@desplega.ai/agent-swarm 1.149.0 → 1.150.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 (385) hide show
  1. package/README.md +7 -3
  2. package/dist/{acp-adapter-4jncb126.js → acp-adapter-d5mzggyk.js} +1 -1
  3. package/dist/{actions-31vp3ae7.js → actions-wn6ew0p7.js} +11 -10
  4. package/dist/{anthropic-messages-vs2rabzp.js → anthropic-messages-ec35ktvx.js} +4 -4
  5. package/dist/{app-1hh67x8w.js → app-dty7p9hg.js} +7 -7
  6. package/dist/{artifact-gj9arwrr.js → artifact-td4q4dch.js} +1 -1
  7. package/dist/{assistant-z66dmz6p.js → assistant-q4vhgjtx.js} +16 -17
  8. package/dist/{boot-reembed-wxa8ya0s.js → boot-reembed-92292pgf.js} +9 -9
  9. package/dist/{boot-reembed-fqzxxzjh.js → boot-reembed-n15q6s9x.js} +8 -8
  10. package/dist/{boot-scrub-logs-jnyndh79.js → boot-scrub-logs-44pc955m.js} +5 -5
  11. package/dist/{claude-adapter-3qpa9w0j.js → claude-adapter-cjegjbje.js} +14 -14
  12. package/dist/{claude-managed-adapter-qvsmh6mv.js → claude-managed-adapter-p3ts5m9m.js} +2 -2
  13. package/dist/{claude-sdk-session-2yxgjs5d.js → claude-sdk-session-7ywbn12v.js} +14 -14
  14. package/dist/{cli-cr12paw2.js → cli-111ey3ra.js} +5 -5
  15. package/dist/{cli-4wtq5jjv.js → cli-1mx65de9.js} +1 -1
  16. package/dist/{cli-9d8ntetj.js → cli-2658f6at.js} +1 -1
  17. package/dist/{cli-n3dz2942.js → cli-3ckzxdt1.js} +10 -6
  18. package/dist/{cli-yb9qhqam.js → cli-3mh119qv.js} +184 -67
  19. package/dist/{cli-ykxrnd1q.js → cli-72xdszyx.js} +2 -2
  20. package/dist/{cli-xm87hzbw.js → cli-7fesa1ky.js} +1 -1
  21. package/dist/{cli-3q5ejx9p.js → cli-7kwmt3r5.js} +2 -2
  22. package/dist/{cli-2qts1hys.js → cli-8chp8xab.js} +2 -2
  23. package/dist/{cli-qaacms9y.js → cli-9gqddmxs.js} +122 -97
  24. package/dist/{cli-zvz62chv.js → cli-a45d5v9b.js} +4 -4
  25. package/dist/{cli-9xvdm3bx.js → cli-asvrh7kj.js} +1 -1
  26. package/dist/{cli-kgz4np97.js → cli-b8x19vbh.js} +4 -4
  27. package/dist/{cli-9fy6nk6g.js → cli-ceb5y160.js} +1 -1
  28. package/dist/{cli-k0cr4kat.js → cli-ck1vqzdj.js} +1 -1
  29. package/dist/{cli-e29gmdmw.js → cli-dv6cdjs2.js} +2 -1
  30. package/dist/{cli-jecc01cb.js → cli-dyx0237s.js} +1 -1
  31. package/dist/{cli-kjwt6hdf.js → cli-gm0fhz13.js} +3 -3
  32. package/dist/{cli-sd5pv3b1.js → cli-h505yhex.js} +2 -2
  33. package/dist/{handlers-nbzdzn9k.js → cli-hbagregr.js} +15 -38
  34. package/dist/{cli-08b07b4r.js → cli-hmyynq9b.js} +1 -1
  35. package/dist/{cli-d8ftsp62.js → cli-kt7wevqh.js} +20 -13
  36. package/dist/{cli-gjhjfeeg.js → cli-kyysm7m3.js} +1 -1
  37. package/dist/{cli-1ebpar1q.js → cli-mzb0n642.js} +6 -6
  38. package/dist/{cli-q50ef8g0.js → cli-n1yj5fd5.js} +1 -1
  39. package/dist/{cli-3apbzgyk.js → cli-n75jt793.js} +13 -9
  40. package/dist/{cli-19f354qr.js → cli-q04q68be.js} +2 -2
  41. package/dist/{cli-yab68w40.js → cli-qp69dd5d.js} +29 -14
  42. package/dist/{cli-6pqcb4q0.js → cli-rnsr8asm.js} +12 -11
  43. package/dist/{cli-ygweqcn4.js → cli-rwp3ksm7.js} +91 -108
  44. package/dist/{cli-phsxnkp6.js → cli-ryz8q8p1.js} +74 -58
  45. package/dist/{cli-e95cx1eb.js → cli-taym3dmg.js} +10 -10
  46. package/dist/{cli-nye12xk5.js → cli-ttje5a4z.js} +7 -4
  47. package/dist/{cli-9hspd3dp.js → cli-vr6qj104.js} +1 -1
  48. package/dist/{cli-mnmsfd1w.js → cli-xjb9wghj.js} +7 -3
  49. package/dist/{cli-gv88e1vf.js → cli-ydk0wjj8.js} +1 -1
  50. package/dist/{cli-aae6hz6a.js → cli-zd21jrrc.js} +3 -3
  51. package/dist/{cli-7smrsr25.js → cli-zthatyrx.js} +23 -11
  52. package/dist/cli.js +19 -19
  53. package/dist/{codex-adapter-8meawydj.js → codex-adapter-rn3aq7jm.js} +7 -7
  54. package/dist/{codex-hook-hfrt9shr.js → codex-hook-gthcmm0g.js} +3 -3
  55. package/dist/{codex-session-runner-gjgxyp5j.js → codex-session-runner-bge0cbsw.js} +7 -7
  56. package/dist/{commands-hz3nb95f.js → commands-26phw0pc.js} +5 -5
  57. package/dist/{db-ggz97zbm.js → db-jxjx6s1b.js} +6 -6
  58. package/dist/{e2b-p04vmtx0.js → e2b-413b8t4v.js} +1 -1
  59. package/dist/handlers-vr1djg4n.js +41 -0
  60. package/dist/{hook-bks2q1f6.js → hook-jw0ztn96.js} +9 -9
  61. package/dist/{hook-kq9wp0ep.js → hook-t6fqsggw.js} +10 -10
  62. package/dist/{http-hrf77v87.js → http-hyc7s57s.js} +80 -71
  63. package/dist/{index-n28pw1zt.js → index-1d9r6a74.js} +18 -18
  64. package/dist/{index-cqtebbhb.js → index-bcyx5djw.js} +17 -17
  65. package/dist/{index-6nsbg88z.js → index-sfhaq59d.js} +408 -74
  66. package/dist/{index-8hmeg8j1.js → index-wtwpthe1.js} +17 -17
  67. package/dist/{keepalive-dxc12gvg.js → keepalive-fbsak4ya.js} +7 -7
  68. package/dist/{lead-yckfn18d.js → lead-rdzdm627.js} +39 -39
  69. package/dist/{maintenance-6kfb2m5e.js → maintenance-25z1c1vf.js} +9 -9
  70. package/dist/{node-x1g4v0pq.js → node-209sxmg3.js} +9 -9
  71. package/dist/{oauth-refresh-sweep-1x1ac722.js → oauth-refresh-sweep-j3d7gtse.js} +6 -6
  72. package/dist/{onboard-dcyt1609.js → onboard-dkcwrc75.js} +2 -2
  73. package/dist/{otel-impl-tbk3e5dr.js → otel-impl-8rgyy3j8.js} +1 -1
  74. package/dist/{pi-mono-adapter-zvshk5cj.js → pi-mono-adapter-4s2bbkgq.js} +8 -8
  75. package/dist/{pricing-refresh-kaqg567e.js → pricing-refresh-9cek71nq.js} +7 -7
  76. package/dist/{rbac-roles-cf97v1vd.js → rbac-roles-vk8mqp9v.js} +6 -6
  77. package/dist/{rbac-roles-ammq6rd2.js → rbac-roles-z98s2ypy.js} +5 -5
  78. package/dist/{render-v2-80w603vy.js → render-v2-3j26g0qh.js} +7 -7
  79. package/dist/{seed-pricing-zbrn83xv.js → seed-pricing-7rxhcnzm.js} +6 -6
  80. package/dist/{setup-fe66kczs.js → setup-e2t7vz0c.js} +2 -2
  81. package/dist/work-objects-8d3nd3x2.js +141 -0
  82. package/dist/{worker-qmb2d1e2.js → worker-0x9fn7nq.js} +39 -39
  83. package/openapi.json +15 -4
  84. package/package.json +3 -3
  85. package/src/agentmail/handlers.ts +5 -0
  86. package/src/be/budget-refusal-notify.ts +1 -0
  87. package/src/be/db/tasks/read.ts +3 -0
  88. package/src/be/db/tasks/write.ts +13 -1
  89. package/src/be/db.ts +4 -2
  90. package/src/be/migrations/153_deferred_task_wait_members.sql +25 -0
  91. package/src/be/migrations/154_routing_source.sql +3 -0
  92. package/src/be/scripts/typecheck.ts +7 -3
  93. package/src/be/seed/automation-toggle.ts +69 -0
  94. package/src/be/seed/schedules-seeder.ts +53 -8
  95. package/src/be/seed/workflows-seeder.ts +35 -6
  96. package/src/be/seed-scripts/catalog/delegate.ts +3 -1
  97. package/src/be/seed-skills/bundled-files.generated.json +1 -1
  98. package/src/be/steering.ts +1 -0
  99. package/src/be/swarm-config-guard.ts +1 -0
  100. package/src/commands/credential-refresh.ts +70 -0
  101. package/src/commands/provider-credentials.ts +2 -25
  102. package/src/commands/runner.ts +23 -56
  103. package/src/github/handlers.ts +9 -0
  104. package/src/gitlab/handlers.ts +4 -0
  105. package/src/heartbeat/heartbeat.ts +3 -0
  106. package/src/http/approval-requests.ts +1 -0
  107. package/src/http/apps.ts +1 -0
  108. package/src/http/config.ts +4 -1
  109. package/src/http/core.ts +4 -2
  110. package/src/http/index.ts +16 -3
  111. package/src/http/script-runs.ts +5 -0
  112. package/src/http/tasks.ts +5 -0
  113. package/src/integrations/kapso/inbound.ts +1 -0
  114. package/src/jira/sync.ts +2 -0
  115. package/src/linear/sync.ts +2 -0
  116. package/src/prompts/session-templates.ts +13 -9
  117. package/src/providers/claude-adapter.ts +21 -8
  118. package/src/scheduler/deferred-task-waits.ts +34 -5
  119. package/src/scheduler/schedule-task.ts +5 -1
  120. package/src/scheduler/scheduler.ts +104 -123
  121. package/src/scripts-runtime/types/stdlib.d.ts +7 -3
  122. package/src/scripts-runtime/types/swarm-sdk.d.ts +7 -3
  123. package/src/slack/HEURISTICS.md +2 -0
  124. package/src/slack/actions.ts +1 -0
  125. package/src/slack/app.ts +2 -0
  126. package/src/slack/assistant.ts +4 -12
  127. package/src/slack/handlers.ts +9 -14
  128. package/src/slack/inbound-files.ts +3 -3
  129. package/src/slack/render-v2.ts +17 -3
  130. package/src/slack/thread-buffer.ts +66 -23
  131. package/src/slack/work-objects.test.ts +252 -0
  132. package/src/slack/work-objects.ts +118 -0
  133. package/src/tasks/worker-follow-up.ts +4 -0
  134. package/src/tests/acp-adapter.test.ts +10 -10
  135. package/src/tests/agent-fs-live-url.test.ts +40 -0
  136. package/src/tests/agent-fs-provision-seeder.test.ts +12 -12
  137. package/src/tests/api-key-tracking.test.ts +18 -18
  138. package/src/tests/api-key.test.ts +4 -2
  139. package/src/tests/apps-rbac.test.ts +1 -1
  140. package/src/tests/apps-spike5.test.ts +1 -1
  141. package/src/tests/apps-sync-engine.test.ts +8 -8
  142. package/src/tests/apps-user-config.test.ts +1 -1
  143. package/src/tests/artifact-sdk.test.ts +8 -8
  144. package/src/tests/asset-key-mcp.test.ts +2 -0
  145. package/src/tests/automation-preflight-alert.test.ts +1 -1
  146. package/src/tests/base-prompt.test.ts +6 -6
  147. package/src/tests/budget-user-scope.test.ts +1 -1
  148. package/src/tests/budgets-routes.test.ts +1 -1
  149. package/src/tests/claude-adapter-binary.test.ts +22 -40
  150. package/src/tests/claude-adapter-otel.test.ts +13 -7
  151. package/src/tests/claude-adapter.test.ts +8 -6
  152. package/src/tests/claude-hook-credentials.test.ts +3 -3
  153. package/src/tests/claude-managed-adapter.test.ts +4 -4
  154. package/src/tests/claude-managed-setup.test.ts +3 -3
  155. package/src/tests/claude-sdk-lifecycle.test.ts +1 -1
  156. package/src/tests/claude-sdk-transport.test.ts +6 -6
  157. package/src/tests/claude-stop-hook.test.ts +8 -8
  158. package/src/tests/claude-worker-parity.test.ts +3 -3
  159. package/src/tests/codex-adapter-pool-auth-revalidate.test.ts +5 -5
  160. package/src/tests/codex-adapter.test.ts +7 -5
  161. package/src/tests/codex-app-server.test.ts +2 -2
  162. package/src/tests/codex-login.test.ts +15 -15
  163. package/src/tests/codex-oauth-credential-info.test.ts +4 -4
  164. package/src/tests/codex-oauth-keep-warm.test.ts +4 -4
  165. package/src/tests/codex-oauth-refresh-lock.test.ts +1 -1
  166. package/src/tests/codex-oauth-storage.test.ts +7 -7
  167. package/src/tests/codex-pool.test.ts +1 -1
  168. package/src/tests/codex-steering-hook.test.ts +1 -1
  169. package/src/tests/codex-swarm-events.test.ts +1 -1
  170. package/src/tests/config-api-only-keys.test.ts +1 -1
  171. package/src/tests/config-session-auth.test.ts +2 -2
  172. package/src/tests/connection-embedded-auth.test.ts +20 -18
  173. package/src/tests/core-auth.test.ts +1 -1
  174. package/src/tests/create-page-tool.test.ts +3 -3
  175. package/src/tests/credential-refresh.test.ts +115 -0
  176. package/src/tests/credential-wait.test.ts +2 -2
  177. package/src/tests/credentials.test.ts +6 -4
  178. package/src/tests/db-queries-oauth.test.ts +40 -40
  179. package/src/tests/defer-task.test.ts +73 -8
  180. package/src/tests/deferred-task-wait-migration.test.ts +64 -0
  181. package/src/tests/deferred-task-wake.test.ts +190 -1
  182. package/src/tests/devin-adapter.test.ts +1 -1
  183. package/src/tests/devin-api.test.ts +1 -1
  184. package/src/tests/e2b-dispatch.test.ts +21 -19
  185. package/src/tests/e2e-claude-transport.test.ts +3 -3
  186. package/src/tests/e2e-redact.test.ts +6 -6
  187. package/src/tests/ensure-token.test.ts +68 -68
  188. package/src/tests/entrypoint-api-readiness.test.ts +1 -1
  189. package/src/tests/entrypoint-codex-oauth-seed.test.ts +13 -13
  190. package/src/tests/events-http.test.ts +1 -1
  191. package/src/tests/fs-routes.test.ts +1 -1
  192. package/src/tests/gitlab-auth.test.ts +10 -10
  193. package/src/tests/harness-provider-resolution.test.ts +8 -5
  194. package/src/tests/heartbeat-reroute-decision.test.ts +1 -0
  195. package/src/tests/helper-credentials.test.ts +137 -0
  196. package/src/tests/http/context-routes.test.ts +2 -2
  197. package/src/tests/http-api-integration.test.ts +5 -2
  198. package/src/tests/http-users.test.ts +1 -1
  199. package/src/tests/identity-refresh.test.ts +2 -2
  200. package/src/tests/internal-ai/complete-structured.test.ts +2 -2
  201. package/src/tests/internal-ai/credentials.test.ts +19 -17
  202. package/src/tests/jira-metadata.test.ts +1 -1
  203. package/src/tests/jira-oauth.test.ts +5 -5
  204. package/src/tests/jira-sync.test.ts +1 -1
  205. package/src/tests/jira-webhook-lifecycle.test.ts +3 -3
  206. package/src/tests/jira-webhook.test.ts +2 -2
  207. package/src/tests/kapso-inbound.test.ts +2 -2
  208. package/src/tests/kv-http.test.ts +1 -1
  209. package/src/tests/kv-namespace-resolution.test.ts +1 -1
  210. package/src/tests/kv-page-proxy.test.ts +2 -2
  211. package/src/tests/launch-password-rejection.test.ts +2 -2
  212. package/src/tests/linear-webhook.test.ts +1 -1
  213. package/src/tests/mcp-oauth-dcr-reuse.test.ts +6 -6
  214. package/src/tests/mcp-oauth-ensure-token.test.ts +28 -22
  215. package/src/tests/mcp-oauth-manual-client.test.ts +16 -12
  216. package/src/tests/mcp-oauth-queries.test.ts +35 -32
  217. package/src/tests/mcp-oauth-resolve-secrets.test.ts +8 -8
  218. package/src/tests/mcp-oauth-wrapper.test.ts +20 -20
  219. package/src/tests/mcp-user-route.test.ts +1 -1
  220. package/src/tests/memory-edges.test.ts +1 -1
  221. package/src/tests/memory-rate-endpoint.test.ts +1 -1
  222. package/src/tests/memory-rate-tool.test.ts +2 -2
  223. package/src/tests/memory-rater-e2e.test.ts +1 -1
  224. package/src/tests/memory-rater-llm-summarizer.test.ts +3 -3
  225. package/src/tests/memory-rater-llm.test.ts +1 -1
  226. package/src/tests/model-control.test.ts +3 -0
  227. package/src/tests/multi-runtime-registration.test.ts +97 -3
  228. package/src/tests/oauth-access-token-tool.test.ts +18 -18
  229. package/src/tests/oauth-callback-flow.test.ts +8 -8
  230. package/src/tests/oauth-credential-bindings.test.ts +29 -27
  231. package/src/tests/oauth-keepalive.test.ts +10 -10
  232. package/src/tests/oauth-presets.test.ts +13 -5
  233. package/src/tests/oauth-refresh-failure.test.ts +9 -9
  234. package/src/tests/oauth-refresh-sweep.test.ts +20 -13
  235. package/src/tests/oauth-wrapper.test.ts +1 -1
  236. package/src/tests/onboard-compose.test.ts +3 -3
  237. package/src/tests/onboard-env.test.ts +26 -26
  238. package/src/tests/onboard-non-interactive.test.ts +4 -4
  239. package/src/tests/opencode-adapter.test.ts +1 -1
  240. package/src/tests/opencode-plugin.test.ts +2 -2
  241. package/src/tests/otel-session-cost-metrics.test.ts +1 -1
  242. package/src/tests/page-proxy-authed.test.ts +2 -2
  243. package/src/tests/page-proxy.test.ts +2 -2
  244. package/src/tests/page-session.test.ts +7 -7
  245. package/src/tests/page-viewer-auth.test.ts +2 -2
  246. package/src/tests/pages-authed-mode.test.ts +1 -1
  247. package/src/tests/pages-http.test.ts +1 -1
  248. package/src/tests/pages-password-mode.test.ts +1 -1
  249. package/src/tests/pages-public-authed-401.test.ts +1 -1
  250. package/src/tests/pages-public-html.test.ts +2 -2
  251. package/src/tests/pages-view-count.test.ts +1 -1
  252. package/src/tests/pi-mono-adapter.test.ts +10 -10
  253. package/src/tests/pi-mono-extension.test.ts +2 -2
  254. package/src/tests/pricing-routes.test.ts +1 -1
  255. package/src/tests/profile-sync-warning.test.ts +8 -8
  256. package/src/tests/profile-sync.test.ts +8 -8
  257. package/src/tests/prompt-template-session.test.ts +36 -5
  258. package/src/tests/provider-process-group.test.ts +95 -4
  259. package/src/tests/providers/pi-cost.test.ts +1 -1
  260. package/src/tests/queue-stall-alarm.test.ts +1 -1
  261. package/src/tests/rbac-admission.test.ts +1 -1
  262. package/src/tests/rbac-charact-http.test.ts +1 -1
  263. package/src/tests/rbac-e2e-helpers.ts +1 -1
  264. package/src/tests/realtime-room-surfaces.test.ts +1 -1
  265. package/src/tests/reload-config.test.ts +1 -1
  266. package/src/tests/routing-reason-contract.test.ts +76 -3
  267. package/src/tests/routing-reason-inventory.test.ts +11 -6
  268. package/src/tests/routing-source.test.ts +53 -0
  269. package/src/tests/runner-agent-fs-provision-retry.test.ts +1 -1
  270. package/src/tests/runner-context-preamble.test.ts +1 -1
  271. package/src/tests/runner-deployment-resume.test.ts +1 -1
  272. package/src/tests/runner-fallback-output.test.ts +1 -1
  273. package/src/tests/runner-identity-refresh.test.ts +1 -1
  274. package/src/tests/runner-skills-refresh.test.ts +1 -1
  275. package/src/tests/schedule-target-type.test.ts +3 -3
  276. package/src/tests/scheduled-tasks.test.ts +14 -5
  277. package/src/tests/scheduler-occurrence.test.ts +347 -0
  278. package/src/tests/script-apis-mcp.test.ts +1 -1
  279. package/src/tests/script-connections-http.test.ts +61 -58
  280. package/src/tests/script-connections-mcp.test.ts +1 -1
  281. package/src/tests/script-connections.test.ts +1 -1
  282. package/src/tests/script-runs-http.test.ts +15 -7
  283. package/src/tests/script-workflows-runtime-e2e.test.ts +1 -1
  284. package/src/tests/scripts-external-api.test.ts +1 -1
  285. package/src/tests/scripts-http.test.ts +1 -1
  286. package/src/tests/scripts-mcp-e2e.test.ts +1 -1
  287. package/src/tests/scripts-only-gating.test.ts +2 -2
  288. package/src/tests/scripts-retention.test.ts +1 -1
  289. package/src/tests/scripts-runtime-identity.test.ts +1 -1
  290. package/src/tests/scripts-runtime-secret-egress.test.ts +1 -1
  291. package/src/tests/scripts-runtime.test.ts +6 -4
  292. package/src/tests/scripts-typecheck.test.ts +21 -0
  293. package/src/tests/sdk-allowlist.test.ts +1 -1
  294. package/src/tests/secret-scrubber.test.ts +38 -31
  295. package/src/tests/seed-registry.test.ts +46 -8
  296. package/src/tests/seed-schedules.test.ts +139 -8
  297. package/src/tests/seed-workflows.test.ts +93 -7
  298. package/src/tests/send-task-output-schema.test.ts +9 -1
  299. package/src/tests/send-task-requested-by.test.ts +1 -0
  300. package/src/tests/send-task-slack-routing-guard.test.ts +2 -0
  301. package/src/tests/session-costs-codex-recompute.test.ts +1 -1
  302. package/src/tests/session-costs-golden.test.ts +2 -2
  303. package/src/tests/session-costs-model-key-normalize.test.ts +2 -2
  304. package/src/tests/session-costs-recompute-all-providers.test.ts +1 -1
  305. package/src/tests/session-tokens.test.ts +1 -1
  306. package/src/tests/shutdown-error-scrubbing.test.ts +1 -1
  307. package/src/tests/slack-file-tools-attachments.test.ts +1 -1
  308. package/src/tests/slack-inbound-files.test.ts +222 -86
  309. package/src/tests/slack-reaction-config.test.ts +5 -4
  310. package/src/tests/slack-read-boundaries.test.ts +1 -1
  311. package/src/tests/slack-render-v2.test.ts +120 -1
  312. package/src/tests/status.test.ts +7 -7
  313. package/src/tests/steering-core.test.ts +1 -1
  314. package/src/tests/steering-transport.test.ts +4 -4
  315. package/src/tests/store-progress-output-guidance.test.ts +34 -0
  316. package/src/tests/swarm-tool-result-gate.test.ts +11 -11
  317. package/src/tests/swarm-x-tool.test.ts +7 -5
  318. package/src/tests/sync-ai-toolbox-skills.test.ts +19 -0
  319. package/src/tests/task-supersede-resume.test.ts +1 -1
  320. package/src/tests/task-tools-ctx.test.ts +2 -0
  321. package/src/tests/tasks-requested-by-filter.test.ts +2 -2
  322. package/src/tests/telemetry-init.test.ts +11 -3
  323. package/src/tests/tool-output-agent-id.test.ts +1 -0
  324. package/src/tests/tracker-fold.test.ts +7 -7
  325. package/src/tests/tracker-tools.test.ts +3 -3
  326. package/src/tests/ui-followup-lead-delegation.test.ts +1 -0
  327. package/src/tests/unified-oauth-migration.test.ts +5 -5
  328. package/src/tests/user-token-rest-auth.test.ts +1 -1
  329. package/src/tests/user-token-routes.test.ts +1 -1
  330. package/src/tests/whoami-route.test.ts +1 -1
  331. package/src/tests/workflow-agent-task.test.ts +15 -13
  332. package/src/tests/workflow-ctx.test.ts +1 -1
  333. package/src/tests/workflow-e2e.test.ts +1 -1
  334. package/src/tests/workflow-engine-v2.test.ts +3 -1
  335. package/src/tests/workflow-executors.test.ts +2 -2
  336. package/src/tests/workflow-http-v2.test.ts +8 -6
  337. package/src/tests/workflow-input-redaction.test.ts +7 -5
  338. package/src/tests/workflow-integration-io.test.ts +2 -2
  339. package/src/tests/workflow-llm.test.ts +5 -5
  340. package/src/tests/workflow-registry.test.ts +1 -1
  341. package/src/tests/workflow-swarm-script.test.ts +1 -1
  342. package/src/tests/workflow-triggers-v2.test.ts +23 -21
  343. package/src/tests/x-composio.test.ts +9 -7
  344. package/src/tests/x402-client.test.ts +1 -1
  345. package/src/tests/x402-config.test.ts +28 -41
  346. package/src/tools/defer-task.ts +156 -24
  347. package/src/tools/send-task.ts +21 -1
  348. package/src/tools/skills/skill-publish.ts +1 -0
  349. package/src/tools/store-progress.ts +1 -1
  350. package/src/tools/templates.ts +2 -1
  351. package/src/types.ts +11 -0
  352. package/src/utils/constants.ts +7 -1
  353. package/src/utils/credentials.test.ts +16 -16
  354. package/src/workflows/executors/agent-task.ts +5 -0
  355. package/templates/ai-toolbox.manifest.json +7 -1
  356. package/templates/schedules/daily-blocker-digest/config.json +6 -1
  357. package/templates/schedules/daily-compounding-reflection/config.json +1 -0
  358. package/templates/schedules/daily-hn-briefing/config.json +1 -1
  359. package/templates/schedules/daily-status-report/config.json +6 -1
  360. package/templates/schedules/daily-swarm-update-check/config.json +19 -0
  361. package/templates/schedules/daily-swarm-update-check/content.md +49 -0
  362. package/templates/schedules/daily-workflow-health-audit/config.json +6 -1
  363. package/templates/schedules/gtm-weekly-review/config.json +1 -1
  364. package/templates/schedules/weekly-code-health-reports/config.json +1 -1
  365. package/templates/schedules/weekly-dependabot-triage/config.json +1 -1
  366. package/templates/schedules/weekly-dora-metrics/config.json +1 -1
  367. package/templates/schedules/weekly-harness-upgrade-check/config.json +1 -1
  368. package/templates/skills/delegate-work/files/scripts/codex-exec.sh +1 -1
  369. package/templates/skills/serply-search/SKILL.md +95 -0
  370. package/templates/skills/serply-search/config.json +13 -0
  371. package/templates/skills/serply-search/content.md +90 -0
  372. package/templates/skills/swarm-scripts/SKILL.md +2 -2
  373. package/templates/skills/swarm-scripts/content.md +2 -2
  374. package/templates/workflows/claude-code-changelog-watch/config.json +1 -1
  375. package/templates/workflows/gsc-topic-miner/config.json +1 -1
  376. package/templates/workflows/linear-drain-loop/config.json +1 -1
  377. package/templates/workflows/llm-safe-release-context/config.json +1 -1
  378. package/templates/workflows/ralph-loop/config.json +1 -1
  379. package/dist/{azure-openai-responses-cqar64rc.js → azure-openai-responses-g85jv7m8.js} +8 -8
  380. package/dist/{cli-4xz3pmrq.js → cli-8qx7jnrk.js} +5 -5
  381. package/dist/{cli-6664w7y4.js → cli-wk0gjrn3.js} +3 -3
  382. package/dist/{google-vertex-ppw8ydpa.js → google-vertex-pkhpkbq9.js} +3 -3
  383. package/dist/{openai-codex-responses-g7w48y30.js → openai-codex-responses-pm5gnyfa.js} +4 -4
  384. package/dist/{openai-completions-0bqmsajw.js → openai-completions-qdcmkfnr.js} +12 -12
  385. package/dist/{openai-responses-nmeyptke.js → openai-responses-vwvk1taj.js} +13 -13
