@agentstep/agent-sdk 0.4.14 → 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 +6 -1
- package/dist/auth/passthrough.js +9 -0
- package/dist/backends/claude/args.js +2 -2
- package/dist/backends/claude/index.js +3 -3
- package/dist/backends/codex/auth.js +2 -2
- package/dist/backends/codex/index.js +5 -5
- package/dist/backends/factory/auth.js +2 -2
- package/dist/backends/factory/index.js +9 -9
- package/dist/backends/gemini/auth.js +2 -2
- package/dist/backends/gemini/index.js +6 -6
- package/dist/backends/opencode/auth.js +2 -2
- package/dist/backends/opencode/index.js +3 -3
- package/dist/backends/pi/auth.js +2 -2
- package/dist/backends/pi/index.js +6 -6
- package/dist/backends/registry.js +18 -18
- package/dist/{chunk-24NL6GPL.js → chunk-2BZ2XKJU.js} +1 -1
- package/dist/{chunk-GSODOHNB.js → chunk-3LG7DRJL.js} +1 -1
- package/dist/{chunk-HOPCVGWL.js → chunk-3PLJHZFD.js} +1 -1
- package/dist/{chunk-B47IDF63.js → chunk-46LBKEBE.js} +1 -1
- package/dist/{chunk-R7PAZ5OA.js → chunk-5DHH2PGR.js} +19 -19
- package/dist/{chunk-LUQP36Y3.js → chunk-5GIZLWWF.js} +1 -1
- package/dist/{chunk-UVUSSZ74.js → chunk-5XF65N7J.js} +1 -1
- package/dist/{chunk-MRJMXGCG.js → chunk-64ZLFLMN.js} +2 -2
- package/dist/{chunk-SS2EEKNM.js → chunk-66CJ6LMV.js} +1 -1
- package/dist/{chunk-PFLR7INE.js → chunk-6IWTDQJN.js} +9 -4
- package/dist/{chunk-GGYTAWW6.js → chunk-6OL43KT2.js} +1 -1
- package/dist/{chunk-CDK25PRU.js → chunk-ACKMNK3C.js} +5 -5
- package/dist/{chunk-K2ITIAVJ.js → chunk-AH7DAJU5.js} +13 -13
- package/dist/{chunk-SNZ4PDVT.js → chunk-AM7F65IC.js} +7 -7
- package/dist/{chunk-CSNIN5YZ.js → chunk-CDCLICKM.js} +1 -1
- package/dist/{chunk-MFEOQ26S.js → chunk-CE45WWNZ.js} +2 -2
- package/dist/{chunk-M674W5NT.js → chunk-CGSUJZ56.js} +1 -1
- package/dist/{chunk-PGSOOOB4.js → chunk-ENOKSV57.js} +3 -3
- package/dist/{chunk-B6LPLXPB.js → chunk-EO5ZTIP7.js} +16 -7
- package/dist/{chunk-GHDY4DVK.js → chunk-F2SDCOHG.js} +12 -12
- package/dist/{chunk-PCKFMALU.js → chunk-FB4OSWM2.js} +1 -1
- package/dist/{chunk-PTGANYUM.js → chunk-FCULDJQO.js} +1 -1
- package/dist/{chunk-HE7EOIPA.js → chunk-GJBKDPQD.js} +1 -1
- package/dist/{chunk-X37MWWUA.js → chunk-HECQRMDR.js} +1 -1
- package/dist/{chunk-374KGHBM.js → chunk-HWWCVD2R.js} +4 -4
- package/dist/{chunk-Q3CV35V6.js → chunk-JKUR5MIM.js} +1 -1
- package/dist/{chunk-UF25F3MH.js → chunk-JOAEFGXZ.js} +13 -13
- package/dist/{chunk-F7DOI3B5.js → chunk-JOZK6G5O.js} +7 -7
- package/dist/{chunk-6QQKTF55.js → chunk-K7KLJ2UJ.js} +6 -6
- package/dist/{chunk-4MHPOB7A.js → chunk-KGARPQA4.js} +1 -1
- package/dist/{chunk-QICG4KW4.js → chunk-L6CUSDUF.js} +1 -1
- package/dist/{chunk-EDRLRJNT.js → chunk-LJF4GWPJ.js} +1 -1
- package/dist/{chunk-LDKZ2SMC.js → chunk-NDQ6CQ7B.js} +45 -45
- package/dist/{chunk-G37JVAOI.js → chunk-NK2RCTFI.js} +4 -4
- package/dist/{chunk-MEEY7BYC.js → chunk-ORU5GQ4Z.js} +1 -1
- package/dist/{chunk-6NZPNYHA.js → chunk-PB7LR2AG.js} +2 -2
- package/dist/{chunk-HIDFQDFP.js → chunk-PNYCULIF.js} +3 -3
- package/dist/{chunk-GCMYVWZ6.js → chunk-PWWRWR75.js} +41 -2
- package/dist/{chunk-TBSWWUJS.js → chunk-PZWVTEL2.js} +1 -1
- package/dist/{chunk-SHKBQQ7W.js → chunk-QFUJDBET.js} +6 -6
- package/dist/{chunk-YEUALILD.js → chunk-QH57EOKP.js} +9 -1
- package/dist/{chunk-YIYEPKVQ.js → chunk-QLWA4MJ5.js} +15 -4
- package/dist/{chunk-M5QX5E5Z.js → chunk-R45W644X.js} +1 -1
- package/dist/{chunk-TJA3RHWR.js → chunk-RZXRMPF4.js} +1 -1
- package/dist/{chunk-R6X47I23.js → chunk-S6AM7WVH.js} +1 -1
- package/dist/{chunk-MOLWE2ZY.js → chunk-SDLNBA53.js} +1 -1
- package/dist/{chunk-A7MX6RSQ.js → chunk-SIKTYKVO.js} +2 -2
- package/dist/{chunk-GAFFXICQ.js → chunk-TFK6TCMC.js} +1 -1
- package/dist/{chunk-F6M4RLDQ.js → chunk-TWPTR2C2.js} +1 -1
- package/dist/{chunk-HR5YA24J.js → chunk-UJDAT42X.js} +7 -7
- package/dist/{chunk-42O6EBUN.js → chunk-VO7BDPYU.js} +2 -2
- package/dist/{chunk-GR4QPRB7.js → chunk-VS7AMAMU.js} +4 -4
- package/dist/chunk-W6WKXFHN.js +39 -0
- package/dist/{chunk-QSYXHYQU.js → chunk-WPEGSLXX.js} +1 -1
- package/dist/{chunk-NCUIEBQY.js → chunk-WRWTK455.js} +1 -1
- package/dist/{chunk-IEG5LIX7.js → chunk-XPKY3Z54.js} +1 -1
- package/dist/{chunk-YJPQFLY3.js → chunk-Y27R572J.js} +3 -2
- package/dist/{chunk-FVFMYO5W.js → chunk-Y4X3QY2S.js} +2 -2
- package/dist/{chunk-7GPKEOAO.js → chunk-Y6ZY23HE.js} +2 -2
- package/dist/{chunk-V7WEALLX.js → chunk-ZLUBNJEO.js} +1 -1
- package/dist/config/index.js +1 -1
- package/dist/containers/client.js +2 -2
- package/dist/containers/exec.js +2 -2
- package/dist/containers/lifecycle.js +24 -24
- package/dist/containers/setup.js +2 -2
- package/dist/handlers/agents.js +37 -36
- package/dist/handlers/api_keys.js +37 -35
- package/dist/handlers/audit.js +37 -35
- package/dist/handlers/batch.js +37 -35
- package/dist/handlers/credentials.js +38 -36
- package/dist/handlers/environments.js +38 -37
- package/dist/handlers/events.js +39 -38
- package/dist/handlers/files.js +37 -35
- package/dist/handlers/index.js +95 -94
- package/dist/handlers/license.js +37 -35
- package/dist/handlers/memory.js +37 -35
- package/dist/handlers/metrics.js +37 -35
- package/dist/handlers/models.js +38 -36
- package/dist/handlers/openapi.js +2 -2
- package/dist/handlers/providers.js +37 -35
- package/dist/handlers/resources.js +37 -35
- package/dist/handlers/sessions.js +38 -37
- package/dist/handlers/settings.js +37 -35
- package/dist/handlers/skills-write.js +37 -35
- package/dist/handlers/skills.js +38 -36
- package/dist/handlers/stream.js +36 -35
- package/dist/handlers/tenants.js +37 -35
- package/dist/handlers/threads.js +37 -35
- package/dist/handlers/traces.js +37 -35
- package/dist/handlers/ui.js +1 -1
- package/dist/handlers/upstream_keys.js +38 -36
- package/dist/handlers/vaults.js +37 -35
- package/dist/handlers/whoami.js +37 -35
- package/dist/http.js +36 -34
- package/dist/index.js +55 -52
- package/dist/init.js +32 -32
- package/dist/lib/model-registry.js +2 -2
- package/dist/lib/skills-cache.js +2 -2
- package/dist/observability/otlp.js +4 -4
- package/dist/observability/redactor.js +2 -2
- package/dist/openapi/spec.js +1 -1
- package/dist/providers/fly.js +1 -1
- package/dist/providers/modal.js +1 -1
- package/dist/providers/registry.js +1 -1
- package/dist/providers/sprites.js +3 -3
- package/dist/providers/upstream-keys.js +4 -4
- package/dist/providers/vercel.js +1 -1
- package/dist/proxy/forward.js +2 -2
- package/dist/queue/index.js +2 -2
- package/dist/sessions/bus.js +2 -2
- package/dist/sessions/driver.js +26 -26
- package/dist/sessions/grader.js +1 -1
- package/dist/sessions/sweeper.js +25 -25
- package/dist/sessions/threads.js +30 -30
- package/dist/shutdown.js +26 -26
- package/dist/sync/file-sync.js +7 -7
- package/package.json +1 -1
- package/dist/{chunk-EOFJ2MWJ.js → chunk-BMPB7XJH.js} +3 -3
- /package/dist/{chunk-N2RHTKW7.js → chunk-JSLEB2ED.js} +0 -0
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildCodexAuthEnv,
|
|
3
|
+
validateCodexRuntime
|
|
4
|
+
} from "./chunk-5XF65N7J.js";
|
|
1
5
|
import {
|
|
2
6
|
prepareCodexOnSandbox
|
|
3
7
|
} from "./chunk-7LQN7NVU.js";
|
|
@@ -13,10 +17,6 @@ import {
|
|
|
13
17
|
import {
|
|
14
18
|
buildCodexArgs
|
|
15
19
|
} from "./chunk-NQX7WBA4.js";
|
|
16
|
-
import {
|
|
17
|
-
buildCodexAuthEnv,
|
|
18
|
-
validateCodexRuntime
|
|
19
|
-
} from "./chunk-UVUSSZ74.js";
|
|
20
20
|
import {
|
|
21
21
|
ApiError
|
|
22
22
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
jsonOk,
|
|
3
3
|
routeWrap
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6IWTDQJN.js";
|
|
5
5
|
import {
|
|
6
6
|
readSetting,
|
|
7
7
|
writeSetting
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QH57EOKP.js";
|
|
9
9
|
import {
|
|
10
10
|
badRequest
|
|
11
11
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
reconcileDockerOrphanSandboxes,
|
|
7
7
|
reconcileOrphanSandboxes,
|
|
8
8
|
releaseSession
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JOAEFGXZ.js";
|
|
10
10
|
import {
|
|
11
11
|
appendEvent,
|
|
12
12
|
dropEmitter
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BMPB7XJH.js";
|
|
14
14
|
import {
|
|
15
15
|
archiveSession,
|
|
16
16
|
getSessionRow,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./chunk-I5ZA45YL.js";
|
|
20
20
|
import {
|
|
21
21
|
getConfig
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-QH57EOKP.js";
|
|
23
23
|
import {
|
|
24
24
|
init_clock,
|
|
25
25
|
nowMs
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
forwardToAnthropic
|
|
3
|
+
} from "./chunk-QLWA4MJ5.js";
|
|
4
|
+
import {
|
|
5
|
+
isAnthropicApiKey,
|
|
6
|
+
isPassthroughAllowedPath
|
|
7
|
+
} from "./chunk-W6WKXFHN.js";
|
|
1
8
|
import {
|
|
2
9
|
findByRawKey,
|
|
3
10
|
hydratePermissions
|
|
4
11
|
} from "./chunk-ADK2TYO4.js";
|
|
12
|
+
import {
|
|
13
|
+
getConfig
|
|
14
|
+
} from "./chunk-QH57EOKP.js";
|
|
5
15
|
import {
|
|
6
16
|
unauthorized
|
|
7
17
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -19,6 +29,21 @@ async function authenticate(request) {
|
|
|
19
29
|
const key = extractKey(request);
|
|
20
30
|
if (!key) throw unauthorized();
|
|
21
31
|
const row = findByRawKey(key);
|
|
32
|
+
if (isAnthropicApiKey(key)) {
|
|
33
|
+
if (!getConfig().anthropicPassthroughEnabled) throw unauthorized();
|
|
34
|
+
return {
|
|
35
|
+
keyId: "passthrough",
|
|
36
|
+
name: "anthropic-passthrough",
|
|
37
|
+
permissions: { admin: false, scope: null },
|
|
38
|
+
tenantId: null,
|
|
39
|
+
isGlobalAdmin: false,
|
|
40
|
+
budgetUsd: null,
|
|
41
|
+
rateLimitRpm: null,
|
|
42
|
+
spentUsd: 0,
|
|
43
|
+
mode: "passthrough",
|
|
44
|
+
passthroughKey: key
|
|
45
|
+
};
|
|
46
|
+
}
|
|
22
47
|
if (!row) throw unauthorized();
|
|
23
48
|
const permissions = hydratePermissions(row.permissions_json);
|
|
24
49
|
return {
|
|
@@ -34,11 +59,25 @@ async function authenticate(request) {
|
|
|
34
59
|
isGlobalAdmin: row.tenant_id === null && permissions.admin,
|
|
35
60
|
budgetUsd: row.budget_usd ?? null,
|
|
36
61
|
rateLimitRpm: row.rate_limit_rpm ?? null,
|
|
37
|
-
spentUsd: row.spent_usd ?? 0
|
|
62
|
+
spentUsd: row.spent_usd ?? 0,
|
|
63
|
+
mode: "gateway"
|
|
38
64
|
};
|
|
39
65
|
}
|
|
66
|
+
async function authenticateAndIntercept(request) {
|
|
67
|
+
const auth = await authenticate(request);
|
|
68
|
+
if (auth.mode !== "passthrough") return { kind: "auth", auth };
|
|
69
|
+
const url = new URL(request.url);
|
|
70
|
+
if (!isPassthroughAllowedPath(url.pathname)) {
|
|
71
|
+
throw unauthorized();
|
|
72
|
+
}
|
|
73
|
+
const response = await forwardToAnthropic(request, url.pathname, {
|
|
74
|
+
apiKey: auth.passthroughKey
|
|
75
|
+
});
|
|
76
|
+
return { kind: "response", response };
|
|
77
|
+
}
|
|
40
78
|
|
|
41
79
|
export {
|
|
42
80
|
extractKey,
|
|
43
|
-
authenticate
|
|
81
|
+
authenticate,
|
|
82
|
+
authenticateAndIntercept
|
|
44
83
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
piBackend
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VS7AMAMU.js";
|
|
4
4
|
import {
|
|
5
5
|
opencodeBackend
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GJBKDPQD.js";
|
|
7
7
|
import {
|
|
8
8
|
geminiBackend
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HWWCVD2R.js";
|
|
10
10
|
import {
|
|
11
11
|
codexBackend
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NK2RCTFI.js";
|
|
13
13
|
import {
|
|
14
14
|
factoryBackend
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UJDAT42X.js";
|
|
16
16
|
import {
|
|
17
17
|
claudeBackend
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-SIKTYKVO.js";
|
|
19
19
|
|
|
20
20
|
// src/backends/registry.ts
|
|
21
21
|
var BACKENDS = {
|
|
@@ -50,9 +50,17 @@ function loadConfig() {
|
|
|
50
50
|
otlpEndpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT || process.env.OTLP_ENDPOINT || readSetting("otlp_endpoint") || void 0,
|
|
51
51
|
otlpAuthorization: process.env.OTEL_EXPORTER_OTLP_HEADERS_AUTHORIZATION || process.env.OTLP_AUTHORIZATION || readSetting("otlp_authorization") || void 0,
|
|
52
52
|
redactEnvKeys: (process.env.OBS_REDACT_KEYS || readSetting("obs_redact_keys") || "").split(",").map((s) => s.trim()).filter(Boolean),
|
|
53
|
-
ollamaUrl: process.env.OLLAMA_URL || readSetting("ollama_url") || "http://localhost:11434"
|
|
53
|
+
ollamaUrl: process.env.OLLAMA_URL || readSetting("ollama_url") || "http://localhost:11434",
|
|
54
|
+
anthropicPassthroughEnabled: parseBool(
|
|
55
|
+
process.env.ANTHROPIC_PASSTHROUGH_ENABLED ?? readSetting("anthropic_passthrough_enabled")
|
|
56
|
+
)
|
|
54
57
|
};
|
|
55
58
|
}
|
|
59
|
+
function parseBool(v) {
|
|
60
|
+
if (!v) return false;
|
|
61
|
+
const s = v.toLowerCase();
|
|
62
|
+
return s === "1" || s === "true" || s === "yes";
|
|
63
|
+
}
|
|
56
64
|
function getConfig() {
|
|
57
65
|
const now = nowMs();
|
|
58
66
|
if (g.__caConfigCache && now - g.__caConfigCache.at < CACHE_MS) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QH57EOKP.js";
|
|
4
4
|
import {
|
|
5
5
|
ApiError
|
|
6
6
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -34,16 +34,27 @@ async function forwardToAnthropic(request, path, opts) {
|
|
|
34
34
|
if (idem) headers.set("idempotency-key", idem);
|
|
35
35
|
const accept = request.headers.get("accept");
|
|
36
36
|
if (accept) headers.set("accept", accept);
|
|
37
|
+
const isMultipart = (ct ?? "").toLowerCase().startsWith("multipart/");
|
|
37
38
|
let body;
|
|
38
39
|
if (request.method !== "GET" && request.method !== "HEAD") {
|
|
39
|
-
|
|
40
|
+
if (opts?.body !== void 0) {
|
|
41
|
+
body = opts.body;
|
|
42
|
+
} else if (isMultipart && request.body) {
|
|
43
|
+
body = request.body;
|
|
44
|
+
} else {
|
|
45
|
+
body = await request.text();
|
|
46
|
+
}
|
|
40
47
|
}
|
|
41
|
-
const
|
|
48
|
+
const fetchInit = {
|
|
42
49
|
method: request.method,
|
|
43
50
|
headers,
|
|
44
51
|
body,
|
|
45
52
|
signal: request.signal
|
|
46
|
-
}
|
|
53
|
+
};
|
|
54
|
+
if (body && typeof body !== "string") {
|
|
55
|
+
fetchInit.duplex = "half";
|
|
56
|
+
}
|
|
57
|
+
const res = await fetch(url.toString(), fetchInit);
|
|
47
58
|
const HOP_BY_HOP = /* @__PURE__ */ new Set([
|
|
48
59
|
"connection",
|
|
49
60
|
"keep-alive",
|
|
@@ -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,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
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) {
|
|
@@ -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
|
-
prepareFactoryOnSandbox
|
|
16
|
-
} from "./chunk-YSUPRYX2.js";
|
|
17
|
-
import {
|
|
18
|
-
FACTORY_WRAPPER_PATH
|
|
19
|
-
} from "./chunk-QQDSHL27.js";
|
|
19
|
+
} from "./chunk-FCULDJQO.js";
|
|
20
20
|
import {
|
|
21
21
|
ApiError
|
|
22
22
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -1,7 +1,10 @@
|
|
|
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
9
|
preparePiOnSandbox
|
|
7
10
|
} from "./chunk-QYSDP6V5.js";
|
|
@@ -11,9 +14,6 @@ import {
|
|
|
11
14
|
import {
|
|
12
15
|
PI_WRAPPER_PATH
|
|
13
16
|
} from "./chunk-JDBXIJKG.js";
|
|
14
|
-
import {
|
|
15
|
-
buildPiArgs
|
|
16
|
-
} from "./chunk-T5VRE77P.js";
|
|
17
17
|
import {
|
|
18
18
|
wrapPromptWithSystem
|
|
19
19
|
} from "./chunk-DAT55TX2.js";
|
|
@@ -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
|
+
};
|
|
@@ -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 } } },
|
|
@@ -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) {
|
package/dist/config/index.js
CHANGED
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
killExecSession,
|
|
8
8
|
listSprites,
|
|
9
9
|
restoreCheckpoint
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-XPKY3Z54.js";
|
|
11
|
+
import "../chunk-QH57EOKP.js";
|
|
12
12
|
import "../chunk-SXE7H3VK.js";
|
|
13
13
|
import "../chunk-LHHBOQUR.js";
|
|
14
14
|
import "../chunk-HFDLUBWN.js";
|
package/dist/containers/exec.js
CHANGED
|
@@ -5,67 +5,67 @@ import {
|
|
|
5
5
|
reconcileDockerOrphanSandboxes,
|
|
6
6
|
reconcileOrphanSandboxes,
|
|
7
7
|
releaseSession
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-JOAEFGXZ.js";
|
|
9
9
|
import "../chunk-DO4WVWW7.js";
|
|
10
10
|
import "../chunk-RMZRSYIJ.js";
|
|
11
11
|
import "../chunk-5ZFOKZGR.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-BMPB7XJH.js";
|
|
13
13
|
import "../chunk-VIGJQU6V.js";
|
|
14
|
+
import "../chunk-I5ZA45YL.js";
|
|
15
|
+
import "../chunk-R5OZHLAD.js";
|
|
14
16
|
import "../chunk-AIBH32FN.js";
|
|
15
17
|
import "../chunk-YPXI7Q2M.js";
|
|
16
18
|
import "../chunk-O45IQUWS.js";
|
|
19
|
+
import "../chunk-XPKY3Z54.js";
|
|
17
20
|
import "../chunk-EFOIR7R3.js";
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-I5ZA45YL.js";
|
|
20
|
-
import "../chunk-R5OZHLAD.js";
|
|
21
|
+
import "../chunk-JSLEB2ED.js";
|
|
21
22
|
import "../chunk-NUO56TF7.js";
|
|
22
23
|
import "../chunk-JEI7I3EH.js";
|
|
23
24
|
import "../chunk-JDELTTHV.js";
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-QFUJDBET.js";
|
|
26
|
+
import "../chunk-VS7AMAMU.js";
|
|
27
|
+
import "../chunk-T5VRE77P.js";
|
|
28
|
+
import "../chunk-66CJ6LMV.js";
|
|
27
29
|
import "../chunk-QYSDP6V5.js";
|
|
28
30
|
import "../chunk-B6E6BVNK.js";
|
|
29
31
|
import "../chunk-JDBXIJKG.js";
|
|
30
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-GJBKDPQD.js";
|
|
31
33
|
import "../chunk-K4E66KY5.js";
|
|
32
|
-
import "../chunk-
|
|
34
|
+
import "../chunk-3PLJHZFD.js";
|
|
33
35
|
import "../chunk-Z25I7DRV.js";
|
|
34
36
|
import "../chunk-P7P2NWZD.js";
|
|
35
37
|
import "../chunk-ETWGCBIQ.js";
|
|
36
38
|
import "../chunk-SWIP7JBQ.js";
|
|
37
|
-
import "../chunk-
|
|
38
|
-
import "../chunk-374KGHBM.js";
|
|
39
|
+
import "../chunk-HWWCVD2R.js";
|
|
39
40
|
import "../chunk-JHGJG2Z2.js";
|
|
40
|
-
import "../chunk-
|
|
41
|
+
import "../chunk-RZXRMPF4.js";
|
|
41
42
|
import "../chunk-XG4UIGDH.js";
|
|
42
|
-
import "../chunk-S3JRZFF5.js";
|
|
43
43
|
import "../chunk-3W6KEDQE.js";
|
|
44
|
-
import "../chunk-
|
|
44
|
+
import "../chunk-S3JRZFF5.js";
|
|
45
|
+
import "../chunk-NK2RCTFI.js";
|
|
46
|
+
import "../chunk-5XF65N7J.js";
|
|
45
47
|
import "../chunk-7LQN7NVU.js";
|
|
46
48
|
import "../chunk-CULYZ3VA.js";
|
|
47
49
|
import "../chunk-RMEX55EU.js";
|
|
48
|
-
import "../chunk-
|
|
50
|
+
import "../chunk-UJDAT42X.js";
|
|
51
|
+
import "../chunk-YSUPRYX2.js";
|
|
49
52
|
import "../chunk-7TSTCMII.js";
|
|
53
|
+
import "../chunk-QQDSHL27.js";
|
|
50
54
|
import "../chunk-DAT55TX2.js";
|
|
51
55
|
import "../chunk-IAF6VMPO.js";
|
|
52
|
-
import "../chunk-
|
|
53
|
-
import "../chunk-
|
|
54
|
-
import "../chunk-
|
|
55
|
-
import "../chunk-A7MX6RSQ.js";
|
|
56
|
-
import "../chunk-TBSWWUJS.js";
|
|
56
|
+
import "../chunk-FCULDJQO.js";
|
|
57
|
+
import "../chunk-SIKTYKVO.js";
|
|
58
|
+
import "../chunk-PZWVTEL2.js";
|
|
57
59
|
import "../chunk-CY6AWCC6.js";
|
|
58
60
|
import "../chunk-ALVC7G6R.js";
|
|
59
61
|
import "../chunk-JFYE5BFI.js";
|
|
60
62
|
import "../chunk-NQX7WBA4.js";
|
|
61
|
-
import "../chunk-UVUSSZ74.js";
|
|
62
63
|
import "../chunk-XBHDQK4Z.js";
|
|
63
64
|
import {
|
|
64
65
|
installClaudeWrapper
|
|
65
66
|
} from "../chunk-IU457W7Q.js";
|
|
66
67
|
import "../chunk-F4WUVOLE.js";
|
|
67
|
-
import "../chunk-
|
|
68
|
-
import "../chunk-YEUALILD.js";
|
|
68
|
+
import "../chunk-QH57EOKP.js";
|
|
69
69
|
import "../chunk-SXE7H3VK.js";
|
|
70
70
|
import "../chunk-LHHBOQUR.js";
|
|
71
71
|
import "../chunk-HFDLUBWN.js";
|
package/dist/containers/setup.js
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
SENTINEL_DIR,
|
|
3
3
|
kickoffEnvironmentSetup,
|
|
4
4
|
prepareSprite
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-SDLNBA53.js";
|
|
6
|
+
import "../chunk-JSLEB2ED.js";
|
|
7
7
|
import "../chunk-NUO56TF7.js";
|
|
8
8
|
import "../chunk-JDELTTHV.js";
|
|
9
9
|
import {
|