@desplega.ai/agent-swarm 1.118.0 → 1.119.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +6 -7
  2. package/dist/{actions-fsdthmby.js → actions-d6rvh4xw.js} +5 -5
  3. package/dist/{app-d48rk7pp.js → app-2t2t6qtm.js} +3 -3
  4. package/dist/{assistant-nqwh132h.js → assistant-kb23g109.js} +8 -8
  5. package/dist/{boot-reembed-vztw3kmn.js → boot-reembed-gjatq261.js} +4 -4
  6. package/dist/{boot-reembed-z229xeg8.js → boot-reembed-t2ct62pw.js} +3 -3
  7. package/dist/{boot-scrub-logs-yqpj4x5g.js → boot-scrub-logs-vwvpxk23.js} +2 -2
  8. package/dist/{cli-yqc51axp.js → cli-03hw3tdq.js} +4 -4
  9. package/dist/{cli-tzs999rv.js → cli-1q7q8zws.js} +1 -1
  10. package/dist/{cli-m3ybbmsm.js → cli-226nz7j1.js} +1 -1
  11. package/dist/{cli-k01wm82x.js → cli-2dsbab02.js} +5 -5
  12. package/dist/{cli-er0djds9.js → cli-2teefgw6.js} +1 -1
  13. package/dist/{cli-gwyaqc05.js → cli-34194d2q.js} +41 -20
  14. package/dist/{cli-g97ggbfg.js → cli-3hqj0r0f.js} +2 -2
  15. package/dist/{cli-jzyjzstk.js → cli-5fb5rv64.js} +2 -2
  16. package/dist/{cli-f5qm42kd.js → cli-6637ryhr.js} +55 -1
  17. package/dist/{cli-nh866k5t.js → cli-6j7ftsbs.js} +1 -1
  18. package/dist/{cli-r6yjwx5h.js → cli-9b5m9d9v.js} +2 -2
  19. package/dist/{cli-sqp2bsy0.js → cli-bwkxh7pa.js} +1 -1
  20. package/dist/{cli-hy7qcdk0.js → cli-gat4kjhe.js} +1 -1
  21. package/dist/{cli-8j4fe76y.js → cli-gpyx6t1w.js} +1 -1
  22. package/dist/{cli-2xp7h939.js → cli-gq1ss3yf.js} +3 -3
  23. package/dist/{cli-xck0rrm4.js → cli-gq46dx9q.js} +1 -1
  24. package/dist/{cli-4j0y68we.js → cli-p750jfs0.js} +2 -2
  25. package/dist/{cli-4xc1mc5x.js → cli-q8bgrc7c.js} +1 -1
  26. package/dist/{cli-60z5nrne.js → cli-wmep6bjt.js} +1 -1
  27. package/dist/{cli-48qxfdv4.js → cli-wt7b0vr9.js} +5 -5
  28. package/dist/{cli-7g2e06cd.js → cli-xjb2jg7b.js} +2 -2
  29. package/dist/{cli-st3frvaf.js → cli-yk38sbmz.js} +51 -12
  30. package/dist/{cli-20zj8pm5.js → cli-zyjvbdgq.js} +6 -6
  31. package/dist/cli.js +9 -9
  32. package/dist/{commands-f6n33dnc.js → commands-sar3k5f6.js} +2 -2
  33. package/dist/{db-h2rfvs2w.js → db-93qmw47d.js} +2 -2
  34. package/dist/{handlers-tr8hkw59.js → handlers-4q6rrpg6.js} +8 -8
  35. package/dist/{hook-h5337q9c.js → hook-r6j7pb72.js} +1 -1
  36. package/dist/{http-6q6znnpp.js → http-yr4md33c.js} +42 -35
  37. package/dist/{index-bm63k39y.js → index-4zpkrw7q.js} +9 -9
  38. package/dist/{index-5mxp943z.js → index-afc5zk9k.js} +10 -10
  39. package/dist/{index-qps3frqq.js → index-snekxj7z.js} +242 -6
  40. package/dist/{index-sqkw2pk3.js → index-wk5gsfqy.js} +8 -8
  41. package/dist/{keepalive-zajb254h.js → keepalive-wp8xyhnb.js} +4 -4
  42. package/dist/{lead-k73hvgv5.js → lead-5x0j5wxz.js} +18 -18
  43. package/dist/{maintenance-8s5pwjje.js → maintenance-yx9pwy8a.js} +4 -4
  44. package/dist/{oauth-refresh-sweep-5qaqbyfx.js → oauth-refresh-sweep-yb4scdc0.js} +3 -3
  45. package/dist/{onboard-eds531mw.js → onboard-f27pqdmq.js} +2 -2
  46. package/dist/{otel-impl-93kctmj7.js → otel-impl-z3cdybex.js} +1 -1
  47. package/dist/{pricing-refresh-gn72ypzm.js → pricing-refresh-0d0877ex.js} +4 -4
  48. package/dist/{rbac-roles-26qs5ckt.js → rbac-roles-fya9jda4.js} +2 -2
  49. package/dist/{rbac-roles-r01mzk0t.js → rbac-roles-s1kpmgrb.js} +3 -3
  50. package/dist/{seed-pricing-299zvwxd.js → seed-pricing-n6weaf7s.js} +3 -3
  51. package/dist/{setup-fhysh4dg.js → setup-64291zb4.js} +2 -2
  52. package/dist/{worker-ykxg0ttd.js → worker-2v01h42e.js} +18 -18
  53. package/openapi.json +1 -1
  54. package/package.json +1 -1
  55. package/src/be/seed-scripts/catalog/complete-task.ts +26 -0
  56. package/src/be/seed-scripts/catalog/delegate.ts +36 -0
  57. package/src/be/seed-scripts/catalog/get-child-outputs.ts +51 -0
  58. package/src/be/seed-scripts/catalog/report-progress.ts +16 -0
  59. package/src/be/seed-scripts/catalog/swarm-overview.ts +21 -0
  60. package/src/be/seed-scripts/catalog/wait-for-task.ts +32 -0
  61. package/src/be/seed-scripts/index.ts +53 -0
  62. package/src/commands/runner.ts +62 -6
  63. package/src/http/mcp-bridge.ts +3 -1
  64. package/src/http/mcp.ts +11 -2
  65. package/src/prompts/base-prompt.ts +28 -5
  66. package/src/prompts/session-templates.ts +56 -0
  67. package/src/server.ts +26 -1
  68. package/src/tests/prompt-template-session.test.ts +5 -4
  69. package/src/tests/scripts-only-gating.test.ts +307 -0
  70. package/src/tests/seed-scripts.test.ts +2 -2
  71. package/src/utils/scripts-only-mode.ts +5 -0
