@madarco/agentbox 0.23.0 → 0.23.2

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.
Files changed (130) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/LICENSE +21 -0
  3. package/dist/{_cloud-attach-RFPLNACE.js → _cloud-attach-LP5CIO7S.js} +4 -4
  4. package/dist/{chunk-ERMU7RMK.js → chunk-7D7K4UXW.js} +4 -4
  5. package/dist/{chunk-QGL734YX.js → chunk-AGSLJ3NE.js} +2 -2
  6. package/dist/{chunk-L5SOSNQI.js → chunk-C47ZA42C.js} +3 -3
  7. package/dist/chunk-G3H2L3O2.js +0 -0
  8. package/dist/{chunk-QVWGQJV6.js → chunk-GGRZ3GZO.js} +2 -2
  9. package/dist/{chunk-6OQENOJZ.js → chunk-J3GSZ33V.js} +8 -8
  10. package/dist/{chunk-CKC3CP7Y.js → chunk-LK2JT2OO.js} +19 -7
  11. package/dist/{chunk-CKC3CP7Y.js.map → chunk-LK2JT2OO.js.map} +1 -1
  12. package/dist/{chunk-Q626V2YX.js → chunk-LSQXT5WZ.js} +2 -2
  13. package/dist/chunk-QT3SHMLY.js +0 -0
  14. package/dist/{chunk-JXDSSSXS.js → chunk-TZLNJBIM.js} +3 -3
  15. package/dist/chunk-WJFZJZIM.js +0 -0
  16. package/dist/cloud-poller-SUNA6ZQC-7M5LJHHE.js +0 -0
  17. package/dist/dist-2BTJQUJS.js +0 -0
  18. package/dist/{dist-GJCIKH2C.js → dist-HENU2IVK.js} +8 -6
  19. package/dist/{dist-GJCIKH2C.js.map → dist-HENU2IVK.js.map} +1 -1
  20. package/dist/{dist-JFUUDAI3.js → dist-NUZ2RMOP.js} +3 -3
  21. package/dist/{dist-GEHCZJCS.js → dist-OTSXYV6X.js} +5 -5
  22. package/dist/{dist-W5476E2U.js → dist-UIOWLT3C.js} +5 -5
  23. package/dist/{dist-Z3GSHEFO.js → dist-VMR6UEP2.js} +5 -5
  24. package/dist/index.js +49 -25
  25. package/dist/index.js.map +1 -1
  26. package/dist/{prepared-state-LW2PKTEQ-5YMKG7UN.js → prepared-state-BUO75YLZ-CDTISC2C.js} +2 -2
  27. package/package.json +27 -28
  28. package/runtime/_shared/agentbox-checkpoint-cleanup +0 -0
  29. package/runtime/_shared/agentbox-dockerd-start +0 -0
  30. package/runtime/_shared/agentbox-open +0 -0
  31. package/runtime/_shared/agentbox-portless-trust +0 -0
  32. package/runtime/_shared/agentbox-vnc-start +0 -0
  33. package/runtime/_shared/ctl.cjs +0 -0
  34. package/runtime/_shared/gh-shim +0 -0
  35. package/runtime/_shared/git-shim +0 -0
  36. package/runtime/_shared/linear-shim +0 -0
  37. package/runtime/_shared/ntn-shim +0 -0
  38. package/runtime/docker/packages/ctl/dist/bin.cjs +0 -0
  39. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup +0 -0
  40. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-dockerd-start +0 -0
  41. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-open +0 -0
  42. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-portless-trust +0 -0
  43. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-sshd-start +0 -0
  44. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-vnc-start +0 -0
  45. package/runtime/docker/packages/sandbox-docker/scripts/chromium-resolver +0 -0
  46. package/runtime/docker/packages/sandbox-docker/scripts/gh-shim +0 -0
  47. package/runtime/docker/packages/sandbox-docker/scripts/git-shim +0 -0
  48. package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +0 -0
  49. package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +0 -0
  50. package/runtime/e2b/agentbox-checkpoint-cleanup +0 -0
  51. package/runtime/e2b/agentbox-dockerd-start +0 -0
  52. package/runtime/e2b/agentbox-open +0 -0
  53. package/runtime/e2b/agentbox-vnc-start +0 -0
  54. package/runtime/e2b/ctl.cjs +0 -0
  55. package/runtime/e2b/gh-shim +0 -0
  56. package/runtime/e2b/git-shim +0 -0
  57. package/runtime/e2b/linear-shim +0 -0
  58. package/runtime/e2b/ntn-shim +0 -0
  59. package/runtime/e2b/scripts/build-template.sh +0 -0
  60. package/runtime/hetzner/agentbox-checkpoint-cleanup +0 -0
  61. package/runtime/hetzner/agentbox-dockerd-start +0 -0
  62. package/runtime/hetzner/agentbox-open +0 -0
  63. package/runtime/hetzner/agentbox-portless-trust +0 -0
  64. package/runtime/hetzner/agentbox-vnc-start +0 -0
  65. package/runtime/hetzner/ctl.cjs +0 -0
  66. package/runtime/hetzner/gh-shim +0 -0
  67. package/runtime/hetzner/git-shim +0 -0
  68. package/runtime/hetzner/linear-shim +0 -0
  69. package/runtime/hetzner/ntn-shim +0 -0
  70. package/runtime/hetzner/scripts/install-box.sh +0 -0
  71. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  72. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  73. package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page_client-reference-manifest.js +1 -1
  74. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  75. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  76. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  77. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
  78. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  79. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  80. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  81. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  82. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  83. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  84. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  85. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  86. package/runtime/hub/apps/hub/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  87. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d6mtlk._.js +1 -1
  88. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_0b_hsjl._.js +1 -1
  89. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  90. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  91. package/runtime/hub/apps/hub/.next/static/chunks/{23fswvjrabu89.js → 0joh_xsiowfc4.js} +1 -1
  92. package/runtime/hub/apps/hub/.next/static/chunks/3rm29i8e-lb25.css +3 -0
  93. package/runtime/hub/apps/hub/{chunk-6HD4PARX.js → chunk-5C7T5LX3.js} +2 -2
  94. package/runtime/hub/apps/hub/{chunk-K6RA5GJI.js → chunk-H22XP3NY.js} +18 -6
  95. package/runtime/hub/apps/hub/{chunk-JQFB2CNA.js → chunk-TS3DHXYG.js} +1 -1
  96. package/runtime/hub/apps/hub/{dist-OUNL2TCW.js → dist-3ILQQGCH.js} +3 -3
  97. package/runtime/hub/apps/hub/{dist-3HR4RIPE.js → dist-6R5YPL5S.js} +2 -2
  98. package/runtime/hub/apps/hub/{dist-7GNKBKFV.js → dist-CJHZ37LW.js} +3 -3
  99. package/runtime/hub/apps/hub/{dist-JWVTVHBT.js → dist-PKOFN4OD.js} +3 -3
  100. package/runtime/hub/apps/hub/{dist-TOHA4OA5.js → dist-WRKJHF6W.js} +6 -4
  101. package/runtime/hub/apps/hub/{prepared-state-LW2PKTEQ-7BCXARGA.js → prepared-state-BUO75YLZ-CAXQS5Y3.js} +1 -1
  102. package/runtime/hub/apps/hub/server.js +9 -9
  103. package/runtime/relay/bin.cjs +0 -0
  104. package/runtime/vercel/agentbox-checkpoint-cleanup +0 -0
  105. package/runtime/vercel/agentbox-dockerd-start +0 -0
  106. package/runtime/vercel/agentbox-open +0 -0
  107. package/runtime/vercel/agentbox-vnc-start +0 -0
  108. package/runtime/vercel/ctl.cjs +0 -0
  109. package/runtime/vercel/gh-shim +0 -0
  110. package/runtime/vercel/git-shim +0 -0
  111. package/runtime/vercel/linear-shim +0 -0
  112. package/runtime/vercel/ntn-shim +0 -0
  113. package/runtime/vercel/scripts/provision.sh +0 -0
  114. package/runtime/hub/apps/hub/.next/static/chunks/3nedwutnzpdis.css +0 -3
  115. /package/dist/{_cloud-attach-RFPLNACE.js.map → _cloud-attach-LP5CIO7S.js.map} +0 -0
  116. /package/dist/{chunk-ERMU7RMK.js.map → chunk-7D7K4UXW.js.map} +0 -0
  117. /package/dist/{chunk-QGL734YX.js.map → chunk-AGSLJ3NE.js.map} +0 -0
  118. /package/dist/{chunk-L5SOSNQI.js.map → chunk-C47ZA42C.js.map} +0 -0
  119. /package/dist/{chunk-QVWGQJV6.js.map → chunk-GGRZ3GZO.js.map} +0 -0
  120. /package/dist/{chunk-6OQENOJZ.js.map → chunk-J3GSZ33V.js.map} +0 -0
  121. /package/dist/{chunk-Q626V2YX.js.map → chunk-LSQXT5WZ.js.map} +0 -0
  122. /package/dist/{chunk-JXDSSSXS.js.map → chunk-TZLNJBIM.js.map} +0 -0
  123. /package/dist/{dist-JFUUDAI3.js.map → dist-NUZ2RMOP.js.map} +0 -0
  124. /package/dist/{dist-GEHCZJCS.js.map → dist-OTSXYV6X.js.map} +0 -0
  125. /package/dist/{dist-W5476E2U.js.map → dist-UIOWLT3C.js.map} +0 -0
  126. /package/dist/{dist-Z3GSHEFO.js.map → dist-VMR6UEP2.js.map} +0 -0
  127. /package/dist/{prepared-state-LW2PKTEQ-5YMKG7UN.js.map → prepared-state-BUO75YLZ-CDTISC2C.js.map} +0 -0
  128. /package/runtime/hub/apps/hub/.next/static/{6WtaFwavHBpin3eT7-HjR → W7Oc_BUsChvL4rrhfKZRY}/_buildManifest.js +0 -0
  129. /package/runtime/hub/apps/hub/.next/static/{6WtaFwavHBpin3eT7-HjR → W7Oc_BUsChvL4rrhfKZRY}/_clientMiddlewareManifest.js +0 -0
  130. /package/runtime/hub/apps/hub/.next/static/{6WtaFwavHBpin3eT7-HjR → W7Oc_BUsChvL4rrhfKZRY}/_ssgManifest.js +0 -0
