@desplega.ai/agent-swarm 2.5.4 → 2.7.0

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 (354) hide show
  1. package/README.md +4 -2
  2. package/dist/{acp-adapter-ek38cwsv.js → acp-adapter-ma1js5n7.js} +9 -9
  3. package/dist/{actions-92mepq03.js → actions-1vhmtvg9.js} +21 -21
  4. package/dist/{amp-adapter-9gaxg015.js → amp-adapter-sxqqvmdk.js} +4 -4
  5. package/dist/{app-ctn8gsgx.js → app-mwx1d5a9.js} +3 -3
  6. package/dist/{assistant-zyr5kz47.js → assistant-yx1p6g82.js} +30 -26
  7. package/dist/{boot-reembed-w75maga2.js → boot-reembed-5h37a2c2.js} +1 -1
  8. package/dist/{boot-reembed-dwzfttdr.js → boot-reembed-7h78vmvv.js} +2 -1
  9. package/dist/{boot-scrub-sweep-e9kq43kf.js → boot-scrub-sweep-8mawd4gw.js} +4 -4
  10. package/dist/{boot-seeds-x28v3fhb.js → boot-seeds-ca84dhnn.js} +4 -4
  11. package/dist/{claude-adapter-f0afqnne.js → claude-adapter-wqt4hfkq.js} +9 -9
  12. package/dist/{claude-managed-adapter-x81a7r65.js → claude-managed-adapter-6fjqtr2z.js} +2 -2
  13. package/dist/{claude-managed-setup-bqzwjd9x.js → claude-managed-setup-rqv98sea.js} +10 -3
  14. package/dist/{claude-sdk-session-7b7whkaq.js → claude-sdk-session-f29f3b2x.js} +11 -11
  15. package/dist/{cli-sxgtf5fw.js → cli-07q03xm2.js} +1 -1
  16. package/dist/{cli-kxpfx2xr.js → cli-0z1xjzwa.js} +2 -2
  17. package/dist/{cli-g9vd9ece.js → cli-1hhbzkbb.js} +14 -16
  18. package/dist/{cli-qqzmjxkf.js → cli-1m9x8dr5.js} +11 -6
  19. package/dist/{cli-jbnn4vxb.js → cli-2pvzmas1.js} +3 -3
  20. package/dist/{cli-x77gen2p.js → cli-2y7v133v.js} +7 -7
  21. package/dist/{cli-dew6x255.js → cli-39aet655.js} +2 -2
  22. package/dist/{cli-g1cw7xtt.js → cli-39rrw8yp.js} +1 -1
  23. package/dist/{cli-jb30dzvk.js → cli-48gxjmcz.js} +530 -190
  24. package/dist/{cli-pzatvw94.js → cli-54sj64fc.js} +2 -2
  25. package/dist/{cli-bvpgr9ny.js → cli-60sty27p.js} +5 -5
  26. package/dist/{cli-asq5ydm4.js → cli-6a9qfa8b.js} +411 -69
  27. package/dist/{cli-277c31dw.js → cli-6mgdba42.js} +225 -3
  28. package/dist/{cli-19202kew.js → cli-6srv653c.js} +5 -5
  29. package/dist/{cli-n4c8e3s5.js → cli-708wdy32.js} +1 -1
  30. package/dist/{cli-pasyvjmm.js → cli-737pyqxr.js} +1 -1
  31. package/dist/{cli-6x9ma5w5.js → cli-803188pb.js} +1 -1
  32. package/dist/{cli-hh5we352.js → cli-86ehn4s5.js} +7 -7
  33. package/dist/{cli-9s05422w.js → cli-8mbc9za9.js} +1 -1
  34. package/dist/{cli-ff1tm9n9.js → cli-8wmj18cz.js} +1 -1
  35. package/dist/{cli-1r5ad7j5.js → cli-9gsm2rzp.js} +12 -12
  36. package/dist/{cli-mz9afxxf.js → cli-9pshx6rd.js} +17 -3
  37. package/dist/{cli-s682zgqz.js → cli-a6ds2epe.js} +1 -1
  38. package/dist/{cli-6a1xg1p7.js → cli-a89zdqz9.js} +2 -2
  39. package/dist/{cli-03vpq45j.js → cli-ay40dnj3.js} +2 -2
  40. package/dist/{cli-tsma7p8v.js → cli-aypd09nf.js} +2 -2
  41. package/dist/{cli-ethgy7ha.js → cli-b3yzyc57.js} +2 -2
  42. package/dist/{cli-bn0rewsy.js → cli-c081bj3b.js} +2 -2
  43. package/dist/{cli-mmhj8vd7.js → cli-c668vvcf.js} +11 -2
  44. package/dist/{cli-sbwsxvtd.js → cli-d20qvpr2.js} +2 -2
  45. package/dist/{cli-c952c7ac.js → cli-e1595bgx.js} +3 -3
  46. package/dist/{cli-621ce7kw.js → cli-f12mr20z.js} +3 -3
  47. package/dist/{cli-dqygeeh5.js → cli-f1e0ptjj.js} +10 -1
  48. package/dist/{cli-xzfq4at3.js → cli-f4dbh7a5.js} +16 -12
  49. package/dist/{cli-ha9rmwgq.js → cli-fb8m699c.js} +2 -2
  50. package/dist/{cli-5bnsc0e1.js → cli-gsfk58nw.js} +5 -5
  51. package/dist/cli-gt4h8cxw.js +895 -0
  52. package/dist/{cli-nwyw3zhg.js → cli-gxee0bqa.js} +1 -1
  53. package/dist/{cli-25n3mv5d.js → cli-h5jeg46p.js} +6 -6
  54. package/dist/{cli-gn5af0x5.js → cli-he9gbdx0.js} +62 -12
  55. package/dist/{cli-gbfxp48k.js → cli-j0ppywdr.js} +42 -35
  56. package/dist/{cli-k4tjsdx9.js → cli-j3y0x2n4.js} +277 -199
  57. package/dist/{cli-7p4jxgtt.js → cli-j9bpmykh.js} +75 -27
  58. package/dist/{cli-dabehxhp.js → cli-kt907da6.js} +1 -1
  59. package/dist/{cli-wx2nj19m.js → cli-kv7sbc2c.js} +6 -6
  60. package/dist/{cli-abs8ndtr.js → cli-m30k9777.js} +26 -26
  61. package/dist/{cli-cz5nmdxt.js → cli-m5e802r7.js} +2 -2
  62. package/dist/{cli-0shx9j93.js → cli-pfk92eqz.js} +2 -2
  63. package/dist/{cli-xtrz6bzs.js → cli-ptfq202x.js} +5 -3
  64. package/dist/{cli-6n8axjv1.js → cli-qj442fws.js} +2 -2
  65. package/dist/{cli-c61mbdds.js → cli-rd5m70gj.js} +4 -4
  66. package/dist/{cli-eftzyh9y.js → cli-s09j9vp5.js} +2 -2
  67. package/dist/{cli-m4ecdxvz.js → cli-s0mgx214.js} +7 -7
  68. package/dist/{cli-wghjkr0e.js → cli-sgqm2582.js} +10 -7
  69. package/dist/{cli-2655k16q.js → cli-sjctjr48.js} +2 -2
  70. package/dist/{cli-nzfnt2gs.js → cli-tf1n0r0b.js} +1 -1
  71. package/dist/{cli-x0f2v69c.js → cli-twctnkng.js} +12 -7
  72. package/dist/{cli-j6rktc91.js → cli-v6shg7na.js} +1 -1
  73. package/dist/{cli-gx4rm0qx.js → cli-vz78s5wm.js} +1 -1
  74. package/dist/{cli-gwhjmh8g.js → cli-wqr7cea4.js} +5 -5
  75. package/dist/{cli-e42vss7b.js → cli-x37r7qwf.js} +16 -8
  76. package/dist/{cli-4b2z6n0m.js → cli-yd2nreqw.js} +17 -8
  77. package/dist/{cli-64mh9mf3.js → cli-ymjpkxgn.js} +69 -17
  78. package/dist/{cli-5kqnemen.js → cli-yvy48785.js} +1 -1
  79. package/dist/{cli-9j129brq.js → cli-yxbsmx56.js} +6 -6
  80. package/dist/cli.js +22 -20
  81. package/dist/{codex-adapter-wch12q99.js → codex-adapter-zk59x2zh.js} +7 -7
  82. package/dist/{codex-hook-brpnycn5.js → codex-hook-xyjhvxwd.js} +1 -1
  83. package/dist/{codex-login-rn7c5gxt.js → codex-login-8cg0vhf2.js} +1 -1
  84. package/dist/{codex-session-runner-41pfcr95.js → codex-session-runner-kh6s4j3n.js} +8 -8
  85. package/dist/{commands-9849dkj6.js → commands-68et1qv2.js} +2 -2
  86. package/dist/{controller-ja0sd95p.js → controller-fyrbnzg4.js} +4 -4
  87. package/dist/{controllers-connect-xp05dj6x.js → controllers-connect-nep9h2xv.js} +23 -23
  88. package/dist/{cursor-adapter-623qxqew.js → cursor-adapter-yss3pg7t.js} +2 -2
  89. package/dist/{db-w759qmx0.js → db-28gjyvxj.js} +4 -2
  90. package/dist/{db-47vj40dy.js → db-8ftwvzba.js} +3 -3
  91. package/dist/{devin-adapter-4ycy4vrf.js → devin-adapter-byen2cxt.js} +1 -1
  92. package/dist/{dispatcher-7b8e4z2j.js → dispatcher-hayexmkr.js} +20 -20
  93. package/dist/{docker-s84hjs91.js → docker-fdzyewpz.js} +2 -2
  94. package/dist/{dsh-adapter-2ezw3xea.js → dsh-adapter-46wawff9.js} +2 -2
  95. package/dist/{e2b-9gkdhm3c.js → e2b-222hsajc.js} +2 -2
  96. package/dist/{e2b-cjtf8k1z.js → e2b-fn3zacvt.js} +2 -2
  97. package/dist/{easter-egg-3d-e4qv8dxj.js → easter-egg-3d-8d1e0h4m.js} +1 -1
  98. package/dist/{event-bus-3z78ep5n.js → event-bus-pghg8hqy.js} +1 -1
  99. package/dist/{execute-0xpz8950.js → execute-cjrfxfnm.js} +1 -1
  100. package/dist/{external-channel-e2s028da.js → external-channel-xbmxcg09.js} +2 -2
  101. package/dist/{grok-adapter-ys7gaqee.js → grok-adapter-ag4wks2a.js} +10 -10
  102. package/dist/handlers-tzmevqb5.js +41 -0
  103. package/dist/{heartbeat-w3mntghj.js → heartbeat-psfvcgwp.js} +23 -23
  104. package/dist/{hook-g7kvv6x9.js → hook-8pz04697.js} +6 -6
  105. package/dist/{hook-3jjywnpb.js → hook-cyq4mryn.js} +8 -8
  106. package/dist/{http-tkp7d4kb.js → http-haj1nd6k.js} +921 -169
  107. package/dist/{index-q7m26kvs.js → index-jwt2bj6f.js} +265 -97
  108. package/dist/{index-3n8m9ea2.js → index-q52f47pe.js} +1 -1
  109. package/dist/{index-31ceyf42.js → index-syvhnvtw.js} +1 -1
  110. package/dist/index-y1ajx04a.js +43 -0
  111. package/dist/{index-1ef1myq2.js → index-z5h22pes.js} +20 -20
  112. package/dist/{index-xdaahthb.js → index-zyq8ct52.js} +20 -20
  113. package/dist/{keepalive-v4ta8wgg.js → keepalive-xdvsamvj.js} +4 -4
  114. package/dist/lead-hqg57kdp.js +79 -0
  115. package/dist/{maintenance-84n1ex21.js → maintenance-4y2xzh3a.js} +1 -1
  116. package/dist/{oauth-refresh-sweep-vjnnandw.js → oauth-refresh-sweep-jd4r7zbs.js} +9 -4
  117. package/dist/{onboard-sfmpe4np.js → onboard-18447q9q.js} +6 -6
  118. package/dist/{opencode-adapter-jmpst4q4.js → opencode-adapter-26b2frdf.js} +7 -7
  119. package/dist/{otel-impl-v6cc0zve.js → otel-impl-f9tgr8yw.js} +2 -2
  120. package/dist/{pi-mono-adapter-fk8fkcf6.js → pi-mono-adapter-qn6qbga1.js} +38 -17
  121. package/dist/{pricing-refresh-fsk1e1zc.js → pricing-refresh-dw2tgb53.js} +3 -3
  122. package/dist/{rbac-roles-prmkdnkw.js → rbac-roles-aygm2760.js} +2 -2
  123. package/dist/{rbac-roles-zxmxqa39.js → rbac-roles-s4nwj2m3.js} +1 -1
  124. package/dist/render-v2-yfvdfr0x.js +16 -0
  125. package/dist/{resume-frdtgfa0.js → resume-1bmvjbf3.js} +9 -9
  126. package/dist/{runtime-bt5pkpm1.js → runtime-f7tpzedy.js} +1 -1
  127. package/dist/{session-access-fpez4y5q.js → session-access-r5garej6.js} +4 -4
  128. package/dist/session-source-backfill-424wzv0r.js +110 -0
  129. package/dist/{setup-mq6m3m8q.js → setup-8tygvxkq.js} +1 -1
  130. package/dist/{virtual-modules-mnfbh5mr.js → virtual-modules-xsw323b3.js} +2 -2
  131. package/dist/{work-objects-kfahhjsq.js → work-objects-ggnghpgf.js} +23 -23
  132. package/dist/worker-sqjd1nqf.js +79 -0
  133. package/dist/{x-pbpezr0s.js → x-wxrzvzx8.js} +2 -2
  134. package/openapi.json +1324 -14
  135. package/package.json +5 -3
  136. package/src/assets/source-key.ts +95 -0
  137. package/src/be/automation-preflight.ts +2 -0
  138. package/src/be/db/api-keys.ts +89 -0
  139. package/src/be/db/session-labels.ts +28 -0
  140. package/src/be/db/session-moves.ts +5 -6
  141. package/src/be/db/session-tree.ts +153 -14
  142. package/src/be/db/tasks/read.ts +11 -0
  143. package/src/be/db/tasks/write.ts +6 -1
  144. package/src/be/db/workflow-runs.ts +219 -6
  145. package/src/be/db-retention.ts +61 -6
  146. package/src/be/db.ts +135 -132
  147. package/src/be/memory/providers/openai-embedding.ts +5 -1
  148. package/src/be/memory/task-learning.ts +155 -0
  149. package/src/be/migrations/244_api_key_validation.sql +4 -0
  150. package/src/be/migrations/245_script_executor.sql +3 -0
  151. package/src/be/oauth-refresh-sweep.ts +2 -1
  152. package/src/be/onboarding.ts +4 -0
  153. package/src/be/scripts/boot-reembed.ts +2 -0
  154. package/src/be/scripts/db.ts +14 -4
  155. package/src/be/scripts/embeddings.ts +2 -0
  156. package/src/be/scripts/run-saved.ts +1 -0
  157. package/src/be/scripts/typecheck.ts +10 -4
  158. package/src/be/seed-skills/index.ts +7 -0
  159. package/src/be/session-source-backfill.ts +163 -0
  160. package/src/be/swarm-config-guard.ts +1 -0
  161. package/src/comb/review-batch.ts +28 -1
  162. package/src/comb/templates.ts +7 -2
  163. package/src/commands/claude-managed-setup.ts +7 -1
  164. package/src/commands/credential-refresh.ts +76 -1
  165. package/src/commands/credential-wait.ts +2 -2
  166. package/src/commands/onboard/compose-generator.ts +5 -3
  167. package/src/commands/provider-credentials.ts +212 -171
  168. package/src/commands/runner.ts +25 -4
  169. package/src/extensions/apply-task-create.ts +8 -1
  170. package/src/extensions/contract-types.generated.ts +1 -1
  171. package/src/extensions/contract.ts +5 -0
  172. package/src/heartbeat/heartbeat.ts +14 -1
  173. package/src/heartbeat/script-runner-probe.ts +47 -0
  174. package/src/http/all-routes.ts +2 -0
  175. package/src/http/api-keys.ts +77 -9
  176. package/src/http/assets.ts +15 -0
  177. package/src/http/codex-oauth-accounts.ts +191 -0
  178. package/src/http/comb.ts +15 -2
  179. package/src/http/config.ts +1 -1
  180. package/src/http/core.ts +6 -0
  181. package/src/http/fleet-benchmark.ts +5 -2
  182. package/src/http/idempotency-key.ts +1 -1
  183. package/src/http/index.ts +14 -3
  184. package/src/http/integrations.ts +5 -1
  185. package/src/http/kv.ts +8 -3
  186. package/src/http/onboarding.ts +6 -1
  187. package/src/http/pages-public.ts +38 -5
  188. package/src/http/pool-keys.ts +354 -0
  189. package/src/http/scripts.ts +27 -0
  190. package/src/http/sessions.ts +37 -12
  191. package/src/http/stats.ts +1 -0
  192. package/src/http/status.ts +26 -12
  193. package/src/http/tasks.ts +3 -0
  194. package/src/http/used-by.ts +7 -2
  195. package/src/http/workflows.ts +88 -9
  196. package/src/http/x.ts +5 -0
  197. package/src/integrations/chat-sdk/inbound.ts +27 -0
  198. package/src/kv-reserved-namespaces.ts +19 -0
  199. package/src/prompts/base-prompt.ts +21 -1
  200. package/src/prompts/session-templates.ts +17 -3
  201. package/src/providers/acp-targets.ts +1 -1
  202. package/src/providers/amp-adapter.ts +1 -1
  203. package/src/providers/claude-adapter.ts +5 -1
  204. package/src/providers/claude-managed-adapter.ts +16 -9
  205. package/src/providers/codex-adapter.ts +71 -11
  206. package/src/providers/dsh-adapter.ts +1 -1
  207. package/src/providers/pi-mono-adapter.ts +41 -11
  208. package/src/scheduler/scheduler.ts +5 -3
  209. package/src/scripts-runtime/eval-harness.ts +8 -1
  210. package/src/scripts-runtime/executors/native.ts +22 -16
  211. package/src/scripts-runtime/executors/quickjs-prelude.ts +103 -1
  212. package/src/scripts-runtime/executors/quickjs-runner.ts +2 -1
  213. package/src/scripts-runtime/executors/quickjs.ts +7 -0
  214. package/src/scripts-runtime/executors/registry.ts +32 -0
  215. package/src/scripts-runtime/executors/types.ts +7 -0
  216. package/src/scripts-runtime/host-validated-args.ts +133 -0
  217. package/src/scripts-runtime/loader.ts +30 -3
  218. package/src/scripts-runtime/swarm-sdk.ts +16 -3
  219. package/src/scripts-runtime/types/stdlib.d.ts +10 -2
  220. package/src/scripts-runtime/types/swarm-extension.d.ts +17 -8
  221. package/src/scripts-runtime/types/swarm-sdk.d.ts +10 -2
  222. package/src/slack/assistant.ts +7 -0
  223. package/src/slack/channel-labels.ts +74 -0
  224. package/src/slack/handlers.ts +8 -0
  225. package/src/slack/inbound-files.ts +5 -2
  226. package/src/slack/thread-buffer.ts +4 -0
  227. package/src/tasks/sibling-awareness.ts +12 -3
  228. package/src/telemetry-context.ts +5 -6
  229. package/src/telemetry-identity.ts +3 -3
  230. package/src/tests/api-key-status-by-suffix.test.ts +242 -0
  231. package/src/tests/api-keys-validation.test.ts +170 -0
  232. package/src/tests/base-prompt.test.ts +70 -2
  233. package/src/tests/claude-managed-adapter.test.ts +46 -0
  234. package/src/tests/claude-routes-e2e.test.ts +7 -2
  235. package/src/tests/codex-credential-pools.test.ts +120 -0
  236. package/src/tests/codex-gateway-route.test.ts +165 -0
  237. package/src/tests/codex-oauth-accounts.test.ts +357 -0
  238. package/src/tests/comb-review-batch.test.ts +63 -2
  239. package/src/tests/community-linear-delivery-loop.test.ts +2099 -0
  240. package/src/tests/config-pool-keys.test.ts +533 -0
  241. package/src/tests/credential-check.test.ts +294 -4
  242. package/src/tests/credential-refresh.test.ts +172 -1
  243. package/src/tests/db-retention.test.ts +9 -3
  244. package/src/tests/db-task-read-contract.test.ts +1 -0
  245. package/src/tests/db-task-write-contract.test.ts +1 -3
  246. package/src/tests/docs-index-footprint.test.js +3 -3
  247. package/src/tests/docs-index.test.ts +135 -0
  248. package/src/tests/dsh-adapter.test.ts +1 -1
  249. package/src/tests/extensions-pre-task.test.ts +53 -1
  250. package/src/tests/fetch-resolved-env.test.ts +16 -2
  251. package/src/tests/fixtures/extensions/record-task-create/hooks.ts +9 -0
  252. package/src/tests/fixtures/extensions/record-task-create/manifest.json +7 -0
  253. package/src/tests/fleet-benchmark.test.ts +8 -0
  254. package/src/tests/get-workflow-run-tool.test.ts +98 -0
  255. package/src/tests/heartbeat-checklist.test.ts +89 -0
  256. package/src/tests/heartbeat-script-runner-probe.test.ts +83 -0
  257. package/src/tests/integrations-http.test.ts +32 -2
  258. package/src/tests/internal-ai/complete-structured.test.ts +37 -1
  259. package/src/tests/internal-ai/credentials.test.ts +23 -0
  260. package/src/tests/kv-http.test.ts +32 -0
  261. package/src/tests/kv-tool.test.ts +25 -0
  262. package/src/tests/multi-runtime-registration.test.ts +12 -12
  263. package/src/tests/oauth-refresh-sweep.test.ts +34 -1
  264. package/src/tests/onboard-compose.test.ts +20 -0
  265. package/src/tests/onboarding.test.ts +108 -1
  266. package/src/tests/openai-embedding-credentials.test.ts +35 -0
  267. package/src/tests/opencode-adapter.test.ts +2 -1
  268. package/src/tests/openrouter-attribution-call-sites.test.ts +2 -2
  269. package/src/tests/org-website.test.ts +36 -0
  270. package/src/tests/pages-frame-ancestors.test.ts +162 -0
  271. package/src/tests/pi-codemode.test.ts +2 -1
  272. package/src/tests/pi-mono-adapter.test.ts +54 -0
  273. package/src/tests/pi-native-mcp.test.ts +13 -1
  274. package/src/tests/pi-tool-exposure.test.ts +8 -8
  275. package/src/tests/probe-tool-schema-tokens.test.ts +144 -0
  276. package/src/tests/prompt-template-session.test.ts +4 -3
  277. package/src/tests/provider-key-probes.test.ts +181 -0
  278. package/src/tests/rbac-e2e-helpers.test.ts +88 -1
  279. package/src/tests/rbac-e2e-helpers.ts +36 -11
  280. package/src/tests/request-composition-derive.test.ts +329 -0
  281. package/src/tests/script-connections.test.ts +4 -0
  282. package/src/tests/script-executor-conformance.test.ts +36 -1
  283. package/src/tests/script-executor-quickjs-pool.test.ts +50 -0
  284. package/src/tests/script-executor-quickjs.test.ts +140 -0
  285. package/src/tests/script-host-validated-args-native.test.ts +196 -0
  286. package/src/tests/script-per-script-executor.test.ts +415 -0
  287. package/src/tests/script-runs-retention.test.ts +212 -0
  288. package/src/tests/scripts-external-api.test.ts +45 -0
  289. package/src/tests/sdk-allowlist.test.ts +42 -2
  290. package/src/tests/self-improvement.test.ts +4 -4
  291. package/src/tests/session-source-backfill.test.ts +429 -0
  292. package/src/tests/session-source-keys.test.ts +236 -0
  293. package/src/tests/session-source-labels.test.ts +419 -0
  294. package/src/tests/sessions-detail-batch.test.ts +2 -0
  295. package/src/tests/sessions-move.test.ts +131 -0
  296. package/src/tests/sessions-tree.test.ts +299 -2
  297. package/src/tests/slack-inbound-files.test.ts +103 -23
  298. package/src/tests/status.test.ts +101 -18
  299. package/src/tests/store-progress-learning.test.ts +288 -0
  300. package/src/tests/tasks-workflow-run-filter.test.ts +146 -0
  301. package/src/tests/test-net.ts +31 -0
  302. package/src/tests/transcription.test.ts +8 -0
  303. package/src/tests/ui-logs-parser.test.ts +180 -0
  304. package/src/tests/used-by-route.test.ts +11 -0
  305. package/src/tests/workflow-cascade-cancel.test.ts +172 -0
  306. package/src/tests/workflow-engine-v2.test.ts +116 -1
  307. package/src/tests/workflow-http-v2.test.ts +131 -0
  308. package/src/tests/workflow-mcp-trigger-schema.test.ts +209 -0
  309. package/src/tests/workflow-run-finished-event.test.ts +263 -0
  310. package/src/tests/workflow-step-order.test.ts +92 -0
  311. package/src/tests/workflow-sub-workflow.test.ts +30 -0
  312. package/src/tests/workflow-swarm-script.test.ts +34 -0
  313. package/src/tools/get-tasks.ts +8 -0
  314. package/src/tools/kv/kv-read-auth.ts +4 -2
  315. package/src/tools/script-common.ts +1 -0
  316. package/src/tools/script-run.ts +7 -0
  317. package/src/tools/script-upsert.ts +7 -0
  318. package/src/tools/store-progress.ts +67 -1
  319. package/src/tools/task-action.ts +1 -1
  320. package/src/tools/workflows/get-workflow-run.ts +14 -4
  321. package/src/tools/workflows/trigger-workflow.ts +104 -10
  322. package/src/types.ts +36 -1
  323. package/src/utils/company-profile.ts +51 -1
  324. package/src/utils/credentials.ts +10 -4
  325. package/src/utils/internal-ai/complete-structured.ts +5 -0
  326. package/src/utils/internal-ai/credentials.ts +4 -3
  327. package/src/utils/provider-key-probes.ts +328 -0
  328. package/src/utils/transcription.ts +4 -1
  329. package/src/workflows/engine.ts +18 -16
  330. package/src/workflows/executors/sub-workflow.ts +8 -1
  331. package/src/workflows/executors/swarm-script.ts +5 -0
  332. package/src/workflows/foreach-driver.ts +5 -11
  333. package/src/workflows/node-timeout.ts +30 -0
  334. package/templates/ai-toolbox.manifest.json +2 -2
  335. package/templates/community/linear-delivery-loop/PLAYBOOK.md +323 -0
  336. package/templates/community/linear-delivery-loop/README.md +38 -0
  337. package/templates/community/linear-delivery-loop/config.example.json +31 -0
  338. package/templates/community/linear-delivery-loop/lead-prompt.md +34 -0
  339. package/templates/community/linear-delivery-loop/schedule.json +10 -0
  340. package/templates/community/linear-delivery-loop/scripts/linear-delivery-setup.ts +148 -0
  341. package/templates/community/linear-delivery-loop/scripts/linear-delivery-tick.ts +1781 -0
  342. package/templates/skills/researching/content.md +2 -0
  343. package/templates/skills/swarm-docs/config.json +14 -0
  344. package/templates/skills/swarm-docs/content.md +144 -0
  345. package/templates/skills/swarm-scripts/SKILL.md +1 -0
  346. package/templates/skills/swarm-scripts/content.md +1 -0
  347. package/dist/cli-7421jzsw.js +0 -84
  348. package/dist/cli-e45e4m6b.js +0 -413
  349. package/dist/cli-zw88zjba.js +0 -307
  350. package/dist/handlers-wy1dr6ja.js +0 -41
  351. package/dist/index-nmm79qgr.js +0 -43
  352. package/dist/lead-sawnyqxk.js +0 -79
  353. package/dist/render-v2-pjwxvnkw.js +0 -12
  354. package/dist/worker-v5e5rxj3.js +0 -79
package/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Agent Swarm API",
5
- "version": "2.5.4",
5
+ "version": "2.7.0",
6
6
  "description": "Multi-agent orchestration API for Claude Code, Codex, and Gemini CLI. Enables task distribution, agent communication, and service discovery.\n\nMCP tools are documented separately in [MCP.md](./MCP.md)."
7
7
  },
8
8
  "servers": [
@@ -648,6 +648,15 @@
648
648
  },
649
649
  "testedAt": {
650
650
  "type": "number"
651
+ },
652
+ "warning": {
653
+ "type": "string"
654
+ },
655
+ "keys": {
656
+ "type": "array",
657
+ "items": {
658
+ "$ref": "#/components/schemas/AgentCredStatusKeyResult"
659
+ }
651
660
  }
652
661
  },
653
662
  "default": null,
@@ -657,6 +666,39 @@
657
666
  "testedAt"
658
667
  ]
659
668
  },
669
+ "AgentCredStatusKeyResult": {
670
+ "type": "object",
671
+ "properties": {
672
+ "keyType": {
673
+ "type": "string"
674
+ },
675
+ "index": {
676
+ "type": "number"
677
+ },
678
+ "suffix": {
679
+ "type": "string"
680
+ },
681
+ "ok": {
682
+ "type": "boolean"
683
+ },
684
+ "error": {
685
+ "type": "string"
686
+ },
687
+ "httpStatus": {
688
+ "type": "number"
689
+ },
690
+ "latency_ms": {
691
+ "type": "number"
692
+ }
693
+ },
694
+ "required": [
695
+ "keyType",
696
+ "index",
697
+ "suffix",
698
+ "ok",
699
+ "latency_ms"
700
+ ]
701
+ },
660
702
  "AgentLatestModel": {
661
703
  "type": [
662
704
  "object",
@@ -5521,6 +5563,77 @@
5521
5563
  "nodeId"
5522
5564
  ]
5523
5565
  },
