@desplega.ai/agent-swarm 2.14.1 → 2.14.2

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 (346) hide show
  1. package/dist/{acp-adapter-7jv7w8jh.js → acp-adapter-q1vz4hh2.js} +8 -8
  2. package/dist/{acp-targets-0ebmg3et.js → acp-targets-d44eerh4.js} +7 -7
  3. package/dist/{actions-0ds9dx6c.js → actions-z4k4bvss.js} +27 -27
  4. package/dist/{agent-fs-provision-zpbxa9jc.js → agent-fs-provision-aan1cgpx.js} +4 -4
  5. package/dist/{amp-adapter-awh5nn7a.js → amp-adapter-wac3py0p.js} +1 -1
  6. package/dist/{anthropic-messages-gtgp9r85.js → anthropic-messages-njt2r5m4.js} +16 -15
  7. package/dist/{app-nzejkvpp.js → app-wax6qz5e.js} +9 -9
  8. package/dist/{approval-notifications-hbqtb2w3.js → approval-notifications-6fvkhnma.js} +10 -10
  9. package/dist/{assistant-1paft129.js → assistant-e8fe08zx.js} +25 -25
  10. package/dist/{azure-openai-responses-e76k86gf.js → azure-openai-responses-6ewf9rwp.js} +9 -9
  11. package/dist/{boot-args-schema-zs435mfx.js → boot-args-schema-rv97cmnt.js} +1 -1
  12. package/dist/{boot-reembed-91qrd4mz.js → boot-reembed-bcn7frk9.js} +1 -1
  13. package/dist/{boot-reembed-7xq2qgg4.js → boot-reembed-xakrdy6y.js} +1 -1
  14. package/dist/{boot-scrub-sweep-3h5xscw6.js → boot-scrub-sweep-20t8akhf.js} +2 -2
  15. package/dist/{boot-seeds-xkxqa8zc.js → boot-seeds-48rr6r29.js} +4 -4
  16. package/dist/{boxd-464x3w4m.js → boxd-tjpxwecx.js} +2 -2
  17. package/dist/{claude-adapter-6d8eyf2f.js → claude-adapter-0wzwntrj.js} +8 -8
  18. package/dist/{claude-managed-adapter-jzxcaf9m.js → claude-managed-adapter-4xcgt46w.js} +2 -2
  19. package/dist/{claude-managed-setup-5fcx0qh3.js → claude-managed-setup-91cyktw7.js} +5 -5
  20. package/dist/{claude-sdk-session-11vhz1hc.js → claude-sdk-session-ngj4dce5.js} +9658 -9634
  21. package/dist/{cli-hamdfjtx.js → cli-021hrewp.js} +1 -1
  22. package/dist/{cli-pgdqhdkw.js → cli-0kyjrbaa.js} +2 -2
  23. package/dist/{cli-132h67ps.js → cli-0nz04gqv.js} +48 -48
  24. package/dist/{cli-6a77m17n.js → cli-0rrft7s3.js} +2 -2
  25. package/dist/{cli-z0effej1.js → cli-1d9q7qrn.js} +5 -5
  26. package/dist/{cli-tdd9dvw6.js → cli-1t5vhrpv.js} +1 -1
  27. package/dist/{cli-zyf288rw.js → cli-2ja7eadd.js} +1 -1
  28. package/dist/{cli-k9m8fckz.js → cli-3ffzr65w.js} +4 -4
  29. package/dist/{cli-02ba8qx5.js → cli-3kdgm393.js} +4 -4
  30. package/dist/{cli-hh5m39pt.js → cli-3vc518cw.js} +1 -1
  31. package/dist/{cli-5pyes68e.js → cli-5188hq0a.js} +8 -8
  32. package/dist/{cli-zcghfsdg.js → cli-53gt8wfv.js} +1 -1
  33. package/dist/{cli-5t00r6c9.js → cli-5njmmmer.js} +2 -2
  34. package/dist/{cli-etykr11s.js → cli-5rw7nt99.js} +1 -1
  35. package/dist/{cli-6c61yjwy.js → cli-5xx353cy.js} +7554 -1534
  36. package/dist/{cli-by7s3n4p.js → cli-65k149j5.js} +2 -2
  37. package/dist/{cli-1e13gvfn.js → cli-6zpn5hmp.js} +11 -11
  38. package/dist/{cli-rb1z91g8.js → cli-7dpdq7yh.js} +1230 -540
  39. package/dist/{cli-3bagv8rt.js → cli-7wwewkf4.js} +1 -1
  40. package/dist/{cli-288k5ep1.js → cli-83hynhes.js} +15 -11
  41. package/dist/{cli-v84kb7af.js → cli-8ee7xt75.js} +11 -11
  42. package/dist/{cli-v3jxx8dv.js → cli-8ef94zm2.js} +2 -2
  43. package/dist/{cli-9fvk9mv8.js → cli-8gr1bg9t.js} +1 -1
  44. package/dist/{cli-vrb8pvrf.js → cli-9j1qcs0b.js} +6 -6
  45. package/dist/{cli-0dkpdvnn.js → cli-9mvfvggt.js} +5 -5
  46. package/dist/{cli-3bcsc3m7.js → cli-an8bpy60.js} +1 -1
  47. package/dist/{cli-6yhjqd6k.js → cli-azptj8xe.js} +810 -184
  48. package/dist/{cli-3a3hm1z8.js → cli-c0rt16vk.js} +2 -2
  49. package/dist/{cli-byzq8xht.js → cli-c6vhcknq.js} +6 -6
  50. package/dist/{cli-eaqxkeq0.js → cli-cczffwak.js} +8 -8
  51. package/dist/{cli-83kf2y60.js → cli-cgmka83w.js} +6 -6
  52. package/dist/{cli-5xjdft4s.js → cli-d13qgcct.js} +207 -142
  53. package/dist/{cli-k3facve0.js → cli-d5nvy1jy.js} +1 -1
  54. package/dist/{cli-zvsy4abb.js → cli-dev6f0px.js} +3 -3
  55. package/dist/{cli-e1wprqnd.js → cli-dzhht0vq.js} +2 -2
  56. package/dist/{cli-zdkcp8p0.js → cli-e13kbyq0.js} +1 -1
  57. package/dist/{cli-f07sgaax.js → cli-e2k0ej0d.js} +2 -2
  58. package/dist/{cli-dt931hb8.js → cli-ek8b88kv.js} +21 -21
  59. package/dist/{cli-20mkgwev.js → cli-ertcjw6z.js} +249 -19
  60. package/dist/{cli-0qyfna7a.js → cli-f3ta4e67.js} +4 -4
  61. package/dist/{cli-6xrbpj5j.js → cli-f4xv7s0t.js} +4 -4
  62. package/dist/{cli-d1zkys4j.js → cli-fdam1t9b.js} +29 -13
  63. package/dist/{cli-spfz393q.js → cli-feh37wgs.js} +598 -219
  64. package/dist/{cli-ebqx630g.js → cli-fjzjtqna.js} +35 -18
  65. package/dist/{cli-zgsd2w2k.js → cli-fs9t2m2k.js} +16 -16
  66. package/dist/{cli-trvtxwzt.js → cli-g03x26q6.js} +2 -2
  67. package/dist/{cli-0mq8kxfx.js → cli-gnkzh8ed.js} +3 -3
  68. package/dist/{cli-phantfg3.js → cli-gy0r7gb8.js} +40 -15
  69. package/dist/{cli-wsh5vfa7.js → cli-h364asjc.js} +2 -2
  70. package/dist/{cli-3ktfe5jx.js → cli-h3xcfp4c.js} +22 -7
  71. package/dist/{cli-976m0zcw.js → cli-h8k5801a.js} +49 -13
  72. package/dist/{cli-727sq1f9.js → cli-h96yp7xv.js} +2 -2
  73. package/dist/{cli-ytgtqsy9.js → cli-hab0bvrh.js} +1 -1
  74. package/dist/{cli-7dwsn9y5.js → cli-j3wqt73b.js} +4 -4
  75. package/dist/{cli-8kemtj1r.js → cli-jfgaz10x.js} +7 -7
  76. package/dist/{cli-wtwe8vng.js → cli-jrhvywah.js} +25 -24
  77. package/dist/{cli-tjrrabez.js → cli-jrxt5j0n.js} +3 -3
  78. package/dist/{cli-7b7rxz22.js → cli-jw7n9pct.js} +5 -2
  79. package/dist/{cli-k791mabe.js → cli-k9kfck3s.js} +5 -5
  80. package/dist/{cli-44r66df2.js → cli-kkwq5b12.js} +1 -1
  81. package/dist/{cli-e9p9h14n.js → cli-nc842kc9.js} +4 -4
  82. package/dist/{cli-3179w2rz.js → cli-nmj4phcg.js} +1 -1
  83. package/dist/{cli-ny8f5g7t.js → cli-praaw1wh.js} +1 -1
  84. package/dist/{cli-j8fmn3wv.js → cli-q44p4869.js} +7 -7
  85. package/dist/{cli-sq32dgfe.js → cli-q58qt9dw.js} +237 -57
  86. package/dist/{cli-2n7qdqfv.js → cli-qqz5z36e.js} +2 -2
  87. package/dist/{cli-b70cpf8f.js → cli-r7rpy2xz.js} +1 -1
  88. package/dist/{cli-1hj68b3h.js → cli-rcqgr0hs.js} +1 -1
  89. package/dist/{cli-ph95yejc.js → cli-rjc464jg.js} +2 -2
  90. package/dist/{cli-967jrz7j.js → cli-rw3m83j4.js} +15 -15
  91. package/dist/{cli-0vxbrxr3.js → cli-rwcj6wt3.js} +304 -19
  92. package/dist/{cli-yvnnyjxm.js → cli-ryn4y478.js} +1 -1
  93. package/dist/{cli-3g0vbq46.js → cli-s48k2rzx.js} +3 -3
  94. package/dist/{cli-98sea4d9.js → cli-s90wcbk9.js} +2 -2
  95. package/dist/{cli-e2wzzw17.js → cli-svcy72s5.js} +1 -1
  96. package/dist/{cli-643skca1.js → cli-swtwbg85.js} +17 -17
  97. package/dist/{cli-4y2bekkn.js → cli-t1bqpzgz.js} +2 -2
  98. package/dist/{cli-zmfs06hg.js → cli-t5jbjq61.js} +3 -3
  99. package/dist/{cli-mz7ycqn8.js → cli-td2h8zej.js} +6 -6
  100. package/dist/{cli-9t7syepg.js → cli-ttatvwn6.js} +1 -1
  101. package/dist/{cli-v1rhq77v.js → cli-txxcf9s1.js} +6 -6
  102. package/dist/{cli-q4z9s6zs.js → cli-v7az4d1g.js} +2 -2
  103. package/dist/cli-vqt44168.js +14 -0
  104. package/dist/{cli-tkrp183j.js → cli-vs9h3vw2.js} +5 -5
  105. package/dist/{cli-7abeph0b.js → cli-w2fg8kjc.js} +3 -3
  106. package/dist/{cli-sf5kp73f.js → cli-wz7qj1jy.js} +12 -12
  107. package/dist/{cli-ww8wxfzx.js → cli-x5t54ytt.js} +2 -2
  108. package/dist/{cli-nmdy8bzf.js → cli-xphbv66z.js} +1 -1
  109. package/dist/{cli-redtbppc.js → cli-xxgqn93n.js} +3753 -1186
  110. package/dist/{cli-s7bfz1ye.js → cli-z209g721.js} +109 -85
  111. package/dist/{cli-vp2ksaq9.js → cli-z5andw8k.js} +1 -1
  112. package/dist/{cli-xmc2nrtv.js → cli-zr2sc5tr.js} +1 -1
  113. package/dist/{cli-z0c98h7h.js → cli-zrm0610v.js} +61 -54
  114. package/dist/cli.js +41 -40
  115. package/dist/{cloudflare-workers-ai-system-one-w3m0fbf8.js → cloudflare-workers-ai-system-one-kb0tq22h.js} +2 -2
  116. package/dist/{codex-adapter-seht4h9t.js → codex-adapter-0c1ynrmt.js} +5 -5
  117. package/dist/{codex-session-runner-tq95x3gq.js → codex-session-runner-z4t9z7yy.js} +5 -5
  118. package/dist/{commands-0awwqxq5.js → commands-h0jxqdhk.js} +3 -3
  119. package/dist/{controller-hgjx521c.js → controller-4ygy66hv.js} +3 -3
  120. package/dist/{controllers-connect-j4kdmhfj.js → controllers-connect-ynbvv8pv.js} +26 -26
  121. package/dist/core-mj9fzrcm.js +41 -0
  122. package/dist/{cursor-adapter-0rg8wk6j.js → cursor-adapter-9e4d6658.js} +1 -1
  123. package/dist/{db-8xs2js3s.js → db-bg0hxjq1.js} +3 -3
  124. package/dist/{db-dd6hj211.js → db-q12gmpns.js} +2 -2
  125. package/dist/{devtools-b8qts77k.js → devtools-t8my9az6.js} +1 -1
  126. package/dist/{dispatcher-v7drd034.js → dispatcher-v5dbfscq.js} +23 -23
  127. package/dist/{dsh-adapter-ah8npj2x.js → dsh-adapter-z3fneea1.js} +1 -1
  128. package/dist/{e2b-z1g7vpz6.js → e2b-k3kb8b52.js} +3 -3
  129. package/dist/{e2b-hg80w0qr.js → e2b-p269awh6.js} +4 -4
  130. package/dist/{easter-egg-3d-8n4w3s9k.js → easter-egg-3d-y49v5z90.js} +1 -1
  131. package/dist/{embedding-space-0p921zt3.js → embedding-space-mjt5ksq0.js} +5 -5
  132. package/dist/{embeddings-9s7kbrc6.js → embeddings-td9hgnc5.js} +1 -1
  133. package/dist/{execute-x0fy9j0m.js → execute-z8nc8bba.js} +1 -1
  134. package/dist/{external-channel-ktfvn29c.js → external-channel-pjenc2ag.js} +2 -2
  135. package/dist/{fx-adapter-15vjxvgm.js → fx-adapter-pjeztp0n.js} +9 -9
  136. package/dist/getMachineId-bsd-hjs2tbdp.js +36 -0
  137. package/dist/getMachineId-darwin-kzbvr8s3.js +40 -0
  138. package/dist/getMachineId-linux-embmcq2c.js +26 -0
  139. package/dist/getMachineId-unsupported-jvznc6d4.js +20 -0
  140. package/dist/getMachineId-win-qr8z0b13.js +36 -0
  141. package/dist/{google-generative-ai-nzndg246.js → google-generative-ai-tf3w7557.js} +11 -16
  142. package/dist/{google-vertex-ragh3nnw.js → google-vertex-9pj87bd8.js} +15 -17
  143. package/dist/{grok-adapter-77httan0.js → grok-adapter-davbhx8t.js} +9 -9
  144. package/dist/handlers-rf130hnp.js +39 -0
  145. package/dist/{heartbeat-5yaj6dym.js → heartbeat-9hmvqxk0.js} +26 -26
  146. package/dist/{hook-c99nycyh.js → hook-0b1jqs2t.js} +6 -6
  147. package/dist/{hook-2jttae8s.js → hook-1n0sjv8p.js} +7 -7
  148. package/dist/{http-7y9dbfrr.js → http-vykejyjx.js} +412 -183
  149. package/dist/{index-tcegcysh.js → index-07d66kdm.js} +5 -5
  150. package/dist/{index-fqf82sbk.js → index-0hgjxqz8.js} +1 -1
  151. package/dist/{index-t274qhhs.js → index-0nt39qwy.js} +6 -6
  152. package/dist/{index-8p03vx1h.js → index-2xbxq71g.js} +8 -8
  153. package/dist/{index-jvfp0j47.js → index-3j8hffkb.js} +12038 -7667
  154. package/dist/index-8w09aggw.js +43 -0
  155. package/dist/{index-xhp7yp3t.js → index-b3wy4jzs.js} +1 -1
  156. package/dist/{index-6g9rdcrj.js → index-dt9vr7tb.js} +162 -57
  157. package/dist/{index-cw8nxnba.js → index-ezfas4jj.js} +1912 -346
  158. package/dist/index-g2jntx15.js +38 -0
  159. package/dist/{index-h9xnzfhx.js → index-j6sqtb83.js} +101 -72
  160. package/dist/{index-m6g8q65g.js → index-na0tczq0.js} +9268 -10220
  161. package/dist/{index-tn1m3q9b.js → index-p9dkwhwe.js} +3 -3
  162. package/dist/{index-g7rthzrv.js → index-pe2etczf.js} +8 -8
  163. package/dist/index-qffex5k4.js +41 -0
  164. package/dist/index-qrp11tp9.js +4 -0
  165. package/dist/{index-t4n9z755.js → index-ryyrg0d8.js} +406 -317
  166. package/dist/{index-t17p395x.js → index-sf06w57a.js} +13 -13
  167. package/dist/{index-qxcfv8vq.js → index-vybnwd5v.js} +1 -1
  168. package/dist/{index-dm7c6hw5.js → index-wsf1f5pe.js} +27 -27
  169. package/dist/{keepalive-7eyb8y4t.js → keepalive-86z0tzzf.js} +3 -3
  170. package/dist/lead-edmwagkn.js +81 -0
  171. package/dist/{llama-cpp-classify-yvb8vh7w.js → llama-cpp-classify-wd7htn1x.js} +2 -2
  172. package/dist/{maintenance-tdrd8nwv.js → maintenance-19h6tfwz.js} +1 -1
  173. package/dist/{mistral-conversations-w4bncwbt.js → mistral-conversations-txjmc64f.js} +7 -7
  174. package/dist/{module-ES6BEMUI-6htewwha.js → module-ES6BEMUI-44w9s1dx.js} +4 -4
  175. package/dist/{multipart-parser-xevcstye.js → multipart-parser-xqbgwrav.js} +1 -1
  176. package/dist/{oauth-refresh-sweep-f4c7g37h.js → oauth-refresh-sweep-6nmyrv32.js} +2 -2
  177. package/dist/{object-webhooks-p190rdxp.js → object-webhooks-2kynmdf8.js} +7 -7
  178. package/dist/{onboard-56h4sks6.js → onboard-zbpm96mn.js} +5 -5
  179. package/dist/{openai-codex-responses-z2h941b8.js → openai-codex-responses-6ckhys6r.js} +31 -25
  180. package/dist/{openai-completions-5bxdkeg9.js → openai-completions-c9dsq9jh.js} +17 -17
  181. package/dist/{openai-decisions-fyq1p9f9.js → openai-decisions-9vzvv10c.js} +2 -2
  182. package/dist/{openai-responses-dzf3e8r5.js → openai-responses-bhfmt9sa.js} +9 -9
  183. package/dist/{opencode-adapter-xg3yxfr0.js → opencode-adapter-fyqcbdra.js} +5 -5
  184. package/dist/{openrouter-images-0jj12a2q.js → openrouter-images-hkk5p580.js} +3 -3
  185. package/dist/otel-impl-txa20w1h.js +11178 -0
  186. package/dist/{pending-xgv316w0.js → pending-4rxawq8y.js} +24 -24
  187. package/dist/{pi-messages-zk3g4esn.js → pi-messages-py3f96p7.js} +5 -5
  188. package/dist/{pi-mono-adapter-txe0syzb.js → pi-mono-adapter-rnsed1xa.js} +14 -14
  189. package/dist/{pricing-refresh-041zpyhf.js → pricing-refresh-4314hwtw.js} +2 -2
  190. package/dist/{rbac-roles-8f3jbcaf.js → rbac-roles-fztcm8ky.js} +2 -2
  191. package/dist/{rbac-roles-cw7rrw5b.js → rbac-roles-msqt7a3k.js} +3 -3
  192. package/dist/{render-v2-2ezw4mzt.js → render-v2-w49wtecg.js} +9 -9
  193. package/dist/{resume-p14wdx8m.js → resume-gwgtp4m3.js} +12 -12
  194. package/dist/{runtime-he7c9g1r.js → runtime-kkebz8yq.js} +1 -1
  195. package/dist/{session-access-8jvq86fj.js → session-access-kjb19m2w.js} +5 -5
  196. package/dist/{session-source-backfill-6fe3hcgb.js → session-source-backfill-805p4wqr.js} +2 -2
  197. package/dist/{setup-6v0bn4r1.js → setup-q8y168c8.js} +3 -3
  198. package/dist/thread-buffer-yqbffd0t.js +40 -0
  199. package/dist/{tree-visibility-g1a8ff4r.js → tree-visibility-qj323994.js} +2 -2
  200. package/dist/{typesafe-system-one-qkvkgrcz.js → typesafe-system-one-avrdb4zm.js} +2 -2
  201. package/dist/{user-merge-jobs-vjsps179.js → user-merge-jobs-qfp40f2s.js} +3 -3
  202. package/dist/{virtual-modules-mreda4fp.js → virtual-modules-nzxegw0a.js} +7 -7
  203. package/dist/{work-objects-hfw15e35.js → work-objects-hs089w60.js} +25 -25
  204. package/dist/{worker-follow-up-gbaz2ydz.js → worker-follow-up-zwgg20sr.js} +23 -23
  205. package/dist/worker-kg4g7rnx.js +81 -0
  206. package/openapi.json +3 -3
  207. package/package.json +25 -24
  208. package/plugin/commands/create-pr.md +5 -2
  209. package/plugin/pi-skills/create-pr/SKILL.md +5 -2
  210. package/src/apps/sync.ts +7 -2
  211. package/src/be/db/workflow-runs.ts +12 -8
  212. package/src/be/db.ts +4 -1
  213. package/src/be/migrations/367_workflow_run_principal.sql +5 -0
  214. package/src/be/swarm-config-guard.ts +3 -0
  215. package/src/be/task-auto-title-listener.ts +2 -2
  216. package/src/commands/onboard/agent-fs-version.ts +1 -1
  217. package/src/extensions/post-bridge.ts +27 -28
  218. package/src/http/active-sessions.ts +7 -0
  219. package/src/http/agents.ts +7 -0
  220. package/src/http/api-keys.ts +7 -0
  221. package/src/http/approval-requests.ts +4 -0
  222. package/src/http/budgets.ts +2 -0
  223. package/src/http/codex-oauth-keep-warm.ts +6 -2
  224. package/src/http/config.ts +1 -0
  225. package/src/http/context.ts +4 -0
  226. package/src/http/db-query.ts +3 -0
  227. package/src/http/events.ts +2 -0
  228. package/src/http/fs.ts +1 -0
  229. package/src/http/integrations.ts +4 -0
  230. package/src/http/mcp-bridge.ts +1 -0
  231. package/src/http/memory.ts +3 -0
  232. package/src/http/metrics.ts +16 -0
  233. package/src/http/oauth-locks.ts +8 -0
  234. package/src/http/page-proxy.ts +16 -0
  235. package/src/http/pages.ts +9 -0
  236. package/src/http/poll.ts +1 -0
  237. package/src/http/pricing.ts +2 -0
  238. package/src/http/prompt-templates.ts +34 -0
  239. package/src/http/schedules.ts +10 -0
  240. package/src/http/script-runs.ts +24 -0
  241. package/src/http/scripts.ts +1 -0
  242. package/src/http/session-data.ts +2 -0
  243. package/src/http/status.ts +1 -0
  244. package/src/http/tasks.ts +17 -0
  245. package/src/http/trackers/jira.ts +2 -0
  246. package/src/http/trackers/linear.ts +4 -0
  247. package/src/http/users.ts +18 -0
  248. package/src/http/webhooks.ts +12 -0
  249. package/src/http/workflow-events.ts +26 -6
  250. package/src/http/workflows.ts +40 -0
  251. package/src/http/x.ts +4 -0
  252. package/src/linear/app.ts +3 -2
  253. package/src/linear/client.ts +5 -1
  254. package/src/linear/host.ts +40 -0
  255. package/src/linear/oauth.ts +3 -2
  256. package/src/linear/sync.ts +4 -3
  257. package/src/otel-impl.ts +8 -5
  258. package/src/providers/amp-adapter.ts +1 -1
  259. package/src/rbac/legacy-policy.ts +2 -0
  260. package/src/rbac/permissions.ts +5 -0
  261. package/src/scripts-runtime/quickjs-compat.ts +44 -10
  262. package/src/slack/render-v2.ts +50 -23
  263. package/src/slack/reviewed-deliverables.ts +251 -0
  264. package/src/tests/check-pr-body.test.ts +408 -93
  265. package/src/tests/compose-dev-object-store.test.ts +13 -0
  266. package/src/tests/compose-example-object-store.test.ts +67 -0
  267. package/src/tests/db-query.test.ts +8 -4
  268. package/src/tests/e2b-dispatch.test.ts +7 -1
  269. package/src/tests/otel-event-loop-and-logs.test.ts +1 -1
  270. package/src/tests/quickjs-compat.test.ts +40 -4
  271. package/src/tests/rbac-route-verbs-e2e.test.ts +142 -0
  272. package/src/tests/script-connections.test.ts +2 -0
  273. package/src/tests/slack-render-v2.test.ts +52 -8
  274. package/src/tests/workflow-definition-pinning.test.ts +2 -0
  275. package/src/tests/workflow-hitl-routing.test.ts +67 -5
  276. package/src/tests/workflow-replay.test.ts +13 -1
  277. package/src/tests/x402-client.test.ts +82 -0
  278. package/src/tools/memory-rate.ts +2 -2
  279. package/src/tools/prompt-templates/delete.ts +22 -1
  280. package/src/tools/prompt-templates/set.ts +15 -1
  281. package/src/utils/constants.ts +5 -4
  282. package/src/utils/task-citations.ts +11 -0
  283. package/src/workflows/engine.ts +5 -0
  284. package/src/workflows/executors/sub-workflow.ts +5 -7
  285. package/src/workflows/executors/swarm-script.ts +4 -5
  286. package/src/workflows/resume.ts +21 -4
  287. package/src/workflows/run-principal.ts +51 -0
  288. package/src/x402/client.ts +38 -17
  289. package/templates/skills/code-quality/content.md +1 -1
  290. package/templates/skills/pages/content.md +36 -12
  291. package/templates/skills/swarm-docs/content.md +46 -41
  292. package/templates/skills/swarm-scripts/SKILL.md +1 -1
  293. package/templates/skills/swarm-scripts/content.md +1 -1
  294. package/dist/cli-547fsc36.js +0 -15
  295. package/dist/cli-dr6x9qdk.js +0 -15
  296. package/dist/cli-h5cveb69.js +0 -15
  297. package/dist/cli-jngvszex.js +0 -1514
  298. package/dist/cli-p0g0erm9.js +0 -15
  299. package/dist/cli-ph1jce1b.js +0 -16
  300. package/dist/cli-vxxdf2ma.js +0 -15
  301. package/dist/cli-x80zagf5.js +0 -15
  302. package/dist/core-8fw1gwg7.js +0 -41
  303. package/dist/getMachineId-bsd-2rd3pnz7.js +0 -36
  304. package/dist/getMachineId-bsd-3p48mkt1.js +0 -36
  305. package/dist/getMachineId-bsd-bk6tmeen.js +0 -36
  306. package/dist/getMachineId-bsd-pssqgwmm.js +0 -37
  307. package/dist/getMachineId-bsd-v218x3xd.js +0 -36
  308. package/dist/getMachineId-bsd-wbxcazef.js +0 -36
  309. package/dist/getMachineId-bsd-x0942pbz.js +0 -36
  310. package/dist/getMachineId-darwin-5qsy4qcg.js +0 -36
  311. package/dist/getMachineId-darwin-6v7zsshx.js +0 -37
  312. package/dist/getMachineId-darwin-fcc3fjag.js +0 -36
  313. package/dist/getMachineId-darwin-pg84hftj.js +0 -36
  314. package/dist/getMachineId-darwin-tyyevt26.js +0 -36
  315. package/dist/getMachineId-darwin-wagmbf0d.js +0 -36
  316. package/dist/getMachineId-darwin-zvkmwr3y.js +0 -36
  317. package/dist/getMachineId-linux-2ncg1epd.js +0 -29
  318. package/dist/getMachineId-linux-2tmt2ptc.js +0 -29
  319. package/dist/getMachineId-linux-empwyp2y.js +0 -29
  320. package/dist/getMachineId-linux-fanqd45b.js +0 -29
  321. package/dist/getMachineId-linux-h6fyga0x.js +0 -29
  322. package/dist/getMachineId-linux-tbhgz1k9.js +0 -29
  323. package/dist/getMachineId-linux-zrbyw7dt.js +0 -29
  324. package/dist/getMachineId-unsupported-29g9dkgv.js +0 -19
  325. package/dist/getMachineId-unsupported-8xfq8djv.js +0 -19
  326. package/dist/getMachineId-unsupported-8y9cag1p.js +0 -19
  327. package/dist/getMachineId-unsupported-a6sjrm02.js +0 -19
  328. package/dist/getMachineId-unsupported-bp3w7ds0.js +0 -19
  329. package/dist/getMachineId-unsupported-sj6fk8sw.js +0 -19
  330. package/dist/getMachineId-unsupported-v0p5gdxp.js +0 -19
  331. package/dist/getMachineId-win-hc996p0x.js +0 -38
  332. package/dist/getMachineId-win-msq9ad87.js +0 -38
  333. package/dist/getMachineId-win-tajyqwd6.js +0 -38
  334. package/dist/getMachineId-win-tzc163da.js +0 -38
  335. package/dist/getMachineId-win-xdaa0mgq.js +0 -38
  336. package/dist/getMachineId-win-xk6p98m5.js +0 -38
  337. package/dist/getMachineId-win-xtk658fm.js +0 -38
  338. package/dist/handlers-c1jp5b6h.js +0 -39
  339. package/dist/index-7dwh9kxh.js +0 -41
  340. package/dist/index-wp9tarbt.js +0 -43
  341. package/dist/index-z6np2405.js +0 -38
  342. package/dist/lead-50cgn8s1.js +0 -81
  343. package/dist/otel-impl-kepzgm4n.js +0 -55386
  344. package/dist/thread-buffer-8860v1ta.js +0 -40
  345. package/dist/worker-hkm8ftqp.js +0 -81
  346. /package/dist/{node-gbx1t3pa.js → node-q4628t0b.js} +0 -0
