@cursor/july 0.1.99 → 0.1.101

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 (420) hide show
  1. package/AGENTS.md +4 -2
  2. package/dist/bin/agent-serve.js +3 -2
  3. package/dist/channels/deployments/deployments-channel.d.ts +41 -5
  4. package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
  5. package/dist/channels/deployments/deployments-channel.js +88 -8
  6. package/dist/channels/deployments/types.d.ts +4 -3
  7. package/dist/channels/deployments/types.d.ts.map +1 -1
  8. package/dist/channels/github/defaults.d.ts.map +1 -1
  9. package/dist/channels/github/defaults.js +28 -3
  10. package/dist/channels/github/progress.d.ts +7 -0
  11. package/dist/channels/github/progress.d.ts.map +1 -1
  12. package/dist/channels/origin/defaults.d.ts +43 -0
  13. package/dist/channels/origin/defaults.d.ts.map +1 -0
  14. package/dist/channels/origin/defaults.js +111 -0
  15. package/dist/channels/origin/index.d.ts +2 -0
  16. package/dist/channels/origin/index.d.ts.map +1 -1
  17. package/dist/channels/origin/index.js +2 -0
  18. package/dist/channels/origin/origin-channel.d.ts +2 -1
  19. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  20. package/dist/channels/origin/origin-channel.js +24 -3
  21. package/dist/channels/origin/state.d.ts +32 -0
  22. package/dist/channels/origin/state.d.ts.map +1 -0
  23. package/dist/channels/origin/state.js +23 -0
  24. package/dist/channels/origin/types.d.ts +23 -1
  25. package/dist/channels/origin/types.d.ts.map +1 -1
  26. package/dist/channels/slack/api.d.ts +16 -7
  27. package/dist/channels/slack/api.d.ts.map +1 -1
  28. package/dist/channels/slack/api.js +31 -14
  29. package/dist/channels/slack/code-fences.d.ts +17 -0
  30. package/dist/channels/slack/code-fences.d.ts.map +1 -0
  31. package/dist/channels/slack/code-fences.js +168 -0
  32. package/dist/channels/slack/constants.d.ts +6 -0
  33. package/dist/channels/slack/constants.d.ts.map +1 -1
  34. package/dist/channels/slack/constants.js +6 -0
  35. package/dist/channels/slack/defaults.d.ts +9 -4
  36. package/dist/channels/slack/defaults.d.ts.map +1 -1
  37. package/dist/channels/slack/defaults.js +154 -76
  38. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  39. package/dist/channels/slack/dispatch.js +3 -3
  40. package/dist/channels/slack/inbound.d.ts +9 -0
  41. package/dist/channels/slack/inbound.d.ts.map +1 -1
  42. package/dist/channels/slack/inbound.js +14 -0
  43. package/dist/channels/slack/index.d.ts +2 -0
  44. package/dist/channels/slack/index.d.ts.map +1 -1
  45. package/dist/channels/slack/index.js +2 -0
  46. package/dist/channels/slack/live-delivery.d.ts +5 -0
  47. package/dist/channels/slack/live-delivery.d.ts.map +1 -1
  48. package/dist/channels/slack/live-delivery.js +116 -21
  49. package/dist/channels/slack/reasoning-card.d.ts +38 -0
  50. package/dist/channels/slack/reasoning-card.d.ts.map +1 -0
  51. package/dist/channels/slack/reasoning-card.js +104 -0
  52. package/dist/channels/slack/redact.d.ts +2 -0
  53. package/dist/channels/slack/redact.d.ts.map +1 -0
  54. package/dist/channels/slack/redact.js +5 -0
  55. package/dist/channels/slack/reply-options.d.ts +40 -0
  56. package/dist/channels/slack/reply-options.d.ts.map +1 -0
  57. package/dist/channels/slack/reply-options.js +150 -0
  58. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  59. package/dist/channels/slack/slack-channel.js +8 -4
  60. package/dist/channels/slack/stream.d.ts +22 -10
  61. package/dist/channels/slack/stream.d.ts.map +1 -1
  62. package/dist/channels/slack/stream.js +9 -16
  63. package/dist/channels/slack/tool-cards.d.ts +22 -0
  64. package/dist/channels/slack/tool-cards.d.ts.map +1 -0
  65. package/dist/channels/slack/tool-cards.js +178 -0
  66. package/dist/channels/slack/types.d.ts +145 -6
  67. package/dist/channels/slack/types.d.ts.map +1 -1
  68. package/dist/connections.d.ts +18 -2
  69. package/dist/connections.d.ts.map +1 -1
  70. package/dist/connections.js +18 -2
  71. package/dist/docs/404.html +2 -2
  72. package/dist/docs/ab.html +6 -6
  73. package/dist/docs/ab.md +1 -1
  74. package/dist/docs/assets/{ab.md.DJo5r4R-.js → ab.md.mlVgqvSk.js} +1 -1
  75. package/dist/docs/assets/{app.BplEAZ3S.js → app.BASO9Kih.js} +1 -1
  76. package/dist/docs/assets/{building-with-agents.md.DI4mEzlt.js → building-with-agents.md.CUSWxlP_.js} +2 -2
  77. package/dist/docs/assets/chunks/@localSearchIndexroot.DbFXINq2.js +1 -0
  78. package/dist/docs/assets/chunks/{VPLocalSearchBox.CHXyv4wP.js → VPLocalSearchBox.DwkqxoE0.js} +1 -1
  79. package/dist/docs/assets/chunks/{theme.BTcsZmjQ.js → theme.CCil_13e.js} +2 -2
  80. package/dist/docs/assets/{evals.md.lfJoEVc8.js → evals.md.CPzDAwoH.js} +1 -1
  81. package/dist/docs/assets/{guides_github.md.Cnh2mL4a.js → guides_github.md.BtPr9GaP.js} +1 -1
  82. package/dist/docs/assets/{guides_mcp-oauth.md.CN-6YmTJ.js → guides_mcp-oauth.md.Dp6cDP7f.js} +1 -1
  83. package/dist/docs/assets/{guides_opentelemetry.md.bmPmkvJu.js → guides_opentelemetry.md.BVTXDCRg.js} +2 -2
  84. package/dist/docs/assets/{guides_slack.md.VDXQV3ja.js → guides_slack.md.9oHPye9o.js} +19 -3
  85. package/dist/docs/assets/{guides_slack.md.VDXQV3ja.lean.js → guides_slack.md.9oHPye9o.lean.js} +1 -1
  86. package/dist/docs/assets/hillclimbing.md.CpTGTCle.js +4 -0
  87. package/dist/docs/assets/{index.md.CVeRUOeZ.js → index.md.Bb4k8kUm.js} +1 -1
  88. package/dist/docs/assets/{quickstart.md.Nj_LjW_a.js → quickstart.md.DdQOF7Y8.js} +1 -1
  89. package/dist/docs/assets/{reference_connections.md.DxldvyIB.js → reference_connections.md.Di6jJAXF.js} +13 -3
  90. package/dist/docs/assets/{reference_connections.md.DxldvyIB.lean.js → reference_connections.md.Di6jJAXF.lean.js} +1 -1
  91. package/dist/docs/assets/{reference_http-api.md.BEJx9XVj.js → reference_http-api.md.oySXBO8o.js} +1 -1
  92. package/dist/docs/assets/scaffolding-agents.md.em43xlY1.js +1 -0
  93. package/dist/docs/assets/skills_ab.md.CsFNatVx.js +26 -0
  94. package/dist/docs/assets/skills_ab.md.CsFNatVx.lean.js +1 -0
  95. package/dist/docs/assets/skills_create-agent.md.BVoWPcan.js +8 -0
  96. package/dist/docs/assets/skills_create-agent.md.BVoWPcan.lean.js +1 -0
  97. package/dist/docs/assets/skills_debug.md.CDbPhHfg.js +1 -0
  98. package/dist/docs/assets/skills_debug.md.CDbPhHfg.lean.js +1 -0
  99. package/dist/docs/assets/skills_evals.md.723kpUmA.js +25 -0
  100. package/dist/docs/assets/skills_evals.md.723kpUmA.lean.js +1 -0
  101. package/dist/docs/assets/skills_framework-map.md.BTi817yv.js +1 -0
  102. package/dist/docs/assets/skills_framework-map.md.BTi817yv.lean.js +1 -0
  103. package/dist/docs/assets/skills_github.md.D0JahM8c.js +16 -0
  104. package/dist/docs/assets/skills_github.md.D0JahM8c.lean.js +1 -0
  105. package/dist/docs/assets/skills_hillclimb.md.B_zJerxA.js +7 -0
  106. package/dist/docs/assets/skills_hillclimb.md.B_zJerxA.lean.js +1 -0
  107. package/dist/docs/assets/skills_index.md.DKwIxzGg.js +1 -0
  108. package/dist/docs/assets/skills_index.md.DKwIxzGg.lean.js +1 -0
  109. package/dist/docs/assets/skills_mcp-auth.md.DGvFP3HE.js +18 -0
  110. package/dist/docs/assets/skills_mcp-auth.md.DGvFP3HE.lean.js +1 -0
  111. package/dist/docs/assets/skills_otel.md.CgiZryR3.js +8 -0
  112. package/dist/docs/assets/skills_otel.md.CgiZryR3.lean.js +1 -0
  113. package/dist/docs/assets/skills_setup-slack.md.BBgx8lUz.js +20 -0
  114. package/dist/docs/assets/skills_setup-slack.md.BBgx8lUz.lean.js +1 -0
  115. package/dist/docs/assets/{troubleshooting.md.DCiPBhYs.js → troubleshooting.md.Cus_YZga.js} +1 -1
  116. package/dist/docs/building-with-agents.html +6 -6
  117. package/dist/docs/building-with-agents.md +14 -11
  118. package/dist/docs/concepts.html +4 -4
  119. package/dist/docs/deployment.html +4 -4
  120. package/dist/docs/evals.html +6 -6
  121. package/dist/docs/evals.md +1 -1
  122. package/dist/docs/guides/agent-to-agent.html +4 -4
  123. package/dist/docs/guides/cloud-runtime.html +4 -4
  124. package/dist/docs/guides/convert-automation.html +4 -4
  125. package/dist/docs/guides/github.html +5 -5
  126. package/dist/docs/guides/github.md +1 -1
  127. package/dist/docs/guides/human-in-the-loop.html +4 -4
  128. package/dist/docs/guides/mcp-oauth.html +5 -5
  129. package/dist/docs/guides/mcp-oauth.md +1 -1
  130. package/dist/docs/guides/opentelemetry.html +7 -7
  131. package/dist/docs/guides/opentelemetry.md +2 -2
  132. package/dist/docs/guides/slack.html +22 -6
  133. package/dist/docs/guides/slack.md +80 -1
  134. package/dist/docs/guides/webhooks.html +5 -5
  135. package/dist/docs/hashmap.json +1 -1
  136. package/dist/docs/hillclimbing.html +6 -6
  137. package/dist/docs/hillclimbing.md +5 -5
  138. package/dist/docs/index.html +6 -6
  139. package/dist/docs/index.md +1 -1
  140. package/dist/docs/llms-full.txt +1073 -31
  141. package/dist/docs/llms.txt +14 -0
  142. package/dist/docs/quickstart.html +5 -5
  143. package/dist/docs/quickstart.md +1 -1
  144. package/dist/docs/reference/agent-config.html +4 -4
  145. package/dist/docs/reference/artifacts.html +4 -4
  146. package/dist/docs/reference/channels.html +4 -4
  147. package/dist/docs/reference/cli.html +4 -4
  148. package/dist/docs/reference/connections.html +17 -7
  149. package/dist/docs/reference/connections.md +32 -1
  150. package/dist/docs/reference/hooks.html +4 -4
  151. package/dist/docs/reference/http-api.html +6 -6
  152. package/dist/docs/reference/http-api.md +1 -1
  153. package/dist/docs/reference/instructions.html +4 -4
  154. package/dist/docs/reference/playground.html +4 -4
  155. package/dist/docs/reference/project-layout.html +4 -4
  156. package/dist/docs/reference/prompt.html +4 -4
  157. package/dist/docs/reference/schedules.html +4 -4
  158. package/dist/docs/reference/sessions.html +4 -4
  159. package/dist/docs/reference/skills.html +4 -4
  160. package/dist/docs/reference/subagents.html +4 -4
  161. package/dist/docs/reference/tools.html +4 -4
  162. package/dist/docs/scaffolding-agents.html +5 -5
  163. package/dist/docs/scaffolding-agents.md +3 -3
  164. package/dist/docs/skills/ab.html +52 -0
  165. package/dist/docs/skills/ab.md +50 -0
  166. package/dist/docs/skills/create-agent.html +34 -0
  167. package/dist/docs/skills/create-agent.md +160 -0
  168. package/dist/docs/skills/debug.html +27 -0
  169. package/dist/docs/skills/debug.md +36 -0
  170. package/dist/docs/skills/evals.html +51 -0
  171. package/dist/docs/skills/evals.md +99 -0
  172. package/dist/docs/skills/framework-map.html +27 -0
  173. package/dist/docs/skills/framework-map.md +95 -0
  174. package/dist/docs/skills/github.html +42 -0
  175. package/dist/docs/skills/github.md +93 -0
  176. package/dist/docs/skills/hillclimb.html +33 -0
  177. package/dist/docs/skills/hillclimb.md +55 -0
  178. package/dist/docs/skills/index.html +27 -0
  179. package/dist/docs/skills/index.md +21 -0
  180. package/dist/docs/skills/mcp-auth.html +44 -0
  181. package/dist/docs/skills/mcp-auth.md +76 -0
  182. package/dist/docs/skills/otel.html +34 -0
  183. package/dist/docs/skills/otel.md +48 -0
  184. package/dist/docs/skills/setup-slack.html +46 -0
  185. package/dist/docs/skills/setup-slack.md +141 -0
  186. package/dist/docs/storage.html +4 -4
  187. package/dist/docs/templates/agentic-owners.html +4 -4
  188. package/dist/docs/templates/agents-md.html +4 -4
  189. package/dist/docs/templates/code-wiki.html +4 -4
  190. package/dist/docs/templates/demo.html +4 -4
  191. package/dist/docs/templates/pr-autofixer.html +4 -4
  192. package/dist/docs/templates/security-help.html +4 -4
  193. package/dist/docs/templates/security-reviewer.html +4 -4
  194. package/dist/docs/templates/triage.html +4 -4
  195. package/dist/docs/troubleshooting.html +5 -5
  196. package/dist/docs/troubleshooting.md +1 -1
  197. package/dist/extensions/cursor-cloud-agents/extension.d.ts +55 -0
  198. package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -0
  199. package/dist/extensions/cursor-cloud-agents/extension.js +64 -0
  200. package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts +30 -0
  201. package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts.map +1 -0
  202. package/dist/extensions/cursor-cloud-agents/lib/cloud.js +45 -0
  203. package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts +25 -0
  204. package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts.map +1 -0
  205. package/dist/extensions/cursor-cloud-agents/lib/fleet.js +85 -0
  206. package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts +15 -0
  207. package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts.map +1 -0
  208. package/dist/extensions/cursor-cloud-agents/lib/repos.js +55 -0
  209. package/dist/extensions/cursor-cloud-agents/skills/handoff.md +27 -0
  210. package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts +4 -0
  211. package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts.map +1 -0
  212. package/dist/extensions/cursor-cloud-agents/tools/follow_up.js +37 -0
  213. package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts +4 -0
  214. package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -0
  215. package/dist/extensions/cursor-cloud-agents/tools/launch.js +83 -0
  216. package/dist/extensions/cursor-cloud-agents/tools/list.d.ts +4 -0
  217. package/dist/extensions/cursor-cloud-agents/tools/list.d.ts.map +1 -0
  218. package/dist/extensions/cursor-cloud-agents/tools/list.js +36 -0
  219. package/dist/extensions/cursor-cloud-agents/tools/status.d.ts +4 -0
  220. package/dist/extensions/cursor-cloud-agents/tools/status.d.ts.map +1 -0
  221. package/dist/extensions/cursor-cloud-agents/tools/status.js +41 -0
  222. package/dist/extensions.d.ts +49 -0
  223. package/dist/extensions.d.ts.map +1 -0
  224. package/dist/extensions.js +75 -0
  225. package/dist/files-backends/cursor-hosted.d.ts +6 -0
  226. package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
  227. package/dist/files-backends/cursor-hosted.js +6 -9
  228. package/dist/index.d.ts +2 -1
  229. package/dist/index.d.ts.map +1 -1
  230. package/dist/index.js +2 -1
  231. package/dist/internal/advertise-tools.d.ts +4 -1
  232. package/dist/internal/advertise-tools.d.ts.map +1 -1
  233. package/dist/internal/advertise-tools.js +20 -1
  234. package/dist/internal/as-of.d.ts +18 -0
  235. package/dist/internal/as-of.d.ts.map +1 -1
  236. package/dist/internal/as-of.js +131 -0
  237. package/dist/internal/cli-deploy.d.ts.map +1 -1
  238. package/dist/internal/cli-deploy.js +66 -21
  239. package/dist/internal/continuation-identity.d.ts.map +1 -1
  240. package/dist/internal/continuation-identity.js +3 -1
  241. package/dist/internal/conversation-mirror.d.ts.map +1 -1
  242. package/dist/internal/conversation-mirror.js +3 -4
  243. package/dist/internal/cursor/hosted-deployment-secrets.d.ts +16 -0
  244. package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -0
  245. package/dist/internal/cursor/hosted-deployment-secrets.js +61 -0
  246. package/dist/internal/cursor/hosted-store-secrets.d.ts +15 -0
  247. package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -0
  248. package/dist/internal/cursor/hosted-store-secrets.js +48 -0
  249. package/dist/internal/cursor-deployment-relay.d.ts +15 -1
  250. package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
  251. package/dist/internal/cursor-deployment-relay.js +46 -7
  252. package/dist/internal/deploy-client.d.ts +29 -6
  253. package/dist/internal/deploy-client.d.ts.map +1 -1
  254. package/dist/internal/deploy-client.js +61 -19
  255. package/dist/internal/discovery.d.ts.map +1 -1
  256. package/dist/internal/discovery.js +426 -121
  257. package/dist/internal/distribution.d.ts.map +1 -1
  258. package/dist/internal/distribution.js +5 -0
  259. package/dist/internal/framework-file-storage.d.ts +15 -8
  260. package/dist/internal/framework-file-storage.d.ts.map +1 -1
  261. package/dist/internal/framework-file-storage.js +70 -10
  262. package/dist/internal/framework-storage-selection.d.ts +12 -12
  263. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  264. package/dist/internal/framework-storage-selection.js +33 -39
  265. package/dist/internal/hosted-delivery.d.ts +3 -1
  266. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  267. package/dist/internal/hosted-delivery.js +19 -32
  268. package/dist/internal/hosted-execution-diag.d.ts +5 -0
  269. package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
  270. package/dist/internal/hosted-execution-diag.js +5 -0
  271. package/dist/internal/hosted-execution-flush.d.ts +46 -0
  272. package/dist/internal/hosted-execution-flush.d.ts.map +1 -0
  273. package/dist/internal/hosted-execution-flush.js +81 -0
  274. package/dist/internal/mcp-endpoint.js +1 -0
  275. package/dist/internal/mcp-host.d.ts +2 -1
  276. package/dist/internal/mcp-host.d.ts.map +1 -1
  277. package/dist/internal/mcp-host.js +35 -15
  278. package/dist/internal/review-comments.d.ts +1 -1
  279. package/dist/internal/review-comments.d.ts.map +1 -1
  280. package/dist/internal/review-comments.js +4 -4
  281. package/dist/internal/server.d.ts +3 -0
  282. package/dist/internal/server.d.ts.map +1 -1
  283. package/dist/internal/server.js +79 -104
  284. package/dist/internal/session-engine.d.ts +9 -7
  285. package/dist/internal/session-engine.d.ts.map +1 -1
  286. package/dist/internal/session-engine.js +45 -34
  287. package/dist/internal/session-run-log.d.ts +5 -4
  288. package/dist/internal/session-run-log.d.ts.map +1 -1
  289. package/dist/internal/session-run-log.js +8 -8
  290. package/dist/internal/start-log-store.d.ts +60 -0
  291. package/dist/internal/start-log-store.d.ts.map +1 -0
  292. package/dist/internal/start-log-store.js +151 -0
  293. package/dist/internal/storage-coordinator.d.ts +0 -6
  294. package/dist/internal/storage-coordinator.d.ts.map +1 -1
  295. package/dist/internal/storage-coordinator.js +1 -9
  296. package/dist/internal/tool-policy.d.ts +8 -0
  297. package/dist/internal/tool-policy.d.ts.map +1 -1
  298. package/dist/internal/tool-policy.js +19 -7
  299. package/dist/playground/assets/{index-jzNbJENa.js → index-BnNN1-EK.js} +45 -45
  300. package/dist/playground/assets/index-DBQCwFp0.css +1 -0
  301. package/dist/playground/index.html +2 -2
  302. package/dist/storage-backends/cursor-hosted-v2.d.ts +83 -0
  303. package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -0
  304. package/dist/storage-backends/cursor-hosted-v2.js +164 -0
  305. package/dist/storage-backends/cursor-hosted.d.ts +6 -0
  306. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  307. package/dist/storage-backends/cursor-hosted.js +6 -1
  308. package/dist/storage-protocol.d.ts +24 -0
  309. package/dist/storage-protocol.d.ts.map +1 -1
  310. package/dist/storage-protocol.js +33 -0
  311. package/dist/storage.d.ts +1 -1
  312. package/dist/storage.d.ts.map +1 -1
  313. package/dist/storage.js +1 -1
  314. package/dist/types.d.ts +123 -6
  315. package/dist/types.d.ts.map +1 -1
  316. package/dist/types.js +29 -1
  317. package/docs/README.md +1 -1
  318. package/docs/ab.md +1 -1
  319. package/docs/building-with-agents.md +14 -11
  320. package/docs/evals.md +1 -1
  321. package/docs/guides/github.md +1 -1
  322. package/docs/guides/mcp-oauth.md +1 -1
  323. package/docs/guides/opentelemetry.md +2 -2
  324. package/docs/guides/slack.md +80 -1
  325. package/docs/hillclimbing.md +5 -5
  326. package/docs/quickstart.md +1 -1
  327. package/docs/reference/connections.md +32 -1
  328. package/docs/reference/http-api.md +1 -1
  329. package/docs/scaffolding-agents.md +3 -3
  330. package/docs/skills/index.md +26 -0
  331. package/docs/troubleshooting.md +1 -1
  332. package/package.json +18 -4
  333. package/src/bin/agent-serve.ts +11 -2
  334. package/src/channels/deployments/deployments-channel.ts +117 -8
  335. package/src/channels/deployments/types.ts +4 -3
  336. package/src/channels/github/defaults.ts +36 -3
  337. package/src/channels/github/progress.ts +7 -0
  338. package/src/channels/origin/defaults.ts +143 -0
  339. package/src/channels/origin/index.ts +2 -0
  340. package/src/channels/origin/origin-channel.ts +37 -1
  341. package/src/channels/origin/state.ts +54 -0
  342. package/src/channels/origin/types.ts +24 -0
  343. package/src/channels/slack/api.ts +37 -18
  344. package/src/channels/slack/code-fences.ts +183 -0
  345. package/src/channels/slack/constants.ts +6 -0
  346. package/src/channels/slack/defaults.ts +173 -92
  347. package/src/channels/slack/dispatch.ts +8 -1
  348. package/src/channels/slack/inbound.ts +17 -0
  349. package/src/channels/slack/index.ts +2 -0
  350. package/src/channels/slack/live-delivery.ts +142 -28
  351. package/src/channels/slack/reasoning-card.ts +140 -0
  352. package/src/channels/slack/redact.ts +6 -0
  353. package/src/channels/slack/reply-options.ts +229 -0
  354. package/src/channels/slack/slack-channel.ts +7 -2
  355. package/src/channels/slack/stream.ts +31 -24
  356. package/src/channels/slack/tool-cards.ts +221 -0
  357. package/src/channels/slack/types.ts +159 -6
  358. package/src/connections.ts +18 -1
  359. package/src/extensions/cursor-cloud-agents/extension.ts +118 -0
  360. package/src/extensions/cursor-cloud-agents/lib/cloud.ts +79 -0
  361. package/src/extensions/cursor-cloud-agents/lib/fleet.ts +109 -0
  362. package/src/extensions/cursor-cloud-agents/lib/repos.ts +81 -0
  363. package/src/extensions/cursor-cloud-agents/skills/handoff.md +27 -0
  364. package/src/extensions/cursor-cloud-agents/tools/follow_up.ts +29 -0
  365. package/src/extensions/cursor-cloud-agents/tools/launch.ts +84 -0
  366. package/src/extensions/cursor-cloud-agents/tools/list.ts +31 -0
  367. package/src/extensions/cursor-cloud-agents/tools/status.ts +39 -0
  368. package/src/extensions.ts +98 -0
  369. package/src/files-backends/cursor-hosted.ts +15 -5
  370. package/src/index.ts +2 -0
  371. package/src/internal/advertise-tools.ts +37 -12
  372. package/src/internal/as-of.ts +163 -0
  373. package/src/internal/cli-deploy.ts +88 -25
  374. package/src/internal/continuation-identity.ts +3 -1
  375. package/src/internal/conversation-mirror.ts +3 -8
  376. package/src/internal/cursor/hosted-deployment-secrets.ts +72 -0
  377. package/src/internal/cursor/hosted-store-secrets.ts +72 -0
  378. package/src/internal/cursor-deployment-relay.ts +65 -8
  379. package/src/internal/deploy-client.ts +83 -28
  380. package/src/internal/discovery.ts +479 -114
  381. package/src/internal/distribution.ts +5 -0
  382. package/src/internal/framework-file-storage.ts +80 -10
  383. package/src/internal/framework-storage-selection.ts +31 -44
  384. package/src/internal/hosted-delivery.ts +38 -63
  385. package/src/internal/hosted-execution-diag.ts +6 -0
  386. package/src/internal/hosted-execution-flush.ts +142 -0
  387. package/src/internal/mcp-endpoint.ts +1 -0
  388. package/src/internal/mcp-host.ts +40 -14
  389. package/src/internal/review-comments.ts +5 -2
  390. package/src/internal/server.ts +81 -100
  391. package/src/internal/session-engine.ts +56 -28
  392. package/src/internal/session-run-log.ts +8 -12
  393. package/src/internal/start-log-store.ts +177 -0
  394. package/src/internal/storage-coordinator.ts +1 -11
  395. package/src/internal/tool-policy.ts +39 -9
  396. package/src/storage-backends/cursor-hosted-v2.ts +219 -0
  397. package/src/storage-backends/cursor-hosted.ts +6 -1
  398. package/src/storage-protocol.ts +37 -0
  399. package/src/storage.ts +1 -0
  400. package/src/types.ts +177 -14
  401. package/dist/docs/assets/chunks/@localSearchIndexroot.DpuI4i7Z.js +0 -1
  402. package/dist/docs/assets/hillclimbing.md.DhESf3OO.js +0 -4
  403. package/dist/docs/assets/scaffolding-agents.md.D7UUkWw0.js +0 -1
  404. package/dist/internal/null-kv-storage.d.ts +0 -48
  405. package/dist/internal/null-kv-storage.d.ts.map +0 -1
  406. package/dist/internal/null-kv-storage.js +0 -58
  407. package/dist/playground/assets/index-D7rGZNjy.css +0 -1
  408. package/src/internal/null-kv-storage.ts +0 -74
  409. /package/dist/docs/assets/{ab.md.DJo5r4R-.lean.js → ab.md.mlVgqvSk.lean.js} +0 -0
  410. /package/dist/docs/assets/{building-with-agents.md.DI4mEzlt.lean.js → building-with-agents.md.CUSWxlP_.lean.js} +0 -0
  411. /package/dist/docs/assets/{evals.md.lfJoEVc8.lean.js → evals.md.CPzDAwoH.lean.js} +0 -0
  412. /package/dist/docs/assets/{guides_github.md.Cnh2mL4a.lean.js → guides_github.md.BtPr9GaP.lean.js} +0 -0
  413. /package/dist/docs/assets/{guides_mcp-oauth.md.CN-6YmTJ.lean.js → guides_mcp-oauth.md.Dp6cDP7f.lean.js} +0 -0
  414. /package/dist/docs/assets/{guides_opentelemetry.md.bmPmkvJu.lean.js → guides_opentelemetry.md.BVTXDCRg.lean.js} +0 -0
  415. /package/dist/docs/assets/{hillclimbing.md.DhESf3OO.lean.js → hillclimbing.md.CpTGTCle.lean.js} +0 -0
  416. /package/dist/docs/assets/{index.md.CVeRUOeZ.lean.js → index.md.Bb4k8kUm.lean.js} +0 -0
  417. /package/dist/docs/assets/{quickstart.md.Nj_LjW_a.lean.js → quickstart.md.DdQOF7Y8.lean.js} +0 -0
  418. /package/dist/docs/assets/{reference_http-api.md.BEJx9XVj.lean.js → reference_http-api.md.oySXBO8o.lean.js} +0 -0
  419. /package/dist/docs/assets/{scaffolding-agents.md.D7UUkWw0.lean.js → scaffolding-agents.md.em43xlY1.lean.js} +0 -0
  420. /package/dist/docs/assets/{troubleshooting.md.DCiPBhYs.lean.js → troubleshooting.md.Cus_YZga.lean.js} +0 -0