5566
+ "WorkflowRunStepSlim": {
5567
+ "type": "object",
5568
+ "properties": {
5569
+ "id": {
5570
+ "type": "string",
5571
+ "format": "uuid"
5572
+ },
5573
+ "runId": {
5574
+ "type": "string",
5575
+ "format": "uuid"
5576
+ },
5577
+ "nodeId": {
5578
+ "type": "string"
5579
+ },
5580
+ "nodeType": {
5581
+ "type": "string"
5582
+ },
5583
+ "status": {
5584
+ "type": "string",
5585
+ "enum": [
5586
+ "pending",
5587
+ "running",
5588
+ "waiting",
5589
+ "completed",
5590
+ "failed",
5591
+ "skipped",
5592
+ "cancelled"
5593
+ ]
5594
+ },
5595
+ "output": {},
5596
+ "error": {
5597
+ "type": "string"
5598
+ },
5599
+ "startedAt": {
5600
+ "type": "string"
5601
+ },
5602
+ "finishedAt": {
5603
+ "type": "string"
5604
+ },
5605
+ "retryCount": {
5606
+ "type": "integer",
5607
+ "minimum": 0,
5608
+ "default": 0
5609
+ },
5610
+ "maxRetries": {
5611
+ "type": "integer",
5612
+ "minimum": 0,
5613
+ "default": 3
5614
+ },
5615
+ "nextRetryAt": {
5616
+ "type": "string"
5617
+ },
5618
+ "idempotencyKey": {
5619
+ "type": "string"
5620
+ },
5621
+ "diagnostics": {
5622
+ "type": "string"
5623
+ },
5624
+ "nextPort": {
5625
+ "type": "string"
5626
+ }
5627
+ },
5628
+ "required": [
5629
+ "id",
5630
+ "runId",
5631
+ "nodeId",
5632
+ "nodeType",
5633
+ "status",
5634
+ "startedAt"
5635
+ ]
5636
+ },
5524
5637
  "WorkflowVersion": {
5525
5638
  "type": "object",
5526
5639
  "properties": {
@@ -12366,6 +12479,9 @@
12366
12479
  "eng_lead",
12367
12480
  "founder",
12368
12481
  "product",
12482
+ "marketing",
12483
+ "sales",
12484
+ "research",
12369
12485
  "ops",
12370
12486
  "other"
12371
12487
  ]
@@ -17266,6 +17382,217 @@
17266
17382
  }
