@desplega.ai/agent-swarm 2.10.0 → 2.12.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 (572) hide show
  1. package/dist/acp-adapter-11m13kx4.js +16 -0
  2. package/dist/{acp-targets-arrwv4f0.js → acp-targets-311gcyvw.js} +9 -9
  3. package/dist/{actions-y0d2n1c2.js → actions-c4chgxp6.js} +27 -24
  4. package/dist/{agent-fs-provision-tpj7sktd.js → agent-fs-provision-0b9awm5n.js} +10 -5
  5. package/dist/{amp-adapter-vmmnmw8d.js → amp-adapter-r0veq6x5.js} +3 -3
  6. package/dist/{anthropic-messages-zdca3gv1.js → anthropic-messages-88b7s3n9.js} +177 -25
  7. package/dist/{app-wb7w45dq.js → app-hn5fftf5.js} +7 -6
  8. package/dist/{approval-notifications-7mqr6vbd.js → approval-notifications-3g6yc8nv.js} +7 -6
  9. package/dist/{assistant-gf60454p.js → assistant-cpjgpjvp.js} +29 -26
  10. package/dist/{azure-openai-responses-b3y7fz36.js → azure-openai-responses-jeaas6x0.js} +10 -10
  11. package/dist/{boot-args-schema-qxmd59sr.js → boot-args-schema-hce1av1h.js} +1 -1
  12. package/dist/{boot-reembed-5tmeskj2.js → boot-reembed-bztbxc4z.js} +1 -1
  13. package/dist/{boot-reembed-wb44vc3s.js → boot-reembed-d7xcym0j.js} +1 -1
  14. package/dist/{boot-scrub-sweep-25bxhnw4.js → boot-scrub-sweep-mkmm16gk.js} +2 -2
  15. package/dist/{boot-seeds-nj9za0vk.js → boot-seeds-arrkbe8t.js} +4 -4
  16. package/dist/{boxd-wn235q80.js → boxd-68n75y1s.js} +2 -2
  17. package/dist/{claude-adapter-d3krpdyb.js → claude-adapter-ykpyr5p8.js} +8 -8
  18. package/dist/{claude-managed-adapter-t8nfgcgz.js → claude-managed-adapter-ssg6z4bt.js} +4 -4
  19. package/dist/{claude-managed-setup-7y4pwd81.js → claude-managed-setup-trd59v7b.js} +4 -4
  20. package/dist/{claude-sdk-session-d138zy0e.js → claude-sdk-session-yjcze0j1.js} +10941 -10412
  21. package/dist/{cli-vq2eg24x.js → cli-01tvvtad.js} +63 -60
  22. package/dist/cli-04zc3f7b.js +68 -0
  23. package/dist/{cli-01k6wpr9.js → cli-0k1a0sde.js} +7 -7
  24. package/dist/{cli-j6te8keb.js → cli-0pp1yjg2.js} +8 -8
  25. package/dist/{cli-0b4zam62.js → cli-0vcqcwfn.js} +18 -0
  26. package/dist/{cli-wwp1bd3n.js → cli-12vek61e.js} +564 -97
  27. package/dist/{cli-rqx70rcz.js → cli-17qzb39j.js} +5 -2
  28. package/dist/{cli-124ntmf0.js → cli-1htmtqc2.js} +143 -63
  29. package/dist/{cli-3f8zbtqa.js → cli-2amwhyv2.js} +15 -11
  30. package/dist/{cli-7sf9sb0w.js → cli-2m6yaq6b.js} +1 -1
  31. package/dist/{cli-6cwr32fe.js → cli-2tw284hj.js} +422 -140
  32. package/dist/{cli-6ehs4mta.js → cli-2z2c4k6q.js} +18 -4
  33. package/dist/{cli-nstkanmx.js → cli-39qm0rtm.js} +8 -8
  34. package/dist/{cli-hnamkvnc.js → cli-3p288654.js} +2 -2
  35. package/dist/{cli-4ymxrwg5.js → cli-4dyzzkfb.js} +2 -2
  36. package/dist/{cli-3kd08rej.js → cli-4jjrhy48.js} +1 -1
  37. package/dist/{cli-kxn3747f.js → cli-4se3x6qm.js} +1 -26
  38. package/dist/cli-52nfye5j.js +673 -0
  39. package/dist/cli-55tc8cj4.js +252 -0
  40. package/dist/cli-5r95eqbh.js +186 -0
  41. package/dist/{cli-6037prsx.js → cli-5tg94mdw.js} +13 -13
  42. package/dist/{cli-2spnz7ye.js → cli-5x03v6en.js} +11137 -8332
  43. package/dist/{cli-y4ccxtz5.js → cli-5z0g0e8v.js} +153 -6
  44. package/dist/{cli-8y43jx2r.js → cli-6p8p2e6r.js} +16 -9
  45. package/dist/{cli-539h29es.js → cli-72yms3ey.js} +224 -189
  46. package/dist/{cli-y8p78ekx.js → cli-73q4g5nx.js} +21 -21
  47. package/dist/{cli-p74md7t8.js → cli-7b7rxz22.js} +13 -15
  48. package/dist/{cli-43ms35q9.js → cli-7wy8gbwb.js} +3 -3
  49. package/dist/{cli-7mv4h3sn.js → cli-7yn42w6m.js} +2 -2
  50. package/dist/{cli-gabsjg8x.js → cli-8hp56wat.js} +3 -2
  51. package/dist/cli-8mfdbdhe.js +43 -0
  52. package/dist/{cli-zcfpsfzf.js → cli-96234j5w.js} +3 -3
  53. package/dist/{cli-1z4qggfe.js → cli-9fvk9mv8.js} +30 -21
  54. package/dist/{cli-2rnd5j3t.js → cli-9qe5y107.js} +2 -2
  55. package/dist/{cli-5mpy301f.js → cli-9t7syepg.js} +1 -1
  56. package/dist/{cli-7cp6aa1q.js → cli-9y4tgrkf.js} +23 -177
  57. package/dist/{cli-7evph51z.js → cli-a49frv85.js} +2 -2
  58. package/dist/{cli-3aaeb78m.js → cli-agjbj5x0.js} +95 -10
  59. package/dist/{cli-th1dkc2v.js → cli-b93d81yg.js} +2 -2
  60. package/dist/{cli-qj39vrc6.js → cli-bhgrhedp.js} +1 -1
  61. package/dist/{cli-2xv18ywz.js → cli-bmqp0ser.js} +2 -2
  62. package/dist/{cli-9fjr27ez.js → cli-bp6k9acz.js} +18 -22
  63. package/dist/{cli-5a6pqy45.js → cli-bpje8n65.js} +31 -4
  64. package/dist/{cli-2v2zdm0a.js → cli-bz97ff9n.js} +2 -2
  65. package/dist/{cli-3caf7pmg.js → cli-c7j31hq9.js} +3 -3
  66. package/dist/{cli-t9ga4qmb.js → cli-cah298e5.js} +40 -33
  67. package/dist/{cli-aw83sr40.js → cli-cjqyse9q.js} +3 -3
  68. package/dist/{cli-b6px1k1q.js → cli-dd2k2mcd.js} +1 -1
  69. package/dist/{cli-nv4xsvmk.js → cli-dkvtfgn4.js} +7 -7
  70. package/dist/{cli-7r162fxe.js → cli-e3ahxq5y.js} +23 -17
  71. package/dist/{cli-3et6fmfe.js → cli-e8n0hdzd.js} +1 -1
  72. package/dist/{cli-tsa40663.js → cli-ebqx630g.js} +3 -3
  73. package/dist/{cli-kbtzfrxj.js → cli-en6dmkxd.js} +3 -3
  74. package/dist/{cli-m9cvf7vs.js → cli-eq4kew31.js} +14 -14
  75. package/dist/{cli-fcfbct2j.js → cli-eqq0hwvx.js} +5 -5
  76. package/dist/{cli-7zm3b3f5.js → cli-ercwc8xn.js} +1 -1
  77. package/dist/{cli-vs9vdpy0.js → cli-ex1y88j3.js} +1 -1
  78. package/dist/{cli-mk7c5ac4.js → cli-fxd1mwtr.js} +2 -2
  79. package/dist/{cli-91pkxres.js → cli-fy4gb74g.js} +2 -2
  80. package/dist/{cli-fq2rr3jb.js → cli-fyaq4zdv.js} +6 -6
  81. package/dist/{cli-cc93xzes.js → cli-gfy6hbd9.js} +28 -17
  82. package/dist/{cli-s1khw52h.js → cli-h70a2mxy.js} +71 -17
  83. package/dist/cli-hbvgzjq4.js +69 -0
  84. package/dist/{cli-qx4f057j.js → cli-hhc47ack.js} +4 -4
  85. package/dist/{cli-q5srsxq2.js → cli-j5gtytvg.js} +154 -41
  86. package/dist/{cli-psffsanb.js → cli-js10kdk7.js} +6 -1
  87. package/dist/{cli-54vrpgm0.js → cli-k3facve0.js} +8 -5
  88. package/dist/{cli-vsw91x06.js → cli-k5jx8jya.js} +10 -6
  89. package/dist/{cli-tr27kwyg.js → cli-krbcr00p.js} +261 -6
  90. package/dist/{cli-5qhfv9rw.js → cli-kwr5qv5g.js} +44 -17
  91. package/dist/{cli-md50mj0r.js → cli-m5qtmrbc.js} +3 -3
  92. package/dist/{cli-vfqvrd82.js → cli-ma9ys8rt.js} +2 -2
  93. package/dist/{cli-w16kwbzw.js → cli-mbwmqb5w.js} +1 -1
  94. package/dist/{cli-w1q68d8x.js → cli-mcymtvwn.js} +322 -72
  95. package/dist/{cli-k3q2va86.js → cli-mq2fbgva.js} +66 -5
  96. package/dist/{cli-xqdz5cqm.js → cli-mz7ycqn8.js} +1 -0
  97. package/dist/{cli-kpgcm7xy.js → cli-n85m2wkq.js} +1 -1
  98. package/dist/{cli-v8z0yga9.js → cli-n8f0fs3c.js} +4 -4
  99. package/dist/{cli-mys27d03.js → cli-nja15knq.js} +3 -3
  100. package/dist/{cli-zk7v5s89.js → cli-pe3yxedk.js} +3 -3
  101. package/dist/{cli-v46zsvqk.js → cli-ph95yejc.js} +2 -2
  102. package/dist/{cli-6237rnyr.js → cli-pqfecppn.js} +1 -1
  103. package/dist/{cli-qrta34nb.js → cli-q2dywc8h.js} +4 -4
  104. package/dist/{cli-k6nejceb.js → cli-q4z9s6zs.js} +2 -2
  105. package/dist/{cli-s1zqk1aj.js → cli-q8tc22bj.js} +15 -9
  106. package/dist/{cli-hg42n3hx.js → cli-qrzq3hvg.js} +8 -8
  107. package/dist/{cli-43evxwj4.js → cli-r0mz92by.js} +9 -4
  108. package/dist/{cli-jrbq4djp.js → cli-r14ac1y0.js} +1 -1
  109. package/dist/{cli-5gpqgs8b.js → cli-rtmqzat7.js} +2 -2
  110. package/dist/{cli-tvgqesec.js → cli-s6zk31gr.js} +4 -4
  111. package/dist/{cli-6ym4jhzp.js → cli-sv2r3bw8.js} +7 -7
  112. package/dist/{cli-wafmk3fn.js → cli-t75xngj1.js} +12 -12
  113. package/dist/{cli-x40a0w9j.js → cli-tdk7jtka.js} +1 -1
  114. package/dist/{cli-zeh2mhkg.js → cli-tm60vtax.js} +1 -1
  115. package/dist/cli-tsfkcd4v.js +30 -0
  116. package/dist/{cli-8st34zhr.js → cli-v9ya390t.js} +57 -19
  117. package/dist/{cli-zfqg6fzn.js → cli-vbppqvte.js} +3 -3
  118. package/dist/{cli-p0n7b5rz.js → cli-wvjqaqcp.js} +2907 -151
  119. package/dist/{cli-sb4426be.js → cli-xf4z5bdn.js} +5 -5
  120. package/dist/{cli-p0c3vtch.js → cli-xm34qj8m.js} +772 -515
  121. package/dist/{cli-z0m452jr.js → cli-ya3kf4gs.js} +1 -1
  122. package/dist/{cli-had1p04a.js → cli-yegz2g06.js} +4 -4
  123. package/dist/{cli-k5yewqgd.js → cli-yfpc6qy9.js} +3 -3
  124. package/dist/{cli-q2d3e1k1.js → cli-z4f346g5.js} +1 -1
  125. package/dist/{cli-yab6sh8p.js → cli-zcghfsdg.js} +23 -4
  126. package/dist/cli.js +34 -30
  127. package/dist/{cloudflare-workers-ai-system-one-4aysy6rh.js → cloudflare-workers-ai-system-one-w3m0fbf8.js} +2 -2
  128. package/dist/{codex-adapter-exfdbj73.js → codex-adapter-wc6e4wct.js} +8 -8
  129. package/dist/{codex-hook-59atdwd8.js → codex-hook-aqtj17yr.js} +1 -1
  130. package/dist/{codex-login-a239g1ah.js → codex-login-1ven7yje.js} +1 -1
  131. package/dist/{codex-session-runner-xhznc4g3.js → codex-session-runner-ppfgjd97.js} +9 -9
  132. package/dist/{commands-d8g349v4.js → commands-tsv2vx5b.js} +3 -3
  133. package/dist/{controller-mwgdmb8y.js → controller-ye4sdwsy.js} +4 -4
  134. package/dist/{controllers-connect-5v7qx04j.js → controllers-connect-zn4dg69h.js} +25 -22
  135. package/dist/core-dxcy02sc.js +41 -0
  136. package/dist/{cursor-adapter-p2q5h35d.js → cursor-adapter-q2g9vwts.js} +2 -2
  137. package/dist/{db-wcw0b2j8.js → db-3r1fyr2n.js} +6 -2
  138. package/dist/{db-qpganbeb.js → db-g111qn9j.js} +3 -3
  139. package/dist/{devin-adapter-zp4tqq53.js → devin-adapter-t8d86q9x.js} +1 -1
  140. package/dist/{dispatcher-8d8s49yz.js → dispatcher-4q8s0mx8.js} +22 -19
  141. package/dist/{docker-09tkkg0n.js → docker-1b41eysj.js} +51 -14
  142. package/dist/{dsh-adapter-me0twn13.js → dsh-adapter-mmcw1z5s.js} +2 -2
  143. package/dist/{e2b-3v1e745x.js → e2b-ew8c5j5v.js} +3 -3
  144. package/dist/{e2b-sm28k0k3.js → e2b-xm60c8ad.js} +6 -6
  145. package/dist/{easter-egg-3d-wv7w5ty6.js → easter-egg-3d-04ke6hcp.js} +1 -1
  146. package/dist/{embedding-space-e48xchqa.js → embedding-space-kcdn52vz.js} +6 -6
  147. package/dist/{embeddings-tgq2afbq.js → embeddings-jnzcd91a.js} +1 -1
  148. package/dist/{event-bus-xr83x566.js → event-bus-v4ywhc2p.js} +1 -1
  149. package/dist/{execute-8rhwrk7f.js → execute-74amghty.js} +8 -4
  150. package/dist/{external-channel-8bt3j2pm.js → external-channel-v9zgxnxz.js} +2 -2
  151. package/dist/fx-adapter-0ar6pqm3.js +19 -0
  152. package/dist/{google-generative-ai-bh0djqjp.js → google-generative-ai-sw77egmr.js} +9 -9
  153. package/dist/{google-vertex-prjbw8dj.js → google-vertex-rrw93g8h.js} +9 -9
  154. package/dist/grok-adapter-t6m74fb1.js +19 -0
  155. package/dist/handlers-9kwcrc4k.js +38 -0
  156. package/dist/{heartbeat-x0056ra5.js → heartbeat-p8pk1msj.js} +25 -22
  157. package/dist/{hook-a7vmn2st.js → hook-k1h73zd7.js} +5 -5
  158. package/dist/{hook-mrd2ayxv.js → hook-p5reemds.js} +8 -8
  159. package/dist/{http-ym9c5svp.js → http-ms1z5xxy.js} +2549 -224
  160. package/dist/index-23cdfzr6.js +39 -0
  161. package/dist/{index-01ns1pkw.js → index-76zzxtzf.js} +1 -1
  162. package/dist/{index-ny60jcat.js → index-fbkqhvvj.js} +40 -18
  163. package/dist/index-g7kkjs5b.js +38 -0
  164. package/dist/{index-x6azjwm8.js → index-gjn6qfgn.js} +1 -1
  165. package/dist/{index-b5wgnm78.js → index-kdmkfjt7.js} +4 -4
  166. package/dist/{index-p46tvwtx.js → index-kn63q1gr.js} +28 -25
  167. package/dist/{index-9myfj74s.js → index-kzdqn3dd.js} +3 -3
  168. package/dist/{index-4a0670yh.js → index-p2f5xg64.js} +6 -6
  169. package/dist/index-stk36pa5.js +43 -0
  170. package/dist/{k8s-m56sw868.js → k8s-fy8hbhkg.js} +73 -14
  171. package/dist/{keepalive-7yxg8z4c.js → keepalive-031js8jz.js} +4 -4
  172. package/dist/lead-mfggjtfk.js +77 -0
  173. package/dist/{llama-cpp-classify-nfgswa1m.js → llama-cpp-classify-yvb8vh7w.js} +2 -2
  174. package/dist/{maintenance-6tefxmk1.js → maintenance-sq9v3qx9.js} +1 -1
  175. package/dist/{mistral-conversations-tm2vd4gc.js → mistral-conversations-w4bncwbt.js} +7 -7
  176. package/dist/{node-7qsx5kvm.js → node-z67yjre7.js} +19 -13
  177. package/dist/{oauth-refresh-sweep-70cavc3a.js → oauth-refresh-sweep-zqmnyvs8.js} +3 -3
  178. package/dist/object-webhooks-r24wwb5y.js +21 -0
  179. package/dist/{onboard-fja65z08.js → onboard-p25yhh7t.js} +5 -5
  180. package/dist/{openai-codex-responses-sxjv60xx.js → openai-codex-responses-70g39cgz.js} +20 -14
  181. package/dist/{openai-completions-0c7qnhsx.js → openai-completions-cv3hp4h5.js} +18 -11
  182. package/dist/{openai-decisions-ytp6w6xh.js → openai-decisions-fyq1p9f9.js} +2 -2
  183. package/dist/{openai-responses-a7h29chp.js → openai-responses-trsvnks6.js} +13 -11
  184. package/dist/{opencode-adapter-hakkm7yh.js → opencode-adapter-wcjc4zdk.js} +7 -7
  185. package/dist/{openrouter-images-xr9gme9x.js → openrouter-images-0jj12a2q.js} +6 -6
  186. package/dist/{otel-impl-7zhnt6gj.js → otel-impl-ff1gf20m.js} +2 -2
  187. package/dist/{pending-h01yzpx4.js → pending-hxj5yatb.js} +23 -20
  188. package/dist/{pi-messages-2j0fpqwq.js → pi-messages-zk3g4esn.js} +1 -1
  189. package/dist/{pi-mono-adapter-f52hz743.js → pi-mono-adapter-vkp4zz7p.js} +19 -18
  190. package/dist/{pricing-refresh-fzxvk2zf.js → pricing-refresh-9w7gx41w.js} +2 -2
  191. package/dist/{rbac-roles-9v6vhgbs.js → rbac-roles-84aw10nz.js} +3 -3
  192. package/dist/{rbac-roles-hfgh8sba.js → rbac-roles-hz74vckp.js} +2 -2
  193. package/dist/{registry-32b1mft6.js → registry-eeyx1201.js} +1 -1
  194. package/dist/{render-v2-1rgspxzf.js → render-v2-nrdkg9gf.js} +7 -6
  195. package/dist/{resume-tqy61x24.js → resume-s6ey36rh.js} +9 -8
  196. package/dist/{runtime-exkxyx5f.js → runtime-x0b4pyam.js} +2 -2
  197. package/dist/{session-access-3act7vt4.js → session-access-xv49tk14.js} +4 -4
  198. package/dist/{session-source-backfill-82qe7fqq.js → session-source-backfill-r5j988ah.js} +3 -3
  199. package/dist/{setup-ry1vfdef.js → setup-mj0krk1p.js} +1 -1
  200. package/dist/thread-buffer-temgaqsy.js +41 -0
  201. package/dist/tree-visibility-cbrsfaar.js +24 -0
  202. package/dist/{typesafe-system-one-vcfj2ak8.js → typesafe-system-one-qkvkgrcz.js} +2 -2
  203. package/dist/{user-merge-jobs-bx6bf7db.js → user-merge-jobs-f9d8nwnw.js} +3 -3
  204. package/dist/{virtual-modules-s0rjzcqq.js → virtual-modules-ns0ryw05.js} +32 -10
  205. package/dist/{work-objects-z2e5tv03.js → work-objects-pydhzast.js} +25 -22
  206. package/dist/worker-efcemc22.js +77 -0
  207. package/dist/{worker-follow-up-y3xeg89w.js → worker-follow-up-9z2xec5e.js} +22 -19
  208. package/dist/{x-wg164ss9.js → x-3dtaf2r9.js} +2 -2
  209. package/openapi.json +2040 -559
  210. package/package.json +15 -11
  211. package/src/azure-devops/auth.ts +2 -3
  212. package/src/be/agent-fs-identity.ts +46 -0
  213. package/src/be/agent-history.ts +215 -0
  214. package/src/be/db/agents.ts +34 -12
  215. package/src/be/db/request-composition.ts +190 -0
  216. package/src/be/db/runtime.ts +15 -0
  217. package/src/be/db/slack-trees.ts +220 -10
  218. package/src/be/db/tasks/human-free.ts +3 -2
  219. package/src/be/db/tasks/write.ts +2 -2
  220. package/src/be/db/workflow-run-retention.ts +101 -0
  221. package/src/be/db-client.ts +23 -1
  222. package/src/be/db-retention-defaults.ts +46 -0
  223. package/src/be/db-retention.ts +55 -6
  224. package/src/be/db.ts +2 -0
  225. package/src/be/mcp-events/catalog.ts +108 -0
  226. package/src/be/mcp-events/dispatcher.ts +202 -0
  227. package/src/be/mcp-events/protocol.ts +296 -0
  228. package/src/be/mcp-events/store.ts +231 -0
  229. package/src/be/mcp-events/webhook.ts +226 -0
  230. package/src/be/memory/providers/sqlite-store.ts +110 -24
  231. package/src/be/memory/review-recall-filter.ts +22 -0
  232. package/src/be/memory/search-candidates.ts +5 -7
  233. package/src/be/memory/types.ts +5 -0
  234. package/src/be/migrations/322_runtime_pool_workspace.sql +8 -0
  235. package/src/be/migrations/323_slack_task_tree_visibility.sql +9 -0
  236. package/src/be/migrations/326_slack_reconcile_pages.sql +13 -0
  237. package/src/be/migrations/327_mcp_event_subscriptions.sql +57 -0
  238. package/src/be/migrations/329_workflow_run_retention.sql +9 -0
  239. package/src/be/migrations/330_request_composition.sql +22 -0
  240. package/src/be/migrations/332_primitive_objects.sql +31 -0
  241. package/src/be/migrations/334_agent_history.sql +23 -0
  242. package/src/be/migrations/335_primitive_object_webhooks.sql +36 -0
  243. package/src/be/model-profile-check.ts +1 -1
  244. package/src/be/multi-runtime.ts +32 -4
  245. package/src/be/primitives/boards/elements.ts +717 -0
  246. package/src/be/primitives/boards/excalifont-metrics.json +516 -0
  247. package/src/be/primitives/boards/service.ts +121 -0
  248. package/src/be/primitives/object-webhooks.ts +348 -0
  249. package/src/be/primitives/objects.ts +686 -0
  250. package/src/be/primitives/sheets/a1.ts +136 -0
  251. package/src/be/primitives/sheets/engine-worker.ts +194 -0
  252. package/src/be/primitives/sheets/engine.ts +199 -0
  253. package/src/be/primitives/sheets/format.ts +106 -0
  254. package/src/be/primitives/sheets/service.ts +415 -0
  255. package/src/be/primitives/write-object.ts +83 -0
  256. package/src/be/runtime-pools/controllers.ts +18 -3
  257. package/src/be/runtime-pools/db.ts +15 -4
  258. package/src/be/runtime-pools/supervisor.ts +42 -2
  259. package/src/be/script-credential-broker.ts +8 -27
  260. package/src/be/scripts/typecheck.ts +216 -0
  261. package/src/be/seed/agent-fs-provision.ts +18 -0
  262. package/src/be/swarm-config-guard.ts +10 -2
  263. package/src/be/users.ts +19 -0
  264. package/src/commands/context-preamble.ts +11 -4
  265. package/src/commands/credential-outcome-report.ts +33 -9
  266. package/src/commands/e2b-stack-wizard.tsx +12 -6
  267. package/src/commands/onboard/agent-fs-version.ts +1 -1
  268. package/src/commands/onboard/steps/harness.tsx +1 -1
  269. package/src/commands/provider-credentials.ts +1 -0
  270. package/src/commands/runner.ts +116 -12
  271. package/src/e2b/env.ts +3 -1
  272. package/src/extensions/catalog.generated.json +1 -1
  273. package/src/fs/agent-fs-provider.ts +33 -2
  274. package/src/github/app.ts +59 -14
  275. package/src/gitlab/auth.ts +3 -4
  276. package/src/heartbeat/heartbeat.ts +11 -11
  277. package/src/http/agent-lifecycle.ts +152 -0
  278. package/src/http/agents.ts +12 -0
  279. package/src/http/all-routes.ts +4 -0
  280. package/src/http/auth.ts +2 -1
  281. package/src/http/config.ts +2 -1
  282. package/src/http/core.ts +2 -0
  283. package/src/http/github-token.ts +66 -0
  284. package/src/http/index.ts +36 -0
  285. package/src/http/mcp-user.ts +11 -8
  286. package/src/http/mcp.ts +58 -42
  287. package/src/http/object-webhooks.ts +101 -0
  288. package/src/http/operator-actor.ts +2 -1
  289. package/src/http/prompt-templates.ts +1 -0
  290. package/src/http/request-composition.ts +310 -0
  291. package/src/http/sessions.ts +7 -0
  292. package/src/http/tasks.ts +6 -1
  293. package/src/http/tool-schema-estimate.ts +95 -0
  294. package/src/http/workflows.ts +61 -11
  295. package/src/integrations/chat-sdk/inbound.ts +2 -2
  296. package/src/integrations/chat-sdk/outbound-files.ts +3 -2
  297. package/src/prompts/base-prompt.ts +133 -7
  298. package/src/prompts/resolver.ts +41 -2
  299. package/src/providers/acp-targets.ts +2 -2
  300. package/src/providers/amp-adapter.ts +1 -1
  301. package/src/providers/opencode-adapter.ts +76 -2
  302. package/src/providers/opencode-swarm-plugin.ts +22 -3
  303. package/src/providers/pi-mono-adapter.ts +1 -0
  304. package/src/providers/pi-mono-extension.ts +71 -0
  305. package/src/providers/pricing-sources.md +4 -0
  306. package/src/providers/request-composition-hook.ts +312 -0
  307. package/src/providers/types.ts +5 -0
  308. package/src/rbac/legacy-policy.ts +2 -0
  309. package/src/rbac/permissions.ts +5 -0
  310. package/src/runtime-providers/controller-protocol.ts +7 -0
  311. package/src/runtime-providers/docker.ts +80 -12
  312. package/src/runtime-providers/k8s.ts +111 -6
  313. package/src/runtime-providers/types.ts +17 -0
  314. package/src/scheduler/scheduler.ts +1 -1
  315. package/src/script-workflows/guest-ctx.ts +32 -0
  316. package/src/script-workflows/workflow-ctx.ts +2 -0
  317. package/src/scripts-runtime/ctx.ts +9 -1
  318. package/src/scripts-runtime/executors/native.ts +106 -21
  319. package/src/scripts-runtime/executors/quickjs-prelude.ts +9 -2
  320. package/src/scripts-runtime/executors/quickjs-runner.ts +12 -1
  321. package/src/scripts-runtime/sdk-allowlist.ts +88 -0
  322. package/src/scripts-runtime/swarm-sdk.ts +51 -3
  323. package/src/scripts-runtime/types/stdlib.d.ts +267 -0
  324. package/src/scripts-runtime/types/swarm-sdk.d.ts +267 -0
  325. package/src/server-user.ts +16 -1
  326. package/src/server.ts +48 -0
  327. package/src/slack/ack.ts +10 -5
  328. package/src/slack/actions.ts +3 -3
  329. package/src/slack/app.ts +2 -0
  330. package/src/slack/assistant.ts +4 -4
  331. package/src/slack/blocks.ts +3 -3
  332. package/src/slack/handlers.ts +3 -3
  333. package/src/slack/reaction-shortcode.ts +23 -2
  334. package/src/slack/render-v2.ts +297 -200
  335. package/src/slack/responses.ts +7 -5
  336. package/src/slack/thread-buffer.ts +3 -3
  337. package/src/slack/tree-visibility.ts +64 -0
  338. package/src/tasks/worker-follow-up.ts +127 -17
  339. package/src/tests/agent-history.test.ts +313 -0
  340. package/src/tests/azure-devops-auth.test.ts +6 -0
  341. package/src/tests/azure-devops-outbound.test.ts +47 -14
  342. package/src/tests/base-prompt.test.ts +149 -1
  343. package/src/tests/chat-sdk-outbound-files.test.ts +3 -1
  344. package/src/tests/check-playwright-version.test.ts +33 -0
  345. package/src/tests/check-unit-test-allowlist.test.ts +193 -0
  346. package/src/tests/context-preamble-budget.test.ts +65 -0
  347. package/src/tests/credential-check.test.ts +12 -0
  348. package/src/tests/credential-outcome-report.test.ts +81 -1
  349. package/src/tests/db-client.test.ts +22 -0
  350. package/src/tests/db-retention-defaults.test.ts +244 -0
  351. package/src/tests/db-retention.test.ts +2 -1
  352. package/src/tests/db-task-read-contract.test.ts +2 -0
  353. package/src/tests/db-task-write-contract.test.ts +2 -0
  354. package/src/tests/deploy-release-dispatch.test.ts +332 -0
  355. package/src/tests/e2b-stack-wizard.test.tsx +156 -0
  356. package/src/tests/e2e-coverage-contract.test.ts +6 -2
  357. package/src/tests/e2e-diff-coverage.test.ts +154 -0
  358. package/src/tests/e2e-rerun-quarantine.test.ts +180 -0
  359. package/src/tests/e2e-shards.test.ts +137 -0
  360. package/src/tests/e2e-tracker-ingest.test.ts +266 -0
  361. package/src/tests/entrypoint-chown-no-follow.test.ts +69 -0
  362. package/src/tests/entrypoint-repo-clone-target.test.ts +112 -0
  363. package/src/tests/env-flag.test.ts +4 -2
  364. package/src/tests/event-loop-lag.test.ts +12 -18
  365. package/src/tests/extensions-example-slack-reply-gate.test.ts +15 -0
  366. package/src/tests/extensions-heartbeat.test.ts +34 -0
  367. package/src/tests/fixtures/base-prompt-baseline-cases.ts +78 -0
  368. package/src/tests/fixtures/base-prompt-baseline.json +18 -0
  369. package/src/tests/github-app-worker-auth-helper.test.ts +325 -0
  370. package/src/tests/github-installation-token-route.test.ts +199 -0
  371. package/src/tests/gitlab-auth.test.ts +10 -0
  372. package/src/tests/heartbeat.test.ts +38 -0
  373. package/src/tests/http-api-integration.test.ts +0 -6
  374. package/src/tests/mcp-user-events.test.ts +708 -0
  375. package/src/tests/memory-key-paths.test.ts +4 -1
  376. package/src/tests/memory-search-stall.test.ts +421 -0
  377. package/src/tests/migration-322-runtime-pool-workspace.test.ts +116 -0
  378. package/src/tests/migration-329-workflow-run-retention.test.ts +32 -0
  379. package/src/tests/model-profile-fallbacks.test.ts +236 -2
  380. package/src/tests/opencode-adapter.test.ts +97 -0
  381. package/src/tests/pi-mono-extension.test.ts +168 -0
  382. package/src/tests/preload-env.test.ts +61 -1
  383. package/src/tests/preload.ts +22 -0
  384. package/src/tests/primitives-boards.test.ts +686 -0
  385. package/src/tests/primitives-object-webhooks.test.ts +642 -0
  386. package/src/tests/primitives-objects.test.ts +248 -0
  387. package/src/tests/prompt-template-resolver.test.ts +85 -0
  388. package/src/tests/reasoning-kind-ui-parity.test.ts +112 -0
  389. package/src/tests/reload-config.test.ts +45 -0
  390. package/src/tests/request-composition.test.ts +447 -0
  391. package/src/tests/runner-max-concurrent.test.ts +86 -0
  392. package/src/tests/runtime-pools-db.test.ts +80 -0
  393. package/src/tests/runtime-provider-registration.test.ts +8 -0
  394. package/src/tests/runtime-providers-docker.test.ts +192 -1
  395. package/src/tests/runtime-providers-k8s.test.ts +127 -0
  396. package/src/tests/runtime-remote-controller.test.ts +64 -1
  397. package/src/tests/runtime-supervisor.test.ts +101 -0
  398. package/src/tests/script-connections.test.ts +8 -0
  399. package/src/tests/script-native-sandbox-identity.test.ts +264 -0
  400. package/src/tests/scripts-namespaces.test.ts +211 -0
  401. package/src/tests/secret-scrub-gate.test.ts +1 -0
  402. package/src/tests/secret-scrubber-convex.test.ts +168 -0
  403. package/src/tests/secret-scrubber.test.ts +1 -1
  404. package/src/tests/session-tokens.test.ts +27 -0
  405. package/src/tests/sheet-engine.test.ts +58 -0
  406. package/src/tests/slack-blocks.test.ts +18 -0
  407. package/src/tests/slack-empty-icon-config.test.ts +113 -0
  408. package/src/tests/slack-file-tools-attachments.test.ts +74 -6
  409. package/src/tests/slack-reaction-config.test.ts +38 -2
  410. package/src/tests/slack-read-boundaries.test.ts +4 -2
  411. package/src/tests/slack-render-v2-query-plans.test.ts +100 -1
  412. package/src/tests/slack-render-v2-reconcile.test.ts +75 -4
  413. package/src/tests/slack-render-v2.test.ts +683 -11
  414. package/src/tests/swarm-config-reserved-keys.test.ts +1 -0
  415. package/src/tests/task-session-prompts.test.ts +37 -0
  416. package/src/tests/task-start-after-commit.test.ts +82 -0
  417. package/src/tests/ui-logs-parser.test.ts +67 -0
  418. package/src/tests/user-delete-perf.test.ts +36 -9
  419. package/src/tests/webhook-filter.test.ts +327 -0
  420. package/src/tests/workflow-async-v2.test.ts +19 -16
  421. package/src/tests/workflow-e2e.test.ts +1 -9
  422. package/src/tests/workflow-finalization-races.test.ts +553 -0
  423. package/src/tests/workflow-foreach.test.ts +2 -0
  424. package/src/tests/workflow-hitl-routing.test.ts +26 -20
  425. package/src/tests/workflow-http-v2.test.ts +105 -2
  426. package/src/tests/workflow-idempotency.test.ts +41 -0
  427. package/src/tests/workflow-mcp-webhook-filter.test.ts +214 -0
  428. package/src/tests/workflow-parallel-park.test.ts +297 -0
  429. package/src/tests/workflow-retry-v2.test.ts +158 -21
  430. package/src/tests/workflow-retry-validation.test.ts +13 -13
  431. package/src/tests/workflow-runs-retention.test.ts +533 -0
  432. package/src/tests/workflow-script-principal.test.ts +7 -2
  433. package/src/tests/workflow-tla-races.test.ts +36 -2
  434. package/src/tests/workflow-triggers-v2.test.ts +201 -0
  435. package/src/tests/workflow-wait-builtin-events.test.ts +3 -1
  436. package/src/tests/workflow-wait-event.test.ts +28 -2
  437. package/src/tests/workflow-wait-poller.test.ts +94 -0
  438. package/src/tests/workflow-wait-time.test.ts +7 -3
  439. package/src/tests/workflow-wait.ts +44 -0
  440. package/src/tools/boards.ts +260 -0
  441. package/src/tools/objects.ts +191 -0
  442. package/src/tools/sheets.ts +312 -0
  443. package/src/tools/slack-read.ts +10 -3
  444. package/src/tools/tool-config.ts +23 -0
  445. package/src/tools/workflows/create-workflow.ts +18 -4
  446. package/src/tools/workflows/patch-workflow-node.ts +4 -0
  447. package/src/tools/workflows/patch-workflow.ts +4 -0
  448. package/src/tools/workflows/update-workflow.ts +24 -3
  449. package/src/types.ts +216 -2
  450. package/src/utils/credentials.ts +7 -0
  451. package/src/utils/sandboxed-process.ts +47 -2
  452. package/src/utils/secret-scrubber.ts +61 -6
  453. package/src/workflows/checkpoint.ts +18 -0
  454. package/src/workflows/engine.ts +73 -31
  455. package/src/workflows/foreach-driver.ts +42 -4
  456. package/src/workflows/input.ts +29 -1
  457. package/src/workflows/patch-definition.ts +15 -1
  458. package/src/workflows/recovery.ts +6 -1
  459. package/src/workflows/resume.ts +11 -3
  460. package/src/workflows/retry-poller.ts +32 -6
  461. package/src/workflows/successor-routing.ts +108 -0
  462. package/src/workflows/task-step-routing.ts +5 -2
  463. package/src/workflows/triggers.ts +21 -36
  464. package/src/workflows/validation.ts +10 -0
  465. package/src/workflows/wait-poller.ts +6 -2
  466. package/src/workflows/webhook-filter.ts +203 -0
  467. package/templates/ai-toolbox.manifest.json +1 -1
  468. package/templates/extensions/slack-reply-gate/hooks.ts +8 -4
  469. package/templates/skills/agent-browser/SKILL.md +1 -0
  470. package/templates/skills/agent-browser/content.md +1 -0
  471. package/templates/skills/pages/content.md +5 -0
  472. package/templates/skills/swarm-docs/content.md +8 -1
  473. package/templates/skills/swarm-scripts/SKILL.md +1 -0
  474. package/templates/skills/swarm-scripts/content.md +1 -0
  475. package/templates/skills/tdd-planning/content.md +5 -2
  476. package/dist/acp-adapter-bht22g3k.js +0 -16
  477. package/dist/core-sxy4epp2.js +0 -38
  478. package/dist/fx-adapter-adtdb3jb.js +0 -19
  479. package/dist/grok-adapter-accnn9km.js +0 -19
  480. package/dist/handlers-1x77561e.js +0 -35
  481. package/dist/index-48qzcqzj.js +0 -35
  482. package/dist/index-rkvaambe.js +0 -36
  483. package/dist/index-xj1mq27m.js +0 -40
  484. package/dist/lead-enzn86bz.js +0 -74
  485. package/dist/thread-buffer-3x93yexa.js +0 -38
  486. package/dist/worker-zfcv2wbf.js +0 -74
  487. package/src/slack/socket-mode-guard.test.ts +0 -25
  488. package/src/tests/agent-activity.test.ts +0 -247
  489. package/src/tests/agent-fs-live-url.test.ts +0 -55
  490. package/src/tests/agentmail-inbox-mapping.test.ts +0 -73
  491. package/src/tests/approval-sweeps-config.test.ts +0 -47
  492. package/src/tests/cards.test.ts +0 -169
  493. package/src/tests/chat-sdk-facts.test.ts +0 -23
  494. package/src/tests/config-env-export-chat-sdk.test.ts +0 -11
  495. package/src/tests/core-auth.test.ts +0 -156
  496. package/src/tests/date-utils.test.ts +0 -48
  497. package/src/tests/db-context-versions.test.ts +0 -37
  498. package/src/tests/db-runtime.test.ts +0 -131
  499. package/src/tests/enabled-capabilities.test.ts +0 -20
  500. package/src/tests/extensions-example-mcp-install.test.ts +0 -67
  501. package/src/tests/extensions-lead-equivalence.test.ts +0 -70
  502. package/src/tests/get-workflow-run-tool.test.ts +0 -98
  503. package/src/tests/github-event-labels.test.ts +0 -24
  504. package/src/tests/haiku-5-5-pricing.test.ts +0 -38
  505. package/src/tests/http-log-scrubbing.test.ts +0 -123
  506. package/src/tests/http-semconv-attributes.test.ts +0 -92
  507. package/src/tests/identity.test.ts +0 -117
  508. package/src/tests/inbox-state.test.ts +0 -167
  509. package/src/tests/internal-ai/models.test.ts +0 -54
  510. package/src/tests/launch-password-rejection.test.ts +0 -140
  511. package/src/tests/list-total-cache.test.ts +0 -88
  512. package/src/tests/match-route.test.ts +0 -187
  513. package/src/tests/memory-feature-flags.test.ts +0 -45
  514. package/src/tests/memory-get-tool.test.ts +0 -269
  515. package/src/tests/memory-health-endpoint.test.ts +0 -78
  516. package/src/tests/memory-http-access.test.ts +0 -221
  517. package/src/tests/memory-retrieval-purge.test.ts +0 -99
  518. package/src/tests/multi-runtime-enabled-stats.test.ts +0 -229
  519. package/src/tests/openai-embedding-provider.test.ts +0 -159
  520. package/src/tests/org-identity.test.ts +0 -44
  521. package/src/tests/pages-actions-endpoint.test.ts +0 -103
  522. package/src/tests/pages-browser-sdk.test.ts +0 -76
  523. package/src/tests/pages-feedback-keys.test.ts +0 -121
  524. package/src/tests/pages-frame-ancestors.test.ts +0 -189
  525. package/src/tests/pages-list-endpoint.test.ts +0 -148
  526. package/src/tests/pages-password-mode.test.ts +0 -266
  527. package/src/tests/pages-public-authed-401.test.ts +0 -103
  528. package/src/tests/pages-public-html.test.ts +0 -297
  529. package/src/tests/pages-public-json-redirect.test.ts +0 -122
  530. package/src/tests/pages-view-count.test.ts +0 -245
  531. package/src/tests/prompt-templates-db.test.ts +0 -616
  532. package/src/tests/rbac-engine.test.ts +0 -742
  533. package/src/tests/repo-allow-merge-gate.test.ts +0 -389
  534. package/src/tests/route-def-find-route.test.ts +0 -192
  535. package/src/tests/runtime-stale-threshold.test.ts +0 -40
  536. package/src/tests/schedule-validation-helper.test.ts +0 -51
  537. package/src/tests/scheduled-tasks-api.test.ts +0 -355
  538. package/src/tests/scheduler-backoff.test.ts +0 -166
  539. package/src/tests/script-run-token.test.ts +0 -75
  540. package/src/tests/scripts-extract-signature.test.ts +0 -47
  541. package/src/tests/scripts-sdk-bridge-tool-failure.test.ts +0 -141
  542. package/src/tests/seed-workflow-dreaming.test.ts +0 -117
  543. package/src/tests/short-id.test.ts +0 -23
  544. package/src/tests/skill-files-http.test.ts +0 -222
  545. package/src/tests/skill-get-file-tool.test.ts +0 -110
  546. package/src/tests/skill-script-refs.test.ts +0 -63
  547. package/src/tests/skill-update-scope.test.ts +0 -252
  548. package/src/tests/skills-bundle.test.ts +0 -99
  549. package/src/tests/slack-app-icon.test.ts +0 -94
  550. package/src/tests/slack-assistant-comention.test.ts +0 -139
  551. package/src/tests/slack-delete.test.ts +0 -157
  552. package/src/tests/slack-inbound-diagnostics-auth.test.ts +0 -93
  553. package/src/tests/slack-manifest.test.ts +0 -23
  554. package/src/tests/slack-task-output.test.ts +0 -90
  555. package/src/tests/store-progress-output-guidance.test.ts +0 -34
  556. package/src/tests/swarm-diff.test.ts +0 -728
  557. package/src/tests/task-lifecycle-events.test.ts +0 -53
  558. package/src/tests/template-asset-config.test.ts +0 -18
  559. package/src/tests/template-fetch.test.ts +0 -490
  560. package/src/tests/themes-page-theme.test.ts +0 -155
  561. package/src/tests/tool-annotations.test.ts +0 -442
  562. package/src/tests/tool-output-agent-id.test.ts +0 -202
  563. package/src/tests/update-profile-agentid.test.ts +0 -248
  564. package/src/tests/whoami-route.test.ts +0 -162
  565. package/src/tests/workflow-definition-telemetry.test.ts +0 -134
  566. package/src/tests/workflow-patch.test.ts +0 -169
  567. package/src/tests/workflow-run-steps-index.test.ts +0 -65
  568. package/src/tests/workflow-schedule-trigger.test.ts +0 -104
  569. package/src/tests/workflow-step-claims.test.ts +0 -152
  570. package/src/tests/workflow-step-order.test.ts +0 -92
  571. package/src/tests/workflow-trigger-schema.test.ts +0 -359
  572. package/src/tests/workflow-versions.test.ts +0 -240
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.10.0",
5
+ "version": "2.12.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": [
@@ -669,6 +669,296 @@
669
669
  }