@@ -2,7 +2,7 @@ import {
2
2
  init_resolver,
3
3
  init_session_templates,
4
4
  resolveTemplateAsync
5
- } from "./cli-3apbzgyk.js";
5
+ } from "./cli-n75jt793.js";
6
6
 
7
7
  // src/prompts/steering-delivery.ts
8
8
  init_session_templates();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  contentSha256,
3
3
  init_profile_sync
4
- } from "./cli-zvz62chv.js";
4
+ } from "./cli-a45d5v9b.js";
5
5
  import {
6
6
  OpenAI,
7
7
  init_openai
@@ -11,7 +11,7 @@ import {
11
11
  getDbClient,
12
12
  init_db,
13
13
  isSqliteVecAvailable
14
- } from "./cli-yab68w40.js";
14
+ } from "./cli-qp69dd5d.js";
15
15
  import {
16
16
  __esm,
17
17
  __export,
@@ -4,11 +4,11 @@ import {
4
4
  getEmbeddingProvider,
5
5
  init_embedding,
6
6
  serializeEmbedding
7
- } from "./cli-3q5ejx9p.js";
7
+ } from "./cli-7kwmt3r5.js";
8
8
  import {
9
9
  getDbClient,
10
10
  init_db
11
- } from "./cli-yab68w40.js";
11
+ } from "./cli-qp69dd5d.js";
12
12
  import {
13
13
  init_secret_scrubber,
14
14
  scrubSecrets
@@ -1,13 +1,15 @@
1
1
  import {
2
+ bufferedFileFailures,
3
+ buildEffectiveText,
2
4
  createAdditiveBuffer,
3
- extractSlackMessageText
4
- } from "./cli-kgz4np97.js";
5
+ createSlackTaskWithFiles,
6
+ extractSlackMessageText,
7
+ fetchSlackFiles,
8
+ notifySlackFileFailures
9
+ } from "./cli-b8x19vbh.js";
5
10
  import {
6
11
  rewriteSlackMentions
7
- } from "./cli-ykxrnd1q.js";
8
- import {
9
- createTaskWithSiblingAwareness
10
- } from "./cli-q50ef8g0.js";
12
+ } from "./cli-72xdszyx.js";
11
13
  import {
12
14
  buildBufferFlushBlocks,
13
15
  ensureSlackThreadTree,
@@ -16,7 +18,7 @@ import {
16
18
  getSlackApp,
17
19
  isSlackRenderV2Enabled,
18
20
  registerTreeMessage
19
- } from "./cli-d8ftsp62.js";
21
+ } from "./cli-kt7wevqh.js";
20
22
  import {
21
23
  createLogEntry,
22
24
  getAgentById,
@@ -29,11 +31,15 @@ import {
29
31
  init_steering,
30
32
  requestSteering,
31
33
  slackContextKey
32
- } from "./cli-yab68w40.js";
34
+ } from "./cli-qp69dd5d.js";
33
35
  import {
34
36
  init_steering_enabled,
35
37
  isSteeringEnabled
36
- } from "./cli-3apbzgyk.js";
38
+ } from "./cli-n75jt793.js";
39
+ import {
40
+ __callDispose,
41
+ __using
42
+ } from "./cli-bc05qbss.js";
37
43
 
