@desplega.ai/agent-swarm 1.127.0 → 1.128.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 (94) hide show
  1. package/README.md +2 -2
  2. package/dist/{actions-644n22m6.js → actions-3tjz0jkn.js} +6 -6
  3. package/dist/{app-ny0gj6kg.js → app-08mcfqa5.js} +3 -3
  4. package/dist/{assistant-gj8b3c00.js → assistant-j90fr0jm.js} +15 -8
  5. package/dist/{boot-reembed-xkbsbxxn.js → boot-reembed-e3290yjs.js} +4 -4
  6. package/dist/{boot-reembed-5ca9kv94.js → boot-reembed-fsj45809.js} +3 -3
  7. package/dist/{boot-scrub-logs-669xsqq1.js → boot-scrub-logs-15m9vfhy.js} +2 -2
  8. package/dist/{cli-sh9vv838.js → cli-0fxf2ess.js} +1 -1
  9. package/dist/{cli-jqqq7zhc.js → cli-24adhcy3.js} +1 -1
  10. package/dist/{cli-xt6r7vgw.js → cli-61y9bkab.js} +1 -1
  11. package/dist/{cli-4gfwmxa8.js → cli-852zctpg.js} +1 -1
  12. package/dist/{cli-n09s3zaf.js → cli-86jbqh6f.js} +66 -30
  13. package/dist/{cli-b696veeb.js → cli-a36npnxa.js} +25 -16
  14. package/dist/{cli-dhb6rmf6.js → cli-agwvxxvh.js} +6 -6
  15. package/dist/{cli-nftx594v.js → cli-br49cbqp.js} +3 -3
  16. package/dist/{cli-xg5g50w0.js → cli-bz42mzy3.js} +3 -3
  17. package/dist/{cli-bs2awjtx.js → cli-gg85k3zt.js} +1 -1
  18. package/dist/{cli-emcj32bv.js → cli-hwtd7cvy.js} +7 -4
  19. package/dist/{cli-c64x8s7t.js → cli-jjp0c4rj.js} +2 -2
  20. package/dist/{cli-dw20rn0d.js → cli-k9m7hetx.js} +2 -2
  21. package/dist/{cli-4ww6rhhg.js → cli-qd4xzgk9.js} +1 -1
  22. package/dist/{cli-ynppb182.js → cli-rwctnq1j.js} +2 -2
  23. package/dist/{cli-bwx9h2cj.js → cli-shzqkrbd.js} +2 -2
  24. package/dist/{cli-bepzsbrb.js → cli-t2msesap.js} +4 -4
  25. package/dist/{cli-x883h2ky.js → cli-t83gdcf7.js} +1 -1
  26. package/dist/{cli-6b41m0f8.js → cli-thsqy2j0.js} +156 -71
  27. package/dist/{cli-68jy5v0w.js → cli-vajhsd2e.js} +1 -1
  28. package/dist/{cli-wa4p03nz.js → cli-wgvn0gs7.js} +4 -3
  29. package/dist/{cli-rdhfg33j.js → cli-xc0x7wey.js} +1 -1
  30. package/dist/{cli-2e10g9r7.js → cli-xn11dp5x.js} +2 -2
  31. package/dist/{cli-yy56svjs.js → cli-xvkz3rm5.js} +1 -1
  32. package/dist/cli.js +10 -10
  33. package/dist/{commands-jasxqcmp.js → commands-pfy10d4q.js} +2 -2
  34. package/dist/{db-wkqh4pk7.js → db-0f7f1cvj.js} +2 -2
  35. package/dist/{handlers-jtp4gkw3.js → handlers-d25x44k0.js} +14 -22
  36. package/dist/{hook-yw7b5qpr.js → hook-qpgs6nt4.js} +1 -1
  37. package/dist/{http-821k8pmw.js → http-2f52nkya.js} +63 -45
  38. package/dist/{index-acdakscd.js → index-4b6wmbmk.js} +9 -9
  39. package/dist/{index-fwv94k2a.js → index-hc8ar2w3.js} +11 -11
  40. package/dist/{index-qsjkh0ad.js → index-mm5rc1qa.js} +10 -10
  41. package/dist/{index-j0m3pjgx.js → index-yg4y519c.js} +13 -7
  42. package/dist/{keepalive-4kr014zc.js → keepalive-aw9aqjd5.js} +5 -5
  43. package/dist/{lead-cvh88580.js → lead-sjxyhtxa.js} +19 -19
  44. package/dist/{maintenance-mnbj2wpg.js → maintenance-5h18tcq7.js} +4 -4
  45. package/dist/{oauth-refresh-sweep-feh6w9a0.js → oauth-refresh-sweep-qgpbc9am.js} +4 -4
  46. package/dist/{onboard-22n94r81.js → onboard-76xj7266.js} +6 -2
  47. package/dist/{otel-impl-2qdetxze.js → otel-impl-2pfbdnr8.js} +1 -1
  48. package/dist/{pricing-refresh-zjq4hrdx.js → pricing-refresh-ba3ag6hh.js} +4 -4
  49. package/dist/{rbac-roles-4nr41yak.js → rbac-roles-jm18zgpz.js} +2 -2
  50. package/dist/{rbac-roles-335afb7w.js → rbac-roles-ktzfw0b0.js} +3 -3
  51. package/dist/{render-v2-hy2jyz5n.js → render-v2-bhez9szv.js} +3 -3
  52. package/dist/{seed-pricing-pbc479ga.js → seed-pricing-ybkssg65.js} +3 -3
  53. package/dist/{setup-qrfd6aae.js → setup-eegn7eyv.js} +2 -2
  54. package/dist/{worker-6cyvsr2y.js → worker-vvwg97h9.js} +19 -19
  55. package/openapi.json +12 -6
  56. package/package.json +2 -2
  57. package/src/commands/onboard/compose-generator.ts +6 -0
  58. package/src/commands/runner.ts +8 -0
  59. package/src/http/tasks.ts +27 -1
  60. package/src/http/workflows.ts +4 -4
  61. package/src/http/x.ts +5 -3
  62. package/src/scripts-runtime/executors/types.ts +8 -0
  63. package/src/scripts-runtime/swarm-sdk.ts +1 -0
  64. package/src/slack/HEURISTICS.md +2 -0
  65. package/src/slack/ack.ts +33 -0
  66. package/src/slack/assistant.ts +12 -1
  67. package/src/slack/handlers.test.ts +162 -1
  68. package/src/slack/handlers.ts +11 -16
  69. package/src/slack/thread-buffer.ts +0 -13
  70. package/src/tasks/terminal-result-guard.ts +121 -0
  71. package/src/tests/audit-updated-by.test.ts +6 -6
  72. package/src/tests/http-api-integration.test.ts +77 -0
  73. package/src/tests/onboard-compose.test.ts +18 -0
  74. package/src/tests/runner-fallback-output.test.ts +31 -2
  75. package/src/tests/sdk-allowlist.test.ts +36 -0
  76. package/src/tests/swarm-tool-result-gate.test.ts +80 -0
  77. package/src/tests/ui-logs-parser.test.ts +778 -0
  78. package/src/tests/workflow-executors.test.ts +17 -0
  79. package/src/tests/workflow-http-v2.test.ts +108 -0
  80. package/src/tests/workflow-mcp-trigger-schema.test.ts +174 -0
  81. package/src/tests/workflow-registry.test.ts +41 -2
  82. package/src/tests/workflow-swarm-script.test.ts +2 -0
  83. package/src/tools/store-progress.ts +12 -84
  84. package/src/tools/utils.ts +45 -1
  85. package/src/tools/workflows/create-workflow.ts +15 -3
  86. package/src/tools/workflows/patch-workflow-node.ts +19 -3
  87. package/src/tools/workflows/patch-workflow.ts +26 -2
  88. package/src/tools/workflows/update-workflow.ts +17 -3
  89. package/src/types.ts +2 -1
  90. package/src/workflows/definition.ts +35 -1
  91. package/src/workflows/executors/script.ts +2 -1
  92. package/src/workflows/executors/swarm-script.ts +7 -3
  93. package/src/workflows/index.ts +13 -10
  94. package/templates/skills/workflow-iterate/content.md +6 -0