package/README.md CHANGED
@@ -129,6 +129,7 @@ Check [our templates](https://templates.agent-swarm.dev) for a quick start.
129
129
  - **Scheduled & recurring tasks** — cron-based automation for standing work, with schedules that can target agent tasks, workflows, or catalog scripts. [Scheduling →](https://docs.agent-swarm.dev/docs/concepts/scheduling)
130
130
  - **Asset namespaces** — group tasks, workflows, schedules, pages, and mapped files under canonical shared or personal keys, with inheritance, subtree filtering, audited moves, and cross-entity discovery. [Asset namespaces →](https://docs.agent-swarm.dev/docs/guides/asset-namespaces)
131
131
  - **Durable script workflows** — launch background script runs, inspect their journals, and track them from the dashboard when a one-shot `script-run` is too small. [Guide →](https://docs.agent-swarm.dev/docs/guides/script-workflow-runs)
132
+ - **Scripts-only MCP mode (code-mode)** — reduce the external MCP surface to eight script tools while retaining the full swarm SDK through `script-run`, cutting tool-schema context for capable coordinator models. [Guide →](https://docs.agent-swarm.dev/docs/guides/scripts-only-mode)
132
133
  - **Scripts as external APIs** — expose a saved script as a public `POST /api/x/script/<id>` endpoint with optional bearer auth, typed input validation, and per-endpoint usage tracking. [Guide →](https://docs.agent-swarm.dev/docs/guides/scripts-external-apis)
133
134
  - **Typed script API connections** — lead-managed OpenAPI, GraphQL, and MCP connections generate `ctx.api.*` / `ctx.mcp.*` clients for scripts, with credential bindings and OAuth-backed auth kept server-side. [Guide →](https://docs.agent-swarm.dev/docs/guides/script-connections)
134
135
  - **E2B-backed eval harness** — run a scenario × harness-config matrix against real swarm stacks, capture transcripts/artifacts, and grade outcomes with deterministic checks plus LLM or agentic judges. [Guide →](https://docs.agent-swarm.dev/docs/guides/evals-harness)
@@ -272,13 +273,11 @@ Join our [Discord](https://discord.gg/KZgfyyDVZa) if you have questions or want
272
273
 
273
274
  ## Star History
274
275
 
275
- <a href="https://star-history.com/#desplega-ai/agent-swarm&Date">
276
- <picture>
277
- <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=desplega-ai/agent-swarm&type=Date&theme=dark" />
278
- <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=desplega-ai/agent-swarm&type=Date" />
279
- <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=desplega-ai/agent-swarm&type=Date" />
280
- </picture>
281
- </a>
276
+ <picture>
277
+ <source media="(prefers-color-scheme: dark)" srcset="./assets/star-history-dark.svg" />
278
+ <source media="(prefers-color-scheme: light)" srcset="./assets/star-history-light.svg" />
279
+ <img alt="Star History Chart" src="./assets/star-history-light.svg" />
280
+ </picture>
282
281
 
283
282
  ## License
284
283
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  resolveSlackUserId
3
- } from "./cli-7g2e06cd.js";
4
- import"./cli-60z5nrne.js";
3
+ } from "./cli-xjb2jg7b.js";
4
+ import"./cli-wmep6bjt.js";
5
5
  import {
6
6
  buildCancelledBlocks,
7
7
  getTaskLink
@@ -9,7 +9,7 @@ import {
9
9
  import"./cli-wspgs9bt.js";
10
10
  import {
11
11
  createTaskWithSiblingAwareness
12
- } from "./cli-m3ybbmsm.js";
12
+ } from "./cli-226nz7j1.js";
13
13
  import"./cli-dh55d5fg.js";
14
14
  import {
15
15
  cancelTask,
@@ -19,11 +19,11 @@ import {
19
19
  init_context_key,
20
20
  init_db,
21
21
  slackContextKey
22
- } from "./cli-f5qm42kd.js";
22
+ } from "./cli-6637ryhr.js";
23
23
  import"./cli-z2zcxes1.js";
24
24
  import"./cli-bw80ck94.js";
25
25
  import"./cli-xz9aq0rf.js";
26
- import"./cli-nh866k5t.js";
26
+ import"./cli-6j7ftsbs.js";
27
27
  import"./cli-4j2mrzag.js";
28
28
  import"./cli-p9swy5t3.js";
29
29
 
@@ -3,17 +3,17 @@ import {
3
3
  initSlackApp,
4
4
  startSlackApp,
5
5
  stopSlackApp
6
- } from "./cli-48qxfdv4.js";
6
+ } from "./cli-wt7b0vr9.js";
7
7
  import"./cli-rkndnn90.js";
8
8
  import"./cli-b0p7rfnd.js";
9
9
  import"./cli-ma04faw5.js";
10
10
  import"./cli-wspgs9bt.js";
11
11
  import"./cli-dh55d5fg.js";
12
- import"./cli-f5qm42kd.js";
12
+ import"./cli-6637ryhr.js";
13
13
  import"./cli-z2zcxes1.js";
14
14
  import"./cli-bw80ck94.js";
15
15
  import"./cli-xz9aq0rf.js";
16
- import"./cli-nh866k5t.js";
16
+ import"./cli-6j7ftsbs.js";
17
17
  import"./cli-4j2mrzag.js";
18
18
  import"./cli-e15jhafb.js";
19
19
  import"./cli-7wmybrt5.js";
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  bufferThreadMessage,
3
3
  wasEventSeen
4
- } from "./cli-k01wm82x.js";
4
+ } from "./cli-2dsbab02.js";
5
5
  import {
6
6
  hasOtherUserMention
7
- } from "./cli-4xc1mc5x.js";
7
+ } from "./cli-q8bgrc7c.js";
8
8
  import {
9
9
  require_dist
10
- } from "./cli-48qxfdv4.js";
10
+ } from "./cli-wt7b0vr9.js";
11
11
  import"./cli-rkndnn90.js";
12
12
  import"./cli-b0p7rfnd.js";
13
13
  import {
14
14
  resolveSlackUserId,
15
15
  rewriteSlackMentions
16
- } from "./cli-7g2e06cd.js";
17
- import"./cli-60z5nrne.js";
16
+ } from "./cli-xjb2jg7b.js";
17
+ import"./cli-wmep6bjt.js";
18
18
  import"./cli-ma04faw5.js";
19
19
  import"./cli-wspgs9bt.js";
20
20
  import {
21
21
  createTaskWithSiblingAwareness
22
- } from "./cli-m3ybbmsm.js";
22
+ } from "./cli-226nz7j1.js";
23
23
  import"./cli-dh55d5fg.js";
24
24
  import {
25
25
  getAgentWorkingOnThread,
@@ -30,11 +30,11 @@ import {
30
30
  init_resolver,
31
31
  resolveTemplate,
32
32
  slackContextKey
33
- } from "./cli-f5qm42kd.js";
33
+ } from "./cli-6637ryhr.js";
34
34
  import"./cli-z2zcxes1.js";
35
35
  import"./cli-bw80ck94.js";
36
36
  import"./cli-xz9aq0rf.js";
37
- import"./cli-nh866k5t.js";
37
+ import"./cli-6j7ftsbs.js";
38
38
  import"./cli-4j2mrzag.js";
39
39
  import"./cli-e15jhafb.js";
40
40
  import"./cli-7wmybrt5.js";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  embedScript,
3
3
  embeddingProvider
4
- } from "./cli-jzyjzstk.js";
5
- import"./cli-sqp2bsy0.js";
4
+ } from "./cli-5fb5rv64.js";
5
+ import"./cli-bwkxh7pa.js";
6
6
  import"./cli-q25ejbyn.js";
