Skip to content

feat(cursor)!: the host hands over @cursor/sdk through createCursorRuntime - #117

Merged
xxchan merged 2 commits into
mainfrom
feat/create-cursor-runtime
Oct 4, 2026
Merged

xxchan merged 2 commits into
mainfrom
feat/create-cursor-runtime

Conversation

@xxchan

@xxchan xxchan commented Oct 4, 2026

Copy link
Copy Markdown
Member

Why

0.19.0 made @cursor/sdk an optional peer that OAR looked up itself. A host that forgot the package learned it only at run time, and with skipLibCheck (most projects) its compile could not see it (#core, 2026-10-04).

What

import { createCursorRuntime, createRuntimeRegistry, runtimes } from "@botiverse/oar";

const registry = createRuntimeRegistry([
  ...runtimes.list(),
  createCursorRuntime({ sdk: () => import("@cursor/sdk") }),
]);
  • The import sits in the host's code: a missing package is a compile error there (TS2307, not hidden by skipLibCheck), the SDK's types are checked against CursorSdk, 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.
  • Breaking: cursor leaves the built-in runtimes registry. cursorRuntime, cursorSession and cursorListModels are replaced by createCursorRuntime (CursorRuntime, CursorRuntimeOptions, CursorSdk types exported). cursorInstallation now reports by platform only.
  • The CLI (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 against CursorSdk.
  • docs/design/capabilities.md gains "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

  • typecheck, lint, full vitest suite (597 passed).
  • tests/clean-install.ts (CI job clean-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 (listModels reaches the SDK); the CLI lists and probes cursor.
  • Live: oar run cursor --model gpt-5.4-nano through the CLI's loader answered and completed the turn; oar models cursor listed the catalog.

🤖 Generated with Claude Code

exe.dev user and others added 2 commits October 4, 2026 05:43
…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]>
@xxchan
xxchan merged commit 0621a5f into main Oct 4, 2026
13 checks passed
@xxchan
xxchan deleted the feat/create-cursor-runtime branch October 4, 2026 05:55
@xxchan xxchan mentioned this pull request Oct 4, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant