@cursor/july 0.1.101 → 0.1.103

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 (862) hide show
  1. package/AGENTS.md +34 -32
  2. package/README.md +28 -3
  3. package/dist/ab.d.ts +1 -1
  4. package/dist/ab.js +1 -1
  5. package/dist/bin/agent-serve.d.ts +12 -12
  6. package/dist/bin/agent-serve.js +114 -36
  7. package/dist/channels/bitbucket/api.d.ts +176 -0
  8. package/dist/channels/bitbucket/api.d.ts.map +1 -0
  9. package/dist/channels/bitbucket/api.js +419 -0
  10. package/dist/channels/bitbucket/binding.d.ts +71 -0
  11. package/dist/channels/bitbucket/binding.d.ts.map +1 -0
  12. package/dist/channels/bitbucket/binding.js +269 -0
  13. package/dist/channels/bitbucket/bitbucket-channel.d.ts +33 -0
  14. package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -0
  15. package/dist/channels/bitbucket/bitbucket-channel.js +120 -0
  16. package/dist/channels/bitbucket/bitbucket-webhook.d.ts +61 -0
  17. package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -0
  18. package/dist/channels/bitbucket/bitbucket-webhook.js +394 -0
  19. package/dist/channels/bitbucket/checks.d.ts +67 -0
  20. package/dist/channels/bitbucket/checks.d.ts.map +1 -0
  21. package/dist/channels/bitbucket/checks.js +102 -0
  22. package/dist/channels/bitbucket/cursor-account.d.ts +37 -0
  23. package/dist/channels/bitbucket/cursor-account.d.ts.map +1 -0
  24. package/dist/channels/bitbucket/cursor-account.js +65 -0
  25. package/dist/channels/bitbucket/defaults.d.ts +26 -0
  26. package/dist/channels/bitbucket/defaults.d.ts.map +1 -0
  27. package/dist/channels/bitbucket/defaults.js +73 -0
  28. package/dist/channels/bitbucket/events.d.ts +22 -0
  29. package/dist/channels/bitbucket/events.d.ts.map +1 -0
  30. package/dist/channels/bitbucket/events.js +64 -0
  31. package/dist/channels/bitbucket/index.d.ts +34 -0
  32. package/dist/channels/bitbucket/index.d.ts.map +1 -0
  33. package/dist/channels/bitbucket/index.js +33 -0
  34. package/dist/channels/bitbucket/replay.d.ts +63 -0
  35. package/dist/channels/bitbucket/replay.d.ts.map +1 -0
  36. package/dist/channels/bitbucket/replay.js +304 -0
  37. package/dist/channels/bitbucket/state.d.ts +35 -0
  38. package/dist/channels/bitbucket/state.d.ts.map +1 -0
  39. package/dist/channels/bitbucket/state.js +21 -0
  40. package/dist/channels/bitbucket/types.d.ts +229 -0
  41. package/dist/channels/bitbucket/types.d.ts.map +1 -0
  42. package/dist/channels/bitbucket/types.js +1 -0
  43. package/dist/channels/deployments/deployments-channel.d.ts +22 -14
  44. package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
  45. package/dist/channels/deployments/deployments-channel.js +25 -27
  46. package/dist/channels/deployments/types.d.ts +12 -6
  47. package/dist/channels/deployments/types.d.ts.map +1 -1
  48. package/dist/channels/github/binding.d.ts +6 -0
  49. package/dist/channels/github/binding.d.ts.map +1 -1
  50. package/dist/channels/github/binding.js +3 -3
  51. package/dist/channels/github/cursor-account.d.ts +7 -3
  52. package/dist/channels/github/cursor-account.d.ts.map +1 -1
  53. package/dist/channels/github/cursor-account.js +10 -6
  54. package/dist/channels/github/events.d.ts +1 -1
  55. package/dist/channels/github/events.js +1 -1
  56. package/dist/channels/github/forward.d.ts +1 -1
  57. package/dist/channels/github/forward.d.ts.map +1 -1
  58. package/dist/channels/github/forward.js +3 -2
  59. package/dist/channels/github/github-channel.d.ts +29 -39
  60. package/dist/channels/github/github-channel.d.ts.map +1 -1
  61. package/dist/channels/github/github-channel.js +68 -101
  62. package/dist/channels/github/replay.d.ts +1 -1
  63. package/dist/channels/github/replay.js +1 -1
  64. package/dist/channels/github/state.d.ts +2 -0
  65. package/dist/channels/github/state.d.ts.map +1 -1
  66. package/dist/channels/github/state.js +14 -11
  67. package/dist/channels/github/types.d.ts +2 -4
  68. package/dist/channels/github/types.d.ts.map +1 -1
  69. package/dist/channels/gitlab/api.d.ts +91 -0
  70. package/dist/channels/gitlab/api.d.ts.map +1 -0
  71. package/dist/channels/gitlab/api.js +150 -0
  72. package/dist/channels/gitlab/binding.d.ts +58 -0
  73. package/dist/channels/gitlab/binding.d.ts.map +1 -0
  74. package/dist/channels/gitlab/binding.js +139 -0
  75. package/dist/channels/gitlab/checks.d.ts +110 -0
  76. package/dist/channels/gitlab/checks.d.ts.map +1 -0
  77. package/dist/channels/gitlab/checks.js +126 -0
  78. package/dist/channels/gitlab/cursor-account.d.ts +36 -0
  79. package/dist/channels/gitlab/cursor-account.d.ts.map +1 -0
  80. package/dist/channels/gitlab/cursor-account.js +65 -0
  81. package/dist/channels/gitlab/defaults.d.ts +25 -0
  82. package/dist/channels/gitlab/defaults.d.ts.map +1 -0
  83. package/dist/channels/gitlab/defaults.js +60 -0
  84. package/dist/channels/gitlab/events.d.ts +12 -0
  85. package/dist/channels/gitlab/events.d.ts.map +1 -0
  86. package/dist/channels/gitlab/events.js +28 -0
  87. package/dist/channels/gitlab/gitlab-channel.d.ts +33 -0
  88. package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -0
  89. package/dist/channels/gitlab/gitlab-channel.js +120 -0
  90. package/dist/channels/gitlab/gitlab-webhook.d.ts +45 -0
  91. package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -0
  92. package/dist/channels/gitlab/gitlab-webhook.js +397 -0
  93. package/dist/channels/gitlab/index.d.ts +31 -0
  94. package/dist/channels/gitlab/index.d.ts.map +1 -0
  95. package/dist/channels/gitlab/index.js +30 -0
  96. package/dist/channels/gitlab/replay.d.ts +105 -0
  97. package/dist/channels/gitlab/replay.d.ts.map +1 -0
  98. package/dist/channels/gitlab/replay.js +206 -0
  99. package/dist/channels/gitlab/state.d.ts +33 -0
  100. package/dist/channels/gitlab/state.d.ts.map +1 -0
  101. package/dist/channels/gitlab/state.js +23 -0
  102. package/dist/channels/gitlab/types.d.ts +214 -0
  103. package/dist/channels/gitlab/types.d.ts.map +1 -0
  104. package/dist/channels/gitlab/types.js +1 -0
  105. package/dist/channels/origin/api.d.ts.map +1 -1
  106. package/dist/channels/origin/api.js +4 -2
  107. package/dist/channels/origin/origin-channel.d.ts +4 -9
  108. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  109. package/dist/channels/origin/origin-channel.js +8 -48
  110. package/dist/channels/origin/types.d.ts +20 -2
  111. package/dist/channels/origin/types.d.ts.map +1 -1
  112. package/dist/channels/slack/api.d.ts +1 -1
  113. package/dist/channels/slack/api.d.ts.map +1 -1
  114. package/dist/channels/slack/api.js +3 -1
  115. package/dist/channels/slack/assistant.d.ts +1 -1
  116. package/dist/channels/slack/assistant.d.ts.map +1 -1
  117. package/dist/channels/slack/dispatch.d.ts +3 -2
  118. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  119. package/dist/channels/slack/dispatch.js +28 -8
  120. package/dist/channels/slack/eval-directive.d.ts.map +1 -1
  121. package/dist/channels/slack/eval-directive.js +1 -7
  122. package/dist/channels/slack/inbound.d.ts +8 -0
  123. package/dist/channels/slack/inbound.d.ts.map +1 -1
  124. package/dist/channels/slack/inbound.js +28 -0
  125. package/dist/channels/slack/init.d.ts.map +1 -1
  126. package/dist/channels/slack/init.js +3 -3
  127. package/dist/channels/slack/manifest.d.ts.map +1 -1
  128. package/dist/channels/slack/manifest.js +2 -1
  129. package/dist/channels/slack/setup.d.ts +1 -1
  130. package/dist/channels/slack/setup.d.ts.map +1 -1
  131. package/dist/channels/slack/setup.js +6 -13
  132. package/dist/channels/slack/types.d.ts +1 -1
  133. package/dist/channels/slack/types.d.ts.map +1 -1
  134. package/dist/channels.d.ts +1 -1
  135. package/dist/channels.d.ts.map +1 -1
  136. package/dist/client.d.ts +1 -1
  137. package/dist/client.js +1 -1
  138. package/dist/connections.d.ts +1 -1
  139. package/dist/connections.js +1 -1
  140. package/dist/docs/404.html +2 -2
  141. package/dist/docs/ab.html +4 -4
  142. package/dist/docs/assets/{app.BASO9Kih.js → app.DW9pXkpL.js} +1 -1
  143. package/dist/docs/assets/chunks/@localSearchIndexroot.nrl1ifBq.js +1 -0
  144. package/dist/docs/assets/chunks/{VPLocalSearchBox.DwkqxoE0.js → VPLocalSearchBox.CdEIUwDg.js} +1 -1
  145. package/dist/docs/assets/chunks/{theme.CCil_13e.js → theme.YZMHgPgg.js} +2 -2
  146. package/dist/docs/assets/{concepts.md.lwAgBIMI.js → concepts.md.DgEcZOfT.js} +1 -1
  147. package/dist/docs/assets/{concepts.md.lwAgBIMI.lean.js → concepts.md.DgEcZOfT.lean.js} +1 -1
  148. package/dist/docs/assets/{evals.md.CPzDAwoH.js → evals.md.CbMoebP1.js} +1 -1
  149. package/dist/docs/assets/guides_cloud-agents.md.DS8RIjwx.js +9 -0
  150. package/dist/docs/assets/guides_cloud-agents.md.DS8RIjwx.lean.js +1 -0
  151. package/dist/docs/assets/{guides_github.md.BtPr9GaP.js → guides_github.md.DKYiT9do.js} +1 -1
  152. package/dist/docs/assets/{guides_opentelemetry.md.BVTXDCRg.js → guides_opentelemetry.md.COh9jFVg.js} +7 -8
  153. package/dist/docs/assets/{guides_opentelemetry.md.BVTXDCRg.lean.js → guides_opentelemetry.md.COh9jFVg.lean.js} +1 -1
  154. package/dist/docs/assets/index.md.D75GWhPl.js +5 -0
  155. package/dist/docs/assets/{index.md.Bb4k8kUm.lean.js → index.md.D75GWhPl.lean.js} +1 -1
  156. package/dist/docs/assets/{reference_agent-config.md.BHeYMgme.js → reference_agent-config.md.CHNpiyp4.js} +3 -3
  157. package/dist/docs/assets/{reference_channels.md.Cd2f2iyV.js → reference_channels.md.Dz8Cnudp.js} +2 -2
  158. package/dist/docs/assets/{reference_channels.md.Cd2f2iyV.lean.js → reference_channels.md.Dz8Cnudp.lean.js} +1 -1
  159. package/dist/docs/assets/{reference_cli.md.DfoeyvL0.js → reference_cli.md.CJNc_xYK.js} +1 -1
  160. package/dist/docs/assets/reference_extensions.md.DykHW3qL.js +62 -0
  161. package/dist/docs/assets/reference_extensions.md.DykHW3qL.lean.js +1 -0
  162. package/dist/docs/assets/reference_hooks.md.Ddt5DdgJ.js +73 -0
  163. package/dist/docs/assets/{reference_hooks.md.a8BJxMR5.lean.js → reference_hooks.md.Ddt5DdgJ.lean.js} +1 -1
  164. package/dist/docs/assets/{reference_playground.md.DnX5nL-B.js → reference_playground.md.4myJPxrf.js} +1 -1
  165. package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.js → reference_project-layout.md.DuBu9a96.js} +2 -2
  166. package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.lean.js → reference_project-layout.md.DuBu9a96.lean.js} +1 -1
  167. package/dist/docs/assets/reference_result.md.BK5SxDrf.js +19 -0
  168. package/dist/docs/assets/reference_result.md.BK5SxDrf.lean.js +1 -0
  169. package/dist/docs/assets/{reference_sessions.md.NxFP_CAC.js → reference_sessions.md.CueyOHSL.js} +1 -1
  170. package/dist/docs/assets/{reference_sessions.md.NxFP_CAC.lean.js → reference_sessions.md.CueyOHSL.lean.js} +1 -1
  171. package/dist/docs/assets/{reference_skills.md.BFW9retM.js → reference_skills.md.l2ezAcaN.js} +1 -1
  172. package/dist/docs/assets/{reference_tools.md.CvAHsdSp.js → reference_tools.md.aGrn99hP.js} +2 -2
  173. package/dist/docs/assets/skills_framework-map.md.haibFyoB.js +1 -0
  174. package/dist/docs/assets/{skills_framework-map.md.BTi817yv.lean.js → skills_framework-map.md.haibFyoB.lean.js} +1 -1
  175. package/dist/docs/assets/{skills_otel.md.CgiZryR3.js → skills_otel.md.CqhobH3B.js} +3 -3
  176. package/dist/docs/assets/{skills_otel.md.CgiZryR3.lean.js → skills_otel.md.CqhobH3B.lean.js} +1 -1
  177. package/dist/docs/assets/{templates_pr-autofixer.md.x5zl6-GT.js → templates_pr-autofixer.md.Bds_XWcV.js} +2 -2
  178. package/dist/docs/assets/{templates_pr-autofixer.md.x5zl6-GT.lean.js → templates_pr-autofixer.md.Bds_XWcV.lean.js} +1 -1
  179. package/dist/docs/building-with-agents.html +4 -4
  180. package/dist/docs/concepts.html +5 -5
  181. package/dist/docs/concepts.md +5 -7
  182. package/dist/docs/deployment.html +4 -4
  183. package/dist/docs/design/runtime-abstraction.md +2 -3
  184. package/dist/docs/evals.html +6 -6
  185. package/dist/docs/evals.md +9 -7
  186. package/dist/docs/guides/agent-to-agent.html +4 -4
  187. package/dist/docs/guides/cloud-agents.html +35 -0
  188. package/dist/docs/guides/cloud-agents.md +91 -0
  189. package/dist/docs/guides/convert-automation.html +4 -4
  190. package/dist/docs/guides/github.html +6 -6
  191. package/dist/docs/guides/github.md +0 -1
  192. package/dist/docs/guides/human-in-the-loop.html +4 -4
  193. package/dist/docs/guides/mcp-oauth.html +5 -5
  194. package/dist/docs/guides/opentelemetry.html +11 -12
  195. package/dist/docs/guides/opentelemetry.md +41 -17
  196. package/dist/docs/guides/slack.html +4 -4
  197. package/dist/docs/guides/webhooks.html +4 -4
  198. package/dist/docs/hashmap.json +1 -1
  199. package/dist/docs/hillclimbing.html +4 -4
  200. package/dist/docs/index.html +6 -6
  201. package/dist/docs/index.md +7 -3
  202. package/dist/docs/llms-full.txt +765 -209
  203. package/dist/docs/llms.txt +3 -1
  204. package/dist/docs/quickstart.html +4 -4
  205. package/dist/docs/reference/agent-config.html +8 -8
  206. package/dist/docs/reference/agent-config.md +6 -10
  207. package/dist/docs/reference/artifacts.html +5 -5
  208. package/dist/docs/reference/channels.html +6 -6
  209. package/dist/docs/reference/channels.md +18 -8
  210. package/dist/docs/reference/cli.html +5 -5
  211. package/dist/docs/reference/cli.md +3 -4
  212. package/dist/docs/reference/connections.html +4 -4
  213. package/dist/docs/reference/extensions.html +88 -0
  214. package/dist/docs/reference/extensions.md +264 -0
  215. package/dist/docs/reference/hooks.html +69 -10
  216. package/dist/docs/reference/hooks.md +215 -46
  217. package/dist/docs/reference/http-api.html +4 -4
  218. package/dist/docs/reference/instructions.html +4 -4
  219. package/dist/docs/reference/playground.html +5 -5
  220. package/dist/docs/reference/playground.md +3 -0
  221. package/dist/docs/reference/project-layout.html +6 -6
  222. package/dist/docs/reference/project-layout.md +4 -0
  223. package/dist/docs/reference/prompt.html +4 -4
  224. package/dist/docs/reference/result.html +45 -0
  225. package/dist/docs/reference/result.md +89 -0
  226. package/dist/docs/reference/schedules.html +4 -4
  227. package/dist/docs/reference/sessions.html +5 -5
  228. package/dist/docs/reference/sessions.md +3 -1
  229. package/dist/docs/reference/skills.html +6 -6
  230. package/dist/docs/reference/skills.md +2 -0
  231. package/dist/docs/reference/subagents.html +5 -5
  232. package/dist/docs/reference/tools.html +6 -6
  233. package/dist/docs/reference/tools.md +3 -2
  234. package/dist/docs/scaffolding-agents.html +4 -4
  235. package/dist/docs/skills/ab.html +4 -4
  236. package/dist/docs/skills/create-agent.html +4 -4
  237. package/dist/docs/skills/debug.html +4 -4
  238. package/dist/docs/skills/evals.html +4 -4
  239. package/dist/docs/skills/framework-map.html +5 -5
  240. package/dist/docs/skills/framework-map.md +3 -0
  241. package/dist/docs/skills/github.html +4 -4
  242. package/dist/docs/skills/hillclimb.html +4 -4
  243. package/dist/docs/skills/index.html +4 -4
  244. package/dist/docs/skills/mcp-auth.html +4 -4
  245. package/dist/docs/skills/otel.html +7 -7
  246. package/dist/docs/skills/otel.md +8 -3
  247. package/dist/docs/skills/setup-slack.html +4 -4
  248. package/dist/docs/storage.html +4 -4
  249. package/dist/docs/templates/agentic-owners.html +4 -4
  250. package/dist/docs/templates/agents-md.html +4 -4
  251. package/dist/docs/templates/code-wiki.html +4 -4
  252. package/dist/docs/templates/demo.html +4 -4
  253. package/dist/docs/templates/pr-autofixer.html +6 -6
  254. package/dist/docs/templates/pr-autofixer.md +0 -3
  255. package/dist/docs/templates/security-help.html +4 -4
  256. package/dist/docs/templates/security-reviewer.html +4 -4
  257. package/dist/docs/templates/triage.html +4 -4
  258. package/dist/docs/troubleshooting.html +4 -4
  259. package/dist/evals.d.ts +1 -1
  260. package/dist/evals.d.ts.map +1 -1
  261. package/dist/extensions/cursor-cloud-agents/extension.d.ts +9 -7
  262. package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
  263. package/dist/extensions/cursor-cloud-agents/extension.js +9 -7
  264. package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +78 -0
  265. package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -0
  266. package/dist/extensions/cursor-cloud-agents/lib/backend.js +286 -0
  267. package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +5 -0
  268. package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -0
  269. package/dist/extensions/cursor-cloud-agents/lib/inputs.js +4 -0
  270. package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts +8 -0
  271. package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts.map +1 -0
  272. package/dist/extensions/cursor-cloud-agents/lib/transcript.js +15 -0
  273. package/dist/extensions/cursor-cloud-agents/skills/handoff.md +21 -7
  274. package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts +4 -0
  275. package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts.map +1 -0
  276. package/dist/extensions/cursor-cloud-agents/tools/cancel.js +26 -0
  277. package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts +4 -0
  278. package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts.map +1 -0
  279. package/dist/extensions/cursor-cloud-agents/tools/dump.js +54 -0
  280. package/dist/extensions/cursor-cloud-agents/tools/get.d.ts +4 -0
  281. package/dist/extensions/cursor-cloud-agents/tools/get.d.ts.map +1 -0
  282. package/dist/extensions/cursor-cloud-agents/tools/get.js +25 -0
  283. package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -1
  284. package/dist/extensions/cursor-cloud-agents/tools/launch.js +14 -38
  285. package/dist/extensions/cursor-cloud-agents/tools/list.js +1 -1
  286. package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts +4 -0
  287. package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts.map +1 -0
  288. package/dist/extensions/cursor-cloud-agents/tools/{follow_up.js → reply.js} +12 -14
  289. package/dist/extensions.d.ts +54 -17
  290. package/dist/extensions.d.ts.map +1 -1
  291. package/dist/extensions.js +83 -15
  292. package/dist/files-backends/cursor-hosted.d.ts +0 -8
  293. package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
  294. package/dist/files-backends/cursor-hosted.js +1 -11
  295. package/dist/files.d.ts +21 -4
  296. package/dist/files.d.ts.map +1 -1
  297. package/dist/files.js +38 -21
  298. package/dist/index.d.ts +6 -6
  299. package/dist/index.d.ts.map +1 -1
  300. package/dist/index.js +4 -4
  301. package/dist/internal/ab-snapshot.d.ts.map +1 -1
  302. package/dist/internal/ab-snapshot.js +0 -1
  303. package/dist/internal/advertise-tools.d.ts.map +1 -1
  304. package/dist/internal/advertise-tools.js +1 -3
  305. package/dist/internal/authored-alias-hooks.d.ts +4 -13
  306. package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
  307. package/dist/internal/authored-alias-hooks.js +4 -20
  308. package/dist/internal/authored-loaders.d.ts +2 -3
  309. package/dist/internal/authored-loaders.d.ts.map +1 -1
  310. package/dist/internal/authored-loaders.js +6 -20
  311. package/dist/internal/channel-dispatch.d.ts +43 -0
  312. package/dist/internal/channel-dispatch.d.ts.map +1 -0
  313. package/dist/internal/channel-dispatch.js +77 -0
  314. package/dist/internal/chat-client.d.ts +1 -1
  315. package/dist/internal/chat-client.js +1 -1
  316. package/dist/internal/cli-ax.d.ts +5 -5
  317. package/dist/internal/cli-ax.d.ts.map +1 -1
  318. package/dist/internal/cli-ax.js +5 -5
  319. package/dist/internal/cli-bitbucket.d.ts +33 -0
  320. package/dist/internal/cli-bitbucket.d.ts.map +1 -0
  321. package/dist/internal/cli-bitbucket.js +359 -0
  322. package/dist/internal/cli-convert-automation.d.ts +1 -1
  323. package/dist/internal/cli-convert-automation.js +2 -2
  324. package/dist/internal/cli-cursor.d.ts +1 -1
  325. package/dist/internal/cli-cursor.d.ts.map +1 -1
  326. package/dist/internal/cli-cursor.js +2 -4
  327. package/dist/internal/cli-deploy.d.ts.map +1 -1
  328. package/dist/internal/cli-deploy.js +2 -6
  329. package/dist/internal/cli-github.d.ts +1 -1
  330. package/dist/internal/cli-github.js +3 -3
  331. package/dist/internal/cli-gitlab.d.ts +37 -0
  332. package/dist/internal/cli-gitlab.d.ts.map +1 -0
  333. package/dist/internal/cli-gitlab.js +380 -0
  334. package/dist/internal/cli-mcp.d.ts.map +1 -1
  335. package/dist/internal/cli-mcp.js +2 -6
  336. package/dist/internal/cli-slack.d.ts +1 -1
  337. package/dist/internal/cli-slack.d.ts.map +1 -1
  338. package/dist/internal/cli-slack.js +2 -4
  339. package/dist/internal/continuation-channel.d.ts +14 -0
  340. package/dist/internal/continuation-channel.d.ts.map +1 -1
  341. package/dist/internal/continuation-channel.js +56 -3
  342. package/dist/internal/continuation-identity.d.ts +14 -15
  343. package/dist/internal/continuation-identity.d.ts.map +1 -1
  344. package/dist/internal/continuation-identity.js +182 -7
  345. package/dist/internal/conversation-mirror.d.ts.map +1 -1
  346. package/dist/internal/conversation-mirror.js +17 -18
  347. package/dist/internal/convert-automation/types.d.ts +1 -1
  348. package/dist/internal/convert-automation/types.js +1 -1
  349. package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
  350. package/dist/internal/cursor/account-mcp.js +1 -3
  351. package/dist/internal/cursor/backend-client.d.ts +13 -5
  352. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  353. package/dist/internal/cursor/backend-client.js +30 -15
  354. package/dist/internal/cursor/bound-secret-file.d.ts +56 -0
  355. package/dist/internal/cursor/bound-secret-file.d.ts.map +1 -0
  356. package/dist/internal/cursor/bound-secret-file.js +88 -0
  357. package/dist/internal/cursor/credentials.d.ts +39 -5
  358. package/dist/internal/cursor/credentials.d.ts.map +1 -1
  359. package/dist/internal/cursor/credentials.js +58 -8
  360. package/dist/internal/cursor/hosted-bound-secrets.d.ts +41 -0
  361. package/dist/internal/cursor/hosted-bound-secrets.d.ts.map +1 -0
  362. package/dist/internal/cursor/hosted-bound-secrets.js +54 -0
  363. package/dist/internal/cursor/hosted-deployment-secrets.d.ts +19 -5
  364. package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -1
  365. package/dist/internal/cursor/hosted-deployment-secrets.js +29 -9
  366. package/dist/internal/cursor/hosted-store-secrets.d.ts +12 -1
  367. package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -1
  368. package/dist/internal/cursor/hosted-store-secrets.js +16 -1
  369. package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -1
  370. package/dist/internal/cursor-account-mcp-auth.js +2 -4
  371. package/dist/internal/cursor-deployment-relay.d.ts +6 -2
  372. package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
  373. package/dist/internal/cursor-deployment-relay.js +13 -9
  374. package/dist/internal/deploy-manifest.d.ts +1 -1
  375. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  376. package/dist/internal/deploy-manifest.js +1 -1
  377. package/dist/internal/discovery/ab.d.ts +9 -0
  378. package/dist/internal/discovery/ab.d.ts.map +1 -0
  379. package/dist/internal/discovery/ab.js +113 -0
  380. package/dist/internal/discovery/agent-config.d.ts +35 -0
  381. package/dist/internal/discovery/agent-config.d.ts.map +1 -0
  382. package/dist/internal/discovery/agent-config.js +173 -0
  383. package/dist/internal/discovery/agent.d.ts +16 -0
  384. package/dist/internal/discovery/agent.d.ts.map +1 -0
  385. package/dist/internal/discovery/agent.js +255 -0
  386. package/dist/internal/discovery/channels.d.ts +10 -0
  387. package/dist/internal/discovery/channels.d.ts.map +1 -0
  388. package/dist/internal/discovery/channels.js +97 -0
  389. package/dist/internal/discovery/connections.d.ts +13 -0
  390. package/dist/internal/discovery/connections.d.ts.map +1 -0
  391. package/dist/internal/discovery/connections.js +422 -0
  392. package/dist/internal/discovery/context.d.ts +20 -0
  393. package/dist/internal/discovery/context.d.ts.map +1 -0
  394. package/dist/internal/discovery/context.js +30 -0
  395. package/dist/internal/discovery/cursor-plugin.d.ts +25 -0
  396. package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -0
  397. package/dist/internal/discovery/cursor-plugin.js +568 -0
  398. package/dist/internal/discovery/extension-overlay.d.ts +32 -0
  399. package/dist/internal/discovery/extension-overlay.d.ts.map +1 -0
  400. package/dist/internal/discovery/extension-overlay.js +191 -0
  401. package/dist/internal/discovery/extensions.d.ts +28 -0
  402. package/dist/internal/discovery/extensions.d.ts.map +1 -0
  403. package/dist/internal/discovery/extensions.js +375 -0
  404. package/dist/internal/discovery/fs.d.ts +15 -0
  405. package/dist/internal/discovery/fs.d.ts.map +1 -0
  406. package/dist/internal/discovery/fs.js +115 -0
  407. package/dist/internal/discovery/hooks.d.ts +7 -0
  408. package/dist/internal/discovery/hooks.d.ts.map +1 -0
  409. package/dist/internal/discovery/hooks.js +61 -0
  410. package/dist/internal/discovery/info.d.ts +6 -0
  411. package/dist/internal/discovery/info.d.ts.map +1 -0
  412. package/dist/internal/discovery/info.js +147 -0
  413. package/dist/internal/discovery/instructions.d.ts +7 -0
  414. package/dist/internal/discovery/instructions.d.ts.map +1 -0
  415. package/dist/internal/discovery/instructions.js +95 -0
  416. package/dist/internal/discovery/modules.d.ts +20 -0
  417. package/dist/internal/discovery/modules.d.ts.map +1 -0
  418. package/dist/internal/discovery/modules.js +107 -0
  419. package/dist/internal/discovery/names.d.ts +12 -0
  420. package/dist/internal/discovery/names.d.ts.map +1 -0
  421. package/dist/internal/discovery/names.js +37 -0
  422. package/dist/internal/discovery/project.d.ts +51 -0
  423. package/dist/internal/discovery/project.d.ts.map +1 -0
  424. package/dist/internal/discovery/project.js +293 -0
  425. package/dist/internal/discovery/runtime.d.ts +34 -0
  426. package/dist/internal/discovery/runtime.d.ts.map +1 -0
  427. package/dist/internal/discovery/runtime.js +97 -0
  428. package/dist/internal/discovery/schedules.d.ts +7 -0
  429. package/dist/internal/discovery/schedules.d.ts.map +1 -0
  430. package/dist/internal/discovery/schedules.js +118 -0
  431. package/dist/internal/discovery/seed-files.d.ts +7 -0
  432. package/dist/internal/discovery/seed-files.d.ts.map +1 -0
  433. package/dist/internal/discovery/seed-files.js +41 -0
  434. package/dist/internal/discovery/services.d.ts +21 -0
  435. package/dist/internal/discovery/services.d.ts.map +1 -0
  436. package/dist/internal/discovery/services.js +134 -0
  437. package/dist/internal/discovery/skills.d.ts +11 -0
  438. package/dist/internal/discovery/skills.d.ts.map +1 -0
  439. package/dist/internal/discovery/skills.js +156 -0
  440. package/dist/internal/discovery/subagent.d.ts +16 -0
  441. package/dist/internal/discovery/subagent.d.ts.map +1 -0
  442. package/dist/internal/discovery/subagent.js +128 -0
  443. package/dist/internal/discovery/tools.d.ts +18 -0
  444. package/dist/internal/discovery/tools.d.ts.map +1 -0
  445. package/dist/internal/discovery/tools.js +159 -0
  446. package/dist/internal/discovery.d.ts +8 -63
  447. package/dist/internal/discovery.d.ts.map +1 -1
  448. package/dist/internal/discovery.js +6 -2504
  449. package/dist/internal/distribution.d.ts +10 -27
  450. package/dist/internal/distribution.d.ts.map +1 -1
  451. package/dist/internal/distribution.js +25 -73
  452. package/dist/internal/docs-site.js +1 -1
  453. package/dist/internal/eval-run-store.d.ts +0 -1
  454. package/dist/internal/eval-run-store.d.ts.map +1 -1
  455. package/dist/internal/eval-runner.d.ts.map +1 -1
  456. package/dist/internal/framework-file-storage.d.ts +8 -0
  457. package/dist/internal/framework-file-storage.d.ts.map +1 -1
  458. package/dist/internal/framework-file-storage.js +14 -14
  459. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  460. package/dist/internal/framework-storage-selection.js +8 -7
  461. package/dist/internal/frontmatter.d.ts +11 -3
  462. package/dist/internal/frontmatter.d.ts.map +1 -1
  463. package/dist/internal/frontmatter.js +29 -3
  464. package/dist/internal/github-fanout.d.ts +1 -1
  465. package/dist/internal/github-fanout.js +1 -1
  466. package/dist/internal/guest-network.d.ts +101 -0
  467. package/dist/internal/guest-network.d.ts.map +1 -0
  468. package/dist/internal/guest-network.js +304 -0
  469. package/dist/internal/host-otel.d.ts +3 -3
  470. package/dist/internal/host-otel.d.ts.map +1 -1
  471. package/dist/internal/host-otel.js +8 -4
  472. package/dist/internal/hosted-admission-adapter.d.ts +8 -7
  473. package/dist/internal/hosted-admission-adapter.d.ts.map +1 -1
  474. package/dist/internal/hosted-delivery-protocol.d.ts +6 -0
  475. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  476. package/dist/internal/hosted-delivery-protocol.js +18 -5
  477. package/dist/internal/hosted-delivery.d.ts +18 -0
  478. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  479. package/dist/internal/hosted-delivery.js +248 -118
  480. package/dist/internal/http-channel.d.ts.map +1 -1
  481. package/dist/internal/http-channel.js +1 -3
  482. package/dist/internal/init-interview.d.ts.map +1 -1
  483. package/dist/internal/init-interview.js +1 -3
  484. package/dist/internal/init-project.d.ts +2 -2
  485. package/dist/internal/init-project.js +2 -2
  486. package/dist/internal/inline-stdio-define-stub.d.ts +1 -1
  487. package/dist/internal/inline-stdio-define-stub.d.ts.map +1 -1
  488. package/dist/internal/inline-stdio-define-stub.js +1 -1
  489. package/dist/internal/is-record.d.ts +2 -0
  490. package/dist/internal/is-record.d.ts.map +1 -0
  491. package/dist/internal/is-record.js +3 -0
  492. package/dist/internal/json-schema.d.ts.map +1 -1
  493. package/dist/internal/json-schema.js +18 -10
  494. package/dist/internal/local-control-plane.d.ts +1 -2
  495. package/dist/internal/local-control-plane.d.ts.map +1 -1
  496. package/dist/internal/local-control-plane.js +3 -20
  497. package/dist/internal/mcp-endpoint.d.ts.map +1 -1
  498. package/dist/internal/mcp-endpoint.js +1 -3
  499. package/dist/internal/mcp-host.d.ts.map +1 -1
  500. package/dist/internal/mcp-host.js +37 -20
  501. package/dist/internal/otel/collector.d.ts +22 -0
  502. package/dist/internal/otel/collector.d.ts.map +1 -1
  503. package/dist/internal/otel/collector.js +145 -126
  504. package/dist/internal/otel/config.d.ts +0 -2
  505. package/dist/internal/otel/config.d.ts.map +1 -1
  506. package/dist/internal/otel/config.js +17 -20
  507. package/dist/internal/otel/http.d.ts +2 -0
  508. package/dist/internal/otel/http.d.ts.map +1 -1
  509. package/dist/internal/otel/http.js +8 -10
  510. package/dist/internal/otel/mcp.d.ts +16 -0
  511. package/dist/internal/otel/mcp.d.ts.map +1 -0
  512. package/dist/internal/otel/mcp.js +55 -0
  513. package/dist/internal/otel/propagation.d.ts +6 -0
  514. package/dist/internal/otel/propagation.d.ts.map +1 -0
  515. package/dist/internal/otel/propagation.js +14 -0
  516. package/dist/internal/otel/runtime.d.ts +26 -1
  517. package/dist/internal/otel/runtime.d.ts.map +1 -1
  518. package/dist/internal/otel/runtime.js +166 -15
  519. package/dist/internal/package-inline-stdio.d.ts.map +1 -1
  520. package/dist/internal/package-inline-stdio.js +3 -11
  521. package/dist/internal/playground/toolchain.d.ts +1 -1
  522. package/dist/internal/playground/toolchain.d.ts.map +1 -1
  523. package/dist/internal/playground/toolchain.js +1 -1
  524. package/dist/internal/request-error-status.d.ts +12 -0
  525. package/dist/internal/request-error-status.d.ts.map +1 -0
  526. package/dist/internal/request-error-status.js +52 -0
  527. package/dist/internal/resolve-prod-target.d.ts +1 -1
  528. package/dist/internal/resolve-prod-target.d.ts.map +1 -1
  529. package/dist/internal/resolve-prod-target.js +3 -7
  530. package/dist/internal/result-output.d.ts +18 -0
  531. package/dist/internal/result-output.d.ts.map +1 -0
  532. package/dist/internal/result-output.js +33 -0
  533. package/dist/internal/run-client.d.ts +2 -2
  534. package/dist/internal/run-client.js +2 -2
  535. package/dist/internal/runtime-dispatch-runner.d.ts +1 -11
  536. package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -1
  537. package/dist/internal/runtime-dispatch-runner.js +2 -15
  538. package/dist/internal/sdk-runner.d.ts.map +1 -1
  539. package/dist/internal/sdk-runner.js +3 -6
  540. package/dist/internal/server.d.ts.map +1 -1
  541. package/dist/internal/server.js +110 -35
  542. package/dist/internal/session-cost.d.ts +3 -3
  543. package/dist/internal/session-cost.d.ts.map +1 -1
  544. package/dist/internal/session-cost.js +3 -3
  545. package/dist/internal/session-engine.d.ts +31 -11
  546. package/dist/internal/session-engine.d.ts.map +1 -1
  547. package/dist/internal/session-engine.js +208 -102
  548. package/dist/internal/session-run-log.d.ts +2 -1
  549. package/dist/internal/session-run-log.d.ts.map +1 -1
  550. package/dist/internal/session-run-log.js +14 -17
  551. package/dist/internal/skills-sync.d.ts +1 -4
  552. package/dist/internal/skills-sync.d.ts.map +1 -1
  553. package/dist/internal/skills-sync.js +10 -50
  554. package/dist/internal/sleep.d.ts +2 -0
  555. package/dist/internal/sleep.d.ts.map +1 -0
  556. package/dist/internal/sleep.js +3 -0
  557. package/dist/internal/start-log-store.d.ts +1 -1
  558. package/dist/internal/start-log-store.d.ts.map +1 -1
  559. package/dist/internal/start-log-store.js +12 -14
  560. package/dist/internal/storage-coordinator.d.ts +4 -1
  561. package/dist/internal/storage-coordinator.d.ts.map +1 -1
  562. package/dist/internal/storage-coordinator.js +15 -13
  563. package/dist/internal/store-mirror.d.ts +29 -0
  564. package/dist/internal/store-mirror.d.ts.map +1 -0
  565. package/dist/internal/store-mirror.js +70 -0
  566. package/dist/internal/tenant-slack/relay.d.ts +73 -0
  567. package/dist/internal/tenant-slack/relay.d.ts.map +1 -0
  568. package/dist/internal/tenant-slack/relay.js +138 -0
  569. package/dist/internal/testing/scm-continuation-fixtures.d.ts +33 -0
  570. package/dist/internal/testing/scm-continuation-fixtures.d.ts.map +1 -0
  571. package/dist/internal/testing/scm-continuation-fixtures.js +253 -0
  572. package/dist/internal/tool-catalog.d.ts.map +1 -1
  573. package/dist/internal/tool-catalog.js +9 -6
  574. package/dist/internal/turn-cost.d.ts +14 -0
  575. package/dist/internal/turn-cost.d.ts.map +1 -1
  576. package/dist/internal/turn-cost.js +41 -9
  577. package/dist/internal/v2-hosting.d.ts +22 -0
  578. package/dist/internal/v2-hosting.d.ts.map +1 -0
  579. package/dist/internal/v2-hosting.js +23 -0
  580. package/dist/internal/workspace-sync.d.ts +22 -0
  581. package/dist/internal/workspace-sync.d.ts.map +1 -0
  582. package/dist/internal/workspace-sync.js +49 -0
  583. package/dist/internal/workspace.d.ts +7 -0
  584. package/dist/internal/workspace.d.ts.map +1 -1
  585. package/dist/internal/workspace.js +13 -0
  586. package/dist/otel.d.ts +39 -1
  587. package/dist/otel.d.ts.map +1 -1
  588. package/dist/otel.js +118 -1
  589. package/dist/playground/assets/index-59KvgREd.js +67 -0
  590. package/dist/playground/assets/index-MbMxXg-y.css +1 -0
  591. package/dist/playground/index.html +2 -2
  592. package/dist/result.d.ts +24 -0
  593. package/dist/result.d.ts.map +1 -0
  594. package/dist/result.js +27 -0
  595. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  596. package/dist/storage-backends/cursor-hosted.js +7 -4
  597. package/dist/storage-protocol.d.ts +24 -23
  598. package/dist/storage-protocol.d.ts.map +1 -1
  599. package/dist/storage-protocol.js +69 -68
  600. package/dist/storage.d.ts +2 -2
  601. package/dist/storage.d.ts.map +1 -1
  602. package/dist/storage.js +1 -1
  603. package/dist/tools.d.ts +9 -0
  604. package/dist/tools.d.ts.map +1 -1
  605. package/dist/tools.js +9 -0
  606. package/dist/types.d.ts +126 -23
  607. package/dist/types.d.ts.map +1 -1
  608. package/docs/README.md +7 -3
  609. package/docs/concepts.md +5 -7
  610. package/docs/design/runtime-abstraction.md +2 -3
  611. package/docs/evals.md +9 -7
  612. package/docs/guides/cloud-agents.md +96 -0
  613. package/docs/guides/github.md +0 -1
  614. package/docs/guides/opentelemetry.md +41 -17
  615. package/docs/reference/agent-config.md +6 -10
  616. package/docs/reference/channels.md +18 -8
  617. package/docs/reference/cli.md +3 -4
  618. package/docs/reference/extensions.md +269 -0
  619. package/docs/reference/hooks.md +215 -46
  620. package/docs/reference/playground.md +3 -0
  621. package/docs/reference/project-layout.md +4 -0
  622. package/docs/reference/result.md +94 -0
  623. package/docs/reference/sessions.md +3 -1
  624. package/docs/reference/skills.md +2 -0
  625. package/docs/reference/tools.md +3 -2
  626. package/docs/templates/pr-autofixer.md +0 -3
  627. package/package.json +29 -10
  628. package/skills/framework-map/SKILL.md +3 -0
  629. package/skills/otel/SKILL.md +8 -3
  630. package/src/ab.ts +1 -1
  631. package/src/bin/agent-serve.ts +121 -21
  632. package/src/channels/bitbucket/api.ts +623 -0
  633. package/src/channels/bitbucket/binding.ts +414 -0
  634. package/src/channels/bitbucket/bitbucket-channel.ts +182 -0
  635. package/src/channels/bitbucket/bitbucket-webhook.ts +576 -0
  636. package/src/channels/bitbucket/checks.ts +154 -0
  637. package/src/channels/bitbucket/cursor-account.ts +117 -0
  638. package/src/channels/bitbucket/defaults.ts +110 -0
  639. package/src/channels/bitbucket/events.ts +84 -0
  640. package/src/channels/bitbucket/index.ts +49 -0
  641. package/src/channels/bitbucket/replay.ts +439 -0
  642. package/src/channels/bitbucket/state.ts +59 -0
  643. package/src/channels/bitbucket/types.ts +266 -0
  644. package/src/channels/deployments/deployments-channel.ts +25 -43
  645. package/src/channels/deployments/types.ts +12 -6
  646. package/src/channels/github/binding.ts +8 -1
  647. package/src/channels/github/cursor-account.ts +17 -6
  648. package/src/channels/github/events.ts +1 -1
  649. package/src/channels/github/forward.ts +3 -2
  650. package/src/channels/github/github-channel.ts +74 -221
  651. package/src/channels/github/replay.ts +1 -1
  652. package/src/channels/github/state.ts +6 -0
  653. package/src/channels/github/types.ts +2 -5
  654. package/src/channels/gitlab/api.ts +228 -0
  655. package/src/channels/gitlab/binding.ts +233 -0
  656. package/src/channels/gitlab/checks.ts +243 -0
  657. package/src/channels/gitlab/cursor-account.ts +114 -0
  658. package/src/channels/gitlab/defaults.ts +93 -0
  659. package/src/channels/gitlab/events.ts +44 -0
  660. package/src/channels/gitlab/gitlab-channel.ts +176 -0
  661. package/src/channels/gitlab/gitlab-webhook.ts +555 -0
  662. package/src/channels/gitlab/index.ts +43 -0
  663. package/src/channels/gitlab/replay.ts +347 -0
  664. package/src/channels/gitlab/state.ts +55 -0
  665. package/src/channels/gitlab/types.ts +263 -0
  666. package/src/channels/origin/api.ts +4 -2
  667. package/src/channels/origin/origin-channel.ts +19 -94
  668. package/src/channels/origin/types.ts +23 -2
  669. package/src/channels/slack/api.ts +4 -2
  670. package/src/channels/slack/assistant.ts +1 -1
  671. package/src/channels/slack/dispatch.ts +27 -2
  672. package/src/channels/slack/eval-directive.ts +1 -6
  673. package/src/channels/slack/inbound.ts +37 -0
  674. package/src/channels/slack/init.ts +6 -3
  675. package/src/channels/slack/manifest.ts +2 -1
  676. package/src/channels/slack/setup.ts +7 -6
  677. package/src/channels/slack/types.ts +1 -1
  678. package/src/channels.ts +0 -1
  679. package/src/client.ts +1 -1
  680. package/src/connections.ts +1 -1
  681. package/src/evals.ts +1 -1
  682. package/src/extensions/cursor-cloud-agents/extension.ts +9 -7
  683. package/src/extensions/cursor-cloud-agents/lib/backend.ts +395 -0
  684. package/src/extensions/cursor-cloud-agents/lib/inputs.ts +5 -0
  685. package/src/extensions/cursor-cloud-agents/lib/transcript.ts +23 -0
  686. package/src/extensions/cursor-cloud-agents/skills/handoff.md +21 -7
  687. package/src/extensions/cursor-cloud-agents/tools/cancel.ts +19 -0
  688. package/src/extensions/cursor-cloud-agents/tools/dump.ts +51 -0
  689. package/src/extensions/cursor-cloud-agents/tools/get.ts +18 -0
  690. package/src/extensions/cursor-cloud-agents/tools/launch.ts +22 -42
  691. package/src/extensions/cursor-cloud-agents/tools/list.ts +1 -1
  692. package/src/extensions/cursor-cloud-agents/tools/reply.ts +34 -0
  693. package/src/extensions.ts +100 -15
  694. package/src/files-backends/cursor-hosted.ts +1 -17
  695. package/src/files.ts +64 -37
  696. package/src/index.ts +27 -26
  697. package/src/internal/ab-snapshot.ts +0 -3
  698. package/src/internal/advertise-tools.ts +1 -4
  699. package/src/internal/authored-alias-hooks.ts +4 -21
  700. package/src/internal/authored-loaders.ts +6 -23
  701. package/src/internal/channel-dispatch.ts +160 -0
  702. package/src/internal/chat-client.ts +1 -1
  703. package/src/internal/cli-ax.ts +5 -5
  704. package/src/internal/cli-bitbucket.ts +477 -0
  705. package/src/internal/cli-convert-automation.ts +7 -7
  706. package/src/internal/cli-cursor.ts +2 -5
  707. package/src/internal/cli-deploy.ts +2 -8
  708. package/src/internal/cli-github.ts +3 -3
  709. package/src/internal/cli-gitlab.ts +485 -0
  710. package/src/internal/cli-mcp.ts +2 -7
  711. package/src/internal/cli-slack.ts +2 -5
  712. package/src/internal/continuation-channel.ts +82 -1
  713. package/src/internal/continuation-identity.ts +229 -11
  714. package/src/internal/conversation-mirror.ts +27 -21
  715. package/src/internal/convert-automation/types.ts +1 -1
  716. package/src/internal/cursor/account-mcp.ts +1 -4
  717. package/src/internal/cursor/backend-client.ts +41 -20
  718. package/src/internal/cursor/bound-secret-file.ts +108 -0
  719. package/src/internal/cursor/credentials.ts +75 -10
  720. package/src/internal/cursor/hosted-bound-secrets.ts +75 -0
  721. package/src/internal/cursor/hosted-deployment-secrets.ts +42 -11
  722. package/src/internal/cursor/hosted-store-secrets.ts +28 -1
  723. package/src/internal/cursor-account-mcp-auth.ts +2 -5
  724. package/src/internal/cursor-deployment-relay.ts +11 -7
  725. package/src/internal/deploy-manifest.ts +4 -2
  726. package/src/internal/discovery/ab.ts +131 -0
  727. package/src/internal/discovery/agent-config.ts +222 -0
  728. package/src/internal/discovery/agent.ts +319 -0
  729. package/src/internal/discovery/channels.ts +105 -0
  730. package/src/internal/discovery/connections.ts +545 -0
  731. package/src/internal/discovery/context.ts +46 -0
  732. package/src/internal/discovery/cursor-plugin.ts +705 -0
  733. package/src/internal/discovery/extension-overlay.ts +274 -0
  734. package/src/internal/discovery/extensions.ts +573 -0
  735. package/src/internal/discovery/fs.ts +108 -0
  736. package/src/internal/discovery/hooks.ts +63 -0
  737. package/src/internal/discovery/info.ts +186 -0
  738. package/src/internal/discovery/instructions.ts +113 -0
  739. package/src/internal/discovery/modules.ts +113 -0
  740. package/src/internal/discovery/names.ts +45 -0
  741. package/src/internal/discovery/project.ts +341 -0
  742. package/src/internal/discovery/runtime.ts +158 -0
  743. package/src/internal/discovery/schedules.ts +120 -0
  744. package/src/internal/discovery/seed-files.ts +37 -0
  745. package/src/internal/discovery/services.ts +160 -0
  746. package/src/internal/discovery/skills.ts +186 -0
  747. package/src/internal/discovery/subagent.ts +136 -0
  748. package/src/internal/discovery/tools.ts +182 -0
  749. package/src/internal/discovery.ts +18 -3081
  750. package/src/internal/distribution.ts +35 -83
  751. package/src/internal/docs-site.ts +1 -1
  752. package/src/internal/eval-run-store.ts +0 -7
  753. package/src/internal/eval-runner.ts +0 -1
  754. package/src/internal/framework-file-storage.ts +14 -14
  755. package/src/internal/framework-storage-selection.ts +9 -9
  756. package/src/internal/frontmatter.ts +36 -3
  757. package/src/internal/github-fanout.ts +1 -1
  758. package/src/internal/guest-network.ts +383 -0
  759. package/src/internal/host-otel.ts +8 -4
  760. package/src/internal/hosted-admission-adapter.ts +8 -8
  761. package/src/internal/hosted-delivery-protocol.ts +26 -1
  762. package/src/internal/hosted-delivery.ts +376 -192
  763. package/src/internal/http-channel.ts +1 -4
  764. package/src/internal/init-interview.ts +1 -4
  765. package/src/internal/init-project.ts +2 -2
  766. package/src/internal/inline-stdio-define-stub.ts +1 -1
  767. package/src/internal/is-record.ts +3 -0
  768. package/src/internal/json-schema.ts +19 -10
  769. package/src/internal/local-control-plane.ts +5 -24
  770. package/src/internal/mcp-endpoint.ts +1 -4
  771. package/src/internal/mcp-host.ts +84 -31
  772. package/src/internal/otel/collector.ts +200 -165
  773. package/src/internal/otel/config.ts +10 -14
  774. package/src/internal/otel/http.ts +16 -13
  775. package/src/internal/otel/mcp.ts +56 -0
  776. package/src/internal/otel/propagation.ts +17 -0
  777. package/src/internal/otel/runtime.ts +242 -25
  778. package/src/internal/package-inline-stdio.ts +3 -12
  779. package/src/internal/playground/toolchain.ts +1 -1
  780. package/src/internal/request-error-status.ts +72 -0
  781. package/src/internal/resolve-prod-target.ts +3 -8
  782. package/src/internal/result-output.ts +34 -0
  783. package/src/internal/run-client.ts +2 -2
  784. package/src/internal/runtime-dispatch-runner.ts +3 -21
  785. package/src/internal/sdk-runner.ts +3 -7
  786. package/src/internal/server.ts +153 -44
  787. package/src/internal/session-cost.ts +3 -3
  788. package/src/internal/session-engine.ts +274 -81
  789. package/src/internal/session-run-log.ts +18 -20
  790. package/src/internal/skills-sync.ts +13 -63
  791. package/src/internal/sleep.ts +3 -0
  792. package/src/internal/start-log-store.ts +13 -16
  793. package/src/internal/storage-coordinator.ts +19 -16
  794. package/src/internal/store-mirror.ts +86 -0
  795. package/src/internal/tenant-slack/relay.ts +179 -0
  796. package/src/internal/testing/scm-continuation-fixtures.ts +286 -0
  797. package/src/internal/tool-catalog.ts +9 -6
  798. package/src/internal/turn-cost.ts +47 -4
  799. package/src/internal/v2-hosting.ts +38 -0
  800. package/src/internal/workspace-sync.ts +55 -0
  801. package/src/internal/workspace.ts +14 -0
  802. package/src/otel.ts +180 -2
  803. package/src/result.ts +36 -0
  804. package/src/storage-backends/cursor-hosted.ts +7 -4
  805. package/src/storage-protocol.ts +102 -95
  806. package/src/storage.ts +4 -0
  807. package/src/tools.ts +18 -0
  808. package/src/types.ts +146 -34
  809. package/templates/triage/agent/lib/types.ts +0 -2
  810. package/dist/continuation.d.ts +0 -20
  811. package/dist/continuation.d.ts.map +0 -1
  812. package/dist/continuation.js +0 -18
  813. package/dist/docs/assets/chunks/@localSearchIndexroot.DbFXINq2.js +0 -1
  814. package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.js +0 -9
  815. package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.lean.js +0 -1
  816. package/dist/docs/assets/index.md.Bb4k8kUm.js +0 -5
  817. package/dist/docs/assets/reference_hooks.md.a8BJxMR5.js +0 -14
  818. package/dist/docs/assets/skills_framework-map.md.BTi817yv.js +0 -1
  819. package/dist/docs/guides/cloud-runtime.html +0 -35
  820. package/dist/docs/guides/cloud-runtime.md +0 -115
  821. package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts +0 -30
  822. package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts.map +0 -1
  823. package/dist/extensions/cursor-cloud-agents/lib/cloud.js +0 -45
  824. package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts +0 -4
  825. package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts.map +0 -1
  826. package/dist/extensions/cursor-cloud-agents/tools/status.d.ts +0 -4
  827. package/dist/extensions/cursor-cloud-agents/tools/status.d.ts.map +0 -1
  828. package/dist/extensions/cursor-cloud-agents/tools/status.js +0 -41
  829. package/dist/internal/convert-automation/index.d.ts +0 -3
  830. package/dist/internal/convert-automation/index.d.ts.map +0 -1
  831. package/dist/internal/convert-automation/index.js +0 -1
  832. package/dist/internal/grokbot/runner.d.ts +0 -64
  833. package/dist/internal/grokbot/runner.d.ts.map +0 -1
  834. package/dist/internal/grokbot/runner.js +0 -282
  835. package/dist/internal/managed-delivery.d.ts +0 -80
  836. package/dist/internal/managed-delivery.d.ts.map +0 -1
  837. package/dist/internal/managed-delivery.js +0 -86
  838. package/dist/internal/review-comments.d.ts +0 -370
  839. package/dist/internal/review-comments.d.ts.map +0 -1
  840. package/dist/internal/review-comments.js +0 -921
  841. package/dist/internal/shallow-clone.d.ts +0 -176
  842. package/dist/internal/shallow-clone.d.ts.map +0 -1
  843. package/dist/internal/shallow-clone.js +0 -419
  844. package/dist/playground/assets/index-BnNN1-EK.js +0 -69
  845. package/dist/playground/assets/index-DBQCwFp0.css +0 -1
  846. package/docs/guides/cloud-runtime.md +0 -120
  847. package/src/continuation.ts +0 -49
  848. package/src/extensions/cursor-cloud-agents/lib/cloud.ts +0 -79
  849. package/src/extensions/cursor-cloud-agents/tools/follow_up.ts +0 -29
  850. package/src/extensions/cursor-cloud-agents/tools/status.ts +0 -39
  851. package/src/internal/convert-automation/index.ts +0 -10
  852. package/src/internal/grokbot/runner.ts +0 -370
  853. package/src/internal/managed-delivery.ts +0 -125
  854. package/src/internal/review-comments.ts +0 -1363
  855. package/src/internal/shallow-clone.ts +0 -609
  856. /package/dist/docs/assets/{evals.md.CPzDAwoH.lean.js → evals.md.CbMoebP1.lean.js} +0 -0
  857. /package/dist/docs/assets/{guides_github.md.BtPr9GaP.lean.js → guides_github.md.DKYiT9do.lean.js} +0 -0
  858. /package/dist/docs/assets/{reference_agent-config.md.BHeYMgme.lean.js → reference_agent-config.md.CHNpiyp4.lean.js} +0 -0
  859. /package/dist/docs/assets/{reference_cli.md.DfoeyvL0.lean.js → reference_cli.md.CJNc_xYK.lean.js} +0 -0
  860. /package/dist/docs/assets/{reference_playground.md.DnX5nL-B.lean.js → reference_playground.md.4myJPxrf.lean.js} +0 -0
  861. /package/dist/docs/assets/{reference_skills.md.BFW9retM.lean.js → reference_skills.md.l2ezAcaN.lean.js} +0 -0
  862. /package/dist/docs/assets/{reference_tools.md.CvAHsdSp.lean.js → reference_tools.md.aGrn99hP.lean.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{_ as s,c as t,o as a,ag as o}from"./chunks/framework.BCISBCiQ.js";const k=JSON.parse('{"title":"OpenTelemetry","description":"Push session, turn, and tool traces from the serve process to an OTLP collector you run.","frontmatter":{"title":"OpenTelemetry","description":"Push session, turn, and tool traces from the serve process to an OTLP collector you run."},"headers":[],"relativePath":"guides/opentelemetry.md","filePath":"guides/opentelemetry.md"}'),n={name:"guides/opentelemetry.md"};function i(r,e,l,d,p,c){return a(),t("div",null,[...e[0]||(e[0]=[o(`<h1 id="opentelemetry" tabindex="-1">OpenTelemetry <a class="header-anchor" href="#opentelemetry" aria-label="Permalink to &quot;OpenTelemetry&quot;">​</a></h1><p>Agent SDK can push traces, metrics, and logs from the serve process to an OTLP collector you run. Point the process at the collector with standard <code>OTEL_EXPORTER_OTLP_*</code> env, or author <code>agent/otel.ts</code>. Traces cover the inbound request, the session, each turn, and every tool call.</p><p>Export is opt-in. Nothing leaves the process until you set an endpoint or a <code>defineOtel</code> config.</p><h2 id="what-does-agent-sdk-export" tabindex="-1">What does Agent SDK export? <a class="header-anchor" href="#what-does-agent-sdk-export" aria-label="Permalink to &quot;What does Agent SDK export?&quot;">​</a></h2><table tabindex="0"><thead><tr><th>Signal</th><th>Default</th><th>What you get</th></tr></thead><tbody><tr><td>Traces</td><td>on</td><td><code>agent_sdk.http</code> <code>agent_sdk.session</code> <code>agent_sdk.turn</code> → <code>agent_sdk.tool</code> / <code>agent_sdk.subagent</code></td></tr><tr><td>Metrics</td><td>on</td><td><code>cursor.token.usage</code>, <code>cursor.tool.calls</code>, <code>cursor.cost.usage</code>, plus <code>agent_sdk.*</code> session and turn counts</td></tr><tr><td>Logs</td><td>off</td><td>Session events as log records. Prompt text, tool payloads, and failure messages stay off unless you opt in</td></tr></tbody></table><p>Turn off a signal with <code>traces: false</code>, <code>metrics: false</code>, or <code>logs: false</code> on <code>defineOtel</code>. Logs also turn on when you set <code>OTEL_LOGS_EXPORTER</code> to anything other than <code>none</code>, or when you set the content flags below.</p><h2 id="how-do-i-turn-opentelemetry-export-on" tabindex="-1">How do I turn OpenTelemetry export on? <a class="header-anchor" href="#how-do-i-turn-opentelemetry-export-on" aria-label="Permalink to &quot;How do I turn OpenTelemetry export on?&quot;">​</a></h2><p>Set a collector URL in the serve process environment:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> OTEL_EXPORTER_OTLP_ENDPOINT</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">https://otel.example.com</span></span>
1
+ import{_ as s,c as t,o as a,ag as o}from"./chunks/framework.BCISBCiQ.js";const k=JSON.parse('{"title":"OpenTelemetry","description":"Push session, turn, and tool traces from the serve process to an OTLP collector you run.","frontmatter":{"title":"OpenTelemetry","description":"Push session, turn, and tool traces from the serve process to an OTLP collector you run."},"headers":[],"relativePath":"guides/opentelemetry.md","filePath":"guides/opentelemetry.md"}'),n={name:"guides/opentelemetry.md"};function i(r,e,d,l,p,h){return a(),t("div",null,[...e[0]||(e[0]=[o(`<h1 id="opentelemetry" tabindex="-1">OpenTelemetry <a class="header-anchor" href="#opentelemetry" aria-label="Permalink to &quot;OpenTelemetry&quot;">​</a></h1><p>Agent SDK can push traces, metrics, and logs from the serve process to an OTLP collector you run. Point the process at the collector with standard <code>OTEL_EXPORTER_OTLP_*</code> env, or author <code>agent/otel.ts</code>. Traces cover the inbound request, each turn, and every tool call.</p><p>Export is opt-in. Nothing leaves the process until you set an endpoint or a <code>defineOtel</code> config.</p><h2 id="what-does-agent-sdk-export" tabindex="-1">What does Agent SDK export? <a class="header-anchor" href="#what-does-agent-sdk-export" aria-label="Permalink to &quot;What does Agent SDK export?&quot;">​</a></h2><table tabindex="0"><thead><tr><th>Signal</th><th>Default</th><th>What you get</th></tr></thead><tbody><tr><td>Traces</td><td>on</td><td><code>agent_sdk.http</code> (per request) and <code>agent_sdk.turn</code> → <code>agent_sdk.tool</code> / <code>agent_sdk.subagent</code></td></tr><tr><td>Metrics</td><td>on</td><td><code>cursor.token.usage</code>, <code>cursor.tool.calls</code>, <code>cursor.cost.usage</code>, plus <code>agent_sdk.*</code> session and turn counts</td></tr><tr><td>Logs</td><td>off</td><td>Session events as log records. Prompt text, tool payloads, and failure messages stay off unless you opt in</td></tr></tbody></table><p>Turn off a signal with <code>traces: false</code>, <code>metrics: false</code>, or <code>logs: false</code> on <code>defineOtel</code>. Logs also turn on when you set <code>OTEL_LOGS_EXPORTER</code> to anything other than <code>none</code>, or when you set the content flags below.</p><h2 id="how-do-i-turn-opentelemetry-export-on" tabindex="-1">How do I turn OpenTelemetry export on? <a class="header-anchor" href="#how-do-i-turn-opentelemetry-export-on" aria-label="Permalink to &quot;How do I turn OpenTelemetry export on?&quot;">​</a></h2><p>Set a collector URL in the serve process environment:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> OTEL_EXPORTER_OTLP_ENDPOINT</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">https://otel.example.com</span></span>
2
2
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> OTEL_EXPORTER_OTLP_HEADERS</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Authorization=Bearer …&quot;</span></span></code></pre></div><p>The default wire format is OTLP/HTTP protobuf. That matches <a href="https://cursor.com/docs/enterprise/opentelemetry-export" target="_blank" rel="noreferrer">Cursor enterprise OpenTelemetry Export</a>. Set <code>OTEL_EXPORTER_OTLP_PROTOCOL=http/json</code> when your collector only accepts JSON. The runtime accepts <code>http/protobuf</code> and <code>http/json</code>. <code>grpc</code> falls back to protobuf and logs a warning.</p><p><code>OTEL_EXPORTER_OTLP_ENDPOINT</code> is the base URL. The runtime appends <code>/v1/traces</code>, <code>/v1/metrics</code>, and <code>/v1/logs</code>. If you pass a signal path, it is stripped back to the base first.</p><p>To send each signal to a different collector, omit the base URL and set the per-signal vars:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> OTEL_EXPORTER_OTLP_TRACES_ENDPOINT</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">https://traces.example.com/v1/traces</span></span>
3
3
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> OTEL_EXPORTER_OTLP_METRICS_ENDPOINT</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">https://metrics.example.com/v1/metrics</span></span>
4
4
  <span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> OTEL_EXPORTER_OTLP_LOGS_ENDPOINT</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">https://logs.example.com/v1/logs</span></span></code></pre></div><p>Optional:</p><table tabindex="0"><thead><tr><th>Variable</th><th>Effect</th></tr></thead><tbody><tr><td><code>OTEL_SERVICE_NAME</code></td><td>Resource <code>service.name</code>. Default <code>cursor</code></td></tr><tr><td><code>OTEL_LOG_USER_PROMPTS=1</code></td><td>Include user prompt text on logs and span events</td></tr><tr><td><code>OTEL_LOG_TOOL_CONTENT=1</code></td><td>Include tool payloads and failure text (truncated)</td></tr></tbody></table><p><code>serve(dir, { otel: false })</code> turns export off even when env or <code>agent/otel.ts</code> is set.</p><h2 id="how-do-i-author-agent-otel-ts" tabindex="-1">How do I author <code>agent/otel.ts</code>? <a class="header-anchor" href="#how-do-i-author-agent-otel-ts" aria-label="Permalink to &quot;How do I author \`agent/otel.ts\`?&quot;">​</a></h2><p>Use <code>defineOtel</code> when you want the collector URL, headers, or sampling in the project instead of the environment:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineOtel } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/july/otel&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
@@ -12,16 +12,15 @@ import{_ as s,c as t,o as a,ag as o}from"./chunks/framework.BCISBCiQ.js";const k
12
12
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> headers: { Authorization: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Bearer …&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
13
13
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
14
14
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ],</span></span>
15
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Multiple <code>exporters</code> fan out to every destination. Restrict one destination with <code>signals: [&quot;traces&quot;]</code>.</p><p>You can also pass the same object to <code>serve(dir, { otel })</code>. Precedence is <code>serve({ otel })</code> over <code>agent/otel.ts</code> over env. An empty <code>defineOtel()</code> still enables export when <code>OTEL_EXPORTER_OTLP_*</code> is set.</p><p>The companion skill is <a href="./../skills/otel.html"><code>skills/otel/SKILL.md</code></a>.</p><h2 id="what-spans-does-a-session-produce" tabindex="-1">What spans does a session produce? <a class="header-anchor" href="#what-spans-does-a-session-produce" aria-label="Permalink to &quot;What spans does a session produce?&quot;">​</a></h2><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>agent_sdk.http inbound channel request (W3C traceparent)</span></span>
16
- <span class="line"><span> └─ agent_sdk.session cursor.conversation.id = session id</span></span>
17
- <span class="line"><span> └─ agent_sdk.turn</span></span>
18
- <span class="line"><span> ├─ agent_sdk.tool</span></span>
19
- <span class="line"><span> └─ agent_sdk.subagent</span></span>
20
- <span class="line"><span> └─ agent_sdk.tool</span></span></code></pre></div><p>Inbound HTTP extracts W3C <code>traceparent</code>, so a channel request parents the session span when the turn starts in that request. Turns that resume after restore, or a direct <code>callTool</code> with no <code>turn.started</code> in this process, open a synthetic turn span so tool calls still nest.</p><h2 id="which-attributes-land-on-the-wire" tabindex="-1">Which attributes land on the wire? <a class="header-anchor" href="#which-attributes-land-on-the-wire" aria-label="Permalink to &quot;Which attributes land on the wire?&quot;">​</a></h2><p>Every signal carries these resource attributes:</p><ul><li><code>service.name</code> (<code>cursor</code> unless you override it)</li><li><code>cursor.entrypoint=sdk_ts</code></li><li><code>cursor.surface=unspecified</code></li><li><code>agent_sdk.framework=@cursor/july</code></li></ul><p>Shared names (same keys as enterprise export):</p><ul><li><code>cursor.conversation.id</code>: the session id</li><li><code>cursor.model.name</code></li><li><code>cursor.token.usage</code> with <code>cursor.token.type</code> of <code>input</code>, <code>output</code>, <code>cache_read</code>, <code>cache_creation</code>, or <code>reasoning</code></li><li><code>cursor.tool.calls</code> with <code>cursor.tool.name</code>, <code>cursor.tool.kind</code>, and <code>cursor.tool.status</code></li><li><code>cursor.cost.usage</code> (USD)</li></ul><p>Agent SDK only (<code>agent_sdk.*</code>): agent name, turn id, channel, call id, subagent name, session mode, and HTTP duration (<code>agent_sdk.http.duration</code>).</p><h2 id="how-do-i-emit-my-own-metrics" tabindex="-1">How do I emit my own metrics? <a class="header-anchor" href="#how-do-i-emit-my-own-metrics" aria-label="Permalink to &quot;How do I emit my own metrics?&quot;">​</a></h2><p><code>ctx.host.otel</code> is always present on tools, hooks, and channel handlers. Counters and histograms no-op when no meter is running. <code>setAttributes</code> still tags the open session when a collector is attached.</p><p>Prefix metric names with your team or agent. First-party names (<code>cursor.token.usage</code>, <code>cursor.tool.calls</code>, <code>cursor.cost.usage</code>, <code>agent_sdk.session.count</code>, <code>agent_sdk.turn.count</code>, <code>agent_sdk.subagent.count</code>, <code>agent_sdk.http.duration</code>) and join keys (<code>cursor.conversation.id</code>, <code>agent_sdk.agent</code>, <code>agent_sdk.turn_id</code>, <code>agent_sdk.framework</code>) are reserved. Custom spans are not on this surface.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">ctx.host.otel.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">setAttributes</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
15
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Multiple <code>exporters</code> fan out to every destination. Restrict one destination with <code>signals: [&quot;traces&quot;]</code>.</p><p>You can also pass the same object to <code>serve(dir, { otel })</code>. Precedence is <code>serve({ otel })</code> over <code>agent/otel.ts</code> over env. An empty <code>defineOtel()</code> still records traces; export starts when <code>OTEL_EXPORTER_OTLP_*</code> or a factory-returned <code>exporters</code> list appears.</p><p>Hosted v2 binds deployment secrets after bake, onto the already-listening process. Pass a factory so flush can re-read them. Spans record from bake; the hosted handler flush constructs the OTLP client and sends the queued batch.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineOtel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(() </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=&gt;</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> resolveMyOtelConfig</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">());</span></span></code></pre></div><p>The companion skill is <a href="./../skills/otel.html"><code>skills/otel/SKILL.md</code></a>.</p><h2 id="what-spans-does-a-session-produce" tabindex="-1">What spans does a session produce? <a class="header-anchor" href="#what-spans-does-a-session-produce" aria-label="Permalink to &quot;What spans does a session produce?&quot;">​</a></h2><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>agent_sdk.http inbound channel request (W3C traceparent)</span></span>
16
+ <span class="line"><span>agent_sdk.turn one root per turn (\`agent_sdk.session_id\` = session id)</span></span>
17
+ <span class="line"><span> ├─ agent_sdk.tool</span></span>
18
+ <span class="line"><span> └─ agent_sdk.subagent</span></span>
19
+ <span class="line"><span> └─ agent_sdk.tool</span></span></code></pre></div><p>Conversational sessions stay on <code>session.waiting</code> and can take more turns, so there is no <code>agent_sdk.session</code> span — it would never end and OTel only exports ended spans. Each turn is its own root. Inbound HTTP is a separate SERVER span (it extracts W3C <code>traceparent</code>) and does not parent the turn, so the turn tree can export when the turn ends. Hosted flush ends that SERVER span before the one-shot export so <code>agent_sdk.http</code> is in the same batch.</p><p>Turns that resume after restore, or a direct <code>callTool</code> with no <code>turn.started</code> in this process, open a synthetic turn span so tool calls still nest.</p><h2 id="which-attributes-land-on-the-wire" tabindex="-1">Which attributes land on the wire? <a class="header-anchor" href="#which-attributes-land-on-the-wire" aria-label="Permalink to &quot;Which attributes land on the wire?&quot;">​</a></h2><p>Every signal carries these resource attributes:</p><ul><li><code>service.name</code> (<code>cursor</code> unless you override it)</li><li><code>cursor.entrypoint=sdk_ts</code></li><li><code>cursor.surface=unspecified</code></li><li><code>agent_sdk.framework=@cursor/july</code></li></ul><p>Span attributes (not process resource attributes — one serve process handles many sessions):</p><ul><li><code>agent_sdk.session_id</code> / <code>cursor.conversation.id</code>: the session id. Search all turns for one conversation with <code>@agent_sdk.session_id</code>.</li></ul><p>Shared names (same keys as enterprise export):</p><ul><li><code>cursor.conversation.id</code>: the session id</li><li><code>cursor.model.name</code></li><li><code>cursor.token.usage</code> with <code>cursor.token.type</code> of <code>input</code>, <code>output</code>, <code>cache_read</code>, <code>cache_creation</code>, or <code>reasoning</code></li><li><code>cursor.tool.calls</code> with <code>cursor.tool.name</code>, <code>cursor.tool.kind</code>, and <code>cursor.tool.status</code></li><li><code>cursor.cost.usage</code> (USD)</li></ul><p>Agent SDK only (<code>agent_sdk.*</code>): session id, agent name, turn id, channel, call id, subagent name, session mode, and HTTP duration (<code>agent_sdk.http.duration</code>).</p><h2 id="how-do-i-emit-my-own-metrics" tabindex="-1">How do I emit my own metrics? <a class="header-anchor" href="#how-do-i-emit-my-own-metrics" aria-label="Permalink to &quot;How do I emit my own metrics?&quot;">​</a></h2><p><code>ctx.host.otel</code> is always present on tools, hooks, and channel handlers. Counters and histograms no-op when no meter is running. <code>setAttributes</code> still tags open turn/tool spans when a collector is attached.</p><p>Prefix metric names with your team or agent. First-party names (<code>cursor.token.usage</code>, <code>cursor.tool.calls</code>, <code>cursor.cost.usage</code>, <code>agent_sdk.session.count</code>, <code>agent_sdk.turn.count</code>, <code>agent_sdk.subagent.count</code>, <code>agent_sdk.http.duration</code>) and join keys (<code>cursor.conversation.id</code>, <code>agent_sdk.session_id</code>, <code>agent_sdk.agent</code>, <code>agent_sdk.turn_id</code>, <code>agent_sdk.framework</code>) are reserved. Custom spans are not on this surface.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">ctx.host.otel.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">setAttributes</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
21
20
  <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;abc.ticket_id&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;INC-123&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
22
21
  <span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;abc.queue&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;p1&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
23
22
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span>
24
23
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">ctx.host.otel.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">increment</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;abc.ticket.resolved&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
25
24
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">ctx.host.otel.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">record</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;abc.approval.duration_ms&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1420</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, {</span></span>
26
25
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> outcome: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;approved&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
27
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>A session-bound host (tools and hooks) adds <code>cursor.conversation.id</code> and <code>agent_sdk.agent</code> for you. Tags merge: later <code>setAttributes</code> calls paint open spans and later first-party metrics.</p><h2 id="what-stays-off-the-opentelemetry-wire" tabindex="-1">What stays off the OpenTelemetry wire? <a class="header-anchor" href="#what-stays-off-the-opentelemetry-wire" aria-label="Permalink to &quot;What stays off the OpenTelemetry wire?&quot;">​</a></h2><p>User prompts, tool arguments, tool results, and failure messages are omitted by default. Failure spans still record an error status with a generic message (<code>turn failed</code> / <code>session failed</code>).</p><p>Opt in with <code>OTEL_LOG_USER_PROMPTS=1</code> and <code>OTEL_LOG_TOOL_CONTENT=1</code>, or the matching <code>logs: { userPrompts, toolContent }</code> fields on <code>defineOtel</code>. Opted-in strings truncate at 2,048 characters.</p><p>Deployment URLs from <code>agent.bound</code> stay off spans unless <code>toolContent</code> is on.</p><h2 id="how-does-agent-sdk-export-relate-to-cursor-enterprise-export" tabindex="-1">How does Agent SDK export relate to Cursor enterprise export? <a class="header-anchor" href="#how-does-agent-sdk-export-relate-to-cursor-enterprise-export" aria-label="Permalink to &quot;How does Agent SDK export relate to Cursor enterprise export?&quot;">​</a></h2><p><a href="https://cursor.com/docs/enterprise/opentelemetry-export" target="_blank" rel="noreferrer">Cursor enterprise OpenTelemetry Export</a> is the team-admin path. Cursor servers send org-wide metrics and logs to a collector you configure in Team Settings.</p><p>Agent SDK export is the process-local path. The serve process sends per-run traces, and optional metrics and logs, to a collector you point it at.</p><p>Point both at the same collector when you want one view. Group on <code>cursor.conversation.id</code>. Resource defaults (<code>service.name=cursor</code>, <code>cursor.entrypoint=sdk_ts</code>) keep the streams next to each other. The <a href="https://cursor.com/docs/enterprise/opentelemetry-export/wire" target="_blank" rel="noreferrer">wire reference</a> lists the shared attribute names.</p><p>Evals (<code>defineEval</code>) stay the in-product regression check. OpenTelemetry is the graph in your observability stack.</p><h2 id="what-if-another-opentelemetry-sdk-is-already-running" tabindex="-1">What if another OpenTelemetry SDK is already running? <a class="header-anchor" href="#what-if-another-opentelemetry-sdk-is-already-running" aria-label="Permalink to &quot;What if another OpenTelemetry SDK is already running?&quot;">​</a></h2><p>OTel providers are process-global. If Cursor CLI, an extension host, or another library already registered a TracerProvider, MeterProvider, or LoggerProvider, Agent SDK reuses it. Run <code>serve</code> as its own process when the Agent SDK exporters should own the destination.</p><p>Two mounts with different <code>agent/otel.ts</code> files fail at serve start. Use the same <code>defineOtel</code> config on every mount, or configure once through <code>serve({ otel })</code> or env.</p><h2 id="what-s-next" tabindex="-1">What&#39;s next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to &quot;What&#39;s next&quot;">​</a></h2><ul><li><a href="./../skills/otel.html"><code>skills/otel/SKILL.md</code></a>: compact <code>defineOtel</code> reference for coding agents</li><li><a href="./../reference/hooks.html">Hooks</a>: observe the same session event stream in-process</li><li><a href="./../deployment.html">Deployment</a>: env, secrets, and self-hosting</li><li><a href="https://cursor.com/docs/enterprise/opentelemetry-export" target="_blank" rel="noreferrer">Cursor enterprise OpenTelemetry Export</a></li></ul>`,50)])])}const u=s(n,[["render",i]]);export{k as __pageData,u as default};
26
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>A session-bound host (tools and hooks) adds <code>cursor.conversation.id</code> and <code>agent_sdk.agent</code> for you. Tags merge: later <code>setAttributes</code> calls paint open spans and later first-party metrics.</p><h2 id="what-stays-off-the-opentelemetry-wire" tabindex="-1">What stays off the OpenTelemetry wire? <a class="header-anchor" href="#what-stays-off-the-opentelemetry-wire" aria-label="Permalink to &quot;What stays off the OpenTelemetry wire?&quot;">​</a></h2><p>User prompts, tool arguments, tool results, and failure messages are omitted by default. Failure spans still record an error status with a generic message (<code>turn failed</code> / <code>session failed</code>).</p><p>Opt in with <code>OTEL_LOG_USER_PROMPTS=1</code> and <code>OTEL_LOG_TOOL_CONTENT=1</code>, or the matching <code>logs: { userPrompts, toolContent }</code> fields on <code>defineOtel</code>. Opted-in strings truncate at 2,048 characters.</p><p>Deployment URLs from <code>agent.bound</code> stay off spans unless <code>toolContent</code> is on.</p><h2 id="how-does-agent-sdk-export-relate-to-cursor-enterprise-export" tabindex="-1">How does Agent SDK export relate to Cursor enterprise export? <a class="header-anchor" href="#how-does-agent-sdk-export-relate-to-cursor-enterprise-export" aria-label="Permalink to &quot;How does Agent SDK export relate to Cursor enterprise export?&quot;">​</a></h2><p><a href="https://cursor.com/docs/enterprise/opentelemetry-export" target="_blank" rel="noreferrer">Cursor enterprise OpenTelemetry Export</a> is the team-admin path. Cursor servers send org-wide metrics and logs to a collector you configure in Team Settings.</p><p>Agent SDK export is the process-local path. The serve process sends per-run traces, and optional metrics and logs, to a collector you point it at.</p><p>Point both at the same collector when you want one view. Group on <code>cursor.conversation.id</code>. Resource defaults (<code>service.name=cursor</code>, <code>cursor.entrypoint=sdk_ts</code>) keep the streams next to each other. The <a href="https://cursor.com/docs/enterprise/opentelemetry-export/wire" target="_blank" rel="noreferrer">wire reference</a> lists the shared attribute names.</p><p>Evals (<code>defineEval</code>) stay the in-product regression check. OpenTelemetry is the graph in your observability stack.</p><h2 id="what-if-another-opentelemetry-sdk-is-already-running" tabindex="-1">What if another OpenTelemetry SDK is already running? <a class="header-anchor" href="#what-if-another-opentelemetry-sdk-is-already-running" aria-label="Permalink to &quot;What if another OpenTelemetry SDK is already running?&quot;">​</a></h2><p>OTel providers are process-global. If Cursor CLI, an extension host, or another library already registered a TracerProvider, MeterProvider, or LoggerProvider, Agent SDK reuses it. Run <code>serve</code> as its own process when the Agent SDK exporters should own the destination.</p><p>Two mounts with different <code>agent/otel.ts</code> files fail at serve start. Use the same <code>defineOtel</code> config on every mount, or configure once through <code>serve({ otel })</code> or env.</p><h2 id="what-s-next" tabindex="-1">What&#39;s next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to &quot;What&#39;s next&quot;">​</a></h2><ul><li><a href="./../skills/otel.html"><code>skills/otel/SKILL.md</code></a>: compact <code>defineOtel</code> reference for coding agents</li><li><a href="./../reference/hooks.html">Hooks</a>: observe the same session event stream in-process</li><li><a href="./../deployment.html">Deployment</a>: env, secrets, and self-hosting</li><li><a href="https://cursor.com/docs/enterprise/opentelemetry-export" target="_blank" rel="noreferrer">Cursor enterprise OpenTelemetry Export</a></li></ul>`,55)])])}const u=s(n,[["render",i]]);export{k as __pageData,u as default};
@@ -1 +1 @@
1
- import{_ as s,c as t,o as a,ag as o}from"./chunks/framework.BCISBCiQ.js";const k=JSON.parse('{"title":"OpenTelemetry","description":"Push session, turn, and tool traces from the serve process to an OTLP collector you run.","frontmatter":{"title":"OpenTelemetry","description":"Push session, turn, and tool traces from the serve process to an OTLP collector you run."},"headers":[],"relativePath":"guides/opentelemetry.md","filePath":"guides/opentelemetry.md"}'),n={name:"guides/opentelemetry.md"};function i(r,e,l,d,p,c){return a(),t("div",null,[...e[0]||(e[0]=[o("",50)])])}const u=s(n,[["render",i]]);export{k as __pageData,u as default};
1
+ import{_ as s,c as t,o as a,ag as o}from"./chunks/framework.BCISBCiQ.js";const k=JSON.parse('{"title":"OpenTelemetry","description":"Push session, turn, and tool traces from the serve process to an OTLP collector you run.","frontmatter":{"title":"OpenTelemetry","description":"Push session, turn, and tool traces from the serve process to an OTLP collector you run."},"headers":[],"relativePath":"guides/opentelemetry.md","filePath":"guides/opentelemetry.md"}'),n={name:"guides/opentelemetry.md"};function i(r,e,d,l,p,h){return a(),t("div",null,[...e[0]||(e[0]=[o("",55)])])}const u=s(n,[["render",i]]);export{k as __pageData,u as default};
@@ -0,0 +1,5 @@
1
+ import{_ as t,c as a,o as s,ag as i}from"./chunks/framework.BCISBCiQ.js";const p=JSON.parse('{"title":"Agent SDK documentation","description":"Build and run Cursor agents with tools, approvals, channels, and evals.","frontmatter":{"title":"Agent SDK documentation","description":"Build and run Cursor agents with tools, approvals, channels, and evals."},"headers":[],"relativePath":"index.md","filePath":"README.md"}'),r={name:"index.md"};function n(l,e,o,h,d,c){return s(),a("div",null,[...e[0]||(e[0]=[i(`<h1 id="agent-sdk-documentation" tabindex="-1">Agent SDK documentation <a class="header-anchor" href="#agent-sdk-documentation" aria-label="Permalink to &quot;Agent SDK documentation&quot;">​</a></h1><p>Use the Agent SDK to define Cursor agents in TypeScript and Markdown. See <a href="./reference/project-layout.html">Project layout</a> for the directory structure.</p><p>Use Node 22.13 or newer. Bun isn&#39;t supported.</p><p>Create a project:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">npx</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> @cursor/july</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> init</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ./my-agent</span></span>
2
+ <span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> my-agent</span></span>
3
+ <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> dev</span></span></code></pre></div><p>If <code>agent-sdk</code> isn&#39;t on <code>PATH</code>, use <code>npx @cursor/july &lt;command&gt;</code>.</p><p>Open the docs locally:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">npx</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> @cursor/july</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> docs</span></span></code></pre></div><h2 id="where-to-start" tabindex="-1">Where to start <a class="header-anchor" href="#where-to-start" aria-label="Permalink to &quot;Where to start&quot;">​</a></h2><table tabindex="0"><thead><tr><th>You are...</th><th>Start with</th></tr></thead><tbody><tr><td>New to the Agent SDK</td><td><a href="./quickstart.html">Quickstart</a> (PR reviewer), then <a href="./concepts.html">Concepts</a></td></tr><tr><td>Building a new agent with Cursor</td><td><a href="./scaffolding-agents.html">Scaffold an agent with Cursor</a></td></tr><tr><td>Turning a Cursor Automation into a project</td><td><a href="./guides/convert-automation.html">Convert a Cursor Automation</a></td></tr><tr><td>Wiring an agent to Slack</td><td><a href="./guides/slack.html">Slack guide</a></td></tr><tr><td>Starting from a packaged template</td><td><a href="./templates/demo.html">Demo</a>, <a href="./templates/code-wiki.html">Code wiki</a>, <a href="./templates/agents-md.html">Living AGENTS.md</a>, <a href="./templates/security-reviewer.html">Security reviewer</a>, <a href="./templates/security-help.html">Security help</a>, <a href="./templates/triage.html">Triage</a>, or <a href="./templates/agentic-owners.html">Agentic Owners</a></td></tr><tr><td>Wiring an agent to GitHub webhooks</td><td><a href="./guides/github.html">GitHub guide</a></td></tr><tr><td>Driving PRs from a cloud VM</td><td><a href="./templates/pr-autofixer.html">PR autofixer template</a></td></tr><tr><td>Handing coding work to Cursor cloud agents</td><td><a href="./guides/cloud-agents.html">Cursor cloud agents</a></td></tr><tr><td>Driving an agent from Linear (or another tracker)</td><td><a href="./guides/webhooks.html#example-linear-as-the-control-plane">Webhooks guide: Linear example</a></td></tr><tr><td>Making an existing agent measurably better</td><td><a href="./evals.html">Evals</a>, then <a href="./hillclimbing.html">Hillclimbing</a></td></tr><tr><td>Comparing variants on live traffic</td><td><a href="./ab.html">Live A/B metrics</a></td></tr><tr><td>Deploying with Cursor or on your own infrastructure</td><td><a href="./deployment.html">Deployment</a></td></tr><tr><td>Debugging something that misbehaves</td><td><a href="./troubleshooting.html">Fix common agent problems</a></td></tr></tbody></table><h2 id="documentation" tabindex="-1">Documentation <a class="header-anchor" href="#documentation" aria-label="Permalink to &quot;Documentation&quot;">​</a></h2><p><strong>Core</strong></p><ul><li><a href="./quickstart.html">Quickstart</a>: build a PR reviewer that classifies changes by complexity and handles GitHub webhook events.</li><li><a href="./scaffolding-agents.html">Scaffold an agent with Cursor</a>: use the bundled skill for a guided build.</li><li><a href="./guides/convert-automation.html">Convert a Cursor Automation</a>: export a dashboard Automation into an Agent SDK project.</li><li><a href="./concepts.html">Concepts</a>: agent discovery, sessions, channels, runtimes, and observability.</li></ul><p><strong>Templates</strong></p><ul><li><a href="./templates/demo.html">Record a walkthrough from a collected PR</a>: host collects the PR, the model records, then comments.</li><li><a href="./templates/code-wiki.html">Keep a code wiki current after merge</a>: update in-repo <code>wiki/</code> pages when a pull request merges.</li><li><a href="./templates/agents-md.html">Keep AGENTS.md current from last week&#39;s work</a>: pull rules out of merged PRs and Slack, then open a follow-up PR.</li><li><a href="./templates/security-reviewer.html">Security reviewer</a>: review pull requests for exploitable bugs and post one comment.</li><li><a href="./templates/security-help.html">Answer security questions in Slack</a>: answer from your skills, or take a first look at a pasted PR.</li><li><a href="./templates/triage.html">Triage Linear or Jira issues in place</a>: classify existing tickets and comment on them.</li><li><a href="./templates/agentic-owners.html">Review pull requests with owners policies</a>: request owners and approve changes allowed by repository policy.</li><li><a href="./templates/pr-autofixer.html">Fix pull requests on a Cursor cloud VM</a></li></ul><p><strong>Self-improving Agents</strong></p><ul><li><a href="./building-with-agents.html">Building agents with agents</a>: use a coding agent to scaffold, run, and iterate on your agent.</li><li><a href="./evals.html">Evals</a>: author <code>defineEval</code> cases, pick fixtures, and use evals as regression checks.</li><li><a href="./ab.html">Live A/B metrics</a>: assign sticky variants and compare cumulative metrics on live sessions.</li><li><a href="./storage.html">Storage</a>: point durable storage at a backend you own with <code>defineStorage</code>.</li><li><a href="./hillclimbing.html">Hillclimbing</a>: measure and improve an agent iteratively.</li></ul><p><strong>Guides</strong></p><ul><li><a href="./guides/webhooks.html">Webhooks and custom channels</a>: give the agent its own HTTP surface.</li><li><a href="./guides/github.html">GitHub</a>: trigger the agent from pull requests, CI, and comments.</li><li><a href="./guides/slack.html">Slack</a>: put the agent in Slack over Socket Mode.</li><li><a href="./guides/human-in-the-loop.html">Human-in-the-loop approvals</a>: park a tool call until a person signs off.</li><li><a href="./guides/mcp-oauth.html">Host MCP OAuth</a>: authorize <code>oauth: true</code> connections, store tokens locally, and persist them on hosted deployments (<code>--store</code>).</li><li><a href="./guides/agent-to-agent.html">Agent-to-agent</a>: every agent is an MCP server; agents can delegate to each other.</li><li><a href="./guides/cloud-agents.html">Cursor cloud agents</a>: let the agent launch and steer cloud agents through the <code>cursor-cloud-agents</code> extension.</li><li><a href="./guides/opentelemetry.html">OpenTelemetry</a>: push session, turn, and tool traces to an OTLP collector you run.</li></ul><p><strong>Operating</strong></p><ul><li><a href="./deployment.html">Deployment</a>: Cursor-managed hosting, self-hosting, auth, state, and operations.</li><li><a href="./troubleshooting.html">Fix common agent problems</a>: diagnose common failures by symptom.</li></ul><p><strong>Reference</strong></p><ul><li><a href="./reference/project-layout.html">Project layout</a>: the full folder structure.</li><li><a href="./reference/agent-config.html">Agent config</a> · <a href="./reference/instructions.html">Instructions</a> · <a href="./reference/tools.html">Tools</a> · <a href="./reference/prompt.html"><code>prompt</code></a> · <a href="./reference/skills.html">Skills</a> · <a href="./reference/connections.html">MCP connections</a> · <a href="./reference/subagents.html">Subagents</a> · <a href="./reference/extensions.html">Extensions</a></li><li><a href="./reference/channels.html">Channels</a> · <a href="./reference/schedules.html">Schedules and reminders</a> · <a href="./reference/hooks.html">Hooks</a> · <a href="./reference/artifacts.html">Artifacts</a> · <a href="./reference/result.html">Turn result</a> · <a href="./reference/sessions.html">Sessions and streaming</a> · <a href="./reference/playground.html">Playground</a></li><li><a href="./reference/cli.html">CLI</a> · <a href="./reference/http-api.html">HTTP API</a></li></ul><h2 id="run-the-cli" tabindex="-1">Run the CLI <a class="header-anchor" href="#run-the-cli" aria-label="Permalink to &quot;Run the CLI&quot;">​</a></h2><p>Docs use <code>agent-sdk &lt;command&gt;</code>. If it isn&#39;t on <code>PATH</code>, use <code>npx @cursor/july &lt;command&gt;</code>.</p><h2 id="credentials" tabindex="-1">Credentials <a class="header-anchor" href="#credentials" aria-label="Permalink to &quot;Credentials&quot;">​</a></h2><p>Sign in to Cursor or set <code>CURSOR_API_KEY</code>:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> login</span></span>
4
+ <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># or: export CURSOR_API_KEY=key_...</span></span>
5
+ <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> whoami</span></span></code></pre></div><p>Confirm <code>agent-sdk whoami</code> shows the expected account.</p><h2 id="related-documentation" tabindex="-1">Related documentation <a class="header-anchor" href="#related-documentation" aria-label="Permalink to &quot;Related documentation&quot;">​</a></h2><ul><li>Package reference: <a href="./../README.html"><code>README.md</code></a></li><li>Coding-agent workflows: <a href="./skills/"><code>skills/</code></a></li></ul>`,31)])])}const m=t(r,[["render",n]]);export{p as __pageData,m as default};
@@ -1 +1 @@
1
- import{_ as t,c as a,o as i,ag as s}from"./chunks/framework.BCISBCiQ.js";const p=JSON.parse('{"title":"Agent SDK documentation","description":"Build and run Cursor agents with tools, approvals, channels, and evals.","frontmatter":{"title":"Agent SDK documentation","description":"Build and run Cursor agents with tools, approvals, channels, and evals."},"headers":[],"relativePath":"index.md","filePath":"README.md"}'),r={name:"index.md"};function n(l,e,o,h,d,c){return i(),a("div",null,[...e[0]||(e[0]=[s("",31)])])}const m=t(r,[["render",n]]);export{p as __pageData,m as default};
1
+ import{_ as t,c as a,o as s,ag as i}from"./chunks/framework.BCISBCiQ.js";const p=JSON.parse('{"title":"Agent SDK documentation","description":"Build and run Cursor agents with tools, approvals, channels, and evals.","frontmatter":{"title":"Agent SDK documentation","description":"Build and run Cursor agents with tools, approvals, channels, and evals."},"headers":[],"relativePath":"index.md","filePath":"README.md"}'),r={name:"index.md"};function n(l,e,o,h,d,c){return s(),a("div",null,[...e[0]||(e[0]=[i("",31)])])}const m=t(r,[["render",n]]);export{p as __pageData,m as default};
@@ -18,12 +18,12 @@ import{_ as e,c as t,o as i,ag as a}from"./chunks/framework.BCISBCiQ.js";const k
18
18
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { id: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;effort&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, value: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;high&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
19
19
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { id: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;fast&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, value: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;true&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
20
20
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ],</span></span>
21
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>A plain string works when you don&#39;t need params:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">model</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;composer-2.5&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span></code></pre></div><h2 id="choose-a-runtime" tabindex="-1">Choose a runtime <a class="header-anchor" href="#choose-a-runtime" aria-label="Permalink to &quot;Choose a runtime&quot;">​</a></h2><p><code>runtime: &quot;local&quot;</code> (the default) runs turns on the Cursor SDK harness on this machine. Server tools, skills, sandbox seeds, and tool approvals all apply.</p><p><code>runtime: &quot;cloud&quot;</code> runs turns on Cursor cloud agents (<code>bc-…</code> ids). Pass a <code>cloud</code> block with the repos the VM carries. Server tools stay reachable over authenticated HTTP MCP back to the serve host when <code>--public-url</code> or <code>--cloud-tools-url</code> is set (omitted with a warning otherwise), and instructions and agent-tool catalogs are prepended to the first prompt, because the local session workspace is not the cloud VM.</p><p><code>validate</code> warns when <code>runtime: &quot;cloud&quot;</code> is combined with agent tools or sandbox seeds (they only materialize into local session workspaces), when skills are present (they sync onto an Agent Store for native discovery rather than the session workspace), and when the <code>cloud</code> block is missing. The full capability matrix and the patterns that hold up are in the <a href="./../guides/cloud-runtime.html">Cloud runtime guide</a>.</p><h2 id="local-options" tabindex="-1">Local options <a class="header-anchor" href="#local-options" aria-label="Permalink to &quot;Local options&quot;">​</a></h2><p><code>local</code> sets local-harness defaults, all ignored for cloud turns.</p><p><code>local.workspaceDir</code> points every session at one shared harness cwd, for agents that work inside an existing checkout. It takes precedence over <code>cwd</code>, and a per-send <code>workspaceDir</code> still wins over both. The SDK keys its local executor (rules, skills, MCP, ignore mappings) on the harness cwd, so a shared directory resolves the workspace once per serve process instead of once per session. The trade: sessions share a working tree, so a file one turn writes is visible to the next.</p><p><code>local.sandbox</code> runs the harness inside Cursor&#39;s local sandbox. It&#39;s off by default, matching the SDK: shell then auto-approves and inherits the serve process environment, including any credentials the host holds. Turn it on for agents whose turns read untrusted input (webhook payloads, PR diffs, inbound chat); it&#39;s a real tool boundary rather than a prompt-level one.</p><h3 id="local-cwd" tabindex="-1">Local cwd <a class="header-anchor" href="#local-cwd" aria-label="Permalink to &quot;Local cwd&quot;">​</a></h3><p><code>local.cwd</code> sets the parent directory for local harness workspaces. Each session uses <code>&lt;cwd&gt;/&lt;sessionId&gt;</code> unless a per-send <code>workspaceDir</code> overrides it.</p><p>Session workspaces are real Cursor project directories. The harness loads <code>AGENTS.md</code> and <code>.cursor</code> config from ancestor directories. An agent nested in another git repo (a monorepo package) defaults to a per-project cache directory under <code>~/.cache</code> when you omit <code>cwd</code>, so the enclosing checkout does not leak rules, skills, or MCP servers into the turn. A standalone git root keeps the in-project session workspace. Point <code>cwd</code> at a checkout only when the agent should inherit that tree.</p><h2 id="allowlist-built-in-harness-tools" tabindex="-1">Allowlist built-in harness tools <a class="header-anchor" href="#allowlist-built-in-harness-tools" aria-label="Permalink to &quot;Allowlist built-in harness tools&quot;">​</a></h2><p>Use <code>tools</code> to limit which built-in Cursor harness tools the model can call. Omit it to keep the standard toolset. When you set it, the model gets only the tools you list. An empty list disables all native built-in tools. Because this field is an allowlist, new platform tools stay disabled until you add them.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineAgent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
21
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>A plain string works when you don&#39;t need params:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">model</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;composer-2.5&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span></code></pre></div><h2 id="choose-a-runtime" tabindex="-1">Choose a runtime <a class="header-anchor" href="#choose-a-runtime" aria-label="Permalink to &quot;Choose a runtime&quot;">​</a></h2><p><code>runtime: &quot;local&quot;</code> (the default) runs turns on the Cursor SDK harness on this machine. Server tools, skills, sandbox seeds, and tool approvals all apply.</p><p><code>runtime: &quot;cloud&quot;</code> runs turns on Cursor cloud agents (<code>bc-…</code> ids). Pass a <code>cloud</code> block with the repos the VM carries. Server tools stay reachable over authenticated HTTP MCP back to the serve host when <code>--public-url</code> or <code>--cloud-tools-url</code> is set (omitted with a warning otherwise), and instructions and agent-tool catalogs are prepended to the first prompt, because the local session workspace is not the cloud VM.</p><p><code>validate</code> warns when <code>runtime: &quot;cloud&quot;</code> is combined with agent tools (they are described on the first prompt instead of written to the VM), when skills or sandbox seeds are present (they sync onto an Agent Store rather than the session workspace), and when the <code>cloud</code> block is missing.</p><h2 id="local-options" tabindex="-1">Local options <a class="header-anchor" href="#local-options" aria-label="Permalink to &quot;Local options&quot;">​</a></h2><p><code>local</code> sets local-harness defaults, all ignored for cloud turns.</p><p><code>local.workspaceDir</code> points every session at one shared harness cwd, for agents that work inside an existing checkout. It takes precedence over <code>cwd</code>, and a per-send <code>workspaceDir</code> still wins over both. The SDK keys its local executor (rules, skills, MCP, ignore mappings) on the harness cwd, so a shared directory resolves the workspace once per serve process instead of once per session. The trade: sessions share a working tree, so a file one turn writes is visible to the next.</p><p><code>local.sandbox</code> runs the harness inside Cursor&#39;s local sandbox. It&#39;s off by default, matching the SDK: shell then auto-approves and inherits the serve process environment, including any credentials the host holds. Turn it on for agents whose turns read untrusted input (webhook payloads, PR diffs, inbound chat); it&#39;s a real tool boundary rather than a prompt-level one.</p><h3 id="local-cwd" tabindex="-1">Local cwd <a class="header-anchor" href="#local-cwd" aria-label="Permalink to &quot;Local cwd&quot;">​</a></h3><p><code>local.cwd</code> sets the parent directory for local harness workspaces. Each session uses <code>&lt;cwd&gt;/&lt;sessionId&gt;</code> unless a per-send <code>workspaceDir</code> overrides it.</p><p>Session workspaces are real Cursor project directories. The harness loads <code>AGENTS.md</code> and <code>.cursor</code> config from ancestor directories. An agent nested in another git repo (a monorepo package) defaults to a per-project cache directory under <code>~/.cache</code> when you omit <code>cwd</code>, so the enclosing checkout does not leak rules, skills, or MCP servers into the turn. A standalone git root keeps the in-project session workspace. Point <code>cwd</code> at a checkout only when the agent should inherit that tree.</p><h2 id="allowlist-built-in-harness-tools" tabindex="-1">Allowlist built-in harness tools <a class="header-anchor" href="#allowlist-built-in-harness-tools" aria-label="Permalink to &quot;Allowlist built-in harness tools&quot;">​</a></h2><p>Use <code>tools</code> to limit which built-in Cursor harness tools the model can call. Omit it to keep the standard toolset. When you set it, the model gets only the tools you list. An empty list disables all native built-in tools. Because this field is an allowlist, new platform tools stay disabled until you add them.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineAgent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
22
22
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> model: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;composer-2.5&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
23
23
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Read-only triage agent: search and read only.</span></span>
24
24
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // No shell, no edits, no subagents.</span></span>
25
25
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tools: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;read&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;grep&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;glob&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;ls&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">],</span></span>
26
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>The Agent SDK always adds <code>&quot;mcp&quot;</code> to a configured allowlist. Authored server tools in <code>agent/tools/</code> use MCP to reach the model. MCP can also expose declared connections and servers from the harness directory&#39;s ambient <code>.cursor</code> config. To exclude a checkout&#39;s MCP servers, point <code>local.cwd</code> outside the checkout. See <a href="#local-cwd">Local cwd</a>. <code>local.sandbox</code> makes MCP tool calls fail closed.</p><p>Use the SDK&#39;s public tool names, including <code>&quot;shell&quot;</code>, <code>&quot;read&quot;</code>, <code>&quot;edit&quot;</code>, <code>&quot;grep&quot;</code>, <code>&quot;glob&quot;</code>, <code>&quot;ls&quot;</code>, and <code>&quot;task&quot;</code>. Unknown names fail the turn with a <code>ConfigurationError</code>.</p><p>Two names have broader effects:</p><ul><li><code>&quot;shell&quot;</code> also grants shell input. Tools with <code>execution: &quot;agent&quot;</code> need it to run their scripts. Discovery warns when your allowlist would prevent those tools from running.</li><li><code>&quot;task&quot;</code> lets the root agent start subagents. Each subagent keeps its own curated toolset.</li></ul><p>Tool allowlists work only with the local runtime. A <code>runtime: &quot;cloud&quot;</code> agent that sets <code>tools</code> fails at serve startup. The Agent SDK also refuses per-send cloud sessions from a hybrid agent with an allowlist. It won&#39;t run those sessions with unrestricted tool access.</p><p>The allowlist controls which tools the model can call. It does not isolate the serve host. For agents that process untrusted input, also set <code>local: { sandbox: true }</code>.</p><h2 id="cloud-options" tabindex="-1">Cloud options <a class="header-anchor" href="#cloud-options" aria-label="Permalink to &quot;Cloud options&quot;">​</a></h2><p>Cloud agent defaults forwarded to the Cursor SDK: <code>repos</code> (each <code>{ url, startingRef? }</code>), environment selection, <code>envVars</code>, and the rest. A local agent uses the same block as the base config when a channel opens a cloud-attached session per send. That hybrid pattern is covered in <a href="./../guides/cloud-runtime.html#hybrid-local-agent-cloud-sessions">Cloud runtime</a>.</p><h2 id="concurrency" tabindex="-1">Concurrency <a class="header-anchor" href="#concurrency" aria-label="Permalink to &quot;Concurrency&quot;">​</a></h2><p><code>concurrency.maxRunningTurns</code> caps how many model turns run at once across all of the agent&#39;s sessions (positive integer, hard cap 200). When every slot is busy, newly admitted turns queue FIFO instead of failing: the stream records a durable <code>turn.queued</code> event with the queue position, <code>GET /v1/sessions</code> reports <code>queued: true</code>, and each queued turn starts as soon as a slot frees. A queued turn still counts as running for busy semantics: follow-ups preempt it, and direct write-effect tool calls get <code>409 session_busy</code>. Omit for unlimited.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineAgent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
26
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>The Agent SDK always adds <code>&quot;mcp&quot;</code> to a configured allowlist. Authored server tools in <code>agent/tools/</code> use MCP to reach the model. MCP can also expose declared connections and servers from the harness directory&#39;s ambient <code>.cursor</code> config. To exclude a checkout&#39;s MCP servers, point <code>local.cwd</code> outside the checkout. See <a href="#local-cwd">Local cwd</a>. <code>local.sandbox</code> makes MCP tool calls fail closed.</p><p>Use the SDK&#39;s public tool names, including <code>&quot;shell&quot;</code>, <code>&quot;read&quot;</code>, <code>&quot;edit&quot;</code>, <code>&quot;grep&quot;</code>, <code>&quot;glob&quot;</code>, <code>&quot;ls&quot;</code>, and <code>&quot;task&quot;</code>. Unknown names fail the turn with a <code>ConfigurationError</code>.</p><p>Two names have broader effects:</p><ul><li><code>&quot;shell&quot;</code> also grants shell input. Tools with <code>execution: &quot;agent&quot;</code> need it to run their scripts. Discovery warns when your allowlist would prevent those tools from running.</li><li><code>&quot;task&quot;</code> lets the root agent start subagents. Each subagent keeps its own curated toolset.</li></ul><p>Tool allowlists work only with the local runtime. A <code>runtime: &quot;cloud&quot;</code> agent that sets <code>tools</code> fails at serve startup. The Agent SDK also refuses per-send cloud sessions from a hybrid agent with an allowlist. It won&#39;t run those sessions with unrestricted tool access.</p><p>The allowlist controls which tools the model can call. It does not isolate the serve host. For agents that process untrusted input, also set <code>local: { sandbox: true }</code>.</p><h2 id="cloud-options" tabindex="-1">Cloud options <a class="header-anchor" href="#cloud-options" aria-label="Permalink to &quot;Cloud options&quot;">​</a></h2><p>Cloud agent defaults forwarded to the Cursor SDK: <code>repos</code> (each <code>{ url, startingRef? }</code>), environment selection, <code>envVars</code>, and the rest. A local agent uses the same block as the base config when a channel opens a cloud-attached session per send (the <code>cloud</code> option on <a href="./channels.html#handler-arguments"><code>send</code></a>).</p><h2 id="concurrency" tabindex="-1">Concurrency <a class="header-anchor" href="#concurrency" aria-label="Permalink to &quot;Concurrency&quot;">​</a></h2><p><code>concurrency.maxRunningTurns</code> caps how many model turns run at once across all of the agent&#39;s sessions (positive integer, hard cap 200). When every slot is busy, newly admitted turns queue FIFO instead of failing: the stream records a durable <code>turn.queued</code> event with the queue position, <code>GET /v1/sessions</code> reports <code>queued: true</code>, and each queued turn starts as soon as a slot frees. A queued turn still counts as running for busy semantics: follow-ups preempt it, and direct write-effect tool calls get <code>409 session_busy</code>. Omit for unlimited.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineAgent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
27
27
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> concurrency: { maxRunningTurns: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">3</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
28
28
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><h2 id="built-in-tools" tabindex="-1">Built-in tools <a class="header-anchor" href="#built-in-tools" aria-label="Permalink to &quot;Built-in tools&quot;">​</a></h2><p><code>builtinTools</code> opts into framework-provided model-facing tools. Each enabled capability materializes as ordinary server tools at discovery time, so turns, direct calls, <code>info</code>, and the playground treat them like authored tools. Authored tools with the same name win, with a warning, and like all server tools they run on the local runtime.</p><p><code>builtinTools: { reminders: true }</code> adds three tools bound to the current conversation over <code>host.reminders</code>: <code>reminders_create</code>, <code>reminders_list</code>, and <code>reminders_cancel</code>. Sessions without a continuation key can&#39;t arm reminders. See <a href="./schedules.html#reminders">Schedules and reminders</a>.</p><h2 id="generate-instructions" tabindex="-1">Generate instructions <a class="header-anchor" href="#generate-instructions" aria-label="Permalink to &quot;Generate instructions&quot;">​</a></h2><p>When the system prompt must be computed, author <code>agent/instructions.ts</code> instead of markdown:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineInstructions } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;@cursor/july&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
29
29
  <span class="line"></span>
@@ -37,4 +37,4 @@ import{_ as e,c as t,o as i,ag as a}from"./chunks/framework.BCISBCiQ.js";const k
37
37
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span>
38
38
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">console.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">log</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">\`listening on \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">handle</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">url</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}\`</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
39
39
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// handle.callTool(...), handle.dispatchSchedule(&quot;heartbeat&quot;),</span></span>
40
- <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// handle.createReminder(...), handle.project, await handle.close()</span></span></code></pre></div><p>Host settings match the documented <a href="./cli.html">CLI</a> <code>serve</code> flags. <code>serve()</code> also accepts <code>discovery</code> (project-loading options) and <code>mode: &quot;single&quot; | &quot;multi&quot;</code>. The Cursor credential resolves in one order everywhere: explicit <code>apiKey</code>, then <code>CURSOR_API_KEY</code>, then the key stored by <code>agent-sdk login</code>.</p><h2 id="what-s-next" tabindex="-1">What&#39;s next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to &quot;What&#39;s next&quot;">​</a></h2><p>Continue with these pages:</p><ul><li><a href="./instructions.html">Instructions</a>: the required half of a minimal agent</li><li><a href="./../guides/cloud-runtime.html">Cloud runtime</a>: when and how to leave the host</li><li><a href="./cli.html">CLI</a>: the <code>serve</code> flags <code>serve()</code> accepts</li></ul>`,50)])])}const u=e(n,[["render",o]]);export{k as __pageData,u as default};
40
+ <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// handle.createReminder(...), handle.project, await handle.close()</span></span></code></pre></div><p>Host settings match the documented <a href="./cli.html">CLI</a> <code>serve</code> flags. <code>serve()</code> also accepts <code>discovery</code> (project-loading options) and <code>mode: &quot;single&quot; | &quot;multi&quot;</code>. The Cursor credential resolves in one order everywhere: explicit <code>apiKey</code>, then <code>CURSOR_API_KEY</code>, then the key stored by <code>agent-sdk login</code>.</p><h2 id="what-s-next" tabindex="-1">What&#39;s next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to &quot;What&#39;s next&quot;">​</a></h2><p>Continue with these pages:</p><ul><li><a href="./instructions.html">Instructions</a>: the required half of a minimal agent</li><li><a href="./cli.html">CLI</a>: the <code>serve</code> flags <code>serve()</code> accepts</li></ul>`,50)])])}const u=e(n,[["render",o]]);export{k as __pageData,u as default};
@@ -1,4 +1,4 @@
1
- import{_ as e,c as i,o as a,ag as t}from"./chunks/framework.BCISBCiQ.js";const k=JSON.parse('{"title":"Channels","description":"The authoring reference for defineChannel, the built-in HTTP channel, route schemas, handler args, and the auth policies.","frontmatter":{"title":"Channels","description":"The authoring reference for defineChannel, the built-in HTTP channel, route schemas, handler args, and the auth policies."},"headers":[],"relativePath":"reference/channels.md","filePath":"reference/channels.md"}'),n={name:"reference/channels.md"};function h(o,s,l,d,r,p){return a(),i("div",null,[...s[0]||(s[0]=[t(`<h1 id="channels" tabindex="-1">Channels <a class="header-anchor" href="#channels" aria-label="Permalink to &quot;Channels&quot;">​</a></h1><p>A channel is the surface an agent lives on. The built-in HTTP session channel is always mounted. Custom channels declare their own routes under <code>/v1/channels/&lt;id&gt;</code>. The Slack and GitHub packs are prebuilt channels with platform transports. This page is the authoring reference; for the walkthrough, see the <a href="./../guides/webhooks.html">Webhooks guide</a>.</p><h2 id="built-in-http-channel" tabindex="-1">Built-in HTTP channel <a class="header-anchor" href="#built-in-http-channel" aria-label="Permalink to &quot;Built-in HTTP channel&quot;">​</a></h2><p>It&#39;s always mounted, under <code>/&lt;slug&gt;</code> in the default multi-agent layout: session create, follow-up, stream, stop, the sessions list, approvals, deterministic tool calls, health, and info. For the route-by-route contract, see the <a href="./http-api.html">HTTP API reference</a>.</p><p>Author <code>agent/channels/http.ts</code> only to override its defaults:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
1
+ import{_ as e,c as a,o as i,ag as t}from"./chunks/framework.BCISBCiQ.js";const k=JSON.parse('{"title":"Channels","description":"The authoring reference for defineChannel, the built-in HTTP channel, route schemas, handler args, and the auth policies.","frontmatter":{"title":"Channels","description":"The authoring reference for defineChannel, the built-in HTTP channel, route schemas, handler args, and the auth policies."},"headers":[],"relativePath":"reference/channels.md","filePath":"reference/channels.md"}'),n={name:"reference/channels.md"};function h(o,s,l,d,r,p){return i(),a("div",null,[...s[0]||(s[0]=[t(`<h1 id="channels" tabindex="-1">Channels <a class="header-anchor" href="#channels" aria-label="Permalink to &quot;Channels&quot;">​</a></h1><p>A channel is the surface an agent lives on. The built-in HTTP session channel is always mounted. Custom channels declare their own routes under <code>/v1/channels/&lt;id&gt;</code>. The Slack and GitHub packs are prebuilt channels with platform transports. This page is the authoring reference; for the walkthrough, see the <a href="./../guides/webhooks.html">Webhooks guide</a>.</p><h2 id="built-in-http-channel" tabindex="-1">Built-in HTTP channel <a class="header-anchor" href="#built-in-http-channel" aria-label="Permalink to &quot;Built-in HTTP channel&quot;">​</a></h2><p>It&#39;s always mounted, under <code>/&lt;slug&gt;</code> in the default multi-agent layout: session create, follow-up, stream, stop, the sessions list, approvals, deterministic tool calls, health, and info. For the route-by-route contract, see the <a href="./http-api.html">HTTP API reference</a>.</p><p>Author <code>agent/channels/http.ts</code> only to override its defaults:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
2
2
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> bearerAuth,</span></span>
3
3
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> httpChannel,</span></span>
4
4
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> localDevStrict,</span></span>
@@ -50,4 +50,4 @@ import{_ as e,c as i,o as a,ag as t}from"./chunks/framework.BCISBCiQ.js";const k
50
50
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
51
51
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
52
52
  <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // auth: [...], state: {...}, onStart(...), onStop(...)</span></span>
53
- <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>This example assumes <code>agent/tools/inspect_pr.ts</code> exists. The handler calls it before the model turn, so every review starts with validated PR data. It also derives a stable conversation key from the PR URL and writes the tool result to <code>pr.json</code>. Instructions can ask the model to inspect a PR, but host code guarantees it.</p><h2 id="route-verbs-and-schemas" tabindex="-1">Route verbs and schemas <a class="header-anchor" href="#route-verbs-and-schemas" aria-label="Permalink to &quot;Route verbs and schemas&quot;">​</a></h2><p><code>GET</code>, <code>POST</code>, <code>PUT</code>, <code>PATCH</code>, and <code>DELETE</code> helpers build routes. Their schemas are Zod, enforced at compile time:</p><table tabindex="0"><thead><tr><th>Verb</th><th>Required schema</th></tr></thead><tbody><tr><td><code>GET</code></td><td><code>querySchema</code></td></tr><tr><td><code>POST</code> / <code>PUT</code> / <code>PATCH</code></td><td><code>bodySchema</code> (optional <code>querySchema</code>)</td></tr><tr><td><code>DELETE</code></td><td>both optional</td></tr></tbody></table><p>Plain JSON Schema objects won&#39;t type-check; use <code>z.object({})</code> or <code>z.unknown()</code> for intentionally open surfaces. The host validates before the handler runs. Handlers receive typed <code>args.body</code> and <code>args.query</code>, and empty POST bodies are coerced to <code>{}</code> first. Declared schemas are projected on <code>GET /v1/info</code>, which powers the playground&#39;s <strong>Try</strong> buttons and composer <strong>slash commands</strong>.</p><h2 id="handler-arguments" tabindex="-1">Handler arguments <a class="header-anchor" href="#handler-arguments" aria-label="Permalink to &quot;Handler arguments&quot;">​</a></h2><p>Handlers receive the Fetch <code>Request</code> and an args object:</p><table tabindex="0"><thead><tr><th>Member</th><th>What it is</th></tr></thead><tbody><tr><td><code>send(message, options?)</code></td><td>Run a model turn on this channel; returns the session handle (options below)</td></tr><tr><td><code>getSession(sessionId)</code></td><td>Look up an existing session on this channel</td></tr><tr><td><code>receive(channelDefinition, input)</code></td><td>Hand off to another channel (schedules use this)</td></tr><tr><td><code>callTool(name, input, options?)</code></td><td>Deterministic server-tool call (<a href="./tools.html#call-a-tool-without-a-model-turn">Tools</a>)</td></tr><tr><td><code>body</code>, <code>query</code>, <code>params</code></td><td>Validated payloads and <code>:param</code> path segments</td></tr><tr><td><code>auth</code></td><td>The <code>AuthContext</code> resolved by this route&#39;s auth chain</td></tr><tr><td><code>requestIp</code></td><td>The TCP peer address</td></tr><tr><td><code>host</code></td><td>Shared services: <code>host.mcp</code>, <code>host.github</code>, <code>host.slack</code>, <code>host.kv</code>, <code>host.files</code>, <code>host.reminders</code></td></tr><tr><td><code>waitUntil(promise)</code></td><td>Background work that outlives the response</td></tr><tr><td><code>sessionUrls(request, sessionId)</code></td><td>Absolute playground + trace URLs for a session on this mount</td></tr><tr><td><code>artifacts</code></td><td>Unbound <a href="./artifacts.html">artifacts</a> facade; pass <code>sessionId</code> in <code>tag</code> input to attribute one</td></tr></tbody></table><p><code>send</code> options: <code>continuationToken</code> (the conversation key), <code>admission</code> (<code>&quot;preempt&quot;</code> interrupts a busy session, the default; <code>&quot;coalesce&quot;</code> enqueues behind the running turn, the <a href="./sessions.html#what-happens-when-i-send-a-follow-up">Slack policy</a>), <code>workspaceFiles</code>, <code>workspaceDir</code>, <code>cloud</code> (attach cloud repos for this session), <code>auth</code> (defaults to the request principal), <code>state</code> (starting channel state for new sessions), <code>title</code> (session display title), and <code>purpose</code> (<code>&quot;eval&quot;</code> skips sticky A/B enrollment).</p><h2 id="events" tabindex="-1">Events <a class="header-anchor" href="#events" aria-label="Permalink to &quot;Events&quot;">​</a></h2><p>The <code>events</code> map subscribes the channel to stream events for the sessions it owns. Keys are event types from the <a href="./sessions.html#which-events-can-i-stream">event vocabulary</a>, or <code>&quot;*&quot;</code>. Handlers receive <code>(event, channel, ctx)</code>, where <code>channel.state</code> is the per-session adapter state and <code>ctx</code> exposes session info and host services. This is where a channel delivers replies back to its surface.</p><h2 id="state-and-lifecycle" tabindex="-1">State and lifecycle <a class="header-anchor" href="#state-and-lifecycle" aria-label="Permalink to &quot;State and lifecycle&quot;">​</a></h2><p><code>state</code> declares the starting per-session adapter state (JSON), persisted on the session record. Routes and event handlers read and mutate it through <code>channel.state</code>. <code>onStart(args)</code> runs when the channel mounts. <code>onStop()</code> runs when the server stops.</p><p><code>onStart</code> receives the route helpers (<code>send</code>, <code>getSession</code>, <code>receive</code>, <code>callTool</code>, <code>host</code>, <code>waitUntil</code>, <code>artifacts</code>, <code>logger</code>) plus helpers for long-lived transports:</p><ul><li><code>emitAssistantMessage(sessionId, text)</code> appends an assistant message without a model turn, for host tasks that already produced the final text.</li><li><code>hasContinuationSession(token)</code> and <code>isContinuationBusy(token)</code> report whether a continuation token has a live session and whether a turn is in flight on it.</li><li><code>interruptContinuation(token)</code> stops the in-flight turn and clears coalesced follow-ups queued behind it.</li><li><code>resolveApproval(sessionId, callId, decision, auth, options?)</code> approves or denies a parked tool call, how Slack Block Kit buttons unblock a turn without the HTTP approvals route.</li></ul><h2 id="auth-policies" tabindex="-1">Auth policies <a class="header-anchor" href="#auth-policies" aria-label="Permalink to &quot;Auth policies&quot;">​</a></h2><p>Every route runs an auth-policy chain: the channel&#39;s <code>auth</code> array, or <code>[localDevStrict()]</code> when unset. A policy is a function <code>(request, info) =&gt; AuthContext | null</code> (async allowed); the first non-null wins, and a request no policy admits gets <code>401</code>.</p><table tabindex="0"><thead><tr><th>Policy</th><th>Admits</th></tr></thead><tbody><tr><td><code>localDevStrict()</code></td><td>Direct loopback callers with no proxy-forwarding headers (<code>X-Forwarded-For</code>, <code>X-Real-IP</code>, <code>Forwarded</code>, and <code>X-Forwarded-Host</code> are all rejected, so tunnels and same-host reverse proxies don&#39;t silently re-expose the route), plus a loopback <code>Host</code> header, which rejects DNS-rebinding callers that reach 127.0.0.1 with a remote hostname.</td></tr><tr><td><code>localDev()</code></td><td>Like <code>localDevStrict()</code> but without the <code>Host</code> check. An explicit, weaker opt-in.</td></tr><tr><td><code>loopbackOnly()</code></td><td>A loopback TCP peer, ignoring forwarding headers; for dev relays that legitimately carry them, like <code>gh webhook forward</code>.</td></tr><tr><td><code>bearerAuth(token)</code></td><td><code>Authorization: Bearer &lt;token&gt;</code>, compared in constant time. Also accepts a verifier function mapping a presented token to an <code>AuthContext</code>.</td></tr><tr><td><code>allowAll()</code></td><td>Everyone, as an <code>anonymous</code> principal. Only for surfaces protected upstream (an HMAC-verified webhook) or intentionally public.</td></tr><tr><td><code>publicEndpoint()</code></td><td>Everyone on this custom channel. Managed hosting also serves the channel without an alias token. Use it only when the handler verifies the provider signature.</td></tr></tbody></table><p><code>publicEndpoint()</code> applies only to custom channel routes. It does not open the built-in session or tool API.</p><p>The resolved <code>AuthContext</code> (<code>{ authenticator, principalId, principalType, attributes? }</code>) becomes the request principal. Sessions bind to the principal that created them, and follow-up, stream, and list routes enforce ownership (<code>403</code> otherwise).</p><p>Server flags interact with authored auth: <code>--bearer-token</code> swaps the default <code>localDevStrict()</code> for <code>bearerAuth(...)</code> on channels that don&#39;t author their own chain, and <code>--allow-anonymous</code> swaps it for <code>allowAll()</code>. Authored <code>auth</code> arrays always win over both. A channel that declares <code>[localDevStrict()]</code> stays loopback-only even on an <code>--allow-anonymous</code> host.</p><h2 id="first-class-channels" tabindex="-1">First class channels <a class="header-anchor" href="#first-class-channels" aria-label="Permalink to &quot;First class channels&quot;">​</a></h2><p><strong>Slack</strong> (<code>@cursor/july/channels/slack</code>): Socket Mode transport, streaming replies, engagement rules, approval cards, and a default block on Slack Connect / guest / other-workspace senders. Author <code>agent/channels/slack.ts</code> with <code>slackChannel()</code>. Guide: <a href="./../guides/slack.html">Slack</a>.</p><p><strong>GitHub</strong> (<code>@cursor/july/channels/github</code>): webhook dispatch with signature verification, per-event hooks returning <code>{ auth }</code> (a model turn), <code>{ task }</code> (host work), or <code>null</code>, and CLI tooling for replay and live forwarding. Author <code>agent/channels/github.ts</code> with <code>githubChannel()</code>. Opt-in <code>progress.commitStatus</code> and <code>progress.banner</code> converge a merge-box check and sticky PR comment from default stream events. Guide: <a href="./../guides/github.html">GitHub</a>.</p><p><strong>Deployments</strong> (<code>@cursor/july/channels/deployments</code>): pull deploy events. Subscribe per deploy source with <code>deploySourceUris</code>, narrow with <code>environments</code> / <code>events</code>, and handle each event in <code>onEvent</code>. <code>deploySourceUris</code> must match <code>Deployment.deploy_source_uri</code> as your deployment writer records it; matching is case-insensitive but otherwise literal. Each event carries <code>deploySourceUri</code> and <code>deployVersion</code>. Author <code>agent/channels/deployments.ts</code> with <code>deploymentsChannel()</code>. It uses the host credential. A restart resumes rather than dropping events. An empty <code>deploySourceUris</code> list mounts the channel but starts no pull, so an env-configured agent stays inert until its deploy sources are set.</p><p>For other platforms like Discord or Teams, use the authored <code>defineChannel</code> webhook form.</p><h2 id="continuation-semantics" tabindex="-1">Continuation semantics <a class="header-anchor" href="#continuation-semantics" aria-label="Permalink to &quot;Continuation semantics&quot;">​</a></h2><p>Channels own their continuation-token format. The built-in HTTP channel mints opaque rotating tokens, Slack uses <code>channelId:threadTs</code>, and PR automations use keys like <code>pr:owner/repo#N</code>. Same token, same durable session; one active continuation per session; the HTTP channel returns <code>409</code> for stale tokens. For the full session model, see <a href="./sessions.html">Sessions</a>.</p><h2 id="what-s-next" tabindex="-1">What&#39;s next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to &quot;What&#39;s next&quot;">​</a></h2><p>Continue with these pages:</p><ul><li><a href="./../guides/webhooks.html">Webhooks guide</a>: the same API, walked through</li><li><a href="./http-api.html">HTTP API</a>: session, discovery, and channel routes</li><li><a href="./sessions.html">Sessions and streaming</a>: the events channels subscribe to</li></ul>`,40)])])}const E=e(n,[["render",h]]);export{k as __pageData,E as default};
53
+ <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>This example assumes <code>agent/tools/inspect_pr.ts</code> exists. The handler calls it before the model turn, so every review starts with validated PR data. It also derives a stable conversation key from the PR URL and writes the tool result to <code>pr.json</code>. Instructions can ask the model to inspect a PR, but host code guarantees it.</p><h2 id="route-verbs-and-schemas" tabindex="-1">Route verbs and schemas <a class="header-anchor" href="#route-verbs-and-schemas" aria-label="Permalink to &quot;Route verbs and schemas&quot;">​</a></h2><p><code>GET</code>, <code>POST</code>, <code>PUT</code>, <code>PATCH</code>, and <code>DELETE</code> helpers build routes. Their schemas are Zod, enforced at compile time:</p><table tabindex="0"><thead><tr><th>Verb</th><th>Required schema</th></tr></thead><tbody><tr><td><code>GET</code></td><td><code>querySchema</code></td></tr><tr><td><code>POST</code> / <code>PUT</code> / <code>PATCH</code></td><td><code>bodySchema</code> (optional <code>querySchema</code>)</td></tr><tr><td><code>DELETE</code></td><td>both optional</td></tr></tbody></table><p>Plain JSON Schema objects won&#39;t type-check; use <code>z.object({})</code> or <code>z.unknown()</code> for intentionally open surfaces. The host validates before the handler runs. Handlers receive typed <code>args.body</code> and <code>args.query</code>, and empty POST bodies are coerced to <code>{}</code> first. Declared schemas are projected on <code>GET /v1/info</code>, which powers the playground&#39;s <strong>Try</strong> buttons and composer <strong>slash commands</strong>.</p><h2 id="handler-arguments" tabindex="-1">Handler arguments <a class="header-anchor" href="#handler-arguments" aria-label="Permalink to &quot;Handler arguments&quot;">​</a></h2><p>Handlers receive the Fetch <code>Request</code> and an args object:</p><table tabindex="0"><thead><tr><th>Member</th><th>What it is</th></tr></thead><tbody><tr><td><code>send(message, options?)</code></td><td>Run a model turn on this channel; returns the session handle (options below)</td></tr><tr><td><code>getSession(sessionId)</code></td><td>Look up an existing session on this channel</td></tr><tr><td><code>receive(channelDefinition, input)</code></td><td>Hand off to another channel (schedules use this)</td></tr><tr><td><code>callTool(name, input, options?)</code></td><td>Deterministic server-tool call (<a href="./tools.html#call-a-tool-without-a-model-turn">Tools</a>)</td></tr><tr><td><code>body</code>, <code>query</code>, <code>params</code></td><td>Validated payloads and <code>:param</code> path segments</td></tr><tr><td><code>auth</code></td><td>The <code>AuthContext</code> resolved by this route&#39;s auth chain</td></tr><tr><td><code>requestIp</code></td><td>The TCP peer address</td></tr><tr><td><code>host</code></td><td>Shared services: <code>host.mcp</code>, <code>host.github</code>, <code>host.slack</code>, <code>host.kv</code>, <code>host.files</code>, <code>host.reminders</code></td></tr><tr><td><code>waitUntil(promise)</code></td><td>Background work that outlives the response</td></tr><tr><td><code>sessionUrls(request, sessionId)</code></td><td>Absolute playground + trace URLs for a session on this mount</td></tr><tr><td><code>artifacts</code></td><td>Unbound <a href="./artifacts.html">artifacts</a> facade; pass <code>sessionId</code> in <code>tag</code> input to attribute one</td></tr></tbody></table><p><code>send</code> options: <code>continuationToken</code> (the conversation key), <code>admission</code> (<code>&quot;preempt&quot;</code> interrupts a busy session, the default; <code>&quot;coalesce&quot;</code> enqueues behind the running turn, the <a href="./sessions.html#what-happens-when-i-send-a-follow-up">Slack policy</a>), <code>workspaceFiles</code>, <code>workspaceDir</code>, <code>cloud</code> (attach cloud repos for this session), <code>auth</code> (defaults to the request principal), <code>state</code> (starting channel state for new sessions), <code>title</code> (session display title), and <code>purpose</code> (<code>&quot;eval&quot;</code> skips sticky A/B enrollment).</p><h2 id="events" tabindex="-1">Events <a class="header-anchor" href="#events" aria-label="Permalink to &quot;Events&quot;">​</a></h2><p>The <code>events</code> map subscribes the channel to stream events for the sessions it owns. Keys are event types from the <a href="./sessions.html#which-events-can-i-stream">event vocabulary</a>, or <code>&quot;*&quot;</code>. Handlers receive <code>(event, channel, ctx)</code>, where <code>channel.state</code> is the per-session adapter state, <code>ctx.session</code> is the session info, and <code>ctx.host</code> is the shared host services, bound to that session as in a <a href="./hooks.html#handler-context">hook</a>. This is where a channel delivers replies back to its surface.</p><h2 id="state-and-lifecycle" tabindex="-1">State and lifecycle <a class="header-anchor" href="#state-and-lifecycle" aria-label="Permalink to &quot;State and lifecycle&quot;">​</a></h2><p><code>state</code> declares the starting per-session adapter state (JSON), persisted on the session record. Routes and event handlers read and mutate it through <code>channel.state</code>. <code>onStart(args)</code> runs when the channel mounts. <code>onStop()</code> runs when the server stops.</p><p><code>onStart</code> receives the route helpers (<code>send</code>, <code>getSession</code>, <code>receive</code>, <code>callTool</code>, <code>host</code>, <code>waitUntil</code>, <code>artifacts</code>, <code>logger</code>) plus helpers for long-lived transports:</p><ul><li><code>emitAssistantMessage(sessionId, text)</code> appends an assistant message without a model turn, for host tasks that already produced the final text.</li><li><code>hasContinuationSession(token)</code> and <code>isContinuationBusy(token)</code> report whether a continuation token has a live session and whether a turn is in flight on it.</li><li><code>interruptContinuation(token)</code> stops the in-flight turn and clears coalesced follow-ups queued behind it.</li><li><code>resolveApproval(sessionId, callId, decision, auth, options?)</code> approves or denies a parked tool call, how Slack Block Kit buttons unblock a turn without the HTTP approvals route.</li></ul><h2 id="auth-policies" tabindex="-1">Auth policies <a class="header-anchor" href="#auth-policies" aria-label="Permalink to &quot;Auth policies&quot;">​</a></h2><p>Every route runs an auth-policy chain: the channel&#39;s <code>auth</code> array, or <code>[localDevStrict()]</code> when unset. A policy is a function <code>(request, info) =&gt; AuthContext | null</code> (async allowed); the first non-null wins, and a request no policy admits gets <code>401</code>.</p><table tabindex="0"><thead><tr><th>Policy</th><th>Admits</th></tr></thead><tbody><tr><td><code>localDevStrict()</code></td><td>Direct loopback callers with no proxy-forwarding headers (<code>X-Forwarded-For</code>, <code>X-Real-IP</code>, <code>Forwarded</code>, and <code>X-Forwarded-Host</code> are all rejected, so tunnels and same-host reverse proxies don&#39;t silently re-expose the route), plus a loopback <code>Host</code> header, which rejects DNS-rebinding callers that reach 127.0.0.1 with a remote hostname.</td></tr><tr><td><code>localDev()</code></td><td>Like <code>localDevStrict()</code> but without the <code>Host</code> check. An explicit, weaker opt-in.</td></tr><tr><td><code>loopbackOnly()</code></td><td>A loopback TCP peer, ignoring forwarding headers; for dev relays that legitimately carry them, like <code>gh webhook forward</code>.</td></tr><tr><td><code>bearerAuth(token)</code></td><td><code>Authorization: Bearer &lt;token&gt;</code>, compared in constant time. Also accepts a verifier function mapping a presented token to an <code>AuthContext</code>.</td></tr><tr><td><code>allowAll()</code></td><td>Everyone, as an <code>anonymous</code> principal. Only for surfaces protected upstream (an HMAC-verified webhook) or intentionally public.</td></tr><tr><td><code>publicEndpoint()</code></td><td>Everyone on this custom channel. Managed hosting also serves the channel without an alias token. Use it only when the handler verifies the provider signature.</td></tr></tbody></table><p><code>publicEndpoint()</code> applies only to custom channel routes. It does not open the built-in session or tool API.</p><p>The resolved <code>AuthContext</code> (<code>{ authenticator, principalId, principalType, attributes? }</code>) becomes the request principal. Sessions bind to the principal that created them, and follow-up, stream, and list routes enforce ownership (<code>403</code> otherwise).</p><p>Server flags interact with authored auth: <code>--bearer-token</code> swaps the default <code>localDevStrict()</code> for <code>bearerAuth(...)</code> on channels that don&#39;t author their own chain, and <code>--allow-anonymous</code> swaps it for <code>allowAll()</code>. Authored <code>auth</code> arrays always win over both. A channel that declares <code>[localDevStrict()]</code> stays loopback-only even on an <code>--allow-anonymous</code> host.</p><h2 id="first-class-channels" tabindex="-1">First class channels <a class="header-anchor" href="#first-class-channels" aria-label="Permalink to &quot;First class channels&quot;">​</a></h2><p><strong>Slack</strong> (<code>@cursor/july/channels/slack</code>): Socket Mode transport, streaming replies, engagement rules, approval cards, and a default block on Slack Connect / guest / other-workspace senders. Author <code>agent/channels/slack.ts</code> with <code>slackChannel()</code>. Guide: <a href="./../guides/slack.html">Slack</a>.</p><p><strong>GitHub</strong> (<code>@cursor/july/channels/github</code>): webhook dispatch with signature verification, per-event hooks returning <code>{ auth }</code> (a model turn), <code>{ task }</code> (host work), or <code>null</code>, and CLI tooling for replay and live forwarding. Author <code>agent/channels/github.ts</code> with <code>githubChannel()</code>. Opt-in <code>progress.commitStatus</code> and <code>progress.banner</code> converge a merge-box check and sticky PR comment from default stream events. Guide: <a href="./../guides/github.html">GitHub</a>.</p><p><strong>Deployments</strong> (<code>@cursor/july/channels/deployments</code>): pull deploy events. Declare <code>events</code> and handle each one in <code>onEvent</code>. Each event carries <code>deploySourceUri</code> and <code>deployVersion</code>. Author <code>agent/channels/deployments.ts</code> with <code>deploymentsChannel()</code>.</p><p>Omit <code>deploySourceUris</code> on hosted v2. The control plane binds <code>deploy_source</code> edges from the deploy&#39;s watched <code>repositories</code> and the channel admits what it is sent, which is what makes it multi-tenant safe.</p><p>Name sources to narrow below that scope, or to drive the self-hosted pull relay, which has no deploy scope to inherit. There, subscribe per deploy source with <code>deploySourceUris</code> and narrow with <code>environments</code> / <code>events</code>. Each entry must match <code>Deployment.deploy_source_uri</code> as your deployment writer records it; matching is case-insensitive but otherwise literal. It uses the host credential. A restart resumes rather than dropping events. An empty <code>deploySourceUris</code> list mounts the channel but starts no pull, so an env-configured agent stays inert until its deploy sources are set.</p><p>For other platforms like Discord or Teams, use the authored <code>defineChannel</code> webhook form.</p><h2 id="continuation-semantics" tabindex="-1">Continuation semantics <a class="header-anchor" href="#continuation-semantics" aria-label="Permalink to &quot;Continuation semantics&quot;">​</a></h2><p>Channels own their continuation-token format. The built-in HTTP channel mints opaque rotating tokens, Slack uses <code>channelId:threadTs</code>, and PR automations use keys like <code>pr:owner/repo#N</code>. Same token, same durable session; one active continuation per session; the HTTP channel returns <code>409</code> for stale tokens. For the full session model, see <a href="./sessions.html">Sessions</a>.</p><h2 id="what-s-next" tabindex="-1">What&#39;s next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to &quot;What&#39;s next&quot;">​</a></h2><p>Continue with these pages:</p><ul><li><a href="./../guides/webhooks.html">Webhooks guide</a>: the same API, walked through</li><li><a href="./http-api.html">HTTP API</a>: session, discovery, and channel routes</li><li><a href="./sessions.html">Sessions and streaming</a>: the events channels subscribe to</li></ul>`,42)])])}const E=e(n,[["render",h]]);export{k as __pageData,E as default};
@@ -1 +1 @@
1
- import{_ as e,c as i,o as a,ag as t}from"./chunks/framework.BCISBCiQ.js";const k=JSON.parse('{"title":"Channels","description":"The authoring reference for defineChannel, the built-in HTTP channel, route schemas, handler args, and the auth policies.","frontmatter":{"title":"Channels","description":"The authoring reference for defineChannel, the built-in HTTP channel, route schemas, handler args, and the auth policies."},"headers":[],"relativePath":"reference/channels.md","filePath":"reference/channels.md"}'),n={name:"reference/channels.md"};function h(o,s,l,d,r,p){return a(),i("div",null,[...s[0]||(s[0]=[t("",40)])])}const E=e(n,[["render",h]]);export{k as __pageData,E as default};
1
+ import{_ as e,c as a,o as i,ag as t}from"./chunks/framework.BCISBCiQ.js";const k=JSON.parse('{"title":"Channels","description":"The authoring reference for defineChannel, the built-in HTTP channel, route schemas, handler args, and the auth policies.","frontmatter":{"title":"Channels","description":"The authoring reference for defineChannel, the built-in HTTP channel, route schemas, handler args, and the auth policies."},"headers":[],"relativePath":"reference/channels.md","filePath":"reference/channels.md"}'),n={name:"reference/channels.md"};function h(o,s,l,d,r,p){return i(),a("div",null,[...s[0]||(s[0]=[t("",42)])])}const E=e(n,[["render",h]]);export{k as __pageData,E as default};
@@ -1,4 +1,4 @@
1
- import{_ as i,c as e,o as a,ag as t}from"./chunks/framework.BCISBCiQ.js";const c=JSON.parse('{"title":"CLI","description":"Commands and common flags for local development, running servers, and Cursor-managed hosting.","frontmatter":{"title":"CLI","description":"Commands and common flags for local development, running servers, and Cursor-managed hosting."},"headers":[],"relativePath":"reference/cli.md","filePath":"reference/cli.md"}'),n={name:"reference/cli.md"};function h(l,s,d,o,p,k){return a(),e("div",null,[...s[0]||(s[0]=[t(`<h1 id="cli-reference" tabindex="-1">CLI reference <a class="header-anchor" href="#cli-reference" aria-label="Permalink to &quot;CLI reference&quot;">​</a></h1><p><code>@cursor/july</code> installs <code>july</code> (so <code>npx @cursor/july docs</code> works) and <code>agent-sdk</code>. The examples on this page use <code>agent-sdk</code>. Run the CLI with Node 22.13 or newer. Don&#39;t run it with Bun; Bun corrupts tool-result streams from the Cursor SDK.</p><p><code>agent-sdk help</code> prints the built-in summary. The Slack and GitHub packs also provide <code>agent-sdk slack help</code> and <code>agent-sdk github help</code>.</p><table tabindex="0"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><a href="#serve"><code>serve</code></a></td><td>Serve agents over HTTP</td></tr><tr><td><a href="#dev"><code>dev</code></a></td><td>Start local development with <code>serve --dev</code></td></tr><tr><td><a href="#chat"><code>chat</code></a></td><td>Talk to a running agent</td></tr><tr><td><a href="#resume"><code>resume</code></a></td><td>Reattach chat to a previous session</td></tr><tr><td><a href="#logs"><code>logs</code></a></td><td>Follow local or hosted logs</td></tr><tr><td><a href="#sessions"><code>sessions</code></a></td><td>List sessions on a running agent</td></tr><tr><td><a href="#session"><code>session</code></a></td><td>Inspect one session</td></tr><tr><td><a href="#cost"><code>cost</code></a></td><td>Report per-session token usage and estimated cost</td></tr><tr><td><a href="#playground"><code>playground</code></a></td><td>Open the local or hosted playground</td></tr><tr><td><a href="#docs"><code>docs</code></a></td><td>Serve the shipped documentation site locally</td></tr><tr><td><a href="#run"><code>run</code></a></td><td>Run one or more turns locally, remotely, or on a hosted agent</td></tr><tr><td><a href="#call"><code>call</code></a></td><td>Call a server tool without a model turn</td></tr><tr><td><a href="#eval"><code>eval</code></a></td><td>Run filesystem evals</td></tr><tr><td><a href="#trajectory"><code>trajectory</code></a></td><td>Summarize a saved event stream</td></tr><tr><td><a href="#init"><code>init</code></a></td><td>Scaffold a project, or print the setup guide</td></tr><tr><td><a href="#convert-automation"><code>convert-automation</code></a></td><td>Export a Cursor Automation into an agent project</td></tr><tr><td><a href="#install-skills"><code>install-skills</code></a></td><td>Refresh coding-agent skills (<code>npm install</code> already copies them)</td></tr><tr><td><a href="#info"><code>info</code></a></td><td>Print the discovered agent surface</td></tr><tr><td><a href="#validate"><code>validate</code></a></td><td>Check a project and fail on errors</td></tr><tr><td><a href="#login-logout-whoami"><code>login</code> / <code>logout</code> / <code>whoami</code></a></td><td>Manage the host&#39;s Cursor credential</td></tr><tr><td><code>version</code></td><td>Print the installed version and exit (also <code>--version</code> / <code>-V</code>)</td></tr><tr><td><a href="#update"><code>update</code></a></td><td>Upgrade the installed CLI</td></tr><tr><td><a href="#deploy"><code>deploy</code></a></td><td>Deploy one or more agents to Cursor managed hosting</td></tr><tr><td><a href="#deployments"><code>deployments</code></a></td><td>List hosted deployments</td></tr><tr><td><a href="#deployment"><code>deployment</code></a></td><td>Inspect one hosted deployment</td></tr><tr><td><a href="#stop"><code>stop</code></a></td><td>Stop a hosted deployment</td></tr><tr><td><a href="#delete"><code>delete</code></a></td><td>Delete a hosted deployment</td></tr><tr><td><a href="#rotate-token"><code>rotate-token</code></a></td><td>Replace a deployment&#39;s alias token</td></tr><tr><td><a href="#rotate-pod-credential"><code>rotate-pod-credential</code></a></td><td>Replace a deployment&#39;s pod credential</td></tr><tr><td><a href="#secrets"><code>secrets</code></a></td><td>Manage deployment secrets</td></tr><tr><td><a href="#mcp"><code>mcp</code></a></td><td>Proxy the agent&#39;s MCP endpoint over stdio; <code>mcp install</code> writes <code>~/.cursor/mcp.json</code></td></tr><tr><td><a href="#mcp-oauth"><code>mcp oauth</code></a></td><td>Authorize host MCP OAuth; optional <code>--store</code> to deployment secrets</td></tr><tr><td><a href="#slack"><code>slack ...</code></a></td><td>Provision, set up, and check Slack channels</td></tr><tr><td><a href="#github"><code>github ...</code></a></td><td>Forward, replay, and inspect GitHub webhook channels</td></tr></tbody></table><h2 id="choose-a-target" tabindex="-1">Choose a target <a class="header-anchor" href="#choose-a-target" aria-label="Permalink to &quot;Choose a target&quot;">​</a></h2><p>Request-sending commands support three target types.</p><table tabindex="0"><thead><tr><th>Target</th><th>How to select it</th><th>Commands</th></tr></thead><tbody><tr><td>Ephemeral local server</td><td>Omit <code>--url</code> and <code>--prod</code></td><td><code>run</code>, <code>call</code>, <code>eval</code></td></tr><tr><td>Running server</td><td>Pass <code>--url &lt;baseUrl&gt;</code>, unless the command uses the localhost default described next</td><td><code>chat</code>, <code>resume</code>, <code>logs</code>, <code>sessions</code>, <code>session</code>, <code>cost</code>, <code>playground</code>, <code>run</code>, <code>call</code>, <code>eval</code>, <code>mcp</code></td></tr><tr><td>Cursor managed hosting</td><td>Pass <code>--prod</code></td><td><code>chat</code>, <code>resume</code>, <code>logs</code>, <code>sessions</code>, <code>session</code>, <code>cost</code>, <code>playground</code>, <code>run</code>, <code>call</code>, <code>eval</code>, <code>mcp</code></td></tr></tbody></table><p><code>chat</code>, <code>logs</code>, <code>sessions</code>, <code>session</code>, <code>cost</code>, and <code>playground</code> default to <code>http://127.0.0.1:3000</code>. A <code>--url</code> must include the agent slug for a multi-agent server, such as <code>http://127.0.0.1:3000/pr-approver</code>. <code>--slug</code> doesn&#39;t change an explicit URL. <code>mcp</code> has no default target; pass <code>--url</code> or <code>--prod</code>.</p><p>With <code>--prod</code>, <code>--slug</code> selects the deployment and <code>--team</code> selects the Cursor team. The slug defaults to the <code>--dir</code> basename. The team defaults to the signed-in account&#39;s team. <code>--url</code> and <code>--prod</code> are mutually exclusive.</p><p>Use <code>--bearer-token &lt;token&gt;</code> when a running server requires bearer authentication. Hosted commands use your Cursor credential to request short-lived engine access. <code>--api-key</code> overrides the Cursor credential for <code>login</code>, <code>serve</code>, hosted targets, and managed-hosting commands. <code>--state-root</code> applies to <code>serve</code> and ephemeral <code>run</code>, <code>call</code>, and <code>eval</code> servers. Running and hosted targets ignore it.</p><p>For ephemeral <code>run</code>, <code>call</code>, and <code>eval</code> commands, omitting <code>--slug</code> selects an unslugged root mount when one exists. Otherwise, the Agent SDK selects the first discovered agent.</p><h2 id="serve" tabindex="-1">serve <a class="header-anchor" href="#serve" aria-label="Permalink to &quot;serve&quot;">​</a></h2><p><code>serve</code> hosts every agent under <code>--dir</code> in multi-agent mode by default.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> serve</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [--dir </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">pat</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">h</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">]</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [--port </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">3000]</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [--host </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">127.0.0.1]</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [--dev]</span></span>
1
+ import{_ as i,c as e,o as a,ag as t}from"./chunks/framework.BCISBCiQ.js";const c=JSON.parse('{"title":"CLI","description":"Commands and common flags for local development, running servers, and Cursor-managed hosting.","frontmatter":{"title":"CLI","description":"Commands and common flags for local development, running servers, and Cursor-managed hosting."},"headers":[],"relativePath":"reference/cli.md","filePath":"reference/cli.md"}'),n={name:"reference/cli.md"};function h(l,s,d,o,p,k){return a(),e("div",null,[...s[0]||(s[0]=[t(`<h1 id="cli-reference" tabindex="-1">CLI reference <a class="header-anchor" href="#cli-reference" aria-label="Permalink to &quot;CLI reference&quot;">​</a></h1><p><code>@cursor/july</code> installs one command, <code>agent-sdk</code>; <code>npx @cursor/july &lt;cmd&gt;</code> runs it. Run the CLI with Node 22.13 or newer. Don&#39;t run it with Bun; Bun corrupts tool-result streams from the Cursor SDK.</p><p><code>agent-sdk help</code> prints the built-in summary. The Slack and GitHub packs also provide <code>agent-sdk slack help</code> and <code>agent-sdk github help</code>.</p><table tabindex="0"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><a href="#serve"><code>serve</code></a></td><td>Serve agents over HTTP</td></tr><tr><td><a href="#dev"><code>dev</code></a></td><td>Start local development with <code>serve --dev</code></td></tr><tr><td><a href="#chat"><code>chat</code></a></td><td>Talk to a running agent</td></tr><tr><td><a href="#resume"><code>resume</code></a></td><td>Reattach chat to a previous session</td></tr><tr><td><a href="#logs"><code>logs</code></a></td><td>Follow local or hosted logs</td></tr><tr><td><a href="#sessions"><code>sessions</code></a></td><td>List sessions on a running agent</td></tr><tr><td><a href="#session"><code>session</code></a></td><td>Inspect one session</td></tr><tr><td><a href="#cost"><code>cost</code></a></td><td>Report per-session token usage and estimated cost</td></tr><tr><td><a href="#playground"><code>playground</code></a></td><td>Open the local or hosted playground</td></tr><tr><td><a href="#docs"><code>docs</code></a></td><td>Serve the shipped documentation site locally</td></tr><tr><td><a href="#run"><code>run</code></a></td><td>Run one or more turns locally, remotely, or on a hosted agent</td></tr><tr><td><a href="#call"><code>call</code></a></td><td>Call a server tool without a model turn</td></tr><tr><td><a href="#eval"><code>eval</code></a></td><td>Run filesystem evals</td></tr><tr><td><a href="#trajectory"><code>trajectory</code></a></td><td>Summarize a saved event stream</td></tr><tr><td><a href="#init"><code>init</code></a></td><td>Scaffold a project, or print the setup guide</td></tr><tr><td><a href="#convert-automation"><code>convert-automation</code></a></td><td>Export a Cursor Automation into an agent project</td></tr><tr><td><a href="#install-skills"><code>install-skills</code></a></td><td>Refresh coding-agent skills (<code>npm install</code> already copies them)</td></tr><tr><td><a href="#info"><code>info</code></a></td><td>Print the discovered agent surface</td></tr><tr><td><a href="#validate"><code>validate</code></a></td><td>Check a project and fail on errors</td></tr><tr><td><a href="#login-logout-whoami"><code>login</code> / <code>logout</code> / <code>whoami</code></a></td><td>Manage the host&#39;s Cursor credential</td></tr><tr><td><code>version</code></td><td>Print the installed version and exit (also <code>--version</code> / <code>-V</code>)</td></tr><tr><td><a href="#update"><code>update</code></a></td><td>Upgrade the installed CLI</td></tr><tr><td><a href="#deploy"><code>deploy</code></a></td><td>Deploy one or more agents to Cursor managed hosting</td></tr><tr><td><a href="#deployments"><code>deployments</code></a></td><td>List hosted deployments</td></tr><tr><td><a href="#deployment"><code>deployment</code></a></td><td>Inspect one hosted deployment</td></tr><tr><td><a href="#stop"><code>stop</code></a></td><td>Stop a hosted deployment</td></tr><tr><td><a href="#delete"><code>delete</code></a></td><td>Delete a hosted deployment</td></tr><tr><td><a href="#rotate-token"><code>rotate-token</code></a></td><td>Replace a deployment&#39;s alias token</td></tr><tr><td><a href="#rotate-pod-credential"><code>rotate-pod-credential</code></a></td><td>Replace a deployment&#39;s pod credential</td></tr><tr><td><a href="#secrets"><code>secrets</code></a></td><td>Manage deployment secrets</td></tr><tr><td><a href="#mcp"><code>mcp</code></a></td><td>Proxy the agent&#39;s MCP endpoint over stdio; <code>mcp install</code> writes <code>~/.cursor/mcp.json</code></td></tr><tr><td><a href="#mcp-oauth"><code>mcp oauth</code></a></td><td>Authorize host MCP OAuth; optional <code>--store</code> to deployment secrets</td></tr><tr><td><a href="#slack"><code>slack ...</code></a></td><td>Provision, set up, and check Slack channels</td></tr><tr><td><a href="#github"><code>github ...</code></a></td><td>Forward, replay, and inspect GitHub webhook channels</td></tr></tbody></table><h2 id="choose-a-target" tabindex="-1">Choose a target <a class="header-anchor" href="#choose-a-target" aria-label="Permalink to &quot;Choose a target&quot;">​</a></h2><p>Request-sending commands support three target types.</p><table tabindex="0"><thead><tr><th>Target</th><th>How to select it</th><th>Commands</th></tr></thead><tbody><tr><td>Ephemeral local server</td><td>Omit <code>--url</code> and <code>--prod</code></td><td><code>run</code>, <code>call</code>, <code>eval</code></td></tr><tr><td>Running server</td><td>Pass <code>--url &lt;baseUrl&gt;</code>, unless the command uses the localhost default described next</td><td><code>chat</code>, <code>resume</code>, <code>logs</code>, <code>sessions</code>, <code>session</code>, <code>cost</code>, <code>playground</code>, <code>run</code>, <code>call</code>, <code>eval</code>, <code>mcp</code></td></tr><tr><td>Cursor managed hosting</td><td>Pass <code>--prod</code></td><td><code>chat</code>, <code>resume</code>, <code>logs</code>, <code>sessions</code>, <code>session</code>, <code>cost</code>, <code>playground</code>, <code>run</code>, <code>call</code>, <code>eval</code>, <code>mcp</code></td></tr></tbody></table><p><code>chat</code>, <code>logs</code>, <code>sessions</code>, <code>session</code>, <code>cost</code>, and <code>playground</code> default to <code>http://127.0.0.1:3000</code>. A <code>--url</code> must include the agent slug for a multi-agent server, such as <code>http://127.0.0.1:3000/pr-approver</code>. <code>--slug</code> doesn&#39;t change an explicit URL. <code>mcp</code> has no default target; pass <code>--url</code> or <code>--prod</code>.</p><p>With <code>--prod</code>, <code>--slug</code> selects the deployment and <code>--team</code> selects the Cursor team. The slug defaults to the <code>--dir</code> basename. The team defaults to the signed-in account&#39;s team. <code>--url</code> and <code>--prod</code> are mutually exclusive.</p><p>Use <code>--bearer-token &lt;token&gt;</code> when a running server requires bearer authentication. Hosted commands use your Cursor credential to request short-lived engine access. <code>--api-key</code> overrides the Cursor credential for <code>login</code>, <code>serve</code>, hosted targets, and managed-hosting commands. <code>--state-root</code> applies to <code>serve</code> and ephemeral <code>run</code>, <code>call</code>, and <code>eval</code> servers. Running and hosted targets ignore it.</p><p>For ephemeral <code>run</code>, <code>call</code>, and <code>eval</code> commands, omitting <code>--slug</code> selects an unslugged root mount when one exists. Otherwise, the Agent SDK selects the first discovered agent.</p><h2 id="serve" tabindex="-1">serve <a class="header-anchor" href="#serve" aria-label="Permalink to &quot;serve&quot;">​</a></h2><p><code>serve</code> hosts every agent under <code>--dir</code> in multi-agent mode by default.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> serve</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [--dir </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">pat</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">h</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">]</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [--port </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">3000]</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [--host </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">127.0.0.1]</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [--dev]</span></span>
2
2
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [--mode multi</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">single] [--api-key </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">key</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
3
3
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [--state-root </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">path</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">] [--bearer-token </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">secret</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> --allow-anonymous]</span></span>
4
4
  <span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [--allow-anonymous-cursor-github]</span></span>