@madarco/agentbox 0.31.4 → 0.32.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 +50 -0
- package/dist/_cloud-attach-UXH3VKTM.js +31 -0
- package/dist/{chunk-VQONUZE4.js → chunk-2W3W3KNR.js} +4 -4
- package/dist/{chunk-RUKTOHK7.js → chunk-3AYSA62C.js} +2 -2
- package/dist/{chunk-EXF4PLBN.js → chunk-3ISG5THX.js} +3 -3
- package/dist/{chunk-BYZPRB7U.js → chunk-5D46PE5V.js} +5 -5
- package/dist/{chunk-IF4VXKJK.js → chunk-5F5NBZG7.js} +3 -3
- package/dist/{chunk-ZUTC2JZM.js → chunk-65G5R2HW.js} +27 -5
- package/dist/chunk-65G5R2HW.js.map +1 -0
- package/dist/{chunk-KCDLAP5Q.js → chunk-66GAYIJZ.js} +3252 -936
- package/dist/chunk-66GAYIJZ.js.map +1 -0
- package/dist/{chunk-IQMDGAMB.js → chunk-6N7OSMEA.js} +4 -4
- package/dist/{chunk-CUIJ2PIN.js → chunk-7PTM6JEX.js} +26 -22
- package/dist/{chunk-CUIJ2PIN.js.map → chunk-7PTM6JEX.js.map} +1 -1
- package/dist/{chunk-EP4IFSV5.js → chunk-B3C6NQB7.js} +75 -26
- package/dist/chunk-B3C6NQB7.js.map +1 -0
- package/dist/{chunk-L567TKOK.js → chunk-BJLUG6TE.js} +5 -5
- package/dist/{chunk-AYREFYEF.js → chunk-BV2UZ4SG.js} +4 -4
- package/dist/{chunk-MBZ4UOWF.js → chunk-EAT5IEWA.js} +3 -3
- package/dist/{chunk-ENFWBFBI.js → chunk-GBEV7ETR.js} +4 -4
- package/dist/{chunk-4NO5MO2P.js → chunk-GLIWCNFE.js} +6 -6
- package/dist/chunk-GVNKIACA.js +223 -0
- package/dist/chunk-GVNKIACA.js.map +1 -0
- package/dist/{chunk-VWJBQGXD.js → chunk-HCKRUAHW.js} +6 -6
- package/dist/{chunk-IFPTD73K.js → chunk-HUVSTEJR.js} +2 -2
- package/dist/{chunk-NKHRFR5G.js → chunk-IL7R2X6B.js} +16 -16
- package/dist/{chunk-5UX2HAF4.js → chunk-IQ4WLVXE.js} +43 -43
- package/dist/{chunk-AAMPHDB2.js → chunk-JL4EJ4EH.js} +5 -5
- package/dist/{chunk-OXBWZG2N.js → chunk-KTB7JGPA.js} +4 -4
- package/dist/{chunk-YL3VEQTS.js → chunk-LFBCFWG6.js} +5 -5
- package/dist/{chunk-MJZPECVQ.js → chunk-M2DWTQRF.js} +2 -2
- package/dist/{chunk-PXH3DERD.js → chunk-MB2K74BI.js} +164 -2
- package/dist/chunk-MB2K74BI.js.map +1 -0
- package/dist/{chunk-2MBELUE6.js → chunk-NGCG3IBH.js} +9 -9
- package/dist/{chunk-QT4MOS6R.js → chunk-NX27A3F2.js} +23 -23
- package/dist/{chunk-4Y365UYP.js → chunk-OUHDSEVQ.js} +2 -2
- package/dist/{chunk-M6VAID7T.js → chunk-QBVRWGXD.js} +2 -2
- package/dist/{chunk-VOVRWIBC.js → chunk-QLZPJIWF.js} +13 -13
- package/dist/{chunk-GCS5XAPC.js → chunk-R3XDO4SN.js} +3 -3
- package/dist/{chunk-IQ6BQ2LX.js → chunk-RF7Q7SHU.js} +3 -3
- package/dist/{chunk-YSC4VY43.js → chunk-SAEZJZ5Z.js} +3 -3
- package/dist/{chunk-QDVIMN57.js → chunk-TDPHZWJI.js} +4 -4
- package/dist/{chunk-QWWDG5B7.js → chunk-U5MUWZOS.js} +6 -6
- package/dist/{chunk-LR5RNEVO.js → chunk-ULQPPQ23.js} +3 -3
- package/dist/{chunk-75JF44DH.js → chunk-VWSERFTW.js} +2 -2
- package/dist/{chunk-4LSLXBFN.js → chunk-XFMCRD2J.js} +6 -6
- package/dist/{chunk-X6SZPGL5.js → chunk-YNAJUTYC.js} +6 -6
- package/dist/{chunk-C67DVYWA.js → chunk-ZKOLV4ZN.js} +37 -2
- package/dist/chunk-ZKOLV4ZN.js.map +1 -0
- package/dist/{cli-XRF7WFE5.js → cli-HFZMZWRM.js} +8 -8
- package/dist/{cli-KT5X4J74.js → cli-HPYDF5AP.js} +8 -8
- package/dist/{cli-HFLU5QTD.js → cli-PWK63DQI.js} +7 -7
- package/dist/{cli-7JW54ZTA.js → cli-RC5F6DYP.js} +8 -8
- package/dist/{cli-7Z7BD23R.js → cli-S7RGCNHG.js} +7 -7
- package/dist/cloud-backends.js +4 -4
- package/dist/{control-plane-DGLF4MBB.js → control-plane-HRJRAYKV.js} +19 -19
- package/dist/{cp-hub-upload-7YESYCVS.js → cp-hub-upload-N4PPUZHE.js} +6 -6
- package/dist/{custody-client-P7SCEDU2.js → custody-client-KYEZET6C.js} +4 -4
- package/dist/{deploy-hetzner-FOCNRRB2.js → deploy-hetzner-A42GILM3.js} +8 -8
- package/dist/{dist-63YBVZW4.js → dist-5OXP2N6H.js} +8 -8
- package/dist/{dist-36WLI6E2.js → dist-64QL2Q5L.js} +6 -6
- package/dist/{dist-MITAKWKQ.js → dist-D4LLY6JV.js} +7 -7
- package/dist/{dist-TJJ6KBNZ.js → dist-ETGTZQUT.js} +255 -5
- package/dist/{dist-54VRDCUU.js → dist-GS36Y2CW.js} +7 -7
- package/dist/{dist-CBPQZPQN.js → dist-HGUSK4LL.js} +7 -7
- package/dist/{dist-E4VLIH3H.js → dist-JU5COR7Y.js} +7 -7
- package/dist/{dist-2CAWJQT5.js → dist-NJ2U42MZ.js} +9 -5
- package/dist/{dist-FHPNYDCF.js → dist-URWWHI3X.js} +8 -2
- package/dist/{dist-XSAPZOEG.js → dist-Z4S5EKUS.js} +7 -7
- package/dist/{host-reach-drainer-XFLSMTSX.js → host-reach-drainer-WIKLZSLZ.js} +2 -2
- package/dist/host-session-YP5RKV6T.js +29 -0
- package/dist/hub-A6U3YB5D.js +39 -0
- package/dist/{hub-adopt-IYZ3WXYN.js → hub-adopt-O4LQLW6N.js} +6 -6
- package/dist/{hub-api-client-WOZ2BQ6H.js → hub-api-client-BI3E37CF.js} +3 -3
- package/dist/{hub-docker-target-IQHX6OYX.js → hub-docker-target-D67UXZSU.js} +13 -13
- package/dist/index.js +1223 -229
- package/dist/index.js.map +1 -1
- package/dist/{plugin-update-2ACFHFUI.js → plugin-update-LI3QDA4K.js} +4 -4
- package/dist/prepare-5Y7DWMZ7.js +45 -0
- package/dist/prepared-custody-L6PXXLD3.js +39 -0
- package/dist/{prepared-state-FO74QUCP-PZLOM6HD.js → prepared-state-FO74QUCP-M4Q2X3KN.js} +3 -3
- package/dist/{publish-credentials-TO5IIW2T.js → publish-credentials-WJ4KLIMW.js} +8 -8
- package/dist/{registry-X33JZU6B.js → registry-6VF5VPGD.js} +4 -4
- package/dist/relay-732OVYXR.js +22 -0
- package/dist/{remote-docker-share-YADHIHXV.js → remote-docker-share-WY5U5USV.js} +10 -10
- package/dist/remote-docker-share-WY5U5USV.js.map +1 -0
- package/dist/{tool-grant-push-7G2QAN3J.js → tool-grant-push-YQYYNMRQ.js} +3 -3
- package/package.json +1 -1
- package/runtime/_shared/ctl.cjs +1026 -309
- package/runtime/digitalocean/ctl.cjs +1026 -309
- package/runtime/docker/packages/ctl/dist/bin.cjs +1026 -309
- package/runtime/e2b/ctl.cjs +1026 -309
- package/runtime/hetzner/ctl.cjs +1026 -309
- package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
- package/runtime/hub/apps/hub/.next/app-path-routes-manifest.json +24 -0
- package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
- package/runtime/hub/apps/hub/.next/routes-manifest.json +188 -0
- package/runtime/hub/apps/hub/.next/server/app/(auth)/signin/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js +4 -4
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/agent/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/backup/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/backup/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/checkpoint/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/checkpoint/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/clone/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/clone/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js +4 -4
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/logs/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/upload/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/upload/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/web/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js +4 -4
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/checkpoints/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/custody/[...path]/route.js +3 -3
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/attach/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/message/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/notes/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/resume/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/[id]/stop/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/detect/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/managers/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/bots/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/create-preflight/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/create-preflight/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/restore/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/restore/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/seed/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/size-check/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/size-check/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/prune/route.js +2 -2
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/prune/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/system/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/tasks/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rename/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/rescan/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route.js +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/tasks/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/[id]/timeline/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route/app-paths-manifest.json +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route/build-manifest.json +9 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route/server-reference-manifest.json +4 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route.js +10 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route.js.map +5 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route.js.nft.json +1 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/workspaces/route_client-reference-manifest.js +3 -0
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/web/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/custody/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/custody/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/system/page.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/(dashboard)/system/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js.nft.json +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/runtime/hub/apps/hub/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/runtime/hub/apps/hub/.next/server/app-paths-manifest.json +24 -0
- package/runtime/hub/apps/hub/.next/server/chunks/00je_(dashboard)_api_v1_workspaces_[id]_tasks_[taskId]_assign_route_actions_1sufsej.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/00je_(dashboard)_api_v1_workspaces_[id]_tasks_[taskId]_done_route_actions_216dixx.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/044u_hub__next-internal_server_app_(dashboard)_api_v1_managers_route_actions_1_vtgih.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/044u_hub__next-internal_server_app_(dashboard)_api_v1_tasks_route_actions_1h8tg_m.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/05v5_app_(dashboard)_api_v1_workspaces_[id]_managers_sessions_route_actions_16dksub.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/05v5_app_(dashboard)_api_v1_workspaces_[id]_managers_start_route_actions_1g-vmis.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/05v5_app_(dashboard)_api_v1_workspaces_[id]_tasks_[taskId]_route_actions_03oih6y.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/05v5_app_(dashboard)_api_v1_workspaces_[id]_tasks_assign_route_actions_196zwo9.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/05v5_app_(dashboard)_api_v1_workspaces_[id]_tasks_reorder_route_actions_1zkcfk-.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0ssw__next-internal_server_app_(dashboard)_api_v1_workspaces_route_actions_12a7_y8.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/0web_next-internal_server_app_(dashboard)_api_v1_managers_[id]_route_actions_07cpyb_.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_[id]_attach_route_actions_0o-khw8.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_[id]_message_route_actions_0rjcqe5.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_[id]_notes_route_actions_1-mf4r_.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_[id]_resume_route_actions_0-cm1mu.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_[id]_stop_route_actions_16nrl1r.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_managers_detect_route_actions_1sdbs-_.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_managers_route_actions_1sxymv0.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_rename_route_actions_0df5zi2.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_rescan_route_actions_1yra_w8.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_route_actions_1f56n_0.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_tasks_route_actions_1t-6quw.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_workspaces_[id]_timeline_route_actions_0pbxblt.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/1viy_api_v1_workspaces_[id]_tasks_[taskId]_unassign_route_actions_18a1p_r.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-c97gb._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0spnud2._.js → [root-of-the-server]__0-kl55b._.js} +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__028ifqb._.js → [root-of-the-server]__0-xlf9z._.js} +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__074mxl5._.js → [root-of-the-server]__0004tsz._.js} +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__00bupbc._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1cpr4qy._.js → [root-of-the-server]__0126167._.js} +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__01fy5q0._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__02c077x._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1ta1gr1._.js → [root-of-the-server]__02sueng._.js} +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0nndlre._.js → [root-of-the-server]__04-gm8c._.js} +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__05uinnp._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__06wy8zz._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__071c-t4._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__08jg8w8._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09059m-._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__092y7_z._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09ti2-t._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09y4pdw._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0_mog_h._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a689u5._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a8ere2._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0bzqrje._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0c_r3oe._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cdoz9i._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cmu4sk._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cxjxz0._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d27tlu._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d3fx1z._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dm5oqm._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dy5g2k._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0e1uaxg._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0e6_t-d._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ets4cd._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f2u0ul._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f9p_4f._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f_jmq2._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0fksz_r._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0fpygqn._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0gym-rp._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0hhlb2_._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0i9phow._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ikyoac._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0j72bti._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jb371p._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jq6cdw._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jt1d2s._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0kcw8t0._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0kdt9-i._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0l27vs0._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lc-j_n._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lna-vq._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0m5woxc._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0mi9xib._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0muy7eg._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nn0_b5._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0no30or._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0o3sjtx._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0onk5r0._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0pik2ie._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qde3vr._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qt_r6a._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ry8baf._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0sg4y_2._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0sgjn2j._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0st6oln._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0t0p64l._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0tbl11-._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ve_tqz._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0w4smfx._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0wo4sqj._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0wujjkl._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xbu3yj._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xl1-w6._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yct1tu._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yg67t0._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ykw5oe._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1c1rcl-._.js → [root-of-the-server]__0zznyx2._.js} +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1--u2xl._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-8sj4i._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__10kmcrt._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__10l_-cd._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__10yfcvu._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__112hqrh._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11c-21i._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11qbpq8._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11s1mrd._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__128w1nz._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__12b2kuv._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__12gbq5m._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13nfpq5._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13vl4-h._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__153b7kv._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__157kmse._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16695dw._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__166_uek._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16o0ij7._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__175lucf._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17p53e3._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17y9pmx._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__18ec5_t._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__18xpvkc._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1925hyw._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19ew1r2._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19grunx._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_4v0mh._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_cbcl1._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_wb2uh._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_xgm2e._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1an6-yb._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1c0ex8m._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1c1e08-._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1c9f4uu._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ci8hc2._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cs6d52._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d60scp._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dicjoc._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1diipl4._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dp2exz._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1epnstn._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1fjnz2l._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1g5wnt2._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1g9v7bq._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1gon0_4._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h_59cs._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h_q3sn._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hlugb4._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hux-70._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1i-7bnu._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1i_el2y._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1j6clag._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1k6q17t._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1khvg39._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lx9lyn._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1m36v6k._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mgu19x._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mhyrr5._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mk_lpu._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mt32fu._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1n1_2tw._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1na4sdw._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ntihlm._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1odu62n._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q6xrlt._.js +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1r4x1-y._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rjs_x0._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rxud0j._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1s5app0._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1sjz59l._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1slo4q_._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1thrazp._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1twtnwr._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1txvsbk._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1uch-60._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1um2jum._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1vnnuo1._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1wegvep._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1wi5roz._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1xa9oiv._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ypmy86._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1zml9me._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1zrf_a6._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__2019yzl._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20jyxyo._.js +2 -2
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20ybhif._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20zl5fr._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__212dyoi._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__218oup-._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__21abvx9._.js +3 -0
- package/runtime/hub/apps/hub/.next/server/chunks/_0907rw0._.js +2 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_0mcxq5g._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/_0vg6gvw._.js +41 -41
- package/runtime/hub/apps/hub/.next/server/chunks/apps_hub_app_(dashboard)_api_v1_lib_openapi_ts_1yokmzt._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/apps_hub_app_(dashboard)_api_v1_lib_validate_ts_16dhbzz._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/packages_relay_dist_control-plane_03a-9aj.js +6 -6
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__03-x9xy._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1jqga8h._.js +1 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0r2xlss._.js +2 -1
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/_14-qzbg._.js +26 -26
- package/runtime/hub/apps/hub/.next/server/chunks/ssr/packages_relay_dist_control-plane_0ve-wz4.js +1 -1
- package/runtime/hub/apps/hub/.next/server/functions-config-manifest.json +24 -0
- package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
- package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
- package/runtime/hub/apps/hub/.next/static/chunks/{31e1wjin30i__.css → 03_fxfc3849ms.css} +1 -1
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/boxes/[id]/[action]/route.ts +4 -2
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.ts +6 -4
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/boxes/route.ts +2 -1
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/lib/actor.ts +48 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/lib/envelope.ts +5 -2
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/lib/openapi.ts +1687 -52
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/lib/validate.ts +527 -1
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/attach/route.ts +26 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/message/route.ts +34 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/notes/route.ts +26 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/resume/route.ts +26 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/route.ts +34 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/[id]/stop/route.ts +23 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/detect/route.ts +33 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/managers/route.ts +27 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/tasks/route.ts +30 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/managers/route.ts +19 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/managers/sessions/route.ts +22 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/managers/start/route.ts +61 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/rename/route.ts +25 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/rescan/route.ts +20 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/route.ts +34 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/assign/route.ts +33 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/done/route.ts +23 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/route.ts +54 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/[taskId]/unassign/route.ts +25 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/assign/route.ts +34 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/reorder/route.ts +33 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/tasks/route.ts +59 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/[id]/timeline/route.ts +25 -0
- package/runtime/hub/apps/hub/app/(dashboard)/api/v1/workspaces/route.ts +31 -0
- package/runtime/hub/apps/hub/{chunk-SM2XYDPL.js → chunk-FBNAIUXZ.js} +36 -1
- package/runtime/hub/apps/hub/{chunk-F6GOERHP.js → chunk-GGHXBTGL.js} +3 -3
- package/runtime/hub/apps/hub/{chunk-7IIG6MIB.js → chunk-LEELYQVR.js} +9 -9
- package/runtime/hub/apps/hub/{chunk-AAF4CYVH.js → chunk-MD2UNTZR.js} +5 -5
- package/runtime/hub/apps/hub/{chunk-7JBH42LK.js → chunk-MQ7AJUJJ.js} +2 -2
- package/runtime/hub/apps/hub/{chunk-AIFVVQPX.js → chunk-OFJRKISZ.js} +3317 -1031
- package/runtime/hub/apps/hub/{dist-DS5LGBGK.js → dist-3LDUYWPK.js} +7 -1
- package/runtime/hub/apps/hub/{dist-YOTRYCRK.js → dist-DENRW6O5.js} +7 -3
- package/runtime/hub/apps/hub/{dist-BKCL4HAA.js → dist-NQYEPZJY.js} +4 -4
- package/runtime/hub/apps/hub/{dist-H7NIUVBD.js → dist-RIXE6NHS.js} +5 -5
- package/runtime/hub/apps/hub/{dist-YG4RVC24.js → dist-RK6SSH23.js} +5 -5
- package/runtime/hub/apps/hub/{dist-MQADLEEQ.js → dist-U5SDGYOA.js} +4 -4
- package/runtime/hub/apps/hub/{dist-LV6CHJVA.js → dist-U6XVHUNU.js} +4 -4
- package/runtime/hub/apps/hub/{dist-RJBPZWSZ.js → dist-W4YRUL6E.js} +4 -4
- package/runtime/hub/apps/hub/{dist-VENYRIRW.js → dist-Y3Q5YEOC.js} +4 -4
- package/runtime/hub/apps/hub/{hub-worker-DLFLGKCV.js → hub-worker-DVATYYST.js} +6 -6
- package/runtime/hub/apps/hub/lib/backend/background.ts +19 -0
- package/runtime/hub/apps/hub/lib/backend/box-facts.ts +97 -0
- package/runtime/hub/apps/hub/lib/backend/box-prs.ts +213 -0
- package/runtime/hub/apps/hub/lib/backend/deps.ts +99 -0
- package/runtime/hub/apps/hub/lib/backend/errors.ts +7 -0
- package/runtime/hub/apps/hub/lib/backend/github-prs.ts +302 -0
- package/runtime/hub/apps/hub/lib/backend/managers.ts +748 -0
- package/runtime/hub/apps/hub/lib/backend/timeline-lanes.ts +150 -0
- package/runtime/hub/apps/hub/lib/backend/timeline.ts +611 -0
- package/runtime/hub/apps/hub/lib/backend/workspaces.ts +439 -0
- package/runtime/hub/apps/hub/lib/boxes/backend-types.ts +355 -10
- package/runtime/hub/apps/hub/lib/boxes/postgres-source.ts +3 -0
- package/runtime/hub/apps/hub/lib/boxes/source.ts +18 -1
- package/runtime/hub/apps/hub/lib/boxes/types.ts +66 -0
- package/runtime/hub/apps/hub/lib/hub-backend.ts +114 -7
- package/runtime/hub/apps/hub/{prepared-state-FO74QUCP-FZ6PT4LA.js → prepared-state-FO74QUCP-75UBPW5I.js} +2 -2
- package/runtime/hub/apps/hub/server.js +2032 -163
- package/runtime/hub/apps/hub/test/backend-managers-background.test.ts +336 -0
- package/runtime/hub/apps/hub/test/backend-managers.test.ts +493 -0
- package/runtime/hub/apps/hub/test/backend-workspaces.test.ts +208 -0
- package/runtime/hub/apps/hub/test/box-prs.test.ts +198 -0
- package/runtime/hub/apps/hub/test/timeline-lanes.test.ts +261 -0
- package/runtime/hub/apps/hub/test/timeline.test.ts +1185 -0
- package/runtime/hub/apps/hub/test/validate.test.ts +252 -0
- package/runtime/hub/apps/hub/tsconfig.tsbuildinfo +1 -1
- package/runtime/relay/bin.cjs +1399 -616
- package/runtime/vercel/ctl.cjs +1026 -309
- package/share/host-skills/agentbox-info/SKILL.md +25 -4
- package/dist/_cloud-attach-B3BCOZ7U.js +0 -31
- package/dist/chunk-C67DVYWA.js.map +0 -1
- package/dist/chunk-EP4IFSV5.js.map +0 -1
- package/dist/chunk-KCDLAP5Q.js.map +0 -1
- package/dist/chunk-PXH3DERD.js.map +0 -1
- package/dist/chunk-ZUTC2JZM.js.map +0 -1
- package/dist/hub-OMGLWQEV.js +0 -39
- package/dist/prepare-OOZF37J6.js +0 -45
- package/dist/prepared-custody-E7CSZJ6V.js +0 -39
- package/dist/relay-7D5NOFKS.js +0 -22
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__00o_3sf._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__08xwxyo._.js +0 -3
- package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-mtsr6._.js +0 -3
- /package/dist/{_cloud-attach-B3BCOZ7U.js.map → _cloud-attach-UXH3VKTM.js.map} +0 -0
- /package/dist/{chunk-VQONUZE4.js.map → chunk-2W3W3KNR.js.map} +0 -0
- /package/dist/{chunk-RUKTOHK7.js.map → chunk-3AYSA62C.js.map} +0 -0
- /package/dist/{chunk-EXF4PLBN.js.map → chunk-3ISG5THX.js.map} +0 -0
- /package/dist/{chunk-BYZPRB7U.js.map → chunk-5D46PE5V.js.map} +0 -0
- /package/dist/{chunk-IF4VXKJK.js.map → chunk-5F5NBZG7.js.map} +0 -0
- /package/dist/{chunk-IQMDGAMB.js.map → chunk-6N7OSMEA.js.map} +0 -0
- /package/dist/{chunk-L567TKOK.js.map → chunk-BJLUG6TE.js.map} +0 -0
- /package/dist/{chunk-AYREFYEF.js.map → chunk-BV2UZ4SG.js.map} +0 -0
- /package/dist/{chunk-MBZ4UOWF.js.map → chunk-EAT5IEWA.js.map} +0 -0
- /package/dist/{chunk-ENFWBFBI.js.map → chunk-GBEV7ETR.js.map} +0 -0
- /package/dist/{chunk-4NO5MO2P.js.map → chunk-GLIWCNFE.js.map} +0 -0
- /package/dist/{chunk-VWJBQGXD.js.map → chunk-HCKRUAHW.js.map} +0 -0
- /package/dist/{chunk-IFPTD73K.js.map → chunk-HUVSTEJR.js.map} +0 -0
- /package/dist/{chunk-NKHRFR5G.js.map → chunk-IL7R2X6B.js.map} +0 -0
- /package/dist/{chunk-5UX2HAF4.js.map → chunk-IQ4WLVXE.js.map} +0 -0
- /package/dist/{chunk-AAMPHDB2.js.map → chunk-JL4EJ4EH.js.map} +0 -0
- /package/dist/{chunk-OXBWZG2N.js.map → chunk-KTB7JGPA.js.map} +0 -0
- /package/dist/{chunk-YL3VEQTS.js.map → chunk-LFBCFWG6.js.map} +0 -0
- /package/dist/{chunk-MJZPECVQ.js.map → chunk-M2DWTQRF.js.map} +0 -0
- /package/dist/{chunk-2MBELUE6.js.map → chunk-NGCG3IBH.js.map} +0 -0
- /package/dist/{chunk-QT4MOS6R.js.map → chunk-NX27A3F2.js.map} +0 -0
- /package/dist/{chunk-4Y365UYP.js.map → chunk-OUHDSEVQ.js.map} +0 -0
- /package/dist/{chunk-M6VAID7T.js.map → chunk-QBVRWGXD.js.map} +0 -0
- /package/dist/{chunk-VOVRWIBC.js.map → chunk-QLZPJIWF.js.map} +0 -0
- /package/dist/{chunk-GCS5XAPC.js.map → chunk-R3XDO4SN.js.map} +0 -0
- /package/dist/{chunk-IQ6BQ2LX.js.map → chunk-RF7Q7SHU.js.map} +0 -0
- /package/dist/{chunk-YSC4VY43.js.map → chunk-SAEZJZ5Z.js.map} +0 -0
- /package/dist/{chunk-QDVIMN57.js.map → chunk-TDPHZWJI.js.map} +0 -0
- /package/dist/{chunk-QWWDG5B7.js.map → chunk-U5MUWZOS.js.map} +0 -0
- /package/dist/{chunk-LR5RNEVO.js.map → chunk-ULQPPQ23.js.map} +0 -0
- /package/dist/{chunk-75JF44DH.js.map → chunk-VWSERFTW.js.map} +0 -0
- /package/dist/{chunk-4LSLXBFN.js.map → chunk-XFMCRD2J.js.map} +0 -0
- /package/dist/{chunk-X6SZPGL5.js.map → chunk-YNAJUTYC.js.map} +0 -0
- /package/dist/{cli-7JW54ZTA.js.map → cli-HFZMZWRM.js.map} +0 -0
- /package/dist/{cli-7Z7BD23R.js.map → cli-HPYDF5AP.js.map} +0 -0
- /package/dist/{cli-HFLU5QTD.js.map → cli-PWK63DQI.js.map} +0 -0
- /package/dist/{cli-KT5X4J74.js.map → cli-RC5F6DYP.js.map} +0 -0
- /package/dist/{cli-XRF7WFE5.js.map → cli-S7RGCNHG.js.map} +0 -0
- /package/dist/{control-plane-DGLF4MBB.js.map → control-plane-HRJRAYKV.js.map} +0 -0
- /package/dist/{cp-hub-upload-7YESYCVS.js.map → cp-hub-upload-N4PPUZHE.js.map} +0 -0
- /package/dist/{custody-client-P7SCEDU2.js.map → custody-client-KYEZET6C.js.map} +0 -0
- /package/dist/{deploy-hetzner-FOCNRRB2.js.map → deploy-hetzner-A42GILM3.js.map} +0 -0
- /package/dist/{dist-2CAWJQT5.js.map → dist-5OXP2N6H.js.map} +0 -0
- /package/dist/{dist-36WLI6E2.js.map → dist-64QL2Q5L.js.map} +0 -0
- /package/dist/{dist-63YBVZW4.js.map → dist-D4LLY6JV.js.map} +0 -0
- /package/dist/{dist-CBPQZPQN.js.map → dist-ETGTZQUT.js.map} +0 -0
- /package/dist/{dist-54VRDCUU.js.map → dist-GS36Y2CW.js.map} +0 -0
- /package/dist/{dist-FHPNYDCF.js.map → dist-HGUSK4LL.js.map} +0 -0
- /package/dist/{dist-E4VLIH3H.js.map → dist-JU5COR7Y.js.map} +0 -0
- /package/dist/{dist-MITAKWKQ.js.map → dist-NJ2U42MZ.js.map} +0 -0
- /package/dist/{dist-TJJ6KBNZ.js.map → dist-URWWHI3X.js.map} +0 -0
- /package/dist/{dist-XSAPZOEG.js.map → dist-Z4S5EKUS.js.map} +0 -0
- /package/dist/{host-reach-drainer-XFLSMTSX.js.map → host-reach-drainer-WIKLZSLZ.js.map} +0 -0
- /package/dist/{hub-OMGLWQEV.js.map → host-session-YP5RKV6T.js.map} +0 -0
- /package/dist/{hub-adopt-IYZ3WXYN.js.map → hub-A6U3YB5D.js.map} +0 -0
- /package/dist/{hub-api-client-WOZ2BQ6H.js.map → hub-adopt-O4LQLW6N.js.map} +0 -0
- /package/dist/{prepare-OOZF37J6.js.map → hub-api-client-BI3E37CF.js.map} +0 -0
- /package/dist/{hub-docker-target-IQHX6OYX.js.map → hub-docker-target-D67UXZSU.js.map} +0 -0
- /package/dist/{plugin-update-2ACFHFUI.js.map → plugin-update-LI3QDA4K.js.map} +0 -0
- /package/dist/{prepared-custody-E7CSZJ6V.js.map → prepare-5Y7DWMZ7.js.map} +0 -0
- /package/dist/{prepared-state-FO74QUCP-PZLOM6HD.js.map → prepared-custody-L6PXXLD3.js.map} +0 -0
- /package/dist/{registry-X33JZU6B.js.map → prepared-state-FO74QUCP-M4Q2X3KN.js.map} +0 -0
- /package/dist/{publish-credentials-TO5IIW2T.js.map → publish-credentials-WJ4KLIMW.js.map} +0 -0
- /package/dist/{relay-7D5NOFKS.js.map → registry-6VF5VPGD.js.map} +0 -0
- /package/dist/{remote-docker-share-YADHIHXV.js.map → relay-732OVYXR.js.map} +0 -0
- /package/dist/{tool-grant-push-7G2QAN3J.js.map → tool-grant-push-YQYYNMRQ.js.map} +0 -0
- /package/runtime/hub/apps/hub/.next/static/{o9_g9S5JH-r8bfNfmPa5H → psd9s1F7NglKqhj4_onRN}/_buildManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{o9_g9S5JH-r8bfNfmPa5H → psd9s1F7NglKqhj4_onRN}/_clientMiddlewareManifest.js +0 -0
- /package/runtime/hub/apps/hub/.next/static/{o9_g9S5JH-r8bfNfmPa5H → psd9s1F7NglKqhj4_onRN}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[49714,e=>{"use strict";let t=["claude","codex","opencode","pi","none"],r=["claude","codex","opencode","pi"],o=["docker","daytona","hetzner","vercel","e2b","digitalocean","remote-docker"],n=["start","pause","resume","stop","destroy","screen"];function s(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let i=/^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/,a=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,u=["checkout","branch","pull","push","push-host"],l=["claude","codex","herdr","cmux","vscode","iterm2","finder"];function f(e,t){return void 0===e?{ok:!0,value:void 0}:"string"!=typeof e?{ok:!1,message:`${t} must be a string`}:{ok:!0,value:e}}function m(e,t){return void 0===e?{ok:!0,value:void 0}:"boolean"!=typeof e?{ok:!1,message:`${t} must be a boolean`}:{ok:!0,value:e}}function d(e,t){return void 0===e?{ok:!0,value:void 0}:"number"==typeof e&&Number.isFinite(e)?{ok:!0,value:e}:{ok:!1,message:`${t} must be a number`}}function g(e,t){if(void 0===e)return{ok:!0,value:void 0};if(!Array.isArray(e))return{ok:!1,message:`${t} must be an array of strings`};for(let r of e)if("string"!=typeof r)return{ok:!1,message:`${t} must be an array of strings`};return{ok:!0,value:e.length>0?e:void 0}}async function k(e){let t=await e.text();if(0===t.trim().length)return{ok:!0,value:{}};try{return{ok:!0,value:JSON.parse(t)}}catch{return{ok:!1,message:"body is not valid JSON"}}}e.s(["AGENTS",0,t,"GIT_OPS",0,u,"LIFECYCLE_ACTIONS",0,n,"isGitOp",0,function(e){return u.includes(e)},"isLifecycleAction",0,function(e){return n.includes(e)},"isProviderId",0,function(e){return o.includes(e)||/^[a-z][a-z0-9-]{0,39}$/.test(e)},"parseAnswer",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{answer:t,cancelled:r,openedByClient:o}=e;return"y"!==t&&"n"!==t?{ok:!1,message:"answer must be 'y' or 'n'"}:void 0!==o&&"boolean"!=typeof o?{ok:!1,message:"openedByClient must be a boolean when present"}:void 0!==r&&"boolean"!=typeof r?{ok:!1,message:"cancelled must be a boolean when present"}:{ok:!0,value:{answer:t,...!0===r?{cancelled:!0}:{},...!0===o?{openedByClient:!0}:{}}}},"parseBoxBackup",0,function(e){if(null==e)return{ok:!0,value:{}};if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=f(e.name,"name");if(!t.ok)return t;let r=f(e.agent,"agent");if(!r.ok)return r;let o=d(e.keep,"keep");if(!o.ok)return o;if(void 0!==o.value&&(!Number.isInteger(o.value)||o.value<1))return{ok:!1,message:"keep must be a positive integer"};let n=m(e.includeNodeModules,"includeNodeModules");return n.ok?{ok:!0,value:{name:t.value,keep:o.value,agent:r.value,includeNodeModules:n.value}}:n},"parseCheckpointCreate",0,function(e){if(null==e)return{ok:!0,value:{}};if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=f(e.name,"name");if(!t.ok)return t;let r=m(e.merged,"merged");if(!r.ok)return r;let o=m(e.setDefault,"setDefault");if(!o.ok)return o;let n=m(e.replace,"replace");return n.ok?{ok:!0,value:{name:t.value,merged:r.value,setDefault:o.value,replace:n.value}}:n},"parseCloneBox",0,function(e){if(null==e)return{ok:!0,value:{}};if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{name:t,provider:r,into:o,includeNodeModules:n,persistent:i}=e,a={},u=(e,t)=>{if(null==e)return{ok:!0,value:void 0};if("string"!=typeof e)return{ok:!1,message:`${t} must be a string`};let r=e.trim();return{ok:!0,value:r.length>0?r:void 0}},l=u(t,"name");if(!l.ok)return l;void 0!==l.value&&(a.name=l.value);let f=u(r,"provider");if(!f.ok)return f;void 0!==f.value&&(a.provider=f.value);let m=u(o,"into");if(!m.ok)return m;if(void 0!==m.value){var d;if(!((d=m.value).startsWith("/")||/^[a-zA-Z]:[\\/]/.test(d)||d.startsWith("\\\\")))return{ok:!1,message:`into must be an absolute path (got "${m.value}") — it names a directory on the hub's machine, which has no notion of your working directory`};a.into=m.value}return void 0!==n&&"boolean"!=typeof n?{ok:!1,message:"includeNodeModules must be a boolean"}:(!0===n&&(a.includeNodeModules=!0),void 0!==i&&"boolean"!=typeof i)?{ok:!1,message:"persistent must be a boolean"}:("boolean"==typeof i&&(a.persistent=i),{ok:!0,value:a})},"parseCreateBox",0,function(e,r=t){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{projectId:n,repoUrl:i,agent:a,provider:u,name:l,prompt:k,fromBranch:v,setupWizard:c}=e,{agentArgs:p,startAgent:b,foreground:y,opts:h}=e,j="string"==typeof n&&n.length>0,N="string"==typeof i&&i.length>0;if(!j&&!N)return{ok:!1,message:"one of projectId or repoUrl is required (string)"};if(j&&N)return{ok:!1,message:"send exactly one of projectId or repoUrl, not both"};if(void 0!==n&&"string"!=typeof n)return{ok:!1,message:"projectId must be a string"};if(void 0!==i&&"string"!=typeof i)return{ok:!1,message:"repoUrl must be a string"};if("string"!=typeof a||!r.includes(a))return{ok:!1,message:`agent must be one of ${r.join(", ")}`,details:{got:a}};let O="string"==typeof u&&/^(?:docker|remote-docker):[A-Za-z0-9][A-Za-z0-9._-]*$/.test(u);if(void 0!==u&&!O&&("string"!=typeof u||!/^[a-z][a-z0-9-]{0,39}$/.test(u)))return{ok:!1,message:`provider must be one of ${o.join(", ")}, a registered plugin provider, or a docker:<host> spec`,details:{got:u}};if(void 0!==l&&"string"!=typeof l)return{ok:!1,message:"name must be a string"};if(void 0!==k&&"string"!=typeof k)return{ok:!1,message:"prompt must be a string"};let S=f(v,"fromBranch");if(!S.ok)return S;let A=m(c,"setupWizard");if(!A.ok)return A;let J=g(p,"agentArgs");if(!J.ok)return J;let P=m(b,"startAgent");if(!P.ok)return P;let w=m(y,"foreground");if(!w.ok)return w;let z=function(e){if(void 0===e)return{ok:!0,value:void 0};if(!s(e))return{ok:!1,message:"opts must be a JSON object"};let t={};for(let r of["image","snapshot","memory","cpus","pidsLimit","disk","size","location","inbound","useBranch","imageRegistry","remoteHost","sessionName"]){let o=f(e[r],`opts.${r}`);if(!o.ok)return o;void 0!==o.value&&(t[r]=o.value)}for(let r of["hostSnapshot","withPlaywright","withEnv","vnc","persistent","resync","sharedDockerCache","portless","build","credentialSync","dangerouslySkipPermissions","carryYes","carryAsk"]){let o=m(e[r],`opts.${r}`);if(!o.ok)return o;void 0!==o.value&&(t[r]=o.value)}let r=d(e.bundleDepth,"opts.bundleDepth");if(!r.ok)return r;void 0!==r.value&&(t.bundleDepth=r.value);let o=g(e.envFiles,"opts.envFiles");if(!o.ok)return o;if(void 0!==o.value&&(t.envFiles=o.value),void 0!==e.gitPushMode){let r=["auto","relay","lease","direct"];if("string"!=typeof e.gitPushMode||!r.includes(e.gitPushMode))return{ok:!1,message:`opts.gitPushMode must be one of ${r.join(", ")}`};t.gitPushMode=e.gitPushMode}if(void 0!==e.carry){if(!Array.isArray(e.carry))return{ok:!1,message:"opts.carry must be an array"};t.carry=e.carry}let n=g(e.borrowCredentials,"opts.borrowCredentials");if(!n.ok)return n;if(void 0!==n.value&&(t.borrowCredentials=n.value),void 0!==e.promptAnswers){if(!Array.isArray(e.promptAnswers))return{ok:!1,message:"opts.promptAnswers must be an array"};for(let[t,r]of e.promptAnswers.entries())if(!s(r)||"string"!=typeof r.id||"string"!=typeof r.value)return{ok:!1,message:`opts.promptAnswers[${String(t)}] must be { id: string, value: string }`};t.promptAnswers=e.promptAnswers}return{ok:!0,value:t}}(h);return z.ok?{ok:!0,value:{projectId:j?n:void 0,repoUrl:N?i:void 0,agent:a,provider:u,name:l,prompt:k,agentArgs:J.value,startAgent:P.value,foreground:w.value,fromBranch:S.value,setupWizard:A.value,opts:z.value}}:z},"parseCreatePreflight",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t="string"==typeof e.agent?e.agent.trim():"";if(0===t.length)return{ok:!1,message:"agent is required (string)"};let r=f(e.provider,"provider");if(!r.ok)return r;let o=m(e.carryAsk,"carryAsk");return o.ok?{ok:!0,value:{agent:t,...void 0!==r.value?{provider:r.value}:{},...void 0!==o.value?{carryAsk:o.value}:{}}}:o},"parseGitBranch",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{name:t,from:r}=e;if("string"!=typeof t||0===t.trim().length)return{ok:!1,message:"name is required (non-empty string)"};let o=f(r,"from");return o.ok?{ok:!0,value:{name:t,from:o.value}}:o},"parseGitCheckout",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{branch:t}=e;if("string"!=typeof t||0===t.trim().length)return{ok:!1,message:"branch is required (non-empty string)"};let r=g(e.args,"args");return r.ok?{ok:!0,value:{branch:t,args:r.value}}:r},"parseGitPull",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=f(e.remote,"remote");if(!t.ok)return t;let r=m(e.ffOnly,"ffOnly");if(!r.ok)return r;let o=g(e.args,"args");return o.ok?{ok:!0,value:{remote:t.value,ffOnly:r.value,args:o.value}}:o},"parseGitPush",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=f(e.remote,"remote");if(!t.ok)return t;let r=m(e.force,"force");if(!r.ok)return r;let o=g(e.args,"args");return o.ok?{ok:!0,value:{remote:t.value,force:r.value,args:o.value}}:o},"parseGitPushHost",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=f(e.as,"as");if(!t.ok)return t;let r=m(e.force,"force");if(!r.ok)return r;let o=g(e.args,"args");return o.ok?{ok:!0,value:{as:t.value,force:r.value,args:o.value}}:o},"parseHostUpsert",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{alias:t,ssh:r,default:o,connection:n,identity:i}=e;if("string"!=typeof t||!a.test(t))return{ok:!1,message:"alias must be a plain name (letters, digits, ., _, -; no @, :, /)"};if("string"!=typeof r||0===r.trim().length)return{ok:!1,message:"ssh is required (an ~/.ssh/config alias or [user@]host[:port])"};let u=m(o,"default");if(!u.ok)return u;let l={alias:t,ssh:r.trim(),default:u.value};if(void 0!==n){if(!s(n))return{ok:!1,message:"connection must be an object"};let{host:e,user:t,port:r}=n;if("string"!=typeof e||0===e.trim().length)return{ok:!1,message:"connection.host is required when connection is given"};if(/[@/\s]/.test(e.trim()))return{ok:!1,message:"connection.host must be a hostname or IP"};let o={host:e.trim()};if(void 0!==t){if("string"!=typeof t||0===t.trim().length)return{ok:!1,message:"connection.user must be a non-empty string"};o.user=t.trim()}if(void 0!==r){if("number"!=typeof r||!Number.isInteger(r)||r<1||r>65535)return{ok:!1,message:"connection.port must be a port number"};o.port=r}l.connection=o}if(void 0!==i){if("string"!=typeof i||!i.includes("PRIVATE KEY"))return{ok:!1,message:"identity must be a PEM-encoded private key"};if(Buffer.byteLength(i,"utf8")>16384)return{ok:!1,message:"identity is too large to be a private key"};if(!l.connection)return{ok:!1,message:"identity requires connection (send the ssh -G expansion)"};l.identity=i}return{ok:!0,value:l}},"parseLoginCode",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{code:t}=e;return"string"!=typeof t||0===t.trim().length?{ok:!1,message:"code is required (non-empty string)"}:{ok:!0,value:{code:t.trim()}}},"parseOpenIn",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{app:t}=e;return"string"==typeof t&&l.includes(t)?{ok:!0,value:{app:t}}:{ok:!1,message:`app must be one of ${l.join(", ")}`,details:{got:t}}},"parseProject",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{path:t,parent:r,name:o,git:n}=e,a="string"==typeof t&&t.length>0,u=void 0!==r||void 0!==o||void 0!==n;if(a&&u)return{ok:!1,message:"send either { path } or { parent, name }, not both"};if(a)return{ok:!0,value:{kind:"register",path:t}};if(!u)return{ok:!1,message:"path (register a folder) or parent + name (create one) is required"};if("string"!=typeof r||0===r.length)return{ok:!1,message:"parent is required (absolute directory path)"};if("string"!=typeof o||!i.test(o))return{ok:!1,message:"name must be a single folder name (letters, digits, . _ -; no leading dot, no slashes)"};let l=m(n,"git");return l.ok?{ok:!0,value:{kind:"create",parent:r,name:o,git:l.value??!1}}:l},"parseProviderCredentials",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t={};for(let[r,o]of Object.entries(e)){if("string"!=typeof o)return{ok:!1,message:`field ${r} must be a string`};t[r]=o}return 0===Object.keys(t).length?{ok:!1,message:"at least one credential field is required"}:{ok:!0,value:t}},"parseProviderPrepare",0,function(e){if(null==e)return{ok:!0,value:{}};if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{force:t,agentSettings:o,agents:n,build:i,size:a,location:u,name:l}=e,d=m(t,"force");if(!d.ok)return d;let k=function(e){if(void 0===e)return{ok:!0,value:void 0};let t={ok:!1,message:"agentSettings must be an object of {agent: {key: string|boolean}}"};if(!s(e))return t;let r={};for(let[o,n]of Object.entries(e)){if(!s(n))return t;let e={};for(let[r,o]of Object.entries(n)){if("string"!=typeof o&&"boolean"!=typeof o)return t;e[r]=o}r[o]=e}return{ok:!0,value:Object.keys(r).length>0?r:void 0}}(o);if(!k.ok)return k;let v=g(n,"agents");if(!v.ok)return v;if(void 0!==(v.value??[]).find(e=>!r.includes(e)))return{ok:!1,message:`agents must each be one of ${r.join(", ")}`};let c=m(i,"build");if(!c.ok)return c;let p=f(a,"size");if(!p.ok)return p;let b=f(u,"location");if(!b.ok)return b;let y=f(l,"name");return y.ok?{ok:!0,value:{force:d.value,agentSettings:k.value,agents:v.value,build:c.value,size:p.value,location:b.value,name:y.value}}:y},"parsePrune",0,function(e){if(null==e)return{ok:!0,value:{}};if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=m(e.all,"all");if(!t.ok)return t;let r=m(e.dryRun,"dryRun");if(!r.ok)return r;let o=f(e.provider,"provider");return o.ok?{ok:!0,value:{all:t.value,dryRun:r.value,provider:o.value}}:o},"parseRenameBox",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{displayName:t}=e;return"string"!=typeof t?{ok:!1,message:"displayName is required (string; empty string clears the label)"}:t.trim().length>60?{ok:!1,message:"displayName too long (max 60 chars)"}:{ok:!0,value:{displayName:t}}},"parseRestoreProject",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};if("string"!=typeof e.bot||0===e.bot.trim().length)return{ok:!1,message:"bot is required (string)"};let t=f(e.stamp,"stamp");if(!t.ok)return t;let r=f(e.name,"name");if(!r.ok)return r;let o=f(e.provider,"provider");if(!o.ok)return o;let n=f(e.into,"into");if(!n.ok)return n;if(void 0!==n.value&&n.value.length>0&&!n.value.startsWith("/"))return{ok:!1,message:"into must be an absolute path"};let i=m(e.force,"force");if(!i.ok)return i;let a=m(e.persistent,"persistent");return a.ok?{ok:!0,value:{bot:e.bot.trim(),stamp:t.value,name:r.value,provider:o.value,into:n.value,force:i.value,persistent:a.value}}:a},"parseServiceRestart",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=f(e.name,"name");return t.ok?{ok:!0,value:{name:t.value}}:t},"parseSizeCheck",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=f(e.size,"size");return t.ok?void 0===t.value?{ok:!1,message:"size is required"}:{ok:!0,value:t.value}:t},"readJson",0,k])}];
|
|
1
|
+
module.exports=[49714,e=>{"use strict";let t=["claude","codex","opencode","pi","none"],r=["claude","codex","opencode","pi"],o=["docker","daytona","hetzner","vercel","e2b","digitalocean","remote-docker"],n=["start","pause","resume","stop","destroy","screen"];function s(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let a=/^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/,i=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,u=["checkout","branch","pull","push","push-host"],l=["claude","codex","herdr","cmux","vscode","iterm2","finder"];function f(e,t){return void 0===e?{ok:!0,value:void 0}:"string"!=typeof e?{ok:!1,message:`${t} must be a string`}:{ok:!0,value:e}}function m(e,t){return void 0===e?{ok:!0,value:void 0}:"boolean"!=typeof e?{ok:!1,message:`${t} must be a boolean`}:{ok:!0,value:e}}function d(e,t){return void 0===e?{ok:!0,value:void 0}:"number"==typeof e&&Number.isFinite(e)?{ok:!0,value:e}:{ok:!1,message:`${t} must be a number`}}function g(e,t){if(void 0===e)return{ok:!0,value:void 0};if(!Array.isArray(e))return{ok:!1,message:`${t} must be an array of strings`};for(let r of e)if("string"!=typeof r)return{ok:!1,message:`${t} must be an array of strings`};return{ok:!0,value:e.length>0?e:void 0}}async function k(e){let t=await e.text();if(0===t.trim().length)return{ok:!0,value:{}};try{return{ok:!0,value:JSON.parse(t)}}catch{return{ok:!1,message:"body is not valid JSON"}}}let v=["todo","in_progress","blocked","done"],p=/^T-\d+$/,b=["claude","codex","opencode","pi"],c=["note","replan","plan"];function y(e,t="note"){if(void 0===e)return{ok:!0,value:void 0};if("string"!=typeof e)return{ok:!1,message:`${t} must be a string`};if(e.length>2e3)return{ok:!1,message:`${t} too long (max ${String(2e3)} chars)`};let r=e.trim();return{ok:!0,value:r.length>0?r:void 0}}function h(e){let t=y(e,"text");return t.ok?t.value?{ok:!0,value:t.value}:{ok:!1,message:"text is required (non-empty string)"}:t}let j=/^[A-Za-z0-9_.-]{1,100}\/[A-Za-z0-9_.-]{1,100}$/;function N(e){return"string"==typeof e&&v.includes(e)}function x(e){if(void 0===e)return{ok:!0,value:void 0};if(!s(e))return{ok:!1,message:"externalRef must be an object"};let{kind:t,id:r,url:o}=e;if("string"!=typeof t||0===t.length)return{ok:!1,message:"externalRef.kind is required (string)"};if("string"!=typeof r||0===r.length)return{ok:!1,message:"externalRef.id is required (string)"};let n=f(o,"externalRef.url");return n.ok?{ok:!0,value:{kind:t,id:r,...n.value?{url:n.value}:{}}}:n}function I(e,t){if(!Array.isArray(e)||0===e.length)return{ok:!1,message:`${t} is required (non-empty array of task ids)`};for(let r of e)if("string"!=typeof r||!p.test(r))return{ok:!1,message:`${t} entries must be task ids like T-1`};return{ok:!0,value:e}}let S=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/,O=/^[0-9a-f]{16}$/;function A(e,t){return void 0===e?{ok:!0,value:void 0}:"string"==typeof e&&O.test(e)?{ok:!0,value:e}:{ok:!1,message:`${t} must be a manager id (16 hex)`}}let J=["running","stopped"];e.s(["AGENTS",0,t,"GIT_OPS",0,u,"LIFECYCLE_ACTIONS",0,n,"MANAGER_AGENT_NAMES",0,b,"isForce",0,function(e){let t=new URL(e.url).searchParams.get("force");return"1"===t||"true"===t},"isGitOp",0,function(e){return u.includes(e)},"isLifecycleAction",0,function(e){return n.includes(e)},"isManagerStatus",0,function(e){return"string"==typeof e&&J.includes(e)},"isProviderId",0,function(e){return o.includes(e)||/^[a-z][a-z0-9-]{0,39}$/.test(e)},"isTaskStatus",0,N,"parseAnswer",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{answer:t,cancelled:r,openedByClient:o}=e;return"y"!==t&&"n"!==t?{ok:!1,message:"answer must be 'y' or 'n'"}:void 0!==o&&"boolean"!=typeof o?{ok:!1,message:"openedByClient must be a boolean when present"}:void 0!==r&&"boolean"!=typeof r?{ok:!1,message:"cancelled must be a boolean when present"}:{ok:!0,value:{answer:t,...!0===r?{cancelled:!0}:{},...!0===o?{openedByClient:!0}:{}}}},"parseBoxBackup",0,function(e){if(null==e)return{ok:!0,value:{}};if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=f(e.name,"name");if(!t.ok)return t;let r=f(e.agent,"agent");if(!r.ok)return r;let o=d(e.keep,"keep");if(!o.ok)return o;if(void 0!==o.value&&(!Number.isInteger(o.value)||o.value<1))return{ok:!1,message:"keep must be a positive integer"};let n=m(e.includeNodeModules,"includeNodeModules");return n.ok?{ok:!0,value:{name:t.value,keep:o.value,agent:r.value,includeNodeModules:n.value}}:n},"parseCheckpointCreate",0,function(e){if(null==e)return{ok:!0,value:{}};if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=f(e.name,"name");if(!t.ok)return t;let r=m(e.merged,"merged");if(!r.ok)return r;let o=m(e.setDefault,"setDefault");if(!o.ok)return o;let n=m(e.replace,"replace");return n.ok?{ok:!0,value:{name:t.value,merged:r.value,setDefault:o.value,replace:n.value}}:n},"parseCloneBox",0,function(e){if(null==e)return{ok:!0,value:{}};if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{name:t,provider:r,into:o,includeNodeModules:n,persistent:a}=e,i={},u=(e,t)=>{if(null==e)return{ok:!0,value:void 0};if("string"!=typeof e)return{ok:!1,message:`${t} must be a string`};let r=e.trim();return{ok:!0,value:r.length>0?r:void 0}},l=u(t,"name");if(!l.ok)return l;void 0!==l.value&&(i.name=l.value);let f=u(r,"provider");if(!f.ok)return f;void 0!==f.value&&(i.provider=f.value);let m=u(o,"into");if(!m.ok)return m;if(void 0!==m.value){var d;if(!((d=m.value).startsWith("/")||/^[a-zA-Z]:[\\/]/.test(d)||d.startsWith("\\\\")))return{ok:!1,message:`into must be an absolute path (got "${m.value}") — it names a directory on the hub's machine, which has no notion of your working directory`};i.into=m.value}return void 0!==n&&"boolean"!=typeof n?{ok:!1,message:"includeNodeModules must be a boolean"}:(!0===n&&(i.includeNodeModules=!0),void 0!==a&&"boolean"!=typeof a)?{ok:!1,message:"persistent must be a boolean"}:("boolean"==typeof a&&(i.persistent=a),{ok:!0,value:i})},"parseCreateBox",0,function(e,r=t){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{projectId:n,repoUrl:a,agent:i,provider:u,name:l,prompt:k,fromBranch:v,setupWizard:p}=e,{agentArgs:b,startAgent:c,foreground:y,opts:h,managerId:j}=e,N="string"==typeof n&&n.length>0,x="string"==typeof a&&a.length>0;if(!N&&!x)return{ok:!1,message:"one of projectId or repoUrl is required (string)"};if(N&&x)return{ok:!1,message:"send exactly one of projectId or repoUrl, not both"};if(void 0!==n&&"string"!=typeof n)return{ok:!1,message:"projectId must be a string"};if(void 0!==a&&"string"!=typeof a)return{ok:!1,message:"repoUrl must be a string"};if("string"!=typeof i||!r.includes(i))return{ok:!1,message:`agent must be one of ${r.join(", ")}`,details:{got:i}};let I="string"==typeof u&&/^(?:docker|remote-docker):[A-Za-z0-9][A-Za-z0-9._-]*$/.test(u);if(void 0!==u&&!I&&("string"!=typeof u||!/^[a-z][a-z0-9-]{0,39}$/.test(u)))return{ok:!1,message:`provider must be one of ${o.join(", ")}, a registered plugin provider, or a docker:<host> spec`,details:{got:u}};if(void 0!==l&&"string"!=typeof l)return{ok:!1,message:"name must be a string"};if(void 0!==k&&"string"!=typeof k)return{ok:!1,message:"prompt must be a string"};let S=f(v,"fromBranch");if(!S.ok)return S;let O=m(p,"setupWizard");if(!O.ok)return O;let J=g(b,"agentArgs");if(!J.ok)return J;let $=m(c,"startAgent");if(!$.ok)return $;let P=m(y,"foreground");if(!P.ok)return P;let w=function(e){if(void 0===e)return{ok:!0,value:void 0};if(!s(e))return{ok:!1,message:"opts must be a JSON object"};let t={};for(let r of["image","snapshot","memory","cpus","pidsLimit","disk","size","location","inbound","useBranch","imageRegistry","remoteHost","sessionName"]){let o=f(e[r],`opts.${r}`);if(!o.ok)return o;void 0!==o.value&&(t[r]=o.value)}for(let r of["hostSnapshot","withPlaywright","withEnv","vnc","persistent","resync","sharedDockerCache","portless","build","credentialSync","dangerouslySkipPermissions","carryYes","carryAsk"]){let o=m(e[r],`opts.${r}`);if(!o.ok)return o;void 0!==o.value&&(t[r]=o.value)}let r=d(e.bundleDepth,"opts.bundleDepth");if(!r.ok)return r;void 0!==r.value&&(t.bundleDepth=r.value);let o=g(e.envFiles,"opts.envFiles");if(!o.ok)return o;if(void 0!==o.value&&(t.envFiles=o.value),void 0!==e.gitPushMode){let r=["auto","relay","lease","direct"];if("string"!=typeof e.gitPushMode||!r.includes(e.gitPushMode))return{ok:!1,message:`opts.gitPushMode must be one of ${r.join(", ")}`};t.gitPushMode=e.gitPushMode}if(void 0!==e.carry){if(!Array.isArray(e.carry))return{ok:!1,message:"opts.carry must be an array"};t.carry=e.carry}let n=g(e.borrowCredentials,"opts.borrowCredentials");if(!n.ok)return n;if(void 0!==n.value&&(t.borrowCredentials=n.value),void 0!==e.promptAnswers){if(!Array.isArray(e.promptAnswers))return{ok:!1,message:"opts.promptAnswers must be an array"};for(let[t,r]of e.promptAnswers.entries())if(!s(r)||"string"!=typeof r.id||"string"!=typeof r.value)return{ok:!1,message:`opts.promptAnswers[${String(t)}] must be { id: string, value: string }`};t.promptAnswers=e.promptAnswers}return{ok:!0,value:t}}(h);if(!w.ok)return w;let z=A(j,"managerId");return z.ok?{ok:!0,value:{...z.value?{managerId:z.value}:{},projectId:N?n:void 0,repoUrl:x?a:void 0,agent:i,provider:u,name:l,prompt:k,agentArgs:J.value,startAgent:$.value,foreground:P.value,fromBranch:S.value,setupWizard:O.value,opts:w.value}}:z},"parseCreatePreflight",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t="string"==typeof e.agent?e.agent.trim():"";if(0===t.length)return{ok:!1,message:"agent is required (string)"};let r=f(e.provider,"provider");if(!r.ok)return r;let o=m(e.carryAsk,"carryAsk");return o.ok?{ok:!0,value:{agent:t,...void 0!==r.value?{provider:r.value}:{},...void 0!==o.value?{carryAsk:o.value}:{}}}:o},"parseGitBranch",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{name:t,from:r}=e;if("string"!=typeof t||0===t.trim().length)return{ok:!1,message:"name is required (non-empty string)"};let o=f(r,"from");return o.ok?{ok:!0,value:{name:t,from:o.value}}:o},"parseGitCheckout",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{branch:t}=e;if("string"!=typeof t||0===t.trim().length)return{ok:!1,message:"branch is required (non-empty string)"};let r=g(e.args,"args");return r.ok?{ok:!0,value:{branch:t,args:r.value}}:r},"parseGitPull",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=f(e.remote,"remote");if(!t.ok)return t;let r=m(e.ffOnly,"ffOnly");if(!r.ok)return r;let o=g(e.args,"args");return o.ok?{ok:!0,value:{remote:t.value,ffOnly:r.value,args:o.value}}:o},"parseGitPush",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=f(e.remote,"remote");if(!t.ok)return t;let r=m(e.force,"force");if(!r.ok)return r;let o=g(e.args,"args");return o.ok?{ok:!0,value:{remote:t.value,force:r.value,args:o.value}}:o},"parseGitPushHost",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=f(e.as,"as");if(!t.ok)return t;let r=m(e.force,"force");if(!r.ok)return r;let o=g(e.args,"args");return o.ok?{ok:!0,value:{as:t.value,force:r.value,args:o.value}}:o},"parseHostUpsert",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{alias:t,ssh:r,default:o,connection:n,identity:a}=e;if("string"!=typeof t||!i.test(t))return{ok:!1,message:"alias must be a plain name (letters, digits, ., _, -; no @, :, /)"};if("string"!=typeof r||0===r.trim().length)return{ok:!1,message:"ssh is required (an ~/.ssh/config alias or [user@]host[:port])"};let u=m(o,"default");if(!u.ok)return u;let l={alias:t,ssh:r.trim(),default:u.value};if(void 0!==n){if(!s(n))return{ok:!1,message:"connection must be an object"};let{host:e,user:t,port:r}=n;if("string"!=typeof e||0===e.trim().length)return{ok:!1,message:"connection.host is required when connection is given"};if(/[@/\s]/.test(e.trim()))return{ok:!1,message:"connection.host must be a hostname or IP"};let o={host:e.trim()};if(void 0!==t){if("string"!=typeof t||0===t.trim().length)return{ok:!1,message:"connection.user must be a non-empty string"};o.user=t.trim()}if(void 0!==r){if("number"!=typeof r||!Number.isInteger(r)||r<1||r>65535)return{ok:!1,message:"connection.port must be a port number"};o.port=r}l.connection=o}if(void 0!==a){if("string"!=typeof a||!a.includes("PRIVATE KEY"))return{ok:!1,message:"identity must be a PEM-encoded private key"};if(Buffer.byteLength(a,"utf8")>16384)return{ok:!1,message:"identity is too large to be a private key"};if(!l.connection)return{ok:!1,message:"identity requires connection (send the ssh -G expansion)"};l.identity=a}return{ok:!0,value:l}},"parseLoginCode",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{code:t}=e;return"string"!=typeof t||0===t.trim().length?{ok:!1,message:"code is required (non-empty string)"}:{ok:!0,value:{code:t.trim()}}},"parseManagerDetect",0,function(e,t=b){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{agent:r,sessionId:o,cwd:n,pid:a,host:i,managerId:u,boxId:l,boxJobId:m,tmuxPane:d,tmuxSession:g}=e;if(void 0!==d&&("string"!=typeof d||!/^%\d+$/.test(d)))return{ok:!1,message:"tmuxPane must be a tmux pane id like %3"};if(void 0!==g&&("string"!=typeof g||!/^agentbox-manager-[0-9a-f]{16}$/.test(g)))return{ok:!1,message:"tmuxSession must be an agentbox-manager-<16 hex> session name"};if("string"!=typeof r||!t.includes(r))return{ok:!1,message:`agent must be one of ${t.join(", ")}`};if("string"!=typeof o||!S.test(o))return{ok:!1,message:"sessionId is required (alphanumeric with - or _)"};if("string"!=typeof n||!n.startsWith("/")||n.length>4096)return{ok:!1,message:"cwd must be an absolute path"};if(void 0!==a&&("number"!=typeof a||!Number.isInteger(a)||a<=0))return{ok:!1,message:"pid must be a positive integer"};let k=f(i,"host");if(!k.ok)return k;if(void 0!==k.value&&k.value.length>255)return{ok:!1,message:"host too long (max 255 chars)"};let v=A(u,"managerId");if(!v.ok)return v;let p=f(l,"boxId");if(!p.ok)return p;let c=f(m,"boxJobId");return c.ok?p.value&&c.value?{ok:!1,message:"send either boxId or boxJobId, not both"}:{ok:!0,value:{agent:r,sessionId:o,cwd:n,...void 0!==a?{pid:a}:{},...k.value?{host:k.value}:{},...v.value?{managerId:v.value}:{},..."string"==typeof d?{tmuxPane:d}:{},..."string"==typeof g?{tmuxSession:g}:{},...p.value?{boxId:p.value}:{},...c.value?{boxJobId:c.value}:{}}}:c},"parseManagerMessage",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=h(e.text);if(!t.ok)return t;let{prNumber:r,repo:o}=e;if(void 0!==r&&("number"!=typeof r||!Number.isInteger(r)||r<=0))return{ok:!1,message:"prNumber must be a positive integer"};if(void 0!==o){if("string"!=typeof o||!j.test(o))return{ok:!1,message:"repo must be owner/name"};if(void 0===r)return{ok:!1,message:"repo needs prNumber"}}return{ok:!0,value:{text:t.value,...void 0!==r?{prNumber:r}:{},...void 0!==o?{repo:o}:{}}}},"parseManagerNote",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=h(e.text);if(!t.ok)return t;let{kind:r}=e;return void 0===r||c.includes(r)?{ok:!0,value:{text:t.value,...r?{kind:r}:{}}}:{ok:!1,message:`kind must be one of ${c.join(", ")}`}},"parseManagerStart",0,function(e,t=b){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{agent:r,sessionId:o,restart:n}=e;if("string"!=typeof r||!t.includes(r))return{ok:!1,message:`agent must be one of ${t.join(", ")}`};let a=f(o,"sessionId");if(!a.ok)return a;if(void 0!==a.value&&!S.test(a.value))return{ok:!1,message:"sessionId must be alphanumeric with - or _"};let i=m(n,"restart");return i.ok?{ok:!0,value:{agent:r,...a.value?{sessionId:a.value}:{},...void 0!==i.value?{restart:i.value}:{}}}:i},"parseOpenIn",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{app:t}=e;return"string"==typeof t&&l.includes(t)?{ok:!0,value:{app:t}}:{ok:!1,message:`app must be one of ${l.join(", ")}`,details:{got:t}}},"parseProject",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{path:t,parent:r,name:o,git:n}=e,i="string"==typeof t&&t.length>0,u=void 0!==r||void 0!==o||void 0!==n;if(i&&u)return{ok:!1,message:"send either { path } or { parent, name }, not both"};if(i)return{ok:!0,value:{kind:"register",path:t}};if(!u)return{ok:!1,message:"path (register a folder) or parent + name (create one) is required"};if("string"!=typeof r||0===r.length)return{ok:!1,message:"parent is required (absolute directory path)"};if("string"!=typeof o||!a.test(o))return{ok:!1,message:"name must be a single folder name (letters, digits, . _ -; no leading dot, no slashes)"};let l=m(n,"git");return l.ok?{ok:!0,value:{kind:"create",parent:r,name:o,git:l.value??!1}}:l},"parseProviderCredentials",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t={};for(let[r,o]of Object.entries(e)){if("string"!=typeof o)return{ok:!1,message:`field ${r} must be a string`};t[r]=o}return 0===Object.keys(t).length?{ok:!1,message:"at least one credential field is required"}:{ok:!0,value:t}},"parseProviderPrepare",0,function(e){if(null==e)return{ok:!0,value:{}};if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{force:t,agentSettings:o,agents:n,build:a,size:i,location:u,name:l}=e,d=m(t,"force");if(!d.ok)return d;let k=function(e){if(void 0===e)return{ok:!0,value:void 0};let t={ok:!1,message:"agentSettings must be an object of {agent: {key: string|boolean}}"};if(!s(e))return t;let r={};for(let[o,n]of Object.entries(e)){if(!s(n))return t;let e={};for(let[r,o]of Object.entries(n)){if("string"!=typeof o&&"boolean"!=typeof o)return t;e[r]=o}r[o]=e}return{ok:!0,value:Object.keys(r).length>0?r:void 0}}(o);if(!k.ok)return k;let v=g(n,"agents");if(!v.ok)return v;if(void 0!==(v.value??[]).find(e=>!r.includes(e)))return{ok:!1,message:`agents must each be one of ${r.join(", ")}`};let p=m(a,"build");if(!p.ok)return p;let b=f(i,"size");if(!b.ok)return b;let c=f(u,"location");if(!c.ok)return c;let y=f(l,"name");return y.ok?{ok:!0,value:{force:d.value,agentSettings:k.value,agents:v.value,build:p.value,size:b.value,location:c.value,name:y.value}}:y},"parsePrune",0,function(e){if(null==e)return{ok:!0,value:{}};if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=m(e.all,"all");if(!t.ok)return t;let r=m(e.dryRun,"dryRun");if(!r.ok)return r;let o=f(e.provider,"provider");return o.ok?{ok:!0,value:{all:t.value,dryRun:r.value,provider:o.value}}:o},"parseRenameBox",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{displayName:t}=e;return"string"!=typeof t?{ok:!1,message:"displayName is required (string; empty string clears the label)"}:t.trim().length>60?{ok:!1,message:"displayName too long (max 60 chars)"}:{ok:!0,value:{displayName:t}}},"parseRestoreProject",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};if("string"!=typeof e.bot||0===e.bot.trim().length)return{ok:!1,message:"bot is required (string)"};let t=f(e.stamp,"stamp");if(!t.ok)return t;let r=f(e.name,"name");if(!r.ok)return r;let o=f(e.provider,"provider");if(!o.ok)return o;let n=f(e.into,"into");if(!n.ok)return n;if(void 0!==n.value&&n.value.length>0&&!n.value.startsWith("/"))return{ok:!1,message:"into must be an absolute path"};let a=m(e.force,"force");if(!a.ok)return a;let i=m(e.persistent,"persistent");return i.ok?{ok:!0,value:{bot:e.bot.trim(),stamp:t.value,name:r.value,provider:o.value,into:n.value,force:a.value,persistent:i.value}}:i},"parseServiceRestart",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=f(e.name,"name");return t.ok?{ok:!0,value:{name:t.value}}:t},"parseSizeCheck",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=f(e.size,"size");return t.ok?void 0===t.value?{ok:!1,message:"size is required"}:{ok:!0,value:t.value}:t},"parseTaskAssign",0,function(e,t={}){let r;if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{ids:o,boxId:n,boxJobId:a}=e;if(t.requireIds||void 0!==o){let e=I(o,"ids");if(!e.ok)return e;r=e.value}let i=f(n,"boxId");if(!i.ok)return i;let u=f(a,"boxJobId");if(!u.ok)return u;if(!i.value&&!u.value)return{ok:!1,message:"boxId or boxJobId is required"};if(i.value&&u.value)return{ok:!1,message:"send either boxId or boxJobId, not both"};let l=y(e.note);return l.ok?{ok:!0,value:{...r?{ids:r}:{},...i.value?{boxId:i.value}:{},...u.value?{boxJobId:u.value}:{},...l.value?{note:l.value}:{}}}:l},"parseTaskCreate",0,function(e){let t;if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{title:r,description:o,projectId:n,dependsOn:a,createdBy:i,externalRef:u,boxId:l,boxJobId:m}=e,d=A(e.managerId,"managerId");if(!d.ok)return d;let g=y(e.note);if(!g.ok)return g;if("string"!=typeof r||0===r.trim().length)return{ok:!1,message:"title is required (non-empty string)"};if(r.length>300)return{ok:!1,message:"title too long (max 300 chars)"};let k=f(o,"description");if(!k.ok)return k;let v=f(n,"projectId");if(!v.ok)return v;let p=x(u);if(!p.ok)return p;let b=f(l,"boxId");if(!b.ok)return b;let c=f(m,"boxJobId");if(!c.ok)return c;if(b.value&&c.value)return{ok:!1,message:"send either boxId or boxJobId, not both"};if(void 0!==i&&"human"!==i&&"manager"!==i&&"api"!==i)return{ok:!1,message:"createdBy must be one of human, manager, api"};if(void 0!==a){let e=I(a,"dependsOn");if(!e.ok)return e;t=e.value}return{ok:!0,value:{title:r.trim(),...k.value?{description:k.value}:{},...v.value?{projectId:v.value}:{},...t?{dependsOn:t}:{},...i?{createdBy:i}:{},...p.value?{externalRef:p.value}:{},...b.value?{boxId:b.value}:{},...c.value?{boxJobId:c.value}:{},...d.value?{managerId:d.value}:{},...g.value?{note:g.value}:{}}}},"parseTaskReorder",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let t=I(e.ids,"ids");if(!t.ok)return t;let r=y(e.note);return r.ok?{ok:!0,value:{ids:t.value,...r.value?{note:r.value}:{}}}:r},"parseTaskUpdate",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{title:t,description:r,status:o,projectId:n,dependsOn:a,externalRef:i,managerId:u}=e,l={};if(void 0!==t){if("string"!=typeof t||0===t.trim().length)return{ok:!1,message:"title must be a non-empty string"};if(t.length>300)return{ok:!1,message:"title too long (max 300 chars)"};l.title=t.trim()}let m=f(r,"description");if(!m.ok)return m;if(void 0!==m.value&&(l.description=m.value),void 0!==o){if(!N(o))return{ok:!1,message:`status must be one of ${v.join(", ")}`};l.status=o}if(void 0!==n){if(null!==n&&"string"!=typeof n)return{ok:!1,message:"projectId must be a string or null"};l.projectId=n}if(void 0!==a)if(Array.isArray(a)&&0===a.length)l.dependsOn=[];else{let e=I(a,"dependsOn");if(!e.ok)return e;l.dependsOn=e.value}let d=x(i);if(!d.ok)return d;if(d.value&&(l.externalRef=d.value),void 0!==u)if(null===u)l.managerId=null;else{let e=A(u,"managerId");if(!e.ok)return e;l.managerId=e.value??null}if(0===Object.keys(l).length)return{ok:!1,message:"no updatable field in body"};let g=y(e.note);return g.ok?(g.value&&(l.note=g.value),{ok:!0,value:l}):g},"parseTimelineQuery",0,function(e){let t={};for(let r of("0"===e.searchParams.get("sync")&&(t.sync=!1),["before","since"])){let o=e.searchParams.get(r);if(null===o||""===o)continue;let n=Date.parse(o);if(Number.isNaN(n))return{ok:!1,message:`${r} must be an ISO date-time`};t[r]=new Date(n).toISOString()}let r=e.searchParams.get("limit");if(null!==r&&""!==r){let e=Number(r);if(!Number.isInteger(e)||e<1||e>500)return{ok:!1,message:`limit must be an integer from 1 to ${String(500)}`};t.limit=e}return{ok:!0,value:t}},"parseWorkspaceAdd",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{path:t,name:r}=e;if("string"!=typeof t||0===t.length)return{ok:!1,message:"path is required (absolute path on the hub host)"};if(!t.startsWith("/"))return{ok:!1,message:"path must be absolute"};let o=f(r,"name");return o.ok?void 0!==o.value&&0===o.value.trim().length?{ok:!1,message:"name must not be empty"}:(o.value?.length??0)>60?{ok:!1,message:"name too long (max 60 chars)"}:{ok:!0,value:{path:t,...o.value?{name:o.value}:{}}}:o},"parseWorkspaceRename",0,function(e){if(!s(e))return{ok:!1,message:"body must be a JSON object"};let{name:t}=e;return"string"!=typeof t||0===t.trim().length?{ok:!1,message:"name is required (non-empty string)"}:t.length>60?{ok:!1,message:"name too long (max 60 chars)"}:{ok:!0,value:{name:t}}},"readJson",0,k])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=apps_hub_app_%28dashboard%29_api_v1_lib_validate_ts_16dhbzz._.js.map
|
package/runtime/hub/apps/hub/.next/server/chunks/packages_relay_dist_control-plane_03a-9aj.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
module.exports=[7876,
|
|
2
|
-
`};let a="",s="",n="";try{let{path:t}=
|
|
1
|
+
module.exports=[7876,47400,54434,t=>{"use strict";var e=t.i(24868),r=t.i(46786),a=t.i(14747),s=t.i(72939),n=t.i(54799),i=t.i(22734),o=t.i(25206);t.i(33405);var d=t.i(46063);t.i(18908),t.i(29220);var l=class{map=new Map;register(t){this.map.set(t.boxId,t)}forget(t){return this.map.delete(t)}authenticate(t){if(0===t.length)return null;for(let e of this.map.values())if(e.token===t)return e;return null}get(t){return this.map.get(t)}list(){return[...this.map.values()]}size(){return this.map.size}},u=class{constructor(t=1e3){this.capacity=t}capacity;buf=[];nextId=1;append(t){let e={id:this.nextId++,receivedAt:new Date().toISOString(),...t};return this.buf.push(e),this.buf.length>this.capacity&&this.buf.shift(),e}since(t,e){let r=[];for(let a of this.buf)!(a.id<=t)&&(e&&a.boxId!==e||r.push(a));return r}all(){return this.buf.slice()}size(){return this.buf.length}};function c(t,e,s){let n=e.toLowerCase().replace(/-/g,"_").replace(/[^a-z0-9_]+/g,"_").replace(/_+/g,"_").replace(/^_+|_+$/g,"").slice(0,32)||"unnamed",i="number"==typeof s&&Number.isFinite(s)&&s>0?`${t}-${String(s)}-${n}`:`${t}-${n}`;return(0,a.join)((0,r.homedir)(),".agentbox","boxes",i)}function p(t){return"object"==typeof t&&null!==t&&1===t.schema&&"string"==typeof t.boxId&&t.boxId.length>0}function h(t){let e=(0,s.normalizeAgentStatus)(t);return 0===Object.keys(e).length?t:{...t,agents:e}}var m=class{map=new Map;get(t){return this.map.get(t)}async set(t,r,s,n){this.map.set(t,n);let i=(0,a.join)(c(t,r,s),"status.json"),o=`${i}.${String(process.pid)}.tmp`;try{await (0,e.mkdir)(c(t,r,s),{recursive:!0}),await (0,e.writeFile)(o,JSON.stringify(n),"utf8"),await (0,e.rename)(o,i)}catch{await (0,e.rm)(o,{force:!0}).catch(()=>{})}}delete(t){this.map.delete(t)}list(){return[...this.map.entries()].map(([t,e])=>({boxId:t,status:e}))}},g=class{registry;events;statusStore;prompts=new Map;createJobs=new Map;constructor(t={}){this.registry=t.registry??new l,this.events=t.events??new u,this.statusStore=t.statusStore??new m}registerBox(t){return this.registry.register(t),Promise.resolve()}getBox(t){return Promise.resolve(this.registry.get(t))}authenticateBox(t){return Promise.resolve(this.registry.authenticate(t))}listBoxes(){return Promise.resolve(this.registry.list())}forgetBox(t){return Promise.resolve(this.registry.forget(t))}countBoxes(){return Promise.resolve(this.registry.size())}appendEvent(t){return Promise.resolve(this.events.append(t))}listEvents(t,e){return Promise.resolve(this.events.since(t,e))}countEvents(){return Promise.resolve(this.events.size())}setStatus(t,e,r,a){return this.statusStore.set(t,e,r,a)}getStatus(t){return Promise.resolve(this.statusStore.get(t))}deleteStatus(t){return this.statusStore.delete(t),Promise.resolve()}listStatuses(){return Promise.resolve(this.statusStore.list())}createPrompt(t){return this.prompts.set(t.id,{...t}),Promise.resolve()}getPrompt(t){let e=this.prompts.get(t);return Promise.resolve(e?{...e}:null)}answerPrompt(t,e,r){let a=this.prompts.get(t);return a&&"pending"===a.status?(a.status="answered",a.answer=e,a.cancelled=r,Promise.resolve(!0)):Promise.resolve(!1)}listPendingPrompts(t){let e=[];for(let r of this.prompts.values())r.boxId===t&&"pending"===r.status&&e.push({...r});return Promise.resolve(e)}setPromptResult(t,e){let r=this.prompts.get(t);return r&&(r.result=e),Promise.resolve()}enqueueCreateJob(t){return this.createJobs.set(t.id,{...t}),Promise.resolve()}getCreateJob(t){let e=this.createJobs.get(t);return Promise.resolve(e?{...e}:null)}listCreateJobs(t){let e=t?.status,r=[...this.createJobs.values()].filter(t=>!e||e.includes(t.status)).sort((t,e)=>e.createdAt.localeCompare(t.createdAt)).map(t=>({...t}));return Promise.resolve(t?.limit?r.slice(0,t.limit):r)}claimNextCreateJob(t){let e=[...this.createJobs.values()].filter(t=>"queued"===t.status).sort((t,e)=>t.createdAt.localeCompare(e.createdAt))[0];return e?(e.status="running",e.claimedBy=t,e.startedAt=new Date().toISOString(),Promise.resolve({...e})):Promise.resolve(null)}completeCreateJob(t,e,r){let a=this.createJobs.get(t);return a&&(a.status=e,a.result=r,a.finishedAt=new Date().toISOString()),Promise.resolve()}};async function b(t,e,r,a,s){if("off"===process.env.AGENTBOX_PROMPT||t.consumeAutoApprove(r,a))return{answer:"y"};let i={id:(0,n.randomUUID)(),...a},o=t.add(r,i);if(e.broadcast(r,"prompt-ask",i),s?.ttlMs!==void 0&&s.ttlMs>0){let n=setTimeout(()=>{t.resolve(i.id,a.defaultAnswer??"n",!0)&&e.broadcast(r,"prompt-resolved",{id:i.id})},s.ttlMs);"function"==typeof n.unref&&n.unref(),o.then(()=>{clearTimeout(n)})}return o}async function x(t,e,r,a,s){if("block"===t.mode){if(!t.prompts||!t.subscribers)return{kind:"deny"};let r=await b(t.prompts,t.subscribers,e,s);return"y"!==r.answer||r.cancelled?{kind:"deny"}:{kind:"allow"}}if("off"===process.env.AGENTBOX_PROMPT)return{kind:"allow"};let i=await t.store.getBox(e);if(i?.autoApproveHostActions)return await t.store.appendEvent({boxId:e,type:"host-action-auto-approved",payload:{command:s.context?.command,argv:s.context?.argv,message:s.message}}),{kind:"allow"};let o=(0,n.randomUUID)(),d={id:o,...s};return await t.store.createPrompt({id:o,boxId:e,ev:d,method:r,params:a,status:"pending",createdAt:new Date().toISOString()}),t.subscribers?.broadcast(e,"prompt-ask",d),{kind:"pending",promptId:o}}function w(t,e){let r=t.worktrees??[];if(0===r.length)return null;let a=r.find(t=>t.containerPath===e);return a||(r.filter(t=>e===t.containerPath||e.startsWith(t.containerPath+"/")).sort((t,e)=>e.containerPath.length-t.containerPath.length)[0]??r.find(t=>"/workspace"===t.containerPath)??null)}function y(t){let e,r,a,s=t.trim();if(0===s.length)throw Error("empty git remote URL");let n=/^([a-z][a-z0-9+.-]*):\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/(.+)$/i.exec(s),i=/^(?:[^@/]+@)?([^/:]+):(.+)$/.exec(s);if(n)a=n[1].toLowerCase(),e=n[2],r=n[3];else if(i&&!/^[a-z][a-z0-9+.-]*:\/\//i.test(s))a=null,e=i[1],r=i[2];else throw Error(`unrecognized git remote URL: ${t}`);return{host:e,path:r.replace(/^\/+/,""),scheme:a}}function f(t,e){let{host:r,path:a}=y(t);return`https://x-access-token:${e}@${r}/${a}`}function v(t){let{host:e,path:r}=y(t),a=r.replace(/\.git$/,"");return"github.com"===e.toLowerCase()?a:`${e}/${a}`}async function S(t,e){if(!t)return{exitCode:64,stdout:"",stderr:"git.lease-token: no GitHub App configured on this relay\n"};let r=e.originUrl;if(!r)return{exitCode:64,stdout:"",stderr:`git.lease-token: box ${e.boxId} has no registered origin URL
|
|
2
|
+
`};let a="",s="",n="";try{let{path:t}=y(r),[e,i]=t.replace(/\.git$/,"").split("/");a=e??"",s=i??"",n=v(r)}catch{return{exitCode:65,stdout:"",stderr:`git.lease-token: unrecognized origin ${r}
|
|
3
3
|
`}}if(!a||!s)return{exitCode:65,stdout:"",stderr:`git.lease-token: cannot derive owner/repo from ${r}
|
|
4
4
|
`};try{let e=await t.leaseRepoToken(a,s),i={token:e.token,expiresAt:e.expiresAt,remoteUrl:f(r,e.token),repo:n};return{exitCode:0,stdout:JSON.stringify(i),stderr:""}}catch(t){return{exitCode:1,stdout:"",stderr:`git.lease-token: ${t instanceof Error?t.message:String(t)}
|
|
5
|
-
`}}}var A=new Set(["registerBox","getBox","authenticateBox","listBoxes","forgetBox","countBoxes","appendEvent","listEvents","countEvents","setStatus","getStatus","deleteStatus","listStatuses","createPrompt","getPrompt","answerPrompt","listPendingPrompts","setPromptResult"]);async function I(t,e){var r,a;let s,i;if("/admin/store"!==t.path)return null;let o=e.adminToken??"";if(0===o.length)return{status:503,body:{error:"control plane not configured: admin token unset"}};if(r=t.bearer,s=Buffer.from(r,"utf8"),i=Buffer.from(o,"utf8"),!(s.length===i.length&&(0,n.timingSafeEqual)(s,i)))return{status:401,body:{error:"invalid admin token"}};if("POST"!==t.method)return{status:405,body:{error:"method not allowed"}};let d=function(t){if(0===t.length)return null;try{return JSON.parse(t)}catch{return null}}(t.bodyText);return d&&"string"==typeof d.method&&Array.isArray(d.args)?(a=d.method,A.has(a))?{status:200,body:{result:await function(t,e,r){switch(e){case"registerBox":return t.registerBox(r[0]);case"getBox":return t.getBox(r[0]);case"authenticateBox":return t.authenticateBox(r[0]);case"listBoxes":return t.listBoxes();case"forgetBox":return t.forgetBox(r[0]);case"countBoxes":return t.countBoxes();case"appendEvent":return t.appendEvent(r[0]);case"listEvents":return t.listEvents(r[0],r[1]);case"countEvents":return t.countEvents();case"setStatus":return t.setStatus(r[0],r[1],r[2],r[3]);case"getStatus":return t.getStatus(r[0]);case"deleteStatus":return t.deleteStatus(r[0]);case"listStatuses":return t.listStatuses();case"createPrompt":return t.createPrompt(r[0]);case"getPrompt":return t.getPrompt(r[0]);case"answerPrompt":return t.answerPrompt(r[0],r[1],r[2]);case"listPendingPrompts":return t.listPendingPrompts(r[0]);case"setPromptResult":return t.setPromptResult(r[0],r[1]);default:throw Error(`unknown store op: ${e}`)}}(e.store,d.method,d.args)??null}}:{status:400,body:{error:`unknown store op: ${d.method}`}}:{status:400,body:{error:"expected {method, args}"}}}var E=["agents","projects","boxes","prepared"],T=class extends Error{constructor(t){super(`payload exceeds the custody blob cap of ${String(t)} bytes`),this.maxBytes=t,this.name="CustodyTooLargeError"}maxBytes},N=class extends Error{constructor(t){super(t),this.name="CustodyPathError"}},P=/^[A-Za-z0-9._-]+$/;function _(t){return(0,n.createHash)("sha256").update(t).digest("hex")}function $(t){let e=t.replace(/^\/+/,"").replace(/\/+$/,"");if(0===e.length)throw new N("empty custody path");if(e.length>256)throw new N(`custody path too long (max ${String(256)} chars)`);let r=e.split("/");if(r.length<2)throw new N(`custody path needs a scope and a name: '${t}'`);if(r.length>6)throw new N(`custody path too deep (max ${String(6)} segments)`);for(let t of r)if("."===t||".."===t||!P.test(t))throw new N(`illegal custody path segment: '${t}'`);let a=r[0];if(!E.includes(a))throw new N(`unknown custody scope '${a}' (expected ${E.join(" | ")})`);if("agents"===a&&!(0,o.agentIds)().includes(r[1]))throw new N(`unknown agent '${r[1]}' (expected ${(0,o.agentIds)().join(" | ")})`);return r.join("/")}function k(t){let e=t.replace(/^\/+/,"").replace(/\/+$/,"");if(0===e.length)return"";if(e.length>256)throw new N(`custody prefix too long (max ${String(256)} chars)`);let r=e.split("/");if(r.length>6)throw new N(`custody prefix too deep (max ${String(6)} segments)`);for(let t of r)if("."===t||".."===t||!P.test(t))throw new N(`illegal custody prefix segment: '${t}'`);if(!E.includes(r[0]))throw new N(`unknown custody scope '${r[0]}' (expected ${E.join(" | ")})`);return r.join("/")}var B="/admin/custody";async function C(t,e){var r,a;let s,i;if(!((r=t.path)===B||r.startsWith(`${B}/`)))return null;let o=e.log??(()=>{}),d=e.adminToken??"";if(0===d.length)return{status:503,body:{error:"custody not configured: admin token unset"}};if(a=t.bearer,s=Buffer.from(a,"utf8"),i=Buffer.from(d,"utf8"),!(s.length===i.length&&(0,n.timingSafeEqual)(s,i)))return{status:401,body:{error:"invalid admin token"}};let l=e.custody;if(!l)return{status:503,body:{error:"custody store not enabled on this relay"}};try{if(t.path===B){if("GET"!==t.method)return{status:405,body:{error:"method not allowed"}};let e=t.query.get("prefix"),r=e?k(e):void 0,a=await l.list(r);return{status:200,body:{entries:a}}}let e=$(decodeURIComponent(t.path.slice(`${B}/`.length)));if("PUT"===t.method){let r;try{r=JSON.parse(0===t.bodyText.length?"{}":t.bodyText)}catch{return{status:400,body:{error:"expected JSON {data: <base64>}"}}}if("string"!=typeof r.data)return{status:400,body:{error:"expected {data: <base64>}"}};let a=Buffer.from(r.data,"base64");if(a.toString("base64")!==r.data.replace(/\s+/g,""))return{status:400,body:{error:"data is not valid base64"}};let s=await l.put(e,a);return o(`custody put ${e} (${String(s.size)} bytes, ${s.changed?"changed":"unchanged"})`),{status:200,body:s}}if("GET"===t.method){let t=await l.get(e);if(!t)return{status:404,body:{error:"no such custody entry"}};return o(`custody get ${e} (${String(t.entry.size)} bytes)`),{status:200,body:{...t.entry,data:t.data.toString("base64")}}}if("DELETE"===t.method){if(!await l.delete(e))return{status:404,body:{error:"no such custody entry"}};return o(`custody delete ${e}`),{status:204}}return{status:405,body:{error:"method not allowed"}}}catch(e){if(e instanceof N)return{status:400,body:{error:e.message}};let t=e instanceof Error?e.message:String(e);return o(`custody error: ${t}`),{status:500,body:{error:`custody: ${t}`}}}}var L="/remote/boxes";async function O(t,e){var r,a;let s,i;if(!((r=t.path)===L||r.startsWith(`${L}/`)))return null;let o=e.log??(()=>{}),{store:d}=e,l=e.adminToken??"";if(0===l.length)return{status:503,body:{error:"control plane not configured: admin token unset"}};if(a=t.bearer,s=Buffer.from(a,"utf8"),i=Buffer.from(l,"utf8"),!(s.length===i.length&&(0,n.timingSafeEqual)(s,i)))return{status:401,body:{error:"invalid admin token"}};if("POST"===t.method&&t.path===L){if(!d.enqueueCreateJob)return{status:501,body:{error:"create-job queue not available on this store"}};let r=function(t){if(0===t.length)return{};try{return JSON.parse(t)}catch{return null}}(t.bodyText);if(!r||"string"!=typeof r.repoUrl||"string"!=typeof r.provider)return{status:400,body:{error:"expected {repoUrl, provider, branch?, name?, agent?, prompt?}"}};let a=e.createProviders;if(a&&a.length>0&&!a.includes(r.provider))return{status:400,body:{error:`provider '${r.provider}' is not supported by this control plane (allowed: ${a.join(", ")})`}};let s=(0,n.randomUUID)();return await d.enqueueCreateJob({id:s,status:"queued",request:{repoUrl:r.repoUrl,provider:r.provider,branch:r.branch,name:r.name,agent:r.agent,prompt:r.prompt},createdAt:new Date().toISOString()}),o(`enqueued create job ${s} (${r.provider} ${r.repoUrl})`),{status:202,body:{jobId:s}}}if("GET"===t.method&&t.path===L)return d.listCreateJobs?{status:200,body:{jobs:await d.listCreateJobs({limit:100})}}:{status:501,body:{error:"create-job queue not available on this store"}};if("GET"===t.method&&t.path.endsWith("/logs")){let r=decodeURIComponent(t.path.slice(`${L}/`.length,-5));if(0===r.length)return{status:404,body:{error:"no such job"}};if(!(r.length>0&&r.length<=128&&/^[A-Za-z0-9._-]+$/.test(r)))return{status:400,body:{error:"invalid job id"}};if(!e.readJobLog)return{status:501,body:{error:"job logs not available on this plane"}};let a=Number.parseInt(t.query?.get("offset")??"0",10);return{status:200,body:await e.readJobLog(r,Number.isFinite(a)?a:0)}}if("GET"===t.method&&t.path.startsWith(`${L}/`)){if(!d.getCreateJob)return{status:501,body:{error:"create-job queue not available on this store"}};let e=decodeURIComponent(t.path.slice(`${L}/`.length)),r=await d.getCreateJob(e);return r?{status:200,body:r}:{status:404,body:{error:"no such job"}}}if("DELETE"===t.method&&t.path.startsWith(`${L}/`)){let r=decodeURIComponent(t.path.slice(`${L}/`.length));if(0===r.length)return{status:404,body:{error:"no such box"}};let a=await d.getBox(r),s=await d.forgetBox(r);await d.deleteStatus(r);let n=0;if(e.custody){let t=a?.sandboxId??r;for(let r of(await e.custody.list(`boxes/${t}`).catch(()=>[])))await e.custody.delete(r.path).catch(()=>!1)&&(n+=1)}let i=await U(r,a?.sandboxId,o);return s||a||0!==n||i?(o(`reaped box ${r} (registration=${String(s)}, custody=${String(n)}, local=${String(i)})`),{status:200,body:{boxId:r,removed:s,custodyRemoved:n,localRemoved:i}}):{status:404,body:{error:"no such box"}}}return{status:405,body:{error:"method not allowed"}}}async function U(r,s,n){let i=!1;try{let{mutateState:n,readState:o,boxSshDirForProvider:d}=await t.A(53982),l=(await o()).boxes.find(t=>t.id===r);if(l){await n(t=>({...t,boxes:t.boxes.filter(t=>t.id!==r)})),i=!0;let t=l.cloud?.sandboxId??s,o=l.provider;if(t&&o){let r=d(o,t);r&&await (0,e.rm)((0,a.dirname)(r),{recursive:!0,force:!0}).catch(()=>{})}}}catch(t){n(`local reap for ${r} failed: ${t instanceof Error?t.message:String(t)}`)}return i}var R=class{inner;registry;events;statusStore;constructor(t,e){this.inner=t,this.registry=e.registry,this.events=e.events,this.statusStore=e.statusStore}async hydrate(){for(let t of(await this.inner.listBoxes()))this.registry.register(t);for(let{boxId:t,status:e}of(await this.inner.listStatuses())){let r=this.registry.get(t);await this.statusStore.set(t,r?.name??t,r?.projectIndex,e)}}migrate(){return this.inner.migrate?.()??Promise.resolve()}async registerBox(t){await this.inner.registerBox(t),this.registry.register(t)}getBox(t){return this.inner.getBox(t)}authenticateBox(t){return this.inner.authenticateBox(t)}listBoxes(){return this.inner.listBoxes()}async forgetBox(t){let e=await this.inner.forgetBox(t);return this.registry.forget(t),e}countBoxes(){return this.inner.countBoxes()}async appendEvent(t){let e=await this.inner.appendEvent(t);return this.events.append(t),e}listEvents(t,e){return this.inner.listEvents(t,e)}countEvents(){return this.inner.countEvents()}async setStatus(t,e,r,a){await this.inner.setStatus(t,e,r,a),await this.statusStore.set(t,e,r,a)}getStatus(t){return this.inner.getStatus(t)}async deleteStatus(t){await this.inner.deleteStatus(t),this.statusStore.delete(t)}listStatuses(){return this.inner.listStatuses()}createPrompt(t){return this.inner.createPrompt(t)}getPrompt(t){return this.inner.getPrompt(t)}answerPrompt(t,e,r){return this.inner.answerPrompt(t,e,r)}listPendingPrompts(t){return this.inner.listPendingPrompts(t)}setPromptResult(t,e){return this.inner.setPromptResult(t,e)}enqueueCreateJob(t){return this.inner.enqueueCreateJob?this.inner.enqueueCreateJob(t):Promise.resolve()}getCreateJob(t){return this.inner.getCreateJob?.(t)??Promise.resolve(null)}listCreateJobs(t){return this.inner.listCreateJobs?.(t)??Promise.resolve([])}claimNextCreateJob(t){return this.inner.claimNextCreateJob?.(t)??Promise.resolve(null)}completeCreateJob(t,e,r){return this.inner.completeCreateJob?this.inner.completeCreateJob(t,e,r):Promise.resolve()}prunePrompts(t){return this.inner.prunePrompts?.(t)??Promise.resolve(0)}pruneCreateJobs(t){return this.inner.pruneCreateJobs?.(t)??Promise.resolve(0)}};function q(t){return Buffer.from(t).toString("base64url")}function j(t,e=Date.now()){let r=Math.floor(e/1e3),a=q(JSON.stringify({alg:"RS256",typ:"JWT"})),s=q(JSON.stringify({iat:r-60,exp:r+540,iss:t.appId})),i=`${a}.${s}`,o=(0,n.createSign)("RSA-SHA256").update(i).sign(t.privateKeyPem);return`${i}.${q(o)}`}var D=class{cfg;fetchImpl;now;apiBase;cache=new Map;installationIds=new Map;constructor(t,e={}){this.cfg=t,this.fetchImpl=e.fetchImpl??fetch,this.now=e.now??Date.now,this.apiBase=(t.apiBaseUrl??"https://api.github.com").replace(/\/$/,"")}headers(t){return{Authorization:`Bearer ${t}`,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28","User-Agent":"agentbox-relay"}}async lookupInstallationId(t,e){let r=`${t}/${e}`,a=this.installationIds.get(r);if(void 0!==a)return a;let s=j(this.cfg,this.now()),n=await this.fetchImpl(`${this.apiBase}/repos/${t}/${e}/installation`,{headers:this.headers(s)});if(404===n.status)return null;if(!n.ok)throw Error(`GET installation for ${r} \u2192 ${String(n.status)}`);let i=await n.json();if("number"!=typeof i.id)throw Error("installation response missing id");return this.installationIds.set(r,i.id),i.id}async installationId(t,e){let r=await this.lookupInstallationId(t,e);if(null===r)throw Error(`GitHub App is not installed on ${t}/${e}`);return r}async isRepoInstalled(t,e){return await this.lookupInstallationId(t,e)!==null}async leaseRepoToken(t,e){let r=`${t}/${e}`,a=this.cache.get(r);if(a&&a.expiresAtMs-this.now()>3e5)return{token:a.token,expiresAt:a.expiresAt};let s=await this.installationId(t,e),n=j(this.cfg,this.now()),i=await this.fetchImpl(`${this.apiBase}/app/installations/${String(s)}/access_tokens`,{method:"POST",headers:{...this.headers(n),"Content-Type":"application/json"},body:JSON.stringify({repositories:[e],permissions:{contents:"write",pull_requests:"write"}})});if(!i.ok)throw Error(`failed to mint installation token for ${r} (\u2192 ${String(i.status)})`);let o=await i.json();if(!o.token||!o.expires_at)throw Error("access_tokens response missing token/expires_at");return this.cache.set(r,{token:o.token,expiresAt:o.expires_at,expiresAtMs:Date.parse(o.expires_at)}),{token:o.token,expiresAt:o.expires_at}}};(0,a.join)(o.STATE_DIR,"queue");var J=(0,a.join)(o.STATE_DIR,"logs");t.s(["CUSTODY_SCOPES",0,E,"CustodyTooLargeError",0,T,"GitHubAppLeaser",0,D,"MemoryStore",0,g,"QUEUE_LOGS_DIR",0,J,"RELAY_EVENT_RING_SIZE",0,1e3,"WriteThroughStore",0,R,"custodyDigest",0,_,"gateApproval",0,x,"handleCustodyRequest",0,C,"handleRemoteBoxesRequest",0,O,"handleStoreRpcRequest",0,I,"isValidBoxStatus",0,p,"leaseTokenResult",0,S,"loadGitHubAppConfig",0,function(){let t=process.env.GITHUB_APP_ID,e=process.env.GITHUB_APP_PRIVATE_KEY;if(!t||!e)return null;if(!e.includes("BEGIN"))try{e=Buffer.from(e,"base64").toString("utf8")}catch{return null}return{appId:t,privateKeyPem:e,apiBaseUrl:process.env.GITHUB_API_URL||void 0}},"normalizeBoxStatus",0,h,"normalizeCustodyPath",0,$,"normalizeCustodyPrefix",0,k,"parseGitRemote",0,w,"queueLogPath",0,function(t){return(0,a.join)(J,`queue-${t}.log`)},"repoSlugFromRemote",0,v,"resolveWorktree",0,y,"toAuthedHttpsUrl",0,f,"toHttpsUrl",0,function(t){let{host:e,path:r}=w(t);return`https://${e}/${r}`}],30385);var M=t.i(57743),z=t.i(11205),F=t.i(63080),G=t.i(56698),H=t.i(44946),X=t.i(64645),W=t.i(62160),Y=t.i(8614),K=t.i(93540),Q=t.i(21918),V=t.i(2340),Z=t.i(42631),tt=t.i(48771),te=t.i(62562),tr=t.i(28065),ta=t.i(88947);let ts={get url(){return`file://${t.P("packages/relay/dist/chunk-4ECL7BHW.js")}`}};async function tn(t,e,r,a,s,n=()=>{}){await t(s?["clone","--branch",s,e,a]:["clone",e,a],{GIT_LFS_SKIP_SMUDGE:"1"});try{await t(["-C",a,"-c",`lfs.url=${e.replace(/\.git$/,"")}.git/info/lfs`,"lfs","pull"],{GIT_TERMINAL_PROMPT:"0",GIT_SSH_COMMAND:"ssh -o BatchMode=yes -o StrictHostKeyChecking=no"},12e4)}catch(t){n(`git-lfs objects left as pointers (fetch failed): ${t instanceof Error?t.message:String(t)}`)}await t(["-C",a,"remote","set-url","origin",r])}async function ti(t,e,r){if(!t.claimNextCreateJob||!t.completeCreateJob)return null;let a=await t.claimNextCreateJob(r);if(!a)return null;try{let{boxId:r,agentStartError:s}=await e(a.request,a.id);s?await t.completeCreateJob(a.id,"failed",{boxId:r,error:s}):await t.completeCreateJob(a.id,"done",{boxId:r})}catch(e){await t.completeCreateJob(a.id,"failed",{error:e instanceof Error?e.message:String(e)})}return a.id}async function to(t,e,r,a=10){let s=0;for(;s<a&&await ti(t,e,r);)s++;return s}function td(t,e=200){return{status:e,body:t}}function tl(t,e){return{status:t,body:{error:e}}}function tu(t){if(0===t.length)return{};try{return JSON.parse(t)}catch{return null}}var tc=new Set(["git.push","git.fetch","cp.toHost","cp.fromHost","download.workspace","download.env","download.config","download.claude","checkpoint.create"]);async function tp(t,e){var r,a;let s,i,{store:o,leaser:d}=e,l=e.log??(()=>{});if(0===e.adminToken.length)return tl(503,"control plane not configured: admin token unset");if("GET"===t.method&&"/healthz"===t.path)return td({ok:!0,boxes:await o.countBoxes(),events:await o.countEvents(),controlPlane:!0});if((t.path.startsWith("/admin/")||t.path.startsWith("/remote/"))&&(r=t.bearer,a=e.adminToken,s=Buffer.from(r,"utf8"),i=Buffer.from(a,"utf8"),!(s.length===i.length&&(0,n.timingSafeEqual)(s,i))))return tl(401,"invalid admin token");let u={custody:e.custody,adminToken:e.adminToken,log:l},c=await C(t,u);if(c)return void 0===c.body?{status:c.status}:td(c.body,c.status);if("POST"===t.method&&"/events"===t.path){let e=await o.authenticateBox(t.bearer);if(!e)return tl(401,"unknown box token");let r=tu(t.bodyText);return r&&"string"==typeof r.type&&0!==r.type.length?"box-status"===r.type?p(r.payload)?(await o.setStatus(e.boxId,e.name,e.projectIndex,h(r.payload)),td({ok:!0},202)):tl(400,"invalid box-status payload"):td({id:(await o.appendEvent({boxId:e.boxId,type:r.type,ts:"string"==typeof r.ts?r.ts:void 0,payload:r.payload})).id},202):tl(400,'missing "type" string')}if("POST"===t.method&&"/rpc"===t.path){let r=await o.authenticateBox(t.bearer);if(!r)return tl(401,"unknown box token");let a=tu(t.bodyText);return a&&"string"==typeof a.method&&0!==a.method.length?(l(`rpc box=${r.boxId} method=${a.method}`),th(r,a.method,a.params,e)):tl(400,'missing "method" string')}if("GET"===t.method&&t.path.startsWith("/rpc/status/")){let e=await o.authenticateBox(t.bearer);if(!e)return tl(401,"unknown box token");let r=decodeURIComponent(t.path.slice(12)),a=await o.getPrompt(r);if(!a||a.boxId!==e.boxId)return tl(404,"no such prompt");if("pending"===a.status)return td({status:"pending"});if("y"!==a.answer||a.cancelled)return td({status:"done",result:{exitCode:10,stdout:"",stderr:"denied by user\n"}});let s=a.result,n=s??await tm(e,a.method,d);return s||await o.setPromptResult(r,n),td({status:"done",result:n})}if("POST"===t.method&&"/admin/register-box"===t.path){let e=tu(t.bodyText);if(!e||!e.boxId||!e.token||"string"!=typeof e.name)return tl(400,"expected {boxId, token, name}");let r={boxId:e.boxId,token:e.token,name:e.name,kind:"cloud"===e.kind?"cloud":"docker",backend:e.backend||void 0,sandboxId:e.sandboxId||void 0,registeredAt:new Date().toISOString(),containerName:e.containerName||void 0,createdAt:e.createdAt||void 0,projectIndex:"number"==typeof e.projectIndex&&e.projectIndex>0?Math.trunc(e.projectIndex):void 0,worktrees:Array.isArray(e.worktrees)?e.worktrees:void 0,previewUrl:e.previewUrl||void 0,previewToken:e.previewToken||void 0,bridgeToken:e.bridgeToken||void 0,autoApproveHostActions:!0===e.autoApproveHostActions,autoApproveSafeHostActions:!1!==e.autoApproveSafeHostActions,originUrl:e.originUrl||void 0};return await o.registerBox(r),l(`registered ${r.kind??"docker"} box ${r.boxId} (${r.name})`),td(null,204)}if("POST"===t.method&&"/admin/forget-box"===t.path){let e=tu(t.bodyText);return e?.boxId?(await o.forgetBox(e.boxId),await o.deleteStatus(e.boxId),td(null,204)):tl(400,"expected {boxId}")}if("GET"===t.method&&"/admin/box-status"===t.path){let e=t.query.get("box")??"",r=e?await o.getStatus(e):void 0;return r?td(r):tl(404,"no status for box")}if("GET"===t.method&&"/admin/events"===t.path){let e=Number.parseInt(t.query.get("since")??"0",10)||0,r=t.query.get("box")??void 0;return td({events:await o.listEvents(e,r??void 0)})}if("GET"===t.method&&"/admin/app/repo-installed"===t.path){if(!d)return tl(503,"no GitHub App configured on this control plane");let e=t.query.get("owner")??"",r=t.query.get("repo")??"";if(!e||!r)return tl(400,"missing owner/repo query params");try{return td({installed:await d.isRepoInstalled(e,r)})}catch(t){return tl(502,`installation check failed: ${t instanceof Error?t.message:String(t)}`)}}if("GET"===t.method&&"/admin/registry"===t.path)return td({boxes:(await o.listBoxes()).map(t=>({boxId:t.boxId,name:t.name,kind:t.kind,registeredAt:t.registeredAt,projectIndex:t.projectIndex,originUrl:t.originUrl}))});if("GET"===t.method&&"/admin/prompts"===t.path){let e=t.query.get("boxId")??"";return 0===e.length?tl(400,"missing boxId query param"):td({prompts:(await o.listPendingPrompts(e)).map(t=>t.ev)})}if("POST"===t.method&&"/admin/prompts/answer"===t.path){let e=tu(t.bodyText);return e?.id&&("y"===e.answer||"n"===e.answer)?await o.answerPrompt(e.id,e.answer,e.cancelled)?td(null,204):tl(404,"no pending prompt with that id"):tl(400,'expected {id, answer:"y"|"n", cancelled?}')}let m=await I(t,{store:o,adminToken:e.adminToken,log:l});if(m)return void 0===m.body?{status:m.status}:td(m.body,m.status);let g=await O(t,{store:o,adminToken:e.adminToken,createProviders:e.createProviders,custody:e.custody,log:l});return g?void 0===g.body?{status:g.status}:td(g.body,g.status):tl(404,"not found")}async function th(t,e,r,a){if("git.lease-token"===e){let n=y(t,r?.path??"/workspace");if(!(0,s.isScratchBranch)(n?.branch)){let s=await x({mode:"poll",store:a.store},t.boxId,e,r,{kind:"confirm",message:`Allow box ${t.name} to lease a push token for ${t.originUrl??"its repo"}?`,detail:`branch ${n?.branch??"(unregistered)"}`,defaultAnswer:"n",context:{command:"git lease-token",cwd:r?.path}});if("pending"===s.kind)return td({status:"pending",promptId:s.promptId},202);if("deny"===s.kind)return td({exitCode:10,stdout:"",stderr:"denied by user\n"},500)}let i=await S(a.leaser,t);return td(i,0===i.exitCode?200:500)}return"browser.open"===e?("string"==typeof r?.url&&await a.store.appendEvent({boxId:t.boxId,type:"browser-open",payload:{url:r.url}}),td({exitCode:0,stdout:"",stderr:""})):tc.has(e)?td({exitCode:64,stdout:"",stderr:`${e}: not available on the hosted control plane (no host). Cloud boxes push via git.lease-token.
|
|
5
|
+
`}}}var A=new Set(["registerBox","getBox","authenticateBox","listBoxes","forgetBox","countBoxes","appendEvent","listEvents","countEvents","setStatus","getStatus","deleteStatus","listStatuses","createPrompt","getPrompt","answerPrompt","listPendingPrompts","setPromptResult"]);async function I(t,e){var r,a;let s,i;if("/admin/store"!==t.path)return null;let o=e.adminToken??"";if(0===o.length)return{status:503,body:{error:"control plane not configured: admin token unset"}};if(r=t.bearer,s=Buffer.from(r,"utf8"),i=Buffer.from(o,"utf8"),!(s.length===i.length&&(0,n.timingSafeEqual)(s,i)))return{status:401,body:{error:"invalid admin token"}};if("POST"!==t.method)return{status:405,body:{error:"method not allowed"}};let d=function(t){if(0===t.length)return null;try{return JSON.parse(t)}catch{return null}}(t.bodyText);return d&&"string"==typeof d.method&&Array.isArray(d.args)?(a=d.method,A.has(a))?{status:200,body:{result:await function(t,e,r){switch(e){case"registerBox":return t.registerBox(r[0]);case"getBox":return t.getBox(r[0]);case"authenticateBox":return t.authenticateBox(r[0]);case"listBoxes":return t.listBoxes();case"forgetBox":return t.forgetBox(r[0]);case"countBoxes":return t.countBoxes();case"appendEvent":return t.appendEvent(r[0]);case"listEvents":return t.listEvents(r[0],r[1]);case"countEvents":return t.countEvents();case"setStatus":return t.setStatus(r[0],r[1],r[2],r[3]);case"getStatus":return t.getStatus(r[0]);case"deleteStatus":return t.deleteStatus(r[0]);case"listStatuses":return t.listStatuses();case"createPrompt":return t.createPrompt(r[0]);case"getPrompt":return t.getPrompt(r[0]);case"answerPrompt":return t.answerPrompt(r[0],r[1],r[2]);case"listPendingPrompts":return t.listPendingPrompts(r[0]);case"setPromptResult":return t.setPromptResult(r[0],r[1]);default:throw Error(`unknown store op: ${e}`)}}(e.store,d.method,d.args)??null}}:{status:400,body:{error:`unknown store op: ${d.method}`}}:{status:400,body:{error:"expected {method, args}"}}}var T=["agents","projects","boxes","prepared"],E=class extends Error{constructor(t){super(`payload exceeds the custody blob cap of ${String(t)} bytes`),this.maxBytes=t,this.name="CustodyTooLargeError"}maxBytes},N=class extends Error{constructor(t){super(t),this.name="CustodyPathError"}},P=/^[A-Za-z0-9._-]+$/;function _(t){return(0,n.createHash)("sha256").update(t).digest("hex")}function $(t){let e=t.replace(/^\/+/,"").replace(/\/+$/,"");if(0===e.length)throw new N("empty custody path");if(e.length>256)throw new N(`custody path too long (max ${String(256)} chars)`);let r=e.split("/");if(r.length<2)throw new N(`custody path needs a scope and a name: '${t}'`);if(r.length>6)throw new N(`custody path too deep (max ${String(6)} segments)`);for(let t of r)if("."===t||".."===t||!P.test(t))throw new N(`illegal custody path segment: '${t}'`);let a=r[0];if(!T.includes(a))throw new N(`unknown custody scope '${a}' (expected ${T.join(" | ")})`);if("agents"===a&&!(0,o.agentIds)().includes(r[1]))throw new N(`unknown agent '${r[1]}' (expected ${(0,o.agentIds)().join(" | ")})`);return r.join("/")}function k(t){let e=t.replace(/^\/+/,"").replace(/\/+$/,"");if(0===e.length)return"";if(e.length>256)throw new N(`custody prefix too long (max ${String(256)} chars)`);let r=e.split("/");if(r.length>6)throw new N(`custody prefix too deep (max ${String(6)} segments)`);for(let t of r)if("."===t||".."===t||!P.test(t))throw new N(`illegal custody prefix segment: '${t}'`);if(!T.includes(r[0]))throw new N(`unknown custody scope '${r[0]}' (expected ${T.join(" | ")})`);return r.join("/")}var B="/admin/custody";async function C(t,e){var r,a;let s,i;if(!((r=t.path)===B||r.startsWith(`${B}/`)))return null;let o=e.log??(()=>{}),d=e.adminToken??"";if(0===d.length)return{status:503,body:{error:"custody not configured: admin token unset"}};if(a=t.bearer,s=Buffer.from(a,"utf8"),i=Buffer.from(d,"utf8"),!(s.length===i.length&&(0,n.timingSafeEqual)(s,i)))return{status:401,body:{error:"invalid admin token"}};let l=e.custody;if(!l)return{status:503,body:{error:"custody store not enabled on this relay"}};try{if(t.path===B){if("GET"!==t.method)return{status:405,body:{error:"method not allowed"}};let e=t.query.get("prefix"),r=e?k(e):void 0,a=await l.list(r);return{status:200,body:{entries:a}}}let e=$(decodeURIComponent(t.path.slice(`${B}/`.length)));if("PUT"===t.method){let r;try{r=JSON.parse(0===t.bodyText.length?"{}":t.bodyText)}catch{return{status:400,body:{error:"expected JSON {data: <base64>}"}}}if("string"!=typeof r.data)return{status:400,body:{error:"expected {data: <base64>}"}};let a=Buffer.from(r.data,"base64");if(a.toString("base64")!==r.data.replace(/\s+/g,""))return{status:400,body:{error:"data is not valid base64"}};let s=await l.put(e,a);return o(`custody put ${e} (${String(s.size)} bytes, ${s.changed?"changed":"unchanged"})`),{status:200,body:s}}if("GET"===t.method){let t=await l.get(e);if(!t)return{status:404,body:{error:"no such custody entry"}};return o(`custody get ${e} (${String(t.entry.size)} bytes)`),{status:200,body:{...t.entry,data:t.data.toString("base64")}}}if("DELETE"===t.method){if(!await l.delete(e))return{status:404,body:{error:"no such custody entry"}};return o(`custody delete ${e}`),{status:204}}return{status:405,body:{error:"method not allowed"}}}catch(e){if(e instanceof N)return{status:400,body:{error:e.message}};let t=e instanceof Error?e.message:String(e);return o(`custody error: ${t}`),{status:500,body:{error:`custody: ${t}`}}}}var L="/remote/boxes";async function O(t,e){var r,a;let s,i;if(!((r=t.path)===L||r.startsWith(`${L}/`)))return null;let o=e.log??(()=>{}),{store:d}=e,l=e.adminToken??"";if(0===l.length)return{status:503,body:{error:"control plane not configured: admin token unset"}};if(a=t.bearer,s=Buffer.from(a,"utf8"),i=Buffer.from(l,"utf8"),!(s.length===i.length&&(0,n.timingSafeEqual)(s,i)))return{status:401,body:{error:"invalid admin token"}};if("POST"===t.method&&t.path===L){if(!d.enqueueCreateJob)return{status:501,body:{error:"create-job queue not available on this store"}};let r=function(t){if(0===t.length)return{};try{return JSON.parse(t)}catch{return null}}(t.bodyText);if(!r||"string"!=typeof r.repoUrl||"string"!=typeof r.provider)return{status:400,body:{error:"expected {repoUrl, provider, branch?, name?, agent?, prompt?}"}};let a=e.createProviders;if(a&&a.length>0&&!a.includes(r.provider))return{status:400,body:{error:`provider '${r.provider}' is not supported by this control plane (allowed: ${a.join(", ")})`}};let s=(0,n.randomUUID)();return await d.enqueueCreateJob({id:s,status:"queued",request:{repoUrl:r.repoUrl,provider:r.provider,branch:r.branch,name:r.name,agent:r.agent,prompt:r.prompt},createdAt:new Date().toISOString()}),o(`enqueued create job ${s} (${r.provider} ${r.repoUrl})`),{status:202,body:{jobId:s}}}if("GET"===t.method&&t.path===L)return d.listCreateJobs?{status:200,body:{jobs:await d.listCreateJobs({limit:100})}}:{status:501,body:{error:"create-job queue not available on this store"}};if("GET"===t.method&&t.path.endsWith("/logs")){let r=decodeURIComponent(t.path.slice(`${L}/`.length,-5));if(0===r.length)return{status:404,body:{error:"no such job"}};if(!(r.length>0&&r.length<=128&&/^[A-Za-z0-9._-]+$/.test(r)))return{status:400,body:{error:"invalid job id"}};if(!e.readJobLog)return{status:501,body:{error:"job logs not available on this plane"}};let a=Number.parseInt(t.query?.get("offset")??"0",10);return{status:200,body:await e.readJobLog(r,Number.isFinite(a)?a:0)}}if("GET"===t.method&&t.path.startsWith(`${L}/`)){if(!d.getCreateJob)return{status:501,body:{error:"create-job queue not available on this store"}};let e=decodeURIComponent(t.path.slice(`${L}/`.length)),r=await d.getCreateJob(e);return r?{status:200,body:r}:{status:404,body:{error:"no such job"}}}if("DELETE"===t.method&&t.path.startsWith(`${L}/`)){let r=decodeURIComponent(t.path.slice(`${L}/`.length));if(0===r.length)return{status:404,body:{error:"no such box"}};let a=await d.getBox(r),s=await d.forgetBox(r);await d.deleteStatus(r);let n=0;if(e.custody){let t=a?.sandboxId??r;for(let r of(await e.custody.list(`boxes/${t}`).catch(()=>[])))await e.custody.delete(r.path).catch(()=>!1)&&(n+=1)}let i=await U(r,a?.sandboxId,o);return s||a||0!==n||i?(o(`reaped box ${r} (registration=${String(s)}, custody=${String(n)}, local=${String(i)})`),{status:200,body:{boxId:r,removed:s,custodyRemoved:n,localRemoved:i}}):{status:404,body:{error:"no such box"}}}return{status:405,body:{error:"method not allowed"}}}async function U(r,s,n){let i=!1;try{let{mutateState:n,readState:o,boxSshDirForProvider:d}=await t.A(53982),l=(await o()).boxes.find(t=>t.id===r);if(l){await n(t=>({...t,boxes:t.boxes.filter(t=>t.id!==r)})),i=!0;let t=l.cloud?.sandboxId??s,o=l.provider;if(t&&o){let r=d(o,t);r&&await (0,e.rm)((0,a.dirname)(r),{recursive:!0,force:!0}).catch(()=>{})}}}catch(t){n(`local reap for ${r} failed: ${t instanceof Error?t.message:String(t)}`)}return i}var R=class{inner;registry;events;statusStore;constructor(t,e){this.inner=t,this.registry=e.registry,this.events=e.events,this.statusStore=e.statusStore}async hydrate(){for(let t of(await this.inner.listBoxes()))this.registry.register(t);for(let{boxId:t,status:e}of(await this.inner.listStatuses())){let r=this.registry.get(t);await this.statusStore.set(t,r?.name??t,r?.projectIndex,e)}}migrate(){return this.inner.migrate?.()??Promise.resolve()}async registerBox(t){await this.inner.registerBox(t),this.registry.register(t)}getBox(t){return this.inner.getBox(t)}authenticateBox(t){return this.inner.authenticateBox(t)}listBoxes(){return this.inner.listBoxes()}async forgetBox(t){let e=await this.inner.forgetBox(t);return this.registry.forget(t),e}countBoxes(){return this.inner.countBoxes()}async appendEvent(t){let e=await this.inner.appendEvent(t);return this.events.append(t),e}listEvents(t,e){return this.inner.listEvents(t,e)}countEvents(){return this.inner.countEvents()}async setStatus(t,e,r,a){await this.inner.setStatus(t,e,r,a),await this.statusStore.set(t,e,r,a)}getStatus(t){return this.inner.getStatus(t)}async deleteStatus(t){await this.inner.deleteStatus(t),this.statusStore.delete(t)}listStatuses(){return this.inner.listStatuses()}createPrompt(t){return this.inner.createPrompt(t)}getPrompt(t){return this.inner.getPrompt(t)}answerPrompt(t,e,r){return this.inner.answerPrompt(t,e,r)}listPendingPrompts(t){return this.inner.listPendingPrompts(t)}setPromptResult(t,e){return this.inner.setPromptResult(t,e)}enqueueCreateJob(t){return this.inner.enqueueCreateJob?this.inner.enqueueCreateJob(t):Promise.resolve()}getCreateJob(t){return this.inner.getCreateJob?.(t)??Promise.resolve(null)}listCreateJobs(t){return this.inner.listCreateJobs?.(t)??Promise.resolve([])}claimNextCreateJob(t){return this.inner.claimNextCreateJob?.(t)??Promise.resolve(null)}completeCreateJob(t,e,r){return this.inner.completeCreateJob?this.inner.completeCreateJob(t,e,r):Promise.resolve()}prunePrompts(t){return this.inner.prunePrompts?.(t)??Promise.resolve(0)}pruneCreateJobs(t){return this.inner.pruneCreateJobs?.(t)??Promise.resolve(0)}};function j(t){return Buffer.from(t).toString("base64url")}function q(t,e=Date.now()){let r=Math.floor(e/1e3),a=j(JSON.stringify({alg:"RS256",typ:"JWT"})),s=j(JSON.stringify({iat:r-60,exp:r+540,iss:t.appId})),i=`${a}.${s}`,o=(0,n.createSign)("RSA-SHA256").update(i).sign(t.privateKeyPem);return`${i}.${j(o)}`}var D=class{cfg;fetchImpl;now;apiBase;cache=new Map;installationIds=new Map;constructor(t,e={}){this.cfg=t,this.fetchImpl=e.fetchImpl??fetch,this.now=e.now??Date.now,this.apiBase=(t.apiBaseUrl??"https://api.github.com").replace(/\/$/,"")}headers(t){return{Authorization:`Bearer ${t}`,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28","User-Agent":"agentbox-relay"}}async lookupInstallationId(t,e){let r=`${t}/${e}`,a=this.installationIds.get(r);if(void 0!==a)return a;let s=q(this.cfg,this.now()),n=await this.fetchImpl(`${this.apiBase}/repos/${t}/${e}/installation`,{headers:this.headers(s)});if(404===n.status)return null;if(!n.ok)throw Error(`GET installation for ${r} \u2192 ${String(n.status)}`);let i=await n.json();if("number"!=typeof i.id)throw Error("installation response missing id");return this.installationIds.set(r,i.id),i.id}async installationId(t,e){let r=await this.lookupInstallationId(t,e);if(null===r)throw Error(`GitHub App is not installed on ${t}/${e}`);return r}async isRepoInstalled(t,e){return await this.lookupInstallationId(t,e)!==null}async leaseRepoToken(t,e){let r=`${t}/${e}`,a=this.cache.get(r);if(a&&a.expiresAtMs-this.now()>3e5)return{token:a.token,expiresAt:a.expiresAt};let s=await this.installationId(t,e),n=q(this.cfg,this.now()),i=await this.fetchImpl(`${this.apiBase}/app/installations/${String(s)}/access_tokens`,{method:"POST",headers:{...this.headers(n),"Content-Type":"application/json"},body:JSON.stringify({repositories:[e],permissions:{contents:"write",pull_requests:"write"}})});if(!i.ok)throw Error(`failed to mint installation token for ${r} (\u2192 ${String(i.status)})`);let o=await i.json();if(!o.token||!o.expires_at)throw Error("access_tokens response missing token/expires_at");return this.cache.set(r,{token:o.token,expiresAt:o.expires_at,expiresAtMs:Date.parse(o.expires_at)}),{token:o.token,expiresAt:o.expires_at}}};(0,a.join)(o.STATE_DIR,"workspaces"),(0,a.join)(o.STATE_DIR,"queue");var J=(0,a.join)(o.STATE_DIR,"logs");t.s(["CUSTODY_SCOPES",0,T,"CustodyTooLargeError",0,E,"GitHubAppLeaser",0,D,"MemoryStore",0,g,"QUEUE_LOGS_DIR",0,J,"RELAY_EVENT_RING_SIZE",0,1e3,"WriteThroughStore",0,R,"custodyDigest",0,_,"gateApproval",0,x,"handleCustodyRequest",0,C,"handleRemoteBoxesRequest",0,O,"handleStoreRpcRequest",0,I,"isValidBoxStatus",0,p,"leaseTokenResult",0,S,"loadGitHubAppConfig",0,function(){let t=process.env.GITHUB_APP_ID,e=process.env.GITHUB_APP_PRIVATE_KEY;if(!t||!e)return null;if(!e.includes("BEGIN"))try{e=Buffer.from(e,"base64").toString("utf8")}catch{return null}return{appId:t,privateKeyPem:e,apiBaseUrl:process.env.GITHUB_API_URL||void 0}},"normalizeBoxStatus",0,h,"normalizeCustodyPath",0,$,"normalizeCustodyPrefix",0,k,"parseGitRemote",0,y,"queueLogPath",0,function(t){return(0,a.join)(J,`queue-${t}.log`)},"repoSlugFromRemote",0,v,"resolveWorktree",0,w,"toAuthedHttpsUrl",0,f,"toHttpsUrl",0,function(t){let{host:e,path:r}=y(t);return`https://${e}/${r}`}],47400);var F=t.i(57743),M=t.i(11205),z=t.i(63080),G=t.i(56698),H=t.i(44946),X=t.i(64645),W=t.i(62160),Y=t.i(8614),K=t.i(93540),Q=t.i(21918),V=t.i(2340),Z=t.i(42631),tt=t.i(48771),te=t.i(62562),tr=t.i(28065),ta=t.i(88947);let ts={get url(){return`file://${t.P("packages/relay/dist/chunk-2F65LVQC.js")}`}};async function tn(t,e,r,a,s,n=()=>{}){await t(s?["clone","--branch",s,e,a]:["clone",e,a],{GIT_LFS_SKIP_SMUDGE:"1"});try{await t(["-C",a,"-c",`lfs.url=${e.replace(/\.git$/,"")}.git/info/lfs`,"lfs","pull"],{GIT_TERMINAL_PROMPT:"0",GIT_SSH_COMMAND:"ssh -o BatchMode=yes -o StrictHostKeyChecking=no"},12e4)}catch(t){n(`git-lfs objects left as pointers (fetch failed): ${t instanceof Error?t.message:String(t)}`)}await t(["-C",a,"remote","set-url","origin",r])}async function ti(t,e,r){if(!t.claimNextCreateJob||!t.completeCreateJob)return null;let a=await t.claimNextCreateJob(r);if(!a)return null;try{let{boxId:r,agentStartError:s}=await e(a.request,a.id);s?await t.completeCreateJob(a.id,"failed",{boxId:r,error:s}):await t.completeCreateJob(a.id,"done",{boxId:r})}catch(e){await t.completeCreateJob(a.id,"failed",{error:e instanceof Error?e.message:String(e)})}return a.id}async function to(t,e,r,a=10){let s=0;for(;s<a&&await ti(t,e,r);)s++;return s}function td(t,e=200){return{status:e,body:t}}function tl(t,e){return{status:t,body:{error:e}}}function tu(t){if(0===t.length)return{};try{return JSON.parse(t)}catch{return null}}var tc=new Set(["git.push","git.fetch","cp.toHost","cp.fromHost","download.workspace","download.env","download.config","download.claude","checkpoint.create"]);async function tp(t,e){var r,a;let s,i,{store:o,leaser:d}=e,l=e.log??(()=>{});if(0===e.adminToken.length)return tl(503,"control plane not configured: admin token unset");if("GET"===t.method&&"/healthz"===t.path)return td({ok:!0,boxes:await o.countBoxes(),events:await o.countEvents(),controlPlane:!0});if((t.path.startsWith("/admin/")||t.path.startsWith("/remote/"))&&(r=t.bearer,a=e.adminToken,s=Buffer.from(r,"utf8"),i=Buffer.from(a,"utf8"),!(s.length===i.length&&(0,n.timingSafeEqual)(s,i))))return tl(401,"invalid admin token");let u={custody:e.custody,adminToken:e.adminToken,log:l},c=await C(t,u);if(c)return void 0===c.body?{status:c.status}:td(c.body,c.status);if("POST"===t.method&&"/events"===t.path){let e=await o.authenticateBox(t.bearer);if(!e)return tl(401,"unknown box token");let r=tu(t.bodyText);return r&&"string"==typeof r.type&&0!==r.type.length?"box-status"===r.type?p(r.payload)?(await o.setStatus(e.boxId,e.name,e.projectIndex,h(r.payload)),td({ok:!0},202)):tl(400,"invalid box-status payload"):td({id:(await o.appendEvent({boxId:e.boxId,type:r.type,ts:"string"==typeof r.ts?r.ts:void 0,payload:r.payload})).id},202):tl(400,'missing "type" string')}if("POST"===t.method&&"/rpc"===t.path){let r=await o.authenticateBox(t.bearer);if(!r)return tl(401,"unknown box token");let a=tu(t.bodyText);return a&&"string"==typeof a.method&&0!==a.method.length?(l(`rpc box=${r.boxId} method=${a.method}`),th(r,a.method,a.params,e)):tl(400,'missing "method" string')}if("GET"===t.method&&t.path.startsWith("/rpc/status/")){let e=await o.authenticateBox(t.bearer);if(!e)return tl(401,"unknown box token");let r=decodeURIComponent(t.path.slice(12)),a=await o.getPrompt(r);if(!a||a.boxId!==e.boxId)return tl(404,"no such prompt");if("pending"===a.status)return td({status:"pending"});if("y"!==a.answer||a.cancelled)return td({status:"done",result:{exitCode:10,stdout:"",stderr:"denied by user\n"}});let s=a.result,n=s??await tm(e,a.method,d);return s||await o.setPromptResult(r,n),td({status:"done",result:n})}if("POST"===t.method&&"/admin/register-box"===t.path){let e=tu(t.bodyText);if(!e||!e.boxId||!e.token||"string"!=typeof e.name)return tl(400,"expected {boxId, token, name}");let r={boxId:e.boxId,token:e.token,name:e.name,kind:"cloud"===e.kind?"cloud":"docker",backend:e.backend||void 0,sandboxId:e.sandboxId||void 0,registeredAt:new Date().toISOString(),containerName:e.containerName||void 0,createdAt:e.createdAt||void 0,projectIndex:"number"==typeof e.projectIndex&&e.projectIndex>0?Math.trunc(e.projectIndex):void 0,worktrees:Array.isArray(e.worktrees)?e.worktrees:void 0,previewUrl:e.previewUrl||void 0,previewToken:e.previewToken||void 0,bridgeToken:e.bridgeToken||void 0,autoApproveHostActions:!0===e.autoApproveHostActions,autoApproveSafeHostActions:!1!==e.autoApproveSafeHostActions,originUrl:e.originUrl||void 0};return await o.registerBox(r),l(`registered ${r.kind??"docker"} box ${r.boxId} (${r.name})`),td(null,204)}if("POST"===t.method&&"/admin/forget-box"===t.path){let e=tu(t.bodyText);return e?.boxId?(await o.forgetBox(e.boxId),await o.deleteStatus(e.boxId),td(null,204)):tl(400,"expected {boxId}")}if("GET"===t.method&&"/admin/box-status"===t.path){let e=t.query.get("box")??"",r=e?await o.getStatus(e):void 0;return r?td(r):tl(404,"no status for box")}if("GET"===t.method&&"/admin/events"===t.path){let e=Number.parseInt(t.query.get("since")??"0",10)||0,r=t.query.get("box")??void 0;return td({events:await o.listEvents(e,r??void 0)})}if("GET"===t.method&&"/admin/app/repo-installed"===t.path){if(!d)return tl(503,"no GitHub App configured on this control plane");let e=t.query.get("owner")??"",r=t.query.get("repo")??"";if(!e||!r)return tl(400,"missing owner/repo query params");try{return td({installed:await d.isRepoInstalled(e,r)})}catch(t){return tl(502,`installation check failed: ${t instanceof Error?t.message:String(t)}`)}}if("GET"===t.method&&"/admin/registry"===t.path)return td({boxes:(await o.listBoxes()).map(t=>({boxId:t.boxId,name:t.name,kind:t.kind,registeredAt:t.registeredAt,projectIndex:t.projectIndex,originUrl:t.originUrl}))});if("GET"===t.method&&"/admin/prompts"===t.path){let e=t.query.get("boxId")??"";return 0===e.length?tl(400,"missing boxId query param"):td({prompts:(await o.listPendingPrompts(e)).map(t=>t.ev)})}if("POST"===t.method&&"/admin/prompts/answer"===t.path){let e=tu(t.bodyText);return e?.id&&("y"===e.answer||"n"===e.answer)?await o.answerPrompt(e.id,e.answer,e.cancelled)?td(null,204):tl(404,"no pending prompt with that id"):tl(400,'expected {id, answer:"y"|"n", cancelled?}')}let m=await I(t,{store:o,adminToken:e.adminToken,log:l});if(m)return void 0===m.body?{status:m.status}:td(m.body,m.status);let g=await O(t,{store:o,adminToken:e.adminToken,createProviders:e.createProviders,custody:e.custody,log:l});return g?void 0===g.body?{status:g.status}:td(g.body,g.status):tl(404,"not found")}async function th(t,e,r,a){if("git.lease-token"===e){let n=w(t,r?.path??"/workspace");if(!(0,s.isScratchBranch)(n?.branch)){let s=await x({mode:"poll",store:a.store},t.boxId,e,r,{kind:"confirm",message:`Allow box ${t.name} to lease a push token for ${t.originUrl??"its repo"}?`,detail:`branch ${n?.branch??"(unregistered)"}`,defaultAnswer:"n",context:{command:"git lease-token",cwd:r?.path}});if("pending"===s.kind)return td({status:"pending",promptId:s.promptId},202);if("deny"===s.kind)return td({exitCode:10,stdout:"",stderr:"denied by user\n"},500)}let i=await S(a.leaser,t);return td(i,0===i.exitCode?200:500)}return"browser.open"===e?("string"==typeof r?.url&&await a.store.appendEvent({boxId:t.boxId,type:"browser-open",payload:{url:r.url}}),td({exitCode:0,stdout:"",stderr:""})):tc.has(e)?td({exitCode:64,stdout:"",stderr:`${e}: not available on the hosted control plane (no host). Cloud boxes push via git.lease-token.
|
|
6
6
|
`},501):td({error:"rpc method not implemented",method:e},501)}async function tm(t,e,r){return"git.lease-token"===e?S(r,t):{exitCode:64,stdout:"",stderr:`relay: no approved-action executor for ${e}
|
|
7
|
-
`}}var tg=
|
|
7
|
+
`}}var tg=F.pgTable("boxes",{boxId:M.text("box_id").primaryKey(),token:M.text("token").notNull(),originUrl:M.text("origin_url"),data:z.jsonb("data").$type().notNull(),registeredAt:G.timestamp("registered_at",{withTimezone:!0}).notNull()}),tb=F.pgTable("events",{id:H.bigint("id",{mode:"number"}).generatedAlwaysAsIdentity().primaryKey(),boxId:M.text("box_id").notNull(),type:M.text("type").notNull(),ts:M.text("ts"),payload:z.jsonb("payload"),receivedAt:G.timestamp("received_at",{withTimezone:!0}).notNull()}),tx=F.pgTable("box_status",{boxId:M.text("box_id").primaryKey(),name:M.text("name"),projectIndex:X.integer("project_index"),status:z.jsonb("status").$type().notNull(),updatedAt:G.timestamp("updated_at",{withTimezone:!0}).notNull()}),tw=F.pgTable("prompts",{id:M.text("id").primaryKey(),boxId:M.text("box_id").notNull(),ev:z.jsonb("ev").$type().notNull(),method:M.text("method").notNull(),params:z.jsonb("params"),status:M.text("status").$type().notNull(),answer:M.text("answer").$type(),cancelled:W.boolean("cancelled"),result:z.jsonb("result").$type(),createdAt:G.timestamp("created_at",{withTimezone:!0}).notNull(),expiresAt:G.timestamp("expires_at",{withTimezone:!0})}),ty=F.pgTable("create_jobs",{id:M.text("id").primaryKey(),status:M.text("status").$type().notNull(),request:z.jsonb("request").$type().notNull(),result:z.jsonb("result").$type(),claimedBy:M.text("claimed_by"),createdAt:G.timestamp("created_at",{withTimezone:!0}).notNull(),startedAt:G.timestamp("started_at",{withTimezone:!0}),finishedAt:G.timestamp("finished_at",{withTimezone:!0})}),tf=`
|
|
8
8
|
CREATE TABLE IF NOT EXISTS boxes (
|
|
9
9
|
box_id text PRIMARY KEY,
|
|
10
10
|
token text NOT NULL,
|
|
@@ -58,7 +58,7 @@ CREATE TABLE IF NOT EXISTS create_jobs (
|
|
|
58
58
|
finished_at timestamptz
|
|
59
59
|
);
|
|
60
60
|
CREATE INDEX IF NOT EXISTS create_jobs_queued_idx ON create_jobs (created_at) WHERE status = 'queued';
|
|
61
|
-
`,tv=Y.sqliteTable("boxes",{boxId:K.text("box_id").primaryKey(),token:K.text("token").notNull(),originUrl:K.text("origin_url"),data:K.text("data",{mode:"json"}).$type().notNull(),registeredAt:K.text("registered_at").notNull()},t=>[Q.index("boxes_token_idx").on(t.token)]),tS=Y.sqliteTable("events",{id:V.integer("id").primaryKey({autoIncrement:!0}),boxId:K.text("box_id").notNull(),type:K.text("type").notNull(),ts:K.text("ts"),payload:K.text("payload",{mode:"json"}),receivedAt:K.text("received_at").notNull()},t=>[Q.index("events_box_idx").on(t.boxId,t.id)]),tA=Y.sqliteTable("box_status",{boxId:K.text("box_id").primaryKey(),name:K.text("name"),projectIndex:V.integer("project_index"),status:K.text("status",{mode:"json"}).$type().notNull(),updatedAt:K.text("updated_at").notNull()}),tI=Y.sqliteTable("prompts",{id:K.text("id").primaryKey(),boxId:K.text("box_id").notNull(),ev:K.text("ev",{mode:"json"}).$type().notNull(),method:K.text("method").notNull(),params:K.text("params",{mode:"json"}),status:K.text("status").$type().notNull(),answer:K.text("answer").$type(),cancelled:V.integer("cancelled",{mode:"boolean"}),result:K.text("result",{mode:"json"}).$type(),createdAt:K.text("created_at").notNull(),expiresAt:K.text("expires_at")},t=>[Q.index("prompts_box_status_idx").on(t.boxId,t.status)]),
|
|
61
|
+
`,tv=Y.sqliteTable("boxes",{boxId:K.text("box_id").primaryKey(),token:K.text("token").notNull(),originUrl:K.text("origin_url"),data:K.text("data",{mode:"json"}).$type().notNull(),registeredAt:K.text("registered_at").notNull()},t=>[Q.index("boxes_token_idx").on(t.token)]),tS=Y.sqliteTable("events",{id:V.integer("id").primaryKey({autoIncrement:!0}),boxId:K.text("box_id").notNull(),type:K.text("type").notNull(),ts:K.text("ts"),payload:K.text("payload",{mode:"json"}),receivedAt:K.text("received_at").notNull()},t=>[Q.index("events_box_idx").on(t.boxId,t.id)]),tA=Y.sqliteTable("box_status",{boxId:K.text("box_id").primaryKey(),name:K.text("name"),projectIndex:V.integer("project_index"),status:K.text("status",{mode:"json"}).$type().notNull(),updatedAt:K.text("updated_at").notNull()}),tI=Y.sqliteTable("prompts",{id:K.text("id").primaryKey(),boxId:K.text("box_id").notNull(),ev:K.text("ev",{mode:"json"}).$type().notNull(),method:K.text("method").notNull(),params:K.text("params",{mode:"json"}),status:K.text("status").$type().notNull(),answer:K.text("answer").$type(),cancelled:V.integer("cancelled",{mode:"boolean"}),result:K.text("result",{mode:"json"}).$type(),createdAt:K.text("created_at").notNull(),expiresAt:K.text("expires_at")},t=>[Q.index("prompts_box_status_idx").on(t.boxId,t.status)]),tT=Y.sqliteTable("create_jobs",{id:K.text("id").primaryKey(),status:K.text("status").$type().notNull(),request:K.text("request",{mode:"json"}).$type().notNull(),result:K.text("result",{mode:"json"}).$type(),claimedBy:K.text("claimed_by"),createdAt:K.text("created_at").notNull(),startedAt:K.text("started_at"),finishedAt:K.text("finished_at")},t=>[Q.index("create_jobs_status_idx").on(t.status,t.createdAt)]),tE=`
|
|
62
62
|
CREATE TABLE IF NOT EXISTS boxes (
|
|
63
63
|
box_id text PRIMARY KEY,
|
|
64
64
|
token text NOT NULL,
|
|
@@ -112,6 +112,6 @@ CREATE TABLE IF NOT EXISTS create_jobs (
|
|
|
112
112
|
finished_at text
|
|
113
113
|
);
|
|
114
114
|
CREATE INDEX IF NOT EXISTS create_jobs_status_idx ON create_jobs (status, created_at);
|
|
115
|
-
`;function tN(t){return t instanceof Date?t.toISOString():new Date(t).toISOString()}function tP(t){return null===t?void 0:tN(t)}function t_(t){return{id:Number(t.id),boxId:t.boxId,type:t.type,ts:t.ts??void 0,payload:t.payload??void 0,receivedAt:tN(t.receivedAt)}}function t$(t){return{id:t.id,boxId:t.boxId,ev:t.ev,method:t.method,params:t.params??void 0,status:t.status,answer:t.answer??void 0,cancelled:t.cancelled??void 0,result:t.result??void 0,createdAt:tN(t.createdAt),expiresAt:tP(t.expiresAt)}}function tk(t){return{id:t.id,status:t.status,request:t.request,result:t.result??void 0,claimedBy:t.claimedBy??void 0,createdAt:tN(t.createdAt),startedAt:tP(t.startedAt),finishedAt:tP(t.finishedAt)}}var tB=class{eventCap;connectionString;injectedPool;poolPromise=null;dbPromise=null;constructor(t={}){this.connectionString=t.connectionString,this.injectedPool=t.pool,this.eventCap=t.eventCap??1e3}pool(){return this.injectedPool?Promise.resolve(this.injectedPool):(this.poolPromise??=t.A(6194).then(({default:t})=>new t.Pool({connectionString:this.connectionString})),this.poolPromise)}db(){return this.dbPromise??=(async()=>{let e=await this.pool(),{drizzle:r}=await t.A(14788);return r(e)})(),this.dbPromise}async migrate(){let t=await this.pool();await t.query(tf)}async close(){if(!this.injectedPool&&this.poolPromise){let t=await this.poolPromise;await t.end(),this.poolPromise=null,this.dbPromise=null}}async registerBox(t){let e=await this.db();await e.insert(tg).values({boxId:t.boxId,token:t.token,originUrl:t.originUrl??null,data:t,registeredAt:new Date(t.registeredAt)}).onConflictDoUpdate({target:tg.boxId,set:{token:t.token,originUrl:t.originUrl??null,data:t}})}async getBox(t){let e=await this.db(),r=await e.select({data:tg.data}).from(tg).where((0,Z.eq)(tg.boxId,t));return r[0]?.data}async authenticateBox(t){if(0===t.length)return null;let e=await this.db(),r=await e.select({data:tg.data}).from(tg).where((0,Z.eq)(tg.token,t)).limit(1);return r[0]?.data??null}async listBoxes(){let t=await this.db();return(await t.select({data:tg.data}).from(tg).orderBy((0,tt.asc)(tg.registeredAt))).map(t=>t.data)}async forgetBox(t){let e=await this.db();return(await e.delete(tg).where((0,Z.eq)(tg.boxId,t)).returning({boxId:tg.boxId})).length>0}async countBoxes(){return(await this.db()).$count(tg)}async appendEvent(t){let e=await this.db(),r=(await e.insert(tb).values({boxId:t.boxId,type:t.type,ts:t.ts??null,payload:t.payload??null,receivedAt:new Date}).returning({id:tb.id,receivedAt:tb.receivedAt}))[0];return this.eventCap>0&&await e.delete(tb).where((0,Z.lte)(tb.id,r.id-this.eventCap)),{id:r.id,boxId:t.boxId,type:t.type,ts:t.ts,payload:t.payload,receivedAt:r.receivedAt.toISOString()}}async listEvents(t,e){let r=await this.db(),a=void 0===e?(0,Z.gt)(tb.id,t):(0,Z.and)((0,Z.gt)(tb.id,t),(0,Z.eq)(tb.boxId,e));return(await r.select().from(tb).where(a).orderBy((0,tt.asc)(tb.id))).map(t_)}async countEvents(){return(await this.db()).$count(tb)}async setStatus(t,e,r,a){let s=await this.db(),n=new Date;await s.insert(tx).values({boxId:t,name:e,projectIndex:r??null,status:a,updatedAt:n}).onConflictDoUpdate({target:tx.boxId,set:{name:e,projectIndex:r??null,status:a,updatedAt:n}})}async getStatus(t){let e=await this.db(),r=await e.select({status:tx.status}).from(tx).where((0,Z.eq)(tx.boxId,t));return r[0]?.status}async deleteStatus(t){let e=await this.db();await e.delete(tx).where((0,Z.eq)(tx.boxId,t))}async listStatuses(){return(await this.db()).select({boxId:tx.boxId,status:tx.status}).from(tx)}async createPrompt(t){let e=await this.db();await e.insert(ty).values({id:t.id,boxId:t.boxId,ev:t.ev,method:t.method,params:t.params??null,status:t.status,answer:t.answer??null,cancelled:t.cancelled??null,result:t.result??null,createdAt:new Date(t.createdAt),expiresAt:t.expiresAt?new Date(t.expiresAt):null}).onConflictDoNothing({target:ty.id})}async getPrompt(t){let e=await this.db(),r=await e.select().from(ty).where((0,Z.eq)(ty.id,t));return r[0]?t$(r[0]):null}async answerPrompt(t,e,r){let a=await this.db();return(await a.update(ty).set({status:"answered",answer:e,cancelled:r??null}).where((0,Z.and)((0,Z.eq)(ty.id,t),(0,Z.eq)(ty.status,"pending"))).returning({id:ty.id})).length>0}async listPendingPrompts(t){let e=await this.db();return(await e.select().from(ty).where((0,Z.and)((0,Z.eq)(ty.boxId,t),(0,Z.eq)(ty.status,"pending"))).orderBy((0,tt.asc)(ty.createdAt))).map(t$)}async setPromptResult(t,e){let r=await this.db();await r.update(ty).set({result:e}).where((0,Z.eq)(ty.id,t))}async enqueueCreateJob(t){let e=await this.db();await e.insert(tw).values({id:t.id,status:t.status,request:t.request,result:t.result??null,claimedBy:t.claimedBy??null,createdAt:new Date(t.createdAt),startedAt:t.startedAt?new Date(t.startedAt):null,finishedAt:t.finishedAt?new Date(t.finishedAt):null}).onConflictDoNothing({target:tw.id})}async getCreateJob(t){let e=await this.db(),r=await e.select().from(tw).where((0,Z.eq)(tw.id,t));return r[0]?tk(r[0]):null}async listCreateJobs(t){let e=(await this.db()).select().from(tw),r=t?.status?.length?e.where((0,Z.inArray)(tw.status,t.status)):e;return(await r.orderBy((0,tt.desc)(tw.createdAt)).limit(t?.limit??100)).map(tk)}async claimNextCreateJob(t){let e=await this.db(),r=e.select({id:tw.id}).from(tw).where((0,Z.eq)(tw.status,"queued")).orderBy((0,tt.asc)(tw.createdAt)).limit(1).for("update",{skipLocked:!0}),a=await e.update(tw).set({status:"running",claimedBy:t,startedAt:new Date}).where((0,Z.inArray)(tw.id,r)).returning();return a[0]?tk(a[0]):null}async completeCreateJob(t,e,r){let a=await this.db();await a.update(tw).set({status:e,result:r,finishedAt:new Date}).where((0,Z.eq)(tw.id,t))}async prunePrompts(t){let e=await this.db(),r=new Date(t);return(await e.delete(ty).where((0,Z.or)((0,Z.and)((0,Z.eq)(ty.status,"answered"),(0,Z.lt)(ty.createdAt,r)),(0,Z.and)((0,Z.isNotNull)(ty.expiresAt),(0,Z.lt)(ty.expiresAt,r)))).returning({id:ty.id})).length}async pruneCreateJobs(t){let e=await this.db(),r=new Date(t);return(await e.delete(tw).where((0,Z.and)((0,Z.inArray)(tw.status,["done","failed"]),(0,Z.isNotNull)(tw.finishedAt),(0,Z.lt)(tw.finishedAt,r))).returning({id:tw.id})).length}},tC=(0,a.join)(d.STATE_DIR,"hub","store.db"),tL=class{path;eventCap;raw=null;dbPromise=null;constructor(t={}){this.path=t.path??tC,this.eventCap=t.eventCap??1e3}db(){return this.dbPromise??=(async()=>{!function(){let[t=0,e=0]=process.versions.node.split(".").map(Number);if(!(t>22||22===t&&e>=5))throw Error(`the SQLite store needs Node >= 22.5 for node:sqlite (running ${process.versions.node}). Upgrade Node, or point the hub at a Postgres store (POSTGRES_URL).`)}();let{DatabaseSync:e}=function(){(0,te.createRequire)(ts.url);let t=Error("Cannot find module 'node:sqlite': Unsupported external type Url for commonjs reference");throw t.code="MODULE_NOT_FOUND",t}(),{drizzle:r}=await t.A(86115);":memory:"!==this.path&&(0,i.mkdirSync)((0,a.dirname)(this.path),{recursive:!0});let s=new e(this.path);return s.exec("PRAGMA journal_mode = WAL; PRAGMA busy_timeout = 5000;"),s.exec(tT),this.raw=s,r(async(t,e,r)=>{let a,n=s.prepare(t);return"run"===r?(n.run(...e),{rows:[]}):("function"==typeof n.setReturnArrays?(n.setReturnArrays(!0),a=n.all(...e)):a=n.all(...e).map(t=>Object.values(t)),"get"===r?{rows:a[0]??[]}:{rows:a})})})(),this.dbPromise}async migrate(){await this.db()}async close(){this.dbPromise&&await this.dbPromise.catch(()=>void 0),this.raw?.close(),this.raw=null,this.dbPromise=null}async registerBox(t){let e=await this.db();await e.insert(tv).values({boxId:t.boxId,token:t.token,originUrl:t.originUrl??null,data:t,registeredAt:t.registeredAt}).onConflictDoUpdate({target:tv.boxId,set:{token:t.token,originUrl:t.originUrl??null,data:t}})}async getBox(t){let e=await this.db(),r=await e.select({data:tv.data}).from(tv).where((0,Z.eq)(tv.boxId,t));return r[0]?.data}async authenticateBox(t){if(0===t.length)return null;let e=await this.db(),r=await e.select({data:tv.data}).from(tv).where((0,Z.eq)(tv.token,t)).limit(1);return r[0]?.data??null}async listBoxes(){let t=await this.db();return(await t.select({data:tv.data}).from(tv).orderBy((0,tt.asc)(tv.registeredAt))).map(t=>t.data)}async forgetBox(t){let e=await this.db();return(await e.delete(tv).where((0,Z.eq)(tv.boxId,t)).returning({boxId:tv.boxId})).length>0}async countBoxes(){return(await this.db()).$count(tv)}async appendEvent(t){let e=await this.db(),r=new Date().toISOString(),a=(await e.insert(tS).values({boxId:t.boxId,type:t.type,ts:t.ts??null,payload:t.payload??null,receivedAt:r}).returning({id:tS.id}))[0].id;return this.eventCap>0&&await e.delete(tS).where((0,Z.lte)(tS.id,a-this.eventCap)),{id:a,boxId:t.boxId,type:t.type,ts:t.ts,payload:t.payload,receivedAt:r}}async listEvents(t,e){let r=await this.db(),a=void 0===e?(0,Z.gt)(tS.id,t):(0,Z.and)((0,Z.gt)(tS.id,t),(0,Z.eq)(tS.boxId,e));return(await r.select().from(tS).where(a).orderBy((0,tt.asc)(tS.id))).map(t_)}async countEvents(){return(await this.db()).$count(tS)}async setStatus(t,e,r,a){let s=await this.db(),n=new Date().toISOString();await s.insert(tA).values({boxId:t,name:e,projectIndex:r??null,status:a,updatedAt:n}).onConflictDoUpdate({target:tA.boxId,set:{name:e,projectIndex:r??null,status:a,updatedAt:n}})}async getStatus(t){let e=await this.db(),r=await e.select({status:tA.status}).from(tA).where((0,Z.eq)(tA.boxId,t));return r[0]?.status}async deleteStatus(t){let e=await this.db();await e.delete(tA).where((0,Z.eq)(tA.boxId,t))}async listStatuses(){return(await this.db()).select({boxId:tA.boxId,status:tA.status}).from(tA)}async createPrompt(t){let e=await this.db();await e.insert(tI).values({id:t.id,boxId:t.boxId,ev:t.ev,method:t.method,params:t.params??null,status:t.status,answer:t.answer??null,cancelled:t.cancelled??null,result:t.result??null,createdAt:t.createdAt,expiresAt:t.expiresAt??null}).onConflictDoNothing({target:tI.id})}async getPrompt(t){let e=await this.db(),r=await e.select().from(tI).where((0,Z.eq)(tI.id,t));return r[0]?t$(r[0]):null}async answerPrompt(t,e,r){let a=await this.db();return(await a.update(tI).set({status:"answered",answer:e,cancelled:r??null}).where((0,Z.and)((0,Z.eq)(tI.id,t),(0,Z.eq)(tI.status,"pending"))).returning({id:tI.id})).length>0}async listPendingPrompts(t){let e=await this.db();return(await e.select().from(tI).where((0,Z.and)((0,Z.eq)(tI.boxId,t),(0,Z.eq)(tI.status,"pending"))).orderBy((0,tt.asc)(tI.createdAt))).map(t$)}async setPromptResult(t,e){let r=await this.db();await r.update(tI).set({result:e}).where((0,Z.eq)(tI.id,t))}async enqueueCreateJob(t){let e=await this.db();await e.insert(tE).values({id:t.id,status:t.status,request:t.request,result:t.result??null,claimedBy:t.claimedBy??null,createdAt:t.createdAt,startedAt:t.startedAt??null,finishedAt:t.finishedAt??null}).onConflictDoNothing({target:tE.id})}async getCreateJob(t){let e=await this.db(),r=await e.select().from(tE).where((0,Z.eq)(tE.id,t));return r[0]?tk(r[0]):null}async listCreateJobs(t){let e=(await this.db()).select().from(tE),r=t?.status?.length?e.where((0,Z.inArray)(tE.status,t.status)):e;return(await r.orderBy((0,tt.desc)(tE.createdAt)).limit(t?.limit??100)).map(tk)}async claimNextCreateJob(t){let e=await this.db(),r=e.select({id:tE.id}).from(tE).where((0,Z.eq)(tE.status,"queued")).orderBy((0,tt.asc)(tE.createdAt)).limit(1),a=await e.update(tE).set({status:"running",claimedBy:t,startedAt:new Date().toISOString()}).where((0,Z.and)((0,Z.inArray)(tE.id,r),(0,Z.eq)(tE.status,"queued"))).returning();return a[0]?tk(a[0]):null}async completeCreateJob(t,e,r){let a=await this.db();await a.update(tE).set({status:e,result:r,finishedAt:new Date().toISOString()}).where((0,Z.eq)(tE.id,t))}async prunePrompts(t){let e=await this.db();return(await e.delete(tI).where((0,Z.or)((0,Z.and)((0,Z.eq)(tI.status,"answered"),(0,Z.lt)(tI.createdAt,t)),(0,Z.and)((0,Z.isNotNull)(tI.expiresAt),(0,Z.lt)(tI.expiresAt,t)))).returning({id:tI.id})).length}async pruneCreateJobs(t){let e=await this.db();return(await e.delete(tE).where((0,Z.and)((0,Z.inArray)(tE.status,["done","failed"]),(0,Z.isNotNull)(tE.finishedAt),(0,Z.lt)(tE.finishedAt,t))).returning({id:tE.id})).length}},tO=(0,a.join)(d.STATE_DIR,"hub","custody"),tU=class{root;constructor(t={}){this.root=t.root??tO}async put(t,r){let s=$(t),i=(0,a.join)(this.root,s),o=_(r),d=await this.readEntry(s);if(d&&d.entry.sha256===o)return{...d.entry,changed:!1};await (0,e.mkdir)((0,a.dirname)(i),{recursive:!0,mode:448});let l=`${i}.${(0,n.randomBytes)(6).toString("hex")}.tmp`;try{await (0,e.writeFile)(l,r,{mode:384}),await (0,e.chmod)(l,384),await (0,e.rename)(l,i)}catch(t){throw await (0,e.rm)(l,{force:!0}),t}let u=await (0,e.stat)(i);return{path:s,size:r.length,sha256:o,mode:511&u.mode,updatedAt:u.mtime.toISOString(),changed:!0}}async get(t){return this.readEntry($(t))}async stat(t){let e=await this.readEntry($(t));return e?e.entry:null}async list(t){let e=void 0===t?"":k(t),r=[];for(let t of(await this.walk(this.root))){if(e.length>0&&t!==e&&!t.startsWith(`${e}/`))continue;let a=await this.readEntry(t);a&&r.push(a.entry)}return r.sort((t,e)=>t.path<e.path?-1:+(t.path>e.path)),r}async delete(t){let r=$(t),s=(0,a.join)(this.root,r);try{return await (0,e.rm)(s),!0}catch(t){if("ENOENT"===t.code)return!1;throw t}}async putStream(t,r,s={}){let o=$(t),d=(0,a.join)(this.root,o);await (0,e.mkdir)((0,a.dirname)(d),{recursive:!0,mode:448});let l=`${d}.${(0,n.randomBytes)(6).toString("hex")}.tmp`,u=(0,n.createHash)("sha256"),c=0,p=new ta.Transform({transform(t,e,r){(c+=t.length,void 0!==s.maxBytes&&c>s.maxBytes)?r(new T(s.maxBytes)):(u.update(t),r(null,t))}});try{await (0,tr.pipeline)(r,p,(0,i.createWriteStream)(l,{mode:384}))}catch(t){throw await (0,e.rm)(l,{force:!0}),t}let h=u.digest("hex"),m=await this.readEntryMeta(o);if(m&&m.sha256===h)return await (0,e.rm)(l,{force:!0}),{...m,changed:!1};try{await (0,e.chmod)(l,384),await (0,e.rename)(l,d)}catch(t){throw await (0,e.rm)(l,{force:!0}),t}let g=await (0,e.stat)(d);return{path:o,size:c,sha256:h,mode:511&g.mode,updatedAt:g.mtime.toISOString(),changed:!0}}async getStream(t){let e=$(t),r=await this.readEntryMeta(e);return r?{entry:r,data:(0,i.createReadStream)((0,a.join)(this.root,e))}:null}async readEntryMeta(t){let r=(0,a.join)(this.root,t);try{let a=await (0,e.stat)(r);if(!a.isFile())return null;let s=(0,n.createHash)("sha256");return await (0,tr.pipeline)((0,i.createReadStream)(r),new ta.Transform({transform(t,e,r){s.update(t),r()}})),{path:t,size:a.size,sha256:s.digest("hex"),mode:511&a.mode,updatedAt:a.mtime.toISOString()}}catch(t){if("ENOENT"===t.code)return null;throw t}}async readEntry(t){let r=(0,a.join)(this.root,t);try{let[a,s]=await Promise.all([(0,e.readFile)(r),(0,e.stat)(r)]);return{entry:{path:t,size:a.length,sha256:_(a),mode:511&s.mode,updatedAt:s.mtime.toISOString()},data:a}}catch(e){let t=e.code;if("ENOENT"===t||"EISDIR"===t)return null;throw e}}async walk(t){let r;try{r=await (0,e.readdir)(t,{withFileTypes:!0})}catch(t){if("ENOENT"===t.code)return[];throw t}let s=[];for(let e of r){let r=(0,a.join)(t,e.name);e.isDirectory()?s.push(...await this.walk(r)):e.isFile()&&!e.name.endsWith(".tmp")&&s.push((0,a.relative)(this.root,r).split(a.sep).join("/"))}return s}};t.s(["DEFAULT_CUSTODY_DIR",0,tO,"DEFAULT_SQLITE_STORE_PATH",0,tC,"FsCustodyStore",0,tU,"PG_SCHEMA_SQL",0,tf,"PostgresStore",0,tB,"SQLITE_SCHEMA_SQL",0,tT,"SqliteStore",0,tL,"cloneRepoWithLfs",0,tn,"drainCreateJobs",0,to,"drainOneCreateJob",0,ti,"handleRelayRequest",0,tp,"makeControlPlaneCreateBox",0,function(t){return async(e,r)=>{let a=t.logFor?.(r)??t.log??(()=>{}),s=t.tmpDir(r);try{let r;a(`leasing a push token for ${e.repoUrl}`);let n=await t.leaseRemoteUrl(e.repoUrl);if(a(`cloning ${e.repoUrl}${e.branch?`@${e.branch}`:""} into ${s}`),await t.cloneRepo(n,e.repoUrl,s,e.branch),t.fetchSeedMaterial)try{let n=await t.fetchSeedMaterial(e.repoUrl,s);if(r=n?.carry?.length?n.carry:void 0,n&&n.files>0){let t=[n.repoHeadSha?`at ${n.repoHeadSha.slice(0,8)}`:null,n.capturedAt?`captured ${n.capturedAt}`:null].filter(Boolean).join(", ");a(`applied ${String(n.files)} seed file(s) from custody${t?` (${t})`:""}`)}}catch(e){if(e instanceof Error&&"CarrySeedError"===e.name)throw e;let t=e instanceof Error?e.message:String(e);a(`seed material unavailable (continuing with a bare clone): ${t}`)}a(`provisioning ${e.provider} box from the clone`);let i=await t.createBox({workspacePath:s,name:e.name,repoUrl:e.repoUrl,provider:e.provider,...r?{carry:r}:{},agent:e.agent,prompt:e.prompt,agentArgs:e.agentArgs,startAgent:e.startAgent,opts:e.opts,onLog:a});return a(`created box ${i.id}`),{boxId:i.id,agentStartError:i.agentStartError}}finally{await t.cleanup(s)}}},"makeStore",0,function(t){if(!t||"memory"===t)return new g;if(t.startsWith("postgres://")||t.startsWith("postgresql://"))return new tB({connectionString:t});if(t.startsWith("sqlite:")){let e=t.slice(7).replace(/^\/\//,"");if(!e)throw Error(`store spec has no path: ${t}`);return new tL({path:e})}if(":memory:"===t||t.startsWith("/")||t.startsWith(".")||t.endsWith(".db"))return new tL({path:t});throw Error(`unknown store spec: ${t}`)}],47706),t.s([],7876)}];
|
|
115
|
+
`;function tN(t){return t instanceof Date?t.toISOString():new Date(t).toISOString()}function tP(t){return null===t?void 0:tN(t)}function t_(t){return{id:Number(t.id),boxId:t.boxId,type:t.type,ts:t.ts??void 0,payload:t.payload??void 0,receivedAt:tN(t.receivedAt)}}function t$(t){return{id:t.id,boxId:t.boxId,ev:t.ev,method:t.method,params:t.params??void 0,status:t.status,answer:t.answer??void 0,cancelled:t.cancelled??void 0,result:t.result??void 0,createdAt:tN(t.createdAt),expiresAt:tP(t.expiresAt)}}function tk(t){return{id:t.id,status:t.status,request:t.request,result:t.result??void 0,claimedBy:t.claimedBy??void 0,createdAt:tN(t.createdAt),startedAt:tP(t.startedAt),finishedAt:tP(t.finishedAt)}}var tB=class{eventCap;connectionString;injectedPool;poolPromise=null;dbPromise=null;constructor(t={}){this.connectionString=t.connectionString,this.injectedPool=t.pool,this.eventCap=t.eventCap??1e3}pool(){return this.injectedPool?Promise.resolve(this.injectedPool):(this.poolPromise??=t.A(6194).then(({default:t})=>new t.Pool({connectionString:this.connectionString})),this.poolPromise)}db(){return this.dbPromise??=(async()=>{let e=await this.pool(),{drizzle:r}=await t.A(14788);return r(e)})(),this.dbPromise}async migrate(){let t=await this.pool();await t.query(tf)}async close(){if(!this.injectedPool&&this.poolPromise){let t=await this.poolPromise;await t.end(),this.poolPromise=null,this.dbPromise=null}}async registerBox(t){let e=await this.db();await e.insert(tg).values({boxId:t.boxId,token:t.token,originUrl:t.originUrl??null,data:t,registeredAt:new Date(t.registeredAt)}).onConflictDoUpdate({target:tg.boxId,set:{token:t.token,originUrl:t.originUrl??null,data:t}})}async getBox(t){let e=await this.db(),r=await e.select({data:tg.data}).from(tg).where((0,Z.eq)(tg.boxId,t));return r[0]?.data}async authenticateBox(t){if(0===t.length)return null;let e=await this.db(),r=await e.select({data:tg.data}).from(tg).where((0,Z.eq)(tg.token,t)).limit(1);return r[0]?.data??null}async listBoxes(){let t=await this.db();return(await t.select({data:tg.data}).from(tg).orderBy((0,tt.asc)(tg.registeredAt))).map(t=>t.data)}async forgetBox(t){let e=await this.db();return(await e.delete(tg).where((0,Z.eq)(tg.boxId,t)).returning({boxId:tg.boxId})).length>0}async countBoxes(){return(await this.db()).$count(tg)}async appendEvent(t){let e=await this.db(),r=(await e.insert(tb).values({boxId:t.boxId,type:t.type,ts:t.ts??null,payload:t.payload??null,receivedAt:new Date}).returning({id:tb.id,receivedAt:tb.receivedAt}))[0];return this.eventCap>0&&await e.delete(tb).where((0,Z.lte)(tb.id,r.id-this.eventCap)),{id:r.id,boxId:t.boxId,type:t.type,ts:t.ts,payload:t.payload,receivedAt:r.receivedAt.toISOString()}}async listEvents(t,e){let r=await this.db(),a=void 0===e?(0,Z.gt)(tb.id,t):(0,Z.and)((0,Z.gt)(tb.id,t),(0,Z.eq)(tb.boxId,e));return(await r.select().from(tb).where(a).orderBy((0,tt.asc)(tb.id))).map(t_)}async countEvents(){return(await this.db()).$count(tb)}async setStatus(t,e,r,a){let s=await this.db(),n=new Date;await s.insert(tx).values({boxId:t,name:e,projectIndex:r??null,status:a,updatedAt:n}).onConflictDoUpdate({target:tx.boxId,set:{name:e,projectIndex:r??null,status:a,updatedAt:n}})}async getStatus(t){let e=await this.db(),r=await e.select({status:tx.status}).from(tx).where((0,Z.eq)(tx.boxId,t));return r[0]?.status}async deleteStatus(t){let e=await this.db();await e.delete(tx).where((0,Z.eq)(tx.boxId,t))}async listStatuses(){return(await this.db()).select({boxId:tx.boxId,status:tx.status}).from(tx)}async createPrompt(t){let e=await this.db();await e.insert(tw).values({id:t.id,boxId:t.boxId,ev:t.ev,method:t.method,params:t.params??null,status:t.status,answer:t.answer??null,cancelled:t.cancelled??null,result:t.result??null,createdAt:new Date(t.createdAt),expiresAt:t.expiresAt?new Date(t.expiresAt):null}).onConflictDoNothing({target:tw.id})}async getPrompt(t){let e=await this.db(),r=await e.select().from(tw).where((0,Z.eq)(tw.id,t));return r[0]?t$(r[0]):null}async answerPrompt(t,e,r){let a=await this.db();return(await a.update(tw).set({status:"answered",answer:e,cancelled:r??null}).where((0,Z.and)((0,Z.eq)(tw.id,t),(0,Z.eq)(tw.status,"pending"))).returning({id:tw.id})).length>0}async listPendingPrompts(t){let e=await this.db();return(await e.select().from(tw).where((0,Z.and)((0,Z.eq)(tw.boxId,t),(0,Z.eq)(tw.status,"pending"))).orderBy((0,tt.asc)(tw.createdAt))).map(t$)}async setPromptResult(t,e){let r=await this.db();await r.update(tw).set({result:e}).where((0,Z.eq)(tw.id,t))}async enqueueCreateJob(t){let e=await this.db();await e.insert(ty).values({id:t.id,status:t.status,request:t.request,result:t.result??null,claimedBy:t.claimedBy??null,createdAt:new Date(t.createdAt),startedAt:t.startedAt?new Date(t.startedAt):null,finishedAt:t.finishedAt?new Date(t.finishedAt):null}).onConflictDoNothing({target:ty.id})}async getCreateJob(t){let e=await this.db(),r=await e.select().from(ty).where((0,Z.eq)(ty.id,t));return r[0]?tk(r[0]):null}async listCreateJobs(t){let e=(await this.db()).select().from(ty),r=t?.status?.length?e.where((0,Z.inArray)(ty.status,t.status)):e;return(await r.orderBy((0,tt.desc)(ty.createdAt)).limit(t?.limit??100)).map(tk)}async claimNextCreateJob(t){let e=await this.db(),r=e.select({id:ty.id}).from(ty).where((0,Z.eq)(ty.status,"queued")).orderBy((0,tt.asc)(ty.createdAt)).limit(1).for("update",{skipLocked:!0}),a=await e.update(ty).set({status:"running",claimedBy:t,startedAt:new Date}).where((0,Z.inArray)(ty.id,r)).returning();return a[0]?tk(a[0]):null}async completeCreateJob(t,e,r){let a=await this.db();await a.update(ty).set({status:e,result:r,finishedAt:new Date}).where((0,Z.eq)(ty.id,t))}async prunePrompts(t){let e=await this.db(),r=new Date(t);return(await e.delete(tw).where((0,Z.or)((0,Z.and)((0,Z.eq)(tw.status,"answered"),(0,Z.lt)(tw.createdAt,r)),(0,Z.and)((0,Z.isNotNull)(tw.expiresAt),(0,Z.lt)(tw.expiresAt,r)))).returning({id:tw.id})).length}async pruneCreateJobs(t){let e=await this.db(),r=new Date(t);return(await e.delete(ty).where((0,Z.and)((0,Z.inArray)(ty.status,["done","failed"]),(0,Z.isNotNull)(ty.finishedAt),(0,Z.lt)(ty.finishedAt,r))).returning({id:ty.id})).length}},tC=(0,a.join)(d.STATE_DIR,"hub","store.db"),tL=class{path;eventCap;raw=null;dbPromise=null;constructor(t={}){this.path=t.path??tC,this.eventCap=t.eventCap??1e3}db(){return this.dbPromise??=(async()=>{!function(){let[t=0,e=0]=process.versions.node.split(".").map(Number);if(!(t>22||22===t&&e>=5))throw Error(`the SQLite store needs Node >= 22.5 for node:sqlite (running ${process.versions.node}). Upgrade Node, or point the hub at a Postgres store (POSTGRES_URL).`)}();let{DatabaseSync:e}=function(){(0,te.createRequire)(ts.url);let t=Error("Cannot find module 'node:sqlite': Unsupported external type Url for commonjs reference");throw t.code="MODULE_NOT_FOUND",t}(),{drizzle:r}=await t.A(86115);":memory:"!==this.path&&(0,i.mkdirSync)((0,a.dirname)(this.path),{recursive:!0});let s=new e(this.path);return s.exec("PRAGMA journal_mode = WAL; PRAGMA busy_timeout = 5000;"),s.exec(tE),this.raw=s,r(async(t,e,r)=>{let a,n=s.prepare(t);return"run"===r?(n.run(...e),{rows:[]}):("function"==typeof n.setReturnArrays?(n.setReturnArrays(!0),a=n.all(...e)):a=n.all(...e).map(t=>Object.values(t)),"get"===r?{rows:a[0]??[]}:{rows:a})})})(),this.dbPromise}async migrate(){await this.db()}async close(){this.dbPromise&&await this.dbPromise.catch(()=>void 0),this.raw?.close(),this.raw=null,this.dbPromise=null}async registerBox(t){let e=await this.db();await e.insert(tv).values({boxId:t.boxId,token:t.token,originUrl:t.originUrl??null,data:t,registeredAt:t.registeredAt}).onConflictDoUpdate({target:tv.boxId,set:{token:t.token,originUrl:t.originUrl??null,data:t}})}async getBox(t){let e=await this.db(),r=await e.select({data:tv.data}).from(tv).where((0,Z.eq)(tv.boxId,t));return r[0]?.data}async authenticateBox(t){if(0===t.length)return null;let e=await this.db(),r=await e.select({data:tv.data}).from(tv).where((0,Z.eq)(tv.token,t)).limit(1);return r[0]?.data??null}async listBoxes(){let t=await this.db();return(await t.select({data:tv.data}).from(tv).orderBy((0,tt.asc)(tv.registeredAt))).map(t=>t.data)}async forgetBox(t){let e=await this.db();return(await e.delete(tv).where((0,Z.eq)(tv.boxId,t)).returning({boxId:tv.boxId})).length>0}async countBoxes(){return(await this.db()).$count(tv)}async appendEvent(t){let e=await this.db(),r=new Date().toISOString(),a=(await e.insert(tS).values({boxId:t.boxId,type:t.type,ts:t.ts??null,payload:t.payload??null,receivedAt:r}).returning({id:tS.id}))[0].id;return this.eventCap>0&&await e.delete(tS).where((0,Z.lte)(tS.id,a-this.eventCap)),{id:a,boxId:t.boxId,type:t.type,ts:t.ts,payload:t.payload,receivedAt:r}}async listEvents(t,e){let r=await this.db(),a=void 0===e?(0,Z.gt)(tS.id,t):(0,Z.and)((0,Z.gt)(tS.id,t),(0,Z.eq)(tS.boxId,e));return(await r.select().from(tS).where(a).orderBy((0,tt.asc)(tS.id))).map(t_)}async countEvents(){return(await this.db()).$count(tS)}async setStatus(t,e,r,a){let s=await this.db(),n=new Date().toISOString();await s.insert(tA).values({boxId:t,name:e,projectIndex:r??null,status:a,updatedAt:n}).onConflictDoUpdate({target:tA.boxId,set:{name:e,projectIndex:r??null,status:a,updatedAt:n}})}async getStatus(t){let e=await this.db(),r=await e.select({status:tA.status}).from(tA).where((0,Z.eq)(tA.boxId,t));return r[0]?.status}async deleteStatus(t){let e=await this.db();await e.delete(tA).where((0,Z.eq)(tA.boxId,t))}async listStatuses(){return(await this.db()).select({boxId:tA.boxId,status:tA.status}).from(tA)}async createPrompt(t){let e=await this.db();await e.insert(tI).values({id:t.id,boxId:t.boxId,ev:t.ev,method:t.method,params:t.params??null,status:t.status,answer:t.answer??null,cancelled:t.cancelled??null,result:t.result??null,createdAt:t.createdAt,expiresAt:t.expiresAt??null}).onConflictDoNothing({target:tI.id})}async getPrompt(t){let e=await this.db(),r=await e.select().from(tI).where((0,Z.eq)(tI.id,t));return r[0]?t$(r[0]):null}async answerPrompt(t,e,r){let a=await this.db();return(await a.update(tI).set({status:"answered",answer:e,cancelled:r??null}).where((0,Z.and)((0,Z.eq)(tI.id,t),(0,Z.eq)(tI.status,"pending"))).returning({id:tI.id})).length>0}async listPendingPrompts(t){let e=await this.db();return(await e.select().from(tI).where((0,Z.and)((0,Z.eq)(tI.boxId,t),(0,Z.eq)(tI.status,"pending"))).orderBy((0,tt.asc)(tI.createdAt))).map(t$)}async setPromptResult(t,e){let r=await this.db();await r.update(tI).set({result:e}).where((0,Z.eq)(tI.id,t))}async enqueueCreateJob(t){let e=await this.db();await e.insert(tT).values({id:t.id,status:t.status,request:t.request,result:t.result??null,claimedBy:t.claimedBy??null,createdAt:t.createdAt,startedAt:t.startedAt??null,finishedAt:t.finishedAt??null}).onConflictDoNothing({target:tT.id})}async getCreateJob(t){let e=await this.db(),r=await e.select().from(tT).where((0,Z.eq)(tT.id,t));return r[0]?tk(r[0]):null}async listCreateJobs(t){let e=(await this.db()).select().from(tT),r=t?.status?.length?e.where((0,Z.inArray)(tT.status,t.status)):e;return(await r.orderBy((0,tt.desc)(tT.createdAt)).limit(t?.limit??100)).map(tk)}async claimNextCreateJob(t){let e=await this.db(),r=e.select({id:tT.id}).from(tT).where((0,Z.eq)(tT.status,"queued")).orderBy((0,tt.asc)(tT.createdAt)).limit(1),a=await e.update(tT).set({status:"running",claimedBy:t,startedAt:new Date().toISOString()}).where((0,Z.and)((0,Z.inArray)(tT.id,r),(0,Z.eq)(tT.status,"queued"))).returning();return a[0]?tk(a[0]):null}async completeCreateJob(t,e,r){let a=await this.db();await a.update(tT).set({status:e,result:r,finishedAt:new Date().toISOString()}).where((0,Z.eq)(tT.id,t))}async prunePrompts(t){let e=await this.db();return(await e.delete(tI).where((0,Z.or)((0,Z.and)((0,Z.eq)(tI.status,"answered"),(0,Z.lt)(tI.createdAt,t)),(0,Z.and)((0,Z.isNotNull)(tI.expiresAt),(0,Z.lt)(tI.expiresAt,t)))).returning({id:tI.id})).length}async pruneCreateJobs(t){let e=await this.db();return(await e.delete(tT).where((0,Z.and)((0,Z.inArray)(tT.status,["done","failed"]),(0,Z.isNotNull)(tT.finishedAt),(0,Z.lt)(tT.finishedAt,t))).returning({id:tT.id})).length}},tO=(0,a.join)(d.STATE_DIR,"hub","custody"),tU=class{root;constructor(t={}){this.root=t.root??tO}async put(t,r){let s=$(t),i=(0,a.join)(this.root,s),o=_(r),d=await this.readEntry(s);if(d&&d.entry.sha256===o)return{...d.entry,changed:!1};await (0,e.mkdir)((0,a.dirname)(i),{recursive:!0,mode:448});let l=`${i}.${(0,n.randomBytes)(6).toString("hex")}.tmp`;try{await (0,e.writeFile)(l,r,{mode:384}),await (0,e.chmod)(l,384),await (0,e.rename)(l,i)}catch(t){throw await (0,e.rm)(l,{force:!0}),t}let u=await (0,e.stat)(i);return{path:s,size:r.length,sha256:o,mode:511&u.mode,updatedAt:u.mtime.toISOString(),changed:!0}}async get(t){return this.readEntry($(t))}async stat(t){let e=await this.readEntry($(t));return e?e.entry:null}async list(t){let e=void 0===t?"":k(t),r=[];for(let t of(await this.walk(this.root))){if(e.length>0&&t!==e&&!t.startsWith(`${e}/`))continue;let a=await this.readEntry(t);a&&r.push(a.entry)}return r.sort((t,e)=>t.path<e.path?-1:+(t.path>e.path)),r}async delete(t){let r=$(t),s=(0,a.join)(this.root,r);try{return await (0,e.rm)(s),!0}catch(t){if("ENOENT"===t.code)return!1;throw t}}async putStream(t,r,s={}){let o=$(t),d=(0,a.join)(this.root,o);await (0,e.mkdir)((0,a.dirname)(d),{recursive:!0,mode:448});let l=`${d}.${(0,n.randomBytes)(6).toString("hex")}.tmp`,u=(0,n.createHash)("sha256"),c=0,p=new ta.Transform({transform(t,e,r){(c+=t.length,void 0!==s.maxBytes&&c>s.maxBytes)?r(new E(s.maxBytes)):(u.update(t),r(null,t))}});try{await (0,tr.pipeline)(r,p,(0,i.createWriteStream)(l,{mode:384}))}catch(t){throw await (0,e.rm)(l,{force:!0}),t}let h=u.digest("hex"),m=await this.readEntryMeta(o);if(m&&m.sha256===h)return await (0,e.rm)(l,{force:!0}),{...m,changed:!1};try{await (0,e.chmod)(l,384),await (0,e.rename)(l,d)}catch(t){throw await (0,e.rm)(l,{force:!0}),t}let g=await (0,e.stat)(d);return{path:o,size:c,sha256:h,mode:511&g.mode,updatedAt:g.mtime.toISOString(),changed:!0}}async getStream(t){let e=$(t),r=await this.readEntryMeta(e);return r?{entry:r,data:(0,i.createReadStream)((0,a.join)(this.root,e))}:null}async readEntryMeta(t){let r=(0,a.join)(this.root,t);try{let a=await (0,e.stat)(r);if(!a.isFile())return null;let s=(0,n.createHash)("sha256");return await (0,tr.pipeline)((0,i.createReadStream)(r),new ta.Transform({transform(t,e,r){s.update(t),r()}})),{path:t,size:a.size,sha256:s.digest("hex"),mode:511&a.mode,updatedAt:a.mtime.toISOString()}}catch(t){if("ENOENT"===t.code)return null;throw t}}async readEntry(t){let r=(0,a.join)(this.root,t);try{let[a,s]=await Promise.all([(0,e.readFile)(r),(0,e.stat)(r)]);return{entry:{path:t,size:a.length,sha256:_(a),mode:511&s.mode,updatedAt:s.mtime.toISOString()},data:a}}catch(e){let t=e.code;if("ENOENT"===t||"EISDIR"===t)return null;throw e}}async walk(t){let r;try{r=await (0,e.readdir)(t,{withFileTypes:!0})}catch(t){if("ENOENT"===t.code)return[];throw t}let s=[];for(let e of r){let r=(0,a.join)(t,e.name);e.isDirectory()?s.push(...await this.walk(r)):e.isFile()&&!e.name.endsWith(".tmp")&&s.push((0,a.relative)(this.root,r).split(a.sep).join("/"))}return s}};t.s(["DEFAULT_CUSTODY_DIR",0,tO,"DEFAULT_SQLITE_STORE_PATH",0,tC,"FsCustodyStore",0,tU,"PG_SCHEMA_SQL",0,tf,"PostgresStore",0,tB,"SQLITE_SCHEMA_SQL",0,tE,"SqliteStore",0,tL,"cloneRepoWithLfs",0,tn,"drainCreateJobs",0,to,"drainOneCreateJob",0,ti,"handleRelayRequest",0,tp,"makeControlPlaneCreateBox",0,function(t){return async(e,r)=>{let a=t.logFor?.(r)??t.log??(()=>{}),s=t.tmpDir(r);try{let r;a(`leasing a push token for ${e.repoUrl}`);let n=await t.leaseRemoteUrl(e.repoUrl);if(a(`cloning ${e.repoUrl}${e.branch?`@${e.branch}`:""} into ${s}`),await t.cloneRepo(n,e.repoUrl,s,e.branch),t.fetchSeedMaterial)try{let n=await t.fetchSeedMaterial(e.repoUrl,s);if(r=n?.carry?.length?n.carry:void 0,n&&n.files>0){let t=[n.repoHeadSha?`at ${n.repoHeadSha.slice(0,8)}`:null,n.capturedAt?`captured ${n.capturedAt}`:null].filter(Boolean).join(", ");a(`applied ${String(n.files)} seed file(s) from custody${t?` (${t})`:""}`)}}catch(e){if(e instanceof Error&&"CarrySeedError"===e.name)throw e;let t=e instanceof Error?e.message:String(e);a(`seed material unavailable (continuing with a bare clone): ${t}`)}a(`provisioning ${e.provider} box from the clone`);let i=await t.createBox({workspacePath:s,name:e.name,repoUrl:e.repoUrl,provider:e.provider,...r?{carry:r}:{},agent:e.agent,prompt:e.prompt,agentArgs:e.agentArgs,startAgent:e.startAgent,opts:e.opts,onLog:a});return a(`created box ${i.id}`),{boxId:i.id,agentStartError:i.agentStartError}}finally{await t.cleanup(s)}}},"makeStore",0,function(t){if(!t||"memory"===t)return new g;if(t.startsWith("postgres://")||t.startsWith("postgresql://"))return new tB({connectionString:t});if(t.startsWith("sqlite:")){let e=t.slice(7).replace(/^\/\//,"");if(!e)throw Error(`store spec has no path: ${t}`);return new tL({path:e})}if(":memory:"===t||t.startsWith("/")||t.startsWith(".")||t.endsWith(".db"))return new tL({path:t});throw Error(`unknown store spec: ${t}`)}],54434),t.s([],7876)}];
|
|
116
116
|
|
|
117
117
|
//# sourceMappingURL=packages_relay_dist_control-plane_03a-9aj.js.map
|