@desplega.ai/agent-swarm 1.130.0 → 1.131.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{actions-73ee723n.js → actions-jgcy477k.js} +7 -7
- package/dist/{anthropic-messages-3xgme8my.js → anthropic-messages-rjmd2e7n.js} +5 -5
- package/dist/{app-hz5c2xay.js → app-5da78bd4.js} +4 -4
- package/dist/{assistant-08mr16yp.js → assistant-f2vkk1hj.js} +9 -9
- package/dist/{azure-openai-responses-xa4sh9f6.js → azure-openai-responses-c0yjmbfd.js} +8 -5
- package/dist/{boot-reembed-5bgan3cd.js → boot-reembed-q7mp8hcr.js} +4 -4
- package/dist/{boot-reembed-z7ykyeq8.js → boot-reembed-xmw8wcx6.js} +5 -5
- package/dist/{boot-scrub-logs-b2rjk8mv.js → boot-scrub-logs-dsqrv79n.js} +3 -3
- package/dist/{claude-adapter-qr0k17km.js → claude-adapter-q6x7yspx.js} +6 -6
- package/dist/{claude-managed-adapter-gv19tdew.js → claude-managed-adapter-wsg37bt8.js} +1 -1
- package/dist/{cli-vr2f46zj.js → cli-114fvtmj.js} +1 -1
- package/dist/{cli-mhr8tq3v.js → cli-2f07m0xr.js} +1 -1
- package/dist/{cli-mgerp0vs.js → cli-2rk0cx7s.js} +2 -2
- package/dist/{cli-tfw3c0y1.js → cli-3ty0t082.js} +2 -2
- package/dist/{cli-fs153s3x.js → cli-4rkfg1wx.js} +3 -3
- package/dist/{cli-s18zzkfp.js → cli-50vbt00w.js} +44 -7
- package/dist/{cli-vgexpfsr.js → cli-57khth04.js} +6 -3
- package/dist/{cli-n9yxcnvk.js → cli-5n6e5yfn.js} +29 -7
- package/dist/{cli-q8zwffx0.js → cli-6dp3ydxa.js} +158 -39
- package/dist/{cli-r62me33w.js → cli-6dpytdr2.js} +2 -2
- package/dist/{cli-ch7t5v7n.js → cli-6map995v.js} +9 -4
- package/dist/{cli-326083vb.js → cli-6pcz9h15.js} +14 -14
- package/dist/{cli-h3e66g5b.js → cli-793jvbsh.js} +1 -1
- package/dist/{cli-yj7z99vp.js → cli-7dm2zqy2.js} +2 -2
- package/dist/{cli-t5tsq67k.js → cli-9dr5qzc0.js} +39 -4
- package/dist/{cli-m8fs5ttq.js → cli-aca5pz9f.js} +1 -1
- package/dist/{cli-w10fkrf1.js → cli-akdvwc9v.js} +354 -115
- package/dist/{cli-hntzdchd.js → cli-bqw0mt1n.js} +1 -1
- package/dist/{cli-7v5dhmc8.js → cli-ccf9vy7q.js} +6 -6
- package/dist/{cli-6nh2qxvh.js → cli-darcwax3.js} +1 -1
- package/dist/{cli-xg2eezyv.js → cli-f1am9szv.js} +1 -1
- package/dist/{cli-1px8pn1s.js → cli-g1re8r05.js} +2 -2
- package/dist/{cli-z9q7pb38.js → cli-g74vpjp2.js} +4 -4
- package/dist/{cli-brebbsen.js → cli-gecy3z2s.js} +20 -8
- package/dist/{cli-epsvdckx.js → cli-gm9cbhbq.js} +20 -10
- package/dist/{cli-xdrmxvd4.js → cli-jbcva0xj.js} +55 -11
- package/dist/{cli-haanc4qd.js → cli-jevgrb4w.js} +22 -22
- package/dist/{cli-e5p3es48.js → cli-kd1ck4rx.js} +1 -1
- package/dist/{cli-1mj7yz1r.js → cli-nrkkknat.js} +1 -1
- package/dist/{cli-2pa5w9b6.js → cli-pxfxkx5m.js} +1 -1
- package/dist/{cli-qcsjdppx.js → cli-rgrfzg8z.js} +7 -7
- package/dist/{cli-mf009e0j.js → cli-se2p6rkb.js} +1 -1
- package/dist/{cli-tp519bjz.js → cli-sy7jk3tx.js} +2 -2
- package/dist/{cli-qbb2ten8.js → cli-t8d349cy.js} +2 -2
- package/dist/{cli-s21zzx4b.js → cli-w2wxd56v.js} +448 -184
- package/dist/{cli-qmdnhpej.js → cli-wz9115x0.js} +17 -7
- package/dist/{cli-4n4mdv21.js → cli-xpxde7rm.js} +7 -3
- package/dist/{cli-dakxgk70.js → cli-ycrnynpw.js} +4 -4
- package/dist/{cli-73bvdyxr.js → cli-ygrbmjja.js} +6 -6
- package/dist/cli.js +22 -22
- package/dist/{codex-adapter-6pc50x9q.js → codex-adapter-htjkn22b.js} +4 -4
- package/dist/{codex-hook-amndawyb.js → codex-hook-hq54t9ft.js} +2 -2
- package/dist/{codex-session-runner-tpg8hyj7.js → codex-session-runner-wjfc7smz.js} +4 -4
- package/dist/{commands-yfpwt11g.js → commands-xhrfwqsk.js} +3 -3
- package/dist/{db-jn499nmp.js → db-anvwb22f.js} +3 -3
- package/dist/{google-generative-ai-txgg2q58.js → google-generative-ai-hysrd8qx.js} +7 -5
- package/dist/{google-vertex-t663s1c3.js → google-vertex-p5arrga0.js} +7 -5
- package/dist/{handlers-eev4nng0.js → handlers-b9kbc621.js} +9 -9
- package/dist/{hook-9fkwkf3m.js → hook-cgk4wxmx.js} +5 -5
- package/dist/{hook-sn7pj75w.js → hook-xkvn6c5h.js} +4 -4
- package/dist/{http-xdbbtmhx.js → http-9xh6ta4r.js} +324 -82
- package/dist/{index-9vnkprkh.js → index-25wjsdv2.js} +10 -10
- package/dist/{index-5fdsemf0.js → index-eaxyqcmj.js} +155 -37
- package/dist/{index-fnack5vh.js → index-vg4snay4.js} +11 -11
- package/dist/{index-c0qedjh6.js → index-ywds4812.js} +9 -9
- package/dist/{keepalive-fc7a2hw9.js → keepalive-vc7s2aa6.js} +5 -5
- package/dist/{lead-1fva34y9.js → lead-r2yqfmx7.js} +29 -29
- package/dist/{maintenance-0rdb12vf.js → maintenance-mw70k468.js} +5 -5
- package/dist/{mistral-conversations-4swenhmf.js → mistral-conversations-81fwav0j.js} +2 -2
- package/dist/{oauth-refresh-sweep-f9rptqbt.js → oauth-refresh-sweep-yecgjpk4.js} +4 -4
- package/dist/{onboard-9zn0fx2m.js → onboard-xj0f73f9.js} +2 -2
- package/dist/{openai-codex-responses-xetseqvt.js → openai-codex-responses-5g27pd6f.js} +43 -23
- package/dist/{openai-completions-5r2g5axa.js → openai-completions-3vkmfz2a.js} +55 -11
- package/dist/{openai-responses-ce67hd23.js → openai-responses-dg4t7j7a.js} +8 -5
- package/dist/{openrouter-images-pzfp22jb.js → openrouter-images-g3gm8931.js} +1 -1
- package/dist/{otel-impl-thnttmbn.js → otel-impl-nxg0n0b3.js} +1 -1
- package/dist/{pi-mono-adapter-bpfrn6d7.js → pi-mono-adapter-4g5kby31.js} +17114 -7514
- package/dist/{pricing-refresh-n0ve0kh6.js → pricing-refresh-2cn6effr.js} +5 -5
- package/dist/{rbac-roles-w45bhahg.js → rbac-roles-1hcxdtg7.js} +4 -4
- package/dist/{rbac-roles-bbwb4wrm.js → rbac-roles-vynday5g.js} +5 -5
- package/dist/{render-v2-d675cp9r.js → render-v2-tc0bh8kk.js} +4 -4
- package/dist/{seed-pricing-47q77nw4.js → seed-pricing-8kceb43f.js} +4 -4
- package/dist/{setup-3vnv2m43.js → setup-46xtgq3c.js} +2 -2
- package/dist/{worker-7shsr8hk.js → worker-qrbz6hmv.js} +29 -29
- package/openapi.json +342 -10
- package/package.json +6 -6
- package/src/apps/store.ts +13 -4
- package/src/assets/key.ts +8 -1
- package/src/be/asset-key-audit.ts +3 -1
- package/src/be/db-queries/mcp-oauth.ts +26 -0
- package/src/be/db.ts +42 -1
- package/src/be/migrations/129_asset_keys_apps_scripts.sql +161 -0
- package/src/be/migrations/130_scratch_script_retention_grace.sql +6 -0
- package/src/be/scripts/db.ts +48 -3
- package/src/be/scripts/retention.ts +164 -0
- package/src/be/scripts/run-saved.ts +16 -1
- package/src/be/seed-skills/index.ts +7 -0
- package/src/http/assets.ts +120 -29
- package/src/http/index.ts +5 -0
- package/src/http/mcp-oauth.ts +69 -1
- package/src/http/scripts.ts +21 -3
- package/src/http/users.ts +45 -0
- package/src/http/x.ts +14 -0
- package/src/oauth/ensure-mcp-token.ts +7 -1
- package/src/oauth/mcp-wrapper.ts +247 -24
- package/src/providers/claude-managed-models.ts +34 -10
- package/src/providers/pi-mono-adapter.ts +1 -1
- package/src/tests/asset-key-api.test.ts +48 -2
- package/src/tests/asset-key-invariants.test.ts +92 -0
- package/src/tests/asset-key-migration.test.ts +174 -8
- package/src/tests/asset-key-normalization.test.ts +2 -0
- package/src/tests/claude-managed-adapter.test.ts +38 -7
- package/src/tests/mcp-oauth-dcr-reuse.test.ts +95 -0
- package/src/tests/mcp-oauth-ensure-token.test.ts +23 -0
- package/src/tests/mcp-oauth-manual-client.test.ts +135 -2
- package/src/tests/mcp-oauth-wrapper.test.ts +380 -0
- package/src/tests/rbac-admission-e2e.test.ts +68 -0
- package/src/tests/sandboxed-process.test.ts +45 -0
- package/src/tests/script-connections.test.ts +4 -0
- package/src/tests/scripts-external-api.test.ts +8 -3
- package/src/tests/scripts-http.test.ts +12 -0
- package/src/tests/scripts-retention.test.ts +384 -0
- package/src/tests/whoami-route.test.ts +127 -0
- package/src/tests/workflow-engine-v2.test.ts +80 -7
- package/src/tests/workflow-swarm-script.test.ts +118 -5
- package/src/tools/workflows/create-workflow.ts +4 -1
- package/src/types.ts +18 -5
- package/src/utils/sandboxed-process.ts +40 -14
- package/src/utils/template.ts +8 -1
- package/src/workflows/engine.ts +27 -4
- package/src/workflows/executors/swarm-script.ts +52 -1
- package/src/workflows/retry-poller.ts +19 -2
- package/templates/schedules/daily-compounding-reflection/content.md +12 -3
- package/templates/skills/asset-namespaces/content.md +2 -2
- package/templates/skills/scheduled-task-resilience/SKILL.md +102 -0
- package/templates/skills/scheduled-task-resilience/config.json +14 -0
- package/templates/skills/scheduled-task-resilience/content.md +97 -0
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./cli-r6kqqbj0.js";
|
|
12
12
|
import {
|
|
13
13
|
normalizeProviderError
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-6map995v.js";
|
|
15
15
|
import {
|
|
16
16
|
getProviderEnvValue
|
|
17
17
|
} from "./cli-4wgngmwv.js";
|
|
@@ -28,15 +28,16 @@ import {
|
|
|
28
28
|
clampReasoning,
|
|
29
29
|
resolveJsonSchemaStrictSampling,
|
|
30
30
|
transformMessages
|
|
31
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-57khth04.js";
|
|
32
32
|
import {
|
|
33
33
|
sanitizeSurrogates
|
|
34
34
|
} from "./cli-y2apkfe2.js";
|
|
35
35
|
import {
|
|
36
36
|
calculateCost
|
|
37
|
-
} from "./cli-
|
|
37
|
+
} from "./cli-akdvwc9v.js";
|
|
38
38
|
import {
|
|
39
|
-
AssistantMessageEventStream
|
|
39
|
+
AssistantMessageEventStream,
|
|
40
|
+
appendAssistantMessageDiagnostic
|
|
40
41
|
} from "./cli-8wrympd7.js";
|
|
41
42
|
import {
|
|
42
43
|
exports_supports_color,
|
|
@@ -5187,6 +5188,7 @@ var stream = (model, context, options = {}) => {
|
|
|
5187
5188
|
config.token = { token: bearerToken };
|
|
5188
5189
|
config.authSchemePreference = ["httpBearerAuth"];
|
|
5189
5190
|
}
|
|
5191
|
+
let responseRequestId;
|
|
5190
5192
|
try {
|
|
5191
5193
|
const client = new import_client_bedrock_runtime.BedrockRuntimeClient(config);
|
|
5192
5194
|
const customHeaders = providerHeadersToRecord(options.headers);
|
|
@@ -5213,6 +5215,7 @@ var stream = (model, context, options = {}) => {
|
|
|
5213
5215
|
}
|
|
5214
5216
|
const command = new import_client_bedrock_runtime.ConverseStreamCommand(commandInput);
|
|
5215
5217
|
const response = await client.send(command, { abortSignal: options.signal });
|
|
5218
|
+
responseRequestId = normalizeDiagnosticValue(response.$metadata.requestId);
|
|
5216
5219
|
if (response.$metadata.httpStatusCode !== undefined) {
|
|
5217
5220
|
const responseHeaders = {};
|
|
5218
5221
|
if (response.$metadata.requestId) {
|
|
@@ -5271,6 +5274,9 @@ var stream = (model, context, options = {}) => {
|
|
|
5271
5274
|
}
|
|
5272
5275
|
output.stopReason = options.signal?.aborted ? "aborted" : "error";
|
|
5273
5276
|
output.errorMessage = formatBedrockError(error);
|
|
5277
|
+
if (output.stopReason === "error") {
|
|
5278
|
+
appendBedrockFailureDiagnostic(output, error, responseRequestId);
|
|
5279
|
+
}
|
|
5274
5280
|
stream2.push({ type: "error", reason: output.stopReason, error: output });
|
|
5275
5281
|
stream2.end();
|
|
5276
5282
|
}
|
|
@@ -5295,6 +5301,35 @@ function formatBedrockError(error) {
|
|
|
5295
5301
|
}
|
|
5296
5302
|
return `${core}${dataRetentionHint}`;
|
|
5297
5303
|
}
|
|
5304
|
+
var MAX_BEDROCK_DIAGNOSTIC_VALUE_CHARS = 200;
|
|
5305
|
+
function normalizeDiagnosticValue(value) {
|
|
5306
|
+
if (typeof value !== "string")
|
|
5307
|
+
return;
|
|
5308
|
+
const trimmed = value.trim();
|
|
5309
|
+
if (trimmed.length === 0 || trimmed.length > MAX_BEDROCK_DIAGNOSTIC_VALUE_CHARS)
|
|
5310
|
+
return;
|
|
5311
|
+
return trimmed;
|
|
5312
|
+
}
|
|
5313
|
+
function extractBedrockErrorCode(error) {
|
|
5314
|
+
if (!(error instanceof Error) || !error.name.endsWith("Exception"))
|
|
5315
|
+
return;
|
|
5316
|
+
return normalizeDiagnosticValue(error.name);
|
|
5317
|
+
}
|
|
5318
|
+
function appendBedrockFailureDiagnostic(output, error, fallbackRequestId) {
|
|
5319
|
+
const metadata = error?.$metadata;
|
|
5320
|
+
const details = {};
|
|
5321
|
+
if (typeof metadata?.httpStatusCode === "number")
|
|
5322
|
+
details.status = metadata.httpStatusCode;
|
|
5323
|
+
const errorCode = extractBedrockErrorCode(error);
|
|
5324
|
+
if (errorCode !== undefined)
|
|
5325
|
+
details.errorCode = errorCode;
|
|
5326
|
+
const requestId = normalizeDiagnosticValue(metadata?.requestId) ?? fallbackRequestId;
|
|
5327
|
+
if (requestId !== undefined)
|
|
5328
|
+
details.requestId = requestId;
|
|
5329
|
+
if (Object.keys(details).length === 0)
|
|
5330
|
+
return;
|
|
5331
|
+
appendAssistantMessageDiagnostic(output, { type: "bedrock_response_failure", timestamp: Date.now(), details });
|
|
5332
|
+
}
|
|
5298
5333
|
var RESERVED_HEADER_EXACT = new Set(["authorization", "host"]);
|
|
5299
5334
|
function isReservedHeader(key) {
|
|
5300
5335
|
const lower = key.toLowerCase();
|