@desplega.ai/agent-swarm 1.123.0 → 1.124.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/README.md +2 -1
  2. package/dist/{actions-e4c9f0xy.js → actions-z3d0fk7z.js} +6 -6
  3. package/dist/{app-vmvmj2v3.js → app-q2rc9tdr.js} +4 -4
  4. package/dist/{assistant-yn7a792a.js → assistant-3stjq7fz.js} +9 -9
  5. package/dist/{boot-reembed-xg1r86h2.js → boot-reembed-5867whnb.js} +3 -3
  6. package/dist/{boot-reembed-chxty50a.js → boot-reembed-v6r1df32.js} +4 -4
  7. package/dist/{boot-scrub-logs-exwddvp5.js → boot-scrub-logs-8b8jegk3.js} +2 -2
  8. package/dist/{cli-1592nfd6.js → cli-0925phzv.js} +1 -1
  9. package/dist/{cli-hbbxmhec.js → cli-2yr6edr7.js} +4 -4
  10. package/dist/{cli-8cq4z4x7.js → cli-3z4q09tn.js} +182 -19
  11. package/dist/{cli-vz9drmce.js → cli-5jn6wnd9.js} +17 -8
  12. package/dist/{cli-5arfywtm.js → cli-5ncdb7ff.js} +19 -9
  13. package/dist/{cli-3tv9z4wx.js → cli-92bqgbgy.js} +1 -1
  14. package/dist/{cli-fjf04hpa.js → cli-dq2ssyf0.js} +48 -56
  15. package/dist/{cli-mngsj9fx.js → cli-gkvf8d83.js} +1 -1
  16. package/dist/{cli-mepk1j0t.js → cli-gzjsamwc.js} +2 -2
  17. package/dist/{cli-c9m59f83.js → cli-h89g0qrd.js} +1 -1
  18. package/dist/{cli-n8mf7x4b.js → cli-jp4mdj9d.js} +2 -2
  19. package/dist/{cli-822d4bjk.js → cli-kk58tg33.js} +7 -7
  20. package/dist/{cli-9hj1adgp.js → cli-mcez7z4p.js} +1 -1
  21. package/dist/{cli-byv3720g.js → cli-mmk5vagg.js} +2 -2
  22. package/dist/{cli-zdp11t8m.js → cli-p0ec4vv6.js} +1 -1
  23. package/dist/{cli-h2say6xk.js → cli-p0zgv8pj.js} +3 -1
  24. package/dist/{cli-8ef5ky75.js → cli-perb20ma.js} +1 -1
  25. package/dist/{cli-zkj6f2sk.js → cli-qf7acvyr.js} +90 -4
  26. package/dist/{cli-kmm1rwmp.js → cli-qwsagsmg.js} +1 -1
  27. package/dist/{cli-we91ywvy.js → cli-sqv6c9b8.js} +6 -6
  28. package/dist/{cli-np0yhmmk.js → cli-vm20sh8d.js} +3 -3
  29. package/dist/{cli-p11rf59d.js → cli-wn3m6q54.js} +3 -3
  30. package/dist/{cli-mkpf4ndf.js → cli-x268say8.js} +2976 -5621
  31. package/dist/{cli-ngbsk4yx.js → cli-y43n987v.js} +1 -1
  32. package/dist/{cli-4509mwm5.js → cli-ykthjw29.js} +8 -8
  33. package/dist/{cli-9eka6jwv.js → cli-zxb72ctk.js} +2 -2
  34. package/dist/cli.js +12 -10
  35. package/dist/{commands-sjk3zfyr.js → commands-sda76yn8.js} +2 -2
  36. package/dist/{db-2je5agjb.js → db-vn9e4rqj.js} +6 -2
  37. package/dist/{e2b-2s4psnbf.js → e2b-q345y8s4.js} +0 -4
  38. package/dist/{handlers-yzv369hf.js → handlers-xfja18ac.js} +9 -9
  39. package/dist/{hook-rfsj2r8x.js → hook-2medrp47.js} +1 -40
  40. package/dist/{http-v9rr144m.js → http-937pyjfc.js} +99 -44
  41. package/dist/{index-nr2199m6.js → index-2bqd2q9v.js} +11 -11
  42. package/dist/{index-3xtk777g.js → index-gw4en7jg.js} +9 -9
  43. package/dist/{index-c3tan44f.js → index-knqczmnm.js} +10 -10
  44. package/dist/{index-smjdc3h9.js → index-vah60vxp.js} +8 -8
  45. package/dist/{keepalive-5ds53bjd.js → keepalive-20rd6hxh.js} +5 -5
  46. package/dist/{lead-5xhez25b.js → lead-7w2k3a49.js} +21 -21
  47. package/dist/{maintenance-b43d24q6.js → maintenance-p3x918yw.js} +4 -4
  48. package/dist/{oauth-refresh-sweep-qe286vn2.js → oauth-refresh-sweep-shm0nzm4.js} +4 -4
  49. package/dist/{onboard-c4r3ds3z.js → onboard-py9dnf54.js} +6 -2
  50. package/dist/{otel-impl-nv3rjw61.js → otel-impl-7yjkfg68.js} +1 -1
  51. package/dist/{pi-mono-adapter-2syx1x4d.js → pi-mono-adapter-z6h98fva.js} +4 -38
  52. package/dist/{pricing-refresh-5ct2wp4k.js → pricing-refresh-3snb6370.js} +4 -4
  53. package/dist/{rbac-roles-m502w0qv.js → rbac-roles-5e72bbpk.js} +3 -3
  54. package/dist/{rbac-roles-b82cxpxn.js → rbac-roles-gqxdp8st.js} +4 -4
  55. package/dist/{seed-pricing-jhjphbf0.js → seed-pricing-bg42d7h2.js} +3 -3
  56. package/dist/{setup-zbaspydq.js → setup-nzk3kbbq.js} +2 -2
  57. package/dist/{worker-snvhpax5.js → worker-0p1jdzkm.js} +21 -21
  58. package/openapi.json +146 -1
  59. package/package.json +3 -1
  60. package/src/be/db.ts +81 -4
  61. package/src/be/models-catalog.ts +156 -0
  62. package/src/be/modelsdev-cache.ts +14 -1
  63. package/src/be/pricing-refresh.ts +2 -0
  64. package/src/be/scripts/typecheck.ts +17 -4
  65. package/src/be/seed-scripts/catalog/task-context-gathering.ts +1 -1
  66. package/src/commands/onboard/env-generator.ts +12 -0
  67. package/src/e2b/env.ts +0 -4
  68. package/src/hooks/hook.ts +0 -67
  69. package/src/http/all-routes.ts +1 -0
  70. package/src/http/index.ts +2 -0
  71. package/src/http/models-catalog.ts +65 -0
  72. package/src/http/workflows.ts +16 -4
  73. package/src/prompts/base-prompt.ts +8 -7
  74. package/src/prompts/session-templates.ts +106 -12
  75. package/src/providers/pi-mono-adapter.ts +12 -2
  76. package/src/providers/pi-mono-extension.ts +0 -64
  77. package/src/providers/pricing-sources.md +16 -1
  78. package/src/scripts-runtime/eval-harness.ts +18 -1
  79. package/src/scripts-runtime/swarm-sdk.ts +10 -0
  80. package/src/scripts-runtime/types/stdlib.d.ts +13 -0
  81. package/src/scripts-runtime/types/swarm-sdk.d.ts +13 -0
  82. package/src/server-user.ts +4 -7
  83. package/src/slack/blocks.ts +21 -8
  84. package/src/slack/responses.ts +27 -51
  85. package/src/slack/watcher.ts +22 -5
  86. package/src/telemetry.ts +169 -3
  87. package/src/tests/base-prompt.test.ts +79 -0
  88. package/src/tests/mcp-tools-user.test.ts +62 -16
  89. package/src/tests/mcp-tools.test.ts +6 -3
  90. package/src/tests/memory-edit.test.ts +21 -4
  91. package/src/tests/model-groups-live-catalog.test.ts +65 -0
  92. package/src/tests/models-catalog.test.ts +119 -0
  93. package/src/tests/oauth-access-token-tool.test.ts +71 -1
  94. package/src/tests/pricing-refresh.test.ts +25 -0
  95. package/src/tests/prompt-template-session.test.ts +142 -5
  96. package/src/tests/rbac-charact-skills.test.ts +81 -14
  97. package/src/tests/script-apis-mcp.test.ts +56 -8
  98. package/src/tests/scripts-mcp-e2e.test.ts +157 -8
  99. package/src/tests/scripts-typecheck.test.ts +17 -0
  100. package/src/tests/sdk-allowlist.test.ts +34 -1
  101. package/src/tests/seed-scripts.test.ts +43 -0
  102. package/src/tests/slack-blocks.test.ts +2 -1
  103. package/src/tests/slack-inline-output.test.ts +24 -30
  104. package/src/tests/slack-watcher.test.ts +42 -0
  105. package/src/tests/steer-task-tool.test.ts +37 -8
  106. package/src/tests/steering-transport.test.ts +18 -3
  107. package/src/tests/swarm-tool-result-gate.test.ts +399 -0
  108. package/src/tests/task-tools-ctx.test.ts +49 -17
  109. package/src/tests/task-tools-ownership.test.ts +41 -13
  110. package/src/tests/telemetry-init.test.ts +376 -2
  111. package/src/tests/tool-output-agent-id.test.ts +14 -2
  112. package/src/tests/workflow-http-v2.test.ts +116 -0
  113. package/src/tools/accept-steer.ts +45 -53
  114. package/src/tools/cancel-task.ts +31 -41
  115. package/src/tools/context-diff.ts +19 -63
  116. package/src/tools/context-history.ts +22 -51
  117. package/src/tools/create-channel.ts +24 -39
  118. package/src/tools/create-metric.ts +19 -82
  119. package/src/tools/create-page.ts +20 -81
  120. package/src/tools/credential-bindings/tool.ts +125 -246
  121. package/src/tools/db-query.ts +13 -24
  122. package/src/tools/delete-channel.ts +25 -71
  123. package/src/tools/delete-page.ts +27 -75
  124. package/src/tools/get-metrics.ts +29 -22
  125. package/src/tools/get-swarm.ts +44 -15
  126. package/src/tools/get-task-details.ts +150 -32
  127. package/src/tools/get-tasks.ts +63 -29
  128. package/src/tools/inject-learning.ts +8 -38
  129. package/src/tools/join-swarm.ts +45 -47
  130. package/src/tools/kv/kv-delete.ts +13 -37
  131. package/src/tools/kv/kv-get.ts +38 -29
  132. package/src/tools/kv/kv-incr.ts +28 -56
  133. package/src/tools/kv/kv-list.ts +40 -31
  134. package/src/tools/kv/kv-set.ts +34 -76
  135. package/src/tools/list-channels.ts +24 -17
  136. package/src/tools/list-services.ts +37 -45
  137. package/src/tools/manage-user.ts +53 -66
  138. package/src/tools/mcp-servers/mcp-server-create.ts +19 -55
  139. package/src/tools/mcp-servers/mcp-server-delete.ts +9 -39
  140. package/src/tools/mcp-servers/mcp-server-get.ts +9 -35
  141. package/src/tools/mcp-servers/mcp-server-install.ts +13 -60
  142. package/src/tools/mcp-servers/mcp-server-list.ts +28 -26
  143. package/src/tools/mcp-servers/mcp-server-uninstall.ts +10 -36
  144. package/src/tools/mcp-servers/mcp-server-update.ts +13 -57
  145. package/src/tools/memory-delete.ts +16 -46
  146. package/src/tools/memory-edit.ts +48 -49
  147. package/src/tools/memory-get.ts +40 -36
  148. package/src/tools/memory-rate.ts +14 -44
  149. package/src/tools/memory-search.ts +46 -52
  150. package/src/tools/my-agent-info.ts +39 -33
  151. package/src/tools/oauth-access-token.ts +9 -24
  152. package/src/tools/poll-task.ts +50 -77
  153. package/src/tools/post-message.ts +24 -38
  154. package/src/tools/prompt-templates/delete.ts +16 -48
  155. package/src/tools/prompt-templates/get.ts +45 -42
  156. package/src/tools/prompt-templates/list.ts +29 -44
  157. package/src/tools/prompt-templates/preview.ts +14 -40
  158. package/src/tools/prompt-templates/set.ts +30 -52
  159. package/src/tools/read-messages.ts +45 -54
  160. package/src/tools/register-agentmail-inbox.ts +28 -84
  161. package/src/tools/register-kapso-number.ts +20 -50
  162. package/src/tools/register-service.ts +36 -44
  163. package/src/tools/repos/get-repos.ts +29 -21
  164. package/src/tools/repos/update-repo.ts +30 -27
  165. package/src/tools/request-human-input.ts +10 -33
  166. package/src/tools/resolve-user.ts +59 -16
  167. package/src/tools/schedules/create-schedule.ts +58 -173
  168. package/src/tools/schedules/delete-schedule.ts +16 -56
  169. package/src/tools/schedules/list-schedules.ts +41 -67
  170. package/src/tools/schedules/patch-schedule.ts +57 -153
  171. package/src/tools/schedules/run-schedule-now.ts +18 -59
  172. package/src/tools/schedules/update-schedule.ts +57 -153
  173. package/src/tools/script-apis.ts +46 -28
  174. package/src/tools/script-common.ts +129 -34
  175. package/src/tools/script-connections/tool.ts +59 -154
  176. package/src/tools/script-query-types.ts +43 -3
  177. package/src/tools/script-run.ts +41 -2
  178. package/src/tools/script-runs.ts +69 -1
  179. package/src/tools/script-search.ts +24 -1
  180. package/src/tools/script-upsert.ts +18 -3
  181. package/src/tools/send-task.ts +32 -81
  182. package/src/tools/skills/skill-create.ts +14 -39
  183. package/src/tools/skills/skill-delete.ts +14 -42
  184. package/src/tools/skills/skill-get-file.ts +10 -43
  185. package/src/tools/skills/skill-get.ts +9 -32
  186. package/src/tools/skills/skill-install-remote.ts +16 -52
  187. package/src/tools/skills/skill-install.ts +14 -52
  188. package/src/tools/skills/skill-list.ts +24 -26
  189. package/src/tools/skills/skill-publish.ts +18 -54
  190. package/src/tools/skills/skill-search.ts +21 -18
  191. package/src/tools/skills/skill-sync-remote.ts +12 -24
  192. package/src/tools/skills/skill-uninstall.ts +10 -26
  193. package/src/tools/skills/skill-update.ts +24 -81
  194. package/src/tools/slack-delete.ts +8 -32
  195. package/src/tools/slack-download-file.ts +17 -57
  196. package/src/tools/slack-list-channels.ts +16 -43
  197. package/src/tools/slack-post.ts +11 -40
  198. package/src/tools/slack-read.ts +33 -103
  199. package/src/tools/slack-reply.ts +16 -53
  200. package/src/tools/slack-start-thread.ts +14 -55
  201. package/src/tools/slack-update.ts +8 -35
  202. package/src/tools/slack-upload-file.ts +22 -122
  203. package/src/tools/steer-task.ts +22 -35
  204. package/src/tools/store-progress.ts +11 -26
  205. package/src/tools/swarm-config/delete-config.ts +19 -57
  206. package/src/tools/swarm-config/get-config.ts +36 -44
  207. package/src/tools/swarm-config/list-config.ts +36 -44
  208. package/src/tools/swarm-config/set-config.ts +35 -73
  209. package/src/tools/swarm-x.ts +20 -26
  210. package/src/tools/task-action.ts +26 -46
  211. package/src/tools/task-tool-ctx.ts +5 -13
  212. package/src/tools/tracker/tracker-link-task.ts +8 -22
  213. package/src/tools/tracker/tracker-map-agent.ts +8 -22
  214. package/src/tools/tracker/tracker-status.ts +27 -19
  215. package/src/tools/tracker/tracker-sync-status.ts +8 -18
  216. package/src/tools/tracker/tracker-unlink.ts +4 -16
  217. package/src/tools/unregister-service.ts +19 -59
  218. package/src/tools/update-profile.ts +60 -100
  219. package/src/tools/update-service-status.ts +42 -67
  220. package/src/tools/utils.ts +189 -8
  221. package/src/tools/whatsapp-message.ts +19 -32
  222. package/src/tools/workflows/cancel-workflow-run.ts +4 -16
  223. package/src/tools/workflows/create-workflow.ts +9 -38
  224. package/src/tools/workflows/delete-workflow.ts +5 -17
  225. package/src/tools/workflows/get-workflow-run.ts +41 -31
  226. package/src/tools/workflows/get-workflow.ts +10 -21
  227. package/src/tools/workflows/list-workflow-runs.ts +107 -34
  228. package/src/tools/workflows/list-workflows.ts +5 -17
  229. package/src/tools/workflows/patch-workflow-node.ts +11 -39
  230. package/src/tools/workflows/patch-workflow.ts +11 -36
  231. package/src/tools/workflows/retry-workflow-run.ts +4 -16
  232. package/src/tools/workflows/trigger-workflow.ts +22 -58
  233. package/src/tools/workflows/update-workflow.ts +10 -42
  234. package/templates/skills/swarm-scripts/SKILL.md +1 -1
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  init_package,
11
11
  package_default
