@cursor/july 0.1.102 → 0.1.103

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (715) hide show
  1. package/AGENTS.md +34 -32
  2. package/README.md +10 -12
  3. package/dist/ab.d.ts +1 -1
  4. package/dist/ab.js +1 -1
  5. package/dist/bin/agent-serve.d.ts +12 -12
  6. package/dist/bin/agent-serve.js +114 -36
  7. package/dist/channels/bitbucket/api.d.ts +176 -0
  8. package/dist/channels/bitbucket/api.d.ts.map +1 -0
  9. package/dist/channels/bitbucket/api.js +419 -0
  10. package/dist/channels/bitbucket/binding.d.ts +71 -0
  11. package/dist/channels/bitbucket/binding.d.ts.map +1 -0
  12. package/dist/channels/bitbucket/binding.js +269 -0
  13. package/dist/channels/bitbucket/bitbucket-channel.d.ts +33 -0
  14. package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -0
  15. package/dist/channels/bitbucket/bitbucket-channel.js +120 -0
  16. package/dist/channels/bitbucket/bitbucket-webhook.d.ts +61 -0
  17. package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -0
  18. package/dist/channels/bitbucket/bitbucket-webhook.js +394 -0
  19. package/dist/channels/bitbucket/checks.d.ts +67 -0
  20. package/dist/channels/bitbucket/checks.d.ts.map +1 -0
  21. package/dist/channels/bitbucket/checks.js +102 -0
  22. package/dist/channels/bitbucket/cursor-account.d.ts +37 -0
  23. package/dist/channels/bitbucket/cursor-account.d.ts.map +1 -0
  24. package/dist/channels/bitbucket/cursor-account.js +65 -0
  25. package/dist/channels/bitbucket/defaults.d.ts +26 -0
  26. package/dist/channels/bitbucket/defaults.d.ts.map +1 -0
  27. package/dist/channels/bitbucket/defaults.js +73 -0
  28. package/dist/channels/bitbucket/events.d.ts +22 -0
  29. package/dist/channels/bitbucket/events.d.ts.map +1 -0
  30. package/dist/channels/bitbucket/events.js +64 -0
  31. package/dist/channels/bitbucket/index.d.ts +34 -0
  32. package/dist/channels/bitbucket/index.d.ts.map +1 -0
  33. package/dist/channels/bitbucket/index.js +33 -0
  34. package/dist/channels/bitbucket/replay.d.ts +63 -0
  35. package/dist/channels/bitbucket/replay.d.ts.map +1 -0
  36. package/dist/channels/bitbucket/replay.js +304 -0
  37. package/dist/channels/bitbucket/state.d.ts +35 -0
  38. package/dist/channels/bitbucket/state.d.ts.map +1 -0
  39. package/dist/channels/bitbucket/state.js +21 -0
  40. package/dist/channels/bitbucket/types.d.ts +229 -0
  41. package/dist/channels/bitbucket/types.d.ts.map +1 -0
  42. package/dist/channels/bitbucket/types.js +1 -0
  43. package/dist/channels/deployments/deployments-channel.d.ts +22 -14
  44. package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
  45. package/dist/channels/deployments/deployments-channel.js +25 -27
  46. package/dist/channels/deployments/types.d.ts +12 -6
  47. package/dist/channels/deployments/types.d.ts.map +1 -1
  48. package/dist/channels/github/binding.d.ts +6 -0
  49. package/dist/channels/github/binding.d.ts.map +1 -1
  50. package/dist/channels/github/binding.js +3 -3
  51. package/dist/channels/github/cursor-account.d.ts +7 -3
  52. package/dist/channels/github/cursor-account.d.ts.map +1 -1
  53. package/dist/channels/github/cursor-account.js +10 -6
  54. package/dist/channels/github/events.d.ts +1 -1
  55. package/dist/channels/github/events.js +1 -1
  56. package/dist/channels/github/forward.d.ts +1 -1
  57. package/dist/channels/github/forward.d.ts.map +1 -1
  58. package/dist/channels/github/forward.js +3 -2
  59. package/dist/channels/github/github-channel.d.ts +29 -39
  60. package/dist/channels/github/github-channel.d.ts.map +1 -1
  61. package/dist/channels/github/github-channel.js +68 -101
  62. package/dist/channels/github/replay.d.ts +1 -1
  63. package/dist/channels/github/replay.js +1 -1
  64. package/dist/channels/github/state.d.ts +2 -0
  65. package/dist/channels/github/state.d.ts.map +1 -1
  66. package/dist/channels/github/state.js +14 -11
  67. package/dist/channels/github/types.d.ts +2 -4
  68. package/dist/channels/github/types.d.ts.map +1 -1
  69. package/dist/channels/gitlab/api.d.ts +91 -0
  70. package/dist/channels/gitlab/api.d.ts.map +1 -0
  71. package/dist/channels/gitlab/api.js +150 -0
  72. package/dist/channels/gitlab/binding.d.ts +58 -0
  73. package/dist/channels/gitlab/binding.d.ts.map +1 -0
  74. package/dist/channels/gitlab/binding.js +139 -0
  75. package/dist/channels/gitlab/checks.d.ts +110 -0
  76. package/dist/channels/gitlab/checks.d.ts.map +1 -0
  77. package/dist/channels/gitlab/checks.js +126 -0
  78. package/dist/channels/gitlab/cursor-account.d.ts +36 -0
  79. package/dist/channels/gitlab/cursor-account.d.ts.map +1 -0
  80. package/dist/channels/gitlab/cursor-account.js +65 -0
  81. package/dist/channels/gitlab/defaults.d.ts +25 -0
  82. package/dist/channels/gitlab/defaults.d.ts.map +1 -0
  83. package/dist/channels/gitlab/defaults.js +60 -0
  84. package/dist/channels/gitlab/events.d.ts +12 -0
  85. package/dist/channels/gitlab/events.d.ts.map +1 -0
  86. package/dist/channels/gitlab/events.js +28 -0
  87. package/dist/channels/gitlab/gitlab-channel.d.ts +33 -0
  88. package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -0
  89. package/dist/channels/gitlab/gitlab-channel.js +120 -0
  90. package/dist/channels/gitlab/gitlab-webhook.d.ts +45 -0
  91. package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -0
  92. package/dist/channels/gitlab/gitlab-webhook.js +397 -0
  93. package/dist/channels/gitlab/index.d.ts +31 -0
  94. package/dist/channels/gitlab/index.d.ts.map +1 -0
  95. package/dist/channels/gitlab/index.js +30 -0
  96. package/dist/channels/gitlab/replay.d.ts +105 -0
  97. package/dist/channels/gitlab/replay.d.ts.map +1 -0
  98. package/dist/channels/gitlab/replay.js +206 -0
  99. package/dist/channels/gitlab/state.d.ts +33 -0
  100. package/dist/channels/gitlab/state.d.ts.map +1 -0
  101. package/dist/channels/gitlab/state.js +23 -0
  102. package/dist/channels/gitlab/types.d.ts +214 -0
  103. package/dist/channels/gitlab/types.d.ts.map +1 -0
  104. package/dist/channels/gitlab/types.js +1 -0
  105. package/dist/channels/origin/api.d.ts.map +1 -1
  106. package/dist/channels/origin/api.js +4 -2
  107. package/dist/channels/origin/origin-channel.d.ts +4 -9
  108. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  109. package/dist/channels/origin/origin-channel.js +8 -48
  110. package/dist/channels/origin/types.d.ts +20 -2
  111. package/dist/channels/origin/types.d.ts.map +1 -1
  112. package/dist/channels/slack/eval-directive.d.ts.map +1 -1
  113. package/dist/channels/slack/eval-directive.js +1 -7
  114. package/dist/channels/slack/init.d.ts.map +1 -1
  115. package/dist/channels/slack/init.js +3 -3
  116. package/dist/channels/slack/setup.d.ts +1 -1
  117. package/dist/channels/slack/setup.d.ts.map +1 -1
  118. package/dist/channels/slack/setup.js +6 -13
  119. package/dist/channels/slack/types.d.ts +1 -1
  120. package/dist/channels/slack/types.d.ts.map +1 -1
  121. package/dist/channels.d.ts +1 -1
  122. package/dist/channels.d.ts.map +1 -1
  123. package/dist/client.d.ts +1 -1
  124. package/dist/client.js +1 -1
  125. package/dist/connections.d.ts +1 -1
  126. package/dist/connections.js +1 -1
  127. package/dist/docs/404.html +2 -2
  128. package/dist/docs/ab.html +4 -4
  129. package/dist/docs/assets/{app.CLA03RCz.js → app.DW9pXkpL.js} +1 -1
  130. package/dist/docs/assets/chunks/@localSearchIndexroot.nrl1ifBq.js +1 -0
  131. package/dist/docs/assets/chunks/{VPLocalSearchBox.ifxv-cJV.js → VPLocalSearchBox.CdEIUwDg.js} +1 -1
  132. package/dist/docs/assets/chunks/{theme.DWCwM6p-.js → theme.YZMHgPgg.js} +2 -2
  133. package/dist/docs/assets/concepts.md.DgEcZOfT.js +1 -0
  134. package/dist/docs/assets/{concepts.md.rPzW2HZN.lean.js → concepts.md.DgEcZOfT.lean.js} +1 -1
  135. package/dist/docs/assets/{evals.md.CPzDAwoH.js → evals.md.CbMoebP1.js} +1 -1
  136. package/dist/docs/assets/guides_cloud-agents.md.DS8RIjwx.js +9 -0
  137. package/dist/docs/assets/{guides_github.md.BtPr9GaP.js → guides_github.md.DKYiT9do.js} +1 -1
  138. package/dist/docs/assets/{guides_opentelemetry.md.BVTXDCRg.js → guides_opentelemetry.md.COh9jFVg.js} +7 -8
  139. package/dist/docs/assets/{guides_opentelemetry.md.BVTXDCRg.lean.js → guides_opentelemetry.md.COh9jFVg.lean.js} +1 -1
  140. package/dist/docs/assets/{index.md.Kiht7ell.js → index.md.D75GWhPl.js} +1 -1
  141. package/dist/docs/assets/{reference_agent-config.md.BHeYMgme.js → reference_agent-config.md.CHNpiyp4.js} +3 -3
  142. package/dist/docs/assets/{reference_channels.md.Cd2f2iyV.js → reference_channels.md.Dz8Cnudp.js} +2 -2
  143. package/dist/docs/assets/{reference_channels.md.Cd2f2iyV.lean.js → reference_channels.md.Dz8Cnudp.lean.js} +1 -1
  144. package/dist/docs/assets/{reference_cli.md.DfoeyvL0.js → reference_cli.md.CJNc_xYK.js} +1 -1
  145. package/dist/docs/assets/{reference_extensions.md.9WQMZe1l.js → reference_extensions.md.DykHW3qL.js} +11 -5
  146. package/dist/docs/assets/reference_extensions.md.DykHW3qL.lean.js +1 -0
  147. package/dist/docs/assets/reference_hooks.md.Ddt5DdgJ.js +73 -0
  148. package/dist/docs/assets/{reference_hooks.md.a8BJxMR5.lean.js → reference_hooks.md.Ddt5DdgJ.lean.js} +1 -1
  149. package/dist/docs/assets/{reference_playground.md.DnX5nL-B.js → reference_playground.md.4myJPxrf.js} +1 -1
  150. package/dist/docs/assets/{reference_project-layout.md.CA6QP6Lw.js → reference_project-layout.md.DuBu9a96.js} +2 -2
  151. package/dist/docs/assets/reference_result.md.BK5SxDrf.js +19 -0
  152. package/dist/docs/assets/reference_result.md.BK5SxDrf.lean.js +1 -0
  153. package/dist/docs/assets/{reference_sessions.md.NxFP_CAC.js → reference_sessions.md.CueyOHSL.js} +1 -1
  154. package/dist/docs/assets/{reference_sessions.md.NxFP_CAC.lean.js → reference_sessions.md.CueyOHSL.lean.js} +1 -1
  155. package/dist/docs/assets/{reference_tools.md.B1up2r9W.js → reference_tools.md.aGrn99hP.js} +1 -1
  156. package/dist/docs/assets/skills_framework-map.md.haibFyoB.js +1 -0
  157. package/dist/docs/assets/{skills_otel.md.CgiZryR3.js → skills_otel.md.CqhobH3B.js} +3 -3
  158. package/dist/docs/assets/{skills_otel.md.CgiZryR3.lean.js → skills_otel.md.CqhobH3B.lean.js} +1 -1
  159. package/dist/docs/assets/{templates_pr-autofixer.md.x5zl6-GT.js → templates_pr-autofixer.md.Bds_XWcV.js} +2 -2
  160. package/dist/docs/assets/{templates_pr-autofixer.md.x5zl6-GT.lean.js → templates_pr-autofixer.md.Bds_XWcV.lean.js} +1 -1
  161. package/dist/docs/building-with-agents.html +4 -4
  162. package/dist/docs/concepts.html +5 -5
  163. package/dist/docs/concepts.md +2 -4
  164. package/dist/docs/deployment.html +4 -4
  165. package/dist/docs/design/runtime-abstraction.md +2 -3
  166. package/dist/docs/evals.html +6 -6
  167. package/dist/docs/evals.md +9 -7
  168. package/dist/docs/guides/agent-to-agent.html +4 -4
  169. package/dist/docs/guides/cloud-agents.html +6 -6
  170. package/dist/docs/guides/cloud-agents.md +4 -6
  171. package/dist/docs/guides/convert-automation.html +4 -4
  172. package/dist/docs/guides/github.html +6 -6
  173. package/dist/docs/guides/github.md +0 -1
  174. package/dist/docs/guides/human-in-the-loop.html +4 -4
  175. package/dist/docs/guides/mcp-oauth.html +5 -5
  176. package/dist/docs/guides/opentelemetry.html +10 -11
  177. package/dist/docs/guides/opentelemetry.md +41 -17
  178. package/dist/docs/guides/slack.html +4 -4
  179. package/dist/docs/guides/webhooks.html +4 -4
  180. package/dist/docs/hashmap.json +1 -1
  181. package/dist/docs/hillclimbing.html +4 -4
  182. package/dist/docs/index.html +6 -6
  183. package/dist/docs/index.md +2 -2
  184. package/dist/docs/llms-full.txt +501 -262
  185. package/dist/docs/llms.txt +2 -2
  186. package/dist/docs/quickstart.html +4 -4
  187. package/dist/docs/reference/agent-config.html +8 -8
  188. package/dist/docs/reference/agent-config.md +6 -10
  189. package/dist/docs/reference/artifacts.html +5 -5
  190. package/dist/docs/reference/channels.html +6 -6
  191. package/dist/docs/reference/channels.md +18 -8
  192. package/dist/docs/reference/cli.html +5 -5
  193. package/dist/docs/reference/cli.md +3 -4
  194. package/dist/docs/reference/connections.html +4 -4
  195. package/dist/docs/reference/extensions.html +16 -10
  196. package/dist/docs/reference/extensions.md +86 -22
  197. package/dist/docs/reference/hooks.html +69 -10
  198. package/dist/docs/reference/hooks.md +215 -46
  199. package/dist/docs/reference/http-api.html +4 -4
  200. package/dist/docs/reference/instructions.html +4 -4
  201. package/dist/docs/reference/playground.html +5 -5
  202. package/dist/docs/reference/playground.md +3 -0
  203. package/dist/docs/reference/project-layout.html +6 -6
  204. package/dist/docs/reference/project-layout.md +2 -1
  205. package/dist/docs/reference/prompt.html +4 -4
  206. package/dist/docs/reference/result.html +45 -0
  207. package/dist/docs/reference/result.md +89 -0
  208. package/dist/docs/reference/schedules.html +4 -4
  209. package/dist/docs/reference/sessions.html +5 -5
  210. package/dist/docs/reference/sessions.md +3 -1
  211. package/dist/docs/reference/skills.html +4 -4
  212. package/dist/docs/reference/subagents.html +4 -4
  213. package/dist/docs/reference/tools.html +5 -5
  214. package/dist/docs/reference/tools.md +1 -2
  215. package/dist/docs/scaffolding-agents.html +4 -4
  216. package/dist/docs/skills/ab.html +4 -4
  217. package/dist/docs/skills/create-agent.html +4 -4
  218. package/dist/docs/skills/debug.html +4 -4
  219. package/dist/docs/skills/evals.html +4 -4
  220. package/dist/docs/skills/framework-map.html +5 -5
  221. package/dist/docs/skills/framework-map.md +3 -1
  222. package/dist/docs/skills/github.html +4 -4
  223. package/dist/docs/skills/hillclimb.html +4 -4
  224. package/dist/docs/skills/index.html +4 -4
  225. package/dist/docs/skills/mcp-auth.html +4 -4
  226. package/dist/docs/skills/otel.html +7 -7
  227. package/dist/docs/skills/otel.md +8 -3
  228. package/dist/docs/skills/setup-slack.html +4 -4
  229. package/dist/docs/storage.html +4 -4
  230. package/dist/docs/templates/agentic-owners.html +4 -4
  231. package/dist/docs/templates/agents-md.html +4 -4
  232. package/dist/docs/templates/code-wiki.html +4 -4
  233. package/dist/docs/templates/demo.html +4 -4
  234. package/dist/docs/templates/pr-autofixer.html +6 -6
  235. package/dist/docs/templates/pr-autofixer.md +0 -3
  236. package/dist/docs/templates/security-help.html +4 -4
  237. package/dist/docs/templates/security-reviewer.html +4 -4
  238. package/dist/docs/templates/triage.html +4 -4
  239. package/dist/docs/troubleshooting.html +4 -4
  240. package/dist/evals.d.ts +1 -1
  241. package/dist/evals.d.ts.map +1 -1
  242. package/dist/extensions.d.ts +20 -7
  243. package/dist/extensions.d.ts.map +1 -1
  244. package/dist/extensions.js +36 -5
  245. package/dist/files.d.ts +16 -3
  246. package/dist/files.d.ts.map +1 -1
  247. package/dist/files.js +16 -3
  248. package/dist/index.d.ts +4 -4
  249. package/dist/index.d.ts.map +1 -1
  250. package/dist/index.js +3 -3
  251. package/dist/internal/ab-snapshot.d.ts.map +1 -1
  252. package/dist/internal/ab-snapshot.js +0 -1
  253. package/dist/internal/advertise-tools.d.ts.map +1 -1
  254. package/dist/internal/advertise-tools.js +1 -3
  255. package/dist/internal/authored-alias-hooks.d.ts +4 -13
  256. package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
  257. package/dist/internal/authored-alias-hooks.js +4 -20
  258. package/dist/internal/authored-loaders.d.ts +2 -3
  259. package/dist/internal/authored-loaders.d.ts.map +1 -1
  260. package/dist/internal/authored-loaders.js +6 -20
  261. package/dist/internal/channel-dispatch.d.ts +43 -0
  262. package/dist/internal/channel-dispatch.d.ts.map +1 -0
  263. package/dist/internal/channel-dispatch.js +77 -0
  264. package/dist/internal/chat-client.d.ts +1 -1
  265. package/dist/internal/chat-client.js +1 -1
  266. package/dist/internal/cli-ax.d.ts +5 -5
  267. package/dist/internal/cli-ax.d.ts.map +1 -1
  268. package/dist/internal/cli-ax.js +5 -5
  269. package/dist/internal/cli-bitbucket.d.ts +33 -0
  270. package/dist/internal/cli-bitbucket.d.ts.map +1 -0
  271. package/dist/internal/cli-bitbucket.js +359 -0
  272. package/dist/internal/cli-convert-automation.d.ts +1 -1
  273. package/dist/internal/cli-convert-automation.js +2 -2
  274. package/dist/internal/cli-cursor.d.ts +1 -1
  275. package/dist/internal/cli-cursor.d.ts.map +1 -1
  276. package/dist/internal/cli-cursor.js +2 -4
  277. package/dist/internal/cli-deploy.d.ts.map +1 -1
  278. package/dist/internal/cli-deploy.js +2 -6
  279. package/dist/internal/cli-github.d.ts +1 -1
  280. package/dist/internal/cli-github.js +3 -3
  281. package/dist/internal/cli-gitlab.d.ts +37 -0
  282. package/dist/internal/cli-gitlab.d.ts.map +1 -0
  283. package/dist/internal/cli-gitlab.js +380 -0
  284. package/dist/internal/cli-mcp.d.ts.map +1 -1
  285. package/dist/internal/cli-mcp.js +2 -6
  286. package/dist/internal/cli-slack.d.ts +1 -1
  287. package/dist/internal/cli-slack.d.ts.map +1 -1
  288. package/dist/internal/cli-slack.js +2 -4
  289. package/dist/internal/continuation-channel.d.ts +14 -0
  290. package/dist/internal/continuation-channel.d.ts.map +1 -1
  291. package/dist/internal/continuation-channel.js +56 -3
  292. package/dist/internal/continuation-identity.d.ts +14 -15
  293. package/dist/internal/continuation-identity.d.ts.map +1 -1
  294. package/dist/internal/continuation-identity.js +182 -7
  295. package/dist/internal/conversation-mirror.d.ts.map +1 -1
  296. package/dist/internal/conversation-mirror.js +4 -3
  297. package/dist/internal/convert-automation/types.d.ts +1 -1
  298. package/dist/internal/convert-automation/types.js +1 -1
  299. package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
  300. package/dist/internal/cursor/account-mcp.js +1 -3
  301. package/dist/internal/cursor/backend-client.d.ts +5 -4
  302. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  303. package/dist/internal/cursor/backend-client.js +5 -6
  304. package/dist/internal/cursor/bound-secret-file.d.ts +56 -0
  305. package/dist/internal/cursor/bound-secret-file.d.ts.map +1 -0
  306. package/dist/internal/cursor/bound-secret-file.js +88 -0
  307. package/dist/internal/cursor/credentials.d.ts +39 -5
  308. package/dist/internal/cursor/credentials.d.ts.map +1 -1
  309. package/dist/internal/cursor/credentials.js +58 -8
  310. package/dist/internal/cursor/hosted-bound-secrets.d.ts +41 -0
  311. package/dist/internal/cursor/hosted-bound-secrets.d.ts.map +1 -0
  312. package/dist/internal/cursor/hosted-bound-secrets.js +54 -0
  313. package/dist/internal/cursor/hosted-deployment-secrets.d.ts +19 -5
  314. package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -1
  315. package/dist/internal/cursor/hosted-deployment-secrets.js +29 -9
  316. package/dist/internal/cursor/hosted-store-secrets.d.ts +1 -1
  317. package/dist/internal/cursor/hosted-store-secrets.js +1 -1
  318. package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -1
  319. package/dist/internal/cursor-account-mcp-auth.js +2 -4
  320. package/dist/internal/cursor-deployment-relay.d.ts +6 -2
  321. package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
  322. package/dist/internal/cursor-deployment-relay.js +13 -9
  323. package/dist/internal/deploy-manifest.d.ts +1 -1
  324. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  325. package/dist/internal/deploy-manifest.js +1 -1
  326. package/dist/internal/discovery/ab.d.ts +1 -1
  327. package/dist/internal/discovery/ab.d.ts.map +1 -1
  328. package/dist/internal/discovery/ab.js +21 -9
  329. package/dist/internal/discovery/agent.d.ts +6 -1
  330. package/dist/internal/discovery/agent.d.ts.map +1 -1
  331. package/dist/internal/discovery/agent.js +65 -116
  332. package/dist/internal/discovery/channels.d.ts +1 -1
  333. package/dist/internal/discovery/channels.d.ts.map +1 -1
  334. package/dist/internal/discovery/channels.js +14 -14
  335. package/dist/internal/discovery/connections.d.ts +1 -5
  336. package/dist/internal/discovery/connections.d.ts.map +1 -1
  337. package/dist/internal/discovery/connections.js +30 -44
  338. package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -1
  339. package/dist/internal/discovery/cursor-plugin.js +1 -3
  340. package/dist/internal/discovery/extension-overlay.d.ts +32 -0
  341. package/dist/internal/discovery/extension-overlay.d.ts.map +1 -0
  342. package/dist/internal/discovery/extension-overlay.js +191 -0
  343. package/dist/internal/discovery/extensions.d.ts +11 -2
  344. package/dist/internal/discovery/extensions.d.ts.map +1 -1
  345. package/dist/internal/discovery/extensions.js +211 -74
  346. package/dist/internal/discovery/hooks.d.ts +1 -1
  347. package/dist/internal/discovery/hooks.d.ts.map +1 -1
  348. package/dist/internal/discovery/hooks.js +15 -2
  349. package/dist/internal/discovery/info.d.ts.map +1 -1
  350. package/dist/internal/discovery/info.js +7 -1
  351. package/dist/internal/discovery/modules.d.ts.map +1 -1
  352. package/dist/internal/discovery/modules.js +8 -2
  353. package/dist/internal/discovery/names.d.ts +1 -1
  354. package/dist/internal/discovery/names.d.ts.map +1 -1
  355. package/dist/internal/discovery/names.js +1 -0
  356. package/dist/internal/discovery/project.d.ts +0 -2
  357. package/dist/internal/discovery/project.d.ts.map +1 -1
  358. package/dist/internal/discovery/project.js +64 -10
  359. package/dist/internal/discovery/runtime.d.ts.map +1 -1
  360. package/dist/internal/discovery/runtime.js +1 -2
  361. package/dist/internal/discovery/schedules.d.ts +1 -1
  362. package/dist/internal/discovery/schedules.d.ts.map +1 -1
  363. package/dist/internal/discovery/schedules.js +23 -2
  364. package/dist/internal/discovery/services.d.ts +6 -2
  365. package/dist/internal/discovery/services.d.ts.map +1 -1
  366. package/dist/internal/discovery/services.js +31 -1
  367. package/dist/internal/discovery/skills.d.ts +1 -6
  368. package/dist/internal/discovery/skills.d.ts.map +1 -1
  369. package/dist/internal/discovery/skills.js +8 -3
  370. package/dist/internal/discovery/subagent.d.ts +3 -0
  371. package/dist/internal/discovery/subagent.d.ts.map +1 -1
  372. package/dist/internal/discovery/subagent.js +109 -0
  373. package/dist/internal/discovery.d.ts +1 -2
  374. package/dist/internal/discovery.d.ts.map +1 -1
  375. package/dist/internal/discovery.js +1 -2
  376. package/dist/internal/distribution.d.ts +10 -27
  377. package/dist/internal/distribution.d.ts.map +1 -1
  378. package/dist/internal/distribution.js +25 -73
  379. package/dist/internal/docs-site.js +1 -1
  380. package/dist/internal/eval-run-store.d.ts +0 -1
  381. package/dist/internal/eval-run-store.d.ts.map +1 -1
  382. package/dist/internal/eval-runner.d.ts.map +1 -1
  383. package/dist/internal/framework-file-storage.d.ts +8 -0
  384. package/dist/internal/framework-file-storage.d.ts.map +1 -1
  385. package/dist/internal/framework-file-storage.js +8 -8
  386. package/dist/internal/github-fanout.d.ts +1 -1
  387. package/dist/internal/github-fanout.js +1 -1
  388. package/dist/internal/guest-network.d.ts +101 -0
  389. package/dist/internal/guest-network.d.ts.map +1 -0
  390. package/dist/internal/guest-network.js +304 -0
  391. package/dist/internal/host-otel.d.ts +3 -3
  392. package/dist/internal/host-otel.d.ts.map +1 -1
  393. package/dist/internal/host-otel.js +8 -4
  394. package/dist/internal/hosted-admission-adapter.d.ts +8 -7
  395. package/dist/internal/hosted-admission-adapter.d.ts.map +1 -1
  396. package/dist/internal/hosted-delivery-protocol.d.ts +6 -0
  397. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  398. package/dist/internal/hosted-delivery-protocol.js +18 -5
  399. package/dist/internal/hosted-delivery.d.ts +18 -0
  400. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  401. package/dist/internal/hosted-delivery.js +248 -118
  402. package/dist/internal/http-channel.d.ts.map +1 -1
  403. package/dist/internal/http-channel.js +1 -3
  404. package/dist/internal/init-interview.d.ts.map +1 -1
  405. package/dist/internal/init-interview.js +1 -3
  406. package/dist/internal/init-project.d.ts +2 -2
  407. package/dist/internal/init-project.js +2 -2
  408. package/dist/internal/inline-stdio-define-stub.d.ts +1 -1
  409. package/dist/internal/inline-stdio-define-stub.d.ts.map +1 -1
  410. package/dist/internal/inline-stdio-define-stub.js +1 -1
  411. package/dist/internal/is-record.d.ts +2 -0
  412. package/dist/internal/is-record.d.ts.map +1 -0
  413. package/dist/internal/is-record.js +3 -0
  414. package/dist/internal/json-schema.d.ts.map +1 -1
  415. package/dist/internal/json-schema.js +18 -10
  416. package/dist/internal/local-control-plane.d.ts +1 -2
  417. package/dist/internal/local-control-plane.d.ts.map +1 -1
  418. package/dist/internal/local-control-plane.js +3 -20
  419. package/dist/internal/mcp-endpoint.d.ts.map +1 -1
  420. package/dist/internal/mcp-endpoint.js +1 -3
  421. package/dist/internal/otel/collector.d.ts +12 -3
  422. package/dist/internal/otel/collector.d.ts.map +1 -1
  423. package/dist/internal/otel/collector.js +77 -125
  424. package/dist/internal/otel/config.d.ts +0 -2
  425. package/dist/internal/otel/config.d.ts.map +1 -1
  426. package/dist/internal/otel/config.js +17 -20
  427. package/dist/internal/otel/http.d.ts +2 -0
  428. package/dist/internal/otel/http.d.ts.map +1 -1
  429. package/dist/internal/otel/http.js +7 -1
  430. package/dist/internal/otel/mcp.d.ts.map +1 -1
  431. package/dist/internal/otel/mcp.js +3 -16
  432. package/dist/internal/otel/runtime.d.ts +26 -1
  433. package/dist/internal/otel/runtime.d.ts.map +1 -1
  434. package/dist/internal/otel/runtime.js +164 -15
  435. package/dist/internal/package-inline-stdio.d.ts.map +1 -1
  436. package/dist/internal/package-inline-stdio.js +3 -11
  437. package/dist/internal/playground/toolchain.d.ts +1 -1
  438. package/dist/internal/playground/toolchain.d.ts.map +1 -1
  439. package/dist/internal/playground/toolchain.js +1 -1
  440. package/dist/internal/request-error-status.d.ts +12 -0
  441. package/dist/internal/request-error-status.d.ts.map +1 -0
  442. package/dist/internal/request-error-status.js +52 -0
  443. package/dist/internal/resolve-prod-target.d.ts +1 -1
  444. package/dist/internal/resolve-prod-target.d.ts.map +1 -1
  445. package/dist/internal/resolve-prod-target.js +3 -7
  446. package/dist/internal/result-output.d.ts +18 -0
  447. package/dist/internal/result-output.d.ts.map +1 -0
  448. package/dist/internal/result-output.js +33 -0
  449. package/dist/internal/run-client.d.ts +2 -2
  450. package/dist/internal/run-client.js +2 -2
  451. package/dist/internal/runtime-dispatch-runner.d.ts +1 -11
  452. package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -1
  453. package/dist/internal/runtime-dispatch-runner.js +2 -15
  454. package/dist/internal/sdk-runner.d.ts.map +1 -1
  455. package/dist/internal/sdk-runner.js +3 -6
  456. package/dist/internal/server.d.ts.map +1 -1
  457. package/dist/internal/server.js +110 -35
  458. package/dist/internal/session-cost.d.ts +3 -3
  459. package/dist/internal/session-cost.d.ts.map +1 -1
  460. package/dist/internal/session-cost.js +3 -3
  461. package/dist/internal/session-engine.d.ts +26 -11
  462. package/dist/internal/session-engine.d.ts.map +1 -1
  463. package/dist/internal/session-engine.js +146 -76
  464. package/dist/internal/session-run-log.d.ts.map +1 -1
  465. package/dist/internal/session-run-log.js +1 -3
  466. package/dist/internal/skills-sync.d.ts +1 -4
  467. package/dist/internal/skills-sync.d.ts.map +1 -1
  468. package/dist/internal/skills-sync.js +10 -50
  469. package/dist/internal/sleep.d.ts +2 -0
  470. package/dist/internal/sleep.d.ts.map +1 -0
  471. package/dist/internal/sleep.js +3 -0
  472. package/dist/internal/store-mirror.d.ts +29 -0
  473. package/dist/internal/store-mirror.d.ts.map +1 -0
  474. package/dist/internal/store-mirror.js +70 -0
  475. package/dist/internal/tenant-slack/relay.d.ts +73 -0
  476. package/dist/internal/tenant-slack/relay.d.ts.map +1 -0
  477. package/dist/internal/tenant-slack/relay.js +138 -0
  478. package/dist/internal/testing/scm-continuation-fixtures.d.ts +33 -0
  479. package/dist/internal/testing/scm-continuation-fixtures.d.ts.map +1 -0
  480. package/dist/internal/testing/scm-continuation-fixtures.js +253 -0
  481. package/dist/internal/workspace-sync.d.ts +22 -0
  482. package/dist/internal/workspace-sync.d.ts.map +1 -0
  483. package/dist/internal/workspace-sync.js +49 -0
  484. package/dist/internal/workspace.d.ts +7 -0
  485. package/dist/internal/workspace.d.ts.map +1 -1
  486. package/dist/internal/workspace.js +13 -0
  487. package/dist/otel.d.ts +23 -1
  488. package/dist/otel.d.ts.map +1 -1
  489. package/dist/otel.js +93 -2
  490. package/dist/playground/assets/index-59KvgREd.js +67 -0
  491. package/dist/playground/assets/index-MbMxXg-y.css +1 -0
  492. package/dist/playground/index.html +2 -2
  493. package/dist/result.d.ts +24 -0
  494. package/dist/result.d.ts.map +1 -0
  495. package/dist/result.js +27 -0
  496. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  497. package/dist/storage-backends/cursor-hosted.js +7 -4
  498. package/dist/storage-protocol.d.ts.map +1 -1
  499. package/dist/storage-protocol.js +1 -3
  500. package/dist/types.d.ts +90 -23
  501. package/dist/types.d.ts.map +1 -1
  502. package/docs/README.md +2 -2
  503. package/docs/concepts.md +2 -4
  504. package/docs/design/runtime-abstraction.md +2 -3
  505. package/docs/evals.md +9 -7
  506. package/docs/guides/cloud-agents.md +4 -6
  507. package/docs/guides/github.md +0 -1
  508. package/docs/guides/opentelemetry.md +41 -17
  509. package/docs/reference/agent-config.md +6 -10
  510. package/docs/reference/channels.md +18 -8
  511. package/docs/reference/cli.md +3 -4
  512. package/docs/reference/extensions.md +87 -23
  513. package/docs/reference/hooks.md +215 -46
  514. package/docs/reference/playground.md +3 -0
  515. package/docs/reference/project-layout.md +2 -1
  516. package/docs/reference/result.md +94 -0
  517. package/docs/reference/sessions.md +3 -1
  518. package/docs/reference/tools.md +1 -2
  519. package/docs/templates/pr-autofixer.md +0 -3
  520. package/package.json +29 -10
  521. package/skills/framework-map/SKILL.md +3 -1
  522. package/skills/otel/SKILL.md +8 -3
  523. package/src/ab.ts +1 -1
  524. package/src/bin/agent-serve.ts +121 -21
  525. package/src/channels/bitbucket/api.ts +623 -0
  526. package/src/channels/bitbucket/binding.ts +414 -0
  527. package/src/channels/bitbucket/bitbucket-channel.ts +182 -0
  528. package/src/channels/bitbucket/bitbucket-webhook.ts +576 -0
  529. package/src/channels/bitbucket/checks.ts +154 -0
  530. package/src/channels/bitbucket/cursor-account.ts +117 -0
  531. package/src/channels/bitbucket/defaults.ts +110 -0
  532. package/src/channels/bitbucket/events.ts +84 -0
  533. package/src/channels/bitbucket/index.ts +49 -0
  534. package/src/channels/bitbucket/replay.ts +439 -0
  535. package/src/channels/bitbucket/state.ts +59 -0
  536. package/src/channels/bitbucket/types.ts +266 -0
  537. package/src/channels/deployments/deployments-channel.ts +25 -43
  538. package/src/channels/deployments/types.ts +12 -6
  539. package/src/channels/github/binding.ts +8 -1
  540. package/src/channels/github/cursor-account.ts +17 -6
  541. package/src/channels/github/events.ts +1 -1
  542. package/src/channels/github/forward.ts +3 -2
  543. package/src/channels/github/github-channel.ts +74 -221
  544. package/src/channels/github/replay.ts +1 -1
  545. package/src/channels/github/state.ts +6 -0
  546. package/src/channels/github/types.ts +2 -5
  547. package/src/channels/gitlab/api.ts +228 -0
  548. package/src/channels/gitlab/binding.ts +233 -0
  549. package/src/channels/gitlab/checks.ts +243 -0
  550. package/src/channels/gitlab/cursor-account.ts +114 -0
  551. package/src/channels/gitlab/defaults.ts +93 -0
  552. package/src/channels/gitlab/events.ts +44 -0
  553. package/src/channels/gitlab/gitlab-channel.ts +176 -0
  554. package/src/channels/gitlab/gitlab-webhook.ts +555 -0
  555. package/src/channels/gitlab/index.ts +43 -0
  556. package/src/channels/gitlab/replay.ts +347 -0
  557. package/src/channels/gitlab/state.ts +55 -0
  558. package/src/channels/gitlab/types.ts +263 -0
  559. package/src/channels/origin/api.ts +4 -2
  560. package/src/channels/origin/origin-channel.ts +19 -94
  561. package/src/channels/origin/types.ts +23 -2
  562. package/src/channels/slack/eval-directive.ts +1 -6
  563. package/src/channels/slack/init.ts +6 -3
  564. package/src/channels/slack/setup.ts +7 -6
  565. package/src/channels/slack/types.ts +1 -1
  566. package/src/channels.ts +0 -1
  567. package/src/client.ts +1 -1
  568. package/src/connections.ts +1 -1
  569. package/src/evals.ts +1 -1
  570. package/src/extensions.ts +47 -5
  571. package/src/files.ts +21 -3
  572. package/src/index.ts +20 -28
  573. package/src/internal/ab-snapshot.ts +0 -3
  574. package/src/internal/advertise-tools.ts +1 -4
  575. package/src/internal/authored-alias-hooks.ts +4 -21
  576. package/src/internal/authored-loaders.ts +6 -23
  577. package/src/internal/channel-dispatch.ts +160 -0
  578. package/src/internal/chat-client.ts +1 -1
  579. package/src/internal/cli-ax.ts +5 -5
  580. package/src/internal/cli-bitbucket.ts +477 -0
  581. package/src/internal/cli-convert-automation.ts +7 -7
  582. package/src/internal/cli-cursor.ts +2 -5
  583. package/src/internal/cli-deploy.ts +2 -8
  584. package/src/internal/cli-github.ts +3 -3
  585. package/src/internal/cli-gitlab.ts +485 -0
  586. package/src/internal/cli-mcp.ts +2 -7
  587. package/src/internal/cli-slack.ts +2 -5
  588. package/src/internal/continuation-channel.ts +82 -1
  589. package/src/internal/continuation-identity.ts +229 -11
  590. package/src/internal/conversation-mirror.ts +4 -3
  591. package/src/internal/convert-automation/types.ts +1 -1
  592. package/src/internal/cursor/account-mcp.ts +1 -4
  593. package/src/internal/cursor/backend-client.ts +9 -10
  594. package/src/internal/cursor/bound-secret-file.ts +108 -0
  595. package/src/internal/cursor/credentials.ts +75 -10
  596. package/src/internal/cursor/hosted-bound-secrets.ts +75 -0
  597. package/src/internal/cursor/hosted-deployment-secrets.ts +42 -11
  598. package/src/internal/cursor/hosted-store-secrets.ts +1 -1
  599. package/src/internal/cursor-account-mcp-auth.ts +2 -5
  600. package/src/internal/cursor-deployment-relay.ts +11 -7
  601. package/src/internal/deploy-manifest.ts +4 -2
  602. package/src/internal/discovery/ab.ts +29 -9
  603. package/src/internal/discovery/agent.ts +94 -135
  604. package/src/internal/discovery/channels.ts +15 -13
  605. package/src/internal/discovery/connections.ts +55 -50
  606. package/src/internal/discovery/cursor-plugin.ts +1 -4
  607. package/src/internal/discovery/extension-overlay.ts +274 -0
  608. package/src/internal/discovery/extensions.ts +330 -105
  609. package/src/internal/discovery/hooks.ts +20 -2
  610. package/src/internal/discovery/info.ts +7 -0
  611. package/src/internal/discovery/modules.ts +8 -2
  612. package/src/internal/discovery/names.ts +2 -1
  613. package/src/internal/discovery/project.ts +80 -9
  614. package/src/internal/discovery/runtime.ts +1 -2
  615. package/src/internal/discovery/schedules.ts +28 -2
  616. package/src/internal/discovery/services.ts +37 -1
  617. package/src/internal/discovery/skills.ts +13 -3
  618. package/src/internal/discovery/subagent.ts +107 -0
  619. package/src/internal/discovery.ts +0 -2
  620. package/src/internal/distribution.ts +35 -83
  621. package/src/internal/docs-site.ts +1 -1
  622. package/src/internal/eval-run-store.ts +0 -7
  623. package/src/internal/eval-runner.ts +0 -1
  624. package/src/internal/framework-file-storage.ts +8 -8
  625. package/src/internal/github-fanout.ts +1 -1
  626. package/src/internal/guest-network.ts +383 -0
  627. package/src/internal/host-otel.ts +8 -4
  628. package/src/internal/hosted-admission-adapter.ts +8 -8
  629. package/src/internal/hosted-delivery-protocol.ts +26 -1
  630. package/src/internal/hosted-delivery.ts +376 -192
  631. package/src/internal/http-channel.ts +1 -4
  632. package/src/internal/init-interview.ts +1 -4
  633. package/src/internal/init-project.ts +2 -2
  634. package/src/internal/inline-stdio-define-stub.ts +1 -1
  635. package/src/internal/is-record.ts +3 -0
  636. package/src/internal/json-schema.ts +19 -10
  637. package/src/internal/local-control-plane.ts +5 -24
  638. package/src/internal/mcp-endpoint.ts +1 -4
  639. package/src/internal/otel/collector.ts +94 -159
  640. package/src/internal/otel/config.ts +10 -14
  641. package/src/internal/otel/http.ts +14 -1
  642. package/src/internal/otel/mcp.ts +3 -16
  643. package/src/internal/otel/runtime.ts +240 -25
  644. package/src/internal/package-inline-stdio.ts +3 -12
  645. package/src/internal/playground/toolchain.ts +1 -1
  646. package/src/internal/request-error-status.ts +72 -0
  647. package/src/internal/resolve-prod-target.ts +3 -8
  648. package/src/internal/result-output.ts +34 -0
  649. package/src/internal/run-client.ts +2 -2
  650. package/src/internal/runtime-dispatch-runner.ts +3 -21
  651. package/src/internal/sdk-runner.ts +3 -7
  652. package/src/internal/server.ts +153 -44
  653. package/src/internal/session-cost.ts +3 -3
  654. package/src/internal/session-engine.ts +182 -74
  655. package/src/internal/session-run-log.ts +1 -4
  656. package/src/internal/skills-sync.ts +13 -63
  657. package/src/internal/sleep.ts +3 -0
  658. package/src/internal/store-mirror.ts +86 -0
  659. package/src/internal/tenant-slack/relay.ts +179 -0
  660. package/src/internal/testing/scm-continuation-fixtures.ts +286 -0
  661. package/src/internal/workspace-sync.ts +55 -0
  662. package/src/internal/workspace.ts +14 -0
  663. package/src/otel.ts +143 -3
  664. package/src/result.ts +36 -0
  665. package/src/storage-backends/cursor-hosted.ts +7 -4
  666. package/src/storage-protocol.ts +1 -4
  667. package/src/types.ts +105 -34
  668. package/templates/triage/agent/lib/types.ts +0 -2
  669. package/dist/continuation.d.ts +0 -20
  670. package/dist/continuation.d.ts.map +0 -1
  671. package/dist/continuation.js +0 -18
  672. package/dist/docs/assets/chunks/@localSearchIndexroot.FAqdWIXo.js +0 -1
  673. package/dist/docs/assets/concepts.md.rPzW2HZN.js +0 -1
  674. package/dist/docs/assets/guides_cloud-agents.md.DumwWXba.js +0 -9
  675. package/dist/docs/assets/guides_cloud-runtime.md.BRirbRAN.js +0 -9
  676. package/dist/docs/assets/guides_cloud-runtime.md.BRirbRAN.lean.js +0 -1
  677. package/dist/docs/assets/reference_extensions.md.9WQMZe1l.lean.js +0 -1
  678. package/dist/docs/assets/reference_hooks.md.a8BJxMR5.js +0 -14
  679. package/dist/docs/assets/skills_framework-map.md.DDa4MeEW.js +0 -1
  680. package/dist/docs/guides/cloud-runtime.html +0 -35
  681. package/dist/docs/guides/cloud-runtime.md +0 -117
  682. package/dist/internal/convert-automation/index.d.ts +0 -3
  683. package/dist/internal/convert-automation/index.d.ts.map +0 -1
  684. package/dist/internal/convert-automation/index.js +0 -1
  685. package/dist/internal/grokbot/runner.d.ts +0 -64
  686. package/dist/internal/grokbot/runner.d.ts.map +0 -1
  687. package/dist/internal/grokbot/runner.js +0 -282
  688. package/dist/internal/managed-delivery.d.ts +0 -80
  689. package/dist/internal/managed-delivery.d.ts.map +0 -1
  690. package/dist/internal/managed-delivery.js +0 -86
  691. package/dist/internal/review-comments.d.ts +0 -370
  692. package/dist/internal/review-comments.d.ts.map +0 -1
  693. package/dist/internal/review-comments.js +0 -921
  694. package/dist/internal/shallow-clone.d.ts +0 -176
  695. package/dist/internal/shallow-clone.d.ts.map +0 -1
  696. package/dist/internal/shallow-clone.js +0 -419
  697. package/dist/playground/assets/index-B6C9S9nG.css +0 -1
  698. package/dist/playground/assets/index-ZqNoT8Ie.js +0 -69
  699. package/docs/guides/cloud-runtime.md +0 -122
  700. package/src/continuation.ts +0 -49
  701. package/src/internal/convert-automation/index.ts +0 -10
  702. package/src/internal/grokbot/runner.ts +0 -370
  703. package/src/internal/managed-delivery.ts +0 -125
  704. package/src/internal/review-comments.ts +0 -1363
  705. package/src/internal/shallow-clone.ts +0 -609
  706. /package/dist/docs/assets/{evals.md.CPzDAwoH.lean.js → evals.md.CbMoebP1.lean.js} +0 -0
  707. /package/dist/docs/assets/{guides_cloud-agents.md.DumwWXba.lean.js → guides_cloud-agents.md.DS8RIjwx.lean.js} +0 -0
  708. /package/dist/docs/assets/{guides_github.md.BtPr9GaP.lean.js → guides_github.md.DKYiT9do.lean.js} +0 -0
  709. /package/dist/docs/assets/{index.md.Kiht7ell.lean.js → index.md.D75GWhPl.lean.js} +0 -0
  710. /package/dist/docs/assets/{reference_agent-config.md.BHeYMgme.lean.js → reference_agent-config.md.CHNpiyp4.lean.js} +0 -0
  711. /package/dist/docs/assets/{reference_cli.md.DfoeyvL0.lean.js → reference_cli.md.CJNc_xYK.lean.js} +0 -0
  712. /package/dist/docs/assets/{reference_playground.md.DnX5nL-B.lean.js → reference_playground.md.4myJPxrf.lean.js} +0 -0
  713. /package/dist/docs/assets/{reference_project-layout.md.CA6QP6Lw.lean.js → reference_project-layout.md.DuBu9a96.lean.js} +0 -0
  714. /package/dist/docs/assets/{reference_tools.md.B1up2r9W.lean.js → reference_tools.md.aGrn99hP.lean.js} +0 -0
  715. /package/dist/docs/assets/{skills_framework-map.md.DDa4MeEW.lean.js → skills_framework-map.md.haibFyoB.lean.js} +0 -0