@@ -4,11 +4,36 @@
4
4
 
5
5
  export type StreamTaskStatus = "pending" | "in_progress" | "complete" | "error";
6
6
 
7
+ /**
8
+ * One update to a task card. Slack keeps one card per `id`: `title` and
9
+ * `status` replace the previous values, `details` and `output` are appended
10
+ * to what the card already shows.
11
+ */
7
12
  export interface StreamTaskChunk {
8
13
  type: "task_update";
9
14
  id: string;
10
15
  title: string;
11
16
  status: StreamTaskStatus;
17
+ details?: string;
18
+ output?: string;
19
+ }
20
+
21
+ export interface StreamMarkdownChunk {
22
+ type: "markdown_text";
23
+ text: string;
24
+ }
25
+
26
+ /**
27
+ * A `chat.*Stream` chunk. Slack fixes a stream's mode at `chat.startStream`:
28
+ * one opened with bare `markdown_text` rejects every later `chunks` append
29
+ * (`streaming_mode_mismatch`), and vice versa. The live-delivery strategy
30
+ * therefore always speaks chunks, wrapping text as `markdown_text` chunks so
31
+ * tool-step `task_update`s can share the same message.
32
+ */
33
+ export type StreamChunk = StreamMarkdownChunk | StreamTaskChunk;
34
+
35
+ export function markdownChunk(text: string): StreamMarkdownChunk {
36
+ return { type: "markdown_text", text };
12
37
  }
