@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
package/runtime/relay/bin.cjs
CHANGED
|
@@ -3130,12 +3130,12 @@ var require_isexe = __commonJS({
|
|
|
3130
3130
|
if (typeof Promise !== "function") {
|
|
3131
3131
|
throw new TypeError("callback not provided");
|
|
3132
3132
|
}
|
|
3133
|
-
return new Promise(function(
|
|
3133
|
+
return new Promise(function(resolve4, reject) {
|
|
3134
3134
|
isexe(path6, options || {}, function(er, is) {
|
|
3135
3135
|
if (er) {
|
|
3136
3136
|
reject(er);
|
|
3137
3137
|
} else {
|
|
3138
|
-
|
|
3138
|
+
resolve4(is);
|
|
3139
3139
|
}
|
|
3140
3140
|
});
|
|
3141
3141
|
});
|
|
@@ -3202,27 +3202,27 @@ var require_which = __commonJS({
|
|
|
3202
3202
|
opt = {};
|
|
3203
3203
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
3204
3204
|
const found = [];
|
|
3205
|
-
const step = (i2) => new Promise((
|
|
3205
|
+
const step = (i2) => new Promise((resolve4, reject) => {
|
|
3206
3206
|
if (i2 === pathEnv.length)
|
|
3207
|
-
return opt.all && found.length ?
|
|
3207
|
+
return opt.all && found.length ? resolve4(found) : reject(getNotFoundError(cmd));
|
|
3208
3208
|
const ppRaw = pathEnv[i2];
|
|
3209
3209
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
3210
3210
|
const pCmd = path6.join(pathPart, cmd);
|
|
3211
3211
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
3212
|
-
|
|
3212
|
+
resolve4(subStep(p, i2, 0));
|
|
3213
3213
|
});
|
|
3214
|
-
const subStep = (p, i2, ii) => new Promise((
|
|
3214
|
+
const subStep = (p, i2, ii) => new Promise((resolve4, reject) => {
|
|
3215
3215
|
if (ii === pathExt.length)
|
|
3216
|
-
return
|
|
3216
|
+
return resolve4(step(i2 + 1));
|
|
3217
3217
|
const ext = pathExt[ii];
|
|
3218
3218
|
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
3219
3219
|
if (!er && is) {
|
|
3220
3220
|
if (opt.all)
|
|
3221
3221
|
found.push(p + ext);
|
|
3222
3222
|
else
|
|
3223
|
-
return
|
|
3223
|
+
return resolve4(p + ext);
|
|
3224
3224
|
}
|
|
3225
|
-
return
|
|
3225
|
+
return resolve4(subStep(p, i2, ii + 1));
|
|
3226
3226
|
});
|
|
3227
3227
|
});
|
|
3228
3228
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -3434,7 +3434,7 @@ var require_parse = __commonJS({
|
|
|
3434
3434
|
}
|
|
3435
3435
|
return parsed;
|
|
3436
3436
|
}
|
|
3437
|
-
function
|
|
3437
|
+
function parse2(command, args, options) {
|
|
3438
3438
|
if (args && !Array.isArray(args)) {
|
|
3439
3439
|
options = args;
|
|
3440
3440
|
args = null;
|
|
@@ -3453,7 +3453,7 @@ var require_parse = __commonJS({
|
|
|
3453
3453
|
};
|
|
3454
3454
|
return options.shell ? parsed : parseNonShell(parsed);
|
|
3455
3455
|
}
|
|
3456
|
-
module2.exports =
|
|
3456
|
+
module2.exports = parse2;
|
|
3457
3457
|
}
|
|
3458
3458
|
});
|
|
3459
3459
|
|
|
@@ -3512,16 +3512,16 @@ var require_cross_spawn = __commonJS({
|
|
|
3512
3512
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports2, module2) {
|
|
3513
3513
|
"use strict";
|
|
3514
3514
|
var cp = require("child_process");
|
|
3515
|
-
var
|
|
3515
|
+
var parse2 = require_parse();
|
|
3516
3516
|
var enoent = require_enoent();
|
|
3517
3517
|
function spawn7(command, args, options) {
|
|
3518
|
-
const parsed =
|
|
3518
|
+
const parsed = parse2(command, args, options);
|
|
3519
3519
|
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
3520
3520
|
enoent.hookChildProcess(spawned, parsed);
|
|
3521
3521
|
return spawned;
|
|
3522
3522
|
}
|
|
3523
3523
|
function spawnSync2(command, args, options) {
|
|
3524
|
-
const parsed =
|
|
3524
|
+
const parsed = parse2(command, args, options);
|
|
3525
3525
|
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
3526
3526
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
3527
3527
|
return result;
|
|
@@ -3529,7 +3529,7 @@ var require_cross_spawn = __commonJS({
|
|
|
3529
3529
|
module2.exports = spawn7;
|
|
3530
3530
|
module2.exports.spawn = spawn7;
|
|
3531
3531
|
module2.exports.sync = spawnSync2;
|
|
3532
|
-
module2.exports._parse =
|
|
3532
|
+
module2.exports._parse = parse2;
|
|
3533
3533
|
module2.exports._enoent = enoent;
|
|
3534
3534
|
}
|
|
3535
3535
|
});
|
|
@@ -5002,7 +5002,7 @@ var require_stringify = __commonJS({
|
|
|
5002
5002
|
props.push(doc.directives.tagString(tag));
|
|
5003
5003
|
return props.join(" ");
|
|
5004
5004
|
}
|
|
5005
|
-
function
|
|
5005
|
+
function stringify2(item, ctx, onComment, onChompKeep) {
|
|
5006
5006
|
if (identity3.isPair(item))
|
|
5007
5007
|
return item.toString(ctx, onComment, onChompKeep);
|
|
5008
5008
|
if (identity3.isAlias(item)) {
|
|
@@ -5031,7 +5031,7 @@ var require_stringify = __commonJS({
|
|
|
5031
5031
|
${ctx.indent}${str}`;
|
|
5032
5032
|
}
|
|
5033
5033
|
exports2.createStringifyContext = createStringifyContext;
|
|
5034
|
-
exports2.stringify =
|
|
5034
|
+
exports2.stringify = stringify2;
|
|
5035
5035
|
}
|
|
5036
5036
|
});
|
|
5037
5037
|
|
|
@@ -5041,7 +5041,7 @@ var require_stringifyPair = __commonJS({
|
|
|
5041
5041
|
"use strict";
|
|
5042
5042
|
var identity3 = require_identity();
|
|
5043
5043
|
var Scalar = require_Scalar();
|
|
5044
|
-
var
|
|
5044
|
+
var stringify2 = require_stringify();
|
|
5045
5045
|
var stringifyComment = require_stringifyComment();
|
|
5046
5046
|
function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
5047
5047
|
const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
|
@@ -5063,7 +5063,7 @@ var require_stringifyPair = __commonJS({
|
|
|
5063
5063
|
});
|
|
5064
5064
|
let keyCommentDone = false;
|
|
5065
5065
|
let chompKeep = false;
|
|
5066
|
-
let str =
|
|
5066
|
+
let str = stringify2.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
|
|
5067
5067
|
if (!explicitKey && !ctx.inFlow && str.length > 1024) {
|
|
5068
5068
|
if (simpleKeys)
|
|
5069
5069
|
throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
|
|
@@ -5115,7 +5115,7 @@ ${indent}:`;
|
|
|
5115
5115
|
ctx.indent = ctx.indent.substring(2);
|
|
5116
5116
|
}
|
|
5117
5117
|
let valueCommentDone = false;
|
|
5118
|
-
const valueStr =
|
|
5118
|
+
const valueStr = stringify2.stringify(value, ctx, () => valueCommentDone = true, () => chompKeep = true);
|
|
5119
5119
|
let ws = " ";
|
|
5120
5120
|
if (keyComment || vsb || vcb) {
|
|
5121
5121
|
ws = vsb ? "\n" : "";
|
|
@@ -5256,7 +5256,7 @@ var require_addPairToJSMap = __commonJS({
|
|
|
5256
5256
|
"use strict";
|
|
5257
5257
|
var log = require_log();
|
|
5258
5258
|
var merge = require_merge();
|
|
5259
|
-
var
|
|
5259
|
+
var stringify2 = require_stringify();
|
|
5260
5260
|
var identity3 = require_identity();
|
|
5261
5261
|
var toJS = require_toJS();
|
|
5262
5262
|
function addPairToJSMap(ctx, map, { key, value }) {
|
|
@@ -5292,7 +5292,7 @@ var require_addPairToJSMap = __commonJS({
|
|
|
5292
5292
|
if (typeof jsKey !== "object")
|
|
5293
5293
|
return String(jsKey);
|
|
5294
5294
|
if (identity3.isNode(key) && ctx?.doc) {
|
|
5295
|
-
const strCtx =
|
|
5295
|
+
const strCtx = stringify2.createStringifyContext(ctx.doc, {});
|
|
5296
5296
|
strCtx.anchors = /* @__PURE__ */ new Set();
|
|
5297
5297
|
for (const node of ctx.anchors.keys())
|
|
5298
5298
|
strCtx.anchors.add(node.anchor);
|
|
@@ -5359,12 +5359,12 @@ var require_stringifyCollection = __commonJS({
|
|
|
5359
5359
|
"../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyCollection.js"(exports2) {
|
|
5360
5360
|
"use strict";
|
|
5361
5361
|
var identity3 = require_identity();
|
|
5362
|
-
var
|
|
5362
|
+
var stringify2 = require_stringify();
|
|
5363
5363
|
var stringifyComment = require_stringifyComment();
|
|
5364
5364
|
function stringifyCollection(collection, ctx, options) {
|
|
5365
5365
|
const flow = ctx.inFlow ?? collection.flow;
|
|
5366
|
-
const
|
|
5367
|
-
return
|
|
5366
|
+
const stringify3 = flow ? stringifyFlowCollection : stringifyBlockCollection;
|
|
5367
|
+
return stringify3(collection, ctx, options);
|
|
5368
5368
|
}
|
|
5369
5369
|
function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
|
|
5370
5370
|
const { indent, options: { commentString } } = ctx;
|
|
@@ -5389,7 +5389,7 @@ var require_stringifyCollection = __commonJS({
|
|
|
5389
5389
|
}
|
|
5390
5390
|
}
|
|
5391
5391
|
chompKeep = false;
|
|
5392
|
-
let str2 =
|
|
5392
|
+
let str2 = stringify2.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
|
|
5393
5393
|
if (comment2)
|
|
5394
5394
|
str2 += stringifyComment.lineComment(str2, itemIndent, commentString(comment2));
|
|
5395
5395
|
if (chompKeep && comment2)
|
|
@@ -5456,7 +5456,7 @@ ${indent}${line}` : "\n";
|
|
|
5456
5456
|
}
|
|
5457
5457
|
if (comment)
|
|
5458
5458
|
reqNewline = true;
|
|
5459
|
-
let str =
|
|
5459
|
+
let str = stringify2.stringify(item, itemCtx, () => comment = null);
|
|
5460
5460
|
reqNewline || (reqNewline = lines.length > linesAtValue || str.includes("\n"));
|
|
5461
5461
|
if (i2 < items.length - 1) {
|
|
5462
5462
|
str += ",";
|
|
@@ -6817,7 +6817,7 @@ var require_stringifyDocument = __commonJS({
|
|
|
6817
6817
|
"../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyDocument.js"(exports2) {
|
|
6818
6818
|
"use strict";
|
|
6819
6819
|
var identity3 = require_identity();
|
|
6820
|
-
var
|
|
6820
|
+
var stringify2 = require_stringify();
|
|
6821
6821
|
var stringifyComment = require_stringifyComment();
|
|
6822
6822
|
function stringifyDocument(doc, options) {
|
|
6823
6823
|
const lines = [];
|
|
@@ -6832,7 +6832,7 @@ var require_stringifyDocument = __commonJS({
|
|
|
6832
6832
|
}
|
|
6833
6833
|
if (hasDirectives)
|
|
6834
6834
|
lines.push("---");
|
|
6835
|
-
const ctx =
|
|
6835
|
+
const ctx = stringify2.createStringifyContext(doc, options);
|
|
6836
6836
|
const { commentString } = ctx.options;
|
|
6837
6837
|
if (doc.commentBefore) {
|
|
6838
6838
|
if (lines.length !== 1)
|
|
@@ -6854,7 +6854,7 @@ var require_stringifyDocument = __commonJS({
|
|
|
6854
6854
|
contentComment = doc.contents.comment;
|
|
6855
6855
|
}
|
|
6856
6856
|
const onChompKeep = contentComment ? void 0 : () => chompKeep = true;
|
|
6857
|
-
let body =
|
|
6857
|
+
let body = stringify2.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep);
|
|
6858
6858
|
if (contentComment)
|
|
6859
6859
|
body += stringifyComment.lineComment(body, "", commentString(contentComment));
|
|
6860
6860
|
if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") {
|
|
@@ -6862,7 +6862,7 @@ var require_stringifyDocument = __commonJS({
|
|
|
6862
6862
|
} else
|
|
6863
6863
|
lines.push(body);
|
|
6864
6864
|
} else {
|
|
6865
|
-
lines.push(
|
|
6865
|
+
lines.push(stringify2.stringify(doc.contents, ctx));
|
|
6866
6866
|
}
|
|
6867
6867
|
if (doc.directives?.docEnd) {
|
|
6868
6868
|
if (doc.comment) {
|
|
@@ -7495,10 +7495,10 @@ var require_resolve_block_map = __commonJS({
|
|
|
7495
7495
|
let offset = bm.offset;
|
|
7496
7496
|
let commentEnd = null;
|
|
7497
7497
|
for (const collItem of bm.items) {
|
|
7498
|
-
const { start, key, sep, value } = collItem;
|
|
7498
|
+
const { start, key, sep: sep2, value } = collItem;
|
|
7499
7499
|
const keyProps = resolveProps.resolveProps(start, {
|
|
7500
7500
|
indicator: "explicit-key-ind",
|
|
7501
|
-
next: key ??
|
|
7501
|
+
next: key ?? sep2?.[0],
|
|
7502
7502
|
offset,
|
|
7503
7503
|
onError,
|
|
7504
7504
|
parentIndent: bm.indent,
|
|
@@ -7512,7 +7512,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
7512
7512
|
else if ("indent" in key && key.indent !== bm.indent)
|
|
7513
7513
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
7514
7514
|
}
|
|
7515
|
-
if (!keyProps.anchor && !keyProps.tag && !
|
|
7515
|
+
if (!keyProps.anchor && !keyProps.tag && !sep2) {
|
|
7516
7516
|
commentEnd = keyProps.end;
|
|
7517
7517
|
if (keyProps.comment) {
|
|
7518
7518
|
if (map.comment)
|
|
@@ -7536,7 +7536,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
7536
7536
|
ctx.atKey = false;
|
|
7537
7537
|
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
|
7538
7538
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
7539
|
-
const valueProps = resolveProps.resolveProps(
|
|
7539
|
+
const valueProps = resolveProps.resolveProps(sep2 ?? [], {
|
|
7540
7540
|
indicator: "map-value-ind",
|
|
7541
7541
|
next: value,
|
|
7542
7542
|
offset: keyNode.range[2],
|
|
@@ -7552,7 +7552,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
7552
7552
|
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
|
|
7553
7553
|
onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
|
|
7554
7554
|
}
|
|
7555
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset,
|
|
7555
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep2, null, valueProps, onError);
|
|
7556
7556
|
if (ctx.schema.compat)
|
|
7557
7557
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
|
|
7558
7558
|
offset = valueNode.range[2];
|
|
@@ -7643,7 +7643,7 @@ var require_resolve_end = __commonJS({
|
|
|
7643
7643
|
let comment = "";
|
|
7644
7644
|
if (end) {
|
|
7645
7645
|
let hasSpace = false;
|
|
7646
|
-
let
|
|
7646
|
+
let sep2 = "";
|
|
7647
7647
|
for (const token of end) {
|
|
7648
7648
|
const { source, type } = token;
|
|
7649
7649
|
switch (type) {
|
|
@@ -7657,13 +7657,13 @@ var require_resolve_end = __commonJS({
|
|
|
7657
7657
|
if (!comment)
|
|
7658
7658
|
comment = cb;
|
|
7659
7659
|
else
|
|
7660
|
-
comment +=
|
|
7661
|
-
|
|
7660
|
+
comment += sep2 + cb;
|
|
7661
|
+
sep2 = "";
|
|
7662
7662
|
break;
|
|
7663
7663
|
}
|
|
7664
7664
|
case "newline":
|
|
7665
7665
|
if (comment)
|
|
7666
|
-
|
|
7666
|
+
sep2 += source;
|
|
7667
7667
|
hasSpace = true;
|
|
7668
7668
|
break;
|
|
7669
7669
|
default:
|
|
@@ -7706,18 +7706,18 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
7706
7706
|
let offset = fc.offset + fc.start.source.length;
|
|
7707
7707
|
for (let i2 = 0; i2 < fc.items.length; ++i2) {
|
|
7708
7708
|
const collItem = fc.items[i2];
|
|
7709
|
-
const { start, key, sep, value } = collItem;
|
|
7709
|
+
const { start, key, sep: sep2, value } = collItem;
|
|
7710
7710
|
const props = resolveProps.resolveProps(start, {
|
|
7711
7711
|
flow: fcName,
|
|
7712
7712
|
indicator: "explicit-key-ind",
|
|
7713
|
-
next: key ??
|
|
7713
|
+
next: key ?? sep2?.[0],
|
|
7714
7714
|
offset,
|
|
7715
7715
|
onError,
|
|
7716
7716
|
parentIndent: fc.indent,
|
|
7717
7717
|
startOnNewline: false
|
|
7718
7718
|
});
|
|
7719
7719
|
if (!props.found) {
|
|
7720
|
-
if (!props.anchor && !props.tag && !
|
|
7720
|
+
if (!props.anchor && !props.tag && !sep2 && !value) {
|
|
7721
7721
|
if (i2 === 0 && props.comma)
|
|
7722
7722
|
onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
7723
7723
|
else if (i2 < fc.items.length - 1)
|
|
@@ -7771,8 +7771,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
7771
7771
|
}
|
|
7772
7772
|
}
|
|
7773
7773
|
}
|
|
7774
|
-
if (!isMap && !
|
|
7775
|
-
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end,
|
|
7774
|
+
if (!isMap && !sep2 && !props.found) {
|
|
7775
|
+
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep2, null, props, onError);
|
|
7776
7776
|
coll.items.push(valueNode);
|
|
7777
7777
|
offset = valueNode.range[2];
|
|
7778
7778
|
if (isBlock(value))
|
|
@@ -7784,7 +7784,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
7784
7784
|
if (isBlock(key))
|
|
7785
7785
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
7786
7786
|
ctx.atKey = false;
|
|
7787
|
-
const valueProps = resolveProps.resolveProps(
|
|
7787
|
+
const valueProps = resolveProps.resolveProps(sep2 ?? [], {
|
|
7788
7788
|
flow: fcName,
|
|
7789
7789
|
indicator: "map-value-ind",
|
|
7790
7790
|
next: value,
|
|
@@ -7795,8 +7795,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
7795
7795
|
});
|
|
7796
7796
|
if (valueProps.found) {
|
|
7797
7797
|
if (!isMap && !props.found && ctx.options.strict) {
|
|
7798
|
-
if (
|
|
7799
|
-
for (const st of
|
|
7798
|
+
if (sep2)
|
|
7799
|
+
for (const st of sep2) {
|
|
7800
7800
|
if (st === valueProps.found)
|
|
7801
7801
|
break;
|
|
7802
7802
|
if (st.type === "newline") {
|
|
@@ -7813,7 +7813,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
7813
7813
|
else
|
|
7814
7814
|
onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
7815
7815
|
}
|
|
7816
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end,
|
|
7816
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep2, null, valueProps, onError) : null;
|
|
7817
7817
|
if (valueNode) {
|
|
7818
7818
|
if (isBlock(value))
|
|
7819
7819
|
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
@@ -7993,7 +7993,7 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
7993
7993
|
chompStart = i2 + 1;
|
|
7994
7994
|
}
|
|
7995
7995
|
let value = "";
|
|
7996
|
-
let
|
|
7996
|
+
let sep2 = "";
|
|
7997
7997
|
let prevMoreIndented = false;
|
|
7998
7998
|
for (let i2 = 0; i2 < contentStart; ++i2)
|
|
7999
7999
|
value += lines[i2][0].slice(trimIndent) + "\n";
|
|
@@ -8010,24 +8010,24 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
8010
8010
|
indent = "";
|
|
8011
8011
|
}
|
|
8012
8012
|
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
8013
|
-
value +=
|
|
8014
|
-
|
|
8013
|
+
value += sep2 + indent.slice(trimIndent) + content;
|
|
8014
|
+
sep2 = "\n";
|
|
8015
8015
|
} else if (indent.length > trimIndent || content[0] === " ") {
|
|
8016
|
-
if (
|
|
8017
|
-
|
|
8018
|
-
else if (!prevMoreIndented &&
|
|
8019
|
-
|
|
8020
|
-
value +=
|
|
8021
|
-
|
|
8016
|
+
if (sep2 === " ")
|
|
8017
|
+
sep2 = "\n";
|
|
8018
|
+
else if (!prevMoreIndented && sep2 === "\n")
|
|
8019
|
+
sep2 = "\n\n";
|
|
8020
|
+
value += sep2 + indent.slice(trimIndent) + content;
|
|
8021
|
+
sep2 = "\n";
|
|
8022
8022
|
prevMoreIndented = true;
|
|
8023
8023
|
} else if (content === "") {
|
|
8024
|
-
if (
|
|
8024
|
+
if (sep2 === "\n")
|
|
8025
8025
|
value += "\n";
|
|
8026
8026
|
else
|
|
8027
|
-
|
|
8027
|
+
sep2 = "\n";
|
|
8028
8028
|
} else {
|
|
8029
|
-
value +=
|
|
8030
|
-
|
|
8029
|
+
value += sep2 + content;
|
|
8030
|
+
sep2 = " ";
|
|
8031
8031
|
prevMoreIndented = false;
|
|
8032
8032
|
}
|
|
8033
8033
|
}
|
|
@@ -8209,25 +8209,25 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
8209
8209
|
if (!match)
|
|
8210
8210
|
return source;
|
|
8211
8211
|
let res = match[1];
|
|
8212
|
-
let
|
|
8212
|
+
let sep2 = " ";
|
|
8213
8213
|
let pos = first.lastIndex;
|
|
8214
8214
|
line.lastIndex = pos;
|
|
8215
8215
|
while (match = line.exec(source)) {
|
|
8216
8216
|
if (match[1] === "") {
|
|
8217
|
-
if (
|
|
8218
|
-
res +=
|
|
8217
|
+
if (sep2 === "\n")
|
|
8218
|
+
res += sep2;
|
|
8219
8219
|
else
|
|
8220
|
-
|
|
8220
|
+
sep2 = "\n";
|
|
8221
8221
|
} else {
|
|
8222
|
-
res +=
|
|
8223
|
-
|
|
8222
|
+
res += sep2 + match[1];
|
|
8223
|
+
sep2 = " ";
|
|
8224
8224
|
}
|
|
8225
8225
|
pos = line.lastIndex;
|
|
8226
8226
|
}
|
|
8227
8227
|
const last = /[ \t]*(.*)/sy;
|
|
8228
8228
|
last.lastIndex = pos;
|
|
8229
8229
|
match = last.exec(source);
|
|
8230
|
-
return res +
|
|
8230
|
+
return res + sep2 + (match?.[1] ?? "");
|
|
8231
8231
|
}
|
|
8232
8232
|
function doubleQuotedValue(source, onError) {
|
|
8233
8233
|
let res = "";
|
|
@@ -8997,7 +8997,7 @@ var require_cst_scalar = __commonJS({
|
|
|
8997
8997
|
var require_cst_stringify = __commonJS({
|
|
8998
8998
|
"../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-stringify.js"(exports2) {
|
|
8999
8999
|
"use strict";
|
|
9000
|
-
var
|
|
9000
|
+
var stringify2 = (cst) => "type" in cst ? stringifyToken(cst) : stringifyItem(cst);
|
|
9001
9001
|
function stringifyToken(token) {
|
|
9002
9002
|
switch (token.type) {
|
|
9003
9003
|
case "block-scalar": {
|
|
@@ -9037,20 +9037,20 @@ var require_cst_stringify = __commonJS({
|
|
|
9037
9037
|
}
|
|
9038
9038
|
}
|
|
9039
9039
|
}
|
|
9040
|
-
function stringifyItem({ start, key, sep, value }) {
|
|
9040
|
+
function stringifyItem({ start, key, sep: sep2, value }) {
|
|
9041
9041
|
let res = "";
|
|
9042
9042
|
for (const st of start)
|
|
9043
9043
|
res += st.source;
|
|
9044
9044
|
if (key)
|
|
9045
9045
|
res += stringifyToken(key);
|
|
9046
|
-
if (
|
|
9047
|
-
for (const st of
|
|
9046
|
+
if (sep2)
|
|
9047
|
+
for (const st of sep2)
|
|
9048
9048
|
res += st.source;
|
|
9049
9049
|
if (value)
|
|
9050
9050
|
res += stringifyToken(value);
|
|
9051
9051
|
return res;
|
|
9052
9052
|
}
|
|
9053
|
-
exports2.stringify =
|
|
9053
|
+
exports2.stringify = stringify2;
|
|
9054
9054
|
}
|
|
9055
9055
|
});
|
|
9056
9056
|
|
|
@@ -10211,18 +10211,18 @@ var require_parser = __commonJS({
|
|
|
10211
10211
|
if (this.type === "map-value-ind") {
|
|
10212
10212
|
const prev = getPrevProps(this.peek(2));
|
|
10213
10213
|
const start = getFirstKeyStartProps(prev);
|
|
10214
|
-
let
|
|
10214
|
+
let sep2;
|
|
10215
10215
|
if (scalar.end) {
|
|
10216
|
-
|
|
10217
|
-
|
|
10216
|
+
sep2 = scalar.end;
|
|
10217
|
+
sep2.push(this.sourceToken);
|
|
10218
10218
|
delete scalar.end;
|
|
10219
10219
|
} else
|
|
10220
|
-
|
|
10220
|
+
sep2 = [this.sourceToken];
|
|
10221
10221
|
const map = {
|
|
10222
10222
|
type: "block-map",
|
|
10223
10223
|
offset: scalar.offset,
|
|
10224
10224
|
indent: scalar.indent,
|
|
10225
|
-
items: [{ start, key: scalar, sep }]
|
|
10225
|
+
items: [{ start, key: scalar, sep: sep2 }]
|
|
10226
10226
|
};
|
|
10227
10227
|
this.onKeyLine = true;
|
|
10228
10228
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -10375,15 +10375,15 @@ var require_parser = __commonJS({
|
|
|
10375
10375
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
10376
10376
|
const start2 = getFirstKeyStartProps(it.start);
|
|
10377
10377
|
const key = it.key;
|
|
10378
|
-
const
|
|
10379
|
-
|
|
10378
|
+
const sep2 = it.sep;
|
|
10379
|
+
sep2.push(this.sourceToken);
|
|
10380
10380
|
delete it.key;
|
|
10381
10381
|
delete it.sep;
|
|
10382
10382
|
this.stack.push({
|
|
10383
10383
|
type: "block-map",
|
|
10384
10384
|
offset: this.offset,
|
|
10385
10385
|
indent: this.indent,
|
|
10386
|
-
items: [{ start: start2, key, sep }]
|
|
10386
|
+
items: [{ start: start2, key, sep: sep2 }]
|
|
10387
10387
|
});
|
|
10388
10388
|
} else if (start.length > 0) {
|
|
10389
10389
|
it.sep = it.sep.concat(start, this.sourceToken);
|
|
@@ -10577,13 +10577,13 @@ var require_parser = __commonJS({
|
|
|
10577
10577
|
const prev = getPrevProps(parent);
|
|
10578
10578
|
const start = getFirstKeyStartProps(prev);
|
|
10579
10579
|
fixFlowSeqItems(fc);
|
|
10580
|
-
const
|
|
10581
|
-
|
|
10580
|
+
const sep2 = fc.end.splice(1, fc.end.length);
|
|
10581
|
+
sep2.push(this.sourceToken);
|
|
10582
10582
|
const map = {
|
|
10583
10583
|
type: "block-map",
|
|
10584
10584
|
offset: fc.offset,
|
|
10585
10585
|
indent: fc.indent,
|
|
10586
|
-
items: [{ start, key: fc, sep }]
|
|
10586
|
+
items: [{ start, key: fc, sep: sep2 }]
|
|
10587
10587
|
};
|
|
10588
10588
|
this.onKeyLine = true;
|
|
10589
10589
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -10761,7 +10761,7 @@ var require_public_api = __commonJS({
|
|
|
10761
10761
|
}
|
|
10762
10762
|
return doc;
|
|
10763
10763
|
}
|
|
10764
|
-
function
|
|
10764
|
+
function parse2(src, reviver, options) {
|
|
10765
10765
|
let _reviver = void 0;
|
|
10766
10766
|
if (typeof reviver === "function") {
|
|
10767
10767
|
_reviver = reviver;
|
|
@@ -10780,7 +10780,7 @@ var require_public_api = __commonJS({
|
|
|
10780
10780
|
}
|
|
10781
10781
|
return doc.toJS(Object.assign({ reviver: _reviver }, options));
|
|
10782
10782
|
}
|
|
10783
|
-
function
|
|
10783
|
+
function stringify2(value, replacer, options) {
|
|
10784
10784
|
let _replacer = null;
|
|
10785
10785
|
if (typeof replacer === "function" || Array.isArray(replacer)) {
|
|
10786
10786
|
_replacer = replacer;
|
|
@@ -10802,10 +10802,10 @@ var require_public_api = __commonJS({
|
|
|
10802
10802
|
return value.toString(options);
|
|
10803
10803
|
return new Document.Document(value, _replacer, options).toString(options);
|
|
10804
10804
|
}
|
|
10805
|
-
exports2.parse =
|
|
10805
|
+
exports2.parse = parse2;
|
|
10806
10806
|
exports2.parseAllDocuments = parseAllDocuments;
|
|
10807
10807
|
exports2.parseDocument = parseDocument;
|
|
10808
|
-
exports2.stringify =
|
|
10808
|
+
exports2.stringify = stringify2;
|
|
10809
10809
|
}
|
|
10810
10810
|
});
|
|
10811
10811
|
|
|
@@ -10873,13 +10873,13 @@ function isConnectionLevelError(err) {
|
|
|
10873
10873
|
const msg = err instanceof Error ? err.message : String(err);
|
|
10874
10874
|
return /\b(ECONNREFUSED|ENOTFOUND|EHOSTUNREACH|ECONNRESET|EPIPE)\b/.test(msg);
|
|
10875
10875
|
}
|
|
10876
|
-
var import_node_http, import_node_https,
|
|
10876
|
+
var import_node_http, import_node_https, import_promises18, BACKOFF_BASE_MS, BACKOFF_MAX_MS, REQUEST_TIMEOUT_MS, FAST_REQUEST_TIMEOUT_MS, FAST_MODE_DECAY_POLLS, STOPPED_TICK_MS, CONNECTION_LEVEL_CODES, CloudBoxPoller, CloudBoxPollers;
|
|
10877
10877
|
var init_cloud_poller = __esm({
|
|
10878
10878
|
"src/cloud-poller.ts"() {
|
|
10879
10879
|
"use strict";
|
|
10880
10880
|
import_node_http = require("http");
|
|
10881
10881
|
import_node_https = require("https");
|
|
10882
|
-
|
|
10882
|
+
import_promises18 = require("timers/promises");
|
|
10883
10883
|
BACKOFF_BASE_MS = 1500;
|
|
10884
10884
|
BACKOFF_MAX_MS = 3e4;
|
|
10885
10885
|
REQUEST_TIMEOUT_MS = 25e3;
|
|
@@ -10947,7 +10947,7 @@ var init_cloud_poller = __esm({
|
|
|
10947
10947
|
stderr: result.stderr
|
|
10948
10948
|
};
|
|
10949
10949
|
const payload = JSON.stringify(body);
|
|
10950
|
-
await new Promise((
|
|
10950
|
+
await new Promise((resolve4, reject) => {
|
|
10951
10951
|
const headers = {
|
|
10952
10952
|
"Content-Type": "application/json",
|
|
10953
10953
|
"Content-Length": Buffer.byteLength(payload).toString(),
|
|
@@ -10967,7 +10967,7 @@ var init_cloud_poller = __esm({
|
|
|
10967
10967
|
},
|
|
10968
10968
|
(res) => {
|
|
10969
10969
|
res.resume();
|
|
10970
|
-
if ((res.statusCode ?? 0) >= 200 && (res.statusCode ?? 0) < 300)
|
|
10970
|
+
if ((res.statusCode ?? 0) >= 200 && (res.statusCode ?? 0) < 300) resolve4();
|
|
10971
10971
|
else reject(new Error(`bridge/action-result \u2192 ${String(res.statusCode)}`));
|
|
10972
10972
|
}
|
|
10973
10973
|
);
|
|
@@ -11033,12 +11033,12 @@ var init_cloud_poller = __esm({
|
|
|
11033
11033
|
if (this.currentBackoffMs === 0 && this.fastModePolls > 0) {
|
|
11034
11034
|
this.fastModePolls -= 1;
|
|
11035
11035
|
}
|
|
11036
|
-
if (this.currentBackoffMs === 0) await (0,
|
|
11036
|
+
if (this.currentBackoffMs === 0) await (0, import_promises18.setTimeout)(STOPPED_TICK_MS);
|
|
11037
11037
|
}
|
|
11038
11038
|
}
|
|
11039
11039
|
async backoff() {
|
|
11040
11040
|
this.currentBackoffMs = this.currentBackoffMs === 0 ? BACKOFF_BASE_MS : Math.min(this.currentBackoffMs * 2, BACKOFF_MAX_MS);
|
|
11041
|
-
await (0,
|
|
11041
|
+
await (0, import_promises18.setTimeout)(this.currentBackoffMs);
|
|
11042
11042
|
}
|
|
11043
11043
|
async tryRecoverPreviewUrl() {
|
|
11044
11044
|
if (!this.deps.recoverPreviewUrl) return;
|
|
@@ -11072,7 +11072,7 @@ var init_cloud_poller = __esm({
|
|
|
11072
11072
|
const transport = isHttps ? import_node_https.request : import_node_http.request;
|
|
11073
11073
|
const port = url.port.length > 0 ? Number.parseInt(url.port, 10) : isHttps ? 443 : 80;
|
|
11074
11074
|
const timeoutMs = this.fastModePolls > 0 ? FAST_REQUEST_TIMEOUT_MS : REQUEST_TIMEOUT_MS;
|
|
11075
|
-
return new Promise((
|
|
11075
|
+
return new Promise((resolve4, reject) => {
|
|
11076
11076
|
const headers = {
|
|
11077
11077
|
Authorization: `Bearer ${this.deps.bridgeToken}`,
|
|
11078
11078
|
Accept: "application/json"
|
|
@@ -11101,7 +11101,7 @@ var init_cloud_poller = __esm({
|
|
|
11101
11101
|
}
|
|
11102
11102
|
try {
|
|
11103
11103
|
const parsed = JSON.parse(text);
|
|
11104
|
-
|
|
11104
|
+
resolve4({
|
|
11105
11105
|
actions: Array.isArray(parsed.actions) ? parsed.actions : [],
|
|
11106
11106
|
events: Array.isArray(parsed.events) ? parsed.events : [],
|
|
11107
11107
|
status: parsed.status ?? null,
|
|
@@ -12730,8 +12730,8 @@ var disconnect = (anyProcess) => {
|
|
|
12730
12730
|
// ../../node_modules/.pnpm/execa@9.6.1/node_modules/execa/lib/utils/deferred.js
|
|
12731
12731
|
var createDeferred = () => {
|
|
12732
12732
|
const methods = {};
|
|
12733
|
-
const promise = new Promise((
|
|
12734
|
-
Object.assign(methods, { resolve:
|
|
12733
|
+
const promise = new Promise((resolve4, reject) => {
|
|
12734
|
+
Object.assign(methods, { resolve: resolve4, reject });
|
|
12735
12735
|
});
|
|
12736
12736
|
return Object.assign(promise, methods);
|
|
12737
12737
|
};
|
|
@@ -17368,11 +17368,11 @@ var addConcurrentStream = (concurrentStreams, stream, waitName) => {
|
|
|
17368
17368
|
const promises = weakMap.get(stream);
|
|
17369
17369
|
const promise = createDeferred();
|
|
17370
17370
|
promises.push(promise);
|
|
17371
|
-
const
|
|
17372
|
-
return { resolve:
|
|
17371
|
+
const resolve4 = promise.resolve.bind(promise);
|
|
17372
|
+
return { resolve: resolve4, promises };
|
|
17373
17373
|
};
|
|
17374
|
-
var waitForConcurrentStreams = async ({ resolve:
|
|
17375
|
-
|
|
17374
|
+
var waitForConcurrentStreams = async ({ resolve: resolve4, promises }, subprocess) => {
|
|
17375
|
+
resolve4();
|
|
17376
17376
|
const [isSubprocessExit] = await Promise.race([
|
|
17377
17377
|
Promise.allSettled([true, subprocess]),
|
|
17378
17378
|
Promise.all([false, ...promises])
|
|
@@ -17958,16 +17958,16 @@ var {
|
|
|
17958
17958
|
} = getIpcExport();
|
|
17959
17959
|
|
|
17960
17960
|
// src/host-actions.ts
|
|
17961
|
-
var
|
|
17961
|
+
var import_promises16 = require("fs/promises");
|
|
17962
17962
|
var import_node_os4 = require("os");
|
|
17963
17963
|
var import_node_path6 = require("path");
|
|
17964
|
+
var import_node_url3 = require("url");
|
|
17964
17965
|
|
|
17965
|
-
// ../
|
|
17966
|
-
var import_promises12 = require("fs/promises");
|
|
17966
|
+
// ../core/dist/index.js
|
|
17967
17967
|
var import_os = require("os");
|
|
17968
17968
|
var import_path = require("path");
|
|
17969
|
-
|
|
17970
|
-
|
|
17969
|
+
var import_promises12 = require("fs/promises");
|
|
17970
|
+
var import_path2 = require("path");
|
|
17971
17971
|
var PLACEHOLDER_KEYS = [
|
|
17972
17972
|
"AGENTBOX_BOX_NAME",
|
|
17973
17973
|
"AGENTBOX_BOX_ID",
|
|
@@ -17982,14 +17982,117 @@ var PLACEHOLDER_KEYS = [
|
|
|
17982
17982
|
"AGENTBOX_BOX_HOST"
|
|
17983
17983
|
];
|
|
17984
17984
|
var PLACEHOLDER_SET = new Set(PLACEHOLDER_KEYS);
|
|
17985
|
+
function parseDownloadKind(method) {
|
|
17986
|
+
return method.split(".")[1] ?? "workspace";
|
|
17987
|
+
}
|
|
17988
|
+
function resolveHostPath(workspacePath, hostPath) {
|
|
17989
|
+
if ((0, import_path.isAbsolute)(hostPath)) return hostPath;
|
|
17990
|
+
if (hostPath === "~") return (0, import_os.homedir)();
|
|
17991
|
+
if (hostPath.startsWith("~/")) return (0, import_path.join)((0, import_os.homedir)(), hostPath.slice(2));
|
|
17992
|
+
return workspacePath ? (0, import_path.resolve)(workspacePath, hostPath) : (0, import_path.resolve)(hostPath);
|
|
17993
|
+
}
|
|
17994
|
+
async function realpathSafe(p) {
|
|
17995
|
+
try {
|
|
17996
|
+
return await (0, import_promises12.realpath)(p);
|
|
17997
|
+
} catch {
|
|
17998
|
+
return (0, import_path2.resolve)(p);
|
|
17999
|
+
}
|
|
18000
|
+
}
|
|
18001
|
+
function isInside(child, parent) {
|
|
18002
|
+
const c3 = (0, import_path2.resolve)(child);
|
|
18003
|
+
const p = (0, import_path2.resolve)(parent);
|
|
18004
|
+
if (c3 === p) return true;
|
|
18005
|
+
return c3.startsWith(p + import_path2.sep);
|
|
18006
|
+
}
|
|
18007
|
+
async function realpathDeepestExisting(p) {
|
|
18008
|
+
let cur = (0, import_path2.resolve)(p);
|
|
18009
|
+
const tail = [];
|
|
18010
|
+
for (; ; ) {
|
|
18011
|
+
try {
|
|
18012
|
+
const real = await (0, import_promises12.realpath)(cur);
|
|
18013
|
+
return tail.length > 0 ? (0, import_path2.resolve)(real, ...tail.reverse()) : real;
|
|
18014
|
+
} catch (err) {
|
|
18015
|
+
if (err.code !== "ENOENT") return (0, import_path2.resolve)(p);
|
|
18016
|
+
const parent = (0, import_path2.dirname)(cur);
|
|
18017
|
+
if (parent === cur) return (0, import_path2.resolve)(p);
|
|
18018
|
+
tail.push((0, import_path2.basename)(cur));
|
|
18019
|
+
cur = parent;
|
|
18020
|
+
}
|
|
18021
|
+
}
|
|
18022
|
+
}
|
|
18023
|
+
async function isContainedInWorkspace(hostPath, workspacePath) {
|
|
18024
|
+
if (!workspacePath) return false;
|
|
18025
|
+
if (!(0, import_path2.isAbsolute)(hostPath)) return false;
|
|
18026
|
+
if ((0, import_path2.normalize)(hostPath).split(import_path2.sep).includes("..")) return false;
|
|
18027
|
+
const wsReal = await realpathSafe(workspacePath);
|
|
18028
|
+
const real = await realpathDeepestExisting(hostPath);
|
|
18029
|
+
return isInside(real, wsReal);
|
|
18030
|
+
}
|
|
18031
|
+
var SECRET_DIR_SEGMENTS = /* @__PURE__ */ new Set([".ssh", ".aws", ".gnupg"]);
|
|
18032
|
+
var SECRET_BASENAMES = /* @__PURE__ */ new Set(["credentials", ".npmrc", ".netrc", ".pgpass", ".htpasswd"]);
|
|
18033
|
+
var SECRET_BASENAME_PATTERNS = [
|
|
18034
|
+
/^\.env(\..+)?$/,
|
|
18035
|
+
// .env, .env.local, .env.production
|
|
18036
|
+
/\.(pem|key|pfx|p12|keystore|jks)$/i,
|
|
18037
|
+
/^id_(rsa|dsa|ecdsa|ed25519)$/
|
|
18038
|
+
// private SSH keys (not the .pub)
|
|
18039
|
+
];
|
|
18040
|
+
function looksLikeSecret(hostPath) {
|
|
18041
|
+
const segs = (0, import_path2.normalize)(hostPath).split(import_path2.sep).filter(Boolean);
|
|
18042
|
+
for (const seg of segs) {
|
|
18043
|
+
if (SECRET_DIR_SEGMENTS.has(seg)) return true;
|
|
18044
|
+
}
|
|
18045
|
+
for (let i2 = 0; i2 + 1 < segs.length; i2++) {
|
|
18046
|
+
if (segs[i2] === ".config" && segs[i2 + 1] === "gh") return true;
|
|
18047
|
+
}
|
|
18048
|
+
const base = (0, import_path2.basename)(hostPath);
|
|
18049
|
+
if (SECRET_BASENAMES.has(base)) return true;
|
|
18050
|
+
return SECRET_BASENAME_PATTERNS.some((re) => re.test(base));
|
|
18051
|
+
}
|
|
18052
|
+
var SCRATCH_BRANCH_PREFIX = "agentbox/";
|
|
18053
|
+
function isScratchBranch(branch) {
|
|
18054
|
+
return !!branch && branch.startsWith(SCRATCH_BRANCH_PREFIX);
|
|
18055
|
+
}
|
|
18056
|
+
function isSanctionedPushBranch(branch, sanctionedBranch) {
|
|
18057
|
+
if (isScratchBranch(branch)) return true;
|
|
18058
|
+
return isResolvedBranch(branch ?? "") && !!sanctionedBranch && branch === sanctionedBranch;
|
|
18059
|
+
}
|
|
18060
|
+
function resolveRemote(remote) {
|
|
18061
|
+
return remote ?? "origin";
|
|
18062
|
+
}
|
|
18063
|
+
function resolveLandDest(src, as) {
|
|
18064
|
+
return as && as.length > 0 ? as : src;
|
|
18065
|
+
}
|
|
18066
|
+
function landRefspec(src, dest, force) {
|
|
18067
|
+
return `${force ? "+" : ""}${src}:refs/heads/${dest}`;
|
|
18068
|
+
}
|
|
18069
|
+
function upstreamRef(remote, branch) {
|
|
18070
|
+
return `${remote}/${branch}`;
|
|
18071
|
+
}
|
|
18072
|
+
function remoteTrackingRef(remote, branch) {
|
|
18073
|
+
return `refs/remotes/${remote}/${branch}`;
|
|
18074
|
+
}
|
|
18075
|
+
function isResolvedBranch(s) {
|
|
18076
|
+
return s.length > 0 && s !== "HEAD";
|
|
18077
|
+
}
|
|
18078
|
+
function sanitizeGitArgs(args) {
|
|
18079
|
+
return Array.isArray(args) ? args.filter((a2) => typeof a2 === "string") : [];
|
|
18080
|
+
}
|
|
17985
18081
|
|
|
17986
18082
|
// ../sandbox-core/dist/index.js
|
|
17987
|
-
var
|
|
17988
|
-
var
|
|
18083
|
+
var import_promises13 = require("fs/promises");
|
|
18084
|
+
var import_os2 = require("os");
|
|
18085
|
+
var import_path3 = require("path");
|
|
18086
|
+
var import_fs = require("fs");
|
|
18087
|
+
var import_os3 = require("os");
|
|
18088
|
+
var import_path4 = require("path");
|
|
18089
|
+
var import_path5 = require("path");
|
|
18090
|
+
var STATE_DIR = (0, import_path3.join)((0, import_os2.homedir)(), ".agentbox");
|
|
18091
|
+
var STATE_FILE = (0, import_path3.join)(STATE_DIR, "state.json");
|
|
17989
18092
|
var EMPTY = { version: 1, boxes: [] };
|
|
17990
18093
|
async function readState(path6 = STATE_FILE) {
|
|
17991
18094
|
try {
|
|
17992
|
-
const raw = await (0,
|
|
18095
|
+
const raw = await (0, import_promises13.readFile)(path6, "utf8");
|
|
17993
18096
|
const parsed = JSON.parse(raw);
|
|
17994
18097
|
if (parsed.version !== 1 || !Array.isArray(parsed.boxes)) {
|
|
17995
18098
|
throw new Error(`unrecognized state file shape at ${path6}`);
|
|
@@ -18047,6 +18150,223 @@ function findBox(idOrName, state) {
|
|
|
18047
18150
|
function hostOpenCommand() {
|
|
18048
18151
|
return process.platform === "linux" ? "xdg-open" : "open";
|
|
18049
18152
|
}
|
|
18153
|
+
var PLUGINS_FILE = (0, import_path4.join)((0, import_os3.homedir)(), ".agentbox", "plugins.json");
|
|
18154
|
+
var SUPPORTED_SDK_API_VERSIONS = [1];
|
|
18155
|
+
function isSupportedApiVersion(v) {
|
|
18156
|
+
return SUPPORTED_SDK_API_VERSIONS.includes(v);
|
|
18157
|
+
}
|
|
18158
|
+
var EMPTY2 = { version: 1, plugins: [] };
|
|
18159
|
+
function normalize2(raw) {
|
|
18160
|
+
const parsed = raw;
|
|
18161
|
+
if (!parsed || parsed.version !== 1 || !Array.isArray(parsed.plugins)) {
|
|
18162
|
+
return { ...EMPTY2 };
|
|
18163
|
+
}
|
|
18164
|
+
return parsed;
|
|
18165
|
+
}
|
|
18166
|
+
function readPluginRegistrySync(path6 = PLUGINS_FILE) {
|
|
18167
|
+
try {
|
|
18168
|
+
if (!(0, import_fs.existsSync)(path6)) return { ...EMPTY2 };
|
|
18169
|
+
return normalize2(JSON.parse((0, import_fs.readFileSync)(path6, "utf8")));
|
|
18170
|
+
} catch {
|
|
18171
|
+
return { ...EMPTY2 };
|
|
18172
|
+
}
|
|
18173
|
+
}
|
|
18174
|
+
function pluginForProvider(providerName, path6 = PLUGINS_FILE) {
|
|
18175
|
+
return readPluginRegistrySync(path6).plugins.find((p) => p.providers.includes(providerName)) ?? null;
|
|
18176
|
+
}
|
|
18177
|
+
var CLAUDE_BOX_DIR = "/home/vscode/.claude";
|
|
18178
|
+
var CODEX_BOX_DIR = "/home/vscode/.codex";
|
|
18179
|
+
var OPENCODE_BOX_DIR = "/home/vscode/.local/share/opencode";
|
|
18180
|
+
var AGENT_SYNC_SPECS = [
|
|
18181
|
+
{
|
|
18182
|
+
id: "claude",
|
|
18183
|
+
aliases: ["claude-code"],
|
|
18184
|
+
sessionName: "claude",
|
|
18185
|
+
dockerVolume: "agentbox-claude-config",
|
|
18186
|
+
staticPaths: [
|
|
18187
|
+
{
|
|
18188
|
+
hostHomeRel: [".claude"],
|
|
18189
|
+
boxDir: CLAUDE_BOX_DIR,
|
|
18190
|
+
// Static-stage excludes (single source of truth; consumed by
|
|
18191
|
+
// `host-stage.ts:stageClaudeStaticForUpload`). `node_modules` drops
|
|
18192
|
+
// host-platform binaries; `.credentials.json` ships separately; the
|
|
18193
|
+
// rest is per-machine runtime/history state the in-box claude
|
|
18194
|
+
// regenerates (`workflows` is seeded per-box at create time, not baked).
|
|
18195
|
+
exclude: [
|
|
18196
|
+
"node_modules",
|
|
18197
|
+
".credentials.json",
|
|
18198
|
+
"projects",
|
|
18199
|
+
"workflows",
|
|
18200
|
+
"sessions",
|
|
18201
|
+
"history.jsonl",
|
|
18202
|
+
"file-history",
|
|
18203
|
+
"shell-snapshots",
|
|
18204
|
+
"backups",
|
|
18205
|
+
"session-env",
|
|
18206
|
+
"paste-cache",
|
|
18207
|
+
"cache",
|
|
18208
|
+
"telemetry",
|
|
18209
|
+
"tasks",
|
|
18210
|
+
"downloads",
|
|
18211
|
+
"chrome",
|
|
18212
|
+
"ide",
|
|
18213
|
+
"debug",
|
|
18214
|
+
"mcp-needs-auth-cache.json",
|
|
18215
|
+
"stats-cache.json"
|
|
18216
|
+
]
|
|
18217
|
+
}
|
|
18218
|
+
],
|
|
18219
|
+
credential: {
|
|
18220
|
+
boxRelPath: ".credentials.json",
|
|
18221
|
+
boxAbsPath: `${CLAUDE_BOX_DIR}/.credentials.json`,
|
|
18222
|
+
hostBackup: (0, import_path5.join)(STATE_DIR, "claude-credentials.json"),
|
|
18223
|
+
cloudMountPath: "/home/vscode/.agentbox-creds/claude",
|
|
18224
|
+
cloudSubpath: "claude/",
|
|
18225
|
+
realShape: "claude-oauth"
|
|
18226
|
+
},
|
|
18227
|
+
forwardedEnvKeys: [
|
|
18228
|
+
"ANTHROPIC_API_KEY",
|
|
18229
|
+
"CLAUDE_CODE_OAUTH_TOKEN",
|
|
18230
|
+
"CLAUDE_EFFORT",
|
|
18231
|
+
"ANTHROPIC_MODEL"
|
|
18232
|
+
],
|
|
18233
|
+
boxRunEnv: () => ({}),
|
|
18234
|
+
caps: { resume: true, teleport: "full", activitySource: "scraper" }
|
|
18235
|
+
},
|
|
18236
|
+
{
|
|
18237
|
+
id: "codex",
|
|
18238
|
+
aliases: [],
|
|
18239
|
+
sessionName: "codex",
|
|
18240
|
+
dockerVolume: "agentbox-codex-config",
|
|
18241
|
+
staticPaths: [
|
|
18242
|
+
{
|
|
18243
|
+
hostHomeRel: [".codex"],
|
|
18244
|
+
boxDir: CODEX_BOX_DIR,
|
|
18245
|
+
// Static-stage excludes (single source of truth; consumed by
|
|
18246
|
+
// `host-stage.ts:stageCodexStaticForUpload`). `auth.json` ships
|
|
18247
|
+
// separately; `state_*.sqlite*` is the resume-cwd index (rebuilt in-box);
|
|
18248
|
+
// `packages`/`plugins/.plugin-appserver`/`computer-use` are heavy
|
|
18249
|
+
// macOS-only artifacts; the rest is host-only session/log/cache state.
|
|
18250
|
+
exclude: [
|
|
18251
|
+
"auth.json",
|
|
18252
|
+
"sessions",
|
|
18253
|
+
"log",
|
|
18254
|
+
"history.jsonl",
|
|
18255
|
+
"hooks.json",
|
|
18256
|
+
"state_*.sqlite*",
|
|
18257
|
+
"logs_*.sqlite*",
|
|
18258
|
+
"external_agent_session_imports.json",
|
|
18259
|
+
"sqlite",
|
|
18260
|
+
"cache",
|
|
18261
|
+
"vendor_imports",
|
|
18262
|
+
"tmp",
|
|
18263
|
+
".tmp",
|
|
18264
|
+
".codex-global-state.json",
|
|
18265
|
+
".codex-global-state.json.bak",
|
|
18266
|
+
".personality_migration",
|
|
18267
|
+
"shell_snapshots",
|
|
18268
|
+
"session_index.jsonl",
|
|
18269
|
+
"models_cache.json",
|
|
18270
|
+
"installation_id",
|
|
18271
|
+
"version.json",
|
|
18272
|
+
"packages",
|
|
18273
|
+
"plugins/.plugin-appserver",
|
|
18274
|
+
"computer-use",
|
|
18275
|
+
"archived_sessions"
|
|
18276
|
+
]
|
|
18277
|
+
}
|
|
18278
|
+
],
|
|
18279
|
+
credential: {
|
|
18280
|
+
boxRelPath: "auth.json",
|
|
18281
|
+
boxAbsPath: `${CODEX_BOX_DIR}/auth.json`,
|
|
18282
|
+
hostBackup: (0, import_path5.join)(STATE_DIR, "codex-credentials.json"),
|
|
18283
|
+
cloudMountPath: "/home/vscode/.agentbox-creds/codex",
|
|
18284
|
+
cloudSubpath: "codex/",
|
|
18285
|
+
realShape: "nonempty-json"
|
|
18286
|
+
},
|
|
18287
|
+
forwardedEnvKeys: ["OPENAI_API_KEY"],
|
|
18288
|
+
boxRunEnv: () => ({}),
|
|
18289
|
+
caps: { resume: true, teleport: "full", activitySource: "scraper" }
|
|
18290
|
+
},
|
|
18291
|
+
{
|
|
18292
|
+
id: "opencode",
|
|
18293
|
+
aliases: [],
|
|
18294
|
+
sessionName: "opencode",
|
|
18295
|
+
dockerVolume: "agentbox-opencode-config",
|
|
18296
|
+
// The three-XDG-dir layout as DATA: the generic seed loop reproduces
|
|
18297
|
+
// `ensureOpencodeVolume`'s three-source rsync (data + config→config +
|
|
18298
|
+
// state→.state/opencode newest-wins) with no tool-specific control flow.
|
|
18299
|
+
staticPaths: [
|
|
18300
|
+
{
|
|
18301
|
+
hostHomeRel: [".local", "share", "opencode"],
|
|
18302
|
+
boxDir: OPENCODE_BOX_DIR,
|
|
18303
|
+
// Static-stage excludes for the data tree (single source of truth;
|
|
18304
|
+
// consumed by `host-stage.ts:stageOpencodeStaticForUpload`). `auth.json`
|
|
18305
|
+
// ships separately; the rest is host-only runtime state.
|
|
18306
|
+
exclude: [
|
|
18307
|
+
"auth.json",
|
|
18308
|
+
"storage",
|
|
18309
|
+
"log",
|
|
18310
|
+
"project",
|
|
18311
|
+
"cache",
|
|
18312
|
+
"bin",
|
|
18313
|
+
"repos",
|
|
18314
|
+
"snapshot",
|
|
18315
|
+
"config",
|
|
18316
|
+
"opencode.db",
|
|
18317
|
+
"opencode.db-shm",
|
|
18318
|
+
"opencode.db-wal"
|
|
18319
|
+
]
|
|
18320
|
+
},
|
|
18321
|
+
{ hostHomeRel: [".config", "opencode"], boxDir: OPENCODE_BOX_DIR, relocToSubpath: "config" },
|
|
18322
|
+
{
|
|
18323
|
+
hostHomeRel: [".local", "state", "opencode"],
|
|
18324
|
+
boxDir: OPENCODE_BOX_DIR,
|
|
18325
|
+
relocToSubpath: ".state/opencode",
|
|
18326
|
+
update: true,
|
|
18327
|
+
exclude: ["locks"]
|
|
18328
|
+
}
|
|
18329
|
+
],
|
|
18330
|
+
credential: {
|
|
18331
|
+
boxRelPath: "auth.json",
|
|
18332
|
+
boxAbsPath: `${OPENCODE_BOX_DIR}/auth.json`,
|
|
18333
|
+
hostBackup: (0, import_path5.join)(STATE_DIR, "opencode-credentials.json"),
|
|
18334
|
+
cloudMountPath: "/home/vscode/.agentbox-creds/opencode",
|
|
18335
|
+
cloudSubpath: "opencode/",
|
|
18336
|
+
realShape: "nonempty-json"
|
|
18337
|
+
},
|
|
18338
|
+
forwardedEnvKeys: [
|
|
18339
|
+
"ANTHROPIC_API_KEY",
|
|
18340
|
+
"OPENAI_API_KEY",
|
|
18341
|
+
"OPENROUTER_API_KEY",
|
|
18342
|
+
"GEMINI_API_KEY",
|
|
18343
|
+
"GOOGLE_GENERATIVE_AI_API_KEY",
|
|
18344
|
+
"GOOGLE_API_KEY",
|
|
18345
|
+
"GROQ_API_KEY"
|
|
18346
|
+
],
|
|
18347
|
+
boxRunEnv: () => ({
|
|
18348
|
+
OPENCODE_CONFIG_DIR: `${OPENCODE_BOX_DIR}/config`,
|
|
18349
|
+
XDG_STATE_HOME: `${OPENCODE_BOX_DIR}/.state`
|
|
18350
|
+
}),
|
|
18351
|
+
caps: { resume: false, teleport: "stub", activitySource: "plugin" }
|
|
18352
|
+
}
|
|
18353
|
+
];
|
|
18354
|
+
function resolveAgentSpec(name) {
|
|
18355
|
+
const spec = AGENT_SYNC_SPECS.find((s) => s.id === name || s.aliases.includes(name));
|
|
18356
|
+
if (!spec) throw new Error(`no agent sync spec for '${name}'`);
|
|
18357
|
+
return spec;
|
|
18358
|
+
}
|
|
18359
|
+
var BOX_CLAUDE_PROJECT_DIR = "/home/vscode/.claude/projects/-workspace";
|
|
18360
|
+
var CLAUDE_HOST_BACKUP = resolveAgentSpec("claude").credential.hostBackup;
|
|
18361
|
+
var BOX_MEMORY_DIR = `${BOX_CLAUDE_PROJECT_DIR}/memory`;
|
|
18362
|
+
var BOX_WORKSPACE2 = "/workspace";
|
|
18363
|
+
var MINIMAL_TRUSTED_CODEX_CONFIG = `[projects."${BOX_WORKSPACE2}"]
|
|
18364
|
+
trust_level = "trusted"
|
|
18365
|
+
`;
|
|
18366
|
+
var CREDENTIALS_BACKUP_FILE = resolveAgentSpec("claude").credential.hostBackup;
|
|
18367
|
+
var CLAUDE_STATIC_EXCLUDES = resolveAgentSpec("claude").staticPaths[0]?.exclude ?? [];
|
|
18368
|
+
var CODEX_STATIC_EXCLUDES = resolveAgentSpec("codex").staticPaths[0]?.exclude ?? [];
|
|
18369
|
+
var OPENCODE_DATA_EXCLUDES = resolveAgentSpec("opencode").staticPaths[0]?.exclude ?? [];
|
|
18050
18370
|
|
|
18051
18371
|
// src/gh.ts
|
|
18052
18372
|
var import_node_child_process6 = require("child_process");
|
|
@@ -18072,6 +18392,7 @@ var GH_PR_READ_ONLY_OPS = /* @__PURE__ */ new Set([
|
|
|
18072
18392
|
"diff",
|
|
18073
18393
|
"checks"
|
|
18074
18394
|
]);
|
|
18395
|
+
var GH_PR_SAFE_AUTO_APPROVE_OPS = /* @__PURE__ */ new Set(["create", "comment"]);
|
|
18075
18396
|
var GH_RUN_OPS = ["list", "view", "rerun"];
|
|
18076
18397
|
function isGhRunOp(value) {
|
|
18077
18398
|
return GH_RUN_OPS.includes(value);
|
|
@@ -18153,6 +18474,9 @@ function injectPrCreateHead(op, branch, args) {
|
|
|
18153
18474
|
function hasHeadArg(args) {
|
|
18154
18475
|
return args.some((a2) => a2 === "--head" || a2.startsWith("--head=") || a2.startsWith("-H"));
|
|
18155
18476
|
}
|
|
18477
|
+
function prCreateHasExplicitHead(op, args) {
|
|
18478
|
+
return op === "create" && hasHeadArg(args);
|
|
18479
|
+
}
|
|
18156
18480
|
function prCreateNeedsHead(op, args) {
|
|
18157
18481
|
return op === "create" && !hasHeadArg(args);
|
|
18158
18482
|
}
|
|
@@ -18189,6 +18513,9 @@ async function probeGh() {
|
|
|
18189
18513
|
stderr: `gh --version failed: ${version.stderr || version.stdout}`.trimEnd() + "\n"
|
|
18190
18514
|
};
|
|
18191
18515
|
}
|
|
18516
|
+
if ((process.env.GH_TOKEN ?? process.env.GITHUB_TOKEN ?? "").length > 0) {
|
|
18517
|
+
return null;
|
|
18518
|
+
}
|
|
18192
18519
|
const auth = await runHostGh(["auth", "status"], process.cwd(), 15e3);
|
|
18193
18520
|
if (auth.exitCode !== 0) {
|
|
18194
18521
|
return {
|
|
@@ -18200,7 +18527,7 @@ async function probeGh() {
|
|
|
18200
18527
|
return null;
|
|
18201
18528
|
}
|
|
18202
18529
|
function runHostGh(args, cwd, timeoutMs = GH_RPC_TIMEOUT_MS) {
|
|
18203
|
-
return new Promise((
|
|
18530
|
+
return new Promise((resolve4) => {
|
|
18204
18531
|
const child = (0, import_node_child_process6.spawn)("gh", args, {
|
|
18205
18532
|
cwd,
|
|
18206
18533
|
env: process.env,
|
|
@@ -18212,7 +18539,7 @@ function runHostGh(args, cwd, timeoutMs = GH_RPC_TIMEOUT_MS) {
|
|
|
18212
18539
|
const finish = (exitCode) => {
|
|
18213
18540
|
if (settled) return;
|
|
18214
18541
|
settled = true;
|
|
18215
|
-
|
|
18542
|
+
resolve4({ exitCode, stdout, stderr });
|
|
18216
18543
|
};
|
|
18217
18544
|
const timer = setTimeout(() => {
|
|
18218
18545
|
child.kill("SIGTERM");
|
|
@@ -18276,7 +18603,7 @@ async function checkoutGuards(hostMainRepo, registeredBranches) {
|
|
|
18276
18603
|
return null;
|
|
18277
18604
|
}
|
|
18278
18605
|
function runGitProbe(args) {
|
|
18279
|
-
return new Promise((
|
|
18606
|
+
return new Promise((resolve4) => {
|
|
18280
18607
|
const child = (0, import_node_child_process6.spawn)("git", args, { env: process.env, stdio: ["ignore", "pipe", "pipe"] });
|
|
18281
18608
|
let stdout = "";
|
|
18282
18609
|
let stderr = "";
|
|
@@ -18287,10 +18614,10 @@ function runGitProbe(args) {
|
|
|
18287
18614
|
stderr += c3.toString("utf8");
|
|
18288
18615
|
});
|
|
18289
18616
|
child.on("error", (err) => {
|
|
18290
|
-
|
|
18617
|
+
resolve4({ exitCode: 127, stdout, stderr: stderr + String(err.message ?? err) });
|
|
18291
18618
|
});
|
|
18292
18619
|
child.on("close", (code) => {
|
|
18293
|
-
|
|
18620
|
+
resolve4({ exitCode: code ?? -1, stdout, stderr });
|
|
18294
18621
|
});
|
|
18295
18622
|
});
|
|
18296
18623
|
}
|
|
@@ -18437,13 +18764,75 @@ var import_node_child_process7 = require("child_process");
|
|
|
18437
18764
|
// ../config/dist/index.js
|
|
18438
18765
|
var import_yaml = __toESM(require_dist(), 1);
|
|
18439
18766
|
var import_crypto = require("crypto");
|
|
18440
|
-
var import_promises13 = require("fs/promises");
|
|
18441
|
-
var import_os2 = require("os");
|
|
18442
|
-
var import_path2 = require("path");
|
|
18443
18767
|
var import_promises14 = require("fs/promises");
|
|
18768
|
+
var import_os4 = require("os");
|
|
18769
|
+
var import_path6 = require("path");
|
|
18770
|
+
var import_promises15 = require("fs/promises");
|
|
18444
18771
|
var import_yaml2 = __toESM(require_dist(), 1);
|
|
18445
|
-
var
|
|
18772
|
+
var import_path7 = require("path");
|
|
18446
18773
|
var import_yaml3 = __toESM(require_dist(), 1);
|
|
18774
|
+
var PROVIDERS = [
|
|
18775
|
+
{
|
|
18776
|
+
name: "docker",
|
|
18777
|
+
kind: "local",
|
|
18778
|
+
label: "Docker (local)",
|
|
18779
|
+
loginHint: "builds a ~1GB local image; no login needed",
|
|
18780
|
+
rebuildMinutes: "1",
|
|
18781
|
+
blurb: "local Docker containers",
|
|
18782
|
+
sizeDesc: "Per-provider override of `box.size` for docker. Reserved \u2014 docker sizing is controlled via `box.memory` / `box.cpus` / `box.disk`.",
|
|
18783
|
+
imageDesc: "Per-provider override of `box.image` for docker (local docker image ref, e.g. `agentbox/box:dev`). Wins over the generic when set."
|
|
18784
|
+
},
|
|
18785
|
+
{
|
|
18786
|
+
name: "daytona",
|
|
18787
|
+
kind: "cloud",
|
|
18788
|
+
label: "Daytona (cloud sandbox)",
|
|
18789
|
+
loginHint: "approve a browser sign-in link",
|
|
18790
|
+
rebuildMinutes: "7",
|
|
18791
|
+
blurb: "Daytona Cloud sandboxes",
|
|
18792
|
+
sizeDesc: "Per-provider override of `box.size` for daytona. `cpu-memory-disk` GB spec (e.g. `4-8-20`). Only honored on the image/Dockerfile create path; Daytona rejects custom resources on snapshot-resume.",
|
|
18793
|
+
imageDesc: "Per-provider override of `box.image` for daytona (named snapshot, e.g. `agentbox-base-<fingerprint>`). Written by `agentbox prepare --provider daytona`."
|
|
18794
|
+
},
|
|
18795
|
+
{
|
|
18796
|
+
name: "hetzner",
|
|
18797
|
+
kind: "cloud",
|
|
18798
|
+
label: "Hetzner (cloud VPS)",
|
|
18799
|
+
loginHint: "paste an API token from the Hetzner Console",
|
|
18800
|
+
rebuildMinutes: "7-10",
|
|
18801
|
+
blurb: "Hetzner Cloud VPSes",
|
|
18802
|
+
sizeDesc: "Per-provider override of `box.size` for hetzner. Server type string (e.g. `cx23`, `cx33`, `cx43`).",
|
|
18803
|
+
imageDesc: "Per-provider override of `box.image` for hetzner (image description, e.g. `agentbox-base-<fingerprint>`). Written by `agentbox prepare --provider hetzner`."
|
|
18804
|
+
},
|
|
18805
|
+
{
|
|
18806
|
+
name: "vercel",
|
|
18807
|
+
kind: "cloud",
|
|
18808
|
+
label: "Vercel (cloud microVM)",
|
|
18809
|
+
loginHint: "installs the Vercel sandbox CLI, then a browser sign-in",
|
|
18810
|
+
rebuildMinutes: "5-10",
|
|
18811
|
+
blurb: "Vercel Sandboxes",
|
|
18812
|
+
sizeDesc: "Per-provider override of `box.size` for vercel. Reserved \u2014 vercel sizing is controlled via `box.vercelVcpus`.",
|
|
18813
|
+
imageDesc: "Per-provider override of `box.image` for vercel (snapshot id, e.g. `snap_\u2026`). Written by `agentbox prepare --provider vercel`."
|
|
18814
|
+
},
|
|
18815
|
+
{
|
|
18816
|
+
name: "e2b",
|
|
18817
|
+
kind: "cloud",
|
|
18818
|
+
label: "E2B (cloud microVM)",
|
|
18819
|
+
loginHint: "paste an API key from the E2B dashboard",
|
|
18820
|
+
rebuildMinutes: "2",
|
|
18821
|
+
blurb: "E2B microVMs",
|
|
18822
|
+
sizeDesc: "Per-provider override of `box.size` for e2b. Reserved \u2014 e2b sizing is template-level (set at `agentbox prepare --provider e2b` time via --vcpus / --memory).",
|
|
18823
|
+
imageDesc: "Per-provider override of `box.image` for e2b (template id or `name:tag`, e.g. `agentbox-base:latest`). Written by `agentbox prepare --provider e2b`."
|
|
18824
|
+
}
|
|
18825
|
+
];
|
|
18826
|
+
var PROVIDER_NAMES = PROVIDERS.map((p) => p.name);
|
|
18827
|
+
var CLOUD_PROVIDER_NAMES = PROVIDERS.filter(
|
|
18828
|
+
(p) => p.kind === "cloud"
|
|
18829
|
+
).map((p) => p.name);
|
|
18830
|
+
function providerKeyCap(name) {
|
|
18831
|
+
return name.charAt(0).toUpperCase() + name.slice(1);
|
|
18832
|
+
}
|
|
18833
|
+
function perProviderConfigKey(base, provider) {
|
|
18834
|
+
return `box.${base}${providerKeyCap(provider)}`;
|
|
18835
|
+
}
|
|
18447
18836
|
var BUILT_IN_DEFAULTS = {
|
|
18448
18837
|
box: {
|
|
18449
18838
|
provider: "docker",
|
|
@@ -18461,10 +18850,12 @@ var BUILT_IN_DEFAULTS = {
|
|
|
18461
18850
|
sizeVercel: "",
|
|
18462
18851
|
sizeE2b: "",
|
|
18463
18852
|
withPlaywright: false,
|
|
18853
|
+
claudeInstall: "native",
|
|
18464
18854
|
withEnv: false,
|
|
18465
18855
|
resyncOnStart: true,
|
|
18466
18856
|
vnc: true,
|
|
18467
18857
|
autoApproveHostActions: false,
|
|
18858
|
+
autoApproveSafeHostActions: true,
|
|
18468
18859
|
isolateClaudeConfig: false,
|
|
18469
18860
|
isolateCodexConfig: false,
|
|
18470
18861
|
isolateOpencodeConfig: false,
|
|
@@ -18519,6 +18910,9 @@ var BUILT_IN_DEFAULTS = {
|
|
|
18519
18910
|
login: true,
|
|
18520
18911
|
tmux: true
|
|
18521
18912
|
},
|
|
18913
|
+
ssh: {
|
|
18914
|
+
autoConfig: true
|
|
18915
|
+
},
|
|
18522
18916
|
engine: {
|
|
18523
18917
|
kind: "auto"
|
|
18524
18918
|
},
|
|
@@ -18526,7 +18920,11 @@ var BUILT_IN_DEFAULTS = {
|
|
|
18526
18920
|
default: "agent-browser"
|
|
18527
18921
|
},
|
|
18528
18922
|
relay: {
|
|
18529
|
-
port: 8787
|
|
18923
|
+
port: 8787,
|
|
18924
|
+
controlPlaneUrl: void 0
|
|
18925
|
+
},
|
|
18926
|
+
git: {
|
|
18927
|
+
pushMode: "auto"
|
|
18530
18928
|
},
|
|
18531
18929
|
vnc: {
|
|
18532
18930
|
containerPort: 6080
|
|
@@ -18559,12 +18957,40 @@ var BUILT_IN_DEFAULTS = {
|
|
|
18559
18957
|
linear: { enabled: false }
|
|
18560
18958
|
}
|
|
18561
18959
|
};
|
|
18960
|
+
function joinOr(items) {
|
|
18961
|
+
if (items.length <= 1) return items.join("");
|
|
18962
|
+
return `${items.slice(0, -1).join(", ")}, or ${items[items.length - 1]}`;
|
|
18963
|
+
}
|
|
18964
|
+
function perProviderCheckpointKeys() {
|
|
18965
|
+
return PROVIDERS.map((p) => ({
|
|
18966
|
+
key: perProviderConfigKey("defaultCheckpoint", p.name),
|
|
18967
|
+
type: "string",
|
|
18968
|
+
description: `Per-provider override of \`box.defaultCheckpoint\` for ${p.name}. Wins over the global when set; set via \`agentbox checkpoint set-default --provider ${p.name}\`.`,
|
|
18969
|
+
advanced: true
|
|
18970
|
+
}));
|
|
18971
|
+
}
|
|
18972
|
+
function perProviderSizeKeys() {
|
|
18973
|
+
return PROVIDERS.map((p) => ({
|
|
18974
|
+
key: perProviderConfigKey("size", p.name),
|
|
18975
|
+
type: "string",
|
|
18976
|
+
description: p.sizeDesc,
|
|
18977
|
+
advanced: true
|
|
18978
|
+
}));
|
|
18979
|
+
}
|
|
18980
|
+
function perProviderImageKeys() {
|
|
18981
|
+
return PROVIDERS.map((p) => ({
|
|
18982
|
+
key: perProviderConfigKey("image", p.name),
|
|
18983
|
+
type: "string",
|
|
18984
|
+
description: p.imageDesc,
|
|
18985
|
+
advanced: true
|
|
18986
|
+
}));
|
|
18987
|
+
}
|
|
18562
18988
|
var KEY_REGISTRY = [
|
|
18563
18989
|
{
|
|
18564
18990
|
key: "box.provider",
|
|
18565
18991
|
type: "enum",
|
|
18566
|
-
enumValues:
|
|
18567
|
-
description:
|
|
18992
|
+
enumValues: PROVIDER_NAMES,
|
|
18993
|
+
description: `Sandbox backend new boxes are created on: ${joinOr(PROVIDERS.map((p) => p.blurb))}.`
|
|
18568
18994
|
},
|
|
18569
18995
|
{
|
|
18570
18996
|
key: "box.hostSnapshot",
|
|
@@ -18576,71 +19002,13 @@ var KEY_REGISTRY = [
|
|
|
18576
19002
|
type: "string",
|
|
18577
19003
|
description: "Checkpoint ref new boxes in this project start from when --snapshot is not given (set via `agentbox checkpoint set-default`). Used as fallback when no per-provider override is set."
|
|
18578
19004
|
},
|
|
18579
|
-
|
|
18580
|
-
key: "box.defaultCheckpointDocker",
|
|
18581
|
-
type: "string",
|
|
18582
|
-
description: "Per-provider override of `box.defaultCheckpoint` for docker. Wins over the global when set; set via `agentbox checkpoint set-default --provider docker`.",
|
|
18583
|
-
advanced: true
|
|
18584
|
-
},
|
|
18585
|
-
{
|
|
18586
|
-
key: "box.defaultCheckpointDaytona",
|
|
18587
|
-
type: "string",
|
|
18588
|
-
description: "Per-provider override of `box.defaultCheckpoint` for daytona. Wins over the global when set; set via `agentbox checkpoint set-default --provider daytona`.",
|
|
18589
|
-
advanced: true
|
|
18590
|
-
},
|
|
18591
|
-
{
|
|
18592
|
-
key: "box.defaultCheckpointHetzner",
|
|
18593
|
-
type: "string",
|
|
18594
|
-
description: "Per-provider override of `box.defaultCheckpoint` for hetzner. Wins over the global when set; set via `agentbox checkpoint set-default --provider hetzner`.",
|
|
18595
|
-
advanced: true
|
|
18596
|
-
},
|
|
18597
|
-
{
|
|
18598
|
-
key: "box.defaultCheckpointVercel",
|
|
18599
|
-
type: "string",
|
|
18600
|
-
description: "Per-provider override of `box.defaultCheckpoint` for vercel. Wins over the global when set; set via `agentbox checkpoint set-default --provider vercel`.",
|
|
18601
|
-
advanced: true
|
|
18602
|
-
},
|
|
18603
|
-
{
|
|
18604
|
-
key: "box.defaultCheckpointE2b",
|
|
18605
|
-
type: "string",
|
|
18606
|
-
description: "Per-provider override of `box.defaultCheckpoint` for e2b. Wins over the global when set; set via `agentbox checkpoint set-default --provider e2b`.",
|
|
18607
|
-
advanced: true
|
|
18608
|
-
},
|
|
19005
|
+
...perProviderCheckpointKeys(),
|
|
18609
19006
|
{
|
|
18610
19007
|
key: "box.size",
|
|
18611
19008
|
type: "string",
|
|
18612
19009
|
description: "Default VM size for cloud providers. Provider-interpreted: hetzner = server type (e.g. `cx33`); daytona = `cpu-memory-disk` GB (e.g. `4-8-20`). Used as fallback when no per-provider override is set. Docker/Vercel ignore it."
|
|
18613
19010
|
},
|
|
18614
|
-
|
|
18615
|
-
key: "box.sizeDocker",
|
|
18616
|
-
type: "string",
|
|
18617
|
-
description: "Per-provider override of `box.size` for docker. Reserved \u2014 docker sizing is controlled via `box.memory` / `box.cpus` / `box.disk`.",
|
|
18618
|
-
advanced: true
|
|
18619
|
-
},
|
|
18620
|
-
{
|
|
18621
|
-
key: "box.sizeDaytona",
|
|
18622
|
-
type: "string",
|
|
18623
|
-
description: "Per-provider override of `box.size` for daytona. `cpu-memory-disk` GB spec (e.g. `4-8-20`). Only honored on the image/Dockerfile create path; Daytona rejects custom resources on snapshot-resume.",
|
|
18624
|
-
advanced: true
|
|
18625
|
-
},
|
|
18626
|
-
{
|
|
18627
|
-
key: "box.sizeHetzner",
|
|
18628
|
-
type: "string",
|
|
18629
|
-
description: "Per-provider override of `box.size` for hetzner. Server type string (e.g. `cx23`, `cx33`, `cx43`).",
|
|
18630
|
-
advanced: true
|
|
18631
|
-
},
|
|
18632
|
-
{
|
|
18633
|
-
key: "box.sizeVercel",
|
|
18634
|
-
type: "string",
|
|
18635
|
-
description: "Per-provider override of `box.size` for vercel. Reserved \u2014 vercel sizing is controlled via `box.vercelVcpus`.",
|
|
18636
|
-
advanced: true
|
|
18637
|
-
},
|
|
18638
|
-
{
|
|
18639
|
-
key: "box.sizeE2b",
|
|
18640
|
-
type: "string",
|
|
18641
|
-
description: "Per-provider override of `box.size` for e2b. Reserved \u2014 e2b sizing is template-level (set at `agentbox prepare --provider e2b` time via --vcpus / --memory).",
|
|
18642
|
-
advanced: true
|
|
18643
|
-
},
|
|
19011
|
+
...perProviderSizeKeys(),
|
|
18644
19012
|
{
|
|
18645
19013
|
key: "checkpoint.maxLayers",
|
|
18646
19014
|
type: "int",
|
|
@@ -18652,6 +19020,12 @@ var KEY_REGISTRY = [
|
|
|
18652
19020
|
type: "bool",
|
|
18653
19021
|
description: "Install @playwright/cli@latest in the box at create time."
|
|
18654
19022
|
},
|
|
19023
|
+
{
|
|
19024
|
+
key: "box.claudeInstall",
|
|
19025
|
+
type: "enum",
|
|
19026
|
+
enumValues: ["native", "npm"],
|
|
19027
|
+
description: "How `agentbox prepare` installs Claude Code into the base image/snapshot: `native` (Anthropic's installer, the default) or `npm` (@anthropic-ai/claude-code). A fallback for cloud egress IPs the native installer's CDN 403s. Bake-time only \u2014 change it, then re-run `agentbox prepare --provider <name>`."
|
|
19028
|
+
},
|
|
18655
19029
|
{
|
|
18656
19030
|
key: "box.withEnv",
|
|
18657
19031
|
type: "bool",
|
|
@@ -18672,6 +19046,11 @@ var KEY_REGISTRY = [
|
|
|
18672
19046
|
type: "bool",
|
|
18673
19047
|
description: "Auto-approve host-action confirmations (git push, cp host<->box, gh PR writes, checkpoint) for this box without an interactive prompt. Off by default; intended for unattended orchestration of trusted boxes. Each auto-approval is recorded as a relay event (visible in `agentbox agent` / the dashboard)."
|
|
18674
19048
|
},
|
|
19049
|
+
{
|
|
19050
|
+
key: "box.autoApproveSafeHostActions",
|
|
19051
|
+
type: "bool",
|
|
19052
|
+
description: "Auto-approve the SAFE subset of host actions without a prompt: opening a PR, PR/review comments, re-running CI, pushing to the box's scratch or host-sanctioned branch, checkpoints, integration writes, and file copy/download that stays inside the box project folder (non-secret). Uncontained or secret file transfers, non-sanctioned-branch pushes, and PR merge/checkout still prompt. On by default; set false to prompt for every host action (the pre-relax behavior). Superseded by box.autoApproveHostActions, which approves everything. Each auto-approval is recorded as a relay event."
|
|
19053
|
+
},
|
|
18675
19054
|
{
|
|
18676
19055
|
key: "box.isolateClaudeConfig",
|
|
18677
19056
|
type: "bool",
|
|
@@ -18693,36 +19072,7 @@ var KEY_REGISTRY = [
|
|
|
18693
19072
|
description: "Generic box image ref (fallback). Used as fallback when no per-provider override is set; the default `agentbox/box:dev` is treated as a sentinel by cloud backends (boot from their prepared base snapshot instead).",
|
|
18694
19073
|
advanced: true
|
|
18695
19074
|
},
|
|
18696
|
-
|
|
18697
|
-
key: "box.imageDocker",
|
|
18698
|
-
type: "string",
|
|
18699
|
-
description: "Per-provider override of `box.image` for docker (local docker image ref, e.g. `agentbox/box:dev`). Wins over the generic when set.",
|
|
18700
|
-
advanced: true
|
|
18701
|
-
},
|
|
18702
|
-
{
|
|
18703
|
-
key: "box.imageDaytona",
|
|
18704
|
-
type: "string",
|
|
18705
|
-
description: "Per-provider override of `box.image` for daytona (named snapshot, e.g. `agentbox-base-<fingerprint>`). Written by `agentbox prepare --provider daytona`.",
|
|
18706
|
-
advanced: true
|
|
18707
|
-
},
|
|
18708
|
-
{
|
|
18709
|
-
key: "box.imageHetzner",
|
|
18710
|
-
type: "string",
|
|
18711
|
-
description: "Per-provider override of `box.image` for hetzner (image description, e.g. `agentbox-base-<fingerprint>`). Written by `agentbox prepare --provider hetzner`.",
|
|
18712
|
-
advanced: true
|
|
18713
|
-
},
|
|
18714
|
-
{
|
|
18715
|
-
key: "box.imageVercel",
|
|
18716
|
-
type: "string",
|
|
18717
|
-
description: "Per-provider override of `box.image` for vercel (snapshot id, e.g. `snap_\u2026`). Written by `agentbox prepare --provider vercel`.",
|
|
18718
|
-
advanced: true
|
|
18719
|
-
},
|
|
18720
|
-
{
|
|
18721
|
-
key: "box.imageE2b",
|
|
18722
|
-
type: "string",
|
|
18723
|
-
description: "Per-provider override of `box.image` for e2b (template id or `name:tag`, e.g. `agentbox-base:latest`). Written by `agentbox prepare --provider e2b`.",
|
|
18724
|
-
advanced: true
|
|
18725
|
-
},
|
|
19075
|
+
...perProviderImageKeys(),
|
|
18726
19076
|
{
|
|
18727
19077
|
key: "box.imageRegistry",
|
|
18728
19078
|
type: "string",
|
|
@@ -18863,6 +19213,11 @@ var KEY_REGISTRY = [
|
|
|
18863
19213
|
type: "bool",
|
|
18864
19214
|
description: "Run `agentbox shell` inside a detachable tmux session (Ctrl+a d to detach)."
|
|
18865
19215
|
},
|
|
19216
|
+
{
|
|
19217
|
+
key: "ssh.autoConfig",
|
|
19218
|
+
type: "bool",
|
|
19219
|
+
description: "Automatically write a `~/.agentbox/ssh/config` entry (Include'd from `~/.ssh/config`) for SSH-capable cloud boxes on create and start/resume, so `ssh <box>` just works. On by default; set false if you manage `~/.ssh/config` yourself. Explicit `agentbox shell --ssh-config`/`code`/`open` still write on demand regardless."
|
|
19220
|
+
},
|
|
18866
19221
|
{
|
|
18867
19222
|
key: "engine.kind",
|
|
18868
19223
|
type: "enum",
|
|
@@ -18881,6 +19236,17 @@ var KEY_REGISTRY = [
|
|
|
18881
19236
|
description: "Host relay TCP port (advanced).",
|
|
18882
19237
|
advanced: true
|
|
18883
19238
|
},
|
|
19239
|
+
{
|
|
19240
|
+
key: "relay.controlPlaneUrl",
|
|
19241
|
+
type: "string",
|
|
19242
|
+
description: "Public HTTPS URL of a deployed control plane (hosted Next.js + Postgres app). When set, new cloud boxes point at it for git-token leasing, permission state, and the box registry/events, and push to GitHub directly with a leased token so they keep working with the laptop off. Set via `agentbox control-plane set-url`."
|
|
19243
|
+
},
|
|
19244
|
+
{
|
|
19245
|
+
key: "git.pushMode",
|
|
19246
|
+
type: "enum",
|
|
19247
|
+
enumValues: ["auto", "relay", "lease"],
|
|
19248
|
+
description: "How a box's `git push` reaches GitHub: `relay` (the host relay pushes with your host credentials \u2014 they never enter the box), `lease` (the relay/plane leases a short-lived GitHub-App token and the box pushes directly, so it works with the laptop off), or `auto` (default \u2014 lease when `relay.controlPlaneUrl` is set for the box, else relay). Only affects cloud boxes; docker boxes always use `relay`. Forcing `relay` needs a reachable host relay for the box; forcing `lease` needs a reachable relay/plane with a GitHub App."
|
|
19249
|
+
},
|
|
18884
19250
|
{
|
|
18885
19251
|
key: "vnc.containerPort",
|
|
18886
19252
|
type: "int",
|
|
@@ -19108,34 +19474,34 @@ function branchHasLeafBelow(branchSpec, prefix) {
|
|
|
19108
19474
|
}
|
|
19109
19475
|
return false;
|
|
19110
19476
|
}
|
|
19111
|
-
var STATE_DIR2 = (0,
|
|
19112
|
-
var GLOBAL_CONFIG_FILE = (0,
|
|
19113
|
-
var PROJECTS_DIR = (0,
|
|
19477
|
+
var STATE_DIR2 = (0, import_path6.join)((0, import_os4.homedir)(), ".agentbox");
|
|
19478
|
+
var GLOBAL_CONFIG_FILE = (0, import_path6.join)(STATE_DIR2, "config.yaml");
|
|
19479
|
+
var PROJECTS_DIR = (0, import_path6.join)(STATE_DIR2, "projects");
|
|
19114
19480
|
var WORKSPACE_CONFIG_BASENAME = "agentbox.yaml";
|
|
19115
19481
|
async function findProjectRoot(cwd) {
|
|
19116
19482
|
const start = await canonicalize(cwd);
|
|
19117
19483
|
let dir = start;
|
|
19118
19484
|
for (let i2 = 0; i2 < 64; i2++) {
|
|
19119
|
-
if (await fileExists((0,
|
|
19485
|
+
if (await fileExists((0, import_path6.join)(dir, WORKSPACE_CONFIG_BASENAME))) {
|
|
19120
19486
|
return { root: dir, hasAgentboxYaml: true };
|
|
19121
19487
|
}
|
|
19122
|
-
const parent = (0,
|
|
19488
|
+
const parent = (0, import_path6.dirname)(dir);
|
|
19123
19489
|
if (parent === dir) break;
|
|
19124
19490
|
dir = parent;
|
|
19125
19491
|
}
|
|
19126
19492
|
return { root: start, hasAgentboxYaml: false };
|
|
19127
19493
|
}
|
|
19128
19494
|
async function canonicalize(p) {
|
|
19129
|
-
const abs = (0,
|
|
19495
|
+
const abs = (0, import_path6.resolve)(p);
|
|
19130
19496
|
try {
|
|
19131
|
-
return await (0,
|
|
19497
|
+
return await (0, import_promises14.realpath)(abs);
|
|
19132
19498
|
} catch {
|
|
19133
19499
|
return abs;
|
|
19134
19500
|
}
|
|
19135
19501
|
}
|
|
19136
19502
|
async function fileExists(p) {
|
|
19137
19503
|
try {
|
|
19138
|
-
const st = await (0,
|
|
19504
|
+
const st = await (0, import_promises14.stat)(p);
|
|
19139
19505
|
return st.isFile();
|
|
19140
19506
|
} catch {
|
|
19141
19507
|
return false;
|
|
@@ -19149,21 +19515,21 @@ function sanitizeMnemonic(raw) {
|
|
|
19149
19515
|
return raw.toLowerCase().replace(/-/g, "_").replace(/[^a-z0-9_]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "").slice(0, 32) || "unnamed";
|
|
19150
19516
|
}
|
|
19151
19517
|
function projectDirSegment(absPath) {
|
|
19152
|
-
return `${hashProjectPath(absPath)}-${sanitizeMnemonic((0,
|
|
19518
|
+
return `${hashProjectPath(absPath)}-${sanitizeMnemonic((0, import_path6.basename)(absPath))}`;
|
|
19153
19519
|
}
|
|
19154
19520
|
function projectConfigDir(absPath) {
|
|
19155
|
-
return (0,
|
|
19521
|
+
return (0, import_path6.join)(PROJECTS_DIR, projectDirSegment(absPath));
|
|
19156
19522
|
}
|
|
19157
19523
|
function projectConfigFile(absPath) {
|
|
19158
|
-
return (0,
|
|
19524
|
+
return (0, import_path6.join)(projectConfigDir(absPath), "config.yaml");
|
|
19159
19525
|
}
|
|
19160
19526
|
function workspaceConfigFile(workspacePath) {
|
|
19161
|
-
return (0,
|
|
19527
|
+
return (0, import_path6.join)(workspacePath, WORKSPACE_CONFIG_BASENAME);
|
|
19162
19528
|
}
|
|
19163
19529
|
async function loadOptionalUserConfig(path6) {
|
|
19164
19530
|
let text;
|
|
19165
19531
|
try {
|
|
19166
|
-
text = await (0,
|
|
19532
|
+
text = await (0, import_promises15.readFile)(path6, "utf8");
|
|
19167
19533
|
} catch (err) {
|
|
19168
19534
|
if (err.code === "ENOENT") return {};
|
|
19169
19535
|
throw err;
|
|
@@ -19174,7 +19540,7 @@ async function loadProjectAgentboxDefaults(workspacePath) {
|
|
|
19174
19540
|
const path6 = workspaceConfigFile(workspacePath);
|
|
19175
19541
|
let text;
|
|
19176
19542
|
try {
|
|
19177
|
-
text = await (0,
|
|
19543
|
+
text = await (0, import_promises15.readFile)(path6, "utf8");
|
|
19178
19544
|
} catch (err) {
|
|
19179
19545
|
if (err.code === "ENOENT") return {};
|
|
19180
19546
|
throw err;
|
|
@@ -19275,7 +19641,7 @@ function writeLeaf(obj, branch, leaf, value) {
|
|
|
19275
19641
|
}
|
|
19276
19642
|
cur[segs[segs.length - 1]] = value;
|
|
19277
19643
|
}
|
|
19278
|
-
var PROJECT_GC_COUNTER_FILE = (0,
|
|
19644
|
+
var PROJECT_GC_COUNTER_FILE = (0, import_path7.join)(PROJECTS_DIR, ".gc.json");
|
|
19279
19645
|
|
|
19280
19646
|
// src/integrations.ts
|
|
19281
19647
|
var INTEGRATION_RPC_TIMEOUT_MS = 12e4;
|
|
@@ -19355,7 +19721,7 @@ function runHostBinary(connector, argv, cwd, timeoutMs) {
|
|
|
19355
19721
|
`
|
|
19356
19722
|
});
|
|
19357
19723
|
}
|
|
19358
|
-
return new Promise((
|
|
19724
|
+
return new Promise((resolve4) => {
|
|
19359
19725
|
const child = (0, import_node_child_process7.spawn)(connector.hostBin, [...argv], {
|
|
19360
19726
|
cwd,
|
|
19361
19727
|
env,
|
|
@@ -19367,7 +19733,7 @@ function runHostBinary(connector, argv, cwd, timeoutMs) {
|
|
|
19367
19733
|
const finish = (exitCode) => {
|
|
19368
19734
|
if (settled) return;
|
|
19369
19735
|
settled = true;
|
|
19370
|
-
|
|
19736
|
+
resolve4({ exitCode, stdout, stderr });
|
|
19371
19737
|
};
|
|
19372
19738
|
const timer = setTimeout(() => {
|
|
19373
19739
|
child.kill("SIGTERM");
|
|
@@ -19428,10 +19794,19 @@ var import_node_crypto2 = require("crypto");
|
|
|
19428
19794
|
var PendingPrompts = class {
|
|
19429
19795
|
entries = /* @__PURE__ */ new Map();
|
|
19430
19796
|
autoApprove = null;
|
|
19797
|
+
onChange = null;
|
|
19431
19798
|
/** Install the per-box auto-approve policy (relay server, once at startup). */
|
|
19432
19799
|
setAutoApprovePolicy(policy) {
|
|
19433
19800
|
this.autoApprove = policy;
|
|
19434
19801
|
}
|
|
19802
|
+
/**
|
|
19803
|
+
* Install a change hook fired whenever the pending set is mutated (add /
|
|
19804
|
+
* resolve). Wired by the relay server to the hub notifier so the embedded UI
|
|
19805
|
+
* pushes an update to connected browsers.
|
|
19806
|
+
*/
|
|
19807
|
+
setOnChange(fn) {
|
|
19808
|
+
this.onChange = fn;
|
|
19809
|
+
}
|
|
19435
19810
|
/**
|
|
19436
19811
|
* True when this box opted into `box.autoApproveHostActions`. Records the
|
|
19437
19812
|
* bypass to the audit sink as a side effect so the caller short-circuits
|
|
@@ -19442,14 +19817,26 @@ var PendingPrompts = class {
|
|
|
19442
19817
|
this.autoApprove.audit(boxId, params);
|
|
19443
19818
|
return true;
|
|
19444
19819
|
}
|
|
19820
|
+
/**
|
|
19821
|
+
* Record a *safe-subset* auto-approval (opening a PR, a contained file copy,
|
|
19822
|
+
* a sanctioned-branch push, …) to the audit sink WITHOUT the blanket
|
|
19823
|
+
* `autoApproveHostActions` opt-in. The handler already decided the action is
|
|
19824
|
+
* safe under `box.autoApproveSafeHostActions`; this just leaves the same
|
|
19825
|
+
* `host-action-auto-approved` trail a full opt-in would, tagged with `reason`.
|
|
19826
|
+
* No-op when no policy is installed (e.g. the stateless poll plane).
|
|
19827
|
+
*/
|
|
19828
|
+
noteAutoApprove(boxId, params, reason) {
|
|
19829
|
+
this.autoApprove?.audit(boxId, params, reason);
|
|
19830
|
+
}
|
|
19445
19831
|
add(boxId, ev) {
|
|
19446
|
-
return new Promise((
|
|
19832
|
+
return new Promise((resolve4) => {
|
|
19447
19833
|
this.entries.set(ev.id, {
|
|
19448
19834
|
ev,
|
|
19449
19835
|
boxId,
|
|
19450
|
-
resolve:
|
|
19836
|
+
resolve: resolve4,
|
|
19451
19837
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
19452
19838
|
});
|
|
19839
|
+
this.onChange?.();
|
|
19453
19840
|
});
|
|
19454
19841
|
}
|
|
19455
19842
|
/**
|
|
@@ -19462,6 +19849,7 @@ var PendingPrompts = class {
|
|
|
19462
19849
|
if (!entry) return false;
|
|
19463
19850
|
this.entries.delete(id);
|
|
19464
19851
|
entry.resolve({ answer, cancelled });
|
|
19852
|
+
this.onChange?.();
|
|
19465
19853
|
return true;
|
|
19466
19854
|
}
|
|
19467
19855
|
/**
|
|
@@ -19475,6 +19863,17 @@ var PendingPrompts = class {
|
|
|
19475
19863
|
}
|
|
19476
19864
|
return out;
|
|
19477
19865
|
}
|
|
19866
|
+
/**
|
|
19867
|
+
* Snapshot of every pending prompt across all boxes, with its boxId and
|
|
19868
|
+
* enqueue time — the hub's Approvals view lists these.
|
|
19869
|
+
*/
|
|
19870
|
+
all() {
|
|
19871
|
+
const out = [];
|
|
19872
|
+
for (const entry of this.entries.values()) {
|
|
19873
|
+
out.push({ id: entry.ev.id, boxId: entry.boxId, ev: entry.ev, createdAt: entry.createdAt });
|
|
19874
|
+
}
|
|
19875
|
+
return out;
|
|
19876
|
+
}
|
|
19478
19877
|
/** boxId that owns a pending prompt id, or null when unknown. */
|
|
19479
19878
|
boxFor(id) {
|
|
19480
19879
|
const entry = this.entries.get(id);
|
|
@@ -19556,6 +19955,20 @@ function isPromptAnswerBody(v) {
|
|
|
19556
19955
|
return true;
|
|
19557
19956
|
}
|
|
19558
19957
|
|
|
19958
|
+
// src/safe-transfer.ts
|
|
19959
|
+
async function canAutoApproveTransfer(input) {
|
|
19960
|
+
if (!input.enabled) return false;
|
|
19961
|
+
if (!input.workspacePath || input.hostPaths.length === 0) return false;
|
|
19962
|
+
for (const p of input.hostPaths) {
|
|
19963
|
+
if (!await isContainedInWorkspace(p, input.workspacePath)) return false;
|
|
19964
|
+
if (input.checkSecret && looksLikeSecret(p)) {
|
|
19965
|
+
const real = await realpathSafe(p);
|
|
19966
|
+
if (!input.carried?.has(real)) return false;
|
|
19967
|
+
}
|
|
19968
|
+
}
|
|
19969
|
+
return true;
|
|
19970
|
+
}
|
|
19971
|
+
|
|
19559
19972
|
// ../integrations/dist/index.js
|
|
19560
19973
|
var linearConnector = {
|
|
19561
19974
|
service: "linear",
|
|
@@ -19850,6 +20263,23 @@ async function resolveCloudBackend(name) {
|
|
|
19850
20263
|
const pkg = "@agentbox/sandbox-e2b";
|
|
19851
20264
|
return loadCloudBackend(pkg, async () => (await import(pkg)).e2bBackend);
|
|
19852
20265
|
}
|
|
20266
|
+
const plugin = pluginForProvider(name);
|
|
20267
|
+
if (plugin) {
|
|
20268
|
+
if (!isSupportedApiVersion(plugin.apiVersion)) {
|
|
20269
|
+
throw new Error(
|
|
20270
|
+
`relay: plugin '${plugin.packageName}' targets provider SDK v${String(plugin.apiVersion)}, which this AgentBox does not support`
|
|
20271
|
+
);
|
|
20272
|
+
}
|
|
20273
|
+
return loadCloudBackend(plugin.packageName, async () => {
|
|
20274
|
+
const mod = await import((0, import_node_url3.pathToFileURL)(plugin.resolvedEntry).href);
|
|
20275
|
+
const all = mod.providerModules ?? (mod.providerModule ? [mod.providerModule] : []);
|
|
20276
|
+
const pm = all.find((m) => m.provider?.name === name);
|
|
20277
|
+
if (!pm?.backend) {
|
|
20278
|
+
throw new Error(`plugin '${plugin.packageName}' exposes no cloud backend for '${name}'`);
|
|
20279
|
+
}
|
|
20280
|
+
return pm.backend;
|
|
20281
|
+
});
|
|
20282
|
+
}
|
|
19853
20283
|
throw new Error(`no host executor for cloud backend '${name}'`);
|
|
19854
20284
|
}
|
|
19855
20285
|
async function loadCloudBackend(pkg, load2) {
|
|
@@ -19961,7 +20391,20 @@ async function runGhPrRpc(action, deps) {
|
|
|
19961
20391
|
stderr: "host-initiated token rejected: invalid, expired, or bound to different params\n"
|
|
19962
20392
|
};
|
|
19963
20393
|
}
|
|
19964
|
-
|
|
20394
|
+
const ghSafeAuto = GH_PR_SAFE_AUTO_APPROVE_OPS.has(op) && deps.autoApproveSafeHostActions !== false && !prCreateHasExplicitHead(op, args);
|
|
20395
|
+
if (ghSafeAuto && !hostInitiatedGhOk) {
|
|
20396
|
+
deps.prompts?.noteAutoApprove(
|
|
20397
|
+
deps.boxId,
|
|
20398
|
+
{
|
|
20399
|
+
kind: "confirm",
|
|
20400
|
+
message: `gh pr ${op} from cloud box ${deps.boxName ?? deps.boxId}`,
|
|
20401
|
+
detail: args.join(" ").slice(0, 200),
|
|
20402
|
+
context: { command: `gh pr ${op}`, cwd: params.path, argv: args }
|
|
20403
|
+
},
|
|
20404
|
+
`safe: gh pr ${op}`
|
|
20405
|
+
);
|
|
20406
|
+
}
|
|
20407
|
+
if (!GH_PR_READ_ONLY_OPS.has(op) && !ghSafeAuto && !hostInitiatedGhOk && deps.prompts && deps.subscribers) {
|
|
19965
20408
|
const detail = args.join(" ").slice(0, 200);
|
|
19966
20409
|
const ctx = {
|
|
19967
20410
|
kind: "confirm",
|
|
@@ -20002,16 +20445,17 @@ async function runGhPrRpc(action, deps) {
|
|
|
20002
20445
|
}
|
|
20003
20446
|
}
|
|
20004
20447
|
let finalArgs = args;
|
|
20005
|
-
|
|
20448
|
+
const containerPath = params.path ?? "/workspace";
|
|
20449
|
+
const needsHeadProbe = op === "create" && !args.some((a2) => a2 === "--head" || a2.startsWith("--head="));
|
|
20450
|
+
if (needsHeadProbe) {
|
|
20006
20451
|
const backend = await resolveCloudBackend(deps.backendName);
|
|
20007
20452
|
const handle = { sandboxId: lookup.cloudSandboxId };
|
|
20008
|
-
const containerPath = params.path ?? "/workspace";
|
|
20009
20453
|
const branchProbe = await backend.exec(
|
|
20010
20454
|
handle,
|
|
20011
20455
|
`git -C ${shellQuote(containerPath)} rev-parse --abbrev-ref HEAD`
|
|
20012
20456
|
);
|
|
20013
20457
|
const branch = branchProbe.exitCode === 0 ? (branchProbe.stdout ?? "").trim() : "";
|
|
20014
|
-
finalArgs = injectPrCreateHead(op, branch,
|
|
20458
|
+
finalArgs = injectPrCreateHead(op, lookup.sanctionedBranch ?? branch, finalArgs);
|
|
20015
20459
|
}
|
|
20016
20460
|
if (prCreateNeedsHead(op, finalArgs)) return PR_CREATE_NO_HEAD_REFUSAL;
|
|
20017
20461
|
return runHostGh(["pr", op, ...finalArgs], lookup.workspacePath);
|
|
@@ -20059,8 +20503,21 @@ async function runGhRunRpc(action, deps) {
|
|
|
20059
20503
|
if (ghReady) return ghReady;
|
|
20060
20504
|
const lookup = await lookupCloudBox(deps.boxId);
|
|
20061
20505
|
if (!GH_RUN_READ_ONLY_OPS.has(op)) {
|
|
20062
|
-
|
|
20063
|
-
|
|
20506
|
+
if (deps.autoApproveSafeHostActions !== false) {
|
|
20507
|
+
deps.prompts?.noteAutoApprove(
|
|
20508
|
+
deps.boxId,
|
|
20509
|
+
{
|
|
20510
|
+
kind: "confirm",
|
|
20511
|
+
message: `gh run ${op} from cloud box ${deps.boxName ?? deps.boxId}`,
|
|
20512
|
+
detail: args.join(" ").slice(0, 200),
|
|
20513
|
+
context: { command: `gh run ${op}`, cwd: params.path, argv: args }
|
|
20514
|
+
},
|
|
20515
|
+
`safe: gh run ${op}`
|
|
20516
|
+
);
|
|
20517
|
+
} else {
|
|
20518
|
+
const denied = await cloudWriteConfirm(deps, `gh run ${op}`, params.path, args);
|
|
20519
|
+
if (denied) return denied;
|
|
20520
|
+
}
|
|
20064
20521
|
}
|
|
20065
20522
|
return runHostGh(["run", op, ...args], lookup.workspacePath);
|
|
20066
20523
|
}
|
|
@@ -20117,29 +20574,42 @@ async function runIntegrationRpc(action, deps) {
|
|
|
20117
20574
|
const ready = await assertIntegrationReady(connector);
|
|
20118
20575
|
if (ready) return ready;
|
|
20119
20576
|
if (opDesc.write) {
|
|
20120
|
-
|
|
20121
|
-
|
|
20122
|
-
|
|
20123
|
-
|
|
20124
|
-
|
|
20125
|
-
|
|
20126
|
-
|
|
20127
|
-
|
|
20128
|
-
|
|
20129
|
-
|
|
20130
|
-
exitCode: 10,
|
|
20131
|
-
stdout: "",
|
|
20132
|
-
stderr: "host-initiated token rejected: invalid, expired, or bound to different params\n"
|
|
20133
|
-
};
|
|
20134
|
-
}
|
|
20135
|
-
if (!tokenOk) {
|
|
20136
|
-
const denied = await cloudWriteConfirm(
|
|
20137
|
-
deps,
|
|
20138
|
-
`integration ${parsed.service} ${parsed.op}`,
|
|
20139
|
-
params.path,
|
|
20140
|
-
args
|
|
20577
|
+
if (deps.autoApproveSafeHostActions !== false) {
|
|
20578
|
+
deps.prompts?.noteAutoApprove(
|
|
20579
|
+
deps.boxId,
|
|
20580
|
+
{
|
|
20581
|
+
kind: "confirm",
|
|
20582
|
+
message: `integration ${parsed.service} ${parsed.op} from cloud box ${deps.boxName ?? deps.boxId}`,
|
|
20583
|
+
detail: args.join(" ").slice(0, 200),
|
|
20584
|
+
context: { command: `integration ${parsed.service} ${parsed.op}`, cwd: params.path, argv: args }
|
|
20585
|
+
},
|
|
20586
|
+
`safe: integration ${parsed.service} ${parsed.op}`
|
|
20141
20587
|
);
|
|
20142
|
-
|
|
20588
|
+
} else {
|
|
20589
|
+
const tokenClaimed = typeof params.hostInitiated === "string";
|
|
20590
|
+
const incomingHash = hashRpcParams(params);
|
|
20591
|
+
const tokenOk = tokenClaimed && (deps.hostInitiatedTokens?.consume(
|
|
20592
|
+
params.hostInitiated,
|
|
20593
|
+
deps.boxId,
|
|
20594
|
+
action.method,
|
|
20595
|
+
incomingHash
|
|
20596
|
+
) ?? false);
|
|
20597
|
+
if (tokenClaimed && !tokenOk) {
|
|
20598
|
+
return {
|
|
20599
|
+
exitCode: 10,
|
|
20600
|
+
stdout: "",
|
|
20601
|
+
stderr: "host-initiated token rejected: invalid, expired, or bound to different params\n"
|
|
20602
|
+
};
|
|
20603
|
+
}
|
|
20604
|
+
if (!tokenOk) {
|
|
20605
|
+
const denied = await cloudWriteConfirm(
|
|
20606
|
+
deps,
|
|
20607
|
+
`integration ${parsed.service} ${parsed.op}`,
|
|
20608
|
+
params.path,
|
|
20609
|
+
args
|
|
20610
|
+
);
|
|
20611
|
+
if (denied) return denied;
|
|
20612
|
+
}
|
|
20143
20613
|
}
|
|
20144
20614
|
}
|
|
20145
20615
|
return runHostIntegration(connector, opDesc, args, lookup.workspacePath);
|
|
@@ -20189,18 +20659,27 @@ async function lookupCloudBox(boxId) {
|
|
|
20189
20659
|
if (!sid) {
|
|
20190
20660
|
throw new Error(`box ${boxId} has no cloud.sandboxId \u2014 record is malformed`);
|
|
20191
20661
|
}
|
|
20192
|
-
return {
|
|
20662
|
+
return {
|
|
20663
|
+
workspacePath: hit.box.workspacePath,
|
|
20664
|
+
cloudSandboxId: sid,
|
|
20665
|
+
sanctionedBranch: hit.box.cloud?.sanctionedBranch ?? hit.box.cloud?.workspaceBranch
|
|
20666
|
+
};
|
|
20193
20667
|
}
|
|
20194
20668
|
async function boxWorkspacePath(boxId) {
|
|
20195
20669
|
const state = await readState();
|
|
20196
20670
|
const hit = findBox(boxId, state);
|
|
20197
20671
|
return hit.kind === "ok" ? hit.box.workspacePath : void 0;
|
|
20198
20672
|
}
|
|
20199
|
-
function
|
|
20200
|
-
|
|
20201
|
-
|
|
20202
|
-
|
|
20203
|
-
|
|
20673
|
+
async function boxCarriedHostPaths(boxId) {
|
|
20674
|
+
const out = /* @__PURE__ */ new Set();
|
|
20675
|
+
try {
|
|
20676
|
+
const state = await readState();
|
|
20677
|
+
const hit = findBox(boxId, state);
|
|
20678
|
+
const entries = hit.kind === "ok" ? hit.box.carry?.entries : void 0;
|
|
20679
|
+
for (const e of entries ?? []) out.add(await realpathSafe(e.src));
|
|
20680
|
+
} catch {
|
|
20681
|
+
}
|
|
20682
|
+
return out;
|
|
20204
20683
|
}
|
|
20205
20684
|
var cloudCpModule;
|
|
20206
20685
|
async function loadCloudCp() {
|
|
@@ -20249,7 +20728,21 @@ async function runCpRpc(action, deps) {
|
|
|
20249
20728
|
resolveHost: (p) => resolveHostPath(lookup.workspacePath, p),
|
|
20250
20729
|
flags: cpFlags(params)
|
|
20251
20730
|
});
|
|
20252
|
-
|
|
20731
|
+
const cpHostPaths = method === "cp.toHost" ? [resolveHostPath(lookup.workspacePath, norm.dest)] : norm.sources.map((s) => resolveHostPath(lookup.workspacePath, s));
|
|
20732
|
+
const cpAuto = await canAutoApproveTransfer({
|
|
20733
|
+
enabled: deps.autoApproveSafeHostActions !== false,
|
|
20734
|
+
workspacePath: lookup.workspacePath,
|
|
20735
|
+
hostPaths: cpHostPaths,
|
|
20736
|
+
checkSecret: method === "cp.fromHost",
|
|
20737
|
+
carried: method === "cp.fromHost" ? await boxCarriedHostPaths(deps.boxId) : void 0
|
|
20738
|
+
});
|
|
20739
|
+
if (cpAuto) {
|
|
20740
|
+
deps.prompts?.noteAutoApprove(
|
|
20741
|
+
deps.boxId,
|
|
20742
|
+
{ kind: "confirm", message: `cp (${direction}) on ${boxName}`, detail, context: { command: method, argv: contextArgv } },
|
|
20743
|
+
method === "cp.toHost" ? "safe: contained copy to host" : "safe: contained copy from host"
|
|
20744
|
+
);
|
|
20745
|
+
} else if (deps.prompts && deps.subscribers) {
|
|
20253
20746
|
const verdict = await askPrompt(deps.prompts, deps.subscribers, deps.boxId, {
|
|
20254
20747
|
kind: "confirm",
|
|
20255
20748
|
message: `Allow cp (${direction}) on ${boxName}?`,
|
|
@@ -20282,7 +20775,7 @@ async function runCheckpointRpc(action, deps) {
|
|
|
20282
20775
|
stderr: "relay: AGENTBOX_CLI_ENTRY not set; cannot run checkpoint host-side\n"
|
|
20283
20776
|
};
|
|
20284
20777
|
}
|
|
20285
|
-
if (deps.backendName === "vercel" && deps.prompts && deps.subscribers && deps.subscribers.forBox(deps.boxId).length > 0) {
|
|
20778
|
+
if (deps.backendName === "vercel" && deps.autoApproveSafeHostActions === false && deps.prompts && deps.subscribers && deps.subscribers.forBox(deps.boxId).length > 0) {
|
|
20286
20779
|
const verdict = await askPrompt(deps.prompts, deps.subscribers, deps.boxId, {
|
|
20287
20780
|
kind: "confirm",
|
|
20288
20781
|
message: `Create checkpoint on ${deps.boxName ?? deps.boxId}? The vercel box will stop and reboot.`,
|
|
@@ -20293,6 +20786,17 @@ async function runCheckpointRpc(action, deps) {
|
|
|
20293
20786
|
if (verdict.answer !== "y") {
|
|
20294
20787
|
return { exitCode: 10, stdout: "", stderr: "checkpoint denied by user\n" };
|
|
20295
20788
|
}
|
|
20789
|
+
} else if (deps.backendName === "vercel" && deps.subscribers && deps.subscribers.forBox(deps.boxId).length > 0) {
|
|
20790
|
+
deps.prompts?.noteAutoApprove(
|
|
20791
|
+
deps.boxId,
|
|
20792
|
+
{
|
|
20793
|
+
kind: "confirm",
|
|
20794
|
+
message: `checkpoint create on ${deps.boxName ?? deps.boxId} (vercel box will stop and reboot)`,
|
|
20795
|
+
detail: params.name ? `checkpoint: ${params.name}` : "(auto-named)",
|
|
20796
|
+
context: { command: "checkpoint create", argv: params.name ? [params.name] : [] }
|
|
20797
|
+
},
|
|
20798
|
+
"safe: checkpoint create"
|
|
20799
|
+
);
|
|
20296
20800
|
}
|
|
20297
20801
|
const argv = [process.execPath, entry, "checkpoint", "create", deps.boxId];
|
|
20298
20802
|
if (params.name) argv.push("--name", params.name);
|
|
@@ -20308,7 +20812,7 @@ async function runCheckpointRpc(action, deps) {
|
|
|
20308
20812
|
}
|
|
20309
20813
|
async function runDownloadRpc(action, deps) {
|
|
20310
20814
|
const params = action.params ?? {};
|
|
20311
|
-
const kind = action.method
|
|
20815
|
+
const kind = parseDownloadKind(action.method);
|
|
20312
20816
|
if (kind !== "workspace") {
|
|
20313
20817
|
return {
|
|
20314
20818
|
exitCode: 1,
|
|
@@ -20317,7 +20821,26 @@ async function runDownloadRpc(action, deps) {
|
|
|
20317
20821
|
`
|
|
20318
20822
|
};
|
|
20319
20823
|
}
|
|
20320
|
-
|
|
20824
|
+
const lookup = await lookupCloudBox(deps.boxId);
|
|
20825
|
+
const hostDst = typeof params.hostPath === "string" && params.hostPath.length > 0 ? resolveHostPath(lookup.workspacePath, params.hostPath) : lookup.workspacePath;
|
|
20826
|
+
const dlAuto = await canAutoApproveTransfer({
|
|
20827
|
+
enabled: deps.autoApproveSafeHostActions !== false,
|
|
20828
|
+
workspacePath: lookup.workspacePath,
|
|
20829
|
+
hostPaths: [hostDst],
|
|
20830
|
+
checkSecret: false
|
|
20831
|
+
});
|
|
20832
|
+
if (dlAuto) {
|
|
20833
|
+
deps.prompts?.noteAutoApprove(
|
|
20834
|
+
deps.boxId,
|
|
20835
|
+
{
|
|
20836
|
+
kind: "confirm",
|
|
20837
|
+
message: `download (${kind}) from ${deps.boxName ?? deps.boxId}`,
|
|
20838
|
+
detail: params.hostPath ?? "(default host location)",
|
|
20839
|
+
context: { command: action.method, argv: params.hostPath ? [params.hostPath] : [] }
|
|
20840
|
+
},
|
|
20841
|
+
"safe: contained download"
|
|
20842
|
+
);
|
|
20843
|
+
} else if (deps.prompts && deps.subscribers) {
|
|
20321
20844
|
const verdict = await askPrompt(deps.prompts, deps.subscribers, deps.boxId, {
|
|
20322
20845
|
kind: "confirm",
|
|
20323
20846
|
message: `Allow download (${kind}) from ${deps.boxName ?? deps.boxId}?`,
|
|
@@ -20332,11 +20855,9 @@ async function runDownloadRpc(action, deps) {
|
|
|
20332
20855
|
return { exitCode: 10, stdout: "", stderr: "denied by user\n" };
|
|
20333
20856
|
}
|
|
20334
20857
|
}
|
|
20335
|
-
const lookup = await lookupCloudBox(deps.boxId);
|
|
20336
20858
|
const backend = await resolveCloudBackend(deps.backendName);
|
|
20337
20859
|
const handle = { sandboxId: lookup.cloudSandboxId };
|
|
20338
20860
|
const cp = await loadCloudCp();
|
|
20339
|
-
const hostDst = typeof params.hostPath === "string" && params.hostPath.length > 0 ? resolveHostPath(lookup.workspacePath, params.hostPath) : lookup.workspacePath;
|
|
20340
20861
|
try {
|
|
20341
20862
|
const result = await cp.pullCloudDirContents(backend, handle, "/workspace", hostDst);
|
|
20342
20863
|
return { exitCode: 0, stdout: `${result.finalPath}
|
|
@@ -20368,7 +20889,7 @@ async function runGitRpc(action, deps) {
|
|
|
20368
20889
|
`git -C ${shellQuote(containerPath)} rev-parse --abbrev-ref HEAD`
|
|
20369
20890
|
);
|
|
20370
20891
|
const branch = (branchProbe.stdout ?? "").trim();
|
|
20371
|
-
if (branchProbe.exitCode !== 0 || branch
|
|
20892
|
+
if (branchProbe.exitCode !== 0 || !isResolvedBranch(branch)) {
|
|
20372
20893
|
return {
|
|
20373
20894
|
exitCode: branchProbe.exitCode || 1,
|
|
20374
20895
|
stdout: "",
|
|
@@ -20376,8 +20897,8 @@ async function runGitRpc(action, deps) {
|
|
|
20376
20897
|
};
|
|
20377
20898
|
}
|
|
20378
20899
|
if (params.hostOnly) {
|
|
20379
|
-
const dest =
|
|
20380
|
-
const stageSave = await (0,
|
|
20900
|
+
const dest = resolveLandDest(branch, params.as);
|
|
20901
|
+
const stageSave = await (0, import_promises16.mkdtemp)((0, import_node_path6.join)((0, import_node_os4.tmpdir)(), "agentbox-git-save-"));
|
|
20381
20902
|
const hostBundleSave = (0, import_node_path6.join)(stageSave, "op.bundle");
|
|
20382
20903
|
const remoteBundleSave = "/tmp/agentbox-rpc-save.bundle";
|
|
20383
20904
|
try {
|
|
@@ -20389,7 +20910,7 @@ async function runGitRpc(action, deps) {
|
|
|
20389
20910
|
return { exitCode: make.exitCode, stdout: "", stderr: `bundle create failed: ${make.stderr || make.stdout}` };
|
|
20390
20911
|
}
|
|
20391
20912
|
await backend.downloadFile(handle, remoteBundleSave, hostBundleSave);
|
|
20392
|
-
const refspec =
|
|
20913
|
+
const refspec = landRefspec(branch, dest, params.force);
|
|
20393
20914
|
const landed = await execa(
|
|
20394
20915
|
"git",
|
|
20395
20916
|
["-C", lookup.workspacePath, "fetch", hostBundleSave, refspec],
|
|
@@ -20409,28 +20930,42 @@ ${landed.stdout ?? ""}`,
|
|
|
20409
20930
|
stderr: landed.stderr ?? ""
|
|
20410
20931
|
};
|
|
20411
20932
|
} finally {
|
|
20412
|
-
await (0,
|
|
20933
|
+
await (0, import_promises16.rm)(stageSave, { recursive: true, force: true });
|
|
20413
20934
|
await backend.exec(handle, `rm -f ${shellQuote(remoteBundleSave)}`).catch(() => {
|
|
20414
20935
|
});
|
|
20415
20936
|
}
|
|
20416
20937
|
}
|
|
20417
|
-
const
|
|
20938
|
+
const isScratch = isScratchBranch(branch);
|
|
20939
|
+
const safeApproveOn = deps.autoApproveSafeHostActions !== false;
|
|
20940
|
+
const isSanctionedNonScratch = !isScratch && safeApproveOn && isSanctionedPushBranch(branch, lookup.sanctionedBranch);
|
|
20941
|
+
const bypassPushGate = isScratch || isSanctionedNonScratch;
|
|
20942
|
+
if (action.method === "git.push" && isSanctionedNonScratch) {
|
|
20943
|
+
deps.prompts?.noteAutoApprove(
|
|
20944
|
+
deps.boxId,
|
|
20945
|
+
{
|
|
20946
|
+
kind: "confirm",
|
|
20947
|
+
message: `git push to sanctioned branch ${branch} on ${deps.boxName ?? deps.boxId}`,
|
|
20948
|
+
context: { command: "git push", cwd: containerPath, argv: params.args }
|
|
20949
|
+
},
|
|
20950
|
+
"safe: sanctioned-branch push"
|
|
20951
|
+
);
|
|
20952
|
+
}
|
|
20418
20953
|
const tokenClaimedGit = typeof params.hostInitiated === "string";
|
|
20419
20954
|
const incomingHashGit = hashRpcParams(params);
|
|
20420
|
-
const hostInitiatedOk = !
|
|
20955
|
+
const hostInitiatedOk = !bypassPushGate && tokenClaimedGit && (deps.hostInitiatedTokens?.consume(
|
|
20421
20956
|
params.hostInitiated,
|
|
20422
20957
|
deps.boxId,
|
|
20423
20958
|
"git.push",
|
|
20424
20959
|
incomingHashGit
|
|
20425
20960
|
) ?? false);
|
|
20426
|
-
if (action.method === "git.push" && !
|
|
20961
|
+
if (action.method === "git.push" && !bypassPushGate && tokenClaimedGit && !hostInitiatedOk) {
|
|
20427
20962
|
return {
|
|
20428
20963
|
exitCode: 10,
|
|
20429
20964
|
stdout: "",
|
|
20430
20965
|
stderr: "host-initiated token rejected: invalid, expired, or bound to different params\n"
|
|
20431
20966
|
};
|
|
20432
20967
|
}
|
|
20433
|
-
if (action.method === "git.push" && !
|
|
20968
|
+
if (action.method === "git.push" && !bypassPushGate && !hostInitiatedOk && deps.prompts && deps.subscribers) {
|
|
20434
20969
|
const hasSubscriber = deps.subscribers.forBox(deps.boxId).length > 0;
|
|
20435
20970
|
if (!hasSubscriber && process.env["AGENTBOX_PROMPT"] !== "off") {
|
|
20436
20971
|
const noSubMode = (process.env["AGENTBOX_GIT_PUSH_NO_SUB"] ?? "deny").toLowerCase();
|
|
@@ -20451,7 +20986,7 @@ ${landed.stdout ?? ""}`,
|
|
|
20451
20986
|
{
|
|
20452
20987
|
kind: "confirm",
|
|
20453
20988
|
message: `Allow git push from cloud box ${deps.boxName ?? deps.boxId}?`,
|
|
20454
|
-
detail: `${params.remote
|
|
20989
|
+
detail: `${resolveRemote(params.remote)} ${branch} ${(params.args ?? []).join(" ")}`.trim(),
|
|
20455
20990
|
defaultAnswer: "n",
|
|
20456
20991
|
context: { command: "git push", cwd: containerPath, argv: params.args }
|
|
20457
20992
|
},
|
|
@@ -20465,7 +21000,7 @@ ${landed.stdout ?? ""}`,
|
|
|
20465
21000
|
const verdict = await askPrompt(deps.prompts, deps.subscribers, deps.boxId, {
|
|
20466
21001
|
kind: "confirm",
|
|
20467
21002
|
message: `Allow git push from cloud box ${deps.boxName ?? deps.boxId}?`,
|
|
20468
|
-
detail: `${params.remote
|
|
21003
|
+
detail: `${resolveRemote(params.remote)} ${branch} ${(params.args ?? []).join(" ")}`.trim(),
|
|
20469
21004
|
defaultAnswer: "n",
|
|
20470
21005
|
context: { command: "git push", cwd: containerPath, argv: params.args }
|
|
20471
21006
|
});
|
|
@@ -20474,7 +21009,7 @@ ${landed.stdout ?? ""}`,
|
|
|
20474
21009
|
}
|
|
20475
21010
|
}
|
|
20476
21011
|
}
|
|
20477
|
-
const stage = await (0,
|
|
21012
|
+
const stage = await (0, import_promises16.mkdtemp)((0, import_node_path6.join)((0, import_node_os4.tmpdir)(), "agentbox-git-rpc-"));
|
|
20478
21013
|
const hostBundle = (0, import_node_path6.join)(stage, "op.bundle");
|
|
20479
21014
|
const remoteBundle = "/tmp/agentbox-rpc.bundle";
|
|
20480
21015
|
try {
|
|
@@ -20487,26 +21022,24 @@ ${landed.stdout ?? ""}`,
|
|
|
20487
21022
|
return { exitCode: make.exitCode, stdout: "", stderr: `bundle create failed: ${make.stderr || make.stdout}` };
|
|
20488
21023
|
}
|
|
20489
21024
|
await backend.downloadFile(handle, remoteBundle, hostBundle);
|
|
20490
|
-
const
|
|
21025
|
+
const fetch2 = await execa(
|
|
20491
21026
|
"git",
|
|
20492
21027
|
["-C", lookup.workspacePath, "fetch", hostBundle, `${branch}:${branch}`],
|
|
20493
21028
|
{ reject: false }
|
|
20494
21029
|
);
|
|
20495
|
-
if (
|
|
21030
|
+
if (fetch2.exitCode !== 0) {
|
|
20496
21031
|
return {
|
|
20497
|
-
exitCode:
|
|
20498
|
-
stdout:
|
|
20499
|
-
stderr: `host git fetch from bundle failed: ${
|
|
21032
|
+
exitCode: fetch2.exitCode ?? 1,
|
|
21033
|
+
stdout: fetch2.stdout ?? "",
|
|
21034
|
+
stderr: `host git fetch from bundle failed: ${fetch2.stderr ?? ""}`
|
|
20500
21035
|
};
|
|
20501
21036
|
}
|
|
20502
|
-
const remote2 = params.remote
|
|
21037
|
+
const remote2 = resolveRemote(params.remote);
|
|
20503
21038
|
const argv = ["-C", lookup.workspacePath, "push", remote2, branch];
|
|
20504
|
-
|
|
20505
|
-
for (const a2 of params.args) if (typeof a2 === "string") argv.push(a2);
|
|
20506
|
-
}
|
|
21039
|
+
argv.push(...sanitizeGitArgs(params.args));
|
|
20507
21040
|
const push = await execa("git", argv, { reject: false });
|
|
20508
21041
|
let pushStderr = push.stderr ?? "";
|
|
20509
|
-
if ((push.exitCode ?? 1) === 0 && !branch
|
|
21042
|
+
if ((push.exitCode ?? 1) === 0 && !isScratchBranch(branch)) {
|
|
20510
21043
|
try {
|
|
20511
21044
|
const sha = await execa(
|
|
20512
21045
|
"git",
|
|
@@ -20517,19 +21050,19 @@ ${landed.stdout ?? ""}`,
|
|
|
20517
21050
|
if (sha.exitCode === 0 && shaText.length > 0) {
|
|
20518
21051
|
const updateRef = await backend.exec(
|
|
20519
21052
|
handle,
|
|
20520
|
-
`git -C ${shellQuote(containerPath)} update-ref
|
|
21053
|
+
`git -C ${shellQuote(containerPath)} update-ref ${remoteTrackingRef(remote2, branch)} ${shellQuote(shaText)}`
|
|
20521
21054
|
);
|
|
20522
21055
|
if (updateRef.exitCode !== 0) {
|
|
20523
21056
|
pushStderr += `
|
|
20524
|
-
relay: post-push in-box update-ref
|
|
21057
|
+
relay: post-push in-box update-ref ${remoteTrackingRef(remote2, branch)} failed: ${updateRef.stderr || updateRef.stdout}`;
|
|
20525
21058
|
}
|
|
20526
21059
|
const setUpstream = await backend.exec(
|
|
20527
21060
|
handle,
|
|
20528
|
-
`git -C ${shellQuote(containerPath)} branch --set-upstream-to=${remote2
|
|
21061
|
+
`git -C ${shellQuote(containerPath)} branch --set-upstream-to=${upstreamRef(remote2, branch)} ${shellQuote(branch)}`
|
|
20529
21062
|
);
|
|
20530
21063
|
if (setUpstream.exitCode !== 0) {
|
|
20531
21064
|
pushStderr += `
|
|
20532
|
-
relay: post-push in-box --set-upstream-to=${remote2
|
|
21065
|
+
relay: post-push in-box --set-upstream-to=${upstreamRef(remote2, branch)} failed: ${setUpstream.stderr || setUpstream.stdout}`;
|
|
20533
21066
|
}
|
|
20534
21067
|
} else {
|
|
20535
21068
|
pushStderr += `
|
|
@@ -20546,7 +21079,7 @@ relay: post-push in-box origin/upstream sync threw: ${err instanceof Error ? err
|
|
|
20546
21079
|
stderr: pushStderr
|
|
20547
21080
|
};
|
|
20548
21081
|
}
|
|
20549
|
-
const remote = params.remote
|
|
21082
|
+
const remote = resolveRemote(params.remote);
|
|
20550
21083
|
const hostFetch = await execa("git", ["-C", lookup.workspacePath, "fetch", remote], { reject: false });
|
|
20551
21084
|
if (hostFetch.exitCode !== 0) {
|
|
20552
21085
|
return {
|
|
@@ -20578,7 +21111,7 @@ relay: post-push in-box origin/upstream sync threw: ${err instanceof Error ? err
|
|
|
20578
21111
|
stderr: sandboxFetch.stderr
|
|
20579
21112
|
};
|
|
20580
21113
|
} finally {
|
|
20581
|
-
await (0,
|
|
21114
|
+
await (0, import_promises16.rm)(stage, { recursive: true, force: true });
|
|
20582
21115
|
await backend.exec(handle, `rm -f ${shellQuote(remoteBundle)}`).catch(() => {
|
|
20583
21116
|
});
|
|
20584
21117
|
}
|
|
@@ -20616,8 +21149,8 @@ var HostActionQueue = class {
|
|
|
20616
21149
|
params,
|
|
20617
21150
|
createdAt: new Date(this.now()).toISOString()
|
|
20618
21151
|
};
|
|
20619
|
-
return new Promise((
|
|
20620
|
-
this.map.set(id, { action, resolve:
|
|
21152
|
+
return new Promise((resolve4) => {
|
|
21153
|
+
this.map.set(id, { action, resolve: resolve4, delivered: false });
|
|
20621
21154
|
});
|
|
20622
21155
|
}
|
|
20623
21156
|
/**
|
|
@@ -20673,6 +21206,25 @@ var HostActionQueue = class {
|
|
|
20673
21206
|
}
|
|
20674
21207
|
};
|
|
20675
21208
|
|
|
21209
|
+
// src/hub-notifier.ts
|
|
21210
|
+
var HubNotifier = class {
|
|
21211
|
+
listeners = /* @__PURE__ */ new Set();
|
|
21212
|
+
/** Register a listener; returns an unsubscribe fn. */
|
|
21213
|
+
subscribe(fn) {
|
|
21214
|
+
this.listeners.add(fn);
|
|
21215
|
+
return () => this.listeners.delete(fn);
|
|
21216
|
+
}
|
|
21217
|
+
/** Fire every listener. A throwing listener never blocks the others. */
|
|
21218
|
+
notify() {
|
|
21219
|
+
for (const fn of this.listeners) {
|
|
21220
|
+
try {
|
|
21221
|
+
fn();
|
|
21222
|
+
} catch {
|
|
21223
|
+
}
|
|
21224
|
+
}
|
|
21225
|
+
}
|
|
21226
|
+
};
|
|
21227
|
+
|
|
20676
21228
|
// src/notices.ts
|
|
20677
21229
|
var import_node_crypto4 = require("crypto");
|
|
20678
21230
|
var DEFAULT_NOTICE_TTL_MS = 66e4;
|
|
@@ -20734,6 +21286,255 @@ var BoxNotices = class {
|
|
|
20734
21286
|
}
|
|
20735
21287
|
};
|
|
20736
21288
|
|
|
21289
|
+
// src/github-app.ts
|
|
21290
|
+
var import_node_crypto5 = require("crypto");
|
|
21291
|
+
function loadGitHubAppConfig() {
|
|
21292
|
+
const appId = process.env.GITHUB_APP_ID;
|
|
21293
|
+
let key = process.env.GITHUB_APP_PRIVATE_KEY;
|
|
21294
|
+
if (!appId || !key) return null;
|
|
21295
|
+
if (!key.includes("BEGIN")) {
|
|
21296
|
+
try {
|
|
21297
|
+
key = Buffer.from(key, "base64").toString("utf8");
|
|
21298
|
+
} catch {
|
|
21299
|
+
return null;
|
|
21300
|
+
}
|
|
21301
|
+
}
|
|
21302
|
+
const apiBaseUrl = process.env.GITHUB_API_URL || void 0;
|
|
21303
|
+
return { appId, privateKeyPem: key, apiBaseUrl };
|
|
21304
|
+
}
|
|
21305
|
+
function b64url(input) {
|
|
21306
|
+
return Buffer.from(input).toString("base64url");
|
|
21307
|
+
}
|
|
21308
|
+
function appJwt(cfg, nowMs = Date.now()) {
|
|
21309
|
+
const now = Math.floor(nowMs / 1e3);
|
|
21310
|
+
const header = b64url(JSON.stringify({ alg: "RS256", typ: "JWT" }));
|
|
21311
|
+
const payload = b64url(JSON.stringify({ iat: now - 60, exp: now + 540, iss: cfg.appId }));
|
|
21312
|
+
const signingInput = `${header}.${payload}`;
|
|
21313
|
+
const signature = (0, import_node_crypto5.createSign)("RSA-SHA256").update(signingInput).sign(cfg.privateKeyPem);
|
|
21314
|
+
return `${signingInput}.${b64url(signature)}`;
|
|
21315
|
+
}
|
|
21316
|
+
var RENEW_BEFORE_MS = 5 * 60 * 1e3;
|
|
21317
|
+
var GitHubAppLeaser = class {
|
|
21318
|
+
cfg;
|
|
21319
|
+
fetchImpl;
|
|
21320
|
+
now;
|
|
21321
|
+
apiBase;
|
|
21322
|
+
cache = /* @__PURE__ */ new Map();
|
|
21323
|
+
installationIds = /* @__PURE__ */ new Map();
|
|
21324
|
+
constructor(cfg, opts = {}) {
|
|
21325
|
+
this.cfg = cfg;
|
|
21326
|
+
this.fetchImpl = opts.fetchImpl ?? fetch;
|
|
21327
|
+
this.now = opts.now ?? Date.now;
|
|
21328
|
+
this.apiBase = (cfg.apiBaseUrl ?? "https://api.github.com").replace(/\/$/, "");
|
|
21329
|
+
}
|
|
21330
|
+
headers(jwt) {
|
|
21331
|
+
return {
|
|
21332
|
+
Authorization: `Bearer ${jwt}`,
|
|
21333
|
+
Accept: "application/vnd.github+json",
|
|
21334
|
+
"X-GitHub-Api-Version": "2022-11-28",
|
|
21335
|
+
"User-Agent": "agentbox-relay"
|
|
21336
|
+
};
|
|
21337
|
+
}
|
|
21338
|
+
/**
|
|
21339
|
+
* Resolve the installation id for `owner/repo`, or null when the App is not
|
|
21340
|
+
* installed on it (404). Caches positive lookups. Non-404 errors throw.
|
|
21341
|
+
*/
|
|
21342
|
+
async lookupInstallationId(owner, repo) {
|
|
21343
|
+
const key = `${owner}/${repo}`;
|
|
21344
|
+
const cached = this.installationIds.get(key);
|
|
21345
|
+
if (cached !== void 0) return cached;
|
|
21346
|
+
const jwt = appJwt(this.cfg, this.now());
|
|
21347
|
+
const res = await this.fetchImpl(`${this.apiBase}/repos/${owner}/${repo}/installation`, {
|
|
21348
|
+
headers: this.headers(jwt)
|
|
21349
|
+
});
|
|
21350
|
+
if (res.status === 404) return null;
|
|
21351
|
+
if (!res.ok) {
|
|
21352
|
+
throw new Error(`GET installation for ${key} \u2192 ${String(res.status)}`);
|
|
21353
|
+
}
|
|
21354
|
+
const body = await res.json();
|
|
21355
|
+
if (typeof body.id !== "number") throw new Error("installation response missing id");
|
|
21356
|
+
this.installationIds.set(key, body.id);
|
|
21357
|
+
return body.id;
|
|
21358
|
+
}
|
|
21359
|
+
async installationId(owner, repo) {
|
|
21360
|
+
const id = await this.lookupInstallationId(owner, repo);
|
|
21361
|
+
if (id === null) throw new Error(`GitHub App is not installed on ${owner}/${repo}`);
|
|
21362
|
+
return id;
|
|
21363
|
+
}
|
|
21364
|
+
/** Whether the App is installed on `owner/repo` — no token is minted. */
|
|
21365
|
+
async isRepoInstalled(owner, repo) {
|
|
21366
|
+
return await this.lookupInstallationId(owner, repo) !== null;
|
|
21367
|
+
}
|
|
21368
|
+
/**
|
|
21369
|
+
* Mint (or return a cached) installation token scoped to the single repo with
|
|
21370
|
+
* `contents: write` + `pull_requests: write`. Throws on any GitHub error.
|
|
21371
|
+
*/
|
|
21372
|
+
async leaseRepoToken(owner, repo) {
|
|
21373
|
+
const key = `${owner}/${repo}`;
|
|
21374
|
+
const cached = this.cache.get(key);
|
|
21375
|
+
if (cached && cached.expiresAtMs - this.now() > RENEW_BEFORE_MS) {
|
|
21376
|
+
return { token: cached.token, expiresAt: cached.expiresAt };
|
|
21377
|
+
}
|
|
21378
|
+
const id = await this.installationId(owner, repo);
|
|
21379
|
+
const jwt = appJwt(this.cfg, this.now());
|
|
21380
|
+
const res = await this.fetchImpl(`${this.apiBase}/app/installations/${String(id)}/access_tokens`, {
|
|
21381
|
+
method: "POST",
|
|
21382
|
+
headers: { ...this.headers(jwt), "Content-Type": "application/json" },
|
|
21383
|
+
body: JSON.stringify({
|
|
21384
|
+
repositories: [repo],
|
|
21385
|
+
permissions: { contents: "write", pull_requests: "write" }
|
|
21386
|
+
})
|
|
21387
|
+
});
|
|
21388
|
+
if (!res.ok) {
|
|
21389
|
+
throw new Error(`failed to mint installation token for ${key} (\u2192 ${String(res.status)})`);
|
|
21390
|
+
}
|
|
21391
|
+
const body = await res.json();
|
|
21392
|
+
if (!body.token || !body.expires_at) throw new Error("access_tokens response missing token/expires_at");
|
|
21393
|
+
this.cache.set(key, {
|
|
21394
|
+
token: body.token,
|
|
21395
|
+
expiresAt: body.expires_at,
|
|
21396
|
+
expiresAtMs: Date.parse(body.expires_at)
|
|
21397
|
+
});
|
|
21398
|
+
return { token: body.token, expiresAt: body.expires_at };
|
|
21399
|
+
}
|
|
21400
|
+
};
|
|
21401
|
+
|
|
21402
|
+
// src/git-pat.ts
|
|
21403
|
+
function parseGitRemote(origin) {
|
|
21404
|
+
const trimmed = origin.trim();
|
|
21405
|
+
if (trimmed.length === 0) throw new Error("empty git remote URL");
|
|
21406
|
+
const urlForm = /^[a-z][a-z0-9+.-]*:\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/(.+)$/i.exec(trimmed);
|
|
21407
|
+
const scpForm = /^(?:[^@/]+@)?([^/:]+):(.+)$/.exec(trimmed);
|
|
21408
|
+
let host;
|
|
21409
|
+
let path6;
|
|
21410
|
+
if (urlForm) {
|
|
21411
|
+
host = urlForm[1];
|
|
21412
|
+
path6 = urlForm[2];
|
|
21413
|
+
} else if (scpForm && !/^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed)) {
|
|
21414
|
+
host = scpForm[1];
|
|
21415
|
+
path6 = scpForm[2];
|
|
21416
|
+
} else {
|
|
21417
|
+
throw new Error(`unrecognized git remote URL: ${origin}`);
|
|
21418
|
+
}
|
|
21419
|
+
return { host, path: path6.replace(/^\/+/, "") };
|
|
21420
|
+
}
|
|
21421
|
+
function toAuthedHttpsUrl(origin, token) {
|
|
21422
|
+
const { host, path: path6 } = parseGitRemote(origin);
|
|
21423
|
+
return `https://x-access-token:${token}@${host}/${path6}`;
|
|
21424
|
+
}
|
|
21425
|
+
function repoSlugFromRemote(origin) {
|
|
21426
|
+
const { host, path: path6 } = parseGitRemote(origin);
|
|
21427
|
+
const repo = path6.replace(/\.git$/, "");
|
|
21428
|
+
return host.toLowerCase() === "github.com" ? repo : `${host}/${repo}`;
|
|
21429
|
+
}
|
|
21430
|
+
|
|
21431
|
+
// src/lease.ts
|
|
21432
|
+
async function leaseTokenResult(leaser, reg) {
|
|
21433
|
+
if (!leaser) {
|
|
21434
|
+
return {
|
|
21435
|
+
exitCode: 64,
|
|
21436
|
+
stdout: "",
|
|
21437
|
+
stderr: "git.lease-token: no GitHub App configured on this relay\n"
|
|
21438
|
+
};
|
|
21439
|
+
}
|
|
21440
|
+
const origin = reg.originUrl;
|
|
21441
|
+
if (!origin) {
|
|
21442
|
+
return {
|
|
21443
|
+
exitCode: 64,
|
|
21444
|
+
stdout: "",
|
|
21445
|
+
stderr: `git.lease-token: box ${reg.boxId} has no registered origin URL
|
|
21446
|
+
`
|
|
21447
|
+
};
|
|
21448
|
+
}
|
|
21449
|
+
let owner = "";
|
|
21450
|
+
let repo = "";
|
|
21451
|
+
let slug = "";
|
|
21452
|
+
try {
|
|
21453
|
+
const { path: path6 } = parseGitRemote(origin);
|
|
21454
|
+
const [o2, r] = path6.replace(/\.git$/, "").split("/");
|
|
21455
|
+
owner = o2 ?? "";
|
|
21456
|
+
repo = r ?? "";
|
|
21457
|
+
slug = repoSlugFromRemote(origin);
|
|
21458
|
+
} catch {
|
|
21459
|
+
return { exitCode: 65, stdout: "", stderr: `git.lease-token: unrecognized origin ${origin}
|
|
21460
|
+
` };
|
|
21461
|
+
}
|
|
21462
|
+
if (!owner || !repo) {
|
|
21463
|
+
return {
|
|
21464
|
+
exitCode: 65,
|
|
21465
|
+
stdout: "",
|
|
21466
|
+
stderr: `git.lease-token: cannot derive owner/repo from ${origin}
|
|
21467
|
+
`
|
|
21468
|
+
};
|
|
21469
|
+
}
|
|
21470
|
+
try {
|
|
21471
|
+
const leased = await leaser.leaseRepoToken(owner, repo);
|
|
21472
|
+
const payload = {
|
|
21473
|
+
token: leased.token,
|
|
21474
|
+
expiresAt: leased.expiresAt,
|
|
21475
|
+
remoteUrl: toAuthedHttpsUrl(origin, leased.token),
|
|
21476
|
+
repo: slug
|
|
21477
|
+
};
|
|
21478
|
+
return { exitCode: 0, stdout: JSON.stringify(payload), stderr: "" };
|
|
21479
|
+
} catch (err) {
|
|
21480
|
+
return {
|
|
21481
|
+
exitCode: 1,
|
|
21482
|
+
stdout: "",
|
|
21483
|
+
stderr: `git.lease-token: ${err instanceof Error ? err.message : String(err)}
|
|
21484
|
+
`
|
|
21485
|
+
};
|
|
21486
|
+
}
|
|
21487
|
+
}
|
|
21488
|
+
|
|
21489
|
+
// src/permission.ts
|
|
21490
|
+
var import_node_crypto6 = require("crypto");
|
|
21491
|
+
async function gateApproval(deps, boxId, method, params, promptParams) {
|
|
21492
|
+
if (deps.mode === "block") {
|
|
21493
|
+
if (!deps.prompts || !deps.subscribers) return { kind: "deny" };
|
|
21494
|
+
const verdict = await askPrompt(deps.prompts, deps.subscribers, boxId, promptParams);
|
|
21495
|
+
return verdict.answer === "y" && !verdict.cancelled ? { kind: "allow" } : { kind: "deny" };
|
|
21496
|
+
}
|
|
21497
|
+
if (process.env.AGENTBOX_PROMPT === "off") return { kind: "allow" };
|
|
21498
|
+
const box = await deps.store.getBox(boxId);
|
|
21499
|
+
if (box?.autoApproveHostActions) {
|
|
21500
|
+
await deps.store.appendEvent({
|
|
21501
|
+
boxId,
|
|
21502
|
+
type: "host-action-auto-approved",
|
|
21503
|
+
payload: {
|
|
21504
|
+
command: promptParams.context?.command,
|
|
21505
|
+
argv: promptParams.context?.argv,
|
|
21506
|
+
message: promptParams.message
|
|
21507
|
+
}
|
|
21508
|
+
});
|
|
21509
|
+
return { kind: "allow" };
|
|
21510
|
+
}
|
|
21511
|
+
const promptId = (0, import_node_crypto6.randomUUID)();
|
|
21512
|
+
const ev = { id: promptId, ...promptParams };
|
|
21513
|
+
await deps.store.createPrompt({
|
|
21514
|
+
id: promptId,
|
|
21515
|
+
boxId,
|
|
21516
|
+
ev,
|
|
21517
|
+
method,
|
|
21518
|
+
params,
|
|
21519
|
+
status: "pending",
|
|
21520
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
21521
|
+
});
|
|
21522
|
+
deps.subscribers?.broadcast(boxId, "prompt-ask", ev);
|
|
21523
|
+
return { kind: "pending", promptId };
|
|
21524
|
+
}
|
|
21525
|
+
|
|
21526
|
+
// src/worktree.ts
|
|
21527
|
+
function resolveWorktree(reg, containerPath) {
|
|
21528
|
+
const trees = reg.worktrees ?? [];
|
|
21529
|
+
if (trees.length === 0) return null;
|
|
21530
|
+
const exact = trees.find((w) => w.containerPath === containerPath);
|
|
21531
|
+
if (exact) return exact;
|
|
21532
|
+
const prefixMatches = trees.filter(
|
|
21533
|
+
(w) => containerPath === w.containerPath || containerPath.startsWith(w.containerPath + "/")
|
|
21534
|
+
).sort((a2, b) => b.containerPath.length - a2.containerPath.length);
|
|
21535
|
+
return prefixMatches[0] ?? trees.find((w) => w.containerPath === "/workspace") ?? null;
|
|
21536
|
+
}
|
|
21537
|
+
|
|
20737
21538
|
// src/registry.ts
|
|
20738
21539
|
var BoxRegistry = class {
|
|
20739
21540
|
map = /* @__PURE__ */ new Map();
|
|
@@ -20797,7 +21598,7 @@ var EventBuffer = class {
|
|
|
20797
21598
|
};
|
|
20798
21599
|
|
|
20799
21600
|
// src/status-store.ts
|
|
20800
|
-
var
|
|
21601
|
+
var import_promises17 = require("fs/promises");
|
|
20801
21602
|
var import_node_os5 = require("os");
|
|
20802
21603
|
var import_node_path7 = require("path");
|
|
20803
21604
|
function sanitizeMnemonic2(raw) {
|
|
@@ -20833,11 +21634,11 @@ var BoxStatusStore = class {
|
|
|
20833
21634
|
const target = boxStatusPathFor(boxId, name, projectIndex);
|
|
20834
21635
|
const tmp = `${target}.${String(process.pid)}.tmp`;
|
|
20835
21636
|
try {
|
|
20836
|
-
await (0,
|
|
20837
|
-
await (0,
|
|
20838
|
-
await (0,
|
|
21637
|
+
await (0, import_promises17.mkdir)(boxRunDirFor(boxId, name, projectIndex), { recursive: true });
|
|
21638
|
+
await (0, import_promises17.writeFile)(tmp, JSON.stringify(status), "utf8");
|
|
21639
|
+
await (0, import_promises17.rename)(tmp, target);
|
|
20839
21640
|
} catch {
|
|
20840
|
-
await (0,
|
|
21641
|
+
await (0, import_promises17.rm)(tmp, { force: true }).catch(() => {
|
|
20841
21642
|
});
|
|
20842
21643
|
}
|
|
20843
21644
|
}
|
|
@@ -20847,6 +21648,112 @@ var BoxStatusStore = class {
|
|
|
20847
21648
|
}
|
|
20848
21649
|
};
|
|
20849
21650
|
|
|
21651
|
+
// src/store/memory-store.ts
|
|
21652
|
+
var MemoryStore = class {
|
|
21653
|
+
registry;
|
|
21654
|
+
events;
|
|
21655
|
+
statusStore;
|
|
21656
|
+
prompts = /* @__PURE__ */ new Map();
|
|
21657
|
+
createJobs = /* @__PURE__ */ new Map();
|
|
21658
|
+
constructor(parts = {}) {
|
|
21659
|
+
this.registry = parts.registry ?? new BoxRegistry();
|
|
21660
|
+
this.events = parts.events ?? new EventBuffer();
|
|
21661
|
+
this.statusStore = parts.statusStore ?? new BoxStatusStore();
|
|
21662
|
+
}
|
|
21663
|
+
registerBox(reg) {
|
|
21664
|
+
this.registry.register(reg);
|
|
21665
|
+
return Promise.resolve();
|
|
21666
|
+
}
|
|
21667
|
+
getBox(boxId) {
|
|
21668
|
+
return Promise.resolve(this.registry.get(boxId));
|
|
21669
|
+
}
|
|
21670
|
+
authenticateBox(token) {
|
|
21671
|
+
return Promise.resolve(this.registry.authenticate(token));
|
|
21672
|
+
}
|
|
21673
|
+
listBoxes() {
|
|
21674
|
+
return Promise.resolve(this.registry.list());
|
|
21675
|
+
}
|
|
21676
|
+
forgetBox(boxId) {
|
|
21677
|
+
return Promise.resolve(this.registry.forget(boxId));
|
|
21678
|
+
}
|
|
21679
|
+
countBoxes() {
|
|
21680
|
+
return Promise.resolve(this.registry.size());
|
|
21681
|
+
}
|
|
21682
|
+
appendEvent(input) {
|
|
21683
|
+
return Promise.resolve(this.events.append(input));
|
|
21684
|
+
}
|
|
21685
|
+
listEvents(since, boxId) {
|
|
21686
|
+
return Promise.resolve(this.events.since(since, boxId));
|
|
21687
|
+
}
|
|
21688
|
+
countEvents() {
|
|
21689
|
+
return Promise.resolve(this.events.size());
|
|
21690
|
+
}
|
|
21691
|
+
setStatus(boxId, name, projectIndex, status) {
|
|
21692
|
+
return this.statusStore.set(boxId, name, projectIndex, status);
|
|
21693
|
+
}
|
|
21694
|
+
getStatus(boxId) {
|
|
21695
|
+
return Promise.resolve(this.statusStore.get(boxId));
|
|
21696
|
+
}
|
|
21697
|
+
deleteStatus(boxId) {
|
|
21698
|
+
this.statusStore.delete(boxId);
|
|
21699
|
+
return Promise.resolve();
|
|
21700
|
+
}
|
|
21701
|
+
createPrompt(row) {
|
|
21702
|
+
this.prompts.set(row.id, { ...row });
|
|
21703
|
+
return Promise.resolve();
|
|
21704
|
+
}
|
|
21705
|
+
getPrompt(promptId) {
|
|
21706
|
+
const row = this.prompts.get(promptId);
|
|
21707
|
+
return Promise.resolve(row ? { ...row } : null);
|
|
21708
|
+
}
|
|
21709
|
+
answerPrompt(promptId, answer, cancelled) {
|
|
21710
|
+
const row = this.prompts.get(promptId);
|
|
21711
|
+
if (!row || row.status !== "pending") return Promise.resolve(false);
|
|
21712
|
+
row.status = "answered";
|
|
21713
|
+
row.answer = answer;
|
|
21714
|
+
row.cancelled = cancelled;
|
|
21715
|
+
return Promise.resolve(true);
|
|
21716
|
+
}
|
|
21717
|
+
listPendingPrompts(boxId) {
|
|
21718
|
+
const out = [];
|
|
21719
|
+
for (const row of this.prompts.values()) {
|
|
21720
|
+
if (row.boxId === boxId && row.status === "pending") out.push({ ...row });
|
|
21721
|
+
}
|
|
21722
|
+
return Promise.resolve(out);
|
|
21723
|
+
}
|
|
21724
|
+
setPromptResult(promptId, result) {
|
|
21725
|
+
const row = this.prompts.get(promptId);
|
|
21726
|
+
if (row) row.result = result;
|
|
21727
|
+
return Promise.resolve();
|
|
21728
|
+
}
|
|
21729
|
+
enqueueCreateJob(job) {
|
|
21730
|
+
this.createJobs.set(job.id, { ...job });
|
|
21731
|
+
return Promise.resolve();
|
|
21732
|
+
}
|
|
21733
|
+
getCreateJob(id) {
|
|
21734
|
+
const job = this.createJobs.get(id);
|
|
21735
|
+
return Promise.resolve(job ? { ...job } : null);
|
|
21736
|
+
}
|
|
21737
|
+
claimNextCreateJob(workerId) {
|
|
21738
|
+
const queued = [...this.createJobs.values()].filter((j) => j.status === "queued").sort((a2, b) => a2.createdAt.localeCompare(b.createdAt));
|
|
21739
|
+
const job = queued[0];
|
|
21740
|
+
if (!job) return Promise.resolve(null);
|
|
21741
|
+
job.status = "running";
|
|
21742
|
+
job.claimedBy = workerId;
|
|
21743
|
+
job.startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
21744
|
+
return Promise.resolve({ ...job });
|
|
21745
|
+
}
|
|
21746
|
+
completeCreateJob(id, status, result) {
|
|
21747
|
+
const job = this.createJobs.get(id);
|
|
21748
|
+
if (job) {
|
|
21749
|
+
job.status = status;
|
|
21750
|
+
job.result = result;
|
|
21751
|
+
job.finishedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
21752
|
+
}
|
|
21753
|
+
return Promise.resolve();
|
|
21754
|
+
}
|
|
21755
|
+
};
|
|
21756
|
+
|
|
20850
21757
|
// src/server.ts
|
|
20851
21758
|
var BOX_STATUS_EVENT = "box-status";
|
|
20852
21759
|
var MAX_BODY_BYTES = 1024 * 1024;
|
|
@@ -20869,7 +21776,7 @@ function send(res, status, body, contentType = "application/json") {
|
|
|
20869
21776
|
}
|
|
20870
21777
|
}
|
|
20871
21778
|
async function readJsonBody(req) {
|
|
20872
|
-
return new Promise((
|
|
21779
|
+
return new Promise((resolve4, reject) => {
|
|
20873
21780
|
let total = 0;
|
|
20874
21781
|
const chunks = [];
|
|
20875
21782
|
req.on("data", (chunk) => {
|
|
@@ -20884,11 +21791,11 @@ async function readJsonBody(req) {
|
|
|
20884
21791
|
req.on("end", () => {
|
|
20885
21792
|
const text = Buffer.concat(chunks).toString("utf8");
|
|
20886
21793
|
if (text.length === 0) {
|
|
20887
|
-
|
|
21794
|
+
resolve4({});
|
|
20888
21795
|
return;
|
|
20889
21796
|
}
|
|
20890
21797
|
try {
|
|
20891
|
-
|
|
21798
|
+
resolve4(JSON.parse(text));
|
|
20892
21799
|
} catch (err) {
|
|
20893
21800
|
reject(err instanceof Error ? err : new Error(String(err)));
|
|
20894
21801
|
}
|
|
@@ -20915,19 +21822,25 @@ function createRelayServer(opts) {
|
|
|
20915
21822
|
const prompts = new PendingPrompts();
|
|
20916
21823
|
const subscribers = new PromptSubscribers();
|
|
20917
21824
|
const notices = new BoxNotices(subscribers);
|
|
21825
|
+
const hubNotifier = new HubNotifier();
|
|
21826
|
+
prompts.setOnChange(() => hubNotifier.notify());
|
|
21827
|
+
const store = opts.store ?? new MemoryStore({ registry, events, statusStore });
|
|
20918
21828
|
prompts.setAutoApprovePolicy({
|
|
20919
21829
|
shouldAutoApprove: (boxId) => registry.get(boxId)?.autoApproveHostActions === true,
|
|
20920
|
-
audit: (boxId, params) => {
|
|
21830
|
+
audit: (boxId, params, reason) => {
|
|
20921
21831
|
events.append({
|
|
20922
21832
|
boxId,
|
|
20923
21833
|
type: "host-action-auto-approved",
|
|
20924
21834
|
payload: {
|
|
20925
21835
|
command: params.context?.command,
|
|
20926
21836
|
argv: params.context?.argv,
|
|
20927
|
-
message: params.message
|
|
21837
|
+
message: params.message,
|
|
21838
|
+
...reason ? { reason } : {}
|
|
20928
21839
|
}
|
|
20929
21840
|
});
|
|
20930
|
-
log(
|
|
21841
|
+
log(
|
|
21842
|
+
`auto-approved host action for ${boxId}: ${params.context?.command ?? params.message}` + (reason ? ` (${reason})` : "")
|
|
21843
|
+
);
|
|
20931
21844
|
}
|
|
20932
21845
|
});
|
|
20933
21846
|
const hostInitiatedTokens = new HostInitiatedTokens();
|
|
@@ -20939,6 +21852,11 @@ function createRelayServer(opts) {
|
|
|
20939
21852
|
throw new Error("relay mode='box' requires a non-empty bridgeToken");
|
|
20940
21853
|
}
|
|
20941
21854
|
const bridgeToken = opts.bridgeToken ?? "";
|
|
21855
|
+
const promptMode = opts.promptMode ?? "block";
|
|
21856
|
+
const gateDeps = { mode: promptMode, store, prompts, subscribers };
|
|
21857
|
+
const githubAppConfig = opts.githubApp === void 0 ? loadGitHubAppConfig() : opts.githubApp;
|
|
21858
|
+
const leaser = githubAppConfig ? new GitHubAppLeaser(githubAppConfig) : null;
|
|
21859
|
+
const uiHandler = opts.uiHandler;
|
|
20942
21860
|
let pollers = null;
|
|
20943
21861
|
async function getPollers() {
|
|
20944
21862
|
if (!pollers) {
|
|
@@ -20961,9 +21879,13 @@ function createRelayServer(opts) {
|
|
|
20961
21879
|
if (route === "GET /healthz") {
|
|
20962
21880
|
send(res, 200, {
|
|
20963
21881
|
ok: true,
|
|
20964
|
-
boxes:
|
|
20965
|
-
events:
|
|
21882
|
+
boxes: await store.countBoxes(),
|
|
21883
|
+
events: await store.countEvents(),
|
|
20966
21884
|
pid: process.pid,
|
|
21885
|
+
// True when a Next UI is delegated here (the embedded hub) vs a bare relay.
|
|
21886
|
+
// Lets `agentbox hub` distinguish "a hub already runs" from "a lean relay
|
|
21887
|
+
// holds the port" (reclaim + respawn as the hub).
|
|
21888
|
+
ui: Boolean(uiHandler),
|
|
20967
21889
|
cliEntry: Boolean(process.env.AGENTBOX_CLI_ENTRY),
|
|
20968
21890
|
// The spawning CLI's version/commit (inherited via env at spawn time).
|
|
20969
21891
|
// `version` lets host-side ensureRelay reclaim a relay left over from a
|
|
@@ -20988,11 +21910,11 @@ function createRelayServer(opts) {
|
|
|
20988
21910
|
}
|
|
20989
21911
|
if (route === "GET /bridge/poll") {
|
|
20990
21912
|
const since = Number.parseInt(url.searchParams.get("since") ?? "0", 10) || 0;
|
|
20991
|
-
const newEvents =
|
|
21913
|
+
const newEvents = await store.listEvents(since);
|
|
20992
21914
|
const lastId = newEvents.length > 0 ? newEvents[newEvents.length - 1].id : since;
|
|
20993
21915
|
const actions = hostActions.drain();
|
|
20994
|
-
const only =
|
|
20995
|
-
const status = only ?
|
|
21916
|
+
const only = (await store.listBoxes())[0];
|
|
21917
|
+
const status = only ? await store.getStatus(only.boxId) ?? null : null;
|
|
20996
21918
|
const reply = {
|
|
20997
21919
|
actions,
|
|
20998
21920
|
events: newEvents,
|
|
@@ -21023,14 +21945,18 @@ function createRelayServer(opts) {
|
|
|
21023
21945
|
send(res, 404, { error: "not found", route });
|
|
21024
21946
|
return;
|
|
21025
21947
|
}
|
|
21026
|
-
if (url.pathname.startsWith("/admin/")) {
|
|
21948
|
+
if (url.pathname.startsWith("/admin/") || url.pathname.startsWith("/remote/")) {
|
|
21949
|
+
if (url.pathname.startsWith("/remote/")) {
|
|
21950
|
+
send(res, 404, { error: "not found", route });
|
|
21951
|
+
return;
|
|
21952
|
+
}
|
|
21027
21953
|
if (!isLoopbackAddress(req.socket.remoteAddress)) {
|
|
21028
21954
|
send(res, 403, { error: "admin endpoints are loopback-only" });
|
|
21029
21955
|
return;
|
|
21030
21956
|
}
|
|
21031
21957
|
}
|
|
21032
21958
|
if (route === "POST /events") {
|
|
21033
|
-
const reg = authBox(req, res
|
|
21959
|
+
const reg = await authBox(req, res);
|
|
21034
21960
|
if (!reg) return;
|
|
21035
21961
|
const body = await readJsonBody(req);
|
|
21036
21962
|
if (!body || typeof body.type !== "string" || body.type.length === 0) {
|
|
@@ -21042,12 +21968,12 @@ function createRelayServer(opts) {
|
|
|
21042
21968
|
send(res, 400, { error: "invalid box-status payload" });
|
|
21043
21969
|
return;
|
|
21044
21970
|
}
|
|
21045
|
-
await
|
|
21971
|
+
await store.setStatus(reg.boxId, reg.name, reg.projectIndex, body.payload);
|
|
21046
21972
|
log(`box-status box=${reg.boxId}`);
|
|
21047
21973
|
send(res, 202, { ok: true });
|
|
21048
21974
|
return;
|
|
21049
21975
|
}
|
|
21050
|
-
const ev =
|
|
21976
|
+
const ev = await store.appendEvent({
|
|
21051
21977
|
boxId: reg.boxId,
|
|
21052
21978
|
type: body.type,
|
|
21053
21979
|
ts: typeof body.ts === "string" ? body.ts : void 0,
|
|
@@ -21058,7 +21984,7 @@ function createRelayServer(opts) {
|
|
|
21058
21984
|
return;
|
|
21059
21985
|
}
|
|
21060
21986
|
if (route === "POST /rpc") {
|
|
21061
|
-
const reg = authBox(req, res
|
|
21987
|
+
const reg = await authBox(req, res);
|
|
21062
21988
|
if (!reg) return;
|
|
21063
21989
|
const body = await readJsonBody(req);
|
|
21064
21990
|
if (!body || typeof body.method !== "string" || body.method.length === 0) {
|
|
@@ -21073,6 +21999,27 @@ function createRelayServer(opts) {
|
|
|
21073
21999
|
return;
|
|
21074
22000
|
}
|
|
21075
22001
|
if (body.method === "git.push" || body.method === "git.fetch") {
|
|
22002
|
+
if (reg.kind === "cloud") {
|
|
22003
|
+
const action = {
|
|
22004
|
+
id: "",
|
|
22005
|
+
boxId: reg.boxId,
|
|
22006
|
+
method: body.method,
|
|
22007
|
+
params: body.params,
|
|
22008
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
22009
|
+
};
|
|
22010
|
+
const result2 = await executeCloudAction(action, {
|
|
22011
|
+
backendName: reg.backend ?? "",
|
|
22012
|
+
boxId: reg.boxId,
|
|
22013
|
+
boxName: reg.name,
|
|
22014
|
+
prompts,
|
|
22015
|
+
subscribers,
|
|
22016
|
+
hostInitiatedTokens,
|
|
22017
|
+
autoApproveSafeHostActions: reg.autoApproveSafeHostActions,
|
|
22018
|
+
log
|
|
22019
|
+
});
|
|
22020
|
+
send(res, result2.exitCode === 0 ? 200 : 500, result2);
|
|
22021
|
+
return;
|
|
22022
|
+
}
|
|
21076
22023
|
if (body.method === "git.push") {
|
|
21077
22024
|
const hostOnlyParams = body.params;
|
|
21078
22025
|
if (hostOnlyParams?.hostOnly) {
|
|
@@ -21082,11 +22029,26 @@ function createRelayServer(opts) {
|
|
|
21082
22029
|
}
|
|
21083
22030
|
const params = body.params;
|
|
21084
22031
|
const worktree = resolveWorktree(reg, params?.path ?? "/workspace");
|
|
21085
|
-
const
|
|
22032
|
+
const dockerPushBranch = worktree?.sanctionedBranch ?? worktree?.branch;
|
|
22033
|
+
const isScratch = isScratchBranch(dockerPushBranch);
|
|
22034
|
+
const safeApproveOn = reg.autoApproveSafeHostActions !== false;
|
|
22035
|
+
const isSanctionedNonScratch = !isScratch && safeApproveOn && isSanctionedPushBranch(dockerPushBranch, dockerPushBranch);
|
|
22036
|
+
const bypassPushGate = isScratch || isSanctionedNonScratch;
|
|
22037
|
+
if (isSanctionedNonScratch) {
|
|
22038
|
+
prompts.noteAutoApprove(
|
|
22039
|
+
reg.boxId,
|
|
22040
|
+
{
|
|
22041
|
+
kind: "confirm",
|
|
22042
|
+
message: `git push to sanctioned branch ${dockerPushBranch ?? ""} from box ${reg.name}`,
|
|
22043
|
+
context: { command: "git push", cwd: params?.path, argv: params?.args }
|
|
22044
|
+
},
|
|
22045
|
+
"safe: sanctioned-branch push"
|
|
22046
|
+
);
|
|
22047
|
+
}
|
|
21086
22048
|
const tokenClaimed = typeof params?.hostInitiated === "string";
|
|
21087
22049
|
const incomingHash = hashRpcParams(params);
|
|
21088
|
-
const hostInitiatedOk = !
|
|
21089
|
-
if (!
|
|
22050
|
+
const hostInitiatedOk = !bypassPushGate && tokenClaimed && hostInitiatedTokens.consume(params?.hostInitiated, reg.boxId, "git.push", incomingHash);
|
|
22051
|
+
if (!bypassPushGate && tokenClaimed && !hostInitiatedOk) {
|
|
21090
22052
|
send(res, 500, {
|
|
21091
22053
|
exitCode: 10,
|
|
21092
22054
|
stdout: "",
|
|
@@ -21094,11 +22056,11 @@ function createRelayServer(opts) {
|
|
|
21094
22056
|
});
|
|
21095
22057
|
return;
|
|
21096
22058
|
}
|
|
21097
|
-
if (!
|
|
21098
|
-
const
|
|
22059
|
+
if (!bypassPushGate && !hostInitiatedOk) {
|
|
22060
|
+
const gate = await gateApproval(gateDeps, reg.boxId, "git.push", body.params, {
|
|
21099
22061
|
kind: "confirm",
|
|
21100
22062
|
message: `Allow git push from box ${reg.name}?`,
|
|
21101
|
-
detail: `${params?.remote
|
|
22063
|
+
detail: `${resolveRemote(params?.remote)} ${(params?.args ?? []).join(" ")}`.trim(),
|
|
21102
22064
|
defaultAnswer: "n",
|
|
21103
22065
|
context: {
|
|
21104
22066
|
command: "git push",
|
|
@@ -21106,7 +22068,11 @@ function createRelayServer(opts) {
|
|
|
21106
22068
|
argv: params?.args
|
|
21107
22069
|
}
|
|
21108
22070
|
});
|
|
21109
|
-
if (
|
|
22071
|
+
if (gate.kind === "pending") {
|
|
22072
|
+
send(res, 202, { status: "pending", promptId: gate.promptId });
|
|
22073
|
+
return;
|
|
22074
|
+
}
|
|
22075
|
+
if (gate.kind === "deny") {
|
|
21110
22076
|
send(res, 500, { exitCode: 10, stdout: "", stderr: "denied by user\n" });
|
|
21111
22077
|
return;
|
|
21112
22078
|
}
|
|
@@ -21117,6 +22083,31 @@ function createRelayServer(opts) {
|
|
|
21117
22083
|
send(res, status, result);
|
|
21118
22084
|
return;
|
|
21119
22085
|
}
|
|
22086
|
+
if (body.method === "git.lease-token") {
|
|
22087
|
+
const params = body.params;
|
|
22088
|
+
const worktree = resolveWorktree(reg, params?.path ?? "/workspace");
|
|
22089
|
+
const isAgentboxBranch = isScratchBranch(worktree?.branch);
|
|
22090
|
+
if (!isAgentboxBranch) {
|
|
22091
|
+
const gate = await gateApproval(gateDeps, reg.boxId, "git.lease-token", body.params, {
|
|
22092
|
+
kind: "confirm",
|
|
22093
|
+
message: `Allow box ${reg.name} to lease a push token for ${reg.originUrl ?? "its repo"}?`,
|
|
22094
|
+
detail: `branch ${worktree?.branch ?? "(unregistered)"}`,
|
|
22095
|
+
defaultAnswer: "n",
|
|
22096
|
+
context: { command: "git lease-token", cwd: params?.path }
|
|
22097
|
+
});
|
|
22098
|
+
if (gate.kind === "pending") {
|
|
22099
|
+
send(res, 202, { status: "pending", promptId: gate.promptId });
|
|
22100
|
+
return;
|
|
22101
|
+
}
|
|
22102
|
+
if (gate.kind === "deny") {
|
|
22103
|
+
send(res, 500, { exitCode: 10, stdout: "", stderr: "denied by user\n" });
|
|
22104
|
+
return;
|
|
22105
|
+
}
|
|
22106
|
+
}
|
|
22107
|
+
const result = await leaseTokenResult(leaser, reg);
|
|
22108
|
+
send(res, result.exitCode === 0 ? 200 : 500, result);
|
|
22109
|
+
return;
|
|
22110
|
+
}
|
|
21120
22111
|
if (body.method === "cp.toHost" || body.method === "cp.fromHost") {
|
|
21121
22112
|
const params = body.params;
|
|
21122
22113
|
let norm;
|
|
@@ -21146,19 +22137,40 @@ function createRelayServer(opts) {
|
|
|
21146
22137
|
}
|
|
21147
22138
|
if (params.defaultExcludes === false) detailParts.push("(default excludes off)");
|
|
21148
22139
|
if (params.yes) detailParts.push("(over size limit \u2014 confirmed)");
|
|
21149
|
-
const
|
|
21150
|
-
|
|
21151
|
-
|
|
21152
|
-
|
|
21153
|
-
|
|
21154
|
-
|
|
21155
|
-
|
|
21156
|
-
argv: contextArgv
|
|
21157
|
-
}
|
|
22140
|
+
const cpHostPaths = body.method === "cp.toHost" ? [resolveHostPath(workspacePath, norm.dest)] : norm.sources.map((s) => resolveHostPath(workspacePath, s));
|
|
22141
|
+
const cpAuto = await canAutoApproveTransfer({
|
|
22142
|
+
enabled: reg.autoApproveSafeHostActions !== false,
|
|
22143
|
+
workspacePath,
|
|
22144
|
+
hostPaths: cpHostPaths,
|
|
22145
|
+
checkSecret: body.method === "cp.fromHost",
|
|
22146
|
+
carried: body.method === "cp.fromHost" ? await boxCarriedHostPaths(reg.boxId) : void 0
|
|
21158
22147
|
});
|
|
21159
|
-
if (
|
|
21160
|
-
|
|
21161
|
-
|
|
22148
|
+
if (cpAuto) {
|
|
22149
|
+
prompts.noteAutoApprove(
|
|
22150
|
+
reg.boxId,
|
|
22151
|
+
{
|
|
22152
|
+
kind: "confirm",
|
|
22153
|
+
message: `cp (${direction}) on ${reg.name}`,
|
|
22154
|
+
detail: detailParts.join("\n"),
|
|
22155
|
+
context: { command: body.method, argv: contextArgv }
|
|
22156
|
+
},
|
|
22157
|
+
body.method === "cp.toHost" ? "safe: contained copy to host" : "safe: contained copy from host"
|
|
22158
|
+
);
|
|
22159
|
+
} else {
|
|
22160
|
+
const verdict = await askPrompt(prompts, subscribers, reg.boxId, {
|
|
22161
|
+
kind: "confirm",
|
|
22162
|
+
message: `Allow cp (${direction}) on ${reg.name}?`,
|
|
22163
|
+
detail: detailParts.join("\n"),
|
|
22164
|
+
defaultAnswer: "n",
|
|
22165
|
+
context: {
|
|
22166
|
+
command: body.method,
|
|
22167
|
+
argv: contextArgv
|
|
22168
|
+
}
|
|
22169
|
+
});
|
|
22170
|
+
if (verdict.answer !== "y") {
|
|
22171
|
+
send(res, 500, { exitCode: 10, stdout: "", stderr: "denied by user\n" });
|
|
22172
|
+
return;
|
|
22173
|
+
}
|
|
21162
22174
|
}
|
|
21163
22175
|
const result = await handleCpRpc(cpArgs, workspacePath);
|
|
21164
22176
|
const status = result.exitCode === 0 ? 200 : 500;
|
|
@@ -21230,20 +22242,40 @@ function createRelayServer(opts) {
|
|
|
21230
22242
|
}
|
|
21231
22243
|
if (body.method === "download.workspace" || body.method === "download.env" || body.method === "download.config" || body.method === "download.claude") {
|
|
21232
22244
|
const params = body.params;
|
|
21233
|
-
const kind = body.method
|
|
21234
|
-
const
|
|
21235
|
-
|
|
21236
|
-
|
|
21237
|
-
|
|
21238
|
-
|
|
21239
|
-
|
|
21240
|
-
command: body.method,
|
|
21241
|
-
argv: params?.hostPath ? [params.hostPath] : []
|
|
21242
|
-
}
|
|
22245
|
+
const kind = parseDownloadKind(body.method);
|
|
22246
|
+
const dlWorkspace = await boxWorkspacePath(reg.boxId);
|
|
22247
|
+
const dlAuto = kind === "workspace" && await canAutoApproveTransfer({
|
|
22248
|
+
enabled: reg.autoApproveSafeHostActions !== false,
|
|
22249
|
+
workspacePath: dlWorkspace,
|
|
22250
|
+
hostPaths: dlWorkspace ? [dlWorkspace] : [],
|
|
22251
|
+
checkSecret: false
|
|
21243
22252
|
});
|
|
21244
|
-
if (
|
|
21245
|
-
|
|
21246
|
-
|
|
22253
|
+
if (dlAuto) {
|
|
22254
|
+
prompts.noteAutoApprove(
|
|
22255
|
+
reg.boxId,
|
|
22256
|
+
{
|
|
22257
|
+
kind: "confirm",
|
|
22258
|
+
message: `download (${kind}) from ${reg.name}`,
|
|
22259
|
+
detail: params?.hostPath ?? "(default host location)",
|
|
22260
|
+
context: { command: body.method, argv: params?.hostPath ? [params.hostPath] : [] }
|
|
22261
|
+
},
|
|
22262
|
+
"safe: contained download"
|
|
22263
|
+
);
|
|
22264
|
+
} else {
|
|
22265
|
+
const verdict = await askPrompt(prompts, subscribers, reg.boxId, {
|
|
22266
|
+
kind: "confirm",
|
|
22267
|
+
message: `Allow download (${kind}) from ${reg.name}?`,
|
|
22268
|
+
detail: params?.hostPath ?? "(default host location)",
|
|
22269
|
+
defaultAnswer: "n",
|
|
22270
|
+
context: {
|
|
22271
|
+
command: body.method,
|
|
22272
|
+
argv: params?.hostPath ? [params.hostPath] : []
|
|
22273
|
+
}
|
|
22274
|
+
});
|
|
22275
|
+
if (verdict.answer !== "y") {
|
|
22276
|
+
send(res, 500, { exitCode: 10, stdout: "", stderr: "denied by user\n" });
|
|
22277
|
+
return;
|
|
22278
|
+
}
|
|
21247
22279
|
}
|
|
21248
22280
|
const result = await handleDownloadRpc(reg, kind);
|
|
21249
22281
|
const status = result.exitCode === 0 ? 200 : 500;
|
|
@@ -21270,7 +22302,7 @@ function createRelayServer(opts) {
|
|
|
21270
22302
|
});
|
|
21271
22303
|
return;
|
|
21272
22304
|
}
|
|
21273
|
-
|
|
22305
|
+
await store.appendEvent({ boxId: reg.boxId, type: "browser-open", payload: { url: url2 } });
|
|
21274
22306
|
send(res, 200, { exitCode: 0, stdout: "", stderr: "" });
|
|
21275
22307
|
if (process.env.AGENTBOX_PROMPT !== "off") {
|
|
21276
22308
|
if (mode === "box" && hostActions) {
|
|
@@ -21298,7 +22330,7 @@ function createRelayServer(opts) {
|
|
|
21298
22330
|
}
|
|
21299
22331
|
return;
|
|
21300
22332
|
}
|
|
21301
|
-
|
|
22333
|
+
await store.appendEvent({
|
|
21302
22334
|
boxId: reg.boxId,
|
|
21303
22335
|
type: "rpc-unknown",
|
|
21304
22336
|
payload: { method: body.method }
|
|
@@ -21306,6 +22338,32 @@ function createRelayServer(opts) {
|
|
|
21306
22338
|
send(res, 501, { error: "rpc method not implemented", method: body.method });
|
|
21307
22339
|
return;
|
|
21308
22340
|
}
|
|
22341
|
+
if (req.method === "GET" && url.pathname.startsWith("/rpc/status/")) {
|
|
22342
|
+
const reg = await authBox(req, res);
|
|
22343
|
+
if (!reg) return;
|
|
22344
|
+
const promptId = decodeURIComponent(url.pathname.slice("/rpc/status/".length));
|
|
22345
|
+
const row = await store.getPrompt(promptId);
|
|
22346
|
+
if (!row || row.boxId !== reg.boxId) {
|
|
22347
|
+
send(res, 404, { error: "no such prompt", promptId });
|
|
22348
|
+
return;
|
|
22349
|
+
}
|
|
22350
|
+
if (row.status === "pending") {
|
|
22351
|
+
send(res, 200, { status: "pending" });
|
|
22352
|
+
return;
|
|
22353
|
+
}
|
|
22354
|
+
if (row.answer !== "y" || row.cancelled) {
|
|
22355
|
+
send(res, 200, {
|
|
22356
|
+
status: "done",
|
|
22357
|
+
result: { exitCode: 10, stdout: "", stderr: "denied by user\n" }
|
|
22358
|
+
});
|
|
22359
|
+
return;
|
|
22360
|
+
}
|
|
22361
|
+
const cached = row.result;
|
|
22362
|
+
const result = cached ?? await dispatchApprovedAction(reg, row.method, row.params);
|
|
22363
|
+
if (!cached) await store.setPromptResult(promptId, result);
|
|
22364
|
+
send(res, 200, { status: "done", result });
|
|
22365
|
+
return;
|
|
22366
|
+
}
|
|
21309
22367
|
if (route === "POST /admin/register-box") {
|
|
21310
22368
|
const body = await readJsonBody(req);
|
|
21311
22369
|
if (!body || typeof body.boxId !== "string" || typeof body.token !== "string" || typeof body.name !== "string" || body.boxId.length === 0 || body.token.length === 0) {
|
|
@@ -21329,9 +22387,13 @@ function createRelayServer(opts) {
|
|
|
21329
22387
|
previewUrl: typeof body.previewUrl === "string" && body.previewUrl.length > 0 ? body.previewUrl : void 0,
|
|
21330
22388
|
previewToken: typeof body.previewToken === "string" && body.previewToken.length > 0 ? body.previewToken : void 0,
|
|
21331
22389
|
bridgeToken: typeof body.bridgeToken === "string" && body.bridgeToken.length > 0 ? body.bridgeToken : void 0,
|
|
21332
|
-
autoApproveHostActions: body.autoApproveHostActions === true
|
|
22390
|
+
autoApproveHostActions: body.autoApproveHostActions === true,
|
|
22391
|
+
// Default on: only an explicit `false` disables the safe subset, so an
|
|
22392
|
+
// older wire body without the field stays relaxed.
|
|
22393
|
+
autoApproveSafeHostActions: body.autoApproveSafeHostActions !== false,
|
|
22394
|
+
originUrl: typeof body.originUrl === "string" && body.originUrl.length > 0 ? body.originUrl : void 0
|
|
21333
22395
|
};
|
|
21334
|
-
|
|
22396
|
+
await store.registerBox(reg);
|
|
21335
22397
|
log(
|
|
21336
22398
|
`registered ${kind} box ${reg.boxId} (${reg.name})` + (worktrees && worktrees.length > 0 ? ` with ${String(worktrees.length)} worktree(s)` : "")
|
|
21337
22399
|
);
|
|
@@ -21343,14 +22405,19 @@ function createRelayServer(opts) {
|
|
|
21343
22405
|
previewUrl: reg.previewUrl,
|
|
21344
22406
|
bridgeToken: reg.bridgeToken,
|
|
21345
22407
|
previewToken: reg.previewToken,
|
|
21346
|
-
onEvents: (evs) => {
|
|
22408
|
+
onEvents: async (evs) => {
|
|
21347
22409
|
for (const ev of evs) {
|
|
21348
|
-
|
|
22410
|
+
await store.appendEvent({
|
|
22411
|
+
boxId: reg.boxId,
|
|
22412
|
+
type: ev.type,
|
|
22413
|
+
payload: ev.payload,
|
|
22414
|
+
ts: ev.ts
|
|
22415
|
+
});
|
|
21349
22416
|
}
|
|
21350
22417
|
},
|
|
21351
22418
|
onStatus: (status) => {
|
|
21352
22419
|
if (isValidBoxStatus(status)) {
|
|
21353
|
-
void
|
|
22420
|
+
void store.setStatus(reg.boxId, reg.name, reg.projectIndex, status);
|
|
21354
22421
|
}
|
|
21355
22422
|
},
|
|
21356
22423
|
// Drained host-only RPCs (git.push, …) run on the host via the
|
|
@@ -21366,6 +22433,7 @@ function createRelayServer(opts) {
|
|
|
21366
22433
|
prompts,
|
|
21367
22434
|
subscribers,
|
|
21368
22435
|
hostInitiatedTokens,
|
|
22436
|
+
autoApproveSafeHostActions: reg.autoApproveSafeHostActions,
|
|
21369
22437
|
log
|
|
21370
22438
|
});
|
|
21371
22439
|
await respond(result);
|
|
@@ -21400,8 +22468,8 @@ function createRelayServer(opts) {
|
|
|
21400
22468
|
send(res, 400, { error: "expected {boxId}" });
|
|
21401
22469
|
return;
|
|
21402
22470
|
}
|
|
21403
|
-
const existed =
|
|
21404
|
-
|
|
22471
|
+
const existed = await store.forgetBox(body.boxId);
|
|
22472
|
+
await store.deleteStatus(body.boxId);
|
|
21405
22473
|
if (pollers) await pollers.stop(body.boxId);
|
|
21406
22474
|
log(`forgot box ${body.boxId} (existed=${String(existed)})`);
|
|
21407
22475
|
send(res, 204, null);
|
|
@@ -21409,7 +22477,7 @@ function createRelayServer(opts) {
|
|
|
21409
22477
|
}
|
|
21410
22478
|
if (route === "GET /admin/box-status") {
|
|
21411
22479
|
const box = url.searchParams.get("box") ?? "";
|
|
21412
|
-
const status = box ?
|
|
22480
|
+
const status = box ? await store.getStatus(box) : void 0;
|
|
21413
22481
|
if (!status) {
|
|
21414
22482
|
send(res, 404, { error: "no status for box", box });
|
|
21415
22483
|
return;
|
|
@@ -21420,12 +22488,12 @@ function createRelayServer(opts) {
|
|
|
21420
22488
|
if (route === "GET /admin/events") {
|
|
21421
22489
|
const since = Number.parseInt(url.searchParams.get("since") ?? "0", 10) || 0;
|
|
21422
22490
|
const box = url.searchParams.get("box") ?? void 0;
|
|
21423
|
-
const list =
|
|
22491
|
+
const list = await store.listEvents(since, box ?? void 0);
|
|
21424
22492
|
send(res, 200, { events: list });
|
|
21425
22493
|
return;
|
|
21426
22494
|
}
|
|
21427
22495
|
if (route === "GET /admin/registry") {
|
|
21428
|
-
const redacted =
|
|
22496
|
+
const redacted = (await store.listBoxes()).map((r) => ({
|
|
21429
22497
|
boxId: r.boxId,
|
|
21430
22498
|
name: r.name,
|
|
21431
22499
|
registeredAt: r.registeredAt,
|
|
@@ -21443,7 +22511,8 @@ function createRelayServer(opts) {
|
|
|
21443
22511
|
send(res, 400, { error: "missing boxId query param" });
|
|
21444
22512
|
return;
|
|
21445
22513
|
}
|
|
21446
|
-
|
|
22514
|
+
const pending = promptMode === "poll" ? (await store.listPendingPrompts(boxId)).map((r) => r.ev) : prompts.forBox(boxId);
|
|
22515
|
+
send(res, 200, { prompts: pending });
|
|
21447
22516
|
return;
|
|
21448
22517
|
}
|
|
21449
22518
|
if (route === "GET /admin/prompts/stream") {
|
|
@@ -21494,6 +22563,17 @@ data: {"ts":"${(/* @__PURE__ */ new Date()).toISOString()}"}
|
|
|
21494
22563
|
send(res, 400, { error: 'expected {id, answer:"y"|"n", cancelled?}' });
|
|
21495
22564
|
return;
|
|
21496
22565
|
}
|
|
22566
|
+
if (promptMode === "poll") {
|
|
22567
|
+
const row = await store.getPrompt(body.id);
|
|
22568
|
+
const hit2 = await store.answerPrompt(body.id, body.answer, body.cancelled);
|
|
22569
|
+
if (!hit2) {
|
|
22570
|
+
send(res, 404, { error: "no pending prompt with that id" });
|
|
22571
|
+
return;
|
|
22572
|
+
}
|
|
22573
|
+
if (row) subscribers.broadcast(row.boxId, "prompt-resolved", { id: body.id });
|
|
22574
|
+
send(res, 204, null);
|
|
22575
|
+
return;
|
|
22576
|
+
}
|
|
21497
22577
|
const targetBox = prompts.boxFor(body.id);
|
|
21498
22578
|
const hit = prompts.resolve(body.id, body.answer, body.cancelled);
|
|
21499
22579
|
if (!hit) {
|
|
@@ -21561,15 +22641,33 @@ data: {"ts":"${(/* @__PURE__ */ new Date()).toISOString()}"}
|
|
|
21561
22641
|
send(res, 204, null);
|
|
21562
22642
|
return;
|
|
21563
22643
|
}
|
|
22644
|
+
if (uiHandler) {
|
|
22645
|
+
uiHandler(req, res);
|
|
22646
|
+
return;
|
|
22647
|
+
}
|
|
21564
22648
|
send(res, 404, { error: "not found", route });
|
|
21565
22649
|
}
|
|
21566
|
-
function
|
|
22650
|
+
async function dispatchApprovedAction(reg, method, params) {
|
|
22651
|
+
if (method === "git.push" || method === "git.fetch") {
|
|
22652
|
+
return handleGitRpc(reg, method, params);
|
|
22653
|
+
}
|
|
22654
|
+
if (method === "git.lease-token") {
|
|
22655
|
+
return leaseTokenResult(leaser, reg);
|
|
22656
|
+
}
|
|
22657
|
+
return {
|
|
22658
|
+
exitCode: 64,
|
|
22659
|
+
stdout: "",
|
|
22660
|
+
stderr: `relay: no approved-action executor for ${method}
|
|
22661
|
+
`
|
|
22662
|
+
};
|
|
22663
|
+
}
|
|
22664
|
+
async function authBox(req, res) {
|
|
21567
22665
|
const token = bearerToken(req);
|
|
21568
22666
|
if (token.length === 0) {
|
|
21569
22667
|
send(res, 401, { error: "missing bearer token" });
|
|
21570
22668
|
return null;
|
|
21571
22669
|
}
|
|
21572
|
-
const match =
|
|
22670
|
+
const match = await store.authenticateBox(token);
|
|
21573
22671
|
if (!match) {
|
|
21574
22672
|
send(res, 401, { error: "unknown box token" });
|
|
21575
22673
|
return null;
|
|
@@ -21578,23 +22676,28 @@ data: {"ts":"${(/* @__PURE__ */ new Date()).toISOString()}"}
|
|
|
21578
22676
|
}
|
|
21579
22677
|
return {
|
|
21580
22678
|
server,
|
|
22679
|
+
store,
|
|
21581
22680
|
registry,
|
|
21582
22681
|
events,
|
|
21583
22682
|
statusStore,
|
|
21584
22683
|
prompts,
|
|
21585
22684
|
subscribers,
|
|
21586
22685
|
notices,
|
|
22686
|
+
hubNotifier,
|
|
21587
22687
|
hostActions: hostActions ?? void 0,
|
|
21588
22688
|
url: `http://${host}:${String(opts.port)}`,
|
|
21589
22689
|
setQueuePoke: (fn) => {
|
|
21590
22690
|
queuePoke = fn;
|
|
21591
22691
|
},
|
|
22692
|
+
pokeQueue: () => {
|
|
22693
|
+
queuePoke?.();
|
|
22694
|
+
},
|
|
21592
22695
|
close: async () => {
|
|
21593
22696
|
if (pollers) await pollers.stopAll();
|
|
21594
|
-
await new Promise((
|
|
22697
|
+
await new Promise((resolve4, reject) => {
|
|
21595
22698
|
server.close((err) => {
|
|
21596
22699
|
if (err) reject(err);
|
|
21597
|
-
else
|
|
22700
|
+
else resolve4();
|
|
21598
22701
|
});
|
|
21599
22702
|
});
|
|
21600
22703
|
}
|
|
@@ -21608,20 +22711,13 @@ function sanitizeWorktrees(input) {
|
|
|
21608
22711
|
out.push({
|
|
21609
22712
|
containerPath: w.containerPath,
|
|
21610
22713
|
hostMainRepo: w.hostMainRepo,
|
|
21611
|
-
branch: w.branch
|
|
22714
|
+
branch: w.branch,
|
|
22715
|
+
...typeof w.sanctionedBranch === "string" && w.sanctionedBranch.length > 0 ? { sanctionedBranch: w.sanctionedBranch } : {}
|
|
21612
22716
|
});
|
|
21613
22717
|
}
|
|
21614
22718
|
}
|
|
21615
22719
|
return out;
|
|
21616
22720
|
}
|
|
21617
|
-
function resolveWorktree(reg, containerPath) {
|
|
21618
|
-
const trees = reg.worktrees ?? [];
|
|
21619
|
-
if (trees.length === 0) return null;
|
|
21620
|
-
const exact = trees.find((w) => w.containerPath === containerPath);
|
|
21621
|
-
if (exact) return exact;
|
|
21622
|
-
const prefixMatches = trees.filter((w) => containerPath === w.containerPath || containerPath.startsWith(w.containerPath + "/")).sort((a2, b) => b.containerPath.length - a2.containerPath.length);
|
|
21623
|
-
return prefixMatches[0] ?? trees.find((w) => w.containerPath === "/workspace") ?? null;
|
|
21624
|
-
}
|
|
21625
22721
|
async function handleGitSaveToHost(reg, params) {
|
|
21626
22722
|
const containerPath = params?.path ?? "/workspace";
|
|
21627
22723
|
const worktree = resolveWorktree(reg, containerPath);
|
|
@@ -21632,8 +22728,8 @@ async function handleGitSaveToHost(reg, params) {
|
|
|
21632
22728
|
stderr: `no worktree registered for box ${reg.boxId} matching ${containerPath}`
|
|
21633
22729
|
};
|
|
21634
22730
|
}
|
|
21635
|
-
const src = worktree.branch;
|
|
21636
|
-
const dest = params?.as
|
|
22731
|
+
const src = worktree.sanctionedBranch ?? worktree.branch;
|
|
22732
|
+
const dest = resolveLandDest(src, params?.as);
|
|
21637
22733
|
if (dest === src) {
|
|
21638
22734
|
return {
|
|
21639
22735
|
exitCode: 0,
|
|
@@ -21642,7 +22738,7 @@ async function handleGitSaveToHost(reg, params) {
|
|
|
21642
22738
|
stderr: ""
|
|
21643
22739
|
};
|
|
21644
22740
|
}
|
|
21645
|
-
const refspec =
|
|
22741
|
+
const refspec = landRefspec(src, dest, params?.force);
|
|
21646
22742
|
const result = await runHostCommand([
|
|
21647
22743
|
"git",
|
|
21648
22744
|
"-C",
|
|
@@ -21672,22 +22768,19 @@ async function handleGitRpc(reg, method, params) {
|
|
|
21672
22768
|
};
|
|
21673
22769
|
}
|
|
21674
22770
|
const op = method === "git.push" ? "push" : "fetch";
|
|
21675
|
-
const remote = params?.remote
|
|
21676
|
-
const
|
|
21677
|
-
|
|
21678
|
-
|
|
21679
|
-
if (typeof a2 === "string") argv.push(a2);
|
|
21680
|
-
}
|
|
21681
|
-
}
|
|
22771
|
+
const remote = resolveRemote(params?.remote);
|
|
22772
|
+
const pushBranch = worktree.sanctionedBranch ?? worktree.branch;
|
|
22773
|
+
const argv = ["git", "-C", worktree.hostMainRepo, op, remote, pushBranch];
|
|
22774
|
+
argv.push(...sanitizeGitArgs(params?.args));
|
|
21682
22775
|
const result = await runHostCommand(argv);
|
|
21683
|
-
if (method === "git.push" && result.exitCode === 0 && !
|
|
22776
|
+
if (method === "git.push" && result.exitCode === 0 && !isScratchBranch(pushBranch)) {
|
|
21684
22777
|
await runHostCommand([
|
|
21685
22778
|
"git",
|
|
21686
22779
|
"-C",
|
|
21687
22780
|
worktree.hostMainRepo,
|
|
21688
22781
|
"branch",
|
|
21689
|
-
`--set-upstream-to=${remote}
|
|
21690
|
-
|
|
22782
|
+
`--set-upstream-to=${upstreamRef(remote, pushBranch)}`,
|
|
22783
|
+
pushBranch
|
|
21691
22784
|
]);
|
|
21692
22785
|
}
|
|
21693
22786
|
return result;
|
|
@@ -21710,7 +22803,9 @@ async function handleGhPrRpc(op, reg, params, prompts, subscribers, hostInitiate
|
|
|
21710
22803
|
if (ghReady) return ghReady;
|
|
21711
22804
|
const args = Array.isArray(params?.args) ? params.args.filter((a2) => typeof a2 === "string") : [];
|
|
21712
22805
|
if (op === "checkout") {
|
|
21713
|
-
const branches = (reg.worktrees ?? []).
|
|
22806
|
+
const branches = (reg.worktrees ?? []).flatMap(
|
|
22807
|
+
(w) => w.sanctionedBranch && w.sanctionedBranch !== w.branch ? [w.branch, w.sanctionedBranch] : [w.branch]
|
|
22808
|
+
);
|
|
21714
22809
|
const guard = await checkoutGuards(worktree.hostMainRepo, branches);
|
|
21715
22810
|
if (guard) return guard;
|
|
21716
22811
|
}
|
|
@@ -21724,7 +22819,20 @@ async function handleGhPrRpc(op, reg, params, prompts, subscribers, hostInitiate
|
|
|
21724
22819
|
stderr: "host-initiated token rejected: invalid, expired, or bound to different params\n"
|
|
21725
22820
|
};
|
|
21726
22821
|
}
|
|
21727
|
-
|
|
22822
|
+
const ghSafeAuto = GH_PR_SAFE_AUTO_APPROVE_OPS.has(op) && reg.autoApproveSafeHostActions !== false && !prCreateHasExplicitHead(op, args);
|
|
22823
|
+
if (ghSafeAuto && !hostInitiatedOk) {
|
|
22824
|
+
prompts.noteAutoApprove(
|
|
22825
|
+
reg.boxId,
|
|
22826
|
+
{
|
|
22827
|
+
kind: "confirm",
|
|
22828
|
+
message: `gh pr ${op} from box ${reg.name}`,
|
|
22829
|
+
detail: args.join(" ").slice(0, 200),
|
|
22830
|
+
context: { command: `gh pr ${op}`, cwd: containerPath, argv: args }
|
|
22831
|
+
},
|
|
22832
|
+
`safe: gh pr ${op}`
|
|
22833
|
+
);
|
|
22834
|
+
}
|
|
22835
|
+
if (!GH_PR_READ_ONLY_OPS.has(op) && !ghSafeAuto && !hostInitiatedOk) {
|
|
21728
22836
|
const detail = args.join(" ").slice(0, 200);
|
|
21729
22837
|
const verdict = await askPrompt(prompts, subscribers, reg.boxId, {
|
|
21730
22838
|
kind: "confirm",
|
|
@@ -21741,7 +22849,7 @@ async function handleGhPrRpc(op, reg, params, prompts, subscribers, hostInitiate
|
|
|
21741
22849
|
return { exitCode: 10, stdout: "", stderr: "denied by user\n" };
|
|
21742
22850
|
}
|
|
21743
22851
|
}
|
|
21744
|
-
const finalArgs = injectPrCreateHead(op, worktree.branch, args);
|
|
22852
|
+
const finalArgs = injectPrCreateHead(op, worktree.sanctionedBranch ?? worktree.branch, args);
|
|
21745
22853
|
if (prCreateNeedsHead(op, finalArgs)) return PR_CREATE_NO_HEAD_REFUSAL;
|
|
21746
22854
|
return runHostGh(["pr", op, ...finalArgs], worktree.hostMainRepo);
|
|
21747
22855
|
}
|
|
@@ -21760,15 +22868,28 @@ async function handleGhRunRpc(op, reg, params, prompts, subscribers) {
|
|
|
21760
22868
|
const args = Array.isArray(params?.args) ? params.args.filter((a2) => typeof a2 === "string") : [];
|
|
21761
22869
|
if (!GH_RUN_READ_ONLY_OPS.has(op)) {
|
|
21762
22870
|
const detail = args.join(" ").slice(0, 200);
|
|
21763
|
-
|
|
21764
|
-
|
|
21765
|
-
|
|
21766
|
-
|
|
21767
|
-
|
|
21768
|
-
|
|
21769
|
-
|
|
21770
|
-
|
|
21771
|
-
|
|
22871
|
+
if (reg.autoApproveSafeHostActions !== false) {
|
|
22872
|
+
prompts.noteAutoApprove(
|
|
22873
|
+
reg.boxId,
|
|
22874
|
+
{
|
|
22875
|
+
kind: "confirm",
|
|
22876
|
+
message: `gh run ${op} from box ${reg.name}`,
|
|
22877
|
+
detail,
|
|
22878
|
+
context: { command: `gh run ${op}`, cwd: containerPath, argv: args }
|
|
22879
|
+
},
|
|
22880
|
+
`safe: gh run ${op}`
|
|
22881
|
+
);
|
|
22882
|
+
} else {
|
|
22883
|
+
const verdict = await askPrompt(prompts, subscribers, reg.boxId, {
|
|
22884
|
+
kind: "confirm",
|
|
22885
|
+
message: `Allow gh run ${op} from box ${reg.name}?`,
|
|
22886
|
+
detail,
|
|
22887
|
+
defaultAnswer: "n",
|
|
22888
|
+
context: { command: `gh run ${op}`, cwd: containerPath, argv: args }
|
|
22889
|
+
});
|
|
22890
|
+
if (verdict.answer !== "y") {
|
|
22891
|
+
return { exitCode: 10, stdout: "", stderr: "denied by user\n" };
|
|
22892
|
+
}
|
|
21772
22893
|
}
|
|
21773
22894
|
}
|
|
21774
22895
|
return runHostGh(["run", op, ...args], worktree.hostMainRepo);
|
|
@@ -21840,31 +22961,48 @@ async function handleIntegrationRpc(method, reg, params, prompts, subscribers, h
|
|
|
21840
22961
|
const ready = await assertIntegrationReady(connector);
|
|
21841
22962
|
if (ready) return ready;
|
|
21842
22963
|
if (opDesc.write) {
|
|
21843
|
-
|
|
21844
|
-
|
|
21845
|
-
|
|
21846
|
-
|
|
21847
|
-
|
|
21848
|
-
|
|
21849
|
-
|
|
21850
|
-
|
|
21851
|
-
|
|
21852
|
-
|
|
21853
|
-
|
|
21854
|
-
|
|
21855
|
-
|
|
21856
|
-
|
|
21857
|
-
|
|
21858
|
-
|
|
21859
|
-
|
|
21860
|
-
|
|
21861
|
-
|
|
21862
|
-
|
|
21863
|
-
|
|
22964
|
+
if (reg.autoApproveSafeHostActions !== false) {
|
|
22965
|
+
prompts.noteAutoApprove(
|
|
22966
|
+
reg.boxId,
|
|
22967
|
+
{
|
|
22968
|
+
kind: "confirm",
|
|
22969
|
+
message: `${parsed.service} ${parsed.op} from box ${reg.name}`,
|
|
22970
|
+
detail: args.join(" ").slice(0, 200),
|
|
22971
|
+
context: {
|
|
22972
|
+
command: `integration ${parsed.service} ${parsed.op}`,
|
|
22973
|
+
cwd: containerPath,
|
|
22974
|
+
argv: args
|
|
22975
|
+
}
|
|
22976
|
+
},
|
|
22977
|
+
`safe: integration ${parsed.service} ${parsed.op}`
|
|
22978
|
+
);
|
|
22979
|
+
} else {
|
|
22980
|
+
const tokenClaimed = typeof params?.hostInitiated === "string";
|
|
22981
|
+
const incomingHash = hashRpcParams(params);
|
|
22982
|
+
const tokenOk = tokenClaimed && hostInitiatedTokens.consume(params?.hostInitiated, reg.boxId, method, incomingHash);
|
|
22983
|
+
if (tokenClaimed && !tokenOk) {
|
|
22984
|
+
return {
|
|
22985
|
+
exitCode: 10,
|
|
22986
|
+
stdout: "",
|
|
22987
|
+
stderr: "host-initiated token rejected: invalid, expired, or bound to different params\n"
|
|
22988
|
+
};
|
|
22989
|
+
}
|
|
22990
|
+
if (!tokenOk) {
|
|
22991
|
+
const detail = args.join(" ").slice(0, 200);
|
|
22992
|
+
const verdict = await askPrompt(prompts, subscribers, reg.boxId, {
|
|
22993
|
+
kind: "confirm",
|
|
22994
|
+
message: `Allow ${parsed.service} ${parsed.op} from box ${reg.name}?`,
|
|
22995
|
+
detail,
|
|
22996
|
+
defaultAnswer: "n",
|
|
22997
|
+
context: {
|
|
22998
|
+
command: `integration ${parsed.service} ${parsed.op}`,
|
|
22999
|
+
cwd: containerPath,
|
|
23000
|
+
argv: args
|
|
23001
|
+
}
|
|
23002
|
+
});
|
|
23003
|
+
if (verdict.answer !== "y") {
|
|
23004
|
+
return { exitCode: 10, stdout: "", stderr: "denied by user\n" };
|
|
21864
23005
|
}
|
|
21865
|
-
});
|
|
21866
|
-
if (verdict.answer !== "y") {
|
|
21867
|
-
return { exitCode: 10, stdout: "", stderr: "denied by user\n" };
|
|
21868
23006
|
}
|
|
21869
23007
|
}
|
|
21870
23008
|
}
|
|
@@ -21923,10 +23061,10 @@ function isOpenableUrl(value) {
|
|
|
21923
23061
|
return url.protocol === "http:" || url.protocol === "https:";
|
|
21924
23062
|
}
|
|
21925
23063
|
function runHostCommand(argv, timeoutMs = GIT_RPC_TIMEOUT_MS, cwd) {
|
|
21926
|
-
return new Promise((
|
|
23064
|
+
return new Promise((resolve4) => {
|
|
21927
23065
|
const [cmd, ...rest] = argv;
|
|
21928
23066
|
if (!cmd) {
|
|
21929
|
-
|
|
23067
|
+
resolve4({ exitCode: 64, stdout: "", stderr: "empty command" });
|
|
21930
23068
|
return;
|
|
21931
23069
|
}
|
|
21932
23070
|
const child = (0, import_node_child_process8.spawn)(cmd, rest, {
|
|
@@ -21943,7 +23081,7 @@ function runHostCommand(argv, timeoutMs = GIT_RPC_TIMEOUT_MS, cwd) {
|
|
|
21943
23081
|
const finish = (exitCode) => {
|
|
21944
23082
|
if (settled) return;
|
|
21945
23083
|
settled = true;
|
|
21946
|
-
|
|
23084
|
+
resolve4({ exitCode, stdout, stderr });
|
|
21947
23085
|
};
|
|
21948
23086
|
const timer = setTimeout(() => {
|
|
21949
23087
|
child.kill("SIGTERM");
|
|
@@ -21971,11 +23109,11 @@ relay: command timed out after ${String(timeoutMs)}ms
|
|
|
21971
23109
|
}
|
|
21972
23110
|
async function startRelayServer(opts) {
|
|
21973
23111
|
const handle = createRelayServer(opts);
|
|
21974
|
-
await new Promise((
|
|
23112
|
+
await new Promise((resolve4, reject) => {
|
|
21975
23113
|
handle.server.once("error", reject);
|
|
21976
23114
|
handle.server.listen(opts.port, opts.host ?? "0.0.0.0", () => {
|
|
21977
23115
|
handle.server.removeListener("error", reject);
|
|
21978
|
-
|
|
23116
|
+
resolve4();
|
|
21979
23117
|
});
|
|
21980
23118
|
});
|
|
21981
23119
|
return handle;
|
|
@@ -21983,20 +23121,22 @@ async function startRelayServer(opts) {
|
|
|
21983
23121
|
|
|
21984
23122
|
// src/autopause.ts
|
|
21985
23123
|
var import_node_child_process10 = require("child_process");
|
|
21986
|
-
var
|
|
23124
|
+
var import_promises21 = require("fs/promises");
|
|
21987
23125
|
|
|
21988
23126
|
// src/queue.ts
|
|
21989
23127
|
var import_node_child_process9 = require("child_process");
|
|
21990
|
-
var
|
|
23128
|
+
var import_node_crypto7 = require("crypto");
|
|
23129
|
+
var import_promises19 = require("fs/promises");
|
|
21991
23130
|
var import_node_fs6 = require("fs");
|
|
21992
23131
|
var import_node_path8 = require("path");
|
|
21993
|
-
var
|
|
23132
|
+
var import_promises20 = require("timers/promises");
|
|
21994
23133
|
var QUEUE_DIR = (0, import_node_path8.join)(STATE_DIR, "queue");
|
|
23134
|
+
var PREPARE_MAX_CONCURRENT = 1;
|
|
21995
23135
|
async function loadQueueConfig() {
|
|
21996
23136
|
const d = BUILT_IN_DEFAULTS.queue;
|
|
21997
23137
|
let global3 = {};
|
|
21998
23138
|
try {
|
|
21999
|
-
global3 = parseUserConfig(await (0,
|
|
23139
|
+
global3 = parseUserConfig(await (0, import_promises19.readFile)(GLOBAL_CONFIG_FILE, "utf8"), GLOBAL_CONFIG_FILE);
|
|
22000
23140
|
} catch {
|
|
22001
23141
|
}
|
|
22002
23142
|
const q = global3.queue ?? {};
|
|
@@ -22008,15 +23148,15 @@ async function loadQueueConfig() {
|
|
|
22008
23148
|
};
|
|
22009
23149
|
}
|
|
22010
23150
|
async function writeJob(job) {
|
|
22011
|
-
await (0,
|
|
23151
|
+
await (0, import_promises19.mkdir)(QUEUE_DIR, { recursive: true });
|
|
22012
23152
|
const final = (0, import_node_path8.join)(QUEUE_DIR, `${job.id}.json`);
|
|
22013
23153
|
const tmp = `${final}.tmp.${String(process.pid)}.${String(Date.now())}`;
|
|
22014
|
-
await (0,
|
|
22015
|
-
await (0,
|
|
23154
|
+
await (0, import_promises19.writeFile)(tmp, JSON.stringify(job, null, 2) + "\n", "utf8");
|
|
23155
|
+
await (0, import_promises19.rename)(tmp, final);
|
|
22016
23156
|
}
|
|
22017
23157
|
async function readJob(id) {
|
|
22018
23158
|
try {
|
|
22019
|
-
const raw = await (0,
|
|
23159
|
+
const raw = await (0, import_promises19.readFile)((0, import_node_path8.join)(QUEUE_DIR, `${id}.json`), "utf8");
|
|
22020
23160
|
return JSON.parse(raw);
|
|
22021
23161
|
} catch (err) {
|
|
22022
23162
|
if (err.code === "ENOENT") return null;
|
|
@@ -22025,7 +23165,7 @@ async function readJob(id) {
|
|
|
22025
23165
|
}
|
|
22026
23166
|
async function deleteJob(id) {
|
|
22027
23167
|
try {
|
|
22028
|
-
await (0,
|
|
23168
|
+
await (0, import_promises19.unlink)((0, import_node_path8.join)(QUEUE_DIR, `${id}.json`));
|
|
22029
23169
|
} catch (err) {
|
|
22030
23170
|
if (err.code !== "ENOENT") throw err;
|
|
22031
23171
|
}
|
|
@@ -22033,7 +23173,7 @@ async function deleteJob(id) {
|
|
|
22033
23173
|
async function loadQueue() {
|
|
22034
23174
|
let entries;
|
|
22035
23175
|
try {
|
|
22036
|
-
entries = await (0,
|
|
23176
|
+
entries = await (0, import_promises19.readdir)(QUEUE_DIR);
|
|
22037
23177
|
} catch (err) {
|
|
22038
23178
|
if (err.code === "ENOENT") return [];
|
|
22039
23179
|
throw err;
|
|
@@ -22042,7 +23182,7 @@ async function loadQueue() {
|
|
|
22042
23182
|
for (const name of entries) {
|
|
22043
23183
|
if (!name.endsWith(".json")) continue;
|
|
22044
23184
|
try {
|
|
22045
|
-
const raw = await (0,
|
|
23185
|
+
const raw = await (0, import_promises19.readFile)((0, import_node_path8.join)(QUEUE_DIR, name), "utf8");
|
|
22046
23186
|
out.push(JSON.parse(raw));
|
|
22047
23187
|
} catch {
|
|
22048
23188
|
}
|
|
@@ -22053,10 +23193,30 @@ async function loadQueue() {
|
|
|
22053
23193
|
function selectNextRunnable(jobs, runningCount) {
|
|
22054
23194
|
for (const j of jobs) {
|
|
22055
23195
|
if (j.status !== "queued") continue;
|
|
23196
|
+
if (j.kind === "prepare") continue;
|
|
22056
23197
|
if (runningCount < j.maxConcurrent) return j;
|
|
22057
23198
|
}
|
|
22058
23199
|
return null;
|
|
22059
23200
|
}
|
|
23201
|
+
function countRunningPrepareJobs(jobs) {
|
|
23202
|
+
let n2 = 0;
|
|
23203
|
+
for (const j of jobs) {
|
|
23204
|
+
if (j.kind !== "prepare") continue;
|
|
23205
|
+
if (j.status !== "running") continue;
|
|
23206
|
+
if (typeof j.pid === "number" && !processAlive(j.pid)) continue;
|
|
23207
|
+
n2 += 1;
|
|
23208
|
+
}
|
|
23209
|
+
return n2;
|
|
23210
|
+
}
|
|
23211
|
+
function selectNextRunnablePrepare(jobs, runningPrepare) {
|
|
23212
|
+
if (runningPrepare >= PREPARE_MAX_CONCURRENT) return null;
|
|
23213
|
+
for (const j of jobs) {
|
|
23214
|
+
if (j.kind !== "prepare") continue;
|
|
23215
|
+
if (j.status !== "queued") continue;
|
|
23216
|
+
return j;
|
|
23217
|
+
}
|
|
23218
|
+
return null;
|
|
23219
|
+
}
|
|
22060
23220
|
var WORKING_AGENT_STATES = [
|
|
22061
23221
|
"working",
|
|
22062
23222
|
"idle",
|
|
@@ -22087,6 +23247,7 @@ function countWorkingSlots(entries, idleGraceMs) {
|
|
|
22087
23247
|
function selectNextRunnableByWorking(jobs, workingCount, globalMaxWorking) {
|
|
22088
23248
|
for (const j of jobs) {
|
|
22089
23249
|
if (j.status !== "queued") continue;
|
|
23250
|
+
if (j.kind === "prepare") continue;
|
|
22090
23251
|
const ceil = typeof j.maxWorking === "number" && j.maxWorking > 0 ? j.maxWorking : globalMaxWorking;
|
|
22091
23252
|
if (workingCount < ceil) return j;
|
|
22092
23253
|
}
|
|
@@ -22172,7 +23333,7 @@ function startQueueLoop(deps) {
|
|
|
22172
23333
|
const fresh = await loadQueue();
|
|
22173
23334
|
next = selectNextRunnable(fresh, occupancy);
|
|
22174
23335
|
}
|
|
22175
|
-
if (!next)
|
|
23336
|
+
if (!next) break;
|
|
22176
23337
|
const current = await readJob(next.id);
|
|
22177
23338
|
if (!current || current.status !== "queued") continue;
|
|
22178
23339
|
const updated = {
|
|
@@ -22208,6 +23369,45 @@ function startQueueLoop(deps) {
|
|
|
22208
23369
|
log(`queue: spawn for job ${updated.id} failed: ${msg}`);
|
|
22209
23370
|
}
|
|
22210
23371
|
}
|
|
23372
|
+
while (!stopped) {
|
|
23373
|
+
const fresh = await loadQueue();
|
|
23374
|
+
const runningPrepare = countRunningPrepareJobs(fresh);
|
|
23375
|
+
const next = selectNextRunnablePrepare(fresh, runningPrepare);
|
|
23376
|
+
if (!next) break;
|
|
23377
|
+
const current = await readJob(next.id);
|
|
23378
|
+
if (!current || current.status !== "queued") continue;
|
|
23379
|
+
const updated = {
|
|
23380
|
+
...current,
|
|
23381
|
+
status: "running",
|
|
23382
|
+
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
23383
|
+
};
|
|
23384
|
+
await writeJob(updated);
|
|
23385
|
+
onStatusChange?.(updated);
|
|
23386
|
+
try {
|
|
23387
|
+
const pid = await spawnWorker(updated);
|
|
23388
|
+
if (typeof pid === "number") {
|
|
23389
|
+
const withPid = { ...updated, pid };
|
|
23390
|
+
await writeJob(withPid);
|
|
23391
|
+
onStatusChange?.(withPid);
|
|
23392
|
+
log(
|
|
23393
|
+
`queue: started prepare job ${updated.id} (${updated.providerName}) as pid ${String(pid)}; prepare ${String(runningPrepare + 1)}/${String(PREPARE_MAX_CONCURRENT)}`
|
|
23394
|
+
);
|
|
23395
|
+
} else {
|
|
23396
|
+
log(`queue: started prepare job ${updated.id} (${updated.providerName}); pid unknown`);
|
|
23397
|
+
}
|
|
23398
|
+
} catch (err) {
|
|
23399
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
23400
|
+
const failed = {
|
|
23401
|
+
...updated,
|
|
23402
|
+
status: "failed",
|
|
23403
|
+
finishedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
23404
|
+
reason: `worker-spawn-failed: ${msg}`
|
|
23405
|
+
};
|
|
23406
|
+
await writeJob(failed);
|
|
23407
|
+
onStatusChange?.(failed);
|
|
23408
|
+
log(`queue: spawn for prepare job ${updated.id} failed: ${msg}`);
|
|
23409
|
+
}
|
|
23410
|
+
}
|
|
22211
23411
|
} catch (err) {
|
|
22212
23412
|
const msg = err instanceof Error ? err.message : String(err);
|
|
22213
23413
|
log(`queue: tick error: ${msg}`);
|
|
@@ -22298,6 +23498,7 @@ async function defaultCountWorkingBoxes(registry, statusStore, idleGraceMs) {
|
|
|
22298
23498
|
function countInFlightCreateJobs(jobs, accountedBoxIds) {
|
|
22299
23499
|
let n2 = 0;
|
|
22300
23500
|
for (const j of jobs) {
|
|
23501
|
+
if (j.kind === "prepare") continue;
|
|
22301
23502
|
if (j.status !== "running") continue;
|
|
22302
23503
|
if (j.boxId && accountedBoxIds.has(j.boxId)) continue;
|
|
22303
23504
|
if (typeof j.pid === "number" && !processAlive(j.pid)) continue;
|
|
@@ -22389,9 +23590,10 @@ async function defaultSpawnWorker(job) {
|
|
|
22389
23590
|
`AGENTBOX_CLI_ENTRY not set or missing (${String(entry)}); cannot spawn queue worker`
|
|
22390
23591
|
);
|
|
22391
23592
|
}
|
|
22392
|
-
await (0,
|
|
23593
|
+
await (0, import_promises19.mkdir)((0, import_node_path8.join)(STATE_DIR, "logs"), { recursive: true });
|
|
22393
23594
|
const fd = (0, import_node_fs6.openSync)(job.logPath, "a");
|
|
22394
|
-
const
|
|
23595
|
+
const command = job.kind === "prepare" ? "_run-queued-prepare" : "_run-queued-job";
|
|
23596
|
+
const child = (0, import_node_child_process9.spawn)(process.execPath, [entry, command, job.id], {
|
|
22395
23597
|
detached: true,
|
|
22396
23598
|
stdio: ["ignore", fd, fd],
|
|
22397
23599
|
env: process.env
|
|
@@ -22424,7 +23626,7 @@ async function loadAutopauseConfig() {
|
|
|
22424
23626
|
const d = BUILT_IN_DEFAULTS.autopause;
|
|
22425
23627
|
let global3 = {};
|
|
22426
23628
|
try {
|
|
22427
|
-
global3 = parseUserConfig(await (0,
|
|
23629
|
+
global3 = parseUserConfig(await (0, import_promises21.readFile)(GLOBAL_CONFIG_FILE, "utf8"), GLOBAL_CONFIG_FILE);
|
|
22428
23630
|
} catch {
|
|
22429
23631
|
}
|
|
22430
23632
|
const a2 = global3.autopause ?? {};
|
|
@@ -22552,7 +23754,7 @@ function toEpoch(iso) {
|
|
|
22552
23754
|
var INSPECT_TIMEOUT_MS = 15e3;
|
|
22553
23755
|
var PAUSE_TIMEOUT_MS = 3e4;
|
|
22554
23756
|
function runDocker(args, timeoutMs) {
|
|
22555
|
-
return new Promise((
|
|
23757
|
+
return new Promise((resolve4) => {
|
|
22556
23758
|
const child = (0, import_node_child_process10.spawn)("docker", args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
22557
23759
|
let stdout = "";
|
|
22558
23760
|
let stderr = "";
|
|
@@ -22560,7 +23762,7 @@ function runDocker(args, timeoutMs) {
|
|
|
22560
23762
|
const finish = (exitCode) => {
|
|
22561
23763
|
if (settled) return;
|
|
22562
23764
|
settled = true;
|
|
22563
|
-
|
|
23765
|
+
resolve4({ exitCode, stdout, stderr });
|
|
22564
23766
|
};
|
|
22565
23767
|
const timer = setTimeout(() => {
|
|
22566
23768
|
child.kill("SIGTERM");
|
|
@@ -22612,7 +23814,7 @@ async function pauseContainer(name) {
|
|
|
22612
23814
|
}
|
|
22613
23815
|
|
|
22614
23816
|
// src/cloud-keepalive.ts
|
|
22615
|
-
var
|
|
23817
|
+
var import_promises22 = require("fs/promises");
|
|
22616
23818
|
function selectBoxesToRenew(entries, windowMs, now) {
|
|
22617
23819
|
const out = [];
|
|
22618
23820
|
for (const e of entries) {
|
|
@@ -22768,7 +23970,7 @@ async function defaultFallbackCreateTimeoutMs(backend) {
|
|
|
22768
23970
|
const fallback = BUILT_IN_DEFAULTS.box.vercelTimeoutMs;
|
|
22769
23971
|
try {
|
|
22770
23972
|
const global3 = parseUserConfig(
|
|
22771
|
-
await (0,
|
|
23973
|
+
await (0, import_promises22.readFile)(GLOBAL_CONFIG_FILE, "utf8"),
|
|
22772
23974
|
GLOBAL_CONFIG_FILE
|
|
22773
23975
|
);
|
|
22774
23976
|
const v = global3.box?.vercelTimeoutMs;
|
|
@@ -22778,6 +23980,43 @@ async function defaultFallbackCreateTimeoutMs(backend) {
|
|
|
22778
23980
|
}
|
|
22779
23981
|
}
|
|
22780
23982
|
|
|
23983
|
+
// src/daemon.ts
|
|
23984
|
+
async function startRelayDaemon(opts) {
|
|
23985
|
+
const handle = await startRelayServer(opts);
|
|
23986
|
+
const log = opts.logger ?? (() => {
|
|
23987
|
+
});
|
|
23988
|
+
const autopause = startAutopauseLoop({
|
|
23989
|
+
registry: handle.registry,
|
|
23990
|
+
statusStore: handle.statusStore,
|
|
23991
|
+
events: handle.events,
|
|
23992
|
+
log
|
|
23993
|
+
});
|
|
23994
|
+
const cloudKeepalive = startCloudKeepaliveLoop({
|
|
23995
|
+
registry: handle.registry,
|
|
23996
|
+
statusStore: handle.statusStore,
|
|
23997
|
+
log
|
|
23998
|
+
});
|
|
23999
|
+
const queue = startQueueLoop({
|
|
24000
|
+
log,
|
|
24001
|
+
registry: handle.registry,
|
|
24002
|
+
statusStore: handle.statusStore,
|
|
24003
|
+
// Refresh the embedded hub UI whenever a background job flips state
|
|
24004
|
+
// (queued → running → done/failed), so a create job's box shows up and
|
|
24005
|
+
// then transitions creating → running without waiting for the 15s SSE ping.
|
|
24006
|
+
onStatusChange: () => handle.hubNotifier.notify()
|
|
24007
|
+
});
|
|
24008
|
+
handle.setQueuePoke(() => {
|
|
24009
|
+
queue.poke?.();
|
|
24010
|
+
});
|
|
24011
|
+
return {
|
|
24012
|
+
handle,
|
|
24013
|
+
stop: async () => {
|
|
24014
|
+
await Promise.allSettled([autopause.stop(), cloudKeepalive.stop(), queue.stop()]);
|
|
24015
|
+
await handle.close();
|
|
24016
|
+
}
|
|
24017
|
+
};
|
|
24018
|
+
}
|
|
24019
|
+
|
|
22781
24020
|
// src/bin.ts
|
|
22782
24021
|
var program2 = new Command();
|
|
22783
24022
|
program2.name("agentbox-relay").description("Host-side HTTP relay for box\u2192host events and RPCs").version("0.0.0");
|
|
@@ -22788,7 +24027,7 @@ program2.command("serve").description("Run the HTTP relay in the foreground").op
|
|
|
22788
24027
|
`);
|
|
22789
24028
|
process.exit(2);
|
|
22790
24029
|
}
|
|
22791
|
-
const
|
|
24030
|
+
const daemon = await startRelayDaemon({
|
|
22792
24031
|
port,
|
|
22793
24032
|
host: opts.host,
|
|
22794
24033
|
logger: (line) => process.stdout.write(`agentbox-relay: ${line}
|
|
@@ -22796,32 +24035,10 @@ program2.command("serve").description("Run the HTTP relay in the foreground").op
|
|
|
22796
24035
|
});
|
|
22797
24036
|
process.stdout.write(`agentbox-relay: listening on ${opts.host}:${String(port)}
|
|
22798
24037
|
`);
|
|
22799
|
-
const autopause = startAutopauseLoop({
|
|
22800
|
-
registry: handle.registry,
|
|
22801
|
-
statusStore: handle.statusStore,
|
|
22802
|
-
events: handle.events,
|
|
22803
|
-
log: (line) => process.stdout.write(`agentbox-relay: ${line}
|
|
22804
|
-
`)
|
|
22805
|
-
});
|
|
22806
|
-
const cloudKeepalive = startCloudKeepaliveLoop({
|
|
22807
|
-
registry: handle.registry,
|
|
22808
|
-
statusStore: handle.statusStore,
|
|
22809
|
-
log: (line) => process.stdout.write(`agentbox-relay: ${line}
|
|
22810
|
-
`)
|
|
22811
|
-
});
|
|
22812
|
-
const queue = startQueueLoop({
|
|
22813
|
-
log: (line) => process.stdout.write(`agentbox-relay: ${line}
|
|
22814
|
-
`),
|
|
22815
|
-
registry: handle.registry,
|
|
22816
|
-
statusStore: handle.statusStore
|
|
22817
|
-
});
|
|
22818
|
-
handle.setQueuePoke(() => {
|
|
22819
|
-
queue.poke?.();
|
|
22820
|
-
});
|
|
22821
24038
|
const shutdown = (signal) => {
|
|
22822
24039
|
process.stdout.write(`agentbox-relay: ${signal} \u2014 shutting down
|
|
22823
24040
|
`);
|
|
22824
|
-
|
|
24041
|
+
daemon.stop().finally(() => process.exit(0));
|
|
22825
24042
|
};
|
|
22826
24043
|
process.on("SIGTERM", () => shutdown("SIGTERM"));
|
|
22827
24044
|
process.on("SIGINT", () => shutdown("SIGINT"));
|
|
@@ -22842,7 +24059,7 @@ program2.command("tail").description("Print recent events (in-container shim; GE
|
|
|
22842
24059
|
async function adminPost(path6, body, portStr) {
|
|
22843
24060
|
const port = Number.parseInt(portStr, 10);
|
|
22844
24061
|
const json = JSON.stringify(body);
|
|
22845
|
-
await new Promise((
|
|
24062
|
+
await new Promise((resolve4, reject) => {
|
|
22846
24063
|
const req = (0, import_node_http3.request)(
|
|
22847
24064
|
{
|
|
22848
24065
|
host: "127.0.0.1",
|
|
@@ -22860,7 +24077,7 @@ async function adminPost(path6, body, portStr) {
|
|
|
22860
24077
|
res.on("end", () => {
|
|
22861
24078
|
const status = res.statusCode ?? 0;
|
|
22862
24079
|
if (status >= 200 && status < 300) {
|
|
22863
|
-
|
|
24080
|
+
resolve4();
|
|
22864
24081
|
} else {
|
|
22865
24082
|
const text = Buffer.concat(chunks).toString("utf8");
|
|
22866
24083
|
reject(new Error(`relay ${path6} \u2192 ${String(status)}: ${text}`));
|
|
@@ -22875,7 +24092,7 @@ async function adminPost(path6, body, portStr) {
|
|
|
22875
24092
|
}
|
|
22876
24093
|
async function adminGet(path6, portStr) {
|
|
22877
24094
|
const port = Number.parseInt(portStr, 10);
|
|
22878
|
-
return new Promise((
|
|
24095
|
+
return new Promise((resolve4, reject) => {
|
|
22879
24096
|
const req = (0, import_node_http3.request)(
|
|
22880
24097
|
{ host: "127.0.0.1", port, method: "GET", path: path6 },
|
|
22881
24098
|
(res) => {
|
|
@@ -22884,7 +24101,7 @@ async function adminGet(path6, portStr) {
|
|
|
22884
24101
|
res.on("end", () => {
|
|
22885
24102
|
const text = Buffer.concat(chunks).toString("utf8");
|
|
22886
24103
|
const status = res.statusCode ?? 0;
|
|
22887
|
-
if (status >= 200 && status < 300)
|
|
24104
|
+
if (status >= 200 && status < 300) resolve4(text);
|
|
22888
24105
|
else reject(new Error(`relay ${path6} \u2192 ${String(status)}: ${text}`));
|
|
22889
24106
|
});
|
|
22890
24107
|
}
|
|
@@ -22899,3 +24116,42 @@ program2.parseAsync(process.argv).catch((err) => {
|
|
|
22899
24116
|
`);
|
|
22900
24117
|
process.exit(1);
|
|
22901
24118
|
});
|
|
24119
|
+
/*! Bundled license information:
|
|
24120
|
+
|
|
24121
|
+
smol-toml/dist/date.js:
|
|
24122
|
+
smol-toml/dist/error.js:
|
|
24123
|
+
smol-toml/dist/primitive.js:
|
|
24124
|
+
smol-toml/dist/util.js:
|
|
24125
|
+
smol-toml/dist/extract.js:
|
|
24126
|
+
smol-toml/dist/struct.js:
|
|
24127
|
+
smol-toml/dist/parse.js:
|
|
24128
|
+
smol-toml/dist/stringify.js:
|
|
24129
|
+
smol-toml/dist/index.js:
|
|
24130
|
+
(*!
|
|
24131
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
24132
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
24133
|
+
*
|
|
24134
|
+
* Redistribution and use in source and binary forms, with or without
|
|
24135
|
+
* modification, are permitted provided that the following conditions are met:
|
|
24136
|
+
*
|
|
24137
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
24138
|
+
* list of conditions and the following disclaimer.
|
|
24139
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
24140
|
+
* this list of conditions and the following disclaimer in the
|
|
24141
|
+
* documentation and/or other materials provided with the distribution.
|
|
24142
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
24143
|
+
* may be used to endorse or promote products derived from this software without
|
|
24144
|
+
* specific prior written permission.
|
|
24145
|
+
*
|
|
24146
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
24147
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
24148
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
24149
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24150
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24151
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
24152
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
24153
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
24154
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
24155
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
24156
|
+
*)
|
|
24157
|
+
*/
|