@desplega.ai/agent-swarm 1.130.0 → 1.131.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 (122) hide show
  1. package/README.md +1 -1
  2. package/dist/{actions-73ee723n.js → actions-w53mbns9.js} +7 -7
  3. package/dist/{anthropic-messages-3xgme8my.js → anthropic-messages-rjmd2e7n.js} +5 -5
  4. package/dist/{app-hz5c2xay.js → app-m9gwqsqv.js} +4 -4
  5. package/dist/{assistant-08mr16yp.js → assistant-bp65m6f3.js} +9 -9
  6. package/dist/{azure-openai-responses-xa4sh9f6.js → azure-openai-responses-c0yjmbfd.js} +8 -5
  7. package/dist/{boot-reembed-5bgan3cd.js → boot-reembed-62p0at2k.js} +4 -4
  8. package/dist/{boot-reembed-z7ykyeq8.js → boot-reembed-xmfp6wdh.js} +5 -5
  9. package/dist/{boot-scrub-logs-b2rjk8mv.js → boot-scrub-logs-rr8q2dms.js} +3 -3
  10. package/dist/{claude-adapter-qr0k17km.js → claude-adapter-2y47mrkd.js} +6 -6
  11. package/dist/{cli-s21zzx4b.js → cli-0rcyq6d9.js} +447 -183
  12. package/dist/{cli-brebbsen.js → cli-2q72qz2s.js} +9 -6
  13. package/dist/{cli-e5p3es48.js → cli-3kf51j15.js} +1 -1
  14. package/dist/{cli-vgexpfsr.js → cli-57khth04.js} +6 -3
  15. package/dist/{cli-h3e66g5b.js → cli-5kx36evn.js} +1 -1
  16. package/dist/{cli-n9yxcnvk.js → cli-5n6e5yfn.js} +29 -7
  17. package/dist/{cli-tp519bjz.js → cli-5v4rw6yd.js} +2 -2
  18. package/dist/{cli-dakxgk70.js → cli-5ze9rv97.js} +4 -4
  19. package/dist/{cli-ch7t5v7n.js → cli-6map995v.js} +9 -4
  20. package/dist/{cli-mgerp0vs.js → cli-70xqj0z3.js} +2 -2
  21. package/dist/{cli-7v5dhmc8.js → cli-72q8m8gk.js} +6 -6
  22. package/dist/{cli-yj7z99vp.js → cli-78xwvkhj.js} +2 -2
  23. package/dist/{cli-t5tsq67k.js → cli-9dr5qzc0.js} +39 -4
  24. package/dist/{cli-73bvdyxr.js → cli-a40rnf71.js} +6 -6
  25. package/dist/{cli-s18zzkfp.js → cli-a4jzdpa3.js} +44 -7
  26. package/dist/{cli-w10fkrf1.js → cli-akdvwc9v.js} +354 -115
  27. package/dist/{cli-hntzdchd.js → cli-bqw0mt1n.js} +1 -1
  28. package/dist/{cli-mhr8tq3v.js → cli-cdeg08wx.js} +1 -1
  29. package/dist/{cli-qcsjdppx.js → cli-cvgjwnh1.js} +7 -7
  30. package/dist/{cli-z9q7pb38.js → cli-d2tfkcga.js} +4 -4
  31. package/dist/{cli-r62me33w.js → cli-d3x3x1c9.js} +2 -2
  32. package/dist/{cli-6nh2qxvh.js → cli-darcwax3.js} +1 -1
  33. package/dist/{cli-326083vb.js → cli-e7ckcg4v.js} +12 -12
  34. package/dist/{cli-fs153s3x.js → cli-efxfnq6q.js} +3 -3
  35. package/dist/{cli-xg2eezyv.js → cli-f1am9szv.js} +1 -1
  36. package/dist/{cli-2pa5w9b6.js → cli-fywms69x.js} +1 -1
  37. package/dist/{cli-1mj7yz1r.js → cli-g6b8x1h8.js} +1 -1
  38. package/dist/{cli-epsvdckx.js → cli-gm9cbhbq.js} +20 -10
  39. package/dist/{cli-tfw3c0y1.js → cli-nm5gtp1x.js} +2 -2
  40. package/dist/{cli-q8zwffx0.js → cli-pm6xbh84.js} +128 -35
  41. package/dist/{cli-m8fs5ttq.js → cli-psh3c4va.js} +1 -1
  42. package/dist/{cli-1px8pn1s.js → cli-qv61hp37.js} +2 -2
  43. package/dist/{cli-mf009e0j.js → cli-rzbpmxdr.js} +1 -1
  44. package/dist/{cli-vr2f46zj.js → cli-t1xze5qh.js} +1 -1
  45. package/dist/{cli-qbb2ten8.js → cli-t55yw3a1.js} +2 -2
  46. package/dist/{cli-haanc4qd.js → cli-t76vw5db.js} +22 -22
  47. package/dist/{cli-4n4mdv21.js → cli-xpxde7rm.js} +7 -3
  48. package/dist/{cli-xdrmxvd4.js → cli-yw8vghx2.js} +46 -10
  49. package/dist/cli.js +22 -22
  50. package/dist/{codex-adapter-6pc50x9q.js → codex-adapter-d24q75wk.js} +4 -4
  51. package/dist/{codex-hook-amndawyb.js → codex-hook-hq54t9ft.js} +2 -2
  52. package/dist/{codex-session-runner-tpg8hyj7.js → codex-session-runner-g50vcsex.js} +4 -4
  53. package/dist/{commands-yfpwt11g.js → commands-c3nrc5hg.js} +3 -3
  54. package/dist/{db-jn499nmp.js → db-nt7fg3tw.js} +3 -3
  55. package/dist/{google-generative-ai-txgg2q58.js → google-generative-ai-hysrd8qx.js} +7 -5
  56. package/dist/{google-vertex-t663s1c3.js → google-vertex-p5arrga0.js} +7 -5
  57. package/dist/{handlers-eev4nng0.js → handlers-fkr6swat.js} +9 -9
  58. package/dist/{hook-sn7pj75w.js → hook-77wpvnjc.js} +4 -4
  59. package/dist/{hook-9fkwkf3m.js → hook-g019yehy.js} +5 -5
  60. package/dist/{http-xdbbtmhx.js → http-jewj0syk.js} +202 -79
  61. package/dist/{index-c0qedjh6.js → index-6gm5he8h.js} +9 -9
  62. package/dist/{index-5fdsemf0.js → index-7n2xpbd4.js} +155 -37
  63. package/dist/{index-9vnkprkh.js → index-hfvggd0z.js} +10 -10
  64. package/dist/{index-fnack5vh.js → index-hp1kdbjj.js} +11 -11
  65. package/dist/{keepalive-fc7a2hw9.js → keepalive-j0fjvqfd.js} +5 -5
  66. package/dist/{lead-1fva34y9.js → lead-1n8x30xe.js} +28 -28
  67. package/dist/{maintenance-0rdb12vf.js → maintenance-gvev11sa.js} +5 -5
  68. package/dist/{mistral-conversations-4swenhmf.js → mistral-conversations-81fwav0j.js} +2 -2
  69. package/dist/{oauth-refresh-sweep-f9rptqbt.js → oauth-refresh-sweep-s9ecsvh0.js} +4 -4
  70. package/dist/{onboard-9zn0fx2m.js → onboard-pvm5b38w.js} +2 -2
  71. package/dist/{openai-codex-responses-xetseqvt.js → openai-codex-responses-5g27pd6f.js} +43 -23
  72. package/dist/{openai-completions-5r2g5axa.js → openai-completions-3vkmfz2a.js} +55 -11
  73. package/dist/{openai-responses-ce67hd23.js → openai-responses-dg4t7j7a.js} +8 -5
  74. package/dist/{openrouter-images-pzfp22jb.js → openrouter-images-g3gm8931.js} +1 -1
  75. package/dist/{otel-impl-thnttmbn.js → otel-impl-p6jvgd9c.js} +1 -1
  76. package/dist/{pi-mono-adapter-bpfrn6d7.js → pi-mono-adapter-t091s27g.js} +17114 -7514
  77. package/dist/{pricing-refresh-n0ve0kh6.js → pricing-refresh-k49rcyed.js} +5 -5
  78. package/dist/{rbac-roles-bbwb4wrm.js → rbac-roles-30pspvy7.js} +5 -5
  79. package/dist/{rbac-roles-w45bhahg.js → rbac-roles-cr80g96t.js} +4 -4
  80. package/dist/{render-v2-d675cp9r.js → render-v2-xm457ng1.js} +4 -4
  81. package/dist/{seed-pricing-47q77nw4.js → seed-pricing-yhpv35fr.js} +4 -4
  82. package/dist/{setup-3vnv2m43.js → setup-nytnmwwr.js} +2 -2
  83. package/dist/{worker-7shsr8hk.js → worker-msytr2cw.js} +28 -28
  84. package/openapi.json +342 -10
  85. package/package.json +6 -6
  86. package/src/apps/store.ts +13 -4
  87. package/src/assets/key.ts +8 -1
  88. package/src/be/asset-key-audit.ts +3 -1
  89. package/src/be/db-queries/mcp-oauth.ts +26 -0
  90. package/src/be/db.ts +42 -1
  91. package/src/be/migrations/129_asset_keys_apps_scripts.sql +161 -0
  92. package/src/be/scripts/db.ts +5 -2
  93. package/src/be/seed-skills/index.ts +7 -0
  94. package/src/http/assets.ts +120 -29
  95. package/src/http/mcp-oauth.ts +69 -1
  96. package/src/http/users.ts +45 -0
  97. package/src/oauth/ensure-mcp-token.ts +7 -1
  98. package/src/oauth/mcp-wrapper.ts +247 -24
  99. package/src/providers/pi-mono-adapter.ts +1 -1
  100. package/src/tests/asset-key-api.test.ts +48 -2
  101. package/src/tests/asset-key-invariants.test.ts +92 -0
  102. package/src/tests/asset-key-migration.test.ts +174 -8
  103. package/src/tests/asset-key-normalization.test.ts +2 -0
  104. package/src/tests/mcp-oauth-dcr-reuse.test.ts +95 -0
  105. package/src/tests/mcp-oauth-ensure-token.test.ts +23 -0
  106. package/src/tests/mcp-oauth-manual-client.test.ts +135 -2
  107. package/src/tests/mcp-oauth-wrapper.test.ts +380 -0
  108. package/src/tests/rbac-admission-e2e.test.ts +68 -0
  109. package/src/tests/script-connections.test.ts +3 -0
  110. package/src/tests/whoami-route.test.ts +127 -0
  111. package/src/tests/workflow-engine-v2.test.ts +80 -7
  112. package/src/tests/workflow-swarm-script.test.ts +104 -0
  113. package/src/tools/workflows/create-workflow.ts +4 -1
  114. package/src/types.ts +18 -5
  115. package/src/utils/template.ts +8 -1
  116. package/src/workflows/engine.ts +27 -4
  117. package/src/workflows/executors/swarm-script.ts +28 -0
  118. package/src/workflows/retry-poller.ts +19 -2
  119. package/templates/skills/asset-namespaces/content.md +2 -2
  120. package/templates/skills/scheduled-task-resilience/SKILL.md +102 -0
  121. package/templates/skills/scheduled-task-resilience/config.json +14 -0
  122. package/templates/skills/scheduled-task-resilience/content.md +97 -0