@@ -8,7 +8,7 @@ import {
8
8
  readPreparedStateRaw,
9
9
  writeManagedSecrets,
10
10
  writePreparedStateRaw
11
- } from "./chunk-CKC3CP7Y.js";
11
+ } from "./chunk-LK2JT2OO.js";
12
12
 
13
13
  // ../../packages/sandbox-e2b/dist/chunk-4FOXSEPX.js
14
14
  import { existsSync, readFileSync } from "fs";
@@ -324,4 +324,4 @@ export {
324
324
  currentE2bBaseFingerprintLive,
325
325
  ensureE2bBaseTemplate
326
326
  };
327
- //# sourceMappingURL=chunk-Q626V2YX.js.map
327
+ //# sourceMappingURL=chunk-LSQXT5WZ.js.map
File without changes
@@ -8,7 +8,7 @@ import {
8
8
  renderInnerCommand,
9
9
  resolveCloudCheckpoint,
10
10
  writeCloudCheckpointManifest
11
- } from "./chunk-L5SOSNQI.js";
11
+ } from "./chunk-C47ZA42C.js";
12
12
  import {
13
13
  UserFacingError,
14
14
  claudeInstallFingerprint,
@@ -24,7 +24,7 @@ import {
24
24
  stageOpencodeStaticForUpload,
25
25
  writeManagedSecrets,
26
26
  writePreparedStateRaw
27
- } from "./chunk-CKC3CP7Y.js";
27
+ } from "./chunk-LK2JT2OO.js";
28
28
 