12
- } from "./cli-h2say6xk.js";
12
+ } from "./cli-p0zgv8pj.js";
13
13
  import {
14
14
  init_secret_scrubber,
15
15
  scrubSecrets
@@ -161047,21 +161047,6 @@ async function syncSetupScriptToServer(config, changeSource = "session_sync") {
161047
161047
  });
161048
161048
  } catch {}
161049
161049
  }
161050
- function isOwnedSharedPath(path12, agentId) {
161051
- const sharedCategories = ["thoughts", "memory", "downloads", "misc"];
161052
- return sharedCategories.some((cat) => path12.startsWith(`/workspace/shared/${cat}/${agentId}/`));
161053
- }
161054
- function sharedDiskWriteWarning(agentId) {
161055
- return `⚠️ This write will fail: You don't have write access to this directory.
161056
-
161057
- ` + `On shared workspaces, each agent can only write to their own directories:
161058
- ` + `- /workspace/shared/thoughts/${agentId}/
161059
- ` + `- /workspace/shared/memory/${agentId}/
161060
- ` + `- /workspace/shared/downloads/${agentId}/
161061
- ` + `- /workspace/shared/misc/${agentId}/
161062
-
161063
- ` + `You CAN read any file on the shared disk. For writes, use your own subdirectory.`;
161064
- }
161065
161050
  async function autoIndexMemoryFile(config, editedPath) {
161066
161051
  try {
161067
161052
  const fileContent = await Bun.file(editedPath).text();
@@ -161266,15 +161251,6 @@ function createSwarmHooksExtension(config) {
161266
161251
  };
161267
161252
  }
161268
161253
  }
