@tangle-network/agent-eval 0.150.2 → 0.161.1

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 (342) hide show
  1. package/CHANGELOG.md +158 -1
  2. package/README.md +7 -3
  3. package/dist/{active-curriculum-C4mk67HP.js → active-curriculum-CD5TU2yW.js} +3 -13
  4. package/dist/active-curriculum-CD5TU2yW.js.map +1 -0
  5. package/dist/{agent-profile-cell-BkcRDikH.d.ts → agent-profile-cell-CTOZJUuE.d.ts} +4 -2
  6. package/dist/agent-profile-cell-CTOZJUuE.d.ts.map +1 -0
  7. package/dist/analyst/index.d.ts +19 -36
  8. package/dist/analyst/index.d.ts.map +1 -1
  9. package/dist/analyst/index.js +8 -8
  10. package/dist/analyst/index.js.map +1 -1
  11. package/dist/{backend-integrity-DOCa_QrR.d.ts → backend-integrity-DxuQCu_A.d.ts} +4 -3
  12. package/dist/backend-integrity-DxuQCu_A.d.ts.map +1 -0
  13. package/dist/{benchmark-BtAWA8nT.d.ts → benchmark-CGPp-kDC.d.ts} +3 -3
  14. package/dist/{benchmark-BtAWA8nT.d.ts.map → benchmark-CGPp-kDC.d.ts.map} +1 -1
  15. package/dist/{benchmark-command-BU1Las59.js → benchmark-command-BDC3Gocz.js} +26 -31
  16. package/dist/benchmark-command-BDC3Gocz.js.map +1 -0
  17. package/dist/benchmarks/index.d.ts +6 -19
  18. package/dist/benchmarks/index.d.ts.map +1 -1
  19. package/dist/benchmarks/index.js +4 -4
  20. package/dist/benchmarks/index.js.map +1 -1
  21. package/dist/builder-eval/index.d.ts +3 -3
  22. package/dist/builder-eval/index.js +2 -2
  23. package/dist/campaign/index.d.ts +9 -9
  24. package/dist/campaign/index.js +7 -7
  25. package/dist/{campaign-la-gEYNz.js → campaign-BSmOwskD.js} +77 -795
  26. package/dist/campaign-BSmOwskD.js.map +1 -0
  27. package/dist/{canonical-D-XsTQ6_.js → canonical-IL-Bu-14.js} +26 -2
  28. package/dist/canonical-IL-Bu-14.js.map +1 -0
  29. package/dist/{capture-fetch-BBVFzhkk.d.ts → capture-fetch-CqwsJkkG.d.ts} +3 -3
  30. package/dist/{capture-fetch-BBVFzhkk.d.ts.map → capture-fetch-CqwsJkkG.d.ts.map} +1 -1
  31. package/dist/{chat-client-Bvmxedyv.js → chat-client-DlMlAeYI.js} +5 -55
  32. package/dist/{chat-client-Bvmxedyv.js.map → chat-client-DlMlAeYI.js.map} +1 -1
  33. package/dist/chat-json-call-6g5sJobJ.js +53 -0
  34. package/dist/chat-json-call-6g5sJobJ.js.map +1 -0
  35. package/dist/cli.js +54 -19
  36. package/dist/cli.js.map +1 -1
  37. package/dist/{client-LIuo-KPv.js → client-CX7KqIdB.js} +3 -3
  38. package/dist/client-CX7KqIdB.js.map +1 -0
  39. package/dist/{client-kPQYT_56.d.ts → client-L9VVPkim.d.ts} +4 -4
  40. package/dist/{client-kPQYT_56.d.ts.map → client-L9VVPkim.d.ts.map} +1 -1
  41. package/dist/contract/index.d.ts +13 -27
  42. package/dist/contract/index.d.ts.map +1 -1
  43. package/dist/contract/index.js +14 -17
  44. package/dist/contract/index.js.map +1 -1
  45. package/dist/{counterfactual--bpysZF0.d.ts → counterfactual-BaFUWK3H.d.ts} +4 -4
  46. package/dist/{counterfactual--bpysZF0.d.ts.map → counterfactual-BaFUWK3H.d.ts.map} +1 -1
  47. package/dist/{counterfactual-lDfCx0Uz.js → counterfactual-D_VWavVm.js} +2 -2
  48. package/dist/{counterfactual-lDfCx0Uz.js.map → counterfactual-D_VWavVm.js.map} +1 -1
  49. package/dist/{dataset-CJjKqQfA.d.ts → dataset-DQqhOCPt.d.ts} +5 -4
  50. package/dist/{dataset-CJjKqQfA.d.ts.map → dataset-DQqhOCPt.d.ts.map} +1 -1
  51. package/dist/{default-registry-Cw0Ohdoj.d.ts → default-registry-G9CKMNkc.d.ts} +7 -8
  52. package/dist/{default-registry-Cw0Ohdoj.d.ts.map → default-registry-G9CKMNkc.d.ts.map} +1 -1
  53. package/dist/{define-agent-eval-CEQWL9Hy.d.ts → define-agent-eval-Dx1JnPEa.d.ts} +26 -6
  54. package/dist/define-agent-eval-Dx1JnPEa.d.ts.map +1 -0
  55. package/dist/{define-agent-eval-C8V8sMqP.js → define-agent-eval-h-s-sI-v.js} +15 -9
  56. package/dist/define-agent-eval-h-s-sI-v.js.map +1 -0
  57. package/dist/{dspy-rlm-engine-CBYlPvNy.js → dspy-rlm-engine-DptEII26.js} +95 -15
  58. package/dist/dspy-rlm-engine-DptEII26.js.map +1 -0
  59. package/dist/{emitter-CPBAhxum.js → emitter-BpYFQPj4.js} +2 -18
  60. package/dist/emitter-BpYFQPj4.js.map +1 -0
  61. package/dist/{emitter-DGQGoLyj.d.ts → emitter-D_jYSGRd.d.ts} +4 -20
  62. package/dist/{emitter-DGQGoLyj.d.ts.map → emitter-D_jYSGRd.d.ts.map} +1 -1
  63. package/dist/{engine-BLzhNzoY.d.ts → engine-Cu5qD5Fc.d.ts} +9 -11
  64. package/dist/{engine-BLzhNzoY.d.ts.map → engine-Cu5qD5Fc.d.ts.map} +1 -1
  65. package/dist/{eval-campaign-CQuZrLR_.js → eval-campaign-BsXWL2-2.js} +17 -28
  66. package/dist/eval-campaign-BsXWL2-2.js.map +1 -0
  67. package/dist/{exact-types-ccQAyut1.d.ts → exact-types-qnexxJ1Z.d.ts} +2 -2
  68. package/dist/{exact-types-ccQAyut1.d.ts.map → exact-types-qnexxJ1Z.d.ts.map} +1 -1
  69. package/dist/{exec-y-DCLqK7.js → exec-D9WpA2p-.js} +2 -2
  70. package/dist/exec-D9WpA2p-.js.map +1 -0
  71. package/dist/experiment/index.d.ts +45 -11
  72. package/dist/experiment/index.d.ts.map +1 -1
  73. package/dist/experiment/index.js +30 -11
  74. package/dist/experiment/index.js.map +1 -1
  75. package/dist/{experiment-tracker-0MhuPArU.d.ts → experiment-tracker-DCO6Cz4s.d.ts} +2 -2
  76. package/dist/{experiment-tracker-0MhuPArU.d.ts.map → experiment-tracker-DCO6Cz4s.d.ts.map} +1 -1
  77. package/dist/{exporters-q9iL-2Jf.js → exporters-Df7TgHFv.js} +3 -3
  78. package/dist/exporters-Df7TgHFv.js.map +1 -0
  79. package/dist/{external-optimizer-contracts-DbLsm4Po.d.ts → external-optimizer-contracts-szBJ_1vh.d.ts} +2 -2
  80. package/dist/{external-optimizer-contracts-DbLsm4Po.d.ts.map → external-optimizer-contracts-szBJ_1vh.d.ts.map} +1 -1
  81. package/dist/{external-optimizer-process-x9oEXKsU.js → external-optimizer-process-WosTBChy.js} +4 -4
  82. package/dist/{external-optimizer-process-x9oEXKsU.js.map → external-optimizer-process-WosTBChy.js.map} +1 -1
  83. package/dist/{external-optimizer-subprocess-CKNb42oM.js → external-optimizer-subprocess-BIWbHpgD.js} +4 -4
  84. package/dist/{external-optimizer-subprocess-CKNb42oM.js.map → external-optimizer-subprocess-BIWbHpgD.js.map} +1 -1
  85. package/dist/{failure-cluster-BLURuWG4.d.ts → failure-cluster-CXL8NbEw.d.ts} +3 -3
  86. package/dist/{failure-cluster-BLURuWG4.d.ts.map → failure-cluster-CXL8NbEw.d.ts.map} +1 -1
  87. package/dist/{feedback-trajectory-DpTTjo0q.d.ts → feedback-trajectory-B3ZHaHV_.d.ts} +7 -7
  88. package/dist/{feedback-trajectory-DpTTjo0q.d.ts.map → feedback-trajectory-B3ZHaHV_.d.ts.map} +1 -1
  89. package/dist/fuzz.js +1 -1
  90. package/dist/{hf-dataset-XggBupCr.js → hf-dataset-D8_RNIis.js} +4 -4
  91. package/dist/{hf-dataset-XggBupCr.js.map → hf-dataset-D8_RNIis.js.map} +1 -1
  92. package/dist/hosted/index.d.ts +3 -14
  93. package/dist/hosted/index.d.ts.map +1 -1
  94. package/dist/hosted/index.js +2 -2
  95. package/dist/{index-Aj3WO3_a.d.ts → index-CGtH1piv.d.ts} +48 -26
  96. package/dist/index-CGtH1piv.d.ts.map +1 -0
  97. package/dist/{index-BNPtkBPf.d.ts → index-D-IiQIBB.d.ts} +5 -10
  98. package/dist/index-D-IiQIBB.d.ts.map +1 -0
  99. package/dist/{index-IQccV3Ou.d.ts → index-D-V8gCs_.d.ts} +13 -90
  100. package/dist/index-D-V8gCs_.d.ts.map +1 -0
  101. package/dist/{index-B8Ui1mr1.d.ts → index-lfaSeKSD.d.ts} +18 -2
  102. package/dist/index-lfaSeKSD.d.ts.map +1 -0
  103. package/dist/index-vrJugRal.d.ts +1 -0
  104. package/dist/index.d.ts +68 -56
  105. package/dist/index.d.ts.map +1 -1
  106. package/dist/index.js +59 -110
  107. package/dist/index.js.map +1 -1
  108. package/dist/{insight-report-BeT8KCgI.d.ts → insight-report-DRe8LB6d.d.ts} +4 -4
  109. package/dist/{insight-report-BeT8KCgI.d.ts.map → insight-report-DRe8LB6d.d.ts.map} +1 -1
  110. package/dist/{integrity-DL91tucI.js → integrity-CyWSSoQS.js} +2 -2
  111. package/dist/{integrity-DL91tucI.js.map → integrity-CyWSSoQS.js.map} +1 -1
  112. package/dist/{integrity-B0dZ96EO.d.ts → integrity-DUNX9Fao.d.ts} +3 -3
  113. package/dist/{integrity-B0dZ96EO.d.ts.map → integrity-DUNX9Fao.d.ts.map} +1 -1
  114. package/dist/{kind-factory-DmAa0h3K.js → kind-factory-DY8FdoXf.js} +3 -71
  115. package/dist/kind-factory-DY8FdoXf.js.map +1 -0
  116. package/dist/ledger-core/index.d.ts +2 -2
  117. package/dist/ledger-core/index.js +3 -3
  118. package/dist/{ledger-core-DTae9rv_.js → ledger-core-BOzlRygb.js} +2 -2
  119. package/dist/{ledger-core-DTae9rv_.js.map → ledger-core-BOzlRygb.js.map} +1 -1
  120. package/dist/{llm-client-Bg32RW0j.js → llm-client-hgDieDNN.js} +53 -98
  121. package/dist/llm-client-hgDieDNN.js.map +1 -0
  122. package/dist/{llm-judge-BqqMS8t7.js → llm-judge-BhasIPFT.js} +1135 -77
  123. package/dist/llm-judge-BhasIPFT.js.map +1 -0
  124. package/dist/{matrix-DrVnRp4G.d.ts → matrix-eXKRMHnL.d.ts} +74 -72
  125. package/dist/matrix-eXKRMHnL.d.ts.map +1 -0
  126. package/dist/meta-eval/index.d.ts +8 -6
  127. package/dist/meta-eval/index.d.ts.map +1 -1
  128. package/dist/meta-eval/index.js +8 -6
  129. package/dist/meta-eval/index.js.map +1 -1
  130. package/dist/{mint-BV6tLVWl.js → mint-DfODW1KW.js} +3 -3
  131. package/dist/{mint-BV6tLVWl.js.map → mint-DfODW1KW.js.map} +1 -1
  132. package/dist/multishot/golden/index.d.ts +2 -8
  133. package/dist/multishot/golden/index.d.ts.map +1 -1
  134. package/dist/multishot/golden/index.js +56 -86
  135. package/dist/multishot/golden/index.js.map +1 -1
  136. package/dist/multishot/index.d.ts +11 -46
  137. package/dist/multishot/index.d.ts.map +1 -1
  138. package/dist/multishot/index.js +30 -83
  139. package/dist/multishot/index.js.map +1 -1
  140. package/dist/openapi.json +1 -1
  141. package/dist/{opencode-sqlite-DJWAXLms.js → opencode-sqlite-eK6HW6dr.js} +2 -6
  142. package/dist/{opencode-sqlite-DJWAXLms.js.map → opencode-sqlite-eK6HW6dr.js.map} +1 -1
  143. package/dist/pipelines/index.d.ts +5 -5
  144. package/dist/pipelines/index.js +3 -3
  145. package/dist/{pre-registration-zFSLEiFU.d.ts → pre-registration-CzFCcwYk.d.ts} +55 -40
  146. package/dist/pre-registration-CzFCcwYk.d.ts.map +1 -0
  147. package/dist/pre-registration-KN9jkh58.js +110 -0
  148. package/dist/pre-registration-KN9jkh58.js.map +1 -0
  149. package/dist/{produced-state-Bnq4FaDO.js → produced-state-DZ89riy5.js} +8 -8
  150. package/dist/produced-state-DZ89riy5.js.map +1 -0
  151. package/dist/profile-cell.d.ts +1 -1
  152. package/dist/profile-cell.js +31 -5
  153. package/dist/profile-cell.js.map +1 -1
  154. package/dist/{promotion-policy-DLOUkYhI.d.ts → promotion-policy-DtnOIZvk.d.ts} +2 -2
  155. package/dist/{promotion-policy-DLOUkYhI.d.ts.map → promotion-policy-DtnOIZvk.d.ts.map} +1 -1
  156. package/dist/{query-Di7eEQ79.js → query-CHmMP42p.js} +20 -11
  157. package/dist/query-CHmMP42p.js.map +1 -0
  158. package/dist/{query-CJ_DX8vl.d.ts → query-DxPYqpmT.d.ts} +10 -4
  159. package/dist/query-DxPYqpmT.d.ts.map +1 -0
  160. package/dist/raw-provider-sink-BU29Sh8h.d.ts +134 -0
  161. package/dist/raw-provider-sink-BU29Sh8h.d.ts.map +1 -0
  162. package/dist/{registry-BQwrSYpC.d.ts → registry-8You7OK1.d.ts} +5 -7
  163. package/dist/{registry-BQwrSYpC.d.ts.map → registry-8You7OK1.d.ts.map} +1 -1
  164. package/dist/{release-confidence-BknrpBnO.js → release-confidence-DKfD2RYU.js} +28 -14
  165. package/dist/release-confidence-DKfD2RYU.js.map +1 -0
  166. package/dist/{release-confidence-4XrqlpFD.d.ts → release-confidence-Dqt0NFep.d.ts} +7 -6
  167. package/dist/release-confidence-Dqt0NFep.d.ts.map +1 -0
  168. package/dist/reporting.d.ts +3 -3
  169. package/dist/reporting.js +3 -3
  170. package/dist/{researcher-DJnoUE8c.d.ts → researcher-Cz565b7D.d.ts} +34 -21
  171. package/dist/researcher-Cz565b7D.d.ts.map +1 -0
  172. package/dist/{reward-hacking-62tojkQd.d.ts → reward-hacking-MBf7qpSB.d.ts} +2 -2
  173. package/dist/{reward-hacking-62tojkQd.d.ts.map → reward-hacking-MBf7qpSB.d.ts.map} +1 -1
  174. package/dist/{reward-hacking-C0x0xihA.js → reward-hacking-t4lB1yt8.js} +2 -2
  175. package/dist/{reward-hacking-C0x0xihA.js.map → reward-hacking-t4lB1yt8.js.map} +1 -1
  176. package/dist/rl.d.ts +11 -42
  177. package/dist/rl.d.ts.map +1 -1
  178. package/dist/rl.js +41 -24
  179. package/dist/rl.js.map +1 -1
  180. package/dist/rollout/index.d.ts +3 -3
  181. package/dist/rollout/index.js +7 -7
  182. package/dist/{rollout-ytVQ7WT8.js → rollout-Dm2tSdiQ.js} +6 -6
  183. package/dist/{rollout-ytVQ7WT8.js.map → rollout-Dm2tSdiQ.js.map} +1 -1
  184. package/dist/{rubric-predictive-validity-CzxLoZge.js → rubric-predictive-validity-CK8SCOg-.js} +5 -15
  185. package/dist/rubric-predictive-validity-CK8SCOg-.js.map +1 -0
  186. package/dist/{rubric-predictive-validity-C7LnNvF2.d.ts → rubric-predictive-validity-CxycqzX5.d.ts} +4 -3
  187. package/dist/rubric-predictive-validity-CxycqzX5.d.ts.map +1 -0
  188. package/dist/{run-record-D2lDdSAz.js → run-record-BC0ebuRP.js} +2 -2
  189. package/dist/{run-record-D2lDdSAz.js.map → run-record-BC0ebuRP.js.map} +1 -1
  190. package/dist/{run-record-DVV82Gwh.d.ts → run-record-VVy4T9OW.d.ts} +3 -3
  191. package/dist/{run-record-DVV82Gwh.d.ts.map → run-record-VVy4T9OW.d.ts.map} +1 -1
  192. package/dist/{schema-BtVldJ3T.d.ts → schema-Bjgdsn73.d.ts} +2 -4
  193. package/dist/{schema-BtVldJ3T.d.ts.map → schema-Bjgdsn73.d.ts.map} +1 -1
  194. package/dist/{schema-Cef2cFmb.d.ts → schema-BzWDXhOR.d.ts} +2 -5
  195. package/dist/schema-BzWDXhOR.d.ts.map +1 -0
  196. package/dist/{schema-C6DW4ZHR.js → schema-C1aaAxTf.js} +2 -2
  197. package/dist/schema-C1aaAxTf.js.map +1 -0
  198. package/dist/{schema-CRhEY1SO.js → schema-k6ZBftVv.js} +2 -8
  199. package/dist/{schema-CRhEY1SO.js.map → schema-k6ZBftVv.js.map} +1 -1
  200. package/dist/{semantic-concept-judge-laMCnTLn.js → semantic-concept-judge-BSkKKHeq.js} +14 -38
  201. package/dist/semantic-concept-judge-BSkKKHeq.js.map +1 -0
  202. package/dist/{sequential-eprocess-CbUt2htw.js → sequential-eprocess-D1jKoihe.js} +49 -2
  203. package/dist/sequential-eprocess-D1jKoihe.js.map +1 -0
  204. package/dist/{sequential-C458DXNf.js → sequential-rYW-Ophm.js} +41 -16
  205. package/dist/sequential-rYW-Ophm.js.map +1 -0
  206. package/dist/{series-convergence-BxKEgBwA.d.ts → series-convergence-D9WgpXGi.d.ts} +2 -2
  207. package/dist/{series-convergence-BxKEgBwA.d.ts.map → series-convergence-D9WgpXGi.d.ts.map} +1 -1
  208. package/dist/{server-dIWwF3j_.js → server-BtFd4uzB.js} +19 -42
  209. package/dist/server-BtFd4uzB.js.map +1 -0
  210. package/dist/{skillopt-optimization-method-CPBlTcj5.js → skillopt-optimization-method-DbaekMcn.js} +794 -8
  211. package/dist/skillopt-optimization-method-DbaekMcn.js.map +1 -0
  212. package/dist/{skillopt-optimization-method-BDD_o1xE.d.ts → skillopt-optimization-method-x7TTF23P.d.ts} +20 -7
  213. package/dist/{skillopt-optimization-method-BDD_o1xE.d.ts.map → skillopt-optimization-method-x7TTF23P.d.ts.map} +1 -1
  214. package/dist/{statistical-heldout-_woZ9q9j.d.ts → statistical-heldout-Cy3EhjlC.d.ts} +21 -8
  215. package/dist/statistical-heldout-Cy3EhjlC.d.ts.map +1 -0
  216. package/dist/{steps-AmkT-GIM.d.ts → steps-CiNVJry_.d.ts} +2 -17
  217. package/dist/steps-CiNVJry_.d.ts.map +1 -0
  218. package/dist/{store-CT9YIIve.d.ts → store-B06JdC56.d.ts} +2 -2
  219. package/dist/{store-CT9YIIve.d.ts.map → store-B06JdC56.d.ts.map} +1 -1
  220. package/dist/{store-otlp-CDYWW_8N.js → store-otlp-C_Rq5I4D.js} +2 -2
  221. package/dist/{store-otlp-CDYWW_8N.js.map → store-otlp-C_Rq5I4D.js.map} +1 -1
  222. package/dist/{store-tool-spans-Br2_IUhm.d.ts → store-tool-spans-DPUG7UUY.d.ts} +6 -6
  223. package/dist/{store-tool-spans-Br2_IUhm.d.ts.map → store-tool-spans-DPUG7UUY.d.ts.map} +1 -1
  224. package/dist/{store-tool-spans-CykkbOlv.js → store-tool-spans-Dlh9vkFK.js} +3 -3
  225. package/dist/{store-tool-spans-CykkbOlv.js.map → store-tool-spans-Dlh9vkFK.js.map} +1 -1
  226. package/dist/storyboard/index.d.ts +1 -1
  227. package/dist/{summary-report-DW2bEpdB.js → summary-report-BI5hUtvK.js} +6 -16
  228. package/dist/summary-report-BI5hUtvK.js.map +1 -0
  229. package/dist/{summary-report-B__Y5ub3.d.ts → summary-report-CC07PhEL.d.ts} +6 -5
  230. package/dist/summary-report-CC07PhEL.d.ts.map +1 -0
  231. package/dist/supervisor-run/index.d.ts +3 -16
  232. package/dist/supervisor-run/index.d.ts.map +1 -1
  233. package/dist/supervisor-run/index.js +3 -3
  234. package/dist/supervisor-run/index.js.map +1 -1
  235. package/dist/{task-failure-attributes--ZTP3tYO.js → task-failure-attributes-DTl-7-Kw.js} +3 -3
  236. package/dist/{task-failure-attributes--ZTP3tYO.js.map → task-failure-attributes-DTl-7-Kw.js.map} +1 -1
  237. package/dist/{tool-groups-B4tqh8jB.d.ts → tool-groups-Ci8i9ErB.d.ts} +3 -3
  238. package/dist/tool-groups-Ci8i9ErB.d.ts.map +1 -0
  239. package/dist/{tool-waste-C-VHSRwF.js → tool-waste-BqzmVdJk.js} +2 -2
  240. package/dist/{tool-waste-C-VHSRwF.js.map → tool-waste-BqzmVdJk.js.map} +1 -1
  241. package/dist/{tool-waste-DjRDEsuI.d.ts → tool-waste-Dro0gJi3.d.ts} +4 -4
  242. package/dist/{tool-waste-DjRDEsuI.d.ts.map → tool-waste-Dro0gJi3.d.ts.map} +1 -1
  243. package/dist/trace-repair/index.d.ts +4 -77
  244. package/dist/trace-repair/index.d.ts.map +1 -1
  245. package/dist/trace-repair/index.js +5 -15
  246. package/dist/trace-repair/index.js.map +1 -1
  247. package/dist/traces.d.ts +13 -23
  248. package/dist/traces.d.ts.map +1 -1
  249. package/dist/traces.js +9 -20
  250. package/dist/traces.js.map +1 -1
  251. package/dist/{trajectory-YC15QDYQ.d.ts → trajectory-Bi157Gun.d.ts} +3 -3
  252. package/dist/{trajectory-YC15QDYQ.d.ts.map → trajectory-Bi157Gun.d.ts.map} +1 -1
  253. package/dist/trajectory-replay/index.d.ts +5 -5
  254. package/dist/trajectory-replay/index.js +5 -5
  255. package/dist/{provenance-oA4-zUqm.d.ts → transient-failure-DKF5Mofa.d.ts} +468 -13
  256. package/dist/transient-failure-DKF5Mofa.d.ts.map +1 -0
  257. package/dist/types-B3jzCp0p.js.map +1 -1
  258. package/dist/{types-CLAwnY-L.d.ts → types-BPb2Kf_C2.d.ts} +3 -3
  259. package/dist/types-BPb2Kf_C2.d.ts.map +1 -0
  260. package/dist/types-Bfk0uxRj.d.ts +443 -0
  261. package/dist/types-Bfk0uxRj.d.ts.map +1 -0
  262. package/dist/{types-DdFNuyxQ.d.ts → types-D4s7Z6nq.d.ts} +30 -6
  263. package/dist/types-D4s7Z6nq.d.ts.map +1 -0
  264. package/dist/{types-B2NsbrNy.d.ts → types-D9ssmxKL.d.ts} +3 -3
  265. package/dist/{types-B2NsbrNy.d.ts.map → types-D9ssmxKL.d.ts.map} +1 -1
  266. package/dist/{types-I5WwVzQ7.d.ts → types-DeIUdzNd.d.ts} +2 -2
  267. package/dist/{types-I5WwVzQ7.d.ts.map → types-DeIUdzNd.d.ts.map} +1 -1
  268. package/dist/{verdict-BndeTAh_.js → verdict-B0xltqu6.js} +2 -2
  269. package/dist/{verdict-BndeTAh_.js.map → verdict-B0xltqu6.js.map} +1 -1
  270. package/dist/verdict-cache-CdVVTVmn.js +88 -0
  271. package/dist/verdict-cache-CdVVTVmn.js.map +1 -0
  272. package/dist/wire/index.d.ts +21 -111
  273. package/dist/wire/index.d.ts.map +1 -1
  274. package/dist/wire/index.js +2 -2
  275. package/docs/building-doctrine.md +3 -3
  276. package/docs/campaign-proposers.md +41 -10
  277. package/docs/design/statistics-decisions.md +89 -1
  278. package/docs/eval-surface-map.md +14 -0
  279. package/docs/experiment.md +19 -2
  280. package/docs/feedback-trajectories.md +1 -1
  281. package/docs/multishot-golden-records.md +4 -4
  282. package/docs/public-api.md +1616 -0
  283. package/docs/research-report-methodology.md +1 -1
  284. package/docs/search-history-receipts.md +39 -1
  285. package/docs/trace-analysis.md +1 -1
  286. package/docs/trace-repair-admission.md +1 -1
  287. package/docs/trace-repair-continuation.md +1 -1
  288. package/docs/verdicts.md +24 -0
  289. package/package.json +7 -3
  290. package/dist/active-curriculum-C4mk67HP.js.map +0 -1
  291. package/dist/agent-profile-cell-BkcRDikH.d.ts.map +0 -1
  292. package/dist/backend-integrity-DOCa_QrR.d.ts.map +0 -1
  293. package/dist/benchmark-command-BU1Las59.js.map +0 -1
  294. package/dist/campaign-la-gEYNz.js.map +0 -1
  295. package/dist/canonical-D-XsTQ6_.js.map +0 -1
  296. package/dist/client-LIuo-KPv.js.map +0 -1
  297. package/dist/define-agent-eval-C8V8sMqP.js.map +0 -1
  298. package/dist/define-agent-eval-CEQWL9Hy.d.ts.map +0 -1
  299. package/dist/dspy-rlm-engine-CBYlPvNy.js.map +0 -1
  300. package/dist/emitter-CPBAhxum.js.map +0 -1
  301. package/dist/eval-campaign-CQuZrLR_.js.map +0 -1
  302. package/dist/exec-y-DCLqK7.js.map +0 -1
  303. package/dist/exporters-q9iL-2Jf.js.map +0 -1
  304. package/dist/index-Aj3WO3_a.d.ts.map +0 -1
  305. package/dist/index-B8Ui1mr1.d.ts.map +0 -1
  306. package/dist/index-BNPtkBPf.d.ts.map +0 -1
  307. package/dist/index-C1ravkGA.d.ts +0 -1
  308. package/dist/index-IQccV3Ou.d.ts.map +0 -1
  309. package/dist/kind-factory-DmAa0h3K.js.map +0 -1
  310. package/dist/llm-client-Bg32RW0j.js.map +0 -1
  311. package/dist/llm-judge-BqqMS8t7.js.map +0 -1
  312. package/dist/matrix-DrVnRp4G.d.ts.map +0 -1
  313. package/dist/pre-registration-DakwTRXk.js +0 -96
  314. package/dist/pre-registration-DakwTRXk.js.map +0 -1
  315. package/dist/pre-registration-zFSLEiFU.d.ts.map +0 -1
  316. package/dist/produced-state-Bnq4FaDO.js.map +0 -1
  317. package/dist/provenance-oA4-zUqm.d.ts.map +0 -1
  318. package/dist/query-CJ_DX8vl.d.ts.map +0 -1
  319. package/dist/query-Di7eEQ79.js.map +0 -1
  320. package/dist/release-confidence-4XrqlpFD.d.ts.map +0 -1
  321. package/dist/release-confidence-BknrpBnO.js.map +0 -1
  322. package/dist/researcher-DJnoUE8c.d.ts.map +0 -1
  323. package/dist/rubric-predictive-validity-C7LnNvF2.d.ts.map +0 -1
  324. package/dist/rubric-predictive-validity-CzxLoZge.js.map +0 -1
  325. package/dist/schema-C6DW4ZHR.js.map +0 -1
  326. package/dist/schema-Cef2cFmb.d.ts.map +0 -1
  327. package/dist/semantic-concept-judge-laMCnTLn.js.map +0 -1
  328. package/dist/sequential-C458DXNf.js.map +0 -1
  329. package/dist/sequential-eprocess-CbUt2htw.js.map +0 -1
  330. package/dist/server-dIWwF3j_.js.map +0 -1
  331. package/dist/skillopt-optimization-method-CPBlTcj5.js.map +0 -1
  332. package/dist/statistical-heldout-_woZ9q9j.d.ts.map +0 -1
  333. package/dist/steps-AmkT-GIM.d.ts.map +0 -1
  334. package/dist/summary-report-B__Y5ub3.d.ts.map +0 -1
  335. package/dist/summary-report-DW2bEpdB.js.map +0 -1
  336. package/dist/tool-groups-B4tqh8jB.d.ts.map +0 -1
  337. package/dist/types-CLAwnY-L.d.ts.map +0 -1
  338. package/dist/types-DdFNuyxQ.d.ts.map +0 -1
  339. package/dist/types-jUBXJ7Iz.d.ts +0 -884
  340. package/dist/types-jUBXJ7Iz.d.ts.map +0 -1
  341. package/dist/verdict-cache-mZf5FEiY.js +0 -107
  342. package/dist/verdict-cache-mZf5FEiY.js.map +0 -1
