@desplega.ai/agent-swarm 2.6.0 → 2.7.1

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 (324) hide show
  1. package/README.md +2 -0
  2. package/dist/{acp-adapter-dgfakfpw.js → acp-adapter-8dn5tq56.js} +6 -6
  3. package/dist/{actions-fbqma8aa.js → actions-3r6gw7dy.js} +18 -18
  4. package/dist/{amp-adapter-en0jy6hs.js → amp-adapter-wjtq413p.js} +3 -3
  5. package/dist/{anthropic-messages-txs190dd.js → anthropic-messages-n4cby1rz.js} +4 -4
  6. package/dist/{app-k8a5cgpp.js → app-d53yhykk.js} +3 -3
  7. package/dist/{assistant-a16433gr.js → assistant-ksrawj3k.js} +20 -20
  8. package/dist/{boot-reembed-6c1sjfnr.js → boot-reembed-fxfw17m2.js} +11 -3
  9. package/dist/{boot-reembed-f4nn561n.js → boot-reembed-k5y5xbj0.js} +15 -8
  10. package/dist/{boot-scrub-sweep-d4w9gajf.js → boot-scrub-sweep-se41j9fd.js} +3 -3
  11. package/dist/{boot-seeds-9bmkspyw.js → boot-seeds-r3kwwv8b.js} +4 -4
  12. package/dist/{claude-adapter-nys1kjxa.js → claude-adapter-ahmyf231.js} +8 -8
  13. package/dist/{claude-managed-adapter-55207973.js → claude-managed-adapter-5knamegc.js} +3 -3
  14. package/dist/{claude-managed-setup-3cm35gey.js → claude-managed-setup-mdc7dy6b.js} +3 -3
  15. package/dist/{claude-sdk-session-nw5yd8cp.js → claude-sdk-session-n5wen9zk.js} +8729 -8600
  16. package/dist/{cli-683y0b3a.js → cli-0dqtv2jg.js} +2 -2
  17. package/dist/{cli-a34pr3w1.js → cli-0tww7dnz.js} +2 -2
  18. package/dist/{cli-w2656ka1.js → cli-0w4e4v58.js} +7 -7
  19. package/dist/{cli-5sckpqcx.js → cli-2sjm3t4r.js} +1 -1
  20. package/dist/{cli-gf2850q7.js → cli-3cywb44q.js} +18 -1
  21. package/dist/{cli-8wkb09q5.js → cli-3k9jej0c.js} +2 -2
  22. package/dist/{cli-3aqd4jaa.js → cli-3v2cyqb8.js} +3 -3
  23. package/dist/{cli-emhjcj2y.js → cli-5qt9vzmq.js} +89 -20
  24. package/dist/{cli-abkm71vr.js → cli-5rp1w4cr.js} +1 -1
  25. package/dist/{cli-gf95q3bm.js → cli-6vwjsetx.js} +4 -4
  26. package/dist/{cli-k21gx5ht.js → cli-6w2yrrc0.js} +10 -10
  27. package/dist/{cli-m70bajzr.js → cli-75tdydgv.js} +1 -1
  28. package/dist/{cli-5rj83bam.js → cli-8feswf2v.js} +47 -36
  29. package/dist/{cli-sxgtf5fw.js → cli-8wd3mbyj.js} +1 -1
  30. package/dist/{cli-ca6banwz.js → cli-9csfthbw.js} +10 -8
  31. package/dist/{cli-dqygeeh5.js → cli-b41p764a.js} +31 -3
  32. package/dist/{cli-m5a9m0ak.js → cli-c1t533hh.js} +3 -3
  33. package/dist/{cli-2sjhpsns.js → cli-c28jxpcv.js} +1 -1
  34. package/dist/{cli-bqztfyve.js → cli-cb50g9cd.js} +1 -1
  35. package/dist/{cli-ag2yrnt5.js → cli-d8gaphtr.js} +2 -2
  36. package/dist/{cli-9abdgn5t.js → cli-dgtfysne.js} +3 -3
  37. package/dist/{cli-nq677csy.js → cli-dscnhn18.js} +1 -1
  38. package/dist/{cli-3fwqy71j.js → cli-dv11pgpv.js} +39 -32
  39. package/dist/{cli-v49fkghp.js → cli-ekptgk2m.js} +6 -6
  40. package/dist/{cli-c2habvsf.js → cli-f3mzy662.js} +17 -17
  41. package/dist/{cli-zqne1qcj.js → cli-fk7k8s9x.js} +2 -2
  42. package/dist/{cli-1tem6ns9.js → cli-gt4h8cxw.js} +3 -2
  43. package/dist/{cli-vbhgkw9h.js → cli-h3e7bhvn.js} +3 -3
  44. package/dist/{cli-ffvsj2qw.js → cli-hkxqdmnb.js} +3 -3
  45. package/dist/{cli-a2rr0fmg.js → cli-hpkvgdad.js} +7 -4
  46. package/dist/{cli-art7c1zh.js → cli-hq2v4rr5.js} +37 -9
  47. package/dist/{cli-sqma6vw1.js → cli-k1zb7raw.js} +5 -5
  48. package/dist/{cli-4rvr7zfx.js → cli-k4awgvzm.js} +5 -0
  49. package/dist/{cli-3ndmpxxv.js → cli-k7d3hvya.js} +2 -2
  50. package/dist/{cli-3gfvmzht.js → cli-kbtdftbw.js} +74 -26
  51. package/dist/{cli-hfeb68z4.js → cli-kj69b9tw.js} +34 -6
  52. package/dist/{cli-az25fn5f.js → cli-kk9jy4nm.js} +2 -2
  53. package/dist/{cli-39aet655.js → cli-m52t4cta.js} +1 -1
  54. package/dist/{cli-cz37jqss.js → cli-mdadewqp.js} +5 -5
  55. package/dist/{cli-esakngh8.js → cli-nf6k60sn.js} +1 -1
  56. package/dist/{cli-j6rktc91.js → cli-nzdf09js.js} +1 -1
  57. package/dist/{cli-rr7zx19j.js → cli-prcyzecg.js} +12 -12
  58. package/dist/{cli-4hxrf0p4.js → cli-pzafyqtk.js} +393 -62
  59. package/dist/{cli-g8ka5j4j.js → cli-qvaa1gjp.js} +173 -52
  60. package/dist/{cli-d2dpf95n.js → cli-rg4b2g6j.js} +1 -1
  61. package/dist/{cli-kf4jree9.js → cli-rm66vqdz.js} +1 -1
  62. package/dist/{cli-4rf0f5vg.js → cli-s504c3w7.js} +5 -3
  63. package/dist/{cli-nn6vx2mq.js → cli-swkx9jm2.js} +7 -5
  64. package/dist/{cli-g20jjwt4.js → cli-thsaq4pd.js} +16 -16
  65. package/dist/{cli-aj8djyqt.js → cli-twjnyvs8.js} +2 -2
  66. package/dist/{cli-03gg9pd1.js → cli-typdpe8g.js} +4 -4
  67. package/dist/{cli-mtnj4fwa.js → cli-vg8pwmsd.js} +6 -6
  68. package/dist/{cli-gnsb1zxa.js → cli-vhpckzvp.js} +1 -1
  69. package/dist/{cli-7enjwya9.js → cli-vz78s5wm.js} +1 -1
  70. package/dist/{cli-dv97kdzv.js → cli-wdxgsdz5.js} +2 -2
  71. package/dist/{cli-7a6p4e65.js → cli-wtjg6je3.js} +1 -1
  72. package/dist/{cli-6y51ryva.js → cli-x3cngb1h.js} +44 -12
  73. package/dist/{cli-n7asmce6.js → cli-xbz6mcg4.js} +3 -3
  74. package/dist/{cli-24j1jeeb.js → cli-y4tdxsqb.js} +3 -3
  75. package/dist/{cli-mvjz5an3.js → cli-yqrsp3ny.js} +7 -7
  76. package/dist/cli.js +31 -21
  77. package/dist/{codex-adapter-d95q4qsn.js → codex-adapter-7wepzq15.js} +6 -6
  78. package/dist/{codex-hook-brpnycn5.js → codex-hook-pbdh4xhx.js} +2 -2
  79. package/dist/{codex-session-runner-gdwd8h0c.js → codex-session-runner-02sb49e4.js} +6 -6
  80. package/dist/{commands-jqmgk54b.js → commands-3rcspxct.js} +2 -2
  81. package/dist/{controller-z3jq589f.js → controller-8ar4avd6.js} +3 -3
  82. package/dist/{controllers-connect-r2za39ef.js → controllers-connect-ajvh9h0v.js} +19 -19
  83. package/dist/{cursor-adapter-4mr4jgkw.js → cursor-adapter-gd0sa7bh.js} +1 -1
  84. package/dist/{db-w36wwb5g.js → db-dv9j7ts5.js} +2 -2
  85. package/dist/{db-ppv2tze7.js → db-z26vgdvj.js} +3 -3
  86. package/dist/{dispatcher-pv5h77vf.js → dispatcher-8m0htjq8.js} +17 -17
  87. package/dist/{dsh-adapter-d4pdpb3r.js → dsh-adapter-y8gyk130.js} +1 -1
  88. package/dist/{e2b-fn3zacvt.js → e2b-74vg9b7e.js} +1 -1
  89. package/dist/{e2b-222hsajc.js → e2b-jyay8wzn.js} +1 -1
  90. package/dist/{easter-egg-3d-4sp4dvmc.js → easter-egg-3d-28f880xx.js} +1 -1
  91. package/dist/{execute-jev839y1.js → execute-9seb79vh.js} +1 -1
  92. package/dist/{external-channel-y6nkzhnn.js → external-channel-smz7jyth.js} +2 -2
  93. package/dist/{getMachineId-bsd-brn0xym3.js → getMachineId-bsd-whfre6gr.js} +3 -3
  94. package/dist/{getMachineId-darwin-t339sfxm.js → getMachineId-darwin-5zjynb19.js} +3 -3
  95. package/dist/{getMachineId-linux-5eq95d8b.js → getMachineId-linux-8mksrrsq.js} +3 -3
  96. package/dist/{getMachineId-unsupported-qavrtc7j.js → getMachineId-unsupported-fxtqsdt2.js} +3 -3
  97. package/dist/{getMachineId-win-q7fe1wx7.js → getMachineId-win-nzfmz857.js} +3 -3
  98. package/dist/{grok-adapter-t08b9ntm.js → grok-adapter-z0nnvtbn.js} +7 -7
  99. package/dist/handlers-pspryh6g.js +41 -0
  100. package/dist/{heartbeat-vn31xwdk.js → heartbeat-f928aqyp.js} +20 -20
  101. package/dist/{hook-cpjs8q51.js → hook-d7c605r4.js} +7 -7
  102. package/dist/{hook-6d0zbvvt.js → hook-q9hv5xf9.js} +5 -5
  103. package/dist/{http-9c6medda.js → http-q6j4k989.js} +1000 -251
  104. package/dist/{index-k0yt1tvq.js → index-5nb266jr.js} +17 -17
  105. package/dist/{index-ysd45kgc.js → index-8fxt5eah.js} +10 -10
  106. package/dist/{index-zgvqzjsw.js → index-cekzwhez.js} +5 -5
  107. package/dist/{index-38t35h0n.js → index-ch0c1xff.js} +17 -17
  108. package/dist/{index-pkma1yf8.js → index-ebnjhxh1.js} +1 -1
  109. package/dist/{index-yqgbfgaj.js → index-ed8dy8rn.js} +20 -20
  110. package/dist/{index-qhjf2htm.js → index-ejqdkkqx.js} +262 -96
  111. package/dist/{index-dr94zbnh.js → index-farm1zsn.js} +32661 -29443
  112. package/dist/{index-g6k9tctj.js → index-yn1yxg85.js} +1 -1
  113. package/dist/{keepalive-em0117bp.js → keepalive-zzc3hks1.js} +3 -3
  114. package/dist/lead-c0pjcaw4.js +79 -0
  115. package/dist/{maintenance-kbme3qy9.js → maintenance-kqsxzpzx.js} +1 -1
  116. package/dist/{oauth-refresh-sweep-xysj4yse.js → oauth-refresh-sweep-7qt0g55z.js} +8 -3
  117. package/dist/{onboard-p6q0vz97.js → onboard-k7x13fqg.js} +121 -8
  118. package/dist/{opencode-adapter-esv3k9yn.js → opencode-adapter-tqvrtter.js} +5 -5
  119. package/dist/{otel-impl-54qhqh1z.js → otel-impl-sqkf6k3b.js} +97 -97
  120. package/dist/{pi-mono-adapter-mymbwhj0.js → pi-mono-adapter-m2qnafxm.js} +89 -14
  121. package/dist/{pricing-refresh-yb75wv33.js → pricing-refresh-wkpwhgvs.js} +3 -3
  122. package/dist/{rbac-roles-dexhc9x8.js → rbac-roles-dpn0c0wj.js} +7 -4
  123. package/dist/{rbac-roles-1vp2mw4p.js → rbac-roles-wk7xd6a6.js} +2 -2
  124. package/dist/{render-v2-tjay5hhf.js → render-v2-ex2m4g2k.js} +3 -3
  125. package/dist/{resume-8ayf37g5.js → resume-725g9b0b.js} +7 -7
  126. package/dist/{runtime-hqe5cqcd.js → runtime-kajas15g.js} +1 -1
  127. package/dist/{session-access-fdhp987s.js → session-access-0j2ezjje.js} +8 -4
  128. package/dist/{session-source-backfill-qgtc86z1.js → session-source-backfill-62202awe.js} +2 -2
  129. package/dist/{setup-4rrmqcq3.js → setup-9sj11ax6.js} +1 -1
  130. package/dist/{virtual-modules-52km00d6.js → virtual-modules-c6fcq6zr.js} +2 -2
  131. package/dist/{work-objects-p28fgd70.js → work-objects-0y07495y.js} +20 -20
  132. package/dist/worker-d4q9sqbc.js +79 -0
  133. package/openapi.json +1536 -407
  134. package/package.json +7 -5
  135. package/src/be/automation-preflight.ts +2 -0
  136. package/src/be/connector-codes.ts +65 -22
  137. package/src/be/db/api-keys.ts +9 -0
  138. package/src/be/db/workflow-runs.ts +36 -5
  139. package/src/be/db.ts +80 -22
  140. package/src/be/memory/boot-reembed.ts +4 -1
  141. package/src/be/memory/constants.ts +6 -0
  142. package/src/be/memory/embedding-recovery.ts +48 -0
  143. package/src/be/memory/index-content.ts +5 -2
  144. package/src/be/memory/providers/openai-embedding.ts +65 -14
  145. package/src/be/memory/task-learning.ts +257 -0
  146. package/src/be/memory/types.ts +13 -2
  147. package/src/be/migrations/245_script_executor.sql +3 -0
  148. package/src/be/migrations/246_connector_code_kind.sql +11 -0
  149. package/src/be/oauth-refresh-sweep.ts +2 -1
  150. package/src/be/onboarding.ts +125 -15
  151. package/src/be/rbac-roles.ts +4 -1
  152. package/src/be/scripts/boot-reembed.ts +2 -0
  153. package/src/be/scripts/db.ts +14 -4
  154. package/src/be/scripts/embeddings.ts +4 -2
  155. package/src/be/scripts/run-saved.ts +1 -0
  156. package/src/be/scripts/typecheck.ts +9 -3
  157. package/src/be/seed/agent-fs-provision.ts +75 -14
  158. package/src/be/seed-skills/index.ts +7 -0
  159. package/src/be/swarm-config-guard.ts +3 -0
  160. package/src/cli.tsx +9 -0
  161. package/src/comb/config.ts +6 -1
  162. package/src/commands/onboard/agent-fs-version.ts +5 -0
  163. package/src/commands/onboard/compose-generator.ts +117 -4
  164. package/src/commands/onboard/env-generator.ts +9 -0
  165. package/src/commands/onboard/tei-image.ts +12 -0
  166. package/src/commands/onboard/types.ts +7 -0
  167. package/src/commands/onboard.tsx +11 -1
  168. package/src/commands/provider-credentials.ts +2 -1
  169. package/src/commands/runner.ts +14 -1
  170. package/src/heartbeat/heartbeat.ts +14 -1
  171. package/src/heartbeat/script-runner-probe.ts +47 -0
  172. package/src/http/agentfs-proxy.ts +369 -0
  173. package/src/http/all-routes.ts +1 -0
  174. package/src/http/api-keys.ts +24 -9
  175. package/src/http/codex-oauth-device.ts +8 -1
  176. package/src/http/fs.ts +64 -10
  177. package/src/http/idempotency-key.ts +1 -1
  178. package/src/http/inbox-state.ts +27 -1
  179. package/src/http/index.ts +7 -4
  180. package/src/http/memory.ts +7 -4
  181. package/src/http/onboarding.ts +139 -11
  182. package/src/http/pages-public.ts +38 -5
  183. package/src/http/scripts.ts +27 -0
  184. package/src/http/session-access.ts +24 -0
  185. package/src/http/sessions.ts +10 -6
  186. package/src/http/tasks.ts +85 -11
  187. package/src/http/telemetry-ui.ts +1 -1
  188. package/src/http/user-roles.ts +4 -1
  189. package/src/http/users.ts +272 -3
  190. package/src/http/utils.ts +22 -3
  191. package/src/http/workflows.ts +10 -0
  192. package/src/http/x.ts +5 -0
  193. package/src/prompts/base-prompt.ts +45 -10
  194. package/src/prompts/session-templates.ts +43 -5
  195. package/src/providers/amp-adapter.ts +1 -1
  196. package/src/providers/codex-adapter.ts +6 -1
  197. package/src/providers/cursor-adapter.ts +1 -1
  198. package/src/providers/dsh-adapter.ts +1 -1
  199. package/src/providers/pi-mono-adapter.ts +99 -14
  200. package/src/rbac/legacy-policy.ts +1 -0
  201. package/src/rbac/permissions.ts +4 -0
  202. package/src/scheduler/scheduler.ts +2 -1
  203. package/src/scripts-runtime/eval-harness.ts +8 -1
  204. package/src/scripts-runtime/executors/native.ts +22 -16
  205. package/src/scripts-runtime/executors/quickjs-prelude.ts +103 -1
  206. package/src/scripts-runtime/executors/quickjs-runner.ts +2 -1
  207. package/src/scripts-runtime/executors/quickjs.ts +7 -0
  208. package/src/scripts-runtime/executors/registry.ts +32 -0
  209. package/src/scripts-runtime/executors/types.ts +7 -0
  210. package/src/scripts-runtime/host-validated-args.ts +133 -0
  211. package/src/scripts-runtime/loader.ts +30 -3
  212. package/src/scripts-runtime/swarm-sdk.ts +9 -2
  213. package/src/scripts-runtime/types/stdlib.d.ts +9 -1
  214. package/src/scripts-runtime/types/swarm-sdk.d.ts +9 -1
  215. package/src/tests/agent-fs-provision-seeder.test.ts +261 -92
  216. package/src/tests/agentfs-proxy.test.ts +1106 -0
  217. package/src/tests/api-key-status-by-suffix.test.ts +242 -0
  218. package/src/tests/base-prompt.test.ts +139 -4
  219. package/src/tests/codex-adapter.test.ts +46 -8
  220. package/src/tests/codex-oauth-device.test.ts +12 -1
  221. package/src/tests/comb-config-guard.test.ts +20 -0
  222. package/src/tests/comb-links.test.ts +79 -1
  223. package/src/tests/comb-status.test.ts +44 -0
  224. package/src/tests/community-linear-delivery-loop.test.ts +2099 -0
  225. package/src/tests/credential-check.test.ts +4 -2
  226. package/src/tests/docs-index-footprint.test.js +3 -3
  227. package/src/tests/docs-index.test.ts +135 -0
  228. package/src/tests/dsh-adapter.test.ts +1 -1
  229. package/src/tests/fetch-resolved-env.test.ts +16 -2
  230. package/src/tests/fixtures/onboard/baseline-states.ts +68 -0
  231. package/src/tests/fixtures/onboard/content.compose.yml.txt +190 -0
  232. package/src/tests/fixtures/onboard/content.env.txt +29 -0
  233. package/src/tests/fixtures/onboard/dev.compose.yml.txt +155 -0
  234. package/src/tests/fixtures/onboard/dev.env.txt +28 -0
  235. package/src/tests/fixtures/onboard/full-all.compose.yml.txt +582 -0
  236. package/src/tests/fixtures/onboard/full-all.env.txt +59 -0
  237. package/src/tests/fixtures/onboard/full.compose.yml.txt +435 -0
  238. package/src/tests/fixtures/onboard/full.env.txt +36 -0
  239. package/src/tests/fixtures/onboard/research.compose.yml.txt +155 -0
  240. package/src/tests/fixtures/onboard/research.env.txt +28 -0
  241. package/src/tests/fixtures/onboard/solo.compose.yml.txt +85 -0
  242. package/src/tests/fixtures/onboard/solo.env.txt +26 -0
  243. package/src/tests/heartbeat-checklist.test.ts +89 -0
  244. package/src/tests/heartbeat-script-runner-probe.test.ts +83 -0
  245. package/src/tests/http-log-scrubbing.test.ts +34 -1
  246. package/src/tests/http-task-write-ownership.test.ts +5 -1
  247. package/src/tests/invites-http.test.ts +464 -0
  248. package/src/tests/memory-embedding-input-cap.test.ts +122 -1
  249. package/src/tests/memory-embedding-recovery.test.ts +137 -0
  250. package/src/tests/oauth-refresh-sweep.test.ts +34 -1
  251. package/src/tests/onboard-compose.test.ts +162 -0
  252. package/src/tests/onboard-env.test.ts +24 -0
  253. package/src/tests/onboard-non-interactive.test.ts +29 -0
  254. package/src/tests/onboard-tei-image.test.ts +36 -0
  255. package/src/tests/onboarding.test.ts +451 -4
  256. package/src/tests/openai-embedding-provider.test.ts +105 -2
  257. package/src/tests/opencode-adapter.test.ts +2 -1
  258. package/src/tests/pages-frame-ancestors.test.ts +162 -0
  259. package/src/tests/pi-codemode.test.ts +2 -1
  260. package/src/tests/pi-mono-adapter.test.ts +54 -0
  261. package/src/tests/pi-mono-session-cost-on-abort.test.ts +270 -0
  262. package/src/tests/pi-native-mcp.test.ts +13 -1
  263. package/src/tests/pi-tool-exposure.test.ts +8 -8
  264. package/src/tests/preload-env.test.ts +4 -0
  265. package/src/tests/preload.ts +4 -0
  266. package/src/tests/probe-tool-schema-tokens.test.ts +144 -0
  267. package/src/tests/prompt-template-session.test.ts +20 -3
  268. package/src/tests/rbac-admission-e2e.test.ts +22 -6
  269. package/src/tests/rbac-admission.test.ts +342 -4
  270. package/src/tests/rbac-engine.test.ts +1 -0
  271. package/src/tests/rbac-roles.test.ts +9 -1
  272. package/src/tests/request-composition-derive.test.ts +329 -0
  273. package/src/tests/script-connections.test.ts +2 -0
  274. package/src/tests/script-executor-conformance.test.ts +36 -1
  275. package/src/tests/script-executor-quickjs-pool.test.ts +50 -0
  276. package/src/tests/script-executor-quickjs.test.ts +140 -0
  277. package/src/tests/script-host-validated-args-native.test.ts +196 -0
  278. package/src/tests/script-per-script-executor.test.ts +415 -0
  279. package/src/tests/scripts-external-api.test.ts +45 -0
  280. package/src/tests/sdk-allowlist.test.ts +3 -2
  281. package/src/tests/self-improvement.test.ts +4 -4
  282. package/src/tests/send-task-requester-gate.test.ts +64 -3
  283. package/src/tests/sessions-move.test.ts +39 -1
  284. package/src/tests/store-progress-learning.test.ts +381 -0
  285. package/src/tests/ui-logs-parser.test.ts +180 -0
  286. package/src/tests/whoami-route.test.ts +41 -0
  287. package/src/tests/workflow-engine-v2.test.ts +116 -1
  288. package/src/tests/workflow-mcp-trigger-schema.test.ts +209 -0
  289. package/src/tests/workflow-run-finished-event.test.ts +263 -0
  290. package/src/tests/workflow-swarm-script.test.ts +34 -0
  291. package/src/tools/inject-learning.ts +1 -1
  292. package/src/tools/memory-edit.ts +1 -1
  293. package/src/tools/memory-search.ts +1 -1
  294. package/src/tools/script-common.ts +1 -0
  295. package/src/tools/script-run.ts +7 -0
  296. package/src/tools/script-upsert.ts +7 -0
  297. package/src/tools/store-progress.ts +71 -1
  298. package/src/tools/utils.ts +12 -1
  299. package/src/tools/workflows/trigger-workflow.ts +104 -10
  300. package/src/types.ts +12 -1
  301. package/src/utils/constants.ts +39 -0
  302. package/src/utils/credentials.ts +5 -2
  303. package/src/utils/task-attachment-links.ts +15 -3
  304. package/src/workflows/engine.ts +18 -16
  305. package/src/workflows/executors/swarm-script.ts +5 -0
  306. package/src/workflows/foreach-driver.ts +5 -11
  307. package/src/workflows/node-timeout.ts +30 -0
  308. package/templates/community/linear-delivery-loop/PLAYBOOK.md +323 -0
  309. package/templates/community/linear-delivery-loop/README.md +38 -0
  310. package/templates/community/linear-delivery-loop/config.example.json +31 -0
  311. package/templates/community/linear-delivery-loop/lead-prompt.md +34 -0
  312. package/templates/community/linear-delivery-loop/schedule.json +10 -0
  313. package/templates/community/linear-delivery-loop/scripts/linear-delivery-setup.ts +148 -0
  314. package/templates/community/linear-delivery-loop/scripts/linear-delivery-tick.ts +1781 -0
  315. package/templates/skills/swarm-docs/config.json +14 -0
  316. package/templates/skills/swarm-docs/content.md +144 -0
  317. package/dist/handlers-eqsnmv95.js +0 -41
  318. package/dist/lead-23e7z59t.js +0 -79
  319. package/dist/worker-e3w7vye1.js +0 -79
  320. package/dist/{azure-openai-responses-9kfwhmn7.js → azure-openai-responses-43asa23s.js} +0 -0
  321. package/dist/{node-vxx896fa.js → node-t28cc56b.js} +0 -0
  322. package/dist/{openai-codex-responses-79s8xnbh.js → openai-codex-responses-jhr3sjtm.js} +3 -3
  323. package/dist/{openai-completions-tdbyts0x.js → openai-completions-gs6yn37k.js} +3 -3
  324. /package/dist/{openai-responses-dm3t5vqp.js → openai-responses-jqm9vwwk.js} +0 -0
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.6.0",
5
+ "version": "2.7.1",
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": [
@@ -19601,6 +19601,14 @@
19601
19601
  "required": false,
