@agentstep/agent-sdk 0.4.13 → 0.4.14
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/auth/middleware.js +6 -6
- package/dist/backends/claude/args.js +6 -6
- package/dist/backends/claude/index.js +8 -8
- package/dist/backends/claude/wrapper-script.js +1 -1
- package/dist/backends/codex/auth.js +6 -6
- package/dist/backends/codex/index.js +11 -11
- package/dist/backends/codex/setup.js +4 -4
- package/dist/backends/codex/wrapper-script.js +1 -1
- package/dist/backends/factory/auth.js +6 -6
- package/dist/backends/factory/index.js +11 -11
- package/dist/backends/factory/setup.js +4 -4
- package/dist/backends/factory/wrapper-script.js +1 -1
- package/dist/backends/gemini/auth.js +6 -6
- package/dist/backends/gemini/index.js +11 -11
- package/dist/backends/gemini/setup.js +4 -4
- package/dist/backends/gemini/wrapper-script.js +1 -1
- package/dist/backends/opencode/auth.js +6 -6
- package/dist/backends/opencode/index.js +11 -11
- package/dist/backends/opencode/setup.js +4 -4
- package/dist/backends/opencode/wrapper-script.js +1 -1
- package/dist/backends/pi/auth.js +6 -6
- package/dist/backends/pi/index.js +11 -11
- package/dist/backends/pi/setup.js +4 -4
- package/dist/backends/pi/wrapper-script.js +1 -1
- package/dist/backends/registry.js +29 -29
- package/dist/{chunk-7YYEE7XR.js → chunk-24NL6GPL.js} +5 -5
- package/dist/{chunk-5GDMWWYD.js → chunk-2BDD6OHG.js} +10 -2
- package/dist/{chunk-XLVCC4IB.js → chunk-374KGHBM.js} +5 -5
- package/dist/{chunk-ME6IR4T6.js → chunk-3W6KEDQE.js} +4 -4
- package/dist/{chunk-4INVRCRD.js → chunk-42O6EBUN.js} +2 -2
- package/dist/{chunk-LP7AQJCU.js → chunk-4MHPOB7A.js} +3 -3
- package/dist/{chunk-DZDWNOEY.js → chunk-5GZEX4HV.js} +1 -1
- package/dist/{chunk-MAW3HLIO.js → chunk-6NZPNYHA.js} +2 -2
- package/dist/{chunk-3KDZP45U.js → chunk-6QQKTF55.js} +11 -8
- package/dist/{chunk-U4F4JSME.js → chunk-7GPKEOAO.js} +3 -3
- package/dist/{chunk-JZ5RFO77.js → chunk-7LQN7NVU.js} +5 -5
- package/dist/{chunk-X3U7IVTN.js → chunk-7OAMTB47.js} +2 -2
- package/dist/{chunk-JFY6EH24.js → chunk-A7MX6RSQ.js} +15 -15
- package/dist/{chunk-IJEZAD5O.js → chunk-ADK2TYO4.js} +2 -2
- package/dist/{chunk-PMEF3X3C.js → chunk-B47IDF63.js} +2 -2
- package/dist/{chunk-RTS2QUZB.js → chunk-B6LPLXPB.js} +8 -8
- package/dist/{chunk-V7OXXKAL.js → chunk-BZ6HFTHU.js} +1 -1
- package/dist/{chunk-I3AP3LEY.js → chunk-CDK25PRU.js} +5 -5
- package/dist/{chunk-TSYQ4XKJ.js → chunk-CSNIN5YZ.js} +2 -2
- package/dist/{chunk-3WJMUX5B.js → chunk-DO4WVWW7.js} +1 -1
- package/dist/{chunk-4FHRWC4H.js → chunk-EDRLRJNT.js} +5 -5
- package/dist/{chunk-AKRE4OEL.js → chunk-EFOIR7R3.js} +5 -3
- package/dist/{chunk-MXRGQRFX.js → chunk-EOFJ2MWJ.js} +4 -4
- package/dist/{chunk-TV2VE2LX.js → chunk-F6M4RLDQ.js} +2 -2
- package/dist/{chunk-NHY4Q6LS.js → chunk-F7DOI3B5.js} +12 -12
- package/dist/{chunk-6BDLNY5J.js → chunk-FVFMYO5W.js} +2 -2
- package/dist/{chunk-KDAZ5TBL.js → chunk-G37JVAOI.js} +5 -5
- package/dist/{chunk-OQWHKEYE.js → chunk-GAFFXICQ.js} +3 -3
- package/dist/{chunk-VVH5DQ2C.js → chunk-GCMYVWZ6.js} +1 -1
- package/dist/{chunk-TQHS4W74.js → chunk-GGYTAWW6.js} +1 -1
- package/dist/{chunk-3NZQBGUJ.js → chunk-GHDY4DVK.js} +13 -13
- package/dist/{chunk-UVCPCX74.js → chunk-GR4QPRB7.js} +5 -5
- package/dist/{chunk-OHYPVKTP.js → chunk-GSODOHNB.js} +4 -4
- package/dist/{chunk-Q4XYK6FF.js → chunk-HE7EOIPA.js} +5 -5
- package/dist/{chunk-KEV4OMRF.js → chunk-HIDFQDFP.js} +9 -9
- package/dist/{chunk-ZA4JVJJE.js → chunk-HOPCVGWL.js} +1 -1
- package/dist/{chunk-3MNDEAPX.js → chunk-HR5YA24J.js} +5 -5
- package/dist/{chunk-MBLMAWSE.js → chunk-I5ZA45YL.js} +7 -7
- package/dist/{chunk-TH54MJMX.js → chunk-IEG5LIX7.js} +1 -1
- package/dist/{chunk-X7W6S3TE.js → chunk-IU457W7Q.js} +5 -5
- package/dist/{chunk-HWTECG57.js → chunk-J4TYHQQG.js} +1 -1
- package/dist/{chunk-Y2SC7HU5.js → chunk-JDBXIJKG.js} +4 -4
- package/dist/{chunk-FDY5BA67.js → chunk-JDELTTHV.js} +1 -1
- package/dist/{chunk-BAH4JSTO.js → chunk-JEI7I3EH.js} +3 -3
- package/dist/{chunk-CKPGSS76.js → chunk-JK5TPJHH.js} +1 -1
- package/dist/{chunk-CX4VNHL6.js → chunk-K2ITIAVJ.js} +73 -31
- package/dist/{chunk-UX6I36QR.js → chunk-LDKZ2SMC.js} +122 -122
- package/dist/{chunk-N5CUDEUJ.js → chunk-LHHBOQUR.js} +2 -2
- package/dist/{chunk-6QDHS2MR.js → chunk-LUQP36Y3.js} +1 -1
- package/dist/{chunk-ETGRQMFJ.js → chunk-M5QX5E5Z.js} +1 -1
- package/dist/{chunk-QKRWCXDU.js → chunk-M674W5NT.js} +1 -1
- package/dist/{chunk-UXZSRUXD.js → chunk-MEEY7BYC.js} +2 -2
- package/dist/{chunk-FXLGGDLM.js → chunk-MFEOQ26S.js} +4 -4
- package/dist/{chunk-RL6XEYOD.js → chunk-MHQXDTJB.js} +1 -1
- package/dist/{chunk-YOFB6CO5.js → chunk-MOLWE2ZY.js} +7 -7
- package/dist/{chunk-6UXT3RG5.js → chunk-MRJMXGCG.js} +4 -4
- package/dist/{chunk-5A6E4F5D.js → chunk-N2RHTKW7.js} +2 -1
- package/dist/{chunk-YM2LYRYY.js → chunk-NCUIEBQY.js} +3 -3
- package/dist/{chunk-7BGILLYC.js → chunk-NIOWKTIF.js} +2 -2
- package/dist/{chunk-OXREXXAQ.js → chunk-NUINUAXO.js} +2 -2
- package/dist/{chunk-XTZ5RQDF.js → chunk-NUO56TF7.js} +4 -4
- package/dist/{chunk-ZIV74JWW.js → chunk-NXRJ7Z4G.js} +2 -2
- package/dist/{chunk-AHHH4PYB.js → chunk-O45IQUWS.js} +3 -3
- package/dist/{chunk-QYFD2OBI.js → chunk-OWTXN2FU.js} +1 -1
- package/dist/{chunk-V4P46OHG.js → chunk-P7P2NWZD.js} +5 -5
- package/dist/{chunk-FB6FOIAY.js → chunk-PCKFMALU.js} +1 -1
- package/dist/{chunk-2FWZ247V.js → chunk-PFLR7INE.js} +2 -2
- package/dist/{chunk-M4RE42AY.js → chunk-PGSOOOB4.js} +3 -3
- package/dist/{chunk-2PKJSOXX.js → chunk-PTGANYUM.js} +1 -1
- package/dist/{chunk-WUNJJNOV.js → chunk-Q3CV35V6.js} +4 -4
- package/dist/{chunk-6A74MTSB.js → chunk-QICG4KW4.js} +3 -3
- package/dist/{chunk-2QGVGXIT.js → chunk-QQDSHL27.js} +4 -4
- package/dist/{chunk-3EGA6TEL.js → chunk-QSYXHYQU.js} +1 -1
- package/dist/{chunk-J4NKW3L5.js → chunk-QYSDP6V5.js} +5 -5
- package/dist/{chunk-LPWEFC55.js → chunk-R5OZHLAD.js} +2 -2
- package/dist/{chunk-CU5GUNFW.js → chunk-R6X47I23.js} +2 -2
- package/dist/{chunk-XLMHG3KR.js → chunk-R7PAZ5OA.js} +38 -35
- package/dist/{chunk-DFE7VZWD.js → chunk-RMEX55EU.js} +4 -4
- package/dist/{chunk-D5XOXR3A.js → chunk-S3SKODVV.js} +4 -4
- package/dist/{chunk-OGONPLTA.js → chunk-SHKBQQ7W.js} +6 -6
- package/dist/{chunk-5ZRGJTR3.js → chunk-SNZ4PDVT.js} +6 -6
- package/dist/{chunk-JMDS2RJJ.js → chunk-SS2EEKNM.js} +1 -1
- package/dist/{chunk-7XFIUYFM.js → chunk-SWIP7JBQ.js} +4 -4
- package/dist/{chunk-XNK2KUTI.js → chunk-SXE7H3VK.js} +2 -2
- package/dist/{chunk-G5RQN53K.js → chunk-TBSWWUJS.js} +1 -1
- package/dist/{chunk-TY7XTT5N.js → chunk-TJA3RHWR.js} +1 -1
- package/dist/{chunk-4BYPJFC5.js → chunk-UF25F3MH.js} +56 -48
- package/dist/{chunk-V364DYC3.js → chunk-UVUSSZ74.js} +1 -1
- package/dist/{chunk-HERWBOQ7.js → chunk-V7WEALLX.js} +5 -5
- package/dist/{chunk-UN3LHCWQ.js → chunk-VIGJQU6V.js} +3 -3
- package/dist/{chunk-7TW4LHPM.js → chunk-X37MWWUA.js} +2 -2
- package/dist/{chunk-W3M3ME6B.js → chunk-XG4UIGDH.js} +5 -5
- package/dist/{chunk-Q5KHBU7P.js → chunk-YEUALILD.js} +3 -3
- package/dist/{chunk-KZGAZPNV.js → chunk-YGAHGTVZ.js} +3 -3
- package/dist/{chunk-6ZJ6X6H7.js → chunk-YIYEPKVQ.js} +1 -1
- package/dist/{chunk-BM34UHSS.js → chunk-YJPQFLY3.js} +4 -4
- package/dist/{chunk-H74BPBKE.js → chunk-YSUPRYX2.js} +5 -5
- package/dist/{chunk-Y5553CX6.js → chunk-ZP5VMV5O.js} +4 -4
- package/dist/config/index.js +5 -5
- package/dist/containers/client.js +6 -6
- package/dist/containers/exec.js +6 -6
- package/dist/containers/lifecycle.js +46 -46
- package/dist/containers/pool.js +3 -3
- package/dist/containers/setup.js +9 -9
- package/dist/db/agents.js +6 -6
- package/dist/db/api_keys.js +5 -5
- package/dist/db/audit.js +3 -3
- package/dist/db/batch.js +10 -10
- package/dist/db/client.js +2 -2
- package/dist/db/credentials.js +3 -3
- package/dist/db/drizzle.js +4 -4
- package/dist/db/environments.js +6 -6
- package/dist/db/events.js +5 -5
- package/dist/db/files.js +5 -5
- package/dist/db/memory.js +5 -5
- package/dist/db/migrations.js +1 -1
- package/dist/db/proxy.js +5 -5
- package/dist/db/schema.js +1 -1
- package/dist/db/session-resources.js +5 -5
- package/dist/db/sessions.js +9 -9
- package/dist/db/sync.js +5 -5
- package/dist/db/tenants.js +3 -3
- package/dist/db/traces.js +5 -5
- package/dist/db/upstream_keys.js +3 -3
- package/dist/db/vaults.js +6 -6
- package/dist/handlers/agents.js +57 -57
- package/dist/handlers/api_keys.js +57 -57
- package/dist/handlers/audit.js +57 -57
- package/dist/handlers/batch.js +57 -57
- package/dist/handlers/credentials.js +57 -57
- package/dist/handlers/environments.js +58 -58
- package/dist/handlers/events.js +61 -61
- package/dist/handlers/files.js +57 -57
- package/dist/handlers/index.js +97 -97
- package/dist/handlers/license.js +56 -56
- package/dist/handlers/memory.js +57 -57
- package/dist/handlers/metrics.js +56 -56
- package/dist/handlers/models.js +57 -57
- package/dist/handlers/openapi.js +3 -3
- package/dist/handlers/providers.js +56 -56
- package/dist/handlers/resources.js +56 -56
- package/dist/handlers/sessions.js +60 -60
- package/dist/handlers/settings.js +56 -56
- package/dist/handlers/skills-write.js +56 -56
- package/dist/handlers/skills.js +57 -57
- package/dist/handlers/stream.js +57 -57
- package/dist/handlers/tenants.js +57 -57
- package/dist/handlers/threads.js +56 -56
- package/dist/handlers/traces.js +57 -57
- package/dist/handlers/ui.js +1 -1
- package/dist/handlers/upstream_keys.js +59 -59
- package/dist/handlers/vaults.js +56 -56
- package/dist/handlers/whoami.js +56 -56
- package/dist/http.js +55 -55
- package/dist/index.js +62 -62
- package/dist/init.js +53 -53
- package/dist/lib/model-registry.js +6 -6
- package/dist/lib/skills-cache.js +6 -6
- package/dist/observability/otlp.js +12 -12
- package/dist/observability/redactor.js +8 -8
- package/dist/openapi/schemas.js +1 -1
- package/dist/openapi/spec.js +2 -2
- package/dist/providers/fly.js +5 -5
- package/dist/providers/modal.js +5 -5
- package/dist/providers/registry.js +1 -1
- package/dist/providers/resolve-secrets.js +7 -7
- package/dist/providers/sprites.js +7 -7
- package/dist/providers/upstream-keys.js +11 -11
- package/dist/providers/vercel.js +5 -5
- package/dist/proxy/forward.js +6 -6
- package/dist/queue/index.js +6 -6
- package/dist/sessions/bus.js +10 -10
- package/dist/sessions/driver.js +46 -46
- package/dist/sessions/grader.js +5 -5
- package/dist/sessions/secrets.js +8 -8
- package/dist/sessions/sweeper.js +43 -43
- package/dist/sessions/threads.js +46 -46
- package/dist/shutdown.js +44 -44
- package/dist/sync/anthropic.js +10 -10
- package/dist/sync/container-file-sync.js +27 -15
- package/dist/sync/file-sync.js +17 -17
- package/package.json +1 -1
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
jsonOk,
|
|
6
6
|
routeWrap
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PFLR7INE.js";
|
|
8
8
|
import {
|
|
9
9
|
getProxiedTenantId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NIOWKTIF.js";
|
|
11
11
|
import {
|
|
12
12
|
getSession,
|
|
13
13
|
updateSessionResources
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-I5ZA45YL.js";
|
|
15
15
|
import {
|
|
16
16
|
countResources,
|
|
17
17
|
createResource,
|
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
getResource,
|
|
20
20
|
init_session_resources,
|
|
21
21
|
listResources
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-R5OZHLAD.js";
|
|
23
23
|
import {
|
|
24
24
|
getDb,
|
|
25
25
|
init_client
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-5GZEX4HV.js";
|
|
27
27
|
import {
|
|
28
28
|
badRequest,
|
|
29
29
|
notFound
|
|
@@ -51,7 +51,7 @@ function runMigrations(db) {
|
|
|
51
51
|
config_json TEXT NOT NULL,
|
|
52
52
|
state TEXT NOT NULL DEFAULT 'preparing',
|
|
53
53
|
state_message TEXT,
|
|
54
|
-
|
|
54
|
+
template_sandbox TEXT,
|
|
55
55
|
checkpoint_id TEXT,
|
|
56
56
|
created_at INTEGER NOT NULL,
|
|
57
57
|
archived_at INTEGER
|
|
@@ -62,7 +62,7 @@ function runMigrations(db) {
|
|
|
62
62
|
agent_id TEXT NOT NULL,
|
|
63
63
|
agent_version INTEGER NOT NULL,
|
|
64
64
|
environment_id TEXT NOT NULL,
|
|
65
|
-
|
|
65
|
+
sandbox_name TEXT,
|
|
66
66
|
-- Legacy name: holds any backend's session id (claude's session_id or
|
|
67
67
|
-- opencode's sessionID). Kept as claude_session_id to avoid schema
|
|
68
68
|
-- churn; see lib/backends/types.ts for the abstraction.
|
|
@@ -444,6 +444,14 @@ function runMigrations(db) {
|
|
|
444
444
|
UNIQUE(vault_id, display_name)
|
|
445
445
|
)
|
|
446
446
|
`);
|
|
447
|
+
const sessCols3 = db.prepare(`PRAGMA table_info(sessions)`).all();
|
|
448
|
+
if (sessCols3.some((c) => c.name === "sprite_name")) {
|
|
449
|
+
db.exec(`ALTER TABLE sessions RENAME COLUMN sprite_name TO sandbox_name`);
|
|
450
|
+
}
|
|
451
|
+
const envCols3 = db.prepare(`PRAGMA table_info(environments)`).all();
|
|
452
|
+
if (envCols3.some((c) => c.name === "template_sprite")) {
|
|
453
|
+
db.exec(`ALTER TABLE environments RENAME COLUMN template_sprite TO template_sandbox`);
|
|
454
|
+
}
|
|
447
455
|
}
|
|
448
456
|
var init_migrations = __esm({
|
|
449
457
|
"src/db/migrations.ts"() {
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
buildGeminiAuthEnv,
|
|
6
6
|
validateGeminiRuntime
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TJA3RHWR.js";
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
prepareGeminiOnSandbox
|
|
10
|
+
} from "./chunk-XG4UIGDH.js";
|
|
11
11
|
import {
|
|
12
12
|
createGeminiTranslator
|
|
13
13
|
} from "./chunk-S3JRZFF5.js";
|
|
14
14
|
import {
|
|
15
15
|
GEMINI_WRAPPER_PATH
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-3W6KEDQE.js";
|
|
17
17
|
import {
|
|
18
18
|
wrapPromptWithSystem
|
|
19
19
|
} from "./chunk-DAT55TX2.js";
|
|
@@ -41,7 +41,7 @@ var geminiBackend = {
|
|
|
41
41
|
wrapperPath: GEMINI_WRAPPER_PATH,
|
|
42
42
|
buildTurn,
|
|
43
43
|
createTranslator: (opts) => createGeminiTranslator(opts),
|
|
44
|
-
|
|
44
|
+
prepareOnSandbox: (name, provider) => prepareGeminiOnSandbox(name, provider),
|
|
45
45
|
validateRuntime: validateGeminiRuntime
|
|
46
46
|
};
|
|
47
47
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// src/backends/gemini/wrapper-script.ts
|
|
2
2
|
var GEMINI_WRAPPER_PATH = "/tmp/.gemini-wrapper";
|
|
3
|
-
var
|
|
3
|
+
var SANDBOX_WRAPPER_SCRIPT = [
|
|
4
4
|
"#!/bin/bash",
|
|
5
5
|
'while IFS= read -r line; do [ -z "$line" ] && break; export "$line"; done',
|
|
6
6
|
'exec gemini "$@"'
|
|
7
7
|
].join("\n");
|
|
8
|
-
async function installGeminiWrapper(
|
|
9
|
-
const escaped =
|
|
10
|
-
await provider.exec(
|
|
8
|
+
async function installGeminiWrapper(sandboxName, provider) {
|
|
9
|
+
const escaped = SANDBOX_WRAPPER_SCRIPT.replace(/'/g, "'\\''");
|
|
10
|
+
await provider.exec(sandboxName, [
|
|
11
11
|
"bash",
|
|
12
12
|
"-c",
|
|
13
13
|
`printf '%s' '${escaped}' > ${GEMINI_WRAPPER_PATH} && chmod +x ${GEMINI_WRAPPER_PATH}`
|
|
@@ -12,15 +12,15 @@ import {
|
|
|
12
12
|
listMemories,
|
|
13
13
|
listMemoryStores,
|
|
14
14
|
updateMemory
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-NUINUAXO.js";
|
|
16
16
|
import {
|
|
17
17
|
jsonOk,
|
|
18
18
|
routeWrap
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-PFLR7INE.js";
|
|
20
20
|
import {
|
|
21
21
|
getDb,
|
|
22
22
|
init_client
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5GZEX4HV.js";
|
|
24
24
|
import {
|
|
25
25
|
badRequest,
|
|
26
26
|
conflict,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
jsonOk,
|
|
3
3
|
routeWrap
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PFLR7INE.js";
|
|
5
5
|
import {
|
|
6
6
|
readSetting,
|
|
7
7
|
writeSetting
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YEUALILD.js";
|
|
9
9
|
import {
|
|
10
10
|
badRequest
|
|
11
11
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -5,23 +5,23 @@ import {
|
|
|
5
5
|
} from "./chunk-23UKWXJH.js";
|
|
6
6
|
import {
|
|
7
7
|
forwardToAnthropic
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YIYEPKVQ.js";
|
|
9
9
|
import {
|
|
10
10
|
kickoffEnvironmentSetup
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MOLWE2ZY.js";
|
|
12
12
|
import {
|
|
13
13
|
jsonOk,
|
|
14
14
|
routeWrap
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-PFLR7INE.js";
|
|
16
16
|
import {
|
|
17
17
|
getProxiedTenantId,
|
|
18
18
|
isProxied,
|
|
19
19
|
markProxied,
|
|
20
20
|
unmarkProxied
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-NIOWKTIF.js";
|
|
22
22
|
import {
|
|
23
23
|
resolveContainerProvider
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-N2RHTKW7.js";
|
|
25
25
|
import {
|
|
26
26
|
archiveEnvironment,
|
|
27
27
|
createEnvironment,
|
|
@@ -30,11 +30,11 @@ import {
|
|
|
30
30
|
hasSessionsAttached,
|
|
31
31
|
listEnvironments,
|
|
32
32
|
updateEnvironment
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-NUO56TF7.js";
|
|
34
34
|
import {
|
|
35
35
|
getDb,
|
|
36
36
|
init_client
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-5GZEX4HV.js";
|
|
38
38
|
import {
|
|
39
39
|
badRequest,
|
|
40
40
|
conflict,
|
|
@@ -123,7 +123,10 @@ function handleCreateEnvironment(request) {
|
|
|
123
123
|
if (existingEnvs.some((e) => e.name === parsed.data.name)) {
|
|
124
124
|
throw conflict(`Environment with name "${parsed.data.name}" already exists`);
|
|
125
125
|
}
|
|
126
|
-
const providerName = parsed.data.config.provider
|
|
126
|
+
const providerName = parsed.data.config.provider;
|
|
127
|
+
if (!providerName) {
|
|
128
|
+
throw badRequest("config.provider is required \u2014 specify a sandbox provider (e.g. docker, apple-container)");
|
|
129
|
+
}
|
|
127
130
|
const CLOUD_PROVIDERS = /* @__PURE__ */ new Set(["sprites", "e2b", "vercel", "daytona", "fly", "modal", "anthropic"]);
|
|
128
131
|
if (!CLOUD_PROVIDERS.has(providerName)) {
|
|
129
132
|
const provider = await resolveContainerProvider(providerName);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadVaultForCaller
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q3CV35V6.js";
|
|
4
4
|
import {
|
|
5
5
|
jsonOk,
|
|
6
6
|
routeWrap
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PFLR7INE.js";
|
|
8
8
|
import {
|
|
9
9
|
createCredential,
|
|
10
10
|
deleteCredential,
|
|
11
11
|
getCredential,
|
|
12
12
|
listCredentials,
|
|
13
13
|
updateCredential
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-J4TYHQQG.js";
|
|
15
15
|
import {
|
|
16
16
|
badRequest,
|
|
17
17
|
conflict,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
installCodexWrapper
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RMEX55EU.js";
|
|
4
4
|
|
|
5
5
|
// src/backends/codex/setup.ts
|
|
6
6
|
var SENTINEL_NAME = ".claude-agents-codex-installed";
|
|
7
|
-
async function
|
|
8
|
-
await installCodexWrapper(
|
|
7
|
+
async function prepareCodexOnSandbox(sandboxName, provider) {
|
|
8
|
+
await installCodexWrapper(sandboxName, provider);
|
|
9
9
|
const script = [
|
|
10
10
|
"set -euo pipefail",
|
|
11
11
|
`SENTINEL="$HOME/${SENTINEL_NAME}"`,
|
|
@@ -16,7 +16,7 @@ async function prepareCodexOnSprite(spriteName, provider) {
|
|
|
16
16
|
"/usr/local/bin/codex --version || $PREFIX/bin/codex --version",
|
|
17
17
|
'touch "$SENTINEL"'
|
|
18
18
|
].join(" && ");
|
|
19
|
-
const result = await provider.exec(
|
|
19
|
+
const result = await provider.exec(sandboxName, ["bash", "-c", script], {
|
|
20
20
|
timeoutMs: 5 * 6e4
|
|
21
21
|
});
|
|
22
22
|
if (result.exit_code !== 0) {
|
|
@@ -27,5 +27,5 @@ async function prepareCodexOnSprite(spriteName, provider) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export {
|
|
30
|
-
|
|
30
|
+
prepareCodexOnSandbox
|
|
31
31
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listCredentialsWithTokens
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-J4TYHQQG.js";
|
|
4
4
|
import {
|
|
5
5
|
listEntries
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VIGJQU6V.js";
|
|
7
7
|
|
|
8
8
|
// src/sessions/secrets.ts
|
|
9
9
|
function loadSessionSecrets(vaultIds) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildClaudeArgs,
|
|
3
3
|
buildClaudeAuthEnv
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TBSWWUJS.js";
|
|
5
5
|
import {
|
|
6
6
|
PERMISSION_BRIDGE_DIR,
|
|
7
7
|
PERMISSION_HOOK_SCRIPT_PATH,
|
|
@@ -22,10 +22,10 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
CLAUDE_WRAPPER_PATH,
|
|
24
24
|
installClaudeWrapper
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-IU457W7Q.js";
|
|
26
26
|
import {
|
|
27
27
|
getConfig
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-YEUALILD.js";
|
|
29
29
|
|
|
30
30
|
// src/backends/claude/index.ts
|
|
31
31
|
function buildTurn(input) {
|
|
@@ -80,35 +80,35 @@ function validateRuntime() {
|
|
|
80
80
|
}
|
|
81
81
|
return null;
|
|
82
82
|
}
|
|
83
|
-
async function installToolBridge(
|
|
83
|
+
async function installToolBridge(sandboxName, customTools, provider) {
|
|
84
84
|
if (customTools.length === 0) return;
|
|
85
|
-
await provider.exec(
|
|
85
|
+
await provider.exec(sandboxName, ["mkdir", "-p", TOOL_BRIDGE_DIR]);
|
|
86
86
|
await provider.exec(
|
|
87
|
-
|
|
87
|
+
sandboxName,
|
|
88
88
|
["bash", "-c", `cat > ${TOOL_BRIDGE_SCRIPT_PATH}`],
|
|
89
89
|
{ stdin: generateBridgeScript() }
|
|
90
90
|
);
|
|
91
91
|
await provider.exec(
|
|
92
|
-
|
|
92
|
+
sandboxName,
|
|
93
93
|
["bash", "-c", `cat > ${TOOL_BRIDGE_TOOLS_PATH}`],
|
|
94
94
|
{ stdin: toolsToJson(customTools) }
|
|
95
95
|
);
|
|
96
|
-
await provider.exec(
|
|
96
|
+
await provider.exec(sandboxName, ["chmod", "+x", TOOL_BRIDGE_SCRIPT_PATH]);
|
|
97
97
|
}
|
|
98
|
-
async function installPermissionHook(
|
|
99
|
-
await provider.exec(
|
|
98
|
+
async function installPermissionHook(sandboxName, provider) {
|
|
99
|
+
await provider.exec(sandboxName, ["mkdir", "-p", PERMISSION_BRIDGE_DIR]);
|
|
100
100
|
await provider.exec(
|
|
101
|
-
|
|
101
|
+
sandboxName,
|
|
102
102
|
["bash", "-c", `cat > ${PERMISSION_HOOK_SCRIPT_PATH}`],
|
|
103
103
|
{ stdin: generatePermissionHookScript() }
|
|
104
104
|
);
|
|
105
|
-
await provider.exec(
|
|
105
|
+
await provider.exec(sandboxName, ["chmod", "+x", PERMISSION_HOOK_SCRIPT_PATH]);
|
|
106
106
|
const hooksConfig = buildPermissionHooksConfig();
|
|
107
107
|
const settingsPath = "/home/sprite/.claude/settings.json";
|
|
108
108
|
let existingSettings = {};
|
|
109
109
|
try {
|
|
110
110
|
const result = await provider.exec(
|
|
111
|
-
|
|
111
|
+
sandboxName,
|
|
112
112
|
["cat", settingsPath]
|
|
113
113
|
);
|
|
114
114
|
if (result.stdout.trim()) {
|
|
@@ -118,7 +118,7 @@ async function installPermissionHook(spriteName, provider) {
|
|
|
118
118
|
}
|
|
119
119
|
const merged = { ...existingSettings, ...hooksConfig };
|
|
120
120
|
await provider.exec(
|
|
121
|
-
|
|
121
|
+
sandboxName,
|
|
122
122
|
["bash", "-c", `mkdir -p /home/sprite/.claude && cat > ${settingsPath}`],
|
|
123
123
|
{ stdin: JSON.stringify(merged, null, 2) }
|
|
124
124
|
);
|
|
@@ -128,7 +128,7 @@ var claudeBackend = {
|
|
|
128
128
|
wrapperPath: CLAUDE_WRAPPER_PATH,
|
|
129
129
|
buildTurn,
|
|
130
130
|
createTranslator: (opts) => createClaudeTranslator(opts),
|
|
131
|
-
|
|
131
|
+
prepareOnSandbox: (name, provider) => installClaudeWrapper(name, provider),
|
|
132
132
|
validateRuntime
|
|
133
133
|
};
|
|
134
134
|
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
jsonOk,
|
|
10
10
|
routeWrap
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-PFLR7INE.js";
|
|
12
12
|
import {
|
|
13
13
|
snapshotApiMetrics
|
|
14
14
|
} from "./chunk-D2XITRN6.js";
|
|
15
15
|
import {
|
|
16
16
|
getDb,
|
|
17
17
|
init_client
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-5GZEX4HV.js";
|
|
19
19
|
import {
|
|
20
20
|
badRequest
|
|
21
21
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveRemoteSessionId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YGAHGTVZ.js";
|
|
4
4
|
import {
|
|
5
5
|
assertResourceTenant
|
|
6
6
|
} from "./chunk-23UKWXJH.js";
|
|
7
7
|
import {
|
|
8
8
|
forwardToAnthropic
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YIYEPKVQ.js";
|
|
10
10
|
import {
|
|
11
11
|
authenticate
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GCMYVWZ6.js";
|
|
13
13
|
import {
|
|
14
14
|
ensureInitialized
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-K2ITIAVJ.js";
|
|
16
16
|
import {
|
|
17
17
|
getProxiedTenantId,
|
|
18
18
|
isProxied
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-NIOWKTIF.js";
|
|
20
20
|
import {
|
|
21
21
|
subscribe
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-EOFJ2MWJ.js";
|
|
23
23
|
import {
|
|
24
24
|
getSession
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-I5ZA45YL.js";
|
|
26
26
|
import {
|
|
27
27
|
getDb,
|
|
28
28
|
init_client
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-5GZEX4HV.js";
|
|
30
30
|
import {
|
|
31
31
|
notFound,
|
|
32
32
|
toResponse
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
onAfterCommit
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EOFJ2MWJ.js";
|
|
4
4
|
import {
|
|
5
5
|
listEventsByTrace
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-O45IQUWS.js";
|
|
7
7
|
import {
|
|
8
8
|
getSessionRow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-I5ZA45YL.js";
|
|
10
10
|
import {
|
|
11
11
|
getAgent
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JEI7I3EH.js";
|
|
13
13
|
import {
|
|
14
14
|
getConfig
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-YEUALILD.js";
|
|
16
16
|
|
|
17
17
|
// src/observability/otlp.ts
|
|
18
18
|
import { createHash } from "crypto";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BatchError,
|
|
3
3
|
executeBatch
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-S3SKODVV.js";
|
|
5
5
|
import {
|
|
6
6
|
jsonOk,
|
|
7
7
|
routeWrap
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PFLR7INE.js";
|
|
9
9
|
import {
|
|
10
10
|
badRequest
|
|
11
11
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YEUALILD.js";
|
|
4
4
|
import {
|
|
5
5
|
ApiError
|
|
6
6
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -16,7 +16,7 @@ function authHeaders(tokenOverride) {
|
|
|
16
16
|
}
|
|
17
17
|
return { Authorization: `Bearer ${token}` };
|
|
18
18
|
}
|
|
19
|
-
async function startExec(
|
|
19
|
+
async function startExec(sandboxName, opts) {
|
|
20
20
|
const params = new URLSearchParams();
|
|
21
21
|
for (const c of opts.argv) params.append("cmd", c);
|
|
22
22
|
if (opts.stdin != null) params.set("stdin", "true");
|
|
@@ -31,7 +31,7 @@ async function startExec(spriteName, opts) {
|
|
|
31
31
|
else opts.signal.addEventListener("abort", () => localAbort.abort(opts.signal.reason));
|
|
32
32
|
}
|
|
33
33
|
const res = await fetch(
|
|
34
|
-
`${api()}/v1/sprites/${encodeURIComponent(
|
|
34
|
+
`${api()}/v1/sprites/${encodeURIComponent(sandboxName)}/exec?${params.toString()}`,
|
|
35
35
|
{
|
|
36
36
|
method: "POST",
|
|
37
37
|
headers: authHeaders(opts.secrets?.SPRITE_TOKEN),
|
|
@@ -45,12 +45,12 @@ async function startExec(spriteName, opts) {
|
|
|
45
45
|
throw new ApiError(
|
|
46
46
|
502,
|
|
47
47
|
"server_error",
|
|
48
|
-
`
|
|
48
|
+
`sandbox exec failed (${res.status}): ${text.slice(0, 300)}`
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
if (!res.body) {
|
|
52
52
|
clearTimeout(timeoutId);
|
|
53
|
-
throw new ApiError(502, "server_error", "
|
|
53
|
+
throw new ApiError(502, "server_error", "sandbox exec returned no body");
|
|
54
54
|
}
|
|
55
55
|
let exitResolve = () => {
|
|
56
56
|
};
|
|
@@ -9,7 +9,9 @@ function state() {
|
|
|
9
9
|
function register(entry) {
|
|
10
10
|
const s = state();
|
|
11
11
|
const list = s.byEnv.get(entry.envId) ?? [];
|
|
12
|
-
list.
|
|
12
|
+
if (!list.some((e) => e.sessionId === entry.sessionId)) {
|
|
13
|
+
list.push(entry);
|
|
14
|
+
}
|
|
13
15
|
s.byEnv.set(entry.envId, list);
|
|
14
16
|
s.bySession.set(entry.sessionId, entry);
|
|
15
17
|
}
|
|
@@ -32,7 +34,7 @@ function unregister(sessionId) {
|
|
|
32
34
|
}
|
|
33
35
|
return entry;
|
|
34
36
|
}
|
|
35
|
-
function
|
|
37
|
+
function allSessionSandboxes() {
|
|
36
38
|
return Array.from(state().bySession.values());
|
|
37
39
|
}
|
|
38
40
|
|
|
@@ -41,5 +43,5 @@ export {
|
|
|
41
43
|
getBySession,
|
|
42
44
|
countInEnv,
|
|
43
45
|
unregister,
|
|
44
|
-
|
|
46
|
+
allSessionSandboxes
|
|
45
47
|
};
|
|
@@ -3,17 +3,17 @@ import {
|
|
|
3
3
|
appendEventsBatch,
|
|
4
4
|
listEvents,
|
|
5
5
|
rowToManagedEvent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-O45IQUWS.js";
|
|
7
7
|
import {
|
|
8
8
|
getSession
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-I5ZA45YL.js";
|
|
10
10
|
import {
|
|
11
11
|
getAgent
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JEI7I3EH.js";
|
|
13
13
|
import {
|
|
14
14
|
getDb,
|
|
15
15
|
init_client
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5GZEX4HV.js";
|
|
17
17
|
|
|
18
18
|
// src/sessions/bus.ts
|
|
19
19
|
import { EventEmitter } from "events";
|