reeval 0.13.0 → 0.14.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 (313) hide show
  1. package/README.md +2 -0
  2. package/THIRD_PARTY_NOTICES.md +121 -121
  3. package/dist/{adapter-IKKo4sZj.js → adapter-BloGVZ_a.js} +20 -8
  4. package/dist/adapter-BloGVZ_a.js.map +1 -0
  5. package/dist/{agent-ClE-g9VL.js → agent-m-_t-IuW.js} +53 -25
  6. package/dist/{agent-ClE-g9VL.js.map → agent-m-_t-IuW.js.map} +1 -1
  7. package/dist/{analysis-B0nOfAzA.js → analysis-C2-aEbr7.js} +4 -4
  8. package/dist/{analysis-B0nOfAzA.js.map → analysis-C2-aEbr7.js.map} +1 -1
  9. package/dist/app-files-C-jwhRDt.js +11 -0
  10. package/dist/app-files-C-jwhRDt.js.map +1 -0
  11. package/dist/{assemble-BO93VAk1.js → assemble-BDEpelpi.js} +92 -35
  12. package/dist/assemble-BDEpelpi.js.map +1 -0
  13. package/dist/assemble-C5bfncHU.js +1 -0
  14. package/dist/{capture-dn2hjSLj.js → capture-CVRwRTnb.js} +572 -36
  15. package/dist/capture-CVRwRTnb.js.map +1 -0
  16. package/dist/capture-CherbjzB.js +1 -0
  17. package/dist/{cli-BCE1xlm4.js → cli-C_4gaJ50.js} +132 -140
  18. package/dist/cli-C_4gaJ50.js.map +1 -0
  19. package/dist/{cli-spec-BXIBUlaK.js → cli-spec-CpnbATtI.js} +2 -2
  20. package/dist/{cli-spec-BXIBUlaK.js.map → cli-spec-CpnbATtI.js.map} +1 -1
  21. package/dist/cli.js +2 -2
  22. package/dist/{assert-EUIoRdIt.js → client-D5hNjpEx.js} +105 -2
  23. package/dist/client-D5hNjpEx.js.map +1 -0
  24. package/dist/{command-C6vwmjS7.js → command-BWAuwQNk.js} +12 -12
  25. package/dist/{command-C6vwmjS7.js.map → command-BWAuwQNk.js.map} +1 -1
  26. package/dist/{command-CANun0m0.js → command-BXLUfw4h.js} +12 -12
  27. package/dist/{command-CANun0m0.js.map → command-BXLUfw4h.js.map} +1 -1
  28. package/dist/{command-CBaHukyl.js → command-Be6BSE2L.js} +12 -12
  29. package/dist/{command-CBaHukyl.js.map → command-Be6BSE2L.js.map} +1 -1
  30. package/dist/{command-D_kEnYcX.js → command-Bxdy62dW.js} +14 -13
  31. package/dist/command-Bxdy62dW.js.map +1 -0
  32. package/dist/{command-Bh3yhN_b.js → command-I1euLLio.js} +35 -15
  33. package/dist/command-I1euLLio.js.map +1 -0
  34. package/dist/{commands-7tH3EsVu.js → commands-jzigbNFb.js} +23 -14
  35. package/dist/commands-jzigbNFb.js.map +1 -0
  36. package/dist/{commands-BKGzBMgb.js → commands-p1S4nw_H.js} +1 -1
  37. package/dist/config-BrdHA9bJ.js +3549 -0
  38. package/dist/config-BrdHA9bJ.js.map +1 -0
  39. package/dist/{contrasts-B4nOhn0Z.js → contrasts-DRxMQQTC.js} +3 -2
  40. package/dist/contrasts-DRxMQQTC.js.map +1 -0
  41. package/dist/cost-D4elx933.js +359 -0
  42. package/dist/cost-D4elx933.js.map +1 -0
  43. package/dist/cost-DmnAod9x.js +1 -0
  44. package/dist/db-CAfksinX.js +2 -0
  45. package/dist/{db-DJUuFoWQ.js → db-DO0p7xgP.js} +25 -8
  46. package/dist/db-DO0p7xgP.js.map +1 -0
  47. package/dist/{dist-Dp_AJgYN.js → dist-CYrBwyHA.js} +2 -2
  48. package/dist/{dist-Dp_AJgYN.js.map → dist-CYrBwyHA.js.map} +1 -1
  49. package/dist/{docker-DuHcQidD.js → docker-BnRlTpZA.js} +2 -2
  50. package/dist/{docker-DuHcQidD.js.map → docker-BnRlTpZA.js.map} +1 -1
  51. package/dist/{docker-CQxucRPe.js → docker-D01slDF3.js} +26 -10
  52. package/dist/docker-D01slDF3.js.map +1 -0
  53. package/dist/{docker-Dac6Zalz.js → docker-DivfZl2u.js} +1 -1
  54. package/dist/{doctor-De_QlOTM.js → doctor-DQ2p0euG.js} +135 -36
  55. package/dist/doctor-DQ2p0euG.js.map +1 -0
  56. package/dist/{environment-B4IuURK1.js → environment-CO0P0soF.js} +8 -7
  57. package/dist/environment-CO0P0soF.js.map +1 -0
  58. package/dist/{evaluate-Djk1YPFL.js → evaluate-BUmsN7yG.js} +66 -27
  59. package/dist/evaluate-BUmsN7yG.js.map +1 -0
  60. package/dist/{evaluate-C9-ritA5.d.ts → evaluate-C_sgRA-V.d.ts} +45 -3
  61. package/dist/{facts-Cfx1H70y.js → facts-DzOUTreB.js} +12 -4
  62. package/dist/facts-DzOUTreB.js.map +1 -0
  63. package/dist/{files-CN1QfenC.js → files-B-CJeeEh.js} +13 -8
  64. package/dist/{files-CN1QfenC.js.map → files-B-CJeeEh.js.map} +1 -1
  65. package/dist/files-Bp5j5BqI.js +1 -0
  66. package/dist/files-C2sjmXhk.js +1 -0
  67. package/dist/{files-Bs6H3HiG.js → files-C_gQNVB-.js} +3 -3
  68. package/dist/{files-Bs6H3HiG.js.map → files-C_gQNVB-.js.map} +1 -1
  69. package/dist/{files-D27nUk0K.js → files-kUCrswI6.js} +2 -2
  70. package/dist/{files-D27nUk0K.js.map → files-kUCrswI6.js.map} +1 -1
  71. package/dist/gateway.d.ts +17 -0
  72. package/dist/gateway.js +17 -0
  73. package/dist/gateway.js.map +1 -0
  74. package/dist/{generate-BnrvBAzF.js → generate-DZ7vp69F.js} +18 -17
  75. package/dist/generate-DZ7vp69F.js.map +1 -0
  76. package/dist/{git-rPfl7AD1.js → git-Bk8DSwHy.js} +2 -2
  77. package/dist/{git-rPfl7AD1.js.map → git-Bk8DSwHy.js.map} +1 -1
  78. package/dist/{harness-1OkumOAm.js → harness-COVXSwJ6.js} +46 -15
  79. package/dist/harness-COVXSwJ6.js.map +1 -0
  80. package/dist/harness.d.ts +26 -18
  81. package/dist/harness.js +1 -1
  82. package/dist/{header-BVzbRnNv.js → header-BLPP6aCU.js} +2 -2
  83. package/dist/{header-BVzbRnNv.js.map → header-BLPP6aCU.js.map} +1 -1
  84. package/dist/{images-m784ueGK.js → images-DzLeFjLx.js} +8 -8
  85. package/dist/{images-m784ueGK.js.map → images-DzLeFjLx.js.map} +1 -1
  86. package/dist/index.d.ts +3 -45
  87. package/dist/index.js +5 -6
  88. package/dist/init-RgCQXZhb.js +1 -0
  89. package/dist/{init-hiTkiM4L.js → init-SRalM5xF.js} +6 -8
  90. package/dist/init-SRalM5xF.js.map +1 -0
  91. package/dist/{insights-B2Xmhz9o.js → insights-TyAvz9aV.js} +5 -1
  92. package/dist/{insights-B2Xmhz9o.js.map → insights-TyAvz9aV.js.map} +1 -1
  93. package/dist/{invocations-D_ePcwyL.js → invocations-DzyKSJBa.js} +2 -2
  94. package/dist/{invocations-D_ePcwyL.js.map → invocations-DzyKSJBa.js.map} +1 -1
  95. package/dist/judge-yLvjC5A3.js +385 -0
  96. package/dist/judge-yLvjC5A3.js.map +1 -0
  97. package/dist/judge.d.ts +7 -6
  98. package/dist/judge.js +7 -5
  99. package/dist/judge.js.map +1 -1
  100. package/dist/match-Bz0nSdzN.js +204 -0
  101. package/dist/match-Bz0nSdzN.js.map +1 -0
  102. package/dist/{matchers-Ddmc2z7H.js → matchers-D4eUqx4j.js} +2 -2
  103. package/dist/{matchers-Ddmc2z7H.js.map → matchers-D4eUqx4j.js.map} +1 -1
  104. package/dist/{model-DpkclE4r.js → model-1ZLr9Dcv.js} +40 -26
  105. package/dist/model-1ZLr9Dcv.js.map +1 -0
  106. package/dist/model-B45lDUV1.js +68 -0
  107. package/dist/model-B45lDUV1.js.map +1 -0
  108. package/dist/model-BTZq8HIZ.js +1 -0
  109. package/dist/{model-UgHDMhI1.js → model-CgnOpss4.js} +57 -318
  110. package/dist/model-CgnOpss4.js.map +1 -0
  111. package/dist/{model-B8H3gL69.js → model-Ch8kX87u.js} +1 -1
  112. package/dist/{node-CGZYh4Fj.js → node-BSq5qHnQ.js} +12 -5
  113. package/dist/node-BSq5qHnQ.js.map +1 -0
  114. package/dist/{opencode-providers-snfeWd6Z.js → opencode-providers-klkqgzvb.js} +23 -52
  115. package/dist/opencode-providers-klkqgzvb.js.map +1 -0
  116. package/dist/{pairs-DP6XOJby.js → pairs-CHfZNRT6.js} +8 -7
  117. package/dist/pairs-CHfZNRT6.js.map +1 -0
  118. package/dist/{patch-uMq9rCl_.js → patch-DWf-I_Q_.js} +2 -2
  119. package/dist/{patch-uMq9rCl_.js.map → patch-DWf-I_Q_.js.map} +1 -1
  120. package/dist/{plan-CZYgXnZh.js → plan-BIwUzlB8.js} +63 -26
  121. package/dist/plan-BIwUzlB8.js.map +1 -0
  122. package/dist/{plugins-P-uh54VF.js → plugins-Dkp_H3pB.js} +4 -4
  123. package/dist/{plugins-P-uh54VF.js.map → plugins-Dkp_H3pB.js.map} +1 -1
  124. package/dist/{preflight-BQlPTHVu.js → preflight-D9y-HvZQ.js} +1 -1
  125. package/dist/{preflight-D3HvKeAx.js → preflight-DJCD_BDn.js} +3 -3
  126. package/dist/{preflight-D3HvKeAx.js.map → preflight-DJCD_BDn.js.map} +1 -1
  127. package/dist/{prepare-DCwM2KKD.js → prepare-BJG_pD54.js} +2 -2
  128. package/dist/{prepare-Dx7dOnJB.js → prepare-CIxCGG0M.js} +8 -8
  129. package/dist/{prepare-Dx7dOnJB.js.map → prepare-CIxCGG0M.js.map} +1 -1
  130. package/dist/prices-BcLEXvdY.js +250 -0
  131. package/dist/prices-BcLEXvdY.js.map +1 -0
  132. package/dist/{provenance-C_-8y-x3.js → provenance-CfZpFpAh.js} +2 -2
  133. package/dist/{provenance-C_-8y-x3.js.map → provenance-CfZpFpAh.js.map} +1 -1
  134. package/dist/{providers-CTBYvMxu.js → providers-D1Zxp2he.js} +1 -1
  135. package/dist/{providers-CF5UEaP8.js → providers-DFk_6W4K.js} +5 -5
  136. package/dist/{providers-CF5UEaP8.js.map → providers-DFk_6W4K.js.map} +1 -1
  137. package/dist/{query-DXthKmq0.js → query-CemclveB.js} +2 -2
  138. package/dist/{query-DXthKmq0.js.map → query-CemclveB.js.map} +1 -1
  139. package/dist/query-Cvbwl804.js +1 -0
  140. package/dist/{questions-KENpWnfV.js → questions-bAudIc04.js} +308 -45
  141. package/dist/questions-bAudIc04.js.map +1 -0
  142. package/dist/{remarks-Ml6bcSdV.js → remarks-CXwSnSjR.js} +9 -9
  143. package/dist/{remarks-Ml6bcSdV.js.map → remarks-CXwSnSjR.js.map} +1 -1
  144. package/dist/remarks-CyAu2DiB.js +1 -0
  145. package/dist/{remarks-1521zwfW.js → remarks-mujJv1Ey.js} +5 -3
  146. package/dist/remarks-mujJv1Ey.js.map +1 -0
  147. package/dist/{remote-Dkeghk8k.js → remote-CKcEKja4.js} +129 -174
  148. package/dist/remote-CKcEKja4.js.map +1 -0
  149. package/dist/resolve-B5-uqmJ6.js +1 -0
  150. package/dist/{resolve-DzdWcIL6.js → resolve-CBoKzQMP.js} +8 -9
  151. package/dist/resolve-CBoKzQMP.js.map +1 -0
  152. package/dist/{results-D-naai_Q.js → results-CMgZEANy.js} +8 -8
  153. package/dist/{results-D-naai_Q.js.map → results-CMgZEANy.js.map} +1 -1
  154. package/dist/{resume-8-nnW8iO.js → resume-B9SOSnK9.js} +3 -3
  155. package/dist/{resume-8-nnW8iO.js.map → resume-B9SOSnK9.js.map} +1 -1
  156. package/dist/{root-DNuLhaA5.js → root-Dlff-zp8.js} +4 -4
  157. package/dist/{root-DNuLhaA5.js.map → root-Dlff-zp8.js.map} +1 -1
  158. package/dist/{rules-CcV3zLDR.js → rules-VhftPOOT.js} +53 -5
  159. package/dist/rules-VhftPOOT.js.map +1 -0
  160. package/dist/{run-Bel7Vde4.js → run-CwIEK16q.js} +9 -9
  161. package/dist/{run-Bel7Vde4.js.map → run-CwIEK16q.js.map} +1 -1
  162. package/dist/{runtime-PX_oXiCS.js → runtime-BgQRyCLl.js} +14 -2
  163. package/dist/runtime-BgQRyCLl.js.map +1 -0
  164. package/dist/{sandbox-YLbk9mO7.js → sandbox-BOYZ0hlo.js} +2 -2
  165. package/dist/{sandbox-YLbk9mO7.js.map → sandbox-BOYZ0hlo.js.map} +1 -1
  166. package/dist/sandbox.d.ts +2 -1
  167. package/dist/sandbox.js +1 -1
  168. package/dist/server-CHRSgKRp.js +1 -0
  169. package/dist/{server-De8oH3bt.js → server-TGW4WyAz.js} +25 -26
  170. package/dist/{server-De8oH3bt.js.map → server-TGW4WyAz.js.map} +1 -1
  171. package/dist/{shared-CA61BuPJ.js → shared-BDUzStad.js} +2 -2
  172. package/dist/shared-BDUzStad.js.map +1 -0
  173. package/dist/shared-CHvO7eLi.d.ts +1 -0
  174. package/dist/{source-C686eZpY.js → source-B1WvBIQt.js} +2 -2
  175. package/dist/{source-C686eZpY.js.map → source-B1WvBIQt.js.map} +1 -1
  176. package/dist/source-DAzztZwU.js +1 -0
  177. package/dist/src-1jHbFaGW.js +1 -0
  178. package/dist/{src-CIpKL45U.js → src-8zoX_qrb.js} +36 -26
  179. package/dist/{src-CIpKL45U.js.map → src-8zoX_qrb.js.map} +1 -1
  180. package/dist/{src-CzQrAcF8.js → src-CHIwOy0o.js} +84 -52
  181. package/dist/src-CHIwOy0o.js.map +1 -0
  182. package/dist/src-C_9wgowC.js +2 -0
  183. package/dist/{src-djNNYIdP.js → src-ChhtI6BP.js} +2 -2
  184. package/dist/{src-djNNYIdP.js.map → src-ChhtI6BP.js.map} +1 -1
  185. package/dist/{src-DrJSnoMR.js → src-CyaDNG9r.js} +1 -1
  186. package/dist/src-D005Cbqz.js +2 -0
  187. package/dist/src-DIfRbp5a.js +3 -0
  188. package/dist/{src-C7W6kg81.js → src-DKPVX2Us.js} +34 -16
  189. package/dist/{src-C7W6kg81.js.map → src-DKPVX2Us.js.map} +1 -1
  190. package/dist/src-Dg8121Xy.js +2 -0
  191. package/dist/{src-cbCb-MPy.js → src-DjF_M8_f.js} +44 -20
  192. package/dist/{src-cbCb-MPy.js.map → src-DjF_M8_f.js.map} +1 -1
  193. package/dist/{src-DIL0jST0.js → src-DjRI-IeE.js} +42 -14
  194. package/dist/src-DjRI-IeE.js.map +1 -0
  195. package/dist/{src-DeY52Gyf.js → src-DmUgeTlE.js} +4 -4
  196. package/dist/{src-DeY52Gyf.js.map → src-DmUgeTlE.js.map} +1 -1
  197. package/dist/src-ElBqEN-S.js +2 -0
  198. package/dist/{src-Xj_BZKbq.js → src-NSdQ9zI6.js} +31 -16
  199. package/dist/{src-Xj_BZKbq.js.map → src-NSdQ9zI6.js.map} +1 -1
  200. package/dist/src-YHGaUrGE.js +2 -0
  201. package/dist/src-mJVxw1Jm.js +2 -0
  202. package/dist/{state-C0i_ujQZ.js → state-B1t143wG.js} +18 -18
  203. package/dist/{state-C0i_ujQZ.js.map → state-B1t143wG.js.map} +1 -1
  204. package/dist/state-vznMh2wl.js +1 -0
  205. package/dist/stats-DSy5HfOv.js +315 -0
  206. package/dist/stats-DSy5HfOv.js.map +1 -0
  207. package/dist/suite-BsWGHzlG.js +2 -0
  208. package/dist/{suite-DmuF_ApO.js → suite-WgT7m6Vs.js} +76 -11
  209. package/dist/suite-WgT7m6Vs.js.map +1 -0
  210. package/dist/{summary-BFMHMTz2.js → summary-DIGEVr08.js} +58 -17
  211. package/dist/summary-DIGEVr08.js.map +1 -0
  212. package/dist/testing.d.ts +174 -2
  213. package/dist/testing.js +14 -3
  214. package/dist/testing.js.map +1 -0
  215. package/dist/types-C5vI3g1C.js.map +1 -1
  216. package/dist/{types-B-9b1MDV.d.ts → types-DXBbP9Mk.d.ts} +298 -70
  217. package/dist/{usage-CleNKkly.js → usage-BNY1ABrU.js} +3 -3
  218. package/dist/{usage-CleNKkly.js.map → usage-BNY1ABrU.js.map} +1 -1
  219. package/dist/usage-DF3_p5pE.js +1 -0
  220. package/dist/{validate-DWjkshl1.js → validate-BhwqrVsm.js} +44 -12
  221. package/dist/validate-BhwqrVsm.js.map +1 -0
  222. package/dist/view/index.d.ts +133 -86
  223. package/dist/view/index.js +7 -6
  224. package/dist/views-BW_C5eVH.js +2 -0
  225. package/dist/{views-Dk8MCQKr.js → views-sXpGE6a2.js} +10 -8
  226. package/dist/views-sXpGE6a2.js.map +1 -0
  227. package/dist/{worker-entry-CqrzGPF4.js → worker-entry-Duo9oAeT.js} +8 -8
  228. package/dist/{worker-entry-CqrzGPF4.js.map → worker-entry-Duo9oAeT.js.map} +1 -1
  229. package/dist/{workspace-CLeOybkr.js → workspace-CDI68wtX.js} +4 -4
  230. package/dist/{workspace-CLeOybkr.js.map → workspace-CDI68wtX.js.map} +1 -1
  231. package/dist/workspace-QZCacP8A.js +1 -0
  232. package/package.json +6 -2
  233. package/skills/eval-rubric/SKILL.md +9 -0
  234. package/dist/adapter-IKKo4sZj.js.map +0 -1
  235. package/dist/assemble-BO93VAk1.js.map +0 -1
  236. package/dist/assemble-VQxyoDxK.js +0 -1
  237. package/dist/assert-EUIoRdIt.js.map +0 -1
  238. package/dist/capture-dn2hjSLj.js.map +0 -1
  239. package/dist/capture-nIJ-7kUE.js +0 -1
  240. package/dist/cli-BCE1xlm4.js.map +0 -1
  241. package/dist/client-fcwgwOAD.js +0 -106
  242. package/dist/client-fcwgwOAD.js.map +0 -1
  243. package/dist/command-Bh3yhN_b.js.map +0 -1
  244. package/dist/command-D_kEnYcX.js.map +0 -1
  245. package/dist/commands-7tH3EsVu.js.map +0 -1
  246. package/dist/config-D7TFvUpL.js +0 -759
  247. package/dist/config-D7TFvUpL.js.map +0 -1
  248. package/dist/contrasts-B4nOhn0Z.js.map +0 -1
  249. package/dist/db-DJUuFoWQ.js.map +0 -1
  250. package/dist/db-W9EFlXnn.js +0 -2
  251. package/dist/docker-CQxucRPe.js.map +0 -1
  252. package/dist/doctor-De_QlOTM.js.map +0 -1
  253. package/dist/egress-DEAvq8Fl.js +0 -1258
  254. package/dist/egress-DEAvq8Fl.js.map +0 -1
  255. package/dist/environment-B4IuURK1.js.map +0 -1
  256. package/dist/evaluate-Djk1YPFL.js.map +0 -1
  257. package/dist/facts-Cfx1H70y.js.map +0 -1
  258. package/dist/files-CtjEXWXm.js +0 -1
  259. package/dist/files-D3gJa91B.js +0 -1
  260. package/dist/generate-BnrvBAzF.js.map +0 -1
  261. package/dist/harness-1OkumOAm.js.map +0 -1
  262. package/dist/init-hiTkiM4L.js.map +0 -1
  263. package/dist/init-kMkTgTZc.js +0 -1
  264. package/dist/judge-CEDIfRiU.js +0 -186
  265. package/dist/judge-CEDIfRiU.js.map +0 -1
  266. package/dist/model-CTiuzkWw.js +0 -46
  267. package/dist/model-CTiuzkWw.js.map +0 -1
  268. package/dist/model-DcIbmggK.js +0 -1
  269. package/dist/model-DpkclE4r.js.map +0 -1
  270. package/dist/model-UgHDMhI1.js.map +0 -1
  271. package/dist/node-CGZYh4Fj.js.map +0 -1
  272. package/dist/opencode-providers-snfeWd6Z.js.map +0 -1
  273. package/dist/options-CyAyLjgJ.js +0 -1129
  274. package/dist/options-CyAyLjgJ.js.map +0 -1
  275. package/dist/pairs-DP6XOJby.js.map +0 -1
  276. package/dist/plan-CZYgXnZh.js.map +0 -1
  277. package/dist/query-D_1ARx5q.js +0 -1
  278. package/dist/questions-KENpWnfV.js.map +0 -1
  279. package/dist/remarks-1521zwfW.js.map +0 -1
  280. package/dist/remarks-BhAV1H4V.js +0 -1
  281. package/dist/remote-Dkeghk8k.js.map +0 -1
  282. package/dist/resolve-CMmhACr6.js +0 -1
  283. package/dist/resolve-DzdWcIL6.js.map +0 -1
  284. package/dist/rules-CcV3zLDR.js.map +0 -1
  285. package/dist/runtime-PX_oXiCS.js.map +0 -1
  286. package/dist/server-C-ysqkLv.js +0 -1
  287. package/dist/shared-CA61BuPJ.js.map +0 -1
  288. package/dist/source-DjgypUHW.js +0 -1
  289. package/dist/src-3mP821Pt.js +0 -2
  290. package/dist/src-B3KCLZVk.js +0 -3
  291. package/dist/src-BAyg6CtQ.js +0 -2
  292. package/dist/src-BezgGX4X.js +0 -2
  293. package/dist/src-ChBhk06Q.js +0 -2
  294. package/dist/src-CoqZYspK.js +0 -2
  295. package/dist/src-CzQrAcF8.js.map +0 -1
  296. package/dist/src-D9fSTxlc.js +0 -1
  297. package/dist/src-DIL0jST0.js.map +0 -1
  298. package/dist/src-dhSTRN50.js +0 -2
  299. package/dist/state-BGWGAwdo.js +0 -1
  300. package/dist/state-CeR6oz0k.js +0 -66
  301. package/dist/state-CeR6oz0k.js.map +0 -1
  302. package/dist/studio-app/assets/index-Bb_cid9k.js +0 -58
  303. package/dist/studio-app/assets/index-CwQN3f_h.css +0 -2
  304. package/dist/studio-app/favicon.svg +0 -1
  305. package/dist/studio-app/index.html +0 -15
  306. package/dist/suite-DmuF_ApO.js.map +0 -1
  307. package/dist/suite-mn9g4veR.js +0 -2
  308. package/dist/summary-BFMHMTz2.js.map +0 -1
  309. package/dist/usage-BDo2q_yu.js +0 -1
  310. package/dist/validate-DWjkshl1.js.map +0 -1
  311. package/dist/views-DE2A1jEX.js +0 -2
  312. package/dist/views-Dk8MCQKr.js.map +0 -1
  313. package/dist/workspace-B1eGO46M.js +0 -1