19602
19602
  "name": "model",
19603
19603
  "in": "query"
19604
+ },
19605
+ {
19606
+ "schema": {
19607
+ "type": "string"
19608
+ },
19609
+ "required": false,
19610
+ "name": "keySuffixes",
19611
+ "in": "query"
19604
19612
  }
19605
19613
  ],
19606
19614
  "responses": {
@@ -22427,7 +22435,7 @@
22427
22435
  "/api/fs/members/invite": {
22428
22436
  "post": {
22429
22437
  "summary": "Invite an external member into the agent-fs shared org",
22430
- "description": "The API server performs the invite with its own bootstrap credentials (which are API-only and never served over HTTP), provisioning the shared org/drive first when needed. Intended for the cloud control plane's Connect-to-Drive flow. No keys are returned; the invitee obtains their own key via agent-fs registration.",
22438
+ "description": "The API server performs the invite with its own bootstrap credentials (which are API-only and never served over HTTP), provisioning the shared org/drive first when needed. Intended for the cloud control plane's Connect-to-Drive flow. An email with an agent-fs account is added directly (status added). An email without one gets a pending invite (status pending) with an acceptUrl when agent-fs returns one; agent-fs sends no email, so the caller must hand the link to the invitee. No keys are returned; the invitee obtains their own key via agent-fs registration.",
22431
22439
  "tags": [
22432
22440
  "FS"
22433
22441
  ],
@@ -22465,7 +22473,7 @@
22465
22473
  },
22466
22474
  "responses": {
22467
22475
  "200": {
22468
- "description": "Invite state ({ orgId, invited })",
22476
+ "description": "Invite state ({ orgId, invited, status, acceptUrl? })",
22469
22477
  "content": {
22470
22478
  "application/json": {
22471
22479
  "schema": {
@@ -22475,12 +22483,35 @@
22475
22483
  "type": "string"
22476
22484
  },
22477
22485
  "invited": {
22478
- "type": "boolean"
22486
+ "type": "boolean",
22487
+ "description": "False only when the email already holds the requested role."
22488
+ },
22489
+ "status": {
22490
+ "type": "string",
22491
+ "enum": [
22492
+ "already_member",
22493
+ "added",
22494
+ "pending"
22495
+ ],
22496
+ "description": "already_member: no change. added: an existing agent-fs account joined the org. pending: the email has no account, so agent-fs created an invite the person must accept."
22497
+ },
22498
+ "inviteId": {
22499
+ "type": "string",
22500
+ "description": "Pending invite id (status pending)."
22501
+ },
22502
+ "expiresAt": {
22503
+ "type": "string",
22504
+ "description": "ISO time the accept link expires (status pending)."
22505
+ },
22506
+ "acceptUrl": {
22507
+ "type": "string",
22508
+ "description": "Link the invitee opens to accept (status pending). agent-fs sends no email, so hand it to the person. Absent when agent-fs has no app URL configured."
22479
22509
  }
22480
22510
  },
22481
22511
  "required": [
22482
22512
  "orgId",
22483
- "invited"
22513
+ "invited",
22514
+ "status"
22484
22515
  ]
22485
22516
  }
22486
22517
  }
@@ -22496,6 +22527,16 @@
22496
22527
  }
22497
22528
  }
22498
22529
  },
