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
@@ -0,0 +1,718 @@
1
+ import { n as UsageError } from "./errors-ttMTnIYX.js";
2
+ import { o as PACKAGE_VERSION, p as reevalCommand, r as DIST_DIR } from "./root-BzeoyfGd.js";
3
+ import { Jt as run } from "./src-CWfy8ct8.js";
4
+ import { o as withoutBom } from "./text-B8-W3Cvn.js";
5
+ import { h as requireConfig } from "./config-C0RKt00M.js";
6
+ import { r as repoTop, t as git } from "./git-DOrOtAiD.js";
7
+ import { a as writeTar, i as safeTarPath, n as readTar, t as extractTar } from "./tarball-C8BSTAMk.js";
8
+ import { o as readableBundleManifest, t as NewerSchemaError } from "./record--vHreTLk.js";
9
+ import { v as findingLines, y as scanText } from "./files-qjeqXnfE.js";
10
+ import { n as gitInfo } from "./provenance-CkykifD9.js";
11
+ import { T as savedFilters } from "./resume-C8Ihfy-C.js";
12
+ import { t as PreflightInfraError } from "./preflight-DySHXeFJ.js";
13
+ import { z } from "zod";
14
+ import { existsSync, rmSync } from "node:fs";
15
+ import { basename, dirname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
16
+ import { spawn } from "node:child_process";
17
+ import { createHash } from "node:crypto";
18
+ import { tmpdir } from "node:os";
19
+ import { gunzipSync, gzipSync } from "node:zlib";
20
+ import { lstat, mkdtemp, readFile, readdir, realpath, rm, stat, writeFile } from "node:fs/promises";
21
+ import { parseEnv } from "node:util";
22
+ // src/bundle/index.ts
23
+ const MANIFEST = "manifest.json";
24
+ /** The placeholder for the bundle root's absolute path in the plan a manifest keeps. */
25
+ const ROOT = "<root>";
26
+ /** Never in a bundle: a path through one is the install's, git's or reeval's own. */
27
+ const SKIP_DIRS = /* @__PURE__ */ new Set([
28
+ ".git",
29
+ "node_modules",
30
+ ".reeval"
31
+ ]);
32
+ const throughSkipped = (rel) => rel.split("/").some((p) => SKIP_DIRS.has(p));
33
+ /** Files a bundle never carries, only names with their variables: dotenv files and `.envrc`. */
34
+ const isEnvFile = (name) => name === ".env" || name.startsWith(".env.") || name === ".envrc";
35
+ /** Input kinds whose local path is a git repository reeval clones, history and all. */
36
+ const REPOSITORY_KINDS = /* @__PURE__ */ new Set([
37
+ "workspace",
38
+ "skill",
39
+ "plugin",
40
+ "marketplace"
41
+ ]);
42
+ /**
43
+ * Package manager settings that hold a registry credential, by file name: a value that isn't a
44
+ * `${VAR}` (or bun's `$VAR`) reference. The match's first group is the setting.
45
+ */
46
+ const REGISTRY_CREDENTIALS = {
47
+ ".npmrc": /^[ \t]*(?:\S*:)?(_auth|_authToken|_password)[ \t]*=[ \t]*(?!["']?\$\{)\S/m,
48
+ ".yarnrc": /^[ \t]*["']?(?:\S*:)?(_auth|_authToken|_password)["']?[ \t]*[ =][ \t]*(?!["']?\$\{)\S/m,
49
+ ".yarnrc.yml": /^[ \t]*(npmAuthToken|npmAuthIdent|npmPassword)[ \t]*:[ \t]*(?!["']?\$\{)[^\s#]/m,
50
+ "bunfig.toml": /(?:^|[{,])[ \t]*(token|password)[ \t]*=[ \t]*["'](?!\$)/m
51
+ };
52
+ /** The shortest variable value a bundled file is checked for: shorter ones match by chance. */
53
+ const MIN_SECRET = 8;
54
+ /** The package manager configuration an install from the lockfile reads, beside it. */
55
+ const INSTALL_FILES = [
56
+ "package.json",
57
+ "pnpm-workspace.yaml",
58
+ ".npmrc",
59
+ ".yarnrc.yml",
60
+ ".yarnrc",
61
+ "bunfig.toml",
62
+ "pyproject.toml",
63
+ ".python-version",
64
+ ".nvmrc",
65
+ ".node-version"
66
+ ];
67
+ /** Each lockfile and the install that reproduces it exactly. */
68
+ const INSTALLS = [
69
+ {
70
+ lockfile: "pnpm-lock.yaml",
71
+ command: () => [
72
+ "pnpm",
73
+ "install",
74
+ "--frozen-lockfile"
75
+ ]
76
+ },
77
+ {
78
+ lockfile: "package-lock.json",
79
+ command: () => ["npm", "ci"]
80
+ },
81
+ {
82
+ lockfile: "npm-shrinkwrap.json",
83
+ command: () => ["npm", "ci"]
84
+ },
85
+ {
86
+ lockfile: "yarn.lock",
87
+ command: (dir) => existsSync(join(dir, ".yarnrc.yml")) ? [
88
+ "yarn",
89
+ "install",
90
+ "--immutable"
91
+ ] : [
92
+ "yarn",
93
+ "install",
94
+ "--frozen-lockfile"
95
+ ]
96
+ },
97
+ {
98
+ lockfile: "bun.lock",
99
+ command: () => [
100
+ "bun",
101
+ "install",
102
+ "--frozen-lockfile"
103
+ ]
104
+ },
105
+ {
106
+ lockfile: "bun.lockb",
107
+ command: () => [
108
+ "bun",
109
+ "install",
110
+ "--frozen-lockfile"
111
+ ]
112
+ },
113
+ {
114
+ lockfile: "uv.lock",
115
+ command: () => [
116
+ "uv",
117
+ "sync",
118
+ "--frozen"
119
+ ]
120
+ }
121
+ ];
122
+ const sha256 = (data) => createHash("sha256").update(data).digest("hex");
123
+ const posix$1 = (path) => path.split(sep).join("/");
124
+ const within = (dir, path) => path === dir || path.startsWith(dir + sep);
125
+ const plural = (n, one, many = `${one}s`) => `${n} ${n === 1 ? one : many}`;
126
+ /** The `reeval run` arguments that plan `args`, for a dry run of the config at `config`. */
127
+ function runArgs(args) {
128
+ return [
129
+ "run",
130
+ ...args.filters,
131
+ ...args.profile ? ["--profile", args.profile] : [],
132
+ ...args.tags.flatMap((t) => ["--tag", t]),
133
+ ...args.traits.flatMap((t) => ["--trait", t]),
134
+ ...args.runs ? ["--runs", args.runs] : []
135
+ ];
136
+ }
137
+ /**
138
+ * The plan document a child `reeval run --dry-run --json` prints in `cwd`, or the code it exited
139
+ * with when it refused: its errors reach the terminal as they are.
140
+ */
141
+ async function dryRun(cwd, args, config) {
142
+ const [cmd, ...rest] = reevalCommand(join(DIST_DIR, "cli.js"), [
143
+ ...args,
144
+ "--dry-run",
145
+ "--json",
146
+ "--config",
147
+ config
148
+ ]);
149
+ const child = spawn(cmd, rest, {
150
+ cwd,
151
+ env: {
152
+ ...process.env,
153
+ REEVAL_PRICES: process.env.REEVAL_PRICES ?? "none"
154
+ },
155
+ stdio: [
156
+ "ignore",
157
+ "pipe",
158
+ "inherit"
159
+ ],
160
+ windowsHide: true
161
+ });
162
+ let out = "";
163
+ child.stdout.setEncoding("utf8");
164
+ child.stdout.on("data", (d) => {
165
+ out += d;
166
+ });
167
+ const code = await new Promise((done, fail) => {
168
+ child.on("error", fail);
169
+ child.on("close", done);
170
+ });
171
+ if (code !== 0) return { code: code ?? 3 };
172
+ return { plan: JSON.parse(out) };
173
+ }
174
+ /** `value` with the absolute path `root` written as {@link ROOT} in every string. */
175
+ function rooted(value, root) {
176
+ const inJson = (s) => JSON.stringify(s).slice(1, -1);
177
+ const json = JSON.stringify(value).split(inJson(root + sep)).join(`${ROOT}/`).split(`"${inJson(root)}"`).join(`"${ROOT}"`);
178
+ return JSON.parse(json);
179
+ }
180
+ /**
181
+ * The files under `root` that `inputs` name: a directory's walked, each link resolved and kept
182
+ * only when its target is under `root`, never through {@link SKIP_DIRS}, and `.env` files listed
183
+ * by their variables instead.
184
+ */
185
+ async function collect(inputs, root) {
186
+ const c = {
187
+ kinds: /* @__PURE__ */ new Map(),
188
+ links: /* @__PURE__ */ new Map(),
189
+ envFiles: /* @__PURE__ */ new Map(),
190
+ values: /* @__PURE__ */ new Map(),
191
+ outside: [],
192
+ carried: []
193
+ };
194
+ const rel = (path) => posix$1(relative(root, path));
195
+ const listEnv = async (path) => {
196
+ const at = rel(path);
197
+ if (c.envFiles.has(at)) return;
198
+ const parsed = parseEnv(withoutBom(await readFile(path, "utf8")));
199
+ c.envFiles.set(at, {
200
+ path: at,
201
+ variables: Object.keys(parsed).sort()
202
+ });
203
+ for (const [name, value] of Object.entries(parsed)) if (value) c.values.set(name, value);
204
+ };
205
+ /** `path` and what it resolves to, or null when it's dangling or resolves outside `root`. */
206
+ const resolved = async (path) => {
207
+ const target = await realpath(path).catch(() => null);
208
+ if (target && !within(root, target)) c.outside.push(rel(path));
209
+ return target && within(root, target) ? target : null;
210
+ };
211
+ const walk = async (dir, kind, ancestors) => {
212
+ for (const name of (await readdir(dir)).sort()) {
213
+ const full = join(dir, name);
214
+ const info = await lstat(full).catch(() => null);
215
+ if (!info || SKIP_DIRS.has(name)) continue;
216
+ const target = info.isSymbolicLink() ? await resolved(full) : full;
217
+ if (!target) continue;
218
+ const real = info.isSymbolicLink() ? await stat(target) : info;
219
+ if (real.isDirectory()) {
220
+ if (!ancestors.includes(target)) await walk(full, kind, [...ancestors, target]);
221
+ } else if (real.isFile()) {
222
+ if (isEnvFile(name)) await listEnv(full);
223
+ else if (!c.kinds.has(full)) c.kinds.set(full, kind);
224
+ }
225
+ }
226
+ };
227
+ for (const input of inputs) {
228
+ if (throughSkipped(rel(input.abs))) continue;
229
+ if (input.kind === "env-file") {
230
+ await listEnv(input.abs);
231
+ continue;
232
+ }
233
+ const link = await lstat(input.abs).catch(() => null);
234
+ if (!link) continue;
235
+ const target = await resolved(input.abs);
236
+ if (!target) continue;
237
+ if (input.symlinkTo !== void 0 && link.isSymbolicLink()) {
238
+ const from = await realpath(dirname(input.abs));
239
+ c.links.set(input.abs, posix$1(relative(from, target)) || ".");
240
+ continue;
241
+ }
242
+ const info = await stat(target);
243
+ if (info.isDirectory()) await walk(input.abs, input.kind, [target]);
244
+ else if (!info.isFile() || c.kinds.has(input.abs)) continue;
245
+ else if (isEnvFile(basename(input.abs)) || isEnvFile(basename(target))) c.carried.push({
246
+ path: rel(input.abs),
247
+ kind: input.kind
248
+ });
249
+ else c.kinds.set(input.abs, input.kind);
250
+ }
251
+ return c;
252
+ }
253
+ /**
254
+ * Why each file in `files` can't be bundled: a secret-looking value (the history's secret scan),
255
+ * a package manager setting with a registry credential in it, or the value of a variable in
256
+ * `values` (a loaded `.env`'s, and the host's for each of the run's secrets). Each value is
257
+ * reported once a file, by the variables that hold it, and not again by the scan.
258
+ */
259
+ function leaks(files, values) {
260
+ const byValue = /* @__PURE__ */ new Map();
261
+ for (const [name, value] of values) byValue.set(value, [...byValue.get(value) ?? [], name]);
262
+ const out = [];
263
+ for (const { path, data } of files) {
264
+ const held = [...byValue].filter(([value]) => data.includes(value));
265
+ for (const [, names] of held) out.push(`${path}: holds the value of ${names.join(" and ")}`);
266
+ if (data.subarray(0, 8e3).includes(0)) continue;
267
+ let text = data.toString("utf8");
268
+ for (const [value] of held) text = text.replaceAll(value, "*".repeat(value.length));
269
+ out.push(...findingLines(path, scanText(path, text)));
270
+ const setting = REGISTRY_CREDENTIALS[basename(path)]?.exec(text)?.[1];
271
+ if (setting) out.push(`${path}: ${setting} holds a registry credential; read it from a variable instead`);
272
+ }
273
+ return out;
274
+ }
275
+ /** How to keep a `.env` file of `kind` out of what the run copies into the sandbox. */
276
+ function leaveOut(kind) {
277
+ if (kind === "file") return "leave it out of the environment's files (directory()'s glob: ['!.env*']) and give the sandbox its variables with env";
278
+ if (kind === "skill") return "leave it out of the skill with skill.local()'s exclude";
279
+ if (kind === "plugin" || kind === "plugin-build") return "move it out of the plugin's folder";
280
+ if (kind === "docker-context" || kind === "dockerfile") return "list it in the build context's .dockerignore";
281
+ if (kind === "npm") return "list it in the package's .npmignore";
282
+ return "move it out of what the run reads";
283
+ }
284
+ /**
285
+ * The bundle root: the project directory, or its git repository's top when an input (a lockfile,
286
+ * a shared skill) is outside the project but in the repository. An input outside both can't be
287
+ * placed in a clean checkout, so it's refused.
288
+ */
289
+ async function bundleRoot(project, inputs) {
290
+ const outside = inputs.filter((p) => !within(project, p));
291
+ if (!outside.length) return project;
292
+ const top = await repoTop(project);
293
+ const top_ = top ? await realpath(top) : null;
294
+ const away = outside.filter((p) => !top_ || !within(top_, p));
295
+ if (away.length) throw new UsageError(`The run reads ${plural(away.length, "file")} outside ${top_ ? "its git repository" : "the project"}, which a bundle can't place in another checkout: ${away.slice(0, 5).join(", ")}${away.length > 5 ? ", …" : ""}. Move ${away.length === 1 ? "it" : "them"} into the ${top_ ? "repository" : "project"}.`);
296
+ return top_;
297
+ }
298
+ /** `reeval bundle`: plans as `reeval run --dry-run` does and writes the run's inputs as one archive. */
299
+ async function bundleCommand(flags, filters, configPath, argv, out) {
300
+ const config = await realpath(requireConfig(configPath));
301
+ const project = dirname(config);
302
+ const given = {
303
+ filters: savedFilters(project, filters),
304
+ ...flags.profile ? { profile: flags.profile } : {},
305
+ tags: flags.tag ?? [],
306
+ traits: flags.trait ?? [],
307
+ ...flags.runs ? { runs: flags.runs } : {}
308
+ };
309
+ const planned = await dryRun(project, runArgs(given), config);
310
+ if ("code" in planned) return planned.code;
311
+ const { plan } = planned;
312
+ const inputs = (plan.inputs ?? []).map((i) => ({
313
+ ...i,
314
+ abs: isAbsolute(i.path) ? i.path : join(project, ...i.path.split("/"))
315
+ }));
316
+ const repositories = [];
317
+ for (const i of inputs) {
318
+ if (i.symlinkTo !== void 0 || !REPOSITORY_KINDS.has(i.kind)) continue;
319
+ if ((await stat(i.abs).catch(() => null))?.isDirectory()) repositories.push(`${i.path} (${i.kind})`);
320
+ }
321
+ if (repositories.length) throw new UsageError(`A bundle can't carry a local git repository, whose history reeval clones: ${repositories.join(", ")}. Point it at a remote repository to bundle the run.`);
322
+ const root = await bundleRoot(project, inputs.filter((i) => i.kind !== "env-file").map((i) => i.abs));
323
+ const installFiles = [];
324
+ for (let dir = project; within(root, dir); dir = dirname(dir)) {
325
+ for (const name of INSTALL_FILES) installFiles.push({
326
+ abs: join(dir, name),
327
+ kind: "install"
328
+ });
329
+ if (dir === root) break;
330
+ }
331
+ const { kinds, links, envFiles, values, outside, carried } = await collect([...inputs, ...installFiles], root);
332
+ if (outside.length) throw new UsageError(`The run reads through ${plural(outside.length, "link")} to files outside the bundle root, which a bundle can't carry: ${outside.slice(0, 5).join(", ")}${outside.length > 5 ? ", …" : ""}. Copy what ${outside.length === 1 ? "it links" : "they link"} to into the project.`);
333
+ if (carried.length) throw new UsageError(`The run copies ${carried.length === 1 ? "a .env file" : ".env files"} into the sandbox, and a bundle never carries one:\n${carried.map((c) => ` ${c.path} (${c.kind}): ${leaveOut(c.kind)}`).join("\n")}`);
334
+ const { inputs: _inputs, secrets = [], ...rest } = plan;
335
+ const watched = /* @__PURE__ */ new Map();
336
+ for (const [name, value] of values) if (value.length >= MIN_SECRET && (secrets.includes(name) || !/^[a-z]+$/.test(value))) watched.set(name, value);
337
+ for (const name of secrets) {
338
+ const value = process.env[name];
339
+ if (value && value.length >= MIN_SECRET) watched.set(name, value);
340
+ }
341
+ const files = [];
342
+ const entries = [];
343
+ for (const file of [...kinds.keys()].sort()) {
344
+ const path = posix$1(relative(root, file));
345
+ if (path === MANIFEST) throw new UsageError(`The run reads ${MANIFEST} at the bundle root, where the bundle keeps its own manifest. Move or rename it to bundle the run.`);
346
+ const [data, info] = await Promise.all([readFile(file), stat(file)]);
347
+ files.push({
348
+ path,
349
+ kind: kinds.get(file),
350
+ sha256: sha256(data),
351
+ size: data.length
352
+ });
353
+ entries.push({
354
+ type: "file",
355
+ path,
356
+ mode: info.mode & 73 ? 493 : 420,
357
+ mtime: Math.floor(info.mtimeMs / 1e3),
358
+ data
359
+ });
360
+ }
361
+ const bundleLinks = [...links].map(([file, target]) => ({
362
+ path: posix$1(relative(root, file)),
363
+ target
364
+ })).sort((a, b) => a.path < b.path ? -1 : 1);
365
+ const linkEntries = bundleLinks.map((l) => ({
366
+ type: "symlink",
367
+ path: l.path,
368
+ mode: 511,
369
+ mtime: Math.floor(Date.now() / 1e3),
370
+ target: l.target
371
+ }));
372
+ const git = await gitInfo(project);
373
+ const manifest = {
374
+ schemaVersion: 1,
375
+ reeval: PACKAGE_VERSION,
376
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
377
+ args: {
378
+ argv,
379
+ ...given,
380
+ ...plan.profile?.name ? { profile: plan.profile.name } : {}
381
+ },
382
+ project: posix$1(relative(root, project)),
383
+ config: posix$1(relative(root, config)),
384
+ git: git ? {
385
+ commit: git.sha,
386
+ dirty: git.dirty
387
+ } : null,
388
+ plan: rooted({
389
+ ...rest,
390
+ inputs: plan.inputs ?? [],
391
+ secrets
392
+ }, root),
393
+ files,
394
+ ...bundleLinks.length ? { links: bundleLinks } : {},
395
+ envFiles: [...envFiles.values()].sort((a, b) => a.path < b.path ? -1 : 1),
396
+ secrets
397
+ };
398
+ const manifestEntry = {
399
+ type: "file",
400
+ path: MANIFEST,
401
+ mode: 420,
402
+ mtime: Math.floor(Date.now() / 1e3),
403
+ data: Buffer.from(`${JSON.stringify(manifest, null, 2)}\n`)
404
+ };
405
+ const found = leaks([manifestEntry, ...entries].map((e) => ({
406
+ path: e.path,
407
+ data: e.data
408
+ })), watched);
409
+ if (found.length) throw new UsageError(`The bundle would carry secrets, so nothing was written:\n${found.map((l) => ` ${l}`).join("\n")}\nMove each out of the files the run reads, or read it from a variable.`);
410
+ const target = resolve(flags.out ?? `${basename(project) || "reeval"}.bundle.tar.gz`);
411
+ const archive = gzipSync(writeTar([
412
+ manifestEntry,
413
+ ...entries,
414
+ ...linkEntries
415
+ ]));
416
+ await writeFile(target, archive);
417
+ const bytes = files.reduce((n, f) => n + f.size, 0);
418
+ out(`Bundled ${plural(files.length, "file")}${bundleLinks.length ? ` and ${plural(bundleLinks.length, "link")}` : ""} (${bytes} bytes) for ${plural(Number(plan.totals?.attempts ?? 0), "attempt")} into ${relative(process.cwd(), target) || target}`);
419
+ if (secrets.length) out(` needs: ${secrets.join(", ")}`);
420
+ for (const env of manifest.envFiles) out(` left out ${env.path}${env.variables.length ? ` (${env.variables.join(", ")})` : ""}: set ${env.variables.length === 1 ? "it" : "them"} where the bundle runs`);
421
+ if (git?.dirty) out(" the project has uncommitted changes; the bundle carries them");
422
+ return 0;
423
+ }
424
+ /** Each difference between two plan documents, by JSON path, at most `limit`. */
425
+ function differences(a, b, at = "", found = [], limit = 8) {
426
+ if (found.length >= limit) return found;
427
+ if (JSON.stringify(a) === JSON.stringify(b)) return found;
428
+ const isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
429
+ if (Array.isArray(a) && Array.isArray(b) && a.length === b.length) for (const [i, v] of a.entries()) differences(v, b[i], `${at}[${i}]`, found, limit);
430
+ else if (isObj(a) && isObj(b)) for (const key of [.../* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(b)])].sort()) differences(a[key], b[key], at ? `${at}.${key}` : key, found, limit);
431
+ else {
432
+ const show = (v) => v === void 0 ? "nothing" : JSON.stringify(v).slice(0, 80);
433
+ found.push(`${at || "the plan"}: ${show(a)} → ${show(b)}`);
434
+ }
435
+ return found;
436
+ }
437
+ /** Keys of the plan that depend on the machine or its history, not on the bundle's files. */
438
+ const MACHINE_KEYS = /* @__PURE__ */ new Set([
439
+ "runId",
440
+ "estimateMs",
441
+ "cost",
442
+ "concurrency",
443
+ "stages",
444
+ "fits"
445
+ ]);
446
+ /** The parts of a plan document a bundle must reproduce. */
447
+ function comparable(plan) {
448
+ const strip = (v) => Array.isArray(v) ? v.map(strip) : typeof v === "object" && v !== null ? Object.fromEntries(Object.entries(v).filter(([k]) => !MACHINE_KEYS.has(k)).map(([k, x]) => [k, strip(x)])) : v;
449
+ const { profile, totals, evals, excluded, images, secrets } = plan;
450
+ return strip({
451
+ profile,
452
+ totals,
453
+ evals,
454
+ excluded,
455
+ images,
456
+ secrets
457
+ });
458
+ }
459
+ /** A path inside the bundle, as `safeTarPath` writes it: relative, `/`-separated, no `..`. */
460
+ const bundlePath = z.string().refine((p) => safeTarPath(p) === p && p !== MANIFEST, "must be a path inside the bundle");
461
+ const manifestSchema = z.object({
462
+ schemaVersion: z.literal(1),
463
+ reeval: z.string(),
464
+ createdAt: z.string(),
465
+ args: z.object({
466
+ argv: z.array(z.string()),
467
+ filters: z.array(z.string()),
468
+ profile: z.string().optional(),
469
+ tags: z.array(z.string()),
470
+ traits: z.array(z.string()),
471
+ runs: z.string().optional()
472
+ }),
473
+ project: z.union([z.literal(""), bundlePath]),
474
+ config: bundlePath,
475
+ git: z.object({
476
+ commit: z.string(),
477
+ dirty: z.boolean()
478
+ }).nullable(),
479
+ plan: z.record(z.string(), z.unknown()),
480
+ files: z.array(z.object({
481
+ path: bundlePath,
482
+ kind: z.string(),
483
+ sha256: z.string().regex(/^[0-9a-f]{64}$/, "must be a sha256 in hex"),
484
+ size: z.number().int().nonnegative()
485
+ })),
486
+ links: z.array(z.object({
487
+ path: bundlePath,
488
+ target: z.string()
489
+ }).refine((l) => !l.target.startsWith("/") && !!safeTarPath(posix.join(posix.dirname(l.path), l.target)), {
490
+ message: "must link to a path inside the bundle",
491
+ path: ["target"]
492
+ })).optional(),
493
+ envFiles: z.array(z.object({
494
+ path: z.string(),
495
+ variables: z.array(z.string())
496
+ })),
497
+ secrets: z.array(z.string())
498
+ });
499
+ /** `value` as a manifest, or a refusal naming the first few fields that aren't one. */
500
+ function validManifest(value, file) {
501
+ const parsed = manifestSchema.safeParse(value);
502
+ if (parsed.success) return parsed.data;
503
+ const lines = parsed.error.issues.slice(0, 5).map((issue) => {
504
+ return ` ${issue.path.map((p, i) => typeof p === "number" ? `[${p}]` : `${i ? "." : ""}${String(p)}`).join("") || "the manifest"}: ${issue.message}`;
505
+ });
506
+ throw new UsageError(`${file}'s ${MANIFEST} isn't a bundle manifest:\n${lines.join("\n")}`);
507
+ }
508
+ /** The prefix of each directory `run --bundle` extracts into, followed by its process id. */
509
+ const EXTRACT_PREFIX = "reeval-bundle-";
510
+ /** reeval's exit code after SIGINT. */
511
+ const EXIT_INTERRUPTED = 130;
512
+ const alive = (pid) => {
513
+ try {
514
+ process.kill(pid, 0);
515
+ return true;
516
+ } catch (error) {
517
+ return error.code === "EPERM";
518
+ }
519
+ };
520
+ /**
521
+ * `reeval clean --bundles`: removes every directory `run --bundle` extracted into whose process
522
+ * has ended, and returns their paths.
523
+ */
524
+ async function removeExtractedBundles() {
525
+ const removed = [];
526
+ for (const name of await readdir(tmpdir()).catch(() => [])) {
527
+ const pid = new RegExp(`^${EXTRACT_PREFIX}(\\d+)-`).exec(name)?.[1];
528
+ if (!pid || alive(Number(pid))) continue;
529
+ const dir = join(tmpdir(), name);
530
+ await rm(dir, {
531
+ recursive: true,
532
+ force: true
533
+ });
534
+ removed.push(dir);
535
+ }
536
+ return removed;
537
+ }
538
+ /**
539
+ * `reeval run --bundle`: extracts the bundle to a new temporary directory, checks every file
540
+ * against its manifest, installs from its lockfiles and dry-runs it there, and refuses (exit 2,
541
+ * naming each file) when a file is missing or differs or the plan isn't the manifest's.
542
+ */
543
+ async function openBundle(file, log) {
544
+ let entries;
545
+ try {
546
+ entries = readTar(gunzipSync(await readFile(file)));
547
+ } catch (error) {
548
+ if (error.code === "ENOENT") throw new UsageError(`No bundle at ${file}`);
549
+ throw new UsageError(`${file} isn't a reeval bundle (a .tar.gz from reeval bundle)`);
550
+ }
551
+ const manifestEntry = entries.find((e) => e.type === "file" && e.path === MANIFEST);
552
+ if (manifestEntry?.type !== "file") throw new UsageError(`${file} has no ${MANIFEST}, so it isn't a reeval bundle`);
553
+ let read;
554
+ try {
555
+ read = JSON.parse(manifestEntry.data.toString("utf8"));
556
+ } catch {
557
+ throw new UsageError(`${file}'s ${MANIFEST} isn't valid JSON`);
558
+ }
559
+ let manifest;
560
+ try {
561
+ manifest = validManifest(readableBundleManifest(read, file), file);
562
+ } catch (error) {
563
+ if (error instanceof NewerSchemaError) throw new UsageError(error.message);
564
+ throw error;
565
+ }
566
+ if (manifest.reeval !== PACKAGE_VERSION) log(`reeval: ${file} was bundled by reeval ${manifest.reeval}; this is ${PACKAGE_VERSION}, whose plan may differ`);
567
+ const inBundle = (path) => path.startsWith(`${ROOT}/`) ? safeTarPath(path.slice(7)) : safeTarPath(manifest.project ? `${manifest.project}/${path}` : path);
568
+ const planInputs = manifest.plan.inputs ?? [];
569
+ const atPath = (kind) => new Set(planInputs.filter(kind).flatMap((i) => inBundle(i.path) ?? []));
570
+ const planLinks = atPath((i) => i.symlinkTo !== void 0);
571
+ const envPaths = atPath((i) => i.kind === "env-file");
572
+ const listed = new Map(manifest.files.map((f) => [f.path, f]));
573
+ const links = new Map((manifest.links ?? []).map((l) => [l.path, l.target]));
574
+ const problems = [];
575
+ for (const [path, target] of links) if (envPaths.has(path) || isEnvFile(basename(path))) problems.push(`a link where the run loads a .env file: ${path}`);
576
+ else if (!planLinks.has(path)) problems.push(`a link its plan doesn't list: ${path}`);
577
+ else if (throughLink(path, target, links)) problems.push(`a link through another link: ${path} → ${target}`);
578
+ const files = [];
579
+ const linked = [];
580
+ for (const e of entries) {
581
+ if (e === manifestEntry) continue;
582
+ if (e.type === "symlink" && links.has(e.path) && !linked.some((x) => x.path === e.path)) {
583
+ if (links.get(e.path) === e.target) linked.push(e);
584
+ else problems.push(`differs: ${e.path}, a link to ${e.target}`);
585
+ continue;
586
+ }
587
+ if (e.type !== "file") {
588
+ problems.push(`not a regular file or a listed link: ${e.path} (a ${e.type === "dir" ? "directory" : "link"})`);
589
+ continue;
590
+ }
591
+ const f = listed.get(e.path);
592
+ if (!f) problems.push(`not in the manifest: ${e.path}`);
593
+ else if (files.some((x) => x.path === e.path)) problems.push(`in the archive twice: ${e.path}`);
594
+ else {
595
+ if (sha256(e.data) !== f.sha256) problems.push(`differs: ${f.path}`);
596
+ files.push({
597
+ ...e,
598
+ mode: e.mode & 73 ? 493 : 420
599
+ });
600
+ }
601
+ }
602
+ for (const f of manifest.files) if (!files.some((e) => e.path === f.path)) problems.push(`missing: ${f.path}`);
603
+ for (const [path] of links) if (!linked.some((e) => e.path === path)) problems.push(`missing: ${path}`);
604
+ for (const input of planInputs) {
605
+ if (input.kind === "env-file" || isAbsolute(input.path)) continue;
606
+ const path = inBundle(input.path);
607
+ if (!path) problems.push(`outside the bundle: ${input.path}`);
608
+ else if (throughSkipped(path) || isEnvFile(basename(path))) continue;
609
+ else if (!listed.has(path) && !links.has(path) && !problems.includes(`missing: ${path}`)) problems.push(`missing: ${path}`);
610
+ }
611
+ if (problems.length) throw new UsageError(`${file} doesn't match its manifest, so nothing ran:\n${problems.map((p) => ` ${p}`).join("\n")}`);
612
+ const dir = await realpath(await mkdtemp(join(tmpdir(), `${EXTRACT_PREFIX}${process.pid}-`)));
613
+ const interrupted = () => {
614
+ rmSync(dir, {
615
+ recursive: true,
616
+ force: true
617
+ });
618
+ process.exit(EXIT_INTERRUPTED);
619
+ };
620
+ process.once("SIGINT", interrupted);
621
+ try {
622
+ const skipped = await extractTar([...files, ...linked], dir);
623
+ const escapes = [];
624
+ for (const l of linked) {
625
+ const real = await realpath(join(dir, ...l.path.split("/"))).catch(() => null);
626
+ if (!real) escapes.push(` a link to nothing: ${l.path} → ${l.target}`);
627
+ else if (!within(dir, real)) escapes.push(` a link out of the bundle: ${l.path} → ${l.target}`);
628
+ }
629
+ if (skipped.length || escapes.length) throw new UsageError(`${file} doesn't match its manifest, so nothing ran:\n${[...skipped.map((p) => ` not extracted: ${p}`), ...escapes].join("\n")}`);
630
+ const project = join(dir, ...manifest.project.split("/").filter(Boolean));
631
+ const config = join(dir, ...manifest.config.split("/"));
632
+ await git(dir, ["init", "-q"]).catch(() => {});
633
+ await install(manifest, dir, log);
634
+ const planned = await dryRun(project, runArgs(manifest.args), config);
635
+ if ("code" in planned) {
636
+ log(`reeval: ${file}'s dry run in ${project} failed, so nothing ran`);
637
+ await rm(dir, {
638
+ recursive: true,
639
+ force: true
640
+ }).catch(() => {});
641
+ return {
642
+ exit: planned.code,
643
+ dir,
644
+ project,
645
+ config,
646
+ manifest
647
+ };
648
+ }
649
+ const { plan } = planned;
650
+ const differs = planDifferences(manifest, rooted(plan, dir));
651
+ if (differs.length) throw new UsageError(`${file} doesn't plan here as it did where it was bundled, so nothing ran:\n${differs.map((p) => ` ${p}`).join("\n")}`);
652
+ return {
653
+ dir,
654
+ project,
655
+ config,
656
+ manifest
657
+ };
658
+ } catch (error) {
659
+ await rm(dir, {
660
+ recursive: true,
661
+ force: true
662
+ }).catch(() => {});
663
+ throw error;
664
+ } finally {
665
+ process.off("SIGINT", interrupted);
666
+ }
667
+ }
668
+ /**
669
+ * Whether `target`, read from the link at `path` one segment at a time, passes through another
670
+ * of `links`: the lexical check can't see where that one leads, so a chain could leave the bundle.
671
+ */
672
+ function throughLink(path, target, links) {
673
+ const at = path.split("/").slice(0, -1);
674
+ for (const part of target.split("/")) if (part === "..") at.pop();
675
+ else if (part && part !== ".") {
676
+ at.push(part);
677
+ if (links.has(at.join("/"))) return true;
678
+ }
679
+ return false;
680
+ }
681
+ /** What differs between the manifest's plan and `plan`, the same run's dry run from the bundle. */
682
+ function planDifferences(manifest, plan) {
683
+ const out = [];
684
+ const project = manifest.project ? `${manifest.project}/` : "";
685
+ const inputs = (doc) => new Map((doc.inputs ?? []).filter((i) => i.kind !== "env-file").map((i) => [i.path, i.kind]));
686
+ const before = inputs(manifest.plan);
687
+ const now = inputs(plan);
688
+ const inBundle = (path) => path.startsWith(`${ROOT}/`) ? path.slice(7) : `${project}${path}`;
689
+ for (const [path, kind] of now) {
690
+ if (before.has(path)) continue;
691
+ out.push(isAbsolute(path) ? `the run reads ${path} on this machine, outside the bundle` : `the run reads ${inBundle(path)} (${kind}), which the bundle doesn't have`);
692
+ }
693
+ for (const [path] of before) if (!now.has(path)) out.push(`the bundle has ${inBundle(path)}, which the run no longer reads`);
694
+ out.push(...differences(comparable(manifest.plan), comparable(plan)).map((d) => `plan: ${d}`));
695
+ return out;
696
+ }
697
+ /** Installs from each lockfile in the bundle, in its directory, the way its lockfile pins. */
698
+ async function install(manifest, dir, log) {
699
+ for (const f of manifest.files) {
700
+ if (f.kind !== "lockfile") continue;
701
+ const how = INSTALLS.find((i) => i.lockfile === basename(f.path));
702
+ if (!how) continue;
703
+ const at = join(dir, ...dirname(f.path).split("/").filter((p) => p !== "."));
704
+ const [cmd, ...args] = how.command(at);
705
+ log(`reeval: installing from ${f.path}: ${cmd} ${args.join(" ")}`);
706
+ const result = await run(cmd, args, { cwd: at }).catch((error) => {
707
+ if (error.code === "ENOENT") throw new UsageError(`The bundle installs from ${f.path} with ${cmd}, which isn't on this machine's PATH. Install ${cmd}, then run it again.`);
708
+ throw error;
709
+ });
710
+ if (result.exitCode !== 0) {
711
+ const said = `${result.stderr}\n${result.stdout}`.trim().split("\n").slice(-20).join("\n");
712
+ throw new PreflightInfraError(`${cmd} ${args.join(" ")} failed (exit ${result.exitCode}) installing from ${f.path}, so nothing ran:\n${said}`);
713
+ }
714
+ }
715
+ }
716
+ export { bundleCommand, openBundle, removeExtractedBundles };
717
+
718
+ //# sourceMappingURL=bundle-DZstHDeW.js.map