670
670
  }
671
671
  },
672
+ "AgentHistoryEvent": {
673
+ "type": "object",
674
+ "properties": {
675
+ "id": {
676
+ "type": "string"
677
+ },
678
+ "agentId": {
679
+ "type": "string"
680
+ },
681
+ "event": {
682
+ "type": "string",
683
+ "enum": [
684
+ "deleted",
685
+ "restored"
686
+ ]
687
+ },
688
+ "actorRef": {
689
+ "type": "string"
690
+ },
691
+ "reason": {
692
+ "type": "string"
693
+ },
694
+ "snapshot": {
695
+ "type": "object",
696
+ "additionalProperties": {}
697
+ },
698
+ "createdAt": {
699
+ "type": "string"
700
+ }
701
+ },
702
+ "required": [
703
+ "id",
704
+ "agentId",
705
+ "event",
706
+ "actorRef",
707
+ "reason",
708
+ "snapshot",
709
+ "createdAt"
710
+ ]
711
+ },
712
+ "Agent": {
713
+ "type": "object",
714
+ "properties": {
715
+ "id": {
716
+ "type": "string"
717
+ },
718
+ "name": {
719
+ "type": "string",
720
+ "minLength": 1
721
+ },
722
+ "isLead": {
723
+ "type": "boolean",
724
+ "default": false
725
+ },
726
+ "status": {
727
+ "type": "string",
728
+ "enum": [
729
+ "idle",
730
+ "busy",
731
+ "offline",
732
+ "waiting_for_credentials"
733
+ ]
734
+ },
735
+ "runtimePoolId": {
736
+ "type": [
737
+ "string",
738
+ "null"
739
+ ]
740
+ },
741
+ "runtimeProvisionAttempts": {
742
+ "type": "integer",
743
+ "minimum": 0
744
+ },
745
+ "runtimeProvisionRetryAt": {
746
+ "type": [
747
+ "string",
748
+ "null"
749
+ ]
750
+ },
751
+ "description": {
752
+ "type": "string"
753
+ },
754
+ "role": {
755
+ "type": "string",
756
+ "maxLength": 100
757
+ },
758
+ "capabilities": {
759
+ "type": "array",
760
+ "items": {
761
+ "type": "string"
762
+ },
763
+ "default": []
764
+ },
765
+ "claudeMd": {
766
+ "type": "string",
767
+ "maxLength": 262144
768
+ },
769
+ "soulMd": {
770
+ "type": "string",
771
+ "maxLength": 262144
772
+ },
773
+ "identityMd": {
774
+ "type": "string",
775
+ "maxLength": 262144
776
+ },
777
+ "setupScript": {
778
+ "type": "string",
779
+ "maxLength": 262144
780
+ },
781
+ "toolsMd": {
782
+ "type": "string",
783
+ "maxLength": 262144
784
+ },
785
+ "heartbeatMd": {
786
+ "type": "string",
787
+ "maxLength": 262144
788
+ },
789
+ "maxTasks": {
790
+ "type": "integer",
791
+ "minimum": 1,
792
+ "maximum": 100
793
+ },
794
+ "emptyPollCount": {
795
+ "type": "integer",
796
+ "minimum": 0
797
+ },
798
+ "lastActivityAt": {
799
+ "type": "string",
800
+ "format": "date-time"
801
+ },
802
+ "provider": {
803
+ "type": "string",
804
+ "enum": [
805
+ "claude",
806
+ "codex",
807
+ "pi",
808
+ "devin",
809
+ "claude-managed",
810
+ "opencode",
811
+ "acp",
812
+ "dsh",
813
+ "amp",
814
+ "cursor",
815
+ "grok",
816
+ "fx"
817
+ ]
818
+ },
819
+ "harnessProvider": {
820
+ "type": [
821
+ "string",
822
+ "null"
823
+ ],
824
+ "enum": [
825
+ "claude",
826
+ "codex",
827
+ "pi",
828
+ "devin",
829
+ "claude-managed",
830
+ "opencode",
831
+ "acp",
832
+ "dsh",
833
+ "amp",
834
+ "cursor",
835
+ "grok",
836
+ "fx",
837
+ null
838
+ ]
839
+ },
840
+ "credentialMissing": {
841
+ "type": [
842
+ "array",
843
+ "null"
844
+ ],
845
+ "items": {
846
+ "type": "string"
847
+ }
848
+ },
849
+ "credStatus": {
850
+ "oneOf": [
851
+ {
852
+ "$ref": "#/components/schemas/AgentCredStatus"
853
+ },
854
+ {
855
+ "type": "null"
856
+ }
857
+ ]
858
+ },
859
+ "avatar": {
860
+ "oneOf": [
861
+ {
862
+ "type": "object",
863
+ "properties": {
864
+ "type": {
865
+ "type": "string",
866
+ "enum": [
867
+ "lucide"
868
+ ]
869
+ },
870
+ "icon": {
871
+ "type": "string",
872
+ "maxLength": 64,
873
+ "pattern": "^[a-z0-9-]+$"
874
+ },
875
+ "color": {
876
+ "type": "string",
877
+ "pattern": "^#[0-9a-fA-F]{6}$"
878
+ }
879
+ },
880
+ "required": [
881
+ "type",
882
+ "icon"
883
+ ]
884
+ },
885
+ {
886
+ "type": "object",
887
+ "properties": {
888
+ "type": {
889
+ "type": "string",
890
+ "enum": [
891
+ "url"
892
+ ]
893
+ },
894
+ "url": {
895
+ "type": "string",
896
+ "maxLength": 2048,
897
+ "format": "uri"
898
+ }
899
+ },
900
+ "required": [
901
+ "type",
902
+ "url"
903
+ ]
904
+ },
905
+ {
906
+ "type": "object",
907
+ "properties": {
908
+ "type": {
909
+ "type": "string",
910
+ "enum": [
911
+ "agent-fs"
912
+ ]
913
+ },
914
+ "path": {
915
+ "type": "string",
916
+ "minLength": 2,
917
+ "maxLength": 1024
918
+ },
919
+ "orgId": {
920
+ "type": "string",
921
+ "minLength": 1
922
+ },
923
+ "driveId": {
924
+ "type": "string",
925
+ "minLength": 1
926
+ }
927
+ },
928
+ "required": [
929
+ "type",
930
+ "path"
931
+ ]
932
+ }
933
+ ]
934
+ },
935
+ "slackIcon": {
936
+ "oneOf": [
937
+ {
938
+ "$ref": "#/components/schemas/AgentSlackIcon"
939
+ },
940
+ {
941
+ "type": "null"
942
+ }
943
+ ]
944
+ },
945
+ "createdAt": {
946
+ "type": "string",
947
+ "format": "date-time"
948
+ },
949
+ "lastUpdatedAt": {
950
+ "type": "string",
951
+ "format": "date-time"
952
+ }
953
+ },
954
+ "required": [
955
+ "id",
956
+ "name",
957
+ "status",
958
+ "createdAt",
959
+ "lastUpdatedAt"
960
+ ]
961
+ },
672
962
  "AgentCredStatus": {
673
963
  "type": "object",
674
964
  "properties": {
@@ -1183,256 +1473,6 @@
1183
1473
  }
1184
1474
  ]
