pi-cursor-sdk 0.5.3 → 0.5.5

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.
Files changed (141) hide show
  1. package/CHANGELOG.md +61 -1
  2. package/README.md +62 -816
  3. package/dist/context.js +11 -5
  4. package/dist/cursor-agents-context.js +6 -6
  5. package/dist/cursor-api-key.js +1 -1
  6. package/dist/cursor-bridge-contract.js +1 -13
  7. package/dist/cursor-cloud-local-state.js +0 -1
  8. package/dist/cursor-config.js +1 -17
  9. package/dist/cursor-fallback-models.generated.js +424 -1
  10. package/dist/cursor-live-run-coordinator.js +1 -0
  11. package/dist/cursor-local-run-terminal-error.js +57 -0
  12. package/dist/cursor-mcp-timeout-override.js +6 -17
  13. package/dist/cursor-native-tool-display-replay.js +5 -5
  14. package/dist/cursor-native-tools.js +11 -0
  15. package/dist/cursor-pi-tool-bridge-env.js +25 -2
  16. package/dist/cursor-pi-tool-bridge-server.js +98 -48
  17. package/dist/cursor-pi-tool-bridge-snapshot.js +1 -1
  18. package/dist/cursor-pi-tool-bridge.js +4 -12
  19. package/dist/cursor-provider-errors.js +0 -6
  20. package/dist/cursor-provider-live-run-drain.js +8 -3
  21. package/dist/cursor-provider-overflow.js +7 -21
  22. package/dist/cursor-provider-turn-finalize.js +2 -0
  23. package/dist/cursor-provider-turn-prepare.js +8 -1
  24. package/dist/cursor-provider-turn-runner.js +17 -6
  25. package/dist/cursor-provider-turn-send.js +3 -0
  26. package/dist/cursor-provider.js +1 -4
  27. package/dist/cursor-runtime-state.js +3 -3
  28. package/dist/cursor-sdk-event-debug.js +2 -2
  29. package/dist/cursor-sdk-output-filter.js +1 -1
  30. package/dist/cursor-sdk-process-error-guard.js +1 -2
  31. package/dist/cursor-session-agent.js +6 -8
  32. package/dist/cursor-session-scope.js +1 -7
  33. package/dist/cursor-session-store.js +3 -2
  34. package/dist/cursor-state.js +9 -23
  35. package/dist/cursor-tool-lifecycle.js +0 -3
  36. package/dist/cursor-tool-manifest.js +3 -1
  37. package/dist/cursor-tool-presentation-registry.js +2 -4
  38. package/dist/cursor-tool-visibility.js +0 -3
  39. package/dist/cursor-transcript-tool-specs.js +1 -2
  40. package/dist/index.js +21 -0
  41. package/dist/model-discovery.js +0 -1
  42. package/dist/model-list-cache.js +4 -9
  43. package/docs/cursor-live-smoke-checklist.md +4 -4
  44. package/docs/cursor-model-ux-spec.md +18 -8
  45. package/docs/cursor-native-tool-replay.md +2 -2
  46. package/docs/cursor-native-tool-visual-audit.md +1 -1
  47. package/docs/cursor-testing-lessons.md +22 -4
  48. package/docs/cursor-tool-surfaces.md +32 -3
  49. package/docs/development.md +101 -0
  50. package/docs/platform-smoke-implementation.md +3 -2
  51. package/docs/reference.md +810 -0
  52. package/node_modules/@modelcontextprotocol/core/node_modules/zod/package.json +1 -1
  53. package/node_modules/@modelcontextprotocol/core/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
  54. package/node_modules/@modelcontextprotocol/core/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
  55. package/node_modules/@modelcontextprotocol/core/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
  56. package/node_modules/@modelcontextprotocol/core/node_modules/zod/src/v4/core/compile.ts +9 -0
  57. package/node_modules/@modelcontextprotocol/core/node_modules/zod/src/v4/core/schemas.ts +35 -1
  58. package/node_modules/@modelcontextprotocol/core/node_modules/zod/src/v4/core/util.ts +13 -0
  59. package/node_modules/@modelcontextprotocol/core/node_modules/zod/src/v4/core/versions.ts +1 -1
  60. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/compile.cjs +8 -0
  61. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/compile.js +8 -0
  62. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/schemas.cjs +30 -0
  63. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/schemas.d.cts +3 -1
  64. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/schemas.d.ts +3 -1
  65. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/schemas.js +30 -0
  66. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/util.cjs +15 -0
  67. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/util.d.cts +2 -0
  68. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/util.d.ts +2 -0
  69. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/util.js +14 -0
  70. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/versions.cjs +1 -1
  71. package/node_modules/@modelcontextprotocol/core/node_modules/zod/v4/core/versions.js +1 -1
  72. package/node_modules/@modelcontextprotocol/server/node_modules/zod/package.json +1 -1
  73. package/node_modules/@modelcontextprotocol/server/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
  74. package/node_modules/@modelcontextprotocol/server/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
  75. package/node_modules/@modelcontextprotocol/server/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
  76. package/node_modules/@modelcontextprotocol/server/node_modules/zod/src/v4/core/compile.ts +9 -0
  77. package/node_modules/@modelcontextprotocol/server/node_modules/zod/src/v4/core/schemas.ts +35 -1
  78. package/node_modules/@modelcontextprotocol/server/node_modules/zod/src/v4/core/util.ts +13 -0
  79. package/node_modules/@modelcontextprotocol/server/node_modules/zod/src/v4/core/versions.ts +1 -1
  80. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/compile.cjs +8 -0
  81. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/compile.js +8 -0
  82. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/schemas.cjs +30 -0
  83. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/schemas.d.cts +3 -1
  84. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/schemas.d.ts +3 -1
  85. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/schemas.js +30 -0
  86. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/util.cjs +15 -0
  87. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/util.d.cts +2 -0
  88. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/util.d.ts +2 -0
  89. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/util.js +14 -0
  90. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/versions.cjs +1 -1
  91. package/node_modules/@modelcontextprotocol/server/node_modules/zod/v4/core/versions.js +1 -1
  92. package/package.json +14 -6
  93. package/scripts/platform-smoke/artifact-secrets.mjs +13 -4
  94. package/scripts/platform-smoke/local-resume-runner.mjs +0 -1
  95. package/scripts/platform-smoke/target-runtime.mjs +4 -2
  96. package/scripts/platform-smoke/targets.mjs +0 -1
  97. package/scripts/steering-rpc-smoke.mjs +1 -1
  98. package/shared/cursor-sdk-output-filter.d.mts +2 -0
  99. package/shared/cursor-sdk-output-filter.mjs +92 -28
  100. package/shared/cursor-sensitive-text.d.mts +1 -0
  101. package/shared/cursor-sensitive-text.mjs +7 -0
  102. package/src/context.ts +16 -9
  103. package/src/cursor-agents-context.ts +6 -6
  104. package/src/cursor-api-key.ts +1 -1
  105. package/src/cursor-bridge-contract.ts +1 -15
  106. package/src/cursor-cloud-local-state.ts +0 -2
  107. package/src/cursor-config.ts +1 -24
  108. package/src/cursor-fallback-models.generated.ts +424 -1
  109. package/src/cursor-live-run-coordinator.ts +5 -0
  110. package/src/cursor-local-run-terminal-error.ts +58 -0
  111. package/src/cursor-mcp-timeout-override.ts +6 -30
  112. package/src/cursor-native-tool-display-replay.ts +4 -6
  113. package/src/cursor-native-tools.ts +14 -0
  114. package/src/cursor-pi-tool-bridge-env.ts +31 -2
  115. package/src/cursor-pi-tool-bridge-server.ts +89 -45
  116. package/src/cursor-pi-tool-bridge-snapshot.ts +0 -1
  117. package/src/cursor-pi-tool-bridge.ts +2 -18
  118. package/src/cursor-provider-errors.ts +0 -8
  119. package/src/cursor-provider-live-run-drain.ts +8 -2
  120. package/src/cursor-provider-overflow.ts +6 -24
  121. package/src/cursor-provider-turn-finalize.ts +2 -0
  122. package/src/cursor-provider-turn-prepare.ts +10 -1
  123. package/src/cursor-provider-turn-runner.ts +17 -6
  124. package/src/cursor-provider-turn-send.ts +2 -0
  125. package/src/cursor-provider.ts +0 -5
  126. package/src/cursor-runtime-state.ts +3 -3
  127. package/src/cursor-sdk-event-debug.ts +2 -2
  128. package/src/cursor-sdk-output-filter.ts +2 -1
  129. package/src/cursor-sdk-process-error-guard.ts +1 -3
  130. package/src/cursor-session-agent.ts +8 -8
  131. package/src/cursor-session-scope.ts +1 -9
  132. package/src/cursor-session-store.ts +3 -2
  133. package/src/cursor-state.ts +9 -36
  134. package/src/cursor-tool-lifecycle.ts +0 -4
  135. package/src/cursor-tool-manifest.ts +4 -1
  136. package/src/cursor-tool-presentation-registry.ts +3 -5
  137. package/src/cursor-tool-visibility.ts +0 -4
  138. package/src/cursor-transcript-tool-specs.ts +0 -3
  139. package/src/index.ts +18 -0
  140. package/src/model-discovery.ts +0 -1
  141. package/src/model-list-cache.ts +4 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,65 @@
