@grok/agent-sdk 0.2.27 → 0.2.29

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 (1332) hide show
  1. package/AGENTS.md +42 -37
  2. package/CHANGELOG.md +1 -1
  3. package/README.md +15 -17
  4. package/dist/agent-v2-hosting.d.ts +13 -0
  5. package/dist/agent-v2-hosting.d.ts.map +1 -0
  6. package/dist/agent-v2-hosting.js +8 -0
  7. package/dist/artifacts.d.ts +1 -1
  8. package/dist/artifacts.js +1 -1
  9. package/dist/bin/agent-serve.d.ts +3 -15
  10. package/dist/bin/agent-serve.d.ts.map +1 -1
  11. package/dist/bin/agent-serve.js +30 -1628
  12. package/dist/channels/bitbucket/api.d.ts.map +1 -1
  13. package/dist/channels/bitbucket/api.js +3 -3
  14. package/dist/channels/bitbucket/binding.d.ts.map +1 -1
  15. package/dist/channels/bitbucket/binding.js +5 -5
  16. package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -1
  17. package/dist/channels/bitbucket/bitbucket-channel.js +1 -0
  18. package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -1
  19. package/dist/channels/bitbucket/bitbucket-webhook.js +9 -6
  20. package/dist/channels/bitbucket/checks.d.ts.map +1 -1
  21. package/dist/channels/bitbucket/checks.js +4 -0
  22. package/dist/channels/bitbucket/events.d.ts.map +1 -1
  23. package/dist/channels/bitbucket/index.d.ts +1 -1
  24. package/dist/channels/bitbucket/index.js +1 -1
  25. package/dist/channels/bitbucket/replay.d.ts.map +1 -1
  26. package/dist/channels/bitbucket/replay.js +4 -3
  27. package/dist/channels/change-monitors/change-monitors-channel.d.ts.map +1 -1
  28. package/dist/channels/change-monitors/change-monitors-channel.js +15 -2
  29. package/dist/channels/change-monitors/claim.d.ts +5 -0
  30. package/dist/channels/change-monitors/claim.d.ts.map +1 -0
  31. package/dist/channels/change-monitors/claim.js +6 -0
  32. package/dist/channels/change-monitors/index.d.ts +1 -0
  33. package/dist/channels/change-monitors/index.d.ts.map +1 -1
  34. package/dist/channels/change-monitors/index.js +1 -0
  35. package/dist/channels/change-monitors/types.d.ts.map +1 -1
  36. package/dist/channels/deployments/deployments-channel.d.ts +1 -1
  37. package/dist/channels/deployments/deployments-channel.js +1 -1
  38. package/dist/channels/deployments/index.d.ts +1 -1
  39. package/dist/channels/deployments/index.js +1 -1
  40. package/dist/channels/deployments/types.d.ts.map +1 -1
  41. package/dist/channels/github/api.d.ts +11 -0
  42. package/dist/channels/github/api.d.ts.map +1 -1
  43. package/dist/channels/github/api.js +29 -4
  44. package/dist/channels/github/binding.d.ts +5 -3
  45. package/dist/channels/github/binding.d.ts.map +1 -1
  46. package/dist/channels/github/binding.js +16 -9
  47. package/dist/channels/github/github-channel.d.ts +7 -2
  48. package/dist/channels/github/github-channel.d.ts.map +1 -1
  49. package/dist/channels/github/github-channel.js +20 -11
  50. package/dist/channels/github/index.d.ts +1 -1
  51. package/dist/channels/github/index.js +1 -1
  52. package/dist/channels/github/progress.d.ts.map +1 -1
  53. package/dist/channels/github/progress.js +4 -0
  54. package/dist/channels/github/state.d.ts +2 -2
  55. package/dist/channels/github/state.d.ts.map +1 -1
  56. package/dist/channels/github/types.d.ts +7 -7
  57. package/dist/channels/github/types.d.ts.map +1 -1
  58. package/dist/channels/gitlab/api.d.ts +2 -2
  59. package/dist/channels/gitlab/api.d.ts.map +1 -1
  60. package/dist/channels/gitlab/api.js +25 -14
  61. package/dist/channels/gitlab/binding.d.ts.map +1 -1
  62. package/dist/channels/gitlab/binding.js +2 -3
  63. package/dist/channels/gitlab/checks.d.ts.map +1 -1
  64. package/dist/channels/gitlab/checks.js +4 -0
  65. package/dist/channels/gitlab/events.d.ts.map +1 -1
  66. package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -1
  67. package/dist/channels/gitlab/gitlab-channel.js +4 -7
  68. package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -1
  69. package/dist/channels/gitlab/gitlab-webhook.js +11 -8
  70. package/dist/channels/gitlab/index.d.ts +1 -1
  71. package/dist/channels/gitlab/index.js +1 -1
  72. package/dist/channels/gitlab/replay.d.ts.map +1 -1
  73. package/dist/channels/gitlab/replay.js +2 -0
  74. package/dist/channels/gitlab/types.d.ts.map +1 -1
  75. package/dist/channels/issues/claim.d.ts +5 -0
  76. package/dist/channels/issues/claim.d.ts.map +1 -0
  77. package/dist/channels/issues/claim.js +6 -0
  78. package/dist/channels/issues/index.d.ts +1 -0
  79. package/dist/channels/issues/index.d.ts.map +1 -1
  80. package/dist/channels/issues/index.js +1 -0
  81. package/dist/channels/issues/issues-channel.d.ts.map +1 -1
  82. package/dist/channels/issues/issues-channel.js +16 -3
  83. package/dist/channels/issues/types.d.ts +2 -2
  84. package/dist/channels/issues/types.d.ts.map +1 -1
  85. package/dist/channels/origin/api.d.ts.map +1 -1
  86. package/dist/channels/origin/api.js +3 -3
  87. package/dist/channels/origin/index.d.ts +1 -1
  88. package/dist/channels/origin/index.js +1 -1
  89. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  90. package/dist/channels/origin/origin-channel.js +6 -6
  91. package/dist/channels/origin/origin-webhook.d.ts.map +1 -1
  92. package/dist/channels/origin/origin-webhook.js +2 -5
  93. package/dist/channels/pagerduty/api.d.ts.map +1 -1
  94. package/dist/channels/pagerduty/api.js +2 -1
  95. package/dist/channels/pagerduty/index.d.ts +1 -1
  96. package/dist/channels/pagerduty/index.js +1 -1
  97. package/dist/channels/pagerduty/pagerduty-channel.d.ts +1 -1
  98. package/dist/channels/pagerduty/pagerduty-channel.d.ts.map +1 -1
  99. package/dist/channels/pagerduty/pagerduty-channel.js +2 -1
  100. package/dist/channels/pagerduty/pagerduty-webhook.d.ts.map +1 -1
  101. package/dist/channels/pagerduty/pagerduty-webhook.js +20 -11
  102. package/dist/channels/pagerduty/payload.d.ts.map +1 -1
  103. package/dist/channels/pagerduty/payload.js +2 -3
  104. package/dist/channels/pagerduty/replay.d.ts +1 -1
  105. package/dist/channels/pagerduty/replay.d.ts.map +1 -1
  106. package/dist/channels/pagerduty/replay.js +8 -5
  107. package/dist/channels/pagerduty/self-user.d.ts.map +1 -1
  108. package/dist/channels/pagerduty/self-user.js +8 -9
  109. package/dist/channels/runs/runs-channel.d.ts.map +1 -1
  110. package/dist/channels/runs/runs-channel.js +8 -2
  111. package/dist/channels/runs/types.d.ts +2 -2
  112. package/dist/channels/runs/types.d.ts.map +1 -1
  113. package/dist/channels/slack/agentic-delivery.d.ts +20 -1
  114. package/dist/channels/slack/agentic-delivery.d.ts.map +1 -1
  115. package/dist/channels/slack/agentic-delivery.js +77 -12
  116. package/dist/channels/slack/agentic-signals.d.ts +2 -0
  117. package/dist/channels/slack/agentic-signals.d.ts.map +1 -1
  118. package/dist/channels/slack/agentic-signals.js +24 -7
  119. package/dist/channels/slack/api.d.ts +1 -1
  120. package/dist/channels/slack/api.d.ts.map +1 -1
  121. package/dist/channels/slack/api.js +12 -13
  122. package/dist/channels/slack/approvals.d.ts.map +1 -1
  123. package/dist/channels/slack/approvals.js +5 -4
  124. package/dist/channels/slack/attachments.d.ts.map +1 -1
  125. package/dist/channels/slack/attachments.js +34 -9
  126. package/dist/channels/slack/auth.d.ts.map +1 -1
  127. package/dist/channels/slack/auth.js +3 -1
  128. package/dist/channels/slack/bot-mentions.d.ts.map +1 -1
  129. package/dist/channels/slack/bot-mentions.js +2 -4
  130. package/dist/channels/slack/cli-project.d.ts.map +1 -1
  131. package/dist/channels/slack/cli-project.js +7 -10
  132. package/dist/channels/slack/constants.d.ts +7 -0
  133. package/dist/channels/slack/constants.d.ts.map +1 -1
  134. package/dist/channels/slack/constants.js +7 -0
  135. package/dist/channels/slack/defaults.d.ts +12 -0
  136. package/dist/channels/slack/defaults.d.ts.map +1 -1
  137. package/dist/channels/slack/defaults.js +10 -2
  138. package/dist/channels/slack/dispatch.d.ts +7 -1
  139. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  140. package/dist/channels/slack/dispatch.js +88 -13
  141. package/dist/channels/slack/doctor.d.ts.map +1 -1
  142. package/dist/channels/slack/doctor.js +11 -11
  143. package/dist/channels/slack/inbound.d.ts +7 -0
  144. package/dist/channels/slack/inbound.d.ts.map +1 -1
  145. package/dist/channels/slack/inbound.js +25 -4
  146. package/dist/channels/slack/index.d.ts +2 -2
  147. package/dist/channels/slack/index.d.ts.map +1 -1
  148. package/dist/channels/slack/index.js +2 -2
  149. package/dist/channels/slack/init.d.ts +2 -0
  150. package/dist/channels/slack/init.d.ts.map +1 -1
  151. package/dist/channels/slack/init.js +10 -2
  152. package/dist/channels/slack/interactive.d.ts +6 -1
  153. package/dist/channels/slack/interactive.d.ts.map +1 -1
  154. package/dist/channels/slack/interactive.js +15 -25
  155. package/dist/channels/slack/manifest.d.ts.map +1 -1
  156. package/dist/channels/slack/manifest.js +15 -12
  157. package/dist/channels/slack/message-body.d.ts.map +1 -1
  158. package/dist/channels/slack/message-body.js +2 -4
  159. package/dist/channels/slack/nudge-carrier.d.ts.map +1 -1
  160. package/dist/channels/slack/nudge-carrier.js +27 -1
  161. package/dist/channels/slack/nudge-store.d.ts.map +1 -1
  162. package/dist/channels/slack/nudge-store.js +8 -3
  163. package/dist/channels/slack/placeholder.d.ts +3 -0
  164. package/dist/channels/slack/placeholder.d.ts.map +1 -1
  165. package/dist/channels/slack/placeholder.js +6 -5
  166. package/dist/channels/slack/recording-sink.d.ts.map +1 -1
  167. package/dist/channels/slack/recording-sink.js +4 -3
  168. package/dist/channels/slack/sender-name.d.ts.map +1 -1
  169. package/dist/channels/slack/sender-name.js +2 -3
  170. package/dist/channels/slack/slack-channel.d.ts +1 -3
  171. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  172. package/dist/channels/slack/slack-channel.js +63 -86
  173. package/dist/channels/slack/thread-context.d.ts.map +1 -1
  174. package/dist/channels/slack/thread-context.js +4 -9
  175. package/dist/channels/slack/tool-cards.d.ts.map +1 -1
  176. package/dist/channels/slack/tool-cards.js +4 -0
  177. package/dist/channels/slack/types.d.ts +19 -4
  178. package/dist/channels/slack/types.d.ts.map +1 -1
  179. package/dist/channels/slack/upload.d.ts +2 -0
  180. package/dist/channels/slack/upload.d.ts.map +1 -1
  181. package/dist/channels/slack/upload.js +49 -12
  182. package/dist/channels/slack/user-info.d.ts.map +1 -1
  183. package/dist/channels/slack/user-info.js +3 -6
  184. package/dist/channels.d.ts +11 -11
  185. package/dist/channels.d.ts.map +1 -1
  186. package/dist/channels.js +57 -30
  187. package/dist/connections.d.ts +1 -1
  188. package/dist/connections.js +1 -1
  189. package/dist/docs/404.html +4 -4
  190. package/dist/docs/architecture.svg +1 -1
  191. package/dist/docs/assets/{app.wA5xBBcd.js → app.DMrZKFjI.js} +4 -4
  192. package/dist/docs/assets/building-with-agents.md.Bf1yH2tG.js +9 -0
  193. package/dist/docs/assets/building-with-agents.md.Bf1yH2tG.lean.js +1 -0
  194. package/dist/docs/assets/changelog.md.DrLFQUlu.js +1 -0
  195. package/dist/docs/assets/changelog.md.DrLFQUlu.lean.js +1 -0
  196. package/dist/docs/assets/chunks/@localSearchIndexroot.Dpd_wxVU.js +1 -0
  197. package/dist/docs/assets/chunks/{VPLocalSearchBox.C29HLCVL.js → VPLocalSearchBox.DQvuw1KA.js} +1 -1
  198. package/dist/docs/assets/chunks/{arc.BOaoYWmh.js → arc.ahOG-Qza.js} +1 -1
  199. package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.MfG0itQh.js → architectureDiagram-Q4EWVU46.BcgfYNO_.js} +1 -1
  200. package/dist/docs/assets/chunks/{baseUniq.CUeJciCF.js → baseUniq.DeIYZrWh.js} +1 -1
  201. package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.BrXMZRtK.js → blockDiagram-DXYQGD6D.HjJ2goMX.js} +1 -1
  202. package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.DfkDHeB9.js → c4Diagram-AHTNJAMY.C1QTb9GM.js} +1 -1
  203. package/dist/docs/assets/chunks/channel._fZX_hvU.js +1 -0
  204. package/dist/docs/assets/chunks/{chunk-4BX2VUAB.xKz8CiXK.js → chunk-4BX2VUAB.UuZiDiVp.js} +1 -1
  205. package/dist/docs/assets/chunks/{chunk-4TB4RGXK.kkfBh4zk.js → chunk-4TB4RGXK.5A3YmkhI.js} +1 -1
  206. package/dist/docs/assets/chunks/{chunk-55IACEB6.BClJGb94.js → chunk-55IACEB6.B4uf1yYV.js} +1 -1
  207. package/dist/docs/assets/chunks/{chunk-EDXVE4YY.P9BpQ9L3.js → chunk-EDXVE4YY.CoXBce8t.js} +1 -1
  208. package/dist/docs/assets/chunks/{chunk-FMBD7UC4.R4iYi58S.js → chunk-FMBD7UC4.DnC5NO4e.js} +1 -1
  209. package/dist/docs/assets/chunks/{chunk-OYMX7WX6.Cpn8L1dw.js → chunk-OYMX7WX6.CzfHCeIi.js} +1 -1
  210. package/dist/docs/assets/chunks/{chunk-QZHKN3VN.BLftECqU.js → chunk-QZHKN3VN.C6tcwkVd.js} +1 -1
  211. package/dist/docs/assets/chunks/{chunk-YZCP3GAM.BWDV1AYt.js → chunk-YZCP3GAM._oboyZ1A.js} +1 -1
  212. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.eClS1Q0E.js +1 -0
  213. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.eClS1Q0E.js +1 -0
  214. package/dist/docs/assets/chunks/clone.W1Phdw9P.js +1 -0
  215. package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.DGpAcJ55.js → cose-bilkent-S5V4N54A.BfPVKeId.js} +1 -1
  216. package/dist/docs/assets/chunks/{dagre-KV5264BT.BBXxGEaD.js → dagre-KV5264BT.CLMLc0lD.js} +1 -1
  217. package/dist/docs/assets/chunks/{diagram-5BDNPKRD.EKqOwmK2.js → diagram-5BDNPKRD.C7OF7UfH.js} +1 -1
  218. package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.CB8pdkoZ.js → diagram-G4DWMVQ6.Dpao0Bl1.js} +1 -1
  219. package/dist/docs/assets/chunks/{diagram-MMDJMWI5.aHh4WGg9.js → diagram-MMDJMWI5.DLnM9eLp.js} +1 -1
  220. package/dist/docs/assets/chunks/{diagram-TYMM5635.YIsbRH20.js → diagram-TYMM5635.BcpVgA_M.js} +1 -1
  221. package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.B3bTCW_e.js → erDiagram-SMLLAGMA.CsL5JuCV.js} +1 -1
  222. package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.M81hXIXZ.js → flowDiagram-DWJPFMVM.MFihq9AF.js} +1 -1
  223. package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.BKg7WY--.js → ganttDiagram-T4ZO3ILL.CJeLodyG.js} +1 -1
  224. package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.CLEMZgO3.js → gitGraphDiagram-UUTBAWPF.1HhlE45Z.js} +1 -1
  225. package/dist/docs/assets/chunks/{graph.DS38W_Q-.js → graph.BS02KkWA.js} +1 -1
  226. package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.BTiWTi82.js → infoDiagram-42DDH7IO.fp5gvytQ.js} +1 -1
  227. package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.DcqY_KQL.js → ishikawaDiagram-UXIWVN3A.C6Wk1V4I.js} +1 -1
  228. package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.0lQNZ40U.js → journeyDiagram-VCZTEJTY.qJt4uJ_H.js} +1 -1
  229. package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.L5sKlf7X.js → kanban-definition-6JOO6SKY.z2tG9kly.js} +1 -1
  230. package/dist/docs/assets/chunks/{layout.7u4gFhQa.js → layout.BPCkdejr.js} +1 -1
  231. package/dist/docs/assets/chunks/{linear.D5v33SOb.js → linear.CL3TC3u7.js} +1 -1
  232. package/dist/docs/assets/chunks/{min.Dc9uCxf9.js → min.SPrSp704.js} +1 -1
  233. package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.B56nGoB_.js → mindmap-definition-QFDTVHPH.DgrQRFZW.js} +1 -1
  234. package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.Cba8e8lS.js → pieDiagram-DEJITSTG.Ba7yxiW2.js} +1 -1
  235. package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.2YjBycHF.js → quadrantDiagram-34T5L4WZ.Bvskad4p.js} +1 -1
  236. package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.D4P5RqVI.js → requirementDiagram-MS252O5E.Ce70ugV9.js} +1 -1
  237. package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.C0Hn8NUm.js → sankeyDiagram-XADWPNL6.BJ5OEULO.js} +1 -1
  238. package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.BZm7EaoT.js → sequenceDiagram-FGHM5R23.C8a1hDs6.js} +1 -1
  239. package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.DcR4f3X2.js → stateDiagram-FHFEXIEX.D2D8A5CK.js} +1 -1
  240. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.77yf4kRr.js +1 -0
  241. package/dist/docs/assets/chunks/{theme.DvfKzyXq.js → theme.DRciHmS1.js} +2 -2
  242. package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.CgDh96vg.js → timeline-definition-GMOUNBTQ.C4ePrY8-.js} +1 -1
  243. package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.B4fagbC8.js → vennDiagram-DHZGUBPP.Dzso6dEA.js} +1 -1
  244. package/dist/docs/assets/chunks/{wardley-RL74JXVD.Ck68omim.js → wardley-RL74JXVD.djgXR0ar.js} +1 -1
  245. package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.DBUg0bvz.js → wardleyDiagram-NUSXRM2D.Bf2ICxjh.js} +1 -1
  246. package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.DnKSGQE1.js → xychartDiagram-5P7HB3ND.DEH4BcVJ.js} +1 -1
  247. package/dist/docs/assets/deployment.md.KW0Ni_rY.js +31 -0
  248. package/dist/docs/assets/deployment.md.KW0Ni_rY.lean.js +1 -0
  249. package/dist/docs/assets/{evals.md.CHR34K1Y.js → evals.md.DiljU__Z.js} +10 -10
  250. package/dist/docs/assets/{guides_agent-to-agent.md.CwL5cwuE.js → guides_agent-to-agent.md.D1D5f6Jc.js} +7 -7
  251. package/dist/docs/assets/guides_agent-to-agent.md.D1D5f6Jc.lean.js +1 -0
  252. package/dist/docs/assets/{guides_bitbucket.md.CKUayYtD.js → guides_bitbucket.md.DkjkBRU8.js} +3 -3
  253. package/dist/docs/assets/guides_cloud-agents.md.Ceyjv0ul.js +9 -0
  254. package/dist/docs/assets/guides_cloud-agents.md.Ceyjv0ul.lean.js +1 -0
  255. package/dist/docs/assets/{guides_convert-automation.md.DMEX9nF-.js → guides_convert-automation.md.BjraCvok.js} +11 -11
  256. package/dist/docs/assets/guides_convert-automation.md.BjraCvok.lean.js +1 -0
  257. package/dist/docs/assets/{guides_github.md.TuNiZAOQ.js → guides_github.md.CgN5sNbW.js} +14 -14
  258. package/dist/docs/assets/{guides_github.md.TuNiZAOQ.lean.js → guides_github.md.CgN5sNbW.lean.js} +1 -1
  259. package/dist/docs/assets/{guides_gitlab.md.CtNI4fSH.js → guides_gitlab.md.DCE0p7_w.js} +3 -3
  260. package/dist/docs/assets/{guides_hooks.md.B2XfGX50.js → guides_hooks.md.BjeEiM7s.js} +4 -4
  261. package/dist/docs/assets/{guides_hooks.md.B2XfGX50.lean.js → guides_hooks.md.BjeEiM7s.lean.js} +1 -1
  262. package/dist/docs/assets/{guides_improve.md.CZKVt1cT.js → guides_improve.md.BFYtrtLE.js} +4 -4
  263. package/dist/docs/assets/{guides_improve.md.CZKVt1cT.lean.js → guides_improve.md.BFYtrtLE.lean.js} +1 -1
  264. package/dist/docs/assets/{guides_jev.md.D7XH4JH3.js → guides_jev.md.CEqLgjj9.js} +12 -12
  265. package/dist/docs/assets/{guides_jev.md.D7XH4JH3.lean.js → guides_jev.md.CEqLgjj9.lean.js} +1 -1
  266. package/dist/docs/assets/{guides_mcp-oauth.md.Cxq2TxBB.js → guides_mcp-oauth.md.DrGY92u4.js} +8 -8
  267. package/dist/docs/assets/{guides_mcp-oauth.md.Cxq2TxBB.lean.js → guides_mcp-oauth.md.DrGY92u4.lean.js} +1 -1
  268. package/dist/docs/assets/guides_migrate.md.RS9Eu-Xh.js +8 -0
  269. package/dist/docs/assets/guides_migrate.md.RS9Eu-Xh.lean.js +1 -0
  270. package/dist/docs/assets/guides_opentelemetry.md.CoZ1kNyd.js +28 -0
  271. package/dist/docs/assets/guides_opentelemetry.md.CoZ1kNyd.lean.js +1 -0
  272. package/dist/docs/assets/{guides_pagerduty.md.BHXMcMtx.js → guides_pagerduty.md.mnKXe9U0.js} +10 -10
  273. package/dist/docs/assets/{guides_slack.md.ClIyi7FI.js → guides_slack.md.BwXHURvY.js} +21 -8
  274. package/dist/docs/assets/{guides_slack.md.ClIyi7FI.lean.js → guides_slack.md.BwXHURvY.lean.js} +1 -1
  275. package/dist/docs/assets/{guides_webhooks.md.Cpdc3BDX.js → guides_webhooks.md.BJk63ZTs.js} +9 -5
  276. package/dist/docs/assets/{guides_webhooks.md.Cpdc3BDX.lean.js → guides_webhooks.md.BJk63ZTs.lean.js} +1 -1
  277. package/dist/docs/assets/{hillclimbing.md.Dxvd-0gT.js → hillclimbing.md.By61f3uq.js} +2 -2
  278. package/dist/docs/assets/index.md.CAruw_rp.js +26 -0
  279. package/dist/docs/assets/index.md.CAruw_rp.lean.js +1 -0
  280. package/dist/docs/assets/{quickstart.md.D8JDfkKO.js → quickstart.md.CljDaJBi.js} +12 -12
  281. package/dist/docs/assets/quickstart.md.CljDaJBi.lean.js +1 -0
  282. package/dist/docs/assets/reference_access.md.CEtibb4i.js +1 -0
  283. package/dist/docs/assets/reference_access.md.CEtibb4i.lean.js +1 -0
  284. package/dist/docs/assets/{reference_agent-config.md.CZrbHOfT.js → reference_agent-config.md.Ck29qYNj.js} +10 -8
  285. package/dist/docs/assets/{reference_agent-config.md.CZrbHOfT.lean.js → reference_agent-config.md.Ck29qYNj.lean.js} +1 -1
  286. package/dist/docs/assets/{reference_artifacts.md.DLV9MZES.js → reference_artifacts.md.C-hKR2hp.js} +2 -2
  287. package/dist/docs/assets/reference_channels.md.DsJfGSBJ.js +22 -0
  288. package/dist/docs/assets/{reference_channels.md.CNNIS6K7.lean.js → reference_channels.md.DsJfGSBJ.lean.js} +1 -1
  289. package/dist/docs/assets/reference_cli.md.BkdLRbXg.js +99 -0
  290. package/dist/docs/assets/reference_cli.md.BkdLRbXg.lean.js +1 -0
  291. package/dist/docs/assets/{reference_connections.md.BJE2Zllp.js → reference_connections.md.BoAotr7_.js} +7 -7
  292. package/dist/docs/assets/{reference_evals.md.Ccwp4x3o.js → reference_evals.md.2BXeMiO2.js} +31 -11
  293. package/dist/docs/assets/{reference_evals.md.Ccwp4x3o.lean.js → reference_evals.md.2BXeMiO2.lean.js} +1 -1
  294. package/dist/docs/assets/{reference_extensions.md.DKxTuCIw.js → reference_extensions.md.DI5X5x8p.js} +10 -10
  295. package/dist/docs/assets/{reference_extensions.md.DKxTuCIw.lean.js → reference_extensions.md.DI5X5x8p.lean.js} +1 -1
  296. package/dist/docs/assets/{reference_hooks.md.CROr0QgC.js → reference_hooks.md.B-bwJuiG.js} +5 -5
  297. package/dist/docs/assets/{reference_http-api.md.Dji-DD_Z.js → reference_http-api.md._RWELr3d.js} +1 -1
  298. package/dist/docs/assets/{reference_instructions.md.BYMVxAkw.js → reference_instructions.md.yL2hXLnl.js} +1 -1
  299. package/dist/docs/assets/reference_limits.md.BCCnvt3o.js +8 -0
  300. package/dist/docs/assets/reference_limits.md.BCCnvt3o.lean.js +1 -0
  301. package/dist/docs/assets/reference_memory.md.Dd7cyV9V.js +4 -0
  302. package/dist/docs/assets/reference_playground.md.CQiJk9CM.js +1 -0
  303. package/dist/docs/assets/{reference_project-layout.md.mFcS8yDD.js → reference_project-layout.md.BamcPDUn.js} +4 -4
  304. package/dist/docs/assets/{reference_prompt.md.DqPh71XN.js → reference_prompt.md.BMjm1Jp3.js} +2 -2
  305. package/dist/docs/assets/{reference_schedules.md.BqWnJES4.js → reference_schedules.md.RC47aFm4.js} +4 -4
  306. package/dist/docs/assets/{reference_sessions.md.Bi6lHttM.js → reference_sessions.md.C7KFhWXV.js} +1 -1
  307. package/dist/docs/assets/{reference_skills.md.Ckddg6KX.js → reference_skills.md.Dej2zQxi.js} +2 -2
  308. package/dist/docs/assets/{reference_skills.md.Ckddg6KX.lean.js → reference_skills.md.Dej2zQxi.lean.js} +1 -1
  309. package/dist/docs/assets/{reference_subagents.md.ChNGh6HK.js → reference_subagents.md.CAhvW4yS.js} +1 -1
  310. package/dist/docs/assets/{reference_tools.md.Bo0UfT0a.js → reference_tools.md.DQr7Fnhu.js} +10 -10
  311. package/dist/docs/assets/{reference_tools.md.Bo0UfT0a.lean.js → reference_tools.md.DQr7Fnhu.lean.js} +1 -1
  312. package/dist/docs/assets/{style.B9o0luvp.css → style.DK0YX1WL.css} +1 -1
  313. package/dist/docs/assets/{templates_agentic-owners.md.CTEnR0jp.js → templates_agentic-owners.md.Dh2nDSqg.js} +4 -4
  314. package/dist/docs/assets/templates_security-reviewer.md.DnwXdnB5.js +3 -0
  315. package/dist/docs/assets/templates_thermo-quality-review.md.MJIdHkzE.js +3 -0
  316. package/dist/docs/assets/{templates_thermo-quality-review.md.B77UyTrX.lean.js → templates_thermo-quality-review.md.MJIdHkzE.lean.js} +1 -1
  317. package/dist/docs/assets/templates_thermo-review.md.DfN1OFOl.js +3 -0
  318. package/dist/docs/assets/{templates_thermo-review.md.DRJ7mC5U.lean.js → templates_thermo-review.md.DfN1OFOl.lean.js} +1 -1
  319. package/dist/docs/assets/{templates_triage.md.CNN6b0JZ.js → templates_triage.md.BYWMloV4.js} +4 -4
  320. package/dist/docs/assets/troubleshooting.md.CGOdNVAL.js +1 -0
  321. package/dist/docs/building-with-agents.html +46 -46
  322. package/dist/docs/building-with-agents.md +20 -20
  323. package/dist/docs/changelog.html +39 -39
  324. package/dist/docs/changelog.md +57 -11
  325. package/dist/docs/deployment.html +54 -54
  326. package/dist/docs/deployment.md +115 -53
  327. package/dist/docs/evals.html +48 -48
  328. package/dist/docs/evals.md +15 -13
  329. package/dist/docs/guides/agent-to-agent.html +45 -45
  330. package/dist/docs/guides/agent-to-agent.md +7 -7
  331. package/dist/docs/guides/bitbucket.html +41 -41
  332. package/dist/docs/guides/bitbucket.md +5 -5
  333. package/dist/docs/guides/cloud-agents.html +41 -41
  334. package/dist/docs/guides/cloud-agents.md +3 -3
  335. package/dist/docs/guides/convert-automation.html +49 -49
  336. package/dist/docs/guides/convert-automation.md +16 -15
  337. package/dist/docs/guides/github.html +50 -50
  338. package/dist/docs/guides/github.md +17 -17
  339. package/dist/docs/guides/gitlab.html +41 -41
  340. package/dist/docs/guides/gitlab.md +5 -5
  341. package/dist/docs/guides/hooks.html +40 -40
  342. package/dist/docs/guides/hooks.md +3 -3
  343. package/dist/docs/guides/improve.html +41 -41
  344. package/dist/docs/guides/improve.md +2 -2
  345. package/dist/docs/guides/jev.html +48 -48
  346. package/dist/docs/guides/jev.md +15 -10
  347. package/dist/docs/guides/mcp-oauth.html +45 -45
  348. package/dist/docs/guides/mcp-oauth.md +10 -11
  349. package/dist/docs/guides/migrate.html +43 -42
  350. package/dist/docs/guides/migrate.md +36 -29
  351. package/dist/docs/guides/opentelemetry.html +50 -59
  352. package/dist/docs/guides/opentelemetry.md +61 -130
  353. package/dist/docs/guides/pagerduty.html +48 -48
  354. package/dist/docs/guides/pagerduty.md +18 -18
  355. package/dist/docs/guides/slack.html +58 -45
  356. package/dist/docs/guides/slack.md +87 -17
  357. package/dist/docs/guides/webhooks.html +46 -42
  358. package/dist/docs/guides/webhooks.md +61 -3
  359. package/dist/docs/hashmap.json +1 -1
  360. package/dist/docs/hillclimbing.html +39 -39
  361. package/dist/docs/hillclimbing.md +4 -4
  362. package/dist/docs/index.html +56 -57
  363. package/dist/docs/index.md +31 -31
  364. package/dist/docs/llms-full.txt +1333 -1417
  365. package/dist/docs/llms.txt +13 -14
  366. package/dist/docs/package/skills/create-agent/SKILL.md +178 -0
  367. package/dist/docs/package/skills/evals/SKILL.md +145 -0
  368. package/dist/docs/package/skills/github/SKILL.md +133 -0
  369. package/dist/docs/package/skills/hillclimb/SKILL.md +63 -0
  370. package/dist/docs/package/skills/mcp-auth/SKILL.md +60 -0
  371. package/dist/docs/package/skills/migrate-v2/SKILL.md +394 -0
  372. package/dist/docs/package/skills/setup-slack/SKILL.md +136 -0
  373. package/dist/docs/quickstart.html +50 -50
  374. package/dist/docs/quickstart.md +25 -21
  375. package/dist/docs/reference/access.html +60 -0
  376. package/dist/docs/reference/access.md +22 -0
  377. package/dist/docs/reference/agent-config.html +46 -44
  378. package/dist/docs/reference/agent-config.md +54 -12
  379. package/dist/docs/reference/artifacts.html +39 -39
  380. package/dist/docs/reference/artifacts.md +2 -2
  381. package/dist/docs/reference/channels.html +39 -39
  382. package/dist/docs/reference/channels.md +29 -9
  383. package/dist/docs/reference/cli.html +96 -100
  384. package/dist/docs/reference/cli.md +363 -366
  385. package/dist/docs/reference/connections.html +44 -44
  386. package/dist/docs/reference/connections.md +10 -10
  387. package/dist/docs/reference/evals.html +68 -48
  388. package/dist/docs/reference/evals.md +48 -13
  389. package/dist/docs/reference/extensions.html +47 -47
  390. package/dist/docs/reference/extensions.md +12 -12
  391. package/dist/docs/reference/hooks.html +42 -42
  392. package/dist/docs/reference/hooks.md +11 -11
  393. package/dist/docs/reference/http-api.html +39 -39
  394. package/dist/docs/reference/http-api.md +1 -1
  395. package/dist/docs/reference/instructions.html +39 -39
  396. package/dist/docs/reference/instructions.md +1 -1
  397. package/dist/docs/reference/limits.html +67 -0
  398. package/dist/docs/reference/limits.md +37 -0
  399. package/dist/docs/reference/memory.html +40 -40
  400. package/dist/docs/reference/memory.md +7 -7
  401. package/dist/docs/reference/playground.html +38 -38
  402. package/dist/docs/reference/playground.md +1 -1
  403. package/dist/docs/reference/project-layout.html +41 -41
  404. package/dist/docs/reference/project-layout.md +6 -6
  405. package/dist/docs/reference/prompt.html +39 -39
  406. package/dist/docs/reference/prompt.md +2 -2
  407. package/dist/docs/reference/schedules.html +42 -42
  408. package/dist/docs/reference/schedules.md +4 -4
  409. package/dist/docs/reference/sessions.html +39 -39
  410. package/dist/docs/reference/sessions.md +3 -3
  411. package/dist/docs/reference/skills.html +39 -39
  412. package/dist/docs/reference/skills.md +2 -2
  413. package/dist/docs/reference/subagents.html +39 -39
  414. package/dist/docs/reference/subagents.md +1 -1
  415. package/dist/docs/reference/tools.html +47 -47
  416. package/dist/docs/reference/tools.md +31 -21
  417. package/dist/docs/templates/agentic-owners.html +41 -41
  418. package/dist/docs/templates/agentic-owners.md +7 -7
  419. package/dist/docs/templates/security-reviewer.html +39 -39
  420. package/dist/docs/templates/security-reviewer.md +6 -6
  421. package/dist/docs/templates/thermo-quality-review.html +40 -40
  422. package/dist/docs/templates/thermo-quality-review.md +7 -7
  423. package/dist/docs/templates/thermo-review.html +40 -40
  424. package/dist/docs/templates/thermo-review.md +7 -7
  425. package/dist/docs/templates/triage.html +41 -41
  426. package/dist/docs/templates/triage.md +9 -9
  427. package/dist/docs/troubleshooting.html +38 -38
  428. package/dist/docs/troubleshooting.md +26 -24
  429. package/dist/evals/assertions.d.ts.map +1 -1
  430. package/dist/evals/assertions.js +2 -2
  431. package/dist/evals/expect.d.ts.map +1 -1
  432. package/dist/evals/expect.js +9 -1
  433. package/dist/evals/judge.js +2 -2
  434. package/dist/evals/loaders.d.ts +3 -3
  435. package/dist/evals/loaders.d.ts.map +1 -1
  436. package/dist/evals/loaders.js +6 -3
  437. package/dist/evals/matchers.d.ts +1 -1
  438. package/dist/evals/matchers.d.ts.map +1 -1
  439. package/dist/evals/matchers.js +40 -6
  440. package/dist/evals/reporters.d.ts +2 -2
  441. package/dist/evals/reporters.js +2 -2
  442. package/dist/evals/results.d.ts +1 -1
  443. package/dist/evals/results.js +1 -1
  444. package/dist/evals.d.ts +3 -3
  445. package/dist/evals.js +1 -1
  446. package/dist/executors.d.ts +1 -1
  447. package/dist/executors.d.ts.map +1 -1
  448. package/dist/executors.js +2 -2
  449. package/dist/extensions/cursor-cloud-agents/extension.d.ts +1 -1
  450. package/dist/extensions/cursor-cloud-agents/extension.js +1 -1
  451. package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -1
  452. package/dist/extensions/cursor-cloud-agents/lib/backend.js +13 -2
  453. package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.js +3 -3
  454. package/dist/extensions/improve/extension.d.ts +1 -1
  455. package/dist/extensions/improve/extension.js +1 -1
  456. package/dist/extensions/jev/extension.d.ts +13 -3
  457. package/dist/extensions/jev/extension.d.ts.map +1 -1
  458. package/dist/extensions/jev/extension.js +5 -1
  459. package/dist/extensions/jev/lib/evaluate.d.ts +33 -6
  460. package/dist/extensions/jev/lib/evaluate.d.ts.map +1 -1
  461. package/dist/extensions/jev/lib/evaluate.js +44 -11
  462. package/dist/extensions/jev/skills/gated-write.md +1 -1
  463. package/dist/extensions/slack-communication/extension.d.ts +1 -1
  464. package/dist/extensions/slack-communication/extension.js +1 -1
  465. package/dist/extensions/slack-communication/skills/slack-voice.js +1 -1
  466. package/dist/extensions/slack-communication/tools/post-file.d.ts.map +1 -1
  467. package/dist/extensions/slack-communication/tools/post-file.js +45 -2
  468. package/dist/extensions.d.ts +2 -2
  469. package/dist/extensions.d.ts.map +1 -1
  470. package/dist/extensions.js +7 -3
  471. package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
  472. package/dist/files-backends/cursor-hosted.js +5 -0
  473. package/dist/files-backends/local-fs.d.ts.map +1 -1
  474. package/dist/files-backends/local-fs.js +4 -3
  475. package/dist/filesystem.d.ts +24 -54
  476. package/dist/filesystem.d.ts.map +1 -1
  477. package/dist/filesystem.js +172 -104
  478. package/dist/hooks.d.ts +1 -1
  479. package/dist/hooks.js +1 -1
  480. package/dist/index.d.ts +11 -4
  481. package/dist/index.d.ts.map +1 -1
  482. package/dist/index.js +10 -3
  483. package/dist/internal/advertise-tools.d.ts +3 -3
  484. package/dist/internal/advertise-tools.d.ts.map +1 -1
  485. package/dist/internal/advertise-tools.js +9 -5
  486. package/dist/internal/artifacts-store.d.ts.map +1 -1
  487. package/dist/internal/artifacts-store.js +15 -6
  488. package/dist/internal/as-of.d.ts.map +1 -1
  489. package/dist/internal/as-of.js +4 -3
  490. package/dist/internal/authored-alias-hooks.d.ts +1 -20
  491. package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
  492. package/dist/internal/authored-alias-hooks.js +54 -7
  493. package/dist/internal/authored-loaders.d.ts +2 -2
  494. package/dist/internal/authored-loaders.d.ts.map +1 -1
  495. package/dist/internal/authored-loaders.js +38 -13
  496. package/dist/internal/brand.d.ts.map +1 -1
  497. package/dist/internal/brand.js +25 -2
  498. package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -1
  499. package/dist/internal/builtin-tools/artifacts.js +19 -3
  500. package/dist/internal/channel-dispatch.d.ts.map +1 -1
  501. package/dist/internal/channel-dispatch.js +1 -1
  502. package/dist/internal/channel-state.d.ts.map +1 -1
  503. package/dist/internal/channel-state.js +13 -8
  504. package/dist/internal/chat-client.d.ts.map +1 -1
  505. package/dist/internal/chat-client.js +14 -5
  506. package/dist/internal/cli/command.d.ts +134 -0
  507. package/dist/internal/cli/command.d.ts.map +1 -0
  508. package/dist/internal/cli/command.js +54 -0
  509. package/dist/internal/cli/commands/channels.d.ts +26 -0
  510. package/dist/internal/cli/commands/channels.d.ts.map +1 -0
  511. package/dist/internal/cli/commands/channels.js +524 -0
  512. package/dist/internal/cli/commands/develop.d.ts +15 -0
  513. package/dist/internal/cli/commands/develop.d.ts.map +1 -0
  514. package/dist/internal/cli/commands/develop.js +577 -0
  515. package/dist/internal/cli/commands/hosted.d.ts +22 -0
  516. package/dist/internal/cli/commands/hosted.d.ts.map +1 -0
  517. package/dist/internal/cli/commands/hosted.js +407 -0
  518. package/dist/internal/cli/commands/index.d.ts +4 -0
  519. package/dist/internal/cli/commands/index.d.ts.map +1 -0
  520. package/dist/internal/cli/commands/index.js +84 -0
  521. package/dist/internal/cli/commands/mcp.d.ts +6 -0
  522. package/dist/internal/cli/commands/mcp.d.ts.map +1 -0
  523. package/dist/internal/cli/commands/mcp.js +89 -0
  524. package/dist/internal/cli/commands/project.d.ts +5 -0
  525. package/dist/internal/cli/commands/project.d.ts.map +1 -0
  526. package/dist/internal/cli/commands/project.js +136 -0
  527. package/dist/internal/cli/commands/scaffold.d.ts +12 -0
  528. package/dist/internal/cli/commands/scaffold.d.ts.map +1 -0
  529. package/dist/internal/cli/commands/scaffold.js +282 -0
  530. package/dist/internal/cli/commands/serve.d.ts +11 -0
  531. package/dist/internal/cli/commands/serve.d.ts.map +1 -0
  532. package/dist/internal/cli/commands/serve.js +370 -0
  533. package/dist/internal/cli/commands/session.d.ts +7 -0
  534. package/dist/internal/cli/commands/session.d.ts.map +1 -0
  535. package/dist/internal/cli/commands/session.js +359 -0
  536. package/dist/internal/cli/dispatch.d.ts +46 -0
  537. package/dist/internal/cli/dispatch.d.ts.map +1 -0
  538. package/dist/internal/cli/dispatch.js +385 -0
  539. package/dist/internal/cli/errors.d.ts +51 -0
  540. package/dist/internal/cli/errors.d.ts.map +1 -0
  541. package/dist/internal/cli/errors.js +142 -0
  542. package/dist/internal/cli/flags.d.ts +186 -0
  543. package/dist/internal/cli/flags.d.ts.map +1 -0
  544. package/dist/internal/cli/flags.js +167 -0
  545. package/dist/internal/cli/help-command.d.ts +7 -0
  546. package/dist/internal/cli/help-command.d.ts.map +1 -0
  547. package/dist/internal/cli/help-command.js +60 -0
  548. package/dist/internal/cli/help.d.ts +63 -0
  549. package/dist/internal/cli/help.d.ts.map +1 -0
  550. package/dist/internal/cli/help.js +203 -0
  551. package/dist/internal/cli/io.d.ts +11 -0
  552. package/dist/internal/cli/io.d.ts.map +1 -0
  553. package/dist/internal/cli/io.js +33 -0
  554. package/dist/internal/cli/output.d.ts +54 -0
  555. package/dist/internal/cli/output.d.ts.map +1 -0
  556. package/dist/internal/cli/output.js +132 -0
  557. package/dist/internal/cli/value-kinds.d.ts +20 -0
  558. package/dist/internal/cli/value-kinds.d.ts.map +1 -0
  559. package/dist/internal/cli/value-kinds.js +70 -0
  560. package/dist/internal/cli-ax.d.ts +35 -20
  561. package/dist/internal/cli-ax.d.ts.map +1 -1
  562. package/dist/internal/cli-ax.js +439 -365
  563. package/dist/internal/cli-convert-automation.d.ts +3 -1
  564. package/dist/internal/cli-convert-automation.d.ts.map +1 -1
  565. package/dist/internal/cli-convert-automation.js +52 -20
  566. package/dist/internal/cli-cursor.js +5 -1
  567. package/dist/internal/cli-deploy.d.ts +23 -9
  568. package/dist/internal/cli-deploy.d.ts.map +1 -1
  569. package/dist/internal/cli-deploy.js +234 -508
  570. package/dist/internal/cli-docs.d.ts +1 -1
  571. package/dist/internal/cli-docs.js +3 -2
  572. package/dist/internal/cli-github.js +1 -0
  573. package/dist/internal/cli-images.d.ts.map +1 -1
  574. package/dist/internal/cli-images.js +44 -14
  575. package/dist/internal/cli-invocation.d.ts +22 -0
  576. package/dist/internal/cli-invocation.d.ts.map +1 -0
  577. package/dist/internal/cli-invocation.js +86 -0
  578. package/dist/internal/cli-manifest.d.ts +4 -1
  579. package/dist/internal/cli-manifest.d.ts.map +1 -1
  580. package/dist/internal/cli-manifest.js +16 -4
  581. package/dist/internal/cli-mcp-oauth.d.ts +7 -11
  582. package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
  583. package/dist/internal/cli-mcp-oauth.js +24 -104
  584. package/dist/internal/cli-mcp.d.ts +17 -28
  585. package/dist/internal/cli-mcp.d.ts.map +1 -1
  586. package/dist/internal/cli-mcp.js +64 -304
  587. package/dist/internal/cli-migrate.d.ts +3 -1
  588. package/dist/internal/cli-migrate.d.ts.map +1 -1
  589. package/dist/internal/cli-migrate.js +43 -15
  590. package/dist/internal/cli-pagerduty.d.ts +1 -1
  591. package/dist/internal/cli-pagerduty.js +1 -1
  592. package/dist/internal/cli-skills.d.ts +30 -2
  593. package/dist/internal/cli-skills.d.ts.map +1 -1
  594. package/dist/internal/cli-skills.js +63 -3
  595. package/dist/internal/cli-slack-context.d.ts +91 -0
  596. package/dist/internal/cli-slack-context.d.ts.map +1 -0
  597. package/dist/internal/cli-slack-context.js +112 -0
  598. package/dist/internal/cli-slack-manual.d.ts +2 -0
  599. package/dist/internal/cli-slack-manual.d.ts.map +1 -1
  600. package/dist/internal/cli-slack-manual.js +12 -0
  601. package/dist/internal/cli-slack.d.ts +1 -49
  602. package/dist/internal/cli-slack.d.ts.map +1 -1
  603. package/dist/internal/cli-slack.js +27 -147
  604. package/dist/internal/cloud-merge.d.ts +2 -4
  605. package/dist/internal/cloud-merge.d.ts.map +1 -1
  606. package/dist/internal/cloud-merge.js +2 -7
  607. package/dist/internal/continuation-channel.d.ts.map +1 -1
  608. package/dist/internal/continuation-channel.js +10 -22
  609. package/dist/internal/continuation-identity.d.ts +33 -12
  610. package/dist/internal/continuation-identity.d.ts.map +1 -1
  611. package/dist/internal/continuation-identity.js +161 -43
  612. package/dist/internal/continuation-registration.d.ts +26 -0
  613. package/dist/internal/continuation-registration.d.ts.map +1 -0
  614. package/dist/internal/continuation-registration.js +35 -0
  615. package/dist/internal/conversation-mirror.d.ts.map +1 -1
  616. package/dist/internal/conversation-mirror.js +23 -14
  617. package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -1
  618. package/dist/internal/convert-automation/convert-workflow.js +28 -22
  619. package/dist/internal/convert-automation/types.d.ts +1 -1
  620. package/dist/internal/convert-automation/types.js +1 -1
  621. package/dist/internal/cursor/account-mcp.js +1 -1
  622. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  623. package/dist/internal/cursor/backend-client.js +6 -8
  624. package/dist/internal/cursor/bound-secret-file.d.ts.map +1 -1
  625. package/dist/internal/cursor/bound-secret-file.js +2 -1
  626. package/dist/internal/cursor/credentials.d.ts +4 -17
  627. package/dist/internal/cursor/credentials.d.ts.map +1 -1
  628. package/dist/internal/cursor/credentials.js +11 -27
  629. package/dist/internal/cursor/session-token.d.ts.map +1 -1
  630. package/dist/internal/cursor/session-token.js +3 -4
  631. package/dist/internal/cursor/store-api-client.d.ts.map +1 -1
  632. package/dist/internal/cursor/store-api-client.js +3 -2
  633. package/dist/internal/cursor-agent-template.d.ts +1 -1
  634. package/dist/internal/cursor-agent-template.d.ts.map +1 -1
  635. package/dist/internal/cursor-agent-template.js +2 -2
  636. package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
  637. package/dist/internal/cursor-deployment-relay.js +24 -2
  638. package/dist/internal/cursor-event-relay.d.ts.map +1 -1
  639. package/dist/internal/cursor-event-relay.js +26 -2
  640. package/dist/internal/cursor-relay-core.d.ts.map +1 -1
  641. package/dist/internal/cursor-relay-core.js +22 -3
  642. package/dist/internal/deploy-client.d.ts +104 -94
  643. package/dist/internal/deploy-client.d.ts.map +1 -1
  644. package/dist/internal/deploy-client.js +143 -178
  645. package/dist/internal/deploy-manifest.d.ts +2 -2
  646. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  647. package/dist/internal/deploy-manifest.js +6 -6
  648. package/dist/internal/describe-error.d.ts +4 -0
  649. package/dist/internal/describe-error.d.ts.map +1 -1
  650. package/dist/internal/describe-error.js +20 -0
  651. package/dist/internal/discovery/agent-config.d.ts +1 -5
  652. package/dist/internal/discovery/agent-config.d.ts.map +1 -1
  653. package/dist/internal/discovery/agent-config.js +5 -11
  654. package/dist/internal/discovery/agent.d.ts.map +1 -1
  655. package/dist/internal/discovery/agent.js +24 -30
  656. package/dist/internal/discovery/channels.d.ts.map +1 -1
  657. package/dist/internal/discovery/channels.js +2 -0
  658. package/dist/internal/discovery/connections.d.ts.map +1 -1
  659. package/dist/internal/discovery/connections.js +6 -4
  660. package/dist/internal/discovery/context.d.ts.map +1 -1
  661. package/dist/internal/discovery/context.js +6 -1
  662. package/dist/internal/discovery/extension-overlay.d.ts +1 -1
  663. package/dist/internal/discovery/extension-overlay.d.ts.map +1 -1
  664. package/dist/internal/discovery/extension-overlay.js +1 -0
  665. package/dist/internal/discovery/extensions.d.ts.map +1 -1
  666. package/dist/internal/discovery/extensions.js +12 -5
  667. package/dist/internal/discovery/fs.d.ts.map +1 -1
  668. package/dist/internal/discovery/fs.js +2 -1
  669. package/dist/internal/discovery/hooks.d.ts.map +1 -1
  670. package/dist/internal/discovery/hooks.js +1 -0
  671. package/dist/internal/discovery/info.d.ts.map +1 -1
  672. package/dist/internal/discovery/info.js +0 -3
  673. package/dist/internal/discovery/instructions.d.ts.map +1 -1
  674. package/dist/internal/discovery/instructions.js +4 -1
  675. package/dist/internal/discovery/instrumentation.js +1 -1
  676. package/dist/internal/discovery/modules.d.ts.map +1 -1
  677. package/dist/internal/discovery/modules.js +4 -1
  678. package/dist/internal/discovery/project.js +1 -1
  679. package/dist/internal/discovery/reminders.d.ts.map +1 -1
  680. package/dist/internal/discovery/reminders.js +1 -0
  681. package/dist/internal/discovery/runtime.d.ts +0 -16
  682. package/dist/internal/discovery/runtime.d.ts.map +1 -1
  683. package/dist/internal/discovery/runtime.js +2 -47
  684. package/dist/internal/discovery/schedules.d.ts.map +1 -1
  685. package/dist/internal/discovery/schedules.js +1 -0
  686. package/dist/internal/discovery/services.d.ts.map +1 -1
  687. package/dist/internal/discovery/services.js +3 -1
  688. package/dist/internal/discovery/skills.d.ts.map +1 -1
  689. package/dist/internal/discovery/skills.js +1 -0
  690. package/dist/internal/discovery/tools.d.ts +1 -1
  691. package/dist/internal/discovery/tools.d.ts.map +1 -1
  692. package/dist/internal/discovery/tools.js +3 -1
  693. package/dist/internal/discovery.d.ts +1 -1
  694. package/dist/internal/discovery.d.ts.map +1 -1
  695. package/dist/internal/discovery.js +1 -1
  696. package/dist/internal/distribution.d.ts +9 -14
  697. package/dist/internal/distribution.d.ts.map +1 -1
  698. package/dist/internal/distribution.js +54 -18
  699. package/dist/internal/docs-site.d.ts.map +1 -1
  700. package/dist/internal/docs-site.js +15 -2
  701. package/dist/internal/dry-run.d.ts +32 -0
  702. package/dist/internal/dry-run.d.ts.map +1 -0
  703. package/dist/internal/dry-run.js +62 -0
  704. package/dist/internal/duration.d.ts.map +1 -1
  705. package/dist/internal/duration.js +1 -0
  706. package/dist/internal/estimate-cost.d.ts.map +1 -1
  707. package/dist/internal/estimate-cost.js +12 -5
  708. package/dist/internal/eval-run-store.d.ts.map +1 -1
  709. package/dist/internal/eval-run-store.js +6 -5
  710. package/dist/internal/eval-runner.d.ts +0 -2
  711. package/dist/internal/eval-runner.d.ts.map +1 -1
  712. package/dist/internal/eval-runner.js +3 -3
  713. package/dist/internal/evals-client.d.ts.map +1 -1
  714. package/dist/internal/evals-client.js +60 -15
  715. package/dist/internal/event-log.d.ts.map +1 -1
  716. package/dist/internal/event-log.js +3 -11
  717. package/dist/internal/event-mapper.d.ts.map +1 -1
  718. package/dist/internal/event-mapper.js +33 -15
  719. package/dist/internal/expected-delivery-failure.d.ts.map +1 -1
  720. package/dist/internal/expected-delivery-failure.js +5 -4
  721. package/dist/internal/fetch-text.d.ts +8 -0
  722. package/dist/internal/fetch-text.d.ts.map +1 -0
  723. package/dist/internal/fetch-text.js +32 -0
  724. package/dist/internal/filesystem/errors.d.ts.map +1 -1
  725. package/dist/internal/filesystem/errors.js +8 -0
  726. package/dist/internal/filesystem/scratch.js +1 -4
  727. package/dist/internal/filesystem/sdk-schemas.d.ts +19 -19
  728. package/dist/internal/filesystem/sdk-schemas.d.ts.map +1 -1
  729. package/dist/internal/filesystem/sdk-schemas.js +15 -21
  730. package/dist/internal/filesystem/tools.d.ts +15 -4
  731. package/dist/internal/filesystem/tools.d.ts.map +1 -1
  732. package/dist/internal/filesystem/tools.js +33 -47
  733. package/dist/internal/filesystem/walk.d.ts.map +1 -1
  734. package/dist/internal/filesystem/walk.js +4 -0
  735. package/dist/internal/framework-file-storage.d.ts.map +1 -1
  736. package/dist/internal/framework-file-storage.js +2 -1
  737. package/dist/internal/frontmatter.d.ts.map +1 -1
  738. package/dist/internal/frontmatter.js +5 -1
  739. package/dist/internal/github-fanout.js +2 -1
  740. package/dist/internal/guest-network.d.ts.map +1 -1
  741. package/dist/internal/guest-network.js +6 -0
  742. package/dist/internal/handleAgentServeTrigger.d.ts +8 -0
  743. package/dist/internal/handleAgentServeTrigger.d.ts.map +1 -1
  744. package/dist/internal/handleAgentServeTrigger.js +27 -1
  745. package/dist/internal/host-kv.d.ts.map +1 -1
  746. package/dist/internal/host-kv.js +4 -2
  747. package/dist/internal/host-otel.d.ts.map +1 -1
  748. package/dist/internal/host-otel.js +2 -8
  749. package/dist/internal/host-platforms.d.ts.map +1 -1
  750. package/dist/internal/host-platforms.js +17 -10
  751. package/dist/internal/hosted-catch-protocol.d.ts.map +1 -1
  752. package/dist/internal/hosted-catch-protocol.js +26 -9
  753. package/dist/internal/hosted-catch.d.ts +13 -10
  754. package/dist/internal/hosted-catch.d.ts.map +1 -1
  755. package/dist/internal/hosted-catch.js +23 -11
  756. package/dist/internal/hosted-delivery-protocol.d.ts +1 -1
  757. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  758. package/dist/internal/hosted-delivery-protocol.js +75 -45
  759. package/dist/internal/hosted-delivery.d.ts +1 -2
  760. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  761. package/dist/internal/hosted-delivery.js +27 -32
  762. package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
  763. package/dist/internal/hosted-execution-diag.js +11 -13
  764. package/dist/internal/hosted-execution-flush.js +1 -1
  765. package/dist/internal/hosted-execution-latency.d.ts.map +1 -1
  766. package/dist/internal/hosted-execution-latency.js +12 -1
  767. package/dist/internal/hosted-hints.d.ts +16 -0
  768. package/dist/internal/hosted-hints.d.ts.map +1 -0
  769. package/dist/internal/hosted-hints.js +23 -0
  770. package/dist/internal/hosted-managed-automation.d.ts.map +1 -1
  771. package/dist/internal/hosted-managed-automation.js +1 -0
  772. package/dist/internal/hosted-session-fixture.d.ts +26 -0
  773. package/dist/internal/hosted-session-fixture.d.ts.map +1 -0
  774. package/dist/internal/hosted-session-fixture.js +34 -0
  775. package/dist/internal/hosted-session-view.d.ts +48 -0
  776. package/dist/internal/hosted-session-view.d.ts.map +1 -0
  777. package/dist/internal/hosted-session-view.js +305 -0
  778. package/dist/internal/http-channel.d.ts.map +1 -1
  779. package/dist/internal/http-channel.js +8 -5
  780. package/dist/internal/http-control-plane-session.d.ts.map +1 -1
  781. package/dist/internal/http-control-plane-session.js +8 -9
  782. package/dist/internal/init-interview.js +2 -2
  783. package/dist/internal/init-project.d.ts +14 -16
  784. package/dist/internal/init-project.d.ts.map +1 -1
  785. package/dist/internal/init-project.js +63 -27
  786. package/dist/internal/init-scaffold.d.ts +2 -1
  787. package/dist/internal/init-scaffold.d.ts.map +1 -1
  788. package/dist/internal/init-scaffold.js +22 -9
  789. package/dist/internal/inline-stdio-define-stub.d.ts +1 -1
  790. package/dist/internal/inline-stdio-define-stub.d.ts.map +1 -1
  791. package/dist/internal/inline-stdio-define-stub.js +1 -1
  792. package/dist/internal/inline-stdio-mcp.d.ts.map +1 -1
  793. package/dist/internal/inline-stdio-mcp.js +31 -8
  794. package/dist/internal/install-cursor-skills.d.ts +22 -15
  795. package/dist/internal/install-cursor-skills.d.ts.map +1 -1
  796. package/dist/internal/install-cursor-skills.js +66 -31
  797. package/dist/internal/interview/agent-questions.d.ts.map +1 -1
  798. package/dist/internal/interview/agent-questions.js +4 -1
  799. package/dist/internal/interview/question.d.ts +1 -1
  800. package/dist/internal/interview/question.js +1 -1
  801. package/dist/internal/json-schema.d.ts +3 -2
  802. package/dist/internal/json-schema.d.ts.map +1 -1
  803. package/dist/internal/json-schema.js +83 -3
  804. package/dist/internal/json-value.d.ts +20 -0
  805. package/dist/internal/json-value.d.ts.map +1 -0
  806. package/dist/internal/json-value.js +56 -0
  807. package/dist/internal/logs-client.d.ts +4 -25
  808. package/dist/internal/logs-client.d.ts.map +1 -1
  809. package/dist/internal/logs-client.js +17 -174
  810. package/dist/internal/mcp-endpoint.d.ts +1 -1
  811. package/dist/internal/mcp-endpoint.js +2 -1
  812. package/dist/internal/mcp-host.d.ts.map +1 -1
  813. package/dist/internal/mcp-host.js +22 -9
  814. package/dist/internal/mcp-oauth.d.ts +2 -2
  815. package/dist/internal/mcp-oauth.d.ts.map +1 -1
  816. package/dist/internal/mcp-oauth.js +61 -8
  817. package/dist/internal/named-webhook-secret.d.ts +12 -0
  818. package/dist/internal/named-webhook-secret.d.ts.map +1 -1
  819. package/dist/internal/named-webhook-secret.js +18 -0
  820. package/dist/internal/otel/bind-telemetry.d.ts +26 -0
  821. package/dist/internal/otel/bind-telemetry.d.ts.map +1 -0
  822. package/dist/internal/otel/bind-telemetry.js +36 -0
  823. package/dist/internal/otel/collector.d.ts.map +1 -1
  824. package/dist/internal/otel/collector.js +94 -42
  825. package/dist/internal/otel/config.d.ts.map +1 -1
  826. package/dist/internal/otel/config.js +4 -3
  827. package/dist/internal/otel/conversation-span-processor.d.ts.map +1 -1
  828. package/dist/internal/otel/conversation-span-processor.js +5 -2
  829. package/dist/internal/otel/customer.d.ts +1 -5
  830. package/dist/internal/otel/customer.d.ts.map +1 -1
  831. package/dist/internal/otel/customer.js +35 -13
  832. package/dist/internal/otel/http.d.ts +1 -1
  833. package/dist/internal/otel/http.d.ts.map +1 -1
  834. package/dist/internal/otel/http.js +5 -3
  835. package/dist/internal/otel/propagation.d.ts +3 -2
  836. package/dist/internal/otel/propagation.d.ts.map +1 -1
  837. package/dist/internal/otel/propagation.js +3 -2
  838. package/dist/internal/otel/reserved-attributes.d.ts +8 -0
  839. package/dist/internal/otel/reserved-attributes.d.ts.map +1 -0
  840. package/dist/internal/otel/reserved-attributes.js +24 -0
  841. package/dist/internal/otel/runtime.d.ts.map +1 -1
  842. package/dist/internal/otel/runtime.js +9 -2
  843. package/dist/internal/otel/session-telemetry.d.ts +22 -0
  844. package/dist/internal/otel/session-telemetry.d.ts.map +1 -0
  845. package/dist/internal/otel/session-telemetry.js +30 -0
  846. package/dist/internal/otel/telemetry-attributes.d.ts +7 -0
  847. package/dist/internal/otel/telemetry-attributes.d.ts.map +1 -0
  848. package/dist/internal/otel/telemetry-attributes.js +35 -0
  849. package/dist/internal/otel/telemetry-processor.d.ts +7 -0
  850. package/dist/internal/otel/telemetry-processor.d.ts.map +1 -0
  851. package/dist/internal/otel/telemetry-processor.js +47 -0
  852. package/dist/internal/otel/tool-error-class.d.ts.map +1 -1
  853. package/dist/internal/otel/tool-error-class.js +4 -0
  854. package/dist/internal/package-inline-stdio.d.ts.map +1 -1
  855. package/dist/internal/package-inline-stdio.js +2 -2
  856. package/dist/internal/peer-connections.js +1 -1
  857. package/dist/internal/persistent-stage-log-mirror.js +2 -5
  858. package/dist/internal/platform-timers.d.ts.map +1 -1
  859. package/dist/internal/platform-timers.js +32 -1
  860. package/dist/internal/playground/toolchain.d.ts.map +1 -1
  861. package/dist/internal/playground/toolchain.js +16 -3
  862. package/dist/internal/playground-proxy.d.ts +6 -27
  863. package/dist/internal/playground-proxy.d.ts.map +1 -1
  864. package/dist/internal/playground-proxy.js +25 -83
  865. package/dist/internal/private-file.d.ts +2 -0
  866. package/dist/internal/private-file.d.ts.map +1 -0
  867. package/dist/internal/private-file.js +8 -0
  868. package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -1
  869. package/dist/internal/reminder-control-plane-protocol.js +4 -2
  870. package/dist/internal/reminder-runner.d.ts.map +1 -1
  871. package/dist/internal/reminder-runner.js +12 -25
  872. package/dist/internal/reminder-schedule.js +1 -1
  873. package/dist/internal/reminder-store.d.ts.map +1 -1
  874. package/dist/internal/reminder-store.js +16 -21
  875. package/dist/internal/request-headers.d.ts +2 -2
  876. package/dist/internal/request-headers.d.ts.map +1 -1
  877. package/dist/internal/request-headers.js +1 -1
  878. package/dist/internal/resolve-prod-target.d.ts +9 -65
  879. package/dist/internal/resolve-prod-target.d.ts.map +1 -1
  880. package/dist/internal/resolve-prod-target.js +20 -187
  881. package/dist/internal/resolved-connections.js +1 -1
  882. package/dist/internal/{factory-resource-channel.d.ts → resource-channel.d.ts} +10 -10
  883. package/dist/internal/resource-channel.d.ts.map +1 -0
  884. package/dist/internal/{factory-resource-channel.js → resource-channel.js} +9 -7
  885. package/dist/internal/run-client.d.ts.map +1 -1
  886. package/dist/internal/run-client.js +4 -1
  887. package/dist/internal/sdk-runner.d.ts +2 -2
  888. package/dist/internal/sdk-runner.d.ts.map +1 -1
  889. package/dist/internal/sdk-runner.js +19 -16
  890. package/dist/internal/sdk-subagent-inherit-support.d.ts.map +1 -1
  891. package/dist/internal/sdk-subagent-inherit-support.js +3 -2
  892. package/dist/internal/serve-restart.d.ts +3 -0
  893. package/dist/internal/serve-restart.d.ts.map +1 -1
  894. package/dist/internal/serve-restart.js +8 -4
  895. package/dist/internal/server.d.ts +5 -1
  896. package/dist/internal/server.d.ts.map +1 -1
  897. package/dist/internal/server.js +71 -64
  898. package/dist/internal/session-cost.d.ts +4 -4
  899. package/dist/internal/session-cost.d.ts.map +1 -1
  900. package/dist/internal/session-cost.js +5 -5
  901. package/dist/internal/session-engine.d.ts +22 -8
  902. package/dist/internal/session-engine.d.ts.map +1 -1
  903. package/dist/internal/session-engine.js +170 -75
  904. package/dist/internal/session-links.js +2 -1
  905. package/dist/internal/session-live-publisher.d.ts +0 -7
  906. package/dist/internal/session-live-publisher.d.ts.map +1 -1
  907. package/dist/internal/session-live-publisher.js +20 -7
  908. package/dist/internal/session-run-log.d.ts.map +1 -1
  909. package/dist/internal/session-run-log.js +19 -5
  910. package/dist/internal/session-store.d.ts.map +1 -1
  911. package/dist/internal/session-store.js +17 -3
  912. package/dist/internal/sessions-client.d.ts +2 -0
  913. package/dist/internal/sessions-client.d.ts.map +1 -1
  914. package/dist/internal/sessions-client.js +44 -10
  915. package/dist/internal/shallow-clone.d.ts +258 -0
  916. package/dist/internal/shallow-clone.d.ts.map +1 -0
  917. package/dist/internal/shallow-clone.js +644 -0
  918. package/dist/internal/slack-bot-scopes.d.ts +3 -0
  919. package/dist/internal/slack-bot-scopes.d.ts.map +1 -0
  920. package/dist/internal/slack-bot-scopes.js +2 -0
  921. package/dist/internal/slack-manifest-opt-in.d.ts +26 -0
  922. package/dist/internal/slack-manifest-opt-in.d.ts.map +1 -0
  923. package/dist/internal/slack-manifest-opt-in.js +63 -0
  924. package/dist/internal/slack-provision-client.d.ts +8 -24
  925. package/dist/internal/slack-provision-client.d.ts.map +1 -1
  926. package/dist/internal/slack-provision-client.js +21 -20
  927. package/dist/internal/slack-thread-key.d.ts +8 -3
  928. package/dist/internal/slack-thread-key.d.ts.map +1 -1
  929. package/dist/internal/slack-thread-key.js +6 -6
  930. package/dist/internal/sqlite-experimental-warning.js +1 -1
  931. package/dist/internal/start-log-store.d.ts.map +1 -1
  932. package/dist/internal/start-log-store.js +2 -5
  933. package/dist/internal/storage-coordinator.d.ts.map +1 -1
  934. package/dist/internal/storage-coordinator.js +49 -20
  935. package/dist/internal/stored-eval-run.d.ts +17 -0
  936. package/dist/internal/stored-eval-run.d.ts.map +1 -0
  937. package/dist/internal/stored-eval-run.js +305 -0
  938. package/dist/internal/stream-progress.d.ts.map +1 -1
  939. package/dist/internal/stream-progress.js +1 -1
  940. package/dist/internal/tcp-address.d.ts +4 -0
  941. package/dist/internal/tcp-address.d.ts.map +1 -0
  942. package/dist/internal/tcp-address.js +8 -0
  943. package/dist/internal/terminal-style.js +2 -2
  944. package/dist/internal/testing/pagerduty-continuation-fixtures.d.ts +1 -1
  945. package/dist/internal/testing/pagerduty-continuation-fixtures.js +1 -1
  946. package/dist/internal/testing/scm-continuation-fixtures.d.ts +1 -1
  947. package/dist/internal/testing/scm-continuation-fixtures.js +1 -1
  948. package/dist/internal/testing/slack-continuation-fixtures.d.ts +12 -6
  949. package/dist/internal/testing/slack-continuation-fixtures.d.ts.map +1 -1
  950. package/dist/internal/testing/slack-continuation-fixtures.js +74 -3
  951. package/dist/internal/tool-call-retry.d.ts +35 -7
  952. package/dist/internal/tool-call-retry.d.ts.map +1 -1
  953. package/dist/internal/tool-call-retry.js +108 -108
  954. package/dist/internal/tool-catalog.d.ts.map +1 -1
  955. package/dist/internal/tool-catalog.js +7 -2
  956. package/dist/internal/tool-policy.d.ts +20 -7
  957. package/dist/internal/tool-policy.d.ts.map +1 -1
  958. package/dist/internal/tool-policy.js +39 -11
  959. package/dist/internal/tool-result.d.ts +0 -5
  960. package/dist/internal/tool-result.d.ts.map +1 -1
  961. package/dist/internal/tool-result.js +26 -6
  962. package/dist/internal/trajectory.d.ts.map +1 -1
  963. package/dist/internal/trajectory.js +5 -1
  964. package/dist/internal/turn-outbox.d.ts.map +1 -1
  965. package/dist/internal/turn-outbox.js +1 -0
  966. package/dist/internal/update-check.d.ts +2 -0
  967. package/dist/internal/update-check.d.ts.map +1 -1
  968. package/dist/internal/update-check.js +4 -0
  969. package/dist/internal/workspace.d.ts +3 -4
  970. package/dist/internal/workspace.d.ts.map +1 -1
  971. package/dist/internal/workspace.js +5 -5
  972. package/dist/kv/memory-kv.d.ts +1 -1
  973. package/dist/kv/memory-kv.js +1 -1
  974. package/dist/kv.d.ts +9 -2
  975. package/dist/kv.d.ts.map +1 -1
  976. package/dist/kv.js +10 -2
  977. package/dist/memory.d.ts +1 -1
  978. package/dist/memory.js +1 -1
  979. package/dist/otel-public.d.ts +2 -1
  980. package/dist/otel-public.d.ts.map +1 -1
  981. package/dist/otel-public.js +2 -1
  982. package/dist/otel.d.ts.map +1 -1
  983. package/dist/otel.js +6 -2
  984. package/dist/playground/assets/cursor-icons-16-QUmxS7q3.woff2 +0 -0
  985. package/dist/playground/assets/index-Cl9zvmmf.js +62 -0
  986. package/dist/playground/assets/index-F8b5WvWi.css +1 -0
  987. package/dist/playground/index.html +2 -2
  988. package/dist/prompt.d.ts +1 -1
  989. package/dist/prompt.js +1 -1
  990. package/dist/public-deprecated.d.ts +11 -12
  991. package/dist/public-deprecated.d.ts.map +1 -1
  992. package/dist/public-deprecated.js +8 -9
  993. package/dist/reminders.d.ts +2 -2
  994. package/dist/reminders.js +2 -2
  995. package/dist/schedules.d.ts +1 -1
  996. package/dist/schedules.js +1 -1
  997. package/dist/scm.d.ts +2 -0
  998. package/dist/scm.d.ts.map +1 -0
  999. package/dist/scm.js +1 -0
  1000. package/dist/skills.d.ts +1 -1
  1001. package/dist/skills.js +1 -1
  1002. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  1003. package/dist/storage-backends/cursor-hosted.js +5 -3
  1004. package/dist/storage-backends/file-kv.d.ts +3 -2
  1005. package/dist/storage-backends/file-kv.d.ts.map +1 -1
  1006. package/dist/storage-backends/file-kv.js +20 -8
  1007. package/dist/storage.d.ts +2 -3
  1008. package/dist/storage.d.ts.map +1 -1
  1009. package/dist/storage.js +9 -5
  1010. package/dist/telemetry.d.ts +12 -0
  1011. package/dist/telemetry.d.ts.map +1 -0
  1012. package/dist/telemetry.js +11 -0
  1013. package/dist/tools.d.ts +1 -1
  1014. package/dist/tools.d.ts.map +1 -1
  1015. package/dist/tools.js +2 -1
  1016. package/dist/types.d.ts +59 -46
  1017. package/dist/types.d.ts.map +1 -1
  1018. package/dist/types.js +4 -4
  1019. package/docs/README.md +33 -33
  1020. package/docs/building-with-agents.md +16 -16
  1021. package/docs/changelog.md +58 -12
  1022. package/docs/deployment.md +116 -54
  1023. package/docs/evals.md +14 -12
  1024. package/docs/guides/agent-to-agent.md +8 -8
  1025. package/docs/guides/bitbucket.md +5 -5
  1026. package/docs/guides/cloud-agents.md +4 -4
  1027. package/docs/guides/convert-automation.md +17 -16
  1028. package/docs/guides/github.md +16 -16
  1029. package/docs/guides/gitlab.md +5 -5
  1030. package/docs/guides/hooks.md +3 -3
  1031. package/docs/guides/improve.md +2 -2
  1032. package/docs/guides/jev.md +15 -10
  1033. package/docs/guides/mcp-oauth.md +9 -10
  1034. package/docs/guides/migrate.md +35 -28
  1035. package/docs/guides/opentelemetry.md +61 -130
  1036. package/docs/guides/pagerduty.md +18 -18
  1037. package/docs/guides/slack.md +85 -15
  1038. package/docs/guides/webhooks.md +61 -3
  1039. package/docs/hillclimbing.md +2 -2
  1040. package/docs/quickstart.md +26 -22
  1041. package/docs/reference/access.md +27 -0
  1042. package/docs/reference/agent-config.md +54 -12
  1043. package/docs/reference/artifacts.md +2 -2
  1044. package/docs/reference/channels.md +29 -9
  1045. package/docs/reference/cli.md +364 -367
  1046. package/docs/reference/connections.md +9 -9
  1047. package/docs/reference/evals.md +48 -13
  1048. package/docs/reference/extensions.md +12 -12
  1049. package/docs/reference/hooks.md +11 -11
  1050. package/docs/reference/http-api.md +1 -1
  1051. package/docs/reference/instructions.md +1 -1
  1052. package/docs/reference/limits.md +42 -0
  1053. package/docs/reference/memory.md +7 -7
  1054. package/docs/reference/playground.md +1 -1
  1055. package/docs/reference/project-layout.md +6 -6
  1056. package/docs/reference/prompt.md +2 -2
  1057. package/docs/reference/schedules.md +4 -4
  1058. package/docs/reference/sessions.md +3 -3
  1059. package/docs/reference/skills.md +2 -2
  1060. package/docs/reference/subagents.md +1 -1
  1061. package/docs/reference/tools.md +31 -21
  1062. package/docs/templates/agentic-owners.md +7 -7
  1063. package/docs/templates/security-reviewer.md +6 -6
  1064. package/docs/templates/thermo-quality-review.md +7 -7
  1065. package/docs/templates/thermo-review.md +7 -7
  1066. package/docs/templates/triage.md +9 -9
  1067. package/docs/troubleshooting.md +26 -24
  1068. package/package.json +52 -99
  1069. package/scripts/install-cursor-skills.mjs +2 -2
  1070. package/skills/cli/SKILL.md +125 -0
  1071. package/skills/create-agent/SKILL.md +29 -26
  1072. package/skills/debug/SKILL.md +6 -6
  1073. package/skills/deploy/SKILL.md +47 -44
  1074. package/skills/evals/SKILL.md +13 -13
  1075. package/skills/framework-map/SKILL.md +9 -8
  1076. package/skills/github/SKILL.md +10 -10
  1077. package/skills/hillclimb/SKILL.md +6 -6
  1078. package/skills/mcp-auth/SKILL.md +3 -3
  1079. package/skills/migrate-v2/SKILL.md +67 -70
  1080. package/skills/otel/SKILL.md +36 -6
  1081. package/skills/setup-slack/SKILL.md +11 -11
  1082. package/templates/agentic-owners/README.md +6 -6
  1083. package/templates/agentic-owners/bot/agent.ts +1 -1
  1084. package/templates/agentic-owners/bot/channels/github.ts +1 -1
  1085. package/templates/agentic-owners/bot/lib/github.ts +2 -2
  1086. package/templates/agentic-owners/bot/lib/owners/parse.ts +1 -1
  1087. package/templates/agentic-owners/bot/lib/owners/policyMode.ts +6 -2
  1088. package/templates/agentic-owners/bot/lib/review.ts +7 -3
  1089. package/templates/agentic-owners/bot/tools/record_review.ts +3 -3
  1090. package/templates/agentic-owners/evals/evals.config.ts +1 -1
  1091. package/templates/agentic-owners/evals/owners.eval.ts +1 -1
  1092. package/templates/agentic-owners/package.json +3 -3
  1093. package/templates/agents-md/README.md +5 -5
  1094. package/templates/agents-md/bot/agent.ts +1 -1
  1095. package/templates/agents-md/bot/channels/github.ts +1 -1
  1096. package/templates/agents-md/bot/channels/queue.ts +5 -3
  1097. package/templates/agents-md/bot/channels/slack.ts +1 -1
  1098. package/templates/agents-md/bot/lib/collect.ts +1 -1
  1099. package/templates/agents-md/bot/schedules/weekly.ts +6 -6
  1100. package/templates/agents-md/bot/tools/apply_agents.ts +2 -2
  1101. package/templates/agents-md/evals/agents.eval.ts +1 -1
  1102. package/templates/agents-md/evals/evals.config.ts +1 -1
  1103. package/templates/agents-md/package.json +3 -3
  1104. package/templates/code-wiki/README.md +4 -4
  1105. package/templates/code-wiki/bot/agent.ts +1 -1
  1106. package/templates/code-wiki/bot/channels/github.ts +3 -3
  1107. package/templates/code-wiki/bot/tools/apply_wiki.ts +3 -3
  1108. package/templates/code-wiki/evals/evals.config.ts +1 -1
  1109. package/templates/code-wiki/evals/wiki.eval.ts +1 -1
  1110. package/templates/code-wiki/package.json +3 -3
  1111. package/templates/demo/README.md +4 -4
  1112. package/templates/demo/bot/agent.ts +1 -1
  1113. package/templates/demo/bot/channels/github.ts +7 -3
  1114. package/templates/demo/bot/channels/queue.ts +5 -5
  1115. package/templates/demo/bot/lib/collect.ts +2 -2
  1116. package/templates/demo/bot/tools/record_demo.ts +2 -2
  1117. package/templates/demo/evals/demo.eval.ts +1 -1
  1118. package/templates/demo/evals/evals.config.ts +1 -1
  1119. package/templates/demo/package.json +3 -3
  1120. package/templates/pr-autofixer/bot/agent.ts +1 -1
  1121. package/templates/pr-autofixer/bot/channels/drive.ts +1 -1
  1122. package/templates/pr-autofixer/bot/channels/github.ts +3 -3
  1123. package/templates/pr-autofixer/bot/channels/slack.ts +1 -1
  1124. package/templates/pr-autofixer/bot/hooks/bind-agent.ts +1 -1
  1125. package/templates/pr-autofixer/bot/lib/affinity.ts +1 -1
  1126. package/templates/pr-autofixer/bot/lib/drive.ts +2 -2
  1127. package/templates/pr-autofixer/bot/lib/merge-watch.ts +4 -4
  1128. package/templates/pr-autofixer/bot/lib/pr-state.ts +1 -1
  1129. package/templates/pr-autofixer/bot/lib/start-drive.ts +2 -2
  1130. package/templates/pr-autofixer/bot/lib/webhook-buffer.ts +1 -1
  1131. package/templates/pr-autofixer/bot/lib/webhook-routing.ts +1 -1
  1132. package/templates/pr-autofixer/bot/tools/drive_pr.ts +1 -1
  1133. package/templates/pr-autofixer/evals/coordinator.eval.ts +1 -1
  1134. package/templates/pr-autofixer/evals/evals.config.ts +1 -1
  1135. package/templates/pr-autofixer/package.json +3 -3
  1136. package/templates/security-help/.gitignore +4 -0
  1137. package/templates/security-help/README.md +6 -6
  1138. package/templates/security-help/bot/agent.ts +1 -1
  1139. package/templates/security-help/bot/channels/github.ts +1 -1
  1140. package/templates/security-help/bot/channels/slack.ts +1 -1
  1141. package/templates/security-help/bot/lib/pr-first-pass.ts +3 -3
  1142. package/templates/security-help/evals/evals.config.ts +1 -1
  1143. package/templates/security-help/evals/security-help.eval.ts +1 -1
  1144. package/templates/security-help/package.json +2 -2
  1145. package/templates/security-reviewer/README.md +4 -4
  1146. package/templates/security-reviewer/bot/agent.ts +1 -1
  1147. package/templates/security-reviewer/bot/channels/github.ts +2 -2
  1148. package/templates/security-reviewer/bot/tools/post_findings.ts +2 -2
  1149. package/templates/security-reviewer/evals/evals.config.ts +1 -1
  1150. package/templates/security-reviewer/evals/review.eval.ts +1 -1
  1151. package/templates/security-reviewer/package.json +3 -3
  1152. package/templates/thermo-quality-review/README.md +5 -5
  1153. package/templates/thermo-quality-review/bot/agent.ts +1 -1
  1154. package/templates/thermo-quality-review/bot/channels/github.ts +2 -2
  1155. package/templates/thermo-quality-review/bot/tools/post_findings.ts +2 -2
  1156. package/templates/thermo-quality-review/evals/evals.config.ts +1 -1
  1157. package/templates/thermo-quality-review/evals/review.eval.ts +1 -1
  1158. package/templates/thermo-quality-review/package.json +3 -3
  1159. package/templates/thermo-review/README.md +5 -5
  1160. package/templates/thermo-review/bot/agent.ts +1 -1
  1161. package/templates/thermo-review/bot/channels/github.ts +2 -2
  1162. package/templates/thermo-review/bot/tools/post_findings.ts +2 -2
  1163. package/templates/thermo-review/evals/evals.config.ts +1 -1
  1164. package/templates/thermo-review/evals/review.eval.ts +1 -1
  1165. package/templates/thermo-review/package.json +3 -3
  1166. package/templates/triage/README.md +5 -5
  1167. package/templates/triage/bot/agent.ts +1 -1
  1168. package/templates/triage/bot/channels/queue.ts +5 -5
  1169. package/templates/triage/bot/channels/webhook.ts +5 -5
  1170. package/templates/triage/bot/hooks/memory.ts +1 -1
  1171. package/templates/triage/bot/lib/actuate.ts +2 -2
  1172. package/templates/triage/bot/tools/record_triage.ts +1 -1
  1173. package/templates/triage/evals/evals.config.ts +1 -1
  1174. package/templates/triage/evals/triage.eval.ts +1 -1
  1175. package/templates/triage/overlays/jira/README.md +4 -4
  1176. package/templates/triage/overlays/jira/bot/mcp-connections/tracker.ts +1 -1
  1177. package/templates/triage/overlays/linear/README.md +4 -4
  1178. package/templates/triage/overlays/linear/bot/mcp-connections/tracker.ts +1 -1
  1179. package/templates/triage/package.json +3 -3
  1180. package/dist/bin/agent-sdk.js +0 -2
  1181. package/dist/docs/assets/building-with-agents.md.FZXrY8Nk.js +0 -9
  1182. package/dist/docs/assets/building-with-agents.md.FZXrY8Nk.lean.js +0 -1
  1183. package/dist/docs/assets/changelog.md.BvHRIiMH.js +0 -1
  1184. package/dist/docs/assets/changelog.md.BvHRIiMH.lean.js +0 -1
  1185. package/dist/docs/assets/chunks/@localSearchIndexroot.BoDEJQWv.js +0 -1
  1186. package/dist/docs/assets/chunks/channel.D2BTz0L-.js +0 -1
  1187. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DqByliAC.js +0 -1
  1188. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DqByliAC.js +0 -1
  1189. package/dist/docs/assets/chunks/clone.CldT1lbQ.js +0 -1
  1190. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.Bb4oMe0P.js +0 -1
  1191. package/dist/docs/assets/deployment.md.3MMWuPeV.js +0 -31
  1192. package/dist/docs/assets/deployment.md.3MMWuPeV.lean.js +0 -1
  1193. package/dist/docs/assets/guides_agent-to-agent.md.CwL5cwuE.lean.js +0 -1
  1194. package/dist/docs/assets/guides_cloud-agents.md.BzbzcOyj.js +0 -9
  1195. package/dist/docs/assets/guides_cloud-agents.md.BzbzcOyj.lean.js +0 -1
  1196. package/dist/docs/assets/guides_convert-automation.md.DMEX9nF-.lean.js +0 -1
  1197. package/dist/docs/assets/guides_export-grokbot.md.qo5bxi4h.js +0 -55
  1198. package/dist/docs/assets/guides_export-grokbot.md.qo5bxi4h.lean.js +0 -1
  1199. package/dist/docs/assets/guides_grokbot-agents.md.BwAykJ7U.js +0 -15
  1200. package/dist/docs/assets/guides_grokbot-agents.md.BwAykJ7U.lean.js +0 -1
  1201. package/dist/docs/assets/guides_migrate.md.CQlGaBKX.js +0 -7
  1202. package/dist/docs/assets/guides_migrate.md.CQlGaBKX.lean.js +0 -1
  1203. package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.js +0 -37
  1204. package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.lean.js +0 -1
  1205. package/dist/docs/assets/index.md.CAnsLl8D.js +0 -27
  1206. package/dist/docs/assets/index.md.CAnsLl8D.lean.js +0 -1
  1207. package/dist/docs/assets/quickstart.md.D8JDfkKO.lean.js +0 -1
  1208. package/dist/docs/assets/reference_channels.md.CNNIS6K7.js +0 -22
  1209. package/dist/docs/assets/reference_cli.md.1o_TqKdt.js +0 -103
  1210. package/dist/docs/assets/reference_cli.md.1o_TqKdt.lean.js +0 -1
  1211. package/dist/docs/assets/reference_memory.md.BwyJXYZe.js +0 -4
  1212. package/dist/docs/assets/reference_playground.md.q4MI-0td.js +0 -1
  1213. package/dist/docs/assets/templates_grokbot-agents.md.DgpPEs7B.js +0 -5
  1214. package/dist/docs/assets/templates_grokbot-agents.md.DgpPEs7B.lean.js +0 -1
  1215. package/dist/docs/assets/templates_security-reviewer.md.Gh6EF9Us.js +0 -3
  1216. package/dist/docs/assets/templates_thermo-quality-review.md.B77UyTrX.js +0 -3
  1217. package/dist/docs/assets/templates_thermo-review.md.DRJ7mC5U.js +0 -3
  1218. package/dist/docs/assets/troubleshooting.md.DFnoTDlQ.js +0 -1
  1219. package/dist/docs/guides/export-grokbot.html +0 -114
  1220. package/dist/docs/guides/export-grokbot.md +0 -239
  1221. package/dist/docs/guides/grokbot-agents.html +0 -74
  1222. package/dist/docs/guides/grokbot-agents.md +0 -135
  1223. package/dist/docs/templates/grokbot-agents.html +0 -64
  1224. package/dist/docs/templates/grokbot-agents.md +0 -55
  1225. package/dist/extensions/cursor-grokbot-agents/extension.d.ts +0 -77
  1226. package/dist/extensions/cursor-grokbot-agents/extension.d.ts.map +0 -1
  1227. package/dist/extensions/cursor-grokbot-agents/extension.js +0 -70
  1228. package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts +0 -11
  1229. package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts.map +0 -1
  1230. package/dist/extensions/cursor-grokbot-agents/lib/agents.js +0 -31
  1231. package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts +0 -56
  1232. package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts.map +0 -1
  1233. package/dist/extensions/cursor-grokbot-agents/lib/backend.js +0 -138
  1234. package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts +0 -28
  1235. package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts.map +0 -1
  1236. package/dist/extensions/cursor-grokbot-agents/lib/contacts.js +0 -46
  1237. package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts +0 -53
  1238. package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts.map +0 -1
  1239. package/dist/extensions/cursor-grokbot-agents/lib/conversation.js +0 -186
  1240. package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts +0 -4
  1241. package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts.map +0 -1
  1242. package/dist/extensions/cursor-grokbot-agents/lib/inputs.js +0 -15
  1243. package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts +0 -12
  1244. package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts.map +0 -1
  1245. package/dist/extensions/cursor-grokbot-agents/lib/lock.js +0 -24
  1246. package/dist/extensions/cursor-grokbot-agents/skills/consult.md +0 -40
  1247. package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts +0 -4
  1248. package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts.map +0 -1
  1249. package/dist/extensions/cursor-grokbot-agents/tools/ask.js +0 -26
  1250. package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts +0 -4
  1251. package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts.map +0 -1
  1252. package/dist/extensions/cursor-grokbot-agents/tools/check.js +0 -21
  1253. package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts +0 -4
  1254. package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts.map +0 -1
  1255. package/dist/extensions/cursor-grokbot-agents/tools/interrupt.js +0 -13
  1256. package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts +0 -4
  1257. package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts.map +0 -1
  1258. package/dist/extensions/cursor-grokbot-agents/tools/list.js +0 -22
  1259. package/dist/internal/cli-init-grokbot.d.ts +0 -29
  1260. package/dist/internal/cli-init-grokbot.d.ts.map +0 -1
  1261. package/dist/internal/cli-init-grokbot.js +0 -181
  1262. package/dist/internal/convert-grokbot/answers.d.ts +0 -127
  1263. package/dist/internal/convert-grokbot/answers.d.ts.map +0 -1
  1264. package/dist/internal/convert-grokbot/answers.js +0 -445
  1265. package/dist/internal/convert-grokbot/bot.d.ts +0 -50
  1266. package/dist/internal/convert-grokbot/bot.d.ts.map +0 -1
  1267. package/dist/internal/convert-grokbot/bot.js +0 -72
  1268. package/dist/internal/convert-grokbot/checks.d.ts +0 -26
  1269. package/dist/internal/convert-grokbot/checks.d.ts.map +0 -1
  1270. package/dist/internal/convert-grokbot/checks.js +0 -170
  1271. package/dist/internal/convert-grokbot/convert.d.ts +0 -60
  1272. package/dist/internal/convert-grokbot/convert.d.ts.map +0 -1
  1273. package/dist/internal/convert-grokbot/convert.js +0 -470
  1274. package/dist/internal/convert-grokbot/handoff.d.ts +0 -44
  1275. package/dist/internal/convert-grokbot/handoff.d.ts.map +0 -1
  1276. package/dist/internal/convert-grokbot/handoff.js +0 -160
  1277. package/dist/internal/convert-grokbot/recipe.d.ts +0 -61
  1278. package/dist/internal/convert-grokbot/recipe.d.ts.map +0 -1
  1279. package/dist/internal/convert-grokbot/recipe.js +0 -94
  1280. package/dist/internal/convert-grokbot/routine.d.ts +0 -51
  1281. package/dist/internal/convert-grokbot/routine.d.ts.map +0 -1
  1282. package/dist/internal/convert-grokbot/routine.js +0 -128
  1283. package/dist/internal/convert-grokbot/slack.d.ts +0 -28
  1284. package/dist/internal/convert-grokbot/slack.d.ts.map +0 -1
  1285. package/dist/internal/convert-grokbot/slack.js +0 -50
  1286. package/dist/internal/factory-resource-channel.d.ts.map +0 -1
  1287. package/dist/internal/legacy-command-guard.d.ts +0 -24
  1288. package/dist/internal/legacy-command-guard.d.ts.map +0 -1
  1289. package/dist/internal/legacy-command-guard.js +0 -47
  1290. package/dist/internal/runtime-dispatch-runner.d.ts +0 -25
  1291. package/dist/internal/runtime-dispatch-runner.d.ts.map +0 -1
  1292. package/dist/internal/runtime-dispatch-runner.js +0 -35
  1293. package/dist/internal/testing/factory-resource-fixtures.d.ts +0 -64
  1294. package/dist/internal/testing/factory-resource-fixtures.d.ts.map +0 -1
  1295. package/dist/internal/testing/factory-resource-fixtures.js +0 -55
  1296. package/dist/playground/assets/cursor-icons-16-DfKNljMZ.woff2 +0 -0
  1297. package/dist/playground/assets/index-B3_YohwW.js +0 -62
  1298. package/dist/playground/assets/index-Cn3-adsJ.css +0 -1
  1299. package/docs/guides/export-grokbot.md +0 -244
  1300. package/docs/guides/grokbot-agents.md +0 -140
  1301. package/docs/templates/grokbot-agents.md +0 -60
  1302. package/schemas/grokbot-answers.schema.json +0 -354
  1303. package/templates/grokbot-agents/README.md +0 -27
  1304. package/templates/grokbot-agents/bot/agent.ts +0 -6
  1305. package/templates/grokbot-agents/bot/extensions/grokbot.ts +0 -5
  1306. package/templates/grokbot-agents/bot/instructions.md +0 -7
  1307. package/templates/grokbot-agents/evals/evals.config.ts +0 -5
  1308. package/templates/grokbot-agents/evals/grokbot-agents.eval.ts +0 -18
  1309. package/templates/grokbot-agents/init.json +0 -18
  1310. package/templates/grokbot-agents/package.json +0 -17
  1311. package/templates/grokbot-agents/tsconfig.json +0 -12
  1312. /package/dist/docs/assets/{evals.md.CHR34K1Y.lean.js → evals.md.DiljU__Z.lean.js} +0 -0
  1313. /package/dist/docs/assets/{guides_bitbucket.md.CKUayYtD.lean.js → guides_bitbucket.md.DkjkBRU8.lean.js} +0 -0
  1314. /package/dist/docs/assets/{guides_gitlab.md.CtNI4fSH.lean.js → guides_gitlab.md.DCE0p7_w.lean.js} +0 -0
  1315. /package/dist/docs/assets/{guides_pagerduty.md.BHXMcMtx.lean.js → guides_pagerduty.md.mnKXe9U0.lean.js} +0 -0
  1316. /package/dist/docs/assets/{hillclimbing.md.Dxvd-0gT.lean.js → hillclimbing.md.By61f3uq.lean.js} +0 -0
  1317. /package/dist/docs/assets/{reference_artifacts.md.DLV9MZES.lean.js → reference_artifacts.md.C-hKR2hp.lean.js} +0 -0
  1318. /package/dist/docs/assets/{reference_connections.md.BJE2Zllp.lean.js → reference_connections.md.BoAotr7_.lean.js} +0 -0
  1319. /package/dist/docs/assets/{reference_hooks.md.CROr0QgC.lean.js → reference_hooks.md.B-bwJuiG.lean.js} +0 -0
  1320. /package/dist/docs/assets/{reference_http-api.md.Dji-DD_Z.lean.js → reference_http-api.md._RWELr3d.lean.js} +0 -0
  1321. /package/dist/docs/assets/{reference_instructions.md.BYMVxAkw.lean.js → reference_instructions.md.yL2hXLnl.lean.js} +0 -0
  1322. /package/dist/docs/assets/{reference_memory.md.BwyJXYZe.lean.js → reference_memory.md.Dd7cyV9V.lean.js} +0 -0
  1323. /package/dist/docs/assets/{reference_playground.md.q4MI-0td.lean.js → reference_playground.md.CQiJk9CM.lean.js} +0 -0
  1324. /package/dist/docs/assets/{reference_project-layout.md.mFcS8yDD.lean.js → reference_project-layout.md.BamcPDUn.lean.js} +0 -0
  1325. /package/dist/docs/assets/{reference_prompt.md.DqPh71XN.lean.js → reference_prompt.md.BMjm1Jp3.lean.js} +0 -0
  1326. /package/dist/docs/assets/{reference_schedules.md.BqWnJES4.lean.js → reference_schedules.md.RC47aFm4.lean.js} +0 -0
  1327. /package/dist/docs/assets/{reference_sessions.md.Bi6lHttM.lean.js → reference_sessions.md.C7KFhWXV.lean.js} +0 -0
  1328. /package/dist/docs/assets/{reference_subagents.md.ChNGh6HK.lean.js → reference_subagents.md.CAhvW4yS.lean.js} +0 -0
  1329. /package/dist/docs/assets/{templates_agentic-owners.md.CTEnR0jp.lean.js → templates_agentic-owners.md.Dh2nDSqg.lean.js} +0 -0
  1330. /package/dist/docs/assets/{templates_security-reviewer.md.Gh6EF9Us.lean.js → templates_security-reviewer.md.DnwXdnB5.lean.js} +0 -0
  1331. /package/dist/docs/assets/{templates_triage.md.CNN6b0JZ.lean.js → templates_triage.md.BYWMloV4.lean.js} +0 -0
  1332. /package/dist/docs/assets/{troubleshooting.md.DFnoTDlQ.lean.js → troubleshooting.md.CGOdNVAL.lean.js} +0 -0