@@ -4,13 +4,16 @@
4
4
  * Exactly one kind of secret exists at runtime: a **personal Cursor user API
5
5
  * key**. Two ways to obtain it, one code path after that:
6
6
  *
7
- * - `agent-serve login` runs the same PKCE browser flow as `cursor-agent`
7
+ * - `agent-sdk login` runs the same PKCE browser flow as `cursor-agent`
8
8
  * and Sand, then uses the short-lived session once to mint a named,
9
9
  * dashboard-revocable user API key — only the key is stored.
10
10
  * - `CURSOR_API_KEY` (or `serve({ apiKey })`) wins over the stored key, so
11
11
  * CI and hosted deployments stay env-driven.
12
12
  * - `CURSOR_API_KEY_FILE` (or the hosted default path) is next: freeze bind
13
- * drops the key at task time without restarting July.
13
+ * drops the key at task time without restarting July. On the hosted path
14
+ * that file is consumed into `CURSOR_API_KEY` and destroyed before
15
+ * anything authored runs, so this fallback is there for local,
16
+ * self-hosted, and the unsigned window before the first bind.
14
17
  * - Stored `july login` is last. Same order for hosted and self-hosted:
15
18
  * option → env → file → login.
16
19
  *
@@ -19,6 +22,7 @@
19
22
  * on demand from the API key (see `backend-client.ts`).
