@desplega.ai/agent-swarm 1.123.1 → 1.124.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 +2 -1
- package/dist/{actions-3ntn8s3f.js → actions-z3d0fk7z.js} +5 -5
- package/dist/{app-pej7g57x.js → app-q2rc9tdr.js} +3 -3
- package/dist/{assistant-pxa36zjn.js → assistant-3stjq7fz.js} +8 -8
- package/dist/{boot-reembed-wdwde4vr.js → boot-reembed-5867whnb.js} +3 -3
- package/dist/{boot-reembed-ybq960bh.js → boot-reembed-v6r1df32.js} +4 -4
- package/dist/{boot-scrub-logs-ndqxg6e3.js → boot-scrub-logs-8b8jegk3.js} +2 -2
- package/dist/{cli-xv09zc8e.js → cli-0925phzv.js} +1 -1
- package/dist/{cli-256kb8p5.js → cli-2yr6edr7.js} +4 -4
- package/dist/{cli-x2hk4m81.js → cli-3z4q09tn.js} +54 -9
- package/dist/{cli-7yn0n4fp.js → cli-5jn6wnd9.js} +8 -8
- package/dist/{cli-82eq5zf5.js → cli-92bqgbgy.js} +1 -1
- package/dist/{cli-r07fhvsk.js → cli-dq2ssyf0.js} +5 -5
- package/dist/{cli-kqgkfpz7.js → cli-gkvf8d83.js} +1 -1
- package/dist/{cli-7qvpf14x.js → cli-gzjsamwc.js} +1 -1
- package/dist/{cli-333x50bh.js → cli-h89g0qrd.js} +1 -1
- package/dist/{cli-g4bfr1e7.js → cli-jp4mdj9d.js} +2 -2
- package/dist/{cli-2e5t0yjj.js → cli-kk58tg33.js} +7 -7
- package/dist/{cli-mb3gz7qr.js → cli-mcez7z4p.js} +1 -1
- package/dist/{cli-ca32n52j.js → cli-mmk5vagg.js} +2 -2
- package/dist/{cli-1kv5sydm.js → cli-p0ec4vv6.js} +1 -1
- package/dist/{cli-zvbxe7pf.js → cli-p0zgv8pj.js} +1 -1
- package/dist/{cli-mntyk3cr.js → cli-perb20ma.js} +1 -1
- package/dist/{cli-7rk0bbfr.js → cli-qf7acvyr.js} +2 -2
- package/dist/{cli-1cah98w1.js → cli-qwsagsmg.js} +1 -1
- package/dist/{cli-pjvdm39a.js → cli-sqv6c9b8.js} +5 -5
- package/dist/{cli-vw0acwe7.js → cli-vm20sh8d.js} +3 -3
- package/dist/{cli-sj43m5z0.js → cli-wn3m6q54.js} +3 -3
- package/dist/{cli-hgkf9zmd.js → cli-x268say8.js} +125 -58
- package/dist/{cli-0pmkqg1d.js → cli-y43n987v.js} +1 -1
- package/dist/{cli-qrnhnhma.js → cli-ykthjw29.js} +4 -4
- package/dist/{cli-k3yfwe8g.js → cli-zxb72ctk.js} +2 -2
- package/dist/cli.js +9 -9
- package/dist/{commands-5p0erxye.js → commands-sda76yn8.js} +2 -2
- package/dist/{db-yp9e9nvs.js → db-vn9e4rqj.js} +6 -2
- package/dist/{handlers-3hqw1dsr.js → handlers-xfja18ac.js} +8 -8
- package/dist/{hook-5981d59r.js → hook-2medrp47.js} +1 -1
- package/dist/{http-ek9ctgth.js → http-937pyjfc.js} +49 -39
- package/dist/{index-33eb3q08.js → index-2bqd2q9v.js} +11 -11
- package/dist/{index-8j9b86c9.js → index-gw4en7jg.js} +9 -9
- package/dist/{index-chcty242.js → index-knqczmnm.js} +10 -10
- package/dist/{index-1cnvzmh4.js → index-vah60vxp.js} +8 -8
- package/dist/{keepalive-rrvxy1fy.js → keepalive-20rd6hxh.js} +5 -5
- package/dist/{lead-jvw8b413.js → lead-7w2k3a49.js} +20 -20
- package/dist/{maintenance-3zjnr2wa.js → maintenance-p3x918yw.js} +4 -4
- package/dist/{oauth-refresh-sweep-vfhvqmby.js → oauth-refresh-sweep-shm0nzm4.js} +4 -4
- package/dist/{onboard-kvntqz8h.js → onboard-py9dnf54.js} +2 -2
- package/dist/{otel-impl-61tsn4bx.js → otel-impl-7yjkfg68.js} +1 -1
- package/dist/{pricing-refresh-jcp6ntbk.js → pricing-refresh-3snb6370.js} +4 -4
- package/dist/{rbac-roles-xcbab18x.js → rbac-roles-5e72bbpk.js} +3 -3
- package/dist/{rbac-roles-r3j4z9vs.js → rbac-roles-gqxdp8st.js} +4 -4
- package/dist/{seed-pricing-bd669a7j.js → seed-pricing-bg42d7h2.js} +3 -3
- package/dist/{setup-pg03xran.js → setup-nzk3kbbq.js} +2 -2
- package/dist/{worker-q5n4qwvq.js → worker-0p1jdzkm.js} +20 -20
- package/openapi.json +23 -1
- package/package.json +1 -1
- package/src/be/db.ts +81 -4
- package/src/be/scripts/typecheck.ts +8 -4
- package/src/be/seed-scripts/catalog/task-context-gathering.ts +1 -1
- package/src/http/workflows.ts +16 -4
- package/src/prompts/session-templates.ts +6 -3
- package/src/scripts-runtime/swarm-sdk.ts +10 -0
- package/src/scripts-runtime/types/stdlib.d.ts +4 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +4 -0
- package/src/telemetry.ts +10 -7
- package/src/tests/mcp-tools.test.ts +2 -2
- package/src/tests/prompt-template-session.test.ts +7 -0
- package/src/tests/scripts-mcp-e2e.test.ts +51 -2
- package/src/tests/scripts-typecheck.test.ts +17 -0
- package/src/tests/sdk-allowlist.test.ts +34 -1
- package/src/tests/seed-scripts.test.ts +43 -0
- package/src/tests/swarm-tool-result-gate.test.ts +35 -0
- package/src/tests/task-tools-ctx.test.ts +29 -0
- package/src/tests/telemetry-init.test.ts +21 -24
- package/src/tests/workflow-http-v2.test.ts +116 -0
- package/src/tools/get-tasks.ts +40 -1
- package/src/tools/script-run.ts +2 -2
- package/src/tools/script-upsert.ts +2 -2
- package/src/tools/utils.ts +14 -8
- package/src/tools/workflows/list-workflow-runs.ts +95 -24
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAdditiveBuffer,
|
|
3
3
|
extractSlackMessageText
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-92bqgbgy.js";
|
|
5
5
|
import {
|
|
6
6
|
rewriteSlackMentions
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-jp4mdj9d.js";
|
|
8
8
|
import {
|
|
9
9
|
createTaskWithSiblingAwareness
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-qwsagsmg.js";
|
|
11
11
|
import {
|
|
12
12
|
getSlackApp,
|
|
13
13
|
registerTreeMessage
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-dq2ssyf0.js";
|
|
15
15
|
import {
|
|
16
16
|
buildBufferFlushBlocks
|
|
17
17
|
} from "./cli-5ncdb7ff.js";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
registerTemplate,
|
|
30
30
|
requestSteering,
|
|
31
31
|
slackContextKey
|
|
32
|
-
} from "./cli-
|
|
32
|
+
} from "./cli-3z4q09tn.js";
|
|
33
33
|
|
|
34
34
|
// src/slack/event-dedup.ts
|
|
35
35
|
var DEFAULT_TTL_MS = 300000;
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
getPinCandidateAgent,
|
|
8
8
|
getResumeGeneration,
|
|
9
9
|
repointTrackerSyncBySwarmId
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-gkvf8d83.js";
|
|
11
11
|
import {
|
|
12
12
|
getExecutorRegistry,
|
|
13
13
|
recoverIncompleteRuns
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-kk58tg33.js";
|
|
15
15
|
import {
|
|
16
16
|
MAX_EMPTY_POLLS,
|
|
17
17
|
assignUnassignedTaskPending,
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
resolveTemplate,
|
|
56
56
|
supersedeTask,
|
|
57
57
|
updateAgentStatus
|
|
58
|
-
} from "./cli-
|
|
58
|
+
} from "./cli-3z4q09tn.js";
|
|
59
59
|
import {
|
|
60
60
|
init_secret_scrubber,
|
|
61
61
|
scrubSecrets
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./cli-jkhwmmgg.js";
|
|
4
4
|
import {
|
|
5
5
|
embedScript
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-mmk5vagg.js";
|
|
7
7
|
import {
|
|
8
8
|
calculatePKCECodeChallenge,
|
|
9
9
|
generateRandomCodeVerifier,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
getOAuthAppById,
|
|
13
13
|
updateAuthorizationTokens,
|
|
14
14
|
upsertAuthorization
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-mcez7z4p.js";
|
|
16
16
|
import {
|
|
17
17
|
computeContentHash,
|
|
18
18
|
decryptSecret,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
normalizeDateRequired,
|
|
31
31
|
placeholderForConfigKey,
|
|
32
32
|
upsertSwarmConfig
|
|
33
|
-
} from "./cli-
|
|
33
|
+
} from "./cli-3z4q09tn.js";
|
|
34
34
|
import {
|
|
35
35
|
init_secret_scrubber,
|
|
36
36
|
refreshSecretScrubberCache,
|
|
@@ -13,22 +13,22 @@ import {
|
|
|
13
13
|
ensure,
|
|
14
14
|
require_dist,
|
|
15
15
|
runScheduleNow
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-2yr6edr7.js";
|
|
17
17
|
import {
|
|
18
18
|
startPricingRefreshLoop
|
|
19
|
-
} from "./cli-
|
|
19
|
+
} from "./cli-qf7acvyr.js";
|
|
20
20
|
import {
|
|
21
21
|
seedPricingFromModelsDev
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-gzjsamwc.js";
|
|
23
23
|
import {
|
|
24
24
|
ensureRbacSeedsSynced,
|
|
25
25
|
getUserGrant
|
|
26
|
-
} from "./cli-
|
|
26
|
+
} from "./cli-zxb72ctk.js";
|
|
27
27
|
import {
|
|
28
28
|
can,
|
|
29
29
|
decideAdmission,
|
|
30
30
|
isRbacEnabled
|
|
31
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-y43n987v.js";
|
|
32
32
|
import {
|
|
33
33
|
createTrackerAgentMapping,
|
|
34
34
|
createTrackerSync,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
repointTrackerSyncBySwarmId,
|
|
44
44
|
updateTrackerSync,
|
|
45
45
|
updateTrackerSyncSwarmId
|
|
46
|
-
} from "./cli-
|
|
46
|
+
} from "./cli-gkvf8d83.js";
|
|
47
47
|
import {
|
|
48
48
|
TriggerSchemaError,
|
|
49
49
|
applyDefinitionPatch,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
startWorkflowExecution,
|
|
58
58
|
validateDefinition,
|
|
59
59
|
validateJsonSchema
|
|
60
|
-
} from "./cli-
|
|
60
|
+
} from "./cli-kk58tg33.js";
|
|
61
61
|
import {
|
|
62
62
|
getApiKey
|
|
63
63
|
} from "./cli-f14fvzag.js";
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
ensureToken,
|
|
68
68
|
ensureTokenOrThrow,
|
|
69
69
|
onAuthorizationRefreshed
|
|
70
|
-
} from "./cli-
|
|
70
|
+
} from "./cli-h89g0qrd.js";
|
|
71
71
|
import {
|
|
72
72
|
ConnectionAuthInputSchema,
|
|
73
73
|
assertUrlSafe,
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
setScriptConnectionEnabled,
|
|
83
83
|
upsertCredentialBinding,
|
|
84
84
|
upsertScriptConnection
|
|
85
|
-
} from "./cli-
|
|
85
|
+
} from "./cli-wn3m6q54.js";
|
|
86
86
|
import {
|
|
87
87
|
CANDIDATE_SET_MULTIPLIER,
|
|
88
88
|
computeScore,
|
|
@@ -94,7 +94,7 @@ import {
|
|
|
94
94
|
isGraphExpansionEnabled,
|
|
95
95
|
rerank,
|
|
96
96
|
rowToCandidate
|
|
97
|
-
} from "./cli-
|
|
97
|
+
} from "./cli-p0ec4vv6.js";
|
|
98
98
|
import {
|
|
99
99
|
createOAuthApp,
|
|
100
100
|
getAuthorizationById,
|
|
@@ -104,7 +104,7 @@ import {
|
|
|
104
104
|
getOAuthTokens,
|
|
105
105
|
listAuthorizationsForApp,
|
|
106
106
|
upsertOAuthApp
|
|
107
|
-
} from "./cli-
|
|
107
|
+
} from "./cli-mcez7z4p.js";
|
|
108
108
|
import {
|
|
109
109
|
ZodFirstPartyTypeKind,
|
|
110
110
|
objectType
|
|
@@ -113,7 +113,7 @@ import {
|
|
|
113
113
|
createAdditiveBuffer,
|
|
114
114
|
extractSlackMessageText,
|
|
115
115
|
parseSlackTs
|
|
116
|
-
} from "./cli-
|
|
116
|
+
} from "./cli-92bqgbgy.js";
|
|
117
117
|
import {
|
|
118
118
|
findOrCreateUserByEmail,
|
|
119
119
|
findUserByExternalId,
|
|
@@ -129,15 +129,15 @@ import {
|
|
|
129
129
|
resolveIdentityByEmail,
|
|
130
130
|
resolveUserByToken,
|
|
131
131
|
unlinkIdentity
|
|
132
|
-
} from "./cli-
|
|
132
|
+
} from "./cli-0925phzv.js";
|
|
133
133
|
import {
|
|
134
134
|
createTaskWithSiblingAwareness
|
|
135
|
-
} from "./cli-
|
|
135
|
+
} from "./cli-qwsagsmg.js";
|
|
136
136
|
import {
|
|
137
137
|
getSlackApp,
|
|
138
138
|
startSlackApp,
|
|
139
139
|
stopSlackApp
|
|
140
|
-
} from "./cli-
|
|
140
|
+
} from "./cli-dq2ssyf0.js";
|
|
141
141
|
import {
|
|
142
142
|
markdownToSlack
|
|
143
143
|
} from "./cli-5ncdb7ff.js";
|
|
@@ -337,7 +337,7 @@ import {
|
|
|
337
337
|
listKv,
|
|
338
338
|
listMcpServers,
|
|
339
339
|
listSkills,
|
|
340
|
-
|
|
340
|
+
listWorkflowRunsPage,
|
|
341
341
|
listWorkflows,
|
|
342
342
|
markInboxMessageResponded,
|
|
343
343
|
markSteeringHandled,
|
|
@@ -390,11 +390,11 @@ import {
|
|
|
390
390
|
upsertService,
|
|
391
391
|
upsertSwarmConfig,
|
|
392
392
|
validateConfigValue
|
|
393
|
-
} from "./cli-
|
|
393
|
+
} from "./cli-3z4q09tn.js";
|
|
394
394
|
import {
|
|
395
395
|
init_package,
|
|
396
396
|
package_default
|
|
397
|
-
} from "./cli-
|
|
397
|
+
} from "./cli-p0zgv8pj.js";
|
|
398
398
|
import {
|
|
399
399
|
init_secret_scrubber,
|
|
400
400
|
refreshSecretScrubberCache,
|
|
@@ -22851,7 +22851,7 @@ async function notifySlack(text) {
|
|
|
22851
22851
|
return;
|
|
22852
22852
|
}
|
|
22853
22853
|
try {
|
|
22854
|
-
const { getSlackApp: getSlackApp2 } = await import("./app-
|
|
22854
|
+
const { getSlackApp: getSlackApp2 } = await import("./app-q2rc9tdr.js");
|
|
22855
22855
|
const app = getSlackApp2();
|
|
22856
22856
|
if (!app) {
|
|
22857
22857
|
console.warn("[Jira webhook keepalive] Slack not available, cannot send notification");
|
|
@@ -22920,7 +22920,7 @@ async function deleteJiraWebhook(webhookId) {
|
|
|
22920
22920
|
console.log(`[Jira webhook keepalive] Deleted webhook id=${webhookId}`);
|
|
22921
22921
|
}
|
|
22922
22922
|
async function overwriteWebhookIds(next) {
|
|
22923
|
-
const { getDb: getDb2 } = await import("./db-
|
|
22923
|
+
const { getDb: getDb2 } = await import("./db-vn9e4rqj.js");
|
|
22924
22924
|
const db = getDb2();
|
|
22925
22925
|
const txn = db.transaction(() => {
|
|
22926
22926
|
const row = db.query("SELECT metadata FROM oauth_apps WHERE provider = 'jira'").get();
|
|
@@ -97816,7 +97816,7 @@ async function initOtel(serviceRole = process.env.AGENT_ROLE || "api") {
|
|
|
97816
97816
|
return;
|
|
97817
97817
|
initialized6 = true;
|
|
97818
97818
|
try {
|
|
97819
|
-
const impl = await import("./otel-impl-
|
|
97819
|
+
const impl = await import("./otel-impl-7yjkfg68.js");
|
|
97820
97820
|
await impl.boot(serviceRole);
|
|
97821
97821
|
realWithSpan = impl.withSpan;
|
|
97822
97822
|
realStartSpan = impl.startSpan;
|
|
@@ -97957,12 +97957,12 @@ var NUDGES = {
|
|
|
97957
97957
|
return Array.isArray(results) && results.some((entry) => Boolean(entry?.rateHint)) ? "Rate memories that help or mislead you with memory_rate." : undefined;
|
|
97958
97958
|
}
|
|
97959
97959
|
};
|
|
97960
|
-
var
|
|
97960
|
+
var DETAILS_CAP = 8000;
|
|
97961
97961
|
function truncateForText(text) {
|
|
97962
|
-
if (text.length <=
|
|
97962
|
+
if (text.length <= DETAILS_CAP)
|
|
97963
97963
|
return text;
|
|
97964
|
-
return `${text.slice(0,
|
|
97965
|
-
… [truncated ${text.length -
|
|
97964
|
+
return `${text.slice(0, DETAILS_CAP)}
|
|
97965
|
+
… [truncated ${text.length - DETAILS_CAP} chars]`;
|
|
97966
97966
|
}
|
|
97967
97967
|
var scrubMiddleware = (result) => result.allowSecretEgress ? result : scrubObject(result);
|
|
97968
97968
|
var nudgeMiddleware = (result, ctx) => {
|
|
@@ -97983,8 +97983,9 @@ function finalizeSwarmToolResult(toolName, result) {
|
|
|
97983
97983
|
}
|
|
97984
97984
|
for (const middleware of FINALIZE_PIPELINE)
|
|
97985
97985
|
r = middleware(r, { toolName });
|
|
97986
|
-
const
|
|
97987
|
-
const
|
|
97986
|
+
const explicitDetails = r.details?.trim() ? truncateForText(r.details.trim()) : undefined;
|
|
97987
|
+
const dataFallback = !explicitDetails && r.data && Object.keys(r.data).length > 0 ? truncateForText(JSON.stringify(r.data, null, 2)) : undefined;
|
|
97988
|
+
const text = [r.message, explicitDetails ?? dataFallback, r.nudge].filter((part) => Boolean(part?.trim())).join(`
|
|
97988
97989
|
|
|
97989
97990
|
`);
|
|
97990
97991
|
const structuredContent = {
|
|
@@ -97992,8 +97993,8 @@ function finalizeSwarmToolResult(toolName, result) {
|
|
|
97992
97993
|
success: r.ok,
|
|
97993
97994
|
message: r.message
|
|
97994
97995
|
};
|
|
97995
|
-
if (
|
|
97996
|
-
structuredContent.details =
|
|
97996
|
+
if (explicitDetails)
|
|
97997
|
+
structuredContent.details = explicitDetails;
|
|
97997
97998
|
if (r.nudge)
|
|
97998
97999
|
structuredContent.nudge = r.nudge;
|
|
97999
98000
|
return {
|
|
@@ -99948,6 +99949,30 @@ var getTasksOutputSchema = swarmToolOutputSchema({
|
|
|
99948
99949
|
yourAgentId: string().optional(),
|
|
99949
99950
|
tasks: array(TaskSummarySchema).optional()
|
|
99950
99951
|
});
|
|
99952
|
+
var TASK_DETAILS_CELL_CAP = 180;
|
|
99953
|
+
function escapeMarkdownCell(value) {
|
|
99954
|
+
const text = String(value ?? "—");
|
|
99955
|
+
const compact2 = text.length > TASK_DETAILS_CELL_CAP ? `${text.slice(0, TASK_DETAILS_CELL_CAP - 1)}…` : text;
|
|
99956
|
+
return compact2.replaceAll("\\", "\\\\").replaceAll("|", "\\|").replace(/\r\n|\r|\n/g, "<br>");
|
|
99957
|
+
}
|
|
99958
|
+
function renderTaskSummaries(tasks) {
|
|
99959
|
+
if (tasks.length === 0)
|
|
99960
|
+
return "No tasks matched the current filters.";
|
|
99961
|
+
const header = "| ID | Status | Priority | Agent | Task |";
|
|
99962
|
+
const separator = "| --- | --- | ---: | --- | --- |";
|
|
99963
|
+
const rows = tasks.map((task) => {
|
|
99964
|
+
const cells = [
|
|
99965
|
+
task.id,
|
|
99966
|
+
task.status,
|
|
99967
|
+
task.priority,
|
|
99968
|
+
task.agentId,
|
|
99969
|
+
task.taskPreview ?? task.task
|
|
99970
|
+
].map(escapeMarkdownCell);
|
|
99971
|
+
return `| ${cells.join(" | ")} |`;
|
|
99972
|
+
});
|
|
99973
|
+
return [header, separator, ...rows].join(`
|
|
99974
|
+
`);
|
|
99975
|
+
}
|
|
99951
99976
|
async function getTasksHandler(ctx, {
|
|
99952
99977
|
status,
|
|
99953
99978
|
mineOnly,
|
|
@@ -100027,7 +100052,7 @@ async function getTasksHandler(ctx, {
|
|
|
100027
100052
|
tasks: taskSummaries
|
|
100028
100053
|
};
|
|
100029
100054
|
return toolOk(`Found ${taskSummaries.length} task(s)${filterMsg}.`, {
|
|
100030
|
-
details:
|
|
100055
|
+
details: renderTaskSummaries(taskSummaries),
|
|
100031
100056
|
data
|
|
100032
100057
|
});
|
|
100033
100058
|
}
|
|
@@ -104801,17 +104826,17 @@ var scriptToolOutputSchema = swarmToolOutputSchema({
|
|
|
104801
104826
|
status: number().optional(),
|
|
104802
104827
|
data: unknown().optional()
|
|
104803
104828
|
});
|
|
104804
|
-
var
|
|
104829
|
+
var DETAILS_CAP2 = 16000;
|
|
104805
104830
|
function stripAnsi(text) {
|
|
104806
104831
|
return text.replace(/\x1b\[[0-9;]*m/g, "");
|
|
104807
104832
|
}
|
|
104808
104833
|
function capDetails(text) {
|
|
104809
104834
|
if (!text)
|
|
104810
104835
|
return;
|
|
104811
|
-
if (text.length <=
|
|
104836
|
+
if (text.length <= DETAILS_CAP2)
|
|
104812
104837
|
return text;
|
|
104813
|
-
return `${text.slice(0,
|
|
104814
|
-
… [truncated ${text.length -
|
|
104838
|
+
return `${text.slice(0, DETAILS_CAP2)}
|
|
104839
|
+
… [truncated ${text.length - DETAILS_CAP2} chars]`;
|
|
104815
104840
|
}
|
|
104816
104841
|
function isRecord(value) {
|
|
104817
104842
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -105386,7 +105411,7 @@ var registerScriptQueryTypesTool = (server) => {
|
|
|
105386
105411
|
|
|
105387
105412
|
// src/tools/script-run.ts
|
|
105388
105413
|
init_zod();
|
|
105389
|
-
var SCRIPT_RUN_DESCRIPTION = "Run a named swarm-shared script (callable across agents and from workflow `swarm-script` nodes), OR inline source (auto-saved as scratch to the catalog). Use for swarm-visible, durable scripts. For local-only throwaway TS, use code-mode `run`.";
|
|
105414
|
+
var SCRIPT_RUN_DESCRIPTION = "Run a named swarm-shared script (callable across agents and from workflow `swarm-script` nodes), OR inline source (auto-saved as scratch to the catalog). Inline source executes without the `script-upsert` compile-time typecheck. Use for swarm-visible, durable scripts. For local-only throwaway TS, use code-mode `run`.";
|
|
105390
105415
|
function renderRunOutput(data) {
|
|
105391
105416
|
if (typeof data !== "object" || data === null)
|
|
105392
105417
|
return;
|
|
@@ -105424,7 +105449,7 @@ var registerScriptRunTool = (server) => {
|
|
|
105424
105449
|
annotations: { openWorldHint: true },
|
|
105425
105450
|
inputSchema: object({
|
|
105426
105451
|
name: scriptNameSchema.optional().describe("Name of a reusable script to run."),
|
|
105427
|
-
source: string().min(1).optional().describe(
|
|
105452
|
+
source: string().min(1).optional().describe('Inline TypeScript source to run without a compile-time typecheck. Must `export default async function (args, ctx)` — args FIRST, ctx second. Import `ScriptContext` from "swarm-sdk" for promotion-safe typing.'),
|
|
105428
105453
|
args: unknown().optional().describe("JSON-serializable script arguments."),
|
|
105429
105454
|
intent: string().default("").describe("Why this script is being run."),
|
|
105430
105455
|
scope: scriptScopeSchema.optional().describe("Optional scope for named script resolution."),
|
|
@@ -105622,7 +105647,7 @@ var registerScriptSearchTool = (server) => {
|
|
|
105622
105647
|
|
|
105623
105648
|
// src/tools/script-upsert.ts
|
|
105624
105649
|
init_zod();
|
|
105625
|
-
var SCRIPT_UPSERT_DESCRIPTION =
|
|
105650
|
+
var SCRIPT_UPSERT_DESCRIPTION = 'Typecheck and persist a TypeScript script to the swarm catalog under your agent scope (or global if you\'re a lead). Import `ScriptContext` from "swarm-sdk" for a real context type. Other agents and workflow nodes will be able to find and run it. For local-only scripts, use code-mode `save`.';
|
|
105626
105651
|
var registerScriptUpsertTool = (server) => {
|
|
105627
105652
|
createToolRegistrar(server)("script-upsert", {
|
|
105628
105653
|
title: "Script Upsert",
|
|
@@ -105630,7 +105655,7 @@ var registerScriptUpsertTool = (server) => {
|
|
|
105630
105655
|
annotations: { openWorldHint: false },
|
|
105631
105656
|
inputSchema: object({
|
|
105632
105657
|
name: scriptNameSchema.describe("Stable script name within the selected scope."),
|
|
105633
|
-
source: string().min(1).describe(
|
|
105658
|
+
source: string().min(1).describe('TypeScript source, typechecked before saving. Must `export default async function (args, ctx)` — args FIRST, ctx second. Import `ScriptContext` from "swarm-sdk" to type `ctx`.'),
|
|
105634
105659
|
description: string().default("").describe("Human-readable script description."),
|
|
105635
105660
|
intent: string().default("").describe("Why this script exists."),
|
|
105636
105661
|
scope: scriptScopeSchema.default("agent").describe("Persist under agent or global scope."),
|
|
@@ -110234,6 +110259,28 @@ var registerGetWorkflowRunTool = (server) => {
|
|
|
110234
110259
|
init_zod();
|
|
110235
110260
|
init_db();
|
|
110236
110261
|
init_types();
|
|
110262
|
+
var DEFAULT_RUN_LIMIT = 20;
|
|
110263
|
+
var TRIGGER_DATA_SUMMARY_CAP = 400;
|
|
110264
|
+
function triggerDataSummary(triggerData) {
|
|
110265
|
+
if (triggerData === undefined || triggerData === null)
|
|
110266
|
+
return;
|
|
110267
|
+
const serialized = typeof triggerData === "string" ? triggerData : JSON.stringify(triggerData);
|
|
110268
|
+
if (!serialized)
|
|
110269
|
+
return;
|
|
110270
|
+
return serialized.length > TRIGGER_DATA_SUMMARY_CAP ? `${serialized.slice(0, TRIGGER_DATA_SUMMARY_CAP)}…` : serialized;
|
|
110271
|
+
}
|
|
110272
|
+
function slimRun(run) {
|
|
110273
|
+
return {
|
|
110274
|
+
id: run.id,
|
|
110275
|
+
workflowId: run.workflowId,
|
|
110276
|
+
status: run.status,
|
|
110277
|
+
error: run.error,
|
|
110278
|
+
startedAt: run.startedAt,
|
|
110279
|
+
finishedAt: run.finishedAt,
|
|
110280
|
+
lastUpdatedAt: run.lastUpdatedAt,
|
|
110281
|
+
triggerDataSummary: triggerDataSummary(run.triggerData)
|
|
110282
|
+
};
|
|
110283
|
+
}
|
|
110237
110284
|
function renderRuns(runs) {
|
|
110238
110285
|
if (runs.length === 0)
|
|
110239
110286
|
return;
|
|
@@ -110244,32 +110291,52 @@ function renderRuns(runs) {
|
|
|
110244
110291
|
}).join(`
|
|
110245
110292
|
`);
|
|
110246
110293
|
}
|
|
110294
|
+
var listWorkflowRunsInputSchema = exports_external.object({
|
|
110295
|
+
workflowId: exports_external.string().uuid().describe("Workflow ID to list runs for"),
|
|
110296
|
+
status: WorkflowRunStatusSchema.optional().describe("Filter by run status (running, waiting, completed, failed, skipped, cancelled)"),
|
|
110297
|
+
limit: exports_external.number().int().min(1).max(100).optional().default(20).describe("Runs per page (default: 20, max: 100)"),
|
|
110298
|
+
offset: exports_external.number().int().min(0).optional().default(0).describe("Zero-based page offset"),
|
|
110299
|
+
includeContext: exports_external.boolean().optional().default(false).describe("Return the full run `context` + trigger data instead of slim rows. Default false — prefer `get-workflow-run` to fetch a single run in full.")
|
|
110300
|
+
});
|
|
110301
|
+
function listWorkflowRunsHandler({
|
|
110302
|
+
workflowId,
|
|
110303
|
+
status,
|
|
110304
|
+
limit = DEFAULT_RUN_LIMIT,
|
|
110305
|
+
offset = 0,
|
|
110306
|
+
includeContext = false
|
|
110307
|
+
}) {
|
|
110308
|
+
try {
|
|
110309
|
+
const { runs, page } = listWorkflowRunsPage(workflowId, {
|
|
110310
|
+
status,
|
|
110311
|
+
limit,
|
|
110312
|
+
offset
|
|
110313
|
+
});
|
|
110314
|
+
const resultRuns = includeContext ? runs : runs.map(slimRun);
|
|
110315
|
+
return toolOk(`Found ${runs.length} run(s) at offset ${page.offset} (${page.total} total).`, {
|
|
110316
|
+
details: renderRuns(runs) ?? "No workflow runs matched this page.",
|
|
110317
|
+
data: { runs: resultRuns, page }
|
|
110318
|
+
});
|
|
110319
|
+
} catch (err) {
|
|
110320
|
+
return toolErr(String(err), { data: { runs: [] } });
|
|
110321
|
+
}
|
|
110322
|
+
}
|
|
110247
110323
|
var registerListWorkflowRunsTool = (server) => {
|
|
110248
110324
|
createToolRegistrar(server)("list-workflow-runs", {
|
|
110249
110325
|
title: "List Workflow Runs",
|
|
110250
110326
|
annotations: { destructiveHint: false },
|
|
110251
|
-
description: "List
|
|
110252
|
-
inputSchema:
|
|
110253
|
-
workflowId: exports_external.string().uuid().describe("Workflow ID to list runs for"),
|
|
110254
|
-
status: WorkflowRunStatusSchema.optional().describe("Filter by run status (running, waiting, completed, failed, skipped)")
|
|
110255
|
-
}),
|
|
110327
|
+
description: "List execution runs for a workflow with offset pagination (default 20, max 100), optionally filtered by status. Returns SLIM rows WITHOUT the full `context` or trigger data — each row carries a bounded `triggerDataSummary` instead. To inspect a run's context and steps, call `get-workflow-run` by id, or pass `includeContext: true` here.",
|
|
110328
|
+
inputSchema: listWorkflowRunsInputSchema,
|
|
110256
110329
|
outputSchema: swarmToolOutputSchema({
|
|
110257
|
-
runs: exports_external.array(exports_external.unknown()).optional()
|
|
110330
|
+
runs: exports_external.array(exports_external.unknown()).optional(),
|
|
110331
|
+
page: exports_external.looseObject({
|
|
110332
|
+
limit: exports_external.number().optional(),
|
|
110333
|
+
offset: exports_external.number().optional(),
|
|
110334
|
+
total: exports_external.number().optional(),
|
|
110335
|
+
hasMore: exports_external.boolean().optional(),
|
|
110336
|
+
nextOffset: exports_external.number().optional()
|
|
110337
|
+
}).optional()
|
|
110258
110338
|
})
|
|
110259
|
-
}, async (
|
|
110260
|
-
try {
|
|
110261
|
-
let runs = listWorkflowRuns(workflowId);
|
|
110262
|
-
if (status) {
|
|
110263
|
-
runs = runs.filter((r) => r.status === status);
|
|
110264
|
-
}
|
|
110265
|
-
return toolOk(`Found ${runs.length} run(s).`, {
|
|
110266
|
-
details: renderRuns(runs),
|
|
110267
|
-
data: { runs }
|
|
110268
|
-
});
|
|
110269
|
-
} catch (err) {
|
|
110270
|
-
return toolErr(String(err), { data: { runs: [] } });
|
|
110271
|
-
}
|
|
110272
|
-
});
|
|
110339
|
+
}, async (args) => listWorkflowRunsHandler(args));
|
|
110273
110340
|
};
|
|
110274
110341
|
// src/tools/workflows/list-workflows.ts
|
|
110275
110342
|
init_zod();
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
withSpan,
|
|
20
20
|
withSpanContext,
|
|
21
21
|
writeSkillsToFilesystem
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-x268say8.js";
|
|
23
23
|
import {
|
|
24
24
|
authJsonToCredentialSelection,
|
|
25
25
|
credentialsToAuthJson,
|
|
@@ -41,10 +41,10 @@ import {
|
|
|
41
41
|
import {
|
|
42
42
|
ensure,
|
|
43
43
|
initialize
|
|
44
|
-
} from "./cli-
|
|
44
|
+
} from "./cli-2yr6edr7.js";
|
|
45
45
|
import {
|
|
46
46
|
validateJsonSchema
|
|
47
|
-
} from "./cli-
|
|
47
|
+
} from "./cli-kk58tg33.js";
|
|
48
48
|
import {
|
|
49
49
|
getApiKey
|
|
50
50
|
} from "./cli-f14fvzag.js";
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
resolveTaskModelSelection,
|
|
86
86
|
resolveTemplateAsync,
|
|
87
87
|
telemetry
|
|
88
|
-
} from "./cli-
|
|
88
|
+
} from "./cli-3z4q09tn.js";
|
|
89
89
|
import {
|
|
90
90
|
init_credentials,
|
|
91
91
|
resolveCredentialPools
|
package/dist/cli.js
CHANGED
|
@@ -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.
|
|
68
|
+
version: "1.124.0",
|
|
69
69
|
description: "Multi-agent orchestration for Claude Code, Codex, Gemini CLI, and other AI coding assistants",
|
|
70
70
|
license: "MIT",
|
|
71
71
|
author: "desplega.sh <contact@desplega.sh>",
|
|
@@ -662,7 +662,7 @@ function McpServer({ port, apiKey, dbPath }) {
|
|
|
662
662
|
if (dbPath) {
|
|
663
663
|
process.env.DATABASE_PATH = dbPath;
|
|
664
664
|
}
|
|
665
|
-
import("./http-
|
|
665
|
+
import("./http-937pyjfc.js").then(() => {
|
|
666
666
|
setStatus("running");
|
|
667
667
|
}).catch((err) => {
|
|
668
668
|
setStatus("error");
|
|
@@ -748,7 +748,7 @@ function WorkerRunner({
|
|
|
748
748
|
}) {
|
|
749
749
|
const { exit } = use_app_default();
|
|
750
750
|
import_react.useEffect(() => {
|
|
751
|
-
import("./worker-
|
|
751
|
+
import("./worker-0p1jdzkm.js").then(({ runWorker }) => runWorker({
|
|
752
752
|
prompt: prompt || undefined,
|
|
753
753
|
yolo,
|
|
754
754
|
systemPrompt: systemPrompt || undefined,
|
|
@@ -765,7 +765,7 @@ function WorkerRunner({
|
|
|
765
765
|
function LeadRunner({ prompt, yolo, systemPrompt, systemPromptFile, additionalArgs }) {
|
|
766
766
|
const { exit } = use_app_default();
|
|
767
767
|
import_react.useEffect(() => {
|
|
768
|
-
import("./lead-
|
|
768
|
+
import("./lead-7w2k3a49.js").then(({ runLead }) => runLead({
|
|
769
769
|
prompt: prompt || undefined,
|
|
770
770
|
yolo,
|
|
771
771
|
systemPrompt: systemPrompt || undefined,
|
|
@@ -805,8 +805,8 @@ function LazyComponent({
|
|
|
805
805
|
}
|
|
806
806
|
return import_react.createElement(Component, props);
|
|
807
807
|
}
|
|
808
|
-
var loadOnboard = () => import("./onboard-
|
|
809
|
-
var loadConnect = () => import("./setup-
|
|
808
|
+
var loadOnboard = () => import("./onboard-py9dnf54.js").then(({ Onboard }) => Onboard);
|
|
809
|
+
var loadConnect = () => import("./setup-nzk3kbbq.js").then(({ Setup }) => Setup);
|
|
810
810
|
function UnknownCommand({ command }) {
|
|
811
811
|
const { exit } = use_app_default();
|
|
812
812
|
import_react.useEffect(() => {
|
|
@@ -919,7 +919,7 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
919
919
|
}
|
|
920
920
|
process.exit(0);
|
|
921
921
|
} else if (args.command === "hook") {
|
|
922
|
-
const { runHook } = await import("./hook-
|
|
922
|
+
const { runHook } = await import("./hook-2medrp47.js");
|
|
923
923
|
await runHook();
|
|
924
924
|
} else if (args.command === "artifact") {
|
|
925
925
|
const artifactArgs = process.argv.slice(process.argv.indexOf("artifact") + 1);
|
|
@@ -939,7 +939,7 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
939
939
|
printHelp("scripts");
|
|
940
940
|
process.exit(scriptsArgs[0] === "reembed" || args.showHelp ? 0 : 1);
|
|
941
941
|
}
|
|
942
|
-
const { runScriptsMaintenanceCommand } = await import("./maintenance-
|
|
942
|
+
const { runScriptsMaintenanceCommand } = await import("./maintenance-p3x918yw.js");
|
|
943
943
|
await runScriptsMaintenanceCommand(scriptsArgs);
|
|
944
944
|
console.log("Scripts re-embedded.");
|
|
945
945
|
} else if (args.command === "rbac") {
|
|
@@ -949,7 +949,7 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
949
949
|
printHelp("rbac");
|
|
950
950
|
process.exit(args.showHelp ? 0 : 1);
|
|
951
951
|
}
|
|
952
|
-
const { runRbacCliCommand } = await import("./rbac-roles-
|
|
952
|
+
const { runRbacCliCommand } = await import("./rbac-roles-5e72bbpk.js");
|
|
953
953
|
await runRbacCliCommand(rbacArgs);
|
|
954
954
|
} else if (args.command === "codex-login") {
|
|
955
955
|
const { runCodexLogin } = await import("./codex-login-0h18cy3e.js");
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
init_db,
|
|
5
5
|
init_env_flag,
|
|
6
6
|
isEnvFlagEnabled
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-3z4q09tn.js";
|
|
8
8
|
import"./cli-z2zcxes1.js";
|
|
9
|
-
import"./cli-
|
|
9
|
+
import"./cli-p0zgv8pj.js";
|
|
10
10
|
import"./cli-4j2mrzag.js";
|
|
11
11
|
import"./cli-bw80ck94.js";
|
|
12
12
|
import"./cli-xz9aq0rf.js";
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
countScriptRunJournalSteps,
|
|
34
34
|
countScriptRuns,
|
|
35
35
|
countSessions,
|
|
36
|
+
countWorkflowRuns,
|
|
36
37
|
createAgent,
|
|
37
38
|
createAgentMailInboxMapping,
|
|
38
39
|
createApprovalRequest,
|
|
@@ -316,6 +317,7 @@ import {
|
|
|
316
317
|
listTaskTemplates,
|
|
317
318
|
listUserFavorites,
|
|
318
319
|
listWorkflowRuns,
|
|
320
|
+
listWorkflowRunsPage,
|
|
319
321
|
listWorkflows,
|
|
320
322
|
logQueries,
|
|
321
323
|
markInboxMessageDelegated,
|
|
@@ -409,9 +411,9 @@ import {
|
|
|
409
411
|
upsertSkillFiles,
|
|
410
412
|
upsertSwarmConfig,
|
|
411
413
|
withFavoriteFlags
|
|
412
|
-
} from "./cli-
|
|
414
|
+
} from "./cli-3z4q09tn.js";
|
|
413
415
|
import"./cli-z2zcxes1.js";
|
|
414
|
-
import"./cli-
|
|
416
|
+
import"./cli-p0zgv8pj.js";
|
|
415
417
|
import"./cli-4j2mrzag.js";
|
|
416
418
|
import"./cli-bw80ck94.js";
|
|
417
419
|
import"./cli-xz9aq0rf.js";
|
|
@@ -512,6 +514,7 @@ export {
|
|
|
512
514
|
markInboxMessageDelegated,
|
|
513
515
|
logQueries,
|
|
514
516
|
listWorkflows,
|
|
517
|
+
listWorkflowRunsPage,
|
|
515
518
|
listWorkflowRuns,
|
|
516
519
|
listUserFavorites,
|
|
517
520
|
listTaskTemplates,
|
|
@@ -794,6 +797,7 @@ export {
|
|
|
794
797
|
createApprovalRequest,
|
|
795
798
|
createAgentMailInboxMapping,
|
|
796
799
|
createAgent,
|
|
800
|
+
countWorkflowRuns,
|
|
797
801
|
countSessions,
|
|
798
802
|
countScriptRuns,
|
|
799
803
|
countScriptRunJournalSteps,
|