@cursor/july 0.1.92 → 0.1.93

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 (324) hide show
  1. package/README.md +117 -162
  2. package/dist/channels/deployments/deployments-channel.d.ts +7 -0
  3. package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
  4. package/dist/channels/deployments/deployments-channel.js +26 -2
  5. package/dist/channels/deployments/types.d.ts +8 -0
  6. package/dist/channels/deployments/types.d.ts.map +1 -1
  7. package/dist/channels/github/github-channel.d.ts +3 -0
  8. package/dist/channels/github/github-channel.d.ts.map +1 -1
  9. package/dist/channels/github/github-channel.js +28 -56
  10. package/dist/continuation.d.ts +1 -1
  11. package/dist/continuation.js +1 -1
  12. package/dist/docs/404.html +2 -2
  13. package/dist/docs/ab.html +8 -8
  14. package/dist/docs/ab.md +7 -13
  15. package/dist/docs/assets/{ab.md.CVzWxLoB.js → ab.md.DJo5r4R-.js} +4 -4
  16. package/dist/docs/assets/{ab.md.CVzWxLoB.lean.js → ab.md.DJo5r4R-.lean.js} +1 -1
  17. package/dist/docs/assets/{app.Bci6CM9E.js → app.CjWU-x0z.js} +1 -1
  18. package/dist/docs/assets/building-with-agents.md.DI4mEzlt.js +13 -0
  19. package/dist/docs/assets/{building-with-agents.md.DH8A_cHA.lean.js → building-with-agents.md.DI4mEzlt.lean.js} +1 -1
  20. package/dist/docs/assets/chunks/@localSearchIndexroot.ChpIC3Zy.js +1 -0
  21. package/dist/docs/assets/chunks/{VPLocalSearchBox.BCPT6xA-.js → VPLocalSearchBox.Cxy8ySFQ.js} +1 -1
  22. package/dist/docs/assets/chunks/{theme.BEA8BF3c.js → theme.Dvq1Bktu.js} +2 -2
  23. package/dist/docs/assets/concepts.md.F6AiPorA.js +1 -0
  24. package/dist/docs/assets/{concepts.md.CRfU3bVg.lean.js → concepts.md.F6AiPorA.lean.js} +1 -1
  25. package/dist/docs/assets/{deployment.md.DX_hc3ze.js → deployment.md.DoLFAzfm.js} +6 -6
  26. package/dist/docs/assets/{evals.md.a0SMN6r9.js → evals.md.lfJoEVc8.js} +6 -6
  27. package/dist/docs/assets/{evals.md.a0SMN6r9.lean.js → evals.md.lfJoEVc8.lean.js} +1 -1
  28. package/dist/docs/assets/{example-agents_approval-buddy.md.DNL83puR.js → example-agents_approval-buddy.md.DmezILPg.js} +1 -1
  29. package/dist/docs/assets/{example-agents_benny.md.C40vHRLc.js → example-agents_benny.md.B0kwY7D_.js} +2 -4
  30. package/dist/docs/assets/{example-agents_benny.md.C40vHRLc.lean.js → example-agents_benny.md.B0kwY7D_.lean.js} +1 -1
  31. package/dist/docs/assets/{example-agents_codebase-wiki.md.Dftj_tPp.js → example-agents_codebase-wiki.md.BBNw9Ekr.js} +3 -3
  32. package/dist/docs/assets/{example-agents_codebase-wiki.md.Dftj_tPp.lean.js → example-agents_codebase-wiki.md.BBNw9Ekr.lean.js} +1 -1
  33. package/dist/docs/assets/{example-agents_concierge.md.MrKpQndp.js → example-agents_concierge.md.BzB2b20R.js} +2 -3
  34. package/dist/docs/assets/example-agents_index.md.ChBp0AX6.js +2 -0
  35. package/dist/docs/assets/example-agents_index.md.ChBp0AX6.lean.js +1 -0
  36. package/dist/docs/assets/{example-agents_knowledge-base.md.DqKqHQ9u.js → example-agents_knowledge-base.md.CrA85ig-.js} +1 -1
  37. package/dist/docs/assets/{example-agents_security-reviewer.md.Bai6D0Ee.js → example-agents_security-reviewer.md.74pPpWYj.js} +1 -1
  38. package/dist/docs/assets/{example-agents_weather-agent.md.lVEAbWFf.js → example-agents_weather-agent.md.CaGpmw3Y.js} +2 -2
  39. package/dist/docs/assets/{guides_agent-to-agent.md.BCeVdJRJ.js → guides_agent-to-agent.md.B3JIaAqz.js} +1 -1
  40. package/dist/docs/assets/{guides_cloud-runtime.md.BSMLIBHr.js → guides_cloud-runtime.md.BnvjPiia.js} +2 -2
  41. package/dist/docs/assets/{guides_cloud-runtime.md.BSMLIBHr.lean.js → guides_cloud-runtime.md.BnvjPiia.lean.js} +1 -1
  42. package/dist/docs/assets/{guides_convert-automation.md.D06eIzea.js → guides_convert-automation.md.Bboisykk.js} +1 -1
  43. package/dist/docs/assets/{guides_github.md.Cdt1s2QC.js → guides_github.md.DqJhuaN1.js} +5 -5
  44. package/dist/docs/assets/{guides_github.md.Cdt1s2QC.lean.js → guides_github.md.DqJhuaN1.lean.js} +1 -1
  45. package/dist/docs/assets/{guides_mcp-oauth.md.Du0f7pGU.js → guides_mcp-oauth.md.CJvrXtkN.js} +2 -2
  46. package/dist/docs/assets/{guides_slack.md.DiUmk_Oi.js → guides_slack.md.mqeNKs84.js} +2 -2
  47. package/dist/docs/assets/{guides_webhooks.md.BpnIdO0i.js → guides_webhooks.md.DKdA43Qm.js} +2 -2
  48. package/dist/docs/assets/{hillclimbing.md.ywF3yDAd.js → hillclimbing.md.DhESf3OO.js} +1 -1
  49. package/dist/docs/assets/{index.md.BAaMXLFd.js → index.md.B-lVR4wT.js} +3 -3
  50. package/dist/docs/assets/{index.md.BAaMXLFd.lean.js → index.md.B-lVR4wT.lean.js} +1 -1
  51. package/dist/docs/assets/{quickstart.md.DsrarzEg.js → quickstart.md.BrmfrrIr.js} +1 -1
  52. package/dist/docs/assets/{reference_agent-config.md.Bqylgw50.js → reference_agent-config.md.Cp_x38Nl.js} +3 -3
  53. package/dist/docs/assets/{reference_channels.md.DQZjCnyh.js → reference_channels.md.Cd2f2iyV.js} +2 -2
  54. package/dist/docs/assets/{reference_channels.md.DQZjCnyh.lean.js → reference_channels.md.Cd2f2iyV.lean.js} +1 -1
  55. package/dist/docs/assets/{reference_cli.md.B7GkAJRC.js → reference_cli.md.D9KESDsD.js} +10 -11
  56. package/dist/docs/assets/{reference_cli.md.B7GkAJRC.lean.js → reference_cli.md.D9KESDsD.lean.js} +1 -1
  57. package/dist/docs/assets/{reference_connections.md.DYidrb-j.js → reference_connections.md.DB6SsN6U.js} +3 -3
  58. package/dist/docs/assets/reference_hooks.md.BxN87gCw.js +14 -0
  59. package/dist/docs/assets/{reference_hooks.md.B9FSgdDe.lean.js → reference_hooks.md.BxN87gCw.lean.js} +1 -1
  60. package/dist/docs/assets/reference_http-api.md.C68BERYr.js +11 -0
  61. package/dist/docs/assets/reference_http-api.md.C68BERYr.lean.js +1 -0
  62. package/dist/docs/assets/{reference_instructions.md.DhNCOl7r.js → reference_instructions.md.CR7XSsGk.js} +3 -3
  63. package/dist/docs/assets/{reference_instructions.md.DhNCOl7r.lean.js → reference_instructions.md.CR7XSsGk.lean.js} +1 -1
  64. package/dist/docs/assets/reference_playground.md.DnX5nL-B.js +1 -0
  65. package/dist/docs/assets/reference_playground.md.DnX5nL-B.lean.js +1 -0
  66. package/dist/docs/assets/{reference_project-layout.md.CwkSbEWT.js → reference_project-layout.md.WN9nwJht.js} +2 -2
  67. package/dist/docs/assets/{reference_prompt.md.DZUMtLPD.js → reference_prompt.md.DnaD5dNK.js} +1 -1
  68. package/dist/docs/assets/{reference_schedules.md.DNipebiG.js → reference_schedules.md.DI_JrHgq.js} +1 -1
  69. package/dist/docs/assets/reference_sessions.md.D0mIh4KK.js +1 -0
  70. package/dist/docs/assets/{reference_sessions.md.tUFzz98S.lean.js → reference_sessions.md.D0mIh4KK.lean.js} +1 -1
  71. package/dist/docs/assets/{reference_skills.md.B5ZEuHfG.js → reference_skills.md.BFW9retM.js} +1 -1
  72. package/dist/docs/assets/{reference_tools.md.wpaJtHn6.js → reference_tools.md.DuKvkYWG.js} +4 -4
  73. package/dist/docs/assets/{reference_tools.md.wpaJtHn6.lean.js → reference_tools.md.DuKvkYWG.lean.js} +1 -1
  74. package/dist/docs/assets/scaffolding-agents.md.D7UUkWw0.js +1 -0
  75. package/dist/docs/assets/{scaffolding-agents.md.CRDDUtYJ.lean.js → scaffolding-agents.md.D7UUkWw0.lean.js} +1 -1
  76. package/dist/docs/assets/{storage.md.JbjlHWZ6.js → storage.md.BOHeqk2M.js} +5 -5
  77. package/dist/docs/assets/{storage.md.JbjlHWZ6.lean.js → storage.md.BOHeqk2M.lean.js} +1 -1
  78. package/dist/docs/assets/{templates_agentic-owners.md.DSJSIpWU.js → templates_agentic-owners.md.DqtPdm6f.js} +2 -2
  79. package/dist/docs/assets/{templates_pr-autofixer.md.1HAR3RXE.js → templates_pr-autofixer.md.R4K_qytS.js} +2 -2
  80. package/dist/docs/assets/{templates_pr-autofixer.md.1HAR3RXE.lean.js → templates_pr-autofixer.md.R4K_qytS.lean.js} +1 -1
  81. package/dist/docs/assets/troubleshooting.md.vCWwvqcJ.js +1 -0
  82. package/dist/docs/assets/{troubleshooting.md.DYECCZiJ.lean.js → troubleshooting.md.vCWwvqcJ.lean.js} +1 -1
  83. package/dist/docs/building-with-agents.html +7 -7
  84. package/dist/docs/building-with-agents.md +5 -11
  85. package/dist/docs/concepts.html +5 -8
  86. package/dist/docs/concepts.md +12 -17
  87. package/dist/docs/deployment.html +11 -11
  88. package/dist/docs/deployment.md +8 -10
  89. package/dist/docs/evals.html +10 -10
  90. package/dist/docs/evals.md +16 -37
  91. package/dist/docs/example-agents/approval-buddy.html +5 -5
  92. package/dist/docs/example-agents/approval-buddy.md +1 -1
  93. package/dist/docs/example-agents/benny.html +5 -7
  94. package/dist/docs/example-agents/benny.md +4 -13
  95. package/dist/docs/example-agents/bugbot.html +4 -4
  96. package/dist/docs/example-agents/codebase-wiki.html +6 -6
  97. package/dist/docs/example-agents/codebase-wiki.md +5 -8
  98. package/dist/docs/example-agents/codeowners-review.html +4 -4
  99. package/dist/docs/example-agents/concierge.html +7 -8
  100. package/dist/docs/example-agents/concierge.md +2 -3
  101. package/dist/docs/example-agents/index.html +6 -6
  102. package/dist/docs/example-agents/index.md +5 -8
  103. package/dist/docs/example-agents/knowledge-base.html +6 -6
  104. package/dist/docs/example-agents/knowledge-base.md +2 -2
  105. package/dist/docs/example-agents/oncall.html +4 -4
  106. package/dist/docs/example-agents/security-reviewer.html +7 -7
  107. package/dist/docs/example-agents/security-reviewer.md +5 -5
  108. package/dist/docs/example-agents/slack-agent.html +4 -4
  109. package/dist/docs/example-agents/weather-agent.html +7 -7
  110. package/dist/docs/example-agents/weather-agent.md +4 -3
  111. package/dist/docs/guides/agent-to-agent.html +5 -5
  112. package/dist/docs/guides/agent-to-agent.md +1 -1
  113. package/dist/docs/guides/cloud-runtime.html +6 -6
  114. package/dist/docs/guides/cloud-runtime.md +8 -25
  115. package/dist/docs/guides/convert-automation.html +6 -6
  116. package/dist/docs/guides/convert-automation.md +3 -3
  117. package/dist/docs/guides/github.html +9 -9
  118. package/dist/docs/guides/github.md +11 -23
  119. package/dist/docs/guides/human-in-the-loop.html +4 -4
  120. package/dist/docs/guides/mcp-oauth.html +6 -6
  121. package/dist/docs/guides/mcp-oauth.md +4 -4
  122. package/dist/docs/guides/opentelemetry.html +4 -4
  123. package/dist/docs/guides/slack.html +7 -7
  124. package/dist/docs/guides/slack.md +4 -4
  125. package/dist/docs/guides/webhooks.html +6 -6
  126. package/dist/docs/guides/webhooks.md +3 -3
  127. package/dist/docs/hashmap.json +1 -1
  128. package/dist/docs/hillclimbing.html +6 -6
  129. package/dist/docs/hillclimbing.md +1 -1
  130. package/dist/docs/index.html +6 -6
  131. package/dist/docs/index.md +2 -10
  132. package/dist/docs/llms-full.txt +300 -850
  133. package/dist/docs/llms.txt +2 -3
  134. package/dist/docs/quickstart.html +5 -5
  135. package/dist/docs/quickstart.md +1 -1
  136. package/dist/docs/reference/agent-config.html +8 -8
  137. package/dist/docs/reference/agent-config.md +10 -15
  138. package/dist/docs/reference/artifacts.html +4 -4
  139. package/dist/docs/reference/channels.html +6 -6
  140. package/dist/docs/reference/channels.md +20 -31
  141. package/dist/docs/reference/cli.html +14 -15
  142. package/dist/docs/reference/cli.md +27 -37
  143. package/dist/docs/reference/connections.html +8 -8
  144. package/dist/docs/reference/connections.md +9 -14
  145. package/dist/docs/reference/hooks.html +6 -6
  146. package/dist/docs/reference/hooks.md +10 -14
  147. package/dist/docs/reference/http-api.html +7 -7
  148. package/dist/docs/reference/http-api.md +17 -37
  149. package/dist/docs/reference/instructions.html +6 -6
  150. package/dist/docs/reference/instructions.md +1 -1
  151. package/dist/docs/reference/playground.html +5 -5
  152. package/dist/docs/reference/playground.md +14 -19
  153. package/dist/docs/reference/project-layout.html +7 -7
  154. package/dist/docs/reference/project-layout.md +2 -2
  155. package/dist/docs/reference/prompt.html +6 -6
  156. package/dist/docs/reference/prompt.md +1 -1
  157. package/dist/docs/reference/schedules.html +6 -6
  158. package/dist/docs/reference/schedules.md +1 -2
  159. package/dist/docs/reference/sessions.html +5 -12
  160. package/dist/docs/reference/sessions.md +8 -19
  161. package/dist/docs/reference/skills.html +6 -6
  162. package/dist/docs/reference/skills.md +3 -3
  163. package/dist/docs/reference/subagents.html +4 -4
  164. package/dist/docs/reference/tools.html +8 -8
  165. package/dist/docs/reference/tools.md +12 -17
  166. package/dist/docs/scaffolding-agents.html +5 -5
  167. package/dist/docs/scaffolding-agents.md +4 -5
  168. package/dist/docs/storage.html +9 -9
  169. package/dist/docs/storage.md +37 -80
  170. package/dist/docs/templates/agentic-owners.html +7 -7
  171. package/dist/docs/templates/agentic-owners.md +2 -2
  172. package/dist/docs/templates/demo.html +4 -4
  173. package/dist/docs/templates/pr-autofixer.html +6 -6
  174. package/dist/docs/templates/pr-autofixer.md +3 -6
  175. package/dist/docs/templates/security-reviewer.html +4 -4
  176. package/dist/docs/templates/triage.html +4 -4
  177. package/dist/docs/troubleshooting.html +5 -5
  178. package/dist/docs/troubleshooting.md +6 -6
  179. package/dist/internal/authored-alias-hooks.d.ts +14 -11
  180. package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
  181. package/dist/internal/authored-alias-hooks.js +14 -11
  182. package/dist/internal/authored-loaders.d.ts +7 -6
  183. package/dist/internal/authored-loaders.d.ts.map +1 -1
  184. package/dist/internal/authored-loaders.js +14 -10
  185. package/dist/internal/cli-deploy.d.ts +1 -1
  186. package/dist/internal/cli-deploy.js +5 -5
  187. package/dist/internal/continuation-channel.d.ts +6 -3
  188. package/dist/internal/continuation-channel.d.ts.map +1 -1
  189. package/dist/internal/continuation-channel.js +44 -40
  190. package/dist/internal/continuation-identity.d.ts +17 -16
  191. package/dist/internal/continuation-identity.d.ts.map +1 -1
  192. package/dist/internal/continuation-identity.js +109 -36
  193. package/dist/internal/deploy-manifest.d.ts +2 -2
  194. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  195. package/dist/internal/deploy-manifest.js +4 -9
  196. package/dist/internal/discovery.d.ts.map +1 -1
  197. package/dist/internal/discovery.js +3 -0
  198. package/dist/internal/distribution.d.ts +4 -3
  199. package/dist/internal/distribution.d.ts.map +1 -1
  200. package/dist/internal/distribution.js +4 -3
  201. package/dist/internal/hosted-delivery-protocol.d.ts +38 -0
  202. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -0
  203. package/dist/internal/hosted-delivery-protocol.js +70 -0
  204. package/dist/internal/hosted-delivery.d.ts +35 -0
  205. package/dist/internal/hosted-delivery.d.ts.map +1 -0
  206. package/dist/internal/hosted-delivery.js +226 -0
  207. package/dist/internal/http-channel.d.ts.map +1 -1
  208. package/dist/internal/http-channel.js +1 -1
  209. package/dist/internal/review-comments.d.ts +186 -63
  210. package/dist/internal/review-comments.d.ts.map +1 -1
  211. package/dist/internal/review-comments.js +350 -168
  212. package/dist/internal/server.d.ts.map +1 -1
  213. package/dist/internal/server.js +21 -3
  214. package/dist/internal/session-engine.d.ts +5 -0
  215. package/dist/internal/session-engine.d.ts.map +1 -1
  216. package/dist/internal/session-engine.js +13 -3
  217. package/dist/internal/shallow-clone.d.ts +8 -2
  218. package/dist/internal/shallow-clone.d.ts.map +1 -1
  219. package/dist/internal/shallow-clone.js +17 -10
  220. package/dist/playground/assets/{index-DDvyC2z6.js → index-D9MFzhNE.js} +1 -1
  221. package/dist/playground/index.html +1 -1
  222. package/dist/types.d.ts +9 -17
  223. package/dist/types.d.ts.map +1 -1
  224. package/docs/README.md +2 -10
  225. package/docs/ab.md +7 -13
  226. package/docs/building-with-agents.md +5 -11
  227. package/docs/concepts.md +12 -17
  228. package/docs/deployment.md +8 -10
  229. package/docs/evals.md +16 -37
  230. package/docs/example-agents/approval-buddy.md +1 -1
  231. package/docs/example-agents/benny.md +4 -13
  232. package/docs/example-agents/codebase-wiki.md +5 -8
  233. package/docs/example-agents/concierge.md +2 -3
  234. package/docs/example-agents/index.md +6 -9
  235. package/docs/example-agents/knowledge-base.md +2 -2
  236. package/docs/example-agents/security-reviewer.md +5 -5
  237. package/docs/example-agents/weather-agent.md +4 -3
  238. package/docs/guides/agent-to-agent.md +1 -1
  239. package/docs/guides/cloud-runtime.md +8 -25
  240. package/docs/guides/convert-automation.md +3 -3
  241. package/docs/guides/github.md +11 -23
  242. package/docs/guides/mcp-oauth.md +4 -4
  243. package/docs/guides/slack.md +4 -4
  244. package/docs/guides/webhooks.md +3 -3
  245. package/docs/hillclimbing.md +1 -1
  246. package/docs/quickstart.md +1 -1
  247. package/docs/reference/agent-config.md +10 -15
  248. package/docs/reference/channels.md +20 -31
  249. package/docs/reference/cli.md +27 -37
  250. package/docs/reference/connections.md +9 -14
  251. package/docs/reference/hooks.md +10 -14
  252. package/docs/reference/http-api.md +18 -38
  253. package/docs/reference/instructions.md +1 -1
  254. package/docs/reference/playground.md +14 -19
  255. package/docs/reference/project-layout.md +2 -2
  256. package/docs/reference/prompt.md +1 -1
  257. package/docs/reference/schedules.md +1 -2
  258. package/docs/reference/sessions.md +8 -19
  259. package/docs/reference/skills.md +3 -3
  260. package/docs/reference/tools.md +12 -17
  261. package/docs/scaffolding-agents.md +4 -5
  262. package/docs/storage.md +37 -80
  263. package/docs/templates/agentic-owners.md +2 -2
  264. package/docs/templates/pr-autofixer.md +3 -6
  265. package/docs/troubleshooting.md +6 -6
  266. package/package.json +8 -1
  267. package/src/channels/deployments/deployments-channel.ts +32 -2
  268. package/src/channels/deployments/types.ts +8 -0
  269. package/src/channels/github/github-channel.ts +71 -21
  270. package/src/continuation.ts +1 -1
  271. package/src/internal/authored-alias-hooks.ts +14 -11
  272. package/src/internal/authored-loaders.ts +14 -10
  273. package/src/internal/cli-deploy.ts +5 -5
  274. package/src/internal/continuation-channel.ts +62 -45
  275. package/src/internal/continuation-identity.ts +123 -38
  276. package/src/internal/deploy-manifest.ts +5 -9
  277. package/src/internal/discovery.ts +3 -0
  278. package/src/internal/distribution.ts +4 -3
  279. package/src/internal/hosted-delivery-protocol.ts +114 -0
  280. package/src/internal/hosted-delivery.ts +327 -0
  281. package/src/internal/http-channel.ts +0 -2
  282. package/src/internal/review-comments.ts +542 -229
  283. package/src/internal/server.ts +29 -2
  284. package/src/internal/session-engine.ts +25 -1
  285. package/src/internal/shallow-clone.ts +30 -16
  286. package/src/types.ts +9 -17
  287. package/dist/docs/assets/building-with-agents.md.DH8A_cHA.js +0 -13
  288. package/dist/docs/assets/chunks/@localSearchIndexroot.Dv-Q0XtU.js +0 -1
  289. package/dist/docs/assets/concepts.md.CRfU3bVg.js +0 -4
  290. package/dist/docs/assets/example-agents_fsd.md.ZWHWWZPE.js +0 -15
  291. package/dist/docs/assets/example-agents_fsd.md.ZWHWWZPE.lean.js +0 -1
  292. package/dist/docs/assets/example-agents_index.md.QZ8mhr6n.js +0 -2
  293. package/dist/docs/assets/example-agents_index.md.QZ8mhr6n.lean.js +0 -1
  294. package/dist/docs/assets/reference_hooks.md.B9FSgdDe.js +0 -14
  295. package/dist/docs/assets/reference_http-api.md.CSHVobzG.js +0 -11
  296. package/dist/docs/assets/reference_http-api.md.CSHVobzG.lean.js +0 -1
  297. package/dist/docs/assets/reference_playground.md.Dfb92yQf.js +0 -1
  298. package/dist/docs/assets/reference_playground.md.Dfb92yQf.lean.js +0 -1
  299. package/dist/docs/assets/reference_sessions.md.tUFzz98S.js +0 -8
  300. package/dist/docs/assets/scaffolding-agents.md.CRDDUtYJ.js +0 -1
  301. package/dist/docs/assets/troubleshooting.md.DYECCZiJ.js +0 -1
  302. package/dist/docs/example-agents/fsd.html +0 -41
  303. package/dist/docs/example-agents/fsd.md +0 -329
  304. package/docs/example-agents/fsd.md +0 -334
  305. /package/dist/docs/assets/{deployment.md.DX_hc3ze.lean.js → deployment.md.DoLFAzfm.lean.js} +0 -0
  306. /package/dist/docs/assets/{example-agents_approval-buddy.md.DNL83puR.lean.js → example-agents_approval-buddy.md.DmezILPg.lean.js} +0 -0
  307. /package/dist/docs/assets/{example-agents_concierge.md.MrKpQndp.lean.js → example-agents_concierge.md.BzB2b20R.lean.js} +0 -0
  308. /package/dist/docs/assets/{example-agents_knowledge-base.md.DqKqHQ9u.lean.js → example-agents_knowledge-base.md.CrA85ig-.lean.js} +0 -0
  309. /package/dist/docs/assets/{example-agents_security-reviewer.md.Bai6D0Ee.lean.js → example-agents_security-reviewer.md.74pPpWYj.lean.js} +0 -0
  310. /package/dist/docs/assets/{example-agents_weather-agent.md.lVEAbWFf.lean.js → example-agents_weather-agent.md.CaGpmw3Y.lean.js} +0 -0
  311. /package/dist/docs/assets/{guides_agent-to-agent.md.BCeVdJRJ.lean.js → guides_agent-to-agent.md.B3JIaAqz.lean.js} +0 -0
  312. /package/dist/docs/assets/{guides_convert-automation.md.D06eIzea.lean.js → guides_convert-automation.md.Bboisykk.lean.js} +0 -0
  313. /package/dist/docs/assets/{guides_mcp-oauth.md.Du0f7pGU.lean.js → guides_mcp-oauth.md.CJvrXtkN.lean.js} +0 -0
  314. /package/dist/docs/assets/{guides_slack.md.DiUmk_Oi.lean.js → guides_slack.md.mqeNKs84.lean.js} +0 -0
  315. /package/dist/docs/assets/{guides_webhooks.md.BpnIdO0i.lean.js → guides_webhooks.md.DKdA43Qm.lean.js} +0 -0
  316. /package/dist/docs/assets/{hillclimbing.md.ywF3yDAd.lean.js → hillclimbing.md.DhESf3OO.lean.js} +0 -0
  317. /package/dist/docs/assets/{quickstart.md.DsrarzEg.lean.js → quickstart.md.BrmfrrIr.lean.js} +0 -0
  318. /package/dist/docs/assets/{reference_agent-config.md.Bqylgw50.lean.js → reference_agent-config.md.Cp_x38Nl.lean.js} +0 -0
  319. /package/dist/docs/assets/{reference_connections.md.DYidrb-j.lean.js → reference_connections.md.DB6SsN6U.lean.js} +0 -0
  320. /package/dist/docs/assets/{reference_project-layout.md.CwkSbEWT.lean.js → reference_project-layout.md.WN9nwJht.lean.js} +0 -0
  321. /package/dist/docs/assets/{reference_prompt.md.DZUMtLPD.lean.js → reference_prompt.md.DnaD5dNK.lean.js} +0 -0
  322. /package/dist/docs/assets/{reference_schedules.md.DNipebiG.lean.js → reference_schedules.md.DI_JrHgq.lean.js} +0 -0
  323. /package/dist/docs/assets/{reference_skills.md.B5ZEuHfG.lean.js → reference_skills.md.BFW9retM.lean.js} +0 -0
  324. /package/dist/docs/assets/{templates_agentic-owners.md.DSJSIpWU.lean.js → templates_agentic-owners.md.DqtPdm6f.lean.js} +0 -0
