reeval 0.20.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (481) hide show
  1. package/CHANGELOG.md +841 -0
  2. package/README.md +15 -15
  3. package/assets/gateway-models.mjs +65 -31
  4. package/dist/{adapter-C60z3wLq.js → adapter-Di9H2etg.js} +8 -49
  5. package/dist/adapter-Di9H2etg.js.map +1 -0
  6. package/dist/{agent-BmsMXZXx.js → agent-B-6GFDqA.js} +185 -38
  7. package/dist/agent-B-6GFDqA.js.map +1 -0
  8. package/dist/{agents-DXuFxtGC.js → agents-KBTYhSSh.js} +385 -116
  9. package/dist/agents-KBTYhSSh.js.map +1 -0
  10. package/dist/{app-files-DT5mJyV4.js → app-files-Cmh9FGr5.js} +3 -3
  11. package/dist/app-files-Cmh9FGr5.js.map +1 -0
  12. package/dist/{assemble-CE4pHKIa.js → assemble-CBMRIhso.js} +1 -1
  13. package/dist/{assemble-DM2PNU4R.js → assemble-DNVBTBp_.js} +172 -18
  14. package/dist/assemble-DNVBTBp_.js.map +1 -0
  15. package/dist/attach-EbDGKGTO.js +152 -0
  16. package/dist/attach-EbDGKGTO.js.map +1 -0
  17. package/dist/{attempt-CAdlwlNu.js → attempt-_dUsblVx.js} +2 -2
  18. package/dist/{attempt-CAdlwlNu.js.map → attempt-_dUsblVx.js.map} +1 -1
  19. package/dist/{attempt-host-7VviAJrl.js → attempt-host-DQvynDHk.js} +17 -8
  20. package/dist/attempt-host-DQvynDHk.js.map +1 -0
  21. package/dist/boat-Bzz8L-KQ.js +701 -0
  22. package/dist/boat-Bzz8L-KQ.js.map +1 -0
  23. package/dist/{boat-BjLqFJIZ.js → boat-Dek8ftIt.js} +20 -8
  24. package/dist/boat-Dek8ftIt.js.map +1 -0
  25. package/dist/bridge/index.mjs +6 -1
  26. package/dist/bundle-DZstHDeW.js +718 -0
  27. package/dist/bundle-DZstHDeW.js.map +1 -0
  28. package/dist/{capture-Ccf0Hmyx.js → capture-BkbPsfej.js} +61 -32
  29. package/dist/capture-BkbPsfej.js.map +1 -0
  30. package/dist/capture-CUAvk9KM.js +1 -0
  31. package/dist/{cases-z9E6DCd5.js → cases-CM-MQRQp.js} +133 -19
  32. package/dist/cases-CM-MQRQp.js.map +1 -0
  33. package/dist/cases-FvhbM8M5.js +1 -0
  34. package/dist/{cli-DTuLSlmW.js → cli-BgBBuxxJ.js} +412 -1044
  35. package/dist/cli-BgBBuxxJ.js.map +1 -0
  36. package/dist/{cli-spec-Dsr79Qy1.js → cli-spec-B5L9n-DV.js} +199 -35
  37. package/dist/cli-spec-B5L9n-DV.js.map +1 -0
  38. package/dist/cli.js +2 -2
  39. package/dist/client-DMEYR3MA.js +807 -0
  40. package/dist/client-DMEYR3MA.js.map +1 -0
  41. package/dist/{command-C2C7P5qo.js → command-BKb8eN_X.js} +10 -10
  42. package/dist/{command-C2C7P5qo.js.map → command-BKb8eN_X.js.map} +1 -1
  43. package/dist/{command-DSL7I-SI.js → command-D_w_kDpI.js} +25 -21
  44. package/dist/command-D_w_kDpI.js.map +1 -0
  45. package/dist/{command-Ff0T-1Hi.js → command-Dwlh0Vhu.js} +17 -16
  46. package/dist/command-Dwlh0Vhu.js.map +1 -0
  47. package/dist/{command-D8oMB2fa.js → command-loXH2jHr.js} +16 -16
  48. package/dist/{command-D8oMB2fa.js.map → command-loXH2jHr.js.map} +1 -1
  49. package/dist/{commands-xAOi_VEk.js → commands-Cuf57OYb.js} +174 -40
  50. package/dist/commands-Cuf57OYb.js.map +1 -0
  51. package/dist/{commands-Bk9NG1s_.js → commands-Dqli45sR.js} +1 -1
  52. package/dist/{config-SvK8pjEK.js → config-C0RKt00M.js} +288 -106
  53. package/dist/config-C0RKt00M.js.map +1 -0
  54. package/dist/{context-BdgCao9Q.js → context-DrEAtUyg.js} +2 -2
  55. package/dist/{context-BdgCao9Q.js.map → context-DrEAtUyg.js.map} +1 -1
  56. package/dist/{cost-BdRgySQl.js → cost-C21gGrju.js} +19 -9
  57. package/dist/cost-C21gGrju.js.map +1 -0
  58. package/dist/cost-IM80LyGD.js +1 -0
  59. package/dist/{cursor-catalog-DEzan4IT.js → cursor-catalog-CRsFxorF.js} +4 -4
  60. package/dist/{cursor-catalog-DEzan4IT.js.map → cursor-catalog-CRsFxorF.js.map} +1 -1
  61. package/dist/db-3o8s2EyD.js +2 -0
  62. package/dist/{db-BzOJ4Js4.js → db-ErnJ-gMD.js} +168 -248
  63. package/dist/db-ErnJ-gMD.js.map +1 -0
  64. package/dist/debug-CIXzB4wK.js.map +1 -1
  65. package/dist/{default-effort-BDKIxJyC.js → default-effort-D70cTG00.js} +4 -4
  66. package/dist/{default-effort-BDKIxJyC.js.map → default-effort-D70cTG00.js.map} +1 -1
  67. package/dist/{default-effort-BBDPbJ4D.js → default-effort-DHzj84dD.js} +1 -1
  68. package/dist/{dist-Db7ifchA.js → dist-DeqeCUZe.js} +5 -5
  69. package/dist/{dist-Db7ifchA.js.map → dist-DeqeCUZe.js.map} +1 -1
  70. package/dist/{docker-DFrjoNs-.js → docker-CFWzZOEk.js} +4 -4
  71. package/dist/{docker-DFrjoNs-.js.map → docker-CFWzZOEk.js.map} +1 -1
  72. package/dist/docker-DrMnpL84.js +1 -0
  73. package/dist/{doctor-DWK4ttex.js → doctor-B7utCSdh.js} +121 -100
  74. package/dist/doctor-B7utCSdh.js.map +1 -0
  75. package/dist/{environment-cPMCOk-h.js → environment-C0Gg8kyN.js} +49 -11
  76. package/dist/environment-C0Gg8kyN.js.map +1 -0
  77. package/dist/{errors-BZgLSZtV.js → errors-C1GBcWE2.js} +2 -2
  78. package/dist/{errors-BZgLSZtV.js.map → errors-C1GBcWE2.js.map} +1 -1
  79. package/dist/{eval-source-C9b1h8L6.js → eval-source-CsW5VIXS.js} +24 -12
  80. package/dist/eval-source-CsW5VIXS.js.map +1 -0
  81. package/dist/{evaluate-B12Tosvq.js → evaluate-BHQyAszQ.js} +679 -142
  82. package/dist/evaluate-BHQyAszQ.js.map +1 -0
  83. package/dist/{evaluate-COdzf7Hl.d.ts → evaluate-DzHq4EsU.d.ts} +2 -2
  84. package/dist/fake-bootstrap-VpisF1WE.js +15 -0
  85. package/dist/fake-bootstrap-VpisF1WE.js.map +1 -0
  86. package/dist/{files-tiNWe8Ih.js → files-BCraBodb.js} +3 -3
  87. package/dist/{files-tiNWe8Ih.js.map → files-BCraBodb.js.map} +1 -1
  88. package/dist/files-BjOJw4sn.js +1 -0
  89. package/dist/{files-DgXyaAg6.js → files-BrGVs4gY.js} +2 -2
  90. package/dist/{files-DgXyaAg6.js.map → files-BrGVs4gY.js.map} +1 -1
  91. package/dist/{files-BOBdC0uI.js → files-BuKWZCzY.js} +6 -6
  92. package/dist/{files-BOBdC0uI.js.map → files-BuKWZCzY.js.map} +1 -1
  93. package/dist/files-CAzVG3Rr.js +1 -0
  94. package/dist/{files-F5EG0WPT.js → files-Cv856jLN.js} +5 -5
  95. package/dist/{files-F5EG0WPT.js.map → files-Cv856jLN.js.map} +1 -1
  96. package/dist/files-D-Lir4aE.js +1 -0
  97. package/dist/files-DRlJ0Xr2.js +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/{files-s28a6czq.js → files-qjeqXnfE.js} +143 -20
  101. package/dist/files-qjeqXnfE.js.map +1 -0
  102. package/dist/gateway.d.ts +1 -1
  103. package/dist/{git-BpoqEgDV.js → git-DOrOtAiD.js} +3 -3
  104. package/dist/{git-BpoqEgDV.js.map → git-DOrOtAiD.js.map} +1 -1
  105. package/dist/{harness-DXv2gnaT.js → harness-FcTyyPco.js} +17 -8
  106. package/dist/harness-FcTyyPco.js.map +1 -0
  107. package/dist/harness-install-Dxho1yaU.js +53 -0
  108. package/dist/harness-install-Dxho1yaU.js.map +1 -0
  109. package/dist/{harness-C2berMiM.js → harness-nwnyghJZ.js} +14 -11
  110. package/dist/{harness-C2berMiM.js.map → harness-nwnyghJZ.js.map} +1 -1
  111. package/dist/harness.d.ts +11 -8
  112. package/dist/harness.js +1 -1
  113. package/dist/{ids-C_advdJA.js → ids-B-JKTCP8.js} +2 -2
  114. package/dist/{ids-C_advdJA.js.map → ids-B-JKTCP8.js.map} +1 -1
  115. package/dist/{images-D2jFze2v.js → images-Ch1y1t6_.js} +122 -73
  116. package/dist/images-Ch1y1t6_.js.map +1 -0
  117. package/dist/index.d.ts +46 -7
  118. package/dist/index.js +6 -6
  119. package/dist/{init-Bi1Q3lRi.js → init-C2HqCwnt.js} +33 -14
  120. package/dist/init-C2HqCwnt.js.map +1 -0
  121. package/dist/init-CM9xwyre.js +1 -0
  122. package/dist/{ink-list-BpfidQ1h.js → ink-list-BbKXElcQ.js} +54 -15
  123. package/dist/ink-list-BbKXElcQ.js.map +1 -0
  124. package/dist/inputs-5UIDpjz-.js +190 -0
  125. package/dist/inputs-5UIDpjz-.js.map +1 -0
  126. package/dist/inputs-load-C82HOKnb.js +1 -0
  127. package/dist/inputs-load-CGPyigMC.js +95 -0
  128. package/dist/inputs-load-CGPyigMC.js.map +1 -0
  129. package/dist/{invocations-CxGNOlh0.js → invocations-BrZAMuTb.js} +5 -5
  130. package/dist/{invocations-CxGNOlh0.js.map → invocations-BrZAMuTb.js.map} +1 -1
  131. package/dist/jiti-radm1Soi.js +52 -0
  132. package/dist/jiti-radm1Soi.js.map +1 -0
  133. package/dist/{judge-COMXT1Hx.js → judge-DwzqucLS.js} +17 -12
  134. package/dist/{judge-COMXT1Hx.js.map → judge-DwzqucLS.js.map} +1 -1
  135. package/dist/judge.d.ts +3 -1
  136. package/dist/judge.js +1 -1
  137. package/dist/{judgments-CzgpsTqv.js → judgments-Cj8bFaDG.js} +2 -2
  138. package/dist/{judgments-CzgpsTqv.js.map → judgments-Cj8bFaDG.js.map} +1 -1
  139. package/dist/{layout-Cm85tQYk.js → layout-Czh5wOpz.js} +14 -11
  140. package/dist/layout-Czh5wOpz.js.map +1 -0
  141. package/dist/{list-DuThsE28.js → list-B_C0k5ex.js} +33 -19
  142. package/dist/{list-DuThsE28.js.map → list-B_C0k5ex.js.map} +1 -1
  143. package/dist/live-C9Et_BVT.js +1 -0
  144. package/dist/{live-CgYbO4Te.js → live-DGgIrVw0.js} +7 -5
  145. package/dist/live-DGgIrVw0.js.map +1 -0
  146. package/dist/{live-DL0se4Zd.js → live-DgFm0H90.js} +9 -9
  147. package/dist/{live-DL0se4Zd.js.map → live-DgFm0H90.js.map} +1 -1
  148. package/dist/machine-service-2lIv5UWF.js +1 -0
  149. package/dist/machine-service-Ct_1XMMi.js +520 -0
  150. package/dist/machine-service-Ct_1XMMi.js.map +1 -0
  151. package/dist/machines-BnquHcBZ.js +120 -0
  152. package/dist/machines-BnquHcBZ.js.map +1 -0
  153. package/dist/{model-CkNVAxob.js → model-B1tdv9-d.js} +1 -1
  154. package/dist/model-Bcy4Qjmm.js +1 -0
  155. package/dist/{model-V3mMXp6x.js → model-DF77SgZv.js} +6 -6
  156. package/dist/{model-V3mMXp6x.js.map → model-DF77SgZv.js.map} +1 -1
  157. package/dist/{model-CwwkrCb7.js → model-DRa7yv6K.js} +9 -6
  158. package/dist/model-DRa7yv6K.js.map +1 -0
  159. package/dist/{model-cgt5uvu8.js → model-E5X8YBJM.js} +7 -6
  160. package/dist/model-E5X8YBJM.js.map +1 -0
  161. package/dist/model-calls-B0BoQfJ4.js +95 -0
  162. package/dist/model-calls-B0BoQfJ4.js.map +1 -0
  163. package/dist/{node-D7pAU--0.js → node-BjuhqQwa.js} +21 -10
  164. package/dist/node-BjuhqQwa.js.map +1 -0
  165. package/dist/{opencode-providers-BGiXt8_B.js → opencode-providers-ChJTQRmz.js} +5 -2
  166. package/dist/{opencode-providers-BGiXt8_B.js.map → opencode-providers-ChJTQRmz.js.map} +1 -1
  167. package/dist/{openrouter-models-Cw1z8-sq.js → openrouter-models-B1sIOTD2.js} +2 -2
  168. package/dist/{openrouter-models-Cw1z8-sq.js.map → openrouter-models-B1sIOTD2.js.map} +1 -1
  169. package/dist/options-C989kuVE.js +1 -0
  170. package/dist/own-reads-CYmBlrHK.js +15 -0
  171. package/dist/own-reads-CYmBlrHK.js.map +1 -0
  172. package/dist/{patch-DAi1nCuH.js → patch-BR8rdl7r.js} +2 -2
  173. package/dist/{patch-DAi1nCuH.js.map → patch-BR8rdl7r.js.map} +1 -1
  174. package/dist/pi-providers-HygmL1y-.js +552 -0
  175. package/dist/pi-providers-HygmL1y-.js.map +1 -0
  176. package/dist/{plain-BYUf_fUV.js → plain-Ctn8oUdp.js} +44 -10
  177. package/dist/plain-Ctn8oUdp.js.map +1 -0
  178. package/dist/{plan-CsPilzpk.js → plan-BcT4G5jj.js} +104 -15
  179. package/dist/plan-BcT4G5jj.js.map +1 -0
  180. package/dist/{plugins-BfnhazOv.js → plugins-cC0sqoDA.js} +608 -12
  181. package/dist/plugins-cC0sqoDA.js.map +1 -0
  182. package/dist/preflight-BMVDBcux.js +1 -0
  183. package/dist/{preflight-BixaE4BA.js → preflight-C9OtTb7k.js} +4 -4
  184. package/dist/{preflight-BixaE4BA.js.map → preflight-C9OtTb7k.js.map} +1 -1
  185. package/dist/{preflight-GkpgrBxP.js → preflight-DySHXeFJ.js} +9 -10
  186. package/dist/preflight-DySHXeFJ.js.map +1 -0
  187. package/dist/{preflight-D1C-iH0U.js → preflight-zsAn3heN.js} +1 -1
  188. package/dist/{prepare-C--rM_wO.js → prepare-MaRWRhNT.js} +2 -2
  189. package/dist/prepare-nbX1CXXg.js +409 -0
  190. package/dist/prepare-nbX1CXXg.js.map +1 -0
  191. package/dist/prices-B1vm_lPk.js +1 -0
  192. package/dist/{prices-5m3SzMZ3.js → prices-BrY_ihLs.js} +80 -22
  193. package/dist/prices-BrY_ihLs.js.map +1 -0
  194. package/dist/{provenance-BXyYwUC8.js → provenance-CkykifD9.js} +5 -5
  195. package/dist/{provenance-BXyYwUC8.js.map → provenance-CkykifD9.js.map} +1 -1
  196. package/dist/provider-DHT20Gl8.js +1 -0
  197. package/dist/{provider-BxzZq3Th.js → provider-ieWOn4YS.js} +2 -2
  198. package/dist/{provider-BxzZq3Th.js.map → provider-ieWOn4YS.js.map} +1 -1
  199. package/dist/provider-stop-CxzWW7Ft.js +69 -0
  200. package/dist/provider-stop-CxzWW7Ft.js.map +1 -0
  201. package/dist/providers-BkLGzaSY.js +1 -0
  202. package/dist/{providers-1p4HKYIp.js → providers-bNgfKa6m.js} +224 -49
  203. package/dist/providers-bNgfKa6m.js.map +1 -0
  204. package/dist/query-B2SQddoV.js +1 -0
  205. package/dist/{query-DhhU9ADI.js → query-DhV3a8lM.js} +2 -2
  206. package/dist/{query-DhhU9ADI.js.map → query-DhV3a8lM.js.map} +1 -1
  207. package/dist/{questions-CMAq4pr8.js → questions-Csv64WCb.js} +7 -7
  208. package/dist/{questions-CMAq4pr8.js.map → questions-Csv64WCb.js.map} +1 -1
  209. package/dist/{record-6IUzwP9K.js → record--vHreTLk.js} +11 -5
  210. package/dist/record--vHreTLk.js.map +1 -0
  211. package/dist/{redact-BhjtnjrU.js → redact-t-L3VGy8.js} +106 -2
  212. package/dist/redact-t-L3VGy8.js.map +1 -0
  213. package/dist/{remarks-D9Lcd1fF.js → remarks-BpdM_2RC.js} +2 -1
  214. package/dist/remarks-BpdM_2RC.js.map +1 -0
  215. package/dist/{remarks-BNABzemt.js → remarks-CYFOsnz5.js} +46 -11
  216. package/dist/remarks-CYFOsnz5.js.map +1 -0
  217. package/dist/remarks-CleoDlYw.js +1 -0
  218. package/dist/{remarks-DPCONFxZ.js → remarks-DqriPKxm.js} +3 -2
  219. package/dist/{remarks-DPCONFxZ.js.map → remarks-DqriPKxm.js.map} +1 -1
  220. package/dist/{remote-U7fNt0UP.js → remote-0CHog7Oq.js} +6 -6
  221. package/dist/{remote-U7fNt0UP.js.map → remote-0CHog7Oq.js.map} +1 -1
  222. package/dist/resolve-Bm9ZyFR-.js +1 -0
  223. package/dist/resolve-Bul8lHaa.js +205 -0
  224. package/dist/resolve-Bul8lHaa.js.map +1 -0
  225. package/dist/{resolve-Cx3a9UQ2.js → resolve-DorSHDBs.js} +14 -11
  226. package/dist/resolve-DorSHDBs.js.map +1 -0
  227. package/dist/resources-DqdwihhT.js +62 -0
  228. package/dist/resources-DqdwihhT.js.map +1 -0
  229. package/dist/{results-CQKXmHym.js → results-DhMgRkR0.js} +9 -22
  230. package/dist/results-DhMgRkR0.js.map +1 -0
  231. package/dist/{resume-POpZa1ge.js → resume-C8Ihfy-C.js} +166 -17
  232. package/dist/resume-C8Ihfy-C.js.map +1 -0
  233. package/dist/{retry-CmG809Mp.js → retry-Bfk7pDti.js} +4 -4
  234. package/dist/{retry-CmG809Mp.js.map → retry-Bfk7pDti.js.map} +1 -1
  235. package/dist/{root-Co0jhOT5.js → root-BzeoyfGd.js} +2 -2
  236. package/dist/{root-Co0jhOT5.js.map → root-BzeoyfGd.js.map} +1 -1
  237. package/dist/routes-Cp4gAjBZ.js +427 -0
  238. package/dist/routes-Cp4gAjBZ.js.map +1 -0
  239. package/dist/{runtime-Xm9oeC7o.js → runtime-CPUH0Vk5.js} +46 -5
  240. package/dist/runtime-CPUH0Vk5.js.map +1 -0
  241. package/dist/sandbox/boat.d.ts +1 -1
  242. package/dist/sandbox/boat.js +1 -1
  243. package/dist/{sandbox-DrlL4yqb.js → sandbox-z8q_4Ywn.js} +3 -3
  244. package/dist/{sandbox-DrlL4yqb.js.map → sandbox-z8q_4Ywn.js.map} +1 -1
  245. package/dist/sandbox.d.ts +1 -1
  246. package/dist/sandbox.js +1 -1
  247. package/dist/{server-C00zd6zl.js → server-BsQZtuF9.js} +9 -9
  248. package/dist/{server-C00zd6zl.js.map → server-BsQZtuF9.js.map} +1 -1
  249. package/dist/server-ZaMzUNmV.js +1 -0
  250. package/dist/services-BG8xuU82.js +39 -0
  251. package/dist/services-BG8xuU82.js.map +1 -0
  252. package/dist/{shared-Cfi45Bvy.js → shared-DtZwIAfy.js} +7 -1
  253. package/dist/shared-DtZwIAfy.js.map +1 -0
  254. package/dist/{source-DDgr48Gn.js → source-9HWaTEgV.js} +2 -2
  255. package/dist/{source-DDgr48Gn.js.map → source-9HWaTEgV.js.map} +1 -1
  256. package/dist/source-BcBDj-R0.js +1 -0
  257. package/dist/src-B2eHTCnp.js +3 -0
  258. package/dist/{src-DAzaCTcN.js → src-B5r1d23Y.js} +176 -18
  259. package/dist/src-B5r1d23Y.js.map +1 -0
  260. package/dist/{src-Dw79VLa3.js → src-Bb3k9Kn_.js} +208 -59
  261. package/dist/src-Bb3k9Kn_.js.map +1 -0
  262. package/dist/src-BfOlH_Bu.js +2 -0
  263. package/dist/src-BuGc40IF.js +2 -0
  264. package/dist/{src-CV_7DkPa.js → src-C-ChdnG6.js} +102 -13
  265. package/dist/src-C-ChdnG6.js.map +1 -0
  266. package/dist/src-C2K5_afU.js +2 -0
  267. package/dist/{src-YvblOrBU.js → src-C3OhA5pw.js} +87 -13
  268. package/dist/src-C3OhA5pw.js.map +1 -0
  269. package/dist/src-CSVJjghq.js +4 -0
  270. package/dist/{src-y0nOeRRE.js → src-CWfy8ct8.js} +1572 -487
  271. package/dist/src-CWfy8ct8.js.map +1 -0
  272. package/dist/src-CcrQQB0_.js +2 -0
  273. package/dist/src-CotUxxQV.js +2 -0
  274. package/dist/src-D-PwBaBB.js +2 -0
  275. package/dist/{src-Cb2MWozp.js → src-DNWiU__5.js} +276 -41
  276. package/dist/src-DNWiU__5.js.map +1 -0
  277. package/dist/{src-KxS91P7L.js → src-DwcTn4JY.js} +79 -11
  278. package/dist/src-DwcTn4JY.js.map +1 -0
  279. package/dist/{src-BNQznj4z.js → src-boB6D-5T.js} +124 -45
  280. package/dist/src-boB6D-5T.js.map +1 -0
  281. package/dist/{src-DvGns8cz.js → src-c3ZQu7Uu.js} +299 -17
  282. package/dist/src-c3ZQu7Uu.js.map +1 -0
  283. package/dist/src-jYqNkT-F.js +1 -0
  284. package/dist/start-Db5VRcRZ.js +660 -0
  285. package/dist/start-Db5VRcRZ.js.map +1 -0
  286. package/dist/state-CKIjZZRK.js +1 -0
  287. package/dist/{state-328JpnHA.js → state-DUYdzNA7.js} +21 -21
  288. package/dist/{state-328JpnHA.js.map → state-DUYdzNA7.js.map} +1 -1
  289. package/dist/store/local.d.ts +8 -0
  290. package/dist/store/local.js +16 -0
  291. package/dist/store/local.js.map +1 -0
  292. package/dist/store/s3.d.ts +10 -0
  293. package/dist/store/s3.js +18 -0
  294. package/dist/store/s3.js.map +1 -0
  295. package/dist/suite-CH1aaAbs.js +2 -0
  296. package/dist/{suite-COglUhPd.js → suite-DjGxmDSY.js} +6 -5
  297. package/dist/{suite-COglUhPd.js.map → suite-DjGxmDSY.js.map} +1 -1
  298. package/dist/{summary-DDy9DfyJ.js → summary-BK5Sa_N0.js} +28 -7
  299. package/dist/summary-BK5Sa_N0.js.map +1 -0
  300. package/dist/sync-DUi_P2UJ.js +559 -0
  301. package/dist/sync-DUi_P2UJ.js.map +1 -0
  302. package/dist/{tarball-CESxtK4X.js → tarball-C8BSTAMk.js} +2 -2
  303. package/dist/{tarball-CESxtK4X.js.map → tarball-C8BSTAMk.js.map} +1 -1
  304. package/dist/tart-BQ_Ap0l4.js +508 -0
  305. package/dist/tart-BQ_Ap0l4.js.map +1 -0
  306. package/dist/tart-CzViW3WZ.js +186 -0
  307. package/dist/tart-CzViW3WZ.js.map +1 -0
  308. package/dist/tart-DmVuVsmX.js +1 -0
  309. package/dist/tart-bake-D1RttYfM.js +148 -0
  310. package/dist/tart-bake-D1RttYfM.js.map +1 -0
  311. package/dist/tart-bake-DjFcsG3N.js +1 -0
  312. package/dist/tart-cli-BOcluha1.js +1 -0
  313. package/dist/tart-cli-gA9xEaQL.js +89 -0
  314. package/dist/tart-cli-gA9xEaQL.js.map +1 -0
  315. package/dist/tart-hosts-CHNrfV6u.js +313 -0
  316. package/dist/tart-hosts-CHNrfV6u.js.map +1 -0
  317. package/dist/tart-hosts-CWse-ASo.js +1 -0
  318. package/dist/{tart-images-DZ_Mbh-g.js → tart-images-CLBjfF9u.js} +64 -6
  319. package/dist/tart-images-CLBjfF9u.js.map +1 -0
  320. package/dist/testing.d.ts +36 -2
  321. package/dist/testing.js +4 -4
  322. package/dist/tool-class-krsmEo44.js +433 -0
  323. package/dist/tool-class-krsmEo44.js.map +1 -0
  324. package/dist/{trace-Dx2NBE1O.js → trace-BpXByD7W.js} +13 -2
  325. package/dist/{trace-Dx2NBE1O.js.map → trace-BpXByD7W.js.map} +1 -1
  326. package/dist/{traits-DKnYkqeK.js → traits-CCD8XsmI.js} +2 -2
  327. package/dist/{traits-DKnYkqeK.js.map → traits-CCD8XsmI.js.map} +1 -1
  328. package/dist/{transcript-CCf07UmU.js → transcript-BXWZiMuC.js} +3 -3
  329. package/dist/{transcript-CCf07UmU.js.map → transcript-BXWZiMuC.js.map} +1 -1
  330. package/dist/{types-C2mLpph3.js → types-CbcnJxCy.js} +7 -1
  331. package/dist/types-CbcnJxCy.js.map +1 -0
  332. package/dist/{types-DBwFsGem.d.ts → types-DKK8jj--.d.ts} +517 -45
  333. package/dist/ui-DKYjTVpn.js +1455 -0
  334. package/dist/ui-DKYjTVpn.js.map +1 -0
  335. package/dist/{usage-DJiDnh2D.js → usage-CwIRPPZ9.js} +16 -3
  336. package/dist/usage-CwIRPPZ9.js.map +1 -0
  337. package/dist/vercel-models-Ci33llXz.js +21 -0
  338. package/dist/vercel-models-Ci33llXz.js.map +1 -0
  339. package/dist/{vertex-Eb2wqahk.js → vertex-BEWxHoxH.js} +22 -6
  340. package/dist/{vertex-Eb2wqahk.js.map → vertex-BEWxHoxH.js.map} +1 -1
  341. package/dist/vertex-DXfcXYKn.js +1 -0
  342. package/dist/view/index.d.ts +32 -3
  343. package/dist/view/index.js +8 -8
  344. package/dist/{views-BROacjBv.js → views-B1zVLJsF.js} +6 -6
  345. package/dist/{views-BROacjBv.js.map → views-B1zVLJsF.js.map} +1 -1
  346. package/dist/views-DCjtw1jF.js +2 -0
  347. package/dist/{worker-entry-Smb4bNDc.js → worker-entry-DrAYYt0M.js} +37 -14
  348. package/dist/worker-entry-DrAYYt0M.js.map +1 -0
  349. package/dist/workspace-CnRbV8cM.js +1 -0
  350. package/dist/{workspace-DNDTEk8v.js → workspace-DwTe1zo6.js} +7 -7
  351. package/dist/{workspace-DNDTEk8v.js.map → workspace-DwTe1zo6.js.map} +1 -1
  352. package/docker/Dockerfile +1 -1
  353. package/package.json +15 -1
  354. package/skills/eval-rubric/SKILL.md +10 -0
  355. package/skills/reeval/SKILL.md +370 -0
  356. package/skills/reeval/references/capture.md +48 -0
  357. package/skills/reeval/references/cli.md +162 -0
  358. package/skills/reeval/references/compare.md +180 -0
  359. package/skills/reeval/references/config.md +147 -0
  360. package/skills/reeval/references/environments.md +218 -0
  361. package/skills/reeval/references/evals.md +241 -0
  362. package/skills/reeval/references/mistakes.md +39 -0
  363. package/skills/reeval/references/vocabulary.md +19 -0
  364. package/skills/setup/SKILL.md +219 -0
  365. package/skills/setup/references/templates.md +258 -0
  366. package/dist/adapter-C60z3wLq.js.map +0 -1
  367. package/dist/agent-BmsMXZXx.js.map +0 -1
  368. package/dist/agents-DXuFxtGC.js.map +0 -1
  369. package/dist/app-files-DT5mJyV4.js.map +0 -1
  370. package/dist/assemble-DM2PNU4R.js.map +0 -1
  371. package/dist/attempt-host-7VviAJrl.js.map +0 -1
  372. package/dist/boat-BjLqFJIZ.js.map +0 -1
  373. package/dist/boat-DSNgZt-t.js +0 -322
  374. package/dist/boat-DSNgZt-t.js.map +0 -1
  375. package/dist/capture-BzotD2hs.js +0 -1
  376. package/dist/capture-Ccf0Hmyx.js.map +0 -1
  377. package/dist/cases-Dy0mifal.js +0 -1
  378. package/dist/cases-z9E6DCd5.js.map +0 -1
  379. package/dist/cli-DTuLSlmW.js.map +0 -1
  380. package/dist/cli-spec-Dsr79Qy1.js.map +0 -1
  381. package/dist/client-KM4C5r5_.js +0 -387
  382. package/dist/client-KM4C5r5_.js.map +0 -1
  383. package/dist/command-DSL7I-SI.js.map +0 -1
  384. package/dist/command-Ff0T-1Hi.js.map +0 -1
  385. package/dist/commands-xAOi_VEk.js.map +0 -1
  386. package/dist/config-SvK8pjEK.js.map +0 -1
  387. package/dist/cost-BdRgySQl.js.map +0 -1
  388. package/dist/cost-Cr26Alhq.js +0 -1
  389. package/dist/db-BzOJ4Js4.js.map +0 -1
  390. package/dist/db-CQRZ3URX.js +0 -2
  391. package/dist/docker--mukta3L.js +0 -1
  392. package/dist/docker-DG_uFgn2.js +0 -246
  393. package/dist/docker-DG_uFgn2.js.map +0 -1
  394. package/dist/doctor-DWK4ttex.js.map +0 -1
  395. package/dist/environment-cPMCOk-h.js.map +0 -1
  396. package/dist/eval-source-C9b1h8L6.js.map +0 -1
  397. package/dist/evaluate-B12Tosvq.js.map +0 -1
  398. package/dist/files-C1Rk9FYA.js +0 -1
  399. package/dist/files-DMQ9-Vv5.js +0 -1
  400. package/dist/files-Di0xDbCc.js +0 -1
  401. package/dist/files-G5jf8wBp.js +0 -1
  402. package/dist/files-s28a6czq.js.map +0 -1
  403. package/dist/harness-DXv2gnaT.js.map +0 -1
  404. package/dist/images-D2jFze2v.js.map +0 -1
  405. package/dist/init-Bi1Q3lRi.js.map +0 -1
  406. package/dist/init-CUw65o36.js +0 -1
  407. package/dist/ink-list-BpfidQ1h.js.map +0 -1
  408. package/dist/kinds-Bh2I35id.js +0 -698
  409. package/dist/kinds-Bh2I35id.js.map +0 -1
  410. package/dist/layout-Cm85tQYk.js.map +0 -1
  411. package/dist/live-CgYbO4Te.js.map +0 -1
  412. package/dist/live-DZLmj0iG.js +0 -1
  413. package/dist/matchers-CXLn-1jm.js +0 -148
  414. package/dist/matchers-CXLn-1jm.js.map +0 -1
  415. package/dist/model-Cv4GuTsZ.js +0 -1
  416. package/dist/model-CwwkrCb7.js.map +0 -1
  417. package/dist/model-cgt5uvu8.js.map +0 -1
  418. package/dist/node-D7pAU--0.js.map +0 -1
  419. package/dist/options-DPUmk7v_.js +0 -1
  420. package/dist/plain-BYUf_fUV.js.map +0 -1
  421. package/dist/plan-CsPilzpk.js.map +0 -1
  422. package/dist/plugins-BfnhazOv.js.map +0 -1
  423. package/dist/preflight-Bn3ianye.js +0 -1
  424. package/dist/preflight-GkpgrBxP.js.map +0 -1
  425. package/dist/prepare-DQEDXoDp.js +0 -268
  426. package/dist/prepare-DQEDXoDp.js.map +0 -1
  427. package/dist/prices-5m3SzMZ3.js.map +0 -1
  428. package/dist/provider-BnUoz4KB.js +0 -1
  429. package/dist/providers-1p4HKYIp.js.map +0 -1
  430. package/dist/providers-B-ijCktf.js +0 -1
  431. package/dist/query-BYhyf0LR.js +0 -1
  432. package/dist/record-6IUzwP9K.js.map +0 -1
  433. package/dist/redact-BhjtnjrU.js.map +0 -1
  434. package/dist/remarks-BNABzemt.js.map +0 -1
  435. package/dist/remarks-CAvTSq16.js +0 -1
  436. package/dist/remarks-D9Lcd1fF.js.map +0 -1
  437. package/dist/resolve-C14Pmtej.js +0 -1
  438. package/dist/resolve-Cx3a9UQ2.js.map +0 -1
  439. package/dist/results-CQKXmHym.js.map +0 -1
  440. package/dist/resume-POpZa1ge.js.map +0 -1
  441. package/dist/runtime-Xm9oeC7o.js.map +0 -1
  442. package/dist/server-C1UJcpUh.js +0 -1
  443. package/dist/shared-Cfi45Bvy.js.map +0 -1
  444. package/dist/source-DJHmQv_j.js +0 -1
  445. package/dist/src-1dBuXzs4.js +0 -3
  446. package/dist/src-BKpioayC.js +0 -2
  447. package/dist/src-BNQznj4z.js.map +0 -1
  448. package/dist/src-BY1cCaoJ.js +0 -2
  449. package/dist/src-BbZYaQ8b.js +0 -2
  450. package/dist/src-CDFH2vVN.js +0 -2
  451. package/dist/src-CMW5R9Q0.js +0 -1
  452. package/dist/src-CV_7DkPa.js.map +0 -1
  453. package/dist/src-Cb2MWozp.js.map +0 -1
  454. package/dist/src-CrV2WA2i.js +0 -2
  455. package/dist/src-CsFaawcZ.js +0 -2
  456. package/dist/src-DAzaCTcN.js.map +0 -1
  457. package/dist/src-DvGns8cz.js.map +0 -1
  458. package/dist/src-Dw79VLa3.js.map +0 -1
  459. package/dist/src-KxS91P7L.js.map +0 -1
  460. package/dist/src-YvblOrBU.js.map +0 -1
  461. package/dist/src-wKwznPgt.js +0 -2
  462. package/dist/src-y0nOeRRE.js.map +0 -1
  463. package/dist/state-Ca55Gk_O.js +0 -1
  464. package/dist/suite-CKBa6MKt.js +0 -2
  465. package/dist/summary-DDy9DfyJ.js.map +0 -1
  466. package/dist/tart-cli-C-GsbVsQ.js +0 -1
  467. package/dist/tart-cli-CU0nFS-L.js +0 -55
  468. package/dist/tart-cli-CU0nFS-L.js.map +0 -1
  469. package/dist/tart-dWoJvWHc.js +0 -586
  470. package/dist/tart-dWoJvWHc.js.map +0 -1
  471. package/dist/tart-images-DZ_Mbh-g.js.map +0 -1
  472. package/dist/tool-target-DS5d72eH.js +0 -40
  473. package/dist/tool-target-DS5d72eH.js.map +0 -1
  474. package/dist/types-C2mLpph3.js.map +0 -1
  475. package/dist/usage-DJiDnh2D.js.map +0 -1
  476. package/dist/vercel-CGlSBv63.js +0 -344
  477. package/dist/vercel-CGlSBv63.js.map +0 -1
  478. package/dist/vertex-O88TCwgY.js +0 -1
  479. package/dist/views-B0Yt_Q1S.js +0 -2
  480. package/dist/worker-entry-Smb4bNDc.js.map +0 -1
  481. package/dist/workspace-C0dDP75l.js +0 -1