17267
17383
  }
17268
17384
  },
17385
+ "/api/codex-oauth/accounts": {
17386
+ "get": {
17387
+ "summary": "List stored Codex ChatGPT accounts",
17388
+ "tags": [
17389
+ "Codex OAuth"
17390
+ ],
17391
+ "security": [
17392
+ {
17393
+ "bearerAuth": []
17394
+ }
17395
+ ],
17396
+ "responses": {
17397
+ "200": {
17398
+ "description": "Stored account metadata",
17399
+ "content": {
17400
+ "application/json": {
17401
+ "schema": {
17402
+ "type": "object",
17403
+ "properties": {
17404
+ "accounts": {
17405
+ "type": "array",
17406
+ "items": {
17407
+ "type": "object",
17408
+ "properties": {
17409
+ "slot": {
17410
+ "type": "integer",
17411
+ "minimum": 0
17412
+ },
17413
+ "configKey": {
17414
+ "type": "string"
17415
+ },
17416
+ "legacy": {
17417
+ "type": "boolean"
17418
+ },
17419
+ "suffix": {
17420
+ "type": [
17421
+ "string",
17422
+ "null"
17423
+ ]
17424
+ },
17425
+ "plan": {
17426
+ "type": [
17427
+ "string",
17428
+ "null"
17429
+ ]
17430
+ },
17431
+ "email": {
17432
+ "type": [
17433
+ "string",
17434
+ "null"
17435
+ ]
17436
+ },
17437
+ "status": {
17438
+ "type": "string",
17439
+ "enum": [
17440
+ "ok",
17441
+ "needs_login",
17442
+ "unchecked"
17443
+ ]
17444
+ }
17445
+ },
17446
+ "required": [
17447
+ "slot",
17448
+ "configKey",
17449
+ "legacy",
17450
+ "suffix",
17451
+ "plan",
17452
+ "email",
17453
+ "status"
17454
+ ]
17455
+ }
17456
+ }
17457
+ },
17458
+ "required": [
17459
+ "accounts"
17460
+ ]
17461
+ }
17462
+ }
17463
+ }
17464
+ },
17465
+ "403": {
17466
+ "description": "Caller cannot read all secrets",
17467
+ "content": {
17468
+ "application/json": {
17469
+ "schema": {
17470
+ "$ref": "#/components/schemas/ErrorResponse"
17471
+ }
17472
+ }
17473
+ }
17474
+ }
17475
+ }
17476
+ }
17477
+ },
17478
+ "/api/codex-oauth/accounts/{slot}": {
17479
+ "delete": {
17480
+ "summary": "Remove a stored Codex ChatGPT account",
17481
+ "tags": [
17482
+ "Codex OAuth"
17483
+ ],
17484
+ "security": [
17485
+ {
17486
+ "bearerAuth": []
17487
+ }
17488
+ ],
17489
+ "parameters": [
17490
+ {
17491
+ "schema": {
17492
+ "type": [
17493
+ "integer",
17494
+ "null"
17495
+ ],
17496
+ "minimum": 0,
17497
+ "maximum": 100
17498
+ },
17499
+ "required": false,
17500
+ "name": "slot",
17501
+ "in": "path"
17502
+ }
17503
+ ],
17504
+ "responses": {
17505
+ "200": {
17506
+ "description": "Remaining accounts",
17507
+ "content": {
17508
+ "application/json": {
17509
+ "schema": {
17510
+ "type": "object",
17511
+ "properties": {
17512
+ "accounts": {
17513
+ "type": "array",
17514
+ "items": {
17515
+ "type": "object",
17516
+ "properties": {
17517
+ "slot": {
17518
+ "type": "integer",
17519
+ "minimum": 0
17520
+ },
17521
+ "configKey": {
17522
+ "type": "string"
17523
+ },
17524
+ "legacy": {
17525
+ "type": "boolean"
17526
+ },
17527
+ "suffix": {
17528
+ "type": [
17529
+ "string",
17530
+ "null"
17531
+ ]
17532
+ },
17533
+ "plan": {
17534
+ "type": [
17535
+ "string",
17536
+ "null"
17537
+ ]
17538
+ },
17539
+ "email": {
17540
+ "type": [
17541
+ "string",
17542
+ "null"
17543
+ ]
17544
+ },
17545
+ "status": {
17546
+ "type": "string",
17547
+ "enum": [
17548
+ "ok",
17549
+ "needs_login",
17550
+ "unchecked"
17551
+ ]
17552
+ }
17553
+ },
17554
+ "required": [
17555
+ "slot",
17556
+ "configKey",
17557
+ "legacy",
17558
+ "suffix",
17559
+ "plan",
17560
+ "email",
17561
+ "status"
17562
+ ]
17563
+ }
17564
+ }
17565
+ },
17566
+ "required": [
17567
+ "accounts"
17568
+ ]
17569
+ }
17570
+ }
17571
+ }
17572
+ },
17573
+ "403": {
17574
+ "description": "Config administration and permission to read all secrets required",
17575
+ "content": {
17576
+ "application/json": {
17577
+ "schema": {
17578
+ "$ref": "#/components/schemas/ErrorResponse"
17579
+ }
17580
+ }
17581
+ }
17582
+ },
17583
+ "404": {
17584
+ "description": "Account slot does not exist",
17585
+ "content": {
17586
+ "application/json": {
17587
+ "schema": {
17588
+ "$ref": "#/components/schemas/ErrorResponse"
17589
+ }
17590
+ }
17591
+ }
17592
+ }
17593
+ }
17594
+ }
17595
+ },
17269
17596
  "/api/oauth/keep-warm/codex": {
17270
17597
  "post": {
17271
17598
  "summary": "Locked keep-warm refresh sweep across all Codex OAuth pool slots",
@@ -17417,7 +17744,7 @@
17417
17744
  "/api/comb/review-batches": {
17418
17745
  "post": {
17419
17746
  "summary": "Send agent-fs comments to the swarm as one lead task",
17420
- "description": "Comb's 'Send to swarm'. The server reads each comment again from agent-fs with its bootstrap key, skips replies, resolved comments, and comments already sent, and creates ONE task for the lead. Each sent comment gets a `[comb:sent task=<id>]` reply from the swarm service account. A comment is sent at most once. When an earlier send lost its reply, the batch posts that reply again (`repaired`). Answers 404 while COMB_ENABLED is off.",
17747
+ "description": "Comb's 'Send to swarm'. The server reads each comment again from agent-fs with its bootstrap key, skips replies, resolved comments, and comments already sent, and creates ONE task for the lead. Each sent comment gets a `[comb:sent task=<id>]` reply from the swarm service account. A comment is sent at most once. An optional `note` from the sender goes into the task text. When an earlier send lost its reply, the batch posts that reply again (`repaired`). Answers 404 while COMB_ENABLED is off.",
17421
17748
  "tags": [
17422
17749
  "Comb"
17423
17750
  ],
@@ -17453,6 +17780,10 @@
17453
17780
  "type": "string",
17454
17781
  "minLength": 1,
17455
17782
  "maxLength": 1024
17783
+ },
17784
+ "note": {
17785
+ "type": "string",
17786
+ "maxLength": 4000
17456
17787
  }
17457
17788
  },
17458
17789
  "required": [
@@ -17529,6 +17860,14 @@
17529
17860
  "taskId"
17530
17861
  ]
17531
17862
  }
17863
+ },
17864
+ "lead": {
17865
+ "type": "string",
17866
+ "enum": [
17867
+ "online",
17868
+ "offline",
17869
+ "none"
17870
+ ]
17532
17871
  }
