@cursor/july 0.1.101 → 0.1.102

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 (374) hide show
  1. package/README.md +27 -0
  2. package/dist/channels/slack/api.d.ts +1 -1
  3. package/dist/channels/slack/api.d.ts.map +1 -1
  4. package/dist/channels/slack/api.js +3 -1
  5. package/dist/channels/slack/assistant.d.ts +1 -1
  6. package/dist/channels/slack/assistant.d.ts.map +1 -1
  7. package/dist/channels/slack/dispatch.d.ts +3 -2
  8. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  9. package/dist/channels/slack/dispatch.js +28 -8
  10. package/dist/channels/slack/inbound.d.ts +8 -0
  11. package/dist/channels/slack/inbound.d.ts.map +1 -1
  12. package/dist/channels/slack/inbound.js +28 -0
  13. package/dist/channels/slack/manifest.d.ts.map +1 -1
  14. package/dist/channels/slack/manifest.js +2 -1
  15. package/dist/docs/404.html +2 -2
  16. package/dist/docs/ab.html +4 -4
  17. package/dist/docs/assets/{app.BASO9Kih.js → app.CLA03RCz.js} +1 -1
  18. package/dist/docs/assets/chunks/@localSearchIndexroot.FAqdWIXo.js +1 -0
  19. package/dist/docs/assets/chunks/{VPLocalSearchBox.DwkqxoE0.js → VPLocalSearchBox.ifxv-cJV.js} +1 -1
  20. package/dist/docs/assets/chunks/{theme.CCil_13e.js → theme.DWCwM6p-.js} +2 -2
  21. package/dist/docs/assets/concepts.md.rPzW2HZN.js +1 -0
  22. package/dist/docs/assets/guides_cloud-agents.md.DumwWXba.js +9 -0
  23. package/dist/docs/assets/guides_cloud-agents.md.DumwWXba.lean.js +1 -0
  24. package/dist/docs/assets/{guides_cloud-runtime.md.CkYbjnAX.js → guides_cloud-runtime.md.BRirbRAN.js} +1 -1
  25. package/dist/docs/assets/index.md.Kiht7ell.js +5 -0
  26. package/dist/docs/assets/{index.md.Bb4k8kUm.lean.js → index.md.Kiht7ell.lean.js} +1 -1
  27. package/dist/docs/assets/reference_extensions.md.9WQMZe1l.js +56 -0
  28. package/dist/docs/assets/reference_extensions.md.9WQMZe1l.lean.js +1 -0
  29. package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.js → reference_project-layout.md.CA6QP6Lw.js} +2 -2
  30. package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.lean.js → reference_project-layout.md.CA6QP6Lw.lean.js} +1 -1
  31. package/dist/docs/assets/{reference_skills.md.BFW9retM.js → reference_skills.md.l2ezAcaN.js} +1 -1
  32. package/dist/docs/assets/{reference_tools.md.CvAHsdSp.js → reference_tools.md.B1up2r9W.js} +1 -1
  33. package/dist/docs/assets/skills_framework-map.md.DDa4MeEW.js +1 -0
  34. package/dist/docs/assets/{skills_framework-map.md.BTi817yv.lean.js → skills_framework-map.md.DDa4MeEW.lean.js} +1 -1
  35. package/dist/docs/building-with-agents.html +4 -4
  36. package/dist/docs/concepts.html +5 -5
  37. package/dist/docs/concepts.md +3 -3
  38. package/dist/docs/deployment.html +4 -4
  39. package/dist/docs/evals.html +4 -4
  40. package/dist/docs/guides/agent-to-agent.html +4 -4
  41. package/dist/docs/guides/cloud-agents.html +35 -0
  42. package/dist/docs/guides/cloud-agents.md +93 -0
  43. package/dist/docs/guides/cloud-runtime.html +6 -6
  44. package/dist/docs/guides/cloud-runtime.md +2 -0
  45. package/dist/docs/guides/convert-automation.html +4 -4
  46. package/dist/docs/guides/github.html +4 -4
  47. package/dist/docs/guides/human-in-the-loop.html +4 -4
  48. package/dist/docs/guides/mcp-oauth.html +4 -4
  49. package/dist/docs/guides/opentelemetry.html +5 -5
  50. package/dist/docs/guides/slack.html +4 -4
  51. package/dist/docs/guides/webhooks.html +4 -4
  52. package/dist/docs/hashmap.json +1 -1
  53. package/dist/docs/hillclimbing.html +4 -4
  54. package/dist/docs/index.html +6 -6
  55. package/dist/docs/index.md +5 -1
  56. package/dist/docs/llms-full.txt +321 -4
  57. package/dist/docs/llms.txt +2 -0
  58. package/dist/docs/quickstart.html +4 -4
  59. package/dist/docs/reference/agent-config.html +4 -4
  60. package/dist/docs/reference/artifacts.html +4 -4
  61. package/dist/docs/reference/channels.html +5 -5
  62. package/dist/docs/reference/cli.html +4 -4
  63. package/dist/docs/reference/connections.html +4 -4
  64. package/dist/docs/reference/extensions.html +82 -0
  65. package/dist/docs/reference/extensions.md +200 -0
  66. package/dist/docs/reference/hooks.html +4 -4
  67. package/dist/docs/reference/http-api.html +4 -4
  68. package/dist/docs/reference/instructions.html +4 -4
  69. package/dist/docs/reference/playground.html +4 -4
  70. package/dist/docs/reference/project-layout.html +6 -6
  71. package/dist/docs/reference/project-layout.md +3 -0
  72. package/dist/docs/reference/prompt.html +4 -4
  73. package/dist/docs/reference/schedules.html +4 -4
  74. package/dist/docs/reference/sessions.html +4 -4
  75. package/dist/docs/reference/skills.html +6 -6
  76. package/dist/docs/reference/skills.md +2 -0
  77. package/dist/docs/reference/subagents.html +5 -5
  78. package/dist/docs/reference/tools.html +6 -6
  79. package/dist/docs/reference/tools.md +2 -0
  80. package/dist/docs/scaffolding-agents.html +4 -4
  81. package/dist/docs/skills/ab.html +4 -4
  82. package/dist/docs/skills/create-agent.html +4 -4
  83. package/dist/docs/skills/debug.html +4 -4
  84. package/dist/docs/skills/evals.html +4 -4
  85. package/dist/docs/skills/framework-map.html +5 -5
  86. package/dist/docs/skills/framework-map.md +1 -0
  87. package/dist/docs/skills/github.html +4 -4
  88. package/dist/docs/skills/hillclimb.html +4 -4
  89. package/dist/docs/skills/index.html +4 -4
  90. package/dist/docs/skills/mcp-auth.html +4 -4
  91. package/dist/docs/skills/otel.html +4 -4
  92. package/dist/docs/skills/setup-slack.html +4 -4
  93. package/dist/docs/storage.html +4 -4
  94. package/dist/docs/templates/agentic-owners.html +4 -4
  95. package/dist/docs/templates/agents-md.html +4 -4
  96. package/dist/docs/templates/code-wiki.html +4 -4
  97. package/dist/docs/templates/demo.html +4 -4
  98. package/dist/docs/templates/pr-autofixer.html +4 -4
  99. package/dist/docs/templates/security-help.html +4 -4
  100. package/dist/docs/templates/security-reviewer.html +4 -4
  101. package/dist/docs/templates/triage.html +4 -4
  102. package/dist/docs/troubleshooting.html +4 -4
  103. package/dist/extensions/cursor-cloud-agents/extension.d.ts +9 -7
  104. package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
  105. package/dist/extensions/cursor-cloud-agents/extension.js +9 -7
  106. package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +78 -0
  107. package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -0
  108. package/dist/extensions/cursor-cloud-agents/lib/backend.js +286 -0
  109. package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +5 -0
  110. package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -0
  111. package/dist/extensions/cursor-cloud-agents/lib/inputs.js +4 -0
  112. package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts +8 -0
  113. package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts.map +1 -0
  114. package/dist/extensions/cursor-cloud-agents/lib/transcript.js +15 -0
  115. package/dist/extensions/cursor-cloud-agents/skills/handoff.md +21 -7
  116. package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts +4 -0
  117. package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts.map +1 -0
  118. package/dist/extensions/cursor-cloud-agents/tools/cancel.js +26 -0
  119. package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts +4 -0
  120. package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts.map +1 -0
  121. package/dist/extensions/cursor-cloud-agents/tools/dump.js +54 -0
  122. package/dist/extensions/cursor-cloud-agents/tools/get.d.ts +4 -0
  123. package/dist/extensions/cursor-cloud-agents/tools/get.d.ts.map +1 -0
  124. package/dist/extensions/cursor-cloud-agents/tools/get.js +25 -0
  125. package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -1
  126. package/dist/extensions/cursor-cloud-agents/tools/launch.js +14 -38
  127. package/dist/extensions/cursor-cloud-agents/tools/list.js +1 -1
  128. package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts +4 -0
  129. package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts.map +1 -0
  130. package/dist/extensions/cursor-cloud-agents/tools/{follow_up.js → reply.js} +12 -14
  131. package/dist/extensions.d.ts +38 -14
  132. package/dist/extensions.d.ts.map +1 -1
  133. package/dist/extensions.js +49 -12
  134. package/dist/files-backends/cursor-hosted.d.ts +0 -8
  135. package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
  136. package/dist/files-backends/cursor-hosted.js +1 -11
  137. package/dist/files.d.ts +5 -1
  138. package/dist/files.d.ts.map +1 -1
  139. package/dist/files.js +22 -18
  140. package/dist/index.d.ts +3 -3
  141. package/dist/index.d.ts.map +1 -1
  142. package/dist/index.js +2 -2
  143. package/dist/internal/conversation-mirror.d.ts.map +1 -1
  144. package/dist/internal/conversation-mirror.js +13 -15
  145. package/dist/internal/cursor/backend-client.d.ts +8 -1
  146. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  147. package/dist/internal/cursor/backend-client.js +25 -9
  148. package/dist/internal/cursor/hosted-store-secrets.d.ts +11 -0
  149. package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -1
  150. package/dist/internal/cursor/hosted-store-secrets.js +15 -0
  151. package/dist/internal/discovery/ab.d.ts +9 -0
  152. package/dist/internal/discovery/ab.d.ts.map +1 -0
  153. package/dist/internal/discovery/ab.js +101 -0
  154. package/dist/internal/discovery/agent-config.d.ts +35 -0
  155. package/dist/internal/discovery/agent-config.d.ts.map +1 -0
  156. package/dist/internal/discovery/agent-config.js +173 -0
  157. package/dist/internal/discovery/agent.d.ts +11 -0
  158. package/dist/internal/discovery/agent.d.ts.map +1 -0
  159. package/dist/internal/discovery/agent.js +306 -0
  160. package/dist/internal/discovery/channels.d.ts +10 -0
  161. package/dist/internal/discovery/channels.d.ts.map +1 -0
  162. package/dist/internal/discovery/channels.js +97 -0
  163. package/dist/internal/discovery/connections.d.ts +17 -0
  164. package/dist/internal/discovery/connections.d.ts.map +1 -0
  165. package/dist/internal/discovery/connections.js +436 -0
  166. package/dist/internal/discovery/context.d.ts +20 -0
  167. package/dist/internal/discovery/context.d.ts.map +1 -0
  168. package/dist/internal/discovery/context.js +30 -0
  169. package/dist/internal/discovery/cursor-plugin.d.ts +25 -0
  170. package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -0
  171. package/dist/internal/discovery/cursor-plugin.js +570 -0
  172. package/dist/internal/discovery/extensions.d.ts +19 -0
  173. package/dist/internal/discovery/extensions.d.ts.map +1 -0
  174. package/dist/internal/discovery/extensions.js +238 -0
  175. package/dist/internal/discovery/fs.d.ts +15 -0
  176. package/dist/internal/discovery/fs.d.ts.map +1 -0
  177. package/dist/internal/discovery/fs.js +115 -0
  178. package/dist/internal/discovery/hooks.d.ts +7 -0
  179. package/dist/internal/discovery/hooks.d.ts.map +1 -0
  180. package/dist/internal/discovery/hooks.js +48 -0
  181. package/dist/internal/discovery/info.d.ts +6 -0
  182. package/dist/internal/discovery/info.d.ts.map +1 -0
  183. package/dist/internal/discovery/info.js +141 -0
  184. package/dist/internal/discovery/instructions.d.ts +7 -0
  185. package/dist/internal/discovery/instructions.d.ts.map +1 -0
  186. package/dist/internal/discovery/instructions.js +95 -0
  187. package/dist/internal/discovery/modules.d.ts +20 -0
  188. package/dist/internal/discovery/modules.d.ts.map +1 -0
  189. package/dist/internal/discovery/modules.js +101 -0
  190. package/dist/internal/discovery/names.d.ts +12 -0
  191. package/dist/internal/discovery/names.d.ts.map +1 -0
  192. package/dist/internal/discovery/names.js +36 -0
  193. package/dist/internal/discovery/project.d.ts +53 -0
  194. package/dist/internal/discovery/project.d.ts.map +1 -0
  195. package/dist/internal/discovery/project.js +239 -0
  196. package/dist/internal/discovery/runtime.d.ts +34 -0
  197. package/dist/internal/discovery/runtime.d.ts.map +1 -0
  198. package/dist/internal/discovery/runtime.js +98 -0
  199. package/dist/internal/discovery/schedules.d.ts +7 -0
  200. package/dist/internal/discovery/schedules.d.ts.map +1 -0
  201. package/dist/internal/discovery/schedules.js +97 -0
  202. package/dist/internal/discovery/seed-files.d.ts +7 -0
  203. package/dist/internal/discovery/seed-files.d.ts.map +1 -0
  204. package/dist/internal/discovery/seed-files.js +41 -0
  205. package/dist/internal/discovery/services.d.ts +17 -0
  206. package/dist/internal/discovery/services.d.ts.map +1 -0
  207. package/dist/internal/discovery/services.js +104 -0
  208. package/dist/internal/discovery/skills.d.ts +16 -0
  209. package/dist/internal/discovery/skills.d.ts.map +1 -0
  210. package/dist/internal/discovery/skills.js +151 -0
  211. package/dist/internal/discovery/subagent.d.ts +13 -0
  212. package/dist/internal/discovery/subagent.d.ts.map +1 -0
  213. package/dist/internal/discovery/subagent.js +19 -0
  214. package/dist/internal/discovery/tools.d.ts +18 -0
  215. package/dist/internal/discovery/tools.d.ts.map +1 -0
  216. package/dist/internal/discovery/tools.js +159 -0
  217. package/dist/internal/discovery.d.ts +8 -62
  218. package/dist/internal/discovery.d.ts.map +1 -1
  219. package/dist/internal/discovery.js +8 -2505
  220. package/dist/internal/framework-file-storage.js +6 -6
  221. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  222. package/dist/internal/framework-storage-selection.js +8 -7
  223. package/dist/internal/frontmatter.d.ts +11 -3
  224. package/dist/internal/frontmatter.d.ts.map +1 -1
  225. package/dist/internal/frontmatter.js +29 -3
  226. package/dist/internal/mcp-host.d.ts.map +1 -1
  227. package/dist/internal/mcp-host.js +37 -20
  228. package/dist/internal/otel/collector.d.ts +13 -0
  229. package/dist/internal/otel/collector.d.ts.map +1 -1
  230. package/dist/internal/otel/collector.js +84 -17
  231. package/dist/internal/otel/http.d.ts.map +1 -1
  232. package/dist/internal/otel/http.js +2 -10
  233. package/dist/internal/otel/mcp.d.ts +16 -0
  234. package/dist/internal/otel/mcp.d.ts.map +1 -0
  235. package/dist/internal/otel/mcp.js +68 -0
  236. package/dist/internal/otel/propagation.d.ts +6 -0
  237. package/dist/internal/otel/propagation.d.ts.map +1 -0
  238. package/dist/internal/otel/propagation.js +14 -0
  239. package/dist/internal/otel/runtime.d.ts.map +1 -1
  240. package/dist/internal/otel/runtime.js +2 -0
  241. package/dist/internal/session-engine.d.ts +5 -0
  242. package/dist/internal/session-engine.d.ts.map +1 -1
  243. package/dist/internal/session-engine.js +68 -32
  244. package/dist/internal/session-run-log.d.ts +2 -1
  245. package/dist/internal/session-run-log.d.ts.map +1 -1
  246. package/dist/internal/session-run-log.js +13 -14
  247. package/dist/internal/start-log-store.d.ts +1 -1
  248. package/dist/internal/start-log-store.d.ts.map +1 -1
  249. package/dist/internal/start-log-store.js +12 -14
  250. package/dist/internal/storage-coordinator.d.ts +4 -1
  251. package/dist/internal/storage-coordinator.d.ts.map +1 -1
  252. package/dist/internal/storage-coordinator.js +15 -13
  253. package/dist/internal/tool-catalog.d.ts.map +1 -1
  254. package/dist/internal/tool-catalog.js +9 -6
  255. package/dist/internal/turn-cost.d.ts +14 -0
  256. package/dist/internal/turn-cost.d.ts.map +1 -1
  257. package/dist/internal/turn-cost.js +41 -9
  258. package/dist/internal/v2-hosting.d.ts +22 -0
  259. package/dist/internal/v2-hosting.d.ts.map +1 -0
  260. package/dist/internal/v2-hosting.js +23 -0
  261. package/dist/otel.d.ts +16 -0
  262. package/dist/otel.d.ts.map +1 -1
  263. package/dist/otel.js +26 -0
  264. package/dist/playground/assets/index-B6C9S9nG.css +1 -0
  265. package/dist/playground/index.html +2 -2
  266. package/dist/storage-protocol.d.ts +24 -23
  267. package/dist/storage-protocol.d.ts.map +1 -1
  268. package/dist/storage-protocol.js +68 -65
  269. package/dist/storage.d.ts +2 -2
  270. package/dist/storage.d.ts.map +1 -1
  271. package/dist/storage.js +1 -1
  272. package/dist/tools.d.ts +9 -0
  273. package/dist/tools.d.ts.map +1 -1
  274. package/dist/tools.js +9 -0
  275. package/dist/types.d.ts +39 -3
  276. package/dist/types.d.ts.map +1 -1
  277. package/docs/README.md +5 -1
  278. package/docs/concepts.md +3 -3
  279. package/docs/guides/cloud-agents.md +98 -0
  280. package/docs/guides/cloud-runtime.md +2 -0
  281. package/docs/reference/extensions.md +205 -0
  282. package/docs/reference/project-layout.md +3 -0
  283. package/docs/reference/skills.md +2 -0
  284. package/docs/reference/tools.md +2 -0
  285. package/package.json +1 -1
  286. package/skills/framework-map/SKILL.md +1 -0
  287. package/src/channels/slack/api.ts +4 -2
  288. package/src/channels/slack/assistant.ts +1 -1
  289. package/src/channels/slack/dispatch.ts +27 -2
  290. package/src/channels/slack/inbound.ts +37 -0
  291. package/src/channels/slack/manifest.ts +2 -1
  292. package/src/extensions/cursor-cloud-agents/extension.ts +9 -7
  293. package/src/extensions/cursor-cloud-agents/lib/backend.ts +395 -0
  294. package/src/extensions/cursor-cloud-agents/lib/inputs.ts +5 -0
  295. package/src/extensions/cursor-cloud-agents/lib/transcript.ts +23 -0
  296. package/src/extensions/cursor-cloud-agents/skills/handoff.md +21 -7
  297. package/src/extensions/cursor-cloud-agents/tools/cancel.ts +19 -0
  298. package/src/extensions/cursor-cloud-agents/tools/dump.ts +51 -0
  299. package/src/extensions/cursor-cloud-agents/tools/get.ts +18 -0
  300. package/src/extensions/cursor-cloud-agents/tools/launch.ts +22 -42
  301. package/src/extensions/cursor-cloud-agents/tools/list.ts +1 -1
  302. package/src/extensions/cursor-cloud-agents/tools/reply.ts +34 -0
  303. package/src/extensions.ts +55 -12
  304. package/src/files-backends/cursor-hosted.ts +1 -17
  305. package/src/files.ts +43 -34
  306. package/src/index.ts +10 -1
  307. package/src/internal/conversation-mirror.ts +23 -18
  308. package/src/internal/cursor/backend-client.ts +32 -10
  309. package/src/internal/cursor/hosted-store-secrets.ts +27 -0
  310. package/src/internal/discovery/ab.ts +111 -0
  311. package/src/internal/discovery/agent-config.ts +222 -0
  312. package/src/internal/discovery/agent.ts +360 -0
  313. package/src/internal/discovery/channels.ts +103 -0
  314. package/src/internal/discovery/connections.ts +540 -0
  315. package/src/internal/discovery/context.ts +46 -0
  316. package/src/internal/discovery/cursor-plugin.ts +708 -0
  317. package/src/internal/discovery/extensions.ts +348 -0
  318. package/src/internal/discovery/fs.ts +108 -0
  319. package/src/internal/discovery/hooks.ts +45 -0
  320. package/src/internal/discovery/info.ts +179 -0
  321. package/src/internal/discovery/instructions.ts +113 -0
  322. package/src/internal/discovery/modules.ts +107 -0
  323. package/src/internal/discovery/names.ts +44 -0
  324. package/src/internal/discovery/project.ts +270 -0
  325. package/src/internal/discovery/runtime.ts +159 -0
  326. package/src/internal/discovery/schedules.ts +94 -0
  327. package/src/internal/discovery/seed-files.ts +37 -0
  328. package/src/internal/discovery/services.ts +124 -0
  329. package/src/internal/discovery/skills.ts +176 -0
  330. package/src/internal/discovery/subagent.ts +29 -0
  331. package/src/internal/discovery/tools.ts +182 -0
  332. package/src/internal/discovery.ts +20 -3081
  333. package/src/internal/framework-file-storage.ts +6 -6
  334. package/src/internal/framework-storage-selection.ts +9 -9
  335. package/src/internal/frontmatter.ts +36 -3
  336. package/src/internal/mcp-host.ts +84 -31
  337. package/src/internal/otel/collector.ts +125 -25
  338. package/src/internal/otel/http.ts +2 -12
  339. package/src/internal/otel/mcp.ts +69 -0
  340. package/src/internal/otel/propagation.ts +17 -0
  341. package/src/internal/otel/runtime.ts +2 -0
  342. package/src/internal/session-engine.ts +96 -11
  343. package/src/internal/session-run-log.ts +17 -16
  344. package/src/internal/start-log-store.ts +13 -16
  345. package/src/internal/storage-coordinator.ts +19 -16
  346. package/src/internal/tool-catalog.ts +9 -6
  347. package/src/internal/turn-cost.ts +47 -4
  348. package/src/internal/v2-hosting.ts +38 -0
  349. package/src/otel.ts +38 -0
  350. package/src/storage-protocol.ts +101 -91
  351. package/src/storage.ts +4 -0
  352. package/src/tools.ts +18 -0
  353. package/src/types.ts +43 -2
  354. package/dist/docs/assets/chunks/@localSearchIndexroot.DbFXINq2.js +0 -1
  355. package/dist/docs/assets/concepts.md.lwAgBIMI.js +0 -1
  356. package/dist/docs/assets/index.md.Bb4k8kUm.js +0 -5
  357. package/dist/docs/assets/skills_framework-map.md.BTi817yv.js +0 -1
  358. package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts +0 -30
  359. package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts.map +0 -1
  360. package/dist/extensions/cursor-cloud-agents/lib/cloud.js +0 -45
  361. package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts +0 -4
  362. package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts.map +0 -1
  363. package/dist/extensions/cursor-cloud-agents/tools/status.d.ts +0 -4
  364. package/dist/extensions/cursor-cloud-agents/tools/status.d.ts.map +0 -1
  365. package/dist/extensions/cursor-cloud-agents/tools/status.js +0 -41
  366. package/dist/playground/assets/index-DBQCwFp0.css +0 -1
  367. package/src/extensions/cursor-cloud-agents/lib/cloud.ts +0 -79
  368. package/src/extensions/cursor-cloud-agents/tools/follow_up.ts +0 -29
  369. package/src/extensions/cursor-cloud-agents/tools/status.ts +0 -39
  370. /package/dist/docs/assets/{concepts.md.lwAgBIMI.lean.js → concepts.md.rPzW2HZN.lean.js} +0 -0
  371. /package/dist/docs/assets/{guides_cloud-runtime.md.CkYbjnAX.lean.js → guides_cloud-runtime.md.BRirbRAN.lean.js} +0 -0
  372. /package/dist/docs/assets/{reference_skills.md.BFW9retM.lean.js → reference_skills.md.l2ezAcaN.lean.js} +0 -0
  373. /package/dist/docs/assets/{reference_tools.md.CvAHsdSp.lean.js → reference_tools.md.B1up2r9W.lean.js} +0 -0
  374. /package/dist/playground/assets/{index-BnNN1-EK.js → index-ZqNoT8Ie.js} +0 -0