29
29
  // ../../packages/sandbox-vercel/dist/chunk-6SDDZRAG.js
30
30
  import { existsSync, readFileSync } from "fs";
@@ -1651,4 +1651,4 @@ export {
1651
1651
  vercelProvider,
1652
1652
  providerModule
1653
1653
  };
1654
- //# sourceMappingURL=chunk-JXDSSSXS.js.map
1654
+ //# sourceMappingURL=chunk-TZLNJBIM.js.map
File without changes
File without changes
File without changes
@@ -13,17 +13,17 @@ import {
13
13
  resolveDockerfileContext,
14
14
  setDaytonaCredentials,
15
15
  writePreparedDaytonaState
16
- } from "./chunk-QVWGQJV6.js";
16
+ } from "./chunk-GGRZ3GZO.js";
17
17
  import {
18
18
  createCloudProvider
19
- } from "./chunk-L5SOSNQI.js";
20
- import "./chunk-QGL734YX.js";
19
+ } from "./chunk-C47ZA42C.js";
20
+ import "./chunk-AGSLJ3NE.js";
21
21
  import "./chunk-QT3SHMLY.js";
22
22
  import {
23
23
  claudeInstallFingerprint,
24
24
  errSummary,
25
25
  stageAllAgentStatic
26
- } from "./chunk-CKC3CP7Y.js";
26
+ } from "./chunk-LK2JT2OO.js";
27
27
  import "./chunk-G3H2L3O2.js";