161269
- if (process.env.ARCHIL_MOUNT_TOKEN) {
161270
- if (event.toolName === "write" || event.toolName === "edit") {
161271
- const toolInput = "input" in event ? event.input : undefined;
161272
- const targetPath = toolInput?.file_path || toolInput?.path || "";
161273
- if (targetPath.startsWith("/workspace/shared/") && !isOwnedSharedPath(targetPath, config.agentId)) {
161274
- console.log(sharedDiskWriteWarning(config.agentId));
161275
- }
161276
- }
161277
- }
161278
161254
  return;
161279
161255
  });
161280
161256
  pi2.on("tool_result", async (event, ctx) => {
@@ -161306,20 +161282,6 @@ function createSwarmHooksExtension(config) {
161306
161282
  });
161307
161283
  }
161308
161284
  }
161309
- if (process.env.ARCHIL_MOUNT_TOKEN) {
161310
- if (event.toolName === "write" || event.toolName === "edit" || event.toolName === "bash") {
161311
- const resultStr = JSON.stringify(event.content ?? []);
161312
- if (resultStr.includes("Read-only file system")) {
161313
- const resultInput = event.input;
161314
- const resultPath = resultInput?.file_path || resultInput?.path || "";
161315
- if (resultPath.startsWith("/workspace/shared/") && !isOwnedSharedPath(resultPath, config.agentId)) {
161316
- console.log(sharedDiskWriteWarning(config.agentId));
161317
- } else if (!resultPath) {
161318
- console.log(sharedDiskWriteWarning(config.agentId));
161319
- }
161320
- }
161321
- }
161322
- }
161323
161285
  const toolName = event.toolName;