20
23
  */
21
24
  import { z } from "zod";
25
+ import { type BoundSecretFileDisposal } from "./bound-secret-file.js";
22
26
  export declare const DEFAULT_CURSOR_BACKEND_URL = "https://api2.cursor.sh";
23
27
  export declare const DEFAULT_CURSOR_EXTERNAL_API_URL = "https://api.cursor.com";
24
28
  /**
@@ -65,9 +69,11 @@ export interface ResolvedApiKey {
65
69
  }
66
70
  /**
67
71
  * Hosted task-bind path. Not a secret: the snapshot may name this path.
68
- * The binder writes the key here after restore; July re-reads on each use.
69
- * Override with `CURSOR_API_KEY_FILE`. A missing file is unsigned — self-hosted
70
- * then uses `CURSOR_API_KEY` or stored login.
72
+ * The binder writes the key here after restore, and hosted admission /
73
+ * execution consume it into `process.env.CURSOR_API_KEY` and destroy the
74
+ * file before authored work this is an IPC handoff, not a credential
75
+ * source July keeps reading. Override with `CURSOR_API_KEY_FILE`. A missing
76
+ * file is unsigned — self-hosted then uses `CURSOR_API_KEY` or stored login.
71
77
  */
72
78
  export declare const DEFAULT_CURSOR_API_KEY_FILE: string;