17533
17872
  },
17534
17873
  "required": [
@@ -17604,6 +17943,14 @@
17604
17943
  "taskId"
17605
17944
  ]
17606
17945
  }
17946
+ },
17947
+ "lead": {
17948
+ "type": "string",
17949
+ "enum": [
17950
+ "online",
17951
+ "offline",
17952
+ "none"
17953
+ ]
17607
17954
  }
17608
17955
  },
17609
17956
  "required": [
@@ -17761,6 +18108,537 @@
17761
18108
  }
17762
18109
  }
17763
18110
  },
18111
+ "/api/config/pool-keys": {
18112
+ "get": {
18113
+ "summary": "List credential pool suffixes and status",
18114
+ "tags": [
18115
+ "Config"
18116
+ ],
18117
+ "security": [
18118
+ {
18119
+ "bearerAuth": []
18120
+ }
18121
+ ],
18122
+ "parameters": [
18123
+ {
18124
+ "schema": {
18125
+ "type": "string"
18126
+ },
18127
+ "required": true,
18128
+ "name": "key",
18129
+ "in": "query"
18130
+ }
18131
+ ],
18132
+ "responses": {
18133
+ "200": {
18134
+ "description": "Credential pool",
18135
+ "content": {
18136
+ "application/json": {
18137
+ "schema": {
18138
+ "type": "object",
18139
+ "properties": {
18140
+ "key": {
18141
+ "type": "string"
18142
+ },
18143
+ "source": {
18144
+ "type": "string",
18145
+ "enum": [
18146
+ "stored",
18147
+ "env",
18148
+ "none"
18149
+ ]
18150
+ },
18151
+ "readOnly": {
18152
+ "type": "boolean"
18153
+ },
18154
+ "keys": {
18155
+ "type": "array",
18156
+ "items": {
18157
+ "type": "object",
18158
+ "properties": {
18159
+ "index": {
18160
+ "type": "integer",
18161
+ "minimum": 0
18162
+ },
18163
+ "suffix": {
18164
+ "type": "string"
18165
+ },
18166
+ "status": {
18167
+ "type": "string",
18168
+ "enum": [
18169
+ "ok",
18170
+ "rejected",
18171
+ "rate_limited",
18172
+ "unchecked"
18173
+ ]
18174
+ },
18175
+ "error": {
18176
+ "type": [
18177
+ "string",
18178
+ "null"
18179
+ ]
18180
+ },
18181
+ "checkedAt": {
18182
+ "type": [
18183
+ "string",
18184
+ "null"
18185
+ ]
18186
+ },
18187
+ "rateLimitedUntil": {
18188
+ "type": [
18189
+ "string",
18190
+ "null"
18191
+ ]
18192
+ }
18193
+ },
18194
+ "required": [
18195
+ "index",
18196
+ "suffix",
18197
+ "status",
18198
+ "error",
18199
+ "checkedAt",
18200
+ "rateLimitedUntil"
18201
+ ]
18202
+ }
18203
+ }
18204
+ },
18205
+ "required": [
18206
+ "key",
18207
+ "source",
18208
+ "readOnly",
18209
+ "keys"
18210
+ ]
18211
+ }
18212
+ }
18213
+ }
18214
+ },
18215
+ "400": {
18216
+ "description": "Invalid pool variable",
18217
+ "content": {
18218
+ "application/json": {
18219
+ "schema": {
18220
+ "$ref": "#/components/schemas/ErrorResponse"
18221
+ }
18222
+ }
18223
+ }
18224
+ },
18225
+ "403": {
18226
+ "description": "Secret read permission required",
18227
+ "content": {
18228
+ "application/json": {
18229
+ "schema": {
18230
+ "$ref": "#/components/schemas/ErrorResponse"
18231
+ }
18232
+ }
18233
+ }
18234
+ }
18235
+ }
18236
+ },
18237
+ "post": {
18238
+ "summary": "Test and append keys to a credential pool",
18239
+ "tags": [
18240
+ "Config"
18241
+ ],
18242
+ "security": [
18243
+ {
18244
+ "bearerAuth": []
18245
+ }
18246
+ ],
18247
+ "requestBody": {
18248
+ "content": {
18249
+ "application/json": {
18250
+ "schema": {
18251
+ "type": "object",
18252
+ "properties": {
18253
+ "key": {
18254
+ "type": "string"
18255
+ },
18256
+ "value": {
18257
+ "type": "string"
18258
+ },
18259
+ "baseUrl": {
18260
+ "type": [
18261
+ "string",
18262
+ "null"
18263
+ ],
18264
+ "description": "Base URL for the check only. Null tests the provider default. Omit to use the stored URL."
18265
+ }
18266
+ },
18267
+ "required": [
18268
+ "key",
18269
+ "value"
18270
+ ]
18271
+ }
18272
+ }
18273
+ }
18274
+ },
18275
+ "responses": {
18276
+ "200": {
18277
+ "description": "Updated credential pool and checks",
18278
+ "content": {
18279
+ "application/json": {
18280
+ "schema": {
18281
+ "type": "object",
18282
+ "properties": {
18283
+ "key": {
18284
+ "type": "string"
18285
+ },
18286
+ "source": {
18287
+ "type": "string",
18288
+ "enum": [
18289
+ "stored",
18290
+ "env",
18291
+ "none"
18292
+ ]
18293
+ },
18294
+ "readOnly": {
18295
+ "type": "boolean"
18296
+ },
18297
+ "keys": {
18298
+ "type": "array",
18299
+ "items": {
18300
+ "type": "object",
18301
+ "properties": {
18302
+ "index": {
18303
+ "type": "integer",
18304
+ "minimum": 0
18305
+ },
18306
+ "suffix": {
18307
+ "type": "string"
18308
+ },
18309
+ "status": {
18310
+ "type": "string",
18311
+ "enum": [
18312
+ "ok",
18313
+ "rejected",
18314
+ "rate_limited",
18315
+ "unchecked"
18316
+ ]
18317
+ },
18318
+ "error": {
18319
+ "type": [
18320
+ "string",
18321
+ "null"
18322
+ ]
18323
+ },
18324
+ "checkedAt": {
18325
+ "type": [
18326
+ "string",
18327
+ "null"
18328
+ ]
18329
+ },
18330
+ "rateLimitedUntil": {
18331
+ "type": [
18332
+ "string",
18333
+ "null"
18334
+ ]
18335
+ }
18336
+ },
18337
+ "required": [
18338
+ "index",
18339
+ "suffix",
18340
+ "status",
18341
+ "error",
18342
+ "checkedAt",
18343
+ "rateLimitedUntil"
18344
+ ]
18345
+ }
18346
+ },
18347
+ "checks": {
18348
+ "type": "array",
18349
+ "items": {
18350
+ "type": "object",
18351
+ "properties": {
18352
+ "suffix": {
18353
+ "type": "string"
18354
+ },
18355
+ "result": {
18356
+ "type": "string",
18357
+ "enum": [
18358
+ "verified",
18359
+ "rejected",
18360
+ "not_tested"
18361
+ ]
18362
+ },
18363
+ "httpStatus": {
18364
+ "type": [
18365
+ "number",
18366
+ "null"
18367
+ ]
18368
+ },
18369
+ "error": {
18370
+ "type": [
18371
+ "string",
18372
+ "null"
18373
+ ]
18374
+ }
18375
+ },
18376
+ "required": [
18377
+ "suffix",
18378
+ "result",
18379
+ "httpStatus",
18380
+ "error"
18381
+ ]
18382
+ }
18383
+ }
18384
+ },
18385
+ "required": [
18386
+ "key",
18387
+ "source",
18388
+ "readOnly",
18389
+ "keys",
18390
+ "checks"
18391
+ ]
18392
+ }
18393
+ }
18394
+ }
18395
+ },
18396
+ "400": {
18397
+ "description": "Invalid key",
18398
+ "content": {
18399
+ "application/json": {
18400
+ "schema": {
18401
+ "$ref": "#/components/schemas/ErrorResponse"
18402
+ }
18403
+ }
18404
+ }
18405
+ },
18406
+ "403": {
18407
+ "description": "Config administration and permission to read all secrets required",
18408
+ "content": {
18409
+ "application/json": {
18410
+ "schema": {
18411
+ "$ref": "#/components/schemas/ErrorResponse"
18412
+ }
18413
+ }
18414
+ }
18415
+ },
18416
+ "409": {
18417
+ "description": "Duplicate key or deployment env pool",
18418
+ "content": {
18419
+ "application/json": {
18420
+ "schema": {
18421
+ "$ref": "#/components/schemas/ErrorResponse"
18422
+ }
18423
+ }
18424
+ }
18425
+ },
18426
+ "422": {
18427
+ "description": "Provider rejected a key. Nothing was saved.",
18428
+ "content": {
18429
+ "application/json": {
18430
+ "schema": {
18431
+ "type": "object",
18432
+ "properties": {
18433
+ "error": {
18434
+ "type": "string"
18435
+ },
18436
+ "checks": {
18437
+ "type": "array",
18438
+ "items": {
18439
+ "type": "object",
18440
+ "properties": {
18441
+ "suffix": {
18442
+ "type": "string"
18443
+ },
18444
+ "result": {
18445
+ "type": "string",
18446
+ "enum": [
18447
+ "verified",
18448
+ "rejected",
18449
+ "not_tested"
18450
+ ]
18451
+ },
18452
+ "httpStatus": {
18453
+ "type": [
18454
+ "number",
18455
+ "null"
18456
+ ]
18457
+ },
18458
+ "error": {
18459
+ "type": [
18460
+ "string",
18461
+ "null"
18462
+ ]
18463
+ }
18464
+ },
18465
+ "required": [
18466
+ "suffix",
18467
+ "result",
18468
+ "httpStatus",
18469
+ "error"
18470
+ ]
18471
+ }
18472
+ }
18473
+ },
18474
+ "required": [
18475
+ "error",
18476
+ "checks"
18477
+ ]
18478
+ }
18479
+ }
18480
+ }
18481
+ }
18482
+ }
18483
+ },
18484
+ "delete": {
18485
+ "summary": "Remove one credential pool member",
18486
+ "tags": [
18487
+ "Config"
18488
+ ],
18489
+ "security": [
18490
+ {
18491
+ "bearerAuth": []
18492
+ }
18493
+ ],
18494
+ "parameters": [
18495
+ {
18496
+ "schema": {
18497
+ "type": "string"
18498
+ },
18499
+ "required": true,
18500
+ "name": "key",
18501
+ "in": "query"
18502
+ },
18503
+ {
18504
+ "schema": {
18505
+ "type": [
18506
+ "integer",
18507
+ "null"
18508
+ ],
18509
+ "minimum": 0
18510
+ },
18511
+ "required": false,
18512
+ "name": "index",
18513
+ "in": "query"
18514
+ },
18515
+ {
18516
+ "schema": {
18517
+ "type": "string",
18518
+ "minLength": 1,
18519
+ "maxLength": 5
18520
+ },
18521
+ "required": true,
18522
+ "name": "suffix",
18523
+ "in": "query"
18524
+ }
18525
+ ],
18526
+ "responses": {
18527
+ "200": {
18528
+ "description": "Updated credential pool",
18529
+ "content": {
18530
+ "application/json": {
18531
+ "schema": {
18532
+ "type": "object",
18533
+ "properties": {
18534
+ "key": {
18535
+ "type": "string"
18536
+ },
18537
+ "source": {
18538
+ "type": "string",
18539
+ "enum": [
18540
+ "stored",
18541
+ "env",
18542
+ "none"
18543
+ ]
18544
+ },
18545
+ "readOnly": {
18546
+ "type": "boolean"
18547
+ },
18548
+ "keys": {
18549
+ "type": "array",
18550
+ "items": {
18551
+ "type": "object",
18552
+ "properties": {
18553
+ "index": {
18554
+ "type": "integer",
18555
+ "minimum": 0
18556
+ },
18557
+ "suffix": {
18558
+ "type": "string"
18559
+ },
18560
+ "status": {
18561
+ "type": "string",
18562
+ "enum": [
18563
+ "ok",
18564
+ "rejected",
18565
+ "rate_limited",
18566
+ "unchecked"
18567
+ ]
18568
+ },
18569
+ "error": {
18570
+ "type": [
18571
+ "string",
18572
+ "null"
18573
+ ]
18574
+ },
18575
+ "checkedAt": {
18576
+ "type": [
18577
+ "string",
18578
+ "null"
18579
+ ]
18580
+ },
18581
+ "rateLimitedUntil": {
18582
+ "type": [
18583
+ "string",
18584
+ "null"
18585
+ ]
18586
+ }
18587
+ },
18588
+ "required": [
18589
+ "index",
18590
+ "suffix",
18591
+ "status",
18592
+ "error",
18593
+ "checkedAt",
18594
+ "rateLimitedUntil"
18595
+ ]
18596
+ }
18597
+ }
18598
+ },
18599
+ "required": [
18600
+ "key",
18601
+ "source",
18602
+ "readOnly",
18603
+ "keys"
18604
+ ]
18605
+ }
18606
+ }
18607
+ }
18608
+ },
18609
+ "400": {
18610
+ "description": "Invalid pool member",
18611
+ "content": {
18612
+ "application/json": {
18613
+ "schema": {
18614
+ "$ref": "#/components/schemas/ErrorResponse"
18615
+ }
18616
+ }
18617
+ }
18618
+ },
18619
+ "403": {
18620
+ "description": "Config administration and permission to read all secrets required",
18621
+ "content": {
18622
+ "application/json": {
18623
+ "schema": {
18624
+ "$ref": "#/components/schemas/ErrorResponse"
18625
+ }
18626
+ }
18627
+ }
18628
+ },
18629
+ "409": {
18630
+ "description": "The pool changed or comes from the deployment env",
18631
+ "content": {
18632
+ "application/json": {
18633
+ "schema": {
18634
+ "$ref": "#/components/schemas/ErrorResponse"
18635
+ }
18636
+ }
18637
+ }
18638
+ }
18639
+ }
18640
+ }
18641
+ },
17764
18642
  "/api/tasks/{id}/context": {
17765
18643
  "post": {
17766
18644
  "summary": "Record a context usage snapshot for a task",
@@ -18212,6 +19090,120 @@
18212
19090
  }
18213
19091
  }
