@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
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
PROVIDER_NAMES,
|
|
4
|
+
isProviderKind
|
|
5
|
+
} from "./chunk-BHJCMTHP.js";
|
|
6
|
+
import {
|
|
7
|
+
isSupportedApiVersion,
|
|
8
|
+
pluginForProvider,
|
|
9
|
+
pluginProviderNames
|
|
10
|
+
} from "./chunk-PXYPQ5BO.js";
|
|
11
|
+
|
|
12
|
+
// src/provider/loaders.ts
|
|
13
|
+
import { pathToFileURL } from "url";
|
|
14
|
+
var IMPORTERS = {
|
|
15
|
+
docker: () => import("./dist-JOFZOZCY.js"),
|
|
16
|
+
daytona: () => import("./dist-KZ2GEEEX.js"),
|
|
17
|
+
hetzner: () => import("./dist-JHMILJUT.js"),
|
|
18
|
+
vercel: () => import("./dist-UXZQWKY6.js"),
|
|
19
|
+
e2b: () => import("./dist-2SYQI5S2.js"),
|
|
20
|
+
digitalocean: () => import("./dist-6QZMZEL7.js"),
|
|
21
|
+
"remote-docker": () => import("./dist-Q5NY4CF6.js")
|
|
22
|
+
};
|
|
23
|
+
function pickProviderModule(mod, name) {
|
|
24
|
+
const m = mod;
|
|
25
|
+
const all = m.providerModules ?? (m.providerModule ? [m.providerModule] : []);
|
|
26
|
+
return all.find((pm) => pm.provider?.name === name) ?? null;
|
|
27
|
+
}
|
|
28
|
+
async function loadProviderModule(name) {
|
|
29
|
+
if (isProviderKind(name)) {
|
|
30
|
+
return (await IMPORTERS[name]()).providerModule;
|
|
31
|
+
}
|
|
32
|
+
const plugin = pluginForProvider(name);
|
|
33
|
+
if (!plugin) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`unknown provider "${name}" \u2014 not built in and no registered plugin provides it (run \`agentbox plugin list\`)`
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
if (!isSupportedApiVersion(plugin.apiVersion)) {
|
|
39
|
+
throw new Error(
|
|
40
|
+
`plugin "${plugin.packageName}" targets provider SDK v${String(plugin.apiVersion)}, which this AgentBox does not support \u2014 update the plugin or AgentBox`
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
const mod = await import(pathToFileURL(plugin.resolvedEntry).href);
|
|
44
|
+
const providerModule = pickProviderModule(mod, name);
|
|
45
|
+
if (!providerModule) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`plugin "${plugin.packageName}" does not export a providerModule for "${name}"`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
return providerModule;
|
|
51
|
+
}
|
|
52
|
+
function getRuntimeProviderNames() {
|
|
53
|
+
return [.../* @__PURE__ */ new Set([...PROVIDER_NAMES, ...pluginProviderNames()])];
|
|
54
|
+
}
|
|
55
|
+
function isRuntimeProvider(name) {
|
|
56
|
+
return isProviderKind(name) || pluginProviderNames().includes(name);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// src/provider/spec.ts
|
|
60
|
+
var REMOTE_DOCKER = "remote-docker";
|
|
61
|
+
function parseProviderSpec(spec) {
|
|
62
|
+
const raw = spec.trim();
|
|
63
|
+
const colon = raw.indexOf(":");
|
|
64
|
+
if (colon < 0) return { name: raw };
|
|
65
|
+
const base = raw.slice(0, colon);
|
|
66
|
+
const host = raw.slice(colon + 1).trim();
|
|
67
|
+
if (base !== "docker" && base !== REMOTE_DOCKER) {
|
|
68
|
+
return { name: raw };
|
|
69
|
+
}
|
|
70
|
+
if (host.length === 0) {
|
|
71
|
+
throw new Error(
|
|
72
|
+
`provider "${raw}" names no host \u2014 write \`${base}:<ssh-host>\` (an ~/.ssh/config alias or [user@]host[:port])`
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
return { name: REMOTE_DOCKER, remoteHost: host };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// src/provider/registry.ts
|
|
79
|
+
function isKnownProvider(name) {
|
|
80
|
+
try {
|
|
81
|
+
return isRuntimeProvider(parseProviderSpec(name).name);
|
|
82
|
+
} catch {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
async function getProvider(name) {
|
|
87
|
+
const mod = await loadProviderModule(parseProviderSpec(name).name);
|
|
88
|
+
if (mod.ensureCredentials) await mod.ensureCredentials();
|
|
89
|
+
return mod.provider;
|
|
90
|
+
}
|
|
91
|
+
async function providerForBox(box) {
|
|
92
|
+
return getProvider(box.provider ?? "docker");
|
|
93
|
+
}
|
|
94
|
+
async function loadControlPlaneEnvLazily() {
|
|
95
|
+
const { loadControlPlaneEnv } = await import("./env-file-UDUDQMP4.js");
|
|
96
|
+
loadControlPlaneEnv();
|
|
97
|
+
}
|
|
98
|
+
async function providerForCreate(choice) {
|
|
99
|
+
const flag = choice.flag?.trim();
|
|
100
|
+
const spec = flag && flag.length > 0 ? flag : choice.config.box.provider;
|
|
101
|
+
if (typeof spec !== "string" || spec.length === 0 || !isKnownProvider(spec)) {
|
|
102
|
+
throw new Error(
|
|
103
|
+
`unknown sandbox provider "${String(spec)}" (known: ${getRuntimeProviderNames().join(", ")})`
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
if (choice.config.relay?.controlPlaneUrl) await loadControlPlaneEnvLazily();
|
|
107
|
+
return getProvider(spec);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export {
|
|
111
|
+
loadProviderModule,
|
|
112
|
+
getRuntimeProviderNames,
|
|
113
|
+
isRuntimeProvider,
|
|
114
|
+
parseProviderSpec,
|
|
115
|
+
isKnownProvider,
|
|
116
|
+
getProvider,
|
|
117
|
+
providerForBox,
|
|
118
|
+
providerForCreate
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=chunk-OEYAVBA6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/provider/loaders.ts","../src/provider/spec.ts","../src/provider/registry.ts"],"sourcesContent":["/**\n * Per-provider lazy module loaders — the ONE place the CLI enumerates the\n * `@agentbox/sandbox-<name>` packages.\n *\n * Each package exposes a uniform `providerModule` (see `ProviderModule` in\n * `@agentbox/sandbox-core`); the create / doctor / install / checkpoint code\n * all resolve a provider through `loadProviderModule` and drive it generically,\n * so those call sites carry no per-provider `switch`.\n *\n * The `import()` specifiers are LITERAL — one arm per provider — on purpose.\n * The CLI's tsup build inlines every `@agentbox/sandbox-*` package\n * (`noExternal: [/^@agentbox\\//]`), which requires esbuild to statically\n * resolve each specifier; a runtime-variable `import('@agentbox/sandbox-' +\n * name)` would not inline and would `MODULE_NOT_FOUND` in the published CLI.\n * `Record<ProviderKind, …>` makes this map exhaustive: adding a provider to the\n * config `PROVIDERS` table forces a matching entry here (a TS error otherwise).\n */\n\nimport { pathToFileURL } from 'node:url';\nimport { PROVIDER_NAMES, isProviderKind, type ProviderKind } from '@agentbox/config';\nimport {\n pluginForProvider,\n pluginProviderNames,\n isSupportedApiVersion,\n type ProviderModule,\n} from '@agentbox/sandbox-core';\n\nconst IMPORTERS: Record<ProviderKind, () => Promise<{ providerModule: ProviderModule }>> = {\n docker: () => import('@agentbox/sandbox-docker'),\n daytona: () => import('@agentbox/sandbox-daytona'),\n hetzner: () => import('@agentbox/sandbox-hetzner'),\n vercel: () => import('@agentbox/sandbox-vercel'),\n e2b: () => import('@agentbox/sandbox-e2b'),\n digitalocean: () => import('@agentbox/sandbox-digitalocean'),\n 'remote-docker': () => import('@agentbox/sandbox-remote-docker'),\n};\n\n/**\n * Extract the `providerModule` matching `name` from an already-imported plugin\n * package. A plugin may export a single `providerModule` or a `providerModules`\n * array (multi-provider package).\n */\nfunction pickProviderModule(mod: unknown, name: string): ProviderModule | null {\n const m = mod as { providerModule?: ProviderModule; providerModules?: ProviderModule[] };\n const all = m.providerModules ?? (m.providerModule ? [m.providerModule] : []);\n // Strict match on provider.name — never fall back to all[0], or a package\n // could serve the WRONG provider for a mismatched `--provider` name.\n return all.find((pm) => pm.provider?.name === name) ?? null;\n}\n\n/**\n * Lazily import a provider package and return its uniform `providerModule`.\n *\n * Built-in providers resolve through the literal-specifier `IMPORTERS` map\n * (bundle-inlined). An unknown name falls back to the plugin registry: a TRUE\n * variable `import(resolvedEntry)` of the externally-installed package — NOT\n * inlined at build time, resolved from wherever the user installed it.\n */\nexport async function loadProviderModule(name: string): Promise<ProviderModule> {\n if (isProviderKind(name)) {\n return (await IMPORTERS[name]()).providerModule;\n }\n const plugin = pluginForProvider(name);\n if (!plugin) {\n throw new Error(\n `unknown provider \"${name}\" — not built in and no registered plugin provides it (run \\`agentbox plugin list\\`)`,\n );\n }\n if (!isSupportedApiVersion(plugin.apiVersion)) {\n throw new Error(\n `plugin \"${plugin.packageName}\" targets provider SDK v${String(plugin.apiVersion)}, which this AgentBox does not support — update the plugin or AgentBox`,\n );\n }\n // Variable specifier on purpose: this is the extension seam. esbuild leaves it\n // as a runtime import so an externally-installed package resolves at run time.\n // Convert to a file:// URL — a bare absolute path is not a valid ESM dynamic\n // import specifier on Windows / some Node setups.\n const mod = (await import(pathToFileURL(plugin.resolvedEntry).href)) as unknown;\n const providerModule = pickProviderModule(mod, name);\n if (!providerModule) {\n throw new Error(\n `plugin \"${plugin.packageName}\" does not export a providerModule for \"${name}\"`,\n );\n }\n return providerModule;\n}\n\n/** Built-in + registered-plugin provider names (deduped). */\nexport function getRuntimeProviderNames(): string[] {\n return [...new Set<string>([...PROVIDER_NAMES, ...pluginProviderNames()])];\n}\n\n/** True if `name` is a built-in provider or a registered plugin provider. */\nexport function isRuntimeProvider(name: string): boolean {\n return isProviderKind(name) || pluginProviderNames().includes(name);\n}\n","/**\n * `--provider` accepts a *spec*, not just a name: `docker:<host>` means \"the\n * docker engine on <host>\", i.e. the remote-docker provider pointed at that SSH\n * destination.\n *\n * agentbox docker:buildbox claude\n * agentbox create --provider docker:dev@10.0.0.9:2222\n * agentbox prepare --provider docker:buildbox\n *\n * Reading `docker:` as the base is deliberate: to the user this IS docker, just\n * not here. `remote-docker:<host>` is accepted too, for anyone who reaches for\n * the provider's real name.\n *\n * Everything that takes a `--provider` runs its value through `parseProviderSpec`,\n * so a spec works anywhere a bare name does. A name with no `:` parses to\n * itself, which keeps every existing call site's behavior exactly as it was.\n */\n\nexport const REMOTE_DOCKER = 'remote-docker';\n\nexport interface ProviderSpec {\n /** The provider name to resolve (`remote-docker` for a `docker:<host>` spec). */\n name: string;\n /** The SSH destination, when the spec named one. */\n remoteHost?: string;\n}\n\n/**\n * Split `<base>:<host>` on the FIRST colon — everything after it is the SSH\n * destination, which may itself contain a `:port` suffix\n * (`docker:dev@10.0.0.9:2222` → host `dev@10.0.0.9:2222`).\n */\nexport function parseProviderSpec(spec: string): ProviderSpec {\n const raw = spec.trim();\n const colon = raw.indexOf(':');\n if (colon < 0) return { name: raw };\n\n const base = raw.slice(0, colon);\n const host = raw.slice(colon + 1).trim();\n if (base !== 'docker' && base !== REMOTE_DOCKER) {\n // Not a remote spec — hand the whole string back and let the caller's\n // unknown-provider error name it, rather than silently reinterpreting it.\n return { name: raw };\n }\n if (host.length === 0) {\n throw new Error(\n `provider \"${raw}\" names no host — write \\`${base}:<ssh-host>\\` (an ~/.ssh/config alias or [user@]host[:port])`,\n );\n }\n return { name: REMOTE_DOCKER, remoteHost: host };\n}\n\n/** The provider name a spec resolves to, ignoring any host. */\nexport function providerNameOf(spec: string): string {\n return parseProviderSpec(spec).name;\n}\n","/**\n * Provider registry — resolves a `Provider` for either an existing box (from\n * its `provider` discriminator) or a fresh `create` (from --provider flag /\n * config / default). Lazy `import()` keeps the Daytona SDK out of the Docker\n * hot path.\n */\n\nimport type { EffectiveConfig } from '@agentbox/config';\nimport type { ProviderKind } from '@agentbox/config';\nimport type { BoxRecord, Provider, ProviderName } from '@agentbox/core';\nimport { getRuntimeProviderNames, isRuntimeProvider, loadProviderModule } from './loaders.js';\nimport { parseProviderSpec } from './spec.js';\n\n/** A built-in `ProviderKind` OR a registered plugin provider name. */\nexport type KnownProviderName = ProviderKind | (string & {});\n\n/**\n * True for a built-in provider, a registered plugin provider, or a\n * host-qualified spec (`docker:<host>`). Every `--provider` validation goes\n * through here, so a spec is accepted everywhere a bare name is.\n */\nexport function isKnownProvider(name: string): boolean {\n try {\n return isRuntimeProvider(parseProviderSpec(name).name);\n } catch {\n // A malformed spec (`docker:` with no host) is not a known provider; the\n // caller's error message names it.\n return false;\n }\n}\n\n/**\n * Resolve a `Provider` by name or spec, running its first-run credential gate\n * first. Each provider package's `providerModule.ensureCredentials` walks the\n * user through `agentbox <provider> login` on first use (a no-op for docker and\n * remote-docker, which have no credential, and for non-TTY callers). The\n * base-snapshot gate lives inside `backend.provision`, not here, so `agentbox\n * prepare` can build the snapshot without tripping it. Built-ins load through\n * the bundle-inlined map; unknown names fall back to the plugin registry.\n */\nexport async function getProvider(name: ProviderName): Promise<Provider> {\n const mod = await loadProviderModule(parseProviderSpec(name).name);\n if (mod.ensureCredentials) await mod.ensureCredentials();\n return mod.provider;\n}\n\n/** Provider for an existing box record. Defaults to 'docker' for legacy records. */\nexport async function providerForBox(box: BoxRecord): Promise<Provider> {\n return getProvider(box.provider ?? 'docker');\n}\n\nexport interface CreateProviderChoice {\n /** Explicit --provider flag, if the command exposed one. */\n flag?: string;\n /** Effective config (carries box.provider for the layered default). */\n config: EffectiveConfig;\n}\n\n/**\n * Provider for a fresh `agentbox create`. Precedence: --provider flag >\n * box.provider config > 'docker'. Throws if the resolved name isn't registered.\n */\n/** Lazy: keeps the env-file read off every `getProvider` call. */\nasync function loadControlPlaneEnvLazily(): Promise<void> {\n const { loadControlPlaneEnv } = await import('../control-plane/env-file.js');\n loadControlPlaneEnv();\n}\n\nexport async function providerForCreate(choice: CreateProviderChoice): Promise<Provider> {\n const flag = choice.flag?.trim();\n const spec = (flag && flag.length > 0 ? flag : choice.config.box.provider) as ProviderName;\n if (typeof spec !== 'string' || spec.length === 0 || !isKnownProvider(spec)) {\n throw new Error(\n `unknown sandbox provider \"${String(spec)}\" (known: ${getRuntimeProviderNames().join(', ')})`,\n );\n }\n // A control-plane create needs the admin bearer in `process.env` — the\n // provider registers the box on the plane and pushes seed material with it.\n // The token lives in the setup-written env file, and nothing on the create\n // path was loading it, so in an ordinary shell (where the user has not\n // sourced it) every PC create silently skipped registration: the box came up\n // with `topology: control-plane` but the plane never heard of it, its seed was\n // never stored, and its `git push` had no token to lease with.\n //\n // Every create path resolves its provider through here, so this is the one\n // place that covers create / claude / codex / opencode / queued jobs.\n // Optional-chained: a real EffectiveConfig always carries `relay` (defaults\n // fill it), but callers/tests hand this a narrower object.\n if (choice.config.relay?.controlPlaneUrl) await loadControlPlaneEnvLazily();\n return getProvider(spec);\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAS,qBAAqB;AAS9B,IAAM,YAAqF;AAAA,EACzF,QAAQ,MAAM,OAAO,oBAA0B;AAAA,EAC/C,SAAS,MAAM,OAAO,oBAA2B;AAAA,EACjD,SAAS,MAAM,OAAO,oBAA2B;AAAA,EACjD,QAAQ,MAAM,OAAO,oBAA0B;AAAA,EAC/C,KAAK,MAAM,OAAO,oBAAuB;AAAA,EACzC,cAAc,MAAM,OAAO,oBAAgC;AAAA,EAC3D,iBAAiB,MAAM,OAAO,oBAAiC;AACjE;AAOA,SAAS,mBAAmB,KAAc,MAAqC;AAC7E,QAAM,IAAI;AACV,QAAM,MAAM,EAAE,oBAAoB,EAAE,iBAAiB,CAAC,EAAE,cAAc,IAAI,CAAC;AAG3E,SAAO,IAAI,KAAK,CAAC,OAAO,GAAG,UAAU,SAAS,IAAI,KAAK;AACzD;AAUA,eAAsB,mBAAmB,MAAuC;AAC9E,MAAI,eAAe,IAAI,GAAG;AACxB,YAAQ,MAAM,UAAU,IAAI,EAAE,GAAG;AAAA,EACnC;AACA,QAAM,SAAS,kBAAkB,IAAI;AACrC,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI;AAAA,MACR,qBAAqB,IAAI;AAAA,IAC3B;AAAA,EACF;AACA,MAAI,CAAC,sBAAsB,OAAO,UAAU,GAAG;AAC7C,UAAM,IAAI;AAAA,MACR,WAAW,OAAO,WAAW,2BAA2B,OAAO,OAAO,UAAU,CAAC;AAAA,IACnF;AAAA,EACF;AAKA,QAAM,MAAO,MAAM,OAAO,cAAc,OAAO,aAAa,EAAE;AAC9D,QAAM,iBAAiB,mBAAmB,KAAK,IAAI;AACnD,MAAI,CAAC,gBAAgB;AACnB,UAAM,IAAI;AAAA,MACR,WAAW,OAAO,WAAW,2CAA2C,IAAI;AAAA,IAC9E;AAAA,EACF;AACA,SAAO;AACT;AAGO,SAAS,0BAAoC;AAClD,SAAO,CAAC,GAAG,oBAAI,IAAY,CAAC,GAAG,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,CAAC;AAC3E;AAGO,SAAS,kBAAkB,MAAuB;AACvD,SAAO,eAAe,IAAI,KAAK,oBAAoB,EAAE,SAAS,IAAI;AACpE;;;AC7EO,IAAM,gBAAgB;AActB,SAAS,kBAAkB,MAA4B;AAC5D,QAAM,MAAM,KAAK,KAAK;AACtB,QAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,MAAI,QAAQ,EAAG,QAAO,EAAE,MAAM,IAAI;AAElC,QAAM,OAAO,IAAI,MAAM,GAAG,KAAK;AAC/B,QAAM,OAAO,IAAI,MAAM,QAAQ,CAAC,EAAE,KAAK;AACvC,MAAI,SAAS,YAAY,SAAS,eAAe;AAG/C,WAAO,EAAE,MAAM,IAAI;AAAA,EACrB;AACA,MAAI,KAAK,WAAW,GAAG;AACrB,UAAM,IAAI;AAAA,MACR,aAAa,GAAG,kCAA6B,IAAI;AAAA,IACnD;AAAA,EACF;AACA,SAAO,EAAE,MAAM,eAAe,YAAY,KAAK;AACjD;;;AC7BO,SAAS,gBAAgB,MAAuB;AACrD,MAAI;AACF,WAAO,kBAAkB,kBAAkB,IAAI,EAAE,IAAI;AAAA,EACvD,QAAQ;AAGN,WAAO;AAAA,EACT;AACF;AAWA,eAAsB,YAAY,MAAuC;AACvE,QAAM,MAAM,MAAM,mBAAmB,kBAAkB,IAAI,EAAE,IAAI;AACjE,MAAI,IAAI,kBAAmB,OAAM,IAAI,kBAAkB;AACvD,SAAO,IAAI;AACb;AAGA,eAAsB,eAAe,KAAmC;AACtE,SAAO,YAAY,IAAI,YAAY,QAAQ;AAC7C;AAcA,eAAe,4BAA2C;AACxD,QAAM,EAAE,oBAAoB,IAAI,MAAM,OAAO,wBAA8B;AAC3E,sBAAoB;AACtB;AAEA,eAAsB,kBAAkB,QAAiD;AACvF,QAAM,OAAO,OAAO,MAAM,KAAK;AAC/B,QAAM,OAAQ,QAAQ,KAAK,SAAS,IAAI,OAAO,OAAO,OAAO,IAAI;AACjE,MAAI,OAAO,SAAS,YAAY,KAAK,WAAW,KAAK,CAAC,gBAAgB,IAAI,GAAG;AAC3E,UAAM,IAAI;AAAA,MACR,6BAA6B,OAAO,IAAI,CAAC,aAAa,wBAAwB,EAAE,KAAK,IAAI,CAAC;AAAA,IAC5F;AAAA,EACF;AAaA,MAAI,OAAO,OAAO,OAAO,gBAAiB,OAAM,0BAA0B;AAC1E,SAAO,YAAY,IAAI;AACzB;","names":[]}
|
|
@@ -343,6 +343,8 @@ import { existsSync as existsSync5, mkdirSync as mkdirSync3, readFileSync as rea
|
|
|
343
343
|
import { readFile as readFile10 } from "fs/promises";
|
|
344
344
|
import { homedir as homedir13 } from "os";
|
|
345
345
|
import { dirname as dirname10, resolve as pathResolve } from "path";
|
|
346
|
+
import { existsSync as existsSync6 } from "fs";
|
|
347
|
+
import { resolve as resolve4 } from "path";
|
|
346
348
|
var STATE_DIR = join(homedir(), ".agentbox");
|
|
347
349
|
var STATE_FILE = join(STATE_DIR, "state.json");
|
|
348
350
|
var EMPTY = { version: 1, boxes: [] };
|
|
@@ -1229,6 +1231,21 @@ function defaultBoxSshDir(boxId, namespace) {
|
|
|
1229
1231
|
const safe = boxId.replace(/[^A-Za-z0-9._-]/g, "_");
|
|
1230
1232
|
return namespace ? resolve22(homedir4(), ".agentbox", namespace, "boxes", safe, "ssh") : resolve22(homedir4(), ".agentbox", "boxes", safe, "ssh");
|
|
1231
1233
|
}
|
|
1234
|
+
function boxSshNamespaceForProvider(provider) {
|
|
1235
|
+
switch (provider) {
|
|
1236
|
+
case "hetzner":
|
|
1237
|
+
return void 0;
|
|
1238
|
+
case "digitalocean":
|
|
1239
|
+
return "digitalocean";
|
|
1240
|
+
default:
|
|
1241
|
+
return null;
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
function boxSshDirForProvider(provider, sandboxId) {
|
|
1245
|
+
const ns = boxSshNamespaceForProvider(provider);
|
|
1246
|
+
if (ns === null) return null;
|
|
1247
|
+
return defaultBoxSshDir(sandboxId, ns);
|
|
1248
|
+
}
|
|
1232
1249
|
async function pickFreePort() {
|
|
1233
1250
|
return new Promise((resolveOk, reject) => {
|
|
1234
1251
|
const srv = createServer();
|
|
@@ -3605,262 +3622,57 @@ function resolveContextFilesFrom(fileMap, opts) {
|
|
|
3605
3622
|
}
|
|
3606
3623
|
return out;
|
|
3607
3624
|
}
|
|
3625
|
+
var RUNTIME_ROOT_ENV = "AGENTBOX_RUNTIME_ROOT";
|
|
3626
|
+
function stagedRuntimeRootCandidates(self) {
|
|
3627
|
+
const candidates = [];
|
|
3628
|
+
const override = process.env[RUNTIME_ROOT_ENV];
|
|
3629
|
+
if (override) candidates.push(override);
|
|
3630
|
+
candidates.push(resolve4(self, "..", "runtime"), resolve4(self, "..", "..", "runtime"));
|
|
3631
|
+
return candidates;
|
|
3632
|
+
}
|
|
3633
|
+
function resolveStagedRuntimeRoot(self, marker) {
|
|
3634
|
+
for (const candidate of stagedRuntimeRootCandidates(self)) {
|
|
3635
|
+
if (existsSync6(resolve4(candidate, marker))) return candidate;
|
|
3636
|
+
}
|
|
3637
|
+
return void 0;
|
|
3638
|
+
}
|
|
3608
3639
|
var BOX_IMAGE_REGISTRY = "ghcr.io/madarco/agentbox/box";
|
|
3609
3640
|
function registryRefForSha(sha, registry = BOX_IMAGE_REGISTRY) {
|
|
3610
3641
|
return `${registry}:sha-${sha.slice(0, 16)}`;
|
|
3611
3642
|
}
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
return cfg.effective.box.claudeInstall;
|
|
3626
|
-
} catch {
|
|
3627
|
-
return "native";
|
|
3628
|
-
}
|
|
3629
|
-
}
|
|
3630
|
-
var here = dirname11(fileURLToPath(import.meta.url));
|
|
3631
|
-
function resolveDockerBuild() {
|
|
3632
|
-
const override = process.env.AGENTBOX_DOCKER_CONTEXT;
|
|
3633
|
-
if (override && existsSync6(resolve4(override, "Dockerfile.box"))) {
|
|
3634
|
-
return { dockerfile: resolve4(override, "Dockerfile.box"), context: override };
|
|
3635
|
-
}
|
|
3636
|
-
const staged = resolve4(here, "..", "runtime", "docker");
|
|
3637
|
-
if (existsSync6(resolve4(staged, "Dockerfile.box"))) {
|
|
3638
|
-
return { dockerfile: resolve4(staged, "Dockerfile.box"), context: staged };
|
|
3643
|
+
function ownerRepoFromOriginUrl(originUrl) {
|
|
3644
|
+
const url = originUrl.trim();
|
|
3645
|
+
if (url.length === 0) return null;
|
|
3646
|
+
let path = null;
|
|
3647
|
+
const scp = /^[^@/\s]+@[^:/\s]+:(.+)$/.exec(url);
|
|
3648
|
+
if (scp) {
|
|
3649
|
+
path = scp[1];
|
|
3650
|
+
} else {
|
|
3651
|
+
try {
|
|
3652
|
+
path = safeDecode(new URL(url).pathname);
|
|
3653
|
+
} catch {
|
|
3654
|
+
return null;
|
|
3655
|
+
}
|
|
3639
3656
|
}
|
|
3640
|
-
const
|
|
3641
|
-
return
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
}
|
|
3646
|
-
var { dockerfile: DOCKERFILE_PATH_RESOLVED, context: BUILD_CONTEXT_DIR_RESOLVED } = resolveDockerBuild();
|
|
3647
|
-
var DOCKERFILE_PATH = DOCKERFILE_PATH_RESOLVED;
|
|
3648
|
-
var BUILD_CONTEXT_DIR = BUILD_CONTEXT_DIR_RESOLVED;
|
|
3649
|
-
async function imageExists(ref) {
|
|
3650
|
-
const result = await execa9("docker", ["image", "inspect", ref], { reject: false });
|
|
3651
|
-
return result.exitCode === 0;
|
|
3657
|
+
const segments = path.replace(/\.git\/?$/, "").split("/").filter((s) => s.length > 0);
|
|
3658
|
+
if (segments.length < 2) return null;
|
|
3659
|
+
const owner = segments[segments.length - 2];
|
|
3660
|
+
const repo = segments[segments.length - 1];
|
|
3661
|
+
if (owner.length === 0 || repo.length === 0) return null;
|
|
3662
|
+
return { owner, repo };
|
|
3652
3663
|
}
|
|
3653
|
-
|
|
3654
|
-
const subprocess = execa9("docker", ["pull", target], {
|
|
3655
|
-
stderr: "pipe",
|
|
3656
|
-
stdout: "pipe",
|
|
3657
|
-
reject: false
|
|
3658
|
-
});
|
|
3659
|
-
let heartbeat;
|
|
3660
|
-
if (opts.onProgress) {
|
|
3661
|
-
let lastLineAt = Date.now();
|
|
3662
|
-
const forward = (chunk) => {
|
|
3663
|
-
lastLineAt = Date.now();
|
|
3664
|
-
const text = typeof chunk === "string" ? chunk : chunk.toString("utf8");
|
|
3665
|
-
for (const line of text.split(/\r?\n/)) {
|
|
3666
|
-
if (line.length > 0) opts.onProgress?.(line);
|
|
3667
|
-
}
|
|
3668
|
-
};
|
|
3669
|
-
subprocess.stdout?.on("data", forward);
|
|
3670
|
-
subprocess.stderr?.on("data", forward);
|
|
3671
|
-
heartbeat = setInterval(() => {
|
|
3672
|
-
if (Date.now() - lastLineAt >= 2e4) {
|
|
3673
|
-
opts.onProgress?.(`still extracting ${target} \u2014 large layers can take a few minutes`);
|
|
3674
|
-
}
|
|
3675
|
-
}, 2e4);
|
|
3676
|
-
}
|
|
3664
|
+
function safeDecode(s) {
|
|
3677
3665
|
try {
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
if (heartbeat) clearInterval(heartbeat);
|
|
3682
|
-
}
|
|
3683
|
-
}
|
|
3684
|
-
async function tagImage(source, target) {
|
|
3685
|
-
await execa9("docker", ["tag", source, target]);
|
|
3686
|
-
}
|
|
3687
|
-
async function imageInfo(ref = DEFAULT_BOX_IMAGE) {
|
|
3688
|
-
const result = await execa9(
|
|
3689
|
-
"docker",
|
|
3690
|
-
["image", "inspect", "--format", "{{.Size}}|{{.Created}}", ref],
|
|
3691
|
-
{ reject: false }
|
|
3692
|
-
);
|
|
3693
|
-
if (result.exitCode !== 0) return { ref, exists: false };
|
|
3694
|
-
const [sizeStr, createdAt] = result.stdout.trim().split("|");
|
|
3695
|
-
const sizeBytes = sizeStr ? Number.parseInt(sizeStr, 10) : NaN;
|
|
3696
|
-
return {
|
|
3697
|
-
ref,
|
|
3698
|
-
exists: true,
|
|
3699
|
-
sizeBytes: Number.isFinite(sizeBytes) ? sizeBytes : void 0,
|
|
3700
|
-
createdAt: createdAt && createdAt.length > 0 ? createdAt : void 0
|
|
3701
|
-
};
|
|
3702
|
-
}
|
|
3703
|
-
async function buildImage(opts = {}) {
|
|
3704
|
-
const ref = opts.ref ?? DEFAULT_BOX_IMAGE;
|
|
3705
|
-
const dockerfile = opts.dockerfile ?? DOCKERFILE_PATH;
|
|
3706
|
-
const contextDir = opts.contextDir ?? BUILD_CONTEXT_DIR;
|
|
3707
|
-
const args = ["build", "-t", ref, "-f", dockerfile];
|
|
3708
|
-
for (const [k, v] of Object.entries(opts.buildArgs ?? {})) {
|
|
3709
|
-
args.push("--build-arg", `${k}=${v}`);
|
|
3710
|
-
}
|
|
3711
|
-
args.push(contextDir);
|
|
3712
|
-
if (process.env.AGENTBOX === "1") {
|
|
3713
|
-
args.splice(1, 0, "--network=host");
|
|
3714
|
-
}
|
|
3715
|
-
const subprocess = execa9("docker", args, {
|
|
3716
|
-
stderr: "pipe",
|
|
3717
|
-
stdout: "pipe"
|
|
3718
|
-
});
|
|
3719
|
-
if (opts.onProgress) {
|
|
3720
|
-
const forward = (chunk) => {
|
|
3721
|
-
const text = typeof chunk === "string" ? chunk : chunk.toString("utf8");
|
|
3722
|
-
for (const line of text.split(/\r?\n/)) {
|
|
3723
|
-
if (line.length > 0) opts.onProgress?.(line);
|
|
3724
|
-
}
|
|
3725
|
-
};
|
|
3726
|
-
subprocess.stdout?.on("data", forward);
|
|
3727
|
-
subprocess.stderr?.on("data", forward);
|
|
3728
|
-
}
|
|
3729
|
-
await subprocess;
|
|
3730
|
-
return ref;
|
|
3731
|
-
}
|
|
3732
|
-
async function pullOrBuild(ref, fingerprint, opts = {}) {
|
|
3733
|
-
const { writePreparedDockerState: writePreparedDockerState2 } = await import("./prepared-state-75DIZ55S-TNJXWMXV.js");
|
|
3734
|
-
const registry = opts.registry ?? BOX_IMAGE_REGISTRY;
|
|
3735
|
-
const allowPull = opts.allowPull !== false;
|
|
3736
|
-
if (allowPull && registry && fingerprint) {
|
|
3737
|
-
const target = registryRefForSha(fingerprint.contextSha256, registry);
|
|
3738
|
-
opts.onProgress?.(`[image] pulling ${target}`);
|
|
3739
|
-
if (await pullImage(target, { onProgress: opts.onProgress })) {
|
|
3740
|
-
await tagImage(target, ref);
|
|
3741
|
-
writePreparedDockerState2({ imageRef: ref, contextSha256: fingerprint.contextSha256 });
|
|
3742
|
-
opts.onProgress?.(`[image] pulled ${target} -> ${ref}`);
|
|
3743
|
-
return { source: "pulled" };
|
|
3744
|
-
}
|
|
3745
|
-
opts.onProgress?.(`[image] registry miss, building ${ref} locally`);
|
|
3746
|
-
}
|
|
3747
|
-
await buildImage({
|
|
3748
|
-
ref,
|
|
3749
|
-
dockerfile: opts.dockerfile,
|
|
3750
|
-
contextDir: opts.contextDir,
|
|
3751
|
-
buildArgs: opts.buildArgs,
|
|
3752
|
-
onProgress: opts.onProgress
|
|
3753
|
-
});
|
|
3754
|
-
if (fingerprint) {
|
|
3755
|
-
writePreparedDockerState2({ imageRef: ref, contextSha256: fingerprint.contextSha256 });
|
|
3756
|
-
}
|
|
3757
|
-
return { source: "built" };
|
|
3758
|
-
}
|
|
3759
|
-
async function ensureImage(ref = DEFAULT_BOX_IMAGE, opts = {}) {
|
|
3760
|
-
const { computeDockerContextFingerprint: computeDockerContextFingerprint2, readPreparedDockerState: readPreparedDockerState2, preparedMatches: preparedMatches2 } = await import("./prepared-state-75DIZ55S-TNJXWMXV.js");
|
|
3761
|
-
const claudeInstall = opts.claudeInstall ?? await resolveClaudeInstallMode();
|
|
3762
|
-
const rawFingerprint = await computeDockerContextFingerprint2({
|
|
3763
|
-
contextDir: opts.contextDir
|
|
3764
|
-
});
|
|
3765
|
-
const fingerprint = rawFingerprint ? {
|
|
3766
|
-
...rawFingerprint,
|
|
3767
|
-
contextSha256: claudeInstallFingerprint(rawFingerprint.contextSha256, claudeInstall)
|
|
3768
|
-
} : null;
|
|
3769
|
-
const prepared = readPreparedDockerState2();
|
|
3770
|
-
const exists = await imageExists(ref);
|
|
3771
|
-
let reason;
|
|
3772
|
-
if (!exists) {
|
|
3773
|
-
reason = `image ${ref} not present`;
|
|
3774
|
-
} else if (!fingerprint) {
|
|
3775
|
-
return { ref, built: false, reason: "image present (fingerprint skipped)" };
|
|
3776
|
-
} else if (!prepared) {
|
|
3777
|
-
reason = "no docker-prepared.json on disk";
|
|
3778
|
-
} else if (!preparedMatches2(prepared, fingerprint.contextSha256)) {
|
|
3779
|
-
reason = `build context changed (was ${prepared.base?.contextSha256?.slice(0, 12) ?? "<none>"}, now ${fingerprint.contextSha256.slice(0, 12)})`;
|
|
3780
|
-
}
|
|
3781
|
-
if (!reason) {
|
|
3782
|
-
return { ref, built: false, reason: "image up to date" };
|
|
3783
|
-
}
|
|
3784
|
-
opts.onProgress?.(`[image] ${ref}: ${reason}`);
|
|
3785
|
-
const npm = claudeInstall === "npm";
|
|
3786
|
-
const { source } = await pullOrBuild(ref, fingerprint, {
|
|
3787
|
-
onProgress: opts.onProgress,
|
|
3788
|
-
dockerfile: opts.dockerfile,
|
|
3789
|
-
contextDir: opts.contextDir,
|
|
3790
|
-
// npm mode pulls too. CI publishes both install variants, and `fingerprint`
|
|
3791
|
-
// is already folded with the mode above — so the pull asks for the npm
|
|
3792
|
-
// image's own tag and hits. (It used to be native-only, which meant npm
|
|
3793
|
-
// users rebuilt the image locally on every first create, forever.) A tag
|
|
3794
|
-
// that genuinely isn't published still falls back to a local build.
|
|
3795
|
-
allowPull: opts.allowPull,
|
|
3796
|
-
registry: opts.registry,
|
|
3797
|
-
buildArgs: npm ? { AGENTBOX_CLAUDE_INSTALL: "npm" } : void 0
|
|
3798
|
-
});
|
|
3799
|
-
return { ref, built: source === "built", reason };
|
|
3800
|
-
}
|
|
3801
|
-
function classifyDockerBaseFreshness(input) {
|
|
3802
|
-
if (!input.imagePresent) return { state: "unprepared" };
|
|
3803
|
-
if (!input.fingerprint) return { state: "unknown" };
|
|
3804
|
-
if (!input.stampedSha) return { state: "stale", reason: "no docker-prepared.json on disk" };
|
|
3805
|
-
if (input.stampedSha !== input.fingerprint) {
|
|
3806
|
-
return {
|
|
3807
|
-
state: "stale",
|
|
3808
|
-
reason: `build context changed (was ${input.stampedSha.slice(0, 12)}, now ${input.fingerprint.slice(0, 12)})`
|
|
3809
|
-
};
|
|
3666
|
+
return decodeURIComponent(s);
|
|
3667
|
+
} catch {
|
|
3668
|
+
return s;
|
|
3810
3669
|
}
|
|
3811
|
-
return { state: "fresh" };
|
|
3812
|
-
}
|
|
3813
|
-
async function evaluateDockerBaseFreshness(opts = {}) {
|
|
3814
|
-
const { computeDockerContextFingerprint: computeDockerContextFingerprint2, readPreparedDockerState: readPreparedDockerState2 } = await import("./prepared-state-75DIZ55S-TNJXWMXV.js");
|
|
3815
|
-
const ref = opts.ref ?? DEFAULT_BOX_IMAGE;
|
|
3816
|
-
const imagePresent = await imageExists(ref);
|
|
3817
|
-
if (!imagePresent) return { state: "unprepared" };
|
|
3818
|
-
const claudeInstall = opts.claudeInstall ?? await resolveClaudeInstallMode();
|
|
3819
|
-
const raw = await computeDockerContextFingerprint2({ contextDir: opts.contextDir });
|
|
3820
|
-
return classifyDockerBaseFreshness({
|
|
3821
|
-
imagePresent,
|
|
3822
|
-
fingerprint: raw ? claudeInstallFingerprint(raw.contextSha256, claudeInstall) : null,
|
|
3823
|
-
stampedSha: readPreparedDockerState2()?.base?.contextSha256 ?? null
|
|
3824
|
-
});
|
|
3825
|
-
}
|
|
3826
|
-
var SCHEMA = 1;
|
|
3827
|
-
function resolveContextFiles(opts = {}) {
|
|
3828
|
-
const ctx = opts.contextDir ?? BUILD_CONTEXT_DIR;
|
|
3829
|
-
const here2 = dirname23(fileURLToPath2(import.meta.url));
|
|
3830
|
-
const packageRoot = resolve23(here2, "..");
|
|
3831
|
-
return resolveContextFilesFrom(DOCKER_CONTEXT_FILE_MAP, {
|
|
3832
|
-
contextDir: ctx,
|
|
3833
|
-
devRoot: packageRoot
|
|
3834
|
-
});
|
|
3835
|
-
}
|
|
3836
|
-
async function computeDockerContextFingerprint(opts = {}) {
|
|
3837
|
-
const files = resolveContextFiles(opts);
|
|
3838
|
-
if (!files) return null;
|
|
3839
|
-
return { contextSha256: await computeContextSha256(files), files };
|
|
3840
|
-
}
|
|
3841
|
-
function readPreparedDockerState() {
|
|
3842
|
-
const raw = readPreparedStateRaw("docker");
|
|
3843
|
-
if (raw === null || typeof raw !== "object") return null;
|
|
3844
|
-
const parsed = raw;
|
|
3845
|
-
if (parsed.schema !== SCHEMA) return null;
|
|
3846
|
-
return { schema: SCHEMA, base: parsed.base };
|
|
3847
|
-
}
|
|
3848
|
-
function writePreparedDockerState(opts) {
|
|
3849
|
-
const stamp = readCliStamp();
|
|
3850
|
-
const state = {
|
|
3851
|
-
schema: SCHEMA,
|
|
3852
|
-
base: {
|
|
3853
|
-
imageRef: opts.imageRef ?? DEFAULT_BOX_IMAGE,
|
|
3854
|
-
contextSha256: opts.contextSha256,
|
|
3855
|
-
cliVersion: stamp.cliVersion,
|
|
3856
|
-
cliCommit: stamp.cliCommit,
|
|
3857
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
3858
|
-
}
|
|
3859
|
-
};
|
|
3860
|
-
writePreparedStateRaw("docker", state);
|
|
3861
3670
|
}
|
|
3862
|
-
function
|
|
3863
|
-
|
|
3671
|
+
function projectSlugFromOriginUrl(originUrl) {
|
|
3672
|
+
const parsed = ownerRepoFromOriginUrl(originUrl);
|
|
3673
|
+
if (!parsed) return null;
|
|
3674
|
+
const clean = (s) => s.replace(/[^A-Za-z0-9._-]/g, "-");
|
|
3675
|
+
return `${clean(parsed.owner)}__${clean(parsed.repo)}`;
|
|
3864
3676
|
}
|
|
3865
3677
|
|
|
3866
3678
|
export {
|
|
@@ -3919,6 +3731,7 @@ export {
|
|
|
3919
3731
|
waitForSsh,
|
|
3920
3732
|
SshTunnelManager,
|
|
3921
3733
|
defaultBoxSshDir,
|
|
3734
|
+
boxSshDirForProvider,
|
|
3922
3735
|
parseInboundSpec,
|
|
3923
3736
|
resolveInboundSources,
|
|
3924
3737
|
describeInbound,
|
|
@@ -4022,23 +3835,10 @@ export {
|
|
|
4022
3835
|
readCliStamp,
|
|
4023
3836
|
DOCKER_CONTEXT_FILE_MAP,
|
|
4024
3837
|
resolveContextFilesFrom,
|
|
3838
|
+
RUNTIME_ROOT_ENV,
|
|
3839
|
+
resolveStagedRuntimeRoot,
|
|
4025
3840
|
BOX_IMAGE_REGISTRY,
|
|
4026
3841
|
registryRefForSha,
|
|
4027
|
-
|
|
4028
|
-
DOCKERFILE_PATH,
|
|
4029
|
-
BUILD_CONTEXT_DIR,
|
|
4030
|
-
imageExists,
|
|
4031
|
-
pullImage,
|
|
4032
|
-
tagImage,
|
|
4033
|
-
imageInfo,
|
|
4034
|
-
pullOrBuild,
|
|
4035
|
-
ensureImage,
|
|
4036
|
-
classifyDockerBaseFreshness,
|
|
4037
|
-
evaluateDockerBaseFreshness,
|
|
4038
|
-
resolveContextFiles,
|
|
4039
|
-
computeDockerContextFingerprint,
|
|
4040
|
-
readPreparedDockerState,
|
|
4041
|
-
writePreparedDockerState,
|
|
4042
|
-
preparedMatches
|
|
3842
|
+
projectSlugFromOriginUrl
|
|
4043
3843
|
};
|
|
4044
|
-
//# sourceMappingURL=chunk-
|
|
3844
|
+
//# sourceMappingURL=chunk-PXYPQ5BO.js.map
|