reeval 0.18.0 → 0.19.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 (380) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_NOTICES.md +5 -5
  3. package/dist/{adapter-CptK032x.js → adapter-C8xPuXYq.js} +5 -4
  4. package/dist/adapter-C8xPuXYq.js.map +1 -0
  5. package/dist/{agent-B63OzUX9.js → agent-CBoLndM7.js} +30 -10
  6. package/dist/{agent-B63OzUX9.js.map → agent-CBoLndM7.js.map} +1 -1
  7. package/dist/agents-C6zhkxp3.js +1151 -0
  8. package/dist/agents-C6zhkxp3.js.map +1 -0
  9. package/dist/{app-files-sgqwfjtn.js → app-files-DT5mJyV4.js} +3 -3
  10. package/dist/app-files-DT5mJyV4.js.map +1 -0
  11. package/dist/assemble-UPCRrtOz.js +1 -0
  12. package/dist/{assemble-Me7Whp-y.js → assemble-t6h018An.js} +152 -129
  13. package/dist/assemble-t6h018An.js.map +1 -0
  14. package/dist/{attempt-Dp7Wtm8M.js → attempt-CAdlwlNu.js} +2 -2
  15. package/dist/{attempt-Dp7Wtm8M.js.map → attempt-CAdlwlNu.js.map} +1 -1
  16. package/dist/{attempt-host-Cik0SoIn.js → attempt-host-CIm1-11m.js} +6 -6
  17. package/dist/{attempt-host-Cik0SoIn.js.map → attempt-host-CIm1-11m.js.map} +1 -1
  18. package/dist/boat-BjLqFJIZ.js +108 -0
  19. package/dist/boat-BjLqFJIZ.js.map +1 -0
  20. package/dist/boat-CJCtzfB1.js +322 -0
  21. package/dist/boat-CJCtzfB1.js.map +1 -0
  22. package/dist/bridge/index.mjs +300 -78
  23. package/dist/capture-DoxFUN3J.js +1 -0
  24. package/dist/{capture-C3RmjPph.js → capture-iBzFiC0j.js} +27 -25
  25. package/dist/capture-iBzFiC0j.js.map +1 -0
  26. package/dist/cases-Dy0mifal.js +1 -0
  27. package/dist/cases-z9E6DCd5.js +639 -0
  28. package/dist/cases-z9E6DCd5.js.map +1 -0
  29. package/dist/{cli-BBOlXKPG.js → cli-20Fpvs5H.js} +442 -707
  30. package/dist/cli-20Fpvs5H.js.map +1 -0
  31. package/dist/{cli-spec-DZ0bnP0_.js → cli-spec-Dsr79Qy1.js} +38 -11
  32. package/dist/cli-spec-Dsr79Qy1.js.map +1 -0
  33. package/dist/cli.js +2 -2
  34. package/dist/{client-tZ2WBDxf.js → client-KM4C5r5_.js} +93 -3
  35. package/dist/client-KM4C5r5_.js.map +1 -0
  36. package/dist/{command-qGS802uX.js → command-B5OyHpOu.js} +21 -80
  37. package/dist/command-B5OyHpOu.js.map +1 -0
  38. package/dist/{command-DhiwsZl1.js → command-BLNVDiIg.js} +9 -9
  39. package/dist/{command-DhiwsZl1.js.map → command-BLNVDiIg.js.map} +1 -1
  40. package/dist/{command-fO0BFsTq.js → command-CRh-cb6Z.js} +37 -37
  41. package/dist/command-CRh-cb6Z.js.map +1 -0
  42. package/dist/{command-CFQ9c1hk.js → command-aUJvENwy.js} +16 -16
  43. package/dist/command-aUJvENwy.js.map +1 -0
  44. package/dist/{commands-CC60TOT5.js → commands-CWy-WndG.js} +186 -85
  45. package/dist/commands-CWy-WndG.js.map +1 -0
  46. package/dist/{commands-xYTMNTPv.js → commands-CfdBX-mc.js} +1 -1
  47. package/dist/{config-C2UtS9vy.js → config-B9mB1kF5.js} +261 -1708
  48. package/dist/config-B9mB1kF5.js.map +1 -0
  49. package/dist/{context-BajfiH0S.js → context-Bkv3ndjq.js} +3 -2
  50. package/dist/context-Bkv3ndjq.js.map +1 -0
  51. package/dist/{cost-BuVDamui.js → cost-BdRgySQl.js} +2 -2
  52. package/dist/{cost-BuVDamui.js.map → cost-BdRgySQl.js.map} +1 -1
  53. package/dist/cost-Cr26Alhq.js +1 -0
  54. package/dist/{cursor-catalog-BTK_apL-.js → cursor-catalog-BSn9xjmo.js} +3 -3
  55. package/dist/{cursor-catalog-BTK_apL-.js.map → cursor-catalog-BSn9xjmo.js.map} +1 -1
  56. package/dist/db-P2fXw4nx.js +2 -0
  57. package/dist/{db-C5SZ0510.js → db-zgC1tvKB.js} +130 -84
  58. package/dist/db-zgC1tvKB.js.map +1 -0
  59. package/dist/debug-CF4p4Lp_.js +1 -0
  60. package/dist/{debug-B5jDImcW.js → debug-CIXzB4wK.js} +2 -2
  61. package/dist/{debug-B5jDImcW.js.map → debug-CIXzB4wK.js.map} +1 -1
  62. package/dist/{default-effort-FEidNAIi.js → default-effort-BAy8ixd1.js} +1 -1
  63. package/dist/{default-effort-BVmx7r7L.js → default-effort-DGhQmu95.js} +4 -4
  64. package/dist/{default-effort-BVmx7r7L.js.map → default-effort-DGhQmu95.js.map} +1 -1
  65. package/dist/{dist-ByYk_wAs.js → dist-CAFD1yfv.js} +28 -6
  66. package/dist/dist-CAFD1yfv.js.map +1 -0
  67. package/dist/{docker-B2F8-PGC.js → docker-Cqw-CyWz.js} +3 -3
  68. package/dist/{docker-B2F8-PGC.js.map → docker-Cqw-CyWz.js.map} +1 -1
  69. package/dist/{docker-Dto8ROCq.js → docker-DAMnm3L9.js} +103 -73
  70. package/dist/docker-DAMnm3L9.js.map +1 -0
  71. package/dist/{docker-BlSopHpZ.js → docker-Dr4XeDc8.js} +1 -1
  72. package/dist/{doctor-BcvfKpBX.js → doctor-B2PohneB.js} +84 -27
  73. package/dist/doctor-B2PohneB.js.map +1 -0
  74. package/dist/{environment-CC1RV21n.js → environment-DB8o3hGi.js} +79 -39
  75. package/dist/environment-DB8o3hGi.js.map +1 -0
  76. package/dist/{errors-BQV__TzH.js → errors-BZgLSZtV.js} +2 -2
  77. package/dist/{errors-BQV__TzH.js.map → errors-BZgLSZtV.js.map} +1 -1
  78. package/dist/{eval-source-CzxdgFBW.js → eval-source-D3sbAzt-.js} +10 -10
  79. package/dist/{eval-source-CzxdgFBW.js.map → eval-source-D3sbAzt-.js.map} +1 -1
  80. package/dist/{evaluate-DToSB2bt.d.ts → evaluate-COdzf7Hl.d.ts} +17 -26
  81. package/dist/{evaluate-NTNJ8T9H.js → evaluate-CwKeN_fo.js} +377 -142
  82. package/dist/evaluate-CwKeN_fo.js.map +1 -0
  83. package/dist/files-B4KQUiM7.js +1 -0
  84. package/dist/files-BEwfjD8J.js +64 -0
  85. package/dist/files-BEwfjD8J.js.map +1 -0
  86. package/dist/{files-DsXULUi5.js → files-BRzV7aPh.js} +5 -5
  87. package/dist/{files-DsXULUi5.js.map → files-BRzV7aPh.js.map} +1 -1
  88. package/dist/{files-aAzoGNCB.js → files-BiFU16BW.js} +5 -5
  89. package/dist/{files-aAzoGNCB.js.map → files-BiFU16BW.js.map} +1 -1
  90. package/dist/files-C1Rk9FYA.js +1 -0
  91. package/dist/files-C3mCC8Mn.js +1 -0
  92. package/dist/{files-CZXrkPja.js → files-Cl7BQ5gE.js} +54 -13
  93. package/dist/{files-CZXrkPja.js.map → files-Cl7BQ5gE.js.map} +1 -1
  94. package/dist/{files-BGlHnC46.js → files-DgXyaAg6.js} +2 -2
  95. package/dist/{files-BGlHnC46.js.map → files-DgXyaAg6.js.map} +1 -1
  96. package/dist/{files-p-uTdOjA.js → files-DlQshsks.js} +3 -2
  97. package/dist/files-DlQshsks.js.map +1 -0
  98. package/dist/files-DnlA1A7N.js +1 -0
  99. package/dist/gate-CgYdaprG.js +49 -0
  100. package/dist/gate-CgYdaprG.js.map +1 -0
  101. package/dist/gateway.d.ts +1 -1
  102. package/dist/{git-C1MB5bjr.js → git-fDiJ8UIV.js} +2 -2
  103. package/dist/{git-C1MB5bjr.js.map → git-fDiJ8UIV.js.map} +1 -1
  104. package/dist/{harness-DGsRZDSo.js → harness-C2berMiM.js} +3 -3
  105. package/dist/{harness-DGsRZDSo.js.map → harness-C2berMiM.js.map} +1 -1
  106. package/dist/{harness-DYSC4zMh.js → harness-DXv2gnaT.js} +4 -2
  107. package/dist/harness-DXv2gnaT.js.map +1 -0
  108. package/dist/harness.d.ts +1 -1
  109. package/dist/harness.js +1 -1
  110. package/dist/{ids-DuK6xl4w.js → ids-C_advdJA.js} +3 -8
  111. package/dist/ids-C_advdJA.js.map +1 -0
  112. package/dist/{images-CNayXCp2.js → images-BNgcR77K.js} +98 -10
  113. package/dist/images-BNgcR77K.js.map +1 -0
  114. package/dist/index.d.ts +23 -3
  115. package/dist/index.js +5 -5
  116. package/dist/init-4RPeD-K-.js +1 -0
  117. package/dist/{init-D5HtmyMI.js → init-DbuZVRrW.js} +7 -6
  118. package/dist/init-DbuZVRrW.js.map +1 -0
  119. package/dist/{ink-list-Ca-5dunO.js → ink-list-BpfidQ1h.js} +121 -31
  120. package/dist/ink-list-BpfidQ1h.js.map +1 -0
  121. package/dist/{invocations-DrGXF9dT.js → invocations-CxGNOlh0.js} +3 -3
  122. package/dist/{invocations-DrGXF9dT.js.map → invocations-CxGNOlh0.js.map} +1 -1
  123. package/dist/judge-COMXT1Hx.js +230 -0
  124. package/dist/judge-COMXT1Hx.js.map +1 -0
  125. package/dist/judge.d.ts +1 -1
  126. package/dist/judge.js +1 -1
  127. package/dist/{judgments-m-mb0zv8.js → judgments-CzgpsTqv.js} +2 -2
  128. package/dist/{judgments-m-mb0zv8.js.map → judgments-CzgpsTqv.js.map} +1 -1
  129. package/dist/kinds-C1oY3qyC.js +697 -0
  130. package/dist/kinds-C1oY3qyC.js.map +1 -0
  131. package/dist/{summary-Uzc9osfV.js → layout-Cm85tQYk.js} +39 -150
  132. package/dist/layout-Cm85tQYk.js.map +1 -0
  133. package/dist/list-DuThsE28.js +1348 -0
  134. package/dist/list-DuThsE28.js.map +1 -0
  135. package/dist/live-CJCK11nh.js +1 -0
  136. package/dist/{live-B71o2TkX.js → live-CgYbO4Te.js} +6 -4
  137. package/dist/{live-B71o2TkX.js.map → live-CgYbO4Te.js.map} +1 -1
  138. package/dist/{live-uRURFDMZ.js → live-CnGrRM6j.js} +7 -7
  139. package/dist/{live-uRURFDMZ.js.map → live-CnGrRM6j.js.map} +1 -1
  140. package/dist/{matchers-Cs8aDqdU.js → matchers-CXLn-1jm.js} +3 -2
  141. package/dist/{matchers-Cs8aDqdU.js.map → matchers-CXLn-1jm.js.map} +1 -1
  142. package/dist/{model-CXVVB4RK.js → model-047Dcd-a.js} +1 -1
  143. package/dist/model-Cv4GuTsZ.js +1 -0
  144. package/dist/{model-1L19Zukh.js → model-CwwkrCb7.js} +5 -5
  145. package/dist/{model-1L19Zukh.js.map → model-CwwkrCb7.js.map} +1 -1
  146. package/dist/{model-BxBWFOZn.js → model-DJjLw-0r.js} +5 -5
  147. package/dist/{model-BxBWFOZn.js.map → model-DJjLw-0r.js.map} +1 -1
  148. package/dist/{model-Ce9l9_rF.js → model-V3mMXp6x.js} +203 -313
  149. package/dist/model-V3mMXp6x.js.map +1 -0
  150. package/dist/{node-DhIRSrrK.js → node-D7pAU--0.js} +14 -10
  151. package/dist/node-D7pAU--0.js.map +1 -0
  152. package/dist/{opencode-providers-Co7plCea.js → opencode-providers-BGiXt8_B.js} +104 -35
  153. package/dist/opencode-providers-BGiXt8_B.js.map +1 -0
  154. package/dist/{openrouter-models-DNvLRYM7.js → openrouter-models-Cw1z8-sq.js} +2 -2
  155. package/dist/{openrouter-models-DNvLRYM7.js.map → openrouter-models-Cw1z8-sq.js.map} +1 -1
  156. package/dist/options-CHubslQf.js +1 -0
  157. package/dist/{gate-Cp_pQoEe.js → pairs-BGb134Vu.js} +2 -48
  158. package/dist/pairs-BGb134Vu.js.map +1 -0
  159. package/dist/{patch-ug5HpMOj.js → patch-DH4e_Gkd.js} +2 -2
  160. package/dist/{patch-ug5HpMOj.js.map → patch-DH4e_Gkd.js.map} +1 -1
  161. package/dist/plain-BYUf_fUV.js +267 -0
  162. package/dist/plain-BYUf_fUV.js.map +1 -0
  163. package/dist/{plan-DqnzfDH1.js → plan-Cgq9NCEX.js} +110 -39
  164. package/dist/plan-Cgq9NCEX.js.map +1 -0
  165. package/dist/{plugins-B2KQ0y3P.js → plugins-BkmPxDiY.js} +10 -267
  166. package/dist/plugins-BkmPxDiY.js.map +1 -0
  167. package/dist/preflight-4gWSy0Pe.js +1 -0
  168. package/dist/{preflight-DyzmvK7i.js → preflight-BElE_q0u.js} +16 -9
  169. package/dist/preflight-BElE_q0u.js.map +1 -0
  170. package/dist/preflight-CtlloeOQ.js +68 -0
  171. package/dist/preflight-CtlloeOQ.js.map +1 -0
  172. package/dist/{preflight-DVXEvzFU.js → preflight-R-InZCQb.js} +1 -1
  173. package/dist/{prepare-21WMQZyt.js → prepare-C7f5mPl5.js} +9 -9
  174. package/dist/{prepare-21WMQZyt.js.map → prepare-C7f5mPl5.js.map} +1 -1
  175. package/dist/{prepare-BcSRa7-3.js → prepare-CzkAdbXm.js} +2 -2
  176. package/dist/{prices-DYJA0tJN.js → prices-5m3SzMZ3.js} +2 -2
  177. package/dist/{prices-DYJA0tJN.js.map → prices-5m3SzMZ3.js.map} +1 -1
  178. package/dist/{provenance-iRxjp4Pu.js → provenance-zsc4--dP.js} +4 -3
  179. package/dist/provenance-zsc4--dP.js.map +1 -0
  180. package/dist/provider-BnUoz4KB.js +1 -0
  181. package/dist/{provider-DZd8t_XW.js → provider-BxzZq3Th.js} +2 -2
  182. package/dist/{provider-DZd8t_XW.js.map → provider-BxzZq3Th.js.map} +1 -1
  183. package/dist/{providers-vXMXuwn-.js → providers-B8xYMeah.js} +152 -9
  184. package/dist/providers-B8xYMeah.js.map +1 -0
  185. package/dist/providers-CVu8e0xS.js +1 -0
  186. package/dist/{query-BhaKQ07P.js → query-Bb3SYICk.js} +2 -2
  187. package/dist/{query-BhaKQ07P.js.map → query-Bb3SYICk.js.map} +1 -1
  188. package/dist/query-DIfkUcPh.js +1 -0
  189. package/dist/{questions-BzdLdV3C.js → questions-CWlR9ffu.js} +9 -9
  190. package/dist/{questions-BzdLdV3C.js.map → questions-CWlR9ffu.js.map} +1 -1
  191. package/dist/{record-DhzwkSXc.js → record-6IUzwP9K.js} +5 -3
  192. package/dist/record-6IUzwP9K.js.map +1 -0
  193. package/dist/{remarks-NMgPd30U.js → remarks-DPCONFxZ.js} +71 -50
  194. package/dist/remarks-DPCONFxZ.js.map +1 -0
  195. package/dist/{remarks-CauU408t.js → remarks-vtkPmQb9.js} +115 -35
  196. package/dist/remarks-vtkPmQb9.js.map +1 -0
  197. package/dist/{remote-Dwy3fyo3.js → remote-BgYWqogI.js} +6 -6
  198. package/dist/{remote-Dwy3fyo3.js.map → remote-BgYWqogI.js.map} +1 -1
  199. package/dist/{resolve-B1zMnPwK.js → resolve-Do0ZaYH6.js} +10 -9
  200. package/dist/resolve-Do0ZaYH6.js.map +1 -0
  201. package/dist/resolve-amw_2Odz.js +1 -0
  202. package/dist/{results-CfC0id_u.js → results-JyuM64gy.js} +6 -6
  203. package/dist/{results-CfC0id_u.js.map → results-JyuM64gy.js.map} +1 -1
  204. package/dist/{resume-Dkhrpjow.js → resume-AW5oXzUc.js} +169 -27
  205. package/dist/resume-AW5oXzUc.js.map +1 -0
  206. package/dist/retry-ChzISxmy.js +105 -0
  207. package/dist/retry-ChzISxmy.js.map +1 -0
  208. package/dist/{runtime-DcvQcr36.js → runtime-BpW1f1Mx.js} +26 -7
  209. package/dist/runtime-BpW1f1Mx.js.map +1 -0
  210. package/dist/sandbox/boat.d.ts +26 -0
  211. package/dist/sandbox/boat.js +37 -0
  212. package/dist/sandbox/boat.js.map +1 -0
  213. package/dist/{sandbox-8zCrtuCf.js → sandbox-kSgr7vo5.js} +31 -3
  214. package/dist/sandbox-kSgr7vo5.js.map +1 -0
  215. package/dist/sandbox.d.ts +20 -2
  216. package/dist/sandbox.js +1 -1
  217. package/dist/server-2_gUnVvf.js +1 -0
  218. package/dist/{server-Dplq8g0r.js → server-Cn8VqO9S.js} +9 -9
  219. package/dist/{server-Dplq8g0r.js.map → server-Cn8VqO9S.js.map} +1 -1
  220. package/dist/{shared-ogqPJ0uo.js → shared-Cfi45Bvy.js} +9 -2
  221. package/dist/shared-Cfi45Bvy.js.map +1 -0
  222. package/dist/slug-IHh3f770.js +136 -0
  223. package/dist/slug-IHh3f770.js.map +1 -0
  224. package/dist/source-CY3etKzw.js +1 -0
  225. package/dist/{source-NWHqn5-o.js → source-CYOhR98B.js} +2 -2
  226. package/dist/{source-NWHqn5-o.js.map → source-CYOhR98B.js.map} +1 -1
  227. package/dist/src-6Zzyg4Qd.js +2 -0
  228. package/dist/{src-B9oE_mNS.js → src-BDhcPtnI.js} +2 -2
  229. package/dist/{src-B-L8O1Ld.js → src-BNQznj4z.js} +2 -2
  230. package/dist/{src-B-L8O1Ld.js.map → src-BNQznj4z.js.map} +1 -1
  231. package/dist/src-BRMsk9nh.js +2 -0
  232. package/dist/{src-BQXdf-Gw.js → src-CV_7DkPa.js} +47 -45
  233. package/dist/{src-BQXdf-Gw.js.map → src-CV_7DkPa.js.map} +1 -1
  234. package/dist/{src-KlDOGD0B.js → src-Cb2MWozp.js} +3 -1
  235. package/dist/{src-KlDOGD0B.js.map → src-Cb2MWozp.js.map} +1 -1
  236. package/dist/{src-BQ6BiXoc.js → src-Ck2r_EMT.js} +607 -72
  237. package/dist/src-Ck2r_EMT.js.map +1 -0
  238. package/dist/{src-HTG2SoNz.js → src-DAzaCTcN.js} +2 -2
  239. package/dist/{src-HTG2SoNz.js.map → src-DAzaCTcN.js.map} +1 -1
  240. package/dist/src-DB7N8TYJ.js +2 -0
  241. package/dist/src-DPDaAYwh.js +2 -0
  242. package/dist/{src-CUpoVVb8.js → src-Dbk19BiP.js} +2 -2
  243. package/dist/src-DtodMT59.js +1 -0
  244. package/dist/{src-uluei5nU.js → src-DvGns8cz.js} +2 -2
  245. package/dist/{src-uluei5nU.js.map → src-DvGns8cz.js.map} +1 -1
  246. package/dist/{src-B_igzM1O.js → src-Dw79VLa3.js} +3 -1
  247. package/dist/{src-B_igzM1O.js.map → src-Dw79VLa3.js.map} +1 -1
  248. package/dist/{src-D5t4OiRt.js → src-KxS91P7L.js} +3 -1
  249. package/dist/{src-D5t4OiRt.js.map → src-KxS91P7L.js.map} +1 -1
  250. package/dist/src-T-OeuJLr.js +2 -0
  251. package/dist/{src-BvM0jWuZ.js → src-YvblOrBU.js} +2 -2
  252. package/dist/{src-BvM0jWuZ.js.map → src-YvblOrBU.js.map} +1 -1
  253. package/dist/src-zntEDlnx.js +3 -0
  254. package/dist/{state-DDCGUhva.js → state-BOLt8pJg.js} +17 -17
  255. package/dist/{state-DDCGUhva.js.map → state-BOLt8pJg.js.map} +1 -1
  256. package/dist/state-kimtIhBP.js +1 -0
  257. package/dist/suite-CKBa6MKt.js +2 -0
  258. package/dist/{suite-M8_7xio7.js → suite-COglUhPd.js} +70 -92
  259. package/dist/suite-COglUhPd.js.map +1 -0
  260. package/dist/summary-DU5zaibx.js +148 -0
  261. package/dist/summary-DU5zaibx.js.map +1 -0
  262. package/dist/tart-BTVXp8rz.js +373 -0
  263. package/dist/tart-BTVXp8rz.js.map +1 -0
  264. package/dist/tart-cli-BIC9HqPg.js +37 -0
  265. package/dist/tart-cli-BIC9HqPg.js.map +1 -0
  266. package/dist/tart-cli-BMrkmBjI.js +1 -0
  267. package/dist/tart-images-DZ_Mbh-g.js +233 -0
  268. package/dist/tart-images-DZ_Mbh-g.js.map +1 -0
  269. package/dist/tart-ref-7Qv3cm3B.js +1 -0
  270. package/dist/tart-ref-DYZijjrU.js +55 -0
  271. package/dist/tart-ref-DYZijjrU.js.map +1 -0
  272. package/dist/testing.d.ts +2 -2
  273. package/dist/testing.js +4 -4
  274. package/dist/trace-Dx2NBE1O.js +311 -0
  275. package/dist/trace-Dx2NBE1O.js.map +1 -0
  276. package/dist/traits-DKnYkqeK.js +66 -0
  277. package/dist/traits-DKnYkqeK.js.map +1 -0
  278. package/dist/{transcript-Cg4SeqRX.js → transcript-CCf07UmU.js} +2 -2
  279. package/dist/{transcript-Cg4SeqRX.js.map → transcript-CCf07UmU.js.map} +1 -1
  280. package/dist/{types-C4OkYhZg.js → types-C2mLpph3.js} +3 -2
  281. package/dist/types-C2mLpph3.js.map +1 -0
  282. package/dist/{types-DGvexkcp.d.ts → types-DBwFsGem.d.ts} +352 -76
  283. package/dist/{judge-DYOF69Oe.js → vercel-CGlSBv63.js} +3 -229
  284. package/dist/vercel-CGlSBv63.js.map +1 -0
  285. package/dist/{vertex-BLQMayc1.js → vertex-Eb2wqahk.js} +2 -2
  286. package/dist/{vertex-BLQMayc1.js.map → vertex-Eb2wqahk.js.map} +1 -1
  287. package/dist/vertex-O88TCwgY.js +1 -0
  288. package/dist/view/index.d.ts +101 -58
  289. package/dist/view/index.js +9 -8
  290. package/dist/{views-BISrsIjw.js → views-DAIiLiV3.js} +7 -6
  291. package/dist/views-DAIiLiV3.js.map +1 -0
  292. package/dist/views-DtRhj2Tn.js +2 -0
  293. package/dist/{worker-entry-DJD_nHkS.js → worker-entry-BIROTPX1.js} +11 -8
  294. package/dist/{worker-entry-DJD_nHkS.js.map → worker-entry-BIROTPX1.js.map} +1 -1
  295. package/dist/workspace-CcQRT31C.js +1 -0
  296. package/dist/{workspace-BO1VhUR9.js → workspace-uuE51x35.js} +6 -6
  297. package/dist/{workspace-BO1VhUR9.js.map → workspace-uuE51x35.js.map} +1 -1
  298. package/package.json +24 -11
  299. package/skills/eval-rubric/SKILL.md +15 -7
  300. package/dist/adapter-CptK032x.js.map +0 -1
  301. package/dist/app-files-sgqwfjtn.js.map +0 -1
  302. package/dist/assemble-CxBHkavM.js +0 -1
  303. package/dist/assemble-Me7Whp-y.js.map +0 -1
  304. package/dist/capture-C3RmjPph.js.map +0 -1
  305. package/dist/capture-YPwxp_iK.js +0 -1
  306. package/dist/cli-BBOlXKPG.js.map +0 -1
  307. package/dist/cli-spec-DZ0bnP0_.js.map +0 -1
  308. package/dist/client-tZ2WBDxf.js.map +0 -1
  309. package/dist/command-CFQ9c1hk.js.map +0 -1
  310. package/dist/command-fO0BFsTq.js.map +0 -1
  311. package/dist/command-qGS802uX.js.map +0 -1
  312. package/dist/commands-CC60TOT5.js.map +0 -1
  313. package/dist/config-C2UtS9vy.js.map +0 -1
  314. package/dist/context-BajfiH0S.js.map +0 -1
  315. package/dist/contrasts-BjOg7wyr.js +0 -101
  316. package/dist/contrasts-BjOg7wyr.js.map +0 -1
  317. package/dist/cost-BJU0MAji.js +0 -1
  318. package/dist/db-C5SZ0510.js.map +0 -1
  319. package/dist/db-puzLzX4k.js +0 -2
  320. package/dist/debug-BnXV7JbX.js +0 -1
  321. package/dist/dist-ByYk_wAs.js.map +0 -1
  322. package/dist/docker-Dto8ROCq.js.map +0 -1
  323. package/dist/doctor-BcvfKpBX.js.map +0 -1
  324. package/dist/environment-CC1RV21n.js.map +0 -1
  325. package/dist/evaluate-NTNJ8T9H.js.map +0 -1
  326. package/dist/files-COW5JBJM.js +0 -1
  327. package/dist/files-DFtuRQJx.js +0 -1
  328. package/dist/files-oOYNR7ZH.js +0 -1
  329. package/dist/files-p-uTdOjA.js.map +0 -1
  330. package/dist/gate-Cp_pQoEe.js.map +0 -1
  331. package/dist/harness-DYSC4zMh.js.map +0 -1
  332. package/dist/ids-DuK6xl4w.js.map +0 -1
  333. package/dist/images-CNayXCp2.js.map +0 -1
  334. package/dist/init-8o6W3_fn.js +0 -1
  335. package/dist/init-D5HtmyMI.js.map +0 -1
  336. package/dist/ink-list-Ca-5dunO.js.map +0 -1
  337. package/dist/judge-DYOF69Oe.js.map +0 -1
  338. package/dist/list-CM_YSJXq.js +0 -374
  339. package/dist/list-CM_YSJXq.js.map +0 -1
  340. package/dist/live-DQc8jr6o.js +0 -1
  341. package/dist/model-Ce9l9_rF.js.map +0 -1
  342. package/dist/model-Cxzo4cjw.js +0 -1
  343. package/dist/node-DhIRSrrK.js.map +0 -1
  344. package/dist/opencode-providers-Co7plCea.js.map +0 -1
  345. package/dist/plan-DqnzfDH1.js.map +0 -1
  346. package/dist/plugins-B2KQ0y3P.js.map +0 -1
  347. package/dist/preflight-DyzmvK7i.js.map +0 -1
  348. package/dist/provenance-iRxjp4Pu.js.map +0 -1
  349. package/dist/provider-DCdTHQpk.js +0 -1
  350. package/dist/providers-D0ob_tra.js +0 -1
  351. package/dist/providers-vXMXuwn-.js.map +0 -1
  352. package/dist/query-CvgUsvep.js +0 -1
  353. package/dist/record-DhzwkSXc.js.map +0 -1
  354. package/dist/remarks-CauU408t.js.map +0 -1
  355. package/dist/remarks-NMgPd30U.js.map +0 -1
  356. package/dist/resolve-B1zMnPwK.js.map +0 -1
  357. package/dist/resolve-BIIeVT12.js +0 -1
  358. package/dist/resume-Dkhrpjow.js.map +0 -1
  359. package/dist/runtime-DcvQcr36.js.map +0 -1
  360. package/dist/sandbox-8zCrtuCf.js.map +0 -1
  361. package/dist/server-0tuj8VSa.js +0 -1
  362. package/dist/shared-ogqPJ0uo.js.map +0 -1
  363. package/dist/source-llwLewOU.js +0 -1
  364. package/dist/src-BQ6BiXoc.js.map +0 -1
  365. package/dist/src-BXnv0ViU.js +0 -2
  366. package/dist/src-BiS8YNN_.js +0 -3
  367. package/dist/src-BkH4GOxu.js +0 -1
  368. package/dist/src-C-tH5ebd.js +0 -2
  369. package/dist/src-Cg1bFs9g.js +0 -2
  370. package/dist/src-DV_UorZv.js +0 -2
  371. package/dist/src-XxUpr2sa.js +0 -2
  372. package/dist/state-DZbAO95a.js +0 -1
  373. package/dist/suite-M8_7xio7.js.map +0 -1
  374. package/dist/suite-u2KJnGpY.js +0 -2
  375. package/dist/summary-Uzc9osfV.js.map +0 -1
  376. package/dist/types-C4OkYhZg.js.map +0 -1
  377. package/dist/vertex-h_peaZTN.js +0 -1
  378. package/dist/views-BISrsIjw.js.map +0 -1
  379. package/dist/views-Bfab8fM9.js +0 -2
  380. package/dist/workspace-B8EOCuxl.js +0 -1