18214
19092
  },
19093
+ "/api/keys/report-validation": {
19094
+ "post": {
19095
+ "summary": "Record live validation results for a credential pool",
19096
+ "tags": [
19097
+ "API Keys"
19098
+ ],
19099
+ "security": [
19100
+ {
19101
+ "bearerAuth": []
19102
+ }
19103
+ ],
19104
+ "requestBody": {
19105
+ "content": {
19106
+ "application/json": {
19107
+ "schema": {
19108
+ "type": "object",
19109
+ "properties": {
19110
+ "keyType": {
19111
+ "type": "string"
19112
+ },
19113
+ "keys": {
19114
+ "type": "array",
19115
+ "items": {
19116
+ "type": "object",
19117
+ "properties": {
19118
+ "keyIndex": {
19119
+ "type": "integer",
19120
+ "minimum": 0
19121
+ },
19122
+ "keySuffix": {
19123
+ "type": "string",
19124
+ "minLength": 1,
19125
+ "maxLength": 10
19126
+ },
19127
+ "ok": {
19128
+ "type": "boolean"
19129
+ },
19130
+ "httpStatus": {
19131
+ "type": "integer"
19132
+ }
19133
+ },
19134
+ "required": [
19135
+ "keyIndex",
19136
+ "keySuffix",
19137
+ "ok"
19138
+ ]
19139
+ },
19140
+ "minItems": 1,
19141
+ "maxItems": 100
19142
+ },
19143
+ "scope": {
19144
+ "type": "string"
19145
+ },
19146
+ "scopeId": {
19147
+ "type": "string"
19148
+ }
19149
+ },
19150
+ "required": [
19151
+ "keyType",
19152
+ "keys"
19153
+ ]
19154
+ }
19155
+ }
19156
+ }
19157
+ },
19158
+ "responses": {
19159
+ "200": {
19160
+ "description": "Validation recorded",
19161
+ "content": {
19162
+ "application/json": {
19163
+ "schema": {
19164
+ "type": "object",
19165
+ "properties": {
19166
+ "success": {
19167
+ "type": "boolean",
19168
+ "enum": [
19169
+ true
19170
+ ]
19171
+ },
19172
+ "message": {
19173
+ "type": "string"
19174
+ }
19175
+ },
19176
+ "required": [
19177
+ "success",
19178
+ "message"
19179
+ ]
19180
+ }
19181
+ }
19182
+ }
19183
+ },
19184
+ "400": {
19185
+ "description": "Validation error",
19186
+ "content": {
19187
+ "application/json": {
19188
+ "schema": {
19189
+ "$ref": "#/components/schemas/ErrorResponse"
19190
+ }
19191
+ }
19192
+ }
19193
+ },
19194
+ "401": {
19195
+ "description": "Unauthorized",
19196
+ "content": {
19197
+ "application/json": {
19198
+ "schema": {
19199
+ "$ref": "#/components/schemas/ErrorResponse"
19200
+ }
19201
+ }
19202
+ }
19203
+ }
19204
+ }
19205
+ }
19206
+ },
18215
19207
  "/api/keys/report-auth-failure": {
18216
19208
  "post": {
18217
19209
  "summary": "Record an auth failure for a pooled key; bench it after 2 in a row",
@@ -18609,6 +19601,14 @@
18609
19601
  "required": false,
18610
19602
  "name": "model",
18611
19603
  "in": "query"
19604
+ },
19605
+ {
19606
+ "schema": {
19607
+ "type": "string"
19608
+ },
19609
+ "required": false,
19610
+ "name": "keySuffixes",
19611
+ "in": "query"
18612
19612
  }
18613
19613
  ],
