{"_id":"@ai-ecoverse/pi-grok","_rev":"4-5f49f372ae140b1703b21e8b41c47a4e","name":"@ai-ecoverse/pi-grok","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@ai-ecoverse/pi-grok","version":"0.1.0","keywords":["pi","grok","xai","ai","extension","provider","grok-build"],"author":{"name":"Lars Trieloff"},"license":"Apache-2.0","_id":"@ai-ecoverse/pi-grok@0.1.0","maintainers":[{"name":"trieloff","email":"lars@trieloff.net"}],"homepage":"https://github.com/ai-ecoverse/pi-grok#readme","bugs":{"url":"https://github.com/ai-ecoverse/pi-grok/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"c5784664456e277350800e485060929bcb65bb6d","tarball":"https://registry.npmjs.org/@ai-ecoverse/pi-grok/-/pi-grok-0.1.0.tgz","fileCount":23,"integrity":"sha512-sS31TavwJcugdDSpKkN6O3gKwVjXuFGB2P3rHg+m7lROJepkWbU2Mrgpr568kT4AuwF6Ka1c96pv+SDg19IJyg==","signatures":[{"sig":"MEQCIFHJNKUvQYfrBT1GEk1JlLugZCLa5lQoOkps3uKK58jUAiANtQNpXVO+aHK6RuengRSovszUfkzYQ29kqEVb04WDyA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57495},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"3f33828fa6d3dd5ae5629f3d8641c5fab8e506c2","scripts":{"dev":"tsc --watch","test":"echo \"No tests yet\"","build":"tsc","prepublishOnly":"rm -rf dist && tsc"},"_npmUser":{"name":"trieloff","email":"lars@trieloff.net"},"repository":{"url":"git+https://github.com/ai-ecoverse/pi-grok.git","type":"git"},"_npmVersion":"11.6.2","description":"Grok Build provider and extension for Pi Coding Agent — registers a `grok-build` model and routes auth through ~/.grok/auth.json (with refresh) or XAI_API_KEY.","directories":{},"_nodeVersion":"25.2.1","dependencies":{"@earendil-works/pi-ai":"^0.74.0","@earendil-works/pi-coding-agent":"^0.74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0","@types/node":"^22.0.0"},"peerDependencies":{"@earendil-works/pi-ai":">=0.74.0","@earendil-works/pi-coding-agent":">=0.74.0"},"_npmOperationalInternal":{"tmp":"tmp/pi-grok_0.1.0_1778891597404_0.25027526057276916","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@ai-ecoverse/pi-grok","version":"0.1.1","keywords":["pi","grok","xai","ai","extension","provider","grok-build"],"author":{"name":"Lars Trieloff"},"license":"Apache-2.0","_id":"@ai-ecoverse/pi-grok@0.1.1","maintainers":[{"name":"trieloff","email":"lars@trieloff.net"}],"homepage":"https://github.com/ai-ecoverse/pi-grok#readme","bugs":{"url":"https://github.com/ai-ecoverse/pi-grok/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"d27a2185279ab3e704cde3331074690c33ff5973","tarball":"https://registry.npmjs.org/@ai-ecoverse/pi-grok/-/pi-grok-0.1.1.tgz","fileCount":23,"integrity":"sha512-KoHxwGJcV92qj0zw6CSg4dqnX1Le7bl8I/BvnuyyLUv+Jb7atqnHx3Z0rbff8Zd/trWii8ixkg3MdnxDMUaBZA==","signatures":[{"sig":"MEUCIQCl/mRAC1Z0ppyUxHWLwTETg9E6+cFMVPoH4briQVlBQAIgU/pgl+nYbPu2TBFAttBaHPB7fjF+//DRUMrzvbQAsS4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ai-ecoverse%2fpi-grok@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":57658},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"991f7e814bfbe8f973956132ee0d05f52a356fac","scripts":{"dev":"tsc --watch","test":"echo \"No tests yet\"","build":"tsc","prepublishOnly":"rm -rf dist && tsc"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d69489f4-5be9-4496-91bd-d450a7d5ed15"}},"repository":{"url":"git+https://github.com/ai-ecoverse/pi-grok.git","type":"git"},"_npmVersion":"11.14.1","description":"Grok Build provider and extension for Pi Coding Agent — registers a `grok-build` model and routes auth through ~/.grok/auth.json (with refresh) or XAI_API_KEY.","directories":{},"_nodeVersion":"24.15.0","dependencies":{"@earendil-works/pi-ai":">=0.74.0","@earendil-works/pi-coding-agent":">=0.74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0","@types/node":"^22.0.0","semantic-release":"25.0.3","@semantic-release/git":"10.0.1","@semantic-release/changelog":"6.0.3"},"peerDependencies":{"@earendil-works/pi-ai":">=0.74.0","@earendil-works/pi-coding-agent":">=0.74.0"},"_npmOperationalInternal":{"tmp":"tmp/pi-grok_0.1.1_1778892018014_0.7740549595231534","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@ai-ecoverse/pi-grok","version":"0.1.2","keywords":["pi","grok","xai","ai","extension","provider","grok-build","deprecated"],"author":{"name":"Lars Trieloff"},"license":"Apache-2.0","_id":"@ai-ecoverse/pi-grok@0.1.2","maintainers":[{"name":"trieloff","email":"lars@trieloff.net"}],"homepage":"https://github.com/stnly/pi-grok#readme","bugs":{"url":"https://github.com/stnly/pi-grok/issues"},"pi":{"extensions":["./src/index.ts"]},"dist":{"shasum":"56fc029ad732b2c1b72352664f045bb62e16e13e","tarball":"https://registry.npmjs.org/@ai-ecoverse/pi-grok/-/pi-grok-0.1.2.tgz","fileCount":23,"integrity":"sha512-3K6UhJmzNxEKjlis6Uzpsz1u/0is58GytIyk3FEKa7nIXV4lkHrFJwyhfFFynn4cBEri+b71UlnlD2paTYBDhQ==","signatures":[{"sig":"MEQCIG09Lh5k29l9fMN0xh0dUGgKJ3rhbX0dNXsFyzONSi6YAiB8uhUK+8KBC251wAO9SHugH65Ev4BAH8J3FB5OZrJhVQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ai-ecoverse%2fpi-grok@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":59997},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"a001a6dd7ef76807afd0389cc960f4f340269a18","scripts":{"dev":"tsc --watch","test":"echo \"No tests yet\"","build":"tsc","prepublishOnly":"rm -rf dist && tsc"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d69489f4-5be9-4496-91bd-d450a7d5ed15"}},"deprecated":"This package (@ai-ecoverse/pi-grok) is deprecated and will receive no further updates. Please migrate to the official stnly/pi-grok extension, which provides native OAuth login, live model discovery, and better xAI Responses API support: https://github.com/stnly/pi-grok","repository":{"url":"git+https://github.com/ai-ecoverse/pi-grok.git","type":"git"},"_npmVersion":"11.14.1","description":"DEPRECATED — Grok Build provider for Pi Coding Agent. This package is no longer maintained. Please migrate to stnly/pi-grok: https://github.com/stnly/pi-grok","directories":{},"_nodeVersion":"24.15.0","dependencies":{"@earendil-works/pi-ai":">=0.74.0","@earendil-works/pi-coding-agent":">=0.74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"6.0.3","@types/node":"25.8.0","semantic-release":"25.0.3","@semantic-release/git":"10.0.1","@semantic-release/changelog":"6.0.3"},"peerDependencies":{"@earendil-works/pi-ai":">=0.74.0","@earendil-works/pi-coding-agent":">=0.74.0"},"_npmOperationalInternal":{"tmp":"tmp/pi-grok_0.1.2_1778956514868_0.072552237140036","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-05-16T00:33:17.311Z","modified":"2026-06-03T10:47:56.676Z","0.1.0":"2026-05-16T00:33:17.568Z","0.1.1":"2026-05-16T00:40:18.167Z","0.1.2":"2026-05-16T18:35:15.006Z"},"bugs":{"url":"https://github.com/stnly/pi-grok/issues"},"author":{"name":"Lars Trieloff"},"license":"Apache-2.0","homepage":"https://github.com/stnly/pi-grok#readme","keywords":["pi","grok","xai","ai","extension","provider","grok-build","deprecated"],"repository":{"url":"git+https://github.com/ai-ecoverse/pi-grok.git","type":"git"},"description":"DEPRECATED — Grok Build provider for Pi Coding Agent. This package is no longer maintained. Please migrate to stnly/pi-grok: https://github.com/stnly/pi-grok","maintainers":[{"email":"lars@trieloff.net","name":"trieloff"},{"email":"karlpauls@gmail.com","name":"karlpauls"}],"readme":"> ⚠️ **DEPRECATED — DO NOT USE**\n>\n> This package (`@ai-ecoverse/pi-grok`) is **deprecated** and will receive **no further updates or security patches**.\n>\n> ## Recommended Replacement\n>\n> Migrate to the official, actively maintained version:\n>\n> - **Repository**: [stnly/pi-grok](https://github.com/stnly/pi-grok)\n> - **Install command**:\n>   ```bash\n>   pi remove npm:@ai-ecoverse/pi-grok\n>   pi install git:github.com/stnly/pi-grok\n>   ```\n>   Then run `/reload` inside pi.\n>\n> ### Why switch?\n>\n> The stnly/pi-grok extension is the **original and recommended** implementation. It offers:\n>\n> - Native OAuth 2.0 + PKCE login flow directly inside pi (`/login`)\n> - Live model discovery — new Grok models appear automatically\n> - Proper payload sanitization for xAI's Responses API (images, reasoning replay, effort levels)\n> - Typed error handling and robust token refresh\n> - Support for the full Grok model lineup (`grok-build`, `grok-4.3`, `grok-4.20-*` reasoning and non-reasoning variants, etc.)\n> - Actively maintained by the original author\n>\n> After installing the new extension, use models like:\n>\n> ```bash\n> pi --model xai-oauth/grok-4.3\n> # or\n> /model xai-oauth/grok-build\n> ```\n>\n> ---\n>\n> # pi-grok (archived)\n\n**Native Grok provider** for the [Pi Coding Agent](https://pi.dev) — **archived**.\n\nThis was a bridge that let users of the Grok Build CLI (`grok` TUI) consume `~/.grok/auth.json` credentials (with refresh) or `XAI_API_KEY` inside pi. It registered a `grok-build` model and overrode auth on the built-in `xai` provider.\n\n**This package is no longer maintained.** The information below is kept for historical reference only.\n\n## Migration (Required)\n\n**This package is deprecated.** To migrate:\n\n1. Remove the old extension:\n   ```bash\n   pi remove npm:@ai-ecoverse/pi-grok\n   ```\n\n2. Install the official replacement:\n   ```bash\n   pi install git:github.com/stnly/pi-grok\n   ```\n\n3. Reload pi:\n   ```bash\n   /reload\n   ```\n\n4. Use the new provider and models, e.g.:\n   ```bash\n   pi --model xai-oauth/grok-4.3\n   # or inside a session:\n   /model xai-oauth/grok-build\n   ```\n\nSee the [stnly/pi-grok README](https://github.com/stnly/pi-grok) for full documentation.\n\n---\n\n## Historical Documentation (Archived)\n\nThe sections below describe how the now-deprecated `@ai-ecoverse/pi-grok` bridge worked. They are kept only for reference.\n\n### Authentication (legacy)\n\nTwo ways to authenticate, picked automatically in this order:\n\n1. **API key in the environment** — set `XAI_API_KEY` (or\n   `GROK_BUILD_API_KEY` for an override that *only* affects this\n   provider). Works with any `xai-…` API key from `console.x.ai`. This\n   is the path to use in containers, CI, slicc, or anywhere\n   `~/.grok/auth.json` is not available.\n\n2. **Grok Build CLI credentials** — `~/.grok/auth.json`, populated by\n   running the `grok` TUI once. The extension reads the OAuth tokens\n   from that file, refreshes them against `https://auth.x.ai/oauth2/token`\n   when they are within 5 min of expiry, and writes the refreshed\n   tokens back atomically so the Grok TUI stays in sync.\n\nRefresh runs lazily on every pi request (uncached `!command` resolver),\nso a long pi session can outlive the 6-hour access-token window without\nintervention.\n\n### Environment variables (legacy)\n\n| Variable               | Purpose                                                      |\n|------------------------|--------------------------------------------------------------|\n| `XAI_API_KEY`          | Plain xAI API key. Used as-is, no refresh.                   |\n| `GROK_BUILD_API_KEY`   | Same as `XAI_API_KEY` but scoped to this provider only.      |\n| `XAI_BASE_URL`         | Override `https://api.x.ai/v1` (e.g. for a proxy).           |\n| `PI_GROK_AUTH_FILE`    | Alternate path to a `grok` auth.json.                        |\n| `PI_GROK_CLIENT_ID`    | Alternate OAuth client id for the refresh request.           |\n\n### Usage (legacy)\n\n```bash\n# Start a session with Grok Build (via the deprecated bridge)\npi --model grok-build\n\n# Or switch model inside a session\n/model grok-build\n```\n\n`grok-build` rejects an explicit `reasoning_effort` parameter, so the\nmodel is registered as non-reasoning. The other xAI models reached via\nthis extension keep pi's built-in reasoning behavior.\n\n### Development (legacy)\n\n```bash\nnpm install\nnpm run build\n```\n\n## License\n\nApache-2.0 (archived package)\n","readmeFilename":"README.md"}