@@ -0,0 +1,697 @@
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 { R as DOCKER_EGRESS, vt as run, yt as shellQuote } from "./src-Ck2r_EMT.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-Dr4XeDc8.js");
523
+ return createDockerSandbox(sandbox, options);
524
+ },
525
+ async capacity(sandbox) {
526
+ const { dockerCapacity } = await import("./src-DtodMT59.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-Dr4XeDc8.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: false,
571
+ isolated: true,
572
+ processTable: false,
573
+ listeners: "lsof",
574
+ images: false,
575
+ preflight: true,
576
+ pluginBuilds: false,
577
+ harnesses: "all"
578
+ },
579
+ provider: () => "tart",
580
+ id: (s) => `tart:${idPart(s.image)}`,
581
+ hostPaths: { "ssh.key": "file" },
582
+ buildsAtStart: () => true,
583
+ hostLimit: {
584
+ max: 2,
585
+ why: "macOS runs two macOS VMs at a time"
586
+ },
587
+ privileges: () => ({
588
+ root: false,
589
+ capabilities: []
590
+ }),
591
+ async create(sandbox, options) {
592
+ const { createTartSandbox } = await import("./tart-BTVXp8rz.js");
593
+ return createTartSandbox(sandbox, options);
594
+ },
595
+ async cleanupRun(runId) {
596
+ const { removeRunVms } = await import("./tart-BTVXp8rz.js");
597
+ await removeRunVms(runId);
598
+ }
599
+ },
600
+ boat: {
601
+ helpers: ["boat"],
602
+ capabilities: {
603
+ platform: "linux",
604
+ egress: {
605
+ enforce: "none",
606
+ record: true
607
+ },
608
+ brokers: true,
609
+ harnessSession: true,
610
+ isolated: true,
611
+ processTable: true,
612
+ listeners: "proc",
613
+ images: false,
614
+ preflight: true,
615
+ pluginBuilds: false,
616
+ harnesses: ["cursor"]
617
+ },
618
+ 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().",
619
+ provider: () => "boat",
620
+ id: (s) => s.type ? `boat:${s.type}` : "boat",
621
+ hostPaths: {},
622
+ buildsAtStart: () => true,
623
+ privileges: () => ({
624
+ root: false,
625
+ capabilities: []
626
+ }),
627
+ async create(sandbox, options) {
628
+ const { createBoatSandbox } = await import("./boat-CJCtzfB1.js");
629
+ return createBoatSandbox(sandbox, options);
630
+ },
631
+ async capacity(sandbox) {
632
+ const { boatCapacity } = await import("./boat-CJCtzfB1.js");
633
+ const free = await boatCapacity(sandbox);
634
+ if (free === null) return null;
635
+ const machines = Math.max(1, free);
636
+ return {
637
+ cpus: machines,
638
+ memoryBytes: machines * 1e9
639
+ };
640
+ },
641
+ async cleanupRun(runId, sandboxes) {
642
+ if (!sandboxes?.length) return;
643
+ const { removeRunSandboxes } = await import("./boat-CJCtzfB1.js");
644
+ await removeRunSandboxes(runId, sandboxes);
645
+ }
646
+ }
647
+ };
648
+ const isSandboxKind = (kind) => typeof kind === "string" && Object.hasOwn(SANDBOX_KINDS, kind);
649
+ /** The entry for `sandbox`'s kind. */
650
+ const sandboxKind = (sandbox) => SANDBOX_KINDS[sandbox.kind];
651
+ /** What `sandbox`'s kind can do. */
652
+ const capabilitiesOf = (sandbox) => SANDBOX_KINDS[sandbox.kind].capabilities;
653
+ /** Every helper that makes a sandbox, as a list a message reads: `docker(), podman() or fakeSandbox()`. */
654
+ function sandboxHelpers(which = () => true) {
655
+ const calls = Object.values(SANDBOX_KINDS).filter((k) => which(k.capabilities)).flatMap((k) => k.helpers.map((h) => `${h}()`));
656
+ return calls.length > 1 ? `${calls.slice(0, -1).join(", ")} or ${calls.at(-1)}` : calls[0] ?? "";
657
+ }
658
+ /**
659
+ * Whether a sandbox can run the real harness `harness`, whose bootstrap installs its CLI for
660
+ * `platforms`: it gives the harness a session, keeps the credential out, runs one of them, and
661
+ * has `harness` among the ones it runs.
662
+ */
663
+ const runsAgent = (harness, platforms) => (c) => c.harnessSession && c.brokers && platforms.includes(c.platform) && takesHarness(c, harness);
664
+ /** Whether a sandbox with `c` runs the real harness `harness`. */
665
+ const takesHarness = (c, harness) => c.harnesses === "all" || c.harnesses.includes(harness);
666
+ /** The first helper of each kind that can, for a fix: `docker()`. */
667
+ const suggestedSandbox = (which) => Object.values(SANDBOX_KINDS).filter((k) => which(k.capabilities)).map((k) => `${k.helpers[0]}()`).join(" or ");
668
+ /** Why `sandbox.maxConcurrent` (in `where`) is wrong, or undefined. */
669
+ function maxConcurrentProblem(sandbox, where) {
670
+ const max = sandbox.maxConcurrent;
671
+ if (max === void 0) return void 0;
672
+ 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)})`;
673
+ const limit = SANDBOX_KINDS[sandbox.kind].hostLimit;
674
+ 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}`;
675
+ }
676
+ /** The cap on `sandbox`'s provider across the run: its `maxConcurrent`, else its kind's limit. */
677
+ const providerLimit = (sandbox) => sandbox.maxConcurrent || SANDBOX_KINDS[sandbox.kind].hostLimit?.max;
678
+ /** What the first of `sandboxes` that runs off the host may use, or null when none does or it doesn't answer. */
679
+ async function sandboxCapacity(sandboxes) {
680
+ for (const sandbox of sandboxes) {
681
+ const kind = sandboxKind(sandbox);
682
+ if (kind.capacity) return kind.capacity(sandbox);
683
+ }
684
+ return null;
685
+ }
686
+ /** Removes what the run left behind: for `sandboxes`, or everything any kind may have started when unset. */
687
+ async function cleanupRun(runId, sandboxes) {
688
+ for (const [name, kind] of Object.entries(SANDBOX_KINDS)) {
689
+ if (!kind.cleanupRun) continue;
690
+ const own = sandboxes?.filter((s) => s.kind === name);
691
+ if (own && !own.length) continue;
692
+ await kind.cleanupRun(runId, own);
693
+ }
694
+ }
695
+ 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 };
696
+
697
+ //# sourceMappingURL=kinds-C1oY3qyC.js.map