@@ -0,0 +1,81 @@
1
+ import"./cli-zrm0610v.js";
2
+ import"./cli-x5t54ytt.js";
3
+ import"./cli-jrxt5j0n.js";
4
+ import"./cli-svcy72s5.js";
5
+ import"./cli-0nvqg1hb.js";
6
+ import"./cli-2ja7eadd.js";
7
+ import"./cli-1t5vhrpv.js";
8
+ import"./cli-0rrft7s3.js";
9
+ import"./cli-ek8b88kv.js";
10
+ import"./cli-q58qt9dw.js";
11
+ import"./cli-cczffwak.js";
12
+ import"./cli-fdam1t9b.js";
13
+ import {
14
+ getEnabledCapabilities,
15
+ init_server
16
+ } from "./cli-d13qgcct.js";
17
+ import"./cli-y260hgep.js";
18
+ import"./cli-f3ta4e67.js";
19
+ import"./cli-c6vhcknq.js";
20
+ import"./cli-cgmka83w.js";
21
+ import"./cli-n15fhd43.js";
22
+ import {
23
+ runAgent
24
+ } from "./cli-0nz04gqv.js";
25
+ import"./cli-08gfvs58.js";
26
+ import"./cli-t1bqpzgz.js";
27
+ import"./cli-77cd6gy8.js";
28
+ import"./cli-8crn0510.js";
29
+ import"./cli-tbrjvrrg.js";
30
+ import"./cli-xd6ntv7x.js";
31
+ import"./cli-vs9h3vw2.js";
32
+ import"./cli-5188hq0a.js";
33
+ import"./cli-65k149j5.js";
34
+ import"./cli-nmj4phcg.js";
35
+ import"./cli-k9kfck3s.js";
36
+ import"./cli-g03x26q6.js";
37
+ import"./cli-zcb64xzv.js";
38
+ import"./cli-d82btycs.js";
39
+ import"./cli-0726awxw.js";
40
+ import"./cli-3ffzr65w.js";
41
+ import"./cli-fs9t2m2k.js";
42
+ import"./cli-w2fg8kjc.js";
43
+ import"./cli-ertcjw6z.js";
44
+ import"./cli-r7rpy2xz.js";
45
+ import"./cli-1zbj28py.js";
46
+ import"./cli-kr5tjjtz.js";
47
+ import"./cli-wz7qj1jy.js";
48
+ import"./cli-q44p4869.js";
49
+ import"./cli-h0edykd1.js";
50
+ import"./cli-f4xv7s0t.js";
51
+ import"./cli-9mvfvggt.js";
52
+ import"./cli-s90wcbk9.js";
53
+ import"./cli-h364asjc.js";
54
+ import"./cli-6zpn5hmp.js";
55
+ import"./cli-h96yp7xv.js";
56
+ import"./cli-dzhht0vq.js";
57
+ import"./cli-hab0bvrh.js";
58
+ import"./cli-gy0r7gb8.js";
59
+ import"./cli-e13kbyq0.js";
60
+ import"./cli-s48k2rzx.js";
61
+ import"./cli-an8bpy60.js";
62
+ import"./cli-ryn4y478.js";
63
+ import"./cli-h8k5801a.js";
64
+ import"./cli-3vc518cw.js";
65
+ import"./cli-9j1qcs0b.js";
66
+ import"./cli-praaw1wh.js";
67
+
68
+ // src/commands/worker.ts
69
+ init_server();
70
+ var workerConfig = {
71
+ role: "worker",
72
+ defaultPrompt: "/start-worker",
73
+ metadataType: "worker_metadata",
74
+ capabilities: getEnabledCapabilities()
75
+ };
76
+ async function runWorker(opts) {
77
+ return runAgent(workerConfig, opts);
78
+ }
79
+ export {
80
+ runWorker
81
+ };
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.14.1",
5
+ "version": "2.14.2",
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": [
@@ -74853,7 +74853,7 @@
74853
74853
  }