@@ -1,15 +1,606 @@
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 { Jt as run, Yt as shellQuote, ft as DOCKER_EGRESS, gt as hostAllowed } from "./src-CWfy8ct8.js";
4
+ import { r as credentialsIn } from "./plain-Ctn8oUdp.js";
5
+ import { l as sha256 } from "./ids-B-JKTCP8.js";
6
+ import { t as asOwnReads } from "./own-reads-CYmBlrHK.js";
7
+ import { S as stripCredentials } from "./redact-t-L3VGy8.js";
8
+ import { i as idPart, r as TART_MACHINE, t as BOAT_MACHINE } from "./machines-BnquHcBZ.js";
2
9
  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
10
  import { existsSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
9
- import { basename, isAbsolute, join, posix, relative, sep, win32 } from "node:path";
11
+ import { basename, dirname, isAbsolute, join, posix, relative, sep, win32 } from "node:path";
12
+ import { spawn } from "node:child_process";
13
+ import { createHash, randomUUID } from "node:crypto";
14
+ import { tmpdir } from "node:os";
15
+ import { connect } from "node:net";
10
16
  import { parse } from "yaml";
17
+ import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
18
+ const POLL_MS = 200;
19
+ const READ_LISTENERS = {
20
+ proc: "if [ -r /proc/net/tcp ]; then echo \"uid $(id -u)\"; cat /proc/net/tcp /proc/net/tcp6 2>/dev/null; else echo noproc; fi",
21
+ 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",
22
+ host: "echo noproc"
23
+ };
24
+ /** Prints `alive` while `pid` runs, then the sandbox's TCP listeners, or `noproc` without them. */
25
+ function probeScript(pid, source = "proc") {
26
+ return `${pid ? `kill -0 ${pid} 2>/dev/null && echo alive; ` : ""}${READ_LISTENERS[source]}; exit 0`;
27
+ }
28
+ /** `0100007F` → `127.0.0.1`; 32 hex digits → an IPv6 address. Each 32-bit word is host-endian. */
29
+ function procAddress(hex) {
30
+ const bytes = (hex.match(/.{8}/g) ?? []).flatMap((w) => (w.match(/../g) ?? []).reverse().map((b) => Number.parseInt(b, 16)));
31
+ if (bytes.length === 4) return bytes.join(".");
32
+ if (bytes.slice(0, 10).every((b) => b === 0) && bytes[10] === 255 && bytes[11] === 255) return bytes.slice(12).join(".");
33
+ const groups = [];
34
+ for (let i = 0; i < 16; i += 2) groups.push(((bytes[i] ?? 0) << 8 | (bytes[i + 1] ?? 0)).toString(16));
35
+ const full = groups.join(":");
36
+ const longest = (full.match(/(^|:)0(:0)+(:|$)/g) ?? []).reduce((a, b) => b.length > a.length ? b : a, "");
37
+ return longest ? full.replace(longest, "::") : full;
38
+ }
39
+ /** A listener the tunnel reaches: on loopback or every address, IPv4 or IPv6. */
40
+ const reachable = (address) => address === "0.0.0.0" || address === "::" || address === "::1" || address.startsWith("127.");
41
+ /**
42
+ * `byUser` keeps only the listeners of the user the probe ran as, naming the others' ports in
43
+ * `others`: on a machine whose attempts share its network. Elsewhere a listener of another user
44
+ * (root's `docker-proxy` for a container's published port) may be the command's own.
45
+ */
46
+ function parseProbe(stdout, o = {}) {
47
+ const lines = stdout.split("\n");
48
+ const alive = lines.includes("alive");
49
+ if (lines.includes("noproc")) return {
50
+ proc: false,
51
+ alive
52
+ };
53
+ const listeners = [];
54
+ if (lines.includes("lsof")) {
55
+ for (const l of lines) {
56
+ const m = /^n(\*|\[[0-9a-f:.]+\]|[0-9.]+):(\d+)$/i.exec(l);
57
+ const address = m?.[1] === "*" ? "0.0.0.0" : (m?.[1] ?? "").replace(/^\[|\]$/g, "");
58
+ if (m && reachable(address)) listeners.push({
59
+ port: Number(m[2]),
60
+ address
61
+ });
62
+ }
63
+ return {
64
+ proc: true,
65
+ alive,
66
+ listeners
67
+ };
68
+ }
69
+ const own = o.byUser ? lines.find((l) => l.startsWith("uid "))?.slice(4) : void 0;
70
+ const others = /* @__PURE__ */ new Set();
71
+ for (const l of lines) {
72
+ const m = /^\s*\d+:\s+([0-9A-F]+):([0-9A-F]{4})\s+\S+\s+0A\s(?:\s*\S+\s+\S+\s+\S+\s+(\d+))?/i.exec(l);
73
+ const address = m ? procAddress(m[1]) : "";
74
+ if (!m || !reachable(address)) continue;
75
+ const port = Number.parseInt(m[2], 16);
76
+ if (own !== void 0 && m[3] !== void 0 && m[3] !== own) others.add(port);
77
+ else listeners.push({
78
+ port,
79
+ address
80
+ });
81
+ }
82
+ return {
83
+ proc: true,
84
+ alive,
85
+ listeners,
86
+ ...others.size && { others: [...others].sort((a, b) => a - b) }
87
+ };
88
+ }
89
+ /** The ports listening now that weren't before the command started, ascending. */
90
+ const newPorts = (listeners, before) => [...new Set(listeners.map((l) => l.port).filter((p) => !before.has(p)))].sort((a, b) => a - b);
91
+ /** The address to record for `port`: IPv4 first, since that's where the tunnel connects first. */
92
+ const addressFor = (listeners, port) => {
93
+ const all = listeners.filter((l) => l.port === port).map((l) => l.address);
94
+ return all.find((a) => !a.includes(":")) ?? all.find((a) => a === "::") ?? all[0] ?? "";
95
+ };
96
+ /** `want` is taken whoever listens on it: `servePort` found it free when the command started. */
97
+ function decide(s) {
98
+ const { listeners, alive } = s.probe;
99
+ const ports = newPorts(listeners, s.before);
100
+ if (listeners.some((l) => l.port === s.want)) return {
101
+ kind: "port",
102
+ port: s.want,
103
+ address: addressFor(listeners, s.want)
104
+ };
105
+ const late = s.elapsedMs >= s.timeoutMs;
106
+ if (!s.given && ports.length && (s.stableMs >= 3e3 || late || !alive)) {
107
+ if (ports.length === 1) {
108
+ const port = ports[0];
109
+ return {
110
+ kind: "port",
111
+ port,
112
+ address: addressFor(listeners, port)
113
+ };
114
+ }
115
+ return {
116
+ kind: "several",
117
+ ports
118
+ };
119
+ }
120
+ if (!alive) return { kind: "exited" };
121
+ return late ? {
122
+ kind: "timeout",
123
+ ports
124
+ } : { kind: "wait" };
125
+ }
126
+ const plain = (output) => output.replace(/\x1b\[[0-9;?]*[A-Za-z]/g, "");
127
+ /** The URLs `output` prints on one of `ports`, as Vite's `Local: http://localhost:5173/`. */
128
+ function printedUrls(output, ports) {
129
+ const found = /* @__PURE__ */ new Map();
130
+ for (const m of plain(output).matchAll(/https?:\/\/(?:\[[0-9a-f:]+\]|[^\s/:[\]]+):(\d+)[^\s'"]*/gi)) {
131
+ const port = Number(m[1]);
132
+ if (ports.includes(port) && !found.has(m[0])) found.set(m[0], port);
133
+ }
134
+ return [...found].map(([url, port]) => ({
135
+ url,
136
+ port
137
+ }));
138
+ }
139
+ /** Whether something on the host accepts a TCP connection on `port`, IPv4 or IPv6 loopback. */
140
+ async function hostListening(port) {
141
+ for (const host of ["127.0.0.1", "::1"]) if (await new Promise((resolve) => {
142
+ const socket = connect({
143
+ port,
144
+ host
145
+ });
146
+ socket.once("connect", () => {
147
+ socket.destroy();
148
+ resolve(true);
149
+ });
150
+ socket.once("error", () => resolve(false));
151
+ })) return host;
152
+ }
153
+ /** How many times `c.serve` allocates `PORT` again when the sandbox already listens on it. */
154
+ const ALLOCATE_TRIES = 5;
155
+ /**
156
+ * The port `c.serve` sets as `PORT` and waits on: `port`, or one from `allocate` that nothing
157
+ * listens on yet. Throws when something already listens on `port`, since that server, not the
158
+ * command's, would answer the checks: c.serve only stops what it started.
159
+ */
160
+ async function servePort(command, port, allocate, taken) {
161
+ if (port === void 0) {
162
+ for (let i = 0; i < ALLOCATE_TRIES; i++) {
163
+ const want = await allocate();
164
+ if (!await taken(want)) return want;
165
+ }
166
+ throw new Error(`c.serve(${JSON.stringify(command)}) found every port it allocated for PORT already in use in the sandbox`);
167
+ }
168
+ 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`);
169
+ return port;
170
+ }
171
+ const sleep = (ms, signal) => new Promise((resolve) => {
172
+ const done = () => {
173
+ clearTimeout(timer);
174
+ signal?.removeEventListener("abort", done);
175
+ resolve();
176
+ };
177
+ const timer = setTimeout(done, ms);
178
+ signal?.addEventListener("abort", done, { once: true });
179
+ });
180
+ const listOf = (items) => items.length > 1 ? `${items.slice(0, -1).join(", ")} and ${items.at(-1)}` : String(items[0]);
181
+ /**
182
+ * Polls until something listens on `want`, or, without a given port, until the ports that are
183
+ * new since the command started have settled on one. Throws, with the command's last output,
184
+ * when they settle on several, it exits, or nothing listens in time.
185
+ */
186
+ async function awaitListening(command, w) {
187
+ const timeoutMs = w.timeoutMs ?? 12e4;
188
+ const started = Date.now();
189
+ let last = "";
190
+ let changed = started;
191
+ const output = async () => plain(await w.output().catch(() => ""));
192
+ const fail = async (why, out) => {
193
+ const tail = (out ?? await output()).trimEnd().split("\n").slice(-20).join("\n").trim();
194
+ return /* @__PURE__ */ new Error(`c.serve(${JSON.stringify(command)}) ${why}${tail ? `. Its last output:\n${tail}` : ""}`);
195
+ };
196
+ for (;;) {
197
+ w.signal?.throwIfAborted();
198
+ const probe = await w.probe();
199
+ const now = Date.now();
200
+ if (!probe.proc) {
201
+ const address = await (w.hostListening ?? hostListening)(w.want);
202
+ if (address !== void 0) return {
203
+ port: w.want,
204
+ address,
205
+ detected: false,
206
+ readyMs: now - started
207
+ };
208
+ if (!probe.alive) throw await fail(`exited before it listened on ${w.want}`);
209
+ 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`);
210
+ } else {
211
+ const key = newPorts(probe.listeners, w.before).join(",");
212
+ if (key !== last) {
213
+ last = key;
214
+ changed = now;
215
+ }
216
+ const d = decide({
217
+ want: w.want,
218
+ given: w.given,
219
+ probe,
220
+ before: w.before,
221
+ stableMs: now - changed,
222
+ elapsedMs: now - started,
223
+ timeoutMs
224
+ });
225
+ if (d.kind === "port") return {
226
+ port: d.port,
227
+ address: d.address,
228
+ detected: d.port !== w.want,
229
+ readyMs: now - started
230
+ };
231
+ if (d.kind === "several") {
232
+ const out = await output();
233
+ const urls = printedUrls(out, d.ports);
234
+ const printed = urls.length ? ` It printed ${listOf(urls.map((u) => u.url))}.` : "";
235
+ const hint = urls[0]?.port ?? d.ports[0];
236
+ 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);
237
+ }
238
+ if (d.kind === "exited") throw await fail("exited before it listened on a port");
239
+ if (d.kind === "timeout") {
240
+ const on = d.ports.length ? `; ${d.ports.length > 1 ? "ports" : "port"} ${listOf(d.ports)} started listening` : "";
241
+ throw await fail(`didn't listen on ${w.given ? `the port passed (${w.want})` : "a port"} within ${timeoutMs / 1e3}s${on}`);
242
+ }
243
+ }
244
+ await sleep(POLL_MS, w.signal);
245
+ }
246
+ }
247
+ // src/sandbox/fake.ts
248
+ /**
249
+ * Commands run on the host's own network, so the fake sandbox can neither restrict nor see it.
250
+ * A phased policy it plans (`proxy` and `allow-all` only) has nothing to switch, so it accepts one.
251
+ */
252
+ const FAKE_EGRESS = {
253
+ enforce: "none",
254
+ record: false,
255
+ switches: true
256
+ };
257
+ /**
258
+ * The POSIX shell commands run in: `sh`, which Windows lacks, so there the `sh.exe` on PATH or
259
+ * Git for Windows'.
260
+ */
261
+ function posixShell(platform = process.platform, env = process.env, exists = existsSync) {
262
+ if (platform !== "win32") return "sh";
263
+ const onPath = (env.PATH ?? env.Path ?? "").split(win32.delimiter).filter(Boolean);
264
+ const git = [
265
+ env.ProgramFiles,
266
+ env["ProgramFiles(x86)"],
267
+ env.LOCALAPPDATA && win32.join(env.LOCALAPPDATA, "Programs")
268
+ ].filter((dir) => !!dir).map((dir) => win32.join(dir, "Git", "bin"));
269
+ const found = [...onPath, ...git].map((dir) => win32.join(dir, "sh.exe")).find(exists);
270
+ if (found) return found;
271
+ 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().");
272
+ }
273
+ const EXEC_TAG = "REEVAL_FAKE_EXEC";
274
+ const KILL_TAGGED = `for pass in 1 2 3 4 5; do
275
+ found=
276
+ for f in $(grep -lzx "${EXEC_TAG}=$1" /proc/[0-9]*/environ 2>/dev/null); do
277
+ p=\${f#/proc/}; kill -9 "\${p%/environ}" 2>/dev/null; found=1
278
+ done
279
+ [ -n "$found" ] || break
280
+ done`;
281
+ /**
282
+ * Stops a command's MSYS processes on Windows. `taskkill /t` doesn't reach them: Git's `sh.exe`
283
+ * starts bash, whose fork and exec leave each new process's Windows parent gone, so a timed-out
284
+ * `sleep 30` would run on, holding the command's pipes and working directory.
285
+ */
286
+ function killTagged(sh, tag) {
287
+ runSh(sh, KILL_TAGGED, tag);
288
+ }
289
+ /**
290
+ * Kills host processes whose cwd is the sandbox, including native `node.exe` `c.serve` starts.
291
+ * Match only the unique `reeval-sandbox-*` folder name: Git Bash `pwd` and node.exe's
292
+ * `/proc/cwd` disagree (`/tmp/...` vs `D:\\Users\\...\\Temp\\...`), and an empty
293
+ * `"$prefix"/*` is `/*`, which SIGKILLs the Windows runner (exit 2304).
294
+ */
295
+ const KILL_UNDER = `cd "$1" || exit 0
296
+ base=$(pwd -P 2>/dev/null || pwd)
297
+ name=\${base##*/}
298
+ case "$name" in
299
+ reeval-sandbox-?*) ;;
300
+ *) exit 0 ;;
301
+ esac
302
+ for f in /proc/[0-9]*/cwd; do
303
+ t=$(readlink "$f" 2>/dev/null) || continue
304
+ case "$t" in
305
+ *"$name"*) ;;
306
+ *) continue ;;
307
+ esac
308
+ p=\${f#/proc/}; p=\${p%/cwd}
309
+ [ -n "$p" ] || continue
310
+ kill -9 "$p" 2>/dev/null
311
+ wp=$(tr -d '\\r\\n' < /proc/$p/winpid 2>/dev/null)
312
+ [ -n "$wp" ] && taskkill /F /PID "$wp" >/dev/null 2>&1
313
+ done`;
314
+ function runSh(sh, script, arg) {
315
+ return new Promise((resolve) => {
316
+ const child = spawn(sh, [
317
+ "-c",
318
+ script,
319
+ "sh",
320
+ arg
321
+ ], {
322
+ stdio: "ignore",
323
+ windowsHide: true
324
+ });
325
+ const done = () => resolve();
326
+ child.on("error", done);
327
+ child.on("close", done);
328
+ });
329
+ }
330
+ /** Windows refuses to delete a directory a live process still has as cwd; retry after kills. */
331
+ async function removeTree(path) {
332
+ const deadline = Date.now() + 8e3;
333
+ for (;;) {
334
+ try {
335
+ await rm(path, {
336
+ recursive: true,
337
+ force: true
338
+ });
339
+ if (!existsSync(path)) return;
340
+ } catch {}
341
+ if (Date.now() >= deadline) {
342
+ await rm(path, {
343
+ recursive: true,
344
+ force: true
345
+ }).catch(() => {});
346
+ return;
347
+ }
348
+ await new Promise((r) => setTimeout(r, 50));
349
+ }
350
+ }
351
+ /**
352
+ * A temp directory on the host. Commands run unisolated on the host shell, so this is
353
+ * only meant for tests and for the fake harness.
354
+ */
355
+ async function createFakeSandbox(descriptor, env = {}) {
356
+ const sh = posixShell();
357
+ const parent = descriptor.dir ?? tmpdir();
358
+ await mkdir(parent, { recursive: true });
359
+ const base = await mkdtemp(join(parent, "reeval-sandbox-"));
360
+ const workdir = join(base, "work");
361
+ await mkdir(workdir);
362
+ const stateDir = `${base}.state`;
363
+ await mkdir(stateDir);
364
+ let destroyed;
365
+ const resolve = (path) => path.startsWith("~/") ? join(base, path.slice(2)) : join(workdir, path);
366
+ return {
367
+ workdir,
368
+ stateDir,
369
+ execOwn: (command, { signal } = {}) => run(sh, ["-c", command], {
370
+ cwd: workdir,
371
+ env: {
372
+ HOME: base,
373
+ ...env
374
+ },
375
+ signal
376
+ }),
377
+ exec: (command, { cwd, env: extra, signal } = {}) => {
378
+ const tag = process.platform === "win32" && signal ? randomUUID() : void 0;
379
+ const stop = () => killTagged(sh, tag);
380
+ if (tag) signal?.addEventListener("abort", stop, { once: true });
381
+ return run(sh, ["-c", cwd ? `cd ${shellQuote(cwd)} && ${command}` : command], {
382
+ cwd: workdir,
383
+ env: {
384
+ HOME: base,
385
+ ...env,
386
+ ...extra,
387
+ ...tag ? { [EXEC_TAG]: tag } : {}
388
+ },
389
+ signal
390
+ }).finally(() => signal?.removeEventListener("abort", stop));
391
+ },
392
+ home: base,
393
+ setEgress: async () => {},
394
+ readFile: (path) => readFile(resolve(path), "utf8").catch(() => null),
395
+ getPortEndpoint: async ({ port, protocol = "http" }) => ({ url: `${protocol === "ws" ? "ws" : "http"}://${await hostListening(port) === "::1" ? "[::1]" : "127.0.0.1"}:${port}` }),
396
+ async writeFile(path, content) {
397
+ const target = resolve(path);
398
+ await mkdir(dirname(target), { recursive: true });
399
+ await writeFile(target, content);
400
+ },
401
+ destroy: () => {
402
+ destroyed ??= (async () => {
403
+ await rm(stateDir, {
404
+ recursive: true,
405
+ force: true
406
+ }).catch(() => {});
407
+ if (process.platform === "win32") {
408
+ if (existsSync(base)) await runSh(sh, KILL_UNDER, base);
409
+ await removeTree(base);
410
+ return;
411
+ }
412
+ await rm(base, {
413
+ recursive: true,
414
+ force: true
415
+ }).catch(() => {});
416
+ })().finally(() => {
417
+ destroyed = void 0;
418
+ });
419
+ return destroyed;
420
+ }
421
+ };
422
+ }
423
+ // src/sandbox/machine.ts
424
+ /**
425
+ * The kinds entry of a machine provider. Every machine is apart from the host, gets the harness a
426
+ * session, keeps brokered values out behind the gateway and is checked in preflight; none starts
427
+ * from an image preflight builds or runs a plugin's `build`.
428
+ */
429
+ function kindOf(machine) {
430
+ const { capacity } = machine;
431
+ return {
432
+ helpers: machine.helpers,
433
+ capabilities: {
434
+ platform: machine.os,
435
+ ...machine.capabilities,
436
+ brokers: true,
437
+ harnessSession: true,
438
+ isolated: true,
439
+ images: false,
440
+ preflight: true,
441
+ pluginBuilds: false
442
+ },
443
+ provider: () => machine.kind,
444
+ id: (s) => machine.id(s),
445
+ hostPaths: machine.hostPaths,
446
+ buildsAtStart: () => true,
447
+ ...machine.hostLimit && { hostLimit: machine.hostLimit },
448
+ privileges: () => ({
449
+ root: false,
450
+ capabilities: []
451
+ }),
452
+ create: (s, o) => machine.create(s, o),
453
+ ...capacity && { async capacity(sandbox) {
454
+ const free = await capacity.call(machine, sandbox);
455
+ if (free === null) return null;
456
+ const machines = Math.max(1, free.machines);
457
+ return {
458
+ cpus: machines,
459
+ memoryBytes: machines * 1e9,
460
+ ...free.attempts && { attempts: free.attempts }
461
+ };
462
+ } },
463
+ cleanupRun: (runId, sandboxes) => machine.cleanupRun(runId, sandboxes),
464
+ ...machine.cleanupScope && { cleanupScope: machine.cleanupScope },
465
+ ...machine.credentials && { credentials: machine.credentials },
466
+ ...machine.doctor && { doctor: machine.doctor },
467
+ ...machine.planWarnings && { planWarnings: machine.planWarnings },
468
+ ...machine.attemptCap && { attemptCap: machine.attemptCap },
469
+ ...machine.slotsPerMachine && { slotsPerMachine: machine.slotsPerMachine }
470
+ };
471
+ }
472
+ // src/sandbox/kinds.ts
473
+ /** `+` and a hash of the install steps, or nothing without any. */
474
+ function installId(install) {
475
+ if (!install?.length) return "";
476
+ const key = JSON.stringify(install.map((step) => typeof step === "string" ? step : {
477
+ run: step.run,
478
+ timeout: step.timeout
479
+ }));
480
+ return `+${createHash("sha256").update(key).digest("hex").slice(0, 8)}`;
481
+ }
482
+ const engineOf = (s) => s.engine ?? "docker";
483
+ const SANDBOX_KINDS = {
484
+ docker: {
485
+ helpers: ["docker", "podman"],
486
+ capabilities: {
487
+ platform: "linux",
488
+ egress: DOCKER_EGRESS,
489
+ brokers: true,
490
+ harnessSession: true,
491
+ isolated: true,
492
+ processTable: true,
493
+ listeners: "proc",
494
+ images: true,
495
+ preflight: true,
496
+ pluginBuilds: true
497
+ },
498
+ provider: engineOf,
499
+ id(s) {
500
+ const install = installId(s.install);
501
+ const engine = engineOf(s);
502
+ if (s.dockerfile) {
503
+ const [file = "", dir = ""] = s.dockerfile.split(/[\\/]/).reverse();
504
+ return `${engine}:${idPart(file === "Dockerfile" ? dir || file : file)}${install}`;
505
+ }
506
+ const image = s.image ?? s.from;
507
+ return image ? `${engine}:${idPart(image)}${install}` : `${engine}${install}`;
508
+ },
509
+ hostPaths: { dockerfile: "file" },
510
+ buildsAtStart: (s) => !!(s.from || s.dockerfile || s.install?.length),
511
+ privileges: (s) => ({
512
+ root: !!s.root,
513
+ capabilities: s.capabilities ?? []
514
+ }),
515
+ async create(sandbox, options) {
516
+ const { createDockerSandbox } = await import("./docker-DrMnpL84.js");
517
+ return createDockerSandbox(sandbox, options);
518
+ },
519
+ async capacity(sandbox) {
520
+ const { dockerCapacity } = await import("./src-jYqNkT-F.js");
521
+ return dockerCapacity(sandbox.engine);
522
+ },
523
+ async cleanupRun(runId, sandboxes) {
524
+ const engines = sandboxes ? [...new Set(sandboxes.map(engineOf))] : ["docker", "podman"];
525
+ if (!engines.length) return;
526
+ const { removeRunContainers } = await import("./docker-DrMnpL84.js");
527
+ await removeRunContainers(runId, engines);
528
+ }
529
+ },
530
+ fake: {
531
+ helpers: ["fakeSandbox"],
532
+ capabilities: {
533
+ platform: process.platform,
534
+ egress: FAKE_EGRESS,
535
+ brokers: false,
536
+ harnessSession: false,
537
+ isolated: false,
538
+ processTable: false,
539
+ listeners: "host",
540
+ images: false,
541
+ preflight: false,
542
+ pluginBuilds: false
543
+ },
544
+ provider: () => "fake",
545
+ id: () => "fake",
546
+ hostPaths: { dir: "dir" },
547
+ buildsAtStart: () => false,
548
+ privileges: () => ({
549
+ root: false,
550
+ capabilities: []
551
+ }),
552
+ create: (sandbox, options) => createFakeSandbox(sandbox, options.env)
553
+ },
554
+ tart: kindOf(TART_MACHINE),
555
+ boat: kindOf(BOAT_MACHINE)
556
+ };
557
+ const isSandboxKind = (kind) => typeof kind === "string" && Object.hasOwn(SANDBOX_KINDS, kind);
558
+ /** The entry for `sandbox`'s kind. */
559
+ const sandboxKind = (sandbox) => SANDBOX_KINDS[sandbox.kind];
560
+ /** What `sandbox`'s kind can do. */
561
+ const capabilitiesOf = (sandbox) => SANDBOX_KINDS[sandbox.kind].capabilities;
562
+ /** Every helper that makes a sandbox, as a list a message reads: `docker(), podman() or fakeSandbox()`. */
563
+ function sandboxHelpers(which = () => true) {
564
+ const calls = Object.values(SANDBOX_KINDS).filter((k) => which(k.capabilities)).flatMap((k) => k.helpers.map((h) => `${h}()`));
565
+ return calls.length > 1 ? `${calls.slice(0, -1).join(", ")} or ${calls.at(-1)}` : calls[0] ?? "";
566
+ }
567
+ /**
568
+ * Whether a sandbox can run a real harness whose bootstrap installs its CLI for `platforms`: it
569
+ * gives the harness a session, keeps the credential out and runs one of them.
570
+ */
571
+ const runsAgent = (platforms) => (c) => c.harnessSession && c.brokers && platforms.includes(c.platform);
572
+ /** The first helper of each kind that can, for a fix: `docker()`. */
573
+ const suggestedSandbox = (which) => Object.values(SANDBOX_KINDS).filter((k) => which(k.capabilities)).map((k) => `${k.helpers[0]}()`).join(" or ");
574
+ /** Why `sandbox.maxConcurrent` (in `where`) is wrong, or undefined. */
575
+ function maxConcurrentProblem(sandbox, where) {
576
+ const max = sandbox.maxConcurrent;
577
+ if (max === void 0) return void 0;
578
+ 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)})`;
579
+ const limit = sandboxKind(sandbox).hostLimit?.(sandbox);
580
+ 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}`;
581
+ }
582
+ /** The cap on `sandbox`'s provider across the run: its `maxConcurrent`, else its kind's limit. */
583
+ const providerLimit = (sandbox) => sandbox.maxConcurrent || sandboxKind(sandbox).hostLimit?.(sandbox).max;
584
+ /** What the first of `sandboxes` that runs off the host may use, or null when none does or it doesn't answer. */
585
+ async function sandboxCapacity(sandboxes) {
586
+ for (const sandbox of sandboxes) {
587
+ const kind = sandboxKind(sandbox);
588
+ if (kind.capacity) return kind.capacity(sandbox);
589
+ }
590
+ return null;
591
+ }
592
+ /** Removes what the run left behind: for `sandboxes`, or everything any kind may have started when unset. */
593
+ async function cleanupRun(runId, sandboxes) {
594
+ for (const [name, kind] of Object.entries(SANDBOX_KINDS)) {
595
+ if (!kind.cleanupRun) continue;
596
+ const own = sandboxes?.filter((s) => s.kind === name);
597
+ if (own && !own.length) continue;
598
+ await kind.cleanupRun(runId, own);
599
+ }
600
+ }
11
601
  // src/environment/plugins.ts