1185
1475
  },
1186
- "Agent": {
1187
- "type": "object",
1188
- "properties": {
1189
- "id": {
1190
- "type": "string"
1191
- },
1192
- "name": {
1193
- "type": "string",
1194
- "minLength": 1
1195
- },
1196
- "isLead": {
1197
- "type": "boolean",
1198
- "default": false
1199
- },
1200
- "status": {
1201
- "type": "string",
1202
- "enum": [
1203
- "idle",
1204
- "busy",
1205
- "offline",
1206
- "waiting_for_credentials"
1207
- ]
1208
- },
1209
- "runtimePoolId": {
1210
- "type": [
1211
- "string",
1212
- "null"
1213
- ]
1214
- },
1215
- "runtimeProvisionAttempts": {
1216
- "type": "integer",
1217
- "minimum": 0
1218
- },
1219
- "runtimeProvisionRetryAt": {
1220
- "type": [
1221
- "string",
1222
- "null"
1223
- ]
1224
- },
1225
- "description": {
1226
- "type": "string"
1227
- },
1228
- "role": {
1229
- "type": "string",
1230
- "maxLength": 100
1231
- },
1232
- "capabilities": {
1233
- "type": "array",
1234
- "items": {
1235
- "type": "string"
1236
- },
1237
- "default": []
1238
- },
1239
- "claudeMd": {
1240
- "type": "string",
1241
- "maxLength": 262144
1242
- },
1243
- "soulMd": {
1244
- "type": "string",
1245
- "maxLength": 262144
1246
- },
1247
- "identityMd": {
1248
- "type": "string",
1249
- "maxLength": 262144
1250
- },
1251
- "setupScript": {
1252
- "type": "string",
1253
- "maxLength": 262144
1254
- },
1255
- "toolsMd": {
1256
- "type": "string",
1257
- "maxLength": 262144
1258
- },
1259
- "heartbeatMd": {
1260
- "type": "string",
1261
- "maxLength": 262144
1262
- },
1263
- "maxTasks": {
1264
- "type": "integer",
1265
- "minimum": 1,
1266
- "maximum": 100
1267
- },
1268
- "emptyPollCount": {
1269
- "type": "integer",
1270
- "minimum": 0
1271
- },
1272
- "lastActivityAt": {
1273
- "type": "string",
1274
- "format": "date-time"
1275
- },
1276
- "provider": {
1277
- "type": "string",
1278
- "enum": [
1279
- "claude",
1280
- "codex",
1281
- "pi",
1282
- "devin",
1283
- "claude-managed",
1284
- "opencode",
1285
- "acp",
1286
- "dsh",
1287
- "amp",
1288
- "cursor",
1289
- "grok",
1290
- "fx"
1291
- ]
1292
- },
1293
- "harnessProvider": {
1294
- "type": [
1295
- "string",
1296
- "null"
1297
- ],
1298
- "enum": [
1299
- "claude",
1300
- "codex",
1301
- "pi",
1302
- "devin",
1303
- "claude-managed",
1304
- "opencode",
1305
- "acp",
1306
- "dsh",
1307
- "amp",
1308
- "cursor",
1309
- "grok",
1310
- "fx",
1311
- null
1312
- ]
1313
- },
1314
- "credentialMissing": {
1315
- "type": [
1316
- "array",
1317
- "null"
1318
- ],
1319
- "items": {
1320
- "type": "string"
1321
- }
1322
- },
1323
- "credStatus": {
1324
- "oneOf": [
1325
- {
1326
- "$ref": "#/components/schemas/AgentCredStatus"
1327
- },
1328
- {
1329
- "type": "null"
1330
- }
1331
- ]
1332
- },
1333
- "avatar": {
1334
- "oneOf": [
1335
- {
1336
- "type": "object",
1337
- "properties": {
1338
- "type": {
1339
- "type": "string",
1340
- "enum": [
1341
- "lucide"
1342
- ]
1343
- },
1344
- "icon": {
1345
- "type": "string",
1346
- "maxLength": 64,
1347
- "pattern": "^[a-z0-9-]+$"
1348
- },
1349
- "color": {
1350
- "type": "string",
1351
- "pattern": "^#[0-9a-fA-F]{6}$"
1352
- }
1353
- },
1354
- "required": [
1355
- "type",
1356
- "icon"
1357
- ]
1358
- },
1359
- {
1360
- "type": "object",
1361
- "properties": {
1362
- "type": {
1363
- "type": "string",
1364
- "enum": [
1365
- "url"
1366
- ]
1367
- },
1368
- "url": {
1369
- "type": "string",
1370
- "maxLength": 2048,
1371
- "format": "uri"
1372
- }
1373
- },
1374
- "required": [
1375
- "type",
1376
- "url"
1377
- ]
1378
- },
1379
- {
1380
- "type": "object",
1381
- "properties": {
1382
- "type": {
1383
- "type": "string",
1384
- "enum": [
1385
- "agent-fs"
1386
- ]
1387
- },
1388
- "path": {
1389
- "type": "string",
1390
- "minLength": 2,
1391
- "maxLength": 1024
1392
- },
1393
- "orgId": {
1394
- "type": "string",
1395
- "minLength": 1
1396
- },
1397
- "driveId": {
1398
- "type": "string",
1399
- "minLength": 1
1400
- }
1401
- },
1402
- "required": [
1403
- "type",
1404
- "path"
1405
- ]
1406
- }
1407
- ]
1408
- },
1409
- "slackIcon": {
1410
- "oneOf": [
1411
- {
1412
- "$ref": "#/components/schemas/AgentSlackIcon"
1413
- },
1414
- {
1415
- "type": "null"
1416
- }
1417
- ]
1418
- },
1419
- "createdAt": {
1420
- "type": "string",
1421
- "format": "date-time"
1422
- },
1423
- "lastUpdatedAt": {
1424
- "type": "string",
1425
- "format": "date-time"
1426
- }
1427
- },
1428
- "required": [
1429
- "id",
1430
- "name",
1431
- "status",
1432
- "createdAt",
1433
- "lastUpdatedAt"
1434
- ]
1435
- },
1436
1476
  "ProfileCheckResult": {
1437
1477
  "type": "object",
1438
1478
  "properties": {
@@ -4179,6 +4219,126 @@
4179
4219
  "review"
4180
4220
  ]
4181
4221
  },