@@ -4,7 +4,7 @@ import {
4
4
  incrKv,
5
5
  init_db,
6
6
  upsertKv
7
- } from "./cli-s18zzkfp.js";
7
+ } from "./cli-a4jzdpa3.js";
8
8
 
9
9
  // src/be/users.ts
10
10
  init_db();
@@ -4,11 +4,11 @@ import {
4
4
  getEmbeddingProvider,
5
5
  init_embedding,
6
6
  serializeEmbedding
7
- } from "./cli-mf009e0j.js";
7
+ } from "./cli-rzbpmxdr.js";
8
8
  import {
9
9
  getDb,
10
10
  init_db
11
- } from "./cli-s18zzkfp.js";
11
+ } from "./cli-a4jzdpa3.js";
12
12
  import {
13
13
  init_secret_scrubber,
14
14
  scrubSecrets
@@ -6,7 +6,7 @@ import {
6
6
  getDb,
7
7
  init_db,
8
8
  isSqliteVecAvailable
9
- } from "./cli-s18zzkfp.js";
9
+ } from "./cli-a4jzdpa3.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-s18zzkfp.js";
4
+ } from "./cli-a4jzdpa3.js";
5
5
 
6
6
  // src/be/seed-pricing.ts
7
7
  init_db();
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  buildModelsDevSeedRows,
3
3
  loadModelsDevCache