7
7
  import {
8
8
  getDb,
9
9
  init_db
10
- } from "./cli-f5qm42kd.js";
10
+ } from "./cli-6637ryhr.js";
11
11
  import"./cli-z2zcxes1.js";
12
12
  import"./cli-bw80ck94.js";
13
13
  import"./cli-xz9aq0rf.js";
14
- import"./cli-nh866k5t.js";
14
+ import"./cli-6j7ftsbs.js";
15
15
  import"./cli-4j2mrzag.js";
16
16
  import"./cli-p9swy5t3.js";
17
17
 
@@ -3,16 +3,16 @@ import {
3
3
  getEmbeddingProvider,
4
4
  getMemoryStore,
5
5
  init_constants
6
- } from "./cli-sqp2bsy0.js";
6
+ } from "./cli-bwkxh7pa.js";
7
7
  import"./cli-q25ejbyn.js";
8
8
  import {
9
9
  getDb,
10
10
  init_db
11
- } from "./cli-f5qm42kd.js";
11
+ } from "./cli-6637ryhr.js";
12
12
  import"./cli-z2zcxes1.js";
13
13
  import"./cli-bw80ck94.js";
14
14
  import"./cli-xz9aq0rf.js";
15
- import"./cli-nh866k5t.js";
15
+ import"./cli-6j7ftsbs.js";
16
16
  import"./cli-4j2mrzag.js";
17
17
  import"./cli-p9swy5t3.js";
18
18
 
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-f5qm42kd.js";
4
+ } from "./cli-6637ryhr.js";
5
5
  import"./cli-z2zcxes1.js";
6
6
  import"./cli-bw80ck94.js";
7
7
  import"./cli-xz9aq0rf.js";
