Repository navigation
feat(cursor)!: the host hands over @cursor/sdk through createCursorRuntime - #117
Merged
Merged
Conversation
…ntime
0.19.0 made @cursor/sdk an optional peer that OAR looked up itself, so a
host that forgot the package learned it only at run time, and with
skipLibCheck its compile could not see it. Now the host hands the SDK over:
createCursorRuntime({ sdk: () => import("@cursor/sdk") })
Written in the host's own code, the import fails the host's compile when
the package is missing, checks the SDK's types against CursorSdk, and is
visible to a bundler. The loader runs once, on the first call that needs
the SDK; a failed load is retried.
Cursor leaves the built-in runtimes registry; cursorRuntime, cursorSession
and cursorListModels are replaced by createCursorRuntime. The CLI, the sea
trial and the experiments add cursor to their own registries.
docs/design/capabilities.md gains the rule: a runtime's host-lifetime
settings go to its own constructor (no shared shape), per-session ones
travel with the session keyed by runtime (not built until needed).
The clean install test now checks that the host's line fails to compile
without the SDK (TS2307) and compiles and loads cursor with it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… own SDK Review of #117: - A host loader that threw before returning a promise reset the memo before `??=` stored the failed attempt, so cursor stayed broken for the process. The attempt now yields first; a test covers it. - The installation probe does not look for the package (that would load the SDK); the docs now say what happens when it is missing anyway. - The clean install test removes the host's SDK before installing the CLI and lists cursor's models through the CLI, so the CLI's own dependency on @cursor/sdk is what the check exercises. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
xxchan
added a commit
that referenced
this pull request
Oct 4, 2026
Minor release, breaking for cursor: #117 has the host hand `@cursor/sdk` over with `createCursorRuntime({ sdk: () => import("@cursor/sdk") })`, so a missing package fails the host's compile. Cursor leaves the built-in `runtimes` registry; `cursorRuntime`, `cursorSession` and `cursorListModels` are replaced by `createCursorRuntime`. The `oar` CLI adds cursor itself. Version bump only. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: exe.dev user <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
xxchan
pushed a commit
that referenced
this pull request
Oct 13, 2026
…ctCursorModels projectCursorModels is public but its parameter type was not, so a host had to reach it through CursorSdk. Found in the #117 review. Co-Authored-By: Claude Opus 5.5 <[email protected]>
xxchan
pushed a commit
that referenced
this pull request
Oct 13, 2026
`projectCursorModels` is public, but its parameter type was not exported, so a host had to reach it through `CursorSdk`. Exports it as `CursorModelListItem`. Found in the #117 review. This is also the first OAR PR opened through Stamp (pilot for the server-wide rollout, #all:c9e5adc5). 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- stamp:review:v1 --> --- <a href="https://stamp.build/review?receipt=prc_4a9808324c81ca928b3c6d031b3f8fed"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/view-in-stamp-dark.9763d9f557d0.svg"><img alt="View in Stamp" src="https://stamp.build/assets/brand/view-in-stamp-light.4ac8a43a1d75.svg" width="132" height="28"></picture></a> <sup><img src="https://api.raft.build/api/avatars/pixel/bXVn.svg" width="16" height="16" align="absmiddle" alt=""> <b>Cindy</b> opened this pull request through Stamp</sup> <!-- /stamp:review:v1 --> Co-authored-by: Cindy <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
0.19.0 made
@cursor/sdkan optional peer that OAR looked up itself. A host that forgot the package learned it only at run time, and withskipLibCheck(most projects) its compile could not see it (#core, 2026-10-04).What
skipLibCheck), the SDK's types are checked againstCursorSdk, and a bundler sees it. The loader runs once, on the first call that needs the SDK; a failed load says so and is retried.runtimesregistry.cursorRuntime,cursorSessionandcursorListModelsare replaced bycreateCursorRuntime(CursorRuntime,CursorRuntimeOptions,CursorSdktypes exported).cursorInstallationnow reports by platform only.packages/cli/src/runtimes.ts), the sea trial and experiments (sea-trial/harness/runtimes.ts) add cursor to their own registries; those imports are where this repo's typecheck checks the real SDK againstCursorSdk.docs/design/capabilities.mdgains "A runtime's own settings": host-lifetime settings go to that runtime's own constructor (no shared shape); per-session ones travel with the session keyed by runtime, not built until a real need.Verification
tests/clean-install.ts(CI jobclean-install): without the SDK, every entry point loads and type-checks, built-in runtimes probe, and the host line fails with TS2307; with the SDK, the line compiles and cursor loads through it (listModelsreaches the SDK); the CLI lists and probes cursor.oar run cursor --model gpt-5.4-nanothrough the CLI's loader answered and completed the turn;oar models cursorlisted the catalog.🤖 Generated with Claude Code