{"_id":"@0reki/pi-cursor","name":"@0reki/pi-cursor","dist-tags":{"latest":"1.4.27"},"versions":{"1.4.27":{"name":"@0reki/pi-cursor","version":"1.4.27","description":"Native Cursor provider for Pi Coding Agent (OAuth + Connect/protobuf streamSimple)","author":{"name":"Rahul Arya"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Rahularya01/pi-cursor.git"},"homepage":"https://github.com/Rahularya01/pi-cursor#readme","funding":{"type":"github","url":"https://github.com/sponsors/Rahularya01"},"bugs":{"url":"https://github.com/Rahularya01/pi-cursor/issues"},"type":"module","main":"./dist/index.js","engines":{"node":">=22.19.0"},"keywords":["pi-package","pi-extension","cursor","oauth","provider"],"scripts":{"build":"tsup","prepare":"npm run build","prepublishOnly":"npm run build","typecheck":"tsc --noEmit","lint":"eslint src tests","lint:fix":"eslint src tests --fix","format":"prettier --write .","format:check":"prettier --check .","security-check":"tsx scripts/security-check.ts","proto:gen":"buf generate","proto:sync":"tsx scripts/proto-sync.ts","proto:check":"tsx scripts/proto-check.ts","test":"vitest run","test:coverage":"vitest run --coverage","test:watch":"vitest","test:legacy":"tsx scripts/test-model-routing.ts && tsx scripts/test-thinking-levels.ts && tsx scripts/test-usage.ts && tsx scripts/test-context-mode-normalize.ts && tsx scripts/test-cli-auth.ts","smoke:auth":"node --import tsx scripts/smoke-auth.mjs","smoke:models":"node --import tsx scripts/smoke-models.mjs","smoke:stream":"node --import tsx scripts/smoke-stream.mjs","smoke:wire":"node --import tsx scripts/smoke-wire.mjs","check":"npm run typecheck && npm run lint && npm run format:check && npm run security-check && npm run proto:check && npm test && npm run test:legacy"},"pi":{"extensions":["./dist/index.js"]},"dependencies":{"@bufbuild/protobuf":"^2.0.0"},"peerDependencies":{"@earendil-works/pi-ai":">=0.80.0","@earendil-works/pi-coding-agent":">=0.80.0"},"devDependencies":{"@bufbuild/buf":"^1.72.0","@bufbuild/protoc-gen-es":"^2.13.0","@eslint/js":"^10.0.1","@types/node":"^26.1.1","@vitest/coverage-v8":"^3.2.4","eslint":"^10.7.0","eslint-config-prettier":"^10.1.8","globals":"^17.7.0","prettier":"^3.9.5","tsup":"^8.5.1","tsx":"^4.23.1","typescript":"^6.0.3","typescript-eslint":"^8.64.0","vitest":"^3.2.4"},"gitHead":"ed6aa0f4042c78a99204cdcaa39f84895e820a28","_id":"@0reki/pi-cursor@1.4.27","_nodeVersion":"26.7.0","_npmVersion":"12.0.2","dist":{"integrity":"sha512-OPpvJiMULT7GJGB/CrQheLWzxr+AWR9qxVia5R1ZR3IoS0ESE3wTtERYJmvj3vSY892jpAiK/DmsNYhAEx32/w==","shasum":"396250f720a3918627af8630d1342945a3b5bc1d","tarball":"https://registry.npmjs.org/@0reki/pi-cursor/-/pi-cursor-1.4.27.tgz","fileCount":6,"unpackedSize":342915,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIET9UiJtshUS9FU0BqbgcMx54FBZmXWaRH6CMNDMlIzgAiAUXFqReLeToq/N9c2kPZCM0A3zoUy55UngaL0EDvQOTQ=="}]},"_npmUser":{"name":"0reki","email":"svip0871@gmail.com"},"directories":{},"maintainers":[{"name":"0reki","email":"svip0871@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-cursor_1.4.27_1787989546364_0.4625653302981465"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-29T07:45:46.153Z","1.4.27":"2026-08-29T07:45:46.511Z","modified":"2026-08-29T07:45:46.725Z"},"maintainers":[{"name":"0reki","email":"svip0871@gmail.com"}],"description":"Native Cursor provider for Pi Coding Agent (OAuth + Connect/protobuf streamSimple)","homepage":"https://github.com/Rahularya01/pi-cursor#readme","keywords":["pi-package","pi-extension","cursor","oauth","provider"],"repository":{"type":"git","url":"git+https://github.com/Rahularya01/pi-cursor.git"},"author":{"name":"Rahul Arya"},"bugs":{"url":"https://github.com/Rahularya01/pi-cursor/issues"},"license":"MIT","readme":"# @rahularya01/pi-cursor\n\n[![npm version](https://img.shields.io/npm/v/@rahularya01/pi-cursor?logo=npm)](https://www.npmjs.com/package/@rahularya01/pi-cursor)\n[![license](https://img.shields.io/npm/l/@rahularya01/pi-cursor)](LICENSE)\n[![Sponsor](https://img.shields.io/badge/Sponsor-GitHub-ea4aaa?logo=github)](https://github.com/sponsors/Rahularya01)\n\nUse your **Cursor** subscription's models — Composer, Claude, GPT, Grok — inside the **Pi Coding Agent**.\n`pi-cursor` plugs in a `cursor` model provider that talks to Cursor's own backend directly (native\nConnect/protobuf streaming over HTTP/2), so there's no separate API key to buy and no Cursor CLI\nprocess running in the background for every chat turn. If you're already logged into Cursor's app\nor CLI, it just works — no setup beyond installing the package.\n\n> **Unofficial integration.** This project is not affiliated with or endorsed by Cursor / Anysphere. It uses reverse-engineered wire protocol details shared by community clients (see [Attributions](#attributions)). Use it only with an account you are authorized to access, and review its source before granting OAuth permissions. Cursor may change wire protocol endpoints or formats at any time.\n\n## Contents\n\n- [Requirements](#requirements)\n- [Install](#install)\n- [Quick start](#quick-start)\n- [Authentication](#authentication-and-resolution-cascade)\n- [Commands](#commands)\n- [Models & reasoning effort](#models-and-reasoning-effort-routing)\n- [Usage dashboard](#usage-quota-and-visual-tui-dashboard)\n- [Troubleshooting](#troubleshooting)\n- [Configuration (advanced)](#configuration)\n- [Architecture (advanced)](#architecture--wire-protocol)\n- [Development](#development)\n\n## Requirements\n\n|                             |                                                                                       |\n| --------------------------- | ------------------------------------------------------------------------------------- |\n| **Pi Coding Agent / Pi AI** | version `0.80.0` or later                                                             |\n| **Node.js**                 | version `22.19.0` or later (needed for native HTTP/2 streaming and credential lookup) |\n| **A Cursor account**        | with model access — signed in via the Cursor app, Cursor CLI, or browser login below  |\n\n## Install\n\n```bash\npi install npm:@rahularya01/pi-cursor\n```\n\nThen **restart Pi** (or run `/reload`) so the new provider is picked up.\n\n<details>\n<summary>Other install options</summary>\n\nInstall the latest code straight from GitHub instead of npm:\n\n```bash\npi install git:github.com/Rahularya01/pi-cursor\n```\n\nTo update later:\n\n```bash\npi update npm:@rahularya01/pi-cursor\n```\n\n</details>\n\n## Quick start\n\n1. **Sign in.** If Cursor's desktop app or CLI (`cursor` / `agent`) is already logged in on this\n   machine, `pi-cursor` detects it automatically — skip to step 2. Otherwise, run:\n\n   ```text\n   /login cursor\n   ```\n\n   This opens a browser tab to sign in with your Cursor account.\n\n2. **Pick a model:**\n\n   ```text\n   /model cursor/composer-2\n   ```\n\n3. **Start chatting.** If anything looks off, run `/cursor.doctor` — it prints which credential\n   source is active, the current endpoint, and the last error, and is the first thing to check\n   before filing an issue.\n\n## Authentication and resolution cascade\n\n`pi-cursor` automatically resolves credentials using a 4-tier cascade:\n\n```text\n1. CURSOR_ACCESS_TOKEN environment variable\n2. Pi OAuth credentials store (~/.pi/agent/auth.json via /login cursor)\n3. Cursor CLI credentials in macOS Keychain (cursor-access-token / cursor-refresh-token)\n4. Cursor IDE local state DB (globalStorage/state.vscdb on macOS, Windows, Linux, or WSL)\n```\n\n`/login cursor` is preferred over Keychain/IDE harvest so an explicit Pi login is not silently overridden by another Cursor app account on the machine.\n\n### Automatic CLI & IDE login detection\n\nIf you are logged into the Cursor desktop app or Cursor CLI (`cursor` / `agent`), `pi-cursor` automatically extracts your session credentials so you can start chatting immediately without manual browser login.\n\nOn **WSL (Windows Subsystem for Linux)**, `pi-cursor` reuses the **current** Windows user's Cursor IDE login (`USERPROFILE` / `USERNAME` → `/mnt/c/Users/<you>/AppData/...`). It does not scan other Windows profiles.\n\nTo **opt out** of Keychain / IDE / WSL credential reuse (OAuth or `CURSOR_ACCESS_TOKEN` only):\n\n```bash\nexport PI_CURSOR_SYSTEM_CREDENTIALS=0\n```\n\n### Deep-link PKCE browser login\n\nWhen no local credentials exist, running `/login cursor` initiates browser sign-in:\n\n1. `/login cursor` opens `https://cursor.com/loginDeepControl?...`\n2. Pi polls `https://api2.cursor.sh/auth/poll` until authentication completes.\n3. Access and refresh tokens are stored in Pi's auth store (`~/.pi/agent/auth.json`).\n4. Tokens are automatically refreshed via `https://api2.cursor.sh/auth/exchange_user_api_key`.\n\nUse `/cursor.doctor` to inspect which source is active (`tokenSource=cli_keychain`, `tokenSource=ide_vscdb`, `tokenSource=pi_oauth`, `tokenSource=env`).\n\n## Commands\n\n| Command              | Description                                                                                      |\n| -------------------- | ------------------------------------------------------------------------------------------------ |\n| `/login cursor`      | Sign in to Cursor via browser PKCE and refresh the live model catalog.                           |\n| `/model cursor/<id>` | Choose a registered Cursor model.                                                                |\n| `/cursor.models`     | List active runtime models, context windows, and effort capabilities.                            |\n| `/cursor.models all` | Include tab/chat internal model variants normally hidden from the picker.                        |\n| `/cursor.usage`      | Display visual TUI usage dashboard (included/auto/API quota bars, reset dates, on-demand spend). |\n| `/cursor.doctor`     | Show sanitized provider diagnostics, active token source, endpoint, and last error.              |\n\n## Models and reasoning effort routing\n\n`pi-cursor` discovers live account models via `GetUsableModels` and parameterized metadata. Reasoning effort levels (`off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`) are mapped directly to Cursor's runtime model variants or reasoning parameters.\n\n| Public model ID          | Context | Thinking | Description / Routing                                      |\n| ------------------------ | ------- | -------- | ---------------------------------------------------------- |\n| `cursor/composer-2`      | 200,000 | Yes      | Cursor's agentic model with fast reasoning effort options. |\n| `cursor/composer-1.5`    | 200,000 | Yes      | Fast agent model optimized for code edit turns.            |\n| `cursor/claude-sonnet-5` | 200,000 | Yes      | Anthropic Claude Sonnet via Cursor infrastructure.         |\n| `cursor/gpt-5.5`         | 200,000 | Yes      | OpenAI flagship model with parameterized reasoning levels. |\n| `cursor/grok-4.5`        | 200,000 | Yes      | xAI Grok model via Cursor infrastructure.                  |\n\nTo restrict which models Pi displays, configure `~/.pi/agent/settings.json`:\n\n```json\n{\n  \"enabledModels\": [\"cursor/composer-2\", \"cursor/claude-sonnet-5\", \"cursor/gpt-5.5\"]\n}\n```\n\n## Usage quota and visual TUI dashboard\n\nRunning `/cursor.usage` displays a formatted terminal interface showing your current billing cycle, progress bars for included plan quota, auto/API usage, reset dates, and on-demand spend:\n\n```text\nUsage • Pro                                           Resets 5 Aug\nMonthly plan and on-demand usage\n\nCategory        Current          Usage\nIncluded        13% used         ███░░░░░░░░░░░░░░░░░\n  Auto          12% used         ███░░░░░░░░░░░░░░░░░\n  API           14% used         ███░░░░░░░░░░░░░░░░░\nOn-Demand       Disabled\n------------------------------------------------------------\nOn-demand usage is off\n\nView in dashboard: cursor.com/dashboard?tab=usage\n```\n\nUsage statistics are fetched directly from Cursor's native Connect period usage endpoint (`POST https://api2.cursor.sh/aiserver.v1.DashboardService/GetCurrentPeriodUsage`) using your active access token, with optional fallback to `CURSOR_USAGE_SESSION_TOKEN`.\n\n## Architecture & Wire Protocol\n\n> The rest of this README is reference material for troubleshooting, tuning, and contributing —\n> nothing here is required for day-to-day use.\n\n```text\nPi Coding Agent  →  streamSimple (cursor-native)\n                      → h2-bridge.mjs (Node.js HTTP/2 child process)\n                      → agent.v1.AgentService/Run (Connect + Protobuf over HTTP/2)\n```\n\n- **Transport:** Native Connect/protobuf streaming over HTTP/2 via `h2-bridge.mjs`.\n- **Infrastructure Context Normalization:** Side-channel user messages (context-mode routing, post-compaction `<session_state>`, and explicit `[pi-lens automated … not a user request]` notices) are safely normalized into the system prompt so Cursor models stay focused on your primary task.\n- **Context-Efficient Tools:** MCP schemas are compacted without changing callable constraints, and exact conversational-only turns (`hi`, `thanks`, etc.) omit tools entirely. Actionable prompts always retain tools.\n- **Cross-Platform:** Tested and fully compatible with macOS, Linux, Windows, and WSL.\n\n## Configuration\n\nEverything below is optional — `pi-cursor` works out of the box. These environment variables exist\nfor tuning timeouts, debugging, and edge-case overrides.\n\n<details>\n<summary><strong>Full environment variable reference</strong></summary>\n\n| Variable                                   | Purpose                                                                                                                                                                                                                                                                                                                                                                                                              |\n| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `PI_CURSOR_AGENT_URL` / `CURSOR_AGENT_URL` | Override agent base URL (default: `https://agentn.us.api5.cursor.sh`).                                                                                                                                                                                                                                                                                                                                               |\n| `CURSOR_ACCESS_TOKEN`                      | Static access token override.                                                                                                                                                                                                                                                                                                                                                                                        |\n| `PI_CURSOR_CLIENT_VERSION`                 | Pin `x-cursor-client-version` header sent by the HTTP/2 bridge.                                                                                                                                                                                                                                                                                                                                                      |\n| `PI_CURSOR_SYSTEM_CREDENTIALS`             | `0`/`false` to disable Keychain/IDE credential reuse (default: allow).                                                                                                                                                                                                                                                                                                                                               |\n| `PI_CURSOR_RAW_MODELS`                     | Disable effort-suffix model collapse.                                                                                                                                                                                                                                                                                                                                                                                |\n| `PI_CURSOR_PROVIDER_DEBUG`                 | Enable verbose JSONL debug logging.                                                                                                                                                                                                                                                                                                                                                                                  |\n| `PI_CURSOR_LIFECYCLE_LOG`                  | Always-on compact lifecycle log path (default: `$TMPDIR/pi-cursor-lifecycle.jsonl`).                                                                                                                                                                                                                                                                                                                                 |\n| `CURSOR_USAGE_SESSION_TOKEN`               | Optional `WorkosCursorSessionToken` fallback cookie for `/cursor.usage`.                                                                                                                                                                                                                                                                                                                                             |\n| `PI_OFFLINE`                               | Skip live model discovery entirely; always use the bundled fallback catalog.                                                                                                                                                                                                                                                                                                                                         |\n| `PI_CURSOR_CACHE_DIR`                      | Where the model catalog and refresh back-off are cached (default: `$XDG_CACHE_HOME/pi-cursor` or `~/.cache/pi-cursor`). Delete it to force a full rediscovery.                                                                                                                                                                                                                                                       |\n| `PI_CURSOR_UNARY_BRIDGE`                   | `1` forces unary RPCs (model discovery) through the h2-bridge subprocess instead of the in-process HTTP/2 client. Diagnostic escape hatch.                                                                                                                                                                                                                                                                           |\n| `PI_CURSOR_STREAM_IDLE_TIMEOUT_MS`         | Silence safety net: ms with **no upstream work** before recover/retry/error. **Default `180000` (3 min)**; `0` disables (turns run unbounded). Text/thinking/token deltas, tool-call events, and answered execs/queries reset it; heartbeats only prove the socket and do not hide an unanswered exec. It is paused during tool execution. On timeout, recovery continues from checkpoint even after partial output. |\n| `PI_CURSOR_RESUME_IDLE_TIMEOUT_MS`         | Same silence safety net after tool-result resume. **Default `180000` (3 min)**; `0` disables.                                                                                                                                                                                                                                                                                                                        |\n| `PI_CURSOR_STREAM_IDLE_MAX_RETRIES`        | Auto-recovery attempts after silence/transport loss. Blind restart is skipped once text/thinking streamed unless a checkpoint is available for continuation. **Default `5`**; `0` disables.                                                                                                                                                                                                                          |\n| `PI_CURSOR_ACTIVE_BRIDGE_TTL_MS`           | How long a mid-tool bridge stays parked waiting for tool results (default: 1 hour).                                                                                                                                                                                                                                                                                                                                  |\n| `PI_CURSOR_H2_CONNECT_TIMEOUT_MS`          | h2-bridge initial connect kill (default: `30000`; `0` disables).                                                                                                                                                                                                                                                                                                                                                     |\n| `PI_CURSOR_H2_IDLE_TIMEOUT_MS`             | h2-bridge activity idle kill. **Default `0` (disabled)**. Parent heartbeats reset it when enabled.                                                                                                                                                                                                                                                                                                                   |\n| `PI_CURSOR_SLIM_TOOLS`                     | Compact Cursor MCP tool definitions: concise function purpose, no annotation-only parameter prose, full callable schema constraints preserved. **Default on**; set `0`/`false` for verbatim schemas.                                                                                                                                                                                                                 |\n| `PI_CURSOR_MIDPAUSE_REBUILD_MAX_AGE_MS`    | Max age of mid-pause metadata used for full-history rebuild (default: 15 min).                                                                                                                                                                                                                                                                                                                                       |\n| `PI_CURSOR_PROMPT_HISTORY`                 | Publish the system prompt and completed turns as Cursor prompt messages when a request is built without an upstream checkpoint. **Default on**; `0`/`false` restores the pre-1.4.24 behavior, where a rebuilt conversation reached the model with no history and no Pi system prompt.                                                                                                                                |\n\n</details>\n\n## Architecture notes\n\n<details>\n<summary><strong>Module layout (<code>src/stream/</code>)</strong></summary>\n\nStream modules are split under `src/stream/`:\n\n| Module                 | Responsibility                                                        |\n| ---------------------- | --------------------------------------------------------------------- |\n| `types.ts`             | Shared structural types (no runtime code — safe for anyone to import) |\n| `config.ts`            | Agent URL + client version resolution                                 |\n| `tuning.ts`            | Timeouts, retry budgets, and the stream idle watchdog                 |\n| `debug-log.ts`         | Debug / lifecycle / metric sinks with secret redaction                |\n| `images.ts`            | Image decode + Cursor CLI format and size validation                  |\n| `model-routing.ts`     | Effort suffix / requested model resolution                            |\n| `model-discovery.ts`   | `GetUsableModels` unary RPCs + per-token model cache                  |\n| `model-cache.ts`       | Cross-process catalog cache read synchronously at startup             |\n| `context-normalize.ts` | Context-mode side-channel folding                                     |\n| `message-parsing.ts`   | Pi/OpenAI message list → Cursor turn structures                       |\n| `pi-adapter.ts`        | Pi context/model types ↔ OpenAI-shaped request, usage accounting      |\n| `request-build.ts`     | `AgentRunRequest` protobuf construction + blob store                  |\n| `bridge-session.ts`    | Active-bridge registry + h2-bridge lifecycle                          |\n| `session-state.ts`     | Conversation store, checkpoints, key derivation, session locks        |\n| `server-messages.ts`   | Inbound KV / exec / interaction dispatch                              |\n| `thinking-filter.ts`   | Strips inline `<think>`-style tags from the text channel              |\n| `recovery.ts`          | Tool-continuation recovery planner                                    |\n| `protocol.ts`          | Auth/protocol error enhancement                                       |\n| `drift.ts`             | Wire-drift detection (unknown message cases and protobuf fields)      |\n| `native-core.ts`       | Native streamSimple runtime that drives all of the above              |\n\nNative `streamSimple` is the only chat path. The OpenAI-compatible local proxy that\nused to sit alongside it was removed in favour of a single code path.\n\n### Startup\n\nExtension activation does no network and no credential lookup. Models are registered\nsynchronously from the persisted catalog (`PI_CURSOR_CACHE_DIR`), falling back to the\ncatalog bundled in `src/models/catalog.json` on a first-ever launch. Live discovery runs\nthrough pi's `refreshModels` hook — off the critical path, in the background, and again\nwhenever `/model` is opened — then persists its result for the next launch.\n\nUnary RPCs (both discovery calls) use an in-process `node:http2` client. The h2-bridge\nsubprocess is still used for the bidirectional chat stream, where Bun's `node:http2` is\nunusable, and remains the automatic fallback if the in-process client fails.\n\n`src/proto/agent_pb.ts` is a large generated Connect/protobuf surface used by the wire\nlayer. Never hand-edit it — regenerate with `npm run proto:gen` (see\n[`proto/README.md`](proto/README.md)) when Cursor changes the agent schema.\n\n</details>\n\n## Troubleshooting\n\n- **`No API provider registered for api: cursor-native`:** Update to the latest `pi-cursor` (`pi update npm:@rahularya01/pi-cursor`) and restart Pi (or `/reload`). This means the Agent tried to stream via Pi's global `streamSimple` dispatcher before the Cursor transport was registered there. Current builds register `cursor-native` on that registry during extension load.\n- **Not logged in / 401:** Ensure Cursor CLI or app is logged in, or run `/login cursor` again. Check `/cursor.doctor` to verify your `tokenSource`. Tokens from CLI/IDE are re-resolved when near expiry; idle stream retries also force-refresh credentials.\n- **Empty / hung stream:** Cursor may have updated wire headers; verify network connectivity or bump `PI_CURSOR_CLIENT_VERSION`. `/cursor.doctor` prints the active `clientVersion`.\n- **Wire-protocol drift:** Cursor can change `agent.v1` at any time. Unrecognized server messages and unknown protobuf fields are no longer skipped silently — they are counted, written to the lifecycle log as `wire_drift`, appended to the failing turn's error message, and listed by `/cursor.doctor` under `wireDrift`. `wireDriftStranding=yes` means an unanswered message could have parked the turn, which is the difference between \"our schema is a bit behind\" and \"this is why it hung\". Run `CURSOR_ACCESS_TOKEN=... npm run smoke:wire` to check the handshake and schema against the live endpoint without starting a chat turn, then see [`proto/README.md`](proto/README.md) to resync the schema.\n- **Stuck / dies after a few minutes of work:** Cursor `InteractionQuery` prompts are answered so the stream does not park. Web/search and unnamed proto fields are rejected (use Pi tools instead). Inspect `$TMPDIR/pi-cursor-lifecycle.jsonl` for `interaction_query` / `bridge_close` events, and `/cursor.doctor` for `lastStreamEvent`. Full debug: `PI_CURSOR_PROVIDER_DEBUG=1`.\n- **Tool continuation lost:** The provider now prefers full-history rebuild when checkpoints are stale/mismatched. If recovery still skips, `/cursor.doctor` shows `lastRecoverySkipReason`. Retry the turn or start a new chat.\n- **WSL credential detection:** Set `USERPROFILE` or `USERNAME` so the Windows home directory is known, and ensure `/mnt/c/Users/<you>/AppData/...` is readable. Disable with `PI_CURSOR_SYSTEM_CREDENTIALS=0` if undesired.\n- **Slow startup:** Activation should be a few milliseconds. `/cursor.doctor` reports `catalogCache` (`none(using bundled fallback)` means every launch is starting cold — check that `catalogCacheDir` is writable) and `unaryTransport`. A stale Cursor CLI keychain entry no longer blocks startup: a refresh token that fails is remembered for 10 minutes so it is not retried on the next launch, and any valid locally stored token is always preferred over a network exchange.\n- **Model list looks stale:** It is the last successfully discovered catalog. Open `/model` to trigger a background refresh, or delete `PI_CURSOR_CACHE_DIR` to force full rediscovery.\n\n## Development\n\n```bash\nnpm install\nnpm run check\n```\n\n`npm run check` runs TypeScript typechecking, ESLint, Prettier format verification, security checks, the protobuf staleness check, and unit tests.\n\n| Script                | Purpose                                                                           |\n| --------------------- | --------------------------------------------------------------------------------- |\n| `npm run proto:gen`   | Regenerate `src/proto/agent_pb.ts` from `proto/agent.proto`.                      |\n| `npm run proto:sync`  | Rebuild `proto/agent.proto` from an updated generated file obtained upstream.     |\n| `npm run proto:check` | Fail if the generated protobuf is stale or hand-edited (part of `npm run check`). |\n\n## Attributions\n\nWire protocol and authentication patterns adapted from MIT community client lineage:\n\n- [ephraimduncan/opencode-cursor](https://github.com/ephraimduncan/opencode-cursor)\n- [@pi-stef/cursor](https://www.npmjs.com/package/@pi-stef/cursor)\n\nPackage structure mirrors [pi-antigravity](https://github.com/Rahularya01/pi-antigravity).\n\n## Support the project\n\nIf `pi-cursor` is useful to you, consider [sponsoring the project on GitHub](https://github.com/sponsors/Rahularya01).\n\n## License\n\n[MIT](LICENSE)\n","readmeFilename":"README.md","_rev":"1-a9c5f5f8dadce0e5a171381c453f0d89"}