@grok/agent-sdk 0.0.0-stage → 0.2.27

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 (1966) hide show
  1. package/AGENTS.md +336 -0
  2. package/CHANGELOG.md +3 -0
  3. package/LICENSE.md +3 -0
  4. package/README.md +106 -2
  5. package/dist/artifacts.d.ts +37 -0
  6. package/dist/artifacts.d.ts.map +1 -0
  7. package/dist/artifacts.js +52 -0
  8. package/dist/bin/agent-sdk.js +2 -0
  9. package/dist/bin/agent-serve.d.ts +20 -0
  10. package/dist/bin/agent-serve.d.ts.map +1 -0
  11. package/dist/bin/agent-serve.js +1703 -0
  12. package/dist/channels/bitbucket/api.d.ts +217 -0
  13. package/dist/channels/bitbucket/api.d.ts.map +1 -0
  14. package/dist/channels/bitbucket/api.js +648 -0
  15. package/dist/channels/bitbucket/binding.d.ts +75 -0
  16. package/dist/channels/bitbucket/binding.d.ts.map +1 -0
  17. package/dist/channels/bitbucket/binding.js +313 -0
  18. package/dist/channels/bitbucket/bitbucket-channel.d.ts +47 -0
  19. package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -0
  20. package/dist/channels/bitbucket/bitbucket-channel.js +173 -0
  21. package/dist/channels/bitbucket/bitbucket-webhook.d.ts +73 -0
  22. package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -0
  23. package/dist/channels/bitbucket/bitbucket-webhook.js +399 -0
  24. package/dist/channels/bitbucket/checks.d.ts +67 -0
  25. package/dist/channels/bitbucket/checks.d.ts.map +1 -0
  26. package/dist/channels/bitbucket/checks.js +90 -0
  27. package/dist/channels/bitbucket/cursor-account.d.ts +37 -0
  28. package/dist/channels/bitbucket/cursor-account.d.ts.map +1 -0
  29. package/dist/channels/bitbucket/cursor-account.js +65 -0
  30. package/dist/channels/bitbucket/defaults.d.ts +26 -0
  31. package/dist/channels/bitbucket/defaults.d.ts.map +1 -0
  32. package/dist/channels/bitbucket/defaults.js +77 -0
  33. package/dist/channels/bitbucket/events.d.ts +22 -0
  34. package/dist/channels/bitbucket/events.d.ts.map +1 -0
  35. package/dist/channels/bitbucket/events.js +59 -0
  36. package/dist/channels/bitbucket/index.d.ts +38 -0
  37. package/dist/channels/bitbucket/index.d.ts.map +1 -0
  38. package/dist/channels/bitbucket/index.js +37 -0
  39. package/dist/channels/bitbucket/replay.d.ts +63 -0
  40. package/dist/channels/bitbucket/replay.d.ts.map +1 -0
  41. package/dist/channels/bitbucket/replay.js +326 -0
  42. package/dist/channels/bitbucket/state.d.ts +35 -0
  43. package/dist/channels/bitbucket/state.d.ts.map +1 -0
  44. package/dist/channels/bitbucket/state.js +30 -0
  45. package/dist/channels/bitbucket/types.d.ts +236 -0
  46. package/dist/channels/bitbucket/types.d.ts.map +1 -0
  47. package/dist/channels/bitbucket/types.js +1 -0
  48. package/dist/channels/change-monitors/change-monitors-channel.d.ts +5 -0
  49. package/dist/channels/change-monitors/change-monitors-channel.d.ts.map +1 -0
  50. package/dist/channels/change-monitors/change-monitors-channel.js +45 -0
  51. package/dist/channels/change-monitors/index.d.ts +4 -0
  52. package/dist/channels/change-monitors/index.d.ts.map +1 -0
  53. package/dist/channels/change-monitors/index.js +2 -0
  54. package/dist/channels/change-monitors/types.d.ts +42 -0
  55. package/dist/channels/change-monitors/types.d.ts.map +1 -0
  56. package/dist/channels/change-monitors/types.js +1 -0
  57. package/dist/channels/checks.d.ts +121 -0
  58. package/dist/channels/checks.d.ts.map +1 -0
  59. package/dist/channels/checks.js +76 -0
  60. package/dist/channels/deployments/deployments-channel.d.ts +95 -0
  61. package/dist/channels/deployments/deployments-channel.d.ts.map +1 -0
  62. package/dist/channels/deployments/deployments-channel.js +188 -0
  63. package/dist/channels/deployments/index.d.ts +25 -0
  64. package/dist/channels/deployments/index.d.ts.map +1 -0
  65. package/dist/channels/deployments/index.js +24 -0
  66. package/dist/channels/deployments/types.d.ts +83 -0
  67. package/dist/channels/deployments/types.d.ts.map +1 -0
  68. package/dist/channels/deployments/types.js +7 -0
  69. package/dist/channels/github/api.d.ts +133 -0
  70. package/dist/channels/github/api.d.ts.map +1 -0
  71. package/dist/channels/github/api.js +373 -0
  72. package/dist/channels/github/auth.d.ts +71 -0
  73. package/dist/channels/github/auth.d.ts.map +1 -0
  74. package/dist/channels/github/auth.js +247 -0
  75. package/dist/channels/github/binding.d.ts +86 -0
  76. package/dist/channels/github/binding.d.ts.map +1 -0
  77. package/dist/channels/github/binding.js +123 -0
  78. package/dist/channels/github/checks.d.ts +64 -0
  79. package/dist/channels/github/checks.d.ts.map +1 -0
  80. package/dist/channels/github/checks.js +93 -0
  81. package/dist/channels/github/cursor-account.d.ts +109 -0
  82. package/dist/channels/github/cursor-account.d.ts.map +1 -0
  83. package/dist/channels/github/cursor-account.js +206 -0
  84. package/dist/channels/github/defaults.d.ts +23 -0
  85. package/dist/channels/github/defaults.d.ts.map +1 -0
  86. package/dist/channels/github/defaults.js +132 -0
  87. package/dist/channels/github/events.d.ts +18 -0
  88. package/dist/channels/github/events.d.ts.map +1 -0
  89. package/dist/channels/github/events.js +56 -0
  90. package/dist/channels/github/forward.d.ts +139 -0
  91. package/dist/channels/github/forward.d.ts.map +1 -0
  92. package/dist/channels/github/forward.js +263 -0
  93. package/dist/channels/github/github-channel.d.ts +187 -0
  94. package/dist/channels/github/github-channel.d.ts.map +1 -0
  95. package/dist/channels/github/github-channel.js +2089 -0
  96. package/dist/channels/github/index.d.ts +64 -0
  97. package/dist/channels/github/index.d.ts.map +1 -0
  98. package/dist/channels/github/index.js +52 -0
  99. package/dist/channels/github/progress.d.ts +84 -0
  100. package/dist/channels/github/progress.d.ts.map +1 -0
  101. package/dist/channels/github/progress.js +235 -0
  102. package/dist/channels/github/replay.d.ts +115 -0
  103. package/dist/channels/github/replay.d.ts.map +1 -0
  104. package/dist/channels/github/replay.js +269 -0
  105. package/dist/channels/github/state.d.ts +47 -0
  106. package/dist/channels/github/state.d.ts.map +1 -0
  107. package/dist/channels/github/state.js +77 -0
  108. package/dist/channels/github/types.d.ts +515 -0
  109. package/dist/channels/github/types.d.ts.map +1 -0
  110. package/dist/channels/github/types.js +1 -0
  111. package/dist/channels/gitlab/api.d.ts +118 -0
  112. package/dist/channels/gitlab/api.d.ts.map +1 -0
  113. package/dist/channels/gitlab/api.js +220 -0
  114. package/dist/channels/gitlab/binding.d.ts +63 -0
  115. package/dist/channels/gitlab/binding.d.ts.map +1 -0
  116. package/dist/channels/gitlab/binding.js +166 -0
  117. package/dist/channels/gitlab/checks.d.ts +110 -0
  118. package/dist/channels/gitlab/checks.d.ts.map +1 -0
  119. package/dist/channels/gitlab/checks.js +121 -0
  120. package/dist/channels/gitlab/cursor-account.d.ts +36 -0
  121. package/dist/channels/gitlab/cursor-account.d.ts.map +1 -0
  122. package/dist/channels/gitlab/cursor-account.js +64 -0
  123. package/dist/channels/gitlab/defaults.d.ts +25 -0
  124. package/dist/channels/gitlab/defaults.d.ts.map +1 -0
  125. package/dist/channels/gitlab/defaults.js +61 -0
  126. package/dist/channels/gitlab/events.d.ts +12 -0
  127. package/dist/channels/gitlab/events.d.ts.map +1 -0
  128. package/dist/channels/gitlab/events.js +26 -0
  129. package/dist/channels/gitlab/gitlab-channel.d.ts +48 -0
  130. package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -0
  131. package/dist/channels/gitlab/gitlab-channel.js +173 -0
  132. package/dist/channels/gitlab/gitlab-webhook.d.ts +54 -0
  133. package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -0
  134. package/dist/channels/gitlab/gitlab-webhook.js +421 -0
  135. package/dist/channels/gitlab/index.d.ts +35 -0
  136. package/dist/channels/gitlab/index.d.ts.map +1 -0
  137. package/dist/channels/gitlab/index.js +34 -0
  138. package/dist/channels/gitlab/replay.d.ts +105 -0
  139. package/dist/channels/gitlab/replay.d.ts.map +1 -0
  140. package/dist/channels/gitlab/replay.js +222 -0
  141. package/dist/channels/gitlab/state.d.ts +33 -0
  142. package/dist/channels/gitlab/state.d.ts.map +1 -0
  143. package/dist/channels/gitlab/state.js +31 -0
  144. package/dist/channels/gitlab/types.d.ts +222 -0
  145. package/dist/channels/gitlab/types.d.ts.map +1 -0
  146. package/dist/channels/gitlab/types.js +1 -0
  147. package/dist/channels/issues/index.d.ts +4 -0
  148. package/dist/channels/issues/index.d.ts.map +1 -0
  149. package/dist/channels/issues/index.js +2 -0
  150. package/dist/channels/issues/issues-channel.d.ts +5 -0
  151. package/dist/channels/issues/issues-channel.d.ts.map +1 -0
  152. package/dist/channels/issues/issues-channel.js +35 -0
  153. package/dist/channels/issues/types.d.ts +33 -0
  154. package/dist/channels/issues/types.d.ts.map +1 -0
  155. package/dist/channels/issues/types.js +1 -0
  156. package/dist/channels/origin/api.d.ts +157 -0
  157. package/dist/channels/origin/api.d.ts.map +1 -0
  158. package/dist/channels/origin/api.js +363 -0
  159. package/dist/channels/origin/binding.d.ts +57 -0
  160. package/dist/channels/origin/binding.d.ts.map +1 -0
  161. package/dist/channels/origin/binding.js +56 -0
  162. package/dist/channels/origin/checks.d.ts +119 -0
  163. package/dist/channels/origin/checks.d.ts.map +1 -0
  164. package/dist/channels/origin/checks.js +147 -0
  165. package/dist/channels/origin/cursor-account.d.ts +24 -0
  166. package/dist/channels/origin/cursor-account.d.ts.map +1 -0
  167. package/dist/channels/origin/cursor-account.js +35 -0
  168. package/dist/channels/origin/defaults.d.ts +43 -0
  169. package/dist/channels/origin/defaults.d.ts.map +1 -0
  170. package/dist/channels/origin/defaults.js +94 -0
  171. package/dist/channels/origin/events.d.ts +10 -0
  172. package/dist/channels/origin/events.d.ts.map +1 -0
  173. package/dist/channels/origin/events.js +25 -0
  174. package/dist/channels/origin/index.d.ts +45 -0
  175. package/dist/channels/origin/index.d.ts.map +1 -0
  176. package/dist/channels/origin/index.js +33 -0
  177. package/dist/channels/origin/origin-channel.d.ts +72 -0
  178. package/dist/channels/origin/origin-channel.d.ts.map +1 -0
  179. package/dist/channels/origin/origin-channel.js +628 -0
  180. package/dist/channels/origin/origin-webhook.d.ts +69 -0
  181. package/dist/channels/origin/origin-webhook.d.ts.map +1 -0
  182. package/dist/channels/origin/origin-webhook.js +213 -0
  183. package/dist/channels/origin/reactions.d.ts +56 -0
  184. package/dist/channels/origin/reactions.d.ts.map +1 -0
  185. package/dist/channels/origin/reactions.js +46 -0
  186. package/dist/channels/origin/state.d.ts +32 -0
  187. package/dist/channels/origin/state.d.ts.map +1 -0
  188. package/dist/channels/origin/state.js +31 -0
  189. package/dist/channels/origin/types.d.ts +257 -0
  190. package/dist/channels/origin/types.d.ts.map +1 -0
  191. package/dist/channels/origin/types.js +1 -0
  192. package/dist/channels/pagerduty/api.d.ts +74 -0
  193. package/dist/channels/pagerduty/api.d.ts.map +1 -0
  194. package/dist/channels/pagerduty/api.js +101 -0
  195. package/dist/channels/pagerduty/defaults.d.ts +42 -0
  196. package/dist/channels/pagerduty/defaults.d.ts.map +1 -0
  197. package/dist/channels/pagerduty/defaults.js +132 -0
  198. package/dist/channels/pagerduty/events.d.ts +24 -0
  199. package/dist/channels/pagerduty/events.d.ts.map +1 -0
  200. package/dist/channels/pagerduty/events.js +38 -0
  201. package/dist/channels/pagerduty/index.d.ts +31 -0
  202. package/dist/channels/pagerduty/index.d.ts.map +1 -0
  203. package/dist/channels/pagerduty/index.js +30 -0
  204. package/dist/channels/pagerduty/pagerduty-channel.d.ts +64 -0
  205. package/dist/channels/pagerduty/pagerduty-channel.d.ts.map +1 -0
  206. package/dist/channels/pagerduty/pagerduty-channel.js +195 -0
  207. package/dist/channels/pagerduty/pagerduty-webhook.d.ts +70 -0
  208. package/dist/channels/pagerduty/pagerduty-webhook.d.ts.map +1 -0
  209. package/dist/channels/pagerduty/pagerduty-webhook.js +280 -0
  210. package/dist/channels/pagerduty/payload.d.ts +33 -0
  211. package/dist/channels/pagerduty/payload.d.ts.map +1 -0
  212. package/dist/channels/pagerduty/payload.js +150 -0
  213. package/dist/channels/pagerduty/replay.d.ts +35 -0
  214. package/dist/channels/pagerduty/replay.d.ts.map +1 -0
  215. package/dist/channels/pagerduty/replay.js +115 -0
  216. package/dist/channels/pagerduty/secrets.d.ts +16 -0
  217. package/dist/channels/pagerduty/secrets.d.ts.map +1 -0
  218. package/dist/channels/pagerduty/secrets.js +23 -0
  219. package/dist/channels/pagerduty/self-user.d.ts +51 -0
  220. package/dist/channels/pagerduty/self-user.d.ts.map +1 -0
  221. package/dist/channels/pagerduty/self-user.js +157 -0
  222. package/dist/channels/pagerduty/state.d.ts +31 -0
  223. package/dist/channels/pagerduty/state.d.ts.map +1 -0
  224. package/dist/channels/pagerduty/state.js +30 -0
  225. package/dist/channels/pagerduty/types.d.ts +217 -0
  226. package/dist/channels/pagerduty/types.d.ts.map +1 -0
  227. package/dist/channels/pagerduty/types.js +1 -0
  228. package/dist/channels/runs/index.d.ts +4 -0
  229. package/dist/channels/runs/index.d.ts.map +1 -0
  230. package/dist/channels/runs/index.js +2 -0
  231. package/dist/channels/runs/runs-channel.d.ts +5 -0
  232. package/dist/channels/runs/runs-channel.d.ts.map +1 -0
  233. package/dist/channels/runs/runs-channel.js +34 -0
  234. package/dist/channels/runs/types.d.ts +34 -0
  235. package/dist/channels/runs/types.d.ts.map +1 -0
  236. package/dist/channels/runs/types.js +1 -0
  237. package/dist/channels/slack/agentic-delivery.d.ts +24 -0
  238. package/dist/channels/slack/agentic-delivery.d.ts.map +1 -0
  239. package/dist/channels/slack/agentic-delivery.js +510 -0
  240. package/dist/channels/slack/agentic-posted.d.ts +30 -0
  241. package/dist/channels/slack/agentic-posted.d.ts.map +1 -0
  242. package/dist/channels/slack/agentic-posted.js +101 -0
  243. package/dist/channels/slack/agentic-signals.d.ts +43 -0
  244. package/dist/channels/slack/agentic-signals.d.ts.map +1 -0
  245. package/dist/channels/slack/agentic-signals.js +199 -0
  246. package/dist/channels/slack/api.d.ts +172 -0
  247. package/dist/channels/slack/api.d.ts.map +1 -0
  248. package/dist/channels/slack/api.js +642 -0
  249. package/dist/channels/slack/approvals.d.ts +48 -0
  250. package/dist/channels/slack/approvals.d.ts.map +1 -0
  251. package/dist/channels/slack/approvals.js +233 -0
  252. package/dist/channels/slack/assistant.d.ts +23 -0
  253. package/dist/channels/slack/assistant.d.ts.map +1 -0
  254. package/dist/channels/slack/assistant.js +57 -0
  255. package/dist/channels/slack/attachments.d.ts +85 -0
  256. package/dist/channels/slack/attachments.d.ts.map +1 -0
  257. package/dist/channels/slack/attachments.js +507 -0
  258. package/dist/channels/slack/auth.d.ts +46 -0
  259. package/dist/channels/slack/auth.d.ts.map +1 -0
  260. package/dist/channels/slack/auth.js +97 -0
  261. package/dist/channels/slack/blocks.d.ts +61 -0
  262. package/dist/channels/slack/blocks.d.ts.map +1 -0
  263. package/dist/channels/slack/blocks.js +90 -0
  264. package/dist/channels/slack/bot-mentions.d.ts +108 -0
  265. package/dist/channels/slack/bot-mentions.d.ts.map +1 -0
  266. package/dist/channels/slack/bot-mentions.js +243 -0
  267. package/dist/channels/slack/channel-watch.d.ts +80 -0
  268. package/dist/channels/slack/channel-watch.d.ts.map +1 -0
  269. package/dist/channels/slack/channel-watch.js +264 -0
  270. package/dist/channels/slack/cli-project.d.ts +19 -0
  271. package/dist/channels/slack/cli-project.d.ts.map +1 -0
  272. package/dist/channels/slack/cli-project.js +203 -0
  273. package/dist/channels/slack/code-fences.d.ts +17 -0
  274. package/dist/channels/slack/code-fences.d.ts.map +1 -0
  275. package/dist/channels/slack/code-fences.js +164 -0
  276. package/dist/channels/slack/constants.d.ts +27 -0
  277. package/dist/channels/slack/constants.d.ts.map +1 -0
  278. package/dist/channels/slack/constants.js +37 -0
  279. package/dist/channels/slack/credentials.d.ts +35 -0
  280. package/dist/channels/slack/credentials.d.ts.map +1 -0
  281. package/dist/channels/slack/credentials.js +73 -0
  282. package/dist/channels/slack/defaults.d.ts +50 -0
  283. package/dist/channels/slack/defaults.d.ts.map +1 -0
  284. package/dist/channels/slack/defaults.js +592 -0
  285. package/dist/channels/slack/dispatch.d.ts +153 -0
  286. package/dist/channels/slack/dispatch.d.ts.map +1 -0
  287. package/dist/channels/slack/dispatch.js +820 -0
  288. package/dist/channels/slack/doctor.d.ts +40 -0
  289. package/dist/channels/slack/doctor.d.ts.map +1 -0
  290. package/dist/channels/slack/doctor.js +277 -0
  291. package/dist/channels/slack/eval-directive.d.ts +59 -0
  292. package/dist/channels/slack/eval-directive.d.ts.map +1 -0
  293. package/dist/channels/slack/eval-directive.js +252 -0
  294. package/dist/channels/slack/event-id-dedupe.d.ts +10 -0
  295. package/dist/channels/slack/event-id-dedupe.d.ts.map +1 -0
  296. package/dist/channels/slack/event-id-dedupe.js +23 -0
  297. package/dist/channels/slack/external-policy.d.ts +28 -0
  298. package/dist/channels/slack/external-policy.d.ts.map +1 -0
  299. package/dist/channels/slack/external-policy.js +51 -0
  300. package/dist/channels/slack/footer.d.ts +33 -0
  301. package/dist/channels/slack/footer.d.ts.map +1 -0
  302. package/dist/channels/slack/footer.js +72 -0
  303. package/dist/channels/slack/inbound.d.ts +104 -0
  304. package/dist/channels/slack/inbound.d.ts.map +1 -0
  305. package/dist/channels/slack/inbound.js +350 -0
  306. package/dist/channels/slack/index.d.ts +56 -0
  307. package/dist/channels/slack/index.d.ts.map +1 -0
  308. package/dist/channels/slack/index.js +55 -0
  309. package/dist/channels/slack/init.d.ts +41 -0
  310. package/dist/channels/slack/init.d.ts.map +1 -0
  311. package/dist/channels/slack/init.js +109 -0
  312. package/dist/channels/slack/interactive.d.ts +73 -0
  313. package/dist/channels/slack/interactive.d.ts.map +1 -0
  314. package/dist/channels/slack/interactive.js +309 -0
  315. package/dist/channels/slack/links.d.ts +10 -0
  316. package/dist/channels/slack/links.d.ts.map +1 -0
  317. package/dist/channels/slack/links.js +18 -0
  318. package/dist/channels/slack/live-delivery.d.ts +80 -0
  319. package/dist/channels/slack/live-delivery.d.ts.map +1 -0
  320. package/dist/channels/slack/live-delivery.js +386 -0
  321. package/dist/channels/slack/log.d.ts +25 -0
  322. package/dist/channels/slack/log.d.ts.map +1 -0
  323. package/dist/channels/slack/log.js +44 -0
  324. package/dist/channels/slack/manifest.d.ts +80 -0
  325. package/dist/channels/slack/manifest.d.ts.map +1 -0
  326. package/dist/channels/slack/manifest.js +186 -0
  327. package/dist/channels/slack/message-body.d.ts +13 -0
  328. package/dist/channels/slack/message-body.d.ts.map +1 -0
  329. package/dist/channels/slack/message-body.js +74 -0
  330. package/dist/channels/slack/nudge-carrier.d.ts +21 -0
  331. package/dist/channels/slack/nudge-carrier.d.ts.map +1 -0
  332. package/dist/channels/slack/nudge-carrier.js +201 -0
  333. package/dist/channels/slack/nudge-store.d.ts +77 -0
  334. package/dist/channels/slack/nudge-store.d.ts.map +1 -0
  335. package/dist/channels/slack/nudge-store.js +288 -0
  336. package/dist/channels/slack/paint-start.d.ts +22 -0
  337. package/dist/channels/slack/paint-start.d.ts.map +1 -0
  338. package/dist/channels/slack/paint-start.js +76 -0
  339. package/dist/channels/slack/placeholder.d.ts +62 -0
  340. package/dist/channels/slack/placeholder.d.ts.map +1 -0
  341. package/dist/channels/slack/placeholder.js +237 -0
  342. package/dist/channels/slack/pr-ref.d.ts +24 -0
  343. package/dist/channels/slack/pr-ref.d.ts.map +1 -0
  344. package/dist/channels/slack/pr-ref.js +55 -0
  345. package/dist/channels/slack/progress-delivery.d.ts +28 -0
  346. package/dist/channels/slack/progress-delivery.d.ts.map +1 -0
  347. package/dist/channels/slack/progress-delivery.js +109 -0
  348. package/dist/channels/slack/reasoning-card.d.ts +38 -0
  349. package/dist/channels/slack/reasoning-card.d.ts.map +1 -0
  350. package/dist/channels/slack/reasoning-card.js +90 -0
  351. package/dist/channels/slack/reasoning-chip.d.ts +8 -0
  352. package/dist/channels/slack/reasoning-chip.d.ts.map +1 -0
  353. package/dist/channels/slack/reasoning-chip.js +30 -0
  354. package/dist/channels/slack/recording-sink.d.ts +29 -0
  355. package/dist/channels/slack/recording-sink.d.ts.map +1 -0
  356. package/dist/channels/slack/recording-sink.js +128 -0
  357. package/dist/channels/slack/redact.d.ts +2 -0
  358. package/dist/channels/slack/redact.d.ts.map +1 -0
  359. package/dist/channels/slack/redact.js +5 -0
  360. package/dist/channels/slack/reply-options.d.ts +56 -0
  361. package/dist/channels/slack/reply-options.d.ts.map +1 -0
  362. package/dist/channels/slack/reply-options.js +218 -0
  363. package/dist/channels/slack/self-identity.d.ts +18 -0
  364. package/dist/channels/slack/self-identity.d.ts.map +1 -0
  365. package/dist/channels/slack/self-identity.js +49 -0
  366. package/dist/channels/slack/sender-name.d.ts +26 -0
  367. package/dist/channels/slack/sender-name.d.ts.map +1 -0
  368. package/dist/channels/slack/sender-name.js +79 -0
  369. package/dist/channels/slack/setup.d.ts +33 -0
  370. package/dist/channels/slack/setup.d.ts.map +1 -0
  371. package/dist/channels/slack/setup.js +99 -0
  372. package/dist/channels/slack/slack-channel.d.ts +46 -0
  373. package/dist/channels/slack/slack-channel.d.ts.map +1 -0
  374. package/dist/channels/slack/slack-channel.js +683 -0
  375. package/dist/channels/slack/socket-mode.d.ts +26 -0
  376. package/dist/channels/slack/socket-mode.d.ts.map +1 -0
  377. package/dist/channels/slack/socket-mode.js +100 -0
  378. package/dist/channels/slack/stop.d.ts +14 -0
  379. package/dist/channels/slack/stop.d.ts.map +1 -0
  380. package/dist/channels/slack/stop.js +22 -0
  381. package/dist/channels/slack/stream.d.ts +42 -0
  382. package/dist/channels/slack/stream.d.ts.map +1 -0
  383. package/dist/channels/slack/stream.js +30 -0
  384. package/dist/channels/slack/thread-context.d.ts +89 -0
  385. package/dist/channels/slack/thread-context.d.ts.map +1 -0
  386. package/dist/channels/slack/thread-context.js +459 -0
  387. package/dist/channels/slack/tool-approval-events.d.ts +38 -0
  388. package/dist/channels/slack/tool-approval-events.d.ts.map +1 -0
  389. package/dist/channels/slack/tool-approval-events.js +207 -0
  390. package/dist/channels/slack/tool-cards.d.ts +22 -0
  391. package/dist/channels/slack/tool-cards.d.ts.map +1 -0
  392. package/dist/channels/slack/tool-cards.js +167 -0
  393. package/dist/channels/slack/tool-chip.d.ts +9 -0
  394. package/dist/channels/slack/tool-chip.d.ts.map +1 -0
  395. package/dist/channels/slack/tool-chip.js +22 -0
  396. package/dist/channels/slack/types.d.ts +811 -0
  397. package/dist/channels/slack/types.d.ts.map +1 -0
  398. package/dist/channels/slack/types.js +4 -0
  399. package/dist/channels/slack/upload.d.ts +13 -0
  400. package/dist/channels/slack/upload.d.ts.map +1 -0
  401. package/dist/channels/slack/upload.js +122 -0
  402. package/dist/channels/slack/user-info.d.ts +16 -0
  403. package/dist/channels/slack/user-info.d.ts.map +1 -0
  404. package/dist/channels/slack/user-info.js +58 -0
  405. package/dist/channels.d.ts +188 -0
  406. package/dist/channels.d.ts.map +1 -0
  407. package/dist/channels.js +421 -0
  408. package/dist/connections.d.ts +160 -0
  409. package/dist/connections.d.ts.map +1 -0
  410. package/dist/connections.js +185 -0
  411. package/dist/dashboard-session-url.d.ts +15 -0
  412. package/dist/dashboard-session-url.d.ts.map +1 -0
  413. package/dist/dashboard-session-url.js +24 -0
  414. package/dist/docs/404.html +24 -0
  415. package/dist/docs/architecture.svg +59 -0
  416. package/dist/docs/assets/app.wA5xBBcd.js +309 -0
  417. package/dist/docs/assets/building-with-agents.md.FZXrY8Nk.js +9 -0
  418. package/dist/docs/assets/building-with-agents.md.FZXrY8Nk.lean.js +1 -0
  419. package/dist/docs/assets/changelog.md.BvHRIiMH.js +1 -0
  420. package/dist/docs/assets/changelog.md.BvHRIiMH.lean.js +1 -0
  421. package/dist/docs/assets/chunks/@localSearchIndexroot.BoDEJQWv.js +1 -0
  422. package/dist/docs/assets/chunks/VPLocalSearchBox.C29HLCVL.js +9 -0
  423. package/dist/docs/assets/chunks/arc.BOaoYWmh.js +1 -0
  424. package/dist/docs/assets/chunks/architectureDiagram-Q4EWVU46.MfG0itQh.js +36 -0
  425. package/dist/docs/assets/chunks/baseUniq.CUeJciCF.js +1 -0
  426. package/dist/docs/assets/chunks/blockDiagram-DXYQGD6D.BrXMZRtK.js +132 -0
  427. package/dist/docs/assets/chunks/c4Diagram-AHTNJAMY.DfkDHeB9.js +10 -0
  428. package/dist/docs/assets/chunks/channel.D2BTz0L-.js +1 -0
  429. package/dist/docs/assets/chunks/chunk-4BX2VUAB.xKz8CiXK.js +1 -0
  430. package/dist/docs/assets/chunks/chunk-4TB4RGXK.kkfBh4zk.js +206 -0
  431. package/dist/docs/assets/chunks/chunk-55IACEB6.BClJGb94.js +1 -0
  432. package/dist/docs/assets/chunks/chunk-EDXVE4YY.P9BpQ9L3.js +1 -0
  433. package/dist/docs/assets/chunks/chunk-FMBD7UC4.R4iYi58S.js +15 -0
  434. package/dist/docs/assets/chunks/chunk-OYMX7WX6.Cpn8L1dw.js +231 -0
  435. package/dist/docs/assets/chunks/chunk-QZHKN3VN.BLftECqU.js +1 -0
  436. package/dist/docs/assets/chunks/chunk-YZCP3GAM.BWDV1AYt.js +1 -0
  437. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DqByliAC.js +1 -0
  438. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DqByliAC.js +1 -0
  439. package/dist/docs/assets/chunks/clone.CldT1lbQ.js +1 -0
  440. package/dist/docs/assets/chunks/cose-bilkent-S5V4N54A.DGpAcJ55.js +1 -0
  441. package/dist/docs/assets/chunks/cytoscape.esm.BQk4lpUV.js +331 -0
  442. package/dist/docs/assets/chunks/dagre-KV5264BT.BBXxGEaD.js +4 -0
  443. package/dist/docs/assets/chunks/defaultLocale.C4B-KCzX.js +1 -0
  444. package/dist/docs/assets/chunks/diagram-5BDNPKRD.EKqOwmK2.js +10 -0
  445. package/dist/docs/assets/chunks/diagram-G4DWMVQ6.CB8pdkoZ.js +24 -0
  446. package/dist/docs/assets/chunks/diagram-MMDJMWI5.aHh4WGg9.js +43 -0
  447. package/dist/docs/assets/chunks/diagram-TYMM5635.YIsbRH20.js +24 -0
  448. package/dist/docs/assets/chunks/erDiagram-SMLLAGMA.B3bTCW_e.js +85 -0
  449. package/dist/docs/assets/chunks/flowDiagram-DWJPFMVM.M81hXIXZ.js +162 -0
  450. package/dist/docs/assets/chunks/framework.BNw1pucY.js +19 -0
  451. package/dist/docs/assets/chunks/ganttDiagram-T4ZO3ILL.BKg7WY--.js +292 -0
  452. package/dist/docs/assets/chunks/gitGraphDiagram-UUTBAWPF.CLEMZgO3.js +106 -0
  453. package/dist/docs/assets/chunks/graph.DS38W_Q-.js +1 -0
  454. package/dist/docs/assets/chunks/infoDiagram-42DDH7IO.BTiWTi82.js +2 -0
  455. package/dist/docs/assets/chunks/init.Gi6I4Gst.js +1 -0
  456. package/dist/docs/assets/chunks/ishikawaDiagram-UXIWVN3A.DcqY_KQL.js +70 -0
  457. package/dist/docs/assets/chunks/journeyDiagram-VCZTEJTY.0lQNZ40U.js +139 -0
  458. package/dist/docs/assets/chunks/kanban-definition-6JOO6SKY.L5sKlf7X.js +89 -0
  459. package/dist/docs/assets/chunks/katex.DkKDou_j.js +257 -0
  460. package/dist/docs/assets/chunks/layout.7u4gFhQa.js +1 -0
  461. package/dist/docs/assets/chunks/linear.D5v33SOb.js +1 -0
  462. package/dist/docs/assets/chunks/min.Dc9uCxf9.js +1 -0
  463. package/dist/docs/assets/chunks/mindmap-definition-QFDTVHPH.B56nGoB_.js +96 -0
  464. package/dist/docs/assets/chunks/ordinal.DBvzRdQf.js +1 -0
  465. package/dist/docs/assets/chunks/pieDiagram-DEJITSTG.Cba8e8lS.js +30 -0
  466. package/dist/docs/assets/chunks/quadrantDiagram-34T5L4WZ.2YjBycHF.js +7 -0
  467. package/dist/docs/assets/chunks/requirementDiagram-MS252O5E.D4P5RqVI.js +84 -0
  468. package/dist/docs/assets/chunks/sankeyDiagram-XADWPNL6.C0Hn8NUm.js +10 -0
  469. package/dist/docs/assets/chunks/sequenceDiagram-FGHM5R23.BZm7EaoT.js +157 -0
  470. package/dist/docs/assets/chunks/stateDiagram-FHFEXIEX.DcR4f3X2.js +1 -0
  471. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.Bb4oMe0P.js +1 -0
  472. package/dist/docs/assets/chunks/theme.DvfKzyXq.js +2 -0
  473. package/dist/docs/assets/chunks/timeline-definition-GMOUNBTQ.CgDh96vg.js +120 -0
  474. package/dist/docs/assets/chunks/vennDiagram-DHZGUBPP.B4fagbC8.js +34 -0
  475. package/dist/docs/assets/chunks/virtual_mermaid-config.DDnGl6nM.js +1 -0
  476. package/dist/docs/assets/chunks/wardley-RL74JXVD.Ck68omim.js +162 -0
  477. package/dist/docs/assets/chunks/wardleyDiagram-NUSXRM2D.DBUg0bvz.js +20 -0
  478. package/dist/docs/assets/chunks/xychartDiagram-5P7HB3ND.DnKSGQE1.js +7 -0
  479. package/dist/docs/assets/deployment.md.3MMWuPeV.js +31 -0
  480. package/dist/docs/assets/deployment.md.3MMWuPeV.lean.js +1 -0
  481. package/dist/docs/assets/evals.md.CHR34K1Y.js +68 -0
  482. package/dist/docs/assets/evals.md.CHR34K1Y.lean.js +1 -0
  483. package/dist/docs/assets/guides_agent-to-agent.md.CwL5cwuE.js +42 -0
  484. package/dist/docs/assets/guides_agent-to-agent.md.CwL5cwuE.lean.js +1 -0
  485. package/dist/docs/assets/guides_bitbucket.md.CKUayYtD.js +145 -0
  486. package/dist/docs/assets/guides_bitbucket.md.CKUayYtD.lean.js +1 -0
  487. package/dist/docs/assets/guides_cloud-agents.md.BzbzcOyj.js +9 -0
  488. package/dist/docs/assets/guides_cloud-agents.md.BzbzcOyj.lean.js +1 -0
  489. package/dist/docs/assets/guides_convert-automation.md.DMEX9nF-.js +43 -0
  490. package/dist/docs/assets/guides_convert-automation.md.DMEX9nF-.lean.js +1 -0
  491. package/dist/docs/assets/guides_export-grokbot.md.qo5bxi4h.js +55 -0
  492. package/dist/docs/assets/guides_export-grokbot.md.qo5bxi4h.lean.js +1 -0
  493. package/dist/docs/assets/guides_github.md.TuNiZAOQ.js +162 -0
  494. package/dist/docs/assets/guides_github.md.TuNiZAOQ.lean.js +1 -0
  495. package/dist/docs/assets/guides_gitlab.md.CtNI4fSH.js +153 -0
  496. package/dist/docs/assets/guides_gitlab.md.CtNI4fSH.lean.js +1 -0
  497. package/dist/docs/assets/guides_grokbot-agents.md.BwAykJ7U.js +15 -0
  498. package/dist/docs/assets/guides_grokbot-agents.md.BwAykJ7U.lean.js +1 -0
  499. package/dist/docs/assets/guides_hooks.md.B2XfGX50.js +54 -0
  500. package/dist/docs/assets/guides_hooks.md.B2XfGX50.lean.js +1 -0
  501. package/dist/docs/assets/guides_improve.md.CZKVt1cT.js +21 -0
  502. package/dist/docs/assets/guides_improve.md.CZKVt1cT.lean.js +1 -0
  503. package/dist/docs/assets/guides_jev.md.D7XH4JH3.js +151 -0
  504. package/dist/docs/assets/guides_jev.md.D7XH4JH3.lean.js +1 -0
  505. package/dist/docs/assets/guides_mcp-oauth.md.Cxq2TxBB.js +38 -0
  506. package/dist/docs/assets/guides_mcp-oauth.md.Cxq2TxBB.lean.js +1 -0
  507. package/dist/docs/assets/guides_migrate.md.CQlGaBKX.js +7 -0
  508. package/dist/docs/assets/guides_migrate.md.CQlGaBKX.lean.js +1 -0
  509. package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.js +37 -0
  510. package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.lean.js +1 -0
  511. package/dist/docs/assets/guides_pagerduty.md.BHXMcMtx.js +60 -0
  512. package/dist/docs/assets/guides_pagerduty.md.BHXMcMtx.lean.js +1 -0
  513. package/dist/docs/assets/guides_slack.md.ClIyi7FI.js +75 -0
  514. package/dist/docs/assets/guides_slack.md.ClIyi7FI.lean.js +1 -0
  515. package/dist/docs/assets/guides_webhooks.md.Cpdc3BDX.js +93 -0
  516. package/dist/docs/assets/guides_webhooks.md.Cpdc3BDX.lean.js +1 -0
  517. package/dist/docs/assets/hillclimbing.md.Dxvd-0gT.js +7 -0
  518. package/dist/docs/assets/hillclimbing.md.Dxvd-0gT.lean.js +1 -0
  519. package/dist/docs/assets/index.md.CAnsLl8D.js +27 -0
  520. package/dist/docs/assets/index.md.CAnsLl8D.lean.js +1 -0
  521. package/dist/docs/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
  522. package/dist/docs/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
  523. package/dist/docs/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
  524. package/dist/docs/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
  525. package/dist/docs/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
  526. package/dist/docs/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
  527. package/dist/docs/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
  528. package/dist/docs/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
  529. package/dist/docs/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
  530. package/dist/docs/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
  531. package/dist/docs/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
  532. package/dist/docs/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
  533. package/dist/docs/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
  534. package/dist/docs/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
  535. package/dist/docs/assets/quickstart.md.D8JDfkKO.js +170 -0
  536. package/dist/docs/assets/quickstart.md.D8JDfkKO.lean.js +1 -0
  537. package/dist/docs/assets/reference_agent-config.md.CZrbHOfT.js +38 -0
  538. package/dist/docs/assets/reference_agent-config.md.CZrbHOfT.lean.js +1 -0
  539. package/dist/docs/assets/reference_artifacts.md.DLV9MZES.js +18 -0
  540. package/dist/docs/assets/reference_artifacts.md.DLV9MZES.lean.js +1 -0
  541. package/dist/docs/assets/reference_channels.md.CNNIS6K7.js +22 -0
  542. package/dist/docs/assets/reference_channels.md.CNNIS6K7.lean.js +1 -0
  543. package/dist/docs/assets/reference_cli.md.1o_TqKdt.js +103 -0
  544. package/dist/docs/assets/reference_cli.md.1o_TqKdt.lean.js +1 -0
  545. package/dist/docs/assets/reference_connections.md.BJE2Zllp.js +66 -0
  546. package/dist/docs/assets/reference_connections.md.BJE2Zllp.lean.js +1 -0
  547. package/dist/docs/assets/reference_evals.md.Ccwp4x3o.js +56 -0
  548. package/dist/docs/assets/reference_evals.md.Ccwp4x3o.lean.js +1 -0
  549. package/dist/docs/assets/reference_extensions.md.DKxTuCIw.js +62 -0
  550. package/dist/docs/assets/reference_extensions.md.DKxTuCIw.lean.js +1 -0
  551. package/dist/docs/assets/reference_hooks.md.CROr0QgC.js +51 -0
  552. package/dist/docs/assets/reference_hooks.md.CROr0QgC.lean.js +1 -0
  553. package/dist/docs/assets/reference_http-api.md.Dji-DD_Z.js +11 -0
  554. package/dist/docs/assets/reference_http-api.md.Dji-DD_Z.lean.js +1 -0
  555. package/dist/docs/assets/reference_instructions.md.BYMVxAkw.js +14 -0
  556. package/dist/docs/assets/reference_instructions.md.BYMVxAkw.lean.js +1 -0
  557. package/dist/docs/assets/reference_memory.md.BwyJXYZe.js +4 -0
  558. package/dist/docs/assets/reference_memory.md.BwyJXYZe.lean.js +1 -0
  559. package/dist/docs/assets/reference_playground.md.q4MI-0td.js +1 -0
  560. package/dist/docs/assets/reference_playground.md.q4MI-0td.lean.js +1 -0
  561. package/dist/docs/assets/reference_project-layout.md.mFcS8yDD.js +25 -0
  562. package/dist/docs/assets/reference_project-layout.md.mFcS8yDD.lean.js +1 -0
  563. package/dist/docs/assets/reference_prompt.md.DqPh71XN.js +9 -0
  564. package/dist/docs/assets/reference_prompt.md.DqPh71XN.lean.js +1 -0
  565. package/dist/docs/assets/reference_schedules.md.BqWnJES4.js +47 -0
  566. package/dist/docs/assets/reference_schedules.md.BqWnJES4.lean.js +1 -0
  567. package/dist/docs/assets/reference_sessions.md.Bi6lHttM.js +22 -0
  568. package/dist/docs/assets/reference_sessions.md.Bi6lHttM.lean.js +1 -0
  569. package/dist/docs/assets/reference_skills.md.Ckddg6KX.js +15 -0
  570. package/dist/docs/assets/reference_skills.md.Ckddg6KX.lean.js +1 -0
  571. package/dist/docs/assets/reference_subagents.md.ChNGh6HK.js +10 -0
  572. package/dist/docs/assets/reference_subagents.md.ChNGh6HK.lean.js +1 -0
  573. package/dist/docs/assets/reference_tools.md.Bo0UfT0a.js +79 -0
  574. package/dist/docs/assets/reference_tools.md.Bo0UfT0a.lean.js +1 -0
  575. package/dist/docs/assets/style.B9o0luvp.css +1 -0
  576. package/dist/docs/assets/templates_agentic-owners.md.CTEnR0jp.js +13 -0
  577. package/dist/docs/assets/templates_agentic-owners.md.CTEnR0jp.lean.js +1 -0
  578. package/dist/docs/assets/templates_grokbot-agents.md.DgpPEs7B.js +5 -0
  579. package/dist/docs/assets/templates_grokbot-agents.md.DgpPEs7B.lean.js +1 -0
  580. package/dist/docs/assets/templates_security-reviewer.md.Gh6EF9Us.js +3 -0
  581. package/dist/docs/assets/templates_security-reviewer.md.Gh6EF9Us.lean.js +1 -0
  582. package/dist/docs/assets/templates_thermo-quality-review.md.B77UyTrX.js +3 -0
  583. package/dist/docs/assets/templates_thermo-quality-review.md.B77UyTrX.lean.js +1 -0
  584. package/dist/docs/assets/templates_thermo-review.md.DRJ7mC5U.js +3 -0
  585. package/dist/docs/assets/templates_thermo-review.md.DRJ7mC5U.lean.js +1 -0
  586. package/dist/docs/assets/templates_triage.md.CNN6b0JZ.js +9 -0
  587. package/dist/docs/assets/templates_triage.md.CNN6b0JZ.lean.js +1 -0
  588. package/dist/docs/assets/troubleshooting.md.DFnoTDlQ.js +1 -0
  589. package/dist/docs/assets/troubleshooting.md.DFnoTDlQ.lean.js +1 -0
  590. package/dist/docs/building-with-agents.html +68 -0
  591. package/dist/docs/building-with-agents.md +134 -0
  592. package/dist/docs/changelog.html +60 -0
  593. package/dist/docs/changelog.md +114 -0
  594. package/dist/docs/deployment.html +90 -0
  595. package/dist/docs/deployment.md +309 -0
  596. package/dist/docs/evals.html +127 -0
  597. package/dist/docs/evals.md +239 -0
  598. package/dist/docs/guides/agent-to-agent.html +101 -0
  599. package/dist/docs/guides/agent-to-agent.md +162 -0
  600. package/dist/docs/guides/bitbucket.html +204 -0
  601. package/dist/docs/guides/bitbucket.md +293 -0
  602. package/dist/docs/guides/cloud-agents.html +68 -0
  603. package/dist/docs/guides/cloud-agents.md +81 -0
  604. package/dist/docs/guides/convert-automation.html +102 -0
  605. package/dist/docs/guides/convert-automation.md +180 -0
  606. package/dist/docs/guides/export-grokbot.html +114 -0
  607. package/dist/docs/guides/export-grokbot.md +239 -0
  608. package/dist/docs/guides/github.html +221 -0
  609. package/dist/docs/guides/github.md +373 -0
  610. package/dist/docs/guides/gitlab.html +212 -0
  611. package/dist/docs/guides/gitlab.md +299 -0
  612. package/dist/docs/guides/grokbot-agents.html +74 -0
  613. package/dist/docs/guides/grokbot-agents.md +135 -0
  614. package/dist/docs/guides/hooks.html +113 -0
  615. package/dist/docs/guides/hooks.md +116 -0
  616. package/dist/docs/guides/improve.html +80 -0
  617. package/dist/docs/guides/improve.md +129 -0
  618. package/dist/docs/guides/jev.html +210 -0
  619. package/dist/docs/guides/jev.md +298 -0
  620. package/dist/docs/guides/mcp-oauth.html +97 -0
  621. package/dist/docs/guides/mcp-oauth.md +148 -0
  622. package/dist/docs/guides/migrate.html +66 -0
  623. package/dist/docs/guides/migrate.md +164 -0
  624. package/dist/docs/guides/opentelemetry.html +96 -0
  625. package/dist/docs/guides/opentelemetry.md +205 -0
  626. package/dist/docs/guides/pagerduty.html +119 -0
  627. package/dist/docs/guides/pagerduty.md +336 -0
  628. package/dist/docs/guides/slack.html +134 -0
  629. package/dist/docs/guides/slack.md +309 -0
  630. package/dist/docs/guides/webhooks.html +152 -0
  631. package/dist/docs/guides/webhooks.md +250 -0
  632. package/dist/docs/hashmap.json +1 -0
  633. package/dist/docs/hillclimbing.html +66 -0
  634. package/dist/docs/hillclimbing.md +134 -0
  635. package/dist/docs/index.html +86 -0
  636. package/dist/docs/index.md +110 -0
  637. package/dist/docs/llms-full.txt +10077 -0
  638. package/dist/docs/llms.txt +68 -0
  639. package/dist/docs/quickstart.html +229 -0
  640. package/dist/docs/quickstart.md +307 -0
  641. package/dist/docs/reference/agent-config.html +97 -0
  642. package/dist/docs/reference/agent-config.md +238 -0
  643. package/dist/docs/reference/artifacts.html +77 -0
  644. package/dist/docs/reference/artifacts.md +113 -0
  645. package/dist/docs/reference/channels.html +81 -0
  646. package/dist/docs/reference/channels.md +214 -0
  647. package/dist/docs/reference/cli.html +162 -0
  648. package/dist/docs/reference/cli.md +1098 -0
  649. package/dist/docs/reference/connections.html +125 -0
  650. package/dist/docs/reference/connections.md +307 -0
  651. package/dist/docs/reference/evals.html +115 -0
  652. package/dist/docs/reference/evals.md +294 -0
  653. package/dist/docs/reference/extensions.html +121 -0
  654. package/dist/docs/reference/extensions.md +209 -0
  655. package/dist/docs/reference/hooks.html +110 -0
  656. package/dist/docs/reference/hooks.md +197 -0
  657. package/dist/docs/reference/http-api.html +70 -0
  658. package/dist/docs/reference/http-api.md +221 -0
  659. package/dist/docs/reference/instructions.html +73 -0
  660. package/dist/docs/reference/instructions.md +64 -0
  661. package/dist/docs/reference/memory.html +63 -0
  662. package/dist/docs/reference/memory.md +114 -0
  663. package/dist/docs/reference/playground.html +60 -0
  664. package/dist/docs/reference/playground.md +36 -0
  665. package/dist/docs/reference/project-layout.html +84 -0
  666. package/dist/docs/reference/project-layout.md +117 -0
  667. package/dist/docs/reference/prompt.html +68 -0
  668. package/dist/docs/reference/prompt.md +47 -0
  669. package/dist/docs/reference/schedules.html +106 -0
  670. package/dist/docs/reference/schedules.md +190 -0
  671. package/dist/docs/reference/sessions.html +81 -0
  672. package/dist/docs/reference/sessions.md +200 -0
  673. package/dist/docs/reference/skills.html +74 -0
  674. package/dist/docs/reference/skills.md +72 -0
  675. package/dist/docs/reference/subagents.html +69 -0
  676. package/dist/docs/reference/subagents.md +61 -0
  677. package/dist/docs/reference/tools.html +138 -0
  678. package/dist/docs/reference/tools.md +306 -0
  679. package/dist/docs/templates/agentic-owners.html +72 -0
  680. package/dist/docs/templates/agentic-owners.md +126 -0
  681. package/dist/docs/templates/grokbot-agents.html +64 -0
  682. package/dist/docs/templates/grokbot-agents.md +55 -0
  683. package/dist/docs/templates/security-reviewer.html +62 -0
  684. package/dist/docs/templates/security-reviewer.md +81 -0
  685. package/dist/docs/templates/thermo-quality-review.html +62 -0
  686. package/dist/docs/templates/thermo-quality-review.md +75 -0
  687. package/dist/docs/templates/thermo-review.html +62 -0
  688. package/dist/docs/templates/thermo-review.md +75 -0
  689. package/dist/docs/templates/triage.html +68 -0
  690. package/dist/docs/templates/triage.md +101 -0
  691. package/dist/docs/troubleshooting.html +60 -0
  692. package/dist/docs/troubleshooting.md +149 -0
  693. package/dist/docs/vp-icons.css +0 -0
  694. package/dist/evals/assertions.d.ts +199 -0
  695. package/dist/evals/assertions.d.ts.map +1 -0
  696. package/dist/evals/assertions.js +447 -0
  697. package/dist/evals/expect.d.ts +95 -0
  698. package/dist/evals/expect.d.ts.map +1 -0
  699. package/dist/evals/expect.js +184 -0
  700. package/dist/evals/judge.d.ts +134 -0
  701. package/dist/evals/judge.d.ts.map +1 -0
  702. package/dist/evals/judge.js +221 -0
  703. package/dist/evals/loaders.d.ts +51 -0
  704. package/dist/evals/loaders.d.ts.map +1 -0
  705. package/dist/evals/loaders.js +107 -0
  706. package/dist/evals/matchers.d.ts +95 -0
  707. package/dist/evals/matchers.d.ts.map +1 -0
  708. package/dist/evals/matchers.js +141 -0
  709. package/dist/evals/reporters.d.ts +70 -0
  710. package/dist/evals/reporters.d.ts.map +1 -0
  711. package/dist/evals/reporters.js +196 -0
  712. package/dist/evals/results.d.ts +103 -0
  713. package/dist/evals/results.d.ts.map +1 -0
  714. package/dist/evals/results.js +27 -0
  715. package/dist/evals/run-facts.d.ts +77 -0
  716. package/dist/evals/run-facts.d.ts.map +1 -0
  717. package/dist/evals/run-facts.js +213 -0
  718. package/dist/evals.d.ts +446 -0
  719. package/dist/evals.d.ts.map +1 -0
  720. package/dist/evals.js +304 -0
  721. package/dist/executors.d.ts +11 -0
  722. package/dist/executors.d.ts.map +1 -0
  723. package/dist/executors.js +21 -0
  724. package/dist/extensions/cursor-cloud-agents/extension.d.ts +94 -0
  725. package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -0
  726. package/dist/extensions/cursor-cloud-agents/extension.js +104 -0
  727. package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +118 -0
  728. package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -0
  729. package/dist/extensions/cursor-cloud-agents/lib/backend.js +290 -0
  730. package/dist/extensions/cursor-cloud-agents/lib/channels.d.ts +3 -0
  731. package/dist/extensions/cursor-cloud-agents/lib/channels.d.ts.map +1 -0
  732. package/dist/extensions/cursor-cloud-agents/lib/channels.js +11 -0
  733. package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts +25 -0
  734. package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts.map +1 -0
  735. package/dist/extensions/cursor-cloud-agents/lib/fleet.js +65 -0
  736. package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +5 -0
  737. package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -0
  738. package/dist/extensions/cursor-cloud-agents/lib/inputs.js +4 -0
  739. package/dist/extensions/cursor-cloud-agents/lib/launch-agent.d.ts +47 -0
  740. package/dist/extensions/cursor-cloud-agents/lib/launch-agent.d.ts.map +1 -0
  741. package/dist/extensions/cursor-cloud-agents/lib/launch-agent.js +62 -0
  742. package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts +17 -0
  743. package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts.map +1 -0
  744. package/dist/extensions/cursor-cloud-agents/lib/repos.js +60 -0
  745. package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts +8 -0
  746. package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts.map +1 -0
  747. package/dist/extensions/cursor-cloud-agents/lib/transcript.js +14 -0
  748. package/dist/extensions/cursor-cloud-agents/lib/watch.d.ts +17 -0
  749. package/dist/extensions/cursor-cloud-agents/lib/watch.d.ts.map +1 -0
  750. package/dist/extensions/cursor-cloud-agents/lib/watch.js +85 -0
  751. package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.d.ts +19 -0
  752. package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.d.ts.map +1 -0
  753. package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.js +60 -0
  754. package/dist/extensions/cursor-cloud-agents/skills/handoff.md +41 -0
  755. package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts +4 -0
  756. package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts.map +1 -0
  757. package/dist/extensions/cursor-cloud-agents/tools/cancel.js +19 -0
  758. package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts +4 -0
  759. package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts.map +1 -0
  760. package/dist/extensions/cursor-cloud-agents/tools/dump.js +43 -0
  761. package/dist/extensions/cursor-cloud-agents/tools/get.d.ts +4 -0
  762. package/dist/extensions/cursor-cloud-agents/tools/get.d.ts.map +1 -0
  763. package/dist/extensions/cursor-cloud-agents/tools/get.js +14 -0
  764. package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts +4 -0
  765. package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -0
  766. package/dist/extensions/cursor-cloud-agents/tools/launch.js +49 -0
  767. package/dist/extensions/cursor-cloud-agents/tools/list.d.ts +4 -0
  768. package/dist/extensions/cursor-cloud-agents/tools/list.d.ts.map +1 -0
  769. package/dist/extensions/cursor-cloud-agents/tools/list.js +25 -0
  770. package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts +4 -0
  771. package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts.map +1 -0
  772. package/dist/extensions/cursor-cloud-agents/tools/reply.js +26 -0
  773. package/dist/extensions/cursor-grokbot-agents/extension.d.ts +77 -0
  774. package/dist/extensions/cursor-grokbot-agents/extension.d.ts.map +1 -0
  775. package/dist/extensions/cursor-grokbot-agents/extension.js +70 -0
  776. package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts +11 -0
  777. package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts.map +1 -0
  778. package/dist/extensions/cursor-grokbot-agents/lib/agents.js +31 -0
  779. package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts +56 -0
  780. package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts.map +1 -0
  781. package/dist/extensions/cursor-grokbot-agents/lib/backend.js +138 -0
  782. package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts +28 -0
  783. package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts.map +1 -0
  784. package/dist/extensions/cursor-grokbot-agents/lib/contacts.js +46 -0
  785. package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts +53 -0
  786. package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts.map +1 -0
  787. package/dist/extensions/cursor-grokbot-agents/lib/conversation.js +186 -0
  788. package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts +4 -0
  789. package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts.map +1 -0
  790. package/dist/extensions/cursor-grokbot-agents/lib/inputs.js +15 -0
  791. package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts +12 -0
  792. package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts.map +1 -0
  793. package/dist/extensions/cursor-grokbot-agents/lib/lock.js +24 -0
  794. package/dist/extensions/cursor-grokbot-agents/skills/consult.md +40 -0
  795. package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts +4 -0
  796. package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts.map +1 -0
  797. package/dist/extensions/cursor-grokbot-agents/tools/ask.js +26 -0
  798. package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts +4 -0
  799. package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts.map +1 -0
  800. package/dist/extensions/cursor-grokbot-agents/tools/check.js +21 -0
  801. package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts +4 -0
  802. package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts.map +1 -0
  803. package/dist/extensions/cursor-grokbot-agents/tools/interrupt.js +13 -0
  804. package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts +4 -0
  805. package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts.map +1 -0
  806. package/dist/extensions/cursor-grokbot-agents/tools/list.js +22 -0
  807. package/dist/extensions/improve/extension.d.ts +48 -0
  808. package/dist/extensions/improve/extension.d.ts.map +1 -0
  809. package/dist/extensions/improve/extension.js +43 -0
  810. package/dist/extensions/improve/skills/yourself.d.ts +4 -0
  811. package/dist/extensions/improve/skills/yourself.d.ts.map +1 -0
  812. package/dist/extensions/improve/skills/yourself.js +43 -0
  813. package/dist/extensions/jev/extension.d.ts +46 -0
  814. package/dist/extensions/jev/extension.d.ts.map +1 -0
  815. package/dist/extensions/jev/extension.js +56 -0
  816. package/dist/extensions/jev/lib/evaluate.d.ts +105 -0
  817. package/dist/extensions/jev/lib/evaluate.d.ts.map +1 -0
  818. package/dist/extensions/jev/lib/evaluate.js +154 -0
  819. package/dist/extensions/jev/skills/gated-write.md +25 -0
  820. package/dist/extensions/jev/skills/questions.md +33 -0
  821. package/dist/extensions/jev/tools/evaluate.d.ts +4 -0
  822. package/dist/extensions/jev/tools/evaluate.d.ts.map +1 -0
  823. package/dist/extensions/jev/tools/evaluate.js +72 -0
  824. package/dist/extensions/slack-communication/extension.d.ts +28 -0
  825. package/dist/extensions/slack-communication/extension.d.ts.map +1 -0
  826. package/dist/extensions/slack-communication/extension.js +32 -0
  827. package/dist/extensions/slack-communication/skills/slack-voice.d.ts +5 -0
  828. package/dist/extensions/slack-communication/skills/slack-voice.d.ts.map +1 -0
  829. package/dist/extensions/slack-communication/skills/slack-voice.js +52 -0
  830. package/dist/extensions/slack-communication/tools/delete-message.d.ts +4 -0
  831. package/dist/extensions/slack-communication/tools/delete-message.d.ts.map +1 -0
  832. package/dist/extensions/slack-communication/tools/delete-message.js +29 -0
  833. package/dist/extensions/slack-communication/tools/edit-message.d.ts +4 -0
  834. package/dist/extensions/slack-communication/tools/edit-message.d.ts.map +1 -0
  835. package/dist/extensions/slack-communication/tools/edit-message.js +34 -0
  836. package/dist/extensions/slack-communication/tools/post-card.d.ts +4 -0
  837. package/dist/extensions/slack-communication/tools/post-card.d.ts.map +1 -0
  838. package/dist/extensions/slack-communication/tools/post-card.js +25 -0
  839. package/dist/extensions/slack-communication/tools/post-file.d.ts +4 -0
  840. package/dist/extensions/slack-communication/tools/post-file.d.ts.map +1 -0
  841. package/dist/extensions/slack-communication/tools/post-file.js +75 -0
  842. package/dist/extensions/slack-communication/tools/post-update.d.ts +4 -0
  843. package/dist/extensions/slack-communication/tools/post-update.d.ts.map +1 -0
  844. package/dist/extensions/slack-communication/tools/post-update.js +33 -0
  845. package/dist/extensions/slack-communication/tools/react.d.ts +4 -0
  846. package/dist/extensions/slack-communication/tools/react.d.ts.map +1 -0
  847. package/dist/extensions/slack-communication/tools/react.js +27 -0
  848. package/dist/extensions/slack-communication/tools/set-status.d.ts +4 -0
  849. package/dist/extensions/slack-communication/tools/set-status.d.ts.map +1 -0
  850. package/dist/extensions/slack-communication/tools/set-status.js +18 -0
  851. package/dist/extensions.d.ts +87 -0
  852. package/dist/extensions.d.ts.map +1 -0
  853. package/dist/extensions.js +141 -0
  854. package/dist/files-backends/agent-store-presigned-url.d.ts +3 -0
  855. package/dist/files-backends/agent-store-presigned-url.d.ts.map +1 -0
  856. package/dist/files-backends/agent-store-presigned-url.js +223 -0
  857. package/dist/files-backends/cursor-hosted.d.ts +65 -0
  858. package/dist/files-backends/cursor-hosted.d.ts.map +1 -0
  859. package/dist/files-backends/cursor-hosted.js +848 -0
  860. package/dist/files-backends/local-fs.d.ts +33 -0
  861. package/dist/files-backends/local-fs.d.ts.map +1 -0
  862. package/dist/files-backends/local-fs.js +133 -0
  863. package/dist/files.d.ts +203 -0
  864. package/dist/files.d.ts.map +1 -0
  865. package/dist/files.js +129 -0
  866. package/dist/filesystem.d.ts +515 -0
  867. package/dist/filesystem.d.ts.map +1 -0
  868. package/dist/filesystem.js +1596 -0
  869. package/dist/hooks.d.ts +25 -0
  870. package/dist/hooks.d.ts.map +1 -0
  871. package/dist/hooks.js +25 -0
  872. package/dist/index.d.ts +87 -0
  873. package/dist/index.d.ts.map +1 -0
  874. package/dist/index.js +94 -0
  875. package/dist/internal/advertise-tools.d.ts +96 -0
  876. package/dist/internal/advertise-tools.d.ts.map +1 -0
  877. package/dist/internal/advertise-tools.js +255 -0
  878. package/dist/internal/approval-gate.d.ts +35 -0
  879. package/dist/internal/approval-gate.d.ts.map +1 -0
  880. package/dist/internal/approval-gate.js +81 -0
  881. package/dist/internal/artifacts-store.d.ts +123 -0
  882. package/dist/internal/artifacts-store.d.ts.map +1 -0
  883. package/dist/internal/artifacts-store.js +657 -0
  884. package/dist/internal/as-of.d.ts +39 -0
  885. package/dist/internal/as-of.d.ts.map +1 -0
  886. package/dist/internal/as-of.js +207 -0
  887. package/dist/internal/auth.d.ts +12 -0
  888. package/dist/internal/auth.d.ts.map +1 -0
  889. package/dist/internal/auth.js +34 -0
  890. package/dist/internal/authored-alias-hooks.d.ts +43 -0
  891. package/dist/internal/authored-alias-hooks.d.ts.map +1 -0
  892. package/dist/internal/authored-alias-hooks.js +104 -0
  893. package/dist/internal/authored-loaders.d.ts +50 -0
  894. package/dist/internal/authored-loaders.d.ts.map +1 -0
  895. package/dist/internal/authored-loaders.js +183 -0
  896. package/dist/internal/bounded-int.d.ts +11 -0
  897. package/dist/internal/bounded-int.d.ts.map +1 -0
  898. package/dist/internal/bounded-int.js +12 -0
  899. package/dist/internal/bounded.d.ts +7 -0
  900. package/dist/internal/bounded.d.ts.map +1 -0
  901. package/dist/internal/bounded.js +21 -0
  902. package/dist/internal/brand.d.ts +6 -0
  903. package/dist/internal/brand.d.ts.map +1 -0
  904. package/dist/internal/brand.js +17 -0
  905. package/dist/internal/browser-origin-guard.d.ts +19 -0
  906. package/dist/internal/browser-origin-guard.d.ts.map +1 -0
  907. package/dist/internal/browser-origin-guard.js +51 -0
  908. package/dist/internal/builtin-tools/artifacts.d.ts +10 -0
  909. package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -0
  910. package/dist/internal/builtin-tools/artifacts.js +87 -0
  911. package/dist/internal/builtin-tools/index.d.ts +17 -0
  912. package/dist/internal/builtin-tools/index.d.ts.map +1 -0
  913. package/dist/internal/builtin-tools/index.js +39 -0
  914. package/dist/internal/builtin-tools/reminders.d.ts +9 -0
  915. package/dist/internal/builtin-tools/reminders.d.ts.map +1 -0
  916. package/dist/internal/builtin-tools/reminders.js +115 -0
  917. package/dist/internal/channel-architecture.d.ts +21 -0
  918. package/dist/internal/channel-architecture.d.ts.map +1 -0
  919. package/dist/internal/channel-architecture.js +43 -0
  920. package/dist/internal/channel-dispatch.d.ts +43 -0
  921. package/dist/internal/channel-dispatch.d.ts.map +1 -0
  922. package/dist/internal/channel-dispatch.js +74 -0
  923. package/dist/internal/channel-route-dispatch.d.ts +13 -0
  924. package/dist/internal/channel-route-dispatch.d.ts.map +1 -0
  925. package/dist/internal/channel-route-dispatch.js +51 -0
  926. package/dist/internal/channel-state.d.ts +17 -0
  927. package/dist/internal/channel-state.d.ts.map +1 -0
  928. package/dist/internal/channel-state.js +69 -0
  929. package/dist/internal/chat-client.d.ts +45 -0
  930. package/dist/internal/chat-client.d.ts.map +1 -0
  931. package/dist/internal/chat-client.js +457 -0
  932. package/dist/internal/cli-ax.d.ts +227 -0
  933. package/dist/internal/cli-ax.d.ts.map +1 -0
  934. package/dist/internal/cli-ax.js +1825 -0
  935. package/dist/internal/cli-bitbucket.d.ts +33 -0
  936. package/dist/internal/cli-bitbucket.d.ts.map +1 -0
  937. package/dist/internal/cli-bitbucket.js +332 -0
  938. package/dist/internal/cli-convert-automation.d.ts +39 -0
  939. package/dist/internal/cli-convert-automation.d.ts.map +1 -0
  940. package/dist/internal/cli-convert-automation.js +257 -0
  941. package/dist/internal/cli-cursor.d.ts +38 -0
  942. package/dist/internal/cli-cursor.d.ts.map +1 -0
  943. package/dist/internal/cli-cursor.js +205 -0
  944. package/dist/internal/cli-deploy.d.ts +171 -0
  945. package/dist/internal/cli-deploy.d.ts.map +1 -0
  946. package/dist/internal/cli-deploy.js +2072 -0
  947. package/dist/internal/cli-docs.d.ts +34 -0
  948. package/dist/internal/cli-docs.d.ts.map +1 -0
  949. package/dist/internal/cli-docs.js +156 -0
  950. package/dist/internal/cli-github.d.ts +47 -0
  951. package/dist/internal/cli-github.d.ts.map +1 -0
  952. package/dist/internal/cli-github.js +600 -0
  953. package/dist/internal/cli-gitlab.d.ts +37 -0
  954. package/dist/internal/cli-gitlab.d.ts.map +1 -0
  955. package/dist/internal/cli-gitlab.js +350 -0
  956. package/dist/internal/cli-images.d.ts +68 -0
  957. package/dist/internal/cli-images.d.ts.map +1 -0
  958. package/dist/internal/cli-images.js +536 -0
  959. package/dist/internal/cli-init-grokbot.d.ts +29 -0
  960. package/dist/internal/cli-init-grokbot.d.ts.map +1 -0
  961. package/dist/internal/cli-init-grokbot.js +181 -0
  962. package/dist/internal/cli-manifest.d.ts +19 -0
  963. package/dist/internal/cli-manifest.d.ts.map +1 -0
  964. package/dist/internal/cli-manifest.js +37 -0
  965. package/dist/internal/cli-mcp-oauth.d.ts +51 -0
  966. package/dist/internal/cli-mcp-oauth.d.ts.map +1 -0
  967. package/dist/internal/cli-mcp-oauth.js +300 -0
  968. package/dist/internal/cli-mcp.d.ts +75 -0
  969. package/dist/internal/cli-mcp.d.ts.map +1 -0
  970. package/dist/internal/cli-mcp.js +659 -0
  971. package/dist/internal/cli-migrate.d.ts +18 -0
  972. package/dist/internal/cli-migrate.d.ts.map +1 -0
  973. package/dist/internal/cli-migrate.js +351 -0
  974. package/dist/internal/cli-pagerduty.d.ts +32 -0
  975. package/dist/internal/cli-pagerduty.d.ts.map +1 -0
  976. package/dist/internal/cli-pagerduty.js +242 -0
  977. package/dist/internal/cli-skills.d.ts +21 -0
  978. package/dist/internal/cli-skills.d.ts.map +1 -0
  979. package/dist/internal/cli-skills.js +65 -0
  980. package/dist/internal/cli-slack-manual.d.ts +41 -0
  981. package/dist/internal/cli-slack-manual.d.ts.map +1 -0
  982. package/dist/internal/cli-slack-manual.js +296 -0
  983. package/dist/internal/cli-slack.d.ts +59 -0
  984. package/dist/internal/cli-slack.d.ts.map +1 -0
  985. package/dist/internal/cli-slack.js +708 -0
  986. package/dist/internal/cloud-merge.d.ts +25 -0
  987. package/dist/internal/cloud-merge.d.ts.map +1 -0
  988. package/dist/internal/cloud-merge.js +40 -0
  989. package/dist/internal/cloud-turn-usage.d.ts +34 -0
  990. package/dist/internal/cloud-turn-usage.d.ts.map +1 -0
  991. package/dist/internal/cloud-turn-usage.js +94 -0
  992. package/dist/internal/comment-safe.d.ts +8 -0
  993. package/dist/internal/comment-safe.d.ts.map +1 -0
  994. package/dist/internal/comment-safe.js +12 -0
  995. package/dist/internal/connection-env.d.ts +31 -0
  996. package/dist/internal/connection-env.d.ts.map +1 -0
  997. package/dist/internal/connection-env.js +83 -0
  998. package/dist/internal/continuation-channel.d.ts +48 -0
  999. package/dist/internal/continuation-channel.d.ts.map +1 -0
  1000. package/dist/internal/continuation-channel.js +170 -0
  1001. package/dist/internal/continuation-identity.d.ts +126 -0
  1002. package/dist/internal/continuation-identity.d.ts.map +1 -0
  1003. package/dist/internal/continuation-identity.js +897 -0
  1004. package/dist/internal/continuation.d.ts +3 -0
  1005. package/dist/internal/continuation.d.ts.map +1 -0
  1006. package/dist/internal/continuation.js +1 -0
  1007. package/dist/internal/conversation-mirror.d.ts +72 -0
  1008. package/dist/internal/conversation-mirror.d.ts.map +1 -0
  1009. package/dist/internal/conversation-mirror.js +401 -0
  1010. package/dist/internal/conversation-pack.d.ts +29 -0
  1011. package/dist/internal/conversation-pack.d.ts.map +1 -0
  1012. package/dist/internal/conversation-pack.js +96 -0
  1013. package/dist/internal/convert-automation/convert-workflow.d.ts +10 -0
  1014. package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -0
  1015. package/dist/internal/convert-automation/convert-workflow.js +976 -0
  1016. package/dist/internal/convert-automation/types.d.ts +202 -0
  1017. package/dist/internal/convert-automation/types.d.ts.map +1 -0
  1018. package/dist/internal/convert-automation/types.js +13 -0
  1019. package/dist/internal/convert-grokbot/answers.d.ts +127 -0
  1020. package/dist/internal/convert-grokbot/answers.d.ts.map +1 -0
  1021. package/dist/internal/convert-grokbot/answers.js +445 -0
  1022. package/dist/internal/convert-grokbot/bot.d.ts +50 -0
  1023. package/dist/internal/convert-grokbot/bot.d.ts.map +1 -0
  1024. package/dist/internal/convert-grokbot/bot.js +72 -0
  1025. package/dist/internal/convert-grokbot/checks.d.ts +26 -0
  1026. package/dist/internal/convert-grokbot/checks.d.ts.map +1 -0
  1027. package/dist/internal/convert-grokbot/checks.js +170 -0
  1028. package/dist/internal/convert-grokbot/convert.d.ts +60 -0
  1029. package/dist/internal/convert-grokbot/convert.d.ts.map +1 -0
  1030. package/dist/internal/convert-grokbot/convert.js +470 -0
  1031. package/dist/internal/convert-grokbot/handoff.d.ts +44 -0
  1032. package/dist/internal/convert-grokbot/handoff.d.ts.map +1 -0
  1033. package/dist/internal/convert-grokbot/handoff.js +160 -0
  1034. package/dist/internal/convert-grokbot/recipe.d.ts +61 -0
  1035. package/dist/internal/convert-grokbot/recipe.d.ts.map +1 -0
  1036. package/dist/internal/convert-grokbot/recipe.js +94 -0
  1037. package/dist/internal/convert-grokbot/routine.d.ts +51 -0
  1038. package/dist/internal/convert-grokbot/routine.d.ts.map +1 -0
  1039. package/dist/internal/convert-grokbot/routine.js +128 -0
  1040. package/dist/internal/convert-grokbot/slack.d.ts +28 -0
  1041. package/dist/internal/convert-grokbot/slack.d.ts.map +1 -0
  1042. package/dist/internal/convert-grokbot/slack.js +50 -0
  1043. package/dist/internal/cron.d.ts +17 -0
  1044. package/dist/internal/cron.d.ts.map +1 -0
  1045. package/dist/internal/cron.js +60 -0
  1046. package/dist/internal/cursor/account-mcp.d.ts +135 -0
  1047. package/dist/internal/cursor/account-mcp.d.ts.map +1 -0
  1048. package/dist/internal/cursor/account-mcp.js +513 -0
  1049. package/dist/internal/cursor/backend-client.d.ts +229 -0
  1050. package/dist/internal/cursor/backend-client.d.ts.map +1 -0
  1051. package/dist/internal/cursor/backend-client.js +700 -0
  1052. package/dist/internal/cursor/bound-secret-file.d.ts +56 -0
  1053. package/dist/internal/cursor/bound-secret-file.d.ts.map +1 -0
  1054. package/dist/internal/cursor/bound-secret-file.js +88 -0
  1055. package/dist/internal/cursor/credentials.d.ts +196 -0
  1056. package/dist/internal/cursor/credentials.d.ts.map +1 -0
  1057. package/dist/internal/cursor/credentials.js +463 -0
  1058. package/dist/internal/cursor/cursor-api-transport.d.ts +37 -0
  1059. package/dist/internal/cursor/cursor-api-transport.d.ts.map +1 -0
  1060. package/dist/internal/cursor/cursor-api-transport.js +40 -0
  1061. package/dist/internal/cursor/github-credentials.d.ts +44 -0
  1062. package/dist/internal/cursor/github-credentials.d.ts.map +1 -0
  1063. package/dist/internal/cursor/github-credentials.js +174 -0
  1064. package/dist/internal/cursor/hosted-bound-secrets.d.ts +45 -0
  1065. package/dist/internal/cursor/hosted-bound-secrets.d.ts.map +1 -0
  1066. package/dist/internal/cursor/hosted-bound-secrets.js +64 -0
  1067. package/dist/internal/cursor/hosted-deployment-secrets.d.ts +30 -0
  1068. package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -0
  1069. package/dist/internal/cursor/hosted-deployment-secrets.js +97 -0
  1070. package/dist/internal/cursor/hosted-store-secrets.d.ts +39 -0
  1071. package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -0
  1072. package/dist/internal/cursor/hosted-store-secrets.js +84 -0
  1073. package/dist/internal/cursor/session-token.d.ts +45 -0
  1074. package/dist/internal/cursor/session-token.d.ts.map +1 -0
  1075. package/dist/internal/cursor/session-token.js +85 -0
  1076. package/dist/internal/cursor/store-api-client.d.ts +60 -0
  1077. package/dist/internal/cursor/store-api-client.d.ts.map +1 -0
  1078. package/dist/internal/cursor/store-api-client.js +189 -0
  1079. package/dist/internal/cursor-account-mcp-auth.d.ts +70 -0
  1080. package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -0
  1081. package/dist/internal/cursor-account-mcp-auth.js +233 -0
  1082. package/dist/internal/cursor-agent-template.d.ts +9 -0
  1083. package/dist/internal/cursor-agent-template.d.ts.map +1 -0
  1084. package/dist/internal/cursor-agent-template.js +43 -0
  1085. package/dist/internal/cursor-deployment-relay.d.ts +95 -0
  1086. package/dist/internal/cursor-deployment-relay.d.ts.map +1 -0
  1087. package/dist/internal/cursor-deployment-relay.js +212 -0
  1088. package/dist/internal/cursor-event-relay.d.ts +243 -0
  1089. package/dist/internal/cursor-event-relay.d.ts.map +1 -0
  1090. package/dist/internal/cursor-event-relay.js +430 -0
  1091. package/dist/internal/cursor-relay-core.d.ts +160 -0
  1092. package/dist/internal/cursor-relay-core.d.ts.map +1 -0
  1093. package/dist/internal/cursor-relay-core.js +442 -0
  1094. package/dist/internal/deferred-channel-session.d.ts +21 -0
  1095. package/dist/internal/deferred-channel-session.d.ts.map +1 -0
  1096. package/dist/internal/deferred-channel-session.js +55 -0
  1097. package/dist/internal/deploy-client.d.ts +604 -0
  1098. package/dist/internal/deploy-client.d.ts.map +1 -0
  1099. package/dist/internal/deploy-client.js +1009 -0
  1100. package/dist/internal/deploy-manifest.d.ts +179 -0
  1101. package/dist/internal/deploy-manifest.d.ts.map +1 -0
  1102. package/dist/internal/deploy-manifest.js +320 -0
  1103. package/dist/internal/deploy-source.d.ts +38 -0
  1104. package/dist/internal/deploy-source.d.ts.map +1 -0
  1105. package/dist/internal/deploy-source.js +124 -0
  1106. package/dist/internal/describe-error.d.ts +6 -0
  1107. package/dist/internal/describe-error.d.ts.map +1 -0
  1108. package/dist/internal/describe-error.js +31 -0
  1109. package/dist/internal/dev-mode.d.ts +13 -0
  1110. package/dist/internal/dev-mode.d.ts.map +1 -0
  1111. package/dist/internal/dev-mode.js +17 -0
  1112. package/dist/internal/discovery/agent-config.d.ts +55 -0
  1113. package/dist/internal/discovery/agent-config.d.ts.map +1 -0
  1114. package/dist/internal/discovery/agent-config.js +230 -0
  1115. package/dist/internal/discovery/agent.d.ts +16 -0
  1116. package/dist/internal/discovery/agent.d.ts.map +1 -0
  1117. package/dist/internal/discovery/agent.js +347 -0
  1118. package/dist/internal/discovery/channels.d.ts +10 -0
  1119. package/dist/internal/discovery/channels.d.ts.map +1 -0
  1120. package/dist/internal/discovery/channels.js +88 -0
  1121. package/dist/internal/discovery/connections.d.ts +13 -0
  1122. package/dist/internal/discovery/connections.d.ts.map +1 -0
  1123. package/dist/internal/discovery/connections.js +430 -0
  1124. package/dist/internal/discovery/context.d.ts +36 -0
  1125. package/dist/internal/discovery/context.d.ts.map +1 -0
  1126. package/dist/internal/discovery/context.js +84 -0
  1127. package/dist/internal/discovery/cursor-plugin.d.ts +25 -0
  1128. package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -0
  1129. package/dist/internal/discovery/cursor-plugin.js +513 -0
  1130. package/dist/internal/discovery/extension-overlay.d.ts +31 -0
  1131. package/dist/internal/discovery/extension-overlay.d.ts.map +1 -0
  1132. package/dist/internal/discovery/extension-overlay.js +142 -0
  1133. package/dist/internal/discovery/extensions.d.ts +28 -0
  1134. package/dist/internal/discovery/extensions.d.ts.map +1 -0
  1135. package/dist/internal/discovery/extensions.js +376 -0
  1136. package/dist/internal/discovery/fs.d.ts +15 -0
  1137. package/dist/internal/discovery/fs.d.ts.map +1 -0
  1138. package/dist/internal/discovery/fs.js +92 -0
  1139. package/dist/internal/discovery/hooks.d.ts +7 -0
  1140. package/dist/internal/discovery/hooks.d.ts.map +1 -0
  1141. package/dist/internal/discovery/hooks.js +50 -0
  1142. package/dist/internal/discovery/info.d.ts +6 -0
  1143. package/dist/internal/discovery/info.d.ts.map +1 -0
  1144. package/dist/internal/discovery/info.js +166 -0
  1145. package/dist/internal/discovery/instructions.d.ts +7 -0
  1146. package/dist/internal/discovery/instructions.d.ts.map +1 -0
  1147. package/dist/internal/discovery/instructions.js +79 -0
  1148. package/dist/internal/discovery/instrumentation.d.ts +10 -0
  1149. package/dist/internal/discovery/instrumentation.d.ts.map +1 -0
  1150. package/dist/internal/discovery/instrumentation.js +29 -0
  1151. package/dist/internal/discovery/modules.d.ts +20 -0
  1152. package/dist/internal/discovery/modules.d.ts.map +1 -0
  1153. package/dist/internal/discovery/modules.js +88 -0
  1154. package/dist/internal/discovery/names.d.ts +14 -0
  1155. package/dist/internal/discovery/names.d.ts.map +1 -0
  1156. package/dist/internal/discovery/names.js +39 -0
  1157. package/dist/internal/discovery/project-public.d.ts +16 -0
  1158. package/dist/internal/discovery/project-public.d.ts.map +1 -0
  1159. package/dist/internal/discovery/project-public.js +54 -0
  1160. package/dist/internal/discovery/project.d.ts +57 -0
  1161. package/dist/internal/discovery/project.d.ts.map +1 -0
  1162. package/dist/internal/discovery/project.js +298 -0
  1163. package/dist/internal/discovery/reminders.d.ts +7 -0
  1164. package/dist/internal/discovery/reminders.d.ts.map +1 -0
  1165. package/dist/internal/discovery/reminders.js +54 -0
  1166. package/dist/internal/discovery/runtime.d.ts +34 -0
  1167. package/dist/internal/discovery/runtime.d.ts.map +1 -0
  1168. package/dist/internal/discovery/runtime.js +97 -0
  1169. package/dist/internal/discovery/schedules.d.ts +7 -0
  1170. package/dist/internal/discovery/schedules.d.ts.map +1 -0
  1171. package/dist/internal/discovery/schedules.js +107 -0
  1172. package/dist/internal/discovery/seed-files.d.ts +7 -0
  1173. package/dist/internal/discovery/seed-files.d.ts.map +1 -0
  1174. package/dist/internal/discovery/seed-files.js +30 -0
  1175. package/dist/internal/discovery/services.d.ts +27 -0
  1176. package/dist/internal/discovery/services.d.ts.map +1 -0
  1177. package/dist/internal/discovery/services.js +122 -0
  1178. package/dist/internal/discovery/skills.d.ts +11 -0
  1179. package/dist/internal/discovery/skills.d.ts.map +1 -0
  1180. package/dist/internal/discovery/skills.js +139 -0
  1181. package/dist/internal/discovery/subagent.d.ts +16 -0
  1182. package/dist/internal/discovery/subagent.d.ts.map +1 -0
  1183. package/dist/internal/discovery/subagent.js +113 -0
  1184. package/dist/internal/discovery/tools.d.ts +18 -0
  1185. package/dist/internal/discovery/tools.d.ts.map +1 -0
  1186. package/dist/internal/discovery/tools.js +144 -0
  1187. package/dist/internal/discovery.d.ts +15 -0
  1188. package/dist/internal/discovery.d.ts.map +1 -0
  1189. package/dist/internal/discovery.js +13 -0
  1190. package/dist/internal/distribution.d.ts +65 -0
  1191. package/dist/internal/distribution.d.ts.map +1 -0
  1192. package/dist/internal/distribution.js +102 -0
  1193. package/dist/internal/docs-site.d.ts +38 -0
  1194. package/dist/internal/docs-site.d.ts.map +1 -0
  1195. package/dist/internal/docs-site.js +216 -0
  1196. package/dist/internal/duration.d.ts +8 -0
  1197. package/dist/internal/duration.d.ts.map +1 -0
  1198. package/dist/internal/duration.js +35 -0
  1199. package/dist/internal/env-file.d.ts +19 -0
  1200. package/dist/internal/env-file.d.ts.map +1 -0
  1201. package/dist/internal/env-file.js +74 -0
  1202. package/dist/internal/estimate-cost.d.ts +55 -0
  1203. package/dist/internal/estimate-cost.d.ts.map +1 -0
  1204. package/dist/internal/estimate-cost.js +118 -0
  1205. package/dist/internal/eval-judge-model.d.ts +64 -0
  1206. package/dist/internal/eval-judge-model.d.ts.map +1 -0
  1207. package/dist/internal/eval-judge-model.js +129 -0
  1208. package/dist/internal/eval-run-store.d.ts +119 -0
  1209. package/dist/internal/eval-run-store.d.ts.map +1 -0
  1210. package/dist/internal/eval-run-store.js +479 -0
  1211. package/dist/internal/eval-runner.d.ts +106 -0
  1212. package/dist/internal/eval-runner.d.ts.map +1 -0
  1213. package/dist/internal/eval-runner.js +616 -0
  1214. package/dist/internal/eval-transport.d.ts +24 -0
  1215. package/dist/internal/eval-transport.d.ts.map +1 -0
  1216. package/dist/internal/eval-transport.js +22 -0
  1217. package/dist/internal/evals-client.d.ts +104 -0
  1218. package/dist/internal/evals-client.d.ts.map +1 -0
  1219. package/dist/internal/evals-client.js +299 -0
  1220. package/dist/internal/event-log.d.ts +94 -0
  1221. package/dist/internal/event-log.d.ts.map +1 -0
  1222. package/dist/internal/event-log.js +302 -0
  1223. package/dist/internal/event-mapper.d.ts +165 -0
  1224. package/dist/internal/event-mapper.d.ts.map +1 -0
  1225. package/dist/internal/event-mapper.js +665 -0
  1226. package/dist/internal/expected-delivery-failure.d.ts +3 -0
  1227. package/dist/internal/expected-delivery-failure.d.ts.map +1 -0
  1228. package/dist/internal/expected-delivery-failure.js +34 -0
  1229. package/dist/internal/factory-resource-channel.d.ts +33 -0
  1230. package/dist/internal/factory-resource-channel.d.ts.map +1 -0
  1231. package/dist/internal/factory-resource-channel.js +63 -0
  1232. package/dist/internal/filesystem/errors.d.ts +64 -0
  1233. package/dist/internal/filesystem/errors.d.ts.map +1 -0
  1234. package/dist/internal/filesystem/errors.js +172 -0
  1235. package/dist/internal/filesystem/format.d.ts +28 -0
  1236. package/dist/internal/filesystem/format.d.ts.map +1 -0
  1237. package/dist/internal/filesystem/format.js +209 -0
  1238. package/dist/internal/filesystem/merge.d.ts +34 -0
  1239. package/dist/internal/filesystem/merge.d.ts.map +1 -0
  1240. package/dist/internal/filesystem/merge.js +154 -0
  1241. package/dist/internal/filesystem/nearest.d.ts +15 -0
  1242. package/dist/internal/filesystem/nearest.d.ts.map +1 -0
  1243. package/dist/internal/filesystem/nearest.js +90 -0
  1244. package/dist/internal/filesystem/scratch.d.ts +60 -0
  1245. package/dist/internal/filesystem/scratch.d.ts.map +1 -0
  1246. package/dist/internal/filesystem/scratch.js +190 -0
  1247. package/dist/internal/filesystem/sdk-schemas.d.ts +29 -0
  1248. package/dist/internal/filesystem/sdk-schemas.d.ts.map +1 -0
  1249. package/dist/internal/filesystem/sdk-schemas.js +154 -0
  1250. package/dist/internal/filesystem/subagent-inherit.d.ts +39 -0
  1251. package/dist/internal/filesystem/subagent-inherit.d.ts.map +1 -0
  1252. package/dist/internal/filesystem/subagent-inherit.js +96 -0
  1253. package/dist/internal/filesystem/tools.d.ts +48 -0
  1254. package/dist/internal/filesystem/tools.d.ts.map +1 -0
  1255. package/dist/internal/filesystem/tools.js +648 -0
  1256. package/dist/internal/filesystem/walk.d.ts +77 -0
  1257. package/dist/internal/filesystem/walk.d.ts.map +1 -0
  1258. package/dist/internal/filesystem/walk.js +283 -0
  1259. package/dist/internal/framework-file-storage.d.ts +51 -0
  1260. package/dist/internal/framework-file-storage.d.ts.map +1 -0
  1261. package/dist/internal/framework-file-storage.js +291 -0
  1262. package/dist/internal/framework-storage-selection.d.ts +30 -0
  1263. package/dist/internal/framework-storage-selection.d.ts.map +1 -0
  1264. package/dist/internal/framework-storage-selection.js +84 -0
  1265. package/dist/internal/frontmatter.d.ts +20 -0
  1266. package/dist/internal/frontmatter.d.ts.map +1 -0
  1267. package/dist/internal/frontmatter.js +85 -0
  1268. package/dist/internal/github-fanout.d.ts +32 -0
  1269. package/dist/internal/github-fanout.d.ts.map +1 -0
  1270. package/dist/internal/github-fanout.js +106 -0
  1271. package/dist/internal/guest-network.d.ts +98 -0
  1272. package/dist/internal/guest-network.d.ts.map +1 -0
  1273. package/dist/internal/guest-network.js +313 -0
  1274. package/dist/internal/handleAgentServeTrigger.d.ts +98 -0
  1275. package/dist/internal/handleAgentServeTrigger.d.ts.map +1 -0
  1276. package/dist/internal/handleAgentServeTrigger.js +194 -0
  1277. package/dist/internal/hmac-secret-values.d.ts +48 -0
  1278. package/dist/internal/hmac-secret-values.d.ts.map +1 -0
  1279. package/dist/internal/hmac-secret-values.js +68 -0
  1280. package/dist/internal/host-files.d.ts +29 -0
  1281. package/dist/internal/host-files.d.ts.map +1 -0
  1282. package/dist/internal/host-files.js +256 -0
  1283. package/dist/internal/host-kv.d.ts +21 -0
  1284. package/dist/internal/host-kv.d.ts.map +1 -0
  1285. package/dist/internal/host-kv.js +62 -0
  1286. package/dist/internal/host-otel.d.ts +26 -0
  1287. package/dist/internal/host-otel.d.ts.map +1 -0
  1288. package/dist/internal/host-otel.js +184 -0
  1289. package/dist/internal/host-platforms.d.ts +58 -0
  1290. package/dist/internal/host-platforms.d.ts.map +1 -0
  1291. package/dist/internal/host-platforms.js +118 -0
  1292. package/dist/internal/hosted-admission-adapter.d.ts +36 -0
  1293. package/dist/internal/hosted-admission-adapter.d.ts.map +1 -0
  1294. package/dist/internal/hosted-admission-adapter.js +7 -0
  1295. package/dist/internal/hosted-admission-context.d.ts +20 -0
  1296. package/dist/internal/hosted-admission-context.d.ts.map +1 -0
  1297. package/dist/internal/hosted-admission-context.js +31 -0
  1298. package/dist/internal/hosted-catch-protocol.d.ts +54 -0
  1299. package/dist/internal/hosted-catch-protocol.d.ts.map +1 -0
  1300. package/dist/internal/hosted-catch-protocol.js +90 -0
  1301. package/dist/internal/hosted-catch.d.ts +42 -0
  1302. package/dist/internal/hosted-catch.d.ts.map +1 -0
  1303. package/dist/internal/hosted-catch.js +154 -0
  1304. package/dist/internal/hosted-delivery-protocol.d.ts +275 -0
  1305. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -0
  1306. package/dist/internal/hosted-delivery-protocol.js +708 -0
  1307. package/dist/internal/hosted-delivery.d.ts +135 -0
  1308. package/dist/internal/hosted-delivery.d.ts.map +1 -0
  1309. package/dist/internal/hosted-delivery.js +1098 -0
  1310. package/dist/internal/hosted-eval-cases.d.ts +21 -0
  1311. package/dist/internal/hosted-eval-cases.d.ts.map +1 -0
  1312. package/dist/internal/hosted-eval-cases.js +162 -0
  1313. package/dist/internal/hosted-execution-diag.d.ts +64 -0
  1314. package/dist/internal/hosted-execution-diag.d.ts.map +1 -0
  1315. package/dist/internal/hosted-execution-diag.js +219 -0
  1316. package/dist/internal/hosted-execution-flush.d.ts +65 -0
  1317. package/dist/internal/hosted-execution-flush.d.ts.map +1 -0
  1318. package/dist/internal/hosted-execution-flush.js +113 -0
  1319. package/dist/internal/hosted-execution-latency.d.ts +80 -0
  1320. package/dist/internal/hosted-execution-latency.d.ts.map +1 -0
  1321. package/dist/internal/hosted-execution-latency.js +226 -0
  1322. package/dist/internal/hosted-managed-automation.d.ts +30 -0
  1323. package/dist/internal/hosted-managed-automation.d.ts.map +1 -0
  1324. package/dist/internal/hosted-managed-automation.js +83 -0
  1325. package/dist/internal/hosting.d.ts +62 -0
  1326. package/dist/internal/hosting.d.ts.map +1 -0
  1327. package/dist/internal/hosting.js +130 -0
  1328. package/dist/internal/http-channel-define.d.ts +11 -0
  1329. package/dist/internal/http-channel-define.d.ts.map +1 -0
  1330. package/dist/internal/http-channel-define.js +21 -0
  1331. package/dist/internal/http-channel.d.ts +54 -0
  1332. package/dist/internal/http-channel.d.ts.map +1 -0
  1333. package/dist/internal/http-channel.js +543 -0
  1334. package/dist/internal/http-control-plane-session.d.ts +54 -0
  1335. package/dist/internal/http-control-plane-session.d.ts.map +1 -0
  1336. package/dist/internal/http-control-plane-session.js +163 -0
  1337. package/dist/internal/ids.d.ts +27 -0
  1338. package/dist/internal/ids.d.ts.map +1 -0
  1339. package/dist/internal/ids.js +54 -0
  1340. package/dist/internal/incoming-headers-to-fetch.d.ts +10 -0
  1341. package/dist/internal/incoming-headers-to-fetch.d.ts.map +1 -0
  1342. package/dist/internal/incoming-headers-to-fetch.js +40 -0
  1343. package/dist/internal/init-interview.d.ts +64 -0
  1344. package/dist/internal/init-interview.d.ts.map +1 -0
  1345. package/dist/internal/init-interview.js +193 -0
  1346. package/dist/internal/init-project.d.ts +188 -0
  1347. package/dist/internal/init-project.d.ts.map +1 -0
  1348. package/dist/internal/init-project.js +492 -0
  1349. package/dist/internal/init-scaffold.d.ts +20 -0
  1350. package/dist/internal/init-scaffold.d.ts.map +1 -0
  1351. package/dist/internal/init-scaffold.js +194 -0
  1352. package/dist/internal/inline-stdio-define-stub.d.ts +3 -0
  1353. package/dist/internal/inline-stdio-define-stub.d.ts.map +1 -0
  1354. package/dist/internal/inline-stdio-define-stub.js +4 -0
  1355. package/dist/internal/inline-stdio-mcp.d.ts +34 -0
  1356. package/dist/internal/inline-stdio-mcp.d.ts.map +1 -0
  1357. package/dist/internal/inline-stdio-mcp.js +170 -0
  1358. package/dist/internal/install-cursor-skills.d.ts +160 -0
  1359. package/dist/internal/install-cursor-skills.d.ts.map +1 -0
  1360. package/dist/internal/install-cursor-skills.js +464 -0
  1361. package/dist/internal/interview/agent-questions.d.ts +19 -0
  1362. package/dist/internal/interview/agent-questions.d.ts.map +1 -0
  1363. package/dist/internal/interview/agent-questions.js +120 -0
  1364. package/dist/internal/interview/question.d.ts +82 -0
  1365. package/dist/internal/interview/question.d.ts.map +1 -0
  1366. package/dist/internal/interview/question.js +198 -0
  1367. package/dist/internal/is-record.d.ts +2 -0
  1368. package/dist/internal/is-record.d.ts.map +1 -0
  1369. package/dist/internal/is-record.js +3 -0
  1370. package/dist/internal/json-schema.d.ts +25 -0
  1371. package/dist/internal/json-schema.d.ts.map +1 -0
  1372. package/dist/internal/json-schema.js +69 -0
  1373. package/dist/internal/legacy-command-guard.d.ts +24 -0
  1374. package/dist/internal/legacy-command-guard.d.ts.map +1 -0
  1375. package/dist/internal/legacy-command-guard.js +47 -0
  1376. package/dist/internal/listen-port.d.ts +22 -0
  1377. package/dist/internal/listen-port.d.ts.map +1 -0
  1378. package/dist/internal/listen-port.js +66 -0
  1379. package/dist/internal/local-control-plane.d.ts +59 -0
  1380. package/dist/internal/local-control-plane.d.ts.map +1 -0
  1381. package/dist/internal/local-control-plane.js +341 -0
  1382. package/dist/internal/local-env.d.ts +10 -0
  1383. package/dist/internal/local-env.d.ts.map +1 -0
  1384. package/dist/internal/local-env.js +55 -0
  1385. package/dist/internal/local-ingress.d.ts +35 -0
  1386. package/dist/internal/local-ingress.d.ts.map +1 -0
  1387. package/dist/internal/local-ingress.js +50 -0
  1388. package/dist/internal/log-ring.d.ts +23 -0
  1389. package/dist/internal/log-ring.d.ts.map +1 -0
  1390. package/dist/internal/log-ring.js +41 -0
  1391. package/dist/internal/logs-client.d.ts +98 -0
  1392. package/dist/internal/logs-client.d.ts.map +1 -0
  1393. package/dist/internal/logs-client.js +418 -0
  1394. package/dist/internal/map-pool.d.ts +11 -0
  1395. package/dist/internal/map-pool.d.ts.map +1 -0
  1396. package/dist/internal/map-pool.js +34 -0
  1397. package/dist/internal/mcp-endpoint.d.ts +84 -0
  1398. package/dist/internal/mcp-endpoint.d.ts.map +1 -0
  1399. package/dist/internal/mcp-endpoint.js +566 -0
  1400. package/dist/internal/mcp-host.d.ts +99 -0
  1401. package/dist/internal/mcp-host.d.ts.map +1 -0
  1402. package/dist/internal/mcp-host.js +422 -0
  1403. package/dist/internal/mcp-oauth-on-demand.d.ts +68 -0
  1404. package/dist/internal/mcp-oauth-on-demand.d.ts.map +1 -0
  1405. package/dist/internal/mcp-oauth-on-demand.js +250 -0
  1406. package/dist/internal/mcp-oauth-persist.d.ts +42 -0
  1407. package/dist/internal/mcp-oauth-persist.d.ts.map +1 -0
  1408. package/dist/internal/mcp-oauth-persist.js +76 -0
  1409. package/dist/internal/mcp-oauth.d.ts +118 -0
  1410. package/dist/internal/mcp-oauth.d.ts.map +1 -0
  1411. package/dist/internal/mcp-oauth.js +393 -0
  1412. package/dist/internal/memory-dir.d.ts +8 -0
  1413. package/dist/internal/memory-dir.d.ts.map +1 -0
  1414. package/dist/internal/memory-dir.js +7 -0
  1415. package/dist/internal/model-config.d.ts +7 -0
  1416. package/dist/internal/model-config.d.ts.map +1 -0
  1417. package/dist/internal/model-config.js +67 -0
  1418. package/dist/internal/named-webhook-secret.d.ts +39 -0
  1419. package/dist/internal/named-webhook-secret.d.ts.map +1 -0
  1420. package/dist/internal/named-webhook-secret.js +47 -0
  1421. package/dist/internal/net.d.ts +5 -0
  1422. package/dist/internal/net.d.ts.map +1 -0
  1423. package/dist/internal/net.js +28 -0
  1424. package/dist/internal/open-browser.d.ts +5 -0
  1425. package/dist/internal/open-browser.d.ts.map +1 -0
  1426. package/dist/internal/open-browser.js +33 -0
  1427. package/dist/internal/otel/attrs.d.ts +7 -0
  1428. package/dist/internal/otel/attrs.d.ts.map +1 -0
  1429. package/dist/internal/otel/attrs.js +13 -0
  1430. package/dist/internal/otel/collector.d.ts +50 -0
  1431. package/dist/internal/otel/collector.d.ts.map +1 -0
  1432. package/dist/internal/otel/collector.js +765 -0
  1433. package/dist/internal/otel/computer-use-attrs.d.ts +18 -0
  1434. package/dist/internal/otel/computer-use-attrs.d.ts.map +1 -0
  1435. package/dist/internal/otel/computer-use-attrs.js +30 -0
  1436. package/dist/internal/otel/config.d.ts +59 -0
  1437. package/dist/internal/otel/config.d.ts.map +1 -0
  1438. package/dist/internal/otel/config.js +236 -0
  1439. package/dist/internal/otel/conversation-span-processor.d.ts +9 -0
  1440. package/dist/internal/otel/conversation-span-processor.d.ts.map +1 -0
  1441. package/dist/internal/otel/conversation-span-processor.js +34 -0
  1442. package/dist/internal/otel/customer.d.ts +52 -0
  1443. package/dist/internal/otel/customer.d.ts.map +1 -0
  1444. package/dist/internal/otel/customer.js +727 -0
  1445. package/dist/internal/otel/http.d.ts +13 -0
  1446. package/dist/internal/otel/http.d.ts.map +1 -0
  1447. package/dist/internal/otel/http.js +93 -0
  1448. package/dist/internal/otel/mcp.d.ts +16 -0
  1449. package/dist/internal/otel/mcp.d.ts.map +1 -0
  1450. package/dist/internal/otel/mcp.js +46 -0
  1451. package/dist/internal/otel/propagation.d.ts +6 -0
  1452. package/dist/internal/otel/propagation.d.ts.map +1 -0
  1453. package/dist/internal/otel/propagation.js +14 -0
  1454. package/dist/internal/otel/runtime.d.ts +41 -0
  1455. package/dist/internal/otel/runtime.d.ts.map +1 -0
  1456. package/dist/internal/otel/runtime.js +92 -0
  1457. package/dist/internal/otel/tool-error-class.d.ts +4 -0
  1458. package/dist/internal/otel/tool-error-class.d.ts.map +1 -0
  1459. package/dist/internal/otel/tool-error-class.js +36 -0
  1460. package/dist/internal/otel-env.d.ts +6 -0
  1461. package/dist/internal/otel-env.d.ts.map +1 -0
  1462. package/dist/internal/otel-env.js +5 -0
  1463. package/dist/internal/package-inline-stdio.d.ts +12 -0
  1464. package/dist/internal/package-inline-stdio.d.ts.map +1 -0
  1465. package/dist/internal/package-inline-stdio.js +107 -0
  1466. package/dist/internal/peer-connections.d.ts +63 -0
  1467. package/dist/internal/peer-connections.d.ts.map +1 -0
  1468. package/dist/internal/peer-connections.js +115 -0
  1469. package/dist/internal/persistent-stage-log-mirror.d.ts +57 -0
  1470. package/dist/internal/persistent-stage-log-mirror.d.ts.map +1 -0
  1471. package/dist/internal/persistent-stage-log-mirror.js +231 -0
  1472. package/dist/internal/platform-schedule-sync.d.ts +17 -0
  1473. package/dist/internal/platform-schedule-sync.d.ts.map +1 -0
  1474. package/dist/internal/platform-schedule-sync.js +55 -0
  1475. package/dist/internal/platform-timers.d.ts +42 -0
  1476. package/dist/internal/platform-timers.d.ts.map +1 -0
  1477. package/dist/internal/platform-timers.js +251 -0
  1478. package/dist/internal/playground/static.d.ts +52 -0
  1479. package/dist/internal/playground/static.d.ts.map +1 -0
  1480. package/dist/internal/playground/static.js +230 -0
  1481. package/dist/internal/playground/toolchain.d.ts +57 -0
  1482. package/dist/internal/playground/toolchain.d.ts.map +1 -0
  1483. package/dist/internal/playground/toolchain.js +213 -0
  1484. package/dist/internal/playground-proxy.d.ts +69 -0
  1485. package/dist/internal/playground-proxy.d.ts.map +1 -0
  1486. package/dist/internal/playground-proxy.js +434 -0
  1487. package/dist/internal/process-memory-telemetry.d.ts +89 -0
  1488. package/dist/internal/process-memory-telemetry.d.ts.map +1 -0
  1489. package/dist/internal/process-memory-telemetry.js +226 -0
  1490. package/dist/internal/project-layout.d.ts +7 -0
  1491. package/dist/internal/project-layout.d.ts.map +1 -0
  1492. package/dist/internal/project-layout.js +24 -0
  1493. package/dist/internal/prompt-context.d.ts +38 -0
  1494. package/dist/internal/prompt-context.d.ts.map +1 -0
  1495. package/dist/internal/prompt-context.js +86 -0
  1496. package/dist/internal/reminder-control-plane-protocol.d.ts +196 -0
  1497. package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -0
  1498. package/dist/internal/reminder-control-plane-protocol.js +279 -0
  1499. package/dist/internal/reminder-runner.d.ts +223 -0
  1500. package/dist/internal/reminder-runner.d.ts.map +1 -0
  1501. package/dist/internal/reminder-runner.js +1241 -0
  1502. package/dist/internal/reminder-schedule.d.ts +26 -0
  1503. package/dist/internal/reminder-schedule.d.ts.map +1 -0
  1504. package/dist/internal/reminder-schedule.js +83 -0
  1505. package/dist/internal/reminder-store.d.ts +78 -0
  1506. package/dist/internal/reminder-store.d.ts.map +1 -0
  1507. package/dist/internal/reminder-store.js +105 -0
  1508. package/dist/internal/request-error-status.d.ts +14 -0
  1509. package/dist/internal/request-error-status.d.ts.map +1 -0
  1510. package/dist/internal/request-error-status.js +77 -0
  1511. package/dist/internal/request-headers.d.ts +11 -0
  1512. package/dist/internal/request-headers.d.ts.map +1 -0
  1513. package/dist/internal/request-headers.js +14 -0
  1514. package/dist/internal/resolve-prod-target.d.ts +76 -0
  1515. package/dist/internal/resolve-prod-target.d.ts.map +1 -0
  1516. package/dist/internal/resolve-prod-target.js +215 -0
  1517. package/dist/internal/resolved-connections.d.ts +65 -0
  1518. package/dist/internal/resolved-connections.d.ts.map +1 -0
  1519. package/dist/internal/resolved-connections.js +108 -0
  1520. package/dist/internal/router.d.ts +33 -0
  1521. package/dist/internal/router.d.ts.map +1 -0
  1522. package/dist/internal/router.js +93 -0
  1523. package/dist/internal/run-client.d.ts +78 -0
  1524. package/dist/internal/run-client.d.ts.map +1 -0
  1525. package/dist/internal/run-client.js +369 -0
  1526. package/dist/internal/runtime-dispatch-runner.d.ts +25 -0
  1527. package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -0
  1528. package/dist/internal/runtime-dispatch-runner.js +35 -0
  1529. package/dist/internal/sanitize-mcp-tool-name.d.ts +20 -0
  1530. package/dist/internal/sanitize-mcp-tool-name.d.ts.map +1 -0
  1531. package/dist/internal/sanitize-mcp-tool-name.js +28 -0
  1532. package/dist/internal/schedule-runner.d.ts +42 -0
  1533. package/dist/internal/schedule-runner.d.ts.map +1 -0
  1534. package/dist/internal/schedule-runner.js +157 -0
  1535. package/dist/internal/scm/pr-url.d.ts +56 -0
  1536. package/dist/internal/scm/pr-url.d.ts.map +1 -0
  1537. package/dist/internal/scm/pr-url.js +153 -0
  1538. package/dist/internal/sdk-runner.d.ts +204 -0
  1539. package/dist/internal/sdk-runner.d.ts.map +1 -0
  1540. package/dist/internal/sdk-runner.js +1006 -0
  1541. package/dist/internal/sdk-subagent-inherit-support.d.ts +9 -0
  1542. package/dist/internal/sdk-subagent-inherit-support.d.ts.map +1 -0
  1543. package/dist/internal/sdk-subagent-inherit-support.js +89 -0
  1544. package/dist/internal/secret-alternatives.d.ts +11 -0
  1545. package/dist/internal/secret-alternatives.d.ts.map +1 -0
  1546. package/dist/internal/secret-alternatives.js +13 -0
  1547. package/dist/internal/serve-restart.d.ts +42 -0
  1548. package/dist/internal/serve-restart.d.ts.map +1 -0
  1549. package/dist/internal/serve-restart.js +72 -0
  1550. package/dist/internal/server.d.ts +45 -0
  1551. package/dist/internal/server.d.ts.map +1 -0
  1552. package/dist/internal/server.js +2566 -0
  1553. package/dist/internal/session-cost.d.ts +49 -0
  1554. package/dist/internal/session-cost.d.ts.map +1 -0
  1555. package/dist/internal/session-cost.js +147 -0
  1556. package/dist/internal/session-engine.d.ts +955 -0
  1557. package/dist/internal/session-engine.d.ts.map +1 -0
  1558. package/dist/internal/session-engine.js +4880 -0
  1559. package/dist/internal/session-links.d.ts +14 -0
  1560. package/dist/internal/session-links.d.ts.map +1 -0
  1561. package/dist/internal/session-links.js +64 -0
  1562. package/dist/internal/session-live-publisher.d.ts +48 -0
  1563. package/dist/internal/session-live-publisher.d.ts.map +1 -0
  1564. package/dist/internal/session-live-publisher.js +415 -0
  1565. package/dist/internal/session-run-log.d.ts +108 -0
  1566. package/dist/internal/session-run-log.d.ts.map +1 -0
  1567. package/dist/internal/session-run-log.js +398 -0
  1568. package/dist/internal/session-store.d.ts +73 -0
  1569. package/dist/internal/session-store.d.ts.map +1 -0
  1570. package/dist/internal/session-store.js +279 -0
  1571. package/dist/internal/session-urls.d.ts +10 -0
  1572. package/dist/internal/session-urls.d.ts.map +1 -0
  1573. package/dist/internal/session-urls.js +25 -0
  1574. package/dist/internal/sessions-client.d.ts +63 -0
  1575. package/dist/internal/sessions-client.d.ts.map +1 -0
  1576. package/dist/internal/sessions-client.js +215 -0
  1577. package/dist/internal/skill-catalog.d.ts +28 -0
  1578. package/dist/internal/skill-catalog.d.ts.map +1 -0
  1579. package/dist/internal/skill-catalog.js +36 -0
  1580. package/dist/internal/skills-sync.d.ts +22 -0
  1581. package/dist/internal/skills-sync.d.ts.map +1 -0
  1582. package/dist/internal/skills-sync.js +40 -0
  1583. package/dist/internal/slack-provision-client.d.ts +199 -0
  1584. package/dist/internal/slack-provision-client.d.ts.map +1 -0
  1585. package/dist/internal/slack-provision-client.js +320 -0
  1586. package/dist/internal/slack-thread-key.d.ts +7 -0
  1587. package/dist/internal/slack-thread-key.d.ts.map +1 -0
  1588. package/dist/internal/slack-thread-key.js +10 -0
  1589. package/dist/internal/sleep.d.ts +2 -0
  1590. package/dist/internal/sleep.d.ts.map +1 -0
  1591. package/dist/internal/sleep.js +3 -0
  1592. package/dist/internal/slug.d.ts +12 -0
  1593. package/dist/internal/slug.d.ts.map +1 -0
  1594. package/dist/internal/slug.js +38 -0
  1595. package/dist/internal/sqlite-experimental-warning.d.ts +2 -0
  1596. package/dist/internal/sqlite-experimental-warning.d.ts.map +1 -0
  1597. package/dist/internal/sqlite-experimental-warning.js +22 -0
  1598. package/dist/internal/start-log-store.d.ts +53 -0
  1599. package/dist/internal/start-log-store.d.ts.map +1 -0
  1600. package/dist/internal/start-log-store.js +155 -0
  1601. package/dist/internal/steering.d.ts +15 -0
  1602. package/dist/internal/steering.d.ts.map +1 -0
  1603. package/dist/internal/steering.js +17 -0
  1604. package/dist/internal/storage-coordinator.d.ts +200 -0
  1605. package/dist/internal/storage-coordinator.d.ts.map +1 -0
  1606. package/dist/internal/storage-coordinator.js +747 -0
  1607. package/dist/internal/storage-roles.d.ts +83 -0
  1608. package/dist/internal/storage-roles.d.ts.map +1 -0
  1609. package/dist/internal/storage-roles.js +24 -0
  1610. package/dist/internal/storage.d.ts +2 -0
  1611. package/dist/internal/storage.d.ts.map +1 -0
  1612. package/dist/internal/storage.js +1 -0
  1613. package/dist/internal/store-api-protocol.d.ts +164 -0
  1614. package/dist/internal/store-api-protocol.d.ts.map +1 -0
  1615. package/dist/internal/store-api-protocol.js +145 -0
  1616. package/dist/internal/store-mirror.d.ts +28 -0
  1617. package/dist/internal/store-mirror.d.ts.map +1 -0
  1618. package/dist/internal/store-mirror.js +54 -0
  1619. package/dist/internal/stream-progress.d.ts +14 -0
  1620. package/dist/internal/stream-progress.d.ts.map +1 -0
  1621. package/dist/internal/stream-progress.js +231 -0
  1622. package/dist/internal/terminal-style.d.ts +40 -0
  1623. package/dist/internal/terminal-style.d.ts.map +1 -0
  1624. package/dist/internal/terminal-style.js +93 -0
  1625. package/dist/internal/testing/conversation-identity-vectors.d.ts +53 -0
  1626. package/dist/internal/testing/conversation-identity-vectors.d.ts.map +1 -0
  1627. package/dist/internal/testing/conversation-identity-vectors.js +170 -0
  1628. package/dist/internal/testing/factory-resource-fixtures.d.ts +64 -0
  1629. package/dist/internal/testing/factory-resource-fixtures.d.ts.map +1 -0
  1630. package/dist/internal/testing/factory-resource-fixtures.js +55 -0
  1631. package/dist/internal/testing/hmac-secret-vectors.d.ts +38 -0
  1632. package/dist/internal/testing/hmac-secret-vectors.d.ts.map +1 -0
  1633. package/dist/internal/testing/hmac-secret-vectors.js +89 -0
  1634. package/dist/internal/testing/pagerduty-continuation-fixtures.d.ts +42 -0
  1635. package/dist/internal/testing/pagerduty-continuation-fixtures.d.ts.map +1 -0
  1636. package/dist/internal/testing/pagerduty-continuation-fixtures.js +175 -0
  1637. package/dist/internal/testing/scm-continuation-fixtures.d.ts +33 -0
  1638. package/dist/internal/testing/scm-continuation-fixtures.d.ts.map +1 -0
  1639. package/dist/internal/testing/scm-continuation-fixtures.js +257 -0
  1640. package/dist/internal/testing/slack-continuation-fixtures.d.ts +26 -0
  1641. package/dist/internal/testing/slack-continuation-fixtures.d.ts.map +1 -0
  1642. package/dist/internal/testing/slack-continuation-fixtures.js +136 -0
  1643. package/dist/internal/tool-call-retry.d.ts +87 -0
  1644. package/dist/internal/tool-call-retry.d.ts.map +1 -0
  1645. package/dist/internal/tool-call-retry.js +387 -0
  1646. package/dist/internal/tool-catalog.d.ts +31 -0
  1647. package/dist/internal/tool-catalog.d.ts.map +1 -0
  1648. package/dist/internal/tool-catalog.js +76 -0
  1649. package/dist/internal/tool-policy.d.ts +110 -0
  1650. package/dist/internal/tool-policy.d.ts.map +1 -0
  1651. package/dist/internal/tool-policy.js +138 -0
  1652. package/dist/internal/tool-result.d.ts +20 -0
  1653. package/dist/internal/tool-result.d.ts.map +1 -0
  1654. package/dist/internal/tool-result.js +50 -0
  1655. package/dist/internal/trajectory.d.ts +68 -0
  1656. package/dist/internal/trajectory.d.ts.map +1 -0
  1657. package/dist/internal/trajectory.js +336 -0
  1658. package/dist/internal/turn-governor.d.ts +54 -0
  1659. package/dist/internal/turn-governor.d.ts.map +1 -0
  1660. package/dist/internal/turn-governor.js +108 -0
  1661. package/dist/internal/turn-lease-store.d.ts +51 -0
  1662. package/dist/internal/turn-lease-store.d.ts.map +1 -0
  1663. package/dist/internal/turn-lease-store.js +172 -0
  1664. package/dist/internal/turn-outbox.d.ts +24 -0
  1665. package/dist/internal/turn-outbox.d.ts.map +1 -0
  1666. package/dist/internal/turn-outbox.js +65 -0
  1667. package/dist/internal/update-check.d.ts +93 -0
  1668. package/dist/internal/update-check.d.ts.map +1 -0
  1669. package/dist/internal/update-check.js +401 -0
  1670. package/dist/internal/v2-hosting.d.ts +34 -0
  1671. package/dist/internal/v2-hosting.d.ts.map +1 -0
  1672. package/dist/internal/v2-hosting.js +35 -0
  1673. package/dist/internal/workspace-sync.d.ts +44 -0
  1674. package/dist/internal/workspace-sync.d.ts.map +1 -0
  1675. package/dist/internal/workspace-sync.js +85 -0
  1676. package/dist/internal/workspace.d.ts +155 -0
  1677. package/dist/internal/workspace.d.ts.map +1 -0
  1678. package/dist/internal/workspace.js +468 -0
  1679. package/dist/internal/zod-schema.d.ts +14 -0
  1680. package/dist/internal/zod-schema.d.ts.map +1 -0
  1681. package/dist/internal/zod-schema.js +22 -0
  1682. package/dist/internal/zod3-datetime.d.ts +12 -0
  1683. package/dist/internal/zod3-datetime.d.ts.map +1 -0
  1684. package/dist/internal/zod3-datetime.js +17 -0
  1685. package/dist/kv/memory-kv.d.ts +24 -0
  1686. package/dist/kv/memory-kv.d.ts.map +1 -0
  1687. package/dist/kv/memory-kv.js +80 -0
  1688. package/dist/kv.d.ts +18 -0
  1689. package/dist/kv.d.ts.map +1 -0
  1690. package/dist/kv.js +16 -0
  1691. package/dist/memory.d.ts +113 -0
  1692. package/dist/memory.d.ts.map +1 -0
  1693. package/dist/memory.js +312 -0
  1694. package/dist/otel-public.d.ts +6 -0
  1695. package/dist/otel-public.d.ts.map +1 -0
  1696. package/dist/otel-public.js +5 -0
  1697. package/dist/otel.d.ts +31 -0
  1698. package/dist/otel.d.ts.map +1 -0
  1699. package/dist/otel.js +146 -0
  1700. package/dist/playground/assets/cursor-icons-16-DfKNljMZ.woff2 +0 -0
  1701. package/dist/playground/assets/index-B3_YohwW.js +62 -0
  1702. package/dist/playground/assets/index-Cn3-adsJ.css +1 -0
  1703. package/dist/playground/index.html +17 -0
  1704. package/dist/prompt.d.ts +39 -0
  1705. package/dist/prompt.d.ts.map +1 -0
  1706. package/dist/prompt.js +68 -0
  1707. package/dist/public-deprecated.d.ts +36 -0
  1708. package/dist/public-deprecated.d.ts.map +1 -0
  1709. package/dist/public-deprecated.js +39 -0
  1710. package/dist/reminders.d.ts +42 -0
  1711. package/dist/reminders.d.ts.map +1 -0
  1712. package/dist/reminders.js +45 -0
  1713. package/dist/schedules.d.ts +23 -0
  1714. package/dist/schedules.d.ts.map +1 -0
  1715. package/dist/schedules.js +26 -0
  1716. package/dist/skills.d.ts +22 -0
  1717. package/dist/skills.d.ts.map +1 -0
  1718. package/dist/skills.js +22 -0
  1719. package/dist/storage-backends/cursor-hosted-v2.d.ts +54 -0
  1720. package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -0
  1721. package/dist/storage-backends/cursor-hosted-v2.js +113 -0
  1722. package/dist/storage-backends/cursor-hosted.d.ts +94 -0
  1723. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -0
  1724. package/dist/storage-backends/cursor-hosted.js +225 -0
  1725. package/dist/storage-backends/file-kv.d.ts +42 -0
  1726. package/dist/storage-backends/file-kv.d.ts.map +1 -0
  1727. package/dist/storage-backends/file-kv.js +226 -0
  1728. package/dist/storage-protocol.d.ts +124 -0
  1729. package/dist/storage-protocol.d.ts.map +1 -0
  1730. package/dist/storage-protocol.js +181 -0
  1731. package/dist/storage.d.ts +254 -0
  1732. package/dist/storage.d.ts.map +1 -0
  1733. package/dist/storage.js +145 -0
  1734. package/dist/tools.d.ts +135 -0
  1735. package/dist/tools.d.ts.map +1 -0
  1736. package/dist/tools.js +78 -0
  1737. package/dist/types.d.ts +3804 -0
  1738. package/dist/types.d.ts.map +1 -0
  1739. package/dist/types.js +191 -0
  1740. package/docs/README.md +115 -0
  1741. package/docs/building-with-agents.md +139 -0
  1742. package/docs/changelog.md +119 -0
  1743. package/docs/deployment.md +314 -0
  1744. package/docs/evals.md +244 -0
  1745. package/docs/guides/agent-to-agent.md +167 -0
  1746. package/docs/guides/bitbucket.md +298 -0
  1747. package/docs/guides/cloud-agents.md +86 -0
  1748. package/docs/guides/convert-automation.md +185 -0
  1749. package/docs/guides/export-grokbot.md +244 -0
  1750. package/docs/guides/github.md +378 -0
  1751. package/docs/guides/gitlab.md +304 -0
  1752. package/docs/guides/grokbot-agents.md +140 -0
  1753. package/docs/guides/hooks.md +121 -0
  1754. package/docs/guides/improve.md +134 -0
  1755. package/docs/guides/jev.md +303 -0
  1756. package/docs/guides/mcp-oauth.md +153 -0
  1757. package/docs/guides/migrate.md +169 -0
  1758. package/docs/guides/opentelemetry.md +205 -0
  1759. package/docs/guides/pagerduty.md +341 -0
  1760. package/docs/guides/slack.md +314 -0
  1761. package/docs/guides/webhooks.md +255 -0
  1762. package/docs/hillclimbing.md +139 -0
  1763. package/docs/quickstart.md +312 -0
  1764. package/docs/reference/agent-config.md +243 -0
  1765. package/docs/reference/artifacts.md +118 -0
  1766. package/docs/reference/channels.md +219 -0
  1767. package/docs/reference/cli.md +1103 -0
  1768. package/docs/reference/connections.md +312 -0
  1769. package/docs/reference/evals.md +299 -0
  1770. package/docs/reference/extensions.md +214 -0
  1771. package/docs/reference/hooks.md +202 -0
  1772. package/docs/reference/http-api.md +226 -0
  1773. package/docs/reference/instructions.md +69 -0
  1774. package/docs/reference/memory.md +119 -0
  1775. package/docs/reference/playground.md +41 -0
  1776. package/docs/reference/project-layout.md +122 -0
  1777. package/docs/reference/prompt.md +52 -0
  1778. package/docs/reference/schedules.md +195 -0
  1779. package/docs/reference/sessions.md +205 -0
  1780. package/docs/reference/skills.md +77 -0
  1781. package/docs/reference/subagents.md +66 -0
  1782. package/docs/reference/tools.md +311 -0
  1783. package/docs/templates/agentic-owners.md +131 -0
  1784. package/docs/templates/grokbot-agents.md +60 -0
  1785. package/docs/templates/security-reviewer.md +86 -0
  1786. package/docs/templates/thermo-quality-review.md +80 -0
  1787. package/docs/templates/thermo-review.md +80 -0
  1788. package/docs/templates/triage.md +106 -0
  1789. package/docs/troubleshooting.md +154 -0
  1790. package/package.json +429 -4
  1791. package/schemas/grokbot-answers.schema.json +354 -0
  1792. package/scripts/install-cursor-skills.mjs +29 -0
  1793. package/skills/create-agent/SKILL.md +175 -0
  1794. package/skills/debug/SKILL.md +43 -0
  1795. package/skills/deploy/SKILL.md +169 -0
  1796. package/skills/evals/SKILL.md +145 -0
  1797. package/skills/framework-map/SKILL.md +128 -0
  1798. package/skills/github/SKILL.md +133 -0
  1799. package/skills/hillclimb/SKILL.md +63 -0
  1800. package/skills/mcp-auth/SKILL.md +60 -0
  1801. package/skills/migrate-v2/SKILL.md +397 -0
  1802. package/skills/otel/SKILL.md +48 -0
  1803. package/skills/setup-slack/SKILL.md +136 -0
  1804. package/templates/agentic-owners/README.md +78 -0
  1805. package/templates/agentic-owners/bot/agent.ts +8 -0
  1806. package/templates/agentic-owners/bot/channels/github.ts +63 -0
  1807. package/templates/agentic-owners/bot/instructions.md +34 -0
  1808. package/templates/agentic-owners/bot/lib/config.ts +5 -0
  1809. package/templates/agentic-owners/bot/lib/github.ts +219 -0
  1810. package/templates/agentic-owners/bot/lib/owners/README.md +50 -0
  1811. package/templates/agentic-owners/bot/lib/owners/constants.ts +22 -0
  1812. package/templates/agentic-owners/bot/lib/owners/decision.ts +480 -0
  1813. package/templates/agentic-owners/bot/lib/owners/globalOverride.ts +60 -0
  1814. package/templates/agentic-owners/bot/lib/owners/handles.ts +54 -0
  1815. package/templates/agentic-owners/bot/lib/owners/match.ts +287 -0
  1816. package/templates/agentic-owners/bot/lib/owners/matching.ts +147 -0
  1817. package/templates/agentic-owners/bot/lib/owners/parse.ts +696 -0
  1818. package/templates/agentic-owners/bot/lib/owners/policyMode.ts +57 -0
  1819. package/templates/agentic-owners/bot/lib/owners/prompt.ts +64 -0
  1820. package/templates/agentic-owners/bot/lib/owners/prompts/base-review.md +105 -0
  1821. package/templates/agentic-owners/bot/lib/owners/types.ts +73 -0
  1822. package/templates/agentic-owners/bot/lib/review.ts +723 -0
  1823. package/templates/agentic-owners/bot/tools/record_review.ts +62 -0
  1824. package/templates/agentic-owners/evals/evals.config.ts +5 -0
  1825. package/templates/agentic-owners/evals/owners.eval.ts +111 -0
  1826. package/templates/agentic-owners/package.json +20 -0
  1827. package/templates/agentic-owners/tsconfig.json +12 -0
  1828. package/templates/agents-md/README.md +43 -0
  1829. package/templates/agents-md/bot/agent.ts +8 -0
  1830. package/templates/agents-md/bot/channels/github.ts +10 -0
  1831. package/templates/agents-md/bot/channels/queue.ts +23 -0
  1832. package/templates/agents-md/bot/channels/slack.ts +9 -0
  1833. package/templates/agents-md/bot/instructions.md +38 -0
  1834. package/templates/agents-md/bot/lib/collect.ts +412 -0
  1835. package/templates/agents-md/bot/lib/config.ts +8 -0
  1836. package/templates/agents-md/bot/lib/paths.ts +49 -0
  1837. package/templates/agents-md/bot/schedules/weekly.ts +17 -0
  1838. package/templates/agents-md/bot/tools/apply_agents.ts +217 -0
  1839. package/templates/agents-md/evals/agents.eval.ts +136 -0
  1840. package/templates/agents-md/evals/evals.config.ts +5 -0
  1841. package/templates/agents-md/init.json +38 -0
  1842. package/templates/agents-md/package.json +18 -0
  1843. package/templates/agents-md/tsconfig.json +12 -0
  1844. package/templates/code-wiki/README.md +34 -0
  1845. package/templates/code-wiki/bot/agent.ts +8 -0
  1846. package/templates/code-wiki/bot/channels/github.ts +125 -0
  1847. package/templates/code-wiki/bot/instructions.md +39 -0
  1848. package/templates/code-wiki/bot/lib/repos.ts +5 -0
  1849. package/templates/code-wiki/bot/lib/wiki.ts +22 -0
  1850. package/templates/code-wiki/bot/tools/apply_wiki.ts +210 -0
  1851. package/templates/code-wiki/evals/evals.config.ts +5 -0
  1852. package/templates/code-wiki/evals/wiki.eval.ts +124 -0
  1853. package/templates/code-wiki/init.json +25 -0
  1854. package/templates/code-wiki/package.json +18 -0
  1855. package/templates/code-wiki/tsconfig.json +12 -0
  1856. package/templates/demo/README.md +37 -0
  1857. package/templates/demo/bot/agent.ts +8 -0
  1858. package/templates/demo/bot/channels/github.ts +52 -0
  1859. package/templates/demo/bot/channels/queue.ts +24 -0
  1860. package/templates/demo/bot/instructions.md +8 -0
  1861. package/templates/demo/bot/lib/collect.ts +66 -0
  1862. package/templates/demo/bot/lib/repos.ts +5 -0
  1863. package/templates/demo/bot/tools/record_demo.ts +37 -0
  1864. package/templates/demo/evals/demo.eval.ts +29 -0
  1865. package/templates/demo/evals/evals.config.ts +5 -0
  1866. package/templates/demo/init.json +25 -0
  1867. package/templates/demo/package.json +18 -0
  1868. package/templates/demo/tsconfig.json +12 -0
  1869. package/templates/grokbot-agents/README.md +27 -0
  1870. package/templates/grokbot-agents/bot/agent.ts +6 -0
  1871. package/templates/grokbot-agents/bot/extensions/grokbot.ts +5 -0
  1872. package/templates/grokbot-agents/bot/instructions.md +7 -0
  1873. package/templates/grokbot-agents/evals/evals.config.ts +5 -0
  1874. package/templates/grokbot-agents/evals/grokbot-agents.eval.ts +18 -0
  1875. package/templates/grokbot-agents/init.json +18 -0
  1876. package/templates/grokbot-agents/package.json +17 -0
  1877. package/templates/grokbot-agents/tsconfig.json +12 -0
  1878. package/templates/pr-autofixer/bot/agent.ts +11 -0
  1879. package/templates/pr-autofixer/bot/channels/drive.ts +24 -0
  1880. package/templates/pr-autofixer/bot/channels/github.ts +155 -0
  1881. package/templates/pr-autofixer/bot/channels/slack.ts +16 -0
  1882. package/templates/pr-autofixer/bot/hooks/bind-agent.ts +19 -0
  1883. package/templates/pr-autofixer/bot/instructions.md +83 -0
  1884. package/templates/pr-autofixer/bot/lib/affinity.ts +24 -0
  1885. package/templates/pr-autofixer/bot/lib/drive-schemas.ts +18 -0
  1886. package/templates/pr-autofixer/bot/lib/drive.ts +73 -0
  1887. package/templates/pr-autofixer/bot/lib/merge-watch.ts +116 -0
  1888. package/templates/pr-autofixer/bot/lib/pr-state.ts +40 -0
  1889. package/templates/pr-autofixer/bot/lib/repos.ts +18 -0
  1890. package/templates/pr-autofixer/bot/lib/start-drive.ts +113 -0
  1891. package/templates/pr-autofixer/bot/lib/webhook-buffer.ts +215 -0
  1892. package/templates/pr-autofixer/bot/lib/webhook-routing.ts +231 -0
  1893. package/templates/pr-autofixer/bot/tools/drive_pr.ts +21 -0
  1894. package/templates/pr-autofixer/evals/coordinator.eval.ts +16 -0
  1895. package/templates/pr-autofixer/evals/evals.config.ts +5 -0
  1896. package/templates/pr-autofixer/init.json +25 -0
  1897. package/templates/pr-autofixer/package.json +18 -0
  1898. package/templates/pr-autofixer/tsconfig.json +12 -0
  1899. package/templates/security-help/README.md +46 -0
  1900. package/templates/security-help/bot/agent.ts +17 -0
  1901. package/templates/security-help/bot/channels/github.ts +13 -0
  1902. package/templates/security-help/bot/channels/slack.ts +84 -0
  1903. package/templates/security-help/bot/instructions.md +19 -0
  1904. package/templates/security-help/bot/lib/pr-first-pass.ts +40 -0
  1905. package/templates/security-help/bot/lib/repos.ts +5 -0
  1906. package/templates/security-help/bot/skills/access-request.md +10 -0
  1907. package/templates/security-help/bot/skills/faq.md +31 -0
  1908. package/templates/security-help/bot/skills/security-playbooks.md +12 -0
  1909. package/templates/security-help/bot/skills/security-pr-first-pass.md +12 -0
  1910. package/templates/security-help/evals/evals.config.ts +5 -0
  1911. package/templates/security-help/evals/security-help.eval.ts +51 -0
  1912. package/templates/security-help/init.json +31 -0
  1913. package/templates/security-help/package.json +17 -0
  1914. package/templates/security-help/tsconfig.json +12 -0
  1915. package/templates/security-reviewer/README.md +33 -0
  1916. package/templates/security-reviewer/bot/agent.ts +8 -0
  1917. package/templates/security-reviewer/bot/channels/github.ts +43 -0
  1918. package/templates/security-reviewer/bot/instructions.md +22 -0
  1919. package/templates/security-reviewer/bot/lib/repos.ts +5 -0
  1920. package/templates/security-reviewer/bot/tools/post_findings.ts +68 -0
  1921. package/templates/security-reviewer/evals/evals.config.ts +5 -0
  1922. package/templates/security-reviewer/evals/review.eval.ts +50 -0
  1923. package/templates/security-reviewer/init.json +25 -0
  1924. package/templates/security-reviewer/package.json +18 -0
  1925. package/templates/security-reviewer/tsconfig.json +12 -0
  1926. package/templates/thermo-quality-review/README.md +35 -0
  1927. package/templates/thermo-quality-review/bot/agent.ts +8 -0
  1928. package/templates/thermo-quality-review/bot/channels/github.ts +39 -0
  1929. package/templates/thermo-quality-review/bot/instructions.md +43 -0
  1930. package/templates/thermo-quality-review/bot/tools/post_findings.ts +67 -0
  1931. package/templates/thermo-quality-review/evals/evals.config.ts +5 -0
  1932. package/templates/thermo-quality-review/evals/review.eval.ts +59 -0
  1933. package/templates/thermo-quality-review/package.json +18 -0
  1934. package/templates/thermo-quality-review/tsconfig.json +12 -0
  1935. package/templates/thermo-review/README.md +35 -0
  1936. package/templates/thermo-review/bot/agent.ts +8 -0
  1937. package/templates/thermo-review/bot/channels/github.ts +39 -0
  1938. package/templates/thermo-review/bot/instructions.md +40 -0
  1939. package/templates/thermo-review/bot/tools/post_findings.ts +67 -0
  1940. package/templates/thermo-review/evals/evals.config.ts +5 -0
  1941. package/templates/thermo-review/evals/review.eval.ts +50 -0
  1942. package/templates/thermo-review/package.json +18 -0
  1943. package/templates/thermo-review/tsconfig.json +12 -0
  1944. package/templates/triage/README.md +47 -0
  1945. package/templates/triage/bot/agent.ts +8 -0
  1946. package/templates/triage/bot/channels/queue.ts +29 -0
  1947. package/templates/triage/bot/channels/webhook.ts +41 -0
  1948. package/templates/triage/bot/hooks/memory.ts +3 -0
  1949. package/templates/triage/bot/instructions.md +38 -0
  1950. package/templates/triage/bot/lib/actuate.ts +703 -0
  1951. package/templates/triage/bot/lib/parse-queue-event.ts +160 -0
  1952. package/templates/triage/bot/lib/tracker.ts +5 -0
  1953. package/templates/triage/bot/lib/types.ts +48 -0
  1954. package/templates/triage/bot/lib/verify-webhook.ts +79 -0
  1955. package/templates/triage/bot/skills/triage-rubric.md +44 -0
  1956. package/templates/triage/bot/tools/record_triage.ts +29 -0
  1957. package/templates/triage/evals/evals.config.ts +5 -0
  1958. package/templates/triage/evals/triage.eval.ts +64 -0
  1959. package/templates/triage/overlays/jira/README.md +21 -0
  1960. package/templates/triage/overlays/jira/bot/lib/tracker.ts +8 -0
  1961. package/templates/triage/overlays/jira/bot/mcp-connections/tracker.ts +6 -0
  1962. package/templates/triage/overlays/linear/README.md +21 -0
  1963. package/templates/triage/overlays/linear/bot/lib/tracker.ts +8 -0
  1964. package/templates/triage/overlays/linear/bot/mcp-connections/tracker.ts +6 -0
  1965. package/templates/triage/package.json +18 -0
  1966. package/templates/triage/tsconfig.json +12 -0
