@desplega.ai/agent-swarm 2.13.1 → 2.13.3

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 (229) hide show
  1. package/README.md +1 -1
  2. package/dist/acp-adapter-t2q6nsqv.js +17 -0
  3. package/dist/{acp-targets-n7vm5atw.js → acp-targets-k8xs4tj8.js} +7 -7
  4. package/dist/{actions-hq6wp9xv.js → actions-pg5fxjer.js} +25 -25
  5. package/dist/{agent-fs-provision-y0qc1rdd.js → agent-fs-provision-vbk3fppw.js} +4 -4
  6. package/dist/{amp-adapter-1qqs6h91.js → amp-adapter-adbhxsz9.js} +2 -2
  7. package/dist/{app-7m4z44rv.js → app-b267ggx1.js} +8 -8
  8. package/dist/{approval-notifications-8sr41gjx.js → approval-notifications-evc1a9z5.js} +9 -9
  9. package/dist/{assistant-hkczwfv6.js → assistant-wgz2ab84.js} +26 -26
  10. package/dist/{boot-args-schema-8025snev.js → boot-args-schema-6tpk28j4.js} +1 -1
  11. package/dist/{boot-reembed-15m87nr1.js → boot-reembed-ankp369c.js} +1 -1
  12. package/dist/{boot-reembed-4bbpxjh1.js → boot-reembed-r1zyvefv.js} +1 -1
  13. package/dist/{boot-scrub-sweep-eajr97e9.js → boot-scrub-sweep-cgb6r5bd.js} +2 -2
  14. package/dist/{boot-seeds-9cwy39jx.js → boot-seeds-bjceqg7b.js} +4 -4
  15. package/dist/{claude-adapter-g61wa4rt.js → claude-adapter-knztdnff.js} +9 -6
  16. package/dist/{claude-managed-adapter-znkk0prm.js → claude-managed-adapter-qwejzqkk.js} +3 -3
  17. package/dist/{claude-managed-setup-f1wndkr2.js → claude-managed-setup-0vgz4d1j.js} +4 -4
  18. package/dist/{claude-sdk-session-687xzf21.js → claude-sdk-session-c3g6dv0g.js} +11984 -11775
  19. package/dist/{cli-4mj5g29m.js → cli-0j4qmc80.js} +7 -7
  20. package/dist/{cli-fn8aj7gb.js → cli-1606qw3n.js} +98 -71
  21. package/dist/{cli-w41bvvms.js → cli-1gnf5c7x.js} +1 -1
  22. package/dist/{cli-aebswqmz.js → cli-1wew39p0.js} +15 -15
  23. package/dist/{cli-0fx95c06.js → cli-268b3dgn.js} +2 -2
  24. package/dist/cli-2ap1the6.js +11 -0
  25. package/dist/{cli-w6c6dj91.js → cli-4dyhzhpx.js} +1 -1
  26. package/dist/{cli-grcc2h2g.js → cli-55fqpd9q.js} +8 -8
  27. package/dist/{cli-p7g7wd9n.js → cli-61fzwtjk.js} +7 -7
  28. package/dist/{cli-zaate0rd.js → cli-61p7ty8d.js} +2 -2
  29. package/dist/{cli-cp0m07wb.js → cli-7fa6yv98.js} +2 -2
  30. package/dist/{cli-5v6b2am8.js → cli-7kv5d674.js} +7 -7
  31. package/dist/{cli-6r1dwegd.js → cli-80d5g0fa.js} +2 -2
  32. package/dist/{cli-0xwb7zpt.js → cli-88np9va3.js} +1 -1
  33. package/dist/{cli-1b5axkt1.js → cli-8m6gqnf1.js} +2 -2
  34. package/dist/{cli-0a336ze7.js → cli-8pnawt98.js} +3 -3
  35. package/dist/{cli-7ewre3dm.js → cli-8sayvj48.js} +2 -2
  36. package/dist/{cli-yeh3g1q6.js → cli-9gmkw6xn.js} +53 -32
  37. package/dist/{cli-h03j6je3.js → cli-a21cwm89.js} +2 -2
  38. package/dist/{cli-s6fhqbz1.js → cli-aytna2fm.js} +1 -1
  39. package/dist/{cli-84xtgbn6.js → cli-b0m3bg0f.js} +100 -2
  40. package/dist/{cli-mwxez0pz.js → cli-b768ek79.js} +1 -1
  41. package/dist/{cli-9xx36trj.js → cli-bh53ppqm.js} +2 -2
  42. package/dist/{cli-1carhg8g.js → cli-czeh7x13.js} +3 -3
  43. package/dist/{cli-cd9acnvd.js → cli-djwt4mtn.js} +71 -5
  44. package/dist/{cli-sfajkbd7.js → cli-dq30fq3q.js} +2 -2
  45. package/dist/{cli-a8ts6x1n.js → cli-dw43pnzp.js} +5 -5
  46. package/dist/{cli-h9bejmkf.js → cli-e4gx499y.js} +52 -29
  47. package/dist/{cli-t90k0phh.js → cli-ea367bdn.js} +32 -23
  48. package/dist/{cli-cmgdptmx.js → cli-ef590376.js} +29 -5
  49. package/dist/{cli-8rbkw18r.js → cli-fbmgpt72.js} +2 -2
  50. package/dist/{cli-tzzas8rb.js → cli-g4dhd3pr.js} +2 -2
  51. package/dist/{cli-snypfjgj.js → cli-gc715jrc.js} +1 -1
  52. package/dist/{cli-c0tyzt73.js → cli-gkjw33x5.js} +1 -1
  53. package/dist/{cli-z6m6xzxt.js → cli-grk77aen.js} +26 -5
  54. package/dist/{cli-hs3mqswp.js → cli-gxqwm3k3.js} +5 -5
  55. package/dist/{cli-4h90xaet.js → cli-h3drhntp.js} +1 -1
  56. package/dist/{cli-qn79645p.js → cli-h9d3sdnc.js} +1 -1
  57. package/dist/{cli-byxsctca.js → cli-hd2a204w.js} +6 -6
  58. package/dist/{cli-1dr5at77.js → cli-hhb8kbwd.js} +12 -12
  59. package/dist/{cli-zvpkrgsc.js → cli-hpxcfvdm.js} +3 -3
  60. package/dist/{cli-cqxwjb93.js → cli-hxj888w3.js} +1 -1
  61. package/dist/{cli-82j36f2m.js → cli-jjzxsk47.js} +9 -3
  62. package/dist/{cli-13t0smbk.js → cli-ka4tqjzd.js} +185 -58
  63. package/dist/{cli-jhtvt7gn.js → cli-kh973792.js} +3 -3
  64. package/dist/{cli-x5yb8zc8.js → cli-kwm1bek7.js} +1 -1
  65. package/dist/{cli-bjmq14k9.js → cli-mgr3gatr.js} +4 -4
  66. package/dist/{cli-c8kqmzzf.js → cli-nbawx3s0.js} +2 -2
  67. package/dist/{cli-04103ryh.js → cli-ppf9ap9n.js} +1 -1
  68. package/dist/{cli-dd57p1gd.js → cli-pzsedyb0.js} +4 -4
  69. package/dist/{cli-32xndx6b.js → cli-r6xnchva.js} +2 -2
  70. package/dist/{cli-4tbvndmm.js → cli-r8ddn0hf.js} +1 -1
  71. package/dist/{cli-y6qqbpwc.js → cli-snwz16eg.js} +1 -1
  72. package/dist/{cli-w24f3j49.js → cli-sy2ge2ye.js} +7 -6
  73. package/dist/{cli-3m8vqehw.js → cli-syqcny89.js} +3 -3
  74. package/dist/{cli-qx1dwrr5.js → cli-tjf1bh1v.js} +2 -2
  75. package/dist/{cli-xhkek467.js → cli-v1v49t36.js} +28 -2
  76. package/dist/{cli-cn6fpa1p.js → cli-v8rpjrnx.js} +1 -1
  77. package/dist/{cli-mmw2sjaf.js → cli-vgh5adn9.js} +5 -5
  78. package/dist/{cli-3zyme1wt.js → cli-w24741sm.js} +3 -3
  79. package/dist/{cli-gq6qhmrr.js → cli-wsnradtk.js} +3 -3
  80. package/dist/{cli-nk8swfpx.js → cli-wtffytm8.js} +3 -3
  81. package/dist/{cli-0m77n7ej.js → cli-xc8m5cjn.js} +54 -12
  82. package/dist/{cli-8cmjkbvj.js → cli-y0q92v4r.js} +2 -2
  83. package/dist/{cli-gedf48yw.js → cli-y754psdt.js} +4 -4
  84. package/dist/cli.js +19 -18
  85. package/dist/{codex-adapter-ysfg6ty3.js → codex-adapter-493vb8cv.js} +5 -5
  86. package/dist/{codex-hook-c0nvm30r.js → codex-hook-ej8hn6z5.js} +9 -2
  87. package/dist/{codex-session-runner-823scr6g.js → codex-session-runner-ps5m4z1g.js} +5 -5
  88. package/dist/{commands-5rbm07fz.js → commands-shktk0b8.js} +3 -3
  89. package/dist/{controllers-connect-34jzhfft.js → controllers-connect-yft057ws.js} +24 -24
  90. package/dist/core-nheayfgm.js +42 -0
  91. package/dist/{cursor-adapter-w1681kp1.js → cursor-adapter-8fpm4dng.js} +1 -1
  92. package/dist/{db-6bkgbfwk.js → db-0ezhdhz5.js} +3 -3
  93. package/dist/{db-hcj16x7z.js → db-84pz2w5c.js} +2 -2
  94. package/dist/{dispatcher-jgjqrfzv.js → dispatcher-h2rz69f6.js} +23 -23
  95. package/dist/{easter-egg-3d-w17nsny6.js → easter-egg-3d-m41ad78v.js} +1 -1
  96. package/dist/{embedding-space-v06fwy7b.js → embedding-space-yam9zwzj.js} +6 -6
  97. package/dist/{embeddings-g50dxea4.js → embeddings-g2be0y8q.js} +1 -1
  98. package/dist/{execute-1n36haw1.js → execute-hhdejgzf.js} +1 -1
  99. package/dist/{external-channel-43tv8pg6.js → external-channel-kjt2yzfj.js} +2 -2
  100. package/dist/fx-adapter-8g7xsp8q.js +20 -0
  101. package/dist/{grok-adapter-my5j8mdf.js → grok-adapter-ztk2zkz1.js} +9 -9
  102. package/dist/handlers-9ywssz71.js +41 -0
  103. package/dist/{heartbeat-sf3nk937.js → heartbeat-2e5jdexj.js} +25 -25
  104. package/dist/{hook-dqph1e05.js → hook-34s8cmgn.js} +9 -6
  105. package/dist/{hook-m1m9dm6w.js → hook-acg9saz7.js} +8 -5
  106. package/dist/{http-w0th1cz9.js → http-ra2zr2f8.js} +304 -111
  107. package/dist/{index-pb03vans.js → index-2z1z7qx6.js} +26 -26
  108. package/dist/{index-p2f5xg64.js → index-3j803vnb.js} +36259 -34299
  109. package/dist/index-6mgbdtv1.js +44 -0
  110. package/dist/{index-e8pz8qdg.js → index-7dgxveck.js} +2 -2
  111. package/dist/{index-gkpfgpg7.js → index-93bw5wds.js} +1 -1
  112. package/dist/{index-c0e8en64.js → index-9q42cr54.js} +1 -1
  113. package/dist/{index-ffba0z8q.js → index-9r4j0a60.js} +28 -18
  114. package/dist/index-hqdsn2t2.js +39 -0
  115. package/dist/{index-k8ajc0g0.js → index-maddg9ys.js} +1 -1
  116. package/dist/{index-y4vd4mhn.js → index-mbpxhc4w.js} +1 -1
  117. package/dist/index-rz8ve510.js +569 -0
  118. package/dist/index-st231bqv.js +40 -0
  119. package/dist/{index-ez823q84.js → index-ym9fgxad.js} +1 -1
  120. package/dist/{keepalive-2v06q2e8.js → keepalive-vjnnqbkm.js} +4 -4
  121. package/dist/lead-mk0xkth2.js +82 -0
  122. package/dist/{maintenance-vx7vjhhy.js → maintenance-px2g599e.js} +1 -1
  123. package/dist/{oauth-refresh-sweep-g06k4bza.js → oauth-refresh-sweep-nkykf09m.js} +3 -3
  124. package/dist/{object-webhooks-3dzdq4fm.js → object-webhooks-gt9xnq21.js} +7 -7
  125. package/dist/{onboard-232pazny.js → onboard-1f134p65.js} +3 -3
  126. package/dist/{opencode-adapter-t0paqbh8.js → opencode-adapter-94976yab.js} +6 -6
  127. package/dist/{otel-impl-kmpkyp4y.js → otel-impl-5d4p2fqs.js} +1 -1
  128. package/dist/{pending-x0z3vx1x.js → pending-vkk0vx6n.js} +24 -24
  129. package/dist/{pi-mono-adapter-7pmypn6d.js → pi-mono-adapter-cyzdv5er.js} +11 -11
  130. package/dist/{pricing-refresh-ytjmtyd7.js → pricing-refresh-jtmjwss9.js} +2 -2
  131. package/dist/{rbac-roles-xyaxekh3.js → rbac-roles-1fvmdyeb.js} +2 -2
  132. package/dist/{rbac-roles-fgm5mxr2.js → rbac-roles-yd1fgpsn.js} +3 -3
  133. package/dist/{render-v2-ws972g4r.js → render-v2-kb5s3vx4.js} +8 -8
  134. package/dist/{resume-m6mjzhkp.js → resume-z1vs44n5.js} +11 -11
  135. package/dist/{runtime-zzpc0c8a.js → runtime-gk6ct7r7.js} +1 -1
  136. package/dist/{session-access-vp35xs91.js → session-access-nz6nre4d.js} +5 -5
  137. package/dist/{session-source-backfill-p73e8zbe.js → session-source-backfill-wb60zjkd.js} +1 -1
  138. package/dist/{setup-r4kd7rxg.js → setup-2x8g8j4s.js} +1 -1
  139. package/dist/thread-buffer-d50rqpev.js +42 -0
  140. package/dist/{tree-visibility-07h2tbs2.js → tree-visibility-ts3z30kw.js} +2 -2
  141. package/dist/{user-merge-jobs-96vg9rpe.js → user-merge-jobs-zetg26e0.js} +3 -3
  142. package/dist/{virtual-modules-vgn3f2x4.js → virtual-modules-674fka8x.js} +3 -3
  143. package/dist/{work-objects-74hbcx3e.js → work-objects-w52yyjxm.js} +26 -26
  144. package/dist/worker-662x1vse.js +82 -0
  145. package/dist/{worker-follow-up-ezavwn5d.js → worker-follow-up-dyfxyjbj.js} +23 -23
  146. package/openapi.json +6 -2
  147. package/package.json +7 -6
  148. package/src/be/migrations/341_user_token_expiry.sql +4 -0
  149. package/src/be/scripts/run-credential.ts +55 -1
  150. package/src/be/scripts/typecheck.ts +4 -4
  151. package/src/be/scripts/user-code-mode.ts +160 -0
  152. package/src/be/users.ts +48 -7
  153. package/src/commands/onboard/agent-fs-version.ts +1 -1
  154. package/src/commands/runner.ts +62 -6
  155. package/src/hooks/codex-hook.ts +15 -4
  156. package/src/hooks/hook.ts +7 -0
  157. package/src/http/script-connection-proxy.ts +18 -6
  158. package/src/http/scripts.ts +2 -11
  159. package/src/http/session-cost-recompute.ts +3 -1
  160. package/src/http/session-data.ts +3 -0
  161. package/src/http/users.ts +1 -0
  162. package/src/integrations/chat-sdk/adapters.ts +29 -0
  163. package/src/integrations/chat-sdk/limits.ts +3 -0
  164. package/src/integrations/chat-sdk/rocketchat/README.md +8 -0
  165. package/src/integrations/chat-sdk/rocketchat/index.ts +790 -0
  166. package/src/integrations/chat-sdk/rocketchat/markdown.ts +210 -0
  167. package/src/integrations/chat-sdk/rocketchat/types.ts +249 -0
  168. package/src/integrations/chat-sdk/runtime.ts +11 -5
  169. package/src/integrations/chat-sdk/schema.ts +37 -3
  170. package/src/integrations/chat-sdk/status.ts +9 -0
  171. package/src/prompts/base-prompt.ts +1 -1
  172. package/src/prompts/session-templates.ts +1 -1
  173. package/src/providers/acp-targets.ts +2 -2
  174. package/src/providers/amp-adapter.ts +1 -1
  175. package/src/providers/claude-adapter.ts +21 -1
  176. package/src/providers/claude-sdk-session.ts +22 -3
  177. package/src/providers/claude-session-events.ts +76 -1
  178. package/src/providers/cursor-adapter.ts +1 -1
  179. package/src/providers/fx-adapter.ts +2 -2
  180. package/src/providers/pricing-sources.md +3 -0
  181. package/src/providers/types.ts +13 -0
  182. package/src/rbac/legacy-policy.ts +1 -0
  183. package/src/rbac/permissions.ts +4 -0
  184. package/src/scripts-runtime/executors/native.ts +225 -67
  185. package/src/scripts-runtime/mcp-client.ts +2 -1
  186. package/src/scripts-runtime/swarm-sdk.ts +2 -1
  187. package/src/scripts-runtime/types/stdlib.d.ts +4 -4
  188. package/src/scripts-runtime/types/swarm-sdk.d.ts +4 -4
  189. package/src/server-user.ts +98 -0
  190. package/src/slack/render-v2.ts +27 -7
  191. package/src/tests/base-prompt.test.ts +6 -2
  192. package/src/tests/chat-sdk-rocketchat-vendored.test.ts +67 -0
  193. package/src/tests/chat-sdk-status-route.test.ts +13 -1
  194. package/src/tests/claude-adapter.test.ts +115 -0
  195. package/src/tests/codex-app-server.test.ts +4 -6
  196. package/src/tests/fixtures/fx/acp-updates-recorded.jsonl +1 -1
  197. package/src/tests/internal-ai/complete-structured.test.ts +105 -0
  198. package/src/tests/internal-ai/credentials.test.ts +149 -0
  199. package/src/tests/internal-ai/task-title.test.ts +78 -0
  200. package/src/tests/mcp-input-caps.test.ts +16 -11
  201. package/src/tests/mcp-user-route.test.ts +10 -1
  202. package/src/tests/runner-slot-reconcile.test.ts +102 -0
  203. package/src/tests/script-connections-mcp.test.ts +14 -10
  204. package/src/tests/script-connections-sql.test.ts +6 -2
  205. package/src/tests/script-connections.test.ts +2 -0
  206. package/src/tests/slack-render-v2.test.ts +85 -0
  207. package/src/tools/script-common.ts +37 -22
  208. package/src/tools/script-query-types.ts +1 -1
  209. package/src/tools/script-run.ts +1 -1
  210. package/src/tools/script-search.ts +12 -10
  211. package/src/tools/utils.ts +7 -1
  212. package/src/types.ts +2 -1
  213. package/src/utils/internal-ai/complete-structured.ts +36 -5
  214. package/src/utils/internal-ai/credentials.ts +78 -2
  215. package/src/utils/internal-ai/models.ts +37 -1
  216. package/src/utils/internal-ai/task-title.ts +31 -1
  217. package/templates/skills/chat-sdk/content.md +2 -2
  218. package/templates/skills/swarm-docs/content.md +10 -0
  219. package/dist/acp-adapter-xtj40wd8.js +0 -17
  220. package/dist/core-kdehq26g.js +0 -42
  221. package/dist/fx-adapter-bvh05t4a.js +0 -20
  222. package/dist/handlers-wyymeeqh.js +0 -41
  223. package/dist/index-22khdtby.js +0 -44
  224. package/dist/index-np0582ac.js +0 -40
  225. package/dist/index-vgkrj1jt.js +0 -39
  226. package/dist/lead-55z813ng.js +0 -79
  227. package/dist/thread-buffer-cm2nzq6t.js +0 -42
  228. package/dist/worker-5pn2vzx6.js +0 -79
  229. /package/dist/{cli-m4ejz4nj.js → cli-cah298e5.js} +0 -0
