@cursor/july 0.1.62 → 0.1.73

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 (286) hide show
  1. package/AGENTS.md +4 -5
  2. package/README.md +23 -11
  3. package/dist/bin/agent-serve.js +11 -2
  4. package/dist/channels/github/api.d.ts +2 -0
  5. package/dist/channels/github/api.d.ts.map +1 -1
  6. package/dist/channels/github/api.js +2 -1
  7. package/dist/channels/github/binding.d.ts +7 -0
  8. package/dist/channels/github/binding.d.ts.map +1 -1
  9. package/dist/channels/github/binding.js +4 -0
  10. package/dist/channels/github/checks.d.ts +99 -0
  11. package/dist/channels/github/checks.d.ts.map +1 -0
  12. package/dist/channels/github/checks.js +108 -0
  13. package/dist/channels/github/cursor-account.d.ts +4 -4
  14. package/dist/channels/github/cursor-account.d.ts.map +1 -1
  15. package/dist/channels/github/cursor-account.js +7 -5
  16. package/dist/channels/github/index.d.ts +1 -0
  17. package/dist/channels/github/index.d.ts.map +1 -1
  18. package/dist/channels/github/index.js +1 -0
  19. package/dist/channels/github/types.d.ts +8 -0
  20. package/dist/channels/github/types.d.ts.map +1 -1
  21. package/dist/channels/slack/channel-watch.d.ts +2 -1
  22. package/dist/channels/slack/channel-watch.d.ts.map +1 -1
  23. package/dist/channels/slack/channel-watch.js +7 -3
  24. package/dist/channels/slack/dispatch.d.ts +9 -0
  25. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  26. package/dist/channels/slack/dispatch.js +41 -21
  27. package/dist/channels/slack/manifest.d.ts +2 -2
  28. package/dist/channels/slack/manifest.d.ts.map +1 -1
  29. package/dist/channels/slack/manifest.js +14 -11
  30. package/dist/channels/slack/nudge-store.d.ts +16 -0
  31. package/dist/channels/slack/nudge-store.d.ts.map +1 -1
  32. package/dist/channels/slack/nudge-store.js +53 -0
  33. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  34. package/dist/channels/slack/slack-channel.js +4 -1
  35. package/dist/channels/slack/types.d.ts +24 -7
  36. package/dist/channels/slack/types.d.ts.map +1 -1
  37. package/dist/connections.d.ts +17 -5
  38. package/dist/connections.d.ts.map +1 -1
  39. package/dist/connections.js +17 -5
  40. package/dist/docs/404.html +2 -2
  41. package/dist/docs/ab.html +3 -3
  42. package/dist/docs/assets/{app.B-biogkN.js → app.CdbcFD8T.js} +1 -1
  43. package/dist/docs/assets/chunks/@localSearchIndexroot.DQad--_z.js +1 -0
  44. package/dist/docs/assets/chunks/{VPLocalSearchBox.DZqKtFZS.js → VPLocalSearchBox.D_NKImM7.js} +1 -1
  45. package/dist/docs/assets/chunks/{theme.BwC5zP2r.js → theme.CMvz7cu9.js} +2 -2
  46. package/dist/docs/assets/{concepts.md.CqOsxbMU.js → concepts.md.BXAm6G-C.js} +1 -1
  47. package/dist/docs/assets/{guides_mcp-oauth.md.C7G7IykG.js → guides_mcp-oauth.md.CzEB6RaG.js} +1 -1
  48. package/dist/docs/assets/{reference_agent-config.md.DHkkvcEZ.js → reference_agent-config.md.BZnEKfEc.js} +3 -4
  49. package/dist/docs/assets/{reference_agent-config.md.DHkkvcEZ.lean.js → reference_agent-config.md.BZnEKfEc.lean.js} +1 -1
  50. package/dist/docs/assets/{reference_connections.md.CSQiNzre.js → reference_connections.md.Cu3N-S3Q.js} +26 -9
  51. package/dist/docs/assets/reference_connections.md.Cu3N-S3Q.lean.js +1 -0
  52. package/dist/docs/assets/{reference_sessions.md.DBVFi2Sx.js → reference_sessions.md.B0DdlM-K.js} +1 -1
  53. package/dist/docs/assets/{reference_tools.md.kJfJAP2m.js → reference_tools.md.DTg_kEsx.js} +2 -2
  54. package/dist/docs/assets/{reference_tools.md.kJfJAP2m.lean.js → reference_tools.md.DTg_kEsx.lean.js} +1 -1
  55. package/dist/docs/assets/troubleshooting.md.DQ-hYuZT.js +1 -0
  56. package/dist/docs/building-with-agents.html +3 -3
  57. package/dist/docs/concepts.html +5 -5
  58. package/dist/docs/deployment.html +3 -3
  59. package/dist/docs/evals.html +3 -3
  60. package/dist/docs/example-agents/approval-buddy.html +3 -3
  61. package/dist/docs/example-agents/benny.html +3 -3
  62. package/dist/docs/example-agents/bugbot.html +3 -3
  63. package/dist/docs/example-agents/codebase-wiki.html +3 -3
  64. package/dist/docs/example-agents/codeowners-review.html +3 -3
  65. package/dist/docs/example-agents/concierge.html +3 -3
  66. package/dist/docs/example-agents/fsd.html +3 -3
  67. package/dist/docs/example-agents/index.html +3 -3
  68. package/dist/docs/example-agents/knowledge-base.html +3 -3
  69. package/dist/docs/example-agents/oncall.html +3 -3
  70. package/dist/docs/example-agents/security-reviewer.html +3 -3
  71. package/dist/docs/example-agents/slack-agent.html +3 -3
  72. package/dist/docs/example-agents/weather-agent.html +3 -3
  73. package/dist/docs/guides/agent-to-agent.html +3 -3
  74. package/dist/docs/guides/cloud-runtime.html +3 -3
  75. package/dist/docs/guides/convert-automation.html +3 -3
  76. package/dist/docs/guides/github.html +3 -3
  77. package/dist/docs/guides/human-in-the-loop.html +3 -3
  78. package/dist/docs/guides/mcp-oauth.html +5 -5
  79. package/dist/docs/guides/opentelemetry.html +3 -3
  80. package/dist/docs/guides/slack.html +3 -3
  81. package/dist/docs/guides/webhooks.html +3 -3
  82. package/dist/docs/hashmap.json +1 -1
  83. package/dist/docs/hillclimbing.html +3 -3
  84. package/dist/docs/index.html +3 -3
  85. package/dist/docs/quickstart.html +3 -3
  86. package/dist/docs/reference/agent-config.html +5 -6
  87. package/dist/docs/reference/artifacts.html +3 -3
  88. package/dist/docs/reference/channels.html +3 -3
  89. package/dist/docs/reference/cli.html +3 -3
  90. package/dist/docs/reference/connections.html +28 -11
  91. package/dist/docs/reference/hooks.html +3 -3
  92. package/dist/docs/reference/http-api.html +3 -3
  93. package/dist/docs/reference/instructions.html +3 -3
  94. package/dist/docs/reference/playground.html +3 -3
  95. package/dist/docs/reference/project-layout.html +3 -3
  96. package/dist/docs/reference/prompt.html +3 -3
  97. package/dist/docs/reference/schedules.html +3 -3
  98. package/dist/docs/reference/sessions.html +5 -5
  99. package/dist/docs/reference/skills.html +3 -3
  100. package/dist/docs/reference/subagents.html +3 -3
  101. package/dist/docs/reference/tools.html +5 -5
  102. package/dist/docs/scaffolding-agents.html +3 -3
  103. package/dist/docs/storage.html +3 -3
  104. package/dist/docs/templates/agentic-owners.html +3 -3
  105. package/dist/docs/templates/demo.html +3 -3
  106. package/dist/docs/templates/pr-autofixer.html +3 -3
  107. package/dist/docs/templates/security-reviewer.html +3 -3
  108. package/dist/docs/templates/triage.html +3 -3
  109. package/dist/docs/troubleshooting.html +5 -5
  110. package/dist/files-backends/agent-store-presigned-url.js +1 -1
  111. package/dist/index.d.ts +2 -2
  112. package/dist/index.d.ts.map +1 -1
  113. package/dist/index.js +1 -1
  114. package/dist/internal/advertise-tools.d.ts +79 -0
  115. package/dist/internal/advertise-tools.d.ts.map +1 -0
  116. package/dist/internal/advertise-tools.js +185 -0
  117. package/dist/internal/cli-deploy.d.ts.map +1 -1
  118. package/dist/internal/cli-deploy.js +7 -1
  119. package/dist/internal/cli-manifest.d.ts +19 -0
  120. package/dist/internal/cli-manifest.d.ts.map +1 -0
  121. package/dist/internal/cli-manifest.js +49 -0
  122. package/dist/internal/cli-slack.d.ts.map +1 -1
  123. package/dist/internal/cli-slack.js +9 -1
  124. package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -1
  125. package/dist/internal/convert-automation/convert-workflow.js +2 -10
  126. package/dist/internal/cursor/account-mcp.d.ts +29 -3
  127. package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
  128. package/dist/internal/cursor/account-mcp.js +147 -67
  129. package/dist/internal/cursor/backend-client.d.ts +11 -6
  130. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  131. package/dist/internal/cursor/backend-client.js +32 -10
  132. package/dist/internal/cursor-account-mcp-auth.d.ts +11 -0
  133. package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -1
  134. package/dist/internal/cursor-account-mcp-auth.js +69 -0
  135. package/dist/internal/cursor-agent-template.d.ts +9 -0
  136. package/dist/internal/cursor-agent-template.d.ts.map +1 -0
  137. package/dist/internal/cursor-agent-template.js +37 -0
  138. package/dist/internal/deploy-client.d.ts +1 -0
  139. package/dist/internal/deploy-client.d.ts.map +1 -1
  140. package/dist/internal/deploy-client.js +18 -2
  141. package/dist/internal/deploy-manifest.d.ts +76 -0
  142. package/dist/internal/deploy-manifest.d.ts.map +1 -0
  143. package/dist/internal/deploy-manifest.js +117 -0
  144. package/dist/internal/deployment-scm-event-stream.d.ts +116 -0
  145. package/dist/internal/deployment-scm-event-stream.d.ts.map +1 -0
  146. package/dist/internal/deployment-scm-event-stream.js +474 -0
  147. package/dist/internal/discovery.d.ts.map +1 -1
  148. package/dist/internal/discovery.js +111 -10
  149. package/dist/internal/init-project.d.ts.map +1 -1
  150. package/dist/internal/init-project.js +12 -123
  151. package/dist/internal/init-scaffold.d.ts +8 -0
  152. package/dist/internal/init-scaffold.d.ts.map +1 -0
  153. package/dist/internal/init-scaffold.js +168 -0
  154. package/dist/internal/inline-stdio-mcp.d.ts +2 -0
  155. package/dist/internal/inline-stdio-mcp.d.ts.map +1 -1
  156. package/dist/internal/inline-stdio-mcp.js +10 -8
  157. package/dist/internal/json-schema.d.ts +7 -0
  158. package/dist/internal/json-schema.d.ts.map +1 -1
  159. package/dist/internal/json-schema.js +18 -3
  160. package/dist/internal/mcp-endpoint.js +7 -7
  161. package/dist/internal/mcp-host.d.ts +18 -0
  162. package/dist/internal/mcp-host.d.ts.map +1 -1
  163. package/dist/internal/mcp-host.js +43 -5
  164. package/dist/internal/mcp-oauth.d.ts +22 -0
  165. package/dist/internal/mcp-oauth.d.ts.map +1 -1
  166. package/dist/internal/mcp-oauth.js +40 -1
  167. package/dist/internal/package-inline-stdio.d.ts.map +1 -1
  168. package/dist/internal/package-inline-stdio.js +5 -5
  169. package/dist/internal/review-comments.d.ts +97 -0
  170. package/dist/internal/review-comments.d.ts.map +1 -1
  171. package/dist/internal/review-comments.js +151 -0
  172. package/dist/internal/sanitize-mcp-tool-name.d.ts +20 -0
  173. package/dist/internal/sanitize-mcp-tool-name.d.ts.map +1 -0
  174. package/dist/internal/sanitize-mcp-tool-name.js +30 -0
  175. package/dist/internal/sdk-runner.d.ts +1 -1
  176. package/dist/internal/sdk-runner.d.ts.map +1 -1
  177. package/dist/internal/sdk-runner.js +36 -13
  178. package/dist/internal/server.d.ts.map +1 -1
  179. package/dist/internal/server.js +18 -0
  180. package/dist/internal/session-engine.d.ts +66 -0
  181. package/dist/internal/session-engine.d.ts.map +1 -1
  182. package/dist/internal/session-engine.js +428 -110
  183. package/dist/internal/shallow-clone.d.ts +170 -0
  184. package/dist/internal/shallow-clone.d.ts.map +1 -0
  185. package/dist/internal/shallow-clone.js +412 -0
  186. package/dist/internal/slack-provision-client.d.ts +2 -0
  187. package/dist/internal/slack-provision-client.d.ts.map +1 -1
  188. package/dist/internal/slack-provision-client.js +1 -0
  189. package/dist/internal/terminal-style.d.ts +18 -0
  190. package/dist/internal/terminal-style.d.ts.map +1 -1
  191. package/dist/internal/terminal-style.js +46 -1
  192. package/dist/internal/turn-lease-store.d.ts +44 -0
  193. package/dist/internal/turn-lease-store.d.ts.map +1 -0
  194. package/dist/internal/turn-lease-store.js +139 -0
  195. package/dist/internal/workspace.d.ts +14 -0
  196. package/dist/internal/workspace.d.ts.map +1 -1
  197. package/dist/internal/workspace.js +33 -0
  198. package/dist/playground/assets/index-77uhu5Kr.css +1 -0
  199. package/dist/playground/assets/index-D4buox4m.js +85 -0
  200. package/dist/playground/index.html +2 -2
  201. package/dist/storage-protocol.d.ts +122 -0
  202. package/dist/storage-protocol.d.ts.map +1 -0
  203. package/dist/storage-protocol.js +173 -0
  204. package/dist/storage.d.ts +2 -72
  205. package/dist/storage.d.ts.map +1 -1
  206. package/dist/storage.js +2 -82
  207. package/dist/tools.d.ts +7 -0
  208. package/dist/tools.d.ts.map +1 -1
  209. package/dist/types.d.ts +141 -6
  210. package/dist/types.d.ts.map +1 -1
  211. package/docs/concepts.md +4 -4
  212. package/docs/guides/mcp-oauth.md +3 -1
  213. package/docs/reference/agent-config.md +11 -12
  214. package/docs/reference/connections.md +108 -10
  215. package/docs/reference/sessions.md +2 -2
  216. package/docs/reference/tools.md +14 -0
  217. package/docs/troubleshooting.md +3 -2
  218. package/package.json +7 -2
  219. package/skills/create-agent/SKILL.md +12 -9
  220. package/skills/debug/SKILL.md +2 -1
  221. package/skills/framework-map/SKILL.md +6 -6
  222. package/skills/mcp-auth/SKILL.md +8 -6
  223. package/src/bin/agent-serve.ts +12 -2
  224. package/src/channels/github/api.ts +6 -1
  225. package/src/channels/github/binding.ts +21 -0
  226. package/src/channels/github/checks.ts +179 -0
  227. package/src/channels/github/cursor-account.ts +9 -6
  228. package/src/channels/github/index.ts +1 -0
  229. package/src/channels/github/types.ts +8 -0
  230. package/src/channels/slack/channel-watch.ts +6 -3
  231. package/src/channels/slack/dispatch.ts +40 -3
  232. package/src/channels/slack/manifest.ts +9 -10
  233. package/src/channels/slack/nudge-store.ts +56 -0
  234. package/src/channels/slack/slack-channel.ts +3 -0
  235. package/src/channels/slack/types.ts +24 -7
  236. package/src/connections.ts +17 -5
  237. package/src/index.ts +5 -0
  238. package/src/internal/advertise-tools.ts +278 -0
  239. package/src/internal/cli-deploy.ts +11 -1
  240. package/src/internal/cli-manifest.ts +63 -0
  241. package/src/internal/cli-slack.ts +10 -1
  242. package/src/internal/convert-automation/convert-workflow.ts +2 -11
  243. package/src/internal/cursor/account-mcp.ts +208 -73
  244. package/src/internal/cursor/backend-client.ts +45 -11
  245. package/src/internal/cursor-account-mcp-auth.ts +83 -0
  246. package/src/internal/cursor-agent-template.ts +46 -0
  247. package/src/internal/deploy-client.ts +25 -6
  248. package/src/internal/deploy-manifest.ts +161 -0
  249. package/src/internal/deployment-scm-event-stream.ts +593 -0
  250. package/src/internal/discovery.ts +132 -3
  251. package/src/internal/init-project.ts +18 -153
  252. package/src/internal/init-scaffold.ts +176 -0
  253. package/src/internal/inline-stdio-mcp.ts +13 -0
  254. package/src/internal/json-schema.ts +24 -3
  255. package/src/internal/mcp-endpoint.ts +6 -0
  256. package/src/internal/mcp-host.ts +70 -9
  257. package/src/internal/mcp-oauth.ts +55 -1
  258. package/src/internal/package-inline-stdio.ts +5 -1
  259. package/src/internal/review-comments.ts +245 -0
  260. package/src/internal/sanitize-mcp-tool-name.ts +33 -0
  261. package/src/internal/sdk-runner.ts +50 -11
  262. package/src/internal/server.ts +19 -0
  263. package/src/internal/session-engine.ts +392 -19
  264. package/src/internal/shallow-clone.ts +595 -0
  265. package/src/internal/slack-provision-client.ts +3 -0
  266. package/src/internal/terminal-style.ts +67 -1
  267. package/src/internal/turn-lease-store.ts +147 -0
  268. package/src/internal/workspace.ts +33 -0
  269. package/src/storage-protocol.ts +247 -0
  270. package/src/storage.ts +16 -110
  271. package/src/tools.ts +7 -0
  272. package/src/types.ts +149 -7
  273. package/templates/agentic-owners/agent/agent.ts +3 -0
  274. package/templates/demo/agent/agent.ts +3 -0
  275. package/templates/pr-autofixer/agent/lib/drive-schemas.ts +4 -1
  276. package/templates/security-reviewer/agent/agent.ts +3 -0
  277. package/templates/triage/agent/agent.ts +3 -0
  278. package/dist/docs/assets/chunks/@localSearchIndexroot.5ozYNf74.js +0 -1
  279. package/dist/docs/assets/reference_connections.md.CSQiNzre.lean.js +0 -1
  280. package/dist/docs/assets/troubleshooting.md.CuVztCKs.js +0 -1
  281. package/dist/playground/assets/index-B4rcOgeP.css +0 -1
  282. package/dist/playground/assets/index-DXcY42Jv.js +0 -85
  283. /package/dist/docs/assets/{concepts.md.CqOsxbMU.lean.js → concepts.md.BXAm6G-C.lean.js} +0 -0
  284. /package/dist/docs/assets/{guides_mcp-oauth.md.C7G7IykG.lean.js → guides_mcp-oauth.md.CzEB6RaG.lean.js} +0 -0
  285. /package/dist/docs/assets/{reference_sessions.md.DBVFi2Sx.lean.js → reference_sessions.md.B0DdlM-K.lean.js} +0 -0
  286. /package/dist/docs/assets/{troubleshooting.md.CuVztCKs.lean.js → troubleshooting.md.DQ-hYuZT.lean.js} +0 -0
