@madarco/agentbox 0.23.4 → 0.24.0
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/CHANGELOG.md +79 -0
- package/LICENSE +21 -0
- package/README.md +3 -2
- package/dist/{_cloud-attach-BQRWX3J2.js → _cloud-attach-T6GPR6LJ.js} +5 -5
- package/dist/{chunk-GGRZ3GZO.js → chunk-5KHEH47T.js} +91 -79
- package/dist/chunk-5KHEH47T.js.map +1 -0
- package/dist/{chunk-I6ZRWTPR.js → chunk-6U2S6QWD.js} +219 -18
- package/dist/chunk-6U2S6QWD.js.map +1 -0
- package/dist/{chunk-LK2JT2OO.js → chunk-DEDTPG2D.js} +880 -146
- package/dist/chunk-DEDTPG2D.js.map +1 -0
- package/dist/chunk-G3H2L3O2.js +0 -0
- package/dist/{chunk-LA4JMS27.js → chunk-I654PBHA.js} +290 -330
- package/dist/chunk-I654PBHA.js.map +1 -0
- package/dist/{chunk-W3FQPFP7.js → chunk-K2EDQGZP.js} +18 -4
- package/dist/chunk-K2EDQGZP.js.map +1 -0
- package/dist/{chunk-LSQXT5WZ.js → chunk-LC4E2EIZ.js} +3 -3
- package/dist/{chunk-LSQXT5WZ.js.map → chunk-LC4E2EIZ.js.map} +1 -1
- package/dist/{chunk-SFA57TGX.js → chunk-NACA6AM7.js} +183 -49
- package/dist/chunk-NACA6AM7.js.map +1 -0
- package/dist/{chunk-QEQFZLYR.js → chunk-RYQLFKCP.js} +20 -10
- package/dist/chunk-RYQLFKCP.js.map +1 -0
- package/dist/{chunk-QT3SHMLY.js → chunk-UIRBYL4G.js} +43 -12
- package/dist/chunk-UIRBYL4G.js.map +1 -0
- package/dist/chunk-WJFZJZIM.js +0 -0
- package/dist/chunk-WLHJZPFJ.js +845 -0
- package/dist/chunk-WLHJZPFJ.js.map +1 -0
- package/dist/cloud-poller-SUNA6ZQC-7M5LJHHE.js +0 -0
- package/dist/dist-3KIJ2KQ2.js +1437 -0
- package/dist/dist-3KIJ2KQ2.js.map +1 -0
- package/dist/{dist-V235KVEX.js → dist-7OUOHQPA.js} +196 -151
- package/dist/dist-7OUOHQPA.js.map +1 -0
- package/dist/{dist-Z2NEVV55.js → dist-B7TNWGVG.js} +8 -4
- package/dist/{dist-CUKBKS3N.js → dist-KYV3LEHG.js} +10 -6
- package/dist/{dist-FXQFTT75.js → dist-PHYCFYKH.js} +37 -17
- package/dist/dist-PHYCFYKH.js.map +1 -0
- package/dist/{dist-2BTJQUJS.js → dist-T5MXBZGP.js} +2 -2
- package/dist/{dist-QO4CTLAX.js → dist-Z7KEPQC7.js} +6 -6
- package/dist/index.js +2560 -1108
- package/dist/index.js.map +1 -1
- package/dist/{prepared-state-BUO75YLZ-CDTISC2C.js → prepared-state-BUO75YLZ-RQRFFBJW.js} +2 -2
- package/package.json +28 -28
- package/runtime/_shared/agentbox-checkpoint-cleanup +0 -0
- package/runtime/_shared/agentbox-codex-hooks.json +1 -1
- package/runtime/_shared/agentbox-dockerd-start +0 -0
- package/runtime/_shared/agentbox-open +0 -0
- package/runtime/_shared/agentbox-portless-trust +0 -0
- package/runtime/_shared/agentbox-vnc-start +0 -0
- package/runtime/_shared/ctl.cjs +468 -97
- package/runtime/_shared/gh-shim +0 -0
- package/runtime/_shared/git-shim +53 -3
- package/runtime/_shared/linear-shim +0 -0
- package/runtime/_shared/ntn-shim +0 -0
- package/runtime/daytona/custom-system-CLAUDE.md +1 -1
- package/runtime/digitalocean/agentbox-checkpoint-cleanup +55 -0
- package/runtime/digitalocean/agentbox-codex-hooks.json +68 -0
- package/runtime/digitalocean/agentbox-dockerd-start +145 -0
- package/runtime/digitalocean/agentbox-open +28 -0
- package/runtime/digitalocean/agentbox-portless-trust +82 -0
- package/runtime/digitalocean/agentbox-setup-skill.md +317 -0
- package/runtime/digitalocean/agentbox-vnc-start +102 -0
- package/runtime/digitalocean/claude-managed-settings.json +116 -0
- package/runtime/digitalocean/ctl.cjs +27852 -0
- package/runtime/digitalocean/custom-system-CLAUDE.md +39 -0
- package/runtime/digitalocean/gh-shim +344 -0
- package/runtime/digitalocean/git-shim +181 -0
- package/runtime/digitalocean/linear-shim +181 -0
- package/runtime/digitalocean/ntn-shim +95 -0
- package/runtime/digitalocean/opencode-agentbox-plugin.js +76 -0
- package/runtime/digitalocean/scripts/install-box.sh +462 -0
- package/runtime/docker/Dockerfile.box +5 -0
- package/runtime/docker/packages/ctl/dist/bin.cjs +468 -97
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-codex-hooks.json +1 -1
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-dockerd-start +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-open +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-portless-trust +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-sshd-start +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-vnc-start +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/chromium-resolver +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/custom-system-CLAUDE.md +2 -1
- package/runtime/docker/packages/sandbox-docker/scripts/gh-shim +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/git-shim +53 -3
- package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +0 -0
- package/runtime/e2b/agentbox-checkpoint-cleanup +0 -0
- package/runtime/e2b/agentbox-codex-hooks.json +1 -1
- package/runtime/e2b/agentbox-dockerd-start +0 -0
- package/runtime/e2b/agentbox-open +0 -0
- package/runtime/e2b/agentbox-vnc-start +0 -0
- package/runtime/e2b/ctl.cjs +468 -97
- package/runtime/e2b/custom-system-CLAUDE.md +6 -3
- package/runtime/e2b/gh-shim +0 -0
- package/runtime/e2b/git-shim +53 -3
- package/runtime/e2b/linear-shim +0 -0
- package/runtime/e2b/ntn-shim +0 -0
- package/runtime/e2b/scripts/build-template.sh +16 -0
- package/runtime/hetzner/agentbox-checkpoint-cleanup +0 -0
- package/runtime/hetzner/agentbox-codex-hooks.json +1 -1
- package/runtime/hetzner/agentbox-dockerd-start +0 -0
- package/runtime/hetzner/agentbox-open +0 -0
- package/runtime/hetzner/agentbox-portless-trust +0 -0
- package/runtime/hetzner/agentbox-vnc-start +0 -0
- package/runtime/hetzner/ctl.cjs +468 -97
- package/runtime/hetzner/custom-system-CLAUDE.md +1 -1
- package/runtime/hetzner/gh-shim +0 -0
- package/runtime/hetzner/git-shim +53 -3
- package/runtime/hetzner/linear-shim +0 -0
- package/runtime/hetzner/ntn-shim +0 -0
- package/runtime/hetzner/scripts/install-box.sh +5 -0
- package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
- package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +12 -12
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0keu6we._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bqbkd5._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qa4a0v._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_06f2faq._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_0760z6y._.js +8 -8
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_09gdzmo._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ro6vh6._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0tgpglr._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_1laion6._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_0b_hsjl._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
- package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
- package/runtime/hub/apps/hub/.next/static/chunks/1c5w3kqosumog.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/1o3ot_9-8jgzc.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/380qcmusmigzz.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/3uq9hf-roasav.js +1 -0
- package/runtime/hub/apps/hub/{auth-675P3LQS.js → auth-Q447765C.js} +2 -2
- package/runtime/hub/apps/hub/{auth-config-AOBEKRZQ.js → auth-config-SIL635ZD.js} +2 -2
- package/runtime/hub/apps/hub/{chunk-H22XP3NY.js → chunk-3VE7AYVK.js} +600 -145
- package/runtime/hub/apps/hub/{chunk-EXQCBM5Q.js → chunk-64WEKO34.js} +42 -11
- package/runtime/hub/apps/hub/{chunk-56YQBVN2.js → chunk-DZPQB2JZ.js} +1 -1
- package/runtime/hub/apps/hub/{chunk-2Z74R6ZT.js → chunk-FGBXEXUV.js} +351 -292
- package/runtime/hub/apps/hub/{chunk-AR7CEZ2G.js → chunk-YVELHPNY.js} +218 -17
- package/runtime/hub/apps/hub/{dist-LZNRLUYY.js → dist-33ZNVTC6.js} +183 -49
- package/runtime/hub/apps/hub/{dist-Q6G66Z57.js → dist-4SXAJBOC.js} +195 -150
- package/runtime/hub/apps/hub/{dist-SD4G36EP.js → dist-EPJFN2J3.js} +116 -86
- package/runtime/hub/apps/hub/{dist-STQK5XM6.js → dist-GF5EBRNG.js} +1 -1
- package/runtime/hub/apps/hub/{dist-LNHEG5P4.js → dist-UJVIROA4.js} +19 -5
- package/runtime/hub/apps/hub/dist-XULFTIMT.js +2212 -0
- package/runtime/hub/apps/hub/{dist-VV6Z2CQX.js → dist-YM5J25H6.js} +7 -3
- package/runtime/hub/apps/hub/{hub-token-2BZFBBW3.js → hub-token-UITZEWVP.js} +2 -2
- package/runtime/hub/apps/hub/package.json +1 -0
- package/runtime/hub/apps/hub/{prepared-state-BUO75YLZ-CAXQS5Y3.js → prepared-state-BUO75YLZ-O4GZMDRF.js} +1 -1
- package/runtime/hub/apps/hub/server.js +38 -19
- package/runtime/relay/bin.cjs +275 -59
- package/runtime/vercel/agentbox-checkpoint-cleanup +0 -0
- package/runtime/vercel/agentbox-codex-hooks.json +1 -1
- package/runtime/vercel/agentbox-dockerd-start +0 -0
- package/runtime/vercel/agentbox-open +0 -0
- package/runtime/vercel/agentbox-vnc-start +0 -0
- package/runtime/vercel/ctl.cjs +468 -97
- package/runtime/vercel/custom-system-CLAUDE.md +3 -2
- package/runtime/vercel/gh-shim +0 -0
- package/runtime/vercel/git-shim +53 -3
- package/runtime/vercel/linear-shim +0 -0
- package/runtime/vercel/ntn-shim +0 -0
- package/runtime/vercel/scripts/provision.sh +16 -0
- package/dist/chunk-GGRZ3GZO.js.map +0 -1
- package/dist/chunk-I6ZRWTPR.js.map +0 -1
- package/dist/chunk-LA4JMS27.js.map +0 -1
- package/dist/chunk-LK2JT2OO.js.map +0 -1
- package/dist/chunk-QEQFZLYR.js.map +0 -1
- package/dist/chunk-QT3SHMLY.js.map +0 -1
- package/dist/chunk-SFA57TGX.js.map +0 -1
- package/dist/chunk-W3FQPFP7.js.map +0 -1
- package/dist/dist-FXQFTT75.js.map +0 -1
- package/dist/dist-V235KVEX.js.map +0 -1
- package/runtime/hub/apps/hub/.next/static/chunks/0joh_xsiowfc4.js +0 -1
- package/runtime/hub/apps/hub/.next/static/chunks/20hq7-0depjid.js +0 -1
- package/runtime/hub/apps/hub/.next/static/chunks/3p86ecqhr_7yy.js +0 -1
- package/runtime/hub/apps/hub/.next/static/chunks/3qof5hg87qf5n.js +0 -1
- /package/dist/{_cloud-attach-BQRWX3J2.js.map → _cloud-attach-T6GPR6LJ.js.map} +0 -0
- /package/dist/{dist-2BTJQUJS.js.map → dist-B7TNWGVG.js.map} +0 -0
- /package/dist/{dist-CUKBKS3N.js.map → dist-KYV3LEHG.js.map} +0 -0
- /package/dist/{dist-QO4CTLAX.js.map → dist-T5MXBZGP.js.map} +0 -0
- /package/dist/{dist-Z2NEVV55.js.map → dist-Z7KEPQC7.js.map} +0 -0
- /package/dist/{prepared-state-BUO75YLZ-CDTISC2C.js.map → prepared-state-BUO75YLZ-RQRFFBJW.js.map} +0 -0
- /package/runtime/hub/apps/hub/.next/static/{eVq-z4zld_8DGQudbYogV → XtIjHGqvY4mQsOY2-m1Jy}/_buildManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{eVq-z4zld_8DGQudbYogV → XtIjHGqvY4mQsOY2-m1Jy}/_clientMiddlewareManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{eVq-z4zld_8DGQudbYogV → XtIjHGqvY4mQsOY2-m1Jy}/_ssgManifest.js +0 -0
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
isAttemptTimeout,
|
|
22
22
|
isRetriable,
|
|
23
23
|
makeHetznerClient,
|
|
24
|
+
mapHetznerProvisionError,
|
|
24
25
|
maskKey,
|
|
25
26
|
mintPrepareKey,
|
|
26
27
|
normalizeSourceCidr,
|
|
@@ -41,16 +42,17 @@ import {
|
|
|
41
42
|
sshOptArgs,
|
|
42
43
|
syncFirewallSource,
|
|
43
44
|
updatePreparedState,
|
|
45
|
+
validateServerChoice,
|
|
44
46
|
waitForSsh,
|
|
45
47
|
withHetznerRetry,
|
|
46
48
|
writePreparedState
|
|
47
|
-
} from "./chunk-
|
|
48
|
-
import "./chunk-
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
49
|
+
} from "./chunk-NACA6AM7.js";
|
|
50
|
+
import "./chunk-6U2S6QWD.js";
|
|
51
|
+
import "./chunk-I654PBHA.js";
|
|
52
|
+
import "./chunk-UIRBYL4G.js";
|
|
51
53
|
import {
|
|
52
54
|
mintSshKey
|
|
53
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-DEDTPG2D.js";
|
|
54
56
|
import "./chunk-G3H2L3O2.js";
|
|
55
57
|
import "./chunk-WJFZJZIM.js";
|
|
56
58
|
export {
|
|
@@ -75,6 +77,7 @@ export {
|
|
|
75
77
|
isAttemptTimeout,
|
|
76
78
|
isRetriable,
|
|
77
79
|
makeHetznerClient,
|
|
80
|
+
mapHetznerProvisionError,
|
|
78
81
|
maskKey,
|
|
79
82
|
mintPrepareKey,
|
|
80
83
|
mintSshKey,
|
|
@@ -96,8 +99,9 @@ export {
|
|
|
96
99
|
sshOptArgs,
|
|
97
100
|
syncFirewallSource,
|
|
98
101
|
updatePreparedState,
|
|
102
|
+
validateServerChoice,
|
|
99
103
|
waitForSsh,
|
|
100
104
|
withHetznerRetry,
|
|
101
105
|
writePreparedState
|
|
102
106
|
};
|
|
103
|
-
//# sourceMappingURL=dist-
|
|
107
|
+
//# sourceMappingURL=dist-KYV3LEHG.js.map
|
|
@@ -7,23 +7,24 @@ import {
|
|
|
7
7
|
ensureDaytonaCredentials,
|
|
8
8
|
ensureDaytonaEnvLoaded,
|
|
9
9
|
getClient,
|
|
10
|
+
parseDaytonaSize,
|
|
10
11
|
preparedMatches,
|
|
11
12
|
readPreparedDaytonaState,
|
|
12
13
|
resolveDaytonaCustomClaudeMd,
|
|
13
14
|
resolveDockerfileContext,
|
|
14
15
|
setDaytonaCredentials,
|
|
15
16
|
writePreparedDaytonaState
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5KHEH47T.js";
|
|
17
18
|
import {
|
|
18
19
|
createCloudProvider
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-6U2S6QWD.js";
|
|
21
|
+
import "./chunk-I654PBHA.js";
|
|
22
|
+
import "./chunk-UIRBYL4G.js";
|
|
22
23
|
import {
|
|
23
24
|
claudeInstallFingerprint,
|
|
24
25
|
errSummary,
|
|
25
26
|
stageAllAgentStatic
|
|
26
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-DEDTPG2D.js";
|
|
27
28
|
import "./chunk-G3H2L3O2.js";
|
|
28
29
|
import "./chunk-WJFZJZIM.js";
|
|
29
30
|
|
|
@@ -32,9 +33,10 @@ import { copyFileSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "
|
|
|
32
33
|
import { tmpdir } from "os";
|
|
33
34
|
import { dirname, join } from "path";
|
|
34
35
|
import { Image } from "@daytonaio/sdk";
|
|
35
|
-
function defaultSnapshotName(fingerprint) {
|
|
36
|
-
|
|
37
|
-
return `agentbox-base-${
|
|
36
|
+
function defaultSnapshotName(fingerprint, sizeKey) {
|
|
37
|
+
const suffix = sizeKey ? `-${sizeKey}` : "";
|
|
38
|
+
if (fingerprint) return `agentbox-base-${fingerprint.slice(0, 12)}${suffix}`;
|
|
39
|
+
return `agentbox-base-${Math.floor(Date.now() / 1e3).toString()}${suffix}`;
|
|
38
40
|
}
|
|
39
41
|
function daytonaSeedPaths(kind) {
|
|
40
42
|
return {
|
|
@@ -66,14 +68,22 @@ async function prepareDaytona(opts) {
|
|
|
66
68
|
const log = opts.onLog ?? (() => {
|
|
67
69
|
});
|
|
68
70
|
const claudeInstall = opts.claudeInstall ?? "native";
|
|
71
|
+
const sizeSpec = opts.size?.trim() || void 0;
|
|
72
|
+
const sizeResources = sizeSpec ? parseDaytonaSize(sizeSpec) : void 0;
|
|
73
|
+
if (sizeSpec && !sizeResources) {
|
|
74
|
+
throw new Error(
|
|
75
|
+
`invalid --size '${sizeSpec}' for daytona: expected 'cpu-memory-disk' GB, e.g. '4-8-20'.`
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
const sizeKey = sizeResources ? `${String(sizeResources.cpu)}-${String(sizeResources.memory)}-${String(sizeResources.disk)}` : void 0;
|
|
69
79
|
const rawFingerprint = await computeDaytonaContextFingerprint();
|
|
70
80
|
const fingerprint = rawFingerprint ? {
|
|
71
81
|
...rawFingerprint,
|
|
72
82
|
contextSha256: claudeInstallFingerprint(rawFingerprint.contextSha256, claudeInstall)
|
|
73
83
|
} : rawFingerprint;
|
|
74
|
-
const snapshotName = opts.name ?? defaultSnapshotName(fingerprint?.contextSha256 ?? null);
|
|
84
|
+
const snapshotName = opts.name ?? defaultSnapshotName(fingerprint?.contextSha256 ?? null, sizeKey);
|
|
75
85
|
const prepared = readPreparedDaytonaState();
|
|
76
|
-
if (!opts.force && fingerprint && preparedMatches(prepared, fingerprint.contextSha256)) {
|
|
86
|
+
if (!opts.force && fingerprint && preparedMatches(prepared, fingerprint.contextSha256, sizeKey)) {
|
|
77
87
|
try {
|
|
78
88
|
const existing = await getClient().snapshot.get(
|
|
79
89
|
prepared?.base?.imageRef ?? snapshotName
|
|
@@ -93,9 +103,16 @@ async function prepareDaytona(opts) {
|
|
|
93
103
|
);
|
|
94
104
|
}
|
|
95
105
|
} else if (!opts.force && fingerprint && prepared?.base?.contextSha256) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
106
|
+
const bakedSize = prepared.extras?.size;
|
|
107
|
+
if (prepared.base.contextSha256 === fingerprint.contextSha256 && bakedSize !== sizeKey) {
|
|
108
|
+
log(
|
|
109
|
+
`daytona size changed (was ${bakedSize ?? "default"}, now ${sizeKey ?? "default"}); rebuilding snapshot`
|
|
110
|
+
);
|
|
111
|
+
} else {
|
|
112
|
+
log(
|
|
113
|
+
`daytona build context changed (was ${prepared.base.contextSha256.slice(0, 12)}, now ${fingerprint.contextSha256.slice(0, 12)}); rebuilding snapshot`
|
|
114
|
+
);
|
|
115
|
+
}
|
|
99
116
|
}
|
|
100
117
|
const ctx = resolveDockerfileContext();
|
|
101
118
|
if (!ctx) {
|
|
@@ -126,9 +143,11 @@ async function prepareDaytona(opts) {
|
|
|
126
143
|
}
|
|
127
144
|
image = image.dockerfileCommands(buildDaytonaSeedCommands(usable), seedContextDir);
|
|
128
145
|
const client = getClient();
|
|
129
|
-
log(
|
|
146
|
+
log(
|
|
147
|
+
`creating Daytona snapshot '${snapshotName}'${sizeResources ? ` (${sizeKey})` : ""}\u2026`
|
|
148
|
+
);
|
|
130
149
|
const snapshot = await client.snapshot.create(
|
|
131
|
-
{ name: snapshotName, image },
|
|
150
|
+
{ name: snapshotName, image, ...sizeResources ? { resources: sizeResources } : {} },
|
|
132
151
|
{
|
|
133
152
|
onLogs: (chunk) => log(String(chunk).split("\n").filter(Boolean).join(" "))
|
|
134
153
|
}
|
|
@@ -137,7 +156,8 @@ async function prepareDaytona(opts) {
|
|
|
137
156
|
if (fingerprint) {
|
|
138
157
|
writePreparedDaytonaState({
|
|
139
158
|
snapshotName: snapshot.name ?? snapshotName,
|
|
140
|
-
contextSha256: fingerprint.contextSha256
|
|
159
|
+
contextSha256: fingerprint.contextSha256,
|
|
160
|
+
size: sizeKey
|
|
141
161
|
});
|
|
142
162
|
log(
|
|
143
163
|
`recorded daytona-prepared.json (fingerprint ${fingerprint.contextSha256.slice(0, 12)})`
|
|
@@ -299,4 +319,4 @@ export {
|
|
|
299
319
|
resolveDockerfileContext,
|
|
300
320
|
setDaytonaCredentials
|
|
301
321
|
};
|
|
302
|
-
//# sourceMappingURL=dist-
|
|
322
|
+
//# sourceMappingURL=dist-PHYCFYKH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../packages/sandbox-daytona/src/index.ts","../../../packages/sandbox-daytona/src/prepare.ts","../../../packages/sandbox-daytona/src/provider-module.ts","../../../packages/sandbox-daytona/src/status.ts"],"sourcesContent":["/**\n * The Daytona Cloud sandbox provider. A thin `CloudBackend` over\n * `@daytonaio/sdk`, composed via `@agentbox/sandbox-cloud`'s `createCloudProvider`\n * for everything provider-agnostic (workspace seeding, ctl launch, state).\n */\n\nimport type { Provider } from '@agentbox/core';\nimport type { ProviderModule } from '@agentbox/sandbox-core';\nimport { createCloudProvider } from '@agentbox/sandbox-cloud';\nimport { daytonaBackend, DEFAULT_BOX_IMAGE_REF } from './backend.js';\nimport { prepareDaytona } from './prepare.js';\nimport { currentDaytonaBaseFingerprintLive } from './prepared-state.js';\nimport { ensureDaytonaCredentials, setDaytonaCredentials } from './credentials.js';\nimport { doctorChecks, readCredStatusSummary } from './provider-module.js';\n\nconst cloudProvider = createCloudProvider(daytonaBackend, {\n defaultResources: { cpu: 2, memory: 4, disk: 8 },\n});\n\nexport const daytonaProvider: Provider = {\n ...cloudProvider,\n prepare: prepareDaytona,\n baseFingerprint: () => currentDaytonaBaseFingerprintLive(),\n};\n\n/** Uniform surface the CLI provider loader resolves this package through. */\nexport const providerModule: ProviderModule = {\n provider: daytonaProvider,\n backend: daytonaBackend,\n ensureCredentials: ensureDaytonaCredentials,\n readCredStatus: readCredStatusSummary,\n setCredentials: setDaytonaCredentials,\n currentBaseFingerprintLive: (claudeInstall) => currentDaytonaBaseFingerprintLive(claudeInstall),\n doctorChecks,\n};\n\nexport { daytonaBackend, DEFAULT_BOX_IMAGE_REF };\nexport { resolveDockerfileContext, type DockerfileContext } from './dockerfile-context.js';\nexport { ensureDaytonaEnvLoaded } from './env-loader.js';\nexport { currentDaytonaBaseFingerprintLive } from './prepared-state.js';\n// Called by the CLI provider registry to gate first-run interactive setup.\n// Plain async function — no commander surface — so adding it here doesn't\n// pull commander/clack into consumers' type graphs. The full CLI command\n// lives at the `./cli` subpath export.\nexport { ensureDaytonaCredentials, setDaytonaCredentials } from './credentials.js';\nexport type { EnsureDaytonaCredentialsOptions } from './credentials.js';\nexport {\n getDaytonaStatus,\n type DaytonaStatus,\n type DaytonaSnapshotSummary,\n type DaytonaVolumeSummary,\n} from './status.js';\n","/**\n * Daytona-side implementation of the `Provider.prepare` hook (`agentbox\n * prepare --provider daytona`). One-time, user-triggered:\n *\n * 1. Stage filtered tarballs of the host's `~/.claude`, `~/.codex`, and\n * `~/.local/share/opencode` static config (no auth tokens — those go on\n * the per-org `agentbox-credentials` volume at create time).\n * 2. Build a layered Daytona `Image`: start from `Dockerfile.box`, then\n * `.addLocalFile()` each staged tarball + `.runCommands()` to extract\n * them into the right paths inside the image.\n * 3. Call `daytona.snapshot.create({ name, image }, { onLogs })` — Daytona\n * runs the build server-side, registers the result as an org-scoped\n * named snapshot, and returns when it's `active`.\n *\n * Replaces the old `agentbox daytona publish-snapshot` flow that\n * provisioned a sandbox + ran an in-sandbox bake + called the broken\n * `_experimental_createSnapshot`. The new path never provisions a sandbox.\n *\n * Source of truth for the public API:\n * https://www.daytona.io/docs/en/snapshots/\n */\n\nimport { copyFileSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { dirname, join } from 'node:path';\nimport { Image } from '@daytonaio/sdk';\nimport type { PrepareOptions, PrepareResult } from '@agentbox/core';\nimport {\n claudeInstallFingerprint,\n stageAllAgentStatic,\n type AgentStaticStage,\n} from '@agentbox/sandbox-core';\nimport { getClient, parseDaytonaSize } from './backend.js';\nimport { resolveDaytonaCustomClaudeMd, resolveDockerfileContext } from './dockerfile-context.js';\nimport { ensureDaytonaEnvLoaded } from './env-loader.js';\nimport {\n computeDaytonaContextFingerprint,\n preparedMatches,\n readPreparedDaytonaState,\n writePreparedDaytonaState,\n} from './prepared-state.js';\n\n/**\n * Default snapshot name. Keyed on the first 12 chars of the build-context\n * fingerprint so identical content produces the same snapshot name across\n * machines / CLI runs (idempotent): if the named snapshot already exists\n * on Daytona, prepare can short-circuit without uploading the build\n * context again. Falls back to a timestamp when fingerprinting fails\n * (partial dev rebuild).\n */\nexport function defaultSnapshotName(fingerprint: string | null, sizeKey?: string): string {\n // The size suffix keeps re-sized bakes from colliding on one name, so a\n // `--size 2-4-8` snapshot doesn't overwrite the `4-8-20` one.\n const suffix = sizeKey ? `-${sizeKey}` : '';\n if (fingerprint) return `agentbox-base-${fingerprint.slice(0, 12)}${suffix}`;\n return `agentbox-base-${Math.floor(Date.now() / 1000).toString()}${suffix}`;\n}\n\n/**\n * Daytona build paths for a staged tool. The tarball is copied into the seed\n * build-context dir under `contextRel` (a RELATIVE name — the Daytona builder\n * only resolves COPY sources that map to a relative archive entry; an absolute\n * `addLocalFile` COPY silently fails to land), then COPYed to `remoteTar`.\n */\nfunction daytonaSeedPaths(kind: AgentStaticStage['kind']): { contextRel: string; remoteTar: string } {\n return {\n contextRel: `agentbox-seed-${kind}.tar.gz`,\n remoteTar: `/tmp/agentbox-seed-${kind}.tar.gz`,\n };\n}\n\n/** Relative name the daytona CLAUDE.md overlay is staged under in the seed context dir. */\nconst DAYTONA_CLAUDE_MD_REL = 'agentbox-custom-CLAUDE.md';\n\n/**\n * Build the appended Dockerfile commands for the seed bake. Every `COPY` source\n * is a RELATIVE name resolved against the seed build-context dir — the Daytona\n * builder drops absolute-source COPYs (they archive to a stripped relative entry\n * that the absolute source can't reference), so relative names are mandatory.\n * Runs as root (COPY drops files root-owned; chown -R + /etc/claude-code need\n * root), then restores `USER vscode` so the image keeps its default-user invariant.\n * Pure + exported for the regression test.\n */\nexport function buildDaytonaSeedCommands(\n usable: ReadonlyArray<Pick<AgentStaticStage, 'kind' | 'extractDir'>>,\n): string[] {\n const cmds: string[] = [\n 'USER root',\n `COPY ${DAYTONA_CLAUDE_MD_REL} /tmp/agentbox-custom-CLAUDE.md`,\n ...usable.map((s) => `COPY ${daytonaSeedPaths(s.kind).contextRel} ${daytonaSeedPaths(s.kind).remoteTar}`),\n 'RUN install -m 0644 /tmp/agentbox-custom-CLAUDE.md /etc/claude-code/CLAUDE.md && rm -f /tmp/agentbox-custom-CLAUDE.md',\n ...usable.map(\n (s) =>\n `RUN mkdir -p ${s.extractDir} && tar -xzf ${daytonaSeedPaths(s.kind).remoteTar} -C ${s.extractDir} --no-same-permissions --no-same-owner -m`,\n ),\n ];\n if (usable.length > 0) {\n // Own the extracted trees as the box user, then drop the staging tarballs.\n // ~/.agents is only present when the host had one (skills dir); guard it.\n cmds.push(\n 'RUN chown -R vscode:vscode /home/vscode/.claude /home/vscode/.codex /home/vscode/.local' +\n ' && ( [ -d /home/vscode/.agents ] && chown -R vscode:vscode /home/vscode/.agents || true )' +\n ' && rm -f /tmp/agentbox-seed-*.tar.gz',\n );\n }\n cmds.push('USER vscode');\n return cmds;\n}\n\n/**\n * Run `agentbox prepare --provider daytona`. Returns `{ snapshotName }` on\n * success so the CLI can pin it into the project config.\n */\nexport async function prepareDaytona(opts: PrepareOptions): Promise<PrepareResult> {\n ensureDaytonaEnvLoaded();\n const log = opts.onLog ?? (() => {});\n\n // Fingerprint the build context first so we can (a) name the snapshot\n // deterministically and (b) detect cache hits against the recorded\n // prepared state. Computed before staging so an early `null` (partial\n // dev rebuild) doesn't waste a tar staging cycle.\n const claudeInstall = opts.claudeInstall ?? 'native';\n\n // Bake-time resources. A `--size` / `box.sizeDaytona` like `4-8-20` sets the\n // snapshot's baked CPU/memory/disk (Daytona rejects resources on the create\n // snapshot path, so it MUST be set here). Normalize to a canonical\n // `cpu-memory-disk` string for the snapshot-name suffix + prepared-state so\n // `04-08-20` and `4-8-20` don't fork the cache.\n const sizeSpec = opts.size?.trim() || undefined;\n const sizeResources = sizeSpec ? parseDaytonaSize(sizeSpec) : undefined;\n if (sizeSpec && !sizeResources) {\n throw new Error(\n `invalid --size '${sizeSpec}' for daytona: expected 'cpu-memory-disk' GB, e.g. '4-8-20'.`,\n );\n }\n const sizeKey = sizeResources\n ? `${String(sizeResources.cpu)}-${String(sizeResources.memory)}-${String(sizeResources.disk)}`\n : undefined;\n\n const rawFingerprint = await computeDaytonaContextFingerprint();\n // Fold the install mode into the sha so native↔npm are distinct cache\n // identities (`native` leaves the hash unchanged) — the snapshot name and the\n // prepared-state match both derive from it.\n const fingerprint = rawFingerprint\n ? {\n ...rawFingerprint,\n contextSha256: claudeInstallFingerprint(rawFingerprint.contextSha256, claudeInstall),\n }\n : rawFingerprint;\n const snapshotName =\n opts.name ?? defaultSnapshotName(fingerprint?.contextSha256 ?? null, sizeKey);\n\n const prepared = readPreparedDaytonaState();\n if (\n !opts.force &&\n fingerprint &&\n preparedMatches(prepared, fingerprint.contextSha256, sizeKey)\n ) {\n // Confirm the snapshot still exists on Daytona before short-circuiting.\n // A \"yes locally, no on the server\" mismatch must rebuild.\n try {\n const existing = await getClient().snapshot.get(\n prepared?.base?.imageRef ?? snapshotName,\n );\n if (existing?.name) {\n log(\n `daytona snapshot '${existing.name}' up to date ` +\n `(fingerprint ${fingerprint.contextSha256.slice(0, 12)}) — skipping rebuild ` +\n `(pass --force to override)`,\n );\n return { snapshotName: existing.name };\n }\n log(\n `recorded snapshot '${prepared?.base?.imageRef ?? snapshotName}' not found on Daytona; rebuilding`,\n );\n } catch {\n log(\n `recorded snapshot lookup failed; rebuilding (pass --force to silence)`,\n );\n }\n } else if (!opts.force && fingerprint && prepared?.base?.contextSha256) {\n const bakedSize = prepared.extras?.size;\n if (prepared.base.contextSha256 === fingerprint.contextSha256 && bakedSize !== sizeKey) {\n log(\n `daytona size changed (was ${bakedSize ?? 'default'}, now ${sizeKey ?? 'default'}); ` +\n `rebuilding snapshot`,\n );\n } else {\n log(\n `daytona build context changed (was ${prepared.base.contextSha256.slice(0, 12)}, ` +\n `now ${fingerprint.contextSha256.slice(0, 12)}); rebuilding snapshot`,\n );\n }\n }\n\n const ctx = resolveDockerfileContext();\n if (!ctx) {\n throw new Error(\n 'could not locate AgentBox Dockerfile.box build context for the Daytona snapshot. ' +\n 'Set AGENTBOX_DOCKER_CONTEXT to the directory containing Dockerfile.box.',\n );\n }\n\n const daytonaClaudeMd = resolveDaytonaCustomClaudeMd();\n if (!daytonaClaudeMd) {\n throw new Error(\n 'could not locate packages/sandbox-daytona/scripts/custom-system-CLAUDE.md ' +\n '(or its staged runtime/daytona/ copy). Ensure `pnpm -w build` ran so the ' +\n 'CLI staging populated runtime/daytona/.',\n );\n }\n\n const stages = await stageAllAgentStatic({ hostWorkspace: opts.hostWorkspace });\n // Surface staging warnings (codex Keychain landmine, etc.) before the\n // longer build kicks off.\n for (const s of stages) {\n for (const w of s.staged.warnings) log(w);\n }\n\n // The Daytona SDK's `Image.fromDockerfile` takes only a path — no build args —\n // and appended `.env()`/`.runCommands()` land *after* the base Dockerfile's\n // Claude RUN (too late, and a native 403 would already have failed the build).\n // So for npm mode we build from a sibling temp Dockerfile with the\n // `AGENTBOX_CLAUDE_INSTALL` ARG default flipped to `npm`. It must live in the\n // original's directory so the Dockerfile's relative COPY sources still resolve.\n let tempDockerfile: string | null = null;\n const dockerfilePath =\n claudeInstall === 'npm'\n ? (tempDockerfile = writeNpmDockerfile(ctx.dockerfile))\n : ctx.dockerfile;\n\n // Seed build-context dir: the daytona CLAUDE.md + each staged tarball are\n // copied here under RELATIVE names so the appended `COPY <name>` sources map\n // to relative archive entries the Daytona builder actually reconstructs.\n // (An absolute `addLocalFile` COPY emits `COPY /abs/tmp/x` but archives the\n // entry as the stripped `abs/tmp/x` — the mismatch silently drops the layer.)\n let seedContextDir: string | null = null;\n try {\n // git-lfs (binary + `git lfs install --system`) is inherited for free from\n // Dockerfile.box, so an in-box checkout of an LFS repo smudges real content.\n // No daytona-specific overlay step is needed; the host-side object seeding\n // lives in sandbox-cloud's workspace-seed (seedCloneLfsObjects).\n let image: Image = Image.fromDockerfile(dockerfilePath);\n\n seedContextDir = mkdtempSync(join(tmpdir(), 'agentbox-daytona-seed-'));\n // Overlay the daytona-specific /etc/claude-code/CLAUDE.md on top of the\n // docker-shaped one baked by Dockerfile.box (daytona boxes have no host\n // .git/ bind-mount, so the in-box hint needs daytona-specific git wording).\n copyFileSync(daytonaClaudeMd, join(seedContextDir, DAYTONA_CLAUDE_MD_REL));\n\n const usable = stages.filter((s) => s.staged.tarballPath !== null);\n for (const s of usable) {\n copyFileSync(s.staged.tarballPath as string, join(seedContextDir, daytonaSeedPaths(s.kind).contextRel));\n }\n\n image = image.dockerfileCommands(buildDaytonaSeedCommands(usable), seedContextDir);\n\n const client = getClient();\n log(\n `creating Daytona snapshot '${snapshotName}'${sizeResources ? ` (${sizeKey})` : ''}…`,\n );\n const snapshot = await client.snapshot.create(\n { name: snapshotName, image, ...(sizeResources ? { resources: sizeResources } : {}) },\n {\n onLogs: (chunk: string) => log(String(chunk).split('\\n').filter(Boolean).join(' ')),\n },\n );\n log(`snapshot '${snapshot.name}' is ${snapshot.state ?? 'created'}`);\n if (fingerprint) {\n writePreparedDaytonaState({\n snapshotName: snapshot.name ?? snapshotName,\n contextSha256: fingerprint.contextSha256,\n size: sizeKey,\n });\n log(\n `recorded daytona-prepared.json (fingerprint ${fingerprint.contextSha256.slice(0, 12)})`,\n );\n }\n return { snapshotName: snapshot.name ?? snapshotName };\n } finally {\n await Promise.all(stages.map((s) => s.staged.cleanup()));\n if (tempDockerfile) rmSync(tempDockerfile, { force: true });\n if (seedContextDir) rmSync(seedContextDir, { recursive: true, force: true });\n }\n}\n\n/**\n * Write a sibling copy of `Dockerfile.box` with the `AGENTBOX_CLAUDE_INSTALL`\n * ARG default flipped from `native` to `npm`, and return its path. A sibling\n * (same directory) keeps the Dockerfile's relative COPY sources resolvable.\n * Throws if the ARG line isn't found (Dockerfile drifted from this expectation).\n */\nfunction writeNpmDockerfile(originalPath: string): string {\n const original = readFileSync(originalPath, 'utf8');\n const flipped = original.replace(\n 'ARG AGENTBOX_CLAUDE_INSTALL=native',\n 'ARG AGENTBOX_CLAUDE_INSTALL=npm',\n );\n if (flipped === original) {\n throw new Error(\n `could not enable npm Claude install for Daytona: 'ARG AGENTBOX_CLAUDE_INSTALL=native' ` +\n `not found in ${originalPath}. The Dockerfile.box drifted from the expected shape.`,\n );\n }\n const target = join(dirname(originalPath), '.agentbox-claude-npm.Dockerfile');\n writeFileSync(target, flipped);\n return target;\n}\n","/**\n * Doctor probes + normalized credential status for the daytona provider,\n * assembled into `providerModule` in `index.ts`. Moved out of apps/cli so the\n * CLI dispatches to it generically (see `@agentbox/sandbox-core`'s `ProviderModule`).\n */\n\nimport { errSummary, type CheckResult, type CredStatusSummary } from '@agentbox/sandbox-core';\nimport { getDaytonaStatus } from './status.js';\n\nexport async function readCredStatusSummary(): Promise<CredStatusSummary> {\n const status = await getDaytonaStatus();\n return { configured: status.configured };\n}\n\nexport async function doctorChecks(): Promise<CheckResult[]> {\n try {\n const status = await getDaytonaStatus();\n if (!status.configured) {\n return [\n {\n label: 'credentials',\n status: 'warn',\n // The SDK's reason is a paragraph (env-var enumeration) — doctor just\n // needs the vercel/e2b-style one-liner; `prepare --status` keeps it.\n detail: 'not configured',\n hint: '`agentbox daytona login`',\n },\n ];\n }\n const credRes: CheckResult = { label: 'credentials', status: 'ok', detail: 'configured' };\n const snapRes: CheckResult =\n status.snapshots.length > 0\n ? {\n label: 'base snapshot',\n status: 'ok',\n detail: `${String(status.snapshots.length)} agentbox snapshot(s)`,\n }\n : {\n label: 'base snapshot',\n status: 'warn',\n detail: 'none',\n hint: '`agentbox prepare --provider daytona`',\n };\n return [credRes, snapRes];\n } catch (err) {\n return [{ label: 'credentials', status: 'warn', detail: errSummary(err) }];\n }\n}\n","/**\n * Read-only status helpers for `agentbox prepare` (no-args mode). Surfaces\n * the user-facing inventory of agentbox-owned base images / snapshots /\n * volumes on the configured Daytona org so the user can see at a glance\n * what's already prepared and what isn't.\n *\n * Daytona-side state lives in two places:\n * - **Snapshots** — built by `agentbox prepare --provider daytona`. Listed\n * filtered to `agentbox*` so we don't surface unrelated org snapshots.\n * - **Volumes** — the per-org `agentbox-credentials` volume created lazily\n * by `ensureAgentVolumesForCloud` on first `agentbox create --provider\n * daytona`.\n *\n * All calls swallow auth/network errors and return an empty section — the\n * status command must work for users who don't have Daytona configured.\n */\n\nimport { ensureDaytonaEnvLoaded } from './env-loader.js';\nimport { getClient } from './backend.js';\n\nexport interface DaytonaSnapshotSummary {\n name: string;\n state?: string;\n /** Snapshot size in GB, as reported by Daytona (may be undefined for non-`active` states). */\n sizeGb?: number;\n createdAt?: string;\n errorReason?: string;\n}\n\nexport interface DaytonaVolumeSummary {\n name: string;\n id: string;\n state?: string;\n createdAt?: string;\n lastUsedAt?: string;\n}\n\nexport interface DaytonaStatus {\n /** True when Daytona credentials are present + the SDK could connect. */\n configured: boolean;\n /** Snapshots whose name starts with `agentbox` (case-insensitive). */\n snapshots: DaytonaSnapshotSummary[];\n /** Volumes whose name starts with `agentbox` (case-insensitive). */\n volumes: DaytonaVolumeSummary[];\n /** Non-fatal explanation when `configured` is false. */\n reason?: string;\n}\n\nfunction isAgentboxName(name: unknown): boolean {\n return typeof name === 'string' && name.toLowerCase().startsWith('agentbox');\n}\n\n/**\n * Collect a read-only summary of agentbox-owned snapshots + volumes on the\n * Daytona org. Never throws — failure paths return `configured: false` with\n * a one-line reason.\n */\nexport async function getDaytonaStatus(): Promise<DaytonaStatus> {\n try {\n ensureDaytonaEnvLoaded();\n } catch (err) {\n return {\n configured: false,\n snapshots: [],\n volumes: [],\n reason: err instanceof Error ? err.message : String(err),\n };\n }\n\n let client;\n try {\n client = getClient();\n } catch (err) {\n return {\n configured: false,\n snapshots: [],\n volumes: [],\n reason: err instanceof Error ? err.message.split('\\n')[0] : String(err),\n };\n }\n\n const snapshots: DaytonaSnapshotSummary[] = [];\n const volumes: DaytonaVolumeSummary[] = [];\n let reason: string | undefined;\n\n try {\n const list = await client.snapshot.list();\n const items = (list as { items?: unknown[] }).items ?? (Array.isArray(list) ? list : []);\n for (const s of items) {\n const dto = s as { name?: unknown; state?: unknown; size?: unknown; createdAt?: unknown; errorReason?: unknown };\n if (!isAgentboxName(dto.name)) continue;\n snapshots.push({\n name: dto.name as string,\n state: typeof dto.state === 'string' ? dto.state : undefined,\n sizeGb: typeof dto.size === 'number' ? dto.size : undefined,\n createdAt: typeof dto.createdAt === 'string' ? dto.createdAt : undefined,\n errorReason: typeof dto.errorReason === 'string' ? dto.errorReason : undefined,\n });\n }\n } catch (err) {\n reason = `snapshot list failed: ${err instanceof Error ? err.message.split('\\n')[0] : String(err)}`;\n }\n\n try {\n const list = await client.volume.list();\n const items: unknown[] = Array.isArray(list)\n ? list\n : ((list as { items?: unknown[] }).items ?? []);\n for (const v of items) {\n const dto = v as { name?: unknown; id?: unknown; state?: unknown; createdAt?: unknown; lastUsedAt?: unknown };\n if (!isAgentboxName(dto.name)) continue;\n volumes.push({\n name: dto.name as string,\n id: typeof dto.id === 'string' ? dto.id : '',\n state: typeof dto.state === 'string' ? dto.state : undefined,\n createdAt: typeof dto.createdAt === 'string' ? dto.createdAt : undefined,\n lastUsedAt: typeof dto.lastUsedAt === 'string' ? dto.lastUsedAt : undefined,\n });\n }\n } catch (err) {\n const msg = `volume list failed: ${err instanceof Error ? err.message.split('\\n')[0] : String(err)}`;\n reason = reason ? `${reason}; ${msg}` : msg;\n }\n\n return {\n configured: true,\n snapshots: snapshots.sort((a, b) => (b.createdAt ?? '').localeCompare(a.createdAt ?? '')),\n volumes: volumes.sort((a, b) => a.name.localeCompare(b.name)),\n reason,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACsBA,SAAS,cAAc,aAAa,cAAc,QAAQ,qBAAqB;AAC/E,SAAS,cAAc;AACvB,SAAS,SAAS,YAAY;AAC9B,SAAS,aAAa;AAyBf,SAAS,oBAAoB,aAA4B,SAA0B;AAGxF,QAAM,SAAS,UAAU,IAAI,OAAO,KAAK;AACzC,MAAI,YAAa,QAAO,iBAAiB,YAAY,MAAM,GAAG,EAAE,CAAC,GAA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,UAAuB,EAAE,OAAO,eAAe,QAAQ,MAAM,QAAQ,aAAa;AACxF,UAAM,UACJ,OAAO,UAAU,SAAS,IACtB;MACE,OAAO;MACP,QAAQ;MACR,QAAQ,GAAG,OAAO,OAAO,UAAU,MAAM,CAAC;IAC5C,IACA;MACE,OAAO;MACP,QAAQ;MACR,QAAQ;MACR,MAAM;IACR;AACN,WAAO,CAAC,SAAS,OAAO;EAC1B,SAAS,KAAK;AACZ,WAAO,CAAC,EAAE,OAAO,eAAe,QAAQ,QAAQ,QAAQ,WAAW,GAAG,EAAE,CAAC;EAC3E;AACF;AFhCA,IAAM,gBAAgB,oBAAoB,gBAAgB;EACxD,kBAAkB,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,EAAE;AACjD,CAAC;AAEM,IAAM,kBAA4B;EACvC,GAAG;EACH,SAAS;EACT,iBAAiB,MAAM,kCAAkC;AAC3D;AAGO,IAAM,iBAAiC;EAC5C,UAAU;EACV,SAAS;EACT,mBAAmB;EACnB,gBAAgB;EAChB,gBAAgB;EAChB,4BAA4B,CAAC,kBAAkB,kCAAkC,aAAa;EAC9F;AACF;","names":[]}
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
unregisterProject,
|
|
42
42
|
unsetConfigValue,
|
|
43
43
|
workspaceConfigFile
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-UIRBYL4G.js";
|
|
45
45
|
import "./chunk-WJFZJZIM.js";
|
|
46
46
|
export {
|
|
47
47
|
BUILT_IN_DEFAULTS,
|
|
@@ -86,4 +86,4 @@ export {
|
|
|
86
86
|
unsetConfigValue,
|
|
87
87
|
workspaceConfigFile
|
|
88
88
|
};
|
|
89
|
-
//# sourceMappingURL=dist-
|
|
89
|
+
//# sourceMappingURL=dist-T5MXBZGP.js.map
|
|
@@ -34,11 +34,11 @@ import {
|
|
|
34
34
|
vercelBackend,
|
|
35
35
|
vercelProvider,
|
|
36
36
|
writePreparedState
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
37
|
+
} from "./chunk-K2EDQGZP.js";
|
|
38
|
+
import "./chunk-6U2S6QWD.js";
|
|
39
|
+
import "./chunk-I654PBHA.js";
|
|
40
|
+
import "./chunk-UIRBYL4G.js";
|
|
41
|
+
import "./chunk-DEDTPG2D.js";
|
|
42
42
|
import "./chunk-G3H2L3O2.js";
|
|
43
43
|
import "./chunk-WJFZJZIM.js";
|
|
44
44
|
export {
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
vercelProvider,
|
|
78
78
|
writePreparedState
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=dist-
|
|
80
|
+
//# sourceMappingURL=dist-Z7KEPQC7.js.map
|