@@ -0,0 +1,82 @@
1
+ import"./cli-e4gx499y.js";
2
+ import"./cli-tjf1bh1v.js";
3
+ import"./cli-fbmgpt72.js";
4
+ import"./cli-h3drhntp.js";
5
+ import"./cli-vx9acp12.js";
6
+ import"./cli-hxj888w3.js";
7
+ import"./cli-4dyhzhpx.js";
8
+ import"./cli-vr4eyq6p.js";
9
+ import"./cli-r8ddn0hf.js";
10
+ import"./cli-ea367bdn.js";
11
+ import"./cli-gxqwm3k3.js";
12
+ import"./cli-hpxcfvdm.js";
13
+ import {
14
+ getEnabledCapabilities,
15
+ init_server
16
+ } from "./cli-1606qw3n.js";
17
+ import"./cli-y260hgep.js";
18
+ import"./cli-268b3dgn.js";
19
+ import"./cli-dw43pnzp.js";
20
+ import"./cli-g4dhd3pr.js";
21
+ import"./cli-h9d3sdnc.js";
22
+ import {
23
+ runAgent
24
+ } from "./cli-9gmkw6xn.js";
25
+ import"./cli-vdfngx2g.js";
26
+ import"./cli-8m6gqnf1.js";
27
+ import"./cli-77cd6gy8.js";
28
+ import"./cli-zkbz8m2q.js";
29
+ import"./cli-hv3820ez.js";
30
+ import"./cli-88np9va3.js";
31
+ import"./cli-nbawx3s0.js";
32
+ import"./cli-6p8p2e6r.js";
33
+ import"./cli-2ap1the6.js";
34
+ import"./cli-kwm1bek7.js";
35
+ import"./cli-ef590376.js";
36
+ import"./cli-wsnradtk.js";
37
+ import"./cli-2v4xxnx2.js";
38
+ import"./cli-d82btycs.js";
39
+ import"./cli-0726awxw.js";
40
+ import"./cli-vgh5adn9.js";
41
+ import"./cli-djwt4mtn.js";
42
+ import"./cli-snxhtehz.js";
43
+ import"./cli-cah298e5.js";
44
+ import"./cli-r6xnchva.js";
45
+ import"./cli-at67kvnp.js";
46
+ import"./cli-kr5tjjtz.js";
47
+ import"./cli-pzsedyb0.js";
48
+ import"./cli-y754psdt.js";
49
+ import"./cli-je587f74.js";
50
+ import"./cli-t25rq8mg.js";
51
+ import"./cli-7fa6yv98.js";
52
+ import"./cli-xc8m5cjn.js";
53
+ import"./cli-7kv5d674.js";
54
+ import"./cli-syqcny89.js";
55
+ import"./cli-bh53ppqm.js";
56
+ import"./cli-61p7ty8d.js";
57
+ import"./cli-ka4tqjzd.js";
58
+ import"./cli-8sayvj48.js";
59
+ import"./cli-w24741sm.js";
60
+ import"./cli-snwz16eg.js";
61
+ import"./cli-v8rpjrnx.js";
62
+ import"./cli-hhb8kbwd.js";
63
+ import"./cli-b0m3bg0f.js";
64
+ import"./cli-1gnf5c7x.js";
65
+ import"./cli-gkjw33x5.js";
66
+ import"./cli-v41kn3cd.js";
67
+ import"./cli-grk77aen.js";
68
+
69
+ // src/commands/worker.ts
70
+ init_server();
71
+ var workerConfig = {
72
+ role: "worker",
73
+ defaultPrompt: "/start-worker",
74
+ metadataType: "worker_metadata",
75
+ capabilities: getEnabledCapabilities()
76
+ };
77
+ async function runWorker(opts) {
78
+ return runAgent(workerConfig, opts);
79
+ }
80
+ export {
81
+ runWorker
82
+ };
@@ -11,32 +11,32 @@ import {
11
11
  createRerouteDecisionTask2,
12
12
  createPoolStarvationDecisionTask2,
13
13
  init_worker_follow_up
14
- } from "./cli-fn8aj7gb.js";
15
- import"./cli-8rbkw18r.js";
16
- import"./cli-4h90xaet.js";
17
- import"./cli-13t0smbk.js";
18
- import"./cli-7ewre3dm.js";
19
- import"./cli-3zyme1wt.js";
20
- import"./cli-y6qqbpwc.js";
14
+ } from "./cli-1606qw3n.js";
15
+ import"./cli-fbmgpt72.js";
16
+ import"./cli-h3drhntp.js";
17
+ import"./cli-ka4tqjzd.js";
18
+ import"./cli-8sayvj48.js";
19
+ import"./cli-w24741sm.js";
20
+ import"./cli-snwz16eg.js";
21
21
  import"./cli-y260hgep.js";
