reeval 0.22.0 → 0.23.0
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 +27 -0
- package/README.md +15 -15
- package/dist/{adapter-Di9H2etg.js → adapter-Dlq3-4OS.js} +5 -5
- package/dist/{adapter-Di9H2etg.js.map → adapter-Dlq3-4OS.js.map} +1 -1
- package/dist/{agent-B-6GFDqA.js → agent-OsAfayRf.js} +4 -4
- package/dist/{agent-B-6GFDqA.js.map → agent-OsAfayRf.js.map} +1 -1
- package/dist/{agents-KBTYhSSh.js → agents-BztvTkfM.js} +15 -15
- package/dist/{agents-KBTYhSSh.js.map → agents-BztvTkfM.js.map} +1 -1
- package/dist/{app-files-Cmh9FGr5.js → app-files-6NHzghym.js} +3 -3
- package/dist/app-files-6NHzghym.js.map +1 -0
- package/dist/{assemble-DNVBTBp_.js → assemble-Doa1m-HW.js} +14 -13
- package/dist/{assemble-DNVBTBp_.js.map → assemble-Doa1m-HW.js.map} +1 -1
- package/dist/{assemble-CBMRIhso.js → assemble-XrZskSNj.js} +1 -1
- package/dist/{attach-EbDGKGTO.js → attach-BH2HdwH_.js} +71 -4
- package/dist/attach-BH2HdwH_.js.map +1 -0
- package/dist/{attempt-host-DQvynDHk.js → attempt-host-8mQV8Uee.js} +6 -6
- package/dist/{attempt-host-DQvynDHk.js.map → attempt-host-8mQV8Uee.js.map} +1 -1
- package/dist/boat-DKRH0Gv7.js +1 -0
- package/dist/boat-DKjqo_ie.js +704 -0
- package/dist/boat-DKjqo_ie.js.map +1 -0
- package/dist/boat-images-CRN_U_eG.js +366 -0
- package/dist/boat-images-CRN_U_eG.js.map +1 -0
- package/dist/{bundle-DZstHDeW.js → bundle-DU2aQVeq.js} +95 -33
- package/dist/bundle-DU2aQVeq.js.map +1 -0
- package/dist/{capture-BkbPsfej.js → capture-By1byHaX.js} +43 -21
- package/dist/capture-By1byHaX.js.map +1 -0
- package/dist/capture-BzjNv0qP.js +1 -0
- package/dist/{cli-BgBBuxxJ.js → cli-DMHOwdVr.js} +374 -121
- package/dist/cli-DMHOwdVr.js.map +1 -0
- package/dist/{cli-spec-B5L9n-DV.js → cli-spec-D0wuUaj9.js} +98 -42
- package/dist/cli-spec-D0wuUaj9.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/{client-DMEYR3MA.js → client-B41UK150.js} +2 -2
- package/dist/{client-DMEYR3MA.js.map → client-B41UK150.js.map} +1 -1
- package/dist/{command-BKb8eN_X.js → command-8GIHYGZf.js} +9 -9
- package/dist/{command-BKb8eN_X.js.map → command-8GIHYGZf.js.map} +1 -1
- package/dist/{command-D_w_kDpI.js → command-CAmnWLFL.js} +14 -14
- package/dist/{command-D_w_kDpI.js.map → command-CAmnWLFL.js.map} +1 -1
- package/dist/{command-loXH2jHr.js → command-CXxckfsq.js} +12 -12
- package/dist/{command-loXH2jHr.js.map → command-CXxckfsq.js.map} +1 -1
- package/dist/{command-Dwlh0Vhu.js → command-ao0NZ8h0.js} +14 -14
- package/dist/{command-Dwlh0Vhu.js.map → command-ao0NZ8h0.js.map} +1 -1
- package/dist/{commands-Dqli45sR.js → commands-B3lnIPj5.js} +1 -1
- package/dist/{commands-Cuf57OYb.js → commands-ttChCsAy.js} +15 -15
- package/dist/{commands-Cuf57OYb.js.map → commands-ttChCsAy.js.map} +1 -1
- package/dist/{config-C0RKt00M.js → config-myJT1Qjc.js} +25 -16
- package/dist/config-myJT1Qjc.js.map +1 -0
- package/dist/{context-DrEAtUyg.js → context-DnzR9TNK.js} +2 -2
- package/dist/{context-DrEAtUyg.js.map → context-DnzR9TNK.js.map} +1 -1
- package/dist/cost-CdRX1s2p.js +1 -0
- package/dist/{cursor-catalog-CRsFxorF.js → cursor-catalog-CUQrabJ_.js} +2 -2
- package/dist/{cursor-catalog-CRsFxorF.js.map → cursor-catalog-CUQrabJ_.js.map} +1 -1
- package/dist/daytona-Dfhwtr9P.js +677 -0
- package/dist/daytona-Dfhwtr9P.js.map +1 -0
- package/dist/daytona-image-CnG6G00x.js +183 -0
- package/dist/daytona-image-CnG6G00x.js.map +1 -0
- package/dist/daytona-image-yJK3c4EV.js +1 -0
- package/dist/{db-ErnJ-gMD.js → db-5H95sFii.js} +7 -7
- package/dist/{db-ErnJ-gMD.js.map → db-5H95sFii.js.map} +1 -1
- package/dist/db-Bbg1n_2M.js +2 -0
- package/dist/{default-effort-DHzj84dD.js → default-effort-CtNY9CGW.js} +1 -1
- package/dist/{default-effort-D70cTG00.js → default-effort-DYpCkJRk.js} +2 -2
- package/dist/{default-effort-D70cTG00.js.map → default-effort-DYpCkJRk.js.map} +1 -1
- package/dist/{docker-CFWzZOEk.js → docker-CR0JZ1FE.js} +2 -2
- package/dist/{docker-CFWzZOEk.js.map → docker-CR0JZ1FE.js.map} +1 -1
- package/dist/docker-kpudeSxV.js +1 -0
- package/dist/{doctor-B7utCSdh.js → doctor-aE-RMbB_.js} +25 -20
- package/dist/doctor-aE-RMbB_.js.map +1 -0
- package/dist/{environment-C0Gg8kyN.js → environment-C8pUCD_A.js} +137 -52
- package/dist/environment-C8pUCD_A.js.map +1 -0
- package/dist/{errors-C1GBcWE2.js → errors-DPUoUTdK.js} +2 -2
- package/dist/{errors-C1GBcWE2.js.map → errors-DPUoUTdK.js.map} +1 -1
- package/dist/{eval-source-CsW5VIXS.js → eval-source-CaLIGH3U.js} +5 -5
- package/dist/{eval-source-CsW5VIXS.js.map → eval-source-CaLIGH3U.js.map} +1 -1
- package/dist/{evaluate-BHQyAszQ.js → evaluate-4kBVtwZZ.js} +37 -28
- package/dist/evaluate-4kBVtwZZ.js.map +1 -0
- package/dist/{evaluate-DzHq4EsU.d.ts → evaluate-DHaNtgVf.d.ts} +2 -2
- package/dist/events-CXxFvVMK.js +475 -0
- package/dist/events-CXxFvVMK.js.map +1 -0
- package/dist/{fake-bootstrap-VpisF1WE.js → fake-bootstrap-CzxrCqO3.js} +2 -2
- package/dist/{fake-bootstrap-VpisF1WE.js.map → fake-bootstrap-CzxrCqO3.js.map} +1 -1
- package/dist/files-BFnkOAhn.js +1 -0
- package/dist/files-BgQxoDlN.js +1 -0
- package/dist/{files-Cv856jLN.js → files-BkvxIqfI.js} +4 -4
- package/dist/{files-Cv856jLN.js.map → files-BkvxIqfI.js.map} +1 -1
- package/dist/{files-g1watgRC.js → files-CDfG8swM.js} +2 -2
- package/dist/{files-g1watgRC.js.map → files-CDfG8swM.js.map} +1 -1
- package/dist/files-CSe4VaMj.js +1 -0
- package/dist/{files-qjeqXnfE.js → files-CX_mmvCc.js} +6 -6
- package/dist/{files-qjeqXnfE.js.map → files-CX_mmvCc.js.map} +1 -1
- package/dist/{files-BrGVs4gY.js → files-Cs2dtb7-.js} +2 -2
- package/dist/{files-BrGVs4gY.js.map → files-Cs2dtb7-.js.map} +1 -1
- package/dist/{files-CAzVG3Rr.js → files-D6M7J3iX.js} +1 -1
- package/dist/{files-BuKWZCzY.js → files-DgHeTdCZ.js} +5 -5
- package/dist/{files-BuKWZCzY.js.map → files-DgHeTdCZ.js.map} +1 -1
- package/dist/{files-BCraBodb.js → files-DpwJW3w6.js} +3 -3
- package/dist/{files-BCraBodb.js.map → files-DpwJW3w6.js.map} +1 -1
- package/dist/gateway.d.ts +1 -1
- package/dist/{git-DOrOtAiD.js → git-BnnNEXqh.js} +2 -2
- package/dist/{git-DOrOtAiD.js.map → git-BnnNEXqh.js.map} +1 -1
- package/dist/{harness-install-Dxho1yaU.js → harness-install-BfMBYDfP.js} +3 -3
- package/dist/{harness-install-Dxho1yaU.js.map → harness-install-BfMBYDfP.js.map} +1 -1
- package/dist/harness.d.ts +1 -1
- package/dist/hosted-5Zz2peTR.js +260 -0
- package/dist/hosted-5Zz2peTR.js.map +1 -0
- package/dist/hosted-Co-waHe0.js +131 -0
- package/dist/hosted-Co-waHe0.js.map +1 -0
- package/dist/hosted-run-202QicZ-.js +1 -0
- package/dist/hosted-run-BfAPIMyT.js +230 -0
- package/dist/hosted-run-BfAPIMyT.js.map +1 -0
- package/dist/{ids-B-JKTCP8.js → ids-a6cr243_.js} +17 -12
- package/dist/ids-a6cr243_.js.map +1 -0
- package/dist/{images-Ch1y1t6_.js → images-DtXwj2wL.js} +13 -12
- package/dist/images-DtXwj2wL.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/init-BiL6B3S4.js +1 -0
- package/dist/{init-C2HqCwnt.js → init-Ci_IAp8p.js} +4 -4
- package/dist/{init-C2HqCwnt.js.map → init-Ci_IAp8p.js.map} +1 -1
- package/dist/{ink-list-BbKXElcQ.js → ink-list-Dnh6XD3C.js} +2 -2
- package/dist/{ink-list-BbKXElcQ.js.map → ink-list-Dnh6XD3C.js.map} +1 -1
- package/dist/{inputs-load-CGPyigMC.js → inputs-load-DPUP_IFL.js} +2 -2
- package/dist/{inputs-load-CGPyigMC.js.map → inputs-load-DPUP_IFL.js.map} +1 -1
- package/dist/inputs-load-M-BGe7gd.js +1 -0
- package/dist/{inputs-5UIDpjz-.js → inputs-z4JqnQ5g.js} +6 -6
- package/dist/{inputs-5UIDpjz-.js.map → inputs-z4JqnQ5g.js.map} +1 -1
- package/dist/internal/vm.d.ts +16 -0
- package/dist/internal/vm.js +22 -0
- package/dist/internal/vm.js.map +1 -0
- package/dist/{invocations-BrZAMuTb.js → invocations-C1gY3E0J.js} +3 -3
- package/dist/{invocations-BrZAMuTb.js.map → invocations-C1gY3E0J.js.map} +1 -1
- package/dist/{jiti-radm1Soi.js → jiti-ILwyxt93.js} +3 -1
- package/dist/{jiti-radm1Soi.js.map → jiti-ILwyxt93.js.map} +1 -1
- package/dist/judge.d.ts +1 -1
- package/dist/kinds-DEKXOWVJ.js +592 -0
- package/dist/kinds-DEKXOWVJ.js.map +1 -0
- package/dist/{layout-Czh5wOpz.js → layout-nCnU9Vu2.js} +2 -2
- package/dist/{layout-Czh5wOpz.js.map → layout-nCnU9Vu2.js.map} +1 -1
- package/dist/{list-B_C0k5ex.js → list-MK4L8tfW.js} +4 -4
- package/dist/{list-B_C0k5ex.js.map → list-MK4L8tfW.js.map} +1 -1
- package/dist/{live-DgFm0H90.js → live-BkPNXVmN.js} +7 -7
- package/dist/{live-DgFm0H90.js.map → live-BkPNXVmN.js.map} +1 -1
- package/dist/{live-DGgIrVw0.js → live-Dlq-S2yy.js} +2 -2
- package/dist/{live-DGgIrVw0.js.map → live-Dlq-S2yy.js.map} +1 -1
- package/dist/live-gZtkBwuo.js +1 -0
- package/dist/{machine-service-2lIv5UWF.js → machine-service-Byl0BlcT.js} +1 -1
- package/dist/{machine-service-Ct_1XMMi.js → machine-service-CZiXiVsS.js} +286 -97
- package/dist/machine-service-CZiXiVsS.js.map +1 -0
- package/dist/machines-Ch5bhgvk.js +279 -0
- package/dist/machines-Ch5bhgvk.js.map +1 -0
- package/dist/model-C6aoJLg_.js +1 -0
- package/dist/{model-E5X8YBJM.js → model-CRh8aiYS.js} +2 -2
- package/dist/{model-E5X8YBJM.js.map → model-CRh8aiYS.js.map} +1 -1
- package/dist/{model-DF77SgZv.js → model-LoLnq9y1.js} +2 -2
- package/dist/{model-DF77SgZv.js.map → model-LoLnq9y1.js.map} +1 -1
- package/dist/{model-B1tdv9-d.js → model-lLaUxxno.js} +1 -1
- package/dist/{node-BjuhqQwa.js → node-BQjSQw0d.js} +4 -4
- package/dist/{node-BjuhqQwa.js.map → node-BQjSQw0d.js.map} +1 -1
- package/dist/options-I9I3FwMl.js +1 -0
- package/dist/{patch-BR8rdl7r.js → patch-D8X6VB-e.js} +2 -2
- package/dist/{patch-BR8rdl7r.js.map → patch-D8X6VB-e.js.map} +1 -1
- package/dist/{plan-BcT4G5jj.js → plan-DgIVIrXJ.js} +7 -7
- package/dist/{plan-BcT4G5jj.js.map → plan-DgIVIrXJ.js.map} +1 -1
- package/dist/{plugins-cC0sqoDA.js → plugins-DvEbow6a.js} +6 -595
- package/dist/plugins-DvEbow6a.js.map +1 -0
- package/dist/{preflight-DySHXeFJ.js → preflight-BKGbxN67.js} +8 -7
- package/dist/preflight-BKGbxN67.js.map +1 -0
- package/dist/{preflight-C9OtTb7k.js → preflight-Qm4wE094.js} +9 -4
- package/dist/preflight-Qm4wE094.js.map +1 -0
- package/dist/preflight-dJqs5x3r.js +1 -0
- package/dist/preflight-fyV5nnea.js +1 -0
- package/dist/{prepare-nbX1CXXg.js → prepare-BAjRSoku.js} +19 -39
- package/dist/prepare-BAjRSoku.js.map +1 -0
- package/dist/prepare-CRPPfRJf.js +2 -0
- package/dist/prices-C0gKS_8G.js +1 -0
- package/dist/{prices-BrY_ihLs.js → prices-DCokI_Ka.js} +3 -3
- package/dist/{prices-BrY_ihLs.js.map → prices-DCokI_Ka.js.map} +1 -1
- package/dist/{provenance-CkykifD9.js → provenance-CSyRCc9B.js} +3 -3
- package/dist/{provenance-CkykifD9.js.map → provenance-CSyRCc9B.js.map} +1 -1
- package/dist/{providers-bNgfKa6m.js → providers-DkaEJvF5.js} +173 -31
- package/dist/providers-DkaEJvF5.js.map +1 -0
- package/dist/providers-DxZ26YoG.js +1 -0
- package/dist/{query-DhV3a8lM.js → query-BL66BOqL.js} +2 -2
- package/dist/{query-DhV3a8lM.js.map → query-BL66BOqL.js.map} +1 -1
- package/dist/query-C9OKU1Vz.js +1 -0
- package/dist/{questions-Csv64WCb.js → questions-boVPzGoC.js} +5 -5
- package/dist/{questions-Csv64WCb.js.map → questions-boVPzGoC.js.map} +1 -1
- package/dist/recipe-qyIpP96r.js +128 -0
- package/dist/recipe-qyIpP96r.js.map +1 -0
- package/dist/{record--vHreTLk.js → record-D1_D1KFY.js} +5 -3
- package/dist/record-D1_D1KFY.js.map +1 -0
- package/dist/{remarks-CYFOsnz5.js → remarks-DEvk5f8v.js} +7 -7
- package/dist/{remarks-CYFOsnz5.js.map → remarks-DEvk5f8v.js.map} +1 -1
- package/dist/{remote-0CHog7Oq.js → remote-CQoBRpOv.js} +5 -5
- package/dist/{remote-0CHog7Oq.js.map → remote-CQoBRpOv.js.map} +1 -1
- package/dist/resolve-BdpO8BN1.js +1 -0
- package/dist/{resolve-Bul8lHaa.js → resolve-Bfo8sjd-.js} +2 -2
- package/dist/{resolve-Bul8lHaa.js.map → resolve-Bfo8sjd-.js.map} +1 -1
- package/dist/{resolve-DorSHDBs.js → resolve-D2RqmybX.js} +8 -8
- package/dist/{resolve-DorSHDBs.js.map → resolve-D2RqmybX.js.map} +1 -1
- package/dist/{results-DhMgRkR0.js → results-BpxzyoMd.js} +5 -5
- package/dist/{results-DhMgRkR0.js.map → results-BpxzyoMd.js.map} +1 -1
- package/dist/{resume-C8Ihfy-C.js → resume-2ekm_9OB.js} +5 -5
- package/dist/{resume-C8Ihfy-C.js.map → resume-2ekm_9OB.js.map} +1 -1
- package/dist/{retry-Bfk7pDti.js → retry-CAhpW1hH.js} +4 -4
- package/dist/{retry-Bfk7pDti.js.map → retry-CAhpW1hH.js.map} +1 -1
- package/dist/{runtime-CPUH0Vk5.js → runtime-C5fKSFCz.js} +4 -4
- package/dist/{runtime-CPUH0Vk5.js.map → runtime-C5fKSFCz.js.map} +1 -1
- package/dist/sandbox/boat.d.ts +11 -3
- package/dist/sandbox/boat.js +18 -4
- package/dist/sandbox/boat.js.map +1 -1
- package/dist/sandbox/daytona.d.ts +30 -0
- package/dist/sandbox/daytona.js +49 -0
- package/dist/sandbox/daytona.js.map +1 -0
- package/dist/{sandbox-z8q_4Ywn.js → sandbox-t-Q-8lA_.js} +2 -2
- package/dist/{sandbox-z8q_4Ywn.js.map → sandbox-t-Q-8lA_.js.map} +1 -1
- package/dist/sandbox.d.ts +1 -1
- package/dist/sandbox.js +1 -1
- package/dist/{server-BsQZtuF9.js → server-BcLg9WzE.js} +10 -10
- package/dist/{server-BsQZtuF9.js.map → server-BcLg9WzE.js.map} +1 -1
- package/dist/server-Buav2-CG.js +1 -0
- package/dist/{source-9HWaTEgV.js → source-CrXM19HD.js} +2 -2
- package/dist/{source-9HWaTEgV.js.map → source-CrXM19HD.js.map} +1 -1
- package/dist/source-dvxkqYvk.js +1 -0
- package/dist/{src-CotUxxQV.js → src-5dCrqbFd.js} +1 -1
- package/dist/{src-boB6D-5T.js → src-Bf5RZlPi.js} +2 -2
- package/dist/{src-boB6D-5T.js.map → src-Bf5RZlPi.js.map} +1 -1
- package/dist/{src-CWfy8ct8.js → src-C5rrQlt8.js} +1107 -382
- package/dist/src-C5rrQlt8.js.map +1 -0
- package/dist/{src-BuGc40IF.js → src-C6MsGyD6.js} +1 -1
- package/dist/{src-C2K5_afU.js → src-Cf4vRyea.js} +1 -1
- package/dist/src-DEbNp-rx.js +1 -0
- package/dist/{src-D-PwBaBB.js → src-DrLbG1HM.js} +1 -1
- package/dist/{src-CcrQQB0_.js → src-Ds1pmXTg.js} +1 -1
- package/dist/{src-CSVJjghq.js → src-DwcCKsV0.js} +2 -2
- package/dist/{src-B2eHTCnp.js → src-VG2IRoT4.js} +1 -1
- package/dist/{src-BfOlH_Bu.js → src-io_SKoZ5.js} +1 -1
- package/dist/ssh-pool-BorCizYw.js +1 -0
- package/dist/ssh-pool-Dvfx5GuV.js +174 -0
- package/dist/ssh-pool-Dvfx5GuV.js.map +1 -0
- package/dist/{start-Db5VRcRZ.js → start-COB07NpH.js} +126 -68
- package/dist/start-COB07NpH.js.map +1 -0
- package/dist/{state-DUYdzNA7.js → state-B319V1p8.js} +5 -5
- package/dist/{state-DUYdzNA7.js.map → state-B319V1p8.js.map} +1 -1
- package/dist/state-C5oBvmoZ.js +1 -0
- package/dist/store/local.d.ts +1 -1
- package/dist/store/s3.d.ts +1 -1
- package/dist/suite-BwJGOhCZ.js +2 -0
- package/dist/{suite-DjGxmDSY.js → suite-D1tgXZxM.js} +2 -2
- package/dist/{suite-DjGxmDSY.js.map → suite-D1tgXZxM.js.map} +1 -1
- package/dist/{summary-BK5Sa_N0.js → summary-ClLns_wv.js} +5 -5
- package/dist/{summary-BK5Sa_N0.js.map → summary-ClLns_wv.js.map} +1 -1
- package/dist/{sync-DUi_P2UJ.js → sync-mOG74RXH.js} +5 -5
- package/dist/{sync-DUi_P2UJ.js.map → sync-mOG74RXH.js.map} +1 -1
- package/dist/{tart-BQ_Ap0l4.js → tart-DMppfbEm.js} +7 -6
- package/dist/{tart-BQ_Ap0l4.js.map → tart-DMppfbEm.js.map} +1 -1
- package/dist/{tart-bake-D1RttYfM.js → tart-bake-Cva_qdir.js} +7 -7
- package/dist/{tart-bake-D1RttYfM.js.map → tart-bake-Cva_qdir.js.map} +1 -1
- package/dist/{tart-bake-DjFcsG3N.js → tart-bake-DVIoXWr_.js} +1 -1
- package/dist/{tart-cli-BOcluha1.js → tart-cli-D88c5YYJ.js} +1 -1
- package/dist/{tart-cli-gA9xEaQL.js → tart-cli-LzDud2Z6.js} +2 -2
- package/dist/{tart-cli-gA9xEaQL.js.map → tart-cli-LzDud2Z6.js.map} +1 -1
- package/dist/{tart-hosts-CWse-ASo.js → tart-hosts-8N6Tt7Yb.js} +1 -1
- package/dist/{tart-hosts-CHNrfV6u.js → tart-hosts-CTRY5kQ2.js} +3 -3
- package/dist/{tart-hosts-CHNrfV6u.js.map → tart-hosts-CTRY5kQ2.js.map} +1 -1
- package/dist/{tart-images-CLBjfF9u.js → tart-images-JfHirU8W.js} +2 -2
- package/dist/{tart-images-CLBjfF9u.js.map → tart-images-JfHirU8W.js.map} +1 -1
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +4 -4
- package/dist/{tool-class-krsmEo44.js → tool-class-CncfCw03.js} +2 -2
- package/dist/{tool-class-krsmEo44.js.map → tool-class-CncfCw03.js.map} +1 -1
- package/dist/{types-DKK8jj--.d.ts → types-BDo8ttQo.d.ts} +157 -17
- package/dist/{ui-DKYjTVpn.js → ui-DUiVPbQ2.js} +53 -484
- package/dist/ui-DUiVPbQ2.js.map +1 -0
- package/dist/view/index.d.ts +1 -1
- package/dist/view/index.js +4 -4
- package/dist/views-B0qZR5Ef.js +2 -0
- package/dist/{views-B1zVLJsF.js → views-CiZGh3ws.js} +6 -6
- package/dist/{views-B1zVLJsF.js.map → views-CiZGh3ws.js.map} +1 -1
- package/dist/vm-container-BVn7pXfD.js +148 -0
- package/dist/vm-container-BVn7pXfD.js.map +1 -0
- package/dist/vm-images-CNk-Zl2a.js +375 -0
- package/dist/vm-images-CNk-Zl2a.js.map +1 -0
- package/dist/{worker-entry-DrAYYt0M.js → worker-entry-DmXQ2Znu.js} +5 -5
- package/dist/{worker-entry-DrAYYt0M.js.map → worker-entry-DmXQ2Znu.js.map} +1 -1
- package/dist/workspace-CRgFdmgW.js +1 -0
- package/dist/{workspace-DwTe1zo6.js → workspace-wwvwEHzP.js} +5 -5
- package/dist/{workspace-DwTe1zo6.js.map → workspace-wwvwEHzP.js.map} +1 -1
- package/package.json +14 -2
- package/skills/reeval/references/environments.md +4 -3
- package/dist/app-files-Cmh9FGr5.js.map +0 -1
- package/dist/attach-EbDGKGTO.js.map +0 -1
- package/dist/boat-Bzz8L-KQ.js +0 -701
- package/dist/boat-Bzz8L-KQ.js.map +0 -1
- package/dist/boat-Dek8ftIt.js +0 -120
- package/dist/boat-Dek8ftIt.js.map +0 -1
- package/dist/bundle-DZstHDeW.js.map +0 -1
- package/dist/capture-BkbPsfej.js.map +0 -1
- package/dist/capture-CUAvk9KM.js +0 -1
- package/dist/cli-BgBBuxxJ.js.map +0 -1
- package/dist/cli-spec-B5L9n-DV.js.map +0 -1
- package/dist/config-C0RKt00M.js.map +0 -1
- package/dist/cost-IM80LyGD.js +0 -1
- package/dist/db-3o8s2EyD.js +0 -2
- package/dist/docker-DrMnpL84.js +0 -1
- package/dist/doctor-B7utCSdh.js.map +0 -1
- package/dist/environment-C0Gg8kyN.js.map +0 -1
- package/dist/evaluate-BHQyAszQ.js.map +0 -1
- package/dist/files-BjOJw4sn.js +0 -1
- package/dist/files-D-Lir4aE.js +0 -1
- package/dist/files-DRlJ0Xr2.js +0 -1
- package/dist/ids-B-JKTCP8.js.map +0 -1
- package/dist/images-Ch1y1t6_.js.map +0 -1
- package/dist/init-CM9xwyre.js +0 -1
- package/dist/inputs-load-C82HOKnb.js +0 -1
- package/dist/live-C9Et_BVT.js +0 -1
- package/dist/machine-service-Ct_1XMMi.js.map +0 -1
- package/dist/machines-BnquHcBZ.js +0 -120
- package/dist/machines-BnquHcBZ.js.map +0 -1
- package/dist/model-Bcy4Qjmm.js +0 -1
- package/dist/options-C989kuVE.js +0 -1
- package/dist/plugins-cC0sqoDA.js.map +0 -1
- package/dist/preflight-BMVDBcux.js +0 -1
- package/dist/preflight-C9OtTb7k.js.map +0 -1
- package/dist/preflight-DySHXeFJ.js.map +0 -1
- package/dist/preflight-zsAn3heN.js +0 -1
- package/dist/prepare-MaRWRhNT.js +0 -2
- package/dist/prepare-nbX1CXXg.js.map +0 -1
- package/dist/prices-B1vm_lPk.js +0 -1
- package/dist/providers-BkLGzaSY.js +0 -1
- package/dist/providers-bNgfKa6m.js.map +0 -1
- package/dist/query-B2SQddoV.js +0 -1
- package/dist/record--vHreTLk.js.map +0 -1
- package/dist/resolve-Bm9ZyFR-.js +0 -1
- package/dist/server-ZaMzUNmV.js +0 -1
- package/dist/source-BcBDj-R0.js +0 -1
- package/dist/src-CWfy8ct8.js.map +0 -1
- package/dist/src-jYqNkT-F.js +0 -1
- package/dist/start-Db5VRcRZ.js.map +0 -1
- package/dist/state-CKIjZZRK.js +0 -1
- package/dist/suite-CH1aaAbs.js +0 -2
- package/dist/tarball-C8BSTAMk.js +0 -257
- package/dist/tarball-C8BSTAMk.js.map +0 -1
- package/dist/ui-DKYjTVpn.js.map +0 -1
- package/dist/views-DCjtw1jF.js +0 -2
- package/dist/workspace-CnRbV8cM.js +0 -1
package/dist/boat-Bzz8L-KQ.js
DELETED
|
@@ -1,701 +0,0 @@
|
|
|
1
|
-
import { Jt as run, Nt as slotLayout, t as connectSsh } from "./src-CWfy8ct8.js";
|
|
2
|
-
import { g as redactSecrets, x as registerSecret } from "./redact-t-L3VGy8.js";
|
|
3
|
-
import { t as InfraError } from "./types-CbcnJxCy.js";
|
|
4
|
-
import { yt as egressLabel } from "./config-C0RKt00M.js";
|
|
5
|
-
import { n as attemptDebug } from "./attempt-_dUsblVx.js";
|
|
6
|
-
import { t as PrepareError } from "./provider-ieWOn4YS.js";
|
|
7
|
-
import { t as harnessBake } from "./harness-install-Dxho1yaU.js";
|
|
8
|
-
import { r as leaseMachine } from "./machine-service-Ct_1XMMi.js";
|
|
9
|
-
import { t as startSandbox } from "./start-Db5VRcRZ.js";
|
|
10
|
-
import { createRequire } from "node:module";
|
|
11
|
-
import { join } from "node:path";
|
|
12
|
-
import { createHash, randomBytes } from "node:crypto";
|
|
13
|
-
import { tmpdir } from "node:os";
|
|
14
|
-
import { pathToFileURL } from "node:url";
|
|
15
|
-
import { connect, isIPv6 } from "node:net";
|
|
16
|
-
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
17
|
-
// src/sandbox/boat.ts
|
|
18
|
-
const BOAT_SDK = "@boatdev/sdk";
|
|
19
|
-
const BOAT_BASE_URL = "BOAT_BASE_URL";
|
|
20
|
-
/** The fix for a project without the SDK. */
|
|
21
|
-
const INSTALL_SDK = `Install the Boat SDK in this project: npm i ${BOAT_SDK}`;
|
|
22
|
-
const missing = (error) => error.code === "ERR_MODULE_NOT_FOUND" || error.code === "MODULE_NOT_FOUND";
|
|
23
|
-
let loaded;
|
|
24
|
-
/**
|
|
25
|
-
* The Boat SDK, from beside reeval or else from the project: a package manager that doesn't link
|
|
26
|
-
* peers into reeval's own `node_modules` still has it in the project's.
|
|
27
|
-
*/
|
|
28
|
-
function loadBoatSdk(projectRoot = process.cwd()) {
|
|
29
|
-
loaded ??= (async () => {
|
|
30
|
-
try {
|
|
31
|
-
return await import(BOAT_SDK);
|
|
32
|
-
} catch (error) {
|
|
33
|
-
if (!missing(error)) throw error;
|
|
34
|
-
}
|
|
35
|
-
try {
|
|
36
|
-
const path = createRequire(join(projectRoot, "noop.js")).resolve(BOAT_SDK);
|
|
37
|
-
return await import(pathToFileURL(path).href);
|
|
38
|
-
} catch (error) {
|
|
39
|
-
if (!missing(error)) throw error;
|
|
40
|
-
throw new PrepareError({
|
|
41
|
-
class: "config",
|
|
42
|
-
stage: "boat",
|
|
43
|
-
ref: null,
|
|
44
|
-
cause: null,
|
|
45
|
-
log: null,
|
|
46
|
-
usage: true,
|
|
47
|
-
message: `boat() needs the Boat SDK, which isn't installed. ${INSTALL_SDK}`
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
})();
|
|
51
|
-
loaded.catch(() => {
|
|
52
|
-
loaded = void 0;
|
|
53
|
-
});
|
|
54
|
-
return loaded;
|
|
55
|
-
}
|
|
56
|
-
/** Why `sandbox`'s key can't be read from this process's environment, or null. */
|
|
57
|
-
function boatKeyProblem(sandbox) {
|
|
58
|
-
const name = sandbox.apiKey.from;
|
|
59
|
-
const value = process.env[name];
|
|
60
|
-
if (!value) return `boat() needs a Boat API key in ${name}, which isn't set`;
|
|
61
|
-
if (/\s/.test(value)) return `${name} has whitespace or a line break in it (a key pasted from a wrapped line?); set it to the key alone`;
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
/** A client for `sandbox`'s account; the key goes from the environment to the SDK, nowhere else. */
|
|
65
|
-
async function boatClient(sandbox, projectRoot) {
|
|
66
|
-
const problem = boatKeyProblem(sandbox);
|
|
67
|
-
if (problem) throw new PrepareError({
|
|
68
|
-
class: "config",
|
|
69
|
-
stage: "boat",
|
|
70
|
-
ref: null,
|
|
71
|
-
cause: null,
|
|
72
|
-
log: null,
|
|
73
|
-
usage: true,
|
|
74
|
-
message: `${problem}. Set it in the environment or the project's .env.local.`
|
|
75
|
-
});
|
|
76
|
-
const { BoatApi, Configuration } = await loadBoatSdk(projectRoot);
|
|
77
|
-
const basePath = process.env[BOAT_BASE_URL];
|
|
78
|
-
const accessToken = process.env[sandbox.apiKey.from];
|
|
79
|
-
registerSecret(accessToken);
|
|
80
|
-
return new BoatApi(new Configuration({
|
|
81
|
-
accessToken,
|
|
82
|
-
...basePath ? { basePath } : {}
|
|
83
|
-
}));
|
|
84
|
-
}
|
|
85
|
-
/** What Boat said about a failed call: `404 not_found: …`, or the error's own message. */
|
|
86
|
-
async function boatError(error) {
|
|
87
|
-
const response = error.response;
|
|
88
|
-
if (!response) return error instanceof Error ? error.message : String(error);
|
|
89
|
-
const body = await response.text().catch(() => "");
|
|
90
|
-
let detail = body.slice(0, 300);
|
|
91
|
-
try {
|
|
92
|
-
const e = JSON.parse(body).error;
|
|
93
|
-
if (typeof e === "string") detail = e;
|
|
94
|
-
else if (e) detail = [e.code, e.message].filter(Boolean).join(": ");
|
|
95
|
-
} catch {}
|
|
96
|
-
return `${response.status}${detail ? ` ${detail}` : ""}`;
|
|
97
|
-
}
|
|
98
|
-
const status = (error) => error.response?.status;
|
|
99
|
-
/** The part of every sandbox name that says which run made it. */
|
|
100
|
-
const runTag = (runId) => createHash("sha256").update(runId).digest("hex").slice(0, 8);
|
|
101
|
-
/** `<prefix>-<run>-`: what every sandbox of the run is named with first. */
|
|
102
|
-
const runPrefix = (sandbox, runId) => `${sandbox.prefix}-${runTag(runId)}-`;
|
|
103
|
-
/** How long a created sandbox may take to be ready. */
|
|
104
|
-
const READY_TIMEOUT_MS = 12e4;
|
|
105
|
-
/** How long a check of the account may wait on Boat, so an unreachable API can't stall a plan. */
|
|
106
|
-
const LIMITS_TIMEOUT_MS = 15e3;
|
|
107
|
-
/** How long a run's cleanup may wait on one account, so an unreachable API can't stall a resume. */
|
|
108
|
-
const CLEANUP_TIMEOUT_MS = 15e3;
|
|
109
|
-
/** Boat's states a sandbox never leaves for `ready`; 'cancelled' answers 404 after it's reported. */
|
|
110
|
-
const DEAD_STATES = [
|
|
111
|
-
"archived",
|
|
112
|
-
"archiving",
|
|
113
|
-
"error",
|
|
114
|
-
"cancelled"
|
|
115
|
-
];
|
|
116
|
-
/** Past the attempt's timeout, so a sandbox whose worker was killed still goes away by itself. */
|
|
117
|
-
const TTL_MARGIN_S = 600;
|
|
118
|
-
/**
|
|
119
|
-
* How long reeval keeps deleting a sandbox that never got ready: Boat can drop a delete sent while
|
|
120
|
-
* it provisions and bring the VM up idle minutes later.
|
|
121
|
-
*/
|
|
122
|
-
const UNREADY_DELETE_MS = 6e5;
|
|
123
|
-
async function untilReady(api, id, signal) {
|
|
124
|
-
const deadline = Date.now() + READY_TIMEOUT_MS;
|
|
125
|
-
for (;;) {
|
|
126
|
-
const { sandbox } = await api.get({ sandboxId: id }).catch(async (error) => {
|
|
127
|
-
throw new InfraError(`Boat didn't report sandbox ${id}: ${await boatError(error)}`);
|
|
128
|
-
});
|
|
129
|
-
if ([
|
|
130
|
-
"ready",
|
|
131
|
-
"idle",
|
|
132
|
-
"running"
|
|
133
|
-
].includes(sandbox.state)) return sandbox;
|
|
134
|
-
if (DEAD_STATES.includes(sandbox.state)) throw new InfraError(`Boat sandbox ${id} stopped starting: ${sandbox.state}${sandbox.error ? ` (${sandbox.error})` : ""}`);
|
|
135
|
-
if (Date.now() > deadline) throw new InfraError(`Boat sandbox ${id} wasn't ready after ${READY_TIMEOUT_MS / 1e3}s (still ${sandbox.state})`);
|
|
136
|
-
if (signal.aborted) throw signal.reason;
|
|
137
|
-
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
/** Deletes a sandbox; one already gone is deleted. */
|
|
141
|
-
async function deleteSandbox(api, id, signal) {
|
|
142
|
-
try {
|
|
143
|
-
await api.deleteSandbox({
|
|
144
|
-
sandboxId: id,
|
|
145
|
-
xAsciiConfirmDelete: id
|
|
146
|
-
}, { signal });
|
|
147
|
-
} catch (error) {
|
|
148
|
-
if (status(error) !== 404) throw error;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Deletes a sandbox that never got ready, sending the delete again every `redeleteMs` until Boat
|
|
153
|
-
* answers 404 or reports one of {@link DEAD_STATES}, for at most `deadlineMs`. Once `signal` is
|
|
154
|
-
* aborted it sends the delete once and stops: a canceled run's `cleanupRun` and the sandbox's TTL
|
|
155
|
-
* take it from there, so the cancel doesn't wait on Boat. Whether it went.
|
|
156
|
-
*/
|
|
157
|
-
async function deleteUntilGone(api, id, o = {}) {
|
|
158
|
-
const until = Date.now() + (o.deadlineMs ?? UNREADY_DELETE_MS);
|
|
159
|
-
const pollMs = o.pollMs ?? 5e3;
|
|
160
|
-
const redeleteMs = o.redeleteMs ?? 3e4;
|
|
161
|
-
let deletedAt = Number.NEGATIVE_INFINITY;
|
|
162
|
-
for (;;) {
|
|
163
|
-
if (Date.now() - deletedAt >= redeleteMs) {
|
|
164
|
-
await deleteSandbox(api, id).catch(() => {});
|
|
165
|
-
deletedAt = Date.now();
|
|
166
|
-
}
|
|
167
|
-
if (o.signal?.aborted) return false;
|
|
168
|
-
const state = await api.get({ sandboxId: id }).then(({ sandbox }) => sandbox.state, (error) => status(error) === 404 ? null : "unknown");
|
|
169
|
-
if (state === null || DEAD_STATES.includes(state)) return true;
|
|
170
|
-
if (Date.now() >= until || o.signal?.aborted) return false;
|
|
171
|
-
await new Promise((resolve) => {
|
|
172
|
-
const done = () => {
|
|
173
|
-
clearTimeout(timer);
|
|
174
|
-
o.signal?.removeEventListener("abort", done);
|
|
175
|
-
resolve();
|
|
176
|
-
};
|
|
177
|
-
const timer = setTimeout(done, pollMs);
|
|
178
|
-
o.signal?.addEventListener("abort", done, { once: true });
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
/** A fresh ed25519 key pair in `dir`, made by the host's OpenSSH. */
|
|
183
|
-
async function newKey(dir) {
|
|
184
|
-
const file = join(dir, "id_ed25519");
|
|
185
|
-
const made = await run("ssh-keygen", [
|
|
186
|
-
"-q",
|
|
187
|
-
"-t",
|
|
188
|
-
"ed25519",
|
|
189
|
-
"-N",
|
|
190
|
-
"",
|
|
191
|
-
"-C",
|
|
192
|
-
"reeval",
|
|
193
|
-
"-f",
|
|
194
|
-
file
|
|
195
|
-
]);
|
|
196
|
-
if (made.exitCode !== 0) throw new InfraError(`Couldn't make an SSH key for the Boat sandbox: ssh-keygen failed: ${made.stderr.trim()}`);
|
|
197
|
-
return {
|
|
198
|
-
file,
|
|
199
|
-
pub: (await readFile(`${file}.pub`, "utf8")).trim()
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Where a sandbox's sshd answers, best first: the VM's own address on port 22, then the public
|
|
204
|
-
* endpoint Boat forwards. The address is IPv6, which a host without IPv6 can't reach; the endpoint
|
|
205
|
-
* is NAT'd, which another VM on the same Boat host can't reach.
|
|
206
|
-
*/
|
|
207
|
-
function sshRoutes(reply) {
|
|
208
|
-
const routes = [];
|
|
209
|
-
if (reply.machineIp) routes.push({
|
|
210
|
-
host: reply.machineIp,
|
|
211
|
-
port: 22,
|
|
212
|
-
via: "machine address"
|
|
213
|
-
});
|
|
214
|
-
const endpoint = /^(.+):(\d+)$/.exec(reply.sshEndpoint ?? "");
|
|
215
|
-
if (endpoint) {
|
|
216
|
-
const host = endpoint[1].replace(/^\[(.*)\]$/, "$1");
|
|
217
|
-
routes.push({
|
|
218
|
-
host,
|
|
219
|
-
port: Number(endpoint[2]),
|
|
220
|
-
via: "public endpoint"
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
return routes;
|
|
224
|
-
}
|
|
225
|
-
const routeLabel = (r) => `${isIPv6(r.host) ? `[${r.host}]` : r.host}:${r.port} (${r.via})`;
|
|
226
|
-
/** How long one try at a route may take to greet, so an address that drops packets costs little. */
|
|
227
|
-
const PROBE_MS = 3e3;
|
|
228
|
-
/** How long the VM may take, after it reports ready, to greet on any route. */
|
|
229
|
-
const REACH_MS = 6e4;
|
|
230
|
-
/** Whether `route` greets with an SSH banner within `timeoutMs`, or why not. */
|
|
231
|
-
function probe(route, timeoutMs, signal) {
|
|
232
|
-
return new Promise((resolve) => {
|
|
233
|
-
const socket = connect({
|
|
234
|
-
host: route.host,
|
|
235
|
-
port: route.port
|
|
236
|
-
});
|
|
237
|
-
let banner = "";
|
|
238
|
-
const done = (result) => {
|
|
239
|
-
clearTimeout(timer);
|
|
240
|
-
signal.removeEventListener("abort", stop);
|
|
241
|
-
socket.destroy();
|
|
242
|
-
resolve(result);
|
|
243
|
-
};
|
|
244
|
-
const stop = () => done("not needed");
|
|
245
|
-
signal.addEventListener("abort", stop, { once: true });
|
|
246
|
-
const timer = setTimeout(() => done(`no SSH greeting in ${timeoutMs / 1e3}s`), timeoutMs);
|
|
247
|
-
socket.on("data", (d) => {
|
|
248
|
-
banner += d.toString("latin1");
|
|
249
|
-
if (banner.startsWith("SSH-")) done(true);
|
|
250
|
-
else if (banner.length >= 4) done("answered, but not as SSH");
|
|
251
|
-
});
|
|
252
|
-
socket.on("error", (e) => done(e.code ?? e.message));
|
|
253
|
-
socket.on("close", () => done("closed before an SSH greeting"));
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* The first of `routes`, in order, whose sshd greets: each round tries them all at once and takes
|
|
258
|
-
* the best that answered, so a route this host can't use costs at most one probe. A VM that just
|
|
259
|
-
* reported ready may not greet yet, so rounds repeat until `reachMs` has passed.
|
|
260
|
-
*/
|
|
261
|
-
async function firstReachable(routes, o = {}) {
|
|
262
|
-
const probeMs = o.probeMs ?? PROBE_MS;
|
|
263
|
-
const deadline = Date.now() + (o.reachMs ?? REACH_MS);
|
|
264
|
-
for (;;) {
|
|
265
|
-
const round = new AbortController();
|
|
266
|
-
const tries = routes.map((r) => probe(r, probeMs, round.signal));
|
|
267
|
-
const results = [];
|
|
268
|
-
for (const [i, attempt] of tries.entries()) {
|
|
269
|
-
results.push(await attempt);
|
|
270
|
-
if (results[i] === true) {
|
|
271
|
-
round.abort();
|
|
272
|
-
return { route: routes[i] };
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
if (Date.now() >= deadline || o.signal?.aborted) return { why: routes.map((r, i) => `${routeLabel(r)}: ${results[i]}`).join("; ") };
|
|
276
|
-
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
/** Where the agent's Node lives when the VM's own is somewhere the sandbox user can't read. */
|
|
280
|
-
const AGENT_NODE = "/opt/reeval/node";
|
|
281
|
-
/**
|
|
282
|
-
* Boat's `/usr/local/bin/node` links into the login user's nvm, under a home other users can't
|
|
283
|
-
* enter: give the sandbox user its own copy of that Node, whose version the record names.
|
|
284
|
-
*/
|
|
285
|
-
const nodeForAgent = (user) => ["real=\"$(readlink -f \"$(command -v node)\" 2>/dev/null || true)\"", `{ [ -z "$real" ] || sudo -n -u ${user} test -x "$real" || [ -x ${AGENT_NODE}/bin/node ] || { rm -rf ${AGENT_NODE} && mkdir -p ${AGENT_NODE} && cp -a "$(dirname "$(dirname "$real")")/." ${AGENT_NODE} && chmod -R a+rX ${AGENT_NODE}; }; }`].join(" && ");
|
|
286
|
-
/** Boat refused a start for now: 429, with when to try again if it said. */
|
|
287
|
-
var BoatRateLimited = class extends Error {
|
|
288
|
-
retryAfterMs;
|
|
289
|
-
constructor(message, retryAfterMs) {
|
|
290
|
-
super(message);
|
|
291
|
-
this.name = "BoatRateLimited";
|
|
292
|
-
this.retryAfterMs = retryAfterMs;
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
/**
|
|
296
|
-
* How long a 429 asks to wait: its `Retry-After` (seconds, or an HTTP date), else the time its
|
|
297
|
-
* message names (`… again at 14:05 UTC`), else null.
|
|
298
|
-
*/
|
|
299
|
-
function retryAfterMs(header, message, now = Date.now()) {
|
|
300
|
-
if (header) {
|
|
301
|
-
const seconds = Number(header);
|
|
302
|
-
if (Number.isFinite(seconds) && seconds >= 0) return Math.ceil(seconds * 1e3);
|
|
303
|
-
const at = Date.parse(header);
|
|
304
|
-
if (Number.isFinite(at)) return Math.max(0, at - now);
|
|
305
|
-
}
|
|
306
|
-
const named = /\b(\d{1,2}):(\d{2})(?::(\d{2}))? ?UTC\b/.exec(message);
|
|
307
|
-
if (named) {
|
|
308
|
-
const day = new Date(now);
|
|
309
|
-
let at = Date.UTC(day.getUTCFullYear(), day.getUTCMonth(), day.getUTCDate(), Number(named[1]), Number(named[2]), Number(named[3] ?? 0));
|
|
310
|
-
if (at < now) at += 864e5;
|
|
311
|
-
return at - now;
|
|
312
|
-
}
|
|
313
|
-
return null;
|
|
314
|
-
}
|
|
315
|
-
/** The harness install a machine keeps a home for, so its slots and resets copy it: by harness. */
|
|
316
|
-
const homeLabel = (options) => {
|
|
317
|
-
const bake = options.harness && harnessBake(options.harness);
|
|
318
|
-
return bake ? bake.label : void 0;
|
|
319
|
-
};
|
|
320
|
-
/**
|
|
321
|
-
* The account's pool: Boat's start caps (the paid ceilings when the account pays for starts past
|
|
322
|
-
* its plan), less the hour's starts already made, and the machines it would still run.
|
|
323
|
-
*/
|
|
324
|
-
const openBoatPool = async (sandbox, o) => {
|
|
325
|
-
const api = await boatClient(sandbox, o.root);
|
|
326
|
-
const limits = await readLimits(api);
|
|
327
|
-
const k = sandbox.attemptsPerMachine ?? 1;
|
|
328
|
-
const free = limits ? Math.max(1, limits.maxActiveSandboxes - limits.activeSandboxes) : 1;
|
|
329
|
-
const capped = sandbox.maxConcurrent ? Math.ceil(sandbox.maxConcurrent / k) : free;
|
|
330
|
-
const caps = limits?.startLimitsWithWallet ?? limits?.startLimits;
|
|
331
|
-
const hourUsed = limits?.starts?.hour?.used ?? 0;
|
|
332
|
-
return {
|
|
333
|
-
provider: boatPoolProvider(sandbox, api, o.runId),
|
|
334
|
-
options: {
|
|
335
|
-
limits: {
|
|
336
|
-
machines: Math.min(free, capped),
|
|
337
|
-
startsPerMinute: caps?.perMinute ?? null,
|
|
338
|
-
startsPerHour: caps?.perHour === void 0 ? null : Math.max(1, caps.perHour - hourUsed)
|
|
339
|
-
},
|
|
340
|
-
attemptsPerMachine: k,
|
|
341
|
-
reuse: sandbox.reuse ?? false
|
|
342
|
-
}
|
|
343
|
-
};
|
|
344
|
-
};
|
|
345
|
-
let limitsWarned = false;
|
|
346
|
-
/**
|
|
347
|
-
* The account's limits, or null, warning once, when Boat doesn't answer: the pool then runs one
|
|
348
|
-
* machine with no start caps of its own, holding back only when Boat refuses a start.
|
|
349
|
-
*/
|
|
350
|
-
async function readLimits(api) {
|
|
351
|
-
try {
|
|
352
|
-
if (!api) throw new Error("no Boat client");
|
|
353
|
-
return await api.limits({}, { signal: AbortSignal.timeout(LIMITS_TIMEOUT_MS) });
|
|
354
|
-
} catch (error) {
|
|
355
|
-
if (!limitsWarned) {
|
|
356
|
-
limitsWarned = true;
|
|
357
|
-
console.warn(`warning: boat() couldn't read the account's limits (${error?.message ?? error}), so the run starts one machine at a time and runs its attemptsPerMachine attempts on it`);
|
|
358
|
-
}
|
|
359
|
-
return null;
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
/** Starting, keeping and removing `descriptor`'s machines for the run's pool, in the main process. */
|
|
363
|
-
function boatPoolProvider(descriptor, api, runId) {
|
|
364
|
-
const type = descriptor.type ?? "small";
|
|
365
|
-
const dirs = /* @__PURE__ */ new Map();
|
|
366
|
-
return {
|
|
367
|
-
helper: "boat()",
|
|
368
|
-
rateLimited: (error) => error instanceof BoatRateLimited ? { retryAfterMs: error.retryAfterMs } : null,
|
|
369
|
-
async keepAlive(id, ttlSeconds) {
|
|
370
|
-
await api.update({
|
|
371
|
-
sandboxId: id,
|
|
372
|
-
updateSandboxRequest: { ttlSeconds }
|
|
373
|
-
});
|
|
374
|
-
},
|
|
375
|
-
async remove(id) {
|
|
376
|
-
await deleteSandbox(api, id).catch(() => {});
|
|
377
|
-
const dir = dirs.get(id);
|
|
378
|
-
dirs.delete(id);
|
|
379
|
-
if (dir) await rm(dir, {
|
|
380
|
-
recursive: true,
|
|
381
|
-
force: true
|
|
382
|
-
});
|
|
383
|
-
},
|
|
384
|
-
async start(signal, ttlSeconds) {
|
|
385
|
-
const name = `${runPrefix(descriptor, runId)}${randomBytes(3).toString("hex")}`;
|
|
386
|
-
const dir = await mkdtemp(join(tmpdir(), "reeval-boat-"));
|
|
387
|
-
let id;
|
|
388
|
-
let ready = false;
|
|
389
|
-
try {
|
|
390
|
-
const key = await newKey(dir);
|
|
391
|
-
id = (await api.create({
|
|
392
|
-
idempotencyKey: name,
|
|
393
|
-
createSandboxRequest: {
|
|
394
|
-
type,
|
|
395
|
-
name,
|
|
396
|
-
ttlSeconds,
|
|
397
|
-
noEnv: true,
|
|
398
|
-
snapshots: false,
|
|
399
|
-
monitoring: false
|
|
400
|
-
}
|
|
401
|
-
}).catch(async (error) => {
|
|
402
|
-
const why = await boatError(error);
|
|
403
|
-
if (status(error) === 429) {
|
|
404
|
-
const response = error.response;
|
|
405
|
-
throw new BoatRateLimited(`Boat is limiting starts: ${why}`, retryAfterMs(response?.headers.get("retry-after") ?? null, why));
|
|
406
|
-
}
|
|
407
|
-
throw new InfraError(`Boat didn't create a sandbox: ${why}`);
|
|
408
|
-
})).sandbox.id;
|
|
409
|
-
await untilReady(api, id, signal);
|
|
410
|
-
ready = true;
|
|
411
|
-
const ssh = await api.sshKey({
|
|
412
|
-
sandboxId: id,
|
|
413
|
-
sshKeyRequest: { key: key.pub }
|
|
414
|
-
}).catch(async (error) => {
|
|
415
|
-
throw new InfraError(`Boat didn't authorize the machine's SSH key: ${await boatError(error)}`);
|
|
416
|
-
});
|
|
417
|
-
const routes = sshRoutes(ssh);
|
|
418
|
-
if (!routes.length || !ssh.hostKey) throw new InfraError(`Boat gave sandbox ${id} no SSH address and host key to connect with`);
|
|
419
|
-
const knownHostsFile = join(dir, "known_hosts");
|
|
420
|
-
await writeFile(knownHostsFile, `${id} ${ssh.hostKey.trim()}\n`);
|
|
421
|
-
const reached = await firstReachable(routes, { signal });
|
|
422
|
-
signal.throwIfAborted();
|
|
423
|
-
if ("why" in reached) throw new InfraError(`Boat sandbox ${id} is up, but this host can't reach its SSH server: ${reached.why}`);
|
|
424
|
-
dirs.set(id, dir);
|
|
425
|
-
return {
|
|
426
|
-
id,
|
|
427
|
-
info: {
|
|
428
|
-
id,
|
|
429
|
-
name,
|
|
430
|
-
type,
|
|
431
|
-
host: reached.route.host,
|
|
432
|
-
port: reached.route.port,
|
|
433
|
-
via: reached.route.via,
|
|
434
|
-
user: ssh.sshUser ?? "user",
|
|
435
|
-
identityFile: key.file,
|
|
436
|
-
knownHostsFile
|
|
437
|
-
}
|
|
438
|
-
};
|
|
439
|
-
} catch (error) {
|
|
440
|
-
if (id && ready) await deleteSandbox(api, id).catch(() => {});
|
|
441
|
-
else if (id) await deleteUntilGone(api, id, { signal }).catch(() => {});
|
|
442
|
-
await rm(dir, {
|
|
443
|
-
recursive: true,
|
|
444
|
-
force: true
|
|
445
|
-
});
|
|
446
|
-
throw error;
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
};
|
|
450
|
-
}
|
|
451
|
-
/** How many times an attempt asks for another machine when the one it got fails to set up. */
|
|
452
|
-
const SETUP_TRIES = 3;
|
|
453
|
-
async function createBoatSandbox(descriptor, options) {
|
|
454
|
-
const debug = attemptDebug();
|
|
455
|
-
const shared = (descriptor.attemptsPerMachine ?? 1) > 1;
|
|
456
|
-
const label = shared || descriptor.reuse ? homeLabel(options) : void 0;
|
|
457
|
-
return startSandbox(options, {
|
|
458
|
-
helper: "boat()",
|
|
459
|
-
machine: {
|
|
460
|
-
sandbox: "boat",
|
|
461
|
-
size: descriptor.type ?? "small"
|
|
462
|
-
},
|
|
463
|
-
shared,
|
|
464
|
-
install: true,
|
|
465
|
-
networkNote: `network policy ${egressLabel(options.egress) || "allow-all"} · the VM keeps its own network, so traffic that ignores the proxy goes out directly, unrecorded`,
|
|
466
|
-
async boot() {
|
|
467
|
-
for (let tries = 1;; tries++) {
|
|
468
|
-
const lease = await leaseMachine({
|
|
469
|
-
sandbox: descriptor,
|
|
470
|
-
runId: options.runId,
|
|
471
|
-
root: process.cwd(),
|
|
472
|
-
ttlSeconds: Math.ceil(options.timeoutMs / 1e3) + TTL_MARGIN_S
|
|
473
|
-
}, options.signal).catch((error) => {
|
|
474
|
-
if (options.signal.aborted) throw options.signal.reason;
|
|
475
|
-
throw error instanceof InfraError ? error : new InfraError(error.message);
|
|
476
|
-
});
|
|
477
|
-
const info = lease.info;
|
|
478
|
-
debug?.log("container", lease.start ? `created ${info.id} (${info.name}, ${info.type}) in ${lease.start.ms}ms${lease.start.queuedMs >= 1e3 ? `, ${Math.round(lease.start.queuedMs / 1e3)}s of it waiting for the account's start caps` : ""}${lease.start.rateLimited ? `, after ${lease.start.rateLimited} rate-limited starts` : ""}; slot ${lease.slot}` : `${lease.reused ? "reused" : "shared"} ${info.id} (${info.name}, ${info.type}); slot ${lease.slot}${lease.reused ? `, its attempt ${lease.reused + 1}` : ""}`);
|
|
479
|
-
for (const lost of lease.lost) debug?.log("container", `dropped ${lost.machine}: keeping it alive failed: ${lost.error}`);
|
|
480
|
-
const layout = slotLayout(lease.slot);
|
|
481
|
-
const dir = await mkdtemp(join(tmpdir(), "reeval-boat-ssh-"));
|
|
482
|
-
let machine;
|
|
483
|
-
try {
|
|
484
|
-
machine = await connectSsh({
|
|
485
|
-
target: {
|
|
486
|
-
host: info.host,
|
|
487
|
-
port: info.port,
|
|
488
|
-
user: info.user,
|
|
489
|
-
identityFile: info.identityFile,
|
|
490
|
-
knownHostsFile: info.knownHostsFile,
|
|
491
|
-
hostKeyAlias: info.id,
|
|
492
|
-
controlPath: join(dir, "cm")
|
|
493
|
-
},
|
|
494
|
-
description: `boat sandbox ${info.id} (${info.type})`,
|
|
495
|
-
env: options.env,
|
|
496
|
-
path: [`${AGENT_NODE}/bin`],
|
|
497
|
-
prepare: nodeForAgent(layout.user),
|
|
498
|
-
abortSignal: options.signal,
|
|
499
|
-
...shared && { layout },
|
|
500
|
-
...lease.reused && { reset: true },
|
|
501
|
-
...label && { home: label }
|
|
502
|
-
});
|
|
503
|
-
} catch (error) {
|
|
504
|
-
await rm(dir, {
|
|
505
|
-
recursive: true,
|
|
506
|
-
force: true
|
|
507
|
-
});
|
|
508
|
-
await lease.release(true);
|
|
509
|
-
if (options.signal.aborted || !lease.reused || tries >= SETUP_TRIES) throw error;
|
|
510
|
-
debug?.log("container", `${info.id} slot ${lease.slot} failed to reset: ${error.message}`);
|
|
511
|
-
continue;
|
|
512
|
-
}
|
|
513
|
-
debug?.log("container", `ssh to ${info.id} over ${routeLabel({
|
|
514
|
-
host: info.host,
|
|
515
|
-
port: info.port,
|
|
516
|
-
via: info.via
|
|
517
|
-
})}`);
|
|
518
|
-
let healthy = true;
|
|
519
|
-
return {
|
|
520
|
-
root: machine.root,
|
|
521
|
-
...shared && {
|
|
522
|
-
proxyPort: layout.proxyPort,
|
|
523
|
-
stateDir: layout.state
|
|
524
|
-
},
|
|
525
|
-
...label && {
|
|
526
|
-
async installedElsewhere() {
|
|
527
|
-
const { restored, waitedMs, copyFailed } = await machine.home().catch((error) => {
|
|
528
|
-
if (options.signal.aborted) throw error;
|
|
529
|
-
return {
|
|
530
|
-
restored: false,
|
|
531
|
-
waitedMs: 0,
|
|
532
|
-
copyFailed: error.message
|
|
533
|
-
};
|
|
534
|
-
});
|
|
535
|
-
if (copyFailed && !restored) debug?.log("container", `no home from the machine's install, so this slot installs its own: ${copyFailed}`);
|
|
536
|
-
else if (copyFailed) debug?.log("container", `the machine's first copy of the install didn't unpack: ${copyFailed}`);
|
|
537
|
-
if (restored) debug?.log("container", `its home from the machine's install${waitedMs >= 1e3 ? `, after waiting ${Math.round(waitedMs / 1e3)}s for another slot to install it` : ""}`);
|
|
538
|
-
return restored;
|
|
539
|
-
},
|
|
540
|
-
async onInstalled() {
|
|
541
|
-
await machine.snapshotHome().catch((error) => {
|
|
542
|
-
debug?.log("container", `the machine keeps no copy of the install: ${error}`);
|
|
543
|
-
});
|
|
544
|
-
}
|
|
545
|
-
},
|
|
546
|
-
session: (o) => machine.session(o),
|
|
547
|
-
async destroy() {
|
|
548
|
-
await machine.close();
|
|
549
|
-
await rm(dir, {
|
|
550
|
-
recursive: true,
|
|
551
|
-
force: true
|
|
552
|
-
});
|
|
553
|
-
await lease.release(!healthy);
|
|
554
|
-
},
|
|
555
|
-
failed() {
|
|
556
|
-
healthy = false;
|
|
557
|
-
}
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
});
|
|
562
|
-
}
|
|
563
|
-
/** Every sandbox on `sandbox`'s account whose name starts with `prefix`, across pages. */
|
|
564
|
-
async function sandboxesNamed(api, prefix, signal) {
|
|
565
|
-
const found = [];
|
|
566
|
-
let cursor;
|
|
567
|
-
do {
|
|
568
|
-
const page = await api.sandboxes({
|
|
569
|
-
namePrefix: prefix,
|
|
570
|
-
limit: 100,
|
|
571
|
-
...cursor && { cursor }
|
|
572
|
-
}, { signal });
|
|
573
|
-
found.push(...page.sandboxes.filter((s) => s.name.startsWith(prefix)));
|
|
574
|
-
cursor = page.pageInfo?.hasMore ? page.pageInfo.nextCursor ?? void 0 : void 0;
|
|
575
|
-
} while (cursor);
|
|
576
|
-
return found;
|
|
577
|
-
}
|
|
578
|
-
/**
|
|
579
|
-
* Deletes every sandbox the run left on each account and prefix in `sandboxes`. Nothing else
|
|
580
|
-
* names them: another prefix, or another run's tag, is someone else's.
|
|
581
|
-
*/
|
|
582
|
-
async function removeRunSandboxes(runId, sandboxes) {
|
|
583
|
-
const seen = /* @__PURE__ */ new Set();
|
|
584
|
-
for (const sandbox of sandboxes) {
|
|
585
|
-
const prefix = runPrefix(sandbox, runId);
|
|
586
|
-
const key = `${sandbox.apiKey.from}\0${prefix}`;
|
|
587
|
-
if (seen.has(key) || boatKeyProblem(sandbox)) continue;
|
|
588
|
-
seen.add(key);
|
|
589
|
-
const api = await boatClient(sandbox).catch(() => null);
|
|
590
|
-
if (!api) continue;
|
|
591
|
-
const signal = AbortSignal.timeout(CLEANUP_TIMEOUT_MS);
|
|
592
|
-
const left = await sandboxesNamed(api, prefix, signal).catch(() => []);
|
|
593
|
-
await Promise.all(left.map((s) => deleteSandbox(api, s.id, signal).catch(() => {})));
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
/**
|
|
597
|
-
* Machines Boat would still start for the account (its cap on sandboxes at once, less what's
|
|
598
|
-
* running), and the attempts the run's pool keeps going on them: a minute's starts' worth of
|
|
599
|
-
* machines at most, each running `attemptsPerMachine`.
|
|
600
|
-
*/
|
|
601
|
-
async function boatCapacity(sandbox) {
|
|
602
|
-
const limits = await readLimits(await boatClient(sandbox).catch(() => null));
|
|
603
|
-
const k = sandbox.attemptsPerMachine ?? 1;
|
|
604
|
-
if (!limits) return {
|
|
605
|
-
machines: 1,
|
|
606
|
-
attempts: Math.min(k, sandbox.maxConcurrent ?? k)
|
|
607
|
-
};
|
|
608
|
-
const machines = Math.max(0, limits.maxActiveSandboxes - limits.activeSandboxes);
|
|
609
|
-
const perMinute = (limits.startLimitsWithWallet ?? limits.startLimits)?.perMinute;
|
|
610
|
-
const attempts = Math.min(machines, perMinute ?? machines) * k;
|
|
611
|
-
return {
|
|
612
|
-
machines,
|
|
613
|
-
attempts: Math.max(1, Math.min(attempts, sandbox.maxConcurrent ?? attempts))
|
|
614
|
-
};
|
|
615
|
-
}
|
|
616
|
-
/** The host's OpenSSH tools a Boat sandbox runs on, or the first one missing. */
|
|
617
|
-
async function missingSshTool() {
|
|
618
|
-
for (const [tool, args] of [["ssh", ["-V"]], ["ssh-keygen", ["-?"]]]) if (!await run(tool, [...args]).catch(() => null)) return tool;
|
|
619
|
-
return null;
|
|
620
|
-
}
|
|
621
|
-
/**
|
|
622
|
-
* Preflight's check of one account: the host has OpenSSH, the key is set, the SDK loads, Boat
|
|
623
|
-
* takes the key and would start the machine size asked for.
|
|
624
|
-
*/
|
|
625
|
-
async function checkBoat(sandbox, projectRoot) {
|
|
626
|
-
const refuse = (message, usage) => new PrepareError({
|
|
627
|
-
class: "config",
|
|
628
|
-
stage: "boat",
|
|
629
|
-
ref: null,
|
|
630
|
-
cause: null,
|
|
631
|
-
log: null,
|
|
632
|
-
usage,
|
|
633
|
-
message
|
|
634
|
-
});
|
|
635
|
-
const tool = await missingSshTool();
|
|
636
|
-
if (tool) throw refuse(`boat() runs every command over SSH, and there's no ${tool} on PATH: install an OpenSSH client (openssh-client on Debian and Ubuntu)`, true);
|
|
637
|
-
const limits = await (await boatClient(sandbox, projectRoot)).limits({}, { signal: AbortSignal.timeout(LIMITS_TIMEOUT_MS) }).catch(async (error) => {
|
|
638
|
-
const code = status(error);
|
|
639
|
-
if (code === 401 || code === 403) throw refuse(`Boat refused the API key in ${sandbox.apiKey.from}: ${await boatError(error)}`, true);
|
|
640
|
-
throw new PrepareError({
|
|
641
|
-
class: "transient",
|
|
642
|
-
stage: "boat",
|
|
643
|
-
ref: null,
|
|
644
|
-
cause: null,
|
|
645
|
-
log: null,
|
|
646
|
-
message: `Couldn't reach Boat: ${await boatError(error)}`
|
|
647
|
-
});
|
|
648
|
-
});
|
|
649
|
-
const type = sandbox.type ?? "small";
|
|
650
|
-
const machine = limits.machineTypes?.find((m) => m.type === type);
|
|
651
|
-
if (machine && !machine.available) throw refuse(`Boat won't start a ${type} machine on this account: ${machine.reason ?? "unavailable"}`, true);
|
|
652
|
-
if (!limits.canStart) throw refuse(`Boat won't start sandboxes on this account: ${limits.startBlockedReason ?? "no reason given"}`, false);
|
|
653
|
-
}
|
|
654
|
-
/** `reeval doctor`: the OpenSSH client, and each Boat account and machine size `sandboxes` use. */
|
|
655
|
-
async function boatDoctor(sandboxes, ctx) {
|
|
656
|
-
const accounts = /* @__PURE__ */ new Map();
|
|
657
|
-
for (const sandbox of sandboxes) accounts.set(`${sandbox.apiKey.from}\0${sandbox.type ?? "small"}`, sandbox);
|
|
658
|
-
if (!accounts.size) return [];
|
|
659
|
-
const missing = await ctx.deps.missingSshTool();
|
|
660
|
-
const checks = [missing ? {
|
|
661
|
-
id: "ssh",
|
|
662
|
-
status: "fail",
|
|
663
|
-
summary: `boat() runs every command over SSH, and there's no ${missing} on PATH`,
|
|
664
|
-
fix: "install an OpenSSH client (openssh-client on Debian and Ubuntu)"
|
|
665
|
-
} : {
|
|
666
|
-
id: "ssh",
|
|
667
|
-
status: "ok",
|
|
668
|
-
summary: "an OpenSSH client for boat()"
|
|
669
|
-
}];
|
|
670
|
-
for (const sandbox of accounts.values()) {
|
|
671
|
-
const key = sandbox.apiKey.from;
|
|
672
|
-
const type = sandbox.type ?? "small";
|
|
673
|
-
if (!ctx.deps.env[key]) {
|
|
674
|
-
checks.push({
|
|
675
|
-
id: "boat",
|
|
676
|
-
status: "fail",
|
|
677
|
-
summary: `boat() needs a Boat API key in ${key}, which isn't set`,
|
|
678
|
-
fix: `set ${key} in ${ctx.envFile}`
|
|
679
|
-
});
|
|
680
|
-
continue;
|
|
681
|
-
}
|
|
682
|
-
try {
|
|
683
|
-
await ctx.deps.boatAccount(sandbox, ctx.root, ctx.online);
|
|
684
|
-
checks.push({
|
|
685
|
-
id: "boat",
|
|
686
|
-
status: "ok",
|
|
687
|
-
summary: ctx.online ? `Boat takes the key in ${key} and starts ${type} machines` : `the Boat SDK loads, and ${key} is set (--online asks Boat whether it takes the key)`
|
|
688
|
-
});
|
|
689
|
-
} catch (error) {
|
|
690
|
-
checks.push({
|
|
691
|
-
id: "boat",
|
|
692
|
-
status: "fail",
|
|
693
|
-
summary: redactSecrets(error.message)
|
|
694
|
-
});
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
return checks;
|
|
698
|
-
}
|
|
699
|
-
export { boatCapacity, boatDoctor, checkBoat, createBoatSandbox, loadBoatSdk, missingSshTool, openBoatPool, removeRunSandboxes };
|
|
700
|
-
|
|
701
|
-
//# sourceMappingURL=boat-Bzz8L-KQ.js.map
|