38
44
  // src/slack/event-dedup.ts
39
45
  var DEFAULT_TTL_MS = 300000;
@@ -148,13 +154,14 @@ var slackBuffer = createAdditiveBuffer({
148
154
  await slackFlush(items, key, reason === "manual");
149
155
  }
150
156
  });
151
- function bufferThreadMessage(channelId, threadTs, text, userId, ts) {
157
+ function bufferThreadMessage(channelId, threadTs, text, userId, ts, files) {
152
158
  slackBuffer.enqueue(makeKey(channelId, threadTs), {
153
159
  text,
154
160
  userId,
155
161
  ts,
156
162
  channelId,
157
- threadTs
163
+ threadTs,
164
+ files
158
165
  });
159
166
  }
160
167
  function getBufferMessageCount(key) {
@@ -194,106 +201,124 @@ async function getThreadContextForBuffer(channelId, threadTs) {
194
201
  }
195
202
  }
196
203
  async function slackFlush(items, key, immediate) {
197
- if (items.length === 0)
198
- return;
199
- const split = splitKey(key);
200
- if (!split) {
201
- console.warn(`[Slack] Buffer flush: malformed key ${key}`);
202
- return;
203
- }
204
- const { channelId, threadTs } = split;
205
- const originalRequesterId = items[0].userId;
206
- console.log(`[Slack] Flushing buffer: ${key} (${items.length} messages, immediate=${immediate})`);
207
- const combinedText = await rewriteSlackMentions(items.map((m) => m.text).join(`
204
+ let __stack = [];
205
+ try {
206
+ if (items.length === 0)
207
+ return;
208
+ const split = splitKey(key);
209
+ if (!split) {
210
+ console.warn(`[Slack] Buffer flush: malformed key ${key}`);
211
+ return;
212
+ }
213
+ const { channelId, threadTs } = split;
214
+ const originalRequesterId = items[0].userId;
215
+ console.log(`[Slack] Flushing buffer: ${key} (${items.length} messages, immediate=${immediate})`);
216
+ const app = getSlackApp();
217
+ const files = items.flatMap((item) => item.files ?? []);
218
+ const inbound = __using(__stack, app ? await fetchSlackFiles(app.client, files) : {
219
+ files,
220
+ fetched: [],
221
+ failed: bufferedFileFailures(files),
222
+ async[Symbol.asyncDispose]() {}
223
+ }, 1);
224
+ const resolvedFiles = new Map(inbound.files.map((file) => [file.id, file]));
225
+ const combinedText = await rewriteSlackMentions(items.map((item) => buildEffectiveText(item.text, item.files?.map((file) => resolvedFiles.get(file.id) ?? file), inbound.failed)).join(`
208
226
  ---
209
227
  `));
210
- const description = `[Thread follow-up — ${items.length} message(s) buffered]
228
+ const description = `[Thread follow-up — ${items.length} message(s) buffered]
211
229
 
212
230
  ${combinedText}`;
213
- const latestActiveTask = await getLatestActiveTaskInThread(channelId, threadTs);
214
- if (latestActiveTask) {
215
- console.log(`[Slack] Dependency chaining: latest active task ${latestActiveTask.id} (status: ${latestActiveTask.status})`);
216
- }
217
- const steering = await requestSlackThreadSteering({
218
- channelId,
219
- threadTs,
220
- message: combinedText,
221
- messageTimestamps: items.map((item) => item.ts)
222
- });
223
- if (steering) {
224
- console.log(`[Slack] Buffer flushed → steering ${steering.result.outcome} for task ${steering.task.id}`);
225
- const app2 = getSlackApp();
226
- const agent = steering.task.agentId ? await getAgentById(steering.task.agentId) : undefined;
227
- if (app2) {
228
- if (!isSlackRenderV2Enabled()) {
229
- try {
230
- await app2.client.chat.postMessage({
231
- channel: channelId,
232
- thread_ts: threadTs,
233
- text: formatSlackSteeringAck(steering.result),
234
- unfurl_links: false,
235
- unfurl_media: false,
236
- ...agent ? { username: getAgentDisplayName(agent), icon_emoji: getAgentEmoji(agent) } : {}
237
- });
238
- } catch (error) {
239
- console.error("[Slack] Failed to post steering feedback:", error);
231
+ const latestActiveTask = await getLatestActiveTaskInThread(channelId, threadTs);
232
+ if (latestActiveTask) {
233
+ console.log(`[Slack] Dependency chaining: latest active task ${latestActiveTask.id} (status: ${latestActiveTask.status})`);
234
+ }
235
+ const steering = files.length === 0 ? await requestSlackThreadSteering({
236
+ channelId,
237
+ threadTs,
238
+ message: combinedText,
239
+ messageTimestamps: items.map((item) => item.ts)
240
+ }) : null;
241
+ if (steering) {
242
+ console.log(`[Slack] Buffer flushed → steering ${steering.result.outcome} for task ${steering.task.id}`);
243
+ const agent = steering.task.agentId ? await getAgentById(steering.task.agentId) : undefined;
244
+ if (app) {
245
+ if (!isSlackRenderV2Enabled()) {
246
+ try {
247
+ await app.client.chat.postMessage({
248
+ channel: channelId,
249
+ thread_ts: threadTs,
250
+ text: formatSlackSteeringAck(steering.result),
251
+ unfurl_links: false,
252
+ unfurl_media: false,
253
+ ...agent ? { username: getAgentDisplayName(agent), icon_emoji: getAgentEmoji(agent) } : {}
254
+ });
255
+ } catch (error) {
256
+ console.error("[Slack] Failed to post steering feedback:", error);
257
+ }
240
258
  }
241
259
  }
260
+ return;
242
261
  }
243
- return;
244
- }
245
- const lead = await getLeadAgent();
246
- const threadContext = await getThreadContextForBuffer(channelId, threadTs);
247
- const fullDescription = threadContext ? `<thread_context>
262
+ const lead = await getLeadAgent();
263
+ const threadContext = await getThreadContextForBuffer(channelId, threadTs);
264
+ const fullDescription = threadContext ? `<thread_context>
248
265
  ${threadContext}
249
266
  </thread_context>
250
267
 
251
268
  ${description}` : description;
252
- const dependsOn = !immediate && latestActiveTask ? [latestActiveTask.id] : undefined;
253
- const mostRecentTask = await getMostRecentTaskInThread(channelId, threadTs);
254
- const task = await createTaskWithSiblingAwareness(fullDescription, {
255
- agentId: lead?.id,
256
- routingReason: lead && mostRecentTask?.agentId === lead.id ? "continuity" : lead ? "skill" : undefined,
257
- source: "slack",
258
- slackChannelId: channelId,
259
- slackThreadTs: threadTs,
260
- slackTriggerMessageTs: items.at(-1).ts,
261
- slackUserId: originalRequesterId,
262
- dependsOn,
263
- parentTaskId: mostRecentTask?.id,
264
- contextKey: slackContextKey({ channelId, threadTs })
265
- });
266
- console.log(`[Slack] Buffer flushed → task ${task.id} (dependsOn: ${dependsOn ? dependsOn.join(", ") : "none"})`);
267
- if (isSlackRenderV2Enabled()) {
268
- await ensureSlackThreadTree([task.id]);
269
- return;
270
- }
271
- const app = getSlackApp();
272
- if (app) {
273
- const hasDependency = !immediate && !!latestActiveTask;
274
- const blocks = buildBufferFlushBlocks({
275
- messageCount: items.length,
276
- taskId: task.id,
277
- hasDependency
278
- });
279
- const fallbackText = hasDependency ? `${items.length} follow-up message(s) queued pending completion of current task` : `${items.length} follow-up message(s) batched into task`;
280
- try {
281
- const result = await app.client.chat.postMessage({
282
- channel: channelId,
283
- thread_ts: threadTs,
284
- text: fallbackText,
285
- unfurl_links: false,
286
- unfurl_media: false,
287
- ...lead ? { username: getAgentDisplayName(lead), icon_emoji: getAgentEmoji(lead) } : {},
288
- blocks
269
+ const dependsOn = !immediate && latestActiveTask ? [latestActiveTask.id] : undefined;
270
+ const mostRecentTask = await getMostRecentTaskInThread(channelId, threadTs);
271
+ const { task, unattached } = await createSlackTaskWithFiles(fullDescription, {
272
+ agentId: lead?.id,
273
+ routingReason: lead && mostRecentTask?.agentId === lead.id ? "continuity" : lead ? "skill" : undefined,
274
+ routingSource: lead ? "engine_default" : undefined,
275
+ source: "slack",
276
+ slackChannelId: channelId,
277
+ slackThreadTs: threadTs,
278
+ slackTriggerMessageTs: items.at(-1).ts,
279
+ slackUserId: originalRequesterId,
280
+ dependsOn,
281
+ parentTaskId: mostRecentTask?.id,
282
+ contextKey: slackContextKey({ channelId, threadTs })
283
+ }, inbound);
284
+ if (app)
285
+ await notifySlackFileFailures(app.client, channelId, threadTs, unattached);
286
+ console.log(`[Slack] Buffer flushed → task ${task.id} (dependsOn: ${dependsOn ? dependsOn.join(", ") : "none"})`);
287
+ if (isSlackRenderV2Enabled()) {
288
+ await ensureSlackThreadTree([task.id]);
289
+ return;
290
+ }
291
+ if (app) {
292
+ const hasDependency = !immediate && !!latestActiveTask;
293
+ const blocks = buildBufferFlushBlocks({
294
+ messageCount: items.length,
295
+ taskId: task.id,
296
+ hasDependency
289
297
  });
290
- if (result.ts && task) {
291
- await registerTreeMessage(task.id, channelId, threadTs, result.ts);
292
- console.log(`[Slack] Registered batched task ${task.id.slice(0, 8)} tree message from buffer flush`);
298
+ const fallbackText = hasDependency ? `${items.length} follow-up message(s) queued pending completion of current task` : `${items.length} follow-up message(s) batched into task`;
299
+ try {
300
+ const result = await app.client.chat.postMessage({
301
+ channel: channelId,
302
+ thread_ts: threadTs,
303
+ text: fallbackText,
304
+ unfurl_links: false,
305
+ unfurl_media: false,
306
+ ...lead ? { username: getAgentDisplayName(lead), icon_emoji: getAgentEmoji(lead) } : {},
307
+ blocks
308
+ });
309
+ if (result.ts && task) {
310
+ await registerTreeMessage(task.id, channelId, threadTs, result.ts);
311
+ console.log(`[Slack] Registered batched task ${task.id.slice(0, 8)} tree message from buffer flush`);
312
+ }
313
+ } catch (error) {
314
+ console.error("[Slack] Failed to post buffer flush feedback:", error);
293
315
  }
294
- } catch (error) {
295
- console.error("[Slack] Failed to post buffer flush feedback:", error);
296
316
  }
317
+ } catch (_catch) {
318
+ var _err = _catch, _hasErr = 1;
319
+ } finally {
320
+ var _promise = __callDispose(__stack, _err, _hasErr);
321
+ _promise && await _promise;
297
322
  }
298
323
  }
299
324
 
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  init_task_attachment_links,
3
3
  taskAttachmentDisplayUrl
4
- } from "./cli-9d8ntetj.js";
4
+ } from "./cli-2658f6at.js";
5
5
  import {
6
6
  IDENTITY_FIELD_BUDGETS,
7
7
  init_identity_field_budget,
8
8
  init_templates
9
- } from "./cli-08b07b4r.js";
9
+ } from "./cli-hmyynq9b.js";
10
10
  import {
11
11
  init_resolver,
12
12
  init_steering_enabled,
13
13
  isSteeringEnabled,
14
14
  resolveTemplateAsync
15
- } from "./cli-3apbzgyk.js";
15
+ } from "./cli-n75jt793.js";
16
16
  import {
17
17
  MAX_PROFILE_FILE_LENGTH,
18
18
  init_constants
19
- } from "./cli-e29gmdmw.js";
19
+ } from "./cli-dv6cdjs2.js";
20
20
  import {
21
21
  init_secret_scrubber,
22
22
  scrubSecrets
@@ -3966,7 +3966,7 @@ _EnvironmentWorker_signal = new WeakMap, _EnvironmentWorker_instances = new Weak
3966
3966
  const ctrl = new AbortController;
3967
3967
  const detachExternal = linkAbort(externalSignal, ctrl);
3968
3968
  const lease = new Lease(ctrl);
3969
- const agentToolset = await import("./node-x1g4v0pq.js");
3969
+ const agentToolset = await import("./node-209sxmg3.js");
3970
3970
  let leaseTtlMs;
3971
3971
  let runner;
3972
3972
  const heartbeatPromise = heartbeatLoop(sessionClient, work, lease, log2, this.requestOptions, (ttlMs) => {
@@ -4,11 +4,11 @@ import {
4
4
  } from "./cli-jsp14b6c.js";
5
5
  import {
6
6
  createTaskWithSiblingAwareness
7
- } from "./cli-q50ef8g0.js";
7
+ } from "./cli-n1yj5fd5.js";
8
8
  import {
9
9
  init_task_attachment_links,
10
10
  taskAttachmentFetchCommand
11
- } from "./cli-9d8ntetj.js";
11
+ } from "./cli-2658f6at.js";
12
12
  import {
13
13
  getAgentById,
14
14
  getAgentWorkingOnThread,
@@ -19,13 +19,13 @@ import {
19
19
  insertTaskAttachment,
20
20
  promoteDraftTask,
21
21
  refreshDraftTaskLease
22
- } from "./cli-yab68w40.js";
22
+ } from "./cli-qp69dd5d.js";
23
23
  import {
24
24
  init_registry,
25
25
  init_resolver,
26
26
  registerTemplate,
27
27
  resolveTemplate
28
- } from "./cli-3apbzgyk.js";
28
+ } from "./cli-n75jt793.js";
29
29
  import {
30
30
  init_env_flag,
31
31
  isEnvFlagEnabled
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-yab68w40.js";
4
+ } from "./cli-qp69dd5d.js";
5
5
 
6
6
  // src/be/seed-pricing.ts
7
7
  init_db();
@@ -5,7 +5,7 @@ import {
5
5
  getDb,
6
6
  getDbClient,
7
7
  init_db
8
- } from "./cli-yab68w40.js";
8
+ } from "./cli-qp69dd5d.js";
9
9
 
10
10
  // src/be/rbac-roles.ts
11
11
  init_db();
@@ -42,7 +42,8 @@ function buildAgentFsLiveUrl(opts) {
42
42
  return null;
43
43
  const host = getAgentFsLiveUrl();
44
44
  const normalizedPath = path.replace(/^\/+/, "");
45
- return `${host}/file/~/${orgId}/${driveId}/${normalizedPath}`;
45
+ const encodedPath = normalizedPath.split("/").map((segment) => encodeURIComponent(segment).replace(/%25([0-9a-f]{2})/gi, "%$1")).join("/");
46
+ return `${host}/file/~/${orgId}/${driveId}/${encodedPath}`;
46
47
  }
47
48
  var MAX_PROFILE_FILE_LENGTH, DEFAULT_APP_URL = "https://app.agent-swarm.dev", DEFAULT_AGENT_FS_LIVE_URL = "https://live.agent-fs.dev";
48
49
  var init_constants = __esm(() => {
@@ -9,7 +9,7 @@ import {
9
9
  getBuiltinModel,
10
10
  parseModelStr,
11
11
  resolveCredential
12
- } from "./cli-1ebpar1q.js";
12
+ } from "./cli-mzb0n642.js";
13
13
  import {
14
14
  DEFAULT_OPENROUTER_BASE_URL,
15
15
  getOpenRouterBaseUrl
@@ -7,7 +7,7 @@ var package_default;
7
7
  var init_package = __esm(() => {
8
8
  package_default = {
9
9
  name: "@desplega.ai/agent-swarm",
10
- version: "1.149.0",
10
+ version: "1.150.0",
11
11
  description: "agent-swarm.dev — an open-source operating system for AI work: a lead agent breaks goals into tasks, routes them to specialized workers such as Claude Code or Codex, runs each worker in an isolated container, and preserves shared memory, tools, schedules, and review gates so delegated work compounds across sessions.",
12
12
  keywords: [
13
13
  "agent-swarm.dev",
@@ -200,8 +200,8 @@ var init_package = __esm(() => {
200
200
  "@inkjs/ui": "^2.0.0",
201
201
  "@linear/sdk": "^77.0.0",
202
202
  "@modelcontextprotocol/sdk": "1.29.0",
203
- "@openai/codex": "0.153.4",
204
- "@opencode-ai/sdk": "^1.18.29",
203
+ "@openai/codex": "0.154.0",
204
+ "@opencode-ai/sdk": "^1.18.31",
205
205
  "@openfort/openfort-node": "^0.9.1",
206
206
  "@opentelemetry/api": "^1.9.1",
207
207
  "@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  buildModelsDevSeedRows,
3
3
  loadModelsDevCache
4
- } from "./cli-9fy6nk6g.js";
4
+ } from "./cli-ceb5y160.js";
5
5
  import {
6
6
  createLogEntry,
7
7
  getActivePricingRow,
8
8
  getDbClient,
9
9
  init_db,
10
10
  insertPricingRow
11
- } from "./cli-yab68w40.js";
11
+ } from "./cli-qp69dd5d.js";
12
12
  import {
13
13
  init_secret_scrubber,
14
14
  scrubSecrets
@@ -5,9 +5,8 @@ import {
5
5
  instantFlush,
6
6
  requestSlackThreadSteering,
7
7
  wasEventSeen
8
- } from "./cli-qaacms9y.js";
8
+ } from "./cli-9gqddmxs.js";
9
9
  import {
10
- bufferedFileFailures,
11
10
  buildEffectiveText,
12
11
  createSlackTaskWithFiles,
13
12
  extractSlackMessageText,
@@ -16,25 +15,19 @@ import {
16
15
  hasOtherUserMention,
17
16
  notifySlackFileFailures,
18
17
  routeMessage
19
- } from "./cli-kgz4np97.js";
20
- import"./cli-jsp14b6c.js";
18
+ } from "./cli-b8x19vbh.js";
21
19
  import {
22
20
  enrichSlackUserEmail,
23
21
  resolveSlackUserId,
24
22
  rewriteSlackMentions
25
- } from "./cli-ykxrnd1q.js";
26
- import"./cli-gv88e1vf.js";
27
- import"./cli-q50ef8g0.js";
23
+ } from "./cli-72xdszyx.js";
28
24
  import {
29
25
  ackSlackMessage,
30
26
  buildTreeBlocks,
31
27
  ensureSlackThreadTree,
32
28
  isSlackRenderV2Enabled,
33
29
  registerTreeMessage
34
- } from "./cli-d8ftsp62.js";
35
- import"./cli-q51yprfq.js";
36
- import"./cli-9d8ntetj.js";
37
- import"./cli-yatxqynm.js";
30
+ } from "./cli-kt7wevqh.js";
38
31
  import {
39
32
  getAgentById,
40
33
  getAgentWorkingOnThread,
@@ -45,29 +38,19 @@ import {
45
38
  init_db,
46
39
  reactionName,
47
40
  slackContextKey
48
- } from "./cli-yab68w40.js";
49
- import"./cli-08b07b4r.js";
41
+ } from "./cli-qp69dd5d.js";
50
42
  import {
51
43
  init_resolver,
52
44
  resolveTemplate
53
- } from "./cli-3apbzgyk.js";
54
- import"./cli-e29gmdmw.js";
55
- import"./cli-c2mk1kgf.js";
45
+ } from "./cli-n75jt793.js";
56
46
  import {
57
47
  init_env_flag,
58
48
  isEnvFlagEnabled
59
49
  } from "./cli-ej6gbxfb.js";
60
- import"./cli-sd0mxa3c.js";
61
- import"./cli-w5e1d1vv.js";
62
- import"./cli-kjwt6hdf.js";
63
- import"./cli-r2ap2czm.js";
64
- import"./cli-pzxba7gw.js";
65
50
  import {
66
51
  init_event_bus,
67
52
  workflowEventBus
68
53
  } from "./cli-f7kvq46p.js";
69
- import"./cli-zf8jjwex.js";
70
- import"./cli-bd957dgb.js";
71
54
  import {
72
55
  __callDispose,
73
56
  __using
@@ -308,18 +291,16 @@ function registerMessageHandler(app) {
308
291
  const additiveSlack = isEnvFlagEnabled("ADDITIVE_SLACK", false);
309
292
  const requireMentionForThreadFollowup = isEnvFlagEnabled("SLACK_THREAD_FOLLOWUP_REQUIRE_MENTION", false);
310
293
  if (additiveSlack && msg.thread_ts) {
311
- const unattached2 = bufferedFileFailures(msg.files);
312
- const stripped = buildEffectiveText(msg.text, msg.files, unattached2).replace(/<@[A-Z0-9]+>/g, "").trim();
294
+ const stripped = (msg.text ?? "").replace(/<@[A-Z0-9]+>/g, "").trim();
313
295
  if (stripped.startsWith("!now") && await hasSwarmThreadActivity(client, msg.channel, msg.thread_ts)) {
314
296
  const nowMessage = stripped.replace(/^!now\s*/, "").trim();
315
297
  const threadKey = `${msg.channel}:${msg.thread_ts}`;
316
298
  console.log(`[Slack] !now command detected in thread ${threadKey}${nowMessage ? ` with message: "${nowMessage}"` : ""}`);
317
- if (nowMessage) {
318
- bufferThreadMessage(msg.channel, msg.thread_ts, nowMessage, msg.user, msg.ts);
299
+ if (nowMessage || msg.files?.length) {
300
+ bufferThreadMessage(msg.channel, msg.thread_ts, nowMessage, msg.user, msg.ts, msg.files);
319
301
  }
320
302
  await instantFlush(threadKey);
321
303
  await ackSlackMessage(client, msg.channel, msg.ts, reactionName("now"), "now");
322
- await notifySlackFileFailures(client, msg.channel, msg.thread_ts, unattached2);
323
304
  return;
324
305
  }
325
306
  }
@@ -331,14 +312,12 @@ function registerMessageHandler(app) {
331
312
  const hasSwarmActivity = await hasSwarmThreadActivity(client, msg.channel, msg.thread_ts);
332
313
  if (hasSwarmActivity) {
333
314
  const threadKey = `${msg.channel}:${msg.thread_ts}`;
334
- const unattached2 = bufferedFileFailures(msg.files);
335
- bufferThreadMessage(msg.channel, msg.thread_ts, buildEffectiveText(msg.text, msg.files, unattached2), msg.user, msg.ts);
315
+ bufferThreadMessage(msg.channel, msg.thread_ts, msg.text ?? "", msg.user, msg.ts, msg.files);
336
316
  const count = getBufferMessageCount(threadKey);
337
317
  const event2 = count === 1 ? "accepted" : "buffered";
338
318
  const name = reactionName(event2);
339
319
  console.log(`[Slack] Additive buffer: ${threadKey} (message #${count}, reaction: ${name})`);
340
320
  await ackSlackMessage(client, msg.channel, msg.ts, name, event2);
341
- await notifySlackFileFailures(client, msg.channel, msg.thread_ts, unattached2);
342
321
  return;
343
322
  }
344
323
  }
@@ -388,6 +367,7 @@ ${taskDescription2}`;
388
367
  const { task, unattached: unattached2 } = await createSlackTaskWithFiles(fullTaskDescription2, {
389
368
  agentId: lead?.id,
390
369
  routingReason: lead ? "skill" : undefined,
370
+ routingSource: lead ? "engine_default" : undefined,
391
371
  source: "slack",
392
372
  slackChannelId: msg.channel,
393
373
  slackThreadTs: threadTs2,
@@ -476,6 +456,7 @@ ${taskDescription}`;
476
456
  const created2 = await createSlackTaskWithFiles(fullTaskDescription, {
477
457
  agentId: agent.id,
478
458
  routingReason: "human_pinned",
459
+ routingSource: "engine_default",
479
460
  source: "slack",
480
461
  slackChannelId: msg.channel,
481
462
  slackThreadTs: threadTs,
@@ -494,6 +475,7 @@ ${taskDescription}`;
494
475
  const created = await createSlackTaskWithFiles(fullTaskDescription, {
495
476
  agentId: agent.id,
496
477
  routingReason: "human_pinned",
478
+ routingSource: "engine_default",
497
479
  source: "slack",
498
480
  slackChannelId: msg.channel,
499
481
  slackThreadTs: threadTs,
@@ -597,10 +579,5 @@ ${taskDescription}`;
597
579
  console.log(`[Slack] App mentioned in channel ${event.channel}`);
598
580
  });
599
581
  }
600
- export {
601
- checkUserAccess,
602
- isBotMessage,
603
- isSwarmThreadRoot,
604
- registerMessageHandler,
605
- resetSlackHandlerCachesForTesting
606
- };
582
+
583
+ export { checkUserAccess, isUserAllowed, isBotMessage, resetSlackHandlerCachesForTesting, isSwarmThreadRoot, registerMessageHandler };
@@ -6,7 +6,7 @@ import {
6
6
  isSteeringEnabled,
7
7
  registerTemplate,
8
8
  resolveTemplateAsync
9
- } from "./cli-3apbzgyk.js";
9
+ } from "./cli-n75jt793.js";
10
10
  import {
11
11
  __esm
12
12
  } from "./cli-bc05qbss.js";