18614
19614
  "responses": {
@@ -18631,6 +19631,12 @@
18631
19631
  "type": "integer"
18632
19632
  }
18633
19633
  },
19634
+ "rejectedIndices": {
19635
+ "type": "array",
19636
+ "items": {
19637
+ "type": "integer"
19638
+ }
19639
+ },
18634
19640
  "totalKeys": {
18635
19641
  "type": "integer"
18636
19642
  },
@@ -18872,6 +19878,18 @@
18872
19878
  "null"
18873
19879
  ]
18874
19880
  },
19881
+ "lastValidationError": {
19882
+ "type": [
19883
+ "string",
19884
+ "null"
19885
+ ]
19886
+ },
19887
+ "lastValidationFailedAt": {
19888
+ "type": [
19889
+ "string",
19890
+ "null"
19891
+ ]
19892
+ },
18875
19893
  "modelLimits": {
18876
19894
  "type": "array",
18877
19895
  "items": {
@@ -18931,6 +19949,8 @@
18931
19949
  "lastSeatMismatchModel",
18932
19950
  "consecutiveAuthFailures",
18933
19951
  "lastAuthFailureAt",
19952
+ "lastValidationError",
19953
+ "lastValidationFailedAt",
18934
19954
  "modelLimits",
18935
19955
  "createdAt",
18936
19956
  "updatedAt"
@@ -29471,7 +30491,7 @@
29471
30491
  "/status": {
29472
30492
  "get": {
29473
30493
  "summary": "Identity + setup readiness + live activity for the swarm dashboard",
29474
- "description": "Single source of truth consumed by the UI home page. Identity comes from SWARM_* envs; setup milestones each emit `unverified | configured | verified`; automations report `running | needs_setup` from the same runtime preflight used at dispatch; activity counts agents alive in the last 5 min and tasks created in the last 24h; agent_fs reports whether AGENT_FS_API_URL is set, plus the Comb settings (COMB_ENABLED, the browser-facing agent-fs URL, the shared org and drive ids, and the agent-fs user id of the swarm service account); telemetry reports the effective ANONYMIZED_TELEMETRY opt-out state.",
30494
+ "description": "Single source of truth consumed by the UI home page. Identity comes from SWARM_* envs; setup milestones each emit `unverified | configured | verified`; automations report `running | needs_setup` from the same runtime preflight used at dispatch; activity counts agents alive in the last 5 min, leads that can take work (status idle or busy), and tasks created in the last 24h; agent_fs reports whether AGENT_FS_API_URL is set, plus the Comb settings (COMB_ENABLED, the browser-facing agent-fs URL, the shared org and drive ids, and the agent-fs user id of the swarm service account); telemetry reports the effective ANONYMIZED_TELEMETRY opt-out state.",
29475
30495
  "tags": [
29476
30496
  "Status"
29477
30497
  ],
@@ -29664,6 +30684,10 @@
29664
30684
  "type": "integer",
29665
30685
  "minimum": 0
29666
30686
  },
30687
+ "leads_ready": {
30688
+ "type": "integer",
30689
+ "minimum": 0
30690
+ },
29667
30691
  "recent_tasks_count": {
29668
30692
  "type": "integer",
29669
30693
  "minimum": 0
@@ -29672,6 +30696,7 @@
29672
30696
  "required": [
29673
30697
  "agents_online",
29674
30698
  "leads_online",
30699
+ "leads_ready",
29675
30700
  "recent_tasks_count"
29676
30701
  ]
29677
30702
  },
@@ -30590,13 +31615,27 @@
30590
31615
  "verifiedWorkers": {
30591
31616
  "type": "integer",
30592
31617
  "minimum": 0
31618
+ },
31619
+ "error": {
31620
+ "type": [
31621
+ "string",
31622
+ "null"
31623
+ ]
31624
+ },
31625
+ "warning": {
31626
+ "type": [
31627
+ "string",
31628
+ "null"
31629
+ ]
30593
31630
  }
30594
31631
  },
30595
31632
  "required": [
30596
31633
  "provider",
30597
31634
  "state",
30598
31635
  "workers",
30599
- "verifiedWorkers"
31636
+ "verifiedWorkers",
31637
+ "error",
31638
+ "warning"
30600
31639
  ]
30601
31640
  }
30602
31641
  },
@@ -31590,13 +32629,27 @@
31590
32629
  "verifiedWorkers": {
31591
32630
  "type": "integer",
31592
32631
  "minimum": 0
32632
+ },
32633
+ "error": {
32634
+ "type": [
32635
+ "string",
32636
+ "null"
32637
+ ]
32638
+ },
32639
+ "warning": {
32640
+ "type": [
32641
+ "string",
32642
+ "null"
32643
+ ]
31593
32644
  }
31594
32645
  },
31595
32646
  "required": [
31596
32647
  "provider",
31597
32648
  "state",
31598
32649
  "workers",
31599
- "verifiedWorkers"
32650
+ "verifiedWorkers",
32651
+ "error",
32652
+ "warning"
31600
32653
  ]
31601
32654
  }
31602
32655
  },
@@ -31991,6 +33044,15 @@
31991
33044
  "name": "scheduleId",
31992
33045
  "in": "query"
31993
33046
  },
33047
+ {
33048
+ "schema": {
33049
+ "type": "string",
33050
+ "format": "uuid"
33051
+ },
33052
+ "required": false,
33053
+ "name": "workflowRunId",
33054
+ "in": "query"
33055
+ },
31994
33056
  {
31995
33057
  "schema": {
31996
33058
  "type": "string",
@@ -49605,6 +50667,12 @@
49605
50667
  "schema": {
49606
50668
  "type": "object",
49607
50669
  "properties": {
50670
+ "labels": {
50671
+ "type": "object",
50672
+ "additionalProperties": {
50673
+ "type": "string"
50674
+ }
50675
+ },
49608
50676
  "groups": {
49609
50677
  "type": "array",
49610
50678
  "items": {
@@ -50362,6 +51430,9 @@
50362
51430
  "owner": {
50363
51431
  "$ref": "#/components/schemas/SessionOwner"
50364
51432
  },
51433
+ "groupKey": {
51434
+ "type": "string"
51435
+ },
50365
51436
  "approvals": {
50366
51437
  "type": "array",
50367
51438
  "items": {
@@ -50408,7 +51479,8 @@
50408
51479
  "root",
50409
51480
  "chain",
50410
51481
  "access",
50411
- "owner"
51482
+ "owner",
51483
+ "groupKey"
50412
51484
  ]
50413
51485
  }
50414
51486
  }
@@ -52972,6 +54044,17 @@
52972
54044
  "workspace-rw"
52973
54045
  ],
52974
54046
  "default": "none"
54047
+ },
54048
+ "executor": {
54049
+ "type": [
54050
+ "string",
54051
+ "null"
54052
+ ],
54053
+ "enum": [
54054
+ "native",
54055
+ "quickjs",
54056
+ null
54057
+ ]
52975
54058
  }
52976
54059
  },
52977
54060
  "required": [
@@ -53099,6 +54182,17 @@
53099
54182
  ],
53100
54183
  "default": "none"
53101
54184
  },
54185
+ "executor": {
54186
+ "type": [
54187
+ "string",
54188
+ "null"
54189
+ ],
54190
+ "enum": [
54191
+ "native",
54192
+ "quickjs",
54193
+ null
54194
+ ]
54195
+ },
53102
54196
  "idempotencyKey": {
53103
54197
  "type": "string",
53104
54198
  "maxLength": 200
@@ -53685,6 +54779,18 @@
53685
54779
  "workspace-rw"
53686
54780
  ]
53687
54781
  },