@@ -37,7 +37,6 @@ copies them onto the hosted deployment as `MCP_OAUTH_<NAME>_*` secrets.
37
37
  export default defineConnection({
38
38
  url: "https://mcp.example.com/inventory",
39
39
  oauth: true,
40
- hostOnly: true, // model cannot call; host.mcp still can
41
40
  });
42
41
  ```
43
42
 
@@ -49,10 +48,96 @@ agent-sdk mcp oauth inventory --store # also upsert deployment secrets
49
48
  Full walkthrough: [Host MCP OAuth](../guides/mcp-oauth.md). Companion
50
49
  skill: [`skills/mcp-auth/SKILL.md`](../../skills/mcp-auth/SKILL.md).
51
50
 
52
- Use `hostOnly: true` when only deterministic host tools should call the
53
- server (deploys, admin APIs). Account MCP (`cursorAccount: true`) stays
54
- the right choice for connectors already linked in the Cursor dashboard;
55
- omit `servers` (or pass `"*"`) to forward every connected connector.
51
+ Set `hostOnly: true` only when host tools should call the server and the
52
+ model should not. Playground chat will not see those tools. Account MCP
53
+ (`cursorAccount: true`) is the right choice for connectors already linked
54
+ in the Cursor dashboard. Omit `servers` (or pass `"*"`) to forward every
55
+ connected connector. If the model should call those tools by name on
56
+ local turns, set `advertiseTools: true`.
57
+
58
+ ## Per-session auth (`auth`)
59
+
60
+ For http/sse connections whose credential depends on **who the session is
61
+ for** — a multi-tenant agent asserting the tenant it is acting for —
62
+ declare an `auth` callback instead of static headers. It runs host-side
63
+ at turn-build time with the session's `SessionInfo` and returns headers
64
+ merged over the static ones:
65
+
66
+ ```ts
67
+ export default defineConnection({
68
+ url: "https://api.cursor.com/v1/mcp/plugins",
69
+ auth: async (session) => ({
70
+ headers: { Authorization: `Bearer ${await grantFor(session)}` },
71
+ }),
72
+ advertiseTools: true, // optional — named tools instead of meta-tools
73
+ });
74
+ ```
75
+
76
+ The callback is evaluated on **every local turn** — reminder fires and
77
+ post-restart follow-ups included — so the identity always comes from the
78
+ session itself, never from state parked in memory. The model never sees a
79
+ tenant parameter and can never choose the tenant. A callback that throws
80
+ fails the turn: a turn never silently runs without the connection's
81
+ identity. Local runtime only; cloud turns are refused. `host.mcp` calls
82
+ from server tools keep the static headers only. Not combinable with
83
+ `oauth: true` — the host OAuth provider owns the Authorization header.
84
+
85
+ Derive the identity from durable session facts — `session.auth`,
86
+ `session.id`, or your channel's own session state. Do **not** key it off
87
+ `session.continuationKey`: the HTTP channel rotates the continuation key
88
+ after every accepted follow-up, so a tenant mapping keyed on it silently
89
+ breaks mid-conversation. (Channels that mint stable, parseable tokens by
90
+ design are the exception.)
91
+
92
+ `auth` works attached or advertised. Advertised connections open
93
+ per-operation clients with the evaluated headers. Attached connections
94
+ ride the turn's SDK `mcpServers`, passed on **every send** rather than
95
+ pinned on the cached per-session agent handle, so a rotated credential is
96
+ live on the very next turn. The cost: when any attached connection has
97
+ `auth`, *all* of the agent's attached connections are configured per
98
+ send — the harness opens fresh MCP clients for them on each turn, so a
99
+ stdio (`command`) server respawns per turn and loses any in-process
100
+ state; keep stateful stdio servers out of agents that attach an auth'd
101
+ connection (or advertise the auth'd connection instead). Workspace
102
+ prewarm has no session, so it omits auth'd connections rather than
103
+ attaching them without an identity.
104
+
105
+ ## Advertise a connection's tools by name (`advertiseTools`) {#advertise-tools}
106
+
107
+ Attached MCP servers sit behind the harness MCP meta-tools. The model does
108
+ not see names like `Datadog-search_datadog_dashboards` until you set
109
+ `advertiseTools: true`. Use that flag when playground or local chat should
110
+ call the tools by name.
111
+
112
+ The engine lists the connection at turn-build time and synthesizes a named
113
+ 1:1 passthrough server tool per entry, using the server's names,
114
+ descriptions, and live schemas. Those merge into the authored
115
+ `agent/tools/` catalog. The raw connection is then not attached to the
116
+ model (it stays available on `host.mcp`), so each tool appears exactly
117
+ once.
118
+
119
+ ```ts
120
+ export default defineConnection({
121
+ url: "https://api.cursor.com/v1/mcp/plugins",
122
+ auth: async (session) => ({ headers: await tenantHeaders(session) }),
123
+ advertiseTools: true,
124
+ });
125
+ ```
126
+
127
+ Fail-closed, by design: a `listTools` failure, an invalid tool name, or a
128
+ name collision (with an authored tool or another advertised connection)
129
+ fails the turn. A turn never silently runs with a shrunken toolset.
130
+ Listing runs once per turn, so point this at endpoints that answer
131
+ `tools/list` cheaply. Connections with `auth` are listed and called
132
+ through one-off clients carrying that session's headers. Auth-less ones
133
+ (including Cursor account connections) go through the shared host
134
+ registry. Local runtime only, like all server tools, and not combinable
135
+ with `hostOnly`. Advertising puts the tools in the model's toolset.
136
+ `hostOnly` keeps them off the model. `GET /v1/info` reports
137
+ `advertiseTools` on the connection. The per-tool list is built per turn,
138
+ not on the static catalog, the peer-agent MCP server, or cloud
139
+ `agentsdk-tools`, and those advertised tools cannot be invoked via direct
140
+ tool calls.
56
141
 
57
142
  ## Local stdio MCP server
58
143
 
@@ -100,17 +185,29 @@ behavior in an explicit form. Pass a name list when you want a smaller
100
185
  set.
101
186
 
102
187
  ```ts