161324
161286
  const input = event.input;
161325
161287
  const editedPath = input?.file_path || input?.path;
@@ -161537,6 +161499,9 @@ function mcpToolsToDefinitions(mcpClient, tools2) {
161537
161499
  const result = await mcpClient.callTool(tool.name, params);
161538
161500
  const text = result.content.map((c) => c.text ?? "").filter(Boolean).join(`
161539
161501
  `);
161502
+ if (result.isError) {
161503
+ throw new Error(text || `Tool ${tool.name} failed with no error message`);
161504
+ }
161540
161505
  return {
161541
161506
  content: [{ type: "text", text: text || "(no output)" }],
161542
161507
  details: undefined
@@ -162134,6 +162099,7 @@ class PiMonoAdapter {
162134
162099
  export {
162135
162100
  runBedrockSdkProbeAndEnumerate,
162136
162101
  resolveModel,
162102
+ mcpToolsToDefinitions,
162137
162103
  extractPiAssistantText,
162138
162104
  ensureOpenRouterModelsOverride,
162139
162105
  createPiRuntimeAuth,
@@ -2,11 +2,11 @@ import {
2
2
  PRICING_REFRESH_INTERVAL_MS,
3
3
  refreshPricingFromModelsDev,
4
4
  startPricingRefreshLoop
5
- } from "./cli-zkj6f2sk.js";
6
- import"./cli-mepk1j0t.js";
7
- import"./cli-8cq4z4x7.js";
5
+ } from "./cli-qf7acvyr.js";
6
+ import"./cli-gzjsamwc.js";
7
+ import"./cli-3z4q09tn.js";
8
8
  import"./cli-z2zcxes1.js";
9
- import"./cli-h2say6xk.js";
9
+ import"./cli-p0zgv8pj.js";
10
10
  import"./cli-4j2mrzag.js";
11
11
  import"./cli-bw80ck94.js";
12
12
  import"./cli-xz9aq0rf.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  PermissionVerbSchema
3
- } from "./cli-ngbsk4yx.js";
3
+ } from "./cli-y43n987v.js";
4
4
  import {
5
5
  getDb,
6
6
  init_db
7
- } from "./cli-8cq4z4x7.js";
7
+ } from "./cli-3z4q09tn.js";
8
8
  import"./cli-z2zcxes1.js";
