@madarco/agentbox 0.20.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/dist/{_cloud-attach-MH7NKIZY.js → _cloud-attach-U3QJO7IF.js} +4 -4
  3. package/dist/{chunk-52LKNUY7.js → chunk-6JJIKCMY.js} +2 -2
  4. package/dist/{chunk-P6UT5XGE.js → chunk-DBMLOY3T.js} +11 -3
  5. package/dist/{chunk-P6UT5XGE.js.map → chunk-DBMLOY3T.js.map} +1 -1
  6. package/dist/{chunk-NXX3KQZ6.js → chunk-IXQTUXWV.js} +2 -2
  7. package/dist/{chunk-MODNW54N.js → chunk-KTEDFUKM.js} +2 -2
  8. package/dist/{chunk-4ATVA3RM.js → chunk-PX7G4PSI.js} +78 -23
  9. package/dist/chunk-PX7G4PSI.js.map +1 -0
  10. package/dist/{chunk-3465NDRZ.js → chunk-QKL7PCXQ.js} +127 -11
  11. package/dist/chunk-QKL7PCXQ.js.map +1 -0
  12. package/dist/{chunk-7K2A3NLE.js → chunk-X2DWS4KS.js} +14 -6
  13. package/dist/chunk-X2DWS4KS.js.map +1 -0
  14. package/dist/{chunk-5N7GA2X7.js → chunk-YZVFGFYQ.js} +263 -881
  15. package/dist/chunk-YZVFGFYQ.js.map +1 -0
  16. package/dist/{dist-G5PDFWKH.js → dist-FMA5Y25B.js} +5 -5
  17. package/dist/{dist-T3JIYHCA.js → dist-NWKOEWUJ.js} +120 -26
  18. package/dist/dist-NWKOEWUJ.js.map +1 -0
  19. package/dist/{dist-AJWL4WLW.js → dist-SAS4PIHA.js} +13 -3
  20. package/dist/{dist-CTTTHG6U.js → dist-U76JL6HI.js} +5 -5
  21. package/dist/{dist-LUEH7MER.js → dist-UVQJ2BZJ.js} +5 -5
  22. package/dist/index.js +1236 -561
  23. package/dist/index.js.map +1 -1
  24. package/dist/{prepared-state-MQHD3M5F-5ZMCNY43.js → prepared-state-MQHD3M5F-YYVVMTNJ.js} +2 -2
  25. package/package.json +6 -5
  26. package/runtime/daytona/custom-system-CLAUDE.md +13 -3
  27. package/runtime/docker/Dockerfile.box +44 -10
  28. package/runtime/docker/apps/cli/share/agentbox-setup/SKILL.md +6 -5
  29. package/runtime/docker/packages/ctl/dist/bin.cjs +324 -109
  30. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-portless-trust +82 -0
  31. package/runtime/docker/packages/sandbox-docker/scripts/custom-system-CLAUDE.md +12 -3
  32. package/runtime/e2b/agentbox-setup-skill.md +6 -5
  33. package/runtime/e2b/ctl.cjs +324 -109
  34. package/runtime/e2b/custom-system-CLAUDE.md +12 -3
  35. package/runtime/e2b/scripts/build-template.sh +44 -2
  36. package/runtime/hetzner/agentbox-portless-trust +82 -0
  37. package/runtime/hetzner/agentbox-setup-skill.md +6 -5
  38. package/runtime/hetzner/ctl.cjs +324 -109
  39. package/runtime/hetzner/custom-system-CLAUDE.md +12 -3
  40. package/runtime/hetzner/scripts/install-box.sh +51 -7
  41. package/runtime/relay/bin.cjs +187 -43
  42. package/runtime/vercel/agentbox-setup-skill.md +6 -5
  43. package/runtime/vercel/ctl.cjs +324 -109
  44. package/runtime/vercel/custom-system-CLAUDE.md +12 -3
  45. package/runtime/vercel/scripts/provision.sh +44 -2
  46. package/share/agentbox-setup/SKILL.md +6 -5
  47. package/share/host-skills/agentbox/SKILL.md +14 -0
  48. package/share/host-skills/agentbox-info/SKILL.md +30 -1
  49. package/dist/chunk-3465NDRZ.js.map +0 -1
  50. package/dist/chunk-4ATVA3RM.js.map +0 -1
  51. package/dist/chunk-5N7GA2X7.js.map +0 -1
  52. package/dist/chunk-7K2A3NLE.js.map +0 -1
  53. package/dist/dist-T3JIYHCA.js.map +0 -1
  54. /package/dist/{_cloud-attach-MH7NKIZY.js.map → _cloud-attach-U3QJO7IF.js.map} +0 -0
  55. /package/dist/{chunk-52LKNUY7.js.map → chunk-6JJIKCMY.js.map} +0 -0
  56. /package/dist/{chunk-NXX3KQZ6.js.map → chunk-IXQTUXWV.js.map} +0 -0
  57. /package/dist/{chunk-MODNW54N.js.map → chunk-KTEDFUKM.js.map} +0 -0
  58. /package/dist/{dist-G5PDFWKH.js.map → dist-FMA5Y25B.js.map} +0 -0
  59. /package/dist/{dist-AJWL4WLW.js.map → dist-SAS4PIHA.js.map} +0 -0
  60. /package/dist/{dist-CTTTHG6U.js.map → dist-U76JL6HI.js.map} +0 -0
  61. /package/dist/{dist-LUEH7MER.js.map → dist-UVQJ2BZJ.js.map} +0 -0
  62. /package/dist/{prepared-state-MQHD3M5F-5ZMCNY43.js.map → prepared-state-MQHD3M5F-YYVVMTNJ.js.map} +0 -0
