@desplega.ai/agent-swarm 1.142.0 → 1.144.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 (224) hide show
  1. package/README.md +31 -231
  2. package/dist/{acp-adapter-6jn4n9bf.js → acp-adapter-0dw2v7kq.js} +146 -15
  3. package/dist/{actions-1x7qhjcp.js → actions-350q9mh6.js} +9 -8
  4. package/dist/{app-1gqhr0zw.js → app-4g0cf217.js} +6 -5
  5. package/dist/{artifact-wpy087er.js → artifact-rnec9nky.js} +1 -1
  6. package/dist/{assistant-ywk5t26k.js → assistant-ersny349.js} +17 -14
  7. package/dist/{boot-reembed-vvgj1fgk.js → boot-reembed-afgn503c.js} +6 -5
  8. package/dist/{boot-reembed-45rvpb3m.js → boot-reembed-gtk0rbbp.js} +7 -6
  9. package/dist/{boot-scrub-logs-k83hm16a.js → boot-scrub-logs-1pssayj0.js} +4 -3
  10. package/dist/{claude-adapter-gcxv09ga.js → claude-adapter-k1w59vhy.js} +23 -12
  11. package/dist/claude-sdk-session-x11xj32v.js +39101 -0
  12. package/dist/{cli-0afy4jqg.js → cli-0ytt7kxe.js} +17 -11
  13. package/dist/{cli-spx3gtdd.js → cli-11w93bcy.js} +2 -2
  14. package/dist/{cli-6kgqmh9y.js → cli-27fb8y23.js} +8 -446
  15. package/dist/cli-2bd58qrz.js +32 -0
  16. package/dist/{cli-ppwm8c6e.js → cli-2daksqps.js} +4 -1
  17. package/dist/{cli-mez7x2z0.js → cli-5am2621e.js} +1 -1
  18. package/dist/cli-5fqjxazz.js +34 -0
  19. package/dist/{cli-48akq54x.js → cli-5xypxegf.js} +1 -1
  20. package/dist/{cli-er2z53kh.js → cli-5y9wtqjk.js} +276 -197
  21. package/dist/{cli-2ed3wv25.js → cli-65qk0zn3.js} +1 -1
  22. package/dist/{cli-vqxttjd7.js → cli-751cnwe0.js} +38 -3
  23. package/dist/{cli-pw4gxcx1.js → cli-800qgp57.js} +2 -2
  24. package/dist/{cli-bc101wmn.js → cli-82cqq2qr.js} +3 -3
  25. package/dist/{cli-rsa49w51.js → cli-9dfnhrte.js} +1 -1
  26. package/dist/{cli-thdvmrm6.js → cli-9ftxmrrg.js} +12 -9
  27. package/dist/{cli-s0w91tq3.js → cli-a4z7ggz9.js} +1172 -262
  28. package/dist/{cli-6spqz3tg.js → cli-aw92bgtv.js} +1 -1
  29. package/dist/{cli-dr5tcz68.js → cli-b4g3p5y2.js} +1 -1
  30. package/dist/{cli-tbtxpj2k.js → cli-bmf7j6v3.js} +7737 -1074
  31. package/dist/{cli-z6wjvew7.js → cli-cs446s3a.js} +2 -2
  32. package/dist/{cli-a6297e83.js → cli-ddp558gj.js} +186 -16
  33. package/dist/{cli-kfrk073c.js → cli-e5ryp8dw.js} +1 -1
  34. package/dist/cli-eree7rnv.js +25 -0
  35. package/dist/{cli-pt7gxw9n.js → cli-etfz8tjx.js} +214 -85
  36. package/dist/{cli-qntkxysp.js → cli-g5rnamvz.js} +208 -164
  37. package/dist/{cli-z0f80e8e.js → cli-k3xswc9f.js} +2 -2
  38. package/dist/{cli-9w49enmh.js → cli-khy0m2ct.js} +8 -2
  39. package/dist/{cli-vp3sksy6.js → cli-kw28xkeg.js} +1 -1
  40. package/dist/{cli-dxt17ymm.js → cli-qxjqd6sg.js} +2 -2
  41. package/dist/{cli-d2epf5ae.js → cli-r3bxcgrj.js} +1 -1
  42. package/dist/{cli-jt7k9yw5.js → cli-smzfvrpm.js} +3 -3
  43. package/dist/{cli-vf5b436q.js → cli-vkp8s27y.js} +10 -3
  44. package/dist/{cli-qmsts4ef.js → cli-vn5w0k4r.js} +940 -610
  45. package/dist/{cli-s84fa8td.js → cli-w4700fz9.js} +5 -5
  46. package/dist/{cli-vqk6rxns.js → cli-wexgbpxj.js} +1 -1
  47. package/dist/{cli-myfb8t15.js → cli-y3tqrvv0.js} +2 -2
  48. package/dist/{cli-6t2fgxpv.js → cli-yhbft4g1.js} +1 -1
  49. package/dist/{cli-8bg3den1.js → cli-ym36dztg.js} +2 -2
  50. package/dist/{cli-s9gpxh9q.js → cli-yptav794.js} +3 -3
  51. package/dist/{cli-15atwe0d.js → cli-z082j4kh.js} +2 -2
  52. package/dist/cli.js +25 -18
  53. package/dist/{codex-adapter-xvgkg755.js → codex-adapter-e2t65b18.js} +6 -5
  54. package/dist/{codex-hook-7eb9d1d5.js → codex-hook-79p3xs7j.js} +2 -0
  55. package/dist/{codex-session-runner-1d1ercsj.js → codex-session-runner-hscf2760.js} +54 -27
  56. package/dist/{commands-k6hhe7ne.js → commands-s38sr2rt.js} +4 -3
  57. package/dist/{db-w2qb9rss.js → db-w2wntm52.js} +16 -3
  58. package/dist/{devtools-j2rnj8w7.js → devtools-qef378vk.js} +2 -2
  59. package/dist/{e2b-b7jt70fc.js → e2b-ngbf1m6j.js} +2 -2
  60. package/dist/{event-bus-n8sb35pw.js → event-bus-wbffpzrw.js} +2 -1
  61. package/dist/{google-generative-ai-gzb1jgd4.js → google-generative-ai-jmcxpk8k.js} +3 -3
  62. package/dist/{google-vertex-k21hxh4n.js → google-vertex-8zv3yfbk.js} +3 -3
  63. package/dist/{handlers-v52he40q.js → handlers-zw49kzdw.js} +22 -22
  64. package/dist/{hook-dq02k126.js → hook-fp4a43qn.js} +5 -5
  65. package/dist/{hook-tyqkv069.js → hook-r54qmqn8.js} +6 -6
  66. package/dist/{http-x6fy2qbf.js → http-3g1vmy67.js} +1187 -386
  67. package/dist/{index-jmrvpb83.js → index-c9fvw8jf.js} +579 -19
  68. package/dist/{index-wdmwar6v.js → index-cj0tge35.js} +16 -15
  69. package/dist/{index-82913rbj.js → index-p8xn6jzt.js} +17 -16
  70. package/dist/{index-1b2phtyf.js → index-sbr2324q.js} +18 -17
  71. package/dist/{keepalive-5axh79td.js → keepalive-7340z3gx.js} +6 -5
  72. package/dist/{lead-7p1rnqt5.js → lead-j0gc233w.js} +35 -33
  73. package/dist/{maintenance-mkkk6xtc.js → maintenance-e86c3vgr.js} +7 -6
  74. package/dist/{oauth-refresh-sweep-924sa8gn.js → oauth-refresh-sweep-zvtva0qw.js} +5 -4
  75. package/dist/{onboard-7220gcnm.js → onboard-t93asx6a.js} +4 -4
  76. package/dist/{opencode-adapter-krfzs6pd.js → opencode-adapter-mze65bgz.js} +2 -2
  77. package/dist/{otel-impl-h4zhfrtn.js → otel-impl-fkm35wy3.js} +14 -4
  78. package/dist/{pi-mono-adapter-ncpmv3qw.js → pi-mono-adapter-nm9mq41y.js} +22 -22
  79. package/dist/{pricing-refresh-wekg4ay3.js → pricing-refresh-1mbapfe0.js} +6 -5
  80. package/dist/{rbac-roles-tx0er4z4.js → rbac-roles-hxvzag74.js} +4 -3
  81. package/dist/{rbac-roles-19qa0m3a.js → rbac-roles-m98begq4.js} +5 -4
  82. package/dist/{render-v2-hh0d7dyx.js → render-v2-g1kc8bza.js} +10 -5
  83. package/dist/{seed-pricing-z2snez0a.js → seed-pricing-n562nvz6.js} +5 -4
  84. package/dist/{setup-zrp530my.js → setup-5tm2m04n.js} +4 -4
  85. package/dist/{worker-2va0xbjz.js → worker-p3x0ez4t.js} +35 -33
  86. package/openapi.json +952 -4
  87. package/package.json +10 -3
  88. package/src/artifact-sdk/browser-sdk.ts +7 -3
  89. package/src/be/db.ts +142 -3
  90. package/src/be/migrations/144_slack_relay_obligations.sql +44 -0
  91. package/src/be/migrations/145_slack_render_v2_delegation.sql +12 -0
  92. package/src/be/scripts/typecheck.ts +35 -0
  93. package/src/be/seed-skills/bundled-files.generated.json +4 -0
  94. package/src/be/swarm-config-guard.ts +48 -0
  95. package/src/commands/codex-session-runner.ts +65 -45
  96. package/src/commands/identity-refresh.ts +101 -0
  97. package/src/commands/runner.ts +199 -59
  98. package/src/hooks/codex-hook.ts +4 -6
  99. package/src/http/agents.ts +267 -91
  100. package/src/http/all-routes.ts +2 -0
  101. package/src/http/auth.ts +25 -1
  102. package/src/http/index.ts +30 -6
  103. package/src/http/kv.ts +16 -1
  104. package/src/http/memory.ts +4 -1
  105. package/src/http/page-proxy.ts +8 -5
  106. package/src/http/pages-public.ts +19 -9
  107. package/src/http/pages.ts +16 -3
  108. package/src/http/realtime.ts +28 -0
  109. package/src/http/rooms.ts +314 -0
  110. package/src/http/route-def.ts +8 -2
  111. package/src/http/tasks.ts +1 -1
  112. package/src/http/utils.ts +104 -7
  113. package/src/kv-reserved-namespaces.ts +6 -0
  114. package/src/otel-impl.ts +14 -0
  115. package/src/otel.ts +8 -0
  116. package/src/providers/acp-adapter.ts +146 -12
  117. package/src/providers/acp-swarm-events.ts +16 -2
  118. package/src/providers/claude-adapter.ts +120 -309
  119. package/src/providers/claude-sdk-session.ts +586 -0
  120. package/src/providers/claude-session-events.ts +247 -0
  121. package/src/providers/codex-adapter.ts +813 -242
  122. package/src/providers/codex-app-server.ts +419 -0
  123. package/src/providers/pricing-sources.md +3 -0
  124. package/src/providers/types.ts +6 -1
  125. package/src/realtime/auth.ts +130 -0
  126. package/src/realtime/browser.generated.txt +69 -0
  127. package/src/realtime/browser.ts +382 -0
  128. package/src/realtime/bus.ts +33 -0
  129. package/src/realtime/document.ts +529 -0
  130. package/src/realtime/rooms.ts +575 -0
  131. package/src/realtime/transport.ts +406 -0
  132. package/src/realtime/tsconfig.browser.json +14 -0
  133. package/src/script-workflows/executor.ts +13 -8
  134. package/src/scripts-runtime/ctx.ts +1 -2
  135. package/src/scripts-runtime/sdk-allowlist.ts +6 -0
  136. package/src/scripts-runtime/swarm-sdk.ts +35 -7
  137. package/src/scripts-runtime/types/stdlib.d.ts +65 -0
  138. package/src/scripts-runtime/types/swarm-sdk.d.ts +65 -0
  139. package/src/server.ts +10 -0
  140. package/src/slack/ack.ts +137 -30
  141. package/src/slack/assistant.ts +18 -10
  142. package/src/slack/closure.ts +66 -0
  143. package/src/slack/handlers.test.ts +172 -5
  144. package/src/slack/handlers.ts +11 -20
  145. package/src/slack/reaction-shortcode.ts +45 -0
  146. package/src/slack/render-v2.ts +404 -36
  147. package/src/slack/responses.ts +26 -6
  148. package/src/slack/watcher.ts +125 -92
  149. package/src/tests/acp-adapter.test.ts +211 -4
  150. package/src/tests/acp-swarm-events.test.ts +4 -1
  151. package/src/tests/agents-harness-provider.test.ts +254 -0
  152. package/src/tests/agents-list-model-display.test.ts +14 -0
  153. package/src/tests/artifact-sdk.test.ts +12 -2
  154. package/src/tests/claude-hook-credentials.test.ts +84 -0
  155. package/src/tests/claude-sdk-lifecycle.test.ts +262 -0
  156. package/src/tests/claude-sdk-live-lifecycle.test.ts +272 -0
  157. package/src/tests/claude-sdk-process.fixture.ts +223 -0
  158. package/src/tests/claude-sdk-transport.test.ts +289 -0
  159. package/src/tests/claude-worker-parity.test.ts +574 -0
  160. package/src/tests/codex-adapter-otel.test.ts +31 -36
  161. package/src/tests/codex-adapter.test.ts +624 -197
  162. package/src/tests/codex-app-server.test.ts +208 -0
  163. package/src/tests/codex-steering-hook.test.ts +16 -0
  164. package/src/tests/codex-subprocess-steering.test.ts +109 -0
  165. package/src/tests/db-query.test.ts +39 -23
  166. package/src/tests/db-retention.test.ts +2 -1
  167. package/src/tests/docs-index-footprint.test.js +4 -3
  168. package/src/tests/e2e-claude-transport.test.ts +204 -0
  169. package/src/tests/e2e-nightly-report.test.ts +41 -4
  170. package/src/tests/env-flag.test.ts +75 -0
  171. package/src/tests/fetch-resolved-env.test.ts +126 -0
  172. package/src/tests/fixtures/codex-deferred-queue-runner.ts +37 -0
  173. package/src/tests/fixtures/codex-session-runner.ts +40 -0
  174. package/src/tests/fixtures/fake-codex-app-server.ts +100 -0
  175. package/src/tests/fixtures/runner-identity-refresh.ts +178 -0
  176. package/src/tests/harness-provider-resolution.test.ts +7 -0
  177. package/src/tests/identity-refresh.test.ts +145 -0
  178. package/src/tests/internal-ai/complete-structured.test.ts +2 -0
  179. package/src/tests/page-proxy.test.ts +223 -27
  180. package/src/tests/page-session.test.ts +32 -0
  181. package/src/tests/page-viewer-auth.test.ts +182 -0
  182. package/src/tests/pages-public-html.test.ts +3 -0
  183. package/src/tests/profile-default-refresh.test.ts +125 -0
  184. package/src/tests/realtime-room-auth.test.ts +68 -0
  185. package/src/tests/realtime-room-surfaces.test.ts +329 -0
  186. package/src/tests/realtime-rooms.test.ts +343 -0
  187. package/src/tests/realtime-transport.test.ts +551 -0
  188. package/src/tests/runner-identity-refresh.test.ts +105 -0
  189. package/src/tests/runner-session-outcome.test.ts +28 -0
  190. package/src/tests/sandboxed-process.test.ts +87 -2
  191. package/src/tests/script-workflows-runtime-e2e.test.ts +71 -1
  192. package/src/tests/seed-skills-bundled-files.test.ts +1 -0
  193. package/src/tests/slack-closure.test.ts +183 -0
  194. package/src/tests/slack-reaction-config.test.ts +399 -0
  195. package/src/tests/slack-relay-obligations.test.ts +185 -0
  196. package/src/tests/slack-render-v2-delegation.test.ts +373 -0
  197. package/src/tests/slack-render-v2.test.ts +1107 -5
  198. package/src/tests/slack-thread-buffer.test.ts +7 -3
  199. package/src/tests/slack-watcher.test.ts +172 -2
  200. package/src/tests/spec-base-url.test.ts +2 -1
  201. package/src/tests/steering-core.test.ts +5 -8
  202. package/src/tests/steering-transport.test.ts +98 -7
  203. package/src/tests/ui-logs-parser.test.ts +402 -0
  204. package/src/tests/vendored-openapi.test.ts +3 -4
  205. package/src/tools/kv/kv-delete.ts +5 -1
  206. package/src/tools/kv/kv-incr.ts +5 -1
  207. package/src/tools/kv/kv-set.ts +5 -1
  208. package/src/tools/kv/kv-write-auth.ts +6 -1
  209. package/src/tools/rooms.ts +171 -0
  210. package/src/tools/tool-config.ts +6 -0
  211. package/src/types.ts +5 -8
  212. package/src/utils/claude-transport.ts +36 -0
  213. package/src/utils/internal-ai/complete-structured.ts +2 -1
  214. package/src/utils/page-session.ts +21 -28
  215. package/src/utils/request-auth-context.ts +6 -2
  216. package/src/utils/sandboxed-process.ts +63 -9
  217. package/src/workflows/event-bus.ts +6 -10
  218. package/src/workflows/executors/swarm-script.ts +2 -0
  219. package/templates/schedules/weekly-harness-upgrade-check/content.md +3 -4
  220. package/templates/skills/pages/content.md +147 -8
  221. package/templates/skills/pages/files/examples/multiplayer-board.html +416 -0
  222. package/tsconfig.json +1 -0
  223. package/dist/cli-95m51ztz.js +0 -28
  224. package/dist/{cli-srjj750f.js → cli-8b7xaa2h.js} +3 -3