103
- // agent/mcp-connections/cursor.ts: every connected connector
104
- export default defineConnection({ cursorAccount: true });
188
+ // agent/mcp-connections/account.ts: every connected connector
189
+ export default defineConnection({
190
+ cursorAccount: true,
191
+ advertiseTools: true,
192
+ });
105
193
  // same, spelled out:
106
- export default defineConnection({ cursorAccount: true, servers: "*" });
194
+ export default defineConnection({
195
+ cursorAccount: true,
196
+ servers: "*",
197
+ advertiseTools: true,
198
+ });
107
199
  // only Linear:
108
200
  export default defineConnection({
109
201
  cursorAccount: true,
110
202
  servers: ["Linear"],
203
+ advertiseTools: true,
111
204
  });
112
205
  ```
113
206
 
207
+ Name the file `account.ts`. `cursor.ts` collides with the IDE `cursor`
208
+ MCP namespace. `advertiseTools: true` puts connector tools on local
209
+ turns by name. Without it they sit behind harness meta-tools.
210
+
114
211
  The host must be signed in (`agent-sdk login` or `CURSOR_API_KEY`).
115
212
  `serve` fails fast at startup otherwise, and logs each connector's live
116
213
  status (`connected`, `needsAuth`, `error`) as it starts.
@@ -152,8 +249,9 @@ are in the [Agent-to-agent guide](../guides/agent-to-agent.md).
152
249
 
153
250
  One authored MCP connection serves three consumers.
154
251
 
155
- 1. **Cursor agent:** Local or cloud turns see the MCP connection
156
- through SDK `mcpServers`, and the model calls its tools directly.
252
+ 1. **Cursor agent:** Attached connections ride SDK `mcpServers` behind
253
+ harness MCP meta-tools. Set `advertiseTools: true` so local turns see
254
+ named tools. `hostOnly` keeps the connection off the model.
157
255
  2. **Server tools:** Deterministic host code composes MCP calls
158
256
  through `ctx.host.mcp`:
159
257
 
@@ -150,8 +150,8 @@ disappears from listings and can no longer be streamed or continued.
150
150
  The `runner/` store keeps its own conversation copy until you remove it.
151
151
  Cloud conversations remain on the Cursor backend.
152
152
 
153
- Change the root with `--state-root` or `stateRoot`. Keep it outside
154
- repositories whose parent rules shouldn't reach the agent. See
153
+ Change the root with `--state-root` or `stateRoot`. Nested git checkouts
154
+ already default `local.cwd` outside the enclosing repo. See
155
155
  [local session workspaces](../concepts.md#what-files-can-a-local-session-access).
156
156
 
157
157
  ## How do I inspect a saved event stream?
@@ -129,6 +129,20 @@ On the local runtime, scripts land under `.agent-serve/tools/` in the
129
129
  session workspace with a catalog in `AGENTS.md`. On cloud, the catalog
130
130
  and script bodies travel on the first prompt.
131
131
 
132
+ ## Tools from an MCP connection, advertised by name
133
+
134
+ Authored `agent/tools/` files are one catalog for every session. When
135
+ the tools should come from an MCP server — including per-tenant toolsets
136
+ resolved at runtime — declare the connection with
137
+ `advertiseTools: true` (plus per-session `auth` when the credential
138
+ depends on who the session is for) and the engine synthesizes named 1:1
139
+ passthrough server tools from the connection's live `listTools` on every
140
+ local turn. See
141
+ [MCP Connections](connections.md#advertise-tools).
142
+ Advertised tools ride the same execution path as authored server tools,
143
+ but cannot be invoked via
144
+ [direct tool calls](#call-a-tool-without-a-model-turn).
145
+
132
146
  ## Gate a tool on human approval
133
147
 
134
148
  A server tool can require a person to sign off before it runs. Set
@@ -31,7 +31,8 @@ Match your symptom below. Keep the commands as `agent-sdk`; see
31
31
  | --- | --- |
32
32
  | Built-in file reads and greps fail; the turn retries for a long time | Run under Node 22.13+ (or `tsx`), never Bun. Look for `NGHTTP2_FRAME_SIZE_ERROR` in logs. |
33
33
  | The turn fails immediately with an API-key error | Sign in with `agent-sdk login`, or set `CURSOR_API_KEY`. Discovery, `info`, `call`, and serve bring-up work without a key; model turns need one. |
34
- | Replies quote rules or `AGENTS.md` from outside your agent project | The session workspace inherited parent-folder config. Point `defineAgent({ local: { cwd } })` outside that tree, or set `--state-root` to a clean directory (for example under `/tmp`). |
34
+ | Replies quote rules or `AGENTS.md` from outside your agent project | The session workspace inherited parent-folder config. Nested git checkouts default `local.cwd` to `~/.cache/agent-serve/<dir>`. Point `defineAgent({ local: { cwd } })` at a checkout only when the agent should inherit that tree, or set `--state-root` to a clean directory (for example under `/tmp`). |
35
+ | Yellow box shows Datadog/Linear tools, but the model lists `GetDynamicTools` / IDE `cursor` tools and never calls them | Attached MCP sits behind harness meta-tools, or `hostOnly` hid the connection, or the harness cwd is still inside another checkout. Set `advertiseTools: true` for named tools on local turns. Check `GET /v1/info` `local.cwd` and `connections[].advertiseTools`. |
35
36
  | Server tools, skills, or workspace seed files never appear | The agent runtime is `cloud`. Those features apply on the local runtime. `validate` warns when this combination is present. |
36
37
  | `validate` and `run` succeed, but typecheck fails in CI | The CLI runs TypeScript with type-stripping only. Keep tool `execute` return types as object literals or `type` aliases, not `interface` types. |
37
38
  | Login works, but turns are rejected when using custom API hosts | Point login and model traffic at the same host (`CURSOR_API_BASE_URL` and `CURSOR_BACKEND_URL`). A key from one host is rejected by the other. |
@@ -70,7 +71,7 @@ Match your symptom below. Keep the commands as `agent-sdk`; see
70
71
  | --- | --- |
71
72
  | `must be defineConnection({ url, oauth: true })` | The connection file needs `oauth: true`, or you passed the wrong connection name to `agent-sdk mcp oauth`. |
72
73
  | Local auth works; hosted calls unauthorized | Run `agent-sdk mcp oauth <name> --store`, confirm names with `agent-sdk secrets list <slug>`, then redeploy. |
73
- | Model asks for `mcp_auth` or IDE MCP for a privileged server | That connection is likely `hostOnly`. Call it from a host tool via `ctx.host.mcp`, and update instructions. |
74
+ | Model asks for `mcp_auth` or IDE MCP for a privileged server | That connection is `hostOnly`. Call it from a host tool via `ctx.host.mcp`, and update instructions. |
74
75
 
75
76
  See [Host MCP OAuth](./guides/mcp-oauth.md) and
76
77
  [`skills/mcp-auth/SKILL.md`](../skills/mcp-auth/SKILL.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cursor/july",
3
- "version": "0.1.62",
3
+ "version": "0.1.73",
4
4
  "description": "(early alpha) Filesystem-first framework for defining Cursor agents as markdown and TypeScript and serving them over channels with the Cursor SDK.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "repository": {
@@ -150,18 +150,21 @@
150
150
  },
151
151
  "./kv": {
152
152
  "anysphere-source": "./src/kv.ts",
153
+ "bun": "./dist/kv.js",
153
154
  "types": "./dist/kv.d.ts",
154
155
  "import": "./dist/kv.js",
155
156
  "default": "./dist/kv.js"
156
157
  },
157
158
  "./kv/memory": {
158
159
  "anysphere-source": "./src/kv/memory-kv.ts",
160
+ "bun": "./dist/kv/memory-kv.js",
159
161
  "types": "./dist/kv/memory-kv.d.ts",
160
162
  "import": "./dist/kv/memory-kv.js",
161
163
  "default": "./dist/kv/memory-kv.js"
162
164
  },
163
165
  "./ledger": {
164
166
  "anysphere-source": "./src/ledger.ts",
167
+ "bun": "./dist/ledger.js",
165
168
  "types": "./dist/ledger.d.ts",
166
169
  "import": "./dist/ledger.js",
167
170
  "default": "./dist/ledger.js"
@@ -221,7 +224,7 @@
221
224
  "node": ">=22.13"
222
225
  },
223
226
  "dependencies": {
224
- "@cursor/sdk": "1.0.27",
227
+ "@cursor/sdk": "1.0.28",
225
228
  "@modelcontextprotocol/sdk": "1.25.1",
226
229
  "@octokit/auth-app": "^7.2.0",
227
230
  "@octokit/rest": "^21.1.1",
@@ -246,6 +249,7 @@
246
249
  "javascript-time-ago": "^2.6.4",
247
250
  "js-yaml": "4.1.0",
248
251
  "ms": "^2.1.3",
252
+ "proper-lockfile": "^4.1.2",
249
253
  "slackify-markdown": "^5.0.0",
250
254
  "tsx": "^4.0.0",
251
255
  "esbuild": "^0.25.0",
@@ -263,6 +267,7 @@
263
267
  "@types/ms": "^2.1.0",
264
268
  "@types/node": "catalog:",
265
269
  "@types/pg": "^8.16.0",
270
+ "@types/proper-lockfile": "^4.1.4",
266
271
  "@types/react": "^19.0.0",
267
272
  "@types/react-dom": "^19.0.0",
268
273
  "@typescript/native-preview": "7.0.0-dev.20260701.1",
@@ -62,7 +62,7 @@ questions, concrete options, the recommended option listed first and labeled
62
62
  | **Runtime** | `local` (default) · `cloud` | Local = Cursor SDK harness on this machine; server tools, skills, sandbox seeds, and tool approvals all work. Cloud = Cursor cloud agents; needs `cloud.repos`, no server tools/skills/sandbox seeds (instructions are prepended to the first prompt). Recommend local unless the purpose needs a repo checkout on a cloud VM. |
63
63
  | **Model** | `grok-4.5` with `effort=high`, `fast=true` (default) · Other model id | Effort and fast are params, not id suffixes: `{ id: "grok-4.5", params: [{ id: "effort", value: "high" }, { id: "fast", value: "true" }] }` — the SDK rejects suffix-style ids. |
64
64
  | **Channels** (multi) | playground + HTTP API only (always mounted) · Slack · GitHub webhooks · custom webhook · schedule (cron) | Slack has two connections: the Cursor-hosted connection (`cursorAccount: true` — zero Slack admin, recommended default) and a dedicated Socket Mode app (own bot user + one app/token pair per agent; needed for channel watching or approval buttons). When Slack is picked, resolve the connection with the Step 0 gate in `setup-slack/SKILL.md` — either fold its AskQuestion into this round or ask it before channel setup; default to Cursor-hosted when you cannot ask. GitHub verifies `X-Hub-Signature-256` when a secret is set. Discord/Teams packs do not exist yet — offer custom webhook instead. |
65
- | **MCP connections** (multi) | none · remote server (URL + header auth) · local stdio server · Other | One file per server under `agent/mcp-connections/`; filename = server name; tokens via env vars, never hardcoded. MCP connections serve the model **and** host code (`ctx.host.mcp`, channel `host.mcp`). |
65
+ | **MCP connections** (multi) | none · remote server (URL + header auth) · local stdio server · Cursor account connectors · Other | One file per server under `agent/mcp-connections/`; filename = server name. Do not name an account connection `cursor.ts` (collides with the IDE `cursor` namespace); use `account.ts`. Tokens via env vars, never hardcoded. Connections serve the model and host code (`ctx.host.mcp`). If the model should call them by name on local turns, set `advertiseTools: true`. Set `hostOnly: true` only when host tools call the server and the playground must not. |
66
66
  | **Capabilities** (multi) | server tools · agent tools (scripts) · skills · subagents · hooks · sandbox seed files · tool approvals (HITL) · evals (recommend) | Server tools, skills, sandbox seeds, approvals are local-runtime only. Agent tools (`execution: "agent"`) work on both runtimes. Always recommend at least one smoke eval. |
67
67
 
68
68
  Close the round with a one-screen plan — chosen options plus the file tree you
@@ -87,6 +87,10 @@ Defaults that make first cuts good:
87
87
 
88
88
  - **Minimal surface.** Instructions + 1–2 real tools + the chosen channels +
89
89
  one smoke eval. Unpicked capabilities are follow-ups, not scope.
90
+ - **`local.cwd`.** Keep the harness outside a monorepo checkout
91
+ (`~/.cache/agent-serve/<slug>`). Discovery does this for nested git
92
+ projects. Point cwd at a checkout only when the agent must inherit that
93
+ tree.
90
94
  - **Instructions** (`agent/instructions.md`, required): a few lines — identity,
91
95
  when to use which tool, output shape. Not an essay.
92
96
  - **Tool per file**, filename = tool name the model sees. Prefer
@@ -139,9 +143,9 @@ agent-sdk init ./<slug>
139
143
  ```
