@agentstep/agent-sdk 0.4.13 → 0.4.15
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 +11 -6
- package/dist/auth/passthrough.js +9 -0
- 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 +13 -13
- 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 +14 -14
- 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 +13 -13
- 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 +14 -14
- package/dist/backends/pi/setup.js +4 -4
- package/dist/backends/pi/wrapper-script.js +1 -1
- package/dist/backends/registry.js +30 -30
- package/dist/{chunk-5GDMWWYD.js → chunk-2BDD6OHG.js} +10 -2
- package/dist/{chunk-7YYEE7XR.js → chunk-2BZ2XKJU.js} +5 -5
- package/dist/{chunk-OHYPVKTP.js → chunk-3LG7DRJL.js} +4 -4
- package/dist/{chunk-ZA4JVJJE.js → chunk-3PLJHZFD.js} +1 -1
- package/dist/{chunk-ME6IR4T6.js → chunk-3W6KEDQE.js} +4 -4
- package/dist/{chunk-PMEF3X3C.js → chunk-46LBKEBE.js} +2 -2
- package/dist/{chunk-XLMHG3KR.js → chunk-5DHH2PGR.js} +50 -47
- package/dist/{chunk-6QDHS2MR.js → chunk-5GIZLWWF.js} +1 -1
- package/dist/{chunk-DZDWNOEY.js → chunk-5GZEX4HV.js} +1 -1
- package/dist/{chunk-V364DYC3.js → chunk-5XF65N7J.js} +1 -1
- package/dist/{chunk-6UXT3RG5.js → chunk-64ZLFLMN.js} +4 -4
- package/dist/{chunk-JMDS2RJJ.js → chunk-66CJ6LMV.js} +1 -1
- package/dist/{chunk-2FWZ247V.js → chunk-6IWTDQJN.js} +9 -4
- package/dist/{chunk-TQHS4W74.js → chunk-6OL43KT2.js} +1 -1
- package/dist/{chunk-JZ5RFO77.js → chunk-7LQN7NVU.js} +5 -5
- package/dist/{chunk-X3U7IVTN.js → chunk-7OAMTB47.js} +2 -2
- package/dist/{chunk-I3AP3LEY.js → chunk-ACKMNK3C.js} +7 -7
- package/dist/{chunk-IJEZAD5O.js → chunk-ADK2TYO4.js} +2 -2
- package/dist/{chunk-CX4VNHL6.js → chunk-AH7DAJU5.js} +74 -32
- package/dist/{chunk-5ZRGJTR3.js → chunk-AM7F65IC.js} +10 -10
- package/dist/{chunk-MXRGQRFX.js → chunk-BMPB7XJH.js} +6 -6
- package/dist/{chunk-V7OXXKAL.js → chunk-BZ6HFTHU.js} +1 -1
- package/dist/{chunk-TSYQ4XKJ.js → chunk-CDCLICKM.js} +2 -2
- package/dist/{chunk-FXLGGDLM.js → chunk-CE45WWNZ.js} +4 -4
- package/dist/{chunk-QKRWCXDU.js → chunk-CGSUJZ56.js} +1 -1
- package/dist/{chunk-3WJMUX5B.js → chunk-DO4WVWW7.js} +1 -1
- package/dist/{chunk-AKRE4OEL.js → chunk-EFOIR7R3.js} +5 -3
- package/dist/{chunk-M4RE42AY.js → chunk-ENOKSV57.js} +3 -3
- package/dist/{chunk-RTS2QUZB.js → chunk-EO5ZTIP7.js} +20 -11
- package/dist/{chunk-3NZQBGUJ.js → chunk-F2SDCOHG.js} +18 -18
- package/dist/{chunk-FB6FOIAY.js → chunk-FB4OSWM2.js} +1 -1
- package/dist/{chunk-2PKJSOXX.js → chunk-FCULDJQO.js} +1 -1
- package/dist/{chunk-Q4XYK6FF.js → chunk-GJBKDPQD.js} +5 -5
- package/dist/{chunk-7TW4LHPM.js → chunk-HECQRMDR.js} +2 -2
- package/dist/{chunk-XLVCC4IB.js → chunk-HWWCVD2R.js} +7 -7
- package/dist/{chunk-MBLMAWSE.js → chunk-I5ZA45YL.js} +7 -7
- 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-WUNJJNOV.js → chunk-JKUR5MIM.js} +4 -4
- package/dist/{chunk-4BYPJFC5.js → chunk-JOAEFGXZ.js} +62 -54
- package/dist/{chunk-NHY4Q6LS.js → chunk-JOZK6G5O.js} +14 -14
- package/dist/{chunk-5A6E4F5D.js → chunk-JSLEB2ED.js} +2 -1
- package/dist/{chunk-3KDZP45U.js → chunk-K7KLJ2UJ.js} +13 -10
- package/dist/{chunk-LP7AQJCU.js → chunk-KGARPQA4.js} +3 -3
- package/dist/{chunk-6A74MTSB.js → chunk-L6CUSDUF.js} +3 -3
- package/dist/{chunk-N5CUDEUJ.js → chunk-LHHBOQUR.js} +2 -2
- package/dist/{chunk-4FHRWC4H.js → chunk-LJF4GWPJ.js} +5 -5
- package/dist/{chunk-RL6XEYOD.js → chunk-MHQXDTJB.js} +1 -1
- package/dist/{chunk-UX6I36QR.js → chunk-NDQ6CQ7B.js} +122 -122
- package/dist/{chunk-7BGILLYC.js → chunk-NIOWKTIF.js} +2 -2
- package/dist/{chunk-KDAZ5TBL.js → chunk-NK2RCTFI.js} +8 -8
- 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-UXZSRUXD.js → chunk-ORU5GQ4Z.js} +2 -2
- package/dist/{chunk-QYFD2OBI.js → chunk-OWTXN2FU.js} +1 -1
- package/dist/{chunk-V4P46OHG.js → chunk-P7P2NWZD.js} +5 -5
- package/dist/{chunk-MAW3HLIO.js → chunk-PB7LR2AG.js} +2 -2
- package/dist/{chunk-KEV4OMRF.js → chunk-PNYCULIF.js} +9 -9
- package/dist/{chunk-VVH5DQ2C.js → chunk-PWWRWR75.js} +42 -3
- package/dist/{chunk-G5RQN53K.js → chunk-PZWVTEL2.js} +1 -1
- package/dist/{chunk-OGONPLTA.js → chunk-QFUJDBET.js} +6 -6
- package/dist/{chunk-Q5KHBU7P.js → chunk-QH57EOKP.js} +12 -4
- package/dist/{chunk-6ZJ6X6H7.js → chunk-QLWA4MJ5.js} +15 -4
- package/dist/{chunk-2QGVGXIT.js → chunk-QQDSHL27.js} +4 -4
- package/dist/{chunk-J4NKW3L5.js → chunk-QYSDP6V5.js} +5 -5
- package/dist/{chunk-ETGRQMFJ.js → chunk-R45W644X.js} +1 -1
- package/dist/{chunk-LPWEFC55.js → chunk-R5OZHLAD.js} +2 -2
- package/dist/{chunk-DFE7VZWD.js → chunk-RMEX55EU.js} +4 -4
- package/dist/{chunk-TY7XTT5N.js → chunk-RZXRMPF4.js} +1 -1
- package/dist/{chunk-D5XOXR3A.js → chunk-S3SKODVV.js} +4 -4
- package/dist/{chunk-CU5GUNFW.js → chunk-S6AM7WVH.js} +2 -2
- package/dist/{chunk-YOFB6CO5.js → chunk-SDLNBA53.js} +7 -7
- package/dist/{chunk-JFY6EH24.js → chunk-SIKTYKVO.js} +15 -15
- package/dist/{chunk-7XFIUYFM.js → chunk-SWIP7JBQ.js} +4 -4
- package/dist/{chunk-XNK2KUTI.js → chunk-SXE7H3VK.js} +2 -2
- package/dist/{chunk-OQWHKEYE.js → chunk-TFK6TCMC.js} +3 -3
- package/dist/{chunk-TV2VE2LX.js → chunk-TWPTR2C2.js} +2 -2
- package/dist/{chunk-3MNDEAPX.js → chunk-UJDAT42X.js} +8 -8
- package/dist/{chunk-UN3LHCWQ.js → chunk-VIGJQU6V.js} +3 -3
- package/dist/{chunk-4INVRCRD.js → chunk-VO7BDPYU.js} +2 -2
- package/dist/{chunk-UVCPCX74.js → chunk-VS7AMAMU.js} +8 -8
- package/dist/chunk-W6WKXFHN.js +39 -0
- package/dist/{chunk-3EGA6TEL.js → chunk-WPEGSLXX.js} +1 -1
- package/dist/{chunk-YM2LYRYY.js → chunk-WRWTK455.js} +3 -3
- package/dist/{chunk-W3M3ME6B.js → chunk-XG4UIGDH.js} +5 -5
- package/dist/{chunk-TH54MJMX.js → chunk-XPKY3Z54.js} +1 -1
- package/dist/{chunk-BM34UHSS.js → chunk-Y27R572J.js} +6 -5
- package/dist/{chunk-6BDLNY5J.js → chunk-Y4X3QY2S.js} +2 -2
- package/dist/{chunk-U4F4JSME.js → chunk-Y6ZY23HE.js} +3 -3
- package/dist/{chunk-KZGAZPNV.js → chunk-YGAHGTVZ.js} +3 -3
- package/dist/{chunk-H74BPBKE.js → chunk-YSUPRYX2.js} +5 -5
- package/dist/{chunk-HERWBOQ7.js → chunk-ZLUBNJEO.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 +47 -47
- 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 +60 -59
- package/dist/handlers/api_keys.js +61 -59
- package/dist/handlers/audit.js +61 -59
- package/dist/handlers/batch.js +61 -59
- package/dist/handlers/credentials.js +61 -59
- package/dist/handlers/environments.js +61 -60
- package/dist/handlers/events.js +64 -63
- package/dist/handlers/files.js +61 -59
- package/dist/handlers/index.js +125 -124
- package/dist/handlers/license.js +60 -58
- package/dist/handlers/memory.js +61 -59
- package/dist/handlers/metrics.js +60 -58
- package/dist/handlers/models.js +61 -59
- package/dist/handlers/openapi.js +3 -3
- package/dist/handlers/providers.js +60 -58
- package/dist/handlers/resources.js +60 -58
- package/dist/handlers/sessions.js +63 -62
- package/dist/handlers/settings.js +60 -58
- package/dist/handlers/skills-write.js +60 -58
- package/dist/handlers/skills.js +61 -59
- package/dist/handlers/stream.js +60 -59
- package/dist/handlers/tenants.js +61 -59
- package/dist/handlers/threads.js +60 -58
- package/dist/handlers/traces.js +61 -59
- package/dist/handlers/ui.js +1 -1
- package/dist/handlers/upstream_keys.js +63 -61
- package/dist/handlers/vaults.js +60 -58
- package/dist/handlers/whoami.js +60 -58
- package/dist/http.js +59 -57
- package/dist/index.js +81 -78
- package/dist/init.js +55 -55
- 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 +48 -48
- package/dist/sessions/grader.js +5 -5
- package/dist/sessions/secrets.js +8 -8
- package/dist/sessions/sweeper.js +44 -44
- package/dist/sessions/threads.js +52 -52
- package/dist/shutdown.js +45 -45
- package/dist/sync/anthropic.js +10 -10
- package/dist/sync/container-file-sync.js +27 -15
- package/dist/sync/file-sync.js +19 -19
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildClaudeArgs,
|
|
3
3
|
buildClaudeAuthEnv
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PZWVTEL2.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-QH57EOKP.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
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// src/backends/opencode/wrapper-script.ts
|
|
2
2
|
var OPENCODE_WRAPPER_PATH = "/tmp/.opencode-wrapper";
|
|
3
|
-
var
|
|
3
|
+
var SANDBOX_WRAPPER_SCRIPT = [
|
|
4
4
|
"#!/bin/bash",
|
|
5
5
|
"set -e",
|
|
6
6
|
'while IFS= read -r line; do [ -z "$line" ] && break; export "$line"; done',
|
|
7
7
|
"PROMPT=$(cat)",
|
|
8
8
|
'exec opencode "$@" "$PROMPT"'
|
|
9
9
|
].join("\n");
|
|
10
|
-
async function installOpencodeWrapper(
|
|
11
|
-
const escaped =
|
|
12
|
-
await provider.exec(
|
|
10
|
+
async function installOpencodeWrapper(sandboxName, provider) {
|
|
11
|
+
const escaped = SANDBOX_WRAPPER_SCRIPT.replace(/'/g, "'\\''");
|
|
12
|
+
await provider.exec(sandboxName, [
|
|
13
13
|
"bash",
|
|
14
14
|
"-c",
|
|
15
15
|
`printf '%s' '${escaped}' > ${OPENCODE_WRAPPER_PATH} && chmod +x ${OPENCODE_WRAPPER_PATH}`
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_schema,
|
|
3
3
|
schema_exports
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LHHBOQUR.js";
|
|
5
5
|
import {
|
|
6
6
|
getDb,
|
|
7
7
|
init_client
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5GZEX4HV.js";
|
|
9
9
|
import {
|
|
10
10
|
__esm
|
|
11
11
|
} from "./chunk-2ESYSVXG.js";
|
|
@@ -3,21 +3,21 @@ import {
|
|
|
3
3
|
} from "./chunk-23UKWXJH.js";
|
|
4
4
|
import {
|
|
5
5
|
recordAudit
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MHQXDTJB.js";
|
|
7
7
|
import {
|
|
8
8
|
requireFeature
|
|
9
9
|
} from "./chunk-2N2KL4KM.js";
|
|
10
10
|
import {
|
|
11
11
|
jsonOk,
|
|
12
12
|
routeWrap
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-6IWTDQJN.js";
|
|
14
14
|
import {
|
|
15
15
|
archiveTenant,
|
|
16
16
|
createTenant,
|
|
17
17
|
getTenant,
|
|
18
18
|
listTenants,
|
|
19
19
|
renameTenant
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-JDELTTHV.js";
|
|
21
21
|
import {
|
|
22
22
|
badRequest,
|
|
23
23
|
notFound
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
prepareFactoryOnSandbox
|
|
3
|
+
} from "./chunk-YSUPRYX2.js";
|
|
1
4
|
import {
|
|
2
5
|
createFactoryTranslator
|
|
3
6
|
} from "./chunk-7TSTCMII.js";
|
|
7
|
+
import {
|
|
8
|
+
FACTORY_WRAPPER_PATH
|
|
9
|
+
} from "./chunk-QQDSHL27.js";
|
|
4
10
|
import {
|
|
5
11
|
wrapPromptWithSystem
|
|
6
12
|
} from "./chunk-DAT55TX2.js";
|
|
@@ -10,13 +16,7 @@ import {
|
|
|
10
16
|
import {
|
|
11
17
|
buildFactoryAuthEnv,
|
|
12
18
|
validateFactoryRuntime
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
prepareFactoryOnSprite
|
|
16
|
-
} from "./chunk-H74BPBKE.js";
|
|
17
|
-
import {
|
|
18
|
-
FACTORY_WRAPPER_PATH
|
|
19
|
-
} from "./chunk-2QGVGXIT.js";
|
|
19
|
+
} from "./chunk-FCULDJQO.js";
|
|
20
20
|
import {
|
|
21
21
|
ApiError
|
|
22
22
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -41,7 +41,7 @@ var factoryBackend = {
|
|
|
41
41
|
wrapperPath: FACTORY_WRAPPER_PATH,
|
|
42
42
|
buildTurn,
|
|
43
43
|
createTranslator: (opts) => createFactoryTranslator(opts),
|
|
44
|
-
|
|
44
|
+
prepareOnSandbox: (name, provider) => prepareFactoryOnSandbox(name, provider),
|
|
45
45
|
validateRuntime: validateFactoryRuntime
|
|
46
46
|
};
|
|
47
47
|
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-AIBH32FN.js";
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_TENANT_ID
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JDELTTHV.js";
|
|
8
8
|
import {
|
|
9
9
|
init_ids,
|
|
10
10
|
newId
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
getDrizzle,
|
|
14
14
|
init_drizzle
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SXE7H3VK.js";
|
|
16
16
|
import {
|
|
17
17
|
schema_exports
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-LHHBOQUR.js";
|
|
19
19
|
import {
|
|
20
20
|
init_clock,
|
|
21
21
|
nowMs,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildPiArgs
|
|
3
|
+
} from "./chunk-T5VRE77P.js";
|
|
1
4
|
import {
|
|
2
5
|
buildPiAuthEnv,
|
|
3
6
|
validatePiRuntime
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-66CJ6LMV.js";
|
|
5
8
|
import {
|
|
6
|
-
|
|
7
|
-
} from "./chunk-
|
|
9
|
+
preparePiOnSandbox
|
|
10
|
+
} from "./chunk-QYSDP6V5.js";
|
|
8
11
|
import {
|
|
9
12
|
createPiTranslator
|
|
10
13
|
} from "./chunk-B6E6BVNK.js";
|
|
11
14
|
import {
|
|
12
15
|
PI_WRAPPER_PATH
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
buildPiArgs
|
|
16
|
-
} from "./chunk-T5VRE77P.js";
|
|
16
|
+
} from "./chunk-JDBXIJKG.js";
|
|
17
17
|
import {
|
|
18
18
|
wrapPromptWithSystem
|
|
19
19
|
} from "./chunk-DAT55TX2.js";
|
|
@@ -41,7 +41,7 @@ var piBackend = {
|
|
|
41
41
|
wrapperPath: PI_WRAPPER_PATH,
|
|
42
42
|
buildTurn,
|
|
43
43
|
createTranslator: (opts) => createPiTranslator(opts),
|
|
44
|
-
|
|
44
|
+
prepareOnSandbox: (name, provider) => preparePiOnSandbox(name, provider),
|
|
45
45
|
validateRuntime: validatePiRuntime
|
|
46
46
|
};
|
|
47
47
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// src/auth/passthrough.ts
|
|
2
|
+
var ANTHROPIC_API_KEY_RE = /^sk-ant-api[A-Za-z0-9_-]{20,}$/;
|
|
3
|
+
function isAnthropicApiKey(key) {
|
|
4
|
+
return ANTHROPIC_API_KEY_RE.test(key);
|
|
5
|
+
}
|
|
6
|
+
var PASSTHROUGH_ROUTE_PATTERNS = [
|
|
7
|
+
// Agents
|
|
8
|
+
/^\/v1\/agents$/,
|
|
9
|
+
/^\/v1\/agents\/[^/]+$/,
|
|
10
|
+
// Sessions + sub-resources
|
|
11
|
+
/^\/v1\/sessions$/,
|
|
12
|
+
/^\/v1\/sessions\/[^/]+$/,
|
|
13
|
+
/^\/v1\/sessions\/[^/]+\/archive$/,
|
|
14
|
+
/^\/v1\/sessions\/[^/]+\/events$/,
|
|
15
|
+
/^\/v1\/sessions\/[^/]+\/events\/stream$/,
|
|
16
|
+
// Vaults + entries + credentials
|
|
17
|
+
/^\/v1\/vaults$/,
|
|
18
|
+
/^\/v1\/vaults\/[^/]+$/,
|
|
19
|
+
/^\/v1\/vaults\/[^/]+\/entries$/,
|
|
20
|
+
/^\/v1\/vaults\/[^/]+\/entries\/[^/]+$/,
|
|
21
|
+
/^\/v1\/vaults\/[^/]+\/credentials$/,
|
|
22
|
+
/^\/v1\/vaults\/[^/]+\/credentials\/[^/]+$/,
|
|
23
|
+
// Environments
|
|
24
|
+
/^\/v1\/environments$/,
|
|
25
|
+
/^\/v1\/environments\/[^/]+$/,
|
|
26
|
+
/^\/v1\/environments\/[^/]+\/archive$/,
|
|
27
|
+
// Files
|
|
28
|
+
/^\/v1\/files$/,
|
|
29
|
+
/^\/v1\/files\/[^/]+$/,
|
|
30
|
+
/^\/v1\/files\/[^/]+\/content$/
|
|
31
|
+
];
|
|
32
|
+
function isPassthroughAllowedPath(pathname) {
|
|
33
|
+
return PASSTHROUGH_ROUTE_PATTERNS.some((re) => re.test(pathname));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
isAnthropicApiKey,
|
|
38
|
+
isPassthroughAllowedPath
|
|
39
|
+
};
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
jsonOk,
|
|
7
7
|
routeWrap
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6IWTDQJN.js";
|
|
9
9
|
import {
|
|
10
10
|
getSession,
|
|
11
11
|
listSessions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-I5ZA45YL.js";
|
|
13
13
|
import {
|
|
14
14
|
getDb,
|
|
15
15
|
init_client
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5GZEX4HV.js";
|
|
17
17
|
import {
|
|
18
18
|
notFound
|
|
19
19
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
installGeminiWrapper
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3W6KEDQE.js";
|
|
4
4
|
|
|
5
5
|
// src/backends/gemini/setup.ts
|
|
6
6
|
var SENTINEL_NAME = ".claude-agents-gemini-installed";
|
|
7
|
-
async function
|
|
8
|
-
await installGeminiWrapper(
|
|
7
|
+
async function prepareGeminiOnSandbox(sandboxName, provider) {
|
|
8
|
+
await installGeminiWrapper(sandboxName, provider);
|
|
9
9
|
const script = [
|
|
10
10
|
"set -euo pipefail",
|
|
11
11
|
`SENTINEL="$HOME/${SENTINEL_NAME}"`,
|
|
@@ -16,7 +16,7 @@ async function prepareGeminiOnSprite(spriteName, provider) {
|
|
|
16
16
|
"/usr/local/bin/gemini --version || $PREFIX/bin/gemini --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 prepareGeminiOnSprite(spriteName, provider) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export {
|
|
30
|
-
|
|
30
|
+
prepareGeminiOnSandbox
|
|
31
31
|
};
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
VaultListResponseSchema,
|
|
84
84
|
VaultSchema,
|
|
85
85
|
WhoamiResponseSchema
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-OWTXN2FU.js";
|
|
87
87
|
import {
|
|
88
88
|
registry
|
|
89
89
|
} from "./chunk-7346CKTF.js";
|
|
@@ -94,7 +94,8 @@ import { OpenApiGeneratorV31 } from "@asteasolutions/zod-to-openapi";
|
|
|
94
94
|
registry.registerComponent("securitySchemes", "ApiKey", {
|
|
95
95
|
type: "apiKey",
|
|
96
96
|
in: "header",
|
|
97
|
-
name: "x-api-key"
|
|
97
|
+
name: "x-api-key",
|
|
98
|
+
description: "Gateway-issued API key (`ck_*`). When passthrough is enabled, `sk-ant-api*` keys are also accepted on Anthropic-mirror routes and forwarded transparently to api.anthropic.com."
|
|
98
99
|
});
|
|
99
100
|
var ErrorResponses = {
|
|
100
101
|
400: { description: "Bad request", content: { "application/json": { schema: ErrorEnvelopeSchema } } },
|
|
@@ -327,7 +328,7 @@ registry.registerPath({
|
|
|
327
328
|
path: "/v1/sessions",
|
|
328
329
|
tags: ["Sessions"],
|
|
329
330
|
summary: "Create a session",
|
|
330
|
-
description: "Creates a session idle and pinned to the specified agent version + environment. A
|
|
331
|
+
description: "Creates a session idle and pinned to the specified agent version + environment. A sandbox is NOT allocated until the first user.message event.",
|
|
331
332
|
security: [{ ApiKey: [] }],
|
|
332
333
|
request: {
|
|
333
334
|
body: {
|
|
@@ -414,7 +415,7 @@ registry.registerPath({
|
|
|
414
415
|
path: "/v1/sessions/{id}",
|
|
415
416
|
tags: ["Sessions"],
|
|
416
417
|
summary: "Delete (terminate) a session",
|
|
417
|
-
description: 'Interrupts any in-flight turn, releases the
|
|
418
|
+
description: 'Interrupts any in-flight turn, releases the sandbox, and flips the session to `terminated` with `stop_reason:"deleted"`.',
|
|
418
419
|
security: [{ ApiKey: [] }],
|
|
419
420
|
request: { params: z.object({ id: z.string() }) },
|
|
420
421
|
responses: {
|
|
@@ -1777,7 +1778,7 @@ function buildOpenApiDocument(opts) {
|
|
|
1777
1778
|
openapi: "3.1.0",
|
|
1778
1779
|
info: {
|
|
1779
1780
|
title: "AgentStep Gateway",
|
|
1780
|
-
version: "0.4.
|
|
1781
|
+
version: "0.4.15",
|
|
1781
1782
|
description: "Open-source, drop-in replacement for the Claude Managed Agents API. Self-hosted agent gateway with 7 agent harnesses and 11 sandbox providers. Use with `@agentstep/agent-sdk` or the official Anthropic SDK \u2014 just change the baseURL."
|
|
1782
1783
|
},
|
|
1783
1784
|
servers: [{ url: opts.serverUrl, description: "This host" }],
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
getSources,
|
|
5
5
|
getStats,
|
|
6
6
|
searchSkills
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FB4OSWM2.js";
|
|
8
8
|
import {
|
|
9
9
|
jsonOk,
|
|
10
10
|
routeWrap
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6IWTDQJN.js";
|
|
12
12
|
|
|
13
13
|
// src/handlers/skills.ts
|
|
14
14
|
async function handleGetSkillsCatalog(request) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadVaultForCaller
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JKUR5MIM.js";
|
|
4
4
|
import {
|
|
5
5
|
jsonOk,
|
|
6
6
|
routeWrap
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6IWTDQJN.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,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDrizzle,
|
|
3
3
|
init_drizzle
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SXE7H3VK.js";
|
|
5
5
|
import {
|
|
6
6
|
schema_exports
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LHHBOQUR.js";
|
|
8
8
|
import {
|
|
9
9
|
init_clock,
|
|
10
10
|
nowMs
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
getDb,
|
|
14
14
|
init_client
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5GZEX4HV.js";
|
|
16
16
|
|
|
17
17
|
// src/db/sync.ts
|
|
18
18
|
init_drizzle();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
installFactoryWrapper
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QQDSHL27.js";
|
|
4
4
|
|
|
5
5
|
// src/backends/factory/setup.ts
|
|
6
6
|
var SENTINEL_NAME = ".claude-agents-factory-installed";
|
|
7
|
-
async function
|
|
8
|
-
await installFactoryWrapper(
|
|
7
|
+
async function prepareFactoryOnSandbox(sandboxName, provider) {
|
|
8
|
+
await installFactoryWrapper(sandboxName, provider);
|
|
9
9
|
const script = [
|
|
10
10
|
"set -euo pipefail",
|
|
11
11
|
`SENTINEL="$HOME/${SENTINEL_NAME}"`,
|
|
@@ -16,7 +16,7 @@ async function prepareFactoryOnSprite(spriteName, provider) {
|
|
|
16
16
|
"/usr/local/bin/droid --version || $PREFIX/bin/droid --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 prepareFactoryOnSprite(spriteName, provider) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export {
|
|
30
|
-
|
|
30
|
+
prepareFactoryOnSandbox
|
|
31
31
|
};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-23UKWXJH.js";
|
|
7
7
|
import {
|
|
8
8
|
recordAudit
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MHQXDTJB.js";
|
|
10
10
|
import {
|
|
11
11
|
COMMUNITY_LIMITS,
|
|
12
12
|
hasFeature,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
jsonOk,
|
|
17
17
|
routeWrap
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-6IWTDQJN.js";
|
|
19
19
|
import {
|
|
20
20
|
createApiKey,
|
|
21
21
|
getApiKeyById,
|
|
@@ -23,14 +23,14 @@ import {
|
|
|
23
23
|
listApiKeys,
|
|
24
24
|
revokeApiKey,
|
|
25
25
|
updateApiKeyPermissions
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-ADK2TYO4.js";
|
|
27
27
|
import {
|
|
28
28
|
listSessionsByApiKey
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-I5ZA45YL.js";
|
|
30
30
|
import {
|
|
31
31
|
getDb,
|
|
32
32
|
init_client
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-5GZEX4HV.js";
|
|
34
34
|
import {
|
|
35
35
|
badRequest,
|
|
36
36
|
forbidden,
|
|
@@ -2,19 +2,19 @@ import {
|
|
|
2
2
|
getSyncRow,
|
|
3
3
|
getSyncedRemoteId,
|
|
4
4
|
upsertSync
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YGAHGTVZ.js";
|
|
6
6
|
import {
|
|
7
7
|
injectMcpAuthHeaders
|
|
8
8
|
} from "./chunk-SV2B3P6B.js";
|
|
9
9
|
import {
|
|
10
10
|
listEntries
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VIGJQU6V.js";
|
|
12
12
|
import {
|
|
13
13
|
getEnvironment
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NUO56TF7.js";
|
|
15
15
|
import {
|
|
16
16
|
getAgent
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-JEI7I3EH.js";
|
|
18
18
|
|
|
19
19
|
// src/sync/anthropic.ts
|
|
20
20
|
import { createHash } from "crypto";
|
package/dist/config/index.js
CHANGED
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
readSetting,
|
|
6
6
|
writeSetting,
|
|
7
7
|
writeTokenSetting
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-QH57EOKP.js";
|
|
9
|
+
import "../chunk-SXE7H3VK.js";
|
|
10
|
+
import "../chunk-LHHBOQUR.js";
|
|
11
11
|
import "../chunk-HFDLUBWN.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-5GZEX4HV.js";
|
|
13
|
+
import "../chunk-2BDD6OHG.js";
|
|
14
14
|
import "../chunk-2ESYSVXG.js";
|
|
15
15
|
export {
|
|
16
16
|
getConfig,
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
killExecSession,
|
|
8
8
|
listSprites,
|
|
9
9
|
restoreCheckpoint
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-XPKY3Z54.js";
|
|
11
|
+
import "../chunk-QH57EOKP.js";
|
|
12
|
+
import "../chunk-SXE7H3VK.js";
|
|
13
|
+
import "../chunk-LHHBOQUR.js";
|
|
14
14
|
import "../chunk-HFDLUBWN.js";
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-5GZEX4HV.js";
|
|
16
|
+
import "../chunk-2BDD6OHG.js";
|
|
17
17
|
import "../chunk-EZYKRG4W.js";
|
|
18
18
|
import "../chunk-2ESYSVXG.js";
|
|
19
19
|
export {
|
package/dist/containers/exec.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
startExec
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-LJF4GWPJ.js";
|
|
4
|
+
import "../chunk-QH57EOKP.js";
|
|
5
|
+
import "../chunk-SXE7H3VK.js";
|
|
6
|
+
import "../chunk-LHHBOQUR.js";
|
|
7
7
|
import "../chunk-HFDLUBWN.js";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-5GZEX4HV.js";
|
|
9
|
+
import "../chunk-2BDD6OHG.js";
|
|
10
10
|
import "../chunk-EZYKRG4W.js";
|
|
11
11
|
import "../chunk-2ESYSVXG.js";
|
|
12
12
|
export {
|