@madarco/agentbox 0.27.1 → 0.28.0-nightly.202607251721
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 +87 -4
- package/README.md +7 -3
- package/dist/_cloud-attach-XZYF324R.js +26 -0
- package/dist/admin-client-NOZ5CCAH.js +15 -0
- package/dist/chunk-2VW37PW4.js +1694 -0
- package/dist/chunk-2VW37PW4.js.map +1 -0
- package/dist/{chunk-HR7NHH5J.js → chunk-3UMM4VJH.js} +808 -57
- package/dist/chunk-3UMM4VJH.js.map +1 -0
- package/dist/chunk-5U5QOFL5.js +20 -0
- package/dist/chunk-5U5QOFL5.js.map +1 -0
- package/dist/chunk-6P6D77QP.js +285 -0
- package/dist/chunk-6P6D77QP.js.map +1 -0
- package/dist/chunk-6V366IZC.js +2892 -0
- package/dist/chunk-6V366IZC.js.map +1 -0
- package/dist/{chunk-KWOEUFVA.js → chunk-7J6G526Q.js} +6 -14
- package/dist/{chunk-KWOEUFVA.js.map → chunk-7J6G526Q.js.map} +1 -1
- package/dist/{chunk-IDH5A4RR.js → chunk-AYPAYY5R.js} +17 -4
- package/dist/chunk-AYPAYY5R.js.map +1 -0
- package/dist/{chunk-JGZSA5ZI.js → chunk-BHJCMTHP.js} +58 -15
- package/dist/chunk-BHJCMTHP.js.map +1 -0
- package/dist/{chunk-26IKZRTT.js → chunk-BLWAWGFX.js} +297 -1217
- package/dist/chunk-BLWAWGFX.js.map +1 -0
- package/dist/chunk-CGPUFXET.js +95 -0
- package/dist/chunk-CGPUFXET.js.map +1 -0
- package/dist/{chunk-SJ75AIA2.js → chunk-D6AODRNA.js} +12 -9
- package/dist/{chunk-SJ75AIA2.js.map → chunk-D6AODRNA.js.map} +1 -1
- package/dist/chunk-DPJMEG7U.js +11 -0
- package/dist/chunk-DPJMEG7U.js.map +1 -0
- package/dist/chunk-E2ITEZAQ.js +148 -0
- package/dist/chunk-E2ITEZAQ.js.map +1 -0
- package/dist/{chunk-JE6UI5YR.js → chunk-NKVCIH6N.js} +89 -223
- package/dist/chunk-NKVCIH6N.js.map +1 -0
- package/dist/chunk-OEYAVBA6.js +120 -0
- package/dist/chunk-OEYAVBA6.js.map +1 -0
- package/dist/{chunk-UJEH2NJT.js → chunk-PXYPQ5BO.js} +64 -264
- package/dist/chunk-PXYPQ5BO.js.map +1 -0
- package/dist/chunk-QESXSSO6.js +670 -0
- package/dist/chunk-QESXSSO6.js.map +1 -0
- package/dist/{chunk-NEF6MDJO.js → chunk-QJCK2AFX.js} +128 -26
- package/dist/chunk-QJCK2AFX.js.map +1 -0
- package/dist/chunk-RUJJY23M.js +84 -0
- package/dist/chunk-RUJJY23M.js.map +1 -0
- package/dist/{chunk-LL7NCMUU.js → chunk-SKNJRYM5.js} +7 -13
- package/dist/chunk-SKNJRYM5.js.map +1 -0
- package/dist/chunk-WFGAMJ5Q.js +689 -0
- package/dist/chunk-WFGAMJ5Q.js.map +1 -0
- package/dist/chunk-ZJL56TJD.js +1444 -0
- package/dist/chunk-ZJL56TJD.js.map +1 -0
- package/dist/{chunk-V5XXJH63.js → chunk-ZXOP4LBG.js} +5 -8
- package/dist/chunk-ZXOP4LBG.js.map +1 -0
- package/dist/control-plane-2VEM2KCL.js +31 -0
- package/dist/custody-client-P6XIXHRG.js +16 -0
- package/dist/{dist-TSFVB7AI.js → dist-2SYQI5S2.js} +11 -7
- package/dist/dist-2SYQI5S2.js.map +1 -0
- package/dist/{dist-KQTMCVME.js → dist-6QZMZEL7.js} +18 -11
- package/dist/dist-6QZMZEL7.js.map +1 -0
- package/dist/{dist-FTKS2GI4.js → dist-JHMILJUT.js} +10 -6
- package/dist/{dist-OO52HARR.js → dist-JOFZOZCY.js} +41 -25
- package/dist/{dist-O3LKOIE7.js → dist-KZ2GEEEX.js} +11 -7
- package/dist/dist-KZ2GEEEX.js.map +1 -0
- package/dist/{dist-Z6L5MM5D.js → dist-Q5NY4CF6.js} +10 -6
- package/dist/{dist-U2SVLJUQ.js → dist-SKMNEDVW.js} +8 -2
- package/dist/dist-SKMNEDVW.js.map +1 -0
- package/dist/dist-SRCKO7ZV.js +197 -0
- package/dist/dist-SRCKO7ZV.js.map +1 -0
- package/dist/{dist-WVYAURMF.js → dist-UXZQWKY6.js} +10 -6
- package/dist/dist-UXZQWKY6.js.map +1 -0
- package/dist/env-file-UDUDQMP4.js +11 -0
- package/dist/env-file-UDUDQMP4.js.map +1 -0
- package/dist/hub-adopt-ZS5CREYF.js +21 -0
- package/dist/hub-adopt-ZS5CREYF.js.map +1 -0
- package/dist/index.js +2461 -1905
- package/dist/index.js.map +1 -1
- package/dist/node-postgres-6JUOVUN5.js +3584 -0
- package/dist/node-postgres-6JUOVUN5.js.map +1 -0
- package/dist/{prepared-state-75DIZ55S-TNJXWMXV.js → prepared-state-75DIZ55S-P6LE4N64.js} +3 -2
- package/dist/prepared-state-75DIZ55S-P6LE4N64.js.map +1 -0
- package/dist/remote-hub-SJ4XWBA5.js +9 -0
- package/dist/remote-hub-SJ4XWBA5.js.map +1 -0
- package/dist/sqlite-proxy-53E5D2VM.js +2882 -0
- package/dist/sqlite-proxy-53E5D2VM.js.map +1 -0
- package/package.json +1 -1
- package/runtime/_shared/ctl.cjs +29199 -16813
- package/runtime/digitalocean/ctl.cjs +29199 -16813
- package/runtime/docker/packages/ctl/dist/bin.cjs +29199 -16813
- package/runtime/e2b/ctl.cjs +29199 -16813
- package/runtime/hetzner/ctl.cjs +29199 -16813
- package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
- package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
- package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js +5 -5
- package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js +4 -4
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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/[...path]/route.js +4 -2
- package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js.nft.json +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/chunks/0-fj_better-auth_dist_adapters_kysely-adapter_index_mjs_0btft52._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_0gvv4ct._.js +4 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_0pn9b49._.js +4 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_145bz8z._.js +9 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_14y990b._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_1nl4l3q._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_sqlite-proxy_index_05v_j5r.js +15 -0
- package/runtime/hub/apps/hub/.next/server/chunks/{[externals]__12m3qoa._.js → [externals]__0f3aqcx._.js} +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-9g1s8._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-pvfxg._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__01amzh6._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__02q799_._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__03k22rl._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04tqk-j._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__05ovf1y._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__05s-_x7._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07dnyfi._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07zk6qo._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0_59yi6._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ajlo3d._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0b5s54n._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0c4fiez._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0c9iff1._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +5 -5
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dh6lzr._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ey83ai._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0h6vdvr._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lup7p4._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0luxuu4._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nl2u6u._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nonp-6._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0oplozy._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0p-6wgd._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0rcnwbw._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0tuz1am._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-9g0ae._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__10ry4ss._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11hv164._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__154_i13._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17676rc._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bg1alc._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cvqb1d._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d60gbz._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dm0jmw._.js +6 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dv_b1t._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1fzxip4._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h4oj-e._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1i4gq_2._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1v1p7in._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1v9_her._.js +4 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1x1jkpb._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1yd8n5l._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20t_rs8._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/_033w048._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_06f2faq._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/{_0760z6y._.js → _0907rw0._.js} +15 -15
- package/runtime/hub/apps/hub/.next/server/chunks/_0f3molr._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_0lgs9kd._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_0pyhcqe._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_1-42ili._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_11__3wi._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_12flzuh._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_1bng7w9._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_1rpkqst._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_1wt72m1._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_1x3l5t8._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/packages_relay_dist_control-plane_03a-9aj.js +62 -31
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_0xy-j7z._.js +1 -1
- 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/09xn_next_dist_esm_build_templates_app-page_010858m.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_04zwxnx.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_06exuc7.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2ldrt.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2tzep.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_116nh32.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_11dyjcb.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_1_4knli.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/1w4z_drizzle-orm_0ebuy19._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/1w4z_drizzle-orm_0wxhi0-._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/1w4z_drizzle-orm_0xe4ick._.js +9 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/1w4z_drizzle-orm_14oaveu._.js +4 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/1w4z_drizzle-orm_sqlite-proxy_index_1a6wfdg.js +15 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0-pm2yl._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__08-1wwu._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0c9mbcn._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0gdfxj4._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0kc-hwp._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0lu73p6._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0m1yf2b._.js +4 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0wv-3zo._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__10bfmwi._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__18qvdzb._.js +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1l2urlw._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/{_0ro6vh6._.js → _0r2xlss._.js} +3 -3
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_components_1z1p98f._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/packages_relay_dist_control-plane_0ve-wz4.js +2 -25
- package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
- package/runtime/hub/apps/hub/.next/server/middleware.js +1 -1
- package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
- package/runtime/hub/apps/hub/.next/static/chunks/{2xc1sm79a6tsb.js → 2gsrna76i1d80.js} +1 -1
- package/runtime/hub/apps/hub/attach-helper.cjs +191 -0
- package/runtime/hub/apps/hub/{auth-DC44GQZY.js → auth-IRNNO3IK.js} +2 -2
- package/runtime/hub/apps/hub/{auth-config-LALRDYDO.js → auth-config-WJHIMGUE.js} +4 -2
- package/runtime/hub/apps/hub/{chunk-YJ5MJOXK.js → chunk-4LYVBRBC.js} +2094 -220
- package/runtime/hub/apps/hub/chunk-6AVSKCZJ.js +669 -0
- package/runtime/hub/apps/hub/{chunk-QSMPSV5Z.js → chunk-A5Y7LJMU.js} +57 -14
- package/runtime/hub/apps/hub/chunk-EDRFXO2M.js +35 -0
- package/runtime/hub/apps/hub/chunk-F2JI4GMX.js +2891 -0
- package/runtime/hub/apps/hub/{chunk-EHBJKZCL.js → chunk-O3K3ZGFF.js} +500 -35
- package/runtime/hub/apps/hub/chunk-RII6IKNJ.js +688 -0
- package/runtime/hub/apps/hub/{chunk-RXYOWSSN.js → chunk-RMEUA6PA.js} +120 -14
- package/runtime/hub/apps/hub/{chunk-3FJNKSNZ.js → chunk-SCHQR5KR.js} +3 -1
- package/runtime/hub/apps/hub/{dist-6FPPUSWZ.js → dist-2GEAA7QA.js} +15 -3
- package/runtime/hub/apps/hub/{dist-JG45OFT2.js → dist-36O6F6M3.js} +39 -24
- package/runtime/hub/apps/hub/{dist-3I7KUI6W.js → dist-IWLEL2TO.js} +21 -24
- package/runtime/hub/apps/hub/{dist-G6TXUSPZ.js → dist-NYKIT5W5.js} +10 -11
- package/runtime/hub/apps/hub/{dist-EQV4L7KP.js → dist-QB2IJ7OD.js} +7 -1
- package/runtime/hub/apps/hub/{dist-LYDHYTP2.js → dist-RBBXXGLI.js} +129 -26
- package/runtime/hub/apps/hub/{dist-GTVVXCBP.js → dist-RRJN2U5P.js} +10 -14
- package/runtime/hub/apps/hub/{dist-DX6IYMAH.js → dist-UWXGDCK4.js} +14 -11
- package/runtime/hub/apps/hub/{hub-token-COBZGSLS.js → hub-token-6USIMBPQ.js} +2 -2
- package/runtime/hub/apps/hub/hub-worker-SOFWVTWU.js +215 -0
- package/runtime/hub/apps/hub/node-postgres-DIU2H5VP.js +3583 -0
- package/runtime/hub/apps/hub/package.json +5 -2
- package/runtime/hub/apps/hub/{prepared-state-75DIZ55S-2IFNUHHM.js → prepared-state-75DIZ55S-P5FHEORG.js} +1 -1
- package/runtime/hub/apps/hub/server.js +247 -66
- package/runtime/hub/apps/hub/sqlite-proxy-VJS3HIOV.js +2881 -0
- package/runtime/relay/bin.cjs +694 -13
- package/runtime/vercel/ctl.cjs +29199 -16813
- package/dist/_cloud-attach-WDGM6FL5.js +0 -19
- package/dist/chunk-26IKZRTT.js.map +0 -1
- package/dist/chunk-HR7NHH5J.js.map +0 -1
- package/dist/chunk-IDH5A4RR.js.map +0 -1
- package/dist/chunk-JE6UI5YR.js.map +0 -1
- package/dist/chunk-JGZSA5ZI.js.map +0 -1
- package/dist/chunk-LL7NCMUU.js.map +0 -1
- package/dist/chunk-NEF6MDJO.js.map +0 -1
- package/dist/chunk-UJEH2NJT.js.map +0 -1
- package/dist/chunk-V5XXJH63.js.map +0 -1
- package/dist/dist-KQTMCVME.js.map +0 -1
- package/dist/dist-O3LKOIE7.js.map +0 -1
- package/dist/dist-TSFVB7AI.js.map +0 -1
- package/runtime/hub/apps/hub/.next/server/chunks/0zhp_better-auth_dist_adapters_kysely-adapter_index_mjs_1rl4qnh._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04h15ml._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04jgk9x._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07ednlo._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a7djvw._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ig1bot._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0keu6we._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ql4fjo._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0szd4sh._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0t7o5ed._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vs8fma._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0w9ud8u._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xh14bo._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yhb0gc._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-0flwc._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13ioh5z._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13jwk_k._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16_uteg._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16p2m-g._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19pc87s._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_gu2yk._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1a50b07._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ai-945._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bu2zio._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ctczev._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d6mtlk._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dn_3i1._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1e4z_-v._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1f2sueq._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1f9zctr._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h4xycg._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hqla7-._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1js2jdv._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1md9kdw._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mttufy._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1nepkp-._.js +0 -6
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1pp5oib._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q5bqse._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qwhzmi._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1thipug._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1v9om6g._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1xeczo7._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20503l7._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[externals]_pg_20c820g._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0j0tjwn._.js +0 -3
- /package/dist/{_cloud-attach-WDGM6FL5.js.map → _cloud-attach-XZYF324R.js.map} +0 -0
- /package/dist/{dist-FTKS2GI4.js.map → admin-client-NOZ5CCAH.js.map} +0 -0
- /package/dist/{dist-OO52HARR.js.map → control-plane-2VEM2KCL.js.map} +0 -0
- /package/dist/{dist-U2SVLJUQ.js.map → custody-client-P6XIXHRG.js.map} +0 -0
- /package/dist/{dist-WVYAURMF.js.map → dist-JHMILJUT.js.map} +0 -0
- /package/dist/{dist-Z6L5MM5D.js.map → dist-JOFZOZCY.js.map} +0 -0
- /package/dist/{prepared-state-75DIZ55S-TNJXWMXV.js.map → dist-Q5NY4CF6.js.map} +0 -0
- /package/runtime/hub/apps/hub/.next/static/{PWF2iHQOg9-rRyfqVDLrh → B4bEtdig9I9joQFHDOjX3}/_buildManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{PWF2iHQOg9-rRyfqVDLrh → B4bEtdig9I9joQFHDOjX3}/_clientMiddlewareManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{PWF2iHQOg9-rRyfqVDLrh → B4bEtdig9I9joQFHDOjX3}/_ssgManifest.js +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@agentbox/hub",
|
|
3
3
|
"version": "0.0.0",
|
|
4
4
|
"private": true,
|
|
5
|
-
"description": "AgentBox hub
|
|
5
|
+
"description": "AgentBox hub \u2014 the Web UI + relay core as a Next.js app (localhost, hetzner, or Vercel)",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "next dev",
|
|
@@ -27,15 +27,18 @@
|
|
|
27
27
|
"@agentbox/sandbox-core": "workspace:*",
|
|
28
28
|
"@agentbox/sandbox-daytona": "workspace:*",
|
|
29
29
|
"@agentbox/sandbox-digitalocean": "workspace:*",
|
|
30
|
-
"@agentbox/sandbox-remote-docker": "workspace:*",
|
|
31
30
|
"@agentbox/sandbox-docker": "workspace:*",
|
|
32
31
|
"@agentbox/sandbox-e2b": "workspace:*",
|
|
33
32
|
"@agentbox/sandbox-hetzner": "workspace:*",
|
|
33
|
+
"@agentbox/sandbox-remote-docker": "workspace:*",
|
|
34
34
|
"@agentbox/sandbox-vercel": "workspace:*",
|
|
35
|
+
"@daytona/sdk": "^0.196.0",
|
|
35
36
|
"@radix-ui/react-tooltip": "^1.2.12",
|
|
37
|
+
"@vercel/sandbox": "^2.0.1",
|
|
36
38
|
"better-auth": "^1.6.0",
|
|
37
39
|
"class-variance-authority": "^0.7.1",
|
|
38
40
|
"clsx": "^2.1.1",
|
|
41
|
+
"e2b": "^2.27.1",
|
|
39
42
|
"lucide-react": "^0.577.0",
|
|
40
43
|
"next": "^16.2.7",
|
|
41
44
|
"next-themes": "^0.4.6",
|
|
@@ -1,23 +1,49 @@
|
|
|
1
1
|
import { createRequire as __cr } from 'node:module'; import { fileURLToPath as __f } from 'node:url'; import { dirname as __d } from 'node:path'; const require = __cr(import.meta.url); const __filename = __f(import.meta.url); const __dirname = __d(__filename);
|
|
2
|
+
import {
|
|
3
|
+
hydratePreparedFromCustody
|
|
4
|
+
} from "./chunk-EDRFXO2M.js";
|
|
5
|
+
import {
|
|
6
|
+
hubProfile
|
|
7
|
+
} from "./chunk-SCHQR5KR.js";
|
|
2
8
|
import {
|
|
3
9
|
baseFreshnessFromFingerprints,
|
|
4
10
|
currentCloudBaseFingerprint,
|
|
5
11
|
openWebAppOnVncScreen
|
|
6
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-O3K3ZGFF.js";
|
|
7
13
|
import {
|
|
14
|
+
FsCustodyStore,
|
|
8
15
|
deleteJob,
|
|
9
16
|
enqueuePrepareJob,
|
|
10
17
|
enqueueQueueJob,
|
|
11
18
|
ensureBoxBrowserShowingApp,
|
|
19
|
+
generateRelayToken,
|
|
12
20
|
hashRpcParams,
|
|
13
21
|
isValidBoxStatus,
|
|
14
22
|
listBoxes,
|
|
15
23
|
loadQueue,
|
|
24
|
+
makeStore,
|
|
16
25
|
mintHostInitiatedToken,
|
|
17
26
|
readJob,
|
|
27
|
+
registrationToBoxRecord,
|
|
18
28
|
startRelayDaemon,
|
|
19
29
|
writeQueueLoginCode
|
|
20
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-4LYVBRBC.js";
|
|
31
|
+
import {
|
|
32
|
+
PROVIDER_NAMES,
|
|
33
|
+
findProjectRoot,
|
|
34
|
+
hashProjectPath,
|
|
35
|
+
isProviderKind,
|
|
36
|
+
listProjectsConfigured,
|
|
37
|
+
loadEffectiveConfig,
|
|
38
|
+
providerMeta,
|
|
39
|
+
registerProject,
|
|
40
|
+
resolveDefaultCheckpoint,
|
|
41
|
+
setConfigValue,
|
|
42
|
+
unregisterProject,
|
|
43
|
+
unsetConfigValue
|
|
44
|
+
} from "./chunk-A5Y7LJMU.js";
|
|
45
|
+
import "./chunk-6AVSKCZJ.js";
|
|
46
|
+
import "./chunk-F2JI4GMX.js";
|
|
21
47
|
import "./chunk-3LAHFDJF.js";
|
|
22
48
|
import {
|
|
23
49
|
BOX_WORKSPACE,
|
|
@@ -30,31 +56,17 @@ import {
|
|
|
30
56
|
boxRestartService,
|
|
31
57
|
boxRestartServices,
|
|
32
58
|
boxServicesStatusRaw,
|
|
59
|
+
boxSshDirForProvider,
|
|
60
|
+
matchClaudeInstallFingerprint,
|
|
33
61
|
normalizeLastAgent,
|
|
34
62
|
readPreparedStateRaw,
|
|
35
63
|
readState,
|
|
64
|
+
recordBox,
|
|
36
65
|
secretsEnvPath,
|
|
37
66
|
setBoxDisplayName,
|
|
38
67
|
syncAgentboxSshConfig
|
|
39
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-RMEUA6PA.js";
|
|
40
69
|
import "./chunk-UDZ3VXRF.js";
|
|
41
|
-
import {
|
|
42
|
-
hubProfile
|
|
43
|
-
} from "./chunk-3FJNKSNZ.js";
|
|
44
|
-
import {
|
|
45
|
-
PROVIDER_NAMES,
|
|
46
|
-
findProjectRoot,
|
|
47
|
-
hashProjectPath,
|
|
48
|
-
isProviderKind,
|
|
49
|
-
listProjectsConfigured,
|
|
50
|
-
loadEffectiveConfig,
|
|
51
|
-
providerMeta,
|
|
52
|
-
registerProject,
|
|
53
|
-
resolveDefaultCheckpoint,
|
|
54
|
-
setConfigValue,
|
|
55
|
-
unregisterProject,
|
|
56
|
-
unsetConfigValue
|
|
57
|
-
} from "./chunk-QSMPSV5Z.js";
|
|
58
70
|
import "./chunk-OG4KH2FZ.js";
|
|
59
71
|
|
|
60
72
|
// server.ts
|
|
@@ -65,20 +77,20 @@ import next from "next";
|
|
|
65
77
|
// lib/hub-backend.ts
|
|
66
78
|
import { execFile } from "node:child_process";
|
|
67
79
|
import { readFileSync } from "node:fs";
|
|
68
|
-
import { readdir, stat } from "node:fs/promises";
|
|
80
|
+
import { chmod, mkdir, readdir, stat, writeFile } from "node:fs/promises";
|
|
69
81
|
import os from "node:os";
|
|
70
82
|
import path from "node:path";
|
|
71
83
|
import { promisify } from "node:util";
|
|
72
84
|
var execFileAsync = promisify(execFile);
|
|
73
85
|
var DISPLAY_NAME_MAX = 60;
|
|
74
86
|
var IMPORTERS = {
|
|
75
|
-
docker: () => import("./dist-
|
|
76
|
-
daytona: () => import("./dist-
|
|
77
|
-
hetzner: () => import("./dist-
|
|
78
|
-
vercel: () => import("./dist-
|
|
79
|
-
e2b: () => import("./dist-
|
|
80
|
-
digitalocean: () => import("./dist-
|
|
81
|
-
"remote-docker": () => import("./dist-
|
|
87
|
+
docker: () => import("./dist-2GEAA7QA.js"),
|
|
88
|
+
daytona: () => import("./dist-36O6F6M3.js"),
|
|
89
|
+
hetzner: () => import("./dist-RBBXXGLI.js"),
|
|
90
|
+
vercel: () => import("./dist-RRJN2U5P.js"),
|
|
91
|
+
e2b: () => import("./dist-NYKIT5W5.js"),
|
|
92
|
+
digitalocean: () => import("./dist-IWLEL2TO.js"),
|
|
93
|
+
"remote-docker": () => import("./dist-UWXGDCK4.js")
|
|
82
94
|
};
|
|
83
95
|
var prepareEnqueueChain = /* @__PURE__ */ new Map();
|
|
84
96
|
async function providerForBox(box) {
|
|
@@ -149,6 +161,44 @@ function mapBox(b) {
|
|
|
149
161
|
codexActivity: b.codexActivity
|
|
150
162
|
};
|
|
151
163
|
}
|
|
164
|
+
function registrationProjectKey(reg) {
|
|
165
|
+
const hostFolder = reg.worktrees?.[0]?.hostMainRepo;
|
|
166
|
+
if (hostFolder && hostFolder.startsWith("/")) {
|
|
167
|
+
return { id: hashProjectPath(hostFolder), repo: path.basename(hostFolder) };
|
|
168
|
+
}
|
|
169
|
+
const repo = reg.projectSlug ?? (reg.originUrl ? deriveRepoLabel(reg.originUrl) : reg.name);
|
|
170
|
+
return { id: hashProjectPath(repo), repo };
|
|
171
|
+
}
|
|
172
|
+
function mapRegistrationToBox(reg) {
|
|
173
|
+
const createdAt = Date.parse(reg.createdAt ?? reg.registeredAt) || Date.now();
|
|
174
|
+
const { id: projectId, repo: repoKey } = registrationProjectKey(reg);
|
|
175
|
+
return {
|
|
176
|
+
id: reg.boxId,
|
|
177
|
+
projectId,
|
|
178
|
+
repo: repoKey,
|
|
179
|
+
branch: reg.worktrees?.[0]?.branch ?? "",
|
|
180
|
+
task: reg.name,
|
|
181
|
+
displayName: null,
|
|
182
|
+
agent: normalizeLastAgent(reg.agent) ?? "claude",
|
|
183
|
+
status: "running",
|
|
184
|
+
createdAt,
|
|
185
|
+
lastActivity: createdAt,
|
|
186
|
+
host: `${reg.backend ?? "cloud"} \xB7 registered`,
|
|
187
|
+
provider: reg.backend ?? "cloud",
|
|
188
|
+
commits: null,
|
|
189
|
+
filesTouched: null,
|
|
190
|
+
error: null,
|
|
191
|
+
webUrl: null,
|
|
192
|
+
vncUrl: null,
|
|
193
|
+
state: "running",
|
|
194
|
+
name: reg.name,
|
|
195
|
+
projectIndex: reg.projectIndex
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function deriveRepoLabel(originUrl) {
|
|
199
|
+
const m = /[:/]([^/]+\/[^/]+?)(?:\.git)?\/?$/.exec(originUrl);
|
|
200
|
+
return m?.[1] ?? originUrl;
|
|
201
|
+
}
|
|
152
202
|
async function hostBranchOf(repo) {
|
|
153
203
|
try {
|
|
154
204
|
const { stdout } = await execFileAsync("git", ["-C", repo, "rev-parse", "--abbrev-ref", "HEAD"]);
|
|
@@ -167,6 +217,15 @@ async function computeNeedsSetup(root, provider) {
|
|
|
167
217
|
return false;
|
|
168
218
|
}
|
|
169
219
|
}
|
|
220
|
+
async function readControlPlane() {
|
|
221
|
+
try {
|
|
222
|
+
const cfg = await loadEffectiveConfig(os.homedir());
|
|
223
|
+
const url = (cfg.effective.relay.controlPlaneUrl ?? "").replace(/\/$/, "");
|
|
224
|
+
return url ? { url } : null;
|
|
225
|
+
} catch {
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
170
229
|
async function listProjects(boxes) {
|
|
171
230
|
const boxByRoot = /* @__PURE__ */ new Map();
|
|
172
231
|
for (const b of boxes) {
|
|
@@ -359,12 +418,18 @@ var freshnessCache = /* @__PURE__ */ new Map();
|
|
|
359
418
|
async function providerBaseFreshness(id, claudeInstall) {
|
|
360
419
|
if (id === "docker") {
|
|
361
420
|
try {
|
|
362
|
-
const { evaluateDockerBaseFreshness } = await import("./dist-
|
|
421
|
+
const { evaluateDockerBaseFreshness } = await import("./dist-2GEAA7QA.js");
|
|
363
422
|
return await evaluateDockerBaseFreshness({ claudeInstall });
|
|
364
423
|
} catch {
|
|
365
424
|
return { state: "unknown" };
|
|
366
425
|
}
|
|
367
426
|
}
|
|
427
|
+
try {
|
|
428
|
+
const mod = (await IMPORTERS[id]()).providerModule;
|
|
429
|
+
await hydratePreparedFromCustody(new FsCustodyStore(), id, mod.provider, claudeInstall ?? "native", () => {
|
|
430
|
+
});
|
|
431
|
+
} catch {
|
|
432
|
+
}
|
|
368
433
|
const stored = currentCloudBaseFingerprint(id);
|
|
369
434
|
const cached = freshnessCache.get(id);
|
|
370
435
|
let live;
|
|
@@ -373,13 +438,14 @@ async function providerBaseFreshness(id, claudeInstall) {
|
|
|
373
438
|
} else {
|
|
374
439
|
try {
|
|
375
440
|
const mod = (await IMPORTERS[id]()).providerModule;
|
|
376
|
-
live = await mod.currentBaseFingerprintLive?.(
|
|
441
|
+
live = await mod.currentBaseFingerprintLive?.("native");
|
|
377
442
|
} catch {
|
|
378
443
|
live = void 0;
|
|
379
444
|
}
|
|
380
445
|
freshnessCache.set(id, { at: Date.now(), stored: stored ?? "", live });
|
|
381
446
|
}
|
|
382
|
-
|
|
447
|
+
const bakedWith = stored && live ? matchClaudeInstallFingerprint(stored, live) : null;
|
|
448
|
+
return baseFreshnessFromFingerprints(stored, bakedWith ? stored : live);
|
|
383
449
|
}
|
|
384
450
|
async function listProvidersWithFreshness(base) {
|
|
385
451
|
let claudeInstall = "native";
|
|
@@ -401,7 +467,7 @@ async function listProvidersWithFreshness(base) {
|
|
|
401
467
|
);
|
|
402
468
|
}
|
|
403
469
|
async function loadRemoteDockerHostViews() {
|
|
404
|
-
const rd = await import("./dist-
|
|
470
|
+
const rd = await import("./dist-UWXGDCK4.js");
|
|
405
471
|
const prepared = rd.readPreparedState();
|
|
406
472
|
const cfg = await loadEffectiveConfig(os.homedir());
|
|
407
473
|
const dflt = (cfg.effective.box.remoteDockerHost || "").trim();
|
|
@@ -532,10 +598,63 @@ async function verifyFromBranch(repo, ref) {
|
|
|
532
598
|
const ok = await execFileAsync("git", ["-C", repo, "rev-parse", "--verify", `${ref}^{commit}`]).then(() => true).catch(() => false);
|
|
533
599
|
return ok ? { ok: true } : { ok: false, error: `unknown base ref "${ref}" (not found in the project repo)` };
|
|
534
600
|
}
|
|
535
|
-
async function
|
|
601
|
+
async function materializeBoxSshFromCustody(custody, provider, sandboxId) {
|
|
602
|
+
if (!custody) return;
|
|
603
|
+
const dir = boxSshDirForProvider(provider, sandboxId);
|
|
604
|
+
if (!dir) return;
|
|
605
|
+
const entries = await custody.list(`boxes/${sandboxId}/ssh`).catch(() => []);
|
|
606
|
+
if (entries.length === 0) return;
|
|
607
|
+
await mkdir(dir, { recursive: true, mode: 448 });
|
|
608
|
+
for (const e of entries) {
|
|
609
|
+
const found = await custody.get(e.path).catch(() => null);
|
|
610
|
+
if (!found) continue;
|
|
611
|
+
const out = path.join(dir, path.basename(e.path));
|
|
612
|
+
await writeFile(out, found.data, { mode: 384 });
|
|
613
|
+
await chmod(out, 384);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
async function hydrateRegisteredBox(handle, id) {
|
|
617
|
+
const reg = await handle.store.getBox(id).catch(() => void 0);
|
|
618
|
+
if (!reg) return null;
|
|
619
|
+
const record = registrationToBoxRecord(reg, {
|
|
620
|
+
// The control box IS the control plane; persist its own public URL so the
|
|
621
|
+
// record's topology matches a worker-created box's.
|
|
622
|
+
controlPlaneUrl: process.env.AGENTBOX_HUB_PUBLIC_URL ?? "",
|
|
623
|
+
freshToken: generateRelayToken
|
|
624
|
+
});
|
|
536
625
|
try {
|
|
537
|
-
|
|
538
|
-
|
|
626
|
+
await providerForBox(record);
|
|
627
|
+
} catch {
|
|
628
|
+
return null;
|
|
629
|
+
}
|
|
630
|
+
await materializeBoxSshFromCustody(handle.custody, record.provider ?? "docker", reg.sandboxId ?? id).catch(
|
|
631
|
+
() => {
|
|
632
|
+
}
|
|
633
|
+
);
|
|
634
|
+
await recordBox(record);
|
|
635
|
+
return record;
|
|
636
|
+
}
|
|
637
|
+
async function reapStoreState(handle, id) {
|
|
638
|
+
const reg = await handle.store.getBox(id).catch(() => void 0);
|
|
639
|
+
const existed = await handle.store.forgetBox(id).catch(() => false);
|
|
640
|
+
await handle.store.deleteStatus(id).catch(() => {
|
|
641
|
+
});
|
|
642
|
+
if (handle.custody) {
|
|
643
|
+
const key = reg?.sandboxId ?? id;
|
|
644
|
+
const entries = await handle.custody.list(`boxes/${key}`).catch(() => []);
|
|
645
|
+
for (const e of entries) await handle.custody.delete(e.path).catch(() => false);
|
|
646
|
+
}
|
|
647
|
+
return existed || reg !== void 0;
|
|
648
|
+
}
|
|
649
|
+
async function findOrHydrateBox(id, hydrate) {
|
|
650
|
+
const { boxes } = await readState();
|
|
651
|
+
const local = boxes.find((b) => b.id === id);
|
|
652
|
+
if (local) return local;
|
|
653
|
+
return hydrate ? await hydrate(id) : null;
|
|
654
|
+
}
|
|
655
|
+
async function runLifecycle(id, op, hydrate) {
|
|
656
|
+
try {
|
|
657
|
+
const box = await findOrHydrateBox(id, hydrate);
|
|
539
658
|
if (!box) return { ok: false, error: `box ${id} not found` };
|
|
540
659
|
const provider = await providerForBox(box);
|
|
541
660
|
await op(box, provider);
|
|
@@ -558,9 +677,8 @@ async function hubWriteSshConfig(box, provider) {
|
|
|
558
677
|
console.warn(`[hub] ssh-config write for ${box.name} failed: ${errMsg(err)}`);
|
|
559
678
|
}
|
|
560
679
|
}
|
|
561
|
-
async function resolveBoxProvider(id) {
|
|
562
|
-
const
|
|
563
|
-
const box = boxes.find((b) => b.id === id);
|
|
680
|
+
async function resolveBoxProvider(id, hydrate) {
|
|
681
|
+
const box = await findOrHydrateBox(id, hydrate);
|
|
564
682
|
if (!box) return null;
|
|
565
683
|
return { box, provider: await providerForBox(box) };
|
|
566
684
|
}
|
|
@@ -573,9 +691,9 @@ function hubGitDeps(boxId) {
|
|
|
573
691
|
}
|
|
574
692
|
};
|
|
575
693
|
}
|
|
576
|
-
async function gitOp(id, fn) {
|
|
694
|
+
async function gitOp(id, fn, hydrate) {
|
|
577
695
|
try {
|
|
578
|
-
const rp = await resolveBoxProvider(id);
|
|
696
|
+
const rp = await resolveBoxProvider(id, hydrate);
|
|
579
697
|
if (!rp) return { ok: false, error: `box ${id} not found` };
|
|
580
698
|
const r = await fn(rp.box, rp.provider);
|
|
581
699
|
if (r.exitCode !== 0) {
|
|
@@ -676,12 +794,16 @@ async function probeOpenTargets() {
|
|
|
676
794
|
}
|
|
677
795
|
}
|
|
678
796
|
function createHubBackend(handle) {
|
|
797
|
+
const hydrate = (bid) => hydrateRegisteredBox(handle, bid);
|
|
679
798
|
return {
|
|
680
799
|
// authMode is layered on by source.ts (an env-derived concern), so the host
|
|
681
800
|
// backend produces everything else.
|
|
682
801
|
async getData() {
|
|
683
802
|
const [listed, jobs] = await Promise.all([listBoxes(), loadQueue()]);
|
|
684
803
|
const liveIds = new Set(listed.map((b) => b.id));
|
|
804
|
+
const liveSandboxIds = new Set(
|
|
805
|
+
listed.map((b) => b.cloud?.sandboxId).filter((s) => Boolean(s))
|
|
806
|
+
);
|
|
685
807
|
const jobBoxes = [];
|
|
686
808
|
for (const j of jobs) {
|
|
687
809
|
if (j.kind === "prepare") continue;
|
|
@@ -689,14 +811,34 @@ function createHubBackend(handle) {
|
|
|
689
811
|
if (j.status === "queued" || j.status === "running") jobBoxes.push(mapJobToBox(j, "creating"));
|
|
690
812
|
else if (j.status === "failed") jobBoxes.push(mapJobToBox(j, "error"));
|
|
691
813
|
}
|
|
814
|
+
const registered = (await handle.store.listBoxes().catch(() => [])).filter(
|
|
815
|
+
(r) => !liveIds.has(r.boxId) && !(r.sandboxId && liveSandboxIds.has(r.sandboxId))
|
|
816
|
+
);
|
|
817
|
+
const registeredBoxes = registered.map(mapRegistrationToBox);
|
|
818
|
+
const projects = await listProjects(listed);
|
|
819
|
+
const projectIds = new Set(projects.map((p) => p.id));
|
|
820
|
+
for (const reg of registered) {
|
|
821
|
+
const { id, repo } = registrationProjectKey(reg);
|
|
822
|
+
if (projectIds.has(id)) continue;
|
|
823
|
+
projectIds.add(id);
|
|
824
|
+
projects.push({
|
|
825
|
+
id,
|
|
826
|
+
name: repo,
|
|
827
|
+
repo,
|
|
828
|
+
defaultBranch: reg.worktrees?.[0]?.branch ?? "main",
|
|
829
|
+
provider: reg.backend ?? "cloud",
|
|
830
|
+
createdAt: Date.parse(reg.createdAt ?? reg.registeredAt) || Date.now()
|
|
831
|
+
});
|
|
832
|
+
}
|
|
692
833
|
return {
|
|
693
834
|
user: currentUser(),
|
|
694
835
|
github: LOCAL_GITHUB,
|
|
695
|
-
projects
|
|
696
|
-
boxes: [...jobBoxes, ...listed.map(mapBox)],
|
|
836
|
+
projects,
|
|
837
|
+
boxes: [...jobBoxes, ...listed.map(mapBox), ...registeredBoxes],
|
|
697
838
|
// Block-mode approvals live in-process on the relay handle, not the Store.
|
|
698
839
|
approvals: handle.prompts.all().map(mapApproval),
|
|
699
|
-
providers: listProviders(jobs)
|
|
840
|
+
providers: listProviders(jobs),
|
|
841
|
+
controlPlane: await readControlPlane()
|
|
700
842
|
};
|
|
701
843
|
},
|
|
702
844
|
async providersWithFreshness(opts) {
|
|
@@ -709,13 +851,13 @@ function createHubBackend(handle) {
|
|
|
709
851
|
if (state === "paused") await provider.resume(box);
|
|
710
852
|
else await provider.start(box);
|
|
711
853
|
await hubWriteSshConfig(box, provider);
|
|
712
|
-
}),
|
|
713
|
-
pause: (id) => runLifecycle(id, (box, provider) => provider.pause(box)),
|
|
854
|
+
}, hydrate),
|
|
855
|
+
pause: (id) => runLifecycle(id, (box, provider) => provider.pause(box), hydrate),
|
|
714
856
|
resume: (id) => runLifecycle(id, async (box, provider) => {
|
|
715
857
|
await provider.resume(box);
|
|
716
858
|
await hubWriteSshConfig(box, provider);
|
|
717
|
-
}),
|
|
718
|
-
stop: (id) => runLifecycle(id, (box, provider) => provider.stop(box)),
|
|
859
|
+
}, hydrate),
|
|
860
|
+
stop: (id) => runLifecycle(id, (box, provider) => provider.stop(box), hydrate),
|
|
719
861
|
screen: (id) => runLifecycle(id, async (box, provider) => {
|
|
720
862
|
if ((box.provider ?? "docker") === "docker") {
|
|
721
863
|
const br = await ensureBoxBrowserShowingApp(box);
|
|
@@ -726,7 +868,7 @@ function createHubBackend(handle) {
|
|
|
726
868
|
console.warn(`[hub] screen ${box.name}: in-box browser failed: ${br.reason}`);
|
|
727
869
|
}
|
|
728
870
|
}
|
|
729
|
-
}),
|
|
871
|
+
}, hydrate),
|
|
730
872
|
async destroy(id) {
|
|
731
873
|
if (id.startsWith("job:")) {
|
|
732
874
|
try {
|
|
@@ -742,11 +884,14 @@ function createHubBackend(handle) {
|
|
|
742
884
|
return { ok: false, error: errMsg(err) };
|
|
743
885
|
}
|
|
744
886
|
}
|
|
745
|
-
|
|
887
|
+
const local = await runLifecycle(id, async (box, provider) => {
|
|
746
888
|
await provider.destroy(box);
|
|
747
889
|
await syncAgentboxSshConfig().catch(() => {
|
|
748
890
|
});
|
|
749
|
-
});
|
|
891
|
+
}, hydrate);
|
|
892
|
+
const reaped = await reapStoreState(handle, id);
|
|
893
|
+
if (local.ok) return { ok: true };
|
|
894
|
+
return reaped ? { ok: true } : local;
|
|
750
895
|
},
|
|
751
896
|
async rename(id, displayName) {
|
|
752
897
|
try {
|
|
@@ -782,7 +927,7 @@ function createHubBackend(handle) {
|
|
|
782
927
|
const hostSpec = provider.match(/^(?:docker|remote-docker):(.+)$/);
|
|
783
928
|
if (hostSpec) {
|
|
784
929
|
const alias = hostSpec[1];
|
|
785
|
-
const rd = await import("./dist-
|
|
930
|
+
const rd = await import("./dist-UWXGDCK4.js");
|
|
786
931
|
if (!rd.getHostAlias(alias)) {
|
|
787
932
|
return { ok: false, error: `unknown remote-docker host '${alias}' \u2014 add it in Settings` };
|
|
788
933
|
}
|
|
@@ -918,14 +1063,14 @@ function createHubBackend(handle) {
|
|
|
918
1063
|
return { ok: true };
|
|
919
1064
|
},
|
|
920
1065
|
// ── box git operations (delegate to the shared, provider-agnostic helpers) ──
|
|
921
|
-
gitCheckout: (id, branch) => gitOp(id, (box, provider) => boxGitCheckout(provider, box, branch)),
|
|
922
|
-
gitNewBranch: (id, input) => gitOp(id, (box, provider) => boxGitNewBranch(provider, box, input.name, input.from)),
|
|
923
|
-
gitPush: (id, input = {}) => gitOp(id, (box, provider) => boxGitPush(provider, box, input, hubGitDeps(id))),
|
|
924
|
-
gitPull: (id, input = {}) => gitOp(id, (box, provider) => boxGitPull(provider, box, input, hubGitDeps(id))),
|
|
925
|
-
gitPushHost: (id, input = {}) => gitOp(id, (box, provider) => boxGitPushHost(provider, box, input)),
|
|
1066
|
+
gitCheckout: (id, branch) => gitOp(id, (box, provider) => boxGitCheckout(provider, box, branch), hydrate),
|
|
1067
|
+
gitNewBranch: (id, input) => gitOp(id, (box, provider) => boxGitNewBranch(provider, box, input.name, input.from), hydrate),
|
|
1068
|
+
gitPush: (id, input = {}) => gitOp(id, (box, provider) => boxGitPush(provider, box, input, hubGitDeps(id)), hydrate),
|
|
1069
|
+
gitPull: (id, input = {}) => gitOp(id, (box, provider) => boxGitPull(provider, box, input, hubGitDeps(id)), hydrate),
|
|
1070
|
+
gitPushHost: (id, input = {}) => gitOp(id, (box, provider) => boxGitPushHost(provider, box, input), hydrate),
|
|
926
1071
|
async getGit(id) {
|
|
927
1072
|
try {
|
|
928
|
-
const rp = await resolveBoxProvider(id);
|
|
1073
|
+
const rp = await resolveBoxProvider(id, hydrate);
|
|
929
1074
|
if (!rp) return { ok: false, error: `box ${id} not found` };
|
|
930
1075
|
const r = await rp.provider.exec(rp.box, ["git", "status", "--porcelain=v2", "--branch"], {
|
|
931
1076
|
cwd: BOX_WORKSPACE
|
|
@@ -938,7 +1083,7 @@ function createHubBackend(handle) {
|
|
|
938
1083
|
},
|
|
939
1084
|
// ── box service control ──
|
|
940
1085
|
async getServices(id) {
|
|
941
|
-
const rp = await resolveBoxProvider(id).catch(() => null);
|
|
1086
|
+
const rp = await resolveBoxProvider(id, hydrate).catch(() => null);
|
|
942
1087
|
if (!rp) return { source: "unavailable", services: [], tasks: [], ports: [], error: `box ${id} not found` };
|
|
943
1088
|
const live = await liveServices(rp.provider, rp.box);
|
|
944
1089
|
if (live) return mapLiveServices(live);
|
|
@@ -948,7 +1093,7 @@ function createHubBackend(handle) {
|
|
|
948
1093
|
},
|
|
949
1094
|
async restartService(id, name) {
|
|
950
1095
|
try {
|
|
951
|
-
const rp = await resolveBoxProvider(id);
|
|
1096
|
+
const rp = await resolveBoxProvider(id, hydrate);
|
|
952
1097
|
if (!rp) return { ok: false, error: `box ${id} not found` };
|
|
953
1098
|
if (name) {
|
|
954
1099
|
const r = await boxRestartService(rp.provider, rp.box, name);
|
|
@@ -989,7 +1134,7 @@ function createHubBackend(handle) {
|
|
|
989
1134
|
},
|
|
990
1135
|
async addRemoteDockerHost(alias, ssh, opts) {
|
|
991
1136
|
try {
|
|
992
|
-
const rd = await import("./dist-
|
|
1137
|
+
const rd = await import("./dist-UWXGDCK4.js");
|
|
993
1138
|
const trimmedSsh = ssh.trim();
|
|
994
1139
|
if (!rd.isValidAlias(alias)) {
|
|
995
1140
|
return {
|
|
@@ -1014,7 +1159,7 @@ function createHubBackend(handle) {
|
|
|
1014
1159
|
},
|
|
1015
1160
|
async removeRemoteDockerHost(alias) {
|
|
1016
1161
|
try {
|
|
1017
|
-
const rd = await import("./dist-
|
|
1162
|
+
const rd = await import("./dist-UWXGDCK4.js");
|
|
1018
1163
|
rd.removeHostAlias(alias);
|
|
1019
1164
|
rd.removePreparedHost(alias);
|
|
1020
1165
|
const cfg = await loadEffectiveConfig(os.homedir());
|
|
@@ -1032,7 +1177,7 @@ function createHubBackend(handle) {
|
|
|
1032
1177
|
},
|
|
1033
1178
|
async bakeRemoteDockerHost(alias) {
|
|
1034
1179
|
try {
|
|
1035
|
-
const rd = await import("./dist-
|
|
1180
|
+
const rd = await import("./dist-UWXGDCK4.js");
|
|
1036
1181
|
if (!rd.getHostAlias(alias)) return { ok: false, error: `no such host alias ${alias}` };
|
|
1037
1182
|
const spec = `docker:${alias}`;
|
|
1038
1183
|
const existing = (await loadQueue()).find(
|
|
@@ -1055,10 +1200,22 @@ var port = Number.parseInt(process.env.AGENTBOX_HUB_PORT ?? "8787", 10);
|
|
|
1055
1200
|
var host = process.env.AGENTBOX_HUB_HOST ?? "127.0.0.1";
|
|
1056
1201
|
process.env.AGENTBOX_HUB_PROFILE ??= host === "127.0.0.1" ? "localhost" : "hetzner";
|
|
1057
1202
|
if (host !== "127.0.0.1") process.env.AGENTBOX_HUB_AUTH ??= "on";
|
|
1203
|
+
async function resolveStore(storeDbPath) {
|
|
1204
|
+
const spec = process.env.RELAY_STORE_URL ?? process.env.POSTGRES_URL ?? (process.env.AGENTBOX_HUB_PROFILE === "hetzner" ? `sqlite:${storeDbPath}` : void 0);
|
|
1205
|
+
if (!spec) return void 0;
|
|
1206
|
+
const store = makeStore(spec);
|
|
1207
|
+
await store.migrate?.();
|
|
1208
|
+
return store;
|
|
1209
|
+
}
|
|
1210
|
+
function positiveIntFromEnv(raw) {
|
|
1211
|
+
if (!raw) return void 0;
|
|
1212
|
+
const n = Number.parseInt(raw, 10);
|
|
1213
|
+
return Number.isFinite(n) && n > 0 ? n : void 0;
|
|
1214
|
+
}
|
|
1058
1215
|
async function main() {
|
|
1059
|
-
const { authMode } = await import("./auth-config-
|
|
1216
|
+
const { authMode, STORE_DB_PATH } = await import("./auth-config-WJHIMGUE.js");
|
|
1060
1217
|
if (process.env.AGENTBOX_HUB_PROFILE === "localhost" && process.env.AGENTBOX_HUB_AUTH !== "off") {
|
|
1061
|
-
const { ensureHubToken } = await import("./hub-token-
|
|
1218
|
+
const { ensureHubToken } = await import("./hub-token-6USIMBPQ.js");
|
|
1062
1219
|
process.env.AGENTBOX_HUB_TOKEN = await ensureHubToken();
|
|
1063
1220
|
}
|
|
1064
1221
|
const dir = import.meta.dirname;
|
|
@@ -1073,9 +1230,21 @@ async function main() {
|
|
|
1073
1230
|
const app = next({ dev, dir, hostname: host, port });
|
|
1074
1231
|
await app.prepare();
|
|
1075
1232
|
const handle = app.getRequestHandler();
|
|
1233
|
+
const store = await resolveStore(STORE_DB_PATH);
|
|
1234
|
+
const adminToken = process.env.AGENTBOX_RELAY_ADMIN_TOKEN ?? "";
|
|
1235
|
+
const custody = adminToken.length > 0 ? new FsCustodyStore() : void 0;
|
|
1076
1236
|
const daemon = await startRelayDaemon({
|
|
1077
1237
|
port,
|
|
1078
1238
|
host,
|
|
1239
|
+
// Omitted → the relay builds its in-memory store (the localhost default).
|
|
1240
|
+
store,
|
|
1241
|
+
custody,
|
|
1242
|
+
adminToken,
|
|
1243
|
+
// Custody carries project seed tars, which dwarf the relay's 1 MiB
|
|
1244
|
+
// control-plane body cap. Env-tunable so a control box with unusually large
|
|
1245
|
+
// untracked seeds can be raised without a rebuild (`relay.custodyMaxBodyBytes`
|
|
1246
|
+
// is the PC-side spelling; the hub reads its own env).
|
|
1247
|
+
custodyMaxBodyBytes: positiveIntFromEnv(process.env.AGENTBOX_CUSTODY_MAX_BODY_BYTES),
|
|
1079
1248
|
logger: (line) => process.stdout.write(`agentbox-hub: ${line}
|
|
1080
1249
|
`),
|
|
1081
1250
|
// Next parses req.url itself when parsedUrl is omitted.
|
|
@@ -1088,10 +1257,22 @@ async function main() {
|
|
|
1088
1257
|
globalThis.__AGENTBOX_HUB_NOTIFIER = daemon.handle.hubNotifier;
|
|
1089
1258
|
const mode = authMode();
|
|
1090
1259
|
if (mode === "password") {
|
|
1091
|
-
const { ensureAuthReady } = await import("./auth-
|
|
1260
|
+
const { ensureAuthReady } = await import("./auth-IRNNO3IK.js");
|
|
1092
1261
|
await ensureAuthReady();
|
|
1093
1262
|
process.stdout.write("agentbox-hub: auth ready\n");
|
|
1094
1263
|
}
|
|
1264
|
+
let worker;
|
|
1265
|
+
if (process.env.AGENTBOX_HUB_WORKER === "on") {
|
|
1266
|
+
const { startHubWorker } = await import("./hub-worker-SOFWVTWU.js");
|
|
1267
|
+
worker = startHubWorker({
|
|
1268
|
+
store: daemon.handle.store,
|
|
1269
|
+
log: (line) => process.stdout.write(`agentbox-hub-worker: ${line}
|
|
1270
|
+
`),
|
|
1271
|
+
publicUrl: process.env.AGENTBOX_HUB_PUBLIC_URL,
|
|
1272
|
+
adminCidr: process.env.AGENTBOX_HUB_ADMIN_CIDR,
|
|
1273
|
+
mockCreate: process.env.AGENTBOX_HUB_WORKER_MOCK === "1"
|
|
1274
|
+
});
|
|
1275
|
+
}
|
|
1095
1276
|
process.stdout.write(`agentbox-hub: listening on ${host}:${String(port)} (dev=${String(dev)})
|
|
1096
1277
|
`);
|
|
1097
1278
|
if (mode === "token") {
|
|
@@ -1101,7 +1282,7 @@ async function main() {
|
|
|
1101
1282
|
const shutdown = (signal) => {
|
|
1102
1283
|
process.stdout.write(`agentbox-hub: ${signal} \u2014 shutting down
|
|
1103
1284
|
`);
|
|
1104
|
-
daemon.stop().finally(() => process.exit(0));
|
|
1285
|
+
void (worker?.stop() ?? Promise.resolve()).finally(() => daemon.stop().finally(() => process.exit(0)));
|
|
1105
1286
|
};
|
|
1106
1287
|
process.on("SIGTERM", () => shutdown("SIGTERM"));
|
|
1107
1288
|
process.on("SIGINT", () => shutdown("SIGINT"));
|