@madarco/agentbox 0.20.0 → 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 (64) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/dist/{_cloud-attach-THTN4CFZ.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-7RWFYLF3.js → chunk-PX7G4PSI.js} +78 -23
  9. package/dist/chunk-PX7G4PSI.js.map +1 -0
  10. package/dist/{chunk-ZX6DTA4X.js → chunk-QKL7PCXQ.js} +220 -16
  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-3VFY3N4A.js → chunk-YZVFGFYQ.js} +320 -956
  15. package/dist/chunk-YZVFGFYQ.js.map +1 -0
  16. package/dist/{dist-7ELDXBAG.js → dist-FMA5Y25B.js} +9 -6
  17. package/dist/{dist-7ELDXBAG.js.map → dist-FMA5Y25B.js.map} +1 -1
  18. package/dist/{dist-C3YRC3PP.js → dist-NWKOEWUJ.js} +120 -26
  19. package/dist/dist-NWKOEWUJ.js.map +1 -0
  20. package/dist/{dist-3PLT2EK2.js → dist-SAS4PIHA.js} +15 -3
  21. package/dist/{dist-3WFNXXPE.js → dist-U76JL6HI.js} +7 -6
  22. package/dist/{dist-3WFNXXPE.js.map → dist-U76JL6HI.js.map} +1 -1
  23. package/dist/{dist-CZ6CRADC.js → dist-UVQJ2BZJ.js} +5 -5
  24. package/dist/dist-UVQJ2BZJ.js.map +1 -0
  25. package/dist/index.js +1236 -561
  26. package/dist/index.js.map +1 -1
  27. package/dist/{prepared-state-MQHD3M5F-5ZMCNY43.js → prepared-state-MQHD3M5F-YYVVMTNJ.js} +2 -2
  28. package/package.json +4 -3
  29. package/runtime/daytona/custom-system-CLAUDE.md +13 -3
  30. package/runtime/docker/Dockerfile.box +57 -10
  31. package/runtime/docker/apps/cli/share/agentbox-setup/SKILL.md +6 -5
  32. package/runtime/docker/packages/ctl/dist/bin.cjs +324 -109
  33. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-portless-trust +82 -0
  34. package/runtime/docker/packages/sandbox-docker/scripts/custom-system-CLAUDE.md +12 -3
  35. package/runtime/e2b/agentbox-setup-skill.md +6 -5
  36. package/runtime/e2b/attach-helper.cjs +4 -1
  37. package/runtime/e2b/ctl.cjs +324 -109
  38. package/runtime/e2b/custom-system-CLAUDE.md +12 -3
  39. package/runtime/e2b/scripts/build-template.sh +54 -2
  40. package/runtime/hetzner/agentbox-portless-trust +82 -0
  41. package/runtime/hetzner/agentbox-setup-skill.md +6 -5
  42. package/runtime/hetzner/ctl.cjs +324 -109
  43. package/runtime/hetzner/custom-system-CLAUDE.md +12 -3
  44. package/runtime/hetzner/scripts/install-box.sh +60 -7
  45. package/runtime/relay/bin.cjs +187 -43
  46. package/runtime/vercel/agentbox-setup-skill.md +6 -5
  47. package/runtime/vercel/ctl.cjs +324 -109
  48. package/runtime/vercel/custom-system-CLAUDE.md +12 -3
  49. package/runtime/vercel/scripts/provision.sh +64 -2
  50. package/share/agentbox-setup/SKILL.md +6 -5
  51. package/share/host-skills/agentbox/SKILL.md +14 -0
  52. package/share/host-skills/agentbox-info/SKILL.md +30 -1
  53. package/dist/chunk-3VFY3N4A.js.map +0 -1
  54. package/dist/chunk-7K2A3NLE.js.map +0 -1
  55. package/dist/chunk-7RWFYLF3.js.map +0 -1
  56. package/dist/chunk-ZX6DTA4X.js.map +0 -1
  57. package/dist/dist-C3YRC3PP.js.map +0 -1
  58. package/dist/dist-CZ6CRADC.js.map +0 -1
  59. /package/dist/{_cloud-attach-THTN4CFZ.js.map → _cloud-attach-U3QJO7IF.js.map} +0 -0
  60. /package/dist/{chunk-52LKNUY7.js.map → chunk-6JJIKCMY.js.map} +0 -0
  61. /package/dist/{chunk-NXX3KQZ6.js.map → chunk-IXQTUXWV.js.map} +0 -0
  62. /package/dist/{chunk-MODNW54N.js.map → chunk-KTEDFUKM.js.map} +0 -0
  63. /package/dist/{dist-3PLT2EK2.js.map → dist-SAS4PIHA.js.map} +0 -0
  64. /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.0",
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
  },
@@ -60,10 +61,10 @@
60
61
  "typescript": "^5.7.2",
61
62
  "vitest": "^2.1.8",
62
63
  "@agentbox/config": "0.0.0",
63
- "@agentbox/core": "0.0.0",
64
64
  "@agentbox/ctl": "0.0.0",