8
- import"./cli-nh866k5t.js";
8
+ import"./cli-6j7ftsbs.js";
9
9
  import {
10
10
  init_secret_scrubber,
11
11
  scrubSecrets
@@ -4,15 +4,15 @@ import {
4
4
  handleScheduleTrigger,
5
5
  runScript,
6
6
  startWorkflowExecution
7
- } from "./cli-20zj8pm5.js";
7
+ } from "./cli-zyjvbdgq.js";
8
8
  import {
9
9
  getScript,
10
10
  getScriptApiConnectionDescriptors,
11
11
  getScriptMcpConnectionDescriptors
12
- } from "./cli-g97ggbfg.js";
12
+ } from "./cli-3hqj0r0f.js";
13
13
  import {
14
14
  createTaskWithSiblingAwareness
15
- } from "./cli-m3ybbmsm.js";
15
+ } from "./cli-226nz7j1.js";
16
16
  import {
17
17
  getDb,
18
18
  getDueScheduledTasks,
@@ -24,7 +24,7 @@ import {
24
24
  scheduleContextKey,
25
25
  telemetry,
26
26
  updateScheduledTask
27
- } from "./cli-f5qm42kd.js";
27
+ } from "./cli-6637ryhr.js";
28
28
  import {
29
29
  __commonJS,
30
30
  __require,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  init_package,
3
3
  package_default
4
- } from "./cli-nh866k5t.js";
4
+ } from "./cli-6j7ftsbs.js";
5
5
 
6
6
  // src/commands/shared/client-config.ts
7
7
  init_package();
@@ -3,7 +3,7 @@ import {
3
3
  getAgentById,
4
4
  getInProgressTasksByContextKey,
5
5
  init_db
6
- } from "./cli-f5qm42kd.js";
6
+ } from "./cli-6637ryhr.js";
7
7
 
8
8
  // src/tasks/sibling-awareness.ts
9
9
  init_db();
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  createAdditiveBuffer,
3
3
  extractSlackMessageText
4
- } from "./cli-4xc1mc5x.js";
4
+ } from "./cli-q8bgrc7c.js";
5
5
  import {
6
6
  getSlackApp,
7
7
  registerTreeMessage
8
- } from "./cli-48qxfdv4.js";
8
+ } from "./cli-wt7b0vr9.js";
9
9
  import {
10
10
  rewriteSlackMentions
11
- } from "./cli-7g2e06cd.js";
11
+ } from "./cli-xjb2jg7b.js";
12
12
  import {
13
13
  buildBufferFlushBlocks
14
14
  } from "./cli-ma04faw5.js";
15
15
  import {
16
16
  createTaskWithSiblingAwareness
17
- } from "./cli-m3ybbmsm.js";
17
+ } from "./cli-226nz7j1.js";
18
18
  import {
19
19
  getLatestActiveTaskInThread,
20
20
  getLeadAgent,
@@ -24,7 +24,7 @@ import {
24
24
  init_registry,
25
25
  registerTemplate,
26
26
  slackContextKey
27
- } from "./cli-f5qm42kd.js";
27
+ } from "./cli-6637ryhr.js";
28
28
 
29
29
  // src/slack/event-dedup.ts
30
30
  var DEFAULT_TTL_MS = 300000;
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  getDb,
6
6
  init_db
7
- } from "./cli-f5qm42kd.js";
7
+ } from "./cli-6637ryhr.js";
8
8
 
9
9
  // src/be/rbac-roles.ts
10
10
  init_db();
@@ -10,14 +10,14 @@ import {
10
10
  } from "./cli-ftyf58xj.js";
11
11
  import {
12
12
  startPricingRefreshLoop
13
- } from "./cli-4j0y68we.js";
13
+ } from "./cli-p750jfs0.js";
14
14
  import {
15
15
  seedPricingFromModelsDev
16
- } from "./cli-8j4fe76y.js";
16
+ } from "./cli-gpyx6t1w.js";
17
17
  import {
18
18
  ensureRbacSeedsSynced,
19
19
  getUserGrant
20
- } from "./cli-er0djds9.js";
20
+ } from "./cli-2teefgw6.js";
21
21
  import {
22
22
  can,
23
23
  decideAdmission,
@@ -37,7 +37,7 @@ import {
37
37
  repointTrackerSyncBySwarmId,
38
38
  updateTrackerSync,
39
39
  updateTrackerSyncSwarmId
40
- } from "./cli-hy7qcdk0.js";
40
+ } from "./cli-gat4kjhe.js";
41
41
  import {
42
42
  ZodFirstPartyTypeKind,
43
43
  objectType
@@ -47,7 +47,7 @@ import {
47
47
  ensure,
48
48
  require_dist,
49
49
  runScheduleNow
50
- } from "./cli-yqc51axp.js";
50
+ } from "./cli-03hw3tdq.js";
51
51
  import {
52
52
  TriggerSchemaError,
53
53
  applyDefinitionPatch,
@@ -61,7 +61,7 @@ import {
61
61
  startWorkflowExecution,
62
62
  validateDefinition,
63
63
  validateJsonSchema
64
- } from "./cli-20zj8pm5.js";
64
+ } from "./cli-zyjvbdgq.js";
65
65
  import {
66
66
  getApiKey
67
67
  } from "./cli-f14fvzag.js";
