@agentstep/agent-sdk 0.4.20 → 0.4.22
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/backends/codex/args.js +1 -1
- package/dist/backends/codex/index.js +4 -4
- package/dist/backends/codex/setup.js +2 -2
- package/dist/backends/codex/wrapper-script.js +1 -1
- package/dist/backends/registry.js +5 -5
- package/dist/{chunk-2XWOQ3BY.js → chunk-3CUY4W6O.js} +1 -1
- package/dist/{chunk-TDSJP5AV.js → chunk-3DKY26SM.js} +2 -2
- package/dist/{chunk-JCW24KHR.js → chunk-3KYYNMM3.js} +1 -1
- package/dist/{chunk-TNQ2H344.js → chunk-4N25TV7W.js} +1 -1
- package/dist/{chunk-3TU24KRF.js → chunk-6DGM6BWP.js} +1 -1
- package/dist/{chunk-B3VXZTKR.js → chunk-73ATUGSN.js} +3 -3
- package/dist/{chunk-EDVS5OMU.js → chunk-CO7CJH7A.js} +36 -7
- package/dist/{chunk-MROQIA7C.js → chunk-DNM5ZHXB.js} +1 -1
- package/dist/{chunk-V2C4E2MN.js → chunk-DPRQO6PY.js} +7 -5
- package/dist/{chunk-NNFXHHPL.js → chunk-DQI6N2QS.js} +2 -2
- package/dist/{chunk-D2FQAAM2.js → chunk-DV2RMXD6.js} +1 -1
- package/dist/{chunk-NXUSIOLM.js → chunk-DZ7V6L66.js} +1 -1
- package/dist/{chunk-NOARWLML.js → chunk-E4FQRMHV.js} +8 -4
- package/dist/{chunk-QTBXZSVW.js → chunk-ES7QCBTU.js} +1 -1
- package/dist/{chunk-BEGJBTM2.js → chunk-FFUQOTXY.js} +4 -4
- package/dist/{chunk-CQ7SDFTO.js → chunk-FYHZ6JI7.js} +1 -1
- package/dist/{chunk-IYM2AYJX.js → chunk-G6DY26SA.js} +1 -1
- package/dist/{chunk-QREI2B7N.js → chunk-GAVZTBYX.js} +1 -1
- package/dist/{chunk-AQCZFV3Q.js → chunk-HRXT7OWW.js} +2 -2
- package/dist/{chunk-QOXHG4Y6.js → chunk-IHI46BFD.js} +1 -1
- package/dist/{chunk-4TUARBXU.js → chunk-JP4O3Z2M.js} +1 -1
- package/dist/{chunk-ZWVYGHM7.js → chunk-K65QMNW2.js} +1 -1
- package/dist/{chunk-WDOPDZAQ.js → chunk-KITFIRK6.js} +1 -1
- package/dist/{chunk-LFTZZ2JC.js → chunk-M2LUXIXU.js} +1 -1
- package/dist/{chunk-LA3LXLFL.js → chunk-MR722H4O.js} +1 -1
- package/dist/{chunk-ORAB6DT4.js → chunk-NUZFYU2K.js} +1 -1
- package/dist/{chunk-4HBGBRU3.js → chunk-PYYZPQH2.js} +1 -1
- package/dist/{chunk-74TKPNGH.js → chunk-Q6HHQ2CK.js} +1 -1
- package/dist/{chunk-YI74CMQH.js → chunk-SAZPAHEA.js} +1 -1
- package/dist/{chunk-SXYRLCQ7.js → chunk-TW5GJAM7.js} +1 -1
- package/dist/{chunk-26MLN4YD.js → chunk-XGMBNULN.js} +1 -1
- package/dist/{chunk-J5DICKEN.js → chunk-XU3OPKWI.js} +1 -1
- package/dist/{chunk-VCM3ZLSO.js → chunk-YA75H2HM.js} +2 -2
- package/dist/{chunk-NQX7WBA4.js → chunk-YOIYOTQD.js} +1 -0
- package/dist/{chunk-EAPJXYAX.js → chunk-ZV4QSTB7.js} +1 -1
- package/dist/{chunk-QCRRP2YS.js → chunk-ZZLOHUAJ.js} +1 -1
- package/dist/containers/lifecycle.js +6 -6
- package/dist/handlers/agents.js +12 -12
- package/dist/handlers/api_keys.js +12 -12
- package/dist/handlers/audit.js +12 -12
- package/dist/handlers/batch.js +12 -12
- package/dist/handlers/credentials.js +13 -13
- package/dist/handlers/environments.js +12 -12
- package/dist/handlers/events.js +12 -12
- package/dist/handlers/files.js +12 -12
- package/dist/handlers/index.js +36 -36
- package/dist/handlers/license.js +12 -12
- package/dist/handlers/memory.js +12 -12
- package/dist/handlers/metrics.js +12 -12
- package/dist/handlers/models.js +12 -12
- package/dist/handlers/providers.js +12 -12
- package/dist/handlers/resources.js +12 -12
- package/dist/handlers/sessions.js +12 -12
- package/dist/handlers/settings.js +12 -12
- package/dist/handlers/skills-write.js +12 -12
- package/dist/handlers/skills.js +12 -12
- package/dist/handlers/stream.js +11 -11
- package/dist/handlers/tenants.js +12 -12
- package/dist/handlers/threads.js +12 -12
- package/dist/handlers/traces.js +12 -12
- package/dist/handlers/upstream_keys.js +12 -12
- package/dist/handlers/vaults.js +12 -12
- package/dist/handlers/whoami.js +12 -12
- package/dist/http.js +11 -11
- package/dist/index.js +11 -11
- package/dist/init.js +10 -10
- package/dist/sessions/driver.js +7 -7
- package/dist/sessions/sweeper.js +7 -7
- package/dist/sessions/threads.js +7 -7
- package/dist/shutdown.js +8 -8
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
codexBackend
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-73ATUGSN.js";
|
|
4
4
|
import {
|
|
5
5
|
buildCodexAuthEnv
|
|
6
6
|
} from "../../chunk-5XF65N7J.js";
|
|
7
7
|
import {
|
|
8
8
|
prepareCodexOnSandbox
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-M2LUXIXU.js";
|
|
10
10
|
import {
|
|
11
11
|
createCodexTranslator
|
|
12
12
|
} from "../../chunk-CULYZ3VA.js";
|
|
13
13
|
import {
|
|
14
14
|
CODEX_WRAPPER_PATH
|
|
15
|
-
} from "../../chunk-
|
|
15
|
+
} from "../../chunk-E4FQRMHV.js";
|
|
16
16
|
import "../../chunk-DAT55TX2.js";
|
|
17
17
|
import {
|
|
18
18
|
buildCodexArgs
|
|
19
|
-
} from "../../chunk-
|
|
19
|
+
} from "../../chunk-YOIYOTQD.js";
|
|
20
20
|
import "../../chunk-QH57EOKP.js";
|
|
21
21
|
import "../../chunk-SXE7H3VK.js";
|
|
22
22
|
import "../../chunk-LHHBOQUR.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listBackends,
|
|
3
3
|
resolveBackend
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-K65QMNW2.js";
|
|
5
5
|
import "../chunk-VS7AMAMU.js";
|
|
6
6
|
import "../chunk-T5VRE77P.js";
|
|
7
7
|
import "../chunk-66CJ6LMV.js";
|
|
@@ -21,11 +21,11 @@ import "../chunk-RZXRMPF4.js";
|
|
|
21
21
|
import "../chunk-XG4UIGDH.js";
|
|
22
22
|
import "../chunk-3W6KEDQE.js";
|
|
23
23
|
import "../chunk-S3JRZFF5.js";
|
|
24
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-73ATUGSN.js";
|
|
25
25
|
import "../chunk-5XF65N7J.js";
|
|
26
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-M2LUXIXU.js";
|
|
27
27
|
import "../chunk-CULYZ3VA.js";
|
|
28
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-E4FQRMHV.js";
|
|
29
29
|
import "../chunk-UJDAT42X.js";
|
|
30
30
|
import "../chunk-YSUPRYX2.js";
|
|
31
31
|
import "../chunk-7TSTCMII.js";
|
|
@@ -38,7 +38,7 @@ import "../chunk-PZWVTEL2.js";
|
|
|
38
38
|
import "../chunk-CY6AWCC6.js";
|
|
39
39
|
import "../chunk-ALVC7G6R.js";
|
|
40
40
|
import "../chunk-JFYE5BFI.js";
|
|
41
|
-
import "../chunk-
|
|
41
|
+
import "../chunk-YOIYOTQD.js";
|
|
42
42
|
import "../chunk-XBHDQK4Z.js";
|
|
43
43
|
import "../chunk-IU457W7Q.js";
|
|
44
44
|
import "../chunk-F4WUVOLE.js";
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
installSkills,
|
|
31
31
|
provisionResources,
|
|
32
32
|
wrapProviderWithSecrets
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-DPRQO6PY.js";
|
|
34
34
|
import {
|
|
35
35
|
BLOCKED_ENV_KEYS,
|
|
36
36
|
resolveVaultSecrets
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
} from "./chunk-JEI7I3EH.js";
|
|
69
69
|
import {
|
|
70
70
|
resolveBackend
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-K65QMNW2.js";
|
|
72
72
|
import {
|
|
73
73
|
PERMISSION_BRIDGE_PENDING_PATH,
|
|
74
74
|
PERMISSION_BRIDGE_REQUEST_PATH,
|
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
} from "./chunk-5XF65N7J.js";
|
|
5
5
|
import {
|
|
6
6
|
prepareCodexOnSandbox
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-M2LUXIXU.js";
|
|
8
8
|
import {
|
|
9
9
|
createCodexTranslator
|
|
10
10
|
} from "./chunk-CULYZ3VA.js";
|
|
11
11
|
import {
|
|
12
12
|
CODEX_WRAPPER_PATH
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-E4FQRMHV.js";
|
|
14
14
|
import {
|
|
15
15
|
wrapPromptWithSystem
|
|
16
16
|
} from "./chunk-DAT55TX2.js";
|
|
17
17
|
import {
|
|
18
18
|
buildCodexArgs
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-YOIYOTQD.js";
|
|
20
20
|
import {
|
|
21
21
|
ApiError
|
|
22
22
|
} from "./chunk-EZYKRG4W.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
jsonOk,
|
|
20
20
|
routeWrap
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-IHI46BFD.js";
|
|
22
22
|
import {
|
|
23
23
|
forwardToAnthropic
|
|
24
24
|
} from "./chunk-QLWA4MJ5.js";
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
} from "./chunk-LAWTTG2E.js";
|
|
39
39
|
import {
|
|
40
40
|
releaseSession
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-DPRQO6PY.js";
|
|
42
42
|
import {
|
|
43
43
|
appendEvent,
|
|
44
44
|
dropEmitter
|
|
@@ -118,9 +118,18 @@ var ResourceSchema = z.object({
|
|
|
118
118
|
content: z.string().optional(),
|
|
119
119
|
file_id: z.string().optional(),
|
|
120
120
|
mount_path: z.string().optional(),
|
|
121
|
+
// Accept both internal (repository_url, branch, commit) and
|
|
122
|
+
// Anthropic API (url, checkout, authorization_token) field names.
|
|
123
|
+
url: z.string().optional(),
|
|
121
124
|
repository_url: z.string().optional(),
|
|
122
125
|
branch: z.string().optional(),
|
|
123
|
-
commit: z.string().optional()
|
|
126
|
+
commit: z.string().optional(),
|
|
127
|
+
checkout: z.object({
|
|
128
|
+
type: z.string(),
|
|
129
|
+
name: z.string().optional(),
|
|
130
|
+
sha: z.string().optional()
|
|
131
|
+
}).optional(),
|
|
132
|
+
authorization_token: z.string().optional()
|
|
124
133
|
});
|
|
125
134
|
var CreateSchema = z.object({
|
|
126
135
|
agent: AgentRef,
|
|
@@ -266,12 +275,22 @@ function handleCreateSession(request) {
|
|
|
266
275
|
if (data.resources?.length) {
|
|
267
276
|
const { createResource } = await import("./db/session-resources.js");
|
|
268
277
|
for (const r of data.resources) {
|
|
278
|
+
let repoUrl = r.type === "github_repository" ? r.repository_url ?? r.url : r.uri;
|
|
279
|
+
if (r.type === "github_repository" && r.authorization_token && repoUrl) {
|
|
280
|
+
try {
|
|
281
|
+
const u = new URL(repoUrl);
|
|
282
|
+
u.username = "x-access-token";
|
|
283
|
+
u.password = r.authorization_token;
|
|
284
|
+
repoUrl = u.toString();
|
|
285
|
+
} catch {
|
|
286
|
+
}
|
|
287
|
+
}
|
|
269
288
|
createResource(session2.id, {
|
|
270
289
|
type: r.type,
|
|
271
290
|
file_id: r.file_id,
|
|
272
291
|
mount_path: r.mount_path,
|
|
273
|
-
url:
|
|
274
|
-
checkout: r.branch ? { type: "branch", name: r.branch } : r.commit ? { type: "commit", name: r.commit } : void 0
|
|
292
|
+
url: repoUrl,
|
|
293
|
+
checkout: r.checkout ? { type: r.checkout.type, name: r.checkout.name ?? r.checkout.sha ?? "" } : r.branch ? { type: "branch", name: r.branch } : r.commit ? { type: "commit", name: r.commit } : void 0
|
|
275
294
|
});
|
|
276
295
|
}
|
|
277
296
|
}
|
|
@@ -315,12 +334,22 @@ function handleCreateSession(request) {
|
|
|
315
334
|
if (data.resources?.length) {
|
|
316
335
|
const { createResource } = await import("./db/session-resources.js");
|
|
317
336
|
for (const r of data.resources) {
|
|
337
|
+
let repoUrl = r.type === "github_repository" ? r.repository_url ?? r.url : r.uri;
|
|
338
|
+
if (r.type === "github_repository" && r.authorization_token && repoUrl) {
|
|
339
|
+
try {
|
|
340
|
+
const u = new URL(repoUrl);
|
|
341
|
+
u.username = "x-access-token";
|
|
342
|
+
u.password = r.authorization_token;
|
|
343
|
+
repoUrl = u.toString();
|
|
344
|
+
} catch {
|
|
345
|
+
}
|
|
346
|
+
}
|
|
318
347
|
createResource(session.id, {
|
|
319
348
|
type: r.type,
|
|
320
349
|
file_id: r.file_id,
|
|
321
350
|
mount_path: r.mount_path,
|
|
322
|
-
url:
|
|
323
|
-
checkout: r.branch ? { type: "branch", name: r.branch } : r.commit ? { type: "commit", name: r.commit } : void 0
|
|
351
|
+
url: repoUrl,
|
|
352
|
+
checkout: r.checkout ? { type: r.checkout.type, name: r.checkout.name ?? r.checkout.sha ?? "" } : r.branch ? { type: "branch", name: r.branch } : r.commit ? { type: "commit", name: r.commit } : void 0
|
|
324
353
|
});
|
|
325
354
|
}
|
|
326
355
|
}
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
} from "./chunk-JEI7I3EH.js";
|
|
35
35
|
import {
|
|
36
36
|
resolveBackend
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-K65QMNW2.js";
|
|
38
38
|
import {
|
|
39
39
|
getConfig
|
|
40
40
|
} from "./chunk-QH57EOKP.js";
|
|
@@ -313,7 +313,9 @@ async function provisionResources(sandboxName, resources, provider) {
|
|
|
313
313
|
} catch (err) {
|
|
314
314
|
console.warn(`[lifecycle] failed to provision file resource ${r.file_id}:`, err);
|
|
315
315
|
}
|
|
316
|
-
} else if (r.type === "github_repository"
|
|
316
|
+
} else if (r.type === "github_repository") {
|
|
317
|
+
const cloneUrl = r.repository_url ?? r.url;
|
|
318
|
+
if (!cloneUrl) continue;
|
|
317
319
|
try {
|
|
318
320
|
const repoDir = safeMountPath ? safeMountPath.startsWith("/") ? safeMountPath : `/mnt/session/uploads/${safeMountPath}` : `/mnt/session/resources/repo_${i}`;
|
|
319
321
|
const SAFE_REF_RE = /^[a-zA-Z0-9_./\-]+$/;
|
|
@@ -325,16 +327,16 @@ async function provisionResources(sandboxName, resources, provider) {
|
|
|
325
327
|
if (safeBranch) {
|
|
326
328
|
gitArgs.push("--branch", safeBranch);
|
|
327
329
|
}
|
|
328
|
-
gitArgs.push("--",
|
|
330
|
+
gitArgs.push("--", cloneUrl, repoDir);
|
|
329
331
|
const result = await provider.exec(sandboxName, gitArgs, { timeoutMs: 12e4 });
|
|
330
332
|
if (safeCommit && result.exit_code === 0) {
|
|
331
333
|
await provider.exec(sandboxName, ["git", "-C", repoDir, "checkout", safeCommit], { timeoutMs: 3e4 });
|
|
332
334
|
}
|
|
333
335
|
if (result.exit_code !== 0) {
|
|
334
|
-
console.warn(`[lifecycle] git clone failed for ${
|
|
336
|
+
console.warn(`[lifecycle] git clone failed for ${cloneUrl}: ${result.stderr.slice(0, 200)}`);
|
|
335
337
|
}
|
|
336
338
|
} catch (err) {
|
|
337
|
-
console.warn(`[lifecycle] failed to clone repo ${
|
|
339
|
+
console.warn(`[lifecycle] failed to clone repo ${cloneUrl}:`, err);
|
|
338
340
|
}
|
|
339
341
|
}
|
|
340
342
|
}
|
|
@@ -8,10 +8,14 @@ var SANDBOX_WRAPPER_SCRIPT = [
|
|
|
8
8
|
// issues when exec replaces the process, matching the claude wrapper pattern.
|
|
9
9
|
"PROMPT_FILE=$(mktemp)",
|
|
10
10
|
'cat > "$PROMPT_FILE"',
|
|
11
|
-
//
|
|
12
|
-
// codex inherits the container exec CWD
|
|
13
|
-
//
|
|
14
|
-
|
|
11
|
+
// Set CWD to the first cloned repo if available, otherwise the user's home.
|
|
12
|
+
// Without bwrap (--sandbox none), codex inherits the container exec CWD
|
|
13
|
+
// which may be / or /root with no project context.
|
|
14
|
+
'REPO_DIR=$(find /mnt/session/resources -maxdepth 1 -name "repo_*" -type d 2>/dev/null | head -1)',
|
|
15
|
+
'if [ -n "$REPO_DIR" ]; then cd "$REPO_DIR"',
|
|
16
|
+
"elif [ -d /home/sprite ]; then cd /home/sprite",
|
|
17
|
+
"elif [ -d /home/user ]; then cd /home/user",
|
|
18
|
+
"else cd /tmp; fi",
|
|
15
19
|
'codex "$@" < "$PROMPT_FILE"',
|
|
16
20
|
"EXIT_CODE=$?",
|
|
17
21
|
'rm -f "$PROMPT_FILE"',
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-HECQRMDR.js";
|
|
4
4
|
import {
|
|
5
5
|
runTurn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3DKY26SM.js";
|
|
7
7
|
import {
|
|
8
8
|
installOtlpExporter
|
|
9
9
|
} from "./chunk-ACKMNK3C.js";
|
|
@@ -19,14 +19,14 @@ import {
|
|
|
19
19
|
} from "./chunk-3MQ2FWXS.js";
|
|
20
20
|
import {
|
|
21
21
|
installShutdownHandlers
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-DNM5ZHXB.js";
|
|
23
23
|
import {
|
|
24
24
|
runSweep
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-FYHZ6JI7.js";
|
|
26
26
|
import {
|
|
27
27
|
reconcileDockerOrphanSandboxes,
|
|
28
28
|
reconcileOrphanSandboxes
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-DPRQO6PY.js";
|
|
30
30
|
import {
|
|
31
31
|
appendEvent,
|
|
32
32
|
installPayloadRedactor
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import {
|
|
25
25
|
jsonOk,
|
|
26
26
|
routeWrap
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-IHI46BFD.js";
|
|
28
28
|
import {
|
|
29
29
|
forwardToAnthropic
|
|
30
30
|
} from "./chunk-QLWA4MJ5.js";
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
import {
|
|
35
35
|
runTurn,
|
|
36
36
|
writePermissionResponse
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-3DKY26SM.js";
|
|
38
38
|
import {
|
|
39
39
|
getProxiedTenantId,
|
|
40
40
|
isProxied
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
jsonOk,
|
|
8
8
|
routeWrap
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-IHI46BFD.js";
|
|
10
10
|
import {
|
|
11
11
|
forwardToAnthropic,
|
|
12
12
|
validateAnthropicProxy
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from "./chunk-JEI7I3EH.js";
|
|
27
27
|
import {
|
|
28
28
|
resolveBackend
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-K65QMNW2.js";
|
|
30
30
|
import {
|
|
31
31
|
getDb,
|
|
32
32
|
init_client
|