@madarco/agentbox 0.26.1 → 0.27.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 +32 -0
- package/README.md +1 -1
- package/dist/{_cloud-attach-7WRQH6XZ.js → _cloud-attach-WDGM6FL5.js} +4 -4
- package/dist/{chunk-UIFL7F2G.js → chunk-26IKZRTT.js} +2 -2
- package/dist/{chunk-DJQMK4RN.js → chunk-HR7NHH5J.js} +14 -9
- package/dist/chunk-HR7NHH5J.js.map +1 -0
- package/dist/{chunk-K5KOLYIL.js → chunk-IDH5A4RR.js} +2 -2
- package/dist/{chunk-ZY7M7MXH.js → chunk-JE6UI5YR.js} +10 -10
- package/dist/{chunk-7ZZAZPYX.js → chunk-KWOEUFVA.js} +2 -2
- package/dist/{chunk-BA2VLJVU.js → chunk-LL7NCMUU.js} +3 -3
- package/dist/{chunk-I2OAJS3L.js → chunk-NEF6MDJO.js} +4 -4
- package/dist/{chunk-I2OAJS3L.js.map → chunk-NEF6MDJO.js.map} +1 -1
- package/dist/{dist-YA7EXBGG.js → chunk-SJ75AIA2.js} +486 -92
- package/dist/chunk-SJ75AIA2.js.map +1 -0
- package/dist/{chunk-PK2QF4IR.js → chunk-UJEH2NJT.js} +27 -14
- package/dist/chunk-UJEH2NJT.js.map +1 -0
- package/dist/{chunk-DQHMDDAT.js → chunk-V5XXJH63.js} +2 -2
- package/dist/{dist-DTNYMBQ5.js → dist-FTKS2GI4.js} +5 -5
- package/dist/{dist-5IICYSR6.js → dist-KQTMCVME.js} +5 -5
- package/dist/{dist-5IICYSR6.js.map → dist-KQTMCVME.js.map} +1 -1
- package/dist/{dist-AR5CHRSV.js → dist-O3LKOIE7.js} +5 -5
- package/dist/{dist-POVRY7HO.js → dist-OO52HARR.js} +3 -3
- package/dist/{dist-K4LNH3EC.js → dist-TSFVB7AI.js} +5 -5
- package/dist/{dist-XYY6SIKG.js → dist-WVYAURMF.js} +5 -5
- package/dist/dist-Z6L5MM5D.js +46 -0
- package/dist/index.js +392 -211
- package/dist/index.js.map +1 -1
- package/dist/{prepared-state-75DIZ55S-W6NU3S3B.js → prepared-state-75DIZ55S-TNJXWMXV.js} +2 -2
- package/dist/prepared-state-75DIZ55S-TNJXWMXV.js.map +1 -0
- package/package.json +7 -7
- package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
- package/runtime/hub/apps/hub/.next/app-path-routes-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
- package/runtime/hub/apps/hub/.next/routes-manifest.json +22 -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/docs/route.js +2 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/docs/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/openapi.json/route.js +2 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/openapi.json/route.js.nft.json +1 -1
- 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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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 +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/044u_hub__next-internal_server_app_(dashboard)_api_v1_hosts_route_actions_0b_404_.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0web_next-internal_server_app_(dashboard)_api_v1_hosts_[alias]_route_actions_0swypy5.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_hosts_[alias]_bake_route_actions_1-_pu3n.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a7djvw._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0bmro0b._.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]__0t4qmv-._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xh14bo._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13ioh5z._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h4xycg._.js +3 -0
- 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]__1md9kdw._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/_1bng7w9._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/apps_hub_app_(dashboard)_api_v1_lib_openapi_ts_1yokmzt._.js +14 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_1uccfbf._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_03s-ah2._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0r4px38._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_18w2zeh._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_0od97-d._.js +3 -0
- 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/chunks/ssr/apps_hub_app_(dashboard)_settings_page_tsx_0hv6n82._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/functions-config-manifest.json +3 -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/0xdtiy_m2ygv8.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/1_ur0im1g7_s9.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/26rwu1f2gzemi.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/3v6kx35_lwjs8.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/{3dfjrxx-dy644.css → 42uysd_max-yq.css} +1 -1
- package/runtime/hub/apps/hub/.next/static/chunks/44j61g8lm9nvw.js +1 -0
- package/runtime/hub/apps/hub/{chunk-BARD2DI6.js → chunk-EHBJKZCL.js} +13 -8
- package/runtime/hub/apps/hub/{chunk-4QY2VZCF.js → chunk-RXYOWSSN.js} +19 -13
- package/runtime/hub/apps/hub/{chunk-XZZXPEVV.js → chunk-YJ5MJOXK.js} +1 -1
- package/runtime/hub/apps/hub/{dist-3ENKQN5G.js → dist-3I7KUI6W.js} +3 -3
- package/runtime/hub/apps/hub/{dist-WAZKGVYL.js → dist-6FPPUSWZ.js} +2 -2
- package/runtime/hub/apps/hub/{dist-NNBELNA7.js → dist-DX6IYMAH.js} +300 -109
- package/runtime/hub/apps/hub/{dist-RJJ2SDYO.js → dist-G6TXUSPZ.js} +3 -3
- package/runtime/hub/apps/hub/{dist-AE6IV4FV.js → dist-GTVVXCBP.js} +3 -3
- package/runtime/hub/apps/hub/{dist-6VGJOQYK.js → dist-JG45OFT2.js} +3 -3
- package/runtime/hub/apps/hub/{dist-TU7D6UTB.js → dist-LYDHYTP2.js} +3 -3
- package/runtime/hub/apps/hub/{prepared-state-75DIZ55S-NYEDSU2U.js → prepared-state-75DIZ55S-2IFNUHHM.js} +1 -1
- package/runtime/hub/apps/hub/server.js +136 -19
- package/dist/chunk-DJQMK4RN.js.map +0 -1
- package/dist/chunk-PK2QF4IR.js.map +0 -1
- package/dist/chunk-ZYKNSHOH.js +0 -259
- package/dist/chunk-ZYKNSHOH.js.map +0 -1
- package/dist/dist-YA7EXBGG.js.map +0 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bqbkd5._.js +0 -14
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qa4a0v._.js +0 -14
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_09gdzmo._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0tgpglr._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_1laion6._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_0b_hsjl._.js +0 -3
- package/runtime/hub/apps/hub/.next/static/chunks/1c5w3kqosumog.js +0 -1
- package/runtime/hub/apps/hub/.next/static/chunks/1o3ot_9-8jgzc.js +0 -1
- package/runtime/hub/apps/hub/.next/static/chunks/1z4elhg8gyq98.js +0 -1
- package/runtime/hub/apps/hub/.next/static/chunks/3uq9hf-roasav.js +0 -1
- /package/dist/{_cloud-attach-7WRQH6XZ.js.map → _cloud-attach-WDGM6FL5.js.map} +0 -0
- /package/dist/{chunk-UIFL7F2G.js.map → chunk-26IKZRTT.js.map} +0 -0
- /package/dist/{chunk-K5KOLYIL.js.map → chunk-IDH5A4RR.js.map} +0 -0
- /package/dist/{chunk-ZY7M7MXH.js.map → chunk-JE6UI5YR.js.map} +0 -0
- /package/dist/{chunk-7ZZAZPYX.js.map → chunk-KWOEUFVA.js.map} +0 -0
- /package/dist/{chunk-BA2VLJVU.js.map → chunk-LL7NCMUU.js.map} +0 -0
- /package/dist/{chunk-DQHMDDAT.js.map → chunk-V5XXJH63.js.map} +0 -0
- /package/dist/{dist-DTNYMBQ5.js.map → dist-FTKS2GI4.js.map} +0 -0
- /package/dist/{dist-AR5CHRSV.js.map → dist-O3LKOIE7.js.map} +0 -0
- /package/dist/{dist-POVRY7HO.js.map → dist-OO52HARR.js.map} +0 -0
- /package/dist/{dist-K4LNH3EC.js.map → dist-TSFVB7AI.js.map} +0 -0
- /package/dist/{dist-XYY6SIKG.js.map → dist-WVYAURMF.js.map} +0 -0
- /package/dist/{prepared-state-75DIZ55S-W6NU3S3B.js.map → dist-Z6L5MM5D.js.map} +0 -0
- /package/runtime/hub/apps/hub/.next/static/{mJYh9UHTsLaGGyRjBSvme → S-yw9-SVffiEHRGm85NzP}/_buildManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{mJYh9UHTsLaGGyRjBSvme → S-yw9-SVffiEHRGm85NzP}/_clientMiddlewareManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{mJYh9UHTsLaGGyRjBSvme → S-yw9-SVffiEHRGm85NzP}/_ssgManifest.js +0 -0
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
} from "./chunk-CKBHQ7OI.js";
|
|
13
13
|
import {
|
|
14
14
|
createCloudProvider
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-EHBJKZCL.js";
|
|
16
16
|
import {
|
|
17
17
|
detectPortless,
|
|
18
18
|
portlessDoctorRow
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-YJ5MJOXK.js";
|
|
20
20
|
import "./chunk-3LAHFDJF.js";
|
|
21
21
|
import {
|
|
22
22
|
SshTunnelManager,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
waitForSsh,
|
|
45
45
|
writeManagedSecrets,
|
|
46
46
|
writePreparedStateRaw
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-RXYOWSSN.js";
|
|
48
48
|
import {
|
|
49
49
|
execa
|
|
50
50
|
} from "./chunk-UDZ3VXRF.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
baseFreshnessFromFingerprints,
|
|
4
4
|
currentCloudBaseFingerprint,
|
|
5
5
|
openWebAppOnVncScreen
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EHBJKZCL.js";
|
|
7
7
|
import {
|
|
8
8
|
deleteJob,
|
|
9
9
|
enqueuePrepareJob,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
readJob,
|
|
18
18
|
startRelayDaemon,
|
|
19
19
|
writeQueueLoginCode
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-YJ5MJOXK.js";
|
|
21
21
|
import "./chunk-3LAHFDJF.js";
|
|
22
22
|
import {
|
|
23
23
|
BOX_WORKSPACE,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
secretsEnvPath,
|
|
37
37
|
setBoxDisplayName,
|
|
38
38
|
syncAgentboxSshConfig
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-RXYOWSSN.js";
|
|
40
40
|
import "./chunk-UDZ3VXRF.js";
|
|
41
41
|
import {
|
|
42
42
|
hubProfile
|
|
@@ -51,7 +51,9 @@ import {
|
|
|
51
51
|
providerMeta,
|
|
52
52
|
registerProject,
|
|
53
53
|
resolveDefaultCheckpoint,
|
|
54
|
-
|
|
54
|
+
setConfigValue,
|
|
55
|
+
unregisterProject,
|
|
56
|
+
unsetConfigValue
|
|
55
57
|
} from "./chunk-QSMPSV5Z.js";
|
|
56
58
|
import "./chunk-OG4KH2FZ.js";
|
|
57
59
|
|
|
@@ -70,13 +72,13 @@ import { promisify } from "node:util";
|
|
|
70
72
|
var execFileAsync = promisify(execFile);
|
|
71
73
|
var DISPLAY_NAME_MAX = 60;
|
|
72
74
|
var IMPORTERS = {
|
|
73
|
-
docker: () => import("./dist-
|
|
74
|
-
daytona: () => import("./dist-
|
|
75
|
-
hetzner: () => import("./dist-
|
|
76
|
-
vercel: () => import("./dist-
|
|
77
|
-
e2b: () => import("./dist-
|
|
78
|
-
digitalocean: () => import("./dist-
|
|
79
|
-
"remote-docker": () => import("./dist-
|
|
75
|
+
docker: () => import("./dist-6FPPUSWZ.js"),
|
|
76
|
+
daytona: () => import("./dist-JG45OFT2.js"),
|
|
77
|
+
hetzner: () => import("./dist-LYDHYTP2.js"),
|
|
78
|
+
vercel: () => import("./dist-GTVVXCBP.js"),
|
|
79
|
+
e2b: () => import("./dist-G6TXUSPZ.js"),
|
|
80
|
+
digitalocean: () => import("./dist-3I7KUI6W.js"),
|
|
81
|
+
"remote-docker": () => import("./dist-DX6IYMAH.js")
|
|
80
82
|
};
|
|
81
83
|
var prepareEnqueueChain = /* @__PURE__ */ new Map();
|
|
82
84
|
async function providerForBox(box) {
|
|
@@ -259,8 +261,19 @@ function mapJobToBox(job, status) {
|
|
|
259
261
|
projectRoot: root
|
|
260
262
|
};
|
|
261
263
|
}
|
|
264
|
+
function remoteDockerHostCount() {
|
|
265
|
+
try {
|
|
266
|
+
const raw = JSON.parse(
|
|
267
|
+
readFileSync(path.join(os.homedir(), ".agentbox", "remote-docker-hosts.json"), "utf8")
|
|
268
|
+
);
|
|
269
|
+
return raw.hosts && typeof raw.hosts === "object" ? Object.keys(raw.hosts).length : 0;
|
|
270
|
+
} catch {
|
|
271
|
+
return 0;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
262
274
|
function isProviderConfigured(id) {
|
|
263
275
|
if (id === "docker") return true;
|
|
276
|
+
if (id === "remote-docker") return remoteDockerHostCount() > 0;
|
|
264
277
|
const raw = readPreparedStateRaw(id);
|
|
265
278
|
return !!(raw && typeof raw === "object" && raw.base);
|
|
266
279
|
}
|
|
@@ -336,7 +349,7 @@ function listProviders(jobs) {
|
|
|
336
349
|
);
|
|
337
350
|
let reason;
|
|
338
351
|
if (!configured) {
|
|
339
|
-
reason = hasCredentials ? "Credentials set \u2014 bake the base image to finish setup." : "Not set up \u2014 add credentials, then bake the base image.";
|
|
352
|
+
reason = id === "remote-docker" ? "Add a host in Settings to run boxes on your own machine over SSH." : hasCredentials ? "Credentials set \u2014 bake the base image to finish setup." : "Not set up \u2014 add credentials, then bake the base image.";
|
|
340
353
|
}
|
|
341
354
|
return { id, label, configured, hasCredentials, jobId: bake?.id, reason };
|
|
342
355
|
});
|
|
@@ -346,7 +359,7 @@ var freshnessCache = /* @__PURE__ */ new Map();
|
|
|
346
359
|
async function providerBaseFreshness(id, claudeInstall) {
|
|
347
360
|
if (id === "docker") {
|
|
348
361
|
try {
|
|
349
|
-
const { evaluateDockerBaseFreshness } = await import("./dist-
|
|
362
|
+
const { evaluateDockerBaseFreshness } = await import("./dist-6FPPUSWZ.js");
|
|
350
363
|
return await evaluateDockerBaseFreshness({ claudeInstall });
|
|
351
364
|
} catch {
|
|
352
365
|
return { state: "unknown" };
|
|
@@ -387,6 +400,37 @@ async function listProvidersWithFreshness(base) {
|
|
|
387
400
|
})
|
|
388
401
|
);
|
|
389
402
|
}
|
|
403
|
+
async function loadRemoteDockerHostViews() {
|
|
404
|
+
const rd = await import("./dist-DX6IYMAH.js");
|
|
405
|
+
const prepared = rd.readPreparedState();
|
|
406
|
+
const cfg = await loadEffectiveConfig(os.homedir());
|
|
407
|
+
const dflt = (cfg.effective.box.remoteDockerHost || "").trim();
|
|
408
|
+
return rd.listHostAliases().map(({ alias, entry }) => {
|
|
409
|
+
const baked = prepared?.hosts[alias];
|
|
410
|
+
return {
|
|
411
|
+
alias,
|
|
412
|
+
ssh: entry.ssh,
|
|
413
|
+
baked: Boolean(baked),
|
|
414
|
+
...baked ? { bakedImageRef: baked.imageRef } : {},
|
|
415
|
+
default: alias === dflt
|
|
416
|
+
};
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
async function expandRemoteDockerHosts(base) {
|
|
420
|
+
const idx = base.findIndex((p) => p.id === "remote-docker");
|
|
421
|
+
if (idx < 0) return base;
|
|
422
|
+
const hosts = await loadRemoteDockerHostViews();
|
|
423
|
+
if (hosts.length === 0) return base;
|
|
424
|
+
const perHost = hosts.map((h) => ({
|
|
425
|
+
// id stays the `docker:<alias>` create spec; the label reads like "Docker (local)".
|
|
426
|
+
id: `docker:${h.alias}`,
|
|
427
|
+
label: `Docker (${h.alias})`,
|
|
428
|
+
configured: true,
|
|
429
|
+
hasCredentials: true,
|
|
430
|
+
reason: h.baked ? void 0 : "Image builds on first create \u2014 bake it in Settings for a faster start."
|
|
431
|
+
}));
|
|
432
|
+
return [...base.slice(0, idx), ...perHost, ...base.slice(idx + 1)];
|
|
433
|
+
}
|
|
390
434
|
function currentUser() {
|
|
391
435
|
let login = "user";
|
|
392
436
|
try {
|
|
@@ -655,8 +699,9 @@ function createHubBackend(handle) {
|
|
|
655
699
|
providers: listProviders(jobs)
|
|
656
700
|
};
|
|
657
701
|
},
|
|
658
|
-
async providersWithFreshness() {
|
|
659
|
-
|
|
702
|
+
async providersWithFreshness(opts) {
|
|
703
|
+
const fresh = await listProvidersWithFreshness(listProviders(await loadQueue()));
|
|
704
|
+
return opts?.expandRemoteDockerHosts ? expandRemoteDockerHosts(fresh) : fresh;
|
|
660
705
|
},
|
|
661
706
|
start: (id) => runLifecycle(id, async (box, provider) => {
|
|
662
707
|
const state = await provider.probeState(box);
|
|
@@ -733,10 +778,19 @@ function createHubBackend(handle) {
|
|
|
733
778
|
try {
|
|
734
779
|
const workspace = await resolveProjectPath(input.projectId);
|
|
735
780
|
if (!workspace) return { ok: false, error: `unknown project ${input.projectId}` };
|
|
736
|
-
const provider = input.provider ?? "docker";
|
|
737
|
-
|
|
738
|
-
if (
|
|
739
|
-
|
|
781
|
+
const provider = (input.provider ?? "docker").trim();
|
|
782
|
+
const hostSpec = provider.match(/^(?:docker|remote-docker):(.+)$/);
|
|
783
|
+
if (hostSpec) {
|
|
784
|
+
const alias = hostSpec[1];
|
|
785
|
+
const rd = await import("./dist-DX6IYMAH.js");
|
|
786
|
+
if (!rd.getHostAlias(alias)) {
|
|
787
|
+
return { ok: false, error: `unknown remote-docker host '${alias}' \u2014 add it in Settings` };
|
|
788
|
+
}
|
|
789
|
+
} else {
|
|
790
|
+
if (!isProviderKind(provider)) return { ok: false, error: `unknown provider ${provider}` };
|
|
791
|
+
if (!isProviderConfigured(provider)) {
|
|
792
|
+
return { ok: false, error: `provider ${provider} is not set up on this host` };
|
|
793
|
+
}
|
|
740
794
|
}
|
|
741
795
|
const noAgent = input.agent === "none";
|
|
742
796
|
const agent = input.agent === "claude" || input.agent === "none" ? "claude-code" : input.agent;
|
|
@@ -928,6 +982,69 @@ function createHubBackend(handle) {
|
|
|
928
982
|
const e = err;
|
|
929
983
|
return { ok: false, error: cleanCliError(e) };
|
|
930
984
|
}
|
|
985
|
+
},
|
|
986
|
+
// ── remote-docker host aliases ──
|
|
987
|
+
async listRemoteDockerHosts() {
|
|
988
|
+
return loadRemoteDockerHostViews();
|
|
989
|
+
},
|
|
990
|
+
async addRemoteDockerHost(alias, ssh, opts) {
|
|
991
|
+
try {
|
|
992
|
+
const rd = await import("./dist-DX6IYMAH.js");
|
|
993
|
+
const trimmedSsh = ssh.trim();
|
|
994
|
+
if (!rd.isValidAlias(alias)) {
|
|
995
|
+
return {
|
|
996
|
+
ok: false,
|
|
997
|
+
error: `invalid host alias "${alias}" \u2014 use a plain name (letters, digits, ., _, -; no @, :, /)`
|
|
998
|
+
};
|
|
999
|
+
}
|
|
1000
|
+
if (!trimmedSsh) return { ok: false, error: "SSH connection is required" };
|
|
1001
|
+
if (rd.getHostAlias(alias)) {
|
|
1002
|
+
return { ok: false, error: `host alias "${alias}" already exists` };
|
|
1003
|
+
}
|
|
1004
|
+
const probe = await rd.probeRemoteEngine(trimmedSsh);
|
|
1005
|
+
if (!probe.ok) return { ok: false, error: probe.error ?? `${trimmedSsh}: remote engine unusable` };
|
|
1006
|
+
rd.upsertHostAlias(alias, trimmedSsh);
|
|
1007
|
+
if (opts?.default) {
|
|
1008
|
+
await setConfigValue("global", "box.remoteDockerHost", alias, os.homedir(), { raw: true });
|
|
1009
|
+
}
|
|
1010
|
+
return { ok: true };
|
|
1011
|
+
} catch (err) {
|
|
1012
|
+
return { ok: false, error: err instanceof Error ? err.message : String(err) };
|
|
1013
|
+
}
|
|
1014
|
+
},
|
|
1015
|
+
async removeRemoteDockerHost(alias) {
|
|
1016
|
+
try {
|
|
1017
|
+
const rd = await import("./dist-DX6IYMAH.js");
|
|
1018
|
+
rd.removeHostAlias(alias);
|
|
1019
|
+
rd.removePreparedHost(alias);
|
|
1020
|
+
const cfg = await loadEffectiveConfig(os.homedir());
|
|
1021
|
+
if (cfg.layers.global.values.box?.remoteDockerHost === alias) {
|
|
1022
|
+
await unsetConfigValue("global", "box.remoteDockerHost", os.homedir());
|
|
1023
|
+
}
|
|
1024
|
+
const { boxes } = await readState();
|
|
1025
|
+
const boxesAffected = boxes.filter(
|
|
1026
|
+
(b) => b.provider === "remote-docker" && typeof b.cloud?.sandboxId === "string" && b.cloud.sandboxId.startsWith(`${alias}/`)
|
|
1027
|
+
).map((b) => b.name);
|
|
1028
|
+
return { ok: true, boxesAffected };
|
|
1029
|
+
} catch (err) {
|
|
1030
|
+
return { ok: false, error: err instanceof Error ? err.message : String(err) };
|
|
1031
|
+
}
|
|
1032
|
+
},
|
|
1033
|
+
async bakeRemoteDockerHost(alias) {
|
|
1034
|
+
try {
|
|
1035
|
+
const rd = await import("./dist-DX6IYMAH.js");
|
|
1036
|
+
if (!rd.getHostAlias(alias)) return { ok: false, error: `no such host alias ${alias}` };
|
|
1037
|
+
const spec = `docker:${alias}`;
|
|
1038
|
+
const existing = (await loadQueue()).find(
|
|
1039
|
+
(j) => j.kind === "prepare" && j.providerName === spec && (j.status === "queued" || j.status === "running")
|
|
1040
|
+
);
|
|
1041
|
+
if (existing) return { ok: true, jobId: existing.id };
|
|
1042
|
+
const { job } = await enqueuePrepareJob({ providerName: spec });
|
|
1043
|
+
handle.pokeQueue();
|
|
1044
|
+
return { ok: true, jobId: job.id };
|
|
1045
|
+
} catch (err) {
|
|
1046
|
+
return { ok: false, error: err instanceof Error ? err.message : String(err) };
|
|
1047
|
+
}
|
|
931
1048
|
}
|
|
932
1049
|
};
|
|
933
1050
|
}
|