reeval 0.9.0 → 0.10.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 (318) hide show
  1. package/README.md +42 -30
  2. package/THIRD_PARTY_NOTICES.md +218 -11
  3. package/assets/package.json +1 -1
  4. package/assets/pnpm-lock.yaml +30 -30
  5. package/dist/adapter-DWlpOtRn.js +279 -0
  6. package/dist/adapter-DWlpOtRn.js.map +1 -0
  7. package/dist/{agent-6FefIhX7.js → agent-CURAwx_q.js} +6 -6
  8. package/dist/{agent-6FefIhX7.js.map → agent-CURAwx_q.js.map} +1 -1
  9. package/dist/{agent-WSmTaesf.js → agent-CaS_2Sce.js} +46 -15
  10. package/dist/agent-CaS_2Sce.js.map +1 -0
  11. package/dist/{analysis-DlGBDjTj.js → analysis-Bxub9LMT.js} +4 -4
  12. package/dist/{analysis-DlGBDjTj.js.map → analysis-Bxub9LMT.js.map} +1 -1
  13. package/dist/{assemble-BCZzTyR7.js → assemble-B9Alds-z.js} +69 -41
  14. package/dist/assemble-B9Alds-z.js.map +1 -0
  15. package/dist/assemble-J5MukZFY.js +1 -0
  16. package/dist/{client-Bbo9SPlK.js → assert-EUIoRdIt.js} +10 -113
  17. package/dist/assert-EUIoRdIt.js.map +1 -0
  18. package/dist/bridge/index.mjs +248 -55
  19. package/dist/{capture-Bp74Z6Fr.js → capture-CNb9SuU5.js} +145 -31
  20. package/dist/capture-CNb9SuU5.js.map +1 -0
  21. package/dist/capture-jquXZBKK.js +1 -0
  22. package/dist/{cli-CVrMh_qz.js → cli-D303Vj5N.js} +133 -115
  23. package/dist/cli-D303Vj5N.js.map +1 -0
  24. package/dist/{cli-spec-CKEYa8V2.js → cli-spec-BPZbQG2p.js} +36 -17
  25. package/dist/cli-spec-BPZbQG2p.js.map +1 -0
  26. package/dist/cli.js +4 -2
  27. package/dist/cli.js.map +1 -1
  28. package/dist/client-fcwgwOAD.js +106 -0
  29. package/dist/client-fcwgwOAD.js.map +1 -0
  30. package/dist/{command-CzIFp1JQ.js → command-BLfT7vnQ.js} +18 -17
  31. package/dist/command-BLfT7vnQ.js.map +1 -0
  32. package/dist/{command-C5xFPKHM.js → command-BT9a37ZR.js} +374 -72
  33. package/dist/command-BT9a37ZR.js.map +1 -0
  34. package/dist/{command-DUT5l13I.js → command-Bge8F7Ko.js} +316 -83
  35. package/dist/command-Bge8F7Ko.js.map +1 -0
  36. package/dist/command-BkFjijN2.js +1 -0
  37. package/dist/{command-BFP0hKEb.js → command-CMJtHKRa.js} +14 -14
  38. package/dist/{command-BFP0hKEb.js.map → command-CMJtHKRa.js.map} +1 -1
  39. package/dist/commands-1p-bIWhN.js +1 -0
  40. package/dist/{commands-CLmPBrTS.js → commands-BFx16WB8.js} +7 -7
  41. package/dist/commands-BFx16WB8.js.map +1 -0
  42. package/dist/config-DEgnUiU-.js +756 -0
  43. package/dist/config-DEgnUiU-.js.map +1 -0
  44. package/dist/{context-DbSMEVKs.js → context-C1mxXh80.js} +11 -3
  45. package/dist/context-C1mxXh80.js.map +1 -0
  46. package/dist/{db-CfQFwJtq.js → db-CdHizc4_.js} +455 -36
  47. package/dist/db-CdHizc4_.js.map +1 -0
  48. package/dist/db-Dm1cRJJP.js +2 -0
  49. package/dist/debug-D7bEv_UV.js +1 -0
  50. package/dist/{dist-CTzThfu_.js → dist-B8hJImYt.js} +17 -4
  51. package/dist/dist-B8hJImYt.js.map +1 -0
  52. package/dist/{docker-CRQGQbIt.js → docker-7b_2SaH7.js} +22 -21
  53. package/dist/docker-7b_2SaH7.js.map +1 -0
  54. package/dist/{docker-DV2GNgle.js → docker-sZrNrr82.js} +3 -3
  55. package/dist/docker-sZrNrr82.js.map +1 -0
  56. package/dist/docker-yauK-9X8.js +1 -0
  57. package/dist/{doctor-DlKycx5H.js → doctor-BYNok4UO.js} +262 -83
  58. package/dist/doctor-BYNok4UO.js.map +1 -0
  59. package/dist/{duration-JsJrIWXq.js → duration-CEOQww97.js} +2 -2
  60. package/dist/{duration-JsJrIWXq.js.map → duration-CEOQww97.js.map} +1 -1
  61. package/dist/{egress-BhzNh7Yi.js → egress-C4PZTSSe.js} +146 -14
  62. package/dist/egress-C4PZTSSe.js.map +1 -0
  63. package/dist/environment-DNjRk0nU.js +1133 -0
  64. package/dist/environment-DNjRk0nU.js.map +1 -0
  65. package/dist/{errors-yDAEwmZo.js → errors-B6BSMs03.js} +2 -2
  66. package/dist/errors-B6BSMs03.js.map +1 -0
  67. package/dist/{errors-C9w_ud7g.js → errors-r025B0Zb.js} +4 -4
  68. package/dist/errors-r025B0Zb.js.map +1 -0
  69. package/dist/evaluate-C1UVL21l.d.ts +92 -0
  70. package/dist/evaluate-D4zeRGBF.js +2351 -0
  71. package/dist/evaluate-D4zeRGBF.js.map +1 -0
  72. package/dist/files-BAt0i00X.js +1 -0
  73. package/dist/{files-CSzVADHn.js → files-BXUdY8tr.js} +9 -8
  74. package/dist/{files-CSzVADHn.js.map → files-BXUdY8tr.js.map} +1 -1
  75. package/dist/files-BhyltlDB.js +1 -0
  76. package/dist/files-Bk1mC3AN.js +43 -0
  77. package/dist/files-Bk1mC3AN.js.map +1 -0
  78. package/dist/{files-DJUFg-4e.js → files-DQmHE7pb.js} +5 -5
  79. package/dist/{files-DJUFg-4e.js.map → files-DQmHE7pb.js.map} +1 -1
  80. package/dist/files-ZZPqfAo6.js +1 -0
  81. package/dist/harness-B8QC9u0O.js +323 -0
  82. package/dist/harness-B8QC9u0O.js.map +1 -0
  83. package/dist/harness.d.ts +16 -30
  84. package/dist/harness.js +1 -2
  85. package/dist/{header-CALhmafp.js → header-hK-Z_Po9.js} +2 -2
  86. package/dist/{header-CALhmafp.js.map → header-hK-Z_Po9.js.map} +1 -1
  87. package/dist/{images-BMgdpMAX.js → images-0On0cztu.js} +114 -45
  88. package/dist/images-0On0cztu.js.map +1 -0
  89. package/dist/index.d.ts +9 -37
  90. package/dist/index.js +6 -2138
  91. package/dist/{init-BIdLF0F9.js → init-B77Rpcqc.js} +26 -8
  92. package/dist/init-B77Rpcqc.js.map +1 -0
  93. package/dist/init-BrOWin3W.js +1 -0
  94. package/dist/{invocations-CLaL8AuW.js → invocations-DbGfBAA_.js} +4 -4
  95. package/dist/{invocations-CLaL8AuW.js.map → invocations-DbGfBAA_.js.map} +1 -1
  96. package/dist/{judge-CeYPN8P_.js → judge-DW_GDOmB.js} +11 -19
  97. package/dist/{judge-CeYPN8P_.js.map → judge-DW_GDOmB.js.map} +1 -1
  98. package/dist/judge.d.ts +2 -2
  99. package/dist/judge.js +1 -1
  100. package/dist/{live-S0qODb6o.js → live-jlfszAbb.js} +9 -20
  101. package/dist/live-jlfszAbb.js.map +1 -0
  102. package/dist/matchers-Ddmc2z7H.js +118 -0
  103. package/dist/matchers-Ddmc2z7H.js.map +1 -0
  104. package/dist/{model-DEQo3FkZ.js → model-DaVCY3rb.js} +2 -2
  105. package/dist/{model-DEQo3FkZ.js.map → model-DaVCY3rb.js.map} +1 -1
  106. package/dist/model-NM3ID0uR.js +1 -0
  107. package/dist/{model-B1BZoZ9b.js → model-h_cDtcRr.js} +18 -17
  108. package/dist/model-h_cDtcRr.js.map +1 -0
  109. package/dist/model-nwWJvaUR.js +1 -0
  110. package/dist/{model-BOnlAPzs.js → model-oqcDplJG.js} +111 -19
  111. package/dist/model-oqcDplJG.js.map +1 -0
  112. package/dist/{node-Co7EXge0.js → node-B3ydHo6t.js} +10 -47
  113. package/dist/node-B3ydHo6t.js.map +1 -0
  114. package/dist/object-CLf2-tNq.js +9 -0
  115. package/dist/object-CLf2-tNq.js.map +1 -0
  116. package/dist/{opencode-providers-ByD85Q0l.js → opencode-providers-J9colP0-.js} +96 -21
  117. package/dist/opencode-providers-J9colP0-.js.map +1 -0
  118. package/dist/options-Bh2W63dK.js +1119 -0
  119. package/dist/options-Bh2W63dK.js.map +1 -0
  120. package/dist/{pairs-DDsjgm5F.js → pairs-CnInRu-G.js} +76 -2
  121. package/dist/{pairs-DDsjgm5F.js.map → pairs-CnInRu-G.js.map} +1 -1
  122. package/dist/{patch-bDV8YFW0.js → patch-Zac5aIRM.js} +6 -6
  123. package/dist/{patch-bDV8YFW0.js.map → patch-Zac5aIRM.js.map} +1 -1
  124. package/dist/{plan-DUydFc_1.js → plan-C9Cy27Ay.js} +24 -9
  125. package/dist/plan-C9Cy27Ay.js.map +1 -0
  126. package/dist/preflight-CPWpQeBI.js +1 -0
  127. package/dist/{preflight-BkoSxf4C.js → preflight-D7iFPKeK.js} +8 -7
  128. package/dist/preflight-D7iFPKeK.js.map +1 -0
  129. package/dist/prepare-BGjePFQl.js +2 -0
  130. package/dist/{prepare-CUAWHebF.js → prepare-doGxaAGR.js} +38 -30
  131. package/dist/prepare-doGxaAGR.js.map +1 -0
  132. package/dist/{provenance-D7HK3vzt.js → provenance-DmE9uPVt.js} +3 -3
  133. package/dist/{provenance-D7HK3vzt.js.map → provenance-DmE9uPVt.js.map} +1 -1
  134. package/dist/provider-DehR4CMN.js +1 -0
  135. package/dist/providers-gDMko8fl.js +1 -0
  136. package/dist/providers-tAOD1NQN.js +165 -0
  137. package/dist/providers-tAOD1NQN.js.map +1 -0
  138. package/dist/{query-BjBMLa-C.js → query-Bes9Kh6Y.js} +3 -3
  139. package/dist/{query-BjBMLa-C.js.map → query-Bes9Kh6Y.js.map} +1 -1
  140. package/dist/query-C_G_svLU.js +1 -0
  141. package/dist/questions-DjAwMxZ3.js +524 -0
  142. package/dist/questions-DjAwMxZ3.js.map +1 -0
  143. package/dist/{record-BRP9vZrj.js → record-BKmMvZ6O.js} +9 -1
  144. package/dist/{record-BRP9vZrj.js.map → record-BKmMvZ6O.js.map} +1 -1
  145. package/dist/remote-HDRt16ew.js +378 -0
  146. package/dist/remote-HDRt16ew.js.map +1 -0
  147. package/dist/{results-Di7m8dQ3.js → results-DuauQI3Z.js} +4 -4
  148. package/dist/{results-Di7m8dQ3.js.map → results-DuauQI3Z.js.map} +1 -1
  149. package/dist/{resume-SUz1GskV.js → resume-BRfa8E_s.js} +10 -10
  150. package/dist/{resume-SUz1GskV.js.map → resume-BRfa8E_s.js.map} +1 -1
  151. package/dist/{root-CvdRlRZX.js → root-DICDHCtp.js} +4 -4
  152. package/dist/{root-CvdRlRZX.js.map → root-DICDHCtp.js.map} +1 -1
  153. package/dist/{runtime-DdsfnRz_.js → runtime-PX_oXiCS.js} +23 -71
  154. package/dist/runtime-PX_oXiCS.js.map +1 -0
  155. package/dist/sandbox-D3A8oUb7.js +70 -0
  156. package/dist/sandbox-D3A8oUb7.js.map +1 -0
  157. package/dist/sandbox.d.ts +19 -6
  158. package/dist/sandbox.js +1 -2
  159. package/dist/server-C7sg1ndo.js +1 -0
  160. package/dist/{server-BNnXtmS8.js → server-XDleKaF_.js} +11 -11
  161. package/dist/server-XDleKaF_.js.map +1 -0
  162. package/dist/shared-DYpIb1BI.js +166 -0
  163. package/dist/shared-DYpIb1BI.js.map +1 -0
  164. package/dist/{source-Dof0NQBm.js → source-C8xumIWj.js} +2 -2
  165. package/dist/{source-Dof0NQBm.js.map → source-C8xumIWj.js.map} +1 -1
  166. package/dist/source-fGd0SaKP.js +1 -0
  167. package/dist/{src-8rRXy4u9.js → src-B7treWa8.js} +1538 -180
  168. package/dist/src-B7treWa8.js.map +1 -0
  169. package/dist/{src-C1E9HDWO.js → src-C7_1SqDP.js} +3 -3
  170. package/dist/{src-C1E9HDWO.js.map → src-C7_1SqDP.js.map} +1 -1
  171. package/dist/{src-DDNXsD9H.js → src-CF17Ug08.js} +5 -4
  172. package/dist/src-CF17Ug08.js.map +1 -0
  173. package/dist/{src-C_4Umgh2.js → src-CFp86GtV.js} +52 -51
  174. package/dist/src-CFp86GtV.js.map +1 -0
  175. package/dist/src-C_lPtowT.js +2 -0
  176. package/dist/src-DIL0jST0.js +368 -0
  177. package/dist/src-DIL0jST0.js.map +1 -0
  178. package/dist/src-DNnG4e4R.js +2 -0
  179. package/dist/src-DTbrY1hi.js +2 -0
  180. package/dist/src-DdyJEh2v.js +2 -0
  181. package/dist/src-Dj9PAroc.js +2 -0
  182. package/dist/src-Du8H85Qq.js +2 -0
  183. package/dist/src-DvCg0NBs.js +324 -0
  184. package/dist/src-DvCg0NBs.js.map +1 -0
  185. package/dist/{src-COgE7991.js → src-DvK0EIZx.js} +5 -5
  186. package/dist/{src-COgE7991.js.map → src-DvK0EIZx.js.map} +1 -1
  187. package/dist/{src-DVy58-zZ.js → src-FGXhkEkH.js} +5 -5
  188. package/dist/{src-DVy58-zZ.js.map → src-FGXhkEkH.js.map} +1 -1
  189. package/dist/src-jzagbuqH.js +2 -0
  190. package/dist/src-ofUaYbuY.js +3 -0
  191. package/dist/src-pJZOrYR9.js +1 -0
  192. package/dist/{src-D95O-Smv.js → src-u8_ixn_F.js} +15 -11
  193. package/dist/src-u8_ixn_F.js.map +1 -0
  194. package/dist/{state-CiXyLqg0.js → state-C__9swoG.js} +35 -23
  195. package/dist/state-C__9swoG.js.map +1 -0
  196. package/dist/state-CeR6oz0k.js +66 -0
  197. package/dist/state-CeR6oz0k.js.map +1 -0
  198. package/dist/state-CgjQo29K.js +1 -0
  199. package/dist/studio-app/assets/index-CwQN3f_h.css +2 -0
  200. package/dist/studio-app/assets/{index-CROH2NB3.js → index-DrQc2Yxd.js} +11 -11
  201. package/dist/studio-app/index.html +2 -2
  202. package/dist/{summary-BTksrIxn.js → summary-BLAVLySU.js} +150 -19
  203. package/dist/summary-BLAVLySU.js.map +1 -0
  204. package/dist/{summary-2OAWF2N7.js → summary-DgyjUh_l.js} +7 -7
  205. package/dist/{summary-2OAWF2N7.js.map → summary-DgyjUh_l.js.map} +1 -1
  206. package/dist/testing.d.ts +3 -2
  207. package/dist/testing.js +3 -2
  208. package/dist/{tool-target-BU1JnSE9.js → tool-target-D2mcYlSQ.js} +14 -7
  209. package/dist/tool-target-D2mcYlSQ.js.map +1 -0
  210. package/dist/{tools-B10Uj7OI.js → tools-GCyNYSc1.js} +6 -6
  211. package/dist/tools-GCyNYSc1.js.map +1 -0
  212. package/dist/transcript-BNNANU8A.js +64 -0
  213. package/dist/transcript-BNNANU8A.js.map +1 -0
  214. package/dist/{types-D8RLfkFP.d.ts → types-g17bRAzt.d.ts} +389 -42
  215. package/dist/{usage-DDF_6tkV.js → usage-CleNKkly.js} +4 -2
  216. package/dist/{usage-DDF_6tkV.js.map → usage-CleNKkly.js.map} +1 -1
  217. package/dist/view/index.d.ts +42 -8
  218. package/dist/view/index.js +6 -6
  219. package/dist/views-BW6oCDUQ.js +2 -0
  220. package/dist/{views-Dqa5ojfZ.js → views-BmQF4UCI.js} +13 -8
  221. package/dist/views-BmQF4UCI.js.map +1 -0
  222. package/dist/{worker-entry-BAikHl9F.js → worker-entry-yOchGYYv.js} +16 -229
  223. package/dist/worker-entry-yOchGYYv.js.map +1 -0
  224. package/dist/{workspace-C-TrNIUc.js → workspace-CgyHEM0l.js} +6 -6
  225. package/dist/{workspace-C-TrNIUc.js.map → workspace-CgyHEM0l.js.map} +1 -1
  226. package/dist/workspace-D8sSgpiy.js +1 -0
  227. package/package.json +12 -12
  228. package/dist/agent-WSmTaesf.js.map +0 -1
  229. package/dist/assemble-BCZzTyR7.js.map +0 -1
  230. package/dist/assemble-C5qq5yT2.js +0 -2
  231. package/dist/capture-Bp74Z6Fr.js.map +0 -1
  232. package/dist/capture-DS-cPyuE.js +0 -2
  233. package/dist/cli-CVrMh_qz.js.map +0 -1
  234. package/dist/cli-spec-CKEYa8V2.js.map +0 -1
  235. package/dist/client-Bbo9SPlK.js.map +0 -1
  236. package/dist/command-BrmXUC-W.js +0 -2
  237. package/dist/command-C5xFPKHM.js.map +0 -1
  238. package/dist/command-CzIFp1JQ.js.map +0 -1
  239. package/dist/command-DUT5l13I.js.map +0 -1
  240. package/dist/commands-CLmPBrTS.js.map +0 -1
  241. package/dist/commands-fI3G2Wnh.js +0 -2
  242. package/dist/config-CGvBeewH.js +0 -457
  243. package/dist/config-CGvBeewH.js.map +0 -1
  244. package/dist/context-DbSMEVKs.js.map +0 -1
  245. package/dist/db-CSSFtGcN.js +0 -3
  246. package/dist/db-CfQFwJtq.js.map +0 -1
  247. package/dist/debug-SEmW4w8f.js +0 -2
  248. package/dist/dist-CTzThfu_.js.map +0 -1
  249. package/dist/docker-CRQGQbIt.js.map +0 -1
  250. package/dist/docker-DV2GNgle.js.map +0 -1
  251. package/dist/docker-Df_YOxxB.js +0 -2
  252. package/dist/doctor-DlKycx5H.js.map +0 -1
  253. package/dist/egress-BhzNh7Yi.js.map +0 -1
  254. package/dist/environment-1jE-HhO-.js +0 -657
  255. package/dist/environment-1jE-HhO-.js.map +0 -1
  256. package/dist/errors-C9w_ud7g.js.map +0 -1
  257. package/dist/errors-yDAEwmZo.js.map +0 -1
  258. package/dist/fake-instructions-CUI33I_F.js +0 -32
  259. package/dist/fake-instructions-CUI33I_F.js.map +0 -1
  260. package/dist/files-AiEKuEZe.js +0 -2
  261. package/dist/files-BM78_nnF.js +0 -2
  262. package/dist/files-BMCvfB4X.js +0 -2
  263. package/dist/harness-CeCp2GSW.js +0 -171
  264. package/dist/harness-CeCp2GSW.js.map +0 -1
  265. package/dist/images-BMgdpMAX.js.map +0 -1
  266. package/dist/index.js.map +0 -1
  267. package/dist/init-B6vegaP_.js +0 -2
  268. package/dist/init-BIdLF0F9.js.map +0 -1
  269. package/dist/jiti-BcJHCtrb.js +0 -46
  270. package/dist/jiti-BcJHCtrb.js.map +0 -1
  271. package/dist/live-S0qODb6o.js.map +0 -1
  272. package/dist/model-B1BZoZ9b.js.map +0 -1
  273. package/dist/model-BOnlAPzs.js.map +0 -1
  274. package/dist/model-DWeg5J7z.js +0 -2
  275. package/dist/model-FXko2kl7.js +0 -2
  276. package/dist/node-Co7EXge0.js.map +0 -1
  277. package/dist/opencode-providers-ByD85Q0l.js.map +0 -1
  278. package/dist/options-CKqyPGxX.js +0 -739
  279. package/dist/options-CKqyPGxX.js.map +0 -1
  280. package/dist/plan-DUydFc_1.js.map +0 -1
  281. package/dist/preflight-BkoSxf4C.js.map +0 -1
  282. package/dist/preflight-D5LW7Oqi.js +0 -2
  283. package/dist/prepare-CUAWHebF.js.map +0 -1
  284. package/dist/prepare-oji2oO8W.js +0 -3
  285. package/dist/provider-BDbNOQhQ.js +0 -2
  286. package/dist/providers-B1DzMvmH.js +0 -107
  287. package/dist/providers-B1DzMvmH.js.map +0 -1
  288. package/dist/providers-CpEfNU1F.js +0 -2
  289. package/dist/query-oPO_XrTy.js +0 -2
  290. package/dist/questions-B8by4Bbt.js +0 -234
  291. package/dist/questions-B8by4Bbt.js.map +0 -1
  292. package/dist/runtime-DdsfnRz_.js.map +0 -1
  293. package/dist/sandbox-D5v-of6d.js +0 -139
  294. package/dist/sandbox-D5v-of6d.js.map +0 -1
  295. package/dist/server-BNnXtmS8.js.map +0 -1
  296. package/dist/server-BNwoKzlm.js +0 -2
  297. package/dist/source-Bk_0ZaEY.js +0 -2
  298. package/dist/src-8rRXy4u9.js.map +0 -1
  299. package/dist/src-BGWuWp6I.js +0 -3
  300. package/dist/src-BRt0O02i.js +0 -3
  301. package/dist/src-Bx2x1ekD.js +0 -3
  302. package/dist/src-C_4Umgh2.js.map +0 -1
  303. package/dist/src-D95O-Smv.js.map +0 -1
  304. package/dist/src-DDNXsD9H.js.map +0 -1
  305. package/dist/src-DLa-ESW0.js +0 -4
  306. package/dist/src-cN0aB-WR.js +0 -3
  307. package/dist/src-cdIVjC5b.js +0 -2
  308. package/dist/src-sIsDHWYq.js +0 -3
  309. package/dist/state-Bo5zg4da.js +0 -2
  310. package/dist/state-CiXyLqg0.js.map +0 -1
  311. package/dist/studio-app/assets/index-B9MCTfuu.css +0 -2
  312. package/dist/summary-BTksrIxn.js.map +0 -1
  313. package/dist/tool-target-BU1JnSE9.js.map +0 -1
  314. package/dist/tools-B10Uj7OI.js.map +0 -1
  315. package/dist/views-Cs2Oqayd.js +0 -3
  316. package/dist/views-Dqa5ojfZ.js.map +0 -1
  317. package/dist/worker-entry-BAikHl9F.js.map +0 -1
  318. package/dist/workspace-Do_SiWBs.js +0 -2