@@ -81,7 +81,7 @@ import {
81
81
  setScriptConnectionEnabled,
82
82
  upsertCredentialBinding,
83
83
  upsertScriptConnection
84
- } from "./cli-g97ggbfg.js";
84
+ } from "./cli-3hqj0r0f.js";
85
85
  import {
86
86
  CANDIDATE_SET_MULTIPLIER,
87
87
  computeScore,
@@ -93,7 +93,7 @@ import {
93
93
  isGraphExpansionEnabled,
94
94
  rerank,
95
95
  rowToCandidate
96
- } from "./cli-sqp2bsy0.js";
96
+ } from "./cli-bwkxh7pa.js";
97
97
  import {
98
98
  buildAuthorizationUrl,
99
99
  ensureToken,
@@ -101,17 +101,17 @@ import {
101
101
  getOAuthApp,
102
102
  getOAuthTokens,
103
103
  upsertOAuthApp
104
- } from "./cli-xck0rrm4.js";
104
+ } from "./cli-gq46dx9q.js";
105
105
  import {
106
106
  createAdditiveBuffer,
107
107
  extractSlackMessageText,
108
108
  parseSlackTs
109
- } from "./cli-4xc1mc5x.js";
109
+ } from "./cli-q8bgrc7c.js";
110
110
  import {
111
111
  getSlackApp,
112
112
  startSlackApp,
113
113
  stopSlackApp
114
- } from "./cli-48qxfdv4.js";
114
+ } from "./cli-wt7b0vr9.js";
115
115
  import {
116
116
  findOrCreateUserByEmail,
117
117
  findUserByExternalId,
@@ -127,13 +127,13 @@ import {
127
127
  resolveIdentityByEmail,
128
128
  resolveUserByToken,
129
129
  unlinkIdentity
130
- } from "./cli-60z5nrne.js";
130
+ } from "./cli-wmep6bjt.js";
131
131
  import {
132
132
  markdownToSlack
133
133
  } from "./cli-ma04faw5.js";
134
134
  import {
135
135
  createTaskWithSiblingAwareness
136
- } from "./cli-m3ybbmsm.js";
136
+ } from "./cli-226nz7j1.js";
137
137
  import {
138
138
  getAppUrl,
139
139
  getMcpBaseUrl,
@@ -377,7 +377,7 @@ import {
377
377
  upsertService,
378
378
  upsertSwarmConfig,
379
379
  validateConfigValue
380
- } from "./cli-f5qm42kd.js";
380
+ } from "./cli-6637ryhr.js";
381
381
  import {
382
382
  init_zod
383
383
  } from "./cli-bw80ck94.js";