54782
+ "executor": {
54783
+ "type": [
54784
+ "string",
54785
+ "null"
54786
+ ],
54787
+ "enum": [
54788
+ "native",
54789
+ "quickjs",
54790
+ null
54791
+ ],
54792
+ "default": null
54793
+ },
53688
54794
  "createdByAgentId": {
53689
54795
  "type": [
53690
54796
  "string",
@@ -53860,6 +54966,18 @@
53860
54966
  "workspace-rw"
53861
54967
  ]
53862
54968
  },
54969
+ "executor": {
54970
+ "type": [
54971
+ "string",
54972
+ "null"
54973
+ ],
54974
+ "enum": [
54975
+ "native",
54976
+ "quickjs",
54977
+ null
54978
+ ],
54979
+ "default": null
54980
+ },
53863
54981
  "createdByAgentId": {
53864
54982
  "type": [
53865
54983
  "string",
@@ -55599,6 +56717,71 @@
55599
56717
  "batchSize",
55600
56718
  "slowestStatementMs"
55601
56719
  ]
56720
+ },
56721
+ "scriptRuns": {
56722
+ "type": "object",
56723
+ "properties": {
56724
+ "at": {
56725
+ "type": "string"
56726
+ },
56727
+ "rowsDeleted": {
56728
+ "type": "number"
56729
+ },
56730
+ "batches": {
56731
+ "type": "number"
56732
+ },
56733
+ "durationMs": {
56734
+ "type": "number"
56735
+ },
56736
+ "dryRun": {
56737
+ "type": "boolean"
56738
+ },
56739
+ "cumulativeRowsDeleted": {
56740
+ "type": "number"
56741
+ },
56742
+ "outcome": {
56743
+ "type": "string",
56744
+ "enum": [
56745
+ "converged",
56746
+ "budget_exhausted",
56747
+ "error"
56748
+ ]
56749
+ },
56750
+ "drained": {
56751
+ "type": "boolean"
56752
+ },
56753
+ "backlogRemaining": {
56754
+ "type": "number"
56755
+ },
56756
+ "batchSize": {
56757
+ "type": "number"
56758
+ },
56759
+ "slowestStatementMs": {
56760
+ "type": "number"
56761
+ },
56762
+ "lastError": {
56763
+ "type": "string"
56764
+ },
56765
+ "lastErrorAt": {
56766
+ "type": "string"
56767
+ },
56768
+ "lastSuccessAt": {
56769
+ "type": "string"
56770
+ }
56771
+ },
56772
+ "required": [
56773
+ "at",
56774
+ "rowsDeleted",
56775
+ "batches",
56776
+ "durationMs",
56777
+ "dryRun",
56778
+ "cumulativeRowsDeleted",
56779
+ "outcome",
56780
+ "drained",
56781
+ "backlogRemaining",
56782
+ "batchSize",
56783
+ "slowestStatementMs"
56784
+ ]
55602
56785
  }
55603
56786
  }
55604
56787
  }
@@ -62392,6 +63575,20 @@
62392
63575
  "name": "id",
62393
63576
  "in": "path"
62394
63577
  },
63578
+ {
63579
+ "schema": {
63580
+ "type": "string",
63581
+ "enum": [
63582
+ "true",
63583
+ "false"
63584
+ ],
63585
+ "description": "Default true: respond after the run's instant steps ran, when it finishes or parks at its first async step. false: respond as soon as the run is committed and walk it in the background."
63586
+ },
63587
+ "required": false,
63588
+ "description": "Default true: respond after the run's instant steps ran, when it finishes or parks at its first async step. false: respond as soon as the run is committed and walk it in the background.",
63589
+ "name": "wait",
63590
+ "in": "query"
63591
+ },
62395
63592
  {
62396
63593
  "schema": {
62397
63594
  "type": "string",
@@ -62664,6 +63861,7 @@
62664
63861
  "/api/workflow-runs/{id}": {
62665
63862
  "get": {
62666
63863
  "summary": "Get a workflow run with steps (includes retry columns)",
63864
+ "description": "Returns the run with its `context` and every step with its `input` by default. A step's `input` is a snapshot of the context when the step started, so in runs with loops (polling, `wait`, iterations) the response grows with steps × context size. Pass `fields=slim` to drop `run.context` and `steps[].input`; outputs, errors, diagnostics, retry fields and `parent` stay.",
62667
63865
  "tags": [
62668
63866
  "Workflows"
62669
63867
  ],
@@ -62680,32 +63878,134 @@
62680
63878
  "required": true,
62681
63879
  "name": "id",
62682
63880
  "in": "path"
63881
+ },
63882
+ {
63883
+ "schema": {
63884
+ "type": "string",
63885
+ "enum": [
63886
+ "full",
63887
+ "slim"
63888
+ ]
63889
+ },
63890
+ "required": false,
63891
+ "name": "fields",
63892
+ "in": "query"
62683
63893
  }
62684
63894
  ],
62685
63895
  "responses": {
62686
63896
  "200": {
62687
63897
  "description": "Workflow run details with steps including retry info",
63898
+ "content": {
63899
+ "application/json": {
63900
+ "schema": {
63901
+ "anyOf": [
63902
+ {
63903
+ "type": "object",
63904
+ "properties": {
63905
+ "run": {
63906
+ "$ref": "#/components/schemas/WorkflowRun"
63907
+ },
63908
+ "steps": {
63909
+ "type": "array",
63910
+ "items": {
63911
+ "$ref": "#/components/schemas/WorkflowRunStep"
63912
+ }
63913
+ },
63914
+ "parent": {
63915
+ "$ref": "#/components/schemas/WorkflowRunParent"
63916
+ }
63917
+ },
63918
+ "required": [
63919
+ "run",
63920
+ "steps"
63921
+ ]
63922
+ },
63923
+ {
63924
+ "type": "object",
63925
+ "properties": {
63926
+ "run": {
63927
+ "$ref": "#/components/schemas/WorkflowRunSummary"
63928
+ },
63929
+ "steps": {
63930
+ "type": "array",
63931
+ "items": {
63932
+ "$ref": "#/components/schemas/WorkflowRunStepSlim"
63933
+ }
63934
+ },
63935
+ "parent": {
63936
+ "$ref": "#/components/schemas/WorkflowRunParent"
63937
+ }
63938
+ },
63939
+ "required": [
63940
+ "run",
63941
+ "steps"
63942
+ ]
63943
+ }
63944
+ ]
63945
+ }
63946
+ }
63947
+ }
63948
+ },
63949
+ "404": {
63950
+ "description": "Run not found",
63951
+ "content": {
63952
+ "application/json": {
63953
+ "schema": {
63954
+ "$ref": "#/components/schemas/ErrorResponse"
63955
+ }
63956
+ }
63957
+ }
63958
+ }
63959
+ }
63960
+ }
63961
+ },
63962
+ "/api/workflow-runs/{id}/tree": {
63963
+ "get": {
63964
+ "summary": "Get a workflow run and every sub-workflow run below it",
63965
+ "description": "Follows stored parent links (`parentStepId` → step → run) through every attempt of every step, terminal runs included. `runs` holds list rows without `context`, root first. `hasOpenWork` is true while any run in the tree is live, has a pending, running or waiting step, a queued retry, an open task or a pending approval; after a cancel it turns false once the tree has settled. Both come from one read snapshot. The tree is not paginated. Links that form a cycle or nest deeper than 32 levels return 409.",
63966
+ "tags": [
63967
+ "Workflows"
63968
+ ],
63969
+ "security": [
63970
+ {
63971
+ "bearerAuth": []
63972
+ }
63973
+ ],
63974
+ "parameters": [
63975
+ {
63976
+ "schema": {
63977
+ "type": "string"
63978
+ },
63979
+ "required": true,
63980
+ "name": "id",
63981
+ "in": "path"
63982
+ }
63983
+ ],
63984
+ "responses": {
63985
+ "200": {
63986
+ "description": "The run tree",
62688
63987
  "content": {
62689
63988
  "application/json": {
62690
63989
  "schema": {
62691
63990
  "type": "object",
62692
63991
  "properties": {
62693
- "run": {
62694
- "$ref": "#/components/schemas/WorkflowRun"
63992
+ "rootRunId": {
63993
+ "type": "string"
62695
63994
  },
62696
- "steps": {
63995
+ "runs": {
62697
63996
  "type": "array",
62698
63997
  "items": {
62699
- "$ref": "#/components/schemas/WorkflowRunStep"
63998
+ "$ref": "#/components/schemas/WorkflowRunSummary"
62700
63999
  }
62701
64000
  },
62702
- "parent": {
62703
- "$ref": "#/components/schemas/WorkflowRunParent"
64001
+ "hasOpenWork": {
64002
+ "type": "boolean"
62704
64003
  }
62705
64004
  },
62706
64005
  "required": [
62707
- "run",
62708
- "steps"
64006
+ "rootRunId",
64007
+ "runs",
64008
+ "hasOpenWork"
62709
64009
  ]
62710
64010
  }
62711
64011
  }
@@ -62720,6 +64020,16 @@
62720
64020
  }
62721
64021
  }
62722
64022
  }
64023
+ },
64024
+ "409": {
64025
+ "description": "Stored parent links form a cycle or nest past the depth bound",
64026
+ "content": {
64027
+ "application/json": {
64028
+ "schema": {
64029
+ "$ref": "#/components/schemas/ErrorResponse"
64030
+ }
64031
+ }
64032
+ }
62723
64033
  }
62724
64034
  }
62725
64035
  }