@madarco/agentbox 0.25.1 → 0.26.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 +36 -0
- package/README.md +8 -7
- package/dist/{_cloud-attach-FGMI2ZHO.js → _cloud-attach-7WRQH6XZ.js} +5 -5
- package/dist/{chunk-5VNL6SHJ.js → chunk-7ZZAZPYX.js} +3 -3
- package/dist/{chunk-ZTSVY3YL.js → chunk-BA2VLJVU.js} +3 -3
- package/dist/{chunk-3BR63LCB.js → chunk-DJQMK4RN.js} +12 -4
- package/dist/chunk-DJQMK4RN.js.map +1 -0
- package/dist/{chunk-6GZK74GT.js → chunk-DQHMDDAT.js} +2 -2
- package/dist/{chunk-P5U6AP6K.js → chunk-I2OAJS3L.js} +40 -377
- package/dist/{chunk-P5U6AP6K.js.map → chunk-I2OAJS3L.js.map} +1 -1
- package/dist/{chunk-5F5SOSDY.js → chunk-JGZSA5ZI.js} +72 -23
- package/dist/chunk-JGZSA5ZI.js.map +1 -0
- package/dist/{chunk-67VF2QZC.js → chunk-K5KOLYIL.js} +3 -3
- package/dist/{chunk-4LS2TOF3.js → chunk-PK2QF4IR.js} +569 -195
- package/dist/chunk-PK2QF4IR.js.map +1 -0
- package/dist/{chunk-3PSRBK24.js → chunk-UIFL7F2G.js} +54 -37
- package/dist/chunk-UIFL7F2G.js.map +1 -0
- package/dist/{chunk-4DBLYT2F.js → chunk-ZY7M7MXH.js} +41 -16
- package/dist/chunk-ZY7M7MXH.js.map +1 -0
- package/dist/chunk-ZYKNSHOH.js +259 -0
- package/dist/chunk-ZYKNSHOH.js.map +1 -0
- package/dist/{dist-X7R2EMJL.js → dist-5IICYSR6.js} +42 -374
- package/dist/{dist-X7R2EMJL.js.map → dist-5IICYSR6.js.map} +1 -1
- package/dist/{dist-5G42NFOG.js → dist-AR5CHRSV.js} +86 -45
- package/dist/{dist-5G42NFOG.js.map → dist-AR5CHRSV.js.map} +1 -1
- package/dist/{dist-AZUD2LUA.js → dist-DTNYMBQ5.js} +12 -12
- package/dist/{dist-MEK44IS5.js → dist-K4LNH3EC.js} +6 -6
- package/dist/{dist-SN6ABGMD.js → dist-POVRY7HO.js} +8 -4
- package/dist/{dist-SBDYDH7H.js → dist-U2SVLJUQ.js} +4 -2
- package/dist/{dist-4I7XHDC3.js → dist-XYY6SIKG.js} +6 -6
- package/dist/dist-YA7EXBGG.js +809 -0
- package/dist/dist-YA7EXBGG.js.map +1 -0
- package/dist/index.js +962 -583
- package/dist/index.js.map +1 -1
- package/dist/{prepared-state-75DIZ55S-5UAKJX3L.js → prepared-state-75DIZ55S-W6NU3S3B.js} +2 -2
- package/package.json +5 -4
- package/runtime/_shared/ctl.cjs +83 -36
- package/runtime/digitalocean/ctl.cjs +83 -36
- package/runtime/docker/packages/ctl/dist/bin.cjs +83 -36
- package/runtime/e2b/ctl.cjs +83 -36
- package/runtime/hetzner/ctl.cjs +83 -36
- 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/(auth)/api/auth/[...all]/route.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js.nft.json +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/0-fj_better-auth_dist_adapters_kysely-adapter_index_mjs_0btft52._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +5 -5
- 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]__1-9g0ae._.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]__19pc87s._.js → [root-of-the-server]__1k8g143._.js} +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qa4a0v._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_0760z6y._.js +4 -4
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_0xy-j7z._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_010858m.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_04zwxnx.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_06exuc7.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2ldrt.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2tzep.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_116nh32.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_11dyjcb.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_1_4knli.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__08-1wwu._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0c9mbcn._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0gdfxj4._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0kc-hwp._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0lu73p6._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__10bfmwi._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__18qvdzb._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1l2urlw._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ro6vh6._.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/{auth-MVL4NCQC.js → auth-DC44GQZY.js} +2 -2
- package/runtime/hub/apps/hub/{auth-config-GRIXACTV.js → auth-config-LALRDYDO.js} +2 -2
- package/runtime/hub/apps/hub/{chunk-JLG5JJXD.js → chunk-3FJNKSNZ.js} +1 -1
- package/runtime/hub/apps/hub/{chunk-RSENJ2FT.js → chunk-4QY2VZCF.js} +502 -132
- package/runtime/hub/apps/hub/{chunk-23AU7VYS.js → chunk-BARD2DI6.js} +11 -3
- package/runtime/hub/apps/hub/{chunk-V3OMPMI3.js → chunk-QSMPSV5Z.js} +70 -21
- package/runtime/hub/apps/hub/{chunk-GARA7RQW.js → chunk-XZZXPEVV.js} +57 -36
- package/runtime/hub/apps/hub/{dist-WZKTIA2R.js → dist-3ENKQN5G.js} +35 -365
- package/runtime/hub/apps/hub/{dist-TP4SXMDY.js → dist-6VGJOQYK.js} +84 -43
- package/runtime/hub/apps/hub/{dist-JVU3QCLG.js → dist-AE6IV4FV.js} +4 -4
- package/runtime/hub/apps/hub/{dist-IZ2JCN5R.js → dist-EQV4L7KP.js} +3 -1
- package/runtime/hub/apps/hub/dist-NNBELNA7.js +1017 -0
- package/runtime/hub/apps/hub/{dist-DZGSA3US.js → dist-RJJ2SDYO.js} +4 -4
- package/runtime/hub/apps/hub/{dist-VWSHZIPN.js → dist-TU7D6UTB.js} +37 -366
- package/runtime/hub/apps/hub/{dist-YWY2DSSL.js → dist-WAZKGVYL.js} +7 -3
- package/runtime/hub/apps/hub/{hub-token-BJG6Q5II.js → hub-token-COBZGSLS.js} +2 -2
- package/runtime/hub/apps/hub/package.json +1 -0
- package/runtime/hub/apps/hub/{prepared-state-75DIZ55S-JDILR4OP.js → prepared-state-75DIZ55S-NYEDSU2U.js} +1 -1
- package/runtime/hub/apps/hub/server.js +20 -16
- package/runtime/relay/bin.cjs +57 -20
- package/runtime/vercel/ctl.cjs +83 -36
- package/dist/chunk-3BR63LCB.js.map +0 -1
- package/dist/chunk-3PSRBK24.js.map +0 -1
- package/dist/chunk-4DBLYT2F.js.map +0 -1
- package/dist/chunk-4LS2TOF3.js.map +0 -1
- package/dist/chunk-5F5SOSDY.js.map +0 -1
- package/runtime/hub/apps/hub/.next/server/chunks/0zhp_better-auth_dist_adapters_kysely-adapter_index_mjs_1rl4qnh._.js +0 -3
- /package/dist/{_cloud-attach-FGMI2ZHO.js.map → _cloud-attach-7WRQH6XZ.js.map} +0 -0
- /package/dist/{chunk-5VNL6SHJ.js.map → chunk-7ZZAZPYX.js.map} +0 -0
- /package/dist/{chunk-ZTSVY3YL.js.map → chunk-BA2VLJVU.js.map} +0 -0
- /package/dist/{chunk-6GZK74GT.js.map → chunk-DQHMDDAT.js.map} +0 -0
- /package/dist/{chunk-67VF2QZC.js.map → chunk-K5KOLYIL.js.map} +0 -0
- /package/dist/{dist-4I7XHDC3.js.map → dist-DTNYMBQ5.js.map} +0 -0
- /package/dist/{dist-MEK44IS5.js.map → dist-K4LNH3EC.js.map} +0 -0
- /package/dist/{dist-AZUD2LUA.js.map → dist-POVRY7HO.js.map} +0 -0
- /package/dist/{dist-SBDYDH7H.js.map → dist-U2SVLJUQ.js.map} +0 -0
- /package/dist/{dist-SN6ABGMD.js.map → dist-XYY6SIKG.js.map} +0 -0
- /package/dist/{prepared-state-75DIZ55S-5UAKJX3L.js.map → prepared-state-75DIZ55S-W6NU3S3B.js.map} +0 -0
- /package/runtime/hub/apps/hub/.next/static/{fo5EgsHa6PFLTBagfLiuM → mrhWWwzD3oh05le9SRnlA}/_buildManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{fo5EgsHa6PFLTBagfLiuM → mrhWWwzD3oh05le9SRnlA}/_clientMiddlewareManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{fo5EgsHa6PFLTBagfLiuM → mrhWWwzD3oh05le9SRnlA}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../packages/sandbox-remote-docker/src/index.ts","../../../packages/sandbox-remote-docker/src/backend.ts","../../../packages/sandbox-remote-docker/src/image.ts","../../../packages/sandbox-remote-docker/src/build-attach.ts","../../../packages/sandbox-remote-docker/src/box-ssh.ts","../../../packages/sandbox-remote-docker/src/prepare.ts","../../../packages/sandbox-remote-docker/src/provider-module.ts"],"sourcesContent":["/**\n * The remote-docker provider: `createCloudProvider(remoteDockerBackend)` plus\n * the four things the scaffold can't supply.\n *\n * - `buildAttach` — the scaffold's SSH attach lands on the machine, not in\n * the container; ours wraps the inner command in a `docker exec`.\n * - `checkpoint` — `docker commit` on the engine that runs the box, with the\n * host carried in the snapshot name (see `parseSnapshotName`).\n * - `prepare` — bake the box image on a remote engine.\n * - `baseFingerprint` — the docker build-context sha, so the CLI's\n * \"your base is stale\" nag works the same way it does locally.\n */\n\nimport type { BoxRecord, Provider, ProviderCheckpoint } from '@agentbox/core';\nimport {\n createCloudProvider,\n currentCloudBaseFingerprint,\n listCloudCheckpoints,\n removeCloudCheckpointDir,\n resolveCloudCheckpoint,\n writeCloudCheckpointManifest,\n} from '@agentbox/sandbox-cloud';\nimport { hashProjectPath, sanitizeMnemonic } from '@agentbox/config';\nimport { readCliStamp, type ProviderModule } from '@agentbox/sandbox-core';\nimport { basename } from 'node:path';\nimport { BACKEND_NAME, makeSnapshotName, remoteDockerBackend } from './backend.js';\nimport { buildRemoteDockerAttach } from './build-attach.js';\nimport { resolveBoxSshTarget } from './box-ssh.js';\nimport { currentContextSha } from './image.js';\nimport { prepareRemoteDocker } from './prepare.js';\nimport { parseSandboxId } from './target.js';\nimport { doctorChecks } from './provider-module.js';\n\nconst cloudProvider = createCloudProvider(remoteDockerBackend, {\n // Empty on purpose. The cloud default (2 cpu / 4 GB) would silently cap a box\n // on a 32-core workstation; a remote engine is the user's own machine, so a\n // box is unlimited unless `--size` says otherwise — the same deal the local\n // docker provider offers.\n defaultResources: {},\n launchDockerd: true,\n});\n\n/** The docker image a checkpoint commits to on the remote engine. */\nfunction checkpointImageRef(projectRoot: string, name: string): string {\n const mnemonic = sanitizeMnemonic(basename(projectRoot));\n return `agentbox-ckpt-${hashProjectPath(projectRoot)}_${mnemonic}:${name}`;\n}\n\nconst remoteDockerCheckpoint: ProviderCheckpoint = {\n async create(box: BoxRecord, name: string) {\n if (!box.projectRoot) {\n throw new Error(\n 'checkpoint requires the box to have a project root (run `agentbox checkpoint` from inside the project)',\n );\n }\n const sandboxId = box.cloud?.sandboxId;\n if (!sandboxId) {\n throw new Error(`remote-docker box ${box.name} has no sandboxId — record is malformed`);\n }\n const { target } = parseSandboxId(sandboxId);\n const snapshotName = makeSnapshotName(target.spec, checkpointImageRef(box.projectRoot, name));\n await remoteDockerBackend.createSnapshot?.({ sandboxId }, snapshotName);\n\n const info = await writeCloudCheckpointManifest(box.projectRoot, BACKEND_NAME, name, {\n snapshotName,\n sourceBoxId: box.id,\n sourceBoxName: box.name,\n baseProvider: BACKEND_NAME,\n baseFingerprint: currentCloudBaseFingerprint(BACKEND_NAME),\n cliVersion: readCliStamp().cliVersion,\n });\n return { ref: info.name };\n },\n\n async list(projectRoot: string) {\n const entries = await listCloudCheckpoints(projectRoot, BACKEND_NAME);\n return entries.map((e) => ({ ref: e.name, createdAt: e.manifest.createdAt }));\n },\n\n async remove(projectRoot: string, ref: string) {\n const entry = await resolveCloudCheckpoint(projectRoot, BACKEND_NAME, ref);\n if (!entry) return;\n await remoteDockerBackend.deleteSnapshot?.(entry.manifest.snapshotName);\n await removeCloudCheckpointDir(projectRoot, BACKEND_NAME, ref);\n },\n};\n\nexport const remoteDockerProvider: Provider = {\n ...cloudProvider,\n buildAttach: buildRemoteDockerAttach,\n // The box's own sshd, reached by jumping through the engine — see box-ssh.ts.\n // Supplying this is what lets `open` / `code` / `connect` treat a remote-docker\n // box like any other SSH-capable box, without the scaffold having to guess a\n // target out of an attach argv that points at the engine rather than the box.\n sshTarget: resolveBoxSshTarget,\n checkpoint: remoteDockerCheckpoint,\n prepare: prepareRemoteDocker,\n baseFingerprint: async (claudeInstall) => (await currentContextSha(claudeInstall)) ?? undefined,\n};\n\n/** Uniform surface the CLI provider loader resolves this package through. */\nexport const providerModule: ProviderModule = {\n provider: remoteDockerProvider,\n backend: remoteDockerBackend,\n currentBaseFingerprintLive: async (claudeInstall) =>\n (await currentContextSha(claudeInstall)) ?? undefined,\n doctorChecks,\n};\n\nexport { remoteDockerBackend, BACKEND_NAME, listOnHost } from './backend.js';\nexport { probeRemoteEngine } from './remote-docker.js';\nexport { parseRemoteTarget, parseSandboxId } from './target.js';\n","/**\n * `remoteDockerBackend` — a `CloudBackend` whose \"sandbox\" is a container on a\n * remote machine's Docker engine, reached over one SSH ControlMaster per box.\n *\n * It is a cloud backend, not a second docker provider, and that is the whole\n * design. The docker provider's core mechanism — bind-mounting the host's\n * `.git/` into the container so in-box commits land in the host repo with zero\n * sync — cannot cross a network. Everything that follows from that (the ctl\n * unix socket on a host path, `-p 127.0.0.1:…` on the *local* loopback,\n * `host.docker.internal` reaching the laptop's relay) is equally local-only.\n *\n * The cloud scaffold already solved all of it: `seedCloudWorkspace` syncs the\n * workspace as a shallow clone + carried-over stash/untracked, the in-box relay\n * on :8788 is long-polled by the host `CloudBoxPoller`, and `git push` travels\n * back as a bundle. So we implement the ~14 `CloudBackend` primitives in terms\n * of `docker` over SSH and inherit the rest.\n *\n * What stays docker-shaped: the image (a real Dockerfile build), checkpoints\n * (`docker commit`), nested containers (DinD, same caps as the local provider),\n * and pause (`docker pause`, a true freeze rather than a snapshot).\n */\n\nimport { createReadStream, createWriteStream } from 'node:fs';\nimport { mkdir } from 'node:fs/promises';\nimport { dirname } from 'node:path';\nimport type {\n CloudBackend,\n CloudExecOptions,\n CloudExecResult,\n CloudFileEntry,\n CloudHandle,\n CloudPreviewUrl,\n CloudProvisionRequest,\n CloudSandboxSummary,\n CloudState,\n} from '@agentbox/core';\nimport { loadEffectiveConfig } from '@agentbox/config';\nimport { CLOUD_VNC_PORT, CLOUD_WEB_PROXY_PORT, bashScript } from '@agentbox/sandbox-cloud';\nimport { readState, sshExec, type SshTargetArgs } from '@agentbox/sandbox-core';\nimport { ensureRemoteImage } from './image.js';\nimport {\n CONTAINER_USER,\n dockerExecArgv,\n dockerOnRemote,\n dockerOnRemoteOrThrow,\n ensureTunnel,\n pipeFileFromContainer,\n pipeFileIntoContainer,\n refreshTunnel,\n tunnels,\n} from './remote-docker.js';\nimport {\n containerNameFor,\n makeSandboxId,\n parseRemoteTarget,\n parseSandboxId,\n type RemoteTarget,\n} from './target.js';\n\nexport const BACKEND_NAME = 'remote-docker';\n\n/**\n * A checkpoint is a `docker commit` on ONE engine — the image never leaves it —\n * so the snapshot name has to carry the host as well as the image ref:\n *\n * \"<ssh-destination>#<docker-image-ref>\"\n * e.g. \"dev@10.0.0.9:2222#agentbox-ckpt-9f2a_myrepo:setup\"\n *\n * `deleteSnapshot` and `snapshotExists` are handed nothing but this string (no\n * `CloudHandle`), so without the host they could not find the image at all. It\n * cannot go in the docker ref itself: a ref admits neither `@` nor `:` outside\n * the tag, and an ssh destination is full of both. `#` never appears in either\n * half, so it is an unambiguous separator.\n *\n * Nothing outside this package interprets the string — the `CloudBackend`\n * contract treats it as opaque, round-tripping it from `createSnapshot` through\n * the manifest to `provision({ snapshot })`.\n */\nconst SNAPSHOT_SEP = '#';\n\nexport interface ParsedSnapshot {\n host: string;\n imageRef: string;\n}\n\nexport function makeSnapshotName(host: string, imageRef: string): string {\n return `${host}${SNAPSHOT_SEP}${imageRef}`;\n}\n\nexport function parseSnapshotName(snapshotName: string): ParsedSnapshot {\n const sep = snapshotName.indexOf(SNAPSHOT_SEP);\n if (sep <= 0 || sep === snapshotName.length - 1) {\n throw new Error(\n `remote-docker: malformed snapshot name \"${snapshotName}\" — expected \"<ssh-destination>#<image-ref>\"`,\n );\n }\n return {\n host: snapshotName.slice(0, sep),\n imageRef: snapshotName.slice(sep + 1),\n };\n}\n\n/**\n * Tunnel id for a host-scoped (rather than box-scoped) connection — the image\n * ops, which act on an engine rather than a container.\n */\nfunction snapshotTunnelId(host: string): string {\n return `engine:${host}`;\n}\n\n/** In-box relay port the host CloudBoxPoller long-polls (`/bridge/*`). */\nconst BRIDGE_PORT = 8788;\n/** The box image's always-on sshd — published so `agentbox open` / `code` work. */\nconst SSH_PORT = 22;\n\n/**\n * Ports published at `docker run`. Docker port mappings are immutable for the\n * life of a container (the same constraint Vercel has), so everything the host\n * may ever need to reach must be listed at create: the WebProxy, noVNC, the\n * bridge, sshd, plus whatever `agentbox.yaml` exposes.\n */\nfunction portsToPublish(exposePorts: number[] | undefined): number[] {\n const base = [CLOUD_WEB_PROXY_PORT, CLOUD_VNC_PORT, BRIDGE_PORT, SSH_PORT];\n return [...new Set([...base, ...(exposePorts ?? [])])];\n}\n\ninterface Ctx {\n target: SshTargetArgs;\n remote: RemoteTarget;\n container: string;\n}\n\n/**\n * Is the remote engine itself running inside an AgentBox sandbox? Only true in\n * the agentbox-in-agentbox dev loop this repo is developed with (CLAUDE.md ->\n * \"Use Agentbox inside Agentbox\"), where the nested dockerd lacks the\n * capabilities a normal engine has. `/etc/agentbox/box.env` is written into\n * every box by the create path, so its presence is the box's own identity file.\n */\nasync function remoteIsNested(target: SshTargetArgs): Promise<boolean> {\n const res = await sshExec(target, 'test -f /etc/agentbox/box.env');\n return res.exitCode === 0;\n}\n\n/** Resolve a handle into a live SSH connection + the container it names. */\nasync function ctxFor(h: CloudHandle): Promise<Ctx> {\n const { target: remote, container } = parseSandboxId(h.sandboxId);\n const target = await ensureTunnel(h.sandboxId, remote);\n return { target, remote, container };\n}\n\n/** `docker inspect` state string -> the provider-neutral CloudState. */\nexport function mapDockerState(status: string): CloudState {\n switch (status.trim()) {\n case 'running':\n return 'running';\n case 'paused':\n return 'paused';\n case 'created':\n case 'exited':\n case 'dead':\n case 'restarting':\n case 'removing':\n return 'stopped';\n default:\n return 'missing';\n }\n}\n\n/**\n * `docker port <c> <p>` -> the ephemeral port docker bound on the remote's\n * loopback. Its output is `127.0.0.1:49153` (possibly several lines, one per\n * binding); we take the first with a port.\n */\nexport function parseDockerPort(stdout: string): number | null {\n for (const line of stdout.split(/\\r?\\n/)) {\n const m = /:(\\d+)\\s*$/.exec(line.trim());\n if (m?.[1]) {\n const port = Number.parseInt(m[1], 10);\n if (Number.isFinite(port) && port > 0) return port;\n }\n }\n return null;\n}\n\n/** Parse `--size` as `cpu-memory` GB (e2b's spec shape). */\nexport function parseSize(size: string | undefined): { cpu?: number; memory?: number } {\n if (!size) return {};\n const m = /^(\\d+)(?:-(\\d+))?$/.exec(size.trim());\n if (!m?.[1]) return {};\n const cpu = Number.parseInt(m[1], 10);\n const memory = m[2] ? Number.parseInt(m[2], 10) : undefined;\n return { cpu, ...(memory !== undefined ? { memory } : {}) };\n}\n\n/**\n * The `docker run` argv for a box. Mirrors the local provider's `runBox` flags\n * — the cap/security/cgroup set is what makes the in-box dockerd work, and the\n * two must not drift.\n */\nexport function buildRunArgv(opts: {\n container: string;\n image: string;\n env: Record<string, string>;\n ports: number[];\n dockerVolume: string;\n cpu?: number;\n memory?: number;\n /** The remote engine is itself inside an AgentBox sandbox — see `remoteIsNested`. */\n nestedEngine?: boolean;\n}): string[] {\n const argv = [\n 'run',\n '-d',\n '--name',\n opts.container,\n '--hostname',\n opts.container,\n // The in-box dockerd needs these: SYS_ADMIN to `mount -t overlay` for\n // overlay2, NET_ADMIN for its bridge + iptables NAT, /dev/fuse +\n // apparmor:unconfined for the fuse-overlayfs fallback, seccomp:unconfined\n // because the default profile blocks syscalls nested containers need, and a\n // private cgroup namespace so runc can create its own slice. Same set as\n // the local docker provider; we still avoid --privileged.\n '--cap-add=SYS_ADMIN',\n '--cap-add=NET_ADMIN',\n '--device=/dev/fuse',\n '--security-opt=apparmor:unconfined',\n '--security-opt=seccomp=unconfined',\n '--cgroupns=private',\n ];\n if (opts.nestedEngine) {\n // The engine is itself inside an AgentBox sandbox, which has no\n // CAP_SYS_PTRACE. Its dockerd therefore cannot bind-mount /proc/<pid>/ns/net\n // for a container whose init runs as a different uid than the daemon —\n // and the box image's default USER is vscode (1000), so `docker run` dies\n // with \"bind-mount /proc/N/ns/net: permission denied\". Forcing init to uid 0\n // makes its /proc readable by the daemon and netns setup succeeds.\n //\n // The local docker provider does the same thing (see `runBox`), but keys it\n // off ITS OWN `AGENTBOX=1`. Here that would be the wrong signal: the CLI can\n // run inside a box while the engine sits on a real machine that has no such\n // limitation. What matters is whether the ENGINE is nested, so we ask it.\n argv.push('--user', '0');\n }\n if (opts.cpu) argv.push('--cpus', String(opts.cpu));\n if (opts.memory) argv.push('--memory', `${String(opts.memory)}g`);\n // /var/lib/docker on a volume, not the container layer: without it, every\n // image the agent pulls inside the box would be captured by `docker commit`\n // and bloat each checkpoint.\n argv.push('-v', `${opts.dockerVolume}:/var/lib/docker`);\n for (const port of opts.ports) {\n // Bind the REMOTE's loopback only: the box is reached through the SSH\n // tunnel, so there is no reason to expose it on the remote's LAN.\n argv.push('-p', `127.0.0.1:0:${String(port)}`);\n }\n for (const [k, v] of Object.entries(opts.env)) {\n argv.push('-e', `${k}=${v}`);\n }\n argv.push(opts.image, 'sleep', 'infinity');\n return argv;\n}\n\nexport const remoteDockerBackend: CloudBackend = {\n name: BACKEND_NAME,\n\n async provision(req: CloudProvisionRequest): Promise<CloudHandle> {\n const log = req.onLog ?? ((): void => {});\n // The SSH destination is resolved by the CLI (`docker:<host>` /\n // --remote-host / box.remoteDockerHost) and threaded through providerOptions.\n const spec = (req.host ?? '').trim();\n if (!spec) {\n throw new Error(\n 'remote-docker: no SSH destination. Use `agentbox docker:<host> …`, `--remote-host <host>`, or set `box.remoteDockerHost`.',\n );\n }\n const remote = parseRemoteTarget(spec);\n const container = containerNameFor(req.name);\n const sandboxId = makeSandboxId(remote.spec, container);\n const target = await ensureTunnel(sandboxId, remote);\n\n // A checkpoint is a `docker commit`ed image on THIS engine; otherwise ensure\n // the fingerprint-tagged base image is present (pull, else build).\n let image: string;\n if (req.snapshot) {\n const snap = parseSnapshotName(req.snapshot);\n // A checkpoint cannot follow you to another machine: the image lives on\n // the engine that committed it. Read as \"gone\" rather than erroring, so\n // the scaffold prunes the dangling manifest and builds a fresh box.\n if (snap.host !== remote.spec) {\n throw new Error(\n `snapshot expired or deleted: it was captured on ${snap.host}, not ${remote.spec} (a remote-docker checkpoint is local to its engine)`,\n );\n }\n image = snap.imageRef;\n const probe = await dockerOnRemote(target, ['image', 'inspect', image]);\n if (probe.exitCode !== 0) {\n // Same contract as the other clouds: a vanished snapshot must read as\n // \"gone\" so the scaffold prunes the manifest and re-provisions from base.\n throw new Error(`snapshot expired or deleted: ${image} is not on ${remote.spec}`);\n }\n } else {\n const ensured = await ensureRemoteImage(target, {\n imageRef: req.image && req.image !== 'agentbox/box:dev' ? req.image : undefined,\n onLog: log,\n });\n image = ensured.ref;\n }\n\n const { cpu, memory } = parseSize(req.size);\n const dockerVolume = `agentbox-docker-${container}`;\n await dockerOnRemoteOrThrow(target, ['volume', 'create', dockerVolume]);\n\n const nestedEngine = await remoteIsNested(target);\n if (nestedEngine) {\n log('[provision] remote engine is itself an AgentBox box — running the box init as root');\n }\n\n const argv = buildRunArgv({\n container,\n image,\n env: req.env ?? {},\n ports: portsToPublish(req.exposePorts),\n dockerVolume,\n nestedEngine,\n ...(cpu !== undefined ? { cpu } : {}),\n ...(memory !== undefined ? { memory } : {}),\n });\n log(`[provision] docker run ${container} on ${remote.spec}`);\n await dockerOnRemoteOrThrow(target, argv, { timeoutMs: 300_000 });\n\n return {\n sandboxId,\n resources: {\n ...(cpu !== undefined ? { cpu } : {}),\n ...(memory !== undefined ? { memory } : {}),\n },\n };\n },\n\n async get(sandboxId: string): Promise<CloudHandle | null> {\n let ctx: Ctx;\n try {\n ctx = await ctxFor({ sandboxId });\n } catch {\n return null;\n }\n const res = await dockerOnRemote(ctx.target, [\n 'inspect',\n '-f',\n '{{.State.Status}}',\n ctx.container,\n ]);\n return res.exitCode === 0 ? { sandboxId } : null;\n },\n\n /**\n * Every other cloud can ask its API \"what sandboxes exist?\". Here there is no\n * API and no registry of engines — a machine only becomes ours by being named\n * in a box record or in `box.remoteDockerHost`. So enumeration means: work out\n * which engines we have ever used, and ask each of them. An engine that has\n * gone away is skipped rather than fatal, since prune must still report on the\n * ones that answer.\n */\n async list(): Promise<CloudSandboxSummary[]> {\n const hosts = await knownHosts();\n const out: CloudSandboxSummary[] = [];\n for (const host of hosts) {\n try {\n out.push(...(await listOnHost(host)));\n } catch {\n // unreachable engine — nothing to report from it\n }\n }\n return out;\n },\n\n async start(h): Promise<void> {\n const ctx = await ctxFor(h);\n await dockerOnRemoteOrThrow(ctx.target, ['start', ctx.container], { timeoutMs: 120_000 });\n },\n\n async stop(h): Promise<void> {\n const ctx = await ctxFor(h);\n await dockerOnRemoteOrThrow(ctx.target, ['stop', ctx.container], { timeoutMs: 120_000 });\n },\n\n /**\n * A true freeze (SIGSTOP-equivalent via the freezer cgroup), not cold storage:\n * the container keeps its memory and its published ports, so resume is instant\n * and the forwarded ports stay valid.\n */\n async pause(h): Promise<void> {\n const ctx = await ctxFor(h);\n const state = await currentState(ctx);\n if (state !== 'running') return;\n await dockerOnRemoteOrThrow(ctx.target, ['pause', ctx.container]);\n },\n\n async resume(h): Promise<void> {\n const ctx = await ctxFor(h);\n const state = await currentState(ctx);\n if (state === 'paused') {\n await dockerOnRemoteOrThrow(ctx.target, ['unpause', ctx.container]);\n return;\n }\n if (state !== 'running') {\n await dockerOnRemoteOrThrow(ctx.target, ['start', ctx.container], { timeoutMs: 120_000 });\n }\n },\n\n async destroy(h): Promise<void> {\n const ctx = await ctxFor(h);\n // Idempotent: `rm -f` on a missing container is a no-op we tolerate, since\n // destroy must converge even after a partially-failed create.\n await dockerOnRemote(ctx.target, ['rm', '-f', ctx.container], { timeoutMs: 120_000 });\n await dockerOnRemote(ctx.target, ['volume', 'rm', '-f', `agentbox-docker-${ctx.container}`]);\n await tunnels.close(h.sandboxId);\n },\n\n async state(h): Promise<CloudState> {\n let ctx: Ctx;\n try {\n ctx = await ctxFor(h);\n } catch {\n // Unreachable host — the box may well be fine, but we cannot see it.\n return 'missing';\n }\n return currentState(ctx);\n },\n\n async exec(h, cmd: string, opts: CloudExecOptions = {}): Promise<CloudExecResult> {\n const ctx = await ctxFor(h);\n const argv = dockerExecArgv(ctx.container, cmd, {\n user: opts.user ?? CONTAINER_USER,\n ...(opts.cwd ? { cwd: opts.cwd } : {}),\n ...(opts.env ? { env: opts.env } : {}),\n });\n const res = await dockerOnRemote(ctx.target, argv, {\n timeoutMs: opts.attemptTimeoutMs ?? 300_000,\n });\n return { exitCode: res.exitCode, stdout: res.stdout, stderr: res.stderr };\n },\n\n async uploadFile(h, localPath: string, remotePath: string): Promise<void> {\n const ctx = await ctxFor(h);\n // The seed tars land in /tmp before an in-box extract; make sure the parent\n // exists, since `cat >` won't create it.\n await dockerOnRemote(\n ctx.target,\n dockerExecArgv(ctx.container, bashScript(`mkdir -p ${shellDir(remotePath)}`), {\n user: 'root',\n }),\n );\n await pipeFileIntoContainer(ctx.target, ctx.container, createReadStream(localPath), remotePath);\n },\n\n async downloadFile(h, remotePath: string, localPath: string): Promise<void> {\n const ctx = await ctxFor(h);\n await mkdir(dirname(localPath), { recursive: true });\n await pipeFileFromContainer(\n ctx.target,\n ctx.container,\n remotePath,\n createWriteStream(localPath),\n );\n },\n\n async listFiles(h, remoteDir: string): Promise<CloudFileEntry[]> {\n const ctx = await ctxFor(h);\n const res = await dockerOnRemote(\n ctx.target,\n dockerExecArgv(\n ctx.container,\n `find ${quote(remoteDir)} -mindepth 1 -maxdepth 1 -printf '%f\\\\t%y\\\\n'`,\n ),\n );\n if (res.exitCode !== 0) return [];\n const out: CloudFileEntry[] = [];\n for (const line of res.stdout.split(/\\r?\\n/)) {\n const [name, kind] = line.split('\\t');\n if (name) out.push({ name, isDir: kind === 'd' });\n }\n return out;\n },\n\n /**\n * The container's port is published on the REMOTE's loopback; we forward that\n * to a free local port over the box's ControlMaster. So the URL is always\n * `http://127.0.0.1:<local>` — reachable from the host browser and from the\n * host relay's poller alike.\n */\n async previewUrl(h, port: number): Promise<CloudPreviewUrl> {\n const ctx = await ctxFor(h);\n const remotePort = await publishedPort(ctx, port);\n const localPort = await tunnels.forward(h.sandboxId, remotePort);\n return { url: `http://127.0.0.1:${String(localPort)}` };\n },\n\n /** SSH is already the auth gate, so a \"signed\" URL is just the tunneled one. */\n async signedPreviewUrl(h, port: number): Promise<CloudPreviewUrl> {\n return remoteDockerBackend.previewUrl(h, port);\n },\n\n /**\n * The poller calls this when the local port stops answering — typically a\n * ControlMaster that died across a host sleep/wake. Re-open the master AND\n * re-read `docker port`: a container restart reassigns the remote's ephemeral\n * port, so a forward to the old one would connect to nothing.\n */\n async refreshPreviewUrl(h, port: number): Promise<CloudPreviewUrl> {\n const { target: remote } = parseSandboxId(h.sandboxId);\n await refreshTunnel(h.sandboxId, remote);\n return remoteDockerBackend.previewUrl(h, port);\n },\n\n async createSnapshot(h, snapshotName: string): Promise<void> {\n const ctx = await ctxFor(h);\n const snap = parseSnapshotName(snapshotName);\n await dockerOnRemoteOrThrow(ctx.target, ['commit', ctx.container, snap.imageRef], {\n timeoutMs: 600_000,\n });\n },\n\n async deleteSnapshot(snapshotName: string): Promise<void> {\n const snap = parseSnapshotName(snapshotName);\n try {\n const target = await ensureTunnel(snapshotTunnelId(snap.host), parseRemoteTarget(snap.host));\n await dockerOnRemote(target, ['image', 'rm', '-f', snap.imageRef]);\n } catch {\n // Unreachable host or already gone — best-effort, matching the other\n // clouds: the caller drops the local manifest either way.\n }\n },\n\n async snapshotExists(snapshotName: string): Promise<boolean> {\n let snap: ParsedSnapshot;\n try {\n snap = parseSnapshotName(snapshotName);\n } catch {\n return false;\n }\n try {\n const target = await ensureTunnel(snapshotTunnelId(snap.host), parseRemoteTarget(snap.host));\n const res = await dockerOnRemote(target, ['image', 'inspect', snap.imageRef]);\n return res.exitCode === 0;\n } catch {\n // Contract: must never throw. An unreachable engine reads as \"not\n // bootable\", which is the truth from here.\n return false;\n }\n },\n};\n\n/**\n * Engines this machine has used: every host named by a remote-docker box record,\n * plus the configured default. Deduped, order-stable.\n */\nasync function knownHosts(): Promise<string[]> {\n const hosts = new Set<string>();\n try {\n const state = await readState();\n for (const box of state.boxes) {\n if (box.provider !== BACKEND_NAME || !box.cloud?.sandboxId) continue;\n try {\n hosts.add(parseSandboxId(box.cloud.sandboxId).target.spec);\n } catch {\n // a malformed id names no engine we could ask\n }\n }\n } catch {\n // no state yet\n }\n try {\n const cfg = await loadEffectiveConfig(process.cwd());\n const dflt = (cfg.effective.box.remoteDockerHost || '').trim();\n if (dflt) hosts.add(dflt);\n } catch {\n // no config — the box records are all we have\n }\n return [...hosts];\n}\n\n/** List agentbox containers on one remote engine — the host-scoped `list()`. */\nexport async function listOnHost(spec: string): Promise<CloudSandboxSummary[]> {\n const remote = parseRemoteTarget(spec);\n const target = await ensureTunnel(`list:${remote.spec}`, remote);\n const res = await dockerOnRemote(target, [\n 'ps',\n '-a',\n '--filter',\n 'name=agentbox-',\n '--format',\n '{{.Names}}\\t{{.State}}\\t{{.CreatedAt}}',\n ]);\n if (res.exitCode !== 0) return [];\n const out: CloudSandboxSummary[] = [];\n for (const line of res.stdout.split(/\\r?\\n/)) {\n const [name, state, createdAt] = line.split('\\t');\n if (!name) continue;\n out.push({\n sandboxId: makeSandboxId(remote.spec, name),\n name,\n ...(createdAt ? { createdAt } : {}),\n state: mapDockerState(state ?? ''),\n });\n }\n return out;\n}\n\nasync function currentState(ctx: Ctx): Promise<CloudState> {\n const res = await dockerOnRemote(ctx.target, [\n 'inspect',\n '-f',\n '{{.State.Status}}',\n ctx.container,\n ]);\n if (res.exitCode !== 0) return 'missing';\n return mapDockerState(res.stdout);\n}\n\nasync function publishedPort(ctx: Ctx, containerPort: number): Promise<number> {\n const res = await dockerOnRemote(ctx.target, ['port', ctx.container, String(containerPort)]);\n const port = res.exitCode === 0 ? parseDockerPort(res.stdout) : null;\n if (port === null) {\n throw new Error(\n `remote-docker: container port ${String(containerPort)} is not published on ${ctx.container}. ` +\n 'Docker port mappings are fixed at create — a service exposed after the box was made is only ' +\n 'reachable through the :80 WebProxy until the box is recreated.',\n );\n }\n return port;\n}\n\nfunction shellDir(path: string): string {\n const slash = path.lastIndexOf('/');\n return quote(slash > 0 ? path.slice(0, slash) : '/');\n}\n\nfunction quote(s: string): string {\n return `'${s.replace(/'/g, \"'\\\\''\")}'`;\n}\n","/**\n * Getting the box image onto the remote engine.\n *\n * The image ref IS the build-context fingerprint: `agentbox/box:<sha16>`, the\n * same sha the local docker provider computes. That one decision removes a\n * whole class of state:\n *\n * - \"is this host prepared?\" == `docker image inspect agentbox/box:<sha>` on it.\n * No prepared-state file is consulted to decide, so it can't go stale or\n * disagree with reality, and it is naturally PER HOST (which a single\n * `~/.agentbox/remote-docker-prepared.json` could never be).\n * - a CLI upgrade that changes any baked file changes the sha, so the next\n * create ensures a new ref rather than silently running an old image.\n *\n * Ensure order: already present → pull the fingerprint-tagged image from GHCR\n * (published multi-arch, so an amd64 remote gets amd64 even though the laptop\n * is arm64) → stream the local build context to a remote `docker build -`.\n */\n\nimport { createReadStream } from 'node:fs';\nimport { rm } from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { execa } from 'execa';\nimport { quoteShellArgv } from '@agentbox/sandbox-cloud';\nimport {\n BOX_IMAGE_REGISTRY,\n BUILD_CONTEXT_DIR,\n computeDockerContextFingerprint,\n registryRefForSha,\n} from '@agentbox/sandbox-docker';\nimport {\n claudeInstallFingerprint,\n sshDestination,\n sshOptArgs,\n type SshTargetArgs,\n} from '@agentbox/sandbox-core';\nimport { dockerOnRemote, loginShell } from './remote-docker.js';\n\nexport type ClaudeInstall = 'native' | 'npm';\n\nexport interface EnsureRemoteImageOptions {\n /** Pin an explicit image ref on the remote (`box.imageRemoteDocker`); skips the ensure. */\n imageRef?: string;\n claudeInstall?: ClaudeInstall;\n /** Registry to pull from. Empty string disables the pull and forces a build. */\n registry?: string;\n /** Force the build path even on a registry hit (`--build`). */\n allowPull?: boolean;\n /** Rebuild even when the ref is already present on the remote. */\n force?: boolean;\n onLog?: (line: string) => void;\n}\n\nexport interface EnsureRemoteImageResult {\n ref: string;\n source: 'pinned' | 'present' | 'pulled' | 'built';\n /** The build-context fingerprint the ref encodes, when we derived it. */\n contextSha256?: string;\n}\n\n/** The image ref a given build-context fingerprint maps to on the remote. */\nexport function remoteImageRef(contextSha256: string): string {\n return `agentbox/box:${contextSha256.slice(0, 16)}`;\n}\n\n/**\n * Resolve the fingerprint of the build context this CLI would bake, folding in\n * the Claude install mode exactly as the docker provider does (so an npm-baked\n * image and a native-baked one are different refs, not the same ref with\n * different contents). Null when the context can't be resolved — a dev tree\n * without `pnpm -w build`.\n */\nexport async function currentContextSha(claudeInstall?: ClaudeInstall): Promise<string | null> {\n const fp = await computeDockerContextFingerprint({});\n if (!fp) return null;\n return claudeInstall\n ? claudeInstallFingerprint(fp.contextSha256, claudeInstall)\n : fp.contextSha256;\n}\n\n/**\n * Make the box image present on the remote engine. Idempotent and cheap on the\n * hot path: a single `docker image inspect` when it's already there.\n */\nexport async function ensureRemoteImage(\n target: SshTargetArgs,\n opts: EnsureRemoteImageOptions = {},\n): Promise<EnsureRemoteImageResult> {\n const log = opts.onLog ?? ((): void => {});\n\n // An explicitly pinned ref is the user's problem to keep present — we neither\n // pull nor build it, because we have no idea what it contains.\n if (opts.imageRef && opts.imageRef.trim().length > 0) {\n const ref = opts.imageRef.trim();\n const probe = await dockerOnRemote(target, ['image', 'inspect', ref]);\n if (probe.exitCode !== 0) {\n throw new Error(\n `remote-docker: box.imageRemoteDocker pins \"${ref}\", which is not present on the remote engine. ` +\n `Build/pull it there, or unset the key to let AgentBox manage the image.`,\n );\n }\n return { ref, source: 'pinned' };\n }\n\n const sha = await currentContextSha(opts.claudeInstall);\n if (!sha) {\n throw new Error(\n 'remote-docker: cannot resolve the box build context (a dev tree needs `pnpm -w build` first)',\n );\n }\n const ref = remoteImageRef(sha);\n\n if (!opts.force) {\n const probe = await dockerOnRemote(target, ['image', 'inspect', ref]);\n if (probe.exitCode === 0) {\n log(`[image] ${ref} already present on the remote`);\n return { ref, source: 'present', contextSha256: sha };\n }\n }\n\n const registry = opts.registry ?? BOX_IMAGE_REGISTRY;\n if (opts.allowPull !== false && registry) {\n const remote = registryRefForSha(sha, registry);\n log(`[image] pulling ${remote} on the remote engine`);\n const pull = await dockerOnRemote(target, ['pull', remote], {\n timeoutMs: 900_000,\n onLine: (l) => log(`[image] ${l}`),\n });\n if (pull.exitCode === 0) {\n await dockerOnRemote(target, ['tag', remote, ref]);\n log(`[image] pulled ${remote} -> ${ref}`);\n return { ref, source: 'pulled', contextSha256: sha };\n }\n log('[image] registry miss — building on the remote from the local context');\n }\n\n await buildOnRemote(target, ref, opts);\n return { ref, source: 'built', contextSha256: sha };\n}\n\n/**\n * Stream the local build context to `docker build -` on the remote.\n *\n * `docker build -` reads a tar of the context from stdin, so the whole build\n * happens on the remote engine with no files staged on its disk beforehand —\n * and no dependency on the remote having a checkout of anything.\n */\nasync function buildOnRemote(\n target: SshTargetArgs,\n ref: string,\n opts: EnsureRemoteImageOptions,\n): Promise<void> {\n const log = opts.onLog ?? ((): void => {});\n const tarPath = join(tmpdir(), `agentbox-box-ctx-${String(process.pid)}.tar`);\n try {\n // COPYFILE_DISABLE stops macOS tar from emitting ._* AppleDouble entries,\n // which would land in the image as junk files.\n await execa('tar', ['-C', BUILD_CONTEXT_DIR, '-cf', tarPath, '.'], {\n env: { ...process.env, COPYFILE_DISABLE: '1' },\n });\n\n const buildArgs = ['build', '-t', ref, '-f', 'Dockerfile.box'];\n if (opts.claudeInstall) {\n buildArgs.push('--build-arg', `AGENTBOX_CLAUDE_INSTALL=${opts.claudeInstall}`);\n }\n buildArgs.push('-');\n\n log(`[image] building ${ref} on the remote (streaming the build context)`);\n const res = await execa(\n 'ssh',\n [\n ...sshOptArgs(target),\n sshDestination(target),\n loginShell(`docker ${quoteShellArgv(buildArgs)}`),\n ],\n { reject: false, input: createReadStream(tarPath), stdout: 'pipe', stderr: 'pipe' },\n );\n const out = `${typeof res.stdout === 'string' ? res.stdout : ''}${typeof res.stderr === 'string' ? res.stderr : ''}`;\n for (const line of out.split(/\\r?\\n/)) {\n if (line.trim().length > 0) log(`[image] ${line}`);\n }\n if (res.exitCode !== 0) {\n throw new Error(\n `remote-docker: remote \\`docker build\\` failed (exit ${String(res.exitCode)}). See the build output above.`,\n );\n }\n log(`[image] built ${ref}`);\n } finally {\n await rm(tarPath, { force: true });\n }\n}\n","/**\n * `buildRemoteDockerAttach` — this provider's override of `Provider.buildAttach`.\n *\n * The cloud scaffold's default appends the inner command to the backend's\n * `attachArgv`, which for an SSH backend lands it on the *host* it connects to.\n * For hetzner that host IS the box. Here it is the machine running the engine —\n * the box is a container on it — so the inner command has to be wrapped in a\n * `docker exec` before it crosses the wire. Hence a full override (the same\n * pattern vercel and e2b use for their non-SSH attaches).\n *\n * The result is a plain `ssh … -t 'docker exec -it … bash -lc <tmux>'`, so the\n * CLI's PTY wrapper drives it exactly like any other provider's attach.\n */\n\nimport type { AttachKind, AttachSpec, BoxRecord, BuildAttachOptions } from '@agentbox/core';\nimport {\n hostTermForCloud,\n quoteShellArg,\n quoteShellArgv,\n renderInnerCommand,\n} from '@agentbox/sandbox-cloud';\nimport { sshDestination, sshOptArgs } from '@agentbox/sandbox-core';\nimport { ensureTunnel } from './remote-docker.js';\nimport { parseSandboxId } from './target.js';\n\nconst CONTAINER_USER = 'vscode';\n\nexport async function buildRemoteDockerAttach(\n box: BoxRecord,\n kind: AttachKind,\n opts: BuildAttachOptions = {},\n): Promise<AttachSpec> {\n const sandboxId = box.cloud?.sandboxId;\n if (!sandboxId) {\n throw new Error(`remote-docker box ${box.name} has no sandboxId — record is malformed`);\n }\n const { target: remote, container } = parseSandboxId(sandboxId);\n const target = await ensureTunnel(sandboxId, remote);\n\n // The tmux session bring-up + attach, identical to every other cloud box.\n const inner = renderInnerCommand(kind, opts);\n const dockerArgv = [\n 'exec',\n // `detached` only creates the session, so it needs no TTY — and asking for\n // one would make docker fail when the CLI runs it without a terminal.\n ...(opts.detached ? ['-i'] : ['-it']),\n '-u',\n opts.user ?? CONTAINER_USER,\n '-e',\n `TERM=${hostTermForCloud()}`,\n container,\n 'bash',\n '-lc',\n inner,\n ];\n const remoteCommand = `docker ${quoteShellArgv(dockerArgv)}`;\n\n const argv = [\n 'ssh',\n ...sshOptArgs(target),\n // -t forces TTY allocation through ssh; without it tmux and readline break.\n ...(opts.detached ? [] : ['-t']),\n sshDestination(target),\n // One argv element: ssh hands the string to the remote login shell, which\n // re-parses it — so the docker argv is quoted, not concatenated.\n remoteCommand,\n ];\n return { argv };\n}\n\n/** Exposed for the unit test — the quoting is the part worth pinning down. */\nexport const _internal = { quoteShellArg };\n","/**\n * Making the BOX (not the engine) reachable over SSH, so `agentbox open`\n * (sshfs), `agentbox code` (Remote-SSH) and `agentbox connect` work exactly as\n * they do for every other provider.\n *\n * The box is a container on someone else's machine, and its sshd is published\n * on THAT machine's loopback (`-p 127.0.0.1:0:22`). So there is no host:port a\n * local ssh could dial directly. The answer is `ProxyJump`: ssh connects to the\n * engine's machine, and the engine dials `127.0.0.1:<published port>` on our\n * behalf — which is precisely the address the box's sshd is listening on from\n * where the jump host stands.\n *\n * Host agentbox-<box>\n * HostName 127.0.0.1 # as resolved ON the jump host\n * Port <published>\n * User vscode\n * ProxyJump <engine> # the ssh destination the box lives on\n * IdentityFile ~/.agentbox/remote-docker/boxes/<id>/ssh/id_ed25519\n *\n * No `ssh -L` forward is involved: ssh's own transport does the hop, so the\n * alias keeps working in any process (VS Code, sshfs) without AgentBox having\n * to hold a tunnel open for it.\n *\n * The private key never leaves the host. The public half is installed into the\n * box's `authorized_keys` over the ControlMaster we already have.\n */\n\nimport type { BoxRecord, SshTargetRecord } from '@agentbox/core';\nimport { bashScript, quoteShellArg } from '@agentbox/sandbox-cloud';\nimport { defaultBoxSshDir, mintSshKey } from '@agentbox/sandbox-core';\nimport { CONTAINER_USER, dockerExecArgv, dockerOnRemote, ensureTunnel } from './remote-docker.js';\nimport { parseSandboxId } from './target.js';\nimport { parseDockerPort } from './backend.js';\n\n/** The box image's sshd listens here; we publish it on the engine's loopback. */\nconst SSH_CONTAINER_PORT = 22;\n\n/**\n * Bring the box's sshd up, make sure it trusts this host's per-box key, and\n * return the connection target. Idempotent — safe to call on every start: the\n * key is reused when present, `authorized_keys` is only appended to when the key\n * isn't already there, and sshd is only launched if it isn't already listening.\n *\n * Returns null (rather than throwing) when sshd doesn't come up, so a failure\n * here degrades `open`/`code` instead of breaking the lifecycle command that\n * triggered it.\n */\nexport async function resolveBoxSshTarget(box: BoxRecord): Promise<SshTargetRecord | null> {\n const sandboxId = box.cloud?.sandboxId;\n if (!sandboxId) return null;\n const { target: remote, container } = parseSandboxId(sandboxId);\n const conn = await ensureTunnel(sandboxId, remote);\n\n const key = await mintSshKey(\n defaultBoxSshDir(sandboxId, 'remote-docker'),\n `agentbox-${box.name}`,\n );\n\n // Install the public key. `grep -q` first so a restart doesn't grow the file\n // without bound. Runs as root because on a nested engine the container's init\n // is uid 0 and ~vscode/.ssh may not exist yet; the chown puts it back.\n const install = [\n `install -d -m 700 -o ${CONTAINER_USER} -g ${CONTAINER_USER} /home/${CONTAINER_USER}/.ssh`,\n `touch /home/${CONTAINER_USER}/.ssh/authorized_keys`,\n `grep -qF ${quoteShellArg(key.publicKey)} /home/${CONTAINER_USER}/.ssh/authorized_keys || echo ${quoteShellArg(key.publicKey)} >> /home/${CONTAINER_USER}/.ssh/authorized_keys`,\n `chown -R ${CONTAINER_USER}:${CONTAINER_USER} /home/${CONTAINER_USER}/.ssh`,\n `chmod 600 /home/${CONTAINER_USER}/.ssh/authorized_keys`,\n ].join(' && ');\n const installRes = await dockerOnRemote(\n conn,\n dockerExecArgv(container, bashScript(install), { user: 'root' }),\n );\n if (installRes.exitCode !== 0) return null;\n\n // Start sshd (the image ships `agentbox-sshd-start`, which manages the host\n // keys and /run/sshd). Idempotent, and a no-op when it's already listening.\n await dockerOnRemote(\n conn,\n dockerExecArgv(container, bashScript('/usr/local/bin/agentbox-sshd-start'), {\n user: 'root',\n }),\n { timeoutMs: 60_000 },\n );\n\n // The port docker published on the ENGINE's loopback. Re-read every time: it\n // is ephemeral and gets reassigned whenever the container restarts.\n const portRes = await dockerOnRemote(conn, ['port', container, String(SSH_CONTAINER_PORT)]);\n const port = portRes.exitCode === 0 ? parseDockerPort(portRes.stdout) : null;\n if (port === null) return null;\n\n return {\n // Resolved on the jump host, not here.\n host: '127.0.0.1',\n port,\n user: CONTAINER_USER,\n identityFile: key.privatePath,\n proxyJump: remote.spec,\n };\n}\n","/**\n * `agentbox prepare --provider docker:<host>` — bake the box image on a remote\n * engine.\n *\n * Unlike the VPS providers, this is not a mandatory gate: a remote engine can\n * build from a Dockerfile, so `create` ensures the image itself and prepare is\n * simply the eager form (\"do the slow part now, not when I'm waiting for a\n * box\"). It is also the only place that writes `remote-docker-prepared.json`,\n * which exists purely so `prepare --status` / `doctor` can report what has been\n * baked where.\n */\n\nimport type { PrepareOptions, PrepareResult } from '@agentbox/core';\nimport { ensureRemoteImage } from './image.js';\nimport { ensureTunnel } from './remote-docker.js';\nimport { recordPreparedHost } from './prepared-state.js';\nimport { parseRemoteTarget } from './target.js';\n\nexport async function prepareRemoteDocker(\n opts: PrepareOptions & { host?: string },\n): Promise<PrepareResult> {\n const log = opts.onLog ?? ((): void => {});\n const spec = (opts.host ?? '').trim();\n if (!spec) {\n throw new Error(\n 'remote-docker: prepare needs an SSH destination — `agentbox prepare --provider docker:<host>`, ' +\n 'or set `box.remoteDockerHost`.',\n );\n }\n const remote = parseRemoteTarget(spec);\n const target = await ensureTunnel(`engine:${remote.spec}`, remote);\n\n log(`[prepare] ensuring the box image on ${remote.spec}`);\n const res = await ensureRemoteImage(target, {\n ...(opts.claudeInstall ? { claudeInstall: opts.claudeInstall } : {}),\n ...(opts.registry !== undefined ? { registry: opts.registry } : {}),\n ...(opts.allowPull !== undefined ? { allowPull: opts.allowPull } : {}),\n ...(opts.force ? { force: true } : {}),\n onLog: log,\n });\n\n if (res.contextSha256) {\n recordPreparedHost(remote.spec, { imageRef: res.ref, contextSha256: res.contextSha256 });\n }\n log(`[prepare] ${remote.spec} ready — ${res.ref} (${res.source})`);\n\n // Deliberately no `snapshotName`: returning one makes the CLI pin\n // `box.imageRemoteDocker` to it, which would freeze every future create on\n // today's fingerprint and defeat the self-updating ref.\n return {};\n}\n","/**\n * Doctor probes for the remote-docker provider.\n *\n * There is no credential to check — the provider authenticates as you, through\n * your own `~/.ssh/config` and agent. What *can* be wrong is the destination:\n * unset, unreachable, or reachable but with no docker on the login-shell PATH.\n * So the checks are exactly those three, run against the configured default.\n */\n\nimport { loadEffectiveConfig } from '@agentbox/config';\nimport { detectPortless, portlessDoctorRow } from '@agentbox/sandbox-cloud';\nimport { errSummary, type CheckResult } from '@agentbox/sandbox-core';\nimport { probeRemoteEngine } from './remote-docker.js';\nimport { readPreparedState } from './prepared-state.js';\n\n// No `readCredStatus` / `ensureCredentials` on this provider's module, and that\n// is not an omission: there is no credential to store or prompt for. The CLI\n// and the hub both feature-detect those, so they simply show no login row.\n\nexport async function doctorChecks(): Promise<CheckResult[]> {\n try {\n const cfg = await loadEffectiveConfig(process.cwd());\n const host = (cfg.effective.box.remoteDockerHost || '').trim();\n if (!host) {\n return [\n {\n label: 'remote engine',\n status: 'warn',\n detail: 'no default SSH destination set',\n hint: '`agentbox config set box.remoteDockerHost <user@host>` (or use `agentbox docker:<host> …`)',\n },\n ];\n }\n\n const probe = await probeRemoteEngine(host);\n const engineRes: CheckResult = probe.ok\n ? {\n label: 'remote engine',\n status: 'ok',\n detail: `${host} — docker ${probe.version} (${probe.os}/${probe.arch})`,\n }\n : {\n label: 'remote engine',\n status: 'fail',\n detail: probe.error,\n hint: `check that \\`ssh ${host} true\\` works and docker is installed there`,\n };\n\n const prepared = readPreparedState();\n const baked = prepared?.hosts[host];\n const imageRes: CheckResult = baked\n ? {\n label: 'box image',\n status: 'ok',\n detail: `${baked.imageRef} (${baked.cliVersion ?? '—'})`,\n }\n : {\n label: 'box image',\n status: 'warn',\n detail: 'not baked on this host yet',\n hint: `\\`agentbox prepare --provider docker:${host}\\` (otherwise the first create bakes it)`,\n };\n\n // Host Portless mints the <box>.localhost alias for the SSH-forwarded port;\n // without it the box's web URL degrades to a raw loopback port.\n const portlessRes = portlessDoctorRow(await detectPortless());\n return [engineRes, imageRes, portlessRes];\n } catch (err) {\n return [{ label: 'remote engine', status: 'warn', detail: errSummary(err) }];\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAS,gBAAgB;ACFzB,SAAS,oBAAAA,mBAAkB,yBAAyB;AACpD,SAAS,aAAa;AACtB,SAAS,eAAe;ACLxB,SAAS,wBAAwB;AACjC,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,aAAa;AAuCf,SAAS,eAAe,eAA+B;AAC5D,SAAO,gBAAgB,cAAc,MAAM,GAAG,EAAE,CAAC;AACnD;AASA,eAAsB,k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,YAAY;AACpE,WAAO,QAAQ,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,EAAE,SAAS,UAAU,EAAE;EAC9E;EAEA,MAAM,OAAO,aAAqB,KAAa;AAC7C,UAAM,QAAQ,MAAM,uBAAuB,aAAa,cAAc,GAAG;AACzE,QAAI,CAAC,MAAO;AACZ,UAAM,oBAAoB,iBAAiB,MAAM,SAAS,YAAY;AACtE,UAAM,yBAAyB,aAAa,cAAc,GAAG;EAC/D;AACF;AAEO,IAAM,uBAAiC;EAC5C,GAAG;EACH,aAAa;;;;;EAKb,WAAW;EACX,YAAY;EACZ,SAAS;EACT,iBAAiB,OAAO,kBAAmB,MAAM,kBAAkB,aAAa,KAAM;AACxF;AAGO,IAAM,iBAAiC;EAC5C,UAAU;EACV,SAAS;EACT,4BAA4B,OAAO,kBAChC,MAAM,kBAAkB,aAAa,KAAM;EAC9C;AACF;","names":["createReadStream","ref","createReadStream","CONTAINER_USER","quoteShellArgv","sshOptArgs","sshDestination","quoteShellArg","bashScript","loadEffectiveConfig"]}
|