@@ -0,0 +1,2072 @@
1
+ /**
2
+ * `agent-sdk deploy | deployments | deployment | stop | rollback | delete | rotate-token |
3
+ * secrets set|list|unset` — Heroku-style deploys
4
+ * onto Cursor's managed agent-serve hosting.
5
+ *
6
+ * All intelligence is server-side (backend/server/src/agentServe/); these
7
+ * handlers resolve parameters (credentials, team, slug, the project's
8
+ * `hosting` / `architecture` manifest block), call the v1 agent-serve or
9
+ * v2 agentsdk management API through `deploy-client.ts`, poll status, and
10
+ * render.
11
+ */
12
+ import { basename, relative, resolve } from "node:path";
13
+ import { catchAuthDeclaration, isPublicEndpointPolicy } from "../channels.js";
14
+ import { isCursorAccountTransport, } from "../types.js";
15
+ import { CursorBackendClient } from "./cursor/backend-client.js";
16
+ import { cursorExternalApiUrl, resolveApiKey, SIGN_IN_HINT } from "./cursor/credentials.js";
17
+ import { authorizeCursorAccountConnectors } from "./cursor-account-mcp-auth.js";
18
+ import { readDeployTemplate } from "./cursor-agent-template.js";
19
+ import { AgentServeDeployClient, SEVERAL_AGENTS_DEPLOY_ALONE, DeployApiError, deploymentServiceAccountId, TERMINAL_AGENTKIT_DEPLOY_STATUSES, TERMINAL_DEPLOY_STATUSES, validateDeploymentSlug, } from "./deploy-client.js";
20
+ import { channelCatchSecretNames, channelCredentialSecretNames, channelSecretAlternatives, } from "./deploy-manifest.js";
21
+ import { unmetSecretAlternatives } from "./secret-alternatives.js";
22
+ import { inferDeployGitSource } from "./deploy-source.js";
23
+ import { describeError } from "./describe-error.js";
24
+ import { formatDiagnostics, hasErrorDiagnostics, isAgentProjectDir, listChildAgentDirs, loadAgentProject, } from "./discovery.js";
25
+ import { CLI_COMMAND_NAME as CLI } from "./distribution.js";
26
+ import { isReservedSecretName, isValidCursorEventRepo, validateSettableSecretName, } from "./hosting.js";
27
+ import { deploymentArchitecture, rejectV2ForLegacyCommand } from "./legacy-command-guard.js";
28
+ import { deployProgressLabel, sanitizeCustomerError } from "./logs-client.js";
29
+ import { sleep } from "./sleep.js";
30
+ import { slugFromDirectoryName } from "./slug.js";
31
+ import { stderrPalette } from "./terminal-style.js";
32
+ const DEFAULT_POLL_INTERVAL_MS = 3_000;
33
+ const DEFAULT_DEPLOY_TIMEOUT_MS = 10 * 60 * 1000;
34
+ const MULTI_COMPONENT_ALLOWED_TEAM_ID = 1;
35
+ function canPublishAgentsAsOne(teamId) {
36
+ return teamId === MULTI_COMPONENT_ALLOWED_TEAM_ID;
37
+ }
38
+ /**
39
+ * Credentials → deploy client → team id. Shared by deploy commands and
40
+ * `--prod` AX routing. Returns an exit code (error already rendered) on
41
+ * failure.
42
+ */
43
+ export async function resolveDeployAuth(options) {
44
+ const err = options.err ?? ((text) => void process.stderr.write(text));
45
+ const resolved = await resolveApiKey(options.apiKey === undefined ? undefined : { apiKey: options.apiKey });
46
+ if (resolved === undefined) {
47
+ err(`Not signed in to Cursor. ${SIGN_IN_HINT}\n`);
48
+ return 1;
49
+ }
50
+ // The deployment management routes live on the external API host
51
+ // (api.cursor.com), not the default backend (api2.cursor.sh) — see
52
+ // cursorExternalApiUrl. GetMe below stays on the resolved backend.
53
+ const client = new AgentServeDeployClient({
54
+ backendUrl: cursorExternalApiUrl(),
55
+ apiKey: resolved.apiKey,
56
+ fetchImpl: options.fetchImpl,
57
+ });
58
+ let teamId;
59
+ if (options.team !== undefined) {
60
+ teamId = Number.parseInt(options.team, 10);
61
+ if (Number.isNaN(teamId) || teamId <= 0) {
62
+ err(`Invalid --team: ${options.team} (expected a positive team id)\n`);
63
+ return 1;
64
+ }
65
+ }
66
+ else {
67
+ const account = new CursorBackendClient({
68
+ backendUrl: resolved.backendUrl,
69
+ apiKey: resolved.apiKey,
70
+ fetchImpl: options.fetchImpl,
71
+ });
72
+ let identity;
73
+ try {
74
+ identity = await account.getMe();
75
+ }
76
+ catch (error) {
77
+ err(`Could not resolve your team from the Cursor account: ${describeError(error)}\nPass --team <id> explicitly.\n`);
78
+ return 1;
79
+ }
80
+ if (identity.teamId === undefined || identity.teamId <= 0) {
81
+ err("This Cursor account has no default team; pass --team <id> (find it in the Cursor dashboard URL).\n");
82
+ return 1;
83
+ }
84
+ teamId = identity.teamId;
85
+ const dim = stderrPalette().dim;
86
+ err(`${dim(`Using team ${teamId}${identity.teamName === undefined ? "" : ` (${identity.teamName})`}`)}\n${dim(" the account's team — pass --team to override.")}\n`);
87
+ }
88
+ return {
89
+ client,
90
+ teamId,
91
+ apiKey: resolved.apiKey,
92
+ backendUrl: resolved.backendUrl,
93
+ };
94
+ }
95
+ /**
96
+ * Shared preamble: credentials → client → team id. Returns an exit code
97
+ * (with the error already rendered) when resolution fails.
98
+ */
99
+ export async function prepare(options) {
100
+ const out = options.out ?? ((text) => void process.stdout.write(text));
101
+ const err = options.err ?? ((text) => void process.stderr.write(text));
102
+ const auth = await resolveDeployAuth({
103
+ team: options.team,
104
+ apiKey: options.apiKey,
105
+ fetchImpl: options.fetchImpl,
106
+ err,
107
+ });
108
+ if (typeof auth === "number") {
109
+ return auth;
110
+ }
111
+ return {
112
+ client: auth.client,
113
+ teamId: auth.teamId,
114
+ apiKey: auth.apiKey,
115
+ backendUrl: auth.backendUrl,
116
+ json: options.json === true,
117
+ noWait: options.noWait === true,
118
+ pollIntervalMs: options.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS,
119
+ timeoutMs: options.timeoutMs ?? DEFAULT_DEPLOY_TIMEOUT_MS,
120
+ out,
121
+ err,
122
+ };
123
+ }
124
+ // ============================================================================
125
+ // deploy
126
+ // ============================================================================
127
+ export async function cmdDeploy(options) {
128
+ const ctx = await prepare(options);
129
+ if (typeof ctx === "number") {
130
+ return ctx;
131
+ }
132
+ if (options.multiTenant === true && ctx.teamId !== MULTI_COMPONENT_ALLOWED_TEAM_ID) {
133
+ ctx.err("--multi-tenant is not available for this team.\n");
134
+ return 1;
135
+ }
136
+ const targets = await resolveDeployTargets(options, ctx);
137
+ if (typeof targets === "number") {
138
+ return targets;
139
+ }
140
+ if (targets.length === 1) {
141
+ return deployOne(ctx, options, targets[0]);
142
+ }
143
+ const manifests = [];
144
+ for (const target of targets) {
145
+ manifests.push(await readDeployManifest(target.dir));
146
+ }
147
+ if (manifests.every((manifest) => manifest.architecture === "v2")) {
148
+ // One team can publish several agents as one deployment. Other teams deploy each agent alone.
149
+ if (!canPublishAgentsAsOne(ctx.teamId)) {
150
+ ctx.err(severalAgentsDeployAloneText(options, targets));
151
+ return 1;
152
+ }
153
+ if (!ctx.json) {
154
+ ctx.err(options.all === true
155
+ ? deployingAllAgentsLine(options, targets)
156
+ : deployingAsOneApplicationLine(options, targets));
157
+ }
158
+ return deployAgentsdkApplication(ctx, options, targets, {
159
+ // `persistent` is per child agent, like `agentPath`: each release
160
+ // component carries its own.
161
+ componentPersistent: Object.fromEntries(targets.map((target, index) => [target.slug, manifests[index]?.persistent === true])),
162
+ componentImage: Object.fromEntries(targets.flatMap((target, index) => manifests[index]?.image === undefined ? [] : [[target.slug, manifests[index].image]])),
163
+ hasScmChannels: manifests.some((manifest) => manifest.hasScmChannels),
164
+ declaredSecretNames: declaredSecretNames(manifests),
165
+ hasDeploymentsChannels: manifests.some((manifest) => manifest.hasDeploymentsChannels),
166
+ });
167
+ }
168
+ if (!ctx.json && options.all === true) {
169
+ ctx.err(deployingAllAgentsLine(options, targets));
170
+ }
171
+ if (!ctx.json && manifests.some((manifest) => manifest.architecture === "v2")) {
172
+ ctx.err(`warning: agents under this parent mix architectures; deploying each separately (v2 children become standalone single-component applications).\n`);
173
+ }
174
+ // --path is per-agent (relative to the repo root). When deploying several
175
+ // agents, ignore a shared --path so each target can infer its own path.
176
+ let deployOptions = options;
177
+ if (options.path !== undefined) {
178
+ if (!ctx.json) {
179
+ ctx.err(`warning: ignoring --path ${JSON.stringify(options.path)} for a multi-agent deploy; each agent infers its own path from git.\n`);
180
+ }
181
+ deployOptions = { ...options, path: undefined };
182
+ }
183
+ // Multi-agent batch: deploy sequentially; --json emits an array.
184
+ const jsonResults = [];
185
+ let failures = 0;
186
+ for (const [index, target] of targets.entries()) {
187
+ if (!ctx.json) {
188
+ ctx.err(`\n=== [${index + 1}/${targets.length}] Deploying ${target.slug} ===\n`);
189
+ }
190
+ const before = jsonResults.length;
191
+ const code = await deployOne(ctx, deployOptions, target, {
192
+ jsonCollect: ctx.json ? jsonResults : undefined,
193
+ });
194
+ if (code !== 0) {
195
+ failures += 1;
196
+ if (ctx.json && jsonResults.length === before) {
197
+ jsonResults.push({ slug: target.slug, error: "deploy failed" });
198
+ }
199
+ }
200
+ }
201
+ if (ctx.json) {
202
+ ctx.out(`${JSON.stringify(jsonResults, null, 2)}\n`);
203
+ }
204
+ else if (failures > 0) {
205
+ ctx.err(`\n${failures} of ${targets.length} deploy(s) failed.\n`);
206
+ }
207
+ else {
208
+ ctx.err(`\nDeployed ${targets.length} agents.\n`);
209
+ }
210
+ return failures === 0 ? 0 : 1;
211
+ }
212
+ /**
213
+ * Resolve which agent directory(ies) to deploy from `--dir` / `--slug` /
214
+ * `--all`, with an interactive picker when a multi-agent parent is on a TTY.
215
+ */
216
+ async function resolveDeployTargets(options, ctx) {
217
+ let dir = resolve(options.dir ?? ".");
218
+ // A repo-root deploy commonly names the local agent through --path. Use
219
+ // that project for manifest discovery unless --dir or --all chose a scope.
220
+ if (options.dir === undefined && options.path !== undefined && options.all !== true) {
221
+ const localSourceDir = resolve(options.path);
222
+ if (await isAgentProjectDir(localSourceDir)) {
223
+ dir = localSourceDir;
224
+ }
225
+ }
226
+ if (options.slug !== undefined) {
227
+ const slugError = validateDeploymentSlug(options.slug);
228
+ if (slugError !== undefined) {
229
+ ctx.err(`${slugError}\n`);
230
+ return 1;
231
+ }
232
+ }
233
+ if (options.all === true && options.slug !== undefined) {
234
+ ctx.err("Pass either --slug or --all, not both.\n");
235
+ return 1;
236
+ }
237
+ if (await isAgentProjectDir(dir)) {
238
+ if (options.all === true) {
239
+ ctx.err(`--all requires a multi-agent parent directory (several child agents under --dir); ${dir} is a single agent project.\n`);
240
+ return 1;
241
+ }
242
+ let slug;
243
+ if (options.slug !== undefined) {
244
+ slug = options.slug;
245
+ }
246
+ else {
247
+ const derived = slugFromDirectoryName(basename(dir));
248
+ if (derived === undefined) {
249
+ ctx.err(`Could not derive a deployment slug from the directory name ${JSON.stringify(basename(dir))}; pass --slug.\n`);
250
+ return 1;
251
+ }
252
+ slug = derived;
253
+ if (!ctx.json) {
254
+ ctx.err(`Deploying as "${slug}" (from the directory name).\n`);
255
+ }
256
+ }
257
+ return [{ slug, dir }];
258
+ }
259
+ let children;
260
+ try {
261
+ children = await listChildAgentDirs(dir);
262
+ }
263
+ catch (error) {
264
+ ctx.err(`${describeError(error)}\n`);
265
+ return 1;
266
+ }
267
+ // Deploy slugs are lowercase-only; normalize directory names the same way
268
+ // single-agent deploy does so MixedCase child dirs still deploy.
269
+ children = children.flatMap((child) => {
270
+ const slug = slugFromDirectoryName(basename(child.dir));
271
+ if (slug === undefined) {
272
+ return [];
273
+ }
274
+ return [{ slug, dir: child.dir }];
275
+ });
276
+ if (children.length === 0) {
277
+ if (options.all === true) {
278
+ ctx.err(`--all requires child agent projects under --dir; none found in ${dir}.\n`);
279
+ return 1;
280
+ }
281
+ // Bare-slug deploy against a non-agent directory (still requires --repo).
282
+ let slug;
283
+ if (options.slug !== undefined) {
284
+ slug = options.slug;
285
+ }
286
+ else {
287
+ const derived = slugFromDirectoryName(basename(dir));
288
+ if (derived === undefined) {
289
+ ctx.err(`No agent projects under ${dir}, and could not derive a slug from ${JSON.stringify(basename(dir))}; pass --slug or --dir <agent>.\n`);
290
+ return 1;
291
+ }
292
+ slug = derived;
293
+ if (!ctx.json) {
294
+ ctx.err(`Deploying as "${slug}" (no agent project at ${dir}).\n`);
295
+ }
296
+ }
297
+ return [{ slug, dir }];
298
+ }
299
+ if (children.length === 1) {
300
+ const only = children[0];
301
+ if (options.all === true) {
302
+ // One child is fine for --all (degenerate multi-agent parent).
303
+ }
304
+ else if (options.slug !== undefined && options.slug.toLowerCase() !== only.slug) {
305
+ ctx.err(`No agent "${options.slug}" under ${dir}; found "${only.slug}".\n`);
306
+ return 1;
307
+ }
308
+ if (!ctx.json) {
309
+ ctx.err(`Deploying "${only.slug}" (only agent under ${basename(dir)}).\n`);
310
+ }
311
+ return [only];
312
+ }
313
+ // Multiple children.
314
+ if (options.all === true) {
315
+ return [...children];
316
+ }
317
+ if (options.slug !== undefined) {
318
+ const wanted = options.slug.toLowerCase();
319
+ const match = children.find((child) => child.slug === wanted);
320
+ if (match === undefined) {
321
+ ctx.err(`No agent "${options.slug}" under ${dir}.\n` +
322
+ formatAgentList(children) +
323
+ `Pass --slug <name> or --all.\n`);
324
+ return 1;
325
+ }
326
+ return [match];
327
+ }
328
+ // An all-v2 parent needs no picker or --all. A v1 child, or a child that
329
+ // fails to load, keeps the interactive picker below.
330
+ if (await allChildrenAreV2(children)) {
331
+ return [...children];
332
+ }
333
+ const chooser = options.chooseTargets ??
334
+ ((agents) => promptChooseDeployTargets(agents, {
335
+ err: ctx.err,
336
+ stdin: options.stdin ?? process.stdin,
337
+ interactive: ctx.json !== true &&
338
+ (options.stdin ?? process.stdin).isTTY === true &&
339
+ process.stderr.isTTY === true,
340
+ }));
341
+ const chosen = await chooser(children);
342
+ if (chosen === null) {
343
+ ctx.err("Deploy cancelled.\n");
344
+ return 1;
345
+ }
346
+ if (chosen.length === 0) {
347
+ ctx.err(`Multiple agents under ${dir}:\n` +
348
+ formatAgentList(children) +
349
+ `Pass --slug <name> or --all (or re-run on a TTY to pick interactively).\n`);
350
+ return 1;
351
+ }
352
+ return chosen;
353
+ }
354
+ function deployingAllAgentsLine(options, targets) {
355
+ return `Deploying all ${targets.length} agents under ${basename(resolve(options.dir ?? "."))}: ${targets.map((target) => target.slug).join(", ")}.\n`;
356
+ }
357
+ function deployingAsOneApplicationLine(options, targets) {
358
+ return `Deploying all ${targets.length} v2 agents under ${basename(resolve(options.dir ?? "."))} as one application (pass --slug <name> to deploy a single agent standalone).\n`;
359
+ }
360
+ function severalAgentsDeployAloneText(options, targets) {
361
+ const flags = copiedDeployFlags(options);
362
+ const commands = targets.map((target) => ` ${CLI} deploy --dir ${quoteShell(relativeDeployDir(target.dir))}${flags}`);
363
+ return `${SEVERAL_AGENTS_DEPLOY_ALONE}\n${commands.join("\n")}\n`;
364
+ }
365
+ function copiedDeployFlags(options) {
366
+ const parts = [];
367
+ if (options.team !== undefined) {
368
+ parts.push(`--team ${quoteShell(options.team)}`);
369
+ }
370
+ if (options.repo !== undefined) {
371
+ parts.push(`--repo ${quoteShell(options.repo)}`);
372
+ }
373
+ if (options.ref !== undefined) {
374
+ parts.push(`--ref ${quoteShell(options.ref)}`);
375
+ }
376
+ for (const repo of options.cursorEventsRepos ?? []) {
377
+ parts.push(`--cursor-events-repo ${quoteShell(repo)}`);
378
+ }
379
+ for (const domain of options.allowDomains ?? []) {
380
+ parts.push(`--allow-domain ${quoteShell(domain)}`);
381
+ }
382
+ return parts.length === 0 ? "" : ` ${parts.join(" ")}`;
383
+ }
384
+ function relativeDeployDir(dir) {
385
+ const rel = relative(process.cwd(), dir);
386
+ return rel === "" ? "." : rel;
387
+ }
388
+ function quoteShell(value) {
389
+ if (/^[A-Za-z0-9_./:-]+$/.test(value)) {
390
+ return value;
391
+ }
392
+ return `'${value.replaceAll("'", "'\\''")}'`;
393
+ }
394
+ function formatAgentList(agents) {
395
+ return agents.map((agent, i) => ` ${i + 1}) ${agent.slug}\n`).join("");
396
+ }
397
+ /**
398
+ * True when every child agent project loads and declares
399
+ * `architecture: "v2"`. Broken projects count as not-v2 so target
400
+ * resolution falls back to the picker instead of failing the whole deploy
401
+ * on a child the user might not even select.
402
+ */
403
+ async function allChildrenAreV2(children) {
404
+ for (const child of children) {
405
+ try {
406
+ if ((await readDeployManifest(child.dir)).architecture !== "v2") {
407
+ return false;
408
+ }
409
+ }
410
+ catch {
411
+ return false;
412
+ }
413
+ }
414
+ return true;
415
+ }
416
+ /**
417
+ * TTY picker for multi-agent parents. Non-interactive callers get `[]`
418
+ * so {@link resolveDeployTargets} can print the --slug/--all hint.
419
+ */
420
+ export async function promptChooseDeployTargets(agents, options) {
421
+ options.err(`Multiple agents (${agents.length}):\n` + formatAgentList(agents) + ` a) all\n`);
422
+ if (!options.interactive) {
423
+ return [];
424
+ }
425
+ options.err('Deploy which? Enter a number, slug, "all", or "q" to cancel: ');
426
+ const readLine = createLineReader(options.stdin);
427
+ // createLineReader pauses until data; ensure stdin is flowing on a TTY.
428
+ options.stdin.resume?.();
429
+ const answer = (await readLine())?.trim().toLowerCase();
430
+ if (answer === undefined || answer === "q" || answer === "quit") {
431
+ return null;
432
+ }
433
+ if (answer === "a" || answer === "all" || answer === "*") {
434
+ return [...agents];
435
+ }
436
+ const asIndex = Number.parseInt(answer, 10);
437
+ if (!Number.isNaN(asIndex) &&
438
+ String(asIndex) === answer &&
439
+ asIndex >= 1 &&
440
+ asIndex <= agents.length) {
441
+ return [agents[asIndex - 1]];
442
+ }
443
+ const bySlug = agents.find((agent) => agent.slug.toLowerCase() === answer);
444
+ if (bySlug !== undefined) {
445
+ return [bySlug];
446
+ }
447
+ options.err(`Unrecognized choice ${JSON.stringify(answer)} — expected 1–${agents.length}, a slug, "all", or "q". Aborting.\n`);
448
+ return null;
449
+ }
450
+ const MISSING_DEPLOY_REPO_HINT = `Could not resolve an https:// git repository URL for this deploy.\n` +
451
+ ` Pass --repo https://github.com/<owner>/<repo>, https://gitlab.com/<group>/<project>, or an Origin repository URL (inferred from origin when possible).\n`;
452
+ async function deployOne(ctx, options, target, extras) {
453
+ const { dir, slug } = target;
454
+ // Fill --repo/--ref/--path from the local git checkout when omitted so
455
+ // `agent-sdk deploy` inside an agent directory is enough. Only probe git
456
+ // for real agent projects (avoids ambient monorepo remotes when someone
457
+ // deploys a bare --slug). Explicit flags always win.
458
+ const isAgent = await isAgentProjectDir(dir);
459
+ const needsGitInference = isAgent &&
460
+ (options.repo === undefined || options.ref === undefined || options.path === undefined);
461
+ const inferred = needsGitInference
462
+ ? await inferDeployGitSource(dir, {
463
+ ...(options.git === undefined ? {} : { git: options.git }),
464
+ })
465
+ : {};
466
+ const gitRepoUrl = options.repo ?? inferred.gitRepoUrl;
467
+ const gitRef = options.ref ?? inferred.gitRef;
468
+ const agentPath = options.path ?? inferred.agentPath;
469
+ if (gitRepoUrl !== undefined && !gitRepoUrl.startsWith("https://")) {
470
+ ctx.err(`Invalid --repo: ${gitRepoUrl} (expected an https:// git repository URL)\n`);
471
+ return 1;
472
+ }
473
+ if (gitRepoUrl === undefined) {
474
+ ctx.err(MISSING_DEPLOY_REPO_HINT);
475
+ return 1;
476
+ }
477
+ for (const repo of options.cursorEventsRepos ?? []) {
478
+ if (!isValidCursorEventRepo(repo)) {
479
+ ctx.err(`Invalid --cursor-events-repo: ${repo} (expected owner/name, gitlab.com/<group>/<project>, or bitbucket.org/<workspace>/<repo>)\n`);
480
+ return 1;
481
+ }
482
+ }
483
+ if (!ctx.json && gitRepoUrl !== undefined) {
484
+ const inferredBits = [];
485
+ if (options.repo === undefined && inferred.gitRepoUrl !== undefined) {
486
+ inferredBits.push("repo");
487
+ }
488
+ if (options.ref === undefined && inferred.gitRef !== undefined) {
489
+ inferredBits.push("ref");
490
+ }
491
+ if (options.path === undefined && inferred.agentPath !== undefined) {
492
+ inferredBits.push("path");
493
+ }
494
+ ctx.err(` source: ${gitRepoUrl}${gitRef === undefined ? "" : ` @ ${gitRef}`}\n` +
495
+ (agentPath === undefined ? "" : ` path: ${agentPath}\n`) +
496
+ (inferredBits.length === 0
497
+ ? ""
498
+ : ` (inferred ${inferredBits.join(", ")} from git; pass --repo/--ref/--path to override)\n`));
499
+ }
500
+ // The package manifest (`defineAgent({ hosting })`) is the source of
501
+ // truth for egress domains and expected secret names; flags override or
502
+ // augment it. Directories without an agent project have no manifest. The same load supplies the
503
+ // cursorAccount connection refs for the post-deploy connector auth and
504
+ // the channels declared public via `publicEndpoint()`.
505
+ const manifest = isAgent ? await readDeployManifest(dir) : undefined;
506
+ const hosting = manifest?.hosting;
507
+ const egressAllowedDomains = [
508
+ ...new Set([...(hosting?.egressDomains ?? []), ...(options.allowDomains ?? [])]),
509
+ ];
510
+ const publicRoutePaths = (manifest?.publicChannelIds ?? []).map((channelId) => `/v1/channels/${channelId}`);
511
+ if (!ctx.json && manifest?.httpChannelPublicEndpoint === true) {
512
+ ctx.err(`warning: publicEndpoint() on the built-in HTTP channel has no effect on hosting — only custom channels (/v1/channels/…) can be public; the session API always requires the alias token.\n`);
513
+ }
514
+ if (!ctx.json && publicRoutePaths.length > 0 && manifest?.architecture !== "v2") {
515
+ // Security-relevant surface change: say exactly what will be reachable
516
+ // without the alias token before the deploy is accepted. v2 registers
517
+ // these routes only after bake, so a relative path here would not be a
518
+ // live webhook URL — the running status prints the absolute one.
519
+ ctx.err(` public: ${publicRoutePaths.join(", ")} (served WITHOUT the alias token — these channels authenticate requests themselves)\n`);
520
+ }
521
+ const extensionEgress = manifest?.extensionEgress ?? [];
522
+ if (!ctx.json && extensionEgress.length > 0) {
523
+ // Mounted packages widen the pod's egress without an agent.ts edit; name
524
+ // each one before the deploy is accepted.
525
+ ctx.err(` egress from extensions: ${extensionEgress
526
+ .map((entry) => `${entry.extension} (${entry.egressDomains.join(", ")})`)
527
+ .join("; ")}\n`);
528
+ }
529
+ const deadSecretChannels = manifest?.publicChannelIdsWithDeadSecretPolicies ?? [];
530
+ if (!ctx.json && deadSecretChannels.length > 0) {
531
+ ctx.err(`warning: ${deadSecretChannels
532
+ .map((channelId) => `/v1/channels/${channelId}`)
533
+ .join(", ")}: publicEndpoint() sits beside sharedSecretAuth()/hmacSignatureAuth() — auth chains are any-of, so every request is admitted and those secret policies never run. Drop publicEndpoint() to enforce them, or drop them to make the intent explicit.\n`);
534
+ }
535
+ if (manifest?.architecture === "v2") {
536
+ if (!ctx.json) {
537
+ ctx.err(` architecture: v2${manifest.persistent ? " (persistent)" : ""}${manifest.image === undefined ? "" : `\n image: ${manifest.image}`}\n`);
538
+ }
539
+ return deployOneAgentsdk(ctx, extras, {
540
+ persistent: manifest.persistent,
541
+ image: manifest.image,
542
+ slug,
543
+ gitRepoUrl,
544
+ gitRef,
545
+ agentPath,
546
+ repositories: options.cursorEventsRepos,
547
+ hasScmChannels: manifest.hasScmChannels,
548
+ declaredSecretNames: declaredSecretNames([manifest]),
549
+ hasDeploymentsChannels: manifest.hasDeploymentsChannels,
550
+ multiTenant: options.multiTenant === true,
551
+ template: readDeployTemplate(dir),
552
+ });
553
+ }
554
+ if (options.multiTenant === true) {
555
+ ctx.err("--multi-tenant is only valid for architecture: v2 deploys (Cursor-managed products).\n");
556
+ return 1;
557
+ }
558
+ // Today's only source shape: the control plane builds from a git ref.
559
+ // See DeploySource for the artifact seam.
560
+ const source = {
561
+ kind: "git-ref",
562
+ gitRepoUrl,
563
+ ...(gitRef === undefined ? {} : { gitRef }),
564
+ ...(agentPath === undefined ? {} : { agentPath }),
565
+ ...(options.cursorEventsRepos === undefined || options.cursorEventsRepos.length === 0
566
+ ? {}
567
+ : { cursorEventRepos: options.cursorEventsRepos }),
568
+ ...(egressAllowedDomains.length === 0 ? {} : { egressAllowedDomains }),
569
+ publicRoutePaths: publicRoutePaths.length === 0 ? undefined : publicRoutePaths,
570
+ // Deliberately NO manifest here: the control plane captures it from the
571
+ // provisioned engine (`GET /v1/manifest` after the health probe), which
572
+ // is the single write path for deploy manifests. `july manifest` remains
573
+ // available for local visibility only.
574
+ };
575
+ let accepted;
576
+ try {
577
+ accepted = await ctx.client.deploy({
578
+ teamId: ctx.teamId,
579
+ slug,
580
+ source,
581
+ template: readDeployTemplate(dir),
582
+ });
583
+ }
584
+ catch (error) {
585
+ return renderApiError(error, ctx.err);
586
+ }
587
+ const aliasUrl = ctx.client.aliasUrl(accepted.engineAlias);
588
+ if (!ctx.json && accepted.aliasToken !== undefined) {
589
+ ctx.out(aliasTokenBlock(accepted.aliasToken));
590
+ }
591
+ if (ctx.noWait) {
592
+ if (extras?.jsonCollect !== undefined) {
593
+ extras.jsonCollect.push(accepted);
594
+ }
595
+ else if (ctx.json) {
596
+ ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
597
+ }
598
+ else {
599
+ ctx.out(`Deploy accepted: ${slug} (team ${ctx.teamId}, generation ${accepted.generation}, ${accepted.deploymentKind})\n` +
600
+ ` alias: ${aliasUrl}\n` +
601
+ `Check progress with \`${CLI} deployment ${slug} --team ${ctx.teamId}\`.\n`);
602
+ }
603
+ return 0;
604
+ }
605
+ let detail;
606
+ try {
607
+ detail = await pollUntil(ctx, slug, TERMINAL_DEPLOY_STATUSES, () => ctx.client.getDeployment({ teamId: ctx.teamId, slug }));
608
+ }
609
+ catch (error) {
610
+ return renderApiError(error, ctx.err);
611
+ }
612
+ warnMissingSecrets(ctx, slug, declaredSecretNames([manifest]), detail.secretNames);
613
+ const payload = accepted.aliasToken === undefined ? detail : { ...detail, aliasToken: accepted.aliasToken };
614
+ if (extras?.jsonCollect !== undefined) {
615
+ extras.jsonCollect.push(payload);
616
+ return detail.status === "running" ? 0 : 1;
617
+ }
618
+ if (ctx.json) {
619
+ ctx.out(`${JSON.stringify(payload, null, 2)}\n`);
620
+ return detail.status === "running" ? 0 : 1;
621
+ }
622
+ if (detail.status !== "running") {
623
+ ctx.err(`Deployment ${slug} ended ${detail.status}${deployFailureDetail(detail.lastError)}\n`);
624
+ return 1;
625
+ }
626
+ const deployedPublicRoutes = detail.publicRoutePaths ?? [];
627
+ ctx.out(`Deployed ${slug} (team ${ctx.teamId})\n` +
628
+ ` status: running\n` +
629
+ ` generation: ${detail.generation}\n` +
630
+ ` kind: ${detail.deploymentKind}\n` +
631
+ ` alias: ${aliasUrl}\n` +
632
+ ` playground: ${aliasUrl}/playground (sign in with the alias token)\n` +
633
+ ` open: ${CLI} playground --prod --slug ${slug} --team ${ctx.teamId}\n` +
634
+ // Paste-ready webhook URLs: these subtrees skip the alias token, so
635
+ // the channel handler must verify deliveries (webhook signatures).
636
+ deployedPublicRoutes
637
+ .map((path) => ` public: ${aliasUrl}${path} (no alias token)\n`)
638
+ .join(""));
639
+ await runPostDeployConnectorAuth(ctx, options, {
640
+ slug,
641
+ connections: manifest?.cursorAccountConnections ?? [],
642
+ serviceAccountId: deploymentServiceAccountId(detail),
643
+ });
644
+ return 0;
645
+ }
646
+ /**
647
+ * Multi-agent parent whose children all declare `architecture: "v2"`:
648
+ * deploy ONE application whose release carries a component per child. The
649
+ * application slug derives from the parent directory name; each component
650
+ * key is the child's slug and its path is the child directory relative to
651
+ * the repo root (a shared --path names the parent's directory in the repo).
652
+ */
653
+ async function deployAgentsdkApplication(ctx, options, targets, declarations) {
654
+ const parentDir = resolve(options.dir ?? ".");
655
+ const slug = slugFromDirectoryName(basename(parentDir));
656
+ if (slug === undefined) {
657
+ ctx.err(`Could not derive an application slug from the parent directory name ${JSON.stringify(basename(parentDir))} — rename it (deploy slugs use lowercase letters, digits, '-' or '_').\n`);
658
+ return 1;
659
+ }
660
+ const needsGitInference = options.repo === undefined || options.ref === undefined || options.path === undefined;
661
+ const inferred = needsGitInference
662
+ ? await inferDeployGitSource(parentDir, {
663
+ ...(options.git === undefined ? {} : { git: options.git }),
664
+ })
665
+ : {};
666
+ const gitRepoUrl = options.repo ?? inferred.gitRepoUrl;
667
+ const gitRef = options.ref ?? inferred.gitRef;
668
+ const parentPath = options.path ?? inferred.agentPath;
669
+ if (gitRepoUrl !== undefined && !gitRepoUrl.startsWith("https://")) {
670
+ ctx.err(`Invalid --repo: ${gitRepoUrl} (expected an https:// git repository URL)\n`);
671
+ return 1;
672
+ }
673
+ if (gitRepoUrl === undefined) {
674
+ ctx.err(MISSING_DEPLOY_REPO_HINT);
675
+ return 1;
676
+ }
677
+ for (const repo of options.cursorEventsRepos ?? []) {
678
+ if (!isValidCursorEventRepo(repo)) {
679
+ ctx.err(`Invalid --cursor-events-repo: ${repo} (expected owner/name, gitlab.com/<group>/<project>, or bitbucket.org/<workspace>/<repo>)\n`);
680
+ return 1;
681
+ }
682
+ }
683
+ const components = targets.map((target) => ({
684
+ componentKey: target.slug,
685
+ agentPath: [parentPath, basename(target.dir)]
686
+ .filter((part) => part !== undefined && part !== "")
687
+ .join("/"),
688
+ persistent: declarations.componentPersistent[target.slug] === true,
689
+ image: declarations.componentImage[target.slug],
690
+ }));
691
+ if (!ctx.json) {
692
+ ctx.err(`Deploying "${slug}" as one v2 application with ${targets.length} components (slug from the parent directory name).\n` +
693
+ ` architecture: v2\n` +
694
+ ` source: ${gitRepoUrl}${gitRef === undefined ? "" : ` @ ${gitRef}`}\n` +
695
+ components
696
+ .map((component) => ` component: ${component.componentKey} (${component.agentPath ?? "."})${component.persistent ? " persistent" : ""}${component.image === undefined ? "" : ` image ${component.image}`}\n`)
697
+ .join(""));
698
+ }
699
+ return deployOneAgentsdk(ctx, undefined, {
700
+ // Multi-component: the flag travels on each component instead.
701
+ persistent: false,
702
+ slug,
703
+ gitRepoUrl,
704
+ gitRef,
705
+ agentPath: undefined,
706
+ components,
707
+ repositories: options.cursorEventsRepos,
708
+ hasScmChannels: declarations.hasScmChannels,
709
+ declaredSecretNames: declarations.declaredSecretNames,
710
+ hasDeploymentsChannels: declarations.hasDeploymentsChannels,
711
+ multiTenant: options.multiTenant === true,
712
+ template: readDeployTemplate(parentDir),
713
+ });
714
+ }
715
+ /**
716
+ * `architecture: "v2"` deploy: POST `/internal/agentsdk/deployments` and
717
+ * poll the matching GET.
718
+ */
719
+ async function deployOneAgentsdk(ctx, extras, args) {
720
+ const { slug } = args;
721
+ const componentsLine = args.components === undefined
722
+ ? ""
723
+ : ` components: ${args.components.map((component) => component.componentKey).join(", ")}\n`;
724
+ if (args.multiTenant && !ctx.json) {
725
+ ctx.err(" multi-tenant: existing product\n");
726
+ }
727
+ let accepted;
728
+ try {
729
+ accepted = await ctx.client.deployAgentkit({
730
+ teamId: ctx.teamId,
731
+ slug,
732
+ gitRepoUrl: args.gitRepoUrl,
733
+ gitRef: args.gitRef,
734
+ agentPath: args.agentPath,
735
+ components: args.components,
736
+ repositories: args.repositories,
737
+ ...(args.multiTenant ? { multiTenant: true } : {}),
738
+ persistent: args.persistent,
739
+ image: args.image,
740
+ template: args.template,
741
+ });
742
+ }
743
+ catch (error) {
744
+ return renderApiError(error, ctx.err, {
745
+ multiTenant: args.multiTenant,
746
+ teamId: ctx.teamId,
747
+ });
748
+ }
749
+ if (!ctx.json && accepted.aliasToken !== undefined) {
750
+ ctx.out(aliasTokenBlock(accepted.aliasToken));
751
+ }
752
+ if (ctx.noWait) {
753
+ if (extras?.jsonCollect !== undefined) {
754
+ extras.jsonCollect.push(accepted);
755
+ }
756
+ else if (ctx.json) {
757
+ ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
758
+ }
759
+ else {
760
+ ctx.out(`Deploy accepted: ${slug} (team ${ctx.teamId}, v2)\n` +
761
+ ` application: ${accepted.applicationId}\n` +
762
+ ` release: ${accepted.releaseId}\n` +
763
+ ` alias: ${ctx.client.aliasUrl(accepted.engineAlias)}\n` +
764
+ componentsLine);
765
+ }
766
+ return 0;
767
+ }
768
+ let detail;
769
+ try {
770
+ detail = await pollUntil(ctx, slug, TERMINAL_AGENTKIT_DEPLOY_STATUSES, () => ctx.client.getAgentkitDeploy({ teamId: ctx.teamId, slug }));
771
+ }
772
+ catch (error) {
773
+ return renderApiError(error, ctx.err);
774
+ }
775
+ const payload = { ...detail, aliasToken: accepted.aliasToken };
776
+ if (extras?.jsonCollect !== undefined) {
777
+ extras.jsonCollect.push(payload);
778
+ return detail.status === "running" ? 0 : 1;
779
+ }
780
+ if (ctx.json) {
781
+ ctx.out(`${JSON.stringify(payload, null, 2)}\n`);
782
+ return detail.status === "running" ? 0 : 1;
783
+ }
784
+ if (detail.status !== "running") {
785
+ ctx.err(`Deployment ${slug} ended ${detail.status}${deployFailureDetail(detail.lastError)}\n`);
786
+ return 1;
787
+ }
788
+ warnMissingSecrets(ctx, slug, args.declaredSecretNames, detail.secretNames);
789
+ const watchesRepositories = args.hasScmChannels || args.hasDeploymentsChannels === true;
790
+ ctx.out(`Deployed ${slug} (team ${ctx.teamId})\n` +
791
+ ` status: running\n` +
792
+ ` architecture: v2\n` +
793
+ ` application: ${detail.applicationId}\n` +
794
+ ` release: ${detail.releaseId}\n` +
795
+ ` alias: ${ctx.client.aliasUrl(accepted.engineAlias)}\n` +
796
+ (args.components === undefined
797
+ ? ""
798
+ : ` components: ${args.components
799
+ .map((component) => component.componentKey)
800
+ .join(", ")}\n`) +
801
+ (detail.repositories === undefined || !watchesRepositories
802
+ ? ""
803
+ : ` watching: ${detail.repositories.length === 0 ? "(nothing)" : detail.repositories.join(", ")}\n`) +
804
+ livePublicWebhookLines(ctx, detail));
805
+ // No --cursor-events-repo hint: that flag fails closed without the webhook.
806
+ if (detail.unboundInferredRepository !== undefined) {
807
+ ctx.err(`warning: ${slug} is not watching ${detail.unboundInferredRepository}.\n` +
808
+ (detail.repositories !== undefined && detail.repositories.length > 0
809
+ ? ` Kept the existing scopes: ${detail.repositories.join(", ")}.\n`
810
+ : ` The deployment watches nothing.\n`));
811
+ return 0;
812
+ }
813
+ // An agent with GitHub/GitLab/Origin/deployments channels bound to no
814
+ // repository scope gets no deliveries at all (deployments channels receive
815
+ // the watched repos' deployment events), which is otherwise invisible here.
816
+ if (watchesRepositories && detail.repositories?.length === 0) {
817
+ ctx.err(`warning: ${slug} watches no repositories, so its GitHub/GitLab/Origin/deployments channels receive no events.\n` +
818
+ ` Redeploy with --cursor-events-repo <owner>/<name> or gitlab.com/<group>/<project> to set the scope.\n`);
819
+ }
820
+ return 0;
821
+ }
822
+ /**
823
+ * Post-deploy connector authorization for `cursorAccount` connections: the
824
+ * agent's connectors execute with tokens owned by the deployment's service
825
+ * account, which start out unauthorized. On a TTY this runs the dashboard's
826
+ * Authenticate flow inline (browser OAuth per connector, already-authorized
827
+ * ones skipped); otherwise it reports status only. Never affects the deploy
828
+ * outcome — anything left unauthorized just gets a playground-page pointer.
829
+ */
830
+ async function runPostDeployConnectorAuth(ctx, options, args) {
831
+ if (args.connections.length === 0) {
832
+ return;
833
+ }
834
+ const { serviceAccountId } = args;
835
+ if (serviceAccountId === undefined) {
836
+ ctx.err(`warning: this agent uses Cursor account connectors, but the deployment has no service account; redeploy to mint one.\n`);
837
+ return;
838
+ }
839
+ const backendClient = new CursorBackendClient({
840
+ backendUrl: ctx.backendUrl,
841
+ apiKey: ctx.apiKey,
842
+ fetchImpl: options.fetchImpl,
843
+ });
844
+ const interactive = options.openBrowserImpl !== undefined ||
845
+ (process.stdout.isTTY === true && process.stdin.isTTY === true);
846
+ let anyUnauthorized = false;
847
+ for (const ref of args.connections) {
848
+ ctx.out(`\nThis agent uses Cursor account connectors (connection "${ref.name}"${ref.servers === undefined || ref.servers.length === 0 ? "" : `: ${ref.servers.join(", ")}`}).\n`);
849
+ try {
850
+ const result = await authorizeCursorAccountConnectors({
851
+ backendClient,
852
+ teamId: ctx.teamId,
853
+ slug: args.slug,
854
+ serviceAccountId,
855
+ connectionName: ref.name,
856
+ servers: ref.servers,
857
+ interactive,
858
+ out: ctx.out,
859
+ err: ctx.err,
860
+ openBrowserImpl: options.openBrowserImpl,
861
+ sleep: options.sleepImpl,
862
+ pollIntervalMs: options.connectorPollIntervalMs,
863
+ pollTimeoutMs: options.connectorPollTimeoutMs,
864
+ });
865
+ if (result.pending.length > 0 || result.errored.length > 0) {
866
+ anyUnauthorized = true;
867
+ if (result.pending.length > 0) {
868
+ ctx.out(`Connectors not authorized yet: ${result.pending.join(", ")}.\n`);
869
+ }
870
+ }
871
+ }
872
+ catch (error) {
873
+ anyUnauthorized = true;
874
+ ctx.err(`warning: could not check connector authorization for "${ref.name}": ${describeError(error)}\n`);
875
+ }
876
+ }
877
+ if (anyUnauthorized) {
878
+ ctx.out(`You can authorize connectors at the playground page (cursor.com dashboard → Deployed Agents → ${args.slug}) or with \`${CLI} mcp oauth <connection>\`.\n`);
879
+ }
880
+ }
881
+ /**
882
+ * Read the deploy-relevant bits of the project manifest at `dir` in one
883
+ * load: the `hosting` block, the agent's cursorAccount connections, and the
884
+ * channels declared public via `publicEndpoint()`.
885
+ */
886
+ async function readDeployManifest(dir) {
887
+ const project = await loadAgentProject(dir);
888
+ // Fail here, before anything is dispatched: a project with error
889
+ // diagnostics (e.g. agent/storage.ts on architecture v2) would only be
890
+ // refused later by `serve` inside the hosted build, wasting a bake.
891
+ if (hasErrorDiagnostics(project)) {
892
+ throw new Error(`Refusing to deploy ${project.name} — it has errors:\n${formatDiagnostics(project.diagnostics.filter((d) => d.severity === "error"))}`);
893
+ }
894
+ return {
895
+ hosting: project.agent.hosting,
896
+ architecture: project.agent.architecture,
897
+ persistent: project.agent.persistent === true,
898
+ image: project.agent.hosting?.image,
899
+ cursorAccountConnections: project.agent.connections.flatMap((connection) => isCursorAccountTransport(connection.transport)
900
+ ? [{ name: connection.name, servers: connection.transport.servers }]
901
+ : []),
902
+ publicChannelIds: project.channels
903
+ .filter((channel) => (channel.definition.auth ?? []).some(isPublicEndpointPolicy))
904
+ .map((channel) => channel.id),
905
+ publicChannelIdsWithDeadSecretPolicies: project.channels
906
+ .filter((channel) => {
907
+ const auth = channel.definition.auth ?? [];
908
+ return (auth.some(isPublicEndpointPolicy) &&
909
+ auth.some((policy) => {
910
+ const kind = catchAuthDeclaration(policy)?.kind;
911
+ return kind !== undefined && kind !== "public";
912
+ }));
913
+ })
914
+ .map((channel) => channel.id),
915
+ httpChannelPublicEndpoint: (project.httpChannel.auth ?? []).some(isPublicEndpointPolicy),
916
+ catchSecretNames: [
917
+ ...new Set(project.channels.flatMap((channel) => channelCatchSecretNames(channel.definition))),
918
+ ],
919
+ credentialSecretNames: [
920
+ ...new Set(project.channels.flatMap((channel) => channelCredentialSecretNames(channel.definition))),
921
+ ],
922
+ secretAlternatives: project.channels.flatMap((channel) => channelSecretAlternatives(channel.definition)),
923
+ hasScmChannels: project.channels.some((channel) => {
924
+ const kind = channel.definition.meta?.kind;
925
+ return kind === "github" || kind === "gitlab" || kind === "origin";
926
+ }),
927
+ hasDeploymentsChannels: project.channels.some((channel) => channel.definition.meta?.kind === "deployments"),
928
+ extensionEgress: (project.agent.extensions ?? []).flatMap((extension) => {
929
+ const egressDomains = extension.hosting?.egressDomains ?? [];
930
+ return egressDomains.length === 0 ? [] : [{ extension: extension.name, egressDomains }];
931
+ }),
932
+ };
933
+ }
934
+ /**
935
+ * Every secret name the deployment is expected to carry: the authored
936
+ * `hosting.secretNames` plus the names the control plane verifies caught
937
+ * requests with. Empty when the manifests declare none.
938
+ */
939
+ function declaredSecretNames(manifests) {
940
+ return {
941
+ names: [
942
+ ...new Set(manifests.flatMap((manifest) => manifest === undefined
943
+ ? []
944
+ : [
945
+ ...(manifest.hosting?.secretNames ?? []),
946
+ ...manifest.catchSecretNames,
947
+ ...manifest.credentialSecretNames,
948
+ ])),
949
+ ],
950
+ alternatives: manifests.flatMap((manifest) => manifest?.secretAlternatives ?? []),
951
+ };
952
+ }
953
+ /**
954
+ * Friendly post-deploy nudge: the manifest declares secrets the agent
955
+ * expects, but the deployment does not have them all set yet.
956
+ */
957
+ function warnMissingSecrets(ctx, slug, declared, set) {
958
+ for (const group of unmetSecretAlternatives(declared?.alternatives ?? [], set)) {
959
+ ctx.err(`warning: none of ${group.names.join(", ")} is set on ${slug}: ${group.unsetEffect}\n` +
960
+ ` set one with \`${CLI} secrets set ${slug} ${group.names[0]}\`\n`);
961
+ }
962
+ if (declared === undefined || declared.names.length === 0) {
963
+ return;
964
+ }
965
+ const setNames = new Set(set ?? []);
966
+ // Platform-managed names (CURSOR_*, hosted storage) are injected by the
967
+ // control plane and never appear in secrets list — do not warn on them.
968
+ const missing = declared.names.filter((name) => !setNames.has(name) && !isReservedSecretName(name));
969
+ if (missing.length === 0) {
970
+ return;
971
+ }
972
+ ctx.err(`warning: secrets declared in the agent manifest but not set on ${slug}: ${missing.join(", ")}\n` +
973
+ ` set them with \`${CLI} secrets set ${slug} ${missing.join(" ")}\`\n`);
974
+ }
975
+ // ============================================================================
976
+ // deployments (list)
977
+ // ============================================================================
978
+ export async function cmdDeployments(options) {
979
+ const ctx = await prepare(options);
980
+ if (typeof ctx === "number") {
981
+ return ctx;
982
+ }
983
+ let deployments;
984
+ try {
985
+ deployments = await ctx.client.listDeployments({ teamId: ctx.teamId });
986
+ }
987
+ catch (error) {
988
+ return renderApiError(error, ctx.err);
989
+ }
990
+ let applications = [];
991
+ try {
992
+ applications = await ctx.client.listAgentkitDeployments({
993
+ teamId: ctx.teamId,
994
+ });
995
+ }
996
+ catch (error) {
997
+ // Older control planes 404 this route; keep listing v1.
998
+ if (!(error instanceof DeployApiError && error.status === 404)) {
999
+ return renderApiError(error, ctx.err);
1000
+ }
1001
+ }
1002
+ if (ctx.json) {
1003
+ // Empty v2 list keeps `{ deployments }` for v1-only parsers.
1004
+ ctx.out(`${JSON.stringify(applications.length === 0 ? { deployments } : { deployments, applications }, null, 2)}\n`);
1005
+ return 0;
1006
+ }
1007
+ if (deployments.length === 0 && applications.length === 0) {
1008
+ ctx.out(`No deployments on team ${ctx.teamId}. Create one with \`${CLI} deploy\`.\n`);
1009
+ return 0;
1010
+ }
1011
+ ctx.out(`${renderTable(["SLUG", "ARCH", "STATUS", "GEN", "KIND", "UPDATED"], [
1012
+ ...deployments.map((d) => [
1013
+ d.slug,
1014
+ "v1",
1015
+ d.status,
1016
+ String(d.generation),
1017
+ d.deploymentKind,
1018
+ d.desiredUpdatedAt ?? "",
1019
+ ]),
1020
+ ...applications.map((application) => [
1021
+ application.slug,
1022
+ "v2",
1023
+ application.status,
1024
+ "-",
1025
+ "application",
1026
+ application.deployments
1027
+ .map((row) => row.desiredUpdatedAt)
1028
+ .sort()
1029
+ .at(-1) ?? "",
1030
+ ]),
1031
+ ])}\n`);
1032
+ return 0;
1033
+ }
1034
+ // ============================================================================
1035
+ // deployment <slug> (detail)
1036
+ // ============================================================================
1037
+ export async function cmdDeploymentStatus(slug, options) {
1038
+ if (slug === undefined || slug === "") {
1039
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} deployment <slug> [--team <id>] [--json]\n`);
1040
+ return 1;
1041
+ }
1042
+ const ctx = await prepare(options);
1043
+ if (typeof ctx === "number") {
1044
+ return ctx;
1045
+ }
1046
+ // Same dispatch as `stop`: v1 409s architecture-v2 slugs, so the v2
1047
+ // GET goes first. A v2 404 (missing slug, or an older backend) falls
1048
+ // through to the v1 agent-serve detail.
1049
+ try {
1050
+ const detail = await ctx.client.getAgentkitDeploy({
1051
+ teamId: ctx.teamId,
1052
+ slug,
1053
+ });
1054
+ renderAgentkitDeploymentStatus(ctx, detail);
1055
+ return 0;
1056
+ }
1057
+ catch (error) {
1058
+ if (!(error instanceof DeployApiError) || error.status !== 404) {
1059
+ return renderApiError(error, ctx.err);
1060
+ }
1061
+ }
1062
+ let detail;
1063
+ try {
1064
+ detail = await ctx.client.getDeployment({ teamId: ctx.teamId, slug });
1065
+ }
1066
+ catch (error) {
1067
+ return renderApiError(error, ctx.err);
1068
+ }
1069
+ if (ctx.json) {
1070
+ ctx.out(`${JSON.stringify(detail, null, 2)}\n`);
1071
+ return 0;
1072
+ }
1073
+ const aliasUrl = ctx.client.aliasUrl(detail.engineAlias);
1074
+ const lines = [`${detail.slug} (team ${detail.teamId})`, ` status: ${detail.status}`];
1075
+ if (detail.progress !== undefined) {
1076
+ lines.push(` progress: ${detail.progress}`);
1077
+ }
1078
+ if (detail.statusMessage !== null &&
1079
+ detail.statusMessage !== undefined &&
1080
+ detail.statusMessage.trim() !== "") {
1081
+ lines.push(` step: ${detail.statusMessage}`);
1082
+ }
1083
+ lines.push(` generation: ${detail.generation}`, ` kind: ${detail.deploymentKind}`, ` alias: ${aliasUrl}`, ` playground: ${aliasUrl}/playground`);
1084
+ if (detail.gitRepoUrl !== null && detail.gitRepoUrl !== undefined) {
1085
+ lines.push(` repo: ${detail.gitRepoUrl} @ ${detail.gitRef ?? ""}`);
1086
+ }
1087
+ if (detail.serviceAccountId !== undefined && detail.serviceAccountId !== null) {
1088
+ lines.push(` service account: ${detail.serviceAccountId}`);
1089
+ }
1090
+ if (detail.agentStoreSourceId !== undefined) {
1091
+ // The durable file store's address: GET /v0/agent-serve-files/<id> lists
1092
+ // it, and the pod sees it as AGENT_SERVE_STORE_SOURCE_ID.
1093
+ lines.push(` file store: ${detail.agentStoreSourceId}`);
1094
+ }
1095
+ if (detail.egressAllowedDomains !== undefined && detail.egressAllowedDomains.length > 0) {
1096
+ lines.push(` egress: ${detail.egressAllowedDomains.join(", ")}`);
1097
+ }
1098
+ if (detail.publicRoutePaths !== undefined && detail.publicRoutePaths.length > 0) {
1099
+ // Served through the alias WITHOUT X-Agent-Alias-Token (the channel
1100
+ // authenticates deliveries itself).
1101
+ for (const path of detail.publicRoutePaths) {
1102
+ lines.push(` public: ${aliasUrl}${path} (no alias token)`);
1103
+ }
1104
+ }
1105
+ if (detail.secretNames !== undefined && detail.secretNames.length > 0) {
1106
+ lines.push(` secrets: ${detail.secretNames.join(", ")}`);
1107
+ }
1108
+ if (detail.podCredentialMaskedKey !== undefined && detail.podCredentialMaskedKey !== null) {
1109
+ lines.push(` pod credential: ${detail.podCredentialMaskedKey}`);
1110
+ }
1111
+ if (detail.engineUrl !== null && detail.engineUrl !== undefined) {
1112
+ lines.push(` engine: ${detail.engineUrl}`);
1113
+ }
1114
+ if (detail.engineAccess !== null &&
1115
+ detail.engineAccess !== undefined &&
1116
+ typeof detail.engineAccess === "object") {
1117
+ lines.push(` engine access: ${detail.engineAccess.url} (expires ${detail.engineAccess.expiresAt})`);
1118
+ }
1119
+ if (detail.lastError !== null && detail.lastError !== undefined) {
1120
+ lines.push(` last error: ${sanitizeCustomerError(detail.lastError)}`);
1121
+ }
1122
+ if (detail.desiredUpdatedAt !== undefined) {
1123
+ lines.push(` updated: ${detail.desiredUpdatedAt}`);
1124
+ }
1125
+ ctx.out(`${lines.join("\n")}\n`);
1126
+ return 0;
1127
+ }
1128
+ /**
1129
+ * Absolute webhook URLs for channels the running release actually admits
1130
+ * without an alias token. A missing alias or an empty path list prints
1131
+ * nothing — a relative `/v1/channels/…` line is not a live URL. A
1132
+ * multi-tenant release returns an empty list: the engine alias 404s, and
1133
+ * the deployment URL is not this application's alias.
1134
+ */
1135
+ function livePublicWebhookLines(ctx, detail) {
1136
+ const engineAlias = detail.engineAlias;
1137
+ if (detail.status !== "running" || engineAlias === undefined) {
1138
+ return "";
1139
+ }
1140
+ return (detail.publicRoutePaths ?? [])
1141
+ .map((path) => ` public: ${ctx.client.aliasUrl(engineAlias)}${path} (no alias token)\n`)
1142
+ .join("");
1143
+ }
1144
+ function renderAgentkitDeploymentStatus(ctx, detail) {
1145
+ if (ctx.json) {
1146
+ ctx.out(`${JSON.stringify(detail, null, 2)}\n`);
1147
+ return;
1148
+ }
1149
+ const lines = [
1150
+ `${detail.slug} (team ${detail.teamId})`,
1151
+ ` status: ${detail.status}`,
1152
+ ` architecture: v2`,
1153
+ ` application: ${detail.applicationId}`,
1154
+ ` release: ${detail.releaseId}`,
1155
+ ` progress: ${detail.progress}`,
1156
+ ];
1157
+ if (detail.statusMessage !== null && detail.statusMessage.trim() !== "") {
1158
+ lines.push(` step: ${detail.statusMessage}`);
1159
+ }
1160
+ if (detail.repositories !== undefined) {
1161
+ lines.push(` watching: ${detail.repositories.length === 0 ? "(nothing)" : detail.repositories.join(", ")}`);
1162
+ }
1163
+ if (detail.secretNames !== undefined && detail.secretNames.length > 0) {
1164
+ lines.push(` secrets: ${detail.secretNames.join(", ")}`);
1165
+ }
1166
+ const publicLines = livePublicWebhookLines(ctx, detail);
1167
+ if (publicLines.length > 0) {
1168
+ lines.push(...publicLines.replace(/\n$/, "").split("\n"));
1169
+ }
1170
+ if (detail.lastError !== null && detail.lastError !== undefined) {
1171
+ lines.push(` last error: ${sanitizeCustomerError(detail.lastError)}`);
1172
+ }
1173
+ ctx.out(`${lines.join("\n")}\n`);
1174
+ }
1175
+ // ============================================================================
1176
+ // stop <slug>
1177
+ // ============================================================================
1178
+ export async function cmdStop(slug, options) {
1179
+ if (slug === undefined || slug === "") {
1180
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} stop <slug> [--team <id>] [--json] [--no-wait]\n`);
1181
+ return 1;
1182
+ }
1183
+ const ctx = await prepare(options);
1184
+ if (typeof ctx === "number") {
1185
+ return ctx;
1186
+ }
1187
+ // Stop takes only a slug, so there is no manifest to dispatch on (unlike
1188
+ // deploy). The v2 agentsdk control plane goes first: v1 endpoints refuse
1189
+ // `architecture: "v2"` slugs with a 409 rather than a 404, so v1-first
1190
+ // could not fall through. A v2 404 (including an older backend without
1191
+ // the `/internal/agentsdk` mount) falls back to the v1 stop.
1192
+ let architecture = "v2";
1193
+ let accepted;
1194
+ try {
1195
+ accepted = await ctx.client.stopAgentkit({
1196
+ teamId: ctx.teamId,
1197
+ slug,
1198
+ cancelRuns: options.cancelRuns,
1199
+ });
1200
+ }
1201
+ catch (error) {
1202
+ if (!(error instanceof DeployApiError) || error.status !== 404) {
1203
+ return renderApiError(error, ctx.err);
1204
+ }
1205
+ if (options.cancelRuns === true) {
1206
+ ctx.err(`Canceling active runs while stopping is supported only for Agent SDK v2 deployments.\n`);
1207
+ return 1;
1208
+ }
1209
+ try {
1210
+ accepted = await ctx.client.stopDeployment({ teamId: ctx.teamId, slug });
1211
+ architecture = "v1";
1212
+ }
1213
+ catch (v1Error) {
1214
+ return renderApiError(v1Error, ctx.err);
1215
+ }
1216
+ }
1217
+ const cancellation = "cancellation" in accepted ? accepted.cancellation : undefined;
1218
+ const stoppedGlobally = "scope" in accepted && accepted.scope === "global";
1219
+ if (ctx.noWait) {
1220
+ if (ctx.json) {
1221
+ ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
1222
+ }
1223
+ else {
1224
+ ctx.out(stoppedGlobally
1225
+ ? `Stop accepted for ${slug} across all tenants (status: ${accepted.status}).\n`
1226
+ : `Stop accepted for ${slug} (status: ${accepted.status}).\n`);
1227
+ }
1228
+ return cancellation?.failed === 0 || cancellation === undefined ? 0 : 1;
1229
+ }
1230
+ let detail;
1231
+ try {
1232
+ detail =
1233
+ architecture === "v2"
1234
+ ? await pollUntil(ctx, slug, new Set(["stopped"]), () => ctx.client.getAgentkitDeploy({ teamId: ctx.teamId, slug }))
1235
+ : await pollUntil(ctx, slug, new Set(["stopped"]), () => ctx.client.getDeployment({ teamId: ctx.teamId, slug }));
1236
+ }
1237
+ catch (error) {
1238
+ return renderApiError(error, ctx.err);
1239
+ }
1240
+ if (ctx.json) {
1241
+ ctx.out(`${JSON.stringify(detail, null, 2)}\n`);
1242
+ }
1243
+ else if (stoppedGlobally) {
1244
+ ctx.out(`Stopped ${slug} across all tenants (team ${ctx.teamId}); resume with \`${CLI} start ${slug}\`.\n`);
1245
+ }
1246
+ else {
1247
+ ctx.out(`Stopped ${slug} (team ${ctx.teamId}).\n`);
1248
+ }
1249
+ if (cancellation !== undefined) {
1250
+ return writeCancellationStarted(ctx, cancellation, slug);
1251
+ }
1252
+ return 0;
1253
+ }
1254
+ function writeCancellationStarted(ctx, cancellation, slug) {
1255
+ ctx.out(`Started cancellation across ${cancellation.batchesStarted} deployment batch(es).\n`);
1256
+ if (cancellation.sessionsMarkedFailed !== undefined) {
1257
+ ctx.out(`Marked ${cancellation.sessionsMarkedFailed} factory session(s) failed.\n`);
1258
+ }
1259
+ if (cancellation.failed > 0) {
1260
+ ctx.err(`Failed to start ${cancellation.failed} cancellation batch(es); retry with \`${CLI} cancel-runs ${slug}\`.\n`);
1261
+ return 1;
1262
+ }
1263
+ return 0;
1264
+ }
1265
+ export async function cmdStart(slug, options) {
1266
+ if (slug === undefined || slug === "") {
1267
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} start <slug> [--team <id>] [--json]\n`);
1268
+ return 1;
1269
+ }
1270
+ const ctx = await prepare(options);
1271
+ if (typeof ctx === "number") {
1272
+ return ctx;
1273
+ }
1274
+ try {
1275
+ const accepted = await ctx.client.startAgentkit({
1276
+ teamId: ctx.teamId,
1277
+ slug,
1278
+ });
1279
+ if (ctx.json) {
1280
+ ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
1281
+ }
1282
+ else {
1283
+ ctx.out(`Started ${slug} (team ${ctx.teamId}).\n`);
1284
+ }
1285
+ return 0;
1286
+ }
1287
+ catch (error) {
1288
+ return renderApiError(error, ctx.err);
1289
+ }
1290
+ }
1291
+ export async function cmdKill(slug, options) {
1292
+ if (slug === undefined || slug === "") {
1293
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} kill <slug> [--team <id>] [--json]\n`);
1294
+ return 1;
1295
+ }
1296
+ const ctx = await prepare(options);
1297
+ if (typeof ctx === "number") {
1298
+ return ctx;
1299
+ }
1300
+ let accepted;
1301
+ try {
1302
+ accepted = await ctx.client.killAgentkit({ teamId: ctx.teamId, slug });
1303
+ }
1304
+ catch (error) {
1305
+ return renderApiError(error, ctx.err);
1306
+ }
1307
+ if (ctx.json) {
1308
+ ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
1309
+ }
1310
+ else {
1311
+ ctx.out(accepted.scope === "global"
1312
+ ? `Killed ${slug} across all tenants (team ${ctx.teamId}): deploys locked, admission stopped.\n`
1313
+ : `Killed ${slug} (team ${ctx.teamId}): deploys locked, admission stopped.\n`);
1314
+ ctx.out(`Resume traffic with \`${CLI} unlock-deploys ${slug}\` then \`${CLI} start ${slug}\`.\n`);
1315
+ ctx.out(`Unlock deploys with \`${CLI} unlock-deploys ${slug}\`.\n`);
1316
+ }
1317
+ if (accepted.cancellation !== undefined) {
1318
+ return writeCancellationStarted(ctx, accepted.cancellation, slug);
1319
+ }
1320
+ return 0;
1321
+ }
1322
+ export async function cmdUnlockDeploys(slug, options) {
1323
+ if (slug === undefined || slug === "") {
1324
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} unlock-deploys <slug> [--team <id>] [--json]\n`);
1325
+ return 1;
1326
+ }
1327
+ const ctx = await prepare(options);
1328
+ if (typeof ctx === "number") {
1329
+ return ctx;
1330
+ }
1331
+ try {
1332
+ const accepted = await ctx.client.unlockAgentkitDeploys({
1333
+ teamId: ctx.teamId,
1334
+ slug,
1335
+ });
1336
+ if (ctx.json) {
1337
+ ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
1338
+ }
1339
+ else {
1340
+ ctx.out(`Unlocked deploys for ${slug} (team ${ctx.teamId}).\n`);
1341
+ }
1342
+ return 0;
1343
+ }
1344
+ catch (error) {
1345
+ return renderApiError(error, ctx.err);
1346
+ }
1347
+ }
1348
+ export async function cmdCancelRuns(slug, options) {
1349
+ if (slug === undefined || slug === "") {
1350
+ (options.err ?? ((text) => void process.stderr.write(text)))(`Usage: ${CLI} cancel-runs <slug> [--team <id>] [--json]\n`);
1351
+ return 1;
1352
+ }
1353
+ const ctx = await prepare(options);
1354
+ if (typeof ctx === "number") {
1355
+ return ctx;
1356
+ }
1357
+ let result;
1358
+ try {
1359
+ result = await ctx.client.cancelAgentkitRuns({
1360
+ teamId: ctx.teamId,
1361
+ slug,
1362
+ });
1363
+ }
1364
+ catch (error) {
1365
+ return renderApiError(error, ctx.err);
1366
+ }
1367
+ if (ctx.json) {
1368
+ ctx.out(`${JSON.stringify(result, null, 2)}\n`);
1369
+ }
1370
+ else {
1371
+ ctx.out(`Started cancellation across ${result.batchesStarted} deployment batch(es).\n`);
1372
+ if (result.sessionsMarkedFailed !== undefined) {
1373
+ ctx.out(`Marked ${result.sessionsMarkedFailed} factory session(s) failed.\n`);
1374
+ }
1375
+ }
1376
+ if (result.failed > 0) {
1377
+ ctx.err(`Failed to start ${result.failed} cancellation batch(es).\n`);
1378
+ return 1;
1379
+ }
1380
+ return 0;
1381
+ }
1382
+ // ============================================================================
1383
+ // event-repos <slug> --repo <owner/name>...
1384
+ // ============================================================================
1385
+ export async function cmdEventRepos(slug, repositories, options) {
1386
+ if (slug === undefined || slug === "") {
1387
+ (options.err ?? ((text) => void process.stderr.write(text)))(`Usage: ${CLI} event-repos <slug> --repo <owner/name>... [--team <id>] [--json]\n`);
1388
+ return 1;
1389
+ }
1390
+ const ctx = await prepare(options);
1391
+ if (typeof ctx === "number") {
1392
+ return ctx;
1393
+ }
1394
+ let configured;
1395
+ try {
1396
+ configured = await ctx.client.setAgentkitEventRepositories({
1397
+ teamId: ctx.teamId,
1398
+ slug,
1399
+ repositories,
1400
+ });
1401
+ }
1402
+ catch (error) {
1403
+ return renderApiError(error, ctx.err);
1404
+ }
1405
+ if (ctx.json) {
1406
+ ctx.out(`${JSON.stringify({ repositories: configured }, null, 2)}\n`);
1407
+ }
1408
+ else if (configured.length === 0) {
1409
+ ctx.out(`${slug} now watches no repositories.\n`);
1410
+ }
1411
+ else {
1412
+ ctx.out(`${slug} now watches ${configured.join(", ")}.\n`);
1413
+ }
1414
+ return 0;
1415
+ }
1416
+ // ============================================================================
1417
+ // upgrade <slug>
1418
+ // ============================================================================
1419
+ /** Release ids are uuids; anything else the user typed is a version. */
1420
+ const RELEASE_ID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
1421
+ export async function cmdUpgrade(args, options) {
1422
+ return cmdPinRelease(args, options, {
1423
+ usage: `Usage: ${CLI} upgrade <slug> [--release <id|version>] [--team <id>] [--json]\n`,
1424
+ pin: (client, request) => client.upgradeAgentkitInstall(request),
1425
+ success: (slug, releaseId) => `${slug} now runs release ${releaseId}.\n`,
1426
+ });
1427
+ }
1428
+ export async function cmdRollback(args, options) {
1429
+ return cmdPinRelease(args, options, {
1430
+ usage: `Usage: ${CLI} rollback <slug> [--release <id|version>] [--team <id>] [--json]\n`,
1431
+ pin: (client, request) => client.rollbackAgentkitInstall(request),
1432
+ success: (slug, releaseId) => `${slug} rolled back to release ${releaseId}.\n`,
1433
+ });
1434
+ }
1435
+ async function cmdPinRelease(args, options, pin) {
1436
+ const { slug, release } = args;
1437
+ if (slug === undefined || slug === "") {
1438
+ (options.err ?? ((text) => void process.stderr.write(text)))(pin.usage);
1439
+ return 1;
1440
+ }
1441
+ const ctx = await prepare(options);
1442
+ if (typeof ctx === "number") {
1443
+ return ctx;
1444
+ }
1445
+ const selector = release?.trim() ?? "";
1446
+ let releaseId;
1447
+ try {
1448
+ releaseId = await pin.pin(ctx.client, {
1449
+ teamId: ctx.teamId,
1450
+ slug,
1451
+ ...(selector === ""
1452
+ ? {}
1453
+ : RELEASE_ID_RE.test(selector)
1454
+ ? { releaseId: selector }
1455
+ : { version: selector }),
1456
+ });
1457
+ }
1458
+ catch (error) {
1459
+ return renderApiError(error, ctx.err);
1460
+ }
1461
+ if (ctx.json) {
1462
+ ctx.out(`${JSON.stringify({ releaseId }, null, 2)}\n`);
1463
+ }
1464
+ else {
1465
+ ctx.out(pin.success(slug, releaseId));
1466
+ }
1467
+ return 0;
1468
+ }
1469
+ // ============================================================================
1470
+ // delete <slug>
1471
+ // ============================================================================
1472
+ export async function cmdDelete(slug, options) {
1473
+ if (slug === undefined || slug === "") {
1474
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} delete <slug> [--team <id>] [--json] [--no-wait]\n`);
1475
+ return 1;
1476
+ }
1477
+ const ctx = await prepare(options);
1478
+ if (typeof ctx === "number") {
1479
+ return ctx;
1480
+ }
1481
+ // Same dispatch as `stop`: v1 409s architecture-v2 slugs, so the v2
1482
+ // DELETE goes first. A v2 404 (missing slug, or an older backend)
1483
+ // falls through to the v1 agent-serve delete.
1484
+ let architecture = "v2";
1485
+ let accepted;
1486
+ try {
1487
+ accepted = await ctx.client.deleteAgentkit({ teamId: ctx.teamId, slug });
1488
+ }
1489
+ catch (error) {
1490
+ if (!(error instanceof DeployApiError) || error.status !== 404) {
1491
+ return renderApiError(error, ctx.err);
1492
+ }
1493
+ try {
1494
+ accepted = await ctx.client.deleteDeployment({
1495
+ teamId: ctx.teamId,
1496
+ slug,
1497
+ });
1498
+ architecture = "v1";
1499
+ }
1500
+ catch (v1Error) {
1501
+ return renderApiError(v1Error, ctx.err);
1502
+ }
1503
+ }
1504
+ if (ctx.noWait) {
1505
+ if (ctx.json) {
1506
+ ctx.out(`${JSON.stringify(accepted, null, 2)}\n`);
1507
+ }
1508
+ else {
1509
+ ctx.out(`Delete accepted for ${slug} (status: ${accepted.status}).\n`);
1510
+ }
1511
+ return 0;
1512
+ }
1513
+ try {
1514
+ await pollUntilGone(ctx, slug, () => architecture === "v2"
1515
+ ? ctx.client.getAgentkitDeploy({ teamId: ctx.teamId, slug })
1516
+ : ctx.client.getDeployment({ teamId: ctx.teamId, slug }));
1517
+ }
1518
+ catch (error) {
1519
+ return renderApiError(error, ctx.err);
1520
+ }
1521
+ if (ctx.json) {
1522
+ ctx.out(`${JSON.stringify({ slug, status: "deleted" }, null, 2)}\n`);
1523
+ }
1524
+ else {
1525
+ ctx.out(`Deleted ${slug} (team ${ctx.teamId}).\n`);
1526
+ }
1527
+ return 0;
1528
+ }
1529
+ // ============================================================================
1530
+ // rotate-token <slug>
1531
+ // ============================================================================
1532
+ export async function cmdRotateToken(slug, options) {
1533
+ if (slug === undefined || slug === "") {
1534
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} rotate-token <slug> [--team <id>]\n`);
1535
+ return 1;
1536
+ }
1537
+ const ctx = await prepare(options);
1538
+ if (typeof ctx === "number") {
1539
+ return ctx;
1540
+ }
1541
+ let aliasToken;
1542
+ try {
1543
+ const architecture = await deploymentArchitecture({
1544
+ client: ctx.client,
1545
+ teamId: ctx.teamId,
1546
+ slug,
1547
+ });
1548
+ aliasToken =
1549
+ architecture === "v2"
1550
+ ? await ctx.client.rotateAgentsdkAliasToken({
1551
+ teamId: ctx.teamId,
1552
+ slug,
1553
+ })
1554
+ : await ctx.client.rotateAliasToken({
1555
+ teamId: ctx.teamId,
1556
+ slug,
1557
+ });
1558
+ }
1559
+ catch (error) {
1560
+ return renderApiError(error, ctx.err);
1561
+ }
1562
+ if (ctx.json) {
1563
+ ctx.out(`${JSON.stringify({ aliasToken }, null, 2)}\n`);
1564
+ return 0;
1565
+ }
1566
+ ctx.out(`Rotated the alias token for ${slug}. The old token stopped working immediately.\n${aliasTokenBlock(aliasToken)}`);
1567
+ return 0;
1568
+ }
1569
+ // ============================================================================
1570
+ // secrets set|list|unset
1571
+ // ============================================================================
1572
+ async function secretDeploymentArchitecture(ctx, slug) {
1573
+ return deploymentArchitecture({
1574
+ client: ctx.client,
1575
+ teamId: ctx.teamId,
1576
+ slug,
1577
+ });
1578
+ }
1579
+ export async function cmdSecretsSet(slug, specs, options) {
1580
+ const usageErr = options.err ?? ((t) => void process.stderr.write(t));
1581
+ if (slug === undefined || slug === "" || specs.length === 0) {
1582
+ usageErr(`Usage: ${CLI} secrets set <slug> NAME [NAME2 ...] [--team <id>] [--json]\n` +
1583
+ ` Hidden prompt on a TTY. One NAME reads all of stdin (redirect a PEM).\n` +
1584
+ ` Several NAMEs: one stdin line each.\n` +
1585
+ ` Opt-in (leaks into argv / agent terminals): NAME=VALUE … --from-argv\n`);
1586
+ return 1;
1587
+ }
1588
+ // Parse and validate every name before prompting for any value, so a
1589
+ // typo in the last name cannot waste typed-in secrets.
1590
+ const parsed = [];
1591
+ for (const spec of specs) {
1592
+ const eq = spec.indexOf("=");
1593
+ const name = eq === -1 ? spec : spec.slice(0, eq);
1594
+ const nameError = validateSettableSecretName(name);
1595
+ if (nameError !== undefined) {
1596
+ usageErr(`${nameError}\n`);
1597
+ return 1;
1598
+ }
1599
+ parsed.push(eq === -1 ? { name } : { name, value: spec.slice(eq + 1) });
1600
+ }
1601
+ const hasArgvValues = parsed.some((entry) => entry.value !== undefined);
1602
+ if (hasArgvValues && options.fromArgv !== true) {
1603
+ usageErr(`Refusing NAME=VALUE on argv (shows up in shell history and agent-captured terminals).\n` +
1604
+ `Pass names only:\n` +
1605
+ ` ${CLI} secrets set ${slug} NAME\n` +
1606
+ `Hidden prompt on a TTY. One NAME reads all of stdin, including newlines:\n` +
1607
+ ` ${CLI} secrets set ${slug} NAME < ./secret.pem\n` +
1608
+ `Several NAMEs take one stdin line each.\n`);
1609
+ return 1;
1610
+ }
1611
+ if (hasArgvValues) {
1612
+ usageErr(`warning: --from-argv puts secret values in argv (shell history and agent-captured terminals).\n`);
1613
+ }
1614
+ const ctx = await prepare(options);
1615
+ if (typeof ctx === "number") {
1616
+ return ctx;
1617
+ }
1618
+ const stdin = options.stdin ?? process.stdin;
1619
+ const secrets = [];
1620
+ let secretNames;
1621
+ let architecture;
1622
+ try {
1623
+ const only = parsed.length === 1 ? parsed[0] : undefined;
1624
+ if (only !== undefined && only.value === undefined && stdin.isTTY !== true) {
1625
+ secrets.push({
1626
+ name: only.name,
1627
+ value: await readWholeStdinValue(stdin, only.name),
1628
+ });
1629
+ }
1630
+ else {
1631
+ const readValue = createSecretValueReader(stdin, ctx.err);
1632
+ for (const entry of parsed) {
1633
+ secrets.push({
1634
+ name: entry.name,
1635
+ value: entry.value ?? (await readValue(entry.name)),
1636
+ });
1637
+ }
1638
+ }
1639
+ architecture = await secretDeploymentArchitecture(ctx, slug);
1640
+ secretNames =
1641
+ architecture === "v2"
1642
+ ? await ctx.client.setAgentkitSecrets({
1643
+ teamId: ctx.teamId,
1644
+ slug,
1645
+ secrets,
1646
+ })
1647
+ : await ctx.client.setSecrets({
1648
+ teamId: ctx.teamId,
1649
+ slug,
1650
+ secrets,
1651
+ });
1652
+ }
1653
+ catch (error) {
1654
+ return renderApiError(error, ctx.err);
1655
+ }
1656
+ if (ctx.json) {
1657
+ ctx.out(`${JSON.stringify({ secretNames }, null, 2)}\n`);
1658
+ return 0;
1659
+ }
1660
+ ctx.out(`Set ${secrets.length} secret${secrets.length === 1 ? "" : "s"} on ${slug}.\n` +
1661
+ `Secrets now set: ${secretNames.join(", ")}\n` +
1662
+ (architecture === "v2"
1663
+ ? `The next task picks them up; no redeploy is required.\n`
1664
+ : `The engine picks them up on its next deploy.\n`));
1665
+ return 0;
1666
+ }
1667
+ export async function cmdSecretsList(slug, options) {
1668
+ if (slug === undefined || slug === "") {
1669
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} secrets list <slug> [--team <id>] [--json]\n`);
1670
+ return 1;
1671
+ }
1672
+ const ctx = await prepare(options);
1673
+ if (typeof ctx === "number") {
1674
+ return ctx;
1675
+ }
1676
+ let secrets;
1677
+ try {
1678
+ const architecture = await secretDeploymentArchitecture(ctx, slug);
1679
+ secrets =
1680
+ architecture === "v2"
1681
+ ? await ctx.client.listAgentkitSecrets({ teamId: ctx.teamId, slug })
1682
+ : await ctx.client.listSecrets({ teamId: ctx.teamId, slug });
1683
+ }
1684
+ catch (error) {
1685
+ return renderApiError(error, ctx.err);
1686
+ }
1687
+ if (ctx.json) {
1688
+ ctx.out(`${JSON.stringify({ secrets }, null, 2)}\n`);
1689
+ return 0;
1690
+ }
1691
+ if (secrets.length === 0) {
1692
+ ctx.out(`No secrets set on ${slug}. Add one with \`${CLI} secrets set ${slug} NAME\`.\n`);
1693
+ return 0;
1694
+ }
1695
+ ctx.out(`${renderTable(["NAME", "CREATED"], secrets.map((secret) => [secret.name, secret.createdAt]))}\n`);
1696
+ return 0;
1697
+ }
1698
+ export async function cmdSecretsUnset(slug, name, options) {
1699
+ if (slug === undefined || slug === "" || name === undefined || name === "") {
1700
+ (options.err ?? ((t) => void process.stderr.write(t)))(`Usage: ${CLI} secrets unset <slug> NAME [--team <id>]\n`);
1701
+ return 1;
1702
+ }
1703
+ const ctx = await prepare(options);
1704
+ if (typeof ctx === "number") {
1705
+ return ctx;
1706
+ }
1707
+ try {
1708
+ const architecture = await secretDeploymentArchitecture(ctx, slug);
1709
+ if (architecture === "v2") {
1710
+ await ctx.client.deleteAgentkitSecret({
1711
+ teamId: ctx.teamId,
1712
+ slug,
1713
+ name,
1714
+ });
1715
+ }
1716
+ else {
1717
+ await ctx.client.deleteSecret({ teamId: ctx.teamId, slug, name });
1718
+ }
1719
+ }
1720
+ catch (error) {
1721
+ if (error instanceof DeployApiError && error.status === 404) {
1722
+ ctx.err(`No secret named ${name} on deployment ${slug} — check \`${CLI} secrets list ${slug}\` (and the slug / --team).\n`);
1723
+ return 1;
1724
+ }
1725
+ return renderApiError(error, ctx.err);
1726
+ }
1727
+ if (ctx.json) {
1728
+ ctx.out(`${JSON.stringify({ removed: name }, null, 2)}\n`);
1729
+ }
1730
+ else {
1731
+ ctx.out(`Removed secret ${name} from ${slug}.\n`);
1732
+ }
1733
+ return 0;
1734
+ }
1735
+ /**
1736
+ * Returns a reader for interactive secret values: hidden (no-echo) prompt
1737
+ * when `stdin` is a TTY, otherwise one line per secret from the piped
1738
+ * stream. One reader per command so piped lines are consumed in order.
1739
+ * A single NAME uses {@link readWholeStdinValue} instead, so a redirected
1740
+ * PEM keeps its internal newlines.
1741
+ */
1742
+ function createSecretValueReader(stdin, err) {
1743
+ if (stdin.isTTY === true) {
1744
+ return (name) => promptHidden(stdin, err, `Value for ${name}: `);
1745
+ }
1746
+ const readLine = createLineReader(stdin);
1747
+ return async (name) => {
1748
+ const line = await readLine();
1749
+ if (line === undefined) {
1750
+ throw new DeployApiError(`stdin ended before a value for ${name} was provided (pipe one line per secret).`, 0);
1751
+ }
1752
+ return line;
1753
+ };
1754
+ }
1755
+ /** Longest mask run drawn while typing a secret; the count carries the rest. */
1756
+ const SECRET_MASK_MAX_WIDTH = 24;
1757
+ /**
1758
+ * One line of typing feedback for the hidden prompt. Echoing the value would
1759
+ * leak it, so the line carries a bounded mask plus the exact character count —
1760
+ * enough to see that keystrokes, backspaces, and pasted values landed. The
1761
+ * mask is clamped to the terminal width so the redraw stays on one line.
1762
+ */
1763
+ function renderSecretPromptLine(prompt, length, dim) {
1764
+ const count = `${length} char${length === 1 ? "" : "s"}`;
1765
+ const room = (process.stderr.columns ?? 80) - prompt.length - count.length - 2;
1766
+ const maskWidth = Math.max(0, Math.min(length, SECRET_MASK_MAX_WIDTH, room));
1767
+ // `·` over `•`: the rest of the CLI's progress output already uses it, and
1768
+ // fonts that ship no bullet glyph draw a tofu box in its place.
1769
+ const mask = "·".repeat(maskWidth);
1770
+ const body = mask === "" ? count : `${mask} ${count}`;
1771
+ return `\r\u001b[2K${prompt}${dim(body)}`;
1772
+ }
1773
+ /**
1774
+ * Raw-mode hidden prompt: never echoes the value, redraws a mask + character
1775
+ * count as it is typed, supports backspace and Ctrl-C.
1776
+ */
1777
+ function promptHidden(stdin, err, prompt) {
1778
+ return new Promise((resolvePromise, reject) => {
1779
+ const { dim } = stderrPalette();
1780
+ let value = "";
1781
+ const draw = () => {
1782
+ err(renderSecretPromptLine(prompt, value.length, dim));
1783
+ };
1784
+ draw();
1785
+ stdin.setRawMode?.(true);
1786
+ stdin.resume();
1787
+ const cleanup = () => {
1788
+ stdin.off("data", onData);
1789
+ stdin.setRawMode?.(false);
1790
+ stdin.pause();
1791
+ draw();
1792
+ err("\n");
1793
+ };
1794
+ const onData = (chunk) => {
1795
+ const text = typeof chunk === "string" ? chunk : chunk.toString("utf8");
1796
+ for (const ch of text) {
1797
+ if (ch === "\r" || ch === "\n") {
1798
+ cleanup();
1799
+ resolvePromise(value);
1800
+ return;
1801
+ }
1802
+ if (ch === "\u0003") {
1803
+ cleanup();
1804
+ reject(new DeployApiError("Aborted.", 0));
1805
+ return;
1806
+ }
1807
+ if (ch === "\u007f" || ch === "\b") {
1808
+ value = value.slice(0, -1);
1809
+ continue;
1810
+ }
1811
+ value += ch;
1812
+ }
1813
+ // One redraw per chunk keeps a pasted value from flooding the terminal.
1814
+ draw();
1815
+ };
1816
+ stdin.on("data", onData);
1817
+ });
1818
+ }
1819
+ /**
1820
+ * Whole piped stdin for a single secret. One trailing newline is removed so
1821
+ * `echo value | secrets set slug NAME` still stores `value`. Internal
1822
+ * newlines stay, which is what a redirected PEM needs.
1823
+ */
1824
+ async function readWholeStdinValue(stdin, name) {
1825
+ const raw = await readStreamText(stdin);
1826
+ if (raw === "") {
1827
+ throw new DeployApiError(`stdin ended before a value for ${name} was provided.`, 0);
1828
+ }
1829
+ return stripOneTrailingNewline(raw);
1830
+ }
1831
+ function stripOneTrailingNewline(value) {
1832
+ if (value.endsWith("\r\n")) {
1833
+ return value.slice(0, -2);
1834
+ }
1835
+ if (value.endsWith("\n") || value.endsWith("\r")) {
1836
+ return value.slice(0, -1);
1837
+ }
1838
+ return value;
1839
+ }
1840
+ function readStreamText(stream) {
1841
+ return new Promise((resolve, reject) => {
1842
+ const chunks = [];
1843
+ const cleanup = () => {
1844
+ stream.off("data", onData);
1845
+ stream.off("end", onEnd);
1846
+ stream.off("error", onError);
1847
+ };
1848
+ const onData = (chunk) => {
1849
+ chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
1850
+ };
1851
+ const onEnd = () => {
1852
+ cleanup();
1853
+ resolve(Buffer.concat(chunks).toString("utf8"));
1854
+ };
1855
+ const onError = (error) => {
1856
+ cleanup();
1857
+ reject(error instanceof Error ? error : new Error(String(error)));
1858
+ };
1859
+ stream.on("data", onData);
1860
+ stream.on("end", onEnd);
1861
+ stream.on("error", onError);
1862
+ stream.resume();
1863
+ });
1864
+ }
1865
+ /** Buffered line reader over a piped stream; undefined once it ends. */
1866
+ export function createLineReader(stream) {
1867
+ let buffer = "";
1868
+ let ended = false;
1869
+ const waiters = [];
1870
+ const drain = () => {
1871
+ while (waiters.length > 0) {
1872
+ const newline = buffer.indexOf("\n");
1873
+ if (newline !== -1) {
1874
+ const line = buffer.slice(0, newline).replace(/\r$/, "");
1875
+ buffer = buffer.slice(newline + 1);
1876
+ waiters.shift()?.(line);
1877
+ continue;
1878
+ }
1879
+ if (!ended) {
1880
+ return;
1881
+ }
1882
+ // Stream ended: a trailing unterminated line still counts once.
1883
+ const rest = buffer;
1884
+ buffer = "";
1885
+ waiters.shift()?.(rest === "" ? undefined : rest.replace(/\r$/, ""));
1886
+ }
1887
+ };
1888
+ stream.on("data", (chunk) => {
1889
+ buffer += typeof chunk === "string" ? chunk : chunk.toString("utf8");
1890
+ drain();
1891
+ });
1892
+ stream.on("end", () => {
1893
+ ended = true;
1894
+ drain();
1895
+ });
1896
+ stream.resume();
1897
+ return () => new Promise((resolvePromise) => {
1898
+ waiters.push(resolvePromise);
1899
+ drain();
1900
+ });
1901
+ }
1902
+ // ============================================================================
1903
+ // Polling + rendering helpers
1904
+ // ============================================================================
1905
+ /**
1906
+ * Poll deployment status every `pollIntervalMs` until it lands in
1907
+ * `terminal` (single-line progress on a TTY, one line per transition
1908
+ * otherwise). Prefers customer `statusMessage` / `progress` over raw
1909
+ * status so create → checkout → start is visible. Throws DeployApiError
1910
+ * on request failures or timeout.
1911
+ */
1912
+ async function pollUntil(ctx, slug, terminal, fetchDetail) {
1913
+ const startedAt = Date.now();
1914
+ const tty = process.stderr.isTTY === true;
1915
+ let lastLabel;
1916
+ let sawProgress = false;
1917
+ const report = (detail) => {
1918
+ if (ctx.json) {
1919
+ return;
1920
+ }
1921
+ const label = deployProgressLabel(detail);
1922
+ const elapsed = Math.round((Date.now() - startedAt) / 1000);
1923
+ if (tty) {
1924
+ ctx.err(`\r\x1b[2K${slug}: ${label} (${elapsed}s)`);
1925
+ sawProgress = true;
1926
+ }
1927
+ else if (label !== lastLabel) {
1928
+ ctx.err(`${slug}: ${label}\n`);
1929
+ }
1930
+ lastLabel = label;
1931
+ };
1932
+ const finishProgressLine = () => {
1933
+ if (tty && sawProgress) {
1934
+ ctx.err("\n");
1935
+ }
1936
+ };
1937
+ for (;;) {
1938
+ let detail;
1939
+ try {
1940
+ detail = await fetchDetail();
1941
+ }
1942
+ catch (error) {
1943
+ // Capacity / rate-limit on GET is not a bake failure. The v2 accept
1944
+ // already started freeze; keep polling until the wait budget expires.
1945
+ if (isTransientDeployStatusError(error) && Date.now() - startedAt < ctx.timeoutMs) {
1946
+ if (!ctx.json) {
1947
+ const elapsed = Math.round((Date.now() - startedAt) / 1000);
1948
+ const label = "Waiting for status (server busy)";
1949
+ if (tty) {
1950
+ ctx.err(`\r\x1b[2K${slug}: ${label} (${elapsed}s)`);
1951
+ sawProgress = true;
1952
+ }
1953
+ else if (label !== lastLabel) {
1954
+ ctx.err(`${slug}: ${label}\n`);
1955
+ }
1956
+ lastLabel = label;
1957
+ }
1958
+ const waitMs = transientDeployStatusWaitMs(error, ctx.pollIntervalMs);
1959
+ const remaining = ctx.timeoutMs - (Date.now() - startedAt);
1960
+ await sleep(Math.max(0, Math.min(waitMs, remaining)));
1961
+ continue;
1962
+ }
1963
+ finishProgressLine();
1964
+ throw error;
1965
+ }
1966
+ report(detail);
1967
+ if (terminal.has(detail.status)) {
1968
+ finishProgressLine();
1969
+ return detail;
1970
+ }
1971
+ if (Date.now() - startedAt >= ctx.timeoutMs) {
1972
+ finishProgressLine();
1973
+ const last = deployProgressLabel(detail);
1974
+ throw new DeployApiError(`Timed out after ${Math.round(ctx.timeoutMs / 1000)}s waiting for ${slug} (last: ${last}). It may still converge — check \`${CLI} deployment ${slug} --team ${ctx.teamId}\`.`, 0);
1975
+ }
1976
+ await sleep(ctx.pollIntervalMs);
1977
+ }
1978
+ }
1979
+ /** Load-shed / rate-limit on status GET — the deploy itself may still be baking. */
1980
+ function isTransientDeployStatusError(error) {
1981
+ return error instanceof DeployApiError && (error.status === 503 || error.status === 429);
1982
+ }
1983
+ function transientDeployStatusWaitMs(error, pollIntervalMs) {
1984
+ if (error.status === 429 &&
1985
+ error.retryAfterSeconds !== undefined &&
1986
+ error.retryAfterSeconds > 0) {
1987
+ return Math.max(pollIntervalMs, error.retryAfterSeconds * 1000);
1988
+ }
1989
+ return pollIntervalMs;
1990
+ }
1991
+ /**
1992
+ * Wait until GET 404s (the delete reconciler purged the record). Treats
1993
+ * other errors as failures. Throws DeployApiError on timeout.
1994
+ */
1995
+ async function pollUntilGone(ctx, slug, getDetail) {
1996
+ const startedAt = Date.now();
1997
+ const tty = process.stderr.isTTY === true;
1998
+ let sawProgress = false;
1999
+ const report = (label) => {
2000
+ if (ctx.json) {
2001
+ return;
2002
+ }
2003
+ const elapsed = Math.round((Date.now() - startedAt) / 1000);
2004
+ if (tty) {
2005
+ ctx.err(`\r\x1b[2K${slug}: ${label} (${elapsed}s)`);
2006
+ sawProgress = true;
2007
+ }
2008
+ };
2009
+ const finishProgressLine = () => {
2010
+ if (tty && sawProgress) {
2011
+ ctx.err("\n");
2012
+ }
2013
+ };
2014
+ for (;;) {
2015
+ try {
2016
+ const detail = await getDetail();
2017
+ report(deployProgressLabel(detail));
2018
+ }
2019
+ catch (error) {
2020
+ if (error instanceof DeployApiError && error.status === 404) {
2021
+ finishProgressLine();
2022
+ return;
2023
+ }
2024
+ finishProgressLine();
2025
+ throw error;
2026
+ }
2027
+ if (Date.now() - startedAt >= ctx.timeoutMs) {
2028
+ finishProgressLine();
2029
+ throw new DeployApiError(`Timed out after ${Math.round(ctx.timeoutMs / 1000)}s waiting for ${slug} to disappear. It may still be deleting — check \`${CLI} deployment ${slug} --team ${ctx.teamId}\`.`, 0);
2030
+ }
2031
+ await sleep(ctx.pollIntervalMs);
2032
+ }
2033
+ }
2034
+ function aliasTokenBlock(aliasToken) {
2035
+ return (`\n Alias token (shown ONCE — save it now, it cannot be retrieved again):\n\n` +
2036
+ ` ${aliasToken}\n\n` +
2037
+ ` Send it as the X-Agent-Alias-Token header on requests to the alias URL.\n` +
2038
+ ` Lost tokens: \`${CLI} rotate-token <slug>\` mints a replacement.\n\n`);
2039
+ }
2040
+ /**
2041
+ * `: <reason>` suffix for a deploy that ended in a non-running state, or
2042
+ * empty when the control plane recorded no reason.
2043
+ */
2044
+ function deployFailureDetail(lastError) {
2045
+ if (lastError === null || lastError === undefined || lastError.trim() === "") {
2046
+ return "";
2047
+ }
2048
+ return `: ${sanitizeCustomerError(lastError.trim())}`;
2049
+ }
2050
+ export function renderApiError(error, err, context) {
2051
+ if (error instanceof DeployApiError) {
2052
+ err(`${error.message}\n`);
2053
+ if (error.status === 409 && error.message.includes("application multiTenant does not match")) {
2054
+ if (context?.multiTenant === true) {
2055
+ err("This slug is a single-tenant application. Redeploy it without --multi-tenant.\n");
2056
+ }
2057
+ else if (context?.teamId === MULTI_COMPONENT_ALLOWED_TEAM_ID) {
2058
+ err("This slug is a Cursor-managed (multi-tenant) product. Redeploy it with --multi-tenant.\n");
2059
+ }
2060
+ }
2061
+ return 1;
2062
+ }
2063
+ throw error;
2064
+ }
2065
+ export function renderTable(header, rows) {
2066
+ const widths = header.map((h, i) => Math.max(h.length, ...rows.map((row) => (row[i] ?? "").length)));
2067
+ const renderRow = (row) => row
2068
+ .map((cell, i) => cell.padEnd(widths[i] ?? 0))
2069
+ .join(" ")
2070
+ .trimEnd();
2071
+ return [renderRow(header), ...rows.map(renderRow)].join("\n");
2072
+ }