140
144
 
141
145
  `init` writes `package.json` (with `typescript` dev deps and a
142
- `check` script), `tsconfig.json`, `agent/agent.ts`, `agent/instructions.md`,
143
- a demo `agent/tools/echo.ts`, and empty capability folders
144
- (`skills/`, `channels/`, `evals/`, …) each with a `.gitkeep`; existing
146
+ `check` script), `tsconfig.json`, `AGENTS.md`, `.gitignore`, `agent/agent.ts`,
147
+ `agent/instructions.md`, a demo `agent/tools/echo.ts`, and empty capability
148
+ folders (`skills/`, `channels/`, `evals/`, …) each with a `.gitkeep`; existing
145
149
  files are left alone (`exist`) and missing ones are filled in. It then
146
150
  runs `npm install`, and when the host is unsigned runs `login` and waits
147
151
  before printing `cd` (when needed) and `agent-sdk dev`. Then shape it to the
@@ -149,8 +153,7 @@ plan:
149
153
 
150
154
  1. `tsconfig.json` — init writes a strict, `noEmit` config covering `agent/`
151
155
  and `evals/`; extend it only when the project needs more.
152
- 2. `agent/agent.ts` — chosen model/runtime via `defineAgent({...})`; add the
153
- `cloud: { repos: [...] }` block for cloud runtime.
156
+ 2. `agent/agent.ts` — chosen model/runtime via `defineAgent({...})`. Nested git checkouts get `local.cwd` under `~/.cache/agent-serve/<slug>` at discovery even if omitted. Add the `cloud: { repos: [...] }` block for cloud runtime.
154
157
  3. `agent/instructions.md` — real instructions; delete or replace `echo.ts`