@@ -1,884 +0,0 @@
1
- import { t as AgentEvalError } from "./errors-DEE6u6ot.js";
2
- import { b as CustomTokenPricing, c as CostLedgerHandle, g as CostReceiptInput, x as MaximumCharge } from "./cost-ledger-DbQdN3nO.js";
3
- //#region src/trace/raw-provider-sink.d.ts
4
- /**
5
- * RawProviderSink — first-class persistence for the actual HTTP-level
6
- * request/response bodies of every LLM provider call.
7
- *
8
- * Why this is a separate sink from the structured `LlmSpan`:
9
- *
10
- * - `LlmSpan` records the *intent* — model name, messages, output text,
11
- * usage. It's what dashboards read; it's NOT enough for forensics.
12
- * - When a downstream consumer reports "the verifier used the wrong route"
13
- * or "tokens look right but reasoning was missing," the only way to
14
- * answer is the raw HTTP body. Span fields can lie (a proxy can echo
15
- * a different `model` value than what actually answered); the raw
16
- * response is ground truth.
17
- *
18
- * Default behaviour: opt-in. Pass `rawSink` to `LlmClientOptions` (or the
19
- * matrix runner / BuilderSession sets it up automatically) and every
20
- * request, response, and error is recorded — including retries, with the
21
- * attempt index attached so a flaky call's full event chain is recoverable.
22
- *
23
- * Redaction is enforced at sink time. The default redactor strips
24
- * `Authorization`, `X-Api-Key`, `X-Auth-Token`, `Cookie` headers and any
25
- * payload field whose key matches `apiKey | api_key | bearer | password |
26
- * secret | token` (case-insensitive). Override via the sink constructor or
27
- * the per-call `redactor`. The `redactedFields` array on the persisted
28
- * event lets a reviewer see what was stripped without exposing the values.
29
- */
30
- type RawProviderDirection = 'request' | 'response' | 'error';
31
- interface RawProviderEvent {
32
- /** Stable id. Generated by the sink if omitted. */
33
- eventId: string;
34
- /** Trace context populated by `LlmClient` when the call is wrapped in a span. */
35
- runId?: string;
36
- spanId?: string;
37
- /**
38
- * Logical provider name. Free-form so callers can use whatever id matches
39
- * their topology (`'openai'`, `'anthropic'`, `'tangle-router'`, …). When
40
- * omitted, derived from `baseUrl` in `LlmClientOptions`.
41
- */
42
- provider: string;
43
- model: string;
44
- /** Endpoint path, e.g. `'/v1/chat/completions'`. */
45
- endpoint: string;
46
- /** Base URL used for the call (already-normalised — no trailing slash). */
47
- baseUrl: string;
48
- /** 0-indexed retry attempt. The first attempt is 0; a retried call gets 1, 2, … */
49
- attemptIndex: number;
50
- direction: RawProviderDirection;
51
- /** Unix ms. */
52
- timestamp: number;
53
- /** Wall-clock duration of the call leg. Set on `response` and `error` events; null on `request`. */
54
- durationMs?: number;
55
- statusCode?: number;
56
- requestHeaders?: Record<string, string>;
57
- requestBody?: unknown;
58
- responseHeaders?: Record<string, string>;
59
- responseBody?: unknown;
60
- /** Set on `direction: 'error'` events. */
61
- errorMessage?: string;
62
- /** Field paths the redactor stripped from this event ('header:Authorization', 'body.apiKey', …). */
63
- redactedFields: string[];
64
- }
65
- interface RawProviderSinkFilter {
66
- runId?: string;
67
- spanId?: string;
68
- direction?: RawProviderDirection;
69
- attemptIndex?: number;
70
- }
71
- interface RawProviderSink {
72
- record(event: RawProviderEvent): Promise<void>;
73
- /** Optional listing — implementations that durably persist (file, db) should support this. */
74
- list?(filter?: RawProviderSinkFilter): Promise<RawProviderEvent[]>;
75
- /** Optional teardown for backed implementations. */
76
- close?(): Promise<void>;
77
- }
78
- type ProviderRedactor = (event: RawProviderEvent) => RawProviderEvent;
79
- /**
80
- * Default redactor — strips well-known auth headers and any body field whose
81
- * key matches the credential pattern. Records every redacted path on
82
- * `event.redactedFields` so a downstream reviewer can see what was removed.
83
- */
84
- declare function defaultProviderRedactor(event: RawProviderEvent): RawProviderEvent;
85
- interface InMemoryRawProviderSinkOptions {
86
- redactor?: ProviderRedactor;
87
- }
88
- declare class InMemoryRawProviderSink implements RawProviderSink {
89
- private events;
90
- private redactor;
91
- constructor(opts?: InMemoryRawProviderSinkOptions);
92
- record(event: RawProviderEvent): Promise<void>;
93
- list(filter?: RawProviderSinkFilter): Promise<RawProviderEvent[]>;
94
- size(): number;
95
- }
96
- declare class NoopRawProviderSink implements RawProviderSink {
97
- record(): Promise<void>;
98
- /**
99
- * Returns an empty array. Implemented so `assertRunCaptured` does not
100
- * trip the `no_raw_sink` issue when a caller explicitly opts out of
101
- * capture by passing this sink — opt-out is a deliberate choice, not a
102
- * misconfiguration.
103
- */
104
- list(): Promise<RawProviderEvent[]>;
105
- }
106
- interface FileSystemRawProviderSinkOptions {
107
- /** Directory the NDJSON file is written into. Created if missing. */
108
- dir: string;
109
- /** File name; default `'raw-provider-events.ndjson'`. */
110
- fileName?: string;
111
- /** Bytes after which the writer rolls over to a new file (default 32 MiB). */
112
- rollAtBytes?: number;
113
- redactor?: ProviderRedactor;
114
- }
115
- declare class FileSystemRawProviderSink implements RawProviderSink {
116
- private dir;
117
- private fileName;
118
- private rollAtBytes;
119
- private redactor;
120
- private bytesWritten;
121
- private rollIndex;
122
- private initPromise;
123
- constructor(opts: FileSystemRawProviderSinkOptions);
124
- private ensureInit;
125
- private currentPath;
126
- record(event: RawProviderEvent): Promise<void>;
127
- list(filter?: RawProviderSinkFilter): Promise<RawProviderEvent[]>;
128
- }
129
- /**
130
- * Best-effort provider id from a base URL. Falls back to the URL host when
131
- * none of the well-known patterns match.
132
- */
133
- declare function providerFromBaseUrl(baseUrl: string): string;
134
- //#endregion
135
- //#region src/judge-families.d.ts
136
- /**
137
- * Judge model-family classification + cross-family enforcement.
138
- *
139
- * A judge ensemble built entirely from one provider family shares that
140
- * family's blind spots and self-preference — its "agreement" is correlated
141
- * bias, not independent signal. `assertCrossFamily` makes the consumer prove
142
- * the ensemble spans ≥2 families; `judgeFamily` is the single regex map that
143
- * replaces the per-consumer copies (tax/legal/creative/gtm each ship one).
144
- */
145
- /** Provider family a model belongs to. `unknown` when no rule matches. */
146
- type JudgeFamily = 'anthropic' | 'openai' | 'google' | 'meta' | 'mistral' | 'deepseek' | 'xai' | 'qwen' | 'cohere' | 'amazon' | 'moonshot' | 'zhipu' | 'unknown';
147
- /**
148
- * Classify a model id into its provider family. Strips a `@snapshot` suffix
149
- * and prefers an explicit `provider/...` prefix; otherwise matches the model
150
- * name. Returns `unknown` when nothing matches (callers decide whether that's
151
- * acceptable — `assertCrossFamily` counts it as its own family).
152
- */
153
- declare function judgeFamily(modelId: string): JudgeFamily;
154
- interface AssertCrossFamilyOptions {
155
- /** Minimum number of distinct families the ensemble must span. Default 2. */
156
- minFamilies?: number;
157
- /** When false (default), `unknown`-family models do NOT count toward the
158
- * family total — an ensemble of all-unclassifiable models is not provably
159
- * cross-family. Set true to count `unknown` as one shared family. */
160
- allowUnknown?: boolean;
161
- }
162
- declare class CrossFamilyError extends Error {
163
- readonly families: JudgeFamily[];
164
- readonly models: string[];
165
- constructor(message: string, families: JudgeFamily[], models: string[]);
166
- }
167
- /**
168
- * Throw unless the judge models span at least `minFamilies` distinct provider
169
- * families. Pass the model ids backing your judge ensemble. Fail-loud by
170
- * design — a correlated single-family ensemble silently inflates agreement.
171
- *
172
- * Scope: this reads the ids you REQUEST. It proves the panel was configured
173
- * across families; it cannot prove the panel RAN across families, because a
174
- * routing gateway may answer several different ids from one provider. Where
175
- * the diversity claim is load-bearing (a published leaderboard, a
176
- * certification, a non-self-judging exclusion), assert on the ids the
177
- * provider echoed instead: `assertCrossFamilyServed` in
178
- * ./integrity/served-model.
179
- */
180
- declare function assertCrossFamily(models: string[], opts?: AssertCrossFamilyOptions): JudgeFamily[];
181
- //#endregion
182
- //#region src/integrity/served-model.d.ts
183
- /** How a served id relates to the id that was requested. */
184
- type ServedModelVerdict =
185
- /** Byte-identical after normalisation — the requested model answered. */
186
- 'exact' |
187
- /** Same model, different spelling (provider prefix, snapshot, tier suffix). */
188
- 'alias' |
189
- /** A different model of the SAME provider family answered. */
190
- 'substituted-within-family' |
191
- /** A different provider's model answered. */
192
- 'substituted-cross-family' |
193
- /** The response carried no model id — identity is unproven either way. */
194
- 'unreported';
195
- interface ServedModelCheck {
196
- /** The id the caller asked for. */
197
- requested: string;
198
- /** The id echoed on the response; `null` when the response omitted it. */
199
- served: string | null;
200
- requestedFamily: JudgeFamily;
201
- /** `null` when `served` is null. */
202
- servedFamily: JudgeFamily | null;
203
- verdict: ServedModelVerdict;
204
- /** True for every verdict except `exact` and `alias`. */
205
- substituted: boolean;
206
- }
207
- /**
208
- * Classify one requested/served pair. Pure — no I/O — so it is safe inside
209
- * response handlers, reducers, and CI gates.
210
- *
211
- * `served` is the id echoed by the provider (OpenAI-compatible bodies put it
212
- * at `model`). `null`/`undefined` means the body omitted it; that is
213
- * `unreported`, NOT a pass — a provider that does not name what answered has
214
- * not proven identity, and a transport that drops the field must not read as
215
- * agreement.
216
- */
217
- declare function checkServedModel(requested: string, served: string | null | undefined): ServedModelCheck;
218
- declare class ModelSubstitutionError extends AgentEvalError {
219
- readonly checks: ReadonlyArray<ServedModelCheck>;
220
- constructor(message: string, checks: ReadonlyArray<ServedModelCheck>);
221
- }
222
- /**
223
- * Consumer-facing name for the substitution policy a metered surface applies.
224
- * `'exact'` rejects every substitution. `'allow-within-family'` accepts a
225
- * different model of the same provider family; it keeps family-level claims
226
- * valid and forfeits per-model claims. Maps to
227
- * `AssertServedModelOptions.allowWithinFamily`.
228
- */
229
- type ServedModelPolicy = 'exact' | 'allow-within-family';
230
- interface AssertServedModelOptions {
231
- /**
232
- * Accept a different model of the same provider family (e.g. requested
233
- * `deepseek-v3.2`, served `deepseek-v4-flash`). Default false. Setting this
234
- * keeps family-level claims valid and forfeits per-model claims.
235
- */
236
- allowWithinFamily?: boolean;
237
- /**
238
- * Accept a response that carried no model id. Default false — an
239
- * unidentified response cannot support a per-model or per-family claim.
240
- */
241
- allowUnreported?: boolean;
242
- /** Prefixed to the thrown message, e.g. the judge or campaign cell name. */
243
- context?: string;
244
- }
245
- /**
246
- * The one place the accept/reject policy lives, so a caller that reports
247
- * substitution (a preflight table, a run record) and a caller that throws on it
248
- * can never drift apart. A cross-family substitution is never acceptable.
249
- */
250
- declare function servedModelAcceptable(check: ServedModelCheck, opts?: AssertServedModelOptions): boolean;
251
- /**
252
- * Throw `ModelSubstitutionError` unless the served id is the requested model.
253
- * Returns the check on success so callers can record the served id alongside
254
- * the result.
255
- */
256
- declare function assertServedModel(requested: string, served: string | null | undefined, opts?: AssertServedModelOptions): ServedModelCheck;
257
- /**
258
- * Batch form: check every pair and throw naming EVERY substitution, so one
259
- * failure does not hide the rest. Returns all checks on success.
260
- */
261
- declare function assertServedModels(pairs: ReadonlyArray<{
262
- requested: string;
263
- served: string | null | undefined;
264
- }>, opts?: AssertServedModelOptions): ServedModelCheck[];
265
- interface AssertCrossFamilyServedOptions extends AssertServedModelOptions {
266
- /** Minimum distinct SERVED families required. Default 2. */
267
- minFamilies?: number;
268
- /** Count `unknown`-family served ids toward the total. Default false. */
269
- allowUnknown?: boolean;
270
- }
271
- declare class ServedCrossFamilyError extends AgentEvalError {
272
- readonly families: JudgeFamily[];
273
- readonly checks: ReadonlyArray<ServedModelCheck>;
274
- constructor(message: string, families: JudgeFamily[], checks: ReadonlyArray<ServedModelCheck>);
275
- }
276
- /**
277
- * Family-diversity rule over the models that actually ANSWERED.
278
- *
279
- * `assertCrossFamily` (../judge-families) reads the requested ids and so
280
- * cannot see a gateway that answers three "different" requests from one
281
- * provider. This one asserts no substitution first, then counts families from
282
- * the served ids — a panel that collapsed to one family under the hood fails
283
- * here even though its request list looked diverse.
284
- */
285
- declare function assertCrossFamilyServed(pairs: ReadonlyArray<{
286
- requested: string;
287
- served: string | null | undefined;
288
- }>, opts?: AssertCrossFamilyServedOptions): JudgeFamily[];
289
- //#endregion
290
- //#region src/llm-client.d.ts
291
- interface LlmMessage {
292
- role: 'system' | 'user' | 'assistant' | 'tool';
293
- /**
294
- * Either a plain text content string OR a multimodal content array
295
- * (text + image_url parts) for vision-capable models.
296
- */
297
- content: string | Array<{
298
- type: 'text';
299
- text: string;
300
- } | {
301
- type: 'image_url';
302
- image_url: {
303
- url: string;
304
- detail?: 'auto' | 'low' | 'high';
305
- };
306
- }>;
307
- /** Tool invocations made by an `assistant` message earlier in the turn. */
308
- toolCalls?: LlmToolCall[];
309
- /** The invocation a `tool` message answers. Required when role is `tool`. */
310
- toolCallId?: string;
311
- }
312
- type LlmThinkingMode = 'enabled' | 'disabled';
313
- /** Canonical function-tool definition offered to the model. */
314
- interface LlmToolDefinition {
315
- type: 'function';
316
- function: {
317
- name: string;
318
- description?: string;
319
- parameters: Record<string, unknown>;
320
- };
321
- }
322
- /** Canonical tool-choice policy; meaningful only when `tools` is present. */
323
- type LlmToolChoice = 'auto' | 'none' | 'required' | {
324
- type: 'function';
325
- function: {
326
- name: string;
327
- };
328
- };
329
- /** One tool invocation on a response or an assistant history message. */
330
- interface LlmToolCall {
331
- id: string;
332
- name: string;
333
- /** JSON-encoded arguments, exactly as the provider produced them. */
334
- argumentsJson: string;
335
- }
336
- interface LlmCallRequest {
337
- model: string;
338
- messages: LlmMessage[];
339
- /** Optional JSON-mode response format (response_format: json_object). */
340
- jsonMode?: boolean;
341
- /** Optional structured output via JSON Schema. Falls back to json_object on 400. */
342
- jsonSchema?: {
343
- name: string;
344
- schema: Record<string, unknown>;
345
- };
346
- /** Function tools offered to the model for this call. */
347
- tools?: LlmToolDefinition[];
348
- /** Tool-choice policy for `tools`. */
349
- toolChoice?: LlmToolChoice;
350
- temperature?: number;
351
- maxTokens?: number;
352
- /** OpenAI-compatible reasoning mode. Omitted when the provider default should apply. */
353
- thinking?: LlmThinkingMode;
354
- /** Per-call timeout, default 300s. */
355
- timeoutMs?: number;
356
- }
357
- /** Conservative priced bound for the exact text request sent to a provider.
358
- * Returns undefined when output or multimodal input is not bounded, causing a
359
- * capped CostLedger to reject the call before execution. Pass
360
- * `customTokenPricing` when package pricing does not cover the model or endpoint. */
361
- declare function maximumChargeForLlmRequest(request: Pick<LlmCallRequest, 'model' | 'messages' | 'jsonSchema' | 'tools' | 'toolChoice' | 'maxTokens' | 'thinking'>, options?: LlmClientOptions): MaximumCharge | undefined;
362
- interface LlmUsage {
363
- promptTokens: number;
364
- completionTokens: number;
365
- totalTokens: number;
366
- /** False when the provider omitted or malformed prompt/completion usage. */
367
- captured?: boolean;
368
- /** Reasoning-token subset of completionTokens, when reported. */
369
- reasoningTokens?: number;
370
- /** Proxies populate this when prompt caching is on. */
371
- cachedPromptTokens?: number;
372
- }
373
- interface LlmCallResult {
374
- /** The text content of the first choice. Empty string if none. */
375
- content: string;
376
- /** Tool invocations from the first choice, when the model called tools. */
377
- toolCalls?: LlmToolCall[];
378
- usage: LlmUsage;
379
- /**
380
- * Cost in USD. Uses the provider's reported cost when present, otherwise
381
- * caller-supplied token pricing. `null` when neither is available.
382
- */
383
- costUsd: number | null;
384
- /**
385
- * Model id used for attribution (cost, pricing, log lines). The response's
386
- * echoed id when the provider sent one, else the requested id.
387
- *
388
- * NOT evidence of which model answered — read `servedModel` for that. A
389
- * provider that omits `model` makes this equal to the request, which is
390
- * exactly the case an identity check must be able to distinguish.
391
- */
392
- model: string;
393
- /**
394
- * The model id the provider echoed on the response, verbatim; `null` when
395
- * the body carried none. This is the only field that can witness a gateway
396
- * substituting a different model for the one requested — compare it with
397
- * `assertServedModel` / `checkServedModel` (src/integrity/served-model.ts).
398
- *
399
- * Optional so hand-built results (mock/custom transports) still typecheck,
400
- * but omitting it is not a pass: the identity checks read `undefined` as
401
- * `unreported` and reject it by default. A transport that knows which model
402
- * answered should say so.
403
- */
404
- servedModel?: string | null;
405
- /** Wall-clock duration of the HTTP call (last attempt, if retried). */
406
- durationMs: number;
407
- /**
408
- * `finish_reason` echoed from the first choice (`stop`, `length`,
409
- * `content_filter`, `tool_calls`, ...). `null` when the provider omits it.
410
- * Exposed so a free-form `callLlm` caller CAN detect a truncated answer
411
- * (`length`) instead of treating a cut-off completion as complete. Note:
412
- * `callLlm` does not itself reject on it — acting on this signal is the
413
- * caller's responsibility (in-repo free-form drivers do not yet enforce it).
414
- */
415
- finishReason?: string | null;
416
- /**
417
- * True when `content.trim()` is empty. An empty completion is a silent zero
418
- * for free-form `callLlm` callers; this flag is the signal a caller can
419
- * inspect to fail loud rather than proceed on an empty string. `callLlm`
420
- * surfaces it but does not throw on it.
421
- */
422
- contentEmpty?: boolean;
423
- /** Raw response body. */
424
- raw: Record<string, unknown>;
425
- }
426
- type LlmCallMetadata = Pick<LlmCallResult, 'usage' | 'costUsd' | 'model' | 'durationMs'>;
427
- /** Convert a provider result into the canonical paid-call receipt input.
428
- * The receipt is JSON-clean: absent optional fields are omitted, never carried
429
- * as explicit-undefined keys. Receipts cross JSON boundaries (the external
430
- * optimizer's loopback proxy validates them with `assertJsonValue`), where an
431
- * explicit-undefined value is rejected as non-serializable. */
432
- declare function costReceiptFromLlm(result: LlmCallResult, customTokenPricing?: CustomTokenPricing): CostReceiptInput;
433
- /** Structured-response failures retain their completed provider receipt. */
434
- declare function costReceiptFromLlmError(error: Error, customTokenPricing?: CustomTokenPricing): CostReceiptInput | undefined;
435
- declare class LlmCallError extends AgentEvalError {
436
- readonly status: number;
437
- readonly body: string;
438
- readonly model: string;
439
- constructor(message: string, status: number, body: string, model: string);
440
- }
441
- /** A provider response completed and incurred measurable usage, but its content
442
- * could not satisfy the caller's response contract. The response envelope is
443
- * retained so accounting can commit the receipt before the error propagates. */
444
- declare class LlmResponseError extends AgentEvalError {
445
- readonly result: LlmCallResult;
446
- constructor(message: string, result: LlmCallResult, options?: {
447
- cause?: unknown;
448
- });
449
- }
450
- interface LlmClientOptions {
451
- /** Base URL (without trailing slash). Must end at the `/v1` prefix. */
452
- baseUrl?: string;
453
- /** Bearer token — either `apiKey` or `bearer` populates `Authorization: Bearer ...`. */
454
- apiKey?: string;
455
- bearer?: string;
456
- /** Override for the `Authorization` header (e.g. `X-Auth: ...`). Takes precedence over apiKey/bearer. */
457
- authHeader?: {
458
- name: string;
459
- value: string;
460
- };
461
- /** Stable provider idempotency key, reused across retries of this logical call. */
462
- idempotencyKey?: string;
463
- /** Default timeout in ms. Per-call can override. */
464
- defaultTimeoutMs?: number;
465
- /**
466
- * Caller-supplied abort signal — e.g. a campaign-wide cancel. Linked to
467
- * each attempt's per-attempt timeout controller, so aborting it cancels
468
- * the in-flight fetch. A caller abort is FATAL: it is not retried even
469
- * though an AbortError otherwise matches the transient patterns.
470
- */
471
- signal?: AbortSignal;
472
- /**
473
- * Cross-attempt wall-clock budget in ms, measured from the first attempt.
474
- * Before launching each attempt the loop checks the remaining budget and
475
- * stops retrying once it is exhausted, rather than waiting the full
476
- * per-attempt timeout on every retry. Bounds total time independent of
477
- * total attempts × `timeoutMs`.
478
- */
479
- deadlineMs?: number;
480
- /** Total provider attempts. Default 3. */
481
- maximumAttempts?: number;
482
- /** Token rates used when the provider omits cost or package pricing does not cover the model. */
483
- customTokenPricing?: CustomTokenPricing;
484
- /**
485
- * Transport for requests that declare `jsonSchema`. `native` sends
486
- * `response_format: json_schema`; `json-object` sends the broadly supported
487
- * JSON mode and relies on the caller to include the schema in model-visible
488
- * instructions. Default: `native`.
489
- */
490
- jsonSchemaTransport?: 'native' | 'json-object';
491
- /**
492
- * JSON payload parsing policy. `extract` accepts fenced or prose-prefixed JSON.
493
- * `exact` requires the complete response content to be one JSON value.
494
- * Default: `extract`.
495
- */
496
- jsonPayloadMode?: 'extract' | 'exact';
497
- /** Default provider reasoning mode. A per-call request value takes precedence. */
498
- thinking?: LlmThinkingMode;
499
- /** Fetch implementation — defaults to global `fetch`. Override for custom transport (e.g. tests). */
500
- fetch?: typeof fetch;
501
- /**
502
- * Optional raw HTTP capture sink. When provided, every request, response,
503
- * and error (across all retry attempts) is recorded to the sink, with auth
504
- * headers and credential-shaped body fields redacted by default. This is
505
- * the layer-1 forensics primitive: structured `LlmSpan`s record intent,
506
- * raw events record what actually crossed the wire.
507
- */
508
- rawSink?: RawProviderSink;
509
- /**
510
- * Logical provider id attached to raw events. When omitted, derived from
511
- * `baseUrl` via `providerFromBaseUrl`.
512
- */
513
- provider?: string;
514
- /** Trace context attached to raw events; populated by emitter-aware callers. */
515
- traceContext?: {
516
- runId?: string;
517
- spanId?: string;
518
- };
519
- /** Override the redaction strategy for this call. Defaults to `defaultProviderRedactor`. */
520
- redactor?: ProviderRedactor;
521
- /**
522
- * Reject a response whose echoed model is not the model that was requested.
523
- * A routing gateway can accept one id and answer from another, which
524
- * silently invalidates every per-model and per-family claim downstream.
525
- * `true` uses the strict default (aliases pass, substitutions and
526
- * unidentified responses throw `ModelSubstitutionError`); pass an options
527
- * object to relax a specific case. Off by default — turning it on for a
528
- * measurement run is the point.
529
- */
530
- assertServedModel?: boolean | AssertServedModelOptions;
531
- }
532
- /**
533
- * True when an error is a transient transport/network fault worth retrying,
534
- * as opposed to a deterministic failure (4xx schema reject, JSON parse) that
535
- * a retry cannot fix. Inspects `LlmCallError.status`, then the error's
536
- * name/message/code, then recurses into `error.cause` — undici nests the
537
- * real socket fault one or more levels under `.cause`.
538
- *
539
- * This is the retry classifier for the package: `callLlm` and
540
- * `withJudgeRetry` both route through it, so connection failures are treated
541
- * consistently across transports.
542
- */
543
- declare function isTransientLlmError(err: unknown): boolean;
544
- /**
545
- * Strip a ```json / ``` code fence if the model emitted one.
546
- * Idempotent for naked JSON. Some models (claude-code via router, certain
547
- * deepseek models) wrap output even under json_object.
548
- */
549
- declare function stripFencedJson(raw: string): string;
550
- /**
551
- * Low-level call. Returns raw content + usage + cost. Retries on transient
552
- * failures; does NOT degrade schema here — callers that want graceful
553
- * degrade use `callLlmJson`.
554
- */
555
- declare function callLlm(req: LlmCallRequest, opts?: LlmClientOptions): Promise<LlmCallResult>;
556
- /**
557
- * Structured-output call. Returns parsed JSON plus the raw result envelope.
558
- * Degrades `jsonSchema` → `jsonMode` on a 400 that names the schema param —
559
- * critical for deepseek-v3/v4, kimi-k2.6, and other models that don't accept
560
- * the `response_format.json_schema` shape but DO accept `json_object`.
561
- */
562
- declare function callLlmJson<T = unknown>(req: LlmCallRequest, opts?: LlmClientOptions): Promise<{
563
- value: T;
564
- result: LlmCallResult;
565
- }>;
566
- interface LlmRouteRequirements {
567
- /**
568
- * Throw if `opts.baseUrl` is undefined, i.e. the call would fall back to
569
- * `DEFAULT_BASE_URL`. Set this for evaluation runs where silently using
570
- * the public/free-tier router is a defect — the launch reviewer needs to
571
- * know exactly which provider answered.
572
- */
573
- requireExplicitBaseUrl?: boolean;
574
- /**
575
- * Allowlist of acceptable base URLs. Strings match by prefix
576
- * (case-insensitive); RegExps test against the full base URL.
577
- */
578
- allowedBaseUrls?: Array<string | RegExp>;
579
- /** Blocklist that takes precedence over `allowedBaseUrls`. */
580
- blockedBaseUrls?: Array<string | RegExp>;
581
- /** Throw if no auth header / api key is configured. */
582
- requireAuth?: boolean;
583
- /**
584
- * Logical provider id the configured `baseUrl` is expected to match (via
585
- * `providerFromBaseUrl`). Mainly useful when paired with `requireExplicitBaseUrl`.
586
- */
587
- expectedProvider?: string;
588
- }
589
- /**
590
- * Fail-loud assertion that the configured LLM client points at the route
591
- * the caller intends. Designed for the matrix-runner preflight: invoke
592
- * once before any LLM call to catch misconfiguration before a sweep burns
593
- * dollars on the wrong provider.
594
- *
595
- * Throws `LlmRouteAssertionError`. Pure — no I/O — so it's safe to call
596
- * from constructors and CI gates.
597
- */
598
- declare function assertLlmRoute(opts: LlmClientOptions, req?: LlmRouteRequirements): void;
599
- /**
600
- * Probe whether a model is reachable. Returns latency + null error on
601
- * success; `ok=false` + error message on any failure (HTTP, timeout,
602
- * network, parse). Designed for sweep preflights — fail loud at the
603
- * boundary before burning a 30-leaf run on a misconfigured router.
604
- *
605
- * Sends a tiny `ping` message with `maxTokens = PROBE_MAX_TOKENS`. Reasoning
606
- * models (glm-5.1, deepseek-v4) can burn the entire budget on internal
607
- * reasoning for short prompts, so don't tighten this further — the shared
608
- * constant keeps this probe and `preflightModels` on one answer. We don't
609
- * validate content.
610
- *
611
- * Reachability and identity are separate answers: `ok` means the route
612
- * answered, `servedModel` / `substituted` say WHICH model answered. A gateway
613
- * that serves another provider's model returns `ok: true` with
614
- * `substituted: true` — inspect both before treating the id as measured.
615
- */
616
- declare function probeLlm(model: string, opts?: LlmClientOptions & {
617
- timeoutMs?: number;
618
- }): Promise<{
619
- ok: boolean;
620
- latencyMs: number;
621
- error: string | null;
622
- /** Id echoed by the provider; `null` when it sent none or the probe failed. */
623
- servedModel: string | null;
624
- /** True when the echoed id is a different model than `model` (or absent). */
625
- substituted: boolean;
626
- }>;
627
- /**
628
- * Stateful client — construct once with defaults, call many times.
629
- * Thin wrapper around the free functions; exists for callers that want
630
- * to inject a single configured instance into multiple primitives.
631
- */
632
- declare class LlmClient {
633
- readonly maximumAttempts: number;
634
- private readonly opts;
635
- constructor(opts?: LlmClientOptions);
636
- call(req: LlmCallRequest, per?: LlmClientOptions): Promise<LlmCallResult>;
637
- callJson<T = unknown>(req: LlmCallRequest, per?: LlmClientOptions): Promise<{
638
- value: T;
639
- result: LlmCallResult;
640
- }>;
641
- }
642
- //#endregion
643
- //#region src/analyst/chat-client.d.ts
644
- /**
645
- * Unified chat interface using the package's canonical LLM request and result.
646
- */
647
- interface ChatClient {
648
- /** Display name of the bound transport, included in telemetry. */
649
- readonly transport: ChatTransport;
650
- /** Default model when the caller omits one. */
651
- readonly defaultModel?: string;
652
- /** Total provider attempts this transport can make for one chat call. */
653
- readonly maximumAttempts?: number;
654
- /** Implementations must enforce `req.maxTokens` when it is present. */
655
- chat(req: ChatRequest, opts?: ChatCallOpts): Promise<ChatResponse>;
656
- }
657
- type ChatTransport = 'router' | 'sandbox-sdk' | 'cli-bridge' | 'direct-provider' | 'custom' | 'mock';
658
- interface ChatRequest extends Omit<LlmCallRequest, 'model'> {
659
- /** Optional — falls back to ChatClient.defaultModel. */
660
- model?: string;
661
- }
662
- type ChatResponse = LlmCallResult;
663
- interface ChatCallOpts {
664
- /** Cancel the in-flight request. */
665
- signal?: AbortSignal;
666
- /** Hard USD ceiling for this single call (informational; the underlying transport may not enforce). */
667
- maxCostUsd?: number;
668
- /** Correlation tag carried into request headers when the transport allows. */
669
- correlationId?: string;
670
- /** Stable provider idempotency key for retries/redrives of one paid call. */
671
- idempotencyKey?: string;
672
- }
673
- type CreateChatClientOpts = RouterTransportOpts | CliBridgeTransportOpts | DirectProviderTransportOpts | SandboxSdkTransportOpts | CustomTransportOpts | MockTransportOpts;
674
- interface BaseTransportOpts {
675
- defaultModel?: string;
676
- /** Total provider attempts. Required for opaque transports used in capped runs. */
677
- maximumAttempts?: number;
678
- }
679
- interface RouterTransportOpts extends BaseTransportOpts {
680
- transport: 'router';
681
- baseUrl?: string;
682
- apiKey: string;
683
- }
684
- interface CliBridgeTransportOpts extends BaseTransportOpts {
685
- transport: 'cli-bridge';
686
- baseUrl?: string;
687
- bearer?: string;
688
- }
689
- interface DirectProviderTransportOpts extends BaseTransportOpts {
690
- transport: 'direct-provider';
691
- baseUrl: string;
692
- apiKey: string;
693
- }
694
- /**
695
- * Sandbox-SDK transport. The caller supplies a canonical chat function for an
696
- * already-configured Sandbox handle, so agent-eval does not import the SDK.
697
- */
698
- interface SandboxSdkTransportOpts extends BaseTransportOpts {
699
- transport: 'sandbox-sdk';
700
- chat: (req: ChatRequest, opts?: ChatCallOpts) => Promise<ChatResponse>;
701
- }
702
- /** Caller-adapted SDK or transport returning the canonical ChatResponse shape. */
703
- interface CustomTransportOpts extends BaseTransportOpts {
704
- transport: 'custom';
705
- chat: (req: ChatRequest, opts?: ChatCallOpts) => Promise<ChatResponse>;
706
- }
707
- /**
708
- * Mock transport for tests. The handler receives the request and returns
709
- * whatever the test wants. No retries, no JSON-schema degrade.
710
- */
711
- interface MockTransportOpts extends BaseTransportOpts {
712
- transport: 'mock';
713
- handler: (req: ChatRequest, opts?: ChatCallOpts) => Promise<ChatResponse>;
714
- }
715
- /**
716
- * Build a ChatClient bound to a specific transport. The returned client
717
- * is safe to share across analysts in a single registry run.
718
- */
719
- declare function createChatClient(opts: CreateChatClientOpts): ChatClient;
720
- //#endregion
721
- //#region src/types.d.ts
722
- interface Scenario {
723
- id: string;
724
- persona: string;
725
- label: string;
726
- thesis: string;
727
- dimensions: string[];
728
- turns: Turn[];
729
- artifactChecks: ArtifactCheck[];
730
- systemPromptAppend?: string;
731
- }
732
- interface Turn {
733
- user: string;
734
- expectedBehaviors: string[];
735
- adversarial?: boolean;
736
- feedbackType?: 'correction' | 'rejection' | 'vague' | 'contradictory' | 'escalation';
737
- }
738
- interface ArtifactCheck {
739
- type: 'vault_file_exists' | 'vault_file_contains' | 'block_extracted' | 'code_valid' | 'generation_produced' | 'tool_created' | string;
740
- target: string;
741
- contains?: string;
742
- minCount?: number;
743
- description: string;
744
- }
745
- interface JudgeRubric {
746
- name: string;
747
- description: string;
748
- dimensions: RubricDimension[];
749
- }
750
- interface RubricDimension {
751
- name: string;
752
- description: string;
753
- anchor_low: string;
754
- anchor_high: string;
755
- weight: number;
756
- }
757
- interface TurnResult {
758
- turnIndex: number;
759
- userMessage: string;
760
- agentResponse: string;
761
- durationMs: number;
762
- blocksExtracted: {
763
- type: string;
764
- title: string;
765
- }[];
766
- containsCode: boolean;
767
- containsToolCall: boolean;
768
- }
769
- interface JudgeScore {
770
- judgeName: string;
771
- dimension: string;
772
- score: number;
773
- reasoning: string;
774
- evidence?: string;
775
- }
776
- interface CollectedArtifacts {
777
- vaultFiles: {
778
- path: string;
779
- content: string;
780
- }[];
781
- blocksExtracted: {
782
- type: string;
783
- fields: Record<string, string>;
784
- }[];
785
- codeBlocks: {
786
- language: string;
787
- code: string;
788
- }[];
789
- toolCalls: string[];
790
- }
791
- interface RouteMap {
792
- signup?: string;
793
- login?: string;
794
- workspaces?: string;
795
- threads?: string;
796
- chat?: string;
797
- tasks?: string;
798
- events?: string;
799
- approvals?: string;
800
- vault?: string;
801
- generations?: string;
802
- [key: string]: string | undefined;
803
- }
804
- interface ProductClientConfig {
805
- baseUrl: string;
806
- routes: RouteMap;
807
- /** Per-request timeout in ms before the request is aborted. Default 30s. */
808
- timeoutMs?: number;
809
- }
810
- interface CompletionCriterion {
811
- name: string;
812
- check: (state: DriverState) => boolean;
813
- progress?: (state: DriverState) => number;
814
- }
815
- /**
816
- * How hard the simulated user pushes back. The driver LLM scales its tone
817
- * and follow-up aggression to this:
818
- * cooperative — forgiving early adopter; accepts reasonable answers.
819
- * demanding — experienced professional; rejects vague or hedged answers.
820
- * relentless — senior partner reviewing for a client who will litigate;
821
- * interrogates every claim, accepts nothing undefended.
822
- */
823
- type PersonaRigor = 'cooperative' | 'demanding' | 'relentless';
824
- interface PersonaConfig {
825
- id: string;
826
- role: string;
827
- goal: string;
828
- completionCriteria: CompletionCriterion[];
829
- maxTurns: number;
830
- /** How adversarial the simulated user is. Defaults to 'demanding'. */
831
- rigor?: PersonaRigor;
832
- /**
833
- * Domain expertise the simulated user holds — quoted into the driver
834
- * prompt so it challenges the agent with authority instead of vague
835
- * dissatisfaction. e.g. "a 15-year M&A partner who knows GAAP
836
- * working-capital mechanics cold".
837
- */
838
- expertise?: string;
839
- /**
840
- * Substantive issues a senior professional in this role would
841
- * interrogate — traps the scenario hides, claims that must be defended.
842
- * The driver probes these without revealing them verbatim; the agent
843
- * must surface them on its own.
844
- */
845
- pressurePoints?: string[];
846
- /**
847
- * Curveballs the driver may inject once the agent is coasting — changed
848
- * facts, a hostile counterparty position, a new constraint. Forces the
849
- * agent to re-derive rather than recite.
850
- */
851
- curveballs?: string[];
852
- }
853
- interface DriverState {
854
- tasks: number;
855
- events: number;
856
- proposals: {
857
- pending: number;
858
- approved: number;
859
- rejected: number;
860
- };
861
- vaultFiles: string[];
862
- codeBlocks: number;
863
- generations: number;
864
- }
865
- interface JudgeInput {
866
- scenario: Scenario;
867
- turns: TurnResult[];
868
- artifacts: CollectedArtifacts;
869
- /** Shared ledger for paid built-in judges. Direct calls default to an uncapped ledger. */
870
- costLedger?: CostLedgerHandle;
871
- costPhase?: string;
872
- costTags?: Record<string, string>;
873
- signal?: AbortSignal;
874
- }
875
- type JudgeFn = (chat: ChatClient, input: JudgeInput) => Promise<JudgeScore[]>;
876
- interface CheckResult {
877
- name: string;
878
- passed: boolean;
879
- expected: string;
880
- actual: string;
881
- }
882
- //#endregion
883
- export { assertServedModels as $, LlmClientOptions as A, isTransientLlmError as B, SandboxSdkTransportOpts as C, LlmCallRequest as D, LlmCallMetadata as E, assertLlmRoute as F, AssertServedModelOptions as G, probeLlm as H, callLlm as I, ServedModelCheck as J, ModelSubstitutionError as K, callLlmJson as L, LlmResponseError as M, LlmRouteRequirements as N, LlmCallResult as O, LlmUsage as P, assertServedModel as Q, costReceiptFromLlm as R, RouterTransportOpts as S, LlmCallError as T, stripFencedJson as U, maximumChargeForLlmRequest as V, AssertCrossFamilyServedOptions as W, ServedModelVerdict as X, ServedModelPolicy as Y, assertCrossFamilyServed as Z, CliBridgeTransportOpts as _, defaultProviderRedactor as _t, JudgeInput as a, assertCrossFamily as at, DirectProviderTransportOpts as b, PersonaConfig as c, FileSystemRawProviderSinkOptions as ct, Scenario as d, NoopRawProviderSink as dt, checkServedModel as et, ChatCallOpts as f, ProviderRedactor as ft, ChatTransport as g, RawProviderSinkFilter as gt, ChatResponse as h, RawProviderSink as ht, JudgeFn as i, JudgeFamily as it, LlmMessage as j, LlmClient as k, ProductClientConfig as l, InMemoryRawProviderSink as lt, ChatRequest as m, RawProviderEvent as mt, CompletionCriterion as n, AssertCrossFamilyOptions as nt, JudgeRubric as o, judgeFamily as ot, ChatClient as p, RawProviderDirection as pt, ServedCrossFamilyError as q, DriverState as r, CrossFamilyError as rt, JudgeScore as s, FileSystemRawProviderSink as st, CheckResult as t, servedModelAcceptable as tt, RouteMap as u, InMemoryRawProviderSinkOptions as ut, CreateChatClientOpts as v, providerFromBaseUrl as vt, createChatClient as w, MockTransportOpts as x, CustomTransportOpts as y, costReceiptFromLlmError as z };
884
- //# sourceMappingURL=types-jUBXJ7Iz.d.ts.map