28
28
  import "./chunk-WJFZJZIM.js";
29
29
 
@@ -247,7 +247,9 @@ async function doctorChecks() {
247
247
  {
248
248
  label: "credentials",
249
249
  status: "warn",
250
- detail: status.reason ?? "not configured",
250
+ // The SDK's reason is a paragraph (env-var enumeration) — doctor just
251
+ // needs the vercel/e2b-style one-liner; `prepare --status` keeps it.
252
+ detail: "not configured",
251
253
  hint: "`agentbox daytona login`"
252
254
  }
253
255
  ];
@@ -297,4 +299,4 @@ export {
297
299
  resolveDockerfileContext,
298
300
  setDaytonaCredentials
299
301
  };
300
- //# sourceMappingURL=dist-GJCIKH2C.js.map
302
+ //# sourceMappingURL=dist-HENU2IVK.js.map
@@ -1 +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 } 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 */\nfunction defaultSnapshotName(fingerprint: string | null): string {\n if (fingerprint) return `agentbox-base-${fingerprint.slice(0, 12)}`;\n return `agentbox-base-${Math.floor(Date.now() / 1000).toString()}`;\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 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);\n\n const prepared = readPreparedDaytonaState();\n if (\n !opts.force &&\n fingerprint &&\n preparedMatches(prepared, fingerprint.contextSha256)\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 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 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(`creating Daytona snapshot '${snapshotName}'…`);\n const snapshot = await client.snapshot.create(\n { name: snapshotName, image },\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 });\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 detail: status.reason ?? '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;AAyBtB,SAAS,oBAAoB,aAAoC;AAC/D,MAAI,YAAa,QAAO,iBAAiB,YAAY,MAAM,GAAG,EAAE,CAAC;AACjE,SAAO,iBAAiB,KAAK,MAAM,KAAK,IAAI,IAAI,GAAI,EAAE,SAAS,CAAC;AAClE;AAQA,SAAS,iBAAiB,MAA2E;AACnG,SAAO;IACL,YAAY,iBAAiB,IAAI;IACjC,WAAW,sBAAsB,IAAI;EACvC;AACF;AAGA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ona/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 } 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 */\nfunction defaultSnapshotName(fingerprint: string | null): string {\n if (fingerprint) return `agentbox-base-${fingerprint.slice(0, 12)}`;\n return `agentbox-base-${Math.floor(Date.now() / 1000).toString()}`;\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 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);\n\n const prepared = readPreparedDaytonaState();\n if (\n !opts.force &&\n fingerprint &&\n preparedMatches(prepared, fingerprint.contextSha256)\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 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 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(`creating Daytona snapshot '${snapshotName}'…`);\n const snapshot = await client.snapshot.create(\n { name: snapshotName, image },\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 });\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":";;;;;;;;;;;;;;;;;;;;;;;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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":[]}
@@ -222,7 +222,7 @@ import {
222
222
  vscodeServerVolumeName,
223
223
  waitForTmuxPaneContent,
224
224
  warmUpClaudeCredentials
225
- } from "./chunk-QGL734YX.js";
225
+ } from "./chunk-AGSLJ3NE.js";
226
226
  import "./chunk-QT3SHMLY.js";
227
227
  import {
228
228
  AmbiguousBoxError,
@@ -271,7 +271,7 @@ import {
271
271
  stageDynamicSyncTarball,
272
272
  tagImage,
273
273
  writePreparedDockerState
274
- } from "./chunk-CKC3CP7Y.js";
274
+ } from "./chunk-LK2JT2OO.js";
275
275
  import "./chunk-G3H2L3O2.js";
276
276
  import "./chunk-WJFZJZIM.js";
