@cursor/july 0.1.89 → 0.1.90

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 (165) hide show
  1. package/README.md +95 -94
  2. package/dist/ab.d.ts +1 -1
  3. package/dist/ab.js +1 -1
  4. package/dist/artifacts.d.ts +1 -1
  5. package/dist/artifacts.js +1 -1
  6. package/dist/bin/agent-serve.js +20 -7
  7. package/dist/channels.d.ts +1 -1
  8. package/dist/channels.js +1 -1
  9. package/dist/connections.d.ts +1 -1
  10. package/dist/connections.js +1 -1
  11. package/dist/docs/404.html +2 -2
  12. package/dist/docs/ab.html +3 -3
  13. package/dist/docs/assets/{app.DUOPbN18.js → app.wiNkt6G7.js} +1 -1
  14. package/dist/docs/assets/chunks/@localSearchIndexroot.FV0R6kOb.js +1 -0
  15. package/dist/docs/assets/chunks/{VPLocalSearchBox.CmWbGcGk.js → VPLocalSearchBox.ByhUGu47.js} +1 -1
  16. package/dist/docs/assets/chunks/{theme.S57OeOLA.js → theme.Dx7j_-0n.js} +2 -2
  17. package/dist/docs/assets/{concepts.md.BXAm6G-C.js → concepts.md.2NfkGjqM.js} +1 -1
  18. package/dist/docs/assets/{reference_project-layout.md.D3MdHM2z.js → reference_project-layout.md.CueaKpjr.js} +5 -20
  19. package/dist/docs/assets/reference_project-layout.md.CueaKpjr.lean.js +1 -0
  20. package/dist/docs/assets/{reference_tools.md.DTg_kEsx.js → reference_tools.md.XmeFP_3d.js} +23 -2
  21. package/dist/docs/assets/{reference_tools.md.DTg_kEsx.lean.js → reference_tools.md.XmeFP_3d.lean.js} +1 -1
  22. package/dist/docs/assets/{scaffolding-agents.md.CiGsJ1aw.js → scaffolding-agents.md.BpMFXv2J.js} +1 -1
  23. package/dist/docs/building-with-agents.html +3 -3
  24. package/dist/docs/concepts.html +5 -5
  25. package/dist/docs/deployment.html +3 -3
  26. package/dist/docs/evals.html +3 -3
  27. package/dist/docs/example-agents/approval-buddy.html +3 -3
  28. package/dist/docs/example-agents/benny.html +3 -3
  29. package/dist/docs/example-agents/bugbot.html +3 -3
  30. package/dist/docs/example-agents/codebase-wiki.html +3 -3
  31. package/dist/docs/example-agents/codeowners-review.html +3 -3
  32. package/dist/docs/example-agents/concierge.html +3 -3
  33. package/dist/docs/example-agents/fsd.html +3 -3
  34. package/dist/docs/example-agents/index.html +3 -3
  35. package/dist/docs/example-agents/knowledge-base.html +3 -3
  36. package/dist/docs/example-agents/oncall.html +3 -3
  37. package/dist/docs/example-agents/security-reviewer.html +3 -3
  38. package/dist/docs/example-agents/slack-agent.html +3 -3
  39. package/dist/docs/example-agents/weather-agent.html +3 -3
  40. package/dist/docs/guides/agent-to-agent.html +3 -3
  41. package/dist/docs/guides/cloud-runtime.html +3 -3
  42. package/dist/docs/guides/convert-automation.html +3 -3
  43. package/dist/docs/guides/github.html +3 -3
  44. package/dist/docs/guides/human-in-the-loop.html +3 -3
  45. package/dist/docs/guides/mcp-oauth.html +3 -3
  46. package/dist/docs/guides/opentelemetry.html +3 -3
  47. package/dist/docs/guides/slack.html +3 -3
  48. package/dist/docs/guides/webhooks.html +3 -3
  49. package/dist/docs/hashmap.json +1 -1
  50. package/dist/docs/hillclimbing.html +3 -3
  51. package/dist/docs/index.html +3 -3
  52. package/dist/docs/quickstart.html +3 -3
  53. package/dist/docs/reference/agent-config.html +3 -3
  54. package/dist/docs/reference/artifacts.html +3 -3
  55. package/dist/docs/reference/channels.html +3 -3
  56. package/dist/docs/reference/cli.html +3 -3
  57. package/dist/docs/reference/connections.html +3 -3
  58. package/dist/docs/reference/hooks.html +3 -3
  59. package/dist/docs/reference/http-api.html +3 -3
  60. package/dist/docs/reference/instructions.html +3 -3
  61. package/dist/docs/reference/playground.html +3 -3
  62. package/dist/docs/reference/project-layout.html +8 -23
  63. package/dist/docs/reference/prompt.html +3 -3
  64. package/dist/docs/reference/schedules.html +3 -3
  65. package/dist/docs/reference/sessions.html +3 -3
  66. package/dist/docs/reference/skills.html +3 -3
  67. package/dist/docs/reference/subagents.html +3 -3
  68. package/dist/docs/reference/tools.html +27 -6
  69. package/dist/docs/scaffolding-agents.html +5 -5
  70. package/dist/docs/storage.html +3 -3
  71. package/dist/docs/templates/agentic-owners.html +3 -3
  72. package/dist/docs/templates/demo.html +3 -3
  73. package/dist/docs/templates/pr-autofixer.html +3 -3
  74. package/dist/docs/templates/security-reviewer.html +3 -3
  75. package/dist/docs/templates/triage.html +3 -3
  76. package/dist/docs/troubleshooting.html +3 -3
  77. package/dist/evals.d.ts +1 -1
  78. package/dist/evals.js +1 -1
  79. package/dist/hooks.d.ts +1 -1
  80. package/dist/hooks.js +1 -1
  81. package/dist/index.d.ts +2 -2
  82. package/dist/index.js +2 -2
  83. package/dist/internal/cli-convert-automation.d.ts +1 -1
  84. package/dist/internal/cli-convert-automation.js +1 -1
  85. package/dist/internal/cli-cursor.d.ts +12 -4
  86. package/dist/internal/cli-cursor.d.ts.map +1 -1
  87. package/dist/internal/cli-cursor.js +11 -4
  88. package/dist/internal/convert-automation/convert-workflow.d.ts +1 -1
  89. package/dist/internal/convert-automation/convert-workflow.js +9 -9
  90. package/dist/internal/convert-automation/types.d.ts +1 -1
  91. package/dist/internal/convert-automation/types.js +1 -1
  92. package/dist/internal/cursor/backend-client.d.ts +9 -1
  93. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  94. package/dist/internal/cursor/backend-client.js +19 -6
  95. package/dist/internal/cursor/credentials.d.ts +35 -9
  96. package/dist/internal/cursor/credentials.d.ts.map +1 -1
  97. package/dist/internal/cursor/credentials.js +92 -39
  98. package/dist/internal/discovery.js +1 -1
  99. package/dist/internal/distribution.d.ts +18 -0
  100. package/dist/internal/distribution.d.ts.map +1 -1
  101. package/dist/internal/distribution.js +19 -0
  102. package/dist/internal/eval-runner.js +1 -1
  103. package/dist/internal/grokbot/runner.d.ts +5 -2
  104. package/dist/internal/grokbot/runner.d.ts.map +1 -1
  105. package/dist/internal/grokbot/runner.js +10 -6
  106. package/dist/internal/init-project.d.ts.map +1 -1
  107. package/dist/internal/init-project.js +8 -1
  108. package/dist/internal/sdk-runner.d.ts +5 -0
  109. package/dist/internal/sdk-runner.d.ts.map +1 -1
  110. package/dist/internal/sdk-runner.js +10 -5
  111. package/dist/internal/server.d.ts.map +1 -1
  112. package/dist/internal/server.js +80 -36
  113. package/dist/playground/assets/index-BpVS-paP.css +1 -0
  114. package/dist/playground/index.html +2 -2
  115. package/dist/reminders.d.ts +1 -1
  116. package/dist/reminders.js +1 -1
  117. package/dist/schedules.d.ts +1 -1
  118. package/dist/schedules.js +1 -1
  119. package/dist/skills.d.ts +1 -1
  120. package/dist/skills.js +1 -1
  121. package/dist/storage.d.ts +1 -1
  122. package/dist/storage.js +1 -1
  123. package/dist/tools.d.ts +1 -1
  124. package/dist/tools.js +1 -1
  125. package/dist/types.d.ts +2 -2
  126. package/dist/types.d.ts.map +1 -1
  127. package/dist/types.js +1 -1
  128. package/docs/concepts.md +2 -1
  129. package/docs/reference/project-layout.md +5 -20
  130. package/docs/reference/tools.md +53 -3
  131. package/docs/scaffolding-agents.md +2 -0
  132. package/package.json +2 -1
  133. package/src/ab.ts +1 -1
  134. package/src/artifacts.ts +1 -1
  135. package/src/bin/agent-serve.ts +20 -6
  136. package/src/channels.ts +1 -1
  137. package/src/connections.ts +1 -1
  138. package/src/evals.ts +1 -1
  139. package/src/hooks.ts +1 -1
  140. package/src/index.ts +2 -2
  141. package/src/internal/cli-convert-automation.ts +1 -1
  142. package/src/internal/cli-cursor.ts +18 -5
  143. package/src/internal/convert-automation/convert-workflow.ts +9 -9
  144. package/src/internal/convert-automation/types.ts +1 -1
  145. package/src/internal/cursor/backend-client.ts +29 -4
  146. package/src/internal/cursor/credentials.ts +87 -24
  147. package/src/internal/discovery.ts +1 -1
  148. package/src/internal/distribution.ts +31 -0
  149. package/src/internal/eval-runner.ts +1 -1
  150. package/src/internal/grokbot/runner.ts +15 -6
  151. package/src/internal/init-project.ts +11 -1
  152. package/src/internal/sdk-runner.ts +10 -4
  153. package/src/internal/server.ts +95 -33
  154. package/src/reminders.ts +1 -1
  155. package/src/schedules.ts +1 -1
  156. package/src/skills.ts +1 -1
  157. package/src/storage.ts +1 -1
  158. package/src/tools.ts +1 -1
  159. package/src/types.ts +2 -2
  160. package/dist/docs/assets/chunks/@localSearchIndexroot.CxCtxfDE.js +0 -1
  161. package/dist/docs/assets/reference_project-layout.md.D3MdHM2z.lean.js +0 -1
  162. package/dist/playground/assets/index-DQGZnAI0.css +0 -1
  163. /package/dist/docs/assets/{concepts.md.BXAm6G-C.lean.js → concepts.md.2NfkGjqM.lean.js} +0 -0
  164. /package/dist/docs/assets/{scaffolding-agents.md.CiGsJ1aw.lean.js → scaffolding-agents.md.BpMFXv2J.lean.js} +0 -0
  165. /package/dist/playground/assets/{index-BmiIjFlM.js → index-DxapiDj_.js} +0 -0
