reeval 0.20.0 → 0.21.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 +803 -0
- package/README.md +15 -15
- package/assets/gateway-models.mjs +65 -31
- package/dist/{adapter-C60z3wLq.js → adapter-BdzhdRYo.js} +8 -6
- package/dist/adapter-BdzhdRYo.js.map +1 -0
- package/dist/{agent-BmsMXZXx.js → agent-Dx-bDmlV.js} +179 -31
- package/dist/agent-Dx-bDmlV.js.map +1 -0
- package/dist/{agents-DXuFxtGC.js → agents-l0-k7vw3.js} +361 -101
- package/dist/agents-l0-k7vw3.js.map +1 -0
- package/dist/{app-files-DT5mJyV4.js → app-files-B-CQYB0c.js} +3 -3
- package/dist/app-files-B-CQYB0c.js.map +1 -0
- package/dist/{assemble-CE4pHKIa.js → assemble-CYMpN8LC.js} +1 -1
- package/dist/{assemble-DM2PNU4R.js → assemble-CsZIcJo8.js} +171 -18
- package/dist/assemble-CsZIcJo8.js.map +1 -0
- package/dist/{attempt-CAdlwlNu.js → attempt-CKfKsqqw.js} +2 -2
- package/dist/{attempt-CAdlwlNu.js.map → attempt-CKfKsqqw.js.map} +1 -1
- package/dist/{attempt-host-7VviAJrl.js → attempt-host-BwSmNYkX.js} +17 -8
- package/dist/attempt-host-BwSmNYkX.js.map +1 -0
- package/dist/{boat-BjLqFJIZ.js → boat-CZpAreTB.js} +3 -3
- package/dist/{boat-BjLqFJIZ.js.map → boat-CZpAreTB.js.map} +1 -1
- package/dist/{boat-DSNgZt-t.js → boat-su1Y7LPd.js} +17 -14
- package/dist/boat-su1Y7LPd.js.map +1 -0
- package/dist/bridge/index.mjs +6 -1
- package/dist/{capture-Ccf0Hmyx.js → capture-BqIAeFyC.js} +55 -29
- package/dist/{capture-Ccf0Hmyx.js.map → capture-BqIAeFyC.js.map} +1 -1
- package/dist/capture-D0Ln5aCP.js +1 -0
- package/dist/{cases-z9E6DCd5.js → cases-CM-MQRQp.js} +133 -19
- package/dist/cases-CM-MQRQp.js.map +1 -0
- package/dist/cases-FvhbM8M5.js +1 -0
- package/dist/{cli-DTuLSlmW.js → cli-s_3opn_I.js} +219 -109
- package/dist/cli-s_3opn_I.js.map +1 -0
- package/dist/{cli-spec-Dsr79Qy1.js → cli-spec-DxzIjmq_.js} +109 -26
- package/dist/cli-spec-DxzIjmq_.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/client-C5fIzHQa.js +803 -0
- package/dist/client-C5fIzHQa.js.map +1 -0
- package/dist/{command-DSL7I-SI.js → command-B5OAIjp7.js} +25 -21
- package/dist/command-B5OAIjp7.js.map +1 -0
- package/dist/{command-C2C7P5qo.js → command-BJ7KqczP.js} +10 -10
- package/dist/{command-C2C7P5qo.js.map → command-BJ7KqczP.js.map} +1 -1
- package/dist/{command-D8oMB2fa.js → command-BXLZsEwQ.js} +16 -16
- package/dist/{command-D8oMB2fa.js.map → command-BXLZsEwQ.js.map} +1 -1
- package/dist/{command-Ff0T-1Hi.js → command-DA_SHQUQ.js} +16 -16
- package/dist/{command-Ff0T-1Hi.js.map → command-DA_SHQUQ.js.map} +1 -1
- package/dist/{commands-xAOi_VEk.js → commands-BKBamOcX.js} +174 -40
- package/dist/commands-BKBamOcX.js.map +1 -0
- package/dist/{commands-Bk9NG1s_.js → commands-BPvAOEmb.js} +1 -1
- package/dist/{config-SvK8pjEK.js → config-C0URar0t.js} +255 -89
- package/dist/config-C0URar0t.js.map +1 -0
- package/dist/{context-BdgCao9Q.js → context-Sj58aJEu.js} +2 -2
- package/dist/{context-BdgCao9Q.js.map → context-Sj58aJEu.js.map} +1 -1
- package/dist/{cost-BdRgySQl.js → cost-C21gGrju.js} +19 -9
- package/dist/cost-C21gGrju.js.map +1 -0
- package/dist/cost-IM80LyGD.js +1 -0
- package/dist/{cursor-catalog-DEzan4IT.js → cursor-catalog-FWgSo-T1.js} +4 -4
- package/dist/{cursor-catalog-DEzan4IT.js.map → cursor-catalog-FWgSo-T1.js.map} +1 -1
- package/dist/db-Bc4L-Wcr.js +2 -0
- package/dist/{db-BzOJ4Js4.js → db-BjAWxVAG.js} +142 -248
- package/dist/db-BjAWxVAG.js.map +1 -0
- package/dist/debug-CIXzB4wK.js.map +1 -1
- package/dist/{default-effort-BBDPbJ4D.js → default-effort-CWlhZ6U1.js} +1 -1
- package/dist/{default-effort-BDKIxJyC.js → default-effort-Ck2GYIxX.js} +4 -4
- package/dist/{default-effort-BDKIxJyC.js.map → default-effort-Ck2GYIxX.js.map} +1 -1
- package/dist/{dist-Db7ifchA.js → dist-DeqeCUZe.js} +5 -5
- package/dist/{dist-Db7ifchA.js.map → dist-DeqeCUZe.js.map} +1 -1
- package/dist/{docker-DG_uFgn2.js → docker-CDdK6Ity.js} +41 -16
- package/dist/docker-CDdK6Ity.js.map +1 -0
- package/dist/{docker-DFrjoNs-.js → docker-D74l67k8.js} +4 -4
- package/dist/{docker-DFrjoNs-.js.map → docker-D74l67k8.js.map} +1 -1
- package/dist/{docker--mukta3L.js → docker-DMug3l-a.js} +1 -1
- package/dist/{doctor-DWK4ttex.js → doctor-eFxyn6at.js} +85 -46
- package/dist/doctor-eFxyn6at.js.map +1 -0
- package/dist/{environment-cPMCOk-h.js → environment-CJIKz-Ud.js} +49 -11
- package/dist/environment-CJIKz-Ud.js.map +1 -0
- package/dist/{errors-BZgLSZtV.js → errors-C1GBcWE2.js} +2 -2
- package/dist/{errors-BZgLSZtV.js.map → errors-C1GBcWE2.js.map} +1 -1
- package/dist/{eval-source-C9b1h8L6.js → eval-source-CXIRJ91v.js} +24 -12
- package/dist/eval-source-CXIRJ91v.js.map +1 -0
- package/dist/{evaluate-B12Tosvq.js → evaluate-DA4QsrHO.js} +792 -281
- package/dist/evaluate-DA4QsrHO.js.map +1 -0
- package/dist/{evaluate-COdzf7Hl.d.ts → evaluate-DHrU4Wld.d.ts} +2 -2
- package/dist/fake-bootstrap-CnwWG3kP.js +15 -0
- package/dist/fake-bootstrap-CnwWG3kP.js.map +1 -0
- package/dist/{files-BOBdC0uI.js → files-BVVWAS0A.js} +6 -6
- package/dist/{files-BOBdC0uI.js.map → files-BVVWAS0A.js.map} +1 -1
- package/dist/files-BaqXvB88.js +1 -0
- package/dist/{files-tiNWe8Ih.js → files-Bey1VAex.js} +3 -3
- package/dist/{files-tiNWe8Ih.js.map → files-Bey1VAex.js.map} +1 -1
- package/dist/files-BjOJw4sn.js +1 -0
- package/dist/{files-DgXyaAg6.js → files-BrGVs4gY.js} +2 -2
- package/dist/{files-DgXyaAg6.js.map → files-BrGVs4gY.js.map} +1 -1
- package/dist/files-CNHhSyb3.js +1 -0
- package/dist/files-CW1lChNh.js +1 -0
- package/dist/{files-F5EG0WPT.js → files-D6j-XpaK.js} +5 -5
- package/dist/{files-F5EG0WPT.js.map → files-D6j-XpaK.js.map} +1 -1
- package/dist/{files-s28a6czq.js → files-F44NRCN0.js} +143 -20
- package/dist/files-F44NRCN0.js.map +1 -0
- package/dist/{files-DlQshsks.js → files-g1watgRC.js} +2 -2
- package/dist/{files-DlQshsks.js.map → files-g1watgRC.js.map} +1 -1
- package/dist/gateway.d.ts +1 -1
- package/dist/{git-BpoqEgDV.js → git-Jqkf9SBa.js} +3 -3
- package/dist/{git-BpoqEgDV.js.map → git-Jqkf9SBa.js.map} +1 -1
- package/dist/{harness-DXv2gnaT.js → harness-FcTyyPco.js} +17 -8
- package/dist/harness-FcTyyPco.js.map +1 -0
- package/dist/{harness-C2berMiM.js → harness-nwnyghJZ.js} +14 -11
- package/dist/{harness-C2berMiM.js.map → harness-nwnyghJZ.js.map} +1 -1
- package/dist/harness.d.ts +11 -8
- package/dist/harness.js +1 -1
- package/dist/{ids-C_advdJA.js → ids-B-JKTCP8.js} +2 -2
- package/dist/{ids-C_advdJA.js.map → ids-B-JKTCP8.js.map} +1 -1
- package/dist/{images-D2jFze2v.js → images-Dsc4Wi-F.js} +65 -30
- package/dist/images-Dsc4Wi-F.js.map +1 -0
- package/dist/index.d.ts +46 -7
- package/dist/index.js +6 -6
- package/dist/init-C0oUG3jh.js +1 -0
- package/dist/{init-Bi1Q3lRi.js → init-QB5ecPDA.js} +33 -14
- package/dist/init-QB5ecPDA.js.map +1 -0
- package/dist/{ink-list-BpfidQ1h.js → ink-list-mCJypk3d.js} +2 -2
- package/dist/{ink-list-BpfidQ1h.js.map → ink-list-mCJypk3d.js.map} +1 -1
- package/dist/{invocations-CxGNOlh0.js → invocations-BSr4lRzI.js} +5 -5
- package/dist/{invocations-CxGNOlh0.js.map → invocations-BSr4lRzI.js.map} +1 -1
- package/dist/{judge-COMXT1Hx.js → judge-eGH39PaP.js} +12 -10
- package/dist/{judge-COMXT1Hx.js.map → judge-eGH39PaP.js.map} +1 -1
- package/dist/judge.d.ts +3 -1
- package/dist/judge.js +1 -1
- package/dist/{judgments-CzgpsTqv.js → judgments-Cj8bFaDG.js} +2 -2
- package/dist/{judgments-CzgpsTqv.js.map → judgments-Cj8bFaDG.js.map} +1 -1
- package/dist/{layout-Cm85tQYk.js → layout-DfQa4mJs.js} +14 -11
- package/dist/layout-DfQa4mJs.js.map +1 -0
- package/dist/{list-DuThsE28.js → list-Dh6T0kdr.js} +23 -12
- package/dist/{list-DuThsE28.js.map → list-Dh6T0kdr.js.map} +1 -1
- package/dist/live-DwjWJTdn.js +1 -0
- package/dist/{live-CgYbO4Te.js → live-xTZs0c61.js} +2 -2
- package/dist/{live-CgYbO4Te.js.map → live-xTZs0c61.js.map} +1 -1
- package/dist/{live-DL0se4Zd.js → live-y1p3oNXH.js} +9 -9
- package/dist/{live-DL0se4Zd.js.map → live-y1p3oNXH.js.map} +1 -1
- package/dist/{model-CwwkrCb7.js → model-3pZZzloU.js} +7 -5
- package/dist/model-3pZZzloU.js.map +1 -0
- package/dist/{model-CkNVAxob.js → model-DEjwetkJ.js} +1 -1
- package/dist/{model-V3mMXp6x.js → model-DNpKiHqO.js} +6 -6
- package/dist/{model-V3mMXp6x.js.map → model-DNpKiHqO.js.map} +1 -1
- package/dist/model-calls-B0BoQfJ4.js +95 -0
- package/dist/model-calls-B0BoQfJ4.js.map +1 -0
- package/dist/{model-cgt5uvu8.js → model-jRKSQBg6.js} +5 -5
- package/dist/{model-cgt5uvu8.js.map → model-jRKSQBg6.js.map} +1 -1
- package/dist/model-nfewGTzB.js +1 -0
- package/dist/{node-D7pAU--0.js → node-DM-mLGdX.js} +7 -7
- package/dist/{node-D7pAU--0.js.map → node-DM-mLGdX.js.map} +1 -1
- package/dist/{opencode-providers-BGiXt8_B.js → opencode-providers-ChJTQRmz.js} +5 -2
- package/dist/{opencode-providers-BGiXt8_B.js.map → opencode-providers-ChJTQRmz.js.map} +1 -1
- package/dist/{openrouter-models-Cw1z8-sq.js → openrouter-models-C0aRo633.js} +2 -2
- package/dist/{openrouter-models-Cw1z8-sq.js.map → openrouter-models-C0aRo633.js.map} +1 -1
- package/dist/options-DpsJ_5CU.js +1 -0
- package/dist/{patch-DAi1nCuH.js → patch-Bx-qp8Li.js} +2 -2
- package/dist/{patch-DAi1nCuH.js.map → patch-Bx-qp8Li.js.map} +1 -1
- package/dist/pi-providers-HygmL1y-.js +552 -0
- package/dist/pi-providers-HygmL1y-.js.map +1 -0
- package/dist/{plain-BYUf_fUV.js → plain-Ctn8oUdp.js} +44 -10
- package/dist/plain-Ctn8oUdp.js.map +1 -0
- package/dist/{plan-CsPilzpk.js → plan-ChO0A-xn.js} +63 -12
- package/dist/plan-ChO0A-xn.js.map +1 -0
- package/dist/{plugins-BfnhazOv.js → plugins-BioMWncI.js} +636 -9
- package/dist/plugins-BioMWncI.js.map +1 -0
- package/dist/{preflight-D1C-iH0U.js → preflight-BUjk_6wT.js} +1 -1
- package/dist/{preflight-GkpgrBxP.js → preflight-CJSGzMzc.js} +8 -9
- package/dist/preflight-CJSGzMzc.js.map +1 -0
- package/dist/preflight-DD3fI4Hz.js +1 -0
- package/dist/{preflight-BixaE4BA.js → preflight-qFCXmxha.js} +4 -4
- package/dist/{preflight-BixaE4BA.js.map → preflight-qFCXmxha.js.map} +1 -1
- package/dist/{prepare-DQEDXoDp.js → prepare-D7oSSFNm.js} +9 -9
- package/dist/{prepare-DQEDXoDp.js.map → prepare-D7oSSFNm.js.map} +1 -1
- package/dist/{prepare-C--rM_wO.js → prepare-xHU2BpN-.js} +2 -2
- package/dist/prices-B1vm_lPk.js +1 -0
- package/dist/{prices-5m3SzMZ3.js → prices-BrY_ihLs.js} +80 -22
- package/dist/prices-BrY_ihLs.js.map +1 -0
- package/dist/{provenance-BXyYwUC8.js → provenance-B-flBAzR.js} +5 -5
- package/dist/{provenance-BXyYwUC8.js.map → provenance-B-flBAzR.js.map} +1 -1
- package/dist/provider-DHT20Gl8.js +1 -0
- package/dist/{provider-BxzZq3Th.js → provider-ieWOn4YS.js} +2 -2
- package/dist/{provider-BxzZq3Th.js.map → provider-ieWOn4YS.js.map} +1 -1
- package/dist/provider-stop-CxzWW7Ft.js +69 -0
- package/dist/provider-stop-CxzWW7Ft.js.map +1 -0
- package/dist/{providers-1p4HKYIp.js → providers-B6StVyfG.js} +215 -48
- package/dist/providers-B6StVyfG.js.map +1 -0
- package/dist/providers-Dljf6al6.js +1 -0
- package/dist/query-BAc2tQZj.js +1 -0
- package/dist/{query-DhhU9ADI.js → query-CkLmJv7R.js} +2 -2
- package/dist/{query-DhhU9ADI.js.map → query-CkLmJv7R.js.map} +1 -1
- package/dist/{questions-CMAq4pr8.js → questions-CJIh2FSX.js} +7 -7
- package/dist/{questions-CMAq4pr8.js.map → questions-CJIh2FSX.js.map} +1 -1
- package/dist/{record-6IUzwP9K.js → record-nVVujCW7.js} +2 -2
- package/dist/{record-6IUzwP9K.js.map → record-nVVujCW7.js.map} +1 -1
- package/dist/{redact-BhjtnjrU.js → redact-DL2BTykw.js} +17 -2
- package/dist/redact-DL2BTykw.js.map +1 -0
- package/dist/{remarks-BNABzemt.js → remarks-B3wjKscW.js} +46 -11
- package/dist/remarks-B3wjKscW.js.map +1 -0
- package/dist/{remarks-D9Lcd1fF.js → remarks-BpdM_2RC.js} +2 -1
- package/dist/remarks-BpdM_2RC.js.map +1 -0
- package/dist/remarks-CleoDlYw.js +1 -0
- package/dist/{remarks-DPCONFxZ.js → remarks-DqriPKxm.js} +3 -2
- package/dist/{remarks-DPCONFxZ.js.map → remarks-DqriPKxm.js.map} +1 -1
- package/dist/{remote-U7fNt0UP.js → remote-C88amFRN.js} +6 -6
- package/dist/{remote-U7fNt0UP.js.map → remote-C88amFRN.js.map} +1 -1
- package/dist/resolve-Bul8lHaa.js +205 -0
- package/dist/resolve-Bul8lHaa.js.map +1 -0
- package/dist/resolve-DW92wpIZ.js +1 -0
- package/dist/{resolve-Cx3a9UQ2.js → resolve-G576PiFJ.js} +14 -11
- package/dist/resolve-G576PiFJ.js.map +1 -0
- package/dist/{results-CQKXmHym.js → results-zVHIW6xw.js} +9 -22
- package/dist/results-zVHIW6xw.js.map +1 -0
- package/dist/{resume-POpZa1ge.js → resume-D_PcUXfG.js} +94 -16
- package/dist/resume-D_PcUXfG.js.map +1 -0
- package/dist/{retry-CmG809Mp.js → retry-BvTzCxdc.js} +4 -4
- package/dist/{retry-CmG809Mp.js.map → retry-BvTzCxdc.js.map} +1 -1
- package/dist/{root-Co0jhOT5.js → root-BzeoyfGd.js} +2 -2
- package/dist/{root-Co0jhOT5.js.map → root-BzeoyfGd.js.map} +1 -1
- package/dist/{vercel-CGlSBv63.js → routes-B0F2R-K7.js} +91 -56
- package/dist/routes-B0F2R-K7.js.map +1 -0
- package/dist/{runtime-Xm9oeC7o.js → runtime-B3r_pAq6.js} +4 -4
- package/dist/{runtime-Xm9oeC7o.js.map → runtime-B3r_pAq6.js.map} +1 -1
- package/dist/sandbox/boat.d.ts +1 -1
- package/dist/sandbox/boat.js +1 -1
- package/dist/{sandbox-DrlL4yqb.js → sandbox-Duh3z1TV.js} +3 -3
- package/dist/{sandbox-DrlL4yqb.js.map → sandbox-Duh3z1TV.js.map} +1 -1
- package/dist/sandbox.d.ts +1 -1
- package/dist/sandbox.js +1 -1
- package/dist/server-CGEsvVRG.js +1 -0
- package/dist/{server-C00zd6zl.js → server-DUWMRKik.js} +8 -8
- package/dist/{server-C00zd6zl.js.map → server-DUWMRKik.js.map} +1 -1
- package/dist/{shared-Cfi45Bvy.js → shared-DtZwIAfy.js} +7 -1
- package/dist/shared-DtZwIAfy.js.map +1 -0
- package/dist/{source-DDgr48Gn.js → source-CHuN4Nfg.js} +2 -2
- package/dist/{source-DDgr48Gn.js.map → source-CHuN4Nfg.js.map} +1 -1
- package/dist/source-Wz1Nrfue.js +1 -0
- package/dist/src--yl1OypK.js +2 -0
- package/dist/{src-Cb2MWozp.js → src-B-HuDqpH.js} +276 -41
- package/dist/src-B-HuDqpH.js.map +1 -0
- package/dist/{src-DAzaCTcN.js → src-B5r1d23Y.js} +176 -18
- package/dist/src-B5r1d23Y.js.map +1 -0
- package/dist/{src-y0nOeRRE.js → src-BHJ4MWvY.js} +494 -112
- package/dist/src-BHJ4MWvY.js.map +1 -0
- package/dist/{src-Dw79VLa3.js → src-BI0v8qlZ.js} +202 -56
- package/dist/src-BI0v8qlZ.js.map +1 -0
- package/dist/src-BL-_0QoE.js +1 -0
- package/dist/{src-YvblOrBU.js → src-BqNzHHWn.js} +87 -13
- package/dist/src-BqNzHHWn.js.map +1 -0
- package/dist/{src-CV_7DkPa.js → src-C-ChdnG6.js} +102 -13
- package/dist/src-C-ChdnG6.js.map +1 -0
- package/dist/src-C-mOSczH.js +2 -0
- package/dist/src-CZaYu6ER.js +3 -0
- package/dist/src-CeBhwD8k.js +2 -0
- package/dist/src-CkEiiyON.js +2 -0
- package/dist/{src-KxS91P7L.js → src-CmA5Yev6.js} +79 -11
- package/dist/src-CmA5Yev6.js.map +1 -0
- package/dist/src-CwH_nEaw.js +2 -0
- package/dist/src-DA95rM6v.js +4 -0
- package/dist/{src-DvGns8cz.js → src-DL-EE4DU.js} +299 -17
- package/dist/src-DL-EE4DU.js.map +1 -0
- package/dist/src-De0KY5S_.js +2 -0
- package/dist/{src-BNQznj4z.js → src-boB6D-5T.js} +124 -45
- package/dist/src-boB6D-5T.js.map +1 -0
- package/dist/state-B3jex5KU.js +1 -0
- package/dist/{state-328JpnHA.js → state-DUBRDyMk.js} +21 -21
- package/dist/{state-328JpnHA.js.map → state-DUBRDyMk.js.map} +1 -1
- package/dist/store/local.d.ts +8 -0
- package/dist/store/local.js +16 -0
- package/dist/store/local.js.map +1 -0
- package/dist/store/s3.d.ts +10 -0
- package/dist/store/s3.js +18 -0
- package/dist/store/s3.js.map +1 -0
- package/dist/{suite-COglUhPd.js → suite-B9J6Afg6.js} +6 -5
- package/dist/{suite-COglUhPd.js.map → suite-B9J6Afg6.js.map} +1 -1
- package/dist/suite-Bhs9-Z7O.js +2 -0
- package/dist/{summary-DDy9DfyJ.js → summary-CSp4cfnr.js} +25 -7
- package/dist/{summary-DDy9DfyJ.js.map → summary-CSp4cfnr.js.map} +1 -1
- package/dist/sync-CxAY6Dki.js +559 -0
- package/dist/sync-CxAY6Dki.js.map +1 -0
- package/dist/{tart-dWoJvWHc.js → tart-CcrrtSrp.js} +179 -61
- package/dist/tart-CcrrtSrp.js.map +1 -0
- package/dist/tart-CzViW3WZ.js +186 -0
- package/dist/tart-CzViW3WZ.js.map +1 -0
- package/dist/tart-DmVuVsmX.js +1 -0
- package/dist/tart-bake-F-6seRC9.js +192 -0
- package/dist/tart-bake-F-6seRC9.js.map +1 -0
- package/dist/tart-bake-RK7RaT9E.js +1 -0
- package/dist/tart-cli-B86Jqo1t.js +89 -0
- package/dist/tart-cli-B86Jqo1t.js.map +1 -0
- package/dist/tart-cli-ClvRniLQ.js +1 -0
- package/dist/tart-hosts-Brii7zHM.js +1 -0
- package/dist/tart-hosts-DPyZsg-1.js +313 -0
- package/dist/tart-hosts-DPyZsg-1.js.map +1 -0
- package/dist/{tart-images-DZ_Mbh-g.js → tart-images-CWSf03w8.js} +64 -6
- package/dist/tart-images-CWSf03w8.js.map +1 -0
- package/dist/testing.d.ts +36 -2
- package/dist/testing.js +4 -4
- package/dist/tool-class-CVDdJy0H.js +433 -0
- package/dist/tool-class-CVDdJy0H.js.map +1 -0
- package/dist/{trace-Dx2NBE1O.js → trace-BpXByD7W.js} +13 -2
- package/dist/{trace-Dx2NBE1O.js.map → trace-BpXByD7W.js.map} +1 -1
- package/dist/{traits-DKnYkqeK.js → traits-CCD8XsmI.js} +2 -2
- package/dist/{traits-DKnYkqeK.js.map → traits-CCD8XsmI.js.map} +1 -1
- package/dist/{transcript-CCf07UmU.js → transcript-BP_2hji-.js} +3 -3
- package/dist/{transcript-CCf07UmU.js.map → transcript-BP_2hji-.js.map} +1 -1
- package/dist/{types-DBwFsGem.d.ts → types-BJ0wh8wC.d.ts} +408 -44
- package/dist/{types-C2mLpph3.js → types-CbcnJxCy.js} +7 -1
- package/dist/types-CbcnJxCy.js.map +1 -0
- package/dist/{usage-DJiDnh2D.js → usage-CwIRPPZ9.js} +16 -3
- package/dist/usage-CwIRPPZ9.js.map +1 -0
- package/dist/{vertex-Eb2wqahk.js → vertex-BEWxHoxH.js} +22 -6
- package/dist/{vertex-Eb2wqahk.js.map → vertex-BEWxHoxH.js.map} +1 -1
- package/dist/vertex-DXfcXYKn.js +1 -0
- package/dist/view/index.d.ts +27 -3
- package/dist/view/index.js +8 -8
- package/dist/{views-BROacjBv.js → views-DRxXCyIH.js} +6 -6
- package/dist/{views-BROacjBv.js.map → views-DRxXCyIH.js.map} +1 -1
- package/dist/views-i67V1ly3.js +2 -0
- package/dist/{worker-entry-Smb4bNDc.js → worker-entry-C3Q4U63F.js} +12 -9
- package/dist/worker-entry-C3Q4U63F.js.map +1 -0
- package/dist/workspace-DhUOW8if.js +1 -0
- package/dist/{workspace-DNDTEk8v.js → workspace-P72SXLXr.js} +7 -7
- package/dist/{workspace-DNDTEk8v.js.map → workspace-P72SXLXr.js.map} +1 -1
- package/package.json +12 -1
- package/skills/eval-rubric/SKILL.md +10 -0
- package/skills/reeval/SKILL.md +370 -0
- package/skills/reeval/references/capture.md +48 -0
- package/skills/reeval/references/cli.md +162 -0
- package/skills/reeval/references/compare.md +180 -0
- package/skills/reeval/references/config.md +147 -0
- package/skills/reeval/references/environments.md +218 -0
- package/skills/reeval/references/evals.md +241 -0
- package/skills/reeval/references/mistakes.md +39 -0
- package/skills/reeval/references/vocabulary.md +19 -0
- package/skills/setup/SKILL.md +219 -0
- package/skills/setup/references/templates.md +258 -0
- package/dist/adapter-C60z3wLq.js.map +0 -1
- package/dist/agent-BmsMXZXx.js.map +0 -1
- package/dist/agents-DXuFxtGC.js.map +0 -1
- package/dist/app-files-DT5mJyV4.js.map +0 -1
- package/dist/assemble-DM2PNU4R.js.map +0 -1
- package/dist/attempt-host-7VviAJrl.js.map +0 -1
- package/dist/boat-DSNgZt-t.js.map +0 -1
- package/dist/capture-BzotD2hs.js +0 -1
- package/dist/cases-Dy0mifal.js +0 -1
- package/dist/cases-z9E6DCd5.js.map +0 -1
- package/dist/cli-DTuLSlmW.js.map +0 -1
- package/dist/cli-spec-Dsr79Qy1.js.map +0 -1
- package/dist/client-KM4C5r5_.js +0 -387
- package/dist/client-KM4C5r5_.js.map +0 -1
- package/dist/command-DSL7I-SI.js.map +0 -1
- package/dist/commands-xAOi_VEk.js.map +0 -1
- package/dist/config-SvK8pjEK.js.map +0 -1
- package/dist/cost-BdRgySQl.js.map +0 -1
- package/dist/cost-Cr26Alhq.js +0 -1
- package/dist/db-BzOJ4Js4.js.map +0 -1
- package/dist/db-CQRZ3URX.js +0 -2
- package/dist/docker-DG_uFgn2.js.map +0 -1
- package/dist/doctor-DWK4ttex.js.map +0 -1
- package/dist/environment-cPMCOk-h.js.map +0 -1
- package/dist/eval-source-C9b1h8L6.js.map +0 -1
- package/dist/evaluate-B12Tosvq.js.map +0 -1
- package/dist/files-C1Rk9FYA.js +0 -1
- package/dist/files-DMQ9-Vv5.js +0 -1
- package/dist/files-Di0xDbCc.js +0 -1
- package/dist/files-G5jf8wBp.js +0 -1
- package/dist/files-s28a6czq.js.map +0 -1
- package/dist/harness-DXv2gnaT.js.map +0 -1
- package/dist/images-D2jFze2v.js.map +0 -1
- package/dist/init-Bi1Q3lRi.js.map +0 -1
- package/dist/init-CUw65o36.js +0 -1
- package/dist/kinds-Bh2I35id.js +0 -698
- package/dist/kinds-Bh2I35id.js.map +0 -1
- package/dist/layout-Cm85tQYk.js.map +0 -1
- package/dist/live-DZLmj0iG.js +0 -1
- package/dist/matchers-CXLn-1jm.js +0 -148
- package/dist/matchers-CXLn-1jm.js.map +0 -1
- package/dist/model-Cv4GuTsZ.js +0 -1
- package/dist/model-CwwkrCb7.js.map +0 -1
- package/dist/options-DPUmk7v_.js +0 -1
- package/dist/plain-BYUf_fUV.js.map +0 -1
- package/dist/plan-CsPilzpk.js.map +0 -1
- package/dist/plugins-BfnhazOv.js.map +0 -1
- package/dist/preflight-Bn3ianye.js +0 -1
- package/dist/preflight-GkpgrBxP.js.map +0 -1
- package/dist/prices-5m3SzMZ3.js.map +0 -1
- package/dist/provider-BnUoz4KB.js +0 -1
- package/dist/providers-1p4HKYIp.js.map +0 -1
- package/dist/providers-B-ijCktf.js +0 -1
- package/dist/query-BYhyf0LR.js +0 -1
- package/dist/redact-BhjtnjrU.js.map +0 -1
- package/dist/remarks-BNABzemt.js.map +0 -1
- package/dist/remarks-CAvTSq16.js +0 -1
- package/dist/remarks-D9Lcd1fF.js.map +0 -1
- package/dist/resolve-C14Pmtej.js +0 -1
- package/dist/resolve-Cx3a9UQ2.js.map +0 -1
- package/dist/results-CQKXmHym.js.map +0 -1
- package/dist/resume-POpZa1ge.js.map +0 -1
- package/dist/server-C1UJcpUh.js +0 -1
- package/dist/shared-Cfi45Bvy.js.map +0 -1
- package/dist/source-DJHmQv_j.js +0 -1
- package/dist/src-1dBuXzs4.js +0 -3
- package/dist/src-BKpioayC.js +0 -2
- package/dist/src-BNQznj4z.js.map +0 -1
- package/dist/src-BY1cCaoJ.js +0 -2
- package/dist/src-BbZYaQ8b.js +0 -2
- package/dist/src-CDFH2vVN.js +0 -2
- package/dist/src-CMW5R9Q0.js +0 -1
- package/dist/src-CV_7DkPa.js.map +0 -1
- package/dist/src-Cb2MWozp.js.map +0 -1
- package/dist/src-CrV2WA2i.js +0 -2
- package/dist/src-CsFaawcZ.js +0 -2
- package/dist/src-DAzaCTcN.js.map +0 -1
- package/dist/src-DvGns8cz.js.map +0 -1
- package/dist/src-Dw79VLa3.js.map +0 -1
- package/dist/src-KxS91P7L.js.map +0 -1
- package/dist/src-YvblOrBU.js.map +0 -1
- package/dist/src-wKwznPgt.js +0 -2
- package/dist/src-y0nOeRRE.js.map +0 -1
- package/dist/state-Ca55Gk_O.js +0 -1
- package/dist/suite-CKBa6MKt.js +0 -2
- package/dist/tart-cli-C-GsbVsQ.js +0 -1
- package/dist/tart-cli-CU0nFS-L.js +0 -55
- package/dist/tart-cli-CU0nFS-L.js.map +0 -1
- package/dist/tart-dWoJvWHc.js.map +0 -1
- package/dist/tart-images-DZ_Mbh-g.js.map +0 -1
- package/dist/tool-target-DS5d72eH.js +0 -40
- package/dist/tool-target-DS5d72eH.js.map +0 -1
- package/dist/types-C2mLpph3.js.map +0 -1
- package/dist/usage-DJiDnh2D.js.map +0 -1
- package/dist/vercel-CGlSBv63.js.map +0 -1
- package/dist/vertex-O88TCwgY.js +0 -1
- package/dist/views-B0Yt_Q1S.js +0 -2
- package/dist/worker-entry-Smb4bNDc.js.map +0 -1
- package/dist/workspace-C0dDP75l.js +0 -1
package/dist/kinds-Bh2I35id.js
DELETED
|
@@ -1,698 +0,0 @@
|
|
|
1
|
-
import { n as UsageError } from "./errors-ttMTnIYX.js";
|
|
2
|
-
import { d as refusal, l as nonEmpty, s as got, t as closest } from "./shared-Cfi45Bvy.js";
|
|
3
|
-
import { bt as shellQuote, yt as run, z as DOCKER_EGRESS } from "./src-y0nOeRRE.js";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
import { existsSync } from "node:fs";
|
|
6
|
-
import { tmpdir } from "node:os";
|
|
7
|
-
import { dirname, join, win32 } from "node:path";
|
|
8
|
-
import { connect } from "node:net";
|
|
9
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
10
|
-
import { spawn } from "node:child_process";
|
|
11
|
-
import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
12
|
-
const fields = {
|
|
13
|
-
id: nonEmpty().optional(),
|
|
14
|
-
image: z.string().regex(/^\S+$/, "one word"),
|
|
15
|
-
maxConcurrent: z.number().optional(),
|
|
16
|
-
cpus: z.int().positive().optional(),
|
|
17
|
-
memory: z.union([z.string().regex(/^\d+(\.\d+)?[bkmg]?$/i), z.int().positive()]).optional(),
|
|
18
|
-
ssh: z.strictObject({
|
|
19
|
-
user: nonEmpty().optional(),
|
|
20
|
-
key: nonEmpty()
|
|
21
|
-
}).optional()
|
|
22
|
-
};
|
|
23
|
-
const tartSandboxSchema = z.strictObject({
|
|
24
|
-
kind: z.literal("tart"),
|
|
25
|
-
...fields
|
|
26
|
-
});
|
|
27
|
-
/** `tart()`'s argument: the descriptor's fields, with `ssh.key` relative or a `file:` URL. */
|
|
28
|
-
const tartOptionsSchema = z.strictObject({
|
|
29
|
-
...fields,
|
|
30
|
-
ssh: z.strictObject({
|
|
31
|
-
user: nonEmpty().optional(),
|
|
32
|
-
key: z.union([nonEmpty(), z.instanceof(URL)])
|
|
33
|
-
}).optional()
|
|
34
|
-
});
|
|
35
|
-
/** What `docker()` takes that a VM has no use for, and why. */
|
|
36
|
-
const DOCKER_ONLY = {
|
|
37
|
-
from: "a Tart VM starts from its image as is; reeval bakes nothing onto it",
|
|
38
|
-
dockerfile: "a Tart VM starts from its image as is; reeval bakes nothing onto it",
|
|
39
|
-
install: "a Tart VM starts from its image as is; put install commands in the environment setup",
|
|
40
|
-
root: "the VM runs everything as the image user",
|
|
41
|
-
capabilities: "a macOS VM has no Linux capabilities",
|
|
42
|
-
swap: "macOS manages its own swap",
|
|
43
|
-
pids: "a macOS VM has no process limit",
|
|
44
|
-
engine: "Tart is its only engine"
|
|
45
|
-
};
|
|
46
|
-
const FIELD = {
|
|
47
|
-
id: (v) => `tart({ id }) must be a non-empty string (got ${got(v)})`,
|
|
48
|
-
image: (v) => `tart({ image }) takes an OCI image or a local VM name with no spaces, e.g. image: 'ghcr.io/cirruslabs/macos-sequoia-base:latest' (got ${got(v)})`,
|
|
49
|
-
maxConcurrent: (v) => `tart({ maxConcurrent }) takes a number (got ${got(v)})`,
|
|
50
|
-
cpus: (v) => `tart({ cpus }) takes a whole number of CPUs above zero (got ${got(v)})`,
|
|
51
|
-
memory: (v) => `tart({ memory }) takes a size such as '8g' or '4096m', or bytes (got ${got(v)})`,
|
|
52
|
-
ssh: (v) => `tart({ ssh }) takes { user?, key }, where key is the path of a private key the image trusts (got ${got(v)})`,
|
|
53
|
-
kind: (v) => `a Tart sandbox's kind is "tart" (got ${got(v)})`
|
|
54
|
-
};
|
|
55
|
-
const ORDER = [
|
|
56
|
-
"kind",
|
|
57
|
-
"image",
|
|
58
|
-
"id",
|
|
59
|
-
"cpus",
|
|
60
|
-
"memory",
|
|
61
|
-
"ssh"
|
|
62
|
-
];
|
|
63
|
-
function explainTart(issue, value) {
|
|
64
|
-
const options = value;
|
|
65
|
-
if (issue.code === "unrecognized_keys" && issue.path.length === 0) {
|
|
66
|
-
const key = issue.keys[0];
|
|
67
|
-
if (DOCKER_ONLY[key]) return `tart() has no "${key}": ${DOCKER_ONLY[key]}.`;
|
|
68
|
-
if (key === "environment" || key === "env") return `Unknown tart() option "${key}". Variables and secrets belong in defineEnvironment({ env }).`;
|
|
69
|
-
const near = closest(key, Object.keys(fields));
|
|
70
|
-
return `Unknown tart() option "${key}".${near ? ` Did you mean "${near}"?` : ""}`;
|
|
71
|
-
}
|
|
72
|
-
const key = String(issue.path[0]);
|
|
73
|
-
return (FIELD[key] ?? ((v) => `tart({ ${key} }) is invalid (got ${got(v)})`))(options[key]);
|
|
74
|
-
}
|
|
75
|
-
/** `tart()`'s options, checked; throws reeval's sentence for the first problem. */
|
|
76
|
-
function checkTartOptions(options) {
|
|
77
|
-
const problem = refusal(tartOptionsSchema, options, explainTart, { order: ORDER });
|
|
78
|
-
if (problem) throw new UsageError(problem);
|
|
79
|
-
if ((options.maxConcurrent ?? 0) > 2) throw new UsageError(`tart({ maxConcurrent }) is ${options.maxConcurrent}, but macOS runs at most 2 macOS VMs at a time`);
|
|
80
|
-
}
|
|
81
|
-
/** What's wrong with a Tart descriptor from any source, or undefined; `maxConcurrent` aside. */
|
|
82
|
-
const tartProblem = (value) => refusal(tartSandboxSchema, value, explainTart, {
|
|
83
|
-
order: ORDER,
|
|
84
|
-
skip: ["maxConcurrent"]
|
|
85
|
-
});
|
|
86
|
-
const POLL_MS = 200;
|
|
87
|
-
const READ_LISTENERS = {
|
|
88
|
-
proc: "if [ -r /proc/net/tcp ]; then cat /proc/net/tcp /proc/net/tcp6 2>/dev/null; else echo noproc; fi",
|
|
89
|
-
lsof: "if command -v lsof >/dev/null 2>&1; then echo lsof; lsof -nP -iTCP -sTCP:LISTEN -Fn 2>/dev/null; else echo noproc; fi",
|
|
90
|
-
host: "echo noproc"
|
|
91
|
-
};
|
|
92
|
-
/** Prints `alive` while `pid` runs, then the sandbox's TCP listeners, or `noproc` without them. */
|
|
93
|
-
function probeScript(pid, source = "proc") {
|
|
94
|
-
return `${pid ? `kill -0 ${pid} 2>/dev/null && echo alive; ` : ""}${READ_LISTENERS[source]}; exit 0`;
|
|
95
|
-
}
|
|
96
|
-
/** `0100007F` → `127.0.0.1`; 32 hex digits → an IPv6 address. Each 32-bit word is host-endian. */
|
|
97
|
-
function procAddress(hex) {
|
|
98
|
-
const bytes = (hex.match(/.{8}/g) ?? []).flatMap((w) => (w.match(/../g) ?? []).reverse().map((b) => Number.parseInt(b, 16)));
|
|
99
|
-
if (bytes.length === 4) return bytes.join(".");
|
|
100
|
-
if (bytes.slice(0, 10).every((b) => b === 0) && bytes[10] === 255 && bytes[11] === 255) return bytes.slice(12).join(".");
|
|
101
|
-
const groups = [];
|
|
102
|
-
for (let i = 0; i < 16; i += 2) groups.push(((bytes[i] ?? 0) << 8 | (bytes[i + 1] ?? 0)).toString(16));
|
|
103
|
-
const full = groups.join(":");
|
|
104
|
-
const longest = (full.match(/(^|:)0(:0)+(:|$)/g) ?? []).reduce((a, b) => b.length > a.length ? b : a, "");
|
|
105
|
-
return longest ? full.replace(longest, "::") : full;
|
|
106
|
-
}
|
|
107
|
-
/** A listener the tunnel reaches: on loopback or every address, IPv4 or IPv6. */
|
|
108
|
-
const reachable = (address) => address === "0.0.0.0" || address === "::" || address === "::1" || address.startsWith("127.");
|
|
109
|
-
function parseProbe(stdout) {
|
|
110
|
-
const lines = stdout.split("\n");
|
|
111
|
-
const alive = lines.includes("alive");
|
|
112
|
-
if (lines.includes("noproc")) return {
|
|
113
|
-
proc: false,
|
|
114
|
-
alive
|
|
115
|
-
};
|
|
116
|
-
const listeners = [];
|
|
117
|
-
if (lines.includes("lsof")) {
|
|
118
|
-
for (const l of lines) {
|
|
119
|
-
const m = /^n(\*|\[[0-9a-f:.]+\]|[0-9.]+):(\d+)$/i.exec(l);
|
|
120
|
-
const address = m?.[1] === "*" ? "0.0.0.0" : (m?.[1] ?? "").replace(/^\[|\]$/g, "");
|
|
121
|
-
if (m && reachable(address)) listeners.push({
|
|
122
|
-
port: Number(m[2]),
|
|
123
|
-
address
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
return {
|
|
127
|
-
proc: true,
|
|
128
|
-
alive,
|
|
129
|
-
listeners
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
for (const l of lines) {
|
|
133
|
-
const m = /^\s*\d+:\s+([0-9A-F]+):([0-9A-F]{4})\s+\S+\s+0A\s/i.exec(l);
|
|
134
|
-
const address = m ? procAddress(m[1]) : "";
|
|
135
|
-
if (m && reachable(address)) listeners.push({
|
|
136
|
-
port: Number.parseInt(m[2], 16),
|
|
137
|
-
address
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
return {
|
|
141
|
-
proc: true,
|
|
142
|
-
alive,
|
|
143
|
-
listeners
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
/** The ports listening now that weren't before the command started, ascending. */
|
|
147
|
-
const newPorts = (listeners, before) => [...new Set(listeners.map((l) => l.port).filter((p) => !before.has(p)))].sort((a, b) => a - b);
|
|
148
|
-
/** The address to record for `port`: IPv4 first, since that's where the tunnel connects first. */
|
|
149
|
-
const addressFor = (listeners, port) => {
|
|
150
|
-
const all = listeners.filter((l) => l.port === port).map((l) => l.address);
|
|
151
|
-
return all.find((a) => !a.includes(":")) ?? all.find((a) => a === "::") ?? all[0] ?? "";
|
|
152
|
-
};
|
|
153
|
-
/** `want` is taken whoever listens on it: `servePort` found it free when the command started. */
|
|
154
|
-
function decide(s) {
|
|
155
|
-
const { listeners, alive } = s.probe;
|
|
156
|
-
const ports = newPorts(listeners, s.before);
|
|
157
|
-
if (listeners.some((l) => l.port === s.want)) return {
|
|
158
|
-
kind: "port",
|
|
159
|
-
port: s.want,
|
|
160
|
-
address: addressFor(listeners, s.want)
|
|
161
|
-
};
|
|
162
|
-
const late = s.elapsedMs >= s.timeoutMs;
|
|
163
|
-
if (!s.given && ports.length && (s.stableMs >= 3e3 || late || !alive)) {
|
|
164
|
-
if (ports.length === 1) {
|
|
165
|
-
const port = ports[0];
|
|
166
|
-
return {
|
|
167
|
-
kind: "port",
|
|
168
|
-
port,
|
|
169
|
-
address: addressFor(listeners, port)
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
return {
|
|
173
|
-
kind: "several",
|
|
174
|
-
ports
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
if (!alive) return { kind: "exited" };
|
|
178
|
-
return late ? {
|
|
179
|
-
kind: "timeout",
|
|
180
|
-
ports
|
|
181
|
-
} : { kind: "wait" };
|
|
182
|
-
}
|
|
183
|
-
const plain = (output) => output.replace(/\x1b\[[0-9;?]*[A-Za-z]/g, "");
|
|
184
|
-
/** The URLs `output` prints on one of `ports`, as Vite's `Local: http://localhost:5173/`. */
|
|
185
|
-
function printedUrls(output, ports) {
|
|
186
|
-
const found = /* @__PURE__ */ new Map();
|
|
187
|
-
for (const m of plain(output).matchAll(/https?:\/\/(?:\[[0-9a-f:]+\]|[^\s/:[\]]+):(\d+)[^\s'"]*/gi)) {
|
|
188
|
-
const port = Number(m[1]);
|
|
189
|
-
if (ports.includes(port) && !found.has(m[0])) found.set(m[0], port);
|
|
190
|
-
}
|
|
191
|
-
return [...found].map(([url, port]) => ({
|
|
192
|
-
url,
|
|
193
|
-
port
|
|
194
|
-
}));
|
|
195
|
-
}
|
|
196
|
-
/** Whether something on the host accepts a TCP connection on `port`, IPv4 or IPv6 loopback. */
|
|
197
|
-
async function hostListening(port) {
|
|
198
|
-
for (const host of ["127.0.0.1", "::1"]) if (await new Promise((resolve) => {
|
|
199
|
-
const socket = connect({
|
|
200
|
-
port,
|
|
201
|
-
host
|
|
202
|
-
});
|
|
203
|
-
socket.once("connect", () => {
|
|
204
|
-
socket.destroy();
|
|
205
|
-
resolve(true);
|
|
206
|
-
});
|
|
207
|
-
socket.once("error", () => resolve(false));
|
|
208
|
-
})) return host;
|
|
209
|
-
}
|
|
210
|
-
/** How many times `c.serve` allocates `PORT` again when the sandbox already listens on it. */
|
|
211
|
-
const ALLOCATE_TRIES = 5;
|
|
212
|
-
/**
|
|
213
|
-
* The port `c.serve` sets as `PORT` and waits on: `port`, or one from `allocate` that nothing
|
|
214
|
-
* listens on yet. Throws when something already listens on `port`, since that server, not the
|
|
215
|
-
* command's, would answer the checks: c.serve only stops what it started.
|
|
216
|
-
*/
|
|
217
|
-
async function servePort(command, port, allocate, taken) {
|
|
218
|
-
if (port === void 0) {
|
|
219
|
-
for (let i = 0; i < ALLOCATE_TRIES; i++) {
|
|
220
|
-
const want = await allocate();
|
|
221
|
-
if (!await taken(want)) return want;
|
|
222
|
-
}
|
|
223
|
-
throw new Error(`c.serve(${JSON.stringify(command)}) found every port it allocated for PORT already in use in the sandbox`);
|
|
224
|
-
}
|
|
225
|
-
if (await taken(port)) throw new Error(`c.serve(${JSON.stringify(command)}, ${port}): port ${port} was already in use before c.serve started (a server the agent left running?), so the checks would reach that server, not this command's. Stop it first, or drop the port to serve on PORT`);
|
|
226
|
-
return port;
|
|
227
|
-
}
|
|
228
|
-
const sleep = (ms, signal) => new Promise((resolve) => {
|
|
229
|
-
const done = () => {
|
|
230
|
-
clearTimeout(timer);
|
|
231
|
-
signal?.removeEventListener("abort", done);
|
|
232
|
-
resolve();
|
|
233
|
-
};
|
|
234
|
-
const timer = setTimeout(done, ms);
|
|
235
|
-
signal?.addEventListener("abort", done, { once: true });
|
|
236
|
-
});
|
|
237
|
-
const listOf = (items) => items.length > 1 ? `${items.slice(0, -1).join(", ")} and ${items.at(-1)}` : String(items[0]);
|
|
238
|
-
/**
|
|
239
|
-
* Polls until something listens on `want`, or, without a given port, until the ports that are
|
|
240
|
-
* new since the command started have settled on one. Throws, with the command's last output,
|
|
241
|
-
* when they settle on several, it exits, or nothing listens in time.
|
|
242
|
-
*/
|
|
243
|
-
async function awaitListening(command, w) {
|
|
244
|
-
const timeoutMs = w.timeoutMs ?? 12e4;
|
|
245
|
-
const started = Date.now();
|
|
246
|
-
let last = "";
|
|
247
|
-
let changed = started;
|
|
248
|
-
const output = async () => plain(await w.output().catch(() => ""));
|
|
249
|
-
const fail = async (why, out) => {
|
|
250
|
-
const tail = (out ?? await output()).trimEnd().split("\n").slice(-20).join("\n").trim();
|
|
251
|
-
return /* @__PURE__ */ new Error(`c.serve(${JSON.stringify(command)}) ${why}${tail ? `. Its last output:\n${tail}` : ""}`);
|
|
252
|
-
};
|
|
253
|
-
for (;;) {
|
|
254
|
-
w.signal?.throwIfAborted();
|
|
255
|
-
const probe = await w.probe();
|
|
256
|
-
const now = Date.now();
|
|
257
|
-
if (!probe.proc) {
|
|
258
|
-
const address = await (w.hostListening ?? hostListening)(w.want);
|
|
259
|
-
if (address !== void 0) return {
|
|
260
|
-
port: w.want,
|
|
261
|
-
address,
|
|
262
|
-
detected: false,
|
|
263
|
-
readyMs: now - started
|
|
264
|
-
};
|
|
265
|
-
if (!probe.alive) throw await fail(`exited before it listened on ${w.want}`);
|
|
266
|
-
if (now - started >= timeoutMs) throw await fail(`didn't listen on ${w.want} within ${timeoutMs / 1e3}s. This sandbox can't list the ports it listens on, so it must listen on PORT or the port passed`);
|
|
267
|
-
} else {
|
|
268
|
-
const key = newPorts(probe.listeners, w.before).join(",");
|
|
269
|
-
if (key !== last) {
|
|
270
|
-
last = key;
|
|
271
|
-
changed = now;
|
|
272
|
-
}
|
|
273
|
-
const d = decide({
|
|
274
|
-
want: w.want,
|
|
275
|
-
given: w.given,
|
|
276
|
-
probe,
|
|
277
|
-
before: w.before,
|
|
278
|
-
stableMs: now - changed,
|
|
279
|
-
elapsedMs: now - started,
|
|
280
|
-
timeoutMs
|
|
281
|
-
});
|
|
282
|
-
if (d.kind === "port") return {
|
|
283
|
-
port: d.port,
|
|
284
|
-
address: d.address,
|
|
285
|
-
detected: d.port !== w.want,
|
|
286
|
-
readyMs: now - started
|
|
287
|
-
};
|
|
288
|
-
if (d.kind === "several") {
|
|
289
|
-
const out = await output();
|
|
290
|
-
const urls = printedUrls(out, d.ports);
|
|
291
|
-
const printed = urls.length ? ` It printed ${listOf(urls.map((u) => u.url))}.` : "";
|
|
292
|
-
const hint = urls[0]?.port ?? d.ports[0];
|
|
293
|
-
throw await fail(`listens on ports ${listOf(d.ports)}, and not on PORT (${w.want}).${printed} Pass the one it serves on: c.serve(${JSON.stringify(command)}, ${hint})`, out);
|
|
294
|
-
}
|
|
295
|
-
if (d.kind === "exited") throw await fail("exited before it listened on a port");
|
|
296
|
-
if (d.kind === "timeout") {
|
|
297
|
-
const on = d.ports.length ? `; ${d.ports.length > 1 ? "ports" : "port"} ${listOf(d.ports)} started listening` : "";
|
|
298
|
-
throw await fail(`didn't listen on ${w.given ? `the port passed (${w.want})` : "a port"} within ${timeoutMs / 1e3}s${on}`);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
await sleep(POLL_MS, w.signal);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
// src/sandbox/fake.ts
|
|
305
|
-
/** Commands run on the host's own network, so the fake sandbox can neither restrict nor see it. */
|
|
306
|
-
const FAKE_EGRESS = {
|
|
307
|
-
enforce: "none",
|
|
308
|
-
record: false
|
|
309
|
-
};
|
|
310
|
-
/**
|
|
311
|
-
* The POSIX shell commands run in: `sh`, which Windows lacks, so there the `sh.exe` on PATH or
|
|
312
|
-
* Git for Windows'.
|
|
313
|
-
*/
|
|
314
|
-
function posixShell(platform = process.platform, env = process.env, exists = existsSync) {
|
|
315
|
-
if (platform !== "win32") return "sh";
|
|
316
|
-
const onPath = (env.PATH ?? env.Path ?? "").split(win32.delimiter).filter(Boolean);
|
|
317
|
-
const git = [
|
|
318
|
-
env.ProgramFiles,
|
|
319
|
-
env["ProgramFiles(x86)"],
|
|
320
|
-
env.LOCALAPPDATA && win32.join(env.LOCALAPPDATA, "Programs")
|
|
321
|
-
].filter((dir) => !!dir).map((dir) => win32.join(dir, "Git", "bin"));
|
|
322
|
-
const found = [...onPath, ...git].map((dir) => win32.join(dir, "sh.exe")).find(exists);
|
|
323
|
-
if (found) return found;
|
|
324
|
-
throw new UsageError("The fake sandbox runs commands with a POSIX sh, and there's none on this machine. Install Git for Windows (https://git-scm.com/download/win), which brings sh.exe, or run the evals in docker().");
|
|
325
|
-
}
|
|
326
|
-
const EXEC_TAG = "REEVAL_FAKE_EXEC";
|
|
327
|
-
const KILL_TAGGED = `for pass in 1 2 3 4 5; do
|
|
328
|
-
found=
|
|
329
|
-
for f in $(grep -lzx "${EXEC_TAG}=$1" /proc/[0-9]*/environ 2>/dev/null); do
|
|
330
|
-
p=\${f#/proc/}; kill -9 "\${p%/environ}" 2>/dev/null; found=1
|
|
331
|
-
done
|
|
332
|
-
[ -n "$found" ] || break
|
|
333
|
-
done`;
|
|
334
|
-
/**
|
|
335
|
-
* Stops a command's MSYS processes on Windows. `taskkill /t` doesn't reach them: Git's `sh.exe`
|
|
336
|
-
* starts bash, whose fork and exec leave each new process's Windows parent gone, so a timed-out
|
|
337
|
-
* `sleep 30` would run on, holding the command's pipes and working directory.
|
|
338
|
-
*/
|
|
339
|
-
function killTagged(sh, tag) {
|
|
340
|
-
runSh(sh, KILL_TAGGED, tag);
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* Kills host processes whose cwd is the sandbox, including native `node.exe` `c.serve` starts.
|
|
344
|
-
* Match only the unique `reeval-sandbox-*` folder name: Git Bash `pwd` and node.exe's
|
|
345
|
-
* `/proc/cwd` disagree (`/tmp/...` vs `D:\\Users\\...\\Temp\\...`), and an empty
|
|
346
|
-
* `"$prefix"/*` is `/*`, which SIGKILLs the Windows runner (exit 2304).
|
|
347
|
-
*/
|
|
348
|
-
const KILL_UNDER = `cd "$1" || exit 0
|
|
349
|
-
base=$(pwd -P 2>/dev/null || pwd)
|
|
350
|
-
name=\${base##*/}
|
|
351
|
-
case "$name" in
|
|
352
|
-
reeval-sandbox-?*) ;;
|
|
353
|
-
*) exit 0 ;;
|
|
354
|
-
esac
|
|
355
|
-
for f in /proc/[0-9]*/cwd; do
|
|
356
|
-
t=$(readlink "$f" 2>/dev/null) || continue
|
|
357
|
-
case "$t" in
|
|
358
|
-
*"$name"*) ;;
|
|
359
|
-
*) continue ;;
|
|
360
|
-
esac
|
|
361
|
-
p=\${f#/proc/}; p=\${p%/cwd}
|
|
362
|
-
[ -n "$p" ] || continue
|
|
363
|
-
kill -9 "$p" 2>/dev/null
|
|
364
|
-
wp=$(tr -d '\\r\\n' < /proc/$p/winpid 2>/dev/null)
|
|
365
|
-
[ -n "$wp" ] && taskkill /F /PID "$wp" >/dev/null 2>&1
|
|
366
|
-
done`;
|
|
367
|
-
function runSh(sh, script, arg) {
|
|
368
|
-
return new Promise((resolve) => {
|
|
369
|
-
const child = spawn(sh, [
|
|
370
|
-
"-c",
|
|
371
|
-
script,
|
|
372
|
-
"sh",
|
|
373
|
-
arg
|
|
374
|
-
], {
|
|
375
|
-
stdio: "ignore",
|
|
376
|
-
windowsHide: true
|
|
377
|
-
});
|
|
378
|
-
const done = () => resolve();
|
|
379
|
-
child.on("error", done);
|
|
380
|
-
child.on("close", done);
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
/** Windows refuses to delete a directory a live process still has as cwd; retry after kills. */
|
|
384
|
-
async function removeTree(path) {
|
|
385
|
-
const deadline = Date.now() + 8e3;
|
|
386
|
-
for (;;) {
|
|
387
|
-
try {
|
|
388
|
-
await rm(path, {
|
|
389
|
-
recursive: true,
|
|
390
|
-
force: true
|
|
391
|
-
});
|
|
392
|
-
if (!existsSync(path)) return;
|
|
393
|
-
} catch {}
|
|
394
|
-
if (Date.now() >= deadline) {
|
|
395
|
-
await rm(path, {
|
|
396
|
-
recursive: true,
|
|
397
|
-
force: true
|
|
398
|
-
}).catch(() => {});
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
401
|
-
await new Promise((r) => setTimeout(r, 50));
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* A temp directory on the host. Commands run unisolated on the host shell, so this is
|
|
406
|
-
* only meant for tests and for the fake harness.
|
|
407
|
-
*/
|
|
408
|
-
async function createFakeSandbox(descriptor, env = {}) {
|
|
409
|
-
const sh = posixShell();
|
|
410
|
-
const parent = descriptor.dir ?? tmpdir();
|
|
411
|
-
await mkdir(parent, { recursive: true });
|
|
412
|
-
const base = await mkdtemp(join(parent, "reeval-sandbox-"));
|
|
413
|
-
const workdir = join(base, "work");
|
|
414
|
-
await mkdir(workdir);
|
|
415
|
-
const stateDir = `${base}.state`;
|
|
416
|
-
await mkdir(stateDir);
|
|
417
|
-
let destroyed;
|
|
418
|
-
const resolve = (path) => path.startsWith("~/") ? join(base, path.slice(2)) : join(workdir, path);
|
|
419
|
-
return {
|
|
420
|
-
workdir,
|
|
421
|
-
stateDir,
|
|
422
|
-
execOwn: (command, { signal } = {}) => run(sh, ["-c", command], {
|
|
423
|
-
cwd: workdir,
|
|
424
|
-
env: {
|
|
425
|
-
HOME: base,
|
|
426
|
-
...env
|
|
427
|
-
},
|
|
428
|
-
signal
|
|
429
|
-
}),
|
|
430
|
-
exec: (command, { cwd, env: extra, signal } = {}) => {
|
|
431
|
-
const tag = process.platform === "win32" && signal ? randomUUID() : void 0;
|
|
432
|
-
const stop = () => killTagged(sh, tag);
|
|
433
|
-
if (tag) signal?.addEventListener("abort", stop, { once: true });
|
|
434
|
-
return run(sh, ["-c", cwd ? `cd ${shellQuote(cwd)} && ${command}` : command], {
|
|
435
|
-
cwd: workdir,
|
|
436
|
-
env: {
|
|
437
|
-
HOME: base,
|
|
438
|
-
...env,
|
|
439
|
-
...extra,
|
|
440
|
-
...tag ? { [EXEC_TAG]: tag } : {}
|
|
441
|
-
},
|
|
442
|
-
signal
|
|
443
|
-
}).finally(() => signal?.removeEventListener("abort", stop));
|
|
444
|
-
},
|
|
445
|
-
home: base,
|
|
446
|
-
readFile: (path) => readFile(resolve(path), "utf8").catch(() => null),
|
|
447
|
-
getPortEndpoint: async ({ port, protocol = "http" }) => ({ url: `${protocol === "ws" ? "ws" : "http"}://${await hostListening(port) === "::1" ? "[::1]" : "127.0.0.1"}:${port}` }),
|
|
448
|
-
async writeFile(path, content) {
|
|
449
|
-
const target = resolve(path);
|
|
450
|
-
await mkdir(dirname(target), { recursive: true });
|
|
451
|
-
await writeFile(target, content);
|
|
452
|
-
},
|
|
453
|
-
destroy: () => {
|
|
454
|
-
destroyed ??= (async () => {
|
|
455
|
-
await rm(stateDir, {
|
|
456
|
-
recursive: true,
|
|
457
|
-
force: true
|
|
458
|
-
}).catch(() => {});
|
|
459
|
-
if (process.platform === "win32") {
|
|
460
|
-
if (existsSync(base)) await runSh(sh, KILL_UNDER, base);
|
|
461
|
-
await removeTree(base);
|
|
462
|
-
return;
|
|
463
|
-
}
|
|
464
|
-
await rm(base, {
|
|
465
|
-
recursive: true,
|
|
466
|
-
force: true
|
|
467
|
-
}).catch(() => {});
|
|
468
|
-
})().finally(() => {
|
|
469
|
-
destroyed = void 0;
|
|
470
|
-
});
|
|
471
|
-
return destroyed;
|
|
472
|
-
}
|
|
473
|
-
};
|
|
474
|
-
}
|
|
475
|
-
// src/sandbox/kinds.ts
|
|
476
|
-
/** The last path segment of `text`, with what an id can't hold replaced. */
|
|
477
|
-
const idPart = (text) => (text.split("/").at(-1) ?? text).replace(/[^A-Za-z0-9._:@-]+/g, "-");
|
|
478
|
-
/** `+` and a hash of the install steps, or nothing without any. */
|
|
479
|
-
function installId(install) {
|
|
480
|
-
if (!install?.length) return "";
|
|
481
|
-
const key = JSON.stringify(install.map((step) => typeof step === "string" ? step : {
|
|
482
|
-
run: step.run,
|
|
483
|
-
timeout: step.timeout
|
|
484
|
-
}));
|
|
485
|
-
return `+${createHash("sha256").update(key).digest("hex").slice(0, 8)}`;
|
|
486
|
-
}
|
|
487
|
-
const engineOf = (s) => s.engine ?? "docker";
|
|
488
|
-
const SANDBOX_KINDS = {
|
|
489
|
-
docker: {
|
|
490
|
-
helpers: ["docker", "podman"],
|
|
491
|
-
capabilities: {
|
|
492
|
-
platform: "linux",
|
|
493
|
-
egress: DOCKER_EGRESS,
|
|
494
|
-
brokers: true,
|
|
495
|
-
harnessSession: true,
|
|
496
|
-
isolated: true,
|
|
497
|
-
processTable: true,
|
|
498
|
-
listeners: "proc",
|
|
499
|
-
images: true,
|
|
500
|
-
preflight: true,
|
|
501
|
-
pluginBuilds: true,
|
|
502
|
-
harnesses: "all"
|
|
503
|
-
},
|
|
504
|
-
provider: engineOf,
|
|
505
|
-
id(s) {
|
|
506
|
-
const install = installId(s.install);
|
|
507
|
-
const engine = engineOf(s);
|
|
508
|
-
if (s.dockerfile) {
|
|
509
|
-
const [file = "", dir = ""] = s.dockerfile.split(/[\\/]/).reverse();
|
|
510
|
-
return `${engine}:${idPart(file === "Dockerfile" ? dir || file : file)}${install}`;
|
|
511
|
-
}
|
|
512
|
-
const image = s.image ?? s.from;
|
|
513
|
-
return image ? `${engine}:${idPart(image)}${install}` : `${engine}${install}`;
|
|
514
|
-
},
|
|
515
|
-
hostPaths: { dockerfile: "file" },
|
|
516
|
-
buildsAtStart: (s) => !!(s.from || s.dockerfile || s.install?.length),
|
|
517
|
-
privileges: (s) => ({
|
|
518
|
-
root: !!s.root,
|
|
519
|
-
capabilities: s.capabilities ?? []
|
|
520
|
-
}),
|
|
521
|
-
async create(sandbox, options) {
|
|
522
|
-
const { createDockerSandbox } = await import("./docker--mukta3L.js");
|
|
523
|
-
return createDockerSandbox(sandbox, options);
|
|
524
|
-
},
|
|
525
|
-
async capacity(sandbox) {
|
|
526
|
-
const { dockerCapacity } = await import("./src-CMW5R9Q0.js");
|
|
527
|
-
return dockerCapacity(sandbox.engine);
|
|
528
|
-
},
|
|
529
|
-
async cleanupRun(runId, sandboxes) {
|
|
530
|
-
const engines = sandboxes ? [...new Set(sandboxes.map(engineOf))] : ["docker", "podman"];
|
|
531
|
-
if (!engines.length) return;
|
|
532
|
-
const { removeRunContainers } = await import("./docker--mukta3L.js");
|
|
533
|
-
await removeRunContainers(runId, engines);
|
|
534
|
-
}
|
|
535
|
-
},
|
|
536
|
-
fake: {
|
|
537
|
-
helpers: ["fakeSandbox"],
|
|
538
|
-
capabilities: {
|
|
539
|
-
platform: process.platform,
|
|
540
|
-
egress: FAKE_EGRESS,
|
|
541
|
-
brokers: false,
|
|
542
|
-
harnessSession: false,
|
|
543
|
-
isolated: false,
|
|
544
|
-
processTable: false,
|
|
545
|
-
listeners: "host",
|
|
546
|
-
images: false,
|
|
547
|
-
preflight: false,
|
|
548
|
-
pluginBuilds: false,
|
|
549
|
-
harnesses: "all"
|
|
550
|
-
},
|
|
551
|
-
provider: () => "fake",
|
|
552
|
-
id: () => "fake",
|
|
553
|
-
hostPaths: { dir: "dir" },
|
|
554
|
-
buildsAtStart: () => false,
|
|
555
|
-
privileges: () => ({
|
|
556
|
-
root: false,
|
|
557
|
-
capabilities: []
|
|
558
|
-
}),
|
|
559
|
-
create: (sandbox, options) => createFakeSandbox(sandbox, options.env)
|
|
560
|
-
},
|
|
561
|
-
tart: {
|
|
562
|
-
helpers: ["tart"],
|
|
563
|
-
capabilities: {
|
|
564
|
-
platform: "darwin",
|
|
565
|
-
egress: {
|
|
566
|
-
enforce: "none",
|
|
567
|
-
record: true
|
|
568
|
-
},
|
|
569
|
-
brokers: true,
|
|
570
|
-
harnessSession: true,
|
|
571
|
-
isolated: true,
|
|
572
|
-
processTable: false,
|
|
573
|
-
listeners: "lsof",
|
|
574
|
-
images: false,
|
|
575
|
-
preflight: true,
|
|
576
|
-
pluginBuilds: false,
|
|
577
|
-
harnesses: ["cursor"]
|
|
578
|
-
},
|
|
579
|
-
unverifiedHarnesses: "A Tart VM starts from its image as is, so a harness's CLI installs as the attempt starts, for macOS, and only Cursor's bootstrap (an npm package with a macOS build) is written to install that way. Run this one in docker().",
|
|
580
|
-
provider: () => "tart",
|
|
581
|
-
id: (s) => `tart:${idPart(s.image)}`,
|
|
582
|
-
hostPaths: { "ssh.key": "file" },
|
|
583
|
-
buildsAtStart: () => true,
|
|
584
|
-
hostLimit: {
|
|
585
|
-
max: 2,
|
|
586
|
-
why: "macOS runs two macOS VMs at a time"
|
|
587
|
-
},
|
|
588
|
-
privileges: () => ({
|
|
589
|
-
root: false,
|
|
590
|
-
capabilities: []
|
|
591
|
-
}),
|
|
592
|
-
async create(sandbox, options) {
|
|
593
|
-
const { createTartSandbox } = await import("./tart-dWoJvWHc.js");
|
|
594
|
-
return createTartSandbox(sandbox, options);
|
|
595
|
-
},
|
|
596
|
-
async cleanupRun(runId) {
|
|
597
|
-
const { removeRunVms } = await import("./tart-dWoJvWHc.js");
|
|
598
|
-
await removeRunVms(runId);
|
|
599
|
-
}
|
|
600
|
-
},
|
|
601
|
-
boat: {
|
|
602
|
-
helpers: ["boat"],
|
|
603
|
-
capabilities: {
|
|
604
|
-
platform: "linux",
|
|
605
|
-
egress: {
|
|
606
|
-
enforce: "none",
|
|
607
|
-
record: true
|
|
608
|
-
},
|
|
609
|
-
brokers: true,
|
|
610
|
-
harnessSession: true,
|
|
611
|
-
isolated: true,
|
|
612
|
-
processTable: true,
|
|
613
|
-
listeners: "proc",
|
|
614
|
-
images: false,
|
|
615
|
-
preflight: true,
|
|
616
|
-
pluginBuilds: false,
|
|
617
|
-
harnesses: ["cursor"]
|
|
618
|
-
},
|
|
619
|
-
unverifiedHarnesses: "Boat installs a harness's CLI as the attempt starts, through the egress gateway, and the others haven't been verified to start in time that way. They'll run on boat() once its snapshots bake their CLIs in ahead of the run; until then, run this one in docker().",
|
|
620
|
-
provider: () => "boat",
|
|
621
|
-
id: (s) => s.type ? `boat:${s.type}` : "boat",
|
|
622
|
-
hostPaths: {},
|
|
623
|
-
buildsAtStart: () => true,
|
|
624
|
-
privileges: () => ({
|
|
625
|
-
root: false,
|
|
626
|
-
capabilities: []
|
|
627
|
-
}),
|
|
628
|
-
async create(sandbox, options) {
|
|
629
|
-
const { createBoatSandbox } = await import("./boat-DSNgZt-t.js");
|
|
630
|
-
return createBoatSandbox(sandbox, options);
|
|
631
|
-
},
|
|
632
|
-
async capacity(sandbox) {
|
|
633
|
-
const { boatCapacity } = await import("./boat-DSNgZt-t.js");
|
|
634
|
-
const free = await boatCapacity(sandbox);
|
|
635
|
-
if (free === null) return null;
|
|
636
|
-
const machines = Math.max(1, free);
|
|
637
|
-
return {
|
|
638
|
-
cpus: machines,
|
|
639
|
-
memoryBytes: machines * 1e9
|
|
640
|
-
};
|
|
641
|
-
},
|
|
642
|
-
async cleanupRun(runId, sandboxes) {
|
|
643
|
-
if (!sandboxes?.length) return;
|
|
644
|
-
const { removeRunSandboxes } = await import("./boat-DSNgZt-t.js");
|
|
645
|
-
await removeRunSandboxes(runId, sandboxes);
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
};
|
|
649
|
-
const isSandboxKind = (kind) => typeof kind === "string" && Object.hasOwn(SANDBOX_KINDS, kind);
|
|
650
|
-
/** The entry for `sandbox`'s kind. */
|
|
651
|
-
const sandboxKind = (sandbox) => SANDBOX_KINDS[sandbox.kind];
|
|
652
|
-
/** What `sandbox`'s kind can do. */
|
|
653
|
-
const capabilitiesOf = (sandbox) => SANDBOX_KINDS[sandbox.kind].capabilities;
|
|
654
|
-
/** Every helper that makes a sandbox, as a list a message reads: `docker(), podman() or fakeSandbox()`. */
|
|
655
|
-
function sandboxHelpers(which = () => true) {
|
|
656
|
-
const calls = Object.values(SANDBOX_KINDS).filter((k) => which(k.capabilities)).flatMap((k) => k.helpers.map((h) => `${h}()`));
|
|
657
|
-
return calls.length > 1 ? `${calls.slice(0, -1).join(", ")} or ${calls.at(-1)}` : calls[0] ?? "";
|
|
658
|
-
}
|
|
659
|
-
/**
|
|
660
|
-
* Whether a sandbox can run the real harness `harness`, whose bootstrap installs its CLI for
|
|
661
|
-
* `platforms`: it gives the harness a session, keeps the credential out, runs one of them, and
|
|
662
|
-
* has `harness` among the ones it runs.
|
|
663
|
-
*/
|
|
664
|
-
const runsAgent = (harness, platforms) => (c) => c.harnessSession && c.brokers && platforms.includes(c.platform) && takesHarness(c, harness);
|
|
665
|
-
/** Whether a sandbox with `c` runs the real harness `harness`. */
|
|
666
|
-
const takesHarness = (c, harness) => c.harnesses === "all" || c.harnesses.includes(harness);
|
|
667
|
-
/** The first helper of each kind that can, for a fix: `docker()`. */
|
|
668
|
-
const suggestedSandbox = (which) => Object.values(SANDBOX_KINDS).filter((k) => which(k.capabilities)).map((k) => `${k.helpers[0]}()`).join(" or ");
|
|
669
|
-
/** Why `sandbox.maxConcurrent` (in `where`) is wrong, or undefined. */
|
|
670
|
-
function maxConcurrentProblem(sandbox, where) {
|
|
671
|
-
const max = sandbox.maxConcurrent;
|
|
672
|
-
if (max === void 0) return void 0;
|
|
673
|
-
if (!(typeof max === "number" && Number.isInteger(max) && max >= 1)) return `sandbox.maxConcurrent in ${where} must be a whole number of at least 1 (got ${String(max)})`;
|
|
674
|
-
const limit = SANDBOX_KINDS[sandbox.kind].hostLimit;
|
|
675
|
-
if (limit && max > limit.max) return `sandbox.maxConcurrent in ${where} is ${max}, but ${SANDBOX_KINDS[sandbox.kind].helpers[0]}() runs at most ${limit.max} at once: ${limit.why}`;
|
|
676
|
-
}
|
|
677
|
-
/** The cap on `sandbox`'s provider across the run: its `maxConcurrent`, else its kind's limit. */
|
|
678
|
-
const providerLimit = (sandbox) => sandbox.maxConcurrent || SANDBOX_KINDS[sandbox.kind].hostLimit?.max;
|
|
679
|
-
/** What the first of `sandboxes` that runs off the host may use, or null when none does or it doesn't answer. */
|
|
680
|
-
async function sandboxCapacity(sandboxes) {
|
|
681
|
-
for (const sandbox of sandboxes) {
|
|
682
|
-
const kind = sandboxKind(sandbox);
|
|
683
|
-
if (kind.capacity) return kind.capacity(sandbox);
|
|
684
|
-
}
|
|
685
|
-
return null;
|
|
686
|
-
}
|
|
687
|
-
/** Removes what the run left behind: for `sandboxes`, or everything any kind may have started when unset. */
|
|
688
|
-
async function cleanupRun(runId, sandboxes) {
|
|
689
|
-
for (const [name, kind] of Object.entries(SANDBOX_KINDS)) {
|
|
690
|
-
if (!kind.cleanupRun) continue;
|
|
691
|
-
const own = sandboxes?.filter((s) => s.kind === name);
|
|
692
|
-
if (own && !own.length) continue;
|
|
693
|
-
await kind.cleanupRun(runId, own);
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
export { probeScript as _, isSandboxKind as a, tartProblem as b, runsAgent as c, sandboxKind as d, suggestedSandbox as f, parseProbe as g, hostListening as h, idPart as i, sandboxCapacity as l, awaitListening as m, capabilitiesOf as n, maxConcurrentProblem as o, takesHarness as p, cleanupRun as r, providerLimit as s, SANDBOX_KINDS as t, sandboxHelpers as u, servePort as v, tartSandboxSchema as x, checkTartOptions as y };
|
|
697
|
-
|
|
698
|
-
//# sourceMappingURL=kinds-Bh2I35id.js.map
|