12
- const readText = (path) => withoutBom(readFileSync(path, "utf8"));
602
+ /** The plan's reads of a plugin or skill, which are reeval's, not the eval file's load's. */
603
+ const readText = (path) => asOwnReads(() => withoutBom(readFileSync(path, "utf8")));
13
604
  const PLUGIN_PARTS = [
14
605
  "skills",
15
606
  "agents",
@@ -425,19 +1016,24 @@ const PART_FILES = {
425
1016
  mcp: (p) => p === ".mcp.json",
426
1017
  rules: (p) => p.startsWith("rules/")
427
1018
  };
1019
+ /** Whether a plugin-relative file is placed with only the parts `kept`: the manifest always is. */
1020
+ function pluginKeeps(kept) {
1021
+ const dropped = PLUGIN_PARTS.filter((part) => !kept.includes(part)).map((x) => PART_FILES[x]);
1022
+ return (path) => !dropped.some((d) => d(path));
1023
+ }
428
1024
  /**
429
1025
  * The files to place, by path relative to the plugin's root: its tree without `.git`, without the
430
1026
  * parts `only` leaves out, and with the manifest as `readPlugin` gives it.
431
1027
  */
432
1028
  function pluginFiles(p) {
433
- const dropped = PLUGIN_PARTS.filter((part) => !p.kept.includes(part)).map((x) => PART_FILES[x]);
1029
+ const keeps = pluginKeeps(p.kept);
434
1030
  const out = [];
435
1031
  const walk = (rel) => {
436
1032
  for (const entry of readdirSync(join(p.dir, rel), { withFileTypes: true })) {
437
1033
  if (entry.name === ".git") continue;
438
1034
  const path = rel ? `${rel}/${entry.name}` : entry.name;
439
1035
  if (entry.isDirectory()) walk(path);
440
- else if (entry.isFile() && path !== ".claude-plugin/plugin.json" && !dropped.some((d) => d(path))) {
1036
+ else if (entry.isFile() && path !== ".claude-plugin/plugin.json" && keeps(path)) {
441
1037
  const full = join(p.dir, path);
442
1038
  const executable = (statSync(full).mode & 64) !== 0;
443
1039
  out.push({
@@ -647,6 +1243,6 @@ function fetchesAtStart(plugins, allowed) {
647
1243
  }
648
1244
  return { notes };
649
1245
  }
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 };
1246
+ export { readMarketplace as A, providerLimit as B, pluginBuildsLabel as C, pluginParts as D, pluginKeeps as E, SANDBOX_KINDS as F, suggestedSandbox as G, sandboxCapacity as H, capabilitiesOf as I, parseProbe as J, awaitListening as K, cleanupRun as L, samePluginTwice as M, skillCall as N, pluginServerName as O, skillName as P, isSandboxKind as R, pluginBuildId as S, pluginFiles as T, sandboxHelpers as U, runsAgent as V, sandboxKind 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, readPlugin as j, pluginSourceLabel 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, maxConcurrentProblem as z };
651
1247
 
652
- //# sourceMappingURL=plugins-BfnhazOv.js.map
1248
+ //# sourceMappingURL=plugins-cC0sqoDA.js.map