@madarco/agentbox 0.24.6 → 0.25.1

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 (161) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/LICENSE +21 -0
  3. package/README.md +4 -0
  4. package/dist/{_cloud-attach-ESCPOKG5.js → _cloud-attach-FGMI2ZHO.js} +5 -5
  5. package/dist/{chunk-4HPLS5HJ.js → chunk-3BR63LCB.js} +110 -9
  6. package/dist/chunk-3BR63LCB.js.map +1 -0
  7. package/dist/{chunk-OSPM4Q5V.js → chunk-3PSRBK24.js} +6 -6
  8. package/dist/chunk-3PSRBK24.js.map +1 -0
  9. package/dist/{chunk-CE3S7UDQ.js → chunk-4DBLYT2F.js} +44 -12
  10. package/dist/chunk-4DBLYT2F.js.map +1 -0
  11. package/dist/{chunk-3MDYQROX.js → chunk-4LS2TOF3.js} +17 -13
  12. package/dist/chunk-4LS2TOF3.js.map +1 -0
  13. package/dist/{chunk-H6A4BQMG.js → chunk-5F5SOSDY.js} +40 -1
  14. package/dist/chunk-5F5SOSDY.js.map +1 -0
  15. package/dist/{chunk-LJMGHFLZ.js → chunk-5VNL6SHJ.js} +3 -3
  16. package/dist/{chunk-7DPDUZ7L.js → chunk-67VF2QZC.js} +194 -56
  17. package/dist/chunk-67VF2QZC.js.map +1 -0
  18. package/dist/{chunk-RFRWS5CD.js → chunk-6GZK74GT.js} +2 -2
  19. package/dist/chunk-G3H2L3O2.js +0 -0
  20. package/dist/{chunk-5JDOTQTM.js → chunk-P5U6AP6K.js} +4 -4
  21. package/dist/chunk-WJFZJZIM.js +0 -0
  22. package/dist/{chunk-QHISF6O6.js → chunk-ZTSVY3YL.js} +3 -3
  23. package/dist/cloud-poller-SUNA6ZQC-7M5LJHHE.js +0 -0
  24. package/dist/{dist-VFPT5TDH.js → dist-4I7XHDC3.js} +6 -6
  25. package/dist/dist-5G42NFOG.js +677 -0
  26. package/dist/dist-5G42NFOG.js.map +1 -0
  27. package/dist/{dist-TRKHS6I7.js → dist-AZUD2LUA.js} +6 -6
  28. package/dist/{dist-FGXCG4JY.js → dist-MEK44IS5.js} +6 -6
  29. package/dist/{dist-HPPHBZTO.js → dist-SBDYDH7H.js} +8 -2
  30. package/dist/{dist-NOUPH5E6.js → dist-SN6ABGMD.js} +4 -4
  31. package/dist/{dist-3M53BF4E.js → dist-X7R2EMJL.js} +6 -6
  32. package/dist/index.js +114 -38
  33. package/dist/index.js.map +1 -1
  34. package/dist/{prepared-state-BUO75YLZ-46W2PAHH.js → prepared-state-75DIZ55S-5UAKJX3L.js} +2 -2
  35. package/package.json +29 -30
  36. package/runtime/_shared/agentbox-checkpoint-cleanup +0 -0
  37. package/runtime/_shared/agentbox-dockerd-start +0 -0
  38. package/runtime/_shared/agentbox-open +0 -0
  39. package/runtime/_shared/agentbox-portless-trust +0 -0
  40. package/runtime/_shared/agentbox-vnc-start +0 -0
  41. package/runtime/_shared/ctl.cjs +31 -4
  42. package/runtime/_shared/gh-shim +0 -0
  43. package/runtime/_shared/git-shim +0 -0
  44. package/runtime/_shared/linear-shim +0 -0
  45. package/runtime/_shared/ntn-shim +0 -0
  46. package/runtime/digitalocean/agentbox-checkpoint-cleanup +0 -0
  47. package/runtime/digitalocean/agentbox-dockerd-start +0 -0
  48. package/runtime/digitalocean/agentbox-open +0 -0
  49. package/runtime/digitalocean/agentbox-portless-trust +0 -0
  50. package/runtime/digitalocean/agentbox-vnc-start +0 -0
  51. package/runtime/digitalocean/ctl.cjs +31 -4
  52. package/runtime/digitalocean/gh-shim +0 -0
  53. package/runtime/digitalocean/git-shim +0 -0
  54. package/runtime/digitalocean/linear-shim +0 -0
  55. package/runtime/digitalocean/ntn-shim +0 -0
  56. package/runtime/digitalocean/scripts/install-box.sh +0 -0
  57. package/runtime/docker/packages/ctl/dist/bin.cjs +31 -4
  58. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup +0 -0
  59. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-dockerd-start +0 -0
  60. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-open +0 -0
  61. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-portless-trust +0 -0
  62. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-sshd-start +0 -0
  63. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-vnc-start +0 -0
  64. package/runtime/docker/packages/sandbox-docker/scripts/chromium-resolver +0 -0
  65. package/runtime/docker/packages/sandbox-docker/scripts/gh-shim +0 -0
  66. package/runtime/docker/packages/sandbox-docker/scripts/git-shim +0 -0
  67. package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +0 -0
  68. package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +0 -0
  69. package/runtime/e2b/agentbox-checkpoint-cleanup +0 -0
  70. package/runtime/e2b/agentbox-dockerd-start +0 -0
  71. package/runtime/e2b/agentbox-open +0 -0
  72. package/runtime/e2b/agentbox-vnc-start +0 -0
  73. package/runtime/e2b/ctl.cjs +31 -4
  74. package/runtime/e2b/gh-shim +0 -0
  75. package/runtime/e2b/git-shim +0 -0
  76. package/runtime/e2b/linear-shim +0 -0
  77. package/runtime/e2b/ntn-shim +0 -0
  78. package/runtime/e2b/scripts/build-template.sh +0 -0
  79. package/runtime/hetzner/agentbox-checkpoint-cleanup +0 -0
  80. package/runtime/hetzner/agentbox-dockerd-start +0 -0
  81. package/runtime/hetzner/agentbox-open +0 -0
  82. package/runtime/hetzner/agentbox-portless-trust +0 -0
  83. package/runtime/hetzner/agentbox-vnc-start +0 -0
  84. package/runtime/hetzner/ctl.cjs +31 -4
  85. package/runtime/hetzner/gh-shim +0 -0
  86. package/runtime/hetzner/git-shim +0 -0
  87. package/runtime/hetzner/linear-shim +0 -0
  88. package/runtime/hetzner/ntn-shim +0 -0
  89. package/runtime/hetzner/scripts/install-box.sh +0 -0
  90. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  91. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  92. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  93. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  94. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  95. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  96. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  97. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  98. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  99. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +6 -6
  100. package/runtime/hub/apps/hub/.next/server/chunks/_0760z6y._.js +1 -1
  101. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ro6vh6._.js +1 -1
  102. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  103. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  104. package/runtime/hub/apps/hub/{auth-HY5K55Y5.js → auth-MVL4NCQC.js} +3 -3
  105. package/runtime/hub/apps/hub/{auth-config-MNW2XGKK.js → auth-config-GRIXACTV.js} +3 -3
  106. package/runtime/hub/apps/hub/{chunk-5KMJIVZC.js → chunk-23AU7VYS.js} +111 -10
  107. package/runtime/hub/apps/hub/{chunk-OF242BLD.js → chunk-CKBHQ7OI.js} +1 -1
  108. package/runtime/hub/apps/hub/{chunk-DNR2YM2G.js → chunk-GARA7RQW.js} +58 -10
  109. package/runtime/hub/apps/hub/{chunk-PROXBLRJ.js → chunk-JLG5JJXD.js} +1 -1
  110. package/runtime/hub/apps/hub/{chunk-TZFWAJVB.js → chunk-OG4KH2FZ.js} +5 -0
  111. package/runtime/hub/apps/hub/chunk-QYJ37CUJ.js +62140 -0
  112. package/runtime/hub/apps/hub/{chunk-EY6HEDTK.js → chunk-RSENJ2FT.js} +17 -13
  113. package/runtime/hub/apps/hub/{chunk-EFW34I43.js → chunk-UDZ3VXRF.js} +1 -1
  114. package/runtime/hub/apps/hub/{chunk-TRUQCO4U.js → chunk-V3OMPMI3.js} +40 -1
  115. package/runtime/hub/apps/hub/{cloud-poller-SUNA6ZQC-VSKVMYHL.js → cloud-poller-SUNA6ZQC-YAWTNA2W.js} +1 -1
  116. package/runtime/hub/apps/hub/{dist-KV5ESR24.js → dist-DZGSA3US.js} +7 -7
  117. package/runtime/hub/apps/hub/{dist-NTKPAYA3.js → dist-IZ2JCN5R.js} +8 -2
  118. package/runtime/hub/apps/hub/{dist-M73U3ZDH.js → dist-JVU3QCLG.js} +7 -7
  119. package/runtime/hub/apps/hub/{dist-3DCKZYID.js → dist-TP4SXMDY.js} +596 -113
  120. package/runtime/hub/apps/hub/{dist-YCRESLWD.js → dist-VWSHZIPN.js} +7 -7
  121. package/runtime/hub/apps/hub/{dist-SX2NXGI6.js → dist-WZKTIA2R.js} +7 -7
  122. package/runtime/hub/apps/hub/{dist-RSWTJWRN.js → dist-YWY2DSSL.js} +5 -5
  123. package/runtime/hub/apps/hub/esm-VGBJAFLR.js +79 -0
  124. package/runtime/hub/apps/hub/{execa-4DLVNM6E.js → execa-AFY4ZODY.js} +2 -2
  125. package/runtime/hub/apps/hub/{hub-token-QKQWV2I6.js → hub-token-BJG6Q5II.js} +3 -3
  126. package/runtime/hub/apps/hub/{prepared-state-BUO75YLZ-KR4YLKDC.js → prepared-state-75DIZ55S-JDILR4OP.js} +3 -3
  127. package/runtime/hub/apps/hub/server.js +19 -19
  128. package/runtime/relay/bin.cjs +177 -42
  129. package/runtime/vercel/agentbox-checkpoint-cleanup +0 -0
  130. package/runtime/vercel/agentbox-dockerd-start +0 -0
  131. package/runtime/vercel/agentbox-open +0 -0
  132. package/runtime/vercel/agentbox-vnc-start +0 -0
  133. package/runtime/vercel/ctl.cjs +31 -4
  134. package/runtime/vercel/gh-shim +0 -0
  135. package/runtime/vercel/git-shim +0 -0
  136. package/runtime/vercel/linear-shim +0 -0
  137. package/runtime/vercel/ntn-shim +0 -0
  138. package/runtime/vercel/scripts/provision.sh +0 -0
  139. package/dist/chunk-3MDYQROX.js.map +0 -1
  140. package/dist/chunk-4HPLS5HJ.js.map +0 -1
  141. package/dist/chunk-7DPDUZ7L.js.map +0 -1
  142. package/dist/chunk-CE3S7UDQ.js.map +0 -1
  143. package/dist/chunk-H6A4BQMG.js.map +0 -1
  144. package/dist/chunk-OSPM4Q5V.js.map +0 -1
  145. package/dist/dist-2N3XHMBQ.js +0 -322
  146. package/dist/dist-2N3XHMBQ.js.map +0 -1
  147. /package/dist/{_cloud-attach-ESCPOKG5.js.map → _cloud-attach-FGMI2ZHO.js.map} +0 -0
  148. /package/dist/{chunk-LJMGHFLZ.js.map → chunk-5VNL6SHJ.js.map} +0 -0
  149. /package/dist/{chunk-RFRWS5CD.js.map → chunk-6GZK74GT.js.map} +0 -0
  150. /package/dist/{chunk-5JDOTQTM.js.map → chunk-P5U6AP6K.js.map} +0 -0
  151. /package/dist/{chunk-QHISF6O6.js.map → chunk-ZTSVY3YL.js.map} +0 -0
  152. /package/dist/{dist-HPPHBZTO.js.map → dist-4I7XHDC3.js.map} +0 -0
  153. /package/dist/{dist-NOUPH5E6.js.map → dist-AZUD2LUA.js.map} +0 -0
  154. /package/dist/{dist-FGXCG4JY.js.map → dist-MEK44IS5.js.map} +0 -0
  155. /package/dist/{dist-TRKHS6I7.js.map → dist-SBDYDH7H.js.map} +0 -0
  156. /package/dist/{dist-VFPT5TDH.js.map → dist-SN6ABGMD.js.map} +0 -0
  157. /package/dist/{dist-3M53BF4E.js.map → dist-X7R2EMJL.js.map} +0 -0
  158. /package/dist/{prepared-state-BUO75YLZ-46W2PAHH.js.map → prepared-state-75DIZ55S-5UAKJX3L.js.map} +0 -0
  159. /package/runtime/hub/apps/hub/.next/static/{2LDXStEUVHS2oK1ID_Uvo → fo5EgsHa6PFLTBagfLiuM}/_buildManifest.js +0 -0
  160. /package/runtime/hub/apps/hub/.next/static/{2LDXStEUVHS2oK1ID_Uvo → fo5EgsHa6PFLTBagfLiuM}/_clientMiddlewareManifest.js +0 -0
  161. /package/runtime/hub/apps/hub/.next/static/{2LDXStEUVHS2oK1ID_Uvo → fo5EgsHa6PFLTBagfLiuM}/_ssgManifest.js +0 -0