@@ -3,20 +3,18 @@
3
3
  * secrets set|list|unset` — Heroku-style deploys
4
4
  * onto Cursor's managed agent-serve hosting.
5
5
  *
6
- * All intelligence is server-side (backend/server/src/agentServe/); these
7
- * handlers resolve parameters (credentials, team, slug, the project's
8
- * `hosting` / `architecture` manifest block), call the v1 agent-serve or
9
- * v2 agentsdk management API through `deploy-client.ts`, poll status, and
10
- * render.
6
+ * All intelligence is server-side. These handlers resolve parameters (credentials, team, slug, the project's
7
+ * `hosting` / `architecture` manifest block), call the v2 agentsdk
8
+ * management API through `deploy-client.ts`, poll status, and render.
9
+ * `deployment`, `stop`, and `delete` keep a v1 fallback so the owner of a
10
+ * live v1 deployment can still see, stop, or remove it.
11
11
  */
12
12
  import { basename, relative, resolve } from "node:path";
13
13
  import { catchAuthDeclaration, isPublicEndpointPolicy } from "../channels.js";
14
- import { isCursorAccountTransport, } from "../types.js";
15
14
  import { CursorBackendClient } from "./cursor/backend-client.js";
16
15
  import { cursorExternalApiUrl, resolveApiKey, SIGN_IN_HINT } from "./cursor/credentials.js";
17
- import { authorizeCursorAccountConnectors } from "./cursor-account-mcp-auth.js";
18
16
  import { readDeployTemplate } from "./cursor-agent-template.js";
19
- import { AgentServeDeployClient, SEVERAL_AGENTS_DEPLOY_ALONE, DeployApiError, deploymentServiceAccountId, TERMINAL_AGENTKIT_DEPLOY_STATUSES, TERMINAL_DEPLOY_STATUSES, validateDeploymentSlug, } from "./deploy-client.js";
17
+ import { AgentServeDeployClient, SEVERAL_AGENTS_DEPLOY_ALONE, DeployApiError, SECRET_NOT_FOUND_MESSAGE, TERMINAL_AGENTKIT_DEPLOY_STATUSES, validateDeploymentSlug, } from "./deploy-client.js";
20
18
  import { channelCatchSecretNames, channelCredentialSecretNames, channelSecretAlternatives, } from "./deploy-manifest.js";
21
19
  import { unmetSecretAlternatives } from "./secret-alternatives.js";
22
20
  import { inferDeployGitSource } from "./deploy-source.js";
@@ -24,7 +22,10 @@ import { describeError } from "./describe-error.js";
24
22
  import { formatDiagnostics, hasErrorDiagnostics, isAgentProjectDir, listChildAgentDirs, loadAgentProject, } from "./discovery.js";
25
23
  import { CLI_COMMAND_NAME as CLI } from "./distribution.js";
26
24
  import { isReservedSecretName, isValidCursorEventRepo, validateSettableSecretName, } from "./hosting.js";
27
- import { deploymentArchitecture, rejectV2ForLegacyCommand } from "./legacy-command-guard.js";
25
+ import { CliError, EXIT_CODE_BY_ERROR, errorCodeForStatus } from "./cli/errors.js";
26
+ import { DEFAULT_LIST_LIMIT, nextPageHint, pageLocally, printJson, printListJson, } from "./cli/output.js";
27
+ import { dryRunActive } from "./dry-run.js";
28
+ import { V1_MIGRATE_HINT } from "./hosted-hints.js";
28
29
  import { deployProgressLabel, sanitizeCustomerError } from "./logs-client.js";
29
30
  import { sleep } from "./sleep.js";
30
31
  import { slugFromDirectoryName } from "./slug.js";
@@ -32,6 +33,8 @@ import { stderrPalette } from "./terminal-style.js";
32
33
  const DEFAULT_POLL_INTERVAL_MS = 3_000;
33
34
  const DEFAULT_DEPLOY_TIMEOUT_MS = 10 * 60 * 1000;
34
35
  const MULTI_COMPONENT_ALLOWED_TEAM_ID = 1;
36
+ /** Server-side v1 deploys are closed; `migrate` moves a v1 project to v2. */
37
+ const V1_DEPLOYS_CLOSED = `Architecture v1 deploys are closed. ${V1_MIGRATE_HINT}`;
35
38
  function canPublishAgentsAsOne(teamId) {
36
39
  return teamId === MULTI_COMPONENT_ALLOWED_TEAM_ID;
37
40
  }
@@ -45,7 +48,7 @@ export async function resolveDeployAuth(options) {
45
48
  const resolved = await resolveApiKey(options.apiKey === undefined ? undefined : { apiKey: options.apiKey });
46
49
  if (resolved === undefined) {
47
50
  err(`Not signed in to Cursor. ${SIGN_IN_HINT}\n`);
48
- return 1;
51
+ return EXIT_CODE_BY_ERROR.unauthenticated;
49
52
  }
50
53
  // The deployment management routes live on the external API host
51
54
  // (api.cursor.com), not the default backend (api2.cursor.sh) — see
@@ -60,7 +63,7 @@ export async function resolveDeployAuth(options) {
60
63
  teamId = Number.parseInt(options.team, 10);
61
64
  if (Number.isNaN(teamId) || teamId <= 0) {
62
65
  err(`Invalid --team: ${options.team} (expected a positive team id)\n`);
63
- return 1;
66
+ return EXIT_CODE_BY_ERROR.usage;
64
67
  }
65
68
  }
66
69
  else {
@@ -114,6 +117,8 @@ export async function prepare(options) {
114
117
  apiKey: auth.apiKey,
115
118
  backendUrl: auth.backendUrl,
116
119
  json: options.json === true,
120
+ fields: options.fields,
121
+ list: { limit: options.limit ?? DEFAULT_LIST_LIMIT, pageToken: options.pageToken },
117
122
  noWait: options.noWait === true,
118
123
  pollIntervalMs: options.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS,
119
124
  timeoutMs: options.timeoutMs ?? DEFAULT_DEPLOY_TIMEOUT_MS,
@@ -144,70 +149,32 @@ export async function cmdDeploy(options) {
144
149
  for (const target of targets) {
145
150
  manifests.push(await readDeployManifest(target.dir));
146
151
  }
147
- if (manifests.every((manifest) => manifest.architecture === "v2")) {
148
- // One team can publish several agents as one deployment. Other teams deploy each agent alone.
149
- if (!canPublishAgentsAsOne(ctx.teamId)) {
150
- ctx.err(severalAgentsDeployAloneText(options, targets));
151
- return 1;
152
- }
153
- if (!ctx.json) {
154
- ctx.err(options.all === true
155
- ? deployingAllAgentsLine(options, targets)
156
- : deployingAsOneApplicationLine(options, targets));
157
- }
158
- return deployAgentsdkApplication(ctx, options, targets, {
159
- // `persistent` is per child agent, like `agentPath`: each release
160
- // component carries its own.
161
- componentPersistent: Object.fromEntries(targets.map((target, index) => [target.slug, manifests[index]?.persistent === true])),
162
- componentImage: Object.fromEntries(targets.flatMap((target, index) => manifests[index]?.image === undefined ? [] : [[target.slug, manifests[index].image]])),
163
- hasScmChannels: manifests.some((manifest) => manifest.hasScmChannels),
164
- declaredSecretNames: declaredSecretNames(manifests),
165
- hasDeploymentsChannels: manifests.some((manifest) => manifest.hasDeploymentsChannels),
166
- });
167
- }
168
- if (!ctx.json && options.all === true) {
169
- ctx.err(deployingAllAgentsLine(options, targets));
170
- }
171
- if (!ctx.json && manifests.some((manifest) => manifest.architecture === "v2")) {
172
- ctx.err(`warning: agents under this parent mix architectures; deploying each separately (v2 children become standalone single-component applications).\n`);
173
- }
174
- // --path is per-agent (relative to the repo root). When deploying several
175
- // agents, ignore a shared --path so each target can infer its own path.
176
- let deployOptions = options;
177
- if (options.path !== undefined) {
178
- if (!ctx.json) {
179
- ctx.err(`warning: ignoring --path ${JSON.stringify(options.path)} for a multi-agent deploy; each agent infers its own path from git.\n`);
180
- }
181
- deployOptions = { ...options, path: undefined };
182
- }
183
- // Multi-agent batch: deploy sequentially; --json emits an array.
184
- const jsonResults = [];
185
- let failures = 0;
186
- for (const [index, target] of targets.entries()) {
187
- if (!ctx.json) {
188
- ctx.err(`\n=== [${index + 1}/${targets.length}] Deploying ${target.slug} ===\n`);
189
- }
190
- const before = jsonResults.length;
191
- const code = await deployOne(ctx, deployOptions, target, {
192
- jsonCollect: ctx.json ? jsonResults : undefined,
193
- });
194
- if (code !== 0) {
195
- failures += 1;
196
- if (ctx.json && jsonResults.length === before) {
197
- jsonResults.push({ slug: target.slug, error: "deploy failed" });
198
- }
199
- }
200
- }
201
- if (ctx.json) {
202
- ctx.out(`${JSON.stringify(jsonResults, null, 2)}\n`);
203
- }
204
- else if (failures > 0) {
205
- ctx.err(`\n${failures} of ${targets.length} deploy(s) failed.\n`);
152
+ const v1Agents = targets.filter((_, index) => manifests[index]?.architecture === "v1");
153
+ if (v1Agents.length > 0) {
154
+ ctx.err(`${V1_DEPLOYS_CLOSED} These agents set architecture: "v1": ${v1Agents
155
+ .map((target) => target.slug)
156
+ .join(", ")}.\n`);
157
+ return 1;
206
158
  }
207
- else {
208
- ctx.err(`\nDeployed ${targets.length} agents.\n`);
159
+ // One team can publish several agents as one deployment. Other teams deploy each agent alone.
160
+ if (!canPublishAgentsAsOne(ctx.teamId)) {
161
+ ctx.err(severalAgentsDeployAloneText(options, targets));
162
+ return 1;
209
163
  }
210
- return failures === 0 ? 0 : 1;
164
+ if (!ctx.json) {
165
+ ctx.err(options.all === true
166
+ ? deployingAllAgentsLine(options, targets)
167
+ : deployingAsOneApplicationLine(options, targets));
168
+ }
169
+ return deployAgentsdkApplication(ctx, options, targets, {
170
+ // `persistent` is per child agent, like `agentPath`: each release
171
+ // component carries its own.
172
+ componentPersistent: Object.fromEntries(targets.map((target, index) => [target.slug, manifests[index]?.persistent])),
173
+ componentImage: Object.fromEntries(targets.flatMap((target, index) => manifests[index]?.image === undefined ? [] : [[target.slug, manifests[index].image]])),
174
+ hasScmChannels: manifests.some((manifest) => manifest.hasScmChannels),
175
+ declaredSecretNames: declaredSecretNames(manifests),
176
+ hasDeploymentsChannels: manifests.some((manifest) => manifest.hasDeploymentsChannels),
177
+ });
211
178
  }
212
179
  /**
213
180
  * Resolve which agent directory(ies) to deploy from `--dir` / `--slug` /
@@ -334,9 +301,7 @@ async function resolveDeployTargets(options, ctx) {
334
301
  ((agents) => promptChooseDeployTargets(agents, {
335
302
  err: ctx.err,
336
303
  stdin: options.stdin ?? process.stdin,
337
- interactive: ctx.json !== true &&
338
- (options.stdin ?? process.stdin).isTTY === true &&
339
- process.stderr.isTTY === true,
304
+ interactive: !ctx.json && (options.stdin ?? process.stdin).isTTY === true && process.stderr.isTTY,
340
305
  }));
341
306
  const chosen = await chooser(children);
342
307
  if (chosen === null) {
@@ -376,9 +341,6 @@ function copiedDeployFlags(options) {
376
341
  for (const repo of options.cursorEventsRepos ?? []) {
377
342
  parts.push(`--cursor-events-repo ${quoteShell(repo)}`);
378
343
  }
379
- for (const domain of options.allowDomains ?? []) {
380
- parts.push(`--allow-domain ${quoteShell(domain)}`);
381
- }
382
344
  return parts.length === 0 ? "" : ` ${parts.join(" ")}`;
383
345
  }
384
346
  function relativeDeployDir(dir) {
@@ -449,7 +411,7 @@ export async function promptChooseDeployTargets(agents, options) {
449
411
  }
450
412
  const MISSING_DEPLOY_REPO_HINT = `Could not resolve an https:// git repository URL for this deploy.\n` +
