@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
|
@@ -12,11 +12,18 @@ import {
|
|
|
12
12
|
} from "./chunk-CKBHQ7OI.js";
|
|
13
13
|
import {
|
|
14
14
|
createCloudProvider
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-O3K3ZGFF.js";
|
|
16
16
|
import {
|
|
17
17
|
detectPortless,
|
|
18
|
-
portlessDoctorRow
|
|
19
|
-
|
|
18
|
+
portlessDoctorRow,
|
|
19
|
+
portlessServiceStatus
|
|
20
|
+
} from "./chunk-4LYVBRBC.js";
|
|
21
|
+
import {
|
|
22
|
+
loadEffectiveConfig,
|
|
23
|
+
mergeConfigYaml
|
|
24
|
+
} from "./chunk-A5Y7LJMU.js";
|
|
25
|
+
import "./chunk-6AVSKCZJ.js";
|
|
26
|
+
import "./chunk-F2JI4GMX.js";
|
|
20
27
|
import "./chunk-3LAHFDJF.js";
|
|
21
28
|
import {
|
|
22
29
|
SshTunnelManager,
|
|
@@ -33,6 +40,7 @@ import {
|
|
|
33
40
|
readCliStamp,
|
|
34
41
|
readPreparedStateRaw,
|
|
35
42
|
resolveInboundSources,
|
|
43
|
+
resolveStagedRuntimeRoot,
|
|
36
44
|
scpDownload,
|
|
37
45
|
scpUpload,
|
|
38
46
|
sshExec,
|
|
@@ -44,14 +52,13 @@ import {
|
|
|
44
52
|
waitForSsh,
|
|
45
53
|
writeManagedSecrets,
|
|
46
54
|
writePreparedStateRaw
|
|
47
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-RMEUA6PA.js";
|
|
48
56
|
import {
|
|
49
57
|
execa
|
|
50
58
|
} from "./chunk-UDZ3VXRF.js";
|
|
51
|
-
import "./chunk-QSMPSV5Z.js";
|
|
52
59
|
import "./chunk-OG4KH2FZ.js";
|
|
53
60
|
|
|
54
|
-
// ../../packages/sandbox-hetzner/dist/chunk-
|
|
61
|
+
// ../../packages/sandbox-hetzner/dist/chunk-AJZON3SG.js
|
|
55
62
|
import { existsSync, readFileSync } from "fs";
|
|
56
63
|
import { homedir } from "os";
|
|
57
64
|
import { resolve } from "path";
|
|
@@ -601,7 +608,7 @@ function controlPlaneInboundRules(hostCidr) {
|
|
|
601
608
|
}
|
|
602
609
|
async function createPerBoxFirewall(client2, opts) {
|
|
603
610
|
return withHetznerRetry(
|
|
604
|
-
{ method: "createFirewall", retryOnAmbiguous:
|
|
611
|
+
{ method: "createFirewall", retryOnAmbiguous: true, attemptTimeoutMs: 6e4 },
|
|
605
612
|
() => client2.createFirewall({
|
|
606
613
|
name: opts.name,
|
|
607
614
|
rules: sshOnlyInboundRule(opts.sources),
|
|
@@ -656,16 +663,7 @@ function normalizeSourceCidr(raw) {
|
|
|
656
663
|
}
|
|
657
664
|
var SELF = dirname(fileURLToPath(import.meta.url));
|
|
658
665
|
function findStagedCliRuntimeRoot() {
|
|
659
|
-
|
|
660
|
-
resolve3(SELF, "..", "runtime"),
|
|
661
|
-
// <cliRoot>/dist/.. → <cliRoot> then /runtime
|
|
662
|
-
resolve3(SELF, "..", "..", "runtime")
|
|
663
|
-
// chunk-NNNN.js at <cliRoot>/dist/<sub>/.. → <cliRoot>/runtime
|
|
664
|
-
];
|
|
665
|
-
for (const c of candidates) {
|
|
666
|
-
if (existsSync2(resolve3(c, "hetzner", "scripts", "install-box.sh"))) return c;
|
|
667
|
-
}
|
|
668
|
-
return void 0;
|
|
666
|
+
return resolveStagedRuntimeRoot(SELF, "hetzner/scripts/install-box.sh");
|
|
669
667
|
}
|
|
670
668
|
var RUNTIME_ASSETS = [
|
|
671
669
|
{ name: "install-box.sh", remoteBasename: "agentbox-install.sh", remoteMode: 493 },
|
|
@@ -820,7 +818,7 @@ import { join as join2 } from "path";
|
|
|
820
818
|
import { resolve as resolvePath } from "path";
|
|
821
819
|
import { join } from "path";
|
|
822
820
|
import { dirname as dirname2, resolve as resolve4 } from "path";
|
|
823
|
-
import { mkdir as mkdir2, rm as rm2, writeFile } from "fs/promises";
|
|
821
|
+
import { readFile, mkdir as mkdir2, rm as rm2, writeFile } from "fs/promises";
|
|
824
822
|
import { homedir as homedir3, tmpdir } from "os";
|
|
825
823
|
import { join as join3 } from "path";
|
|
826
824
|
function generatePrepareCloudInit(opts) {
|
|
@@ -856,7 +854,7 @@ function controlPlaneCloudInit(opts) {
|
|
|
856
854
|
const pubkey = opts.sshPubkey.trim();
|
|
857
855
|
return [
|
|
858
856
|
"#cloud-config",
|
|
859
|
-
"# AgentBox control-plane VPS \u2014 provisioned by `agentbox
|
|
857
|
+
"# AgentBox control-plane VPS \u2014 provisioned by `agentbox hub setup --deploy hetzner`.",
|
|
860
858
|
"disable_root: false",
|
|
861
859
|
"ssh_pwauth: false",
|
|
862
860
|
"chpasswd:",
|
|
@@ -1422,6 +1420,7 @@ async function ensureTunnel(sandboxId, state, vpsIp) {
|
|
|
1422
1420
|
await tunnels.open({
|
|
1423
1421
|
boxId: sandboxId,
|
|
1424
1422
|
vpsHost: vpsIp,
|
|
1423
|
+
vpsUser: VPS_USER,
|
|
1425
1424
|
identity: state.identity
|
|
1426
1425
|
});
|
|
1427
1426
|
} catch (err) {
|
|
@@ -1477,6 +1476,12 @@ var hetznerBackend = {
|
|
|
1477
1476
|
const egressOverride = req.env?.AGENTBOX_HETZNER_FIREWALL_SOURCE ?? process.env.AGENTBOX_HETZNER_FIREWALL_SOURCE;
|
|
1478
1477
|
const hostEgress = inboundPolicy.mode === "open" ? null : egressOverride ? normalizeSourceCidr(egressOverride) : `${await detectEgressIp({ onLog })}/32`;
|
|
1479
1478
|
const sources = resolveInboundSources(inboundPolicy, hostEgress);
|
|
1479
|
+
if (inboundPolicy.mode !== "open" && req.extraInboundCidrs && req.extraInboundCidrs.length > 0) {
|
|
1480
|
+
for (const cidr of req.extraInboundCidrs) {
|
|
1481
|
+
const normalized = normalizeSourceCidr(cidr);
|
|
1482
|
+
if (!sources.includes(normalized)) sources.push(normalized);
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1480
1485
|
progress(`firewall inbound: ${describeInbound(inboundPolicy)} -> ${sources.join(", ")}`);
|
|
1481
1486
|
const stamp = Date.now().toString(36) + "-" + Math.random().toString(36).slice(2, 8);
|
|
1482
1487
|
const tempDir = resolvePath(
|
|
@@ -1556,6 +1561,7 @@ var hetznerBackend = {
|
|
|
1556
1561
|
return {
|
|
1557
1562
|
sandboxId,
|
|
1558
1563
|
inbound: inboundPolicy,
|
|
1564
|
+
publicHost: vpsIp,
|
|
1559
1565
|
resources: {
|
|
1560
1566
|
cpu: provisioned.cores,
|
|
1561
1567
|
memory: provisioned.memory,
|
|
@@ -1594,7 +1600,7 @@ var hetznerBackend = {
|
|
|
1594
1600
|
const id = Number.parseInt(sandboxId, 10);
|
|
1595
1601
|
if (!Number.isFinite(id)) return null;
|
|
1596
1602
|
const server = await client().getServer(id);
|
|
1597
|
-
return server ? { sandboxId } : null;
|
|
1603
|
+
return server ? { sandboxId, publicHost: server.public_net.ipv4?.ip } : null;
|
|
1598
1604
|
},
|
|
1599
1605
|
async list() {
|
|
1600
1606
|
const servers = await client().listServers({ label_selector: "agentbox.managed=true" });
|
|
@@ -1862,16 +1868,83 @@ async function doctorChecks() {
|
|
|
1862
1868
|
detail: "not baked",
|
|
1863
1869
|
hint: "`agentbox prepare --provider hetzner`"
|
|
1864
1870
|
};
|
|
1865
|
-
const portlessRes = portlessDoctorRow(await detectPortless());
|
|
1871
|
+
const portlessRes = portlessDoctorRow(await detectPortless(), await portlessServiceStatus());
|
|
1866
1872
|
return [credRes, snapRes, portlessRes];
|
|
1867
1873
|
} catch (err) {
|
|
1868
1874
|
return [{ label: "credentials", status: "warn", detail: errSummary(err) }];
|
|
1869
1875
|
}
|
|
1870
1876
|
}
|
|
1871
1877
|
var REMOTE_APP_DIR = "/opt/agentbox/apps/hub";
|
|
1878
|
+
var REMOTE_DATA_DIR = "/opt/agentbox/hub-data";
|
|
1879
|
+
var PROVIDER_SECRET_KEYS = [
|
|
1880
|
+
"HCLOUD_TOKEN",
|
|
1881
|
+
"HCLOUD_ENDPOINT",
|
|
1882
|
+
"E2B_API_KEY",
|
|
1883
|
+
"E2B_DOMAIN",
|
|
1884
|
+
"DAYTONA_API_KEY",
|
|
1885
|
+
"DAYTONA_JWT_TOKEN",
|
|
1886
|
+
"DAYTONA_ORGANIZATION_ID",
|
|
1887
|
+
"DAYTONA_API_URL",
|
|
1888
|
+
"DAYTONA_TARGET",
|
|
1889
|
+
// Vercel: only the ACCESS-TOKEN keys travel. A CLI-login setup keeps the token
|
|
1890
|
+
// in the Vercel CLI store (not secrets.env) and marks it with
|
|
1891
|
+
// VERCEL_AUTH_SOURCE — deliberately NOT copied, since there's no vercel CLI on
|
|
1892
|
+
// the control box, so copying the marker without a token would falsely show
|
|
1893
|
+
// "configured" and then fail at create time. Set a VERCEL_TOKEN (or use the hub
|
|
1894
|
+
// Settings form) to run vercel from the control box.
|
|
1895
|
+
"VERCEL_TOKEN",
|
|
1896
|
+
"VERCEL_OIDC_TOKEN",
|
|
1897
|
+
"VERCEL_TEAM_ID",
|
|
1898
|
+
"VERCEL_PROJECT_ID",
|
|
1899
|
+
"DIGITALOCEAN_TOKEN",
|
|
1900
|
+
"DIGITALOCEAN_API_URL"
|
|
1901
|
+
];
|
|
1902
|
+
function filterProviderSecrets(body) {
|
|
1903
|
+
const allow = new Set(PROVIDER_SECRET_KEYS);
|
|
1904
|
+
const out = [];
|
|
1905
|
+
for (const line of body.split(/\r?\n/)) {
|
|
1906
|
+
const stripped = line.startsWith("export ") ? line.slice("export ".length) : line;
|
|
1907
|
+
const eq = stripped.indexOf("=");
|
|
1908
|
+
if (eq <= 0) continue;
|
|
1909
|
+
const key = stripped.slice(0, eq).trim();
|
|
1910
|
+
if (allow.has(key)) out.push(`${key}=${stripped.slice(eq + 1)}`);
|
|
1911
|
+
}
|
|
1912
|
+
return out.length > 0 ? out.join("\n") + "\n" : "";
|
|
1913
|
+
}
|
|
1914
|
+
var MIGRATED_CONFIG_KEYS = ["box.claudeInstall"];
|
|
1915
|
+
function buildControlPlaneConfigYaml(remoteBody, values) {
|
|
1916
|
+
let body = remoteBody;
|
|
1917
|
+
let changed = false;
|
|
1918
|
+
for (const key of MIGRATED_CONFIG_KEYS) {
|
|
1919
|
+
const value = values[key];
|
|
1920
|
+
if (value === void 0) continue;
|
|
1921
|
+
body = mergeConfigYaml(body, key, value);
|
|
1922
|
+
changed = true;
|
|
1923
|
+
}
|
|
1924
|
+
return changed ? body : null;
|
|
1925
|
+
}
|
|
1926
|
+
async function collectMigratedConfig() {
|
|
1927
|
+
try {
|
|
1928
|
+
const cfg = await loadEffectiveConfig(homedir3());
|
|
1929
|
+
const out = {};
|
|
1930
|
+
if (cfg.effective.box.claudeInstall === "npm") out["box.claudeInstall"] = "npm";
|
|
1931
|
+
return out;
|
|
1932
|
+
} catch {
|
|
1933
|
+
return {};
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
async function collectProviderSecrets() {
|
|
1937
|
+
let body = "";
|
|
1938
|
+
try {
|
|
1939
|
+
body = await readFile(join3(homedir3(), ".agentbox", "secrets.env"), "utf8");
|
|
1940
|
+
} catch {
|
|
1941
|
+
return "";
|
|
1942
|
+
}
|
|
1943
|
+
return filterProviderSecrets(body);
|
|
1944
|
+
}
|
|
1872
1945
|
function caddyfile(domain) {
|
|
1873
1946
|
return `${domain} {
|
|
1874
|
-
reverse_proxy app:
|
|
1947
|
+
reverse_proxy app:8787
|
|
1875
1948
|
}
|
|
1876
1949
|
`;
|
|
1877
1950
|
}
|
|
@@ -1930,7 +2003,7 @@ async function deployControlPlaneToHetzner(opts) {
|
|
|
1930
2003
|
const hostCidr = normalizeSourceCidr(await detectEgressIp());
|
|
1931
2004
|
log("creating the control-plane firewall (:22 host-only, :80/:443 open)\u2026");
|
|
1932
2005
|
const firewall = await withHetznerRetry(
|
|
1933
|
-
{ method: "createFirewall", retryOnAmbiguous:
|
|
2006
|
+
{ method: "createFirewall", retryOnAmbiguous: true, attemptTimeoutMs: 6e4 },
|
|
1934
2007
|
() => client2.createFirewall({
|
|
1935
2008
|
name,
|
|
1936
2009
|
rules: controlPlaneInboundRules(hostCidr),
|
|
@@ -1968,19 +2041,49 @@ async function deployControlPlaneToHetzner(opts) {
|
|
|
1968
2041
|
if (cloned.exitCode !== 0) {
|
|
1969
2042
|
throw new Error("repo clone did not complete on the VPS (cloud-init failed)");
|
|
1970
2043
|
}
|
|
2044
|
+
const hubEnvExtra = `AGENTBOX_HUB_DATA_DIR=${REMOTE_DATA_DIR}
|
|
2045
|
+
AGENTBOX_HUB_PUBLIC_URL=${url}
|
|
2046
|
+
AGENTBOX_HUB_ADMIN_CIDR=${hostCidr}
|
|
2047
|
+
`;
|
|
2048
|
+
const providerSecrets = await collectProviderSecrets();
|
|
2049
|
+
if (!providerSecrets) {
|
|
2050
|
+
log("warning: no provider credentials found in ~/.agentbox/secrets.env \u2014 the worker can only create boxes for providers whose creds you push later");
|
|
2051
|
+
}
|
|
1971
2052
|
const staging = join3(tmpdir(), `agentbox-cp-deploy-${stamp}`);
|
|
1972
2053
|
await mkdir2(staging, { recursive: true });
|
|
1973
2054
|
try {
|
|
1974
2055
|
const envLocal = join3(staging, "control-plane.env");
|
|
1975
2056
|
const caddyLocal = join3(staging, "Caddyfile");
|
|
1976
2057
|
const composeLocal = join3(staging, "docker-compose.caddy.yml");
|
|
1977
|
-
|
|
2058
|
+
const secretsLocal = join3(staging, "secrets.env");
|
|
2059
|
+
await writeFile(envLocal, opts.envContent + hubEnvExtra, { mode: 384 });
|
|
1978
2060
|
await writeFile(caddyLocal, caddyfile(domain));
|
|
1979
2061
|
await writeFile(composeLocal, CADDY_COMPOSE);
|
|
1980
|
-
|
|
2062
|
+
await writeFile(secretsLocal, providerSecrets, { mode: 384 });
|
|
2063
|
+
log("creating the persistent data dir on the VPS\u2026");
|
|
2064
|
+
await sshExec(target, `mkdir -p ${REMOTE_DATA_DIR} && chmod 700 ${REMOTE_DATA_DIR}`);
|
|
2065
|
+
log("uploading env + provider secrets + Caddy config\u2026");
|
|
1981
2066
|
await scpUpload(target, envLocal, `${REMOTE_APP_DIR}/.env`);
|
|
1982
2067
|
await scpUpload(target, caddyLocal, `${REMOTE_APP_DIR}/Caddyfile`);
|
|
1983
2068
|
await scpUpload(target, composeLocal, `${REMOTE_APP_DIR}/docker-compose.caddy.yml`);
|
|
2069
|
+
await scpUpload(target, secretsLocal, `${REMOTE_DATA_DIR}/secrets.env`);
|
|
2070
|
+
const migrated = await collectMigratedConfig();
|
|
2071
|
+
if (Object.keys(migrated).length > 0) {
|
|
2072
|
+
const remoteCfg = await sshExec(
|
|
2073
|
+
target,
|
|
2074
|
+
`cat ${REMOTE_DATA_DIR}/config.yaml 2>/dev/null || true`
|
|
2075
|
+
);
|
|
2076
|
+
const merged = buildControlPlaneConfigYaml(
|
|
2077
|
+
remoteCfg.exitCode === 0 ? remoteCfg.stdout : "",
|
|
2078
|
+
migrated
|
|
2079
|
+
);
|
|
2080
|
+
if (merged) {
|
|
2081
|
+
const cfgLocal = join3(staging, "config.yaml");
|
|
2082
|
+
await writeFile(cfgLocal, merged, { mode: 384 });
|
|
2083
|
+
log(`migrating config to the control box: ${Object.keys(migrated).join(", ")}`);
|
|
2084
|
+
await scpUpload(target, cfgLocal, `${REMOTE_DATA_DIR}/config.yaml`);
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
1984
2087
|
} finally {
|
|
1985
2088
|
await rm2(staging, { recursive: true, force: true });
|
|
1986
2089
|
}
|
|
@@ -2011,7 +2114,7 @@ var cloudProvider = createCloudProvider(hetznerBackend, {
|
|
|
2011
2114
|
var hetznerProvider = {
|
|
2012
2115
|
...cloudProvider,
|
|
2013
2116
|
prepare: prepareHetznerProvider,
|
|
2014
|
-
baseFingerprint: () => currentHetznerBaseFingerprintLive()
|
|
2117
|
+
baseFingerprint: (claudeInstall) => currentHetznerBaseFingerprintLive(claudeInstall)
|
|
2015
2118
|
};
|
|
2016
2119
|
var providerModule = {
|
|
2017
2120
|
provider: hetznerProvider,
|
|
@@ -21,8 +21,11 @@ import {
|
|
|
21
21
|
renderInnerCommand,
|
|
22
22
|
resolveCloudCheckpoint,
|
|
23
23
|
writeCloudCheckpointManifest
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-O3K3ZGFF.js";
|
|
25
|
+
import "./chunk-4LYVBRBC.js";
|
|
26
|
+
import "./chunk-A5Y7LJMU.js";
|
|
27
|
+
import "./chunk-6AVSKCZJ.js";
|
|
28
|
+
import "./chunk-F2JI4GMX.js";
|
|
26
29
|
import "./chunk-3LAHFDJF.js";
|
|
27
30
|
import {
|
|
28
31
|
UserFacingError,
|
|
@@ -34,19 +37,19 @@ import {
|
|
|
34
37
|
readCliStamp,
|
|
35
38
|
readPreparedStateRaw,
|
|
36
39
|
recordBox,
|
|
40
|
+
resolveStagedRuntimeRoot,
|
|
37
41
|
stageClaudeStaticForUpload,
|
|
38
42
|
stageCodexStaticForUpload,
|
|
39
43
|
stageOpencodeStaticForUpload,
|
|
40
44
|
writeManagedSecrets,
|
|
41
45
|
writePreparedStateRaw
|
|
42
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-RMEUA6PA.js";
|
|
43
47
|
import {
|
|
44
48
|
execa
|
|
45
49
|
} from "./chunk-UDZ3VXRF.js";
|
|
46
|
-
import "./chunk-QSMPSV5Z.js";
|
|
47
50
|
import "./chunk-OG4KH2FZ.js";
|
|
48
51
|
|
|
49
|
-
// ../../packages/sandbox-vercel/dist/chunk-
|
|
52
|
+
// ../../packages/sandbox-vercel/dist/chunk-VWSRV5RR.js
|
|
50
53
|
import { existsSync, readFileSync } from "fs";
|
|
51
54
|
import { homedir } from "os";
|
|
52
55
|
import { resolve } from "path";
|
|
@@ -771,14 +774,7 @@ function maskKey(value) {
|
|
|
771
774
|
}
|
|
772
775
|
var SELF = dirname(fileURLToPath(import.meta.url));
|
|
773
776
|
function findStagedCliRuntimeRoot() {
|
|
774
|
-
|
|
775
|
-
resolve3(SELF, "..", "runtime"),
|
|
776
|
-
resolve3(SELF, "..", "..", "runtime")
|
|
777
|
-
];
|
|
778
|
-
for (const c of candidates) {
|
|
779
|
-
if (existsSync3(resolve3(c, "vercel", "scripts", "provision.sh"))) return c;
|
|
780
|
-
}
|
|
781
|
-
return void 0;
|
|
777
|
+
return resolveStagedRuntimeRoot(SELF, "vercel/scripts/provision.sh");
|
|
782
778
|
}
|
|
783
779
|
var RUNTIME_ASSETS = [
|
|
784
780
|
{ name: "provision.sh", remotePath: "/tmp/agentbox-provision.sh", remoteMode: 493 },
|
|
@@ -1621,7 +1617,7 @@ var vercelProvider = {
|
|
|
1621
1617
|
prepare: prepareVercelProvider,
|
|
1622
1618
|
buildAttach: buildVercelAttach,
|
|
1623
1619
|
checkpoint: vercelCheckpoint,
|
|
1624
|
-
baseFingerprint: () => currentVercelBaseFingerprintLive()
|
|
1620
|
+
baseFingerprint: (claudeInstall) => currentVercelBaseFingerprintLive(claudeInstall)
|
|
1625
1621
|
};
|
|
1626
1622
|
var providerModule = {
|
|
1627
1623
|
provider: vercelProvider,
|
|
@@ -20,11 +20,20 @@ import {
|
|
|
20
20
|
renderInnerCommand,
|
|
21
21
|
resolveCloudCheckpoint,
|
|
22
22
|
writeCloudCheckpointManifest
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-O3K3ZGFF.js";
|
|
24
24
|
import {
|
|
25
25
|
detectPortless,
|
|
26
|
-
portlessDoctorRow
|
|
27
|
-
|
|
26
|
+
portlessDoctorRow,
|
|
27
|
+
portlessServiceStatus
|
|
28
|
+
} from "./chunk-4LYVBRBC.js";
|
|
29
|
+
import {
|
|
30
|
+
hashProjectPath,
|
|
31
|
+
loadEffectiveConfig,
|
|
32
|
+
sanitizeMnemonic,
|
|
33
|
+
setConfigValue
|
|
34
|
+
} from "./chunk-A5Y7LJMU.js";
|
|
35
|
+
import "./chunk-6AVSKCZJ.js";
|
|
36
|
+
import "./chunk-F2JI4GMX.js";
|
|
28
37
|
import "./chunk-3LAHFDJF.js";
|
|
29
38
|
import {
|
|
30
39
|
BOX_IMAGE_REGISTRY,
|
|
@@ -43,16 +52,10 @@ import {
|
|
|
43
52
|
sshExec,
|
|
44
53
|
sshOptArgs,
|
|
45
54
|
writePreparedStateRaw
|
|
46
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-RMEUA6PA.js";
|
|
47
56
|
import {
|
|
48
57
|
execa
|
|
49
58
|
} from "./chunk-UDZ3VXRF.js";
|
|
50
|
-
import {
|
|
51
|
-
hashProjectPath,
|
|
52
|
-
loadEffectiveConfig,
|
|
53
|
-
sanitizeMnemonic,
|
|
54
|
-
setConfigValue
|
|
55
|
-
} from "./chunk-QSMPSV5Z.js";
|
|
56
59
|
import "./chunk-OG4KH2FZ.js";
|
|
57
60
|
|
|
58
61
|
// ../../packages/sandbox-remote-docker/dist/chunk-SMGJ34CX.js
|
|
@@ -1058,7 +1061,7 @@ async function doctorChecks() {
|
|
|
1058
1061
|
detail: "not baked on this host yet",
|
|
1059
1062
|
hint: `\`agentbox prepare --provider docker:${alias}\` (otherwise the first create bakes it)`
|
|
1060
1063
|
};
|
|
1061
|
-
const portlessRes = portlessDoctorRow(await detectPortless());
|
|
1064
|
+
const portlessRes = portlessDoctorRow(await detectPortless(), await portlessServiceStatus());
|
|
1062
1065
|
return [engineRes, imageRes, portlessRes];
|
|
1063
1066
|
} catch (err) {
|
|
1064
1067
|
return [{ label: "remote engine", status: "warn", detail: errSummary(err) }];
|
|
@@ -1,8 +1,8 @@
|
|
|
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
2
|
import {
|
|
3
3
|
AUTH_TOKEN_PATH
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-SCHQR5KR.js";
|
|
5
|
+
import "./chunk-A5Y7LJMU.js";
|
|
6
6
|
import "./chunk-OG4KH2FZ.js";
|
|
7
7
|
|
|
8
8
|
// lib/hub-token.ts
|
|
@@ -0,0 +1,215 @@
|
|
|
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
|
+
applyProjectSeed,
|
|
7
|
+
startDetachedCloudAgent
|
|
8
|
+
} from "./chunk-O3K3ZGFF.js";
|
|
9
|
+
import {
|
|
10
|
+
FsCustodyStore,
|
|
11
|
+
GitHubAppLeaser,
|
|
12
|
+
cloneRepoWithLfs,
|
|
13
|
+
drainCreateJobs,
|
|
14
|
+
loadGitHubAppConfig,
|
|
15
|
+
makeControlPlaneCreateBox,
|
|
16
|
+
parseGitRemote,
|
|
17
|
+
toAuthedHttpsUrl
|
|
18
|
+
} from "./chunk-4LYVBRBC.js";
|
|
19
|
+
import {
|
|
20
|
+
isProviderKind,
|
|
21
|
+
loadEffectiveConfig
|
|
22
|
+
} from "./chunk-A5Y7LJMU.js";
|
|
23
|
+
import "./chunk-6AVSKCZJ.js";
|
|
24
|
+
import "./chunk-F2JI4GMX.js";
|
|
25
|
+
import "./chunk-3LAHFDJF.js";
|
|
26
|
+
import {
|
|
27
|
+
AGENT_SYNC_SPECS,
|
|
28
|
+
boxSshDirForProvider,
|
|
29
|
+
projectSlugFromOriginUrl,
|
|
30
|
+
resolveAgentLauncher
|
|
31
|
+
} from "./chunk-RMEUA6PA.js";
|
|
32
|
+
import "./chunk-UDZ3VXRF.js";
|
|
33
|
+
import "./chunk-OG4KH2FZ.js";
|
|
34
|
+
|
|
35
|
+
// lib/hub-worker.ts
|
|
36
|
+
import { execFile } from "node:child_process";
|
|
37
|
+
import { mkdir, readdir, rm, writeFile } from "node:fs/promises";
|
|
38
|
+
import { hostname, tmpdir } from "node:os";
|
|
39
|
+
import { dirname, join } from "node:path";
|
|
40
|
+
import { promisify } from "node:util";
|
|
41
|
+
var execFileAsync = promisify(execFile);
|
|
42
|
+
var IMPORTERS = {
|
|
43
|
+
docker: () => import("./dist-2GEAA7QA.js"),
|
|
44
|
+
daytona: () => import("./dist-36O6F6M3.js"),
|
|
45
|
+
hetzner: () => import("./dist-RBBXXGLI.js"),
|
|
46
|
+
vercel: () => import("./dist-RRJN2U5P.js"),
|
|
47
|
+
e2b: () => import("./dist-NYKIT5W5.js"),
|
|
48
|
+
digitalocean: () => import("./dist-IWLEL2TO.js"),
|
|
49
|
+
"remote-docker": () => import("./dist-UWXGDCK4.js")
|
|
50
|
+
};
|
|
51
|
+
async function runGit(args, env, timeoutMs) {
|
|
52
|
+
await execFileAsync("git", args, {
|
|
53
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
54
|
+
env: env ? { ...process.env, ...env } : process.env,
|
|
55
|
+
...timeoutMs ? { timeout: timeoutMs } : {}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
async function seedHostBackupsFromCustody(custody, log) {
|
|
59
|
+
for (const spec of AGENT_SYNC_SPECS) {
|
|
60
|
+
const custodyPath = `agents/${spec.id}/${spec.credential.boxRelPath}`;
|
|
61
|
+
try {
|
|
62
|
+
const found = await custody.get(custodyPath);
|
|
63
|
+
if (!found) continue;
|
|
64
|
+
await mkdir(dirname(spec.credential.hostBackup), { recursive: true });
|
|
65
|
+
await writeFile(spec.credential.hostBackup, found.data, { mode: 384 });
|
|
66
|
+
log(`seeded ${spec.id} credentials from custody`);
|
|
67
|
+
} catch (err) {
|
|
68
|
+
log(`seed ${spec.id} from custody failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async function mirrorBoxSshToCustody(custody, provider, sandboxId, log) {
|
|
73
|
+
if (!sandboxId) return;
|
|
74
|
+
const sshDir = boxSshDirForProvider(provider, sandboxId);
|
|
75
|
+
if (!sshDir) return;
|
|
76
|
+
try {
|
|
77
|
+
const files = await readdir(sshDir, { withFileTypes: true }).catch(() => []);
|
|
78
|
+
const { readFile } = await import("node:fs/promises");
|
|
79
|
+
for (const f of files) {
|
|
80
|
+
if (!f.isFile()) continue;
|
|
81
|
+
const data = await readFile(join(sshDir, f.name));
|
|
82
|
+
await custody.put(`boxes/${sandboxId}/ssh/${f.name}`, data);
|
|
83
|
+
}
|
|
84
|
+
if (files.length > 0) log(`mirrored ${provider} box ${sandboxId} ssh keys to custody`);
|
|
85
|
+
} catch (err) {
|
|
86
|
+
log(`ssh-mirror ${sandboxId} failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async function applySeedFromCustody(custody, repoUrl, dest, log) {
|
|
90
|
+
const slug = projectSlugFromOriginUrl(repoUrl);
|
|
91
|
+
if (!slug) return null;
|
|
92
|
+
return applyProjectSeed({
|
|
93
|
+
source: {
|
|
94
|
+
get: async (rel) => (await custody.get(`projects/${slug}/seed/${rel}`))?.data ?? null
|
|
95
|
+
},
|
|
96
|
+
dest,
|
|
97
|
+
log
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function normalizeCreateAgent(agent) {
|
|
101
|
+
return agent === "claude" || agent === "codex" || agent === "opencode" ? agent : void 0;
|
|
102
|
+
}
|
|
103
|
+
function makeHubCreateBox(opts) {
|
|
104
|
+
const { log } = opts;
|
|
105
|
+
const custody = new FsCustodyStore();
|
|
106
|
+
if (opts.mockCreate) {
|
|
107
|
+
return (request, jobId) => {
|
|
108
|
+
log(`[mock] created box for job ${jobId} (${request.provider} ${request.repoUrl})`);
|
|
109
|
+
return Promise.resolve({ boxId: `mock-${jobId.slice(0, 8)}` });
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
const appCfg = loadGitHubAppConfig();
|
|
113
|
+
if (!appCfg) throw new Error("no GitHub App configured (AGENTBOX_GITHUB_APP_* / control-plane.env)");
|
|
114
|
+
const leaser = new GitHubAppLeaser(appCfg);
|
|
115
|
+
const extraInboundCidrs = opts.adminCidr ? [opts.adminCidr] : void 0;
|
|
116
|
+
return makeControlPlaneCreateBox({
|
|
117
|
+
leaseRemoteUrl: async (repoUrl) => {
|
|
118
|
+
const { path } = parseGitRemote(repoUrl);
|
|
119
|
+
const [owner, repo] = path.replace(/\.git$/, "").split("/");
|
|
120
|
+
if (!owner || !repo) throw new Error(`cannot derive owner/repo from ${repoUrl}`);
|
|
121
|
+
const { token } = await leaser.leaseRepoToken(owner, repo);
|
|
122
|
+
return toAuthedHttpsUrl(repoUrl, token);
|
|
123
|
+
},
|
|
124
|
+
cloneRepo: (authedUrl, repoUrl, dest, branch) => cloneRepoWithLfs(runGit, authedUrl, repoUrl, dest, branch, log),
|
|
125
|
+
createBox: async ({ workspacePath, name, provider, agent, prompt, agentArgs, onLog }) => {
|
|
126
|
+
if (!isProviderKind(provider)) throw new Error(`unknown provider ${provider}`);
|
|
127
|
+
const mod = (await IMPORTERS[provider]()).providerModule;
|
|
128
|
+
if (mod.ensureCredentials) await mod.ensureCredentials();
|
|
129
|
+
await seedHostBackupsFromCustody(custody, log);
|
|
130
|
+
const claudeInstall = (await loadEffectiveConfig(workspacePath).catch(() => null))?.effective.box.claudeInstall ?? "native";
|
|
131
|
+
await hydratePreparedFromCustody(custody, provider, mod.provider, claudeInstall, log);
|
|
132
|
+
const created = await mod.provider.create({
|
|
133
|
+
workspacePath,
|
|
134
|
+
name,
|
|
135
|
+
projectRoot: workspacePath,
|
|
136
|
+
// Registered on the plane so an adopting PC relaunches the right agent.
|
|
137
|
+
agent: normalizeCreateAgent(agent),
|
|
138
|
+
// Register the box on THIS hub (control-plane topology) so the phone UI
|
|
139
|
+
// sees it and approvals route back here.
|
|
140
|
+
controlPlaneUrl: opts.publicUrl,
|
|
141
|
+
...extraInboundCidrs ? { providerOptions: { extraInboundCidrs } } : {},
|
|
142
|
+
onLog
|
|
143
|
+
});
|
|
144
|
+
await mirrorBoxSshToCustody(custody, provider, created.record.cloud?.sandboxId, log);
|
|
145
|
+
const boxAgent = normalizeCreateAgent(agent);
|
|
146
|
+
if (boxAgent && prompt && prompt.length > 0) {
|
|
147
|
+
const kind = boxAgent === "claude" ? "claude-code" : boxAgent;
|
|
148
|
+
const extraArgs = resolveAgentLauncher(kind).buildArgs(prompt, agentArgs ?? []);
|
|
149
|
+
log(`starting ${boxAgent} in ${created.record.name} with the seed prompt`);
|
|
150
|
+
try {
|
|
151
|
+
await startDetachedCloudAgent({
|
|
152
|
+
provider: mod.provider,
|
|
153
|
+
box: created.record,
|
|
154
|
+
binary: boxAgent,
|
|
155
|
+
sessionName: boxAgent,
|
|
156
|
+
extraArgs
|
|
157
|
+
});
|
|
158
|
+
log(`${boxAgent} session is running in ${created.record.name}`);
|
|
159
|
+
} catch (err) {
|
|
160
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
161
|
+
log(`agent start failed (box was created): ${msg}`);
|
|
162
|
+
return { id: created.record.id, agentStartError: msg };
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return { id: created.record.id };
|
|
166
|
+
},
|
|
167
|
+
fetchSeedMaterial: (repoUrl, dest) => applySeedFromCustody(custody, repoUrl, dest, log),
|
|
168
|
+
tmpDir: (jobId) => join(tmpdir(), `agentbox-hub-worker-${jobId}`),
|
|
169
|
+
cleanup: (dir) => rm(dir, { recursive: true, force: true }),
|
|
170
|
+
log
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
function startHubWorker(opts) {
|
|
174
|
+
const { store, log } = opts;
|
|
175
|
+
if (!store.claimNextCreateJob || !store.completeCreateJob) {
|
|
176
|
+
log("worker: store has no create-job queue; not starting");
|
|
177
|
+
return { stop: () => Promise.resolve() };
|
|
178
|
+
}
|
|
179
|
+
const createBox = makeHubCreateBox(opts);
|
|
180
|
+
const workerId = `hub-${hostname()}`;
|
|
181
|
+
const intervalMs = opts.intervalMs ?? 5e3;
|
|
182
|
+
let ticking = false;
|
|
183
|
+
let stopped = false;
|
|
184
|
+
let inFlight = Promise.resolve();
|
|
185
|
+
async function tick() {
|
|
186
|
+
if (ticking) return;
|
|
187
|
+
ticking = true;
|
|
188
|
+
try {
|
|
189
|
+
const n = await drainCreateJobs(store, createBox, workerId);
|
|
190
|
+
if (n > 0) log(`worker: processed ${String(n)} create job(s)`);
|
|
191
|
+
} catch (err) {
|
|
192
|
+
log(`worker: tick error: ${err instanceof Error ? err.message : String(err)}`);
|
|
193
|
+
} finally {
|
|
194
|
+
ticking = false;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
const timer = setInterval(() => {
|
|
198
|
+
if (stopped) return;
|
|
199
|
+
inFlight = tick();
|
|
200
|
+
}, intervalMs);
|
|
201
|
+
timer.unref();
|
|
202
|
+
log(`worker: draining create jobs as ${workerId}`);
|
|
203
|
+
return {
|
|
204
|
+
stop: async () => {
|
|
205
|
+
stopped = true;
|
|
206
|
+
clearInterval(timer);
|
|
207
|
+
await inFlight.catch(() => {
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
export {
|
|
213
|
+
makeHubCreateBox,
|
|
214
|
+
startHubWorker
|
|
215
|
+
};
|