package/CHANGELOG.md CHANGED
@@ -9,6 +9,75 @@ Entries are generated from the commit history with `/release-notes` and then
9
9
  hand-reviewed — they describe what changed for someone using the `agentbox`
10
10
  CLI, not the raw commits.
11
11
 
12
+ ## [0.25.1] - 2026-07-13
13
+
14
+ ### Fixed
15
+
16
+ - `box.claudeInstall: npm` now pulls the prebuilt box image instead of building
17
+ it locally every time. The pull was hard-disabled for npm mode, from back when
18
+ only the native image was published — most visible as the throwaway container
19
+ behind `claude` sign-in baking from scratch. 0.25.0 started publishing the npm
20
+ image; this actually uses it.
21
+
22
+ ## [0.25.0] - 2026-07-13
23
+
24
+ ### Breaking
25
+
26
+ - Daytona boxes now default to the `linux-vm` sandbox class, which Daytona runs
27
+ in **`us-east-1` only** — so new boxes are pinned to US-East. Set
28
+ `box.daytonaClass: container` to keep the old behavior and your choice of
29
+ region. Existing container base snapshots keep working (a box boots the class
30
+ its base was baked as); run `agentbox prepare --provider daytona --force` to
31
+ move to a VM base.
32
+
33
+ ### Added
34
+
35
+ - **Daytona `linux-vm` sandbox class** (`box.daytonaClass`, default `linux-vm`).
36
+ `agentbox pause` is now a true VM freeze — CPU and memory are preserved, so
37
+ running processes and tmux sessions survive `unpause`. Checkpoints work
38
+ (~2 s capture; the old endpoint 404'd), and the base bake drops from ~7 min to
39
+ ~66 s. New keys: `box.daytonaRegion`, `box.daytonaTimeoutMs`,
40
+ `box.daytonaVmBaseImage`.
41
+ - Idle Daytona boxes now pause themselves after `box.daytonaTimeoutMs` (25 min).
42
+ The host enforces this: Daytona's own idle timer is reset by any request to the
43
+ sandbox — including AgentBox's own polling — so it never fired, and idle boxes
44
+ billed indefinitely.
45
+ - The box image is published for `box.claudeInstall: npm` too, so npm-mode users
46
+ get a pull hit instead of a silent local image build — and can use `linux-vm`
47
+ boxes, which can only boot from a published image.
48
+
49
+ ### Changed
50
+
51
+ - Daytona attach honors `attach.openIn` (`split`/`tab`/`window`) like every other
52
+ provider, instead of always taking over the current terminal.
53
+
54
+ ### Fixed
55
+
56
+ - `agentbox pause` on a container-class Daytona box failed outright with
57
+ `Sandbox is not stopped`.
58
+ - `agentbox shell` against a paused cloud box now resumes it first, rather than
59
+ failing — both the interactive and the one-shot `-- cmd` forms, on every cloud
60
+ provider.
61
+ - `agentbox daytona claude` (and `codex`/`opencode`, queued `-i` jobs, and the
62
+ dashboard) now boot from the base snapshot `prepare` baked. They read the
63
+ generic `box.image` instead of the per-provider key, so they ignored it — a
64
+ silent ~7-min rebuild per create, and on `linux-vm` a hard failure.
65
+ - Daytona interactive attach dropped instantly into "box rebooting —
66
+ reconnecting…" on a perfectly healthy box.
67
+ - `agentbox screen` on a `linux-vm` box opened the VNC desktop but no browser:
68
+ the image's environment (`DISPLAY`, …) is dropped by the VM conversion, and is
69
+ now restored.
70
+ - `agentbox prepare --provider daytona` no longer dies when it has to fall back
71
+ to a container base, and `create` no longer demands a VM base that the fallback
72
+ never produced.
73
+ - The box image is republished whenever its content changes. The publish workflow
74
+ filtered on paths that missed most of the image's real inputs, so an image
75
+ could silently go unpublished — which on Daytona quietly downgraded a VM box to
76
+ a container.
77
+ - `@madarco/agentbox-provider-sdk` 2.3.0: `CloudBackend` gains `timeoutModel` and
78
+ `attachExecLacksTty`, `AttachSpec` gains `initialInput`, and the box record
79
+ carries `sandboxClass`. Additive only.
80
+
12
81
  ## [0.24.6] - 2026-07-12
13
82
 
14
83
  ### Fixed
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Marco D'Alia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -199,6 +199,10 @@ pnpm --filter @madarco/agentbox-provider-sdk pack:test
199
199
 
200
200
  Full guide: [Build a provider](https://agent-box.sh/docs/build-a-provider) (and the authoring reference [`docs/provider-plugins.md`](https://github.com/madarco/agentbox/blob/main/docs/provider-plugins.md)). Reference packages: [`examples/agentbox-provider-sample`](https://github.com/madarco/agentbox/blob/main/examples/agentbox-provider-sample) (stub) and [`examples/agentbox-provider-example`](https://github.com/madarco/agentbox/blob/main/examples/agentbox-provider-example) (a real, Vercel-backed provider).
201
201
 
202
+ # Contributing
203
+
204
+ Bug reports, docs fixes, and provider work are welcome — see [CONTRIBUTING.md](https://github.com/madarco/agentbox/blob/main/CONTRIBUTING.md). First-time contributors sign a one-line [CLA](https://github.com/madarco/agentbox/blob/main/.github/CLA.md) on their first pull request. Security issues go through [SECURITY.md](https://github.com/madarco/agentbox/blob/main/SECURITY.md), not a public issue.
205
+
202
206
  # Author
203
207
 
204
208
  [Marco D'Alia](https://www.madarco.net) - [@madarco](https://x.com/madarco) - [Linkedin](https://www.linkedin.com/in/marcodalia/)
@@ -4,10 +4,10 @@ import {
4
4
  cloudAgentAttach,
5
5
  cloudAgentStartDetached,
6
6
  verifyDetachedSession
7
- } from "./chunk-CE3S7UDQ.js";
8
- import "./chunk-OSPM4Q5V.js";
9
- import "./chunk-H6A4BQMG.js";
10
- import "./chunk-3MDYQROX.js";
7
+ } from "./chunk-4DBLYT2F.js";
8
+ import "./chunk-3PSRBK24.js";
9
+ import "./chunk-5F5SOSDY.js";
10
+ import "./chunk-4LS2TOF3.js";
11
11
  import "./chunk-G3H2L3O2.js";
12
12
  import "./chunk-WJFZJZIM.js";
13
13
  export {
@@ -16,4 +16,4 @@ export {
16
16
  cloudAgentStartDetached,
17
17
  verifyDetachedSession
18
18
  };
19
- //# sourceMappingURL=_cloud-attach-ESCPOKG5.js.map
19
+ //# sourceMappingURL=_cloud-attach-FGMI2ZHO.js.map
@@ -22,13 +22,13 @@ import {
22
22
  readBoxStatus,
23
23
  registerBoxWithRelay,
24
24
  syncClaudeCredentials
25
- } from "./chunk-OSPM4Q5V.js";
25
+ } from "./chunk-3PSRBK24.js";
26
26
  import {
27
27
  hashProjectPath,
28
28
  loadEffectiveConfig,
29
29
  projectDirSegment,
30
30
  sanitizeMnemonic
31
- } from "./chunk-H6A4BQMG.js";
31
+ } from "./chunk-5F5SOSDY.js";
32
32
  import {
33
33
  AGENT_SYNC_SPECS,
34
34
  BOX_DYNAMIC_SYNC_MANIFEST,
@@ -66,6 +66,7 @@ import {
66
66
  resolveSyncTopology,
67
67
  resyncWorkspace,
68
68
  shouldAcceptCredentialUpdate,
69
+ stageAllAgentStatic,
69
70
  stageClaudeCredentialsForUpload,
70
71
  stageClaudeJsonOnlyForUpload,
71
72
  stageClaudeStaticForUpload,
@@ -76,7 +77,7 @@ import {
76
77
  stageOpencodeStateForUpload,
77
78
  stageOpencodeStaticForUpload,
78
79
  writeCredentialBackup
79
- } from "./chunk-3MDYQROX.js";
80
+ } from "./chunk-4LS2TOF3.js";
80
81
 
81
82
  // ../../packages/sandbox-cloud/dist/index.js
82
83
  import { basename as basename2, resolve } from "path";
@@ -417,6 +418,12 @@ async function ensureAgentVolumesForCloud(backend, opts = {}) {
417
418
  const log = opts.onLog ?? (() => {
418
419
  });
419
420
  const allAgents = AGENT_SPECS.map((s) => s.kind);
421
+ if (opts.volumesUsable === false) {
422
+ log(
423
+ `cloud backend '${backend.name}' cannot mount volumes for this sandbox class \u2014 agent credentials seeded per-create only`
424
+ );
425
+ return { mounts: [], env: buildForwardedEnv(allAgents), agents: allAgents };
426
+ }
420
427
  if (typeof backend.ensureVolume !== "function") {
421
428
  log(
422
429
  `cloud backend '${backend.name}' has no volume primitive \u2014 agent credentials seeded per-create only`
@@ -2079,7 +2086,11 @@ function createCloudProvider(backend, opts = {}) {
2079
2086
  if (!sandboxId) {
2080
2087
  throw new Error(`cloud box ${box.name} has no sandboxId \u2014 record is malformed`);
2081
2088
  }
2082
- return { sandboxId, inbound: box.cloud?.inbound };
2089
+ return {
2090
+ sandboxId,
2091
+ inbound: box.cloud?.inbound,
2092
+ sandboxClass: box.cloud?.sandboxClass
2093
+ };
2083
2094
  }
2084
2095
  function mintBox(req) {
2085
2096
  const id = generateBoxId();
@@ -2271,7 +2282,7 @@ function createCloudProvider(backend, opts = {}) {
2271
2282
  const image = opts.provisionImage ? await opts.provisionImage(req) : req.image ?? FALLBACK_IMAGE;
2272
2283
  const resources = opts.defaultResources ?? { cpu: 2, memory: 4, disk: 8 };
2273
2284
  const timeoutOverride = req.providerOptions?.["timeoutMs"];
2274
- const timeoutMs = typeof timeoutOverride === "number" && timeoutOverride > 0 ? timeoutOverride : void 0;
2285
+ const timeoutMs = typeof timeoutOverride === "number" && timeoutOverride >= 0 ? timeoutOverride : void 0;
2275
2286
  const networkPolicyOpt = req.providerOptions?.["networkPolicy"];
2276
2287
  const networkPolicy = typeof networkPolicyOpt === "string" && networkPolicyOpt.trim() !== "" ? networkPolicyOpt.trim() : void 0;
2277
2288
  const sizeOpt = req.providerOptions?.["size"];
@@ -2282,6 +2293,8 @@ function createCloudProvider(backend, opts = {}) {
2282
2293
  const inbound = typeof inboundOpt === "string" && inboundOpt.trim() !== "" ? inboundOpt.trim() : void 0;
2283
2294
  const projectOpt = req.providerOptions?.["project"];
2284
2295
  const project = typeof projectOpt === "string" && projectOpt.trim() !== "" ? projectOpt.trim() : void 0;
2296
+ const classOpt = req.providerOptions?.["sandboxClass"];
2297
+ const sandboxClass = typeof classOpt === "string" && classOpt.trim() !== "" ? classOpt.trim() : void 0;
2285
2298
  const relayToken = generateRelayToken();
2286
2299
  const bridgeToken = generateRelayToken();
2287
2300
  try {
@@ -2309,7 +2322,12 @@ function createCloudProvider(backend, opts = {}) {
2309
2322
  );
2310
2323
  }
2311
2324
  }
2312
- const agentVolumes = await ensureAgentVolumesForCloud(backend, { onLog: log });
2325
+ const agentVolumes = await ensureAgentVolumesForCloud(backend, {
2326
+ onLog: log,
2327
+ // Daytona's linux-vm class accepts volume mounts and never honors them
2328
+ // (see ensureAgentVolumesForCloud) — take the per-create upload path.
2329
+ volumesUsable: sandboxClass !== "linux-vm"
2330
+ });
2313
2331
  const exposeServicePorts = await readExposedServicePorts(req.workspacePath);
2314
2332
  const credentialSyncOff = (req.credentialSync ?? (await loadEffectiveConfig(req.projectRoot ?? req.workspacePath)).effective.box.credentialSync) === false;
2315
2333
  const provisionEnv = {
@@ -2339,6 +2357,7 @@ function createCloudProvider(backend, opts = {}) {
2339
2357
  location,
2340
2358
  project,
2341
2359
  inbound,
2360
+ sandboxClass,
2342
2361
  timeoutMs,
2343
2362
  exposePorts: exposeServicePorts,
2344
2363
  networkPolicy,
@@ -2637,6 +2656,10 @@ function createCloudProvider(backend, opts = {}) {
2637
2656
  // Inbound-access policy the backend applied to the per-box firewall
2638
2657
  // (VPS providers). Persisted so drift re-syncs preserve the whitelist.
2639
2658
  inbound: handle.inbound,
2659
+ // Daytona sandbox class, read back from the class of the snapshot the
2660
+ // box actually booted from (not from config, which can disagree).
2661
+ // pause() branches on it: a VM pauses, a container archives.
2662
+ sandboxClass: handle.sandboxClass,
2640
2663
  // Only host-seeded boxes share a fork base with the host, so only
2641
2664
  // they can be resynced back to the host tip on session start (7.5).
2642
2665
  // inBoxClone / plane boxes clone from a leased URL — left unset.
@@ -2814,12 +2837,28 @@ function createCloudProvider(backend, opts = {}) {
2814
2837
  const handle = handleFor(box);
2815
2838
  const baseArgv = await backend.attachArgv(handle);
2816
2839
  const inner = renderInnerCommand(kind, opts2);
2817
- const argv = opts2?.detached ? [...baseArgv.slice(1), inner] : [...baseArgv.slice(1), "-t", inner];
2840
+ const viaStdin = backend.attachExecLacksTty === true && !opts2?.detached && kind !== "logs";
2841
+ const scriptPath = viaStdin ? attachScriptPath(opts2?.sessionName ?? kind) : "";
2842
+ if (viaStdin) {
2843
+ const b64 = Buffer.from(inner, "utf8").toString("base64");
2844
+ await backend.exec(
2845
+ handle,
2846
+ `printf %s '${b64}' | base64 -d > ${scriptPath} && chmod 700 ${scriptPath}`
2847
+ );
2848
+ }
2849
+ const argv = opts2?.detached ? [...baseArgv.slice(1), inner] : viaStdin ? [...baseArgv.slice(1)] : [...baseArgv.slice(1), "-t", inner];
2818
2850
  const fullArgv = [baseArgv[0], ...argv];
2819
2851
  const cleanup = backend.revokeAttachToken ? async () => {
2820
2852
  await backend.revokeAttachToken(handle, baseArgv);
2821
2853
  } : void 0;
2822
- return { argv: fullArgv, cleanup };
2854
+ return {
2855
+ argv: fullArgv,
2856
+ // `exec` so the script replaces the login shell: the user never lands
2857
+ // back on a prompt when they detach from tmux.
2858
+ ...viaStdin ? { initialInput: `exec bash ${scriptPath}
2859
+ ` } : {},
2860
+ cleanup
2861
+ };
2823
2862
  },
2824
2863
  async uploadPath(box, hostSrcs, boxDst, exclude) {
2825
2864
  return uploadToCloudBox(backend, handleFor(box), hostSrcs, boxDst, exclude);
@@ -2985,6 +3024,10 @@ function hostTermForCloud() {
2985
3024
  const t = process.env["TERM"];
2986
3025
  return t && /^[A-Za-z0-9][A-Za-z0-9._+-]*$/.test(t) ? t : "xterm-256color";
2987
3026
  }
3027
+ function attachScriptPath(sessionName) {
3028
+ const safe = sessionName.replace(/[^A-Za-z0-9._-]/g, "_").slice(0, 40) || "attach";
3029
+ return `/tmp/agentbox-attach-${safe}.sh`;
3030
+ }
2988
3031
  function renderInnerCommand(kind, opts) {
2989
3032
  const sessionName = opts?.sessionName ?? defaultSessionName(kind);
2990
3033
  const fallback = opts?.command ?? defaultCommand(kind, opts);
@@ -3036,6 +3079,62 @@ function defaultCommand(kind, opts) {
3036
3079
  function shellSingle(s) {
3037
3080
  return "'" + s.replace(/'/g, "'\\''") + "'";
3038
3081
  }
3082
+ function remoteTarFor(kind) {
3083
+ return `/tmp/agentbox-seed-${kind}.tar.gz`;
3084
+ }
3085
+ var REMOTE_CLAUDE_MD = "/tmp/agentbox-custom-CLAUDE.md";
3086
+ function buildAgentStaticSeedCommands(usable, opts = {}) {
3087
+ const cmds = [];
3088
+ if (opts.claudeMdOverlay) {
3089
+ cmds.push(
3090
+ `sudo -n mkdir -p /etc/claude-code && sudo -n install -m 0644 ${REMOTE_CLAUDE_MD} /etc/claude-code/CLAUDE.md && rm -f ${REMOTE_CLAUDE_MD}`
3091
+ );
3092
+ }
3093
+ for (const s of usable) {
3094
+ cmds.push(
3095
+ `mkdir -p ${s.extractDir} && tar -xzf ${remoteTarFor(s.kind)} -C ${s.extractDir} --no-same-permissions --no-same-owner -m && rm -f ${remoteTarFor(s.kind)}`
3096
+ );
3097
+ }
3098
+ if (usable.length > 0) {
3099
+ cmds.push(
3100
+ "sudo -n chown -R vscode:vscode /home/vscode/.claude /home/vscode/.codex /home/vscode/.local && ( [ -d /home/vscode/.agents ] && sudo -n chown -R vscode:vscode /home/vscode/.agents || true )"
3101
+ );
3102
+ }
3103
+ return cmds;
3104
+ }
3105
+ async function seedAgentStaticIntoCloudBox(backend, handle, opts = {}) {
3106
+ const log = opts.onLog ?? (() => {
3107
+ });
3108
+ const stages = await stageAllAgentStatic({ hostWorkspace: opts.hostWorkspace });
3109
+ try {
3110
+ for (const s of stages) {
3111
+ for (const w of s.staged.warnings) log(w);
3112
+ }
3113
+ const usable = stages.filter((s) => s.staged.tarballPath !== null);
3114
+ if (opts.claudeMdOverlay) {
3115
+ await backend.uploadFile(handle, opts.claudeMdOverlay, REMOTE_CLAUDE_MD);
3116
+ }
3117
+ for (const s of usable) {
3118
+ await backend.uploadFile(handle, s.staged.tarballPath, remoteTarFor(s.kind));
3119
+ }
3120
+ const cmds = buildAgentStaticSeedCommands(usable, {
3121
+ claudeMdOverlay: Boolean(opts.claudeMdOverlay)
3122
+ });
3123
+ for (const cmd of cmds) {
3124
+ const r = await backend.exec(handle, cmd);
3125
+ if (r.exitCode !== 0) {
3126
+ throw new Error(
3127
+ `agent-static seed failed (exit ${String(r.exitCode)}): ${cmd}
3128
+ ${r.stdout}${r.stderr}`
3129
+ );
3130
+ }
3131
+ }
3132
+ log(`seeded agent static config: ${usable.map((s) => s.kind).join(", ") || "(none)"}`);
3133
+ return { seeded: usable.map((s) => s.kind) };
3134
+ } finally {
3135
+ await Promise.all(stages.map((s) => s.staged.cleanup()));
3136
+ }
3137
+ }
3039
3138
  async function openWebAppOnVncScreen(box, provider) {
3040
3139
  const persisted = await readBoxStatus(box);
3041
3140
  const hasWebService = persisted?.services.some((s) => s.expose) ?? false;
@@ -3061,6 +3160,7 @@ export {
3061
3160
  ensureAgentVolumesForCloud,
3062
3161
  seedAgentVolumesIfFresh,
3063
3162
  agentSpecsForCloud,
3163
+ cloudSnapshotName,
3064
3164
  listCloudBackendDirs,
3065
3165
  listCloudCheckpoints,
3066
3166
  listAllCloudCheckpoints,
@@ -3073,6 +3173,7 @@ export {
3073
3173
  createCloudProvider,
3074
3174
  hostTermForCloud,
3075
3175
  renderInnerCommand,
3176
+ seedAgentStaticIntoCloudBox,
3076
3177
  openWebAppOnVncScreen
3077
3178
  };
3078
- //# sourceMappingURL=chunk-4HPLS5HJ.js.map
3179
+ //# sourceMappingURL=chunk-3BR63LCB.js.map