reeval 0.23.0 → 0.25.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 (574) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +17 -17
  3. package/THIRD_PARTY_NOTICES.md +0 -2068
  4. package/assets/package.json +1 -1
  5. package/assets/pnpm-lock.yaml +65 -50
  6. package/dist/{adapter-Dlq3-4OS.js → adapter-vLxVtLdk.js} +6 -6
  7. package/dist/{adapter-Dlq3-4OS.js.map → adapter-vLxVtLdk.js.map} +1 -1
  8. package/dist/{agent-OsAfayRf.js → agent-DN36i629.js} +9 -9
  9. package/dist/{agent-OsAfayRf.js.map → agent-DN36i629.js.map} +1 -1
  10. package/dist/{agents-BztvTkfM.js → agents-Bp40Y7Lk.js} +47 -59
  11. package/dist/agents-Bp40Y7Lk.js.map +1 -0
  12. package/dist/{analysis-BnG_1x_O.js → analysis-8vvMnUJB.js} +4 -5
  13. package/dist/analysis-8vvMnUJB.js.map +1 -0
  14. package/dist/api-ZeGnedB3.js +141 -0
  15. package/dist/api-ZeGnedB3.js.map +1 -0
  16. package/dist/assemble-ChNVeWNr.js +1 -0
  17. package/dist/{assemble-Doa1m-HW.js → assemble-DsllweEG.js} +132 -68
  18. package/dist/assemble-DsllweEG.js.map +1 -0
  19. package/dist/{attach-BH2HdwH_.js → attach-DFf2hFl7.js} +18 -10
  20. package/dist/attach-DFf2hFl7.js.map +1 -0
  21. package/dist/{attempt-_dUsblVx.js → attempt-CfwXgF2q.js} +3 -3
  22. package/dist/{attempt-_dUsblVx.js.map → attempt-CfwXgF2q.js.map} +1 -1
  23. package/dist/{attempt-host-8mQV8Uee.js → attempt-host-XyyFR6jc.js} +37 -14
  24. package/dist/attempt-host-XyyFR6jc.js.map +1 -0
  25. package/dist/boat-BCNNEJni.js +298 -0
  26. package/dist/boat-BCNNEJni.js.map +1 -0
  27. package/dist/{boat-DKjqo_ie.js → boat-CNUnhvWH.js} +117 -197
  28. package/dist/boat-CNUnhvWH.js.map +1 -0
  29. package/dist/boat-DRTQHXlj.js +1 -0
  30. package/dist/{boat-images-CRN_U_eG.js → boat-images-B0MsRBFx.js} +18 -22
  31. package/dist/boat-images-B0MsRBFx.js.map +1 -0
  32. package/dist/{bundle-DU2aQVeq.js → bundle-B1v8DEEX.js} +26 -15
  33. package/dist/bundle-B1v8DEEX.js.map +1 -0
  34. package/dist/{capture-By1byHaX.js → capture-BAtaw-L-.js} +20 -19
  35. package/dist/{capture-By1byHaX.js.map → capture-BAtaw-L-.js.map} +1 -1
  36. package/dist/capture-DOHR_KXl.js +1 -0
  37. package/dist/cases-Bsp-G-ZL.js +1 -0
  38. package/dist/{cases-CM-MQRQp.js → cases-C6vnV-gn.js} +61 -43
  39. package/dist/cases-C6vnV-gn.js.map +1 -0
  40. package/dist/classify-BIJQ2Xqo.js +163 -0
  41. package/dist/classify-BIJQ2Xqo.js.map +1 -0
  42. package/dist/{cli-DMHOwdVr.js → cli-BFfZy9Ax.js} +385 -178
  43. package/dist/cli-BFfZy9Ax.js.map +1 -0
  44. package/dist/{cli-spec-D0wuUaj9.js → cli-spec-Bj2z-4Pa.js} +242 -39
  45. package/dist/cli-spec-Bj2z-4Pa.js.map +1 -0
  46. package/dist/cli.js +6 -2
  47. package/dist/cli.js.map +1 -1
  48. package/dist/client-Dj65gXG3.js +105 -0
  49. package/dist/client-Dj65gXG3.js.map +1 -0
  50. package/dist/cloud-DgMSxpCk.js +154 -0
  51. package/dist/cloud-DgMSxpCk.js.map +1 -0
  52. package/dist/{hosted-5Zz2peTR.js → cloud-TuNUlZ0L.js} +31 -31
  53. package/dist/cloud-TuNUlZ0L.js.map +1 -0
  54. package/dist/cloud-files-BjoNhDJs.js +301 -0
  55. package/dist/cloud-files-BjoNhDJs.js.map +1 -0
  56. package/dist/cloud-project-B1lN8D9m.js +1 -0
  57. package/dist/cloud-project-Dh17iadw.js +110 -0
  58. package/dist/cloud-project-Dh17iadw.js.map +1 -0
  59. package/dist/cloud-push-CdYqsM34.js +817 -0
  60. package/dist/cloud-push-CdYqsM34.js.map +1 -0
  61. package/dist/cloud-push-GXvEYHoa.js +1 -0
  62. package/dist/cloud-run-BfFCs6Fm.js +1 -0
  63. package/dist/cloud-run-CZOpabN1.js +517 -0
  64. package/dist/cloud-run-CZOpabN1.js.map +1 -0
  65. package/dist/cloud-secrets-BskXM_2n.js +1 -0
  66. package/dist/cloud-secrets-DrrgGOF_.js +345 -0
  67. package/dist/cloud-secrets-DrrgGOF_.js.map +1 -0
  68. package/dist/{command-CXxckfsq.js → command-Bic6f84Y.js} +28 -130
  69. package/dist/command-Bic6f84Y.js.map +1 -0
  70. package/dist/{command-CAmnWLFL.js → command-C7m3ZoXS.js} +93 -27
  71. package/dist/command-C7m3ZoXS.js.map +1 -0
  72. package/dist/command-DHrT6YVl.js +183 -0
  73. package/dist/command-DHrT6YVl.js.map +1 -0
  74. package/dist/command-DMwSLfJT.js +141 -0
  75. package/dist/command-DMwSLfJT.js.map +1 -0
  76. package/dist/{command-ao0NZ8h0.js → command-DP8sQ-dk.js} +29 -23
  77. package/dist/command-DP8sQ-dk.js.map +1 -0
  78. package/dist/{commands-ttChCsAy.js → commands-BPLexk6R.js} +62 -41
  79. package/dist/commands-BPLexk6R.js.map +1 -0
  80. package/dist/commands-D8D7ZJ0I.js +1 -0
  81. package/dist/{config-myJT1Qjc.js → config-DQqcGmz7.js} +67 -47
  82. package/dist/config-DQqcGmz7.js.map +1 -0
  83. package/dist/core-BXYzOEyQ.js +2058 -0
  84. package/dist/core-BXYzOEyQ.js.map +1 -0
  85. package/dist/{slug-IHh3f770.js → cost-DQ0ayy6h.js} +37 -2
  86. package/dist/cost-DQ0ayy6h.js.map +1 -0
  87. package/dist/{cost-C21gGrju.js → cost-Dp-xFGJ1.js} +2 -2
  88. package/dist/{cost-C21gGrju.js.map → cost-Dp-xFGJ1.js.map} +1 -1
  89. package/dist/{cost-CdRX1s2p.js → cost-a_rUSdsf.js} +1 -1
  90. package/dist/{cursor-catalog-CUQrabJ_.js → cursor-catalog-DQCmwsX3.js} +4 -4
  91. package/dist/{cursor-catalog-CUQrabJ_.js.map → cursor-catalog-DQCmwsX3.js.map} +1 -1
  92. package/dist/{daytona-Dfhwtr9P.js → daytona-DOeJzXl_.js} +27 -19
  93. package/dist/daytona-DOeJzXl_.js.map +1 -0
  94. package/dist/{daytona-image-CnG6G00x.js → daytona-image-B9JpVeP5.js} +5 -4
  95. package/dist/daytona-image-B9JpVeP5.js.map +1 -0
  96. package/dist/daytona-image-BsCbvDGn.js +1 -0
  97. package/dist/db-BqFlDMmS.js +1 -0
  98. package/dist/{db-5H95sFii.js → db-DU3fgU0h.js} +32 -120
  99. package/dist/db-DU3fgU0h.js.map +1 -0
  100. package/dist/debug-CGg7KHKq.js +1 -0
  101. package/dist/{debug-CIXzB4wK.js → debug-T29p6HOX.js} +2 -10
  102. package/dist/debug-T29p6HOX.js.map +1 -0
  103. package/dist/{default-effort-DYpCkJRk.js → default-effort-BFl6WLBi.js} +3 -3
  104. package/dist/{default-effort-DYpCkJRk.js.map → default-effort-BFl6WLBi.js.map} +1 -1
  105. package/dist/{default-effort-CtNY9CGW.js → default-effort-C6Gcd-Fy.js} +1 -1
  106. package/dist/{dist-DeqeCUZe.js → dist-DCG7vZGQ.js} +3 -3
  107. package/dist/{dist-DeqeCUZe.js.map → dist-DCG7vZGQ.js.map} +1 -1
  108. package/dist/{docker-kpudeSxV.js → docker-B5YBmpPz.js} +1 -1
  109. package/dist/{docker-CR0JZ1FE.js → docker-hIo_H0W0.js} +4 -4
  110. package/dist/{docker-CR0JZ1FE.js.map → docker-hIo_H0W0.js.map} +1 -1
  111. package/dist/{doctor-aE-RMbB_.js → doctor-DGWbvYtu.js} +29 -29
  112. package/dist/{doctor-aE-RMbB_.js.map → doctor-DGWbvYtu.js.map} +1 -1
  113. package/dist/duration-Bz2H7pXb.js +34 -0
  114. package/dist/duration-Bz2H7pXb.js.map +1 -0
  115. package/dist/{environment-C8pUCD_A.js → environment-WC8PrLoe.js} +14 -11
  116. package/dist/environment-WC8PrLoe.js.map +1 -0
  117. package/dist/errors-BjzEWESY.js +93 -0
  118. package/dist/errors-BjzEWESY.js.map +1 -0
  119. package/dist/{errors-DPUoUTdK.js → errors-Cda7UzRA.js} +2 -2
  120. package/dist/{errors-DPUoUTdK.js.map → errors-Cda7UzRA.js.map} +1 -1
  121. package/dist/{eval-source-CaLIGH3U.js → eval-source-DL1HOi8U.js} +6 -6
  122. package/dist/{eval-source-CaLIGH3U.js.map → eval-source-DL1HOi8U.js.map} +1 -1
  123. package/dist/{evaluate-4kBVtwZZ.js → evaluate-DHnD8yzq.js} +280 -59
  124. package/dist/evaluate-DHnD8yzq.js.map +1 -0
  125. package/dist/{evaluate-DHaNtgVf.d.ts → evaluate-Nnh0iPuo.d.ts} +2 -3
  126. package/dist/{events-CXxFvVMK.js → events-oe84EOLK.js} +153 -34
  127. package/dist/{events-CXxFvVMK.js.map → events-oe84EOLK.js.map} +1 -1
  128. package/dist/{fake-bootstrap-CzxrCqO3.js → fake-bootstrap-Ct1qEs-Z.js} +2 -2
  129. package/dist/{fake-bootstrap-CzxrCqO3.js.map → fake-bootstrap-Ct1qEs-Z.js.map} +1 -1
  130. package/dist/files-2fO6iaJG.js +1 -0
  131. package/dist/{files-DpwJW3w6.js → files-4Qt4KUyR.js} +3 -3
  132. package/dist/{files-DpwJW3w6.js.map → files-4Qt4KUyR.js.map} +1 -1
  133. package/dist/{files-DgHeTdCZ.js → files-4XWe_gow.js} +27 -41
  134. package/dist/files-4XWe_gow.js.map +1 -0
  135. package/dist/files-63CNzRBF.js +1 -0
  136. package/dist/files-BDkCNIEh.js +1 -0
  137. package/dist/{files-CDfG8swM.js → files-Bv6ipFjc.js} +27 -18
  138. package/dist/files-Bv6ipFjc.js.map +1 -0
  139. package/dist/{files-Cs2dtb7-.js → files-ClUbQPj9.js} +2 -2
  140. package/dist/{files-Cs2dtb7-.js.map → files-ClUbQPj9.js.map} +1 -1
  141. package/dist/files-CzgXLYGq.js +1609 -0
  142. package/dist/files-CzgXLYGq.js.map +1 -0
  143. package/dist/files-DCcRkJN4.js +1 -0
  144. package/dist/{files-BkvxIqfI.js → files-DW8y3WCx.js} +5 -5
  145. package/dist/{files-BkvxIqfI.js.map → files-DW8y3WCx.js.map} +1 -1
  146. package/dist/gateway.d.ts +2 -3
  147. package/dist/{git-BnnNEXqh.js → git-CiCya2yZ.js} +3 -3
  148. package/dist/{git-BnnNEXqh.js.map → git-CiCya2yZ.js.map} +1 -1
  149. package/dist/{harness-FcTyyPco.js → harness-Dcd3ffkY.js} +3 -2
  150. package/dist/harness-Dcd3ffkY.js.map +1 -0
  151. package/dist/{harness-nwnyghJZ.js → harness-DvqNGwl6.js} +3 -3
  152. package/dist/{harness-nwnyghJZ.js.map → harness-DvqNGwl6.js.map} +1 -1
  153. package/dist/{harness-install-BfMBYDfP.js → harness-install-BSet5fE5.js} +4 -3
  154. package/dist/harness-install-BSet5fE5.js.map +1 -0
  155. package/dist/harness.d.ts +2 -3
  156. package/dist/harness.js +1 -1
  157. package/dist/http-DtlSzw4A.js +96 -0
  158. package/dist/http-DtlSzw4A.js.map +1 -0
  159. package/dist/{ids-a6cr243_.js → ids-CtxRn13a.js} +3 -2
  160. package/dist/ids-CtxRn13a.js.map +1 -0
  161. package/dist/{images-DtXwj2wL.js → images-BkJn7NHU.js} +13 -13
  162. package/dist/{images-DtXwj2wL.js.map → images-BkJn7NHU.js.map} +1 -1
  163. package/dist/index.d.ts +9 -5
  164. package/dist/index.js +4 -5
  165. package/dist/init-BOYNr3Ql.js +1 -0
  166. package/dist/{init-Ci_IAp8p.js → init-CAJvEKEt.js} +6 -6
  167. package/dist/{init-Ci_IAp8p.js.map → init-CAJvEKEt.js.map} +1 -1
  168. package/dist/{ink-list-Dnh6XD3C.js → ink-list-BJIKlKpN.js} +3 -3
  169. package/dist/{ink-list-Dnh6XD3C.js.map → ink-list-BJIKlKpN.js.map} +1 -1
  170. package/dist/{inputs-z4JqnQ5g.js → inputs-CjhDEzr4.js} +6 -6
  171. package/dist/{inputs-z4JqnQ5g.js.map → inputs-CjhDEzr4.js.map} +1 -1
  172. package/dist/inputs-load-C8HEtAej.js +1 -0
  173. package/dist/{inputs-load-DPUP_IFL.js → inputs-load-DQRC3dUA.js} +3 -3
  174. package/dist/{inputs-load-DPUP_IFL.js.map → inputs-load-DQRC3dUA.js.map} +1 -1
  175. package/dist/internal/vm-api/boat.d.ts +46 -0
  176. package/dist/internal/vm-api/boat.js +1 -0
  177. package/dist/internal/vm-api/daytona.d.ts +26 -0
  178. package/dist/internal/vm-api/daytona.js +220 -0
  179. package/dist/internal/vm-api/daytona.js.map +1 -0
  180. package/dist/internal/vm-api.d.ts +86 -0
  181. package/dist/internal/vm-api.js +3 -0
  182. package/dist/internal/vm.d.ts +7 -8
  183. package/dist/internal/vm.js +6 -6
  184. package/dist/internal/vm.js.map +1 -1
  185. package/dist/{invocations-C1gY3E0J.js → invocations-DUFiIb_S.js} +6 -6
  186. package/dist/{invocations-C1gY3E0J.js.map → invocations-DUFiIb_S.js.map} +1 -1
  187. package/dist/issue-BKMnnit3.js +120 -0
  188. package/dist/issue-BKMnnit3.js.map +1 -0
  189. package/dist/issue-esBvB5Df.js +1 -0
  190. package/dist/{jiti-ILwyxt93.js → jiti-aNfS_lSj.js} +2 -2
  191. package/dist/{jiti-ILwyxt93.js.map → jiti-aNfS_lSj.js.map} +1 -1
  192. package/dist/{judge-DwzqucLS.js → judge-_fsdF4YB.js} +7 -4
  193. package/dist/judge-_fsdF4YB.js.map +1 -0
  194. package/dist/judge.d.ts +5 -6
  195. package/dist/judge.js +1 -1
  196. package/dist/{judgments-Cj8bFaDG.js → judgments-CVCUWT-g.js} +8 -5
  197. package/dist/{judgments-Cj8bFaDG.js.map → judgments-CVCUWT-g.js.map} +1 -1
  198. package/dist/{kinds-DEKXOWVJ.js → kinds-5utDFJ15.js} +37 -12
  199. package/dist/kinds-5utDFJ15.js.map +1 -0
  200. package/dist/labels-Dtyf5-pd.js +251 -0
  201. package/dist/labels-Dtyf5-pd.js.map +1 -0
  202. package/dist/{layout-nCnU9Vu2.js → layout-Co4tPHWI.js} +3 -3
  203. package/dist/{layout-nCnU9Vu2.js.map → layout-Co4tPHWI.js.map} +1 -1
  204. package/dist/link-Dat_O7Gn.js +128 -0
  205. package/dist/link-Dat_O7Gn.js.map +1 -0
  206. package/dist/{list-MK4L8tfW.js → list-CjcNH-5e.js} +13 -8
  207. package/dist/list-CjcNH-5e.js.map +1 -0
  208. package/dist/live-BElpkw5b.js +56 -0
  209. package/dist/live-BElpkw5b.js.map +1 -0
  210. package/dist/{live-Dlq-S2yy.js → live-BRF0ogR6.js} +3 -5
  211. package/dist/live-BRF0ogR6.js.map +1 -0
  212. package/dist/{machine-service-Byl0BlcT.js → machine-service-Cymfk7E-.js} +1 -1
  213. package/dist/{machine-service-CZiXiVsS.js → machine-service-DYdTM_rW.js} +146 -13
  214. package/dist/machine-service-DYdTM_rW.js.map +1 -0
  215. package/dist/{machines-Ch5bhgvk.js → machines-B6rS9-Xu.js} +38 -38
  216. package/dist/{machines-Ch5bhgvk.js.map → machines-B6rS9-Xu.js.map} +1 -1
  217. package/dist/markdown-COts-jxf.js +653 -0
  218. package/dist/markdown-COts-jxf.js.map +1 -0
  219. package/dist/{model-lLaUxxno.js → model-BdLvfSQO.js} +1 -1
  220. package/dist/{model-DRa7yv6K.js → model-CIMBjBS7.js} +5 -5
  221. package/dist/{model-DRa7yv6K.js.map → model-CIMBjBS7.js.map} +1 -1
  222. package/dist/model-CrsA2Evf.js +1 -0
  223. package/dist/{model-CRh8aiYS.js → model-oBFmfzES.js} +4 -4
  224. package/dist/{model-CRh8aiYS.js.map → model-oBFmfzES.js.map} +1 -1
  225. package/dist/{model-LoLnq9y1.js → model-xemZQ7DK.js} +251 -65
  226. package/dist/model-xemZQ7DK.js.map +1 -0
  227. package/dist/{node-BQjSQw0d.js → node-DyRPGAT5.js} +19 -8
  228. package/dist/{node-BQjSQw0d.js.map → node-DyRPGAT5.js.map} +1 -1
  229. package/dist/options-CeIRZslO.js +1 -0
  230. package/dist/otlp-ehLWBhVL.js +123 -0
  231. package/dist/otlp-ehLWBhVL.js.map +1 -0
  232. package/dist/outcome-1LBk2e3w.js +38 -0
  233. package/dist/outcome-1LBk2e3w.js.map +1 -0
  234. package/dist/{patch-D8X6VB-e.js → patch-BgSw3TXR.js} +3 -3
  235. package/dist/{patch-D8X6VB-e.js.map → patch-BgSw3TXR.js.map} +1 -1
  236. package/dist/{patch-C7yBztZj.js → patch-uwo6t4Zy.js} +26 -2
  237. package/dist/patch-uwo6t4Zy.js.map +1 -0
  238. package/dist/{pi-providers-HygmL1y-.js → pi-providers-BjcQv2A1.js} +23 -9
  239. package/dist/{pi-providers-HygmL1y-.js.map → pi-providers-BjcQv2A1.js.map} +1 -1
  240. package/dist/{plain-Ctn8oUdp.js → plain-DXUNwqpO.js} +2 -2
  241. package/dist/{plain-Ctn8oUdp.js.map → plain-DXUNwqpO.js.map} +1 -1
  242. package/dist/{plan-DgIVIrXJ.js → plan-x-_vZMQH.js} +11 -11
  243. package/dist/{plan-DgIVIrXJ.js.map → plan-x-_vZMQH.js.map} +1 -1
  244. package/dist/{plugins-DvEbow6a.js → plugins-0DuNw_c5.js} +7 -7
  245. package/dist/{plugins-DvEbow6a.js.map → plugins-0DuNw_c5.js.map} +1 -1
  246. package/dist/{preflight-dJqs5x3r.js → preflight-0Wt3wufx.js} +1 -1
  247. package/dist/preflight-CKrvQ-of.js +1 -0
  248. package/dist/{preflight-BKGbxN67.js → preflight-CUc-Y1d3.js} +9 -9
  249. package/dist/{preflight-BKGbxN67.js.map → preflight-CUc-Y1d3.js.map} +1 -1
  250. package/dist/{preflight-Qm4wE094.js → preflight-Cce8YEPE.js} +4 -4
  251. package/dist/{preflight-Qm4wE094.js.map → preflight-Cce8YEPE.js.map} +1 -1
  252. package/dist/{prepare-CRPPfRJf.js → prepare-Bj8KzeBU.js} +2 -2
  253. package/dist/{prepare-BAjRSoku.js → prepare-FXc1YcxO.js} +8 -8
  254. package/dist/{prepare-BAjRSoku.js.map → prepare-FXc1YcxO.js.map} +1 -1
  255. package/dist/prices-CfnkJOth.js +1 -0
  256. package/dist/{prices-DCokI_Ka.js → prices-CoLymMRd.js} +3 -3
  257. package/dist/{prices-DCokI_Ka.js.map → prices-CoLymMRd.js.map} +1 -1
  258. package/dist/process-B86Nvm4J.js +118 -0
  259. package/dist/process-B86Nvm4J.js.map +1 -0
  260. package/dist/provenance-Cylt_YxT.d.ts +222 -0
  261. package/dist/{provenance-CSyRCc9B.js → provenance-DDZGWE4O.js} +6 -6
  262. package/dist/{provenance-CSyRCc9B.js.map → provenance-DDZGWE4O.js.map} +1 -1
  263. package/dist/provider-B24hZX95.js +1 -0
  264. package/dist/{provider-ieWOn4YS.js → provider-Cn7lmECy.js} +2 -2
  265. package/dist/{provider-ieWOn4YS.js.map → provider-Cn7lmECy.js.map} +1 -1
  266. package/dist/{provider-stop-CxzWW7Ft.js → provider-stop-DjBMfZW5.js} +2 -2
  267. package/dist/{provider-stop-CxzWW7Ft.js.map → provider-stop-DjBMfZW5.js.map} +1 -1
  268. package/dist/{providers-DxZ26YoG.js → providers-BPujoqQM.js} +1 -1
  269. package/dist/{providers-DkaEJvF5.js → providers-Cqb25Aq1.js} +35 -35
  270. package/dist/{providers-DkaEJvF5.js.map → providers-Cqb25Aq1.js.map} +1 -1
  271. package/dist/{query-BL66BOqL.js → query-C_lwW-ok.js} +2 -2
  272. package/dist/{query-BL66BOqL.js.map → query-C_lwW-ok.js.map} +1 -1
  273. package/dist/query-DzS1Z4bw.js +1 -0
  274. package/dist/{questions-boVPzGoC.js → questions-DRPM7pky.js} +19 -13
  275. package/dist/questions-DRPM7pky.js.map +1 -0
  276. package/dist/{recipe-qyIpP96r.js → recipe-CV_EifJk.js} +4 -4
  277. package/dist/{recipe-qyIpP96r.js.map → recipe-CV_EifJk.js.map} +1 -1
  278. package/dist/{record-D1_D1KFY.js → record-Cj3yWR0E.js} +50 -13
  279. package/dist/record-Cj3yWR0E.js.map +1 -0
  280. package/dist/{redact-t-L3VGy8.js → redact-DMueYS-v.js} +28 -6
  281. package/dist/redact-DMueYS-v.js.map +1 -0
  282. package/dist/{remarks-DqriPKxm.js → remarks-BPKGorBW.js} +4 -2
  283. package/dist/remarks-BPKGorBW.js.map +1 -0
  284. package/dist/{remarks-DEvk5f8v.js → remarks-Bded6YeV.js} +22 -12
  285. package/dist/{remarks-DEvk5f8v.js.map → remarks-Bded6YeV.js.map} +1 -1
  286. package/dist/{remote-CQoBRpOv.js → remote-DMuAUedR.js} +9 -7
  287. package/dist/{remote-CQoBRpOv.js.map → remote-DMuAUedR.js.map} +1 -1
  288. package/dist/renderer/ascii.d.ts +6 -0
  289. package/dist/renderer/ascii.js +7 -0
  290. package/dist/renderer/ascii.js.map +1 -0
  291. package/dist/renderer/markdown.d.ts +31 -0
  292. package/dist/renderer/markdown.js +1 -0
  293. package/dist/report-BSi-R8hC.js +941 -0
  294. package/dist/report-BSi-R8hC.js.map +1 -0
  295. package/dist/report-inputs-JhiwKAZH.js +113 -0
  296. package/dist/report-inputs-JhiwKAZH.js.map +1 -0
  297. package/dist/{resolve-Bfo8sjd-.js → resolve-BEltmYhD.js} +23 -7
  298. package/dist/resolve-BEltmYhD.js.map +1 -0
  299. package/dist/resolve-s6JzFZu0.js +1 -0
  300. package/dist/{resolve-D2RqmybX.js → resolve-usf6ejs_.js} +64 -19
  301. package/dist/resolve-usf6ejs_.js.map +1 -0
  302. package/dist/{results-BpxzyoMd.js → results-rYLTGa1F.js} +11 -7
  303. package/dist/{results-BpxzyoMd.js.map → results-rYLTGa1F.js.map} +1 -1
  304. package/dist/{resume-2ekm_9OB.js → resume-aGIZhM58.js} +7 -7
  305. package/dist/{resume-2ekm_9OB.js.map → resume-aGIZhM58.js.map} +1 -1
  306. package/dist/{retry-CAhpW1hH.js → retry-BNFAHTES.js} +5 -5
  307. package/dist/{retry-CAhpW1hH.js.map → retry-BNFAHTES.js.map} +1 -1
  308. package/dist/{root-BzeoyfGd.js → root-Co0jhOT5.js} +2 -2
  309. package/dist/{root-BzeoyfGd.js.map → root-Co0jhOT5.js.map} +1 -1
  310. package/dist/run-DSKRllpd.js +127 -0
  311. package/dist/run-DSKRllpd.js.map +1 -0
  312. package/dist/{client-B41UK150.js → runtime-B2zv9GPL.js} +525 -105
  313. package/dist/runtime-B2zv9GPL.js.map +1 -0
  314. package/dist/sandbox/boat.d.ts +4 -5
  315. package/dist/sandbox/boat.js +2 -2
  316. package/dist/sandbox/daytona.d.ts +4 -5
  317. package/dist/sandbox/daytona.js +1 -1
  318. package/dist/{sandbox-t-Q-8lA_.js → sandbox-DbTHBA7g.js} +3 -3
  319. package/dist/{sandbox-t-Q-8lA_.js.map → sandbox-DbTHBA7g.js.map} +1 -1
  320. package/dist/sandbox.d.ts +4 -5
  321. package/dist/sandbox.js +1 -1
  322. package/dist/secrets-file-BEScYC3S.js +100 -0
  323. package/dist/secrets-file-BEScYC3S.js.map +1 -0
  324. package/dist/secrets-file-take-BXfYMTM-.js +33 -0
  325. package/dist/secrets-file-take-BXfYMTM-.js.map +1 -0
  326. package/dist/server-BIqAFNjF.js +1 -0
  327. package/dist/server-Dc-V_-C1.js +204 -0
  328. package/dist/server-Dc-V_-C1.js.map +1 -0
  329. package/dist/{services-BG8xuU82.js → services-CHh83UDC.js} +4 -2
  330. package/dist/services-CHh83UDC.js.map +1 -0
  331. package/dist/shared-B3iLKAiu.d.ts +1 -0
  332. package/dist/{shared-DtZwIAfy.js → shared-bXaqVxk-.js} +5 -34
  333. package/dist/shared-bXaqVxk-.js.map +1 -0
  334. package/dist/skill-dirs-B7o83G5I.js +63 -0
  335. package/dist/skill-dirs-B7o83G5I.js.map +1 -0
  336. package/dist/{source-CrXM19HD.js → source-BodZTD70.js} +33 -18
  337. package/dist/source-BodZTD70.js.map +1 -0
  338. package/dist/source-BtdFbZLW.js +1 -0
  339. package/dist/spans-C3FlFC22.js +1 -0
  340. package/dist/spans-Dq3fo6HM.js +6 -0
  341. package/dist/spans-Dq3fo6HM.js.map +1 -0
  342. package/dist/spans-WvAmJF2z.js +72 -0
  343. package/dist/spans-WvAmJF2z.js.map +1 -0
  344. package/dist/{src-C6MsGyD6.js → src-AAdLbAn2.js} +1 -1
  345. package/dist/{src-VG2IRoT4.js → src-BbaLTc-p.js} +2 -2
  346. package/dist/src-BjiNaGf5.js +2 -0
  347. package/dist/{src-Cf4vRyea.js → src-BkkdN2w0.js} +2 -2
  348. package/dist/{src-C5rrQlt8.js → src-BzeiF5Lh.js} +197 -138
  349. package/dist/src-BzeiF5Lh.js.map +1 -0
  350. package/dist/{src-Ds1pmXTg.js → src-CfPSD_GS.js} +2 -2
  351. package/dist/{src-C-ChdnG6.js → src-ClMhIgi3.js} +2 -2
  352. package/dist/{src-C-ChdnG6.js.map → src-ClMhIgi3.js.map} +1 -1
  353. package/dist/{src-io_SKoZ5.js → src-D5i8gCa3.js} +2 -2
  354. package/dist/{src-Bb3k9Kn_.js → src-DDIV_RfE.js} +65 -10
  355. package/dist/{src-Bb3k9Kn_.js.map → src-DDIV_RfE.js.map} +1 -1
  356. package/dist/src-DXZXofCJ.js +1 -0
  357. package/dist/src-Db01fVzc.js +2 -0
  358. package/dist/{src-DwcTn4JY.js → src-DhZuOcgq.js} +5 -5
  359. package/dist/{src-DwcTn4JY.js.map → src-DhZuOcgq.js.map} +1 -1
  360. package/dist/{src-DwcCKsV0.js → src-DiBd7r1i.js} +3 -3
  361. package/dist/{src-DNWiU__5.js → src-Dm2YIeXn.js} +8 -8
  362. package/dist/{src-DNWiU__5.js.map → src-Dm2YIeXn.js.map} +1 -1
  363. package/dist/{src-c3ZQu7Uu.js → src-NYxoDS3b.js} +5 -5
  364. package/dist/{src-c3ZQu7Uu.js.map → src-NYxoDS3b.js.map} +1 -1
  365. package/dist/{src-C3OhA5pw.js → src-Y4AiZxLt.js} +5 -5
  366. package/dist/{src-C3OhA5pw.js.map → src-Y4AiZxLt.js.map} +1 -1
  367. package/dist/{src-Bf5RZlPi.js → src-YpmRtJmP.js} +2 -2
  368. package/dist/{src-Bf5RZlPi.js.map → src-YpmRtJmP.js.map} +1 -1
  369. package/dist/{ssh-pool-Dvfx5GuV.js → ssh-pool-B2c2vxzx.js} +20 -16
  370. package/dist/ssh-pool-B2c2vxzx.js.map +1 -0
  371. package/dist/ssh-pool-mcCYe6RO.js +1 -0
  372. package/dist/{start-COB07NpH.js → start-DyXCyHGX.js} +64 -12
  373. package/dist/start-DyXCyHGX.js.map +1 -0
  374. package/dist/{state-B319V1p8.js → state-CiR8Ema7.js} +21 -38
  375. package/dist/state-CiR8Ema7.js.map +1 -0
  376. package/dist/state-DBuFimCA.js +1 -0
  377. package/dist/store/local.d.ts +2 -3
  378. package/dist/store/s3.d.ts +2 -3
  379. package/dist/studio-share-C05twqpy.js +209 -0
  380. package/dist/studio-share-C05twqpy.js.map +1 -0
  381. package/dist/suite-fO-u8jlS.js +2 -0
  382. package/dist/{suite-D1tgXZxM.js → suite-oH7uiCRq.js} +108 -107
  383. package/dist/suite-oH7uiCRq.js.map +1 -0
  384. package/dist/summary-CTMWfnOF.js +75 -0
  385. package/dist/summary-CTMWfnOF.js.map +1 -0
  386. package/dist/{sync-mOG74RXH.js → sync-r8EvW6Hr.js} +6 -6
  387. package/dist/{sync-mOG74RXH.js.map → sync-r8EvW6Hr.js.map} +1 -1
  388. package/dist/{tart-DMppfbEm.js → tart-BUh58nxA.js} +37 -10
  389. package/dist/tart-BUh58nxA.js.map +1 -0
  390. package/dist/{tart-DmVuVsmX.js → tart-DNrumWZu.js} +1 -1
  391. package/dist/{tart-CzViW3WZ.js → tart-Duqp33Zh.js} +2 -2
  392. package/dist/{tart-CzViW3WZ.js.map → tart-Duqp33Zh.js.map} +1 -1
  393. package/dist/{tart-bake-Cva_qdir.js → tart-bake-ChrVpjuF.js} +8 -7
  394. package/dist/tart-bake-ChrVpjuF.js.map +1 -0
  395. package/dist/{tart-bake-DVIoXWr_.js → tart-bake-LwdUVOzS.js} +1 -1
  396. package/dist/{tart-cli-LzDud2Z6.js → tart-cli-Dv3dNC13.js} +3 -2
  397. package/dist/tart-cli-Dv3dNC13.js.map +1 -0
  398. package/dist/{tart-cli-D88c5YYJ.js → tart-cli-S388NU-r.js} +1 -1
  399. package/dist/{tart-hosts-CTRY5kQ2.js → tart-hosts-B-dQEGpc.js} +7 -6
  400. package/dist/tart-hosts-B-dQEGpc.js.map +1 -0
  401. package/dist/{tart-hosts-8N6Tt7Yb.js → tart-hosts-_nHGB4mC.js} +1 -1
  402. package/dist/{tart-images-JfHirU8W.js → tart-images-DAEYoC_M.js} +3 -3
  403. package/dist/{tart-images-JfHirU8W.js.map → tart-images-DAEYoC_M.js.map} +1 -1
  404. package/dist/testing.d.ts +13 -5
  405. package/dist/testing.js +4 -4
  406. package/dist/{tool-class-CncfCw03.js → tool-class-CB-m4PiF.js} +2 -2
  407. package/dist/{tool-class-CncfCw03.js.map → tool-class-CB-m4PiF.js.map} +1 -1
  408. package/dist/{trace-BpXByD7W.js → trace-CJQLlAbB.js} +2 -2
  409. package/dist/{trace-BpXByD7W.js.map → trace-CJQLlAbB.js.map} +1 -1
  410. package/dist/{traits-CCD8XsmI.js → traits-DPIffsN8.js} +2 -2
  411. package/dist/{traits-CCD8XsmI.js.map → traits-DPIffsN8.js.map} +1 -1
  412. package/dist/{transcript-BXWZiMuC.js → transcript-CW02A4s9.js} +3 -3
  413. package/dist/{transcript-BXWZiMuC.js.map → transcript-CW02A4s9.js.map} +1 -1
  414. package/dist/{resources-DqdwihhT.js → turn-error-Dmv_Muj7.js} +15 -2
  415. package/dist/turn-error-Dmv_Muj7.js.map +1 -0
  416. package/dist/{types-BDo8ttQo.d.ts → types-BZaItiui.d.ts} +209 -28
  417. package/dist/types-Buut5yGe.js +29 -0
  418. package/dist/types-Buut5yGe.js.map +1 -0
  419. package/dist/types-C48zuZbT.d.ts +156 -0
  420. package/dist/types-CYz4dqAd.d.ts +1366 -0
  421. package/dist/{ui-DUiVPbQ2.js → ui-CJvbt2Cc.js} +15 -14
  422. package/dist/ui-CJvbt2Cc.js.map +1 -0
  423. package/dist/vertex-D4H9bKHD.d.ts +2 -0
  424. package/dist/{vertex-BEWxHoxH.js → vertex-DQQGhUn7.js} +2 -2
  425. package/dist/{vertex-BEWxHoxH.js.map → vertex-DQQGhUn7.js.map} +1 -1
  426. package/dist/vertex-DtWe0Xf6.js +1 -0
  427. package/dist/view/index.d.ts +142 -810
  428. package/dist/view/index.js +17 -12
  429. package/dist/view/report/index.d.ts +217 -0
  430. package/dist/view/report/index.js +4 -0
  431. package/dist/{views-CiZGh3ws.js → views-CtnOlABJ.js} +6 -6
  432. package/dist/{views-CiZGh3ws.js.map → views-CtnOlABJ.js.map} +1 -1
  433. package/dist/views-crppDW_B.js +2 -0
  434. package/dist/{vm-container-BVn7pXfD.js → vm-container-DwroMAXW.js} +13 -10
  435. package/dist/vm-container-DwroMAXW.js.map +1 -0
  436. package/dist/{vm-images-CNk-Zl2a.js → vm-images-y0BcVyv3.js} +19 -21
  437. package/dist/vm-images-y0BcVyv3.js.map +1 -0
  438. package/dist/wait-CixM6W0G.js +65 -0
  439. package/dist/wait-CixM6W0G.js.map +1 -0
  440. package/dist/{worker-entry-DmXQ2Znu.js → worker-entry-8KHmPzr4.js} +7 -7
  441. package/dist/{worker-entry-DmXQ2Znu.js.map → worker-entry-8KHmPzr4.js.map} +1 -1
  442. package/dist/workspace-JlgoGyR0.js +1 -0
  443. package/dist/{workspace-wwvwEHzP.js → workspace-xCQ6VDR-.js} +9 -8
  444. package/dist/workspace-xCQ6VDR-.js.map +1 -0
  445. package/package.json +33 -9
  446. package/skills/reeval/SKILL.md +2 -2
  447. package/skills/reeval/references/cli.md +1 -1
  448. package/skills/reeval/references/config.md +1 -1
  449. package/skills/reeval/references/environments.md +1 -1
  450. package/skills/setup/SKILL.md +1 -1
  451. package/dist/agents-BztvTkfM.js.map +0 -1
  452. package/dist/analysis-BnG_1x_O.js.map +0 -1
  453. package/dist/app-files-6NHzghym.js +0 -10
  454. package/dist/app-files-6NHzghym.js.map +0 -1
  455. package/dist/assemble-Doa1m-HW.js.map +0 -1
  456. package/dist/assemble-XrZskSNj.js +0 -1
  457. package/dist/attach-BH2HdwH_.js.map +0 -1
  458. package/dist/attempt-host-8mQV8Uee.js.map +0 -1
  459. package/dist/boat-DKRH0Gv7.js +0 -1
  460. package/dist/boat-DKjqo_ie.js.map +0 -1
  461. package/dist/boat-images-CRN_U_eG.js.map +0 -1
  462. package/dist/bundle-DU2aQVeq.js.map +0 -1
  463. package/dist/capture-BzjNv0qP.js +0 -1
  464. package/dist/cases-CM-MQRQp.js.map +0 -1
  465. package/dist/cases-FvhbM8M5.js +0 -1
  466. package/dist/cli-DMHOwdVr.js.map +0 -1
  467. package/dist/cli-spec-D0wuUaj9.js.map +0 -1
  468. package/dist/client-B41UK150.js.map +0 -1
  469. package/dist/command-8GIHYGZf.js +0 -298
  470. package/dist/command-8GIHYGZf.js.map +0 -1
  471. package/dist/command-CAmnWLFL.js.map +0 -1
  472. package/dist/command-CXxckfsq.js.map +0 -1
  473. package/dist/command-ao0NZ8h0.js.map +0 -1
  474. package/dist/commands-B3lnIPj5.js +0 -1
  475. package/dist/commands-ttChCsAy.js.map +0 -1
  476. package/dist/config-myJT1Qjc.js.map +0 -1
  477. package/dist/context-DnzR9TNK.js +0 -120
  478. package/dist/context-DnzR9TNK.js.map +0 -1
  479. package/dist/daytona-Dfhwtr9P.js.map +0 -1
  480. package/dist/daytona-image-CnG6G00x.js.map +0 -1
  481. package/dist/daytona-image-yJK3c4EV.js +0 -1
  482. package/dist/db-5H95sFii.js.map +0 -1
  483. package/dist/db-Bbg1n_2M.js +0 -2
  484. package/dist/debug-CF4p4Lp_.js +0 -1
  485. package/dist/debug-CIXzB4wK.js.map +0 -1
  486. package/dist/environment-C8pUCD_A.js.map +0 -1
  487. package/dist/evaluate-4kBVtwZZ.js.map +0 -1
  488. package/dist/files-BFnkOAhn.js +0 -1
  489. package/dist/files-BgQxoDlN.js +0 -1
  490. package/dist/files-CDfG8swM.js.map +0 -1
  491. package/dist/files-CSe4VaMj.js +0 -1
  492. package/dist/files-CX_mmvCc.js +0 -775
  493. package/dist/files-CX_mmvCc.js.map +0 -1
  494. package/dist/files-D6M7J3iX.js +0 -1
  495. package/dist/files-DgHeTdCZ.js.map +0 -1
  496. package/dist/gate-CgYdaprG.js +0 -49
  497. package/dist/gate-CgYdaprG.js.map +0 -1
  498. package/dist/harness-FcTyyPco.js.map +0 -1
  499. package/dist/harness-install-BfMBYDfP.js.map +0 -1
  500. package/dist/hosted-5Zz2peTR.js.map +0 -1
  501. package/dist/hosted-Co-waHe0.js +0 -131
  502. package/dist/hosted-Co-waHe0.js.map +0 -1
  503. package/dist/hosted-run-202QicZ-.js +0 -1
  504. package/dist/hosted-run-BfAPIMyT.js +0 -230
  505. package/dist/hosted-run-BfAPIMyT.js.map +0 -1
  506. package/dist/ids-a6cr243_.js.map +0 -1
  507. package/dist/init-BiL6B3S4.js +0 -1
  508. package/dist/inputs-load-M-BGe7gd.js +0 -1
  509. package/dist/judge-DwzqucLS.js.map +0 -1
  510. package/dist/kinds-DEKXOWVJ.js.map +0 -1
  511. package/dist/list-MK4L8tfW.js.map +0 -1
  512. package/dist/live-BkPNXVmN.js +0 -120
  513. package/dist/live-BkPNXVmN.js.map +0 -1
  514. package/dist/live-Dlq-S2yy.js.map +0 -1
  515. package/dist/live-gZtkBwuo.js +0 -1
  516. package/dist/machine-service-CZiXiVsS.js.map +0 -1
  517. package/dist/model-C6aoJLg_.js +0 -1
  518. package/dist/model-LoLnq9y1.js.map +0 -1
  519. package/dist/options-I9I3FwMl.js +0 -1
  520. package/dist/pairs-BGb134Vu.js +0 -230
  521. package/dist/pairs-BGb134Vu.js.map +0 -1
  522. package/dist/patch-C7yBztZj.js.map +0 -1
  523. package/dist/paths-Dwmi7L4X.js +0 -75
  524. package/dist/paths-Dwmi7L4X.js.map +0 -1
  525. package/dist/preflight-fyV5nnea.js +0 -1
  526. package/dist/prices-C0gKS_8G.js +0 -1
  527. package/dist/provider-DHT20Gl8.js +0 -1
  528. package/dist/query-C9OKU1Vz.js +0 -1
  529. package/dist/questions-boVPzGoC.js.map +0 -1
  530. package/dist/record-D1_D1KFY.js.map +0 -1
  531. package/dist/redact-t-L3VGy8.js.map +0 -1
  532. package/dist/remarks-DqriPKxm.js.map +0 -1
  533. package/dist/resolve-BdpO8BN1.js +0 -1
  534. package/dist/resolve-Bfo8sjd-.js.map +0 -1
  535. package/dist/resolve-D2RqmybX.js.map +0 -1
  536. package/dist/resources-DqdwihhT.js.map +0 -1
  537. package/dist/runtime-C5fKSFCz.js +0 -457
  538. package/dist/runtime-C5fKSFCz.js.map +0 -1
  539. package/dist/server-BcLg9WzE.js +0 -284
  540. package/dist/server-BcLg9WzE.js.map +0 -1
  541. package/dist/server-Buav2-CG.js +0 -1
  542. package/dist/services-BG8xuU82.js.map +0 -1
  543. package/dist/shared-CHvO7eLi.d.ts +0 -1
  544. package/dist/shared-DtZwIAfy.js.map +0 -1
  545. package/dist/slug-IHh3f770.js.map +0 -1
  546. package/dist/source-CrXM19HD.js.map +0 -1
  547. package/dist/source-dvxkqYvk.js +0 -1
  548. package/dist/src-5dCrqbFd.js +0 -2
  549. package/dist/src-C5rrQlt8.js.map +0 -1
  550. package/dist/src-DEbNp-rx.js +0 -1
  551. package/dist/src-DrLbG1HM.js +0 -2
  552. package/dist/ssh-pool-BorCizYw.js +0 -1
  553. package/dist/ssh-pool-Dvfx5GuV.js.map +0 -1
  554. package/dist/start-COB07NpH.js.map +0 -1
  555. package/dist/state-B319V1p8.js.map +0 -1
  556. package/dist/state-C5oBvmoZ.js +0 -1
  557. package/dist/suite-BwJGOhCZ.js +0 -2
  558. package/dist/suite-D1tgXZxM.js.map +0 -1
  559. package/dist/summary-ClLns_wv.js +0 -169
  560. package/dist/summary-ClLns_wv.js.map +0 -1
  561. package/dist/tart-DMppfbEm.js.map +0 -1
  562. package/dist/tart-bake-Cva_qdir.js.map +0 -1
  563. package/dist/tart-cli-LzDud2Z6.js.map +0 -1
  564. package/dist/tart-hosts-CTRY5kQ2.js.map +0 -1
  565. package/dist/types-CbcnJxCy.js +0 -15
  566. package/dist/types-CbcnJxCy.js.map +0 -1
  567. package/dist/ui-DUiVPbQ2.js.map +0 -1
  568. package/dist/vertex-C7PI-WPc.d.ts +0 -3
  569. package/dist/vertex-DXfcXYKn.js +0 -1
  570. package/dist/views-B0qZR5Ef.js +0 -2
  571. package/dist/vm-container-BVn7pXfD.js.map +0 -1
  572. package/dist/vm-images-CNk-Zl2a.js.map +0 -1
  573. package/dist/workspace-CRgFdmgW.js +0 -1
  574. package/dist/workspace-wwvwEHzP.js.map +0 -1