@@ -6,7 +6,7 @@ import {
6
6
  readPreparedDockerState,
7
7
  resolveContextFiles,
8
8
  writePreparedDockerState
9
- } from "./chunk-7K2A3NLE.js";
9
+ } from "./chunk-X2DWS4KS.js";
10
10
  import "./chunk-WJFZJZIM.js";
11
11
  export {
12
12
  DOCKERFILE_PATH,
@@ -16,4 +16,4 @@ export {
16
16
  resolveContextFiles,
17
17
  writePreparedDockerState
18
18
  };
19
- //# sourceMappingURL=prepared-state-MQHD3M5F-5ZMCNY43.js.map
19
+ //# sourceMappingURL=prepared-state-MQHD3M5F-YYVVMTNJ.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madarco/agentbox",
3
- "version": "0.20.1",
3
+ "version": "0.21.0",
4
4
  "description": "Launch Claude Code, Codex, and other coding agents in isolated sandboxes",
5
5
  "license": "MIT",
6
6
  "author": "Marco D'Alia",
@@ -48,6 +48,7 @@
48
48
  "commander": "^12.1.0",
49
49
  "e2b": "^2.27.1",
50
50
  "execa": "^9.5.2",
51
+ "smol-toml": "^1.7.0",
51
52
  "supports-hyperlinks": "^3.1.0",
52
53
  "yaml": "^2.6.1"
53
54
  },
@@ -59,18 +60,18 @@
59
60
  "tsup": "^8.3.5",
60
61
  "typescript": "^5.7.2",
61
62
  "vitest": "^2.1.8",
62
- "@agentbox/core": "0.0.0",
63
63
  "@agentbox/config": "0.0.0",
64
64
  "@agentbox/ctl": "0.0.0",
65
+ "@agentbox/core": "0.0.0",
65
66
  "@agentbox/relay": "0.0.0",
66
- "@agentbox/sandbox-cloud": "0.0.0",
67
67
  "@agentbox/integrations": "0.0.0",
68
+ "@agentbox/sandbox-cloud": "0.0.0",
68
69
  "@agentbox/sandbox-core": "0.0.0",
69
70
  "@agentbox/sandbox-daytona": "0.0.0",
70
71
  "@agentbox/sandbox-docker": "0.0.0",