73
79
  /**
@@ -76,7 +82,35 @@ export declare const DEFAULT_CURSOR_API_KEY_FILE: string;
76
82
  * listens before the binder drops the key; self-hosted falls through to
77
83
  * env or login.
78
84
  */
85
+ export declare function resolveCursorApiKeyFilePath(filePath?: string, env?: NodeJS.ProcessEnv): string;
79
86
  export declare function readApiKeyFromFile(filePath?: string): string | undefined;
87
+ export type BoundCursorApiKeyConsumeResult = {
88
+ /** The file supplied `CURSOR_API_KEY` on this call. */
89
+ applied: boolean;
90
+ disposal: BoundSecretFileDisposal;
91
+ };
92
+ /**
93
+ * Copy the task-bind key file into `process.env.CURSOR_API_KEY`, then destroy
94
+ * the file.
95
+ *
96
+ * Hosted v2 cannot set another process's environment from the binder, so it
97
+ * drops a tmpfs file. Teaching every reader to open that file misses authored
98
+ * `process.env.CURSOR_API_KEY` and leaves a secret on disk. Hosted admission /
99
+ * execution call this once per request, next to the deployment-secrets
100
+ * consume: after it returns, env-only readers work and the key is no longer
101
+ * recoverable from disk. The control plane re-binds before the next request.
102
+ *
103
+ * The env write always happens before the destroy, never the other way round.
104
+ * An already-set `CURSOR_API_KEY` is not overwritten, but the file is still
105
+ * destroyed — env is the source, the file is only the handoff.
106
+ *
107
+ * A `readable` disposal means the secret survived; callers on the hosted path
108
+ * must fail the request rather than run authored code.
109
+ */
110
+ export declare function consumeBoundCursorApiKey(options?: {
111
+ filePath?: string;
112
+ env?: NodeJS.ProcessEnv;
113
+ }): BoundCursorApiKeyConsumeResult;
80
114
  /**
81
115
  * First present source wins. We define the order; operators do not.
82
116
  * `--api-key` / `serve({ apiKey })` → `CURSOR_API_KEY` → `CURSOR_API_KEY_FILE`
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/credentials.ts"],"names":[],"mappings":"AA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AEtC;AAED,yEAAyE;AACzE,eAAO,MAAM,YAAY,EAAE,MAAoH,CAAC;AAQhJ,MAAM,WAAW,UAAU;IACzB,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,CAU9C;AAKD;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1C;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,2CAA2C;IAC3C,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,eAAe,CAAC,CAmG3B"}
@@ -4,13 +4,16 @@
4
4
  * Exactly one kind of secret exists at runtime: a **personal Cursor user API
5
5
  * key**. Two ways to obtain it, one code path after that:
6
6
  *
7
- * - `agent-serve login` runs the same PKCE browser flow as `cursor-agent`
7
+ * - `agent-sdk login` runs the same PKCE browser flow as `cursor-agent`
8
8
  * and Sand, then uses the short-lived session once to mint a named,
9
9
  * dashboard-revocable user API key — only the key is stored.
10
10
  * - `CURSOR_API_KEY` (or `serve({ apiKey })`) wins over the stored key, so
11
11
  * CI and hosted deployments stay env-driven.
12
12
  * - `CURSOR_API_KEY_FILE` (or the hosted default path) is next: freeze bind
13
- * drops the key at task time without restarting July.
13
+ * drops the key at task time without restarting July. On the hosted path
14
+ * that file is consumed into `CURSOR_API_KEY` and destroyed before
15
+ * anything authored runs, so this fallback is there for local,
16
+ * self-hosted, and the unsigned window before the first bind.
14
17
  * - Stored `july login` is last. Same order for hosted and self-hosted:
15
18
  * option → env → file → login.
16
19
  *
@@ -34,6 +37,7 @@ import { homedir } from "node:os";
34
37
  import { dirname, join } from "node:path";
35
38
  import { z } from "zod";
36
39
  import { CLI_COMMAND_NAME } from "../distribution.js";
40
+ import { destroyBoundSecretFile, } from "./bound-secret-file.js";
37
41
  export const DEFAULT_CURSOR_BACKEND_URL = "https://api2.cursor.sh";
38
42
  export const DEFAULT_CURSOR_EXTERNAL_API_URL = "https://api.cursor.com";
39
43
  const DEFAULT_CURSOR_WEBSITE_URL = "https://cursor.com";
@@ -152,9 +156,11 @@ export function clearStoredCredentials() {
152
156
  }
153
157
  /**
154
158
  * Hosted task-bind path. Not a secret: the snapshot may name this path.
155
- * The binder writes the key here after restore; July re-reads on each use.
156
- * Override with `CURSOR_API_KEY_FILE`. A missing file is unsigned — self-hosted
157
- * then uses `CURSOR_API_KEY` or stored login.
159
+ * The binder writes the key here after restore, and hosted admission /
160
+ * execution consume it into `process.env.CURSOR_API_KEY` and destroy the
161
+ * file before authored work this is an IPC handoff, not a credential
162
+ * source July keeps reading. Override with `CURSOR_API_KEY_FILE`. A missing
163
+ * file is unsigned — self-hosted then uses `CURSOR_API_KEY` or stored login.
158
164
  */
