@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
@@ -1,1640 +1,40 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * agent-serve CLI.
4
- *
5
- * agent-sdk serve [--dir .] [--port 3000] [--host 127.0.0.1] [--dev]
6
- * agent-sdk dev [path] [--port 3000] [--host 127.0.0.1]
7
- * agent-sdk docs [--port 0] [--host 127.0.0.1] [--print]
8
- * agent-sdk chat [--url http://127.0.0.1:3000] [--message "..."] [--json]
9
- * agent-sdk resume [sessionId] [--url | --prod] [--message "..."]
10
- * agent-sdk run [--dir .] [--message "..."] [--json|--text]
11
- * agent-sdk trajectory --events <file.ndjson>
12
- * agent-sdk init [dir] [--json]
13
- * agent-sdk convert-automation <url> [--dir <path>] [--json]
14
- * agent-sdk migrate [--dir .] [--no-wait] [--json]
15
- * agent-sdk eval [--dir .] [evalId...]
16
- * agent-sdk validate [--dir .] [--json]
17
- * agent-sdk slack <subcommand>
3
+ * The `agent-sdk` CLI entry point. Every command is declared once in
4
+ * `internal/cli/commands/`, which also produces `--help` and
5
+ * `agent-sdk help --json`. Run `agent-sdk` for the command index.
18
6
  */
19
- import { spawn } from "node:child_process";
20
- import { readFile } from "node:fs/promises";
21
- import { resolve } from "node:path";
22
- import { parseArgs } from "node:util";
23
- import { serve } from "../index.js";
24
7
  import { registerAuthoredModuleLoaders } from "../internal/authored-loaders.js";
25
- import { formatDiagnostics, formatValidateJson, projectInfo, resolveAgentMounts, } from "../internal/discovery.js";
26
- import { cmdCall, cmdChat, cmdCost, cmdEval, cmdEvalCancel, cmdEvalStatus, cmdInit, cmdLogs, cmdPlayground, cmdResume, cmdRun, cmdSession, cmdSessions, cmdSkill, cmdTrajectory, } from "../internal/cli-ax.js";
27
- import { cmdCancelRuns, cmdDelete, cmdDeploy, cmdDeploymentStatus, cmdDeployments, cmdEventRepos, cmdKill, cmdRollback, cmdRotateToken, cmdSecretsList, cmdSecretsSet, cmdSecretsUnset, cmdStart, cmdStop, cmdUnlockDeploys, cmdUpgrade, } from "../internal/cli-deploy.js";
28
- import { cmdImagesList, cmdImagesPush, cmdImagesRm } from "../internal/cli-images.js";
29
- import { cmdManifest } from "../internal/cli-manifest.js";
30
- import { CLI_COMMAND_NAME as CLI, formatCliVersion, PACKAGE_NAME, packageVersion, } from "../internal/distribution.js";
31
- import { initFlagConflict } from "../internal/init-project.js";
32
- import { v2HostedVerifyHint } from "../internal/legacy-command-guard.js";
33
- import { loadAgentLocalEnv } from "../internal/local-env.js";
34
- import { ENTER_RESTART_EXIT_CODE, isServeRestartWorker, runEnterRestartSupervisor, } from "../internal/serve-restart.js";
8
+ import { COMMANDS } from "../internal/cli/commands/index.js";
9
+ import { isHelpRequest, runCli } from "../internal/cli/dispatch.js";
10
+ import { askOnTty, writeStdout } from "../internal/cli/io.js";
11
+ import { formatCliVersion } from "../internal/distribution.js";
12
+ import { isServeRestartWorker } from "../internal/serve-restart.js";
35
13
  import { flushSessionRunFatal } from "../internal/session-run-log.js";
36
- import { clearTerminal, stdoutPalette } from "../internal/terminal-style.js";
37
- import { cmdUpdate, warnIfOutdated } from "../internal/update-check.js";
38
- const HELP = `${CLI} — serve a filesystem-defined Cursor agent over channels
39
-
40
- Usage:
41
- ${CLI} serve [--dir <path>] [--port <n>] [--host <host>] [--dev]
42
- [--mode single|multi] [--api-key <key>] [--no-schedules]
43
- [--public-url <url>]
44
- [--cursor-events --repo <owner/name>]...
45
- ${CLI} dev [path] [--port <n>] [--host <host>] …
46
- Same flags as serve; implies --dev. Path defaults to
47
- the current directory (or pass --dir).
48
- ${CLI} chat [--url <baseUrl> | --prod] [--message <text>] [--json] [--text]
49
- [--session <id> | --resume] [--continuation-token <t>]
50
- [--slug <slug>] [--team <id>]
51
- ${CLI} resume [sessionId] [--url <baseUrl> | --prod] [--message <text>]
52
- [--json] [--text] [--continuation-token <t>]
53
- [--slug <slug>] [--team <id>]
54
- ${CLI} logs [<ses_>] [--url <baseUrl> | --prod] [--session <ses_>]
55
- [--once] [--json] [--slug <slug>] [--team <id>]
56
- [--dir <path>]
57
- ${CLI} sessions [--url <baseUrl> | --prod] [--json]
58
- [--slug <slug>] [--team <id>] [--dir <path>]
59
- v2: unsupported. ${v2HostedVerifyHint()}
60
- ${CLI} session <sessionId> [--url <baseUrl> | --prod]
61
- [--json | --text | --events] [--out <file.ndjson>]
62
- [--slug <slug>] [--team <id>] [--dir <path>]
63
- or: --prod [<sessionId>] --slug <slug> --message "…" [--dry-run] [--as-of <instant>]
64
- ${CLI} cost [sessionId] [--url <baseUrl> | --prod] [--json]
65
- [--slug <slug>] [--team <id>] [--dir <path>]
66
- ${CLI} playground [--url <baseUrl> | --prod] [--session <id>] [--print]
67
- [--slug <slug>] [--team <id>] [--dir <path>]
68
- ${CLI} docs [--port <n>] [--host <host>] [--print]
69
- ${CLI} run [--dir <path>] [--message <text>]... [--url <baseUrl> | --prod]
70
- [--session <id>] [--continuation-token <t>]
71
- [--events <file.ndjson>] [--no-events] [--text]
72
- [--timeout-ms <n>] [--no-stream] [--slug <slug>] [--team <id>]
73
- [--dry-run] [--as-of <instant>]
74
- ${CLI} trajectory --events <file.ndjson> [--text]
75
- ${CLI} call <tool> [--input <json>] [--dir <path> | --url <baseUrl> | --prod]
76
- [--session <id>] [--slug <slug>] [--team <id>]
77
- v2: unsupported. ${v2HostedVerifyHint()}
78
- ${CLI} skill <name> [--dir <path> | --url <baseUrl> | --prod]
79
- [--slug <slug>] [--team <id>] [--text]
80
- ${CLI} init [dir] [--template <name>] [--var id=value]... [--json]
81
- ${CLI} init [dir] --from-grokbot <recipe.json> [--answers <file>]
82
- [--dry-run] [--json]
83
- ${CLI} convert-automation <url> [--dir <path>] [--json]
84
- ${CLI} migrate [--dir <path>] [--repo <url>] [--ref <ref>] [--path <agentPath>]
85
- [--no-wait] [--json]
86
- ${CLI} install-skills [--print] [--json]
87
- ${CLI} mcp --prod [--slug <slug>] [--team <id>] [--dir <path>]
88
- | --url <baseUrl> [--bearer-token <t>]
89
- ${CLI} mcp install [--name <serverName>] [--print] [--json]
90
- (same target flags as mcp)
91
- ${CLI} mcp oauth <connection> [--dir <path>] [--store] [--slug <slug>]
92
- ${CLI} eval [--dir <path>] [evalId...] [--list] [--json]
93
- [--tag <tag>]... [--verbose] [--timeout-ms <n>]
94
- [--strict] [--max-concurrency <n>]
95
- [--junit <path>] [--artifacts <dir>|--no-artifacts]
96
- [--out <file.json>]
97
- [--skip-report] [--no-stream] [--no-wait]
98
- [--url <baseUrl>] [--slug <slug>]
99
- ${CLI} eval status [runId] --url <baseUrl> [--dir <path>] [--json]
100
- [--out <file.json>]
101
- ${CLI} eval cancel <runId> --url <baseUrl> [--dir <path>] [--json]
102
- ${CLI} info [--dir <path>] [--json]
103
- ${CLI} validate [--dir <path>] [--json]
104
- ${CLI} login [--api-key <key>] [--key-name <name>]
105
- ${CLI} logout
106
- ${CLI} whoami [--json]
107
- ${CLI} update
108
- ${CLI} version [--json]
109
- ${CLI} deploy [--dir <path>] [--slug <slug> | --all] [--team <id>] [--json]
110
- [--no-wait] [--repo <url>] [--ref <ref>]
111
- [--path <agentPath>] [--cursor-events-repo <repo>]...
112
- [--allow-domain <domain>]...
113
- ${CLI} manifest [--dir <path>] [--json]
114
- ${CLI} deployments [--team <id>] [--json]
115
- ${CLI} deployment <slug> [--team <id>] [--json]
116
- ${CLI} stop <slug> [--team <id>] [--json] [--no-wait] [--cancel-runs]
117
- ${CLI} start <slug> [--team <id>] [--json]
118
- ${CLI} kill <slug> [--team <id>] [--json]
119
- ${CLI} unlock-deploys <slug> [--team <id>] [--json]
120
- ${CLI} cancel-runs <slug> [--team <id>] [--json]
121
- ${CLI} event-repos <slug> [--repo <owner/name>]... [--team <id>] [--json]
122
- ${CLI} upgrade <slug> [--release <id|version>] [--team <id>] [--json]
123
- ${CLI} rollback <slug> [--release <id|version>] [--team <id>] [--json]
124
- ${CLI} delete <slug> [--team <id>] [--json] [--no-wait]
125
- ${CLI} rotate-token <slug> [--team <id>]
126
- ${CLI} secrets set <slug> NAME... | list <slug> | unset <slug> NAME
127
- [--team <id>] [--json] [--from-argv]
128
- ${CLI} slack <subcommand> …
129
- ${CLI} github <subcommand> …
130
-
131
- Commands:
132
- serve Serve agents under /<slug>/... (index at /). Runs \`${CLI} login\`
133
- when unsigned. On a TTY, press Enter to restart (re-executes this
134
- process so agent code, evals, and Vite reload).
135
- dev Local development: same as \`${CLI} serve --dev\` (manual
136
- schedule/reminder dispatch, unsigned GitHub loopback, Vite HMR).
137
- Also runs \`${CLI} login\` when unsigned.
138
- chat Interactive REPL against a running server (follow-ups keep the
139
- session + continuation token). Optional --message seeds the first
140
- turn then stays open on a TTY. --session reattaches (looks up the
141
- continuation token via /v1/sessions when omitted) and replays the
142
- transcript. --resume reattaches the most recently updated
143
- followable session (no id needed). --json is one-shot. Pass
144
- --prod to hit the team's hosted deployment (slug from --slug or
145
- the directory name).
146
- resume Reattach chat to a session (same as \`${CLI} chat --session <id>\`
147
- or \`${CLI} chat --resume\` with no id). Omit the session id to
148
- resume the previous followable session from /v1/sessions. Looks
149
- up the continuation token via /v1/sessions when
150
- --continuation-token is omitted, then replays the transcript.
151
- Pass --prod for a hosted deployment.
152
- logs Tail agent logs. Default follows (Ctrl-C to stop); --once dumps
153
- the current buffer. Without --prod, tails the local server (or
154
- --url). On a v1 deployment, --prod shows deploy progress until
155
- the deployment is running, then tails runtime logs. On
156
- architecture v2, --prod tails the output of the deployment's
157
- most recent sessions, each under a ==> ses_… <== header; pass a
158
- session id (positional or --session) to tail only that session.
159
- sessions List sessions on a running agent or a v1 --prod deployment.
160
- Unsupported on architecture v2. ${v2HostedVerifyHint()}
161
- session Show one session. On v2: \`${CLI} session <ses_> --prod --slug <slug>\`.
162
- Default: text trajectory. --json for trajectory
163
- JSON; --events for the raw event list. To continue interactively,
164
- use \`${CLI} resume [id]\`.
165
- cost Pull cost metrics. With a session id: per-turn token usage and
166
- estimated cost for that session. Without one: one row per
167
- session plus a total. Costs are the engine's recorded estimates
168
- from turn.completed events; --json for machine-readable reports.
169
- playground Open the web playground. --prod opens the v1 hosted alias or
170
- v2 portal UI; --session deep-links a session. --print skips
171
- opening a browser. Ctrl-C stops local credential proxies.
172
- docs Serve the shipped documentation site on loopback and open it
173
- (also: npx @cursor/bdk docs). No agent project required.
174
- --print skips opening a browser. Ctrl-C stops the server.
175
- run One-shot create→test loop: ephemeral server + JSON trajectory.
176
- Writes a single events.ndjson trace (summarize with trajectory).
177
- Streams tool calls and reply text to stderr when stderr is a TTY.
178
- Pass --prod to hit the hosted deployment instead of a local server.
179
- On an AgentSDK v2 slug, --prod starts a hosted session through
180
- the control plane (Temporal, no resident engine). ${v2HostedVerifyHint()}
181
- --session ses_… resumes that exact session. A 404 falls back to the v1
182
- engine alias.
183
- trajectory Summarize an events.ndjson file into a trajectory.
184
- call Call an authored server tool deterministically (no model turn)
185
- via POST /v1/tools/:toolName. --session runs it inside an
186
- existing session and records it on that session's event stream.
187
- Unsupported on architecture v2. ${v2HostedVerifyHint()}
188
- skill Read an authored skill deterministically (no model turn)
189
- via GET /v1/skills/:skillName. --text prints SKILL.md.
190
- init Scaffold a project (skipping existing files), npm install,
191
- run login when unsigned, then print next steps. Templates
192
- with init.json interview on a TTY; --var answers without a
193
- prompt. With --json or off a TTY, each question without a
194
- default needs --var. --json is machine-readable and never
195
- blocks on login. No directory: print the setup guide.
196
- --from-grokbot converts a Grok Bot recipe instead: it asks
197
- the export questions on a TTY or reads them from --answers
198
- (schema: schemas/grokbot-answers.schema.json), writes the
199
- project with SECRETS.md, a finish-the-export skill, and
200
- SLACK.md for Slack bots, and installs npm dependencies. The
201
- directory defaults to the answers' location. --dry-run
202
- prints the preview and writes nothing.
203
- convert-automation
204
- Export a Cursor Automation into an agentsdk project. <url> is
205
- the dashboard URL (…/automations/<uuid> or
206
- …/custom-agents/<uuid>) or a bare uuid. Fetches the definition
207
- with your Cursor credentials, writes the converted files into
208
- --dir (default ./<automation-name>), fills in the init scaffold
209
- around them (existing files are kept), and installs npm
210
- dependencies. MCP servers convert to Cursor-account connections
211
- resolved at runtime (manage authorization in Cursor, dashboard
212
- -> MCP). Review the project, then run \`validate\` / \`dev\`.
213
- Warnings never fail the command.
214
- migrate Early-alpha projects only: start a Cursor cloud agent that
215
- moves the project from hosted architecture v1 to v2 with the
216
- bdk-migrate-v2 skill and opens a pull request. Reads the
217
- pushed ref; --repo/--ref/--path are inferred like deploy.
218
- Waits for the pull request unless --no-wait. Never deploys.
219
- install-skills
220
- Refresh the BDK skills for coding agents in
221
- ~/.cursor/skills/bdk and print where they landed.
222
- Installed copies set alwaysApply so Cursor injects them
223
- into context. \`npm install\` / \`npx\` already copies them
224
- (postinstall); this command overwrites with the package
225
- version without asking. \`init\` also offers a TTY refresh.
226
- --print previews without writing.
227
- mcp Serve this agent's MCP endpoint over stdio for MCP clients
228
- that spawn local servers (e.g. Cursor). Proxies
229
- newline-delimited JSON-RPC to <target>/v1/mcp. --prod resolves
230
- the hosted deployment with the signed-in Cursor account and
231
- re-mints short-lived engine credentials as they expire;
232
- --url targets a running server. stdout is reserved for the
233
- MCP wire. \`mcp install\` writes the matching entry into
234
- ~/.cursor/mcp.json (--print to preview; --name to override
235
- the server name). \`mcp oauth <connection>\` runs host PKCE
236
- for defineConnection({ url, oauth: true }); \`--store\` upserts
237
- MCP_OAUTH_<NAME>_* secrets on the hosted deployment.
238
- eval Run filesystem evals under evals/**/*.eval.ts (streams on a TTY).
239
- Default: ephemeral local harness against evals on disk. Pass
240
- --url to kick off the batch on a running server via
241
- /v1/dev/evals/runs so results appear in the playground and
242
- persist when the agent declares an evals storage table. With
243
- --url, prints an Eval ID as soon as the batch is accepted (also
244
- with --no-wait). Check later with
245
- \`${CLI} eval status <evalId> --url <baseUrl>\` (omit id to list
246
- recent runs; exit 3 while still running) or cancel with
247
- \`${CLI} eval cancel <evalId> --url <baseUrl>\`. The
248
- status/cancel subcommands only bind when --url is set, so an
249
- eval id named status/cancel still runs locally. eval does not
250
- accept --prod. Pass evalId args to
251
- select: one datapoint (weather/nyc), a whole file (weather → all
252
- cases in that file), several of either, or omit to run all.
253
- info Print the discovered agent surface (tools, skills, channels, ...).
254
- validate Check the project(s) and exit non-zero on error diagnostics.
255
- login Sign the host in to Cursor: browser sign-in mints a named,
256
- dashboard-revocable API key (only the key is stored). It powers
257
- inference and cursorAccount MCP connections.
258
- logout Remove the stored Cursor credentials.
259
- whoami Show which Cursor account powers this host (and why).
260
- update Upgrade this install to the latest published version (detects
261
- global npm/pnpm/yarn/bun installs and project dependencies).
262
- version Print the ${PACKAGE_NAME} version this CLI will use and exit
263
- (also --version / -V). Text is the version number; --json
264
- prints { name, version, cli }.
265
- deploy Deploy onto Cursor's managed agent-serve hosting, then wait for
266
- the engine to come up. --repo/--ref/--path stay available;
267
- inside an agent git checkout they are inferred when omitted
268
- (flags always win). When --dir is a multi-agent parent,
269
- pick one interactively, or pass --slug / --all. First deploy
270
- of a slug prints the alias token exactly once — save it.
271
- deployments List the team's deployments (slug, status, generation, kind).
272
- deployment Show one deployment in full (status, lastError, engine info).
273
- stop Stop every install of a slug and wait until it reports
274
- stopped. Does not lock deploys or flip tenant enabled.
275
- start Resume every enabled install of a slug. Does not unlock
276
- deploys; run unlock-deploys first after kill.
277
- kill Emergency stop: lock deploys, stop every install, cancel
278
- runs and reminder clocks.
279
- unlock-deploys Allow deploy/upgrade again after kill. Does not resume
280
- traffic; start after unlock.
281
- cancel-runs Request cancellation for active Agent SDK v2 session runs
282
- and reminder clocks, and mark factory creating/active
283
- sessions failed. For a multi-tenant application this
284
- cancels every install, not just the caller's.
285
- Install-local cancel is stop --cancel-runs.
286
- event-repos Set the repositories a multi-tenant install receives events
287
- for. A deploy cannot carry these; pass every repository you
288
- want, since the list is replaced rather than merged.
289
- upgrade Move this team's install onto a release, the newest ready one
290
- by default. Deploying a multi-tenant application publishes a
291
- release without moving any tenant onto it.
292
- rollback Move this team's install onto an earlier ready release, the
293
- nearest one by default. Does not publish a release. Pass
294
- --release to choose an older id or version.
295
- delete Delete a deployment (teardown + purge the record) and wait
296
- until GET 404s. The slug is then free to redeploy.
297
- rotate-token Mint a new alias token for a deployment (shown once); the old
298
- token stops working immediately.
299
- secrets Manage deployment secrets: set (names only by default: hidden
300
- prompt or piped stdin; NAME=VALUE requires --from-argv), list
301
- (names + createdAt; never values), unset.
302
- images Container images for persistent agents: push <local-image>
303
- --name <name> (docker save, upload), list, rm <name>.
304
- slack Slack channel pack: create/destroy/icon (dashboard wizard),
305
- doctor (see slack help).
306
- github GitHub webhook pack: forward live deliveries, events, doctor
307
- (wraps \`gh webhook forward\`; see github help).
308
- gitlab GitLab webhook pack: replay a merge request, events, forward
309
- recipe (see gitlab help).
310
- bitbucket Bitbucket webhook pack (Cloud + Data Center): replay a pull
311
- request, events, forward recipe (see bitbucket help).
312
- pagerduty PagerDuty webhook pack: replay synthesized incident events,
313
- events (see pagerduty help).
314
-
315
- Agent loop:
316
- ${CLI} validate --dir .
317
- ${CLI} info --dir . --json
318
- ${CLI} run --dir . --message "..."
319
- ${CLI} eval --dir .
320
- ${CLI} dev .
321
-
322
- Options:
323
- --version, -V Print the version number and exit.
324
- --dir Project root (defaults to the current directory).
325
- --port Port to listen on (default 3000). When the default is
326
- taken, serve tries the next free port and prints a notice.
327
- An explicit --port fails with a next-port hint instead.
328
- --host Host to bind (default 127.0.0.1).
329
- --mode serve: "multi" (default, slugged /<dir>/v1/*) or "single"
330
- (unslugged /v1/*). Multi also exposes host /v1/health for
331
- ALB/ECS checks; use single when one agent is the whole host.
332
- --dev Dev mode: mounts POST /v1/dev/schedules/:scheduleId and
333
- disables the cron runner (dispatch schedules by hand).
334
- --api-key Cursor API key (defaults to CURSOR_API_KEY, then
335
- CURSOR_API_KEY_FILE — hosted default
336
- /run/cursor/secrets/CURSOR_API_KEY when unset —
337
- then CURSOR_SERVICE_ACCOUNT_KEY, then the stored
338
- \`${CLI} login\` credential).
339
- --key-name login: label for the minted API key (defaults to
340
- "${CLI} (<hostname>)").
341
- --state-root Durable state directory (default <dir>/.agent-serve). Put it
342
- outside any repository whose rules should not reach the agent.
343
- --bearer-token serve: require this bearer token on API routes. chat/run/eval:
344
- send it as the Authorization bearer.
345
- --allow-anonymous serve: admit all HTTP callers (allowAll). For demos behind a
346
- trusted network only; mutually exclusive with --bearer-token.
347
- --allow-anonymous-cursor-github
348
- serve: allow --allow-anonymous together with
349
- githubChannel({ cursorAccount }). Admitted callers can drive
350
- sessions holding the account's repo-scoped GitHub credential,
351
- so use only behind a trusted boundary (e.g. an SSO proxy).
352
- --allow-anonymous-grokbot
353
- serve: allow --allow-anonymous together with a
354
- runtime: "grokbot" mount. Admitted callers can drive turns
355
- on the signed-in account's hosted Grok Bot computer, so use
356
- only behind a trusted boundary (e.g. an SSO proxy).
357
- --allow-anonymous-cursor-account-mcp
358
- serve: allow --allow-anonymous together with
359
- defineConnection({ cursorAccount: true }). Admitted callers
360
- can drive the account's MCP connectors, so use only behind
361
- a trusted boundary (e.g. an SSO proxy or hosted alias token).
362
- --cursor-scm-proxy serve: route every SCM channel's cursorAccount API calls
363
- (githubChannel, gitlabChannel, bitbucketChannel) through
364
- the Cursor backend's per-forge forwarder instead of
365
- minting raw tokens into this process
366
- (AGENT_SERVE_<FORGE>_PROXY_URL overrides a base URL).
367
- --public-url serve: base URL where this host is reachable from outside
368
- (e.g. https://agent-serve.example.com).
369
- --no-schedules Disable the cron runner outside dev mode.
370
- --no-control-plane serve: do not start the bundled control plane (schedule
371
- and reminder clocks). Cursor hosting passes this so the
372
- kit uses the Cursor backend instead.
373
- --cloud-tools-url serve: Cursor hosting passes the deployment's server-tools
374
- MCP URL here. Hosted install probes this help text for the
375
- flag before trusting a checkout build; keep it listed.
376
- --peers-url serve: Cursor hosting passes the base URL where a
377
- single-agent serve reaches its peers
378
- (defineConnection({ agent })) at <url>/<slug>/v1/mcp,
379
- authenticated with CURSOR_API_KEY. Hosting probes this
380
- help text for the flag; keep it listed.
381
- --team deploy/deployments/deployment/stop/rotate-token and
382
- chat/resume/run/call/logs/sessions/session/playground
383
- --prod: Cursor team id. Defaults to the account's team when
384
- it has one.
385
- --prod chat/resume/run/call/logs/sessions/session/playground:
386
- use the team's hosted deployment. Slug from --slug or the
387
- --dir basename. Mutually exclusive with --url. Requires
388
- \`${CLI} login\`. eval does not accept --prod.
389
- v2: only run, session, logs, and playground support
390
- --prod. ${v2HostedVerifyHint()}
391
- --dry-run run/session --prod: mark the hosted v2 turn non-mutating.
392
- ${v2HostedVerifyHint()}
393
- --component run/session --prod: wake this v2 component key,
394
- not the application default.
395
- --as-of run/session --prod: freeze the session clock at this
396
- timezone-bearing ISO-8601 instant.
397
- --once logs: print current progress / log buffer once and exit
398
- (default is to follow).
399
- --print playground/docs: print the URL only; do not open a
400
- browser. install-skills: list the skills and the install
401
- path without writing them.
402
- --no-wait deploy/stop/eval: return right after the request is
403
- accepted instead of polling until a terminal status.
404
- For eval, prints the runId (--url only). migrate: print
405
- the cloud agent URL and exit.
406
- --cancel-runs stop: also cancel this install's active Agent SDK v2
407
- session runs and reminder clocks, and mark factory
408
- creating/active sessions failed (not every tenant).
409
- --no-playground Disable the bundled web playground at /playground (also skips
410
- auto-build / HMR).
411
- --no-docs Disable the documentation site at /docs (also skips its
412
- auto-build).
413
- --url chat/resume/run/call/eval/logs/sessions/session/playground:
414
- base URL of a running agent (skip local host). Mutually
415
- exclusive with --prod.
416
- --message chat/resume/run: user message (repeatable for run).
417
- --input call: JSON object of tool arguments (default {}).
418
- --messages-file JSON array of strings (run).
419
- --session Existing session id (run/call follow-up, or chat reattach).
420
- Prefer \`${CLI} resume [sessionId]\` for interactive
421
- reattach. logs --prod (v2): tail only this session.
422
- --resume chat: reattach the previous followable session (most
423
- recently updated in /v1/sessions). Same as
424
- \`${CLI} resume\` with no session id. Ignored when
425
- --session is also set.
426
- --continuation-token Token from a prior run/chat/resume response (optional
427
- for resume / chat --session/--resume; looked up via
428
- /v1/sessions when omitted).
429
- --events run: write NDJSON trace to this path (default
430
- <dir>/.agent-serve/traces/<sessionId>.ndjson).
431
- trajectory: read this file. session: print raw
432
- { sessionId, events } JSON (boolean; no path).
433
- --no-events run: do not write a trace file.
434
- --slug Agent slug when --dir mounts multiple agents.
435
- --timeout-ms Abort a hung turn after N milliseconds.
436
- --tag eval: only run cases with this tag (repeatable).
437
- --list eval: print discovered cases without running.
438
- --verbose eval: stream t.log lines and reply snippets.
439
- --strict eval: a missed soft threshold (SCORED) also exits 1.
440
- --max-concurrency eval: override evals.config.ts maxConcurrency.
441
- --junit eval: write JUnit XML here for CI annotations.
442
- --artifacts eval: run-artifact directory (default a timestamped dir
443
- under <dir>/.agent-serve/evals/).
444
- --no-artifacts eval: do not write run artifacts.
445
- --skip-report eval: ignore reporters from evals.config.ts / eval files.
446
- --no-stream run/eval: silence live progress on stderr (JSON still prints).
447
- --json JSON output (init/convert-automation/install-skills/
448
- info/validate/chat/eval/logs/version/
449
- sessions/session/github; run defaults to JSON). logs:
450
- NDJSON progress/log events (v2: {sessionId, line}).
451
- session: trajectory JSON
452
- (not raw events).
453
- --no-color chat: force plain output.
454
- --cursor-events serve: pull SCM webhook events from /v0/scm-events. The
455
- stream is read as your Cursor user, so serve requires
456
- sign-in (\`${CLI} login\` / CURSOR_API_KEY) and --repo.
457
- Offset under <state-root>/cursor-events/.
458
- CURSOR_API_BASE_URL overrides.
459
- --repo serve --cursor-events: repo to subscribe to (repeatable).
460
- github forward: owner/repo to forward from (inferred from
461
- the git remote when omitted; last wins).
462
- deploy/migrate: https git repo URL (optional; inferred
463
- from git remote origin when omitted).
464
- --ref deploy/migrate: git ref to build or migrate (optional;
465
- inferred from the current branch when omitted).
466
- --path deploy/migrate: agent dir relative to repo root
467
- (optional; inferred from --dir vs git toplevel when
468
- omitted).
469
- --all deploy: every child agent under a multi-agent --dir
470
- (skips the interactive picker; mutually exclusive with
471
- --slug).
472
- --cursor-events-repo deploy: repo the deployed agent watches
473
- (repeatable): owner/name for GitHub and Origin,
474
- gitlab.com/<group>/<project>, or
475
- bitbucket.org/<workspace>/<repo>.
476
- --allow-domain deploy: egress domain the engine pod may reach
477
- (repeatable; unioned with hosting.egressDomains from the
478
- agent manifest). Repo-backed deploys only.
479
- --from-argv secrets set: allow NAME=VALUE on argv (leaks into shell
480
- history and agent-captured terminals). Default is names
481
- only with a hidden prompt or piped stdin.
482
- --org github forward: organization login (org-level hooks).
483
- --channel github: select one channel id when several are declared.
484
- --secret github forward: webhook signing secret (defaults to
485
- GITHUB_WEBHOOK_SECRET). github: --events overrides the
486
- derived webhook event list.
487
- --install github: install the cli/gh-webhook extension if missing.
488
- slack init --manual: require Slack CLI app install.
489
- --no-install slack init --manual: skip Slack CLI app install.
490
- --action github/gitlab replay: event action (e.g. opened, open).
491
- --conclusion github replay: CI conclusion (check_run/suite/status).
492
- gitlab replay: pipeline status (success, failed, …).
493
- --comment github/gitlab/bitbucket/pagerduty replay: comment / note body.
494
- --context github replay: commit-status context.
495
- --dry-run github replay: print synthesized payloads, don't POST.
496
- --out eval / eval status <runId>: also write the full results
497
- JSON to this path. session: write the raw NDJSON trace
498
- there instead of printing (same format as run --events;
499
- playground-openable). github replay: write synthesized
500
- payloads as fixtures.
501
- `;
502
- function writeStdout(text) {
503
- return new Promise((resolve, reject) => {
504
- process.stdout.write(text, (error) => {
505
- if (error) {
506
- reject(error);
507
- return;
508
- }
509
- resolve();
510
- });
511
- });
512
- }
14
+ import { warnIfOutdated } from "../internal/update-check.js";
15
+ /** Commands that skip the update notice: `update` checks itself, and `mcp` owns stdout. */
16
+ const NO_UPDATE_NOTICE = new Set(["update", "mcp"]);
513
17
  async function main(argv) {
514
- const [command, ...restIn] = argv;
515
- if (command === undefined || command === "help" || command === "--help" || command === "-h") {
516
- // Await the write: HELP is larger than a pipe buffer, and process.exit
517
- // after main() would otherwise truncate --help under execFile / CI.
518
- await writeStdout(HELP);
519
- return command === undefined ? 1 : 0;
520
- }
521
- if (command === "version" || command === "--version" || command === "-V") {
522
- await writeStdout(formatCliVersion({ json: restIn.includes("--json") }));
523
- return 0;
524
- }
525
- // `session --events` means "dump raw events" (boolean). Rewrite so it does
526
- // not collide with run/trajectory's `--events <file.ndjson>` string flag.
527
- const rest = command === "session"
528
- ? restIn.map((arg) => (arg === "--events" ? "--raw-events" : arg))
529
- : restIn;
530
- const { values, positionals } = parseArgs({
531
- args: rest,
532
- allowPositionals: true,
533
- options: {
534
- dir: { type: "string", default: "." },
535
- template: { type: "string" },
536
- var: { type: "string", multiple: true },
537
- "from-grokbot": { type: "string" },
538
- answers: { type: "string" },
539
- port: { type: "string" },
540
- host: { type: "string" },
541
- mode: { type: "string" },
542
- dev: { type: "boolean", default: false },
543
- "api-key": { type: "string" },
544
- "key-name": { type: "string" },
545
- "state-root": { type: "string" },
546
- "bearer-token": { type: "string" },
547
- "allow-anonymous": { type: "boolean", default: false },
548
- "allow-anonymous-cursor-github": { type: "boolean", default: false },
549
- "allow-anonymous-cursor-account-mcp": { type: "boolean", default: false },
550
- "allow-anonymous-grokbot": { type: "boolean", default: false },
551
- "cursor-scm-proxy": { type: "boolean", default: false },
552
- "no-schedules": { type: "boolean", default: false },
553
- "no-control-plane": { type: "boolean", default: false },
554
- "no-playground": { type: "boolean", default: false },
555
- "no-docs": { type: "boolean", default: false },
556
- url: { type: "string" },
557
- prod: { type: "boolean", default: false },
558
- message: { type: "string", multiple: true },
559
- input: { type: "string" },
560
- "messages-file": { type: "string" },
561
- "session-id": { type: "string" },
562
- session: { type: "string" },
563
- resume: { type: "boolean", default: false },
564
- "continuation-token": { type: "string" },
565
- events: { type: "string" },
566
- "no-events": { type: "boolean", default: false },
567
- slug: { type: "string" },
568
- "timeout-ms": { type: "string" },
569
- tag: { type: "string", multiple: true },
570
- list: { type: "boolean", default: false },
571
- verbose: { type: "boolean", default: false },
572
- text: { type: "boolean", default: false },
573
- "no-color": { type: "boolean", default: false },
574
- "no-stream": { type: "boolean", default: false },
575
- once: { type: "boolean", default: false },
576
- "raw-events": { type: "boolean", default: false },
577
- json: { type: "boolean", default: false },
578
- name: { type: "string" },
579
- env: { type: "string" },
580
- "public-url": { type: "string" },
581
- "cloud-tools-url": { type: "string" },
582
- "peers-url": { type: "string" },
583
- "mount-path": { type: "string" },
584
- "base-url": { type: "string" },
585
- print: { type: "boolean", default: false },
586
- store: { type: "boolean", default: false },
587
- remote: { type: "boolean", default: false },
588
- transport: { type: "string" },
589
- prefix: { type: "string" },
590
- "no-prefix": { type: "boolean", default: false },
591
- "channel-posts": { type: "boolean", default: false },
592
- "slack-team": { type: "string" },
593
- icon: { type: "string" },
594
- force: { type: "boolean", default: false },
595
- manual: { type: "boolean", default: false },
596
- repo: { type: "string", multiple: true },
597
- org: { type: "string" },
598
- "cursor-events": { type: "boolean", default: false },
599
- secret: { type: "string" },
600
- channel: { type: "string", multiple: true },
601
- install: { type: "boolean", default: false },
602
- "no-install": { type: "boolean", default: false },
603
- action: { type: "string" },
604
- conclusion: { type: "string" },
605
- context: { type: "string" },
606
- comment: { type: "string" },
607
- "dry-run": { type: "boolean", default: false },
608
- "as-of": { type: "string" },
609
- component: { type: "string" },
610
- out: { type: "string" },
611
- team: { type: "string" },
612
- "no-wait": { type: "boolean", default: false },
613
- "cancel-runs": { type: "boolean", default: false },
614
- ref: { type: "string" },
615
- release: { type: "string" },
616
- path: { type: "string" },
617
- all: { type: "boolean", default: false },
618
- "cursor-events-repo": { type: "string", multiple: true },
619
- "allow-domain": { type: "string", multiple: true },
620
- // Hidden Anysphere-only flag; omitted from help.
621
- "multi-tenant": { type: "boolean", default: false },
622
- "from-argv": { type: "boolean", default: false },
623
- strict: { type: "boolean", default: false },
624
- junit: { type: "string" },
625
- artifacts: { type: "string" },
626
- "no-artifacts": { type: "boolean", default: false },
627
- "skip-report": { type: "boolean", default: false },
628
- "max-concurrency": { type: "string" },
629
- version: { type: "boolean", short: "V", default: false },
630
- },
631
- });
632
- const dir = values.dir ?? ".";
633
- if (values.version === true) {
634
- await writeStdout(formatCliVersion({ json: values.json === true }));
18
+ const [command, ...rest] = argv;
19
+ if (command === "--version" || command === "-V") {
20
+ await writeStdout(formatCliVersion({ json: rest.includes("--json") }));
635
21
  return 0;
636
22
  }
637
- // Best-effort, cached, and silent on failure. `update` does its own fresh
638
- // lookup, --json runs stay quiet for machine consumers, and `mcp` skips it
639
- // so MCP client spawns stay fast (stdout there is the protocol wire).
640
- if (command !== "update" &&
641
- command !== "mcp" &&
642
- values.json !== true &&
23
+ // Best-effort, cached, and silent on failure. --json runs stay quiet for
24
+ // machine consumers. Help runs skip it, so the hosting probe of
25
+ // `agent-sdk --help` never waits on the registry.
26
+ if (command !== undefined &&
27
+ !isHelpRequest(argv) &&
28
+ !NO_UPDATE_NOTICE.has(command) &&
29
+ !rest.includes("--json") &&
643
30
  !isServeRestartWorker()) {
644
31
  await warnIfOutdated();
645
32
  }
646
- switch (command) {
647
- case "slack": {
648
- const { cmdSlack } = await import("../internal/cli-slack.js");
649
- const env = values.env === "dev" || values.env === "prod" || values.env === "both"
650
- ? values.env
651
- : undefined;
652
- return cmdSlack(positionals[0], {
653
- dir,
654
- name: values.name,
655
- env,
656
- json: values.json,
657
- print: values.print,
658
- prefix: values.prefix,
659
- noPrefix: values["no-prefix"],
660
- channelPosts: values["channel-posts"],
661
- channels: values.channel,
662
- slackTeam: values["slack-team"],
663
- prod: values.prod,
664
- team: values.team,
665
- apiKey: values["api-key"],
666
- icon: values.icon,
667
- force: values.force,
668
- manual: values.manual,
669
- install: values.install,
670
- noInstall: values["no-install"],
671
- iconSource: positionals[0] === "icon" ? positionals[1] : undefined,
672
- });
673
- }
674
- case "github": {
675
- const port = values.port === undefined ? undefined : Number.parseInt(values.port, 10);
676
- if (port !== undefined && (Number.isNaN(port) || port < 0 || port > 65535)) {
677
- process.stderr.write(`invalid --port: ${values.port}\n`);
678
- return 1;
679
- }
680
- const { cmdGithub } = await import("../internal/cli-github.js");
681
- return cmdGithub(positionals[0], {
682
- dir,
683
- slug: values.slug,
684
- // `--channel` is repeatable for `slack doctor`; the github
685
- // subcommands target a single channel, so the last one wins.
686
- channel: values.channel?.at(-1),
687
- host: values.host,
688
- port,
689
- url: values.url,
690
- events: values.events,
691
- // `--repo` is repeatable for `serve --cursor-events`; the github
692
- // subcommands target a single repo, so the last one wins.
693
- repo: values.repo?.at(-1),
694
- org: values.org,
695
- secret: values.secret,
696
- install: values.install,
697
- json: values.json,
698
- prUrl: positionals[1],
699
- action: values.action,
700
- conclusion: values.conclusion,
701
- context: values.context,
702
- comment: values.comment,
703
- dryRun: values["dry-run"],
704
- out: values.out,
705
- });
706
- }
707
- case "gitlab": {
708
- const port = values.port === undefined ? undefined : Number.parseInt(values.port, 10);
709
- if (port !== undefined && (Number.isNaN(port) || port < 0 || port > 65535)) {
710
- process.stderr.write(`invalid --port: ${values.port}\n`);
711
- return 1;
712
- }
713
- const { cmdGitlab } = await import("../internal/cli-gitlab.js");
714
- return cmdGitlab(positionals[0], {
715
- dir,
716
- slug: values.slug,
717
- channel: values.channel?.at(-1),
718
- host: values.host,
719
- port,
720
- url: values.url,
721
- events: values.events,
722
- secret: values.secret,
723
- json: values.json,
724
- mrUrl: positionals[1],
725
- action: values.action,
726
- conclusion: values.conclusion,
727
- comment: values.comment,
728
- dryRun: values["dry-run"],
729
- out: values.out,
730
- });
731
- }
732
- case "pagerduty": {
733
- const port = values.port === undefined ? undefined : Number.parseInt(values.port, 10);
734
- if (port !== undefined && (Number.isNaN(port) || port < 0 || port > 65535)) {
735
- process.stderr.write(`invalid --port: ${values.port}\n`);
736
- return 1;
737
- }
738
- const { cmdPagerDuty } = await import("../internal/cli-pagerduty.js");
739
- return cmdPagerDuty(positionals[0], {
740
- dir,
741
- slug: values.slug,
742
- channel: values.channel?.at(-1),
743
- host: values.host,
744
- port,
745
- url: values.url,
746
- events: values.events,
747
- secret: values.secret,
748
- json: values.json,
749
- incidentId: positionals[1],
750
- comment: values.comment,
751
- dryRun: values["dry-run"],
752
- out: values.out,
753
- });
754
- }
755
- case "bitbucket": {
756
- const port = values.port === undefined ? undefined : Number.parseInt(values.port, 10);
757
- if (port !== undefined && (Number.isNaN(port) || port < 0 || port > 65535)) {
758
- process.stderr.write(`invalid --port: ${values.port}\n`);
759
- return 1;
760
- }
761
- const { cmdBitbucket } = await import("../internal/cli-bitbucket.js");
762
- return cmdBitbucket(positionals[0], {
763
- dir,
764
- slug: values.slug,
765
- channel: values.channel?.at(-1),
766
- host: values.host,
767
- port,
768
- url: values.url,
769
- events: values.events,
770
- secret: values.secret,
771
- json: values.json,
772
- prUrl: positionals[1],
773
- comment: values.comment,
774
- dryRun: values["dry-run"],
775
- out: values.out,
776
- });
777
- }
778
- case "init": {
779
- const conflict = initFlagConflict({
780
- fromGrokbot: values["from-grokbot"],
781
- answers: values.answers,
782
- dryRun: values["dry-run"],
783
- template: values.template,
784
- vars: values.var,
785
- });
786
- if (conflict !== undefined) {
787
- if (values.json) {
788
- await writeStdout(`${JSON.stringify({ ok: false, error: conflict })}\n`);
789
- }
790
- process.stderr.write(`${conflict}\n`);
791
- return 1;
792
- }
793
- if (values["from-grokbot"] !== undefined) {
794
- const { cmdInitFromGrokbot } = await import("../internal/cli-init-grokbot.js");
795
- return cmdInitFromGrokbot({
796
- recipe: values["from-grokbot"],
797
- answers: values.answers,
798
- dir: positionals[0],
799
- dryRun: values["dry-run"],
800
- json: values.json,
801
- });
802
- }
803
- return cmdInit({
804
- dir,
805
- initTarget: positionals[0],
806
- template: values.template,
807
- vars: values.var,
808
- json: values.json,
809
- });
810
- }
811
- case "convert-automation": {
812
- const { cmdConvertAutomation } = await import("../internal/cli-convert-automation.js");
813
- const dirFlagPassed = rest.includes("--dir") || rest.some((arg) => arg.startsWith("--dir="));
814
- return cmdConvertAutomation({
815
- url: positionals[0],
816
- // Default target is ./<automation-name-slug>, not the cwd.
817
- dir: dirFlagPassed ? dir : undefined,
818
- json: values.json,
819
- apiKey: values["api-key"],
820
- });
821
- }
822
- case "migrate": {
823
- const { cmdMigrate } = await import("../internal/cli-migrate.js");
824
- return cmdMigrate({
825
- dir,
826
- repo: values.repo?.at(-1),
827
- ref: values.ref,
828
- path: values.path,
829
- noWait: values["no-wait"],
830
- json: values.json,
831
- apiKey: values["api-key"],
832
- });
833
- }
834
- case "install-skills": {
835
- const { cmdInstallSkills } = await import("../internal/cli-skills.js");
836
- return cmdInstallSkills({
837
- json: values.json,
838
- print: values.print,
839
- });
840
- }
841
- case "mcp": {
842
- const { cmdMcp } = await import("../internal/cli-mcp.js");
843
- const mcpSub = positionals[0];
844
- return cmdMcp(mcpSub, {
845
- dir,
846
- slug: values.slug,
847
- team: values.team,
848
- apiKey: values["api-key"],
849
- url: values.url,
850
- prod: values.prod,
851
- bearerToken: values["bearer-token"],
852
- name: values.name,
853
- print: values.print,
854
- json: values.json,
855
- store: values.store,
856
- remote: values.remote,
857
- oauthConnection: mcpSub === "oauth" ? positionals[1] : undefined,
858
- });
859
- }
860
- case "login": {
861
- const { cmdLogin } = await import("../internal/cli-cursor.js");
862
- return cmdLogin({
863
- apiKey: values["api-key"],
864
- keyName: values["key-name"],
865
- });
866
- }
867
- case "logout": {
868
- const { cmdLogout } = await import("../internal/cli-cursor.js");
869
- return cmdLogout();
870
- }
871
- case "whoami": {
872
- const { cmdWhoami } = await import("../internal/cli-cursor.js");
873
- return cmdWhoami({ json: values.json });
874
- }
875
- case "update": {
876
- return cmdUpdate();
877
- }
878
- case "deploy": {
879
- // `--repo` is repeatable for `serve --cursor-events`; deploy targets a
880
- // single source repo, so the last one wins.
881
- const repo = values.repo?.at(-1);
882
- const dirFlagPassed = rest.includes("--dir") || rest.some((arg) => arg.startsWith("--dir="));
883
- return cmdDeploy({
884
- ...deployOptionsFromValues(values),
885
- dir: dirFlagPassed ? dir : undefined,
886
- ...(values.slug === undefined ? {} : { slug: values.slug }),
887
- all: values.all === true,
888
- ...(repo === undefined ? {} : { repo }),
889
- ...(values.ref === undefined ? {} : { ref: values.ref }),
890
- ...(values.path === undefined ? {} : { path: values.path }),
891
- ...(values["cursor-events-repo"] === undefined
892
- ? {}
893
- : { cursorEventsRepos: values["cursor-events-repo"] }),
894
- ...(values["allow-domain"] === undefined ? {} : { allowDomains: values["allow-domain"] }),
895
- multiTenant: values["multi-tenant"] === true,
896
- });
897
- }
898
- case "manifest": {
899
- // Offline extraction of deploy metadata (events, egress, routes,
900
- // /v1/info payload) — no VM, no network. Wd-1 of the event-ingress
901
- // plan; `deploy` attaches this to the request from Wd-2 on.
902
- return cmdManifest({ dir, json: values.json === true });
903
- }
904
- case "deployments": {
905
- return cmdDeployments(deployOptionsFromValues(values));
906
- }
907
- case "deployment": {
908
- return cmdDeploymentStatus(positionals[0], deployOptionsFromValues(values));
909
- }
910
- case "stop": {
911
- return cmdStop(positionals[0], deployOptionsFromValues(values));
912
- }
913
- case "kill": {
914
- return cmdKill(positionals[0], deployOptionsFromValues(values));
915
- }
916
- case "unlock-deploys": {
917
- return cmdUnlockDeploys(positionals[0], deployOptionsFromValues(values));
918
- }
919
- case "start": {
920
- return cmdStart(positionals[0], deployOptionsFromValues(values));
921
- }
922
- case "cancel-runs": {
923
- return cmdCancelRuns(positionals[0], deployOptionsFromValues(values));
924
- }
925
- case "event-repos": {
926
- return cmdEventRepos(positionals[0], values.repo ?? [], deployOptionsFromValues(values));
927
- }
928
- case "upgrade": {
929
- return cmdUpgrade({ slug: positionals[0], release: values.release }, deployOptionsFromValues(values));
930
- }
931
- case "rollback": {
932
- return cmdRollback({ slug: positionals[0], release: values.release }, deployOptionsFromValues(values));
933
- }
934
- case "delete": {
935
- return cmdDelete(positionals[0], deployOptionsFromValues(values));
936
- }
937
- case "rotate-token": {
938
- return cmdRotateToken(positionals[0], deployOptionsFromValues(values));
939
- }
940
- case "secrets": {
941
- const base = deployOptionsFromValues(values);
942
- switch (positionals[0]) {
943
- case "set":
944
- return cmdSecretsSet(positionals[1], positionals.slice(2), base);
945
- case "list":
946
- return cmdSecretsList(positionals[1], base);
947
- case "unset":
948
- return cmdSecretsUnset(positionals[1], positionals[2], base);
949
- default:
950
- process.stderr.write(`Usage: ${CLI} secrets <set|list|unset> <slug> ... [--team <id>] [--json]\n`);
951
- return 1;
952
- }
953
- }
954
- case "images": {
955
- const base = deployOptionsFromValues(values);
956
- switch (positionals[0]) {
957
- case "push":
958
- return cmdImagesPush({ image: positionals[1], name: values.name }, base);
959
- case "list":
960
- return cmdImagesList(base);
961
- case "rm":
962
- return cmdImagesRm(positionals[1], base);
963
- default:
964
- process.stderr.write(`Usage: ${CLI} images <push <local-image> --name <name>|list|rm <name>> [--team <id>] [--json]\n`);
965
- return 1;
966
- }
967
- }
968
- case "run": {
969
- const messages = await loadMessages(values.message, values["messages-file"]);
970
- return cmdRun(axFromOptions({
971
- dir,
972
- messages,
973
- sessionId: values["session-id"] ?? values.session,
974
- continuationToken: values["continuation-token"],
975
- events: values["no-events"] ? false : values.events === undefined ? true : values.events,
976
- text: values.text,
977
- url: values.url,
978
- prod: values.prod,
979
- team: values.team,
980
- apiKey: values["api-key"],
981
- slug: values.slug,
982
- bearerToken: values["bearer-token"],
983
- stateRoot: values["state-root"],
984
- timeoutMs: parseTimeoutMs(values["timeout-ms"]),
985
- stream: values["no-stream"] ? false : undefined,
986
- dryRun: values["dry-run"],
987
- asOf: values["as-of"],
988
- componentKey: values.component,
989
- }));
990
- }
991
- case "call": {
992
- return cmdCall(axFromOptions({
993
- dir,
994
- toolName: positionals[0],
995
- toolInput: values.input,
996
- sessionId: values["session-id"] ?? values.session,
997
- url: values.url,
998
- prod: values.prod,
999
- team: values.team,
1000
- apiKey: values["api-key"],
1001
- slug: values.slug,
1002
- bearerToken: values["bearer-token"],
1003
- stateRoot: values["state-root"],
1004
- }));
1005
- }
1006
- case "skill": {
1007
- return cmdSkill(positionals[0], axFromOptions({
1008
- dir,
1009
- text: values.text,
1010
- url: values.url,
1011
- prod: values.prod,
1012
- team: values.team,
1013
- apiKey: values["api-key"],
1014
- slug: values.slug,
1015
- bearerToken: values["bearer-token"],
1016
- stateRoot: values["state-root"],
1017
- }));
1018
- }
1019
- case "trajectory": {
1020
- if (values.events === undefined) {
1021
- process.stderr.write("trajectory requires --events <file.ndjson>\n");
1022
- return 1;
1023
- }
1024
- return cmdTrajectory(axFromOptions({
1025
- dir,
1026
- events: values.events,
1027
- text: values.text,
1028
- }));
1029
- }
1030
- case "eval": {
1031
- // Remote status subcommand only when targeting --url. Otherwise the
1032
- // bare token "status" is a normal eval id (evals/status.eval.ts).
1033
- if (positionals[0] === "status" && values.url !== undefined) {
1034
- return cmdEvalStatus(positionals[1], axFromOptions({
1035
- dir,
1036
- json: values.json,
1037
- url: values.url,
1038
- prod: values.prod,
1039
- slug: values.slug,
1040
- bearerToken: values["bearer-token"],
1041
- out: values.out,
1042
- }));
1043
- }
1044
- if (positionals[0] === "cancel" && values.url !== undefined) {
1045
- return cmdEvalCancel(positionals[1], axFromOptions({
1046
- dir,
1047
- json: values.json,
1048
- url: values.url,
1049
- prod: values.prod,
1050
- slug: values.slug,
1051
- bearerToken: values["bearer-token"],
1052
- }));
1053
- }
1054
- return cmdEval(axFromOptions({
1055
- dir,
1056
- evalIds: positionals,
1057
- list: values.list,
1058
- verbose: values.verbose,
1059
- json: values.json,
1060
- tags: values.tag,
1061
- url: values.url,
1062
- prod: values.prod,
1063
- noWait: values["no-wait"],
1064
- slug: values.slug,
1065
- bearerToken: values["bearer-token"],
1066
- stateRoot: values["state-root"],
1067
- timeoutMs: parseTimeoutMs(values["timeout-ms"]),
1068
- stream: values["no-stream"] ? false : undefined,
1069
- strict: values.strict,
1070
- junit: values.junit,
1071
- artifacts: values["no-artifacts"] ? false : values.artifacts,
1072
- skipReport: values["skip-report"],
1073
- maxConcurrency: parseMaxConcurrency(values["max-concurrency"]),
1074
- out: values.out,
1075
- }));
1076
- }
1077
- case "chat": {
1078
- return cmdChat(axFromOptions({
1079
- dir,
1080
- messages: values.message,
1081
- url: values.url,
1082
- prod: values.prod,
1083
- team: values.team,
1084
- apiKey: values["api-key"],
1085
- slug: values.slug,
1086
- sessionId: values["session-id"] ?? values.session,
1087
- resume: values.resume,
1088
- continuationToken: values["continuation-token"],
1089
- bearerToken: values["bearer-token"],
1090
- json: values.json,
1091
- text: values.text,
1092
- noColor: values["no-color"],
1093
- }));
1094
- }
1095
- case "resume": {
1096
- return cmdResume(positionals[0], axFromOptions({
1097
- dir,
1098
- messages: values.message,
1099
- url: values.url,
1100
- prod: values.prod,
1101
- team: values.team,
1102
- apiKey: values["api-key"],
1103
- slug: values.slug,
1104
- // Positional wins; --session is accepted as a redundant alias.
1105
- // No id → resume previous (cmdResume sets resume: true).
1106
- sessionId: positionals[0] ?? values["session-id"] ?? values.session,
1107
- continuationToken: values["continuation-token"],
1108
- bearerToken: values["bearer-token"],
1109
- json: values.json,
1110
- text: values.text,
1111
- noColor: values["no-color"],
1112
- }));
1113
- }
1114
- case "logs": {
1115
- return cmdLogs(axFromOptions({
1116
- dir,
1117
- url: values.url,
1118
- prod: values.prod,
1119
- team: values.team,
1120
- apiKey: values["api-key"],
1121
- slug: values.slug,
1122
- bearerToken: values["bearer-token"],
1123
- sessionId: positionals[0] ?? values["session-id"] ?? values.session,
1124
- json: values.json,
1125
- once: values.once,
1126
- }));
1127
- }
1128
- case "sessions": {
1129
- return cmdSessions(axFromOptions({
1130
- dir,
1131
- url: values.url,
1132
- prod: values.prod,
1133
- team: values.team,
1134
- apiKey: values["api-key"],
1135
- slug: values.slug,
1136
- bearerToken: values["bearer-token"],
1137
- json: values.json,
1138
- }));
1139
- }
1140
- case "session": {
1141
- const messages = await loadMessages(values.message, values["messages-file"]);
1142
- return cmdSession(positionals[0], axFromOptions({
1143
- dir,
1144
- url: values.url,
1145
- prod: values.prod,
1146
- team: values.team,
1147
- apiKey: values["api-key"],
1148
- slug: values.slug,
1149
- bearerToken: values["bearer-token"],
1150
- json: values.json,
1151
- text: values.text,
1152
- rawEvents: values["raw-events"],
1153
- out: values.out,
1154
- messages,
1155
- sessionId: values["session-id"] ?? values.session,
1156
- dryRun: values["dry-run"],
1157
- asOf: values["as-of"],
1158
- componentKey: values.component,
1159
- }));
1160
- }
1161
- case "cost": {
1162
- return cmdCost(positionals[0] ?? values["session-id"] ?? values.session, axFromOptions({
1163
- dir,
1164
- url: values.url,
1165
- prod: values.prod,
1166
- team: values.team,
1167
- apiKey: values["api-key"],
1168
- slug: values.slug,
1169
- bearerToken: values["bearer-token"],
1170
- json: values.json,
1171
- }));
1172
- }
1173
- case "playground": {
1174
- return cmdPlayground(axFromOptions({
1175
- dir,
1176
- url: values.url,
1177
- prod: values.prod,
1178
- team: values.team,
1179
- apiKey: values["api-key"],
1180
- slug: values.slug,
1181
- bearerToken: values["bearer-token"],
1182
- sessionId: values["session-id"] ?? values.session,
1183
- print: values.print,
1184
- }));
1185
- }
1186
- case "docs": {
1187
- const docsPort = values.port === undefined ? 0 : Number.parseInt(values.port, 10);
1188
- if (Number.isNaN(docsPort) || docsPort < 0 || docsPort > 65535) {
1189
- process.stderr.write(`invalid --port: ${values.port}\n`);
1190
- return 1;
1191
- }
1192
- const { cmdDocs } = await import("../internal/cli-docs.js");
1193
- return cmdDocs({
1194
- port: docsPort,
1195
- host: values.host,
1196
- print: values.print === true,
1197
- });
1198
- }
1199
- case "validate": {
1200
- const mounts = await loadMounts(dir);
1201
- if (values.json === true) {
1202
- process.stdout.write(formatValidateJson(mounts));
1203
- }
1204
- else {
1205
- for (const { slug, project } of mounts) {
1206
- const label = slug === "" ? project.name : `${slug} (${project.name})`;
1207
- if (project.diagnostics.length === 0) {
1208
- process.stdout.write(`ok: ${label} has no diagnostics\n`);
1209
- continue;
1210
- }
1211
- process.stdout.write(`${label}:\n${formatDiagnostics(project.diagnostics)}\n`);
1212
- }
1213
- }
1214
- const hasError = mounts.some((mount) => mount.project.diagnostics.some((diagnostic) => diagnostic.severity === "error"));
1215
- return hasError ? 1 : 0;
1216
- }
1217
- case "info": {
1218
- const mounts = await loadMounts(dir);
1219
- if (values.json) {
1220
- const payload = mounts.length === 1 && mounts[0]?.slug === ""
1221
- ? projectInfo(mounts[0].project)
1222
- : {
1223
- agents: mounts.map(({ slug, project }) => ({
1224
- slug,
1225
- ...projectInfo(project),
1226
- })),
1227
- };
1228
- process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
1229
- return 0;
1230
- }
1231
- if (mounts.length > 1 || mounts[0]?.slug !== "") {
1232
- process.stdout.write(`${mounts.length} agents under ${dir}:\n\n`);
1233
- for (const { slug, project } of mounts) {
1234
- const info = projectInfo(project);
1235
- process.stdout.write(` /${slug} — ${info.name} (${formatModel(info.model)}, ${info.tools.length} tools, ${info.channels.length} channels)\n`);
1236
- }
1237
- const anyError = mounts.some((m) => m.project.diagnostics.some((d) => d.severity === "error"));
1238
- return anyError ? 1 : 0;
1239
- }
1240
- const project = mounts[0]?.project;
1241
- const info = projectInfo(project);
1242
- const lines = [];
1243
- lines.push(`agent: ${info.name}`);
1244
- lines.push(`model: ${formatModel(info.model)}`);
1245
- lines.push(`mcp: ${info.mcp.path} (${info.mcp.tools.join(", ")})`);
1246
- if (info.instructions !== undefined) {
1247
- lines.push(`instructions: ${info.instructions.chars} chars`);
1248
- }
1249
- lines.push(section("tools", info.tools.map((t) => `${t.name} — ${t.description}`)));
1250
- lines.push(section("skills", info.skills.map((s) => `${s.name} — ${s.description}`)));
1251
- lines.push(section("extensions", info.extensions.map((e) => {
1252
- const contributed = [...e.tools, ...e.skills].join(", ") || "(nothing contributed)";
1253
- const egress = e.hosting?.egressDomains ?? [];
1254
- return egress.length === 0
1255
- ? `${e.name} — ${contributed}`
1256
- : `${e.name} — ${contributed}; egress: ${egress.join(", ")}`;
1257
- })));
1258
- lines.push(section("MCP connections", info.connections.map((c) => `${c.name} — ${c.transport}`)));
1259
- lines.push(section("subagents", info.subagents.map((s) => `${s.name} — ${s.description ?? ""}`)));
1260
- lines.push(section("channels", info.channels.map((c) => `${c.id}: ${c.routes.map((r) => `${r.method} ${r.url}`).join(", ") || "(events only)"}`)));
1261
- lines.push(section("schedules", info.schedules.map((s) => `${s.name} (${s.cron}, ${s.kind})`)));
1262
- lines.push(section("hooks", info.hooks));
1263
- lines.push(section("hosting egress domains", info.hosting?.egressDomains ?? []));
1264
- lines.push(section("hosting secret names", info.hosting?.secretNames ?? []));
1265
- if (info.diagnostics.length > 0) {
1266
- lines.push(`\ndiagnostics:\n${formatDiagnostics(info.diagnostics)}`);
1267
- }
1268
- process.stdout.write(`${lines.filter((line) => line !== "").join("\n")}\n`);
1269
- return info.diagnostics.some((d) => d.severity === "error") ? 1 : 0;
1270
- }
1271
- case "dev":
1272
- case "serve": {
1273
- const serveDirResult = resolveServeDir({
1274
- command,
1275
- dir,
1276
- positionals,
1277
- dirFlagPassed: rest.includes("--dir"),
1278
- });
1279
- if (typeof serveDirResult !== "string") {
1280
- process.stderr.write(serveDirResult.error);
1281
- return 1;
1282
- }
1283
- const serveDir = serveDirResult;
1284
- const port = values.port === undefined ? undefined : Number.parseInt(values.port, 10);
1285
- if (port !== undefined && (Number.isNaN(port) || port < 0 || port > 65535)) {
1286
- process.stderr.write(`invalid --port: ${values.port}\n`);
1287
- return 1;
1288
- }
1289
- if (values["allow-anonymous"] === true && values["bearer-token"] !== undefined) {
1290
- process.stderr.write("--allow-anonymous and --bearer-token are mutually exclusive\n");
1291
- return 1;
1292
- }
1293
- const mode = values.mode;
1294
- if (mode !== undefined && mode !== "single" && mode !== "multi") {
1295
- process.stderr.write(`invalid --mode: ${mode} (expected "single" or "multi")\n`);
1296
- return 1;
1297
- }
1298
- const dev = command === "dev" || values.dev === true;
1299
- const style = stdoutPalette();
1300
- // Real env wins (loadEnvFile never overrides). Runs inside start()
1301
- // so dev's Enter-restart picks up tokens written since boot.
1302
- const loadLocalEnv = () => {
1303
- const loadedEnvFiles = loadAgentLocalEnv(serveDir);
1304
- if (loadedEnvFiles.length > 0) {
1305
- process.stdout.write(`${style.dim(`env: loaded ${loadedEnvFiles.join(", ")}`)}\n`);
1306
- }
1307
- };
1308
- const serveOptions = {
1309
- port,
1310
- host: values.host,
1311
- mode: mode,
1312
- dev,
1313
- apiKey: values["api-key"],
1314
- stateRoot: values["state-root"],
1315
- authToken: values["bearer-token"],
1316
- allowAnonymous: values["allow-anonymous"] === true ? true : undefined,
1317
- allowAnonymousCursorGithub: values["allow-anonymous-cursor-github"] === true ? true : undefined,
1318
- allowAnonymousCursorAccountMcp: values["allow-anonymous-cursor-account-mcp"] === true ? true : undefined,
1319
- allowAnonymousGrokbot: values["allow-anonymous-grokbot"] === true ? true : undefined,
1320
- cursorScmProxy: values["cursor-scm-proxy"] === true ? true : undefined,
1321
- schedules: values["no-schedules"] === true ? false : undefined,
1322
- noControlPlane: values["no-control-plane"] === true ? true : undefined,
1323
- playground: values["no-playground"] === true ? false : undefined,
1324
- docs: values["no-docs"] === true ? false : undefined,
1325
- publicUrl: values["public-url"],
1326
- cloudToolsUrl: values["cloud-tools-url"],
1327
- peersUrl: values["peers-url"],
1328
- cursorEvents: values["cursor-events"] === true ? { repos: values.repo ?? [] } : undefined,
1329
- // Soft boot logs stay secondary to the banner. `dim` is a no-op on
1330
- // already-styled lines (the MCP warning box).
1331
- logger: (line) => {
1332
- process.stdout.write(`${style.dim(line)}\n`);
1333
- },
1334
- };
1335
- const enterToRestart = process.stdin.isTTY === true;
1336
- if (enterToRestart && !isServeRestartWorker()) {
1337
- return runEnterRestartSupervisor({
1338
- spawn: (command, args, spawnOptions) => spawn(command, args, spawnOptions),
1339
- onRestart: () => {
1340
- clearTerminal();
1341
- },
1342
- });
1343
- }
1344
- const bannerOpts = {
1345
- noPlayground: values["no-playground"] === true,
1346
- dev,
1347
- bearerToken: values["bearer-token"] !== undefined,
1348
- noSchedules: values["no-schedules"] === true,
1349
- };
1350
- const start = async () => {
1351
- loadLocalEnv();
1352
- const next = await serve(serveDir, serveOptions);
1353
- printServeBanner(next, bannerOpts);
1354
- if (enterToRestart) {
1355
- process.stdout.write(style.dim(" press Enter to restart\n"));
1356
- }
1357
- return next;
1358
- };
1359
- const handle = await start();
1360
- let closing = false;
1361
- let restartRequested = false;
1362
- await new Promise((resolve) => {
1363
- const shutdown = () => {
1364
- if (closing) {
1365
- return;
1366
- }
1367
- closing = true;
1368
- process.stdout.write("\nshutting down (draining running turns)\n");
1369
- void handle.close().finally(resolve);
1370
- };
1371
- process.on("SIGINT", shutdown);
1372
- process.on("SIGTERM", shutdown);
1373
- if (!enterToRestart) {
1374
- return;
1375
- }
1376
- process.stdin.resume();
1377
- process.stdin.on("data", (chunk) => {
1378
- const text = typeof chunk === "string" ? chunk : chunk.toString("utf8");
1379
- if (!isEnterOnly(text) || closing) {
1380
- return;
1381
- }
1382
- closing = true;
1383
- restartRequested = true;
1384
- clearTerminal();
1385
- process.stdout.write(style.dim("restarting…\n"));
1386
- void handle.close().finally(resolve);
1387
- });
1388
- });
1389
- return restartRequested ? ENTER_RESTART_EXIT_CODE : 0;
1390
- }
1391
- default: {
1392
- process.stderr.write(`Unknown command "${command}"\n\n${HELP}`);
1393
- return 1;
1394
- }
1395
- }
1396
- }
1397
- function deployOptionsFromValues(values) {
1398
- return {
1399
- team: values.team,
1400
- json: values.json === true,
1401
- noWait: values["no-wait"] === true,
1402
- cancelRuns: values["cancel-runs"] === true,
1403
- apiKey: values["api-key"],
1404
- fromArgv: values["from-argv"] === true ? true : undefined,
1405
- };
1406
- }
1407
- function axFromOptions(partial) {
1408
- return {
1409
- dir: partial.dir,
1410
- cwd: partial.cwd,
1411
- slug: partial.slug,
1412
- bearerToken: partial.bearerToken,
1413
- stateRoot: partial.stateRoot,
1414
- messages: partial.messages,
1415
- sessionId: partial.sessionId,
1416
- resume: partial.resume,
1417
- continuationToken: partial.continuationToken,
1418
- dryRun: partial.dryRun,
1419
- asOf: partial.asOf,
1420
- componentKey: partial.componentKey,
1421
- timeoutMs: partial.timeoutMs,
1422
- events: partial.events,
1423
- text: partial.text,
1424
- json: partial.json,
1425
- list: partial.list,
1426
- verbose: partial.verbose,
1427
- tags: partial.tags,
1428
- evalIds: partial.evalIds,
1429
- initTarget: partial.initTarget,
1430
- vars: partial.vars,
1431
- toolName: partial.toolName,
1432
- toolInput: partial.toolInput,
1433
- url: partial.url,
1434
- prod: partial.prod,
1435
- noWait: partial.noWait,
1436
- team: partial.team,
1437
- apiKey: partial.apiKey,
1438
- fetchImpl: partial.fetchImpl,
1439
- stream: partial.stream,
1440
- noColor: partial.noColor,
1441
- once: partial.once,
1442
- rawEvents: partial.rawEvents,
1443
- print: partial.print,
1444
- strict: partial.strict,
1445
- junit: partial.junit,
1446
- artifacts: partial.artifacts,
1447
- skipReport: partial.skipReport,
1448
- maxConcurrency: partial.maxConcurrency,
1449
- out: partial.out,
1450
- };
1451
- }
1452
- async function loadMessages(messages, messagesFile) {
1453
- const out = [];
1454
- if (messagesFile !== undefined) {
1455
- const raw = await readFile(resolve(messagesFile), "utf8");
1456
- const parsed = JSON.parse(raw);
1457
- if (!Array.isArray(parsed)) {
1458
- throw new Error("--messages-file must be a JSON array of strings");
1459
- }
1460
- for (const item of parsed) {
1461
- if (typeof item !== "string") {
1462
- throw new Error("--messages-file entries must be strings");
1463
- }
1464
- out.push(item);
1465
- }
1466
- }
1467
- if (messages !== undefined) {
1468
- out.push(...messages);
1469
- }
1470
- return out;
1471
- }
1472
- function parseTimeoutMs(value) {
1473
- if (value === undefined) {
1474
- return undefined;
1475
- }
1476
- const n = Number.parseInt(value, 10);
1477
- if (Number.isNaN(n) || n <= 0) {
1478
- throw new Error(`invalid --timeout-ms: ${value}`);
1479
- }
1480
- return n;
1481
- }
1482
- function parseMaxConcurrency(value) {
1483
- if (value === undefined) {
1484
- return undefined;
1485
- }
1486
- const n = Number.parseInt(value, 10);
1487
- if (Number.isNaN(n) || n <= 0) {
1488
- throw new Error(`invalid --max-concurrency: ${value}`);
1489
- }
1490
- return n;
1491
- }
1492
- /**
1493
- * Load mounts the same way `serve` does (multi-agent layout by default).
1494
- */
1495
- async function loadMounts(dir) {
1496
- return resolveAgentMounts(dir);
1497
- }
1498
- function section(title, items) {
1499
- if (items.length === 0) {
1500
- return "";
1501
- }
1502
- return `${title}:\n${items.map((item) => ` - ${item}`).join("\n")}`;
1503
- }
1504
- function isEnterOnly(text) {
1505
- return text.length > 0 && [...text].every((ch) => ch === "\n" || ch === "\r");
1506
- }
1507
- /**
1508
- * `dev [path]` takes a positional project root; `serve` keeps `--dir` only.
1509
- * Reject mixing a positional with an explicit `--dir`, and extra args on `dev`.
1510
- */
1511
- function resolveServeDir(args) {
1512
- if (args.command !== "dev") {
1513
- return args.dir;
1514
- }
1515
- if (args.positionals.length > 1) {
1516
- return {
1517
- error: `${CLI} dev: unexpected arguments: ${args.positionals.slice(1).join(" ")}\n`,
1518
- };
1519
- }
1520
- const positionalDir = args.positionals[0];
1521
- if (positionalDir === undefined) {
1522
- return args.dir;
1523
- }
1524
- if (args.dirFlagPassed && args.dir !== positionalDir) {
1525
- return {
1526
- error: `${CLI} dev: pass a path as a positional or --dir, not both\n`,
1527
- };
1528
- }
1529
- return positionalDir;
1530
- }
1531
- function printServeBanner(handle, opts) {
1532
- const c = stdoutPalette();
1533
- const agents = handle.agents;
1534
- // Name the framework build in the boot line: hosted engines install the
1535
- // published package at provision time, so the serve log is the only
1536
- // durable record of which build a deployment's turns actually ran on.
1537
- const versionTag = c.dim(`(${PACKAGE_NAME} ${packageVersion()})`);
1538
- if (agents.length > 1) {
1539
- process.stdout.write(`${agents.length} agents listening ${versionTag}\n`);
1540
- }
1541
- else {
1542
- const info = agents[0]?.info;
1543
- if (info !== undefined) {
1544
- process.stdout.write(`${info.name} listening ${versionTag}\n`);
1545
- }
1546
- }
1547
- const playgroundUrl = resolvePlaygroundBannerUrl(handle, opts.noPlayground);
1548
- if (playgroundUrl !== undefined) {
1549
- process.stdout.write(` playground ${c.cyan(playgroundUrl)}\n`);
1550
- }
1551
- // `/` is only mounted when the playground host home is enabled.
1552
- if (!opts.noPlayground) {
1553
- process.stdout.write(` home ${c.cyan(`${handle.url}/`)}\n`);
1554
- }
1555
- // Dev is playground-first (Vite proxies the API). Keep API/route detail for
1556
- // plain `serve`, where operators often curl the HTTP surface directly.
1557
- if (!opts.dev) {
1558
- process.stdout.write(c.dim(` api ${handle.url}\n`));
1559
- if (agents.length > 1 || agents[0]?.slug !== "") {
1560
- for (const agent of agents) {
1561
- const info = agent.info;
1562
- process.stdout.write(c.dim(` /${agent.slug} ${info.name}\n`));
1563
- }
1564
- }
1565
- else {
1566
- const info = agents[0]?.info;
1567
- if (info !== undefined) {
1568
- process.stdout.write(c.dim(` POST ${handle.url}/v1/session\n`));
1569
- process.stdout.write(c.dim(` GET ${handle.url}/v1/session/:sessionId/stream\n`));
1570
- for (const channel of info.channels) {
1571
- if (channel.id === "http") {
1572
- continue;
1573
- }
1574
- for (const route of channel.routes) {
1575
- process.stdout.write(c.dim(` ${route.method} ${handle.url}${route.url}\n`));
1576
- }
1577
- }
1578
- if (info.schedules.length > 0) {
1579
- const scheduleMode = opts.noSchedules ? "disabled" : "running on cron cadence (UTC)";
1580
- process.stdout.write(c.dim(` schedules: ${info.schedules.map((s) => s.name).join(", ")} — ${scheduleMode}\n`));
1581
- }
1582
- }
1583
- }
1584
- if (handle.docsUrl !== undefined) {
1585
- process.stdout.write(c.dim(` docs ${handle.docsUrl}\n`));
1586
- }
1587
- }
1588
- if (opts.bearerToken) {
1589
- process.stdout.write(c.dim(" auth: bearer token required on API routes (playground has a token field)\n"));
1590
- }
1591
- if (opts.dev &&
1592
- (process.env.GITHUB_WEBHOOK_SECRET === undefined || process.env.GITHUB_WEBHOOK_SECRET === "") &&
1593
- handle.agents.some((agent) => agent.info.channels.some((c) => c.kind === "github"))) {
1594
- process.stdout.write(c.dim(` github: dev accepts unsigned loopback deliveries (${CLI} github forward works without a secret; set GITHUB_WEBHOOK_SECRET to verify signatures)\n`));
1595
- }
1596
- if (opts.dev &&
1597
- (process.env.GITLAB_WEBHOOK_SECRET === undefined || process.env.GITLAB_WEBHOOK_SECRET === "") &&
1598
- handle.agents.some((agent) => agent.info.channels.some((c) => c.kind === "gitlab"))) {
1599
- process.stdout.write(c.dim(` gitlab: dev accepts unsigned loopback deliveries (${CLI} gitlab replay works without a secret; set GITLAB_WEBHOOK_SECRET to verify X-Gitlab-Token)\n`));
1600
- }
1601
- if (opts.dev &&
1602
- (process.env.BITBUCKET_WEBHOOK_SECRET === undefined ||
1603
- process.env.BITBUCKET_WEBHOOK_SECRET === "") &&
1604
- handle.agents.some((agent) => agent.info.channels.some((c) => c.kind === "bitbucket"))) {
1605
- process.stdout.write(c.dim(` bitbucket: dev accepts unsigned loopback deliveries (${CLI} bitbucket replay works without a secret; set BITBUCKET_WEBHOOK_SECRET to verify X-Hub-Signature)\n`));
1606
- }
1607
- if (opts.dev &&
1608
- (process.env.PAGERDUTY_WEBHOOK_SECRET === undefined ||
1609
- process.env.PAGERDUTY_WEBHOOK_SECRET === "") &&
1610
- handle.agents.some((agent) => agent.info.channels.some((c) => c.kind === "pagerduty"))) {
1611
- process.stdout.write(c.dim(` pagerduty: dev accepts unsigned loopback deliveries (${CLI} pagerduty replay works without a secret; set PAGERDUTY_WEBHOOK_SECRET to verify X-PagerDuty-Signature)\n`));
1612
- }
1613
- }
1614
- /** Prefer the Vite playground URL in --dev; otherwise the static SPA path. */
1615
- function resolvePlaygroundBannerUrl(handle, noPlayground) {
1616
- if (noPlayground) {
1617
- return undefined;
1618
- }
1619
- if (handle.playgroundDevUrl !== undefined) {
1620
- return handle.playgroundDevUrl.replace(/\/$/, "");
1621
- }
1622
- if (handle.agents.length === 1) {
1623
- return `${handle.agents[0].url}/playground`;
1624
- }
1625
- if (handle.agents.length > 1) {
1626
- return handle.url;
1627
- }
1628
- return undefined;
1629
- }
1630
- function formatModel(model) {
1631
- if (model === undefined) {
1632
- return "(unset)";
1633
- }
1634
- if (typeof model === "string") {
1635
- return model;
1636
- }
1637
- return JSON.stringify(model);
33
+ return runCli(COMMANDS, argv, {
34
+ stdout: writeStdout,
35
+ stderr: (text) => void process.stderr.write(text),
36
+ ask: askOnTty,
37
+ });
1638
38
  }
1639
39
  /**
1640
40
  * The Cursor SDK's Connect/HTTP2 client sometimes emits uncaught stream
@@ -1695,8 +95,10 @@ installTransportErrorGuards();
1695
95
  registerAuthoredModuleLoaders()
1696
96
  .then(() => main(process.argv.slice(2)))
1697
97
  .then((code) => {
1698
- // Ephemeral run/eval can leave SDK/HTTP handles open; force exit.
1699
- process.exit(code);
98
+ // Ephemeral run/eval can leave SDK/HTTP handles open; force exit. Exit
99
+ // only after stdout drains: a pipe write is async, so an early exit cuts
100
+ // a --json payload at the pipe buffer (8 KiB under a Node parent).
101
+ process.stdout.write("", () => process.exit(code));
1700
102
  }, (error) => {
1701
103
  process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
1702
104
  process.exit(1);