65
- "@agentbox/integrations": "0.0.0",
65
+ "@agentbox/core": "0.0.0",
66
66
  "@agentbox/relay": "0.0.0",
67
+ "@agentbox/integrations": "0.0.0",
67
68
  "@agentbox/sandbox-cloud": "0.0.0",
68
69
  "@agentbox/sandbox-core": "0.0.0",
69
70
  "@agentbox/sandbox-daytona": "0.0.0",
@@ -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
@@ -68,6 +70,7 @@ RUN apt-get update \
68
70
  python3-venv \
69
71
  build-essential \
70
72
  git \
73
+ git-lfs \
71
74
  tmux \
72
75
  vim \
73
76
  libcap2-bin \
@@ -112,6 +115,18 @@ RUN mkdir -p /home/vscode/.cache/node/corepack \
112
115
  # bind-mount of ~/.gitconfig from the host.
113
116
  RUN git config --system --add safe.directory '*'
114
117
 
118
+ # git-lfs (installed above) must register its filter.lfs.* hooks, otherwise a
119
+ # checkout of an LFS-tracked repo skips smudge/clean entirely. More to the
120
+ # point: the host's ~/.gitconfig is bind-mounted RO into the box and a user who
121
+ # ran `git lfs install` on the host has `filter.lfs.process = git-lfs
122
+ # filter-process` in it. The in-container `git worktree add` (seedWorkspace)
123
+ # then spawns that filter on checkout, so the `git-lfs` binary has to be on
124
+ # PATH or the add dies with "git-lfs: not found / the remote end hung up
125
+ # unexpectedly". `--system` writes /etc/gitconfig (the host-config bind only
126
+ # covers ~/.gitconfig), so repos that declare LFS purely via .gitattributes
127
+ # resolve too. `--skip-repo` keeps it from touching any checkout at build time.
128
+ RUN git lfs install --system --skip-repo
129
+
115
130
  # Docker-in-Docker. dockerd inside the box lets the agent run
116
131
  # `docker build`/`docker run` in its own namespace without exposing the host
117
132
  # daemon. The storage driver is NOT pinned here: agentbox-dockerd-start picks
@@ -252,7 +267,20 @@ RUN mkdir -p /home/vscode/.vscode-server/extensions /home/vscode/.cursor-server/
252
267
  # the host's `.claude.json` (with installMethod=native) expects, so the in-box
253
268
  # integrity check doesn't fire.
254
269
  USER vscode
255
- 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
256
284
  USER root
257
285
 
258
286
  # OpenAI Codex CLI. The @openai/codex npm package ships platform-native
@@ -307,7 +335,7 @@ RUN npm install -g opencode-ai
307
335
  # wiped on `agentbox destroy`.
308
336
  RUN apt-get update \
309
337
  && apt-get install -y --no-install-recommends \
310
- libnss3 libnspr4 libatk1.0-0t64 libatk-bridge2.0-0t64 libcups2t64 \
338
+ libnss3 libnss3-tools libnspr4 libatk1.0-0t64 libatk-bridge2.0-0t64 libcups2t64 \
311
339
  libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \
312
340
  libgbm1 libdrm2 libpango-1.0-0 libcairo2 libasound2t64 \
313
341
  fonts-liberation xdg-utils \
@@ -377,6 +405,12 @@ RUN chmod +x /usr/local/bin/agentbox-vnc-start
377
405
  COPY packages/sandbox-docker/scripts/agentbox-dockerd-start /usr/local/bin/agentbox-dockerd-start
378
406
  RUN chmod +x /usr/local/bin/agentbox-dockerd-start
379
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
+
380
414
  # Pre-`docker commit` cleanup for checkpoints. Baked into the image so the host
381
415
  # can always reach it via `docker exec --user root <ctr>
382
416
  # /usr/local/bin/agentbox-checkpoint-cleanup` regardless of the in-box state
@@ -422,13 +456,17 @@ RUN printf '%s\n' \
422
456
  'set -g escape-time 0' \
423
457
  > /etc/tmux.conf
424
458
 
425
- # 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
426
460
  # documented Claude Code load path today (only /etc/claude-code/managed-settings.json
427
461
  # is, and that's settings-only) — kept here so it's discoverable via
428
462
  # `cat /etc/claude-code/CLAUDE.md` and forward-compatible if Claude Code
429
- # adds it to its memory chain. Until then, in-box agents learn the same
430
- # facts via /etc/agentbox/box.env + AGENTBOX_* env vars. Content lives in
431
- # 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.
432
470
  RUN mkdir -p /etc/claude-code
433
471
  COPY packages/sandbox-docker/scripts/custom-system-CLAUDE.md /etc/claude-code/CLAUDE.md
434
472
  RUN chmod 0644 /etc/claude-code/CLAUDE.md
@@ -472,6 +510,15 @@ RUN printf '%s\n' \
472
510
  ' . /etc/agentbox/box.env' \
473
511
  ' set +a' \
474
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' \
475
522
  > /etc/profile.d/agentbox.sh \
476
523
  && chmod 0644 /etc/profile.d/agentbox.sh
477
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