22530
+ "403": {
22531
+ "description": "A non-admin user token named an email other than its own",
22532
+ "content": {
22533
+ "application/json": {
22534
+ "schema": {
22535
+ "$ref": "#/components/schemas/ErrorResponse"
22536
+ }
22537
+ }
22538
+ }
22539
+ },
22499
22540
  "500": {
22500
22541
  "description": "Provisioning or invite failed",
22501
22542
  "content": {
@@ -23228,6 +23269,16 @@
23228
23269
  }
23229
23270
  }
23230
23271
  }
23272
+ },
23273
+ "403": {
23274
+ "description": "A non-admin user token wrote another user's state",
23275
+ "content": {
23276
+ "application/json": {
23277
+ "schema": {
23278
+ "$ref": "#/components/schemas/ErrorResponse"
23279
+ }
23280
+ }
23281
+ }
23231
23282
  }
23232
23283
  }
23233
23284
  }
@@ -23357,6 +23408,16 @@
23357
23408
  }
23358
23409
  }
23359
23410
  }
23411
+ },
23412
+ "403": {
23413
+ "description": "A non-admin user token wrote another user's state",
23414
+ "content": {
23415
+ "application/json": {
23416
+ "schema": {
23417
+ "$ref": "#/components/schemas/ErrorResponse"
23418
+ }
23419
+ }
23420
+ }
23360
23421
  }
23361
23422
  }
23362
23423
  }
@@ -31101,6 +31162,7 @@
31101
31162
  "agents",
31102
31163
  "memory",
31103
31164
  "integrations",
31165
+ "files",
31104
31166
  "first_task"
31105
31167
  ]
31106
31168
  },
@@ -31488,6 +31550,62 @@
31488
31550
  "errorClass"
31489
31551
  ]
31490
31552
  },
31553
+ "files": {
31554
+ "type": "object",
31555
+ "properties": {
31556
+ "status": {
31557
+ "type": "string",
31558
+ "enum": [
31559
+ "todo",
31560
+ "done",
31561
+ "skipped",
31562
+ "failed"
31563
+ ]
31564
+ },
31565
+ "at": {
31566
+ "type": [
31567
+ "string",
31568
+ "null"
31569
+ ],
31570
+ "format": "date-time"
31571
+ },
31572
+ "method": {
31573
+ "type": [
31574
+ "string",
31575
+ "null"
31576
+ ],
31577
+ "enum": [
31578
+ "created",
31579
+ "connected",
31580
+ null
31581
+ ]
31582
+ },
31583
+ "errorClass": {
31584
+ "type": [
31585
+ "string",
31586
+ "null"
31587
+ ],
31588
+ "enum": [
31589
+ "auth",
31590
+ "network",
31591
+ "timeout",
31592
+ "dimension",
31593
+ "model",
31594
+ "endpoint",
31595
+ "not_enabled",
31596
+ "expired",
31597
+ "unknown",
31598
+ null
31599
+ ]
31600
+ }
31601
+ },
31602
+ "required": [
31603
+ "status",
31604
+ "at",
31605
+ "method",
31606
+ "errorClass"
31607
+ ]
31608
+ },
31491
31609
  "first_task": {
31492
31610
  "type": "object",
31493
31611
  "properties": {
@@ -31552,6 +31670,7 @@
31552
31670
  "agents",
31553
31671
  "memory",
31554
31672
  "integrations",
31673
+ "files",
31555
31674
  "first_task"
31556
31675
  ]
31557
31676
  }
@@ -31640,11 +31759,53 @@
31640
31759
  "dimensions": {
31641
31760
  "type": "integer",
31642
31761
  "exclusiveMinimum": 0
31762
+ },
31763
+ "model": {
31764
+ "type": [
31765
+ "string",
31766
+ "null"
31767
+ ]
31768
+ },
31769
+ "local": {
31770
+ "type": "boolean"
31771
+ },
31772
+ "provider": {
31773
+ "type": [
31774
+ "string",
31775
+ "null"
31776
+ ],
31777
+ "enum": [
31778
+ "local",
31779
+ "openai",
31780
+ "openrouter",
31781
+ "vercel",
31782
+ "azure",
31783
+ "custom",
31784
+ null
31785
+ ]
31786
+ },
31787
+ "localDefault": {
31788
+ "type": [
31789
+ "object",
31790
+ "null"
31791
+ ],
31792
+ "properties": {
31793
+ "model": {
31794
+ "type": "string"
31795
+ }
31796
+ },
31797
+ "required": [
31798
+ "model"
31799
+ ]
31643
31800
  }
31644
31801
  },
