reeval 0.21.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 +65 -0
- package/README.md +15 -15
- package/dist/{adapter-BdzhdRYo.js → adapter-Dlq3-4OS.js} +7 -50
- package/dist/adapter-Dlq3-4OS.js.map +1 -0
- package/dist/{agent-Dx-bDmlV.js → agent-OsAfayRf.js} +11 -12
- package/dist/agent-OsAfayRf.js.map +1 -0
- package/dist/{agents-l0-k7vw3.js → agents-BztvTkfM.js} +46 -37
- package/dist/agents-BztvTkfM.js.map +1 -0
- package/dist/{app-files-B-CQYB0c.js → app-files-6NHzghym.js} +3 -3
- package/dist/app-files-6NHzghym.js.map +1 -0
- package/dist/{assemble-CsZIcJo8.js → assemble-Doa1m-HW.js} +17 -15
- package/dist/{assemble-CsZIcJo8.js.map → assemble-Doa1m-HW.js.map} +1 -1
- package/dist/{assemble-CYMpN8LC.js → assemble-XrZskSNj.js} +1 -1
- package/dist/attach-BH2HdwH_.js +219 -0
- package/dist/attach-BH2HdwH_.js.map +1 -0
- package/dist/{attempt-CKfKsqqw.js → attempt-_dUsblVx.js} +2 -2
- package/dist/{attempt-CKfKsqqw.js.map → attempt-_dUsblVx.js.map} +1 -1
- package/dist/{attempt-host-BwSmNYkX.js → attempt-host-8mQV8Uee.js} +7 -7
- package/dist/{attempt-host-BwSmNYkX.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-DU2aQVeq.js +780 -0
- package/dist/bundle-DU2aQVeq.js.map +1 -0
- package/dist/{capture-BqIAeFyC.js → capture-By1byHaX.js} +52 -27
- package/dist/capture-By1byHaX.js.map +1 -0
- package/dist/capture-BzjNv0qP.js +1 -0
- package/dist/{cli-s_3opn_I.js → cli-DMHOwdVr.js} +560 -1049
- package/dist/cli-DMHOwdVr.js.map +1 -0
- package/dist/{cli-spec-DxzIjmq_.js → cli-spec-D0wuUaj9.js} +179 -42
- package/dist/cli-spec-D0wuUaj9.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/{client-C5fIzHQa.js → client-B41UK150.js} +8 -4
- package/dist/client-B41UK150.js.map +1 -0
- package/dist/{command-BJ7KqczP.js → command-8GIHYGZf.js} +9 -9
- package/dist/{command-BJ7KqczP.js.map → command-8GIHYGZf.js.map} +1 -1
- package/dist/{command-B5OAIjp7.js → command-CAmnWLFL.js} +14 -14
- package/dist/{command-B5OAIjp7.js.map → command-CAmnWLFL.js.map} +1 -1
- package/dist/{command-BXLZsEwQ.js → command-CXxckfsq.js} +13 -13
- package/dist/{command-BXLZsEwQ.js.map → command-CXxckfsq.js.map} +1 -1
- package/dist/{command-DA_SHQUQ.js → command-ao0NZ8h0.js} +16 -15
- package/dist/command-ao0NZ8h0.js.map +1 -0
- package/dist/{commands-BPvAOEmb.js → commands-B3lnIPj5.js} +1 -1
- package/dist/{commands-BKBamOcX.js → commands-ttChCsAy.js} +15 -15
- package/dist/{commands-BKBamOcX.js.map → commands-ttChCsAy.js.map} +1 -1
- package/dist/{config-C0URar0t.js → config-myJT1Qjc.js} +62 -37
- package/dist/config-myJT1Qjc.js.map +1 -0
- package/dist/{context-Sj58aJEu.js → context-DnzR9TNK.js} +2 -2
- package/dist/{context-Sj58aJEu.js.map → context-DnzR9TNK.js.map} +1 -1
- package/dist/cost-CdRX1s2p.js +1 -0
- package/dist/{cursor-catalog-FWgSo-T1.js → cursor-catalog-CUQrabJ_.js} +2 -2
- package/dist/{cursor-catalog-FWgSo-T1.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-BjAWxVAG.js → db-5H95sFii.js} +35 -9
- package/dist/{db-BjAWxVAG.js.map → db-5H95sFii.js.map} +1 -1
- package/dist/db-Bbg1n_2M.js +2 -0
- package/dist/{default-effort-CWlhZ6U1.js → default-effort-CtNY9CGW.js} +1 -1
- package/dist/{default-effort-Ck2GYIxX.js → default-effort-DYpCkJRk.js} +2 -2
- package/dist/{default-effort-Ck2GYIxX.js.map → default-effort-DYpCkJRk.js.map} +1 -1
- package/dist/{docker-D74l67k8.js → docker-CR0JZ1FE.js} +4 -4
- package/dist/{docker-D74l67k8.js.map → docker-CR0JZ1FE.js.map} +1 -1
- package/dist/docker-kpudeSxV.js +1 -0
- package/dist/{doctor-eFxyn6at.js → doctor-aE-RMbB_.js} +63 -76
- package/dist/doctor-aE-RMbB_.js.map +1 -0
- package/dist/{environment-CJIKz-Ud.js → environment-C8pUCD_A.js} +138 -53
- 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-CXIRJ91v.js → eval-source-CaLIGH3U.js} +6 -6
- package/dist/{eval-source-CXIRJ91v.js.map → eval-source-CaLIGH3U.js.map} +1 -1
- package/dist/{evaluate-DA4QsrHO.js → evaluate-4kBVtwZZ.js} +250 -215
- package/dist/evaluate-4kBVtwZZ.js.map +1 -0
- package/dist/{evaluate-DHrU4Wld.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-CnwWG3kP.js → fake-bootstrap-CzxrCqO3.js} +2 -2
- package/dist/{fake-bootstrap-CnwWG3kP.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-D6j-XpaK.js → files-BkvxIqfI.js} +4 -4
- package/dist/{files-D6j-XpaK.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-F44NRCN0.js → files-CX_mmvCc.js} +8 -8
- package/dist/{files-F44NRCN0.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-BaqXvB88.js → files-D6M7J3iX.js} +1 -1
- package/dist/{files-BVVWAS0A.js → files-DgHeTdCZ.js} +6 -6
- package/dist/{files-BVVWAS0A.js.map → files-DgHeTdCZ.js.map} +1 -1
- package/dist/{files-Bey1VAex.js → files-DpwJW3w6.js} +3 -3
- package/dist/{files-Bey1VAex.js.map → files-DpwJW3w6.js.map} +1 -1
- package/dist/gateway.d.ts +1 -1
- package/dist/{git-Jqkf9SBa.js → git-BnnNEXqh.js} +3 -3
- package/dist/{git-Jqkf9SBa.js.map → git-BnnNEXqh.js.map} +1 -1
- package/dist/harness-install-BfMBYDfP.js +53 -0
- package/dist/harness-install-BfMBYDfP.js.map +1 -0
- 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-Dsc4Wi-F.js → images-DtXwj2wL.js} +70 -55
- 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-QB5ecPDA.js → init-Ci_IAp8p.js} +5 -5
- package/dist/{init-QB5ecPDA.js.map → init-Ci_IAp8p.js.map} +1 -1
- package/dist/{ink-list-mCJypk3d.js → ink-list-Dnh6XD3C.js} +54 -15
- package/dist/ink-list-Dnh6XD3C.js.map +1 -0
- package/dist/inputs-load-DPUP_IFL.js +95 -0
- package/dist/inputs-load-DPUP_IFL.js.map +1 -0
- package/dist/inputs-load-M-BGe7gd.js +1 -0
- package/dist/inputs-z4JqnQ5g.js +190 -0
- package/dist/inputs-z4JqnQ5g.js.map +1 -0
- 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-BSr4lRzI.js → invocations-C1gY3E0J.js} +4 -4
- package/dist/{invocations-BSr4lRzI.js.map → invocations-C1gY3E0J.js.map} +1 -1
- package/dist/jiti-ILwyxt93.js +54 -0
- package/dist/jiti-ILwyxt93.js.map +1 -0
- package/dist/{judge-eGH39PaP.js → judge-DwzqucLS.js} +9 -6
- package/dist/{judge-eGH39PaP.js.map → judge-DwzqucLS.js.map} +1 -1
- package/dist/judge.d.ts +1 -1
- package/dist/judge.js +1 -1
- package/dist/kinds-DEKXOWVJ.js +592 -0
- package/dist/kinds-DEKXOWVJ.js.map +1 -0
- package/dist/{layout-DfQa4mJs.js → layout-nCnU9Vu2.js} +2 -2
- package/dist/{layout-DfQa4mJs.js.map → layout-nCnU9Vu2.js.map} +1 -1
- package/dist/{list-Dh6T0kdr.js → list-MK4L8tfW.js} +14 -11
- package/dist/{list-Dh6T0kdr.js.map → list-MK4L8tfW.js.map} +1 -1
- package/dist/{live-y1p3oNXH.js → live-BkPNXVmN.js} +8 -8
- package/dist/{live-y1p3oNXH.js.map → live-BkPNXVmN.js.map} +1 -1
- package/dist/{live-xTZs0c61.js → live-Dlq-S2yy.js} +7 -5
- package/dist/live-Dlq-S2yy.js.map +1 -0
- package/dist/live-gZtkBwuo.js +1 -0
- package/dist/machine-service-Byl0BlcT.js +1 -0
- package/dist/machine-service-CZiXiVsS.js +709 -0
- 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-jRKSQBg6.js → model-CRh8aiYS.js} +6 -5
- package/dist/model-CRh8aiYS.js.map +1 -0
- package/dist/{model-3pZZzloU.js → model-DRa7yv6K.js} +6 -5
- package/dist/model-DRa7yv6K.js.map +1 -0
- package/dist/{model-DNpKiHqO.js → model-LoLnq9y1.js} +2 -2
- package/dist/{model-DNpKiHqO.js.map → model-LoLnq9y1.js.map} +1 -1
- package/dist/{model-DEjwetkJ.js → model-lLaUxxno.js} +1 -1
- package/dist/{node-DM-mLGdX.js → node-BQjSQw0d.js} +19 -8
- package/dist/node-BQjSQw0d.js.map +1 -0
- package/dist/{openrouter-models-C0aRo633.js → openrouter-models-B1sIOTD2.js} +2 -2
- package/dist/{openrouter-models-C0aRo633.js.map → openrouter-models-B1sIOTD2.js.map} +1 -1
- package/dist/options-I9I3FwMl.js +1 -0
- package/dist/own-reads-CYmBlrHK.js +15 -0
- package/dist/own-reads-CYmBlrHK.js.map +1 -0
- package/dist/{patch-Bx-qp8Li.js → patch-D8X6VB-e.js} +2 -2
- package/dist/{patch-Bx-qp8Li.js.map → patch-D8X6VB-e.js.map} +1 -1
- package/dist/{plan-ChO0A-xn.js → plan-DgIVIrXJ.js} +47 -9
- package/dist/plan-DgIVIrXJ.js.map +1 -0
- package/dist/{plugins-BioMWncI.js → plugins-DvEbow6a.js} +17 -637
- package/dist/plugins-DvEbow6a.js.map +1 -0
- package/dist/{preflight-CJSGzMzc.js → preflight-BKGbxN67.js} +9 -8
- package/dist/preflight-BKGbxN67.js.map +1 -0
- package/dist/{preflight-qFCXmxha.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-BAjRSoku.js +389 -0
- 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-B-flBAzR.js → provenance-CSyRCc9B.js} +4 -4
- package/dist/{provenance-B-flBAzR.js.map → provenance-CSyRCc9B.js.map} +1 -1
- package/dist/{providers-B6StVyfG.js → providers-DkaEJvF5.js} +185 -35
- package/dist/providers-DkaEJvF5.js.map +1 -0
- package/dist/providers-DxZ26YoG.js +1 -0
- package/dist/{query-CkLmJv7R.js → query-BL66BOqL.js} +2 -2
- package/dist/{query-CkLmJv7R.js.map → query-BL66BOqL.js.map} +1 -1
- package/dist/query-C9OKU1Vz.js +1 -0
- package/dist/{questions-CJIh2FSX.js → questions-boVPzGoC.js} +7 -7
- package/dist/{questions-CJIh2FSX.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-nVVujCW7.js → record-D1_D1KFY.js} +12 -4
- package/dist/record-D1_D1KFY.js.map +1 -0
- package/dist/{redact-DL2BTykw.js → redact-t-L3VGy8.js} +91 -2
- package/dist/redact-t-L3VGy8.js.map +1 -0
- package/dist/{remarks-B3wjKscW.js → remarks-DEvk5f8v.js} +7 -7
- package/dist/{remarks-B3wjKscW.js.map → remarks-DEvk5f8v.js.map} +1 -1
- package/dist/{remote-C88amFRN.js → remote-CQoBRpOv.js} +5 -5
- package/dist/{remote-C88amFRN.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-G576PiFJ.js → resolve-D2RqmybX.js} +9 -9
- package/dist/{resolve-G576PiFJ.js.map → resolve-D2RqmybX.js.map} +1 -1
- package/dist/resources-DqdwihhT.js +62 -0
- package/dist/resources-DqdwihhT.js.map +1 -0
- package/dist/{results-zVHIW6xw.js → results-BpxzyoMd.js} +5 -5
- package/dist/{results-zVHIW6xw.js.map → results-BpxzyoMd.js.map} +1 -1
- package/dist/{resume-D_PcUXfG.js → resume-2ekm_9OB.js} +78 -7
- package/dist/resume-2ekm_9OB.js.map +1 -0
- package/dist/{retry-BvTzCxdc.js → retry-CAhpW1hH.js} +4 -4
- package/dist/{retry-BvTzCxdc.js.map → retry-CAhpW1hH.js.map} +1 -1
- package/dist/{routes-B0F2R-K7.js → routes-Cp4gAjBZ.js} +118 -70
- package/dist/routes-Cp4gAjBZ.js.map +1 -0
- package/dist/{runtime-B3r_pAq6.js → runtime-C5fKSFCz.js} +46 -5
- package/dist/runtime-C5fKSFCz.js.map +1 -0
- 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-Duh3z1TV.js → sandbox-t-Q-8lA_.js} +2 -2
- package/dist/{sandbox-Duh3z1TV.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-DUWMRKik.js → server-BcLg9WzE.js} +10 -10
- package/dist/{server-DUWMRKik.js.map → server-BcLg9WzE.js.map} +1 -1
- package/dist/server-Buav2-CG.js +1 -0
- package/dist/services-BG8xuU82.js +39 -0
- package/dist/services-BG8xuU82.js.map +1 -0
- package/dist/{source-CHuN4Nfg.js → source-CrXM19HD.js} +2 -2
- package/dist/{source-CHuN4Nfg.js.map → source-CrXM19HD.js.map} +1 -1
- package/dist/source-dvxkqYvk.js +1 -0
- package/dist/src-5dCrqbFd.js +2 -0
- package/dist/{src-BI0v8qlZ.js → src-Bb3k9Kn_.js} +8 -5
- package/dist/{src-BI0v8qlZ.js.map → src-Bb3k9Kn_.js.map} +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-BqNzHHWn.js → src-C3OhA5pw.js} +2 -2
- package/dist/{src-BqNzHHWn.js.map → src-C3OhA5pw.js.map} +1 -1
- package/dist/{src-BHJ4MWvY.js → src-C5rrQlt8.js} +2199 -771
- package/dist/src-C5rrQlt8.js.map +1 -0
- package/dist/{src-CeBhwD8k.js → src-C6MsGyD6.js} +1 -1
- package/dist/{src-De0KY5S_.js → src-Cf4vRyea.js} +2 -2
- package/dist/src-DEbNp-rx.js +1 -0
- package/dist/{src-B-HuDqpH.js → src-DNWiU__5.js} +2 -2
- package/dist/{src-B-HuDqpH.js.map → src-DNWiU__5.js.map} +1 -1
- package/dist/src-DrLbG1HM.js +2 -0
- package/dist/{src--yl1OypK.js → src-Ds1pmXTg.js} +2 -2
- package/dist/{src-DA95rM6v.js → src-DwcCKsV0.js} +2 -2
- package/dist/{src-CmA5Yev6.js → src-DwcTn4JY.js} +2 -2
- package/dist/{src-CmA5Yev6.js.map → src-DwcTn4JY.js.map} +1 -1
- package/dist/{src-CZaYu6ER.js → src-VG2IRoT4.js} +1 -1
- package/dist/{src-DL-EE4DU.js → src-c3ZQu7Uu.js} +2 -2
- package/dist/{src-DL-EE4DU.js.map → src-c3ZQu7Uu.js.map} +1 -1
- package/dist/{src-CkEiiyON.js → src-io_SKoZ5.js} +2 -2
- 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-COB07NpH.js +718 -0
- package/dist/start-COB07NpH.js.map +1 -0
- package/dist/{state-DUBRDyMk.js → state-B319V1p8.js} +16 -16
- package/dist/{state-DUBRDyMk.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-B9J6Afg6.js → suite-D1tgXZxM.js} +2 -2
- package/dist/{suite-B9J6Afg6.js.map → suite-D1tgXZxM.js.map} +1 -1
- package/dist/{summary-CSp4cfnr.js → summary-ClLns_wv.js} +8 -5
- package/dist/summary-ClLns_wv.js.map +1 -0
- package/dist/{sync-CxAY6Dki.js → sync-mOG74RXH.js} +5 -5
- package/dist/{sync-CxAY6Dki.js.map → sync-mOG74RXH.js.map} +1 -1
- package/dist/{tart-CcrrtSrp.js → tart-DMppfbEm.js} +100 -295
- package/dist/tart-DMppfbEm.js.map +1 -0
- package/dist/{tart-bake-F-6seRC9.js → tart-bake-Cva_qdir.js} +18 -62
- package/dist/tart-bake-Cva_qdir.js.map +1 -0
- package/dist/{tart-bake-RK7RaT9E.js → tart-bake-DVIoXWr_.js} +1 -1
- package/dist/{tart-cli-ClvRniLQ.js → tart-cli-D88c5YYJ.js} +1 -1
- package/dist/{tart-cli-B86Jqo1t.js → tart-cli-LzDud2Z6.js} +2 -2
- package/dist/{tart-cli-B86Jqo1t.js.map → tart-cli-LzDud2Z6.js.map} +1 -1
- package/dist/{tart-hosts-Brii7zHM.js → tart-hosts-8N6Tt7Yb.js} +1 -1
- package/dist/{tart-hosts-DPyZsg-1.js → tart-hosts-CTRY5kQ2.js} +3 -3
- package/dist/{tart-hosts-DPyZsg-1.js.map → tart-hosts-CTRY5kQ2.js.map} +1 -1
- package/dist/{tart-images-CWSf03w8.js → tart-images-JfHirU8W.js} +2 -2
- package/dist/{tart-images-CWSf03w8.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-CVDdJy0H.js → tool-class-CncfCw03.js} +2 -2
- package/dist/{tool-class-CVDdJy0H.js.map → tool-class-CncfCw03.js.map} +1 -1
- package/dist/{transcript-BP_2hji-.js → transcript-BXWZiMuC.js} +2 -2
- package/dist/{transcript-BP_2hji-.js.map → transcript-BXWZiMuC.js.map} +1 -1
- package/dist/{types-BJ0wh8wC.d.ts → types-BDo8ttQo.d.ts} +253 -5
- package/dist/types-CbcnJxCy.js.map +1 -1
- package/dist/ui-DUiVPbQ2.js +1024 -0
- package/dist/ui-DUiVPbQ2.js.map +1 -0
- package/dist/vercel-models-Ci33llXz.js +21 -0
- package/dist/vercel-models-Ci33llXz.js.map +1 -0
- package/dist/view/index.d.ts +6 -1
- package/dist/view/index.js +4 -4
- package/dist/views-B0qZR5Ef.js +2 -0
- package/dist/{views-DRxXCyIH.js → views-CiZGh3ws.js} +6 -6
- package/dist/{views-DRxXCyIH.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-C3Q4U63F.js → worker-entry-DmXQ2Znu.js} +31 -11
- package/dist/worker-entry-DmXQ2Znu.js.map +1 -0
- package/dist/workspace-CRgFdmgW.js +1 -0
- package/dist/{workspace-P72SXLXr.js → workspace-wwvwEHzP.js} +6 -6
- package/dist/{workspace-P72SXLXr.js.map → workspace-wwvwEHzP.js.map} +1 -1
- package/docker/Dockerfile +1 -1
- package/package.json +17 -2
- package/skills/reeval/references/environments.md +4 -3
- package/dist/adapter-BdzhdRYo.js.map +0 -1
- package/dist/agent-Dx-bDmlV.js.map +0 -1
- package/dist/agents-l0-k7vw3.js.map +0 -1
- package/dist/app-files-B-CQYB0c.js.map +0 -1
- package/dist/boat-CZpAreTB.js +0 -108
- package/dist/boat-CZpAreTB.js.map +0 -1
- package/dist/boat-su1Y7LPd.js +0 -325
- package/dist/boat-su1Y7LPd.js.map +0 -1
- package/dist/capture-BqIAeFyC.js.map +0 -1
- package/dist/capture-D0Ln5aCP.js +0 -1
- package/dist/cli-s_3opn_I.js.map +0 -1
- package/dist/cli-spec-DxzIjmq_.js.map +0 -1
- package/dist/client-C5fIzHQa.js.map +0 -1
- package/dist/command-DA_SHQUQ.js.map +0 -1
- package/dist/config-C0URar0t.js.map +0 -1
- package/dist/cost-IM80LyGD.js +0 -1
- package/dist/db-Bc4L-Wcr.js +0 -2
- package/dist/docker-CDdK6Ity.js +0 -271
- package/dist/docker-CDdK6Ity.js.map +0 -1
- package/dist/docker-DMug3l-a.js +0 -1
- package/dist/doctor-eFxyn6at.js.map +0 -1
- package/dist/environment-CJIKz-Ud.js.map +0 -1
- package/dist/evaluate-DA4QsrHO.js.map +0 -1
- package/dist/files-BjOJw4sn.js +0 -1
- package/dist/files-CNHhSyb3.js +0 -1
- package/dist/files-CW1lChNh.js +0 -1
- package/dist/ids-B-JKTCP8.js.map +0 -1
- package/dist/images-Dsc4Wi-F.js.map +0 -1
- package/dist/init-C0oUG3jh.js +0 -1
- package/dist/ink-list-mCJypk3d.js.map +0 -1
- package/dist/live-DwjWJTdn.js +0 -1
- package/dist/live-xTZs0c61.js.map +0 -1
- package/dist/model-3pZZzloU.js.map +0 -1
- package/dist/model-jRKSQBg6.js.map +0 -1
- package/dist/model-nfewGTzB.js +0 -1
- package/dist/node-DM-mLGdX.js.map +0 -1
- package/dist/options-DpsJ_5CU.js +0 -1
- package/dist/plan-ChO0A-xn.js.map +0 -1
- package/dist/plugins-BioMWncI.js.map +0 -1
- package/dist/preflight-BUjk_6wT.js +0 -1
- package/dist/preflight-CJSGzMzc.js.map +0 -1
- package/dist/preflight-DD3fI4Hz.js +0 -1
- package/dist/preflight-qFCXmxha.js.map +0 -1
- package/dist/prepare-D7oSSFNm.js +0 -268
- package/dist/prepare-D7oSSFNm.js.map +0 -1
- package/dist/prepare-xHU2BpN-.js +0 -2
- package/dist/prices-B1vm_lPk.js +0 -1
- package/dist/providers-B6StVyfG.js.map +0 -1
- package/dist/providers-Dljf6al6.js +0 -1
- package/dist/query-BAc2tQZj.js +0 -1
- package/dist/record-nVVujCW7.js.map +0 -1
- package/dist/redact-DL2BTykw.js.map +0 -1
- package/dist/resolve-DW92wpIZ.js +0 -1
- package/dist/resume-D_PcUXfG.js.map +0 -1
- package/dist/routes-B0F2R-K7.js.map +0 -1
- package/dist/runtime-B3r_pAq6.js.map +0 -1
- package/dist/server-CGEsvVRG.js +0 -1
- package/dist/source-Wz1Nrfue.js +0 -1
- package/dist/src-BHJ4MWvY.js.map +0 -1
- package/dist/src-BL-_0QoE.js +0 -1
- package/dist/src-C-mOSczH.js +0 -2
- package/dist/src-CwH_nEaw.js +0 -2
- package/dist/state-B3jex5KU.js +0 -1
- package/dist/suite-Bhs9-Z7O.js +0 -2
- package/dist/summary-CSp4cfnr.js.map +0 -1
- package/dist/tarball-CESxtK4X.js +0 -257
- package/dist/tarball-CESxtK4X.js.map +0 -1
- package/dist/tart-CcrrtSrp.js.map +0 -1
- package/dist/tart-bake-F-6seRC9.js.map +0 -1
- package/dist/views-i67V1ly3.js +0 -2
- package/dist/worker-entry-C3Q4U63F.js.map +0 -1
- package/dist/workspace-DhUOW8if.js +0 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { n as UsageError } from "./errors-ttMTnIYX.js";
|
|
2
2
|
import { g as parseDuration } from "./shared-DtZwIAfy.js";
|
|
3
3
|
import { o as PACKAGE_VERSION } from "./root-BzeoyfGd.js";
|
|
4
|
-
import { a as newRunId,
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { a as fromCwd, l as relativeFile, o as newRunId, r as cwdIn } from "./ids-a6cr243_.js";
|
|
5
|
+
import { S as stripCredentials, g as redactSecrets, x as registerSecret } from "./redact-t-L3VGy8.js";
|
|
6
|
+
import { c as sandboxCapacity, n as capabilitiesOf, r as cleanupRun, u as sandboxKind } from "./kinds-DEKXOWVJ.js";
|
|
7
|
+
import { i as formatDuration, n as clip } from "./text-B8-W3Cvn.js";
|
|
8
8
|
import { y as vertexSettingsIn } from "./vertex-BEWxHoxH.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { l as judgeModelName, m as unusedGatewayKey } from "./judge-
|
|
9
|
+
import { D as profileSandbox, F as workspaceLabel, d as environmentSandbox } from "./environment-C8pUCD_A.js";
|
|
10
|
+
import { At as resolveOutput, Dt as rootlessPodmanSwitch, Ot as setupEgress, R as checkLimitHarness, S as resolveModelGateway, U as harnessId, _ as selectProfile, _t as ciRunner, a as configPathFor, b as gatewayScope, c as findConfig, d as loadConfig, et as plannedSandboxIds, f as malformedCredentials, g as runJudgeModel, h as requireConfig, i as configLabel, l as givenConcurrency, m as neededCredentials, o as defaultConcurrency, p as missingCredentials, tt as plannedSandboxes, u as hostCapacity, v as withProfileHistory, vt as directOnCloud, xt as isDirect } from "./config-myJT1Qjc.js";
|
|
11
|
+
import { l as judgeModelName, m as unusedGatewayKey } from "./judge-DwzqucLS.js";
|
|
12
12
|
import { n as loadEnvFiles, t as inCI } from "./env-8x1O8I1M.js";
|
|
13
|
-
import { r as localStudio } from "./resolve-
|
|
14
|
-
import { r as openRouterFallbacks } from "./openrouter-models-
|
|
13
|
+
import { r as localStudio } from "./resolve-Bfo8sjd-.js";
|
|
14
|
+
import { r as openRouterFallbacks } from "./openrouter-models-B1sIOTD2.js";
|
|
15
15
|
import { a as traitFilters, o as traitFlags, t as checkTraitKeys } from "./traits-CCD8XsmI.js";
|
|
16
|
-
import { k as runOutcome } from "./model-
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { i as
|
|
16
|
+
import { k as runOutcome } from "./model-LoLnq9y1.js";
|
|
17
|
+
import { i as INSTEAD, l as helpText, n as FLAGS, r as GLOBAL, s as commandHelpText, t as COMMANDS } from "./cli-spec-D0wuUaj9.js";
|
|
18
|
+
import { t as colors } from "./colors-DcXBvAlU.js";
|
|
19
|
+
import { d as storeCredentials, i as isRemote, u as pullStore } from "./sync-mOG74RXH.js";
|
|
20
|
+
import { i as runtimeInfo, n as gitInfo, r as runnerInfo, t as author } from "./provenance-CSyRCc9B.js";
|
|
21
|
+
import { A as writeLiveProgress, C as restoreRetry, D as stoppedRetry, E as savedInvocation, O as sweepStaging, S as resolveRetry, T as savedFilters, _ as pruneEvents, a as eventsFile, b as resolveAttach, d as liveAttempts, f as loadPrevious, h as previousAttempt, i as erroredAttempts, k as writeCurrent, l as keptAttempts, m as prepareResume, o as holdRetry, p as noteRetries, r as completedKeysFor, t as CANCEL_SIGNAL, u as leftOutAttempts, w as resumeSettings, x as resolveResume, y as removeStoppedStaging } from "./resume-2ekm_9OB.js";
|
|
22
|
+
import { c as notEventStream, l as openEventStream, o as isAttachUrl, s as isEventsUrl, u as teeRenderer } from "./events-CXxFvVMK.js";
|
|
23
|
+
import { t as createRenderer } from "./ui-DUiVPbQ2.js";
|
|
24
|
+
import { n as preflight } from "./preflight-BKGbxN67.js";
|
|
22
25
|
import { t as budgetMarker } from "./budget-BcxLYY5L.js";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { a as redactArgv, r as commandOf, t as logInvocation } from "./invocations-BSr4lRzI.js";
|
|
26
|
-
import { _ as phaseOf, c as pointerLine, d as attemptAxes, f as debugLines, g as outcomeOf, h as offset, i as listLines, m as failureLines, n as SPINNER, p as errorCheck, s as progressText, t as LiveList, u as statusList, v as progressLine, y as tailLines } from "./list-Dh6T0kdr.js";
|
|
26
|
+
import { d as wantsHosted } from "./hosted-run-BfAPIMyT.js";
|
|
27
|
+
import { a as redactArgv, r as commandOf, t as logInvocation } from "./invocations-C1gY3E0J.js";
|
|
27
28
|
import { existsSync, mkdirSync, readdirSync, writeFileSync } from "node:fs";
|
|
28
|
-
import { dirname, join } from "node:path";
|
|
29
|
+
import { dirname, join, resolve } from "node:path";
|
|
29
30
|
import { appendFile, readFile, rm } from "node:fs/promises";
|
|
30
31
|
import { inspect } from "node:util";
|
|
31
32
|
import { detectAgent } from "std-env";
|
|
32
33
|
import { Command, Option } from "commander";
|
|
33
|
-
import stringWidth from "string-width";
|
|
34
34
|
// src/cli-parse.ts
|
|
35
35
|
const OPTIONS = Object.fromEntries(Object.entries(FLAGS).map(([name, spec]) => {
|
|
36
36
|
const short = "short" in spec ? `-${spec.short}, ` : "";
|
|
@@ -172,936 +172,6 @@ function usageError(error, command) {
|
|
|
172
172
|
}
|
|
173
173
|
return new UsageError(first.charAt(0).toUpperCase() + first.slice(1));
|
|
174
174
|
}
|
|
175
|
-
// src/ui/header.ts
|
|
176
|
-
/** ` ➜ `, ` ⚠ `: the glyph column every line of the block starts with. */
|
|
177
|
-
const GLYPH = 5;
|
|
178
|
-
/** `Est. Time: `, the longest key. */
|
|
179
|
-
const KEY = 11;
|
|
180
|
-
/** `Warning: `, the longer note label. */
|
|
181
|
-
const LABEL = 9;
|
|
182
|
-
/**
|
|
183
|
-
* `text` broken at spaces into lines of at most `width` columns, not counting color codes; a
|
|
184
|
-
* longer word keeps a line. A `·` stays with the word before it, so no line starts with one.
|
|
185
|
-
*/
|
|
186
|
-
function wrap(text, width) {
|
|
187
|
-
const words = [];
|
|
188
|
-
for (const word of text.split(/\s+/).filter(Boolean)) if (word === "·" && words.length) words[words.length - 1] += " ·";
|
|
189
|
-
else words.push(word);
|
|
190
|
-
const lines = [];
|
|
191
|
-
let line = "";
|
|
192
|
-
for (const word of words) if (line && stripAnsi(line).length + 1 + stripAnsi(word).length > width) {
|
|
193
|
-
lines.push(line);
|
|
194
|
-
line = word;
|
|
195
|
-
} else line = line ? `${line} ${word}` : word;
|
|
196
|
-
return line ? [...lines, line] : lines;
|
|
197
|
-
}
|
|
198
|
-
const indent = (n) => " ".repeat(n);
|
|
199
|
-
/** `REEVAL v0.16.1`, then the run's facts, one `➜ Key: value` line each. */
|
|
200
|
-
function headerLines(c, h, width) {
|
|
201
|
-
const name = `REEVAL v${h.version}`;
|
|
202
|
-
const title = c.bold(c.depth === 4 ? name : c.teal(name));
|
|
203
|
-
const valueWidth = width - GLYPH - KEY;
|
|
204
|
-
const row = (key, value) => {
|
|
205
|
-
const values = typeof value === "string" ? [value] : value;
|
|
206
|
-
const joined = values.join(", ");
|
|
207
|
-
return (values.length > 1 && stripAnsi(joined).length > valueWidth ? values : wrap(joined, valueWidth)).map((v, i) => i === 0 ? ` ${c.teal("➜")} ${c.dim(`${key}:`)}${indent(KEY - key.length - 1)}${v}` : `${indent(16)}${v}`);
|
|
208
|
-
};
|
|
209
|
-
const many = (one, n, many = `${one}s`) => n === 1 ? one : many;
|
|
210
|
-
const continued = [h.resumed ? `${plural(h.resumed, "attempt")} done` : "", h.retried ? `${plural(h.retried, "error")} to retry` : ""].filter(Boolean);
|
|
211
|
-
const resumed = continued.length ? c.dim(` (resumed, ${continued.join(", ")})`) : "";
|
|
212
|
-
const reason = h.profile && h.profile.reason !== "--profile" ? c.dim(` (${h.profile.reason})`) : "";
|
|
213
|
-
return [
|
|
214
|
-
h.dryRun ? `${title} ${c.dim("dry run")}` : title,
|
|
215
|
-
"",
|
|
216
|
-
...row("Run", `${h.runId}${resumed}`),
|
|
217
|
-
...h.config ? row("Config", h.config) : [],
|
|
218
|
-
...h.profile ? row("Profile", `${h.profile.name}${reason}`) : [],
|
|
219
|
-
...row(many("Harness", h.harnesses.length, "Harnesses"), h.harnesses.map((id) => harness(c, h, id))),
|
|
220
|
-
...row(many("Sandbox", h.sandboxes.length, "Sandboxes"), h.sandboxes),
|
|
221
|
-
...h.judges.length ? row(many("Judge", h.judges.length), h.judges) : [],
|
|
222
|
-
...row("Scope", scope(c, h)),
|
|
223
|
-
...row("Est. Time", estimate(c, h)),
|
|
224
|
-
...h.record && !h.dryRun ? row("Record", h.record) : []
|
|
225
|
-
];
|
|
226
|
-
}
|
|
227
|
-
/** A harness id, with the effort it runs at when the id doesn't name it. */
|
|
228
|
-
function harness(c, h, id) {
|
|
229
|
-
const effort = h.efforts?.[id];
|
|
230
|
-
if (effort === void 0 || id.includes("[effort=")) return id;
|
|
231
|
-
return `${id} ${`(effort: ${effort})`.split(" ").map((w) => c.dim(w)).join(" ")}`;
|
|
232
|
-
}
|
|
233
|
-
function scope(c, h) {
|
|
234
|
-
const attempts = h.fewest < h.attempts ? `${h.fewest}–${h.attempts} attempts` : plural(h.attempts, "attempt");
|
|
235
|
-
const parts = [
|
|
236
|
-
plural(h.files, "eval file"),
|
|
237
|
-
plural(h.evals, "eval") + (h.skipped ? ` (${h.skipped} skipped)` : ""),
|
|
238
|
-
plural(h.cells, "cell"),
|
|
239
|
-
attempts
|
|
240
|
-
];
|
|
241
|
-
const caps = [h.budget.attempts !== void 0 ? `${h.budget.attempts} ${h.attempts <= h.budget.attempts ? c.green("✓") : c.red("✗")}` : "", h.budget.duration ?? ""].filter(Boolean);
|
|
242
|
-
return `${parts.join(" · ")}${caps.length ? ` (budget: ${caps.join(", ")})` : ""}`;
|
|
243
|
-
}
|
|
244
|
-
function estimate(c, h) {
|
|
245
|
-
const serial = `~${formatDuration(h.estimateMs)} ${c.dim("(serial)")}`;
|
|
246
|
-
const most = Math.min(h.concurrency, h.attempts);
|
|
247
|
-
const parallel = h.parallel ?? most;
|
|
248
|
-
if (parallel <= 1) return serial;
|
|
249
|
-
const capped = parallel < most ? `, ${parallel} at once` : "";
|
|
250
|
-
return `${`~${formatDuration(h.estimateMs / parallel)} ${c.dim(`(concurrency: ${h.concurrency}${capped})`)}`} · ${serial}`;
|
|
251
|
-
}
|
|
252
|
-
/** `⚠ Warning: …` or `ℹ Hint: …`, wrapped under its first word. */
|
|
253
|
-
function noteLines(c, kind, text, width) {
|
|
254
|
-
const [glyph, label, paint] = kind === "hint" ? [
|
|
255
|
-
"ℹ",
|
|
256
|
-
"Hint:",
|
|
257
|
-
c.blue
|
|
258
|
-
] : [
|
|
259
|
-
"⚠",
|
|
260
|
-
"Warning:",
|
|
261
|
-
kind === "root" ? c.red : c.orange
|
|
262
|
-
];
|
|
263
|
-
const basic = {
|
|
264
|
-
warning: c.yellow,
|
|
265
|
-
hint: c.teal,
|
|
266
|
-
root: c.red
|
|
267
|
-
}[kind];
|
|
268
|
-
const lead = c.depth === 4 && kind !== "root" ? `${basic(glyph)} ${c.bold(label)}` : c.bold(paint(`${glyph} ${label}`));
|
|
269
|
-
const at = 14;
|
|
270
|
-
return wrap(text, Math.max(20, width - at)).map((line, i) => i === 0 ? ` ${lead}${indent(LABEL - label.length)}${line}` : `${indent(at)}${line}`);
|
|
271
|
-
}
|
|
272
|
-
/** A step line, `◆ Preparing 1 sandbox (docker)...`, its text wrapped under itself. */
|
|
273
|
-
function stepLines(glyph, text, width) {
|
|
274
|
-
return wrap(text, Math.max(20, width - GLYPH)).map((line, i) => i === 0 ? ` ${glyph} ${line}` : `${indent(GLYPH)}${line}`);
|
|
275
|
-
}
|
|
276
|
-
/** A run-level notice (a prepared workspace, the Ctrl-C one) as a step line. */
|
|
277
|
-
function noticeLines(c, e, width) {
|
|
278
|
-
const glyph = {
|
|
279
|
-
info: c.dim("ℹ"),
|
|
280
|
-
warn: c.orange("⚠"),
|
|
281
|
-
error: c.red("✗")
|
|
282
|
-
}[e.level];
|
|
283
|
-
const lines = stepLines(glyph, e.text, width);
|
|
284
|
-
return e.level === "info" ? lines.map((l) => c.dim(l)) : lines;
|
|
285
|
-
}
|
|
286
|
-
/** Preflight: which sandboxes it prepares, each one ready, and each failure. */
|
|
287
|
-
function prepareStepLines(c, e, width, max) {
|
|
288
|
-
if (e.state === "start") {
|
|
289
|
-
const n = e.targets.length;
|
|
290
|
-
const names = e.targets.map((t) => t.label).join(", ");
|
|
291
|
-
return stepLines(c.teal("◆"), `Preparing ${plural(n, "sandbox", "sandboxes")} (${names})...`, width);
|
|
292
|
-
}
|
|
293
|
-
const { outcome } = e;
|
|
294
|
-
if (outcome.ok) {
|
|
295
|
-
const took = outcome.ms >= 1e3 ? ` ${c.dim(formatDuration(outcome.ms))}` : "";
|
|
296
|
-
return [` ${c.green("✓")} ${outcome.target.label} ready${took}`];
|
|
297
|
-
}
|
|
298
|
-
const who = outcome.target.setBy.join(", ");
|
|
299
|
-
return [` ${c.red("✗")} ${outcome.target.label} failed to prepare ${c.dim(`(set by ${who}; only its attempts fail)`)}`, ...tailLines(outcome.failure.message, max).map((l) => `${indent(GLYPH)}${c.orange(l)}`)];
|
|
300
|
-
}
|
|
301
|
-
/** The start line's text: how the attempts' logs will print. */
|
|
302
|
-
function startText(output) {
|
|
303
|
-
return output.outputLogs === "none" ? "Running..." : output.outputLogs === "errors-only" ? "Running; logs print for failed attempts only..." : output.logOrder === "stream" ? "Streaming logs..." : "Running; each attempt's logs print as it ends...";
|
|
304
|
-
}
|
|
305
|
-
/** The last line before the attempts' own: how their logs will print. */
|
|
306
|
-
function startLine(c, output) {
|
|
307
|
-
return ` ${c.teal("◆")} ${startText(output)}`;
|
|
308
|
-
}
|
|
309
|
-
/** What the start line's text becomes once the run ends, on a terminal that redraws it. */
|
|
310
|
-
function endText(status) {
|
|
311
|
-
return status === "interrupted" ? "Canceled." : status === "budget" ? "Stopped at the budget." : "Finished.";
|
|
312
|
-
}
|
|
313
|
-
/** The plan as the header block: its facts, `--dry-run`'s table, then each kind of note. */
|
|
314
|
-
function planLines(c, e, width) {
|
|
315
|
-
const sections = [
|
|
316
|
-
e.details,
|
|
317
|
-
[...e.warnings.flatMap((w) => noteLines(c, "warning", w, width)), ...(e.sandboxWarnings ?? []).flatMap((w) => noteLines(c, w.kind === "root" ? "root" : "warning", w.message, width))],
|
|
318
|
-
e.hints.flatMap((h) => noteLines(c, "hint", h, width))
|
|
319
|
-
];
|
|
320
|
-
const out = headerLines(c, e.header, width);
|
|
321
|
-
for (const lines of sections) if (lines.length) out.push("", ...lines);
|
|
322
|
-
out.push("");
|
|
323
|
-
return out;
|
|
324
|
-
}
|
|
325
|
-
// src/ui/tags.ts
|
|
326
|
-
const STOPWORDS = new Set("a an the and or of to in on for with without from by at as is are be it its that this when than then into via not no".split(" "));
|
|
327
|
-
const MAX_WORDS = 3;
|
|
328
|
-
const MAX_LENGTH = 24;
|
|
329
|
-
const words = (name) => name.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter((w) => w && !STOPWORDS.has(w));
|
|
330
|
-
/**
|
|
331
|
-
* Short handles for the evals of one file, e.g. `greet`: the first distinctive words of each
|
|
332
|
-
* name, where words shared by most of the file's evals ("recommends Genkit over …") don't
|
|
333
|
-
* count. Depends only on the file's evals, so a tag stays the same across runs and filters.
|
|
334
|
-
*/
|
|
335
|
-
function fileTags(evals, taken) {
|
|
336
|
-
const lists = evals.map((e) => words(e.name));
|
|
337
|
-
const df = /* @__PURE__ */ new Map();
|
|
338
|
-
for (const list of lists) for (const w of new Set(list)) df.set(w, (df.get(w) ?? 0) + 1);
|
|
339
|
-
const common = (w) => evals.length > 1 && (df.get(w) ?? 0) > evals.length / 2;
|
|
340
|
-
const candidates = lists.map((list) => {
|
|
341
|
-
const rare = list.filter((w) => !common(w));
|
|
342
|
-
return rare.length ? rare : list.length ? list : ["eval"];
|
|
343
|
-
});
|
|
344
|
-
const tags = /* @__PURE__ */ new Map();
|
|
345
|
-
const clip = (tag) => tag.slice(0, MAX_LENGTH).replace(/-+$/, "");
|
|
346
|
-
const prefix = (list, n) => clip(list.slice(0, n).join("-"));
|
|
347
|
-
evals.forEach((e, i) => {
|
|
348
|
-
const own = candidates[i] ?? ["eval"];
|
|
349
|
-
let tag = prefix(own, 1);
|
|
350
|
-
for (let n = 1; n <= MAX_WORDS; n++) {
|
|
351
|
-
tag = prefix(own, n);
|
|
352
|
-
if (!candidates.some((other, j) => j !== i && prefix(other, n) === tag) && !taken.has(tag)) break;
|
|
353
|
-
}
|
|
354
|
-
let unique = tag;
|
|
355
|
-
for (let k = 2; taken.has(unique); k++) unique = `${tag}-${k}`;
|
|
356
|
-
taken.add(unique);
|
|
357
|
-
tags.set(e.id, unique);
|
|
358
|
-
});
|
|
359
|
-
return tags;
|
|
360
|
-
}
|
|
361
|
-
/** Tags evals as their files are collected; later files never rename earlier tags. */
|
|
362
|
-
var Tagger = class {
|
|
363
|
-
#tags = /* @__PURE__ */ new Map();
|
|
364
|
-
#taken = /* @__PURE__ */ new Set();
|
|
365
|
-
addFile(attempts) {
|
|
366
|
-
const fresh = [...new Map(attempts.map((a) => [a.id, a])).values()].filter((e) => !this.#tags.has(e.id));
|
|
367
|
-
for (const [id, tag] of fileTags(fresh, this.#taken)) this.#tags.set(id, tag);
|
|
368
|
-
}
|
|
369
|
-
/** `greet#1`: the eval's tag and run number. */
|
|
370
|
-
label(id, attempt) {
|
|
371
|
-
let tag = this.#tags.get(id);
|
|
372
|
-
if (!tag) {
|
|
373
|
-
this.addFile([{
|
|
374
|
-
id,
|
|
375
|
-
name: id.split(" › ").at(-1) ?? id
|
|
376
|
-
}]);
|
|
377
|
-
tag = this.#tags.get(id) ?? "eval";
|
|
378
|
-
}
|
|
379
|
-
return `${tag}#${attempt}`;
|
|
380
|
-
}
|
|
381
|
-
};
|
|
382
|
-
// src/ui/agent.ts
|
|
383
|
-
const MAX_LINES = 12;
|
|
384
|
-
/** Agents read whole lines, so the header's notes don't wrap. */
|
|
385
|
-
const WIDTH = Number.POSITIVE_INFINITY;
|
|
386
|
-
var AgentRenderer = class {
|
|
387
|
-
#o;
|
|
388
|
-
#c = colors(false);
|
|
389
|
-
/** `[key]` prefixes for `-v` lines, from each attempt's start. */
|
|
390
|
-
#labels = /* @__PURE__ */ new Map();
|
|
391
|
-
#tags = new Tagger();
|
|
392
|
-
constructor(options) {
|
|
393
|
-
this.#o = options;
|
|
394
|
-
}
|
|
395
|
-
#write(text) {
|
|
396
|
-
this.#o.out.write(`${text.trimEnd()}\n`);
|
|
397
|
-
}
|
|
398
|
-
onEvent(e) {
|
|
399
|
-
switch (e.type) {
|
|
400
|
-
case "plan":
|
|
401
|
-
for (const line of planLines(this.#c, e, WIDTH)) this.#write(line);
|
|
402
|
-
return;
|
|
403
|
-
case "run-start":
|
|
404
|
-
this.#write(startLine(this.#c, {
|
|
405
|
-
...this.#o.output,
|
|
406
|
-
outputLogs: "none"
|
|
407
|
-
}));
|
|
408
|
-
return;
|
|
409
|
-
case "collected":
|
|
410
|
-
this.#tags.addFile(e.evals);
|
|
411
|
-
return;
|
|
412
|
-
case "eval-start": {
|
|
413
|
-
const tag = this.#tags.label(e.id, e.attempt?.n ?? 1);
|
|
414
|
-
this.#labels.set(e.key, `[${tag} ${attemptAxes(e.attempt, "agent")}]`);
|
|
415
|
-
return;
|
|
416
|
-
}
|
|
417
|
-
case "debug": {
|
|
418
|
-
const label = this.#labels.get(e.key) ?? `[${e.key}]`;
|
|
419
|
-
for (const line of debugLines(this.#c, e.line, this.#o.verbosity === 2)) this.#write(`${label} ${line}`);
|
|
420
|
-
return;
|
|
421
|
-
}
|
|
422
|
-
case "eval-progress": {
|
|
423
|
-
if (e.progress.kind !== "browser-download" && e.progress.kind !== "warning") return;
|
|
424
|
-
const label = this.#labels.get(e.key) ?? `[${e.key}]`;
|
|
425
|
-
this.#write(`${label} ${progressLine(this.#c, e.progress)}`);
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
case "prepare":
|
|
429
|
-
for (const line of prepareStepLines(this.#c, e, WIDTH, MAX_LINES)) this.#write(line);
|
|
430
|
-
return;
|
|
431
|
-
case "notice":
|
|
432
|
-
for (const line of noticeLines(this.#c, e, WIDTH)) this.#write(line);
|
|
433
|
-
return;
|
|
434
|
-
case "run-end": {
|
|
435
|
-
this.#write("");
|
|
436
|
-
const verbose = (this.#o.verbosity ?? 0) > 0;
|
|
437
|
-
const list = statusList({
|
|
438
|
-
record: e.record,
|
|
439
|
-
suite: suiteResult(e.record),
|
|
440
|
-
remarks: e.remarks ?? null,
|
|
441
|
-
verbose,
|
|
442
|
-
...e.notRun ? { notRun: e.notRun } : {}
|
|
443
|
-
});
|
|
444
|
-
const pointer = pointerLine(e.summaryPath);
|
|
445
|
-
for (const line of listLines(list, this.#c, false, pointer, verbose, true)) this.#write(line);
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
default: return;
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
close() {}
|
|
452
|
-
};
|
|
453
|
-
// src/ui/plain.ts
|
|
454
|
-
/** In a grouped block, an end line replaces its start line and keeps its start time. */
|
|
455
|
-
const STARTS = {
|
|
456
|
-
"sandbox-ready": "sandbox",
|
|
457
|
-
"turn-end": "turn-start",
|
|
458
|
-
"check-end": "check-start",
|
|
459
|
-
"judge-end": "judge-start",
|
|
460
|
-
"browser-download": "browser-download"
|
|
461
|
-
};
|
|
462
|
-
const ERROR_LINES = 12;
|
|
463
|
-
/** Back to the start of the line and clear it, for the live status line. */
|
|
464
|
-
const CLEAR = "\r\x1B[2K";
|
|
465
|
-
/** GitHub Actions workflow-command escaping. */
|
|
466
|
-
const ghEscape = (s, property = false) => {
|
|
467
|
-
const out = s.replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A");
|
|
468
|
-
return property ? out.replace(/:/g, "%3A").replace(/,/g, "%2C") : out;
|
|
469
|
-
};
|
|
470
|
-
/** The eval file's line in Vitest's formatted error (`❯ evals/a.eval.ts:7:33`), if any. */
|
|
471
|
-
function locate(result) {
|
|
472
|
-
const text = stripAnsi(result.formattedErrors[0] ?? "");
|
|
473
|
-
const file = result.file.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
474
|
-
const match = new RegExp(`❯ ${file}:(\\d+):(\\d+)`).exec(text);
|
|
475
|
-
return match?.[1] && match[2] ? {
|
|
476
|
-
line: match[1],
|
|
477
|
-
col: match[2]
|
|
478
|
-
} : void 0;
|
|
479
|
-
}
|
|
480
|
-
/** `evals/a.eval.ts:7` as its file and line. */
|
|
481
|
-
const splitAt = (at) => {
|
|
482
|
-
const i = at.lastIndexOf(":");
|
|
483
|
-
return [at.slice(0, i), at.slice(i + 1)];
|
|
484
|
-
};
|
|
485
|
-
var PlainRenderer = class {
|
|
486
|
-
#o;
|
|
487
|
-
#c;
|
|
488
|
-
#tags = new Tagger();
|
|
489
|
-
#running = /* @__PURE__ */ new Map();
|
|
490
|
-
#now;
|
|
491
|
-
#queued = /* @__PURE__ */ new Set();
|
|
492
|
-
#runStartedAt = 0;
|
|
493
|
-
#lastWrite = 0;
|
|
494
|
-
/** The last line written was blank, so the list needs no gap above it. */
|
|
495
|
-
#blank = false;
|
|
496
|
-
#timer;
|
|
497
|
-
/** On a TTY: the status line is drawn under everything else, and redrawn after each write. */
|
|
498
|
-
#live;
|
|
499
|
-
#status = "";
|
|
500
|
-
/** Tries collected (not skipped), as many as the plan has, and the tries that ended. */
|
|
501
|
-
#tries = /* @__PURE__ */ new Set();
|
|
502
|
-
#plannedTries = 0;
|
|
503
|
-
#ended = /* @__PURE__ */ new Set();
|
|
504
|
-
#list;
|
|
505
|
-
#lastProgress = 0;
|
|
506
|
-
constructor(options) {
|
|
507
|
-
this.#o = options;
|
|
508
|
-
this.#list = new LiveList(options.harness);
|
|
509
|
-
this.#c = options.colors;
|
|
510
|
-
this.#now = options.now ?? Date.now;
|
|
511
|
-
this.#live = options.output.statusLine;
|
|
512
|
-
const { heartbeatMs } = options.output;
|
|
513
|
-
if (options.timers !== false && heartbeatMs > 0) {
|
|
514
|
-
this.#timer = setInterval(() => this.tick(), Math.min(heartbeatMs, 5e3));
|
|
515
|
-
this.#timer.unref();
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
#write(text) {
|
|
519
|
-
const line = `${text.trimEnd()}\n`;
|
|
520
|
-
this.#o.out.write(this.#status ? `${CLEAR}${line}${this.#status}` : line);
|
|
521
|
-
this.#lastWrite = this.#now();
|
|
522
|
-
this.#blank = line === "\n";
|
|
523
|
-
}
|
|
524
|
-
/**
|
|
525
|
-
* `7 evals · 12/28 tries`: what the plan runs (or what's collected, when that's more) and how
|
|
526
|
-
* many tries ended.
|
|
527
|
-
*/
|
|
528
|
-
#drawStatus() {
|
|
529
|
-
if (!this.#live || !this.#tries.size) return;
|
|
530
|
-
const { total } = this.#list.counts();
|
|
531
|
-
const tries = Math.max(this.#plannedTries, this.#tries.size);
|
|
532
|
-
const status = this.#c.dim(`${plural(total, "eval")} · ${this.#ended.size}/${tries} tries`);
|
|
533
|
-
if (status === this.#status) return;
|
|
534
|
-
this.#o.out.write(`${CLEAR}${status}`);
|
|
535
|
-
this.#status = status;
|
|
536
|
-
}
|
|
537
|
-
#clearStatus() {
|
|
538
|
-
if (!this.#status) return;
|
|
539
|
-
this.#o.out.write(CLEAR);
|
|
540
|
-
this.#status = "";
|
|
541
|
-
}
|
|
542
|
-
#attempt(ref, startedAt) {
|
|
543
|
-
const n = ref.attempt?.n ?? 1;
|
|
544
|
-
const label = `[${this.#tags.label(ref.id, n)} ${attemptAxes(ref.attempt, this.#o.harness)}]`;
|
|
545
|
-
const ungated = ref.attempt?.gate === "none";
|
|
546
|
-
return {
|
|
547
|
-
key: ref.key,
|
|
548
|
-
id: ref.id,
|
|
549
|
-
label,
|
|
550
|
-
startedAt,
|
|
551
|
-
lines: [],
|
|
552
|
-
last: void 0,
|
|
553
|
-
ungated
|
|
554
|
-
};
|
|
555
|
-
}
|
|
556
|
-
#prefix(a) {
|
|
557
|
-
return this.#c.tag(a.label)(a.label);
|
|
558
|
-
}
|
|
559
|
-
#detail(a, line, prefixed) {
|
|
560
|
-
const body = line.debug ? ` ${line.text}` : ` ${this.#c.dim(offset(line.at - a.startedAt))} ${line.text}`;
|
|
561
|
-
return prefixed ? `${this.#prefix(a)}${body}` : body.slice(1);
|
|
562
|
-
}
|
|
563
|
-
get #streaming() {
|
|
564
|
-
return this.#o.output.logOrder === "stream" && this.#o.output.outputLogs === "full";
|
|
565
|
-
}
|
|
566
|
-
#add(a, line) {
|
|
567
|
-
if (line.kind === "warning" && !this.#streaming) {
|
|
568
|
-
this.#write(this.#detail(a, line, true));
|
|
569
|
-
return;
|
|
570
|
-
}
|
|
571
|
-
a.lines.push(line);
|
|
572
|
-
if (this.#streaming) this.#write(this.#detail(a, line, true));
|
|
573
|
-
}
|
|
574
|
-
onEvent(e) {
|
|
575
|
-
const c = this.#c;
|
|
576
|
-
switch (e.type) {
|
|
577
|
-
case "run-start":
|
|
578
|
-
this.#runStartedAt = e.at;
|
|
579
|
-
this.#write(startLine(c, this.#o.output));
|
|
580
|
-
this.#write("");
|
|
581
|
-
return;
|
|
582
|
-
case "plan":
|
|
583
|
-
this.#list.planned(e.header.evals);
|
|
584
|
-
this.#plannedTries = e.header.attempts;
|
|
585
|
-
for (const line of planLines(c, e, this.#columns)) this.#write(line);
|
|
586
|
-
if (this.#o.output.githubActions) for (const w of e.sandboxWarnings ?? []) this.#annotate(w);
|
|
587
|
-
return;
|
|
588
|
-
case "collected":
|
|
589
|
-
this.#list.collected(e.file, e.evals);
|
|
590
|
-
this.#tags.addFile(e.evals);
|
|
591
|
-
for (const x of e.evals) {
|
|
592
|
-
if (x.skipped) continue;
|
|
593
|
-
this.#queued.add(x.key);
|
|
594
|
-
this.#tries.add(x.key);
|
|
595
|
-
}
|
|
596
|
-
this.#drawStatus();
|
|
597
|
-
return;
|
|
598
|
-
case "eval-start": {
|
|
599
|
-
const a = this.#attempt(e, e.at);
|
|
600
|
-
this.#list.start(e);
|
|
601
|
-
a.last = e;
|
|
602
|
-
this.#queued.delete(e.key);
|
|
603
|
-
this.#running.set(e.key, a);
|
|
604
|
-
if (this.#streaming) this.#write(`${this.#prefix(a)} ${c.dim("▶")} ${e.id}`);
|
|
605
|
-
return;
|
|
606
|
-
}
|
|
607
|
-
case "eval-progress": {
|
|
608
|
-
const a = this.#running.get(e.key);
|
|
609
|
-
if (!a) return;
|
|
610
|
-
this.#list.progress(e.key, e.progress);
|
|
611
|
-
if (e.progress.kind !== "warning") a.last = e;
|
|
612
|
-
const { progress } = e;
|
|
613
|
-
const paint = a.ungated ? {
|
|
614
|
-
...c,
|
|
615
|
-
red: c.dim
|
|
616
|
-
} : c;
|
|
617
|
-
const line = {
|
|
618
|
-
at: progress.at,
|
|
619
|
-
text: progressLine(paint, progress),
|
|
620
|
-
kind: progress.kind
|
|
621
|
-
};
|
|
622
|
-
const start = STARTS[progress.kind];
|
|
623
|
-
const open = start && a.lines.findLastIndex((l) => l.kind === start);
|
|
624
|
-
if (!this.#streaming && open !== void 0 && open >= 0) {
|
|
625
|
-
line.at = a.lines[open]?.at ?? line.at;
|
|
626
|
-
a.lines.splice(open, 1);
|
|
627
|
-
}
|
|
628
|
-
this.#add(a, line);
|
|
629
|
-
return;
|
|
630
|
-
}
|
|
631
|
-
case "debug": {
|
|
632
|
-
const a = this.#running.get(e.key);
|
|
633
|
-
if (!a) return;
|
|
634
|
-
for (const text of debugLines(c, e.line, this.#o.verbosity === 2)) this.#add(a, {
|
|
635
|
-
at: e.line.at,
|
|
636
|
-
text,
|
|
637
|
-
debug: true
|
|
638
|
-
});
|
|
639
|
-
return;
|
|
640
|
-
}
|
|
641
|
-
case "log": {
|
|
642
|
-
const a = e.key ? this.#running.get(e.key) : void 0;
|
|
643
|
-
const label = e.stream === "stderr" ? c.yellow("stderr |") : c.dim("stdout |");
|
|
644
|
-
for (const text of e.text.replace(/\n$/, "").split("\n")) if (a) this.#add(a, {
|
|
645
|
-
at: e.at,
|
|
646
|
-
text: `${label} ${text}`
|
|
647
|
-
});
|
|
648
|
-
else this.#write(`${label} ${text}`);
|
|
649
|
-
return;
|
|
650
|
-
}
|
|
651
|
-
case "eval-end":
|
|
652
|
-
this.#list.end(e.result);
|
|
653
|
-
this.#end(e.result, e.at);
|
|
654
|
-
if (this.#tries.has(e.result.key)) this.#ended.add(e.result.key);
|
|
655
|
-
this.#drawStatus();
|
|
656
|
-
return;
|
|
657
|
-
case "prepare":
|
|
658
|
-
for (const line of prepareStepLines(c, e, this.#columns, ERROR_LINES)) this.#write(line);
|
|
659
|
-
if (e.state === "failed" && this.#o.output.githubActions) {
|
|
660
|
-
const { target, failure } = e.outcome;
|
|
661
|
-
const what = target.kind === "workspace" ? "The" : "Sandbox";
|
|
662
|
-
const title = ghEscape(`${what} ${target.label} failed to prepare`, true);
|
|
663
|
-
this.#write(`::error title=${title}::${ghEscape(failure.message)}`);
|
|
664
|
-
}
|
|
665
|
-
return;
|
|
666
|
-
case "notice":
|
|
667
|
-
for (const line of noticeLines(c, e, this.#columns)) this.#write(line);
|
|
668
|
-
return;
|
|
669
|
-
case "run-end": {
|
|
670
|
-
this.#clearStatus();
|
|
671
|
-
if (!this.#blank) this.#write("");
|
|
672
|
-
const verbose = (this.#o.verbosity ?? 0) > 0;
|
|
673
|
-
const list = statusList({
|
|
674
|
-
record: e.record,
|
|
675
|
-
suite: suiteResult(e.record),
|
|
676
|
-
remarks: e.remarks ?? null,
|
|
677
|
-
verbose,
|
|
678
|
-
...e.notRun ? { notRun: e.notRun } : {}
|
|
679
|
-
});
|
|
680
|
-
for (const line of listLines(list, c, true, pointerLine(e.summaryPath), verbose)) this.#write(line);
|
|
681
|
-
return;
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
get #columns() {
|
|
686
|
-
return this.#o.columns || Number.POSITIVE_INFINITY;
|
|
687
|
-
}
|
|
688
|
-
/** The header block names a sandbox warning; GitHub Actions also annotates it. */
|
|
689
|
-
#annotate(w) {
|
|
690
|
-
const file = w.file ? `file=${ghEscape(w.file, true)},` : "";
|
|
691
|
-
const title = w.kind === "root" ? "Sandbox runs as root" : "Sandbox has extra capabilities";
|
|
692
|
-
this.#write(`::warning ${file}title=${ghEscape(title, true)}::${ghEscape(w.message)}`);
|
|
693
|
-
}
|
|
694
|
-
/**
|
|
695
|
-
* An ended attempt's logs, as `--output-logs` picks: grouped, its block under a `▶` header;
|
|
696
|
-
* streamed, only its error lines, since the rest already printed. A sandbox that failed to
|
|
697
|
-
* prepare was annotated once, for all its attempts.
|
|
698
|
-
*/
|
|
699
|
-
#end(result, at) {
|
|
700
|
-
const c = this.#c;
|
|
701
|
-
const a = this.#running.get(result.key) ?? this.#attempt(result, at - result.durationMs);
|
|
702
|
-
this.#running.delete(result.key);
|
|
703
|
-
this.#queued.delete(result.key);
|
|
704
|
-
const outcome = outcomeOf(result);
|
|
705
|
-
const failed = outcome !== "pass" && outcome !== "skipped";
|
|
706
|
-
const ungated = failed && result.attempt?.gate === "none";
|
|
707
|
-
const missed = ungated && outcome === "fail";
|
|
708
|
-
const { outputLogs, githubActions, logPrefix } = this.#o.output;
|
|
709
|
-
const showDetail = !this.#streaming && a.lines.length > 0 && (outputLogs === "full" || outputLogs === "errors-only" && failed);
|
|
710
|
-
const judged = result.meta?.errorKind === "judge" && (showDetail || this.#streaming);
|
|
711
|
-
const errors = failed && outputLogs !== "none" && !judged ? missed ? failureLines(colors(false), result, { max: 1 }).filter((l) => l.trim()).slice(0, 1).map((l) => c.dim(l)) : failureLines(c, result, { max: ERROR_LINES }) : [];
|
|
712
|
-
const lines = a.lines.filter((l) => l.kind !== "cleanup").sort((x, y) => x.at - y.at);
|
|
713
|
-
const prefixed = logPrefix === "task";
|
|
714
|
-
const head = `${this.#prefix(a)} ${c.dim("▶")} ${result.id}`;
|
|
715
|
-
const group = githubActions && showDetail && (!failed || missed);
|
|
716
|
-
if (showDetail || !this.#streaming && errors.length) this.#write(group ? `::group::${stripAnsi(head)}` : head);
|
|
717
|
-
if (showDetail) for (const line of lines) this.#write(this.#detail(a, line, prefixed));
|
|
718
|
-
for (const line of errors) this.#write(prefixed ? `${this.#prefix(a)} ${line}` : ` ${line}`);
|
|
719
|
-
if (group) this.#write("::endgroup::");
|
|
720
|
-
if (githubActions && failed && !ungated && !result.meta?.prepare) {
|
|
721
|
-
const which = result.attempt?.label ? ` [${result.attempt.label}]` : "";
|
|
722
|
-
const title = ghEscape(`${result.id}${which}`, true);
|
|
723
|
-
const checks = (result.meta?.failedChecks ?? []).filter((x) => x.at);
|
|
724
|
-
for (const x of checks) {
|
|
725
|
-
const [file, line] = splitAt(x.at);
|
|
726
|
-
const label = ghEscape(`${result.id}${which}: ${x.label}`, true);
|
|
727
|
-
this.#write(`::error file=${ghEscape(file, true)},line=${line},title=${label}::${ghEscape(x.message)}`);
|
|
728
|
-
}
|
|
729
|
-
if (!errorCheck(result)?.at) {
|
|
730
|
-
const message = ghEscape(failureLines(colors(false), result, { max: ERROR_LINES }).join("\n").replace(/^✗ failed {2}/, ""));
|
|
731
|
-
const at = locate(result);
|
|
732
|
-
const where = at ? `,line=${at.line},col=${at.col}` : "";
|
|
733
|
-
this.#write(`::error file=${ghEscape(result.file, true)}${where},title=${title}::${message}`);
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
/**
|
|
738
|
-
* Every `heartbeatMs` while attempts run. Without attempt logs, how many evals are done; with
|
|
739
|
-
* them, each running attempt's phase, when nothing printed for that long.
|
|
740
|
-
*/
|
|
741
|
-
tick(now = this.#now()) {
|
|
742
|
-
const { heartbeatMs, outputLogs } = this.#o.output;
|
|
743
|
-
if (this.#live || heartbeatMs <= 0) return;
|
|
744
|
-
if (this.#running.size === 0) return;
|
|
745
|
-
const c = this.#c;
|
|
746
|
-
if (outputLogs === "none") {
|
|
747
|
-
if (now - Math.max(this.#lastProgress, this.#runStartedAt) < heartbeatMs) return;
|
|
748
|
-
const { done, total } = this.#list.counts();
|
|
749
|
-
this.#write(c.dim(progressText(done, total, now - this.#runStartedAt)));
|
|
750
|
-
this.#lastProgress = now;
|
|
751
|
-
return;
|
|
752
|
-
}
|
|
753
|
-
if (now - this.#lastWrite < heartbeatMs) return;
|
|
754
|
-
const running = [...this.#running.values()].map((a) => {
|
|
755
|
-
const progress = a.last?.type === "eval-progress" ? a.last.progress : void 0;
|
|
756
|
-
return `${this.#prefix(a)} ${phaseOf(progress)} ${c.dim(formatDuration(now - a.startedAt))}`;
|
|
757
|
-
});
|
|
758
|
-
const queued = this.#queued.size ? `, ${this.#queued.size} queued` : "";
|
|
759
|
-
const elapsed = formatDuration(now - this.#runStartedAt);
|
|
760
|
-
this.#write(`${c.dim(`… ${this.#running.size} running${queued} after ${elapsed}:`)} ${running.join(c.dim(", "))}`);
|
|
761
|
-
}
|
|
762
|
-
close() {
|
|
763
|
-
clearInterval(this.#timer);
|
|
764
|
-
this.#clearStatus();
|
|
765
|
-
}
|
|
766
|
-
};
|
|
767
|
-
// src/ui/tty.ts
|
|
768
|
-
/** The list's state, which the Ink app reads with `useSyncExternalStore`. */
|
|
769
|
-
var ListStore = class {
|
|
770
|
-
#state = {
|
|
771
|
-
files: [],
|
|
772
|
-
logs: [],
|
|
773
|
-
counts: {
|
|
774
|
-
done: 0,
|
|
775
|
-
total: 0
|
|
776
|
-
},
|
|
777
|
-
phase: null,
|
|
778
|
-
finished: null
|
|
779
|
-
};
|
|
780
|
-
#listeners = /* @__PURE__ */ new Set();
|
|
781
|
-
get = () => this.#state;
|
|
782
|
-
subscribe = (listener) => {
|
|
783
|
-
this.#listeners.add(listener);
|
|
784
|
-
return () => this.#listeners.delete(listener);
|
|
785
|
-
};
|
|
786
|
-
set(next) {
|
|
787
|
-
this.#state = {
|
|
788
|
-
...this.#state,
|
|
789
|
-
...next
|
|
790
|
-
};
|
|
791
|
-
for (const l of this.#listeners) l();
|
|
792
|
-
}
|
|
793
|
-
};
|
|
794
|
-
const FRAME_MS = 80;
|
|
795
|
-
const ESC = String.fromCharCode(27);
|
|
796
|
-
const BEL = String.fromCharCode(7);
|
|
797
|
-
/** A CSI sequence (colors, cursor moves) or an OSC one (a hyperlink), which take no columns. */
|
|
798
|
-
const ESCAPE = new RegExp(`${ESC}(?:\\[[0-9;?]*[ -/]*[@-~]|\\][^${BEL}${ESC}]*(?:${BEL}|${ESC}\\\\))`, "g");
|
|
799
|
-
const graphemes = new Intl.Segmenter();
|
|
800
|
-
/**
|
|
801
|
-
* Terminal rows one line takes at `columns`, placed as a terminal places it: a wide character that
|
|
802
|
-
* doesn't fit in the row's last column moves to the next row, `\r` returns to the row's start and
|
|
803
|
-
* `\t` goes to the next stop of eight without wrapping.
|
|
804
|
-
*/
|
|
805
|
-
function rowsOf(line, columns) {
|
|
806
|
-
let rows = 1;
|
|
807
|
-
let column = 0;
|
|
808
|
-
for (const { segment } of graphemes.segment(line.replace(ESCAPE, ""))) if (segment === "\r") column = 0;
|
|
809
|
-
else if (segment === " ") column = Math.min(columns - 1, (Math.floor(column / 8) + 1) * 8);
|
|
810
|
-
else if (segment === "\b") column = Math.max(0, column - 1);
|
|
811
|
-
else {
|
|
812
|
-
const width = stringWidth(segment);
|
|
813
|
-
if (!width) continue;
|
|
814
|
-
if (column + width > columns) {
|
|
815
|
-
rows += 1;
|
|
816
|
-
column = 0;
|
|
817
|
-
}
|
|
818
|
-
column += width;
|
|
819
|
-
}
|
|
820
|
-
return rows;
|
|
821
|
-
}
|
|
822
|
-
/**
|
|
823
|
-
* Before the list is up, the sandbox prepare step: the glyph of its `◆ Preparing…` line spins in
|
|
824
|
-
* place (the cursor goes up to it and back) until each sandbox is ready or failed, then settles to
|
|
825
|
-
* `◆`. What prints under it is kept and measured in rows as the terminal placed it, so a wide
|
|
826
|
-
* character still finds the step line. Once the step line would be out of reach, or the width
|
|
827
|
-
* changes (some terminals reflow what they show, some don't, so its row is unknown), it stops
|
|
828
|
-
* without drawing.
|
|
829
|
-
*/
|
|
830
|
-
var StepSpinner = class {
|
|
831
|
-
#write;
|
|
832
|
-
#c;
|
|
833
|
-
#size;
|
|
834
|
-
#timer;
|
|
835
|
-
#frame = 0;
|
|
836
|
-
/** The step line and everything printed under it since. */
|
|
837
|
-
#text = "";
|
|
838
|
-
/** The width `#text` was printed at. */
|
|
839
|
-
#columns = 0;
|
|
840
|
-
#pending = 0;
|
|
841
|
-
constructor(write, c, size) {
|
|
842
|
-
this.#write = write;
|
|
843
|
-
this.#c = c;
|
|
844
|
-
this.#size = size;
|
|
845
|
-
}
|
|
846
|
-
/** Terminal lines from the step line down to the cursor after `text`. */
|
|
847
|
-
#up(text = this.#text) {
|
|
848
|
-
const columns = Math.max(1, this.#columns);
|
|
849
|
-
const lines = text.split("\n");
|
|
850
|
-
if (lines.at(-1) === "") lines.pop();
|
|
851
|
-
return lines.reduce((n, l) => n + rowsOf(l, columns), 0);
|
|
852
|
-
}
|
|
853
|
-
/** The step line was just written as `text`; it spins until `targets` have reported. */
|
|
854
|
-
start(text, targets) {
|
|
855
|
-
this.settle();
|
|
856
|
-
this.#text = text;
|
|
857
|
-
this.#columns = this.#size().columns;
|
|
858
|
-
this.#pending = targets;
|
|
859
|
-
this.#timer = setInterval(() => this.#draw(), FRAME_MS);
|
|
860
|
-
this.#timer.unref();
|
|
861
|
-
this.#draw();
|
|
862
|
-
}
|
|
863
|
-
/** Before `text` prints under it; settles first if the step line would scroll out of reach. */
|
|
864
|
-
before(text) {
|
|
865
|
-
if (!this.#timer) return;
|
|
866
|
-
const next = this.#text + text;
|
|
867
|
-
if (!this.#reachable(next)) this.settle();
|
|
868
|
-
this.#text = next;
|
|
869
|
-
}
|
|
870
|
-
/** One sandbox reported; the last settles it. */
|
|
871
|
-
reported() {
|
|
872
|
-
this.#pending -= 1;
|
|
873
|
-
if (this.#pending <= 0) this.settle();
|
|
874
|
-
}
|
|
875
|
-
#reachable(text = this.#text) {
|
|
876
|
-
const { rows, columns } = this.#size();
|
|
877
|
-
return columns === this.#columns && this.#up(text) < rows - 1;
|
|
878
|
-
}
|
|
879
|
-
#draw(glyph = SPINNER[this.#frame++ % SPINNER.length] ?? "◆") {
|
|
880
|
-
if (!this.#reachable()) {
|
|
881
|
-
clearInterval(this.#timer);
|
|
882
|
-
this.#timer = void 0;
|
|
883
|
-
return;
|
|
884
|
-
}
|
|
885
|
-
const up = this.#up();
|
|
886
|
-
this.#write(`\x1b[${up}A\r\x1b[2C${this.#c.teal(glyph)}\r\x1b[${up}B`);
|
|
887
|
-
}
|
|
888
|
-
settle() {
|
|
889
|
-
if (!this.#timer) return;
|
|
890
|
-
this.#draw("◆");
|
|
891
|
-
clearInterval(this.#timer);
|
|
892
|
-
this.#timer = void 0;
|
|
893
|
-
}
|
|
894
|
-
};
|
|
895
|
-
var InteractiveRenderer = class {
|
|
896
|
-
#o;
|
|
897
|
-
#c;
|
|
898
|
-
#store = new ListStore();
|
|
899
|
-
#list;
|
|
900
|
-
/** The header and run-level lines, as every terminal prints them. */
|
|
901
|
-
#plain;
|
|
902
|
-
#app;
|
|
903
|
-
/** Set once the list couldn't load: from then on, the run prints as a pipe's does. */
|
|
904
|
-
#fallback;
|
|
905
|
-
#ended;
|
|
906
|
-
#closed = false;
|
|
907
|
-
#spinner;
|
|
908
|
-
/** What the plain renderer wrote since `#written` was reset, while the list isn't up. */
|
|
909
|
-
#written = "";
|
|
910
|
-
constructor(options) {
|
|
911
|
-
this.#o = options;
|
|
912
|
-
this.#c = options.colors;
|
|
913
|
-
this.#list = new LiveList(options.harness);
|
|
914
|
-
this.#spinner = new StepSpinner((text) => options.out.write(text), options.colors, () => sizeOf(options.stdout));
|
|
915
|
-
const out = { write: (text) => {
|
|
916
|
-
if (!this.#app || this.#fallback) {
|
|
917
|
-
this.#spinner.before(redactSecrets(String(text)));
|
|
918
|
-
this.#written += String(text);
|
|
919
|
-
return options.out.write(text);
|
|
920
|
-
}
|
|
921
|
-
const lines = String(text).replace(/\n$/, "").split("\n");
|
|
922
|
-
this.#store.set({ logs: [...this.#store.get().logs, ...lines] });
|
|
923
|
-
return true;
|
|
924
|
-
} };
|
|
925
|
-
this.#plain = new PlainRenderer({
|
|
926
|
-
...options,
|
|
927
|
-
out,
|
|
928
|
-
timers: false,
|
|
929
|
-
output: {
|
|
930
|
-
...options.output,
|
|
931
|
-
statusLine: false,
|
|
932
|
-
interactive: false,
|
|
933
|
-
outputLogs: "none"
|
|
934
|
-
}
|
|
935
|
-
});
|
|
936
|
-
}
|
|
937
|
-
#mount() {
|
|
938
|
-
if (this.#app || this.#closed) return;
|
|
939
|
-
const cancel = this.#o.cancel ?? (() => process.kill(process.pid, "SIGINT"));
|
|
940
|
-
const load = this.#o.load ?? (() => import("./ink-list-mCJypk3d.js"));
|
|
941
|
-
this.#app = load().then((m) => m.mountList({
|
|
942
|
-
store: this.#store,
|
|
943
|
-
colors: this.#c,
|
|
944
|
-
cancel,
|
|
945
|
-
stdout: this.#o.stdout,
|
|
946
|
-
stdin: this.#o.stdin
|
|
947
|
-
})).catch((error) => {
|
|
948
|
-
this.#fallBack(error);
|
|
949
|
-
});
|
|
950
|
-
}
|
|
951
|
-
#fallBack(error) {
|
|
952
|
-
const out = this.#o.out;
|
|
953
|
-
const { logs, phase } = this.#store.get();
|
|
954
|
-
for (const line of logs) out.write(`${line}\n`);
|
|
955
|
-
const reason = error instanceof Error ? error.message : String(error);
|
|
956
|
-
out.write(`${this.#c.yellow(`Couldn't draw the interactive list (${reason}).`)}\n`);
|
|
957
|
-
if (phase) out.write(` ${this.#c.teal("◆")} ${phase}\n`);
|
|
958
|
-
this.#fallback = new PlainRenderer({
|
|
959
|
-
...this.#o,
|
|
960
|
-
timers: false,
|
|
961
|
-
output: {
|
|
962
|
-
...this.#o.output,
|
|
963
|
-
statusLine: false,
|
|
964
|
-
interactive: false
|
|
965
|
-
}
|
|
966
|
-
});
|
|
967
|
-
if (this.#ended) this.#fallback.onEvent(this.#ended.event);
|
|
968
|
-
}
|
|
969
|
-
#update() {
|
|
970
|
-
const { done, total, failed, failing } = this.#list.counts();
|
|
971
|
-
this.#store.set({
|
|
972
|
-
files: this.#list.files(),
|
|
973
|
-
counts: {
|
|
974
|
-
done,
|
|
975
|
-
total,
|
|
976
|
-
failed,
|
|
977
|
-
failing
|
|
978
|
-
}
|
|
979
|
-
});
|
|
980
|
-
}
|
|
981
|
-
onEvent(e) {
|
|
982
|
-
if (this.#fallback) {
|
|
983
|
-
if (e.type !== "run-start") this.#fallback.onEvent(e);
|
|
984
|
-
return;
|
|
985
|
-
}
|
|
986
|
-
switch (e.type) {
|
|
987
|
-
case "run-start":
|
|
988
|
-
this.#spinner.settle();
|
|
989
|
-
this.#store.set({ phase: startText(this.#o.output) });
|
|
990
|
-
return;
|
|
991
|
-
case "prepare":
|
|
992
|
-
this.#written = "";
|
|
993
|
-
this.#plain.onEvent(e);
|
|
994
|
-
if (this.#app || this.#o.timers === false || process.env.REEVAL_DEBUG) return;
|
|
995
|
-
if (e.state === "start") this.#spinner.start(this.#written, e.targets.length);
|
|
996
|
-
else this.#spinner.reported();
|
|
997
|
-
return;
|
|
998
|
-
case "plan":
|
|
999
|
-
this.#list.planned(e.header.evals);
|
|
1000
|
-
this.#plain.onEvent(e);
|
|
1001
|
-
return;
|
|
1002
|
-
case "collected":
|
|
1003
|
-
this.#spinner.settle();
|
|
1004
|
-
this.#list.collected(e.file, e.evals);
|
|
1005
|
-
this.#mount();
|
|
1006
|
-
this.#update();
|
|
1007
|
-
return;
|
|
1008
|
-
case "eval-start":
|
|
1009
|
-
this.#list.start(e);
|
|
1010
|
-
this.#update();
|
|
1011
|
-
return;
|
|
1012
|
-
case "eval-progress":
|
|
1013
|
-
if (e.progress.kind === "warning" || e.progress.kind === "browser-download") this.#plain.onEvent(e);
|
|
1014
|
-
this.#list.progress(e.key, e.progress);
|
|
1015
|
-
this.#update();
|
|
1016
|
-
return;
|
|
1017
|
-
case "eval-end":
|
|
1018
|
-
this.#list.end(e.result);
|
|
1019
|
-
this.#update();
|
|
1020
|
-
return;
|
|
1021
|
-
case "debug": return;
|
|
1022
|
-
case "run-end": {
|
|
1023
|
-
const listOf = (verbose) => statusList({
|
|
1024
|
-
record: e.record,
|
|
1025
|
-
suite: suiteResult(e.record),
|
|
1026
|
-
remarks: e.remarks ?? null,
|
|
1027
|
-
verbose,
|
|
1028
|
-
...e.notRun ? { notRun: e.notRun } : {}
|
|
1029
|
-
});
|
|
1030
|
-
const list = listOf(false);
|
|
1031
|
-
const verbose = (this.#o.verbosity ?? 0) > 0;
|
|
1032
|
-
if (!this.#app) {
|
|
1033
|
-
this.#plain.onEvent(e);
|
|
1034
|
-
return;
|
|
1035
|
-
}
|
|
1036
|
-
this.#ended = {
|
|
1037
|
-
scrollback: verbose ? listOf(true) : list,
|
|
1038
|
-
verbose,
|
|
1039
|
-
pointer: pointerLine(e.summaryPath),
|
|
1040
|
-
event: e
|
|
1041
|
-
};
|
|
1042
|
-
this.#store.set({
|
|
1043
|
-
files: list.files,
|
|
1044
|
-
...this.#store.get().phase ? { phase: endText(e.record.status) } : {},
|
|
1045
|
-
finished: {
|
|
1046
|
-
done: list.done,
|
|
1047
|
-
notes: list.notes,
|
|
1048
|
-
pointer: pointerLine(e.summaryPath),
|
|
1049
|
-
errors: list.errors
|
|
1050
|
-
}
|
|
1051
|
-
});
|
|
1052
|
-
return;
|
|
1053
|
-
}
|
|
1054
|
-
default: this.#plain.onEvent(e);
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
close() {
|
|
1058
|
-
this.#spinner.settle();
|
|
1059
|
-
this.#plain.close();
|
|
1060
|
-
this.#fallback?.close();
|
|
1061
|
-
if (!this.#store.get().finished) {
|
|
1062
|
-
this.#closed = true;
|
|
1063
|
-
this.#app?.then((a) => a?.unmount());
|
|
1064
|
-
}
|
|
1065
|
-
}
|
|
1066
|
-
/** Until the user quits the list, then the whole list into the scrollback; at once when there's none. */
|
|
1067
|
-
async wait() {
|
|
1068
|
-
const app = await this.#app;
|
|
1069
|
-
if (!app || !this.#ended) return;
|
|
1070
|
-
await app.waitUntilExit();
|
|
1071
|
-
const { phase } = this.#store.get();
|
|
1072
|
-
const { scrollback, verbose, pointer } = this.#ended;
|
|
1073
|
-
const text = [...phase ? [` ${this.#c.teal("◆")} ${phase}`, ""] : [], ...listLines(scrollback, this.#c, true, pointer, verbose)];
|
|
1074
|
-
this.#o.out.write(`${text.join("\n")}\n`);
|
|
1075
|
-
}
|
|
1076
|
-
};
|
|
1077
|
-
const sizeOf = (stdout) => {
|
|
1078
|
-
const { rows, columns } = stdout ?? {};
|
|
1079
|
-
return {
|
|
1080
|
-
rows: rows || 24,
|
|
1081
|
-
columns: columns || 80
|
|
1082
|
-
};
|
|
1083
|
-
};
|
|
1084
|
-
// src/ui/index.ts
|
|
1085
|
-
const depthOf = (bits = 4) => bits >= 24 ? 24 : bits >= 8 ? 8 : 4;
|
|
1086
|
-
function createRenderer(options) {
|
|
1087
|
-
const out = { write: (text) => options.out.write(redactSecrets(text)) };
|
|
1088
|
-
if (options.output.mode === "agent") return new AgentRenderer({
|
|
1089
|
-
...options,
|
|
1090
|
-
out
|
|
1091
|
-
});
|
|
1092
|
-
const paint = colors(options.output.color, depthOf(options.colorDepth));
|
|
1093
|
-
if (options.output.interactive && options.tty) return new InteractiveRenderer({
|
|
1094
|
-
...options,
|
|
1095
|
-
...options.tty,
|
|
1096
|
-
out,
|
|
1097
|
-
colors: paint
|
|
1098
|
-
});
|
|
1099
|
-
return new PlainRenderer({
|
|
1100
|
-
...options,
|
|
1101
|
-
out,
|
|
1102
|
-
colors: paint
|
|
1103
|
-
});
|
|
1104
|
-
}
|
|
1105
175
|
// src/cli.ts
|
|
1106
176
|
const HISTORY_COMMANDS = {
|
|
1107
177
|
record: 1,
|
|
@@ -1127,10 +197,16 @@ const EXPECTED_ERRORS = [
|
|
|
1127
197
|
"CommandError",
|
|
1128
198
|
"RefError",
|
|
1129
199
|
"HistoryError",
|
|
1130
|
-
"StudioBuildError"
|
|
200
|
+
"StudioBuildError",
|
|
201
|
+
"NewerSchemaError"
|
|
1131
202
|
];
|
|
1132
203
|
/** Errors that exit 3: reeval couldn't reach what the run needs, not a mistake in the command. */
|
|
1133
|
-
const INFRA_ERRORS = [
|
|
204
|
+
const INFRA_ERRORS = [
|
|
205
|
+
"PreflightInfraError",
|
|
206
|
+
"StoreError",
|
|
207
|
+
"EventStreamError",
|
|
208
|
+
"HostedError"
|
|
209
|
+
];
|
|
1134
210
|
const EXIT = {
|
|
1135
211
|
ok: 0,
|
|
1136
212
|
failed: 1,
|
|
@@ -1149,6 +225,8 @@ const invocation = {
|
|
|
1149
225
|
runId: null,
|
|
1150
226
|
unhandledErrors: []
|
|
1151
227
|
};
|
|
228
|
+
/** `reeval run --events`: the run's event stream, which ends with the command's exit code. */
|
|
229
|
+
let eventStream;
|
|
1152
230
|
/** Set by the first Ctrl-C or SIGTERM of `reeval run`. */
|
|
1153
231
|
let interrupted = false;
|
|
1154
232
|
/** The last signal that canceled the run: 130 after SIGINT, 143 after SIGTERM. */
|
|
@@ -1189,7 +267,7 @@ async function run(argv) {
|
|
|
1189
267
|
return values.help ? EXIT.ok : EXIT.usage;
|
|
1190
268
|
}
|
|
1191
269
|
if (command === "init") {
|
|
1192
|
-
const { initCommand } = await import("./init-
|
|
270
|
+
const { initCommand } = await import("./init-BiL6B3S4.js");
|
|
1193
271
|
return initCommand(values, filters, {
|
|
1194
272
|
out: (s) => console.log(s),
|
|
1195
273
|
input: process.stdin,
|
|
@@ -1198,7 +276,7 @@ async function run(argv) {
|
|
|
1198
276
|
});
|
|
1199
277
|
}
|
|
1200
278
|
if (command === "doctor") {
|
|
1201
|
-
const { doctorCommand } = await import("./doctor-
|
|
279
|
+
const { doctorCommand } = await import("./doctor-aE-RMbB_.js");
|
|
1202
280
|
return doctorCommand(values, {
|
|
1203
281
|
out: (s) => console.log(s),
|
|
1204
282
|
color: !!process.stdout.isTTY && !process.env.NO_COLOR,
|
|
@@ -1206,7 +284,7 @@ async function run(argv) {
|
|
|
1206
284
|
});
|
|
1207
285
|
}
|
|
1208
286
|
if (command === "report") {
|
|
1209
|
-
const { reportCommand } = await import("./command-
|
|
287
|
+
const { reportCommand } = await import("./command-CXxckfsq.js");
|
|
1210
288
|
return reportCommand(values, filters, {
|
|
1211
289
|
out: (s) => console.log(s),
|
|
1212
290
|
err: (s) => console.error(dim(s)),
|
|
@@ -1216,13 +294,15 @@ async function run(argv) {
|
|
|
1216
294
|
}
|
|
1217
295
|
const configPath = configPathFor(values.config);
|
|
1218
296
|
if (command === "image") {
|
|
1219
|
-
if (filters[0]
|
|
297
|
+
if (filters[0] === "list") return imageListCommand(values, configPath, filters.slice(1));
|
|
298
|
+
if (filters[0] === "clean") return imageCleanCommand(values, configPath);
|
|
299
|
+
if (filters[0] !== "build") throw new UsageError(`Unknown command "image ${filters[0] ?? ""}". Did you mean reeval image build, list or clean?`);
|
|
1220
300
|
return imageBuildCommand(values, configPath, filters.slice(1));
|
|
1221
301
|
}
|
|
1222
302
|
if (command === "studio") {
|
|
1223
303
|
const config = await historyConfig(configPath, "studio", values.profile);
|
|
1224
304
|
localStudio(config);
|
|
1225
|
-
const { studioCommand } = await import("./command-
|
|
305
|
+
const { studioCommand } = await import("./command-8GIHYGZf.js");
|
|
1226
306
|
return studioCommand({
|
|
1227
307
|
config,
|
|
1228
308
|
flags: values,
|
|
@@ -1233,7 +313,7 @@ async function run(argv) {
|
|
|
1233
313
|
if (command === "mcp") {
|
|
1234
314
|
if (!values.http) console.log = console.info = console.debug = console.error;
|
|
1235
315
|
const config = await historyConfig(configPath, "mcp", values.profile, values);
|
|
1236
|
-
const { mcpCommand } = await import("./command-
|
|
316
|
+
const { mcpCommand } = await import("./command-ao0NZ8h0.js");
|
|
1237
317
|
return mcpCommand({
|
|
1238
318
|
config,
|
|
1239
319
|
flags: values,
|
|
@@ -1242,7 +322,7 @@ async function run(argv) {
|
|
|
1242
322
|
}
|
|
1243
323
|
if (command in HISTORY_COMMANDS) {
|
|
1244
324
|
const config = await historyConfig(configPath, command, values.profile, values);
|
|
1245
|
-
const commands = await import("./commands-
|
|
325
|
+
const commands = await import("./commands-B3lnIPj5.js");
|
|
1246
326
|
const ctx = {
|
|
1247
327
|
config,
|
|
1248
328
|
flags: values,
|
|
@@ -1256,14 +336,14 @@ async function run(argv) {
|
|
|
1256
336
|
case "checkout": return commands.checkoutCommand(ctx, filters);
|
|
1257
337
|
case "sync": return commands.syncCommand(ctx, filters);
|
|
1258
338
|
case "query": {
|
|
1259
|
-
const { queryCommand } = await import("./query-
|
|
339
|
+
const { queryCommand } = await import("./query-C9OKU1Vz.js");
|
|
1260
340
|
return queryCommand({
|
|
1261
341
|
...ctx,
|
|
1262
342
|
err: (s) => console.error(dim(s))
|
|
1263
343
|
}, filters);
|
|
1264
344
|
}
|
|
1265
345
|
case "analyze": {
|
|
1266
|
-
const { analyzeCommand } = await import("./command-
|
|
346
|
+
const { analyzeCommand } = await import("./command-CAmnWLFL.js");
|
|
1267
347
|
return analyzeCommand({
|
|
1268
348
|
...ctx,
|
|
1269
349
|
err: (s) => console.error(dim(s))
|
|
@@ -1272,10 +352,53 @@ async function run(argv) {
|
|
|
1272
352
|
}
|
|
1273
353
|
}
|
|
1274
354
|
if (command === "clean") return cleanCommand(values, configPath);
|
|
355
|
+
if (command === "attach") return attachCommand(values, filters[0], configPath);
|
|
356
|
+
if (command === "bundle") {
|
|
357
|
+
const { bundleCommand } = await import("./bundle-DU2aQVeq.js");
|
|
358
|
+
return bundleCommand(values, filters, configPath, argv.slice(1), (s) => console.log(s));
|
|
359
|
+
}
|
|
1275
360
|
if (command !== "run") throw new UsageError(`Unknown command "${command}". Run reeval --help.`);
|
|
361
|
+
if (values.bundle !== void 0) return bundleRun(values, filters);
|
|
1276
362
|
return runCommand(values, configPath, filters);
|
|
1277
363
|
}
|
|
1278
364
|
/**
|
|
365
|
+
* `reeval run --bundle`: the bundle's own filters, profile, tags, traits and runs, from the
|
|
366
|
+
* project it extracts to. Other run flags (`--json`, `--record`, `--concurrency`, …) apply as given.
|
|
367
|
+
*/
|
|
368
|
+
async function bundleRun(flags, filters) {
|
|
369
|
+
const planning = [
|
|
370
|
+
"profile",
|
|
371
|
+
"tag",
|
|
372
|
+
"trait",
|
|
373
|
+
"runs",
|
|
374
|
+
"config",
|
|
375
|
+
"resume",
|
|
376
|
+
"retry-errors",
|
|
377
|
+
"hosted"
|
|
378
|
+
].filter((f) => flags[f] !== void 0).map((f) => `--${f}`);
|
|
379
|
+
if (filters.length || planning.length) throw new UsageError(`--bundle runs the bundle with the filters, profile, tags, traits and runs it was made with: leave out ${[...filters.length ? ["filters"] : [], ...planning].join(", ")}.`);
|
|
380
|
+
const file = flags.bundle;
|
|
381
|
+
const log = (s) => flags.json ? console.error(s) : console.log(s);
|
|
382
|
+
const { bundledGit, openBundle } = await import("./bundle-DU2aQVeq.js");
|
|
383
|
+
const opened = await openBundle(file, log);
|
|
384
|
+
if (opened.exit !== void 0) return opened.exit;
|
|
385
|
+
const { args, author } = opened.manifest;
|
|
386
|
+
log(`reeval: running ${file} in ${opened.project}, where its .reeval/ stays`);
|
|
387
|
+
process.chdir(opened.project);
|
|
388
|
+
return runCommand({
|
|
389
|
+
...flags,
|
|
390
|
+
bundle: void 0,
|
|
391
|
+
local: true,
|
|
392
|
+
...args.profile ? { profile: args.profile } : {},
|
|
393
|
+
tag: args.tags,
|
|
394
|
+
trait: args.traits,
|
|
395
|
+
...args.runs ? { runs: args.runs } : {}
|
|
396
|
+
}, opened.config, args.filters, {
|
|
397
|
+
git: bundledGit(opened.manifest),
|
|
398
|
+
...author ? { author } : {}
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
1279
402
|
* The config a command that reads the history runs on: the profile `--profile`, `REEVAL_PROFILE`
|
|
1280
403
|
* or `defaultProfile` picks sets which store it reads, as it does for `reeval run`. `.env` and
|
|
1281
404
|
* `.env.local` load first, as for `reeval run`: they can hold the store's keys and the profile.
|
|
@@ -1301,12 +424,12 @@ async function historyConfig(configPath, command, flag, values = {}) {
|
|
|
1301
424
|
}
|
|
1302
425
|
/** The dry run's prices, fetched only when a planned attempt or the judge has anything to price. */
|
|
1303
426
|
async function dryRunPrices(planned, judgeModel) {
|
|
1304
|
-
const { needsPrices } = await import("./cost-
|
|
427
|
+
const { needsPrices } = await import("./cost-CdRX1s2p.js");
|
|
1305
428
|
if (!needsPrices(planned.filter((p) => !p.attempt.plan.skip).map((p) => p.attempt.harness), judgeModel)) return {
|
|
1306
429
|
table: null,
|
|
1307
430
|
why: "nothing to price"
|
|
1308
431
|
};
|
|
1309
|
-
const { loadPrices } = await import("./prices-
|
|
432
|
+
const { loadPrices } = await import("./prices-C0gKS_8G.js");
|
|
1310
433
|
return loadPrices();
|
|
1311
434
|
}
|
|
1312
435
|
/** Asks a yes/no question on the terminal; anything but y or yes is no. */
|
|
@@ -1324,7 +447,8 @@ async function confirm(question) {
|
|
|
1324
447
|
}
|
|
1325
448
|
/**
|
|
1326
449
|
* `reeval clean`: removes local debug data and snapshots, all of them or all but the newest
|
|
1327
|
-
* `--keep` runs',
|
|
450
|
+
* `--keep` runs', with `--staging` every stopped run's staging, and with `--bundles` every copy
|
|
451
|
+
* `run --bundle` extracted whose process has ended.
|
|
1328
452
|
*/
|
|
1329
453
|
async function cleanCommand(flags, configPath) {
|
|
1330
454
|
const config = await loadConfig(configPath, "clean");
|
|
@@ -1333,7 +457,7 @@ async function cleanCommand(flags, configPath) {
|
|
|
1333
457
|
keep = Number(flags.keep);
|
|
1334
458
|
if (!(Number.isInteger(keep) && keep >= 0)) throw new UsageError(`--keep must be a whole number (got ${flags.keep})`);
|
|
1335
459
|
}
|
|
1336
|
-
const { debugRoot, pruneDebug } = await import("./files-
|
|
460
|
+
const { debugRoot, pruneDebug } = await import("./files-BFnkOAhn.js");
|
|
1337
461
|
const { formatBytes } = await import("./debug-CF4p4Lp_.js");
|
|
1338
462
|
const { runs, bytes } = await pruneDebug(config.root, keep);
|
|
1339
463
|
const where = fromCwd(debugRoot(config.root)) || ".";
|
|
@@ -1342,19 +466,26 @@ async function cleanCommand(flags, configPath) {
|
|
|
1342
466
|
const removed = await removeStoppedStaging(config.root);
|
|
1343
467
|
console.log(removed.length ? `Removed the staging of ${removed.length} stopped run${removed.length === 1 ? "" : "s"}: ${removed.join(", ")}` : "No stopped runs in .reeval/staging to remove");
|
|
1344
468
|
}
|
|
469
|
+
const streams = await pruneEvents(config.root, keep);
|
|
470
|
+
if (streams.length) console.log(`Removed the event streams of ${streams.length} finished run${streams.length === 1 ? "" : "s"} from .reeval/events`);
|
|
471
|
+
if (flags.bundles) {
|
|
472
|
+
const { removeExtractedBundles } = await import("./bundle-DU2aQVeq.js");
|
|
473
|
+
const removed = await removeExtractedBundles();
|
|
474
|
+
console.log(removed.length ? `Removed ${removed.length} extracted bundle${removed.length === 1 ? "" : "s"}: ${removed.join(", ")}` : "No extracted bundles to remove");
|
|
475
|
+
}
|
|
1345
476
|
if (flags.images) {
|
|
1346
|
-
const { dockerAvailable, pruneImages } = await import("./src-
|
|
1347
|
-
const { requireDocker } = await import("./providers-
|
|
477
|
+
const { dockerAvailable, pruneImages } = await import("./src-DEbNp-rx.js");
|
|
478
|
+
const { requireDocker } = await import("./providers-DxZ26YoG.js");
|
|
1348
479
|
const engines = [];
|
|
1349
480
|
for (const engine of ["docker", "podman"]) if (await dockerAvailable(engine)) engines.push(engine);
|
|
1350
|
-
const { tartCli } = await import("./tart-cli-
|
|
481
|
+
const { tartCli } = await import("./tart-cli-D88c5YYJ.js");
|
|
1351
482
|
const tart = await tartCli(["--version"]).then((r) => r.exitCode === 0, () => false);
|
|
1352
483
|
if (!engines.length && !tart) await requireDocker();
|
|
1353
484
|
let removed = 0;
|
|
1354
485
|
for (const engine of engines) removed += await pruneImages(engine);
|
|
1355
486
|
if (engines.length) console.log(removed ? `Removed ${removed} image${removed === 1 ? "" : "s"} reeval built that nothing uses` : "No leftover images to remove");
|
|
1356
487
|
if (tart) {
|
|
1357
|
-
const { deleteBakedImages } = await import("./tart-bake-
|
|
488
|
+
const { deleteBakedImages } = await import("./tart-bake-DVIoXWr_.js");
|
|
1358
489
|
const baked = await deleteBakedImages();
|
|
1359
490
|
console.log(baked.length ? `Deleted ${baked.length} Tart image${baked.length === 1 ? "" : "s"} with a harness baked in (reeval image build bakes them again): ${baked.join(", ")}` : "No Tart images with a harness baked in to delete");
|
|
1360
491
|
}
|
|
@@ -1373,25 +504,14 @@ function verbosityOf(flags) {
|
|
|
1373
504
|
* image.
|
|
1374
505
|
*/
|
|
1375
506
|
async function imageBuildCommand(flags, configPath, filters) {
|
|
1376
|
-
const { buildImages, imagePlanLines, imageTargets, plannedImageUses, pullTartImages, tartPlanLines, tartTargets } = await import("./images-
|
|
1377
|
-
const {
|
|
1378
|
-
|
|
1379
|
-
"dry-run": true
|
|
1380
|
-
}, configPath));
|
|
1381
|
-
const root = config.root;
|
|
1382
|
-
const uses = await plannedImageUses({
|
|
1383
|
-
runId,
|
|
1384
|
-
stagingDir,
|
|
1385
|
-
config,
|
|
1386
|
-
runs,
|
|
1387
|
-
tags,
|
|
1388
|
-
concurrency,
|
|
1389
|
-
profile
|
|
1390
|
-
}, filters, (parts) => unmatchedFilter(config, parts));
|
|
507
|
+
const { buildImages, imagePlanLines, imageTargets, plannedImageUses, pullTartImages, tartPlanLines, tartTargets } = await import("./images-DtXwj2wL.js");
|
|
508
|
+
const { buildVmImages, vmImageTargets, vmPlanLines } = await import("./vm-images-CNk-Zl2a.js");
|
|
509
|
+
const { setup, root, uses } = await imageUses(flags, configPath, filters, plannedImageUses);
|
|
1391
510
|
const targets = imageTargets(uses);
|
|
1392
511
|
const vms = tartTargets(uses);
|
|
1393
|
-
|
|
1394
|
-
|
|
512
|
+
const snapshots = vmImageTargets(uses);
|
|
513
|
+
if (targets.length === 0 && vms.length === 0 && snapshots.length === 0) {
|
|
514
|
+
console.log("No eval runs in a Docker or Tart sandbox, or a boat() or daytona() sandbox with an image recipe, so there are no images to build or pull.");
|
|
1395
515
|
return EXIT.ok;
|
|
1396
516
|
}
|
|
1397
517
|
const { tartTagWarning } = await import("./tart-ref-7Qv3cm3B.js");
|
|
@@ -1402,6 +522,7 @@ async function imageBuildCommand(flags, configPath, filters) {
|
|
|
1402
522
|
if (flags["dry-run"]) {
|
|
1403
523
|
if (vms.length) for (const line of await tartPlanLines(vms)) console.log(line);
|
|
1404
524
|
if (targets.length) for (const line of await imagePlanLines(targets, root)) console.log(line);
|
|
525
|
+
if (snapshots.length) for (const line of await vmPlanLines(snapshots, root)) console.log(line);
|
|
1405
526
|
return EXIT.ok;
|
|
1406
527
|
}
|
|
1407
528
|
const { PrepareError } = await import("./provider-DHT20Gl8.js");
|
|
@@ -1423,7 +544,7 @@ async function imageBuildCommand(flags, configPath, filters) {
|
|
|
1423
544
|
const pulled = vms.length ? await pullTartImages(vms, root, {
|
|
1424
545
|
log: (line) => console.log(line.startsWith("warning: ") ? yellow(line) : dim(line)),
|
|
1425
546
|
force: !!flags.force
|
|
1426
|
-
}).catch(refusal("tart", vms, targets.length)) : [];
|
|
547
|
+
}).catch(refusal("tart", vms, targets.length + snapshots.length)) : [];
|
|
1427
548
|
for (const p of pulled) outcomes.push(p.ok ? {
|
|
1428
549
|
id: p.id,
|
|
1429
550
|
evals: p.evals,
|
|
@@ -1439,8 +560,10 @@ async function imageBuildCommand(flags, configPath, filters) {
|
|
|
1439
560
|
if (targets.length) {
|
|
1440
561
|
const built = await buildImages(targets, root, {
|
|
1441
562
|
log: (line) => console.log(dim(line)),
|
|
1442
|
-
force: !!flags.force
|
|
1443
|
-
|
|
563
|
+
force: !!flags.force,
|
|
564
|
+
registry: setup.registry,
|
|
565
|
+
push: !!flags.push
|
|
566
|
+
}).catch(refusal("docker", targets, vms.length + snapshots.length));
|
|
1444
567
|
for (const b of built) outcomes.push(b.ok ? {
|
|
1445
568
|
id: b.id,
|
|
1446
569
|
evals: b.evals,
|
|
@@ -1454,11 +577,29 @@ async function imageBuildCommand(flags, configPath, filters) {
|
|
|
1454
577
|
failure: b.failure
|
|
1455
578
|
});
|
|
1456
579
|
}
|
|
580
|
+
if (snapshots.length) {
|
|
581
|
+
const built = await buildVmImages(snapshots, root, { log: (line) => console.log(dim(line)) }).catch(refusal("vm", snapshots.map((t) => ({ evals: t.ids.length })), targets.length + vms.length));
|
|
582
|
+
for (const b of built) {
|
|
583
|
+
const evals = b.ids.length;
|
|
584
|
+
outcomes.push(b.ok ? {
|
|
585
|
+
id: b.id,
|
|
586
|
+
evals,
|
|
587
|
+
ok: true,
|
|
588
|
+
ref: `snapshot ${b.name}`,
|
|
589
|
+
id12: b.cached ? "saved" : `built in ${formatDuration(b.ms)}`
|
|
590
|
+
} : {
|
|
591
|
+
id: b.id,
|
|
592
|
+
evals,
|
|
593
|
+
ok: false,
|
|
594
|
+
failure: b.failure
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
}
|
|
1457
598
|
} catch (error) {
|
|
1458
599
|
if (!(error instanceof PrepareError)) throw error;
|
|
1459
600
|
if (error.failure.usage) throw new UsageError(error.message);
|
|
1460
601
|
if (error.failure.cause === "enospc") invocation.machineState = true;
|
|
1461
|
-
const { PreflightInfraError } = await import("./preflight-
|
|
602
|
+
const { PreflightInfraError } = await import("./preflight-fyV5nnea.js");
|
|
1462
603
|
throw new PreflightInfraError(error.message);
|
|
1463
604
|
}
|
|
1464
605
|
for (const o of outcomes) {
|
|
@@ -1473,26 +614,293 @@ async function imageBuildCommand(flags, configPath, filters) {
|
|
|
1473
614
|
}
|
|
1474
615
|
const failed = outcomes.filter((o) => !o.ok);
|
|
1475
616
|
const n = outcomes.length;
|
|
1476
|
-
console.log(failed.length ? red(`${failed.length} of ${n} image${n === 1 ? "" : "s"} failed to ${vms.length ? targets.length ? "build or pull" : "pull" : "build"}`) : dim(`${n} image${n === 1 ? "" : "s"} ready`));
|
|
617
|
+
console.log(failed.length ? red(`${failed.length} of ${n} image${n === 1 ? "" : "s"} failed to ${vms.length ? targets.length || snapshots.length ? "build or pull" : "pull" : "build"}`) : dim(`${n} image${n === 1 ? "" : "s"} ready`));
|
|
1477
618
|
if (!failed.length) return EXIT.ok;
|
|
1478
619
|
if (refused || failed.every((o) => !o.ok && o.failure.usage)) return EXIT.usage;
|
|
1479
620
|
invocation.machineState = failed.every((o) => !o.ok && o.failure.cause === "enospc");
|
|
1480
621
|
return EXIT.infra;
|
|
1481
622
|
}
|
|
623
|
+
/** What `reeval image` plans for: the harness and sandbox of each attempt, collected as `--dry-run` does. */
|
|
624
|
+
async function imageUses(flags, configPath, filters, planned) {
|
|
625
|
+
const plannedImageUses = planned ?? (await import("./images-DtXwj2wL.js")).plannedImageUses;
|
|
626
|
+
const setup = await prepareRun({
|
|
627
|
+
...flags,
|
|
628
|
+
"dry-run": true
|
|
629
|
+
}, configPath);
|
|
630
|
+
const { runId, stagingDir, config, runs, tags, concurrency, profile } = await startRun(setup);
|
|
631
|
+
const uses = await plannedImageUses({
|
|
632
|
+
runId,
|
|
633
|
+
stagingDir,
|
|
634
|
+
config,
|
|
635
|
+
runs,
|
|
636
|
+
tags,
|
|
637
|
+
concurrency,
|
|
638
|
+
profile
|
|
639
|
+
}, filters, (parts) => unmatchedFilter(config, parts));
|
|
640
|
+
return {
|
|
641
|
+
setup,
|
|
642
|
+
root: config.root,
|
|
643
|
+
uses
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* `reeval image list`: the image snapshots under each `boat()` and `daytona()` account and prefix
|
|
648
|
+
* the evals use, with the environments that start from each.
|
|
649
|
+
*/
|
|
650
|
+
async function imageListCommand(flags, configPath, filters) {
|
|
651
|
+
const vm = await import("./vm-images-CNk-Zl2a.js");
|
|
652
|
+
const { formatSize } = await import("./tart-images-JfHirU8W.js");
|
|
653
|
+
const { root, uses } = await imageUses(flags, configPath, filters);
|
|
654
|
+
const accounts = vm.vmAccounts(uses);
|
|
655
|
+
if (!accounts.length) {
|
|
656
|
+
console.log("No eval runs in a boat() or daytona() sandbox, so there are no image snapshots to list.");
|
|
657
|
+
return EXIT.ok;
|
|
658
|
+
}
|
|
659
|
+
const [{ snapshots, failed }, { usedBy }] = await Promise.all([vm.listAccounts(accounts, root), vm.usedSnapshots(vm.vmImageTargets(uses), root)]);
|
|
660
|
+
const cache = vm.readVmImageCache();
|
|
661
|
+
const rows = snapshots.map((s) => ({
|
|
662
|
+
...s,
|
|
663
|
+
lastUsedAt: vm.lastUsed(s, cache),
|
|
664
|
+
usedBy: usedBy.get(s.name) ?? []
|
|
665
|
+
}));
|
|
666
|
+
if (flags.json) {
|
|
667
|
+
const iso = (t) => t === null ? null : new Date(t).toISOString();
|
|
668
|
+
console.log(JSON.stringify({
|
|
669
|
+
snapshots: rows.map((r) => ({
|
|
670
|
+
...r,
|
|
671
|
+
createdAt: iso(r.createdAt),
|
|
672
|
+
lastUsedAt: iso(r.lastUsedAt)
|
|
673
|
+
})),
|
|
674
|
+
failed: failed.map((f) => ({
|
|
675
|
+
provider: f.account.provider,
|
|
676
|
+
account: f.account.sandbox.apiKey.from,
|
|
677
|
+
prefix: f.account.sandbox.prefix,
|
|
678
|
+
error: f.error.message
|
|
679
|
+
}))
|
|
680
|
+
}, null, 2));
|
|
681
|
+
return failed.length ? EXIT.infra : EXIT.ok;
|
|
682
|
+
}
|
|
683
|
+
const table = rows.map((r) => [
|
|
684
|
+
r.provider,
|
|
685
|
+
r.name,
|
|
686
|
+
r.status,
|
|
687
|
+
r.sizeBytes === null ? "-" : formatSize(r.sizeBytes),
|
|
688
|
+
`saved ${vm.ago(r.createdAt)}`,
|
|
689
|
+
`used ${vm.ago(r.lastUsedAt)}`,
|
|
690
|
+
r.usedBy.length ? r.usedBy.join(", ") : dim("no environment")
|
|
691
|
+
]);
|
|
692
|
+
const widths = table[0]?.map((_, i) => Math.max(...table.map((row) => (row[i] ?? "").length))) ?? [];
|
|
693
|
+
for (const row of table) console.log(row.map((cell, i) => i === row.length - 1 ? cell : cell.padEnd(widths[i] ?? 0)).join(" "));
|
|
694
|
+
for (const f of failed) console.log(red(`✗ ${vm.accountLabel(f.account)}: ${f.error.message}`));
|
|
695
|
+
const n = rows.length;
|
|
696
|
+
console.log(dim(`${n} snapshot${n === 1 ? "" : "s"} under ${accounts.map(vm.accountLabel).join(", ")}`));
|
|
697
|
+
return failed.length ? EXIT.infra : EXIT.ok;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* `reeval image clean`: deletes the image snapshots no environment of the evals starts from, under
|
|
701
|
+
* each `boat()` and `daytona()` account and prefix they use, never one used in the
|
|
702
|
+
* last hour or one still being saved.
|
|
703
|
+
*/
|
|
704
|
+
async function imageCleanCommand(flags, configPath) {
|
|
705
|
+
const vm = await import("./vm-images-CNk-Zl2a.js");
|
|
706
|
+
const { formatSize } = await import("./tart-images-JfHirU8W.js");
|
|
707
|
+
const provider = flags.provider;
|
|
708
|
+
if (provider !== void 0 && provider !== "boat" && provider !== "daytona") throw new UsageError(`--provider is boat or daytona (got "${provider}")`);
|
|
709
|
+
const olderThanMs = flags["older-than"] !== void 0 ? vm.parseAge(flags["older-than"]) : flags.all ? void 0 : vm.DEFAULT_OLDER_THAN_MS;
|
|
710
|
+
const { root, uses } = await imageUses(flags, configPath, []);
|
|
711
|
+
const accounts = vm.vmAccounts(uses).filter((a) => !provider || a.provider === provider);
|
|
712
|
+
if (!accounts.length) {
|
|
713
|
+
console.log(`No eval runs in a ${provider ? `${provider}()` : "boat() or daytona()"} sandbox, so there are no image snapshots to clean.`);
|
|
714
|
+
return EXIT.ok;
|
|
715
|
+
}
|
|
716
|
+
const [{ snapshots, failed }, { usedBy, unknown }] = await Promise.all([vm.listAccounts(accounts, root), vm.usedSnapshots(vm.vmImageTargets(uses).filter((t) => !provider || t.provider === provider), root)]);
|
|
717
|
+
const refused = unknown.find((u) => u.error.failure?.usage);
|
|
718
|
+
if (refused) throw new UsageError(refused.error.message);
|
|
719
|
+
if (unknown.length && !flags.all) {
|
|
720
|
+
for (const u of unknown) console.log(red(`✗ couldn't tell which snapshot ${u.target.id} starts from: ${u.error.message.split("\n")[0]}`));
|
|
721
|
+
console.log(red("Nothing was deleted, so a snapshot in use isn't. Fix that, or pass --all."));
|
|
722
|
+
return EXIT.infra;
|
|
723
|
+
}
|
|
724
|
+
const choices = vm.cleanChoices(snapshots, {
|
|
725
|
+
cache: vm.readVmImageCache(),
|
|
726
|
+
usedBy,
|
|
727
|
+
now: Date.now(),
|
|
728
|
+
...olderThanMs !== void 0 && { olderThanMs },
|
|
729
|
+
all: !!flags.all
|
|
730
|
+
});
|
|
731
|
+
const doomed = choices.filter((c) => c.keep === null);
|
|
732
|
+
const byAccount = (s) => accounts.find((a) => a.provider === s.provider && a.sandbox.apiKey.from === s.account && a.sandbox.prefix === s.prefix);
|
|
733
|
+
let freed = 0;
|
|
734
|
+
let deleted = 0;
|
|
735
|
+
let failures = failed.length;
|
|
736
|
+
for (const c of choices) {
|
|
737
|
+
const size = c.snapshot.sizeBytes === null ? "" : ` (${formatSize(c.snapshot.sizeBytes)})`;
|
|
738
|
+
if (c.keep !== null) {
|
|
739
|
+
console.log(dim(` kept ${c.snapshot.provider} ${c.snapshot.name}: ${c.keep}`));
|
|
740
|
+
continue;
|
|
741
|
+
}
|
|
742
|
+
if (flags["dry-run"]) {
|
|
743
|
+
console.log(` would delete ${c.snapshot.provider} ${c.snapshot.name}${size}`);
|
|
744
|
+
continue;
|
|
745
|
+
}
|
|
746
|
+
try {
|
|
747
|
+
await vm.deleteVmSnapshot(byAccount(c.snapshot), c.snapshot, root);
|
|
748
|
+
deleted++;
|
|
749
|
+
freed += c.snapshot.sizeBytes ?? 0;
|
|
750
|
+
console.log(`${green("✓")} deleted ${c.snapshot.provider} ${c.snapshot.name}${size}`);
|
|
751
|
+
} catch (error) {
|
|
752
|
+
failures++;
|
|
753
|
+
console.log(red(`✗ ${c.snapshot.provider} ${c.snapshot.name}: ${error.message}`));
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
for (const f of failed) console.log(red(`✗ ${vm.accountLabel(f.account)}: ${f.error.message}`));
|
|
757
|
+
const n = doomed.length;
|
|
758
|
+
console.log(dim(flags["dry-run"] ? `${n} snapshot${n === 1 ? "" : "s"} to delete (nothing deleted: --dry-run)` : `Deleted ${deleted} snapshot${deleted === 1 ? "" : "s"}${freed ? ` (${formatSize(freed)})` : ""}`));
|
|
759
|
+
return failures ? EXIT.infra : EXIT.ok;
|
|
760
|
+
}
|
|
1482
761
|
/** The first 12 hex digits of an image id or digest. */
|
|
1483
762
|
const short12 = (id) => id.replace(/^sha256:/, "").slice(0, 12);
|
|
763
|
+
/**
|
|
764
|
+
* `reeval attach`: a run's socket URL or stream file as given, else the run a ref names (by default the one in
|
|
765
|
+
* progress) and the stream file it writes. Exits with the run's exit code.
|
|
766
|
+
*/
|
|
767
|
+
async function attachCommand(flags, target, configPath) {
|
|
768
|
+
let source;
|
|
769
|
+
let root = configPath === void 0 ? void 0 : dirname(configPath);
|
|
770
|
+
if (target && (isAttachUrl(target) || existsSync(target))) {
|
|
771
|
+
source = target;
|
|
772
|
+
const inEvents = isAttachUrl(target) ? null : /^(.*)[\\/]\.reeval[\\/]events[\\/][^\\/]+\.ndjson$/.exec(resolve(target));
|
|
773
|
+
if (inEvents?.[1]) root = inEvents[1];
|
|
774
|
+
} else {
|
|
775
|
+
root = dirname(requireConfig(configPath));
|
|
776
|
+
source = (await resolveAttach(root, target)).file;
|
|
777
|
+
}
|
|
778
|
+
const { hostedFollow } = await import("./hosted-run-202QicZ-.js");
|
|
779
|
+
const follow = isAttachUrl(source) ? hostedFollow(source) : void 0;
|
|
780
|
+
return attachHere(flags, {
|
|
781
|
+
source,
|
|
782
|
+
...root === void 0 ? {} : { root },
|
|
783
|
+
...follow ? { follow } : {}
|
|
784
|
+
});
|
|
785
|
+
}
|
|
786
|
+
/** `reeval attach`'s viewer on this terminal, drawn with the attach flags. */
|
|
787
|
+
async function attachHere(flags, options) {
|
|
788
|
+
const { attach } = await import("./attach-BH2HdwH_.js");
|
|
789
|
+
return attach({
|
|
790
|
+
...options,
|
|
791
|
+
out: process.stdout,
|
|
792
|
+
columns: process.stdout.columns,
|
|
793
|
+
colorDepth: process.stdout.isTTY ? process.stdout.getColorDepth() : void 0,
|
|
794
|
+
tty: {
|
|
795
|
+
stdout: process.stdout,
|
|
796
|
+
stdin: process.stdin
|
|
797
|
+
},
|
|
798
|
+
output: (verbosity) => resolveOutput({
|
|
799
|
+
flags: {
|
|
800
|
+
ui: flags.ui,
|
|
801
|
+
logOrder: flags["log-order"],
|
|
802
|
+
logPrefix: flags["log-prefix"],
|
|
803
|
+
outputLogs: flags["output-logs"],
|
|
804
|
+
verbose: verbosity > 0
|
|
805
|
+
},
|
|
806
|
+
env: process.env,
|
|
807
|
+
isTTY: !!process.stdout.isTTY,
|
|
808
|
+
agent: detectAgent().name,
|
|
809
|
+
stdinTTY: !!process.stdin.isTTY
|
|
810
|
+
})
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* Where a run that asked for the hosted platform goes, from the bundle made for it: there, or
|
|
815
|
+
* here with why. A real run there is created, uploaded, started and followed, and its exit code is
|
|
816
|
+
* `exit`. Undefined when the run didn't ask for hosted.
|
|
817
|
+
*/
|
|
818
|
+
async function hostedTarget(flags, setup, filters, configPath) {
|
|
819
|
+
const hosted = await import("./hosted-run-202QicZ-.js");
|
|
820
|
+
if (!hosted.wantsHosted(flags, setup.config, setup.profile)) return void 0;
|
|
821
|
+
const { makeBundle } = await import("./bundle-DU2aQVeq.js");
|
|
822
|
+
const picked = setup.profile ? { profile: setup.profile.name } : {};
|
|
823
|
+
const bundle = async (env) => {
|
|
824
|
+
try {
|
|
825
|
+
const made = await makeBundle({
|
|
826
|
+
...flags,
|
|
827
|
+
...picked
|
|
828
|
+
}, filters, configPath, process.argv.slice(2), {
|
|
829
|
+
env,
|
|
830
|
+
prices: true
|
|
831
|
+
});
|
|
832
|
+
if ("code" in made) return made;
|
|
833
|
+
const blocked = made.plan.notHosted ?? [];
|
|
834
|
+
return blocked.length ? { why: blocked.join("; ") } : { made };
|
|
835
|
+
} catch (error) {
|
|
836
|
+
if (!(error instanceof UsageError)) throw error;
|
|
837
|
+
return { why: error.message };
|
|
838
|
+
}
|
|
839
|
+
};
|
|
840
|
+
let result = await bundle({});
|
|
841
|
+
let base = null;
|
|
842
|
+
if ("made" in result) {
|
|
843
|
+
hosted.refuseLocalFlags(flags);
|
|
844
|
+
if (!setup.dryRun) {
|
|
845
|
+
base = hosted.hostedUrl();
|
|
846
|
+
const env = await hosted.hostedPlanEnv(base);
|
|
847
|
+
if (Object.entries(env).some(([k, v]) => process.env[k] !== v)) result = await bundle(env);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
if ("code" in result) return { exit: result.code };
|
|
851
|
+
if ("why" in result) {
|
|
852
|
+
const why = result.why.replace(/^[A-Z](?=[a-z])/, (c) => c.toLowerCase());
|
|
853
|
+
if (!setup.dryRun) {
|
|
854
|
+
console.log(dim(`Running here, not on hosted: ${why}`));
|
|
855
|
+
if (setup.recording) storeCredentials(setup.config.history);
|
|
856
|
+
}
|
|
857
|
+
return {
|
|
858
|
+
target: {
|
|
859
|
+
kind: "local",
|
|
860
|
+
why
|
|
861
|
+
},
|
|
862
|
+
detail: `target here, not hosted: ${why.split("\n")[0]}`
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
const { made } = result;
|
|
866
|
+
if (!base) {
|
|
867
|
+
const unset = process.env[hosted.HOSTED_URL_VAR]?.trim() ? "" : ` · ${hosted.HOSTED_URL_VAR} isn't set, so a run would exit 2`;
|
|
868
|
+
return {
|
|
869
|
+
target: { kind: "hosted" },
|
|
870
|
+
detail: `${await hosted.hostedLine(made.plan, "target hosted")}${unset}`
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
console.log(await hosted.hostedLine(made.plan));
|
|
874
|
+
if (setup.recording) console.log(dim("record: a hosted run isn't recorded into this machine's history"));
|
|
875
|
+
return { exit: await hosted.runHosted({
|
|
876
|
+
base,
|
|
877
|
+
bundle: made,
|
|
878
|
+
log: (line) => console.log(dim(line)),
|
|
879
|
+
follow: (options) => attachHere(flags, options)
|
|
880
|
+
}) };
|
|
881
|
+
}
|
|
1484
882
|
/** `reeval run`: check, plan, run the engine, then write the run and pick the exit code. */
|
|
1485
|
-
async function runCommand(flags, configPath, given) {
|
|
883
|
+
async function runCommand(flags, configPath, given, bundled) {
|
|
1486
884
|
const retry = flags["retry-errors"];
|
|
885
|
+
const url = flags["events-url"];
|
|
886
|
+
const parsed = url === void 0 ? null : URL.parse(url);
|
|
887
|
+
if (url !== void 0 && !(parsed && isEventsUrl(url))) throw new UsageError(`--events-url takes an http or https URL (got ${stripCredentials(url)})`);
|
|
888
|
+
if (url !== void 0 && (parsed?.username || parsed?.password)) throw new UsageError(`--events-url can't carry a user name or password (got ${stripCredentials(url)}): put a token in the path or query instead`);
|
|
889
|
+
const eventsFileFlag = flags["events-file"];
|
|
890
|
+
if (eventsFileFlag !== void 0) {
|
|
891
|
+
const refused = notEventStream(resolve(eventsFileFlag));
|
|
892
|
+
if (refused) throw new UsageError(`--events-file: ${refused}`);
|
|
893
|
+
}
|
|
1487
894
|
if (retry !== void 0 && flags.resume !== void 0) throw new UsageError("--resume and --retry-errors both continue a run: pass one of them.");
|
|
1488
895
|
if (retry !== void 0 && (given.length || flags.tag?.length || flags.trait?.length)) throw new UsageError("--retry-errors runs every infra-errored attempt of the run again, with its plan: leave out filters, --tag and --trait.");
|
|
1489
|
-
const
|
|
896
|
+
const continued = flags.resume !== void 0 || retry !== void 0;
|
|
897
|
+
const resumed = continued ? await resumedRun(flags, given, configPath) : null;
|
|
1490
898
|
if (resumed?.nothing) {
|
|
1491
899
|
const { nothing, record } = resumed.nothing;
|
|
1492
900
|
const outcome = runOutcome(record);
|
|
1493
901
|
if (flags.json) {
|
|
1494
902
|
console.error(nothing);
|
|
1495
|
-
const { suiteResult } = await import("./suite-
|
|
903
|
+
const { suiteResult } = await import("./suite-BwJGOhCZ.js");
|
|
1496
904
|
process.stdout.write(`${JSON.stringify({
|
|
1497
905
|
...suiteResult(record),
|
|
1498
906
|
outcome
|
|
@@ -1509,8 +917,10 @@ async function runCommand(flags, configPath, given) {
|
|
|
1509
917
|
noProfile: !!resumed?.saved && resumed.saved.profile === void 0,
|
|
1510
918
|
...resumed?.profileOf ? { profileOf: resumed.profileOf } : {}
|
|
1511
919
|
});
|
|
920
|
+
const hosted = bundled ? void 0 : await hostedTarget(runFlags, setup, filters, configPath);
|
|
921
|
+
if (hosted && "exit" in hosted) return hosted.exit;
|
|
1512
922
|
const explicit = runFlags.concurrency ?? (process.env.REEVAL_CONCURRENCY || void 0);
|
|
1513
|
-
const ctx = await startRun(setup);
|
|
923
|
+
const ctx = await startRun(setup, bundled);
|
|
1514
924
|
const startedWith = resumed ? resumed.saved ?? void 0 : {
|
|
1515
925
|
...setup.runs === void 0 ? {} : { runs: setup.runs },
|
|
1516
926
|
...setup.profile ? { profile: setup.profile.name } : {},
|
|
@@ -1524,26 +934,57 @@ async function runCommand(flags, configPath, given) {
|
|
|
1524
934
|
if (githubOut) await appendFile(githubOut, `run-id=${ctx.runId}\n`).catch(() => {});
|
|
1525
935
|
const stepStart = process.env.GITHUB_STEP_SUMMARY;
|
|
1526
936
|
if (stepStart) await appendFile(stepStart, `run ${ctx.runId}\n`).catch(() => {});
|
|
1527
|
-
const { engineVersions } = await import("./node-
|
|
937
|
+
const { engineVersions } = await import("./node-BQjSQw0d.js");
|
|
1528
938
|
const terminal = setup.json && !setup.dryRun ? process.stderr : process.stdout;
|
|
1529
|
-
const
|
|
939
|
+
const harness = setup.config.harness[0]?.kind ?? "agent";
|
|
940
|
+
const drawn = createRenderer({
|
|
1530
941
|
out: setup.json && setup.dryRun ? { write: () => true } : terminal,
|
|
1531
942
|
columns: terminal.columns,
|
|
1532
943
|
colorDepth: terminal.isTTY ? terminal.getColorDepth() : void 0,
|
|
1533
944
|
output: setup.output,
|
|
1534
945
|
verbosity: ctx.verbosity ?? 0,
|
|
1535
|
-
harness
|
|
946
|
+
harness,
|
|
1536
947
|
tty: {
|
|
1537
948
|
stdout: process.stdout,
|
|
1538
949
|
stdin: process.stdin
|
|
1539
950
|
}
|
|
1540
951
|
});
|
|
952
|
+
const root = setup.config.root;
|
|
953
|
+
const eventsTo = eventsFileFlag !== void 0 ? resolve(eventsFileFlag) : flags.events ? eventsFile(root, ctx.runId) : resumed?.saved?.events ? resolve(root, resumed.saved.events) : void 0;
|
|
954
|
+
const savedEvents = eventsTo ? relativeFile(root, eventsTo) : void 0;
|
|
955
|
+
if (startedWith && savedEvents) startedWith.events = savedEvents;
|
|
956
|
+
const eventsUrl = flags["events-url"];
|
|
957
|
+
if (eventsTo || eventsUrl) {
|
|
958
|
+
const cwd = cwdIn(root);
|
|
959
|
+
eventStream = openEventStream({
|
|
960
|
+
...eventsTo ? {
|
|
961
|
+
file: eventsTo,
|
|
962
|
+
append: continued
|
|
963
|
+
} : {},
|
|
964
|
+
...eventsUrl ? { url: eventsUrl } : {},
|
|
965
|
+
header: {
|
|
966
|
+
reeval: version,
|
|
967
|
+
runId: ctx.runId,
|
|
968
|
+
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
969
|
+
harness,
|
|
970
|
+
verbosity: ctx.verbosity ?? 0,
|
|
971
|
+
...cwd === void 0 ? {} : { cwd }
|
|
972
|
+
},
|
|
973
|
+
warn: (message) => process.stderr.write(yellow(`reeval: ${message}\n`))
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
const renderer = eventStream ? teeRenderer(drawn, eventStream) : drawn;
|
|
1541
977
|
let executed;
|
|
1542
978
|
try {
|
|
1543
979
|
executed = await executeRun(ctx, setup, filters, renderer, {
|
|
1544
980
|
startedWith,
|
|
1545
981
|
notes: resumed?.notes ?? [],
|
|
1546
|
-
narrowed: !!resumed && (given.length > 0 || !!flags.tag?.length || !!flags.trait?.length)
|
|
982
|
+
narrowed: !!resumed && (given.length > 0 || !!flags.tag?.length || !!flags.trait?.length),
|
|
983
|
+
...savedEvents ? { events: savedEvents } : {},
|
|
984
|
+
...hosted ? {
|
|
985
|
+
target: hosted.target,
|
|
986
|
+
targetDetail: hosted.detail
|
|
987
|
+
} : {}
|
|
1547
988
|
});
|
|
1548
989
|
} catch (error) {
|
|
1549
990
|
renderer.close();
|
|
@@ -1564,7 +1005,7 @@ async function runCommand(flags, configPath, given) {
|
|
|
1564
1005
|
return EXIT.ok;
|
|
1565
1006
|
}
|
|
1566
1007
|
if (ctx.retry && ctx.previous && retried.size) {
|
|
1567
|
-
const { retryEnvironmentChanges } = await import("./retry-
|
|
1008
|
+
const { retryEnvironmentChanges } = await import("./retry-CAhpW1hH.js");
|
|
1568
1009
|
const changes = retryEnvironmentChanges(ctx.previous, ctx.stagingDir, retried);
|
|
1569
1010
|
if (changes.length) {
|
|
1570
1011
|
questions?.cancel();
|
|
@@ -1583,8 +1024,8 @@ async function runCommand(flags, configPath, given) {
|
|
|
1583
1024
|
}
|
|
1584
1025
|
finishing = true;
|
|
1585
1026
|
live?.phase("finishing");
|
|
1586
|
-
const { lockfiles } = await import("./state-
|
|
1587
|
-
const { writeScratchRun } = await import("./results-
|
|
1027
|
+
const { lockfiles } = await import("./state-C5oBvmoZ.js");
|
|
1028
|
+
const { writeScratchRun } = await import("./results-BpxzyoMd.js");
|
|
1588
1029
|
const run = await writeScratchRun({
|
|
1589
1030
|
ctx,
|
|
1590
1031
|
author: ctx.author,
|
|
@@ -1618,7 +1059,7 @@ async function runCommand(flags, configPath, given) {
|
|
|
1618
1059
|
status: "complete"
|
|
1619
1060
|
}) : outcome;
|
|
1620
1061
|
let code = stopped ? stopCode : ran === "fail" ? EXIT.failed : ran === "infra_error" ? EXIT.infra : EXIT.ok;
|
|
1621
|
-
const { pruneDebug } = await import("./files-
|
|
1062
|
+
const { pruneDebug } = await import("./files-BFnkOAhn.js");
|
|
1622
1063
|
await pruneDebug(ctx.config.root, ctx.config.debug.keep).catch(() => {});
|
|
1623
1064
|
const summary = run.artifactDir ? join(run.artifactDir, "summary.md") : run.recordPath;
|
|
1624
1065
|
renderer.onEvent({
|
|
@@ -1632,7 +1073,7 @@ async function runCommand(flags, configPath, given) {
|
|
|
1632
1073
|
});
|
|
1633
1074
|
renderer.close();
|
|
1634
1075
|
if (retried.size) {
|
|
1635
|
-
const { retryCounts, retryLine } = await import("./retry-
|
|
1076
|
+
const { retryCounts, retryLine } = await import("./retry-CAhpW1hH.js");
|
|
1636
1077
|
const line = retryLine(retryCounts(record, retried, ctx.previous));
|
|
1637
1078
|
if (setup.json) console.error(line);
|
|
1638
1079
|
else console.log(line);
|
|
@@ -1641,11 +1082,11 @@ async function runCommand(flags, configPath, given) {
|
|
|
1641
1082
|
if (stepSummary && run.artifactDir) await appendFile(stepSummary, await readFile(summary)).catch(() => {});
|
|
1642
1083
|
const { config } = ctx;
|
|
1643
1084
|
const mode = setup.record;
|
|
1644
|
-
const { readRecord, recordFile } = await import("./files-
|
|
1085
|
+
const { readRecord, recordFile } = await import("./files-D6M7J3iX.js");
|
|
1645
1086
|
const rerecord = (setup.retry !== void 0 || setup.resume !== void 0) && record.status === "complete" && existsSync(recordFile(config.history.dir, record.runId));
|
|
1646
1087
|
const autoRecord = flags.record || mode === "always" || mode === "ci" && inCI() || rerecord;
|
|
1647
1088
|
if (autoRecord && record.status !== "interrupted") {
|
|
1648
|
-
const { record: recordCmd } = await import("./commands-
|
|
1089
|
+
const { record: recordCmd } = await import("./commands-B3lnIPj5.js");
|
|
1649
1090
|
const allow = record.status === "budget" ? { "allow-incomplete": true } : {};
|
|
1650
1091
|
const level = rerecord ? { artifacts: (await readRecord(recordFile(config.history.dir, record.runId))).artifacts } : {};
|
|
1651
1092
|
const line = await recordCmd(config, record.runId, {
|
|
@@ -1666,7 +1107,7 @@ async function runCommand(flags, configPath, given) {
|
|
|
1666
1107
|
else console.log(line);
|
|
1667
1108
|
}
|
|
1668
1109
|
if (setup.json) {
|
|
1669
|
-
const { suiteResult } = await import("./suite-
|
|
1110
|
+
const { suiteResult } = await import("./suite-BwJGOhCZ.js");
|
|
1670
1111
|
process.stdout.write(`${JSON.stringify({
|
|
1671
1112
|
...suiteResult(record),
|
|
1672
1113
|
outcome: ran
|
|
@@ -1746,13 +1187,21 @@ async function prepareRun(flags, configPath, { noProfile = false, profileOf } =
|
|
|
1746
1187
|
stdinTTY: !!process.stdin.isTTY && !flags.json && !flags["dry-run"]
|
|
1747
1188
|
});
|
|
1748
1189
|
const path = requireConfig(configPath);
|
|
1749
|
-
|
|
1190
|
+
const tracked = !!(flags["dry-run"] && flags.json) ? (await import("./inputs-load-M-BGe7gd.js")).trackLoad(dirname(path)) : void 0;
|
|
1191
|
+
let configInputs = [];
|
|
1192
|
+
let loaded;
|
|
1750
1193
|
const named = noProfile ? void 0 : flags.profile ?? (process.env.REEVAL_PROFILE || void 0);
|
|
1751
|
-
|
|
1194
|
+
try {
|
|
1195
|
+
loadEnvFiles(path);
|
|
1196
|
+
loaded = await loadConfig(path, "run", named);
|
|
1197
|
+
} finally {
|
|
1198
|
+
if (tracked) configInputs = tracked.stop(path, "config");
|
|
1199
|
+
}
|
|
1752
1200
|
if (profileOf && flags.profile && !loaded.profiles[flags.profile]) throw new UsageError(`run ${profileOf} was started with profile ${flags.profile}, which ${loaded.file} no longer defines. Put it back to resume the run, or start a new run without --resume.`);
|
|
1753
1201
|
const profile = noProfile ? null : selectProfile(loaded, flags.profile);
|
|
1754
1202
|
const config = withProfileHistory(loaded, profile);
|
|
1755
|
-
|
|
1203
|
+
const recording = flags.record || (profile?.record ?? config.record) === "always" || (profile?.record ?? config.record) === "ci" && inCI();
|
|
1204
|
+
if (recording && !flags["dry-run"] && !wantsHosted(flags, config, profile)) storeCredentials(config.history);
|
|
1756
1205
|
let runs;
|
|
1757
1206
|
if (flags.runs !== void 0) {
|
|
1758
1207
|
runs = Number(flags.runs);
|
|
@@ -1760,6 +1209,7 @@ async function prepareRun(flags, configPath, { noProfile = false, profileOf } =
|
|
|
1760
1209
|
}
|
|
1761
1210
|
const sandboxes = [...(config.environments.length ? config.environments : [void 0]).map((e) => environmentSandbox(e, config.sandbox)), ...profile ? [profileSandbox(config, profile.defaults)] : []];
|
|
1762
1211
|
const concurrency = givenConcurrency(config, flags.concurrency);
|
|
1212
|
+
const registry = await registryFlag(flags);
|
|
1763
1213
|
return {
|
|
1764
1214
|
output,
|
|
1765
1215
|
config,
|
|
@@ -1777,9 +1227,15 @@ async function prepareRun(flags, configPath, { noProfile = false, profileOf } =
|
|
|
1777
1227
|
sizeRun: async () => concurrency ?? defaultConcurrency(await sandboxCapacity(sandboxes) ?? hostCapacity()),
|
|
1778
1228
|
budget: profile?.budget ?? config.budget,
|
|
1779
1229
|
record: profile?.record ?? config.record,
|
|
1230
|
+
/** Whether the run is recorded into the history once it ends. */
|
|
1231
|
+
recording: !!recording,
|
|
1780
1232
|
dryRun: !!flags["dry-run"],
|
|
1781
1233
|
json: !!flags.json,
|
|
1234
|
+
/** What loading the config read, for `--dry-run --json`'s `inputs`. */
|
|
1235
|
+
configInputs,
|
|
1782
1236
|
force: !!flags.force,
|
|
1237
|
+
/** `--registry`: where a missing sandbox image is pulled from before it's built. */
|
|
1238
|
+
registry,
|
|
1783
1239
|
verbosity: verbosityOf(flags),
|
|
1784
1240
|
configFile: configLabel(path),
|
|
1785
1241
|
/** Named in the plan line when the project root isn't the current directory. */
|
|
@@ -1790,17 +1246,26 @@ async function prepareRun(flags, configPath, { noProfile = false, profileOf } =
|
|
|
1790
1246
|
retry: flags["retry-errors"]
|
|
1791
1247
|
};
|
|
1792
1248
|
}
|
|
1249
|
+
/** `--registry`, checked, or null; `--push` needs it. */
|
|
1250
|
+
async function registryFlag(flags) {
|
|
1251
|
+
if (flags.push && flags.registry === void 0) throw new UsageError("--push needs --registry, the registry to push to, e.g. --registry ghcr.io/acme/reeval");
|
|
1252
|
+
if (flags.registry === void 0) return null;
|
|
1253
|
+
const { registryProblem } = await import("./src-DEbNp-rx.js");
|
|
1254
|
+
const problem = registryProblem(flags.registry);
|
|
1255
|
+
if (problem) throw new UsageError(problem);
|
|
1256
|
+
return flags.registry.replace(/\/+$/, "");
|
|
1257
|
+
}
|
|
1793
1258
|
/** What a retry, or a resume that finishes one, does to the run's errors, for its refusals. */
|
|
1794
1259
|
const retryVerb = (retry, runId) => retry.resume ? `--resume finishes run ${runId}'s --retry-errors, which runs its errors again` : "--retry-errors runs its errors again";
|
|
1795
1260
|
/** The run's id and the state it starts from: commit, uncommitted changes, author. */
|
|
1796
|
-
async function startRun({ config, profile, runs, tags, traits, sandboxes, sizeRun, verbosity, configFile, resume, retry, dryRun }) {
|
|
1261
|
+
async function startRun({ config, profile, runs, tags, traits, sandboxes, sizeRun, verbosity, configFile, resume, retry, dryRun }, bundled) {
|
|
1797
1262
|
const startedAt = /* @__PURE__ */ new Date();
|
|
1798
|
-
const git = await gitInfo(config.root, [config.history.dir]);
|
|
1799
|
-
const { worktreePatch } = await import("./state-
|
|
1800
|
-
const patch = git?.dirty ? await worktreePatch(config.root, [config.history.dir]) : null;
|
|
1801
|
-
const who = await author(config.root);
|
|
1802
|
-
const { stagingDir } = await import("./results-
|
|
1803
|
-
const { scratchDir } = await import("./files-
|
|
1263
|
+
const git = bundled ? bundled.git : await gitInfo(config.root, [config.history.dir]);
|
|
1264
|
+
const { worktreePatch } = await import("./state-C5oBvmoZ.js");
|
|
1265
|
+
const patch = git?.dirty && !bundled ? await worktreePatch(config.root, [config.history.dir]) : null;
|
|
1266
|
+
const who = bundled?.author ?? await author(config.root);
|
|
1267
|
+
const { stagingDir } = await import("./results-BpxzyoMd.js");
|
|
1268
|
+
const { scratchDir } = await import("./files-D6M7J3iX.js");
|
|
1804
1269
|
const scratch = scratchDir(config.root);
|
|
1805
1270
|
if (resume !== void 0 || retry !== void 0) {
|
|
1806
1271
|
const target = await continuedRun(config.root, {
|
|
@@ -1817,8 +1282,8 @@ async function startRun({ config, profile, runs, tags, traits, sandboxes, sizeRu
|
|
|
1817
1282
|
} : await loadPrevious(stagingDir(config.root, target.runId));
|
|
1818
1283
|
if (!dryRun) {
|
|
1819
1284
|
await cleanupRun(target.runId).catch(() => {});
|
|
1820
|
-
const
|
|
1821
|
-
if (
|
|
1285
|
+
const scoped = sandboxes.filter((s) => sandboxKind(s).cleanupScope?.(s)?.atStart);
|
|
1286
|
+
if (scoped.length) await cleanupRun(target.runId, scoped).catch(() => {});
|
|
1822
1287
|
}
|
|
1823
1288
|
const concurrency = await sizeRun();
|
|
1824
1289
|
const { unfoldCases } = await import("./cases-FvhbM8M5.js");
|
|
@@ -1915,12 +1380,12 @@ function namesDeclaredSecret(evals) {
|
|
|
1915
1380
|
*/
|
|
1916
1381
|
async function planEfforts(planned) {
|
|
1917
1382
|
const live = planned.filter((p) => !p.attempt.plan.skip);
|
|
1918
|
-
const { effortNotes, withDefaultEffort } = await import("./default-effort-
|
|
1383
|
+
const { effortNotes, withDefaultEffort } = await import("./default-effort-CtNY9CGW.js");
|
|
1919
1384
|
let cursor;
|
|
1920
1385
|
let unchecked = "CURSOR_API_KEY isn't set";
|
|
1921
1386
|
const key = process.env.CURSOR_API_KEY;
|
|
1922
1387
|
if (key && live.some((p) => p.attempt.harness.kind === "cursor")) {
|
|
1923
|
-
const { checkCursorPlan } = await import("./cursor-catalog-
|
|
1388
|
+
const { checkCursorPlan } = await import("./cursor-catalog-CUQrabJ_.js");
|
|
1924
1389
|
const checked = await checkCursorPlan(key, live);
|
|
1925
1390
|
if (checked instanceof Error) unchecked = `its request failed: ${checked.message}`;
|
|
1926
1391
|
else {
|
|
@@ -1941,6 +1406,7 @@ async function planEfforts(planned) {
|
|
|
1941
1406
|
* or Docker problem (exit 2). Then runs the engine with live output and Ctrl-C handling.
|
|
1942
1407
|
*/
|
|
1943
1408
|
async function executeRun(ctx, setup, filters, renderer, started) {
|
|
1409
|
+
const { events } = started;
|
|
1944
1410
|
const { runId, stagingDir, config, runs, tags, traits, concurrency, profile, verbosity } = ctx;
|
|
1945
1411
|
const { configFile } = ctx;
|
|
1946
1412
|
const run = JSON.parse(JSON.stringify({
|
|
@@ -1954,10 +1420,11 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
1954
1420
|
profile,
|
|
1955
1421
|
verbosity,
|
|
1956
1422
|
configFile,
|
|
1957
|
-
completed: []
|
|
1423
|
+
completed: [],
|
|
1424
|
+
...setup.dryRun && setup.json ? { inputs: true } : {}
|
|
1958
1425
|
}));
|
|
1959
|
-
const { runEngine } = await import("./node-
|
|
1960
|
-
const { buildPlan, checkAttemptBudget, planDocument, planLine, planTable, runHeader } = await import("./plan-
|
|
1426
|
+
const { runEngine } = await import("./node-BQjSQw0d.js");
|
|
1427
|
+
const { buildPlan, checkAttemptBudget, planDocument, planInputs, planLine, planTable, runHeader } = await import("./plan-DgIVIrXJ.js");
|
|
1961
1428
|
let plan;
|
|
1962
1429
|
let sandboxVersions = { images: [] };
|
|
1963
1430
|
let preflightStop;
|
|
@@ -2002,9 +1469,9 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2002
1469
|
if (ctx.retry && ctx.previous) {
|
|
2003
1470
|
const ranOn = ctx.previous.stack?.reeval;
|
|
2004
1471
|
if (ranOn && ranOn !== version) throw new UsageError(`run ${runId} ran on reeval ${ranOn}, and this is ${version}. ${retryVerb(ctx.retry, runId)} only on the reeval they ran on: install reeval ${ranOn}, or start a new run with reeval run.`);
|
|
2005
|
-
const { retryChanges } = await import("./retry-
|
|
2006
|
-
const { judgePart } = await import("./assemble-
|
|
2007
|
-
const { engineVersions } = await import("./node-
|
|
1472
|
+
const { retryChanges } = await import("./retry-CAhpW1hH.js");
|
|
1473
|
+
const { judgePart } = await import("./assemble-XrZskSNj.js");
|
|
1474
|
+
const { engineVersions } = await import("./node-BQjSQw0d.js");
|
|
2008
1475
|
const judged = judgePart(config, profile, version, engineVersions);
|
|
2009
1476
|
const runs = new Set(planned.map((p) => p.key).filter((key) => !completed.has(key)));
|
|
2010
1477
|
const changes = await retryChanges(ctx.previous, planned, runs, config.root, judged);
|
|
@@ -2017,7 +1484,7 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2017
1484
|
}
|
|
2018
1485
|
}
|
|
2019
1486
|
retried = continuing && !setup.dryRun ? noteRetries(planned, stagingDir, ctx.previous, true).errored : errored;
|
|
2020
|
-
const models = skipped.some((p) => !p.attempt.plan.skip && p.attempt.plan.questions?.length) ? await import("./model-
|
|
1487
|
+
const models = skipped.some((p) => !p.attempt.plan.skip && p.attempt.plan.questions?.length) ? await import("./model-lLaUxxno.js") : void 0;
|
|
2021
1488
|
const judge = runJudgeModel(config, profile);
|
|
2022
1489
|
const judgeModel = judge === void 0 ? null : judgeModelName(judge);
|
|
2023
1490
|
plan = await buildPlan({
|
|
@@ -2037,7 +1504,7 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2037
1504
|
const direct = cloud ? [...new Set(skipped.filter((p) => !p.attempt.plan.skip && capabilitiesOf(p.attempt.sandbox).isolated).filter((p) => isDirect(p.attempt.egress.policy) || isDirect(setupEgress(p.attempt.egress).policy)).map((p) => p.id))] : [];
|
|
2038
1505
|
if (cloud && direct.length) plan.warnings.push(`${directOnCloud(cloud)}. Under it: ${direct.join(", ")}. Keep 'allow-all' to the evals that need raw TCP or UDP; the default, 'proxy', sends everything through the gateway`);
|
|
2039
1506
|
const switching = concurrency > 1 ? [...new Set(skipped.filter(({ attempt }) => !attempt.plan.skip && !!attempt.egress.setup && attempt.sandbox.kind === "docker" && attempt.sandbox.engine === "podman").map((p) => p.id))] : [];
|
|
2040
|
-
const { podmanRootless } = await import("./providers-
|
|
1507
|
+
const { podmanRootless } = await import("./providers-DxZ26YoG.js");
|
|
2041
1508
|
if (switching.length && await podmanRootless()) plan.warnings.push(rootlessPodmanSwitch(switching));
|
|
2042
1509
|
plan.warnings.push(...started.notes);
|
|
2043
1510
|
if (started.narrowed) {
|
|
@@ -2053,7 +1520,7 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2053
1520
|
run.completed = [...completed];
|
|
2054
1521
|
const done = leftOut.filter((l) => l.done).map((l) => l.key);
|
|
2055
1522
|
kept = keptAttempts([...completed, ...done], stagingDir, ctx.previous);
|
|
2056
|
-
const { imageStages, imageTargets } = await import("./images-
|
|
1523
|
+
const { imageStages, imageTargets } = await import("./images-DtXwj2wL.js");
|
|
2057
1524
|
const targets = imageTargets(skipped.filter((p) => !p.attempt.plan.skip).map((p) => ({
|
|
2058
1525
|
id: p.attempt.family?.id ?? p.id,
|
|
2059
1526
|
harness: p.attempt.harness,
|
|
@@ -2067,18 +1534,39 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2067
1534
|
evals: t.evals,
|
|
2068
1535
|
stages: await imageStages(t, config.root)
|
|
2069
1536
|
})));
|
|
2070
|
-
const
|
|
1537
|
+
const { lockfiles } = await import("./state-C5oBvmoZ.js");
|
|
1538
|
+
const locks = (await lockfiles(config.root)).map(({ path }) => ({
|
|
1539
|
+
path: join(config.root, path),
|
|
1540
|
+
kind: "lockfile"
|
|
1541
|
+
}));
|
|
1542
|
+
const inputs = planInputs(config.root, [...setup.configInputs, ...locks], skipped);
|
|
1543
|
+
const running = skipped.filter((p) => !p.attempt.plan.skip);
|
|
1544
|
+
const secrets = new Set(running.flatMap((p) => p.attempt.secretVars));
|
|
1545
|
+
const needed = neededCredentials(config, {
|
|
1546
|
+
harnesses: plan.harnessDescriptors,
|
|
1547
|
+
sandboxes: plan.sandboxes,
|
|
1548
|
+
profile,
|
|
1549
|
+
judges: running.flatMap((p) => p.attempt.judge ? [p.attempt.judge] : [])
|
|
1550
|
+
});
|
|
1551
|
+
for (const { names } of needed) for (const name of names) secrets.add(name);
|
|
1552
|
+
const { notHosted } = await import("./hosted-run-202QicZ-.js");
|
|
1553
|
+
const blocked = notHosted(skipped);
|
|
1554
|
+
const doc = {
|
|
1555
|
+
...planDocument(plan, skipped, excluded, images, inputs, [...secrets].sort()),
|
|
1556
|
+
...blocked.length ? { notHosted: blocked } : {},
|
|
1557
|
+
...started.target ? { target: started.target } : {}
|
|
1558
|
+
};
|
|
2071
1559
|
process.stdout.write(`${JSON.stringify(doc, null, 2)}\n`);
|
|
2072
1560
|
return false;
|
|
2073
1561
|
}
|
|
2074
1562
|
const elsewhere = setup.configElsewhere ? configFile : void 0;
|
|
2075
|
-
const { scratchDir } = await import("./files-
|
|
1563
|
+
const { scratchDir } = await import("./files-D6M7J3iX.js");
|
|
2076
1564
|
const lines = [];
|
|
2077
1565
|
if (setup.dryRun) {
|
|
2078
1566
|
const todos = excluded.filter((e) => e.mode === "todo").map((e) => e.id);
|
|
2079
1567
|
lines.push(...planTable(plan, todos));
|
|
2080
|
-
const { imageStatusLines } = await import("./images-
|
|
2081
|
-
const { dockerAvailable, engineSpec } = await import("./src-
|
|
1568
|
+
const { imageStatusLines } = await import("./images-DtXwj2wL.js");
|
|
1569
|
+
const { dockerAvailable, engineSpec } = await import("./src-DEbNp-rx.js");
|
|
2082
1570
|
const engines = [...new Set(targets.map((t) => t.sandbox.engine ?? "docker"))];
|
|
2083
1571
|
const down = [];
|
|
2084
1572
|
for (const engine of engines) if (!await dockerAvailable(engine)) down.push(engine);
|
|
@@ -2087,9 +1575,10 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2087
1575
|
const names = down.map((e) => engineSpec(e).name).join(" and ");
|
|
2088
1576
|
lines.push(`images not checked: ${names} ${down.length === 1 ? "is" : "are"} not running`);
|
|
2089
1577
|
}
|
|
2090
|
-
const { costLine } = await import("./cost-
|
|
1578
|
+
const { costLine } = await import("./cost-CdRX1s2p.js");
|
|
2091
1579
|
const cost = plan.cost && costLine(plan.cost);
|
|
2092
1580
|
if (cost) lines.push(cost);
|
|
1581
|
+
if (started.targetDetail) lines.push(started.targetDetail);
|
|
2093
1582
|
}
|
|
2094
1583
|
renderer.onEvent({
|
|
2095
1584
|
type: "plan",
|
|
@@ -2114,8 +1603,8 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2114
1603
|
const away = /* @__PURE__ */ new Map();
|
|
2115
1604
|
for (const { attempt } of planned) {
|
|
2116
1605
|
const { sandbox } = attempt;
|
|
2117
|
-
|
|
2118
|
-
if (
|
|
1606
|
+
const scope = sandboxKind(sandbox).cleanupScope?.(sandbox);
|
|
1607
|
+
if (scope) away.set(`${sandbox.kind}\0${scope.key}`, sandbox);
|
|
2119
1608
|
}
|
|
2120
1609
|
if (away.size) await cleanupRun(runId, [...away.values()]).catch(() => {});
|
|
2121
1610
|
}
|
|
@@ -2171,7 +1660,7 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2171
1660
|
});
|
|
2172
1661
|
if (malformed.length) throw new UsageError(`Credentials with whitespace or a line break in them: ${malformed.join(", ")}. A key copied from a wrapped terminal line picks these up; set it again as one line.`);
|
|
2173
1662
|
if (asked.length) {
|
|
2174
|
-
const { questionRunner } = await import("./questions-
|
|
1663
|
+
const { questionRunner } = await import("./questions-boVPzGoC.js");
|
|
2175
1664
|
const warned = /* @__PURE__ */ new Set();
|
|
2176
1665
|
questions = questionRunner({
|
|
2177
1666
|
evals: asked,
|
|
@@ -2213,7 +1702,7 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2213
1702
|
}
|
|
2214
1703
|
});
|
|
2215
1704
|
}
|
|
2216
|
-
const { prepareWorkspaces, sameTreeArms, workspaceKey } = await import("./workspace-
|
|
1705
|
+
const { prepareWorkspaces, sameTreeArms, workspaceKey } = await import("./workspace-CRgFdmgW.js");
|
|
2217
1706
|
const live = skipped.filter((p) => !p.attempt.plan.skip);
|
|
2218
1707
|
const outcomes = await prepareWorkspaces(live.flatMap(({ attempt: a }) => a.workspace ? [{
|
|
2219
1708
|
workspace: a.workspace,
|
|
@@ -2278,7 +1767,8 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2278
1767
|
type: "prepare",
|
|
2279
1768
|
at: Date.now(),
|
|
2280
1769
|
...e
|
|
2281
|
-
})
|
|
1770
|
+
}),
|
|
1771
|
+
...setup.registry ? { registry: setup.registry } : {}
|
|
2282
1772
|
});
|
|
2283
1773
|
} catch (error) {
|
|
2284
1774
|
if (error.name !== "PreflightInfraError") throw error;
|
|
@@ -2305,11 +1795,17 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2305
1795
|
};
|
|
2306
1796
|
let engineRun;
|
|
2307
1797
|
let cutShort = false;
|
|
1798
|
+
const { MACHINES, MachineService } = await import("./machine-service-Byl0BlcT.js");
|
|
1799
|
+
const machines = new MachineService();
|
|
2308
1800
|
try {
|
|
2309
1801
|
engineRun = await runEngine({
|
|
2310
1802
|
run,
|
|
2311
1803
|
filters,
|
|
2312
1804
|
onPlan,
|
|
1805
|
+
services: {
|
|
1806
|
+
call: (owner, service, body) => service === MACHINES ? machines.call(owner, body) : Promise.reject(/* @__PURE__ */ new Error(`This run has no ${service} service`)),
|
|
1807
|
+
released: (owner) => machines.released(owner)
|
|
1808
|
+
},
|
|
2313
1809
|
onRunStart: (files) => {
|
|
2314
1810
|
writeCurrent(setup.config.root, runId);
|
|
2315
1811
|
live = writeLiveProgress({
|
|
@@ -2319,7 +1815,8 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2319
1815
|
planned: toRun,
|
|
2320
1816
|
kept,
|
|
2321
1817
|
leftOut,
|
|
2322
|
-
...started.startedWith ? { invocation: started.startedWith } : {}
|
|
1818
|
+
...started.startedWith ? { invocation: started.startedWith } : {},
|
|
1819
|
+
...events ? { events } : {}
|
|
2323
1820
|
});
|
|
2324
1821
|
renderer.onEvent({
|
|
2325
1822
|
type: "run-start",
|
|
@@ -2346,7 +1843,15 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2346
1843
|
},
|
|
2347
1844
|
onCancelable: (cancel) => {
|
|
2348
1845
|
let first;
|
|
2349
|
-
const onSignal = (signal) => {
|
|
1846
|
+
const onSignal = (signal, attach) => {
|
|
1847
|
+
if (first?.attach && !attach && Date.now() - first.at < SAME_PRESS_MS) {
|
|
1848
|
+
stopCode = signal === "SIGTERM" ? EXIT.terminated : EXIT.interrupted;
|
|
1849
|
+
first = {
|
|
1850
|
+
signal,
|
|
1851
|
+
at: Date.now()
|
|
1852
|
+
};
|
|
1853
|
+
return;
|
|
1854
|
+
}
|
|
2350
1855
|
if (first && !first.passedOn && signal !== first.signal && Date.now() - first.at < SAME_PRESS_MS) {
|
|
2351
1856
|
if (signal === "SIGINT") stopCode = EXIT.interrupted;
|
|
2352
1857
|
if (!finishing) renderer.onEvent({
|
|
@@ -2368,7 +1873,8 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2368
1873
|
interrupted = true;
|
|
2369
1874
|
first = {
|
|
2370
1875
|
signal,
|
|
2371
|
-
at: Date.now()
|
|
1876
|
+
at: Date.now(),
|
|
1877
|
+
...attach ? { attach } : {}
|
|
2372
1878
|
};
|
|
2373
1879
|
if (finishing) return;
|
|
2374
1880
|
questions?.cancel();
|
|
@@ -2381,8 +1887,11 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2381
1887
|
});
|
|
2382
1888
|
cancel();
|
|
2383
1889
|
};
|
|
2384
|
-
process.on("SIGINT", onSignal);
|
|
2385
|
-
process.on("SIGTERM", onSignal);
|
|
1890
|
+
process.on("SIGINT", () => onSignal("SIGINT", false));
|
|
1891
|
+
process.on("SIGTERM", () => onSignal("SIGTERM", false));
|
|
1892
|
+
if (process.platform !== "win32") process.on(CANCEL_SIGNAL, () => {
|
|
1893
|
+
if (!interrupted && !finishing) onSignal("SIGINT", true);
|
|
1894
|
+
});
|
|
2386
1895
|
}
|
|
2387
1896
|
});
|
|
2388
1897
|
cutShort = interrupted;
|
|
@@ -2391,9 +1900,10 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2391
1900
|
throw error;
|
|
2392
1901
|
} finally {
|
|
2393
1902
|
clearTimeout(budgetTimer);
|
|
2394
|
-
|
|
1903
|
+
await machines.close();
|
|
1904
|
+
const { removePrepared } = await import("./preflight-dJqs5x3r.js");
|
|
2395
1905
|
removePrepared(config.root, runId);
|
|
2396
|
-
const { removePreparedWorkspaces } = await import("./workspace-
|
|
1906
|
+
const { removePreparedWorkspaces } = await import("./workspace-CRgFdmgW.js");
|
|
2397
1907
|
removePreparedWorkspaces(config.root, runId);
|
|
2398
1908
|
}
|
|
2399
1909
|
if (preflightStop) throw preflightStop;
|
|
@@ -2421,6 +1931,7 @@ process.stdout.on("error", (error) => {
|
|
|
2421
1931
|
* error or an infra error), prints one line suggesting `reeval report`. Not for agents or JSON.
|
|
2422
1932
|
*/
|
|
2423
1933
|
function finish(code, error, kind) {
|
|
1934
|
+
eventStream?.end(code);
|
|
2424
1935
|
const flags = invocation.flags;
|
|
2425
1936
|
let root = process.cwd();
|
|
2426
1937
|
try {
|
|
@@ -2480,4 +1991,4 @@ run(process.argv.slice(2)).finally(() => {
|
|
|
2480
1991
|
});
|
|
2481
1992
|
export {};
|
|
2482
1993
|
|
|
2483
|
-
//# sourceMappingURL=cli-
|
|
1994
|
+
//# sourceMappingURL=cli-DMHOwdVr.js.map
|