@desplega.ai/agent-swarm 1.129.0 → 1.131.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-kfv2dawe.js → actions-w53mbns9.js} +11 -11
- package/dist/{anthropic-messages-3xgme8my.js → anthropic-messages-rjmd2e7n.js} +5 -5
- package/dist/{app-q8vjk6e8.js → app-m9gwqsqv.js} +8 -8
- package/dist/{artifact-hg4t1nx7.js → artifact-jysj3wrg.js} +2 -2
- package/dist/{assistant-g037r345.js → assistant-bp65m6f3.js} +13 -13
- package/dist/{azure-openai-responses-xa4sh9f6.js → azure-openai-responses-c0yjmbfd.js} +8 -5
- package/dist/{boot-reembed-18pzsrxa.js → boot-reembed-62p0at2k.js} +6 -6
- package/dist/{boot-reembed-wpks2cj8.js → boot-reembed-xmfp6wdh.js} +7 -7
- package/dist/{boot-scrub-logs-n7szd57r.js → boot-scrub-logs-rr8q2dms.js} +5 -5
- package/dist/{claude-adapter-qz4r0ajt.js → claude-adapter-2y47mrkd.js} +9 -9
- package/dist/{cli-mhjnbgb6.js → cli-0rcyq6d9.js} +450 -186
- package/dist/{cli-ttkmehy0.js → cli-2q72qz2s.js} +274 -25
- package/dist/{cli-gztgc3hz.js → cli-2wadx7p2.js} +2 -2
- package/dist/cli-3fj60etf.js +153 -0
- package/dist/{cli-7ecgm5v0.js → cli-3kf51j15.js} +1 -1
- package/dist/{cli-vgexpfsr.js → cli-57khth04.js} +6 -3
- package/dist/{cli-2mbe7vk0.js → cli-5dsbcjjw.js} +1 -1
- package/dist/{cli-etr62zy6.js → cli-5kx36evn.js} +2 -2
- package/dist/{cli-v2tr6amf.js → cli-5n6e5yfn.js} +30 -8
- package/dist/{cli-hx02s9zq.js → cli-5v4rw6yd.js} +2 -2
- package/dist/{cli-v37yr6mf.js → cli-5ze9rv97.js} +4 -4
- package/dist/{cli-ch7t5v7n.js → cli-6map995v.js} +9 -4
- package/dist/{cli-h0457a67.js → cli-70xqj0z3.js} +3 -3
- package/dist/{cli-kk4f9r17.js → cli-72q8m8gk.js} +8 -6
- package/dist/{cli-7padk69a.js → cli-78xwvkhj.js} +2 -2
- package/dist/{cli-dxtxacy7.js → cli-9dr5qzc0.js} +45 -8
- package/dist/{cli-17zxdgsq.js → cli-a40rnf71.js} +6 -6
- package/dist/{cli-t53vnnxz.js → cli-a4jzdpa3.js} +2514 -1055
- package/dist/{cli-w10fkrf1.js → cli-akdvwc9v.js} +354 -115
- package/dist/{cli-1qkk5er0.js → cli-bmze986d.js} +1 -1
- package/dist/{cli-ga12dc1d.js → cli-bqw0mt1n.js} +3 -3
- package/dist/{cli-0sf92efp.js → cli-cdeg08wx.js} +1 -1
- package/dist/{cli-a8ynhkyj.js → cli-cvgjwnh1.js} +17 -15
- package/dist/{cli-9fxg3v5m.js → cli-d2tfkcga.js} +4 -4
- package/dist/{cli-nhcd7x43.js → cli-d3x3x1c9.js} +2 -2
- package/dist/{cli-6nh2qxvh.js → cli-darcwax3.js} +1 -1
- package/dist/{cli-yjbgmysx.js → cli-e7ckcg4v.js} +12 -12
- package/dist/{cli-4n2gcjpd.js → cli-efxfnq6q.js} +4 -3
- package/dist/{cli-z9xqqhfk.js → cli-er3a4bb0.js} +1 -1
- package/dist/{cli-xg2eezyv.js → cli-f1am9szv.js} +1 -1
- package/dist/{cli-xy4cwsm9.js → cli-fywms69x.js} +1 -1
- package/dist/{cli-33jj76y8.js → cli-g6b8x1h8.js} +1 -1
- package/dist/{cli-epsvdckx.js → cli-gm9cbhbq.js} +20 -10
- package/dist/{cli-rkndnn90.js → cli-k9qkf1hw.js} +6 -4
- package/dist/{cli-zejvt395.js → cli-kh3ba2zf.js} +1 -1
- package/dist/{cli-gb25p1h2.js → cli-nm5gtp1x.js} +2 -2
- package/dist/{cli-akxnpx17.js → cli-pm6xbh84.js} +1829 -1629
- package/dist/{cli-2k0ztbfp.js → cli-psh3c4va.js} +1 -1
- package/dist/{cli-39vgrsep.js → cli-qv61hp37.js} +2 -2
- package/dist/{cli-hv2fndhm.js → cli-r6kqqbj0.js} +6 -4
- package/dist/{cli-1y1cm570.js → cli-rzbpmxdr.js} +1 -1
- package/dist/{cli-mmrk00vp.js → cli-t1xze5qh.js} +1 -1
- package/dist/{cli-g252a9ky.js → cli-t55yw3a1.js} +2 -2
- package/dist/{cli-7bz8dzqa.js → cli-t76vw5db.js} +1184 -1522
- package/dist/{cli-4n4mdv21.js → cli-xpxde7rm.js} +7 -3
- package/dist/{cli-fpaa5k2q.js → cli-yw8vghx2.js} +54 -18
- package/dist/cli-zsspvvm2.js +490 -0
- package/dist/cli.js +27 -25
- package/dist/{codex-adapter-7v6t7ff6.js → codex-adapter-d24q75wk.js} +7 -7
- package/dist/{codex-hook-amndawyb.js → codex-hook-hq54t9ft.js} +2 -2
- package/dist/{codex-session-runner-e7j4khe2.js → codex-session-runner-g50vcsex.js} +7 -7
- package/dist/{commands-ex0k5tbf.js → commands-c3nrc5hg.js} +5 -5
- package/dist/{db-df7jatfc.js → db-nt7fg3tw.js} +5 -5
- package/dist/{google-generative-ai-y42hnw9p.js → google-generative-ai-hysrd8qx.js} +7 -5
- package/dist/{google-vertex-4sg66gb6.js → google-vertex-p5arrga0.js} +7 -5
- package/dist/{handlers-1j2cfqt2.js → handlers-fkr6swat.js} +13 -13
- package/dist/{hook-nx9a0mj3.js → hook-77wpvnjc.js} +7 -7
- package/dist/{hook-w6yaf6sy.js → hook-g019yehy.js} +8 -8
- package/dist/{http-4tz5h8wg.js → http-jewj0syk.js} +2993 -716
- package/dist/{index-0bpkzb09.js → index-070v4eyb.js} +3 -3
- package/dist/{index-0s67qv7h.js → index-6gm5he8h.js} +11 -11
- package/dist/{index-35gtv6gj.js → index-7n2xpbd4.js} +310 -40
- package/dist/{index-ker3gccb.js → index-9znhar3x.js} +4 -4
- package/dist/{index-5n2c8yay.js → index-hase6zbe.js} +2 -2
- package/dist/{index-kcf3tm9h.js → index-hfvggd0z.js} +12 -12
- package/dist/{index-7c0jqna0.js → index-hp1kdbjj.js} +13 -13
- package/dist/{keepalive-3j4a9168.js → keepalive-j0fjvqfd.js} +7 -7
- package/dist/{lead-6kpevymb.js → lead-1n8x30xe.js} +33 -33
- package/dist/{maintenance-m1k82ean.js → maintenance-gvev11sa.js} +7 -7
- package/dist/{mistral-conversations-bjkdfb6z.js → mistral-conversations-81fwav0j.js} +6 -6
- package/dist/{oauth-refresh-sweep-881k8e4q.js → oauth-refresh-sweep-s9ecsvh0.js} +6 -6
- package/dist/{onboard-c0ykffjn.js → onboard-pvm5b38w.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-sqagjerv.js → otel-impl-p6jvgd9c.js} +6 -4
- package/dist/{otel-3mp81ppd.js → otel-nqa12wf3.js} +2 -2
- package/dist/{pi-mono-adapter-k584k16g.js → pi-mono-adapter-t091s27g.js} +17117 -7517
- package/dist/{pricing-refresh-y82whbf9.js → pricing-refresh-k49rcyed.js} +7 -7
- package/dist/{rbac-roles-nvkqmzyd.js → rbac-roles-30pspvy7.js} +7 -7
- package/dist/{rbac-roles-4ht8gegc.js → rbac-roles-cr80g96t.js} +6 -6
- package/dist/{render-v2-wvqdgvvp.js → render-v2-xm457ng1.js} +8 -8
- package/dist/{seed-pricing-fy3rxhde.js → seed-pricing-yhpv35fr.js} +6 -6
- package/dist/{setup-ak5cnc6f.js → setup-nytnmwwr.js} +2 -2
- package/dist/{worker-d8769q8a.js → worker-msytr2cw.js} +33 -33
- package/openapi.json +34039 -11036
- package/package.json +8 -6
- package/src/apps/definition.ts +368 -26
- package/src/apps/row-store.ts +66 -10
- package/src/apps/schema-migrate.ts +95 -1
- package/src/apps/store.ts +13 -4
- package/src/apps/sync-run-as.ts +18 -0
- package/src/apps/sync.ts +934 -0
- package/src/apps/version.ts +16 -2
- package/src/assets/key.ts +8 -1
- package/src/be/asset-key-audit.ts +3 -1
- package/src/be/db-queries/mcp-oauth.ts +297 -24
- package/src/be/db.ts +42 -1
- package/src/be/migrations/129_asset_keys_apps_scripts.sql +161 -0
- package/src/be/scripts/db.ts +5 -2
- package/src/be/scripts/typecheck.ts +1 -0
- package/src/be/seed-scripts/catalog/app-sync-run.ts +32 -0
- package/src/be/seed-scripts/catalog/github-issues-pull.ts +102 -0
- package/src/be/seed-scripts/index.ts +18 -0
- package/src/be/seed-skills/index.ts +7 -0
- package/src/http/active-sessions.ts +26 -18
- package/src/http/agents.ts +94 -27
- package/src/http/api-keys.ts +91 -17
- package/src/http/approval-requests.ts +87 -10
- package/src/http/apps.ts +361 -53
- package/src/http/assets.ts +165 -31
- package/src/http/budgets.ts +7 -5
- package/src/http/codex-oauth-keep-warm.ts +21 -3
- package/src/http/config.ts +46 -16
- package/src/http/context.ts +33 -6
- package/src/http/ecosystem.ts +20 -6
- package/src/http/events.ts +24 -9
- package/src/http/favorites.ts +20 -6
- package/src/http/fs.ts +60 -17
- package/src/http/heartbeat.ts +18 -4
- package/src/http/inbox-state.ts +12 -6
- package/src/http/integrations.ts +25 -5
- package/src/http/kv.ts +36 -15
- package/src/http/mcp-bridge.ts +5 -1
- package/src/http/mcp-oauth.ts +332 -17
- package/src/http/mcp-servers.ts +56 -18
- package/src/http/memory.ts +282 -29
- package/src/http/metrics.ts +80 -17
- package/src/http/oauth-callback.ts +10 -4
- package/src/http/oauth-generic.ts +5 -1
- package/src/http/oauth-locks.ts +6 -3
- package/src/http/openapi.ts +57 -9
- package/src/http/page-proxy.ts +25 -5
- package/src/http/pages-public.ts +37 -20
- package/src/http/pages.ts +93 -28
- package/src/http/poll.ts +89 -5
- package/src/http/pricing.ts +9 -6
- package/src/http/prompt-templates.ts +85 -21
- package/src/http/route-def.ts +67 -4
- package/src/http/schedules.ts +63 -14
- package/src/http/script-connection-proxy.ts +30 -4
- package/src/http/script-connections.ts +393 -43
- package/src/http/script-runs.ts +73 -19
- package/src/http/scripts.ts +257 -39
- package/src/http/session-data.ts +87 -14
- package/src/http/sessions.ts +80 -5
- package/src/http/skills.ts +115 -35
- package/src/http/stats.ts +94 -13
- package/src/http/task-templates.ts +6 -4
- package/src/http/tasks.ts +230 -61
- package/src/http/trackers/jira.ts +90 -30
- package/src/http/trackers/linear.ts +46 -12
- package/src/http/users.ts +162 -25
- package/src/http/utils.ts +12 -2
- package/src/http/webhooks.ts +30 -16
- package/src/http/workflow-events.ts +18 -5
- package/src/http/workflows.ts +128 -39
- package/src/http/x.ts +37 -6
- package/src/oauth/ensure-mcp-token.ts +16 -1
- package/src/oauth/mcp-wrapper.ts +281 -26
- package/src/providers/pi-mono-adapter.ts +1 -1
- package/src/scripts-runtime/credential-broker/README.md +1 -1
- package/src/scripts-runtime/credential-broker/fetch-patch.ts +12 -2
- package/src/scripts-runtime/sdk-allowlist.ts +1 -0
- package/src/scripts-runtime/stdlib/fetch.ts +6 -0
- package/src/scripts-runtime/types/stdlib.d.ts +1 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +1 -0
- package/src/server.ts +2 -0
- package/src/tests/apps-rbac.test.ts +110 -0
- package/src/tests/apps-spike2.test.ts +4 -1
- package/src/tests/apps-sync-engine.test.ts +2540 -0
- package/src/tests/apps-sync.test.ts +1627 -0
- 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/credential-broker.test.ts +27 -2
- package/src/tests/mcp-oauth-dcr-reuse.test.ts +743 -0
- package/src/tests/mcp-oauth-ensure-token.test.ts +45 -0
- package/src/tests/mcp-oauth-manual-client.test.ts +135 -2
- package/src/tests/mcp-oauth-queries.test.ts +153 -0
- package/src/tests/mcp-oauth-wrapper.test.ts +432 -0
- package/src/tests/memory-http-recall-gating.test.ts +2 -0
- package/src/tests/openapi-response-contract.test.ts +138 -0
- package/src/tests/rbac-admission-e2e.test.ts +68 -0
- package/src/tests/script-connections.test.ts +3 -0
- package/src/tests/scripts-runtime-fetch.test.ts +121 -0
- package/src/tests/scripts-runtime-secret-egress.test.ts +4 -2
- package/src/tests/seed-scripts.test.ts +2 -2
- package/src/tests/swarm-tool-result-gate.test.ts +32 -0
- package/src/tests/task-working-dir.test.ts +8 -4
- 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 +104 -0
- package/src/tools/app-get.ts +10 -2
- package/src/tools/app-rollback.ts +1 -0
- package/src/tools/app-sync.ts +112 -0
- package/src/tools/script-common.ts +20 -0
- package/src/tools/tool-config.ts +2 -1
- package/src/tools/utils.ts +11 -0
- package/src/tools/workflows/create-workflow.ts +4 -1
- package/src/types.ts +1394 -1206
- package/src/utils/template.ts +8 -1
- package/src/utils/zod-openapi.ts +11 -0
- package/src/workflows/engine.ts +27 -4
- package/src/workflows/executors/swarm-script.ts +28 -0
- package/src/workflows/retry-poller.ts +19 -2
- package/templates/skills/apps/content.md +94 -5
- 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
- package/dist/cli-7wmybrt5.js +0 -115
- package/dist/cli-d91pvmq1.js +0 -14
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
retryProviderRequest
|
|
3
|
+
} from "./cli-s8s499xy.js";
|
|
1
4
|
import {
|
|
2
5
|
import_websocket
|
|
3
6
|
} from "./cli-4w4fmq9x.js";
|
|
@@ -9,7 +12,7 @@ import {
|
|
|
9
12
|
import {
|
|
10
13
|
resolveJsonSchemaStrictSampling,
|
|
11
14
|
transformMessages
|
|
12
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-57khth04.js";
|
|
13
16
|
import {
|
|
14
17
|
sanitizeSurrogates
|
|
15
18
|
} from "./cli-y2apkfe2.js";
|
|
@@ -834,7 +837,7 @@ Content-Type: ${partContentType}\r
|
|
|
834
837
|
static #proxyAgent;
|
|
835
838
|
static #fetch;
|
|
836
839
|
static async#getProxyAgent() {
|
|
837
|
-
this.#proxyAgent ||= (await import("./index-
|
|
840
|
+
this.#proxyAgent ||= (await import("./index-hase6zbe.js").then((m)=>__toESM(m.default))).HttpsProxyAgent;
|
|
838
841
|
return this.#proxyAgent;
|
|
839
842
|
}
|
|
840
843
|
static async#getFetch() {
|
|
@@ -25054,7 +25057,8 @@ function resolveThoughtSignature(isSameProviderAndModel, signature) {
|
|
|
25054
25057
|
return isSameProviderAndModel && isValidThoughtSignature(signature) ? signature : undefined;
|
|
25055
25058
|
}
|
|
25056
25059
|
function requiresToolCallId(modelId) {
|
|
25057
|
-
|
|
25060
|
+
const geminiMajorVersion = getGeminiMajorVersion(modelId);
|
|
25061
|
+
return modelId.startsWith("claude-") || modelId.startsWith("gpt-oss-") || geminiMajorVersion !== undefined && geminiMajorVersion >= 3;
|
|
25058
25062
|
}
|
|
25059
25063
|
function getGeminiMajorVersion(modelId) {
|
|
25060
25064
|
const match = modelId.toLowerCase().match(/^gemini(?:-live)?-(\d+)/);
|
|
@@ -25109,24 +25113,26 @@ function convertMessages(model, context) {
|
|
|
25109
25113
|
const isSameProviderAndModel = msg.provider === model.provider && msg.model === model.id;
|
|
25110
25114
|
for (const block of msg.content) {
|
|
25111
25115
|
if (block.type === "text") {
|
|
25112
|
-
if (!block.text || block.text.trim() === "")
|
|
25113
|
-
continue;
|
|
25114
25116
|
const thoughtSignature = resolveThoughtSignature(isSameProviderAndModel, block.textSignature);
|
|
25117
|
+
if ((!block.text || block.text.trim() === "") && !thoughtSignature)
|
|
25118
|
+
continue;
|
|
25115
25119
|
parts.push({
|
|
25116
25120
|
text: sanitizeSurrogates(block.text),
|
|
25117
25121
|
...thoughtSignature && { thoughtSignature }
|
|
25118
25122
|
});
|
|
25119
25123
|
} else if (block.type === "thinking") {
|
|
25120
|
-
if (!block.thinking || block.thinking.trim() === "")
|
|
25121
|
-
continue;
|
|
25122
25124
|
if (isSameProviderAndModel) {
|
|
25123
25125
|
const thoughtSignature = resolveThoughtSignature(isSameProviderAndModel, block.thinkingSignature);
|
|
25126
|
+
if ((!block.thinking || block.thinking.trim() === "") && !thoughtSignature)
|
|
25127
|
+
continue;
|
|
25124
25128
|
parts.push({
|
|
25125
25129
|
thought: true,
|
|
25126
25130
|
text: sanitizeSurrogates(block.thinking),
|
|
25127
25131
|
...thoughtSignature && { thoughtSignature }
|
|
25128
25132
|
});
|
|
25129
25133
|
} else {
|
|
25134
|
+
if (!block.thinking || block.thinking.trim() === "")
|
|
25135
|
+
continue;
|
|
25130
25136
|
parts.push({
|
|
25131
25137
|
text: sanitizeSurrogates(block.thinking)
|
|
25132
25138
|
});
|
|
@@ -25282,5 +25288,21 @@ function mapStopReason(reason) {
|
|
|
25282
25288
|
}
|
|
25283
25289
|
}
|
|
25284
25290
|
}
|
|
25291
|
+
function retryGoogleRequest(request, options) {
|
|
25292
|
+
return retryProviderRequest(async () => {
|
|
25293
|
+
try {
|
|
25294
|
+
return await request();
|
|
25295
|
+
} catch (error) {
|
|
25296
|
+
if (error instanceof Error && "status" in error && !("headers" in error)) {
|
|
25297
|
+
error.headers = undefined;
|
|
25298
|
+
}
|
|
25299
|
+
throw error;
|
|
25300
|
+
}
|
|
25301
|
+
}, {
|
|
25302
|
+
maxRetries: options?.maxRetries,
|
|
25303
|
+
maxRetryDelayMs: options?.maxRetryDelayMs,
|
|
25304
|
+
signal: options?.signal
|
|
25305
|
+
});
|
|
25306
|
+
}
|
|
25285
25307
|
|
|
25286
|
-
export { ThinkingLevel, ResourceScope, GoogleGenAI, isThinkingPart, retainThoughtSignature, convertMessages, convertTools, supportsGoogleStrictToolSampling, resolveGoogleFunctionCallingMode, mapStopReason };
|
|
25308
|
+
export { ThinkingLevel, ResourceScope, GoogleGenAI, isThinkingPart, retainThoughtSignature, convertMessages, convertTools, supportsGoogleStrictToolSampling, resolveGoogleFunctionCallingMode, mapStopReason, retryGoogleRequest };
|
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
getExecutorRegistry,
|
|
3
3
|
handleScheduleTrigger,
|
|
4
4
|
startWorkflowExecution
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-yw8vghx2.js";
|
|
6
6
|
import {
|
|
7
7
|
buildScriptCredentialBindings,
|
|
8
8
|
getScript,
|
|
9
9
|
getScriptApiConnectionDescriptors,
|
|
10
10
|
getScriptMcpConnectionDescriptors,
|
|
11
11
|
runScript
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-pm6xbh84.js";
|
|
13
13
|
import {
|
|
14
14
|
createTaskWithSiblingAwareness
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-cdeg08wx.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-a4jzdpa3.js";
|
|
28
28
|
import {
|
|
29
29
|
__commonJS,
|
|
30
30
|
__require,
|
|
@@ -38,22 +38,27 @@ function extractBody(error) {
|
|
|
38
38
|
function pickBodyText(error) {
|
|
39
39
|
if (typeof error.body === "string")
|
|
40
40
|
return error.body;
|
|
41
|
-
if (
|
|
41
|
+
if (isPlainNonEmptyObject(error.error))
|
|
42
42
|
return safeJsonStringify(error.error);
|
|
43
43
|
const responseBody = error.$response?.body;
|
|
44
44
|
if (typeof responseBody === "string")
|
|
45
45
|
return responseBody;
|
|
46
46
|
if (isReadableStreamLike(responseBody))
|
|
47
47
|
return;
|
|
48
|
-
if (
|
|
48
|
+
if (isPlainNonEmptyObject(responseBody))
|
|
49
49
|
return safeJsonStringify(responseBody);
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
function isReadableStreamLike(value) {
|
|
53
53
|
return typeof value === "object" && value !== null && "pipe" in value && typeof value.pipe === "function";
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
55
|
+
function isPlainNonEmptyObject(value) {
|
|
56
|
+
if (typeof value !== "object" || value === null)
|
|
57
|
+
return false;
|
|
58
|
+
const proto = Object.getPrototypeOf(value);
|
|
59
|
+
if (proto !== Object.prototype && proto !== null)
|
|
60
|
+
return false;
|
|
61
|
+
return Object.keys(value).length > 0;
|
|
57
62
|
}
|
|
58
63
|
function formatProviderError(norm, prefix) {
|
|
59
64
|
if (norm.messageCarriesBody || norm.status === undefined || norm.body === undefined) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
summarizeSession
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-0rcyq6d9.js";
|
|
4
4
|
import {
|
|
5
5
|
checkToolLoop,
|
|
6
6
|
clearToolHistory
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
fetchRetrievalsForTask,
|
|
12
12
|
isLlmRaterEnabled,
|
|
13
13
|
postRatings
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-2wadx7p2.js";
|
|
15
15
|
import {
|
|
16
16
|
getApiKey
|
|
17
17
|
} from "./cli-f14fvzag.js";
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
import {
|
|
34
34
|
init_package,
|
|
35
35
|
package_default
|
|
36
|
-
} from "./cli-
|
|
36
|
+
} from "./cli-72q8m8gk.js";
|
|
37
37
|
|
|
38
38
|
// src/hooks/hook.ts
|
|
39
39
|
init_package();
|
|
@@ -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.131.0",
|
|
11
11
|
description: "agent-swarm.dev — an open-source operating system for AI work: a lead agent breaks goals into tasks, routes them to specialized workers such as Claude Code or Codex, runs each worker in an isolated container, and preserves shared memory, tools, schedules, and review gates so delegated work compounds across sessions.",
|
|
12
12
|
keywords: [
|
|
13
13
|
"agent-swarm.dev",
|
|
@@ -99,6 +99,7 @@ var init_package = __esm(() => {
|
|
|
99
99
|
"check:api-key-boundary": "bash scripts/check-api-key-boundary.sh",
|
|
100
100
|
"check:vendored-openapi": "bun scripts/check-vendored-openapi.ts",
|
|
101
101
|
"check:rbac-coverage": "bun scripts/check-rbac-coverage.ts",
|
|
102
|
+
"check:openapi-response-coverage": "bun scripts/check-openapi-response-coverage.ts",
|
|
102
103
|
"check:script-types": "bash scripts/check-script-types-freshness.sh",
|
|
103
104
|
"check:audit-columns": "bash scripts/check-audit-columns.sh",
|
|
104
105
|
"lint:structure": "konsistent check",
|
|
@@ -158,6 +159,7 @@ var init_package = __esm(() => {
|
|
|
158
159
|
"@types/bun": "latest",
|
|
159
160
|
"dependency-cruiser": "^18.0.0",
|
|
160
161
|
konsistent: "1.0.0-beta.1",
|
|
162
|
+
"openapi-typescript": "^7",
|
|
161
163
|
"ts-morph": "^28.0.0",
|
|
162
164
|
turbo: "^2.10.0"
|
|
163
165
|
},
|
|
@@ -174,14 +176,14 @@ var init_package = __esm(() => {
|
|
|
174
176
|
"@aws-sdk/client-bedrock": "3.1048.0",
|
|
175
177
|
"@desplega.ai/business-use": "^0.4.2",
|
|
176
178
|
"@desplega.ai/localtunnel": "^2.2.0",
|
|
177
|
-
"@earendil-works/pi-agent-core": "^0.
|
|
178
|
-
"@earendil-works/pi-ai": "^0.
|
|
179
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
179
|
+
"@earendil-works/pi-agent-core": "^0.84.1",
|
|
180
|
+
"@earendil-works/pi-ai": "^0.84.1",
|
|
181
|
+
"@earendil-works/pi-coding-agent": "^0.84.1",
|
|
180
182
|
"@inkjs/ui": "^2.0.0",
|
|
181
183
|
"@linear/sdk": "^77.0.0",
|
|
182
184
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
183
|
-
"@openai/codex-sdk": "^0.
|
|
184
|
-
"@opencode-ai/sdk": "^1.18.
|
|
185
|
+
"@openai/codex-sdk": "^0.147.0",
|
|
186
|
+
"@opencode-ai/sdk": "^1.18.15",
|
|
185
187
|
"@openfort/openfort-node": "^0.9.1",
|
|
186
188
|
"@opentelemetry/api": "^1.9.1",
|
|
187
189
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
linkIdentity,
|
|
5
5
|
recordUnmappedIdentity,
|
|
6
6
|
resolveIdentity
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-psh3c4va.js";
|
|
8
8
|
import {
|
|
9
9
|
getKv,
|
|
10
10
|
init_db,
|
|
11
11
|
upsertKv
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-a4jzdpa3.js";
|
|
13
13
|
|
|
14
14
|
// src/slack/enrich.ts
|
|
15
15
|
init_db();
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
require_dist,
|
|
10
10
|
require_dist1 as require_dist2
|
|
11
|
-
} from "./cli-
|
|
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,19 +28,21 @@ 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
|
-
|
|
43
|
+
exports_supports_color,
|
|
44
|
+
init_supports_color
|
|
45
|
+
} from "./cli-3fj60etf.js";
|
|
44
46
|
import {
|
|
45
47
|
require_event_streams
|
|
46
48
|
} from "./cli-9sbhdpvb.js";
|
|
@@ -70,6 +72,7 @@ import {
|
|
|
70
72
|
import {
|
|
71
73
|
__commonJS,
|
|
72
74
|
__require,
|
|
75
|
+
__toCommonJS,
|
|
73
76
|
__toESM
|
|
74
77
|
} from "./cli-p9swy5t3.js";
|
|
75
78
|
|
|
@@ -4805,7 +4808,7 @@ var require_node = __commonJS((exports, module) => {
|
|
|
4805
4808
|
exports.destroy = util.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
4806
4809
|
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
4807
4810
|
try {
|
|
4808
|
-
const supportsColor =
|
|
4811
|
+
const supportsColor = (init_supports_color(), __toCommonJS(exports_supports_color));
|
|
4809
4812
|
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
4810
4813
|
exports.colors = [
|
|
4811
4814
|
20,
|
|
@@ -5185,6 +5188,7 @@ var stream = (model, context, options = {}) => {
|
|
|
5185
5188
|
config.token = { token: bearerToken };
|
|
5186
5189
|
config.authSchemePreference = ["httpBearerAuth"];
|
|
5187
5190
|
}
|
|
5191
|
+
let responseRequestId;
|
|
5188
5192
|
try {
|
|
5189
5193
|
const client = new import_client_bedrock_runtime.BedrockRuntimeClient(config);
|
|
5190
5194
|
const customHeaders = providerHeadersToRecord(options.headers);
|
|
@@ -5211,6 +5215,7 @@ var stream = (model, context, options = {}) => {
|
|
|
5211
5215
|
}
|
|
5212
5216
|
const command = new import_client_bedrock_runtime.ConverseStreamCommand(commandInput);
|
|
5213
5217
|
const response = await client.send(command, { abortSignal: options.signal });
|
|
5218
|
+
responseRequestId = normalizeDiagnosticValue(response.$metadata.requestId);
|
|
5214
5219
|
if (response.$metadata.httpStatusCode !== undefined) {
|
|
5215
5220
|
const responseHeaders = {};
|
|
5216
5221
|
if (response.$metadata.requestId) {
|
|
@@ -5269,6 +5274,9 @@ var stream = (model, context, options = {}) => {
|
|
|
5269
5274
|
}
|
|
5270
5275
|
output.stopReason = options.signal?.aborted ? "aborted" : "error";
|
|
5271
5276
|
output.errorMessage = formatBedrockError(error);
|
|
5277
|
+
if (output.stopReason === "error") {
|
|
5278
|
+
appendBedrockFailureDiagnostic(output, error, responseRequestId);
|
|
5279
|
+
}
|
|
5272
5280
|
stream2.push({ type: "error", reason: output.stopReason, error: output });
|
|
5273
5281
|
stream2.end();
|
|
5274
5282
|
}
|
|
@@ -5293,6 +5301,35 @@ function formatBedrockError(error) {
|
|
|
5293
5301
|
}
|
|
5294
5302
|
return `${core}${dataRetentionHint}`;
|
|
5295
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
|
+
}
|
|
5296
5333
|
var RESERVED_HEADER_EXACT = new Set(["authorization", "host"]);
|
|
5297
5334
|
function isReservedHeader(key) {
|
|
5298
5335
|
const lower = key.toLowerCase();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAdditiveBuffer,
|
|
3
3
|
extractSlackMessageText
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-d3x3x1c9.js";
|
|
5
5
|
import {
|
|
6
6
|
rewriteSlackMentions
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-78xwvkhj.js";
|
|
8
8
|
import {
|
|
9
9
|
createTaskWithSiblingAwareness
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-cdeg08wx.js";
|
|
11
11
|
import {
|
|
12
12
|
buildBufferFlushBlocks,
|
|
13
13
|
ensureSlackThreadTree,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
getSlackApp,
|
|
17
17
|
isSlackRenderV2Enabled,
|
|
18
18
|
registerTreeMessage
|
|
19
|
-
} from "./cli-
|
|
19
|
+
} from "./cli-cvgjwnh1.js";
|
|
20
20
|
import {
|
|
21
21
|
createLogEntry,
|
|
22
22
|
getAgentById,
|
|
@@ -29,13 +29,13 @@ import {
|
|
|
29
29
|
init_steering,
|
|
30
30
|
requestSteering,
|
|
31
31
|
slackContextKey
|
|
32
|
-
} from "./cli-
|
|
32
|
+
} from "./cli-a4jzdpa3.js";
|
|
33
33
|
import {
|
|
34
34
|
init_registry,
|
|
35
35
|
init_steering_enabled,
|
|
36
36
|
isSteeringEnabled,
|
|
37
37
|
registerTemplate
|
|
38
|
-
} from "./cli-
|
|
38
|
+
} from "./cli-xpxde7rm.js";
|
|
39
39
|
|
|
40
40
|
// src/slack/event-dedup.ts
|
|
41
41
|
var DEFAULT_TTL_MS = 300000;
|