@@ -0,0 +1,385 @@
1
+ import { a as providerServedModel, i as providerModelResponses, n as providerEndpoints, r as providerHosts, s as resolveOpenCodeProvider } from "./opencode-providers-klkqgzvb.js";
2
+ import { r as badCharacterAt } from "./redact-CRGdfV2s.js";
3
+ import { setTimeout } from "node:timers/promises";
4
+ //#region src/gateway/vercel.ts
5
+ const VERCEL_HOST = "ai-gateway.vercel.sh";
6
+ /** What the adapters take Vercel's key as, whichever host variable it came from. */
7
+ const VERCEL_KEY = "AI_GATEWAY_API_KEY";
8
+ /** A Vercel project's short-lived token (`vercel env pull`), used when there's no key. */
9
+ const VERCEL_OIDC = "VERCEL_OIDC_TOKEN";
10
+ /** The host variable the key comes from: `AI_GATEWAY_API_KEY`, else `VERCEL_OIDC_TOKEN`. */
11
+ const vercelCredential = (env = process.env) => !env["AI_GATEWAY_API_KEY"] && env["VERCEL_OIDC_TOKEN"] ? VERCEL_OIDC : VERCEL_KEY;
12
+ /** When a JWT's `exp` says it expires, or undefined when it isn't one or doesn't say. */
13
+ function jwtExpiry(token) {
14
+ const [, payload] = token.split(".");
15
+ if (!payload) return void 0;
16
+ try {
17
+ const { exp } = JSON.parse(Buffer.from(payload, "base64url").toString("utf8"));
18
+ return typeof exp === "number" ? /* @__PURE__ */ new Date(exp * 1e3) : void 0;
19
+ } catch {
20
+ return;
21
+ }
22
+ }
23
+ /**
24
+ * Why the run can't use Vercel's key, or undefined when it can: `VERCEL_OIDC_TOKEN` lasts about
25
+ * 12 hours, and a run that starts on an expired one fails every attempt.
26
+ */
27
+ function vercelCredentialProblem(env = process.env, now = /* @__PURE__ */ new Date()) {
28
+ if (vercelCredential(env) !== "VERCEL_OIDC_TOKEN") return void 0;
29
+ const expiry = jwtExpiry(env["VERCEL_OIDC_TOKEN"] ?? "");
30
+ if (!expiry || expiry > now) return void 0;
31
+ return `${VERCEL_OIDC} expired at ${expiry.toISOString()}, so vercel() can't authenticate. Run vercel env pull for a new one, or set ${VERCEL_KEY}.`;
32
+ }
33
+ const onVercel = (path, method) => ({
34
+ host: VERCEL_HOST,
35
+ path: { exact: path },
36
+ method: [method]
37
+ });
38
+ /**
39
+ * The response names the model that served it on Vercel's host, in Vercel's form
40
+ * (`openai/gpt-5.6-luna`), with the reasoning effort when it says one.
41
+ */
42
+ const servedOnVercel = ({ host, responseModel, responseEffort }) => host === "ai-gateway.vercel.sh" && responseModel ? `${responseModel}${responseEffort ? `[effort=${responseEffort}]` : ""}` : void 0;
43
+ /**
44
+ * Claude Code with `ANTHROPIC_BASE_URL` at Vercel's host: its adapter switches to it when given
45
+ * the key as `AI_GATEWAY_API_KEY`, and the CLI sends it in `x-api-key` on Anthropic's message
46
+ * paths. On another base URL it makes none of its `/api/claude_code/*` calls.
47
+ */
48
+ function claudeCode(env) {
49
+ return {
50
+ credential: vercelCredential(env),
51
+ authAs: VERCEL_KEY,
52
+ endpoints: [onVercel("/v1/messages", "POST"), onVercel("/v1/messages/count_tokens", "POST")],
53
+ hosts: [VERCEL_HOST]
54
+ };
55
+ }
56
+ /** Codex on a Responses API provider at Vercel, whose ids name the provider (`openai/…`). */
57
+ function codex(env) {
58
+ const endpoints = [onVercel("/v1/responses", "POST")];
59
+ return {
60
+ credential: vercelCredential(env),
61
+ authAs: VERCEL_KEY,
62
+ endpoints,
63
+ modelResponses: endpoints,
64
+ servedModel: servedOnVercel,
65
+ hosts: [VERCEL_HOST],
66
+ modelId: (model) => model.includes("/") ? model : `openai/${model}`
67
+ };
68
+ }
69
+ /** fx's language-model calls on Vercel, whose responses name the model that served them. */
70
+ const FX_VERCEL_CALL = {
71
+ host: VERCEL_HOST,
72
+ path: { regex: "^/v\\d+/ai/language-model$" },
73
+ method: ["POST"]
74
+ };
75
+ /**
76
+ * The model an fx call asked the gateway for, in `ai-language-model-id`: what reeval records when
77
+ * a provider's stream (Gemini's) names no served model. Only a call that succeeded asked anything.
78
+ */
79
+ const fxAskedModel = (request) => {
80
+ if (request.host !== "ai-gateway.vercel.sh" || !new RegExp(FX_VERCEL_CALL.path.regex).test(request.path)) return void 0;
81
+ if (request.status === void 0 || request.status < 200 || request.status > 299) return void 0;
82
+ const asked = request.headers?.["ai-language-model-id"];
83
+ return (typeof asked === "string" ? asked : asked?.[0]) || void 0;
84
+ };
85
+ /** The model list fx fetches before a turn, and its language-model calls. */
86
+ const FX_VERCEL_ENDPOINTS = [{
87
+ host: VERCEL_HOST,
88
+ path: { regex: "^/coding-agent/v1/" },
89
+ method: ["GET"]
90
+ }, FX_VERCEL_CALL];
91
+ /** fx on its own AI Gateway provider, which takes a gateway id; a bare one is OpenAI's. */
92
+ function fx(env) {
93
+ return {
94
+ credential: vercelCredential(env),
95
+ authAs: VERCEL_KEY,
96
+ endpoints: FX_VERCEL_ENDPOINTS,
97
+ modelResponses: [FX_VERCEL_CALL],
98
+ servedModel: servedOnVercel,
99
+ askedModel: fxAskedModel,
100
+ hosts: [VERCEL_HOST],
101
+ modelId: (model) => model.includes("/") ? model : `openai/${model}`
102
+ };
103
+ }
104
+ /** A Gemini id as Vercel names it (`google/gemini-3-flash`), unless the id names a provider. */
105
+ const googleId = (model) => model.includes("/") ? model : `google/${model}`;
106
+ /**
107
+ * Goose on its `vercel_ai_gateway` provider, an OpenAI-compatible one: Chat Completions, the
108
+ * Responses API for OpenAI's reasoning models, and the model list it fetches each turn.
109
+ */
110
+ function goose(env) {
111
+ const calls = [onVercel("/v1/chat/completions", "POST"), onVercel("/v1/responses", "POST")];
112
+ return {
113
+ credential: vercelCredential(env),
114
+ authAs: VERCEL_KEY,
115
+ endpoints: [...calls, onVercel("/v1/models", "GET")],
116
+ modelResponses: calls,
117
+ servedModel: servedOnVercel,
118
+ hosts: [VERCEL_HOST],
119
+ modelId: googleId
120
+ };
121
+ }
122
+ /**
123
+ * OpenCode on its own `vercel` provider, with the model as `vercel/<id>`: the requests the pinned
124
+ * CLI sends that provider's key on (harness-opencode's provider table), plus Exa's host for web
125
+ * search.
126
+ */
127
+ function opencode(env) {
128
+ const resolved = resolveOpenCodeProvider("vercel/model");
129
+ if ("error" in resolved) throw new Error(resolved.error);
130
+ const { provider } = resolved;
131
+ return {
132
+ credential: vercelCredential(env),
133
+ authAs: VERCEL_KEY,
134
+ endpoints: providerEndpoints(provider),
135
+ modelResponses: providerModelResponses(provider),
136
+ servedModel: (request) => providerServedModel(provider, request),
137
+ hosts: [...providerHosts(provider), "mcp.exa.ai"],
138
+ modelId: (model) => `vercel/${model}`
139
+ };
140
+ }
141
+ /**
142
+ * Grok Build with the model as a `[model.<id>]` table on Vercel's Chat Completions API, keyed by
143
+ * `env_key`; it then calls nothing on xAI's API.
144
+ */
145
+ function grokBuild(env) {
146
+ const endpoints = [onVercel("/v1/chat/completions", "POST")];
147
+ return {
148
+ credential: vercelCredential(env),
149
+ authAs: VERCEL_KEY,
150
+ endpoints,
151
+ modelResponses: endpoints,
152
+ servedModel: servedOnVercel,
153
+ hosts: [VERCEL_HOST],
154
+ expectedBlocked: {
155
+ hosts: ["vercel.com"],
156
+ why: "Grok Build's probe of the gateway's root, which Vercel redirects to its site"
157
+ },
158
+ modelId: (model) => model.includes("/") ? model : `xai/${model}`
159
+ };
160
+ }
161
+ /** The harnesses reeval runs on Vercel, and what each needs there. */
162
+ const VERCEL_ROUTES = {
163
+ "claude-code": claudeCode,
164
+ codex,
165
+ goose,
166
+ opencode,
167
+ fx,
168
+ "grok-build": grokBuild
169
+ };
170
+ /** Why Vercel can't serve an agent reeval doesn't route there, for the plan's messages. */
171
+ const VERCEL_REFUSALS = {
172
+ cursor: "Cursor's agent only calls Cursor's own API",
173
+ antigravity: "Antigravity's CLI only calls Google's API, with a Gemini key",
174
+ pi: "pi reaches a Gemini model on Vercel AI Gateway only through Anthropic's Messages API, with Anthropic's thinking budget for Gemini's own thinking level, and doesn't behave as it does on Gemini's API; reeval runs pi on its Gemini key"
175
+ };
176
+ /**
177
+ * The harnesses on Vercel whose `effort` reaches the model by a path no real run has checked: the
178
+ * plan refuses `effort` with them on `vercel()`. Claude Code's goes as on Anthropic's API, and
179
+ * Codex's response names the effort it ran at.
180
+ */
181
+ const VERCEL_UNPROVEN_EFFORT = [
182
+ "goose",
183
+ "opencode",
184
+ "grok-build"
185
+ ];
186
+ //#endregion
187
+ //#region src/judge/retry.ts
188
+ /** Up to six tries over about a minute: long enough to ride out a provider's "high demand". */
189
+ const JUDGE_RETRY = {
190
+ attempts: 6,
191
+ baseMs: 2e3,
192
+ maxMs: 3e4
193
+ };
194
+ const TRANSIENT_STATUS = /* @__PURE__ */ new Set([
195
+ 408,
196
+ 409,
197
+ 425,
198
+ 429
199
+ ]);
200
+ const TRANSIENT_MESSAGE = /high demand|overloaded|unavailable|rate.?limit|resource.?exhausted|try again|ECONNRESET|ECONNREFUSED|ETIMEDOUT|EAI_AGAIN|socket hang up|fetch failed/i;
201
+ /** The AI SDK wraps the provider's error once it has retried itself; look through that. */
202
+ const innermost = (error) => {
203
+ const e = error;
204
+ return e?.name === "AI_RetryError" && e.lastError ? innermost(e.lastError) : error;
205
+ };
206
+ /** An error from the provider's API (an AI SDK `APICallError`), not one reeval raised itself. */
207
+ const isApiError = (error) => typeof innermost(error)?.statusCode === "number";
208
+ /** Rate limits, 5xx, overload and network blips. Never a bad request, bad key, abort or timeout. */
209
+ function isTransient(error) {
210
+ const e = innermost(error);
211
+ if (!e || e.name === "AbortError" || e.name === "TimeoutError") return false;
212
+ if (typeof e.statusCode === "number") return e.statusCode >= 500 || TRANSIENT_STATUS.has(e.statusCode) || e.isRetryable === true;
213
+ return e.isRetryable === true || TRANSIENT_MESSAGE.test(e.message ?? String(e));
214
+ }
215
+ function retryAfterMs(error) {
216
+ const header = innermost(error)?.responseHeaders?.["retry-after"];
217
+ const seconds = Number(header);
218
+ return Number.isFinite(seconds) && seconds > 0 ? seconds * 1e3 : 0;
219
+ }
220
+ /** Exponential backoff with equal jitter, at least any `retry-after`, never above `maxMs`. */
221
+ function backoffMs(policy, retry, error) {
222
+ const cap = Math.min(policy.maxMs, policy.baseMs * 2 ** retry);
223
+ const jittered = cap / 2 + Math.random() * (cap / 2);
224
+ return Math.round(Math.min(policy.maxMs, Math.max(jittered, retryAfterMs(error))));
225
+ }
226
+ /** Runs `call` until it succeeds, fails for good, or runs out of tries. */
227
+ async function withRetries(call, policy, signal) {
228
+ const retries = [];
229
+ for (;;) try {
230
+ return {
231
+ value: await call(),
232
+ retries
233
+ };
234
+ } catch (error) {
235
+ if (signal.aborted || retries.length + 1 >= policy.attempts || !isTransient(error)) {
236
+ const failed = error instanceof Error ? error : new Error(String(error));
237
+ failed.retries = retries;
238
+ throw failed;
239
+ }
240
+ const delayMs = backoffMs(policy, retries.length, error);
241
+ const e = innermost(error);
242
+ retries.push({
243
+ error: e?.message ?? String(e),
244
+ delayMs
245
+ });
246
+ await setTimeout(delayMs, void 0, { signal });
247
+ }
248
+ }
249
+ //#endregion
250
+ //#region src/judge/index.ts
251
+ /** The judge the docs recommend, pinned so a model update never silently moves scores. */
252
+ const RECOMMENDED_JUDGE_MODEL = "typesafe-ai/jev-1.14.0";
253
+ /** The language model `reeval init` sets as `analysis.model` and the docs recommend for insights. */
254
+ const RECOMMENDED_ANALYSIS_MODEL = "google/gemini-3.8-flash";
255
+ const DEFAULT_THRESHOLD = .8;
256
+ const GATEWAY_KEYS = [VERCEL_KEY, VERCEL_OIDC];
257
+ /**
258
+ * Providers `direct()` calls, each through its own AI SDK package and key. Any other prefix needs
259
+ * `vercel()` in the config's gateway list.
260
+ */
261
+ const DIRECT_PROVIDERS = {
262
+ anthropic: {
263
+ key: "ANTHROPIC_API_KEY",
264
+ pkg: "@ai-sdk/anthropic",
265
+ name: "Anthropic"
266
+ },
267
+ google: {
268
+ key: "GOOGLE_GENERATIVE_AI_API_KEY",
269
+ pkg: "@ai-sdk/google",
270
+ name: "Google"
271
+ },
272
+ openai: {
273
+ key: "OPENAI_API_KEY",
274
+ pkg: "@ai-sdk/openai",
275
+ name: "OpenAI"
276
+ },
277
+ "typesafe-ai": {
278
+ key: "TYPESAFE_AI_API_KEY",
279
+ pkg: "@ai-sdk/typesafe-ai",
280
+ name: "TypeSafe AI"
281
+ }
282
+ };
283
+ const isFakeJudge = (m) => typeof m === "object" && m !== null && m.kind === "fake-judge";
284
+ function judgeModelName(model) {
285
+ if (typeof model === "string") return model;
286
+ if (isFakeJudge(model)) return "fake";
287
+ const m = model;
288
+ return m.provider && m.modelId ? `${m.provider}/${m.modelId}` : "custom";
289
+ }
290
+ /**
291
+ * Checks a model string's shape; returns an error message naming it as `what` (with where it was
292
+ * set), or undefined when it's valid.
293
+ */
294
+ function checkModelString(model, what = "The judge model", examples = [RECOMMENDED_JUDGE_MODEL, `google/${model}`]) {
295
+ if (model.includes("/")) return void 0;
296
+ return `${what} needs a provider prefix, e.g. ${examples.map((e) => `"${e}"`).join(" or ")} (got "${model}")`;
297
+ }
298
+ const providerOf = (model) => model.slice(0, model.indexOf("/"));
299
+ /**
300
+ * Environment variables a model needs on `gateway`, in the order reeval prefers them; any one is
301
+ * enough. On direct, its provider's own key (none for a prefix reeval can't call directly); on
302
+ * vercel, the Gateway's.
303
+ */
304
+ function judgeCredentials(model, gateway = "direct") {
305
+ if (isFakeJudge(model)) return [];
306
+ if (gateway === "vercel") return GATEWAY_KEYS;
307
+ const direct = DIRECT_PROVIDERS[providerOf(model)];
308
+ return direct ? [direct.key] : [];
309
+ }
310
+ /** The keys that would work for a model on `on`: `ANTHROPIC_API_KEY (for direct())`. */
311
+ function modelKeyOptions(model, on = "direct") {
312
+ if (on === "vercel") return `${GATEWAY_KEYS.join(" or ")} (for vercel())`;
313
+ const direct = DIRECT_PROVIDERS[providerOf(model)];
314
+ return direct ? `${direct.key} (for direct())` : `vercel() in gateway (direct() calls only ${Object.keys(DIRECT_PROVIDERS).map((p) => `${p}/*`).join(", ")} models)`;
315
+ }
316
+ /** The Vercel credential set in `env`, if any. */
317
+ const setGatewayKey = (env) => GATEWAY_KEYS.find((k) => env[k]);
318
+ /**
319
+ * ` AI_GATEWAY_API_KEY is set, but …` when a Vercel credential is set and the model goes direct, so
320
+ * a key that worked before reeval stopped falling back to the Gateway says how to use it.
321
+ */
322
+ function unusedGatewayKey(env, gateway = "direct") {
323
+ if (gateway !== "direct") return "";
324
+ const set = setGatewayKey(env);
325
+ return set ? ` ${set} is set, but no gateway in the config uses it: add vercel() to gateway to call the model through Vercel AI Gateway.` : "";
326
+ }
327
+ /**
328
+ * The provider's own package on direct, or the Vercel AI Gateway on vercel. Throws, naming the
329
+ * model, its prefix and the keys that would work, when none is set, when the key it would send
330
+ * has whitespace or a line break in it, or when Vercel's project token has expired.
331
+ */
332
+ function judgeRoute(model, env = process.env, what = "judge model", gateway = "direct") {
333
+ const provider = providerOf(model);
334
+ const direct = DIRECT_PROVIDERS[provider];
335
+ const keys = judgeCredentials(model, gateway);
336
+ if (!keys.length) throw new Error(`${what} "${model}" needs vercel() in the config's gateway list: direct() calls only ${Object.keys(DIRECT_PROVIDERS).map((p) => `${p}/*`).join(", ")} models.`);
337
+ const key = keys.find((k) => env[k]);
338
+ if (key === void 0) throw new Error(`No credentials for ${what} "${model}" (provider "${provider}"). Set ${modelKeyOptions(model, gateway)}, in the environment or .env.local.${unusedGatewayKey(env, gateway)}`);
339
+ if (key === "VERCEL_OIDC_TOKEN") {
340
+ const expired = vercelCredentialProblem(env);
341
+ if (expired) throw new Error(`${what} "${model}": ${expired}`);
342
+ }
343
+ const at = badCharacterAt(env[key]);
344
+ if (at) throw new Error(`${key} for ${what} "${model}" has whitespace or a line break in it at character ${at}. A key copied from a wrapped terminal line picks these up; set it again as one line.`);
345
+ return direct && key === direct.key ? {
346
+ kind: "direct",
347
+ provider,
348
+ pkg: direct.pkg
349
+ } : { kind: "gateway" };
350
+ }
351
+ /** Transient provider errors (429, 5xx, "high demand") are retried with backoff and recorded. */
352
+ async function runJudge(question, state, options, signal, retry = JUDGE_RETRY) {
353
+ const { model, threshold } = options;
354
+ const gateway = typeof options.gateway === "object" ? options.gateway.kind : options.gateway;
355
+ let score;
356
+ let resolvedModel;
357
+ let retries = [];
358
+ if (isFakeJudge(model)) score = typeof model.score === "function" ? model.score(state) : model.score;
359
+ else {
360
+ if (typeof model === "string") {
361
+ const problem = checkModelString(model);
362
+ if (problem) throw new Error(problem);
363
+ }
364
+ const { scoreWithModel } = await import("./model-B45lDUV1.js");
365
+ const scored = await withRetries(() => scoreWithModel(model, question, state, options.providerOptions, signal, gateway), retry, signal);
366
+ ({score, resolvedModel} = scored.value);
367
+ retries = scored.retries;
368
+ }
369
+ return {
370
+ verdict: {
371
+ verdict: score >= threshold ? "pass" : "fail",
372
+ score,
373
+ threshold,
374
+ question,
375
+ model: judgeModelName(model),
376
+ ...resolvedModel ? { resolvedModel } : {},
377
+ ...gateway && typeof model === "string" ? { gateway } : {}
378
+ },
379
+ retries
380
+ };
381
+ }
382
+ //#endregion
383
+ export { servedOnVercel as C, fxAskedModel as S, VERCEL_HOST as _, checkModelString as a, VERCEL_ROUTES as b, judgeModelName as c, runJudge as d, setGatewayKey as f, FX_VERCEL_ENDPOINTS as g, FX_VERCEL_CALL as h, RECOMMENDED_JUDGE_MODEL as i, judgeRoute as l, isApiError as m, DIRECT_PROVIDERS as n, isFakeJudge as o, unusedGatewayKey as p, RECOMMENDED_ANALYSIS_MODEL as r, judgeCredentials as s, DEFAULT_THRESHOLD as t, modelKeyOptions as u, VERCEL_KEY as v, vercelCredentialProblem as w, VERCEL_UNPROVEN_EFFORT as x, VERCEL_REFUSALS as y };
384
+
385
+ //# sourceMappingURL=judge-yLvjC5A3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judge-yLvjC5A3.js","names":["sleep"],"sources":["../src/gateway/vercel.ts","../src/judge/retry.ts","../src/judge/index.ts"],"mappings":";;;;AAYA,MAAa,cAAc;;AAG3B,MAAa,aAAa;;AAE1B,MAAa,cAAc;;AAa3B,MAAa,oBAAoB,MAAyB,QAAQ,QAChE,CAAC,IAAA,yBAAmB,IAAA,uBAAmB,cAAc;;AAGvD,SAAgB,UAAU,OAAiC;CACzD,MAAM,GAAG,WAAW,MAAM,MAAM,GAAG;CACnC,IAAI,CAAC,SAAS,OAAO,KAAA;CACrB,IAAI;EACF,MAAM,EAAE,QAAQ,KAAK,MAAM,OAAO,KAAK,SAAS,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC;EAG7E,OAAO,OAAO,QAAQ,2BAAW,IAAI,KAAK,MAAM,GAAI,IAAI,KAAA;CAC1D,QAAQ;EACN;CACF;AACF;;;;;AAMA,SAAgB,wBACd,MAAyB,QAAQ,KACjC,sBAAM,IAAI,KAAK,GACK;CACpB,IAAI,iBAAiB,GAAG,MAAA,qBAAmB,OAAO,KAAA;CAClD,MAAM,SAAS,UAAU,IAAA,wBAAoB,EAAE;CAC/C,IAAI,CAAC,UAAU,SAAS,KAAK,OAAO,KAAA;CACpC,OAAO,GAAG,YAAY,cAAc,OAAO,YAAY,EAAE,8EAA8E,WAAW;AACpJ;AAEA,MAAM,YAAY,MAAc,YAC7B;CAAE,MAAM;CAAa,MAAM,EAAE,OAAO,KAAK;CAAG,QAAQ,CAAC,MAAM;AAAE;;;;;AAMhE,MAAa,kBAAgD,EAC3D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GARP,SAAS,SAAS,YAAY,SAAS;GACvC;GACA;GACA;GACA,OAAO,eAAe,KAAK;GAC3B,GAAI,gBAAgB,EAAE,cAAc,IAAI,CAAC;GACzC,GAAI,WAAW,OAAO,UAAU,WAAW,EAAE,QAAQ,IAAI,CAAC;EAE7C;EAAG;CAAQ;AAC5B"}
package/dist/judge.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Bt as Verdict, D as ConfigJudgeOptions, J as FakeJudgeModel, K as FakeInsights, W as FakeAnalysisModel, Z as FakeVote, ct as JudgeArtifactRef, dt as JudgeModel, ft as JudgeOptions, lt as JudgeCallOptions, n as AnalysisConfig, o as BlindPair, pt as JudgeState, q as FakeInsightsInput, ut as JudgeFailure } from "./types-B-9b1MDV.js";
1
+ import { $ as FakeJudgeModel, $t as Verdict, J as FakeAnalysisModel, Q as FakeInsightsInput, Y as FakeAnswer, Z as FakeInsights, _t as JudgeCallOptions, bt as JudgeOptions, c as BlindAttempt, gt as JudgeArtifactRef, k as ConfigJudgeOptions, l as BlindPair, n as AnalysisConfig, nt as FakeVote, vt as JudgeFailure, xt as JudgeState, yt as JudgeModel } from "./types-DXBbP9Mk.js";
2
2
  //#region src/judge/index.d.ts
3
3
  /** The judge the docs recommend, pinned so a model update never silently moves scores. */
4
4
  export declare const RECOMMENDED_JUDGE_MODEL = "typesafe-ai/jev-1.14.0";
@@ -14,14 +14,15 @@ export declare const fakeJudge: ({ score }?: {
14
14
  }) => FakeJudgeModel;
15
15
  /**
16
16
  * An analysis model for tests: `reeval analyze` gets `output` (or `output(digest)`) back as the
17
- * model's structured answer, and each compare question's pair gets `vote` (a fixed `'A'`, `'B'` or
18
- * `'tie'`, `{ winner, reason? }`, a function of the blinded pair, or `{ error }`), through the same
19
- * parsing and validation as a real one. Insights (in `reeval run` and `reeval analyze --insights`)
17
+ * model's structured answer, each pairwise question's pair gets `vote` (a fixed `'A'`, `'B'` or
18
+ * `'tie'`, `{ winner, reason? }`, a function of the blinded pair, or `{ error }`), and each
19
+ * question asked of one attempt gets `answer` (its text, `{ choice?, text? }`, a function of the
20
+ * blinded attempt, or `{ error }`), through the same parsing and validation as a real one. Insights (in `reeval run` and `reeval analyze --insights`)
20
21
  * get `insights` (or `insights(input)`, called per eval for its classification and its sentences,
21
22
  * then once for the headline), through the same validator: an uncited sentence is dropped, and one
22
23
  * with a banned word is asked for again, then dropped.
23
24
  */
24
- export declare const fakeAnalysis: ({ output, vote, insights }: Pick<FakeAnalysisModel, 'output' | 'vote' | 'insights'>) => FakeAnalysisModel;
25
+ export declare const fakeAnalysis: ({ output, vote, answer, insights }: Pick<FakeAnalysisModel, 'output' | 'vote' | 'answer' | 'insights'>) => FakeAnalysisModel;
25
26
  //#endregion
26
- export type { AnalysisConfig, BlindPair, ConfigJudgeOptions, FakeAnalysisModel, FakeInsights, FakeInsightsInput, FakeJudgeModel, FakeVote, JudgeArtifactRef, JudgeCallOptions, JudgeFailure, JudgeModel, JudgeOptions, JudgeState, Verdict };
27
+ export type { AnalysisConfig, BlindAttempt, BlindPair, ConfigJudgeOptions, FakeAnalysisModel, FakeAnswer, FakeInsights, FakeInsightsInput, FakeJudgeModel, FakeVote, JudgeArtifactRef, JudgeCallOptions, JudgeFailure, JudgeModel, JudgeOptions, JudgeState, Verdict };
27
28
  //# sourceMappingURL=judge.d.ts.map
package/dist/judge.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as RECOMMENDED_JUDGE_MODEL, t as DEFAULT_THRESHOLD } from "./judge-CEDIfRiU.js";
1
+ import { i as RECOMMENDED_JUDGE_MODEL, t as DEFAULT_THRESHOLD } from "./judge-yLvjC5A3.js";
2
2
  //#region src/judge.ts
3
3
  /**
4
4
  * A judge that returns `score` without calling a model, for tests and dry runs. `score` can be a
@@ -10,17 +10,19 @@ const fakeJudge = ({ score = 1 } = {}) => ({
10
10
  });
11
11
  /**
12
12
  * An analysis model for tests: `reeval analyze` gets `output` (or `output(digest)`) back as the
13
- * model's structured answer, and each compare question's pair gets `vote` (a fixed `'A'`, `'B'` or
14
- * `'tie'`, `{ winner, reason? }`, a function of the blinded pair, or `{ error }`), through the same
15
- * parsing and validation as a real one. Insights (in `reeval run` and `reeval analyze --insights`)
13
+ * model's structured answer, each pairwise question's pair gets `vote` (a fixed `'A'`, `'B'` or
14
+ * `'tie'`, `{ winner, reason? }`, a function of the blinded pair, or `{ error }`), and each
15
+ * question asked of one attempt gets `answer` (its text, `{ choice?, text? }`, a function of the
16
+ * blinded attempt, or `{ error }`), through the same parsing and validation as a real one. Insights (in `reeval run` and `reeval analyze --insights`)
16
17
  * get `insights` (or `insights(input)`, called per eval for its classification and its sentences,
17
18
  * then once for the headline), through the same validator: an uncited sentence is dropped, and one
18
19
  * with a banned word is asked for again, then dropped.
19
20
  */
20
- const fakeAnalysis = ({ output, vote, insights }) => ({
21
+ const fakeAnalysis = ({ output, vote, answer, insights }) => ({
21
22
  kind: "fake-analysis",
22
23
  ...output !== void 0 ? { output } : {},
23
24
  ...vote !== void 0 ? { vote } : {},
25
+ ...answer !== void 0 ? { answer } : {},
24
26
  ...insights !== void 0 ? { insights } : {}
25
27
  });
26
28
  //#endregion
package/dist/judge.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"judge.js","names":[],"sources":["../src/judge.ts"],"mappings":";;;;;;AAQA,MAAa,aAAa,EACxB,QAAQ,MAGN,CAAC,OAAuB;CAC1B,MAAM;CACN;AACF;;;;;;;;;;AAWA,MAAa,gBAAgB,EAC3B,QACA,MACA,gBACiF;CACjF,MAAM;CACN,GAAI,WAAW,KAAA,IAAY,EAAE,OAAO,IAAI,CAAC;CACzC,GAAI,SAAS,KAAA,IAAY,EAAE,KAAK,IAAI,CAAC;CACrC,GAAI,aAAa,KAAA,IAAY,EAAE,SAAS,IAAI,CAAC;AAC/C"}
1
+ {"version":3,"file":"judge.js","names":[],"sources":["../src/judge.ts"],"mappings":";;;;;;AAQA,MAAa,aAAa,EACxB,QAAQ,MAGN,CAAC,OAAuB;CAC1B,MAAM;CACN;AACF;;;;;;;;;;;AAYA,MAAa,gBAAgB,EAC3B,QACA,MACA,QACA,gBAC4F;CAC5F,MAAM;CACN,GAAI,WAAW,KAAA,IAAY,EAAE,OAAO,IAAI,CAAC;CACzC,GAAI,SAAS,KAAA,IAAY,EAAE,KAAK,IAAI,CAAC;CACrC,GAAI,WAAW,KAAA,IAAY,EAAE,OAAO,IAAI,CAAC;CACzC,GAAI,aAAa,KAAA,IAAY,EAAE,SAAS,IAAI,CAAC;AAC/C"}
@@ -0,0 +1,204 @@
1
+ import { n as UsageError } from "./errors-B6BSMs03.js";
2
+ import { f as isUnanswerable } from "./runtime-BgQRyCLl.js";
3
+ import { i as assertionRecords } from "./evaluate-BUmsN7yG.js";
4
+ import { i as runMatcher, r as isMatcherName, t as MATCHERS } from "./matchers-D4eUqx4j.js";
5
+ //#region src/attempt/match.ts
6
+ const isPattern = (value) => "regexp" in value && typeof value.regexp === "string" && Object.keys(value).every((k) => k === "regexp" || k === "flags");
7
+ const isAnswered = (value) => Object.keys(value).length === 2 && "matchedBy" in value && typeof value.matchedBy === "string" && "answers" in value && typeof value.answers === "object" && value.answers !== null && !Array.isArray(value.answers);
8
+ /**
9
+ * A pattern the runner matches in its own language, as the `RegExp` a matcher takes: it answers
10
+ * each string from the call's `answers`, and notes the strings it has none for, which it fails.
11
+ */
12
+ var AnsweredPattern = class extends RegExp {
13
+ static get [Symbol.species]() {
14
+ return RegExp;
15
+ }
16
+ matchedBy;
17
+ answers;
18
+ untested;
19
+ constructor(matchedBy, answers, untested) {
20
+ super("(?:)");
21
+ this.matchedBy = matchedBy;
22
+ this.answers = answers;
23
+ this.untested = untested;
24
+ }
25
+ test(value) {
26
+ const text = String(value);
27
+ if (Object.hasOwn(this.answers, text)) return this.answers[text] === true;
28
+ const strings = this.untested.get(this.matchedBy) ?? /* @__PURE__ */ new Set();
29
+ this.untested.set(this.matchedBy, strings.add(text));
30
+ return false;
31
+ }
32
+ exec(value) {
33
+ const text = String(value);
34
+ return this.test(text) ? Object.assign([text], {
35
+ index: 0,
36
+ input: text
37
+ }) : null;
38
+ }
39
+ get source() {
40
+ return this.matchedBy;
41
+ }
42
+ toString() {
43
+ return this.matchedBy;
44
+ }
45
+ };
46
+ /**
47
+ * A wire argument as `expect` takes it: every `{ regexp, flags? }` in it a `RegExp`, and every
48
+ * `{ matchedBy, answers }` one that notes in `untested` the strings it can't answer.
49
+ */
50
+ function fromWire(value, untested = /* @__PURE__ */ new Map()) {
51
+ if (Array.isArray(value)) return value.map((v) => fromWire(v, untested));
52
+ if (typeof value !== "object" || value === null) return value;
53
+ if (isAnswered(value)) return new AnsweredPattern(value.matchedBy, value.answers, untested);
54
+ if (isPattern(value)) try {
55
+ return new RegExp(value.regexp, value.flags);
56
+ } catch (error) {
57
+ throw new UsageError(`${JSON.stringify(value)} isn't a regular expression: ${error.message}`);
58
+ }
59
+ return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, fromWire(v, untested)]));
60
+ }
61
+ function subjectOf(c, subject) {
62
+ if ("turn" in subject) {
63
+ const turn = c.turns[subject.turn];
64
+ if (!turn) throw new UsageError(`expect's subject is turn ${subject.turn}, but the attempt has ${c.turns.length} turn${c.turns.length === 1 ? "" : "s"}`);
65
+ return turn;
66
+ }
67
+ if ("attempt" in subject) return c;
68
+ if ("value" in subject) return subject.value;
69
+ if ("exec" in subject) return subject.result ?? c.exec(subject.exec);
70
+ return c.readFile(subject.readFile);
71
+ }
72
+ /** What the subject names itself by, as `c.exec`'s and `c.judge`'s results do in TypeScript. */
73
+ function subjectName(subject) {
74
+ if ("exec" in subject) return subject.exec;
75
+ if (!("value" in subject)) return void 0;
76
+ const value = subject.value;
77
+ return typeof value === "object" && value !== null && "verdict" in value ? value.question : void 0;
78
+ }
79
+ async function once(c, name, call, untested) {
80
+ const args = call.args.map((arg) => fromWire(arg, untested));
81
+ let async = false;
82
+ try {
83
+ const actual = await subjectOf(c, call.subject);
84
+ const running = runMatcher(name, actual, args, { not: call.not });
85
+ async = running instanceof Promise;
86
+ const result = await running;
87
+ if (untested.size > 0) return {
88
+ status: "pass",
89
+ async
90
+ };
91
+ if (result.pass !== call.not) return {
92
+ status: "pass",
93
+ async
94
+ };
95
+ const message = result.message();
96
+ const error = new Error(call.label ? `${call.label}: ${message}` : message);
97
+ error.name = "AssertionError";
98
+ return {
99
+ status: "fail",
100
+ error,
101
+ async
102
+ };
103
+ } catch (error) {
104
+ if (!isUnanswerable(error)) throw error;
105
+ return {
106
+ status: "error",
107
+ error,
108
+ async
109
+ };
110
+ }
111
+ }
112
+ const untestedReply = (untested) => ({ untested: Object.fromEntries([...untested].map(([pattern, strings]) => [pattern, [...strings]])) });
113
+ /**
114
+ * Runs one `expect` call on the attempt, as the matcher call it records. A polled call re-reads
115
+ * its subject and retries until the matcher passes or its timeout leaves no room for another
116
+ * try, then answers the last try. A try that tested a runner's pattern on a string it has no
117
+ * answer for ends the call with those strings, and records nothing.
118
+ */
119
+ async function match(c, call) {
120
+ const name = call.matcher;
121
+ if (!isMatcherName(name)) throw new UsageError(`${name} isn't one of reeval's matchers (${Object.keys(MATCHERS).join(", ")})`);
122
+ const startedAt = performance.now();
123
+ const untested = /* @__PURE__ */ new Map();
124
+ let outcome = await once(c, name, call, untested);
125
+ if (untested.size > 0) return untestedReply(untested);
126
+ if (call.poll) {
127
+ const { interval = 50, timeout = 1e3 } = call.poll;
128
+ const deadline = Date.now() + timeout;
129
+ while (outcome.status !== "pass" && Date.now() + interval < deadline) {
130
+ await new Promise((resolve) => setTimeout(resolve, interval));
131
+ outcome = await once(c, name, call, untested);
132
+ if (untested.size > 0) return untestedReply(untested);
133
+ }
134
+ }
135
+ const subject = subjectName(call.subject);
136
+ return {
137
+ matcher: [
138
+ call.poll && "poll",
139
+ call.not && "not",
140
+ name
141
+ ].filter(Boolean).join("."),
142
+ args: call.args.map((arg) => fromWire(arg)),
143
+ ...subject === void 0 ? {} : { subject },
144
+ ...call.label ? { label: call.label } : {},
145
+ soft: call.soft,
146
+ status: outcome.status,
147
+ ...outcome.status === "pass" ? {} : { error: outcome.error },
148
+ ...outcome.async || call.poll ? { durationMs: Math.round(performance.now() - startedAt) } : {}
149
+ };
150
+ }
151
+ /**
152
+ * Runs the call, adds it to the attempt's matcher calls and replies with its record, or with the
153
+ * strings a runner's pattern must answer first.
154
+ */
155
+ async function expectCall(c, calls, call) {
156
+ const slot = {
157
+ matcher: [
158
+ call.poll && "poll",
159
+ call.not && "not",
160
+ call.matcher
161
+ ].filter(Boolean).join("."),
162
+ args: call.args.map((arg) => fromWire(arg)),
163
+ subject: subjectName(call.subject),
164
+ ...call.label ? { label: call.label } : {},
165
+ soft: call.soft,
166
+ status: "pass"
167
+ };
168
+ calls.push(slot);
169
+ let result;
170
+ try {
171
+ result = await match(c, call);
172
+ } catch (error) {
173
+ calls.splice(calls.indexOf(slot), 1);
174
+ throw error;
175
+ }
176
+ if ("untested" in result) {
177
+ calls.splice(calls.indexOf(slot), 1);
178
+ return result;
179
+ }
180
+ Object.assign(slot, result);
181
+ return { assertion: assertionRecords(calls)[calls.indexOf(slot)] };
182
+ }
183
+ /**
184
+ * Adds a check the eval's own language made (`record`) to the attempt's matcher calls and replies
185
+ * with its record, named and numbered as a matcher call is.
186
+ */
187
+ function recordCall(calls, call) {
188
+ const failure = new Error(call.message ?? `${call.label ?? call.subject ?? call.matcher} failed`);
189
+ failure.name = "AssertionError";
190
+ calls.push({
191
+ matcher: call.matcher,
192
+ args: [],
193
+ ...call.subject === void 0 ? {} : { subject: call.subject },
194
+ ...call.label === void 0 ? {} : { label: call.label },
195
+ soft: call.soft ?? false,
196
+ status: call.status,
197
+ ...call.status === "pass" ? {} : { error: failure }
198
+ });
199
+ return assertionRecords(calls).at(-1);
200
+ }
201
+ //#endregion
202
+ export { recordCall as n, expectCall as t };
203
+
204
+ //# sourceMappingURL=match-Bz0nSdzN.js.map