package/README.md CHANGED
@@ -1,60 +1,22 @@
1
- <p align="center">
2
- <a href="https://github.com/desplega-ai/agent-swarm/stargazers"><img src="https://img.shields.io/github/stars/desplega-ai/agent-swarm?style=flat-square&color=yellow" alt="GitHub Stars"></a>
3
- <a href="https://github.com/desplega-ai/agent-swarm/blob/main/LICENSE"><img src="https://img.shields.io/github/license/desplega-ai/agent-swarm?style=flat-square" alt="MIT License"></a>
4
- <a href="https://github.com/desplega-ai/agent-swarm/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen?style=flat-square" alt="PRs Welcome"></a>
5
- </p>
6
-
7
- <p align="center">
8
- <b>An engine to make your company AI Native</b><br/>
9
- <sub>Built by <a href="https://desplega.sh">desplega.sh</a> — by builders, for builders.</sub>
10
- </p>
1
+ <p align="center"><a href="https://github.com/desplega-ai/agent-swarm/stargazers"><img src="https://img.shields.io/github/stars/desplega-ai/agent-swarm?style=flat-square&color=yellow" alt="GitHub Stars"></a> <a href="https://github.com/desplega-ai/agent-swarm/blob/main/LICENSE"><img src="https://img.shields.io/github/license/desplega-ai/agent-swarm?style=flat-square" alt="MIT License"></a> <a href="https://github.com/desplega-ai/agent-swarm/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen?style=flat-square" alt="PRs Welcome"></a></p>
2
+ <p align="center"><b>An engine to make your company AI Native</b><br/><sub>Built by <a href="https://desplega.sh">desplega.sh</a>.</sub></p>
11
3
 