package/README.md CHANGED
@@ -15,7 +15,7 @@ as the execution engine.
15
15
 
16
16
  **User-facing documentation lives in [`docs/`](./docs/README.md)** —
17
17
  open it with `npx @cursor/july docs`, or at `/docs` on every running
18
- `agent-serve serve` host getting started, concepts, guides (Slack,
18
+ `agent-sdk serve` host. It covers getting started, concepts, guides (Slack,
19
19
  GitHub webhooks, approvals, agent-to-agent, cloud runtime), evals, live
20
20
  A/B metrics, hillclimbing, deployment, troubleshooting, and reference
21
21
  pages for each folder. This README is the compact package reference.
@@ -44,6 +44,10 @@ my-agent/
44
44
  │ └── webhook.ts # HTTP surfaces beyond the built-in session API
45
45
  ├── hooks/
46
46
  │ └── audit.ts # observe the runtime event stream
47
+ ├── storage.ts # optional durable storage
48
+ ├── artifacts.ts # optional artifact kinds and retention
49
+ ├── otel.ts # optional OpenTelemetry export
50
+ ├── playground/ # optional custom playground tool chips
47
51
  ├── ab.ts # optional live A/B experiment
48
52
  ├── ab/ # optional: more experiments
49
53
  ├── schedules/
@@ -52,20 +56,21 @@ my-agent/
52
56
  └── lib/ # shared code (import-only, never discovered)
53
57
  ```
54
58
 
55
- Scaffold a starter project with `agent-serve init ./my-agent` a minimal
56
- agent (`package.json`, `tsconfig.json`, `agent/agent.ts`,
57
- `agent/instructions.md`, and a demo `agent/tools/echo.ts`) that serves
58
- immediately and type-checks with `npm run check`. From there, grow it folder
59
- by folder; the [docs](./docs/README.md) walk a weather agent from a single
59
+ Scaffold a starter project with `agent-sdk init ./my-agent`. It writes
60
+ `AGENTS.md`, `.gitignore`, `package.json`, `tsconfig.json`, `agent/agent.ts`,
61
+ `agent/instructions.md`, `agent/tools/echo.ts`, `agent/hooks/memory.ts`, and
62
+ empty capability folders. The project serves immediately and type-checks with
63
+ `npm run check`. From there, grow it folder by folder. The
64
+ [docs](./docs/README.md) walk a weather agent from a single
60
65
  `get_weather` tool through skills, channels, evals, and deployment.
61
66
 
62
- Serve one project with `agent-serve serve --dir ./my-agent --dev`, or point
67
+ Serve one project with `agent-sdk serve --dir ./my-agent --dev`, or point
63
68
  `serve` at a folder of agent projects to mount every child under its
64
69
  directory name.
65
70
 
66
71
  ## Node only — do not run under Bun
67
72
 
68
- Run agent-serve with **Node 22+** (from source: `pnpm exec tsx
73
+ Run the Agent SDK with **Node 22.13+** (from source: `pnpm exec tsx
69
74
  src/bin/agent-serve.ts …`, or the built `dist/bin/agent-serve.js`). Do not
70
75
  run it under Bun: Bun's HTTP/2 client corrupts the Cursor SDK's local
71
76
  harness tool-result streams (`NGHTTP2_FRAME_SIZE_ERROR`), so every built-in
@@ -79,7 +84,7 @@ Point `serve` at a **folder of agent projects** and it hosts all of them on
79
84
  one port, each under its own slug (its directory name):
80
85
 
81
86
  ```bash
82
- agent-serve serve --dir ./agents --dev
87
+ agent-sdk serve --dir ./agents --dev
83
88
  # 2 agents listening
84
89
  # playground http://127.0.0.1:5273
85
90
  ```
@@ -101,7 +106,7 @@ In multi-agent mode:
101
106
  - sessions are isolated per agent (`<stateRoot>/<slug>/`), and the playground
102
107
  gains a "← all agents" link back to the index.
103
108
  - point the terminal client at a slug:
104
- `agent-serve chat --url http://127.0.0.1:3000/weather-agent`.
109
+ `agent-sdk chat --url http://127.0.0.1:3000/weather-agent`.
105
110
 
106
111
  Slugs come from directory names and must match `[A-Za-z0-9][A-Za-z0-9_-]*`
107
112
  and not collide with the reserved `v1` / `playground` / `docs` path
@@ -163,8 +168,8 @@ instructions narrowly (the concierge above delegates *weather questions* to
163
168
  `weather-agent`, not everything).
164
169
 
165
170
  ```bash
166
- agent-serve serve --dir ./agents --dev
167
- agent-serve chat --url http://127.0.0.1:3000/concierge \
171
+ agent-sdk serve --dir ./agents --dev
172
+ agent-sdk chat --url http://127.0.0.1:3000/concierge \
168
173
  --message "What's the weather in Paris right now?"
169
174
  # concierge → weather.ask → weather-agent's own session/tools → reply
170
175
  ```
@@ -198,9 +203,9 @@ Serve it (turns run on the Cursor harness, so the host needs a Cursor
198
203
  credential — sign in once, or export an API key):
199
204
 
200
205
  ```bash
201
- agent-serve login # browser sign-in; mints + stores a revocable API key
206
+ agent-sdk login # browser sign-in; mints + stores a revocable API key
202
207
  # or: export CURSOR_API_KEY=key_...
203
- agent-serve serve --dir . --port 3000
208
+ agent-sdk serve --dir . --port 3000
204
209
  # e.g. playground at http://127.0.0.1:3000/<dirname>/playground
205
210
  ```
206
211
 
@@ -233,28 +238,28 @@ curl -X POST http://127.0.0.1:3000/<slug>/v1/session/ses_... \
233
238
  Inspect the discovered surface at any time:
234
239
 
235
240
  ```bash
236
- agent-serve info --dir . # or GET /<slug>/v1/info on a running server
237
- agent-serve validate --dir . # exit non-zero on error diagnostics
241
+ agent-sdk info --dir . # or GET /<slug>/v1/info on a running server
242
+ agent-sdk validate --dir . # exit non-zero on error diagnostics
238
243
  ```
239
244
 
240
245
  ## Terminal client
241
246
 
242
- `agent-serve chat` talks to a running server over the same public API and
247
+ `agent-sdk chat` talks to a running server over the same public API and
243
248
  renders the reply live — streamed text, tool calls, and a per-turn usage
244
249
  footer. Pass `--json` for a compact trajectory (same shape as `run`).
245
250
 
246
251
  ```bash
247
252
  # interactive REPL against a local server
248
- agent-serve chat --url http://127.0.0.1:3000
253
+ agent-sdk chat --url http://127.0.0.1:3000
249
254
 
250
255
  # one-shot (good for piping / scripts)
251
- agent-serve chat --url http://127.0.0.1:3000 --message "Weather in Paris?"
256
+ agent-sdk chat --url http://127.0.0.1:3000 --message "Weather in Paris?"
252
257
 
253
258
  # JSON trajectory (for coding agents / scripts)
254
- agent-serve chat --url http://127.0.0.1:3000 --message "hello" --json
259
+ agent-sdk chat --url http://127.0.0.1:3000 --message "hello" --json
255
260
 
256
261
  # against an authed server
257
- agent-serve chat --url https://my-agent.example.com --bearer-token "$TOKEN"
262
+ agent-sdk chat --url https://my-agent.example.com --bearer-token "$TOKEN"
258
263
  ```
259
264
 
260
265
  ## Agent loop
@@ -263,19 +268,19 @@ Coding agents should prefer the JSON-first commands: edit files → inspect
263
268
  → run a turn → assert with filesystem evals.
264
269
 
265
270
  ```bash
266
- agent-serve validate --dir .
267
- agent-serve info --dir . --json
271
+ agent-sdk validate --dir .
272
+ agent-sdk info --dir . --json
268
273
 
269
274
  # Ephemeral server + one (or more) turns; JSON trajectory on stdout
270
- agent-serve run --dir . --message "What's the temperature in NYC?"
275
+ agent-sdk run --dir . --message "What's the temperature in NYC?"
271
276
 
272
277
  # Optional event log for later summarization
273
- agent-serve run --dir . --message "..." --events /tmp/run.ndjson
274
- agent-serve trajectory --events /tmp/run.ndjson
278
+ agent-sdk run --dir . --message "..." --events /tmp/run.ndjson
279
+ agent-sdk trajectory --events /tmp/run.ndjson
275
280
 
276
281
  # Scaffold (or print the setup guide with no directory)
277
- agent-serve init ./my-agent
278
- agent-serve init
282
+ agent-sdk init ./my-agent
283
+ agent-sdk init
279
284
  ```
280
285
 
281
286
  `run` / `eval` boot a temporary server on port `0` with a temp `stateRoot`
@@ -306,6 +311,9 @@ export default defineEval({
306
311
  Case id is the path under `evals/` for a single-`test` file, or
307
312
  `<fileId>/<case.id>` when using `cases` in one file.
308
313
 
314
+ Use `t.judge` when wording needs an LLM grader. The built-in JUnit and
315
+ Artifacts reporters write CI results and per-case evidence.
316
+
309
317
  Every project with evals needs `evals/evals.config.ts` with a required
310
318
  `maxConcurrency` (hard-capped at 200 due to model provider request limits).
311
319
  Playground batches are in-memory by default; declare an `evals` table in
@@ -324,12 +332,12 @@ export default defineEvalConfig({
324
332
  ```
325
333
 
326
334
  ```bash
327
- agent-serve eval --dir . --list
328
- agent-serve eval --dir . --json
329
- agent-serve eval --dir . weather/nyc # one datapoint
330
- agent-serve eval --dir . weather # whole file
331
- agent-serve eval --dir . weather forecast # multiple files
332
- agent-serve eval --dir . --tag smoke
335
+ agent-sdk eval --dir . --list
336
+ agent-sdk eval --dir . --json
337
+ agent-sdk eval --dir . weather/nyc # one datapoint
338
+ agent-sdk eval --dir . weather # whole file
339
+ agent-sdk eval --dir . weather forecast # multiple files
340
+ agent-sdk eval --dir . --tag smoke
333
341
  ```
334
342
 
335
343
  See [`docs/`](./docs/README.md) for the full documentation set,
@@ -339,10 +347,10 @@ evals, hillclimb, GitHub webhooks, Slack setup, debugging).
339
347
 
340
348
  ## Web playground
341
349
 
342
- Every served agent ships with a built-in playground at
343
- `http://127.0.0.1:3000/playground` — a Vite + React SPA (reusing
344
- Cursor's internal UI components) over the same public HTTP API, made for quick
345
- manual testing and demo recordings:
350
+ Every served agent ships with a built-in playground. The default multi-agent
351
+ mode serves it at `http://127.0.0.1:3000/<slug>/playground`.
352
+ `--mode single` uses `http://127.0.0.1:3000/playground`. The Vite and React
353
+ app uses the same public HTTP API for manual testing and demo recordings:
346
354
 
347
355
  - chat with the agent and watch text/reasoning stream live, rendered as
348
356
  markdown (headings, lists, tables, blockquotes, links) with syntax
@@ -361,7 +369,7 @@ manual testing and demo recordings:
361
369
  connections, channels, hooks),
362
370
  - flip on the raw NDJSON pane to see the exact wire events.
363
371
 
364
- The SPA is a static bundle. `agent-serve serve` auto-builds `dist/playground/`
372
+ The SPA is a static bundle. `agent-sdk serve` auto-builds `dist/playground/`
365
373
  when it is missing and the local vite toolchain is present (`pnpm run build`
366
374
  also emits it for publish). The server serves the bundle and every call it
367
375
  makes runs the normal route auth chain (there's a bearer-token field for
@@ -461,7 +469,7 @@ export default defineAgent({
461
469
  ```
462
470
 
463
471
  `model` accepts a Cursor model id string or `{ id, params }`. When omitted
464
- on the root agent, agent-serve defaults to `grok-4.5` with `effort=high`
472
+ on the root agent, the Agent SDK defaults to `grok-4.5` with `effort=high`
465
473
  and `fast=true`.
466
474
 
467
475
  `runtime` selects where turns execute:
@@ -469,7 +477,7 @@ and `fast=true`.
469
477
  | Value | Behavior |
470
478
  | --------- | ------- |
471
479
  | `"local"` | Cursor SDK local harness on this machine. Session id doubles as the SDK agent id. Authored tools, skills, and sandbox seeds apply. |
472
- | `"cloud"` | Cursor cloud agents. Pass a `cloud` block (repos, env, envVars, …) forwarded to the SDK. In-process server tools are not available; instructions and agent-tool catalogs are prepended to the first prompt because the local session workspace is not the cloud VM. |
480
+ | `"cloud"` | Cursor cloud agents. Pass a `cloud` block (repos, env, envVars, …) forwarded to the SDK. Server tools use authenticated HTTP MCP when the host has `--public-url` or `--cloud-tools-url`. Instructions and agent-tool catalogs are prepended to the first prompt because the local session workspace is not the cloud VM. |
473
481
 
474
482
  Discovery warns when `runtime: "cloud"` is combined with agent tools or sandbox seeds that only apply locally. Authored skills still warn: they sync onto an Agent Store for native discovery rather than the session workspace.
475
483
 
@@ -489,7 +497,7 @@ One file per tool; the filename is the tool name the model sees.
489
497
 
490
498
  | Value | Behavior |
491
499
  | ----- | -------- |
492
- | `"server"` (default) | In-process on the agent-serve host via Cursor SDK custom tools. Requires `execute`. Only available when the agent `runtime` is `"local"`. |
500
+ | `"server"` (default) | In-process on the serve host. Local turns call it directly. Cloud turns use authenticated HTTP MCP when the host has `--public-url` or `--cloud-tools-url`. Requires `execute`. |
493
501
  | `"agent"` | Materialized into the agent environment as a shell script. Requires `script` (JSON on stdin, result on stdout). Works with local and cloud agent runtimes. |
494
502
 
495
503
  Server tool (default):
@@ -603,10 +611,12 @@ printf '%s\\n' "$message"
603
611
  });
604
612
  ```
605
613
 
606
- `inputSchema` is a zod schema (validated and typed for server tools) or a
607
- plain JSON Schema object (forwarded as-is). For server tools, `ctx` carries
608
- `{ toolCallId, session, workspaceDir }`. Return a string, a JSON value, or
609
- `{ content: [...], isError? }` for rich results.
614
+ `inputSchema` is a Zod schema (validated and typed for server tools) or a
615
+ plain JSON Schema object (forwarded as-is). `outputSchema` advertises a
616
+ structured result schema. The host doesn't validate results against it.
617
+ Plain objects fill `structuredContent` automatically. Envelope results set
618
+ it explicitly next to `content` and `isError`. For server tools, `ctx` carries
619
+ `{ toolCallId, session, workspaceDir }`.
610
620
 
611
621
  #### Deterministic tool calls
612
622
 
@@ -629,8 +639,8 @@ From the CLI (boots an ephemeral server unless `--url` targets a running
629
639
  one):
630
640
 
631
641
  ```bash
632
- agent-serve call get_weather --dir . --input '{"city":"NYC"}'
633
- agent-serve call get_weather --url http://127.0.0.1:3000/<slug> --input '{"city":"NYC"}'
642
+ agent-sdk call get_weather --dir . --input '{"city":"NYC"}'
643
+ agent-sdk call get_weather --url http://127.0.0.1:3000/<slug> --input '{"city":"NYC"}'
634
644
  ```
635
645
 
636
646
  Programmatically, `callTool(toolName, input, options?)` is available on the
@@ -725,7 +735,7 @@ name.
725
735
 
726
736
  Requirements and behavior:
727
737
 
728
- - The host must be signed in (`agent-serve login` or `CURSOR_API_KEY`);
738
+ - The host must be signed in (`agent-sdk login` or `CURSOR_API_KEY`);
729
739
  `serve` fails fast at startup otherwise, and logs each connector's live
730
740
  status (`connected` / `needsAuth` / `error`) as it starts.
731
741
  - Local turns and host-side calls go through a loopback bridge route guarded
@@ -743,7 +753,7 @@ Requirements and behavior:
743
753
  Every MCP connection is always available in three places:
744
754
 
745
755
  1. the Cursor agent (local or cloud), via SDK `mcpServers`
746
- 2. the agent-serve host, for in-process tools via `ctx.host.mcp`
756
+ 2. the serve host, for in-process tools via `ctx.host.mcp`
747
757
  3. channel / schedule handlers, via `args.host.mcp` (deterministic — no agent loop)
748
758
 
749
759
  ```ts
@@ -928,7 +938,7 @@ Watched posts dispatch with the same thread-scoped principal as mentions
928
938
  left to the `app_mention` path; bot-authored posts never dispatch; deleting
929
939
  a post inside the debounce window cancels its dispatch. The Slack app must
930
940
  subscribe to `message.channels` / `message.groups`
931
- (`agent-serve slack create --channel-posts`) and be a member of each watched channel. Watched channels surface in
941
+ (`agent-sdk slack create --channel-posts`) and be a member of each watched channel. Watched channels surface in
932
942
  `info` via `meta.slackChannelPosts`.
933
943
 
934
944
  **HITL compose:** park/resume is independent (`needsApproval` on tools). Opt in
@@ -966,19 +976,19 @@ from the mention and run the same host path as their HTTP channels.
966
976
  agent-to-agent only (no Slack channel).
967
977
 
968
978
  For Socket Mode apps (channel watch / approvals), run
969
- `agent-serve slack create`. It opens the dashboard wizard, creates and
979
+ `agent-sdk slack create`. It opens the dashboard wizard, creates and
970
980
  installs the app, and writes the token pair to `.env.local`. To own the
971
- Slack app yourself, run `agent-serve slack init --manual` and paste the
981
+ Slack app yourself, run `agent-sdk slack init --manual` and paste the
972
982
  manifests at api.slack.com.
973
983
 
974
- CLI (`agent-serve slack …`; guided setup in `skills/setup-slack/SKILL.md`):
984
+ CLI (`agent-sdk slack …`; guided setup in `skills/setup-slack/SKILL.md`):
975
985
 
976
986
  ```bash
977
- agent-serve slack create --dir ./my-agent # dashboard wizard (dev app)
978
- agent-serve slack create --dir ./my-agent --prod # prod app
979
- agent-serve slack init --manual --dir ./my-agent # manifests for api.slack.com
980
- agent-serve slack setup
981
- agent-serve slack doctor --prefix MY_AGENT
987
+ agent-sdk slack create --dir ./my-agent # dashboard wizard (dev app)
988
+ agent-sdk slack create --dir ./my-agent --prod # prod app
989
+ agent-sdk slack init --manual --dir ./my-agent # manifests for api.slack.com
990
+ agent-sdk slack setup
991
+ agent-sdk slack doctor --prefix MY_AGENT
982
992
  ```
983
993
 
984
994
  **GitHub** (`@cursor/july/channels/github`): a webhook channel pack
@@ -1009,7 +1019,7 @@ under `serve --dev`, which admits unsigned loopback deliveries so
1009
1019
  `{ auth }` to start a model turn as the actor, `{ task }` for host-side work
1010
1020
  (202 ACK, runs past GitHub's ~10s timeout), or `null` to skip.
1011
1021
 
1012
- **Testing GitHub agents locally.** `cursorAccount` reuses `agent-serve login`
1022
+ **Testing GitHub agents locally.** `cursorAccount` reuses `agent-sdk login`
1013
1023
  for both Cursor SCM events and a refreshing repo-scoped GitHub credential used
1014
1024
  by `ctx.github`, `ctx.host.github`, and child `gh` commands. Default
1015
1025
  `permissions: "pr-write"` covers comments without `contents:write`; opt up to
@@ -1020,27 +1030,27 @@ auth prefers GitHub App installation tokens when `GITHUB_APP_ID` /
1020
1030
  `GITHUB_APP_PRIVATE_KEY` (and an installation id) are set, then falls back to
1021
1031
  `GITHUB_TOKEN` / `GH_TOKEN` or `gh auth login`. The channel publishes the
1022
1032
  webhook events it dispatches on (derived from the declared hooks, or pinned
1023
- via `webhookEvents`), so `agent-serve github …` can forward live
1033
+ via `webhookEvents`), so `agent-sdk github …` can forward live
1024
1034
  deliveries with zero hand-listing — it wraps [`gh webhook
1025
1035
  forward`](https://docs.github.com/en/webhooks/testing-and-troubleshooting-webhooks/using-the-github-cli-to-forward-webhooks-for-testing):
1026
1036
 
1027
1037
  ```bash
1028
1038
  # One-time: gh + the cli/gh-webhook extension
1029
- agent-serve github doctor --install
1039
+ agent-sdk github doctor --install
1030
1040
 
1031
1041
  # Terminal A: serve the agent (dev accepts unsigned loopback deliveries)
1032
- agent-serve serve --dir ./my-agent --dev
1042
+ agent-sdk serve --dir ./my-agent --dev
1033
1043
 
1034
1044
  # Terminal B: forward this repo's deliveries to the discovered github channel
1035
1045
  # (URL + events auto-derived; repo inferred from the git remote). No secret
1036
1046
  # needed against a --dev server; set GITHUB_WEBHOOK_SECRET to verify signatures.
1037
- agent-serve github forward --dir ./my-agent
1047
+ agent-sdk github forward --dir ./my-agent
1038
1048
 
1039
1049
  # Inspect what would be forwarded (URL + events per agent)
1040
- agent-serve github events --dir ./agents --json
1050
+ agent-sdk github events --dir ./agents --json
1041
1051
 
1042
1052
  # Forward to EVERY discovered github channel at once
1043
- agent-serve github forward --dir ./agents
1053
+ agent-sdk github forward --dir ./agents
1044
1054
  ```
1045
1055
 
1046
1056
  When several channels match (e.g. a folder of agent projects with more than
@@ -1054,8 +1064,8 @@ URL, so N processes would collide with `Hook already exists`.
1054
1064
  it registers a real webhook — and authenticates its relay with the GitHub CLI's
1055
1065
  own login. If `GITHUB_TOKEN` / `GH_TOKEN` is set in your env, deliveries fail
1056
1066
  with **HTTP 401** (the relay rejects env tokens); blank it for the command
1057
- (`GITHUB_TOKEN= GH_TOKEN= agent-serve github forward …`) or `unset` it.
1058
- `agent-serve github doctor` / `forward` warn when they detect this.
1067
+ (`GITHUB_TOKEN= GH_TOKEN= agent-sdk github forward …`) or `unset` it.
1068
+ `agent-sdk github doctor` / `forward` warn when they detect this.
1059
1069
 
1060
1070
  Pass `--repo owner/repo` / `--org ORG` to override the inferred target,
1061
1071
  `--events a,b,c` to narrow the set, `--url` for a custom endpoint (e.g. a
@@ -1067,19 +1077,19 @@ still works too — `POST` a saved payload with an `x-github-event` header (no
1067
1077
  signature needed in `--dev`).
1068
1078
 
1069
1079
  **No admin? Hillclimbing? Use `github replay`.** `gh webhook forward` needs repo
1070
- admin and a live event. `agent-serve github replay <pr_url>` instead **reads**
1080
+ admin and a live event. `agent-sdk github replay <pr_url>` instead **reads**
1071
1081
  the PR (pull access is enough — no admin, no relay, and `GITHUB_TOKEN` is fine)
1072
1082
  and synthesizes GitHub-shaped payloads it POSTs straight at the channel:
1073
1083
 
1074
1084
  ```bash
1075
1085
  # Replay a pull_request delivery for a PR to the discovered channel
1076
- agent-serve github replay https://github.com/owner/repo/pull/123 --dir ./my-agent
1086
+ agent-sdk github replay https://github.com/owner/repo/pull/123 --dir ./my-agent
1077
1087
 
1078
1088
  # Replay everything the channel listens for (its declared events), CI failing
1079
- agent-serve github replay owner/repo#123 --dir ./my-agent --events '*' --conclusion failure
1089
+ agent-sdk github replay owner/repo#123 --dir ./my-agent --events '*' --conclusion failure
1080
1090
 
1081
1091
  # Inspect payloads without POSTing (and snapshot them as reusable fixtures)
1082
- agent-serve github replay owner/repo#123 --dir ./my-agent --events '*' --dry-run --out fixtures/github
1092
+ agent-sdk github replay owner/repo#123 --dir ./my-agent --events '*' --dry-run --out fixtures/github
1083
1093
  ```
1084
1094
 
1085
1095
  `--events` defaults to `pull_request` (`*` = the channel's declared events);
@@ -1094,8 +1104,9 @@ Cursor GitHub App is on the repo, `serve --cursor-events --repo owner/repo`
1094
1104
  long-polls `/v0/scm-events` with the host's Cursor account (no public URL /
1095
1105
  repo admin). Offset + consumer id live under `<state-root>/cursor-events/`.
1096
1106
  The stream is read as your Cursor user, so the flag **requires a signed-in
1097
- host** (`agent-serve login`, `CURSOR_API_KEY`, or `serve({ apiKey })`) — serve
1098
- fails fast rather than starting with a relay that can never receive events.
1107
+ host** (`agent-sdk login`, `CURSOR_API_KEY`, or `serve({ apiKey })`).
1108
+ Serve fails fast rather than starting with a relay that can never receive
1109
+ events.
1099
1110
 
1100
1111
  ### Hooks (`agent/hooks/*.ts`)
1101
1112
  Observe-only subscribers that run after each event is recorded — audit
@@ -1135,7 +1146,7 @@ export default defineSchedule({
1135
1146
  ```
1136
1147
 
1137
1148
  Cron expressions are standard 5-field, evaluated in UTC with minute
1138
- granularity. In production mode (`agent-serve serve`) schedules fire on
1149
+ granularity. In production mode (`agent-sdk serve`) schedules fire on
1139
1150
  cadence; in dev mode (`--dev`) they never fire automatically — dispatch one
1140
1151
  by hand, exactly once, through the same path production uses:
1141
1152
 
@@ -1215,7 +1226,7 @@ console.log(`listening on ${handle.url}`);
1215
1226
 
1216
1227
  The Cursor credential resolves in one order everywhere (SDK turns, cloud
1217
1228
  runtime, Cursor account MCP connections): explicit `apiKey` option / `--api-key`
1218
- → `CURSOR_API_KEY` → the key stored by `agent-serve login`. `whoami` shows
1229
+ → `CURSOR_API_KEY` → the key stored by `agent-sdk login`. `whoami` shows
1219
1230
  which one is active; `logout` removes the stored key (revoke it in the
1220
1231
  Cursor dashboard to kill it outright).
1221
1232
 
@@ -1225,7 +1236,7 @@ non-production backend, set **both** to the same URL — a key minted on one
1225
1236
  backend is rejected by the other.
1226
1237
 
1227
1238
  `serve` refuses to start when discovery produced error diagnostics; run
1228
- `agent-serve validate` (or read `project.diagnostics`) to see why.
1239
+ `agent-sdk validate` (or read `project.diagnostics`) to see why.
1229
1240
 
1230
1241
  State lives under `<project>/.agent-serve/` (override with `stateRoot` /
1231
1242
  `--state-root`): `sessions/<id>/{session.json,events.ndjson,workspace/}`
@@ -1240,20 +1251,10 @@ when the agent should inherit that tree.
1240
1251
 
1241
1252
  ## Not supported (yet)
1242
1253
 
1243
- Deliberately out of scope for now, and reported as warnings where the
1244
- corresponding folder exists: per-subagent tools/skills/mcp-connections, nested
1245
- subagents, WebSocket channel routes, platform channel packs for Discord
1246
- and Teams (Slack is supported via `@cursor/july/channels/slack`;
1247
- other platforms still use the authored `defineChannel` webhook form),
1248
- OAuth-brokered MCP connections beyond the Cursor account
1249
- (`{ cursorAccount: true }` covers connectors the account already
1250
- authorized in Cursor), custom sandbox backends (`sandbox.ts`),
1251
- instrumentation modules, dynamic per-caller capabilities, structured
1252
- output schemas, and file uploads. Human-in-the-loop tool approvals
1253
- (`needsApproval` on `execution: "server"` tools) are supported; exact
1254
- resume of a parked tool call after host restart is not. Filesystem
1255
- evals (`defineEval` under `evals/`), live A/B metrics (`defineAB` under
1256
- `agent/ab`), and the `run` / `trajectory` commands are supported;
1257
- LLM-as-judge scoring and external reporters are not yet. Context
1258
- compaction is handled by the Cursor harness rather than
1259
- configured here.
1254
+ The Agent SDK does not load per-subagent tools, skills, or MCP connections.
1255
+ It also rejects nested subagents, WebSocket channel routes, and custom
1256
+ sandbox backends. Discord and Teams do not have channel packs. Use an
1257
+ authored `defineChannel` integration for those platforms.
1258
+
1259
+ Parked approval calls do not resume after a host restart. Context compaction
1260
+ is owned by the Cursor harness.
package/dist/ab.d.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  * sample/snapshot export lives on the `defineStorage` `abs` table.
15
15
  *
16
16
  * ```ts
17
- * import { defineAB, splitBySessionHash } from "@anysphere/agent-serve/ab";
17
+ * import { defineAB, splitBySessionHash } from "@cursor/july/ab";
18
18
  *
19
19
  * export default defineAB({
20
20
  * name: "concise-instructions",
package/dist/ab.js CHANGED
@@ -14,7 +14,7 @@
14
14
  * sample/snapshot export lives on the `defineStorage` `abs` table.
15
15
  *
16
16
  * ```ts
17
- * import { defineAB, splitBySessionHash } from "@anysphere/agent-serve/ab";
17
+ * import { defineAB, splitBySessionHash } from "@cursor/july/ab";
18
18
  *
19
19
  * export default defineAB({
20
20
  * name: "concise-instructions",
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * ```ts
12
12
  * import { z } from "zod";
13
- * import { defineArtifacts } from "@anysphere/agent-serve/artifacts";
13
+ * import { defineArtifacts } from "@cursor/july/artifacts";
14
14
  *
15
15
  * export default defineArtifacts({
16
16
  * kinds: {
package/dist/artifacts.js CHANGED
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * ```ts
12
12
  * import { z } from "zod";
13
- * import { defineArtifacts } from "@anysphere/agent-serve/artifacts";
13
+ * import { defineArtifacts } from "@cursor/july/artifacts";
14
14
  *
15
15
  * export default defineArtifacts({
16
16
  * kinds: {
@@ -34,7 +34,7 @@ import { cmdCall, cmdChat, cmdCost, cmdEval, cmdEvalCancel, cmdEvalStatus, cmdIn
34
34
  import { ensureCursorLogin } from "../internal/cli-cursor.js";
35
35
  import { cmdDelete, cmdDeploy, cmdDeploymentStatus, cmdDeployments, cmdRotatePodCredential, cmdRotateToken, cmdSecretsList, cmdSecretsSet, cmdSecretsUnset, cmdStop, } from "../internal/cli-deploy.js";
36
36
  import { cmdManifest } from "../internal/cli-manifest.js";
37
- import { CLI_COMMAND_NAME as CLI, PACKAGE_NAME, packageVersion, } from "../internal/distribution.js";
37
+ import { CLI_COMMAND_NAME as CLI, formatCliVersion, PACKAGE_NAME, packageVersion, } from "../internal/distribution.js";
38
38
  import { loadAgentLocalEnv } from "../internal/local-env.js";
39
39
  import { ENTER_RESTART_EXIT_CODE, isServeRestartWorker, runEnterRestartSupervisor, } from "../internal/serve-restart.js";
40
40
  import { clearTerminal, stdoutPalette } from "../internal/terminal-style.js";
@@ -100,7 +100,7 @@ Usage:
100
100
  ${CLI} logout
101
101
  ${CLI} whoami [--json]
102
102
  ${CLI} update
103
- ${CLI} version
103
+ ${CLI} version [--json]
104
104
  ${CLI} deploy [--dir <path>] [--slug <slug> | --all] [--team <id>] [--json]
105
105
  [--no-wait] [--repo <url>] [--ref <ref>]
106
106
  [--path <agentPath>] [--cursor-events-repo <owner/name>]...
@@ -170,7 +170,7 @@ Commands:
170
170
  prompt. --json is machine-readable and never blocks on
171
171
  login. No directory: print the setup guide.
172
172
  convert-automation
173
- Export a Cursor Automation into an agentkit project. <url> is
173
+ Export a Cursor Automation into an agentsdk project. <url> is
174
174
  the dashboard URL (…/automations/<uuid> or
175
175
  …/custom-agents/<uuid>) or a bare uuid. Fetches the definition
176
176
  with your Cursor credentials, writes the converted files into
@@ -223,7 +223,9 @@ Commands:
223
223
  whoami Show which Cursor account powers this host (and why).
224
224
  update Upgrade this install to the latest published version (detects
225
225
  global npm/pnpm/yarn/bun installs and project dependencies).
226
- version Print the installed ${CLI} version and exit (also --version / -V).
226
+ version Print the ${PACKAGE_NAME} version this CLI will use and exit
227
+ (also --version / -V). Text is the version number; --json
228
+ prints { name, version, cli }.
227
229
  deploy Deploy onto Cursor's managed agent-serve hosting, then wait for
228
230
  the engine to come up. --repo/--ref/--path stay available;
229
231
  inside an agent git checkout they are inferred when omitted
@@ -257,7 +259,7 @@ Agent loop:
257
259
  ${CLI} dev .
258
260
 
259
261
  Options:
260
- --version, -V Print the installed version and exit.
262
+ --version, -V Print the version number and exit.
261
263
  --dir Project root (defaults to the current directory).
262
264
  --port Port to listen on (default 3000). When the default is
263
265
  taken, serve tries the next free port and prints a notice.
@@ -365,7 +367,7 @@ Options:
365
367
  --skip-report eval: ignore reporters from evals.config.ts / eval files.
366
368
  --no-stream run/eval: silence live progress on stderr (JSON still prints).
367
369
  --json JSON output (init/convert-automation/install-skills/
368
- info/chat/eval/logs/
370
+ info/chat/eval/logs/version/
369
371
  sessions/session/github; run defaults to JSON). logs:
370
372
  NDJSON progress/log events. session: trajectory JSON
371
373
  (not raw events).
@@ -438,7 +440,7 @@ function main(argv) {
438
440
  return command === undefined ? 1 : 0;
439
441
  }
440
442
  if (command === "version" || command === "--version" || command === "-V") {
441
- yield writeStdout(`${CLI} ${packageVersion()}\n`);
443
+ yield writeStdout(formatCliVersion({ json: restIn.includes("--json") }));
442
444
  return 0;
443
445
  }
444
446
  // `session --events` means "dump raw events" (boolean). Rewrite so it does
@@ -535,9 +537,14 @@ function main(argv) {
535
537
  "no-artifacts": { type: "boolean", default: false },
536
538
  "skip-report": { type: "boolean", default: false },
537
539
  "max-concurrency": { type: "string" },
540
+ version: { type: "boolean", short: "V", default: false },
538
541
  },
539
542
  });
540
543
  const dir = (_j = values.dir) !== null && _j !== void 0 ? _j : ".";
544
+ if (values.version === true) {
545
+ yield writeStdout(formatCliVersion({ json: values.json === true }));
546
+ return 0;
547
+ }
541
548
  // Best-effort, cached, and silent on failure. `update` does its own fresh
542
549
  // lookup, --json runs stay quiet for machine consumers, and `mcp` skips it
543
550
  // so MCP client spawns stay fast (stdout there is the protocol wire).
@@ -1090,8 +1097,14 @@ function main(argv) {
1090
1097
  loadLocalEnv();
1091
1098
  // Model turns need a Cursor credential. Prompt login before listen
1092
1099
  // so the first playground turn does not fail with a late auth error.
1100
+ // `--allow-anonymous` is the hosted trust boundary (alias token /
1101
+ // freeze bake): skip the login gate so health can bind without a
1102
+ // key. v1 hosted injects CURSOR_API_KEY at exec; freeze bind drops
1103
+ // CURSOR_API_KEY / CURSOR_API_KEY_FILE onto the listening process.
1104
+ // Self-hosted omit the flag and still fail-fast unsigned on a TTY-less host.
1093
1105
  const loginExit = yield ensureCursorLogin({
1094
1106
  apiKey: values["api-key"],
1107
+ allowAnonymous: values["allow-anonymous"] === true,
1095
1108
  });
1096
1109
  if (loginExit !== 0) {
1097
1110
  return { kind: "login-failed", exitCode: loginExit };
@@ -9,7 +9,7 @@
9
9
  * and are mounted under `/v1/channels/<name>`:
10
10
  *
11
11
  * ```ts
12
- * import { defineChannel, POST } from "@anysphere/agent-serve/channels";
12
+ * import { defineChannel, POST } from "@cursor/july/channels";
13
13
  * import { z } from "zod";
14
14
  *
15
15
  * export default defineChannel({
package/dist/channels.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * and are mounted under `/v1/channels/<name>`:
10
10
  *
11
11
  * ```ts
12
- * import { defineChannel, POST } from "@anysphere/agent-serve/channels";
12
+ * import { defineChannel, POST } from "@cursor/july/channels";
13
13
  * import { z } from "zod";
14
14
  *
15
15
  * export default defineChannel({
@@ -8,7 +8,7 @@
8
8
  * `hostOnly: true` to keep it off the model (still on `host.mcp`).
9
9
  *
10
10
  * ```ts
11
- * import { defineConnection } from "@anysphere/agent-serve/connections";
11
+ * import { defineConnection } from "@cursor/july/connections";
12
12
  *
13
13
  * export default defineConnection({
14
14
  * url: "https://mcp.linear.app/mcp",
@@ -8,7 +8,7 @@
8
8
  * `hostOnly: true` to keep it off the model (still on `host.mcp`).
9
9
  *
10
10
  * ```ts
11
- * import { defineConnection } from "@anysphere/agent-serve/connections";
11
+ * import { defineConnection } from "@cursor/july/connections";
12
12
  *
13
13
  * export default defineConnection({
14
14
  * url: "https://mcp.linear.app/mcp",