@@ -0,0 +1,817 @@
1
+ import { f as printable, g as request, n as CloudError, p as redirected, u as platformError } from "./cloud-run-CZOpabN1.js";
2
+ import { l as parseLevel, m as recordedRun, t as CommandError, u as pick } from "./commands-BPLexk6R.js";
3
+ import { n as UsageError } from "./errors-ttMTnIYX.js";
4
+ import { t as fileInside } from "./source-BodZTD70.js";
5
+ import { m as parsedAnalysis } from "./report-BSi-R8hC.js";
6
+ import { r as STUDIO_API_PREFIX, t as RUN_ID } from "./api-ZeGnedB3.js";
7
+ import { o as savedAnalysisDir } from "./files-4XWe_gow.js";
8
+ import { A as readZip, C as scanText, D as openArchive, E as ArchiveError, O as writeArchive, d as readRunArchiveFiles, j as safeZipPath, k as bufferSource, p as recordFile, s as leveledArchiveFiles, u as readRecord, y as scratchDir } from "./files-CzgXLYGq.js";
9
+ import { o as findSecrets, s as findSecretsInJson } from "./redact-DMueYS-v.js";
10
+ import { o as target } from "./cloud-secrets-DrrgGOF_.js";
11
+ import "./ids-CtxRn13a.js";
12
+ import { a as plural } from "./text-B8-W3Cvn.js";
13
+ import { s as formatBytes } from "./debug-T29p6HOX.js";
14
+ import { n as LIVE_FILE, s as readableLiveProgress } from "./live-BRF0ogR6.js";
15
+ import { existsSync, rmSync } from "node:fs";
16
+ import { hostname, tmpdir } from "node:os";
17
+ import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
18
+ import { lstat, mkdir, mkdtemp, readFile, readdir, realpath, rm, stat } from "node:fs/promises";
19
+ import { Readable, pipeline } from "node:stream";
20
+ import * as zlib$1 from "node:zlib";
21
+ import { createBrotliDecompress, createGunzip, createInflate } from "node:zlib";
22
+ import { setTimeout } from "node:timers/promises";
23
+ import { StringDecoder } from "node:string_decoder";
24
+ // src/analysis/push.ts
25
+ /**
26
+ * The largest analysis document that leaves this machine. One is the model's answer (at most
27
+ * `analysis.maxOutputTokens`, 32,000 tokens by default, about 128 KB) plus the cited facts, each
28
+ * clipped to 400 characters, so a real one is tens of KB; 1 MiB leaves room for any config.
29
+ */
30
+ const MAX_ANALYSIS_BYTES = 2 ** 20;
31
+ /** Why `bytes`, the analysis at `path`, can't go with run `runId`; undefined when it can. */
32
+ function analysisProblem(bytes, path, runId) {
33
+ if (bytes.length > MAX_ANALYSIS_BYTES) return tooLarge(path, bytes.length);
34
+ const value = jsonOf(bytes);
35
+ return value === void 0 ? `${path} isn't JSON` : docProblem(value, path, runId);
36
+ }
37
+ const tooLarge = (path, size) => `${path} is ${size} bytes, and an analysis may be at most ${MAX_ANALYSIS_BYTES} (1 MiB)`;
38
+ function jsonOf(bytes) {
39
+ try {
40
+ return JSON.parse(Buffer.from(bytes).toString("utf8"));
41
+ } catch {
42
+ return;
43
+ }
44
+ }
45
+ function docProblem(value, path, runId) {
46
+ let doc;
47
+ try {
48
+ doc = parsedAnalysis(value, path);
49
+ } catch (error) {
50
+ return error instanceof Error ? error.message : String(error);
51
+ }
52
+ if (doc.anchor !== runId) return `${path} is an analysis of run ${doc.anchor}, not ${runId}`;
53
+ }
54
+ const isAnalysis = (value) => value?.kind === "reeval-analysis";
55
+ /**
56
+ * Run `runId`'s saved analyses in `historyDir`, `<runId>/analysis/*.json`, as archive files;
57
+ * exit 2, naming each, when any can't go with the run. A `.json` that isn't an analysis, or whose
58
+ * real path leaves the run's folder, is left out with a warning, as every reader of saved
59
+ * analyses leaves it out.
60
+ */
61
+ async function savedAnalysisFiles(historyDir, runId, warn) {
62
+ const dir = savedAnalysisDir(historyDir, runId);
63
+ const names = (await readdir(dir).catch(() => [])).filter((n) => n.endsWith(".json")).sort();
64
+ const files = [];
65
+ const problems = [];
66
+ for (const name of names) {
67
+ const path = `${runId}/analysis/${name}`;
68
+ const real = await fileInside(historyDir, [runId, "analysis"], [name]);
69
+ if (!real) {
70
+ if ((await lstat(join(dir, name)).catch(() => null))?.isSymbolicLink()) warn(`Leaving ${path} out of the push: it links outside the run's folder`);
71
+ continue;
72
+ }
73
+ const { size } = await stat(real);
74
+ if (size > MAX_ANALYSIS_BYTES) {
75
+ problems.push(tooLarge(path, size));
76
+ continue;
77
+ }
78
+ const data = await readFile(real);
79
+ const value = jsonOf(data);
80
+ if (value !== void 0 && !isAnalysis(value)) {
81
+ warn(`Leaving ${path} out of the push: it isn't a reeval analysis`);
82
+ continue;
83
+ }
84
+ const problem = value === void 0 ? `${path} isn't JSON` : docProblem(value, path, runId);
85
+ if (problem) problems.push(problem);
86
+ else files.push({
87
+ path,
88
+ data
89
+ });
90
+ }
91
+ if (problems.length) throw new CommandError(`Refusing to push ${runId}: ${problems.length === 1 ? "a saved analysis" : `${problems.length} saved analyses`} can't go with it:\n${problems.map((p) => ` ${p}`).join("\n")}\nFix or remove ${problems.length === 1 ? "it" : "them"}, then push again.`);
92
+ return files;
93
+ }
94
+ /** Where `PUT` sends run `runId`'s analysis on the platform at `base`. */
95
+ const analysisUrl = (base, runId) => new URL(`${STUDIO_API_PREFIX.slice(1)}/runs/${encodeURIComponent(runId)}/analysis`, base);
96
+ /**
97
+ * Uploads `bytes`, a saved analysis of `runId`, to the platform's copy of the run. A run the
98
+ * platform says it doesn't have (404, `run_not_found`) exits 2 with how to push it; any other 404
99
+ * is a platform that takes no analysis uploads, and exits 3, as a failure does; any other refusal
100
+ * exits 2.
101
+ */
102
+ async function putAnalysis(base, auth, runId, bytes) {
103
+ const what = `upload the analysis of run ${runId}`;
104
+ const answer = await request(analysisUrl(base, runId), {
105
+ method: "PUT",
106
+ what,
107
+ redirect: "manual",
108
+ headers: { "content-type": "application/json" },
109
+ body: Buffer.from(bytes)
110
+ }, auth.headers);
111
+ if (answer.status >= 300 && answer.status < 400) throw redirected("the analysis upload");
112
+ if (answer.status === 404 && answer.body?.error === "run_not_found") throw new UsageError(`The cloud has no run ${runId}, so the analysis stays saved here only: reeval cloud push ${runId} uploads the run with its saved analyses.`);
113
+ if (answer.status === 404) throw new CloudError(`The cloud platform doesn't take analysis uploads (HTTP 404 from ${analysisUrl(base, runId).pathname}), so the analysis stays saved here only.`);
114
+ if (!answer.ok) throw platformError(answer, what, auth);
115
+ }
116
+ // src/cloud-push-scan.ts
117
+ /** The characters scanned at once. */
118
+ const WINDOW = 4 * 2 ** 20;
119
+ /**
120
+ * What each window carries over from the next. Every secret shape matches within its first
121
+ * 64 KiB, so a match that starts in a window is found there whole or by its first 64 KiB.
122
+ */
123
+ const OVERLAP = 65536;
124
+ /** Bytes handed to the decoder at once. */
125
+ const PIECE = 2 ** 20;
126
+ /** What the scan unpacks of compressed files, across one push, before it stops reading them. */
127
+ const UNPACK_BUDGET = 256 * 2 ** 20;
128
+ /** Compressed files inside compressed files it follows, at most. */
129
+ const MAX_DEPTH = 3;
130
+ /** Findings named per file; the rest are counted. */
131
+ const SHOWN = 3;
132
+ /** Bytes read before deciding what a stream holds: its magic number, or UTF-16. */
133
+ const PEEK = 512;
134
+ const MASK = "[REDACTED]";
135
+ const JSON_FILE = /\.(?:json|jsonl|ndjson)$/;
136
+ const UNREADABLE = [
137
+ [/\.xz$/i, "xz"],
138
+ [/\.(?:lz|lzma)$/i, "lzma"],
139
+ [/\.bz2$/i, "bzip2"],
140
+ [/\.7z$/i, "7z"],
141
+ [/\.rar$/i, "rar"]
142
+ ];
143
+ /** Why the scan stopped reading a file, said in place of what it found there. */
144
+ var Unread = class extends Error {};
145
+ const isGzip = (b) => b[0] === 31 && b[1] === 139;
146
+ const isZip = (b) => b[0] === 80 && b[1] === 75 && (b[2] === 3 && b[3] === 4 || b[2] === 5 && b[3] === 6);
147
+ /** A zlib header with a 32 KiB window, as every common encoder writes: `78 01`, `5e`, `9c`, `da`. */
148
+ const isZlib = (b) => b.length >= 2 && b[0] === 120 && (30720 + b[1]) % 31 === 0;
149
+ const isZstd = (b) => b.subarray(0, 4).equals(Buffer.from([
150
+ 40,
151
+ 181,
152
+ 47,
153
+ 253
154
+ ]));
155
+ const startsWith = (bytes) => (b) => b.subarray(0, bytes.length).equals(Buffer.from(bytes));
156
+ const UNREADABLE_MAGIC = [
157
+ [startsWith([
158
+ 253,
159
+ 55,
160
+ 122,
161
+ 88,
162
+ 90,
163
+ 0
164
+ ]), "xz"],
165
+ [(b) => b.subarray(0, 3).toString("latin1") === "BZh" && b[3] >= 49 && b[3] <= 57 && ["314159265359", "177245385090"].includes(b.subarray(4, 10).toString("hex")), "bzip2"],
166
+ [startsWith([
167
+ 76,
168
+ 90,
169
+ 73,
170
+ 80
171
+ ]), "lzma"],
172
+ [startsWith([
173
+ 55,
174
+ 122,
175
+ 188,
176
+ 175,
177
+ 39,
178
+ 28
179
+ ]), "7z"],
180
+ [startsWith([
181
+ 82,
182
+ 97,
183
+ 114,
184
+ 33,
185
+ 26,
186
+ 7
187
+ ]), "rar"]
188
+ ];
189
+ /** Node's zstd decoder, on the Node versions that have one. */
190
+ const zstdDecompress = zlib$1.createZstdDecompress;
191
+ /** Whether `b` looks like UTF-16: a byte-order mark, or NUL in every other byte of its start. */
192
+ function utf16(b) {
193
+ if (b[0] === 255 && b[1] === 254) return "le";
194
+ if (b[0] === 254 && b[1] === 255) return "be";
195
+ const n = Math.min(b.length, PEEK) & -2;
196
+ if (n < 8) return null;
197
+ let even = 0;
198
+ let odd = 0;
199
+ for (let i = 0; i < n; i += 2) {
200
+ if (b[i] === 0) even++;
201
+ if (b[i + 1] === 0) odd++;
202
+ }
203
+ const half = n / 2;
204
+ if (odd >= half * .9 && even < half * .1) return "le";
205
+ if (even >= half * .9 && odd < half * .1) return "be";
206
+ return null;
207
+ }
208
+ /** A decoder for a stream that starts with `start`, carrying split characters between pieces. */
209
+ function decoderFor(start) {
210
+ const wide = utf16(start);
211
+ const strip = (s) => s.includes("\0") ? s.replaceAll("\0", "") : s;
212
+ if (wide === "le") {
213
+ const d = new StringDecoder("utf16le");
214
+ return (piece) => strip(d.write(piece));
215
+ }
216
+ if (wide === "be") {
217
+ const d = new StringDecoder("utf16le");
218
+ let odd = Buffer.alloc(0);
219
+ return (piece) => {
220
+ const all = odd.length ? Buffer.concat([odd, piece]) : piece;
221
+ const even = all.length & -2;
222
+ odd = Buffer.from(all.subarray(even));
223
+ return strip(d.write(Buffer.from(all.subarray(0, even)).swap16()));
224
+ };
225
+ }
226
+ if (start.includes(0)) return (piece) => strip(piece.toString("latin1"));
227
+ const d = new StringDecoder("utf8");
228
+ return (piece) => strip(d.write(piece));
229
+ }
230
+ const newlines = (text, from, to) => {
231
+ let n = 0;
232
+ for (let i = text.indexOf("\n", from); i !== -1 && i < to; i = text.indexOf("\n", i + 1)) n++;
233
+ return n;
234
+ };
235
+ /**
236
+ * One file's text, scanned in windows of `WINDOW` characters that overlap by `OVERLAP`. A match
237
+ * counts in the window it starts in, before the part the next window repeats, so it counts once.
238
+ * Text that fits one window is scanned as `scanText` scans a file, a patch placed by its files.
239
+ */
240
+ var TextScan = class {
241
+ #buf = "";
242
+ #line = 1;
243
+ #whole = true;
244
+ #found = [];
245
+ path;
246
+ constructor(path) {
247
+ this.path = path;
248
+ }
249
+ push(text) {
250
+ this.#buf += text;
251
+ while (this.#buf.length >= WINDOW) this.#window(false);
252
+ }
253
+ end() {
254
+ if (this.#whole) return scanText(this.path, this.#buf);
255
+ this.#window(true);
256
+ return this.#found;
257
+ }
258
+ #window(last) {
259
+ const text = this.#buf;
260
+ let owned = text.length;
261
+ if (!last) {
262
+ owned -= OVERLAP;
263
+ const cut = text.lastIndexOf("\n", owned - 1);
264
+ if (cut >= owned / 2) owned = cut + 1;
265
+ }
266
+ const matches = (JSON_FILE.test(this.path) ? findSecretsInJson : findSecrets)(text).filter((m) => m.start < owned).sort((a, b) => a.start - b.start);
267
+ let line = this.#line;
268
+ let at = 0;
269
+ for (const m of matches) {
270
+ line += newlines(text, at, m.start);
271
+ at = m.start;
272
+ this.#found.push({
273
+ file: null,
274
+ line,
275
+ what: m.rule,
276
+ rule: m.rule
277
+ });
278
+ }
279
+ this.#line += newlines(text, 0, owned);
280
+ this.#buf = text.slice(owned);
281
+ this.#whole = false;
282
+ }
283
+ };
284
+ async function* pieces(data) {
285
+ for (let at = 0; at < data.length; at += PIECE) yield data.subarray(at, at + PIECE);
286
+ }
287
+ /** The first `PEEK` bytes of `source` (fewer only at its end), and all of it from the start. */
288
+ async function peek(source) {
289
+ const it = source[Symbol.asyncIterator]();
290
+ const head = [];
291
+ let size = 0;
292
+ let done = false;
293
+ while (size < PEEK) {
294
+ const next = await it.next();
295
+ if (next.done) {
296
+ done = true;
297
+ break;
298
+ }
299
+ head.push(next.value);
300
+ size += next.value.length;
301
+ }
302
+ const start = Buffer.concat(head);
303
+ async function* all() {
304
+ if (start.length) yield start;
305
+ if (done) return;
306
+ for (let next = await it.next(); !next.done; next = await it.next()) yield next.value;
307
+ }
308
+ return {
309
+ start,
310
+ all: all()
311
+ };
312
+ }
313
+ /** `stream` inflated, counted against the push's unpack budget. */
314
+ async function* inflated(stream, inflate, scan, progress = { bytes: 0 }) {
315
+ const out = pipeline(Readable.from(stream), inflate, () => {});
316
+ for await (const chunk of out) {
317
+ progress.bytes += chunk.length;
318
+ scan.budget.left -= chunk.length;
319
+ if (scan.budget.left < 0) throw new Unread("too large to unpack and scan");
320
+ yield chunk;
321
+ }
322
+ }
323
+ /** Scans one stream's contents, unpacking what it can; `name` is the file name it came under. */
324
+ async function scanStream(path, name, source, depth, scan) {
325
+ const { start, all } = await peek(source);
326
+ const unreadable = UNREADABLE_MAGIC.find(([test]) => test(start));
327
+ if (unreadable) throw new Unread(`${unreadable[1]}-compressed`);
328
+ const gzip = isGzip(start);
329
+ const zip = !gzip && isZip(start);
330
+ const zstd = !gzip && !zip && (isZstd(start) || name !== null && /\.zstd?$/i.test(name));
331
+ const maybe = gzip || zip || zstd ? null : isZlib(start) ? createInflate : name !== null && /\.br$/i.test(name) ? createBrotliDecompress : null;
332
+ if ((gzip || zip || zstd || maybe) && depth >= MAX_DEPTH) throw new Unread(`compressed more than ${MAX_DEPTH} levels deep`);
333
+ const unpacked = path.endsWith("!") ? path : `${path}!`;
334
+ if (gzip) return scanStream(unpacked, null, inflated(all, createGunzip(), scan), depth + 1, scan);
335
+ if (zstd && !zstdDecompress) throw new Unread("zstd-compressed");
336
+ if (zip) {
337
+ const chunks = [];
338
+ for await (const chunk of all) chunks.push(chunk);
339
+ return scanZip(path.replace(/!$/, ""), Buffer.concat(chunks), depth + 1, scan);
340
+ }
341
+ const inflater = zstd ? zstdDecompress : maybe;
342
+ if (inflater) {
343
+ const chunks = [];
344
+ for await (const chunk of all) chunks.push(chunk);
345
+ const raw = Buffer.concat(chunks);
346
+ const progress = { bytes: 0 };
347
+ const stream = inflater();
348
+ try {
349
+ await scanStream(unpacked, null, inflated(pieces(raw), stream, scan, progress), depth + 1, scan);
350
+ } catch (error) {
351
+ if (zstd || error instanceof Unread || progress.bytes > 0 || raw.length === 0) throw error;
352
+ return scanPlain(path, raw, pieces(raw), scan);
353
+ }
354
+ const used = stream.bytesWritten;
355
+ if (used >= raw.length) return;
356
+ if (used <= 0) throw new Unread("the scan couldn't finish reading it");
357
+ return scanStream(path, null, pieces(raw.subarray(used)), depth, scan);
358
+ }
359
+ return scanPlain(path, start, all, scan);
360
+ }
361
+ /** Scans a stream as text, decoded as its first bytes, `start`, say. */
362
+ async function scanPlain(path, start, all, scan) {
363
+ const decode = decoderFor(start);
364
+ const text = new TextScan(path);
365
+ for await (const chunk of all) for (let at = 0; at < chunk.length; at += PIECE) text.push(decode(chunk.subarray(at, at + PIECE)));
366
+ const findings = text.end();
367
+ if (findings.length) scan.out.findings.push(findingText(scan.mask(path), findings));
368
+ }
369
+ async function scanZip(path, data, depth, scan) {
370
+ let zip;
371
+ try {
372
+ zip = await readZip(bufferSource(data));
373
+ } catch {
374
+ throw new Unread("a zip the scan can't read");
375
+ }
376
+ for (const entry of zip.entries) await scanFile(`${path}!/${entry.path}`, depth, scan, async () => {
377
+ if (entry.method !== "store") {
378
+ if (entry.size > scan.budget.left) throw new Unread("too large to unpack and scan");
379
+ scan.budget.left -= entry.size;
380
+ }
381
+ try {
382
+ return await zip.read(entry);
383
+ } catch {
384
+ throw new Unread("a zip the scan can't read");
385
+ }
386
+ });
387
+ }
388
+ /** Scans one file's path and contents, saying it unread where the scan can't finish. */
389
+ async function scanFile(path, depth, scan, data) {
390
+ const shown = scan.mask(path);
391
+ const name = path.slice(path.lastIndexOf("/") + 1);
392
+ const unreadable = UNREADABLE.find(([test]) => test.test(name));
393
+ if (unreadable) {
394
+ scan.out.unread.push(`${shown} (${unreadable[1]}-compressed)`);
395
+ return;
396
+ }
397
+ try {
398
+ await scanStream(path, name, pieces(await data()), depth, scan);
399
+ } catch (error) {
400
+ const why = error instanceof Unread ? error.message : "the scan couldn't finish reading it";
401
+ scan.out.unread.push(`${shown} (${why})`);
402
+ }
403
+ }
404
+ function findingText(path, findings) {
405
+ const shown = findings.slice(0, SHOWN).map((f) => {
406
+ const where = [f.file, f.line === null ? null : `line ${f.line}`].filter(Boolean).join(" ");
407
+ return `${where ? `${where}: ` : ""}${f.rule}`;
408
+ });
409
+ const more = findings.length > SHOWN ? `, and ${findings.length - SHOWN} more` : "";
410
+ return `${path}: ${shown.join("; ")}${more}`;
411
+ }
412
+ /** Scans every file's contents and every segment of its path, nested zips' entries included. */
413
+ async function scanPush(files) {
414
+ const out = {
415
+ findings: [],
416
+ unread: []
417
+ };
418
+ const segments = /* @__PURE__ */ new Map();
419
+ const flagged = /* @__PURE__ */ new Set();
420
+ const rulesOf = (segment) => {
421
+ let rules = segments.get(segment);
422
+ if (!rules) {
423
+ let decoded = segment;
424
+ try {
425
+ decoded = decodeURIComponent(segment);
426
+ } catch {}
427
+ const found = findSecrets(segment);
428
+ if (decoded !== segment) found.push(...findSecrets(decoded));
429
+ rules = [...new Set(found.map((m) => m.rule))];
430
+ segments.set(segment, rules);
431
+ }
432
+ return rules;
433
+ };
434
+ const mask = (path) => path.split("/").map((s) => rulesOf(s).length ? MASK : s).join("/");
435
+ const scan = {
436
+ out,
437
+ budget: { left: UNPACK_BUDGET },
438
+ mask: (path) => {
439
+ const parts = path.split("/");
440
+ for (let i = 0; i < parts.length; i++) {
441
+ const rules = rulesOf(parts[i]);
442
+ const prefix = parts.slice(0, i + 1).join("/");
443
+ if (rules.length && !flagged.has(prefix)) {
444
+ flagged.add(prefix);
445
+ out.findings.push(`${mask(prefix)}: name: ${rules.join("; ")}`);
446
+ }
447
+ }
448
+ return mask(path);
449
+ }
450
+ };
451
+ for (const { path, data } of files) await scanFile(path, 0, scan, async () => Buffer.from(data.buffer, data.byteOffset, data.length));
452
+ return {
453
+ ...out,
454
+ mask
455
+ };
456
+ }
457
+ // src/cloud-push.ts
458
+ /** How long the push waits for the platform to read the run before it stops waiting. */
459
+ const WAIT_MS = 3e5;
460
+ const FIRST_POLL_MS = 500;
461
+ const MAX_POLL_MS = 5e3;
462
+ /** The upload's time limit: this, plus a second for every 32 KB the archive holds. */
463
+ const UPLOAD_BASE_MS = 12e4;
464
+ const UPLOAD_BYTES_PER_SECOND = 32768;
465
+ /** How long a single read of the run's state retries before it stops. */
466
+ const STATE_MS = 3e4;
467
+ /** A progress file from another host this old means its run stopped, as the studio reads it. */
468
+ const LIVE_STALE_MS = 15e3;
469
+ const STATUSES = [
470
+ "pending",
471
+ "ready",
472
+ "failed"
473
+ ];
474
+ /** What each level keeps, widest first. */
475
+ const LEVELS = [
476
+ "all",
477
+ "evidence",
478
+ "failures",
479
+ "none"
480
+ ];
481
+ const orList = (items) => items.length < 2 ? items.join("") : `${items.slice(0, -1).join(", ")} or ${items.at(-1)}`;
482
+ /** Whether `runId`'s `reeval run` is still going: its progress file's process is alive. */
483
+ async function stillRunning(root, runId) {
484
+ const text = await readFile(join(root, ".reeval", "staging", runId, LIVE_FILE), "utf8").catch(() => null);
485
+ if (!text) return false;
486
+ let progress = null;
487
+ try {
488
+ progress = readableLiveProgress(JSON.parse(text));
489
+ } catch {}
490
+ if (!progress || progress.runId !== runId) return false;
491
+ if (progress.host !== hostname()) return Date.now() - Date.parse(progress.heartbeatAt) < LIVE_STALE_MS;
492
+ try {
493
+ process.kill(progress.pid, 0);
494
+ return true;
495
+ } catch (error) {
496
+ return error.code !== "ESRCH";
497
+ }
498
+ }
499
+ const refuseRunning = async (config, runId) => {
500
+ if (await stillRunning(config.root, runId)) throw new CommandError(`Run ${runId} is still running: push it once it ends`);
501
+ };
502
+ /**
503
+ * The run's archive files: as recorded, or with `--artifacts`, at that level, from the recorded
504
+ * run (narrower only) or from a run only in `.reeval/runs`, which stays unrecorded.
505
+ */
506
+ async function archiveFiles(config, flags, ref, warn) {
507
+ if (flags.artifacts === void 0) {
508
+ const { runId } = await recordedRun(config, ref ?? "latest");
509
+ return {
510
+ runId,
511
+ files: await readRunArchiveFiles(config.history.dir, runId)
512
+ };
513
+ }
514
+ const level = parseLevel(flags.artifacts, "all");
515
+ if (ref && RUN_ID.test(ref)) await refuseRunning(config, ref);
516
+ const entry = await pick(config, ref ?? "latest");
517
+ const { runId } = entry;
518
+ await refuseRunning(config, runId);
519
+ const skip = flags["skip-secret-scan"] ? { skipSecretScan: true } : {};
520
+ let built = null;
521
+ const scratch = scratchDir(config.root);
522
+ if (existsSync(recordFile(scratch, runId))) {
523
+ const recorded = entry.recorded ? await readRecord(recordFile(config.history.dir, runId)) : void 0;
524
+ const local = await leveledArchiveFiles(scratch, runId, level, {
525
+ ...skip,
526
+ ...recorded && { recorded },
527
+ check: (run) => {
528
+ if (!recorded && run.status !== "complete" && !flags["allow-incomplete"]) throw new CommandError(`Run ${runId} was ${run.status}; pass --allow-incomplete to push it`);
529
+ }
530
+ });
531
+ if ("mismatch" in local) warn(`Pushing ${runId} from the history folder: its copy in .reeval/runs isn't the recorded run (${local.mismatch})`);
532
+ else built = local;
533
+ }
534
+ if (!built) {
535
+ let same = false;
536
+ const history = await leveledArchiveFiles(config.history.dir, runId, level, {
537
+ ...skip,
538
+ check: (run) => {
539
+ const was = run.artifacts;
540
+ if (LEVELS.indexOf(level) < LEVELS.indexOf(was)) throw new CommandError(`Run ${runId} was recorded with artifacts ${was}, so --artifacts ${level} can't add what recording left out: push it at ${orList(LEVELS.slice(LEVELS.indexOf(was)))}`);
541
+ same = level === was;
542
+ }
543
+ });
544
+ if (same || "mismatch" in history) return {
545
+ runId,
546
+ files: await readRunArchiveFiles(config.history.dir, runId)
547
+ };
548
+ built = history;
549
+ }
550
+ if (built.droppedPatch.length) warn(`Left ${runId}'s worktree patch out of the archive: it looks like it holds a secret:\n${built.droppedPatch.map((l) => ` ${l}`).join("\n")}`);
551
+ return {
552
+ runId,
553
+ files: built.files
554
+ };
555
+ }
556
+ const seg = encodeURIComponent;
557
+ /** `path` under the cloud project's API, `api/orgs/<org>/projects/<project>/<path>`. */
558
+ const projectUrl = (t, path) => new URL(`api/orgs/${seg(t.orgId)}/projects/${seg(t.projectId ?? "")}/${path}`, t.base);
559
+ /** The platform's answer about the run, or null when it isn't one. */
560
+ function runState(body) {
561
+ const b = body;
562
+ if (typeof b !== "object" || b === null) return null;
563
+ if (typeof b.revision !== "number" || !STATUSES.includes(b.status)) return null;
564
+ return {
565
+ revision: b.revision,
566
+ status: b.status,
567
+ error: typeof b.error === "string" ? printable(b.error) : null
568
+ };
569
+ }
570
+ /** `zip` written from `files`, with an archive the writer refuses as a usage error. */
571
+ async function writeRunArchive(zip, run) {
572
+ await writeArchive(zip, {
573
+ contents: "run",
574
+ runId: run.runId,
575
+ files: run.files
576
+ }).catch((error) => {
577
+ if (error instanceof ArchiveError) throw new CommandError(`couldn't archive ${run.runId}: ${error.message}`);
578
+ throw error;
579
+ });
580
+ }
581
+ /**
582
+ * The archive of `run`, built in a temporary folder that is removed once it's read, on an
583
+ * error and on Ctrl-C or SIGTERM.
584
+ */
585
+ async function archiveBytes(run) {
586
+ const tmp = await mkdtemp(join(tmpdir(), "reeval-push-"));
587
+ const onSignal = (signal) => {
588
+ rmSync(tmp, {
589
+ recursive: true,
590
+ force: true
591
+ });
592
+ process.exit(signal === "SIGTERM" ? 143 : 130);
593
+ };
594
+ process.once("SIGINT", onSignal);
595
+ process.once("SIGTERM", onSignal);
596
+ try {
597
+ const zip = join(tmp, `${run.runId}.zip`);
598
+ await writeRunArchive(zip, run);
599
+ return await readFile(zip);
600
+ } finally {
601
+ process.off("SIGINT", onSignal);
602
+ process.off("SIGTERM", onSignal);
603
+ await rm(tmp, {
604
+ recursive: true,
605
+ force: true
606
+ });
607
+ }
608
+ }
609
+ /**
610
+ * The recorded run `ref` names (default the newest), its files read and scanned: exit 2 on
611
+ * anything the scan finds or can't read, unless `--skip-secret-scan` warns instead.
612
+ */
613
+ async function scannedRun(config, flags, ref, warn) {
614
+ const { runId, files: runFiles } = await archiveFiles(config, flags, ref, warn);
615
+ const files = [...runFiles, ...await savedAnalysisFiles(config.history.dir, runId, warn)];
616
+ const { findings, unread, mask } = await scanPush(files);
617
+ const listed = (lines) => lines.map((l) => ` ${l}`).join("\n");
618
+ if (flags["skip-secret-scan"]) {
619
+ if (findings.length) warn(`Pushing ${runId} despite what looks like a secret in:\n${listed(findings)}`);
620
+ if (unread.length) warn(`Pushing ${runId} with files the secret scan can't read:\n${listed(unread)}`);
621
+ } else if (findings.length || unread.length) {
622
+ const parts = [...findings.length ? [`${plural(findings.length, "file")} look${findings.length === 1 ? "s" : ""} like ${findings.length === 1 ? "it holds" : "they hold"} a secret:\n${listed(findings)}`] : [], ...unread.length ? [`the secret scan can't read ${plural(unread.length, "file")}:\n${listed(unread)}`] : []];
623
+ throw new CommandError(`Refusing to push ${runId}: ${parts.join("\nand ")}\nCheck them, then pass --skip-secret-scan to push anyway.`);
624
+ }
625
+ const unsafe = files.find((f) => safeZipPath(f.path) !== f.path);
626
+ if (unsafe) throw new CommandError(`${runId} has a file whose name can't go in an archive: ${JSON.stringify(mask(unsafe.path))} (a backslash, an empty, . or .. part, or a NUL). Rename or remove it, then push again.`);
627
+ return {
628
+ runId,
629
+ files,
630
+ artifacts: JSON.parse(Buffer.from(files[0]?.data ?? "{}").toString()).artifacts ?? "failures"
631
+ };
632
+ }
633
+ const runUrl = (t, runId) => projectUrl(t, `studio/runs/${seg(runId)}`);
634
+ /** Where the cloud studio shows `runId`. */
635
+ function studioUrl(t, runId) {
636
+ const studio = new URL("studio", t.base);
637
+ studio.searchParams.set("run", runId);
638
+ return studio;
639
+ }
640
+ /**
641
+ * How the cloud project's copy of `runId` stands, or null when it has none. No answer, a 5xx, a
642
+ * 429 or a refusal the platform marks retryable is asked again, backing off, until `deadline`.
643
+ */
644
+ async function readState(t, runId, deadline) {
645
+ const what = `read how run ${runId} stands`;
646
+ let wait = FIRST_POLL_MS;
647
+ let problem = "";
648
+ for (;;) {
649
+ let answer = null;
650
+ try {
651
+ answer = await request(runUrl(t, runId), {
652
+ method: "GET",
653
+ what,
654
+ redirect: "manual"
655
+ }, t.auth.headers);
656
+ } catch (error) {
657
+ if (!(error instanceof CloudError)) throw error;
658
+ problem = error.message;
659
+ }
660
+ if (answer) {
661
+ if (answer.status >= 300 && answer.status < 400) throw redirected("the status check");
662
+ const retryable = answer.body?.error?.retryable === true;
663
+ if (answer.status >= 500 || answer.status === 429 || !answer.ok && retryable) problem = platformError(answer, what, t.auth).message;
664
+ else {
665
+ if (answer.status === 404) return null;
666
+ if (!answer.ok) throw platformError(answer, what, t.auth);
667
+ const state = runState(answer.body);
668
+ if (!state) throw new CloudError(`the cloud platform answered how run ${runId} stands with something else`);
669
+ return state;
670
+ }
671
+ }
672
+ if (Date.now() >= deadline.at) throw deadline.timeout(problem);
673
+ await setTimeout(Math.min(wait, Math.max(0, deadline.at - Date.now())));
674
+ wait = Math.min(wait * 2, MAX_POLL_MS);
675
+ }
676
+ }
677
+ /** How the cloud project's copy of `runId` stands, or null when it has none. */
678
+ function cloudRunState(t, runId) {
679
+ return readState(t, runId, {
680
+ at: Date.now() + STATE_MS,
681
+ timeout: (problem) => new CloudError(`couldn't read how run ${runId} stands: ${problem}`)
682
+ });
683
+ }
684
+ /** Waits while the platform reads `runId`, from `state`: its last state, `failed` included. */
685
+ async function waitRead(t, runId, state) {
686
+ const studio = studioUrl(t, runId);
687
+ const deadline = {
688
+ at: Date.now() + WAIT_MS,
689
+ timeout: (problem) => new CloudError(`run ${runId} still wasn't read after ${WAIT_MS / 6e4} minutes${problem ? ` (last: ${problem})` : ""}; the studio shows it once it is: ${studio.href}`)
690
+ };
691
+ let wait = FIRST_POLL_MS;
692
+ let current = state;
693
+ while (current.status === "pending") {
694
+ if (Date.now() >= deadline.at) throw deadline.timeout("");
695
+ await setTimeout(Math.min(wait, Math.max(0, deadline.at - Date.now())));
696
+ wait = Math.min(wait * 2, MAX_POLL_MS);
697
+ const next = await readState(t, runId, deadline);
698
+ if (!next) throw new CloudError(`the cloud platform has no run ${runId} any more`);
699
+ current = next;
700
+ }
701
+ return current;
702
+ }
703
+ /**
704
+ * Uploads `run`'s archive to the cloud project and, unless `wait` is false, waits until the
705
+ * platform has read it: its last state, `failed` included.
706
+ */
707
+ async function uploadRun(t, run, options) {
708
+ const { runId } = run;
709
+ const body = await archiveBytes(run);
710
+ options.progress(`Pushing ${runId}: ${plural(run.files.length, "file")}, ${formatBytes(body.length)}`);
711
+ const what = `upload run ${runId}`;
712
+ const answer = await request(runUrl(t, runId), {
713
+ method: "PUT",
714
+ what,
715
+ redirect: "manual",
716
+ headers: {
717
+ "content-type": "application/zip",
718
+ "content-length": String(body.length)
719
+ },
720
+ body,
721
+ timeoutMs: UPLOAD_BASE_MS + Math.ceil(body.length / UPLOAD_BYTES_PER_SECOND) * 1e3
722
+ }, t.auth.headers);
723
+ if (answer.status >= 300 && answer.status < 400) throw redirected("the upload");
724
+ if (!answer.ok) throw platformError(answer, what, t.auth);
725
+ const state = runState(answer.body);
726
+ if (!state) throw new CloudError(`the cloud platform took run ${runId} without saying how it stands`);
727
+ if (!options.wait) {
728
+ options.progress(`Uploaded revision ${state.revision}; the studio shows it once it's read: ${studioUrl(t, runId).href}`);
729
+ return state;
730
+ }
731
+ options.progress(`Uploaded revision ${state.revision}; waiting for the cloud platform to read it`);
732
+ return waitRead(t, runId, state);
733
+ }
734
+ const readFailed = (runId, state) => new CloudError(`the cloud platform couldn't read run ${runId}${state.error ? `: ${state.error}` : ""}`);
735
+ /** The cloud project `--org` and `--project` or the link name, with a token to send. */
736
+ async function signedInTarget(flags, io, command) {
737
+ const env = io.env ?? process.env;
738
+ const t = await target({
739
+ env,
740
+ projectDir: io.projectDir
741
+ }, flags, command, "required");
742
+ if (!t.auth.headers.authorization) throw new UsageError(`reeval ${command} needs you signed in: ${t.auth.refused}`);
743
+ return t;
744
+ }
745
+ const inside = (dir, file) => {
746
+ const rel = relative(resolve(dir), file);
747
+ return rel === "" || !rel.startsWith("..") && !isAbsolute(rel);
748
+ };
749
+ /** `path` with its deepest existing ancestor's symlinks resolved and the rest joined back on. */
750
+ async function realAncestor(path) {
751
+ const found = await realpath(path).catch(() => null);
752
+ if (found) return found;
753
+ const parent = dirname(path);
754
+ return parent === path ? path : join(await realAncestor(parent), basename(path));
755
+ }
756
+ /**
757
+ * Where `--out` writes: a file, never `-`, a folder, anywhere reeval keeps runs, or a file that is
758
+ * there already and isn't a reeval archive.
759
+ */
760
+ async function outFile(config, out) {
761
+ if (out === "-") throw new UsageError("--out takes a file to write the archive to, not - (stdout)");
762
+ const file = resolve(out);
763
+ const real = join(await realAncestor(dirname(file)), basename(file));
764
+ for (const [dir, what] of [[config.history.dir, "the history folder"], [join(config.root, ".reeval"), ".reeval/"]]) if (inside(await realAncestor(resolve(dir)), real)) throw new UsageError(`--out ${out} is inside ${what}, where reeval keeps runs: write the archive somewhere else`);
765
+ const there = await stat(file).catch(() => null);
766
+ if (there?.isDirectory()) throw new UsageError(`--out ${out} is a folder: name the file to write, e.g. ${join(out, "run.zip")}`);
767
+ if (there) {
768
+ const archive = await openArchive(file).catch(() => null);
769
+ await archive?.close();
770
+ if (!archive) throw new UsageError(`--out ${out} is there already and isn't a reeval archive: name a new file, or remove it first`);
771
+ }
772
+ return file;
773
+ }
774
+ /** Pushes the recorded run `args[0]` names (default the newest) and returns the exit code. */
775
+ async function pushCommand(config, flags, args, io) {
776
+ const warn = io.err ?? io.out;
777
+ const progress = flags.json ? io.note ?? warn : io.out;
778
+ if (flags["allow-incomplete"] && flags.artifacts === void 0) throw new UsageError("--allow-incomplete goes with --artifacts, which can push an unrecorded run: add --artifacts <level>, or leave it out");
779
+ if (flags.out !== void 0) {
780
+ const extra = [
781
+ "no-wait",
782
+ "org",
783
+ "project"
784
+ ].filter((f) => flags[f] !== void 0);
785
+ if (extra.length) throw new UsageError(`--out writes the archive to a file and uploads nothing: leave out ${extra.map((f) => `--${f}`).join(", ")}`);
786
+ const file = await outFile(config, flags.out);
787
+ const run = await scannedRun(config, flags, args[0], warn);
788
+ await mkdir(dirname(file), { recursive: true });
789
+ await writeRunArchive(file, run);
790
+ const bytes = (await stat(file)).size;
791
+ io.out(flags.json ? JSON.stringify({
792
+ runId: run.runId,
793
+ out: file,
794
+ files: run.files.length,
795
+ bytes
796
+ }) : `Wrote ${run.runId} to ${flags.out}: ${plural(run.files.length, "file")}, ${formatBytes(bytes)}`);
797
+ return 0;
798
+ }
799
+ const t = await signedInTarget(flags, io, "cloud push");
800
+ const run = await scannedRun(config, flags, args[0], warn);
801
+ const state = await uploadRun(t, run, {
802
+ wait: !flags["no-wait"],
803
+ progress
804
+ });
805
+ const studio = studioUrl(t, run.runId).href;
806
+ if (flags.json) io.out(JSON.stringify({
807
+ runId: run.runId,
808
+ ...state,
809
+ studioUrl: studio
810
+ }));
811
+ if (state.status === "failed") throw readFailed(run.runId, state);
812
+ if (!flags.json && state.status === "ready") io.out(`Ready: ${studio}`);
813
+ return 0;
814
+ }
815
+ export { scannedRun as a, uploadRun as c, putAnalysis as d, readFailed as i, waitRead as l, projectUrl as n, signedInTarget as o, pushCommand as r, studioUrl as s, cloudRunState as t, analysisProblem as u };
816
+
817
+ //# sourceMappingURL=cloud-push-CdYqsM34.js.map