31645
31802
  "required": [
31646
31803
  "configured",
31647
- "dimensions"
31804
+ "dimensions",
31805
+ "model",
31806
+ "local",
31807
+ "provider",
31808
+ "localDefault"
31648
31809
  ]
31649
31810
  },
31650
31811
  "integrations": {
@@ -31712,6 +31873,17 @@
31712
31873
  "id",
31713
31874
  "status"
31714
31875
  ]
31876
+ },
31877
+ "files": {
31878
+ "type": "object",
31879
+ "properties": {
31880
+ "enabled": {
31881
+ "type": "boolean"
31882
+ }
31883
+ },
31884
+ "required": [
31885
+ "enabled"
31886
+ ]
31715
31887
  }
31716
31888
  },
31717
31889
  "required": [
@@ -31719,7 +31891,8 @@
31719
31891
  "embeddings",
31720
31892
  "integrations",
31721
31893
  "agents",
31722
- "firstTask"
31894
+ "firstTask",
31895
+ "files"
31723
31896
  ]
31724
31897
  }
31725
31898
  },
@@ -31766,6 +31939,7 @@
31766
31939
  "agents",
31767
31940
  "memory",
31768
31941
  "integrations",
31942
+ "files",
31769
31943
  "first_task"
31770
31944
  ]
31771
31945
  }
@@ -31937,6 +32111,36 @@
31937
32111
  ],
31938
32112
  "additionalProperties": false
31939
32113
  },
32114
+ {
32115
+ "type": "object",
32116
+ "properties": {
32117
+ "action": {
32118
+ "type": "string",
32119
+ "enum": [
32120
+ "complete"
32121
+ ]
32122
+ },
32123
+ "step": {
32124
+ "type": "string",
32125
+ "enum": [
32126
+ "files"
32127
+ ]
32128
+ },
32129
+ "method": {
32130
+ "type": "string",
32131
+ "enum": [
32132
+ "created",
32133
+ "connected"
32134
+ ]
32135
+ }
32136
+ },
32137
+ "required": [
32138
+ "action",
32139
+ "step",
32140
+ "method"
32141
+ ],
32142
+ "additionalProperties": false
32143
+ },
31940
32144
  {
31941
32145
  "type": "object",
31942
32146
  "properties": {
@@ -31954,6 +32158,7 @@
31954
32158
  "agents",
31955
32159
  "memory",
31956
32160
  "integrations",
32161
+ "files",
31957
32162
  "first_task"
31958
32163
  ]
31959
32164
  }
@@ -31982,6 +32187,7 @@
31982
32187
  "agents",
31983
32188
  "memory",
31984
32189
  "integrations",
32190
+ "files",
31985
32191
  "first_task"
31986
32192
  ]
31987
32193
  },
@@ -32115,6 +32321,7 @@
32115
32321
  "agents",
32116
32322
  "memory",
32117
32323
  "integrations",
32324
+ "files",
32118
32325
  "first_task"
32119
32326
  ]
32120
32327
  },
@@ -32502,6 +32709,62 @@
32502
32709
  "errorClass"
32503
32710
  ]
32504
32711
  },
32712
+ "files": {
32713
+ "type": "object",
32714
+ "properties": {
32715
+ "status": {
32716
+ "type": "string",
32717
+ "enum": [
32718
+ "todo",
32719
+ "done",
32720
+ "skipped",
32721
+ "failed"
32722
+ ]
32723
+ },
32724
+ "at": {
32725
+ "type": [
32726
+ "string",
32727
+ "null"
32728
+ ],
32729
+ "format": "date-time"
32730
+ },
32731
+ "method": {
32732
+ "type": [
32733
+ "string",
32734
+ "null"
32735
+ ],
32736
+ "enum": [
32737
+ "created",
32738
+ "connected",
32739
+ null
32740
+ ]
32741
+ },
32742
+ "errorClass": {
32743
+ "type": [
32744
+ "string",
32745
+ "null"
32746
+ ],
32747
+ "enum": [
32748
+ "auth",
32749
+ "network",
32750
+ "timeout",
32751
+ "dimension",
32752
+ "model",
32753
+ "endpoint",
32754
+ "not_enabled",
32755
+ "expired",
32756
+ "unknown",
32757
+ null
32758
+ ]
32759
+ }
32760
+ },
32761
+ "required": [
32762
+ "status",
32763
+ "at",
32764
+ "method",
32765
+ "errorClass"
32766
+ ]
32767
+ },
32505
32768
  "first_task": {
32506
32769
  "type": "object",
32507
32770
  "properties": {
@@ -32566,6 +32829,7 @@
32566
32829
  "agents",
32567
32830
  "memory",
32568
32831
  "integrations",
32832
+ "files",
32569
32833
  "first_task"
32570
32834
  ]
32571
32835
  }
@@ -32654,11 +32918,53 @@
32654
32918
  "dimensions": {
32655
32919
  "type": "integer",
32656
32920
  "exclusiveMinimum": 0
32921
+ },
32922
+ "model": {
32923
+ "type": [
32924
+ "string",
32925
+ "null"
32926
+ ]
32927
+ },
32928
+ "local": {
32929
+ "type": "boolean"
32930
+ },
32931
+ "provider": {
32932
+ "type": [
32933
+ "string",
32934
+ "null"
32935
+ ],
32936
+ "enum": [
32937
+ "local",
32938
+ "openai",
32939
+ "openrouter",
32940
+ "vercel",
32941
+ "azure",
32942
+ "custom",
32943
+ null
32944
+ ]
32945
+ },
32946
+ "localDefault": {
32947
+ "type": [
32948
+ "object",
32949
+ "null"
32950
+ ],
32951
+ "properties": {
32952
+ "model": {
32953
+ "type": "string"
32954
+ }
32955
+ },
32956
+ "required": [
32957
+ "model"
32958
+ ]
32657
32959
  }
32658
32960
  },
32659
32961
  "required": [
32660
32962
  "configured",
32661
- "dimensions"
32963
+ "dimensions",
32964
+ "model",
32965
+ "local",
32966
+ "provider",
32967
+ "localDefault"
32662
32968
  ]
32663
32969
  },
32664
32970
  "integrations": {
@@ -32726,6 +33032,17 @@
32726
33032
  "id",
32727
33033
  "status"
32728
33034
  ]
33035
+ },
33036
+ "files": {
33037
+ "type": "object",
33038
+ "properties": {
33039
+ "enabled": {
33040
+ "type": "boolean"
33041
+ }
33042
+ },
33043
+ "required": [
33044
+ "enabled"
33045
+ ]
32729
33046
  }
32730
33047
  },
32731
33048
  "required": [
@@ -32733,7 +33050,8 @@
32733
33050
  "embeddings",
32734
33051
  "integrations",
32735
33052
  "agents",
32736
- "firstTask"
33053
+ "firstTask",
33054
+ "files"
32737
33055
  ]
32738
33056
  }
32739
33057
  },
@@ -32814,6 +33132,9 @@
32814
33132
  "OPENAI_API_KEY",
32815
33133
  "OPENROUTER_API_KEY"
32816
33134
  ]
33135
+ },
33136
+ "restoreDefault": {
33137
+ "type": "boolean"
32817
33138
  }
32818
33139
  },
32819
33140
  "required": [
@@ -32999,155 +33320,528 @@
32999
33320
  }
33000
33321
  }
33001
33322
  },