277
277
  export {
@@ -544,4 +544,4 @@ export {
544
544
  warmUpClaudeCredentials,
545
545
  writePreparedDockerState
546
546
  };
547
- //# sourceMappingURL=dist-JFUUDAI3.js.map
547
+ //# sourceMappingURL=dist-NUZ2RMOP.js.map
@@ -20,7 +20,7 @@ import {
20
20
  setE2bCredentials,
21
21
  updatePreparedState,
22
22
  writePreparedState
23
- } from "./chunk-Q626V2YX.js";
23
+ } from "./chunk-LSQXT5WZ.js";
24
24
  import {
25
25
  createCloudProvider,
26
26
  currentCloudBaseFingerprint,
@@ -30,8 +30,8 @@ import {
30
30
  renderInnerCommand,
31
31
  resolveCloudCheckpoint,
32
32
  writeCloudCheckpointManifest
33
- } from "./chunk-L5SOSNQI.js";
34
- import "./chunk-QGL734YX.js";
33
+ } from "./chunk-C47ZA42C.js";
34
+ import "./chunk-AGSLJ3NE.js";
35
35
  import "./chunk-QT3SHMLY.js";
36
36
  import {
37
37
  claudeInstallFingerprint,
@@ -40,7 +40,7 @@ import {
40
40
  readCliStamp,
41
41
  recordBox,
42
42
  stageAllAgentStatic
43
- } from "./chunk-CKC3CP7Y.js";
43
+ } from "./chunk-LK2JT2OO.js";
44
44
  import "./chunk-G3H2L3O2.js";
45
45
  import "./chunk-WJFZJZIM.js";
46
46
 
@@ -750,4 +750,4 @@ export {
750
750
  updatePreparedState,
751
751
  writePreparedState
752
752
  };
753
- //# sourceMappingURL=dist-GEHCZJCS.js.map
753
+ //# sourceMappingURL=dist-OTSXYV6X.js.map
@@ -34,11 +34,11 @@ import {
34
34
  vercelBackend,
35
35
  vercelProvider,
36
36
  writePreparedState
37
- } from "./chunk-JXDSSSXS.js";
38
- import "./chunk-L5SOSNQI.js";
39
- import "./chunk-QGL734YX.js";
37
+ } from "./chunk-TZLNJBIM.js";
38
+ import "./chunk-C47ZA42C.js";
39
+ import "./chunk-AGSLJ3NE.js";
40
40
  import "./chunk-QT3SHMLY.js";
41
- import "./chunk-CKC3CP7Y.js";
41
+ import "./chunk-LK2JT2OO.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-W5476E2U.js.map
80
+ //# sourceMappingURL=dist-UIOWLT3C.js.map
@@ -44,13 +44,13 @@ import {
44
44
  waitForSsh,
45
45
  withHetznerRetry,
46
46
  writePreparedState
47
- } from "./chunk-ERMU7RMK.js";
48
- import "./chunk-L5SOSNQI.js";
49
- import "./chunk-QGL734YX.js";
47
+ } from "./chunk-7D7K4UXW.js";
48
+ import "./chunk-C47ZA42C.js";
49
+ import "./chunk-AGSLJ3NE.js";
50
50
  import "./chunk-QT3SHMLY.js";
51
51
  import {
52
52
  mintSshKey
53
- } from "./chunk-CKC3CP7Y.js";
53
+ } from "./chunk-LK2JT2OO.js";
54
54
  import "./chunk-G3H2L3O2.js";
55
55
  import "./chunk-WJFZJZIM.js";
