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