@madarco/agentbox 0.20.0 → 0.20.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.
- package/CHANGELOG.md +21 -0
- package/dist/{_cloud-attach-THTN4CFZ.js → _cloud-attach-MH7NKIZY.js} +3 -3
- package/dist/{chunk-ZX6DTA4X.js → chunk-3465NDRZ.js} +95 -7
- package/dist/chunk-3465NDRZ.js.map +1 -0
- package/dist/{chunk-7RWFYLF3.js → chunk-4ATVA3RM.js} +7 -7
- package/dist/{chunk-3VFY3N4A.js → chunk-5N7GA2X7.js} +58 -76
- package/dist/chunk-5N7GA2X7.js.map +1 -0
- package/dist/{dist-3PLT2EK2.js → dist-AJWL4WLW.js} +4 -2
- package/dist/{dist-3WFNXXPE.js → dist-CTTTHG6U.js} +5 -4
- package/dist/{dist-3WFNXXPE.js.map → dist-CTTTHG6U.js.map} +1 -1
- package/dist/{dist-7ELDXBAG.js → dist-G5PDFWKH.js} +7 -4
- package/dist/{dist-7ELDXBAG.js.map → dist-G5PDFWKH.js.map} +1 -1
- package/dist/{dist-CZ6CRADC.js → dist-LUEH7MER.js} +3 -3
- package/dist/dist-LUEH7MER.js.map +1 -0
- package/dist/{dist-C3YRC3PP.js → dist-T3JIYHCA.js} +3 -3
- package/dist/index.js +29 -29
- package/package.json +5 -5
- package/runtime/docker/Dockerfile.box +13 -0
- package/runtime/e2b/attach-helper.cjs +4 -1
- package/runtime/e2b/scripts/build-template.sh +10 -0
- package/runtime/hetzner/scripts/install-box.sh +9 -0
- package/runtime/vercel/scripts/provision.sh +20 -0
- package/dist/chunk-3VFY3N4A.js.map +0 -1
- package/dist/chunk-ZX6DTA4X.js.map +0 -1
- package/dist/dist-CZ6CRADC.js.map +0 -1
- /package/dist/{_cloud-attach-THTN4CFZ.js.map → _cloud-attach-MH7NKIZY.js.map} +0 -0
- /package/dist/{chunk-7RWFYLF3.js.map → chunk-4ATVA3RM.js.map} +0 -0
- /package/dist/{dist-3PLT2EK2.js.map → dist-AJWL4WLW.js.map} +0 -0
- /package/dist/{dist-C3YRC3PP.js.map → dist-T3JIYHCA.js.map} +0 -0
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
readBoxStatus,
|
|
6
6
|
startClaudeSession,
|
|
7
7
|
startCodexSession
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5N7GA2X7.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/_cloud-attach.ts
|
|
11
11
|
import { spawn as spawn4 } from "child_process";
|
|
@@ -105,26 +105,26 @@ function isKnownProvider(name) {
|
|
|
105
105
|
async function getProvider(name) {
|
|
106
106
|
switch (name) {
|
|
107
107
|
case "docker": {
|
|
108
|
-
const mod = await import("./dist-
|
|
108
|
+
const mod = await import("./dist-AJWL4WLW.js");
|
|
109
109
|
return mod.dockerProvider;
|
|
110
110
|
}
|
|
111
111
|
case "daytona": {
|
|
112
|
-
const mod = await import("./dist-
|
|
112
|
+
const mod = await import("./dist-LUEH7MER.js");
|
|
113
113
|
await mod.ensureDaytonaCredentials();
|
|
114
114
|
return mod.daytonaProvider;
|
|
115
115
|
}
|
|
116
116
|
case "hetzner": {
|
|
117
|
-
const mod = await import("./dist-
|
|
117
|
+
const mod = await import("./dist-T3JIYHCA.js");
|
|
118
118
|
await mod.ensureHetznerCredentials();
|
|
119
119
|
return mod.hetznerProvider;
|
|
120
120
|
}
|
|
121
121
|
case "vercel": {
|
|
122
|
-
const mod = await import("./dist-
|
|
122
|
+
const mod = await import("./dist-CTTTHG6U.js");
|
|
123
123
|
await mod.ensureVercelCredentials();
|
|
124
124
|
return mod.vercelProvider;
|
|
125
125
|
}
|
|
126
126
|
case "e2b": {
|
|
127
|
-
const mod = await import("./dist-
|
|
127
|
+
const mod = await import("./dist-G5PDFWKH.js");
|
|
128
128
|
await mod.ensureE2bCredentials();
|
|
129
129
|
return mod.e2bProvider;
|
|
130
130
|
}
|
|
@@ -2666,4 +2666,4 @@ export {
|
|
|
2666
2666
|
agentResumeArgs,
|
|
2667
2667
|
restoreAgentSessions
|
|
2668
2668
|
};
|
|
2669
|
-
//# sourceMappingURL=chunk-
|
|
2669
|
+
//# sourceMappingURL=chunk-4ATVA3RM.js.map
|
|
@@ -5799,8 +5799,8 @@ async function startClaudeSession(opts) {
|
|
|
5799
5799
|
`failed to start claude session in ${opts.container}: ${stderr.trim() || `exit ${String(result.exitCode)}`}`
|
|
5800
5800
|
);
|
|
5801
5801
|
}
|
|
5802
|
-
|
|
5803
|
-
|
|
5802
|
+
var TERM_FALLBACK_SNIPPET = 'if ! infocmp "$TERM" >/dev/null 2>&1; then TERM=xterm-256color; export TERM; fi; ';
|
|
5803
|
+
function buildTermSafeTmuxExec(opts) {
|
|
5804
5804
|
const term = process.env["TERM"] ?? "xterm-256color";
|
|
5805
5805
|
return [
|
|
5806
5806
|
"exec",
|
|
@@ -5808,45 +5808,32 @@ function buildClaudeAttachArgv(container, sessionName) {
|
|
|
5808
5808
|
"-e",
|
|
5809
5809
|
`TERM=${term}`,
|
|
5810
5810
|
"--user",
|
|
5811
|
-
|
|
5812
|
-
container,
|
|
5813
|
-
"
|
|
5814
|
-
"
|
|
5815
|
-
|
|
5816
|
-
|
|
5811
|
+
opts.user,
|
|
5812
|
+
opts.container,
|
|
5813
|
+
"sh",
|
|
5814
|
+
"-c",
|
|
5815
|
+
`${TERM_FALLBACK_SNIPPET}${opts.tmuxScript}`,
|
|
5816
|
+
"sh",
|
|
5817
|
+
...opts.positionals
|
|
5817
5818
|
];
|
|
5818
5819
|
}
|
|
5820
|
+
function buildClaudeAttachArgv(container, sessionName) {
|
|
5821
|
+
const name = sessionName ?? DEFAULT_CLAUDE_SESSION;
|
|
5822
|
+
return buildTermSafeTmuxExec({
|
|
5823
|
+
container,
|
|
5824
|
+
user: CONTAINER_USER,
|
|
5825
|
+
tmuxScript: 'exec tmux attach -t "$1"',
|
|
5826
|
+
positionals: [name]
|
|
5827
|
+
});
|
|
5828
|
+
}
|
|
5819
5829
|
function buildDashboardAttachArgv(container, sessionName) {
|
|
5820
5830
|
const name = sessionName ?? DEFAULT_CLAUDE_SESSION;
|
|
5821
|
-
|
|
5822
|
-
const term = process.env["TERM"] ?? "xterm-256color";
|
|
5823
|
-
return [
|
|
5824
|
-
"exec",
|
|
5825
|
-
"-it",
|
|
5826
|
-
"-e",
|
|
5827
|
-
`TERM=${term}`,
|
|
5828
|
-
"--user",
|
|
5829
|
-
CONTAINER_USER,
|
|
5831
|
+
return buildTermSafeTmuxExec({
|
|
5830
5832
|
container,
|
|
5831
|
-
|
|
5832
|
-
"new-session",
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
"-s",
|
|
5836
|
-
dash,
|
|
5837
|
-
"-t",
|
|
5838
|
-
name,
|
|
5839
|
-
";",
|
|
5840
|
-
"set",
|
|
5841
|
-
"-t",
|
|
5842
|
-
dash,
|
|
5843
|
-
"status",
|
|
5844
|
-
"off",
|
|
5845
|
-
";",
|
|
5846
|
-
"attach",
|
|
5847
|
-
"-t",
|
|
5848
|
-
dash
|
|
5849
|
-
];
|
|
5833
|
+
user: CONTAINER_USER,
|
|
5834
|
+
tmuxScript: 'dash="$1-dash"; exec tmux new-session -A -d -s "$dash" -t "$1" \\; set -t "$dash" status off \\; attach -t "$dash"',
|
|
5835
|
+
positionals: [name]
|
|
5836
|
+
});
|
|
5850
5837
|
}
|
|
5851
5838
|
async function waitForTmuxPaneContent(container, sessionName, timeoutMs = 2e4) {
|
|
5852
5839
|
const deadline = Date.now() + timeoutMs;
|
|
@@ -6376,20 +6363,12 @@ async function startCodexSession(opts) {
|
|
|
6376
6363
|
}
|
|
6377
6364
|
function buildCodexAttachArgv(container, sessionName) {
|
|
6378
6365
|
const name = sessionName ?? DEFAULT_CODEX_SESSION;
|
|
6379
|
-
|
|
6380
|
-
return [
|
|
6381
|
-
"exec",
|
|
6382
|
-
"-it",
|
|
6383
|
-
"-e",
|
|
6384
|
-
`TERM=${term}`,
|
|
6385
|
-
"--user",
|
|
6386
|
-
CONTAINER_USER,
|
|
6366
|
+
return buildTermSafeTmuxExec({
|
|
6387
6367
|
container,
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
];
|
|
6368
|
+
user: CONTAINER_USER,
|
|
6369
|
+
tmuxScript: 'exec tmux attach -t "$1"',
|
|
6370
|
+
positionals: [name]
|
|
6371
|
+
});
|
|
6393
6372
|
}
|
|
6394
6373
|
function buildCodexLoginRunArgv(opts) {
|
|
6395
6374
|
const term = process.env["TERM"] ?? "xterm-256color";
|
|
@@ -6768,20 +6747,12 @@ async function startOpencodeSession(opts) {
|
|
|
6768
6747
|
}
|
|
6769
6748
|
function buildOpencodeAttachArgv(container, sessionName) {
|
|
6770
6749
|
const name = sessionName ?? DEFAULT_OPENCODE_SESSION;
|
|
6771
|
-
|
|
6772
|
-
return [
|
|
6773
|
-
"exec",
|
|
6774
|
-
"-it",
|
|
6775
|
-
"-e",
|
|
6776
|
-
`TERM=${term}`,
|
|
6777
|
-
"--user",
|
|
6778
|
-
CONTAINER_USER,
|
|
6750
|
+
return buildTermSafeTmuxExec({
|
|
6779
6751
|
container,
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
];
|
|
6752
|
+
user: CONTAINER_USER,
|
|
6753
|
+
tmuxScript: 'exec tmux attach -t "$1"',
|
|
6754
|
+
positionals: [name]
|
|
6755
|
+
});
|
|
6785
6756
|
}
|
|
6786
6757
|
function buildOpencodeLoginRunArgv(opts) {
|
|
6787
6758
|
const term = process.env["TERM"] ?? "xterm-256color";
|
|
@@ -7085,6 +7056,22 @@ async function bindWorktrees(container, binds, onLog) {
|
|
|
7085
7056
|
log(`bind-mounted ${b.containerPath} <- ${b.gitWorktreePath}`);
|
|
7086
7057
|
}
|
|
7087
7058
|
}
|
|
7059
|
+
async function prefetchHostLfs(hostMainRepo, baseRef, log) {
|
|
7060
|
+
const tracked = await execa10("git", ["-C", hostMainRepo, "lfs", "ls-files", "-n"], {
|
|
7061
|
+
reject: false
|
|
7062
|
+
});
|
|
7063
|
+
if (tracked.exitCode !== 0 || tracked.stdout.trim().length === 0) return;
|
|
7064
|
+
const remote = "origin";
|
|
7065
|
+
const fetched = await execa10("git", ["-C", hostMainRepo, "lfs", "fetch", remote, baseRef], {
|
|
7066
|
+
reject: false
|
|
7067
|
+
});
|
|
7068
|
+
if (fetched.exitCode === 0) {
|
|
7069
|
+
log(`prefetched git-lfs objects for ${baseRef} into shared .git/lfs (host ${remote})`);
|
|
7070
|
+
} else {
|
|
7071
|
+
const msg = (fetched.stderr || fetched.stdout || `exit ${String(fetched.exitCode ?? "?")}`).trim().split("\n")[0];
|
|
7072
|
+
log(`git-lfs prefetch for ${baseRef} skipped (best-effort, continuing): ${msg}`);
|
|
7073
|
+
}
|
|
7074
|
+
}
|
|
7088
7075
|
async function seedWorkspace(opts) {
|
|
7089
7076
|
const log = opts.onLog ?? (() => {
|
|
7090
7077
|
});
|
|
@@ -7093,6 +7080,7 @@ async function seedWorkspace(opts) {
|
|
|
7093
7080
|
const main = r.repo.hostMainRepo;
|
|
7094
7081
|
const wt = r.gitWorktreePath;
|
|
7095
7082
|
const baseRef = r.repo.kind === "root" ? opts.fromBranch ?? "HEAD" : "HEAD";
|
|
7083
|
+
await prefetchHostLfs(main, baseRef, log);
|
|
7096
7084
|
const addArgs = r.reuseBranch ? ["worktree", "add", wt, r.branch] : ["worktree", "add", "-b", r.branch, wt, baseRef];
|
|
7097
7085
|
const add = await execa10(
|
|
7098
7086
|
"docker",
|
|
@@ -7258,6 +7246,7 @@ async function regenerateRestoredWorktrees(opts) {
|
|
|
7258
7246
|
].join("\n");
|
|
7259
7247
|
for (const p of opts.plans) {
|
|
7260
7248
|
const baseRef = p.kind === "root" ? opts.fromBranch ?? "HEAD" : "HEAD";
|
|
7249
|
+
await prefetchHostLfs(p.hostMainRepo, baseRef, log);
|
|
7261
7250
|
const metaDir = `${p.hostMainRepo}/.git/worktrees/${fsSafeBranch(p.freshBranch)}`;
|
|
7262
7251
|
const r = await execa10(
|
|
7263
7252
|
"docker",
|
|
@@ -9503,20 +9492,12 @@ async function startShellSession(opts) {
|
|
|
9503
9492
|
}
|
|
9504
9493
|
function buildShellSessionAttachArgv(container, sessionName, user) {
|
|
9505
9494
|
const name = sessionName ?? DEFAULT_SHELL_SESSION;
|
|
9506
|
-
|
|
9507
|
-
return [
|
|
9508
|
-
"exec",
|
|
9509
|
-
"-it",
|
|
9510
|
-
"-e",
|
|
9511
|
-
`TERM=${term}`,
|
|
9512
|
-
"--user",
|
|
9513
|
-
user ?? CONTAINER_USER,
|
|
9495
|
+
return buildTermSafeTmuxExec({
|
|
9514
9496
|
container,
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
];
|
|
9497
|
+
user: user ?? CONTAINER_USER,
|
|
9498
|
+
tmuxScript: 'exec tmux attach -t "$1"',
|
|
9499
|
+
positionals: [name]
|
|
9500
|
+
});
|
|
9520
9501
|
}
|
|
9521
9502
|
async function shellSessionInfo(container, sessionName, user) {
|
|
9522
9503
|
const name = sessionName ?? DEFAULT_SHELL_SESSION;
|
|
@@ -10712,6 +10693,7 @@ export {
|
|
|
10712
10693
|
rebuildPluginNativeDeps,
|
|
10713
10694
|
ClaudeSessionError,
|
|
10714
10695
|
startClaudeSession,
|
|
10696
|
+
TERM_FALLBACK_SNIPPET,
|
|
10715
10697
|
buildClaudeAttachArgv,
|
|
10716
10698
|
buildDashboardAttachArgv,
|
|
10717
10699
|
waitForTmuxPaneContent,
|
|
@@ -10909,4 +10891,4 @@ smol-toml/dist/index.js:
|
|
|
10909
10891
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
10910
10892
|
*)
|
|
10911
10893
|
*/
|
|
10912
|
-
//# sourceMappingURL=chunk-
|
|
10894
|
+
//# sourceMappingURL=chunk-5N7GA2X7.js.map
|