9
- import"./cli-h2say6xk.js";
9
+ import"./cli-p0zgv8pj.js";
10
10
  import"./cli-4j2mrzag.js";
11
11
  import"./cli-bw80ck94.js";
12
12
  import"./cli-xz9aq0rf.js";
@@ -7,11 +7,11 @@ import {
7
7
  getUserGrant,
8
8
  listUserRoles,
9
9
  runRbacCliCommand
10
- } from "./cli-9eka6jwv.js";
11
- import"./cli-ngbsk4yx.js";
12
- import"./cli-8cq4z4x7.js";
10
+ } from "./cli-zxb72ctk.js";
11
+ import"./cli-y43n987v.js";
12
+ import"./cli-3z4q09tn.js";
13
13
  import"./cli-z2zcxes1.js";
14
- import"./cli-h2say6xk.js";
14
+ import"./cli-p0zgv8pj.js";
15
15
  import"./cli-4j2mrzag.js";
16
16
  import"./cli-bw80ck94.js";
17
17
  import"./cli-xz9aq0rf.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  buildModelsDevSeedRows,
3
3
  seedPricingFromModelsDev
4
- } from "./cli-mepk1j0t.js";
5
- import"./cli-8cq4z4x7.js";
4
+ } from "./cli-gzjsamwc.js";
5
+ import"./cli-3z4q09tn.js";
6
6
  import"./cli-z2zcxes1.js";
7
- import"./cli-h2say6xk.js";
7
+ import"./cli-p0zgv8pj.js";
8
8
  import"./cli-4j2mrzag.js";
9
9
  import"./cli-bw80ck94.js";
10
10
  import"./cli-xz9aq0rf.js";
