@rahularya01/pi-cursor 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/README.md +28 -4
- package/dist/index.js +27 -0
- package/package.json +15 -9
- package/src/auth/cli-credentials.ts +0 -168
- package/src/auth/index.ts +0 -10
- package/src/auth/oauth.ts +0 -214
- package/src/client/bridge.ts +0 -206
- package/src/client/cursor-wire.ts +0 -212
- package/src/client/index.ts +0 -19
- package/src/diagnostics/diagnostics.ts +0 -62
- package/src/diagnostics/index.ts +0 -1
- package/src/index.ts +0 -1393
- package/src/models/catalog.json +0 -1163
- package/src/models/index.ts +0 -2
- package/src/proto/agent_pb.ts +0 -15294
- package/src/stream/index.ts +0 -11
- package/src/stream/native-core.ts +0 -5760
- package/src/usage.ts +0 -262
- package/src/utils/index.ts +0 -2
- package/src/utils/security.ts +0 -65
- package/src/utils/util.ts +0 -19
- package/tsconfig.json +0 -21
- /package/{src/client → dist}/h2-bridge.mjs +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.2.0] - 2026-07-23
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Package now ships a bundled, minified `dist/` build (via `tsup`) instead of raw TypeScript source. Unpacked package size dropped ~818 KB → ~222 KB (packed ~154 KB → ~69 KB) by tree-shaking the generated protobuf module (~1000 exports, ~70 used). `main` and `pi.extensions` now point at `./dist/index.js`.
|
|
8
|
+
- `prepare` script builds `dist/` on install, so `git:`-based installs work without a committed build.
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Streaming hot path: the thinking-tag filter regex is compiled once at module load instead of being rebuilt on every streamed chunk.
|
|
13
|
+
|
|
14
|
+
## [1.1.0] - 2026-07-23
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Modular stream surface: `config`, `model-routing`, `context-normalize`, `recovery`, `protocol` extracted from the native runtime.
|
|
19
|
+
- Vitest unit suite covering recovery, model routing, context-mode normalize, consent, protocol framing, and usage formatting.
|
|
20
|
+
- Mid-session token re-resolution when access tokens near expiry (all credential sources).
|
|
21
|
+
- System credential consent opt-out via `PI_CURSOR_SYSTEM_CREDENTIALS=0`.
|
|
22
|
+
- `/cursor.doctor` fields: `clientVersion`, `systemCredentials`, `lastRecoverySkipReason`, protocol/auth hints.
|
|
23
|
+
- Protocol mismatch / auth error message enhancement with actionable hints.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- Tool-continuation recovery prefers full-history rebuild when checkpoints are stale or tool-id mismatched (hard skip only when rebuild is unsafe).
|
|
28
|
+
- OpenAI-compatible local proxy path quarantined (not part of the public `src/stream` export surface).
|
|
29
|
+
- Agent URL resolution validates hosts via the existing allowlist helper.
|
|
30
|
+
- `SECURITY.md` updated for 1.x support and system-credential policy.
|
|
31
|
+
|
|
3
32
|
## [1.0.0] - 2026-07-23
|
|
4
33
|
|
|
5
34
|
### Added
|
package/README.md
CHANGED
|
@@ -57,6 +57,12 @@ If you are logged into the Cursor desktop app or Cursor CLI (`cursor` / `agent`)
|
|
|
57
57
|
|
|
58
58
|
On **WSL (Windows Subsystem for Linux)**, `pi-cursor` automatically scans Windows host user profiles (`/mnt/c/Users/*/AppData/...`) to detect and reuse your Windows Cursor app login.
|
|
59
59
|
|
|
60
|
+
To **opt out** of Keychain / IDE / WSL credential reuse (OAuth or `CURSOR_ACCESS_TOKEN` only):
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
export PI_CURSOR_SYSTEM_CREDENTIALS=0
|
|
64
|
+
```
|
|
65
|
+
|
|
60
66
|
### Deep-link PKCE browser login
|
|
61
67
|
|
|
62
68
|
When no local credentials exist, running `/login cursor` initiates browser sign-in:
|
|
@@ -139,17 +145,35 @@ Pi Coding Agent → streamSimple (cursor-native)
|
|
|
139
145
|
| `PI_CURSOR_AGENT_URL` / `CURSOR_AGENT_URL` | Override agent base URL (default: `https://agentn.us.api5.cursor.sh`). |
|
|
140
146
|
| `CURSOR_ACCESS_TOKEN` | Static access token override. |
|
|
141
147
|
| `PI_CURSOR_CLIENT_VERSION` | Pin `x-cursor-client-version` header sent by the HTTP/2 bridge. |
|
|
148
|
+
| `PI_CURSOR_SYSTEM_CREDENTIALS` | `0`/`false` to disable Keychain/IDE credential reuse (default: allow). |
|
|
142
149
|
| `PI_CURSOR_RAW_MODELS` | Disable effort-suffix model collapse. |
|
|
143
150
|
| `PI_CURSOR_PROVIDER_DEBUG` | Enable JSONL debug logging (`/tmp/pi-cursor-debug.jsonl`). |
|
|
144
151
|
| `CURSOR_USAGE_SESSION_TOKEN` | Optional `WorkosCursorSessionToken` fallback cookie for `/cursor.usage`. |
|
|
145
152
|
| `PI_OFFLINE` | Skip live model discovery on startup. |
|
|
146
153
|
|
|
154
|
+
## Architecture notes
|
|
155
|
+
|
|
156
|
+
Stream modules are split under `src/stream/`:
|
|
157
|
+
|
|
158
|
+
| Module | Responsibility |
|
|
159
|
+
| ---------------------- | --------------------------------------------------- |
|
|
160
|
+
| `config.ts` | Agent URL + client version resolution |
|
|
161
|
+
| `model-routing.ts` | Effort suffix / requested model resolution |
|
|
162
|
+
| `context-normalize.ts` | Context-mode side-channel folding |
|
|
163
|
+
| `recovery.ts` | Tool-continuation recovery planner |
|
|
164
|
+
| `protocol.ts` | Auth/protocol error enhancement |
|
|
165
|
+
| `native-core.ts` | Native streamSimple runtime + (internal) proxy path |
|
|
166
|
+
|
|
167
|
+
The OpenAI-compatible local proxy remains **internal/quarantined** (not exported from `src/stream/index.ts`). Day-to-day chat uses native `streamSimple` only.
|
|
168
|
+
|
|
169
|
+
`src/proto/agent_pb.ts` is a large generated Connect/protobuf surface used by the wire layer. Prefer regenerating it from upstream protos when Cursor changes the agent schema rather than hand-editing.
|
|
170
|
+
|
|
147
171
|
## Troubleshooting
|
|
148
172
|
|
|
149
|
-
- **Not logged in / 401:** Ensure Cursor CLI or app is logged in, or run `/login cursor` again. Check `/cursor.doctor` to verify your `tokenSource`.
|
|
150
|
-
- **Empty / hung stream:** Cursor may have updated wire headers; verify network connectivity or bump `PI_CURSOR_CLIENT_VERSION`.
|
|
151
|
-
- **Tool continuation lost:** Retry the turn or start a new chat
|
|
152
|
-
- **WSL credential detection:** Ensure your Windows user profile folder exists under `/mnt/c/Users/` and is readable from WSL.
|
|
173
|
+
- **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.
|
|
174
|
+
- **Empty / hung stream:** Cursor may have updated wire headers; verify network connectivity or bump `PI_CURSOR_CLIENT_VERSION`. `/cursor.doctor` prints the active `clientVersion`.
|
|
175
|
+
- **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.
|
|
176
|
+
- **WSL credential detection:** Ensure your Windows user profile folder exists under `/mnt/c/Users/` and is readable from WSL. Disable with `PI_CURSOR_SYSTEM_CREDENTIALS=0` if undesired.
|
|
153
177
|
|
|
154
178
|
## Development
|
|
155
179
|
|