@desplega.ai/agent-swarm 1.120.0 → 1.121.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 -2
- package/dist/{actions-rym7jyg2.js → actions-mwshtkf7.js} +6 -6
- package/dist/{anthropic-messages-qjxzsabf.js → anthropic-messages-4gn944cn.js} +29 -13
- package/dist/{app-ss3a0nfj.js → app-skbty91x.js} +4 -4
- package/dist/{assistant-8sd2b21b.js → assistant-tg7dhfj8.js} +13 -13
- package/dist/{azure-openai-responses-ntfd05zd.js → azure-openai-responses-79zc0wyy.js} +28 -13
- package/dist/{boot-reembed-eh18r04f.js → boot-reembed-ntjmeyh2.js} +4 -4
- package/dist/{boot-reembed-7bs0d0sj.js → boot-reembed-q5x0xpcp.js} +5 -5
- package/dist/{boot-scrub-logs-v8ch000n.js → boot-scrub-logs-5gznsfbe.js} +4 -4
- package/dist/{claude-adapter-9n3nzt65.js → claude-adapter-vxvcym3r.js} +3 -3
- package/dist/{claude-managed-adapter-pv2nbqy4.js → claude-managed-adapter-g807894s.js} +2 -2
- package/dist/{cli-py8z9bjq.js → cli-072t49hf.js} +9 -9
- package/dist/{cli-383wyw2f.js → cli-0df2g86x.js} +61 -17
- package/dist/{cli-84j2vp67.js → cli-1728qh70.js} +1 -1
- package/dist/{cli-kyqs14qe.js → cli-3b1ayz83.js} +5 -5
- package/dist/{cli-0ap79nha.js → cli-3fxqwfh3.js} +1 -1
- package/dist/{cli-w6rhc30s.js → cli-3jrdwnn9.js} +20 -5
- package/dist/{cli-gq12jc1m.js → cli-46etyprn.js} +7 -5
- package/dist/{cli-j59bj3vs.js → cli-4pfweq4x.js} +8 -8
- package/dist/{cli-2r7s8jhp.js → cli-5c4327dx.js} +7 -1
- package/dist/{cli-4cb3p8pj.js → cli-5hpvd15x.js} +2 -2
- package/dist/{cli-branks1w.js → cli-6s3ytc5x.js} +1 -1
- package/dist/{cli-da3x3btq.js → cli-7pt9sc83.js} +2 -2
- package/dist/{cli-n745f8e5.js → cli-7pzae66m.js} +1 -1
- package/dist/{cli-qs7nb3zn.js → cli-8wrympd7.js} +27 -1
- package/dist/{cli-zxnp21rf.js → cli-95rbe11h.js} +13 -13
- package/dist/{cli-v65h59hn.js → cli-agdrxyex.js} +1 -1
- package/dist/{cli-wr706gez.js → cli-av2s7my4.js} +167 -66
- package/dist/{cli-t91zbm2s.js → cli-avw9ev3x.js} +55 -21
- package/dist/{cli-shdvvj0n.js → cli-b2mqkg1h.js} +2 -2
- package/dist/{cli-1arw00dp.js → cli-ccjwgarc.js} +12 -3
- package/dist/{cli-pscrc6tw.js → cli-ch7t5v7n.js} +5 -0
- package/dist/{cli-tghre7g6.js → cli-cw70hymf.js} +1 -0
- package/dist/{cli-n61x2aph.js → cli-dmzv0986.js} +816 -1335
- package/dist/{cli-0kkggfr9.js → cli-g9vva2qh.js} +2 -2
- package/dist/{cli-dnx98dwa.js → cli-gdpx70nc.js} +38185 -38141
- package/dist/{cli-vmhqfnp1.js → cli-ghq3v4c9.js} +2 -2
- package/dist/{cli-w5em21am.js → cli-ky8esb8t.js} +3 -3
- package/dist/{cli-f6c6y7fw.js → cli-nf7sadev.js} +2 -2
- package/dist/{cli-zxeb2qe3.js → cli-p9w7kb3h.js} +1 -1
- package/dist/{cli-xeatwfbe.js → cli-ry656xem.js} +24 -17
- package/dist/{cli-th08nm8p.js → cli-s8bdcke2.js} +1 -1
- package/dist/cli-s8s499xy.js +81 -0
- package/dist/{cli-d2eyq90a.js → cli-srjqn7fd.js} +1 -1
- package/dist/{cli-gad984jj.js → cli-tv7vekye.js} +1 -1
- package/dist/{cli-kyfx7z3d.js → cli-vg3zrw6h.js} +4 -4
- package/dist/{cli-sbh0b9r1.js → cli-vp9r4ap4.js} +5 -4
- package/dist/{cli-mg280wsv.js → cli-we156bmz.js} +1 -1
- package/dist/{cli-e0y603nn.js → cli-x0e0yvnq.js} +101 -1
- package/dist/{cli-mw3xpgwb.js → cli-x4apc9t3.js} +4 -4
- package/dist/cli.js +23 -21
- package/dist/{codex-adapter-6j2b38tg.js → codex-adapter-mmy741zd.js} +8 -9
- package/dist/{codex-session-runner-vz215wgw.js → codex-session-runner-sazmx9zt.js} +8 -9
- package/dist/{commands-w1swgcgg.js → commands-cxxye5e4.js} +3 -3
- package/dist/{db-yv6y0fxw.js → db-ab1954b7.js} +5 -3
- package/dist/{google-generative-ai-n1d3xt4n.js → google-generative-ai-wwa2ked5.js} +14 -18
- package/dist/{google-vertex-mxst23gy.js → google-vertex-71xmdd7n.js} +14 -18
- package/dist/{handlers-yjyafdwk.js → handlers-fmfe2343.js} +13 -13
- package/dist/{hook-6nvc6p19.js → hook-ygnw3cvt.js} +7 -8
- package/dist/{http-g6j8rc6h.js → http-kactcc0z.js} +142 -64
- package/dist/{index-b2rarbkn.js → index-6erq0wvk.js} +11 -11
- package/dist/{index-7betnvg6.js → index-g86j2yt5.js} +9 -9
- package/dist/{index-64th6eqs.js → index-gmzs6a2q.js} +10 -10
- package/dist/{index-cbknx39k.js → index-hmp82wn0.js} +12 -12
- package/dist/{keepalive-j8c99r3m.js → keepalive-3cvt26dw.js} +6 -6
- package/dist/{lead-8xe71m3s.js → lead-ysf26cjr.js} +30 -31
- package/dist/{maintenance-eqnmrwb2.js → maintenance-9npwptbb.js} +5 -5
- package/dist/{mistral-conversations-ykcg66za.js → mistral-conversations-26ya4yah.js} +17 -13
- package/dist/{oauth-refresh-sweep-c5dy1653.js → oauth-refresh-sweep-0r2v76vw.js} +6 -6
- package/dist/{onboard-4avg01c1.js → onboard-ddb1674a.js} +2 -2
- package/dist/{openai-codex-responses-zy0907j9.js → openai-codex-responses-6rr2ye0s.js} +78 -38
- package/dist/{openai-completions-xk4p56n9.js → openai-completions-zfa9nkvt.js} +130 -33
- package/dist/{openai-responses-4gv3ca5d.js → openai-responses-9wmdks0g.js} +38 -14
- package/dist/{opencode-adapter-5bwzvbwj.js → opencode-adapter-h6rkxwrk.js} +2 -2
- package/dist/{openrouter-images-4fsrrzes.js → openrouter-images-dgq98729.js} +10 -3
- package/dist/{otel-impl-z4cwkp40.js → otel-impl-b43bkq8e.js} +4 -4
- package/dist/{pi-messages-zb8v76wx.js → pi-messages-nzjbbz47.js} +4 -6
- package/dist/{pi-mono-adapter-9sg69kg3.js → pi-mono-adapter-ke789738.js} +2328 -1281
- package/dist/{pricing-refresh-dts9429d.js → pricing-refresh-2rqf114z.js} +5 -5
- package/dist/{rbac-roles-4f64wch6.js → rbac-roles-5wkhc8xv.js} +4 -4
- package/dist/{rbac-roles-24cvsejy.js → rbac-roles-6vtafvzb.js} +3 -3
- package/dist/{seed-pricing-74ph9wap.js → seed-pricing-23wrb873.js} +4 -4
- package/dist/{setup-9q0n8rvd.js → setup-6rny4fk6.js} +2 -2
- package/dist/{worker-x7g344z8.js → worker-yapewe14.js} +30 -31
- package/openapi.json +169 -85
- package/package.json +7 -5
- package/plugin/commands/swarm-chat.md +2 -0
- package/plugin/pi-skills/swarm-chat/SKILL.md +2 -0
- package/src/be/db.ts +61 -5
- package/src/be/migrations/119_agent_avatar.sql +7 -0
- package/src/be/migrations/120_task_title.sql +3 -0
- package/src/be/scripts/typecheck.ts +3 -2
- package/src/be/seed-capabilities.ts +62 -0
- package/src/be/seed-pricing.ts +1 -1
- package/src/be/seed-scripts/catalog/ops-catalog-audit.inline.ts +1 -1
- package/src/be/seed-scripts/catalog/ops-catalog-audit.ts +1 -1
- package/src/commands/runner.ts +69 -6
- package/src/http/agents.ts +23 -5
- package/src/http/core.ts +8 -5
- package/src/http/index.ts +11 -0
- package/src/http/mcp-bridge.ts +5 -2
- package/src/http/poll.ts +5 -1
- package/src/http/sessions.ts +1 -1
- package/src/http/tasks.ts +35 -0
- package/src/prompts/base-prompt.ts +48 -4
- package/src/prompts/session-templates.ts +13 -1
- package/src/providers/claude-managed-models.ts +8 -0
- package/src/scripts-runtime/types/stdlib.d.ts +11 -0
- package/src/server.ts +230 -126
- package/src/tests/agent-avatar-resolution.test.ts +123 -0
- package/src/tests/agents-list-model-display.test.ts +10 -0
- package/src/tests/base-prompt.test.ts +72 -0
- package/src/tests/claude-managed-adapter.test.ts +6 -0
- package/src/tests/context-window.test.ts +1 -0
- package/src/tests/list-endpoint-slimming.test.ts +45 -0
- package/src/tests/prompt-template-session.test.ts +6 -5
- package/src/tests/script-connections.test.ts +1 -0
- package/src/tests/sdk-allowlist.test.ts +4 -1
- package/src/tests/seed-capabilities.test.ts +92 -0
- package/src/tests/session-costs-model-key-normalize.test.ts +1 -0
- package/src/tests/sessions.test.ts +46 -0
- package/src/tests/task-title-route.test.ts +106 -0
- package/src/tests/tool-annotations.test.ts +6 -3
- package/src/tools/update-profile.ts +15 -5
- package/src/types.ts +29 -0
- package/src/utils/context-window.ts +1 -0
- package/dist/cli-z9gzq07x.js +0 -27
- package/dist/{otel-g299k41b.js → otel-63jr5v38.js} +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDb,
|
|
3
3
|
init_db
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-0df2g86x.js";
|
|
5
5
|
|
|
6
6
|
// src/be/seed-pricing.ts
|
|
7
7
|
init_db();
|
|
@@ -72,7 +72,7 @@ var MANUAL_PRICING_OVERRIDES = [
|
|
|
72
72
|
var ANTHROPIC_SHORTNAME_TO_MODELSDEV = {
|
|
73
73
|
fable: "claude-fable-5",
|
|
74
74
|
mythos: "claude-mythos-5",
|
|
75
|
-
opus: "claude-opus-
|
|
75
|
+
opus: "claude-opus-5",
|
|
76
76
|
sonnet: "claude-sonnet-5",
|
|
77
77
|
haiku: "claude-haiku-4-5"
|
|
78
78
|
};
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
getPinCandidateAgent,
|
|
8
8
|
getResumeGeneration,
|
|
9
9
|
repointTrackerSyncBySwarmId
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-agdrxyex.js";
|
|
11
11
|
import {
|
|
12
12
|
getExecutorRegistry,
|
|
13
13
|
recoverIncompleteRuns
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-95rbe11h.js";
|
|
15
15
|
import {
|
|
16
16
|
MAX_EMPTY_POLLS,
|
|
17
17
|
assignUnassignedTaskPending,
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
resolveTemplate,
|
|
52
52
|
supersedeTask,
|
|
53
53
|
updateAgentStatus
|
|
54
|
-
} from "./cli-
|
|
54
|
+
} from "./cli-0df2g86x.js";
|
|
55
55
|
|
|
56
56
|
// src/heartbeat/heartbeat.ts
|
|
57
57
|
init_db();
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
linkIdentity,
|
|
5
5
|
recordUnmappedIdentity,
|
|
6
6
|
resolveIdentity
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-srjqn7fd.js";
|
|
8
8
|
import {
|
|
9
9
|
getKv,
|
|
10
10
|
init_db,
|
|
11
11
|
upsertKv
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-0df2g86x.js";
|
|
13
13
|
|
|
14
14
|
// src/slack/enrich.ts
|
|
15
15
|
init_db();
|
|
@@ -17,14 +17,15 @@ import {
|
|
|
17
17
|
} from "./cli-4wgngmwv.js";
|
|
18
18
|
import {
|
|
19
19
|
normalizeProviderError
|
|
20
|
-
} from "./cli-
|
|
20
|
+
} from "./cli-ch7t5v7n.js";
|
|
21
21
|
import {
|
|
22
22
|
adjustMaxTokensForThinking,
|
|
23
23
|
buildBaseOptions,
|
|
24
24
|
clampMaxTokensToContext,
|
|
25
25
|
clampReasoning,
|
|
26
|
+
resolveJsonSchemaStrictSampling,
|
|
26
27
|
transformMessages
|
|
27
|
-
} from "./cli-
|
|
28
|
+
} from "./cli-x0e0yvnq.js";
|
|
28
29
|
import {
|
|
29
30
|
sanitizeSurrogates
|
|
30
31
|
} from "./cli-y2apkfe2.js";
|
|
@@ -33,10 +34,10 @@ import {
|
|
|
33
34
|
} from "./cli-vapyk8sw.js";
|
|
34
35
|
import {
|
|
35
36
|
calculateCost
|
|
36
|
-
} from "./cli-
|
|
37
|
+
} from "./cli-ccjwgarc.js";
|
|
37
38
|
import {
|
|
38
39
|
AssistantMessageEventStream
|
|
39
|
-
} from "./cli-
|
|
40
|
+
} from "./cli-8wrympd7.js";
|
|
40
41
|
import {
|
|
41
42
|
require_supports_color
|
|
42
43
|
} from "./cli-7wmybrt5.js";
|
|
@@ -5199,7 +5200,7 @@ var stream = (model, context, options = {}) => {
|
|
|
5199
5200
|
...inferenceMaxTokens !== undefined && { maxTokens: inferenceMaxTokens },
|
|
5200
5201
|
...options.temperature !== undefined && { temperature: options.temperature }
|
|
5201
5202
|
},
|
|
5202
|
-
toolConfig: convertToolConfig(context.tools, options.toolChoice),
|
|
5203
|
+
toolConfig: convertToolConfig(context.tools, options.toolChoice, model.compat?.supportsStrictMode ?? false),
|
|
5203
5204
|
additionalModelRequestFields: buildAdditionalModelRequestFields(model, options),
|
|
5204
5205
|
...options.requestMetadata !== undefined && { requestMetadata: options.requestMetadata }
|
|
5205
5206
|
};
|
|
@@ -5440,11 +5441,11 @@ function getModelMatchCandidates(modelId, modelName) {
|
|
|
5440
5441
|
}
|
|
5441
5442
|
function supportsAdaptiveThinking(modelId, modelName) {
|
|
5442
5443
|
const candidates = getModelMatchCandidates(modelId, modelName);
|
|
5443
|
-
return candidates.some((s) => s.includes("opus-4-6") || s.includes("opus-4-7") || s.includes("opus-4-8") || s.includes("sonnet-4-6") || s.includes("sonnet-5") || s.includes("fable-5"));
|
|
5444
|
+
return candidates.some((s) => s.includes("opus-4-6") || s.includes("opus-4-7") || s.includes("opus-4-8") || s.includes("opus-5") || s.includes("sonnet-4-6") || s.includes("sonnet-5") || s.includes("fable-5"));
|
|
5444
5445
|
}
|
|
5445
5446
|
function supportsNativeXhighEffort(model) {
|
|
5446
5447
|
const candidates = getModelMatchCandidates(model.id, model.name);
|
|
5447
|
-
return candidates.some((s) => s.includes("opus-4-7") || s.includes("opus-4-8") || s.includes("sonnet-5") || s.includes("fable-5"));
|
|
5448
|
+
return candidates.some((s) => s.includes("opus-4-7") || s.includes("opus-4-8") || s.includes("opus-5") || s.includes("sonnet-5") || s.includes("fable-5"));
|
|
5448
5449
|
}
|
|
5449
5450
|
function mapThinkingLevelToEffort(model, level) {
|
|
5450
5451
|
if (level === "xhigh" && supportsNativeXhighEffort(model))
|
|
@@ -5486,7 +5487,7 @@ function supportsPromptCaching(model, env) {
|
|
|
5486
5487
|
return true;
|
|
5487
5488
|
return false;
|
|
5488
5489
|
}
|
|
5489
|
-
if (candidates.some((s) => s.includes("fable-5") || s.includes("sonnet-5")))
|
|
5490
|
+
if (candidates.some((s) => s.includes("fable-5") || s.includes("opus-5") || s.includes("sonnet-5")))
|
|
5490
5491
|
return true;
|
|
5491
5492
|
if (candidates.some((s) => s.includes("-4-")))
|
|
5492
5493
|
return true;
|
|
@@ -5674,16 +5675,22 @@ function convertMessages(context, model, cacheRetention, env) {
|
|
|
5674
5675
|
}
|
|
5675
5676
|
return result;
|
|
5676
5677
|
}
|
|
5677
|
-
function convertToolConfig(tools, toolChoice) {
|
|
5678
|
-
if (!tools?.length
|
|
5678
|
+
function convertToolConfig(tools, toolChoice, supportsStrictMode) {
|
|
5679
|
+
if (!tools?.length)
|
|
5679
5680
|
return;
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5681
|
+
if (toolChoice === "none")
|
|
5682
|
+
return;
|
|
5683
|
+
const bedrockTools = tools.map((tool) => {
|
|
5684
|
+
const strict = resolveJsonSchemaStrictSampling(tool, supportsStrictMode);
|
|
5685
|
+
return {
|
|
5686
|
+
toolSpec: {
|
|
5687
|
+
name: tool.name,
|
|
5688
|
+
description: tool.description,
|
|
5689
|
+
inputSchema: { json: tool.parameters },
|
|
5690
|
+
...strict === true ? { strict: true } : {}
|
|
5691
|
+
}
|
|
5692
|
+
};
|
|
5693
|
+
});
|
|
5687
5694
|
let bedrockToolChoice;
|
|
5688
5695
|
switch (toolChoice) {
|
|
5689
5696
|
case "auto":
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js
|
|
2
|
+
var DEFAULT_MAX_RETRY_DELAY_MS = 60000;
|
|
3
|
+
function isProviderError(error) {
|
|
4
|
+
if (!(error instanceof Error) || !("status" in error) || !("headers" in error))
|
|
5
|
+
return false;
|
|
6
|
+
return (error.status === undefined || typeof error.status === "number") && (error.headers === undefined || error.headers instanceof Headers);
|
|
7
|
+
}
|
|
8
|
+
function isRetryableProviderError(error) {
|
|
9
|
+
const shouldRetry = error.headers?.get("x-should-retry");
|
|
10
|
+
if (shouldRetry === "true")
|
|
11
|
+
return true;
|
|
12
|
+
if (shouldRetry === "false")
|
|
13
|
+
return false;
|
|
14
|
+
if (error.status === undefined)
|
|
15
|
+
return true;
|
|
16
|
+
return error.status === 408 || error.status === 409 || error.status === 429 || typeof error.status === "number" && error.status >= 500;
|
|
17
|
+
}
|
|
18
|
+
function validateServerRetryDelayMs(delayMs, maxRetryDelayMs, providerErrorMessage) {
|
|
19
|
+
const maxDelayMs = maxRetryDelayMs ?? DEFAULT_MAX_RETRY_DELAY_MS;
|
|
20
|
+
if (maxDelayMs > 0 && delayMs > maxDelayMs) {
|
|
21
|
+
throw new Error(`Server requested ${Math.ceil(delayMs / 1000)}s retry delay (max: ${Math.ceil(maxDelayMs / 1000)}s). ${providerErrorMessage}`);
|
|
22
|
+
}
|
|
23
|
+
return delayMs;
|
|
24
|
+
}
|
|
25
|
+
function getRetryDelayMs(error, retryIndex, maxRetryDelayMs) {
|
|
26
|
+
const retryAfterMs = error.headers?.get("retry-after-ms");
|
|
27
|
+
if (retryAfterMs) {
|
|
28
|
+
const value = Number.parseFloat(retryAfterMs);
|
|
29
|
+
if (!Number.isNaN(value))
|
|
30
|
+
return validateServerRetryDelayMs(value, maxRetryDelayMs, error.message);
|
|
31
|
+
}
|
|
32
|
+
const retryAfter = error.headers?.get("retry-after");
|
|
33
|
+
if (retryAfter) {
|
|
34
|
+
const seconds = Number.parseFloat(retryAfter);
|
|
35
|
+
const delayMs = Number.isNaN(seconds) ? Date.parse(retryAfter) - Date.now() : seconds * 1000;
|
|
36
|
+
return validateServerRetryDelayMs(delayMs, maxRetryDelayMs, error.message);
|
|
37
|
+
}
|
|
38
|
+
const exponentialDelay = Math.min(0.5 * 2 ** retryIndex, 8) * 1000;
|
|
39
|
+
return exponentialDelay * (1 - Math.random() * 0.25);
|
|
40
|
+
}
|
|
41
|
+
function createAbortError() {
|
|
42
|
+
const error = new Error("Request aborted");
|
|
43
|
+
error.name = "AbortError";
|
|
44
|
+
return error;
|
|
45
|
+
}
|
|
46
|
+
function abortableSleep(ms, signal) {
|
|
47
|
+
return new Promise((resolve, reject) => {
|
|
48
|
+
if (signal?.aborted) {
|
|
49
|
+
reject(createAbortError());
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const onAbort = () => {
|
|
53
|
+
clearTimeout(timeout);
|
|
54
|
+
reject(createAbortError());
|
|
55
|
+
};
|
|
56
|
+
const timeout = setTimeout(() => {
|
|
57
|
+
signal?.removeEventListener("abort", onAbort);
|
|
58
|
+
resolve();
|
|
59
|
+
}, Math.max(0, ms));
|
|
60
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
async function retryProviderRequest(request, options = {}) {
|
|
64
|
+
const maxRetries = options.maxRetries ?? 0;
|
|
65
|
+
let retriesRemaining = maxRetries;
|
|
66
|
+
for (;; ) {
|
|
67
|
+
try {
|
|
68
|
+
return await request();
|
|
69
|
+
} catch (error) {
|
|
70
|
+
if (options.signal?.aborted)
|
|
71
|
+
throw createAbortError();
|
|
72
|
+
if (retriesRemaining <= 0 || !isProviderError(error) || !isRetryableProviderError(error))
|
|
73
|
+
throw error;
|
|
74
|
+
const retryIndex = maxRetries - retriesRemaining;
|
|
75
|
+
retriesRemaining--;
|
|
76
|
+
await abortableSleep(getRetryDelayMs(error, retryIndex, options.maxRetryDelayMs), options.signal);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export { retryProviderRequest };
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
handleScheduleTrigger,
|
|
5
5
|
runScript,
|
|
6
6
|
startWorkflowExecution
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-95rbe11h.js";
|
|
8
8
|
import {
|
|
9
9
|
getScript,
|
|
10
10
|
getScriptApiConnectionDescriptors,
|
|
11
11
|
getScriptMcpConnectionDescriptors
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-072t49hf.js";
|
|
13
13
|
import {
|
|
14
14
|
createTaskWithSiblingAwareness
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-s8bdcke2.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-0df2g86x.js";
|
|
28
28
|
import {
|
|
29
29
|
__commonJS,
|
|
30
30
|
__require,
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
getScriptApiTypes,
|
|
3
3
|
getScriptMcpTypes,
|
|
4
4
|
require_typescript
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-072t49hf.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-0df2g86x.js";
|
|
15
15
|
import {
|
|
16
16
|
init_secret_scrubber,
|
|
17
17
|
scrubSecrets
|
|
@@ -431,7 +431,7 @@ export interface SwarmSdk {
|
|
|
431
431
|
// --- repos ---
|
|
432
432
|
repo_list(args?: Record<string, unknown>): Promise<unknown>;
|
|
433
433
|
// --- schedules ---
|
|
434
|
-
schedule_list(args?:
|
|
434
|
+
schedule_list(args?: { enabled?: boolean; name?: string; scheduleType?: "recurring" | "one_time"; targetType?: "agent-task" | "workflow" | "script"; workflowId?: string; scriptName?: string; hideCompleted?: boolean; consecutiveErrorsMin?: number; lastRunStatus?: "failed" | "succeeded" }): Promise<unknown>;
|
|
435
435
|
// --- scripts ---
|
|
436
436
|
script_search(args: { query?: string; scope?: ScriptScope; limit?: number }): Promise<unknown>;
|
|
437
437
|
script_run(args: { name?: string; source?: string; args?: unknown; intent?: string; scope?: ScriptScope; fsMode?: ScriptFsMode; idempotencyKey?: string }): Promise<unknown>;
|
|
@@ -455,7 +455,7 @@ export interface SwarmSdk {
|
|
|
455
455
|
context_history(args?: { agentId?: string; field?: "soulMd" | "identityMd" | "toolsMd" | "claudeMd" | "setupScript"; limit?: number }): Promise<unknown>;
|
|
456
456
|
context_diff(args: { versionId: string; compareToVersionId?: string }): Promise<unknown>;
|
|
457
457
|
// --- workflows ---
|
|
458
|
-
workflow_list(args?: { enabled?: boolean; includeFull?: boolean }): Promise<unknown>;
|
|
458
|
+
workflow_list(args?: { enabled?: boolean; includeFull?: boolean; consecutiveErrorsMin?: number; lastRunStatus?: "running" | "waiting" | "completed" | "failed" | "skipped" | "cancelled" }): Promise<unknown>;
|
|
459
459
|
workflow_get(args: { id: string }): Promise<unknown>;
|
|
460
460
|
workflow_listRuns(args: { workflowId: string; status?: "running" | "waiting" | "completed" | "failed" | "skipped" | "cancelled" }): Promise<unknown>;
|
|
461
461
|
workflow_getRun(args: { id: string }): Promise<unknown>;
|
|
@@ -516,6 +516,7 @@ export interface SwarmSdk {
|
|
|
516
516
|
// --- write: schedules ---
|
|
517
517
|
schedule_create(args: Record<string, unknown>): Promise<unknown>;
|
|
518
518
|
schedule_update(args: Record<string, unknown>): Promise<unknown>;
|
|
519
|
+
schedule_patch(args: Record<string, unknown>): Promise<unknown>;
|
|
519
520
|
schedule_delete(args: { id: string }): Promise<unknown>;
|
|
520
521
|
schedule_runNow(args: { id: string }): Promise<unknown>;
|
|
521
522
|
|
|
@@ -1,3 +1,103 @@
|
|
|
1
|
+
// node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js
|
|
2
|
+
function getGrammarToolInput(toolName, arguments_, inputProperty) {
|
|
3
|
+
const input = arguments_[inputProperty];
|
|
4
|
+
if (typeof input !== "string") {
|
|
5
|
+
throw new Error(`Grammar tool call "${toolName}" requires argument "${inputProperty}" to be a string.`);
|
|
6
|
+
}
|
|
7
|
+
return input;
|
|
8
|
+
}
|
|
9
|
+
function appendGrammarToolInputJsonDelta(buffer, inputProperty, nextInput, close) {
|
|
10
|
+
if (buffer.closed) {
|
|
11
|
+
if (close && nextInput === buffer.input)
|
|
12
|
+
return;
|
|
13
|
+
throw new Error(`grammar tool input for property "${inputProperty}" changed after it was closed`);
|
|
14
|
+
}
|
|
15
|
+
if (!nextInput.startsWith(buffer.input)) {
|
|
16
|
+
throw new Error(`grammar tool input for property "${inputProperty}" changed non-monotonically`);
|
|
17
|
+
}
|
|
18
|
+
const inputDelta = nextInput.slice(buffer.input.length);
|
|
19
|
+
if (!close && inputDelta.length === 0)
|
|
20
|
+
return;
|
|
21
|
+
let delta = "";
|
|
22
|
+
if (!buffer.started) {
|
|
23
|
+
delta += `{${JSON.stringify(inputProperty)}:"`;
|
|
24
|
+
buffer.started = true;
|
|
25
|
+
}
|
|
26
|
+
delta += JSON.stringify(inputDelta).slice(1, -1);
|
|
27
|
+
buffer.input = nextInput;
|
|
28
|
+
if (close) {
|
|
29
|
+
delta += '"}';
|
|
30
|
+
buffer.closed = true;
|
|
31
|
+
}
|
|
32
|
+
return delta;
|
|
33
|
+
}
|
|
34
|
+
function inferGrammarInputProperty(tool) {
|
|
35
|
+
const schema = tool.parameters;
|
|
36
|
+
if (schema.type !== "object") {
|
|
37
|
+
throw new Error("grammar constrained sampling requires an object parameter schema");
|
|
38
|
+
}
|
|
39
|
+
if (!Array.isArray(schema.required) || schema.required.length !== 1 || typeof schema.required[0] !== "string") {
|
|
40
|
+
throw new Error("grammar constrained sampling requires exactly one required string property");
|
|
41
|
+
}
|
|
42
|
+
const inputProperty = schema.required[0];
|
|
43
|
+
if (!schema.properties?.[inputProperty]) {
|
|
44
|
+
throw new Error(`grammar constrained sampling requires a properties entry for ${inputProperty}`);
|
|
45
|
+
}
|
|
46
|
+
if (schema.properties[inputProperty]?.type !== "string") {
|
|
47
|
+
throw new Error(`grammar constrained sampling property ${inputProperty} must have type string`);
|
|
48
|
+
}
|
|
49
|
+
return inputProperty;
|
|
50
|
+
}
|
|
51
|
+
function resolveJsonSchemaStrictSampling(tool, supportsStrictMode) {
|
|
52
|
+
const config = tool.constrainedSampling;
|
|
53
|
+
if (!config || config.type !== "json_schema") {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (supportsStrictMode) {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
if (config.strict === "require") {
|
|
60
|
+
throw new Error(`Tool "${tool.name}" requires JSON-schema constrained sampling, but strict tools are unsupported.`);
|
|
61
|
+
}
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
function resolveGrammarConstrainedSampling(tool, supportsOpenAIGrammarTools) {
|
|
65
|
+
const config = tool.constrainedSampling;
|
|
66
|
+
if (!config || config.type !== "grammar") {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (!supportsOpenAIGrammarTools) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const larkDefinition = config.variants.openai_lark;
|
|
73
|
+
const regexDefinition = config.variants.openai_regex;
|
|
74
|
+
const hasLarkDefinition = typeof larkDefinition === "string" && larkDefinition.trim().length > 0;
|
|
75
|
+
const hasRegexDefinition = typeof regexDefinition === "string" && regexDefinition.trim().length > 0;
|
|
76
|
+
if (!hasLarkDefinition && !hasRegexDefinition) {
|
|
77
|
+
throw new Error(`Tool "${tool.name}" cannot use grammar constrained sampling: no supported grammar variant was provided.`);
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
return {
|
|
81
|
+
format: hasLarkDefinition ? "lark" : "regex",
|
|
82
|
+
definition: hasLarkDefinition ? larkDefinition : regexDefinition,
|
|
83
|
+
inputProperty: inferGrammarInputProperty(tool)
|
|
84
|
+
};
|
|
85
|
+
} catch (error) {
|
|
86
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
87
|
+
throw new Error(`Tool "${tool.name}" cannot use grammar constrained sampling: ${message}.`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function createGrammarToolInputProperties(tools, supportsOpenAIGrammarTools) {
|
|
91
|
+
const properties = new Map;
|
|
92
|
+
for (const tool of tools ?? []) {
|
|
93
|
+
const grammar = resolveGrammarConstrainedSampling(tool, supportsOpenAIGrammarTools);
|
|
94
|
+
if (grammar) {
|
|
95
|
+
properties.set(tool.name, grammar.inputProperty);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return properties;
|
|
99
|
+
}
|
|
100
|
+
|
|
1
101
|
// node_modules/@earendil-works/pi-ai/dist/utils/estimate.js
|
|
2
102
|
var CHARS_PER_TOKEN = 4;
|
|
3
103
|
var ESTIMATED_IMAGE_CHARS = 4800;
|
|
@@ -309,4 +409,4 @@ function transformMessages(messages, model, normalizeToolCallId) {
|
|
|
309
409
|
return result;
|
|
310
410
|
}
|
|
311
411
|
|
|
312
|
-
export { clampMaxTokensToContext, buildBaseOptions, clampReasoning, adjustMaxTokensForThinking, transformMessages };
|
|
412
|
+
export { getGrammarToolInput, appendGrammarToolInputJsonDelta, resolveJsonSchemaStrictSampling, resolveGrammarConstrainedSampling, createGrammarToolInputProperties, clampMaxTokensToContext, buildBaseOptions, clampReasoning, adjustMaxTokensForThinking, transformMessages };
|
|
@@ -16,10 +16,13 @@ import {
|
|
|
16
16
|
clampContextPercent,
|
|
17
17
|
computeContextUsedUnified,
|
|
18
18
|
getContextWindowSize
|
|
19
|
-
} from "./cli-
|
|
19
|
+
} from "./cli-cw70hymf.js";
|
|
20
20
|
import {
|
|
21
21
|
applyReasoningEffort
|
|
22
22
|
} from "./cli-e61fs2hp.js";
|
|
23
|
+
import {
|
|
24
|
+
require_src
|
|
25
|
+
} from "./cli-7zd05xb4.js";
|
|
23
26
|
import {
|
|
24
27
|
init_credentials,
|
|
25
28
|
validateClaudeCredentials
|
|
@@ -28,9 +31,6 @@ import {
|
|
|
28
31
|
init_secret_scrubber,
|
|
29
32
|
scrubSecrets
|
|
30
33
|
} from "./cli-4j2mrzag.js";
|
|
31
|
-
import {
|
|
32
|
-
require_src
|
|
33
|
-
} from "./cli-7zd05xb4.js";
|
|
34
34
|
import {
|
|
35
35
|
__toESM
|
|
36
36
|
} from "./cli-p9swy5t3.js";
|
package/dist/cli.js
CHANGED
|
@@ -13,23 +13,23 @@ import"./cli-ap1czx8f.js";
|
|
|
13
13
|
import"./cli-v69vk5h0.js";
|
|
14
14
|
import {
|
|
15
15
|
bedrockProviderModule
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-ry656xem.js";
|
|
17
17
|
import"./cli-cwy5hqbq.js";
|
|
18
18
|
import"./cli-jvv0g8bh.js";
|
|
19
19
|
import {
|
|
20
20
|
setBedrockProviderModule
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-we156bmz.js";
|
|
22
22
|
import"./cli-hv2fndhm.js";
|
|
23
23
|
import"./cli-zyxs93y9.js";
|
|
24
24
|
import"./cli-4wgngmwv.js";
|
|
25
|
-
import"./cli-
|
|
26
|
-
import"./cli-
|
|
25
|
+
import"./cli-ch7t5v7n.js";
|
|
26
|
+
import"./cli-x0e0yvnq.js";
|
|
27
27
|
import"./cli-y2apkfe2.js";
|
|
28
28
|
import"./cli-vapyk8sw.js";
|
|
29
|
-
import"./cli-
|
|
30
|
-
import"./cli-
|
|
31
|
-
import"./cli-7wmybrt5.js";
|
|
29
|
+
import"./cli-ccjwgarc.js";
|
|
30
|
+
import"./cli-8wrympd7.js";
|
|
32
31
|
import"./cli-7sgrxg9a.js";
|
|
32
|
+
import"./cli-7wmybrt5.js";
|
|
33
33
|
import"./cli-9sbhdpvb.js";
|
|
34
34
|
import"./cli-z905tvmm.js";
|
|
35
35
|
import"./cli-dxak0fqd.js";
|
|
@@ -65,7 +65,7 @@ var import_react = __toESM(require_react(), 1);
|
|
|
65
65
|
// package.json
|
|
66
66
|
var package_default = {
|
|
67
67
|
name: "@desplega.ai/agent-swarm",
|
|
68
|
-
version: "1.
|
|
68
|
+
version: "1.121.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>",
|
|
@@ -124,6 +124,7 @@ var package_default = {
|
|
|
124
124
|
],
|
|
125
125
|
scripts: {
|
|
126
126
|
"build:pi-skills": "bun run plugin/build-pi-skills.ts",
|
|
127
|
+
"build:script-types": "bun scripts/bundle-script-types.ts",
|
|
127
128
|
"build:cli": "bun run scripts/build-cli.ts",
|
|
128
129
|
"mono:build": "turbo run build",
|
|
129
130
|
"mono:test": "turbo run test",
|
|
@@ -136,6 +137,7 @@ var package_default = {
|
|
|
136
137
|
"check:api-key-boundary": "bash scripts/check-api-key-boundary.sh",
|
|
137
138
|
"check:vendored-openapi": "bun scripts/check-vendored-openapi.ts",
|
|
138
139
|
"check:rbac-coverage": "bun scripts/check-rbac-coverage.ts",
|
|
140
|
+
"check:script-types": "bash scripts/check-script-types-freshness.sh",
|
|
139
141
|
"check:audit-columns": "bash scripts/check-audit-columns.sh",
|
|
140
142
|
"lint:structure": "konsistent check",
|
|
141
143
|
"prepare-release": "bun scripts/prepare-release.ts",
|
|
@@ -208,14 +210,14 @@ var package_default = {
|
|
|
208
210
|
"@aws-sdk/client-bedrock": "3.1048.0",
|
|
209
211
|
"@desplega.ai/business-use": "^0.4.2",
|
|
210
212
|
"@desplega.ai/localtunnel": "^2.2.0",
|
|
211
|
-
"@earendil-works/pi-agent-core": "^0.
|
|
212
|
-
"@earendil-works/pi-ai": "^0.
|
|
213
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
213
|
+
"@earendil-works/pi-agent-core": "^0.82.1",
|
|
214
|
+
"@earendil-works/pi-ai": "^0.82.1",
|
|
215
|
+
"@earendil-works/pi-coding-agent": "^0.82.1",
|
|
214
216
|
"@inkjs/ui": "^2.0.0",
|
|
215
217
|
"@linear/sdk": "^77.0.0",
|
|
216
218
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
217
219
|
"@openai/codex-sdk": "^0.145.0",
|
|
218
|
-
"@opencode-ai/sdk": "^1.18.
|
|
220
|
+
"@opencode-ai/sdk": "^1.18.5",
|
|
219
221
|
"@openfort/openfort-node": "^0.9.1",
|
|
220
222
|
"@opentelemetry/api": "^1.9.1",
|
|
221
223
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
|
|
@@ -658,7 +660,7 @@ function McpServer({ port, apiKey, dbPath }) {
|
|
|
658
660
|
if (dbPath) {
|
|
659
661
|
process.env.DATABASE_PATH = dbPath;
|
|
660
662
|
}
|
|
661
|
-
import("./http-
|
|
663
|
+
import("./http-kactcc0z.js").then(() => {
|
|
662
664
|
setStatus("running");
|
|
663
665
|
}).catch((err) => {
|
|
664
666
|
setStatus("error");
|
|
@@ -744,7 +746,7 @@ function WorkerRunner({
|
|
|
744
746
|
}) {
|
|
745
747
|
const { exit } = use_app_default();
|
|
746
748
|
import_react.useEffect(() => {
|
|
747
|
-
import("./worker-
|
|
749
|
+
import("./worker-yapewe14.js").then(({ runWorker }) => runWorker({
|
|
748
750
|
prompt: prompt || undefined,
|
|
749
751
|
yolo,
|
|
750
752
|
systemPrompt: systemPrompt || undefined,
|
|
@@ -761,7 +763,7 @@ function WorkerRunner({
|
|
|
761
763
|
function LeadRunner({ prompt, yolo, systemPrompt, systemPromptFile, additionalArgs }) {
|
|
762
764
|
const { exit } = use_app_default();
|
|
763
765
|
import_react.useEffect(() => {
|
|
764
|
-
import("./lead-
|
|
766
|
+
import("./lead-ysf26cjr.js").then(({ runLead }) => runLead({
|
|
765
767
|
prompt: prompt || undefined,
|
|
766
768
|
yolo,
|
|
767
769
|
systemPrompt: systemPrompt || undefined,
|
|
@@ -801,8 +803,8 @@ function LazyComponent({
|
|
|
801
803
|
}
|
|
802
804
|
return import_react.createElement(Component, props);
|
|
803
805
|
}
|
|
804
|
-
var loadOnboard = () => import("./onboard-
|
|
805
|
-
var loadConnect = () => import("./setup-
|
|
806
|
+
var loadOnboard = () => import("./onboard-ddb1674a.js").then(({ Onboard }) => Onboard);
|
|
807
|
+
var loadConnect = () => import("./setup-6rny4fk6.js").then(({ Setup }) => Setup);
|
|
806
808
|
function UnknownCommand({ command }) {
|
|
807
809
|
const { exit } = use_app_default();
|
|
808
810
|
import_react.useEffect(() => {
|
|
@@ -915,7 +917,7 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
915
917
|
}
|
|
916
918
|
process.exit(0);
|
|
917
919
|
} else if (args.command === "hook") {
|
|
918
|
-
const { runHook } = await import("./hook-
|
|
920
|
+
const { runHook } = await import("./hook-ygnw3cvt.js");
|
|
919
921
|
await runHook();
|
|
920
922
|
} else if (args.command === "artifact") {
|
|
921
923
|
const artifactArgs = process.argv.slice(process.argv.indexOf("artifact") + 1);
|
|
@@ -935,7 +937,7 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
935
937
|
printHelp("scripts");
|
|
936
938
|
process.exit(scriptsArgs[0] === "reembed" || args.showHelp ? 0 : 1);
|
|
937
939
|
}
|
|
938
|
-
const { runScriptsMaintenanceCommand } = await import("./maintenance-
|
|
940
|
+
const { runScriptsMaintenanceCommand } = await import("./maintenance-9npwptbb.js");
|
|
939
941
|
await runScriptsMaintenanceCommand(scriptsArgs);
|
|
940
942
|
console.log("Scripts re-embedded.");
|
|
941
943
|
} else if (args.command === "rbac") {
|
|
@@ -945,14 +947,14 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
945
947
|
printHelp("rbac");
|
|
946
948
|
process.exit(args.showHelp ? 0 : 1);
|
|
947
949
|
}
|
|
948
|
-
const { runRbacCliCommand } = await import("./rbac-roles-
|
|
950
|
+
const { runRbacCliCommand } = await import("./rbac-roles-6vtafvzb.js");
|
|
949
951
|
await runRbacCliCommand(rbacArgs);
|
|
950
952
|
} else if (args.command === "codex-login") {
|
|
951
953
|
const { runCodexLogin } = await import("./codex-login-0h18cy3e.js");
|
|
952
954
|
const codexLoginArgs = process.argv.slice(process.argv.indexOf("codex-login") + 1);
|
|
953
955
|
await runCodexLogin(codexLoginArgs);
|
|
954
956
|
} else if (args.command === "codex-session-runner") {
|
|
955
|
-
const { runCodexSessionRunner } = await import("./codex-session-runner-
|
|
957
|
+
const { runCodexSessionRunner } = await import("./codex-session-runner-sazmx9zt.js");
|
|
956
958
|
await runCodexSessionRunner();
|
|
957
959
|
} else if (args.command === "claude-managed-setup") {
|
|
958
960
|
const { runClaudeManagedSetup } = await import("./claude-managed-setup-eac00cqn.js");
|