package/README.md CHANGED
@@ -146,7 +146,7 @@ Check [our templates](https://templates.agent-swarm.dev) for a quick start.
146
146
  - **Config-driven metrics dashboards** — define read-only SQL widgets, version them, and render them in the dashboard without shipping custom frontend code. [Metrics API →](https://docs.agent-swarm.dev/docs/api-reference/stats)
147
147
  - **DB-backed pages** — agents publish HTML or JSON pages (reports, dashboards, action specs) via `create_page`, remove stale pages with `delete-page`, and share them with public / authed / password modes, version history, view counters, diff helpers, and PDF export. [MCP tools → Pages](https://docs.agent-swarm.dev/docs/reference/mcp-tools#pages-tools)
148
148
  - **KV store** — Redis-like namespaced key/value store with auto-scoped context (Slack thread / PR / Linear issue / page). [MCP tools → KV](https://docs.agent-swarm.dev/docs/reference/mcp-tools#kv-tools)
149
- - **Real-time dashboard + task attachments** — monitor agents, tasks, and inter-agent chat; rename sessions inline; search a broad Lucide catalog to customize each agent's icon and color; filter Pages, Approval Requests, and workflow definitions with URL-backed search/facets; create tasks with uploaded files from the sessions composer; and preview task attachments inline above session prompts. [app.agent-swarm.dev →](https://app.agent-swarm.dev)
149
+ - **Real-time dashboard + task attachments** — monitor agents, tasks, and inter-agent chat; filter tasks by requester (including yourself or unattributed work); rename sessions inline; search a broad Lucide catalog to customize each agent's icon and color; filter Pages, Approval Requests, and workflow definitions with URL-backed search/facets; create tasks with uploaded files from the sessions composer; and preview task attachments inline above session prompts. [app.agent-swarm.dev →](https://app.agent-swarm.dev)
150
150
 
151
151
  ## Quick Start
152
152
 
@@ -221,7 +221,7 @@ Missing one? Ask the swarm to build it.
221
221
 
222
222
  ## Dashboard
223
223
 
224
- Real-time monitoring of agents, tasks, and inter-agent chat. Session titles can be renamed inline, and agent profiles can search hundreds of Lucide icons, pick a color, and retain deterministic defaults when no customization is set. Use the hosted version at [app.agent-swarm.dev](https://app.agent-swarm.dev), or run locally:
224
+ Real-time monitoring of agents, tasks, and inter-agent chat. The task list can be filtered by requester, including **Me** and **Unattributed**, while keeping the selection in the page URL. Session titles can be renamed inline, and agent profiles can search hundreds of Lucide icons, pick a color, and retain deterministic defaults when no customization is set. Use the hosted version at [app.agent-swarm.dev](https://app.agent-swarm.dev), or run locally:
225
225
 
226
226
  ```bash
227
227
  cd apps/ui && bun install && bun run dev
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  resolveSlackUserId
3
- } from "./cli-ynppb182.js";
4
- import"./cli-68jy5v0w.js";
3
+ } from "./cli-rwctnq1j.js";
4
+ import"./cli-vajhsd2e.js";
5
5
  import {
6
6
  createTaskWithSiblingAwareness
7
- } from "./cli-x883h2ky.js";
7
+ } from "./cli-t83gdcf7.js";
8
8
  import {
9
9
  buildCancelledBlocks,
10
10
  ensureSlackThreadTree,
11
11
  getTaskLink,
12
12
  isSlackRenderV2Enabled
13
- } from "./cli-dhb6rmf6.js";
13
+ } from "./cli-agwvxxvh.js";
14
14
  import"./cli-rkndnn90.js";
15
15
  import"./cli-b0p7rfnd.js";
16
16
  import"./cli-wspgs9bt.js";
@@ -23,11 +23,11 @@ import {
23
23
  init_context_key,
24
24
  init_db,
25
25
  slackContextKey
26
- } from "./cli-wa4p03nz.js";
26
+ } from "./cli-wgvn0gs7.js";
27
27
  import"./cli-hzad20bp.js";
28
28
  import"./cli-z2zcxes1.js";
29
29
  import"./cli-bw80ck94.js";
30
- import"./cli-dw20rn0d.js";
30
+ import"./cli-k9m7hetx.js";
31
31
  import"./cli-4j2mrzag.js";
32
32
  import"./cli-xz9aq0rf.js";
33
33
  import"./cli-e15jhafb.js";
@@ -3,16 +3,16 @@ import {
3
3
  initSlackApp,
4
4
  startSlackApp,
5
5
  stopSlackApp
6
- } from "./cli-dhb6rmf6.js";
6
+ } from "./cli-agwvxxvh.js";
7
7
  import"./cli-rkndnn90.js";
8
8
  import"./cli-b0p7rfnd.js";
9
9
  import"./cli-wspgs9bt.js";
10
10
  import"./cli-dh55d5fg.js";
11
- import"./cli-wa4p03nz.js";
11
+ import"./cli-wgvn0gs7.js";
12
12
  import"./cli-hzad20bp.js";
13
13
  import"./cli-z2zcxes1.js";
14
14
  import"./cli-bw80ck94.js";
15
- import"./cli-dw20rn0d.js";
15
+ import"./cli-k9m7hetx.js";
16
16
  import"./cli-4j2mrzag.js";
17
17
  import"./cli-xz9aq0rf.js";
18
18
  import"./cli-e15jhafb.js";
@@ -1,23 +1,25 @@
1
1
  import {
2
+ ackSlackMessage,
2
3
  bufferThreadMessage,
4
+ getBufferMessageCount,
3
5
  wasEventSeen
4
- } from "./cli-b696veeb.js";
6
+ } from "./cli-a36npnxa.js";
5
7
  import {
6
8
  hasOtherUserMention
7
- } from "./cli-yy56svjs.js";
9
+ } from "./cli-xvkz3rm5.js";
8
10
  import {
9
11
  resolveSlackUserId,
10
12
  rewriteSlackMentions
11
- } from "./cli-ynppb182.js";
12
- import"./cli-68jy5v0w.js";
13
+ } from "./cli-rwctnq1j.js";
14
+ import"./cli-vajhsd2e.js";
13
15
  import {
14
16
  createTaskWithSiblingAwareness
15
- } from "./cli-x883h2ky.js";
17
+ } from "./cli-t83gdcf7.js";
16
18
  import {
17
19
  ensureSlackThreadTree,
18
20
  isSlackRenderV2Enabled,
19
21
  require_dist
20
- } from "./cli-dhb6rmf6.js";
22
+ } from "./cli-agwvxxvh.js";
21
23
  import"./cli-rkndnn90.js";
22
24
  import"./cli-b0p7rfnd.js";
23
25
  import"./cli-wspgs9bt.js";
@@ -29,7 +31,7 @@ import {
29
31
  init_context_key,
30
32
  init_db,
31
33
  slackContextKey
32
- } from "./cli-wa4p03nz.js";
34
+ } from "./cli-wgvn0gs7.js";
33
35
  import {
34
36
  init_env_flag,
35
37
  init_resolver,
@@ -38,7 +40,7 @@ import {
38
40
  } from "./cli-hzad20bp.js";
39
41
  import"./cli-z2zcxes1.js";
40
42
  import"./cli-bw80ck94.js";
41
- import"./cli-dw20rn0d.js";
43
+ import"./cli-k9m7hetx.js";
42
44
  import"./cli-4j2mrzag.js";
43
45
  import"./cli-xz9aq0rf.js";
44
46
  import"./cli-e15jhafb.js";
@@ -129,6 +131,8 @@ function createAssistant() {
129
131
  if (workingAgent && workingAgent.status !== "offline") {
130
132
  if (isAdditiveSlack()) {
131
133
  bufferThreadMessage(channelId, threadTs, messageText, userId, message.ts);
134
+ const count = getBufferMessageCount(`${channelId}:${threadTs}`);
135
+ await ackSlackMessage(client, channelId, message.ts, count === 1 ? "eyes" : "heavy_plus_sign");
132
136
  await safeSetStatus("Queuing follow-up...");
133
137
  return;
134
138
  }
@@ -144,6 +148,7 @@ function createAssistant() {
144
148
  requestedByUserId,
145
149
  contextKey: slackContextKey({ channelId, threadTs })
146
150
  });
151
+ await ackSlackMessage(client, channelId, message.ts, "eyes");
147
152
  if (isSlackRenderV2Enabled())
148
153
  await ensureSlackThreadTree([task2.id]);
149
154
  await safeSetStatus("Processing follow-up...");
@@ -169,6 +174,7 @@ function createAssistant() {
169
174
  requestedByUserId,
170
175
  contextKey: slackContextKey({ channelId, threadTs })
171
176
  });
177
+ await ackSlackMessage(client, channelId, message.ts, "eyes");
172
178
  if (isSlackRenderV2Enabled()) {
173
179
  await ensureSlackThreadTree([task2.id]);
174
180
  } else {
@@ -187,6 +193,7 @@ function createAssistant() {
187
193
  requestedByUserId,
188
194
  contextKey: slackContextKey({ channelId, threadTs })
189
195
  });
196
+ await ackSlackMessage(client, channelId, message.ts, "eyes");
190
197
  if (isSlackRenderV2Enabled())
191
198
  await ensureSlackThreadTree([task.id]);
192
199
  } catch (error) {
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  embedScript,
3
3
  embeddingProvider
4
- } from "./cli-bwx9h2cj.js";
5
- import"./cli-jqqq7zhc.js";
4
+ } from "./cli-shzqkrbd.js";
5
+ import"./cli-24adhcy3.js";
6
6
  import"./cli-q25ejbyn.js";
7
7
  import {
8
8
  getDb,
9
9
  init_db
10
- } from "./cli-wa4p03nz.js";
10
+ } from "./cli-wgvn0gs7.js";
11
11
  import"./cli-hzad20bp.js";
12
12
  import"./cli-z2zcxes1.js";
13
13
  import"./cli-bw80ck94.js";
14
- import"./cli-dw20rn0d.js";
14
+ import"./cli-k9m7hetx.js";
15
15
  import"./cli-4j2mrzag.js";
16
16
  import"./cli-xz9aq0rf.js";
17
17
  import"./cli-p9swy5t3.js";
@@ -3,16 +3,16 @@ import {
3
3
  getEmbeddingProvider,
4
4
  getMemoryStore,
5
5
  init_constants
6
- } from "./cli-jqqq7zhc.js";
6
+ } from "./cli-24adhcy3.js";
7
7
  import"./cli-q25ejbyn.js";
8
8
  import {
9
9
  getDb,
10
10
  init_db
11
- } from "./cli-wa4p03nz.js";
11
+ } from "./cli-wgvn0gs7.js";
12
12
  import"./cli-hzad20bp.js";
13
13
  import"./cli-z2zcxes1.js";
14
14
  import"./cli-bw80ck94.js";
15
- import"./cli-dw20rn0d.js";
15
+ import"./cli-k9m7hetx.js";
16
16
  import"./cli-4j2mrzag.js";
17
17
  import"./cli-xz9aq0rf.js";
18
18
  import"./cli-p9swy5t3.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-wa4p03nz.js";
4
+ } from "./cli-wgvn0gs7.js";
5
5
  import"./cli-hzad20bp.js";
6
6
  import"./cli-z2zcxes1.js";
7
7
  import"./cli-bw80ck94.js";
8
- import"./cli-dw20rn0d.js";
8
+ import"./cli-k9m7hetx.js";
9
9
  import {
10
10
  init_secret_scrubber,
11
11
  scrubSecrets
@@ -11,7 +11,7 @@ import {
11
11
  markAuthorizationRefreshFailed,
12
12
  releaseOAuthRefreshLock,
13
13
  updateAuthorizationTokens
14
- } from "./cli-rdhfg33j.js";
14
+ } from "./cli-xc0x7wey.js";
15
15
  import {
16
16
  init_secret_scrubber,
17
17
  registerVolatileSecret,
@@ -6,7 +6,7 @@ import {
6
6
  getDb,
7
7
  init_db,
8
8
  isSqliteVecAvailable
9
- } from "./cli-wa4p03nz.js";
9
+ } from "./cli-wgvn0gs7.js";
10
10
  import {
11
11
  __esm,
12
12
  __export,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-wa4p03nz.js";
4
+ } from "./cli-wgvn0gs7.js";
5
5
 
6
6
  // src/be/seed-pricing.ts
7
7
  init_db();
@@ -16,7 +16,7 @@ import {
16
16
  init_db,
17
17
  init_templates1 as init_templates,
18
18
  normalizeDateRequired
19
- } from "./cli-wa4p03nz.js";
19
+ } from "./cli-wgvn0gs7.js";
20
20
  import {
21
21
  init_env_flag,
22
22
  init_resolver,
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  ensureAuthorizationTokenOrThrow,
9
9
  oauthAppRowToProviderConfig
10
- } from "./cli-sh9vv838.js";
10
+ } from "./cli-0fxf2ess.js";
11
11
  import {
12
12
  getScript,
13
13
  getScriptApiConnectionDescriptors,
@@ -15,15 +15,15 @@ import {
15
15
  getScriptVersion,
16
16
  listRelationalCredentialBindings,
17
17
  validateScriptImports
18
- } from "./cli-xg5g50w0.js";
18
+ } from "./cli-bz42mzy3.js";
19
19
  import {
20
20
  getAuthorizationById,
21
21
  getOAuthApp,
22
22
  getOAuthAppById
23
- } from "./cli-rdhfg33j.js";
23
+ } from "./cli-xc0x7wey.js";
24
24
  import {
25
25
  withSiblingAwareness
26
- } from "./cli-x883h2ky.js";
26
+ } from "./cli-t83gdcf7.js";
27
27
  import {
28
28
  getAppUrl
29
29
  } from "./cli-dh55d5fg.js";
@@ -74,7 +74,7 @@ import {
74
74
  updateWorkflowRun,
75
75
  updateWorkflowRunStep,
76
76
  workflowContextKey
77
- } from "./cli-wa4p03nz.js";
77
+ } from "./cli-wgvn0gs7.js";
78
78
  import {
79
79
  deepInterpolate,
80
80
  init_template,
@@ -201,6 +201,16 @@ function isUpstream(def, sourceId, targetId) {
201
201
  }
202
202
  return false;
203
203
  }
204
+ function containsInterpolationToken(value) {
205
+ if (typeof value === "string")
206
+ return value.includes("{{") && value.includes("}}");
207
+ if (Array.isArray(value))
208
+ return value.some(containsInterpolationToken);
209
+ if (value && typeof value === "object") {
210
+ return Object.values(value).some(containsInterpolationToken);
211
+ }
212
+ return false;
213
+ }
204
214
  function validateDefinition(def, registry) {
205
215
  const errors = [];
206
216
  const nodeIds = new Set(def.nodes.map((n) => n.id));
@@ -257,6 +267,26 @@ function validateDefinition(def, registry) {
257
267
  for (const node of def.nodes) {
258
268
  if (!registry.has(node.type)) {
259
269
  errors.push(`Node "${node.id}" uses unregistered executor type "${node.type}"`);
270
+ continue;
271
+ }
272
+ const configResult = registry.get(node.type).configSchema.safeParse(node.config);
273
+ if (!configResult.success) {
274
+ for (const issue of configResult.error.issues) {
275
+ const issuePath = issue.path.map(String);
276
+ const path = ["config", ...issuePath].join(".");
277
+ let value = node.config;
278
+ for (const segment of issue.path) {
279
+ if (value === null || typeof value !== "object") {
280
+ value = undefined;
281
+ break;
282
+ }
283
+ value = value[segment];
284
+ }
285
+ if (containsInterpolationToken(value))
286
+ continue;
287
+ const renderedValue = value === undefined ? "undefined" : JSON.stringify(value);
288
+ errors.push(`Node "${node.id}" (${node.type}) ${path} has invalid value ${renderedValue}: ${issue.message}`);
289
+ }
260
290
  }
261
291
  }
262
292
  }
@@ -2629,7 +2659,7 @@ class HumanInTheLoopExecutor extends BaseExecutor {
2629
2659
  }
2630
2660
  if (notification.channel === "slack") {
2631
2661
  try {
2632
- const { getSlackApp } = await import("./app-ny0gj6kg.js");
2662
+ const { getSlackApp } = await import("./app-08mcfqa5.js");
2633
2663
  const slackApp = getSlackApp();
2634
2664
  if (!slackApp) {
2635
2665
  console.warn("[HITL] Slack not initialized — cannot send notification");
@@ -2745,7 +2775,7 @@ class NotifyExecutor extends BaseExecutor {
2745
2775
  }
2746
2776
  }
2747
2777
  case "slack": {
2748
- const { getSlackApp } = await import("./app-ny0gj6kg.js");
2778
+ const { getSlackApp } = await import("./app-08mcfqa5.js");
2749
2779
  const app = getSlackApp();
2750
2780
  if (!app) {
2751
2781
  return {
@@ -2942,11 +2972,27 @@ class RawLlmExecutor extends BaseExecutor {
2942
2972
 
2943
2973
  // src/workflows/executors/script.ts
2944
2974
  init_zod();
2975
+
2976
+ // src/scripts-runtime/executors/types.ts
2977
+ var MIN_SCRIPT_WALL_CLOCK_MS = 1000;
2978
+ var SCRIPT_LONG_TIMEOUT_HINT_MS = 120000;
2979
+ var MAX_SCRIPT_WALL_CLOCK_MS = 300000;
2980
+ var DEFAULT_SCRIPT_RESOURCES = {
2981
+ memoryMb: 512,
2982
+ cpuTimeSec: 60,
2983
+ wallClockMs: 30000,
2984
+ maxProcs: 32,
2985
+ maxFdCount: 64,
2986
+ maxFileBytes: 64000000,
2987
+ maxStdoutBytes: 1048576
2988
+ };
2989
+
2990
+ // src/workflows/executors/script.ts
2945
2991
  var ScriptConfigSchema = exports_external.object({
2946
2992
  runtime: exports_external.enum(["bash", "ts", "python"]),
2947
2993
  script: exports_external.string(),
2948
2994
  args: exports_external.array(exports_external.string()).optional(),
2949
- timeout: exports_external.number().int().min(1000).default(30000),
2995
+ timeout: exports_external.number().int().min(1000).max(MAX_SCRIPT_WALL_CLOCK_MS).default(30000),
2950
2996
  cwd: exports_external.string().optional()
2951
2997
  });
2952
2998
  var ScriptOutputSchema = exports_external.object({
@@ -3109,17 +3155,6 @@ async function buildScriptCredentialBindings(input) {
3109
3155
  return (await buildScriptCredentialBindingsWithFailures(input)).egressSecrets;
3110
3156
  }
3111
3157
 
3112
- // src/scripts-runtime/executors/types.ts
3113
- var DEFAULT_SCRIPT_RESOURCES = {
3114
- memoryMb: 512,
3115
- cpuTimeSec: 60,
3116
- wallClockMs: 30000,
3117
- maxProcs: 32,
3118
- maxFdCount: 64,
3119
- maxFileBytes: 64000000,
3120
- maxStdoutBytes: 1048576
3121
- };
3122
-
3123
3158
  // src/scripts-runtime/loader.ts
3124
3159
  init_secret_scrubber();
3125
3160
 
@@ -3429,8 +3464,8 @@ async function runScript(input) {
3429
3464
 
3430
3465
  // src/workflows/executors/swarm-script.ts
3431
3466
  var SWARM_SCRIPT_DEFAULT_TIMEOUT_MS = DEFAULT_SCRIPT_RESOURCES.wallClockMs;
3432
- var SWARM_SCRIPT_MIN_TIMEOUT_MS = 1000;
3433
- var SWARM_SCRIPT_MAX_TIMEOUT_MS = DEFAULT_SCRIPT_RESOURCES.cpuTimeSec * 1000;
3467
+ var SWARM_SCRIPT_MIN_TIMEOUT_MS = MIN_SCRIPT_WALL_CLOCK_MS;
3468
+ var SWARM_SCRIPT_MAX_TIMEOUT_MS = MAX_SCRIPT_WALL_CLOCK_MS;
3434
3469
  var SwarmScriptConfigSchema = exports_external.object({
3435
3470
  scriptName: exports_external.string().min(1),
3436
3471
  scope: exports_external.enum(["global", "agent"]).optional(),
@@ -3817,18 +3852,19 @@ function createExecutorRegistry(deps) {
3817
3852
 
3818
3853
  // src/workflows/index.ts
3819
3854
  var _registry = null;
3820
- function getExecutorRegistry() {
3821
- if (!_registry) {
3822
- throw new Error("Workflow engine not initialized — call initWorkflows() first");
3823
- }
3824
- return _registry;
3825
- }
3826
- function initWorkflows() {
3827
- _registry = createExecutorRegistry({
3855
+ function createBuiltInExecutorRegistry() {
3856
+ return createExecutorRegistry({
3828
3857
  db: exports_db,
3829
3858
  eventBus: workflowEventBus,
3830
3859
  interpolate: (template, ctx) => interpolate(template, ctx).result
3831
3860
  });
3861
+ }
3862
+ function getExecutorRegistry() {
3863
+ _registry ??= createBuiltInExecutorRegistry();
3864
+ return _registry;
3865
+ }
3866
+ function initWorkflows() {
3867
+ _registry = getExecutorRegistry();
3832
3868
  setupWorkflowResumeListener(workflowEventBus, _registry);
3833
3869
  recoverIncompleteRuns(_registry).catch((err) => {
3834
3870
  console.error("[workflows] Failed to recover incomplete runs on startup:", err);
@@ -3838,4 +3874,4 @@ function initWorkflows() {
3838
3874
  initWaitBusSubscriptions(_registry);
3839
3875
  }
3840
3876
 
3841
- export { oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, buildScriptCredentialBindingsWithFailures, buildScriptCredentialBindings, runScript, generateEdges, findEntryNodes, getSuccessors, validateDefinition, applyDefinitionPatch, validateJsonSchema, TriggerSchemaError, startWorkflowExecution, setupWorkflowResumeListener, retryFailedRun, cancelWorkflowRun, resumeWaitState, initWaitBusSubscriptions, subscribeWaitToBus, recoverIncompleteRuns, startRetryPoller, stopRetryPoller, validateTemplateVariables, instantiateTemplate, handleWebhookTrigger, handleScheduleTrigger, verifyHmacSignature, WebhookError, snapshotWorkflow, startWaitPoller, stopWaitPoller, RawLlmConfigSchema, executeRawLlm, getExecutorRegistry, initWorkflows };
3877
+ export { MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, buildScriptCredentialBindingsWithFailures, buildScriptCredentialBindings, runScript, generateEdges, findEntryNodes, getSuccessors, validateDefinition, applyDefinitionPatch, validateJsonSchema, TriggerSchemaError, startWorkflowExecution, setupWorkflowResumeListener, retryFailedRun, cancelWorkflowRun, resumeWaitState, initWaitBusSubscriptions, subscribeWaitToBus, recoverIncompleteRuns, startRetryPoller, stopRetryPoller, validateTemplateVariables, instantiateTemplate, handleWebhookTrigger, handleScheduleTrigger, verifyHmacSignature, WebhookError, snapshotWorkflow, startWaitPoller, stopWaitPoller, RawLlmConfigSchema, executeRawLlm, getExecutorRegistry, initWorkflows };
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  createAdditiveBuffer,
3
3
  extractSlackMessageText
4
- } from "./cli-yy56svjs.js";
4
+ } from "./cli-xvkz3rm5.js";
5
5
  import {
6
6
  rewriteSlackMentions
7
- } from "./cli-ynppb182.js";
7
+ } from "./cli-rwctnq1j.js";
8
8
  import {
9
9
  createTaskWithSiblingAwareness
10
- } from "./cli-x883h2ky.js";
10
+ } from "./cli-t83gdcf7.js";
11
11
  import {
12
12
  buildBufferFlushBlocks,
13
13
  ensureSlackThreadTree,
14
14
  getSlackApp,
15
15
  isSlackRenderV2Enabled,
16
16
  registerTreeMessage
17
- } from "./cli-dhb6rmf6.js";
17
+ } from "./cli-agwvxxvh.js";
18
18
  import {
19
19
  getLatestActiveTaskInThread,
20
20
  getLatestLeadTaskInThread,
@@ -25,7 +25,7 @@ import {
25
25
  init_steering,
26
26
  requestSteering,
27
27
  slackContextKey
28
- } from "./cli-wa4p03nz.js";
28
+ } from "./cli-wgvn0gs7.js";
29
29
  import {
30
30
  init_registry,
31
31
  init_steering_enabled,
@@ -33,6 +33,25 @@ import {
33
33
  registerTemplate
34
34
  } from "./cli-hzad20bp.js";
35
35
 
36
+ // src/slack/ack.ts
37
+ function slackErrorCode(error) {
38
+ if (!error || typeof error !== "object")
39
+ return;
40
+ const data = "data" in error ? error.data : undefined;
41
+ if (!data || typeof data !== "object" || !("error" in data))
42
+ return;
43
+ return typeof data.error === "string" ? data.error : undefined;
44
+ }
45
+ async function ackSlackMessage(client, channel, timestamp, name) {
46
+ try {
47
+ await client.reactions.add({ channel, name, timestamp });
48
+ } catch (error) {
49
+ if (slackErrorCode(error) === "already_reacted")
50
+ return;
51
+ console.log(`[Slack] ${name} acknowledgement reaction failed: ${error instanceof Error ? error.message : error}`);
52
+ }
53
+ }
54
+
36
55
  // src/slack/event-dedup.ts
37
56
  var DEFAULT_TTL_MS = 300000;
38
57
  var CLEANUP_INTERVAL_MS = 60000;
@@ -254,16 +273,6 @@ ${combinedText}`;
254
273
  console.log(`[Slack] Buffer flushed → steering ${steering.result.outcome} for task ${steering.task.id}`);
255
274
  const app2 = getSlackApp();
256
275
  if (app2) {
257
- const lastItem = items.at(-1);
258
- try {
259
- await app2.client.reactions.add({
260
- channel: channelId,
261
- name: "eyes",
262
- timestamp: lastItem.ts
263
- });
264
- } catch (error) {
265
- console.log(`[Slack] Steering reaction failed: ${error instanceof Error ? error.message : error}`);
266
- }
267
276
  if (!isSlackRenderV2Enabled()) {
268
277
  try {
269
278
  await app2.client.chat.postMessage({
@@ -333,4 +342,4 @@ ${description}` : description;
333
342
  }
334
343
  }
335
344
 
336
- export { wasEventSeen, requestSlackThreadSteering, formatSlackSteeringAck, bufferThreadMessage, getBufferMessageCount, instantFlush };
345
+ export { ackSlackMessage, wasEventSeen, requestSlackThreadSteering, formatSlackSteeringAck, bufferThreadMessage, getBufferMessageCount, instantFlush };
@@ -37,7 +37,7 @@ import {
37
37
  setSlackMessageTracking,
38
38
  slackContextKey,
39
39
  updateSlackMessageRecord
40
- } from "./cli-wa4p03nz.js";
40
+ } from "./cli-wgvn0gs7.js";
41
41
  import {
42
42
  init_env_flag,
43
43
  isEnvFlagEnabled
@@ -55405,13 +55405,13 @@ async function initSlackApp() {
55405
55405
  socketMode: true,
55406
55406
  logLevel: import_bolt.LogLevel.DEBUG
55407
55407
  });
55408
- const { registerMessageHandler } = await import("./handlers-jtp4gkw3.js");
55409
- const { registerCommandHandler } = await import("./commands-jasxqcmp.js");
55410
- const { registerActionHandlers } = await import("./actions-644n22m6.js");
55408
+ const { registerMessageHandler } = await import("./handlers-d25x44k0.js");
55409
+ const { registerCommandHandler } = await import("./commands-pfy10d4q.js");
55410
+ const { registerActionHandlers } = await import("./actions-3tjz0jkn.js");
55411
55411
  registerMessageHandler(app);
55412
55412
  registerCommandHandler(app);
55413
55413
  registerActionHandlers(app);
55414
- const { createAssistant } = await import("./assistant-gj8b3c00.js");
55414
+ const { createAssistant } = await import("./assistant-j90fr0jm.js");
55415
55415
  app.assistant(createAssistant());
55416
55416
  return app;
55417
55417
  }
@@ -55420,7 +55420,7 @@ async function startSlackApp() {
55420
55420
  await initSlackApp();
55421
55421
  }
55422
55422
  if (app) {
55423
- const { isSlackRenderV2Enabled: isSlackRenderV2Enabled2 } = await import("./render-v2-hy2jyz5n.js");
55423
+ const { isSlackRenderV2Enabled: isSlackRenderV2Enabled2 } = await import("./render-v2-bhez9szv.js");
55424
55424
  if (isSlackRenderV2Enabled2())
55425
55425
  ensureSlackRenderV2Activation();
55426
55426
  await app.start();
@@ -7,11 +7,11 @@ import {
7
7
  getPinCandidateAgent,
8
8
  getResumeGeneration,
9
9
  repointTrackerSyncBySwarmId
10
- } from "./cli-4gfwmxa8.js";
10
+ } from "./cli-852zctpg.js";
11
11
  import {
12
12
  getExecutorRegistry,
13
13
  recoverIncompleteRuns
14
- } from "./cli-n09s3zaf.js";
14
+ } from "./cli-86jbqh6f.js";
15
15
  import {
16
16
  MAX_EMPTY_POLLS,
17
17
  assignUnassignedTaskPending,
@@ -51,7 +51,7 @@ import {
51
51
  releaseStaleReviewingTasks,
52
52
  supersedeTask,
53
53
  updateAgentStatus
54
- } from "./cli-wa4p03nz.js";
54
+ } from "./cli-wgvn0gs7.js";
55
55
  import {
56
56
  init_registry,
57
57
  init_resolver,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./cli-jkhwmmgg.js";
4
4
  import {
5
5
  embedScript
6
- } from "./cli-bwx9h2cj.js";
6
+ } from "./cli-shzqkrbd.js";
7
7
  import {
8
8
  calculatePKCECodeChallenge,
9
9
  generateRandomCodeVerifier,
@@ -12,7 +12,7 @@ import {
12
12
  getOAuthAppById,
13
13
  updateAuthorizationTokens,
14
14
  upsertAuthorization
15
- } from "./cli-rdhfg33j.js";
15
+ } from "./cli-xc0x7wey.js";
16
16
  import {
17
17
  computeContentHash,
18
18
  decryptSecret,
@@ -28,7 +28,7 @@ import {
28
28
  normalizeDateRequired,
29
29
  placeholderForConfigKey,
30
30
  upsertSwarmConfig
31
- } from "./cli-wa4p03nz.js";
31
+ } from "./cli-wgvn0gs7.js";
32
32
  import {
33
33
  init_env_flag,
34
34
  isEnvFlagEnabled
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  init_package,
3
3
  package_default
4
- } from "./cli-dw20rn0d.js";
4
+ } from "./cli-k9m7hetx.js";
5
5
 
6
6
  // src/commands/shared/client-config.ts
7
7
  init_package();
@@ -22,7 +22,7 @@ import {
22
22
  withSpan,
23
23
  withSpanContext,
24
24
  writeSkillsToFilesystem
25
- } from "./cli-6b41m0f8.js";
25
+ } from "./cli-thsqy2j0.js";
26
26
  import {
27
27
  authJsonToCredentialSelection,
28
28
  credentialsToAuthJson,
@@ -44,10 +44,10 @@ import {
44
44
  import {
45
45
  ensure,
46
46
  initialize
47
- } from "./cli-bepzsbrb.js";
47
+ } from "./cli-t2msesap.js";
48
48
  import {
49
49
  validateJsonSchema
50
- } from "./cli-n09s3zaf.js";
50
+ } from "./cli-86jbqh6f.js";
51
51
  import {
52
52
  getOpenRouterBaseUrl
53
53
  } from "./cli-3dpj7atn.js";
@@ -80,7 +80,7 @@ import {
80
80
  init_types,
81
81
  resolveTaskModelSelection,
82
82
  telemetry
83
- } from "./cli-wa4p03nz.js";
83
+ } from "./cli-wgvn0gs7.js";
84
84
  import {
85
85
  configureHttpResolver,
86
86
  init_resolver,
@@ -2298,6 +2298,9 @@ ${failureDiagnostics}`;
2298
2298
  } else {
2299
2299
  console.log(`[${role}] Runner marked task ${taskId.slice(0, 8)} as ${status} (exit code: ${exitCode})`);
2300
2300
  }
2301
+ } else if (response.status === 409) {
2302
+ const error = await response.text();
2303
+ console.warn(`[${role}] Runner result for task ${taskId.slice(0, 8)} was discarded because the task is already terminal; continuing: ${error}`);
2301
2304
  } else if (response.status === 404) {
2302
2305
  console.log(`[${role}] Task ${taskId.slice(0, 8)} already finalized (not found), skipping`);
2303
2306
  } else {