71
72
  "@agentbox/sandbox-e2b": "0.0.0",
72
- "@agentbox/sandbox-vercel": "0.0.0",
73
- "@agentbox/sandbox-hetzner": "0.0.0"
73
+ "@agentbox/sandbox-hetzner": "0.0.0",
74
+ "@agentbox/sandbox-vercel": "0.0.0"
74
75
  },
75
76
  "scripts": {
76
77
  "build": "tsup",
@@ -20,7 +20,12 @@ the host's worktree state. The wrapper already builds `git push <remote>
20
20
  <branch>` host-side from the registered worktree; the `-- <args>` slot is for
21
21
  extra flags only (e.g. `--force-with-lease`, `--tags`). Re-passing the remote
22
22
  or branch makes git treat them as refspecs and fails with
23
- `refs/remotes/origin/HEAD cannot be resolved to branch`.
23
+ `refs/remotes/origin/HEAD cannot be resolved to branch`. To make the branch
24
+ available on the host **without** publishing it to the remote, add
25
+ `--host-only` (e.g. `agentbox-ctl git push --host-only`); it lands the branch
26
+ in the host's local repo only. Add `--as <branch>` to choose the host branch
27
+ name (default: this box's branch), and `--force` to allow a non-fast-forward
28
+ overwrite.
24
29
 
25
30
  For GitHub PR work, use `agentbox-ctl git pr <op> [args...]` — same model,
26
31
  relay shells to host `gh`. Ops: `create`, `view`, `list`, `comment`,
@@ -29,11 +34,16 @@ read-only and run silently; everything else asks the user to confirm in
29
34
  the host wrapper (deny → exit 10).
30
35
 
31
36
  For ad-hoc file transfers between this box and the host, use
32
- `agentbox-ctl cp toHost <boxPath> <hostPath>` and
33
- `agentbox-ctl cp fromHost <hostPath> <boxPath>` or `agentbox-ctl download claude` / `download env` /
37
+ `agentbox-ctl cp toHost <boxPath...> <hostPath>` and
38
+ `agentbox-ctl cp fromHost <hostPath...> <boxPath>` (both accept multiple paths; wildcards expand in your shell) or `agentbox-ctl download claude` / `download env` /
34
39
  `download config`. They RPC to the host and
35
40
  ask the user for confirmation on the wrapper that runs `agentbox claude`;
36
41
  deny returns exit 10 (`denied by user`).
37
42
  Don't put any timeout on the command, it will run forever and the user will be notified through multiple channels.
38
43
 
44
+ If an agentbox.yaml file is present, services and docker containers will be started automatically.
45
+ Check the status with `agentbox-ctl status`.
46
+
47
+ To view any web services, open the browser to https://<AGENTBOX_BOX_HOST>. The AGENTBOX_BOX_HOST env var is available in the box and the same url will work from the host as well because it is a cloud provided url.
48
+
39
49
  Box identity: /etc/agentbox/box.env and the AGENTBOX_* env vars.
@@ -32,10 +32,12 @@ ENV DEBIAN_FRONTEND=noninteractive
32
32
  # outer terminal regardless; this just unlocks the in-pane side.
33
33
  #
34
34
  # DISABLE_AUTOUPDATER follows Anthropic's own devcontainer guidance: there's no
35
- # point updating Claude Code inside a sandbox that's torn down regularly, and
36
- # leaving it enabled triggers a "installMethod is native, but .local/bin
37
- # missing" warning when the host's .claude.json (synced in) reports a native
38
- # install method while the box uses npm-global.
35
+ # point updating Claude Code inside a sandbox that's torn down regularly. The box
36
+ # installs claude via Anthropic's native installer (below), so the binary lands
37
+ # at /home/vscode/.local/bin/claude and installMethod=native (synced in from the
38
+ # host's .claude.json) matches the box — no "installMethod is native, but
39
+ # .local/bin missing" warning, and the autoupdater would otherwise churn the
40
+ # pinned `stable` build.
39
41
  #
40
42
  # LANG/LC_ALL must be set via ENV (not /etc/environment, which is what the
41
43
  # devcontainers base seeds): `docker exec` doesn't source login files, so
@@ -265,7 +267,20 @@ RUN mkdir -p /home/vscode/.vscode-server/extensions /home/vscode/.cursor-server/
265
267
  # the host's `.claude.json` (with installMethod=native) expects, so the in-box
266
268
  # integrity check doesn't fire.
267
269
  USER vscode
268
- RUN curl -fsSL https://claude.ai/install.sh | bash -s stable
270
+ # Fetch the installer to a file (not `curl | bash`) so a blocked download — e.g.
271
+ # a Cloudflare 403 the CDN intermittently returns under load — fails the `&&`
272
+ # chain instead of being hidden behind bash's exit 0, and retry it (3 attempts,
273
+ # 60s then 240s backoff) before giving up, then verify `claude` is on PATH.
274
+ # (RUN's default shell is /bin/sh, so a plain loop — no pipefail/bash arrays.)
275
+ RUN i=1; while :; do \
276
+ curl -fsSL https://claude.ai/install.sh -o /tmp/claude-install.sh \
277
+ && bash /tmp/claude-install.sh stable \
278
+ && command -v claude >/dev/null && break; \
279
+ [ "$i" -ge 3 ] && { echo "claude native install failed after 3 attempts" >&2; exit 71; }; \
280
+ w=60; [ "$i" -ge 2 ] && w=240; \
281
+ echo "claude install attempt $i failed — backing off ${w}s" >&2; sleep "$w"; \
282
+ i=$((i+1)); \
283
+ done; rm -f /tmp/claude-install.sh
269
284
  USER root
270
285
 
271
286
  # OpenAI Codex CLI. The @openai/codex npm package ships platform-native
@@ -320,7 +335,7 @@ RUN npm install -g opencode-ai
320
335
  # wiped on `agentbox destroy`.
321
336
  RUN apt-get update \
322
337
  && apt-get install -y --no-install-recommends \
323
- libnss3 libnspr4 libatk1.0-0t64 libatk-bridge2.0-0t64 libcups2t64 \
338
+ libnss3 libnss3-tools libnspr4 libatk1.0-0t64 libatk-bridge2.0-0t64 libcups2t64 \
324
339
  libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \
325
340
  libgbm1 libdrm2 libpango-1.0-0 libcairo2 libasound2t64 \
326
341
  fonts-liberation xdg-utils \
@@ -390,6 +405,12 @@ RUN chmod +x /usr/local/bin/agentbox-vnc-start
390
405
  COPY packages/sandbox-docker/scripts/agentbox-dockerd-start /usr/local/bin/agentbox-dockerd-start
391
406
  RUN chmod +x /usr/local/bin/agentbox-dockerd-start
392
407
 
408
+ # In-box Portless CA trust helper — trusts the symmetric `<box>.localhost` CA in
409
+ # the system store + the box user's NSS db (Chromium/Playwright). Invoked at
410
+ # create when the host Portless proxy is TLS. certutil ships in libnss3-tools above.
411
+ COPY packages/sandbox-docker/scripts/agentbox-portless-trust /usr/local/bin/agentbox-portless-trust
412
+ RUN chmod +x /usr/local/bin/agentbox-portless-trust
413
+
393
414
  # Pre-`docker commit` cleanup for checkpoints. Baked into the image so the host
394
415
  # can always reach it via `docker exec --user root <ctr>
395
416
  # /usr/local/bin/agentbox-checkpoint-cleanup` regardless of the in-box state
@@ -435,13 +456,17 @@ RUN printf '%s\n' \
435
456
  'set -g escape-time 0' \
436
457
  > /etc/tmux.conf
437
458
 
438
- # System-wide Claude Code hint. NOTE: /etc/claude-code/CLAUDE.md is not a
459
+ # System-wide agent hint. NOTE: /etc/claude-code/CLAUDE.md is not a
439
460
  # documented Claude Code load path today (only /etc/claude-code/managed-settings.json
440
461
  # is, and that's settings-only) — kept here so it's discoverable via
441
462
  # `cat /etc/claude-code/CLAUDE.md` and forward-compatible if Claude Code
442
- # adds it to its memory chain. Until then, in-box agents learn the same
443
- # facts via /etc/agentbox/box.env + AGENTBOX_* env vars. Content lives in
444
- # scripts/custom-system-CLAUDE.md (edit there, not inline) for maintainability.
463
+ # adds it to its memory chain. Codex DOES consume it: seedCodexAgentsOverride()
464
+ # (packages/sandbox-docker/src/codex.ts) folds this file into the codex-config
465
+ # volume's ~/.codex/AGENTS.override.md at create time (a runtime seed, not an
466
+ # image bake — the ~/.codex volume would shadow a baked link). Until Claude loads
467
+ # it, Claude agents learn the same facts via /etc/agentbox/box.env + AGENTBOX_*
468
+ # env vars. Content lives in scripts/custom-system-CLAUDE.md (edit there, not
469
+ # inline) for maintainability.
445
470
  RUN mkdir -p /etc/claude-code
446
471
  COPY packages/sandbox-docker/scripts/custom-system-CLAUDE.md /etc/claude-code/CLAUDE.md
447
472
  RUN chmod 0644 /etc/claude-code/CLAUDE.md
@@ -485,6 +510,15 @@ RUN printf '%s\n' \
485
510
  ' . /etc/agentbox/box.env' \
486
511
  ' set +a' \
487
512
  'fi' \
513
+ '# Land interactive login shells in the workspace (remote-host integrations,' \
514
+ '# plain `ssh <box>`); interactive-only and only when still at $HOME.' \
515
+ 'case $- in' \
516
+ ' *i*)' \
517
+ ' if [ "$PWD" = "$HOME" ] && [ -d /workspace ]; then' \
518
+ ' cd /workspace' \
519
+ ' fi' \
520
+ ' ;;' \
521
+ 'esac' \
488
522
  > /etc/profile.d/agentbox.sh \
489
523
  && chmod 0644 /etc/profile.d/agentbox.sh
490
524
 
@@ -222,8 +222,9 @@ write back to the host):
222
222
  `obj`, `packages`, `dist`, `.next`, `target`) are dropped by default; `exclude:`