@@ -288,18 +288,20 @@ export async function setThreadTitle(args: {
288
288
  export async function setSuggestedPrompts(args: {
289
289
  botToken: SlackBotToken | undefined;
290
290
  channelId: string;
291
- threadTs: string;
291
+ threadTs?: string;
292
292
  prompts: SlackSuggestedPrompt[];
293
293
  title?: string;
294
294
  }): Promise<SoftSlackResult> {
295
295
  const body: Record<string, unknown> = {
296
296
  channel_id: args.channelId,
297
- thread_ts: args.threadTs,
298
297
  prompts: args.prompts.map((p) => ({
299
298
  title: p.title,
300
299
  message: p.message,
301
300
  })),
302
301
  };
302
+ if (args.threadTs !== undefined && args.threadTs !== "") {
303
+ body.thread_ts = args.threadTs;
304
+ }
303
305
  if (args.title !== undefined && args.title !== "") {
304
306
  body.title = args.title;
305
307
  }
@@ -48,7 +48,7 @@ export async function maybeSetThreadTitle(args: {
48
48
  export async function maybeSetSuggestedPrompts(args: {
49
49
  botToken: SlackBotToken | undefined;
50
50
  channelId: string;
51
- threadTs: string;
51
+ threadTs?: string;
52
52
  prompts: SlackSuggestedPrompt[];
53
53
  title?: string;
54
54
  log?: SlackLog;
@@ -38,6 +38,7 @@ import { isExternalSlackSender } from "./external-policy.js";
38
38
  import {
39
39
  describeSlackEventShape,
40
40
  formatSlackContextBlock,
41
+ parseAppHomeOpened,
41
42
  parseAppMentionEvent,
42
43
  parseAssistantThreadStarted,
43
44
  parseChannelMessageEvent,
@@ -181,8 +182,9 @@ export interface SlackInboundDispatchDeps extends SlackContinuationProbes {
181
182
  */
182
183
  blockExternals?: boolean;
183
184
  /**
184
- * Suggested prompts written on `assistant_thread_started` so the
185
- * assistant pane is not blank before the first user message.
185
+ * Suggested prompts pinned when a user opens the agent Messages tab
186
+ * (`app_home_opened`). Older apps still seed them on
187
+ * `assistant_thread_started`.
186
188
  */
187
189
  suggestedPrompts?: SlackSuggestedPrompt[];
188
190
  suggestedPromptsTitle?: string;
@@ -766,6 +768,29 @@ export function dispatchInboundFromEventBody(
766
768
  return true;
767
769
  }
768
770
 
771
+ const home = parseAppHomeOpened(body);
772
+ if (home !== null) {
773
+ const prompts = deps.suggestedPrompts ?? [];
774
+ log.info("app home opened", {
775
+ channel: home.channelId,
776
+ tab: home.tab,
777
+ user: home.userId,
778
+ event_id: eventId,
779
+ });
780
+ if (home.tab === "messages" && prompts.length > 0) {
781
+ deps.waitUntil(
782
+ maybeSetSuggestedPrompts({
783
+ botToken: deps.credentials?.botToken,
784
+ channelId: home.channelId,
785
+ prompts,
786
+ title: deps.suggestedPromptsTitle,
787
+ log,
788
+ })
789
+ );
790
+ }
791
+ return true;
792
+ }
793
+
769
794
  const assistantThread = parseAssistantThreadStarted(body);
770
795
  if (assistantThread !== null) {
771
796
  const prompts = deps.suggestedPrompts ?? [];
@@ -138,6 +138,43 @@ export function parseAppMentionEvent(
138
138
  return delegation === undefined ? message : { ...message, delegation };
139
139
  }
140
140
 
141
+ export interface SlackAppHomeOpened {
142
+ channelId: string;
143
+ tab: string;
144
+ userId?: string;
145
+ teamId?: string;
146
+ }
147
+
148
+ /** Slack fires this when a user opens the app Home or Messages tab. */
149
+ export function parseAppHomeOpened(body: unknown): SlackAppHomeOpened | null {
150
+ const root = asRecord(body);
151
+ if (root === null || root.type !== "event_callback") {
152
+ return null;
153
+ }
154
+ const event = asRecord(root.event);
155
+ if (event === null || event.type !== "app_home_opened") {
156
+ return null;
157
+ }
158
+ const channelId = asString(event.channel);
159
+ const tab = asString(event.tab);
160
+ if (
161
+ channelId === undefined ||
162
+ channelId === "" ||
163
+ tab === undefined ||
164
+ tab === ""
165
+ ) {
166
+ return null;
167
+ }
168
+ const userId = asString(event.user);
169
+ const teamId = asString(root.team_id) ?? asString(event.team_id);
170
+ return {
171
+ channelId,
172
+ tab,
173
+ userId: userId === undefined || userId === "" ? undefined : userId,
174
+ teamId: teamId === undefined || teamId === "" ? undefined : teamId,
175
+ };
176
+ }
177
+
141
178
  export interface SlackAssistantThreadStarted {
142
179
  channelId: string;
143
180
  threadTs: string;
@@ -84,7 +84,8 @@ const BOT_SCOPES = [
84
84
  const BOT_EVENTS = [
85
85
  "app_mention",
86
86
  "message.im",
87
- "assistant_thread_started",
87
+ // agent_view DMs: Slack no longer fires assistant_thread_started.
88
+ "app_home_opened",
88
89
  ] as const;
89
90
 
90
91
  /** Slack's display_information.description bound. */
@@ -11,13 +11,15 @@
11
11
  * });
12
12
  * ```
13
13
  *
14
- * Contributes `cloud__launch`, `cloud__follow_up`, `cloud__status`,
15
- * `cloud__list` and the `cloud__handoff` skill (the namespace is the mount
16
- * filename). Calls go through the Cursor SDK with the serve host's Cursor
17
- * API key (`CURSOR_API_KEY`, key file, or `login`); each launched agent
18
- * stays bound to the principal that launched it, and launches go to the
19
- * configured repositories. The tools run on the serve host, so they need
20
- * the local runtime.
14
+ * Contributes `cloud__launch`, `cloud__get`, `cloud__dump`, `cloud__reply`,
15
+ * `cloud__cancel`, `cloud__list` and the `cloud__handoff` skill (the
16
+ * namespace is the mount filename), the action vocabulary Sand's CloudAgent
17
+ * tool uses, over the same backend calls: launches through the v1 Cloud
18
+ * Agents API, everything else through the BackgroundComposerService RPCs,
19
+ * all under the serve host's Cursor API key (`CURSOR_API_KEY`, key file, or
20
+ * `login`). Each launched agent stays bound to the principal that launched
21
+ * it, and launches go to the configured repositories. The tools run on the
22
+ * serve host, so they need the local runtime.
21
23
  */
22
24
 
23
25
  import { z } from "zod";
@@ -0,0 +1,395 @@
1
+ /**
2
+ * The Cursor backend as the tools use it: launches go through the public
3
+ * v1 Cloud Agents API (the only surface that takes per-launch `envVars`),
4
+ * everything about an existing agent goes through the same
5
+ * `aiserver.v1.BackgroundComposerService` RPCs Sand's CloudAgent tool
6
+ * calls, so follow-ups queue, runs pause, and the full conversation is
7
+ * readable. Both authenticate with the host's Cursor API key; the RPCs
8
+ * exchange it for a session token the way the dashboard client does.
9
+ */
10
+
11
+ import { randomUUID } from "node:crypto";
12
+ import { z } from "zod";
13
+ import { CursorBackendClient } from "../../../internal/cursor/backend-client.js";
14
+ import {
15
+ cursorBackendUrl,
16
+ cursorExternalApiUrl,
17
+ cursorWebsiteUrl,
18
+ resolveApiKeySync,
19
+ SIGN_IN_HINT,
20
+ } from "../../../internal/cursor/credentials.js";
21
+ import { toModelSelection } from "../../../internal/sdk-runner.js";
22
+ import type { AgentCloudOptions, ModelSetting } from "../../../types.js";
23
+ import extension from "../extension.js";
24
+
25
+ const SERVICE = "BackgroundComposerService";
26
+ /** Launches and follow-ups from this extension carry the SDK source, like the v1 API. */
27
+ const SOURCE = "BACKGROUND_COMPOSER_SOURCE_SDK";
28
+ const RPC_TIMEOUT_MS = 60_000;
29
+ // The create call returns once the initial run exists, which can wait on a VM.
30
+ const LAUNCH_TIMEOUT_MS = 300_000;
31
+
32
+ export class CloudAgentsApiError extends Error {
33
+ constructor(
34
+ message: string,
35
+ readonly status?: number
36
+ ) {
37
+ super(message);
38
+ this.name = "CloudAgentsApiError";
39
+ }
40
+ }
41
+
42
+ export type CloudAgentStatus =
43
+ | "creating"
44
+ | "running"
45
+ | "finished"
46
+ | "error"
47
+ | "expired"
48
+ | "unknown";
49
+
50
+ // Type aliases, not interfaces: these flow into tool results.
51
+ export type CloudAgentInfo = {
52
+ agentId: string;
53
+ name: string;
54
+ status: CloudAgentStatus;
55
+ archived: boolean;
56
+ url: string;
57
+ branch?: string;
58
+ prUrl?: string;
59
+ summary?: string;
60
+ error?: string;
61
+ changes?: { filesChanged: number; linesAdded: number; linesRemoved: number };
62
+ };
63
+
64
+ export type CloudAgentToolCall = {
65
+ name: string;
66
+ args: unknown;
67
+ content?: string;
68
+ error?: string;
69
+ };
70
+
71
+ export type CloudAgentMessage = {
72
+ role: "user" | "assistant";
73
+ text?: string;
74
+ thinking?: string;
75
+ toolCalls?: CloudAgentToolCall[];
76
+ };
77
+
78
+ export type CloudAgentLaunch = {
79
+ agentId: string;
80
+ runId: string;
81
+ status: string;
82
+ url: string;
83
+ };
84
+
85
+ export type LaunchRequest = {
86
+ prompt: string;
87
+ name?: string;
88
+ cloud: AgentCloudOptions;
89
+ model?: ModelSetting;
90
+ };
91
+
92
+ // ---------------------------------------------------------------------------
93
+ // Proto-JSON response schemas (camelCase; default-valued fields are omitted)
94
+ // ---------------------------------------------------------------------------
95
+
96
+ const composerSchema = z.object({
97
+ bcId: z.string(),
98
+ name: z.string().optional(),
99
+ status: z.string().optional(),
100
+ isArchived: z.boolean().optional(),
101
+ branchName: z.string().optional(),
102
+ prUrl: z.string().optional(),
103
+ linesAdded: z.number().optional(),
104
+ linesRemoved: z.number().optional(),
105
+ filesChanged: z.number().optional(),
106
+ });
107
+
108
+ const errorDetailsSchema = z.object({
109
+ details: z
110
+ .object({ title: z.string().optional(), detail: z.string().optional() })
111
+ .optional(),
112
+ });
113
+
114
+ const infoResponseSchema = z.object({
115
+ composer: z.object({
116
+ composer: composerSchema,
117
+ summary: z.string().optional(),
118
+ startError: errorDetailsSchema.optional(),
119
+ permanentError: errorDetailsSchema.optional(),
120
+ }),
121
+ });
122
+
123
+ const toolResultSchema = z.object({
124
+ toolName: z.string().optional(),
125
+ args: z.string().optional(),
126
+ rawArgs: z.string().optional(),
127
+ content: z.string().optional(),
128
+ error: z
129
+ .object({ clientVisibleErrorMessage: z.string().optional() })
130
+ .optional(),
131
+ });
132
+
133
+ const conversationResponseSchema = z.object({
134
+ conversation: z
135
+ .array(
136
+ z.object({
137
+ type: z.string().optional(),
138
+ text: z.string().optional(),
139
+ thinking: z.object({ text: z.string().optional() }).optional(),
140
+ toolResults: z.array(toolResultSchema).optional(),
141
+ })
142
+ )
143
+ .optional(),
144
+ });
145
+
146
+ const followupResponseSchema = z.object({ runId: z.string().optional() });
147
+
148
+ const launchResponseSchema = z.object({
149
+ agent: z.object({ id: z.string(), url: z.string().optional() }),
150
+ run: z.object({ id: z.string(), status: z.string() }),
151
+ });
152
+
153
+ // ---------------------------------------------------------------------------
154
+
155
+ export class CloudAgentsBackend {
156
+ private readonly rpcClient: CursorBackendClient;
157
+
158
+ constructor(
159
+ private readonly apiKey: () => string,
160
+ private readonly fetchImpl: typeof fetch = fetch
161
+ ) {
162
+ // The key is read per call: the host can sign in after the mount.
163
+ this.rpcClient = new CursorBackendClient({
164
+ backendUrl: cursorBackendUrl(),
165
+ apiKey: "",
166
+ getApiKey: apiKey,
167
+ fetchImpl,
168
+ });
169
+ }
170
+
171
+ /** `POST /v1/agents`: create the agent and start its first run in one call. */
172
+ async launch(request: LaunchRequest): Promise<CloudAgentLaunch> {
173
+ const { cloud } = request;
174
+ const body = {
175
+ prompt: { text: request.prompt },
176
+ name: request.name,
177
+ model:
178
+ request.model === undefined
179
+ ? undefined
180
+ : toModelSelection(request.model),
181
+ env: cloud.env,
182
+ envVars: cloud.envVars,
183
+ repos: cloud.repos,
184
+ workOnCurrentBranch: cloud.workOnCurrentBranch,
185
+ autoCreatePR: cloud.autoCreatePR,
186
+ skipReviewerRequest: cloud.skipReviewerRequest,
187
+ };
188
+ let response: Response;
189
+ try {
190
+ response = await this.fetchImpl(`${cursorExternalApiUrl()}/v1/agents`, {
191
+ method: "POST",
192
+ headers: {
193
+ "content-type": "application/json",
194
+ authorization: `Bearer ${this.apiKey()}`,
195
+ "x-ghost-mode": "true",
196
+ "x-cursor-client-type": "agent-serve",
197
+ "x-request-id": randomUUID(),
198
+ },
199
+ body: JSON.stringify(body),
200
+ signal: AbortSignal.timeout(LAUNCH_TIMEOUT_MS),
201
+ });
202
+ } catch (error) {
203
+ throw new CloudAgentsApiError(
204
+ `Cloud agent launch failed: ${error instanceof Error ? error.message : String(error)}`
205
+ );
206
+ }
207
+ const text = await response.text();
208
+ if (!response.ok) {
209
+ throw new CloudAgentsApiError(
210
+ `Cloud agent launch failed (${response.status}): ${apiErrorMessage(text)}`,
211
+ response.status
212
+ );
213
+ }
214
+ const parsed = launchResponseSchema.parse(JSON.parse(text));
215
+ return {
216
+ agentId: parsed.agent.id,
217
+ runId: parsed.run.id,
218
+ status: parsed.run.status.toLowerCase(),
219
+ url: parsed.agent.url ?? agentUrl(parsed.agent.id),
220
+ };
221
+ }
222
+
223
+ async info(agentId: string): Promise<CloudAgentInfo> {
224
+ const { composer } = infoResponseSchema.parse(
225
+ await this.rpcClient.serviceRpc(
226
+ SERVICE,
227
+ "GetBackgroundComposerInfo",
228
+ { bcId: agentId },
229
+ RPC_TIMEOUT_MS
230
+ )
231
+ );
232
+ const { composer: summary } = composer;
233
+ const failure = composer.permanentError ?? composer.startError;
234
+ return {
235
+ agentId: summary.bcId,
236
+ name: summary.name ?? "",
237
+ status: statusOf(summary.status),
238
+ archived: summary.isArchived === true,
239
+ url: agentUrl(summary.bcId),
240
+ branch: emptyToUndefined(summary.branchName),
241
+ prUrl: emptyToUndefined(summary.prUrl),
242
+ summary: emptyToUndefined(composer.summary),
243
+ error: failureMessage(failure),
244
+ changes:
245
+ summary.filesChanged === undefined
246
+ ? undefined
247
+ : {
248
+ filesChanged: summary.filesChanged,
249
+ linesAdded: summary.linesAdded ?? 0,
250
+ linesRemoved: summary.linesRemoved ?? 0,
251
+ },
252
+ };
253
+ }
254
+
255
+ async conversation(agentId: string): Promise<CloudAgentMessage[]> {
256
+ const { conversation } = conversationResponseSchema.parse(
257
+ await this.rpcClient.serviceRpc(
258
+ SERVICE,
259
+ "GetBackgroundComposerConversation",
260
+ { bcId: agentId },
261
+ RPC_TIMEOUT_MS
262
+ )
263
+ );
264
+ return (conversation ?? []).map((message) => {
265
+ const toolCalls = (message.toolResults ?? []).map((result) => ({
266
+ name: result.toolName ?? "",
267
+ args: parseArgs(result.args ?? result.rawArgs),
268
+ content: result.content,
269
+ error: result.error?.clientVisibleErrorMessage,
270
+ }));
271
+ return {
272
+ role: message.type === "MESSAGE_TYPE_HUMAN" ? "user" : "assistant",
273
+ text: emptyToUndefined(message.text),
274
+ thinking: emptyToUndefined(message.thinking?.text),
275
+ toolCalls: toolCalls.length === 0 ? undefined : toolCalls,
276
+ };
277
+ });
278
+ }
279
+
280
+ /**
281
+ * Queue a follow-up behind the current run, or with `interrupt` cancel the
282
+ * in-flight step and run it now; the backend's `synchronous` switch.
283
+ */
284
+ async followUp(
285
+ agentId: string,
286
+ prompt: string,
287
+ interrupt: boolean
288
+ ): Promise<{ runId: string | undefined }> {
289
+ const { runId } = followupResponseSchema.parse(
290
+ await this.rpcClient.serviceRpc(
291
+ SERVICE,
292
+ "AddAsyncFollowupBackgroundComposer",
293
+ {
294
+ bcId: agentId,
295
+ synchronous: interrupt,
296
+ followupSource: SOURCE,
297
+ followupMessage: {
298
+ text: prompt,
299
+ type: "MESSAGE_TYPE_HUMAN",
300
+ bubbleId: randomUUID(),
301
+ },
302
+ },
303
+ RPC_TIMEOUT_MS
304
+ )
305
+ );
306
+ return { runId };
307
+ }
308
+
309
+ async pause(agentId: string): Promise<void> {
310
+ await this.rpcClient.serviceRpc(
311
+ SERVICE,
312
+ "PauseBackgroundComposer",
313
+ { bcId: agentId, source: SOURCE },
314
+ RPC_TIMEOUT_MS
315
+ );
316
+ }
317
+ }
318
+
319
+ let backend: CloudAgentsBackend | undefined;
320
+
321
+ /** The process-wide backend for this mount, built on first use. */
322
+ export function cloudAgentsBackend(): CloudAgentsBackend {
323
+ backend ??= new CloudAgentsBackend(apiKey);
324
+ return backend;
325
+ }
326
+
327
+ export function apiKey(): string {
328
+ const key = resolveApiKeySync({ apiKey: extension.config.apiKey });
329
+ if (key === undefined) {
330
+ throw new Error(`Cloud agents need a Cursor API key. ${SIGN_IN_HINT}`);
331
+ }
332
+ return key.apiKey;
333
+ }
334
+
335
+ export function agentUrl(agentId: string): string {
336
+ return `${cursorWebsiteUrl()}/agents/${agentId}`;
337
+ }
338
+
339
+ function statusOf(status: string | undefined): CloudAgentStatus {
340
+ switch (status) {
341
+ case "BACKGROUND_COMPOSER_STATUS_CREATING":
342
+ return "creating";
343
+ case "BACKGROUND_COMPOSER_STATUS_RUNNING":
344
+ return "running";
345
+ case "BACKGROUND_COMPOSER_STATUS_FINISHED":
346
+ return "finished";
347
+ case "BACKGROUND_COMPOSER_STATUS_ERROR":
348
+ return "error";
349
+ case "BACKGROUND_COMPOSER_STATUS_EXPIRED":
350
+ return "expired";
351
+ default:
352
+ return "unknown";
353
+ }
354
+ }
355
+
356
+ function failureMessage(
357
+ failure: z.infer<typeof errorDetailsSchema> | undefined
358
+ ): string | undefined {
359
+ const parts = [failure?.details?.title, failure?.details?.detail].filter(
360
+ (part): part is string => part !== undefined && part !== ""
361
+ );
362
+ return parts.length === 0 ? undefined : parts.join(": ");
363
+ }
364
+
365
+ function parseArgs(args: string | undefined): unknown {
366
+ if (args === undefined || args === "") {
367
+ return undefined;
368
+ }
369
+ try {
370
+ return JSON.parse(args) as unknown;
371
+ } catch {
372
+ return args;
373
+ }
374
+ }
375
+
376
+ function emptyToUndefined(value: string | undefined): string | undefined {
377
+ return value === undefined || value === "" ? undefined : value;
378
+ }
379
+
380
+ function apiErrorMessage(text: string): string {
381
+ try {
382
+ const parsed = JSON.parse(text) as {
383
+ error?: { code?: string; message?: string };
384
+ code?: string;
385
+ message?: string;
386
+ };
387
+ const code = parsed.error?.code ?? parsed.code;
388
+ const message = parsed.error?.message ?? parsed.message;
389
+ return (
390
+ [code, message].filter((part) => part !== undefined).join(": ") || text
391
+ );
392
+ } catch {
393
+ return text;
394
+ }
395
+ }
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+
3
+ export const agentRef: z.ZodObject<{ agent_id: z.ZodString }> = z.object({
4
+ agent_id: z.string().describe("Agent id (`bc-...`) returned by launch."),
5
+ });
@@ -0,0 +1,23 @@
1
+ /** A cloud agent's conversation as JSONL lines, one message per line. */
2
+
3
+ import type { CloudAgentMessage } from "./backend.js";
4
+
5
+ /** Workspace-relative path of a dumped transcript; the directory Sand uses too. */
6
+ export function transcriptPath(agentId: string): string {
7
+ return `cloud-agent-transcripts/${agentId}.jsonl`;
8
+ }
9
+
10
+ export function transcriptLines(messages: CloudAgentMessage[]): string[] {
11
+ return messages.map((message) => JSON.stringify(message));
12
+ }
13
+
14
+ /** The text of the last assistant message, the agent's report. */
15
+ export function lastAssistantText(
16
+ messages: CloudAgentMessage[]
17
+ ): string | undefined {
18
+ return messages
19
+ .toReversed()
20
+ .find(
21
+ (message) => message.role === "assistant" && message.text !== undefined
22
+ )?.text;
23
+ }
@@ -1,26 +1,40 @@
1
1
  ---
2
- description: "Delegate coding work to Cursor cloud agents: when to hand off, how to write the prompt, and how to follow up and check status."
2
+ description: "Delegate coding work to Cursor cloud agents: when to hand off, how to write the prompt, and how to look an agent up by id, read what it did, reply, and cancel."
3
3
  ---
4
4
 
5
5
  # Cloud agent handoff
6
6
 
7
7
  Hand work to a Cursor cloud agent when it needs a repository checkout, a long run, or an isolated machine: implementing a change, running a test suite, opening a pull request. Answer questions and small reads yourself.
8
8
 
9
- The tools below are this extension's; they appear under its mount namespace, as `<namespace>__launch` and so on.
9
+ The tools below are this extension's; they appear under its mount namespace, as `<namespace>__launch` and so on. Every agent is addressed by its `agent_id` (`bc-...`).
10
10
 
11
11
  ## Launch
12
12
 
13
- Call `launch` with a self-contained prompt: the goal, the repository or pull request, constraints (branch, files to leave alone), and what done looks like (tests pass, PR opened). Pass `ref` or `prUrl` to pick a branch or pull request; `repo` must be one of the configured repositories.
13
+ Call `launch` with a self-contained prompt: the goal, the repository or pull request, constraints (branch, files to leave alone), and what done looks like (tests pass, PR opened). Pass `starting_ref` or `pr_url` to pick a branch or pull request; `repo` must be one of the configured repositories.
14
14
 
15
15
  The result carries `agentId` (`bc-...`) and a `url`. Report both in full. Never truncate the id.
16
16
 
17
- ## Follow up
17
+ ## Look an agent up by id
18
18
 
19
- Call `follow_up` with the `agentId` to steer an agent you launched or ask for changes on its branch. A busy agent rejects the follow-up: check status and retry once its run has finished. Do not launch a second agent for follow-up work on the same branch.
19
+ Call `get` with the `agent_id`. It returns the agent's `status` (`creating`, `running`, `finished`, `error`, or `expired`), its `branch` and pull request `prUrl` once pushed, the `changes` it made so far (files and lines), a `summary` when one exists, and an `error` when it failed. A run takes minutes: check when asked or when you need the result, not in a tight loop. The final report itself comes from `dump`.
20
20
 
21
- ## Check status
21
+ ## Read what it did
22
22
 
23
- Call `status` with the `agentId`. The latest run carries `status` (`running`, `finished`, `error`, or `cancelled`), the final `result` text, an `error` message, and any pushed `branches` or pull requests; the agent itself reports `archived`. A run takes minutes: check when asked or when you need the result, not in a tight loop.
23
+ To read the report or understand what was done, call `dump` with the `agent_id`. It writes the agent's whole conversation, every run, to `cloud-agent-transcripts/<agent_id>.jsonl` in your workspace and returns the absolute `path` plus the `finalMessage`. Each line is one JSON message with `role` (`user` or `assistant`) and, for assistant lines, `text`, `thinking`, and `toolCalls` (tool `name`, `args`, `content`, `error`). Read it with your file and shell tools, using the returned path:
24
+
25
+ - `tail -n 1 <path>` gives the final report.
26
+ - `grep '"toolCalls"' <path>` shows the commands and edits it made.
27
+ - `grep '"role":"user"' <path>` shows every prompt it received, including replies.
28
+
29
+ Use `dump` before summarizing an agent's work for a person, and to understand a failure before replying with a fix.
30
+
31
+ ## Reply
32
+
33
+ Call `reply` with the `agent_id` and a prompt to steer an agent or ask for changes on its branch. The follow-up queues behind the current run and starts when it finishes; pass `interrupt: true` to stop the current step and deliver it now. Do not launch a second agent for follow-up work on the same branch.
34
+
35
+ ## Cancel
36
+
37
+ Call `cancel` with the `agent_id` to stop the active run. The agent keeps its branch and conversation, so a `reply` can continue from where it stopped.
24
38
 
25
39
  ## Fleet
26
40
 
@@ -0,0 +1,19 @@
1
+ import { defineTool } from "../../../tools.js";
2
+ import type { ToolDefinition } from "../../../types.js";
3
+ import { cloudAgentsBackend } from "../lib/backend.js";
4
+ import { assertOwned } from "../lib/fleet.js";
5
+ import { agentRef } from "../lib/inputs.js";
6
+
7
+ const cancel: ToolDefinition = defineTool({
8
+ description:
9
+ "Stop a cloud agent's active run. The agent keeps its branch and conversation; reply to it to continue.",
10
+ effect: "write",
11
+ inputSchema: agentRef,
12
+ async execute(input, ctx) {
13
+ await assertOwned(ctx, input.agent_id);
14
+ await cloudAgentsBackend().pause(input.agent_id);
15
+ return { agentId: input.agent_id, cancelled: true };
16
+ },
17
+ });
18
+
19
+ export default cancel;