4222
+ "RequestComposition": {
4223
+ "type": "object",
4224
+ "properties": {
4225
+ "id": {
4226
+ "type": "string",
4227
+ "format": "uuid"
4228
+ },
4229
+ "taskId": {
4230
+ "type": "string"
4231
+ },
4232
+ "agentId": {
4233
+ "type": "string"
4234
+ },
4235
+ "sessionId": {
4236
+ "type": "string"
4237
+ },
4238
+ "seq": {
4239
+ "type": "integer",
4240
+ "minimum": 0
4241
+ },
4242
+ "provider": {
4243
+ "type": "string"
4244
+ },
4245
+ "model": {
4246
+ "type": [
4247
+ "string",
4248
+ "null"
4249
+ ]
4250
+ },
4251
+ "source": {
4252
+ "type": "string",
4253
+ "enum": [
4254
+ "worker",
4255
+ "harness-hook"
4256
+ ]
4257
+ },
4258
+ "parts": {
4259
+ "type": "array",
4260
+ "items": {
4261
+ "$ref": "#/components/schemas/RequestCompositionPart"
4262
+ }
4263
+ },
4264
+ "staticEstTokens": {
4265
+ "type": "integer",
4266
+ "minimum": 0
4267
+ },
4268
+ "tokenRatio": {
4269
+ "type": "number"
4270
+ },
4271
+ "createdAt": {
4272
+ "type": "string",
4273
+ "format": "date-time"
4274
+ }
4275
+ },
4276
+ "required": [
4277
+ "id",
4278
+ "taskId",
4279
+ "agentId",
4280
+ "sessionId",
4281
+ "seq",
4282
+ "provider",
4283
+ "model",
4284
+ "source",
4285
+ "parts",
4286
+ "staticEstTokens",
4287
+ "tokenRatio",
4288
+ "createdAt"
4289
+ ]
4290
+ },
4291
+ "RequestCompositionPart": {
4292
+ "type": "object",
4293
+ "properties": {
4294
+ "kind": {
4295
+ "type": "string",
4296
+ "enum": [
4297
+ "system_section",
4298
+ "persona",
4299
+ "claude_md",
4300
+ "operator_prompt",
4301
+ "tool_schemas",
4302
+ "skills_listing",
4303
+ "task_prompt",
4304
+ "memories"
4305
+ ]
4306
+ },
4307
+ "id": {
4308
+ "type": "string",
4309
+ "minLength": 1,
4310
+ "maxLength": 200
4311
+ },
4312
+ "label": {
4313
+ "type": "string",
4314
+ "minLength": 1,
4315
+ "maxLength": 200
4316
+ },
4317
+ "chars": {
4318
+ "type": "integer",
4319
+ "minimum": 0
4320
+ },
4321
+ "fidelity": {
4322
+ "type": "string",
4323
+ "enum": [
4324
+ "exact",
4325
+ "estimate"
4326
+ ],
4327
+ "default": "exact"
4328
+ },
4329
+ "estTokens": {
4330
+ "type": "integer",
4331
+ "minimum": 0
4332
+ }
4333
+ },
4334
+ "required": [
4335
+ "kind",
4336
+ "id",
4337
+ "label",
4338
+ "chars",
4339
+ "estTokens"
4340
+ ]
4341
+ },
4182
4342
  "ScriptRun": {
4183
4343
  "type": "object",
4184
4344
  "properties": {
@@ -5682,12 +5842,94 @@
5682
5842
  "type": "string",
5683
5843
  "minLength": 1
5684
5844
  },
5685
- "description": "Optional event allowlist, matched exactly against the eventHeader value after signature verification. A delivery whose event is not listed (or that has no event header) gets a 2xx `skipped` reply and creates no run. Omit or leave empty to accept every event."
5845
+ "description": "Deprecated alias of one delivery-filter clause, AND-ed with filter. Matched exactly against eventHeader, or against the preset event field when eventHeader is omitted: X-GitHub-Event (github, and the default), X-Gitlab-Event (gitlab), or JSON body type (standard-webhooks). A miss returns 200 skipped with reason event-not-allowed and creates no run. Omit or leave empty to add no event clause."
5686
5846
  },
5687
5847
  "eventHeader": {
5688
5848
  "type": "string",
5689
5849
  "minLength": 1,
5690
- "description": "Request header holding the event name for `events` (case-insensitive lookup). Defaults to X-GitHub-Event."
5850
+ "description": "Deprecated. Header read for events. The name lookup is case-insensitive and the value is exact. Overrides preset. Defaults to X-GitHub-Event when preset is omitted."
5851
+ },
5852
+ "preset": {
5853
+ "type": "string",
5854
+ "enum": [
5855
+ "github",
5856
+ "gitlab",
5857
+ "standard-webhooks"
5858
+ ],
5859
+ "description": "Optional sender preset for the events allowlist. github reads X-GitHub-Event, gitlab reads X-Gitlab-Event, and standard-webhooks reads the JSON body field type. A preset alone does not filter. Ignored when eventHeader is set."
5860
+ },
5861
+ "filter": {
5862
+ "type": "object",
5863
+ "properties": {
5864
+ "headers": {
5865
+ "type": "object",
5866
+ "additionalProperties": {
5867
+ "anyOf": [
5868
+ {
5869
+ "type": "string",
5870
+ "minLength": 1,
5871
+ "maxLength": 512
5872
+ },
5873
+ {
5874
+ "type": "array",
5875
+ "items": {
5876
+ "type": "string",
5877
+ "minLength": 1,
5878
+ "maxLength": 512
5879
+ },
5880
+ "minItems": 1,
5881
+ "maxItems": 64
5882
+ }
5883
+ ]
5884
+ },
5885
+ "description": "Header name to one exact value, or a list of exact values. Names are matched case-insensitively. Every entry must match."
5886
+ },
5887
+ "body": {
5888
+ "type": "object",
5889
+ "additionalProperties": {
5890
+ "anyOf": [
5891
+ {
5892
+ "type": "string",
5893
+ "maxLength": 512
5894
+ },
5895
+ {
5896
+ "type": "number"
5897
+ },
5898
+ {
5899
+ "type": "boolean"
5900
+ },
5901
+ {
5902
+ "type": "null"
5903
+ },
5904
+ {
5905
+ "type": "array",
5906
+ "items": {
5907
+ "anyOf": [
5908
+ {
5909
+ "type": "string",
5910
+ "maxLength": 512
5911
+ },
5912
+ {
5913
+ "type": "number"
5914
+ },
5915
+ {
5916
+ "type": "boolean"
5917
+ },
5918
+ {
5919
+ "type": "null"
5920
+ }
5921
+ ]
5922
+ },
5923
+ "minItems": 1,
5924
+ "maxItems": 64
5925
+ }
5926
+ ]
5927
+ },
5928
+ "description": "Dot path into the JSON body, to one exact scalar or a list of scalars. A numeric segment indexes an array (commits.0.id). No type coercion. Every entry must match."
5929
+ }
5930
+ },
5931
+ "additionalProperties": false,
5932
+ "description": "Header and JSON body allowlists, AND-ed with events. Evaluated after signature verification and before a run is saved. A miss returns 200 skipped with reason filter-not-matched and creates no run."
5691
5933
  }
5692
5934
  },
5693
5935
  "required": [
@@ -6460,12 +6702,94 @@
6460
6702
  "type": "string",
6461
6703
  "minLength": 1
6462
6704
  },
6463
- "description": "Optional event allowlist, matched exactly against the eventHeader value after signature verification. A delivery whose event is not listed (or that has no event header) gets a 2xx `skipped` reply and creates no run. Omit or leave empty to accept every event."
6705
+ "description": "Deprecated alias of one delivery-filter clause, AND-ed with filter. Matched exactly against eventHeader, or against the preset event field when eventHeader is omitted: X-GitHub-Event (github, and the default), X-Gitlab-Event (gitlab), or JSON body type (standard-webhooks). A miss returns 200 skipped with reason event-not-allowed and creates no run. Omit or leave empty to add no event clause."
6464
6706
  },
6465
6707
  "eventHeader": {
6466
6708
  "type": "string",
6467
6709
  "minLength": 1,
6468
- "description": "Request header holding the event name for `events` (case-insensitive lookup). Defaults to X-GitHub-Event."
6710
+ "description": "Deprecated. Header read for events. The name lookup is case-insensitive and the value is exact. Overrides preset. Defaults to X-GitHub-Event when preset is omitted."
6711
+ },
6712
+ "preset": {
6713
+ "type": "string",
6714
+ "enum": [
6715
+ "github",
6716
+ "gitlab",
6717
+ "standard-webhooks"
6718
+ ],
6719
+ "description": "Optional sender preset for the events allowlist. github reads X-GitHub-Event, gitlab reads X-Gitlab-Event, and standard-webhooks reads the JSON body field type. A preset alone does not filter. Ignored when eventHeader is set."
6720
+ },
6721
+ "filter": {
6722
+ "type": "object",
6723
+ "properties": {
6724
+ "headers": {
6725
+ "type": "object",
6726
+ "additionalProperties": {
6727
+ "anyOf": [
6728
+ {
6729
+ "type": "string",
6730
+ "minLength": 1,
6731
+ "maxLength": 512
6732
+ },
6733
+ {
6734
+ "type": "array",
6735
+ "items": {
6736
+ "type": "string",
6737
+ "minLength": 1,
6738
+ "maxLength": 512
6739
+ },
6740
+ "minItems": 1,
6741
+ "maxItems": 64
6742
+ }
6743
+ ]
6744
+ },
6745
+ "description": "Header name to one exact value, or a list of exact values. Names are matched case-insensitively. Every entry must match."
6746
+ },
6747
+ "body": {
6748
+ "type": "object",
6749
+ "additionalProperties": {
6750
+ "anyOf": [
6751
+ {
6752
+ "type": "string",
6753
+ "maxLength": 512
6754
+ },
6755
+ {
6756
+ "type": "number"
6757
+ },
6758
+ {
6759
+ "type": "boolean"
6760
+ },
6761
+ {
6762
+ "type": "null"
6763
+ },
6764
+ {
6765
+ "type": "array",
6766
+ "items": {
6767
+ "anyOf": [
6768
+ {
6769
+ "type": "string",
6770
+ "maxLength": 512
6771
+ },
6772
+ {
6773
+ "type": "number"
6774
+ },
6775
+ {
6776
+ "type": "boolean"
6777
+ },
6778
+ {
6779
+ "type": "null"
6780
+ }
6781
+ ]
6782
+ },
6783
+ "minItems": 1,
6784
+ "maxItems": 64
6785
+ }
6786
+ ]
6787
+ },
6788
+ "description": "Dot path into the JSON body, to one exact scalar or a list of scalars. A numeric segment indexes an array (commits.0.id). No type coercion. Every entry must match."
6789
+ }
6790
+ },
6791
+ "additionalProperties": false,
6792
+ "description": "Header and JSON body allowlists, AND-ed with events. Evaluated after signature verification and before a run is saved. A miss returns 200 skipped with reason filter-not-matched and creates no run."
6469
6793
  }