@@ -20,11 +20,6 @@ Metric callbacks observe the result without approving, rejecting, or
20
20
  failing a turn. Use [evals](/docs/evals.md) for pass/fail regression checks
21
21
  on fixed inputs.
22
22
 
23
- > [!NOTE]
24
- > Import paths here use `@cursor/july/ab`. On projects still
25
- > using `@anysphere/agent-serve`, swap the import. See
26
- > [Run the CLI](/docs/index.md#run-the-cli) for the full rename table.
27
-
28
23
  ## Choose live A/B metrics or evals
29
24
 
30
25
  Both features read the session event stream, but they answer different
@@ -45,7 +40,7 @@ There is no `agent-sdk ab` command or assertion API.
45
40
  Author one experiment in `agent/ab.ts`, add more under
46
41
  `agent/ab/<name>.ts`, or use both forms. Each file defines one
47
42
  experiment. The experiment name comes from `name` when set. Otherwise,
48
- The Agent SDK uses `ab` for `agent/ab.ts` and the file stem for files under
43
+ the Agent SDK uses `ab` for `agent/ab.ts` and the file stem for files under
49
44
  `agent/ab/`.
50
45
 
51
46
  ```ts
@@ -254,10 +249,9 @@ The response has two views of the same durable data:
254
249
  `GET /v1/abs` returns sessions visible to the current principal by
255
250
  default. In `--dev`, loopback requests include every session. Add
256
251
  `--allow-anonymous` to include every session from non-loopback callers
257
- too. This include-all behavior can still apply to `GET /v1/abs` in dev
258
- when bearer or custom auth keeps `GET /v1/sessions` owner-scoped.
252
+ too.
259
253
 
260
- Session `events.ndjson` is the source of truth for assignment + fold.
254
+ The session event stream is the source of truth for assignment + fold.
261
255
  `GET /v1/abs` recomputes aggregates from those logs. Any
262
256
  `agent/storage.ts` exports samples and snapshots durably: an authored
263
257
  `abs` table when the backend has a native shape for it, or the table
@@ -267,14 +261,14 @@ derived over the KV core otherwise. See
267
261
  ## Configure the playground fold window
268
262
 
269
263
  Assignments and foldable metrics already persist in each session's
270
- `events.ndjson` under `--state-root`. The optional `agent/ab.config.ts`
271
- only caps how many sessions the playground and `GET /v1/abs` fold:
264
+ event stream. The optional `agent/ab.config.ts` only caps how many
265
+ sessions the playground and `GET /v1/abs` fold:
272
266
 
273
267
  ```ts
274
268
  import { defineABConfig } from "@cursor/july/ab";
275
269
 
276
270
  export default defineABConfig({
277
- // Optional defaults to 200. Only affects GET /v1/abs / A/Bs tab.
271
+ // Optional. Defaults to 200. Only affects GET /v1/abs / A/Bs tab.
278
272
  maxPlaygroundSessions: 500,
279
273
  });
280
274
  ```
@@ -286,7 +280,7 @@ your metrics vendor, send samples from `onSample` or declare a storage
286
280
 
287
281
  ## Keep assignments durable
288
282
 
289
- The append-only `events.ndjson` stream is the source of truth. Each
283
+ The append-only event stream is the source of truth. Each
290
284
  `ab.assigned` event persists a variant key or null skip. Built-in
291
285
  metrics come from the turn and tool events that follow it.
292
286
 
@@ -373,9 +367,8 @@ and verify the result without reading terminal prose.
373
367
  ## How do I create an agent with the built-in skill?
374
368
 
375
369
  Have the coding agent read
376
- [`skills/create-agent/SKILL.md`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/skills/create-agent/SKILL.md) (in the
377
- monorepo: `packages/agent-serve/skills/create-agent/SKILL.md`) and follow
378
- it.
370
+ [`skills/create-agent/SKILL.md`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/skills/create-agent/SKILL.md) and
371
+ follow it.
379
372
 
380
373
  The skill asks about your agent's purpose, runtime, model, channels, MCP
381
374
  connections, and capabilities. It then shows you a plan, writes the
@@ -409,11 +402,6 @@ The package ships task-specific guides under [`skills/`](https://github.com/curs
409
402
  Point your coding agent at the matching `SKILL.md`. The guide contains
410
403
  the workflow, commands, and common mistakes for that task.
411
404
 
412
- > [!NOTE]
413
- > The skill bodies use the current `agent-serve` CLI names. This guide
414
- > uses the upcoming `agent-sdk` names. See
415
- > [Run the CLI](/docs/index.md#run-the-cli) for the full rename table.
416
-
417
405
  ## How does a coding agent verify its work?
418
406
 
419
407
  The coding agent should discover the project, test each server tool,
@@ -429,7 +417,7 @@ agent-sdk call inspect_pr --dir . \
429
417
  agent-sdk run --dir . \
430
418
  --message "Is https://github.com/acme/checkout/pull/42 ready to approve?"
431
419
 
432
- agent-sdk trajectory --events .agent-serve/traces/<sessionId>.ndjson
420
+ agent-sdk trajectory --events <state-root>/traces/<sessionId>.ndjson
433
421
 
434
422
  agent-sdk eval --dir . --list
435
423
  agent-sdk eval --dir . --json
@@ -444,8 +432,8 @@ Test server tools with `call` before tuning the prompt. It runs a tool
444
432
  in-process with schema validation and no model turn. If the tool returns
445
433
  the wrong data, a prompt change won't fix it.
446
434
 
447
- `validate` and `run` don't type-check the project because tsx strips
448
- types. Run the project's TypeScript check before shipping. Tool results
435
+ `validate` and `run` do not type-check the project. Run the project's
436
+ TypeScript check before shipping. Tool results
449
437
  must also be JSON-shaped. Use object literals or `type` aliases for
450
438
  `execute` return types instead of `interface` types.
451
439
 
@@ -520,8 +508,8 @@ Other folders add subagents, hooks, schedules, and workspace files. You
520
508
  don't register them elsewhere. Run `agent-sdk validate` to catch
521
509
  invalid files before serving the project.
522
510
 
523
- See [Project layout](/docs/reference/project-layout.md) for every supported
524
- path.
511
+ See [Project layout](/docs/reference/project-layout.md) for the folder
512
+ structure.
525
513
 
526
514
  ## How does the Agent SDK identify a conversation?
527
515
 
@@ -540,8 +528,7 @@ observe or manage the conversation.
540
528
 
541
529
  ## How do I see what an agent did?
542
530
 
543
- Each session writes an append-only NDJSON file:
544
- `sessions/<id>/events.ndjson`. It includes:
531
+ Each session records an append-only event stream. It includes:
545
532
 
546
533
  - Messages and streamed text
547
534
  - Requested tool calls and their results
@@ -554,7 +541,8 @@ playground renders the stream. Evals assert against it. The
554
541
  summary.
555
542
 
556
543
  When a run surprises you, inspect its event stream first. See
557
- [Sessions and streaming](/docs/reference/sessions.md) for every event.
544
+ [Sessions and streaming](/docs/reference/sessions.md) for the event
545
+ vocabulary.
558
546
 
559
547
  ## What does a channel control?
560
548
 
@@ -607,18 +595,13 @@ files, and adds agent tool scripts.
607
595
 
608
596
  The workspace is a real Cursor project. It can inherit `AGENTS.md` and
609
597
  `.cursor` settings from parent directories. Nested git checkouts default
610
- `local.cwd` to `~/.cache/agent-serve/<dir>`. Point `cwd` at a checkout
611
- only when the agent should inherit that tree. `run` and `eval` already
612
- use a temporary state root.
598
+ `local.cwd` to a per-project cache directory under `~/.cache`. Point
599
+ `cwd` at a checkout only when the agent should inherit that tree. `run`
600
+ and `eval` already use a temporary state root.
613
601
 
614
- Durable local state uses this shape:
615
-
616
- ```text
617
- <project>/.agent-serve/
618
- sessions/<id>/events.ndjson
619
- sessions/<id>/workspace/
620
- traces/<sessionId>.ndjson
621
- ```
602
+ Session files live under `--state-root`. See
603
+ [Sessions](/docs/reference/sessions.md#where-does-the-agent-sdk-store-session-data)
604
+ for the layout.
622
605
 
623
606
  ## How can one agent call another?
624
607
 
@@ -806,10 +789,8 @@ the feature that needs the secret.
806
789
 
807
790
  Hosted filesystem state can reset during a deploy or runtime
808
791
  replacement. Prefer
809
- [`cursorHostedStorage`](/docs/storage.md) (`@cursor/july/storage/cursor-hosted`)
810
- so durable records land in Cursor's Bugbot `agent_serve_*` tables through
811
- a control-plane HTTP proxy (pod credential auth — no database URL in the
812
- engine). Do not put `BUGBOTDB_URL` or `AGENT_SERVE_DEPLOYMENT_ID` in
792
+ [`cursorHostedStorage`](/docs/storage.md) so records survive replace.
793
+ Do not put platform storage or deployment-identity names in
813
794
  `hosting.secretNames`. Self-host with your own `defineStorage` backend or
814
795
  a persistent `--state-root` when the complete filesystem must survive.
815
796
 
@@ -937,7 +918,7 @@ Without `envPrefix`, a dedicated app reads `SLACK_BOT_TOKEN` and
937
918
  ### Update, stop, or delete a deployment
938
919
 
939
920
  Redeploy the same slug after pushing a new Git ref. The stable alias
940
- continues to point at the active generation. Follow the same source rules
921
+ continues to point at the latest deploy. Follow the same source rules
941
922
  from [Deploy from Git](#deploy-from-git).
942
923
 
943
924
  ```bash
@@ -954,7 +935,7 @@ reference.
954
935
  ## Self-host the Agent SDK
955
936
 
956
937
  The Agent SDK runs as a Node HTTP server on Node 22.13 or newer. You can host
957
- it on a VM, container platform, or ECS.
938
+ it on a VM or container platform.
958
939
 
959
940
  ### The security model in one minute
960
941
 
@@ -1007,7 +988,7 @@ export AGENT_SDK_BEARER_TOKEN="$(openssl rand -hex 32)"
1007
988
 
1008
989
  # the server: all agents under one port
1009
990
  agent-sdk serve --dir /srv/agents --port 3000 --host 127.0.0.1 \
1010
- --state-root /var/lib/agent-serve \
991
+ --state-root /var/lib/agent-sdk \
1011
992
  --bearer-token "$AGENT_SDK_BEARER_TOKEN"
1012
993
  ```
1013
994
 
@@ -1038,8 +1019,8 @@ agent code. Humans reach the playground through a private network or
1038
1019
  tunnel. Keep `--bearer-token` on because tunneled requests arrive from
1039
1020
  loopback and IP-based policies can't tell them apart.
1040
1021
 
1041
- Health checks: `GET /v1/health` at the host level (made for ALB and ECS
1042
- checks), and each agent also serves `/<slug>/v1/health`.
1022
+ Health checks: `GET /v1/health` at the host level, and each agent also
1023
+ serves `/<slug>/v1/health`.
1043
1024
 
1044
1025
  ### Containers
1045
1026
 
@@ -1049,7 +1030,7 @@ package dependencies. Run `agent-sdk serve` as a non-root user:
1049
1030
  ```bash
1050
1031
  agent-sdk serve --dir /srv/agents --mode multi \
1051
1032
  --host 0.0.0.0 --port 3000 \
1052
- --state-root /var/lib/agent-serve \
1033
+ --state-root /var/lib/agent-sdk \
1053
1034
  --bearer-token "$AGENT_SDK_BEARER_TOKEN"
1054
1035
  ```
1055
1036
 
@@ -1139,12 +1120,6 @@ targets) a real agent server, drives sessions over the public API, and
1139
1120
  grades what comes back. A passing eval means the agent started,
1140
1121
  accepted a message, and did what you asserted.
1141
1122
 
1142
- > [!NOTE]
1143
- > Import paths here use `@cursor/july/evals`. On projects still
1144
- > using `@anysphere/agent-serve`, swap the import and run
1145
- > `agent-serve eval`. See
1146
- > [Run the CLI](/docs/index.md#run-the-cli) for the full rename table.
1147
-
1148
1123
  ## Define evals with `defineEval`
1149
1124
 
1150
1125
  The Agent SDK discovers evals under the project-root `evals/` directory,
@@ -1248,7 +1223,7 @@ export default defineEvalConfig({
1248
1223
  // timeoutMs: 180_000, // optional project-wide default
1249
1224
  // judge: { model: "..." }, // default judge model for t.judge.*
1250
1225
  // reporters: [], // destinations that observe every case
1251
- // maxPlaygroundRuns: 50, // playground /v1/dev/evals history only (default 20)
1226
+ // maxPlaygroundRuns: 50, // playground history only (default 20)
1252
1227
  });
1253
1228
  ```
1254
1229
 
@@ -1262,7 +1237,7 @@ The optional fields:
1262
1237
  | `timeoutMs` | `180_000` | Project-wide per-case timeout |
1263
1238
  | `judge` | unset | Default judge model for `t.judge.*`; see [Judge free-form output](#judge-free-form-output) |
1264
1239
  | `reporters` | unset | Destinations that observe every case; `--skip-report` suppresses them |
1265
- | `maxPlaygroundRuns` | `20` | Max batches in the playground / `/v1/dev/evals*` history (not CLI `eval`) |
1240
+ | `maxPlaygroundRuns` | `20` | Max batches in the playground / `/v1/dev/evals*` history (not CLI `eval`). Hard-capped at 500. |
1266
1241
 
1267
1242
  Reporters come from `@cursor/july/evals/reporters`: `JUnit` writes a
1268
1243
  JUnit XML file for CI, `Artifacts` writes per-case files, and
@@ -1274,7 +1249,7 @@ Playground batches survive restarts whenever `agent/storage.ts` exists
1274
1249
  with an `evals` table or a KV core providing `delete` and `list` (the
1275
1250
  table is derived over the core); see
1276
1251
  [Storage](/docs/storage.md#eval-and-a-b-tables). Without storage they live
1277
- in process memory and disappear when `serve` exits navigating away
1252
+ in process memory and disappear when `serve` exits. Navigating away
1278
1253
  and back still works while the process is up.
1279
1254
 
1280
1255
  ## Drive and assert with `t`
@@ -1294,9 +1269,9 @@ intermediate turn before the next send overwrites `t.reply`.
1294
1269
  depend on it.
1295
1270
 
1296
1271
  Read the full case state with `t.reply` (the last assistant text),
1297
- `t.events` (every captured session event across turns), `t.turns`
1298
- (settled turns, oldest first), and `t.sessionId`. `t.signal` aborts
1299
- when the case hits its timeout; pass it to your own async work.
1272
+ `t.events` (session events captured so far), `t.turns` (settled
1273
+ turns, oldest first), and `t.sessionId`. `t.signal` aborts when the
1274
+ case hits its timeout; pass it to your own async work.
1300
1275
 
1301
1276
  Assert with the gates:
1302
1277
 
@@ -1352,10 +1327,10 @@ the CLI and playground result.
1352
1327
 
1353
1328
  Three `t.send` options apply on session create (first `t.send` only):
1354
1329
 
1355
- - `workspaceFiles` `{ path: contents }`, seeded into the local session
1330
+ - `workspaceFiles`: `{ path: contents }`, seeded into the local session
1356
1331
  workspace. Prefer this over machine-local paths.
1357
- - `workspaceDir` absolute harness cwd (local runtime).
1358
- - `cloud` per-session cloud options merged over the agent's static
1332
+ - `workspaceDir`: absolute harness cwd (local runtime).
1333
+ - `cloud`: per-session cloud options merged over the agent's static
1359
1334
  `cloud` config (repos / env / …). Use a pinned `repos` override to
1360
1335
  attach a fixture repo for cloud evals without putting it on the
1361
1336
  agent's default `cloud.repos`. Cloud ignores `workspaceFiles` seeds.
@@ -1417,7 +1392,7 @@ match both groups.
1417
1392
 
1418
1393
  `eval` boots an ephemeral server on port 0 with a temp state root
1419
1394
  outside the project, so cases don't inherit ambient monorepo rules and
1420
- don't pollute `.agent-serve/`. Point `--url` at a running server to eval
1395
+ don't write into the project state directory. Point `--url` at a running server to eval
1421
1396
  a live agent instead:
1422
1397
 
1423
1398
  ```bash
@@ -1471,29 +1446,18 @@ failed assertion without parsing terminal text.
1471
1446
 
1472
1447
  ## Run evals in the playground
1473
1448
 
1474
- Start the server with `--dev`, open the playground, and choose
1475
- **Evals**. You can run every case or one case, watch progress, and open
1476
- the resulting session trace.
1449
+ Start the server, open the playground, and choose **Evals**. You can run
1450
+ every case or one case, watch progress, and open the resulting session
1451
+ trace. The Evals tab works on a normal `serve`.
1477
1452
 
1478
1453
  ```bash
1479
- agent-sdk serve --dir . --dev
1454
+ agent-sdk serve --dir .
1480
1455
  ```
1481
1456
 
1482
1457
  Playground runs target the live server instead of an ephemeral one.
1483
1458
  Their sessions appear in the session list. One eval batch can run at a
1484
- time. Batches persist across restarts whenever `agent/storage.ts`
1485
- provides an `evals` table or a KV core with `delete` and `list` (the
1486
- table is derived over the core); without storage they are **in-memory
1487
- only** (capped by `maxPlaygroundRuns`) — see
1488
- [Storage](/docs/storage.md#eval-and-a-b-tables).
1489
-
1490
- The UI uses the playground eval routes (available without `--dev`):
1491
- `GET /v1/dev/evals` lists datapoints and config (includes `maxPlaygroundRuns` /
1492
- `durableRuns`),
1493
- `GET /v1/dev/evals/runs` rehydrates recent batches after navigation,
1494
- `POST /v1/dev/evals/runs` starts a batch (returns an **Eval ID** / `runId`),
1495
- `GET /v1/dev/evals/runs/:runId` polls it, and
1496
- `POST /v1/dev/evals/runs/:runId/cancel` cancels a running batch. See
1459
+ time. Persistence follows the rule under
1460
+ [Configure eval runs](#configure-eval-runs). See
1497
1461
  [Playground eval routes](/docs/reference/http-api.md#playground-eval-routes).
1498
1462
  The start request returns `202` while cases run in the background.
1499
1463
  Poll until the snapshot status becomes `completed`, `failed`, or `cancelled`.
@@ -1512,10 +1476,6 @@ agent-sdk eval cancel evalrun_… --prod --slug vulnerability-scanner
1512
1476
  agent-sdk eval status evalrun_… --prod --slug vulnerability-scanner
1513
1477
  ```
1514
1478
 
1515
- The Evals tab prefers the server’s in-flight batch (`activeRunId`) over a
1516
- stale tab-local remembered id, so CLI / Slack kicks show up without an
1517
- incognito window.
1518
-
1519
1479
  ## What good cases assert
1520
1480
 
1521
1481
  Gate decisions and shape, not prose. Model wording varies run to run.
@@ -1678,7 +1638,7 @@ approving the PR.
1678
1638
  | Server tools | [`agent/tools/`](https://github.com/cursor/cursor/tree/main/packages/agent-serve/examples/approval-buddy/agent/tools/) | Prepare evidence, approve, list buddies, and search GIFs. |
1679
1639
  | Deterministic policy | [`agent/lib/approve.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/approval-buddy/agent/lib/approve.ts), [`agent/lib/buddies.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/approval-buddy/agent/lib/buddies.ts) | Own the roster and live eligibility checks. |
1680
1640
  | Review subagents | [`agent/subagents/`](https://github.com/cursor/cursor/tree/main/packages/agent-serve/examples/approval-buddy/agent/subagents/) | Run deep audit and code-quality passes over the same evidence. |
1681
- | Storage | [`agent/storage.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/approval-buddy/agent/storage.ts) | Persist sessions and events with `cursorHostedStorage` (Bugbot `agent_serve_*`). |
1641
+ | Storage | [`agent/storage.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/approval-buddy/agent/storage.ts) | Persist sessions and events with `cursorHostedStorage`. See [Storage](/docs/storage.md). |
1682
1642
  | Live A/B experiment | [`agent/ab.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/approval-buddy/agent/ab.ts) | Compare baseline responses with a concise, presentation-only treatment (`concise-results`). |
1683
1643
  | Evals and unit tests | [`evals/`](https://github.com/cursor/cursor/tree/main/packages/agent-serve/examples/approval-buddy/evals/), [`agent/lib/`](https://github.com/cursor/cursor/tree/main/packages/agent-serve/examples/approval-buddy/agent/lib/) | Protect routing, output contracts, policy, and GitHub behavior. |
1684
1644
 
@@ -1928,7 +1888,7 @@ need the watched-channel path.
1928
1888
 
1929
1889
  | File | Purpose |
1930
1890
  | --- | --- |
1931
- | [`agent/agent.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/benny/agent/agent.ts) | Names the agent, selects its model, and keeps the harness under `.agent-serve/harness`. |
1891
+ | [`agent/agent.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/benny/agent/agent.ts) | Names the agent, selects its model, and points the harness at a project-local cwd so inherited playbooks load. |
1932
1892
  | [`agent/instructions.md`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/benny/agent/instructions.md) | Defines engagement rules, evidence policy, and the playbook routing map. |
1933
1893
  | [`agent/channels/slack.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/benny/agent/channels/slack.ts) | Handles account-linked mentions and direct messages. |
1934
1894
  | [`agent/channels/slack-app.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/benny/agent/channels/slack-app.ts) | Runs the dedicated app and watches one allowlisted channel. |
@@ -1946,18 +1906,9 @@ large monorepo. This prevents ancestor instruction and repository-rule files
1946
1906
  from leaking into an unrelated agent.
1947
1907
 
1948
1908
  The playbook router needs the opposite. Its procedures live at the repository
1949
- root, so
1950
- `agent.ts` sets:
1951
-
1952
- ```ts
1953
- local: {
1954
- cwd: ".agent-serve/harness",
1955
- }
1956
- ```
1957
-
1958
- Each harness workspace lands under
1959
- `examples/benny/.agent-serve/harness/<sessionId>`. Walking up the directory
1960
- tree reaches the host repository and its inherited playbook directory.
1909
+ root, so `agent.ts` points `local.cwd` at a harness directory under the
1910
+ project. Each harness workspace is a child of that directory. Walking up
1911
+ reaches the host repository and its inherited playbook directory.
1961
1912
 
1962
1913
  Those playbooks are inherited context. `agent-sdk info` reports zero authored
1963
1914
  skills for the agent. Copying this project into another repository removes
@@ -2333,9 +2284,9 @@ The wiki refuses to become a merge log:
2333
2284
  - Every touched page gets a dated changelog entry citing the PR
2334
2285
  number, so each fact traces back to a merge.
2335
2286
 
2336
- The wiki itself is markdown on the serve host, in `.agent-serve/wiki/`
2337
- by default with a `CODEBASE_WIKI_DIR` override. Sessions are
2338
- disposable; the wiki is the durable state.
2287
+ The wiki itself is markdown on the serve host, in a wiki directory by
2288
+ default with a `CODEBASE_WIKI_DIR` override. Sessions are disposable;
2289
+ the wiki is the durable state.
2339
2290
 
2340
2291
  ## Follow a merged PR
2341
2292
 
@@ -2409,11 +2360,8 @@ agent-sdk github replay https://github.com/owner/repo/pull/123 \
2409
2360
  ```
2410
2361
 
2411
2362
  The reply is a 202 acknowledgement; the ingest continues in the task.
2412
- Watch the session in the playground, then read the result on disk:
2413
-
2414
- ```bash
2415
- ls examples/codebase-wiki/.agent-serve/wiki/features/
2416
- ```
2363
+ Watch the session in the playground, then open the wiki directory on
2364
+ the serve host. Feature pages land under `features/`.
2417
2365
 
2418
2366
  Each ingested feature page carries an overview, a "How it works"
2419
2367
  section, and a changelog line citing the PR. Deterministic digest
@@ -2758,7 +2706,7 @@ A peer can only resolve within a multi-agent serve host. Validating Concierge
2758
2706
  alone checks its files, but serving it alone fails because `weather-agent`
2759
2707
  isn't mounted.
2760
2708
 
2761
- From `packages/agent-serve`, validate both projects:
2709
+ From this package, validate both projects:
2762
2710
 
2763
2711
  ```bash
2764
2712
  agent-sdk validate --dir examples/concierge
@@ -2771,8 +2719,7 @@ two-project mount instead. Copy only the authored files needed for this proof,
2771
2719
  leaving Weather's Slack channels out:
2772
2720
 
2773
2721
  ```bash
2774
- mkdir -p "$PWD/.agent-serve"
2775
- PAIR_DIR=$(mktemp -d "$PWD/.agent-serve/concierge-weather.XXXXXX")
2722
+ PAIR_DIR=$(mktemp -d "${TMPDIR:-/tmp}/concierge-weather.XXXXXX")
2776
2723
  mkdir -p "$PAIR_DIR/concierge" "$PAIR_DIR/weather-agent/agent"
2777
2724
  cp -R examples/concierge/agent "$PAIR_DIR/concierge/"
2778
2725
  cp examples/concierge/package.json "$PAIR_DIR/concierge/"
@@ -2880,340 +2827,6 @@ one parent and needs no independent sessions, use a subagent instead.
2880
2827
 
2881
2828
  ---
2882
2829
 
2883
- Source: /docs/example-agents/fsd.md
2884
-
2885
- # Hand PR triage to managed remote agents
2886
-
2887
- The remote PR coordinator keeps chat and routing on the local serve host,
2888
- then hands each pull request to a managed remote agent with a real checkout.
2889
- The same remote conversation resumes when a user drives the PR again, GitHub
2890
- reports a change, or a merge-conflict reminder fires.
2891
-
2892
- This example is Cursor-internal. For your own repos, scaffold
2893
- [PR autofixer](/docs/templates/pr-autofixer.md) instead.
2894
-
2895
- The workflow backend enrolls each remote run with a workflow MCP. Its tools
2896
- and the host's findings routes read and write the same external findings
2897
- service.
2898
-
2899
- Use this example when repository work is too heavy or concurrent for local
2900
- worktrees, but the host should still own intake, session identity, policy, and
2901
- bookkeeping.
2902
-
2903
- [Browse the current coordinator source.](https://github.com/cursor/cursor/tree/main/packages/agent-serve/examples/fsd/)
2904
-
2905
- ## Resume one remote agent across every PR wake
2906
-
2907
- The coordinator uses a hybrid runtime:
2908
-
2909
- - Ordinary playground and Slack chat run locally.
2910
- - The `drive_pr` server tool creates a remote session for one PR.
2911
- - The remote worker gets the repository and PR reference.
2912
- - An `agent.bound` hook records the remote run id and enrolls the run into a
2913
- workflow MCP.
2914
- - Webhooks and reminders resume the same remote agent through durable
2915
- PR-to-agent affinity.
2916
-
2917
- No other example moves one logical conversation across local chat, remote
2918
- execution, event wakes, and timed follow-ups.
2919
-
2920
- ## Follow a chat request
2921
-
2922
- 1. A user asks local chat or Slack to drive a PR.
2923
- 2. The root model calls `drive_pr` with the PR, mode, and optional hint.
2924
- 3. The tool calls `ctx.send("drive", ...)` with a per-session `cloud` block
2925
- to attach the PR.
2926
- 4. The Agent SDK creates or resumes the `drive` session keyed by
2927
- `pr:owner/repo#N`.
2928
- 5. The remote runtime provisions the agent and emits `agent.bound`.
2929
- 6. The enrollment hook writes PR affinity and calls the workflow backend to
2930
- attach run-scoped MCP tools.
2931
- 7. `drive_pr` waits for remote binding, then returns the agent id and URL.
2932
- If binding exceeds its wait window, those fields can be `null` while work
2933
- continues.
2934
- 8. The remote agent reads the host-prepared PR brief, checks unresolved state,
2935
- and records findings through the workflow MCP.
2936
- 9. The host forwards a validated fallback output block when MCP wasn't
2937
- available for the turn.
2938
-
2939
- The local chat agent doesn't have the target checkout, `gh`, `git`, or the
2940
- workflow MCP. Its job is coordination.
2941
-
2942
- A request for a merged or closed PR finishes before provisioning. That result
2943
- has `status: "finished"` and no remote session.
2944
-
2945
- ## Map the framework features
2946
-
2947
- | Capability | Source | Role |
2948
- | --- | --- | --- |
2949
- | Hybrid config | [`agent/agent.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/fsd/agent/agent.ts) | Keep chat local, set remote-runtime defaults, disable automatic PR creation, and isolate local harness workspaces. |
2950
- | Root instructions | [`agent/instructions.md`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/fsd/agent/instructions.md) | Separate local coordination from remote triage and define suggest/apply policy. |
2951
- | Drive tool | [`agent/tools/drive_pr.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/fsd/agent/tools/drive_pr.ts) | Hand a chat request to the `drive` channel and wait for remote binding. |
2952
- | Drive channel | [`agent/channels/drive.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/fsd/agent/channels/drive.ts) | Start remote work and expose findings read/write routes. |
2953
- | GitHub channel | [`agent/channels/github.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/fsd/agent/channels/github.ts) | Buffer PR, comment, review, check, and status wakes. |
2954
- | Slack channel | [`agent/channels/slack.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/fsd/agent/channels/slack.ts) | Route Slack requests to the local coordinator. |
2955
- | Hooks | [`agent/hooks/enroll-fsd.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/fsd/agent/hooks/enroll-fsd.ts), [`agent/hooks/record-outputs.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/fsd/agent/hooks/record-outputs.ts) | Bind remote identity, enroll MCP, and forward fallback findings. |
2956
- | Affinity and buffering | [`agent/lib/pr-affinity.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/fsd/agent/lib/pr-affinity.ts), [`agent/lib/webhook-buffer.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/fsd/agent/lib/webhook-buffer.ts) | Persist PR identity, sticky mode, and pending wakes. |
2957
- | Reminders | [`agent/lib/merge-conflict-watch.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/fsd/agent/lib/merge-conflict-watch.ts) | Recheck merge conflicts every 30 minutes. |
2958
- | Workflow client | [`agent/lib/fsd-platform.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/fsd/agent/lib/fsd-platform.ts) | Enroll external runs and read or record findings. |
2959
- | Storage | [`agent/storage.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/fsd/agent/storage.ts) | Persist sessions and events with `cursorHostedStorage`. |
2960
-
2961
- The coordinator has no authored skill, subagent, MCP connection, static
2962
- schedule, A/B experiment, eval, or tool approval.
2963
-
2964
- The workflow MCP is dynamic. Backend enrollment attaches it to the remote run,
2965
- so there is no file under `agent/mcp-connections/`.
2966
-
2967
- ## Understand local and remote workspaces
2968
-
2969
- The root config sets `runtime: "local"` because `drive_pr` is a server tool.
2970
- It also supplies remote-runtime defaults through the `cloud` configuration:
2971
-
2972
- ```ts
2973
- local: {
2974
- cwd: join(homedir(), ".cache", "agent-serve", "fsd"),
2975
- },
2976
- cloud: {
2977
- env: { type: "cloud" },
2978
- autoCreatePR: false,
2979
- },
2980
- ```
2981
-
2982
- The local cwd sits outside the monorepo, so inherited repository instructions
2983
- don't affect coordinator chat.
2984
-
2985
- Remote sessions get a repository attachment with the target PR. The worker starts
2986
- from the PR base and creates an automation side branch from the PR head only when
2987
- code context or a fix is needed. The serve host never checks out target code.
2988
-
2989
- ## Prepare access
2990
-
2991
- You need:
2992
-
2993
- - Node 22.13 or newer.
2994
- - An agent-runtime user credential.
2995
- - Access to a managed remote runtime.
2996
- - Access to the target GitHub PR.
2997
- - Access to the workflow backend and findings store.
2998
-
2999
- Keep the affinity and webhook-buffer files on durable storage for a
3000
- long-lived host.
3001
-
3002
- ## Validate without starting remote work
3003
-
3004
- ```bash
3005
- agent-sdk validate --dir examples/fsd
3006
- agent-sdk info --dir examples/fsd --json
3007
- agent-sdk github events --dir examples/fsd --json
3008
- ```
3009
-
3010
- These commands inspect discovery and declared GitHub events. They don't
3011
- provision a remote agent.
3012
-
3013
- ## Choose suggest or apply
3014
-
3015
- Every PR has a sticky mode:
3016
-
3017
- | Mode | Required remote behavior |
3018
- | --- | --- |
3019
- | `suggest` | May create verified commits on the VM's local side branch. Instructions require no pushes, comments, PR edits, or workflow actions. Records exact fixes and actions as findings for the owner. |
3020
- | `apply` | Pushes verified fixes to the existing PR head and may update metadata, reply to threads, mark a draft ready, rebase, or rerun CI. |
3021
-
3022
- The remote instructions forbid merging, enabling auto-merge, force-pushing,
3023
- and opening a new PR in both modes. `autoCreatePR: false` also disables the
3024
- SDK's automatic PR creation. The other restrictions are prompt policy, not a
3025
- deterministic host gate. `suggest` is the default.
3026
-
3027
- The selected mode is stored beside PR affinity. Webhooks and reminders reuse
3028
- it. Re-driving a PR can change the host-side mode. Backend enrollment records
3029
- the mode at first enrollment, so each later host prompt repeats the current
3030
- authoritative mode.
3031
-
3032
- > [!CAUTION]
3033
- > `apply` writes to the user's PR branch and triggers CI. Use `suggest` for
3034
- > development. Both modes provision a billed remote agent and can write
3035
- > structured findings to the findings service. `drive_pr` has no approval gate,
3036
- > and suggest/apply restrictions depend on the remote agent following its
3037
- > instructions.
3038
-
3039
- ## Start a suggest-mode drive
3040
-
3041
- Run the host:
3042
-
3043
- ```bash
3044
- agent-sdk dev examples/fsd
3045
- ```
3046
-
3047
- From chat:
3048
-
3049
- > Drive https://github.com/owner/repo/pull/123 in suggest mode.
3050
-
3051
- Or call the coordinator tool:
3052
-
3053
- ```bash
3054
- agent-sdk call drive_pr \
3055
- --dir examples/fsd \
3056
- --input '{"pr":"https://github.com/owner/repo/pull/123","mode":"suggest"}'
3057
- ```
3058
-
3059
- For an open PR, the tool waits up to 60 seconds for remote binding and returns:
3060
-
3061
- - the normalized PR label,
3062
- - session and continuation ids,
3063
- - the remote-agent id and URL when binding completes in that window,
3064
- - `status: "started"`, and
3065
- - the merge-conflict reminder id.
3066
-
3067
- It doesn't wait for findings. A slow binding can return `null` identifiers.
3068
- Open the returned agent URL when present to follow the remote run.
3069
-
3070
- ## Use the HTTP drive surface
3071
-
3072
- The custom channel starts the same orchestration:
3073
-
3074
- ```bash
3075
- curl -s -X POST \
3076
- http://127.0.0.1:3000/fsd/v1/channels/drive/ \
3077
- -H 'content-type: application/json' \
3078
- -d '{"pr":"owner/repo#123","mode":"suggest"}'
3079
- ```
3080
-
3081
- This route returns as soon as the channel session exists. The remote-agent id
3082
- can still be `null` at that point. Triage continues in the background.
3083
-
3084
- Read findings later:
3085
-
3086
- ```bash
3087
- curl -s \
3088
- 'http://127.0.0.1:3000/fsd/v1/channels/drive/findings?pr=owner/repo%23123'
3089
- ```
3090
-
3091
- The external findings service is the source of truth. The local host doesn't keep a second
3092
- findings database.
3093
-
3094
- The channel also exposes `POST /findings` as a testing surface. It validates
3095
- outputs, then writes them to the findings service for a PR already bound by this
3096
- host. The route has no approval gate. Keep it under the default loopback auth
3097
- or another trusted boundary.
3098
-
3099
- ## Keep one remote agent per PR
3100
-
3101
- Within the `drive` channel, the stable continuation token
3102
- `pr:owner/repo#N` resumes the same session. GitHub sessions are scoped to
3103
- another channel, so a continuation token alone can't bridge them.
3104
-
3105
- The enrollment hook closes that gap:
3106
-
3107
- 1. Read the PR from the continuation token or host-authored session title.
3108
- 2. Record PR to `sdkAgentId` affinity after `agent.bound`.
3109
- 3. Seed later sessions with the same remote id.
3110
- 4. Retry workflow MCP enrollment after a completed turn when the first RPC
3111
- failed.
3112
-
3113
- This lets Slack, HTTP drive, GitHub, and reminders talk to one remote
3114
- conversation without sharing one channel session.
3115
-
3116
- ## Buffer GitHub wakes
3117
-
3118
- The GitHub channel handles pull requests, comments, reviews, check suites,
3119
- check runs, and selected status events. It doesn't send payload details to the
3120
- model. It asks the remote agent to refresh live source of truth.
3121
-
3122
- The buffer:
3123
-
3124
- - groups events by PR,
3125
- - waits three seconds for a burst to settle,
3126
- - re-buffers while CI settles,
3127
- - skips a flush when the PR session is busy,
3128
- - tries to write its snapshot before acknowledging a wake, and
3129
- - restores pending entries when the channel starts.
3130
-
3131
- Closing a PR discards its pending entry and cancels its reminders.
3132
-
3133
- Snapshot persistence is best-effort. Write failures are swallowed silently,
3134
- so a delivery can still be acknowledged without a durable snapshot.
3135
-
3136
- This is the high-volume counterpart to a direct `{ auth }` GitHub wake. See
3137
- [GitHub](/docs/guides/github.md#handle-high-event-volume) for the reusable
3138
- pattern.
3139
-
3140
- ## Add merge-conflict checks
3141
-
3142
- Starting a drive arms one recurring reminder per PR. Every 30 minutes the host
3143
- checks mergeability:
3144
-
3145
- - closed or merged stops the reminder,
3146
- - clean skips delivery,
3147
- - conflicting sends a follow-up to the owning session, and
3148
- - a busy session skips the wake.
3149
-
3150
- This uses runtime reminders, not a static `agent/schedules/` file. The host
3151
- creates, lists, replaces, and cancels reminders through `host.reminders`.
3152
- Development mode doesn't fire reminder timers automatically. Dispatch one
3153
- through the dev reminder endpoint for a manual proof, or use non-dev `serve`
3154
- to run the 30-minute cadence.
3155
-
3156
- The reminder's `run` handler lives in memory. After a host restart, the Agent SDK
3157
- disarms it with `handler_lost_on_restart`; a later drive or webhook path can
3158
- arm a fresh handler. Persisted reminder metadata alone doesn't keep the check
3159
- running.
3160
-
3161
- ## Record findings with MCP or a fallback
3162
-
3163
- After enrollment, the remote agent receives workflow tools for:
3164
-
3165
- - recording and updating outputs,
3166
- - listing current outputs,
3167
- - reading PR metadata,
3168
- - reading CI state, and
3169
- - reading review comments.
3170
-
3171
- The main output is a structured workflow suggestion or code-change reference.
3172
- The remote prompt requires findings as soon as each action becomes clear.
3173
-
3174
- If enrollment races or MCP is unavailable, the agent writes one fenced
3175
- fallback JSON block. The host validates allowed kinds, actions, statuses, and
3176
- the 140-character finding body before forwarding it to the same findings
3177
- service. The output hook catches fallback blocks from webhook and reminder
3178
- turns.
3179
-
3180
- ## Verify the host logic
3181
-
3182
- The coordinator has no filesystem evals. Its unit tests cover mode parsing, drive
3183
- orchestration, affinity, webhook durability, CI settlement, output parsing,
3184
- reminders, and Slack configuration:
3185
-
3186
- ```bash
3187
- pnpm exec vitest run examples/fsd/agent/lib
3188
- ```
3189
-
3190
- Use those tests for host policy. Use a dedicated test PR and suggest mode for
3191
- the end-to-end remote path.
3192
-
3193
- ## Build another hybrid coordinator
3194
-
3195
- Use this architecture when each work item needs a real checkout:
3196
-
3197
- 1. Keep conversational intake local.
3198
- 2. Open a remote session only after the request identifies a work item.
3199
- 3. Give the work item a stable continuation key.
3200
- 4. Persist its remote-agent id for cross-channel resume.
3201
- 5. Coalesce noisy events before spending another turn.
3202
- 6. Put the current mode and permissions in every host prompt.
3203
- 7. Record outputs incrementally in a durable sink.
3204
- 8. Add reminders for state requiring periodic rechecks.
3205
-
3206
- ## Where to go next
3207
-
3208
- - [Cloud runtime](/docs/guides/cloud-runtime.md)
3209
- - [GitHub](/docs/guides/github.md)
3210
- - [Webhooks and custom channels](/docs/guides/webhooks.md)
3211
- - [Schedules and reminders](/docs/reference/schedules.md)
3212
- - [Sessions and streaming](/docs/reference/sessions.md)
3213
- - [Deployment](/docs/deployment.md)
3214
-
3215
- ---
3216
-
3217
2830
  Source: /docs/example-agents/index.md
3218
2831
 
3219
2832
  # Choose the right Agent SDK example
@@ -3225,7 +2838,7 @@ design.
3225
2838
 
3226
2839
  The source projects live under
3227
2840
  [`examples/`](https://github.com/cursor/cursor/tree/main/packages/agent-serve/examples/). Run the commands below from
3228
- `packages/agent-serve`. See [Run the CLI](/docs/index.md#run-the-cli) if the
2841
+ this package. See [Run the CLI](/docs/index.md#run-the-cli) if the
3229
2842
  `agent-sdk` command isn't installed.
3230
2843
 
3231
2844
  ## Compare the examples
@@ -3239,8 +2852,7 @@ The source projects live under
3239
2852
  | [Alert investigator](/docs/example-agents/oncall.md) | Local | Watched Slack alerts channel | Bot-post channel watching, per-thread debounce, reminder tools, and host Slack calls | Every alert gets a thread-pinned investigation that schedules its own re-checks. |
3240
2853
  | [PR evidence reviewer](/docs/example-agents/bugbot.md) | Local | Custom HTTP and Slack | Host tool, skill, seeded workspaces, and an eval | The model receives a prepared diff-first evidence tree instead of a checkout. |
3241
2854
  | [Approval Buddy](/docs/example-agents/approval-buddy.md) | Local | GitHub and Slack | Policy tools, two subagents, durable storage, and evals | Code decides whether a PR may be approved. Reviews stay informational. |
3242
- | [Security Reviewer](/docs/example-agents/security-reviewer.md) | Local host pipeline | GitHub and chat | Staged tools, parallel SDK agents, progress UI, durable storage, A/B, and evals | Lives in `factory/security-reviewer/`. Reviewers and triage overlap while the playground shows every stage. |
3243
- | [Remote PR coordinator](/docs/example-agents/fsd.md) | Local coordinator and remote PR sessions | HTTP, GitHub, and Slack | Remote handoff, hooks, affinity, buffering, reminders, and workflow MCP | One remote conversation follows a PR across chat, webhooks, and timed wakes. |
2855
+ | [Security Reviewer](/docs/example-agents/security-reviewer.md) | Local host pipeline | GitHub and chat | Staged tools, parallel SDK agents, progress UI, durable storage, A/B, and evals | Reviewers and triage overlap while the playground shows every stage. |
3244
2856
  | [Knowledge base](/docs/example-agents/knowledge-base.md) | Local | Built-in HTTP chat | Durable host-side state, a conventions skill, a schedule, unit tests, and evals | People curate shared facts in chat, and fresh sessions retrieve them from markdown. |
3245
2857
  | [Codebase wiki](/docs/example-agents/codebase-wiki.md) | Local | GitHub and chat | Task-dispatch webhooks, seeded digests, a mapping skill, a schedule, and evals | Merged PRs accumulate into per-feature wiki pages with a daily digest. |
3246
2858
  | [Codeowners review](/docs/example-agents/codeowners-review.md) | Local | GitHub, chat, and fixtures | Ownership routing in code, playbook data files, parallel subagents, and evals | Each product area reviews with its own playbook, and verdicts aggregate mechanically. |
@@ -3261,8 +2873,8 @@ Use this order when you want to learn the Agent SDK one capability at a time:
3261
2873
  6. Study [PR evidence reviewer](/docs/example-agents/bugbot.md) before giving a model repository
3262
2874
  evidence.
3263
2875
  7. Move policy into code with [Approval Buddy](/docs/example-agents/approval-buddy.md).
3264
- 8. Compare [Security Reviewer](/docs/example-agents/security-reviewer.md) and
3265
- [Remote PR coordinator](/docs/example-agents/fsd.md) for host-side versus remote PR work.
2876
+ 8. Study [Security Reviewer](/docs/example-agents/security-reviewer.md) for host-side PR
2877
+ work.
3266
2878
  9. See parallel subagent delegation carry team judgment in
3267
2879
  [Codeowners review](/docs/example-agents/codeowners-review.md).
3268
2880
  10. Curate team context through conversation with
@@ -3285,9 +2897,7 @@ Several examples need more:
3285
2897
  - GitHub examples require access to the target repository. Codebase wiki and
3286
2898
  Codeowners review call the host `gh` CLI for PR data; the codeowners
3287
2899
  fixtures run without network.
3288
- - Example agents use `cursorHostedStorage` (`agent/storage.ts`) for Cursor-hosted session storage (control-plane proxy).
3289
- - Remote PR coordinator starts remote agent sessions and needs access to its
3290
- workflow backend.
2900
+ - Example agents use `cursorHostedStorage` in `agent/storage.ts` for hosted session storage. See [Storage](/docs/storage.md).
3291
2901
 
3292
2902
  Each guide lists its own credentials, services, and side effects.
3293
2903
 
@@ -3339,8 +2949,8 @@ feature documentation instead.
3339
2949
 
3340
2950
  ## Keep shared knowledge on the filesystem
3341
2951
 
3342
- The knowledge base lives outside any session workspace, in
3343
- `.agent-serve/wiki/` by default. `KNOWLEDGE_BASE_DIR` overrides the location,
2952
+ The knowledge base lives outside any session workspace, in a wiki
2953
+ directory on the serve host by default. `KNOWLEDGE_BASE_DIR` overrides the location,
3344
2954
  and the tools resolve it on every call, so tests and evals can point the same
3345
2955
  code at a temp directory.
3346
2956
 
@@ -3885,10 +3495,10 @@ findings, accounting, and audit events.
3885
3495
 
3886
3496
  ## Separate session storage from review artifacts
3887
3497
 
3888
- `defineStorage` + `cursorHostedStorage` sends Agent SDK session and event records
3889
- to Cursor-hosted Bugbot storage through the control-plane proxy. Security
3890
- Reviewer sets `restore: "off"` so startup doesn't load old review sessions in
3891
- bulk. A continuation lookup can still fetch a needed session.
3498
+ `cursorHostedStorage` keeps Agent SDK session and event records on
3499
+ Cursor-managed hosting. Security Reviewer sets `restore: "off"` so startup
3500
+ doesn't load old review sessions in bulk. A continuation lookup can still
3501
+ fetch a needed session. See [Storage](/docs/storage.md).
3892
3502
 
3893
3503
  The staged review files are separate from session storage. Session-store
3894
3504
  durability doesn't preserve those files. All stages for one `runId` must see
@@ -3910,7 +3520,7 @@ instruction overlay asking chat and playground summaries to lead with high
3910
3520
  and critical findings. Full artifacts, `finalResponse`, and finding counts
3911
3521
  still include every finding. Stage-tool counters appear in the
3912
3522
  playground A/B view. Local sample and snapshot files persist under
3913
- `.agent-serve/`.
3523
+ the project state directory.
3914
3524
 
3915
3525
  When a treatment session has only low or medium findings, the filtered review
3916
3526
  body currently says no vulnerabilities were found even though artifacts and
@@ -4274,8 +3884,8 @@ A real call writes `vm-tool-observations/<id>.json` in the agent cwd and
4274
3884
  returns hostname, cwd, and pid. Stream events show `probe:probe_cloud_tool`,
4275
3885
  not `shell`.
4276
3886
 
4277
- A local `.agent-serve/tools/probe_cloud_tool.sh` or a marker under `probes/`
4278
- means the model invented a substitute.
3887
+ A local tool script or a marker under `probes/` means the model
3888
+ invented a substitute.
4279
3889
 
4280
3890
  ```bash
4281
3891
  agent-sdk run --dir examples/weather-agent \
@@ -4390,7 +4000,8 @@ hash:
4390
4000
  - `treatment` adds a brief Celsius instruction and changes `get_weather` to
4391
4001
  return Celsius fields.
4392
4002
 
4393
- Samples and aggregate snapshots persist under `.agent-serve/`. The treatment
4003
+ Samples and aggregate snapshots persist under the project state
4004
+ directory. The treatment
4394
4005
  only changes current conditions; `get_forecast` still returns Fahrenheit.
4395
4006
  Treat the branch as an example of `ctx.session.abs`, not a complete unit
4396
4007
  policy.
@@ -4442,7 +4053,7 @@ same. A peer MCP connection makes the wiring one line.
4442
4053
  This guide wires a `concierge` agent that delegates weather questions
4443
4054
  to a `weather-agent` peer mounted on the same host.
4444
4055
 
4445
- ## The MCP endpoint
4056
+ ## MCP endpoint
4446
4057
 
4447
4058
  Each agent serves the Model Context Protocol over streamable HTTP at
4448
4059
  `/<slug>/v1/mcp` (or `/v1/mcp` in single mode). The surface is stateless
@@ -4610,34 +4221,21 @@ mapping shifts:
4610
4221
  | `instructions.*` | `AGENTS.md` in the session workspace | prepended to the first prompt |
4611
4222
  | Server tools (`execution: "server"`) | in-process SDK custom tools | authenticated HTTP MCP back to the AgentSDK host, when `--public-url` or `--cloud-tools-url` is set |
4612
4223
  | Agent tools (`execution: "agent"`) | scripts in the session workspace | catalog + script bodies on the first prompt |
4613
- | `skills/*` | `.cursor/skills/` in the workspace | native discovery from the Agent Store (`skills/` on hosted deployments; `agent-serve/<agent>/skills/` on the USER store for local serve/run) |
4224
+ | `skills/*` | `.cursor/skills/` in the workspace | native discovery after the first turn, from the hosted store or the signed-in account |
4614
4225
  | `mcp-connections/*.ts` | SDK `mcpServers` | SDK `mcpServers` (peers need `--public-url`) |
4615
4226
  | `sandbox/workspace/**` | seeded into the session workspace | ignored |
4616
4227
  | Tool approvals (`needsApproval`) | supported | not supported; keep approval-gated tools on local turns |
4617
4228
 
4618
- Authored skills copy onto an Agent Store on the first cloud turn so the
4619
- VM discovers them natively. Hosted deployments write the deployment
4620
- store's `skills/` directory; local `serve`/`run` with a personal API
4621
- key writes `agent-serve/<agent>/skills/` on the USER store.
4622
-
4623
- Hosted deployments configure the server-tool MCP URL automatically
4624
- (`cloudToolsUrl`, authenticated with the resolved Cursor API key). A
4625
- self-hosted public server needs `--public-url` (and `--bearer-token` when the
4626
- host is not behind another trusted authentication boundary) so cloud turns
4627
- can reach those tools. Without either, the server warns at startup and
4628
- cloud turns omit the server tools.
4229
+ Authored skills are discovered natively after the first cloud turn,
4230
+ using the hosted store or the signed-in account.
4629
4231
 
4630
4232
  Approvals are a local-runtime contract. On cloud, a `needsApproval` tool
4631
4233
  call rides one HTTP MCP request from the VM, and a parked call would
4632
4234
  hold that request open until it times out; there is no durable approval
4633
4235
  flow for cloud turns.
4634
4236
 
4635
- Two more behaviors are cloud-specific. Sessions persist a separate SDK
4636
- agent id (`bc-…`), emitted on the stream as `agent.bound` with a URL to
4637
- the cloud conversation. Cloud ids are minted during the first send. And
4638
- peer MCP connections resolve to `--public-url` for cloud turns, because a VM
4639
- cannot reach the host's loopback; without one, peers are omitted from
4640
- cloud turns and the server warns at startup.
4237
+ Peer MCP connections need `--public-url` for cloud turns. Without one,
4238
+ peers are omitted and the server warns at startup.
4641
4239
 
4642
4240
  ## Hybrid: local agent, cloud sessions
4643
4241
 
@@ -4652,12 +4250,8 @@ base that per-session options merge over.
4652
4250
 
4653
4251
  These come from running a PR driver against real PR traffic:
4654
4252
 
4655
- - One cloud agent per unit of work (per PR, say). Store the `bc-…` id
4656
- keyed by the work unit (an affinity store written from an
4657
- `agent.bound` hook) so webhook wakes resume the same conversation
4658
- instead of booting a fresh VM per event.
4659
- - Stable continuation keys (`pr:owner/repo#N`) so every wake lands on
4660
- the same session within a channel.
4253
+ - One cloud session per unit of work, keyed with a stable continuation
4254
+ token (`pr:owner/repo#N`) so every wake lands on the same conversation.
4661
4255
  - Keep the host deterministic: fetch briefs and metadata on the host,
4662
4256
  send the VM a compact prompt, and let the VM re-read source of truth
4663
4257
  with its own `gh` and `git` instead of trusting payload snapshots.
@@ -4677,7 +4271,7 @@ driving channels directly.
4677
4271
  Continue with these pages:
4678
4272
 
4679
4273
  - [Agent config](/docs/reference/agent-config.md): the `runtime` and
4680
- `cloud` fields precisely
4274
+ `cloud` fields
4681
4275
  - [GitHub guide](/docs/guides/github.md): the webhook patterns that pair with
4682
4276
  cloud triage
4683
4277
 
@@ -4724,9 +4318,9 @@ cd nightly-triage
4724
4318
  ```
4725
4319
 
4726
4320
  The command fetches the Automation before writing files. A 404 means it
4727
- was not found, you do not have access, or the `agent_serve_mvp` feature
4728
- gate is off for your team. A 422 means it is Cursor-managed. The command
4729
- writes nothing after either error.
4321
+ was not found, you do not have access, or convert is not enabled for
4322
+ your team. A 422 means it is Cursor-managed. The command writes nothing
4323
+ after either error.
4730
4324
 
4731
4325
  The command runs `npm install` after writing the project. If the install
4732
4326
  fails, the files remain. Run `npm install` in the output directory
@@ -4907,8 +4501,9 @@ Choose `permissions` by what the agent needs:
4907
4501
  `contents-write` is an explicit opt-up. `progress.commitStatus` posts a
4908
4502
  GitHub check run (`checks:write`). Hosted `cursorAccount` mints that
4909
4503
  permission on `"contents-write"` tokens. Enabling `commitStatus` opts a
4910
- `"pr-write"` channel up to that tier so github-proxy can post the check.
4911
- `"pr-write"` without `commitStatus` is enough for comments and banners.
4504
+ `"pr-write"` channel up to that tier because it needs check-write
4505
+ permission. `"pr-write"` without `commitStatus` is enough for comments
4506
+ and banners.
4912
4507
  Prefer `"pr-write"` unless the agent must push or post a merge-box check.
4913
4508
 
4914
4509
  Set `checks: true` when channel code posts its own Checks API runs through
@@ -4928,10 +4523,9 @@ Repeat `--repo` for each repository. The stream and credential are
4928
4523
  resolved as the signed-in Cursor principal. `serve` refuses to start
4929
4524
  signed out.
4930
4525
 
4931
- Offset and consumer id live under `<state-root>/cursor-events/`.
4932
- `CURSOR_API_BASE_URL` overrides the backend. The stream carries event
4933
- metadata, not full webhook bodies, so your agent should re-read the PR
4934
- or checks from GitHub instead of trusting a snapshot in the wake.
4526
+ The stream carries event metadata, not full webhook bodies, so your
4527
+ agent should re-read the PR or checks from GitHub instead of trusting a
4528
+ snapshot in the wake.
4935
4529
 
4936
4530
  This is the preferred production path: no public URL, no repo admin
4937
4531
  webhook, and no inbound network for GitHub deliveries.
@@ -4969,7 +4563,7 @@ things:
4969
4563
  | `{ task }` | Host-side work. The delivery is 202-ACKed immediately and the task runs past GitHub's ~10-second timeout. No chat session. |
4970
4564
  | `null` | Skip this delivery. |
4971
4565
 
4972
- `{ auth }` may also carry `workspaceFiles` the same session seed Slack
4566
+ `{ auth }` may also carry `workspaceFiles`, the same session seed Slack
4973
4567
  and `send()` use. Pass a function to fetch after a 202 so I/O can miss
4974
4568
  GitHub's ~10s window.
4975
4569
 
@@ -5056,9 +4650,7 @@ These patterns come from running a PR agent against real traffic:
5056
4650
  - Persist the buffer in `host.kv` before you acknowledge a wake, and
5057
4651
  restore it on channel start. A restart must not drop buffered wakes.
5058
4652
  - Key sessions with a stable continuation token (`pr:owner/repo#N`) so
5059
- every wake resumes the PR's conversation. Cross-channel resume needs
5060
- an affinity store mapping PR → SDK agent id; write it from an
5061
- `agent.bound` hook with `ctx.host.kv`.
4653
+ every wake resumes the PR's conversation.
5062
4654
  - Keep payload details out of wake prompts. Send a generic "re-check
5063
4655
  the PR" and let the agent re-read source of truth instead of trusting a
5064
4656
  stale snapshot.
@@ -5120,19 +4712,9 @@ behavior. Reactions still default on; set `reactions: false` when the
5120
4712
  eyes emoji is noise. Descriptions are optional; defaults derive from
5121
4713
  `botName` or the check `context`.
5122
4714
 
5123
- The check run posts to `channel.state.headSha`. PR and CI wakes seed and
5124
- refresh it (`refreshState` on continuation). A first wake that is only an
5125
- `issue_comment` has no head SHA in the payload, so the check is skipped until
5126
- a PR/CI wake stores one; the banner still posts. Review-comment wakes
5127
- carry `pull_request.head.sha` when GitHub includes it.
5128
-
5129
- The sticky comment id and latest check-run id live on durable
5130
- `GitHubChannelState` (session record). Each wake also passes `refreshState`
5131
- so `headSha` / refs update on continuation without wiping those ids. A later
5132
- turn on the same SHA creates a new check run — GitHub cannot reopen a
5133
- completed run. Persist other derived state
5134
- with `ctx.host.kv` or `ctx.host.files`. `stateRoot` resets on hosted
5135
- replace.
4715
+ A comment-only first wake has no head SHA, so the check waits for a
4716
+ PR or CI event. The banner still posts. A later turn on the same SHA
4717
+ creates a new check run; GitHub cannot reopen a completed run.
5136
4718
 
5137
4719
  Override `events` when the mapping is custom. [Approval Buddy](/docs/example-agents/approval-buddy.md)
5138
4720
  posts commit status from `turn.started` / `action.result` / `turn.failed`
@@ -5299,8 +4881,8 @@ The companion skill is
5299
4881
 
5300
4882
  - Authorize `defineConnection({ url, oauth: true })` with a browser PKCE
5301
4883
  flow (`agent-sdk mcp oauth <connection>`)
5302
- - Keep tokens in `~/.config/agent-serve/mcp-auth.json`, bound to that
5303
- connection's resource URL
4884
+ - Keep tokens in `mcp-auth.json` under the CLI config directory, bound
4885
+ to that connection's resource URL
5304
4886
  - Upsert deployment secrets with `--store` so hosted engines seed the
5305
4887
  same tokens from env
5306
4888
  - Keep privileged servers off the model with `hostOnly: true` while
@@ -5378,8 +4960,8 @@ What happens:
5378
4960
  `oauth: true`
5379
4961
  2. It opens the authorization URL in your browser
5380
4962
  3. The callback lands on `http://localhost:8787/callback`
5381
- 4. Tokens land in `~/.config/agent-serve/mcp-auth.json` (override the
5382
- config dir with `AGENT_SERVE_CONFIG_DIR`)
4963
+ 4. Tokens land in `mcp-auth.json` under the CLI config directory
4964
+ (override with `AGENT_SERVE_CONFIG_DIR`)
5383
4965
 
5384
4966
  If you're already authorized, the command prints that and exits. Re-run
5385
4967
  it after rotating tokens on the MCP server, or after you change the
@@ -5786,7 +5368,7 @@ writes `<PREFIX>_SLACK_BOT_TOKEN` and `<PREFIX>_SLACK_APP_TOKEN` into
5786
5368
  [below](#wire-the-env-and-verify).
5787
5369
 
5788
5370
  If Slack needs a workspace admin to approve the app, keep the CLI
5789
- running. Managed install does not file the request open Slack's
5371
+ running. Managed install does not file the request. Open Slack's
5790
5372
  **Request approval** page (the CLI prints the link; the same URL is
5791
5373
  **Send a reminder** after you submit). After an admin approves, click
5792
5374
  **Retry** in the wizard.
@@ -5849,9 +5431,9 @@ option.
5849
5431
  agent-sdk slack init --manual --dir . --name "My Agent"
5850
5432
  ```
5851
5433
 
5852
- That writes `agent/channels/slack.ts`, importable manifests at
5853
- `.agent-serve/slack/manifest.{dev,prod}.json`, `env.example`, and
5854
- `setup-status.json`. `--no-prefix` uses shared `SLACK_*` variables on
5434
+ That writes `agent/channels/slack.ts`, Slack manifests under the
5435
+ project state directory, `env.example`, and `setup-status.json`.
5436
+ `--no-prefix` uses shared `SLACK_*` variables on
5855
5437
  a single-agent host. `--prefix CUSTOM` overrides the directory-derived
5856
5438
  prefix. `--channel-posts` subscribes the manifests to channel-post
5857
5439
  events.
@@ -6017,8 +5599,8 @@ mechanism. This page is the mechanism itself.
6017
5599
  The built-in HTTP channel is always mounted (under `/<slug>` in the
6018
5600
  default multi-agent layout). `POST /v1/session` starts a conversation,
6019
5601
  `POST /v1/session/:id` follows up, and `GET /v1/session/:id/stream`
6020
- streams NDJSON events, plus sessions, approvals, and tool routes. The
6021
- full list is in the [HTTP API reference](/docs/reference/http-api.md).
5602
+ streams NDJSON events, plus sessions, approvals, and tool routes. See
5603
+ the [HTTP API reference](/docs/reference/http-api.md).
6022
5604
 
6023
5605
  Write a custom channel when that shape doesn't fit: a webhook with its
6024
5606
  own payload contract, a surface that keys sessions by a domain id, or a
@@ -6452,7 +6034,7 @@ Start with curl and saved payloads under `fixtures/`. The playground's
6452
6034
  endpoint, has Copy curl, and opens the created session on a successful
6453
6035
  Try. For regression coverage, drive the same behavior through an eval,
6454
6036
  or keep channel logic deterministic in `agent/lib/` and unit-test it
6455
- there. When something looks wrong, read the session's `events.ndjson`.
6037
+ there. When something looks wrong, inspect the session event stream.
6456
6038
  The stream is the record of what happened.
6457
6039
 
6458
6040
  For GitHub specifically, don't hand-roll fixtures.
@@ -6525,7 +6107,7 @@ Pin the input first. A moving fixture is noise. For GitHub agents, use `agent-sd
6525
6107
 
6526
6108
  ## How do I run one hillclimb round?
6527
6109
 
6528
- **Measure.** Hit the agent the way a user would: playground, channel HTTP, or Slack in `--dev`. Or ask the hillclimb skill to do it. `agent-sdk run` returns a JSON trajectory and writes a trace under `.agent-serve/traces/`.
6110
+ **Measure.** Hit the agent the way a user would: playground, channel HTTP, or Slack in `--dev`. Or ask the hillclimb skill to do it. `agent-sdk run` returns a JSON trajectory and writes a trace under the project state directory.
6529
6111
 
6530
6112
  **Reflect.** Score the trajectory, not impressions. Was the answer right? Did the model thrash (too many tools, fat evidence, grep loops)? Did it invent work the host should have prepared? Name the single dominant problem for this round in one sentence. Example: "Full-file dumps trigger grep loops."
6531
6113
 
@@ -6666,8 +6248,8 @@ npx @cursor/july docs
6666
6248
 
6667
6249
  **Example agents**
6668
6250
 
6669
- - [Choose the right example](/docs/example-agents/index.md): compare all twelve
6670
- agents by runtime, channels, tools, state, and architecture.
6251
+ - [Choose the right example](/docs/example-agents/index.md): compare the
6252
+ example agents by runtime, channels, tools, and state.
6671
6253
  - [Weather agent](/docs/example-agents/weather-agent.md): explore tools, MCP,
6672
6254
  approvals, skills, subagents, schedules, hooks, A/B metrics, and evals.
6673
6255
  - [Slack agent](/docs/example-agents/slack-agent.md): put a minimal agent in
@@ -6684,8 +6266,6 @@ npx @cursor/july docs
6684
6266
  in code while subagents supply review findings.
6685
6267
  - [Security Reviewer](/docs/example-agents/security-reviewer.md): run a staged,
6686
6268
  parallel security pipeline with live playground progress.
6687
- - [Remote PR coordinator](/docs/example-agents/fsd.md): hand PR triage from local
6688
- chat and webhooks to durable remote sessions.
6689
6269
  - [Knowledge base](/docs/example-agents/knowledge-base.md): turn conversations
6690
6270
  about people, systems, decisions, and preferences into shared markdown.
6691
6271
  - [Codebase wiki](/docs/example-agents/codebase-wiki.md): ingest merged PRs into
@@ -6722,12 +6302,6 @@ npx @cursor/july docs
6722
6302
  Docs use `agent-sdk <command>`. If it isn't on `PATH`, use
6723
6303
  `npx @cursor/july <command>`.
6724
6304
 
6725
- From `packages/agent-serve` in a source checkout:
6726
-
6727
- ```bash
6728
- alias agent-sdk="pnpm exec tsx $PWD/src/bin/agent-serve.ts"
6729
- ```
6730
-
6731
6305
  ## Credentials
6732
6306
 
6733
6307
  Sign in to Cursor or set `CURSOR_API_KEY`:
@@ -6767,7 +6341,7 @@ review. Add GitHub event handling so pull requests can trigger reviews.
6767
6341
  - Node 22.13 or newer. Bun isn't supported.
6768
6342
  - Run commands as `agent-sdk <command>`, or use
6769
6343
  `npx @cursor/july <command>` when the CLI isn't on `PATH`. See
6770
- [Run the CLI](/docs/index.md#run-the-cli) for monorepo checkouts and other setups.
6344
+ [Run the CLI](/docs/index.md#run-the-cli) if `agent-sdk` is not on `PATH`.
6771
6345
  - A Cursor credential for model turns. Sign in once:
6772
6346
 
6773
6347
  ```bash
@@ -7185,8 +6759,8 @@ model: "composer-2.5",
7185
6759
  ## Choose a runtime
7186
6760
 
7187
6761
  `runtime: "local"` (the default) runs turns on the Cursor SDK harness on
7188
- this machine. The session id doubles as the SDK agent id, and server
7189
- tools, skills, sandbox seeds, and tool approvals all apply.
6762
+ this machine. Server tools, skills, sandbox seeds, and tool approvals
6763
+ all apply.
7190
6764
 
7191
6765
  `runtime: "cloud"` runs turns on Cursor cloud agents (`bc-…` ids). Pass
7192
6766
  a `cloud` block with the repos the VM carries. Server tools stay
@@ -7230,8 +6804,8 @@ it.
7230
6804
 
7231
6805
  Session workspaces are real Cursor project directories. The harness loads
7232
6806
  `AGENTS.md` and `.cursor` config from ancestor directories. An agent nested
7233
- in another git repo (a monorepo package) defaults to
7234
- `~/.cache/agent-serve/<dir>` when you omit `cwd`, so the enclosing checkout
6807
+ in another git repo (a monorepo package) defaults to a per-project
6808
+ cache directory under `~/.cache` when you omit `cwd`, so the enclosing checkout
7235
6809
  does not leak rules, skills, or MCP servers into the turn. A standalone git
7236
6810
  root keeps the in-project session workspace. Point `cwd` at a checkout only
7237
6811
  when the agent should inherit that tree.
@@ -7253,7 +6827,7 @@ export default defineAgent({
7253
6827
  });
7254
6828
  ```
7255
6829
 
7256
- Agent Serve always adds `"mcp"` to a configured allowlist. Authored
6830
+ The Agent SDK always adds `"mcp"` to a configured allowlist. Authored
7257
6831
  server tools in `agent/tools/` use MCP to reach the model. MCP can also
7258
6832
  expose declared connections and servers from the harness directory's
7259
6833
  ambient `.cursor` config. To exclude a checkout's MCP servers, point
@@ -7274,7 +6848,7 @@ Two names have broader effects:
7274
6848
 
7275
6849
  Tool allowlists work only with the local runtime. A
7276
6850
  `runtime: "cloud"` agent that sets `tools` fails at serve startup.
7277
- Agent Serve also refuses per-send cloud sessions from a hybrid agent
6851
+ The Agent SDK also refuses per-send cloud sessions from a hybrid agent
7278
6852
  with an allowlist. It won't run those sessions with unrestricted tool
7279
6853
  access.
7280
6854
 
@@ -7282,7 +6856,7 @@ The allowlist controls which tools the model can call. It does not
7282
6856
  isolate the serve host. For agents that process untrusted input, also
7283
6857
  set `local: { sandbox: true }`.
7284
6858
 
7285
- ## The `cloud` block
6859
+ ## Cloud options
7286
6860
 
7287
6861
  Cloud agent defaults forwarded to the Cursor SDK: `repos` (each
7288
6862
  `{ url, startingRef? }`), environment selection, `envVars`, and the
@@ -7354,13 +6928,8 @@ console.log(`listening on ${handle.url}`);
7354
6928
  // handle.createReminder(...), handle.project, await handle.close()
7355
6929
  ```
7356
6930
 
7357
- `ServeOptions` mirrors the CLI flags: `port`, `host`, `dev`,
7358
- `stateRoot`, `apiKey`, `schedules`, `reminders`, `noControlPlane`,
7359
- `playground`, `docs`, `authToken` (the `--bearer-token` equivalent),
7360
- `allowAnonymous`, `allowAnonymousCursorGithub`,
7361
- `allowAnonymousCursorAccountMcp`, `cursorGithubProxy`, `publicUrl`,
7362
- `cloudToolsUrl`, `cursorEvents`, and `logger`. `serve()` additionally
7363
- accepts `discovery` (project-loading options) and
6931
+ Host settings match the documented [CLI](/docs/reference/cli.md) `serve` flags.
6932
+ `serve()` also accepts `discovery` (project-loading options) and
7364
6933
  `mode: "single" | "multi"`. The Cursor credential resolves in one order
7365
6934
  everywhere: explicit `apiKey`, then `CURSOR_API_KEY`, then the key
7366
6935
  stored by `agent-sdk login`.
@@ -7373,7 +6942,7 @@ Continue with these pages:
7373
6942
  agent
7374
6943
  - [Cloud runtime](/docs/guides/cloud-runtime.md): when and how to leave
7375
6944
  the host
7376
- - [CLI](/docs/reference/cli.md): the flags `ServeOptions` mirrors
6945
+ - [CLI](/docs/reference/cli.md): the `serve` flags `serve()` accepts
7377
6946
 
7378
6947
  ---
7379
6948
 
@@ -7504,7 +7073,7 @@ under `/v1/channels/<id>`. The Slack and GitHub packs are prebuilt
7504
7073
  channels with platform transports. This page is the authoring reference;
7505
7074
  for the walkthrough, see the [Webhooks guide](/docs/guides/webhooks.md).
7506
7075
 
7507
- ## The built-in HTTP channel
7076
+ ## Built-in HTTP channel
7508
7077
 
7509
7078
  It's always mounted, under `/<slug>` in the default multi-agent layout:
7510
7079
  session create, follow-up, stream, stop, the sessions list, approvals,
@@ -7625,11 +7194,9 @@ Handlers receive the Fetch `Request` and an args object:
7625
7194
  `"coalesce"` enqueues behind the running turn, the
7626
7195
  [Slack policy](/docs/reference/sessions.md#what-happens-when-i-send-a-follow-up)),
7627
7196
  `workspaceFiles`, `workspaceDir`, `cloud` (attach cloud repos for this
7628
- session), `auth` (defaults to the request principal), `sdkAgentId`
7629
- (resume a specific SDK agent), `state` (starting channel state for new
7630
- sessions), `title` (session display title), `purpose` (`"eval"` skips
7631
- sticky A/B enrollment), and `coalesceSourceTs` (dedupe key for coalesce
7632
- queue items already delivered mid-turn).
7197
+ session), `auth` (defaults to the request principal), `state` (starting
7198
+ channel state for new sessions), `title` (session display title), and
7199
+ `purpose` (`"eval"` skips sticky A/B enrollment).
7633
7200
 
7634
7201
  ## Events
7635
7202
 
@@ -7644,14 +7211,12 @@ services. This is where a channel delivers replies back to its surface.
7644
7211
 
7645
7212
  `state` declares the starting per-session adapter state (JSON), persisted
7646
7213
  on the session record. Routes and event handlers read and mutate it
7647
- through `channel.state`. `onStart(args)` runs when the channel mounts;
7648
- the Slack pack opens its Socket Mode connection here. `onStop()` runs
7649
- when the server drains.
7214
+ through `channel.state`. `onStart(args)` runs when the channel mounts.
7215
+ `onStop()` runs when the server stops.
7650
7216
 
7651
7217
  `onStart` receives the route helpers (`send`, `getSession`, `receive`,
7652
- `callTool`, `host`, `waitUntil`, `artifacts`, and a `logger` that
7653
- respects the server's log sink) plus a set that exists for long-lived
7654
- transports:
7218
+ `callTool`, `host`, `waitUntil`, `artifacts`, `logger`) plus helpers
7219
+ for long-lived transports:
7655
7220
 
7656
7221
  - `emitAssistantMessage(sessionId, text)` appends an assistant message
7657
7222
  without a model turn, for host tasks that already produced the final
@@ -7659,8 +7224,6 @@ transports:
7659
7224
  - `hasContinuationSession(token)` and `isContinuationBusy(token)`
7660
7225
  report whether a continuation token has a live session and whether a
7661
7226
  turn is in flight on it.
7662
- - `getContinuationLastBotMessageTs(token)` reads the Slack warm-delta
7663
- watermark from channel state.
7664
7227
  - `interruptContinuation(token)` stops the in-flight turn and clears
7665
7228
  coalesced follow-ups queued behind it.
7666
7229
  - `resolveApproval(sessionId, callId, decision, auth, options?)`
@@ -7714,22 +7277,17 @@ replay and live forwarding. Author `agent/channels/github.ts` with
7714
7277
  converge a merge-box check and sticky PR comment from default stream
7715
7278
  events. Guide: [GitHub](/docs/guides/github.md).
7716
7279
 
7717
- **Deployments** (`@cursor/july/channels/deployments`): pull transport
7718
- over `/v0/deployment-events`. Subscribe per deploy source with
7719
- `deploySourceUris`, narrow with `environments` / `events`, and handle
7720
- each event in `onEvent`. `deploySourceUris` must match
7721
- `Deployment.deploy_source_uri` as your deployment writer records it; the
7722
- field has no format, and matching is case-insensitive but otherwise
7723
- literal. Each event carries `deploySourceUri` and `deployVersion`.
7724
- Author `agent/channels/deployments.ts` with `deploymentsChannel()`. The
7725
- serve host discovers every mounted deployments channel, runs one relay
7726
- for the process against the union of their deploy sources, and routes
7727
- each event to the channels that asked for it; the Slack and SCM relays
7728
- use the same ownership. It authenticates with the host credential and
7729
- keeps a durable offset, so a restart resumes rather than dropping
7730
- events. An empty `deploySourceUris` list mounts the channel but starts
7731
- no relay for it, so an env-configured agent stays inert until its
7732
- deploy sources are set.
7280
+ **Deployments** (`@cursor/july/channels/deployments`): pull deploy
7281
+ events. Subscribe per deploy source with `deploySourceUris`, narrow
7282
+ with `environments` / `events`, and handle each event in `onEvent`.
7283
+ `deploySourceUris` must match `Deployment.deploy_source_uri` as your
7284
+ deployment writer records it; matching is case-insensitive but
7285
+ otherwise literal. Each event carries `deploySourceUri` and
7286
+ `deployVersion`. Author `agent/channels/deployments.ts` with
7287
+ `deploymentsChannel()`. It uses the host credential. A restart resumes
7288
+ rather than dropping events. An empty `deploySourceUris` list mounts
7289
+ the channel but starts no pull, so an env-configured agent stays inert
7290
+ until its deploy sources are set.
7733
7291
 
7734
7292
  For other platforms like Discord or Teams, use the authored
7735
7293
  `defineChannel` webhook form.
@@ -7748,7 +7306,7 @@ session; one active continuation per session; the HTTP channel returns
7748
7306
  Continue with these pages:
7749
7307
 
7750
7308
  - [Webhooks guide](/docs/guides/webhooks.md): the same API, walked through
7751
- - [HTTP API](/docs/reference/http-api.md): the built-in routes precisely
7309
+ - [HTTP API](/docs/reference/http-api.md): session, discovery, and channel routes
7752
7310
  - [Sessions and streaming](/docs/reference/sessions.md): the events channels
7753
7311
  subscribe to
7754
7312
 
@@ -7758,14 +7316,10 @@ Source: /docs/reference/cli.md
7758
7316
 
7759
7317
  # CLI reference
7760
7318
 
7761
- `@cursor/july` installs `july` (so `npx @cursor/july docs` works),
7762
- `agent-sdk`, and the legacy `agent-serve` alias. The examples on this
7763
- page use `agent-sdk`. Run the CLI with Node 22.13 or newer. Don't run it
7764
- with Bun; Bun corrupts tool-result streams from the Cursor SDK.
7765
-
7766
- The current release still uses `.agent-serve` for on-disk state. See the
7767
- [rename table](/docs/index.md#run-the-cli) for identifiers still moving to
7768
- agent-sdk names.
7319
+ `@cursor/july` installs `july` (so `npx @cursor/july docs` works) and
7320
+ `agent-sdk`. The examples on this page use `agent-sdk`. Run the CLI with
7321
+ Node 22.13 or newer. Don't run it with Bun; Bun corrupts tool-result
7322
+ streams from the Cursor SDK.
7769
7323
 
7770
7324
  `agent-sdk help` prints the built-in summary. The Slack and GitHub packs
7771
7325
  also provide `agent-sdk slack help` and `agent-sdk github help`.
@@ -7785,7 +7339,7 @@ also provide `agent-sdk slack help` and `agent-sdk github help`.
7785
7339
  | [`run`](#run) | Run one or more turns locally, remotely, or on a hosted agent |
7786
7340
  | [`call`](#call) | Call a server tool without a model turn |
7787
7341
  | [`eval`](#eval) | Run filesystem evals |
7788
- | [`trajectory`](#trajectory) | Summarize a saved `events.ndjson` file |
7342
+ | [`trajectory`](#trajectory) | Summarize a saved event stream |
7789
7343
  | [`init`](#init) | Scaffold a project, or print the setup guide |
7790
7344
  | [`convert-automation`](#convert-automation) | Export a Cursor Automation into an agent project |
7791
7345
  | [`install-skills`](#install-skills) | Refresh coding-agent skills (`npm install` already copies them) |
@@ -7850,7 +7404,6 @@ agent-sdk serve [--dir <path>] [--port 3000] [--host 127.0.0.1] [--dev]
7850
7404
  [--allow-anonymous-cursor-github]
7851
7405
  [--allow-anonymous-cursor-account-mcp]
7852
7406
  [--public-url <url>] [--cloud-tools-url <url>]
7853
- [--cursor-github-proxy] [--no-control-plane]
7854
7407
  [--no-schedules] [--no-playground]
7855
7408
  [--no-docs] [--cursor-events --repo owner/name]...
7856
7409
  ```
@@ -7859,15 +7412,14 @@ If `--dir` is an agent project, it mounts under its directory name. If
7859
7412
  it contains agent projects, each child mounts separately. The index
7860
7413
  lives at `/`. Each agent is available at `/<slug>/v1/*` and
7861
7414
  `/<slug>/playground`. On a TTY, press Enter to restart.
7862
- Unless `--state-root` is set, each mount uses
7863
- `<agent-project>/.agent-serve`; slugged mounts use
7864
- `<agent-project>/.agent-serve/<slug>`.
7415
+ Unless `--state-root` is set, each mount uses a state directory under
7416
+ the agent project. Slugged mounts get a subdirectory named for the slug.
7865
7417
 
7866
7418
  | Flag | Meaning |
7867
7419
  | --- | --- |
7868
7420
  | `--port` | Listen on this port. `0` selects an available port. The default is `3000`. When the default is taken, serve tries the next free port and prints a notice; an explicit `--port` fails with a next-port hint instead. |
7869
7421
  | `--host` | Bind this host. The default is loopback-only `127.0.0.1`. |
7870
- | `--dev` | Disable automatic schedule and reminder firing, admit unsigned loopback GitHub deliveries, widen playground session access on loopback, and start Vite HMR when available. |
7422
+ | `--dev` | Disable automatic schedule and reminder firing, admit unsigned loopback GitHub deliveries, and widen playground session access on loopback. |
7871
7423
  | `--mode` | Use `multi` for slugged routes and an index, or `single` for one agent at the unslugged `/v1/*`. The default is `multi`. |
7872
7424
  | `--api-key` | Use this Cursor API key. The command falls back to `CURSOR_API_KEY`, then the stored login. |
7873
7425
  | `--state-root` | Store sessions, streams, workspaces, and channel state here. Keep durable production state outside the agent repository. |
@@ -7877,12 +7429,10 @@ Unless `--state-root` is set, each mount uses
7877
7429
  | `--allow-anonymous-cursor-account-mcp` | Allow anonymous callers to drive Cursor account MCP connectors (`defineConnection({ cursorAccount: true })`). Use only behind an authenticating proxy (hosted alias token counts). |
7878
7430
  | `--public-url` | Set the externally reachable host URL. Cloud-runtime peer connections need it to call back into this server. |
7879
7431
  | `--cloud-tools-url` | Authenticated HTTP MCP URL for this deployment's direct server-tool endpoint. Hosted deployments configure it automatically. |
7880
- | `--cursor-github-proxy` | Route `githubChannel({ cursorAccount })` API calls through the Cursor backend's GitHub forwarder instead of minting raw installation tokens into this process. `AGENT_SERVE_GITHUB_PROXY_URL` overrides the base URL. |
7881
- | `--no-control-plane` | Skip the bundled schedule and reminder clocks. Cursor hosting passes this so the platform fires timed work through internal routes instead. |
7882
7432
  | `--no-schedules` | Disable the cron runner outside dev mode. |
7883
- | `--no-playground` | Skip the web playground and its build or HMR process. |
7884
- | `--no-docs` | Skip the documentation site at `/docs` and its build. |
7885
- | `--cursor-events` | Pull SCM events from Cursor's `/v0/scm-events` in addition to authored webhook routes. Requires a signed-in host. Pass repeatable `--repo owner/name` values; repos declared by `githubChannel({ cursorAccount })` also enable the relay. State lives under `<state-root>/cursor-events/`. |
7433
+ | `--no-playground` | Skip the web playground. |
7434
+ | `--no-docs` | Skip the documentation site at `/docs`. |
7435
+ | `--cursor-events` | Pull SCM events from Cursor in addition to authored webhook routes. Requires a signed-in host. Pass repeatable `--repo owner/name` values; repos declared by `githubChannel({ cursorAccount })` also enable it. |
7886
7436
 
7887
7437
  Multi-agent slugs must start with a letter or digit, then contain only
7888
7438
  letters, digits, `_`, or `-`. The reserved slugs are `v1`, `playground`,
@@ -7902,10 +7452,9 @@ agent-sdk dev ./sdk-pr-reviewer --port 3000
7902
7452
  `dev` accepts the same flags as [`serve`](#serve). You can use `--dir`
7903
7453
  instead of the positional path.
7904
7454
  Dev mode is always on: schedules and reminders wait for manual dispatch,
7905
- GitHub accepts unsigned loopback deliveries, and Vite HMR starts when
7906
- the toolchain is present. Prefer this over `serve --dev` while
7907
- iterating. Pass at most one positional path. Don't combine a positional
7908
- path with a different `--dir`.
7455
+ and GitHub accepts unsigned loopback deliveries. Prefer this over
7456
+ `serve --dev` while iterating. Pass at most one positional path. Don't
7457
+ combine a positional path with a different `--dir`.
7909
7458
 
7910
7459
  ## chat
7911
7460
 
@@ -8042,7 +7591,7 @@ npx @cursor/july docs
8042
7591
  agent-sdk docs [--port <n>] [--host 127.0.0.1] [--print]
8043
7592
  ```
8044
7593
 
8045
- The site is the same VitePress build mounted at `/docs` on a running
7594
+ The site is the same documentation mounted at `/docs` on a running
8046
7595
  `serve` host. `docs` starts a loopback-only static server (default port
8047
7596
  is an ephemeral port) and keeps it open until Ctrl-C. `--print` prints
8048
7597
  the URL without opening a browser.
@@ -8078,7 +7627,7 @@ after the turns finish.
8078
7627
  | `--slug <slug>` | Pick one agent when local discovery mounts several agents. With `--prod`, select the hosted deployment. |
8079
7628
 
8080
7629
  The default trace path is
8081
- `<dir>/.agent-serve/traces/<sessionId>.ndjson`. JSON output contains
7630
+ `<state-root>/traces/<sessionId>.ndjson`. JSON output contains
8082
7631
  `ok`, `sessionId`, `continuationToken`, `trace`, `playgroundUrl`,
8083
7632
  `playgroundHint`, `visualize`, and `trajectory`. The command exits
8084
7633
  non-zero when the trajectory fails.
@@ -8146,7 +7695,7 @@ between 1 and 200. Timeout priority is the case's `timeoutMs`, the CLI's
8146
7695
  | `--strict` | Exit `1` when a scored case misses a soft threshold. |
8147
7696
  | `--max-concurrency <n>` | Override `maxConcurrency` from `evals.config.ts`. |
8148
7697
  | `--junit <path>` | Write JUnit XML for CI annotations. |
8149
- | `--artifacts <dir>` | Write run artifacts here. The default is a timestamped directory under `<dir>/.agent-serve/evals/`. |
7698
+ | `--artifacts <dir>` | Write run artifacts here. The default is a timestamped directory under `<state-root>/evals/`. |
8150
7699
  | `--no-artifacts` | Skip run artifacts. |
8151
7700
  | `--skip-report` | Ignore reporters from `evals.config.ts` and eval files. |
8152
7701
  | `--out <path>` | Also write the full results JSON to this path (also for `eval status <evalId>`). |
@@ -8318,10 +7867,9 @@ takes precedence over the stored login. `logout` removes the local
8318
7867
  credential file but doesn't revoke the API key. Revoke it in the Cursor
8319
7868
  dashboard when it should stop working.
8320
7869
 
8321
- Non-production backends: login and account RPCs honor
8322
- `CURSOR_API_BASE_URL` while the SDK harness honors `CURSOR_BACKEND_URL`.
8323
- Set both to the same URL, or keys minted on one backend are rejected by
8324
- the other.
7870
+ Login and account RPCs honor `CURSOR_API_BASE_URL`. The SDK harness
7871
+ honors `CURSOR_BACKEND_URL`. Set both to the same URL, or keys minted
7872
+ on one host are rejected by the other.
8325
7873
 
8326
7874
  ## update
8327
7875
 
@@ -8401,7 +7949,7 @@ state layout.
8401
7949
  agent-sdk deployments [--team <id>] [--json]
8402
7950
  ```
8403
7951
 
8404
- Text output shows each slug, status, generation, deployment kind, and
7952
+ Text output shows each slug, status, deployment kind, and
8405
7953
  update time. `--json` prints `{ deployments }`.
8406
7954
 
8407
7955
  ## deployment
@@ -8412,7 +7960,7 @@ update time. `--json` prints `{ deployments }`.
8412
7960
  agent-sdk deployment <slug> [--team <id>] [--json]
8413
7961
  ```
8414
7962
 
8415
- Text output includes status, generation, kind, alias, source, egress
7963
+ Text output includes status, kind, alias, source, egress
8416
7964
  domains, secret names, engine state, and the last error when present.
8417
7965
  `--json` returns the full API response. It can include short-lived
8418
7966
  `engineAccess.headers`, so handle JSON output as a credential.
@@ -8501,8 +8049,8 @@ as a credential.
8501
8049
  `defineConnection({ cursorAccount: true })` connection.
8502
8050
 
8503
8051
  URL connections run a browser PKCE flow. Tokens are written to
8504
- `mcp-auth.json` under the agent-serve config dir (default
8505
- `~/.config/agent-serve`). Pass `--store` to upsert matching
8052
+ `mcp-auth.json` under the CLI config directory (override with
8053
+ `AGENT_SERVE_CONFIG_DIR`). Pass `--store` to upsert matching
8506
8054
  `MCP_OAUTH_<CONNECTION>_*` secrets on the hosted deployment.
8507
8055
 
8508
8056
  Cursor-account connections authorize the hosted deployment's service
@@ -8698,9 +8246,9 @@ These environment variables affect the CLI and its channel packs.
8698
8246
  | Variable | Meaning |
8699
8247
  | --- | --- |
8700
8248
  | `CURSOR_API_KEY` | Cursor credential. It takes precedence over the stored login. |
8701
- | `CURSOR_API_BASE_URL` | Backend used by login, account, deployment, and event-relay RPCs in non-production environments. |
8702
- | `CURSOR_BACKEND_URL` | Backend used by the Cursor SDK harness in non-production environments. |
8703
- | `AGENT_SERVE_CONFIG_DIR` | Directory for stored credentials and update-check state. The default is `~/.config/agent-serve`. |
8249
+ | `CURSOR_API_BASE_URL` | Backend used by login, account, deployment, and event-relay RPCs. |
8250
+ | `CURSOR_BACKEND_URL` | Backend used by the Cursor SDK harness. |
8251
+ | `AGENT_SERVE_CONFIG_DIR` | Directory for stored credentials and update-check state. Defaults to the CLI config directory under `~/.config`. |
8704
8252
  | `AGENT_SERVE_NO_UPDATE_CHECK` / `NO_UPDATE_NOTIFIER` | Disable the automatic published-version check when set to a non-empty value other than `0`. |
8705
8253
  | `CI` | Disable the automatic published-version check when set. |
8706
8254
  | `GITHUB_WEBHOOK_SECRET` | Default signing secret for GitHub forwarding and replay. |
@@ -8745,7 +8293,7 @@ Tokens come from env vars. Never hardcode them in the file.
8745
8293
  ## Host MCP OAuth
8746
8294
 
8747
8295
  For servers that speak OAuth, set `oauth: true` and authorize with the
8748
- CLI. Tokens live in `~/.config/agent-serve/mcp-auth.json`. `--store`
8296
+ CLI. Tokens live in `mcp-auth.json` under the CLI config directory. `--store`
8749
8297
  copies them onto the hosted deployment as `MCP_OAUTH_<NAME>_*` secrets.
8750
8298
 
8751
8299
  ```ts
@@ -8773,7 +8321,7 @@ local turns, set `advertiseTools: true`.
8773
8321
  ## Per-session auth (`auth`)
8774
8322
 
8775
8323
  For http/sse connections whose credential depends on **who the session is
8776
- for** a multi-tenant agent asserting the tenant it is acting for
8324
+ for** (a multi-tenant agent asserting the tenant it is acting for),
8777
8325
  declare an `auth` callback instead of static headers. It runs host-side
8778
8326
  at turn-build time with the session's `SessionInfo` and returns headers
8779
8327
  merged over the static ones:
@@ -8788,16 +8336,16 @@ export default defineConnection({
8788
8336
  });
8789
8337
  ```
8790
8338
 
8791
- The callback is evaluated on **every local turn** reminder fires and
8792
- post-restart follow-ups included — so the identity always comes from the
8339
+ The callback is evaluated on **every local turn**, including reminder
8340
+ fires and post-restart follow-ups, so the identity always comes from the
8793
8341
  session itself, never from state parked in memory. The model never sees a
8794
8342
  tenant parameter and can never choose the tenant. A callback that throws
8795
8343
  fails the turn: a turn never silently runs without the connection's
8796
8344
  identity. Local runtime only; cloud turns are refused. `host.mcp` calls
8797
8345
  from server tools keep the static headers only. Not combinable with
8798
- `oauth: true` the host OAuth provider owns the Authorization header.
8346
+ `oauth: true`; the host OAuth provider owns the Authorization header.
8799
8347
 
8800
- Derive the identity from durable session facts `session.auth`,
8348
+ Derive the identity from durable session facts: `session.auth`,
8801
8349
  `session.id`, or your channel's own session state. Do **not** key it off
8802
8350
  `session.continuationKey`: the HTTP channel rotates the continuation key
8803
8351
  after every accepted follow-up, so a tenant mapping keyed on it silently
@@ -8808,14 +8356,9 @@ design are the exception.)
8808
8356
  per-operation clients with the evaluated headers. Attached connections
8809
8357
  ride the turn's SDK `mcpServers`, passed on **every send** rather than
8810
8358
  pinned on the cached per-session agent handle, so a rotated credential is
8811
- live on the very next turn. The cost: when any attached connection has
8812
- `auth`, *all* of the agent's attached connections are configured per
8813
- send — the harness opens fresh MCP clients for them on each turn, so a
8814
- stdio (`command`) server respawns per turn and loses any in-process
8815
- state; keep stateful stdio servers out of agents that attach an auth'd
8816
- connection (or advertise the auth'd connection instead). Workspace
8817
- prewarm has no session, so it omits auth'd connections rather than
8818
- attaching them without an identity.
8359
+ live on the very next turn. A stateful stdio server cannot share a
8360
+ process with an attached `auth` connection. Advertise the auth
8361
+ connection instead.
8819
8362
 
8820
8363
  ## Advertise a connection's tools by name (`advertiseTools`) {#advertise-tools}
8821
8364
 
@@ -8994,11 +8537,11 @@ Source: /docs/reference/hooks.md
8994
8537
  # Hooks
8995
8538
 
8996
8539
  A hook is an observe-only subscriber to the session event stream. Hooks
8997
- run after each event is recorded and fanned out (file persistence flushes
8998
- in the background). That makes them the home for audit logging, metrics,
8999
- mirroring transcripts into your own store, and maintaining derived state.
9000
- Handler errors are logged and never fatal. A hook can't modify events,
9001
- inject context into the next turn, or block a turn.
8540
+ run after each event is recorded. They cannot change the event or the
8541
+ turn. That makes them the home for audit logging, metrics, mirroring
8542
+ transcripts into your own store, and maintaining derived state. Handler
8543
+ errors are logged and never fatal. A hook can't inject context into the
8544
+ next turn or block a turn.
9002
8545
 
9003
8546
  For deterministic context composition before the model runs, use the
9004
8547
  host path that already owns the wake: channel handlers (fetch, `callTool`,
@@ -9026,7 +8569,7 @@ export default defineHook({
9026
8569
  });
9027
8570
  ```
9028
8571
 
9029
- Keys are event types (the full list is in the
8572
+ Keys are event types (see the
9030
8573
  [event vocabulary](/docs/reference/sessions.md#which-events-can-i-stream)), or `"*"`
9031
8574
  for everything. Handlers receive the event with its envelope (`index`,
9032
8575
  `sessionId`, `turnId?`, `at`) and a `HookContext`:
@@ -9072,20 +8615,16 @@ Usage metering: subscribe to `turn.completed` and forward
9072
8615
  Failure alerting: `turn.failed` carries the message, and
9073
8616
  `ctx.session.id` points at the trace.
9074
8617
 
9075
- Derived state: `agent.bound` fires when the Cursor SDK agent id is known
9076
- (`bc-…` on cloud). A PR agent can record PR → agent id from it in a
9077
- hook with `ctx.host.kv`, so later webhook wakes resume the same cloud
9078
- conversation. Prefer `ctx.host.kv` or `ctx.host.files` for ids that
9079
- must survive hosted replace. `stateRoot` resets on replace.
8618
+ Derived state: persist ids that must survive hosted replace with
8619
+ `ctx.host.kv` or `ctx.host.files`. `stateRoot` resets on replace.
9080
8620
 
9081
- Transcript export: subscribe to `"*"` and append to your own store. The
9082
- NDJSON envelope is already ordered and replayable.
8621
+ Transcript export: subscribe to `"*"` and append to your own store.
9083
8622
 
9084
8623
  ## What's next
9085
8624
 
9086
8625
  Continue with these pages:
9087
8626
 
9088
- - [Sessions and streaming](/docs/reference/sessions.md): every event a hook can see
8627
+ - [Sessions and streaming](/docs/reference/sessions.md): the event vocabulary hooks observe
9089
8628
  - [OpenTelemetry](/docs/guides/opentelemetry.md): OTLP traces and metrics
9090
8629
  from the same event stream
9091
8630
  - [Deployment](/docs/deployment.md#observability): runtime logs and export
@@ -9100,7 +8639,7 @@ Source: /docs/reference/http-api.md
9100
8639
 
9101
8640
  # HTTP API reference
9102
8641
 
9103
- Every Agent SDK host speaks the same stable HTTP API. In the default
8642
+ Agent SDK hosts expose the same public HTTP surface. In the default
9104
8643
  multi-agent layout each agent is namespaced under its slug
9105
8644
  (`/<slug>/v1/session`, `/<slug>/playground`), with host-level routes at
9106
8645
  the root. With `--mode single`, one agent serves the same surface
@@ -9125,8 +8664,7 @@ both layouts and removed by `--no-docs`.
9125
8664
  | `GET /` | A web index of every mounted agent, linking to playgrounds (playground only) |
9126
8665
  | `GET /v1/agents` | The JSON index of mounted agents (playground only, no auth) |
9127
8666
  | `GET /docs`, `GET /docs/*` | This documentation, served as a static site (both layouts, no auth) |
9128
- | `GET /v1/health` | Host-level liveness, no auth; made for ALB/ECS checks |
9129
- | `POST /v1/webhooks/github` | Loopback-only trigger endpoint that fans a GitHub-shaped payload out to every mounted GitHub channel (used by local tooling) |
8667
+ | `GET /v1/health` | Host-level liveness, no auth |
9130
8668
 
9131
8669
  ## Start a session
9132
8670
 
@@ -9234,17 +8772,16 @@ while a turn runs). Agent-execution tools are rejected with `400`, and
9234
8772
  unknown tools with `404` and the list of available names. For the
9235
8773
  semantics, see [Tools](/docs/reference/tools.md#call-a-tool-without-a-model-turn).
9236
8774
 
9237
- ## Discovery and meta
8775
+ ## Discovery
9238
8776
 
9239
- Five read-only routes describe the running agent.
8777
+ These read-only routes describe the running agent.
9240
8778
 
9241
8779
  | Route | What it does |
9242
8780
  | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
9243
- | `GET /v1/info` | The manifest snapshot: model, tools, skills, MCP connections, subagents, channels and routes (with schemas), schedules, hooks, A/B experiments, diagnostics. Always the bare project-info object; `agent-sdk info --json` wraps the same data per slug in `{ agents: [...] }` |
8781
+ | `GET /v1/info` | The discovered surface: model, tools, skills, MCP connections, subagents, channels and routes (with schemas), schedules, hooks, A/B experiments, diagnostics |
9244
8782
  | `GET /v1/health` | Per-agent liveness, no auth |
9245
- | `GET /v1/meta` | SPA bootstrap: agent name, dev flag, base path (no auth) |
9246
- | `GET /v1/logs?after=N` | Recent server log lines from the ring buffer, with a polling cursor |
9247
- | `GET /v1/abs` | [Live A/B metrics](/docs/ab.md): per-session assignments and aggregate arm totals folded from durable event streams (`config` reports `maxPlaygroundSessions` / `durableSamples` / `durableSnapshots` from `agent/ab.config.ts`) |
8783
+ | `GET /v1/logs?after=N` | Recent server log lines, with a polling cursor |
8784
+ | `GET /v1/abs` | [Live A/B metrics](/docs/ab.md): per-session assignments and aggregate arm totals |
9248
8785
 
9249
8786
  ## Artifacts
9250
8787
 
@@ -9286,20 +8823,14 @@ it through the URL configured by `serve --cloud-tools-url`. Unlike
9286
8823
  `/v1/mcp`, it runs the CLI-level auth chain (loopback, bearer, or
9287
8824
  anonymous), not any authored channel auth.
9288
8825
 
9289
- `POST /v1/cursor-account/:connection/mcp` is the bridge for
9290
- `defineConnection({ cursorAccount: true })` connections. The runtime
9291
- calls it with a per-boot bearer secret; it never joins the public auth
9292
- chain, and an unknown connection name returns `404`.
9293
-
9294
8826
  ## Playground eval routes
9295
8827
 
9296
- Always registered (including production / non-`--dev` serves). The playground
9297
- Evals tab uses these:
8828
+ The playground Evals tab and `agent-sdk eval --prod` / `--url` use these:
9298
8829
 
9299
8830
  | Route | What it does |
9300
8831
  | ------------------------------- | ---------------------------------------------------------------------------------------------------------- |
9301
- | `GET /v1/dev/evals` | List discovered eval datapoints and project config as `{ evals, config }` (`config` includes `maxPlaygroundRuns`, `durableRuns`) |
9302
- | `GET /v1/dev/evals/runs` | List recent run snapshots (newest first) as `{ runs, activeRunId? }` for playground rehydrate |
8832
+ | `GET /v1/dev/evals` | List discovered eval datapoints and project config |
8833
+ | `GET /v1/dev/evals/runs` | List recent run snapshots, newest first |
9303
8834
  | `POST /v1/dev/evals/runs` | Start an eval run (`{filterIds?, tags?}`); `202` with a snapshot (`runId` is the Eval ID), `404` when nothing matches, `409` when one is running |
9304
8835
  | `GET /v1/dev/evals/runs/:runId` | Poll a run's progress |
9305
8836
  | `POST /v1/dev/evals/runs/:runId/cancel` | Cancel a running batch; `200` with snapshot, `404` unknown, `409` when not running |
@@ -9308,10 +8839,9 @@ Eval runs are asynchronous. Poll the run route for case progress and
9308
8839
  the final `completed` or `failed` status. Batch errors appear on the
9309
8840
  snapshot returned by the poll. Entries within `filterIds` and `tags`
9310
8841
  use OR semantics. When both fields are present, a case must match one
9311
- entry from each field. Listed runs persist across restarts whenever
9312
- `agent/storage.ts` provides an `evals` table or a KV core with `delete`
9313
- and `list` (the table is derived — see [Storage](/docs/storage.md));
9314
- otherwise they are process-memory only (capped by `maxPlaygroundRuns`).
8842
+ entry from each field. Listed runs persist across restarts when storage is configured; see
8843
+ [Storage](/docs/storage.md#eval-and-a-b-tables). Otherwise they are
8844
+ process-memory only.
9315
8845
 
9316
8846
  ## Dev-mode routes
9317
8847
 
@@ -9319,29 +8849,18 @@ These routes exist only under `serve --dev`.
9319
8849
 
9320
8850
  | Route | What it does |
9321
8851
  | ------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
9322
- | `POST /v1/dev/schedules/:scheduleId` | Dispatch a schedule by hand, exactly once, through the production path. Returns `{scheduleId, sessionIds}` |
8852
+ | `POST /v1/dev/schedules/:scheduleId` | Dispatch a schedule by hand, exactly once. Returns `{scheduleId, sessionIds}` |
9323
8853
  | `GET /v1/dev/reminders` | List reminders |
9324
8854
  | `POST /v1/dev/reminders/:reminderId` | Fire a reminder by hand |
9325
8855
 
9326
8856
  Schedules and reminders never fire automatically in dev mode. These
9327
8857
  routes are the only way they run, which keeps iteration deterministic.
9328
8858
 
9329
- ## Platform timer routes
9330
-
9331
- `POST /v1/internal/schedules/:scheduleId/fire` and
9332
- `POST /v1/internal/reminders/:reminderId/fire` exist only under
9333
- `serve --no-control-plane`, where the host runs no schedule or reminder
9334
- clocks of its own. Cursor hosting starts engines this way and fires
9335
- timed work through them. They admit only requests carrying the
9336
- platform's `x-agent-serve-timed-work` marker, which the alias proxy
9337
- strips from external traffic, so webhook and playground callers can
9338
- never reach them.
9339
-
9340
8859
  ## Playground assets
9341
8860
 
9342
- `GET /playground` and `GET /playground/assets/:file` serve the static
9343
- SPA bundle (omitted with `--no-playground`). The playground calls the
9344
- JSON API above and has no privileged surface.
8861
+ `GET /playground` and `GET /playground/assets/:file` serve the
8862
+ playground (omitted with `--no-playground`). It calls the JSON API
8863
+ above and has no privileged surface.
9345
8864
 
9346
8865
  ## Status codes
9347
8866
 
@@ -9407,7 +8926,7 @@ may also load ambient `AGENTS.md` and `.cursor` config from ancestor
9407
8926
  directories. [Agent config → Local cwd](/docs/reference/agent-config.md#local-cwd)
9408
8927
  covers controlling that.
9409
8928
 
9410
- ## Best Practices
8929
+ ## What to put in instructions
9411
8930
 
9412
8931
  Keep them a few lines: identity, when to use which tool, output shape.
9413
8932
  The [quickstart PR approver](/docs/quickstart.md) is the pattern:
@@ -9453,40 +8972,35 @@ Source: /docs/reference/playground.md
9453
8972
 
9454
8973
  Every served agent ships with a web playground at
9455
8974
  `http://127.0.0.1:3000/<slug>/playground` (or `/playground` in single
9456
- mode): a static SPA over the same public HTTP API, made for manual
9457
- testing, demos, and reading sessions. Every call it makes runs the
9458
- normal route auth chain, so anything you can do in the playground you
9459
- can also do with curl.
8975
+ mode). Anything you can do there you can also do with curl.
9460
8976
 
9461
8977
  ## What it does
9462
8978
 
9463
- The playground covers the whole manual-testing loop.
8979
+ Use the playground to chat, try channel routes, and inspect sessions.
9464
8980
 
9465
- - **Chat** with the agent. Text and reasoning stream live, rendered as
9466
- markdown with syntax highlighting, and tool calls appear inline with
9467
- their arguments, output, and error state as the `actions.requested` /
9468
- `action.result` events arrive.
8981
+ - **Chat** with the agent. Text and reasoning stream live, and tool
8982
+ calls appear inline with their arguments, output, and error state.
9469
8983
  - **Slash commands**: custom channel routes become composer commands
9470
- (a `drive` route becomes `/drive <pr-url>`), derived from the schemas
9471
- on `GET /v1/info`, with `/help` and autocomplete.
8984
+ (a `drive` route becomes `/drive <pr-url>`), with `/help` and
8985
+ autocomplete.
9472
8986
  - **Try** any channel route from the Agent surface. The modal remembers
9473
8987
  your last body per endpoint and has Copy curl, and a successful Try
9474
8988
  opens the created session.
9475
- - **Sessions**: browse every session (chat, custom-channel, schedule
9476
- tasks) and replay their durable event streams. Search by session ID
9477
- to filter the list, or press Enter to open an ID directly. "Open
9478
- trace" renders any `events.ndjson` file.
8989
+ - **Sessions**: browse the sessions you own (chat, custom-channel,
8990
+ schedule tasks) and replay their event streams. In `--dev` on
8991
+ loopback, or with `--allow-anonymous`, the list includes every
8992
+ principal. Search by session ID to filter the list, or press Enter
8993
+ to open an ID directly. "Open trace" renders a saved event stream.
9479
8994
  - **Approvals**: parked `needsApproval` tool calls render Approve /
9480
8995
  Deny buttons.
9481
8996
  - **Evals**: list and run filesystem evals from the browser (backed by
9482
8997
  `/v1/dev/evals`). Schedule hand-dispatch still requires `--dev`.
9483
8998
  - **The surface**: inspect the discovered tools, skills, subagents, MCP
9484
8999
  connections, channels, and hooks.
9485
- - **Raw NDJSON pane**: flip it on to see the exact wire events.
9000
+ - **Raw events pane**: flip it on to inspect the event stream.
9486
9001
  - **Logs tab**: recent server log lines, polled from `GET /v1/logs`.
9487
9002
  - **A/Bs tab**: per-session and aggregate
9488
- [live A/B metrics](/docs/ab.md) from `GET /v1/abs` (folds durable
9489
- `ab.assigned` plus turn and tool events; no separate store).
9003
+ [live A/B metrics](/docs/ab.md) from `GET /v1/abs`.
9490
9004
 
9491
9005
  In multi-agent mode each agent has its own playground at
9492
9006
  `/<slug>/playground`, and `/` is an index of them all.
@@ -9505,7 +9019,7 @@ demo-only alternative for trusted networks.
9505
9019
 
9506
9020
  Continue with these pages:
9507
9021
 
9508
- - [HTTP API](/docs/reference/http-api.md): everything the playground calls
9022
+ - [HTTP API](/docs/reference/http-api.md): the HTTP surface the playground uses
9509
9023
  - [Sessions and streaming](/docs/reference/sessions.md): the streams it renders
9510
9024
  - [Human-in-the-loop](/docs/guides/human-in-the-loop.md): the approval
9511
9025
  buttons in context
@@ -9589,7 +9103,7 @@ Each path maps to a capability and a reference page.
9589
9103
  | `agent/artifacts.ts` | `defineArtifacts` kinds, the `tag_artifact` opt-in, and retention | [Artifacts](/docs/reference/artifacts.md) |
9590
9104
  | `agent/schedules/*` | Cron-driven runs (UTC, 5-field; never auto-fire under `--dev`) | [Schedules](/docs/reference/schedules.md) |
9591
9105
  | `agent/sandbox/workspace/**` | Seed files copied into each local session workspace | [Sessions](/docs/reference/sessions.md#what-goes-into-a-local-session-workspace) |
9592
- | `agent/playground/` | Custom playground tool chips for the Vite dev playground | [Playground](/docs/reference/playground.md) |
9106
+ | `agent/playground/` | Custom playground tool chips | [Playground](/docs/reference/playground.md) |
9593
9107
  | `agent/lib/` | Import-only shared code, never discovered | None |
9594
9108
  | `evals/evals.config.ts` | Shared eval settings (e.g. `maxConcurrency`); required when evals exist | [Evals](/docs/evals.md) |
9595
9109
  | `evals/**/*.eval.ts` | Filesystem evals; case id = path under `evals/` | [Evals](/docs/evals.md) |
@@ -9611,7 +9125,7 @@ or has the wrong extension.
9611
9125
  ```bash
9612
9126
  agent-sdk validate --dir . # diagnostics; non-zero exit on errors
9613
9127
  agent-sdk info --dir . # human-readable surface
9614
- agent-sdk info --dir . --json # machine-readable manifest (same shape as GET /v1/info)
9128
+ agent-sdk info --dir . --json # machine-readable project info (same shape as GET /v1/info)
9615
9129
  ```
9616
9130
 
9617
9131
  ## What's next
@@ -9660,7 +9174,7 @@ those lines the same indent as the `prompt` body so dedent stays consistent.
9660
9174
 
9661
9175
  ## `prompt.lines\`…\``
9662
9176
 
9663
- Same dedent rules, but returns `string[]` one entry per line. Use this
9177
+ Same dedent rules, but returns `string[]`, one entry per line. Use this
9664
9178
  where an API wants separate lines (for example GitHub channel `context`):
9665
9179
 
9666
9180
  ```ts
@@ -9854,8 +9368,7 @@ in-memory, so after a restart those reminders are disarmed
9854
9368
  (`handler_lost_on_restart`); re-arm them from the code path that created
9855
9369
  them, or prefer the prompt form.
9856
9370
 
9857
- Dev mode matches schedules. Auto-timers follow `ServeOptions.reminders`
9858
- (default `!dev`), so in `--dev` fire by hand:
9371
+ `--dev` does not auto-fire reminders. Dispatch one by hand:
9859
9372
 
9860
9373
  ```bash
9861
9374
  curl http://127.0.0.1:3000/<slug>/v1/dev/reminders # list
@@ -9971,7 +9484,7 @@ within one session. The `at` field is an ISO-8601 timestamp.
9971
9484
  | Phase | Events | What they tell you |
9972
9485
  | --- | --- | --- |
9973
9486
  | Session | `session.started`, [`ab.assigned`](/docs/ab.md#assign-sticky-variants), `session.waiting`, `session.completed`, `session.failed` | Session creation, A/B enrollment, readiness, and task completion |
9974
- | Agent | `agent.bound` | Cursor SDK agent ID and cloud conversation URL |
9487
+ | Agent | `agent.bound` | Cloud conversation URL |
9975
9488
  | Input | `message.received` | A user message was accepted |
9976
9489
  | Turn | `turn.queued`, `turn.started`, `turn.completed`, `turn.failed` | Queue position under a [`maxRunningTurns` cap](/docs/reference/agent-config.md#concurrency), then turn status, final result, and token usage |
9977
9490
  | Steps | `step.started`, `step.completed` | Model step boundaries and duration |
@@ -10010,7 +9523,7 @@ The Agent SDK creates a workspace before the first local turn:
10010
9523
  | ---------------------------------- | ----------------------------------------------------------------------- |
10011
9524
  | `instructions.*` | `AGENTS.md` |
10012
9525
  | `skills/*` | `.cursor/skills/<name>/SKILL.md` |
10013
- | agent tools (`execution: "agent"`) | scripts under `.agent-serve/tools/`, with a catalog in `AGENTS.md` |
9526
+ | agent tools (`execution: "agent"`) | scripts in the session workspace, with a catalog in `AGENTS.md` |
10014
9527
  | `sandbox/workspace/**` | copied in as seed files |
10015
9528
  | per-send `workspaceFiles` | written before the turn |
10016
9529
 
@@ -10025,34 +9538,23 @@ inheritance rules.
10025
9538
 
10026
9539
  ## Where does the Agent SDK store session data?
10027
9540
 
10028
- Local state uses one directory tree:
10029
-
10030
- ```text
10031
- <project>/.agent-serve/ # or <stateRoot>/<slug>/ under serve
10032
- sessions/<id>/session.json # metadata: channel, mode, principal, tokens
10033
- sessions/<id>/events.ndjson # the durable stream
10034
- sessions/<id>/workspace/ # the harness cwd
10035
- traces/<sessionId>.ndjson # written by `run`
10036
- runner/ # Cursor SDK conversation store
10037
- tool-calls/<callId>/ # ephemeral deterministic-call workspaces
10038
- ```
9541
+ Local state lives under `--state-root`. Slugged mounts store it under
9542
+ a subdirectory named for the slug.
10039
9543
 
10040
9544
  Deleting a session directory removes the session from the server: it
10041
9545
  disappears from listings and can no longer be streamed or continued.
10042
- The `runner/` store keeps its own conversation copy until you remove it.
10043
9546
  Cloud conversations remain on the Cursor backend.
10044
9547
 
10045
- Change the root with `--state-root` or `stateRoot`. Nested git checkouts
10046
- already default `local.cwd` outside the enclosing repo. See
9548
+ Nested git checkouts already default `local.cwd` outside the enclosing
9549
+ repo. See
10047
9550
  [local session workspaces](/docs/concepts.md#what-files-can-a-local-session-access).
10048
9551
 
10049
9552
  ## How do I inspect a saved event stream?
10050
9553
 
10051
- Use `trajectory` with a trace or session event file:
9554
+ Use `trajectory` with a saved trace:
10052
9555
 
10053
9556
  ```bash
10054
- agent-sdk trajectory --events .agent-serve/traces/<sessionId>.ndjson
10055
- agent-sdk trajectory --events <stateRoot>/<slug>/sessions/<id>/events.ndjson
9557
+ agent-sdk trajectory --events <state-root>/traces/<sessionId>.ndjson
10056
9558
  ```
10057
9559
 
10058
9560
  The command prints tool calls, the reply, and token usage in the same
@@ -10124,9 +9626,9 @@ the engine copies the same SKILL.md tree onto an Agent Store for native
10124
9626
  discovery:
10125
9627
 
10126
9628
  - Hosted deployments write store-root `skills/<name>/`.
10127
- - `agent-serve serve` / `run` with a personal `CURSOR_API_KEY` write
10128
- `agent-serve/<agent>/skills/<name>/` on the USER store, namespaced so
10129
- they cannot collide with the user's own skills.
9629
+ - `agent-sdk serve` / `run` with a personal `CURSOR_API_KEY` write
9630
+ namespaced skills on the USER store so they cannot collide with the
9631
+ user's own skills.
10130
9632
 
10131
9633
  `validate` still warns about the combination so the store path is
10132
9634
  visible. Cloud turns with neither a hosted store nor an API key see
@@ -10295,7 +9797,7 @@ export default defineTool({
10295
9797
  });
10296
9798
  ```
10297
9799
 
10298
- ### The `ctx` parameter
9800
+ ### Tool context
10299
9801
 
10300
9802
  `execute` receives a `ctx` with the runtime accessors:
10301
9803
 
@@ -10307,7 +9809,7 @@ export default defineTool({
10307
9809
  | `ctx.stateRoot` | The agent's durable state root, shared across every session |
10308
9810
  | `ctx.host` | Shared host services (see below) |
10309
9811
  | `ctx.send(channelId, message, options?)` | Start or resume a session on any channel: the cross-channel handoff primitive, e.g. a chat tool opening a `drive` cloud session for a PR. `auth` defaults to this call's session principal |
10310
- | `ctx.getSession(channelId, sessionId)` | Look up a session on a channel, e.g. refresh `sdkAgentId` after a turn |
9812
+ | `ctx.getSession(channelId, sessionId)` | Look up a session on a channel |
10311
9813
  | `ctx.artifacts` | Session-bound [artifacts](/docs/reference/artifacts.md) facade: `tag` auto-fills the session |
10312
9814
 
10313
9815
  `ctx.host` carries the shared host services: `host.mcp` (authored MCP
@@ -10315,9 +9817,7 @@ connections: `names()`, `listTools(name)`, `callTool(name, tool, args)`),
10315
9817
  `host.github` and `host.slack` (shared platform clients), `host.kv` and
10316
9818
  `host.files` (durable [storage](/docs/storage.md)), `host.otel` (custom
10317
9819
  metrics and session tags; see [OpenTelemetry](/docs/guides/opentelemetry.md)),
10318
- `host.reminders` (per-session wakes, when attached), `host.evals`
10319
- (playground eval batches, when attached), and `host.slackNudges`
10320
- (Slack ask-dedupe helpers).
9820
+ `host.reminders` (per-session wakes, when attached).
10321
9821
 
10322
9822
  ### Return values
10323
9823
 
@@ -10405,15 +9905,15 @@ printf '%s\\n' "$message"
10405
9905
  });
10406
9906
  ```
10407
9907
 
10408
- On the local runtime, scripts land under `.agent-serve/tools/` in the
10409
- session workspace with a catalog in `AGENTS.md`. On cloud, the catalog
10410
- and script bodies travel on the first prompt.
9908
+ On the local runtime, scripts land in the session workspace with a
9909
+ catalog in `AGENTS.md`. On cloud, the catalog and script bodies travel
9910
+ on the first prompt.
10411
9911
 
10412
9912
  ## Tools from an MCP connection, advertised by name
10413
9913
 
10414
9914
  Authored `agent/tools/` files are one catalog for every session. When
10415
- the tools should come from an MCP server including per-tenant toolsets
10416
- resolved at runtime declare the connection with
9915
+ the tools should come from an MCP server, including per-tenant toolsets
9916
+ resolved at runtime, declare the connection with
10417
9917
  `advertiseTools: true` (plus per-session `auth` when the credential
10418
9918
  depends on who the session is for) and the engine synthesizes named 1:1
10419
9919
  passthrough server tools from the connection's live `listTools` on every
@@ -10490,15 +9990,12 @@ const outcome = await handle.callTool("inspect_pr", {
10490
9990
  // { toolName, callId, isError, result, durationMs }
10491
9991
  ```
10492
9992
 
10493
- By default the call runs against an ephemeral scratch workspace under
10494
- `<stateRoot>/tool-calls/<callId>`, materialized like a session workspace
10495
- and removed when the call returns. Pass a `sessionId` (a body field over
9993
+ By default the call runs against an ephemeral workspace and is removed
9994
+ when the call returns. Pass a `sessionId` (a body field over
10496
9995
  HTTP, `--session` on the CLI, `options.sessionId` programmatically) to
10497
9996
  run inside an existing session instead: the tool sees that session's
10498
- workspace, and the call is recorded on the session's event stream under
10499
- a per-call `turnId`, visible in the playground and trajectories like
10500
- any model-initiated call. Session-bound calls serialize with model
10501
- turns and return `409 session_busy` while a turn runs.
9997
+ workspace, and the call is recorded on the session's event stream.
9998
+ Session-bound calls return `409 session_busy` while a turn runs.
10502
9999
 
10503
10000
  The error semantics match the model path. Unknown tools are rejected
10504
10001
  with the available names, agent-execution tools cannot be called on the
@@ -10556,12 +10053,11 @@ Where to find the file depends on how you got the package:
10556
10053
  injects the skill body into context instead of waiting for the
10557
10054
  model to pick it from the catalog. The `/` menu lists them as
10558
10055
  `/agentsdk-create-agent`, `/agentsdk-hillclimb`, and the rest. Re-installing overwrites those
10559
- copies with the package version. Set
10560
- `CURSOR_JULY_SKIP_SKILL_INSTALL=1` to skip the copy.
10056
+ copies with the package version.
10561
10057
  - Installed `@cursor/july` as a dependency? The skill also ships inside
10562
10058
  the package at `node_modules/@cursor/july/skills/create-agent/SKILL.md`.
10563
- - Working in the monorepo? It's at
10564
- `packages/agent-serve/skills/create-agent/SKILL.md`. Run
10059
+ - Working from this package's source? The skill is at
10060
+ [`skills/create-agent/SKILL.md`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/skills/create-agent/SKILL.md). Run
10565
10061
  `agent-sdk install-skills` if you want the same copies in
10566
10062
  `~/.cursor/skills/agentsdk/` (the package postinstall skips the
10567
10063
  source checkout).
@@ -10661,7 +10157,7 @@ inputs again, and adds an eval for each improvement you keep.
10661
10157
 
10662
10158
  ## Related
10663
10159
 
10664
- - [Build your first PR approver](/docs/quickstart.md)
10160
+ - [Build your first PR reviewer](/docs/quickstart.md)
10665
10161
  - [Convert a Cursor Automation](/docs/guides/convert-automation.md)
10666
10162
  - [Building agents with agents](/docs/building-with-agents.md)
10667
10163
  - [Evals](/docs/evals.md)
@@ -10676,15 +10172,10 @@ Source: /docs/storage.md
10676
10172
 
10677
10173
  The Agent SDK owns durable storage for sessions, continuation tokens,
10678
10174
  reminders, playground eval history, and live A/B samples. It chooses the
10679
- keys (under `agentkit/v1/`), when to read and write, and how to restore
10680
- after restart.
10175
+ keys, when to read and write, and how to restore after restart.
10681
10176
 
10682
- Keys have bounded length: caller-controlled segments (channel ids,
10683
- continuation tokens) are URI-encoded, and any segment past 256 encoded
10684
- bytes is replaced by its `sha256:…` digest — deterministically, so writes
10685
- and lookups always agree. Backends can rely on this instead of imposing
10686
- their own key-length caps (which would silently drop writes, since a
10687
- throwing `put` is at-most-once).
10177
+ The Agent SDK owns key encoding. Backends must accept the keys they are
10178
+ given. Do not fail `put` to enforce a shorter cap.
10688
10179
 
10689
10180
  By default that storage lives under `--state-root` on local disk. Fine
10690
10181
  for one machine; it does not survive replacing the host.
@@ -10692,8 +10183,7 @@ for one machine; it does not survive replacing the host.
10692
10183
  To keep the same framework storage across hosts, plug in a key-value
10693
10184
  backend with `agent/storage.ts`. You provide `put` / `get` / `delete` /
10694
10185
  `list`. The optional `cas` group adds conditional writes (see
10695
- [Conditional writes](#conditional-writes-the-cas-group)). The Agent SDK
10696
- does the rest.
10186
+ [Conditional writes](#conditional-writes-the-cas-group)).
10697
10187
 
10698
10188
  ```ts
10699
10189
  // agent/storage.ts
@@ -10713,15 +10203,10 @@ export default defineStorage({
10713
10203
  });
10714
10204
  ```
10715
10205
 
10716
- > [!NOTE]
10717
- > Import paths here use `@cursor/july/storage`. On projects still
10718
- > using `@anysphere/agent-serve`, swap the import. See
10719
- > [Run the CLI](/docs/index.md#run-the-cli) for the full rename table.
10720
-
10721
10206
  ## Which fields to provide
10722
10207
 
10723
- Implement the small KV core `put`/`get`/`delete`/`list` plus the `cas`
10724
- group and you get **full functionality**: eval-run and A/B history are
10208
+ Implement the small KV core (`put`/`get`/`delete`/`list` plus the `cas`
10209
+ group) and you get **full functionality**: eval-run and A/B history are
10725
10210
  derived over the core automatically. The dedicated `evals` / `abs` groups
10726
10211
  are backend-native optimizations, not required-or-lose-history hooks.
10727
10212
 
@@ -10729,13 +10214,13 @@ are backend-native optimizations, not required-or-lose-history hooks.
10729
10214
  | --- | --- | --- |
10730
10215
  | `put` | Yes | Write or update a value |
10731
10216
  | `cas` | Optional | Conditional writes; see [Conditional writes](#conditional-writes-the-cas-group) |
10732
- | `get` | For restore | Look up one key (also: derived A/B snapshot backfill) |
10733
- | `list` | For restore | Return entries under a prefix, in key order (also: derived eval-runs hydrate) |
10734
- | `delete` | For cleanup | Remove a key (also: derived eval-runs pruning) |
10217
+ | `get` | For restore | Look up one key |
10218
+ | `list` | For restore | Return entries under a prefix, in key order |
10219
+ | `delete` | For cleanup | Remove a key |
10735
10220
  | `name` | No | Label surfaced on `GET /v1/info` diagnostics |
10736
10221
  | `policy` | No | Timing knobs; see [Policy](#policy) |
10737
- | `evals` | No | Backend-native eval-runs table; derived over the core when omitted see [Eval and A/B tables](#eval-and-a-b-tables) |
10738
- | `abs` | No | Backend-native A/B metrics table; derived over the core when omitted see [Eval and A/B tables](#eval-and-a-b-tables) |
10222
+ | `evals` | No | Backend-native eval-runs table; derived over the core when omitted. See [Eval and A/B tables](#eval-and-a-b-tables) |
10223
+ | `abs` | No | Backend-native A/B metrics table; derived over the core when omitted. See [Eval and A/B tables](#eval-and-a-b-tables) |
10739
10224
 
10740
10225
  A throwing `put` is logged and dropped. It never fails a turn. When
10741
10226
  resolving a missing continuation token, a throwing `get` fails the
@@ -10749,30 +10234,20 @@ values. Both are **optional optimizations**: when a group is not
10749
10234
  authored, `defineStorage` derives it over the KV core, so a backend that
10750
10235
  implements only the core loses nothing. Author a group only when the
10751
10236
  backend has a better native shape (a real database table, an analytics
10752
- pipeline) the built-in `fileKv` and `cursorHostedStorage` both do.
10237
+ pipeline). The built-in `fileKv` and `cursorHostedStorage` both do.
10753
10238
 
10754
10239
  `evals` keeps playground eval batches across restarts (`put`, `delete`,
10755
- `list` over run snapshots keyed by `runId`). The Agent SDK upserts a
10756
- snapshot as a batch starts, progresses, and finishes, prunes runs past
10757
- the playground history window, and lists everything back at serve start.
10758
- **Derived form**: one key per run under
10759
- `agentkit/v1/{agent}/eval-runs/{runId}` — needs core `put` + `delete` +
10760
- `list`. Only a core missing `delete` or `list` leaves eval history in
10761
- process memory (cleared on restart). See
10762
- [Evals](/docs/evals.md#configure-eval-runs).
10240
+ `list` over run snapshots keyed by `runId`). A core missing `delete` or
10241
+ `list` leaves eval history in memory until restart.
10242
+ See [Evals](/docs/evals.md#configure-eval-runs).
10763
10243
 
10764
10244
  `abs` exports live A/B metrics: `putSample` appends one cumulative
10765
10245
  metric sample per enrolled experiment on each completed or failed turn;
10766
10246
  optional `putSnapshot` / `getSnapshot` store and serve back the latest
10767
- aggregate so a replacement host with no local sessions can still serve
10768
- the A/Bs surface. **Derived form**: each sample lands as its own key
10769
- (`agentkit/v1/{agent}/ab-samples/{experiment}/{sessionId}/{at}` a
10770
- blind append-only put, never a read-modify-write of one growing array)
10771
- and the snapshot lives at the fixed `agentkit/v1/{agent}/ab-snapshot`
10772
- key (last-write-wins is correct for "latest aggregate"). `putSample` and
10773
- `putSnapshot` need only core `put`; `getSnapshot` needs core `get`.
10774
- Session event logs remain the assignment source of truth either way. See
10775
- [Live A/B metrics](/docs/ab.md).
10247
+ aggregate so a replacement host can still serve the A/Bs surface.
10248
+ `putSample` and `putSnapshot` need only core `put`; `getSnapshot` needs
10249
+ core `get`. Session event logs remain the assignment source of truth
10250
+ either way. See [Live A/B metrics](/docs/ab.md).
10776
10251
 
10777
10252
  ## Policy
10778
10253
 
@@ -10806,8 +10281,6 @@ follow-up arrives instead of at startup.
10806
10281
  With `get` and `list`, serve can rebuild local state from your store:
10807
10282
 
10808
10283
  - At startup, the Agent SDK loads recent sessions up to the restore caps.
10809
- Local disk wins when both sides have the same session. Reminders
10810
- hydrate the same way into `--state-root/reminders`.
10811
10284
  - On demand, a missing continuation token resolves through the store
10812
10285
  and resumes that session.
10813
10286
  - Playground eval history and A/B aggregates can load from the same
@@ -10826,19 +10299,16 @@ await ctx.host.kv.put("alert-memory/abc", { updated: "…" });
10826
10299
  const prior = await ctx.host.kv.get("alert-memory/abc");
10827
10300
  ```
10828
10301
 
10829
- The Agent SDK prefixes author keys as `agentkit/v1/{agent}/kv/{key}` (same
10830
- bounded encoding as continuation tokens). Writes **await** the sink and
10831
- propagate errors — unlike session mirrors, which are at-most-once.
10302
+ Writes **await** the sink and propagate errors, unlike session mirrors,
10303
+ which are at-most-once.
10832
10304
 
10833
- Without `agent/storage.ts`, `host.kv` falls back to files under
10834
- `--state-root/kv`. That is fine for local dogfood; it does **not**
10835
- survive replacing the host. For Cursor-managed hosting, prefer
10836
- `@cursor/july/storage/cursor-hosted` so sessions and author KV share the
10837
- platform Bugbot tables through a control-plane HTTP proxy (authenticated
10838
- as the deployment pod credential — engines never receive a database URL).
10305
+ Without `agent/storage.ts`, `host.kv` is local-only and does not
10306
+ survive replacing the host. Hosted agents should author
10307
+ `cursorHostedStorage()` so session and `host.kv` records survive
10308
+ replace.
10839
10309
 
10840
10310
  ```ts
10841
- // agent/storage.ts Cursor-managed hosting
10311
+ // agent/storage.ts: Cursor-managed hosting
10842
10312
  import { defineStorage } from "@cursor/july/storage";
10843
10313
  import { cursorHostedStorage } from "@cursor/july/storage/cursor-hosted";
10844
10314
 
@@ -10851,32 +10321,18 @@ Built-in helpers:
10851
10321
 
10852
10322
  | Import | Backend |
10853
10323
  | --- | --- |
10854
- | `@cursor/july/storage/file-kv` | File-per-key under `.agent-serve/kv` |
10855
- | `@cursor/july/storage/cursor-hosted` | Platform Bugbot `agent_serve_*` via control-plane proxy |
10324
+ | `@cursor/july/storage/file-kv` | File-per-key under the project state directory |
10325
+ | `@cursor/july/storage/cursor-hosted` | Cursor-managed hosting; records survive replace |
10856
10326
 
10857
10327
  ## Bring your own backend
10858
10328
 
10859
- There is no built-in Postgres backend on purpose. Cursor's internal
10860
- `agent_serve_*` tables are owned by the backend and reachable only
10861
- through the hosted proxy, and this doc does not prescribe a schema —
10862
- what you back the KV with is your call. Any durable store works:
10863
-
10864
- - **Local disk** the built-in `fileKv` (single process only).
10865
- - **Object storage (S3-class)** one object per key; conditional
10866
- writes map directly onto the contract (`putIfAbsent` = put with
10867
- `If-None-Match: *`, `putIfVersion` = put with `If-Match: <etag>`,
10868
- the ETag is the version token, `listKeys` is a prefix listing).
10869
- - **Redis, DynamoDB, a SQL table, …** — anything that can do an
10870
- atomic compare-and-set and a prefix listing.
10871
-
10872
- Implement the `StorageConfig` methods (and the optional `cas` group)
10873
- against that store. The
10874
- contract, defined at `@cursor/july/kv`: version tokens are opaque
10875
- strings that change on every successful write — including plain
10876
- `put`, so a stale token fences instead of clobbering; conditional
10877
- writes are atomic; `listKeys` returns every key under the prefix.
10878
- `@cursor/july/kv/memory` is a complete reference implementation to
10879
- compare behavior against.
10329
+ Any durable store works if it can put, get, delete, list by prefix,
10330
+ and optionally compare-and-set. Implement the `StorageConfig` methods
10331
+ (and the optional `cas` group) against that store. The contract,
10332
+ defined at `@cursor/july/kv`: version tokens are opaque strings that
10333
+ change on every successful write, including plain `put`, so a stale
10334
+ token fences instead of clobbering; conditional writes are atomic;
10335
+ `listKeys` returns every key under the prefix.
10880
10336
 
10881
10337
  ## Conditional writes (the `cas` group)
10882
10338
 
@@ -10884,13 +10340,10 @@ The `cas` group is compare-and-swap over the same keyspace:
10884
10340
  `getWithVersion` / `putIfAbsent` / `putIfVersion` / `listKeys`, defined
10885
10341
  backend-agnostically at `@cursor/july/kv`. Plain storage works without
10886
10342
  it, so an existing backend keeps working across a platform upgrade.
10887
- `defineStorage` rejects a partial group implement all four methods or
10343
+ `defineStorage` rejects a partial group. Implement all four methods or
10888
10344
  none. Version tokens are opaque strings that must change on every write
10889
10345
  (a counter column, a row version, a content hash). The built-in backends
10890
- both include it: `fileKv` uses content-hash tokens (single-process
10891
- correctness) and `cursorHostedStorage` the control-plane proxy (a
10892
- `version` counter on the server). `memoryCasTable()` is for test fixtures
10893
- and inert sinks only.
10346
+ both include the group.
10894
10347
 
10895
10348
  ---
10896
10349
 
@@ -10925,7 +10378,7 @@ agent-sdk login
10925
10378
  agent-sdk dev
10926
10379
  ```
10927
10380
 
10928
- PR events stream through your Cursor account no webhook or GitHub App
10381
+ PR events stream through your Cursor account. No webhook or GitHub App
10929
10382
  setup. Open a PR, or replay a real one deterministically (this also works
10930
10383
  with `repos` empty):
10931
10384
 
@@ -10968,7 +10421,7 @@ applies the deterministic decision:
10968
10421
 
10969
10422
  - **Approve** when the tier is low and no matched rule demands a human,
10970
10423
  bound to the head SHA.
10971
- - **Request reviewers** otherwise the policy owners (max 2, never the
10424
+ - **Request reviewers** otherwise: the policy owners (max 2, never the
10972
10425
  author), plus one status comment the agent keeps updated in place.
10973
10426
 
10974
10427
  The model never writes to GitHub. A broken policy file fails closed with
@@ -11165,12 +10618,9 @@ opted-in PR wakes the agent. A comment on a plain GitHub issue does
11165
10618
  not. The channel buffers about 3 seconds per PR. Payload details are
11166
10619
  dropped on purpose. The follow-up says something changed.
11167
10620
 
11168
- Pending wakes snapshot to `host.kv` (`webhook-buffer`) before the
11169
- webhook is ACKed, and restore on restart. Affinity is
11170
- `affinity/{owner/repo#N}` `bc-…` in the same store, written from
11171
- `agent.bound`. `agent/storage.ts` uses `cursorHostedStorage`, so both
11172
- survive host replace. Local serve without that plug-in falls back to
11173
- `--state-root/kv`.
10621
+ Pending wakes and the PR-to-cloud-agent map persist in `host.kv` so
10622
+ they survive restart. `cursorHostedStorage` keeps both across replace.
10623
+ Without that plug-in, `host.kv` is local-only.
11174
10624
 
11175
10625
  Closing a PR cancels its merge-conflict reminder and drops buffered
11176
10626
  wakes.
@@ -11414,8 +10864,8 @@ Start with four checks, in order:
11414
10864
  3. What the playground or HTTP API shows
11415
10865
  4. The session event stream (trace)
11416
10866
 
11417
- Match your symptom below. Keep the commands as `agent-sdk`; see
11418
- [Run the CLI](/docs/index.md#run-the-cli) if you still need an alias.
10867
+ Match your symptom below. Keep the commands as `agent-sdk`. If it is
10868
+ not on `PATH`, use `npx @cursor/july`.
11419
10869
 
11420
10870
  ## What if serve or the playground looks wrong?
11421
10871
 
@@ -11423,9 +10873,9 @@ Match your symptom below. Keep the commands as `agent-sdk`; see
11423
10873
  | --- | --- |
11424
10874
  | `serve` won't start | Run `agent-sdk validate --dir .` and fix the reported errors. |
11425
10875
  | Playground is blank or says there are no agents | The UI needs a running `serve` process. Building the playground assets alone is not enough. |
11426
- | Edits to the playground don't show up | Use `serve --dev` and open the printed playground HMR URL (often port `5273`), not only the static `:3000` URL. |
11427
- | Sessions exist on disk but the playground list is empty | The list shows sessions for the authenticated caller. In `--dev` on loopback the list is wider. Otherwise open `/<slug>/playground?sessionId=ses_…` or inspect `sessions/` under your state root. |
11428
- | Port 3000 or 5273 is already in use | For the default serve port, the CLI tries the next free port and prints a notice. Pass `--port` to pick one, or `--port 0` for any free port. Stop leftover Vite or webhook-forwarder processes if you need the original port. |
10876
+ | The playground UI looks stale | `serve --dev` prints a playground URL. Open that URL. Agent-file edits still need a restart (press Enter on the TTY). |
10877
+ | Sessions exist but the playground list is empty | The list shows sessions for the authenticated caller. In `--dev` on loopback the list is wider. Otherwise open `/<slug>/playground?sessionId=ses_…`. |
10878
+ | Port 3000 is already in use | For the default serve port, the CLI tries the next free port and prints a notice. Pass `--port` to pick one, or `--port 0` for any free port. Stop leftover playground or webhook-forwarder processes if you need the original port. |
11429
10879
 
11430
10880
  ## What if a model turn goes wrong?
11431
10881
 
@@ -11433,7 +10883,7 @@ Match your symptom below. Keep the commands as `agent-sdk`; see
11433
10883
  | --- | --- |
11434
10884
  | Built-in file reads and greps fail; the turn retries for a long time | Run under Node 22.13+ (or `tsx`), never Bun. Look for `NGHTTP2_FRAME_SIZE_ERROR` in logs. |
11435
10885
  | The turn fails immediately with an API-key error | Sign in with `agent-sdk login`, or set `CURSOR_API_KEY`. Discovery, `info`, `call`, and serve bring-up work without a key; model turns need one. |
11436
- | Replies quote rules or `AGENTS.md` from outside your agent project | The session workspace inherited parent-folder config. Nested git checkouts default `local.cwd` to `~/.cache/agent-serve/<dir>`. Point `defineAgent({ local: { cwd } })` at a checkout only when the agent should inherit that tree, or set `--state-root` to a clean directory (for example under `/tmp`). |
10886
+ | Replies quote rules or `AGENTS.md` from outside your agent project | The session workspace inherited parent-folder config. Nested git checkouts default `local.cwd` to a per-project cache directory under `~/.cache`. Point `defineAgent({ local: { cwd } })` at a checkout only when the agent should inherit that tree, or set `--state-root` to a clean directory (for example under `/tmp`). |
11437
10887
  | Yellow box shows Datadog/Linear tools, but the model lists `GetDynamicTools` / IDE `cursor` tools and never calls them | Attached MCP sits behind harness meta-tools, or `hostOnly` hid the connection, or the harness cwd is still inside another checkout. Set `advertiseTools: true` for named tools on local turns. Check `GET /v1/info` `local.cwd` and `connections[].advertiseTools`. |
11438
10888
  | Server tools, skills, or workspace seed files never appear | Server tools and sandbox seeds apply on the local runtime (cloud server tools need `--public-url` / `--cloud-tools-url`). Skills reach cloud through the Agent Store when hosting or a personal `CURSOR_API_KEY` is available; otherwise only skills already in the cloud repo. `validate` warns when this combination is present. |
11439
10889
  | `validate` and `run` succeed, but typecheck fails in CI | The CLI runs TypeScript with type-stripping only. Keep tool `execute` return types as object literals or `type` aliases, not `interface` types. |