@madarco/agentbox 0.1.0 → 0.3.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.
@@ -13,10 +13,10 @@ import {
13
13
  startBox,
14
14
  stopBox,
15
15
  unpauseBox
16
- } from "./chunk-RWJE6AER.js";
16
+ } from "./chunk-7NQFIBQG.js";
17
17
  import {
18
18
  SNAPSHOTS_ROOT
19
- } from "./chunk-O5HS3QHW.js";
19
+ } from "./chunk-MOC54XL6.js";
20
20
  import "./chunk-IDR4HVIC.js";
21
21
  import "./chunk-SOMIKEN2.js";
22
22
  export {
@@ -35,4 +35,4 @@ export {
35
35
  stopBox,
36
36
  unpauseBox
37
37
  };
38
- //# sourceMappingURL=lifecycle-P4FSKGR2-3466P54Y.js.map
38
+ //# sourceMappingURL=lifecycle-YTMZYKOE-R4M3OR27.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madarco/agentbox",
3
- "version": "0.1.0",
3
+ "version": "0.3.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",
@@ -149,13 +149,16 @@ services:
149
149
  1. Write the file to `/workspace/agentbox.yaml`.
150
150
  2. **Apply it live**: from inside the box run `agentbox-ctl reload`. The already-running supervisor re-reads the config and immediately runs the declared tasks and autostarts the services — no box restart needed. It prints the `added` / `removed` / `changed` diff. If it errors because the daemon isn't running, the config is still valid: the next `agentbox start` (or `agentbox create` in this workspace) picks it up automatically.
151
151
  3. Confirm with `agentbox-ctl status`: tasks should be `running` or `done`, autostart services `starting` or `ready`. If something failed, tail it with `agentbox-ctl logs <service>` and fix the config, then `agentbox-ctl reload` again.
152
- 4. Tell the user:
152
+
153
+ 4. **Then do section 9** — once the box is warmed up (deps installed, services ready), checkpoint it with `agentbox-ctl checkpoint --set-default` so future boxes start ready. This is the real final step; don't stop at hand-off.
154
+
155
+ 5. Tell the user:
153
156
 
154
157
  > I wrote `/workspace/agentbox.yaml` and ran `agentbox-ctl reload` so the supervisor is already running the declared tasks/services. To land the file on the host:
158
+ > - I've created a checkpoint of the warm box state so future boxes start ready in seconds, no reinstall.
155
159
  > - commit it inside the box (`git add agentbox.yaml && git commit -m 'add agentbox config'`) — the box's `.git/` is bind-mounted, so the commit shows up on the host immediately; or
156
- > - on the host, tell the user to run `agentbox pull config` to update their original host workspace. `agentbox pull env` if you also create env files.
160
+ > - on the host, tell the user to run `agentbox pull config` to update their original host workspace.
157
161
 
158
- 5. **Then do section 9** — once the box is warmed up (deps installed, services ready), checkpoint it so future boxes start ready. This is the real final step; don't stop at hand-off.
159
162
 
160
163
  ## 9. Checkpoint the warm state (do this at the very end)
161
164
 
@@ -185,4 +188,5 @@ Then tell the user, e.g.:
185
188
 
186
189
  - For Nextjs/Vite/Tasnstack projects, makes sure to forward also websocket for hot reload.
187
190
  - **Turbo/Nx/Jest and other git-worktree-aware tools may try to write their cache to a read-only host path.** The box runs `/workspace` as a git worktree with the host repo's `.git/` bind-mounted at its absolute host path; tools that derive paths from git (Turbo's cache root = the worktree's git *common dir*) resolve outside `/workspace` and hit `EROFS` on the Mac path. Pin the cache into the writable overlay via the task/service `env:`, e.g. `TURBO_CACHE_DIR: /workspace/.turbo/cache` (or pass `--cache-dir`).
188
- - The `install` task is intentionally a no-op once `node_modules/.agentbox-installed` exists. Do **not** remove the marker guard to "force a fresh install" — that reinstalls on every box start. To force a one-off rebuild, delete `node_modules` (or just the marker) then run `agentbox-ctl reload`.
191
+ - The `install` task is intentionally a no-op once `node_modules/.agentbox-installed` exists. Do **not** remove the marker guard to "force a fresh install" — that reinstalls on every box start. To force a one-off rebuild, delete `node_modules` (or just the marker) then run `agentbox-ctl reload`.
192
+ - `.pnpm-store` default location is read only, so you need to point it to a writable location in the box's writable workspace eg: `PNPM_STORE: /workspace/.pnpm-store` and add `.pnpm-store/` to the `.gitignore` if the workspace root is git-tracked.
@@ -12017,6 +12017,17 @@ var import_node_child_process3 = require("child_process");
12017
12017
 
12018
12018
  // src/tmux.ts
12019
12019
  var import_node_child_process2 = require("child_process");
12020
+ var import_node_os = require("os");
12021
+ var MAX_TITLE_LEN = 120;
12022
+ function sanitizePaneTitle(raw, ctx) {
12023
+ const t = raw.trim();
12024
+ if (t.length === 0) return null;
12025
+ const lower = t.toLowerCase();
12026
+ if (ctx.hostname && lower === ctx.hostname.toLowerCase()) return null;
12027
+ if (ctx.sessionName && lower === ctx.sessionName.toLowerCase()) return null;
12028
+ if (["bash", "-bash", "sh", "-sh", "zsh", "-zsh", "tmux"].includes(lower)) return null;
12029
+ return t.length > MAX_TITLE_LEN ? t.slice(0, MAX_TITLE_LEN) : t;
12030
+ }
12020
12031
  function runTool(cmd, args) {
12021
12032
  return new Promise((resolve) => {
12022
12033
  const child = (0, import_node_child_process2.spawn)(cmd, args, { stdio: ["ignore", "pipe", "pipe"] });
@@ -12030,7 +12041,8 @@ function runTool(cmd, args) {
12030
12041
  }
12031
12042
  async function probeClaudeSession(sessionName) {
12032
12043
  const has = await runTool("tmux", ["has-session", "-t", sessionName]);
12033
- if (has.exitCode !== 0) return { running: false, sessionName, startedAt: null };
12044
+ if (has.exitCode !== 0)
12045
+ return { running: false, sessionName, startedAt: null, title: null };
12034
12046
  const ts = await runTool("tmux", [
12035
12047
  "display-message",
12036
12048
  "-p",
@@ -12043,7 +12055,15 @@ async function probeClaudeSession(sessionName) {
12043
12055
  const secs = Number.parseInt(ts.stdout.trim(), 10);
12044
12056
  if (Number.isFinite(secs) && secs > 0) startedAt = new Date(secs * 1e3).toISOString();
12045
12057
  }
12046
- return { running: true, sessionName, startedAt };
12058
+ const pt = await runTool("tmux", [
12059
+ "display-message",
12060
+ "-p",
12061
+ "-t",
12062
+ sessionName,
12063
+ "#{pane_title}"
12064
+ ]);
12065
+ const title = pt.exitCode === 0 ? sanitizePaneTitle(pt.stdout, { hostname: (0, import_node_os.hostname)(), sessionName }) : null;
12066
+ return { running: true, sessionName, startedAt, title };
12047
12067
  }
12048
12068
 
12049
12069
  // src/status-reporter.ts
@@ -12135,7 +12155,8 @@ var StatusReporter = class {
12135
12155
  claude: {
12136
12156
  state: this.claudeState,
12137
12157
  updatedAt: this.claudeUpdatedAt,
12138
- sessionRunning: session.running
12158
+ sessionRunning: session.running,
12159
+ ...session.title ? { sessionTitle: session.title } : {}
12139
12160
  }
12140
12161
  };
12141
12162
  }
@@ -149,13 +149,16 @@ services:
149
149
  1. Write the file to `/workspace/agentbox.yaml`.
150
150
  2. **Apply it live**: from inside the box run `agentbox-ctl reload`. The already-running supervisor re-reads the config and immediately runs the declared tasks and autostarts the services — no box restart needed. It prints the `added` / `removed` / `changed` diff. If it errors because the daemon isn't running, the config is still valid: the next `agentbox start` (or `agentbox create` in this workspace) picks it up automatically.
151
151
  3. Confirm with `agentbox-ctl status`: tasks should be `running` or `done`, autostart services `starting` or `ready`. If something failed, tail it with `agentbox-ctl logs <service>` and fix the config, then `agentbox-ctl reload` again.
152
- 4. Tell the user:
152
+
153
+ 4. **Then do section 9** — once the box is warmed up (deps installed, services ready), checkpoint it with `agentbox-ctl checkpoint --set-default` so future boxes start ready. This is the real final step; don't stop at hand-off.
154
+
155
+ 5. Tell the user:
153
156
 
154
157
  > I wrote `/workspace/agentbox.yaml` and ran `agentbox-ctl reload` so the supervisor is already running the declared tasks/services. To land the file on the host:
158
+ > - I've created a checkpoint of the warm box state so future boxes start ready in seconds, no reinstall.
155
159
  > - commit it inside the box (`git add agentbox.yaml && git commit -m 'add agentbox config'`) — the box's `.git/` is bind-mounted, so the commit shows up on the host immediately; or
156
- > - on the host, tell the user to run `agentbox pull config` to update their original host workspace. `agentbox pull env` if you also create env files.
160
+ > - on the host, tell the user to run `agentbox pull config` to update their original host workspace.
157
161
 
158
- 5. **Then do section 9** — once the box is warmed up (deps installed, services ready), checkpoint it so future boxes start ready. This is the real final step; don't stop at hand-off.
159
162
 
160
163
  ## 9. Checkpoint the warm state (do this at the very end)
161
164
 
@@ -185,4 +188,5 @@ Then tell the user, e.g.:
185
188
 
186
189
  - For Nextjs/Vite/Tasnstack projects, makes sure to forward also websocket for hot reload.
187
190
  - **Turbo/Nx/Jest and other git-worktree-aware tools may try to write their cache to a read-only host path.** The box runs `/workspace` as a git worktree with the host repo's `.git/` bind-mounted at its absolute host path; tools that derive paths from git (Turbo's cache root = the worktree's git *common dir*) resolve outside `/workspace` and hit `EROFS` on the Mac path. Pin the cache into the writable overlay via the task/service `env:`, e.g. `TURBO_CACHE_DIR: /workspace/.turbo/cache` (or pass `--cache-dir`).
188
- - The `install` task is intentionally a no-op once `node_modules/.agentbox-installed` exists. Do **not** remove the marker guard to "force a fresh install" — that reinstalls on every box start. To force a one-off rebuild, delete `node_modules` (or just the marker) then run `agentbox-ctl reload`.
191
+ - The `install` task is intentionally a no-op once `node_modules/.agentbox-installed` exists. Do **not** remove the marker guard to "force a fresh install" — that reinstalls on every box start. To force a one-off rebuild, delete `node_modules` (or just the marker) then run `agentbox-ctl reload`.
192
+ - `.pnpm-store` default location is read only, so you need to point it to a writable location in the box's writable workspace eg: `PNPM_STORE: /workspace/.pnpm-store` and add `.pnpm-store/` to the `.gitignore` if the workspace root is git-tracked.