22
- import"./cli-cn6fpa1p.js";
23
- import"./cli-zvpkrgsc.js";
24
- import"./cli-1dr5at77.js";
25
- import"./cli-hs3mqswp.js";
26
- import"./cli-a8ts6x1n.js";
27
- import"./cli-0fx95c06.js";
28
- import"./cli-t90k0phh.js";
29
- import"./cli-cqxwjb93.js";
30
- import"./cli-4tbvndmm.js";
31
- import"./cli-84xtgbn6.js";
22
+ import"./cli-v8rpjrnx.js";
23
+ import"./cli-hpxcfvdm.js";
24
+ import"./cli-hhb8kbwd.js";
25
+ import"./cli-gxqwm3k3.js";
26
+ import"./cli-dw43pnzp.js";
27
+ import"./cli-268b3dgn.js";
28
+ import"./cli-ea367bdn.js";
29
+ import"./cli-4dyhzhpx.js";
30
+ import"./cli-hxj888w3.js";
31
+ import"./cli-r8ddn0hf.js";
32
+ import"./cli-b0m3bg0f.js";
32
33
  import"./cli-vr4eyq6p.js";
33
- import"./cli-w6c6dj91.js";
34
- import"./cli-w41bvvms.js";
34
+ import"./cli-1gnf5c7x.js";
35
35
  import"./cli-vx9acp12.js";