@@ -422,7 +422,7 @@ import {
422
422
  import {
423
423
  init_package,
424
424
  package_default
425
- } from "./cli-nh866k5t.js";
425
+ } from "./cli-6j7ftsbs.js";
426
426
  import {
427
427
  init_secret_scrubber,
428
428
  refreshSecretScrubberCache,
@@ -19710,7 +19710,7 @@ async function initOtel(serviceRole = process.env.AGENT_ROLE || "api") {
19710
19710
  return;
19711
19711
  initialized2 = true;
19712
19712
  try {
19713
- const impl = await import("./otel-impl-93kctmj7.js");
19713
+ const impl = await import("./otel-impl-z3cdybex.js");
19714
19714
  await impl.boot(serviceRole);
19715
19715
  realWithSpan = impl.withSpan;
19716
19716
  realStartSpan = impl.startSpan;
@@ -34997,7 +34997,7 @@ async function notifySlack(text) {
34997
34997
  return;
34998
34998
  }
34999
34999
  try {
35000
- const { getSlackApp: getSlackApp2 } = await import("./app-d48rk7pp.js");
35000
+ const { getSlackApp: getSlackApp2 } = await import("./app-2t2t6qtm.js");
35001
35001
  const app = getSlackApp2();
35002
35002
  if (!app) {
35003
35003
  console.warn("[Jira webhook keepalive] Slack not available, cannot send notification");
@@ -35066,7 +35066,7 @@ async function deleteJiraWebhook(webhookId) {
35066
35066
  console.log(`[Jira webhook keepalive] Deleted webhook id=${webhookId}`);
35067
35067
  }
35068
35068
  async function overwriteWebhookIds(next) {
35069
- const { getDb: getDb2 } = await import("./db-h2rfvs2w.js");
35069
+ const { getDb: getDb2 } = await import("./db-93qmw47d.js");
35070
35070
  const db = getDb2();
35071
35071
  const txn = db.transaction(() => {
35072
35072
  const row = db.query("SELECT metadata FROM oauth_apps WHERE provider = 'jira'").get();
@@ -112237,6 +112237,15 @@ var registerUpdateWorkflowTool = (server) => {
112237
112237
  }
112238
112238
  });
112239
112239
  };
112240
+ // src/utils/scripts-only-mode.ts
112241
+ function resolveScriptsOnlyMode(opts) {
112242
+ if (opts.env)
112243
+ return opts.env === "true";
112244
+ if (opts.configValue)
112245
+ return opts.configValue === "true";
112246
+ return false;
112247
+ }
112248
+
112240
112249
  // src/server.ts
112241
112250
  var DEFAULT_CAPABILITIES = "core,task-pool,profiles,services,scheduling,memory,workflows,pages,metrics,kv";
112242
112251
  var CAPABILITIES = new Set((process.env.CAPABILITIES || DEFAULT_CAPABILITIES).split(",").map((s) => s.trim()));
@@ -112246,7 +112255,10 @@ function hasCapability(cap) {
112246
112255
  function getEnabledCapabilities() {
112247
112256
  return Array.from(CAPABILITIES);
112248
112257
  }
112249
- function createServer() {
112258
+ function isScriptsOnlyMcp() {
112259
+ return resolveScriptsOnlyMode({ env: process.env.SCRIPTS_ONLY_MCP });
112260
+ }
112261
+ function createServer(opts = {}) {
112250
112262
  initDb(process.env.DATABASE_PATH);
112251
112263
  seedPricingFromModelsDev();
112252
112264
  startPricingRefreshLoop();
@@ -112267,6 +112279,15 @@ function createServer() {
112267
112279
  logging: {}
112268
112280
  }
112269
112281
  });
112282
+ if (opts.scriptsOnly ?? isScriptsOnlyMcp()) {
112283
+ registerScriptSearchTool(server);
112284
+ registerScriptRunTool(server);
112285
+ registerScriptUpsertTool(server);
112286
+ registerScriptDeleteTool(server);
112287
+ registerScriptQueryTypesTool(server);
112288
+ registerScriptRunsTools(server);
112289
+ return server;
112290
+ }
112270
112291
  registerJoinSwarmTool(server);
112271
112292
  registerPollTaskTool(server);
112272
112293
  registerGetSwarmTool(server);
@@ -112548,4 +112569,4 @@ function writeSkillsToFilesystem(entries, harnessType = "all", home) {
112548
112569
  return { synced, removed, errors };
112549
112570
  }
112550
112571
 
112551
- export { DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, isJSONRPCRequest, isJSONRPCResultResponse, isJSONRPCErrorResponse, JSONRPCMessageSchema, isInitializeRequest, McpServer, isGitHubEnabled, initGitHub, verifyWebhookSignature, userCtx, isPollTracingEnabled, initOtel, withSpan, startSpan, withSpanContext, withRemoteContext, injectTraceContext, recordSessionCost, createToolRegistrar, cancelTaskInputSchema, cancelTaskOutputSchema, cancelTaskHandler, setCorsHeaders, parseQueryParams, getPathSegments, safeRequestUrlForLog, agentWithCapacity, parseBody, BODY_TOO_LARGE, enforceContentLengthCap, json, jsonError, triggerSchemaErrorResponse, deriveApiBaseUrl, httpServerSemconvAttributes, describeRequestRoute, route, assertSelectOnlyQuery, executeReadOnlyQuery, handleDbQuery, snapshotMetric, AssetKeyAuthorizationError, authorizeAssetKeyWrite, resolveTaskAuditUserId, resolveHttpAuditUserId, snapshotPage, assertOAuthProviderIsNotReserved, assertOAuthAppUrlsSafe, scopedResourceScopeIdSchema, resolveScopedResourceId, getTaskDetailsInputSchema, getTaskDetailsOutputSchema, getTaskDetailsHandler, getTasksInputSchema, getTasksOutputSchema, getTasksHandler, storeLinks, refreshLinks, canReadMemory, getLinksForMemory, recordRetrievals, expandCandidatesWithGraph, markKapsoMessageRead, sendKapsoReaction, getKapsoConfig, getKapsoNumberMapping, markKapsoMessageSeen, createEvent, createEventsBatch, getEventCountsFiltered, getEventsFiltered, mergeScheduleTiming, validateRecurringTiming, sendTaskOutputSchema, sendTaskHandler, parseSkillContent, ExplicitSelfDuplicateError, applyRating, shouldPersistAutomaticTaskMemory, isAgentMailEnabled, initAgentMail, verifyAgentMailWebhook, isInboxAllowed, isSenderAllowed, handleMessageReceived, enqueueAuditRow, enqueueAdmissionRow, flushAuditBuffer, startAuditWriter, stopAuditWriter, startAuditGc, stopAuditGc, handlePullRequest, handleIssue, handleComment, handlePullRequestReview, handleCheckRun, handleCheckSuite, handleWorkflowRun, getJiraMetadata, updateJiraMetadata, clearJiraMetadata, registerJiraWebhook, deleteJiraWebhook, isJiraEnabled, initJira, handleJiraWebhook, handleAgentSessionEvent, handleIssueUpdate, handleIssueDelete, handleAgentSessionPrompted, isLinearEnabled, initLinear, loadGlobalConfigsIntoEnv, reloadGlobalConfigsAndIntegrations, scheduleIntegrationsReload, handleCore, canClaim, emitBudgetRefusalSideEffects, taskActionInputSchema, taskActionOutputSchema, taskActionHandler, hasCapability, getEnabledCapabilities, createServer, writeSkillsToFilesystem };
112572
+ export { DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, isJSONRPCRequest, isJSONRPCResultResponse, isJSONRPCErrorResponse, JSONRPCMessageSchema, isInitializeRequest, McpServer, isGitHubEnabled, initGitHub, verifyWebhookSignature, userCtx, isPollTracingEnabled, initOtel, withSpan, startSpan, withSpanContext, withRemoteContext, injectTraceContext, recordSessionCost, createToolRegistrar, cancelTaskInputSchema, cancelTaskOutputSchema, cancelTaskHandler, setCorsHeaders, parseQueryParams, getPathSegments, safeRequestUrlForLog, agentWithCapacity, parseBody, BODY_TOO_LARGE, enforceContentLengthCap, json, jsonError, triggerSchemaErrorResponse, deriveApiBaseUrl, httpServerSemconvAttributes, describeRequestRoute, route, assertSelectOnlyQuery, executeReadOnlyQuery, handleDbQuery, snapshotMetric, AssetKeyAuthorizationError, authorizeAssetKeyWrite, resolveTaskAuditUserId, resolveHttpAuditUserId, snapshotPage, assertOAuthProviderIsNotReserved, assertOAuthAppUrlsSafe, scopedResourceScopeIdSchema, resolveScopedResourceId, getTaskDetailsInputSchema, getTaskDetailsOutputSchema, getTaskDetailsHandler, getTasksInputSchema, getTasksOutputSchema, getTasksHandler, storeLinks, refreshLinks, canReadMemory, getLinksForMemory, recordRetrievals, expandCandidatesWithGraph, markKapsoMessageRead, sendKapsoReaction, getKapsoConfig, getKapsoNumberMapping, markKapsoMessageSeen, createEvent, createEventsBatch, getEventCountsFiltered, getEventsFiltered, mergeScheduleTiming, validateRecurringTiming, sendTaskOutputSchema, sendTaskHandler, parseSkillContent, ExplicitSelfDuplicateError, applyRating, shouldPersistAutomaticTaskMemory, isAgentMailEnabled, initAgentMail, verifyAgentMailWebhook, isInboxAllowed, isSenderAllowed, handleMessageReceived, enqueueAuditRow, enqueueAdmissionRow, flushAuditBuffer, startAuditWriter, stopAuditWriter, startAuditGc, stopAuditGc, handlePullRequest, handleIssue, handleComment, handlePullRequestReview, handleCheckRun, handleCheckSuite, handleWorkflowRun, getJiraMetadata, updateJiraMetadata, clearJiraMetadata, registerJiraWebhook, deleteJiraWebhook, isJiraEnabled, initJira, handleJiraWebhook, handleAgentSessionEvent, handleIssueUpdate, handleIssueDelete, handleAgentSessionPrompted, isLinearEnabled, initLinear, loadGlobalConfigsIntoEnv, reloadGlobalConfigsAndIntegrations, scheduleIntegrationsReload, handleCore, canClaim, emitBudgetRefusalSideEffects, taskActionInputSchema, taskActionOutputSchema, taskActionHandler, resolveScriptsOnlyMode, hasCapability, getEnabledCapabilities, createServer, writeSkillsToFilesystem };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./cli-jkhwmmgg.js";
4
4
  import {
5
5
  embedScript
6
- } from "./cli-jzyjzstk.js";
6
+ } from "./cli-5fb5rv64.js";
7
7
  import {
8
8
  calculatePKCECodeChallenge,
9
9
  generateRandomCodeVerifier,
@@ -22,7 +22,7 @@ import {
22
22
  init_date_utils,
23
23
  init_db,
24
24
  normalizeDateRequired
25
- } from "./cli-f5qm42kd.js";
25
+ } from "./cli-6637ryhr.js";
26
26
  import {
27
27
  init_zod
28
28
  } from "./cli-bw80ck94.js";
@@ -4,11 +4,11 @@ import {
4
4
  getEmbeddingProvider,
5
5
  init_embedding,
6
6
  serializeEmbedding
7
- } from "./cli-sqp2bsy0.js";
7
+ } from "./cli-bwkxh7pa.js";
8
8
  import {
9
9
  getDb,
10
10
  init_db
11
- } from "./cli-f5qm42kd.js";
11
+ } from "./cli-6637ryhr.js";
12
12
  import {
13
13
  init_secret_scrubber,
14
14
  scrubSecrets
@@ -26,7 +26,7 @@ import {
26
26
  import {
27
27
  init_package,
28
28
  package_default
29
- } from "./cli-nh866k5t.js";
29
+ } from "./cli-6j7ftsbs.js";
30
30
  import {
31
31
  init_secret_scrubber,
32
32
  scrubSecrets
@@ -3098,6 +3098,58 @@ The 5 script tools (\`script-search\`, \`script-run\`, \`script-upsert\`, \`scri
3098
3098
  variables: [],
3099
3099
  category: "system"
3100
3100
  });
3101
+ registerTemplate({
3102
+ eventType: "system.agent.scripts_only_mode",
3103
+ header: "",
3104
+ defaultBody: `
3105
+ ## Code-Mode: script tools ONLY
3106
+
3107
+ This swarm runs in **scripts-only mode**. The ONLY swarm MCP tools available are the script tools: \`script-search\`, \`script-run\`, \`script-upsert\`, \`script-delete\`, \`script-query-types\`, \`launch-script-run\`, \`get-script-run\`, \`list-script-runs\` (your harness may expose them under a prefix, e.g. \`mcp__agent-swarm__script-run\` — use the exact registered tool id). They are already loaded. Named tools like \`store-progress\`, \`send-task\`, \`post-message\`, \`memory-search\` do NOT exist here — do not search for them.
3108
+
3109
+ **Script entry signature (memorize — args FIRST, ctx SECOND):**
3110
+
3111
+ \`\`\`ts
3112
+ export default async function (args: any, ctx: any) { /* ... */ }
3113
+ \`\`\`
3114
+
3115
+ The full SDK is \`ctx.swarm.*\` — task lifecycle (\`task_get\`, \`task_send\`, \`task_storeProgress\`, \`task_action\`, \`task_list\`), messaging (\`message_post\`, \`message_read\`), Slack (\`slack_reply\`, \`slack_post\`, \`slack_read\`), memory, kv, swarm info (\`swarm_get\`, \`agent_info\`), and more. Responses are usually wrapped — prefer \`res?.data ?? res\`.
3116
+
3117
+ **Built-in coordination scripts — USE THESE FIRST (\`script-run\` with \`name\` + \`args\`):**
3118
+ - \`delegate\` {agentName, task, parentTaskId?} → subtask for an agent by name; returns {taskId}
3119
+ - \`wait-for-task\` {taskId} → waits up to ~25s for a terminal state; returns {done, status, output}; while done=false call it again
3120
+ - \`get-child-outputs\` {parentTaskId} → all children with status+output
3121
+ - \`complete-task\` {taskId, output} → THE way to finish your assigned task
3122
+ - \`report-progress\` {taskId, note} → progress update
3123
+ - \`swarm-overview\` {} → agents + task counts
3124
+
3125
+ Rules of the road:
3126
+ - Prefer a built-in script over inline source; write inline TypeScript only for logic no built-in covers. Check \`script-search\` first, and \`script-query-types\` for the live \`swarm-sdk.d.ts\` before authoring anything non-trivial.
3127
+ - \`taskId\` is NOT ambient inside scripts — pass it explicitly via \`args\`.
3128
+ - Report progress and completion via \`complete-task\` / \`report-progress\` (or \`ctx.swarm.task_storeProgress\` inline). This is how you update, complete, or fail your task — there is no other way.
3129
+ - Scripts are killed after ~30s and stdout is capped at 1 MB. Never sleep/loop longer than ~25s inside one script — chain \`wait-for-task\` calls instead.
3130
+ - Aggregate inside the script and return only the derived result — never dump raw data.
3131
+ - Batch related SDK calls into a single script when it reduces round trips.
3132
+ `,
3133
+ variables: [],
3134
+ category: "system"
3135
+ });
3136
+ registerTemplate({
3137
+ eventType: "system.agent.scripts_only_mode.slack",
3138
+ header: "",
3139
+ defaultBody: `
3140
+ #### Slack Thread Updates (scripts-only)
3141
+
3142
+ This task originated from Slack (channel: \`{{slackChannelId}}\`). You MUST keep the originating Slack thread informed — named Slack tools are not exposed in scripts-only mode, so reply via \`script-run\` with inline source calling \`ctx.swarm.slack_reply({ taskId, message })\` (your taskId carries the thread context):
3143
+ - **On start**: post a brief note that you picked up the task
3144
+ - **On completion**: post a summary of the result
3145
+ - **On failure**: post what went wrong so the requester knows immediately
3146
+ `,
3147
+ variables: [
3148
+ { name: "slackChannelId", description: "The Slack channel ID for the originating thread" },
3149
+ { name: "slackThreadTs", description: "The Slack thread timestamp" }
3150
+ ],
3151
+ category: "system"
3152
+ });
3101
3153
  registerTemplate({
3102
3154
  eventType: "system.agent.context_mode",
3103
3155
  header: "",
@@ -3133,6 +3185,8 @@ See the \`swarm-scripts\` skill for the full catalog, signatures, and usage patt
3133
3185
 
3134
3186
  **At task start when you only need memory:** Run \`smart-recall\` with 2-4 search angles from the task description.
3135
3187
 
3188
+ **For multi-agent fan-out:** \`delegate\` (subtask to an agent by name), \`wait-for-task\` (bounded wait for a child's result), \`get-child-outputs\` (aggregate all children) — each replaces a get-swarm/send-task/poll chain.
3189
+
3136
3190
  **For any other repetitive multi-tool pattern:** Call \`script-search\` with a natural-language description. If a script exists, use it.
3137
3191
 
3138
3192
  Script tools are deferred — load via \`ToolSearch("select:script-search,script-run")\` before first use.
@@ -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.118.0",
10
+ version: "1.119.1",
11
11
  description: "Multi-agent orchestration for Claude Code, Codex, Gemini CLI, and other AI coding assistants",
12
12
  license: "MIT",
13
13
  author: "desplega.sh <contact@desplega.sh>",
@@ -2,7 +2,7 @@ import {
2
2
  getScriptApiTypes,
3
3
  getScriptMcpTypes,
4
4
  require_typescript
5
- } from "./cli-g97ggbfg.js";
5
+ } from "./cli-3hqj0r0f.js";
6
6
  import {
7
7
  deleteSwarmConfigByKey,
8
8
  getAgentById,
@@ -11,7 +11,7 @@ import {
11
11
  getSwarmConfigs,
12
12
  init_db,
13
13
  upsertSwarmConfig
14
- } from "./cli-f5qm42kd.js";
14
+ } from "./cli-6637ryhr.js";
15
15
  import {
16
16
  init_secret_scrubber,
17
17
  scrubSecrets
@@ -6,7 +6,7 @@ import {
6
6
  getDb,
7
7
  init_db,
8
8
  isSqliteVecAvailable
9
- } from "./cli-f5qm42kd.js";
9
+ } from "./cli-6637ryhr.js";
10
10
  import {
11
11
  __esm,
12
12
  __export,
@@ -18,7 +18,7 @@ import {
18
18
  init_templates1 as init_templates,
19
19
  normalizeDateRequired,
20
20
  resolveTemplate
21
- } from "./cli-f5qm42kd.js";
21
+ } from "./cli-6637ryhr.js";
22
22
 
23
23
  // src/be/db-queries/tracker.ts
24
24
  init_date_utils();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-f5qm42kd.js";
4
+ } from "./cli-6637ryhr.js";
5
5
 
6
6
  // src/be/seed-pricing.ts
7
7
  init_db();