155
158
  with the real tools.
156
159
  4. Add the chosen `channels/`, `mcp-connections/`, `skills/`, `subagents/<id>/`
@@ -210,9 +213,9 @@ agent-sdk eval --dir ./<slug>
210
213
 
211
214
  Serve only the new agent's directory during bring-up — pointing `serve` at a
212
215
  parent folder also mounts every sibling agent it contains.
213
- Runtime state lands in `<project>/.agent-serve/` (gitignored); keep durable
214
- `--state-root` outside the monorepo so sessions don't inherit ambient
215
- `AGENTS.md`.
216
+ Runtime state lands in `<project>/.agent-serve/` (gitignored). Nested
217
+ checkouts default `local.cwd` to `~/.cache/agent-serve/<slug>` at
218
+ discovery. `--state-root` is for session files, not harness cwd.
216
219
 
217
220
  ## Channel setup with the user
218
221
 
@@ -47,7 +47,8 @@ curl -sN 'localhost:3000/<slug>/v1/session/<id>/stream?startIndex=0' | head -50
47
47
  | Every built-in read/grep the model makes fails; turns crawl through retry loops | You ran the CLI under **Bun**. Kill it, rerun under Node/tsx. (`NGHTTP2_FRAME_SIZE_ERROR` in SDK logs is the tell.) |