4
- } from "./cli-vr2f46zj.js";
4
+ } from "./cli-t1xze5qh.js";
5
5
  import {
6
6
  createLogEntry,
7
7
  getActivePricingRow,
8
8
  getDb,
9
9
  init_db,
10
10
  insertPricingRow
11
- } from "./cli-s18zzkfp.js";
11
+ } from "./cli-a4jzdpa3.js";
12
12
  import {
13
13
  init_secret_scrubber,
14
14
  scrubSecrets
@@ -22,28 +22,28 @@ import {
22
22
  repointTrackerSyncBySwarmId,
23
23
  updateTrackerSync,
24
24
  updateTrackerSyncSwarmId
25
- } from "./cli-tfw3c0y1.js";
25
+ } from "./cli-nm5gtp1x.js";
26
26
  import {
27
27
  calculateNextRun,
28
28
  ensure,
29
29
  require_dist,
30
30
  runScheduleNow
31
- } from "./cli-dakxgk70.js";
31
+ } from "./cli-5ze9rv97.js";
32
32
  import {
33
33
  startPricingRefreshLoop
34
- } from "./cli-qbb2ten8.js";
34
+ } from "./cli-t55yw3a1.js";
35
35
  import {
36
36
  seedPricingFromModelsDev
37
- } from "./cli-vr2f46zj.js";
37
+ } from "./cli-t1xze5qh.js";
38
38
  import {
39
39
  ensureRbacSeedsSynced,
40
40
  getUserGrant
41
- } from "./cli-tp519bjz.js";
41
+ } from "./cli-5v4rw6yd.js";
42
42
  import {
43
43
  can,
44
44
  decideAdmission,
45
45
  isRbacEnabled
46
- } from "./cli-hntzdchd.js";
46
+ } from "./cli-bqw0mt1n.js";
47
47
  import {
48
48
  AppDefinitionSchema,
49
49
  AppElementsSchema,
@@ -65,7 +65,7 @@ import {
65
65
  runSavedScriptAsAgent,
66
66
  updateApp,
67
67
  upgradeAppDefinition
68
- } from "./cli-brebbsen.js";
68
+ } from "./cli-2q72qz2s.js";
69
69
  import {
70
70
  TriggerSchemaError,
71
71
  applyDefinitionPatch,
@@ -78,7 +78,7 @@ import {
78
78
  startWorkflowExecution,
79
79
  validateDefinition,
80
80
  validateJsonSchema
81
- } from "./cli-xdrmxvd4.js";
81
+ } from "./cli-yw8vghx2.js";
82
82
  import {
83
83
  ConnectionAuthInputSchema,
84
84
  SCRIPT_LONG_TIMEOUT_HINT_MS,
@@ -97,7 +97,7 @@ import {
97
97
  setScriptConnectionEnabled,
98
98
  upsertCredentialBinding,
99
99
  upsertScriptConnection
100
- } from "./cli-q8zwffx0.js";
100
+ } from "./cli-pm6xbh84.js";
101
101
  import {
102
102
  getApiKey
103
103
  } from "./cli-f14fvzag.js";
