@madarco/agentbox 0.22.2 → 0.23.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.
- package/CHANGELOG.md +56 -0
- package/dist/{_cloud-attach-Y5WZ7F53.js → _cloud-attach-RFPLNACE.js} +4 -4
- package/dist/{chunk-BMCT3LBE.js → chunk-6OQENOJZ.js} +8 -8
- package/dist/{chunk-ES2DDCAC.js → chunk-CKC3CP7Y.js} +284 -154
- package/dist/chunk-CKC3CP7Y.js.map +1 -0
- package/dist/{chunk-AYNGC4Z5.js → chunk-ERMU7RMK.js} +43 -58
- package/dist/{chunk-AYNGC4Z5.js.map → chunk-ERMU7RMK.js.map} +1 -1
- package/dist/chunk-G3H2L3O2.js +0 -0
- package/dist/{chunk-3KAWXDQ4.js → chunk-JXDSSSXS.js} +3 -3
- package/dist/{chunk-S4OWE3UD.js → chunk-L5SOSNQI.js} +3 -3
- package/dist/{chunk-V2NCCC2B.js → chunk-Q626V2YX.js} +2 -2
- package/dist/{chunk-5DZTXHLQ.js → chunk-QGL734YX.js} +169 -52
- package/dist/chunk-QGL734YX.js.map +1 -0
- package/dist/chunk-QT3SHMLY.js +0 -0
- package/dist/{chunk-7HAGPF4X.js → chunk-QVWGQJV6.js} +2 -2
- package/dist/chunk-WJFZJZIM.js +0 -0
- package/dist/cloud-poller-SUNA6ZQC-7M5LJHHE.js +0 -0
- package/dist/dist-2BTJQUJS.js +0 -0
- package/dist/{dist-SJRMFVRV.js → dist-GEHCZJCS.js} +5 -5
- package/dist/{dist-AN5NUXA5.js → dist-GJCIKH2C.js} +5 -5
- package/dist/{dist-FNAGMTUI.js → dist-JFUUDAI3.js} +17 -3
- package/dist/{dist-VOVN64Y2.js → dist-W5476E2U.js} +5 -5
- package/dist/{dist-K5GASNBV.js → dist-Z3GSHEFO.js} +7 -6
- package/dist/index.js +391 -215
- package/dist/index.js.map +1 -1
- package/dist/{prepared-state-5FIGV4BE-WPHOEDA6.js → prepared-state-LW2PKTEQ-5YMKG7UN.js} +2 -2
- package/package.json +28 -27
- package/runtime/_shared/agentbox-checkpoint-cleanup +0 -0
- package/runtime/_shared/agentbox-dockerd-start +0 -0
- package/runtime/_shared/agentbox-open +0 -0
- package/runtime/_shared/agentbox-portless-trust +0 -0
- package/runtime/_shared/agentbox-vnc-start +0 -0
- package/runtime/_shared/ctl.cjs +3 -1
- package/runtime/_shared/gh-shim +0 -0
- package/runtime/_shared/git-shim +0 -0
- package/runtime/_shared/linear-shim +0 -0
- package/runtime/_shared/ntn-shim +0 -0
- package/runtime/docker/Dockerfile.box +12 -0
- package/runtime/docker/packages/ctl/dist/bin.cjs +3 -1
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-dockerd-start +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-open +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-portless-trust +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-sshd-start +44 -0
- package/runtime/docker/packages/sandbox-docker/scripts/agentbox-vnc-start +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/chromium-resolver +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/gh-shim +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/git-shim +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +0 -0
- package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +0 -0
- package/runtime/e2b/agentbox-checkpoint-cleanup +0 -0
- package/runtime/e2b/agentbox-dockerd-start +0 -0
- package/runtime/e2b/agentbox-open +0 -0
- package/runtime/e2b/agentbox-vnc-start +0 -0
- package/runtime/e2b/ctl.cjs +3 -1
- package/runtime/e2b/gh-shim +0 -0
- package/runtime/e2b/git-shim +0 -0
- package/runtime/e2b/linear-shim +0 -0
- package/runtime/e2b/ntn-shim +0 -0
- package/runtime/e2b/scripts/build-template.sh +0 -0
- package/runtime/hetzner/agentbox-checkpoint-cleanup +0 -0
- package/runtime/hetzner/agentbox-dockerd-start +0 -0
- package/runtime/hetzner/agentbox-open +0 -0
- package/runtime/hetzner/agentbox-portless-trust +0 -0
- package/runtime/hetzner/agentbox-vnc-start +0 -0
- package/runtime/hetzner/ctl.cjs +3 -1
- package/runtime/hetzner/gh-shim +0 -0
- package/runtime/hetzner/git-shim +0 -0
- package/runtime/hetzner/linear-shim +0 -0
- package/runtime/hetzner/ntn-shim +0 -0
- package/runtime/hetzner/scripts/install-box.sh +0 -0
- package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
- package/runtime/hub/apps/hub/.next/app-path-routes-manifest.json +2 -0
- package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
- package/runtime/hub/apps/hub/.next/routes-manifest.json +14 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app-paths-manifest.json +2 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0ssw__next-internal_server_app_(dashboard)_api_v1_open-targets_route_actions_1z-vd4m.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_boxes_[id]_open_route_actions_1agwl8h.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0keu6we._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ql4fjo._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vs8fma._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0w9ud8u._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yhb0gc._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-0flwc._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1a50b07._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bqbkd5._.js +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dn_3i1._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hqla7-._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1js2jdv._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1nepkp-._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q5bqse._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qa4a0v._.js +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1thipug._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1v9om6g._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_06f2faq._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_0f3molr._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ro6vh6._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_0b_hsjl._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_[id]_page_tsx_1-j_972._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_components_box-table_tsx_0a9pyn_._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/functions-config-manifest.json +2 -0
- package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
- package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
- package/runtime/hub/apps/hub/.next/static/chunks/1py5tlz57h7ra.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/{3y2c7woqhtx9s.js → 23fswvjrabu89.js} +1 -1
- package/runtime/hub/apps/hub/.next/static/chunks/3nedwutnzpdis.css +3 -0
- package/runtime/hub/apps/hub/.next/static/chunks/3p86ecqhr_7yy.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/3qof5hg87qf5n.js +1 -0
- package/runtime/hub/apps/hub/{chunk-673QOHSR.js → chunk-6HD4PARX.js} +9 -9
- package/runtime/hub/apps/hub/{chunk-7J6ZFTT4.js → chunk-JQFB2CNA.js} +132 -16
- package/runtime/hub/apps/hub/{chunk-5XQ3T3W2.js → chunk-K6RA5GJI.js} +231 -126
- package/runtime/hub/apps/hub/{dist-GCALYJN7.js → dist-3HR4RIPE.js} +17 -3
- package/runtime/hub/apps/hub/{dist-EI54M5DP.js → dist-7GNKBKFV.js} +29 -42
- package/runtime/hub/apps/hub/{dist-MOCUH2OC.js → dist-JWVTVHBT.js} +4 -4
- package/runtime/hub/apps/hub/{dist-LYTWBTUL.js → dist-OUNL2TCW.js} +4 -4
- package/runtime/hub/apps/hub/{dist-K7WHNDZB.js → dist-TOHA4OA5.js} +4 -4
- package/runtime/hub/apps/hub/{prepared-state-5FIGV4BE-D2HJEY2L.js → prepared-state-LW2PKTEQ-7BCXARGA.js} +1 -1
- package/runtime/hub/apps/hub/server.js +105 -24
- package/runtime/relay/bin.cjs +3 -1
- package/runtime/vercel/agentbox-checkpoint-cleanup +0 -0
- package/runtime/vercel/agentbox-dockerd-start +0 -0
- package/runtime/vercel/agentbox-open +0 -0
- package/runtime/vercel/agentbox-vnc-start +0 -0
- package/runtime/vercel/ctl.cjs +3 -1
- package/runtime/vercel/gh-shim +0 -0
- package/runtime/vercel/git-shim +0 -0
- package/runtime/vercel/linear-shim +0 -0
- package/runtime/vercel/ntn-shim +0 -0
- package/runtime/vercel/scripts/provision.sh +0 -0
- package/LICENSE +0 -21
- package/dist/chunk-5DZTXHLQ.js.map +0 -1
- package/dist/chunk-ES2DDCAC.js.map +0 -1
- package/runtime/hub/apps/hub/.next/static/chunks/0dx4alyqu7cq1.css +0 -3
- package/runtime/hub/apps/hub/.next/static/chunks/332lo0ac7l2wv.js +0 -1
- package/runtime/hub/apps/hub/.next/static/chunks/3gdqmzzl34ilu.js +0 -1
- package/runtime/hub/apps/hub/.next/static/chunks/44exu5uemf-ev.js +0 -1
- /package/dist/{_cloud-attach-Y5WZ7F53.js.map → _cloud-attach-RFPLNACE.js.map} +0 -0
- /package/dist/{chunk-BMCT3LBE.js.map → chunk-6OQENOJZ.js.map} +0 -0
- /package/dist/{chunk-3KAWXDQ4.js.map → chunk-JXDSSSXS.js.map} +0 -0
- /package/dist/{chunk-S4OWE3UD.js.map → chunk-L5SOSNQI.js.map} +0 -0
- /package/dist/{chunk-V2NCCC2B.js.map → chunk-Q626V2YX.js.map} +0 -0
- /package/dist/{chunk-7HAGPF4X.js.map → chunk-QVWGQJV6.js.map} +0 -0
- /package/dist/{dist-SJRMFVRV.js.map → dist-GEHCZJCS.js.map} +0 -0
- /package/dist/{dist-AN5NUXA5.js.map → dist-GJCIKH2C.js.map} +0 -0
- /package/dist/{dist-FNAGMTUI.js.map → dist-JFUUDAI3.js.map} +0 -0
- /package/dist/{dist-K5GASNBV.js.map → dist-W5476E2U.js.map} +0 -0
- /package/dist/{dist-VOVN64Y2.js.map → dist-Z3GSHEFO.js.map} +0 -0
- /package/dist/{prepared-state-5FIGV4BE-WPHOEDA6.js.map → prepared-state-LW2PKTEQ-5YMKG7UN.js.map} +0 -0
- /package/runtime/hub/apps/hub/.next/static/{zT1paOSXMJpAPsZ1dFK2V → 6WtaFwavHBpin3eT7-HjR}/_buildManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{zT1paOSXMJpAPsZ1dFK2V → 6WtaFwavHBpin3eT7-HjR}/_clientMiddlewareManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{zT1paOSXMJpAPsZ1dFK2V → 6WtaFwavHBpin3eT7-HjR}/_ssgManifest.js +0 -0
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
createCloudProvider
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-L5SOSNQI.js";
|
|
5
5
|
import {
|
|
6
6
|
detectPortless,
|
|
7
7
|
portlessDoctorRow
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QGL734YX.js";
|
|
9
9
|
import {
|
|
10
10
|
UserFacingError,
|
|
11
11
|
claudeInstallFingerprint,
|
|
12
12
|
computeContextSha256,
|
|
13
13
|
errSummary,
|
|
14
14
|
hostOpenCommand,
|
|
15
|
+
mintSshKey,
|
|
15
16
|
preparedStatePathFor,
|
|
16
17
|
readCliStamp,
|
|
17
18
|
readPreparedStateRaw,
|
|
@@ -21,7 +22,7 @@ import {
|
|
|
21
22
|
stageOpencodeStaticForUpload,
|
|
22
23
|
writeManagedSecrets,
|
|
23
24
|
writePreparedStateRaw
|
|
24
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-CKC3CP7Y.js";
|
|
25
26
|
|
|
26
27
|
// ../../packages/sandbox-hetzner/dist/chunk-3ZWBEZND.js
|
|
27
28
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -781,24 +782,22 @@ async function currentHetznerBaseFingerprintLive(claudeInstall = "native") {
|
|
|
781
782
|
|
|
782
783
|
// ../../packages/sandbox-hetzner/dist/index.js
|
|
783
784
|
import { existsSync as existsSync22 } from "fs";
|
|
784
|
-
import { rm as rm2, rename, mkdir as
|
|
785
|
-
import { join as
|
|
786
|
-
import { execa as
|
|
785
|
+
import { rm as rm2, rename, mkdir as mkdir2 } from "fs/promises";
|
|
786
|
+
import { join as join3 } from "path";
|
|
787
|
+
import { execa as execa3 } from "execa";
|
|
787
788
|
import { resolve as resolvePath } from "path";
|
|
788
|
-
import { join
|
|
789
|
-
import {
|
|
790
|
-
import { dirname as dirname2, join, resolve as resolve4 } from "path";
|
|
789
|
+
import { join } from "path";
|
|
790
|
+
import { dirname as dirname2, resolve as resolve4 } from "path";
|
|
791
791
|
import { execa } from "execa";
|
|
792
|
-
import { execa as execa2 } from "execa";
|
|
793
792
|
import { existsSync as existsSync3 } from "fs";
|
|
794
|
-
import { mkdir
|
|
793
|
+
import { mkdir, rm } from "fs/promises";
|
|
795
794
|
import { createServer } from "net";
|
|
796
795
|
import { homedir as homedir3 } from "os";
|
|
797
|
-
import { dirname as dirname22, join as
|
|
798
|
-
import { execa as
|
|
799
|
-
import { mkdir as
|
|
796
|
+
import { dirname as dirname22, join as join2, resolve as resolve22 } from "path";
|
|
797
|
+
import { execa as execa2 } from "execa";
|
|
798
|
+
import { mkdir as mkdir3, rm as rm3, writeFile } from "fs/promises";
|
|
800
799
|
import { homedir as homedir22, tmpdir } from "os";
|
|
801
|
-
import { join as
|
|
800
|
+
import { join as join4 } from "path";
|
|
802
801
|
function generatePrepareCloudInit(opts) {
|
|
803
802
|
const pubkey = opts.sshPubkey.trim();
|
|
804
803
|
return [
|
|
@@ -914,19 +913,6 @@ async function pollUntil(label, check, opts = {}) {
|
|
|
914
913
|
interval = Math.min(interval * 2, max);
|
|
915
914
|
}
|
|
916
915
|
}
|
|
917
|
-
async function mintSshKey(targetDir, comment) {
|
|
918
|
-
const dir = resolve4(targetDir);
|
|
919
|
-
const priv = join(dir, "id_ed25519");
|
|
920
|
-
const pub = `${priv}.pub`;
|
|
921
|
-
await mkdir(dir, { recursive: true, mode: 448 });
|
|
922
|
-
await execa(
|
|
923
|
-
"ssh-keygen",
|
|
924
|
-
["-t", "ed25519", "-N", "", "-C", comment, "-f", priv, "-q"],
|
|
925
|
-
{ stdio: "pipe" }
|
|
926
|
-
);
|
|
927
|
-
const publicKey = (await readFile(pub, "utf8")).trim();
|
|
928
|
-
return { dir, privatePath: priv, publicPath: pub, publicKey };
|
|
929
|
-
}
|
|
930
916
|
async function mintPrepareKey() {
|
|
931
917
|
const root = resolve4(homedirOrCwd(), ".agentbox", "hetzner", `prepare-${Date.now().toString(36)}`);
|
|
932
918
|
const key = await mintSshKey(root, `agentbox-prepare-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}`);
|
|
@@ -977,7 +963,7 @@ async function sshExec(target, remoteCmd, opts = {}) {
|
|
|
977
963
|
`${target.user}@${target.host}`,
|
|
978
964
|
remoteCmd
|
|
979
965
|
];
|
|
980
|
-
const child =
|
|
966
|
+
const child = execa("ssh", argv, {
|
|
981
967
|
reject: false,
|
|
982
968
|
timeout: opts.timeoutMs,
|
|
983
969
|
env: { ...process.env, ...opts.env },
|
|
@@ -1006,7 +992,7 @@ async function scpUpload(target, localPath, remotePath, opts = {}) {
|
|
|
1006
992
|
localPath,
|
|
1007
993
|
`${target.user}@${target.host}:${remotePath}`
|
|
1008
994
|
];
|
|
1009
|
-
const res = await
|
|
995
|
+
const res = await execa("scp", argv, {
|
|
1010
996
|
reject: false,
|
|
1011
997
|
timeout: opts.timeoutMs
|
|
1012
998
|
});
|
|
@@ -1023,7 +1009,7 @@ async function scpDownload(target, remotePath, localPath, opts = {}) {
|
|
|
1023
1009
|
`${target.user}@${target.host}:${remotePath}`,
|
|
1024
1010
|
localPath
|
|
1025
1011
|
];
|
|
1026
|
-
const res = await
|
|
1012
|
+
const res = await execa("scp", argv, {
|
|
1027
1013
|
reject: false,
|
|
1028
1014
|
timeout: opts.timeoutMs
|
|
1029
1015
|
});
|
|
@@ -1130,7 +1116,7 @@ async function prepareHetzner(opts = {}) {
|
|
|
1130
1116
|
host: ip,
|
|
1131
1117
|
user: "root",
|
|
1132
1118
|
identity: key.privatePath,
|
|
1133
|
-
knownHosts:
|
|
1119
|
+
knownHosts: join(key.dir, "known_hosts")
|
|
1134
1120
|
};
|
|
1135
1121
|
const up = await waitForSsh(sshTarget, PREPARE_SSH_DEADLINE_MS);
|
|
1136
1122
|
if (!up) {
|
|
@@ -1323,9 +1309,9 @@ var SshTunnelManager = class {
|
|
|
1323
1309
|
*/
|
|
1324
1310
|
async open(opts) {
|
|
1325
1311
|
const boxSshDir = opts.boxSshDir ?? defaultBoxSshDir(opts.boxId);
|
|
1326
|
-
await
|
|
1327
|
-
const controlPath =
|
|
1328
|
-
const knownHosts =
|
|
1312
|
+
await mkdir(boxSshDir, { recursive: true, mode: 448 });
|
|
1313
|
+
const controlPath = join2(boxSshDir, "control.sock");
|
|
1314
|
+
const knownHosts = join2(boxSshDir, "known_hosts");
|
|
1329
1315
|
const user = opts.vpsUser ?? "vscode";
|
|
1330
1316
|
const tunnel = {
|
|
1331
1317
|
controlPath,
|
|
@@ -1370,7 +1356,7 @@ var SshTunnelManager = class {
|
|
|
1370
1356
|
`ConnectTimeout=${String(connectTimeout)}`,
|
|
1371
1357
|
`${user}@${opts.vpsHost}`
|
|
1372
1358
|
];
|
|
1373
|
-
const res = await
|
|
1359
|
+
const res = await execa2("ssh", argv, { reject: false });
|
|
1374
1360
|
if (res.exitCode !== 0 || !existsSync3(controlPath)) {
|
|
1375
1361
|
throw new Error(
|
|
1376
1362
|
`ssh ControlMaster failed for ${opts.boxId} (exit ${String(res.exitCode)}): ${res.stderr || res.stdout || "(no output)"}`
|
|
@@ -1408,7 +1394,7 @@ var SshTunnelManager = class {
|
|
|
1408
1394
|
"dummy"
|
|
1409
1395
|
// the target host is ignored when -O is used, but argv needs one
|
|
1410
1396
|
];
|
|
1411
|
-
const res = await
|
|
1397
|
+
const res = await execa2("ssh", argv, { reject: false });
|
|
1412
1398
|
if (res.exitCode !== 0) {
|
|
1413
1399
|
throw new Error(
|
|
1414
1400
|
`ssh -O forward failed for ${boxId} (exit ${String(res.exitCode)}): ${res.stderr || res.stdout || "(no output)"}`
|
|
@@ -1435,7 +1421,7 @@ var SshTunnelManager = class {
|
|
|
1435
1421
|
const alive = await this.isAlive(existing.controlPath);
|
|
1436
1422
|
if (!alive && existsSync3(existing.controlPath)) {
|
|
1437
1423
|
try {
|
|
1438
|
-
await
|
|
1424
|
+
await execa2(
|
|
1439
1425
|
"ssh",
|
|
1440
1426
|
["-O", "exit", "-S", existing.controlPath, "dummy"],
|
|
1441
1427
|
{ reject: false }
|
|
@@ -1462,7 +1448,7 @@ var SshTunnelManager = class {
|
|
|
1462
1448
|
tunnel.controlPath,
|
|
1463
1449
|
"dummy"
|
|
1464
1450
|
];
|
|
1465
|
-
await
|
|
1451
|
+
await execa2("ssh", argv, { reject: false });
|
|
1466
1452
|
tunnel.forwards.delete(remotePort);
|
|
1467
1453
|
}
|
|
1468
1454
|
/**
|
|
@@ -1473,7 +1459,7 @@ var SshTunnelManager = class {
|
|
|
1473
1459
|
const tunnel = this.boxes.get(boxId);
|
|
1474
1460
|
if (!tunnel) return;
|
|
1475
1461
|
if (existsSync3(tunnel.controlPath)) {
|
|
1476
|
-
await
|
|
1462
|
+
await execa2("ssh", ["-O", "exit", "-S", tunnel.controlPath, "dummy"], { reject: false });
|
|
1477
1463
|
await rm(tunnel.controlPath, { force: true });
|
|
1478
1464
|
}
|
|
1479
1465
|
this.boxes.delete(boxId);
|
|
@@ -1499,7 +1485,7 @@ var SshTunnelManager = class {
|
|
|
1499
1485
|
registerExisting(boxId, opts) {
|
|
1500
1486
|
const boxSshDir = opts.boxSshDir ?? defaultBoxSshDir(opts.boxId);
|
|
1501
1487
|
this.boxes.set(boxId, {
|
|
1502
|
-
controlPath:
|
|
1488
|
+
controlPath: join2(boxSshDir, "control.sock"),
|
|
1503
1489
|
vpsHost: opts.vpsHost,
|
|
1504
1490
|
vpsUser: opts.vpsUser ?? "vscode",
|
|
1505
1491
|
identity: opts.identity,
|
|
@@ -1508,7 +1494,7 @@ var SshTunnelManager = class {
|
|
|
1508
1494
|
});
|
|
1509
1495
|
}
|
|
1510
1496
|
async isAlive(controlPath) {
|
|
1511
|
-
const res = await
|
|
1497
|
+
const res = await execa2("ssh", ["-O", "check", "-S", controlPath, "dummy"], { reject: false });
|
|
1512
1498
|
return res.exitCode === 0;
|
|
1513
1499
|
}
|
|
1514
1500
|
getTunnelOrThrow(boxId) {
|
|
@@ -1622,12 +1608,12 @@ function perBoxDir(sandboxId) {
|
|
|
1622
1608
|
}
|
|
1623
1609
|
async function ensurePerBoxState(sandboxId) {
|
|
1624
1610
|
const dir = perBoxDir(sandboxId);
|
|
1625
|
-
const sshDir =
|
|
1626
|
-
await
|
|
1611
|
+
const sshDir = join3(dir, "ssh");
|
|
1612
|
+
await mkdir2(sshDir, { recursive: true, mode: 448 });
|
|
1627
1613
|
return {
|
|
1628
1614
|
dir,
|
|
1629
|
-
identity:
|
|
1630
|
-
knownHosts:
|
|
1615
|
+
identity: join3(sshDir, "id_ed25519"),
|
|
1616
|
+
knownHosts: join3(sshDir, "known_hosts")
|
|
1631
1617
|
};
|
|
1632
1618
|
}
|
|
1633
1619
|
function bashScript(s) {
|
|
@@ -1914,7 +1900,7 @@ var hetznerBackend = {
|
|
|
1914
1900
|
`${target.user}@${target.host}`,
|
|
1915
1901
|
bashScript(opts?.cwd ? `cd ${shellQuote(opts.cwd)} && ${cmd}` : cmd)
|
|
1916
1902
|
];
|
|
1917
|
-
const res = await
|
|
1903
|
+
const res = await execa3("ssh", argv, {
|
|
1918
1904
|
reject: false,
|
|
1919
1905
|
timeout: opts?.attemptTimeoutMs ?? 12e4,
|
|
1920
1906
|
env: { ...process.env, ...opts?.env ?? {} }
|
|
@@ -1932,7 +1918,7 @@ var hetznerBackend = {
|
|
|
1932
1918
|
localPath,
|
|
1933
1919
|
`${target.user}@${target.host}:${remotePath}`
|
|
1934
1920
|
];
|
|
1935
|
-
const res = await
|
|
1921
|
+
const res = await execa3("scp", argv, { reject: false, timeout: 3e5 });
|
|
1936
1922
|
if (res.exitCode !== 0) {
|
|
1937
1923
|
throw new Error(`hetzner: scp upload failed (exit ${String(res.exitCode)}): ${res.stderr || ""}`);
|
|
1938
1924
|
}
|
|
@@ -1944,7 +1930,7 @@ var hetznerBackend = {
|
|
|
1944
1930
|
`${target.user}@${target.host}:${remotePath}`,
|
|
1945
1931
|
localPath
|
|
1946
1932
|
];
|
|
1947
|
-
const res = await
|
|
1933
|
+
const res = await execa3("scp", argv, { reject: false, timeout: 3e5 });
|
|
1948
1934
|
if (res.exitCode !== 0) {
|
|
1949
1935
|
throw new Error(`hetzner: scp download failed (exit ${String(res.exitCode)}): ${res.stderr || ""}`);
|
|
1950
1936
|
}
|
|
@@ -2145,9 +2131,9 @@ async function deployControlPlaneToHetzner(opts) {
|
|
|
2145
2131
|
labels: { "agentbox.managed": "true", "agentbox.role": "control-plane" }
|
|
2146
2132
|
})
|
|
2147
2133
|
);
|
|
2148
|
-
const keyDir =
|
|
2134
|
+
const keyDir = join4(homedir22(), ".agentbox", "control-plane", "ssh", stamp);
|
|
2149
2135
|
const key = await mintSshKey(keyDir, `agentbox-control-plane-${stamp}`);
|
|
2150
|
-
const knownHosts =
|
|
2136
|
+
const knownHosts = join4(keyDir, "known_hosts");
|
|
2151
2137
|
log2(`provisioning ${opts.serverType ?? "cx23"} VPS (cloning ${repoUrl}@${repoRef})\u2026`);
|
|
2152
2138
|
const { server } = await withHetznerRetry(
|
|
2153
2139
|
{ method: "createServer", retryOnAmbiguous: false, attemptTimeoutMs: 12e4 },
|
|
@@ -2176,12 +2162,12 @@ async function deployControlPlaneToHetzner(opts) {
|
|
|
2176
2162
|
if (cloned.exitCode !== 0) {
|
|
2177
2163
|
throw new Error("repo clone did not complete on the VPS (cloud-init failed)");
|
|
2178
2164
|
}
|
|
2179
|
-
const staging =
|
|
2180
|
-
await
|
|
2165
|
+
const staging = join4(tmpdir(), `agentbox-cp-deploy-${stamp}`);
|
|
2166
|
+
await mkdir3(staging, { recursive: true });
|
|
2181
2167
|
try {
|
|
2182
|
-
const envLocal =
|
|
2183
|
-
const caddyLocal =
|
|
2184
|
-
const composeLocal =
|
|
2168
|
+
const envLocal = join4(staging, "control-plane.env");
|
|
2169
|
+
const caddyLocal = join4(staging, "Caddyfile");
|
|
2170
|
+
const composeLocal = join4(staging, "docker-compose.caddy.yml");
|
|
2185
2171
|
await writeFile(envLocal, opts.envContent, { mode: 384 });
|
|
2186
2172
|
await writeFile(caddyLocal, caddyfile(domain));
|
|
2187
2173
|
await writeFile(composeLocal, CADDY_COMPOSE);
|
|
@@ -2262,7 +2248,6 @@ export {
|
|
|
2262
2248
|
controlPlaneCloudInit,
|
|
2263
2249
|
generateBoxCloudInit,
|
|
2264
2250
|
pollUntil,
|
|
2265
|
-
mintSshKey,
|
|
2266
2251
|
mintPrepareKey,
|
|
2267
2252
|
sshOptArgs,
|
|
2268
2253
|
sshExec,
|
|
@@ -2278,4 +2263,4 @@ export {
|
|
|
2278
2263
|
hetznerProvider,
|
|
2279
2264
|
providerModule
|
|
2280
2265
|
};
|
|
2281
|
-
//# sourceMappingURL=chunk-
|
|
2266
|
+
//# sourceMappingURL=chunk-ERMU7RMK.js.map
|