@madarco/agentbox 0.21.0 → 0.22.1
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 +109 -0
- package/README.md +32 -0
- package/dist/{_cloud-attach-U3QJO7IF.js → _cloud-attach-YH2SU75S.js} +5 -4
- package/dist/chunk-ALEYDWAO.js +2561 -0
- package/dist/chunk-ALEYDWAO.js.map +1 -0
- package/dist/{chunk-QKL7PCXQ.js → chunk-CDEJ2GQK.js} +836 -488
- package/dist/chunk-CDEJ2GQK.js.map +1 -0
- package/dist/{chunk-PX7G4PSI.js → chunk-GGWVTWJM.js} +65 -34
- package/dist/{chunk-PX7G4PSI.js.map → chunk-GGWVTWJM.js.map} +1 -1
- package/dist/chunk-KBVD2UUQ.js +1654 -0
- package/dist/chunk-KBVD2UUQ.js.map +1 -0
- package/dist/{chunk-IXQTUXWV.js → chunk-O2NDZQHN.js} +50 -52
- package/dist/{chunk-IXQTUXWV.js.map → chunk-O2NDZQHN.js.map} +1 -1
- package/dist/{dist-NWKOEWUJ.js → chunk-O67ZESNL.js} +1059 -109
- package/dist/chunk-O67ZESNL.js.map +1 -0
- package/dist/chunk-VBSRJG53.js +1241 -0
- package/dist/chunk-VBSRJG53.js.map +1 -0
- package/dist/{chunk-6JJIKCMY.js → chunk-W2FLHB54.js} +26 -56
- package/dist/chunk-W2FLHB54.js.map +1 -0
- package/dist/{chunk-YZVFGFYQ.js → chunk-YZXXBHWG.js} +1937 -2975
- package/dist/chunk-YZXXBHWG.js.map +1 -0
- package/dist/{dist-SAS4PIHA.js → dist-EJXUKIR7.js} +41 -36
- package/dist/{dist-UVQJ2BZJ.js → dist-LJHS4PTC.js} +112 -62
- package/dist/dist-LJHS4PTC.js.map +1 -0
- package/dist/dist-QBXEP4VY.js +89 -0
- package/dist/dist-QNV4H6NN.js +80 -0
- package/dist/dist-QNV4H6NN.js.map +1 -0
- package/dist/{dist-FMA5Y25B.js → dist-UR2DB2HT.js} +83 -9
- package/dist/dist-UR2DB2HT.js.map +1 -0
- package/dist/dist-YECTRVGD.js +102 -0
- package/dist/dist-YECTRVGD.js.map +1 -0
- package/dist/index.js +3243 -1448
- package/dist/index.js.map +1 -1
- package/dist/{prepared-state-MQHD3M5F-YYVVMTNJ.js → prepared-state-5FIGV4BE-BMUK63FD.js} +2 -2
- package/dist/prepared-state-5FIGV4BE-BMUK63FD.js.map +1 -0
- package/package.json +12 -5
- package/runtime/_shared/agentbox-checkpoint-cleanup +55 -0
- package/runtime/_shared/agentbox-codex-hooks.json +68 -0
- package/runtime/_shared/agentbox-dockerd-start +145 -0
- package/runtime/_shared/agentbox-open +28 -0
- package/runtime/_shared/agentbox-portless-trust +82 -0
- package/runtime/_shared/agentbox-setup-skill.md +317 -0
- package/runtime/_shared/agentbox-vnc-start +102 -0
- package/runtime/_shared/claude-managed-settings.json +116 -0
- package/runtime/_shared/ctl.cjs +27469 -0
- package/runtime/_shared/gh-shim +344 -0
- package/runtime/_shared/git-shim +131 -0
- package/runtime/_shared/linear-shim +181 -0
- package/runtime/_shared/ntn-shim +95 -0
- package/runtime/_shared/opencode-agentbox-plugin.js +76 -0
- package/runtime/docker/Dockerfile.box +30 -17
- package/runtime/docker/packages/ctl/dist/bin.cjs +11871 -10351
- package/runtime/e2b/ctl.cjs +11871 -10351
- package/runtime/e2b/scripts/build-template.sh +31 -15
- package/runtime/hetzner/ctl.cjs +11871 -10351
- package/runtime/hetzner/scripts/install-box.sh +37 -19
- package/runtime/hub/apps/hub/.next/BUILD_ID +1 -0
- package/runtime/hub/apps/hub/.next/app-path-routes-manifest.json +36 -0
- package/runtime/hub/apps/hub/.next/build-manifest.json +21 -0
- package/runtime/hub/apps/hub/.next/package.json +1 -0
- package/runtime/hub/apps/hub/.next/prerender-manifest.json +36 -0
- package/runtime/hub/apps/hub/.next/required-server-files.json +350 -0
- package/runtime/hub/apps/hub/.next/routes-manifest.json +292 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js +13 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page/build-manifest.json +17 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page/next-font-manifest.json +13 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page/react-loadable-manifest.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page.js +14 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/events/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/events/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/events/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/events/route.js +7 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/events/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/events/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/events/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/jobs/[id]/logs/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/jobs/[id]/logs/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/jobs/[id]/logs/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/jobs/[id]/logs/route.js +7 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/jobs/[id]/logs/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/jobs/[id]/logs/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/jobs/[id]/logs/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/docs/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/docs/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/docs/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/docs/route.js +7 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/docs/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/docs/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/docs/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/openapi.json/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/openapi.json/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/openapi.json/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/openapi.json/route.js +7 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/openapi.json/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/openapi.json/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/openapi.json/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page/build-manifest.json +17 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page/next-font-manifest.json +13 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page/react-loadable-manifest.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page/server-reference-manifest.json +17 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js +17 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page/build-manifest.json +17 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page/next-font-manifest.json +13 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page/react-loadable-manifest.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page/server-reference-manifest.json +137 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js +17 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page/build-manifest.json +17 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page/next-font-manifest.json +13 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page/react-loadable-manifest.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page/server-reference-manifest.json +125 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js +17 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page/build-manifest.json +17 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page/next-font-manifest.json +13 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page/react-loadable-manifest.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page/server-reference-manifest.json +89 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js +17 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page/build-manifest.json +17 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page/next-font-manifest.json +13 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page/react-loadable-manifest.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js +16 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/[...path]/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/[...path]/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/[...path]/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js +8 -0
- package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/[...path]/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error/page/build-manifest.json +17 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error/page.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error/page.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error/page.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error/page_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error.meta +15 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +14 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +14 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +5 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +5 -0
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
- package/runtime/hub/apps/hub/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/_not-found/page/build-manifest.json +17 -0
- package/runtime/hub/apps/hub/.next/server/app/_not-found/page/next-font-manifest.json +13 -0
- package/runtime/hub/apps/hub/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/_not-found/page.js +13 -0
- package/runtime/hub/apps/hub/.next/server/app/_not-found/page.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/_not-found/page_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app-paths-manifest.json +36 -0
- package/runtime/hub/apps/hub/.next/server/chunks/01te_@better-auth_kysely-adapter_dist_0jw_ngm._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/01te_@better-auth_kysely-adapter_dist_0z6cvsk._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/01te_@better-auth_kysely-adapter_dist_210bxd8._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/01te_@better-auth_kysely-adapter_dist_index_mjs_0h-j5xt._.js +4 -0
- package/runtime/hub/apps/hub/.next/server/chunks/044u_hub__next-internal_server_app_(auth)_api_auth_[___all]_route_actions_1agi0ag.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/044u_hub__next-internal_server_app_(dashboard)_api_v1_boxes_route_actions_1ggp_5o.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/044u_hub__next-internal_server_app_(dashboard)_api_v1_health_route_actions_017gnzg.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/044u_hub__next-internal_server_app_(dashboard)_api_v1_projects_route_actions_04w8ozk.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/09mp_@better-auth_memory-adapter_dist_index_mjs_0ti_30h._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/09xn_next_0tn6frk._.js +6 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0d-b_next_dist_server_app-render_after-task-async-storage_external_0-exn7p.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0m4a_kysely_dist_095p8vu._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0m4a_kysely_dist_1skbhvx._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0sj1_@opentelemetry_api_build_esm_index_0xy-j06.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0ssw__next-internal_server_app_(dashboard)_api_jobs_[id]_logs_route_actions_01aqmf3.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0ssw__next-internal_server_app_(dashboard)_api_v1_approvals_route_actions_1vwxs9a.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0ssw__next-internal_server_app_(dashboard)_api_v1_boxes_[id]_route_actions_01510xg.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0ssw__next-internal_server_app_(dashboard)_api_v1_jobs_[id]_route_actions_0oc630h.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0ssw__next-internal_server_app_(dashboard)_api_v1_openapi_json_route_actions_1lunxjz.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0ssw__next-internal_server_app_(dashboard)_api_v1_providers_route_actions_1666ry8.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0web_next-internal_server_app_(dashboard)_api_v1_projects_[id]_route_actions_1beikpx.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0zhp_better-auth_dist_adapters_kysely-adapter_index_mjs_1rl4qnh._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/151__@better-auth_core_dist_0ecdp_3._.js +5 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_approvals_[id]_answer_route_actions_1cq4z5x.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_boxes_[id]_[action]_route_actions_0cib0ju.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_boxes_[id]_branches_route_actions_15snjix.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_boxes_[id]_git_[op]_route_actions_116a41w.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_boxes_[id]_git_route_actions_1a-q-i2.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_boxes_[id]_services_restart_route_actions_1yvsbmm.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_boxes_[id]_services_route_actions_1uvv36v.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_jobs_[id]_login-code_route_actions_1825jmw.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_jobs_[id]_logs_route_actions_0msc0_w.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_projects_[id]_branches_route_actions_07i0vrw.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_providers_[id]_credentials_route_actions_1cds5re.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_providers_[id]_prepare_route_actions_079fbng.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[externals]__12m3qoa._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[externals]_pg_15jfwkh._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04h15ml._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04jgk9x._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07ednlo._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +105 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ig1bot._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0keu6we._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ql4fjo._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0se1fty._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0t7o5ed._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vs8fma._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vxaujy._.js +6 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0w9ud8u._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yhb0gc._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-9g0ae._.js +461 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13jwk_k._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16_uteg._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16p2m-g._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19pc87s._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_gu2yk._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ai-945._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bqbkd5._.js +14 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bu2zio._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ctczev._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d6mtlk._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d75vsx._.js +6 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dn_3i1._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1e4z_-v._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1f2sueq._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1f9zctr._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hqla7-._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1js2jdv._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mttufy._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1nepkp-._.js +6 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1pp5oib._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q5bqse._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qa4a0v._.js +14 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qwhzmi._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1v9om6g._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1xeczo7._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20503l7._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[turbopack]_runtime.js +903 -0
- package/runtime/hub/apps/hub/.next/server/chunks/_033w048._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/_06f2faq._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/_0760z6y._.js +27 -0
- package/runtime/hub/apps/hub/.next/server/chunks/_0pyhcqe._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/_1-42ili._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/_11__3wi._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/_12flzuh._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/_1rpkqst._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/_1wt72m1._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/_1x3l5t8._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/apps_hub__next-internal_server_app_(dashboard)_api_events_route_actions_17s9lxs.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/apps_hub__next-internal_server_app_(dashboard)_api_v1_docs_route_actions_0d-s_oo.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/apps_hub__next-internal_server_app_[___path]_route_actions_1hdraye.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/packages_relay_dist_control-plane_03a-9aj.js +86 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/044u_hub__next-internal_server_app_(dashboard)_projects_[id]_page_actions_15f56np.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_0iwlo01._.js +6 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_0xy-j7z._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_client_components_20xzgz2._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_client_components_builtin_forbidden_1x5yo9-.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_client_components_builtin_global-error_14poel6.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_client_components_builtin_unauthorized_0vj9qge.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_010858m.js +4 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_04zwxnx.js +4 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_06exuc7.js +4 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2ldrt.js +4 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2tzep.js +4 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_116nh32.js +4 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_11dyjcb.js +4 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_1_4knli.js +4 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[externals]_pg_15jfwkh._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[externals]_pg_20c820g._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__03-x9xy._.js +19 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__08-1wwu._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0c9mbcn._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0cpdgd0._.js +33 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0gdfxj4._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0j0tjwn._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0kc-hwp._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0lu73p6._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__10bfmwi._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__18qvdzb._.js +33 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1bq2f8q._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1c1x9zr._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1he4k-q._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1l2urlw._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[turbopack]_runtime.js +903 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_04br1ft._.js +6 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_09gdzmo._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0kpdmm-._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ozyjt1._.js +21 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ro6vh6._.js +27 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0tgpglr._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_1laion6._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_0_lzzn3._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_0b_hsjl._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(auth)_signin_page_actions_1vmiwl7.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_approvals_page_actions_1mi0bpn.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_boxes_[id]_page_actions_0k7kgn2.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_page_actions_1t3u0xy.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_settings_page_actions_0ti7gxm.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app__global-error_page_actions_1ofuxm1.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app__not-found_page_actions_1fmdkci.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_[id]_page_tsx_1-j_972._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_components_box-table_tsx_0a9pyn_._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_components_1z1p98f._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_lib_auth_client_ts_1uxjxr_._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/node_modules__pnpm_04qfi10._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/node_modules__pnpm_0kvuy0s._.js +33 -0
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/packages_relay_dist_control-plane_0ve-wz4.js +80 -0
- package/runtime/hub/apps/hub/.next/server/functions-config-manifest.json +40 -0
- package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +21 -0
- package/runtime/hub/apps/hub/.next/server/middleware-manifest.json +6 -0
- package/runtime/hub/apps/hub/.next/server/middleware.js +5 -0
- package/runtime/hub/apps/hub/.next/server/next-font-manifest.js +1 -0
- package/runtime/hub/apps/hub/.next/server/next-font-manifest.json +49 -0
- package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -0
- package/runtime/hub/apps/hub/.next/server/pages-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/prefetch-hints.json +1 -0
- package/runtime/hub/apps/hub/.next/server/server-reference-manifest.js +1 -0
- package/runtime/hub/apps/hub/.next/server/server-reference-manifest.json +276 -0
- package/runtime/hub/apps/hub/.next/static/TpPTWVdZDxqrPlONtJcR5/_buildManifest.js +11 -0
- package/runtime/hub/apps/hub/.next/static/TpPTWVdZDxqrPlONtJcR5/_clientMiddlewareManifest.js +6 -0
- package/runtime/hub/apps/hub/.next/static/TpPTWVdZDxqrPlONtJcR5/_ssgManifest.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/0cz1d0mv5g_q7.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/0dx4alyqu7cq1.css +3 -0
- package/runtime/hub/apps/hub/.next/static/chunks/0lq354ziiwxxl.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/0ptag81psa0nj.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/11vmjdy3390ik.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/19cwkdx97a5_c.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/1svigjdfotduh.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/1t3645mc1s54c.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/1y49eldffr2-_.js +31 -0
- package/runtime/hub/apps/hub/.next/static/chunks/26ef4lcj-7-li.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/2d5e6t-5j4etp.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/2ozcn3ku69ymf.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/2w65a9zig6ya7.js +4 -0
- package/runtime/hub/apps/hub/.next/static/chunks/2x7nfpuaaba_a.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/3-zanu4ioia5i.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/3c49t4evjq8hf.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/3x8k7so-uoat8.js +2 -0
- package/runtime/hub/apps/hub/.next/static/chunks/3y2c7woqhtx9s.js +1 -0
- package/runtime/hub/apps/hub/.next/static/chunks/turbopack-2x4_cva4cco3h.js +1 -0
- package/runtime/hub/apps/hub/.next/static/media/02263ebadd758ea4-s.29yke99gs9qpn.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/03fc1b4a8d284b5e-s.p.0wiir8udbzjvx.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/1a69062cfe6f77f8-s.0o-3_g79811ob.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/1bcd0e671759a44c-s.2qt3tdwt-y9x_.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/23b7a97ae3b5c134-s.p.226pwps5o-gq_.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/2e95a7d252b9825a-s.15orukf5wyxb5.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/2fe89d53234c61d4-s.1u30mmyq6lnsd.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/57215795b8570f5c-s.2rixgazldzomk.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/59b15b4bcd7b1eb5-s.2vemzm0itqzfy.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/5e05ae5b48faa55e-s.1yd4_i3e35931.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/68757d6cddeff913-s.1i-sca43-qwng.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/6ff74e33ebd7bca3-s.352ti9pm7m6qh.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/7fea77d1d19108bf-s.2y65deuc30pmy.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/90c51ce8fb754fe8-s.02z5rrbg5nt92.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/99e609270109b47d-s.p.40sczeszzbjw1.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/9a4838fcda0d1bca-s.0ngr-xkgqz1kf.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/a7afbb44bec2bb18-s.1qc6dx89jd2qv.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/e15f58668ad64cb8-s.3cvcemwuzoywn.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/e390973e931a41c5-s.0rgnxg2b64rzs.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/e532fa1b9921e1cd-s.3cb5lpr2l6xud.woff2 +0 -0
- package/runtime/hub/apps/hub/.next/static/media/effe91970fc4db64-s.p.0oace-s_gkfks.woff2 +0 -0
- package/runtime/hub/apps/hub/auth-YBXDRLHG.js +75 -0
- package/runtime/hub/apps/hub/auth-config-LJGI76HI.js +21 -0
- package/runtime/hub/apps/hub/chunk-3LAHFDJF.js +287 -0
- package/runtime/hub/apps/hub/chunk-AKLBSCSZ.js +8573 -0
- package/runtime/hub/apps/hub/chunk-EFW34I43.js +7299 -0
- package/runtime/hub/apps/hub/chunk-JDA7BPPN.js +2806 -0
- package/runtime/hub/apps/hub/chunk-LJG4CEGS.js +3341 -0
- package/runtime/hub/apps/hub/chunk-OBKLTPIR.js +41 -0
- package/runtime/hub/apps/hub/chunk-OF242BLD.js +797 -0
- package/runtime/hub/apps/hub/chunk-TZFWAJVB.js +38 -0
- package/runtime/hub/apps/hub/chunk-V5KGFHCF.js +12683 -0
- package/runtime/hub/apps/hub/cloud-poller-SUNA6ZQC-VSKVMYHL.js +10 -0
- package/runtime/hub/apps/hub/dist-BF54UNHK.js +1029 -0
- package/runtime/hub/apps/hub/dist-CM4YAQLI.js +1656 -0
- package/runtime/hub/apps/hub/dist-ELOY2IUE.js +533 -0
- package/runtime/hub/apps/hub/dist-FDBOJ74K.js +1085 -0
- package/runtime/hub/apps/hub/dist-GGM4BUKM.js +2281 -0
- package/runtime/hub/apps/hub/dist-IENF7YOD.js +88 -0
- package/runtime/hub/apps/hub/execa-4DLVNM6E.js +32 -0
- package/runtime/hub/apps/hub/hub-token-EW32VDIU.js +25 -0
- package/runtime/hub/apps/hub/package.json +55 -0
- package/runtime/hub/apps/hub/prepared-state-5FIGV4BE-FIXKBF5A.js +19 -0
- package/runtime/hub/apps/hub/public/logo.svg +5 -0
- package/runtime/hub/apps/hub/server.js +838 -0
- package/runtime/relay/bin.cjs +1738 -482
- package/runtime/vercel/ctl.cjs +11871 -10351
- package/runtime/vercel/scripts/provision.sh +31 -15
- package/dist/chunk-6JJIKCMY.js.map +0 -1
- package/dist/chunk-DBMLOY3T.js +0 -793
- package/dist/chunk-DBMLOY3T.js.map +0 -1
- package/dist/chunk-KTEDFUKM.js +0 -831
- package/dist/chunk-KTEDFUKM.js.map +0 -1
- package/dist/chunk-QKL7PCXQ.js.map +0 -1
- package/dist/chunk-X2DWS4KS.js +0 -820
- package/dist/chunk-X2DWS4KS.js.map +0 -1
- package/dist/chunk-YZVFGFYQ.js.map +0 -1
- package/dist/dist-FMA5Y25B.js.map +0 -1
- package/dist/dist-NWKOEWUJ.js.map +0 -1
- package/dist/dist-U76JL6HI.js +0 -738
- package/dist/dist-U76JL6HI.js.map +0 -1
- package/dist/dist-UVQJ2BZJ.js.map +0 -1
- /package/dist/{_cloud-attach-U3QJO7IF.js.map → _cloud-attach-YH2SU75S.js.map} +0 -0
- /package/dist/{dist-SAS4PIHA.js.map → dist-EJXUKIR7.js.map} +0 -0
- /package/dist/{prepared-state-MQHD3M5F-YYVVMTNJ.js.map → dist-QBXEP4VY.js.map} +0 -0
|
@@ -0,0 +1,1656 @@
|
|
|
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
|
+
$e,
|
|
4
|
+
BD,
|
|
5
|
+
L,
|
|
6
|
+
de,
|
|
7
|
+
fe,
|
|
8
|
+
me,
|
|
9
|
+
ue,
|
|
10
|
+
v,
|
|
11
|
+
ve,
|
|
12
|
+
we,
|
|
13
|
+
ye
|
|
14
|
+
} from "./chunk-OF242BLD.js";
|
|
15
|
+
import {
|
|
16
|
+
createCloudProvider,
|
|
17
|
+
currentCloudBaseFingerprint,
|
|
18
|
+
hostTermForCloud,
|
|
19
|
+
listCloudCheckpoints,
|
|
20
|
+
removeCloudCheckpointDir,
|
|
21
|
+
renderInnerCommand,
|
|
22
|
+
resolveCloudCheckpoint,
|
|
23
|
+
writeCloudCheckpointManifest
|
|
24
|
+
} from "./chunk-JDA7BPPN.js";
|
|
25
|
+
import "./chunk-V5KGFHCF.js";
|
|
26
|
+
import "./chunk-AKLBSCSZ.js";
|
|
27
|
+
import "./chunk-3LAHFDJF.js";
|
|
28
|
+
import {
|
|
29
|
+
UserFacingError,
|
|
30
|
+
claudeInstallFingerprint,
|
|
31
|
+
computeContextSha256,
|
|
32
|
+
errSummary,
|
|
33
|
+
hostOpenCommand,
|
|
34
|
+
preparedStatePathFor,
|
|
35
|
+
readCliStamp,
|
|
36
|
+
readPreparedStateRaw,
|
|
37
|
+
recordBox,
|
|
38
|
+
stageClaudeStaticForUpload,
|
|
39
|
+
stageCodexStaticForUpload,
|
|
40
|
+
stageOpencodeStaticForUpload,
|
|
41
|
+
writeManagedSecrets,
|
|
42
|
+
writePreparedStateRaw
|
|
43
|
+
} from "./chunk-LJG4CEGS.js";
|
|
44
|
+
import {
|
|
45
|
+
execa
|
|
46
|
+
} from "./chunk-EFW34I43.js";
|
|
47
|
+
import "./chunk-TZFWAJVB.js";
|
|
48
|
+
|
|
49
|
+
// ../../packages/sandbox-vercel/dist/chunk-6SDDZRAG.js
|
|
50
|
+
import { existsSync, readFileSync } from "fs";
|
|
51
|
+
import { homedir } from "os";
|
|
52
|
+
import { resolve } from "path";
|
|
53
|
+
import { spawnSync } from "child_process";
|
|
54
|
+
import { homedir as homedir3 } from "os";
|
|
55
|
+
import { resolve as resolve2 } from "path";
|
|
56
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
|
|
57
|
+
import { homedir as homedir2 } from "os";
|
|
58
|
+
import { join } from "path";
|
|
59
|
+
import { Sandbox, Snapshot } from "@vercel/sandbox";
|
|
60
|
+
import { existsSync as existsSync3 } from "fs";
|
|
61
|
+
import { dirname, resolve as resolve3 } from "path";
|
|
62
|
+
import { fileURLToPath } from "url";
|
|
63
|
+
var VERCEL_KEYS = [
|
|
64
|
+
"VERCEL_OIDC_TOKEN",
|
|
65
|
+
"VERCEL_TOKEN",
|
|
66
|
+
"VERCEL_TEAM_ID",
|
|
67
|
+
"VERCEL_PROJECT_ID",
|
|
68
|
+
// Marker for CLI-login mode (`agentbox vercel login` → `sandbox login`). The
|
|
69
|
+
// access token is NOT stored here — it's read live from the Vercel CLI store;
|
|
70
|
+
// only this marker + team/project ids are persisted.
|
|
71
|
+
"VERCEL_AUTH_SOURCE"
|
|
72
|
+
];
|
|
73
|
+
var loaded = false;
|
|
74
|
+
function ensureVercelEnvLoaded() {
|
|
75
|
+
if (loaded) return;
|
|
76
|
+
loaded = true;
|
|
77
|
+
importVercelFromFile(resolve(homedir(), ".agentbox", "secrets.env"), VERCEL_KEYS);
|
|
78
|
+
}
|
|
79
|
+
function reloadVercelEnv() {
|
|
80
|
+
loaded = false;
|
|
81
|
+
ensureVercelEnvLoaded();
|
|
82
|
+
}
|
|
83
|
+
function importVercelFromFile(path, keys) {
|
|
84
|
+
if (!existsSync(path)) return;
|
|
85
|
+
let body;
|
|
86
|
+
try {
|
|
87
|
+
body = readFileSync(path, "utf8");
|
|
88
|
+
} catch {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const parsed = parseEnvFile(body);
|
|
92
|
+
for (const key of keys) {
|
|
93
|
+
if (process.env[key] !== void 0) continue;
|
|
94
|
+
const value = parsed[key];
|
|
95
|
+
if (typeof value === "string") {
|
|
96
|
+
process.env[key] = value;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function parseEnvFile(body) {
|
|
101
|
+
const out = {};
|
|
102
|
+
for (const rawLine of body.split(/\r?\n/)) {
|
|
103
|
+
const line = rawLine.trim();
|
|
104
|
+
if (line.length === 0 || line.startsWith("#")) continue;
|
|
105
|
+
const stripped = line.startsWith("export ") ? line.slice("export ".length) : line;
|
|
106
|
+
const eq = stripped.indexOf("=");
|
|
107
|
+
if (eq <= 0) continue;
|
|
108
|
+
const key = stripped.slice(0, eq).trim();
|
|
109
|
+
let value = stripped.slice(eq + 1).trim();
|
|
110
|
+
if (value.length >= 2 && (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'"))) {
|
|
111
|
+
value = value.slice(1, -1);
|
|
112
|
+
}
|
|
113
|
+
out[key] = value;
|
|
114
|
+
}
|
|
115
|
+
return out;
|
|
116
|
+
}
|
|
117
|
+
var SBX_BINS = ["sbx", "sandbox"];
|
|
118
|
+
var cached = null;
|
|
119
|
+
async function detectSbx() {
|
|
120
|
+
if (cached !== null) return cached;
|
|
121
|
+
for (const bin of SBX_BINS) {
|
|
122
|
+
try {
|
|
123
|
+
const r = await execa(bin, ["--version"], { reject: false });
|
|
124
|
+
if (r.exitCode === 0) {
|
|
125
|
+
cached = { installed: true, bin, version: (r.stdout ?? "").trim() || void 0 };
|
|
126
|
+
return cached;
|
|
127
|
+
}
|
|
128
|
+
} catch {
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
cached = { installed: false };
|
|
132
|
+
return cached;
|
|
133
|
+
}
|
|
134
|
+
function resetSbxCache() {
|
|
135
|
+
cached = null;
|
|
136
|
+
}
|
|
137
|
+
function installSbxHint() {
|
|
138
|
+
return "npm install -g sandbox";
|
|
139
|
+
}
|
|
140
|
+
async function installSbx() {
|
|
141
|
+
try {
|
|
142
|
+
const r = await execa("npm", ["install", "-g", "sandbox"], { reject: false });
|
|
143
|
+
return r.exitCode === 0;
|
|
144
|
+
} catch {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function loginSbx(bin) {
|
|
149
|
+
const r = spawnSync(bin, ["login"], { stdio: "inherit" });
|
|
150
|
+
return r.status ?? 1;
|
|
151
|
+
}
|
|
152
|
+
async function refreshSbxToken(bin) {
|
|
153
|
+
try {
|
|
154
|
+
const r = await execa(bin, ["list"], {
|
|
155
|
+
reject: false,
|
|
156
|
+
timeout: 3e4,
|
|
157
|
+
stdin: "ignore"
|
|
158
|
+
});
|
|
159
|
+
return r.exitCode === 0;
|
|
160
|
+
} catch {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
var API = "https://api.vercel.com";
|
|
165
|
+
var VercelApiError = class extends Error {
|
|
166
|
+
constructor(status, message) {
|
|
167
|
+
super(message);
|
|
168
|
+
this.status = status;
|
|
169
|
+
this.name = "VercelApiError";
|
|
170
|
+
}
|
|
171
|
+
status;
|
|
172
|
+
};
|
|
173
|
+
async function api(token, path, init) {
|
|
174
|
+
const res = await fetch(`${API}${path}`, {
|
|
175
|
+
method: init?.method ?? "GET",
|
|
176
|
+
headers: {
|
|
177
|
+
Authorization: `Bearer ${token}`,
|
|
178
|
+
...init?.body ? { "Content-Type": "application/json" } : {}
|
|
179
|
+
},
|
|
180
|
+
body: init?.body ? JSON.stringify(init.body) : void 0
|
|
181
|
+
});
|
|
182
|
+
const text2 = await res.text();
|
|
183
|
+
let json = null;
|
|
184
|
+
try {
|
|
185
|
+
json = text2 ? JSON.parse(text2) : null;
|
|
186
|
+
} catch {
|
|
187
|
+
json = null;
|
|
188
|
+
}
|
|
189
|
+
if (!res.ok) {
|
|
190
|
+
const detail = json?.error?.message ?? text2 ?? res.statusText;
|
|
191
|
+
throw new VercelApiError(res.status, `Vercel API ${res.status}: ${detail}`);
|
|
192
|
+
}
|
|
193
|
+
return json;
|
|
194
|
+
}
|
|
195
|
+
async function getUser(token) {
|
|
196
|
+
const json = await api(token, "/v2/user");
|
|
197
|
+
const user = json.user;
|
|
198
|
+
if (!user?.id) throw new Error("Vercel /v2/user returned no user");
|
|
199
|
+
return user;
|
|
200
|
+
}
|
|
201
|
+
async function listProjects(token, teamId, limit = 100) {
|
|
202
|
+
const json = await api(
|
|
203
|
+
token,
|
|
204
|
+
`/v9/projects?teamId=${encodeURIComponent(teamId)}&limit=${limit}`
|
|
205
|
+
);
|
|
206
|
+
return (json.projects ?? []).map((p) => ({ id: p.id, name: p.name }));
|
|
207
|
+
}
|
|
208
|
+
async function createProject(token, teamId, name) {
|
|
209
|
+
try {
|
|
210
|
+
const json = await api(token, `/v9/projects?teamId=${encodeURIComponent(teamId)}`, {
|
|
211
|
+
method: "POST",
|
|
212
|
+
body: { name }
|
|
213
|
+
});
|
|
214
|
+
return { id: json.id, name: json.name };
|
|
215
|
+
} catch (err) {
|
|
216
|
+
if (err instanceof VercelApiError && err.status === 409) {
|
|
217
|
+
const existing = (await listProjects(token, teamId)).find((p) => p.name === name);
|
|
218
|
+
if (existing) return existing;
|
|
219
|
+
}
|
|
220
|
+
throw err;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function withTeam(path, teamId) {
|
|
224
|
+
if (!teamId) return path;
|
|
225
|
+
return `${path}${path.includes("?") ? "&" : "?"}teamId=${encodeURIComponent(teamId)}`;
|
|
226
|
+
}
|
|
227
|
+
async function getProject(token, teamId, idOrName) {
|
|
228
|
+
try {
|
|
229
|
+
return await api(token, withTeam(`/v9/projects/${encodeURIComponent(idOrName)}`, teamId));
|
|
230
|
+
} catch (err) {
|
|
231
|
+
if (err instanceof VercelApiError && err.status === 404) return null;
|
|
232
|
+
throw err;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
async function createGitProject(token, teamId, input) {
|
|
236
|
+
return await api(token, withTeam("/v11/projects", teamId), {
|
|
237
|
+
method: "POST",
|
|
238
|
+
body: {
|
|
239
|
+
name: input.name,
|
|
240
|
+
framework: input.framework ?? "nextjs",
|
|
241
|
+
rootDirectory: input.rootDirectory,
|
|
242
|
+
gitRepository: { type: "github", repo: input.repo }
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
async function deleteProject(token, teamId, idOrName) {
|
|
247
|
+
await api(token, withTeam(`/v9/projects/${encodeURIComponent(idOrName)}`, teamId), { method: "DELETE" });
|
|
248
|
+
}
|
|
249
|
+
async function patchProjectSettings(token, teamId, idOrName, settings) {
|
|
250
|
+
await api(token, withTeam(`/v9/projects/${encodeURIComponent(idOrName)}`, teamId), {
|
|
251
|
+
method: "PATCH",
|
|
252
|
+
body: settings
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
async function upsertProjectEnv(token, teamId, idOrName, vars) {
|
|
256
|
+
await api(token, withTeam(`/v10/projects/${encodeURIComponent(idOrName)}/env?upsert=true`, teamId), {
|
|
257
|
+
method: "POST",
|
|
258
|
+
body: vars.map((v2) => ({
|
|
259
|
+
key: v2.key,
|
|
260
|
+
value: v2.value,
|
|
261
|
+
type: v2.type ?? "encrypted",
|
|
262
|
+
target: v2.target ?? ["production"]
|
|
263
|
+
}))
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
async function projectHasEnv(token, teamId, idOrName, key) {
|
|
267
|
+
const r = await api(token, withTeam(`/v9/projects/${encodeURIComponent(idOrName)}/env`, teamId));
|
|
268
|
+
return (r.envs ?? []).some((e) => e.key === key);
|
|
269
|
+
}
|
|
270
|
+
async function createGitDeployment(token, teamId, input) {
|
|
271
|
+
const res = await api(token, withTeam("/v13/deployments?skipAutoDetectionConfirmation=1", teamId), {
|
|
272
|
+
method: "POST",
|
|
273
|
+
body: {
|
|
274
|
+
name: input.name,
|
|
275
|
+
project: input.projectId,
|
|
276
|
+
target: "production",
|
|
277
|
+
gitSource: { type: "github", org: input.owner, repo: input.repo, ref: input.ref }
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
if (!res.id) throw new Error("Vercel deployment create returned no id");
|
|
281
|
+
return { id: res.id, url: res.url };
|
|
282
|
+
}
|
|
283
|
+
async function getDeployment(token, teamId, id) {
|
|
284
|
+
const d = await api(token, withTeam(`/v13/deployments/${encodeURIComponent(id)}`, teamId));
|
|
285
|
+
return {
|
|
286
|
+
readyState: d.readyState ?? d.status ?? "UNKNOWN",
|
|
287
|
+
url: d.url,
|
|
288
|
+
aliasFinal: d.aliasFinal,
|
|
289
|
+
alias: d.alias,
|
|
290
|
+
errorMessage: d.errorMessage,
|
|
291
|
+
errorStep: d.errorStep
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
async function getProductionAlias(token, teamId, idOrName) {
|
|
295
|
+
const p = await getProject(token, teamId, idOrName);
|
|
296
|
+
const aliases = p?.targets?.production?.alias;
|
|
297
|
+
return Array.isArray(aliases) && aliases.length > 0 ? aliases[0] : null;
|
|
298
|
+
}
|
|
299
|
+
function vercelCliDir() {
|
|
300
|
+
const override = process.env.AGENTBOX_VERCEL_CLI_DIR;
|
|
301
|
+
if (override && override.trim().length > 0) return override.trim();
|
|
302
|
+
const name = "com.vercel.cli";
|
|
303
|
+
if (process.platform === "darwin") {
|
|
304
|
+
return join(homedir2(), "Library", "Application Support", name);
|
|
305
|
+
}
|
|
306
|
+
if (process.platform === "win32") {
|
|
307
|
+
const appData = process.env.APPDATA;
|
|
308
|
+
if (appData && appData.trim().length > 0) return join(appData, name);
|
|
309
|
+
return join(homedir2(), "AppData", "Roaming", name);
|
|
310
|
+
}
|
|
311
|
+
const xdg = process.env.XDG_DATA_HOME;
|
|
312
|
+
const base = xdg && xdg.trim().length > 0 ? xdg.trim() : join(homedir2(), ".local", "share");
|
|
313
|
+
return join(base, name);
|
|
314
|
+
}
|
|
315
|
+
function cliStorePaths() {
|
|
316
|
+
const dir = vercelCliDir();
|
|
317
|
+
return { authPath: join(dir, "auth.json"), configPath: join(dir, "config.json") };
|
|
318
|
+
}
|
|
319
|
+
function readJson(path) {
|
|
320
|
+
if (!existsSync2(path)) return null;
|
|
321
|
+
try {
|
|
322
|
+
return JSON.parse(readFileSync2(path, "utf8"));
|
|
323
|
+
} catch {
|
|
324
|
+
return null;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
function readCliAuth() {
|
|
328
|
+
const raw = readJson(cliStorePaths().authPath);
|
|
329
|
+
if (!raw || typeof raw.token !== "string" || raw.token.length === 0) return null;
|
|
330
|
+
return {
|
|
331
|
+
token: raw.token,
|
|
332
|
+
expiresAt: typeof raw.expiresAt === "number" ? raw.expiresAt : void 0,
|
|
333
|
+
refreshToken: typeof raw.refreshToken === "string" ? raw.refreshToken : void 0
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
function readCliCurrentTeam() {
|
|
337
|
+
const raw = readJson(cliStorePaths().configPath);
|
|
338
|
+
return raw && typeof raw.currentTeam === "string" && raw.currentTeam.length > 0 ? raw.currentTeam : null;
|
|
339
|
+
}
|
|
340
|
+
function isNearExpiry(auth, skewSec = 120) {
|
|
341
|
+
if (auth.expiresAt === void 0) return true;
|
|
342
|
+
return auth.expiresAt * 1e3 < Date.now() + skewSec * 1e3;
|
|
343
|
+
}
|
|
344
|
+
function resolveCredentials() {
|
|
345
|
+
ensureVercelEnvLoaded();
|
|
346
|
+
const oidc = process.env.VERCEL_OIDC_TOKEN;
|
|
347
|
+
if (oidc) {
|
|
348
|
+
const claims = decodeOidcClaims(oidc);
|
|
349
|
+
if (!claims) {
|
|
350
|
+
throw new Error(
|
|
351
|
+
"VERCEL_OIDC_TOKEN is set but could not be decoded (not a valid Vercel OIDC JWT). Re-run `vercel env pull`, or use the VERCEL_TOKEN + VERCEL_TEAM_ID + VERCEL_PROJECT_ID trio."
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
if (claims.exp !== void 0 && claims.exp * 1e3 < Date.now()) {
|
|
355
|
+
throw new Error(
|
|
356
|
+
"VERCEL_OIDC_TOKEN has expired (Vercel dev OIDC tokens last ~12h). Re-run `vercel env pull` to refresh it, then retry."
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
return { token: oidc, teamId: claims.teamId, projectId: claims.projectId };
|
|
360
|
+
}
|
|
361
|
+
if (process.env.VERCEL_AUTH_SOURCE === "cli") {
|
|
362
|
+
const auth = readCliAuth();
|
|
363
|
+
if (!auth) {
|
|
364
|
+
throw new Error(
|
|
365
|
+
"Vercel CLI session not found \u2014 run `agentbox vercel login` (or `sbx login`) to sign in again."
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
const teamId2 = process.env.VERCEL_TEAM_ID ?? readCliCurrentTeam() ?? void 0;
|
|
369
|
+
const projectId2 = process.env.VERCEL_PROJECT_ID;
|
|
370
|
+
if (!teamId2 || !projectId2) {
|
|
371
|
+
throw new Error(
|
|
372
|
+
"Vercel CLI auth is missing the team/project id \u2014 re-run `agentbox vercel login`."
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
return { token: auth.token, teamId: teamId2, projectId: projectId2 };
|
|
376
|
+
}
|
|
377
|
+
const token = process.env.VERCEL_TOKEN;
|
|
378
|
+
const teamId = process.env.VERCEL_TEAM_ID;
|
|
379
|
+
const projectId = process.env.VERCEL_PROJECT_ID;
|
|
380
|
+
if (token && teamId && projectId) return { token, teamId, projectId };
|
|
381
|
+
throw new Error(
|
|
382
|
+
"Vercel credentials not configured.\nEither run `vercel link && vercel env pull` to get a VERCEL_OIDC_TOKEN, or set VERCEL_TOKEN + VERCEL_TEAM_ID + VERCEL_PROJECT_ID (see `agentbox vercel login`)."
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
function decodeOidcClaims(token) {
|
|
386
|
+
const parts = token.split(".");
|
|
387
|
+
if (parts.length < 2 || !parts[1]) return null;
|
|
388
|
+
try {
|
|
389
|
+
const payload = JSON.parse(Buffer.from(parts[1], "base64url").toString("utf8"));
|
|
390
|
+
if (typeof payload.owner_id !== "string" || typeof payload.project_id !== "string") return null;
|
|
391
|
+
return {
|
|
392
|
+
teamId: payload.owner_id,
|
|
393
|
+
projectId: payload.project_id,
|
|
394
|
+
exp: typeof payload.exp === "number" ? payload.exp : void 0
|
|
395
|
+
};
|
|
396
|
+
} catch {
|
|
397
|
+
return null;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
function hasUsableCredentials() {
|
|
401
|
+
ensureVercelEnvLoaded();
|
|
402
|
+
if (process.env.VERCEL_OIDC_TOKEN) return true;
|
|
403
|
+
if (process.env.VERCEL_AUTH_SOURCE === "cli" && process.env.VERCEL_TEAM_ID && process.env.VERCEL_PROJECT_ID && readCliAuth()) {
|
|
404
|
+
return true;
|
|
405
|
+
}
|
|
406
|
+
return Boolean(
|
|
407
|
+
process.env.VERCEL_TOKEN && process.env.VERCEL_TEAM_ID && process.env.VERCEL_PROJECT_ID
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
var inflightRefresh = null;
|
|
411
|
+
function ensureFreshCredentials() {
|
|
412
|
+
ensureVercelEnvLoaded();
|
|
413
|
+
if (process.env.VERCEL_AUTH_SOURCE !== "cli") return Promise.resolve();
|
|
414
|
+
if (inflightRefresh) return inflightRefresh;
|
|
415
|
+
inflightRefresh = refreshCliToken().finally(() => {
|
|
416
|
+
inflightRefresh = null;
|
|
417
|
+
});
|
|
418
|
+
return inflightRefresh;
|
|
419
|
+
}
|
|
420
|
+
async function refreshCliToken() {
|
|
421
|
+
const auth = readCliAuth();
|
|
422
|
+
if (!auth) return;
|
|
423
|
+
if (!isNearExpiry(auth)) return;
|
|
424
|
+
const det = await detectSbx();
|
|
425
|
+
if (!det.installed || !det.bin) {
|
|
426
|
+
throw new Error(
|
|
427
|
+
"Vercel access token is near expiry and the `sandbox` CLI is no longer installed \u2014 reinstall it (`npm install -g sandbox`) or run `agentbox vercel login`."
|
|
428
|
+
);
|
|
429
|
+
}
|
|
430
|
+
const ok = await refreshSbxToken(det.bin);
|
|
431
|
+
if (!ok) {
|
|
432
|
+
throw new Error(
|
|
433
|
+
"Vercel token refresh failed \u2014 run `agentbox vercel login` (the refresh token may have expired)."
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
const fresh = readCliAuth();
|
|
437
|
+
if (!fresh || isNearExpiry(fresh, 0)) {
|
|
438
|
+
throw new Error(
|
|
439
|
+
"Vercel token is still stale after a refresh attempt \u2014 run `agentbox vercel login`."
|
|
440
|
+
);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
function exitOnCancel(v2) {
|
|
444
|
+
if (BD(v2)) {
|
|
445
|
+
ve("Cancelled.");
|
|
446
|
+
process.exit(130);
|
|
447
|
+
}
|
|
448
|
+
return v2;
|
|
449
|
+
}
|
|
450
|
+
var DASHBOARD_TOKENS_URL = "https://vercel.com/account/settings/tokens";
|
|
451
|
+
var MANAGED_KEYS = [
|
|
452
|
+
"VERCEL_OIDC_TOKEN",
|
|
453
|
+
"VERCEL_TOKEN",
|
|
454
|
+
"VERCEL_TEAM_ID",
|
|
455
|
+
"VERCEL_PROJECT_ID",
|
|
456
|
+
"VERCEL_AUTH_SOURCE"
|
|
457
|
+
];
|
|
458
|
+
async function ensureVercelCredentials(opts = {}) {
|
|
459
|
+
ensureVercelEnvLoaded();
|
|
460
|
+
if (!opts.force && hasUsableCredentials()) return;
|
|
461
|
+
if (!process.stdin.isTTY) return;
|
|
462
|
+
we("Vercel setup");
|
|
463
|
+
ye(
|
|
464
|
+
`AgentBox needs Vercel credentials to provision sandboxes.
|
|
465
|
+
Sign in with Vercel (recommended): drives the Vercel \`sandbox\` CLI through a browser login, then reads the token from the CLI's own store and keeps it fresh \u2014 no token to paste.
|
|
466
|
+
Access token (best for CI / headless): personal access token + team id + project id, saved to \`~/.agentbox/secrets.env\`.
|
|
467
|
+
OIDC (short interactive work): export VERCEL_OIDC_TOKEN in your shell or add it to \`~/.agentbox/secrets.env\` (dev token expires ~12h, no headless refresh).`,
|
|
468
|
+
"Credentials required"
|
|
469
|
+
);
|
|
470
|
+
const mode = exitOnCancel(
|
|
471
|
+
await de({
|
|
472
|
+
message: "How do you want to authenticate?",
|
|
473
|
+
options: [
|
|
474
|
+
{ value: "cli", label: "Sign in with Vercel (browser) \u2014 recommended for interactive use" },
|
|
475
|
+
{ value: "token", label: "Access token (VERCEL_TOKEN + team + project) \u2014 best for CI / headless" },
|
|
476
|
+
{ value: "oidc", label: "OIDC token (VERCEL_OIDC_TOKEN in env / secrets.env) \u2014 short interactive work" }
|
|
477
|
+
],
|
|
478
|
+
initialValue: "cli"
|
|
479
|
+
})
|
|
480
|
+
);
|
|
481
|
+
if (mode === "cli") {
|
|
482
|
+
await runCliLogin();
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
if (mode === "oidc") {
|
|
486
|
+
ye(
|
|
487
|
+
`Get an OIDC token with \`vercel link\` then \`vercel env pull\`, then make it visible to AgentBox by either:
|
|
488
|
+
export VERCEL_OIDC_TOKEN=<token> # in this shell
|
|
489
|
+
echo "VERCEL_OIDC_TOKEN=<token>" >> ~/.agentbox/secrets.env
|
|
490
|
+
Re-do every ~12h; the dev token expires. AgentBox does not harvest .env.local.`,
|
|
491
|
+
"OIDC setup"
|
|
492
|
+
);
|
|
493
|
+
reloadVercelEnv();
|
|
494
|
+
if (process.env.VERCEL_OIDC_TOKEN) {
|
|
495
|
+
v.success("Found VERCEL_OIDC_TOKEN \u2014 Vercel is configured.");
|
|
496
|
+
await ensureSbxInstalled();
|
|
497
|
+
fe("Setup complete.");
|
|
498
|
+
} else {
|
|
499
|
+
v.warn("No VERCEL_OIDC_TOKEN found yet \u2014 set it as above, then re-run `agentbox vercel login`.");
|
|
500
|
+
}
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
const creds2 = await promptForTokenTrio();
|
|
504
|
+
persistCredentials(creds2);
|
|
505
|
+
v.success(`Vercel credentials saved to ${secretsPath()}`);
|
|
506
|
+
await ensureSbxInstalled();
|
|
507
|
+
fe("Setup complete.");
|
|
508
|
+
}
|
|
509
|
+
async function promptForTokenTrio() {
|
|
510
|
+
const openIt = exitOnCancel(
|
|
511
|
+
await me({
|
|
512
|
+
message: `Open ${DASHBOARD_TOKENS_URL} to create a token?`,
|
|
513
|
+
initialValue: true
|
|
514
|
+
})
|
|
515
|
+
);
|
|
516
|
+
if (openIt) openDashboard();
|
|
517
|
+
const token = exitOnCancel(
|
|
518
|
+
await $e({
|
|
519
|
+
message: "Paste your Vercel access token",
|
|
520
|
+
validate: (v2) => v2 && v2.trim().length > 0 ? void 0 : "Cannot be empty"
|
|
521
|
+
})
|
|
522
|
+
);
|
|
523
|
+
const teamId = exitOnCancel(
|
|
524
|
+
await ue({
|
|
525
|
+
message: "Team ID (team settings \u2192 General)",
|
|
526
|
+
placeholder: "team_...",
|
|
527
|
+
validate: (v2) => v2 && v2.trim().length > 0 ? void 0 : "Cannot be empty"
|
|
528
|
+
})
|
|
529
|
+
);
|
|
530
|
+
const projectId = exitOnCancel(
|
|
531
|
+
await ue({
|
|
532
|
+
message: "Project ID (project settings \u2192 General)",
|
|
533
|
+
placeholder: "prj_...",
|
|
534
|
+
validate: (v2) => v2 && v2.trim().length > 0 ? void 0 : "Cannot be empty"
|
|
535
|
+
})
|
|
536
|
+
);
|
|
537
|
+
return { token: token.trim(), teamId: teamId.trim(), projectId: projectId.trim() };
|
|
538
|
+
}
|
|
539
|
+
function persistCredentials(creds2) {
|
|
540
|
+
writeManaged({
|
|
541
|
+
VERCEL_TOKEN: creds2.token,
|
|
542
|
+
VERCEL_TEAM_ID: creds2.teamId,
|
|
543
|
+
VERCEL_PROJECT_ID: creds2.projectId
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
function persistCliCredentials(ids) {
|
|
547
|
+
writeManaged({
|
|
548
|
+
VERCEL_AUTH_SOURCE: "cli",
|
|
549
|
+
VERCEL_TEAM_ID: ids.teamId,
|
|
550
|
+
VERCEL_PROJECT_ID: ids.projectId
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
function writeManaged(record) {
|
|
554
|
+
writeManagedSecrets(MANAGED_KEYS, record);
|
|
555
|
+
}
|
|
556
|
+
async function setVercelCredentials(fields) {
|
|
557
|
+
ensureVercelEnvLoaded();
|
|
558
|
+
const token = (fields.token ?? "").trim();
|
|
559
|
+
const projectId = (fields.projectId ?? "").trim() || void 0;
|
|
560
|
+
let teamId = (fields.teamId ?? "").trim() || void 0;
|
|
561
|
+
if (!token) {
|
|
562
|
+
return { ok: false, error: "token is required", status: { configured: false } };
|
|
563
|
+
}
|
|
564
|
+
try {
|
|
565
|
+
const user = await getUser(token);
|
|
566
|
+
if (!teamId) teamId = user.defaultTeamId;
|
|
567
|
+
} catch (err) {
|
|
568
|
+
return {
|
|
569
|
+
ok: false,
|
|
570
|
+
error: `token rejected by Vercel: ${err instanceof Error ? err.message : String(err)}`,
|
|
571
|
+
status: { configured: false }
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
if (!teamId) {
|
|
575
|
+
return {
|
|
576
|
+
ok: false,
|
|
577
|
+
error: "could not determine a Vercel team \u2014 provide teamId",
|
|
578
|
+
status: { configured: false }
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
const record = { VERCEL_TOKEN: token, VERCEL_TEAM_ID: teamId };
|
|
582
|
+
if (projectId) record.VERCEL_PROJECT_ID = projectId;
|
|
583
|
+
writeManaged(record);
|
|
584
|
+
return {
|
|
585
|
+
ok: true,
|
|
586
|
+
status: { configured: true, label: projectId ? "token" : "token (no project)" }
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
async function ensureSbxInstalled() {
|
|
590
|
+
let det = await detectSbx();
|
|
591
|
+
if (!det.installed) {
|
|
592
|
+
const doInstall = exitOnCancel(
|
|
593
|
+
await me({
|
|
594
|
+
message: `The Vercel sandbox CLI (needed for interactive attach) isn't installed. Install it now? (${installSbxHint()})`,
|
|
595
|
+
initialValue: true
|
|
596
|
+
})
|
|
597
|
+
);
|
|
598
|
+
if (!doInstall) {
|
|
599
|
+
v.warn(
|
|
600
|
+
`Install it with \`${installSbxHint()}\` to use \`agentbox shell|claude|codex|opencode\` on Vercel boxes.`
|
|
601
|
+
);
|
|
602
|
+
return null;
|
|
603
|
+
}
|
|
604
|
+
const sp = L();
|
|
605
|
+
sp.start("Installing the Vercel sandbox CLI\u2026");
|
|
606
|
+
const ok = await installSbx();
|
|
607
|
+
resetSbxCache();
|
|
608
|
+
det = await detectSbx();
|
|
609
|
+
if (!ok || !det.installed || !det.bin) {
|
|
610
|
+
sp.stop("Install failed.");
|
|
611
|
+
v.warn(`Could not install the sandbox CLI \u2014 run \`${installSbxHint()}\` manually.`);
|
|
612
|
+
return null;
|
|
613
|
+
}
|
|
614
|
+
sp.stop(`Installed sandbox CLI${det.version ? ` ${det.version}` : ""}.`);
|
|
615
|
+
}
|
|
616
|
+
return det.bin ? { bin: det.bin } : null;
|
|
617
|
+
}
|
|
618
|
+
async function runCliLogin() {
|
|
619
|
+
const det = await ensureSbxInstalled();
|
|
620
|
+
if (!det) {
|
|
621
|
+
v.warn("The Vercel sandbox CLI is required to sign in this way \u2014 install it, then re-run `agentbox vercel login`.");
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
ye("A browser window will open to sign in to Vercel.", "Vercel sign-in");
|
|
625
|
+
const status = loginSbx(det.bin);
|
|
626
|
+
if (status !== 0) {
|
|
627
|
+
v.warn("Vercel sign-in did not complete \u2014 re-run `agentbox vercel login` to try again.");
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
const auth = readCliAuth();
|
|
631
|
+
if (!auth) {
|
|
632
|
+
v.warn("Sign-in finished but no access token was found in the Vercel CLI store. Try again.");
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
let user;
|
|
636
|
+
try {
|
|
637
|
+
user = await getUser(auth.token);
|
|
638
|
+
} catch (err) {
|
|
639
|
+
v.warn(
|
|
640
|
+
`The Vercel session looks invalid (${err instanceof Error ? err.message : String(err)}). Re-run \`agentbox vercel login\`.`
|
|
641
|
+
);
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
const teamId = resolveCliTeamId(user.defaultTeamId);
|
|
645
|
+
if (!teamId) {
|
|
646
|
+
v.warn(
|
|
647
|
+
"Signed in, but could not determine a Vercel team to scope sandboxes to. Set VERCEL_TEAM_ID in `~/.agentbox/secrets.env` and re-run `agentbox vercel login`."
|
|
648
|
+
);
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
const projectId = await resolveProjectId(auth.token, teamId);
|
|
652
|
+
if (projectId === null) {
|
|
653
|
+
v.warn("No project selected \u2014 re-run `agentbox vercel login` to finish setup.");
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
656
|
+
persistCliCredentials({ teamId, projectId });
|
|
657
|
+
reloadVercelEnv();
|
|
658
|
+
v.success(`Signed in with Vercel \u2014 credentials managed by the sandbox CLI (saved scope to ${secretsPath()}).`);
|
|
659
|
+
fe("Setup complete.");
|
|
660
|
+
}
|
|
661
|
+
function resolveCliTeamId(defaultTeamId) {
|
|
662
|
+
return process.env.VERCEL_TEAM_ID ?? readCliCurrentTeam() ?? defaultTeamId ?? null;
|
|
663
|
+
}
|
|
664
|
+
async function resolveVercelApiAuth() {
|
|
665
|
+
ensureVercelEnvLoaded();
|
|
666
|
+
const token = process.env.VERCEL_TOKEN ?? readCliAuth()?.token;
|
|
667
|
+
if (!token) return null;
|
|
668
|
+
let teamId = process.env.VERCEL_TEAM_ID ?? readCliCurrentTeam() ?? void 0;
|
|
669
|
+
if (!teamId) {
|
|
670
|
+
try {
|
|
671
|
+
teamId = (await getUser(token)).defaultTeamId;
|
|
672
|
+
} catch {
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
return { token, teamId };
|
|
676
|
+
}
|
|
677
|
+
async function resolveProjectId(token, teamId) {
|
|
678
|
+
let projects = [];
|
|
679
|
+
const sp = L();
|
|
680
|
+
sp.start("Loading your Vercel projects\u2026");
|
|
681
|
+
try {
|
|
682
|
+
projects = await listProjects(token, teamId);
|
|
683
|
+
sp.stop(`Found ${projects.length} project${projects.length === 1 ? "" : "s"}.`);
|
|
684
|
+
} catch (err) {
|
|
685
|
+
sp.stop("Could not list projects.");
|
|
686
|
+
v.warn(`Failed to list Vercel projects: ${err instanceof Error ? err.message : String(err)}`);
|
|
687
|
+
return null;
|
|
688
|
+
}
|
|
689
|
+
const CREATE = "__create__";
|
|
690
|
+
const preferred = projects.find((p) => p.name === "agentbox") ?? projects.find((p) => p.name === "vercel-sandbox-default-project");
|
|
691
|
+
const choice = exitOnCancel(
|
|
692
|
+
await de({
|
|
693
|
+
message: "Which Vercel project should sandboxes run under?",
|
|
694
|
+
options: [
|
|
695
|
+
...projects.map((p) => ({ value: p.id, label: p.name })),
|
|
696
|
+
{ value: CREATE, label: "Create a new project\u2026" }
|
|
697
|
+
],
|
|
698
|
+
initialValue: preferred ? preferred.id : CREATE
|
|
699
|
+
})
|
|
700
|
+
);
|
|
701
|
+
if (choice !== CREATE) return choice;
|
|
702
|
+
const name = exitOnCancel(
|
|
703
|
+
await ue({
|
|
704
|
+
message: "New project name",
|
|
705
|
+
placeholder: "agentbox",
|
|
706
|
+
defaultValue: "agentbox",
|
|
707
|
+
validate: (v2) => v2 && v2.trim().length > 0 ? void 0 : "Cannot be empty"
|
|
708
|
+
})
|
|
709
|
+
);
|
|
710
|
+
try {
|
|
711
|
+
const created = await createProject(token, teamId, name.trim() || "agentbox");
|
|
712
|
+
return created.id;
|
|
713
|
+
} catch (err) {
|
|
714
|
+
v.warn(`Could not create the project: ${err instanceof Error ? err.message : String(err)}`);
|
|
715
|
+
return null;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
function openDashboard() {
|
|
719
|
+
import("child_process").then(({ spawnSync: spawnSync2 }) => {
|
|
720
|
+
const r = spawnSync2(hostOpenCommand(), [DASHBOARD_TOKENS_URL], { stdio: "ignore" });
|
|
721
|
+
if (r.status !== 0) {
|
|
722
|
+
v.warn(`Could not auto-open the browser \u2014 visit ${DASHBOARD_TOKENS_URL} manually.`);
|
|
723
|
+
}
|
|
724
|
+
}).catch(() => {
|
|
725
|
+
v.warn(`Could not auto-open the browser \u2014 visit ${DASHBOARD_TOKENS_URL} manually.`);
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
function secretsPath() {
|
|
729
|
+
return resolve2(homedir3(), ".agentbox", "secrets.env");
|
|
730
|
+
}
|
|
731
|
+
function readVercelCredStatus() {
|
|
732
|
+
const shellHad = !!process.env.VERCEL_OIDC_TOKEN || !!process.env.VERCEL_TOKEN;
|
|
733
|
+
ensureVercelEnvLoaded();
|
|
734
|
+
const oidc = !!process.env.VERCEL_OIDC_TOKEN;
|
|
735
|
+
const teamId = process.env.VERCEL_TEAM_ID;
|
|
736
|
+
const projectId = process.env.VERCEL_PROJECT_ID;
|
|
737
|
+
if (oidc) {
|
|
738
|
+
return { auth: "oidc", oidc: true, teamId, projectId, source: shellHad ? "env" : "secrets.env" };
|
|
739
|
+
}
|
|
740
|
+
if (process.env.VERCEL_AUTH_SOURCE === "cli") {
|
|
741
|
+
const auth = readCliAuth();
|
|
742
|
+
return {
|
|
743
|
+
auth: "cli",
|
|
744
|
+
oidc: false,
|
|
745
|
+
token: auth?.token,
|
|
746
|
+
teamId,
|
|
747
|
+
projectId,
|
|
748
|
+
source: "cli-store",
|
|
749
|
+
cli: {
|
|
750
|
+
loggedIn: !!auth,
|
|
751
|
+
expiresAt: auth?.expiresAt,
|
|
752
|
+
nearExpiry: auth ? isNearExpiry(auth) : void 0,
|
|
753
|
+
authPath: cliStorePaths().authPath
|
|
754
|
+
}
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
const token = process.env.VERCEL_TOKEN;
|
|
758
|
+
if (!token) return { auth: "none", oidc: false, source: "none" };
|
|
759
|
+
return {
|
|
760
|
+
auth: "token",
|
|
761
|
+
oidc: false,
|
|
762
|
+
token,
|
|
763
|
+
teamId,
|
|
764
|
+
projectId,
|
|
765
|
+
source: shellHad ? "env" : "secrets.env"
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
function maskKey(value) {
|
|
769
|
+
if (value.length <= 8) return "*".repeat(value.length);
|
|
770
|
+
return `${value.slice(0, 4)}\u2026${"*".repeat(8)}${value.slice(-4)}`;
|
|
771
|
+
}
|
|
772
|
+
var SELF = dirname(fileURLToPath(import.meta.url));
|
|
773
|
+
function findStagedCliRuntimeRoot() {
|
|
774
|
+
const candidates = [
|
|
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;
|
|
782
|
+
}
|
|
783
|
+
var RUNTIME_ASSETS = [
|
|
784
|
+
{ name: "provision.sh", remotePath: "/tmp/agentbox-provision.sh", remoteMode: 493 },
|
|
785
|
+
{ name: "agentbox-ctl", remotePath: "/tmp/agentbox-ctl", remoteMode: 493 },
|
|
786
|
+
{ name: "agentbox-vnc-start", remotePath: "/tmp/agentbox-vnc-start", remoteMode: 493 },
|
|
787
|
+
{ name: "agentbox-dockerd-start", remotePath: "/tmp/agentbox-dockerd-start", remoteMode: 493 },
|
|
788
|
+
{ name: "agentbox-checkpoint-cleanup", remotePath: "/tmp/agentbox-checkpoint-cleanup", remoteMode: 493 },
|
|
789
|
+
{ name: "agentbox-open", remotePath: "/tmp/agentbox-open", remoteMode: 493 },
|
|
790
|
+
{ name: "gh-shim", remotePath: "/tmp/agentbox-gh-shim", remoteMode: 493 },
|
|
791
|
+
{ name: "git-shim", remotePath: "/tmp/agentbox-git-shim", remoteMode: 493 },
|
|
792
|
+
{ name: "ntn-shim", remotePath: "/tmp/agentbox-ntn-shim", remoteMode: 493 },
|
|
793
|
+
{ name: "linear-shim", remotePath: "/tmp/agentbox-linear-shim", remoteMode: 493 },
|
|
794
|
+
{ name: "custom-system-CLAUDE.md", remotePath: "/tmp/agentbox-custom-CLAUDE.md", remoteMode: 420 },
|
|
795
|
+
{ name: "claude-managed-settings.json", remotePath: "/tmp/agentbox-managed-settings.json", remoteMode: 420 },
|
|
796
|
+
{ name: "agentbox-codex-hooks.json", remotePath: "/tmp/agentbox-codex-hooks.json", remoteMode: 420 },
|
|
797
|
+
{ name: "agentbox-setup-skill.md", remotePath: "/tmp/agentbox-setup-skill.md", remoteMode: 420 }
|
|
798
|
+
];
|
|
799
|
+
function candidatesFor(name, opts = {}) {
|
|
800
|
+
const cliRoot = opts.cliRuntimeRoot;
|
|
801
|
+
const monorepo = opts.repoRoot ?? guessRepoRoot();
|
|
802
|
+
const monorepoRelative = {
|
|
803
|
+
"provision.sh": ["packages/sandbox-vercel/scripts/provision.sh"],
|
|
804
|
+
"agentbox-ctl": ["packages/ctl/dist/bin.cjs"],
|
|
805
|
+
"agentbox-vnc-start": ["packages/sandbox-docker/scripts/agentbox-vnc-start"],
|
|
806
|
+
"agentbox-dockerd-start": ["packages/sandbox-docker/scripts/agentbox-dockerd-start"],
|
|
807
|
+
"agentbox-checkpoint-cleanup": ["packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup"],
|
|
808
|
+
"agentbox-open": ["packages/sandbox-docker/scripts/agentbox-open"],
|
|
809
|
+
"gh-shim": ["packages/sandbox-docker/scripts/gh-shim"],
|
|
810
|
+
"git-shim": ["packages/sandbox-docker/scripts/git-shim"],
|
|
811
|
+
"ntn-shim": ["packages/sandbox-docker/scripts/ntn-shim"],
|
|
812
|
+
"linear-shim": ["packages/sandbox-docker/scripts/linear-shim"],
|
|
813
|
+
"custom-system-CLAUDE.md": ["packages/sandbox-vercel/scripts/custom-system-CLAUDE.md"],
|
|
814
|
+
"claude-managed-settings.json": ["packages/sandbox-docker/scripts/claude-managed-settings.json"],
|
|
815
|
+
"agentbox-codex-hooks.json": ["packages/sandbox-docker/scripts/agentbox-codex-hooks.json"],
|
|
816
|
+
"agentbox-setup-skill.md": ["apps/cli/share/agentbox-setup/SKILL.md"]
|
|
817
|
+
};
|
|
818
|
+
const cliRelative = {
|
|
819
|
+
"provision.sh": ["vercel/scripts/provision.sh"],
|
|
820
|
+
"agentbox-ctl": ["vercel/ctl.cjs"],
|
|
821
|
+
"agentbox-vnc-start": ["vercel/agentbox-vnc-start", "docker/packages/sandbox-docker/scripts/agentbox-vnc-start"],
|
|
822
|
+
"agentbox-dockerd-start": ["vercel/agentbox-dockerd-start", "docker/packages/sandbox-docker/scripts/agentbox-dockerd-start"],
|
|
823
|
+
"agentbox-checkpoint-cleanup": ["vercel/agentbox-checkpoint-cleanup", "docker/packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup"],
|
|
824
|
+
"agentbox-open": ["vercel/agentbox-open", "docker/packages/sandbox-docker/scripts/agentbox-open"],
|
|
825
|
+
"gh-shim": ["vercel/gh-shim", "docker/packages/sandbox-docker/scripts/gh-shim"],
|
|
826
|
+
"git-shim": ["vercel/git-shim", "docker/packages/sandbox-docker/scripts/git-shim"],
|
|
827
|
+
"ntn-shim": ["vercel/ntn-shim", "docker/packages/sandbox-docker/scripts/ntn-shim"],
|
|
828
|
+
"linear-shim": ["vercel/linear-shim", "docker/packages/sandbox-docker/scripts/linear-shim"],
|
|
829
|
+
"custom-system-CLAUDE.md": ["vercel/custom-system-CLAUDE.md"],
|
|
830
|
+
"claude-managed-settings.json": ["vercel/claude-managed-settings.json", "docker/packages/sandbox-docker/scripts/claude-managed-settings.json"],
|
|
831
|
+
"agentbox-codex-hooks.json": ["vercel/agentbox-codex-hooks.json", "docker/packages/sandbox-docker/scripts/agentbox-codex-hooks.json"],
|
|
832
|
+
"agentbox-setup-skill.md": ["vercel/agentbox-setup-skill.md", "docker/apps/cli/share/agentbox-setup/SKILL.md"]
|
|
833
|
+
};
|
|
834
|
+
const out = [];
|
|
835
|
+
if (cliRoot) {
|
|
836
|
+
for (const rel of cliRelative[name] ?? []) out.push(resolve3(cliRoot, rel));
|
|
837
|
+
}
|
|
838
|
+
for (const rel of monorepoRelative[name] ?? []) out.push(resolve3(monorepo, rel));
|
|
839
|
+
return out;
|
|
840
|
+
}
|
|
841
|
+
function resolveRuntimeAssets(opts = {}) {
|
|
842
|
+
const out = [];
|
|
843
|
+
const missing = [];
|
|
844
|
+
for (const asset of RUNTIME_ASSETS) {
|
|
845
|
+
const cands = candidatesFor(asset.name, opts);
|
|
846
|
+
const hit = cands.find((p) => existsSync3(p));
|
|
847
|
+
if (!hit) {
|
|
848
|
+
missing.push({ name: asset.name, tried: cands });
|
|
849
|
+
continue;
|
|
850
|
+
}
|
|
851
|
+
out.push({ ...asset, localPath: hit });
|
|
852
|
+
}
|
|
853
|
+
if (missing.length > 0) {
|
|
854
|
+
const lines = missing.flatMap((m) => [` - ${m.name}: tried`, ...m.tried.map((p) => ` ${p}`)]);
|
|
855
|
+
throw new Error(
|
|
856
|
+
`vercel: could not resolve runtime assets needed to bake the base snapshot:
|
|
857
|
+
` + lines.join("\n") + `
|
|
858
|
+
|
|
859
|
+
If running from the monorepo, ensure \`pnpm -w build\` has run so packages/ctl/dist/bin.cjs exists.`
|
|
860
|
+
);
|
|
861
|
+
}
|
|
862
|
+
return out;
|
|
863
|
+
}
|
|
864
|
+
function guessRepoRoot() {
|
|
865
|
+
let cur = SELF;
|
|
866
|
+
for (let i = 0; i < 8; i++) {
|
|
867
|
+
if (existsSync3(resolve3(cur, "pnpm-workspace.yaml"))) return cur;
|
|
868
|
+
const parent = dirname(cur);
|
|
869
|
+
if (parent === cur) break;
|
|
870
|
+
cur = parent;
|
|
871
|
+
}
|
|
872
|
+
return SELF;
|
|
873
|
+
}
|
|
874
|
+
var SCHEMA = 1;
|
|
875
|
+
function preparedStatePath() {
|
|
876
|
+
return preparedStatePathFor("vercel");
|
|
877
|
+
}
|
|
878
|
+
function readPreparedState() {
|
|
879
|
+
const raw = readPreparedStateRaw("vercel");
|
|
880
|
+
if (raw === null || typeof raw !== "object") return { schema: SCHEMA };
|
|
881
|
+
const parsed = raw;
|
|
882
|
+
if (parsed.schema !== SCHEMA) {
|
|
883
|
+
return { schema: SCHEMA };
|
|
884
|
+
}
|
|
885
|
+
return { schema: SCHEMA, base: parsed.base };
|
|
886
|
+
}
|
|
887
|
+
function writePreparedState(state) {
|
|
888
|
+
writePreparedStateRaw("vercel", state);
|
|
889
|
+
}
|
|
890
|
+
function updatePreparedState(mutate) {
|
|
891
|
+
const s = readPreparedState();
|
|
892
|
+
mutate(s);
|
|
893
|
+
writePreparedState(s);
|
|
894
|
+
}
|
|
895
|
+
async function currentVercelBaseFingerprintLive(claudeInstall = "native") {
|
|
896
|
+
try {
|
|
897
|
+
const assets = resolveRuntimeAssets({ cliRuntimeRoot: findStagedCliRuntimeRoot() });
|
|
898
|
+
return claudeInstallFingerprint(
|
|
899
|
+
await computeContextSha256(assets.map((a) => ({ rel: a.name, abs: a.localPath }))),
|
|
900
|
+
claudeInstall
|
|
901
|
+
);
|
|
902
|
+
} catch {
|
|
903
|
+
return void 0;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
function ensureVercelBaseSnapshot() {
|
|
907
|
+
const state = readPreparedState();
|
|
908
|
+
if (state.base !== void 0) return;
|
|
909
|
+
throw new UserFacingError(
|
|
910
|
+
"no Vercel base snapshot found.\nRun `agentbox prepare --provider vercel` first \u2014 Vercel cannot build images from a Dockerfile, so the base snapshot is a one-time prerequisite for cloud boxes."
|
|
911
|
+
);
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
// ../../packages/sandbox-vercel/dist/index.js
|
|
915
|
+
import { readFile } from "fs/promises";
|
|
916
|
+
import { readFile as readFile2 } from "fs/promises";
|
|
917
|
+
import { Writable } from "stream";
|
|
918
|
+
var DEFAULT_BACKOFF = [1e3, 2e3, 4e3];
|
|
919
|
+
var DEFAULT_ATTEMPT_TIMEOUT_MS = 3e4;
|
|
920
|
+
var AttemptTimeoutError = class extends Error {
|
|
921
|
+
constructor(method, ms) {
|
|
922
|
+
super(`vercel ${method}: per-attempt timeout after ${String(ms)}ms`);
|
|
923
|
+
this.name = "AttemptTimeoutError";
|
|
924
|
+
}
|
|
925
|
+
};
|
|
926
|
+
function statusCodeOf(err) {
|
|
927
|
+
if (!err || typeof err !== "object") return void 0;
|
|
928
|
+
for (const key of ["statusCode", "status", "code"]) {
|
|
929
|
+
const v2 = err[key];
|
|
930
|
+
if (typeof v2 === "number") return v2;
|
|
931
|
+
}
|
|
932
|
+
const resp = err.response;
|
|
933
|
+
if (resp && typeof resp.status === "number") return resp.status;
|
|
934
|
+
return void 0;
|
|
935
|
+
}
|
|
936
|
+
function isRetriable(err, allowAmbiguous) {
|
|
937
|
+
if (err instanceof AttemptTimeoutError) return allowAmbiguous;
|
|
938
|
+
const status = statusCodeOf(err);
|
|
939
|
+
if (status !== void 0) {
|
|
940
|
+
if (status === 429) return true;
|
|
941
|
+
if (status >= 500 && status <= 599) return allowAmbiguous;
|
|
942
|
+
return false;
|
|
943
|
+
}
|
|
944
|
+
if (err && typeof err === "object") {
|
|
945
|
+
const candidates = [err, err.cause];
|
|
946
|
+
for (const c of candidates) {
|
|
947
|
+
if (!c || typeof c !== "object") continue;
|
|
948
|
+
const code = c.code;
|
|
949
|
+
if (code === "ECONNRESET" || code === "ETIMEDOUT" || code === "ECONNABORTED" || code === "EAI_AGAIN" || code === "ECONNREFUSED" || code === "ENOTFOUND" || code === "UND_ERR_SOCKET" || code === "UND_ERR_CONNECT_TIMEOUT") {
|
|
950
|
+
return allowAmbiguous;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
return false;
|
|
955
|
+
}
|
|
956
|
+
async function withVercelRetry(opts, fn) {
|
|
957
|
+
const backoff = opts.backoffMs ?? DEFAULT_BACKOFF;
|
|
958
|
+
const maxAttempts = backoff.length + 1;
|
|
959
|
+
const timeoutMs = opts.attemptTimeoutMs ?? DEFAULT_ATTEMPT_TIMEOUT_MS;
|
|
960
|
+
const log = opts.onRetry ?? defaultRetryLog;
|
|
961
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
962
|
+
try {
|
|
963
|
+
return await raceTimeout(fn(), timeoutMs, opts.method);
|
|
964
|
+
} catch (err) {
|
|
965
|
+
const last = attempt === maxAttempts;
|
|
966
|
+
if (last || !isRetriable(err, opts.retryOnAmbiguous)) throw err;
|
|
967
|
+
const delay = backoff[attempt - 1] ?? backoff[backoff.length - 1] ?? 4e3;
|
|
968
|
+
log(
|
|
969
|
+
`vercel ${opts.method}: attempt ${String(attempt)} failed (${errorSummary(err)}); retrying in ${String(delay)}ms`
|
|
970
|
+
);
|
|
971
|
+
await sleep(delay);
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
throw new Error(`withVercelRetry: exhausted attempts for ${opts.method}`);
|
|
975
|
+
}
|
|
976
|
+
function defaultRetryLog(line) {
|
|
977
|
+
process.stderr.write(`
|
|
978
|
+
[vercel-retry] ${line}
|
|
979
|
+
`);
|
|
980
|
+
}
|
|
981
|
+
function sleep(ms) {
|
|
982
|
+
return new Promise((r) => setTimeout(r, ms));
|
|
983
|
+
}
|
|
984
|
+
async function raceTimeout(p, ms, method) {
|
|
985
|
+
let timer;
|
|
986
|
+
try {
|
|
987
|
+
return await Promise.race([
|
|
988
|
+
p,
|
|
989
|
+
new Promise((_resolve, reject) => {
|
|
990
|
+
timer = setTimeout(() => reject(new AttemptTimeoutError(method, ms)), ms);
|
|
991
|
+
})
|
|
992
|
+
]);
|
|
993
|
+
} finally {
|
|
994
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
function errorSummary(err) {
|
|
998
|
+
if (err instanceof Error) {
|
|
999
|
+
const status = statusCodeOf(err);
|
|
1000
|
+
return status !== void 0 ? `${err.name}(${String(status)}): ${truncate(err.message)}` : `${err.name}: ${truncate(err.message)}`;
|
|
1001
|
+
}
|
|
1002
|
+
return truncate(String(err));
|
|
1003
|
+
}
|
|
1004
|
+
function truncate(s, max = 160) {
|
|
1005
|
+
return s.length > max ? `${s.slice(0, max)}\u2026` : s;
|
|
1006
|
+
}
|
|
1007
|
+
var DEFAULT_BOX_IMAGE_REF = "agentbox/box:dev";
|
|
1008
|
+
var BOX_USER = "vscode";
|
|
1009
|
+
var BOX_OWNER = "vscode:vscode";
|
|
1010
|
+
var VERCEL_EXPOSED_PORTS = [8080, 6080, 8788];
|
|
1011
|
+
var VERCEL_MAX_PORTS = 4;
|
|
1012
|
+
function buildExposedPorts(extra) {
|
|
1013
|
+
const ports = [...VERCEL_EXPOSED_PORTS];
|
|
1014
|
+
const seen = new Set(ports);
|
|
1015
|
+
for (const p of extra ?? []) {
|
|
1016
|
+
if (ports.length >= VERCEL_MAX_PORTS) break;
|
|
1017
|
+
if (Number.isInteger(p) && p >= 1024 && p < 65536 && !seen.has(p)) {
|
|
1018
|
+
ports.push(p);
|
|
1019
|
+
seen.add(p);
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
return ports;
|
|
1023
|
+
}
|
|
1024
|
+
function parseNetworkPolicy(raw) {
|
|
1025
|
+
const v2 = (raw ?? "").trim();
|
|
1026
|
+
if (v2 === "") return void 0;
|
|
1027
|
+
if (v2 === "allow-all" || v2 === "deny-all") return v2;
|
|
1028
|
+
const allow = v2.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
1029
|
+
return allow.length > 0 ? { allow } : void 0;
|
|
1030
|
+
}
|
|
1031
|
+
var DEFAULT_TIMEOUT_MS = 45 * 6e4;
|
|
1032
|
+
var KEEP_LAST_SNAPSHOTS = { count: 1, expiration: 0, deleteEvicted: false };
|
|
1033
|
+
function creds() {
|
|
1034
|
+
return resolveCredentials();
|
|
1035
|
+
}
|
|
1036
|
+
function shq(s) {
|
|
1037
|
+
return "'" + s.replace(/'/g, "'\\''") + "'";
|
|
1038
|
+
}
|
|
1039
|
+
async function getSandbox(id) {
|
|
1040
|
+
return Sandbox.get({ name: id, resume: false, ...creds() });
|
|
1041
|
+
}
|
|
1042
|
+
async function maybeGetSandbox(id) {
|
|
1043
|
+
try {
|
|
1044
|
+
return await getSandbox(id);
|
|
1045
|
+
} catch {
|
|
1046
|
+
return null;
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
function mapState(s) {
|
|
1050
|
+
switch (s) {
|
|
1051
|
+
case "running":
|
|
1052
|
+
return "running";
|
|
1053
|
+
case "pending":
|
|
1054
|
+
case "stopping":
|
|
1055
|
+
case "snapshotting":
|
|
1056
|
+
return "running";
|
|
1057
|
+
case "stopped":
|
|
1058
|
+
return "paused";
|
|
1059
|
+
case "aborted":
|
|
1060
|
+
case "failed":
|
|
1061
|
+
default:
|
|
1062
|
+
return "missing";
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
function buildRunCommand(cmd, opts) {
|
|
1066
|
+
const prelude = [];
|
|
1067
|
+
if (opts?.cwd) prelude.push(`cd ${shq(opts.cwd)}`);
|
|
1068
|
+
for (const [k, v2] of Object.entries(opts?.env ?? {})) {
|
|
1069
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(k)) {
|
|
1070
|
+
throw new Error(`vercel exec: invalid env var name ${JSON.stringify(k)}`);
|
|
1071
|
+
}
|
|
1072
|
+
prelude.push(`export ${k}=${shq(v2)}`);
|
|
1073
|
+
}
|
|
1074
|
+
const inner = [...prelude, cmd].join("\n");
|
|
1075
|
+
const user = opts?.user ?? BOX_USER;
|
|
1076
|
+
if (user === "root") {
|
|
1077
|
+
return { cmd: "bash", args: ["-lc", inner], sudo: true };
|
|
1078
|
+
}
|
|
1079
|
+
return {
|
|
1080
|
+
cmd: "bash",
|
|
1081
|
+
args: ["-lc", `sudo -u ${user} -H bash -lc ${shq(inner)}`],
|
|
1082
|
+
sudo: true
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
var vercelBackend = {
|
|
1086
|
+
name: "vercel",
|
|
1087
|
+
// Vercel rejects privileged ports (<1024) and can't add a routable port to a
|
|
1088
|
+
// running sandbox (update registers a route that 502s — verified). So the
|
|
1089
|
+
// in-box WebProxy binds 8080 (exposed at create via VERCEL_EXPOSED_PORTS) and
|
|
1090
|
+
// `agentbox url` resolves sandbox.domain(8080) → WebProxy → the in-box service.
|
|
1091
|
+
webProxyPort: 8080,
|
|
1092
|
+
async provision(req) {
|
|
1093
|
+
await ensureFreshCredentials();
|
|
1094
|
+
const snapshotId = req.snapshot ?? readPreparedState().base?.snapshotId;
|
|
1095
|
+
if (!snapshotId) {
|
|
1096
|
+
throw new Error(
|
|
1097
|
+
"no Vercel base snapshot found.\nRun `agentbox prepare --provider vercel` first \u2014 Vercel cannot build images from a Dockerfile, so the base snapshot is a one-time prerequisite."
|
|
1098
|
+
);
|
|
1099
|
+
}
|
|
1100
|
+
const networkPolicy = parseNetworkPolicy(req.networkPolicy);
|
|
1101
|
+
const handle = await withVercelRetry(
|
|
1102
|
+
{ method: "provision", retryOnAmbiguous: false, attemptTimeoutMs: 9e5, backoffMs: [] },
|
|
1103
|
+
async () => {
|
|
1104
|
+
const sb = await Sandbox.create({
|
|
1105
|
+
name: req.name,
|
|
1106
|
+
source: { type: "snapshot", snapshotId },
|
|
1107
|
+
resources: { vcpus: req.resources?.cpu ?? 2 },
|
|
1108
|
+
ports: buildExposedPorts(req.exposePorts),
|
|
1109
|
+
timeout: req.timeoutMs ?? DEFAULT_TIMEOUT_MS,
|
|
1110
|
+
env: req.env,
|
|
1111
|
+
tags: { agentbox: "true", "agentbox.name": req.name },
|
|
1112
|
+
persistent: true,
|
|
1113
|
+
// Pin the sandbox-default expiration to never. Evicted snapshots (see
|
|
1114
|
+
// KEEP_LAST_SNAPSHOTS) fall back to this, so the shared base/checkpoint
|
|
1115
|
+
// a box boots from is never re-stamped with a finite expiry on eviction.
|
|
1116
|
+
snapshotExpiration: 0,
|
|
1117
|
+
keepLastSnapshots: { ...KEEP_LAST_SNAPSHOTS },
|
|
1118
|
+
...networkPolicy ? { networkPolicy } : {},
|
|
1119
|
+
...creds()
|
|
1120
|
+
});
|
|
1121
|
+
return { sandboxId: sb.name };
|
|
1122
|
+
}
|
|
1123
|
+
);
|
|
1124
|
+
return handle;
|
|
1125
|
+
},
|
|
1126
|
+
async get(sandboxId) {
|
|
1127
|
+
await ensureFreshCredentials();
|
|
1128
|
+
return withVercelRetry({ method: "get", retryOnAmbiguous: true }, async () => {
|
|
1129
|
+
const sb = await maybeGetSandbox(sandboxId);
|
|
1130
|
+
return sb ? { sandboxId: sb.name } : null;
|
|
1131
|
+
});
|
|
1132
|
+
},
|
|
1133
|
+
async list() {
|
|
1134
|
+
await ensureFreshCredentials();
|
|
1135
|
+
return withVercelRetry({ method: "list", retryOnAmbiguous: true }, async () => {
|
|
1136
|
+
const page = await Sandbox.list({ ...creds() });
|
|
1137
|
+
const items = await page.toArray();
|
|
1138
|
+
return items.filter((sb) => sb.tags?.["agentbox"] === "true").map((sb) => {
|
|
1139
|
+
const summary = { sandboxId: sb.name };
|
|
1140
|
+
const friendly = sb.tags?.["agentbox.name"] ?? sb.name;
|
|
1141
|
+
if (friendly) summary.name = friendly;
|
|
1142
|
+
if (typeof sb.createdAt === "number") {
|
|
1143
|
+
summary.createdAt = new Date(sb.createdAt).toISOString();
|
|
1144
|
+
}
|
|
1145
|
+
summary.state = mapState(sb.status);
|
|
1146
|
+
return summary;
|
|
1147
|
+
});
|
|
1148
|
+
});
|
|
1149
|
+
},
|
|
1150
|
+
async start(h) {
|
|
1151
|
+
await ensureFreshCredentials();
|
|
1152
|
+
await withVercelRetry(
|
|
1153
|
+
{ method: "start", retryOnAmbiguous: true, attemptTimeoutMs: 12e4 },
|
|
1154
|
+
async () => {
|
|
1155
|
+
await Sandbox.get({ name: h.sandboxId, resume: true, ...creds() });
|
|
1156
|
+
}
|
|
1157
|
+
);
|
|
1158
|
+
},
|
|
1159
|
+
async stop(h) {
|
|
1160
|
+
await ensureFreshCredentials();
|
|
1161
|
+
await withVercelRetry(
|
|
1162
|
+
{ method: "stop", retryOnAmbiguous: true, attemptTimeoutMs: 12e4 },
|
|
1163
|
+
async () => {
|
|
1164
|
+
const sb = await getSandbox(h.sandboxId);
|
|
1165
|
+
await sb.stop();
|
|
1166
|
+
}
|
|
1167
|
+
);
|
|
1168
|
+
},
|
|
1169
|
+
// pause == stop on Vercel (the auto-snapshot IS the cold-storage state).
|
|
1170
|
+
async pause(h) {
|
|
1171
|
+
await this.stop(h);
|
|
1172
|
+
},
|
|
1173
|
+
async resume(h) {
|
|
1174
|
+
await this.start(h);
|
|
1175
|
+
},
|
|
1176
|
+
async destroy(h) {
|
|
1177
|
+
await ensureFreshCredentials();
|
|
1178
|
+
await withVercelRetry(
|
|
1179
|
+
{ method: "destroy", retryOnAmbiguous: true, attemptTimeoutMs: 12e4 },
|
|
1180
|
+
async () => {
|
|
1181
|
+
const sb = await maybeGetSandbox(h.sandboxId);
|
|
1182
|
+
if (!sb) return;
|
|
1183
|
+
const snapId = sb.currentSnapshotId;
|
|
1184
|
+
const source = sb.sourceSnapshotId;
|
|
1185
|
+
const base = readPreparedState().base?.snapshotId;
|
|
1186
|
+
const ownSnapshot = snapId !== void 0 && snapId !== source && snapId !== base;
|
|
1187
|
+
await sb.delete();
|
|
1188
|
+
if (ownSnapshot) {
|
|
1189
|
+
try {
|
|
1190
|
+
const snap = await Snapshot.get({ snapshotId: snapId, ...creds() });
|
|
1191
|
+
await snap.delete();
|
|
1192
|
+
} catch {
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
);
|
|
1197
|
+
},
|
|
1198
|
+
async state(h) {
|
|
1199
|
+
await ensureFreshCredentials();
|
|
1200
|
+
return withVercelRetry({ method: "state", retryOnAmbiguous: true }, async () => {
|
|
1201
|
+
const sb = await maybeGetSandbox(h.sandboxId);
|
|
1202
|
+
if (!sb) return "missing";
|
|
1203
|
+
return mapState(sb.status);
|
|
1204
|
+
});
|
|
1205
|
+
},
|
|
1206
|
+
async exec(h, cmd, opts) {
|
|
1207
|
+
await ensureFreshCredentials();
|
|
1208
|
+
return withVercelRetry(
|
|
1209
|
+
{
|
|
1210
|
+
method: "exec",
|
|
1211
|
+
retryOnAmbiguous: opts?.noRetry ? false : true,
|
|
1212
|
+
attemptTimeoutMs: opts?.attemptTimeoutMs ?? 12e4,
|
|
1213
|
+
backoffMs: opts?.noRetry ? [] : void 0
|
|
1214
|
+
},
|
|
1215
|
+
async () => {
|
|
1216
|
+
const sb = await getSandbox(h.sandboxId);
|
|
1217
|
+
const r = await sb.runCommand(buildRunCommand(cmd, opts));
|
|
1218
|
+
const [stdout, stderr] = await Promise.all([r.stdout(), r.stderr()]);
|
|
1219
|
+
return { exitCode: r.exitCode, stdout, stderr };
|
|
1220
|
+
}
|
|
1221
|
+
);
|
|
1222
|
+
},
|
|
1223
|
+
async uploadFile(h, localPath, remotePath) {
|
|
1224
|
+
await ensureFreshCredentials();
|
|
1225
|
+
await withVercelRetry(
|
|
1226
|
+
{ method: "uploadFile", retryOnAmbiguous: true, attemptTimeoutMs: 3e5 },
|
|
1227
|
+
async () => {
|
|
1228
|
+
const content = await readFile(localPath);
|
|
1229
|
+
const sb = await getSandbox(h.sandboxId);
|
|
1230
|
+
await sb.writeFiles([{ path: remotePath, content }]);
|
|
1231
|
+
try {
|
|
1232
|
+
await sb.runCommand({ cmd: "chown", args: [BOX_OWNER, remotePath], sudo: true });
|
|
1233
|
+
} catch {
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
);
|
|
1237
|
+
},
|
|
1238
|
+
async downloadFile(h, remotePath, localPath) {
|
|
1239
|
+
await ensureFreshCredentials();
|
|
1240
|
+
await withVercelRetry(
|
|
1241
|
+
{ method: "downloadFile", retryOnAmbiguous: true, attemptTimeoutMs: 3e5 },
|
|
1242
|
+
async () => {
|
|
1243
|
+
const sb = await getSandbox(h.sandboxId);
|
|
1244
|
+
const written = await sb.downloadFile(
|
|
1245
|
+
{ path: remotePath },
|
|
1246
|
+
{ path: localPath },
|
|
1247
|
+
{ mkdirRecursive: true }
|
|
1248
|
+
);
|
|
1249
|
+
if (written === null) {
|
|
1250
|
+
throw new Error(`vercel downloadFile: source not found: ${remotePath}`);
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
);
|
|
1254
|
+
},
|
|
1255
|
+
async listFiles(h, remoteDir) {
|
|
1256
|
+
await ensureFreshCredentials();
|
|
1257
|
+
return withVercelRetry({ method: "listFiles", retryOnAmbiguous: true }, async () => {
|
|
1258
|
+
const sb = await getSandbox(h.sandboxId);
|
|
1259
|
+
const entries = await sb.fs.readdir(remoteDir, { withFileTypes: true });
|
|
1260
|
+
return entries.map((e) => ({ name: e.name, isDir: e.isDirectory() }));
|
|
1261
|
+
});
|
|
1262
|
+
},
|
|
1263
|
+
async previewUrl(h, port) {
|
|
1264
|
+
await ensureFreshCredentials();
|
|
1265
|
+
return withVercelRetry({ method: "previewUrl", retryOnAmbiguous: true }, async () => {
|
|
1266
|
+
const sb = await getSandbox(h.sandboxId);
|
|
1267
|
+
return { url: sb.domain(port), token: void 0 };
|
|
1268
|
+
});
|
|
1269
|
+
},
|
|
1270
|
+
// Fewer params than the interface's (h, port, expiresInSeconds) is fine —
|
|
1271
|
+
// Vercel sandbox domains are already public + browser-usable, so the signed
|
|
1272
|
+
// URL is just the standard one (the TTL is governed by the sandbox session
|
|
1273
|
+
// lifetime, not a per-URL signature, so the expiry arg is irrelevant here).
|
|
1274
|
+
async signedPreviewUrl(h, port) {
|
|
1275
|
+
return this.previewUrl(h, port);
|
|
1276
|
+
},
|
|
1277
|
+
// Vercel `extendTimeout` is ADDITIVE (adds to the current deadline) and the
|
|
1278
|
+
// remaining time isn't readable, so the host passes its tracked deadline and
|
|
1279
|
+
// we extend by the delta to land the death-time at `target`. The host only
|
|
1280
|
+
// calls when target > current, so this never shortens. A plan-cap rejection
|
|
1281
|
+
// bubbles to the keepalive loop's catch (it lets the box lapse at the cap).
|
|
1282
|
+
async renewTimeout(h, targetDeadlineEpochMs, currentDeadlineEpochMs) {
|
|
1283
|
+
const deltaMs = Math.max(0, targetDeadlineEpochMs - currentDeadlineEpochMs);
|
|
1284
|
+
if (deltaMs === 0) return;
|
|
1285
|
+
await ensureFreshCredentials();
|
|
1286
|
+
await withVercelRetry({ method: "renewTimeout", retryOnAmbiguous: true }, async () => {
|
|
1287
|
+
const sb = await getSandbox(h.sandboxId);
|
|
1288
|
+
await sb.extendTimeout(deltaMs);
|
|
1289
|
+
});
|
|
1290
|
+
},
|
|
1291
|
+
async snapshotExists(snapshotName) {
|
|
1292
|
+
await ensureFreshCredentials();
|
|
1293
|
+
return withVercelRetry({ method: "snapshotExists", retryOnAmbiguous: true }, async () => {
|
|
1294
|
+
try {
|
|
1295
|
+
const snap = await Snapshot.get({ snapshotId: snapshotName, ...creds() });
|
|
1296
|
+
return snap.status === "created";
|
|
1297
|
+
} catch {
|
|
1298
|
+
return false;
|
|
1299
|
+
}
|
|
1300
|
+
});
|
|
1301
|
+
}
|
|
1302
|
+
// NOTE: no `createSnapshot`/`deleteSnapshot` here. Vercel snapshots are
|
|
1303
|
+
// addressed by an opaque id (not a caller-chosen name), which doesn't fit the
|
|
1304
|
+
// CloudBackend `createSnapshot(handle, name): void` contract — the provider
|
|
1305
|
+
// needs the id back to store it in the checkpoint manifest. The Vercel
|
|
1306
|
+
// provider therefore overrides the whole `checkpoint` capability in index.ts
|
|
1307
|
+
// using `snapshotVercelSandbox` / `deleteVercelSnapshot` below.
|
|
1308
|
+
};
|
|
1309
|
+
async function snapshotVercelSandbox(sandboxId) {
|
|
1310
|
+
await ensureFreshCredentials();
|
|
1311
|
+
return withVercelRetry(
|
|
1312
|
+
{ method: "createSnapshot", retryOnAmbiguous: false, attemptTimeoutMs: 9e5, backoffMs: [] },
|
|
1313
|
+
async () => {
|
|
1314
|
+
const sb = await getSandbox(sandboxId);
|
|
1315
|
+
const snap = await sb.snapshot({ expiration: 0 });
|
|
1316
|
+
return snap.snapshotId;
|
|
1317
|
+
}
|
|
1318
|
+
);
|
|
1319
|
+
}
|
|
1320
|
+
async function deleteVercelSnapshot(snapshotId) {
|
|
1321
|
+
await ensureFreshCredentials();
|
|
1322
|
+
await withVercelRetry({ method: "deleteSnapshot", retryOnAmbiguous: true }, async () => {
|
|
1323
|
+
try {
|
|
1324
|
+
const snap = await Snapshot.get({ snapshotId, ...creds() });
|
|
1325
|
+
await snap.delete();
|
|
1326
|
+
} catch (err) {
|
|
1327
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1328
|
+
if (/not.?found|404/i.test(msg)) return;
|
|
1329
|
+
throw err;
|
|
1330
|
+
}
|
|
1331
|
+
});
|
|
1332
|
+
}
|
|
1333
|
+
var BUILDER_TIMEOUT_MS = 25 * 6e4;
|
|
1334
|
+
var SHELL = "/bin/bash";
|
|
1335
|
+
async function prepareVercel(opts = {}) {
|
|
1336
|
+
await ensureVercelCredentials();
|
|
1337
|
+
await ensureFreshCredentials();
|
|
1338
|
+
const creds2 = resolveCredentials();
|
|
1339
|
+
const log = opts.onLog ?? (() => {
|
|
1340
|
+
});
|
|
1341
|
+
const progress = (s) => log(`prepare-vercel: ${s}`);
|
|
1342
|
+
const assets = resolveRuntimeAssets({
|
|
1343
|
+
cliRuntimeRoot: opts.cliRuntimeRoot ?? findStagedCliRuntimeRoot(),
|
|
1344
|
+
repoRoot: opts.repoRoot
|
|
1345
|
+
});
|
|
1346
|
+
const claudeInstall = opts.claudeInstall ?? "native";
|
|
1347
|
+
const contextSha = claudeInstallFingerprint(
|
|
1348
|
+
await computeContextSha256(assets.map((a) => ({ rel: a.name, abs: a.localPath }))),
|
|
1349
|
+
claudeInstall
|
|
1350
|
+
);
|
|
1351
|
+
const existing = readPreparedState();
|
|
1352
|
+
if (!opts.force && existing.base) {
|
|
1353
|
+
const stillThere = await snapshotExists(existing.base.snapshotId, creds2);
|
|
1354
|
+
if (stillThere && existing.base.contextSha256 === contextSha) {
|
|
1355
|
+
progress(
|
|
1356
|
+
`base snapshot ${existing.base.snapshotId} already exists (fingerprint ${contextSha.slice(0, 12)} matches); skipping (pass --force to rebuild)`
|
|
1357
|
+
);
|
|
1358
|
+
return { snapshotName: existing.base.snapshotId };
|
|
1359
|
+
}
|
|
1360
|
+
if (!stillThere) {
|
|
1361
|
+
progress(`recorded base snapshot ${existing.base.snapshotId} is gone on Vercel; rebuilding`);
|
|
1362
|
+
} else {
|
|
1363
|
+
progress(
|
|
1364
|
+
`build context changed (was ${existing.base.contextSha256?.slice(0, 12) ?? "<none>"}, now ${contextSha.slice(0, 12)}); rebuilding`
|
|
1365
|
+
);
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
progress(`creating builder sandbox (node24, ${String(opts.vcpus ?? 4)} vcpus)`);
|
|
1369
|
+
const sb = await Sandbox.create({
|
|
1370
|
+
runtime: "node24",
|
|
1371
|
+
resources: { vcpus: opts.vcpus ?? 4 },
|
|
1372
|
+
timeout: BUILDER_TIMEOUT_MS,
|
|
1373
|
+
tags: { agentbox: "true", "agentbox.role": "prepare" },
|
|
1374
|
+
persistent: false,
|
|
1375
|
+
...creds2
|
|
1376
|
+
});
|
|
1377
|
+
progress(`builder sandbox ${sb.name} up`);
|
|
1378
|
+
progress(`uploading ${String(assets.length)} runtime asset(s)`);
|
|
1379
|
+
await sb.writeFiles(
|
|
1380
|
+
await Promise.all(
|
|
1381
|
+
assets.map(async (a) => ({
|
|
1382
|
+
path: a.remotePath,
|
|
1383
|
+
content: await readFile2(a.localPath),
|
|
1384
|
+
mode: a.remoteMode
|
|
1385
|
+
}))
|
|
1386
|
+
)
|
|
1387
|
+
);
|
|
1388
|
+
progress("running provision.sh (this takes a few minutes)");
|
|
1389
|
+
const install = await sb.runCommand({
|
|
1390
|
+
cmd: SHELL,
|
|
1391
|
+
args: ["-lc", `AGENTBOX_CLAUDE_INSTALL=${claudeInstall} bash /tmp/agentbox-provision.sh 2>&1`],
|
|
1392
|
+
sudo: true,
|
|
1393
|
+
stdout: lineSink((l) => log(`[provision] ${l}`)),
|
|
1394
|
+
stderr: lineSink((l) => log(`[provision] ${l}`))
|
|
1395
|
+
});
|
|
1396
|
+
if (install.exitCode !== 0) {
|
|
1397
|
+
throw new Error(`provision.sh failed on the builder sandbox (exit ${String(install.exitCode)})`);
|
|
1398
|
+
}
|
|
1399
|
+
progress("provision.sh complete");
|
|
1400
|
+
await stageAgentConfig(sb, opts.hostWorkspace, log);
|
|
1401
|
+
progress("creating base snapshot (expiration: never)");
|
|
1402
|
+
const snap = await sb.snapshot({ expiration: 0 });
|
|
1403
|
+
progress(`snapshot created: ${snap.snapshotId}`);
|
|
1404
|
+
const cliStamp = readCliStamp();
|
|
1405
|
+
writePreparedState({
|
|
1406
|
+
schema: 1,
|
|
1407
|
+
base: {
|
|
1408
|
+
snapshotId: snap.snapshotId,
|
|
1409
|
+
contextSha256: contextSha,
|
|
1410
|
+
cliVersion: cliStamp.cliVersion,
|
|
1411
|
+
cliCommit: cliStamp.cliCommit,
|
|
1412
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1413
|
+
}
|
|
1414
|
+
});
|
|
1415
|
+
progress(`wrote ${preparedStatePath()}`);
|
|
1416
|
+
progress("deleting builder sandbox");
|
|
1417
|
+
try {
|
|
1418
|
+
await sb.delete();
|
|
1419
|
+
progress("builder sandbox deleted");
|
|
1420
|
+
} catch (err) {
|
|
1421
|
+
progress(
|
|
1422
|
+
`builder delete failed (left for Vercel reaper): ${err instanceof Error ? err.message : String(err)}`
|
|
1423
|
+
);
|
|
1424
|
+
}
|
|
1425
|
+
progress(`prepare complete \u2014 base snapshot ${snap.snapshotId}`);
|
|
1426
|
+
return { snapshotName: snap.snapshotId };
|
|
1427
|
+
}
|
|
1428
|
+
async function snapshotExists(snapshotId, creds2) {
|
|
1429
|
+
try {
|
|
1430
|
+
const snap = await Snapshot.get({ snapshotId, ...creds2 });
|
|
1431
|
+
return snap.status === "created";
|
|
1432
|
+
} catch {
|
|
1433
|
+
return false;
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
async function stageAgentConfig(sb, hostWorkspace, log) {
|
|
1437
|
+
const progress = (s) => log(`prepare-vercel: ${s}`);
|
|
1438
|
+
progress("staging host agent static config");
|
|
1439
|
+
const stagings = [];
|
|
1440
|
+
try {
|
|
1441
|
+
const claudeTar = await stageClaudeStaticForUpload({ hostWorkspace });
|
|
1442
|
+
for (const w of claudeTar.warnings) progress(w);
|
|
1443
|
+
if (claudeTar.tarballPath) stagings.push({ kind: "claude", tar: claudeTar, dest: "/home/vscode/.claude" });
|
|
1444
|
+
else await claudeTar.cleanup();
|
|
1445
|
+
const codexTar = await stageCodexStaticForUpload();
|
|
1446
|
+
for (const w of codexTar.warnings) progress(w);
|
|
1447
|
+
if (codexTar.tarballPath) stagings.push({ kind: "codex", tar: codexTar, dest: "/home/vscode/.codex" });
|
|
1448
|
+
else await codexTar.cleanup();
|
|
1449
|
+
const opencodeTar = await stageOpencodeStaticForUpload();
|
|
1450
|
+
for (const w of opencodeTar.warnings) progress(w);
|
|
1451
|
+
if (opencodeTar.tarballPath) stagings.push({ kind: "opencode", tar: opencodeTar, dest: "/home/vscode/.local/share/opencode" });
|
|
1452
|
+
else await opencodeTar.cleanup();
|
|
1453
|
+
for (const s of stagings) {
|
|
1454
|
+
const remote = `/tmp/agentbox-${s.kind}-static.tar.gz`;
|
|
1455
|
+
progress(`uploading ${s.kind} static config`);
|
|
1456
|
+
await sb.writeFiles([{ path: remote, content: await readFile2(s.tar.tarballPath) }]);
|
|
1457
|
+
const extract = `sudo -u vscode mkdir -p ${s.dest} && sudo -u vscode tar -xzf ${remote} -C ${s.dest} --no-same-permissions --no-same-owner -m && rm -f ${remote}`;
|
|
1458
|
+
const r = await sb.runCommand({ cmd: SHELL, args: ["-lc", extract], sudo: true });
|
|
1459
|
+
if (r.exitCode !== 0) {
|
|
1460
|
+
progress(`WARN: ${s.kind} static extract failed (exit ${String(r.exitCode)}) \u2014 continuing`);
|
|
1461
|
+
} else {
|
|
1462
|
+
progress(`baked ${s.kind} static config into snapshot`);
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
} finally {
|
|
1466
|
+
for (const s of stagings) await s.tar.cleanup();
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
function lineSink(onLine) {
|
|
1470
|
+
let buf = "";
|
|
1471
|
+
return new Writable({
|
|
1472
|
+
write(chunk, _enc, cb) {
|
|
1473
|
+
buf += chunk.toString("utf8");
|
|
1474
|
+
let nl;
|
|
1475
|
+
while ((nl = buf.indexOf("\n")) !== -1) {
|
|
1476
|
+
onLine(buf.slice(0, nl));
|
|
1477
|
+
buf = buf.slice(nl + 1);
|
|
1478
|
+
}
|
|
1479
|
+
cb();
|
|
1480
|
+
},
|
|
1481
|
+
final(cb) {
|
|
1482
|
+
if (buf.length > 0) onLine(buf);
|
|
1483
|
+
cb();
|
|
1484
|
+
}
|
|
1485
|
+
});
|
|
1486
|
+
}
|
|
1487
|
+
var prepareVercelProvider = (req) => prepareVercel({
|
|
1488
|
+
name: req.name,
|
|
1489
|
+
hostWorkspace: req.hostWorkspace ?? process.cwd(),
|
|
1490
|
+
force: req.force,
|
|
1491
|
+
claudeInstall: req.claudeInstall,
|
|
1492
|
+
onLog: req.onLog
|
|
1493
|
+
});
|
|
1494
|
+
async function buildVercelAttach(box, kind, opts) {
|
|
1495
|
+
const sandboxId = box.cloud?.sandboxId;
|
|
1496
|
+
if (!sandboxId) {
|
|
1497
|
+
throw new Error(`vercel box ${box.name} has no sandboxId \u2014 record is malformed`);
|
|
1498
|
+
}
|
|
1499
|
+
const det = await detectSbx();
|
|
1500
|
+
if (!det.installed || !det.bin) {
|
|
1501
|
+
throw new Error(
|
|
1502
|
+
"Vercel interactive attach needs the Vercel `sandbox` CLI \u2014 run `agentbox vercel login` (it installs it) or `npm install -g sandbox`."
|
|
1503
|
+
);
|
|
1504
|
+
}
|
|
1505
|
+
await ensureFreshCredentials();
|
|
1506
|
+
const { token, teamId, projectId } = resolveCredentials();
|
|
1507
|
+
const interactive = (kind === "shell" || kind === "agent") && !opts?.detached;
|
|
1508
|
+
const envPrelude = `export LANG=C.UTF-8 LC_ALL=C.UTF-8 TERM=${hostTermForCloud()}; `;
|
|
1509
|
+
const inner = envPrelude + renderInnerCommand(kind, opts);
|
|
1510
|
+
const argv = [
|
|
1511
|
+
det.bin,
|
|
1512
|
+
"exec",
|
|
1513
|
+
"--sudo",
|
|
1514
|
+
...interactive ? ["-i"] : [],
|
|
1515
|
+
"--project",
|
|
1516
|
+
projectId,
|
|
1517
|
+
"--scope",
|
|
1518
|
+
teamId,
|
|
1519
|
+
sandboxId,
|
|
1520
|
+
"--",
|
|
1521
|
+
"sudo",
|
|
1522
|
+
"-u",
|
|
1523
|
+
"vscode",
|
|
1524
|
+
"-H",
|
|
1525
|
+
"bash",
|
|
1526
|
+
"-lc",
|
|
1527
|
+
inner
|
|
1528
|
+
];
|
|
1529
|
+
return { argv, env: { VERCEL_AUTH_TOKEN: token } };
|
|
1530
|
+
}
|
|
1531
|
+
function readCredStatusSummary() {
|
|
1532
|
+
const cred = readVercelCredStatus();
|
|
1533
|
+
return { configured: cred.auth !== "none", label: cred.auth };
|
|
1534
|
+
}
|
|
1535
|
+
async function doctorChecks() {
|
|
1536
|
+
try {
|
|
1537
|
+
const cred = readVercelCredStatus();
|
|
1538
|
+
const credRes = cred.auth === "none" ? {
|
|
1539
|
+
label: "credentials",
|
|
1540
|
+
status: "warn",
|
|
1541
|
+
detail: "not configured",
|
|
1542
|
+
hint: "`agentbox vercel login`"
|
|
1543
|
+
} : { label: "credentials", status: "ok", detail: `${cred.auth} (${cred.source})` };
|
|
1544
|
+
const prepared = readPreparedState();
|
|
1545
|
+
const snapRes = prepared.base?.snapshotId ? {
|
|
1546
|
+
label: "base snapshot",
|
|
1547
|
+
status: "ok",
|
|
1548
|
+
detail: `${prepared.base.snapshotId.slice(0, 16)}\u2026 (${prepared.base.cliVersion ?? "\u2014"})`
|
|
1549
|
+
} : {
|
|
1550
|
+
label: "base snapshot",
|
|
1551
|
+
status: "warn",
|
|
1552
|
+
detail: "not baked",
|
|
1553
|
+
hint: "`agentbox prepare --provider vercel`"
|
|
1554
|
+
};
|
|
1555
|
+
return [credRes, snapRes];
|
|
1556
|
+
} catch (err) {
|
|
1557
|
+
return [{ label: "credentials", status: "warn", detail: errSummary(err) }];
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
var BACKEND_NAME = "vercel";
|
|
1561
|
+
var cloudProvider = createCloudProvider(vercelBackend, {
|
|
1562
|
+
// Vercel couples RAM to vCPU at 2048 MB/vCPU; disk is a fixed 32 GB NVMe.
|
|
1563
|
+
defaultResources: { cpu: 2, memory: 4, disk: 32 },
|
|
1564
|
+
launchDockerd: true
|
|
1565
|
+
});
|
|
1566
|
+
var vercelCheckpoint = {
|
|
1567
|
+
async create(box, name) {
|
|
1568
|
+
if (!box.projectRoot) {
|
|
1569
|
+
throw new Error(
|
|
1570
|
+
"cloud checkpoint requires the box to have a project root (run `agentbox checkpoint` from inside the project)"
|
|
1571
|
+
);
|
|
1572
|
+
}
|
|
1573
|
+
if (!box.cloud?.sandboxId) {
|
|
1574
|
+
throw new Error(`vercel box ${box.name} has no sandboxId \u2014 record is malformed`);
|
|
1575
|
+
}
|
|
1576
|
+
const snapshotId = await snapshotVercelSandbox(box.cloud.sandboxId);
|
|
1577
|
+
try {
|
|
1578
|
+
await recordBox({ ...box, cloud: { ...box.cloud, lastState: "paused" } });
|
|
1579
|
+
} catch {
|
|
1580
|
+
}
|
|
1581
|
+
const info = await writeCloudCheckpointManifest(box.projectRoot, BACKEND_NAME, name, {
|
|
1582
|
+
snapshotName: snapshotId,
|
|
1583
|
+
sourceBoxId: box.id,
|
|
1584
|
+
sourceBoxName: box.name,
|
|
1585
|
+
baseProvider: BACKEND_NAME,
|
|
1586
|
+
baseFingerprint: currentCloudBaseFingerprint(BACKEND_NAME),
|
|
1587
|
+
cliVersion: readCliStamp().cliVersion
|
|
1588
|
+
});
|
|
1589
|
+
return { ref: info.name };
|
|
1590
|
+
},
|
|
1591
|
+
async list(projectRoot) {
|
|
1592
|
+
const entries = await listCloudCheckpoints(projectRoot, BACKEND_NAME);
|
|
1593
|
+
return entries.map((e) => ({ ref: e.name, createdAt: e.manifest.createdAt }));
|
|
1594
|
+
},
|
|
1595
|
+
async remove(projectRoot, ref) {
|
|
1596
|
+
const entry = await resolveCloudCheckpoint(projectRoot, BACKEND_NAME, ref);
|
|
1597
|
+
if (!entry) return;
|
|
1598
|
+
try {
|
|
1599
|
+
await deleteVercelSnapshot(entry.manifest.snapshotName);
|
|
1600
|
+
} catch {
|
|
1601
|
+
}
|
|
1602
|
+
await removeCloudCheckpointDir(projectRoot, BACKEND_NAME, ref);
|
|
1603
|
+
}
|
|
1604
|
+
};
|
|
1605
|
+
var vercelProvider = {
|
|
1606
|
+
...cloudProvider,
|
|
1607
|
+
prepare: prepareVercelProvider,
|
|
1608
|
+
buildAttach: buildVercelAttach,
|
|
1609
|
+
checkpoint: vercelCheckpoint,
|
|
1610
|
+
baseFingerprint: () => currentVercelBaseFingerprintLive()
|
|
1611
|
+
};
|
|
1612
|
+
var providerModule = {
|
|
1613
|
+
provider: vercelProvider,
|
|
1614
|
+
backend: vercelBackend,
|
|
1615
|
+
ensureCredentials: ensureVercelCredentials,
|
|
1616
|
+
readCredStatus: readCredStatusSummary,
|
|
1617
|
+
setCredentials: setVercelCredentials,
|
|
1618
|
+
currentBaseFingerprintLive: (claudeInstall) => currentVercelBaseFingerprintLive(claudeInstall),
|
|
1619
|
+
doctorChecks
|
|
1620
|
+
};
|
|
1621
|
+
export {
|
|
1622
|
+
DEFAULT_BOX_IMAGE_REF,
|
|
1623
|
+
RUNTIME_ASSETS,
|
|
1624
|
+
buildVercelAttach,
|
|
1625
|
+
candidatesFor,
|
|
1626
|
+
createGitDeployment,
|
|
1627
|
+
createGitProject,
|
|
1628
|
+
currentVercelBaseFingerprintLive,
|
|
1629
|
+
deleteProject,
|
|
1630
|
+
ensureVercelBaseSnapshot,
|
|
1631
|
+
ensureVercelCredentials,
|
|
1632
|
+
ensureVercelEnvLoaded,
|
|
1633
|
+
findStagedCliRuntimeRoot,
|
|
1634
|
+
getDeployment,
|
|
1635
|
+
getProductionAlias,
|
|
1636
|
+
getProject,
|
|
1637
|
+
maskKey,
|
|
1638
|
+
patchProjectSettings,
|
|
1639
|
+
prepareVercel,
|
|
1640
|
+
prepareVercelProvider,
|
|
1641
|
+
preparedStatePath,
|
|
1642
|
+
projectHasEnv,
|
|
1643
|
+
providerModule,
|
|
1644
|
+
readPreparedState,
|
|
1645
|
+
readVercelCredStatus,
|
|
1646
|
+
reloadVercelEnv,
|
|
1647
|
+
resolveRuntimeAssets,
|
|
1648
|
+
resolveVercelApiAuth,
|
|
1649
|
+
secretsPath,
|
|
1650
|
+
setVercelCredentials,
|
|
1651
|
+
updatePreparedState,
|
|
1652
|
+
upsertProjectEnv,
|
|
1653
|
+
vercelBackend,
|
|
1654
|
+
vercelProvider,
|
|
1655
|
+
writePreparedState
|
|
1656
|
+
};
|