@desplega.ai/agent-swarm 2.13.1 → 2.13.3
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/acp-adapter-t2q6nsqv.js +17 -0
- package/dist/{acp-targets-n7vm5atw.js → acp-targets-k8xs4tj8.js} +7 -7
- package/dist/{actions-hq6wp9xv.js → actions-pg5fxjer.js} +25 -25
- package/dist/{agent-fs-provision-y0qc1rdd.js → agent-fs-provision-vbk3fppw.js} +4 -4
- package/dist/{amp-adapter-1qqs6h91.js → amp-adapter-adbhxsz9.js} +2 -2
- package/dist/{app-7m4z44rv.js → app-b267ggx1.js} +8 -8
- package/dist/{approval-notifications-8sr41gjx.js → approval-notifications-evc1a9z5.js} +9 -9
- package/dist/{assistant-hkczwfv6.js → assistant-wgz2ab84.js} +26 -26
- package/dist/{boot-args-schema-8025snev.js → boot-args-schema-6tpk28j4.js} +1 -1
- package/dist/{boot-reembed-15m87nr1.js → boot-reembed-ankp369c.js} +1 -1
- package/dist/{boot-reembed-4bbpxjh1.js → boot-reembed-r1zyvefv.js} +1 -1
- package/dist/{boot-scrub-sweep-eajr97e9.js → boot-scrub-sweep-cgb6r5bd.js} +2 -2
- package/dist/{boot-seeds-9cwy39jx.js → boot-seeds-bjceqg7b.js} +4 -4
- package/dist/{claude-adapter-g61wa4rt.js → claude-adapter-knztdnff.js} +9 -6
- package/dist/{claude-managed-adapter-znkk0prm.js → claude-managed-adapter-qwejzqkk.js} +3 -3
- package/dist/{claude-managed-setup-f1wndkr2.js → claude-managed-setup-0vgz4d1j.js} +4 -4
- package/dist/{claude-sdk-session-687xzf21.js → claude-sdk-session-c3g6dv0g.js} +11984 -11775
- package/dist/{cli-4mj5g29m.js → cli-0j4qmc80.js} +7 -7
- package/dist/{cli-fn8aj7gb.js → cli-1606qw3n.js} +98 -71
- package/dist/{cli-w41bvvms.js → cli-1gnf5c7x.js} +1 -1
- package/dist/{cli-aebswqmz.js → cli-1wew39p0.js} +15 -15
- package/dist/{cli-0fx95c06.js → cli-268b3dgn.js} +2 -2
- package/dist/cli-2ap1the6.js +11 -0
- package/dist/{cli-w6c6dj91.js → cli-4dyhzhpx.js} +1 -1
- package/dist/{cli-grcc2h2g.js → cli-55fqpd9q.js} +8 -8
- package/dist/{cli-p7g7wd9n.js → cli-61fzwtjk.js} +7 -7
- package/dist/{cli-zaate0rd.js → cli-61p7ty8d.js} +2 -2
- package/dist/{cli-cp0m07wb.js → cli-7fa6yv98.js} +2 -2
- package/dist/{cli-5v6b2am8.js → cli-7kv5d674.js} +7 -7
- package/dist/{cli-6r1dwegd.js → cli-80d5g0fa.js} +2 -2
- package/dist/{cli-0xwb7zpt.js → cli-88np9va3.js} +1 -1
- package/dist/{cli-1b5axkt1.js → cli-8m6gqnf1.js} +2 -2
- package/dist/{cli-0a336ze7.js → cli-8pnawt98.js} +3 -3
- package/dist/{cli-7ewre3dm.js → cli-8sayvj48.js} +2 -2
- package/dist/{cli-yeh3g1q6.js → cli-9gmkw6xn.js} +53 -32
- package/dist/{cli-h03j6je3.js → cli-a21cwm89.js} +2 -2
- package/dist/{cli-s6fhqbz1.js → cli-aytna2fm.js} +1 -1
- package/dist/{cli-84xtgbn6.js → cli-b0m3bg0f.js} +100 -2
- package/dist/{cli-mwxez0pz.js → cli-b768ek79.js} +1 -1
- package/dist/{cli-9xx36trj.js → cli-bh53ppqm.js} +2 -2
- package/dist/{cli-1carhg8g.js → cli-czeh7x13.js} +3 -3
- package/dist/{cli-cd9acnvd.js → cli-djwt4mtn.js} +71 -5
- package/dist/{cli-sfajkbd7.js → cli-dq30fq3q.js} +2 -2
- package/dist/{cli-a8ts6x1n.js → cli-dw43pnzp.js} +5 -5
- package/dist/{cli-h9bejmkf.js → cli-e4gx499y.js} +52 -29
- package/dist/{cli-t90k0phh.js → cli-ea367bdn.js} +32 -23
- package/dist/{cli-cmgdptmx.js → cli-ef590376.js} +29 -5
- package/dist/{cli-8rbkw18r.js → cli-fbmgpt72.js} +2 -2
- package/dist/{cli-tzzas8rb.js → cli-g4dhd3pr.js} +2 -2
- package/dist/{cli-snypfjgj.js → cli-gc715jrc.js} +1 -1
- package/dist/{cli-c0tyzt73.js → cli-gkjw33x5.js} +1 -1
- package/dist/{cli-z6m6xzxt.js → cli-grk77aen.js} +26 -5
- package/dist/{cli-hs3mqswp.js → cli-gxqwm3k3.js} +5 -5
- package/dist/{cli-4h90xaet.js → cli-h3drhntp.js} +1 -1
- package/dist/{cli-qn79645p.js → cli-h9d3sdnc.js} +1 -1
- package/dist/{cli-byxsctca.js → cli-hd2a204w.js} +6 -6
- package/dist/{cli-1dr5at77.js → cli-hhb8kbwd.js} +12 -12
- package/dist/{cli-zvpkrgsc.js → cli-hpxcfvdm.js} +3 -3
- package/dist/{cli-cqxwjb93.js → cli-hxj888w3.js} +1 -1
- package/dist/{cli-82j36f2m.js → cli-jjzxsk47.js} +9 -3
- package/dist/{cli-13t0smbk.js → cli-ka4tqjzd.js} +185 -58
- package/dist/{cli-jhtvt7gn.js → cli-kh973792.js} +3 -3
- package/dist/{cli-x5yb8zc8.js → cli-kwm1bek7.js} +1 -1
- package/dist/{cli-bjmq14k9.js → cli-mgr3gatr.js} +4 -4
- package/dist/{cli-c8kqmzzf.js → cli-nbawx3s0.js} +2 -2
- package/dist/{cli-04103ryh.js → cli-ppf9ap9n.js} +1 -1
- package/dist/{cli-dd57p1gd.js → cli-pzsedyb0.js} +4 -4
- package/dist/{cli-32xndx6b.js → cli-r6xnchva.js} +2 -2
- package/dist/{cli-4tbvndmm.js → cli-r8ddn0hf.js} +1 -1
- package/dist/{cli-y6qqbpwc.js → cli-snwz16eg.js} +1 -1
- package/dist/{cli-w24f3j49.js → cli-sy2ge2ye.js} +7 -6
- package/dist/{cli-3m8vqehw.js → cli-syqcny89.js} +3 -3
- package/dist/{cli-qx1dwrr5.js → cli-tjf1bh1v.js} +2 -2
- package/dist/{cli-xhkek467.js → cli-v1v49t36.js} +28 -2
- package/dist/{cli-cn6fpa1p.js → cli-v8rpjrnx.js} +1 -1
- package/dist/{cli-mmw2sjaf.js → cli-vgh5adn9.js} +5 -5
- package/dist/{cli-3zyme1wt.js → cli-w24741sm.js} +3 -3
- package/dist/{cli-gq6qhmrr.js → cli-wsnradtk.js} +3 -3
- package/dist/{cli-nk8swfpx.js → cli-wtffytm8.js} +3 -3
- package/dist/{cli-0m77n7ej.js → cli-xc8m5cjn.js} +54 -12
- package/dist/{cli-8cmjkbvj.js → cli-y0q92v4r.js} +2 -2
- package/dist/{cli-gedf48yw.js → cli-y754psdt.js} +4 -4
- package/dist/cli.js +19 -18
- package/dist/{codex-adapter-ysfg6ty3.js → codex-adapter-493vb8cv.js} +5 -5
- package/dist/{codex-hook-c0nvm30r.js → codex-hook-ej8hn6z5.js} +9 -2
- package/dist/{codex-session-runner-823scr6g.js → codex-session-runner-ps5m4z1g.js} +5 -5
- package/dist/{commands-5rbm07fz.js → commands-shktk0b8.js} +3 -3
- package/dist/{controllers-connect-34jzhfft.js → controllers-connect-yft057ws.js} +24 -24
- package/dist/core-nheayfgm.js +42 -0
- package/dist/{cursor-adapter-w1681kp1.js → cursor-adapter-8fpm4dng.js} +1 -1
- package/dist/{db-6bkgbfwk.js → db-0ezhdhz5.js} +3 -3
- package/dist/{db-hcj16x7z.js → db-84pz2w5c.js} +2 -2
- package/dist/{dispatcher-jgjqrfzv.js → dispatcher-h2rz69f6.js} +23 -23
- package/dist/{easter-egg-3d-w17nsny6.js → easter-egg-3d-m41ad78v.js} +1 -1
- package/dist/{embedding-space-v06fwy7b.js → embedding-space-yam9zwzj.js} +6 -6
- package/dist/{embeddings-g50dxea4.js → embeddings-g2be0y8q.js} +1 -1
- package/dist/{execute-1n36haw1.js → execute-hhdejgzf.js} +1 -1
- package/dist/{external-channel-43tv8pg6.js → external-channel-kjt2yzfj.js} +2 -2
- package/dist/fx-adapter-8g7xsp8q.js +20 -0
- package/dist/{grok-adapter-my5j8mdf.js → grok-adapter-ztk2zkz1.js} +9 -9
- package/dist/handlers-9ywssz71.js +41 -0
- package/dist/{heartbeat-sf3nk937.js → heartbeat-2e5jdexj.js} +25 -25
- package/dist/{hook-dqph1e05.js → hook-34s8cmgn.js} +9 -6
- package/dist/{hook-m1m9dm6w.js → hook-acg9saz7.js} +8 -5
- package/dist/{http-w0th1cz9.js → http-ra2zr2f8.js} +304 -111
- package/dist/{index-pb03vans.js → index-2z1z7qx6.js} +26 -26
- package/dist/{index-p2f5xg64.js → index-3j803vnb.js} +36259 -34299
- package/dist/index-6mgbdtv1.js +44 -0
- package/dist/{index-e8pz8qdg.js → index-7dgxveck.js} +2 -2
- package/dist/{index-gkpfgpg7.js → index-93bw5wds.js} +1 -1
- package/dist/{index-c0e8en64.js → index-9q42cr54.js} +1 -1
- package/dist/{index-ffba0z8q.js → index-9r4j0a60.js} +28 -18
- package/dist/index-hqdsn2t2.js +39 -0
- package/dist/{index-k8ajc0g0.js → index-maddg9ys.js} +1 -1
- package/dist/{index-y4vd4mhn.js → index-mbpxhc4w.js} +1 -1
- package/dist/index-rz8ve510.js +569 -0
- package/dist/index-st231bqv.js +40 -0
- package/dist/{index-ez823q84.js → index-ym9fgxad.js} +1 -1
- package/dist/{keepalive-2v06q2e8.js → keepalive-vjnnqbkm.js} +4 -4
- package/dist/lead-mk0xkth2.js +82 -0
- package/dist/{maintenance-vx7vjhhy.js → maintenance-px2g599e.js} +1 -1
- package/dist/{oauth-refresh-sweep-g06k4bza.js → oauth-refresh-sweep-nkykf09m.js} +3 -3
- package/dist/{object-webhooks-3dzdq4fm.js → object-webhooks-gt9xnq21.js} +7 -7
- package/dist/{onboard-232pazny.js → onboard-1f134p65.js} +3 -3
- package/dist/{opencode-adapter-t0paqbh8.js → opencode-adapter-94976yab.js} +6 -6
- package/dist/{otel-impl-kmpkyp4y.js → otel-impl-5d4p2fqs.js} +1 -1
- package/dist/{pending-x0z3vx1x.js → pending-vkk0vx6n.js} +24 -24
- package/dist/{pi-mono-adapter-7pmypn6d.js → pi-mono-adapter-cyzdv5er.js} +11 -11
- package/dist/{pricing-refresh-ytjmtyd7.js → pricing-refresh-jtmjwss9.js} +2 -2
- package/dist/{rbac-roles-xyaxekh3.js → rbac-roles-1fvmdyeb.js} +2 -2
- package/dist/{rbac-roles-fgm5mxr2.js → rbac-roles-yd1fgpsn.js} +3 -3
- package/dist/{render-v2-ws972g4r.js → render-v2-kb5s3vx4.js} +8 -8
- package/dist/{resume-m6mjzhkp.js → resume-z1vs44n5.js} +11 -11
- package/dist/{runtime-zzpc0c8a.js → runtime-gk6ct7r7.js} +1 -1
- package/dist/{session-access-vp35xs91.js → session-access-nz6nre4d.js} +5 -5
- package/dist/{session-source-backfill-p73e8zbe.js → session-source-backfill-wb60zjkd.js} +1 -1
- package/dist/{setup-r4kd7rxg.js → setup-2x8g8j4s.js} +1 -1
- package/dist/thread-buffer-d50rqpev.js +42 -0
- package/dist/{tree-visibility-07h2tbs2.js → tree-visibility-ts3z30kw.js} +2 -2
- package/dist/{user-merge-jobs-96vg9rpe.js → user-merge-jobs-zetg26e0.js} +3 -3
- package/dist/{virtual-modules-vgn3f2x4.js → virtual-modules-674fka8x.js} +3 -3
- package/dist/{work-objects-74hbcx3e.js → work-objects-w52yyjxm.js} +26 -26
- package/dist/worker-662x1vse.js +82 -0
- package/dist/{worker-follow-up-ezavwn5d.js → worker-follow-up-dyfxyjbj.js} +23 -23
- package/openapi.json +6 -2
- package/package.json +7 -6
- package/src/be/migrations/341_user_token_expiry.sql +4 -0
- package/src/be/scripts/run-credential.ts +55 -1
- package/src/be/scripts/typecheck.ts +4 -4
- package/src/be/scripts/user-code-mode.ts +160 -0
- package/src/be/users.ts +48 -7
- package/src/commands/onboard/agent-fs-version.ts +1 -1
- package/src/commands/runner.ts +62 -6
- package/src/hooks/codex-hook.ts +15 -4
- package/src/hooks/hook.ts +7 -0
- package/src/http/script-connection-proxy.ts +18 -6
- package/src/http/scripts.ts +2 -11
- package/src/http/session-cost-recompute.ts +3 -1
- package/src/http/session-data.ts +3 -0
- package/src/http/users.ts +1 -0
- package/src/integrations/chat-sdk/adapters.ts +29 -0
- package/src/integrations/chat-sdk/limits.ts +3 -0
- package/src/integrations/chat-sdk/rocketchat/README.md +8 -0
- package/src/integrations/chat-sdk/rocketchat/index.ts +790 -0
- package/src/integrations/chat-sdk/rocketchat/markdown.ts +210 -0
- package/src/integrations/chat-sdk/rocketchat/types.ts +249 -0
- package/src/integrations/chat-sdk/runtime.ts +11 -5
- package/src/integrations/chat-sdk/schema.ts +37 -3
- package/src/integrations/chat-sdk/status.ts +9 -0
- package/src/prompts/base-prompt.ts +1 -1
- package/src/prompts/session-templates.ts +1 -1
- package/src/providers/acp-targets.ts +2 -2
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/claude-adapter.ts +21 -1
- package/src/providers/claude-sdk-session.ts +22 -3
- package/src/providers/claude-session-events.ts +76 -1
- package/src/providers/cursor-adapter.ts +1 -1
- package/src/providers/fx-adapter.ts +2 -2
- package/src/providers/pricing-sources.md +3 -0
- package/src/providers/types.ts +13 -0
- package/src/rbac/legacy-policy.ts +1 -0
- package/src/rbac/permissions.ts +4 -0
- package/src/scripts-runtime/executors/native.ts +225 -67
- package/src/scripts-runtime/mcp-client.ts +2 -1
- package/src/scripts-runtime/swarm-sdk.ts +2 -1
- package/src/scripts-runtime/types/stdlib.d.ts +4 -4
- package/src/scripts-runtime/types/swarm-sdk.d.ts +4 -4
- package/src/server-user.ts +98 -0
- package/src/slack/render-v2.ts +27 -7
- package/src/tests/base-prompt.test.ts +6 -2
- package/src/tests/chat-sdk-rocketchat-vendored.test.ts +67 -0
- package/src/tests/chat-sdk-status-route.test.ts +13 -1
- package/src/tests/claude-adapter.test.ts +115 -0
- package/src/tests/codex-app-server.test.ts +4 -6
- package/src/tests/fixtures/fx/acp-updates-recorded.jsonl +1 -1
- package/src/tests/internal-ai/complete-structured.test.ts +105 -0
- package/src/tests/internal-ai/credentials.test.ts +149 -0
- package/src/tests/internal-ai/task-title.test.ts +78 -0
- package/src/tests/mcp-input-caps.test.ts +16 -11
- package/src/tests/mcp-user-route.test.ts +10 -1
- package/src/tests/runner-slot-reconcile.test.ts +102 -0
- package/src/tests/script-connections-mcp.test.ts +14 -10
- package/src/tests/script-connections-sql.test.ts +6 -2
- package/src/tests/script-connections.test.ts +2 -0
- package/src/tests/slack-render-v2.test.ts +85 -0
- package/src/tools/script-common.ts +37 -22
- package/src/tools/script-query-types.ts +1 -1
- package/src/tools/script-run.ts +1 -1
- package/src/tools/script-search.ts +12 -10
- package/src/tools/utils.ts +7 -1
- package/src/types.ts +2 -1
- package/src/utils/internal-ai/complete-structured.ts +36 -5
- package/src/utils/internal-ai/credentials.ts +78 -2
- package/src/utils/internal-ai/models.ts +37 -1
- package/src/utils/internal-ai/task-title.ts +31 -1
- package/templates/skills/chat-sdk/content.md +2 -2
- package/templates/skills/swarm-docs/content.md +10 -0
- package/dist/acp-adapter-xtj40wd8.js +0 -17
- package/dist/core-kdehq26g.js +0 -42
- package/dist/fx-adapter-bvh05t4a.js +0 -20
- package/dist/handlers-wyymeeqh.js +0 -41
- package/dist/index-22khdtby.js +0 -44
- package/dist/index-np0582ac.js +0 -40
- package/dist/index-vgkrj1jt.js +0 -39
- package/dist/lead-55z813ng.js +0 -79
- package/dist/thread-buffer-cm2nzq6t.js +0 -42
- package/dist/worker-5pn2vzx6.js +0 -79
- /package/dist/{cli-m4ejz4nj.js → cli-cah298e5.js} +0 -0
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
getWorkflowVersions2,
|
|
47
47
|
getMcpServerById2,
|
|
48
48
|
init_db4
|
|
49
|
-
} from "./cli-
|
|
49
|
+
} from "./cli-e4gx499y.js";
|
|
50
50
|
import {
|
|
51
51
|
McpHttpClient,
|
|
52
52
|
init_http_client
|
|
@@ -61,17 +61,17 @@ import {
|
|
|
61
61
|
oauthAppRowToProviderConfig,
|
|
62
62
|
ensureAuthorizationTokenOrThrow,
|
|
63
63
|
init_ensure_token
|
|
64
|
-
} from "./cli-
|
|
64
|
+
} from "./cli-8sayvj48.js";
|
|
65
65
|
import {
|
|
66
66
|
AGENT_FS_API_KEY_CONFIG,
|
|
67
67
|
init_script_fs,
|
|
68
68
|
resolveAgentFsIdentity,
|
|
69
69
|
init_agent_fs_identity
|
|
70
|
-
} from "./cli-
|
|
70
|
+
} from "./cli-snwz16eg.js";
|
|
71
71
|
import {
|
|
72
72
|
validateDefinition,
|
|
73
73
|
init_definition2
|
|
74
|
-
} from "./cli-
|
|
74
|
+
} from "./cli-hhb8kbwd.js";
|
|
75
75
|
import {
|
|
76
76
|
getApiKey,
|
|
77
77
|
init_api_key
|
|
@@ -83,12 +83,14 @@ import {
|
|
|
83
83
|
refreshMcpToken,
|
|
84
84
|
computeExpiresAt,
|
|
85
85
|
init_mcp_wrapper
|
|
86
|
-
} from "./cli-
|
|
86
|
+
} from "./cli-gkjw33x5.js";
|
|
87
87
|
import {
|
|
88
|
+
mintUserScriptRunToken,
|
|
89
|
+
revokeUserScriptRunToken,
|
|
88
90
|
mintScriptRunToken,
|
|
89
91
|
revokeSessionToken,
|
|
90
92
|
init_users
|
|
91
|
-
} from "./cli-
|
|
93
|
+
} from "./cli-grk77aen.js";
|
|
92
94
|
import {
|
|
93
95
|
defaultAssetKey,
|
|
94
96
|
init_key,
|
|
@@ -9019,14 +9021,127 @@ async function linkOrWriteBareImportShims(baseTmpDir, tmpdir) {
|
|
|
9019
9021
|
await writeBareImportShims(tmpdir);
|
|
9020
9022
|
}
|
|
9021
9023
|
}
|
|
9022
|
-
function
|
|
9023
|
-
return
|
|
9024
|
-
|
|
9025
|
-
|
|
9026
|
-
|
|
9027
|
-
|
|
9028
|
-
|
|
9029
|
-
}
|
|
9024
|
+
function harnessRunPaths(tmpdir) {
|
|
9025
|
+
return {
|
|
9026
|
+
argsFile: `${tmpdir}/args.json`,
|
|
9027
|
+
sourceFile: `${tmpdir}/user-module/user-script.ts`,
|
|
9028
|
+
resultFile: `${tmpdir}/result.json`,
|
|
9029
|
+
errorFile: `${tmpdir}/error.json`,
|
|
9030
|
+
startedFile: `${tmpdir}/started.marker`
|
|
9031
|
+
};
|
|
9032
|
+
}
|
|
9033
|
+
function harnessEnvFor(spec, tmpdir) {
|
|
9034
|
+
const paths = harnessRunPaths(tmpdir);
|
|
9035
|
+
return {
|
|
9036
|
+
PATH: process.env.PATH ?? "/usr/bin:/bin",
|
|
9037
|
+
HOME: spec.runAs ? tmpdir : process.env.HOME ?? "/tmp",
|
|
9038
|
+
LANG: process.env.LANG ?? "C.UTF-8",
|
|
9039
|
+
LC_ALL: process.env.LC_ALL ?? "C.UTF-8",
|
|
9040
|
+
TMPDIR: tmpdir,
|
|
9041
|
+
SWARM_SCRIPT_TMPDIR: tmpdir,
|
|
9042
|
+
SWARM_SCRIPT_ARGS_FILE: paths.argsFile,
|
|
9043
|
+
SWARM_SCRIPT_SOURCE_FILE: paths.sourceFile,
|
|
9044
|
+
SWARM_SCRIPT_RESULT_FILE: paths.resultFile,
|
|
9045
|
+
SWARM_SCRIPT_ERROR_FILE: paths.errorFile,
|
|
9046
|
+
SWARM_SCRIPT_STARTED_FILE: paths.startedFile,
|
|
9047
|
+
...spec.hostValidatedArgs ? { SWARM_SCRIPT_HOST_VALIDATED_ARGS: "1" } : {}
|
|
9048
|
+
};
|
|
9049
|
+
}
|
|
9050
|
+
function spawnHarness(spec, tmpdir) {
|
|
9051
|
+
const harnessEnv = harnessEnvFor(spec, tmpdir);
|
|
9052
|
+
const limits = {
|
|
9053
|
+
virtualMemoryMb: spec.resources.memoryMb,
|
|
9054
|
+
cpuTimeSec: spec.resources.cpuTimeSec,
|
|
9055
|
+
maxProcs: spec.resources.maxProcs,
|
|
9056
|
+
maxFileKb: Math.floor(spec.resources.maxFileBytes / 1024),
|
|
9057
|
+
maxFdCount: spec.resources.maxFdCount
|
|
9058
|
+
};
|
|
9059
|
+
return registerProcessGroup(Bun.spawn(buildSandboxedCommand(["bun", "run", spec.harnessPath], harnessEnv, limits, "inline", spec.runAs), {
|
|
9060
|
+
env: sandboxSpawnEnv(harnessEnv),
|
|
9061
|
+
cwd: tmpdir,
|
|
9062
|
+
detached: detachedProcessGroup,
|
|
9063
|
+
stdin: "pipe",
|
|
9064
|
+
stdout: "pipe",
|
|
9065
|
+
stderr: "pipe"
|
|
9066
|
+
}));
|
|
9067
|
+
}
|
|
9068
|
+
function harnessSpecKey(spec) {
|
|
9069
|
+
return JSON.stringify([
|
|
9070
|
+
spec.harnessPath,
|
|
9071
|
+
spec.baseTmpDir,
|
|
9072
|
+
spec.runAs ?? null,
|
|
9073
|
+
spec.hostValidatedArgs,
|
|
9074
|
+
spec.resources.memoryMb,
|
|
9075
|
+
spec.resources.cpuTimeSec,
|
|
9076
|
+
spec.resources.maxProcs,
|
|
9077
|
+
spec.resources.maxFileBytes,
|
|
9078
|
+
spec.resources.maxFdCount,
|
|
9079
|
+
process.env.PATH ?? null,
|
|
9080
|
+
process.env.HOME ?? null,
|
|
9081
|
+
process.env.LANG ?? null,
|
|
9082
|
+
process.env.LC_ALL ?? null
|
|
9083
|
+
]);
|
|
9084
|
+
}
|
|
9085
|
+
function harnessAlive(proc) {
|
|
9086
|
+
return proc.exitCode === null && proc.signalCode === null && !proc.killed;
|
|
9087
|
+
}
|
|
9088
|
+
function discardWarmHarness(entry) {
|
|
9089
|
+
clearTimeout(entry.idleTimer);
|
|
9090
|
+
if (warmHarnesses.get(entry.key) === entry)
|
|
9091
|
+
warmHarnesses.delete(entry.key);
|
|
9092
|
+
terminateProcessGroup(entry.proc.pid).catch(() => {}).finally(() => rm(entry.tmpdir, { recursive: true, force: true }).catch(() => {}));
|
|
9093
|
+
}
|
|
9094
|
+
function takeWarmHarness(key) {
|
|
9095
|
+
const entry = warmHarnesses.get(key);
|
|
9096
|
+
if (!entry)
|
|
9097
|
+
return;
|
|
9098
|
+
warmHarnesses.delete(key);
|
|
9099
|
+
clearTimeout(entry.idleTimer);
|
|
9100
|
+
if (!harnessAlive(entry.proc)) {
|
|
9101
|
+
discardWarmHarness(entry);
|
|
9102
|
+
return;
|
|
9103
|
+
}
|
|
9104
|
+
entry.proc.ref();
|
|
9105
|
+
return entry;
|
|
9106
|
+
}
|
|
9107
|
+
async function startWarmHarness(key, spec) {
|
|
9108
|
+
if (process.platform === "win32")
|
|
9109
|
+
return;
|
|
9110
|
+
if (warmHarnesses.has(key) || warmingSpecs.has(key))
|
|
9111
|
+
return;
|
|
9112
|
+
warmingSpecs.add(key);
|
|
9113
|
+
const tmpdir = `${spec.baseTmpDir}/swarm-script-${crypto.randomUUID()}`;
|
|
9114
|
+
let started = false;
|
|
9115
|
+
try {
|
|
9116
|
+
await mkdir(tmpdir, { recursive: true, mode: 493 });
|
|
9117
|
+
await linkOrWriteBareImportShims(spec.baseTmpDir, tmpdir);
|
|
9118
|
+
if (warmHarnesses.has(key))
|
|
9119
|
+
return;
|
|
9120
|
+
const proc = spawnHarness(spec, tmpdir);
|
|
9121
|
+
proc.unref();
|
|
9122
|
+
started = true;
|
|
9123
|
+
const entry = {
|
|
9124
|
+
key,
|
|
9125
|
+
tmpdir,
|
|
9126
|
+
proc,
|
|
9127
|
+
idleTimer: setTimeout(() => discardWarmHarness(entry), WARM_IDLE_MS)
|
|
9128
|
+
};
|
|
9129
|
+
entry.idleTimer.unref?.();
|
|
9130
|
+
if (warmHarnesses.size >= MAX_WARM_SPECS) {
|
|
9131
|
+
const oldest = warmHarnesses.values().next().value;
|
|
9132
|
+
if (oldest)
|
|
9133
|
+
discardWarmHarness(oldest);
|
|
9134
|
+
}
|
|
9135
|
+
warmHarnesses.set(key, entry);
|
|
9136
|
+
proc.exited.then(() => {
|
|
9137
|
+
if (warmHarnesses.get(key) === entry)
|
|
9138
|
+
discardWarmHarness(entry);
|
|
9139
|
+
}, () => {});
|
|
9140
|
+
} catch {} finally {
|
|
9141
|
+
warmingSpecs.delete(key);
|
|
9142
|
+
if (!started)
|
|
9143
|
+
await rm(tmpdir, { recursive: true, force: true }).catch(() => {});
|
|
9144
|
+
}
|
|
9030
9145
|
}
|
|
9031
9146
|
|
|
9032
9147
|
class NativeScriptExecutor {
|
|
@@ -9037,15 +9152,16 @@ class NativeScriptExecutor {
|
|
|
9037
9152
|
}
|
|
9038
9153
|
const start = Date.now();
|
|
9039
9154
|
const baseTmpDir = process.env.TMPDIR ?? (process.platform === "win32" ? osTmpdir() : "/tmp");
|
|
9040
|
-
const tmpdir = `${baseTmpDir}/swarm-script-${crypto.randomUUID()}`;
|
|
9041
|
-
await mkdir(`${tmpdir}/user-module`, { recursive: true });
|
|
9042
|
-
const argsFile = `${tmpdir}/args.json`;
|
|
9043
|
-
const sourceFile = `${tmpdir}/user-module/user-script.ts`;
|
|
9044
|
-
const resultFile = `${tmpdir}/result.json`;
|
|
9045
|
-
const errorFile = `${tmpdir}/error.json`;
|
|
9046
|
-
const startedFile = `${tmpdir}/started.marker`;
|
|
9047
9155
|
const runAs = resolveSandboxIdentity();
|
|
9048
9156
|
const harnessPath = process.env.SCRIPT_RUNTIME_DIR ? `${process.env.SCRIPT_RUNTIME_DIR}/eval-harness.bundle.js` : fileURLToPath(new URL("../eval-harness.ts", import.meta.url));
|
|
9157
|
+
const spec = {
|
|
9158
|
+
harnessPath,
|
|
9159
|
+
baseTmpDir,
|
|
9160
|
+
runAs,
|
|
9161
|
+
hostValidatedArgs: Boolean(input.hostValidatedArgs),
|
|
9162
|
+
resources: input.resources
|
|
9163
|
+
};
|
|
9164
|
+
const specKey = harnessSpecKey(spec);
|
|
9049
9165
|
let timedOut = false;
|
|
9050
9166
|
let killed = input.signal?.aborted ?? false;
|
|
9051
9167
|
let removeAbortListener;
|
|
@@ -9059,9 +9175,14 @@ class NativeScriptExecutor {
|
|
|
9059
9175
|
exitCode: 1,
|
|
9060
9176
|
error: "killed"
|
|
9061
9177
|
});
|
|
9178
|
+
if (killed)
|
|
9179
|
+
return killedOutput();
|
|
9180
|
+
const warm = takeWarmHarness(specKey);
|
|
9181
|
+
const tmpdir = warm?.tmpdir ?? `${baseTmpDir}/swarm-script-${crypto.randomUUID()}`;
|
|
9182
|
+
const { argsFile, sourceFile, resultFile, errorFile, startedFile } = harnessRunPaths(tmpdir);
|
|
9183
|
+
if (warm)
|
|
9184
|
+
proc = warm.proc;
|
|
9062
9185
|
try {
|
|
9063
|
-
if (killed)
|
|
9064
|
-
return killedOutput();
|
|
9065
9186
|
const onExternalAbort = () => {
|
|
9066
9187
|
killed = true;
|
|
9067
9188
|
if (proc)
|
|
@@ -9069,11 +9190,13 @@ class NativeScriptExecutor {
|
|
|
9069
9190
|
};
|
|
9070
9191
|
input.signal?.addEventListener("abort", onExternalAbort, { once: true });
|
|
9071
9192
|
removeAbortListener = () => input.signal?.removeEventListener("abort", onExternalAbort);
|
|
9193
|
+
await mkdir(`${tmpdir}/user-module`, { recursive: true });
|
|
9072
9194
|
await Promise.all([
|
|
9073
9195
|
Bun.write(argsFile, JSON.stringify(input.args ?? null)),
|
|
9074
|
-
Bun.write(sourceFile, input.source)
|
|
9075
|
-
linkOrWriteBareImportShims(baseTmpDir, tmpdir)
|
|
9196
|
+
Bun.write(sourceFile, input.source)
|
|
9076
9197
|
]);
|
|
9198
|
+
if (!warm)
|
|
9199
|
+
await linkOrWriteBareImportShims(baseTmpDir, tmpdir);
|
|
9077
9200
|
if (runAs) {
|
|
9078
9201
|
await Promise.all([tmpdir, `${tmpdir}/user-module`, argsFile, sourceFile].map((path) => chown(path, runAs.uid, runAs.gid)));
|
|
9079
9202
|
}
|
|
@@ -9084,34 +9207,15 @@ class NativeScriptExecutor {
|
|
|
9084
9207
|
if (proc)
|
|
9085
9208
|
terminateProcessGroup(proc.pid);
|
|
9086
9209
|
}, input.resources.wallClockMs);
|
|
9087
|
-
const
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
TMPDIR: tmpdir,
|
|
9093
|
-
SWARM_SCRIPT_TMPDIR: tmpdir,
|
|
9094
|
-
SWARM_SCRIPT_ARGS_FILE: argsFile,
|
|
9095
|
-
SWARM_SCRIPT_SOURCE_FILE: sourceFile,
|
|
9096
|
-
SWARM_SCRIPT_RESULT_FILE: resultFile,
|
|
9097
|
-
SWARM_SCRIPT_ERROR_FILE: errorFile,
|
|
9098
|
-
SWARM_SCRIPT_STARTED_FILE: startedFile,
|
|
9099
|
-
...input.hostValidatedArgs ? { SWARM_SCRIPT_HOST_VALIDATED_ARGS: "1" } : {}
|
|
9100
|
-
};
|
|
9101
|
-
proc = registerProcessGroup(Bun.spawn(harnessCommand(harnessPath, input, harnessEnv, runAs), {
|
|
9102
|
-
env: sandboxSpawnEnv(harnessEnv),
|
|
9103
|
-
cwd: tmpdir,
|
|
9104
|
-
detached: detachedProcessGroup,
|
|
9105
|
-
stdin: "pipe",
|
|
9106
|
-
stdout: "pipe",
|
|
9107
|
-
stderr: "pipe"
|
|
9108
|
-
}));
|
|
9109
|
-
proc.stdin.write(JSON.stringify(input.configPayload));
|
|
9110
|
-
proc.stdin.end();
|
|
9210
|
+
const child = proc ?? spawnHarness(spec, tmpdir);
|
|
9211
|
+
proc = child;
|
|
9212
|
+
startWarmHarness(specKey, spec);
|
|
9213
|
+
child.stdin.write(JSON.stringify(input.configPayload));
|
|
9214
|
+
child.stdin.end();
|
|
9111
9215
|
const [stdout, stderr, exitCode] = await Promise.all([
|
|
9112
|
-
readStreamCapped(
|
|
9113
|
-
readStreamCapped(
|
|
9114
|
-
|
|
9216
|
+
readStreamCapped(child.stdout, input.resources.maxStdoutBytes),
|
|
9217
|
+
readStreamCapped(child.stderr, input.resources.maxStdoutBytes),
|
|
9218
|
+
child.exited.catch(() => timedOut ? 124 : 1)
|
|
9115
9219
|
]).finally(() => clearTimeout(timeout));
|
|
9116
9220
|
const runDirCheck = {
|
|
9117
9221
|
maxBytes: input.resources.maxFileBytes,
|
|
@@ -9149,12 +9253,14 @@ class NativeScriptExecutor {
|
|
|
9149
9253
|
}
|
|
9150
9254
|
}
|
|
9151
9255
|
}
|
|
9152
|
-
var SANDBOX_CAPACITY_EXIT_CODE = 134, RUN_DIR_OPEN_FLAGS, cachedDevTargets, sharedShimDirPromises;
|
|
9256
|
+
var SANDBOX_CAPACITY_EXIT_CODE = 134, RUN_DIR_OPEN_FLAGS, cachedDevTargets, sharedShimDirPromises, WARM_IDLE_MS = 30000, MAX_WARM_SPECS = 4, warmHarnesses, warmingSpecs;
|
|
9153
9257
|
var init_native = __esm(() => {
|
|
9154
9258
|
init_process_group();
|
|
9155
9259
|
init_sandboxed_process();
|
|
9156
9260
|
RUN_DIR_OPEN_FLAGS = fsConstants.O_RDONLY | (fsConstants.O_NOFOLLOW ?? 0) | (fsConstants.O_NONBLOCK ?? 0);
|
|
9157
9261
|
sharedShimDirPromises = new Map;
|
|
9262
|
+
warmHarnesses = new Map;
|
|
9263
|
+
warmingSpecs = new Set;
|
|
9158
9264
|
});
|
|
9159
9265
|
|
|
9160
9266
|
// src/scripts-runtime/executors/quickjs.ts
|
|
@@ -178313,6 +178419,10 @@ var init_loader = __esm(() => {
|
|
|
178313
178419
|
});
|
|
178314
178420
|
|
|
178315
178421
|
// src/be/scripts/run-credential.ts
|
|
178422
|
+
function userScriptRunTokenTtlMs() {
|
|
178423
|
+
const override = Number(process.env.SCRIPT_RUN_USER_TOKEN_TTL_MS);
|
|
178424
|
+
return override > 0 && override < SCRIPT_RUN_TOKEN_TTL_MS ? override : SCRIPT_RUN_TOKEN_TTL_MS;
|
|
178425
|
+
}
|
|
178316
178426
|
async function acquireScriptApiCredential(agentId, provenance = {}) {
|
|
178317
178427
|
if (!await getAgentById2(agentId)) {
|
|
178318
178428
|
return { apiKey: undefined, release: async () => {} };
|
|
@@ -178337,6 +178447,23 @@ async function runScriptWithRunCredential(input, provenance = {}) {
|
|
|
178337
178447
|
await credential.release();
|
|
178338
178448
|
}
|
|
178339
178449
|
}
|
|
178450
|
+
async function runScriptAsUserWithRunCredential(input, userId) {
|
|
178451
|
+
const token = await mintUserScriptRunToken(userId, userScriptRunTokenTtlMs());
|
|
178452
|
+
try {
|
|
178453
|
+
return await runScript({
|
|
178454
|
+
...input,
|
|
178455
|
+
apiKey: token.plaintext,
|
|
178456
|
+
agentId: "",
|
|
178457
|
+
egressSecrets: [],
|
|
178458
|
+
failedBindings: [],
|
|
178459
|
+
userConfig: {},
|
|
178460
|
+
apiConnections: [],
|
|
178461
|
+
mcpConnections: []
|
|
178462
|
+
});
|
|
178463
|
+
} finally {
|
|
178464
|
+
await revokeUserScriptRunToken(token.tokenId);
|
|
178465
|
+
}
|
|
178466
|
+
}
|
|
178340
178467
|
var SCRIPT_RUN_TOKEN_TTL_MS;
|
|
178341
178468
|
var init_run_credential = __esm(() => {
|
|
178342
178469
|
init_loader();
|
|
@@ -187802,10 +187929,10 @@ export interface SwarmSdk {
|
|
|
187802
187929
|
|
|
187803
187930
|
// --- write: chat sdk ---
|
|
187804
187931
|
chat_reply(args: { text?: string; card?: unknown }): Promise<unknown>;
|
|
187805
|
-
chat_post(args: { adapter: "telegram" | "slack" | "discord" | "teams"; threadId?: string; channelId?: string; text?: string; card?: unknown }): Promise<unknown>;
|
|
187806
|
-
chat_openDm(args: { adapter: "telegram" | "slack" | "discord" | "teams"; userId: string }): Promise<unknown>;
|
|
187807
|
-
chat_registerChannel(args: { adapter: "telegram" | "slack" | "discord" | "teams"; channelId: string; agentId?: string; workflowId?: string; name?: string }): Promise<unknown>;
|
|
187808
|
-
chat_unregisterChannel(args: { adapter: "telegram" | "slack" | "discord" | "teams"; channelId: string }): Promise<unknown>;
|
|
187932
|
+
chat_post(args: { adapter: "telegram" | "slack" | "discord" | "teams" | "rocketchat"; threadId?: string; channelId?: string; text?: string; card?: unknown }): Promise<unknown>;
|
|
187933
|
+
chat_openDm(args: { adapter: "telegram" | "slack" | "discord" | "teams" | "rocketchat"; userId: string }): Promise<unknown>;
|
|
187934
|
+
chat_registerChannel(args: { adapter: "telegram" | "slack" | "discord" | "teams" | "rocketchat"; channelId: string; agentId?: string; workflowId?: string; name?: string }): Promise<unknown>;
|
|
187935
|
+
chat_unregisterChannel(args: { adapter: "telegram" | "slack" | "discord" | "teams" | "rocketchat"; channelId: string }): Promise<unknown>;
|
|
187809
187936
|
|
|
187810
187937
|
// --- write: messaging (internal) ---
|
|
187811
187938
|
message_post(args: { channel?: string; content: string; to?: string }): Promise<unknown>;
|
|
@@ -188587,4 +188714,4 @@ function parseSkillContent(content) {
|
|
|
188587
188714
|
}
|
|
188588
188715
|
var init_skill_parser = () => {};
|
|
188589
188716
|
|
|
188590
|
-
export { require_dist, getMcpOAuthToken, findReusableMcpOAuthClient, invalidateMcpOAuthClient, upsertMcpOAuthToken, applyMcpOAuthRefresh, markMcpOAuthTokenStatus, deleteMcpOAuthToken, insertMcpOAuthPending, consumeMcpOAuthPending, gcMcpOAuthPending, setMcpServerAuthMethod, init_mcp_oauth, ensureMcpToken, init_ensure_mcp_token, callMcpServerTool, init_mcp_proxy, resolveSqlDsn, runReadOnlyQuery, init_sql_connections, listVendoredOpenapiEntries, init_vendored_openapi, ConnectionAuthInputSchema, SqlDsnInputSchema, connectionAuthSummary, listRelationalCredentialBindings, getCredentialBindingById, findCredentialBindingByIdentity, upsertCredentialBinding, disableCredentialBinding, listScriptConnections, listScriptConnectionsAsync, getScriptConnectionById, ScriptConnectionConflictError, connectionAuthInputFromFlat, upsertScriptConnection, refreshScriptConnection, setScriptConnectionEnabled, deleteScriptConnection, getScriptApiConnectionDescriptors, getScriptMcpConnectionDescriptors, getScriptApiTypes, getScriptMcpTypes, init_script_connections, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, init_oauth_credential_bindings, buildScriptCredentialBindingsWithFailures, init_script_credential_broker, DEFAULT_SANDBOX_LIMITS, buildSandboxedCommand, sandboxSpawnEnv, createCappedStreamState, snapshotCapped, readStreamCapped, init_sandboxed_process, writeBareImportShim, init_native, isExecutorAllowedByDeployment, init_registry, MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, DEFAULT_SCRIPT_RESOURCES, init_types3, HOST_VALIDATED_ARGS, init_host_validated_args, require_typescript2, checkImportAllowlist, validateScriptImports, init_import_allowlist, runScriptWithRunCredential, init_run_credential, resolveSeededEnabled, init_automation_toggle, getSeedState, recordSeedState, deleteSeedState, init_state_db, canonicalJson, seededWorkflowState, workflowsSeeder, init_workflows_seeder, extractScriptSignature, init_extract_signature, extractArgsJsonSchema, init_extract_schema, getSavedScriptOwnerAgentId, runSavedScriptAsAgent, init_run_saved, checkQuickJSCompat, quickJSCompatWarnings, init_quickjs_compat, resolveSyncRunAs, init_sync_run_as, AppNameSchema, ScalarColumnKindSchema, isIso8601Date, jsonColumnSizeLabel, jsonColumnValueIssue, isValidColumnValue, SYSTEM_COLUMN_KINDS, SORTABLE_SYSTEM_DATE_COLUMNS, AppElementsSchema, AppDefinitionSchema, collectScriptReferences, scriptCompatWarnings, parseAppDefinition, applyAppDefinitionPatch, init_definition, upgradeAppDefinition, init_format_upgrades, decodeAppDefinition, appDefinitionNeedsRepair, createApp, getApp, listApps, listAppRecords, updateApp, deleteApp, init_store2, getScriptAppTypes, init_script_types, SCRIPT_SDK_TYPES, scriptSdkTypesWithGeneratedApis, SCRIPT_STDLIB_MODULE_TYPES, scriptStdlibTypesWithGeneratedApis, typecheckWithAmbient, typecheckScript, init_typecheck, parseSkillContent, init_skill_parser };
|
|
188717
|
+
export { require_dist, getMcpOAuthToken, findReusableMcpOAuthClient, invalidateMcpOAuthClient, upsertMcpOAuthToken, applyMcpOAuthRefresh, markMcpOAuthTokenStatus, deleteMcpOAuthToken, insertMcpOAuthPending, consumeMcpOAuthPending, gcMcpOAuthPending, setMcpServerAuthMethod, init_mcp_oauth, ensureMcpToken, init_ensure_mcp_token, callMcpServerTool, init_mcp_proxy, resolveSqlDsn, runReadOnlyQuery, init_sql_connections, listVendoredOpenapiEntries, init_vendored_openapi, ConnectionAuthInputSchema, SqlDsnInputSchema, connectionAuthSummary, listRelationalCredentialBindings, getCredentialBindingById, findCredentialBindingByIdentity, upsertCredentialBinding, disableCredentialBinding, listScriptConnections, listScriptConnectionsAsync, getScriptConnectionById, ScriptConnectionConflictError, connectionAuthInputFromFlat, upsertScriptConnection, refreshScriptConnection, setScriptConnectionEnabled, deleteScriptConnection, getScriptApiConnectionDescriptors, getScriptMcpConnectionDescriptors, getScriptApiTypes, getScriptMcpTypes, init_script_connections, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, init_oauth_credential_bindings, buildScriptCredentialBindingsWithFailures, init_script_credential_broker, DEFAULT_SANDBOX_LIMITS, buildSandboxedCommand, sandboxSpawnEnv, createCappedStreamState, snapshotCapped, readStreamCapped, init_sandboxed_process, writeBareImportShim, init_native, isExecutorAllowedByDeployment, init_registry, MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, DEFAULT_SCRIPT_RESOURCES, init_types3, HOST_VALIDATED_ARGS, init_host_validated_args, require_typescript2, checkImportAllowlist, validateScriptImports, init_import_allowlist, runScriptWithRunCredential, runScriptAsUserWithRunCredential, init_run_credential, resolveSeededEnabled, init_automation_toggle, getSeedState, recordSeedState, deleteSeedState, init_state_db, canonicalJson, seededWorkflowState, workflowsSeeder, init_workflows_seeder, extractScriptSignature, init_extract_signature, extractArgsJsonSchema, init_extract_schema, getSavedScriptOwnerAgentId, runSavedScriptAsAgent, init_run_saved, checkQuickJSCompat, quickJSCompatWarnings, init_quickjs_compat, resolveSyncRunAs, init_sync_run_as, AppNameSchema, ScalarColumnKindSchema, isIso8601Date, jsonColumnSizeLabel, jsonColumnValueIssue, isValidColumnValue, SYSTEM_COLUMN_KINDS, SORTABLE_SYSTEM_DATE_COLUMNS, AppElementsSchema, AppDefinitionSchema, collectScriptReferences, scriptCompatWarnings, parseAppDefinition, applyAppDefinitionPatch, init_definition, upgradeAppDefinition, init_format_upgrades, decodeAppDefinition, appDefinitionNeedsRepair, createApp, getApp, listApps, listAppRecords, updateApp, deleteApp, init_store2, getScriptAppTypes, init_script_types, SCRIPT_SDK_TYPES, scriptSdkTypesWithGeneratedApis, SCRIPT_STDLIB_MODULE_TYPES, scriptStdlibTypesWithGeneratedApis, typecheckWithAmbient, typecheckScript, init_typecheck, parseSkillContent, init_skill_parser };
|
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
getLeadAgent2,
|
|
5
5
|
getTaskById2,
|
|
6
6
|
init_db4
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-e4gx499y.js";
|
|
8
8
|
import {
|
|
9
9
|
getTaskUiSpec,
|
|
10
10
|
reserveTaskUiActionRun,
|
|
11
11
|
releaseTaskUiActionRun,
|
|
12
12
|
setTaskUiActionResult,
|
|
13
13
|
init_task_ui_spec
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-ea367bdn.js";
|
|
15
15
|
import {
|
|
16
16
|
createTaskWithSiblingAwareness,
|
|
17
17
|
init_sibling_awareness,
|
|
18
18
|
runTaskUiScriptAction,
|
|
19
19
|
init_script_actions
|
|
20
|
-
} from "./cli-
|
|
20
|
+
} from "./cli-1606qw3n.js";
|
|
21
21
|
import {
|
|
22
22
|
isEnvFlagEnabled,
|
|
23
23
|
init_env_flag
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
deleteSkillFile2,
|
|
18
18
|
getSkillById2,
|
|
19
19
|
init_db4
|
|
20
|
-
} from "./cli-
|
|
20
|
+
} from "./cli-e4gx499y.js";
|
|
21
21
|
import {
|
|
22
22
|
snapshotAndUpdateWorkflow,
|
|
23
23
|
init_version,
|
|
@@ -28,15 +28,15 @@ import {
|
|
|
28
28
|
liveSkillSpec,
|
|
29
29
|
skillHash,
|
|
30
30
|
init_assets
|
|
31
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-1606qw3n.js";
|
|
32
32
|
import {
|
|
33
33
|
getSeedState,
|
|
34
34
|
init_state_db
|
|
35
|
-
} from "./cli-
|
|
35
|
+
} from "./cli-ka4tqjzd.js";
|
|
36
36
|
import {
|
|
37
37
|
matchesDefaultIdentityMd,
|
|
38
38
|
init_defaults
|
|
39
|
-
} from "./cli-
|
|
39
|
+
} from "./cli-aytna2fm.js";
|
|
40
40
|
import {
|
|
41
41
|
__esm
|
|
42
42
|
} from "./cli-242037k3.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
contextBoundNoteThreshold,
|
|
3
3
|
createContextBoundNote
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-88np9va3.js";
|
|
5
5
|
import {
|
|
6
6
|
applyReasoningEffort
|
|
7
7
|
} from "./cli-vdfngx2g.js";
|
|
@@ -48,7 +48,7 @@ init_context_window();
|
|
|
48
48
|
init_multi_runtime2();
|
|
49
49
|
init_process_group();
|
|
50
50
|
init_secret_scrubber();
|
|
51
|
-
var AMP_PACKAGE = "@ampcode/cli@0.0.
|
|
51
|
+
var AMP_PACKAGE = "@ampcode/cli@0.0.1794744038-ga74b43";
|
|
52
52
|
var AMP_MCP_SERVER_NAME = "agent-swarm";
|
|
53
53
|
var AMP_PLUGIN_MODE_KEY = "agent-swarm";
|
|
54
54
|
var AMP_LIVE_TEST_TIMEOUT_MS = 5000;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
contextBoundNoteThreshold,
|
|
3
3
|
createContextBoundNote
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-88np9va3.js";
|
|
5
5
|
import {
|
|
6
6
|
SessionErrorTracker
|
|
7
7
|
} from "./cli-zkbz8m2q.js";
|
|
8
8
|
import {
|
|
9
9
|
summarizeSession
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-wsnradtk.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveCodexCommand
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-8m6gqnf1.js";
|
|
14
14
|
import {
|
|
15
15
|
createSwarmEventHandler
|
|
16
16
|
} from "./cli-at67kvnp.js";
|
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
import {
|
|
100
100
|
init_package,
|
|
101
101
|
package_default
|
|
102
|
-
} from "./cli-
|
|
102
|
+
} from "./cli-sy2ge2ye.js";
|
|
103
103
|
import {
|
|
104
104
|
init_src2,
|
|
105
105
|
scrubSecrets,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Anthropic
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-cah298e5.js";
|
|
4
4
|
import {
|
|
5
5
|
contextBoundNoteThreshold,
|
|
6
6
|
createContextBoundNote
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-88np9va3.js";
|
|
8
8
|
import {
|
|
9
9
|
checkToolLoop
|
|
10
10
|
} from "./cli-0726awxw.js";
|
|
@@ -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: "2.13.
|
|
10
|
+
version: "2.13.3",
|
|
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",
|
|
@@ -214,19 +214,20 @@ var init_package = __esm(() => {
|
|
|
214
214
|
bun: ">=1.3.12"
|
|
215
215
|
},
|
|
216
216
|
dependencies: {
|
|
217
|
-
"@agentclientprotocol/sdk": "2.
|
|
217
|
+
"@agentclientprotocol/sdk": "2.7.0",
|
|
218
218
|
"@ai-sdk/openai": "^3.0.41",
|
|
219
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.
|
|
219
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.325",
|
|
220
220
|
"@anthropic-ai/sdk": "^1.8.0",
|
|
221
221
|
"@asteasolutions/zod-to-openapi": "^8.0.0",
|
|
222
222
|
"@aws-sdk/client-bedrock": "3.1048.0",
|
|
223
223
|
"@boxd-sh/sdk": "0.2.20",
|
|
224
224
|
"@chat-adapter/discord": "4.45.0",
|
|
225
|
+
"@chat-adapter/shared": "4.45.0",
|
|
225
226
|
"@chat-adapter/slack": "4.45.0",
|
|
226
227
|
"@chat-adapter/teams": "4.45.0",
|
|
227
228
|
"@chat-adapter/telegram": "4.45.0",
|
|
228
|
-
"@cursor/sdk": "1.
|
|
229
|
-
"@desplega.ai/agent-fs-just-bash": "0.18.
|
|
229
|
+
"@cursor/sdk": "1.4.0",
|
|
230
|
+
"@desplega.ai/agent-fs-just-bash": "0.18.29",
|
|
230
231
|
"@desplega.ai/business-use": "^0.4.2",
|
|
231
232
|
"@earendil-works/pi-agent-core": "^1.5.2",
|
|
232
233
|
"@earendil-works/pi-ai": "^1.5.2",
|
|
@@ -238,7 +239,7 @@ var init_package = __esm(() => {
|
|
|
238
239
|
"@json-render/core": "0.22.0",
|
|
239
240
|
"@linear/sdk": "^77.0.0",
|
|
240
241
|
"@modelcontextprotocol/sdk": "1.32.1",
|
|
241
|
-
"@openai/codex": "0.
|
|
242
|
+
"@openai/codex": "0.169.0",
|
|
242
243
|
"@openfort/openfort-node": "^0.9.1",
|
|
243
244
|
"@opentelemetry/api": "^1.9.1",
|
|
244
245
|
"@opentelemetry/api-logs": "^0.218.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
contextBoundNoteThreshold,
|
|
3
3
|
createContextBoundNote
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-88np9va3.js";
|
|
5
5
|
import {
|
|
6
6
|
canonicalToolName,
|
|
7
7
|
canonicalArgs,
|
|
@@ -27,13 +27,13 @@ import {
|
|
|
27
27
|
autoIndexMemoryFile,
|
|
28
28
|
fetchConcurrentContext,
|
|
29
29
|
summarizeTranscript
|
|
30
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-7kv5d674.js";
|
|
31
31
|
import {
|
|
32
32
|
applyReasoningEffort
|
|
33
33
|
} from "./cli-vdfngx2g.js";
|
|
34
34
|
import {
|
|
35
35
|
resolveOpencodeSdkSpecifier
|
|
36
|
-
} from "./cli-
|
|
36
|
+
} from "./cli-8m6gqnf1.js";
|
|
37
37
|
import {
|
|
38
38
|
fetchInstalledMcpServers
|
|
39
39
|
} from "./cli-5y2fvw4z.js";
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
invalidateTelemetryUserRole,
|
|
9
9
|
init_telemetry_identity,
|
|
10
10
|
init_db4
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-e4gx499y.js";
|
|
12
12
|
import {
|
|
13
13
|
revokeAllUserCredentials,
|
|
14
14
|
isLiveUserToken,
|
|
15
15
|
init_users
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-grk77aen.js";
|
|
17
17
|
import {
|
|
18
18
|
init_env_flag
|
|
19
19
|
} from "./cli-cebvbc9t.js";
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
import {
|
|
72
72
|
resolveRaterModelString,
|
|
73
73
|
init_models2
|
|
74
|
-
} from "./cli-
|
|
74
|
+
} from "./cli-jjzxsk47.js";
|
|
75
75
|
import {
|
|
76
76
|
isFirstPartyAnthropicUrl,
|
|
77
77
|
init_src,
|
|
@@ -9519,8 +9519,32 @@ async function resolveKind(kind, opts, env, getEnvKey) {
|
|
|
9519
9519
|
if (!env.AGENT_SWARM_CLAUDE_OAUTH_TOKEN && !env.CLAUDE_CODE_OAUTH_TOKEN)
|
|
9520
9520
|
return null;
|
|
9521
9521
|
return { kind, modelDefault: resolveRaterModelString(kind) };
|
|
9522
|
+
case "fireworks": {
|
|
9523
|
+
const key = env.FIREWORKS_API_KEY ?? getEnvKey("fireworks");
|
|
9524
|
+
if (!key)
|
|
9525
|
+
return null;
|
|
9526
|
+
return {
|
|
9527
|
+
kind,
|
|
9528
|
+
apiKey: selectCredential(key, undefined, "FIREWORKS_API_KEY").selected,
|
|
9529
|
+
modelDefault: resolveRaterModelString(kind)
|
|
9530
|
+
};
|
|
9531
|
+
}
|
|
9532
|
+
case "amazon-bedrock":
|
|
9533
|
+
return resolveBedrockCredential(env, getEnvKey);
|
|
9522
9534
|
}
|
|
9523
9535
|
}
|
|
9536
|
+
function resolveBedrockCredential(env, getEnvKey) {
|
|
9537
|
+
const region = env.AWS_REGION?.trim() || env.AWS_DEFAULT_REGION?.trim();
|
|
9538
|
+
if (!region)
|
|
9539
|
+
return null;
|
|
9540
|
+
if (!getEnvKey("amazon-bedrock", env))
|
|
9541
|
+
return null;
|
|
9542
|
+
return {
|
|
9543
|
+
kind: "amazon-bedrock",
|
|
9544
|
+
modelDefault: resolveRaterModelString("amazon-bedrock"),
|
|
9545
|
+
region
|
|
9546
|
+
};
|
|
9547
|
+
}
|
|
9524
9548
|
async function resolveCodexOAuthCredential(opts, apiUrl, apiKey) {
|
|
9525
9549
|
const getCodex = opts._getValidCodexOAuth ?? getValidCodexOAuth;
|
|
9526
9550
|
const getOAuth = opts._getOAuthApiKey ?? resolveOAuthApiKey;
|
|
@@ -9596,7 +9620,9 @@ var init_credentials = __esm(() => {
|
|
|
9596
9620
|
"anthropic",
|
|
9597
9621
|
"openai",
|
|
9598
9622
|
"openai-codex",
|
|
9599
|
-
"claude-cli"
|
|
9623
|
+
"claude-cli",
|
|
9624
|
+
"fireworks",
|
|
9625
|
+
"amazon-bedrock"
|
|
9600
9626
|
];
|
|
9601
9627
|
});
|
|
9602
9628
|
|