@desplega.ai/agent-swarm 1.118.0 → 1.119.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.
- package/README.md +1 -0
- package/dist/{actions-fsdthmby.js → actions-cdhadphb.js} +5 -5
- package/dist/{app-d48rk7pp.js → app-w2067dt3.js} +3 -3
- package/dist/{assistant-nqwh132h.js → assistant-cb02pb41.js} +8 -8
- package/dist/{boot-reembed-vztw3kmn.js → boot-reembed-b18pndap.js} +4 -4
- package/dist/{boot-reembed-z229xeg8.js → boot-reembed-p00s3r7a.js} +3 -3
- package/dist/{boot-scrub-logs-yqpj4x5g.js → boot-scrub-logs-b9ym4xx3.js} +2 -2
- package/dist/{cli-k01wm82x.js → cli-06d436hx.js} +5 -5
- package/dist/{cli-4xc1mc5x.js → cli-06xdf1gz.js} +1 -1
- package/dist/{cli-48qxfdv4.js → cli-15m4y05s.js} +5 -5
- package/dist/{cli-hy7qcdk0.js → cli-9ed8efw3.js} +1 -1
- package/dist/{cli-nh866k5t.js → cli-9kbww4vb.js} +1 -1
- package/dist/{cli-r6yjwx5h.js → cli-azvm6fss.js} +2 -2
- package/dist/{cli-g97ggbfg.js → cli-bx96sw2z.js} +2 -2
- package/dist/{cli-yqc51axp.js → cli-chs2zh28.js} +4 -4
- package/dist/{cli-xck0rrm4.js → cli-dqxwy0td.js} +1 -1
- package/dist/{cli-gwyaqc05.js → cli-h1gg78hv.js} +41 -20
- package/dist/{cli-er0djds9.js → cli-hyn69s0c.js} +1 -1
- package/dist/{cli-f5qm42kd.js → cli-j12px91x.js} +55 -1
- package/dist/{cli-20zj8pm5.js → cli-jy7w6z37.js} +6 -6
- package/dist/{cli-4j0y68we.js → cli-mxennm5t.js} +2 -2
- package/dist/{cli-2xp7h939.js → cli-q7eev82n.js} +3 -3
- package/dist/{cli-sqp2bsy0.js → cli-qcm02dkk.js} +1 -1
- package/dist/{cli-m3ybbmsm.js → cli-qf35kzka.js} +1 -1
- package/dist/{cli-jzyjzstk.js → cli-qw9seygs.js} +2 -2
- package/dist/{cli-60z5nrne.js → cli-txxvn1zb.js} +1 -1
- package/dist/{cli-8j4fe76y.js → cli-vfq38b3e.js} +1 -1
- package/dist/{cli-tzs999rv.js → cli-vt51szy9.js} +1 -1
- package/dist/{cli-st3frvaf.js → cli-x1m2hp0q.js} +51 -12
- package/dist/{cli-7g2e06cd.js → cli-zcra7f1h.js} +2 -2
- package/dist/cli.js +9 -9
- package/dist/{commands-f6n33dnc.js → commands-rn6frj4c.js} +2 -2
- package/dist/{db-h2rfvs2w.js → db-kmemzvqt.js} +2 -2
- package/dist/{handlers-tr8hkw59.js → handlers-mppa5zb3.js} +8 -8
- package/dist/{hook-h5337q9c.js → hook-ej6457r1.js} +1 -1
- package/dist/{http-6q6znnpp.js → http-wv092d70.js} +42 -35
- package/dist/{index-5mxp943z.js → index-adgr531h.js} +10 -10
- package/dist/{index-bm63k39y.js → index-bc90csfq.js} +9 -9
- package/dist/{index-sqkw2pk3.js → index-n6xq6x5d.js} +8 -8
- package/dist/{index-qps3frqq.js → index-q1x8ttq6.js} +242 -6
- package/dist/{keepalive-zajb254h.js → keepalive-yjx8f7cq.js} +4 -4
- package/dist/{lead-k73hvgv5.js → lead-r01f3pft.js} +18 -18
- package/dist/{maintenance-8s5pwjje.js → maintenance-tr5vvp93.js} +4 -4
- package/dist/{oauth-refresh-sweep-5qaqbyfx.js → oauth-refresh-sweep-s2jrst63.js} +3 -3
- package/dist/{onboard-eds531mw.js → onboard-czarh0tp.js} +2 -2
- package/dist/{otel-impl-93kctmj7.js → otel-impl-3e0t0kga.js} +1 -1
- package/dist/{pricing-refresh-gn72ypzm.js → pricing-refresh-0dvbj3rq.js} +4 -4
- package/dist/{rbac-roles-r01mzk0t.js → rbac-roles-1q4v9s52.js} +3 -3
- package/dist/{rbac-roles-26qs5ckt.js → rbac-roles-thnb7h7j.js} +2 -2
- package/dist/{seed-pricing-299zvwxd.js → seed-pricing-76xbxghj.js} +3 -3
- package/dist/{setup-fhysh4dg.js → setup-b134pfqr.js} +2 -2
- package/dist/{worker-ykxg0ttd.js → worker-e1ssyv77.js} +18 -18
- package/openapi.json +1 -1
- package/package.json +1 -1
- package/src/be/seed-scripts/catalog/complete-task.ts +26 -0
- package/src/be/seed-scripts/catalog/delegate.ts +36 -0
- package/src/be/seed-scripts/catalog/get-child-outputs.ts +51 -0
- package/src/be/seed-scripts/catalog/report-progress.ts +16 -0
- package/src/be/seed-scripts/catalog/swarm-overview.ts +21 -0
- package/src/be/seed-scripts/catalog/wait-for-task.ts +32 -0
- package/src/be/seed-scripts/index.ts +53 -0
- package/src/commands/runner.ts +62 -6
- package/src/http/mcp-bridge.ts +3 -1
- package/src/http/mcp.ts +11 -2
- package/src/prompts/base-prompt.ts +28 -5
- package/src/prompts/session-templates.ts +56 -0
- package/src/server.ts +26 -1
- package/src/tests/prompt-template-session.test.ts +5 -4
- package/src/tests/scripts-only-gating.test.ts +307 -0
- package/src/tests/seed-scripts.test.ts +2 -2
- 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)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveSlackUserId
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
3
|
+
} from "./cli-zcra7f1h.js";
|
|
4
|
+
import"./cli-txxvn1zb.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-
|
|
12
|
+
} from "./cli-qf35kzka.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-
|
|
22
|
+
} from "./cli-j12px91x.js";
|
|
23
23
|
import"./cli-z2zcxes1.js";
|
|
24
24
|
import"./cli-bw80ck94.js";
|
|
25
25
|
import"./cli-xz9aq0rf.js";
|
|
26
|
-
import"./cli-
|
|
26
|
+
import"./cli-9kbww4vb.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-
|
|
6
|
+
} from "./cli-15m4y05s.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-
|
|
12
|
+
import"./cli-j12px91x.js";
|
|
13
13
|
import"./cli-z2zcxes1.js";
|
|
14
14
|
import"./cli-bw80ck94.js";
|
|
15
15
|
import"./cli-xz9aq0rf.js";
|
|
16
|
-
import"./cli-
|
|
16
|
+
import"./cli-9kbww4vb.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-
|
|
4
|
+
} from "./cli-06d436hx.js";
|
|
5
5
|
import {
|
|
6
6
|
hasOtherUserMention
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-06xdf1gz.js";
|
|
8
8
|
import {
|
|
9
9
|
require_dist
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-15m4y05s.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-
|
|
17
|
-
import"./cli-
|
|
16
|
+
} from "./cli-zcra7f1h.js";
|
|
17
|
+
import"./cli-txxvn1zb.js";
|
|
18
18
|
import"./cli-ma04faw5.js";
|
|
19
19
|
import"./cli-wspgs9bt.js";
|
|
20
20
|
import {
|
|
21
21
|
createTaskWithSiblingAwareness
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-qf35kzka.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-
|
|
33
|
+
} from "./cli-j12px91x.js";
|
|
34
34
|
import"./cli-z2zcxes1.js";
|
|
35
35
|
import"./cli-bw80ck94.js";
|
|
36
36
|
import"./cli-xz9aq0rf.js";
|
|
37
|
-
import"./cli-
|
|
37
|
+
import"./cli-9kbww4vb.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-
|
|
5
|
-
import"./cli-
|
|
4
|
+
} from "./cli-qw9seygs.js";
|
|
5
|
+
import"./cli-qcm02dkk.js";
|
|
6
6
|
import"./cli-q25ejbyn.js";
|
|
7
7
|
import {
|
|
8
8
|
getDb,
|
|
9
9
|
init_db
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-j12px91x.js";
|
|
11
11
|
import"./cli-z2zcxes1.js";
|
|
12
12
|
import"./cli-bw80ck94.js";
|
|
13
13
|
import"./cli-xz9aq0rf.js";
|
|
14
|
-
import"./cli-
|
|
14
|
+
import"./cli-9kbww4vb.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-
|
|
6
|
+
} from "./cli-qcm02dkk.js";
|
|
7
7
|
import"./cli-q25ejbyn.js";
|
|
8
8
|
import {
|
|
9
9
|
getDb,
|
|
10
10
|
init_db
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-j12px91x.js";
|
|
12
12
|
import"./cli-z2zcxes1.js";
|
|
13
13
|
import"./cli-bw80ck94.js";
|
|
14
14
|
import"./cli-xz9aq0rf.js";
|
|
15
|
-
import"./cli-
|
|
15
|
+
import"./cli-9kbww4vb.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-
|
|
4
|
+
} from "./cli-j12px91x.js";
|
|
5
5
|
import"./cli-z2zcxes1.js";
|
|
6
6
|
import"./cli-bw80ck94.js";
|
|
7
7
|
import"./cli-xz9aq0rf.js";
|
|
8
|
-
import"./cli-
|
|
8
|
+
import"./cli-9kbww4vb.js";
|
|
9
9
|
import {
|
|
10
10
|
init_secret_scrubber,
|
|
11
11
|
scrubSecrets
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAdditiveBuffer,
|
|
3
3
|
extractSlackMessageText
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-06xdf1gz.js";
|
|
5
5
|
import {
|
|
6
6
|
getSlackApp,
|
|
7
7
|
registerTreeMessage
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-15m4y05s.js";
|
|
9
9
|
import {
|
|
10
10
|
rewriteSlackMentions
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-zcra7f1h.js";
|
|
12
12
|
import {
|
|
13
13
|
buildBufferFlushBlocks
|
|
14
14
|
} from "./cli-ma04faw5.js";
|
|
15
15
|
import {
|
|
16
16
|
createTaskWithSiblingAwareness
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-qf35kzka.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-
|
|
27
|
+
} from "./cli-j12px91x.js";
|
|
28
28
|
|
|
29
29
|
// src/slack/event-dedup.ts
|
|
30
30
|
var DEFAULT_TTL_MS = 300000;
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
getTaskById,
|
|
28
28
|
init_db,
|
|
29
29
|
setSlackMessageTracking
|
|
30
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-j12px91x.js";
|
|
31
31
|
import {
|
|
32
32
|
require_receiver,
|
|
33
33
|
require_sender,
|
|
@@ -55073,13 +55073,13 @@ async function initSlackApp() {
|
|
|
55073
55073
|
socketMode: true,
|
|
55074
55074
|
logLevel: import_bolt.LogLevel.DEBUG
|
|
55075
55075
|
});
|
|
55076
|
-
const { registerMessageHandler } = await import("./handlers-
|
|
55077
|
-
const { registerCommandHandler } = await import("./commands-
|
|
55078
|
-
const { registerActionHandlers } = await import("./actions-
|
|
55076
|
+
const { registerMessageHandler } = await import("./handlers-mppa5zb3.js");
|
|
55077
|
+
const { registerCommandHandler } = await import("./commands-rn6frj4c.js");
|
|
55078
|
+
const { registerActionHandlers } = await import("./actions-cdhadphb.js");
|
|
55079
55079
|
registerMessageHandler(app);
|
|
55080
55080
|
registerCommandHandler(app);
|
|
55081
55081
|
registerActionHandlers(app);
|
|
55082
|
-
const { createAssistant } = await import("./assistant-
|
|
55082
|
+
const { createAssistant } = await import("./assistant-cb02pb41.js");
|
|
55083
55083
|
app.assistant(createAssistant());
|
|
55084
55084
|
return app;
|
|
55085
55085
|
}
|
|
@@ -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.
|
|
10
|
+
version: "1.119.0",
|
|
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-
|
|
5
|
+
} from "./cli-bx96sw2z.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-
|
|
14
|
+
} from "./cli-j12px91x.js";
|
|
15
15
|
import {
|
|
16
16
|
init_secret_scrubber,
|
|
17
17
|
scrubSecrets
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./cli-jkhwmmgg.js";
|
|
4
4
|
import {
|
|
5
5
|
embedScript
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-qw9seygs.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-
|
|
25
|
+
} from "./cli-j12px91x.js";
|
|
26
26
|
import {
|
|
27
27
|
init_zod
|
|
28
28
|
} from "./cli-bw80ck94.js";
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
handleScheduleTrigger,
|
|
5
5
|
runScript,
|
|
6
6
|
startWorkflowExecution
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-jy7w6z37.js";
|
|
8
8
|
import {
|
|
9
9
|
getScript,
|
|
10
10
|
getScriptApiConnectionDescriptors,
|
|
11
11
|
getScriptMcpConnectionDescriptors
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-bx96sw2z.js";
|
|
13
13
|
import {
|
|
14
14
|
createTaskWithSiblingAwareness
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-qf35kzka.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-
|
|
27
|
+
} from "./cli-j12px91x.js";
|
|
28
28
|
import {
|
|
29
29
|
__commonJS,
|
|
30
30
|
__require,
|
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
} from "./cli-ftyf58xj.js";
|
|
11
11
|
import {
|
|
12
12
|
startPricingRefreshLoop
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-mxennm5t.js";
|
|
14
14
|
import {
|
|
15
15
|
seedPricingFromModelsDev
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-vfq38b3e.js";
|
|
17
17
|
import {
|
|
18
18
|
ensureRbacSeedsSynced,
|
|
19
19
|
getUserGrant
|
|
20
|
-
} from "./cli-
|
|
20
|
+
} from "./cli-hyn69s0c.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-
|
|
40
|
+
} from "./cli-9ed8efw3.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-
|
|
50
|
+
} from "./cli-chs2zh28.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-
|
|
64
|
+
} from "./cli-jy7w6z37.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-
|
|
84
|
+
} from "./cli-bx96sw2z.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-
|
|
96
|
+
} from "./cli-qcm02dkk.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-
|
|
104
|
+
} from "./cli-dqxwy0td.js";
|
|
105
105
|
import {
|
|
106
106
|
createAdditiveBuffer,
|
|
107
107
|
extractSlackMessageText,
|
|
108
108
|
parseSlackTs
|
|
109
|
-
} from "./cli-
|
|
109
|
+
} from "./cli-06xdf1gz.js";
|
|
110
110
|
import {
|
|
111
111
|
getSlackApp,
|
|
112
112
|
startSlackApp,
|
|
113
113
|
stopSlackApp
|
|
114
|
-
} from "./cli-
|
|
114
|
+
} from "./cli-15m4y05s.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-
|
|
130
|
+
} from "./cli-txxvn1zb.js";
|
|
131
131
|
import {
|
|
132
132
|
markdownToSlack
|
|
133
133
|
} from "./cli-ma04faw5.js";
|
|
134
134
|
import {
|
|
135
135
|
createTaskWithSiblingAwareness
|
|
136
|
-
} from "./cli-
|
|
136
|
+
} from "./cli-qf35kzka.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-
|
|
380
|
+
} from "./cli-j12px91x.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-
|
|
425
|
+
} from "./cli-9kbww4vb.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-
|
|
19713
|
+
const impl = await import("./otel-impl-3e0t0kga.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-
|
|
35000
|
+
const { getSlackApp: getSlackApp2 } = await import("./app-w2067dt3.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-
|
|
35069
|
+
const { getDb: getDb2 } = await import("./db-kmemzvqt.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
|
|
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 };
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
import {
|
|
27
27
|
init_package,
|
|
28
28
|
package_default
|
|
29
|
-
} from "./cli-
|
|
29
|
+
} from "./cli-9kbww4vb.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.
|