36
- import"./cli-c0tyzt73.js";
37
- import"./cli-qx1dwrr5.js";
38
- import"./cli-z6m6xzxt.js";
39
- import"./cli-h9bejmkf.js";
36
+ import"./cli-gkjw33x5.js";
37
+ import"./cli-tjf1bh1v.js";
38
+ import"./cli-grk77aen.js";
39
+ import"./cli-e4gx499y.js";
40
40
  init_worker_follow_up();
41
41
 
42
42
  export {
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.13.1",
5
+ "version": "2.13.3",
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": [
@@ -27402,7 +27402,8 @@
27402
27402
  "telegram",
27403
27403
  "slack",
27404
27404
  "discord",
27405
- "teams"
27405
+ "teams",
27406
+ "rocketchat"
27406
27407
  ]
27407
27408
  },
27408
27409
  "configured": {
@@ -56242,6 +56243,9 @@
56242
56243
  "harnessCostBilled": {
56243
56244
  "type": "boolean"
56244
56245
  },
56246
+ "estimated": {
56247
+ "type": "boolean"
56248
+ },
56245
56249
  "taskId": {
56246
56250
  "type": "string"
56247
56251
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@desplega.ai/agent-swarm",
3
- "version": "2.13.1",
3
+ "version": "2.13.3",
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",
@@ -207,19 +207,20 @@
207
207
  "bun": ">=1.3.12"
208
208
  },
209
209
  "dependencies": {
210
- "@agentclientprotocol/sdk": "2.6.0",
210
+ "@agentclientprotocol/sdk": "2.7.0",
211
211
  "@ai-sdk/openai": "^3.0.41",
212
- "@anthropic-ai/claude-agent-sdk": "0.3.323",
212
+ "@anthropic-ai/claude-agent-sdk": "0.3.325",
213
213
  "@anthropic-ai/sdk": "^1.8.0",
214
214
  "@asteasolutions/zod-to-openapi": "^8.0.0",
215
215
  "@aws-sdk/client-bedrock": "3.1048.0",
216
216
  "@boxd-sh/sdk": "0.2.20",
217
217
  "@chat-adapter/discord": "4.45.0",
218
+ "@chat-adapter/shared": "4.45.0",
218
219
  "@chat-adapter/slack": "4.45.0",
219
220
  "@chat-adapter/teams": "4.45.0",
220
221
  "@chat-adapter/telegram": "4.45.0",
221
- "@cursor/sdk": "1.3.1",
222
- "@desplega.ai/agent-fs-just-bash": "0.18.27",
222
+ "@cursor/sdk": "1.4.0",
223
+ "@desplega.ai/agent-fs-just-bash": "0.18.29",
223
224
  "@desplega.ai/business-use": "^0.4.2",
224
225
  "@earendil-works/pi-agent-core": "^1.5.2",
225
226
  "@earendil-works/pi-ai": "^1.5.2",
@@ -231,7 +232,7 @@
231
232
  "@json-render/core": "0.22.0",
232
233
  "@linear/sdk": "^77.0.0",
233
234
  "@modelcontextprotocol/sdk": "1.32.1",
234
- "@openai/codex": "0.167.2",
235
+ "@openai/codex": "0.169.0",
235
236
  "@openfort/openfort-node": "^0.9.1",
236
237
  "@opentelemetry/api": "^1.9.1",
237
238
  "@opentelemetry/api-logs": "^0.218.0",
@@ -0,0 +1,4 @@
1
+ -- Expiry for short-lived user tokens: a user MCP script run presents one so its
2
+ -- `ctx.swarm` calls act as the requesting user. NULL for the long-lived MCP
3
+ -- tokens people mint, which never expire.
4
+ ALTER TABLE user_tokens ADD COLUMN expiresAt TEXT;
@@ -1,6 +1,11 @@
1
1
  import { type RunScriptInput, type RunScriptOutput, runScript } from "../../scripts-runtime/loader";
2
2
  import { getAgentById } from "../db";
3
- import { mintScriptRunToken, revokeSessionToken } from "../users";
3
+ import {
4
+ mintScriptRunToken,
5
+ mintUserScriptRunToken,
6
+ revokeSessionToken,
7
+ revokeUserScriptRunToken,
8
+ } from "../users";
4
9
 
5
10
  /**
6
11
  * Backstop lifetime of a script run's api credential. The run revokes its
@@ -10,6 +15,16 @@ import { mintScriptRunToken, revokeSessionToken } from "../users";
10
15
  */
11
16
  const SCRIPT_RUN_TOKEN_TTL_MS = 15 * 60 * 1000;
12
17
 
18
+ /**
19
+ * Lifetime of a user MCP run's token. `SCRIPT_RUN_USER_TOKEN_TTL_MS` is a test
20
+ * seam (the e2e suite sets it so a run can watch its own token expire); it can
21
+ * only shorten the backstop, never extend it.
22
+ */
23
+ function userScriptRunTokenTtlMs(): number {
24
+ const override = Number(process.env.SCRIPT_RUN_USER_TOKEN_TTL_MS);
25
+ return override > 0 && override < SCRIPT_RUN_TOKEN_TTL_MS ? override : SCRIPT_RUN_TOKEN_TTL_MS;
26
+ }
27
+
13
28
  export type ScriptApiCredential = {
14
29
  /**
15
30
  * The bearer the script's `ctx.swarm` SDK calls present to the api, or
@@ -74,3 +89,42 @@ export async function runScriptWithRunCredential(
74
89
  await credential.release();
75
90
  }
76
91
  }
92
+
93
+ /**
94
+ * Run a script for a user, with no executing agent: its `ctx.swarm` calls
95
+ * present a short-lived token bound to `userId`, so the api applies that
96
+ * user's permissions, and the run gets no agent's credentials, connections or
97
+ * deployment egress secrets. The token is revoked when the run ends.
98
+ */
99
+ export async function runScriptAsUserWithRunCredential(
100
+ input: Omit<
101
+ RunScriptInput,
102
+ | "apiKey"
103
+ | "agentId"
104
+ | "egressSecrets"
105
+ | "failedBindings"
106
+ | "userConfig"
107
+ | "apiConnections"
108
+ | "mcpConnections"
109
+ | "agentFs"
110
+ >,
111
+ userId: string,
112
+ ): Promise<RunScriptOutput> {
113
+ const token = await mintUserScriptRunToken(userId, userScriptRunTokenTtlMs());
114
+ try {
115
+ return await runScript({
116
+ ...input,
117
+ apiKey: token.plaintext,
118
+ // Empty: the SDK then sends no X-Agent-ID, which the api refuses on a user token.
119
+ agentId: "",
120
+ // Explicit empties: omitted, the loader falls back to deployment-wide bindings.
121
+ egressSecrets: [],
122
+ failedBindings: [],
123
+ userConfig: {},
124
+ apiConnections: [],
125
+ mcpConnections: [],
126
+ });
127
+ } finally {
128
+ await revokeUserScriptRunToken(token.tokenId);
129
+ }
130
+ }
@@ -577,10 +577,10 @@ export interface SwarmSdk {
577
577
 
578
578
  // --- write: chat sdk ---
579
579
  chat_reply(args: { text?: string; card?: unknown }): Promise<unknown>;
580
- chat_post(args: { adapter: "telegram" | "slack" | "discord" | "teams"; threadId?: string; channelId?: string; text?: string; card?: unknown }): Promise<unknown>;
581
- chat_openDm(args: { adapter: "telegram" | "slack" | "discord" | "teams"; userId: string }): Promise<unknown>;
582
- chat_registerChannel(args: { adapter: "telegram" | "slack" | "discord" | "teams"; channelId: string; agentId?: string; workflowId?: string; name?: string }): Promise<unknown>;
583
- chat_unregisterChannel(args: { adapter: "telegram" | "slack" | "discord" | "teams"; channelId: string }): Promise<unknown>;
580
+ chat_post(args: { adapter: "telegram" | "slack" | "discord" | "teams" | "rocketchat"; threadId?: string; channelId?: string; text?: string; card?: unknown }): Promise<unknown>;
581
+ chat_openDm(args: { adapter: "telegram" | "slack" | "discord" | "teams" | "rocketchat"; userId: string }): Promise<unknown>;
582
+ chat_registerChannel(args: { adapter: "telegram" | "slack" | "discord" | "teams" | "rocketchat"; channelId: string; agentId?: string; workflowId?: string; name?: string }): Promise<unknown>;
583
+ chat_unregisterChannel(args: { adapter: "telegram" | "slack" | "discord" | "teams" | "rocketchat"; channelId: string }): Promise<unknown>;
584
584
 
585
585
  // --- write: messaging (internal) ---
586
586
  message_post(args: { channel?: string; content: string; to?: string }): Promise<unknown>;
@@ -0,0 +1,160 @@
1
+ import { isExecutorAllowedByDeployment } from "../../scripts-runtime/executors/registry";
2
+ import type { ScriptRecord } from "../../types";
3
+ import { scrubObject, scrubSecrets } from "../../utils/secret-scrubber";
4
+ import { recordInlineScriptRun } from "../db";
5
+ import { getScript } from "./db";
6
+ import { type ScriptSearchResult, searchScripts } from "./embeddings";
7
+ import { runScriptAsUserWithRunCredential } from "./run-credential";
8
+ import { refuseSourceWithSecrets } from "./source-secrets";
9
+ import { scriptStdlibTypesWithGeneratedApis } from "./typecheck";
10
+
11
+ /**
12
+ * Code mode on the user MCP: search, type and run scripts as a person, with no
13
+ * agent and no task. A user has no agent scope, so only global scripts are
14
+ * visible. Results mirror the `/api/scripts/*` bodies so the tools render them
15
+ * the same way the agent-side tools do.
16
+ */
17
+
18
+ /** `script_runs.agentId` for a user MCP run, which has no agent (like "schedule"). */
19
+ export const USER_SCRIPT_RUN_AGENT_ID = "user-mcp";
20
+
21
+ export type UserCodeModeResponse = { status: number; body: unknown };
22
+
23
+ /** The `/api/scripts/search` result rows, shared with that route. */
24
+ export function toScriptSearchResults(matches: ScriptSearchResult[]) {
25
+ return matches.map(({ script, score }) => ({
26
+ name: script.name,
27
+ signature: JSON.parse(script.signatureJson),
28
+ argsJsonSchema: script.argsJsonSchema
29
+ ? (JSON.parse(script.argsJsonSchema) as Record<string, unknown>)
30
+ : null,
31
+ description: script.description,
32
+ score,
33
+ }));
34
+ }
35
+
36
+ export async function searchScriptsForUser(args: {
37
+ query: string;
38
+ limit?: number;
39
+ }): Promise<UserCodeModeResponse> {
40
+ const matches = await searchScripts({ query: args.query, scope: "global", limit: args.limit });
41
+ return { status: 200, body: { results: toScriptSearchResults(matches) } };
42
+ }
43
+
44
+ // A user run gets no agent connections or apps, so its types carry none.
45
+ const EMPTY_API_TYPES = "export interface ScriptApiRegistry {}\n";
46
+ const EMPTY_MCP_TYPES = "export interface ScriptMcpRegistry {}\n";
47
+
48
+ /**
49
+ * `stdlibTypes` is the whole authoring surface: the `stdlib` module plus the
50
+ * full `swarm-sdk` module, so it alone is enough to write a script.
51
+ */
52
+ export async function scriptTypesForUser(name?: string): Promise<UserCodeModeResponse> {
53
+ let script: ScriptRecord | null = null;
54
+ if (name) {
55
+ script = await getScript({ name, scope: "global" });
56
+ if (!script) return { status: 404, body: { error: "Script not found" } };
57
+ }
58
+ const stdlibTypes = await scriptStdlibTypesWithGeneratedApis(
59
+ EMPTY_API_TYPES,
60
+ EMPTY_MCP_TYPES,
61
+ "",
62
+ );
63
+ if (!script) return { status: 200, body: { stdlibTypes } };
64
+ return {
65
+ status: 200,
66
+ body: {
67
+ signature: JSON.parse(script.signatureJson),
68
+ argsJsonSchema: script.argsJsonSchema
69
+ ? (JSON.parse(script.argsJsonSchema) as Record<string, unknown>)
70
+ : null,
71
+ stdlibTypes,
72
+ },
73
+ };
74
+ }
75
+
76
+ export async function runScriptForUser(args: {
77
+ userId: string;
78
+ name?: string;
79
+ source?: string;
80
+ args?: unknown;
81
+ }): Promise<UserCodeModeResponse> {
82
+ if (!args.name === !args.source) {
83
+ return { status: 400, body: { error: "Pass exactly one of name or source" } };
84
+ }
85
+
86
+ let source = args.source as string;
87
+ let fsMode: ScriptRecord["fsMode"] = "none";
88
+ let executor: ScriptRecord["executor"] = null;
89
+ if (args.name) {
90
+ const script = await getScript({ name: args.name, scope: "global" });
91
+ if (!script) return { status: 404, body: { error: "Script not found" } };
92
+ ({ source, fsMode, executor } = script);
93
+ } else {
94
+ // The run row records the source: refuse an embedded secret before it runs or persists.
95
+ const refusal = refuseSourceWithSecrets(source);
96
+ if (refusal) return { status: 400, body: refusal };
97
+ }
98
+ if (fsMode === "workspace-rw") {
99
+ return { status: 501, body: { error: "workspace-rw scripts are not supported in v1" } };
100
+ }
101
+ if (executor && !isExecutorAllowedByDeployment(executor)) {
102
+ return {
103
+ status: 400,
104
+ body: {
105
+ error: 'Executor "native" is not permitted when deployment SCRIPT_EXECUTOR="quickjs"',
106
+ },
107
+ };
108
+ }
109
+
110
+ const startedAt = new Date().toISOString();
111
+ const output = await runScriptAsUserWithRunCredential(
112
+ { source, args: args.args, fsMode, executor },
113
+ args.userId,
114
+ );
115
+ const ok = output.exitCode === 0 && !output.error && !output.runtimeError;
116
+ try {
117
+ await recordInlineScriptRun({
118
+ id: crypto.randomUUID(),
119
+ agentId: USER_SCRIPT_RUN_AGENT_ID,
120
+ requestedByUserId: args.userId,
121
+ createdBy: args.userId,
122
+ source,
123
+ args: scrubObject(args.args ?? null),
124
+ scriptName: args.name ?? "(inline source)",
125
+ status: ok ? "completed" : "failed",
126
+ output: scrubObject(output.result),
127
+ error: ok
128
+ ? undefined
129
+ : scrubSecrets(
130
+ [
131
+ output.error,
132
+ output.stderr || undefined,
133
+ output.runtimeError
134
+ ? `${output.runtimeError.name}: ${output.runtimeError.message}`
135
+ : undefined,
136
+ ]
137
+ .filter(Boolean)
138
+ .join(" — ") || `Script exited with code ${output.exitCode}`,
139
+ ),
140
+ startedAt,
141
+ finishedAt: new Date().toISOString(),
142
+ });
143
+ } catch {
144
+ // The run already executed; the row is observability only.
145
+ }
146
+
147
+ return {
148
+ status: 200,
149
+ body: scrubObject({
150
+ result: output.result,
151
+ truncated: output.truncated,
152
+ durationMs: output.durationMs,
153
+ stdout: output.stdout,
154
+ stderr: output.stderr,
155
+ exitCode: output.exitCode,
156
+ error: output.error,
157
+ runtimeError: output.runtimeError,
158
+ }),
159
+ };
160
+ }
package/src/be/users.ts CHANGED
@@ -304,7 +304,7 @@ export async function listUserTokens(userId: string): Promise<UserTokenSummary[]
304
304
  return getDbClient().query<UserTokenRow>(
305
305
  `SELECT id, userId, label, tokenPreview, createdAt, lastUsedAt, revokedAt
306
306
  FROM user_tokens
307
- WHERE userId = ?
307
+ WHERE userId = ? AND expiresAt IS NULL
308
308
  ORDER BY createdAt DESC`,
309
309
  [userId],
310
310
  );
@@ -511,6 +511,43 @@ export async function mintToken(
511
511
  return { tokenId, plaintext };
512
512
  }
513
513
 
514
+ /**
515
+ * Mint the short-lived `aswt_` token a user MCP script run presents on its
516
+ * `ctx.swarm` calls, so the script can do only what the requesting user's own
517
+ * token can. It expires at `now + ttlMs` (the backstop for a run that dies
518
+ * without revoking) and stays off the People page token list. No identity
519
+ * event: one per run would flood the audit log, like `mintScriptRunToken`.
520
+ */
521
+ export async function mintUserScriptRunToken(
522
+ userId: string,
523
+ ttlMs: number,
524
+ ): Promise<{ tokenId: string; plaintext: string }> {
525
+ const plaintext = `${TOKEN_PREFIX}${randomChars(TOKEN_ALPHABET, 24)}`;
526
+ const tokenId = randomUUID().replace(/-/g, "");
527
+ const now = new Date();
528
+ await getDbClient().run(
529
+ `INSERT INTO user_tokens (id, userId, label, tokenHash, tokenPreview, createdAt, expiresAt)
530
+ VALUES (?, ?, 'script-run', ?, ?, ?, ?)`,
531
+ [
532
+ tokenId,
533
+ userId,
534
+ sha256Hex(plaintext),
535
+ plaintext.slice(-4),
536
+ now.toISOString(),
537
+ new Date(now.getTime() + ttlMs).toISOString(),
538
+ ],
539
+ );
540
+ return { tokenId, plaintext };
541
+ }
542
+
543
+ /** Revoke a token minted by `mintUserScriptRunToken`. No-op if already revoked. */
544
+ export async function revokeUserScriptRunToken(tokenId: string): Promise<void> {
545
+ await getDbClient().run(
546
+ "UPDATE user_tokens SET revokedAt = ? WHERE id = ? AND expiresAt IS NOT NULL AND revokedAt IS NULL",
547
+ [new Date().toISOString(), tokenId],
548
+ );
549
+ }
550
+
514
551
  /**
515
552
  * Revoke a previously-minted token. Sets `revokedAt = now` and emits
516
553
  * `token_revoked`. Subsequent `resolveUserByToken(plaintext)` returns null.
@@ -586,11 +623,14 @@ export async function resolveUserToken(
586
623
  const hash = sha256Hex(plaintext);
587
624
  const client = getDbClient();
588
625
 
589
- const row = await client.get<{ id: string; userId: string; revokedAt: string | null }>(
590
- "SELECT id, userId, revokedAt FROM user_tokens WHERE tokenHash = ?",
591
- [hash],
592
- );
626
+ const row = await client.get<{
627
+ id: string;
628
+ userId: string;
629
+ revokedAt: string | null;
630
+ expiresAt: string | null;
631
+ }>("SELECT id, userId, revokedAt, expiresAt FROM user_tokens WHERE tokenHash = ?", [hash]);
593
632
  if (!row || row.revokedAt !== null) return null;
633
+ if (row.expiresAt !== null && Date.parse(row.expiresAt) <= Date.now()) return null;
594
634
 
595
635
  // Best-effort lastUsedAt update — never let a failure here leak to the
596
636
  // caller and block a successful token resolution.
@@ -613,8 +653,9 @@ export async function resolveUserToken(
613
653
  */
614
654
  export async function isLiveUserToken(tokenId: string, userId: string): Promise<boolean> {
615
655
  const row = await getDbClient().get<{ found: number }>(
616
- "SELECT 1 AS found FROM user_tokens WHERE id = ? AND userId = ? AND revokedAt IS NULL",
617
- [tokenId, userId],
656
+ `SELECT 1 AS found FROM user_tokens
657
+ WHERE id = ? AND userId = ? AND revokedAt IS NULL AND (expiresAt IS NULL OR expiresAt > ?)`,
658
+ [tokenId, userId, new Date().toISOString()],
618
659
  );
619
660
  return row != null;
620
661
  }
@@ -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.27";
5
+ export const AGENT_FS_VERSION = "0.18.29";