@@ -4,14 +4,14 @@ import {
4
4
  createDefaultMcpJson,
5
5
  createDefaultSettingsLocal,
6
6
  createHooksConfig
7
- } from "./cli-8ef5ky75.js";
7
+ } from "./cli-perb20ma.js";
8
8
  import {
9
9
  require_jsx_dev_runtime
10
10
  } from "./cli-wx82tw1k.js";
11
11
  import {
12
12
  getApiKey
13
13
  } from "./cli-f14fvzag.js";
14
- import"./cli-h2say6xk.js";
14
+ import"./cli-p0zgv8pj.js";
15
15
  import {
16
16
  Box_default,
17
17
  Spinner,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runAgent
3
- } from "./cli-4509mwm5.js";
3
+ } from "./cli-ykthjw29.js";
4
4
  import"./cli-exfs8aym.js";
5
5
  import"./cli-jj1arm18.js";
6
6
  import"./cli-07er7wrs.js";
@@ -14,7 +14,7 @@ import"./cli-d6n0thxw.js";
14
14
  import"./cli-v1mwc5v2.js";
15
15
  import {
16
16
  getEnabledCapabilities
17
- } from "./cli-mkpf4ndf.js";
17
+ } from "./cli-x268say8.js";
18
18
  import"./cli-1z7048dy.js";
19
19
  import"./cli-gz9sbyk3.js";
20
20
  import"./cli-ftyf58xj.js";
@@ -25,36 +25,36 @@ import"./cli-tng3131n.js";
25
25
  import"./cli-zm7njwzd.js";
26
26
  import"./cli-cw70hymf.js";
27
27
  import"./cli-e61fs2hp.js";
28
- import"./cli-hbbxmhec.js";
29
- import"./cli-zkj6f2sk.js";
30
- import"./cli-mepk1j0t.js";
31
- import"./cli-9eka6jwv.js";
32
- import"./cli-ngbsk4yx.js";
33
- import"./cli-mngsj9fx.js";
34
- import"./cli-822d4bjk.js";
28
+ import"./cli-2yr6edr7.js";
29
+ import"./cli-qf7acvyr.js";
30
+ import"./cli-gzjsamwc.js";
31
+ import"./cli-zxb72ctk.js";
32
+ import"./cli-y43n987v.js";
33
+ import"./cli-gkvf8d83.js";
34
+ import"./cli-kk58tg33.js";
35
35
  import"./cli-f14fvzag.js";
36
36
  import"./cli-3dpj7atn.js";
37
- import"./cli-c9m59f83.js";
38
- import"./cli-p11rf59d.js";
37
+ import"./cli-h89g0qrd.js";
38
+ import"./cli-wn3m6q54.js";
39
39
  import"./cli-jkhwmmgg.js";
40
- import"./cli-byv3720g.js";
41
- import"./cli-zdp11t8m.js";
40
+ import"./cli-mmk5vagg.js";
41
+ import"./cli-p0ec4vv6.js";
42
42
  import"./cli-q25ejbyn.js";
43
- import"./cli-9hj1adgp.js";
43
+ import"./cli-mcez7z4p.js";
44
44
  import"./cli-fad8m16k.js";
45
45
  import"./cli-7zd05xb4.js";
46
- import"./cli-3tv9z4wx.js";
47
- import"./cli-1592nfd6.js";
48
- import"./cli-kmm1rwmp.js";
49
- import"./cli-fjf04hpa.js";
46
+ import"./cli-92bqgbgy.js";
47
+ import"./cli-0925phzv.js";
48
+ import"./cli-qwsagsmg.js";
49
+ import"./cli-dq2ssyf0.js";
50
50
  import"./cli-rkndnn90.js";
51
51
  import"./cli-b0p7rfnd.js";
52
- import"./cli-5arfywtm.js";
52
+ import"./cli-5ncdb7ff.js";
53
53
  import"./cli-wspgs9bt.js";
54
54
  import"./cli-dh55d5fg.js";
55
- import"./cli-8cq4z4x7.js";
55
+ import"./cli-3z4q09tn.js";
56
56
  import"./cli-z2zcxes1.js";
57
- import"./cli-h2say6xk.js";
57
+ import"./cli-p0zgv8pj.js";
58
58
  import"./cli-4j2mrzag.js";
59
59
  import"./cli-bw80ck94.js";
60
60
  import"./cli-xz9aq0rf.js";
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": "1.123.0",
5
+ "version": "1.124.0",
6
6
  "description": "Multi-agent orchestration API for Claude Code, Codex, and Gemini CLI. Enables task distribution, agent communication, and service discovery.\n\nMCP tools are documented separately in [MCP.md](./MCP.md)."
7
7
  },
8
8
  "servers": [
@@ -6574,6 +6574,129 @@
6574
6574
  }
6575
6575
  }
6576
6576
  },