74854
74854
  },
74855
74855
  "403": {
74856
- "description": "Event name is reserved for provider webhooks",
74856
+ "description": "Event name is reserved for provider webhooks or server-emitted events",
74857
74857
  "content": {
74858
74858
  "application/json": {
74859
74859
  "schema": {
@@ -74946,7 +74946,7 @@
74946
74946
  }
74947
74947
  },
74948
74948
  "403": {
74949
- "description": "Event name is reserved for provider webhooks",
74949
+ "description": "Event name is reserved for provider webhooks or server-emitted events",
74950
74950
  "content": {
74951
74951
  "application/json": {
74952
74952
  "schema": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@desplega.ai/agent-swarm",
3
- "version": "2.14.1",
3
+ "version": "2.14.2",
4
4
  "description": "agent-swarm.dev — an open-source operating system for AI work: a lead agent breaks goals into tasks, routes them to specialized workers such as Claude Code or Codex, runs each worker in an isolated container, and preserves shared memory, tools, schedules, and review gates so delegated work compounds across sessions.",
5
5
  "keywords": [
6
6
  "agent-swarm.dev",
@@ -121,6 +121,7 @@
121
121
  "tsc:check": "bun check",
122
122
  "tsc:check:tsc": "bun tsc --noEmit",
123
123
  "check:db-boundary": "bash scripts/check-db-boundary.sh",
124
+ "check:agents-md-size": "bash scripts/check-agents-md-size.sh",
124
125
  "check:codex-default-model": "bash scripts/check-codex-default-model.sh",
125
126
  "check:test-spawn-sync": "bash scripts/check-test-spawn-sync.sh",
126
127
  "check:dep-graph": "depcruise src packages/model-routing --config .dependency-cruiser.cjs",
@@ -193,6 +194,7 @@
193
194
  "@oxlint/plugins": "1.93.0",
194
195
  "@types/bun": "latest",
195
196
  "dependency-cruiser": "^18.7.2",
197
+ "emulate": "0.14.0",
196
198
  "happy-dom": "^21.0.4",
197
199
  "konsistent": "1.0.0-beta.13",
198
200
  "openapi-typescript": "^7",
@@ -208,23 +210,23 @@
208
210
  },
209
211
  "dependencies": {
210
212
  "@agentclientprotocol/sdk": "2.8.0",
211
- "@ai-sdk/openai": "^3.0.141",
212
- "@anthropic-ai/claude-agent-sdk": "0.3.328",
213
- "@anthropic-ai/sdk": "^1.10.0",
213
+ "@ai-sdk/openai": "^3.0.142",
214
+ "@anthropic-ai/claude-agent-sdk": "0.3.329",
215
+ "@anthropic-ai/sdk": "^1.11.0",
214
216
  "@asteasolutions/zod-to-openapi": "^8.5.0",
215
- "@aws-sdk/client-bedrock": "3.1167.0",
216
- "@boxd-sh/sdk": "0.2.22",
217
+ "@aws-sdk/client-bedrock": "3.1168.0",
218
+ "@boxd-sh/sdk": "0.3.2",
217
219
  "@chat-adapter/discord": "4.45.0",
218
220
  "@chat-adapter/shared": "4.45.0",
219
221
  "@chat-adapter/slack": "4.45.0",
220
222
  "@chat-adapter/teams": "4.45.0",
221
223
  "@chat-adapter/telegram": "4.45.0",
222
224
  "@cursor/sdk": "1.4.2",
223
- "@desplega.ai/agent-fs-just-bash": "0.18.35",
225
+ "@desplega.ai/agent-fs-just-bash": "0.18.37",
224
226
  "@desplega.ai/business-use": "^0.4.3",
225
- "@earendil-works/pi-agent-core": "^1.5.2",
226
- "@earendil-works/pi-ai": "^1.5.2",
227
- "@earendil-works/pi-coding-agent": "^1.5.2",
227
+ "@earendil-works/pi-agent-core": "^1.6.0",
228
+ "@earendil-works/pi-ai": "^1.6.0",
229
+ "@earendil-works/pi-coding-agent": "^1.6.0",
228
230
  "@inkjs/ui": "^2.0.0",
229
231
  "@ironcalc/wasm": "0.9.1",
230
232
  "@jitl/quickjs-singlefile-mjs-release-sync": "0.32.0",
@@ -232,27 +234,26 @@
232
234
  "@json-render/core": "0.22.0",
233
235
  "@linear/sdk": "^77.0.0",
234
236
  "@modelcontextprotocol/sdk": "1.32.2",
235
- "@openai/codex": "0.170.0",
236
- "@openfort/openfort-node": "^0.9.3",
237
+ "@openai/codex": "0.171.0",
238
+ "@openfort/openfort-node": "^0.14.0",
237
239
  "@opentelemetry/api": "^1.10.0",
238
- "@opentelemetry/api-logs": "^0.218.0",
239
- "@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
240
- "@opentelemetry/exporter-trace-otlp-http": "^0.218.0",
241
- "@opentelemetry/resources": "^2.12.1",
242
- "@opentelemetry/sdk-metrics": "^2.12.1",
243
- "@opentelemetry/sdk-node": "^0.218.0",
240
+ "@opentelemetry/exporter-metrics-otlp-http": "^0.301.2",
241
+ "@opentelemetry/exporter-trace-otlp-http": "^0.301.2",
242
+ "@opentelemetry/resources": "^3.1.1",
243
+ "@opentelemetry/sdk-metrics": "^3.1.1",
244
+ "@opentelemetry/sdk-node": "^0.301.2",
244
245
  "@opentelemetry/semantic-conventions": "^1.45.0",
245
246
  "@slack/bolt": "^4.7.3",
246
247
  "@slack/web-api": "7.19.0",
247
248
  "@types/react": "^19.3.0",
248
- "@x402/core": "^2.5.0",
249
- "@x402/evm": "^2.5.0",
250
- "@x402/fetch": "^2.5.0",
251
- "ai": "^6.0.330",
249
+ "@x402/core": "^2.31.0",
250
+ "@x402/evm": "^2.31.0",
251
+ "@x402/fetch": "^2.31.0",
252
+ "ai": "^6.0.331",
252
253
  "chat": "4.45.0",
253
254
  "cron-parser": "^5.10.5",
254
255
  "date-fns": "^4.4.0",
255
- "e2b": "2.26.0",
256
+ "e2b": "2.63.0",
256
257
  "fractional-indexing": "4.0.0",
257
258
  "ink": "^6.8.0",
258
259
  "just-bash": "3.6.0",
@@ -264,7 +265,7 @@
264
265
  "sqlite-vec": "^0.1.9",
265
266
  "svix": "^1.99.1",
266
267
  "viem": "^2.57.19",
267
- "ws": "8.22.2",
268
+ "ws": "8.23.0",
268
269
  "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
269
270
  "y-protocols": "1.0.7",
270
271
  "yjs": "13.6.33",
@@ -28,10 +28,13 @@ You should be working in a repository cloned to `/workspace/personal/<repo-name>
28
28
  5. **Generate title and description.** Follow the conventions of the repository you are working in, not a fixed format:
29
29
  - **Title**: Concise summary (conventional commit style if the repo uses it)
30
30
  - **Description**: If the repo has a PR/MR template, use its headings as the structure and fill every section. GitHub looks for `pull_request_template.md` in `.github/`, `docs/`, or the repo root (plus an optional `PULL_REQUEST_TEMPLATE/` directory), and falls back to the org's `.github` repo. GitLab uses `.gitlab/merge_request_templates/`. Also follow any PR rules in the repo's `CLAUDE.md`, `AGENTS.md`, or `CONTRIBUTING.md`. If the repo defines none, include: summary of changes, notable items, testing done, related issues.
31
- - **Show the change, do not narrate it.** Aim for about 250 prose words; code blocks, mermaid, tables and `<details>` do not count. No file-by-file changelog: that belongs in your task output.
31
+ - **Show the change, do not narrate it.** Aim for about 150 prose words; code blocks, mermaid, tables and `<details>` do not count. No file-by-file changelog: that belongs in your task output.
32
+ - **Why**: one sentence, 25 words or fewer (the check fails above 40). Say who sees what after the merge, not how it works.
33
+ - **Before / after**: the smallest view of what a user, an agent or an operator sees change. A `diff` block with the old and new lines for an API result, CLI output, a log line or prompt text. A table for a default or a number. Slack mock frames. A screenshot pair for UI. For an internal change, write the line `No visible change: <reason>`.
34
+ - **Known risks and skipped work** go in the template's heads-up section. Do not add text after the last section, and do not add a `Skipped/risk:` paragraph.
32
35
  - **Review map**: build it from `git diff --stat <base>...HEAD`. One row per area, biggest risk first, with `(+N/-M)`, a depth (🔍 deep, 👀 skim, ⏭ skip for tests and generated files) and what could break.
33
36
  - **Change outline**: 1 or 2 views of the shape of the change. Pseudocode with `+`/`-` lines for logic, mermaid for flow, a tree with paths on the nodes for structure.
34
- - **Swarm provenance** (when you run in the swarm): fill it from your task context. Link the task (`$APP_URL/tasks/<taskId>`) and its tree (`$APP_URL/sessions/<rootTaskId>`), the Slack permalink of the ask if the task came from Slack, any workflow run, and the plan or research as its agent-fs live app link (`${AGENT_FS_LIVE_URL}/file/~/<org>/<drive>/<path>`). These auth-gated links go in this section only.
37
+ - **Swarm provenance** (when you run in the swarm): fill it from your task context, as a list of Markdown links and nothing else. Link the task (`[Task]($APP_URL/tasks/<taskId>)`) and its tree (`[tree]($APP_URL/sessions/<rootTaskId>)`), the Slack permalink of the ask if the task came from Slack (`[Ask](<permalink>)`), any workflow run, and the plan or research as its agent-fs live app link (`${AGENT_FS_LIVE_URL}/file/~/<org>/<drive>/<path>`). Always link the task: this section is the one place where these auth-gated links are allowed, so do not withhold them. A bare URL fails the PR Body check.
35
38
  - **Media**: images and mp4s as GitHub user attachments (`github-attach` skill), docs as the agent-fs live app link under Swarm provenance (an `agent-fs share-create` link only when the requester asks for one or a reader has no agent-fs login). Never a presigned agent-fs URL for docs or videos.
36
39
  6. **Create the PR/MR** using `gh pr create` or `glab mr create`. `gh pr create --body` does not apply the repo template, so write the filled description to a file and pass it with `--body-file <file>`.
37
40
  7. **Check CI status** — After creating the PR, wait ~30 seconds, then check CI with `gh pr checks <pr-number>` (GitHub) or `glab mr view --json pipelines` (GitLab). If any check is failing, investigate the failure, fix it, push the fix, and re-check. Repeat until CI is green.
@@ -28,10 +28,13 @@ You should be working in a repository cloned to `/workspace/personal/<repo-name>
28
28
  5. **Generate title and description.** Follow the conventions of the repository you are working in, not a fixed format:
29
29
  - **Title**: Concise summary (conventional commit style if the repo uses it)
30
30
  - **Description**: If the repo has a PR/MR template, use its headings as the structure and fill every section. GitHub looks for `pull_request_template.md` in `.github/`, `docs/`, or the repo root (plus an optional `PULL_REQUEST_TEMPLATE/` directory), and falls back to the org's `.github` repo. GitLab uses `.gitlab/merge_request_templates/`. Also follow any PR rules in the repo's `CLAUDE.md`, `AGENTS.md`, or `CONTRIBUTING.md`. If the repo defines none, include: summary of changes, notable items, testing done, related issues.
31
- - **Show the change, do not narrate it.** Aim for about 250 prose words; code blocks, mermaid, tables and `<details>` do not count. No file-by-file changelog: that belongs in your task output.
31
+ - **Show the change, do not narrate it.** Aim for about 150 prose words; code blocks, mermaid, tables and `<details>` do not count. No file-by-file changelog: that belongs in your task output.
32
+ - **Why**: one sentence, 25 words or fewer (the check fails above 40). Say who sees what after the merge, not how it works.
33
+ - **Before / after**: the smallest view of what a user, an agent or an operator sees change. A `diff` block with the old and new lines for an API result, CLI output, a log line or prompt text. A table for a default or a number. Slack mock frames. A screenshot pair for UI. For an internal change, write the line `No visible change: <reason>`.
34
+ - **Known risks and skipped work** go in the template's heads-up section. Do not add text after the last section, and do not add a `Skipped/risk:` paragraph.
32
35
  - **Review map**: build it from `git diff --stat <base>...HEAD`. One row per area, biggest risk first, with `(+N/-M)`, a depth (🔍 deep, 👀 skim, ⏭ skip for tests and generated files) and what could break.
33
36
  - **Change outline**: 1 or 2 views of the shape of the change. Pseudocode with `+`/`-` lines for logic, mermaid for flow, a tree with paths on the nodes for structure.
34
- - **Swarm provenance** (when you run in the swarm): fill it from your task context. Link the task (`$APP_URL/tasks/<taskId>`) and its tree (`$APP_URL/sessions/<rootTaskId>`), the Slack permalink of the ask if the task came from Slack, any workflow run, and the plan or research as its agent-fs live app link (`${AGENT_FS_LIVE_URL}/file/~/<org>/<drive>/<path>`). These auth-gated links go in this section only.
37
+ - **Swarm provenance** (when you run in the swarm): fill it from your task context, as a list of Markdown links and nothing else. Link the task (`[Task]($APP_URL/tasks/<taskId>)`) and its tree (`[tree]($APP_URL/sessions/<rootTaskId>)`), the Slack permalink of the ask if the task came from Slack (`[Ask](<permalink>)`), any workflow run, and the plan or research as its agent-fs live app link (`${AGENT_FS_LIVE_URL}/file/~/<org>/<drive>/<path>`). Always link the task: this section is the one place where these auth-gated links are allowed, so do not withhold them. A bare URL fails the PR Body check.
35
38
  - **Media**: images and mp4s as GitHub user attachments (`github-attach` skill), docs as the agent-fs live app link under Swarm provenance (an `agent-fs share-create` link only when the requester asks for one or a reader has no agent-fs login). Never a presigned agent-fs URL for docs or videos.
36
39
  6. **Create the PR/MR** using `gh pr create` or `glab mr create`. `gh pr create --body` does not apply the repo template, so write the filled description to a file and pass it with `--body-file <file>`.
37
40
  7. **Check CI status** — After creating the PR, wait ~30 seconds, then check CI with `gh pr checks <pr-number>` (GitHub) or `glab mr view --json pipelines` (GitLab). If any check is failing, investigate the failure, fix it, push the fix, and re-check. Repeat until CI is green.
package/src/apps/sync.ts CHANGED
@@ -4,7 +4,7 @@ import { listScriptConnections } from "../be/script-connections";
4
4
  import { getScriptById } from "../be/scripts/db";
5
5
  import { runSavedScriptAsAgent } from "../be/scripts/run-saved";
6
6
  import { type AgentTask, AgentTaskStatusSchema } from "../types";
7
- import { scrubObject, scrubSecrets } from "../utils/secret-scrubber";
7
+ import { createSweepScrubber, scrubObject, scrubSecrets } from "../utils/secret-scrubber";
8
8
  import {
9
9
  type AppDefinition,
10
10
  type AppValidationIssue,
@@ -853,7 +853,9 @@ async function executePass(args: {
853
853
  // Pull OUTSIDE the lock; reconcile inside it. Pulled values persist into
854
854
  // rows any app.use principal can later read, so secrets are redacted here
855
855
  // at the persistence boundary — the finish() scrub only covers the pass
856
- // summary, never pull.records.
856
+ // summary, never pull.records. The sweep scrubber skips rules a clean text
857
+ // cannot trigger: the default one re-reads the env per string and blocks
858
+ // the event loop for tens of ms on a few hundred rows.
857
859
  const pull = scrubObject(
858
860
  source.connector === "script"
859
861
  ? await pullFromScript({
@@ -863,6 +865,9 @@ async function executePass(args: {
863
865
  source,
864
866
  })
865
867
  : await pullFromSwarmTasks(source, args.invokedBy),
868
+ undefined,
869
+ undefined,
870
+ createSweepScrubber(),
866
871
  );
867
872
  pulled = pull.records.length;
868
873
  for (const warning of pull.warnings) warn(warnings, warning);
@@ -135,16 +135,20 @@ const WORKFLOW_RUN_STEP_SLIM_COLUMNS =
135
135
  * nor parsed.
136
136
  */
137
137
  /**
138
- * The agent a run's creator-less `swarm-script` nodes act as: the agent the
139
- * server stamped when the run started (migration 247), or null for a run with
140
- * no starting agent (webhook, event, a run from before the migration).
138
+ * The principal decided when the run pinned its definition (migration 367, a
139
+ * JSON `WorkflowRunPrincipal`), plus the agent the server stamped when the run
140
+ * started (migration 247; null for webhook, event and older runs). Null
141
+ * `principal` means a run from before migration 367.
141
142
  */
142
- export async function getWorkflowRunTriggeredByAgentId(runId: string): Promise<string | null> {
143
- const row = await getDbClient().get<{ triggeredByAgentId: string | null }>(
144
- "SELECT triggeredByAgentId FROM workflow_runs WHERE id = ?",
145
- [runId],
143
+ export async function getWorkflowRunPrincipalRow(
144
+ runId: string,
145
+ ): Promise<{ principal: string | null; triggeredByAgentId: string | null } | null> {
146
+ return (
147
+ (await getDbClient().get<{ principal: string | null; triggeredByAgentId: string | null }>(
148
+ "SELECT principal, triggeredByAgentId FROM workflow_runs WHERE id = ?",
149
+ [runId],
150
+ )) ?? null
146
151
  );
147
- return row?.triggeredByAgentId ?? null;
148
152
  }
149
153
 
150
154
  export async function getWorkflowRunSummary(id: string): Promise<WorkflowRunSummary | null> {
package/src/be/db.ts CHANGED
@@ -7947,10 +7947,12 @@ export async function createWorkflowRun(data: {
7947
7947
  triggeredByAgentId?: string;
7948
7948
  /** The `workflow_run_definitions` row the run is pinned to (migration 283). */
7949
7949
  definitionHash?: string;
7950
+ /** JSON `WorkflowRunPrincipal` decided from the pinned definition (migration 367). */
7951
+ principal?: string;
7950
7952
  }): Promise<WorkflowRun> {
7951
7953
  const now = new Date().toISOString();
7952
7954
  const row = await getDbClient().get<WorkflowRunRow>(
7953
- `INSERT INTO workflow_runs (id, workflowId, triggerType, startedAt, triggerData, created_by, parentStepId, parentStepAttempt, triggeredByAgentId, definitionHash, sourceStepId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`,
7955
+ `INSERT INTO workflow_runs (id, workflowId, triggerType, startedAt, triggerData, created_by, parentStepId, parentStepAttempt, triggeredByAgentId, definitionHash, sourceStepId, principal) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`,
7954
7956
  [
7955
7957
  data.id,
7956
7958
  data.workflowId,
@@ -7970,6 +7972,7 @@ export async function createWorkflowRun(data: {
7970
7972
  (data.triggerType !== "api" && (data.triggerType ?? "manual") !== "manual")
7971
7973
  ? null
7972
7974
  : (getCurrentRunProvenance()?.sourceStepId ?? null),
7975
+ data.principal ?? null,
7973
7976
  ],
7974
7977
  );
7975
7978
  if (!row) throw new Error("Failed to create workflow run");
@@ -0,0 +1,5 @@
1
+ -- The agent a run's swarm-script and sub-workflow nodes act as, decided once
2
+ -- from the definition the run pins (JSON of `WorkflowRunPrincipal`). An edit
3
+ -- or re-save of the live workflow after the run started cannot change it.
4
+ -- Runs created before this migration keep NULL and decide from the live row.
5
+ ALTER TABLE workflow_runs ADD COLUMN principal TEXT;
@@ -82,6 +82,9 @@ const RESERVED_KEYS = new Set([
82
82
  // tokens, so only the deployment env may redirect it.
83
83
  "GITHUB_URL",
84
84
  "GITHUB_API_URL",
85
+ // Linear host (E2E emulator): the API base receives the OAuth client secret and tokens.
86
+ "LINEAR_URL",
87
+ "LINEAR_API_URL",
85
88
  // Picks which App installation workers get tokens for; a config writer must not choose it.
86
89
  "GITHUB_APP_INSTALLATION_ID",
87
90
  // Owners whose repos get a token for their own installation; same reason.
@@ -12,7 +12,7 @@
12
12
  */
13
13
 
14
14
  import { getApiKey } from "../utils/api-key";
15
- import { getMcpBaseUrl } from "../utils/constants";
15
+ import { getScriptApiBaseUrl } from "../utils/constants";
16
16
  import { parseEnvFlag } from "../utils/env-flag";
17
17
  import { generateTaskTitle, TASK_TITLE_TIMEOUT_MS } from "../utils/internal-ai/task-title";
18
18
  import { scrubSecrets } from "../utils/secret-scrubber";
@@ -103,7 +103,7 @@ async function titleTask(
103
103
  task: task.task,
104
104
  env,
105
105
  // Loopback context for the codex OAuth probe; only used when no API key is set.
106
- apiUrl: getMcpBaseUrl(),
106
+ apiUrl: getScriptApiBaseUrl(),
107
107
  apiKey: getApiKey(),
108
108
  callerTag: `task-title:${task.source}`,
109
109
  signal: AbortSignal.timeout(TASK_TITLE_TIMEOUT_MS),
@@ -2,4 +2,4 @@
2
2
  * agent-fs image tag bundled by `agent-swarm onboard --yes`.
3
3
  * `bun run bump:agent-fs` rewrites it together with the other pins.
4
4
  */
5
- export const AGENT_FS_VERSION = "0.18.35";
5
+ export const AGENT_FS_VERSION = "0.18.37";
@@ -360,42 +360,41 @@ const onVcsEvent = (name: string, data: unknown): void => {
360
360
  });
361
361
  };
362
362
 
363
+ // Every bus name the bridge forwards to extension handlers. Handlers trust these payloads,
364
+ // so only server code may emit them (the workflow-events API refuses them).
365
+ const BRIDGED_EVENTS: ReadonlyArray<readonly [string, (data: unknown) => void]> = [
366
+ ["task.created", onTaskCreated],
367
+ ["task.create_blocked", onTaskBlocked],
368
+ ["task.completed", onTaskCompleted],
369
+ ["task.failed", onTaskFailed],
370
+ ["task.cancelled", onTaskCancelled],
371
+ ["task.superseded", onTaskSuperseded],
372
+ ["task.progress", onTaskProgress],
373
+ ["slack.message", onSlackMessage],
374
+ ["approval.resolved", onApprovalResolved],
375
+ ["task.budget_refused", onTaskBudgetRefused],
376
+ ["agentmail.message.received", onEmailReceived],
377
+ ["kapso.message.received", onKapsoMessage],
378
+ ["chat.message.received", onChatMessageReceived],
379
+ ["chat.message.sent", onChatMessageSent],
380
+ ];
381
+ const BRIDGED_EVENT_NAMES: ReadonlySet<string> = new Set(BRIDGED_EVENTS.map(([name]) => name));
382
+
383
+ /** True for a bus name the extension post-bridge forwards: server-emitted only. */
384
+ export function isExtensionBridgedEvent(name: string): boolean {
385
+ return BRIDGED_EVENT_NAMES.has(name) || VCS_PREFIXES.some((prefix) => name.startsWith(prefix));
386
+ }
387
+
363
388
  export function initExtensionPostBridge(): void {
364
389
  if (subscribed) return;
365
390
  subscribed = true;
366
- workflowEventBus.on("task.created", onTaskCreated);
367
- workflowEventBus.on("task.create_blocked", onTaskBlocked);
368
- workflowEventBus.on("task.completed", onTaskCompleted);
369
- workflowEventBus.on("task.failed", onTaskFailed);
370
- workflowEventBus.on("task.cancelled", onTaskCancelled);
371
- workflowEventBus.on("task.superseded", onTaskSuperseded);
372
- workflowEventBus.on("task.progress", onTaskProgress);
373
- workflowEventBus.on("slack.message", onSlackMessage);
374
- workflowEventBus.on("approval.resolved", onApprovalResolved);
375
- workflowEventBus.on("task.budget_refused", onTaskBudgetRefused);
376
- workflowEventBus.on("agentmail.message.received", onEmailReceived);
377
- workflowEventBus.on("kapso.message.received", onKapsoMessage);
378
- workflowEventBus.on("chat.message.received", onChatMessageReceived);
379
- workflowEventBus.on("chat.message.sent", onChatMessageSent);
391
+ for (const [name, handler] of BRIDGED_EVENTS) workflowEventBus.on(name, handler);
380
392
  for (const prefix of VCS_PREFIXES) workflowEventBus.onPrefix(prefix, onVcsEvent);
381
393
  }
382
394
 
383
395
  export function teardownExtensionPostBridge(): void {
384
396
  if (!subscribed) return;
385
397
  subscribed = false;
386
- workflowEventBus.off("task.created", onTaskCreated);
387
- workflowEventBus.off("task.create_blocked", onTaskBlocked);
388
- workflowEventBus.off("task.completed", onTaskCompleted);
389
- workflowEventBus.off("task.failed", onTaskFailed);
390
- workflowEventBus.off("task.cancelled", onTaskCancelled);
391
- workflowEventBus.off("task.superseded", onTaskSuperseded);
392
- workflowEventBus.off("task.progress", onTaskProgress);
393
- workflowEventBus.off("slack.message", onSlackMessage);
394
- workflowEventBus.off("approval.resolved", onApprovalResolved);
395
- workflowEventBus.off("task.budget_refused", onTaskBudgetRefused);
396
- workflowEventBus.off("agentmail.message.received", onEmailReceived);
397
- workflowEventBus.off("kapso.message.received", onKapsoMessage);
398
- workflowEventBus.off("chat.message.received", onChatMessageReceived);
399
- workflowEventBus.off("chat.message.sent", onChatMessageSent);
398
+ for (const [name, handler] of BRIDGED_EVENTS) workflowEventBus.off(name, handler);
400
399
  for (const prefix of VCS_PREFIXES) workflowEventBus.offPrefix(prefix, onVcsEvent);
401
400
  }
@@ -56,6 +56,7 @@ const createActiveSession = route({
56
56
  201: { description: "Session created", schema: z.object({ session: ActiveSessionSchema }) },
57
57
  400: { description: "Validation error" },
58
58
  },
59
+ rbac: { ungated: "worker runner bookkeeping for its own active session; no user flow writes it" },
59
60
  });
60
61
 
61
62
  const deleteSessionByTask = route({
@@ -69,6 +70,7 @@ const deleteSessionByTask = route({
69
70
  responses: {
70
71
  200: { description: "Session deleted", schema: z.object({ deleted: z.boolean() }) },
71
72
  },
73
+ rbac: { ungated: "worker runner bookkeeping for its own active session; no user flow writes it" },
72
74
  });
73
75
 
74
76
  const deleteSessionById = route({
@@ -82,6 +84,7 @@ const deleteSessionById = route({
82
84
  responses: {
83
85
  200: { description: "Session deleted", schema: z.object({ deleted: z.boolean() }) },
84
86
  },
87
+ rbac: { ungated: "worker runner bookkeeping for its own active session; no user flow writes it" },
85
88
  });
86
89
 
87
90
  const heartbeatSession = route({
@@ -95,6 +98,7 @@ const heartbeatSession = route({
95
98
  responses: {
96
99
  200: { description: "Heartbeat updated", schema: z.object({ updated: z.boolean() }) },
97
100
  },
101
+ rbac: { ungated: "worker runner bookkeeping for its own active session; no user flow writes it" },
98
102
  });
99
103
 
100
104
  const updateProviderSession = route({
@@ -109,6 +113,7 @@ const updateProviderSession = route({
109
113
  responses: {
110
114
  200: { description: "Provider session ID updated", schema: z.object({ updated: z.boolean() }) },
111
115
  },
116
+ rbac: { ungated: "worker runner bookkeeping for its own active session; no user flow writes it" },
112
117
  });
113
118
 
114
119
  const cleanupSessions = route({
@@ -127,6 +132,7 @@ const cleanupSessions = route({
127
132
  responses: {
128
133
  200: { description: "Cleanup result", schema: z.object({ cleaned: z.number().int() }) },
129
134
  },
135
+ rbac: { ungated: "worker runner bookkeeping for its own active session; no user flow writes it" },
130
136
  });
131
137
 
132
138
  const recoverOrphanedTasks = route({
@@ -147,6 +153,7 @@ const recoverOrphanedTasks = route({
147
153
  },
148
154
  403: { description: "Can only recover orphaned tasks for the calling agent" },
149
155
  },
156
+ rbac: { ungated: "worker runner bookkeeping for its own active session; no user flow writes it" },
150
157
  });
151
158
 
152
159
  // ─── Handler ─────────────────────────────────────────────────────────────────
@@ -200,6 +200,7 @@ const registerAgent = route({
200
200
  description: "An operator deleted this agent id (`agent_deleted`); the worker must stop",
201
201
  },
202
202
  },
203
+ rbac: { ungated: "worker self-registration at boot; no user flow calls it" },
203
204
  });
204
205
 
205
206
  const setAgentHarnessProviderRoute = route({
@@ -219,6 +220,7 @@ const setAgentHarnessProviderRoute = route({
219
220
  400: { description: "Validation error (unknown provider)" },
220
221
  404: { description: "Agent not found" },
221
222
  },
223
+ rbac: { permission: "config.write.any" },
222
224
  });
223
225
 
224
226
  const LocalHarnessProviderSchema = z.enum([
@@ -316,6 +318,7 @@ const updateAgentRuntimeRoute = route({
316
318
  400: { description: "Validation error, or `{ error, check }` when the profile check fails" },
317
319
  404: { description: "Agent not found" },
318
320
  },
321
+ rbac: { permission: "config.write.any" },
319
322
  });
320
323
 
321
324
  class ClaudeTransportConflictError extends Error {}
@@ -460,6 +463,7 @@ const updateAgentNameRoute = route({
460
463
  404: { description: "Agent not found" },
461
464
  409: { description: "Name conflict" },
462
465
  },
466
+ rbac: { permission: "agent.profile.update.any" },
463
467
  });
464
468
 
465
469
  const getAgentSetupScript = route({
@@ -584,6 +588,7 @@ const updateAgentProfileRoute = route({
584
588
  },
585
589
  404: { description: "Agent not found, or changedByAgentId names no agent" },
586
590
  },
591
+ rbac: { permission: "agent.profile.update.any" },
587
592
  });
588
593
 
589
594
  const updateAgentActivityRoute = route({
@@ -596,6 +601,7 @@ const updateAgentActivityRoute = route({
596
601
  responses: {
597
602
  204: { description: "Activity updated" },
598
603
  },
604
+ rbac: { ungated: "worker telemetry ingest; no user flow writes it" },
599
605
  });
600
606
 
601
607
  const getAgent = route({
@@ -653,6 +659,7 @@ const updateAgentCredentialStatusRoute = route({
653
659
  400: { description: "Missing X-Runtime-Instance-ID in multi-runtime mode" },
654
660
  404: { description: "Agent not found" },
655
661
  },
662
+ rbac: { ungated: "worker telemetry ingest; no user flow writes it" },
656
663
  });
657
664
 
658
665
  const getAgentCredentialStatusRoute = route({
@@ -88,6 +88,7 @@ const reportUsage = route({
88
88
  401: { description: "Unauthorized" },
89
89
  },
90
90
  auth: { apiKey: true },
91
+ rbac: { ungated: "worker credential-pool bookkeeping; no user flow calls it" },
91
92
  });
92
93
 
93
94
  /** A provider spend limit behind a key's rate limit (`SpendCap`). */
@@ -119,6 +120,7 @@ const reportRateLimit = route({
119
120
  401: { description: "Unauthorized" },
120
121
  },
121
122
  auth: { apiKey: true },
123
+ rbac: { ungated: "worker credential-pool bookkeeping; no user flow calls it" },
122
124
  });
123
125
 
124
126
  const reportValidation = route({
@@ -652,6 +654,10 @@ const setKeyName = route({
652
654
  404: { description: "Key not found" },
653
655
  },
654
656
  auth: { apiKey: true },
657
+ rbac: {
658
+ ungated:
659
+ "credential display metadata on a pooled key; no verb covers it, so user roles need admin",
660
+ },
655
661
  });
656
662
 
657
663
  const clearRateLimitRoute = route({
@@ -688,6 +694,7 @@ const clearRateLimitRoute = route({
688
694
  401: { description: "Unauthorized" },
689
695
  },
690
696
  auth: { apiKey: true },
697
+ rbac: { ungated: "worker credential-pool bookkeeping; no user flow calls it" },
691
698
  });
692
699
 
693
700
  const listPlans = route({
@@ -422,6 +422,10 @@ const createRoute = route({
422
422
  403: { description: "Slack notifications require a lead agent" },
423
423
  },
424
424
  auth: { apiKey: true },
425
+ rbac: {
426
+ ungated:
427
+ "agents raise approval requests for their task (session posture checks it); the Slack-notification branch gates integration.slack.post in the handler",
428
+ },
425
429
  });
426
430
 
427
431
  const getByIdRoute = route({
@@ -101,6 +101,7 @@ const upsertBudgetRoute = route({
101
101
  200: { description: "Budget upserted", schema: BudgetSchema },
102
102
  400: { description: "Validation error" },
103
103
  },
104
+ rbac: { ungated: "spend controls: no verb covers them, so user roles need admin" },
104
105
  });
105
106
 
106
107
  const deleteBudgetRoute = route({
@@ -114,6 +115,7 @@ const deleteBudgetRoute = route({
114
115
  204: { description: "Budget deleted" },
115
116
  404: { description: "Budget not configured" },
116
117
  },
118
+ rbac: { ungated: "spend controls: no verb covers them, so user roles need admin" },
117
119
  });
118
120
 
119
121
  // ─── Handler ─────────────────────────────────────────────────────────────────