1
1
  # Changelog
2
2
 
3
+ **Release preparation is not a publication receipt:** confirm the exact version, source and artifact integrity in npm/GitHub publication records before relying on availability. No issue is closed by preparation alone.
4
+
5
+ ## 0.5.5
6
+
7
+ ### Fixed
8
+
9
+ - Stop a failed LOCAL Cursor run's shell commands and other native tool processes. SDK 1.0.40 leaves them running after a run fails, for example when it gives up resuming a reset connection, and `Run.cancel()` stops them only while the run is still running. The provider now cancels the run while the SDK records the failure, which the SDK does before it marks the run failed, and still reports the SDK's failure message as a Pi error. A separate SDK error code, when present, is not shown after this cancellation. Explicit Pi aborts and Cloud runs are unchanged (#384).
10
+
11
+ - Upgrade the exact unbundled Cursor SDK and its optional platform packages from 1.0.37 to 1.0.40 for LOCAL Claude-format hook compatibility: the SDK now enables translation of nested `hookSpecificOutput` denial/rewrite output into the fields its tool adapters consume. It also improves Windows command-hook UTF-8 input and native exit-code propagation. This is not a Pi pre-execution hook, universal policy guarantee, or resolution of the original rtk report (#173).
12
+
13
+ - Supply SDK 1.0.40's required Zod peer as a direct exact `zod@4.6.6` runtime dependency, with the bundled MCP bridge's newer nested `4.6.7` copies retained by npm's lockfile. This keeps the peer outside the tarball's bundle and reachable by the unbundled SDK under Pi's `--legacy-peer-deps` installation, without peer auto-installation, overrides or SDK patches (#380). A deduplicated root `4.6.7` copy instead gets bundled and breaks that installation.
14
+
15
+ - Both the SDK's v4/v4-mini parsers and the bridge's v4 parsers now include the bounded-collection fix for [GHSA-mrhx-c7xc-m3w5](https://github.com/advisories/GHSA-mrhx-c7xc-m3w5): array, set and map size bounds are checked before parsing elements. Zod 4.6.7 differs from 4.6.6 only in version metadata. The legacy `zod/v3` implementation is unchanged, and unconstrained collections still validate every element; this is not a universal resource cap or a claim of a demonstrated SDK exploit.
16
+
17
+ - Stop `smoke:steering --self-test` from rebuilding `dist/` before its offline probe. The rebuild briefly removed `dist/` while the concurrent package test packed the checkout, producing an intermittent missing `dist/index.js` failure. Live steering runs still rebuild first (fitchmultz/.github#98).
18
+
19
+ ### Changed
20
+
21
+ - Refresh the fallback catalog from the authenticated SDK 1.0.40 catalog-only observation on 2026-10-31: 49 models, adding DeepSeek V4.1 Flash 1017 (`deepseek-v41-flash-1017`) and recording `cyber=false` on Claude Opus 5.5 variants. All 48 prior model IDs and the 33 bundled checkpoint-derived entries remain; no Agent/model turn or Cloud run was performed.
22
+
23
+ ### Verification and limits
24
+
25
+ - **User-visible rollout:** admitted user/project Claude hooks returning only nested denial/rewrite output can now affect tool execution where SDK 1.0.37 ignored that output; this is an intended behavior change, not just a test-harness repair.
26
+ - Add installed-package contracts for actual Claude settings loading, UTF-8 hook input, nested denial/rewrite, conflicting/mismatched output guards and native exit-2 denial. These use test-only lexical observation, not a production SDK patch, public Agent/backend run or startup canary. Preserve the dated SDK 1.0.37 catalog and older captures at their actual identities; the other original backlog causes remain unqualified and both commit/PR attribution controls remain unavailable.
27
+
28
+ ## 0.5.4
29
+
30
+ ### Fixed
31
+
32
+ - Identify 0.5.4 as the first candidate containing the native-tool opt-out and `/cursor-abort` from #372, and require an exact publication/installation check. Published npm 0.5.3 ignores that flag and lacks the command; a development version label is not proof of enforcement (#368).
33
+ - Keep verified SDK bootstrap output filtered across detached rule/skill work and asynchronous reload gaps with a process-lifetime, versioned sink lease. Preserve unrelated output and expose bounded owner-scoped capability/hook warnings; unknown output is not universally suppressed (#367).
34
+ - Isolate native auth/catalog fixtures from the official host's file-backed startup refresh-admission race. Use matching in-memory catalog state for extension-owned assertions; this is not an official-host startup repair (#357).
35
+ - Skip credential-URL regex scans when required markers are absent, preserving the existing matching/redaction contract, including percent-encoded cases. Inputs containing both markers retain the existing regex behavior; no universal processing bound is claimed (#371).
36
+
37
+ ### Added
38
+
39
+ - Add `/cursor-abort` as an explicit session-scoped release path for a pending local Cursor run after a native-tool policy mismatch. Ordinary mismatch remains restorable and never cancels implicitly; idle Pi abort has no active signal after the error has settled. Explicit active provider abort now also releases its captured scope's old pending run before preparation. Recovery never delivers stale Pi results, automatically sends a replacement turn, releases sibling scopes, or undoes already-executed work.
40
+
41
+ - Add opt-in `PI_CURSOR_NATIVE_TOOLS=0` for MCP-only ordinary LOCAL agents using public SDK `tools: ["mcp"]`, excluding all other main tools including native task/subagents. Capture and forward the same policy for create/resume and split pooled/durable identities only on opt-out, and reject opposite-policy pending-run continuation before delivering Pi results; defaults and text-only summaries are unchanged. Cloud fails closed instead of ignoring the control. Keep Pi builtin exposure explicit, and document that native replay hooks/display flags cannot govern original execution, ambient configured MCP remains unless settings are disabled, and permitted Pi/MCP tools are not a sandbox (#368).
42
+
43
+ - Add `PI_CURSOR_PI_TOOL_BRIDGE_HOST` (`localhost` or the default `127.0.0.1` in the bridge URL) and `PI_CURSOR_PI_TOOL_BRIDGE_PORT` (one port or an inclusive `N-M` range) so a Cursor team MCP allowlist such as `http://localhost:800*/mcp` can admit the pi tool bridge. The default still binds only `127.0.0.1`; opt-in `localhost` now requires owning both explicit loopbacks on the same port before advertising a URL, with partial-startup cleanup and lifetime-stable host policy. Unset settings keep the previous random-port behavior.
44
+
45
+ ### Changed
46
+
47
+ - Refresh the fallback catalog from the authenticated SDK 1.0.37 catalog-only observation on 2026-10-22: 48 models, adding Gemini 4 Argon (`gemini-4-argon`) and Muse Wonder (`muse-wonder-1.0`) while preserving all 46 prior records. Keep the 33 bundled checkpoint-derived entries unchanged; no Agent/model turn or Cloud run was performed.
48
+ - Prefer the currently exposed Pi tool capabilities, schemas and prompt guidelines instead of hardcoded historical MCP/delegation names. Dynamic registry mapping remains unchanged; this is not qualification of the original Windows bridge report (#206).
49
+ - Rewrite the README around installation and everyday use, add a diagram of Cursor inside Pi, and move detailed configuration and maintainer procedures into linked reference pages.
50
+ - Align locked development Pi snapshots and their resolved Pi cohort to 1.1.0 ([#353](https://github.com/fitchmultz/pi-cursor-sdk/pull/353)). This is development-only maintenance, not a user runtime Pi upgrade or a new npm publication. Node 24+, official Pi 0.87.1+, optional wildcard Pi/TypeBox peers, and exact unbundled Cursor SDK 1.0.37 remain unchanged; published 0.5.3 and historical qualification evidence retain their original source/version attribution.
51
+ - Consolidate redundant tests and unused internal exports/wrappers while retaining native, installed-SDK and persistence boundary owners (#360, #363). Improve fixture contracts for user/custom start events without widening runtime APIs (#361). Make installed-SDK bootstrap-printer fixtures select and restore their terminal environment even under `TERM=dumb`, preserving ANSI and confinement assertions.
52
+ - Use the reviewed automatic npm release workflow: an intentional versioned PR merged to main triggers qualification and publication without a new approval step. This candidate does not change publisher policy, authentication, protections or workflow pins (#362).
53
+
54
+ ### Security
55
+
56
+ - Include the development-only Vite 8.3.1 → 8.3.4 lockfile update already merged in #369; no release-time dependency upgrade is added.
57
+
58
+ ### Verification and limits
59
+
60
+ - The native-tool opt-out is the supported LOCAL SDK MCP-only tool surface, not interception of native replay or an OS sandbox. Configured MCP remains unless setting sources are narrowed, and permitted Pi/MCP tools can execute arbitrary work. Defaults and existing LOCAL text-only summary isolation remain unchanged; unsupported Cloud opt-out fails closed. No paid Cloud campaign is part of this release.
61
+ - Runtime/source checks, package controls, catalog metadata, current-host offline CI and publication are distinct evidence. Preserve retained proof at its actual SDK/host/source identity. No original #173 hook rewrite, #206 Windows bridge readiness, #233 embedded loader, #247 idle recovery, #257 model narration or #339 signal-sender resolution is inferred from this candidate.
62
+
3
63
  ## 0.5.3 - 2026-10-07
4
64
 
5
65
  ### Changed
@@ -80,7 +140,7 @@ These changes are carried into 0.5.2; this section does not record a successful
80
140
 
81
141
  ### Breaking Changes
82
142
 
83
- - Bare `ctx.modelRegistry.complete(...)` and `ctx.modelRegistry.streamSimple(...)` calls are unsupported for Cursor models because they lack native session ownership receipts. Custom compaction and other integrations must use the owning AgentSession's stream path or an independent child AgentSession; bind/refresh/reload does not migrate bare calls. See [embedding migration guidance](README.md#embedded-sessions-report-concurrent-cursor-turns).
143
+ - Bare `ctx.modelRegistry.complete(...)` and `ctx.modelRegistry.streamSimple(...)` calls are unsupported for Cursor models because they lack native session ownership receipts. Custom compaction and other integrations must use the owning AgentSession's stream path or an independent child AgentSession; bind/refresh/reload does not migrate bare calls. See [embedding migration guidance](docs/reference.md#embedded-sessions-report-concurrent-cursor-turns).
84
144
 
85
145
  ### Changed
86
146