@@ -112,7 +112,7 @@ import {
112
112
  isGraphExpansionEnabled,
113
113
  rerank,
114
114
  rowToCandidate
115
- } from "./cli-mf009e0j.js";
115
+ } from "./cli-rzbpmxdr.js";
116
116
  import {
117
117
  buildAuthorizationUrl,
118
118
  createOAuthApp,
@@ -127,7 +127,7 @@ import {
127
127
  listAuthorizationsForApp,
128
128
  onAuthorizationRefreshed,
129
129
  upsertOAuthApp
130
- } from "./cli-1mj7yz1r.js";
130
+ } from "./cli-g6b8x1h8.js";
131
131
  import {
132
132
  ZodFirstPartyTypeKind,
133
133
  objectType
@@ -136,7 +136,7 @@ import {
136
136
  createAdditiveBuffer,
137
137
  extractSlackMessageText,
138
138
  parseSlackTs
139
- } from "./cli-r62me33w.js";
139
+ } from "./cli-d3x3x1c9.js";
140
140
  import {
141
141
  findOrCreateUserByEmail,
142
142
  findUserByExternalId,
@@ -152,10 +152,10 @@ import {
152
152
  resolveIdentityByEmail,
153
153
  resolveUserByToken,
154
154
  unlinkIdentity
155
- } from "./cli-m8fs5ttq.js";
155
+ } from "./cli-psh3c4va.js";
156
156
  import {
157
157
  createTaskWithSiblingAwareness
158
- } from "./cli-mhr8tq3v.js";
158
+ } from "./cli-cdeg08wx.js";
159
159
  import {
160
160
  getAgentDisplayName,
161
161
  getAgentEmoji,
@@ -164,7 +164,7 @@ import {
164
164
  markdownToSlack,
165
165
  startSlackApp,
166
166
  stopSlackApp
167
- } from "./cli-qcsjdppx.js";
167
+ } from "./cli-cvgjwnh1.js";
168
168
  import {
169
169
  $OpenAPIRegistry,
170
170
  $OpenApiGeneratorV31,
@@ -410,7 +410,7 @@ import {
410
410
  upsertService,
411
411
  upsertSwarmConfig,
412
412
  validateConfigValue
413
- } from "./cli-s18zzkfp.js";
413
+ } from "./cli-a4jzdpa3.js";
414
414
  import {
415
415
  getTemplateDefinition,
416
416
  init_env_flag,
@@ -422,7 +422,7 @@ import {
422
422
  parseEnvFlag,
423
423
  registerTemplate,
424
424
  resolveTemplate
425
- } from "./cli-4n4mdv21.js";
425
+ } from "./cli-xpxde7rm.js";
426
426
  import {
427
427
  MAX_PROFILE_FILE_LENGTH,
428
428
  getAppUrl,
@@ -444,7 +444,7 @@ import {
444
444
  import {
445
445
  init_package,
446
446
  package_default
447
- } from "./cli-7v5dhmc8.js";
447
+ } from "./cli-72q8m8gk.js";
448
448
  import {
449
449
  $ZodObject,
450
450
  $ZodType,
@@ -22901,7 +22901,7 @@ async function notifySlack(text) {
22901
22901
  return;
22902
22902
  }
22903
22903
  try {
22904
- const { getSlackApp: getSlackApp2 } = await import("./app-hz5c2xay.js");
22904
+ const { getSlackApp: getSlackApp2 } = await import("./app-m9gwqsqv.js");
22905
22905
  const app = getSlackApp2();
22906
22906
  if (!app) {
22907
22907
  console.warn("[Jira webhook keepalive] Slack not available, cannot send notification");
@@ -22972,7 +22972,7 @@ async function deleteJiraWebhook(webhookId) {
22972
22972
  console.log(`[Jira webhook keepalive] Deleted webhook id=${webhookId}`);
22973
22973
  }
22974
22974
  async function overwriteWebhookIds(next) {
22975
- const { getDb: getDb2 } = await import("./db-jn499nmp.js");
22975
+ const { getDb: getDb2 } = await import("./db-nt7fg3tw.js");
22976
22976
  const db = getDb2();
22977
22977
  const txn = db.transaction(() => {
22978
22978
  const row = db.query("SELECT metadata FROM oauth_apps WHERE provider = 'jira'").get();
@@ -96516,7 +96516,7 @@ async function initOtel(serviceRole = process.env.AGENT_ROLE || "api") {
96516
96516
  return;
96517
96517
  initialized6 = true;
96518
96518
  try {
96519
- const impl = await import("./otel-impl-thnttmbn.js");
96519
+ const impl = await import("./otel-impl-p6jvgd9c.js");
96520
96520
  await impl.boot(serviceRole);
96521
96521
  realWithSpan = impl.withSpan;
96522
96522
  realStartSpan = impl.startSpan;
@@ -113231,7 +113231,7 @@ var registerCreateWorkflowTool = (server) => {
113231
113231
  annotations: { destructiveHint: false },
113232
113232
  description: `Create a new automation workflow. Key concepts:
113233
113233
  ` + `- Nodes are linked via 'next' (string or port-based record).
113234
- ` + "- CROSS-NODE DATA: To use output from an upstream node, you MUST declare an 'inputs' mapping on the downstream node. " + 'Example: inputs: { "cityData": "generate-city" } → then use {{cityData.taskOutput.field}} in config templates. ' + `Without 'inputs', only 'trigger' and workflow-level 'input' are available for interpolation.
113234
+ ` + "- CROSS-NODE DATA: To use output from an upstream node, you MUST declare an 'inputs' mapping on the downstream node. " + 'Example: inputs: { "cityData": "generate-city" } → then use {{cityData.taskOutput.field}} in config templates. ' + "Without 'inputs', built-in trigger/input/workflow/swarm/run context remains available, but upstream outputs do not. " + "Agent-task templates may interpolate trigger and declared upstream aliases. SECURITY: executable source for script/swarm-script nodes does not: " + "inline script source allows only input/workflow/swarm/run values, while named swarm-script source is not workflow-interpolated. " + `Pass dynamic trigger or upstream values through config.args (argv for inline scripts; the args object for swarm-script).
113235
113235
  ` + "- STRUCTURED OUTPUT: For agent-task nodes, put outputSchema inside 'config' to validate the agent's raw JSON output. " + `Node-level outputSchema validates the executor's return ({taskId, taskOutput}), which is different.
113236
113236
  ` + `- Agent-task config: { template, outputSchema?, agentId?, tags?, priority?, dir?, vcsRepo?, model? }.
113237
113237
  ` + "- FOREACH NODE: type 'foreach' fans out one agent-task per item. Config: " + "{ over: <array or exact {{input}} token>, itemKey: <property name>, body: { type: 'agent-task', config: {...} } }. " + "The body config is interpolated once per item with {{item.*}} and {{index}}. Child steps use synthetic IDs " + "'<foreachNodeId>#<itemKey>'; the parent waits for every child and exposes one aggregate result to successors. " + `concurrency is not supported in v1; use definition-level onNodeFailure: 'continue' to aggregate failed children.
@@ -3,9 +3,12 @@ import {
3
3
  } from "./cli-p9swy5t3.js";
4
4
 
5
5
  // src/utils/template.ts
6
+ function findInterpolationTokens(template) {
7
+ return Array.from(template.matchAll(INTERPOLATION_TOKEN_RE), (match) => match[1].trim());
8
+ }
6
9
  function interpolate(template, ctx) {
7
10
  const unresolved = [];
8
- const result = template.replace(/\{\{([^}]+)\}\}/g, (_match, path) => {
11
+ const result = template.replace(INTERPOLATION_TOKEN_RE, (_match, path) => {
9
12
  const keys = path.trim().split(".");
10
13
  let value = ctx;
11
14
  for (const key of keys) {
@@ -73,8 +76,9 @@ function deepInterpolate(value, ctx, options = {}) {
73
76
  }
74
77
  return { value: walk(value), unresolved: allUnresolved };
75
78
  }
76
- var EXACT_TOKEN_RE;
79
+ var INTERPOLATION_TOKEN_RE, EXACT_TOKEN_RE;
77
80
  var init_template = __esm(() => {
81
+ INTERPOLATION_TOKEN_RE = /\{\{([^}]+)\}\}/g;
78
82
  EXACT_TOKEN_RE = /^\{\{([^}]+)\}\}$/;
79
83
  });
80
84
 
@@ -1146,4 +1150,4 @@ Your output is captured automatically — focus on doing the work and communicat
1146
1150
  });
1147
1151
  });
1148
1152
 
1149
- export { interpolate, deepInterpolate, init_template, registerTemplate, getTemplateDefinition, getAllTemplateDefinitions, init_registry, configureDbResolver, configureHttpResolver, resolveTemplate, resolveTemplateAsync, init_resolver, parseEnvFlag, isEnvFlagEnabled, init_env_flag, init_session_templates, isSteeringEnabled, init_steering_enabled };
1153
+ export { findInterpolationTokens, interpolate, deepInterpolate, init_template, registerTemplate, getTemplateDefinition, getAllTemplateDefinitions, init_registry, configureDbResolver, configureHttpResolver, resolveTemplate, resolveTemplateAsync, init_resolver, parseEnvFlag, isEnvFlagEnabled, init_env_flag, init_session_templates, isSteeringEnabled, init_steering_enabled };
@@ -16,10 +16,10 @@ import {
16
16
  runScript,
17
17
  sandboxSpawnEnv,
18
18
  snapshotCapped
19
- } from "./cli-q8zwffx0.js";
19
+ } from "./cli-pm6xbh84.js";
20
20
  import {
21
21
  withSiblingAwareness
22
- } from "./cli-mhr8tq3v.js";
22
+ } from "./cli-cdeg08wx.js";
23
23
  import {
24
24
  FollowUpConfigSchema,
25
25
  ModelTierSchema,
@@ -64,12 +64,13 @@ import {
64
64
  updateWorkflowRun,
65
65
  updateWorkflowRunStep,
66
66
  workflowContextKey
67
- } from "./cli-s18zzkfp.js";
67
+ } from "./cli-a4jzdpa3.js";
68
68
  import {
69
69
  deepInterpolate,
70
+ findInterpolationTokens,
70
71
  init_template,
71
72
  interpolate
72
- } from "./cli-4n4mdv21.js";
73
+ } from "./cli-xpxde7rm.js";
73
74
  import {
74
75
  getAppUrl,
75
76
  init_constants
@@ -1079,9 +1080,18 @@ async function executeStep(def, runId, ctx, node, registry, workflowId, secretKe
1079
1080
  throw new Error(errorMsg);
1080
1081
  }
1081
1082
  }
1082
- const { value: interpolatedValue, unresolved } = interpolateNodeConfig(node, interpolationCtx);
1083
+ const {
1084
+ value: interpolatedValue,
1085
+ unresolved,
1086
+ scriptBodyUnresolved
1087
+ } = interpolateNodeConfig(node, interpolationCtx);
1083
1088
  const interpolatedConfig = interpolatedValue;
1084
1089
  const executionCtx = { ...ctx, ...interpolationCtx };
1090
+ if (scriptBodyUnresolved && scriptBodyUnresolved.length > 0) {
1091
+ const errorMsg = scriptBodyInterpolationError(node.id, scriptBodyUnresolved);
1092
+ checkpointStepFailure(runId, stepId, errorMsg, 0);
1093
+ return { outcome: "failed", successors: [] };
1094
+ }
1085
1095
  if (unresolved.length > 0) {
1086
1096
  console.warn(`[workflow] Step ${node.id}: unresolved interpolation tokens: ${unresolved.join(", ")}`);
1087
1097
  updateWorkflowRunStep(stepId, {
@@ -1267,9 +1277,10 @@ function interpolateNodeConfig(node, interpolationCtx) {
1267
1277
  return {
1268
1278
  value: {
1269
1279
  ...restResult.value,
1270
- script: scriptResult.value
1280
+ script: scriptResult.unresolved.length > 0 ? script : scriptResult.value
1271
1281
  },
1272
- unresolved: [...restResult.unresolved, ...scriptResult.unresolved]
1282
+ unresolved: [...restResult.unresolved, ...scriptResult.unresolved],
1283
+ scriptBodyUnresolved: scriptResult.unresolved
1273
1284
  };
1274
1285
  }
1275
1286
  if (node.type !== "swarm-script" || !Object.hasOwn(node.config, "args")) {
@@ -1286,6 +1297,10 @@ function interpolateNodeConfig(node, interpolationCtx) {
1286
1297
  unresolved: [...configResult.unresolved, ...argsResult.unresolved]
1287
1298
  };
1288
1299
  }
1300
+ function scriptBodyInterpolationError(nodeId, tokens) {
1301
+ const renderedTokens = [...new Set(tokens)].map((token) => `{{${token}}}`).join(", ");
1302
+ return `Script body interpolation failed for node "${nodeId}": unresolved or disallowed token(s): ${renderedTokens}. ` + "Executable source may interpolate only input, workflow, swarm, or run values. " + "Pass dynamic trigger or upstream values through config.args and read them from argv.";
1303
+ }
1289
1304
  function timeoutPromise(ms) {
1290
1305
  return new Promise((_, reject) => {
1291
1306
  setTimeout(() => reject(new Error(`Step timed out after ${ms}ms`)), ms);
@@ -2225,7 +2240,11 @@ function startRetryPoller(registry, intervalMs = 5000) {
2225
2240
  if (!("run" in ctx))
2226
2241
  ctx.run = { id: run.id };
2227
2242
  const inputCtx = buildNodeInterpolationCtx(node, ctx);
2228
- const { value: interpolatedValue } = interpolateNodeConfig(node, inputCtx);
2243
+ const { value: interpolatedValue, scriptBodyUnresolved } = interpolateNodeConfig(node, inputCtx);
2244
+ if (scriptBodyUnresolved && scriptBodyUnresolved.length > 0) {
2245
+ checkpointStepFailure(run.id, step.id, scriptBodyInterpolationError(node.id, scriptBodyUnresolved), step.retryCount);
2246
+ continue;
2247
+ }
2229
2248
  const interpolatedConfig = interpolatedValue;
2230
2249
  const executor = registry.get(node.type);
2231
2250
  const meta = {
@@ -3073,7 +3092,7 @@ class HumanInTheLoopExecutor extends BaseExecutor {
3073
3092
  }
3074
3093
  if (notification.channel === "slack") {
3075
3094
  try {
3076
- const { getSlackApp } = await import("./app-hz5c2xay.js");
3095
+ const { getSlackApp } = await import("./app-m9gwqsqv.js");
3077
3096
  const slackApp = getSlackApp();
3078
3097
  if (!slackApp) {
3079
3098
  console.warn("[HITL] Slack not initialized — cannot send notification");
@@ -3189,7 +3208,7 @@ class NotifyExecutor extends BaseExecutor {
3189
3208
  }
3190
3209
  }
3191
3210
  case "slack": {
3192
- const { getSlackApp } = await import("./app-hz5c2xay.js");
3211
+ const { getSlackApp } = await import("./app-m9gwqsqv.js");
3193
3212
  const app = getSlackApp();
3194
3213
  if (!app) {
3195
3214
  return {
@@ -3538,6 +3557,7 @@ class ScriptExecutor extends BaseExecutor {
3538
3557
 
3539
3558
  // src/workflows/executors/swarm-script.ts
3540
3559
  init_zod();
3560
+ init_template();
3541
3561
  var SWARM_SCRIPT_DEFAULT_TIMEOUT_MS = DEFAULT_SCRIPT_RESOURCES.wallClockMs;
3542
3562
  var SWARM_SCRIPT_MIN_TIMEOUT_MS = MIN_SCRIPT_WALL_CLOCK_MS;
3543
3563
  var SWARM_SCRIPT_MAX_TIMEOUT_MS = MAX_SCRIPT_WALL_CLOCK_MS;
@@ -3560,6 +3580,14 @@ var SwarmScriptOutputSchema = exports_external.object({
3560
3580
  contentHash: exports_external.string(),
3561
3581
  version: exports_external.number()
3562
3582
  });
3583
+ var WORKFLOW_INTERPOLATION_ROOTS = new Set(["trigger", "input", "workflow", "swarm", "run"]);
3584
+ function findWorkflowSourceTokens(source, inputCtx) {
3585
+ const roots = new Set([...WORKFLOW_INTERPOLATION_ROOTS, ...Object.keys(inputCtx ?? {})]);
3586
+ return findInterpolationTokens(source).filter((token) => {
3587
+ const root = token.split(".")[0];
3588
+ return root !== undefined && roots.has(root);
3589
+ });
3590
+ }
3563
3591
 
3564
3592
  class SwarmScriptExecutor extends BaseExecutor {
3565
3593
  type = "swarm-script";
@@ -3579,6 +3607,14 @@ class SwarmScriptExecutor extends BaseExecutor {
3579
3607
  if (!resolved.ok) {
3580
3608
  return { status: "failed", error: resolved.error };
3581
3609
  }
3610
+ const sourceTokens = findWorkflowSourceTokens(resolved.source, meta.inputCtx);
3611
+ if (sourceTokens.length > 0) {
3612
+ const renderedTokens = [...new Set(sourceTokens)].map((token) => `{{${token}}}`).join(", ");
3613
+ return {
3614
+ status: "failed",
3615
+ error: `swarm-script body interpolation failed for node "${meta.nodeId}": unresolved token(s): ${renderedTokens}. ` + "Named script source is not workflow-interpolated; pass dynamic values through config.args and read them from args."
3616
+ };
3617
+ }
3582
3618
  const credentials = await buildScriptCredentialBindingsWithFailures({
3583
3619
  agentId: agentId ?? undefined
3584
3620
  });
package/dist/cli.js CHANGED
@@ -13,20 +13,20 @@ import"./cli-ap1czx8f.js";
13
13
  import"./cli-v69vk5h0.js";
14
14
  import {
15
15
  bedrockProviderModule
16
- } from "./cli-t5tsq67k.js";
16
+ } from "./cli-9dr5qzc0.js";
17
17
  import"./cli-cwy5hqbq.js";
18
18
  import {
19
19
  setBedrockProviderModule
20
- } from "./cli-6nh2qxvh.js";
20
+ } from "./cli-darcwax3.js";
21
21
  import"./cli-jvv0g8bh.js";
22
22
  import"./cli-r6kqqbj0.js";
23
- import"./cli-ch7t5v7n.js";
23
+ import"./cli-6map995v.js";
24
24
  import"./cli-4wgngmwv.js";
25
25
  import"./cli-vapyk8sw.js";
26
26
  import"./cli-zyxs93y9.js";
27
- import"./cli-vgexpfsr.js";
27
+ import"./cli-57khth04.js";
28
28
  import"./cli-y2apkfe2.js";
29
- import"./cli-w10fkrf1.js";
29
+ import"./cli-akdvwc9v.js";
30
30
  import"./cli-8wrympd7.js";
31
31
  import"./cli-7sgrxg9a.js";
32
32
  import"./cli-3fj60etf.js";
@@ -65,7 +65,7 @@ var import_react = __toESM(require_react(), 1);
65
65
  // package.json
66
66
  var package_default = {
67
67
  name: "@desplega.ai/agent-swarm",
68
- version: "1.130.0",
68
+ version: "1.131.0",
69
69
  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.",
70
70
  keywords: [
71
71
  "agent-swarm.dev",
@@ -234,14 +234,14 @@ var package_default = {
234
234
  "@aws-sdk/client-bedrock": "3.1048.0",
235
235
  "@desplega.ai/business-use": "^0.4.2",
236
236
  "@desplega.ai/localtunnel": "^2.2.0",
237
- "@earendil-works/pi-agent-core": "^0.83.0",
238
- "@earendil-works/pi-ai": "^0.83.0",
239
- "@earendil-works/pi-coding-agent": "^0.83.0",
237
+ "@earendil-works/pi-agent-core": "^0.84.1",
238
+ "@earendil-works/pi-ai": "^0.84.1",
239
+ "@earendil-works/pi-coding-agent": "^0.84.1",
240
240
  "@inkjs/ui": "^2.0.0",
241
241
  "@linear/sdk": "^77.0.0",
242
242
  "@modelcontextprotocol/sdk": "^1.25.1",
243
- "@openai/codex-sdk": "^0.146.0",
244
- "@opencode-ai/sdk": "^1.18.13",
243
+ "@openai/codex-sdk": "^0.147.0",
244
+ "@opencode-ai/sdk": "^1.18.15",
245
245
  "@openfort/openfort-node": "^0.9.1",
246
246
  "@opentelemetry/api": "^1.9.1",
247
247
  "@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
@@ -699,7 +699,7 @@ function McpServer({ port, apiKey, dbPath }) {
699
699
  if (dbPath) {
700
700
  process.env.DATABASE_PATH = dbPath;
701
701
  }
702
- import("./http-xdbbtmhx.js").then(() => {
702
+ import("./http-jewj0syk.js").then(() => {
703
703
  setStatus("running");
704
704
  }).catch((err) => {
705
705
  setStatus("error");
@@ -785,7 +785,7 @@ function WorkerRunner({
785
785
  }) {
786
786
  const { exit } = use_app_default();
787
787
  import_react.useEffect(() => {
788
- import("./worker-7shsr8hk.js").then(({ runWorker }) => runWorker({
788
+ import("./worker-msytr2cw.js").then(({ runWorker }) => runWorker({
789
789
  prompt: prompt || undefined,
790
790
  yolo,
791
791
  systemPrompt: systemPrompt || undefined,
@@ -802,7 +802,7 @@ function WorkerRunner({
802
802
  function LeadRunner({ prompt, yolo, systemPrompt, systemPromptFile, additionalArgs }) {
803
803
  const { exit } = use_app_default();
804
804
  import_react.useEffect(() => {
805
- import("./lead-1fva34y9.js").then(({ runLead }) => runLead({
805
+ import("./lead-1n8x30xe.js").then(({ runLead }) => runLead({
806
806
  prompt: prompt || undefined,
807
807
  yolo,
808
808
  systemPrompt: systemPrompt || undefined,
@@ -842,8 +842,8 @@ function LazyComponent({
842
842
  }
843
843
  return import_react.createElement(Component, props);
844
844
  }
845
- var loadOnboard = () => import("./onboard-9zn0fx2m.js").then(({ Onboard }) => Onboard);
846
- var loadConnect = () => import("./setup-3vnv2m43.js").then(({ Setup }) => Setup);
845
+ var loadOnboard = () => import("./onboard-pvm5b38w.js").then(({ Onboard }) => Onboard);
846
+ var loadConnect = () => import("./setup-nytnmwwr.js").then(({ Setup }) => Setup);
847
847
  function UnknownCommand({ command }) {
848
848
  const { exit } = use_app_default();
849
849
  import_react.useEffect(() => {
@@ -956,14 +956,14 @@ ${binName} docs \u2014 v${package_default.version}
956
956
  }
957
957
  process.exit(0);
958
958
  } else if (args.command === "hook") {
959
- const { runHook } = await import("./hook-9fkwkf3m.js");
959
+ const { runHook } = await import("./hook-g019yehy.js");
960
960
  await runHook();
961
961
  } else if (args.command === "codex-hook") {
962
- const { handleCodexHook } = await import("./codex-hook-amndawyb.js");
962
+ const { handleCodexHook } = await import("./codex-hook-hq54t9ft.js");
963
963
  await handleCodexHook();
964
964
  process.exit(0);
965
965
  } else if (args.command === "session-summary-stdin") {
966
- const { runSessionSummaryFromStdin } = await import("./hook-sn7pj75w.js");
966
+ const { runSessionSummaryFromStdin } = await import("./hook-77wpvnjc.js");
967
967
  await runSessionSummaryFromStdin();
968
968
  process.exit(process.exitCode ?? 0);
969
969
  } else if (args.command === "artifact") {
@@ -984,7 +984,7 @@ ${binName} docs \u2014 v${package_default.version}
984
984
  printHelp("scripts");
985
985
  process.exit(scriptsArgs[0] === "reembed" || args.showHelp ? 0 : 1);
986
986
  }
987
- const { runScriptsMaintenanceCommand } = await import("./maintenance-0rdb12vf.js");
987
+ const { runScriptsMaintenanceCommand } = await import("./maintenance-gvev11sa.js");
988
988
  await runScriptsMaintenanceCommand(scriptsArgs);
989
989
  console.log("Scripts re-embedded.");
990
990
  } else if (args.command === "rbac") {
@@ -994,14 +994,14 @@ ${binName} docs \u2014 v${package_default.version}
994
994
  printHelp("rbac");
995
995
  process.exit(args.showHelp ? 0 : 1);
996
996
  }
997
- const { runRbacCliCommand } = await import("./rbac-roles-w45bhahg.js");
997
+ const { runRbacCliCommand } = await import("./rbac-roles-cr80g96t.js");
998
998
  await runRbacCliCommand(rbacArgs);
999
999
  } else if (args.command === "codex-login") {
1000
1000
  const { runCodexLogin } = await import("./codex-login-z6yhbkmk.js");
1001
1001
  const codexLoginArgs = process.argv.slice(process.argv.indexOf("codex-login") + 1);
1002
1002
  await runCodexLogin(codexLoginArgs);
1003
1003
  } else if (args.command === "codex-session-runner") {
1004
- const { runCodexSessionRunner } = await import("./codex-session-runner-tpg8hyj7.js");
1004
+ const { runCodexSessionRunner } = await import("./codex-session-runner-g50vcsex.js");
1005
1005
  await runCodexSessionRunner();
1006
1006
  } else if (args.command === "claude-managed-setup") {
1007
1007
  const { runClaudeManagedSetup } = await import("./claude-managed-setup-52z4mq9w.js");
@@ -6,12 +6,12 @@ import {
6
6
  createInProcessCodexSession,
7
7
  resolveCodexAuthMode,
8
8
  resolveCodexRunnerArgv
9
- } from "./cli-h3e66g5b.js";
9
+ } from "./cli-5kx36evn.js";
10
10
  import"./cli-07er7wrs.js";
11
11
  import"./cli-r94z9p1z.js";
12
12
  import"./cli-d6n0thxw.js";
13
13
  import"./cli-psrqtw2m.js";
14
- import"./cli-s21zzx4b.js";
14
+ import"./cli-0rcyq6d9.js";
15
15
  import"./cli-yv9dttkh.js";
16
16
  import"./cli-zm7njwzd.js";
17
17
  import"./cli-cw70hymf.js";
@@ -25,10 +25,10 @@ import"./cli-7zd05xb4.js";
25
25
  import"./cli-zsspvvm2.js";
26
26
  import"./cli-4j2mrzag.js";
27
27
  import"./cli-5dsbcjjw.js";
28
- import"./cli-6nh2qxvh.js";
28
+ import"./cli-darcwax3.js";
29
29
  import"./cli-4wgngmwv.js";
30
30
  import"./cli-zyxs93y9.js";
31
- import"./cli-w10fkrf1.js";
31
+ import"./cli-akdvwc9v.js";
32
32
  import"./cli-8wrympd7.js";
33
33
  import"./cli-p9swy5t3.js";
34
34
  export {
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env bun
2
2
  import {
3
3
  renderSteeringDelivery
4
- } from "./cli-xg2eezyv.js";
4
+ } from "./cli-f1am9szv.js";
5
5
  import {
6
6
  getApiKey
7
7
  } from "./cli-f14fvzag.js";
8
8
  import {
9
9
  init_steering_enabled,
10
10
  isSteeringEnabled
11
- } from "./cli-4n4mdv21.js";
11
+ } from "./cli-xpxde7rm.js";
12
12
  import {
13
13
  getMcpBaseUrl,
14
14
  init_constants
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createInProcessCodexSession
3
- } from "./cli-h3e66g5b.js";
3
+ } from "./cli-5kx36evn.js";
4
4
  import"./cli-07er7wrs.js";
5
5
  import"./cli-r94z9p1z.js";
6
6
  import"./cli-d6n0thxw.js";
7
7
  import"./cli-psrqtw2m.js";
8
- import"./cli-s21zzx4b.js";
8
+ import"./cli-0rcyq6d9.js";
9
9
  import"./cli-yv9dttkh.js";
10
10
  import"./cli-zm7njwzd.js";
11
11
  import"./cli-cw70hymf.js";
@@ -19,10 +19,10 @@ import"./cli-7zd05xb4.js";
19
19
  import"./cli-zsspvvm2.js";
20
20
  import"./cli-4j2mrzag.js";
21
21
  import"./cli-5dsbcjjw.js";
22
- import"./cli-6nh2qxvh.js";
22
+ import"./cli-darcwax3.js";
23
23
  import"./cli-4wgngmwv.js";
24
24
  import"./cli-zyxs93y9.js";
25
- import"./cli-w10fkrf1.js";
25
+ import"./cli-akdvwc9v.js";
26
26
  import"./cli-8wrympd7.js";
27
27
  import"./cli-p9swy5t3.js";
28
28
 
@@ -2,16 +2,16 @@ import {
2
2
  getAllAgents,
3
3
  getAllTasks,
4
4
  init_db
5
- } from "./cli-s18zzkfp.js";
5
+ } from "./cli-a4jzdpa3.js";
6
6
  import {
7
7
  init_env_flag,
8
8
  isEnvFlagEnabled
9
- } from "./cli-4n4mdv21.js";
9
+ } from "./cli-xpxde7rm.js";
10
10
  import"./cli-x23me2mg.js";
11
11
  import"./cli-z2zcxes1.js";
12
12
  import"./cli-zsspvvm2.js";
13
13
  import"./cli-4j2mrzag.js";
14
- import"./cli-7v5dhmc8.js";
14
+ import"./cli-72q8m8gk.js";
15
15
  import"./cli-5dsbcjjw.js";
16
16
  import"./cli-p9swy5t3.js";
17
17
 
@@ -436,13 +436,13 @@ import {
436
436
  upsertSkillFiles,
437
437
  upsertSwarmConfig,
438
438
  withFavoriteFlags
439
- } from "./cli-s18zzkfp.js";
440
- import"./cli-4n4mdv21.js";
439
+ } from "./cli-a4jzdpa3.js";
440
+ import"./cli-xpxde7rm.js";
441
441
  import"./cli-x23me2mg.js";
442
442
  import"./cli-z2zcxes1.js";
443
443
  import"./cli-zsspvvm2.js";
444
444
  import"./cli-4j2mrzag.js";
445
- import"./cli-7v5dhmc8.js";
445
+ import"./cli-72q8m8gk.js";
446
446
  import"./cli-5dsbcjjw.js";
447
447
  import"./cli-p9swy5t3.js";
448
448
  init_db();