451
413
  ` Pass --repo https://github.com/<owner>/<repo>, https://gitlab.com/<group>/<project>, or an Origin repository URL (inferred from origin when possible).\n`;
452
- async function deployOne(ctx, options, target, extras) {
414
+ async function deployOne(ctx, options, target) {
453
415
  const { dir, slug } = target;
454
416
  // Fill --repo/--ref/--path from the local git checkout when omitted so
455
417
  // `agent-sdk deploy` inside an agent directory is enough. Only probe git
@@ -498,26 +460,17 @@ async function deployOne(ctx, options, target, extras) {
498
460
  : ` (inferred ${inferredBits.join(", ")} from git; pass --repo/--ref/--path to override)\n`));
499
461
  }
500
462
  // The package manifest (`defineAgent({ hosting })`) is the source of
501
- // truth for egress domains and expected secret names; flags override or
502
- // augment it. Directories without an agent project have no manifest. The same load supplies the
503
- // cursorAccount connection refs for the post-deploy connector auth and
504
- // the channels declared public via `publicEndpoint()`.
463
+ // truth for expected secret names. Directories without an agent project
464
+ // have no manifest and deploy with defaults; the hosted build reads the
465
+ // project from git.
505
466
  const manifest = isAgent ? await readDeployManifest(dir) : undefined;