33002
- "/api/tasks": {
33323
+ "/agentfs/{path}": {
33003
33324
  "get": {
33004
- "summary": "List tasks with filters",
33005
- "description": "Returns tasks with the full `task` text replaced by a bounded `taskPreview` and completion/integration blobs dropped by default — list views only need the preview. Pass `fields=full` to restore the full `AgentTask`, or `fields=timeline` for the narrow shape the dashboard timeline draws. Every shape gives a user caller only tasks of sessions they can read. Fetch a single task in full via `GET /api/tasks/{id}`. `total` (the filtered row count, ignoring limit/offset) is computed only with `includeTotal=true`.",
33325
+ "summary": "Streaming pass-through proxy to agent-fs (enabled by AGENT_FS_PROXY)",
33006
33326
  "tags": [
33007
- "Tasks"
33008
- ],
33009
- "security": [
33010
- {
33011
- "bearerAuth": []
33012
- }
33327
+ "Comb"
33013
33328
  ],
33014
- "parameters": [
33015
- {
33016
- "schema": {
33017
- "type": "string"
33018
- },
33019
- "required": false,
33020
- "name": "status",
33021
- "in": "query"
33329
+ "responses": {
33330
+ "200": {
33331
+ "description": "Upstream agent-fs response, streamed verbatim"
33022
33332
  },
33023
- {
33024
- "schema": {
33025
- "type": "string"
33026
- },
33027
- "required": false,
33028
- "name": "agentId",
33029
- "in": "query"
33333
+ "401": {
33334
+ "description": "Returned by agent-fs when credentials are missing or invalid, or by the swarm when POST /agentfs/auth/register has no swarm credential",
33335
+ "content": {
33336
+ "application/json": {
33337
+ "schema": {
33338
+ "$ref": "#/components/schemas/ErrorResponse"
33339
+ }
33340
+ }
33341
+ }
33030
33342
  },
33031
- {
33032
- "schema": {
33033
- "type": "string"
33034
- },
33035
- "required": false,
33036
- "name": "scheduleId",
33037
- "in": "query"
33343
+ "403": {
33344
+ "description": "POST /agentfs/auth/register with a user token for an email that is not the user's",
33345
+ "content": {
33346
+ "application/json": {
33347
+ "schema": {
33348
+ "$ref": "#/components/schemas/ErrorResponse"
33349
+ }
33350
+ }
33351
+ }
33038
33352
  },
33039
- {
33040
- "schema": {
33041
- "type": "string",
33042
- "format": "uuid"
33043
- },
33044
- "required": false,
33045
- "name": "workflowRunId",
33046
- "in": "query"
33353
+ "413": {
33354
+ "description": "POST /agentfs/auth/register body over 16 KB",
33355
+ "content": {
33356
+ "application/json": {
33357
+ "schema": {
33358
+ "$ref": "#/components/schemas/ErrorResponse"
33359
+ }
33360
+ }
33361
+ }
33047
33362
  },
33048
- {
33049
- "schema": {
33050
- "type": "string",
33051
- "minLength": 1,
33052
- "maxLength": 255,
33053
- "description": "Non-unique asset directory namespace (for example shared/ or personal/<user-id>/drafts/). Runtime write boundaries normalize and validate the canonical form."
33054
- },
33055
- "required": false,
33056
- "description": "Non-unique asset directory namespace (for example shared/ or personal/<user-id>/drafts/). Runtime write boundaries normalize and validate the canonical form.",
33057
- "name": "key",
33058
- "in": "query"
33363
+ "429": {
33364
+ "description": "Too many registrations from this IP (POST /agentfs/auth/register)",
33365
+ "content": {
33366
+ "application/json": {
33367
+ "schema": {
33368
+ "$ref": "#/components/schemas/ErrorResponse"
33369
+ }
33370
+ }
33371
+ }
33059
33372
  },
33060
- {
33061
- "schema": {
33062
- "type": "string",
33063
- "minLength": 1,
33064
- "maxLength": 255,
33065
- "description": "Non-unique asset directory namespace (for example shared/ or personal/<user-id>/drafts/). Runtime write boundaries normalize and validate the canonical form."
33066
- },
33067
- "required": false,
33068
- "description": "Non-unique asset directory namespace (for example shared/ or personal/<user-id>/drafts/). Runtime write boundaries normalize and validate the canonical form.",
33069
- "name": "keyPrefix",
33070
- "in": "query"
33373
+ "502": {
33374
+ "description": "agent-fs is unreachable",
33375
+ "content": {
33376
+ "application/json": {
33377
+ "schema": {
33378
+ "$ref": "#/components/schemas/ErrorResponse"
33379
+ }
33380
+ }
33381
+ }
33382
+ }
33383
+ }
33384
+ },
33385
+ "post": {
33386
+ "summary": "Streaming pass-through proxy to agent-fs (enabled by AGENT_FS_PROXY)",
33387
+ "tags": [
33388
+ "Comb"
33389
+ ],
33390
+ "responses": {
33391
+ "200": {
33392
+ "description": "Upstream agent-fs response, streamed verbatim"
33071
33393
  },
33072
- {
33073
- "schema": {
33074
- "type": "string"
33075
- },
33076
- "required": false,
33077
- "name": "search",
33078
- "in": "query"
33394
+ "401": {
33395
+ "description": "Returned by agent-fs when credentials are missing or invalid, or by the swarm when POST /agentfs/auth/register has no swarm credential",
33396
+ "content": {
33397
+ "application/json": {
33398
+ "schema": {
33399
+ "$ref": "#/components/schemas/ErrorResponse"
33400
+ }
33401
+ }
33402
+ }
33079
33403
  },
33080
- {
33081
- "schema": {
33082
- "type": "string",
33083
- "enum": [
33084
- "true",
33085
- "false"
33086
- ]
33087
- },
33088
- "required": false,
33089
- "name": "includeHeartbeat",
33090
- "in": "query"
33404
+ "403": {
33405
+ "description": "POST /agentfs/auth/register with a user token for an email that is not the user's",
33406
+ "content": {
33407
+ "application/json": {
33408
+ "schema": {
33409
+ "$ref": "#/components/schemas/ErrorResponse"
33410
+ }
33411
+ }
33412
+ }
33091
33413
  },
33092
- {
33093
- "schema": {
33094
- "type": "string",
33095
- "format": "date-time"
33096
- },
33097
- "required": false,
33098
- "name": "createdAfter",
33099
- "in": "query"
33414
+ "413": {
33415
+ "description": "POST /agentfs/auth/register body over 16 KB",
33416
+ "content": {
33417
+ "application/json": {
33418
+ "schema": {
33419
+ "$ref": "#/components/schemas/ErrorResponse"
33420
+ }
33421
+ }
33422
+ }
33100
33423
  },
33101
- {
33102
- "schema": {
33103
- "type": "string",
33104
- "format": "date-time"
33105
- },
33106
- "required": false,
33107
- "name": "createdBefore",
33108
- "in": "query"
33424
+ "429": {
33425
+ "description": "Too many registrations from this IP (POST /agentfs/auth/register)",
33426
+ "content": {
33427
+ "application/json": {
33428
+ "schema": {
33429
+ "$ref": "#/components/schemas/ErrorResponse"
33430
+ }
33431
+ }
33432
+ }
33109
33433
  },
33110
- {
33111
- "schema": {
33112
- "type": "string"
33113
- },
33114
- "required": false,
33115
- "name": "source",
33116
- "in": "query"
33434
+ "502": {
33435
+ "description": "agent-fs is unreachable",
33436
+ "content": {
33437
+ "application/json": {
33438
+ "schema": {
33439
+ "$ref": "#/components/schemas/ErrorResponse"
33440
+ }
33441
+ }
33442
+ }
33443
+ }
33444
+ }
33445
+ },
33446
+ "put": {
33447
+ "summary": "Streaming pass-through proxy to agent-fs (enabled by AGENT_FS_PROXY)",
33448
+ "tags": [
33449
+ "Comb"
33450
+ ],
33451
+ "responses": {
33452
+ "200": {
33453
+ "description": "Upstream agent-fs response, streamed verbatim"
33117
33454
  },
33118
- {
33119
- "schema": {
33120
- "type": "string",
33121
- "minLength": 1
33122
- },
33123
- "required": false,
33124
- "name": "requestedByUserId",
33125
- "in": "query"
33455
+ "401": {
33456
+ "description": "Returned by agent-fs when credentials are missing or invalid, or by the swarm when POST /agentfs/auth/register has no swarm credential",
33457
+ "content": {
33458
+ "application/json": {
33459
+ "schema": {
33460
+ "$ref": "#/components/schemas/ErrorResponse"
33461
+ }
33462
+ }
33463
+ }
33126
33464
  },
33127
- {
33128
- "schema": {
33129
- "type": "string",
33130
- "enum": [
33131
- "lastUpdatedAt",
33132
- "createdAt"
33133
- ]
33134
- },
33135
- "required": false,
33136
- "name": "orderBy",
33137
- "in": "query"
33465
+ "403": {
33466
+ "description": "POST /agentfs/auth/register with a user token for an email that is not the user's",
33467
+ "content": {
33468
+ "application/json": {
33469
+ "schema": {
33470
+ "$ref": "#/components/schemas/ErrorResponse"
33471
+ }
33472
+ }
33473
+ }
33138
33474
  },
33139
- {
33140
- "schema": {
33141
- "type": [
33142
- "integer",
33143
- "null"
33144
- ]
33145
- },
33146
- "required": false,
33147
- "name": "limit",
33148
- "in": "query"
33475
+ "413": {
33476
+ "description": "POST /agentfs/auth/register body over 16 KB",
33477
+ "content": {
33478
+ "application/json": {
33479
+ "schema": {
33480
+ "$ref": "#/components/schemas/ErrorResponse"
33481
+ }
33482
+ }
33483
+ }
33149
33484
  },
33150
- {
33485
+ "429": {
33486
+ "description": "Too many registrations from this IP (POST /agentfs/auth/register)",
33487
+ "content": {
33488
+ "application/json": {
33489
+ "schema": {
33490
+ "$ref": "#/components/schemas/ErrorResponse"
33491
+ }
33492
+ }
33493
+ }
33494
+ },
33495
+ "502": {
33496
+ "description": "agent-fs is unreachable",
33497
+ "content": {
33498
+ "application/json": {
33499
+ "schema": {
33500
+ "$ref": "#/components/schemas/ErrorResponse"
33501
+ }
33502
+ }
33503
+ }
33504
+ }
33505
+ }
33506
+ },
33507
+ "delete": {
33508
+ "summary": "Streaming pass-through proxy to agent-fs (enabled by AGENT_FS_PROXY)",
33509
+ "tags": [
33510
+ "Comb"
33511
+ ],
33512
+ "responses": {
33513
+ "200": {
33514
+ "description": "Upstream agent-fs response, streamed verbatim"
33515
+ },
33516
+ "401": {
33517
+ "description": "Returned by agent-fs when credentials are missing or invalid, or by the swarm when POST /agentfs/auth/register has no swarm credential",
33518
+ "content": {
33519
+ "application/json": {
33520
+ "schema": {
33521
+ "$ref": "#/components/schemas/ErrorResponse"
33522
+ }
33523
+ }
33524
+ }
33525
+ },
33526
+ "403": {
33527
+ "description": "POST /agentfs/auth/register with a user token for an email that is not the user's",
33528
+ "content": {
33529
+ "application/json": {
33530
+ "schema": {
33531
+ "$ref": "#/components/schemas/ErrorResponse"
33532
+ }
33533
+ }
33534
+ }
33535
+ },
33536
+ "413": {
33537
+ "description": "POST /agentfs/auth/register body over 16 KB",
33538
+ "content": {
33539
+ "application/json": {
33540
+ "schema": {
33541
+ "$ref": "#/components/schemas/ErrorResponse"
33542
+ }
33543
+ }
33544
+ }
33545
+ },
33546
+ "429": {
33547
+ "description": "Too many registrations from this IP (POST /agentfs/auth/register)",
33548
+ "content": {
33549
+ "application/json": {
33550
+ "schema": {
33551
+ "$ref": "#/components/schemas/ErrorResponse"
33552
+ }
33553
+ }
33554
+ }
33555
+ },
33556
+ "502": {
33557
+ "description": "agent-fs is unreachable",
33558
+ "content": {
33559
+ "application/json": {
33560
+ "schema": {
33561
+ "$ref": "#/components/schemas/ErrorResponse"
33562
+ }
33563
+ }
33564
+ }
33565
+ }
33566
+ }
33567
+ },
33568
+ "patch": {
33569
+ "summary": "Streaming pass-through proxy to agent-fs (enabled by AGENT_FS_PROXY)",
33570
+ "tags": [
33571
+ "Comb"
33572
+ ],
33573
+ "responses": {
33574
+ "200": {
33575
+ "description": "Upstream agent-fs response, streamed verbatim"
33576
+ },
33577
+ "401": {
33578
+ "description": "Returned by agent-fs when credentials are missing or invalid, or by the swarm when POST /agentfs/auth/register has no swarm credential",
33579
+ "content": {
33580
+ "application/json": {
33581
+ "schema": {
33582
+ "$ref": "#/components/schemas/ErrorResponse"
33583
+ }
33584
+ }
33585
+ }
33586
+ },
33587
+ "403": {
33588
+ "description": "POST /agentfs/auth/register with a user token for an email that is not the user's",
33589
+ "content": {
33590
+ "application/json": {
33591
+ "schema": {
33592
+ "$ref": "#/components/schemas/ErrorResponse"
33593
+ }
33594
+ }
33595
+ }
33596
+ },
33597
+ "413": {
33598
+ "description": "POST /agentfs/auth/register body over 16 KB",
33599
+ "content": {
33600
+ "application/json": {
33601
+ "schema": {
33602
+ "$ref": "#/components/schemas/ErrorResponse"
33603
+ }
33604
+ }
33605
+ }
33606
+ },
33607
+ "429": {
33608
+ "description": "Too many registrations from this IP (POST /agentfs/auth/register)",
33609
+ "content": {
33610
+ "application/json": {
33611
+ "schema": {
33612
+ "$ref": "#/components/schemas/ErrorResponse"
33613
+ }
33614
+ }
33615
+ }
33616
+ },
33617
+ "502": {
33618
+ "description": "agent-fs is unreachable",
33619
+ "content": {
33620
+ "application/json": {
33621
+ "schema": {
33622
+ "$ref": "#/components/schemas/ErrorResponse"
33623
+ }
33624
+ }
33625
+ }
33626
+ }
33627
+ }
33628
+ }
33629
+ },
33630
+ "/share/{path}": {
33631
+ "get": {
33632
+ "summary": "Public agent-fs share page, served through the API (enabled by AGENT_FS_PROXY)",
33633
+ "tags": [
33634
+ "Comb"
33635
+ ],
33636
+ "responses": {
33637
+ "200": {
33638
+ "description": "agent-fs /share response, streamed verbatim"
33639
+ },
33640
+ "404": {
33641
+ "description": "Unknown or expired link (from agent-fs), or the proxy is off",
33642
+ "content": {
33643
+ "application/json": {
33644
+ "schema": {
33645
+ "$ref": "#/components/schemas/ErrorResponse"
33646
+ }
33647
+ }
33648
+ }
33649
+ },
33650
+ "502": {
33651
+ "description": "agent-fs is unreachable",
33652
+ "content": {
33653
+ "application/json": {
33654
+ "schema": {
33655
+ "$ref": "#/components/schemas/ErrorResponse"
33656
+ }
33657
+ }
33658
+ }
33659
+ }
33660
+ }
33661
+ }
33662
+ },
33663
+ "/site/{path}": {
33664
+ "get": {
33665
+ "summary": "Public agent-fs site page, served through the API (enabled by AGENT_FS_PROXY)",
33666
+ "tags": [
33667
+ "Comb"
33668
+ ],
33669
+ "responses": {
33670
+ "200": {
33671
+ "description": "agent-fs /site response, streamed verbatim"
33672
+ },
33673
+ "404": {
33674
+ "description": "Unknown or expired link (from agent-fs), or the proxy is off",
33675
+ "content": {
33676
+ "application/json": {
33677
+ "schema": {
33678
+ "$ref": "#/components/schemas/ErrorResponse"
33679
+ }
33680
+ }
33681
+ }
33682
+ },
33683
+ "502": {
33684
+ "description": "agent-fs is unreachable",
33685
+ "content": {
33686
+ "application/json": {
33687
+ "schema": {
33688
+ "$ref": "#/components/schemas/ErrorResponse"
33689
+ }
33690
+ }
33691
+ }
33692
+ }
33693
+ }
33694
+ }
33695
+ },
33696
+ "/api/tasks": {
33697
+ "get": {
33698
+ "summary": "List tasks with filters",
33699
+ "description": "Returns tasks with the full `task` text replaced by a bounded `taskPreview` and completion/integration blobs dropped by default — list views only need the preview. Pass `fields=full` to restore the full `AgentTask`, or `fields=timeline` for the narrow shape the dashboard timeline draws. Every shape gives a user caller only tasks of sessions they can read. Fetch a single task in full via `GET /api/tasks/{id}`. `total` (the filtered row count, ignoring limit/offset) is computed only with `includeTotal=true`.",
33700
+ "tags": [
33701
+ "Tasks"
33702
+ ],
33703
+ "security": [
33704
+ {
33705
+ "bearerAuth": []
33706
+ }
33707
+ ],
33708
+ "parameters": [
33709
+ {
33710
+ "schema": {
33711
+ "type": "string"
33712
+ },
33713
+ "required": false,
33714
+ "name": "status",
33715
+ "in": "query"
33716
+ },
33717
+ {
33718
+ "schema": {
33719
+ "type": "string"
33720
+ },
33721
+ "required": false,
33722
+ "name": "agentId",
33723
+ "in": "query"
33724
+ },
33725
+ {
33726
+ "schema": {
33727
+ "type": "string"
33728
+ },
33729
+ "required": false,
33730
+ "name": "scheduleId",
33731
+ "in": "query"
33732
+ },
33733
+ {
33734
+ "schema": {
33735
+ "type": "string",
33736
+ "format": "uuid"
33737
+ },
33738
+ "required": false,
33739
+ "name": "workflowRunId",
33740
+ "in": "query"
33741
+ },
33742
+ {
33743
+ "schema": {
33744
+ "type": "string",
33745
+ "minLength": 1,
33746
+ "maxLength": 255,
33747
+ "description": "Non-unique asset directory namespace (for example shared/ or personal/<user-id>/drafts/). Runtime write boundaries normalize and validate the canonical form."
33748
+ },
33749
+ "required": false,
33750
+ "description": "Non-unique asset directory namespace (for example shared/ or personal/<user-id>/drafts/). Runtime write boundaries normalize and validate the canonical form.",
33751
+ "name": "key",
33752
+ "in": "query"
33753
+ },
33754
+ {
33755
+ "schema": {
33756
+ "type": "string",
33757
+ "minLength": 1,
33758
+ "maxLength": 255,
33759
+ "description": "Non-unique asset directory namespace (for example shared/ or personal/<user-id>/drafts/). Runtime write boundaries normalize and validate the canonical form."
33760
+ },
33761
+ "required": false,
33762
+ "description": "Non-unique asset directory namespace (for example shared/ or personal/<user-id>/drafts/). Runtime write boundaries normalize and validate the canonical form.",
33763
+ "name": "keyPrefix",
33764
+ "in": "query"
33765
+ },
33766
+ {
33767
+ "schema": {
33768
+ "type": "string"
33769
+ },
33770
+ "required": false,
33771
+ "name": "search",
33772
+ "in": "query"
33773
+ },
33774
+ {
33775
+ "schema": {
33776
+ "type": "string",
33777
+ "enum": [
33778
+ "true",
33779
+ "false"
33780
+ ]
33781
+ },
33782
+ "required": false,
33783
+ "name": "includeHeartbeat",
33784
+ "in": "query"
33785
+ },
33786
+ {
33787
+ "schema": {
33788
+ "type": "string",
33789
+ "format": "date-time"
33790
+ },
33791
+ "required": false,
33792
+ "name": "createdAfter",
33793
+ "in": "query"
33794
+ },
33795
+ {
33796
+ "schema": {
33797
+ "type": "string",
33798
+ "format": "date-time"
33799
+ },
33800
+ "required": false,
33801
+ "name": "createdBefore",
33802
+ "in": "query"
33803
+ },
33804
+ {
33805
+ "schema": {
33806
+ "type": "string"
33807
+ },
33808
+ "required": false,
33809
+ "name": "source",
33810
+ "in": "query"
33811
+ },
33812
+ {
33813
+ "schema": {
33814
+ "type": "string",
33815
+ "minLength": 1
33816
+ },
33817
+ "required": false,
33818
+ "name": "requestedByUserId",
33819
+ "in": "query"
33820
+ },
33821
+ {
33822
+ "schema": {
33823
+ "type": "string",
33824
+ "enum": [
33825
+ "lastUpdatedAt",
33826
+ "createdAt"
33827
+ ]
33828
+ },
33829
+ "required": false,
33830
+ "name": "orderBy",
33831
+ "in": "query"
33832
+ },
33833
+ {
33834
+ "schema": {
33835
+ "type": [
33836
+ "integer",
33837
+ "null"
33838
+ ]
33839
+ },
33840
+ "required": false,
33841
+ "name": "limit",
33842
+ "in": "query"
33843
+ },
33844
+ {
33151
33845
  "schema": {
33152
33846
  "type": [
33153
33847
  "integer",
@@ -54036,6 +54730,17 @@
54036
54730
  "workspace-rw"
54037
54731
  ],
54038
54732
  "default": "none"
54733
+ },
54734
+ "executor": {
54735
+ "type": [
54736
+ "string",
54737
+ "null"
54738
+ ],
54739
+ "enum": [
54740
+ "native",
54741
+ "quickjs",
54742
+ null
54743
+ ]
54039
54744
  }
54040
54745
  },
54041
54746
  "required": [
@@ -54163,6 +54868,17 @@
54163
54868
  ],
54164
54869
  "default": "none"
54165
54870
  },
54871
+ "executor": {
54872
+ "type": [
54873
+ "string",
54874
+ "null"
54875
+ ],
54876
+ "enum": [
54877
+ "native",
54878
+ "quickjs",
54879
+ null
54880
+ ]
54881
+ },
54166
54882
  "idempotencyKey": {
54167
54883
  "type": "string",
54168
54884
  "maxLength": 200
@@ -54749,6 +55465,18 @@
54749
55465
  "workspace-rw"
54750
55466
  ]
54751
55467
  },
55468
+ "executor": {
55469
+ "type": [
55470
+ "string",
55471
+ "null"
55472
+ ],
55473
+ "enum": [
55474
+ "native",
55475
+ "quickjs",
55476
+ null
55477
+ ],
55478
+ "default": null
55479
+ },
54752
55480
  "createdByAgentId": {
54753
55481
  "type": [
54754
55482
  "string",
@@ -54924,6 +55652,18 @@
54924
55652
  "workspace-rw"
54925
55653
  ]
54926
55654
  },
55655
+ "executor": {
55656
+ "type": [
55657
+ "string",
55658
+ "null"
55659
+ ],
55660
+ "enum": [
55661
+ "native",
55662
+ "quickjs",
55663
+ null
55664
+ ],
55665
+ "default": null
55666
+ },
54927
55667
  "createdByAgentId": {
54928
55668
  "type": [
54929
55669
  "string",
@@ -59112,6 +59852,31 @@
59112
59852
  "type": "null"
59113
59853
  }
59114
59854
  ]
59855
+ },
59856
+ "grants": {
59857
+ "type": "object",
59858
+ "properties": {
59859
+ "grantsAll": {
59860
+ "type": "boolean"
59861
+ },
59862
+ "verbs": {
59863
+ "type": "array",
59864
+ "items": {
59865
+ "type": "string"
59866
+ }
59867
+ },
59868
+ "roles": {
59869
+ "type": "array",
59870
+ "items": {
59871
+ "type": "string"
59872
+ }
59873
+ }
59874
+ },
59875
+ "required": [
59876
+ "grantsAll",
59877
+ "verbs",
59878
+ "roles"
59879
+ ]
59115
59880
  }
59116
59881
  },
59117
59882
  "required": [
@@ -60590,8 +61355,604 @@
60590
61355
  }
60591
61356
  },
60592
61357
  "required": [
60593
- "plaintext",
60594
- "user"
61358
+ "plaintext",
61359
+ "user"
61360
+ ]
61361
+ }
61362
+ }
61363
+ }
61364
+ },
61365
+ "401": {
61366
+ "description": "Unauthorized",
61367
+ "content": {
61368
+ "application/json": {
61369
+ "schema": {
61370
+ "$ref": "#/components/schemas/ErrorResponse"
61371
+ }
61372
+ }
61373
+ }
61374
+ },
61375
+ "404": {
61376
+ "description": "User not found",
61377
+ "content": {
61378
+ "application/json": {
61379
+ "schema": {
61380
+ "$ref": "#/components/schemas/ErrorResponse"
61381
+ }
61382
+ }
61383
+ }
61384
+ }
61385
+ }
61386
+ }
61387
+ },
61388
+ "/api/users/{id}/mcp-tokens/{tokenId}": {
61389
+ "delete": {
61390
+ "summary": "Revoke a user's MCP token",
61391
+ "tags": [
61392
+ "Users"
61393
+ ],
61394
+ "security": [
61395
+ {
61396
+ "bearerAuth": []
61397
+ }
61398
+ ],
61399
+ "parameters": [
61400
+ {
61401
+ "schema": {
61402
+ "type": "string"
61403
+ },
61404
+ "required": true,
61405
+ "name": "id",
61406
+ "in": "path"
61407
+ },
61408
+ {
61409
+ "schema": {
61410
+ "type": "string"
61411
+ },
61412
+ "required": true,
61413
+ "name": "tokenId",
61414
+ "in": "path"
61415
+ }
61416
+ ],
61417
+ "responses": {
61418
+ "200": {
61419
+ "description": "Composed user after token revocation",
61420
+ "content": {
61421
+ "application/json": {
61422
+ "schema": {
61423
+ "type": "object",
61424
+ "properties": {
61425
+ "user": {
61426
+ "anyOf": [
61427
+ {
61428
+ "allOf": [
61429
+ {
61430
+ "$ref": "#/components/schemas/User"
61431
+ },
61432
+ {
61433
+ "type": "object",
61434
+ "properties": {
61435
+ "identities": {
61436
+ "type": "array",
61437
+ "items": {
61438
+ "type": "object",
61439
+ "properties": {
61440
+ "kind": {
61441
+ "type": "string"
61442
+ },
61443
+ "externalId": {
61444
+ "type": "string"
61445
+ }
61446
+ },
61447
+ "required": [
61448
+ "kind",
61449
+ "externalId"
61450
+ ]
61451
+ }
61452
+ },
61453
+ "tokens": {
61454
+ "type": "array",
61455
+ "items": {
61456
+ "type": "object",
61457
+ "properties": {
61458
+ "id": {
61459
+ "type": "string"
61460
+ },
61461
+ "userId": {
61462
+ "type": "string"
61463
+ },
61464
+ "label": {
61465
+ "type": [
61466
+ "string",
61467
+ "null"
61468
+ ]
61469
+ },
61470
+ "tokenPreview": {
61471
+ "type": "string"
61472
+ },
61473
+ "createdAt": {
61474
+ "type": "string"
61475
+ },
61476
+ "lastUsedAt": {
61477
+ "type": [
61478
+ "string",
61479
+ "null"
61480
+ ]
61481
+ },
61482
+ "revokedAt": {
61483
+ "type": [
61484
+ "string",
61485
+ "null"
61486
+ ]
61487
+ }
61488
+ },
61489
+ "required": [
61490
+ "id",
61491
+ "userId",
61492
+ "label",
61493
+ "tokenPreview",
61494
+ "createdAt",
61495
+ "lastUsedAt",
61496
+ "revokedAt"
61497
+ ]
61498
+ }
61499
+ },
61500
+ "recentEvents": {
61501
+ "type": "array",
61502
+ "items": {
61503
+ "type": "object",
61504
+ "properties": {
61505
+ "id": {
61506
+ "type": "string"
61507
+ },
61508
+ "userId": {
61509
+ "type": "string"
61510
+ },
61511
+ "eventType": {
61512
+ "type": "string"
61513
+ },
61514
+ "actor": {
61515
+ "type": "string"
61516
+ },
61517
+ "before": {},
61518
+ "after": {},
61519
+ "createdAt": {
61520
+ "type": "string"
61521
+ }
61522
+ },
61523
+ "required": [
61524
+ "id",
61525
+ "userId",
61526
+ "eventType",
61527
+ "actor",
61528
+ "createdAt"
61529
+ ]
61530
+ }
61531
+ }
61532
+ },
61533
+ "required": [
61534
+ "identities",
61535
+ "tokens",
61536
+ "recentEvents"
61537
+ ]
61538
+ }
61539
+ ]
61540
+ },
61541
+ {
61542
+ "type": "null"
61543
+ }
61544
+ ]
61545
+ }
61546
+ },
61547
+ "required": [
61548
+ "user"
61549
+ ]
61550
+ }
61551
+ }
61552
+ }
61553
+ },
61554
+ "401": {
61555
+ "description": "Unauthorized",
61556
+ "content": {
61557
+ "application/json": {
61558
+ "schema": {
61559
+ "$ref": "#/components/schemas/ErrorResponse"
61560
+ }
61561
+ }
61562
+ }
61563
+ },
61564
+ "404": {
61565
+ "description": "User or token not found",
61566
+ "content": {
61567
+ "application/json": {
61568
+ "schema": {
61569
+ "$ref": "#/components/schemas/ErrorResponse"
61570
+ }
61571
+ }
61572
+ }
61573
+ }
61574
+ }
61575
+ }
61576
+ },
61577
+ "/api/users/{id}/connector-codes": {
61578
+ "post": {
61579
+ "summary": "Create a single-use connect code for the agent-swarm.dev ChatGPT connector",
61580
+ "description": "Returns a 10-minute single-use code and the connector URL that carries it. The connector trades the code for an MCP token at POST /api/connector/exchange.",
61581
+ "tags": [
61582
+ "Users"
61583
+ ],
61584
+ "security": [
61585
+ {
61586
+ "bearerAuth": []
61587
+ }
61588
+ ],
61589
+ "parameters": [
61590
+ {
61591
+ "schema": {
61592
+ "type": "string"
61593
+ },
61594
+ "required": true,
61595
+ "name": "id",
61596
+ "in": "path"
61597
+ }
61598
+ ],
61599
+ "requestBody": {
61600
+ "content": {
61601
+ "application/json": {
61602
+ "schema": {
61603
+ "type": "object",
61604
+ "properties": {
61605
+ "label": {
61606
+ "type": "string",
61607
+ "minLength": 1
61608
+ }
61609
+ }
61610
+ }
61611
+ }
61612
+ }
61613
+ },
61614
+ "responses": {
61615
+ "201": {
61616
+ "description": "Connect code, its expiry and the connector URL",
61617
+ "content": {
61618
+ "application/json": {
61619
+ "schema": {
61620
+ "type": "object",
61621
+ "properties": {
61622
+ "code": {
61623
+ "type": "string"
61624
+ },
61625
+ "expiresAt": {
61626
+ "type": "string"
61627
+ },
61628
+ "connectUrl": {
61629
+ "type": "string"
61630
+ }
61631
+ },
61632
+ "required": [
61633
+ "code",
61634
+ "expiresAt",
61635
+ "connectUrl"
61636
+ ]
61637
+ }
61638
+ }
61639
+ }
61640
+ },
61641
+ "400": {
61642
+ "description": "The public API origin or CONNECTOR_CONNECT_URL is not HTTPS",
61643
+ "content": {
61644
+ "application/json": {
61645
+ "schema": {
61646
+ "$ref": "#/components/schemas/ErrorResponse"
61647
+ }
61648
+ }
61649
+ }
61650
+ },
61651
+ "401": {
61652
+ "description": "Unauthorized",
61653
+ "content": {
61654
+ "application/json": {
61655
+ "schema": {
61656
+ "$ref": "#/components/schemas/ErrorResponse"
61657
+ }
61658
+ }
61659
+ }
61660
+ },
61661
+ "404": {
61662
+ "description": "User not found",
61663
+ "content": {
61664
+ "application/json": {
61665
+ "schema": {
61666
+ "$ref": "#/components/schemas/ErrorResponse"
61667
+ }
61668
+ }
61669
+ }
61670
+ }
61671
+ }
61672
+ }
61673
+ },
61674
+ "/api/connector/exchange": {
61675
+ "post": {
61676
+ "summary": "Exchange a connect code for a user MCP token",
61677
+ "description": "Unauthenticated: the single-use code is the credential. Rate limited per IP. Unknown, expired and used codes all return 404 code_invalid.",
61678
+ "tags": [
61679
+ "Users"
61680
+ ],
61681
+ "requestBody": {
61682
+ "content": {
61683
+ "application/json": {
61684
+ "schema": {
61685
+ "type": "object",
61686
+ "properties": {
61687
+ "code": {
61688
+ "type": "string",
61689
+ "minLength": 1,
61690
+ "maxLength": 256
61691
+ }
61692
+ },
61693
+ "required": [
61694
+ "code"
61695
+ ]
61696
+ }
61697
+ }
61698
+ }
61699
+ },
61700
+ "responses": {
61701
+ "200": {
61702
+ "description": "Minted MCP token for the code's user",
61703
+ "content": {
61704
+ "application/json": {
61705
+ "schema": {
61706
+ "type": "object",
61707
+ "properties": {
61708
+ "token": {
61709
+ "type": "string"
61710
+ },
61711
+ "userId": {
61712
+ "type": "string"
61713
+ },
61714
+ "version": {
61715
+ "type": "string"
61716
+ }
61717
+ },
61718
+ "required": [
61719
+ "token",
61720
+ "userId",
61721
+ "version"
61722
+ ]
61723
+ }
61724
+ }
61725
+ }
61726
+ },
61727
+ "404": {
61728
+ "description": "Code unknown, malformed, expired or already used",
61729
+ "content": {
61730
+ "application/json": {
61731
+ "schema": {
61732
+ "$ref": "#/components/schemas/ErrorResponse"
61733
+ }
61734
+ }
61735
+ }
61736
+ },
61737
+ "413": {
61738
+ "description": "Request body too large",
61739
+ "content": {
61740
+ "application/json": {
61741
+ "schema": {
61742
+ "$ref": "#/components/schemas/ErrorResponse"
61743
+ }
61744
+ }
61745
+ }
61746
+ },
61747
+ "429": {
61748
+ "description": "Rate limited",
61749
+ "content": {
61750
+ "application/json": {
61751
+ "schema": {
61752
+ "$ref": "#/components/schemas/ErrorResponse"
61753
+ }
61754
+ }
61755
+ }
61756
+ }
61757
+ }
61758
+ }
61759
+ },
61760
+ "/api/invites": {
61761
+ "post": {
61762
+ "summary": "Invite a teammate with a one-time API link",
61763
+ "description": "Creates an invited user with the given role (requester by default) and returns a 7-day single-use API link. The API redirects to the current APP_URL dashboard with the code in the URL fragment. The browser exchanges the code at POST /api/invites/exchange for a personal MCP token. Re-inviting an invited user replaces the role and link. Active or suspended users return 409 user_exists. No email is sent.",
61764
+ "tags": [
61765
+ "Users"
61766
+ ],
61767
+ "security": [
61768
+ {
61769
+ "bearerAuth": []
61770
+ }
61771
+ ],
61772
+ "requestBody": {
61773
+ "content": {
61774
+ "application/json": {
61775
+ "schema": {
61776
+ "type": "object",
61777
+ "properties": {
61778
+ "email": {
61779
+ "type": "string",
61780
+ "format": "email"
61781
+ },
61782
+ "name": {
61783
+ "type": "string",
61784
+ "minLength": 1,
61785
+ "maxLength": 200
61786
+ },
61787
+ "role": {
61788
+ "type": "string",
61789
+ "enum": [
61790
+ "requester",
61791
+ "viewer",
61792
+ "admin"
61793
+ ],
61794
+ "default": "requester"
61795
+ }
61796
+ },
61797
+ "required": [
61798
+ "email"
61799
+ ]
61800
+ }
61801
+ }
61802
+ }
61803
+ },
61804
+ "responses": {
61805
+ "201": {
61806
+ "description": "The invited user, API link, dashboard URL, expiry and API reachability",
61807
+ "content": {
61808
+ "application/json": {
61809
+ "schema": {
61810
+ "type": "object",
61811
+ "properties": {
61812
+ "user": {
61813
+ "anyOf": [
61814
+ {
61815
+ "allOf": [
61816
+ {
61817
+ "$ref": "#/components/schemas/User"
61818
+ },
61819
+ {
61820
+ "type": "object",
61821
+ "properties": {
61822
+ "identities": {
61823
+ "type": "array",
61824
+ "items": {
61825
+ "type": "object",
61826
+ "properties": {
61827
+ "kind": {
61828
+ "type": "string"
61829
+ },
61830
+ "externalId": {
61831
+ "type": "string"
61832
+ }
61833
+ },
61834
+ "required": [
61835
+ "kind",
61836
+ "externalId"
61837
+ ]
61838
+ }
61839
+ },
61840
+ "tokens": {
61841
+ "type": "array",
61842
+ "items": {
61843
+ "type": "object",
61844
+ "properties": {
61845
+ "id": {
61846
+ "type": "string"
61847
+ },
61848
+ "userId": {
61849
+ "type": "string"
61850
+ },
61851
+ "label": {
61852
+ "type": [
61853
+ "string",
61854
+ "null"
61855
+ ]
61856
+ },
61857
+ "tokenPreview": {
61858
+ "type": "string"
61859
+ },
61860
+ "createdAt": {
61861
+ "type": "string"
61862
+ },
61863
+ "lastUsedAt": {
61864
+ "type": [
61865
+ "string",
61866
+ "null"
61867
+ ]
61868
+ },
61869
+ "revokedAt": {
61870
+ "type": [
61871
+ "string",
61872
+ "null"
61873
+ ]
61874
+ }
61875
+ },
61876
+ "required": [
61877
+ "id",
61878
+ "userId",
61879
+ "label",
61880
+ "tokenPreview",
61881
+ "createdAt",
61882
+ "lastUsedAt",
61883
+ "revokedAt"
61884
+ ]
61885
+ }
61886
+ },
61887
+ "recentEvents": {
61888
+ "type": "array",
61889
+ "items": {
61890
+ "type": "object",
61891
+ "properties": {
61892
+ "id": {
61893
+ "type": "string"
61894
+ },
61895
+ "userId": {
61896
+ "type": "string"
61897
+ },
61898
+ "eventType": {
61899
+ "type": "string"
61900
+ },
61901
+ "actor": {
61902
+ "type": "string"
61903
+ },
61904
+ "before": {},
61905
+ "after": {},
61906
+ "createdAt": {
61907
+ "type": "string"
61908
+ }
61909
+ },
61910
+ "required": [
61911
+ "id",
61912
+ "userId",
61913
+ "eventType",
61914
+ "actor",
61915
+ "createdAt"
61916
+ ]
61917
+ }
61918
+ }
61919
+ },
61920
+ "required": [
61921
+ "identities",
61922
+ "tokens",
61923
+ "recentEvents"
61924
+ ]
61925
+ }
61926
+ ]
61927
+ },
61928
+ {
61929
+ "type": "null"
61930
+ }
61931
+ ]
61932
+ },
61933
+ "inviteUrl": {
61934
+ "type": "string"
61935
+ },
61936
+ "appUrl": {
61937
+ "type": "string"
61938
+ },
61939
+ "expiresAt": {
61940
+ "type": "string"
61941
+ },
61942
+ "apiReachable": {
61943
+ "type": "string",
61944
+ "enum": [
61945
+ "public",
61946
+ "local"
61947
+ ]
61948
+ }
61949
+ },
61950
+ "required": [
61951
+ "user",
61952
+ "inviteUrl",
61953
+ "appUrl",
61954
+ "expiresAt",
61955
+ "apiReachable"
60595
61956
  ]
60596
61957
  }
60597
61958
  }
@@ -60607,187 +61968,8 @@
60607
61968
  }
60608
61969
  }
60609
61970
  },
60610
- "404": {
60611
- "description": "User not found",
60612
- "content": {
60613
- "application/json": {
60614
- "schema": {
60615
- "$ref": "#/components/schemas/ErrorResponse"
60616
- }
60617
- }
60618
- }
60619
- }
60620
- }
60621
- }
60622
- },
60623
- "/api/users/{id}/mcp-tokens/{tokenId}": {
60624
- "delete": {
60625
- "summary": "Revoke a user's MCP token",
60626
- "tags": [
60627
- "Users"
60628
- ],
60629
- "security": [
60630
- {
60631
- "bearerAuth": []
60632
- }
60633
- ],
60634
- "parameters": [
60635
- {
60636
- "schema": {
60637
- "type": "string"
60638
- },
60639
- "required": true,
60640
- "name": "id",
60641
- "in": "path"
60642
- },
60643
- {
60644
- "schema": {
60645
- "type": "string"
60646
- },
60647
- "required": true,
60648
- "name": "tokenId",
60649
- "in": "path"
60650
- }
60651
- ],
60652
- "responses": {
60653
- "200": {
60654
- "description": "Composed user after token revocation",
60655
- "content": {
60656
- "application/json": {
60657
- "schema": {
60658
- "type": "object",
60659
- "properties": {
60660
- "user": {
60661
- "anyOf": [
60662
- {
60663
- "allOf": [
60664
- {
60665
- "$ref": "#/components/schemas/User"
60666
- },
60667
- {
60668
- "type": "object",
60669
- "properties": {
60670
- "identities": {
60671
- "type": "array",
60672
- "items": {
60673
- "type": "object",
60674
- "properties": {
60675
- "kind": {
60676
- "type": "string"
60677
- },
60678
- "externalId": {
60679
- "type": "string"
60680
- }
60681
- },
60682
- "required": [
60683
- "kind",
60684
- "externalId"
60685
- ]
60686
- }
60687
- },
60688
- "tokens": {
60689
- "type": "array",
60690
- "items": {
60691
- "type": "object",
60692
- "properties": {
60693
- "id": {
60694
- "type": "string"
60695
- },
60696
- "userId": {
60697
- "type": "string"
60698
- },
60699
- "label": {
60700
- "type": [
60701
- "string",
60702
- "null"
60703
- ]
60704
- },
60705
- "tokenPreview": {
60706
- "type": "string"
60707
- },
60708
- "createdAt": {
60709
- "type": "string"
60710
- },
60711
- "lastUsedAt": {
60712
- "type": [
60713
- "string",
60714
- "null"
60715
- ]
60716
- },
60717
- "revokedAt": {
60718
- "type": [
60719
- "string",
60720
- "null"
60721
- ]
60722
- }
60723
- },
60724
- "required": [
60725
- "id",
60726
- "userId",
60727
- "label",
60728
- "tokenPreview",
60729
- "createdAt",
60730
- "lastUsedAt",
60731
- "revokedAt"
60732
- ]
60733
- }
60734
- },
60735
- "recentEvents": {
60736
- "type": "array",
60737
- "items": {
60738
- "type": "object",
60739
- "properties": {
60740
- "id": {
60741
- "type": "string"
60742
- },
60743
- "userId": {
60744
- "type": "string"
60745
- },
60746
- "eventType": {
60747
- "type": "string"
60748
- },
60749
- "actor": {
60750
- "type": "string"
60751
- },
60752
- "before": {},
60753
- "after": {},
60754
- "createdAt": {
60755
- "type": "string"
60756
- }
60757
- },
60758
- "required": [
60759
- "id",
60760
- "userId",
60761
- "eventType",
60762
- "actor",
60763
- "createdAt"
60764
- ]
60765
- }
60766
- }
60767
- },
60768
- "required": [
60769
- "identities",
60770
- "tokens",
60771
- "recentEvents"
60772
- ]
60773
- }
60774
- ]
60775
- },
60776
- {
60777
- "type": "null"
60778
- }
60779
- ]
60780
- }
60781
- },
60782
- "required": [
60783
- "user"
60784
- ]
60785
- }
60786
- }
60787
- }
60788
- },
60789
- "401": {
60790
- "description": "Unauthorized",
61971
+ "403": {
61972
+ "description": "Not allowed to manage roles",
60791
61973
  "content": {
60792
61974
  "application/json": {
60793
61975
  "schema": {
@@ -60796,8 +61978,8 @@
60796
61978
  }
60797
61979
  }
60798
61980
  },
60799
- "404": {
60800
- "description": "User or token not found",
61981
+ "409": {
61982
+ "description": "The email belongs to an active or suspended user",
60801
61983
  "content": {
60802
61984
  "application/json": {
60803
61985
  "schema": {
@@ -60809,92 +61991,29 @@
60809
61991
  }
60810
61992
  }
60811
61993
  },
60812
- "/api/users/{id}/connector-codes": {
60813
- "post": {
60814
- "summary": "Create a single-use connect code for the agent-swarm.dev ChatGPT connector",
60815
- "description": "Returns a 10-minute single-use code and the connector URL that carries it. The connector trades the code for an MCP token at POST /api/connector/exchange.",
61994
+ "/invite/{code}": {
61995
+ "get": {
61996
+ "summary": "Open an invite in the configured dashboard",
61997
+ "description": "Redirects to the current APP_URL dashboard with the code in the URL fragment. Does not validate or consume the invite.",
60816
61998
  "tags": [
60817
61999
  "Users"
60818
62000
  ],
60819
- "security": [
60820
- {
60821
- "bearerAuth": []
60822
- }
60823
- ],
60824
62001
  "parameters": [
60825
62002
  {
60826
62003
  "schema": {
60827
62004
  "type": "string"
60828
62005
  },
60829
62006
  "required": true,
60830
- "name": "id",
62007
+ "name": "code",
60831
62008
  "in": "path"
60832
62009
  }
60833
62010
  ],
60834
- "requestBody": {
60835
- "content": {
60836
- "application/json": {
60837
- "schema": {
60838
- "type": "object",
60839
- "properties": {
60840
- "label": {
60841
- "type": "string",
60842
- "minLength": 1
60843
- }
60844
- }
60845
- }
60846
- }
60847
- }
60848
- },
60849
62011
  "responses": {
60850
- "201": {
60851
- "description": "Connect code, its expiry and the connector URL",
60852
- "content": {
60853
- "application/json": {
60854
- "schema": {
60855
- "type": "object",
60856
- "properties": {
60857
- "code": {
60858
- "type": "string"
60859
- },
60860
- "expiresAt": {
60861
- "type": "string"
60862
- },
60863
- "connectUrl": {
60864
- "type": "string"
60865
- }
60866
- },
60867
- "required": [
60868
- "code",
60869
- "expiresAt",
60870
- "connectUrl"
60871
- ]
60872
- }
60873
- }
60874
- }
60875
- },
60876
- "400": {
60877
- "description": "The public API origin or CONNECTOR_CONNECT_URL is not HTTPS",
60878
- "content": {
60879
- "application/json": {
60880
- "schema": {
60881
- "$ref": "#/components/schemas/ErrorResponse"
60882
- }
60883
- }
60884
- }
60885
- },
60886
- "401": {
60887
- "description": "Unauthorized",
60888
- "content": {
60889
- "application/json": {
60890
- "schema": {
60891
- "$ref": "#/components/schemas/ErrorResponse"
60892
- }
60893
- }
60894
- }
62012
+ "302": {
62013
+ "description": "Redirect to the dashboard"
60895
62014
  },
60896
62015
  "404": {
60897
- "description": "User not found",
62016
+ "description": "Malformed code (code_invalid)",
60898
62017
  "content": {
60899
62018
  "application/json": {
60900
62019
  "schema": {
@@ -60906,10 +62025,10 @@
60906
62025
  }
60907
62026
  }
60908
62027
  },
60909
- "/api/connector/exchange": {
62028
+ "/api/invites/exchange": {
60910
62029
  "post": {
60911
- "summary": "Exchange a connect code for a user MCP token",
60912
- "description": "Unauthenticated: the single-use code is the credential. Rate limited per IP. Unknown, expired and used codes all return 404 code_invalid.",
62030
+ "summary": "Exchange an invite code for the invited user's MCP token",
62031
+ "description": "Unauthenticated: the single-use invite code is the credential. Rate limited per IP. Activates the invited user. Unknown, expired, used and connector codes, and codes for users who are no longer invited, all return 404 code_invalid.",
60913
62032
  "tags": [
60914
62033
  "Users"
60915
62034
  ],
@@ -60934,7 +62053,7 @@
60934
62053
  },
60935
62054
  "responses": {
60936
62055
  "200": {
60937
- "description": "Minted MCP token for the code's user",
62056
+ "description": "Minted MCP token for the invited user",
60938
62057
  "content": {
60939
62058
  "application/json": {
60940
62059
  "schema": {
@@ -60945,22 +62064,18 @@
60945
62064
  },
60946
62065
  "userId": {
60947
62066
  "type": "string"
60948
- },
60949
- "version": {
60950
- "type": "string"
60951
62067
  }
60952
62068
  },
60953
62069
  "required": [
60954
62070
  "token",
60955
- "userId",
60956
- "version"
62071
+ "userId"
60957
62072
  ]
60958
62073
  }
60959
62074
  }
60960
62075
  }
60961
62076
  },
60962
62077
  "404": {
60963
- "description": "Code unknown, malformed, expired or already used",
62078
+ "description": "Code unknown, malformed, expired, already used or not an invite",
60964
62079
  "content": {
60965
62080
  "application/json": {
60966
62081
  "schema": {
@@ -63521,6 +64636,20 @@
63521
64636
  "name": "id",
63522
64637
  "in": "path"
63523
64638
  },
64639
+ {
64640
+ "schema": {
64641
+ "type": "string",
64642
+ "enum": [
64643
+ "true",
64644
+ "false"
64645
+ ],
64646
+ "description": "Default true: respond after the run's instant steps ran, when it finishes or parks at its first async step. false: respond as soon as the run is committed and walk it in the background."
64647
+ },
64648
+ "required": false,
64649
+ "description": "Default true: respond after the run's instant steps ran, when it finishes or parks at its first async step. false: respond as soon as the run is committed and walk it in the background.",
64650
+ "name": "wait",
64651
+ "in": "query"
64652
+ },
63524
64653
  {
63525
64654
  "schema": {
63526
64655
  "type": "string",