56
56
  export {
@@ -100,4 +100,4 @@ export {
100
100
  withHetznerRetry,
101
101
  writePreparedState
102
102
  };
103
- //# sourceMappingURL=dist-Z3GSHEFO.js.map
103
+ //# sourceMappingURL=dist-VMR6UEP2.js.map
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  readE2bCredStatus,
6
6
  readPreparedState as readPreparedState3,
7
7
  secretsPath as secretsPath4
8
- } from "./chunk-Q626V2YX.js";
8
+ } from "./chunk-LSQXT5WZ.js";
9
9
  import {
10
10
  ADVANCED_HINT_GROUPS,
11
11
  ALERT_BAND_ROWS,
@@ -49,7 +49,7 @@ import {
49
49
  subscribePrompts,
50
50
  uploadImageFileToBox,
51
51
  withFirewallRepair
52
- } from "./chunk-6OQENOJZ.js";
52
+ } from "./chunk-J3GSZ33V.js";
53
53
  import {
54
54
  daytonaBackend,
55
55
  ensureDaytonaCredentials,
@@ -57,7 +57,7 @@ import {
57
57
  readDaytonaCredStatus,
58
58
  readPreparedDaytonaState,
59
59
  secretsPath
60
- } from "./chunk-QVWGQJV6.js";
60
+ } from "./chunk-GGRZ3GZO.js";
61
61
  import {
62
62
  deployControlPlaneToHetzner,
63
63
  detectEgressIp,
@@ -69,7 +69,7 @@ import {
69
69
  readPreparedState,
70
70
  secretsPath as secretsPath2,
71
71
  syncFirewallSource
72
- } from "./chunk-ERMU7RMK.js";
72
+ } from "./chunk-7D7K4UXW.js";
73
73
  import {
74
74
  createGitDeployment,
75
75
  createGitProject,
@@ -88,7 +88,7 @@ import {
88
88
  resolveVercelApiAuth,
89
89
  secretsPath as secretsPath3,
90
90
  upsertProjectEnv
91
- } from "./chunk-JXDSSSXS.js";
91
+ } from "./chunk-TZLNJBIM.js";
92
92
  import {
93
93
  agentSpecsForCloud,
94
94
  baseFreshnessFromFingerprints,
@@ -100,7 +100,7 @@ import {
100
100
  probeCloudCheckpoint,
101
101
  resolveCloudCheckpoint,
102
102
  seedAgentVolumesIfFresh
103
- } from "./chunk-L5SOSNQI.js";
103
+ } from "./chunk-C47ZA42C.js";
104
104
  import {
105
105
  ALL_CONNECTORS,
106
106
  BOX_STATUS_EVENT,
@@ -248,7 +248,7 @@ import {
248
248
  waitForTmuxPaneContent,
249
249
  warmUpClaudeCredentials,
250
250
  writeJob
251
- } from "./chunk-QGL734YX.js";
251
+ } from "./chunk-AGSLJ3NE.js";
252
252
  import {
253
253
  BUILT_IN_DEFAULTS,
254
254
  CLOUD_PROVIDER_NAMES,
@@ -333,7 +333,7 @@ import {
333
333
  toQueueKind,
334
334
  toSyncKind,
335
335
  upsertClaudeSshConfig
336
- } from "./chunk-CKC3CP7Y.js";
336
+ } from "./chunk-LK2JT2OO.js";
337
337
  import "./chunk-G3H2L3O2.js";
338
338
  import {
339
339
  __export,
@@ -341,8 +341,8 @@ import {
341
341
  } from "./chunk-WJFZJZIM.js";
342
342
 
343
343
  // src/version.ts
344
- var AGENTBOX_VERSION = true ? "0.23.0" : "0.0.0-dev";
345
- var AGENTBOX_COMMIT = true ? "0a2aba48e" : "dev";
344
+ var AGENTBOX_VERSION = true ? "0.23.2" : "0.0.0-dev";
345
+ var AGENTBOX_COMMIT = true ? "ae37e1f96" : "dev";
346
346
 
347
347
  // src/index.ts
348
348
  import { existsSync as _existsSync } from "fs";
@@ -1111,7 +1111,7 @@ import { homedir as homedir2 } from "os";
1111
1111
  import { join as join3 } from "path";
1112
1112
  import { setTimeout as delay2 } from "timers/promises";
1113
1113
 
1114
- // src/commands/install-tray.ts
1114
+ // src/commands/install-app.ts
1115
1115
  import { intro, log as log4, outro } from "@clack/prompts";
1116
1116
  import { Command as Command2 } from "commander";
1117
1117
  import { execa } from "execa";
@@ -1169,7 +1169,7 @@ function remoteCheckFresh(state, now = /* @__PURE__ */ new Date()) {
1169
1169
  return now.getTime() - t < DAY_MS && t - now.getTime() < DAY_MS;
1170
1170
  }
1171
1171
 
1172
- // src/commands/install-tray.ts
1172
+ // src/commands/install-app.ts
1173
1173
  var APP_NAME = "AgentBox";
1174
1174
  var APP_PATH = `/Applications/${APP_NAME}.app`;
1175
1175
  var APP_BUNDLE_ID = "com.madarco.agentbox-tray";
@@ -1282,8 +1282,8 @@ async function downloadAndVerify(tag2, dir, say) {
1282
1282
  }
1283
1283
  return { zipPath, sha: actual };
1284
1284
  }