506
- const hosting = manifest?.hosting;
507
- const egressAllowedDomains = [
508
- ...new Set([...(hosting?.egressDomains ?? []), ...(options.allowDomains ?? [])]),
509
- ];
510
- const publicRoutePaths = (manifest?.publicChannelIds ?? []).map((channelId) => `/v1/channels/${channelId}`);
467
+ if (manifest?.architecture === "v1") {
468
+ ctx.err(`${V1_DEPLOYS_CLOSED}\n`);
469
+ return 1;
470
+ }
511
471
  if (!ctx.json && manifest?.httpChannelPublicEndpoint === true) {
512
472
  ctx.err(`warning: publicEndpoint() on the built-in HTTP channel has no effect on hosting — only custom channels (/v1/channels/…) can be public; the session API always requires the alias token.\n`);
513
473
  }
514
- if (!ctx.json && publicRoutePaths.length > 0 && manifest?.architecture !== "v2") {
515
- // Security-relevant surface change: say exactly what will be reachable
516
- // without the alias token before the deploy is accepted. v2 registers
517
- // these routes only after bake, so a relative path here would not be a
518
- // live webhook URL — the running status prints the absolute one.
519
- ctx.err(` public: ${publicRoutePaths.join(", ")} (served WITHOUT the alias token — these channels authenticate requests themselves)\n`);
520
- }
521
474
  const extensionEgress = manifest?.extensionEgress ?? [];