@@ -1,739 +0,0 @@
1
- import { n as UsageError } from "./errors-yDAEwmZo.js";
2
- import { t as parseDuration } from "./duration-JsJrIWXq.js";
3
- import { E as workspaceOf, S as sandboxOf, T as workspaceLabel, g as isMovingRef, i as applied, l as emptyEnvironment, m as isEnvironment, o as checkEgress, r as EMPTY_BASELINE, s as checkEnv, w as unbrokeredSecrets, x as plannedSecrets } from "./environment-1jE-HhO-.js";
4
- import { g as isAgentKind, i as plannedEgress, l as HARNESS_EXAMPLE, r as egressLabel } from "./egress-BhzNh7Yi.js";
5
- import { a as checkModelString, i as badJudgeList } from "./judge-CeYPN8P_.js";
6
- import { c as opencodeModelError } from "./harness-CeCp2GSW.js";
7
- import { createHash } from "node:crypto";
8
- //#region src/harness/effort.ts
9
- /**
10
- * The reasoning effort a harness asked for. Same user-facing name on every factory; the CLI's
11
- * native flag may say thinking. Undefined when the factory left it unset. Fast is not this.
12
- */
13
- function harnessEffort(h) {
14
- return "effort" in h && typeof h.effort === "string" ? h.effort : void 0;
15
- }
16
- /**
17
- * The reasoning effort a served-model label recorded, e.g. `gpt-5.6-luna[effort=medium]` →
18
- * `medium`. Fast (`[fast=true]`) is not effort and is ignored.
19
- */
20
- function effortFromModelLabel(model) {
21
- const inner = model?.match(/\[([^\]]+)]/)?.[1];
22
- if (!inner) return void 0;
23
- for (const part of inner.split(",")) {
24
- const eq = part.indexOf("=");
25
- if (eq < 0) continue;
26
- const key = part.slice(0, eq).trim();
27
- if (key === "fast") continue;
28
- if (/^(?:reasoning_)?effort$|^thinking$/.test(key)) {
29
- const value = part.slice(eq + 1).trim();
30
- if (value) return value;
31
- }
32
- }
33
- }
34
- /** The first reasoning-effort suffix among served-model labels; undefined when none name one. */
35
- function servedEffortOf(models) {
36
- if (!models) return void 0;
37
- for (const model of models) {
38
- const effort = effortFromModelLabel(model);
39
- if (effort) return effort;
40
- }
41
- }
42
- /** Unique reasoning-effort suffixes among served-model labels, in first-seen order. */
43
- function resolvedEffortOf(models) {
44
- if (!models) return [];
45
- const seen = /* @__PURE__ */ new Set();
46
- const out = [];
47
- for (const model of models) {
48
- const effort = effortFromModelLabel(model);
49
- if (effort && !seen.has(effort)) {
50
- seen.add(effort);
51
- out.push(effort);
52
- }
53
- }
54
- return out;
55
- }
56
- //#endregion
57
- //#region src/options.ts
58
- const KNOWN = [
59
- "harness",
60
- "sandbox",
61
- "environment",
62
- "compare",
63
- "runs",
64
- "gate",
65
- "env",
66
- "egress",
67
- "judge",
68
- "capture",
69
- "timeout",
70
- "tags",
71
- "pin"
72
- ];
73
- const SUGGEST = {
74
- harnesses: "harness",
75
- sandboxes: "sandbox",
76
- environments: "environment",
77
- baseline: "environment",
78
- variants: "compare",
79
- repeat: "runs",
80
- repeats: "runs",
81
- iterations: "runs",
82
- trials: "runs",
83
- secrets: "env",
84
- vars: "env",
85
- network: "egress",
86
- networkPolicy: "egress",
87
- tag: "tags",
88
- pins: "pin",
89
- passRate: "gate",
90
- threshold: "gate"
91
- };
92
- /** Throws unless `value` is `'all'` or `{ passRate }` with a rate in (0, 1]. */
93
- function checkGate(value, where) {
94
- if (value === "all") return;
95
- const rate = value?.passRate;
96
- if ((typeof value === "object" && value !== null ? Object.keys(value) : []).length === 1 && typeof rate === "number" && rate > 0 && rate <= 1) return;
97
- throw new UsageError(`gate is 'all' (every attempt passes) or { passRate } with a share above 0 and at most 1, e.g. gate: { passRate: 0.8 } (got ${JSON.stringify(value)}) in ${where}`);
98
- }
99
- const PINNABLE = [
100
- "harness",
101
- "runs",
102
- "compare"
103
- ];
104
- const GATES = [
105
- "variants",
106
- "all",
107
- "none"
108
- ];
109
- const COMPARE_KEYS = [
110
- "baseline",
111
- "variants",
112
- "gate",
113
- "minLift",
114
- "harness",
115
- "questions",
116
- "across"
117
- ];
118
- const QUESTION_KEYS = [
119
- "question",
120
- "model",
121
- "across"
122
- ];
123
- const QUESTION_EXAMPLE = `questions: ['Which handles state more cleanly?']`;
124
- const PAIR_FACTORS = ["environment", "harness"];
125
- const ACROSS_HINT = `'environment' (vary the environment, same harness) or 'harness' (vary the harness, same environment)`;
126
- const ACROSS_MEAN = " Did you mean \"across\"? It is the factor you vary: across: 'environment'.";
127
- const ID = /^[A-Za-z0-9._:@+\-=[\]]+$/;
128
- const sanitize = (text) => (text.split("/").at(-1) ?? text).replace(/[^A-Za-z0-9._:@-]+/g, "-");
129
- function harnessId(h) {
130
- if (h.id) return h.id;
131
- const effort = harnessEffort(h);
132
- const suffix = effort ? `[effort=${sanitize(effort)}]` : "";
133
- if (h.kind === "fake") return `fake${suffix}`;
134
- return `${h.model ? `${h.kind}:${sanitize(h.model)}` : h.kind}${suffix}`;
135
- }
136
- function installId(install) {
137
- if (!install?.length) return "";
138
- const key = JSON.stringify(install.map((step) => typeof step === "string" ? step : {
139
- run: step.run,
140
- timeout: step.timeout
141
- }));
142
- return `+${createHash("sha256").update(key).digest("hex").slice(0, 8)}`;
143
- }
144
- function sandboxId(s) {
145
- if (s.id) return s.id;
146
- if (s.kind === "fake") return "fake";
147
- const install = s.kind === "docker" ? installId(s.install) : "";
148
- if (s.dockerfile) {
149
- const [file = "", dir = ""] = s.dockerfile.split(/[\\/]/).reverse();
150
- return `docker:${sanitize(file === "Dockerfile" ? dir || file : file)}${install}`;
151
- }
152
- const image = s.image ?? s.from;
153
- return image ? `docker:${sanitize(image)}${install}` : `docker${install}`;
154
- }
155
- const cellKey = (harness, environment, sandbox) => `${harness}/${environment}/${sandbox}`;
156
- const isHarness = (v) => v?.kind === "fake" || isAgentKind(v?.kind);
157
- function checkMaxConcurrent(value, where) {
158
- if (value === void 0 || Number.isInteger(value) && value >= 1) return;
159
- throw new UsageError(`maxConcurrent must be a whole number of at least 1 (got ${String(value)}) for ${where}`);
160
- }
161
- const describe = (value) => {
162
- if (Array.isArray(value)) return `a list of ${value.length}`;
163
- if (typeof value === "object" && value !== null) {
164
- const keys = Object.keys(value);
165
- return keys.length ? `an object with ${keys.map((k) => `"${k}"`).join(", ")}` : "an object";
166
- }
167
- return JSON.stringify(value) ?? String(value);
168
- };
169
- /** A question's model is a language model: evaluation models score yes/no questions only. */
170
- const isEvaluationModel = (model) => model.startsWith("typesafe-ai/");
171
- function checkQuestion(item, where) {
172
- if (typeof item === "string") {
173
- if (item.trim()) return item;
174
- throw new UsageError(`compare.questions in ${where} is an empty string. Ask something, e.g. ${QUESTION_EXAMPLE}.`);
175
- }
176
- if (typeof item !== "object" || item === null || Array.isArray(item)) throw new UsageError(`compare.questions in ${where} takes strings or { question, model?, across? } (got ${describe(item)}), e.g. ${QUESTION_EXAMPLE}.`);
177
- const unknown = Object.keys(item).filter((k) => !QUESTION_KEYS.includes(k));
178
- if (unknown.length) {
179
- const hint = unknown.some((k) => k === "cut" || k === "cuts") ? ACROSS_MEAN : "";
180
- throw new UsageError(`compare.questions in ${where} takes { question, model?, across? } (got ${unknown.map((k) => `"${k}"`).join(", ")}).${hint}`);
181
- }
182
- const { question, model, across } = item;
183
- if (typeof question !== "string" || !question.trim()) throw new UsageError(`compare.questions in ${where} has an entry without its question (got ${describe(question)}), e.g. { question: 'Which is cleaner?', model: 'google/gemini-3.8-flash' }.`);
184
- if (across !== void 0) checkAcross(across, where, question);
185
- if (model !== void 0) {
186
- if (typeof model !== "string" || checkModelString(model)) throw new UsageError(`compare.questions "${question}" in ${where}: model is a 'provider/model' string, e.g. 'google/gemini-3.8-flash' (got ${describe(model)})`);
187
- if (isEvaluationModel(model)) throw new UsageError(`compare.questions "${question}" in ${where} names ${model}, an evaluation model: it scores yes/no questions and can't pick between two attempts. Use a language model, e.g. 'google/gemini-3.8-flash'.`);
188
- }
189
- return question;
190
- }
191
- function checkQuestions(value, where) {
192
- if (!Array.isArray(value)) throw new UsageError(`compare.questions in ${where} is a list (got ${describe(value)}), e.g. ${QUESTION_EXAMPLE}.`);
193
- const list = value;
194
- if (list.length === 0) throw new UsageError(`compare.questions in ${where} is an empty list. Ask at least one, e.g. ${QUESTION_EXAMPLE}, or leave questions out.`);
195
- const texts = list.map((item) => checkQuestion(item, where));
196
- const dupe = texts.find((t, i) => texts.indexOf(t) !== i);
197
- if (dupe) throw new UsageError(`compare.questions in ${where} asks "${dupe}" twice`);
198
- }
199
- function checkAcross(value, where, question) {
200
- if (PAIR_FACTORS.includes(value)) return;
201
- throw new UsageError(`compare.questions "${question}" in ${where}: across is ${ACROSS_HINT} (got ${describe(value)}). Leave it out to vary both.`);
202
- }
203
- function checkAcrosses(value, where) {
204
- const list = Array.isArray(value) ? value : [value];
205
- if (list.length === 0) throw new UsageError(`compare.across in ${where} is ${ACROSS_HINT}, or a list of those (got ${describe(value)}). Leave it out to vary both.`);
206
- const seen = /* @__PURE__ */ new Set();
207
- for (const item of list) {
208
- if (!PAIR_FACTORS.includes(item)) throw new UsageError(`compare.across in ${where} is ${ACROSS_HINT}, or a list of those (got ${describe(item)}).`);
209
- if (seen.has(item)) throw new UsageError(`compare.across in ${where} lists "${item}" twice`);
210
- seen.add(item);
211
- }
212
- }
213
- function checkCompare(value, where) {
214
- if (Array.isArray(value)) throw new UsageError(`compare must be an object in ${where}. Use compare: { baseline, variants: [...] }.`);
215
- const spec = value;
216
- if (typeof value !== "object" || value === null || !Array.isArray(spec.variants)) throw new UsageError(`compare takes { variants, baseline? } (got ${describe(value)}) in ${where}. Use compare: { variants: [a, b], baseline?, gate?, minLift?, harness?, questions?, across? }.`);
217
- for (const key of Object.keys(value)) if (!COMPARE_KEYS.includes(key)) {
218
- const hint = key === "question" ? `. Did you mean "questions"? It's a list: ${QUESTION_EXAMPLE}.` : key === "cut" || key === "cuts" ? `.${ACROSS_MEAN}` : "";
219
- throw new UsageError(`Unknown compare option "${key}" in ${where}${hint}`);
220
- }
221
- const { baseline, variants, gate, minLift, harness, questions, across } = spec;
222
- if (questions !== void 0) checkQuestions(questions, where);
223
- if (across !== void 0) checkAcrosses(across, where);
224
- if (baseline !== void 0 && !isEnvironment(baseline)) throw new UsageError(`compare.baseline in ${where} must be an environment from defineEnvironment (got ${describe(baseline)}). It is the control; variants are not layered on it or on the eval's environment. Leave it out to use the eval's environment as the control.`);
225
- if (gate !== void 0 && !GATES.includes(gate)) throw new UsageError(`compare.gate must be one of ${GATES.join(", ")} in ${where}`);
226
- if (minLift !== void 0 && !(typeof minLift === "number" && minLift >= -1 && minLift <= 1)) throw new UsageError(`compare.minLift is points from -1 to 1 (got ${minLift}) in ${where}`);
227
- if (harness !== void 0 && !Array.isArray(harness)) throw new UsageError(`compare.harness must be a list of harness ids in ${where}`);
228
- if (variants.length === 0) throw new UsageError(`compare has no variants in ${where}. Give at least one environment.`);
229
- for (const v of variants) if (!isEnvironment(v)) throw new UsageError(`compare takes environments (got ${describe(v)}) in ${where}. Variants share the eval's prompt and checks; if a variant needs different checks, write a separate eval.`);
230
- }
231
- /** `compare: false` and `environment` beside `compare.baseline` are never legal options. */
232
- function refuseIllegalCompare(options, where) {
233
- if (options.compare === false) throw new UsageError(`compare: false can't be set in ${where}. A profile turns compare off with limit.compare: false, which runs the baseline and strips the variants. On a group or eval, omit compare or pass compare: { baseline, variants }.`);
234
- const baseline = options.compare !== null && typeof options.compare === "object" && "baseline" in options.compare ? options.compare.baseline : void 0;
235
- if (options.environment !== void 0 && baseline !== void 0) throw new UsageError(`environment and compare.baseline can't both be set in ${where}. compare: { baseline, variants } names every arm, so drop environment, or drop baseline to make environment the control.`);
236
- }
237
- /** Throws on keys that aren't options, and on values of the wrong shape, suggesting a fix. */
238
- function checkOptions(options, where, allowed = KNOWN) {
239
- for (const key of Object.keys(options)) {
240
- if (allowed.includes(key)) continue;
241
- const hint = key === "pool" ? " pool is an option of evaluate.each, beside the cases: evaluate.each(cases, { pool: false })." : SUGGEST[key] ? ` Did you mean "${SUGGEST[key]}"?` : "";
242
- throw new UsageError(`Unknown option "${key}" in ${where}.${hint}`);
243
- }
244
- const o = options;
245
- if (o.runs !== void 0 && !(Number.isInteger(o.runs) && o.runs >= 1)) throw new UsageError(`runs must be a whole number of at least 1 (got ${o.runs}) in ${where}`);
246
- if (o.gate !== void 0) checkGate(o.gate, where);
247
- if (o.tags !== void 0 && (!Array.isArray(o.tags) || o.tags.some((t) => typeof t !== "string"))) throw new UsageError(`tags must be a list of strings in ${where}`);
248
- if (o.env !== void 0) checkEnv(o.env, where, UsageError);
249
- if (o.egress !== void 0) checkEgress(o.egress, where, UsageError);
250
- checkMaxConcurrent(o.judge?.maxConcurrent, `judge in ${where}`);
251
- const threshold = o.judge?.threshold;
252
- if (threshold !== void 0 && !(typeof threshold === "number" && threshold >= 0 && threshold <= 1)) throw new UsageError(`judge.threshold must be between 0 and 1 (got ${String(threshold)}) in ${where}`);
253
- const badList = o.judge && badJudgeList(o.judge);
254
- if (badList) throw new UsageError(`judge.${badList.key} must be a list of non-empty strings (got ${badList.got}) in ${where}`);
255
- if (o.sandbox !== void 0) {
256
- const kind = o.sandbox.kind;
257
- if (kind !== "docker" && kind !== "fake") throw new UsageError(`sandbox in ${where} must come from docker() or fakeSandbox() (got ${describe(o.sandbox)})`);
258
- const max = o.sandbox.maxConcurrent;
259
- if (max !== void 0 && !(Number.isInteger(max) && max >= 1)) throw new UsageError(`sandbox.maxConcurrent in ${where} must be a whole number of at least 1 (got ${String(max)})`);
260
- }
261
- if (o.environment !== void 0) {
262
- if (Array.isArray(o.environment)) throw new UsageError(`environment takes one environment, not a list (${where}). To compare environments, use compare: { baseline, variants: [a, b] }. baseline is the control; variants are not layered on it.`);
263
- if (!isEnvironment(o.environment)) throw new UsageError(`environment in ${where} must come from defineEnvironment(…) (got ${describe(o.environment)})`);
264
- }
265
- refuseIllegalCompare(options, where);
266
- if (o.compare !== void 0) checkCompare(o.compare, where);
267
- if (o.pin !== void 0) {
268
- const bad = Array.isArray(o.pin) ? o.pin.filter((k) => !PINNABLE.includes(k)) : [o.pin];
269
- if (bad.length) throw new UsageError(`pin accepts harness, runs and compare (got ${bad.map(String).join(", ")}) in ${where}`);
270
- }
271
- if (o.capture !== void 0) checkCapture(o.capture, where);
272
- }
273
- const CAPTURE_KEYS = [
274
- "viewport",
275
- "timeout",
276
- "browser",
277
- "model"
278
- ];
279
- const CAPTURE_SHAPE = "{ viewport?, timeout?, browser?, model? }";
280
- const CAPTURE_CALL_ONLY = /* @__PURE__ */ new Set([
281
- "instructions",
282
- "wait",
283
- "name",
284
- "path"
285
- ]);
286
- /** Throws unless `capture` is a shallow-merge object with a viewport, timeout, browser and/or model. */
287
- function checkCapture(value, where) {
288
- if (typeof value !== "object" || value === null || Array.isArray(value)) throw new UsageError(`capture is ${CAPTURE_SHAPE} (got ${JSON.stringify(value)}) in ${where}`);
289
- const o = value;
290
- if (o.instructions !== void 0) throw new UsageError(`c.capture() instructions need a vision model in ${where}. instructions is call-only on the call.`);
291
- const unknown = Object.keys(o).filter((k) => !CAPTURE_KEYS.includes(k));
292
- if (unknown.length) {
293
- const key = unknown[0] ?? "";
294
- if (key === "use" || key === "fake") throw new UsageError(`Unknown capture key "${key}" in ${where}. Set capture.model. Tests pass fakeInstructions from reeval/testing as instructions.`);
295
- if (CAPTURE_CALL_ONLY.has(key)) throw new UsageError(`c.capture() ${key} is call-only on the call in ${where}. Use viewport, timeout, browser, model.`);
296
- throw new UsageError(`Unknown capture key "${key}" in ${where}. Use viewport, timeout, browser, model.`);
297
- }
298
- if (o.viewport !== void 0) checkViewport(o.viewport, where);
299
- if (o.timeout !== void 0) parseDuration(o.timeout);
300
- if (o.browser !== void 0 && typeof o.browser !== "boolean") throw new UsageError(`capture.browser is true or false (got ${JSON.stringify(o.browser)}) in ${where}`);
301
- if (o.model !== void 0) checkCaptureModel(o.model, where);
302
- }
303
- function checkViewport(value, where) {
304
- if (value === "full-page") return;
305
- if (typeof value !== "object" || value === null || Array.isArray(value)) throw new UsageError(`capture.viewport is { width, height } or 'full-page' (got ${JSON.stringify(value)}) in ${where}`);
306
- const o = value;
307
- const keys = Object.keys(o);
308
- if (keys.includes("fullPage")) throw new UsageError(`capture.viewport is { width, height } or 'full-page' in ${where}, not { height, fullPage }. Use viewport: 'full-page' for a tall shot.`);
309
- const width = o.width;
310
- const height = o.height;
311
- if (keys.some((k) => k !== "width" && k !== "height") || !(Number.isInteger(width) && width > 0) || !(Number.isInteger(height) && height > 0)) throw new UsageError(`capture.viewport is { width, height } or 'full-page' (got ${JSON.stringify(value)}) in ${where}`);
312
- }
313
- function checkCaptureModel(value, where) {
314
- if (typeof value !== "string" || !value.includes("/")) throw new UsageError(`capture.model is a 'provider/model' string, e.g. 'google/gemini-3.8-flash' (got ${JSON.stringify(value)}) in ${where}`);
315
- if (isEvaluationModel(value)) throw new UsageError(`capture.model "${value}" in ${where} is an evaluation model: it scores yes/no questions and can't drive a capture. Use a language model that accepts images, e.g. 'google/gemini-3.8-flash'.`);
316
- }
317
- function applyHarness(inherited, value, where) {
318
- if (value === void 0) return inherited;
319
- const next = typeof value === "function" ? value(inherited) : isHarnessEdit(value) ? editHarness(inherited, value, where) : value;
320
- const list = Array.isArray(next) ? next : [next];
321
- if (list.length === 0) throw new UsageError(`harness is an empty list in ${where}. Give at least one, e.g. harness: ${HARNESS_EXAMPLE}`);
322
- checkHarnesses(list, where);
323
- return list;
324
- }
325
- const isHarnessEdit = (v) => typeof v === "object" && v !== null && !Array.isArray(v) && !("kind" in v) && ("add" in v || "only" in v);
326
- /** `{ add }` appends to the inherited harnesses; `{ only }` keeps those with these ids. */
327
- function editHarness(inherited, edit, where) {
328
- if ("add" in edit && "only" in edit) throw new UsageError(`harness takes { add } or { only }, not both, in ${where}`);
329
- if ("add" in edit) return [...inherited, ...Array.isArray(edit.add) ? edit.add : [edit.add]];
330
- const ids = Array.isArray(edit.only) ? edit.only : [edit.only];
331
- const have = inherited.map(harnessId);
332
- const missing = ids.filter((id) => typeof id !== "string" || !have.includes(id));
333
- if (missing.length) throw new UsageError(`harness { only: ${missing.map((id) => JSON.stringify(id)).join(", ")} } in ${where} names no inherited harness (inherited: ${have.join(", ")})`);
334
- return inherited.filter((h) => ids.includes(harnessId(h)));
335
- }
336
- /** Each harness is one, with a valid `maxConcurrent`. */
337
- function checkHarnesses(list, where) {
338
- for (const item of list) {
339
- if (!isHarness(item)) throw new UsageError(`harness in ${where} must be like ${HARNESS_EXAMPLE} (got ${describe(item)})`);
340
- if (item.kind === "opencode") {
341
- const why = opencodeModelError(item.model);
342
- if (why) throw new UsageError(`opencode() in ${where}: ${why}`);
343
- }
344
- checkMaxConcurrent(item.maxConcurrent, `harness in ${where}`);
345
- const { startTimeout } = item;
346
- if (startTimeout !== void 0) try {
347
- parseDuration(startTimeout);
348
- } catch (error) {
349
- throw new UsageError(`startTimeout of harness in ${where}: ${error.message}`);
350
- }
351
- }
352
- }
353
- function checkUnique(list, where) {
354
- const seen = /* @__PURE__ */ new Set();
355
- for (const item of list) {
356
- const key = harnessId(item);
357
- if (!ID.test(key)) throw new UsageError(`The harness id "${key}" in ${where} may only use letters, digits and . _ : @ + - [ ] =`);
358
- if (seen.has(key)) throw new UsageError(`Two harnesses in ${where} resolve to the id "${key}". Give one an id, e.g. cursor({ model: '…', id: '…' })`);
359
- seen.add(key);
360
- }
361
- }
362
- /** A question's own `across`, else the one `compare.across` names when it names exactly one. */
363
- const plannedAcross = (own, compare) => {
364
- if (own) return own;
365
- const list = compare === void 0 ? void 0 : Array.isArray(compare) ? compare : [compare];
366
- return list?.length === 1 ? list[0] : void 0;
367
- };
368
- const plannedQuestions = (value, compareAcross) => (value ?? []).map((q) => {
369
- if (typeof q === "string") {
370
- const across = plannedAcross(void 0, compareAcross);
371
- return across ? {
372
- question: q,
373
- across
374
- } : { question: q };
375
- }
376
- const across = plannedAcross(q.across, compareAcross);
377
- return {
378
- question: q.question,
379
- ...q.model !== void 0 ? { model: q.model } : {},
380
- ...across ? { across } : {}
381
- };
382
- });
383
- function normalizeCompare(value) {
384
- if (value === void 0) return void 0;
385
- return {
386
- ...value.baseline ? { baseline: value.baseline } : {
387
- baseline: emptyEnvironment(EMPTY_BASELINE),
388
- from: "empty"
389
- },
390
- variants: value.variants,
391
- gate: value.gate ?? "variants",
392
- ...value.minLift !== void 0 ? { minLift: value.minLift } : {},
393
- ...value.harness ? { harness: value.harness.map((h) => typeof h === "string" ? h : harnessId(h)) } : {},
394
- of: value.variants.length,
395
- questions: plannedQuestions(value.questions, value.across)
396
- };
397
- }
398
- function applyLevel(out, options, where, egress = "own") {
399
- for (const [key, value] of Object.entries(options)) if (value !== void 0) out.sources = {
400
- ...out.sources,
401
- [key]: where
402
- };
403
- if (options.egress !== void 0) out.egress[egress] = options.egress;
404
- out.harness = applyHarness(out.harness, options.harness, where);
405
- if (options.sandbox !== void 0) out.sandbox = options.sandbox;
406
- if (options.environment !== void 0) out.environment = options.environment;
407
- if (options.compare !== void 0) out.compare = normalizeCompare(options.compare);
408
- if (options.runs !== void 0) out.runs = options.runs;
409
- if (options.gate !== void 0) out.gate = options.gate;
410
- if (options.timeout !== void 0) out.timeout = options.timeout;
411
- Object.assign(out.env, options.env);
412
- Object.assign(out.judge, options.judge);
413
- if (options.capture !== void 0) {
414
- const { viewport, ...rest } = options.capture;
415
- out.capture = {
416
- ...out.capture,
417
- ...rest
418
- };
419
- if (viewport !== void 0) out.capture.viewport = viewport;
420
- }
421
- for (const tag of options.tags ?? []) if (!out.tags.includes(tag)) out.tags.push(tag);
422
- for (const key of options.pin ?? []) if (!out.pin.includes(key)) out.pin.push(key);
423
- }
424
- /** What a profile sets over the config's judge: its `judge`, then its `defaults.judge`. */
425
- const profileJudge = (profile) => ({
426
- ...profile.judge,
427
- ...profile.defaults.judge
428
- });
429
- /**
430
- * Config, then the profile's defaults, then each enclosing group, then the eval; then the
431
- * profile's limit (narrowing only, except pinned keys); then `--runs`.
432
- */
433
- function cascade(base, levels, where, options = {}) {
434
- const out = {
435
- ...base,
436
- env: { ...base.env },
437
- egress: { ...base.egress },
438
- judge: { ...base.judge },
439
- capture: { ...base.capture },
440
- tags: [...base.tags],
441
- pin: [...base.pin]
442
- };
443
- const { profile } = options;
444
- const notes = [];
445
- if (profile) applyLevel(out, {
446
- ...profile.defaults,
447
- judge: profileJudge(profile)
448
- }, `profiles.${profile.name}.defaults`, "inherited");
449
- for (const { options: own, where: at } of levels) applyLevel(out, own, at);
450
- if (out.compare?.from && out.environment) out.compare = {
451
- ...out.compare,
452
- baseline: out.environment,
453
- from: "environment"
454
- };
455
- checkUnique(out.harness, where);
456
- if (profile?.defaults.harness !== void 0 && levels.some((l) => l.options.harness)) notes.push("harness set by the eval");
457
- const ids = out.harness.map(harnessId);
458
- const missing = (out.compare?.harness)?.filter((id) => !ids.includes(id)) ?? [];
459
- if (missing.length) throw new UsageError(`compare.harness lists ${missing.join(", ")}, which ${where} doesn't run (it runs ${ids.join(", ")}).`);
460
- for (const v of out.compare?.variants ?? []) if (v.name === out.compare?.baseline.name) throw new UsageError(out.compare.from === "empty" ? `compare in ${where} lists a variant named ${v.name}, the name of the empty control a compare without a baseline or environment runs. Rename the variant, or set compare.baseline.` : out.compare.from === "environment" ? `compare in ${where} lists ${v.name}, which is the control: compare has no baseline, so the eval's environment is. List only the other environments.` : `compare in ${where} lists ${v.name}, which is the baseline. List only the other environments.`);
461
- const names = out.compare?.variants.map((v) => v.name) ?? [];
462
- const dupe = names.find((n, i) => names.indexOf(n) !== i);
463
- if (dupe) throw new UsageError(`compare in ${where} lists two variants named ${dupe}`);
464
- let skip;
465
- const limit = profile?.limit;
466
- if (profile && limit) {
467
- const tag = `profile ${profile.name}`;
468
- const pinned = (key) => out.pin.includes(key);
469
- if (limit.runs !== void 0 && options.runs === void 0 && !pinned("runs") && out.runs > limit.runs) {
470
- notes.push(`runs ${out.runs} → ${limit.runs} (${tag})`);
471
- out.runs = limit.runs;
472
- }
473
- if (limit.harness && !pinned("harness")) {
474
- const kept = out.harness.filter((h) => limit.harness?.includes(harnessId(h)));
475
- if (kept.length === 0) skip = `no harness left: ${tag} allows ${limit.harness.join(", ") || "none"}`;
476
- else if (kept.length < out.harness.length) {
477
- notes.push(`harnesses ${out.harness.length} → ${kept.length} (${tag})`);
478
- out.harness = kept;
479
- }
480
- }
481
- if (out.compare && limit.compare !== void 0 && !pinned("compare")) {
482
- if (limit.compare === false) {
483
- notes.push(`compare off (${tag})`);
484
- out.compare = {
485
- ...out.compare,
486
- variants: []
487
- };
488
- } else if (out.compare.variants.length > limit.compare.maxVariants) {
489
- notes.push(`variants ${out.compare.variants.length} → ${limit.compare.maxVariants} (${tag})`);
490
- out.compare = {
491
- ...out.compare,
492
- variants: out.compare.variants.slice(0, limit.compare.maxVariants)
493
- };
494
- }
495
- if (out.compare.variants.length === 0 && out.compare.questions.length) {
496
- notes.push(`questions off (${tag})`);
497
- out.compare = {
498
- ...out.compare,
499
- questions: []
500
- };
501
- }
502
- }
503
- const pins = out.pin.filter((k) => k === "compare" ? limit.compare !== void 0 && out.compare : limit[k] !== void 0);
504
- if (pins.length) notes.push(`pinned: ${pins.join(", ")}`);
505
- }
506
- if (options.runs !== void 0) out.runs = options.runs;
507
- return {
508
- resolved: out,
509
- notes,
510
- ...skip ? { skip } : {}
511
- };
512
- }
513
- /**
514
- * The sandbox an attempt runs in: the resolved environment's (including an `.extend()`
515
- * parent's), else the first variant's when this is an omitted-baseline empty control, else
516
- * the cascaded option (`defineConfig` / profile defaults / group / eval), else implicit Docker.
517
- * A named environment is a total override: the config environment's sandbox is not inherited.
518
- */
519
- const attemptSandbox = (resolved, env) => {
520
- const own = env.layers.findLast((l) => l.spec.sandbox)?.spec.sandbox;
521
- if (own) return own;
522
- const variant = resolved.compare?.from === "empty" && env.name === "baseline" ? resolved.compare.variants[0] : void 0;
523
- return sandboxOf(variant?.layers ?? [], resolved.sandbox);
524
- };
525
- /**
526
- * Which level set this attempt's sandbox: the cascade source of the environment that named one
527
- * (an `.extend()` child still names that environment), else the first variant when this is an
528
- * omitted-baseline empty control, else the cascaded `sandbox` option, else the config (implicit
529
- * Docker).
530
- */
531
- function sandboxSetBy(planned, resolved, configFile) {
532
- if (!planned.environment.layers.some((l) => l.spec.sandbox)) {
533
- if (resolved.compare?.from === "empty" && planned.cell.role === "control" && resolved.compare.variants[0]?.layers.some((l) => l.spec.sandbox)) return resolved.sources?.compare ?? configFile;
534
- return resolved.sources?.sandbox ?? configFile;
535
- }
536
- if (resolved.compare) {
537
- if (planned.cell.role === "control") {
538
- if (resolved.compare.from === "environment") return resolved.sources?.environment ?? configFile;
539
- if (resolved.compare.from === "empty") return configFile;
540
- return resolved.sources?.compare ?? configFile;
541
- }
542
- return resolved.sources?.compare ?? configFile;
543
- }
544
- return resolved.sources?.environment ?? configFile;
545
- }
546
- /** Per harness: the control, then each variant it compares on; then run numbers. */
547
- function expand(resolved) {
548
- const { compare } = resolved;
549
- const control = applied(compare ? compare.baseline : resolved.environment);
550
- const policy = resolved.gate ?? "all";
551
- const gateIf = (gated) => gated ? policy : "none";
552
- const attempts = [];
553
- for (const harness of resolved.harness) {
554
- const hid = harnessId(harness);
555
- const cells = [(() => {
556
- const sandbox = attemptSandbox(resolved, control);
557
- const sid = sandboxId(sandbox);
558
- return {
559
- env: control,
560
- sandbox,
561
- cell: {
562
- key: cellKey(hid, control.name, sid),
563
- harness: hid,
564
- environment: control.name,
565
- sandbox: sid,
566
- role: "control"
567
- },
568
- gate: gateIf(!compare || compare.gate === "all")
569
- };
570
- })()];
571
- if (compare && (!compare.harness || compare.harness.includes(hid))) for (const v of compare.variants) {
572
- const env = applied(v);
573
- const sandbox = attemptSandbox(resolved, env);
574
- const sid = sandboxId(sandbox);
575
- cells.push({
576
- env,
577
- sandbox,
578
- cell: {
579
- key: cellKey(hid, env.name, sid),
580
- harness: hid,
581
- environment: env.name,
582
- sandbox: sid,
583
- role: "variant",
584
- variant: v.name
585
- },
586
- gate: gateIf(compare.gate !== "none")
587
- });
588
- }
589
- for (const { env, sandbox, cell, gate } of cells) {
590
- const axes = [resolved.harness.length > 1 ? hid : "", compare ? cell.role === "control" ? "control" : env.name : ""].filter(Boolean);
591
- for (let n = 1; n <= resolved.runs; n++) {
592
- const label = [axes.join(" · "), resolved.runs > 1 ? `#${n}` : ""].filter(Boolean).join(" ");
593
- attempts.push({
594
- cell,
595
- harness,
596
- sandbox,
597
- environment: env,
598
- egress: plannedEgress(resolved.egress, harness, resolved.env, env.layers),
599
- gate,
600
- ...cell.role === "variant" && compare?.minLift !== void 0 ? { minLift: compare.minLift } : {},
601
- n,
602
- label
603
- });
604
- }
605
- }
606
- }
607
- return attempts;
608
- }
609
- /** Warnings about what an eval's environments pull in, e.g. skills at a moving git ref. */
610
- function environmentWarnings(attempts) {
611
- const out = /* @__PURE__ */ new Set();
612
- for (const a of attempts) {
613
- const workspace = workspaceOf(a.environment.layers);
614
- if (workspace && isMovingRef(workspace.ref)) {
615
- const ref = workspace.ref ? `moving ref "${workspace.ref}"` : "no ref (the default branch)";
616
- out.add(`workspace git(${workspace.repo}) uses ${ref}: results aren't comparable over time. Pin a tag or SHA (the resolved commit is recorded either way).`);
617
- }
618
- for (const layer of a.environment.layers) for (const s of layer.spec.skills ?? []) {
619
- if (s.source === "git" && isMovingRef(s.ref)) {
620
- const ref = s.ref ? `moving ref "${s.ref}"` : "no ref (the default branch)";
621
- out.add(`skill.git(${s.repo}) uses ${ref}: results aren't comparable over time. Pin a tag or SHA (the resolved commit is recorded either way).`);
622
- }
623
- if (s.source === "registry" && !s.version) out.add(`skill.registry(${s.id}) has no version: results aren't comparable over time. Pin one (the resolved commit is recorded either way).`);
624
- }
625
- }
626
- return [...out];
627
- }
628
- /** Secrets a Docker attempt would get as real values, because they have no `hosts`. */
629
- function unbrokered(env, attempts) {
630
- const out = /* @__PURE__ */ new Map();
631
- for (const a of attempts) {
632
- if (a.sandbox.kind !== "docker") continue;
633
- for (const s of unbrokeredSecrets(env, a.environment.layers)) out.set(s.label, s);
634
- }
635
- return [...out.values()];
636
- }
637
- /** An optional secret whose host variable isn't set never reaches the sandbox, so it gets no warning. */
638
- const reachesSandbox = (s) => !s.optional || Boolean(process.env[s.from]);
639
- /** `GEMINI_API_KEY → generativelanguage.googleapis.com` for each secret an attempt brokers. */
640
- const brokeredIn = (env, attempt) => [...new Set(plannedSecrets(env, attempt.environment.layers).flatMap((s) => s.hosts ? [`${s.label} → ${s.hosts.join(", ")}`] : []))];
641
- /** The host variables an attempt's secrets read, brokered or not. */
642
- const secretVarsIn = (env, attempt) => [...new Set(plannedSecrets(env, attempt.environment.layers).map((s) => s.from))];
643
- const brokerHint = (s) => /^mcp\.[^.]+\.headers\./.test(s.label) ? "give the MCP server an https:// URL (reeval brokers its header secrets to its own host, over HTTPS only)" : `add the hosts it's sent to, e.g. secret.fromEnv('${s.from}', { hosts: ['api.example.com'] })`;
644
- const unbrokeredWarning = (s) => s.checksOnly ? `${s.label} reaches the checks (c.exec, setup steps) as its real value; the agent never gets it. To give the checks only a placeholder, ${brokerHint(s)}.` : `${s.label} is in the sandbox as its real value. To give the agent only a placeholder, ${brokerHint(s)}.`;
645
- const unbrokeredError = (s, where, configFile) => `${s.label} in ${where} isn't brokered, and secrets.unbrokered is 'error' in ${configFile}. To broker it, ${brokerHint(s)}.`;
646
- const levelOf = (where) => where.startsWith("evaluate(") ? "eval" : where.startsWith("group(") ? "group" : where.startsWith("profiles.") ? "profile" : "config";
647
- /**
648
- * A warning per privilege an attempt's Docker sandbox adds, naming the level that set the
649
- * environment which owns that sandbox: the config when no profile, group or eval did.
650
- */
651
- function sandboxWarnings(attempts, resolved, origin) {
652
- const out = [];
653
- const seen = /* @__PURE__ */ new Set();
654
- for (const a of attempts) {
655
- if (a.sandbox.kind !== "docker") continue;
656
- const where = sandboxSetBy(a, resolved, origin.configFile);
657
- const level = levelOf(where);
658
- const file = level === "eval" || level === "group" ? origin.file : null;
659
- if (a.sandbox.root) {
660
- const message = `running as root in the sandbox: ${where} (docker({ root: true }))`;
661
- const key = `${file}\0${message}`;
662
- if (!seen.has(key)) {
663
- seen.add(key);
664
- out.push({
665
- kind: "root",
666
- level,
667
- where,
668
- file,
669
- message
670
- });
671
- }
672
- }
673
- if (a.sandbox.capabilities?.length) {
674
- const message = `extra capabilities in the sandbox: ${where} (docker({ capabilities: [${a.sandbox.capabilities.map((c) => `'${c}'`).join(", ")}] }))`;
675
- const key = `${file}\0${message}`;
676
- if (!seen.has(key)) {
677
- seen.add(key);
678
- out.push({
679
- kind: "capabilities",
680
- level,
681
- where,
682
- file,
683
- capabilities: [...a.sandbox.capabilities],
684
- message
685
- });
686
- }
687
- }
688
- }
689
- return out;
690
- }
691
- /** The plan row for an eval. */
692
- function evalPlan(r, attempts, origin) {
693
- const { resolved, skip } = r;
694
- const capture = captureNote(resolved.capture);
695
- const notes = capture ? [...r.notes, capture] : r.notes;
696
- return {
697
- harnesses: skip ? 0 : resolved.harness.length,
698
- variants: resolved.compare ? {
699
- run: resolved.compare.variants.length,
700
- of: resolved.compare.of
701
- } : null,
702
- ...resolved.compare ? { compare: {
703
- baseline: resolved.compare.baseline.name,
704
- ...resolved.compare.from ? { from: resolved.compare.from } : {}
705
- } } : {},
706
- ...!skip && resolved.compare?.questions.length ? { questions: resolved.compare.questions } : {},
707
- runs: resolved.runs,
708
- ...resolved.gate !== void 0 ? { gate: resolved.gate } : {},
709
- attempts: skip ? 0 : attempts.length,
710
- notes,
711
- ...skip ? { skip } : {},
712
- warnings: [...environmentWarnings(attempts), ...unbrokered(r.resolved.env, attempts).filter(reachesSandbox).map(unbrokeredWarning)],
713
- sandboxWarnings: skip ? [] : sandboxWarnings(attempts, resolved, origin),
714
- brokered: [...new Set(attempts.flatMap((a) => brokeredIn(r.resolved.env, a)))],
715
- egress: [...new Set(attempts.map((a) => egressLabel(a.egress)).filter(Boolean))],
716
- workspaces: [...new Set(attempts.flatMap((a) => {
717
- const w = workspaceOf(a.environment.layers);
718
- return w ? [workspaceLabel(w)] : [];
719
- }))],
720
- ...capture ? { capture: resolved.capture } : {}
721
- };
722
- }
723
- function captureNote(c) {
724
- const parts = [];
725
- if (c.viewport === "full-page") parts.push("full-page");
726
- else if (c.viewport) parts.push(`${c.viewport.width}×${c.viewport.height}`);
727
- if (c.timeout !== void 0) parts.push(typeof c.timeout === "number" ? `${c.timeout}ms` : c.timeout);
728
- if (c.browser === false) parts.push("browser false");
729
- if (c.model) parts.push(`model ${c.model}`);
730
- return parts.length ? `capture: ${parts.join(" · ")}` : void 0;
731
- }
732
- /** `--tag a --tag !b`: every entry must hold. */
733
- function matchesTags(tags, filters) {
734
- return filters.every((f) => f.startsWith("!") ? !tags.includes(f.slice(1)) : tags.includes(f));
735
- }
736
- //#endregion
737
- export { resolvedEffortOf as _, evalPlan as a, levelOf as c, sandboxId as d, sandboxSetBy as f, harnessEffort as g, unbrokeredError as h, checkOptions as i, matchesTags as l, unbrokered as m, cascade as n, expand as o, secretVarsIn as p, checkHarnesses as r, harnessId as s, brokeredIn as t, profileJudge as u, servedEffortOf as v };
738
-
739
- //# sourceMappingURL=options-CKqyPGxX.js.map