6577
+ "/api/models-catalog": {
6578
+ "get": {
6579
+ "summary": "Get the live model catalog for the picker-reachable providers",
6580
+ "description": "Slim projection of the models.dev payload (openrouter / anthropic / openai / amazon-bedrock only), refreshed server-side at boot and every 12h by the pricing-refresh loop. `source` is 'snapshot' with `updatedAt: null` until the first successful fetch (or when models.dev is unreachable), in which case the vendored snapshot is served instead.",
6581
+ "tags": [
6582
+ "Pricing"
6583
+ ],
6584
+ "security": [
6585
+ {
6586
+ "bearerAuth": []
6587
+ }
6588
+ ],
6589
+ "responses": {
6590
+ "200": {
6591
+ "description": "Model catalog",
6592
+ "content": {
6593
+ "application/json": {
6594
+ "schema": {
6595
+ "type": "object",
6596
+ "properties": {
6597
+ "source": {
6598
+ "type": "string",
6599
+ "enum": [
6600
+ "live",
6601
+ "snapshot"
6602
+ ]
6603
+ },
6604
+ "updatedAt": {
6605
+ "type": [
6606
+ "number",
6607
+ "null"
6608
+ ]
6609
+ },
6610
+ "providers": {
6611
+ "type": "object",
6612
+ "additionalProperties": {
6613
+ "type": "object",
6614
+ "properties": {
6615
+ "id": {
6616
+ "type": "string"
6617
+ },
6618
+ "name": {
6619
+ "type": "string"
6620
+ },
6621
+ "models": {
6622
+ "type": "object",
6623
+ "additionalProperties": {
6624
+ "type": "object",
6625
+ "properties": {
6626
+ "id": {
6627
+ "type": "string"
6628
+ },
6629
+ "name": {
6630
+ "type": "string"
6631
+ },
6632
+ "cost": {
6633
+ "type": "object",
6634
+ "properties": {
6635
+ "input": {
6636
+ "type": "number"
6637
+ },
6638
+ "output": {
6639
+ "type": "number"
6640
+ }
6641
+ }
6642
+ },
6643
+ "limit": {
6644
+ "type": "object",
6645
+ "properties": {
6646
+ "context": {
6647
+ "type": "number"
6648
+ }
6649
+ }
6650
+ },
6651
+ "reasoning": {
6652
+ "type": "boolean"
6653
+ },
6654
+ "reasoning_options": {
6655
+ "type": "array",
6656
+ "items": {
6657
+ "type": "object",
6658
+ "properties": {
6659
+ "type": {
6660
+ "type": "string"
6661
+ },
6662
+ "values": {
6663
+ "type": "array",
6664
+ "items": {
6665
+ "type": "string"
6666
+ }
6667
+ }
6668
+ },
6669
+ "required": [
6670
+ "type"
6671
+ ]
6672
+ }
6673
+ }
6674
+ },
6675
+ "required": [
6676
+ "id"
6677
+ ]
6678
+ }
6679
+ }
6680
+ },
6681
+ "required": [
6682
+ "id",
6683
+ "models"
6684
+ ]
6685
+ }
6686
+ }
6687
+ },
6688
+ "required": [
6689
+ "source",
6690
+ "updatedAt",
6691
+ "providers"
6692
+ ]
6693
+ }
6694
+ }
6695
+ }
6696
+ }
6697
+ }
6698
+ }
6699
+ },
6577
6700
  "/api/oauth/refresh-locks/{key}": {
6578
6701
  "post": {
6579
6702
  "summary": "Acquire a cross-process OAuth refresh lock",
@@ -19605,6 +19728,28 @@
19605
19728
  "required": false,
19606
19729
  "name": "status",
19607
19730
  "in": "query"
19731
+ },
19732
+ {
19733
+ "schema": {
19734
+ "type": "integer",
19735
+ "minimum": 1,
19736
+ "maximum": 100
19737
+ },
19738
+ "required": false,
19739
+ "name": "limit",
19740
+ "in": "query"
19741
+ },
19742
+ {
19743
+ "schema": {
19744
+ "type": [
19745
+ "integer",
19746
+ "null"
19747
+ ],
19748
+ "minimum": 0
19749
+ },
19750
+ "required": false,
19751
+ "name": "offset",
19752
+ "in": "query"
19608
19753
  }
19609
19754
  ],
19610
19755
  "responses": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@desplega.ai/agent-swarm",
3
- "version": "1.123.0",
3
+ "version": "1.124.0",
4
4
  "description": "Multi-agent orchestration for Claude Code, Codex, Gemini CLI, and other AI coding assistants",
5
5
  "license": "MIT",
6
6
  "author": "desplega.sh <contact@desplega.sh>",
@@ -99,7 +99,9 @@
99
99
  "format": "biome format --write src",
100
100
  "build:binary": "bun build ./src/cli.tsx --compile --compile-exec-argv='--expose-gc' --target=bun-linux-x64 --outfile ./dist/agent-swarm",
101
101
  "build:binary:arm64": "bun build ./src/cli.tsx --compile --compile-exec-argv='--expose-gc' --target=bun-linux-arm64 --outfile ./dist/agent-swarm",