1285
- var installTrayCommand = new Command2("tray").description("Download and install the AgentBox Tray macOS menu-bar app into /Applications").option("--uninstall", "quit and remove the menu-bar app").option("--tag <tag>", "release tag to install from (default: tray-latest)").option("--zip <path>", "install a local AgentBox.zip instead of downloading").action(async (opts) => {
1286
- intro(opts.uninstall ? "Removing AgentBox Tray\u2026" : "Installing AgentBox Tray\u2026");
1285
+ var installAppCommand = new Command2("app").description("Download and install the AgentBox macOS menu-bar app into /Applications").option("--uninstall", "quit and remove the menu-bar app").option("--tag <tag>", "release tag to install from (default: tray-latest)").option("--zip <path>", "install a local AgentBox.zip instead of downloading").action(async (opts) => {
1286
+ intro(opts.uninstall ? "Removing the AgentBox app\u2026" : "Installing the AgentBox app\u2026");
1287
1287
  const res = await installTray(opts);
1288
1288
  outro(res.ran ? "Done" : `Skipped (${res.reason ?? "nothing to do"})`);
1289
1289
  if (!res.ran && res.reason && res.reason !== "not-macos") process.exitCode = 1;
@@ -1388,7 +1388,7 @@ var statusSub = new Command3("status").description("Show whether the AgentBox ap
1388
1388
  } else if (installed) {
1389
1389
  log5.info("AgentBox is installed but not running.");
1390
1390
  } else {
1391
- log5.warn("AgentBox is not installed. Run `agentbox install tray`.");
1391
+ log5.warn("AgentBox is not installed. Run `agentbox install app`.");
1392
1392
  }
1393
1393
  });
1394
1394
  var startSub = new Command3("start").description("Launch the AgentBox app if it is not already running").action(async () => {
@@ -3736,7 +3736,7 @@ async function renderDocker(status) {
3736
3736
  }
3737
3737
  async function daytonaStatus() {
3738
3738
  try {
3739
- const mod = await import("./dist-GJCIKH2C.js");
3739
+ const mod = await import("./dist-HENU2IVK.js");
3740
3740
  return await mod.getDaytonaStatus();
3741
3741
  } catch (err) {
3742
3742
  return {
@@ -3747,7 +3747,7 @@ async function daytonaStatus() {
3747
3747
  }
3748
3748
  async function e2bStatus() {
3749
3749
  try {
3750
- const mod = await import("./dist-GEHCZJCS.js");
3750
+ const mod = await import("./dist-OTSXYV6X.js");
3751
3751
  const cred = mod.readE2bCredStatus();
3752
3752
  if (cred.auth === "none") {
3753
3753
  return { configured: false, reason: "not configured \u2014 run `agentbox e2b login`" };
@@ -8345,7 +8345,7 @@ var createCommand = new Command13("create").description(
8345
8345
  }
8346
8346
  outro7("done");
8347
8347
  if (attachClaudeAfter) {
8348
- const { cloudAgentAttach: cloudAgentAttach2 } = await import("./_cloud-attach-RFPLNACE.js");
8348
+ const { cloudAgentAttach: cloudAgentAttach2 } = await import("./_cloud-attach-LP5CIO7S.js");
8349
8349
  await cloudAgentAttach2({
8350
8350
  box: result.record,
8351
8351
  binary: "claude",
@@ -11999,7 +11999,14 @@ function summaryToken(group) {
11999
11999
  const worst = worstInResults(group.results);
12000
12000
  if (group.title === "system") {
12001
12001
  if (worst === "fail") return "system FAIL";
12002
- if (worst === "warn") return "system warn";
12002
+ if (worst === "warn") {
12003
+ const warns = group.results.filter((r) => r.status === "warn");
12004
+ const required = warns.filter((r) => !r.hint?.startsWith("optional")).map((r) => r.label);
12005
+ const optional = warns.filter((r) => r.hint?.startsWith("optional")).map((r) => r.label);
12006
+ const parts = [...required];
12007
+ if (optional.length > 0) parts.push(`optional ${optional.join(", ")}`);
12008
+ return `system warn: ${parts.join(", ")}`;
12009
+ }
12003
12010
  return "system ok";
12004
12011
  }
12005
12012
  if (group.title === "integrations") {
@@ -12084,7 +12091,12 @@ import { dirname as dirname4, join as join24 } from "path";
12084
12091
  var STATE_VERSION2 = 1;
12085
12092
  var REPO = "madarco/agentbox";
12086
12093
  var REPO_URL = `https://github.com/${REPO}`;
12087
- var DEFAULT_STATE = { version: STATE_VERSION2, installCount: 0, starred: false };
12094
+ var DEFAULT_STATE = {
12095
+ version: STATE_VERSION2,
12096
+ installCount: 0,
12097
+ starred: false,
12098
+ answered: false
12099
+ };
12088
12100
  function starStatePath() {
12089
12101
  return join24(homedir18(), ".agentbox", "star-prompt.json");
12090
12102
  }
@@ -12096,7 +12108,8 @@ function readStarState() {
12096
12108
  return {
12097
12109
  version: STATE_VERSION2,
12098
12110
  installCount: typeof parsed.installCount === "number" ? parsed.installCount : 0,
12099
- starred: parsed.starred === true
12111
+ starred: parsed.starred === true,
12112
+ answered: parsed.answered === true
12100
12113
  };
12101
12114
  } catch {
12102
12115
  return { ...DEFAULT_STATE };
@@ -12114,7 +12127,7 @@ function ghReady() {
12114
12127
  async function maybePromptStar(opts) {
12115
12128
  if (!process.stdout.isTTY) return;
12116
12129
  const state = readStarState();
12117
- if (state.starred) return;
12130
+ if (state.starred || state.answered) return;
12118
12131
  let shouldPrompt;
12119
12132
  if (opts.trigger === "install") {
12120
12133
  state.installCount += 1;
@@ -12128,6 +12141,8 @@ async function maybePromptStar(opts) {
12128
12141
  message: "Help support this open source project \u2014 would you like to star it on GitHub? Thanks!",
12129
12142
  initialValue: true
12130
12143
  });
12144
+ state.answered = true;
12145
+ writeStarState(state);
12131
12146
  if (!yes) return;
12132
12147
  try {
12133
12148
  if (ghReady()) {
@@ -13077,7 +13092,16 @@ var installCommand = new Command32("install").description(
13077
13092
  ).option("--force", "overwrite existing skill files even if not AgentBox-managed").option("--dry-run", "print what would be written without changing anything").option(
13078
13093
  "-p, --provider <name>",
13079
13094
  "pre-select the provider to set up (docker | daytona | hetzner | vercel)"
13080
- ).option("-y, --yes", "auto-confirm the prepare step").action(async (opts) => {
13095
+ ).option("-y, --yes", "auto-confirm the prepare step").action(async (opts, cmd) => {
13096
+ const stray = cmd.args[0];
13097
+ if (stray !== void 0) {
13098
+ const targets = cmd.commands.map((c) => c.name()).join(", ");
13099
+ process.stderr.write(
13100
+ `error: unknown install target '${stray}'. Valid targets: ${targets} \u2014 or run \`agentbox install\` with no target for the setup wizard.
13101
+ `
13102
+ );
13103
+ process.exit(1);
13104
+ }
13081
13105
  if (opts.skillsOnly) {
13082
13106
  (0, prompt_exports.intro)("Installing AgentBox host commands...");
13083
13107
  let res;
@@ -13116,7 +13140,7 @@ installCommand.enablePositionalOptions();
13116
13140
  installCommand.addCommand(installCmuxCommand);
13117
13141
  installCommand.addCommand(installHerdrCommand);
13118
13142
  installCommand.addCommand(installCodexCommand);
13119
- installCommand.addCommand(installTrayCommand);
13143
+ installCommand.addCommand(installAppCommand);
13120
13144
 
13121
13145
  // src/commands/plugin.ts
13122
13146
  import { execFileSync } from "child_process";
@@ -16495,7 +16519,7 @@ async function maybeUpdateTray(say) {
16495
16519
  }
16496
16520
  const res = await installTray({ quiet: true });
16497
16521
  say(
16498
- res.ran ? "menu-bar app updated" : `menu-bar app not updated (${res.reason ?? "unknown"}) \u2014 run \`agentbox install tray\` manually`
16522
+ res.ran ? "menu-bar app updated" : `menu-bar app not updated (${res.reason ?? "unknown"}) \u2014 run \`agentbox install app\` manually`
16499
16523
  );
16500
16524
  }
16501
16525
  async function runPostUpdateRefresh(opts = {}) {