223
223
  is additive. Each carry entry is capped at `box.cpMaxBytes` (default 100 MiB
224
224
  after excludes) — the same limit `agentbox cp` enforces.
225
- - **`agentbox-ctl cp fromHost <hostPath> <boxPath>`** (ad-hoc, from inside the box)
226
- — for a one-off copy. Prompts the user on the host to approve.
225
+ - **`agentbox-ctl cp fromHost <hostPath...> <boxPath>`** (ad-hoc, from inside the box)
226
+ — for a one-off copy. Takes several sources in one call (last path is the dest,
227
+ which must be a directory). Prompts the user on the host to approve.
227
228
 
228
229
  **The per-copy size limit (important for large/legacy folders).** A single copy is
229
230
  blocked above `box.cpMaxBytes` (default **100 MB**) *after* default excludes, so it
@@ -236,9 +237,9 @@ the biggest remaining folders/subfolders. To get under the limit, EITHER:
236
237
  - pass `--yes` to copy the whole thing anyway (only when you really need it all).
237
238
 
238
239
  Example: a 2.4 GB legacy folder is mostly `packages/` (NuGet) + `.git`; those are
239
- excluded by default, and what's left can be split:
240
- `agentbox-ctl cp fromHost ../legacy/src /workspace/legacy/src` then
241
- `... cp fromHost ../legacy/Database /workspace/legacy/Database`.
240
+ excluded by default, and what's left can be copied in one call by listing the
241
+ sub-folders into a destination directory:
242
+ `agentbox-ctl cp fromHost ../legacy/src ../legacy/Database /workspace/legacy/`.
242
243
 
243
244
  ## 7. Validate before handing off
244
245