102
+ "docker:build:api": "docker build -f Dockerfile -t agent-swarm-api:latest .",
102
103
  "docker:build:worker": "docker build -f Dockerfile.worker -t agent-swarm-worker:latest .",
104
+ "docker:build:worker:slim": "docker build -f Dockerfile.worker --target worker-slim -t agent-swarm-worker:slim .",
103
105
  "docker:run:worker": "docker run --rm -it --env-file .env.docker -p 3202:3000 -v ./logs:/logs -v ./work/shared:/workspace/shared -v ./work/worker-1:/workspace/personal agent-swarm-worker:latest",
104
106
  "docker:run:lead": "docker run --rm -it --env-file .env.docker-lead -e AGENT_ROLE=lead -p 3201:3000 -v ./logs:/logs -v ./work/shared:/workspace/shared -v ./work/lead:/workspace/personal agent-swarm-worker:latest",
105
107
  "deploy:install": "bun deploy/install.ts",
package/src/be/db.ts CHANGED
@@ -8679,15 +8679,92 @@ export function updateWorkflowRun(
8679
8679
  return run;
8680
8680
  }
8681
8681
 
8682
- export function listWorkflowRuns(workflowId: string): WorkflowRun[] {
8682
+ export type WorkflowRunListOptions = {
8683
+ status?: WorkflowRunStatus;
8684
+ limit?: number;
8685
+ offset?: number;
8686
+ };
8687
+
8688
+ export type WorkflowRunPage = {
8689
+ runs: WorkflowRun[];
8690
+ page: {
8691
+ limit: number;
8692
+ offset: number;
8693
+ total: number;
8694
+ hasMore: boolean;
8695
+ nextOffset?: number;
8696
+ };
8697
+ };
8698
+
8699
+ export function listWorkflowRuns(
8700
+ workflowId: string,
8701
+ options: WorkflowRunListOptions = {},
8702
+ ): WorkflowRun[] {
8703
+ const conditions = ["workflowId = ?"];
8704
+ const params: Array<string | number> = [workflowId];
8705
+ if (options.status) {
8706
+ conditions.push("status = ?");
8707
+ params.push(options.status);
8708
+ }
8709
+
8710
+ let pagination = "";
8711
+ if (options.limit !== undefined) {
8712
+ pagination = " LIMIT ? OFFSET ?";
8713
+ params.push(options.limit, options.offset ?? 0);
8714
+ } else if (options.offset !== undefined) {
8715
+ pagination = " LIMIT -1 OFFSET ?";
8716
+ params.push(options.offset);
8717
+ }
8718
+
8683
8719
  return getDb()
8684
- .prepare<WorkflowRunRow, [string]>(
8685
- "SELECT * FROM workflow_runs WHERE workflowId = ? ORDER BY startedAt DESC",
8720
+ .prepare<WorkflowRunRow, Array<string | number>>(
8721
+ `SELECT * FROM workflow_runs
8722
+ WHERE ${conditions.join(" AND ")}
8723
+ ORDER BY startedAt DESC, id DESC${pagination}`,
8686
8724
  )
8687
- .all(workflowId)
8725
+ .all(...params)
8688
8726
  .map(rowToWorkflowRun);
8689
8727
  }
8690
8728
 
8729
+ export function countWorkflowRuns(
8730
+ workflowId: string,
8731
+ options: Pick<WorkflowRunListOptions, "status"> = {},
8732
+ ): number {
8733
+ const conditions = ["workflowId = ?"];
8734
+ const params: string[] = [workflowId];
8735
+ if (options.status) {
8736
+ conditions.push("status = ?");
8737
+ params.push(options.status);
8738
+ }
8739
+ const row = getDb()
8740
+ .prepare<{ count: number }, string[]>(
8741
+ `SELECT COUNT(*) AS count FROM workflow_runs WHERE ${conditions.join(" AND ")}`,
8742
+ )
8743
+ .get(...params);
8744
+ return row?.count ?? 0;
8745
+ }
8746
+
8747
+ export function listWorkflowRunsPage(
8748
+ workflowId: string,
8749
+ options: Required<Pick<WorkflowRunListOptions, "limit" | "offset">> &
8750
+ Pick<WorkflowRunListOptions, "status">,
8751
+ ): WorkflowRunPage {
8752
+ const runs = listWorkflowRuns(workflowId, options);
8753
+ const total = countWorkflowRuns(workflowId, { status: options.status });
8754
+ const nextOffset = options.offset + runs.length;
8755
+ const hasMore = nextOffset < total;
8756
+ return {
8757
+ runs,
8758
+ page: {
8759
+ limit: options.limit,
8760
+ offset: options.offset,
8761
+ total,
8762
+ hasMore,
8763
+ ...(hasMore ? { nextOffset } : {}),
8764
+ },
8765
+ };
8766
+ }
8767
+
8691
8768
  // ============================================================================
8692
8769
  // Workflow Run Step CRUD
8693
8770
  // ============================================================================