159
165
  export const DEFAULT_CURSOR_API_KEY_FILE = "/run/cursor/secrets/CURSOR_API_KEY";
160
166
  /**
@@ -163,11 +169,14 @@ export const DEFAULT_CURSOR_API_KEY_FILE = "/run/cursor/secrets/CURSOR_API_KEY";
163
169
  * listens before the binder drops the key; self-hosted falls through to
164
170
  * env or login.
165
171
  */
166
- export function readApiKeyFromFile(filePath) {
167
- const configured = filePath !== null && filePath !== void 0 ? filePath : process.env.CURSOR_API_KEY_FILE;
168
- const path = configured !== undefined && configured.trim() !== ""
172
+ export function resolveCursorApiKeyFilePath(filePath, env = process.env) {
173
+ const configured = filePath !== null && filePath !== void 0 ? filePath : env.CURSOR_API_KEY_FILE;
174
+ return configured !== undefined && configured.trim() !== ""
169
175
  ? configured.trim()
170
176
  : DEFAULT_CURSOR_API_KEY_FILE;
177
+ }
178
+ export function readApiKeyFromFile(filePath) {
179
+ const path = resolveCursorApiKeyFilePath(filePath);
171
180
  try {
172
181
  const raw = readFileSync(path, "utf8").trim();
173
182
  return raw === "" ? undefined : raw;
@@ -176,6 +185,47 @@ export function readApiKeyFromFile(filePath) {
176
185
  return undefined;
177
186
  }
178
187
  }
188
+ /**
189
+ * Copy the task-bind key file into `process.env.CURSOR_API_KEY`, then destroy
190
+ * the file.
191
+ *
192
+ * Hosted v2 cannot set another process's environment from the binder, so it
193
+ * drops a tmpfs file. Teaching every reader to open that file misses authored
194
+ * `process.env.CURSOR_API_KEY` and leaves a secret on disk. Hosted admission /
195
+ * execution call this once per request, next to the deployment-secrets
196
+ * consume: after it returns, env-only readers work and the key is no longer
197
+ * recoverable from disk. The control plane re-binds before the next request.
198
+ *
199
+ * The env write always happens before the destroy, never the other way round.
200
+ * An already-set `CURSOR_API_KEY` is not overwritten, but the file is still
201
+ * destroyed — env is the source, the file is only the handoff.
202
+ *
203
+ * A `readable` disposal means the secret survived; callers on the hosted path
204
+ * must fail the request rather than run authored code.
205
+ */
206
+ export function consumeBoundCursorApiKey(options) {
207
+ var _a;
208
+ const env = (_a = options === null || options === void 0 ? void 0 : options.env) !== null && _a !== void 0 ? _a : process.env;
209
+ const path = resolveCursorApiKeyFilePath(options === null || options === void 0 ? void 0 : options.filePath, env);
210
+ const envKeyAlreadySet = env.CURSOR_API_KEY !== undefined && env.CURSOR_API_KEY.trim() !== "";
211
+ let raw = "";
212
+ try {
213
+ raw = readFileSync(path, "utf8").trim();
214
+ }
215
+ catch (_b) {
216
+ return { applied: false, disposal: { state: "absent" } };
217
+ }
218
+ if (raw === "") {
219
+ return { applied: false, disposal: destroyBoundSecretFile(path) };
220
+ }
221
+ if (!envKeyAlreadySet) {
222
+ env.CURSOR_API_KEY = raw;
223
+ }
224
+ return {
225
+ applied: !envKeyAlreadySet,
226
+ disposal: destroyBoundSecretFile(path),
227
+ };
228
+ }
179
229
  /**
180
230
  * First present source wins. We define the order; operators do not.
181
231
  * `--api-key` / `serve({ apiKey })` → `CURSOR_API_KEY` → `CURSOR_API_KEY_FILE`
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The hosted v2 per-request secret handoff: bind files in, `process.env` out,
3
+ * nothing recoverable left on disk.
4
+ *
5
+ * The control plane rewrites `/run/cursor/secrets/` before every hosted
6
+ * admission and execution because it cannot set the already-running July
7
+ * process's environment. This module closes that handoff at the top of each
8
+ * request: copy both documents into `process.env`, then destroy them. Hosted
9
+ * request code and authored agents read env from there on — nothing on the
10
+ * hosted path should open these paths again.
11
+ *
12
+ * It fails closed. A secret that survives the consume would sit world-readable
13
+ * next to authored agent code for the length of a turn, so the caller returns
14
+ * a retryable error instead of dispatching. The next request re-binds and
15
+ * consumes again.
16
+ */
17
+ /** Wire error code for a bind file that outlived its consume. */
18
+ export declare const BOUND_SECRETS_NOT_CONSUMED = "bound_secrets_not_consumed";
19
+ export type HostedBoundSecretsResult = {
20
+ ok: true;
21
+ } | {
22
+ ok: false;
23
+ code: typeof BOUND_SECRETS_NOT_CONSUMED;
24
+ message: string;
25
+ };
26
+ /**
27
+ * Hydrate `process.env` from both bind files and remove them from disk.
28
+ * Returns a failure when either secret is still readable afterwards.
29
+ *
30
+ * Both paths are platform constants, deliberately not the `CURSOR_API_KEY_FILE`
31
+ * override that {@link resolveApiKeySync} honors. That override is a read
32
+ * chain; this is a destructive consume. Following it here would let authored
33
+ * code redirect the destroy at a decoy path — reporting success while the real
34
+ * bind file stays live — and would delete an operator's own long-lived key
35
+ * file on a surface that points the variable at one.
36
+ */
37
+ export declare function consumeHostedBoundSecrets(options?: {
38
+ apiKeyFilePath?: string;
39
+ deploymentSecretsFilePath?: string;
40
+ }): HostedBoundSecretsResult;
41
+ //# sourceMappingURL=hosted-bound-secrets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosted-bound-secrets.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/hosted-bound-secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAWH,iEAAiE;AACjE,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAEvE,MAAM,MAAM,wBAAwB,GAChC;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GACZ;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,OAAO,0BAA0B,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,CAAC,EAAE;IAClD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,GAAG,wBAAwB,CA2B3B"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The hosted v2 per-request secret handoff: bind files in, `process.env` out,
3
+ * nothing recoverable left on disk.
4
+ *
5
+ * The control plane rewrites `/run/cursor/secrets/` before every hosted
6
+ * admission and execution because it cannot set the already-running July
7
+ * process's environment. This module closes that handoff at the top of each
8
+ * request: copy both documents into `process.env`, then destroy them. Hosted
9
+ * request code and authored agents read env from there on — nothing on the
10
+ * hosted path should open these paths again.
11
+ *
12
+ * It fails closed. A secret that survives the consume would sit world-readable
13
+ * next to authored agent code for the length of a turn, so the caller returns
14
+ * a retryable error instead of dispatching. The next request re-binds and
15
+ * consumes again.
16
+ */
17
+ import { consumeBoundCursorApiKey, DEFAULT_CURSOR_API_KEY_FILE, } from "./credentials.js";
18
+ import { consumeBoundDeploymentSecrets, DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE, } from "./hosted-deployment-secrets.js";
19
+ /** Wire error code for a bind file that outlived its consume. */
20
+ export const BOUND_SECRETS_NOT_CONSUMED = "bound_secrets_not_consumed";
21
+ /**
22
+ * Hydrate `process.env` from both bind files and remove them from disk.
23
+ * Returns a failure when either secret is still readable afterwards.
24
+ *
25
+ * Both paths are platform constants, deliberately not the `CURSOR_API_KEY_FILE`
26
+ * override that {@link resolveApiKeySync} honors. That override is a read
27
+ * chain; this is a destructive consume. Following it here would let authored
28
+ * code redirect the destroy at a decoy path — reporting success while the real
29
+ * bind file stays live — and would delete an operator's own long-lived key
30
+ * file on a surface that points the variable at one.
31
+ */
32
+ export function consumeHostedBoundSecrets(options) {
33
+ var _a, _b;
34
+ const survivors = [];
35
+ const secretsPath = (_a = options === null || options === void 0 ? void 0 : options.deploymentSecretsFilePath) !== null && _a !== void 0 ? _a : DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE;
36
+ const secrets = consumeBoundDeploymentSecrets(secretsPath);
37
+ if (secrets.disposal.state === "readable") {
38
+ survivors.push(`${secretsPath} (${secrets.disposal.reason})`);
39
+ }
40
+ const apiKeyPath = (_b = options === null || options === void 0 ? void 0 : options.apiKeyFilePath) !== null && _b !== void 0 ? _b : DEFAULT_CURSOR_API_KEY_FILE;
41
+ const apiKey = consumeBoundCursorApiKey({ filePath: apiKeyPath });
42
+ if (apiKey.disposal.state === "readable") {
43
+ survivors.push(`${apiKeyPath} (${apiKey.disposal.reason})`);
44
+ }
45
+ if (survivors.length === 0) {
46
+ return { ok: true };
47
+ }
48
+ return {
49
+ ok: false,
50
+ code: BOUND_SECRETS_NOT_CONSUMED,
51
+ message: `Task-bind secrets are still readable after being hydrated into the ` +
52
+ `environment, so authored work did not run: ${survivors.join(", ")}.`,
53
+ };
54
+ }
@@ -4,13 +4,27 @@
4
4
  * The deployment host rewrites this tmpfs document before each admission and
5
5
  * execution request. July reloads it synchronously because the process was
6
6
  * already running in the frozen snapshot when the task-specific values
7
- * arrived.
7
+ * arrived, then destroys the document: `process.env` is the source authored
8
+ * code reads, and the file is only how the value crossed the process
9
+ * boundary.
8
10
  */
11
+ import { type BoundSecretFileDisposal } from "./bound-secret-file.js";
9
12
  export declare const DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE = "/run/cursor/secrets/AGENT_SERVE_DEPLOYMENT_SECRETS.json";
13
+ export type BoundDeploymentSecretsConsumeResult = {
14
+ /** The document supplied values on this call. */
15
+ applied: boolean;
16
+ disposal: BoundSecretFileDisposal;
17
+ };
10
18
  /**
11
- * Refresh `process.env` from the latest bound document. A missing or malformed
12
- * file is a no-op; an empty valid document removes values loaded by an earlier
13
- * bind after the deployment secret was unset.
19
+ * Apply the bound document to `process.env`, then destroy it.
20
+ *
21
+ * The env refresh always runs first, so a failed destroy never costs the
22
+ * request its secrets. A malformed document is destroyed too: it carries no
23
+ * values this process can use, and leaving it on disk only leaves whatever
24
+ * the control plane did manage to write.
25
+ *
26
+ * A `readable` disposal means the document survived; hosted callers must fail
27
+ * the request rather than run authored code next to a live secrets file.
14
28
  */
15
- export declare function refreshBoundDeploymentSecrets(path?: string): void;
29
+ export declare function consumeBoundDeploymentSecrets(path?: string): BoundDeploymentSecretsConsumeResult;
16
30
  //# sourceMappingURL=hosted-deployment-secrets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hosted-deployment-secrets.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/hosted-deployment-secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,2CAA2C,4DACG,CAAC;AAqC5D;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,GAAE,MAAoD,GACzD,IAAI,CAeN"}
1
+ {"version":3,"file":"hosted-deployment-secrets.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/hosted-deployment-secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,2CAA2C,4DACG,CAAC;AAuD5D,MAAM,MAAM,mCAAmC,GAAG;IAChD,iDAAiD;IACjD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,uBAAuB,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,GAAE,MAAoD,GACzD,mCAAmC,CASrC"}
@@ -4,9 +4,12 @@
4
4
  * The deployment host rewrites this tmpfs document before each admission and
5
5
  * execution request. July reloads it synchronously because the process was
6
6
  * already running in the frozen snapshot when the task-specific values
7
- * arrived.
7
+ * arrived, then destroys the document: `process.env` is the source authored
8
+ * code reads, and the file is only how the value crossed the process
9
+ * boundary.
8
10
  */
9
11
  import { readFileSync } from "node:fs";
12
+ import { destroyBoundSecretFile, } from "./bound-secret-file.js";
10
13
  export const DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE = "/run/cursor/secrets/AGENT_SERVE_DEPLOYMENT_SECRETS.json";
11
14
  const SECRET_NAME_PATTERN = /^[A-Z][A-Z0-9_]{0,63}$/;
12
15
  const appliedSecretNames = new Set();
@@ -39,15 +42,11 @@ function parseBoundSecrets(path) {
39
42
  return secrets;
40
43
  }
41
44
  /**
42
- * Refresh `process.env` from the latest bound document. A missing or malformed
43
- * file is a no-op; an empty valid document removes values loaded by an earlier
44
- * bind after the deployment secret was unset.
45
+ * Apply the latest bound document to `process.env`. An empty valid document
46
+ * removes values loaded by an earlier bind after the deployment secret was
47
+ * unset, which is why the applied names are tracked across calls.
45
48
  */
46
- export function refreshBoundDeploymentSecrets(path = DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE) {
47
- const secrets = parseBoundSecrets(path);
48
- if (secrets === undefined) {
49
- return;
50
- }
49
+ function applyBoundSecrets(secrets) {
51
50
  for (const name of appliedSecretNames) {
52
51
  if (!(name in secrets)) {
53
52
  delete process.env[name];
@@ -59,3 +58,24 @@ export function refreshBoundDeploymentSecrets(path = DEFAULT_AGENT_SERVE_DEPLOYM
59
58
  appliedSecretNames.add(name);
60
59
  }
61
60
  }
61
+ /**
62
+ * Apply the bound document to `process.env`, then destroy it.
63
+ *
64
+ * The env refresh always runs first, so a failed destroy never costs the
65
+ * request its secrets. A malformed document is destroyed too: it carries no
66
+ * values this process can use, and leaving it on disk only leaves whatever
67
+ * the control plane did manage to write.
68
+ *
69
+ * A `readable` disposal means the document survived; hosted callers must fail
70
+ * the request rather than run authored code next to a live secrets file.
71
+ */
72
+ export function consumeBoundDeploymentSecrets(path = DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE) {
73
+ const secrets = parseBoundSecrets(path);
74
+ if (secrets !== undefined) {
75
+ applyBoundSecrets(secrets);
76
+ }
77
+ return {
78
+ applied: secrets !== undefined,
79
+ disposal: destroyBoundSecretFile(path),
80
+ };
81
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Task-time bind paths for hosted deployment file-store source ids.
3
3
  *
4
- * Freeze v2 snapshots start `agent-serve serve` at bake time without a service
4
+ * Freeze v2 snapshots start `agent-sdk serve` at bake time without a service
5
5
  * account, so neither store id is in process env. Execute-from-freeze binds
6
6
  * the deployment credential and store ids into `/run/cursor/secrets/` without
7
7
  * restarting July — the same pattern as {@link DEFAULT_CURSOR_API_KEY_FILE}.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Task-time bind paths for hosted deployment file-store source ids.
3
3
  *
4
- * Freeze v2 snapshots start `agent-serve serve` at bake time without a service
4
+ * Freeze v2 snapshots start `agent-sdk serve` at bake time without a service
5
5
  * account, so neither store id is in process env. Execute-from-freeze binds
6
6
  * the deployment credential and store ids into `/run/cursor/secrets/` without
7
7
  * restarting July — the same pattern as {@link DEFAULT_CURSOR_API_KEY_FILE}.
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-account-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MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,sCAAsC;IACrD,0DAA0D;IAC1D,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,gDAAgD;IAChD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,8CAA8C;IAC9C,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjD;AAED;;;;GAIG;AACH,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,oCAAoC,GACzC,OAAO,CAAC,sCAAsC,CAAC,CA8FjD;AA2DD;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,MAAM,EAAE,IAAI,CACV,mBAAmB,EACnB,wBAAwB,GAAG,oBAAoB,CAChD,CAAC;IACF,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA0C/B"}
@@ -23,6 +23,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
23
23
  };
24
24
  import { LOG_PREFIX } from "./distribution.js";
25
25
  import { openBrowser } from "./mcp-oauth.js";
26
+ import { sleep as defaultSleep } from "./sleep.js";
26
27
  const DEFAULT_POLL_INTERVAL_MS = 3000;
27
28
  const DEFAULT_POLL_TIMEOUT_MS = 5 * 60 * 1000;
28
29
  /** Same default the dashboard uses; MCP_OAUTH_REDIRECT_URI overrides for dev. */
@@ -33,9 +34,6 @@ export function mcpOauthRedirectUri() {
33
34
  }
34
35
  return "https://www.cursor.com/agents/mcp/oauth/callback";
35
36
  }
36
- function sleepMs(ms) {
37
- return new Promise((resolve) => setTimeout(resolve, ms));
38
- }
39
37
  /**
40
38
  * Authorize the deployment service account for the connection's connectors.
41
39
  * Already-authorized connectors are skipped; the rest get a browser OAuth
@@ -46,7 +44,7 @@ export function authorizeCursorAccountConnectors(args) {
46
44
  var _a, _b, _c, _d, _e, _f;
47
45
  const { backendClient, teamId, serviceAccountId, connectionName, out, err } = args;
48
46
  const open = (_a = args.openBrowserImpl) !== null && _a !== void 0 ? _a : openBrowser;
49
- const sleep = (_b = args.sleep) !== null && _b !== void 0 ? _b : sleepMs;
47
+ const sleep = (_b = args.sleep) !== null && _b !== void 0 ? _b : defaultSleep;
50
48
  const pollIntervalMs = (_c = args.pollIntervalMs) !== null && _c !== void 0 ? _c : DEFAULT_POLL_INTERVAL_MS;
51
49
  const pollTimeoutMs = (_d = args.pollTimeoutMs) !== null && _d !== void 0 ? _d : DEFAULT_POLL_TIMEOUT_MS;
52
50
  const redirectUri = mcpOauthRedirectUri();
@@ -36,9 +36,13 @@ export interface DeploymentEventRelayOptions {
36
36
  }
37
37
  /** Current subscriptions: a live getter, otherwise the snapshot. */
38
38
  export declare function currentDeploymentSubscriptions(subscriptions: DeploymentSubscriptionSource): readonly ResolvedSubscription[];
39
- /** Normalize the channel's `deploySourceUris` option into concrete subscriptions. */
39
+ /**
40
+ * Normalize the channel's `deploySourceUris` option into concrete
41
+ * subscriptions. An omitted or empty option resolves to none, which callers
42
+ * read as "defer to the deploy scope".
43
+ */
40
44
  export declare function resolveDeploymentSubscriptions(options: {
41
- deploySourceUris: readonly (string | DeploymentSubscription)[];
45
+ deploySourceUris?: readonly (string | DeploymentSubscription)[];
42
46
  environments?: readonly string[];
43
47
  events?: readonly DeploymentEventType[];
44
48
  }): ResolvedSubscription[];
@@ -1 +1 @@
1
- {"version":3,"file":"cursor-deployment-relay.d.ts","sourceRoot":"","sources":["../../src/internal/cursor-deployment-relay.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,sBAAsB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,eAAe,GACxB,OAAO,CAQT;AAED,8DAA8D;AAC9D,MAAM,WAAW,wBAAwB;IACvC,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC/C,OAAO,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACvD;AAED;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CAAC,KAAK,EAAE;IACjD,OAAO,EAAE,SAAS,wBAAwB,EAAE,CAAC;IAC7C,KAAK,EAAE,eAAe,CAAC;IACvB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BhB;AAED,qBAAa,oBAAoB;IAKnB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJpC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwC;IAC7D,OAAO,CAAC,UAAU,CAA2C;IAC7D,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAqB;IAE1D,YAA6B,OAAO,EAAE,2BAA2B,EAuEhE;IAED;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;IAsBtB,KAAK,IAAI,IAAI,CAEZ;IAEK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAE1B;CACF"}
@@ -33,11 +33,15 @@ const DEFAULT_EVENTS = ["deployment.succeeded"];
33
33
  export function currentDeploymentSubscriptions(subscriptions) {
34
34
  return typeof subscriptions === "function" ? subscriptions() : subscriptions;
35
35
  }
36
- /** Normalize the channel's `deploySourceUris` option into concrete subscriptions. */
36
+ /**
37
+ * Normalize the channel's `deploySourceUris` option into concrete
38
+ * subscriptions. An omitted or empty option resolves to none, which callers
39
+ * read as "defer to the deploy scope".
40
+ */
37
41
  export function resolveDeploymentSubscriptions(options) {
38
- var _a, _b, _c, _d;
42
+ var _a, _b, _c, _d, _e;
39
43
  const bySource = new Map();
40
- for (const entry of options.deploySourceUris) {
44
+ for (const entry of (_a = options.deploySourceUris) !== null && _a !== void 0 ? _a : []) {
41
45
  const subscription = typeof entry === "string" ? { deploySourceUri: entry } : entry;
42
46
  // Case-folded only: `Deployment.deploy_source_uri` has no documented
43
47
  // format, and the server keys subscriptions the same way.
@@ -46,11 +50,11 @@ export function resolveDeploymentSubscriptions(options) {
46
50
  throw new Error(`deploymentsChannel: invalid deploy source "${subscription.deploySourceUri}".`);
47
51
  }
48
52
  const environments = [
49
- ...new Set(((_b = (_a = subscription.environments) !== null && _a !== void 0 ? _a : options.environments) !== null && _b !== void 0 ? _b : [])
53
+ ...new Set(((_c = (_b = subscription.environments) !== null && _b !== void 0 ? _b : options.environments) !== null && _c !== void 0 ? _c : [])
50
54
  .map((value) => value.trim())
51
55
  .filter(Boolean)),
52
56
  ];
53
- const events = new Set((_d = (_c = subscription.events) !== null && _c !== void 0 ? _c : options.events) !== null && _d !== void 0 ? _d : DEFAULT_EVENTS);
57
+ const events = new Set((_e = (_d = subscription.events) !== null && _d !== void 0 ? _d : options.events) !== null && _e !== void 0 ? _e : DEFAULT_EVENTS);
54
58
  if (events.size === 0) {
55
59
  throw new Error(`deploymentsChannel: deploy source "${deploySourceUri}" subscribes to no events.`);
56
60
  }
@@ -68,10 +72,10 @@ export function resolveDeploymentSubscriptions(options) {
68
72
  ? []
69
73
  : [...new Set([...existing.environments, ...environments])];
70
74
  }
71
- // Empty is legal here and means "this channel wants nothing". The
72
- // wire-level empty list means deregister. The host re-resolves on each
73
- // heartbeat, so a channel that later fills `deploySourceUris` can
74
- // register without a restart.
75
+ // Empty means "this channel names nothing". The relay wire reads that as
76
+ // deregistration, hosted admission reads it as "defer to the deploy
77
+ // scope". The host re-resolves on each heartbeat, so a channel that later
78
+ // fills `deploySourceUris` registers without a restart.
75
79
  return [...bySource.values()];
76
80
  }
77
81
  /**
@@ -28,8 +28,8 @@
28
28
  * Keep that capability per-channel: do not reintroduce a provider-wide event
29
29
  * union for control-plane consumers.
30
30
  */
31
- import type { ContinuationIdentity } from "../continuation.js";
32
31
  import type { AgentProject, AgentProjectInfo } from "../types.js";
32
+ import { type ContinuationIdentity } from "./continuation-identity.js";
33
33
  export declare const DEPLOY_MANIFEST_VERSION: 1;
34
34
  export interface AgentDeployManifestDeclarations {
35
35
  egressDomains: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"deploy-manifest.d.ts","sourceRoot":"","sources":["../../src/internal/deploy-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAclE,eAAO,MAAM,uBAAuB,EAAE,CAAK,CAAC;AAiC5C,MAAM,WAAW,+BAA+B;IAC9C,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,eAAe,GAAG,OAAO,GAAG,MAAM,CAAC;IACtD;;;;OAIG;IACH,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,EAAE,KAAK,CAAC;QACd,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,YAAY,EAAE,oBAAoB,CAAC;KACpC,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,qBAAqB;IACpC,eAAe,EAAE,CAAC,CAAC;IACnB,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,+BAA+B,CAAC;IAC9C;;;OAGG;IACH,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,wB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,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,YAAY,EACrB,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAChD,qBAAqB,CA0DvB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,OAAO,GACX,qBAAqB,GAAG,SAAS,CAOnC"}
@@ -32,7 +32,7 @@ import { z } from "zod";
32
32
  import { isPublicEndpointPolicy } from "../channels.js";
33
33
  import { isCursorHostedStorage } from "../storage-backends/cursor-hosted.js";
34
34
  import { applyAgentContinuationDefaults, channelContinuationIdentity, channelDeclaredEventTypes, handshakeChannelContinuation, } from "./continuation-channel.js";
35
- import { CONTINUATION_SELECTORS } from "./continuation-identity.js";
35
+ import { CONTINUATION_SELECTORS, } from "./continuation-identity.js";
36
36
  import { projectInfo, runtimeArchitectureCompatibilityError, } from "./discovery.js";
37
37
  import { packageVersion } from "./distribution.js";
38
38
  export const DEPLOY_MANIFEST_VERSION = 1;
@@ -4,6 +4,6 @@
4
4
  import type { ABConfigFile } from "../../ab.js";
5
5
  import type { DiscoveredAB } from "../../types.js";
6
6
  import { type DiscoveryContext } from "./context.js";
7
- export declare function loadABs(ctx: DiscoveryContext, agentDir: string): Promise<DiscoveredAB[]>;
7
+ export declare function loadABs(ctx: DiscoveryContext, agentDir: string, onDisable?: (source: string, path: string) => void): Promise<DiscoveredAB[]>;
8
8
  export declare function loadABConfig(ctx: DiscoveryContext, agentDir: string): Promise<ABConfigFile | undefined>;
9
9
  //# sourceMappingURL=ab.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ab.d.ts","sourceRoot":"","sources":["../../../src/internal/discovery/ab.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,KAAK,gBAAgB,EAAe,MAAM,cAAc,CAAC;AAUlE,wBAAsB,OAAO,CAC3B,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,EAAE,CAAC,CA+CzB;AAED,wBAAsB,YAAY,CAChC,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAyBnC"}
1
+ {"version":3,"file":"ab.d.ts","sourceRoot":"","sources":["../../../src/internal/discovery/ab.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,KAAK,gBAAgB,EAAe,MAAM,cAAc,CAAC;AAUlE,wBAAsB,OAAO,CAC3B,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,GACjD,OAAO,CAAC,YAAY,EAAE,CAAC,CAiEzB;AAED,wBAAsB,YAAY,CAChC,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAyBnC"}