13
38
 
14
39
  /**
@@ -36,28 +61,10 @@ export function computeStreamAppend(
36
61
  return "";
37
62
  }
38
63
 
39
- /** Build task_update chunks for tool calls. */
40
- export function buildTaskChunksForCalls(
41
- calls: Array<{ callId: string; toolName: string }>,
42
- status: StreamTaskStatus
43
- ): StreamTaskChunk[] {
44
- return calls.map((call) => ({
45
- type: "task_update" as const,
46
- id: call.callId,
47
- title: call.toolName,
48
- status,
49
- }));
50
- }
51
-
52
- export function buildTaskChunkForResult(args: {
53
- callId: string;
54
- toolName: string;
55
- isError: boolean;
56
- }): StreamTaskChunk {
57
- return {
58
- type: "task_update",
59
- id: args.callId,
60
- title: args.toolName,
61
- status: args.isError ? "error" : "complete",
62
- };
64
+ /** Clamp to `max` characters, ending in an ellipsis when cut. */
65
+ export function truncateCardText(text: string, max: number): string {
66
+ if (text.length <= max) {
67
+ return text;
68
+ }
69
+ return `${text.slice(0, max - 1)}…`;
63
70
  }
@@ -0,0 +1,221 @@
1
+ /**
2
+ * Task cards for tool calls inside the streamed reply. One card per key:
3
+ * the call id for `per-call`, the tool name for `per-tool`. A card's title
4
+ * counts its calls and its status follows the whole group; with one call
5
+ * per key that reduces to the plain per-call card.
6
+ */
7
+
8
+ import { redactSecretTokens } from "./redact.js";
9
+ import type { ResolvedSlackToolCards } from "./reply-options.js";
10
+ import { type StreamTaskChunk, truncateCardText } from "./stream.js";
11
+ import type {
12
+ SlackChannelState,
13
+ SlackToolCall,
14
+ SlackToolResult,
15
+ ToolCardCount,
16
+ } from "./types.js";
17
+
18
+ /** The argument the playground puts in a built-in tool's header. */
19
+ const TOOL_PRIMARY_ARGS: Readonly<Record<string, readonly string[]>> = {
20
+ grep: ["pattern"],
21
+ glob: ["glob_pattern", "globPattern"],
22
+ read: ["path", "file_path", "target_file"],
23
+ shell: ["command", "cmd"],
24
+ task: ["description", "prompt"],
25
+ };
26
+ /** For other tools: the telling key, if any. */
27
+ const GENERIC_PRIMARY_ARGS = [
28
+ "pattern",
29
+ "query",
30
+ "command",
31
+ "cmd",
32
+ "path",
33
+ "file",
34
+ "file_path",
35
+ "target_file",
36
+ "url",
37
+ "prompt",
38
+ "description",
39
+ "name",
40
+ "message",
41
+ ];
42
+ const PATH_ARGS = new Set([
43
+ "path",
44
+ "file",
45
+ "file_path",
46
+ "target_file",
47
+ "target_directory",
48
+ "targetDirectory",
49
+ ]);
50
+ const LINE_MAX = 80;
51
+ const JSON_MAX = 120;
52
+
53
+ function oneLine(text: string, max: number): string {
54
+ return truncateCardText(
55
+ redactSecretTokens(text).replace(/\s+/g, " ").trim(),
56
+ max
57
+ );
58
+ }
59
+
60
+ /** Clamp the middle so both ends stay visible; tail-biased to keep filenames. */
61
+ function clampPath(text: string, max: number): string {
62
+ const one = redactSecretTokens(text).replace(/\s+/g, " ").trim();
63
+ if (one.length <= max) {
64
+ return one;
65
+ }
66
+ const budget = max - 1;
67
+ const head = Math.max(1, Math.floor(budget * 0.35));
68
+ const tail = Math.max(1, budget - head);
69
+ return `${one.slice(0, head)}…${one.slice(one.length - tail)}`;
70
+ }
71
+
72
+ /**
73
+ * Default tool-card line for a call, matching the playground's tool header:
74
+ * the grep pattern, the glob pattern, the file path, the shell command. Other
75
+ * tools show a lone string argument bare, else compact JSON. No key labels,
76
+ * no knobs like `headLimit`.
77
+ */
78
+ export function defaultToolCardDetails(
79
+ call: SlackToolCall
80
+ ): string | undefined {
81
+ const args = call.args;
82
+ if (args === undefined || args === null) {
83
+ return undefined;
84
+ }
85
+ if (typeof args === "string") {
86
+ const line = oneLine(args, LINE_MAX);
87
+ return line === "" ? undefined : line;
88
+ }
89
+ if (typeof args !== "object" || Array.isArray(args)) {
90
+ return oneLine(JSON.stringify(args), JSON_MAX);
91
+ }
92
+ const record = args as Record<string, unknown>;
93
+ for (const key of TOOL_PRIMARY_ARGS[call.toolName] ?? GENERIC_PRIMARY_ARGS) {
94
+ const value = record[key];
95
+ if (typeof value === "string" && value.trim() !== "") {
96
+ return PATH_ARGS.has(key)
97
+ ? clampPath(value, LINE_MAX)
98
+ : oneLine(value, LINE_MAX);
99
+ }
100
+ }
101
+ const entries = Object.entries(record);
102
+ if (entries.length === 0) {
103
+ return undefined;
104
+ }
105
+ const lone = entries.length === 1 ? entries[0]?.[1] : undefined;
106
+ if (typeof lone === "string" && lone.trim() !== "") {
107
+ return oneLine(lone, LINE_MAX);
108
+ }
109
+ return oneLine(JSON.stringify(record), JSON_MAX);
110
+ }
111
+
112
+ export interface ToolCards {
113
+ forCalls(
114
+ state: SlackChannelState,
115
+ calls: readonly SlackToolCall[]
116
+ ): StreamTaskChunk[];
117
+ forResult(state: SlackChannelState, result: SlackToolResult): StreamTaskChunk;
118
+ }
119
+
120
+ function tallyFor(state: SlackChannelState, key: string): ToolCardCount {
121
+ if (state.toolCardCounts === undefined) {
122
+ state.toolCardCounts = {};
123
+ }
124
+ const existing = state.toolCardCounts[key];
125
+ if (existing !== undefined) {
126
+ return existing;
127
+ }
128
+ const created: ToolCardCount = { started: 0, done: 0, errors: 0 };
129
+ state.toolCardCounts[key] = created;
130
+ return created;
131
+ }
132
+
133
+ /**
134
+ * Slack appends each update's text to the card verbatim, so a group's later
135
+ * batch of lines brings its own line break.
136
+ */
137
+ function appendLines(
138
+ tally: ToolCardCount,
139
+ field: "details" | "output",
140
+ lines: readonly string[]
141
+ ): string | undefined {
142
+ if (lines.length === 0) {
143
+ return undefined;
144
+ }
145
+ const already = tally[field] ?? 0;
146
+ tally[field] = already + lines.length;
147
+ return `${already > 0 ? "\n" : ""}${lines.join("\n")}`;
148
+ }
149
+
150
+ function present(line: string | undefined): line is string {
151
+ return line !== undefined && line !== "";
152
+ }
153
+
154
+ export function createToolCards(
155
+ cards: ResolvedSlackToolCards,
156
+ toolLabel: (toolName: string) => string
157
+ ): ToolCards {
158
+ const keyOf = (call: { callId: string; toolName: string }): string =>
159
+ cards.group === "per-call" ? call.callId : `tool:${call.toolName}`;
160
+ const title = (toolName: string, started: number): string => {
161
+ const label = toolLabel(toolName);
162
+ return started > 1 ? `${label} ×${started}` : label;
163
+ };
164
+
165
+ return {
166
+ forCalls(state, calls) {
167
+ const groups = new Map<string, SlackToolCall[]>();
168
+ for (const call of calls) {
169
+ const key = keyOf(call);
170
+ groups.set(key, [...(groups.get(key) ?? []), call]);
171
+ }
172
+ return [...groups.entries()].map(([key, group]) => {
173
+ const tally = tallyFor(state, key);
174
+ tally.started += group.length;
175
+ const chunk: StreamTaskChunk = {
176
+ type: "task_update",
177
+ id: key,
178
+ title: title(group[0]!.toolName, tally.started),
179
+ status: "in_progress",
180
+ };
181
+ const details = appendLines(
182
+ tally,
183
+ "details",
184
+ group.map((call) => cards.details?.(call)).filter(present)
185
+ );
186
+ if (details !== undefined) {
187
+ chunk.details = details;
188
+ }
189
+ return chunk;
190
+ });
191
+ },
192
+
193
+ forResult(state, result) {
194
+ const tally = tallyFor(state, keyOf(result));
195
+ tally.done += 1;
196
+ if (result.isError) {
197
+ tally.errors += 1;
198
+ }
199
+ const chunk: StreamTaskChunk = {
200
+ type: "task_update",
201
+ id: keyOf(result),
202
+ title: title(result.toolName, tally.started),
203
+ status:
204
+ tally.done < tally.started
205
+ ? "in_progress"
206
+ : tally.errors > 0
207
+ ? "error"
208
+ : "complete",
209
+ };
210
+ const output = appendLines(
211
+ tally,
212
+ "output",
213
+ [cards.output?.(result)].filter(present)
214
+ );
215
+ if (output !== undefined) {
216
+ chunk.output = output;
217
+ }
218
+ return chunk;
219
+ },
220
+ };
221
+ }
@@ -79,6 +79,8 @@ export interface SlackChannelState {
79
79
  * for the rest of the turn.
80
80
  */
81
81
  streamingUnavailable?: boolean;
82
+ /** The open stream hit Slack's size cap; appends stop until it closes. */
83
+ streamFull?: boolean;
82
84
  /** Editable progress message ts when `chat.startStream` is unavailable. */
83
85
  progressTs: string | null;
84
86
  /**
@@ -86,8 +88,151 @@ export interface SlackChannelState {
86
88
  * replacing Approve/Deny buttons after a decision).
87
89
  */
88
90
  approvalMessageByCallId?: Record<string, string>;
91
+ /** `reply.reasoningCard` bookkeeping for the current turn. */
92
+ reasoningCard?: ReasoningCardState;
93
+ /** `reply.toolCards` per-tool tallies for the current turn, keyed by tool name. */
94
+ toolCardCounts?: Record<string, ToolCardCount>;
89
95
  }
90
96
 
97
+ /**
98
+ * Slack appends a task card's `details` across updates, so the reasoning
99
+ * card is fed deltas: `blockSent` is how much of the current reasoning block
100
+ * is already on Slack, `pending` is buffered text awaiting a flush.
101
+ */
102
+ export interface ReasoningCardState {
103
+ status: "in_progress" | "complete" | null;
104
+ blockSent: number | null;
105
+ pending: string;
106
+ lastFlushMs: number | null;
107
+ chars: number;
108
+ }
109
+
110
+ /**
111
+ * `details` / `output` count the lines already on the card, so a later
112
+ * batch can start on a new line (Slack appends updates verbatim).
113
+ */
114
+ export interface ToolCardCount {
115
+ started: number;
116
+ done: number;
117
+ errors: number;
118
+ details?: number;
119
+ output?: number;
120
+ }
121
+
122
+ /** A tool call as the model requested it (`actions.requested`). */
123
+ export interface SlackToolCall {
124
+ callId: string;
125
+ toolName: string;
126
+ args?: unknown;
127
+ }
128
+
129
+ /** A finished tool call (`action.result`). */
130
+ export interface SlackToolResult {
131
+ callId: string;
132
+ toolName: string;
133
+ output?: unknown;
134
+ isError: boolean;
135
+ }
136
+
137
+ /**
138
+ * What the status chip under the thread shows while a turn runs. Slack caps
139
+ * each line at 50 characters. While a `chat.startStream` is open Slack shows
140
+ * its own generic "is working…" instead, so in `"stream"` mode these lines
141
+ * are only visible until the first chunk goes out.
142
+ */
143
+ export interface SlackStatusOptions {
144
+ /** First line of each reasoning block, throttled. Defaults to `true`. */
145
+ reasoning?: boolean;
146
+ /**
147
+ * Tool calls as they start: `"Running grep, glob…"` (tool names through
148
+ * {@link SlackChannelOptions.toolLabels}), or your own line. Defaults to
149
+ * `true`.
150
+ */
151
+ tools?: boolean | ((calls: readonly SlackToolCall[]) => string);
152
+ /**
153
+ * Rotation Slack cycles through while nothing more specific is known
154
+ * (turn start, long silent stretches). Up to 5 entries. Defaults to
155
+ * Thinking… / Working on it… / Almost there….
156
+ */
157
+ idle?: readonly string[];
158
+ }
159
+
160
+ export type SlackToolCardGroup = "per-call" | "per-tool";
161
+
162
+ /**
163
+ * Task cards for tool calls inside the streamed reply. Slack appends each
164
+ * update's `details` / `output` to the card, so the callbacks return the
165
+ * text to add, not the full card.
166
+ */
167
+ export interface SlackToolCardOptions {
168
+ /**
169
+ * `"per-tool"` (default) keeps one card per tool name and counts calls in
170
+ * the title (`grep ×3`). `"per-call"` shows one card per call.
171
+ */
172
+ group?: SlackToolCardGroup;
173
+ /**
174
+ * `true` (default): cards expand to show one line per call, the way the
175
+ * reasoning card does. `false`: cards are their titles only.
176
+ */
177
+ collapsible?: boolean;
178
+ /**
179
+ * The line a collapsible card shows for a call. Defaults to what the
180
+ * playground shows in that tool's header: the grep pattern, the file
181
+ * path, the shell command.
182
+ */
183
+ details?: (call: SlackToolCall) => string | undefined;
184
+ /** Text appended to a collapsible card when a call finishes. */
185
+ output?: (result: SlackToolResult) => string | undefined;
186
+ }
187
+
188
+ /**
189
+ * One task card that receives the model's reasoning as it streams. Its
190
+ * status is `in_progress` while the model thinks and `complete` once the
191
+ * answer text starts.
192
+ */
193
+ export interface SlackReasoningCardOptions {
194
+ /** Card title. Defaults to `"Thinking"`. */
195
+ title?: string;
196
+ /**
197
+ * Stop appending after this many characters. Defaults to 1500: Slack caps
198
+ * a streamed message (answer text plus cards) near 12k, so a long card
199
+ * shortens the answer that fits before the reply spills into a second
200
+ * message.
201
+ */
202
+ maxChars?: number;
203
+ }
204
+
205
+ /**
206
+ * How the reply reaches the thread while the turn runs.
207
+ *
208
+ * - `"post"` (default): live feedback is the status chip; the answer lands
209
+ * as one message when the turn finishes.
210
+ * - `"stream"`: the answer text streams into one message as it is written.
211
+ * Slack replaces the status chip with its generic "is working…" for the
212
+ * duration, so live feedback inside the message comes from cards.
213
+ */
214
+ export type SlackReplyOptions =
215
+ | {
216
+ mode: "post";
217
+ status?: SlackStatusOptions;
218
+ }
219
+ | {
220
+ mode: "stream";
221
+ status?: SlackStatusOptions;
222
+ /** Defaults to `false`. `true` is `{ group: "per-tool" }`. */
223
+ toolCards?: boolean | SlackToolCardOptions;
224
+ /** Defaults to `false`. */
225
+ reasoningCard?: boolean | SlackReasoningCardOptions;
226
+ };
227
+
228
+ /**
229
+ * Human labels for tool names, shared by the status chip and the cards.
230
+ * A function may return `undefined` to keep the raw tool name.
231
+ */
232
+ export type SlackToolLabels =
233
+ | Readonly<Record<string, string>>
234
+ | ((toolName: string) => string | undefined);
235
+
91
236
  export interface SlackAuthor {
92
237
  /** Slack user id. Empty string for bot posts with no `user` field. */
93
238
  userId: string;
@@ -502,13 +647,21 @@ export interface SlackChannelOptions {
502
647
  */
503
648
  deliverDefaults?: boolean;
504
649
  /**
505
- * Stream assistant text while the turn runs via `chat.startStream` /
506
- * `appendStream` / `stopStream` (defaults to `true`).
650
+ * How the reply reaches the thread: status chip + one message at the end
651
+ * (`"post"`, default), or a live-streamed message with optional tool and
652
+ * reasoning cards (`"stream"`). See {@link SlackReplyOptions}.
653
+ */
654
+ reply?: SlackReplyOptions;
655
+ /** Human labels for tool names in the status chip and cards. */
656
+ toolLabels?: SlackToolLabels;
657
+ /**
658
+ * @deprecated Use `reply: { mode: "stream" }` / `reply: { mode: "post" }`.
659
+ * Ignored when `reply` is set.
507
660
  */
508
661
  streaming?: boolean;
509
662
  /**
510
- * Show task-style thinking steps for tool calls (stream chunks or status).
511
- * Defaults to `true`.
663
+ * @deprecated Use `reply: { mode: "stream", toolCards: true }`. Ignored
664
+ * when `reply` is set.
512
665
  */
513
666
  thinkingSteps?: boolean;
514
667
  /**
@@ -556,8 +709,8 @@ export interface SlackChannelOptions {
556
709
  suggestedPrompts?: SlackSuggestedPrompt[];
557
710
  suggestedPromptsTitle?: string;
558
711
  /**
559
- * Rotating `assistant.threads.setStatus` loading lines (Slack caps each
560
- * entry at 50 chars). Defaults to Thinking… / Working on it… / Almost there….
712
+ * @deprecated Use `reply: { mode, status: { idle: [...] } }`. Ignored when
713
+ * `reply` is set.
561
714
  */
562
715
  loadingMessages?: string[];
563
716
  /**
@@ -8,7 +8,9 @@
8
8
  * are available to the agent (SDK `mcpServers`), host (`ctx.host.mcp`),
9
9
  * and channel/schedule handlers. Pass `advertiseTools: true` for named
10
10
  * tools on local turns. Pass `effects: "read"` with `advertiseTools` to
11
- * advertise only tools the server classifies as reads. Files under
11
+ * advertise only tools the server classifies as reads. Pass `tools` as
12
+ * a name list to keep a subset, same shape as `defineAgent({ tools })`.
13
+ * Pass `disallowedTools` to drop names. Files under
12
14
  * `host-connections/` stay off the model.
13
15
  *
14
16
  * ```ts
@@ -42,6 +44,20 @@
42
44
  * advertiseTools: true,
43
45
  * effects: "read",
44
46
  * });
47
+ *
48
+ * // named subset: advertise and call only these tools
49
+ * export default defineConnection({
50
+ * url: "https://mcp.example.com/inventory",
51
+ * advertiseTools: true,
52
+ * tools: ["search_skus", "get_stock"],
53
+ * });
54
+ *
55
+ * // drop a few tools from a large server
56
+ * export default defineConnection({
57
+ * url: "https://mcp.example.com/inventory",
58
+ * advertiseTools: true,
59
+ * disallowedTools: ["place_order", "delete_sku"],
60
+ * });
45
61
  * ```
46
62
  *
47
63
  * A **Cursor account MCP connection** exposes the MCP connectors the operator
@@ -129,6 +145,7 @@ export {
129
145
  isInlineStdioConnection,
130
146
  isToolEffect,
131
147
  normalizeConnectionEffects,
148
+ normalizeConnectionTools,
132
149
  normalizeCursorAccountServers,
133
150
  } from "./types.js";
134
151
 
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Cursor cloud agents as an extension. Mount it and the agent can hand
3
+ * coding work to Cursor cloud agents and steer a fleet of them:
4
+ *
5
+ * ```ts
6
+ * // agent/extensions/cloud.ts
7
+ * import cursorCloudAgents from "@cursor/july/extensions/cursor-cloud-agents";
8
+ *
9
+ * export default cursorCloudAgents({
10
+ * cloud: { repos: [{ url: "https://github.com/acme/api" }], autoCreatePR: true },
11
+ * });
12
+ * ```
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.
21
+ */
22
+
23
+ import { z } from "zod";
24
+ import { defineExtension } from "../../extensions.js";
25
+ import type {
26
+ AgentCloudOptions,
27
+ Extension,
28
+ ModelSetting,
29
+ } from "../../types.js";
30
+
31
+ /** Mount options; every field is optional. */
32
+ export interface CursorCloudAgentsOptions {
33
+ /**
34
+ * Launch defaults: target `repos`, `env`, `autoCreatePR`, ... in the same
35
+ * vocabulary as `defineAgent({ cloud })`. Configured `repos` are also the
36
+ * allowlist for a launch's own `repo` / `prUrl`; model-chosen targets are
37
+ * refused when no allowlist is configured. With none configured,
38
+ * `needsApproval` defaults to true so prompt-only launches park first.
39
+ */
40
+ cloud?: AgentCloudOptions;
41
+ /** Model for launched agents. The account default when omitted. */
42
+ model?: ModelSetting;
43
+ /**
44
+ * Park launches and follow-ups for a human approval. Defaults to `true`
45
+ * when no `cloud.repos` are configured (prompt-only launches still use
46
+ * the host key); `false` once repositories are configured. Pass an
47
+ * explicit boolean to override. Model-chosen `repo` / `prUrl` still
48
+ * require the allowlist regardless of this flag.
49
+ */
50
+ needsApproval?: boolean;
51
+ /** Cursor API key. Defaults to the serve host's own key. */
52
+ apiKey?: string;
53
+ }
54
+
55
+ /** {@link CursorCloudAgentsOptions} with defaults applied. */
56
+ export interface CursorCloudAgentsConfig {
57
+ cloud: AgentCloudOptions;
58
+ model?: ModelSetting;
59
+ needsApproval: boolean;
60
+ apiKey?: string;
61
+ }
62
+
63
+ const repo = z.object({
64
+ url: z.string().url(),
65
+ startingRef: z.string().optional(),
66
+ prUrl: z.string().url().optional(),
67
+ });
68
+
69
+ const cloud: z.ZodType<AgentCloudOptions> = z.object({
70
+ env: z
71
+ .discriminatedUnion("type", [
72
+ z.object({ type: z.literal("cloud"), name: z.string().optional() }),
73
+ z.object({ type: z.literal("pool"), name: z.string().optional() }),
74
+ z.object({ type: z.literal("machine"), name: z.string().optional() }),
75
+ ])
76
+ .optional(),
77
+ repos: z.array(repo).optional(),
78
+ workOnCurrentBranch: z.boolean().optional(),
79
+ autoCreatePR: z.boolean().optional(),
80
+ skipReviewerRequest: z.boolean().optional(),
81
+ envVars: z.record(z.string()).optional(),
82
+ });
83
+
84
+ const model: z.ZodType<ModelSetting> = z.union([
85
+ z.string().min(1),
86
+ z.object({
87
+ id: z.string().min(1),
88
+ params: z.array(z.object({ id: z.string(), value: z.string() })).optional(),
89
+ }),
90
+ ]);
91
+
92
+ const config: z.ZodType<
93
+ CursorCloudAgentsConfig,
94
+ z.ZodTypeDef,
95
+ CursorCloudAgentsOptions | undefined
96
+ > = z
97
+ .object({
98
+ cloud: cloud.default({}),
99
+ model: model.optional(),
100
+ needsApproval: z.boolean().optional(),
101
+ apiKey: z.string().optional(),
102
+ })
103
+ .default({})
104
+ .transform((options) => ({
105
+ ...options,
106
+ needsApproval: options.needsApproval ?? options.cloud.repos === undefined,
107
+ }));
108
+
109
+ const cursorCloudAgents: Extension<
110
+ CursorCloudAgentsConfig,
111
+ CursorCloudAgentsOptions | undefined
112
+ > = defineExtension({
113
+ root: import.meta.dirname,
114
+ description: "Launch, steer, and monitor Cursor cloud agents.",
115
+ config,
116
+ });
117
+
118
+ export default cursorCloudAgents;