@desplega.ai/agent-swarm 2.7.5 → 2.7.6
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/dist/{acp-adapter-g3ads55s.js → acp-adapter-bp91d37f.js} +4 -4
- package/dist/{actions-zwfykqqk.js → actions-yj0eeaqh.js} +18 -17
- package/dist/{amp-adapter-z3s0ssdt.js → amp-adapter-4pg9h34q.js} +1 -1
- package/dist/{app-vmp4fgep.js → app-909e97cr.js} +3 -3
- package/dist/{assistant-vwde653f.js → assistant-qdyb5fyy.js} +24 -22
- package/dist/{boot-reembed-375t7tbk.js → boot-reembed-fk0s9z18.js} +1 -1
- package/dist/{boot-reembed-gq9rcpnj.js → boot-reembed-gs1rzrnh.js} +1 -1
- package/dist/{boot-scrub-sweep-nd938kyf.js → boot-scrub-sweep-4qfd4kfx.js} +2 -2
- package/dist/{boot-seeds-aykx51v3.js → boot-seeds-yr00k13d.js} +4 -4
- package/dist/{boxd-k1j26g3h.js → boxd-vdmfssd9.js} +4 -4
- package/dist/{claude-adapter-8j4hm099.js → claude-adapter-qta1f1xn.js} +3 -3
- package/dist/{claude-managed-setup-0wyynpn1.js → claude-managed-setup-sc6j4dm0.js} +1 -1
- package/dist/{claude-sdk-session-q6wj5hmy.js → claude-sdk-session-zgrz6yvc.js} +9169 -9070
- package/dist/{cli-gjr2y2xk.js → cli-0agcv1v5.js} +4 -1
- package/dist/{cli-vqypxzh4.js → cli-0at8w34w.js} +7 -7
- package/dist/{cli-7a42nfy0.js → cli-0qatpy8q.js} +3 -3
- package/dist/{cli-p599f1qm.js → cli-0yv5z2pg.js} +1 -1
- package/dist/{cli-0gey5fzy.js → cli-386tyxxg.js} +2 -2
- package/dist/{cli-5pag6rmn.js → cli-3ypk9vk1.js} +1 -1
- package/dist/{cli-qxnf8z2z.js → cli-436532ck.js} +2 -2
- package/dist/{cli-z8eh3ex8.js → cli-4necwtsv.js} +4 -4
- package/dist/{cli-zh3fp8v2.js → cli-54t00gt8.js} +1 -1
- package/dist/{cli-hf6zt5m6.js → cli-69szn7w7.js} +17 -1
- package/dist/{cli-nn4d8dne.js → cli-89knwags.js} +2 -2
- package/dist/{cli-spknvxbq.js → cli-8bc1w0tw.js} +10 -10
- package/dist/{cli-rqkxrmgw.js → cli-8snvgs5r.js} +38 -13
- package/dist/{cli-rhw40jgb.js → cli-bjb3z51z.js} +2 -2
- package/dist/{cli-xtjhfmpc.js → cli-c60vetmm.js} +1 -1
- package/dist/{cli-0731hvbw.js → cli-decfb6v8.js} +2 -2
- package/dist/{cli-bhjt02p8.js → cli-drr5v6av.js} +1 -1
- package/dist/{cli-fqzx7gwa.js → cli-dxae2yg7.js} +2 -2
- package/dist/{cli-tqgg40ek.js → cli-e3r2neck.js} +8 -7
- package/dist/{cli-zppwg9p9.js → cli-ekwks2vs.js} +1 -1
- package/dist/{cli-nzxr556s.js → cli-es6va8jk.js} +26 -26
- package/dist/{cli-a47xy8eq.js → cli-faxe6thg.js} +1 -1
- package/dist/cli-gdhpcbhf.js +55 -0
- package/dist/{cli-82jg7fp9.js → cli-he5nxaa8.js} +1 -1
- package/dist/{cli-8veytvbh.js → cli-he9wchme.js} +1 -1
- package/dist/{cli-pywf3eh5.js → cli-hgaazk69.js} +1 -1
- package/dist/{cli-0bxqnvq9.js → cli-hr2e2fft.js} +28 -6
- package/dist/{cli-1ayk1eas.js → cli-k2gzwsj2.js} +135 -26
- package/dist/{cli-xbkdm710.js → cli-kqdg1bsb.js} +3 -3
- package/dist/cli-m2z8jagn.js +12078 -0
- package/dist/{cli-g61qxmge.js → cli-m48g6p95.js} +3 -3
- package/dist/{cli-7wspm5gm.js → cli-nhrvpaj7.js} +20 -4
- package/dist/{cli-afrrppsw.js → cli-nwj0ee2w.js} +2 -2
- package/dist/{cli-3h4nhjn8.js → cli-p5gp8pcx.js} +9 -7
- package/dist/{cli-rm6hqj3z.js → cli-pd7vagab.js} +33 -139
- package/dist/{cli-mjzynrse.js → cli-q0k1w5zd.js} +1 -1
- package/dist/{cli-8hs41zy2.js → cli-rmmmrjkd.js} +1 -1
- package/dist/{cli-kg8hchyg.js → cli-sa02jsqt.js} +1 -1
- package/dist/{cli-1338796d.js → cli-shpbx5ee.js} +142 -98
- package/dist/{cli-82ae98pz.js → cli-svj5090z.js} +2 -2
- package/dist/{cli-bnz7a7qf.js → cli-vvpx3gsx.js} +1 -1
- package/dist/{cli-mmwm7zbf.js → cli-w6dt9ged.js} +1 -1
- package/dist/{cli-wvaawacd.js → cli-waqbxg08.js} +5230 -66
- package/dist/{cli-j3jvnpe8.js → cli-wp9sp1qb.js} +1 -1
- package/dist/{cli-nmbmy64z.js → cli-xbbndvjy.js} +3 -3
- package/dist/{cli-vbyfwh92.js → cli-xds5f77d.js} +2 -2
- package/dist/{cli-7wcyk2s5.js → cli-xnqgpshy.js} +1 -1
- package/dist/{cli-rpm2sgv0.js → cli-xnrwazav.js} +19 -2
- package/dist/{cli-gf5hbmdr.js → cli-yjdgea32.js} +3 -3
- package/dist/{cli-mry0qzym.js → cli-yn4kxs06.js} +123 -10
- package/dist/{cli-hn9hxmz9.js → cli-yx4kfngt.js} +1 -1
- package/dist/{cli-y24sc29k.js → cli-yy3rhsdw.js} +30 -8
- package/dist/{cli-6s7vdcta.js → cli-zbbwez0r.js} +4 -4
- package/dist/{cli-z6jkx23q.js → cli-zm72anhg.js} +9 -9
- package/dist/cli.js +22 -21
- package/dist/{codex-adapter-q6k3gnyg.js → codex-adapter-ayd1fb6h.js} +2 -2
- package/dist/{codex-session-runner-3mwmk3d9.js → codex-session-runner-jesa32xc.js} +2 -2
- package/dist/{commands-evrenjn9.js → commands-hanewgf2.js} +9 -3
- package/dist/{controller-xjp8vswh.js → controller-dt1n3c1q.js} +8 -3
- package/dist/{controllers-connect-pp5jnxvc.js → controllers-connect-xx8x64n5.js} +20 -19
- package/dist/{cursor-adapter-yf47w4t0.js → cursor-adapter-9s4dwwdw.js} +1 -1
- package/dist/{db-zxpw6aht.js → db-3vttcbv4.js} +3 -3
- package/dist/{db-rgfsh91f.js → db-9dv0g1ab.js} +11 -3
- package/dist/{devtools-82fzqra8.js → devtools-qxfgbsqz.js} +1 -1
- package/dist/{dispatcher-smasgws7.js → dispatcher-tx9hd1sv.js} +17 -16
- package/dist/{docker-rrjhaqt9.js → docker-c1a3gqmf.js} +89 -22
- package/dist/{dsh-adapter-ftyy8dnp.js → dsh-adapter-007y4ejs.js} +1 -1
- package/dist/{e2b-qcaj675y.js → e2b-a19d28rz.js} +2 -2
- package/dist/{e2b-w1p0bnpm.js → e2b-we6hs6q5.js} +4 -4
- package/dist/{easter-egg-3d-yyts7p16.js → easter-egg-3d-rgbrqb8s.js} +1 -1
- package/dist/{embedding-space-1z0mbg95.js → embedding-space-ny1e2940.js} +6 -6
- package/dist/{embeddings-ygeg7tm7.js → embeddings-2t386t13.js} +1 -1
- package/dist/{execute-14qhqp4d.js → execute-pksh0ceh.js} +1 -1
- package/dist/{external-channel-ttgrs3sx.js → external-channel-phgmhmd7.js} +2 -2
- package/dist/{fx-adapter-gt6pncj2.js → fx-adapter-fy8rr921.js} +5 -5
- package/dist/{google-generative-ai-yvmdxyxa.js → google-generative-ai-8y3m3k4b.js} +1 -1
- package/dist/{google-vertex-jrtdh9gs.js → google-vertex-w3v98n7b.js} +1 -1
- package/dist/{grok-adapter-sm4m5k4g.js → grok-adapter-q0abvpaj.js} +5 -5
- package/dist/handlers-by3sfxyx.js +32 -0
- package/dist/{heartbeat-qahz4p62.js → heartbeat-kadyek8p.js} +20 -19
- package/dist/{hook-kj3d398m.js → hook-5zs3msf6.js} +2 -2
- package/dist/{hook-4fd5wq5w.js → hook-9k551xnj.js} +2 -2
- package/dist/{http-1ted0j1k.js → http-mhz9vw1f.js} +213 -80
- package/dist/index-4f2pvxae.js +37 -0
- package/dist/index-98gz7tmp.js +30 -0
- package/dist/{index-5rk6rfzr.js → index-fvzke5kx.js} +1 -1
- package/dist/index-k08z2cak.js +33 -0
- package/dist/{index-yqhz88yy.js → index-pxn30mse.js} +8 -8
- package/dist/{index-6rq3r5zb.js → index-q361cg2f.js} +1 -1
- package/dist/{index-7v51awbn.js → index-rvr00sg7.js} +20 -13
- package/dist/{index-q4b917zs.js → index-vdygbq10.js} +1 -1
- package/dist/{keepalive-6cf311t5.js → keepalive-w56f32cg.js} +3 -3
- package/dist/{lead-fjy418cw.js → lead-enq35nqp.js} +31 -30
- package/dist/{maintenance-a4bm1bmt.js → maintenance-7mdgxcea.js} +1 -1
- package/dist/{oauth-refresh-sweep-3h0dfw1k.js → oauth-refresh-sweep-29txy9vk.js} +2 -2
- package/dist/{onboard-myn5hraa.js → onboard-kpsrkarj.js} +4 -4
- package/dist/{opencode-adapter-p2nkb5am.js → opencode-adapter-j25vm3rr.js} +3 -3
- package/dist/{otel-impl-a1a0ef6b.js → otel-impl-6kkct7a8.js} +1 -1
- package/dist/{pi-mono-adapter-rzmpb72a.js → pi-mono-adapter-exhkzhn2.js} +4 -4
- package/dist/{pricing-refresh-83drrnxj.js → pricing-refresh-n2x7jh6k.js} +3 -3
- package/dist/{rbac-roles-s8y6ecb5.js → rbac-roles-81ypx6es.js} +1 -1
- package/dist/{rbac-roles-0fb6e7pj.js → rbac-roles-b5htkjby.js} +2 -2
- package/dist/{render-v2-twmbgrz4.js → render-v2-qn6jmpk4.js} +3 -3
- package/dist/{resume-zfqc36xj.js → resume-wd30wx23.js} +6 -6
- package/dist/{runtime-qwggdpqr.js → runtime-4hsg7h60.js} +1 -1
- package/dist/{session-access-sc9pn9da.js → session-access-5qvfevhk.js} +4 -4
- package/dist/{session-source-backfill-qh07xr8g.js → session-source-backfill-n1czavbr.js} +2 -2
- package/dist/{setup-4fr0m7a1.js → setup-dnb56qy5.js} +3 -3
- package/dist/{virtual-modules-fh4ha15b.js → virtual-modules-76xxv9fs.js} +2 -2
- package/dist/{work-objects-0wr8zxct.js → work-objects-4n21tfkm.js} +20 -19
- package/dist/{worker-follow-up-ktyyazyp.js → worker-follow-up-77hvzxww.js} +17 -16
- package/dist/{worker-0c5tyzqe.js → worker-gg1576j3.js} +31 -30
- package/openapi.json +93 -1
- package/package.json +8 -7
- package/src/be/db/script-runs.ts +23 -0
- package/src/be/db/tasks/read.ts +122 -3
- package/src/be/db-client.ts +8 -5
- package/src/be/db.ts +15 -4
- package/src/be/memory/providers/sqlite-store.ts +49 -12
- package/src/be/migrations/260_runtime_pool_cache.sql +20 -0
- package/src/be/migrations/262_session_visibility_indexes.sql +18 -0
- package/src/be/migrations/263_task_list_filter_index.sql +11 -0
- package/src/be/migrations/264_slack_thread_cover_index.sql +9 -0
- package/src/be/migrations/266_script_runs_source_task.sql +11 -0
- package/src/be/runtime-pools/cache-cleanup.ts +109 -0
- package/src/be/runtime-pools/db.ts +65 -6
- package/src/be/runtime-pools/remote-controller.ts +5 -0
- package/src/be/runtime-pools/supervisor.ts +33 -2
- package/src/be/scripts/typecheck.ts +22 -0
- package/src/be/seed-scripts/catalog/task-failure-audit.ts +5 -1
- package/src/commands/controller.ts +4 -0
- package/src/commands/entrypoint-api-readiness.ts +74 -0
- package/src/http/index.ts +1 -1
- package/src/http/list-total-cache.ts +14 -7
- package/src/http/memory.ts +38 -9
- package/src/http/script-runs.ts +174 -5
- package/src/http/status.ts +10 -2
- package/src/http/tasks.ts +4 -2
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/fx-adapter.ts +1 -1
- package/src/runtime-providers/controller-protocol.ts +14 -1
- package/src/runtime-providers/controller.ts +5 -0
- package/src/runtime-providers/docker.ts +108 -23
- package/src/runtime-providers/types.ts +16 -0
- package/src/script-workflows/workflow-ctx.ts +8 -0
- package/src/scripts-runtime/types/stdlib.d.ts +22 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +22 -0
- package/src/server-user.ts +1 -0
- package/src/slack/commands.ts +5 -1
- package/src/slack/handlers.ts +37 -2
- package/src/slack/left-threads.ts +27 -4
- package/src/tasks/follow-up-redelegation-guard.ts +155 -0
- package/src/tests/claude-artifacts-read-script.test.ts +209 -0
- package/src/tests/db-client.test.ts +21 -0
- package/src/tests/db-task-read-contract.test.ts +8 -2
- package/src/tests/db-task-write-contract.test.ts +5 -1
- package/src/tests/entrypoint-api-readiness.test.ts +416 -210
- package/src/tests/explicit-model-validation.test.ts +14 -8
- package/src/tests/follow-up-redelivery-guard.test.ts +432 -202
- package/src/tests/list-total-cache.test.ts +27 -2
- package/src/tests/memory-fts-populate.test.ts +11 -9
- package/src/tests/memory-retrieval-purge.test.ts +80 -0
- package/src/tests/migration-260-runtime-pool-cache.test.ts +118 -0
- package/src/tests/query-audit-plans.test.ts +27 -0
- package/src/tests/runtime-cache-cleanup.test.ts +367 -0
- package/src/tests/runtime-e2b-pools.test.ts +41 -0
- package/src/tests/runtime-pools-db.test.ts +98 -0
- package/src/tests/runtime-pools-http.test.ts +29 -0
- package/src/tests/runtime-providers-docker.test.ts +253 -0
- package/src/tests/runtime-remote-controller.test.ts +66 -2
- package/src/tests/runtime-supervisor.test.ts +66 -2
- package/src/tests/script-connections.test.ts +11 -0
- package/src/tests/script-runs-http.test.ts +684 -2
- package/src/tests/seed-scripts.test.ts +26 -0
- package/src/tests/slack-leave-thread.test.ts +145 -5
- package/src/tests/slack-render-v2-query-plans.test.ts +24 -2
- package/src/tests/status.test.ts +11 -0
- package/src/tests/tasks-readable-row.test.ts +155 -0
- package/src/tools/send-task.ts +35 -47
- package/src/tools/slack-leave-thread.ts +1 -1
- package/src/tools/task-dedup.ts +45 -21
- package/src/types.ts +38 -0
- package/templates/skills/composio-google-docs/content.md +10 -0
- package/templates/skills/script-workflows/content.md +19 -1
- package/templates/skills/swarm-docs/content.md +1 -0
- package/templates/skills/swarm-scripts/SKILL.md +2 -0
- package/templates/skills/swarm-scripts/content.md +2 -0
- package/dist/cli-dznrgaep.js +0 -30
- package/dist/cli-w3hcrxht.js +0 -6985
- package/dist/handlers-vwmba1m2.js +0 -31
- package/dist/index-5r71rf98.js +0 -32
- package/dist/index-anmwxs87.js +0 -29
- package/dist/index-spp0ra5c.js +0 -36
package/dist/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
use_app_default,
|
|
12
12
|
Spinner,
|
|
13
13
|
require_react_jsx_dev_runtime_development
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-he5nxaa8.js";
|
|
15
15
|
import"./cli-v41kn3cd.js";
|
|
16
16
|
import {
|
|
17
17
|
setBedrockProviderModule,
|
|
@@ -50,7 +50,7 @@ var import_react = __toESM(require_react(), 1);
|
|
|
50
50
|
// package.json
|
|
51
51
|
var package_default = {
|
|
52
52
|
name: "@desplega.ai/agent-swarm",
|
|
53
|
-
version: "2.7.
|
|
53
|
+
version: "2.7.6",
|
|
54
54
|
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.",
|
|
55
55
|
keywords: [
|
|
56
56
|
"agent-swarm.dev",
|
|
@@ -112,6 +112,7 @@ var package_default = {
|
|
|
112
112
|
"packages/*"
|
|
113
113
|
],
|
|
114
114
|
overrides: {
|
|
115
|
+
"@slack/socket-mode": "^2.0.7",
|
|
115
116
|
react: "19.2.3",
|
|
116
117
|
"react-dom": "19.2.3"
|
|
117
118
|
},
|
|
@@ -228,12 +229,12 @@ var package_default = {
|
|
|
228
229
|
},
|
|
229
230
|
devDependencies: {
|
|
230
231
|
"@biomejs/biome": "^2.3.10",
|
|
231
|
-
"@desplega.ai/slack-mock": "^0.
|
|
232
|
+
"@desplega.ai/slack-mock": "^0.5.0",
|
|
232
233
|
"@desplega/model-catalog": "workspace:*",
|
|
233
234
|
"@desplega/model-routing": "workspace:*",
|
|
234
235
|
"@faker-js/faker": "^10.4.0",
|
|
235
|
-
"@opencode/plugin": "2.2.
|
|
236
|
-
"@opencode/sdk": "2.2.
|
|
236
|
+
"@opencode/plugin": "2.2.3",
|
|
237
|
+
"@opencode/sdk": "2.2.3",
|
|
237
238
|
"@oxlint/plugins": "1.78.0",
|
|
238
239
|
"@types/bun": "latest",
|
|
239
240
|
"dependency-cruiser": "^18.0.0",
|
|
@@ -251,9 +252,9 @@ var package_default = {
|
|
|
251
252
|
bun: ">=1.3.12"
|
|
252
253
|
},
|
|
253
254
|
dependencies: {
|
|
254
|
-
"@agentclientprotocol/sdk": "2.
|
|
255
|
+
"@agentclientprotocol/sdk": "2.2.0",
|
|
255
256
|
"@ai-sdk/openai": "^3.0.41",
|
|
256
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.
|
|
257
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.314",
|
|
257
258
|
"@anthropic-ai/sdk": "^1.3.0",
|
|
258
259
|
"@asteasolutions/zod-to-openapi": "^8.0.0",
|
|
259
260
|
"@aws-sdk/client-bedrock": "3.1048.0",
|
|
@@ -272,7 +273,7 @@ var package_default = {
|
|
|
272
273
|
"@jitl/quickjs-singlefile-mjs-release-sync": "0.32.0",
|
|
273
274
|
"@linear/sdk": "^77.0.0",
|
|
274
275
|
"@modelcontextprotocol/sdk": "1.32.1",
|
|
275
|
-
"@openai/codex": "0.
|
|
276
|
+
"@openai/codex": "0.166.0",
|
|
276
277
|
"@openfort/openfort-node": "^0.9.1",
|
|
277
278
|
"@opentelemetry/api": "^1.9.1",
|
|
278
279
|
"@opentelemetry/api-logs": "^0.218.0",
|
|
@@ -843,7 +844,7 @@ function McpServer({ port, apiKey, dbPath }) {
|
|
|
843
844
|
if (dbPath) {
|
|
844
845
|
process.env.DATABASE_PATH = dbPath;
|
|
845
846
|
}
|
|
846
|
-
import("./http-
|
|
847
|
+
import("./http-mhz9vw1f.js").then(() => {
|
|
847
848
|
setStatus("running");
|
|
848
849
|
}).catch((err) => {
|
|
849
850
|
setStatus("error");
|
|
@@ -930,7 +931,7 @@ function WorkerRunner({
|
|
|
930
931
|
const { exit } = use_app_default();
|
|
931
932
|
import_react.useEffect(() => {
|
|
932
933
|
installConsoleScrub();
|
|
933
|
-
import("./worker-
|
|
934
|
+
import("./worker-gg1576j3.js").then(({ runWorker }) => runWorker({
|
|
934
935
|
prompt: prompt || undefined,
|
|
935
936
|
yolo,
|
|
936
937
|
systemPrompt: systemPrompt || undefined,
|
|
@@ -948,7 +949,7 @@ function LeadRunner({ prompt, yolo, systemPrompt, systemPromptFile, additionalAr
|
|
|
948
949
|
const { exit } = use_app_default();
|
|
949
950
|
import_react.useEffect(() => {
|
|
950
951
|
installConsoleScrub();
|
|
951
|
-
import("./lead-
|
|
952
|
+
import("./lead-enq35nqp.js").then(({ runLead }) => runLead({
|
|
952
953
|
prompt: prompt || undefined,
|
|
953
954
|
yolo,
|
|
954
955
|
systemPrompt: systemPrompt || undefined,
|
|
@@ -988,8 +989,8 @@ function LazyComponent({
|
|
|
988
989
|
}
|
|
989
990
|
return import_react.createElement(Component, props);
|
|
990
991
|
}
|
|
991
|
-
var loadOnboard = () => import("./onboard-
|
|
992
|
-
var loadConnect = () => import("./setup-
|
|
992
|
+
var loadOnboard = () => import("./onboard-kpsrkarj.js").then(({ Onboard }) => Onboard);
|
|
993
|
+
var loadConnect = () => import("./setup-dnb56qy5.js").then(({ Setup }) => Setup);
|
|
993
994
|
function UnknownCommand({ command }) {
|
|
994
995
|
const { exit } = use_app_default();
|
|
995
996
|
import_react.useEffect(() => {
|
|
@@ -1121,14 +1122,14 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
1121
1122
|
}
|
|
1122
1123
|
process.exit(0);
|
|
1123
1124
|
} else if (args.command === "hook") {
|
|
1124
|
-
const { runHook } = await import("./hook-
|
|
1125
|
+
const { runHook } = await import("./hook-9k551xnj.js");
|
|
1125
1126
|
await runHook();
|
|
1126
1127
|
} else if (args.command === "codex-hook") {
|
|
1127
1128
|
const { handleCodexHook } = await import("./codex-hook-9efm2x1m.js");
|
|
1128
1129
|
await handleCodexHook();
|
|
1129
1130
|
process.exit(process.exitCode ?? 0);
|
|
1130
1131
|
} else if (args.command === "session-summary-stdin") {
|
|
1131
|
-
const { runSessionSummaryFromStdin } = await import("./hook-
|
|
1132
|
+
const { runSessionSummaryFromStdin } = await import("./hook-5zs3msf6.js");
|
|
1132
1133
|
await runSessionSummaryFromStdin();
|
|
1133
1134
|
process.exit(process.exitCode ?? 0);
|
|
1134
1135
|
} else if (args.command === "x") {
|
|
@@ -1141,7 +1142,7 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
1141
1142
|
printHelp("scripts");
|
|
1142
1143
|
process.exit(scriptsArgs[0] === "reembed" || args.showHelp ? 0 : 1);
|
|
1143
1144
|
}
|
|
1144
|
-
const { runScriptsMaintenanceCommand } = await import("./maintenance-
|
|
1145
|
+
const { runScriptsMaintenanceCommand } = await import("./maintenance-7mdgxcea.js");
|
|
1145
1146
|
await runScriptsMaintenanceCommand(scriptsArgs);
|
|
1146
1147
|
console.log("Scripts re-embedded.");
|
|
1147
1148
|
} else if (args.command === "rbac") {
|
|
@@ -1151,17 +1152,17 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
1151
1152
|
printHelp("rbac");
|
|
1152
1153
|
process.exit(args.showHelp ? 0 : 1);
|
|
1153
1154
|
}
|
|
1154
|
-
const { runRbacCliCommand } = await import("./rbac-roles-
|
|
1155
|
+
const { runRbacCliCommand } = await import("./rbac-roles-81ypx6es.js");
|
|
1155
1156
|
await runRbacCliCommand(rbacArgs);
|
|
1156
1157
|
} else if (args.command === "codex-login") {
|
|
1157
1158
|
const { runCodexLogin } = await import("./codex-login-y0pmff1c.js");
|
|
1158
1159
|
const codexLoginArgs = process.argv.slice(process.argv.indexOf("codex-login") + 1);
|
|
1159
1160
|
await runCodexLogin(codexLoginArgs);
|
|
1160
1161
|
} else if (args.command === "codex-session-runner") {
|
|
1161
|
-
const { runCodexSessionRunner } = await import("./codex-session-runner-
|
|
1162
|
+
const { runCodexSessionRunner } = await import("./codex-session-runner-jesa32xc.js");
|
|
1162
1163
|
await runCodexSessionRunner();
|
|
1163
1164
|
} else if (args.command === "claude-managed-setup") {
|
|
1164
|
-
const { runClaudeManagedSetup } = await import("./claude-managed-setup-
|
|
1165
|
+
const { runClaudeManagedSetup } = await import("./claude-managed-setup-sc6j4dm0.js");
|
|
1165
1166
|
const setupArgs = process.argv.slice(process.argv.indexOf("claude-managed-setup") + 1);
|
|
1166
1167
|
await runClaudeManagedSetup(setupArgs);
|
|
1167
1168
|
} else if (args.command === "worker-token") {
|
|
@@ -1169,11 +1170,11 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
1169
1170
|
const tokenArgs = process.argv.slice(process.argv.indexOf("worker-token") + 1);
|
|
1170
1171
|
process.exit(await runWorkerToken(tokenArgs));
|
|
1171
1172
|
} else if (args.command === "e2b") {
|
|
1172
|
-
const { runE2BCommand } = await import("./e2b-
|
|
1173
|
+
const { runE2BCommand } = await import("./e2b-a19d28rz.js");
|
|
1173
1174
|
const e2bArgs = process.argv.slice(process.argv.indexOf("e2b") + 1);
|
|
1174
1175
|
await runE2BCommand(e2bArgs);
|
|
1175
1176
|
} else if (args.command === "controller") {
|
|
1176
|
-
const { runController } = await import("./controller-
|
|
1177
|
+
const { runController } = await import("./controller-dt1n3c1q.js");
|
|
1177
1178
|
await runController(process.argv.slice(process.argv.indexOf("controller") + 1));
|
|
1178
1179
|
} else {
|
|
1179
1180
|
render_default(/* @__PURE__ */ jsx_dev_runtime.jsxDEV(App, {
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
checkCodexCredentials2,
|
|
3
3
|
createInProcessCodexSession2,
|
|
4
4
|
CodexAdapter2
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-0qatpy8q.js";
|
|
6
6
|
import"./cli-4zsenjhy.js";
|
|
7
7
|
import"./cli-kr5tjjtz.js";
|
|
8
8
|
import"./cli-98rwmcyc.js";
|
|
9
9
|
import"./cli-4bd1rck6.js";
|
|
10
10
|
import"./cli-jc1g9ndz.js";
|
|
11
|
-
import"./cli-
|
|
11
|
+
import"./cli-faxe6thg.js";
|
|
12
12
|
import"./cli-0726awxw.js";
|
|
13
13
|
import"./cli-dhar9qay.js";
|
|
14
14
|
import"./cli-mthwvjre.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import"./cli-dhar9qay.js";
|
|
2
2
|
import"./cli-mthwvjre.js";
|
|
3
|
-
import"./cli-
|
|
3
|
+
import"./cli-faxe6thg.js";
|
|
4
4
|
import {
|
|
5
5
|
createInProcessCodexSession2
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-0qatpy8q.js";
|
|
7
7
|
import"./cli-jc1g9ndz.js";
|
|
8
8
|
import"./cli-0726awxw.js";
|
|
9
9
|
import"./cli-4bd1rck6.js";
|
|
@@ -2,12 +2,16 @@ import {
|
|
|
2
2
|
getAllAgents2,
|
|
3
3
|
getAllTasks2,
|
|
4
4
|
init_db4
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-k2gzwsj2.js";
|
|
6
6
|
import {
|
|
7
7
|
EXTERNAL_CHANNEL_BLOCKED_REPLY2,
|
|
8
8
|
shouldBlockChannel2,
|
|
9
9
|
init_external_channel
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-w6dt9ged.js";
|
|
11
|
+
import {
|
|
12
|
+
isSlackLeaveThreadDisabled,
|
|
13
|
+
init_left_threads
|
|
14
|
+
} from "./cli-gdhpcbhf.js";
|
|
11
15
|
import {
|
|
12
16
|
isEnvFlagEnabled,
|
|
13
17
|
init_env_flag
|
|
@@ -91,9 +95,10 @@ function registerCommandHandler(app) {
|
|
|
91
95
|
• \`!now <message>\` in a thread — Flush buffer immediately, skip dependency queue
|
|
92
96
|
• Follow-up tasks auto-depend on the active task in the thread for natural sequencing`);
|
|
93
97
|
}
|
|
98
|
+
const leaveLine = isSlackLeaveThreadDisabled() ? "" : "\n• `!leave` in a thread - Make the swarm ignore that thread until someone @mentions it";
|
|
94
99
|
sections.push(`*Commands:*
|
|
95
100
|
• \`/agent-swarm-status\` - Show all agents and their current status
|
|
96
|
-
• \`/agent-swarm-help\` - Show this help message`);
|
|
101
|
+
• \`/agent-swarm-help\` - Show this help message${leaveLine}`);
|
|
97
102
|
const blocks = [
|
|
98
103
|
{
|
|
99
104
|
type: "header",
|
|
@@ -114,6 +119,7 @@ var init_commands = __esm(() => {
|
|
|
114
119
|
init_db4();
|
|
115
120
|
init_env_flag();
|
|
116
121
|
init_external_channel();
|
|
122
|
+
init_left_threads();
|
|
117
123
|
});
|
|
118
124
|
init_commands();
|
|
119
125
|
|
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
CONTROLLER_PROTOCOL_VERSION,
|
|
4
4
|
CONTROLLER_PING_INTERVAL_MS,
|
|
5
5
|
ControllerServerMessageSchema
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-xnrwazav.js";
|
|
7
7
|
import {
|
|
8
8
|
createRuntimeProvider,
|
|
9
9
|
init_runtime_providers
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-kqdg1bsb.js";
|
|
11
11
|
import {
|
|
12
12
|
RuntimeProviderKindSchema,
|
|
13
13
|
init_types4
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-nhrvpaj7.js";
|
|
15
15
|
import {
|
|
16
16
|
scrubSecrets,
|
|
17
17
|
registerVolatileSecret,
|
|
@@ -24,6 +24,11 @@ init_types4();
|
|
|
24
24
|
init_secret_scrubber();
|
|
25
25
|
async function executeCommand(controller, command) {
|
|
26
26
|
switch (command.op) {
|
|
27
|
+
case "release-cache":
|
|
28
|
+
if (!controller.releaseCache)
|
|
29
|
+
throw new Error("Controller does not support cache cleanup");
|
|
30
|
+
await controller.releaseCache(command.payload);
|
|
31
|
+
return {};
|
|
27
32
|
case "provision":
|
|
28
33
|
return await controller.provision(command.payload);
|
|
29
34
|
case "terminate":
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
isRuntimePoolsEnabled,
|
|
4
4
|
init_runtime_pools_flag,
|
|
5
5
|
init_db4
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-k2gzwsj2.js";
|
|
7
7
|
import {
|
|
8
8
|
CONTROLLER_PROTOCOL_VERSION,
|
|
9
9
|
CONTROLLER_PING_INTERVAL_MS,
|
|
10
10
|
ControllerClientMessageSchema
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-xnrwazav.js";
|
|
12
12
|
import {
|
|
13
13
|
getRuntimeController2,
|
|
14
14
|
init_db2
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-yn4kxs06.js";
|
|
16
16
|
import {
|
|
17
17
|
remoteControllerSession,
|
|
18
18
|
installRemoteController,
|
|
@@ -21,36 +21,37 @@ import {
|
|
|
21
21
|
ensureRuntimeOwnerId,
|
|
22
22
|
reconcileRemoteProvisions,
|
|
23
23
|
reconcileControllerOrphans
|
|
24
|
-
} from "./cli-
|
|
25
|
-
import"./cli-
|
|
26
|
-
import"./cli-
|
|
24
|
+
} from "./cli-8snvgs5r.js";
|
|
25
|
+
import"./cli-w6dt9ged.js";
|
|
26
|
+
import"./cli-waqbxg08.js";
|
|
27
27
|
import"./cli-wx3rhnm0.js";
|
|
28
|
-
import"./cli-
|
|
28
|
+
import"./cli-m48g6p95.js";
|
|
29
29
|
import {
|
|
30
30
|
resolveHttpRequestAuth,
|
|
31
31
|
init_auth
|
|
32
|
-
} from "./cli-
|
|
33
|
-
import"./cli-
|
|
34
|
-
import"./cli-
|
|
35
|
-
import"./cli-
|
|
32
|
+
} from "./cli-shpbx5ee.js";
|
|
33
|
+
import"./cli-rmmmrjkd.js";
|
|
34
|
+
import"./cli-zbbwez0r.js";
|
|
35
|
+
import"./cli-89knwags.js";
|
|
36
36
|
import"./cli-3xj33nrx.js";
|
|
37
37
|
import {
|
|
38
38
|
route,
|
|
39
39
|
init_route_def
|
|
40
|
-
} from "./cli-
|
|
41
|
-
import"./cli-
|
|
42
|
-
import"./cli-
|
|
43
|
-
import"./cli-
|
|
44
|
-
import"./cli-
|
|
45
|
-
import"./cli-
|
|
40
|
+
} from "./cli-4necwtsv.js";
|
|
41
|
+
import"./cli-c60vetmm.js";
|
|
42
|
+
import"./cli-hr2e2fft.js";
|
|
43
|
+
import"./cli-xnqgpshy.js";
|
|
44
|
+
import"./cli-8bc1w0tw.js";
|
|
45
|
+
import"./cli-gdhpcbhf.js";
|
|
46
|
+
import"./cli-hgaazk69.js";
|
|
46
47
|
import {
|
|
47
48
|
registerSessionTokenConnection,
|
|
48
49
|
init_session_token_connections
|
|
49
|
-
} from "./cli-
|
|
50
|
+
} from "./cli-drr5v6av.js";
|
|
50
51
|
import {
|
|
51
52
|
import_websocket_server,
|
|
52
53
|
init_wrapper2
|
|
53
|
-
} from "./cli-
|
|
54
|
+
} from "./cli-69szn7w7.js";
|
|
54
55
|
import {
|
|
55
56
|
getApiKey,
|
|
56
57
|
init_api_key
|
|
@@ -19,9 +19,9 @@ import {
|
|
|
19
19
|
createPoolAgent2,
|
|
20
20
|
loadRuntimeControllerSecrets2,
|
|
21
21
|
init_db2
|
|
22
|
-
} from "./cli-
|
|
23
|
-
import"./cli-
|
|
24
|
-
import"./cli-
|
|
22
|
+
} from "./cli-yn4kxs06.js";
|
|
23
|
+
import"./cli-drr5v6av.js";
|
|
24
|
+
import"./cli-k2gzwsj2.js";
|
|
25
25
|
init_db2();
|
|
26
26
|
|
|
27
27
|
export {
|
|
@@ -96,7 +96,9 @@ import {
|
|
|
96
96
|
getLatestActiveTaskByContextKey2,
|
|
97
97
|
getLatestLeadTaskByContextKey2,
|
|
98
98
|
getMostRecentTaskInThread2,
|
|
99
|
-
|
|
99
|
+
findCompletedTasksInThread2,
|
|
100
|
+
findRecentFailedTaskInThread2,
|
|
101
|
+
countAgentDispatchesInThread2,
|
|
100
102
|
findRecentCancelledTaskInThread2,
|
|
101
103
|
AssetKeyMovesBlockedError2,
|
|
102
104
|
assertAssetKeyMovesAllowed2,
|
|
@@ -128,6 +130,8 @@ import {
|
|
|
128
130
|
recordKeySeatMismatch2,
|
|
129
131
|
recordKeyValidation2,
|
|
130
132
|
getScriptRunExecutionArgs2,
|
|
133
|
+
getScriptRunFollowUpGuard2,
|
|
134
|
+
setScriptRunFollowUpGuard2,
|
|
131
135
|
literalPrefixPattern2,
|
|
132
136
|
getSlackRenderV2ActivatedAt2,
|
|
133
137
|
ensureSlackRenderV2Activation2,
|
|
@@ -510,7 +514,7 @@ import {
|
|
|
510
514
|
countScriptRunJournalSteps2,
|
|
511
515
|
countScriptRunJournalAgentTaskSteps2,
|
|
512
516
|
init_db4
|
|
513
|
-
} from "./cli-
|
|
517
|
+
} from "./cli-k2gzwsj2.js";
|
|
514
518
|
import {
|
|
515
519
|
generateDefaultClaudeMd2,
|
|
516
520
|
generateDefaultSoulMd2,
|
|
@@ -562,6 +566,7 @@ export {
|
|
|
562
566
|
completeTask2 as completeTask,
|
|
563
567
|
computeContentHash2 as computeContentHash,
|
|
564
568
|
countActiveScriptRuns2 as countActiveScriptRuns,
|
|
569
|
+
countAgentDispatchesInThread2 as countAgentDispatchesInThread,
|
|
565
570
|
countAllMetrics2 as countAllMetrics,
|
|
566
571
|
countAllPages2 as countAllPages,
|
|
567
572
|
countKv2 as countKv,
|
|
@@ -636,9 +641,10 @@ export {
|
|
|
636
641
|
failPendingResumeIfUnclaimed2 as failPendingResumeIfUnclaimed,
|
|
637
642
|
failTask2 as failTask,
|
|
638
643
|
findActiveTasksByVcs2 as findActiveTasksByVcs,
|
|
639
|
-
|
|
644
|
+
findCompletedTasksInThread2 as findCompletedTasksInThread,
|
|
640
645
|
findExistingLinearTrackerContextWork2 as findExistingLinearTrackerContextWork,
|
|
641
646
|
findRecentCancelledTaskInThread2 as findRecentCancelledTaskInThread,
|
|
647
|
+
findRecentFailedTaskInThread2 as findRecentFailedTaskInThread,
|
|
642
648
|
findRecentSimilarTasks2 as findRecentSimilarTasks,
|
|
643
649
|
findTaskByAgentMailThread2 as findTaskByAgentMailThread,
|
|
644
650
|
findTaskByGitHub2 as findTaskByGitHub,
|
|
@@ -787,6 +793,7 @@ export {
|
|
|
787
793
|
getScriptRun2 as getScriptRun,
|
|
788
794
|
getScriptRunByIdempotencyKey2 as getScriptRunByIdempotencyKey,
|
|
789
795
|
getScriptRunExecutionArgs2 as getScriptRunExecutionArgs,
|
|
796
|
+
getScriptRunFollowUpGuard2 as getScriptRunFollowUpGuard,
|
|
790
797
|
getScriptRunJournalStep2 as getScriptRunJournalStep,
|
|
791
798
|
getServiceByAgentAndName2 as getServiceByAgentAndName,
|
|
792
799
|
getServiceById2 as getServiceById,
|
|
@@ -979,6 +986,7 @@ export {
|
|
|
979
986
|
setApiKeyPlan2 as setApiKeyPlan,
|
|
980
987
|
setBudgetRefusalFollowUpTaskId2 as setBudgetRefusalFollowUpTaskId,
|
|
981
988
|
setFavorite2 as setFavorite,
|
|
989
|
+
setScriptRunFollowUpGuard2 as setScriptRunFollowUpGuard,
|
|
982
990
|
setSlackMessageTracking2 as setSlackMessageTracking,
|
|
983
991
|
setUserFavorite2 as setUserFavorite,
|
|
984
992
|
settleSupersededTaskDependents2 as settleSupersededTaskDependents,
|
|
@@ -12,23 +12,24 @@ import {
|
|
|
12
12
|
dispatchPre2,
|
|
13
13
|
dispatchPost2,
|
|
14
14
|
init_dispatcher
|
|
15
|
-
} from "./cli-
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
15
|
+
} from "./cli-shpbx5ee.js";
|
|
16
|
+
import"./cli-zbbwez0r.js";
|
|
17
|
+
import"./cli-89knwags.js";
|
|
18
|
+
import"./cli-c60vetmm.js";
|
|
19
|
+
import"./cli-hr2e2fft.js";
|
|
20
|
+
import"./cli-xnqgpshy.js";
|
|
21
21
|
import"./cli-3xj33nrx.js";
|
|
22
|
-
import"./cli-
|
|
23
|
-
import"./cli-
|
|
24
|
-
import"./cli-
|
|
25
|
-
import"./cli-
|
|
26
|
-
import"./cli-
|
|
27
|
-
import"./cli-
|
|
28
|
-
import"./cli-
|
|
29
|
-
import"./cli-
|
|
30
|
-
import"./cli-
|
|
31
|
-
import"./cli-
|
|
22
|
+
import"./cli-4necwtsv.js";
|
|
23
|
+
import"./cli-m48g6p95.js";
|
|
24
|
+
import"./cli-8bc1w0tw.js";
|
|
25
|
+
import"./cli-waqbxg08.js";
|
|
26
|
+
import"./cli-gdhpcbhf.js";
|
|
27
|
+
import"./cli-w6dt9ged.js";
|
|
28
|
+
import"./cli-hgaazk69.js";
|
|
29
|
+
import"./cli-yn4kxs06.js";
|
|
30
|
+
import"./cli-drr5v6av.js";
|
|
31
|
+
import"./cli-rmmmrjkd.js";
|
|
32
|
+
import"./cli-k2gzwsj2.js";
|
|
32
33
|
import"./cli-wx3rhnm0.js";
|
|
33
34
|
init_dispatcher();
|
|
34
35
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
RUNTIME_LABELS,
|
|
3
|
-
init_types5
|
|
4
|
-
} from "./cli-gjr2y2xk.js";
|
|
5
1
|
import {
|
|
6
2
|
redactWithEnv,
|
|
7
3
|
init_env2
|
|
8
4
|
} from "./cli-ae7mrdf9.js";
|
|
5
|
+
import {
|
|
6
|
+
RUNTIME_LABELS,
|
|
7
|
+
init_types5
|
|
8
|
+
} from "./cli-0agcv1v5.js";
|
|
9
9
|
import {
|
|
10
10
|
scrubSecrets,
|
|
11
11
|
init_secret_scrubber
|
|
@@ -43,6 +43,13 @@ function socketPath(target) {
|
|
|
43
43
|
}
|
|
44
44
|
return host.slice("unix://".length);
|
|
45
45
|
}
|
|
46
|
+
function isCacheMountError(error) {
|
|
47
|
+
return error instanceof DockerApiError && /\b(?:mount\w*|volume\w*)\b/i.test(error.message);
|
|
48
|
+
}
|
|
49
|
+
function assertCacheOwner(volume, cache) {
|
|
50
|
+
if (volume.Name !== cache.key || volume.Labels?.[RUNTIME_LABELS.owner] !== cache.ownerId || volume.Labels?.[RUNTIME_LABELS.poolId] !== cache.poolId || volume.Labels?.["swarm.cache"] !== "true")
|
|
51
|
+
throw new Error(`Cache volume ${cache.key} is not owned by this swarm and pool`);
|
|
52
|
+
}
|
|
46
53
|
async function dockerApi(target, method, path, body, stream = false, retryVersion = true) {
|
|
47
54
|
const socket = socketPath(target);
|
|
48
55
|
try {
|
|
@@ -84,7 +91,12 @@ async function dockerApi(target, method, path, body, stream = false, retryVersio
|
|
|
84
91
|
|
|
85
92
|
class DockerRuntimeProvider {
|
|
86
93
|
kind = "docker";
|
|
87
|
-
traits = {
|
|
94
|
+
traits = {
|
|
95
|
+
canProvision: true,
|
|
96
|
+
ephemeralDisk: true,
|
|
97
|
+
supportsPause: false,
|
|
98
|
+
persistentCache: true
|
|
99
|
+
};
|
|
88
100
|
checkConfig(target) {
|
|
89
101
|
try {
|
|
90
102
|
socketPath(target);
|
|
@@ -95,6 +107,28 @@ class DockerRuntimeProvider {
|
|
|
95
107
|
}
|
|
96
108
|
async provision(target, req) {
|
|
97
109
|
try {
|
|
110
|
+
let cacheWarning;
|
|
111
|
+
let cacheMount;
|
|
112
|
+
if (req.cache) {
|
|
113
|
+
try {
|
|
114
|
+
const volume = await dockerApi(target, "POST", "/volumes/create", {
|
|
115
|
+
Name: req.cache.key,
|
|
116
|
+
Labels: {
|
|
117
|
+
[RUNTIME_LABELS.owner]: req.ownerId,
|
|
118
|
+
[RUNTIME_LABELS.poolId]: req.poolId,
|
|
119
|
+
"swarm.cache": "true"
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
assertCacheOwner(volume, {
|
|
123
|
+
key: req.cache.key,
|
|
124
|
+
poolId: req.poolId,
|
|
125
|
+
ownerId: req.ownerId
|
|
126
|
+
});
|
|
127
|
+
cacheMount = { Type: "volume", Source: req.cache.key, Target: req.cache.mountPath };
|
|
128
|
+
} catch (error) {
|
|
129
|
+
cacheWarning = redactWithEnv(scrubSecrets(String(error)), req.env);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
98
132
|
const path = `/containers/create?name=${encodeURIComponent(`swarm-rt-${req.runtimeId}`)}`;
|
|
99
133
|
const body = {
|
|
100
134
|
Image: req.image,
|
|
@@ -113,34 +147,67 @@ class DockerRuntimeProvider {
|
|
|
113
147
|
],
|
|
114
148
|
NetworkMode: target.DOCKER_NETWORK,
|
|
115
149
|
Memory: req.resources?.memoryMb ? req.resources.memoryMb * 1024 * 1024 : undefined,
|
|
116
|
-
NanoCpus: req.resources?.cpu ? Math.round(req.resources.cpu * 1e9) : undefined
|
|
150
|
+
NanoCpus: req.resources?.cpu ? Math.round(req.resources.cpu * 1e9) : undefined,
|
|
151
|
+
...cacheMount ? { Mounts: [cacheMount] } : {}
|
|
117
152
|
}
|
|
118
153
|
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
154
|
+
const createAndStart = async () => {
|
|
155
|
+
let created;
|
|
156
|
+
try {
|
|
157
|
+
created = await dockerApi(target, "POST", path, body);
|
|
158
|
+
} catch (err) {
|
|
159
|
+
if (!(err instanceof DockerApiError) || err.statusCode !== 404 || !err.message.includes("No such image"))
|
|
160
|
+
throw err;
|
|
161
|
+
const pullParams = new URLSearchParams({ fromImage: req.image });
|
|
162
|
+
if (!req.image.includes("@") && req.image.lastIndexOf(":") <= req.image.lastIndexOf("/")) {
|
|
163
|
+
pullParams.set("tag", "latest");
|
|
164
|
+
}
|
|
165
|
+
await dockerApi(target, "POST", `/images/create?${pullParams}`, undefined, true);
|
|
166
|
+
created = await dockerApi(target, "POST", path, body);
|
|
125
167
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
168
|
+
try {
|
|
169
|
+
await dockerApi(target, "POST", `/containers/${created.Id}/start`);
|
|
170
|
+
} catch (err) {
|
|
171
|
+
try {
|
|
172
|
+
await dockerApi(target, "DELETE", `/containers/${created.Id}?force=true&v=true`);
|
|
173
|
+
} catch (cleanupError) {
|
|
174
|
+
if (cacheMount && isCacheMountError(err) && !(cleanupError instanceof DockerApiError && cleanupError.statusCode === 404))
|
|
175
|
+
throw new Error(`${String(err)}; failed-start cleanup failed: ${String(cleanupError)}`);
|
|
176
|
+
}
|
|
177
|
+
throw err;
|
|
129
178
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
179
|
+
return created.Id;
|
|
180
|
+
};
|
|
181
|
+
let externalId;
|
|
133
182
|
try {
|
|
134
|
-
await
|
|
183
|
+
externalId = await createAndStart();
|
|
135
184
|
} catch (err) {
|
|
136
|
-
|
|
137
|
-
|
|
185
|
+
if (!cacheMount || !isCacheMountError(err))
|
|
186
|
+
throw err;
|
|
187
|
+
cacheWarning = redactWithEnv(scrubSecrets(String(err)), req.env);
|
|
188
|
+
delete body.HostConfig.Mounts;
|
|
189
|
+
externalId = await createAndStart();
|
|
138
190
|
}
|
|
139
|
-
return {
|
|
191
|
+
return {
|
|
192
|
+
kind: "docker",
|
|
193
|
+
externalId,
|
|
194
|
+
...cacheWarning ? { meta: { cacheWarning } } : {}
|
|
195
|
+
};
|
|
140
196
|
} catch (err) {
|
|
141
197
|
throw new Error(redactWithEnv(String(err), req.env));
|
|
142
198
|
}
|
|
143
199
|
}
|
|
200
|
+
async releaseCache(target, cache) {
|
|
201
|
+
const path = `/volumes/${encodeURIComponent(cache.key)}`;
|
|
202
|
+
try {
|
|
203
|
+
const volume = await dockerApi(target, "GET", path);
|
|
204
|
+
assertCacheOwner(volume, cache);
|
|
205
|
+
await dockerApi(target, "DELETE", path);
|
|
206
|
+
} catch (error) {
|
|
207
|
+
if (!(error instanceof DockerApiError && error.statusCode === 404))
|
|
208
|
+
throw error;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
144
211
|
async terminate(target, handle) {
|
|
145
212
|
try {
|
|
146
213
|
await dockerApi(target, "DELETE", `/containers/${handle.externalId}?force=true&v=true`);
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
use_app_default,
|
|
7
7
|
Select,
|
|
8
8
|
TextInput
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-he5nxaa8.js";
|
|
10
10
|
import {
|
|
11
11
|
require_jsx_dev_runtime
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-sa02jsqt.js";
|
|
13
13
|
import {
|
|
14
14
|
sandboxPortUrl,
|
|
15
15
|
createSandbox,
|