6470
6794
  },
6471
6795
  "required": [
@@ -6727,6 +7051,21 @@
6727
7051
  ],
6728
7052
  "additionalProperties": false
6729
7053
  },
7054
+ "workspace": {
7055
+ "type": [
7056
+ "object",
7057
+ "null"
7058
+ ],
7059
+ "properties": {
7060
+ "sizeGb": {
7061
+ "type": "integer",
7062
+ "minimum": 1,
7063
+ "maximum": 1024
7064
+ }
7065
+ },
7066
+ "default": null,
7067
+ "additionalProperties": false
7068
+ },
6730
7069
  "ttlSec": {
6731
7070
  "type": [
6732
7071
  "integer",
@@ -6877,6 +7216,12 @@
6877
7216
  "null"
6878
7217
  ]
6879
7218
  },
7219
+ "workspaceSlot": {
7220
+ "type": [
7221
+ "integer",
7222
+ "null"
7223
+ ]
7224
+ },
6880
7225
  "reportedSlots": {
6881
7226
  "type": "integer"
6882
7227
  },
@@ -7464,6 +7809,342 @@
7464
7809
  }
7465
7810
  }
7466
7811
  },
7812
+ "/api/agents/{id}/delete": {
7813
+ "post": {
7814
+ "summary": "Delete an agent into agent_history",
7815
+ "description": "Appends the agent row to `agent_history`, revokes its session tokens, and deletes the row. Refused with 409 while the agent is the lead, an extension identity, not offline, pool-bound, holds open tasks or enabled schedules, or owns skills, MCP servers or inboxes.",
7816
+ "tags": [
7817
+ "Agents"
7818
+ ],
7819
+ "security": [
7820
+ {
7821
+ "bearerAuth": []
7822
+ }
7823
+ ],
7824
+ "parameters": [
7825
+ {
7826
+ "schema": {
7827
+ "type": "string",
7828
+ "minLength": 1
7829
+ },
7830
+ "required": true,
7831
+ "name": "id",
7832
+ "in": "path"
7833
+ }
7834
+ ],
7835
+ "requestBody": {
7836
+ "content": {
7837
+ "application/json": {
7838
+ "schema": {
7839
+ "type": "object",
7840
+ "properties": {
7841
+ "reason": {
7842
+ "type": "string",
7843
+ "minLength": 3,
7844
+ "maxLength": 2000
7845
+ }
7846
+ },
7847
+ "required": [
7848
+ "reason"
7849
+ ]
7850
+ }
7851
+ }
7852
+ }
7853
+ },
7854
+ "responses": {
7855
+ "200": {
7856
+ "description": "Agent deleted",
7857
+ "content": {
7858
+ "application/json": {
7859
+ "schema": {
7860
+ "type": "object",
7861
+ "properties": {
7862
+ "event": {
7863
+ "$ref": "#/components/schemas/AgentHistoryEvent"
7864
+ }
7865
+ },
7866
+ "required": [
7867
+ "event"
7868
+ ]
7869
+ }
7870
+ }
7871
+ }
7872
+ },
7873
+ "400": {
7874
+ "description": "Validation error",
7875
+ "content": {
7876
+ "application/json": {
7877
+ "schema": {
7878
+ "$ref": "#/components/schemas/ErrorResponse"
7879
+ }
7880
+ }
7881
+ }
7882
+ },
7883
+ "403": {
7884
+ "description": "Operator or user credentials required",
7885
+ "content": {
7886
+ "application/json": {
7887
+ "schema": {
7888
+ "$ref": "#/components/schemas/ErrorResponse"
7889
+ }
7890
+ }
7891
+ }
7892
+ },
7893
+ "404": {
7894
+ "description": "Agent not found",
7895
+ "content": {
7896
+ "application/json": {
7897
+ "schema": {
7898
+ "$ref": "#/components/schemas/ErrorResponse"
7899
+ }
7900
+ }
7901
+ }
7902
+ },
7903
+ "409": {
7904
+ "description": "A blocker refuses the delete",
7905
+ "content": {
7906
+ "application/json": {
7907
+ "schema": {
7908
+ "type": "object",
7909
+ "properties": {
7910
+ "error": {
7911
+ "type": "string"
7912
+ },
7913
+ "code": {
7914
+ "type": "string"
7915
+ },
7916
+ "blockers": {
7917
+ "type": "array",
7918
+ "items": {
7919
+ "type": "object",
7920
+ "properties": {
7921
+ "code": {
7922
+ "type": "string"
7923
+ },
7924
+ "message": {
7925
+ "type": "string"
7926
+ }
7927
+ },
7928
+ "required": [
7929
+ "code",
7930
+ "message"
7931
+ ]
7932
+ }
7933
+ }
7934
+ },
7935
+ "required": [
7936
+ "error",
7937
+ "code",
7938
+ "blockers"
7939
+ ]
7940
+ }
7941
+ }
7942
+ }
7943
+ }
7944
+ }
7945
+ }
7946
+ },
7947
+ "/api/agents/{id}/restore": {
7948
+ "post": {
7949
+ "summary": "Restore a deleted agent from agent_history",
7950
+ "description": "Reinserts the latest deleted snapshot under the same id. Rows a cascading foreign key removed on delete do not come back.",
7951
+ "tags": [
7952
+ "Agents"
7953
+ ],
7954
+ "security": [
7955
+ {
7956
+ "bearerAuth": []
7957
+ }
7958
+ ],
7959
+ "parameters": [
7960
+ {
7961
+ "schema": {
7962
+ "type": "string",
7963
+ "minLength": 1
7964
+ },
7965
+ "required": true,
7966
+ "name": "id",
7967
+ "in": "path"
7968
+ }
7969
+ ],
7970
+ "requestBody": {
7971
+ "content": {
7972
+ "application/json": {
7973
+ "schema": {
7974
+ "type": "object",
7975
+ "properties": {
7976
+ "reason": {
7977
+ "type": "string",
7978
+ "minLength": 3,
7979
+ "maxLength": 2000
7980
+ },
7981
+ "newName": {
7982
+ "type": "string",
7983
+ "minLength": 1
7984
+ }
7985
+ },
7986
+ "required": [
7987
+ "reason"
7988
+ ]
7989
+ }
7990
+ }
7991
+ }
7992
+ },
7993
+ "responses": {
7994
+ "200": {
7995
+ "description": "Agent restored",
7996
+ "content": {
7997
+ "application/json": {
7998
+ "schema": {
7999
+ "type": "object",
8000
+ "properties": {
8001
+ "agent": {
8002
+ "$ref": "#/components/schemas/Agent"
8003
+ },
8004
+ "event": {
8005
+ "$ref": "#/components/schemas/AgentHistoryEvent"
8006
+ }
8007
+ },
8008
+ "required": [
8009
+ "agent",
8010
+ "event"
8011
+ ]
8012
+ }
8013
+ }
8014
+ }
8015
+ },
8016
+ "400": {
8017
+ "description": "Validation error",
8018
+ "content": {
8019
+ "application/json": {
8020
+ "schema": {
8021
+ "$ref": "#/components/schemas/ErrorResponse"
8022
+ }
8023
+ }
8024
+ }
8025
+ },
8026
+ "403": {
8027
+ "description": "Operator or user credentials required",
8028
+ "content": {
8029
+ "application/json": {
8030
+ "schema": {
8031
+ "$ref": "#/components/schemas/ErrorResponse"
8032
+ }
8033
+ }
8034
+ }
8035
+ },
8036
+ "404": {
8037
+ "description": "No deleted agent with this id",
8038
+ "content": {
8039
+ "application/json": {
8040
+ "schema": {
8041
+ "$ref": "#/components/schemas/ErrorResponse"
8042
+ }
8043
+ }
8044
+ }
8045
+ },
8046
+ "409": {
8047
+ "description": "The agent exists, or its name is taken",
8048
+ "content": {
8049
+ "application/json": {
8050
+ "schema": {
8051
+ "type": "object",
8052
+ "properties": {
8053
+ "error": {
8054
+ "type": "string"
8055
+ },
8056
+ "code": {
8057
+ "type": "string"
8058
+ },
8059
+ "blockers": {
8060
+ "type": "array",
8061
+ "items": {
8062
+ "type": "object",
8063
+ "properties": {
8064
+ "code": {
8065
+ "type": "string"
8066
+ },
8067
+ "message": {
8068
+ "type": "string"
8069
+ }
8070
+ },
8071
+ "required": [
8072
+ "code",
8073
+ "message"
8074
+ ]
8075
+ }
8076
+ }
8077
+ },
8078
+ "required": [
8079
+ "error",
8080
+ "code",
8081
+ "blockers"
8082
+ ]
8083
+ }
8084
+ }
8085
+ }
8086
+ }
8087
+ }
8088
+ }
8089
+ },
8090
+ "/api/agent-history": {
8091
+ "get": {
8092
+ "summary": "List agent delete and restore events",
8093
+ "description": "Newest first, at most 500. Filter by `agentId`.",
8094
+ "tags": [
8095
+ "Agents"
8096
+ ],
8097
+ "security": [
8098
+ {
8099
+ "bearerAuth": []
8100
+ }
8101
+ ],
8102
+ "parameters": [
8103
+ {
8104
+ "schema": {
8105
+ "type": "string",
8106
+ "minLength": 1
8107
+ },
8108
+ "required": false,
8109
+ "name": "agentId",
8110
+ "in": "query"
8111
+ }
8112
+ ],
8113
+ "responses": {
8114
+ "200": {
8115
+ "description": "Events",
8116
+ "content": {
8117
+ "application/json": {
8118
+ "schema": {
8119
+ "type": "object",
8120
+ "properties": {
8121
+ "events": {
8122
+ "type": "array",
8123
+ "items": {
8124
+ "$ref": "#/components/schemas/AgentHistoryEvent"
8125
+ }
8126
+ }
8127
+ },
8128
+ "required": [
8129
+ "events"
8130
+ ]
8131
+ }
8132
+ }
8133
+ }
8134
+ },
8135
+ "403": {
8136
+ "description": "Operator or user credentials required",
8137
+ "content": {
8138
+ "application/json": {
8139
+ "schema": {
8140
+ "$ref": "#/components/schemas/ErrorResponse"
8141
+ }
8142
+ }
8143
+ }
8144
+ }
8145
+ }
8146
+ }
8147
+ },
7467
8148
  "/api/mcp-bridge": {
7468
8149
  "post": {
7469
8150
  "summary": "Generic MCP tool proxy for the scripts SDK bridge",
@@ -11428,7 +12109,8 @@
11428
12109
  "agentmail",
11429
12110
  "kapso",
11430
12111
  "chat-sdk",
11431
- "swarm-x"
12112
+ "swarm-x",
12113
+ "primitives"
11432
12114
  ]
11433
12115
  }
11434
12116
  },
@@ -11491,7 +12173,8 @@
11491
12173
  "agentmail",
11492
12174
  "kapso",
11493
12175
  "chat-sdk",
11494
- "swarm-x"
12176
+ "swarm-x",
12177
+ "primitives"
11495
12178
  ]
11496
12179
  }
11497
12180
  },
@@ -11525,6 +12208,16 @@
11525
12208
  }
11526
12209
  }
11527
12210
  }
12211
+ },
12212
+ "410": {
12213
+ "description": "An operator deleted this agent id (`agent_deleted`); the worker must stop",
12214
+ "content": {
12215
+ "application/json": {
12216
+ "schema": {
12217
+ "$ref": "#/components/schemas/ErrorResponse"
12218
+ }
12219
+ }
12220
+ }
11528
12221
  }
11529
12222
  }
11530
12223
  },
@@ -12378,6 +13071,12 @@
12378
13071
  "null"
12379
13072
  ]
12380
13073
  },
13074
+ "workspaceSlot": {
13075
+ "type": [
13076
+ "integer",
13077
+ "null"
13078
+ ]
13079
+ },
12381
13080
  "reportedSlots": {
12382
13081
  "type": "integer"
12383
13082
  },
@@ -25392,17 +26091,122 @@
25392
26091
  ],
