reeval 0.21.0 → 0.22.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 +38 -0
- package/README.md +15 -15
- package/dist/{adapter-BdzhdRYo.js → adapter-Di9H2etg.js} +5 -48
- package/dist/adapter-Di9H2etg.js.map +1 -0
- package/dist/{agent-Dx-bDmlV.js → agent-B-6GFDqA.js} +11 -12
- package/dist/agent-B-6GFDqA.js.map +1 -0
- package/dist/{agents-l0-k7vw3.js → agents-KBTYhSSh.js} +45 -36
- package/dist/agents-KBTYhSSh.js.map +1 -0
- package/dist/{app-files-B-CQYB0c.js → app-files-Cmh9FGr5.js} +3 -3
- package/dist/app-files-Cmh9FGr5.js.map +1 -0
- package/dist/{assemble-CYMpN8LC.js → assemble-CBMRIhso.js} +1 -1
- package/dist/{assemble-CsZIcJo8.js → assemble-DNVBTBp_.js} +11 -10
- package/dist/{assemble-CsZIcJo8.js.map → assemble-DNVBTBp_.js.map} +1 -1
- package/dist/attach-EbDGKGTO.js +152 -0
- package/dist/attach-EbDGKGTO.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-DQvynDHk.js} +6 -6
- package/dist/{attempt-host-BwSmNYkX.js.map → attempt-host-DQvynDHk.js.map} +1 -1
- package/dist/boat-Bzz8L-KQ.js +701 -0
- package/dist/boat-Bzz8L-KQ.js.map +1 -0
- package/dist/{boat-CZpAreTB.js → boat-Dek8ftIt.js} +18 -6
- package/dist/boat-Dek8ftIt.js.map +1 -0
- package/dist/bundle-DZstHDeW.js +718 -0
- package/dist/bundle-DZstHDeW.js.map +1 -0
- package/dist/{capture-BqIAeFyC.js → capture-BkbPsfej.js} +17 -14
- package/dist/capture-BkbPsfej.js.map +1 -0
- package/dist/capture-CUAvk9KM.js +1 -0
- package/dist/{cli-s_3opn_I.js → cli-BgBBuxxJ.js} +276 -1018
- package/dist/cli-BgBBuxxJ.js.map +1 -0
- package/dist/{cli-spec-DxzIjmq_.js → cli-spec-B5L9n-DV.js} +93 -12
- package/dist/cli-spec-B5L9n-DV.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/{client-C5fIzHQa.js → client-DMEYR3MA.js} +8 -4
- package/dist/client-DMEYR3MA.js.map +1 -0
- package/dist/{command-BJ7KqczP.js → command-BKb8eN_X.js} +8 -8
- package/dist/{command-BJ7KqczP.js.map → command-BKb8eN_X.js.map} +1 -1
- package/dist/{command-B5OAIjp7.js → command-D_w_kDpI.js} +13 -13
- package/dist/{command-B5OAIjp7.js.map → command-D_w_kDpI.js.map} +1 -1
- package/dist/{command-DA_SHQUQ.js → command-Dwlh0Vhu.js} +15 -14
- package/dist/command-Dwlh0Vhu.js.map +1 -0
- package/dist/{command-BXLZsEwQ.js → command-loXH2jHr.js} +11 -11
- package/dist/{command-BXLZsEwQ.js.map → command-loXH2jHr.js.map} +1 -1
- package/dist/{commands-BKBamOcX.js → commands-Cuf57OYb.js} +13 -13
- package/dist/{commands-BKBamOcX.js.map → commands-Cuf57OYb.js.map} +1 -1
- package/dist/{commands-BPvAOEmb.js → commands-Dqli45sR.js} +1 -1
- package/dist/{config-C0URar0t.js → config-C0RKt00M.js} +46 -30
- package/dist/config-C0RKt00M.js.map +1 -0
- package/dist/{context-Sj58aJEu.js → context-DrEAtUyg.js} +2 -2
- package/dist/{context-Sj58aJEu.js.map → context-DrEAtUyg.js.map} +1 -1
- package/dist/{cursor-catalog-FWgSo-T1.js → cursor-catalog-CRsFxorF.js} +2 -2
- package/dist/{cursor-catalog-FWgSo-T1.js.map → cursor-catalog-CRsFxorF.js.map} +1 -1
- package/dist/db-3o8s2EyD.js +2 -0
- package/dist/{db-BjAWxVAG.js → db-ErnJ-gMD.js} +34 -8
- package/dist/{db-BjAWxVAG.js.map → db-ErnJ-gMD.js.map} +1 -1
- package/dist/{default-effort-Ck2GYIxX.js → default-effort-D70cTG00.js} +2 -2
- package/dist/{default-effort-Ck2GYIxX.js.map → default-effort-D70cTG00.js.map} +1 -1
- package/dist/{default-effort-CWlhZ6U1.js → default-effort-DHzj84dD.js} +1 -1
- package/dist/{docker-D74l67k8.js → docker-CFWzZOEk.js} +4 -4
- package/dist/{docker-D74l67k8.js.map → docker-CFWzZOEk.js.map} +1 -1
- package/dist/docker-DrMnpL84.js +1 -0
- package/dist/{doctor-eFxyn6at.js → doctor-B7utCSdh.js} +56 -74
- package/dist/doctor-B7utCSdh.js.map +1 -0
- package/dist/{environment-CJIKz-Ud.js → environment-C0Gg8kyN.js} +5 -5
- package/dist/{environment-CJIKz-Ud.js.map → environment-C0Gg8kyN.js.map} +1 -1
- package/dist/{eval-source-CXIRJ91v.js → eval-source-CsW5VIXS.js} +5 -5
- package/dist/{eval-source-CXIRJ91v.js.map → eval-source-CsW5VIXS.js.map} +1 -1
- package/dist/{evaluate-DA4QsrHO.js → evaluate-BHQyAszQ.js} +238 -212
- package/dist/evaluate-BHQyAszQ.js.map +1 -0
- package/dist/{evaluate-DHrU4Wld.d.ts → evaluate-DzHq4EsU.d.ts} +2 -2
- package/dist/{fake-bootstrap-CnwWG3kP.js → fake-bootstrap-VpisF1WE.js} +2 -2
- package/dist/{fake-bootstrap-CnwWG3kP.js.map → fake-bootstrap-VpisF1WE.js.map} +1 -1
- package/dist/{files-Bey1VAex.js → files-BCraBodb.js} +3 -3
- package/dist/{files-Bey1VAex.js.map → files-BCraBodb.js.map} +1 -1
- package/dist/{files-BVVWAS0A.js → files-BuKWZCzY.js} +5 -5
- package/dist/{files-BVVWAS0A.js.map → files-BuKWZCzY.js.map} +1 -1
- package/dist/{files-BaqXvB88.js → files-CAzVG3Rr.js} +1 -1
- package/dist/{files-D6j-XpaK.js → files-Cv856jLN.js} +3 -3
- package/dist/{files-D6j-XpaK.js.map → files-Cv856jLN.js.map} +1 -1
- package/dist/files-D-Lir4aE.js +1 -0
- package/dist/files-DRlJ0Xr2.js +1 -0
- package/dist/{files-F44NRCN0.js → files-qjeqXnfE.js} +6 -6
- package/dist/{files-F44NRCN0.js.map → files-qjeqXnfE.js.map} +1 -1
- package/dist/gateway.d.ts +1 -1
- package/dist/{git-Jqkf9SBa.js → git-DOrOtAiD.js} +3 -3
- package/dist/{git-Jqkf9SBa.js.map → git-DOrOtAiD.js.map} +1 -1
- package/dist/harness-install-Dxho1yaU.js +53 -0
- package/dist/harness-install-Dxho1yaU.js.map +1 -0
- package/dist/harness.d.ts +1 -1
- package/dist/{images-Dsc4Wi-F.js → images-Ch1y1t6_.js} +69 -55
- package/dist/images-Ch1y1t6_.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/{init-QB5ecPDA.js → init-C2HqCwnt.js} +5 -5
- package/dist/{init-QB5ecPDA.js.map → init-C2HqCwnt.js.map} +1 -1
- package/dist/init-CM9xwyre.js +1 -0
- package/dist/{ink-list-mCJypk3d.js → ink-list-BbKXElcQ.js} +54 -15
- package/dist/ink-list-BbKXElcQ.js.map +1 -0
- package/dist/inputs-5UIDpjz-.js +190 -0
- package/dist/inputs-5UIDpjz-.js.map +1 -0
- package/dist/inputs-load-C82HOKnb.js +1 -0
- package/dist/inputs-load-CGPyigMC.js +95 -0
- package/dist/inputs-load-CGPyigMC.js.map +1 -0
- package/dist/{invocations-BSr4lRzI.js → invocations-BrZAMuTb.js} +4 -4
- package/dist/{invocations-BSr4lRzI.js.map → invocations-BrZAMuTb.js.map} +1 -1
- package/dist/jiti-radm1Soi.js +52 -0
- package/dist/jiti-radm1Soi.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/{layout-DfQa4mJs.js → layout-Czh5wOpz.js} +2 -2
- package/dist/{layout-DfQa4mJs.js.map → layout-Czh5wOpz.js.map} +1 -1
- package/dist/{list-Dh6T0kdr.js → list-B_C0k5ex.js} +14 -11
- package/dist/{list-Dh6T0kdr.js.map → list-B_C0k5ex.js.map} +1 -1
- package/dist/live-C9Et_BVT.js +1 -0
- package/dist/{live-xTZs0c61.js → live-DGgIrVw0.js} +7 -5
- package/dist/live-DGgIrVw0.js.map +1 -0
- package/dist/{live-y1p3oNXH.js → live-DgFm0H90.js} +7 -7
- package/dist/{live-y1p3oNXH.js.map → live-DgFm0H90.js.map} +1 -1
- package/dist/machine-service-2lIv5UWF.js +1 -0
- package/dist/machine-service-Ct_1XMMi.js +520 -0
- package/dist/machine-service-Ct_1XMMi.js.map +1 -0
- package/dist/machines-BnquHcBZ.js +120 -0
- package/dist/machines-BnquHcBZ.js.map +1 -0
- package/dist/{model-DEjwetkJ.js → model-B1tdv9-d.js} +1 -1
- package/dist/model-Bcy4Qjmm.js +1 -0
- package/dist/{model-DNpKiHqO.js → model-DF77SgZv.js} +2 -2
- package/dist/{model-DNpKiHqO.js.map → model-DF77SgZv.js.map} +1 -1
- package/dist/{model-3pZZzloU.js → model-DRa7yv6K.js} +6 -5
- package/dist/model-DRa7yv6K.js.map +1 -0
- package/dist/{model-jRKSQBg6.js → model-E5X8YBJM.js} +6 -5
- package/dist/model-E5X8YBJM.js.map +1 -0
- package/dist/{node-DM-mLGdX.js → node-BjuhqQwa.js} +16 -5
- package/dist/node-BjuhqQwa.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-C989kuVE.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-BR8rdl7r.js} +2 -2
- package/dist/{patch-Bx-qp8Li.js.map → patch-BR8rdl7r.js.map} +1 -1
- package/dist/{plan-ChO0A-xn.js → plan-BcT4G5jj.js} +47 -9
- package/dist/plan-BcT4G5jj.js.map +1 -0
- package/dist/{plugins-BioMWncI.js → plugins-cC0sqoDA.js} +91 -122
- package/dist/plugins-cC0sqoDA.js.map +1 -0
- package/dist/preflight-BMVDBcux.js +1 -0
- package/dist/{preflight-qFCXmxha.js → preflight-C9OtTb7k.js} +3 -3
- package/dist/{preflight-qFCXmxha.js.map → preflight-C9OtTb7k.js.map} +1 -1
- package/dist/{preflight-CJSGzMzc.js → preflight-DySHXeFJ.js} +8 -8
- package/dist/preflight-DySHXeFJ.js.map +1 -0
- package/dist/{preflight-BUjk_6wT.js → preflight-zsAn3heN.js} +1 -1
- package/dist/{prepare-xHU2BpN-.js → prepare-MaRWRhNT.js} +2 -2
- package/dist/{prepare-D7oSSFNm.js → prepare-nbX1CXXg.js} +195 -54
- package/dist/prepare-nbX1CXXg.js.map +1 -0
- package/dist/{provenance-B-flBAzR.js → provenance-CkykifD9.js} +3 -3
- package/dist/{provenance-B-flBAzR.js.map → provenance-CkykifD9.js.map} +1 -1
- package/dist/{providers-Dljf6al6.js → providers-BkLGzaSY.js} +1 -1
- package/dist/{providers-B6StVyfG.js → providers-bNgfKa6m.js} +31 -23
- package/dist/providers-bNgfKa6m.js.map +1 -0
- package/dist/query-B2SQddoV.js +1 -0
- package/dist/{query-CkLmJv7R.js → query-DhV3a8lM.js} +2 -2
- package/dist/{query-CkLmJv7R.js.map → query-DhV3a8lM.js.map} +1 -1
- package/dist/{questions-CJIh2FSX.js → questions-Csv64WCb.js} +6 -6
- package/dist/{questions-CJIh2FSX.js.map → questions-Csv64WCb.js.map} +1 -1
- package/dist/{record-nVVujCW7.js → record--vHreTLk.js} +10 -4
- package/dist/record--vHreTLk.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-CYFOsnz5.js} +6 -6
- package/dist/{remarks-B3wjKscW.js.map → remarks-CYFOsnz5.js.map} +1 -1
- package/dist/{remote-C88amFRN.js → remote-0CHog7Oq.js} +5 -5
- package/dist/{remote-C88amFRN.js.map → remote-0CHog7Oq.js.map} +1 -1
- package/dist/resolve-Bm9ZyFR-.js +1 -0
- package/dist/{resolve-G576PiFJ.js → resolve-DorSHDBs.js} +7 -7
- package/dist/{resolve-G576PiFJ.js.map → resolve-DorSHDBs.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-DhMgRkR0.js} +5 -5
- package/dist/{results-zVHIW6xw.js.map → results-DhMgRkR0.js.map} +1 -1
- package/dist/{resume-D_PcUXfG.js → resume-C8Ihfy-C.js} +77 -6
- package/dist/resume-C8Ihfy-C.js.map +1 -0
- package/dist/{retry-BvTzCxdc.js → retry-Bfk7pDti.js} +3 -3
- package/dist/{retry-BvTzCxdc.js.map → retry-Bfk7pDti.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-CPUH0Vk5.js} +44 -3
- package/dist/runtime-CPUH0Vk5.js.map +1 -0
- package/dist/sandbox/boat.d.ts +1 -1
- package/dist/sandbox/boat.js +1 -1
- package/dist/{sandbox-Duh3z1TV.js → sandbox-z8q_4Ywn.js} +2 -2
- package/dist/{sandbox-Duh3z1TV.js.map → sandbox-z8q_4Ywn.js.map} +1 -1
- package/dist/sandbox.d.ts +1 -1
- package/dist/sandbox.js +1 -1
- package/dist/{server-DUWMRKik.js → server-BsQZtuF9.js} +8 -8
- package/dist/{server-DUWMRKik.js.map → server-BsQZtuF9.js.map} +1 -1
- package/dist/server-ZaMzUNmV.js +1 -0
- package/dist/services-BG8xuU82.js +39 -0
- package/dist/services-BG8xuU82.js.map +1 -0
- package/dist/{source-CHuN4Nfg.js → source-9HWaTEgV.js} +2 -2
- package/dist/{source-CHuN4Nfg.js.map → source-9HWaTEgV.js.map} +1 -1
- package/dist/source-BcBDj-R0.js +1 -0
- package/dist/{src-CZaYu6ER.js → src-B2eHTCnp.js} +1 -1
- 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-CkEiiyON.js → src-BfOlH_Bu.js} +2 -2
- package/dist/{src-CeBhwD8k.js → src-BuGc40IF.js} +1 -1
- package/dist/{src-De0KY5S_.js → src-C2K5_afU.js} +2 -2
- 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-DA95rM6v.js → src-CSVJjghq.js} +1 -1
- package/dist/{src-BHJ4MWvY.js → src-CWfy8ct8.js} +1114 -411
- package/dist/src-CWfy8ct8.js.map +1 -0
- package/dist/{src--yl1OypK.js → src-CcrQQB0_.js} +2 -2
- package/dist/src-CotUxxQV.js +2 -0
- package/dist/src-D-PwBaBB.js +2 -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-CmA5Yev6.js → src-DwcTn4JY.js} +2 -2
- package/dist/{src-CmA5Yev6.js.map → src-DwcTn4JY.js.map} +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-jYqNkT-F.js +1 -0
- package/dist/start-Db5VRcRZ.js +660 -0
- package/dist/start-Db5VRcRZ.js.map +1 -0
- package/dist/state-CKIjZZRK.js +1 -0
- package/dist/{state-DUBRDyMk.js → state-DUYdzNA7.js} +14 -14
- package/dist/{state-DUBRDyMk.js.map → state-DUYdzNA7.js.map} +1 -1
- package/dist/store/local.d.ts +1 -1
- package/dist/store/s3.d.ts +1 -1
- package/dist/suite-CH1aaAbs.js +2 -0
- package/dist/{suite-B9J6Afg6.js → suite-DjGxmDSY.js} +2 -2
- package/dist/{suite-B9J6Afg6.js.map → suite-DjGxmDSY.js.map} +1 -1
- package/dist/{summary-CSp4cfnr.js → summary-BK5Sa_N0.js} +8 -5
- package/dist/summary-BK5Sa_N0.js.map +1 -0
- package/dist/{sync-CxAY6Dki.js → sync-DUi_P2UJ.js} +2 -2
- package/dist/{sync-CxAY6Dki.js.map → sync-DUi_P2UJ.js.map} +1 -1
- package/dist/{tarball-CESxtK4X.js → tarball-C8BSTAMk.js} +2 -2
- package/dist/{tarball-CESxtK4X.js.map → tarball-C8BSTAMk.js.map} +1 -1
- package/dist/{tart-CcrrtSrp.js → tart-BQ_Ap0l4.js} +99 -295
- package/dist/tart-BQ_Ap0l4.js.map +1 -0
- package/dist/{tart-bake-F-6seRC9.js → tart-bake-D1RttYfM.js} +18 -62
- package/dist/tart-bake-D1RttYfM.js.map +1 -0
- package/dist/{tart-bake-RK7RaT9E.js → tart-bake-DjFcsG3N.js} +1 -1
- package/dist/{tart-cli-ClvRniLQ.js → tart-cli-BOcluha1.js} +1 -1
- package/dist/{tart-cli-B86Jqo1t.js → tart-cli-gA9xEaQL.js} +2 -2
- package/dist/{tart-cli-B86Jqo1t.js.map → tart-cli-gA9xEaQL.js.map} +1 -1
- package/dist/{tart-hosts-DPyZsg-1.js → tart-hosts-CHNrfV6u.js} +3 -3
- package/dist/{tart-hosts-DPyZsg-1.js.map → tart-hosts-CHNrfV6u.js.map} +1 -1
- package/dist/{tart-hosts-Brii7zHM.js → tart-hosts-CWse-ASo.js} +1 -1
- package/dist/{tart-images-CWSf03w8.js → tart-images-CLBjfF9u.js} +2 -2
- package/dist/{tart-images-CWSf03w8.js.map → tart-images-CLBjfF9u.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-krsmEo44.js} +2 -2
- package/dist/{tool-class-CVDdJy0H.js.map → tool-class-krsmEo44.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-CbcnJxCy.js.map +1 -1
- package/dist/{types-BJ0wh8wC.d.ts → types-DKK8jj--.d.ts} +110 -2
- package/dist/ui-DKYjTVpn.js +1455 -0
- package/dist/ui-DKYjTVpn.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-DRxXCyIH.js → views-B1zVLJsF.js} +6 -6
- package/dist/{views-DRxXCyIH.js.map → views-B1zVLJsF.js.map} +1 -1
- package/dist/views-DCjtw1jF.js +2 -0
- package/dist/{worker-entry-C3Q4U63F.js → worker-entry-DrAYYt0M.js} +31 -11
- package/dist/worker-entry-DrAYYt0M.js.map +1 -0
- package/dist/workspace-CnRbV8cM.js +1 -0
- package/dist/{workspace-P72SXLXr.js → workspace-DwTe1zo6.js} +5 -5
- package/dist/{workspace-P72SXLXr.js.map → workspace-DwTe1zo6.js.map} +1 -1
- package/docker/Dockerfile +1 -1
- package/package.json +4 -1
- package/skills/reeval/references/environments.md +2 -2
- 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.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/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/evaluate-DA4QsrHO.js.map +0 -1
- package/dist/files-CNHhSyb3.js +0 -1
- package/dist/files-CW1lChNh.js +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-CJSGzMzc.js.map +0 -1
- package/dist/preflight-DD3fI4Hz.js +0 -1
- package/dist/prepare-D7oSSFNm.js.map +0 -1
- package/dist/providers-B6StVyfG.js.map +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/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,34 @@
|
|
|
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, i as fromCwd } from "./ids-B-JKTCP8.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { a as newRunId, c as relativeFile, i as fromCwd } from "./ids-B-JKTCP8.js";
|
|
5
|
+
import { S as stripCredentials, g as redactSecrets, x as registerSecret } from "./redact-t-L3VGy8.js";
|
|
6
|
+
import { H as sandboxCapacity, I as capabilitiesOf, L as cleanupRun, W as sandboxKind } from "./plugins-cC0sqoDA.js";
|
|
7
|
+
import { 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-C0Gg8kyN.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-C0RKt00M.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
13
|
import { r as localStudio } from "./resolve-Bul8lHaa.js";
|
|
14
|
-
import { r as openRouterFallbacks } from "./openrouter-models-
|
|
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-DF77SgZv.js";
|
|
17
|
+
import { c as helpText, i as INSTEAD, n as FLAGS, o as commandHelpText, r as GLOBAL, t as COMMANDS } from "./cli-spec-B5L9n-DV.js";
|
|
18
|
+
import { t as colors } from "./colors-DcXBvAlU.js";
|
|
19
|
+
import { d as storeCredentials, i as isRemote, u as pullStore } from "./sync-DUi_P2UJ.js";
|
|
20
|
+
import { i as runtimeInfo, n as gitInfo, r as runnerInfo, t as author } from "./provenance-CkykifD9.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-C8Ihfy-C.js";
|
|
22
|
+
import { c as isEventsUrl, d as teeRenderer, l as notEventStream, s as isAttachUrl, t as createRenderer, u as openEventStream } from "./ui-DKYjTVpn.js";
|
|
23
|
+
import { n as preflight } from "./preflight-DySHXeFJ.js";
|
|
22
24
|
import { t as budgetMarker } from "./budget-BcxLYY5L.js";
|
|
23
|
-
import {
|
|
24
|
-
import { n as preflight } from "./preflight-CJSGzMzc.js";
|
|
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";
|
|
25
|
+
import { a as redactArgv, r as commandOf, t as logInvocation } from "./invocations-BrZAMuTb.js";
|
|
27
26
|
import { existsSync, mkdirSync, readdirSync, writeFileSync } from "node:fs";
|
|
28
|
-
import { dirname, join } from "node:path";
|
|
27
|
+
import { dirname, join, resolve } from "node:path";
|
|
29
28
|
import { appendFile, readFile, rm } from "node:fs/promises";
|
|
30
29
|
import { inspect } from "node:util";
|
|
31
30
|
import { detectAgent } from "std-env";
|
|
32
31
|
import { Command, Option } from "commander";
|
|
33
|
-
import stringWidth from "string-width";
|
|
34
32
|
// src/cli-parse.ts
|
|
35
33
|
const OPTIONS = Object.fromEntries(Object.entries(FLAGS).map(([name, spec]) => {
|
|
36
34
|
const short = "short" in spec ? `-${spec.short}, ` : "";
|
|
@@ -172,936 +170,6 @@ function usageError(error, command) {
|
|
|
172
170
|
}
|
|
173
171
|
return new UsageError(first.charAt(0).toUpperCase() + first.slice(1));
|
|
174
172
|
}
|
|
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
173
|
// src/cli.ts
|
|
1106
174
|
const HISTORY_COMMANDS = {
|
|
1107
175
|
record: 1,
|
|
@@ -1127,10 +195,15 @@ const EXPECTED_ERRORS = [
|
|
|
1127
195
|
"CommandError",
|
|
1128
196
|
"RefError",
|
|
1129
197
|
"HistoryError",
|
|
1130
|
-
"StudioBuildError"
|
|
198
|
+
"StudioBuildError",
|
|
199
|
+
"NewerSchemaError"
|
|
1131
200
|
];
|
|
1132
201
|
/** Errors that exit 3: reeval couldn't reach what the run needs, not a mistake in the command. */
|
|
1133
|
-
const INFRA_ERRORS = [
|
|
202
|
+
const INFRA_ERRORS = [
|
|
203
|
+
"PreflightInfraError",
|
|
204
|
+
"StoreError",
|
|
205
|
+
"EventStreamError"
|
|
206
|
+
];
|
|
1134
207
|
const EXIT = {
|
|
1135
208
|
ok: 0,
|
|
1136
209
|
failed: 1,
|
|
@@ -1149,6 +222,8 @@ const invocation = {
|
|
|
1149
222
|
runId: null,
|
|
1150
223
|
unhandledErrors: []
|
|
1151
224
|
};
|
|
225
|
+
/** `reeval run --events`: the run's event stream, which ends with the command's exit code. */
|
|
226
|
+
let eventStream;
|
|
1152
227
|
/** Set by the first Ctrl-C or SIGTERM of `reeval run`. */
|
|
1153
228
|
let interrupted = false;
|
|
1154
229
|
/** The last signal that canceled the run: 130 after SIGINT, 143 after SIGTERM. */
|
|
@@ -1189,7 +264,7 @@ async function run(argv) {
|
|
|
1189
264
|
return values.help ? EXIT.ok : EXIT.usage;
|
|
1190
265
|
}
|
|
1191
266
|
if (command === "init") {
|
|
1192
|
-
const { initCommand } = await import("./init-
|
|
267
|
+
const { initCommand } = await import("./init-CM9xwyre.js");
|
|
1193
268
|
return initCommand(values, filters, {
|
|
1194
269
|
out: (s) => console.log(s),
|
|
1195
270
|
input: process.stdin,
|
|
@@ -1198,7 +273,7 @@ async function run(argv) {
|
|
|
1198
273
|
});
|
|
1199
274
|
}
|
|
1200
275
|
if (command === "doctor") {
|
|
1201
|
-
const { doctorCommand } = await import("./doctor-
|
|
276
|
+
const { doctorCommand } = await import("./doctor-B7utCSdh.js");
|
|
1202
277
|
return doctorCommand(values, {
|
|
1203
278
|
out: (s) => console.log(s),
|
|
1204
279
|
color: !!process.stdout.isTTY && !process.env.NO_COLOR,
|
|
@@ -1206,7 +281,7 @@ async function run(argv) {
|
|
|
1206
281
|
});
|
|
1207
282
|
}
|
|
1208
283
|
if (command === "report") {
|
|
1209
|
-
const { reportCommand } = await import("./command-
|
|
284
|
+
const { reportCommand } = await import("./command-loXH2jHr.js");
|
|
1210
285
|
return reportCommand(values, filters, {
|
|
1211
286
|
out: (s) => console.log(s),
|
|
1212
287
|
err: (s) => console.error(dim(s)),
|
|
@@ -1222,7 +297,7 @@ async function run(argv) {
|
|
|
1222
297
|
if (command === "studio") {
|
|
1223
298
|
const config = await historyConfig(configPath, "studio", values.profile);
|
|
1224
299
|
localStudio(config);
|
|
1225
|
-
const { studioCommand } = await import("./command-
|
|
300
|
+
const { studioCommand } = await import("./command-BKb8eN_X.js");
|
|
1226
301
|
return studioCommand({
|
|
1227
302
|
config,
|
|
1228
303
|
flags: values,
|
|
@@ -1233,7 +308,7 @@ async function run(argv) {
|
|
|
1233
308
|
if (command === "mcp") {
|
|
1234
309
|
if (!values.http) console.log = console.info = console.debug = console.error;
|
|
1235
310
|
const config = await historyConfig(configPath, "mcp", values.profile, values);
|
|
1236
|
-
const { mcpCommand } = await import("./command-
|
|
311
|
+
const { mcpCommand } = await import("./command-Dwlh0Vhu.js");
|
|
1237
312
|
return mcpCommand({
|
|
1238
313
|
config,
|
|
1239
314
|
flags: values,
|
|
@@ -1242,7 +317,7 @@ async function run(argv) {
|
|
|
1242
317
|
}
|
|
1243
318
|
if (command in HISTORY_COMMANDS) {
|
|
1244
319
|
const config = await historyConfig(configPath, command, values.profile, values);
|
|
1245
|
-
const commands = await import("./commands-
|
|
320
|
+
const commands = await import("./commands-Dqli45sR.js");
|
|
1246
321
|
const ctx = {
|
|
1247
322
|
config,
|
|
1248
323
|
flags: values,
|
|
@@ -1256,14 +331,14 @@ async function run(argv) {
|
|
|
1256
331
|
case "checkout": return commands.checkoutCommand(ctx, filters);
|
|
1257
332
|
case "sync": return commands.syncCommand(ctx, filters);
|
|
1258
333
|
case "query": {
|
|
1259
|
-
const { queryCommand } = await import("./query-
|
|
334
|
+
const { queryCommand } = await import("./query-B2SQddoV.js");
|
|
1260
335
|
return queryCommand({
|
|
1261
336
|
...ctx,
|
|
1262
337
|
err: (s) => console.error(dim(s))
|
|
1263
338
|
}, filters);
|
|
1264
339
|
}
|
|
1265
340
|
case "analyze": {
|
|
1266
|
-
const { analyzeCommand } = await import("./command-
|
|
341
|
+
const { analyzeCommand } = await import("./command-D_w_kDpI.js");
|
|
1267
342
|
return analyzeCommand({
|
|
1268
343
|
...ctx,
|
|
1269
344
|
err: (s) => console.error(dim(s))
|
|
@@ -1272,10 +347,48 @@ async function run(argv) {
|
|
|
1272
347
|
}
|
|
1273
348
|
}
|
|
1274
349
|
if (command === "clean") return cleanCommand(values, configPath);
|
|
350
|
+
if (command === "attach") return attachCommand(values, filters[0], configPath);
|
|
351
|
+
if (command === "bundle") {
|
|
352
|
+
const { bundleCommand } = await import("./bundle-DZstHDeW.js");
|
|
353
|
+
return bundleCommand(values, filters, configPath, argv.slice(1), (s) => console.log(s));
|
|
354
|
+
}
|
|
1275
355
|
if (command !== "run") throw new UsageError(`Unknown command "${command}". Run reeval --help.`);
|
|
356
|
+
if (values.bundle !== void 0) return bundleRun(values, filters);
|
|
1276
357
|
return runCommand(values, configPath, filters);
|
|
1277
358
|
}
|
|
1278
359
|
/**
|
|
360
|
+
* `reeval run --bundle`: the bundle's own filters, profile, tags, traits and runs, from the
|
|
361
|
+
* project it extracts to. Other run flags (`--json`, `--record`, `--concurrency`, …) apply as given.
|
|
362
|
+
*/
|
|
363
|
+
async function bundleRun(flags, filters) {
|
|
364
|
+
const planning = [
|
|
365
|
+
"profile",
|
|
366
|
+
"tag",
|
|
367
|
+
"trait",
|
|
368
|
+
"runs",
|
|
369
|
+
"config",
|
|
370
|
+
"resume",
|
|
371
|
+
"retry-errors"
|
|
372
|
+
].filter((f) => flags[f] !== void 0).map((f) => `--${f}`);
|
|
373
|
+
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(", ")}.`);
|
|
374
|
+
const file = flags.bundle;
|
|
375
|
+
const log = (s) => flags.json ? console.error(s) : console.log(s);
|
|
376
|
+
const { openBundle } = await import("./bundle-DZstHDeW.js");
|
|
377
|
+
const opened = await openBundle(file, log);
|
|
378
|
+
if (opened.exit !== void 0) return opened.exit;
|
|
379
|
+
const { args } = opened.manifest;
|
|
380
|
+
log(`reeval: running ${file} in ${opened.project}, where its .reeval/ stays`);
|
|
381
|
+
process.chdir(opened.project);
|
|
382
|
+
return runCommand({
|
|
383
|
+
...flags,
|
|
384
|
+
bundle: void 0,
|
|
385
|
+
...args.profile ? { profile: args.profile } : {},
|
|
386
|
+
tag: args.tags,
|
|
387
|
+
trait: args.traits,
|
|
388
|
+
...args.runs ? { runs: args.runs } : {}
|
|
389
|
+
}, opened.config, args.filters);
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
1279
392
|
* The config a command that reads the history runs on: the profile `--profile`, `REEVAL_PROFILE`
|
|
1280
393
|
* or `defaultProfile` picks sets which store it reads, as it does for `reeval run`. `.env` and
|
|
1281
394
|
* `.env.local` load first, as for `reeval run`: they can hold the store's keys and the profile.
|
|
@@ -1324,7 +437,8 @@ async function confirm(question) {
|
|
|
1324
437
|
}
|
|
1325
438
|
/**
|
|
1326
439
|
* `reeval clean`: removes local debug data and snapshots, all of them or all but the newest
|
|
1327
|
-
* `--keep` runs',
|
|
440
|
+
* `--keep` runs', with `--staging` every stopped run's staging, and with `--bundles` every copy
|
|
441
|
+
* `run --bundle` extracted whose process has ended.
|
|
1328
442
|
*/
|
|
1329
443
|
async function cleanCommand(flags, configPath) {
|
|
1330
444
|
const config = await loadConfig(configPath, "clean");
|
|
@@ -1342,19 +456,26 @@ async function cleanCommand(flags, configPath) {
|
|
|
1342
456
|
const removed = await removeStoppedStaging(config.root);
|
|
1343
457
|
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
458
|
}
|
|
459
|
+
const streams = await pruneEvents(config.root, keep);
|
|
460
|
+
if (streams.length) console.log(`Removed the event streams of ${streams.length} finished run${streams.length === 1 ? "" : "s"} from .reeval/events`);
|
|
461
|
+
if (flags.bundles) {
|
|
462
|
+
const { removeExtractedBundles } = await import("./bundle-DZstHDeW.js");
|
|
463
|
+
const removed = await removeExtractedBundles();
|
|
464
|
+
console.log(removed.length ? `Removed ${removed.length} extracted bundle${removed.length === 1 ? "" : "s"}: ${removed.join(", ")}` : "No extracted bundles to remove");
|
|
465
|
+
}
|
|
1345
466
|
if (flags.images) {
|
|
1346
|
-
const { dockerAvailable, pruneImages } = await import("./src-
|
|
1347
|
-
const { requireDocker } = await import("./providers-
|
|
467
|
+
const { dockerAvailable, pruneImages } = await import("./src-jYqNkT-F.js");
|
|
468
|
+
const { requireDocker } = await import("./providers-BkLGzaSY.js");
|
|
1348
469
|
const engines = [];
|
|
1349
470
|
for (const engine of ["docker", "podman"]) if (await dockerAvailable(engine)) engines.push(engine);
|
|
1350
|
-
const { tartCli } = await import("./tart-cli-
|
|
471
|
+
const { tartCli } = await import("./tart-cli-BOcluha1.js");
|
|
1351
472
|
const tart = await tartCli(["--version"]).then((r) => r.exitCode === 0, () => false);
|
|
1352
473
|
if (!engines.length && !tart) await requireDocker();
|
|
1353
474
|
let removed = 0;
|
|
1354
475
|
for (const engine of engines) removed += await pruneImages(engine);
|
|
1355
476
|
if (engines.length) console.log(removed ? `Removed ${removed} image${removed === 1 ? "" : "s"} reeval built that nothing uses` : "No leftover images to remove");
|
|
1356
477
|
if (tart) {
|
|
1357
|
-
const { deleteBakedImages } = await import("./tart-bake-
|
|
478
|
+
const { deleteBakedImages } = await import("./tart-bake-DjFcsG3N.js");
|
|
1358
479
|
const baked = await deleteBakedImages();
|
|
1359
480
|
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
481
|
}
|
|
@@ -1373,11 +494,12 @@ function verbosityOf(flags) {
|
|
|
1373
494
|
* image.
|
|
1374
495
|
*/
|
|
1375
496
|
async function imageBuildCommand(flags, configPath, filters) {
|
|
1376
|
-
const { buildImages, imagePlanLines, imageTargets, plannedImageUses, pullTartImages, tartPlanLines, tartTargets } = await import("./images-
|
|
1377
|
-
const
|
|
497
|
+
const { buildImages, imagePlanLines, imageTargets, plannedImageUses, pullTartImages, tartPlanLines, tartTargets } = await import("./images-Ch1y1t6_.js");
|
|
498
|
+
const setup = await prepareRun({
|
|
1378
499
|
...flags,
|
|
1379
500
|
"dry-run": true
|
|
1380
|
-
}, configPath)
|
|
501
|
+
}, configPath);
|
|
502
|
+
const { runId, stagingDir, config, runs, tags, concurrency, profile } = await startRun(setup);
|
|
1381
503
|
const root = config.root;
|
|
1382
504
|
const uses = await plannedImageUses({
|
|
1383
505
|
runId,
|
|
@@ -1439,7 +561,9 @@ async function imageBuildCommand(flags, configPath, filters) {
|
|
|
1439
561
|
if (targets.length) {
|
|
1440
562
|
const built = await buildImages(targets, root, {
|
|
1441
563
|
log: (line) => console.log(dim(line)),
|
|
1442
|
-
force: !!flags.force
|
|
564
|
+
force: !!flags.force,
|
|
565
|
+
registry: setup.registry,
|
|
566
|
+
push: !!flags.push
|
|
1443
567
|
}).catch(refusal("docker", targets, vms.length));
|
|
1444
568
|
for (const b of built) outcomes.push(b.ok ? {
|
|
1445
569
|
id: b.id,
|
|
@@ -1458,7 +582,7 @@ async function imageBuildCommand(flags, configPath, filters) {
|
|
|
1458
582
|
if (!(error instanceof PrepareError)) throw error;
|
|
1459
583
|
if (error.failure.usage) throw new UsageError(error.message);
|
|
1460
584
|
if (error.failure.cause === "enospc") invocation.machineState = true;
|
|
1461
|
-
const { PreflightInfraError } = await import("./preflight-
|
|
585
|
+
const { PreflightInfraError } = await import("./preflight-BMVDBcux.js");
|
|
1462
586
|
throw new PreflightInfraError(error.message);
|
|
1463
587
|
}
|
|
1464
588
|
for (const o of outcomes) {
|
|
@@ -1481,18 +605,69 @@ async function imageBuildCommand(flags, configPath, filters) {
|
|
|
1481
605
|
}
|
|
1482
606
|
/** The first 12 hex digits of an image id or digest. */
|
|
1483
607
|
const short12 = (id) => id.replace(/^sha256:/, "").slice(0, 12);
|
|
608
|
+
/**
|
|
609
|
+
* `reeval attach`: a run's socket URL or stream file as given, else the run a ref names (by default the one in
|
|
610
|
+
* progress) and the stream file it writes. Exits with the run's exit code.
|
|
611
|
+
*/
|
|
612
|
+
async function attachCommand(flags, target, configPath) {
|
|
613
|
+
let source;
|
|
614
|
+
let root = configPath === void 0 ? void 0 : dirname(configPath);
|
|
615
|
+
if (target && (isAttachUrl(target) || existsSync(target))) {
|
|
616
|
+
source = target;
|
|
617
|
+
const inEvents = isAttachUrl(target) ? null : /^(.*)[\\/]\.reeval[\\/]events[\\/][^\\/]+\.ndjson$/.exec(resolve(target));
|
|
618
|
+
if (inEvents?.[1]) root = inEvents[1];
|
|
619
|
+
} else {
|
|
620
|
+
root = dirname(requireConfig(configPath));
|
|
621
|
+
source = (await resolveAttach(root, target)).file;
|
|
622
|
+
}
|
|
623
|
+
const { attach } = await import("./attach-EbDGKGTO.js");
|
|
624
|
+
return attach({
|
|
625
|
+
source,
|
|
626
|
+
...root === void 0 ? {} : { root },
|
|
627
|
+
out: process.stdout,
|
|
628
|
+
columns: process.stdout.columns,
|
|
629
|
+
colorDepth: process.stdout.isTTY ? process.stdout.getColorDepth() : void 0,
|
|
630
|
+
tty: {
|
|
631
|
+
stdout: process.stdout,
|
|
632
|
+
stdin: process.stdin
|
|
633
|
+
},
|
|
634
|
+
output: (verbosity) => resolveOutput({
|
|
635
|
+
flags: {
|
|
636
|
+
ui: flags.ui,
|
|
637
|
+
logOrder: flags["log-order"],
|
|
638
|
+
logPrefix: flags["log-prefix"],
|
|
639
|
+
outputLogs: flags["output-logs"],
|
|
640
|
+
verbose: verbosity > 0
|
|
641
|
+
},
|
|
642
|
+
env: process.env,
|
|
643
|
+
isTTY: !!process.stdout.isTTY,
|
|
644
|
+
agent: detectAgent().name,
|
|
645
|
+
stdinTTY: !!process.stdin.isTTY
|
|
646
|
+
})
|
|
647
|
+
});
|
|
648
|
+
}
|
|
1484
649
|
/** `reeval run`: check, plan, run the engine, then write the run and pick the exit code. */
|
|
1485
650
|
async function runCommand(flags, configPath, given) {
|
|
1486
651
|
const retry = flags["retry-errors"];
|
|
652
|
+
const url = flags["events-url"];
|
|
653
|
+
const parsed = url === void 0 ? null : URL.parse(url);
|
|
654
|
+
if (url !== void 0 && !(parsed && isEventsUrl(url))) throw new UsageError(`--events-url takes an http or https URL (got ${stripCredentials(url)})`);
|
|
655
|
+
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`);
|
|
656
|
+
const eventsFileFlag = flags["events-file"];
|
|
657
|
+
if (eventsFileFlag !== void 0) {
|
|
658
|
+
const refused = notEventStream(resolve(eventsFileFlag));
|
|
659
|
+
if (refused) throw new UsageError(`--events-file: ${refused}`);
|
|
660
|
+
}
|
|
1487
661
|
if (retry !== void 0 && flags.resume !== void 0) throw new UsageError("--resume and --retry-errors both continue a run: pass one of them.");
|
|
1488
662
|
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
|
|
663
|
+
const continued = flags.resume !== void 0 || retry !== void 0;
|
|
664
|
+
const resumed = continued ? await resumedRun(flags, given, configPath) : null;
|
|
1490
665
|
if (resumed?.nothing) {
|
|
1491
666
|
const { nothing, record } = resumed.nothing;
|
|
1492
667
|
const outcome = runOutcome(record);
|
|
1493
668
|
if (flags.json) {
|
|
1494
669
|
console.error(nothing);
|
|
1495
|
-
const { suiteResult } = await import("./suite-
|
|
670
|
+
const { suiteResult } = await import("./suite-CH1aaAbs.js");
|
|
1496
671
|
process.stdout.write(`${JSON.stringify({
|
|
1497
672
|
...suiteResult(record),
|
|
1498
673
|
outcome
|
|
@@ -1524,26 +699,49 @@ async function runCommand(flags, configPath, given) {
|
|
|
1524
699
|
if (githubOut) await appendFile(githubOut, `run-id=${ctx.runId}\n`).catch(() => {});
|
|
1525
700
|
const stepStart = process.env.GITHUB_STEP_SUMMARY;
|
|
1526
701
|
if (stepStart) await appendFile(stepStart, `run ${ctx.runId}\n`).catch(() => {});
|
|
1527
|
-
const { engineVersions } = await import("./node-
|
|
702
|
+
const { engineVersions } = await import("./node-BjuhqQwa.js");
|
|
1528
703
|
const terminal = setup.json && !setup.dryRun ? process.stderr : process.stdout;
|
|
1529
|
-
const
|
|
704
|
+
const harness = setup.config.harness[0]?.kind ?? "agent";
|
|
705
|
+
const drawn = createRenderer({
|
|
1530
706
|
out: setup.json && setup.dryRun ? { write: () => true } : terminal,
|
|
1531
707
|
columns: terminal.columns,
|
|
1532
708
|
colorDepth: terminal.isTTY ? terminal.getColorDepth() : void 0,
|
|
1533
709
|
output: setup.output,
|
|
1534
710
|
verbosity: ctx.verbosity ?? 0,
|
|
1535
|
-
harness
|
|
711
|
+
harness,
|
|
1536
712
|
tty: {
|
|
1537
713
|
stdout: process.stdout,
|
|
1538
714
|
stdin: process.stdin
|
|
1539
715
|
}
|
|
1540
716
|
});
|
|
717
|
+
const root = setup.config.root;
|
|
718
|
+
const eventsTo = eventsFileFlag !== void 0 ? resolve(eventsFileFlag) : flags.events ? eventsFile(root, ctx.runId) : resumed?.saved?.events ? resolve(root, resumed.saved.events) : void 0;
|
|
719
|
+
const savedEvents = eventsTo ? relativeFile(root, eventsTo) : void 0;
|
|
720
|
+
if (startedWith && savedEvents) startedWith.events = savedEvents;
|
|
721
|
+
const eventsUrl = flags["events-url"];
|
|
722
|
+
if (eventsTo || eventsUrl) eventStream = openEventStream({
|
|
723
|
+
...eventsTo ? {
|
|
724
|
+
file: eventsTo,
|
|
725
|
+
append: continued
|
|
726
|
+
} : {},
|
|
727
|
+
...eventsUrl ? { url: eventsUrl } : {},
|
|
728
|
+
header: {
|
|
729
|
+
reeval: version,
|
|
730
|
+
runId: ctx.runId,
|
|
731
|
+
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
732
|
+
harness,
|
|
733
|
+
verbosity: ctx.verbosity ?? 0
|
|
734
|
+
},
|
|
735
|
+
warn: (message) => process.stderr.write(yellow(`reeval: ${message}\n`))
|
|
736
|
+
});
|
|
737
|
+
const renderer = eventStream ? teeRenderer(drawn, eventStream) : drawn;
|
|
1541
738
|
let executed;
|
|
1542
739
|
try {
|
|
1543
740
|
executed = await executeRun(ctx, setup, filters, renderer, {
|
|
1544
741
|
startedWith,
|
|
1545
742
|
notes: resumed?.notes ?? [],
|
|
1546
|
-
narrowed: !!resumed && (given.length > 0 || !!flags.tag?.length || !!flags.trait?.length)
|
|
743
|
+
narrowed: !!resumed && (given.length > 0 || !!flags.tag?.length || !!flags.trait?.length),
|
|
744
|
+
...savedEvents ? { events: savedEvents } : {}
|
|
1547
745
|
});
|
|
1548
746
|
} catch (error) {
|
|
1549
747
|
renderer.close();
|
|
@@ -1564,7 +762,7 @@ async function runCommand(flags, configPath, given) {
|
|
|
1564
762
|
return EXIT.ok;
|
|
1565
763
|
}
|
|
1566
764
|
if (ctx.retry && ctx.previous && retried.size) {
|
|
1567
|
-
const { retryEnvironmentChanges } = await import("./retry-
|
|
765
|
+
const { retryEnvironmentChanges } = await import("./retry-Bfk7pDti.js");
|
|
1568
766
|
const changes = retryEnvironmentChanges(ctx.previous, ctx.stagingDir, retried);
|
|
1569
767
|
if (changes.length) {
|
|
1570
768
|
questions?.cancel();
|
|
@@ -1583,8 +781,8 @@ async function runCommand(flags, configPath, given) {
|
|
|
1583
781
|
}
|
|
1584
782
|
finishing = true;
|
|
1585
783
|
live?.phase("finishing");
|
|
1586
|
-
const { lockfiles } = await import("./state-
|
|
1587
|
-
const { writeScratchRun } = await import("./results-
|
|
784
|
+
const { lockfiles } = await import("./state-CKIjZZRK.js");
|
|
785
|
+
const { writeScratchRun } = await import("./results-DhMgRkR0.js");
|
|
1588
786
|
const run = await writeScratchRun({
|
|
1589
787
|
ctx,
|
|
1590
788
|
author: ctx.author,
|
|
@@ -1632,7 +830,7 @@ async function runCommand(flags, configPath, given) {
|
|
|
1632
830
|
});
|
|
1633
831
|
renderer.close();
|
|
1634
832
|
if (retried.size) {
|
|
1635
|
-
const { retryCounts, retryLine } = await import("./retry-
|
|
833
|
+
const { retryCounts, retryLine } = await import("./retry-Bfk7pDti.js");
|
|
1636
834
|
const line = retryLine(retryCounts(record, retried, ctx.previous));
|
|
1637
835
|
if (setup.json) console.error(line);
|
|
1638
836
|
else console.log(line);
|
|
@@ -1641,11 +839,11 @@ async function runCommand(flags, configPath, given) {
|
|
|
1641
839
|
if (stepSummary && run.artifactDir) await appendFile(stepSummary, await readFile(summary)).catch(() => {});
|
|
1642
840
|
const { config } = ctx;
|
|
1643
841
|
const mode = setup.record;
|
|
1644
|
-
const { readRecord, recordFile } = await import("./files-
|
|
842
|
+
const { readRecord, recordFile } = await import("./files-CAzVG3Rr.js");
|
|
1645
843
|
const rerecord = (setup.retry !== void 0 || setup.resume !== void 0) && record.status === "complete" && existsSync(recordFile(config.history.dir, record.runId));
|
|
1646
844
|
const autoRecord = flags.record || mode === "always" || mode === "ci" && inCI() || rerecord;
|
|
1647
845
|
if (autoRecord && record.status !== "interrupted") {
|
|
1648
|
-
const { record: recordCmd } = await import("./commands-
|
|
846
|
+
const { record: recordCmd } = await import("./commands-Dqli45sR.js");
|
|
1649
847
|
const allow = record.status === "budget" ? { "allow-incomplete": true } : {};
|
|
1650
848
|
const level = rerecord ? { artifacts: (await readRecord(recordFile(config.history.dir, record.runId))).artifacts } : {};
|
|
1651
849
|
const line = await recordCmd(config, record.runId, {
|
|
@@ -1666,7 +864,7 @@ async function runCommand(flags, configPath, given) {
|
|
|
1666
864
|
else console.log(line);
|
|
1667
865
|
}
|
|
1668
866
|
if (setup.json) {
|
|
1669
|
-
const { suiteResult } = await import("./suite-
|
|
867
|
+
const { suiteResult } = await import("./suite-CH1aaAbs.js");
|
|
1670
868
|
process.stdout.write(`${JSON.stringify({
|
|
1671
869
|
...suiteResult(record),
|
|
1672
870
|
outcome: ran
|
|
@@ -1746,9 +944,16 @@ async function prepareRun(flags, configPath, { noProfile = false, profileOf } =
|
|
|
1746
944
|
stdinTTY: !!process.stdin.isTTY && !flags.json && !flags["dry-run"]
|
|
1747
945
|
});
|
|
1748
946
|
const path = requireConfig(configPath);
|
|
1749
|
-
|
|
947
|
+
const tracked = !!(flags["dry-run"] && flags.json) ? (await import("./inputs-load-C82HOKnb.js")).trackLoad(dirname(path)) : void 0;
|
|
948
|
+
let configInputs = [];
|
|
949
|
+
let loaded;
|
|
1750
950
|
const named = noProfile ? void 0 : flags.profile ?? (process.env.REEVAL_PROFILE || void 0);
|
|
1751
|
-
|
|
951
|
+
try {
|
|
952
|
+
loadEnvFiles(path);
|
|
953
|
+
loaded = await loadConfig(path, "run", named);
|
|
954
|
+
} finally {
|
|
955
|
+
if (tracked) configInputs = tracked.stop(path, "config");
|
|
956
|
+
}
|
|
1752
957
|
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
958
|
const profile = noProfile ? null : selectProfile(loaded, flags.profile);
|
|
1754
959
|
const config = withProfileHistory(loaded, profile);
|
|
@@ -1760,6 +965,7 @@ async function prepareRun(flags, configPath, { noProfile = false, profileOf } =
|
|
|
1760
965
|
}
|
|
1761
966
|
const sandboxes = [...(config.environments.length ? config.environments : [void 0]).map((e) => environmentSandbox(e, config.sandbox)), ...profile ? [profileSandbox(config, profile.defaults)] : []];
|
|
1762
967
|
const concurrency = givenConcurrency(config, flags.concurrency);
|
|
968
|
+
const registry = await registryFlag(flags);
|
|
1763
969
|
return {
|
|
1764
970
|
output,
|
|
1765
971
|
config,
|
|
@@ -1779,7 +985,11 @@ async function prepareRun(flags, configPath, { noProfile = false, profileOf } =
|
|
|
1779
985
|
record: profile?.record ?? config.record,
|
|
1780
986
|
dryRun: !!flags["dry-run"],
|
|
1781
987
|
json: !!flags.json,
|
|
988
|
+
/** What loading the config read, for `--dry-run --json`'s `inputs`. */
|
|
989
|
+
configInputs,
|
|
1782
990
|
force: !!flags.force,
|
|
991
|
+
/** `--registry`: where a missing sandbox image is pulled from before it's built. */
|
|
992
|
+
registry,
|
|
1783
993
|
verbosity: verbosityOf(flags),
|
|
1784
994
|
configFile: configLabel(path),
|
|
1785
995
|
/** Named in the plan line when the project root isn't the current directory. */
|
|
@@ -1790,17 +1000,26 @@ async function prepareRun(flags, configPath, { noProfile = false, profileOf } =
|
|
|
1790
1000
|
retry: flags["retry-errors"]
|
|
1791
1001
|
};
|
|
1792
1002
|
}
|
|
1003
|
+
/** `--registry`, checked, or null; `--push` needs it. */
|
|
1004
|
+
async function registryFlag(flags) {
|
|
1005
|
+
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");
|
|
1006
|
+
if (flags.registry === void 0) return null;
|
|
1007
|
+
const { registryProblem } = await import("./src-jYqNkT-F.js");
|
|
1008
|
+
const problem = registryProblem(flags.registry);
|
|
1009
|
+
if (problem) throw new UsageError(problem);
|
|
1010
|
+
return flags.registry.replace(/\/+$/, "");
|
|
1011
|
+
}
|
|
1793
1012
|
/** What a retry, or a resume that finishes one, does to the run's errors, for its refusals. */
|
|
1794
1013
|
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
1014
|
/** The run's id and the state it starts from: commit, uncommitted changes, author. */
|
|
1796
1015
|
async function startRun({ config, profile, runs, tags, traits, sandboxes, sizeRun, verbosity, configFile, resume, retry, dryRun }) {
|
|
1797
1016
|
const startedAt = /* @__PURE__ */ new Date();
|
|
1798
1017
|
const git = await gitInfo(config.root, [config.history.dir]);
|
|
1799
|
-
const { worktreePatch } = await import("./state-
|
|
1018
|
+
const { worktreePatch } = await import("./state-CKIjZZRK.js");
|
|
1800
1019
|
const patch = git?.dirty ? await worktreePatch(config.root, [config.history.dir]) : null;
|
|
1801
1020
|
const who = await author(config.root);
|
|
1802
|
-
const { stagingDir } = await import("./results-
|
|
1803
|
-
const { scratchDir } = await import("./files-
|
|
1021
|
+
const { stagingDir } = await import("./results-DhMgRkR0.js");
|
|
1022
|
+
const { scratchDir } = await import("./files-CAzVG3Rr.js");
|
|
1804
1023
|
const scratch = scratchDir(config.root);
|
|
1805
1024
|
if (resume !== void 0 || retry !== void 0) {
|
|
1806
1025
|
const target = await continuedRun(config.root, {
|
|
@@ -1817,8 +1036,8 @@ async function startRun({ config, profile, runs, tags, traits, sandboxes, sizeRu
|
|
|
1817
1036
|
} : await loadPrevious(stagingDir(config.root, target.runId));
|
|
1818
1037
|
if (!dryRun) {
|
|
1819
1038
|
await cleanupRun(target.runId).catch(() => {});
|
|
1820
|
-
const
|
|
1821
|
-
if (
|
|
1039
|
+
const scoped = sandboxes.filter((s) => sandboxKind(s).cleanupScope?.(s)?.atStart);
|
|
1040
|
+
if (scoped.length) await cleanupRun(target.runId, scoped).catch(() => {});
|
|
1822
1041
|
}
|
|
1823
1042
|
const concurrency = await sizeRun();
|
|
1824
1043
|
const { unfoldCases } = await import("./cases-FvhbM8M5.js");
|
|
@@ -1915,12 +1134,12 @@ function namesDeclaredSecret(evals) {
|
|
|
1915
1134
|
*/
|
|
1916
1135
|
async function planEfforts(planned) {
|
|
1917
1136
|
const live = planned.filter((p) => !p.attempt.plan.skip);
|
|
1918
|
-
const { effortNotes, withDefaultEffort } = await import("./default-effort-
|
|
1137
|
+
const { effortNotes, withDefaultEffort } = await import("./default-effort-DHzj84dD.js");
|
|
1919
1138
|
let cursor;
|
|
1920
1139
|
let unchecked = "CURSOR_API_KEY isn't set";
|
|
1921
1140
|
const key = process.env.CURSOR_API_KEY;
|
|
1922
1141
|
if (key && live.some((p) => p.attempt.harness.kind === "cursor")) {
|
|
1923
|
-
const { checkCursorPlan } = await import("./cursor-catalog-
|
|
1142
|
+
const { checkCursorPlan } = await import("./cursor-catalog-CRsFxorF.js");
|
|
1924
1143
|
const checked = await checkCursorPlan(key, live);
|
|
1925
1144
|
if (checked instanceof Error) unchecked = `its request failed: ${checked.message}`;
|
|
1926
1145
|
else {
|
|
@@ -1941,6 +1160,7 @@ async function planEfforts(planned) {
|
|
|
1941
1160
|
* or Docker problem (exit 2). Then runs the engine with live output and Ctrl-C handling.
|
|
1942
1161
|
*/
|
|
1943
1162
|
async function executeRun(ctx, setup, filters, renderer, started) {
|
|
1163
|
+
const { events } = started;
|
|
1944
1164
|
const { runId, stagingDir, config, runs, tags, traits, concurrency, profile, verbosity } = ctx;
|
|
1945
1165
|
const { configFile } = ctx;
|
|
1946
1166
|
const run = JSON.parse(JSON.stringify({
|
|
@@ -1954,10 +1174,11 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
1954
1174
|
profile,
|
|
1955
1175
|
verbosity,
|
|
1956
1176
|
configFile,
|
|
1957
|
-
completed: []
|
|
1177
|
+
completed: [],
|
|
1178
|
+
...setup.dryRun && setup.json ? { inputs: true } : {}
|
|
1958
1179
|
}));
|
|
1959
|
-
const { runEngine } = await import("./node-
|
|
1960
|
-
const { buildPlan, checkAttemptBudget, planDocument, planLine, planTable, runHeader } = await import("./plan-
|
|
1180
|
+
const { runEngine } = await import("./node-BjuhqQwa.js");
|
|
1181
|
+
const { buildPlan, checkAttemptBudget, planDocument, planInputs, planLine, planTable, runHeader } = await import("./plan-BcT4G5jj.js");
|
|
1961
1182
|
let plan;
|
|
1962
1183
|
let sandboxVersions = { images: [] };
|
|
1963
1184
|
let preflightStop;
|
|
@@ -2002,9 +1223,9 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2002
1223
|
if (ctx.retry && ctx.previous) {
|
|
2003
1224
|
const ranOn = ctx.previous.stack?.reeval;
|
|
2004
1225
|
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-
|
|
1226
|
+
const { retryChanges } = await import("./retry-Bfk7pDti.js");
|
|
1227
|
+
const { judgePart } = await import("./assemble-CBMRIhso.js");
|
|
1228
|
+
const { engineVersions } = await import("./node-BjuhqQwa.js");
|
|
2008
1229
|
const judged = judgePart(config, profile, version, engineVersions);
|
|
2009
1230
|
const runs = new Set(planned.map((p) => p.key).filter((key) => !completed.has(key)));
|
|
2010
1231
|
const changes = await retryChanges(ctx.previous, planned, runs, config.root, judged);
|
|
@@ -2017,7 +1238,7 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2017
1238
|
}
|
|
2018
1239
|
}
|
|
2019
1240
|
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-
|
|
1241
|
+
const models = skipped.some((p) => !p.attempt.plan.skip && p.attempt.plan.questions?.length) ? await import("./model-B1tdv9-d.js") : void 0;
|
|
2021
1242
|
const judge = runJudgeModel(config, profile);
|
|
2022
1243
|
const judgeModel = judge === void 0 ? null : judgeModelName(judge);
|
|
2023
1244
|
plan = await buildPlan({
|
|
@@ -2037,7 +1258,7 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2037
1258
|
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
1259
|
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
1260
|
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-
|
|
1261
|
+
const { podmanRootless } = await import("./providers-BkLGzaSY.js");
|
|
2041
1262
|
if (switching.length && await podmanRootless()) plan.warnings.push(rootlessPodmanSwitch(switching));
|
|
2042
1263
|
plan.warnings.push(...started.notes);
|
|
2043
1264
|
if (started.narrowed) {
|
|
@@ -2053,7 +1274,7 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2053
1274
|
run.completed = [...completed];
|
|
2054
1275
|
const done = leftOut.filter((l) => l.done).map((l) => l.key);
|
|
2055
1276
|
kept = keptAttempts([...completed, ...done], stagingDir, ctx.previous);
|
|
2056
|
-
const { imageStages, imageTargets } = await import("./images-
|
|
1277
|
+
const { imageStages, imageTargets } = await import("./images-Ch1y1t6_.js");
|
|
2057
1278
|
const targets = imageTargets(skipped.filter((p) => !p.attempt.plan.skip).map((p) => ({
|
|
2058
1279
|
id: p.attempt.family?.id ?? p.id,
|
|
2059
1280
|
harness: p.attempt.harness,
|
|
@@ -2067,18 +1288,33 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2067
1288
|
evals: t.evals,
|
|
2068
1289
|
stages: await imageStages(t, config.root)
|
|
2069
1290
|
})));
|
|
2070
|
-
const
|
|
1291
|
+
const { lockfiles } = await import("./state-CKIjZZRK.js");
|
|
1292
|
+
const locks = (await lockfiles(config.root)).map(({ path }) => ({
|
|
1293
|
+
path: join(config.root, path),
|
|
1294
|
+
kind: "lockfile"
|
|
1295
|
+
}));
|
|
1296
|
+
const inputs = planInputs(config.root, [...setup.configInputs, ...locks], skipped);
|
|
1297
|
+
const running = skipped.filter((p) => !p.attempt.plan.skip);
|
|
1298
|
+
const secrets = new Set(running.flatMap((p) => p.attempt.secretVars));
|
|
1299
|
+
const needed = neededCredentials(config, {
|
|
1300
|
+
harnesses: plan.harnessDescriptors,
|
|
1301
|
+
sandboxes: plan.sandboxes,
|
|
1302
|
+
profile,
|
|
1303
|
+
judges: running.flatMap((p) => p.attempt.judge ? [p.attempt.judge] : [])
|
|
1304
|
+
});
|
|
1305
|
+
for (const { names } of needed) for (const name of names) secrets.add(name);
|
|
1306
|
+
const doc = planDocument(plan, skipped, excluded, images, inputs, [...secrets].sort());
|
|
2071
1307
|
process.stdout.write(`${JSON.stringify(doc, null, 2)}\n`);
|
|
2072
1308
|
return false;
|
|
2073
1309
|
}
|
|
2074
1310
|
const elsewhere = setup.configElsewhere ? configFile : void 0;
|
|
2075
|
-
const { scratchDir } = await import("./files-
|
|
1311
|
+
const { scratchDir } = await import("./files-CAzVG3Rr.js");
|
|
2076
1312
|
const lines = [];
|
|
2077
1313
|
if (setup.dryRun) {
|
|
2078
1314
|
const todos = excluded.filter((e) => e.mode === "todo").map((e) => e.id);
|
|
2079
1315
|
lines.push(...planTable(plan, todos));
|
|
2080
|
-
const { imageStatusLines } = await import("./images-
|
|
2081
|
-
const { dockerAvailable, engineSpec } = await import("./src-
|
|
1316
|
+
const { imageStatusLines } = await import("./images-Ch1y1t6_.js");
|
|
1317
|
+
const { dockerAvailable, engineSpec } = await import("./src-jYqNkT-F.js");
|
|
2082
1318
|
const engines = [...new Set(targets.map((t) => t.sandbox.engine ?? "docker"))];
|
|
2083
1319
|
const down = [];
|
|
2084
1320
|
for (const engine of engines) if (!await dockerAvailable(engine)) down.push(engine);
|
|
@@ -2114,8 +1350,8 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2114
1350
|
const away = /* @__PURE__ */ new Map();
|
|
2115
1351
|
for (const { attempt } of planned) {
|
|
2116
1352
|
const { sandbox } = attempt;
|
|
2117
|
-
|
|
2118
|
-
if (
|
|
1353
|
+
const scope = sandboxKind(sandbox).cleanupScope?.(sandbox);
|
|
1354
|
+
if (scope) away.set(`${sandbox.kind}\0${scope.key}`, sandbox);
|
|
2119
1355
|
}
|
|
2120
1356
|
if (away.size) await cleanupRun(runId, [...away.values()]).catch(() => {});
|
|
2121
1357
|
}
|
|
@@ -2171,7 +1407,7 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2171
1407
|
});
|
|
2172
1408
|
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
1409
|
if (asked.length) {
|
|
2174
|
-
const { questionRunner } = await import("./questions-
|
|
1410
|
+
const { questionRunner } = await import("./questions-Csv64WCb.js");
|
|
2175
1411
|
const warned = /* @__PURE__ */ new Set();
|
|
2176
1412
|
questions = questionRunner({
|
|
2177
1413
|
evals: asked,
|
|
@@ -2213,7 +1449,7 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2213
1449
|
}
|
|
2214
1450
|
});
|
|
2215
1451
|
}
|
|
2216
|
-
const { prepareWorkspaces, sameTreeArms, workspaceKey } = await import("./workspace-
|
|
1452
|
+
const { prepareWorkspaces, sameTreeArms, workspaceKey } = await import("./workspace-CnRbV8cM.js");
|
|
2217
1453
|
const live = skipped.filter((p) => !p.attempt.plan.skip);
|
|
2218
1454
|
const outcomes = await prepareWorkspaces(live.flatMap(({ attempt: a }) => a.workspace ? [{
|
|
2219
1455
|
workspace: a.workspace,
|
|
@@ -2278,7 +1514,8 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2278
1514
|
type: "prepare",
|
|
2279
1515
|
at: Date.now(),
|
|
2280
1516
|
...e
|
|
2281
|
-
})
|
|
1517
|
+
}),
|
|
1518
|
+
...setup.registry ? { registry: setup.registry } : {}
|
|
2282
1519
|
});
|
|
2283
1520
|
} catch (error) {
|
|
2284
1521
|
if (error.name !== "PreflightInfraError") throw error;
|
|
@@ -2305,11 +1542,17 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2305
1542
|
};
|
|
2306
1543
|
let engineRun;
|
|
2307
1544
|
let cutShort = false;
|
|
1545
|
+
const { MACHINES, MachineService } = await import("./machine-service-2lIv5UWF.js");
|
|
1546
|
+
const machines = new MachineService();
|
|
2308
1547
|
try {
|
|
2309
1548
|
engineRun = await runEngine({
|
|
2310
1549
|
run,
|
|
2311
1550
|
filters,
|
|
2312
1551
|
onPlan,
|
|
1552
|
+
services: {
|
|
1553
|
+
call: (owner, service, body) => service === MACHINES ? machines.call(owner, body) : Promise.reject(/* @__PURE__ */ new Error(`This run has no ${service} service`)),
|
|
1554
|
+
released: (owner) => machines.released(owner)
|
|
1555
|
+
},
|
|
2313
1556
|
onRunStart: (files) => {
|
|
2314
1557
|
writeCurrent(setup.config.root, runId);
|
|
2315
1558
|
live = writeLiveProgress({
|
|
@@ -2319,7 +1562,8 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2319
1562
|
planned: toRun,
|
|
2320
1563
|
kept,
|
|
2321
1564
|
leftOut,
|
|
2322
|
-
...started.startedWith ? { invocation: started.startedWith } : {}
|
|
1565
|
+
...started.startedWith ? { invocation: started.startedWith } : {},
|
|
1566
|
+
...events ? { events } : {}
|
|
2323
1567
|
});
|
|
2324
1568
|
renderer.onEvent({
|
|
2325
1569
|
type: "run-start",
|
|
@@ -2346,7 +1590,15 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2346
1590
|
},
|
|
2347
1591
|
onCancelable: (cancel) => {
|
|
2348
1592
|
let first;
|
|
2349
|
-
const onSignal = (signal) => {
|
|
1593
|
+
const onSignal = (signal, attach) => {
|
|
1594
|
+
if (first?.attach && !attach && Date.now() - first.at < SAME_PRESS_MS) {
|
|
1595
|
+
stopCode = signal === "SIGTERM" ? EXIT.terminated : EXIT.interrupted;
|
|
1596
|
+
first = {
|
|
1597
|
+
signal,
|
|
1598
|
+
at: Date.now()
|
|
1599
|
+
};
|
|
1600
|
+
return;
|
|
1601
|
+
}
|
|
2350
1602
|
if (first && !first.passedOn && signal !== first.signal && Date.now() - first.at < SAME_PRESS_MS) {
|
|
2351
1603
|
if (signal === "SIGINT") stopCode = EXIT.interrupted;
|
|
2352
1604
|
if (!finishing) renderer.onEvent({
|
|
@@ -2368,7 +1620,8 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2368
1620
|
interrupted = true;
|
|
2369
1621
|
first = {
|
|
2370
1622
|
signal,
|
|
2371
|
-
at: Date.now()
|
|
1623
|
+
at: Date.now(),
|
|
1624
|
+
...attach ? { attach } : {}
|
|
2372
1625
|
};
|
|
2373
1626
|
if (finishing) return;
|
|
2374
1627
|
questions?.cancel();
|
|
@@ -2381,8 +1634,11 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2381
1634
|
});
|
|
2382
1635
|
cancel();
|
|
2383
1636
|
};
|
|
2384
|
-
process.on("SIGINT", onSignal);
|
|
2385
|
-
process.on("SIGTERM", onSignal);
|
|
1637
|
+
process.on("SIGINT", () => onSignal("SIGINT", false));
|
|
1638
|
+
process.on("SIGTERM", () => onSignal("SIGTERM", false));
|
|
1639
|
+
if (process.platform !== "win32") process.on(CANCEL_SIGNAL, () => {
|
|
1640
|
+
if (!interrupted && !finishing) onSignal("SIGINT", true);
|
|
1641
|
+
});
|
|
2386
1642
|
}
|
|
2387
1643
|
});
|
|
2388
1644
|
cutShort = interrupted;
|
|
@@ -2391,9 +1647,10 @@ async function executeRun(ctx, setup, filters, renderer, started) {
|
|
|
2391
1647
|
throw error;
|
|
2392
1648
|
} finally {
|
|
2393
1649
|
clearTimeout(budgetTimer);
|
|
2394
|
-
|
|
1650
|
+
await machines.close();
|
|
1651
|
+
const { removePrepared } = await import("./preflight-zsAn3heN.js");
|
|
2395
1652
|
removePrepared(config.root, runId);
|
|
2396
|
-
const { removePreparedWorkspaces } = await import("./workspace-
|
|
1653
|
+
const { removePreparedWorkspaces } = await import("./workspace-CnRbV8cM.js");
|
|
2397
1654
|
removePreparedWorkspaces(config.root, runId);
|
|
2398
1655
|
}
|
|
2399
1656
|
if (preflightStop) throw preflightStop;
|
|
@@ -2421,6 +1678,7 @@ process.stdout.on("error", (error) => {
|
|
|
2421
1678
|
* error or an infra error), prints one line suggesting `reeval report`. Not for agents or JSON.
|
|
2422
1679
|
*/
|
|
2423
1680
|
function finish(code, error, kind) {
|
|
1681
|
+
eventStream?.end(code);
|
|
2424
1682
|
const flags = invocation.flags;
|
|
2425
1683
|
let root = process.cwd();
|
|
2426
1684
|
try {
|
|
@@ -2480,4 +1738,4 @@ run(process.argv.slice(2)).finally(() => {
|
|
|
2480
1738
|
});
|
|
2481
1739
|
export {};
|
|
2482
1740
|
|
|
2483
|
-
//# sourceMappingURL=cli-
|
|
1741
|
+
//# sourceMappingURL=cli-BgBBuxxJ.js.map
|