48
48
  | `gh webhook forward` / `agent-sdk github forward` deliveries all 401 — but hook creation succeeded | `GITHUB_TOKEN`/`GH_TOKEN` in the env. The relay authenticates with the gh CLI login and rejects env tokens. `GITHUB_TOKEN= GH_TOKEN= agent-sdk github forward ...` |
49
49
  | `Hook already exists` starting a forwarder | GitHub allows one forwarder per repo. Use one `github forward --dir <parent>` (it fans out to every matching channel) instead of N processes; kill stale forwarders. |
50
- | Agent's answers reference monorepo rules / AGENTS.md it shouldn't know | Session workspace sits inside the monorepo, so the harness loaded ancestor config. `defineAgent({ local: { cwd } })` outside the repo, or `--state-root` under `/tmp`. |
50
+ | Agent's answers reference monorepo rules / AGENTS.md it shouldn't know | Session workspace sits inside another git checkout, so the harness loaded ancestor config. Nested projects default `local.cwd` to `~/.cache/agent-serve/<dir>`. Point cwd at a checkout only when the agent should inherit that tree. |
51
+ | Yellow box lists Datadog/Linear tools; model recites `GetDynamicTools` / IDE `cursor` tools and never calls MCP | Attached MCP is behind meta-tools, or `hostOnly` hid it, or cwd still leaked IDE MCP. Set `advertiseTools: true` for named tools on local turns. Confirm `GET /v1/info` `local.cwd` and `connections[].advertiseTools`. |
51
52
  | Port 3000/5273 in use; stray processes after crashes | `lsof -iTCP:3000 -sTCP:LISTEN`, kill the pids; also check companion processes (e.g. vite). |
