@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
@@ -27,21 +27,25 @@
27
27
  * `defineConnection({ effects })` filters the listing before names are
28
28
  * assigned: only tools whose MCP annotations classify as an intended
29
29
  * effect are advertised. Unclassified tools are omitted, not guessed.
30
+ * `defineConnection({ tools: [...] })` keeps only the named tools.
31
+ * `disallowedTools` drops names. A name filter that matches nothing on
32
+ * the server fails the turn.
30
33
  * Tools whose `annotations.title` is `do-not-call` are dropped as well
31
34
  * (vendor host-UI / MCP Apps helpers that still carry `readOnlyHint`).
32
35
  */
33
36
 
34
- import type {
35
- DiscoveredConnection,
36
- DiscoveredTool,
37
- HostMcpCallResult,
38
- HostMcpToolInfo,
39
- JsonSchemaObject,
40
- McpToolAnnotations,
41
- ResolvedAgent,
42
- SessionInfo,
43
- ToolDefinition,
44
- ToolEffect,
37
+ import {
38
+ connectionAllowsTool,
39
+ type DiscoveredConnection,
40
+ type DiscoveredTool,
41
+ type HostMcpCallResult,
42
+ type HostMcpToolInfo,
43
+ type JsonSchemaObject,
44
+ type McpToolAnnotations,
45
+ type ResolvedAgent,
46
+ type SessionInfo,
47
+ type ToolDefinition,
48
+ type ToolEffect,
45
49
  } from "../types.js";
46
50
  import { brandDefinition } from "./brand.js";
47
51
  import type { HostMcpOneOff } from "./mcp-host.js";
@@ -136,7 +140,14 @@ export async function resolveAdvertisedTools(args: {
136
140
  try {
137
141
  const source = await sourceFor(connection, args.session, args.hostMcp);
138
142
  const listed = await source.listTools();
139
- return { connection, ok: true, source, listed };
143
+ return {
144
+ connection,
145
+ ok: true,
146
+ source,
147
+ listed: listed.filter((info) =>
148
+ connectionAllowsTool(connection, info.name)
149
+ ),
150
+ };
140
151
  } catch (error) {
141
152
  return { connection, ok: false, error };
142
153
  }
@@ -157,6 +168,20 @@ export async function resolveAdvertisedTools(args: {
157
168
  );
158
169
  }
159
170
  const { source, listed } = listing;
171
+ if (
172
+ (connection.tools !== undefined ||
173
+ connection.disallowedTools !== undefined) &&
174
+ listed.length === 0
175
+ ) {
176
+ const error = new Error(
177
+ `Advertised connection "${connection.name}" tool filter matched no tools on the server.`
178
+ );
179
+ if (args.onConnectionError !== undefined) {
180
+ args.onConnectionError(connection.name, error);
181
+ continue;
182
+ }
183
+ throw error;
184
+ }
160
185
  const intended = listed.filter(
161
186
  (info) =>
162
187
  !isDoNotCallTool(info.annotations) &&
@@ -105,3 +105,166 @@ export function timeArgViolation(
105
105
  }
106
106
  return undefined;
107
107
  }
108
+
109
+ // Whole-string only: a query that merely contains "now" is not a bound.
110
+ // Duration-only strings (`30m`, `2h`) and last/this plus a non-window word
111
+ // (`last modified`) are not time bounds. Calendar-aligned `now/d` is.
112
+ const TIME_UNIT =
113
+ "(?:s|sec|secs|second|seconds|m|min|mins|minute|minutes|h|hr|hrs|hour|hours|d|day|days|w|week|weeks|mo|month|months|y|yr|yrs|year|years)";
114
+ const WINDOW_WORD =
115
+ "(?:second|seconds|minute|minutes|hour|hours|day|days|week|weeks|month|months|year|years|quarter|quarters|weekend|monday|tuesday|wednesday|thursday|friday|saturday|sunday|morning|afternoon|evening|night)";
116
+ const RELATIVE_TIME_EXPRESSION = new RegExp(
117
+ `^(?:now(?:\\s*[+-]\\s*\\d+\\s*${TIME_UNIT}\\b.*|/[a-zA-Z]+.*)?|[+-]\\d+\\s*${TIME_UNIT}|today|yesterday|tomorrow|(?:last|this)\\s+${WINDOW_WORD})$`,
118
+ "i"
119
+ );
120
+
121
+ function forwardTimeReason(
122
+ value: unknown,
123
+ asOf: string,
124
+ frozenMs: number
125
+ ): string | undefined {
126
+ if (typeof value !== "string") {
127
+ return undefined;
128
+ }
129
+ const trimmed = value.trim();
130
+ if (trimmed === "") {
131
+ return undefined;
132
+ }
133
+ if (RELATIVE_TIME_EXPRESSION.test(trimmed)) {
134
+ return (
135
+ `Argument ${JSON.stringify(value)} is a relative time expression, ` +
136
+ `which reads against the real present. This session reads the world ` +
137
+ `as of ${asOf}; supply an absolute ISO-8601 instant with a timezone ` +
138
+ `at or before that instant and retry.`
139
+ );
140
+ }
141
+ const instant = parseInstant(trimmed);
142
+ if (instant !== undefined && instant.getTime() > frozenMs) {
143
+ return (
144
+ `Argument ${JSON.stringify(value)} is later than the instant this ` +
145
+ `session reads the world as of (${asOf}). Supply a bound at or before ` +
146
+ `that instant and retry.`
147
+ );
148
+ }
149
+ return undefined;
150
+ }
151
+
152
+ /** Relative expressions or instants after `asOf`. Numeric epochs need `timeArgs`. */
153
+ export function forwardTimeArgument(
154
+ input: unknown,
155
+ asOf: string
156
+ ): string | undefined {
157
+ const frozenMs = new Date(asOf).getTime();
158
+ const seen = new Set<unknown>();
159
+ const walk = (value: unknown, depth: number): string | undefined => {
160
+ if (depth > 8) {
161
+ return undefined;
162
+ }
163
+ const reason = forwardTimeReason(value, asOf, frozenMs);
164
+ if (reason !== undefined) {
165
+ return reason;
166
+ }
167
+ if (Array.isArray(value)) {
168
+ for (const item of value) {
169
+ const found = walk(item, depth + 1);
170
+ if (found !== undefined) {
171
+ return found;
172
+ }
173
+ }
174
+ return undefined;
175
+ }
176
+ if (typeof value === "object" && value !== null) {
177
+ if (seen.has(value)) {
178
+ return undefined;
179
+ }
180
+ seen.add(value);
181
+ for (const item of Object.values(value as Record<string, unknown>)) {
182
+ const found = walk(item, depth + 1);
183
+ if (found !== undefined) {
184
+ return found;
185
+ }
186
+ }
187
+ }
188
+ return undefined;
189
+ };
190
+ return walk(input, 0);
191
+ }
192
+
193
+ /**
194
+ * Property names that carry a query's time window when a vendor schema
195
+ * declares them. Deliberately narrower than the embedded-filter key list:
196
+ * these must be safe to *require*, so only unambiguous window names — never
197
+ * `timestamp`/`date`, which name data fields more often than bounds.
198
+ */
199
+ const TIME_WINDOW_KEYS = new Set([
200
+ "from",
201
+ "to",
202
+ "since",
203
+ "until",
204
+ "start",
205
+ "end",
206
+ "start_time",
207
+ "end_time",
208
+ "starttime",
209
+ "endtime",
210
+ ]);
211
+
212
+ /**
213
+ * The string-typed time-window properties a tool's input schema declares.
214
+ * String-typed only: a numeric `from` is a pagination offset more often than
215
+ * an instant, and requiring an ISO value there would break the call.
216
+ */
217
+ export function schemaTimeWindowKeys(
218
+ inputSchema: { properties?: Record<string, unknown> } | undefined
219
+ ): string[] {
220
+ const properties = inputSchema?.properties;
221
+ if (properties === undefined) {
222
+ return [];
223
+ }
224
+ const keys: string[] = [];
225
+ for (const [name, spec] of Object.entries(properties)) {
226
+ if (!TIME_WINDOW_KEYS.has(name.toLowerCase())) {
227
+ continue;
228
+ }
229
+ const type =
230
+ typeof spec === "object" && spec !== null
231
+ ? (spec as { type?: unknown }).type
232
+ : undefined;
233
+ const types = Array.isArray(type) ? type : [type];
234
+ if (types.includes("string")) {
235
+ keys.push(name);
236
+ }
237
+ }
238
+ return keys;
239
+ }
240
+
241
+ /**
242
+ * An omitted time window on a vendor tool is not "no window" — the vendor
243
+ * fills it with a live default (Datadog: `now-1h`..`now`), which the walker
244
+ * cannot see because the value is never present. In a frozen session a call
245
+ * that omits a schema-declared window key is refused so the model supplies
246
+ * the bound explicitly, where {@link forwardTimeArgument} then checks it.
247
+ */
248
+ export function missingTimeWindow(
249
+ input: unknown,
250
+ windowKeys: readonly string[],
251
+ asOf: string
252
+ ): string | undefined {
253
+ if (windowKeys.length === 0) {
254
+ return undefined;
255
+ }
256
+ const record =
257
+ typeof input === "object" && input !== null
258
+ ? (input as Record<string, unknown>)
259
+ : {};
260
+ const missing = windowKeys.filter((key) => record[key] === undefined);
261
+ if (missing.length === 0) {
262
+ return undefined;
263
+ }
264
+ return (
265
+ `This tool fills omitted time bounds (${missing.join(", ")}) with a ` +
266
+ `live default window, which reads the real present. This session reads ` +
267
+ `the world as of ${asOf}; supply each bound explicitly as an absolute ` +
268
+ `ISO-8601 instant with a timezone at or before that instant and retry.`
269
+ );
270
+ }
@@ -329,6 +329,14 @@ export async function cmdDeploy(options: DeployCliOptions): Promise<number> {
329
329
  if (manifests.every((manifest) => manifest.architecture === "v2")) {
330
330
  return deployAgentsdkApplication(ctx, options, targets, {
331
331
  hasScmChannels: manifests.some((manifest) => manifest.hasScmChannels),
332
+ declaredSecretNames: [
333
+ ...new Set(
334
+ manifests.flatMap((manifest) => manifest.hosting?.secretNames ?? [])
335
+ ),
336
+ ],
337
+ hasDeploymentsChannels: manifests.some(
338
+ (manifest) => manifest.hasDeploymentsChannels
339
+ ),
332
340
  });
333
341
  }
334
342
  if (
@@ -741,6 +749,8 @@ async function deployOne(
741
749
  agentPath,
742
750
  repositories: options.cursorEventsRepos,
743
751
  hasScmChannels: manifest.hasScmChannels,
752
+ declaredSecretNames: hosting?.secretNames,
753
+ hasDeploymentsChannels: manifest.hasDeploymentsChannels,
744
754
  multiTenant: options.multiTenant === true,
745
755
  });
746
756
  }
@@ -871,7 +881,11 @@ async function deployAgentsdkApplication(
871
881
  ctx: DeployCliContext,
872
882
  options: DeployCliOptions,
873
883
  targets: readonly DeployTarget[],
874
- declarations: { hasScmChannels: boolean }
884
+ declarations: {
885
+ hasScmChannels: boolean;
886
+ declaredSecretNames: string[];
887
+ hasDeploymentsChannels: boolean;
888
+ }
875
889
  ): Promise<number> {
876
890
  const parentDir = resolve(options.dir ?? ".");
877
891
  const slug = slugFromDirectoryName(basename(parentDir));
@@ -936,16 +950,7 @@ async function deployAgentsdkApplication(
936
950
  );
937
951
  }
938
952
 
939
- // Components bake sequentially on the control plane, so the default wait
940
- // budget is per component; otherwise a 2+ component deploy routinely hits
941
- // the client-side timeout while the server-side deploy is still fine. An
942
- // explicitly passed timeout always wins.
943
- const waitCtx =
944
- options.timeoutMs === undefined
945
- ? { ...ctx, timeoutMs: ctx.timeoutMs * targets.length }
946
- : ctx;
947
-
948
- return deployOneAgentsdk(waitCtx, undefined, {
953
+ return deployOneAgentsdk(ctx, undefined, {
949
954
  slug,
950
955
  gitRepoUrl,
951
956
  gitRef,
@@ -953,12 +958,14 @@ async function deployAgentsdkApplication(
953
958
  components,
954
959
  repositories: options.cursorEventsRepos,
955
960
  hasScmChannels: declarations.hasScmChannels,
961
+ declaredSecretNames: declarations.declaredSecretNames,
962
+ hasDeploymentsChannels: declarations.hasDeploymentsChannels,
956
963
  multiTenant: options.multiTenant === true,
957
964
  });
958
965
  }
959
966
 
960
967
  /**
961
- * `architecture: "v2"` deploy: POST `/internal/agentkit/deployments` and
968
+ * `architecture: "v2"` deploy: POST `/internal/agentsdk/deployments` and
962
969
  * poll the matching GET. The v2 accept path starts freeze bake; it does
963
970
  * not mint an engine alias or alias token.
964
971
  */
@@ -974,6 +981,10 @@ async function deployOneAgentsdk(
974
981
  repositories: string[] | undefined;
975
982
  /** Any component declares a GitHub/Origin channel. */
976
983
  hasScmChannels: boolean;
984
+ /** Union of application component secret declarations. */
985
+ declaredSecretNames?: string[];
986
+ /** Any component declares a deployments channel (same repo scope). */
987
+ hasDeploymentsChannels?: boolean;
977
988
  /** Redeploy an existing Cursor-managed product. */
978
989
  multiTenant: boolean;
979
990
  }
@@ -1048,6 +1059,9 @@ async function deployOneAgentsdk(
1048
1059
  );
1049
1060
  return 1;
1050
1061
  }
1062
+ warnMissingSecrets(ctx, slug, args.declaredSecretNames, detail.secretNames);
1063
+ const watchesRepositories =
1064
+ args.hasScmChannels || args.hasDeploymentsChannels === true;
1051
1065
  ctx.out(
1052
1066
  `Deployed ${slug} (team ${ctx.teamId})\n` +
1053
1067
  ` status: running\n` +
@@ -1059,15 +1073,16 @@ async function deployOneAgentsdk(
1059
1073
  : ` components: ${args.components
1060
1074
  .map((component) => component.componentKey)
1061
1075
  .join(", ")}\n`) +
1062
- (detail.repositories === undefined || !args.hasScmChannels
1076
+ (detail.repositories === undefined || !watchesRepositories
1063
1077
  ? ""
1064
1078
  : ` watching: ${detail.repositories.length === 0 ? "(nothing)" : detail.repositories.join(", ")}\n`)
1065
1079
  );
1066
- // An agent with GitHub/Origin channels bound to no repository scope gets
1067
- // no deliveries at all, which is otherwise invisible in this output.
1068
- if (args.hasScmChannels && detail.repositories?.length === 0) {
1080
+ // An agent with GitHub/Origin/deployments channels bound to no repository
1081
+ // scope gets no deliveries at all (deployments channels receive the
1082
+ // watched repos' deployment events), which is otherwise invisible here.
1083
+ if (watchesRepositories && detail.repositories?.length === 0) {
1069
1084
  ctx.err(
1070
- `warning: ${slug} watches no repositories, so its GitHub/Origin channels receive no events.\n` +
1085
+ `warning: ${slug} watches no repositories, so its GitHub/Origin/deployments channels receive no events.\n` +
1071
1086
  ` Redeploy with --cursor-events-repo <owner>/<name> to set the scope.\n`
1072
1087
  );
1073
1088
  }
@@ -1185,6 +1200,12 @@ interface DeployManifest {
1185
1200
  * while the deployment is bound to at least one `owner/name` scope.
1186
1201
  */
1187
1202
  hasScmChannels: boolean;
1203
+ /**
1204
+ * The agent has deployments channels; deploy-source edges derive from
1205
+ * the same watched-repo set as GitHub/Origin, so it too receives
1206
+ * nothing while the deployment watches no repositories.
1207
+ */
1208
+ hasDeploymentsChannels: boolean;
1188
1209
  }
1189
1210
 
1190
1211
  /**
@@ -1224,6 +1245,9 @@ async function readDeployManifest(dir: string): Promise<DeployManifest> {
1224
1245
  const kind = channel.definition.meta?.kind;
1225
1246
  return kind === "github" || kind === "origin";
1226
1247
  }),
1248
+ hasDeploymentsChannels: project.channels.some(
1249
+ (channel) => channel.definition.meta?.kind === "deployments"
1250
+ ),
1227
1251
  };
1228
1252
  }
1229
1253
 
@@ -1450,6 +1474,9 @@ function renderAgentkitDeploymentStatus(
1450
1474
  }`
1451
1475
  );
1452
1476
  }
1477
+ if (detail.secretNames !== undefined && detail.secretNames.length > 0) {
1478
+ lines.push(` secrets: ${detail.secretNames.join(", ")}`);
1479
+ }
1453
1480
  if (detail.lastError !== null && detail.lastError !== undefined) {
1454
1481
  lines.push(` last error: ${sanitizeCustomerError(detail.lastError)}`);
1455
1482
  }
@@ -1478,7 +1505,7 @@ export async function cmdStop(
1478
1505
  // deploy). The v2 agentsdk control plane goes first: v1 endpoints refuse
1479
1506
  // `architecture: "v2"` slugs with a 409 rather than a 404, so v1-first
1480
1507
  // could not fall through. A v2 404 (including an older backend without
1481
- // the `/internal/agentkit` mount) falls back to the v1 stop.
1508
+ // the `/internal/agentsdk` mount) falls back to the v1 stop.
1482
1509
  let architecture: "v1" | "v2" = "v2";
1483
1510
  let accepted: StopAccepted | AgentkitStopAccepted;
1484
1511
  try {
@@ -1650,6 +1677,21 @@ export async function cmdRotatePodCredential(
1650
1677
  // secrets set|list|unset
1651
1678
  // ============================================================================
1652
1679
 
1680
+ async function secretDeploymentArchitecture(
1681
+ ctx: DeployCliContext,
1682
+ slug: string
1683
+ ): Promise<"v1" | "v2"> {
1684
+ try {
1685
+ await ctx.client.getAgentkitDeploy({ teamId: ctx.teamId, slug });
1686
+ return "v2";
1687
+ } catch (error) {
1688
+ if (error instanceof DeployApiError && error.status === 404) {
1689
+ return "v1";
1690
+ }
1691
+ throw error;
1692
+ }
1693
+ }
1694
+
1653
1695
  export async function cmdSecretsSet(
1654
1696
  slug: string | undefined,
1655
1697
  specs: string[],
@@ -1712,11 +1754,19 @@ export async function cmdSecretsSet(
1712
1754
 
1713
1755
  let secretNames: string[];
1714
1756
  try {
1715
- secretNames = await ctx.client.setSecrets({
1716
- teamId: ctx.teamId,
1717
- slug,
1718
- secrets,
1719
- });
1757
+ const architecture = await secretDeploymentArchitecture(ctx, slug);
1758
+ secretNames =
1759
+ architecture === "v2"
1760
+ ? await ctx.client.setAgentkitSecrets({
1761
+ teamId: ctx.teamId,
1762
+ slug,
1763
+ secrets,
1764
+ })
1765
+ : await ctx.client.setSecrets({
1766
+ teamId: ctx.teamId,
1767
+ slug,
1768
+ secrets,
1769
+ });
1720
1770
  } catch (error) {
1721
1771
  return renderApiError(error, ctx.err);
1722
1772
  }
@@ -1748,7 +1798,11 @@ export async function cmdSecretsList(
1748
1798
  }
1749
1799
  let secrets: SecretInfo[];
1750
1800
  try {
1751
- secrets = await ctx.client.listSecrets({ teamId: ctx.teamId, slug });
1801
+ const architecture = await secretDeploymentArchitecture(ctx, slug);
1802
+ secrets =
1803
+ architecture === "v2"
1804
+ ? await ctx.client.listAgentkitSecrets({ teamId: ctx.teamId, slug })
1805
+ : await ctx.client.listSecrets({ teamId: ctx.teamId, slug });
1752
1806
  } catch (error) {
1753
1807
  return renderApiError(error, ctx.err);
1754
1808
  }
@@ -1787,7 +1841,16 @@ export async function cmdSecretsUnset(
1787
1841
  return ctx;
1788
1842
  }
1789
1843
  try {
1790
- await ctx.client.deleteSecret({ teamId: ctx.teamId, slug, name });
1844
+ const architecture = await secretDeploymentArchitecture(ctx, slug);
1845
+ if (architecture === "v2") {
1846
+ await ctx.client.deleteAgentkitSecret({
1847
+ teamId: ctx.teamId,
1848
+ slug,
1849
+ name,
1850
+ });
1851
+ } else {
1852
+ await ctx.client.deleteSecret({ teamId: ctx.teamId, slug, name });
1853
+ }
1791
1854
  } catch (error) {
1792
1855
  if (error instanceof DeployApiError && error.status === 404) {
1793
1856
  ctx.err(
@@ -119,7 +119,9 @@ export const BUILTINS: readonly ContinuationBuiltin[] = [
119
119
  {
120
120
  type: "deployment",
121
121
  kind: "deployments",
122
- events: ["deployment.created", "deployment.succeeded"],
122
+ // All three factory stream events carry `deploymentId`; keep in
123
+ // lockstep with the control plane's `conversation/deployments.ts`.
124
+ events: ["deployment.created", "deployment.succeeded", "deployment.failed"],
123
125
  format: "deployments:{deploymentId}",
124
126
  },
125
127
  ] as const;
@@ -383,18 +383,13 @@ export function selectConversationMirror(input: {
383
383
  return undefined;
384
384
  }
385
385
  const env = input.env ?? process.env;
386
- const frameworkStoreId = cursorFrameworkStoreSourceId(
387
- env as NodeJS.ProcessEnv
388
- );
389
- if (
390
- env[AGENT_SERVE_GENERATION_ENV_VAR] === undefined ||
391
- frameworkStoreId === undefined
392
- ) {
386
+ if (env[AGENT_SERVE_GENERATION_ENV_VAR] === undefined) {
393
387
  return undefined;
394
388
  }
389
+ const envSnapshot = env as NodeJS.ProcessEnv;
395
390
  return createConversationMirror({
396
391
  sink: cursorHostedFiles({
397
- storeSourceId: frameworkStoreId,
392
+ resolveStoreSourceId: () => cursorFrameworkStoreSourceId(envSnapshot),
398
393
  // Full chain (env → key file → stored login): frozen engines listen
399
394
  // unsigned and bind CURSOR_API_KEY_FILE at task time, after this sink
400
395
  // is constructed.
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Task-time application secrets for hosted v2 freeze restores.
3
+ *
4
+ * The deployment host rewrites this tmpfs document before each admission and
5
+ * execution request. July reloads it synchronously because the process was
6
+ * already running in the frozen snapshot when the task-specific values
7
+ * arrived.
8
+ */
9
+
10
+ import { readFileSync } from "node:fs";
11
+
12
+ export const DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE =
13
+ "/run/cursor/secrets/AGENT_SERVE_DEPLOYMENT_SECRETS.json";
14
+
15
+ const SECRET_NAME_PATTERN = /^[A-Z][A-Z0-9_]{0,63}$/;
16
+ const appliedSecretNames = new Set<string>();
17
+
18
+ function parseBoundSecrets(path: string): Record<string, string> | undefined {
19
+ let parsed: unknown;
20
+ try {
21
+ parsed = JSON.parse(readFileSync(path, "utf8"));
22
+ } catch {
23
+ return undefined;
24
+ }
25
+ if (parsed === null || typeof parsed !== "object") {
26
+ return undefined;
27
+ }
28
+ const envelope = parsed as { v?: unknown; secrets?: unknown };
29
+ if (
30
+ envelope.v !== 1 ||
31
+ envelope.secrets === null ||
32
+ typeof envelope.secrets !== "object" ||
33
+ Array.isArray(envelope.secrets)
34
+ ) {
35
+ return undefined;
36
+ }
37
+ const secrets: Record<string, string> = {};
38
+ for (const [name, value] of Object.entries(envelope.secrets)) {
39
+ if (
40
+ SECRET_NAME_PATTERN.test(name) &&
41
+ !name.startsWith("CURSOR_") &&
42
+ typeof value === "string"
43
+ ) {
44
+ secrets[name] = value;
45
+ }
46
+ }
47
+ return secrets;
48
+ }
49
+
50
+ /**
51
+ * Refresh `process.env` from the latest bound document. A missing or malformed
52
+ * file is a no-op; an empty valid document removes values loaded by an earlier
53
+ * bind after the deployment secret was unset.
54
+ */
55
+ export function refreshBoundDeploymentSecrets(
56
+ path: string = DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE
57
+ ): void {
58
+ const secrets = parseBoundSecrets(path);
59
+ if (secrets === undefined) {
60
+ return;
61
+ }
62
+ for (const name of appliedSecretNames) {
63
+ if (!(name in secrets)) {
64
+ delete process.env[name];
65
+ }
66
+ }
67
+ appliedSecretNames.clear();
68
+ for (const [name, value] of Object.entries(secrets)) {
69
+ process.env[name] = value;
70
+ appliedSecretNames.add(name);
71
+ }
72
+ }
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Task-time bind paths for hosted deployment file-store source ids.
3
+ *
4
+ * Freeze v2 snapshots start `agent-serve serve` at bake time without a service
5
+ * account, so neither store id is in process env. Execute-from-freeze binds
6
+ * the deployment credential and store ids into `/run/cursor/secrets/` without
7
+ * restarting July — the same pattern as {@link DEFAULT_CURSOR_API_KEY_FILE}.
8
+ */
9
+
10
+ import { readFileSync } from "node:fs";
11
+
12
+ export const DEFAULT_AGENT_SERVE_STORE_SOURCE_ID_FILE =
13
+ "/run/cursor/secrets/AGENT_SERVE_STORE_SOURCE_ID";
14
+
15
+ export const DEFAULT_AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID_FILE =
16
+ "/run/cursor/secrets/AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID";
17
+
18
+ const STORE_SOURCE_ID_ENV = "AGENT_SERVE_STORE_SOURCE_ID";
19
+ const FRAMEWORK_STORE_SOURCE_ID_ENV = "AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID";
20
+ const STORE_SOURCE_ID_FILE_ENV = "AGENT_SERVE_STORE_SOURCE_ID_FILE";
21
+ const FRAMEWORK_STORE_SOURCE_ID_FILE_ENV =
22
+ "AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID_FILE";
23
+
24
+ function readTrimmedFile(path: string): string | undefined {
25
+ try {
26
+ const raw = readFileSync(path, "utf8").trim();
27
+ return raw === "" ? undefined : raw;
28
+ } catch {
29
+ return undefined;
30
+ }
31
+ }
32
+
33
+ function readBoundSecretFile(
34
+ fileEnvVar: string,
35
+ defaultPath: string,
36
+ env: NodeJS.ProcessEnv
37
+ ): string | undefined {
38
+ const configured = env[fileEnvVar]?.trim();
39
+ const path =
40
+ configured !== undefined && configured !== "" ? configured : defaultPath;
41
+ return readTrimmedFile(path);
42
+ }
43
+
44
+ /** Deployment user-land store: env, then task-bind file. */
45
+ export function resolveDeploymentStoreSourceIdSync(
46
+ env: NodeJS.ProcessEnv = process.env
47
+ ): string | undefined {
48
+ const fromEnv = env[STORE_SOURCE_ID_ENV]?.trim();
49
+ if (fromEnv !== undefined && fromEnv !== "") {
50
+ return fromEnv;
51
+ }
52
+ return readBoundSecretFile(
53
+ STORE_SOURCE_ID_FILE_ENV,
54
+ DEFAULT_AGENT_SERVE_STORE_SOURCE_ID_FILE,
55
+ env
56
+ );
57
+ }
58
+
59
+ /** Engine framework store: env, then task-bind file. */
60
+ export function resolveFrameworkStoreSourceIdSync(
61
+ env: NodeJS.ProcessEnv = process.env
62
+ ): string | undefined {
63
+ const fromEnv = env[FRAMEWORK_STORE_SOURCE_ID_ENV]?.trim();
64
+ if (fromEnv !== undefined && fromEnv !== "") {
65
+ return fromEnv;
66
+ }
67
+ return readBoundSecretFile(
68
+ FRAMEWORK_STORE_SOURCE_ID_FILE_ENV,
69
+ DEFAULT_AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID_FILE,
70
+ env
71
+ );
72
+ }