522
475
  if (!ctx.json && extensionEgress.length > 0) {
523
476
  // Mounted packages widen the pod's egress without an agent.ts edit; name
@@ -532,116 +485,24 @@ async function deployOne(ctx, options, target, extras) {
532
485
  .map((channelId) => `/v1/channels/${channelId}`)
533
486
  .join(", ")}: publicEndpoint() sits beside sharedSecretAuth()/hmacSignatureAuth() — auth chains are any-of, so every request is admitted and those secret policies never run. Drop publicEndpoint() to enforce them, or drop them to make the intent explicit.\n`);
534
487
  }
535
- if (manifest?.architecture === "v2") {
536
- if (!ctx.json) {
537
- ctx.err(` architecture: v2${manifest.persistent ? " (persistent)" : ""}${manifest.image === undefined ? "" : `\n image: ${manifest.image}`}\n`);
538
- }
539
- return deployOneAgentsdk(ctx, extras, {
540
- persistent: manifest.persistent,
541
- image: manifest.image,
542
- slug,
543
- gitRepoUrl,
544
- gitRef,
545
- agentPath,
546
- repositories: options.cursorEventsRepos,
547
- hasScmChannels: manifest.hasScmChannels,
548
- declaredSecretNames: declaredSecretNames([manifest]),
549
- hasDeploymentsChannels: manifest.hasDeploymentsChannels,
550
- multiTenant: options.multiTenant === true,
551
- template: readDeployTemplate(dir),
552
- });
553
- }
554
- if (options.multiTenant === true) {
555
- ctx.err("--multi-tenant is only valid for architecture: v2 deploys (Cursor-managed products).\n");
556
- return 1;
557
- }
558
- // Today's only source shape: the control plane builds from a git ref.
559
- // See DeploySource for the artifact seam.
560
- const source = {
561
- kind: "git-ref",
562
- gitRepoUrl,
563
- ...(gitRef === undefined ? {} : { gitRef }),
564
- ...(agentPath === undefined ? {} : { agentPath }),
565
- ...(options.cursorEventsRepos === undefined || options.cursorEventsRepos.length === 0
566
- ? {}
567
- : { cursorEventRepos: options.cursorEventsRepos }),
568
- ...(egressAllowedDomains.length === 0 ? {} : { egressAllowedDomains }),
569
- publicRoutePaths: publicRoutePaths.length === 0 ? undefined : publicRoutePaths,
570
- // Deliberately NO manifest here: the control plane captures it from the
571
- // provisioned engine (`GET /v1/manifest` after the health probe), which
572
- // is the single write path for deploy manifests. `july manifest` remains
573
- // available for local visibility only.
574
- };
575
- let accepted;
576
- try {
577
- accepted = await ctx.client.deploy({
578
- teamId: ctx.teamId,
579
- slug,
580
- source,
581
- template: readDeployTemplate(dir),
582
- });
583
- }
584
- catch (error) {
585
- return renderApiError(error, ctx.err);
586
- }
587
- const aliasUrl = ctx.client.aliasUrl(accepted.engineAlias);
588
- if (!ctx.json && accepted.aliasToken !== undefined) {
589
- ctx.out(aliasTokenBlock(accepted.aliasToken));
590
- }
591
- if (ctx.noWait) {
592
- if (extras?.jsonCollect !== undefined) {
593
- extras.jsonCollect.push(accepted);
594
- }
595
- else if (ctx.json) {
596
- ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
597
- }
598
- else {
599
- ctx.out(`Deploy accepted: ${slug} (team ${ctx.teamId}, generation ${accepted.generation}, ${accepted.deploymentKind})\n` +
600
- ` alias: ${aliasUrl}\n` +
601
- `Check progress with \`${CLI} deployment ${slug} --team ${ctx.teamId}\`.\n`);
602
- }
603
- return 0;
604
- }
605
- let detail;
606
- try {
607
- detail = await pollUntil(ctx, slug, TERMINAL_DEPLOY_STATUSES, () => ctx.client.getDeployment({ teamId: ctx.teamId, slug }));
608
- }
609
- catch (error) {
610
- return renderApiError(error, ctx.err);
611
- }
612
- warnMissingSecrets(ctx, slug, declaredSecretNames([manifest]), detail.secretNames);
613
- const payload = accepted.aliasToken === undefined ? detail : { ...detail, aliasToken: accepted.aliasToken };
614
- if (extras?.jsonCollect !== undefined) {
615
- extras.jsonCollect.push(payload);
616
- return detail.status === "running" ? 0 : 1;
617
- }
618
- if (ctx.json) {
619
- ctx.out(`${JSON.stringify(payload, null, 2)}\n`);
620
- return detail.status === "running" ? 0 : 1;
621
- }
622
- if (detail.status !== "running") {
623
- ctx.err(`Deployment ${slug} ended ${detail.status}${deployFailureDetail(detail.lastError)}\n`);
624
- return 1;
488
+ const persistent = manifest?.persistent === true;
489
+ if (!ctx.json) {
490
+ ctx.err(` architecture: v2${persistent ? " (persistent)" : ""}${manifest?.image === undefined ? "" : `\n image: ${manifest.image}`}\n`);
625
491
  }
626
- const deployedPublicRoutes = detail.publicRoutePaths ?? [];
627
- ctx.out(`Deployed ${slug} (team ${ctx.teamId})\n` +
628
- ` status: running\n` +
629
- ` generation: ${detail.generation}\n` +
630
- ` kind: ${detail.deploymentKind}\n` +
631
- ` alias: ${aliasUrl}\n` +
632
- ` playground: ${aliasUrl}/playground (sign in with the alias token)\n` +
633
- ` open: ${CLI} playground --prod --slug ${slug} --team ${ctx.teamId}\n` +
634
- // Paste-ready webhook URLs: these subtrees skip the alias token, so
635
- // the channel handler must verify deliveries (webhook signatures).
636
- deployedPublicRoutes
637
- .map((path) => ` public: ${aliasUrl}${path} (no alias token)\n`)
638
- .join(""));
639
- await runPostDeployConnectorAuth(ctx, options, {
492
+ return deployOneAgentsdk(ctx, {
493
+ persistent,
494
+ image: manifest?.image,
640
495
  slug,
641
- connections: manifest?.cursorAccountConnections ?? [],
642
- serviceAccountId: deploymentServiceAccountId(detail),
496
+ gitRepoUrl,
497
+ gitRef,
498
+ agentPath,
499
+ repositories: options.cursorEventsRepos,
500
+ hasScmChannels: manifest?.hasScmChannels === true,
501
+ declaredSecretNames: declaredSecretNames([manifest]),
502
+ hasDeploymentsChannels: manifest?.hasDeploymentsChannels === true,
503
+ multiTenant: options.multiTenant === true,
504
+ template: readDeployTemplate(dir),
643
505
  });
644
- return 0;
645
506
  }
646
507
  /**
647
508
  * Multi-agent parent whose children all declare `architecture: "v2"`:
@@ -685,7 +546,7 @@ async function deployAgentsdkApplication(ctx, options, targets, declarations) {
685
546
  agentPath: [parentPath, basename(target.dir)]
686
547
  .filter((part) => part !== undefined && part !== "")
687
548
  .join("/"),
688
- persistent: declarations.componentPersistent[target.slug] === true,
549
+ persistent: declarations.componentPersistent[target.slug],
689
550
  image: declarations.componentImage[target.slug],
690
551
  }));
691
552
  if (!ctx.json) {
@@ -696,7 +557,7 @@ async function deployAgentsdkApplication(ctx, options, targets, declarations) {
696
557
  .map((component) => ` component: ${component.componentKey} (${component.agentPath ?? "."})${component.persistent ? " persistent" : ""}${component.image === undefined ? "" : ` image ${component.image}`}\n`)
697
558
  .join(""));
698
559
  }
699
- return deployOneAgentsdk(ctx, undefined, {
560
+ return deployOneAgentsdk(ctx, {
700
561
  // Multi-component: the flag travels on each component instead.
701
562
  persistent: false,
702
563
  slug,
@@ -716,7 +577,7 @@ async function deployAgentsdkApplication(ctx, options, targets, declarations) {
716
577
  * `architecture: "v2"` deploy: POST `/internal/agentsdk/deployments` and
717
578
  * poll the matching GET.
718
579
  */
719
- async function deployOneAgentsdk(ctx, extras, args) {
580
+ async function deployOneAgentsdk(ctx, args) {
720
581
  const { slug } = args;
721
582
  const componentsLine = args.components === undefined
722
583
  ? ""
@@ -741,7 +602,7 @@ async function deployOneAgentsdk(ctx, extras, args) {
741
602
  });
742
603
  }
743
604
  catch (error) {
744
- return renderApiError(error, ctx.err, {
605
+ throw apiError(error, {
745
606
  multiTenant: args.multiTenant,
746
607
  teamId: ctx.teamId,
747
608
  });
@@ -750,10 +611,7 @@ async function deployOneAgentsdk(ctx, extras, args) {
750
611
  ctx.out(aliasTokenBlock(accepted.aliasToken));
751
612
  }
752
613
  if (ctx.noWait) {
753
- if (extras?.jsonCollect !== undefined) {
754
- extras.jsonCollect.push(accepted);
755
- }
756
- else if (ctx.json) {
614
+ if (ctx.json) {
757
615
  ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
758
616
  }
759
617
  else {
@@ -770,13 +628,9 @@ async function deployOneAgentsdk(ctx, extras, args) {
770
628
  detail = await pollUntil(ctx, slug, TERMINAL_AGENTKIT_DEPLOY_STATUSES, () => ctx.client.getAgentkitDeploy({ teamId: ctx.teamId, slug }));
771
629
  }
772
630
  catch (error) {
773
- return renderApiError(error, ctx.err);
631
+ throw apiError(error);
774
632
  }
775
633
  const payload = { ...detail, aliasToken: accepted.aliasToken };
776
- if (extras?.jsonCollect !== undefined) {
777
- extras.jsonCollect.push(payload);
778
- return detail.status === "running" ? 0 : 1;
779
- }
780
634
  if (ctx.json) {
781
635
  ctx.out(`${JSON.stringify(payload, null, 2)}\n`);
782
636
  return detail.status === "running" ? 0 : 1;
@@ -819,69 +673,9 @@ async function deployOneAgentsdk(ctx, extras, args) {
819
673
  }
820
674
  return 0;
821
675
  }
822
- /**
823
- * Post-deploy connector authorization for `cursorAccount` connections: the
824
- * agent's connectors execute with tokens owned by the deployment's service
825
- * account, which start out unauthorized. On a TTY this runs the dashboard's
826
- * Authenticate flow inline (browser OAuth per connector, already-authorized
827
- * ones skipped); otherwise it reports status only. Never affects the deploy
828
- * outcome — anything left unauthorized just gets a playground-page pointer.
829
- */
830
- async function runPostDeployConnectorAuth(ctx, options, args) {
831
- if (args.connections.length === 0) {
832
- return;
833
- }
834
- const { serviceAccountId } = args;
835
- if (serviceAccountId === undefined) {
836
- ctx.err(`warning: this agent uses Cursor account connectors, but the deployment has no service account; redeploy to mint one.\n`);
837
- return;
838
- }
839
- const backendClient = new CursorBackendClient({
840
- backendUrl: ctx.backendUrl,
841
- apiKey: ctx.apiKey,
842
- fetchImpl: options.fetchImpl,
843
- });
844
- const interactive = options.openBrowserImpl !== undefined ||
845
- (process.stdout.isTTY === true && process.stdin.isTTY === true);
846
- let anyUnauthorized = false;
847
- for (const ref of args.connections) {
848
- ctx.out(`\nThis agent uses Cursor account connectors (connection "${ref.name}"${ref.servers === undefined || ref.servers.length === 0 ? "" : `: ${ref.servers.join(", ")}`}).\n`);
849
- try {
850
- const result = await authorizeCursorAccountConnectors({
851
- backendClient,
852
- teamId: ctx.teamId,
853
- slug: args.slug,
854
- serviceAccountId,
855
- connectionName: ref.name,
856
- servers: ref.servers,
857
- interactive,
858
- out: ctx.out,
859
- err: ctx.err,
860
- openBrowserImpl: options.openBrowserImpl,
861
- sleep: options.sleepImpl,
862
- pollIntervalMs: options.connectorPollIntervalMs,
863
- pollTimeoutMs: options.connectorPollTimeoutMs,
864
- });
865
- if (result.pending.length > 0 || result.errored.length > 0) {
866
- anyUnauthorized = true;
867
- if (result.pending.length > 0) {
868
- ctx.out(`Connectors not authorized yet: ${result.pending.join(", ")}.\n`);
869
- }
870
- }
871
- }
872
- catch (error) {
873
- anyUnauthorized = true;
874
- ctx.err(`warning: could not check connector authorization for "${ref.name}": ${describeError(error)}\n`);
875
- }
876
- }
877
- if (anyUnauthorized) {
878
- ctx.out(`You can authorize connectors at the playground page (cursor.com dashboard → Deployed Agents → ${args.slug}) or with \`${CLI} mcp oauth <connection>\`.\n`);
879
- }
880
- }
881
676
  /**
882
677
  * Read the deploy-relevant bits of the project manifest at `dir` in one
883
- * load: the `hosting` block, the agent's cursorAccount connections, and the
884
- * channels declared public via `publicEndpoint()`.
678
+ * load: the `hosting` block, declared secrets, and channel warnings.
885
679
  */
886
680
  async function readDeployManifest(dir) {
887
681
  const project = await loadAgentProject(dir);
@@ -896,12 +690,6 @@ async function readDeployManifest(dir) {
896
690
  architecture: project.agent.architecture,
897
691
  persistent: project.agent.persistent === true,
898
692
  image: project.agent.hosting?.image,
899
- cursorAccountConnections: project.agent.connections.flatMap((connection) => isCursorAccountTransport(connection.transport)
900
- ? [{ name: connection.name, servers: connection.transport.servers }]
901
- : []),
902
- publicChannelIds: project.channels
903
- .filter((channel) => (channel.definition.auth ?? []).some(isPublicEndpointPolicy))
904
- .map((channel) => channel.id),
905
693
  publicChannelIdsWithDeadSecretPolicies: project.channels
906
694
  .filter((channel) => {
907
695
  const auth = channel.definition.auth ?? [];
@@ -957,7 +745,7 @@ function declaredSecretNames(manifests) {
957
745
  function warnMissingSecrets(ctx, slug, declared, set) {
958
746
  for (const group of unmetSecretAlternatives(declared?.alternatives ?? [], set)) {
959
747
  ctx.err(`warning: none of ${group.names.join(", ")} is set on ${slug}: ${group.unsetEffect}\n` +
960
- ` set one with \`${CLI} secrets set ${slug} ${group.names[0]}\`\n`);
748
+ ` set one with \`${CLI} secret set ${slug} ${group.names[0]}\`\n`);
961
749
  }
962
750
  if (declared === undefined || declared.names.length === 0) {
963
751
  return;
@@ -970,7 +758,7 @@ function warnMissingSecrets(ctx, slug, declared, set) {
970
758
  return;
971
759
  }
972
760
  ctx.err(`warning: secrets declared in the agent manifest but not set on ${slug}: ${missing.join(", ")}\n` +
973
- ` set them with \`${CLI} secrets set ${slug} ${missing.join(" ")}\`\n`);
761
+ ` set them with \`${CLI} secret set ${slug} ${missing.join(" ")}\`\n`);
974
762
  }
975
763
  // ============================================================================
976
764
  // deployments (list)
@@ -980,55 +768,40 @@ export async function cmdDeployments(options) {
980
768
  if (typeof ctx === "number") {
981
769
  return ctx;
982
770
  }
983
- let deployments;
771
+ let page;
984
772
  try {
985
- deployments = await ctx.client.listDeployments({ teamId: ctx.teamId });
986
- }
987
- catch (error) {
988
- return renderApiError(error, ctx.err);
989
- }
990
- let applications = [];
991
- try {
992
- applications = await ctx.client.listAgentkitDeployments({
773
+ page = await ctx.client.listAgentkitDeploymentsPage({
993
774
  teamId: ctx.teamId,
775
+ pageSize: ctx.list.limit,
776
+ pageToken: ctx.list.pageToken,
994
777
  });
995
778
  }
996
779
  catch (error) {
997
- // Older control planes 404 this route; keep listing v1.
998
- if (!(error instanceof DeployApiError && error.status === 404)) {
999
- return renderApiError(error, ctx.err);
1000
- }
780
+ throw apiError(error);
1001
781
  }
1002
782
  if (ctx.json) {
1003
- // Empty v2 list keeps `{ deployments }` for v1-only parsers.
1004
- ctx.out(`${JSON.stringify(applications.length === 0 ? { deployments } : { deployments, applications }, null, 2)}\n`);
783
+ printListJson({ items: page.deployments, nextPageToken: page.nextPageToken }, { fields: ctx.fields, write: ctx.out });
1005
784
  return 0;
1006
785
  }
1007
- if (deployments.length === 0 && applications.length === 0) {
1008
- ctx.out(`No deployments on team ${ctx.teamId}. Create one with \`${CLI} deploy\`.\n`);
786
+ if (page.deployments.length === 0) {
787
+ // Past the last page the team can still have deployments.
788
+ ctx.out(ctx.list.pageToken === undefined
789
+ ? `No deployments on team ${ctx.teamId}. Create one with \`${CLI} deploy\`.\n`
790
+ : "No more deployments.\n");
1009
791
  return 0;
1010
792
  }
1011
- ctx.out(`${renderTable(["SLUG", "ARCH", "STATUS", "GEN", "KIND", "UPDATED"], [
1012
- ...deployments.map((d) => [
1013
- d.slug,
1014
- "v1",
1015
- d.status,
1016
- String(d.generation),
1017
- d.deploymentKind,
1018
- d.desiredUpdatedAt ?? "",
1019
- ]),
1020
- ...applications.map((application) => [
1021
- application.slug,
1022
- "v2",
1023
- application.status,
1024
- "-",
1025
- "application",
1026
- application.deployments
1027
- .map((row) => row.desiredUpdatedAt)
1028
- .sort()
1029
- .at(-1) ?? "",
1030
- ]),
1031
- ])}\n`);
793
+ ctx.out(`${renderTable(["SLUG", "STATUS", "UPDATED"], page.deployments.map((application) => [
794
+ application.slug,
795
+ application.status,
796
+ application.deployments
797
+ .map((row) => row.desiredUpdatedAt)
798
+ .sort()
799
+ .at(-1) ?? "",
800
+ ]))}\n`);
801
+ const hint = nextPageHint(page.nextPageToken);
802
+ if (hint !== undefined) {
803
+ ctx.err(hint);
804
+ }
1032
805
  return 0;
1033
806
  }
1034
807
  // ============================================================================
@@ -1036,16 +809,15 @@ export async function cmdDeployments(options) {
1036
809
  // ============================================================================
1037
810
  export async function cmdDeploymentStatus(slug, options) {
1038
811
  if (slug === undefined || slug === "") {
1039
- (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} deployment <slug> [--team <id>] [--json]\n`);
812
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} deployment get <slug> [--team <id>] [--json]\n`);
1040
813
  return 1;
1041
814
  }
1042
815
  const ctx = await prepare(options);
1043
816
  if (typeof ctx === "number") {
1044
817
  return ctx;
1045
818
  }
1046
- // Same dispatch as `stop`: v1 409s architecture-v2 slugs, so the v2
1047
- // GET goes first. A v2 404 (missing slug, or an older backend) falls
1048
- // through to the v1 agent-serve detail.
819
+ // v1 409s architecture-v2 slugs, so the v2 GET goes first. A v2 404 falls
820
+ // through to the v1 detail: the exit ramp for a deployment not yet on v2.
1049
821
  try {
1050
822
  const detail = await ctx.client.getAgentkitDeploy({
1051
823
  teamId: ctx.teamId,
@@ -1056,7 +828,7 @@ export async function cmdDeploymentStatus(slug, options) {
1056
828
  }
1057
829
  catch (error) {
1058
830
  if (!(error instanceof DeployApiError) || error.status !== 404) {
1059
- return renderApiError(error, ctx.err);
831
+ throw apiError(error);
1060
832
  }
1061
833
  }
1062
834
  let detail;
@@ -1064,65 +836,26 @@ export async function cmdDeploymentStatus(slug, options) {
1064
836
  detail = await ctx.client.getDeployment({ teamId: ctx.teamId, slug });
1065
837
  }
1066
838
  catch (error) {
1067
- return renderApiError(error, ctx.err);
839
+ throw apiError(error);
1068
840
  }
1069
841
  if (ctx.json) {
1070
- ctx.out(`${JSON.stringify(detail, null, 2)}\n`);
1071
- return 0;
1072
- }
1073
- const aliasUrl = ctx.client.aliasUrl(detail.engineAlias);
1074
- const lines = [`${detail.slug} (team ${detail.teamId})`, ` status: ${detail.status}`];
1075
- if (detail.progress !== undefined) {
1076
- lines.push(` progress: ${detail.progress}`);
1077
- }
1078
- if (detail.statusMessage !== null &&
1079
- detail.statusMessage !== undefined &&
1080
- detail.statusMessage.trim() !== "") {
1081
- lines.push(` step: ${detail.statusMessage}`);
1082
- }
1083
- lines.push(` generation: ${detail.generation}`, ` kind: ${detail.deploymentKind}`, ` alias: ${aliasUrl}`, ` playground: ${aliasUrl}/playground`);
1084
- if (detail.gitRepoUrl !== null && detail.gitRepoUrl !== undefined) {
1085
- lines.push(` repo: ${detail.gitRepoUrl} @ ${detail.gitRef ?? ""}`);
842
+ printJson({ ...detail, architecture: "v1" }, { fields: ctx.fields, write: ctx.out });
1086
843
  }
1087
- if (detail.serviceAccountId !== undefined && detail.serviceAccountId !== null) {
1088
- lines.push(` service account: ${detail.serviceAccountId}`);
1089
- }
1090
- if (detail.agentStoreSourceId !== undefined) {
1091
- // The durable file store's address: GET /v0/agent-serve-files/<id> lists
1092
- // it, and the pod sees it as AGENT_SERVE_STORE_SOURCE_ID.
1093
- lines.push(` file store: ${detail.agentStoreSourceId}`);
1094
- }
1095
- if (detail.egressAllowedDomains !== undefined && detail.egressAllowedDomains.length > 0) {
1096
- lines.push(` egress: ${detail.egressAllowedDomains.join(", ")}`);
1097
- }
1098
- if (detail.publicRoutePaths !== undefined && detail.publicRoutePaths.length > 0) {
1099
- // Served through the alias WITHOUT X-Agent-Alias-Token (the channel
1100
- // authenticates deliveries itself).
1101
- for (const path of detail.publicRoutePaths) {
1102
- lines.push(` public: ${aliasUrl}${path} (no alias token)`);
844
+ else {
845
+ const lines = [
846
+ `${detail.slug} (team ${detail.teamId})`,
847
+ ` status: ${detail.status}`,
848
+ ` architecture: v1`,
849
+ ];
850
+ if (detail.lastError !== null && detail.lastError !== undefined) {
851
+ lines.push(` last error: ${sanitizeCustomerError(detail.lastError)}`);
1103
852
  }
853
+ if (detail.desiredUpdatedAt !== undefined) {
854
+ lines.push(` updated: ${detail.desiredUpdatedAt}`);
855
+ }
856
+ ctx.out(`${lines.join("\n")}\n`);
1104
857
  }
1105
- if (detail.secretNames !== undefined && detail.secretNames.length > 0) {
1106
- lines.push(` secrets: ${detail.secretNames.join(", ")}`);
1107
- }
1108
- if (detail.podCredentialMaskedKey !== undefined && detail.podCredentialMaskedKey !== null) {
1109
- lines.push(` pod credential: ${detail.podCredentialMaskedKey}`);
1110
- }
1111
- if (detail.engineUrl !== null && detail.engineUrl !== undefined) {
1112
- lines.push(` engine: ${detail.engineUrl}`);
1113
- }
1114
- if (detail.engineAccess !== null &&
1115
- detail.engineAccess !== undefined &&
1116
- typeof detail.engineAccess === "object") {
1117
- lines.push(` engine access: ${detail.engineAccess.url} (expires ${detail.engineAccess.expiresAt})`);
1118
- }
1119
- if (detail.lastError !== null && detail.lastError !== undefined) {
1120
- lines.push(` last error: ${sanitizeCustomerError(detail.lastError)}`);
1121
- }
1122
- if (detail.desiredUpdatedAt !== undefined) {
1123
- lines.push(` updated: ${detail.desiredUpdatedAt}`);
1124
- }
1125
- ctx.out(`${lines.join("\n")}\n`);
858
+ ctx.err(`${V1_MIGRATE_HINT}\n`);
1126
859
  return 0;
1127
860
  }
1128
861
  /**
@@ -1143,7 +876,7 @@ function livePublicWebhookLines(ctx, detail) {
1143
876
  }
1144
877
  function renderAgentkitDeploymentStatus(ctx, detail) {
1145
878
  if (ctx.json) {
1146
- ctx.out(`${JSON.stringify(detail, null, 2)}\n`);
879
+ printJson(detail, { fields: ctx.fields, write: ctx.out });
1147
880
  return;
1148
881
  }
1149
882
  const lines = [
@@ -1177,18 +910,17 @@ function renderAgentkitDeploymentStatus(ctx, detail) {
1177
910
  // ============================================================================
1178
911
  export async function cmdStop(slug, options) {
1179
912
  if (slug === undefined || slug === "") {
1180
- (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} stop <slug> [--team <id>] [--json] [--no-wait]\n`);
913
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} deployment stop <slug> [--team <id>] [--json] [--no-wait]\n`);
1181
914
  return 1;
1182
915
  }
1183
916
  const ctx = await prepare(options);
1184
917
  if (typeof ctx === "number") {
1185
918
  return ctx;
1186
919
  }
1187
- // Stop takes only a slug, so there is no manifest to dispatch on (unlike
1188
- // deploy). The v2 agentsdk control plane goes first: v1 endpoints refuse
1189
- // `architecture: "v2"` slugs with a 409 rather than a 404, so v1-first
1190
- // could not fall through. A v2 404 (including an older backend without
1191
- // the `/internal/agentsdk` mount) falls back to the v1 stop.
920
+ // Stop takes only a slug, so there is no manifest to dispatch on. The v2
921
+ // agentsdk control plane goes first: v1 endpoints refuse `architecture:
922
+ // "v2"` slugs with a 409 rather than a 404. A v2 404 falls back to the v1
923
+ // stop, the exit ramp for a deployment not yet on v2.
1192
924
  let architecture = "v2";
1193
925
  let accepted;
1194
926
  try {
@@ -1200,7 +932,7 @@ export async function cmdStop(slug, options) {
1200
932
  }
1201
933
  catch (error) {
1202
934
  if (!(error instanceof DeployApiError) || error.status !== 404) {
1203
- return renderApiError(error, ctx.err);
935
+ throw apiError(error);
1204
936
  }
1205
937
  if (options.cancelRuns === true) {
1206
938
  ctx.err(`Canceling active runs while stopping is supported only for Agent SDK v2 deployments.\n`);
@@ -1211,7 +943,7 @@ export async function cmdStop(slug, options) {
1211
943
  architecture = "v1";
1212
944
  }
1213
945
  catch (v1Error) {
1214
- return renderApiError(v1Error, ctx.err);
946
+ throw apiError(v1Error);
1215
947
  }
1216
948
  }
1217
949
  const cancellation = "cancellation" in accepted ? accepted.cancellation : undefined;
@@ -1235,13 +967,14 @@ export async function cmdStop(slug, options) {
1235
967
  : await pollUntil(ctx, slug, new Set(["stopped"]), () => ctx.client.getDeployment({ teamId: ctx.teamId, slug }));
1236
968
  }
1237
969
  catch (error) {
1238
- return renderApiError(error, ctx.err);
970
+ throw apiError(error);
1239
971
  }
1240
972
  if (ctx.json) {
1241
- ctx.out(`${JSON.stringify(detail, null, 2)}\n`);
973
+ // One document: the cancellation result rides along with the detail.
974
+ ctx.out(`${JSON.stringify(cancellation === undefined ? detail : { ...detail, cancellation }, null, 2)}\n`);
1242
975
  }
1243
976
  else if (stoppedGlobally) {
1244
- ctx.out(`Stopped ${slug} across all tenants (team ${ctx.teamId}); resume with \`${CLI} start ${slug}\`.\n`);
977
+ ctx.out(`Stopped ${slug} across all tenants (team ${ctx.teamId}); resume with \`${CLI} deployment start ${slug}\`.\n`);
1245
978
  }
1246
979
  else {
1247
980
  ctx.out(`Stopped ${slug} (team ${ctx.teamId}).\n`);
@@ -1252,19 +985,21 @@ export async function cmdStop(slug, options) {
1252
985
  return 0;
1253
986
  }
1254
987
  function writeCancellationStarted(ctx, cancellation, slug) {
1255
- ctx.out(`Started cancellation across ${cancellation.batchesStarted} deployment batch(es).\n`);
1256
- if (cancellation.sessionsMarkedFailed !== undefined) {
1257
- ctx.out(`Marked ${cancellation.sessionsMarkedFailed} factory session(s) failed.\n`);
988
+ if (!ctx.json) {
989
+ ctx.out(`Started cancellation across ${cancellation.batchesStarted} deployment batch(es).\n`);
990
+ if (cancellation.sessionsMarkedFailed !== undefined) {
991
+ ctx.out(`Marked ${cancellation.sessionsMarkedFailed} factory session(s) failed.\n`);
992
+ }
1258
993
  }
1259
994
  if (cancellation.failed > 0) {
1260
- ctx.err(`Failed to start ${cancellation.failed} cancellation batch(es); retry with \`${CLI} cancel-runs ${slug}\`.\n`);
995
+ ctx.err(`Failed to start ${cancellation.failed} cancellation batch(es); retry with \`${CLI} deployment cancel-runs ${slug}\`.\n`);
1261
996
  return 1;
1262
997
  }
1263
998
  return 0;
1264
999
  }
1265
1000
  export async function cmdStart(slug, options) {
1266
1001
  if (slug === undefined || slug === "") {
1267
- (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} start <slug> [--team <id>] [--json]\n`);
1002
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} deployment start <slug> [--team <id>] [--json]\n`);
1268
1003
  return 1;
1269
1004
  }
1270
1005
  const ctx = await prepare(options);
@@ -1285,12 +1020,12 @@ export async function cmdStart(slug, options) {
1285
1020
  return 0;
1286
1021
  }
1287
1022
  catch (error) {
1288
- return renderApiError(error, ctx.err);
1023
+ throw apiError(error);
1289
1024
  }
1290
1025
  }
1291
1026
  export async function cmdKill(slug, options) {
1292
1027
  if (slug === undefined || slug === "") {
1293
- (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} kill <slug> [--team <id>] [--json]\n`);
1028
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} deployment kill <slug> [--team <id>] [--json]\n`);
1294
1029
  return 1;
1295
1030
  }
1296
1031
  const ctx = await prepare(options);
@@ -1302,7 +1037,7 @@ export async function cmdKill(slug, options) {
1302
1037
  accepted = await ctx.client.killAgentkit({ teamId: ctx.teamId, slug });
1303
1038
  }
1304
1039
  catch (error) {
1305
- return renderApiError(error, ctx.err);
1040
+ throw apiError(error);
1306
1041
  }
1307
1042
  if (ctx.json) {
1308
1043
  ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
@@ -1311,8 +1046,7 @@ export async function cmdKill(slug, options) {
1311
1046
  ctx.out(accepted.scope === "global"
1312
1047
  ? `Killed ${slug} across all tenants (team ${ctx.teamId}): deploys locked, admission stopped.\n`
1313
1048
  : `Killed ${slug} (team ${ctx.teamId}): deploys locked, admission stopped.\n`);
1314
- ctx.out(`Resume traffic with \`${CLI} unlock-deploys ${slug}\` then \`${CLI} start ${slug}\`.\n`);
1315
- ctx.out(`Unlock deploys with \`${CLI} unlock-deploys ${slug}\`.\n`);
1049
+ ctx.out(`Resume traffic with \`${CLI} deployment unlock ${slug}\` then \`${CLI} deployment start ${slug}\`.\n`);
1316
1050
  }
1317
1051
  if (accepted.cancellation !== undefined) {
1318
1052
  return writeCancellationStarted(ctx, accepted.cancellation, slug);
@@ -1321,7 +1055,7 @@ export async function cmdKill(slug, options) {
1321
1055
  }
1322
1056
  export async function cmdUnlockDeploys(slug, options) {
1323
1057
  if (slug === undefined || slug === "") {
1324
- (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} unlock-deploys <slug> [--team <id>] [--json]\n`);
1058
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} deployment unlock <slug> [--team <id>] [--json]\n`);
1325
1059
  return 1;
1326
1060
  }
1327
1061
  const ctx = await prepare(options);
@@ -1342,12 +1076,12 @@ export async function cmdUnlockDeploys(slug, options) {
1342
1076
  return 0;
1343
1077
  }
1344
1078
  catch (error) {
1345
- return renderApiError(error, ctx.err);
1079
+ throw apiError(error);
1346
1080
  }
1347
1081
  }
1348
1082
  export async function cmdCancelRuns(slug, options) {
1349
1083
  if (slug === undefined || slug === "") {
1350
- (options.err ?? ((text) => void process.stderr.write(text)))(`Usage: ${CLI} cancel-runs <slug> [--team <id>] [--json]\n`);
1084
+ (options.err ?? ((text) => void process.stderr.write(text)))(`Usage: ${CLI} deployment cancel-runs <slug> [--team <id>] [--json]\n`);
1351
1085
  return 1;
1352
1086
  }
1353
1087
  const ctx = await prepare(options);
@@ -1362,7 +1096,7 @@ export async function cmdCancelRuns(slug, options) {
1362
1096
  });
1363
1097
  }
1364
1098
  catch (error) {
1365
- return renderApiError(error, ctx.err);
1099
+ throw apiError(error);
1366
1100
  }
1367
1101
  if (ctx.json) {
1368
1102
  ctx.out(`${JSON.stringify(result, null, 2)}\n`);
@@ -1384,7 +1118,7 @@ export async function cmdCancelRuns(slug, options) {
1384
1118
  // ============================================================================
1385
1119
  export async function cmdEventRepos(slug, repositories, options) {
1386
1120
  if (slug === undefined || slug === "") {
1387
- (options.err ?? ((text) => void process.stderr.write(text)))(`Usage: ${CLI} event-repos <slug> --repo <owner/name>... [--team <id>] [--json]\n`);
1121
+ (options.err ?? ((text) => void process.stderr.write(text)))(`Usage: ${CLI} deployment update <slug> --event-repo <owner/name>... [--team <id>] [--json]\n`);
1388
1122
  return 1;
1389
1123
  }
1390
1124
  const ctx = await prepare(options);
@@ -1400,7 +1134,7 @@ export async function cmdEventRepos(slug, repositories, options) {
1400
1134
  });
1401
1135
  }
1402
1136
  catch (error) {
1403
- return renderApiError(error, ctx.err);
1137
+ throw apiError(error);
1404
1138
  }
1405
1139
  if (ctx.json) {
1406
1140
  ctx.out(`${JSON.stringify({ repositories: configured }, null, 2)}\n`);
@@ -1420,14 +1154,14 @@ export async function cmdEventRepos(slug, repositories, options) {
1420
1154
  const RELEASE_ID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
1421
1155
  export async function cmdUpgrade(args, options) {
1422
1156
  return cmdPinRelease(args, options, {
1423
- usage: `Usage: ${CLI} upgrade <slug> [--release <id|version>] [--team <id>] [--json]\n`,
1157
+ usage: `Usage: ${CLI} deployment upgrade <slug> [--release <id|version>] [--team <id>] [--json]\n`,
1424
1158
  pin: (client, request) => client.upgradeAgentkitInstall(request),
1425
1159
  success: (slug, releaseId) => `${slug} now runs release ${releaseId}.\n`,
1426
1160
  });
1427
1161
  }
1428
1162
  export async function cmdRollback(args, options) {
1429
1163
  return cmdPinRelease(args, options, {
1430
- usage: `Usage: ${CLI} rollback <slug> [--release <id|version>] [--team <id>] [--json]\n`,
1164
+ usage: `Usage: ${CLI} deployment rollback <slug> [--release <id|version>] [--team <id>] [--json]\n`,
1431
1165
  pin: (client, request) => client.rollbackAgentkitInstall(request),
1432
1166
  success: (slug, releaseId) => `${slug} rolled back to release ${releaseId}.\n`,
1433
1167
  });
@@ -1456,7 +1190,7 @@ async function cmdPinRelease(args, options, pin) {
1456
1190
  });
1457
1191
  }
1458
1192
  catch (error) {
1459
- return renderApiError(error, ctx.err);
1193
+ throw apiError(error);
1460
1194
  }
1461
1195
  if (ctx.json) {
1462
1196
  ctx.out(`${JSON.stringify({ releaseId }, null, 2)}\n`);
@@ -1471,7 +1205,7 @@ async function cmdPinRelease(args, options, pin) {
1471
1205
  // ============================================================================
1472
1206
  export async function cmdDelete(slug, options) {
1473
1207
  if (slug === undefined || slug === "") {
1474
- (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} delete <slug> [--team <id>] [--json] [--no-wait]\n`);
1208
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} deployment delete <slug> [--team <id>] [--json] [--no-wait]\n`);
1475
1209
  return 1;
1476
1210
  }
1477
1211
  const ctx = await prepare(options);
@@ -1479,8 +1213,8 @@ export async function cmdDelete(slug, options) {
1479
1213
  return ctx;
1480
1214
  }
1481
1215
  // Same dispatch as `stop`: v1 409s architecture-v2 slugs, so the v2
1482
- // DELETE goes first. A v2 404 (missing slug, or an older backend)
1483
- // falls through to the v1 agent-serve delete.
1216
+ // DELETE goes first. A v2 404 falls through to the v1 delete, the exit
1217
+ // ramp for a deployment not yet on v2.
1484
1218
  let architecture = "v2";
1485
1219
  let accepted;
1486
1220
  try {
@@ -1488,7 +1222,7 @@ export async function cmdDelete(slug, options) {
1488
1222
  }
1489
1223
  catch (error) {
1490
1224
  if (!(error instanceof DeployApiError) || error.status !== 404) {
1491
- return renderApiError(error, ctx.err);
1225
+ throw apiError(error);
1492
1226
  }
1493
1227
  try {
1494
1228
  accepted = await ctx.client.deleteDeployment({
@@ -1498,7 +1232,7 @@ export async function cmdDelete(slug, options) {
1498
1232
  architecture = "v1";
1499
1233
  }
1500
1234
  catch (v1Error) {
1501
- return renderApiError(v1Error, ctx.err);
1235
+ throw apiError(v1Error);
1502
1236
  }
1503
1237
  }
1504
1238
  if (ctx.noWait) {
@@ -1516,7 +1250,7 @@ export async function cmdDelete(slug, options) {
1516
1250
  : ctx.client.getDeployment({ teamId: ctx.teamId, slug }));
1517
1251
  }
1518
1252
  catch (error) {
1519
- return renderApiError(error, ctx.err);
1253
+ throw apiError(error);
1520
1254
  }
1521
1255
  if (ctx.json) {
1522
1256
  ctx.out(`${JSON.stringify({ slug, status: "deleted" }, null, 2)}\n`);
@@ -1531,7 +1265,7 @@ export async function cmdDelete(slug, options) {
1531
1265
  // ============================================================================
1532
1266
  export async function cmdRotateToken(slug, options) {
1533
1267
  if (slug === undefined || slug === "") {
1534
- (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} rotate-token <slug> [--team <id>]\n`);
1268
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} deployment rotate-token <slug> [--team <id>]\n`);
1535
1269
  return 1;
1536
1270
  }
1537
1271
  const ctx = await prepare(options);
@@ -1540,24 +1274,13 @@ export async function cmdRotateToken(slug, options) {
1540
1274
  }
1541
1275
  let aliasToken;
1542
1276
  try {
1543
- const architecture = await deploymentArchitecture({
1544
- client: ctx.client,
1277
+ aliasToken = await ctx.client.rotateAgentsdkAliasToken({
1545
1278
  teamId: ctx.teamId,
1546
1279
  slug,
1547
1280
  });
1548
- aliasToken =
1549
- architecture === "v2"
1550
- ? await ctx.client.rotateAgentsdkAliasToken({
1551
- teamId: ctx.teamId,
1552
- slug,
1553
- })
1554
- : await ctx.client.rotateAliasToken({
1555
- teamId: ctx.teamId,
1556
- slug,
1557
- });
1558
1281
  }
1559
1282
  catch (error) {
1560
- return renderApiError(error, ctx.err);
1283
+ throw apiError(error);
1561
1284
  }
1562
1285
  if (ctx.json) {
1563
1286
  ctx.out(`${JSON.stringify({ aliasToken }, null, 2)}\n`);
@@ -1569,17 +1292,10 @@ export async function cmdRotateToken(slug, options) {
1569
1292
  // ============================================================================
1570
1293
  // secrets set|list|unset
1571
1294
  // ============================================================================
1572
- async function secretDeploymentArchitecture(ctx, slug) {
1573
- return deploymentArchitecture({
1574
- client: ctx.client,
1575
- teamId: ctx.teamId,
1576
- slug,
1577
- });
1578
- }
1579
1295
  export async function cmdSecretsSet(slug, specs, options) {
1580
1296
  const usageErr = options.err ?? ((t) => void process.stderr.write(t));
1581
1297
  if (slug === undefined || slug === "" || specs.length === 0) {
1582
- usageErr(`Usage: ${CLI} secrets set <slug> NAME [NAME2 ...] [--team <id>] [--json]\n` +
1298
+ usageErr(`Usage: ${CLI} secret set <slug> NAME [NAME2 ...] [--team <id>] [--json]\n` +
1583
1299
  ` Hidden prompt on a TTY. One NAME reads all of stdin (redirect a PEM).\n` +
1584
1300
  ` Several NAMEs: one stdin line each.\n` +
1585
1301
  ` Opt-in (leaks into argv / agent terminals): NAME=VALUE … --from-argv\n`);
@@ -1602,9 +1318,9 @@ export async function cmdSecretsSet(slug, specs, options) {
1602
1318
  if (hasArgvValues && options.fromArgv !== true) {
1603
1319
  usageErr(`Refusing NAME=VALUE on argv (shows up in shell history and agent-captured terminals).\n` +
1604
1320
  `Pass names only:\n` +
1605
- ` ${CLI} secrets set ${slug} NAME\n` +
1321
+ ` ${CLI} secret set ${slug} NAME\n` +
1606
1322
  `Hidden prompt on a TTY. One NAME reads all of stdin, including newlines:\n` +
1607
- ` ${CLI} secrets set ${slug} NAME < ./secret.pem\n` +
1323
+ ` ${CLI} secret set ${slug} NAME < ./secret.pem\n` +
1608
1324
  `Several NAMEs take one stdin line each.\n`);
1609
1325
  return 1;
1610
1326
  }
@@ -1618,10 +1334,13 @@ export async function cmdSecretsSet(slug, specs, options) {
1618
1334
  const stdin = options.stdin ?? process.stdin;
1619
1335
  const secrets = [];
1620
1336
  let secretNames;
1621
- let architecture;
1622
1337
  try {
1623
1338
  const only = parsed.length === 1 ? parsed[0] : undefined;
1624
- if (only !== undefined && only.value === undefined && stdin.isTTY !== true) {
1339
+ if (dryRunActive()) {
1340
+ // A dry run reads no value: the request below stops with names only.
1341
+ secrets.push(...parsed.map((entry) => ({ name: entry.name, value: "" })));
1342
+ }
1343
+ else if (only !== undefined && only.value === undefined && stdin.isTTY !== true) {
1625
1344
  secrets.push({
1626
1345
  name: only.name,
1627
1346
  value: await readWholeStdinValue(stdin, only.name),
@@ -1636,22 +1355,14 @@ export async function cmdSecretsSet(slug, specs, options) {
1636
1355
  });
1637
1356
  }
1638
1357
  }
1639
- architecture = await secretDeploymentArchitecture(ctx, slug);
1640
- secretNames =
1641
- architecture === "v2"
1642
- ? await ctx.client.setAgentkitSecrets({
1643
- teamId: ctx.teamId,
1644
- slug,
1645
- secrets,
1646
- })
1647
- : await ctx.client.setSecrets({
1648
- teamId: ctx.teamId,
1649
- slug,
1650
- secrets,
1651
- });
1358
+ secretNames = await ctx.client.setAgentkitSecrets({
1359
+ teamId: ctx.teamId,
1360
+ slug,
1361
+ secrets,
1362
+ });
1652
1363
  }
1653
1364
  catch (error) {
1654
- return renderApiError(error, ctx.err);
1365
+ throw apiError(error);
1655
1366
  }
1656
1367
  if (ctx.json) {
1657
1368
  ctx.out(`${JSON.stringify({ secretNames }, null, 2)}\n`);
@@ -1659,14 +1370,12 @@ export async function cmdSecretsSet(slug, specs, options) {
1659
1370
  }
1660
1371
  ctx.out(`Set ${secrets.length} secret${secrets.length === 1 ? "" : "s"} on ${slug}.\n` +
1661
1372
  `Secrets now set: ${secretNames.join(", ")}\n` +
1662
- (architecture === "v2"
1663
- ? `The next task picks them up; no redeploy is required.\n`
1664
- : `The engine picks them up on its next deploy.\n`));
1373
+ `The next task picks them up; no redeploy is required.\n`);
1665
1374
  return 0;
1666
1375
  }
1667
1376
  export async function cmdSecretsList(slug, options) {
1668
1377
  if (slug === undefined || slug === "") {
1669
- (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} secrets list <slug> [--team <id>] [--json]\n`);
1378
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} secret list <slug> [--team <id>] [--json]\n`);
1670
1379
  return 1;
1671
1380
  }
1672
1381
  const ctx = await prepare(options);
@@ -1675,29 +1384,35 @@ export async function cmdSecretsList(slug, options) {
1675
1384
  }
1676
1385
  let secrets;
1677
1386
  try {
1678
- const architecture = await secretDeploymentArchitecture(ctx, slug);
1679
- secrets =
1680
- architecture === "v2"
1681
- ? await ctx.client.listAgentkitSecrets({ teamId: ctx.teamId, slug })
1682
- : await ctx.client.listSecrets({ teamId: ctx.teamId, slug });
1387
+ secrets = await ctx.client.listAgentkitSecrets({ teamId: ctx.teamId, slug });
1683
1388
  }
1684
1389
  catch (error) {
1685
- return renderApiError(error, ctx.err);
1390
+ throw apiError(error);
1686
1391
  }
1392
+ // The secrets route returns every secret at once, so page here.
1393
+ const page = pageLocally(secrets, ctx.list);
1687
1394
  if (ctx.json) {
1688
- ctx.out(`${JSON.stringify({ secrets }, null, 2)}\n`);
1395
+ printListJson(page, { fields: ctx.fields, write: ctx.out });
1689
1396
  return 0;
1690
1397
  }
1691
1398
  if (secrets.length === 0) {
1692
- ctx.out(`No secrets set on ${slug}. Add one with \`${CLI} secrets set ${slug} NAME\`.\n`);
1399
+ ctx.out(`No secrets set on ${slug}. Add one with \`${CLI} secret set ${slug} NAME\`.\n`);
1693
1400
  return 0;
1694
1401
  }
1695
- ctx.out(`${renderTable(["NAME", "CREATED"], secrets.map((secret) => [secret.name, secret.createdAt]))}\n`);
1402
+ if (page.items.length === 0) {
1403
+ ctx.out("No more secrets.\n");
1404
+ return 0;
1405
+ }
1406
+ ctx.out(`${renderTable(["NAME", "CREATED"], page.items.map((secret) => [secret.name, secret.createdAt]))}\n`);
1407
+ const hint = nextPageHint(page.nextPageToken);
1408
+ if (hint !== undefined) {
1409
+ ctx.err(hint);
1410
+ }
1696
1411
  return 0;
1697
1412
  }
1698
1413
  export async function cmdSecretsUnset(slug, name, options) {
1699
1414
  if (slug === undefined || slug === "" || name === undefined || name === "") {
1700
- (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} secrets unset <slug> NAME [--team <id>]\n`);
1415
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} secret delete <slug> NAME [--team <id>]\n`);
1701
1416
  return 1;
1702
1417
  }
1703
1418
  const ctx = await prepare(options);
@@ -1705,24 +1420,23 @@ export async function cmdSecretsUnset(slug, name, options) {
1705
1420
  return ctx;
1706
1421
  }
1707
1422
  try {
1708
- const architecture = await secretDeploymentArchitecture(ctx, slug);
1709
- if (architecture === "v2") {
1710
- await ctx.client.deleteAgentkitSecret({
1711
- teamId: ctx.teamId,
1712
- slug,
1713
- name,
1714
- });
1715
- }
1716
- else {
1717
- await ctx.client.deleteSecret({ teamId: ctx.teamId, slug, name });
1718
- }
1423
+ await ctx.client.deleteAgentkitSecret({
1424
+ teamId: ctx.teamId,
1425
+ slug,
1426
+ name,
1427
+ });
1719
1428
  }
1720
1429
  catch (error) {
1721
- if (error instanceof DeployApiError && error.status === 404) {
1722
- ctx.err(`No secret named ${name} on deployment ${slug} — check \`${CLI} secrets list ${slug}\` (and the slug / --team).\n`);
1723
- return 1;
1430
+ if (error instanceof DeployApiError &&
1431
+ error.status === 404 &&
1432
+ error.message === SECRET_NOT_FOUND_MESSAGE) {
1433
+ throw new CliError(`No secret named ${name} on deployment ${slug}.`, {
1434
+ code: "not_found",
1435
+ hint: `Check \`${CLI} secret list ${slug}\` (and the slug / --team).`,
1436
+ cause: error,
1437
+ });
1724
1438
  }
1725
- return renderApiError(error, ctx.err);
1439
+ throw apiError(error);
1726
1440
  }
1727
1441
  if (ctx.json) {
1728
1442
  ctx.out(`${JSON.stringify({ removed: name }, null, 2)}\n`);
@@ -1747,7 +1461,7 @@ function createSecretValueReader(stdin, err) {
1747
1461
  return async (name) => {
1748
1462
  const line = await readLine();
1749
1463
  if (line === undefined) {
1750
- throw new DeployApiError(`stdin ended before a value for ${name} was provided (pipe one line per secret).`, 0);
1464
+ throw new CliError(`stdin ended before a value for ${name} was provided (pipe one line per secret).`, { code: "invalid_argument" });
1751
1465
  }
1752
1466
  return line;
1753
1467
  };
@@ -1801,7 +1515,7 @@ function promptHidden(stdin, err, prompt) {
1801
1515
  }
1802
1516
  if (ch === "\u0003") {
1803
1517
  cleanup();
1804
- reject(new DeployApiError("Aborted.", 0));
1518
+ reject(new CliError("Aborted."));
1805
1519
  return;
1806
1520
  }
1807
1521
  if (ch === "\u007f" || ch === "\b") {
@@ -1824,7 +1538,9 @@ function promptHidden(stdin, err, prompt) {
1824
1538
  async function readWholeStdinValue(stdin, name) {
1825
1539
  const raw = await readStreamText(stdin);
1826
1540
  if (raw === "") {
1827
- throw new DeployApiError(`stdin ended before a value for ${name} was provided.`, 0);
1541
+ throw new CliError(`stdin ended before a value for ${name} was provided.`, {
1542
+ code: "invalid_argument",
1543
+ });
1828
1544
  }
1829
1545
  return stripOneTrailingNewline(raw);
1830
1546
  }
@@ -1911,7 +1627,7 @@ export function createLineReader(stream) {
1911
1627
  */
1912
1628
  async function pollUntil(ctx, slug, terminal, fetchDetail) {
1913
1629
  const startedAt = Date.now();
1914
- const tty = process.stderr.isTTY === true;
1630
+ const tty = process.stderr.isTTY;
1915
1631
  let lastLabel;
1916
1632
  let sawProgress = false;
1917
1633
  const report = (detail) => {
@@ -1971,7 +1687,7 @@ async function pollUntil(ctx, slug, terminal, fetchDetail) {
1971
1687
  if (Date.now() - startedAt >= ctx.timeoutMs) {
1972
1688
  finishProgressLine();
1973
1689
  const last = deployProgressLabel(detail);
1974
- throw new DeployApiError(`Timed out after ${Math.round(ctx.timeoutMs / 1000)}s waiting for ${slug} (last: ${last}). It may still converge — check \`${CLI} deployment ${slug} --team ${ctx.teamId}\`.`, 0);
1690
+ throw new CliError(`Timed out after ${Math.round(ctx.timeoutMs / 1000)}s waiting for ${slug} (last: ${last}). It may still converge — check \`${CLI} deployment get ${slug} --team ${ctx.teamId}\`.`, { code: "pending" });
1975
1691
  }
1976
1692
  await sleep(ctx.pollIntervalMs);
1977
1693
  }
@@ -1994,7 +1710,7 @@ function transientDeployStatusWaitMs(error, pollIntervalMs) {
1994
1710
  */
1995
1711
  async function pollUntilGone(ctx, slug, getDetail) {
1996
1712
  const startedAt = Date.now();
1997
- const tty = process.stderr.isTTY === true;
1713
+ const tty = process.stderr.isTTY;
1998
1714
  let sawProgress = false;
1999
1715
  const report = (label) => {
2000
1716
  if (ctx.json) {
@@ -2026,7 +1742,7 @@ async function pollUntilGone(ctx, slug, getDetail) {
2026
1742
  }
2027
1743
  if (Date.now() - startedAt >= ctx.timeoutMs) {
2028
1744
  finishProgressLine();
2029
- throw new DeployApiError(`Timed out after ${Math.round(ctx.timeoutMs / 1000)}s waiting for ${slug} to disappear. It may still be deleting — check \`${CLI} deployment ${slug} --team ${ctx.teamId}\`.`, 0);
1745
+ throw new CliError(`Timed out after ${Math.round(ctx.timeoutMs / 1000)}s waiting for ${slug} to disappear. It may still be deleting — check \`${CLI} deployment get ${slug} --team ${ctx.teamId}\`.`, { code: "pending" });
2030
1746
  }
2031
1747
  await sleep(ctx.pollIntervalMs);
2032
1748
  }
@@ -2035,7 +1751,7 @@ function aliasTokenBlock(aliasToken) {
2035
1751
  return (`\n Alias token (shown ONCE — save it now, it cannot be retrieved again):\n\n` +
2036
1752
  ` ${aliasToken}\n\n` +
2037
1753
  ` Send it as the X-Agent-Alias-Token header on requests to the alias URL.\n` +
2038
- ` Lost tokens: \`${CLI} rotate-token <slug>\` mints a replacement.\n\n`);
1754
+ ` Lost tokens: \`${CLI} deployment rotate-token <slug>\` mints a replacement.\n\n`);
2039
1755
  }
2040
1756
  /**
2041
1757
  * `: <reason>` suffix for a deploy that ended in a non-running state, or
@@ -2047,20 +1763,30 @@ function deployFailureDetail(lastError) {
2047
1763
  }
2048
1764
  return `: ${sanitizeCustomerError(lastError.trim())}`;
2049
1765
  }
2050
- export function renderApiError(error, err, context) {
2051
- if (error instanceof DeployApiError) {
2052
- err(`${error.message}\n`);
2053
- if (error.status === 409 && error.message.includes("application multiTenant does not match")) {
2054
- if (context?.multiTenant === true) {
2055
- err("This slug is a single-tenant application. Redeploy it without --multi-tenant.\n");
2056
- }
2057
- else if (context?.teamId === MULTI_COMPONENT_ALLOWED_TEAM_ID) {
2058
- err("This slug is a Cursor-managed (multi-tenant) product. Redeploy it with --multi-tenant.\n");
2059
- }
1766
+ /**
1767
+ * A Cursor backend error as a {@link CliError}: its HTTP status picks the
1768
+ * error code (and so the exit code), plus a hint where one helps. Any other
1769
+ * error comes back unchanged, so `throw apiError(error)` keeps it.
1770
+ */
1771
+ export function apiError(error, context) {
1772
+ if (!(error instanceof DeployApiError)) {
1773
+ return error;
1774
+ }
1775
+ let hint;
1776
+ if (error.status === 409 && error.message.includes("application multiTenant does not match")) {
1777
+ if (context?.multiTenant === true) {
1778
+ hint = "This slug is a single-tenant application. Redeploy it without --multi-tenant.";
1779
+ }
1780
+ else if (context?.teamId === MULTI_COMPONENT_ALLOWED_TEAM_ID) {
1781
+ hint =
1782
+ "This slug is a Cursor-managed (multi-tenant) product. Redeploy it with --multi-tenant.";
2060
1783
  }
2061
- return 1;
2062
1784
  }
2063
- throw error;
1785
+ return new CliError(error.message, {
1786
+ code: errorCodeForStatus(error.status),
1787
+ hint,
1788
+ cause: error,
1789
+ });
2064
1790
  }
2065
1791
  export function renderTable(header, rows) {
2066
1792
  const widths = header.map((h, i) => Math.max(h.length, ...rows.map((row) => (row[i] ?? "").length)));