52
53
  | Pending tool approval vanished after server restart | By design: parked SDK calls don't survive host restart; they resolve as interrupted. Re-run the turn. |
53
54
  | Schedule / reminder never fires under `--dev` | Dev never auto-fires. `POST /<slug>/v1/dev/schedules/<id>` or `POST /<slug>/v1/dev/reminders/<id>` (list at `GET /v1/dev/reminders`). |
@@ -38,11 +38,11 @@ pnpm exec tsx src/bin/agent-serve.ts <cmd> ...
38
38
  before shipping. Classic miss: a tool `execute` return that fails
39
39
  `ToolExecuteResult` — returns must be JSON-shaped, so use object
40
40
  literals or `type` aliases, not `interface` types.
41
- 4. **Keep session state out of big monorepos.** Session workspaces are real
42
- Cursor project directories and inherit ambient `AGENTS.md`/`.cursor`
43
- rules from **ancestors**. Set `defineAgent({ local: { cwd } })` outside
44
- the monorepo or pass a temp `--state-root`. (`run`/`eval` already use a
45
- temp state root.)
41
+ 4. **Harness cwd in a nested git repo.** Discovery defaults `local.cwd` to
42
+ `~/.cache/agent-serve/<dir>` so ancestor `AGENTS.md` / `.cursor` / IDE
43
+ MCP do not leak into playground turns. Set cwd at a checkout only when
44
+ the agent must inherit that tree. Attached MCP is invisible by name
45
+ until `advertiseTools: true`. `hostOnly` hides it from the model.
46
46
  5. **A model turn needs `CURSOR_API_KEY`.** Everything structural
47
47
  (`validate`, `info`, `call`, `serve` bring-up) works without one.
48
48
 
@@ -57,7 +57,7 @@ path live under README "Folder structure".
57
57
  | `agent/instructions.md` | Always-on system prompt (required; `.ts`/dir forms exist) |
58
58
  | `agent/tools/<name>.ts` | One typed tool; filename = tool name. `execution: "server"` (in-process, default) or `"agent"` (script that runs where the agent runs) |
59
59
  | `agent/skills/*` | SKILL.md-convention procedures, loaded on demand |
60
- | `agent/mcp-connections/<name>.ts` | MCP servers available to the model, to server tools (`ctx.host.mcp`), and to channel/schedule handlers (`args.host.mcp`). `{ tools }` authors TypeScript the Agent SDK packages as stdio MCP for the agent environment. |
60
+ | `agent/mcp-connections/<name>.ts` | MCP servers. Do not name an account connection `cursor.ts`. `advertiseTools: true` for named tools on local turns; `hostOnly` keeps them off the model. `{ tools }` authors TypeScript the Agent SDK packages as stdio MCP. |
61
61
  | `agent/subagents/<id>/` | Child agent dir (`description` required; per-subagent tools/skills/MCP connections ignored for now) |
62
62
  | `agent/channels/*.ts` | HTTP surfaces beyond the built-in session API; `slack.ts` / `github.ts` use the platform packs |
63
63
  | `agent/hooks/*.ts` | Observe-only event subscribers (never fatal) |
@@ -3,7 +3,7 @@ name: agentkit-mcp-auth
3
3
  description: >-
4
4
  Authorize host MCP OAuth for defineConnection({ url, oauth: true }):
5
5
  agent-sdk mcp oauth, local mcp-auth.json, --store deployment secrets,
6
- hostOnly, and egress. Read when wiring or debugging MCP auth.
6
+ hostOnly, advertiseTools, and egress. Read when wiring or debugging MCP auth.
7
7
  ---
8
8
 
9
9
  # Host MCP OAuth (mcp auth)
@@ -26,13 +26,15 @@ Docs: `docs/guides/mcp-oauth.md`, `docs/reference/connections.md`,
26
26
  | Remote URL that speaks OAuth; host must hold tokens | `defineConnection({ url, oauth: true })` + this skill |
27
27
  | Static bearer / API key | `headers` / env on a plain `{ url }` connection |
28
28
 