12
4
  > [!TIP]
13
5
  > **This repo evolves every single day.** [Watch now →](https://github.com/desplega-ai/agent-swarm/subscription)
6
+ <p align="center"><video src="https://github.com/user-attachments/assets/e220712e-c54d-4f46-b059-bac04639d229" controls muted playsinline width="720"></video></p>
7
+ <p align="center"><sub>▸ <a href="./assets/agent-swarm.mp4">daily evolution</a> · <a href="./assets/agent-swarm-slack-to-pr.mp4">slack → pr</a> · <a href="./assets/video-source">Making of</a></sub></p>
8
+ <p align="center"><a href="https://agent-swarm.dev"><img src="https://img.shields.io/badge/Website-agent--swarm.dev-000?style=for-the-badge" alt="Website"></a> <a href="https://docs.agent-swarm.dev"><img src="https://img.shields.io/badge/Docs-docs.agent--swarm.dev-amber?style=for-the-badge" alt="Docs"></a> <a href="https://app.agent-swarm.dev"><img src="https://img.shields.io/badge/Dashboard-app.agent--swarm.dev-blue?style=for-the-badge" alt="Dashboard"></a> <a href="https://discord.gg/KZgfyyDVZa"><img src="https://img.shields.io/badge/Discord-Join%20Community-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Join Discord"></a> <a href="https://x.com/desplegalabs"><img src="https://img.shields.io/badge/𝕏-@desplegalabs-000?style=for-the-badge&logo=x&logoColor=white" alt="Follow on X"></a> <a href="https://www.linkedin.com/company/desplega-labs/"><img src="https://img.shields.io/badge/LinkedIn-Desplega%20Labs-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white" alt="Desplega Labs on LinkedIn"></a></p>
14
9
 
15
- <p align="center">
16
- <video src="https://github.com/user-attachments/assets/e220712e-c54d-4f46-b059-bac04639d229" controls muted playsinline width="720"></video>
17
- </p>
18
- <p align="center">
19
- <sub>▸ <a href="./assets/agent-swarm.mp4">daily evolution</a> · <a href="./assets/agent-swarm-slack-to-pr.mp4">slack → pr</a> · <a href="./assets/video-source">Making of</a></sub>
20
- </p>
21
-
22
- <p align="center">
23
- <a href="https://agent-swarm.dev">
24
- <img src="https://img.shields.io/badge/Website-agent--swarm.dev-000?style=for-the-badge" alt="Website">
25
- </a>
26
- <a href="https://docs.agent-swarm.dev">
27
- <img src="https://img.shields.io/badge/Docs-docs.agent--swarm.dev-amber?style=for-the-badge" alt="Docs">
28
- </a>
29
- <a href="https://app.agent-swarm.dev">
30
- <img src="https://img.shields.io/badge/Dashboard-app.agent--swarm.dev-blue?style=for-the-badge" alt="Dashboard">
31
- </a>
32
- <a href="https://discord.gg/KZgfyyDVZa">
33
- <img src="https://img.shields.io/badge/Discord-Join%20Community-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Join Discord">
34
- </a>
35
- <a href="https://x.com/desplegalabs">
36
- <img src="https://img.shields.io/badge/𝕏-@desplegalabs-000?style=for-the-badge&logo=x&logoColor=white" alt="Follow on X">
37
- </a>
38
- <a href="https://www.linkedin.com/company/desplega-labs/">
39
- <img src="https://img.shields.io/badge/LinkedIn-Desplega%20Labs-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white" alt="Desplega Labs on LinkedIn">
40
- </a>
41
- </p>
42
-
43
- > **agent-swarm.dev is 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.**
44
-
45
- > AI-Native · Compounds · Presence · Harness & LLM-Agnostic · Your Infra · Your Memory ·
46
-
47
- ## What it does
48
-
49
- agent-swarm.dev runs a team of AI agents that coordinate autonomously. A **lead agent** receives tasks (from Slack, GitHub, GitLab, Linear, Jira, email, or the API), breaks them down, and delegates to **worker agents** running in isolated environments (Docker). Workers execute tasks, ship solutions, and write their learnings back to a shared memory so the whole swarm gets smarter every session.
10
+ agent-swarm.dev is an open-source operating system for AI work. A lead agent delegates goals to workers such as Claude Code or Codex. Isolated containers, shared memory, tools, schedules, and review gates preserve work across sessions.
50
11
 
51
- You can run agents for Marketing, Product, UX, Engineering, Support, Operations, HR, Finance, or any role you can think of. A centralized Lead coordinates them, and they share the learnings horizontally. That's the true difference between [*AI First*](https://www.pleasedontdeploy.com/i/197193364/ai-first) and [*AI Native*](https://www.pleasedontdeploy.com/i/197193364/third-the-ai-native-metamorphosis).
12
+ ## What you get
52
13
 
53
- agent-swarm.dev is the shared cloud brain and muscle that makes your whole company better every day.
54
-
55
- Sometimes humans are the blocker. We can help you. Contact us [contact@desplega.sh](mailto:contact@desplega.sh).
56
-
57
- Learn more in the [architecture overview](https://docs.agent-swarm.dev/docs/architecture/overview).
14
+ - A lead agent that receives work from Slack, repositories, issue trackers, email, or the API
15
+ - Workers in isolated Docker containers with development environments
16
+ - Memory and identity that persist across sessions
17
+ - Workflows, schedules, scripts, and apps for recurring work
18
+ - [Realtime rooms](./runbooks/realtime-rooms.md) for shared page state, presence, and live channels
19
+ - Your choice of harness and models: Claude Code, Codex, pi, opencode, Devin, or ACP agents
58
20
 
59
21
  ```mermaid
60
22
  flowchart LR
@@ -94,208 +56,46 @@ flowchart LR
94
56
  WORKERS --> OUT
95
57
  ```
96
58
 
97
- ## Known Use Cases
98
-
99
- Use cases that are used daily by ourselves and others.
100
- Each playbook contains: the agents, the tools & skills, and workflows & schedules behind it. **[Browse all playbooks →](https://docs.agent-swarm.dev/docs/playbooks)**
101
-
102
- - **[Feature Development](https://docs.agent-swarm.dev/docs/playbooks/feature-development)** — Integrated with Linear and GitHub to take feature requests from Slack and turn them into pull requests.
103
- - **[Lead Prospecting](https://docs.agent-swarm.dev/docs/playbooks/lead-prospecting)** — Integrate your prospecting tools with the swarm and let agents handle outreach, scheduling, and follow-up.
104
- - **[Content Generation](https://docs.agent-swarm.dev/docs/playbooks/content-generation)** — Generate engagement tools, blog posts, manage social media presence, update your website, and more.
105
- - **[UX Command Center](https://docs.agent-swarm.dev/docs/playbooks/ux-command-center)** — Agents that keep your product usable: record agentic sessions, enforce your design system, and mine user logs to detect and propose UX improvements.
106
- - **[Proactive Customer Support](https://docs.agent-swarm.dev/docs/playbooks/proactive-customer-support)** — Agents that oversee your top accounts, prepare scheduled reports, and leverage everything they know about your platform to keep those accounts up to date.
107
- - **[Code Health & Alert Management](https://docs.agent-swarm.dev/docs/playbooks/code-health-alert-management)** — Datadog, New Relic, Sentry, or any alerting tool can kick off fixes or new proposals. Monitor code health and propose improvements weekly, daily, or hourly.
108
- - **[Reports from Multiple Sources](https://docs.agent-swarm.dev/docs/playbooks/reports-multiple-sources)** — Integrate your data warehouse to generate tailored reports and answer the key questions your team has, with fresh data. Your BI tool may be a thing of the past.
109
- - **[Self-Documenting & Release Reports](https://docs.agent-swarm.dev/docs/playbooks/self-documenting-release-reports)** — Update your docs and use frameworks like [Remotion](https://www.remotion.dev/), [qa-use](https://github.com/qa-use/qa-use), and [browser-use](https://github.com/browser-use/browser-use) to generate release videos and rich documentation in seconds, at the cadence you need.
110
- - Do you have a cool playbook to share? Send us a PR!
111
-
112
- > **The patterns that compound.** Five recipes show up in nearly every playbook — they're how the swarm stays reliable as it scales:
113
- > **[Litmus Tests](https://docs.agent-swarm.dev/docs/playbooks/patterns/litmus-tests)** (LLM-as-judge quality gates) ·
114
- > **[Drain Loops](https://docs.agent-swarm.dev/docs/playbooks/patterns/drain-loops)** (one ticket → a chain of reviewable PRs) ·
115
- > **[HITL Gates](https://docs.agent-swarm.dev/docs/playbooks/patterns/hitl-gates)** (pause for human approval on irreversible steps) ·
116
- > **[Per-Customer Working Directories](https://docs.agent-swarm.dev/docs/playbooks/patterns/per-customer-working-directories)** (context that compounds per account) ·
117
- > **[No-op Workflows](https://docs.agent-swarm.dev/docs/playbooks/patterns/no-op-workflows)** (skip silently when nothing changed).
118
- > **[See all patterns →](https://docs.agent-swarm.dev/docs/playbooks/patterns)**
119
-
120
- Check [our templates](https://templates.agent-swarm.dev) for a quick start.
121
-
122
- ## Highlights
123
-
124
- - **Lead/worker orchestration in Docker** — isolated dev environments, priority queues, pause/resume across deploys, and API-side alerts when claimable work stops being picked up. [Architecture →](https://docs.agent-swarm.dev/docs/architecture/overview)
125
- - **Compounding memory & persistent identity** — agents explicitly capture reusable learnings with `memory-store`, remember past sessions, and evolve their own persona, expertise, and notes, with ratcheting file budgets and visible recovery when local edits exceed prompt limits. [Memory →](https://docs.agent-swarm.dev/docs/architecture/memory) · [Agents →](https://docs.agent-swarm.dev/docs/architecture/agents)
126
- - **Hybrid + graph-linked memory recall** — memory retrieval can blend vector and full-text ranking, expand through linked memories, surface usefulness readouts, and let agents correct an existing memory without losing its ID or history. [Memory →](https://docs.agent-swarm.dev/docs/architecture/memory) · [MCP tools →](https://docs.agent-swarm.dev/docs/reference/mcp-tools#memory-tools)
127
- - **Multi-channel inputs** — Slack, GitHub, GitLab, email, WhatsApp, Linear, Jira, and the HTTP API all create tasks. [Integrations](#integrations)
128
- - **Slack operations and persistent thread trees** — lead agents can create, populate, and archive channels, while conversations can opt in to one editable task tree with streamed outcome cards and explicit Block Kit messages. [Slack guide →](https://docs.agent-swarm.dev/docs/integrations/slack)
129
- - **Workflow engine with Human-in-the-Loop** — DAG-based automation with approval gates, retries, structured I/O, and `foreach` fan-out that rejoins child agent tasks deterministically. [Workflows →](https://docs.agent-swarm.dev/docs/concepts/workflows)
130
- - **Scheduled & recurring tasks** — cron-based automation for standing work, with schedules that can target agent tasks, workflows, or catalog scripts. Bundled automations declare their required parameters and integrations; if enabled before setup is complete, they remain in `needs_setup` instead of dispatching. [Scheduling →](https://docs.agent-swarm.dev/docs/concepts/scheduling)
131
- - **Mid-run task steering** — add context at the next turn boundary, request an immediate interrupt where the harness supports it, or degrade safely to a follow-up task. [Task steering →](https://docs.agent-swarm.dev/docs/guides/task-steering)
132
- - **Operator configuration UI** — tune non-secret feature flags, limits, integration toggles, and runtime defaults from Settings → Configuration, with source and restart-required indicators. [Configuration →](https://docs.agent-swarm.dev/docs/ui/configuration)
133
- - **Asset namespaces** — group tasks, workflows, schedules, pages, apps, scripts, and mapped files under canonical shared or personal keys, with inheritance, subtree filtering, audited moves, and cross-entity discovery. [Asset namespaces →](https://docs.agent-swarm.dev/docs/guides/asset-namespaces)
134
- - **Persistent shared files via agent-fs** — co-deploy agent-fs for shared task attachments, previews, and search; `store-progress` verifies attachment pointers before changing task state, late provisioning or config reloads activate the provider without an API restart, and tenant-authenticated control planes can invite shared-org members without receiving the bootstrap key. [Co-deployment guide →](https://docs.agent-swarm.dev/docs/guides/agent-fs-co-deployment)
135
- - **Durable script workflows** — launch background script runs, inspect their journals, and track them from the dashboard when a one-shot `script-run` is too small. User code runs in a credential-free guest while authenticated swarm operations stay behind a capability broker. [Guide →](https://docs.agent-swarm.dev/docs/guides/script-workflow-runs)
136
- - **Scripts-only MCP mode (code-mode)** — reduce the external MCP surface to eight script tools while retaining the full swarm SDK through `script-run`, cutting tool-schema context for capable coordinator models. [Guide →](https://docs.agent-swarm.dev/docs/guides/scripts-only-mode)
137
- - **Scripts as external APIs** — expose a saved script as a public `POST /api/x/script/<id>` endpoint with optional bearer auth, typed input validation, and per-endpoint usage tracking. [Guide →](https://docs.agent-swarm.dev/docs/guides/scripts-external-apis)
138
- - **Typed script API connections** — lead-managed OpenAPI, GraphQL, and MCP connections generate `ctx.api.*` / `ctx.mcp.*` clients for scripts, with credential bindings and OAuth-backed auth kept server-side. [Guide →](https://docs.agent-swarm.dev/docs/guides/script-connections)
139
- - **Swarm Apps** — agents build versioned, schema-backed dashboard apps with reusable UI elements, named queries and actions, per-user settings, RBAC, history, and safe rollback. Models can also sync source-backed rows through owner-scoped script connections. [Apps API →](https://docs.agent-swarm.dev/docs/api-reference/apps)
140
- - **E2B-backed eval harness** — run a scenario × harness-config matrix against real swarm stacks, capture transcripts/artifacts, and grade outcomes with deterministic checks plus LLM or agentic judges. [Guide →](https://docs.agent-swarm.dev/docs/guides/evals-harness)
141
- - **Harness & LLM agnostic** — run with Claude Code, Claude Bridge, OpenAI Codex, pi-mono (Anthropic, OpenRouter, or Amazon Bedrock), Devin, Claude Managed Agents, raw LLMs, opencode, or any [Agent Client Protocol](https://agentclientprotocol.com) agent via the generic `acp` provider. The dashboard model picker follows a live models.dev catalog (with a bundled snapshot fallback), and the direct Claude catalog includes Fable 5.1 and Mythos 5.1. Route every OpenRouter-backed harness, workflow, and summarizer through an OpenAI-compatible gateway with `OPENROUTER_BASE_URL`. Tasks, schedules, and workflow agent-task nodes can use portable `modelTier` intent (`smol`, `regular`, `smart`, `ultra`), and operators can set per-agent reasoning effort (`off` → `max`, where supported) without changing task payloads. [Compare providers →](https://docs.agent-swarm.dev/docs/guides/provider-capability-matrix) · [Harness config →](https://docs.agent-swarm.dev/docs/guides/harness-configuration) · [Add a new provider →](https://docs.agent-swarm.dev/docs/guides/harness-providers)
142
- - **Published release artifacts** — every release publishes multi-architecture API, full-worker, and slim-worker images alongside versioned E2B templates, the npm CLI package, and the Helm chart. [Artifact inventory →](https://docs.agent-swarm.dev/docs/guides/published-artifacts)
143
- - **OpenTelemetry traces plus OTLP cost/token metrics** — export API + worker traces and finalized session cost/token counters through the same OTLP pipeline for dashboarding in SigNoz, Datadog, Tempo, or another compatible backend. [Observability →](https://docs.agent-swarm.dev/docs/guides/observability-opentelemetry)
144
- - **Follow-up continuity across all harnesses** — child tasks inherit a bounded prior-task context preamble built from the task chain, so continuity survives restarts and works the same across every provider. [Task lifecycle →](https://docs.agent-swarm.dev/docs/concepts/task-lifecycle)
145
- - **Skills & MCP servers** — reusable procedural knowledge, bundled skill reference files, and per-agent MCP servers with scope cascade. [MCP tools →](https://docs.agent-swarm.dev/docs/reference/mcp-tools)
146
- - **External tool-router access** — the `x` command and `swarm_x` MCP tool let humans and agents execute approved third-party routes such as Composio without baking bespoke MCP servers first. [CLI →](https://docs.agent-swarm.dev/docs/reference/cli) · [Composio →](https://docs.agent-swarm.dev/docs/integrations/composio)
147
- - **Config-driven metrics dashboards** — define read-only SQL widgets, version them, and render them in the dashboard without shipping custom frontend code. [Metrics API →](https://docs.agent-swarm.dev/docs/api-reference/stats)
148
- - **DB-backed pages** — agents publish HTML or JSON pages (reports, dashboards, action specs) via `create_page`, remove stale pages with `delete-page`, and share them with public / authed / password modes, version history, view counters, diff helpers, and PDF export. [MCP tools → Pages](https://docs.agent-swarm.dev/docs/reference/mcp-tools#pages-tools)
149
- - **KV store** — Redis-like namespaced key/value store with auto-scoped context (Slack thread / PR / Linear issue / page). [MCP tools → KV](https://docs.agent-swarm.dev/docs/reference/mcp-tools#kv-tools)
150
- - **Real-time, themeable dashboard + task attachments** — monitor agents, tasks, per-user usage costs, and inter-agent chat; choose from built-in light/dark themes; filter tasks by requester; create tasks with uploaded files; and preview attachments inline above session prompts. [app.agent-swarm.dev →](https://app.agent-swarm.dev)
151
-
152
59
  ## Quick Start
153
60
 
154
- Need help? Contact us at [contact@desplega.sh](mailto:contact@desplega.sh).
155
-
156
- **Prerequisites:** [Docker](https://docker.com) and one supported harness credential. Claude remains the default, or choose one of these install-time mappings:
157
-
158
- | Provider | `HARNESS_PROVIDER` | Credential/configuration |
159
- | --- | --- | --- |
160
- | Claude Code | `claude` | `CLAUDE_CODE_OAUTH_TOKEN` or `ANTHROPIC_API_KEY` |
161
- | OpenAI | `codex` | `OPENAI_API_KEY` |
162
- | OpenRouter | `pi` | `OPENROUTER_API_KEY` and a `MODEL_OVERRIDE` |
163
- | AWS Bedrock (alpha) | `pi` | `AWS_REGION`, a Bedrock `MODEL_OVERRIDE`, and AWS credentials or profile |
164
-
165
- Alpha: session summaries, memory rating, spend tracking and model tiers may be missing on Bedrock. See [model providers and gateways](https://docs.agent-swarm.dev/docs/guides/provider-auth/model-gateways) and [what each provider supports](https://docs.agent-swarm.dev/docs/guides/harness-configuration#supported-providers).
166
-
167
- The fastest way is the onboarding wizard — it collects credentials, picks presets, and generates a working `docker-compose.yml`:
61
+ Give your coding agent the operator skill for Docker Compose or Kubernetes:
168
62
 
169
63
  ```bash
170
- bunx @desplega.ai/agent-swarm onboard
171
- npx @desplega.ai/agent-swarm onboard
64
+ npx skills add desplega-ai/agent-swarm
172
65
  ```
173
66
 
174
- Prefer manual setup? Clone and run with Docker Compose:
67
+ Or use the examples directly:
175
68
 
176
69
  ```bash
177
- git clone https://github.com/desplega-ai/agent-swarm.git
178
- cd agent-swarm
179
- cp .env.docker.example .env
180
- # edit .env — set API_KEY, HARNESS_PROVIDER, and one credential set from the table above
70
+ git clone https://github.com/desplega-ai/agent-swarm.git && cd agent-swarm
71
+ cp .env.docker.example .env # Set API_KEY, a harness credential, and all eight agent UUIDs.
72
+ openssl rand -base64 32 > encryption_key
73
+ chmod 600 .env encryption_key
181
74
  docker compose -f docker-compose.example.yml --env-file .env up -d
182
75
  ```
183
76
 
184
- The API runs on port `3013`, with interactive docs at `http://localhost:3013/docs` and an OpenAPI 3.1 spec at `http://localhost:3013/openapi.json`.
185
-
186
- <details>
187
- <summary><strong>Other setups</strong></summary>
188
-
189
- - **Local API + Docker workers** — run the API on your host, workers in Docker. See [Getting Started](https://docs.agent-swarm.dev/docs/getting-started).
190
- - **Claude Code as the lead agent** — `bunx @desplega.ai/agent-swarm connect` (or `npx @desplega.ai/agent-swarm connect`), then tell Claude Code to register as the lead.
191
-
192
- </details>
193
-
194
- ## How It Works
195
-
196
- ```
197
- You (Slack / GitHub / Email / CLI)
198
- |
199
- Lead Agent ←→ MCP API Server ←→ SQLite DB
200
- |
201
- ┌────┼────┐
202
- Worker Worker Worker
203
- (Docker containers with full dev environments)
204
- ```
205
-
206
- 1. A task arrives via Slack DM, GitHub @mention, email, or the API.
207
- 2. The lead plans and delegates subtasks to workers.
208
- 3. Workers execute in isolated Docker containers (git, Node.js, Python, etc.).
209
- 4. Progress streams to the dashboard, Slack threads, or the API.
210
- 5. Results ship back out as PRs, custom pages, issue replies, or Slack messages.
211
- 6. Session learnings are extracted and become memory for future tasks.
212
-
213
- More detail in the [task lifecycle docs](https://docs.agent-swarm.dev/docs/concepts/task-lifecycle).
77
+ Read the [Compose checklist](./skills/agent-swarm/references/compose.md) before starting. API: http://localhost:3013, with `/docs` and `/openapi.json`. [Dashboard](https://app.agent-swarm.dev): connect it to your API.
78
+ Kubernetes: [install the OCI Helm chart](./charts/agent-swarm/README.md).
214
79
 
215
80
  ## Integrations
216
81
 
217
- Missing one? Ask the swarm to build it.
218
-
219
- | Integration | What it does | Setup |
220
- |---|---|---|
221
- | **Slack** | DM or @mention the bot to create tasks; workers reply in threads | [Guide](https://docs.agent-swarm.dev/docs/integrations/slack) |
222
- | **GitHub App** | @mention or assign the bot on issues/PRs; CI failures create follow-up tasks | [Guide](https://docs.agent-swarm.dev/docs/integrations/github) |
223
- | **GitLab** | Same model as GitHub — webhooks on issues/MRs, `glab` preinstalled in workers | [Guide](https://docs.agent-swarm.dev/docs/integrations/gitlab) |
224
- | **AgentMail** | Give each agent an inbox; emails become tasks or lead messages | [Guide](https://docs.agent-swarm.dev/docs/integrations/agentmail) |
225
- | **Kapso (WhatsApp)** | Native inbound WhatsApp webhook routing; agents reply over WhatsApp with MCP tools or the `kapso-whatsapp` skill | [Guide](https://docs.agent-swarm.dev/docs/integrations/kapso) |
226
- | **Composio** | Route approved third-party app operations through `agent-swarm x composio ...` or the `swarm_x` MCP tool | [Guide](https://docs.agent-swarm.dev/docs/integrations/composio) |
227
- | **Linear** | Bidirectional ticket sync via OAuth + webhooks | [Guide](https://docs.agent-swarm.dev/docs/integrations/linear) |
228
- | **Jira Cloud** | OAuth 3LO ticket sync — assignee/comment events create tasks; lifecycle posts comments back | [Guide](https://docs.agent-swarm.dev/docs/integrations/jira) |
229
- | **Sentry** | Workers can triage Sentry issues with the `/investigate-sentry-issue` command | [Guide](https://docs.agent-swarm.dev/docs/integrations/sentry) |
230
- | **Devin** | Devin can be a node in your swarm — keep your existing configuration | [Guide](https://docs.agent-swarm.dev/docs/guides/harness-configuration#supported-providers) |
231
-
232
- ## Dashboard
233
-
234
- Real-time monitoring of agents, tasks, and inter-agent chat. The task list can be filtered by requester, including **Me** and **Unattributed**, while keeping the selection in the page URL. Session titles can be renamed inline, and agent profiles can search hundreds of Lucide icons, pick a color, and retain deterministic defaults when no customization is set. Use the hosted version at [app.agent-swarm.dev](https://app.agent-swarm.dev), or run locally:
235
-
236
- ```bash
237
- cd apps/ui && bun install && bun run dev
238
- ```
239
-
240
- Opens at `http://localhost:5274`.
241
-
242
- ## [CLI](https://docs.agent-swarm.dev/docs/reference/cli)
82
+ Slack · GitHub · GitLab · Linear · Jira · AgentMail · WhatsApp (Kapso) · Composio · Sentry · Devin. [Integration guides](https://docs.agent-swarm.dev/docs/integrations).
243
83
 
244
- ```bash
245
- bunx @desplega.ai/agent-swarm <command>
246
- npx @desplega.ai/agent-swarm <command>
247
- ```
248
-
249
- | Command | Description |
250
- |---------|-------------|
251
- | `onboard` | Set up a new swarm from scratch (Docker Compose wizard) |
252
- | `connect` | Connect this project to an existing swarm |
253
- | `api` | Start the API + MCP HTTP server |
254
- | `worker` | Run a worker agent |
255
- | `lead` | Run a lead agent |
256
- | `e2b` | Build E2B templates and launch/manage grouped API + lead + worker swarms |
257
- | `x` | Execute approved external routes such as Composio |
258
- | `docs` | Open documentation (`--open` to launch in browser) |
259
-
260
- ## Deployment
261
-
262
- For production deployments (Docker Compose with multiple workers, systemd for the API, graceful shutdown, integration config), see [DEPLOYMENT.md](./DEPLOYMENT.md) and the [deployment guide](https://docs.agent-swarm.dev/docs/guides/deployment).
263
-
264
- ## Documentation
84
+ ## Learn more
265
85
 
266
- Everything lives at **[docs.agent-swarm.dev](https://docs.agent-swarm.dev)**. Good starting points:
267
-
268
- - [Getting Started](https://docs.agent-swarm.dev/docs/getting-started) — install, configure, and run your first task
269
- - [Architecture overview](https://docs.agent-swarm.dev/docs/architecture/overview) — how the swarm is wired together
270
- - [Playbooks](https://docs.agent-swarm.dev/docs/playbooks) — eight production flows we use to run Desplega, plus the patterns behind them
271
- - [CLI reference](https://docs.agent-swarm.dev/docs/reference/cli) and [Environment variables](https://docs.agent-swarm.dev/docs/reference/environment-variables)
272
- - [API reference](https://docs.agent-swarm.dev/docs/api-reference) — every HTTP endpoint
86
+ - [Getting started](https://docs.agent-swarm.dev/docs/getting-started) · [Architecture](https://docs.agent-swarm.dev/docs/architecture/overview) · [Playbooks](https://docs.agent-swarm.dev/docs/playbooks) · [CLI](https://docs.agent-swarm.dev/docs/reference/cli) · [API reference](https://docs.agent-swarm.dev/docs/api-reference)
87
+ - [Agent templates](https://templates.agent-swarm.dev)
88
+ - Help: [contact@desplega.sh](mailto:contact@desplega.sh) · [Discord](https://discord.gg/KZgfyyDVZa)
273
89
 
274
90
  ## Contributing
275
91
 
276
- We love contributions! Whether it's bug reports, feature requests, docs improvements, or code all are welcome.
277
-
278
- See [CONTRIBUTING.md](./CONTRIBUTING.md) to get started. The quickest way to contribute:
279
-
280
- 1. Fork the repo
281
- 2. Create a branch (`git checkout -b my-feature`)
282
- 3. Make your changes
283
- 4. Open a PR
284
-
285
- Join our [Discord](https://discord.gg/KZgfyyDVZa) if you have questions or want to discuss ideas.
286
-
287
- > Are you an agent? Go to [agent-swarm.dev/skill.md](https://www.agent-swarm.dev/skill.md).
92
+ Read [CONTRIBUTING.md](./CONTRIBUTING.md), fork the repository, create a branch, and open a PR. Discuss ideas on [Discord](https://discord.gg/KZgfyyDVZa).
93
+ > Are you an agent? Run `npx skills add desplega-ai/agent-swarm` or read the [operator skill](./skills/agent-swarm/SKILL.md).
288
94
 
289
95
  ## Star History
290
96
 
291
- <picture>
292
- <source media="(prefers-color-scheme: dark)" srcset="./assets/star-history-dark.svg" />
293
- <source media="(prefers-color-scheme: light)" srcset="./assets/star-history-light.svg" />
294
- <img alt="Star History Chart" src="./assets/star-history-light.svg" />
295
- </picture>
296
-
297
- The charts are generated from timestamped GitHub stargazer data and refreshed weekly through a reviewable pull request.
97
+ <picture><source media="(prefers-color-scheme: dark)" srcset="./assets/star-history-dark.svg" /> <source media="(prefers-color-scheme: light)" srcset="./assets/star-history-light.svg" /> <img alt="Star History Chart" src="./assets/star-history-light.svg" /></picture>
298
98
 
299
99
  ## License
300
100
 
301
- [MIT](./LICENSE) 2025-2026 [desplega.sh](https://desplega.sh)
101
+ [MIT](./LICENSE) · 2025-2026 [desplega.sh](https://desplega.sh)
@@ -29,7 +29,7 @@ import {
29
29
  import {
30
30
  init_package,
31
31
  package_default
32
- } from "./cli-vf5b436q.js";
32
+ } from "./cli-vkp8s27y.js";
33
33
  import {
34
34
  init_secret_scrubber,
35
35
  scrubSecrets
@@ -4369,9 +4369,23 @@ function toolResult(update) {
4369
4369
  function translateAcpSessionUpdate(update) {
4370
4370
  switch (update.sessionUpdate) {
4371
4371
  case "agent_message_chunk":
4372
- return [{ type: "message", role: "assistant", content: contentToText(update.content) }];
4372
+ return [
4373
+ {
4374
+ type: "message",
4375
+ role: "assistant",
4376
+ content: contentToText(update.content),
4377
+ messageId: update.messageId ?? undefined
4378
+ }
4379
+ ];
4373
4380
  case "user_message_chunk":
4374
- return [{ type: "message", role: "user", content: contentToText(update.content) }];
4381
+ return [
4382
+ {
4383
+ type: "message",
4384
+ role: "user",
4385
+ content: contentToText(update.content),
4386
+ messageId: update.messageId ?? undefined
4387
+ }
4388
+ ];
4375
4389
  case "agent_thought_chunk":
4376
4390
  return [
4377
4391
  {
@@ -4607,6 +4621,101 @@ function resolveAcpTarget(config) {
4607
4621
  }
4608
4622
 
4609
4623
  // src/providers/acp-adapter.ts
4624
+ var ACP_LOG_MAX_CHARS = 30000;
4625
+ var ACP_LOG_FIELD_MAX_CHARS = 12000;
4626
+ var ACP_LOG_PREVIEW_MAX_CHARS = 1e4;
4627
+ var CREDENTIAL_HEADER_NAMES = new Set([
4628
+ "authorization",
4629
+ "proxy-authorization",
4630
+ "cookie",
4631
+ "set-cookie",
4632
+ "www-authenticate",
4633
+ "proxy-authenticate",
4634
+ "x-api-key",
4635
+ "api-key",
4636
+ "x-auth-token",
4637
+ "x-access-token",
4638
+ "x-session-token"
4639
+ ]);
4640
+ function isCredentialHeaderName(value) {
4641
+ return CREDENTIAL_HEADER_NAMES.has(value.trim().toLowerCase());
4642
+ }
4643
+ function isCredentialHeader(value) {
4644
+ if (!value || typeof value !== "object" || Array.isArray(value))
4645
+ return false;
4646
+ const name = value.name;
4647
+ return typeof name === "string" && isCredentialHeaderName(name);
4648
+ }
4649
+ function serializeAcpLog(value) {
4650
+ const serialized = JSON.stringify(value, (key, child) => {
4651
+ if (isCredentialHeaderName(key))
4652
+ return;
4653
+ if (key.toLowerCase() === "headers" && Array.isArray(child)) {
4654
+ return child.filter((header) => !isCredentialHeader(header));
4655
+ }
4656
+ if (typeof child !== "string")
4657
+ return child;
4658
+ const scrubbed = scrubSecrets(child);
4659
+ return scrubbed.length > ACP_LOG_FIELD_MAX_CHARS ? `${scrubbed.slice(0, ACP_LOG_FIELD_MAX_CHARS)}… [truncated]` : scrubbed;
4660
+ });
4661
+ if (serialized.length <= ACP_LOG_MAX_CHARS)
4662
+ return serialized;
4663
+ const sanitizedValue = JSON.parse(serialized);
4664
+ const record2 = sanitizedValue && typeof sanitizedValue === "object" && !Array.isArray(sanitizedValue) ? sanitizedValue : undefined;
4665
+ const update = record2 && "update" in record2 && record2.update && typeof record2.update === "object" ? record2.update : undefined;
4666
+ const preview = `${serialized.slice(0, ACP_LOG_PREVIEW_MAX_CHARS)}… [truncated]`;
4667
+ if (record2 && "type" in record2) {
4668
+ const type = record2.type;
4669
+ if (type === "tool_start") {
4670
+ return JSON.stringify({
4671
+ type,
4672
+ toolCallId: boundedAcpLogScalar(record2.toolCallId),
4673
+ toolName: boundedAcpLogScalar(record2.toolName),
4674
+ args: { truncated: true, preview }
4675
+ });
4676
+ }
4677
+ if (type === "tool_end") {
4678
+ const result = record2.result && typeof record2.result === "object" && !Array.isArray(record2.result) ? record2.result : undefined;
4679
+ return JSON.stringify({
4680
+ type,
4681
+ toolCallId: boundedAcpLogScalar(record2.toolCallId),
4682
+ toolName: boundedAcpLogScalar(record2.toolName),
4683
+ result: {
4684
+ status: boundedAcpLogScalar(result?.status),
4685
+ truncated: true,
4686
+ preview
4687
+ }
4688
+ });
4689
+ }
4690
+ if (type === "custom") {
4691
+ return JSON.stringify({
4692
+ type,
4693
+ name: boundedAcpLogScalar(record2.name),
4694
+ data: { truncated: true, preview }
4695
+ });
4696
+ }
4697
+ }
4698
+ const summary = {
4699
+ type: "acp_log_truncated",
4700
+ originalType: record2 && "type" in record2 && typeof record2.type === "string" ? record2.type : undefined,
4701
+ sessionId: record2 && "sessionId" in record2 && typeof record2.sessionId === "string" ? record2.sessionId.slice(0, 500) : undefined,
4702
+ sessionUpdate: update && "sessionUpdate" in update && typeof update.sessionUpdate === "string" ? update.sessionUpdate : undefined,
4703
+ preview
4704
+ };
4705
+ const bounded = JSON.stringify(summary);
4706
+ if (bounded.length <= ACP_LOG_MAX_CHARS)
4707
+ return bounded;
4708
+ return JSON.stringify({
4709
+ type: "acp_log_truncated",
4710
+ originalType: summary.originalType?.slice(0, 500),
4711
+ sessionId: summary.sessionId,
4712
+ sessionUpdate: summary.sessionUpdate?.slice(0, 500)
4713
+ });
4714
+ }
4715
+ function boundedAcpLogScalar(value) {
4716
+ return typeof value === "string" ? value.slice(0, 500) : value;
4717
+ }
4718
+
4610
4719
  class SwarmAcpClient {
4611
4720
  emit;
4612
4721
  constructor(emit) {
@@ -4619,6 +4728,7 @@ class SwarmAcpClient {
4619
4728
  return { outcome: { outcome: "selected", optionId: selected.optionId } };
4620
4729
  }
4621
4730
  async sessionUpdate(params) {
4731
+ this.emit({ type: "raw_log", content: serializeAcpLog(params) });
4622
4732
  for (const event of translateAcpSessionNotification(params)) {
4623
4733
  this.emit(event);
4624
4734
  }
@@ -4687,6 +4797,15 @@ class ACPSession {
4687
4797
  if (event.type === "message" && event.role === "assistant") {
4688
4798
  this.output += event.content;
4689
4799
  }
4800
+ this.emitDirect(event);
4801
+ if (event.type !== "raw_log" && event.type !== "raw_stderr") {
4802
+ this.emitDirect({
4803
+ type: "raw_log",
4804
+ content: serializeAcpLog(event)
4805
+ });
4806
+ }
4807
+ }
4808
+ emitDirect(event) {
4690
4809
  if (this.listeners.size === 0) {
4691
4810
  this.pendingEvents.push(event);
4692
4811
  return;
@@ -4784,7 +4903,13 @@ class ACPAdapter {
4784
4903
  stderr: "pipe"
4785
4904
  }));
4786
4905
  let session = null;
4787
- const client2 = new SwarmAcpClient((event) => session?.emitFromAcp(event));
4906
+ const preSessionEvents = [];
4907
+ const client2 = new SwarmAcpClient((event) => {
4908
+ if (session)
4909
+ session.emitFromAcp(event);
4910
+ else
4911
+ preSessionEvents.push(event);
4912
+ });
4788
4913
  const stream = ndJsonStream2(fileSinkWritableStream(proc.stdin), proc.stdout);
4789
4914
  const connection = new ClientSideConnection(() => client2, stream);
4790
4915
  try {
@@ -4815,6 +4940,8 @@ class ACPAdapter {
4815
4940
  target: target.target,
4816
4941
  configOptions: sanitizeAcpConfigOptions(configOptions)
4817
4942
  });
4943
+ for (const event of preSessionEvents)
4944
+ session.emitFromAcp(event);
4818
4945
  return session;
4819
4946
  } catch (err) {
4820
4947
  await terminateProcessGroup(proc.pid);
@@ -4861,10 +4988,10 @@ async function applyConfiguredOptions(connection, sessionId, advertised, configu
4861
4988
  function sanitizeAcpConfigOptions(options) {
4862
4989
  return options.map((option) => {
4863
4990
  const common = {
4864
- id: option.id,
4865
- name: option.name,
4866
- description: option.description,
4867
- category: option.category
4991
+ id: scrubSecrets(option.id),
4992
+ name: scrubSecrets(option.name),
4993
+ description: option.description == null ? option.description : scrubSecrets(option.description),
4994
+ category: option.category == null ? option.category : scrubSecrets(option.category)
4868
4995
  };
4869
4996
  if (option.type === "boolean") {
4870
4997
  return { ...common, type: "boolean", currentValue: option.currentValue };
@@ -4872,16 +4999,20 @@ function sanitizeAcpConfigOptions(options) {
4872
4999
  return {
4873
5000
  ...common,
4874
5001
  type: "select",
4875
- currentValue: option.currentValue,
5002
+ currentValue: scrubSecrets(option.currentValue),
4876
5003
  options: option.options.map((entry) => ("group" in entry) ? {
4877
- group: entry.group,
4878
- name: entry.name,
5004
+ group: scrubSecrets(entry.group),
5005
+ name: entry.name == null ? entry.name : scrubSecrets(entry.name),
4879
5006
  options: entry.options.map(({ value, name, description }) => ({
4880
- value,
4881
- name,
4882
- description
5007
+ value: scrubSecrets(value),
5008
+ name: scrubSecrets(name),
5009
+ description: description == null ? description : scrubSecrets(description)
4883
5010
  }))
4884
- } : { value: entry.value, name: entry.name, description: entry.description })
5011
+ } : {
5012
+ value: scrubSecrets(entry.value),
5013
+ name: scrubSecrets(entry.name),
5014
+ description: entry.description == null ? entry.description : scrubSecrets(entry.description)
5015
+ })
4885
5016
  };
4886
5017
  });
4887
5018
  }
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  resolveSlackUserId
3
- } from "./cli-pw4gxcx1.js";
4
- import"./cli-vp3sksy6.js";
3
+ } from "./cli-800qgp57.js";
4
+ import"./cli-kw28xkeg.js";
5
5
  import {
6
6
  createTaskWithSiblingAwareness
7
- } from "./cli-kfrk073c.js";
7
+ } from "./cli-e5ryp8dw.js";
8
8
  import {
9
9
  buildCancelledBlocks,
10
10
  ensureSlackThreadTree,
@@ -12,7 +12,7 @@ import {
12
12
  getAgentEmoji,
13
13
  getTaskLink,
14
14
  isSlackRenderV2Enabled
15
- } from "./cli-s0w91tq3.js";
15
+ } from "./cli-a4z7ggz9.js";
16
16
  import"./cli-qf9kpsve.js";
17
17
  import"./cli-g2p9bd1z.js";
18
18
  import {
@@ -23,17 +23,18 @@ import {
23
23
  init_context_key,
24
24
  init_db,
25
25
  slackContextKey
26
- } from "./cli-a6297e83.js";
27
- import"./cli-d2epf5ae.js";
26
+ } from "./cli-ddp558gj.js";
27
+ import"./cli-r3bxcgrj.js";
28
28
  import"./cli-87zrjxdb.js";
29
29
  import"./cli-a1rrkrb4.js";
30
30
  import"./cli-xbyjkasx.js";
31
31
  import"./cli-nanaxrz6.js";
32
32
  import"./cli-s35981d0.js";
33
33
  import"./cli-pqv5gvyf.js";
34
- import"./cli-vf5b436q.js";
34
+ import"./cli-vkp8s27y.js";
35
35
  import"./cli-mkq1rk7b.js";
36
- import"./cli-qntkxysp.js";
36
+ import"./cli-g5rnamvz.js";
37
+ import"./cli-5fqjxazz.js";
37
38
  import"./cli-497b685t.js";
38
39
  import"./cli-pq2ee5ja.js";
39
40
 
@@ -3,20 +3,21 @@ import {
3
3
  initSlackApp,
4
4
  startSlackApp,
5
5
  stopSlackApp
6
- } from "./cli-s0w91tq3.js";
6
+ } from "./cli-a4z7ggz9.js";
7
7
  import"./cli-qf9kpsve.js";
8
8
  import"./cli-g2p9bd1z.js";
9
- import"./cli-a6297e83.js";
10
- import"./cli-d2epf5ae.js";
9
+ import"./cli-ddp558gj.js";
10
+ import"./cli-r3bxcgrj.js";
11
11
  import"./cli-87zrjxdb.js";
12
12
  import"./cli-a1rrkrb4.js";
13
13
  import"./cli-xbyjkasx.js";
14
14
  import"./cli-nanaxrz6.js";
15
15
  import"./cli-s35981d0.js";
16
16
  import"./cli-pqv5gvyf.js";
17
- import"./cli-vf5b436q.js";
17
+ import"./cli-vkp8s27y.js";
18
18
  import"./cli-mkq1rk7b.js";
19
- import"./cli-qntkxysp.js";
19
+ import"./cli-g5rnamvz.js";
20
+ import"./cli-5fqjxazz.js";
20
21
  import"./cli-497b685t.js";
21
22
  import"./cli-pq2ee5ja.js";
22
23
  export {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BROWSER_SDK_JS
3
- } from "./cli-ppwm8c6e.js";
3
+ } from "./cli-2daksqps.js";
4
4
  import {
5
5
  getApiKey
6
6
  } from "./cli-f14fvzag.js";