25393
26092
  "responses": {
25394
26093
  "200": {
25395
- "description": "Task attachment metadata",
25396
- "content": {
25397
- "application/json": {
25398
- "schema": {
25399
- "$ref": "#/components/schemas/TaskAttachment"
25400
- }
25401
- }
25402
- }
26094
+ "description": "Task attachment metadata",
26095
+ "content": {
26096
+ "application/json": {
26097
+ "schema": {
26098
+ "$ref": "#/components/schemas/TaskAttachment"
26099
+ }
26100
+ }
26101
+ }
26102
+ },
26103
+ "404": {
26104
+ "description": "Task or attachment not found",
26105
+ "content": {
26106
+ "application/json": {
26107
+ "schema": {
26108
+ "$ref": "#/components/schemas/ErrorResponse"
26109
+ }
26110
+ }
26111
+ }
26112
+ }
26113
+ }
26114
+ },
26115
+ "delete": {
26116
+ "summary": "Delete a task file attachment",
26117
+ "tags": [
26118
+ "FS"
26119
+ ],
26120
+ "security": [
26121
+ {
26122
+ "bearerAuth": []
26123
+ }
26124
+ ],
26125
+ "parameters": [
26126
+ {
26127
+ "schema": {
26128
+ "type": "string",
26129
+ "format": "uuid"
26130
+ },
26131
+ "required": true,
26132
+ "name": "taskId",
26133
+ "in": "path"
26134
+ },
26135
+ {
26136
+ "schema": {
26137
+ "type": "string",
26138
+ "format": "uuid"
26139
+ },
26140
+ "required": true,
26141
+ "name": "attachmentId",
26142
+ "in": "path"
26143
+ }
26144
+ ],
26145
+ "responses": {
26146
+ "204": {
26147
+ "description": "Attachment deleted"
26148
+ },
26149
+ "403": {
26150
+ "description": "Caller cannot mutate this task",
26151
+ "content": {
26152
+ "application/json": {
26153
+ "schema": {
26154
+ "$ref": "#/components/schemas/ErrorResponse"
26155
+ }
26156
+ }
26157
+ }
26158
+ },
26159
+ "404": {
26160
+ "description": "Task or attachment not found",
26161
+ "content": {
26162
+ "application/json": {
26163
+ "schema": {
26164
+ "$ref": "#/components/schemas/ErrorResponse"
26165
+ }
26166
+ }
26167
+ }
26168
+ }
26169
+ }
26170
+ }
26171
+ },
26172
+ "/api/fs/tasks/{taskId}/files/{attachmentId}/raw": {
26173
+ "get": {
26174
+ "summary": "Download raw task file bytes",
26175
+ "description": "Streams raw bytes. File content is not secret-scrubbed.",
26176
+ "tags": [
26177
+ "FS"
26178
+ ],
26179
+ "security": [
26180
+ {
26181
+ "bearerAuth": []
26182
+ }
26183
+ ],
26184
+ "parameters": [
26185
+ {
26186
+ "schema": {
26187
+ "type": "string",
26188
+ "format": "uuid"
26189
+ },
26190
+ "required": true,
26191
+ "name": "taskId",
26192
+ "in": "path"
26193
+ },
26194
+ {
26195
+ "schema": {
26196
+ "type": "string",
26197
+ "format": "uuid"
26198
+ },
26199
+ "required": true,
26200
+ "name": "attachmentId",
26201
+ "in": "path"
26202
+ }
26203
+ ],
26204
+ "responses": {
26205
+ "200": {
26206
+ "description": "Raw file bytes"
25403
26207
  },
25404
26208
  "404": {
25405
- "description": "Task or attachment not found",
26209
+ "description": "Task, attachment, or provider object not found",
25406
26210
  "content": {
25407
26211
  "application/json": {
25408
26212
  "schema": {
@@ -25412,9 +26216,11 @@
25412
26216
  }
25413
26217
  }
25414
26218
  }
25415
- },
25416
- "delete": {
25417
- "summary": "Delete a task file attachment",
26219
+ }
26220
+ },
26221
+ "/api/fs/tasks/{taskId}/files/{attachmentId}/signed-url": {
26222
+ "get": {
26223
+ "summary": "Create a provider signed GET URL for a task file",
25418
26224
  "tags": [
25419
26225
  "FS"
25420
26226
  ],
@@ -25441,24 +26247,43 @@
25441
26247
  "required": true,
25442
26248
  "name": "attachmentId",
25443
26249
  "in": "path"
26250
+ },
26251
+ {
26252
+ "schema": {
26253
+ "type": "integer",
26254
+ "exclusiveMinimum": 0,
26255
+ "maximum": 3600
26256
+ },
26257
+ "required": false,
26258
+ "name": "expiresIn",
26259
+ "in": "query"
25444
26260
  }
25445
26261
  ],
25446
26262
  "responses": {
25447
- "204": {
25448
- "description": "Attachment deleted"
25449
- },
25450
- "403": {
25451
- "description": "Caller cannot mutate this task",
26263
+ "200": {
26264
+ "description": "Signed URL",
25452
26265
  "content": {
25453
26266
  "application/json": {
25454
26267
  "schema": {
25455
- "$ref": "#/components/schemas/ErrorResponse"
26268
+ "type": "object",
26269
+ "properties": {
26270
+ "url": {
26271
+ "type": "string"
26272
+ },
26273
+ "expiresIn": {
26274
+ "type": "number"
26275
+ }
26276
+ },
26277
+ "required": [
26278
+ "url",
26279
+ "expiresIn"
26280
+ ]
25456
26281
  }
25457
26282
  }
25458
26283
  }
25459
26284
  },
25460
26285
  "404": {
25461
- "description": "Task or attachment not found",
26286
+ "description": "Task, attachment, or provider object not found",
25462
26287
  "content": {
25463
26288
  "application/json": {
25464
26289
  "schema": {
@@ -25466,48 +26291,9 @@
25466
26291
  }
25467
26292
  }
25468
26293
  }
25469
- }
25470
- }
25471
- }
25472
- },
25473
- "/api/fs/tasks/{taskId}/files/{attachmentId}/raw": {
25474
- "get": {
25475
- "summary": "Download raw task file bytes",
25476
- "description": "Streams raw bytes. File content is not secret-scrubbed.",
25477
- "tags": [
25478
- "FS"
25479
- ],
25480
- "security": [
25481
- {
25482
- "bearerAuth": []
25483
- }
25484
- ],
25485
- "parameters": [
25486
- {
25487
- "schema": {
25488
- "type": "string",
25489
- "format": "uuid"
25490
- },
25491
- "required": true,
25492
- "name": "taskId",
25493
- "in": "path"
25494
- },
25495
- {
25496
- "schema": {
25497
- "type": "string",
25498
- "format": "uuid"
25499
- },
25500
- "required": true,
25501
- "name": "attachmentId",
25502
- "in": "path"
25503
- }
25504
- ],
25505
- "responses": {
25506
- "200": {
25507
- "description": "Raw file bytes"
25508
26294
  },
25509
- "404": {
25510
- "description": "Task, attachment, or provider object not found",
26295
+ "501": {
26296
+ "description": "Active provider does not support signed URLs",
25511
26297
  "content": {
25512
26298
  "application/json": {
25513
26299
  "schema": {
@@ -25519,72 +26305,63 @@
25519
26305
  }
25520
26306
  }
25521
26307
  },
25522
- "/api/fs/tasks/{taskId}/files/{attachmentId}/signed-url": {
25523
- "get": {
25524
- "summary": "Create a provider signed GET URL for a task file",
26308
+ "/api/github/installation-token": {
26309
+ "post": {
26310
+ "summary": "Mint a GitHub App installation token for worker git and gh",
26311
+ "description": "Internal worker endpoint. Returns a short-lived installation token for the installation in `GITHUB_APP_INSTALLATION_ID`, minted with the API server's GitHub App credentials. The caller cannot choose the installation. Only a registered agent (swarm API key plus X-Agent-ID, or an agent or runtime token) may call it; user, guest and ACP task tokens are refused. 404 when the App or the installation id is not configured, so workers fall back to `GITHUB_TOKEN`.",
25525
26312
  "tags": [
25526
- "FS"
26313
+ "GitHub"
25527
26314
  ],
25528
26315
  "security": [
25529
26316
  {
25530
26317
  "bearerAuth": []
25531
26318
  }
25532
26319
  ],
25533
- "parameters": [
25534
- {
25535
- "schema": {
25536
- "type": "string",
25537
- "format": "uuid"
25538
- },
25539
- "required": true,
25540
- "name": "taskId",
25541
- "in": "path"
25542
- },
25543
- {
25544
- "schema": {
25545
- "type": "string",
25546
- "format": "uuid"
25547
- },
25548
- "required": true,
25549
- "name": "attachmentId",
25550
- "in": "path"
25551
- },
25552
- {
25553
- "schema": {
25554
- "type": "integer",
25555
- "exclusiveMinimum": 0,
25556
- "maximum": 3600
25557
- },
25558
- "required": false,
25559
- "name": "expiresIn",
25560
- "in": "query"
26320
+ "requestBody": {
26321
+ "content": {
26322
+ "application/json": {
26323
+ "schema": {
26324
+ "type": "object",
26325
+ "properties": {}
26326
+ }
26327
+ }
25561
26328
  }
25562
- ],
26329
+ },
25563
26330
  "responses": {
25564
26331
  "200": {
25565
- "description": "Signed URL",
26332
+ "description": "Installation token and its expiry (ISO 8601)",
25566
26333
  "content": {
25567
26334
  "application/json": {
25568
26335
  "schema": {
25569
26336
  "type": "object",
25570
26337
  "properties": {
25571
- "url": {
26338
+ "token": {
25572
26339
  "type": "string"
25573
26340
  },
25574
- "expiresIn": {
25575
- "type": "number"
26341
+ "expiresAt": {
26342
+ "type": "string"
25576
26343
  }
25577
26344
  },
25578
26345
  "required": [
25579
- "url",
25580
- "expiresIn"
26346
+ "token",
26347
+ "expiresAt"
25581
26348
  ]
25582
26349
  }
25583
26350
  }
25584
26351
  }
25585
26352
  },
26353
+ "403": {
26354
+ "description": "Caller is not a registered agent",
26355
+ "content": {
26356
+ "application/json": {
26357
+ "schema": {
26358
+ "$ref": "#/components/schemas/ErrorResponse"
26359
+ }
26360
+ }
26361
+ }
26362
+ },
25586
26363
  "404": {
25587
- "description": "Task, attachment, or provider object not found",
26364
+ "description": "GitHub App worker auth is not configured",
25588
26365
  "content": {
25589
26366
  "application/json": {
25590
26367
  "schema": {
@@ -25593,8 +26370,8 @@
25593
26370
  }
25594
26371
  }
25595
26372
  },
25596
- "501": {
25597
- "description": "Active provider does not support signed URLs",
26373
+ "502": {
26374
+ "description": "GitHub refused or failed to mint the token",
25598
26375
  "content": {
25599
26376
  "application/json": {
25600
26377
  "schema": {
@@ -32855,6 +33632,103 @@
32855
33632
  }
32856
33633
  }
32857
33634
  },
33635
+ "/api/objects/agent-fs-webhook/{id}": {
33636
+ "post": {
33637
+ "summary": "Receive agent-fs file.changed events that keep primitive objects in sync",
33638
+ "tags": [
33639
+ "Webhooks"
33640
+ ],
33641
+ "parameters": [
33642
+ {
33643
+ "schema": {
33644
+ "type": "string",
33645
+ "description": "Receiver id the swarm registered with agent-fs"
33646
+ },
33647
+ "required": true,
33648
+ "description": "Receiver id the swarm registered with agent-fs",
33649
+ "name": "id",
33650
+ "in": "path"
33651
+ }
33652
+ ],
33653
+ "responses": {
33654
+ "200": {
33655
+ "description": "Event applied or ignored",
33656
+ "content": {
33657
+ "application/json": {
33658
+ "schema": {
33659
+ "type": "object",
33660
+ "properties": {
33661
+ "action": {
33662
+ "type": "string",
33663
+ "enum": [
33664
+ "updated",
33665
+ "tombstoned",
33666
+ "restored",
33667
+ "moved",
33668
+ "ignored"
33669
+ ]
33670
+ },
33671
+ "path": {
33672
+ "type": "string"
33673
+ },
33674
+ "id": {
33675
+ "type": "string"
33676
+ },
33677
+ "reason": {
33678
+ "type": "string"
33679
+ }
33680
+ },
33681
+ "required": [
33682
+ "action",
33683
+ "path"
33684
+ ]
33685
+ }
33686
+ }
33687
+ }
33688
+ },
33689
+ "400": {
33690
+ "description": "Body is not a valid event",
33691
+ "content": {
33692
+ "application/json": {
33693
+ "schema": {
33694
+ "$ref": "#/components/schemas/ErrorResponse"
33695
+ }
33696
+ }
33697
+ }
33698
+ },
33699
+ "401": {
33700
+ "description": "Unknown receiver, missing headers or invalid signature",
33701
+ "content": {
33702
+ "application/json": {
33703
+ "schema": {
33704
+ "$ref": "#/components/schemas/ErrorResponse"
33705
+ }
33706
+ }
33707
+ }
33708
+ },
33709
+ "413": {
33710
+ "description": "Body exceeds 64 KiB",
33711
+ "content": {
33712
+ "application/json": {
33713
+ "schema": {
33714
+ "$ref": "#/components/schemas/ErrorResponse"
33715
+ }
33716
+ }
33717
+ }
33718
+ },
33719
+ "503": {
33720
+ "description": "agent-fs could not be read; agent-fs retries the delivery",
33721
+ "content": {
33722
+ "application/json": {
33723
+ "schema": {
33724
+ "$ref": "#/components/schemas/ErrorResponse"
33725
+ }
33726
+ }
33727
+ }
33728
+ }
33729
+ }
33730
+ }
33731
+ },
32858
33732
  "/api/oauth/refresh-locks/{key}": {
32859
33733
  "post": {
32860
33734
  "summary": "Acquire a cross-process OAuth refresh lock",
@@ -40123,7 +40997,7 @@
40123
40997
  "/api/tasks/{id}/supersede": {
40124
40998
  "post": {
40125
40999
  "summary": "Supersede an in-progress task (terminate + spawn resume follow-up)",
40126
- "description": "Marks the original task `superseded` (terminal) and creates a fresh `taskType=\"resume\"` follow-up so a worker can pick up the work in a new provider session. Workflow-step tasks (those with `workflowRunStepId`) are carved out: the original is marked `failed` with reason `superseded_workflow_task` and no follow-up is created — the workflow engine's retry/failure policy applies, and the task moves to `superseded` once the engine queues the step's retry or the step ends without failing. With `reason: provider_fallback` (and its `errorClass`), the resume runs on the same agent with the next fallback profile that passes the profile check; when none is left, or the task is a workflow step, nothing changes and `kind: noFallback` tells the worker to fail the task itself, led by `failureReason` when set.",
41000
+ "description": "Marks the original task `superseded` (terminal) and creates a fresh `taskType=\"resume\"` follow-up so a worker can pick up the work in a new provider session. Workflow-step tasks (those with `workflowRunStepId`) are carved out: the original is marked `failed` with reason `superseded_workflow_task` and no follow-up is created — the workflow engine's retry/failure policy applies, and the task moves to `superseded` once the engine queues the step's retry or the step ends without failing. With `reason: provider_fallback` (and its `errorClass`), the resume runs on the same agent: on the same profile while a key-scoped error (`rate_limit`, `credits`) leaves another unbenched key in its pool, else on the next fallback profile that passes the profile check; when none is left, or the task is a workflow step, nothing changes and `kind: noFallback` tells the worker to fail the task itself, led by `failureReason` when set.",
40127
41001
  "tags": [
40128
41002
  "Tasks"
40129
41003
  ],
@@ -41946,6 +42820,24 @@
41946
42820
  "items": {
41947
42821
  "type": "string"
41948
42822
  }
42823
+ },
42824
+ "segments": {
42825
+ "type": "array",
42826
+ "items": {
42827
+ "type": "object",
42828
+ "properties": {
42829
+ "templateId": {
42830
+ "type": "string"
42831
+ },
42832
+ "chars": {
42833
+ "type": "integer"
42834
+ }
42835
+ },
42836
+ "required": [
42837
+ "templateId",
42838
+ "chars"
42839
+ ]
42840
+ }
41949
42841
  }
41950
42842
  },
41951
42843
  "required": [
@@ -42286,6 +43178,24 @@
42286
43178
  "items": {
42287
43179
  "type": "string"
42288
43180
  }
43181
+ },
43182
+ "segments": {
43183
+ "type": "array",
43184
+ "items": {
43185
+ "type": "object",
43186
+ "properties": {
43187
+ "templateId": {
43188
+ "type": "string"
43189
+ },
43190
+ "chars": {
43191
+ "type": "integer"
43192
+ }
43193
+ },
43194
+ "required": [
43195
+ "templateId",
43196
+ "chars"
43197
+ ]
43198
+ }
42289
43199
  }
42290
43200
  },
42291
43201
  "required": [
@@ -44157,6 +45067,289 @@
44157
45067
  }
44158
45068
  }
44159
45069
  },
45070
+ "/api/tasks/{id}/request-composition": {
45071
+ "post": {
45072
+ "summary": "Record the request composition manifest of a task session",
45073
+ "description": "The worker posts the size of each prompt part it assembled. The server adds the MCP tool-schema estimate for the agent's effective tool surface and stores the manifest as the session's next seq. A `harness-hook` post (pi, opencode) carries exact sizes measured from the request payload plus the call's prompt tokens: the server merges it with the session's worker manifest and folds the observed chars-to-tokens ratio into the provider's average. Only the agent assigned to the task may post, and a task keeps at most 100 manifests.",
45074
+ "tags": [
45075
+ "Tasks"
45076
+ ],
45077
+ "security": [
45078
+ {
45079
+ "bearerAuth": []
45080
+ }
45081
+ ],
45082
+ "parameters": [
45083
+ {
45084
+ "schema": {
45085
+ "type": "string"
45086
+ },
45087
+ "required": true,
45088
+ "name": "id",
45089
+ "in": "path"
45090
+ }
45091
+ ],
45092
+ "requestBody": {
45093
+ "content": {
45094
+ "application/json": {
45095
+ "schema": {
45096
+ "type": "object",
45097
+ "properties": {
45098
+ "sessionId": {
45099
+ "type": "string",
45100
+ "minLength": 1
45101
+ },
45102
+ "provider": {
45103
+ "type": "string",
45104
+ "minLength": 1
45105
+ },
45106
+ "model": {
45107
+ "type": "string"
45108
+ },
45109
+ "toolLoading": {
45110
+ "type": "string",
45111
+ "enum": [
45112
+ "all",
45113
+ "core",
45114
+ "preloaded",
45115
+ "none"
45116
+ ]
45117
+ },
45118
+ "parts": {
45119
+ "type": "array",
45120
+ "items": {
45121
+ "type": "object",
45122
+ "properties": {
45123
+ "kind": {
45124
+ "type": "string",
45125
+ "enum": [
45126
+ "system_section",
45127
+ "persona",
45128
+ "claude_md",
45129
+ "operator_prompt",
45130
+ "tool_schemas",
45131
+ "skills_listing",
45132
+ "task_prompt",
45133
+ "memories"
45134
+ ]
45135
+ },
45136
+ "id": {
45137
+ "type": "string",
45138
+ "minLength": 1,
45139
+ "maxLength": 200
45140
+ },
45141
+ "label": {
45142
+ "type": "string",
45143
+ "minLength": 1,
45144
+ "maxLength": 200
45145
+ },
45146
+ "chars": {
45147
+ "type": "integer",
45148
+ "minimum": 0
45149
+ },
45150
+ "fidelity": {
45151
+ "type": "string",
45152
+ "enum": [
45153
+ "exact",
45154
+ "estimate"
45155
+ ],
45156
+ "default": "exact"
45157
+ }
45158
+ },
45159
+ "required": [
45160
+ "kind",
45161
+ "id",
45162
+ "label",
45163
+ "chars"
45164
+ ]
45165
+ },
45166
+ "maxItems": 200
45167
+ },
45168
+ "source": {
45169
+ "type": "string",
45170
+ "enum": [
45171
+ "worker",
45172
+ "harness-hook"
45173
+ ],
45174
+ "default": "worker"
45175
+ },
45176
+ "harness": {
45177
+ "type": "object",
45178
+ "properties": {
45179
+ "systemChars": {
45180
+ "type": "integer",
45181
+ "minimum": 0
45182
+ },
45183
+ "payloadChars": {
45184
+ "type": "integer",
45185
+ "minimum": 0
45186
+ },
45187
+ "promptTokens": {
45188
+ "type": "integer",
45189
+ "minimum": 0
45190
+ },
45191
+ "firstMessageChars": {
45192
+ "type": "integer",
45193
+ "minimum": 0
45194
+ }
45195
+ },
45196
+ "required": [
45197
+ "systemChars",
45198
+ "payloadChars",
45199
+ "promptTokens"
45200
+ ]
45201
+ }
45202
+ },
45203
+ "required": [
45204
+ "sessionId",
45205
+ "provider",
45206
+ "toolLoading",
45207
+ "parts"
45208
+ ]
45209
+ }
45210
+ }
45211
+ }
45212
+ },
45213
+ "responses": {
45214
+ "200": {
45215
+ "description": "Manifest recorded",
45216
+ "content": {
45217
+ "application/json": {
45218
+ "schema": {
45219
+ "type": "object",
45220
+ "properties": {
45221
+ "ok": {
45222
+ "type": "boolean",
45223
+ "enum": [
45224
+ true
45225
+ ]
45226
+ },
45227
+ "id": {
45228
+ "type": "string",
45229
+ "format": "uuid"
45230
+ },
45231
+ "seq": {
45232
+ "type": "integer",
45233
+ "minimum": 0
45234
+ }
45235
+ },
45236
+ "required": [
45237
+ "ok",
45238
+ "id",
45239
+ "seq"
45240
+ ]
45241
+ }
45242
+ }
45243
+ }
45244
+ },
45245
+ "400": {
45246
+ "description": "Validation error",
45247
+ "content": {
45248
+ "application/json": {
45249
+ "schema": {
45250
+ "$ref": "#/components/schemas/ErrorResponse"
45251
+ }
45252
+ }
45253
+ }
45254
+ },
45255
+ "403": {
45256
+ "description": "Task is assigned to another agent",
45257
+ "content": {
45258
+ "application/json": {
45259
+ "schema": {
45260
+ "$ref": "#/components/schemas/ErrorResponse"
45261
+ }
45262
+ }
45263
+ }
45264
+ },
45265
+ "404": {
45266
+ "description": "Task not found",
45267
+ "content": {
45268
+ "application/json": {
45269
+ "schema": {
45270
+ "$ref": "#/components/schemas/ErrorResponse"
45271
+ }
45272
+ }
45273
+ }
45274
+ },
45275
+ "429": {
45276
+ "description": "The task already holds the maximum number of manifests",
45277
+ "content": {
45278
+ "application/json": {
45279
+ "schema": {
45280
+ "$ref": "#/components/schemas/ErrorResponse"
45281
+ }
45282
+ }
45283
+ }
45284
+ }
45285
+ }
45286
+ },
45287
+ "get": {
45288
+ "summary": "Get the request composition manifests of a task",
45289
+ "tags": [
45290
+ "Tasks"
45291
+ ],
45292
+ "security": [
45293
+ {
45294
+ "bearerAuth": []
45295
+ }
45296
+ ],
45297
+ "parameters": [
45298
+ {
45299
+ "schema": {
45300
+ "type": "string"
45301
+ },
45302
+ "required": true,
45303
+ "name": "id",
45304
+ "in": "path"
45305
+ },
45306
+ {
45307
+ "schema": {
45308
+ "type": "integer",
45309
+ "minimum": 1,
45310
+ "maximum": 100,
45311
+ "default": 100
45312
+ },
45313
+ "required": false,
45314
+ "name": "limit",
45315
+ "in": "query"
45316
+ }
45317
+ ],
45318
+ "responses": {
45319
+ "200": {
45320
+ "description": "Manifests, oldest first",
45321
+ "content": {
45322
+ "application/json": {
45323
+ "schema": {
45324
+ "type": "object",
45325
+ "properties": {
45326
+ "manifests": {
45327
+ "type": "array",
45328
+ "items": {
45329
+ "$ref": "#/components/schemas/RequestComposition"
45330
+ }
45331
+ }
45332
+ },
45333
+ "required": [
45334
+ "manifests"
45335
+ ]
45336
+ }
45337
+ }
45338
+ }
45339
+ },
45340
+ "404": {
45341
+ "description": "Task not found",
45342
+ "content": {
45343
+ "application/json": {
45344
+ "schema": {
45345
+ "$ref": "#/components/schemas/ErrorResponse"
45346
+ }
45347
+ }
45348
+ }
45349
+ }
45350
+ }
45351
+ }
45352
+ },
44160
45353
  "/api/realtime/ticket": {
44161
45354
  "post": {
44162
45355
  "summary": "Issue a one-shot dashboard realtime ticket",
@@ -57011,6 +58204,16 @@
57011
58204
  }
57012
58205
  }
57013
58206
  }
58207
+ },
58208
+ "410": {
58209
+ "description": "An operator deleted this agent id (`agent_deleted`); restore it first",
58210
+ "content": {
58211
+ "application/json": {
58212
+ "schema": {
58213
+ "$ref": "#/components/schemas/ErrorResponse"
58214
+ }
58215
+ }
58216
+ }
57014
58217
  }
57015
58218
  }
57016
58219
  },
@@ -71733,12 +72936,94 @@
71733
72936
  "type": "string",
71734
72937
  "minLength": 1
71735
72938
  },
71736
- "description": "Optional event allowlist, matched exactly against the eventHeader value after signature verification. A delivery whose event is not listed (or that has no event header) gets a 2xx `skipped` reply and creates no run. Omit or leave empty to accept every event."
72939
+ "description": "Deprecated alias of one delivery-filter clause, AND-ed with filter. Matched exactly against eventHeader, or against the preset event field when eventHeader is omitted: X-GitHub-Event (github, and the default), X-Gitlab-Event (gitlab), or JSON body type (standard-webhooks). A miss returns 200 skipped with reason event-not-allowed and creates no run. Omit or leave empty to add no event clause."
71737
72940
  },
71738
72941
  "eventHeader": {
71739
72942
  "type": "string",
71740
72943
  "minLength": 1,
71741
- "description": "Request header holding the event name for `events` (case-insensitive lookup). Defaults to X-GitHub-Event."
72944
+ "description": "Deprecated. Header read for events. The name lookup is case-insensitive and the value is exact. Overrides preset. Defaults to X-GitHub-Event when preset is omitted."
72945
+ },
72946
+ "preset": {
72947
+ "type": "string",
72948
+ "enum": [
72949
+ "github",
72950
+ "gitlab",
72951
+ "standard-webhooks"
72952
+ ],
72953
+ "description": "Optional sender preset for the events allowlist. github reads X-GitHub-Event, gitlab reads X-Gitlab-Event, and standard-webhooks reads the JSON body field type. A preset alone does not filter. Ignored when eventHeader is set."
72954
+ },
72955
+ "filter": {
72956
+ "type": "object",
72957
+ "properties": {
72958
+ "headers": {
72959
+ "type": "object",
72960
+ "additionalProperties": {
72961
+ "anyOf": [
72962
+ {
72963
+ "type": "string",
72964
+ "minLength": 1,
72965
+ "maxLength": 512
72966
+ },
72967
+ {
72968
+ "type": "array",
72969
+ "items": {
72970
+ "type": "string",
72971
+ "minLength": 1,
72972
+ "maxLength": 512
72973
+ },
72974
+ "minItems": 1,
72975
+ "maxItems": 64
72976
+ }
72977
+ ]
72978
+ },
72979
+ "description": "Header name to one exact value, or a list of exact values. Names are matched case-insensitively. Every entry must match."
72980
+ },
72981
+ "body": {
72982
+ "type": "object",
72983
+ "additionalProperties": {
72984
+ "anyOf": [
72985
+ {
72986
+ "type": "string",
72987
+ "maxLength": 512
72988
+ },
72989
+ {
72990
+ "type": "number"
72991
+ },
72992
+ {
72993
+ "type": "boolean"
72994
+ },
72995
+ {
72996
+ "type": "null"
72997
+ },
72998
+ {
72999
+ "type": "array",
73000
+ "items": {
73001
+ "anyOf": [
73002
+ {
73003
+ "type": "string",
73004
+ "maxLength": 512
73005
+ },
73006
+ {
73007
+ "type": "number"
73008
+ },
73009
+ {
73010
+ "type": "boolean"
73011
+ },
73012
+ {
73013
+ "type": "null"
73014
+ }
73015
+ ]
73016
+ },
73017
+ "minItems": 1,
73018
+ "maxItems": 64
73019
+ }
73020
+ ]
73021
+ },
73022
+ "description": "Dot path into the JSON body, to one exact scalar or a list of scalars. A numeric segment indexes an array (commits.0.id). No type coercion. Every entry must match."
73023
+ }
73024
+ },
73025
+ "additionalProperties": false,
73026
+ "description": "Header and JSON body allowlists, AND-ed with events. Evaluated after signature verification and before a run is saved. A miss returns 200 skipped with reason filter-not-matched and creates no run."
71742
73027
  }
71743
73028
  },
71744
73029
  "required": [
@@ -71914,6 +73199,16 @@
71914
73199
  }
71915
73200
  }
71916
73201
  },
73202
+ "403": {
73203
+ "description": "Env var or secret input requires config.read.secrets",
73204
+ "content": {
73205
+ "application/json": {
73206
+ "schema": {
73207
+ "$ref": "#/components/schemas/ErrorResponse"
73208
+ }
73209
+ }
73210
+ }
73211
+ },
71917
73212
  "409": {
71918
73213
  "description": "Idempotency-Key was already used for a different request",
71919
73214
  "content": {
@@ -72167,12 +73462,94 @@
72167
73462
  "type": "string",
72168
73463
  "minLength": 1
72169
73464
  },
72170
- "description": "Optional event allowlist, matched exactly against the eventHeader value after signature verification. A delivery whose event is not listed (or that has no event header) gets a 2xx `skipped` reply and creates no run. Omit or leave empty to accept every event."
73465
+ "description": "Deprecated alias of one delivery-filter clause, AND-ed with filter. Matched exactly against eventHeader, or against the preset event field when eventHeader is omitted: X-GitHub-Event (github, and the default), X-Gitlab-Event (gitlab), or JSON body type (standard-webhooks). A miss returns 200 skipped with reason event-not-allowed and creates no run. Omit or leave empty to add no event clause."
72171
73466
  },
72172
73467
  "eventHeader": {
72173
73468
  "type": "string",
72174
73469
  "minLength": 1,
72175
- "description": "Request header holding the event name for `events` (case-insensitive lookup). Defaults to X-GitHub-Event."
73470
+ "description": "Deprecated. Header read for events. The name lookup is case-insensitive and the value is exact. Overrides preset. Defaults to X-GitHub-Event when preset is omitted."
73471
+ },
73472
+ "preset": {
73473
+ "type": "string",
73474
+ "enum": [
73475
+ "github",
73476
+ "gitlab",
73477
+ "standard-webhooks"
73478
+ ],
73479
+ "description": "Optional sender preset for the events allowlist. github reads X-GitHub-Event, gitlab reads X-Gitlab-Event, and standard-webhooks reads the JSON body field type. A preset alone does not filter. Ignored when eventHeader is set."
73480
+ },
73481
+ "filter": {
73482
+ "type": "object",
73483
+ "properties": {
73484
+ "headers": {
73485
+ "type": "object",
73486
+ "additionalProperties": {
73487
+ "anyOf": [
73488
+ {
73489
+ "type": "string",
73490
+ "minLength": 1,
73491
+ "maxLength": 512
73492
+ },
73493
+ {
73494
+ "type": "array",
73495
+ "items": {
73496
+ "type": "string",
73497
+ "minLength": 1,
73498
+ "maxLength": 512
73499
+ },
73500
+ "minItems": 1,
73501
+ "maxItems": 64
73502
+ }
73503
+ ]
73504
+ },
73505
+ "description": "Header name to one exact value, or a list of exact values. Names are matched case-insensitively. Every entry must match."
73506
+ },
73507
+ "body": {
73508
+ "type": "object",
73509
+ "additionalProperties": {
73510
+ "anyOf": [
73511
+ {
73512
+ "type": "string",
73513
+ "maxLength": 512
73514
+ },
73515
+ {
73516
+ "type": "number"
73517
+ },
73518
+ {
73519
+ "type": "boolean"
73520
+ },
73521
+ {
73522
+ "type": "null"
73523
+ },
73524
+ {
73525
+ "type": "array",
73526
+ "items": {
73527
+ "anyOf": [
73528
+ {
73529
+ "type": "string",
73530
+ "maxLength": 512
73531
+ },
73532
+ {
73533
+ "type": "number"
73534
+ },
73535
+ {
73536
+ "type": "boolean"
73537
+ },
73538
+ {
73539
+ "type": "null"
73540
+ }
73541
+ ]
73542
+ },
73543
+ "minItems": 1,
73544
+ "maxItems": 64
73545
+ }
73546
+ ]
73547
+ },
73548
+ "description": "Dot path into the JSON body, to one exact scalar or a list of scalars. A numeric segment indexes an array (commits.0.id). No type coercion. Every entry must match."
73549
+ }
73550
+ },
73551
+ "additionalProperties": false,
73552
+ "description": "Header and JSON body allowlists, AND-ed with events. Evaluated after signature verification and before a run is saved. A miss returns 200 skipped with reason filter-not-matched and creates no run."
72176
73553
  }
72177
73554
  },
72178
73555
  "required": [
@@ -72362,6 +73739,16 @@
72362
73739
  }
72363
73740
  }
72364
73741
  },
73742
+ "403": {
73743
+ "description": "Env var or secret input requires config.read.secrets",
73744
+ "content": {
73745
+ "application/json": {
73746
+ "schema": {
73747
+ "$ref": "#/components/schemas/ErrorResponse"
73748
+ }
73749
+ }
73750
+ }
73751
+ },
72365
73752
  "404": {
72366
73753
  "description": "Workflow not found",
72367
73754
  "content": {
@@ -72454,179 +73841,199 @@
72454
73841
  }
72455
73842
  }
72456
73843
  },
72457
- "404": {
72458
- "description": "Workflow not found",
72459
- "content": {
72460
- "application/json": {
72461
- "schema": {
72462
- "$ref": "#/components/schemas/ErrorResponse"
72463
- }
72464
- }
72465
- }
72466
- }
72467
- }
72468
- },
72469
- "delete": {
72470
- "summary": "Delete a workflow",
72471
- "tags": [
72472
- "Workflows"
72473
- ],
72474
- "security": [
72475
- {
72476
- "bearerAuth": []
72477
- }
72478
- ],
72479
- "parameters": [
72480
- {
72481
- "schema": {
72482
- "type": "string"
72483
- },
72484
- "required": true,
72485
- "name": "id",
72486
- "in": "path"
72487
- }
72488
- ],
72489
- "responses": {
72490
- "204": {
72491
- "description": "Workflow deleted"
72492
- },
72493
- "404": {
72494
- "description": "Workflow not found",
72495
- "content": {
72496
- "application/json": {
72497
- "schema": {
72498
- "$ref": "#/components/schemas/ErrorResponse"
72499
- }
72500
- }
72501
- }
72502
- }
72503
- }
72504
- }
72505
- },
72506
- "/api/workflows/{id}/nodes/{nodeId}": {
72507
- "patch": {
72508
- "summary": "Patch a single node in a workflow definition",
72509
- "tags": [
72510
- "Workflows"
72511
- ],
72512
- "security": [
72513
- {
72514
- "bearerAuth": []
72515
- }
72516
- ],
72517
- "parameters": [
72518
- {
72519
- "schema": {
72520
- "type": "string"
72521
- },
72522
- "required": true,
72523
- "name": "id",
72524
- "in": "path"
72525
- },
72526
- {
72527
- "schema": {
72528
- "type": "string"
72529
- },
72530
- "required": true,
72531
- "name": "nodeId",
72532
- "in": "path"
72533
- }
72534
- ],
72535
- "requestBody": {
72536
- "content": {
72537
- "application/json": {
72538
- "schema": {
72539
- "type": "object",
72540
- "properties": {
72541
- "type": {
72542
- "type": "string",
72543
- "description": "Executor type: 'agent-task', 'script', 'swarm-script', 'raw-llm', 'system-one-decision', 'system-one-extraction', 'validate', 'property-match'"
72544
- },
72545
- "label": {
72546
- "type": "string",
72547
- "description": "Human-readable label for UI display"
72548
- },
72549
- "config": {
72550
- "type": "object",
72551
- "additionalProperties": {},
72552
- "description": "Executor-specific config. For agent-task: { template, outputSchema?, agentId?, routingReason?, routingNote?, tags?, priority?, dir?, vcsRepo?, model? }; configured agentId defaults routingReason to human_pinned. For script: { runtime, script, args?, env?, timeout? }; env is a string-to-string map of environment variables with interpolated values and can be used alongside args. For swarm-script: { scriptName, scope?, pinHash?, args?, fsMode?, timeoutMs? (1000-300000) }. For system-one-decision (typed decisions, Jev by default): { provider? ('typesafe' default | 'openrouter' | 'laya'; a literal, never a {{token}}), state, questions: { <id>: { type: 'noul'|'choice'|'score', instructions, criteria? } }, returns: { <id>: { type } }, model? (provider-specific; unset = the provider's default, and laya has none so it sends no model and picks its own checkpoint), timeoutMs?, maxRetries? (0-3), humanReview? { band: { min, max } (0-1, inclusive), approvers: { users?, roles?, policy }, title?, timeout?, notifications? } }; each provider needs its own global secret (TYPESAFE_API_KEY, OPENROUTER_API_KEY, or LAYA_API_KEY; laya also needs the global config LAYA_URL), and a save warns and a run fails before any node executes when one is missing; system-one-decision nodes must not set retry or validation.retry. With humanReview, an answer whose confidence is inside the band waits for a person (human-in-the-loop approval), and next must map ports { approved, rejected?, timeout? }. For system-one-extraction (typed extraction, Cloudflare Clairic by default): { provider? ('cloudflare'; a literal), state (text to read; may be empty when images are sent), fields: { <id>: { type: 'text'|'number'|'date'|'time'|'datetime'|'duration'|'list'|'estimate'|'forecast', instructions?, ...type options (number: unit?, integer?, decimals?; duration: unit? (seconds..years), integer?, decimals?; list: items ('text'|'number'|'date'); estimate: min, max, step?, scale?, unit?; forecast: min, max, horizon?, interval?, scale?, unit?; text/number/date/time/datetime/duration: null_threshold?) } }, images? (max 4 base64 data: URLs or { content_type, base64 }), referenceDate? (YYYY-MM-DD), model?, timeoutMs?, maxRetries? (0-3) }; output answers.<id> carries value (null when the input does not say), guess, p_null, confidence, span/spans, and for estimate/forecast median/p10/p90. Needs the global secret CLOUDFLARE_API_TOKEN (or CLOUDFLARE_API_KEY) and the global config CLOUDFLARE_ACCOUNT_ID; must not set retry or validation.retry. Agent-task templates and ordinary config values support {{interpolation}} from the node's inputs context, including trigger and declared upstream aliases. SECURITY: executable source for script/swarm-script nodes does not interpolate trigger.* or upstream node outputs; only input/workflow/swarm/run values are allowed in inline script source, and named swarm-script source is not workflow-interpolated. Pass dynamic values through config.args instead (inline script receives them as argv, with runtime: \"bash\" running bash -c <script> ...args so args[0] is $0 and args[1] is $1; swarm-script receives its args object). Inline script nodes also accept config.env for environment variables. NOTE: config.outputSchema on agent-task nodes validates the AGENT's raw JSON output, while node-level outputSchema validates the EXECUTOR's return value ({taskId, taskOutput})."
72553
- },
72554
- "next": {
72555
- "anyOf": [
72556
- {
72557
- "type": "string"
72558
- },
72559
- {
72560
- "type": "array",
72561
- "items": {
72562
- "type": "string"
72563
- }
72564
- },
72565
- {
72566
- "type": "object",
72567
- "additionalProperties": {
72568
- "type": "string"
72569
- }
72570
- }
72571
- ],
72572
- "description": "Next node(s): string for simple chaining, string[] for fan-out to parallel nodes, or record for port-based routing ({pass: 'a', fail: 'b'})"
72573
- },
72574
- "validation": {
72575
- "$ref": "#/components/schemas/StepValidationConfig"
72576
- },
72577
- "retry": {
72578
- "$ref": "#/components/schemas/RetryPolicy"
72579
- },
72580
- "inputs": {
72581
- "type": "object",
72582
- "additionalProperties": {
72583
- "type": "string"
72584
- },
72585
- "description": "REQUIRED for cross-node data access. Maps local names to context paths. Without this, upstream step outputs are NOT available for interpolation; built-in trigger/input/workflow/swarm/run context remains available. Example: { \"cityData\": \"generate-city\" } → use {{cityData.taskOutput.field}} in config templates. For trigger data: { \"pr\": \"trigger.pullRequest\" }. This mapping works in agent-task templates and ordinary config, but executable script/swarm-script source excludes trigger and upstream-output aliases. Route those dynamic values through config.args (argv for inline scripts) instead; inline script nodes also accept config.env for environment variables."
72586
- },
72587
- "inputSchema": {
72588
- "type": "object",
72589
- "additionalProperties": {},
72590
- "description": "JSON Schema to validate resolved inputs before execution"
72591
- },
72592
- "outputSchema": {
72593
- "type": "object",
72594
- "additionalProperties": {},
72595
- "description": "JSON Schema to validate the executor's output (e.g. {taskId, taskOutput} for agent-task). Different from config.outputSchema which validates the agent's raw output."
72596
- }
72597
- }
72598
- }
72599
- }
72600
- }
72601
- },
72602
- "responses": {
72603
- "200": {
72604
- "description": "Node patched (version snapshot created)",
72605
- "content": {
72606
- "application/json": {
72607
- "schema": {
72608
- "allOf": [
72609
- {
72610
- "$ref": "#/components/schemas/Workflow"
72611
- },
72612
- {
72613
- "type": "object",
72614
- "properties": {
72615
- "warnings": {
72616
- "type": "array",
72617
- "items": {
72618
- "type": "string"
72619
- }
72620
- }
72621
- }
72622
- }
72623
- ]
72624
- }
72625
- }
72626
- }
72627
- },
72628
- "400": {
72629
- "description": "Invalid patch or resulting definition",
73844
+ "403": {
73845
+ "description": "Stored env var or secret input requires config.read.secrets",
73846
+ "content": {
73847
+ "application/json": {
73848
+ "schema": {
73849
+ "$ref": "#/components/schemas/ErrorResponse"
73850
+ }
73851
+ }
73852
+ }
73853
+ },
73854
+ "404": {
73855
+ "description": "Workflow not found",
73856
+ "content": {
73857
+ "application/json": {
73858
+ "schema": {
73859
+ "$ref": "#/components/schemas/ErrorResponse"
73860
+ }
73861
+ }
73862
+ }
73863
+ }
73864
+ }
73865
+ },
73866
+ "delete": {
73867
+ "summary": "Delete a workflow",
73868
+ "tags": [
73869
+ "Workflows"
73870
+ ],
73871
+ "security": [
73872
+ {
73873
+ "bearerAuth": []
73874
+ }
73875
+ ],
73876
+ "parameters": [
73877
+ {
73878
+ "schema": {
73879
+ "type": "string"
73880
+ },
73881
+ "required": true,
73882
+ "name": "id",
73883
+ "in": "path"
73884
+ }
73885
+ ],
73886
+ "responses": {
73887
+ "204": {
73888
+ "description": "Workflow deleted"
73889
+ },
73890
+ "404": {
73891
+ "description": "Workflow not found",
73892
+ "content": {
73893
+ "application/json": {
73894
+ "schema": {
73895
+ "$ref": "#/components/schemas/ErrorResponse"
73896
+ }
73897
+ }
73898
+ }
73899
+ }
73900
+ }
73901
+ }
73902
+ },
73903
+ "/api/workflows/{id}/nodes/{nodeId}": {
73904
+ "patch": {
73905
+ "summary": "Patch a single node in a workflow definition",
73906
+ "tags": [
73907
+ "Workflows"
73908
+ ],
73909
+ "security": [
73910
+ {
73911
+ "bearerAuth": []
73912
+ }
73913
+ ],
73914
+ "parameters": [
73915
+ {
73916
+ "schema": {
73917
+ "type": "string"
73918
+ },
73919
+ "required": true,
73920
+ "name": "id",
73921
+ "in": "path"
73922
+ },
73923
+ {
73924
+ "schema": {
73925
+ "type": "string"
73926
+ },
73927
+ "required": true,
73928
+ "name": "nodeId",
73929
+ "in": "path"
73930
+ }
73931
+ ],
73932
+ "requestBody": {
73933
+ "content": {
73934
+ "application/json": {
73935
+ "schema": {
73936
+ "type": "object",
73937
+ "properties": {
73938
+ "type": {
73939
+ "type": "string",
73940
+ "description": "Executor type: 'agent-task', 'script', 'swarm-script', 'raw-llm', 'system-one-decision', 'system-one-extraction', 'validate', 'property-match'"
73941
+ },
73942
+ "label": {
73943
+ "type": "string",
73944
+ "description": "Human-readable label for UI display"
73945
+ },
73946
+ "config": {
73947
+ "type": "object",
73948
+ "additionalProperties": {},
73949
+ "description": "Executor-specific config. For agent-task: { template, outputSchema?, agentId?, routingReason?, routingNote?, tags?, priority?, dir?, vcsRepo?, model? }; configured agentId defaults routingReason to human_pinned. For script: { runtime, script, args?, env?, timeout? }; env is a string-to-string map of environment variables with interpolated values and can be used alongside args. For swarm-script: { scriptName, scope?, pinHash?, args?, fsMode?, timeoutMs? (1000-300000) }. For system-one-decision (typed decisions, Jev by default): { provider? ('typesafe' default | 'openrouter' | 'laya'; a literal, never a {{token}}), state, questions: { <id>: { type: 'noul'|'choice'|'score', instructions, criteria? } }, returns: { <id>: { type } }, model? (provider-specific; unset = the provider's default, and laya has none so it sends no model and picks its own checkpoint), timeoutMs?, maxRetries? (0-3), humanReview? { band: { min, max } (0-1, inclusive), approvers: { users?, roles?, policy }, title?, timeout?, notifications? } }; each provider needs its own global secret (TYPESAFE_API_KEY, OPENROUTER_API_KEY, or LAYA_API_KEY; laya also needs the global config LAYA_URL), and a save warns and a run fails before any node executes when one is missing; system-one-decision nodes must not set retry or validation.retry. With humanReview, an answer whose confidence is inside the band waits for a person (human-in-the-loop approval), and next must map ports { approved, rejected?, timeout? }. For system-one-extraction (typed extraction, Cloudflare Clairic by default): { provider? ('cloudflare'; a literal), state (text to read; may be empty when images are sent), fields: { <id>: { type: 'text'|'number'|'date'|'time'|'datetime'|'duration'|'list'|'estimate'|'forecast', instructions?, ...type options (number: unit?, integer?, decimals?; duration: unit? (seconds..years), integer?, decimals?; list: items ('text'|'number'|'date'); estimate: min, max, step?, scale?, unit?; forecast: min, max, horizon?, interval?, scale?, unit?; text/number/date/time/datetime/duration: null_threshold?) } }, images? (max 4 base64 data: URLs or { content_type, base64 }), referenceDate? (YYYY-MM-DD), model?, timeoutMs?, maxRetries? (0-3) }; output answers.<id> carries value (null when the input does not say), guess, p_null, confidence, span/spans, and for estimate/forecast median/p10/p90. Needs the global secret CLOUDFLARE_API_TOKEN (or CLOUDFLARE_API_KEY) and the global config CLOUDFLARE_ACCOUNT_ID; must not set retry or validation.retry. Agent-task templates and ordinary config values support {{interpolation}} from the node's inputs context, including trigger and declared upstream aliases. SECURITY: executable source for script/swarm-script nodes does not interpolate trigger.* or upstream node outputs; only input/workflow/swarm/run values are allowed in inline script source, and named swarm-script source is not workflow-interpolated. Pass dynamic values through config.args instead (inline script receives them as argv, with runtime: \"bash\" running bash -c <script> ...args so args[0] is $0 and args[1] is $1; swarm-script receives its args object). Inline script nodes also accept config.env for environment variables. NOTE: config.outputSchema on agent-task nodes validates the AGENT's raw JSON output, while node-level outputSchema validates the EXECUTOR's return value ({taskId, taskOutput})."
73950
+ },
73951
+ "next": {
73952
+ "anyOf": [
73953
+ {
73954
+ "type": "string"
73955
+ },
73956
+ {
73957
+ "type": "array",
73958
+ "items": {
73959
+ "type": "string"
73960
+ }
73961
+ },
73962
+ {
73963
+ "type": "object",
73964
+ "additionalProperties": {
73965
+ "type": "string"
73966
+ }
73967
+ }
73968
+ ],
73969
+ "description": "Next node(s): string for simple chaining, string[] for fan-out to parallel nodes, or record for port-based routing ({pass: 'a', fail: 'b'})"
73970
+ },
73971
+ "validation": {
73972
+ "$ref": "#/components/schemas/StepValidationConfig"
73973
+ },
73974
+ "retry": {
73975
+ "$ref": "#/components/schemas/RetryPolicy"
73976
+ },
73977
+ "inputs": {
73978
+ "type": "object",
73979
+ "additionalProperties": {
73980
+ "type": "string"
73981
+ },
73982
+ "description": "REQUIRED for cross-node data access. Maps local names to context paths. Without this, upstream step outputs are NOT available for interpolation; built-in trigger/input/workflow/swarm/run context remains available. Example: { \"cityData\": \"generate-city\" } → use {{cityData.taskOutput.field}} in config templates. For trigger data: { \"pr\": \"trigger.pullRequest\" }. This mapping works in agent-task templates and ordinary config, but executable script/swarm-script source excludes trigger and upstream-output aliases. Route those dynamic values through config.args (argv for inline scripts) instead; inline script nodes also accept config.env for environment variables."
73983
+ },
73984
+ "inputSchema": {
73985
+ "type": "object",
73986
+ "additionalProperties": {},
73987
+ "description": "JSON Schema to validate resolved inputs before execution"
73988
+ },
73989
+ "outputSchema": {
73990
+ "type": "object",
73991
+ "additionalProperties": {},
73992
+ "description": "JSON Schema to validate the executor's output (e.g. {taskId, taskOutput} for agent-task). Different from config.outputSchema which validates the agent's raw output."
73993
+ }
73994
+ }
73995
+ }
73996
+ }
73997
+ }
73998
+ },
73999
+ "responses": {
74000
+ "200": {
74001
+ "description": "Node patched (version snapshot created)",
74002
+ "content": {
74003
+ "application/json": {
74004
+ "schema": {
74005
+ "allOf": [
74006
+ {
74007
+ "$ref": "#/components/schemas/Workflow"
74008
+ },
74009
+ {
74010
+ "type": "object",
74011
+ "properties": {
74012
+ "warnings": {
74013
+ "type": "array",
74014
+ "items": {
74015
+ "type": "string"
74016
+ }
74017
+ }
74018
+ }
74019
+ }
74020
+ ]
74021
+ }
74022
+ }
74023
+ }
74024
+ },
74025
+ "400": {
74026
+ "description": "Invalid patch or resulting definition",
74027
+ "content": {
74028
+ "application/json": {
74029
+ "schema": {
74030
+ "$ref": "#/components/schemas/ErrorResponse"
74031
+ }
74032
+ }
74033
+ }
74034
+ },
74035
+ "403": {
74036
+ "description": "Stored env var or secret input requires config.read.secrets",
72630
74037
  "content": {
72631
74038
  "application/json": {
72632
74039
  "schema": {
@@ -73416,35 +74823,80 @@
73416
74823
  ],
73417
74824
  "responses": {
73418
74825
  "200": {
73419
- "description": "Delivery skipped: its event is not in the trigger's `events` allowlist. No run was created.",
74826
+ "description": "Delivery skipped after signature verification and before a run was saved. event-not-allowed: the events allowlist missed. filter-not-matched: a header or JSON body field missed. The received value is not echoed for a filter miss.",
73420
74827
  "content": {
73421
74828
  "application/json": {
73422
74829
  "schema": {
73423
- "type": "object",
73424
- "properties": {
73425
- "skipped": {
73426
- "type": "boolean",
73427
- "enum": [
73428
- true
73429
- ]
73430
- },
73431
- "reason": {
73432
- "type": "string",
73433
- "enum": [
73434
- "event-not-allowed"
74830
+ "oneOf": [
74831
+ {
74832
+ "type": "object",
74833
+ "properties": {
74834
+ "skipped": {
74835
+ "type": "boolean",
74836
+ "enum": [
74837
+ true
74838
+ ]
74839
+ },
74840
+ "reason": {
74841
+ "type": "string",
74842
+ "enum": [
74843
+ "event-not-allowed"
74844
+ ]
74845
+ },
74846
+ "event": {
74847
+ "type": [
74848
+ "string",
74849
+ "null"
74850
+ ]
74851
+ }
74852
+ },
74853
+ "required": [
74854
+ "skipped",
74855
+ "reason",
74856
+ "event"
73435
74857
  ]
73436
74858
  },
73437
- "event": {
73438
- "type": [
73439
- "string",
73440
- "null"
74859
+ {
74860
+ "type": "object",
74861
+ "properties": {
74862
+ "skipped": {
74863
+ "type": "boolean",
74864
+ "enum": [
74865
+ true
74866
+ ]
74867
+ },
74868
+ "reason": {
74869
+ "type": "string",
74870
+ "enum": [
74871
+ "filter-not-matched"
74872
+ ]
74873
+ },
74874
+ "match": {
74875
+ "type": "object",
74876
+ "properties": {
74877
+ "source": {
74878
+ "type": "string",
74879
+ "enum": [
74880
+ "header",
74881
+ "body"
74882
+ ]
74883
+ },
74884
+ "path": {
74885
+ "type": "string"
74886
+ }
74887
+ },
74888
+ "required": [
74889
+ "source",
74890
+ "path"
74891
+ ]
74892
+ }
74893
+ },
74894
+ "required": [
74895
+ "skipped",
74896
+ "reason",
74897
+ "match"
73441
74898
  ]
73442
74899
  }
73443
- },
73444
- "required": [
73445
- "skipped",
73446
- "reason",
73447
- "event"
73448
74900
  ]
73449
74901
  }
73450
74902
  }
@@ -73953,6 +75405,21 @@
73953
75405
  ],
73954
75406
  "additionalProperties": false
73955
75407
  },
75408
+ "workspace": {
75409
+ "type": [
75410
+ "object",
75411
+ "null"
75412
+ ],
75413
+ "properties": {
75414
+ "sizeGb": {
75415
+ "type": "integer",
75416
+ "minimum": 1,
75417
+ "maximum": 1024
75418
+ }
75419
+ },
75420
+ "default": null,
75421
+ "additionalProperties": false
75422
+ },
73956
75423
  "ttlSec": {
73957
75424
  "type": [
73958
75425
  "integer",
@@ -74251,6 +75718,20 @@
74251
75718
  ],
74252
75719
  "additionalProperties": false
74253
75720
  },
75721
+ "workspace": {
75722
+ "type": [
75723
+ "object",
75724
+ "null"
75725
+ ],
75726
+ "properties": {
75727
+ "sizeGb": {
75728
+ "type": "integer",
75729
+ "minimum": 1,
75730
+ "maximum": 1024
75731
+ }
75732
+ },
75733
+ "additionalProperties": false
75734
+ },
74254
75735
  "ttlSec": {
74255
75736
  "type": [
74256
75737
  "integer",