29
- Prefer `hostOnly: true` when only host tools / channel handlers should
30
- call the server (admin APIs, privileged writes). The model will not see
31
- those tools.
29
+ Set `hostOnly: true` only when host tools / channel handlers should call
30
+ the server and the model should not (admin APIs, privileged writes).
31
+ Playground chat will not see those tools. For connectors the model should
32
+ call on local turns (Linear, Datadog, account MCP), omit `hostOnly` and
33
+ set `advertiseTools: true`.
32
34
 
33
35
  ## Goal checklist
34
36
 
35
- - [ ] `agent/mcp-connections/<name>.ts` with `url` + `oauth: true` (+ `hostOnly` if privileged)
37
+ - [ ] `agent/mcp-connections/<name>.ts` with `url` + `oauth: true` (`hostOnly` if privileged; `advertiseTools` if the model should call it)
36
38
  - [ ] `hosting.secretNames` lists `MCP_OAUTH_<NAME>_{ACCESS_TOKEN,REFRESH_TOKEN,CLIENT_ID}` when you will `--store`
37
39
  - [ ] Hosted engines that reach non-bootstrap hosts declare `hosting.egressDomains`
38
40
  - [ ] Local: `agent-sdk mcp oauth <name>` succeeds
@@ -127,7 +129,7 @@ redeploy completed, then exercise the same host tool once.
127
129
  | `Unknown MCP connection` | Filename under `agent/mcp-connections/` must match CLI arg |
128
130
  | Callback hang | Free port 8787; finish browser flow on this machine |
129
131
  | Hosted 401 / unauthorized | `secrets list`; re-run `--store`; redeploy |
130
- | Model invents `mcp_auth` / IDE MCP | Connection is `hostOnly`; fix instructions + use host tools |
132
+ | Model invents `mcp_auth` / IDE MCP | `hostOnly` hid it, or attached MCP is behind meta-tools. Use host tools for privileged servers. Set `advertiseTools: true` for named tools on local turns. |
131
133
  | Tokens ignored after URL edit | Expected; run `mcp oauth` again for the new resource URL |
132
134
 
133
135
  ## Don't
@@ -58,6 +58,7 @@ import {
58
58
  cmdStop,
59
59
  type DeployCliOptions,
60
60
  } from "../internal/cli-deploy.js";
61
+ import { cmdManifest } from "../internal/cli-manifest.js";
61
62
  import {
62
63
  CLI_COMMAND_NAME as CLI,
63
64
  PACKAGE_NAME,
@@ -139,6 +140,7 @@ Usage:
139
140
  [--no-wait] [--repo <url>] [--ref <ref>]
140
141
  [--path <agentPath>] [--cursor-events-repo <owner/name>]...
141
142
  [--allow-domain <domain>]...
143
+ ${CLI} manifest [--dir <path>] [--json]
142
144
  ${CLI} deployments [--team <id>] [--json]
143
145
  ${CLI} deployment <slug> [--team <id>] [--json]
144
146
  ${CLI} stop <slug> [--team <id>] [--json] [--no-wait]
@@ -742,6 +744,13 @@ async function main(argv: string[]): Promise<number> {
742
744
  });
743
745
  }
744
746
 
747
+ case "manifest": {
748
+ // Offline extraction of deploy metadata (events, egress, routes,
749
+ // /v1/info payload) — no VM, no network. Wd-1 of the event-ingress
750
+ // plan; `deploy` attaches this to the request from Wd-2 on.
751
+ return cmdManifest({ dir, json: values.json === true });
752
+ }
753
+
745
754
  case "deployments": {
746
755
  return cmdDeployments(deployOptionsFromValues(values));
747
756
  }
@@ -1251,7 +1260,8 @@ async function main(argv: string[]): Promise<number> {
1251
1260
  values["cursor-events"] === true
1252
1261
  ? { repos: values.repo ?? [] }
1253
1262
  : undefined,
1254
- // Soft boot logs (GitHub auth, etc.) stay secondary to the banner.
1263
+ // Soft boot logs stay secondary to the banner. `dim` is a no-op on
1264
+ // already-styled lines (the MCP warning box).
1255
1265
  logger: (line: string) => {
1256
1266
  process.stdout.write(`${style.dim(line)}\n`);
1257
1267
  },
@@ -1691,7 +1701,7 @@ installTransportErrorGuards();
1691
1701
 
1692
1702
  // Authored agent files are TypeScript imported at runtime; install the tsx
1693
1703
  // loader (and the framework import aliases on compiled runs) before any
1694
- // command touches a project.
1704
+ // command touches a project. In-repo CLI is `bin/agentsdk`.
1695
1705
  registerAuthoredModuleLoaders()
1696
1706
  .then(() => main(process.argv.slice(2)))
1697
1707
  .then(
@@ -535,7 +535,12 @@ function isOctokitRequestError(error: unknown): error is {
535
535
  );
536
536
  }
537
537
 
538
- function wrapOctokitError(error: unknown, method: string, path: string): Error {
538
+ /** Normalize an Octokit request failure into {@link GitHubApiError}. */
539
+ export function wrapOctokitError(
540
+ error: unknown,
541
+ method: string,
542
+ path: string
543
+ ): Error {
539
544
  if (isOctokitRequestError(error)) {
540
545
  return new GitHubApiError({
541
546
  body: error.response?.data,
@@ -17,6 +17,11 @@ import {
17
17
  type GitHubPostedComment,
18
18
  type GitHubReactionContent,
19
19
  } from "./api.js";
20
+ import {
21
+ createGitHubCheck,
22
+ type GitHubCheck,
23
+ type GitHubCheckCreateInput,
24
+ } from "./checks.js";
20
25
  import type {
21
26
  GitHubChannelCredentials,
22
27
  GitHubConversationKind,
@@ -79,6 +84,14 @@ export interface GitHubHandle {
79
84
  description?: string;
80
85
  targetUrl?: string;
81
86
  }): Promise<GitHubApiResponse>;
87
+ /**
88
+ * Open a CI check run (Checks API) on `sha` and get a handle for updating
89
+ * and concluding it. Needs `checks:write` — with `cursorAccount`, declare
90
+ * `githubChannel({ checks: true })` to opt the lease up.
91
+ */
92
+ createCheck(
93
+ input: Omit<GitHubCheckCreateInput, "github" | "owner" | "repo">
94
+ ): Promise<GitHubCheck>;
82
95
  }
83
96
 
84
97
  /** Thread-scoped operations for the current conversation (`ctx.thread`). */
@@ -149,6 +162,14 @@ export function buildGitHubBinding(input: {
149
162
  : { targetUrl: status.targetUrl }),
150
163
  });
151
164
  },
165
+ createCheck(check) {
166
+ return createGitHubCheck({
167
+ ...check,
168
+ github: { getOctokit },
169
+ owner: state.owner,
170
+ repo: state.repo,
171
+ });
172
+ },
152
173
  };
153
174
 
154
175
  const thread: GitHubThread = {