@tangle-network/agent-eval 0.129.0 → 0.130.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 (427) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +1 -0
  3. package/dist/active-curriculum-C4mk67HP.js +214 -0
  4. package/dist/active-curriculum-C4mk67HP.js.map +1 -0
  5. package/dist/adversarial-smnADNFS.d.ts +21 -0
  6. package/dist/adversarial-smnADNFS.d.ts.map +1 -0
  7. package/dist/analyst/index.d.ts +81 -2872
  8. package/dist/analyst/index.d.ts.map +1 -0
  9. package/dist/analyst/index.js +319 -360
  10. package/dist/analyst/index.js.map +1 -1
  11. package/dist/analyst-BkTS3C58.d.ts +89 -0
  12. package/dist/analyst-BkTS3C58.d.ts.map +1 -0
  13. package/dist/analyst-LsnNpSkm.js +152 -0
  14. package/dist/analyst-LsnNpSkm.js.map +1 -0
  15. package/dist/analyze-runs-C1CavBMk.js +1067 -0
  16. package/dist/analyze-runs-C1CavBMk.js.map +1 -0
  17. package/dist/analyze-runs-FsgYCinh.d.ts +72 -0
  18. package/dist/analyze-runs-FsgYCinh.d.ts.map +1 -0
  19. package/dist/attribute-vocabulary-DLJ6303h.d.ts +54 -0
  20. package/dist/attribute-vocabulary-DLJ6303h.d.ts.map +1 -0
  21. package/dist/authenticity/index.d.ts +81 -79
  22. package/dist/authenticity/index.d.ts.map +1 -0
  23. package/dist/authenticity/index.js +209 -193
  24. package/dist/authenticity/index.js.map +1 -1
  25. package/dist/baseline-HsBvw_dk.js +550 -0
  26. package/dist/baseline-HsBvw_dk.js.map +1 -0
  27. package/dist/baseline-hG3K85h4.d.ts +125 -0
  28. package/dist/baseline-hG3K85h4.d.ts.map +1 -0
  29. package/dist/belief-state/index.d.ts +448 -1188
  30. package/dist/belief-state/index.d.ts.map +1 -0
  31. package/dist/belief-state/index.js +1617 -1709
  32. package/dist/belief-state/index.js.map +1 -1
  33. package/dist/benchmarks/index.d.ts +2 -891
  34. package/dist/benchmarks/index.js +2 -60
  35. package/dist/benchmarks-DviOvUNr.js +754 -0
  36. package/dist/benchmarks-DviOvUNr.js.map +1 -0
  37. package/dist/builder-eval/index.d.ts +150 -662
  38. package/dist/builder-eval/index.d.ts.map +1 -0
  39. package/dist/builder-eval/index.js +356 -345
  40. package/dist/builder-eval/index.js.map +1 -1
  41. package/dist/calibration-CNWWA6K8.js +94 -0
  42. package/dist/calibration-CNWWA6K8.js.map +1 -0
  43. package/dist/campaign/index.d.ts +5 -6381
  44. package/dist/campaign/index.js +3 -213
  45. package/dist/campaign-CBKZvQ1H.js +3885 -0
  46. package/dist/campaign-CBKZvQ1H.js.map +1 -0
  47. package/dist/cli.d.ts +1 -1
  48. package/dist/cli.js +164 -175
  49. package/dist/cli.js.map +1 -1
  50. package/dist/client-C97NMzqi.d.ts +581 -0
  51. package/dist/client-C97NMzqi.d.ts.map +1 -0
  52. package/dist/client-CYzbdJOZ.js +637 -0
  53. package/dist/client-CYzbdJOZ.js.map +1 -0
  54. package/dist/code-agent-session-BjkMTQ7H.js +1390 -0
  55. package/dist/code-agent-session-BjkMTQ7H.js.map +1 -0
  56. package/dist/code-agent-session-DqqgOJaz.d.ts +143 -0
  57. package/dist/code-agent-session-DqqgOJaz.d.ts.map +1 -0
  58. package/dist/concurrency-DIxRZF_J.js +85 -0
  59. package/dist/concurrency-DIxRZF_J.js.map +1 -0
  60. package/dist/contract/index.d.ts +645 -5565
  61. package/dist/contract/index.d.ts.map +1 -0
  62. package/dist/contract/index.js +1730 -1938
  63. package/dist/contract/index.js.map +1 -1
  64. package/dist/control.d.ts +3 -1030
  65. package/dist/control.js +2 -33
  66. package/dist/cost-ledger-DIgQUFZZ.js +801 -0
  67. package/dist/cost-ledger-DIgQUFZZ.js.map +1 -0
  68. package/dist/cost-ledger-Dye6jCgg.d.ts +236 -0
  69. package/dist/cost-ledger-Dye6jCgg.d.ts.map +1 -0
  70. package/dist/dataset-BvtnC8Dc.d.ts +115 -0
  71. package/dist/dataset-BvtnC8Dc.d.ts.map +1 -0
  72. package/dist/default-registry-C-vFCSEc.js +2579 -0
  73. package/dist/default-registry-C-vFCSEc.js.map +1 -0
  74. package/dist/default-registry-CNPo-Vsb.d.ts +540 -0
  75. package/dist/default-registry-CNPo-Vsb.d.ts.map +1 -0
  76. package/dist/emitter-CPBAhxum.js +266 -0
  77. package/dist/emitter-CPBAhxum.js.map +1 -0
  78. package/dist/emitter-DGQGoLyj.d.ts +113 -0
  79. package/dist/emitter-DGQGoLyj.d.ts.map +1 -0
  80. package/dist/errors-8YnH8WlF.js +64 -0
  81. package/dist/errors-8YnH8WlF.js.map +1 -0
  82. package/dist/errors-CEk209JS.d.ts +76 -0
  83. package/dist/errors-CEk209JS.d.ts.map +1 -0
  84. package/dist/eval-campaign-DEm6c8ru.js +349 -0
  85. package/dist/eval-campaign-DEm6c8ru.js.map +1 -0
  86. package/dist/execution-tracks-CpgFPpS5.js +93 -0
  87. package/dist/execution-tracks-CpgFPpS5.js.map +1 -0
  88. package/dist/exporters-q9iL-2Jf.js +148 -0
  89. package/dist/exporters-q9iL-2Jf.js.map +1 -0
  90. package/dist/extract-usage-BrQ8mCLX.js +155 -0
  91. package/dist/extract-usage-BrQ8mCLX.js.map +1 -0
  92. package/dist/failure-cluster-CqcvCcdR.d.ts +59 -0
  93. package/dist/failure-cluster-CqcvCcdR.d.ts.map +1 -0
  94. package/dist/feedback-trajectory-CVaeREXV.d.ts +340 -0
  95. package/dist/feedback-trajectory-CVaeREXV.d.ts.map +1 -0
  96. package/dist/fuzz.d.ts +320 -646
  97. package/dist/fuzz.d.ts.map +1 -0
  98. package/dist/fuzz.js +670 -618
  99. package/dist/fuzz.js.map +1 -1
  100. package/dist/hf-dataset-DBJXXoY1.js +763 -0
  101. package/dist/hf-dataset-DBJXXoY1.js.map +1 -0
  102. package/dist/hosted/index.d.ts +11 -831
  103. package/dist/hosted/index.d.ts.map +1 -0
  104. package/dist/hosted/index.js +2 -37
  105. package/dist/index-2JJSA6-r2.d.ts +926 -0
  106. package/dist/index-2JJSA6-r2.d.ts.map +1 -0
  107. package/dist/index-6N0aYmpW.d.ts +217 -0
  108. package/dist/index-6N0aYmpW.d.ts.map +1 -0
  109. package/dist/index-BAvgST_9.d.ts +131 -0
  110. package/dist/index-BAvgST_9.d.ts.map +1 -0
  111. package/dist/index-BvnJuTGD.d.ts +68 -0
  112. package/dist/index-BvnJuTGD.d.ts.map +1 -0
  113. package/dist/index-C61Wi7yg.d.ts +547 -0
  114. package/dist/index-C61Wi7yg.d.ts.map +1 -0
  115. package/dist/index-CAPUUKaM.d.ts +335 -0
  116. package/dist/index-CAPUUKaM.d.ts.map +1 -0
  117. package/dist/index-DE5fb3EC.d.ts +2244 -0
  118. package/dist/index-DE5fb3EC.d.ts.map +1 -0
  119. package/dist/index-DSC51roc.d.ts +102 -0
  120. package/dist/index-DSC51roc.d.ts.map +1 -0
  121. package/dist/index.d.ts +3755 -15555
  122. package/dist/index.d.ts.map +1 -0
  123. package/dist/index.js +11182 -11216
  124. package/dist/index.js.map +1 -1
  125. package/dist/integrity-BzRbCHzi.js +424 -0
  126. package/dist/integrity-BzRbCHzi.js.map +1 -0
  127. package/dist/integrity-rmVhXWA7.d.ts +61 -0
  128. package/dist/integrity-rmVhXWA7.d.ts.map +1 -0
  129. package/dist/judge-calibration-DFtEMlde.d.ts +146 -0
  130. package/dist/judge-calibration-DFtEMlde.d.ts.map +1 -0
  131. package/dist/ledger-core/index.d.ts +2 -0
  132. package/dist/ledger-core/index.js +2 -0
  133. package/dist/ledger-core-DtZz1RG0.js +388 -0
  134. package/dist/ledger-core-DtZz1RG0.js.map +1 -0
  135. package/dist/llm-client--GR4JbZE.js +687 -0
  136. package/dist/llm-client--GR4JbZE.js.map +1 -0
  137. package/dist/llm-client-B_nIBlYo.d.ts +290 -0
  138. package/dist/llm-client-B_nIBlYo.d.ts.map +1 -0
  139. package/dist/matrix/index.d.ts +3 -155
  140. package/dist/matrix/index.js +2 -8
  141. package/dist/matrix-BzQnu2S6.js +270 -0
  142. package/dist/matrix-BzQnu2S6.js.map +1 -0
  143. package/dist/meta-eval/index.d.ts +4 -1027
  144. package/dist/meta-eval/index.js +393 -390
  145. package/dist/meta-eval/index.js.map +1 -1
  146. package/dist/metrics-C9YY1OcL.js +239 -0
  147. package/dist/metrics-C9YY1OcL.js.map +1 -0
  148. package/dist/mint-yN2M2eh0.js +201 -0
  149. package/dist/mint-yN2M2eh0.js.map +1 -0
  150. package/dist/multi-layer-verifier-BHY1gWAc.d.ts +138 -0
  151. package/dist/multi-layer-verifier-BHY1gWAc.d.ts.map +1 -0
  152. package/dist/multishot/index.d.ts +273 -480
  153. package/dist/multishot/index.d.ts.map +1 -0
  154. package/dist/multishot/index.js +595 -548
  155. package/dist/multishot/index.js.map +1 -1
  156. package/dist/off-policy-DvgzvtIx.js +220 -0
  157. package/dist/off-policy-DvgzvtIx.js.map +1 -0
  158. package/dist/off-policy-mskQw8Mb.d.ts +153 -0
  159. package/dist/off-policy-mskQw8Mb.d.ts.map +1 -0
  160. package/dist/openapi.json +1 -1
  161. package/dist/opencode-sqlite-BGrHeDu3.js +318 -0
  162. package/dist/opencode-sqlite-BGrHeDu3.js.map +1 -0
  163. package/dist/outcome-store-BYHIuO0e.d.ts +65 -0
  164. package/dist/outcome-store-BYHIuO0e.d.ts.map +1 -0
  165. package/dist/outcome-store-ChBKlTd_.js +75 -0
  166. package/dist/outcome-store-ChBKlTd_.js.map +1 -0
  167. package/dist/paired-arms-D9D0wXj2.js +260 -0
  168. package/dist/paired-arms-D9D0wXj2.js.map +1 -0
  169. package/dist/pipelines/index.d.ts +95 -532
  170. package/dist/pipelines/index.d.ts.map +1 -0
  171. package/dist/pipelines/index.js +497 -478
  172. package/dist/pipelines/index.js.map +1 -1
  173. package/dist/pre-registration-DakwTRXk.js +96 -0
  174. package/dist/pre-registration-DakwTRXk.js.map +1 -0
  175. package/dist/propose-review-control-LhIWGzHl.js +1458 -0
  176. package/dist/propose-review-control-LhIWGzHl.js.map +1 -0
  177. package/dist/query-CJ_DX8vl.d.ts +28 -0
  178. package/dist/query-CJ_DX8vl.d.ts.map +1 -0
  179. package/dist/query-Di7eEQ79.js +83 -0
  180. package/dist/query-Di7eEQ79.js.map +1 -0
  181. package/dist/raw-provider-sink-BQd7mzyT.js +201 -0
  182. package/dist/raw-provider-sink-BQd7mzyT.js.map +1 -0
  183. package/dist/raw-provider-sink-BU29Sh8h.d.ts +134 -0
  184. package/dist/raw-provider-sink-BU29Sh8h.d.ts.map +1 -0
  185. package/dist/redact-7Aq1ukl-.js +107 -0
  186. package/dist/redact-7Aq1ukl-.js.map +1 -0
  187. package/dist/release-report-Cz9NKH39.js +603 -0
  188. package/dist/release-report-Cz9NKH39.js.map +1 -0
  189. package/dist/release-report-mvB2G4_J.d.ts +244 -0
  190. package/dist/release-report-mvB2G4_J.d.ts.map +1 -0
  191. package/dist/replay-GnyotH0J.js +1741 -0
  192. package/dist/replay-GnyotH0J.js.map +1 -0
  193. package/dist/replay-OoidtG1E.d.ts +749 -0
  194. package/dist/replay-OoidtG1E.d.ts.map +1 -0
  195. package/dist/reporting.d.ts +6 -1312
  196. package/dist/reporting.js +6 -51
  197. package/dist/researcher-CwTdwXG1.d.ts +314 -0
  198. package/dist/researcher-CwTdwXG1.d.ts.map +1 -0
  199. package/dist/reward-hacking-eAnOsynk.d.ts +224 -0
  200. package/dist/reward-hacking-eAnOsynk.d.ts.map +1 -0
  201. package/dist/reward-hacking-qipEpKvY.js +596 -0
  202. package/dist/reward-hacking-qipEpKvY.js.map +1 -0
  203. package/dist/reward-nw2xZGZG.js +137 -0
  204. package/dist/reward-nw2xZGZG.js.map +1 -0
  205. package/dist/rl.d.ts +760 -4010
  206. package/dist/rl.d.ts.map +1 -0
  207. package/dist/rl.js +2325 -1958
  208. package/dist/rl.js.map +1 -1
  209. package/dist/rolldown-runtime-8H4AJuhK.js +14 -0
  210. package/dist/rollout/index.d.ts +3 -2087
  211. package/dist/rollout/index.js +8 -168
  212. package/dist/rollout-BOYjemfR.js +624 -0
  213. package/dist/rollout-BOYjemfR.js.map +1 -0
  214. package/dist/rubric-predictive-validity-B3xmbmS1.js +141 -0
  215. package/dist/rubric-predictive-validity-B3xmbmS1.js.map +1 -0
  216. package/dist/rubric-predictive-validity-Ku_clp_1.d.ts +74 -0
  217. package/dist/rubric-predictive-validity-Ku_clp_1.d.ts.map +1 -0
  218. package/dist/run-evidence-ClRX_8A9.d.ts +225 -0
  219. package/dist/run-evidence-ClRX_8A9.d.ts.map +1 -0
  220. package/dist/run-record-BuoE80Dq.js +467 -0
  221. package/dist/{chunk-56TAVBOK.js.map → run-record-BuoE80Dq.js.map} +1 -1
  222. package/dist/run-record-CnZu_gjl.d.ts +357 -0
  223. package/dist/run-record-CnZu_gjl.d.ts.map +1 -0
  224. package/dist/run-score-iEEAWiBY.js +41 -0
  225. package/dist/run-score-iEEAWiBY.js.map +1 -0
  226. package/dist/runtime-trajectory-1gyaTOoC.js +93 -0
  227. package/dist/runtime-trajectory-1gyaTOoC.js.map +1 -0
  228. package/dist/runtime-trajectory-BvSZcCHD.d.ts +50 -0
  229. package/dist/runtime-trajectory-BvSZcCHD.d.ts.map +1 -0
  230. package/dist/schema-BtVldJ3T.d.ts +206 -0
  231. package/dist/schema-BtVldJ3T.d.ts.map +1 -0
  232. package/dist/schema-C6DW4ZHR.js +821 -0
  233. package/dist/schema-C6DW4ZHR.js.map +1 -0
  234. package/dist/schema-CRhEY1SO.js +69 -0
  235. package/dist/schema-CRhEY1SO.js.map +1 -0
  236. package/dist/schema-Cef2cFmb.d.ts +408 -0
  237. package/dist/schema-Cef2cFmb.d.ts.map +1 -0
  238. package/dist/semantic-concept-judge-B6cWNJ2K.js +725 -0
  239. package/dist/semantic-concept-judge-B6cWNJ2K.js.map +1 -0
  240. package/dist/sequential-Br0mAPHA.js +148 -0
  241. package/dist/sequential-Br0mAPHA.js.map +1 -0
  242. package/dist/sequential-CYwq6Ff_.d.ts +141 -0
  243. package/dist/sequential-CYwq6Ff_.d.ts.map +1 -0
  244. package/dist/series-convergence-CjO2QdRW.js +43 -0
  245. package/dist/series-convergence-CjO2QdRW.js.map +1 -0
  246. package/dist/series-convergence-ofsqPWhs.d.ts +35 -0
  247. package/dist/series-convergence-ofsqPWhs.d.ts.map +1 -0
  248. package/dist/server-m5D9cvnG.js +1040 -0
  249. package/dist/server-m5D9cvnG.js.map +1 -0
  250. package/dist/skill-usage-C_pXm7lP.d.ts +534 -0
  251. package/dist/skill-usage-C_pXm7lP.d.ts.map +1 -0
  252. package/dist/skillopt-optimization-method-B7wX7XkF.d.ts +1739 -0
  253. package/dist/skillopt-optimization-method-B7wX7XkF.d.ts.map +1 -0
  254. package/dist/skillopt-optimization-method-D4ODwFVV.js +7712 -0
  255. package/dist/skillopt-optimization-method-D4ODwFVV.js.map +1 -0
  256. package/dist/statistics-Cmj6nynr.d.ts +514 -0
  257. package/dist/statistics-Cmj6nynr.d.ts.map +1 -0
  258. package/dist/statistics-CnnxdpOg.js +1437 -0
  259. package/dist/statistics-CnnxdpOg.js.map +1 -0
  260. package/dist/store-CT9YIIve.d.ts +117 -0
  261. package/dist/store-CT9YIIve.d.ts.map +1 -0
  262. package/dist/store-CxJry_cs.d.ts +229 -0
  263. package/dist/store-CxJry_cs.d.ts.map +1 -0
  264. package/dist/storyboard/index.d.ts +84 -203
  265. package/dist/storyboard/index.d.ts.map +1 -0
  266. package/dist/storyboard/index.js +609 -542
  267. package/dist/storyboard/index.js.map +1 -1
  268. package/dist/summary-report-BNs5nmXI.js +862 -0
  269. package/dist/summary-report-BNs5nmXI.js.map +1 -0
  270. package/dist/summary-report-Cj9gdw4i.d.ts +407 -0
  271. package/dist/summary-report-Cj9gdw4i.d.ts.map +1 -0
  272. package/dist/supervisor-run/index.d.ts +2 -959
  273. package/dist/supervisor-run/index.js +2 -65
  274. package/dist/supervisor-run-_lnTLM3z.js +1679 -0
  275. package/dist/supervisor-run-_lnTLM3z.js.map +1 -0
  276. package/dist/task-failure-attributes-CQZlB3et.js +311 -0
  277. package/dist/task-failure-attributes-CQZlB3et.js.map +1 -0
  278. package/dist/test-graded-scenario-BsqWLmPt.js +318 -0
  279. package/dist/test-graded-scenario-BsqWLmPt.js.map +1 -0
  280. package/dist/test-graded-scenario-D1TaI2va.d.ts +141 -0
  281. package/dist/test-graded-scenario-D1TaI2va.d.ts.map +1 -0
  282. package/dist/tools-BmuN627J.js +1085 -0
  283. package/dist/tools-BmuN627J.js.map +1 -0
  284. package/dist/trace-attributes.d.ts +2 -52
  285. package/dist/trace-attributes.js +131 -61
  286. package/dist/trace-attributes.js.map +1 -1
  287. package/dist/traces.d.ts +12 -2365
  288. package/dist/traces.js +12 -252
  289. package/dist/trajectory-D_7rLrvE.js +56 -0
  290. package/dist/trajectory-D_7rLrvE.js.map +1 -0
  291. package/dist/types-DGsxbAEd.d.ts +387 -0
  292. package/dist/types-DGsxbAEd.d.ts.map +1 -0
  293. package/dist/types-k9tZGKUg.d.ts +640 -0
  294. package/dist/types-k9tZGKUg.d.ts.map +1 -0
  295. package/dist/verdict-Dps8_okt.d.ts +37 -0
  296. package/dist/verdict-Dps8_okt.d.ts.map +1 -0
  297. package/dist/wire/index.d.ts +702 -1173
  298. package/dist/wire/index.d.ts.map +1 -0
  299. package/dist/wire/index.js +2 -81
  300. package/package.json +17 -9
  301. package/dist/benchmarks/index.js.map +0 -1
  302. package/dist/campaign/index.js.map +0 -1
  303. package/dist/chunk-2QU3YOPR.js +0 -7374
  304. package/dist/chunk-2QU3YOPR.js.map +0 -1
  305. package/dist/chunk-3OCR4R5I.js +0 -728
  306. package/dist/chunk-3OCR4R5I.js.map +0 -1
  307. package/dist/chunk-3RF76KTD.js +0 -84
  308. package/dist/chunk-3RF76KTD.js.map +0 -1
  309. package/dist/chunk-56TAVBOK.js +0 -698
  310. package/dist/chunk-5DTSBUL2.js +0 -159
  311. package/dist/chunk-5DTSBUL2.js.map +0 -1
  312. package/dist/chunk-7FO3TNPI.js +0 -232
  313. package/dist/chunk-7FO3TNPI.js.map +0 -1
  314. package/dist/chunk-7ZZMD7UK.js +0 -386
  315. package/dist/chunk-7ZZMD7UK.js.map +0 -1
  316. package/dist/chunk-BOD4O7OF.js +0 -40
  317. package/dist/chunk-BOD4O7OF.js.map +0 -1
  318. package/dist/chunk-BSO5JDQH.js +0 -2335
  319. package/dist/chunk-BSO5JDQH.js.map +0 -1
  320. package/dist/chunk-C6LXANRU.js +0 -1550
  321. package/dist/chunk-C6LXANRU.js.map +0 -1
  322. package/dist/chunk-DODXQREJ.js +0 -752
  323. package/dist/chunk-DODXQREJ.js.map +0 -1
  324. package/dist/chunk-DRYIUNWY.js +0 -622
  325. package/dist/chunk-DRYIUNWY.js.map +0 -1
  326. package/dist/chunk-E7QXT7SX.js +0 -183
  327. package/dist/chunk-E7QXT7SX.js.map +0 -1
  328. package/dist/chunk-EG66UGL4.js +0 -341
  329. package/dist/chunk-EG66UGL4.js.map +0 -1
  330. package/dist/chunk-FXTVJPYD.js +0 -576
  331. package/dist/chunk-FXTVJPYD.js.map +0 -1
  332. package/dist/chunk-G7MGMCZD.js +0 -153
  333. package/dist/chunk-G7MGMCZD.js.map +0 -1
  334. package/dist/chunk-GGE4NNQT.js +0 -65
  335. package/dist/chunk-GGE4NNQT.js.map +0 -1
  336. package/dist/chunk-H23X7XKK.js +0 -181
  337. package/dist/chunk-H23X7XKK.js.map +0 -1
  338. package/dist/chunk-HHWE3POT.js +0 -94
  339. package/dist/chunk-HHWE3POT.js.map +0 -1
  340. package/dist/chunk-HPWUNB47.js +0 -289
  341. package/dist/chunk-HPWUNB47.js.map +0 -1
  342. package/dist/chunk-IYCLP2N2.js +0 -766
  343. package/dist/chunk-IYCLP2N2.js.map +0 -1
  344. package/dist/chunk-JHCHEVET.js +0 -274
  345. package/dist/chunk-JHCHEVET.js.map +0 -1
  346. package/dist/chunk-JQSF5DQT.js +0 -701
  347. package/dist/chunk-JQSF5DQT.js.map +0 -1
  348. package/dist/chunk-K4DBDHLK.js +0 -158
  349. package/dist/chunk-K4DBDHLK.js.map +0 -1
  350. package/dist/chunk-K6N6XJJX.js +0 -306
  351. package/dist/chunk-K6N6XJJX.js.map +0 -1
  352. package/dist/chunk-M4YBQKIJ.js +0 -1040
  353. package/dist/chunk-M4YBQKIJ.js.map +0 -1
  354. package/dist/chunk-MA6HLL3S.js +0 -65
  355. package/dist/chunk-MA6HLL3S.js.map +0 -1
  356. package/dist/chunk-MAZ26DC7.js +0 -99
  357. package/dist/chunk-MAZ26DC7.js.map +0 -1
  358. package/dist/chunk-NPCTHQIO.js +0 -91
  359. package/dist/chunk-NPCTHQIO.js.map +0 -1
  360. package/dist/chunk-NY44NC4A.js +0 -1056
  361. package/dist/chunk-NY44NC4A.js.map +0 -1
  362. package/dist/chunk-OIUOT4QD.js +0 -44
  363. package/dist/chunk-OIUOT4QD.js.map +0 -1
  364. package/dist/chunk-ONWEPEDO.js +0 -57
  365. package/dist/chunk-ONWEPEDO.js.map +0 -1
  366. package/dist/chunk-OWN5NPMC.js +0 -152
  367. package/dist/chunk-OWN5NPMC.js.map +0 -1
  368. package/dist/chunk-P6FYH6K4.js +0 -1161
  369. package/dist/chunk-P6FYH6K4.js.map +0 -1
  370. package/dist/chunk-PC4UYEBM.js +0 -166
  371. package/dist/chunk-PC4UYEBM.js.map +0 -1
  372. package/dist/chunk-PC5DOSM7.js +0 -579
  373. package/dist/chunk-PC5DOSM7.js.map +0 -1
  374. package/dist/chunk-PXE2VKMX.js +0 -140
  375. package/dist/chunk-PXE2VKMX.js.map +0 -1
  376. package/dist/chunk-PZ5AY32C.js +0 -10
  377. package/dist/chunk-PZ5AY32C.js.map +0 -1
  378. package/dist/chunk-QB6BDBP2.js +0 -4464
  379. package/dist/chunk-QB6BDBP2.js.map +0 -1
  380. package/dist/chunk-RXHCETDZ.js +0 -536
  381. package/dist/chunk-RXHCETDZ.js.map +0 -1
  382. package/dist/chunk-RZTMDUO7.js +0 -49
  383. package/dist/chunk-RZTMDUO7.js.map +0 -1
  384. package/dist/chunk-SFLLL76A.js +0 -669
  385. package/dist/chunk-SFLLL76A.js.map +0 -1
  386. package/dist/chunk-SZLVEKMJ.js +0 -1446
  387. package/dist/chunk-SZLVEKMJ.js.map +0 -1
  388. package/dist/chunk-T4SQEITX.js +0 -95
  389. package/dist/chunk-T4SQEITX.js.map +0 -1
  390. package/dist/chunk-T6RLYGAD.js +0 -158
  391. package/dist/chunk-T6RLYGAD.js.map +0 -1
  392. package/dist/chunk-TJVT4QFF.js +0 -911
  393. package/dist/chunk-TJVT4QFF.js.map +0 -1
  394. package/dist/chunk-TQ7LNKZ3.js +0 -136
  395. package/dist/chunk-TQ7LNKZ3.js.map +0 -1
  396. package/dist/chunk-U4L7JRPZ.js +0 -1706
  397. package/dist/chunk-U4L7JRPZ.js.map +0 -1
  398. package/dist/chunk-U4PHLT2N.js +0 -419
  399. package/dist/chunk-U4PHLT2N.js.map +0 -1
  400. package/dist/chunk-VCZ5FQYW.js +0 -928
  401. package/dist/chunk-VCZ5FQYW.js.map +0 -1
  402. package/dist/chunk-VI2UW6B6.js +0 -162
  403. package/dist/chunk-VI2UW6B6.js.map +0 -1
  404. package/dist/chunk-VQMK5FMP.js +0 -247
  405. package/dist/chunk-VQMK5FMP.js.map +0 -1
  406. package/dist/chunk-WGXIEX7P.js +0 -116
  407. package/dist/chunk-WGXIEX7P.js.map +0 -1
  408. package/dist/chunk-WVATSFCP.js +0 -1553
  409. package/dist/chunk-WVATSFCP.js.map +0 -1
  410. package/dist/chunk-X4YIBDER.js +0 -1662
  411. package/dist/chunk-X4YIBDER.js.map +0 -1
  412. package/dist/chunk-YQN4ICPP.js +0 -355
  413. package/dist/chunk-YQN4ICPP.js.map +0 -1
  414. package/dist/chunk-ZET2UAYW.js +0 -89
  415. package/dist/chunk-ZET2UAYW.js.map +0 -1
  416. package/dist/chunk-ZHTZ4EYI.js +0 -1212
  417. package/dist/chunk-ZHTZ4EYI.js.map +0 -1
  418. package/dist/control.js.map +0 -1
  419. package/dist/hosted/index.js.map +0 -1
  420. package/dist/matrix/index.js.map +0 -1
  421. package/dist/reporting.js.map +0 -1
  422. package/dist/rollout/index.js.map +0 -1
  423. package/dist/run-campaign-OJJ7CZF4.js +0 -18
  424. package/dist/run-campaign-OJJ7CZF4.js.map +0 -1
  425. package/dist/supervisor-run/index.js.map +0 -1
  426. package/dist/traces.js.map +0 -1
  427. package/dist/wire/index.js.map +0 -1
@@ -1,858 +1,111 @@
1
- import { z } from 'zod';
2
- import { OpenAPIObject } from 'openapi3-ts/oas31';
3
- import * as hono_types from 'hono/types';
4
- import { ServerType } from '@hono/node-server';
5
- import { Hono } from 'hono';
6
-
7
- type CostChannel = 'agent' | 'judge' | 'verifier' | 'analyst' | 'driver' | (string & {});
8
- interface CostUsage {
9
- inputTokens: number;
10
- /** Includes reasoning tokens when the provider bills them as output. */
11
- outputTokens: number;
12
- /** Reasoning-token subset of outputTokens, when reported. */
13
- reasoningTokens?: number;
14
- /** Prompt tokens served from a provider cache. */
15
- cachedTokens?: number;
16
- /** Prompt tokens written into a provider cache. */
17
- cacheWriteTokens?: number;
18
- }
19
- interface CostCallBase {
20
- callId: string;
21
- channel: CostChannel;
22
- phase: string;
23
- actor: string;
24
- model: string;
25
- maximumCostUsd?: number;
26
- tags?: Record<string, string>;
27
- timestamp: number;
28
- }
29
- interface PendingCostCall extends CostCallBase {
30
- status: 'pending';
31
- }
32
- interface PendingCostCallView extends PendingCostCall {
33
- state: 'active' | 'late' | 'interrupted';
34
- }
35
- interface CostReceipt extends CostCallBase, CostUsage {
36
- status: 'settled';
37
- costUsd: number;
38
- costUnknown: boolean;
39
- usageUnknown?: boolean;
40
- /** Rates used to estimate cost locally. Absent when cost is provider-reported or unknown. */
41
- pricing?: {
42
- inputUsdPerThousand: number;
43
- cachedInputUsdPerThousand?: number;
44
- cacheWriteUsdPerThousand?: number;
45
- outputUsdPerThousand: number;
46
- };
47
- /** Cost reported by the provider, not a local token-price calculation. */
48
- actualCostUsd?: number;
49
- error?: string;
50
- }
51
- interface CostReceiptInput extends CostUsage {
52
- model: string;
53
- /** Caller-supplied rates for a local estimate when the provider does not report billed cost. */
54
- customTokenPricing?: CustomTokenPricing;
55
- actualCostUsd?: number;
56
- costUnknown?: boolean;
57
- usageUnknown?: boolean;
58
- }
59
- /** Per-million token rates for a model or endpoint not covered by package pricing. */
60
- interface CustomTokenPricing {
61
- /** Non-cached input tokens. */
62
- inputUsdPerMillion: number;
63
- /** Cache-read tokens. Falls back to the normal input rate when omitted. */
64
- cachedInputUsdPerMillion?: number;
65
- /** Cache-creation or cache-write tokens. Falls back to the normal input rate when omitted. */
66
- cacheWriteUsdPerMillion?: number;
67
- outputUsdPerMillion: number;
68
- }
69
- type MaximumCharge = {
70
- externallyEnforcedMaximumUsd: number;
71
- } | ({
72
- customTokenPricing: CustomTokenPricing;
73
- } & Pick<CostUsage, 'inputTokens' | 'outputTokens' | 'cachedTokens' | 'cacheWriteTokens'>) | ({
74
- model: string;
75
- } & CostUsage);
76
- interface RunPaidCallInput<T> {
77
- callId?: string;
78
- channel: CostChannel;
79
- phase: string;
80
- actor: string;
81
- /** Used before a provider receipt exists and on failures without one. */
82
- model?: string;
83
- tags?: Record<string, string>;
84
- signal?: AbortSignal;
85
- /** Provider-enforced dollar maximum, or maximum token usage with known pricing. Required when capped. */
86
- maximumCharge?: MaximumCharge;
87
- /** `callId` can be forwarded as the provider's idempotency key. */
88
- execute(signal: AbortSignal, callId: string): Promise<T>;
89
- receipt(value: T): CostReceiptInput;
90
- receiptFromError?(error: Error): CostReceiptInput | undefined;
91
- }
92
- type PaidCallResult<T> = {
93
- succeeded: true;
94
- callId: string;
95
- value: T;
96
- receipt: CostReceipt;
97
- } | {
98
- succeeded: false;
99
- callId?: string;
100
- error: Error;
101
- receipt?: CostReceipt;
102
- };
103
- interface ChannelRollup {
104
- channel: CostChannel;
105
- calls: number;
106
- inputTokens: number;
107
- outputTokens: number;
108
- reasoningTokens?: number;
109
- cachedTokens: number;
110
- cacheWriteTokens?: number;
111
- costUsd: number;
112
- unpricedCalls: number;
113
- unknownUsageCalls: number;
114
- }
115
- interface CostLedgerSummary {
116
- totalCalls: number;
117
- pendingCalls: number;
118
- unresolvedCalls: number;
119
- reservedCostUsd: number;
120
- inputTokens: number;
121
- outputTokens: number;
122
- reasoningTokens?: number;
123
- cachedTokens: number;
124
- cacheWriteTokens?: number;
125
- totalCostUsd: number;
126
- byChannel: ChannelRollup[];
127
- unpricedModels: string[];
128
- fullyPriced: boolean;
129
- usageComplete: boolean;
130
- accountingComplete: boolean;
131
- incompleteReasons: string[];
132
- }
133
- interface CostLedgerFilter {
134
- channel?: CostChannel;
135
- phase?: string;
136
- tags?: Record<string, string>;
137
- }
138
- interface CostLedgerWaitOptions {
139
- /** Maximum time to wait for active provider calls. Default 5 seconds. */
140
- timeoutMs?: number;
141
- /** Wait only for calls matching this attribution filter. */
142
- filter?: CostLedgerFilter;
143
- }
144
- /** Append-only storage. `append` must atomically reject stale revisions. */
145
- interface CostLedgerPersistence {
146
- read(): {
147
- revision: string;
148
- events: string;
149
- };
150
- append(expectedRevision: string, event: string): string | undefined;
151
- }
152
- interface CostLedgerOptions {
153
- costCeilingUsd?: number;
154
- persistence?: CostLedgerPersistence;
155
- /** Import already-settled receipts without admitting new paid work. */
156
- receipts?: readonly CostReceipt[];
157
- }
158
- /** Run-wide paid-call admission, durable call state, receipts, and summaries. */
159
- declare class CostLedger {
160
- private readonly records;
161
- private readonly activeCallIds;
162
- private readonly lateCallIds;
163
- private readonly idleWaiters;
164
- private completedTasks;
165
- private revision;
166
- private costLimitPersisted;
167
- readonly costCeilingUsd?: number;
168
- private readonly persistence?;
169
- constructor(input?: number | CostLedgerOptions);
170
- runPaidCall<T>(input: RunPaidCallInput<T>): Promise<PaidCallResult<T>>;
171
- /** Wait until every call started by this ledger has produced a durable outcome. */
172
- waitForIdle(options?: CostLedgerWaitOptions): Promise<boolean>;
173
- /** Settle a call left pending by a crashed process after reconciling with the provider. */
174
- reconcile(callId: string, observed: CostReceiptInput, options?: {
175
- error?: string;
176
- }): CostReceipt;
177
- list(filter?: CostLedgerFilter): CostReceipt[];
178
- /** Read pending calls without exposing mutable ledger state. */
179
- listPending(filter?: CostLedgerFilter): PendingCostCallView[];
180
- summary(filter?: CostLedgerFilter): CostLedgerSummary;
181
- markCompleted(count?: number): void;
182
- costPerCompletedTask(): number | null;
183
- private execute;
184
- private captureLateOutcome;
185
- private releaseActiveCall;
186
- private commitOutcome;
187
- private captureFailure;
188
- private commitReceipt;
189
- private resolveMaximum;
190
- private hasIncompleteSettledCall;
191
- private appendRecord;
192
- private ensureCostLimitPersisted;
193
- private appendEvent;
194
- }
195
- /** Public callback surface for a shared cost ledger.
196
- *
197
- * Declaration bundles may expose this type through multiple package subpaths.
198
- * Keeping callback contracts structural lets those subpaths compose while the
199
- * concrete {@link CostLedger} retains its private durable state.
200
- */
201
- type CostLedgerHandle = Pick<CostLedger, Exclude<keyof CostLedger, 'listPending' | 'waitForIdle'>> & Partial<Pick<CostLedger, 'listPending' | 'waitForIdle'>>;
202
-
203
- type RunStatus = 'running' | 'completed' | 'failed' | 'aborted';
204
- interface BudgetSpec {
205
- tokens?: number;
206
- wallMs?: number;
207
- calls?: number;
208
- usd?: number;
209
- }
210
- interface RunOutcome {
211
- score?: number;
212
- pass?: boolean;
213
- failureClass?: FailureClass;
214
- notes?: string;
215
- }
216
- /**
217
- * Layer — optional classification in a nested build workflow.
218
- * `builder`: the meta-agent editing a project (e.g. agent-builder Forge chat).
219
- * `app-build`: sandbox harness that compiled + tested the generated scaffold.
220
- * `app-runtime`: a run of the generated agent against a domain scenario.
221
- * `meta`: any meta-eval (judge replay, correlation analysis).
222
- */
223
- type RunLayer = 'builder' | 'app-build' | 'app-runtime' | 'meta' | 'custom';
224
- interface Run {
225
- runId: string;
226
- /**
227
- * Stable identifier of the scenario being executed.
228
- *
229
- * Always populated on the persisted Run — but `TraceEmitter.startRun` accepts
230
- * input WITHOUT this field, substituting a sensible default
231
- * (`run.layer ?? run.tags?.['kind'] ?? 'runtime'`) when the caller has no
232
- * curated scenario to anchor to (runtime / operator / meta-eval runs). This
233
- * keeps the persisted shape unambiguous for downstream filters + aggregations
234
- * while removing the boilerplate of inventing placeholder ids at the call site.
235
- */
236
- scenarioId: string;
237
- variantId?: string;
238
- datasetVersion?: string;
239
- /** Git SHA of agent code at run time. */
240
- codeSha?: string;
241
- /** Hash of the prompt template + any system prompt. */
242
- promptSha?: string;
243
- /** Model id + date + system-prompt hash, concatenated. */
244
- modelFingerprint?: string;
245
- seed?: number;
246
- /** Arbitrary environment markers (shell, docker version, tz). */
247
- envFingerprint?: Record<string, string>;
248
- /** Version of the redaction rules applied to this run. */
249
- redactionVersion?: string;
250
- /** Parent run in a nested build workflow. A builder run's children are
251
- * app-build runs; those children are app-runtime runs. */
252
- parentRunId?: string;
253
- /** Stable project identifier — groups runs across chats + sessions. */
254
- projectId?: string;
255
- /** Chat/conversation identifier within a project. */
256
- chatId?: string;
257
- /** Layer classification — hint for aggregation; not enforced. */
258
- layer?: RunLayer;
259
- startedAt: number;
260
- endedAt?: number;
261
- status: RunStatus;
262
- outcome?: RunOutcome;
263
- budget?: BudgetSpec;
264
- /** Free-form labels for downstream grouping. */
265
- tags?: Record<string, string>;
266
- }
267
- type SpanKind = 'agent' | 'llm' | 'tool' | 'retrieval' | 'judge' | 'sandbox' | 'custom';
268
- type SpanStatus = 'ok' | 'error';
269
- interface SpanBase {
270
- spanId: string;
271
- parentSpanId?: string;
272
- runId: string;
273
- kind: SpanKind;
274
- name: string;
275
- startedAt: number;
276
- endedAt?: number;
277
- status?: SpanStatus;
278
- error?: string;
279
- /** Anything not covered by typed fields. Kept deliberately free-form. */
280
- attributes?: Record<string, unknown>;
281
- }
282
- interface Message {
283
- role: 'system' | 'user' | 'assistant' | 'tool';
284
- content: string;
285
- tokens?: number;
286
- /** Multi-modal content descriptors; blobs themselves live in Artifacts. */
287
- images?: Array<{
288
- artifactId?: string;
289
- url?: string;
290
- mime?: string;
291
- }>;
292
- }
293
- interface LlmSpan extends SpanBase {
294
- kind: 'llm';
295
- model: string;
296
- messages: Message[];
297
- output?: string;
298
- inputTokens?: number;
299
- /** All generated tokens, including the reasoning subset when present. */
300
- outputTokens?: number;
301
- cachedTokens?: number;
302
- cacheWriteTokens?: number;
303
- /** Reasoning-token subset of `outputTokens`. */
304
- reasoningTokens?: number;
305
- costUsd?: number;
306
- finishReason?: string;
307
- }
308
- interface ToolSpan extends SpanBase {
309
- kind: 'tool';
310
- toolName: string;
311
- args: unknown;
312
- /** False when the source observed the call but did not capture its arguments. */
313
- argsCaptured?: boolean;
314
- result?: unknown;
315
- latencyMs?: number;
316
- }
317
- interface RetrievalSpan extends SpanBase {
318
- kind: 'retrieval';
319
- query: string;
320
- hits: Array<{
321
- docId: string;
322
- score: number;
323
- content?: string;
324
- }>;
325
- }
326
- interface JudgeSpan extends SpanBase {
327
- kind: 'judge';
328
- judgeId: string;
329
- /** Span this judgment applies to. */
330
- targetSpanId: string;
331
- dimension: string;
332
- /** Numeric score (free-range; interpretation up to the judge). */
333
- score: number;
334
- rationale?: string;
335
- evidence?: string;
336
- }
337
- interface SandboxSpan extends SpanBase {
338
- kind: 'sandbox';
339
- image?: string;
340
- command?: string;
341
- exitCode?: number;
342
- testsTotal?: number;
343
- testsPassed?: number;
344
- stdoutHash?: string;
345
- stderrHash?: string;
346
- /** Duration in ms; the harness fills this explicitly (endedAt - startedAt may miss setup). */
347
- wallMs?: number;
348
- }
349
- interface GenericSpan extends SpanBase {
350
- kind: 'agent' | 'custom';
351
- }
352
- type Span = LlmSpan | ToolSpan | RetrievalSpan | JudgeSpan | SandboxSpan | GenericSpan;
353
- type EventKind = 'log' | 'error' | 'budget_decrement' | 'budget_breach' | 'state_mutation' | 'policy_violation' | 'redaction_applied' | 'custom';
354
- interface TraceEvent$1 {
355
- eventId: string;
356
- runId: string;
357
- spanId?: string;
358
- kind: EventKind;
359
- timestamp: number;
360
- payload: Record<string, unknown>;
361
- }
362
- interface BudgetLedgerEntry {
363
- runId: string;
364
- dimension: keyof BudgetSpec;
365
- limit: number;
366
- consumed: number;
367
- remaining: number;
368
- timestamp: number;
369
- breached: boolean;
370
- /** Span that triggered this entry, if any. */
371
- spanId?: string;
372
- }
373
- interface Artifact {
374
- artifactId: string;
375
- runId: string;
376
- spanId?: string;
377
- contentType: string;
378
- sizeBytes: number;
379
- /** sha256 in hex. */
380
- hash: string;
381
- /** External storage URL (R2, S3, filesystem path). */
382
- storageUrl?: string;
383
- /** Inline content for small blobs — keep under ~64KB. */
384
- inlineContent?: string;
385
- }
386
- type FailureClass = 'success' | 'reasoning_error' | 'tool_selection_error' | 'tool_argument_error' | 'tool_recovery_failure' | 'hallucination' | 'instruction_following' | 'safety_refusal_miss' | 'policy_violation' | 'budget_exceeded' | 'format_drift' | 'permission_escalation' | 'pii_leak' | 'cost_overrun' | 'timeout' | 'sandbox_failure' | 'missing_user_data' | 'missing_domain_data' | 'missing_codebase_context' | 'missing_runtime_context' | 'missing_credentials' | 'missing_integration_connection' | 'missing_integration_scope' | 'integration_approval_required' | 'integration_auth_expired' | 'integration_provider_failure' | 'bad_integration_manifest' | 'unsafe_integration_write_denied' | 'stale_external_data' | 'bad_retrieval' | 'insufficient_evidence' | 'contradictory_evidence' | 'ambiguous_user_intent' | 'knowledge_readiness_blocked' | 'unknown';
387
-
388
- interface RunFilter {
389
- scenarioId?: string;
390
- variantId?: string;
391
- status?: RunStatus;
392
- since?: number;
393
- until?: number;
394
- tag?: {
395
- key: string;
396
- value: string;
397
- };
398
- parentRunId?: string;
399
- projectId?: string;
400
- chatId?: string;
401
- layer?: RunLayer;
402
- }
403
- interface SpanFilter {
404
- runId?: string;
405
- parentSpanId?: string;
406
- kind?: SpanKind;
407
- name?: string;
408
- toolName?: string;
409
- judgeId?: string;
410
- since?: number;
411
- until?: number;
412
- }
413
- interface EventFilter {
414
- runId?: string;
415
- spanId?: string;
416
- kind?: EventKind;
417
- since?: number;
418
- until?: number;
419
- }
420
- interface TraceStore {
421
- appendRun(run: Run): Promise<void>;
422
- updateRun(runId: string, patch: Partial<Run>): Promise<void>;
423
- appendSpan(span: Span): Promise<void>;
424
- updateSpan(spanId: string, patch: Partial<Span>): Promise<void>;
425
- appendEvent(event: TraceEvent$1): Promise<void>;
426
- appendArtifact(artifact: Artifact): Promise<void>;
427
- appendBudgetEntry(entry: BudgetLedgerEntry): Promise<void>;
428
- getRun(runId: string): Promise<Run | undefined>;
429
- listRuns(filter?: RunFilter): Promise<Run[]>;
430
- spans(filter?: SpanFilter): Promise<Span[]>;
431
- events(filter?: EventFilter): Promise<TraceEvent$1[]>;
432
- budget(runId: string): Promise<BudgetLedgerEntry[]>;
433
- artifacts(runId: string): Promise<Artifact[]>;
434
- }
435
-
436
- /**
437
- * Policy-based agent control runtime.
438
- *
439
- * This is the minimal reusable loop behind driver-agent patterns:
440
- *
441
- * observe state -> validate -> decide next action -> act -> observe -> ...
442
- *
443
- * It deliberately does not model named "topologies". Direct execution,
444
- * critic/revise, driver intervention, specialist calls, and human escalation
445
- * are all just actions chosen by the control policy.
446
- */
447
-
448
- type ControlSeverity = 'info' | 'warning' | 'error' | 'critical';
449
- interface ControlEvalResult {
450
- /** Stable validator or judge id. */
451
- id: string;
452
- /** Whether this check passed. */
453
- passed: boolean;
454
- /** Optional normalized score. 1 = best, 0 = worst. */
455
- score?: number;
456
- /** Objective validators should usually be "error" or "critical" when failed. */
457
- severity?: ControlSeverity;
458
- /** Human-readable result. */
459
- detail?: string;
460
- /** Small evidence string or pointer. Avoid large payloads. */
461
- evidence?: string;
462
- /** True when the result came from deterministic state, not LLM judgment. */
463
- objective?: boolean;
464
- /** Structured details for downstream control policies and reports. */
465
- metadata?: Record<string, unknown>;
466
- }
467
-
468
- /**
469
- * Dataset — versioned, sliceable, content-hashed scenario collection.
470
- *
471
- * Scenarios stop being ephemeral arrays and become first-class
472
- * artifacts. Every Dataset carries:
473
- * - content hash (sha256 over canonicalized scenario array)
474
- * - provenance (contributor, createdAt, sourceUrl)
475
- * - split labels (train | dev | test | holdout)
476
- * - difficulty tiers (easy | medium | hard | extreme)
477
- * - tags (free-form, per-scenario)
478
- *
479
- * `Dataset.slice({ difficulty, split, holdout, seed })` returns a
480
- * deterministic, reproducible subset. Holdout slices are locked: you
481
- * can read them but `mutate` throws, which prevents "oh I'll just
482
- * tweak that one scenario" contamination drift.
483
- */
484
- type DatasetSplit = 'train' | 'dev' | 'test' | 'holdout';
485
-
486
- type FeedbackArtifactType = 'text' | 'code' | 'plan' | 'research' | 'action' | 'ui' | 'decision' | 'data' | 'other';
487
- type FeedbackLabelSource = 'user' | 'judge' | 'environment' | 'metric' | 'policy' | 'system';
488
- type FeedbackLabelKind = 'approve' | 'reject' | 'select' | 'edit' | 'rank' | 'rate' | 'comment' | 'metric_outcome' | 'policy_block' | 'revision_request';
489
- type FeedbackSeverity = 'info' | 'warning' | 'error' | 'critical';
490
- interface FeedbackTask {
491
- intent: string;
492
- context?: unknown;
493
- }
494
- interface ProposedSideEffect {
495
- type: string;
496
- risk?: 'low' | 'medium' | 'high';
497
- costUsd?: number;
498
- externalSideEffect?: boolean;
499
- requiresApproval?: boolean;
500
- metadata?: Record<string, unknown>;
501
- }
502
- interface FeedbackLabel {
503
- id?: string;
504
- source: FeedbackLabelSource;
505
- kind: FeedbackLabelKind;
506
- value: unknown;
507
- reason?: string;
508
- severity?: FeedbackSeverity;
509
- createdAt: string;
510
- metadata?: Record<string, unknown>;
511
- }
512
- interface FeedbackAttempt {
513
- id: string;
514
- stepIndex: number;
515
- artifactType: FeedbackArtifactType;
516
- artifact: unknown;
517
- options?: unknown[];
518
- proposedAction?: ProposedSideEffect;
519
- evals?: ControlEvalResult[];
520
- feedback?: FeedbackLabel[];
521
- createdAt: string;
522
- metadata?: Record<string, unknown>;
523
- }
524
- interface FeedbackOutcome {
525
- success?: boolean;
526
- score?: number;
527
- metrics?: Record<string, number>;
528
- costUsd?: number;
529
- detail?: string;
530
- observedAt?: string;
531
- metadata?: Record<string, unknown>;
532
- }
533
- interface FeedbackTrajectory$1 {
534
- id: string;
535
- projectId?: string;
536
- scenarioId?: string;
537
- task: FeedbackTask;
538
- attempts: FeedbackAttempt[];
539
- labels: FeedbackLabel[];
540
- outcome?: FeedbackOutcome;
541
- split?: DatasetSplit;
542
- tags?: Record<string, string>;
543
- createdAt: string;
544
- updatedAt?: string;
545
- metadata?: Record<string, unknown>;
546
- }
547
- interface FeedbackTrajectoryStore {
548
- save(trajectory: FeedbackTrajectory$1): Promise<void>;
549
- get(id: string): Promise<FeedbackTrajectory$1 | null>;
550
- list(filter?: FeedbackTrajectoryFilter): Promise<FeedbackTrajectory$1[]>;
551
- appendAttempt(id: string, attempt: FeedbackAttempt): Promise<FeedbackTrajectory$1>;
552
- appendLabel(id: string, label: FeedbackLabel, attemptId?: string): Promise<FeedbackTrajectory$1>;
553
- }
554
- interface FeedbackTrajectoryFilter {
555
- projectId?: string;
556
- scenarioId?: string;
557
- split?: DatasetSplit;
558
- tag?: [string, string];
559
- }
560
-
561
- /**
562
- * RawProviderSink — first-class persistence for the actual HTTP-level
563
- * request/response bodies of every LLM provider call.
564
- *
565
- * Why this is a separate sink from the structured `LlmSpan`:
566
- *
567
- * - `LlmSpan` records the *intent* — model name, messages, output text,
568
- * usage. It's what dashboards read; it's NOT enough for forensics.
569
- * - When a downstream consumer reports "the verifier used the wrong route"
570
- * or "tokens look right but reasoning was missing," the only way to
571
- * answer is the raw HTTP body. Span fields can lie (a proxy can echo
572
- * a different `model` value than what actually answered); the raw
573
- * response is ground truth.
574
- *
575
- * Default behaviour: opt-in. Pass `rawSink` to `LlmClientOptions` (or the
576
- * matrix runner / BuilderSession sets it up automatically) and every
577
- * request, response, and error is recorded — including retries, with the
578
- * attempt index attached so a flaky call's full event chain is recoverable.
579
- *
580
- * Redaction is enforced at sink time. The default redactor strips
581
- * `Authorization`, `X-Api-Key`, `X-Auth-Token`, `Cookie` headers and any
582
- * payload field whose key matches `apiKey | api_key | bearer | password |
583
- * secret | token` (case-insensitive). Override via the sink constructor or
584
- * the per-call `redactor`. The `redactedFields` array on the persisted
585
- * event lets a reviewer see what was stripped without exposing the values.
586
- */
587
- type RawProviderDirection = 'request' | 'response' | 'error';
588
- interface RawProviderEvent {
589
- /** Stable id. Generated by the sink if omitted. */
590
- eventId: string;
591
- /** Trace context populated by `LlmClient` when the call is wrapped in a span. */
592
- runId?: string;
593
- spanId?: string;
594
- /**
595
- * Logical provider name. Free-form so callers can use whatever id matches
596
- * their topology (`'openai'`, `'anthropic'`, `'tangle-router'`, …). When
597
- * omitted, derived from `baseUrl` in `LlmClientOptions`.
598
- */
599
- provider: string;
600
- model: string;
601
- /** Endpoint path, e.g. `'/v1/chat/completions'`. */
602
- endpoint: string;
603
- /** Base URL used for the call (already-normalised — no trailing slash). */
604
- baseUrl: string;
605
- /** 0-indexed retry attempt. The first attempt is 0; a retried call gets 1, 2, … */
606
- attemptIndex: number;
607
- direction: RawProviderDirection;
608
- /** Unix ms. */
609
- timestamp: number;
610
- /** Wall-clock duration of the call leg. Set on `response` and `error` events; null on `request`. */
611
- durationMs?: number;
612
- statusCode?: number;
613
- requestHeaders?: Record<string, string>;
614
- requestBody?: unknown;
615
- responseHeaders?: Record<string, string>;
616
- responseBody?: unknown;
617
- /** Set on `direction: 'error'` events. */
618
- errorMessage?: string;
619
- /** Field paths the redactor stripped from this event ('header:Authorization', 'body.apiKey', …). */
620
- redactedFields: string[];
621
- }
622
- interface RawProviderSinkFilter {
623
- runId?: string;
624
- spanId?: string;
625
- direction?: RawProviderDirection;
626
- attemptIndex?: number;
627
- }
628
- interface RawProviderSink {
629
- record(event: RawProviderEvent): Promise<void>;
630
- /** Optional listing — implementations that durably persist (file, db) should support this. */
631
- list?(filter?: RawProviderSinkFilter): Promise<RawProviderEvent[]>;
632
- /** Optional teardown for backed implementations. */
633
- close?(): Promise<void>;
634
- }
635
- type ProviderRedactor = (event: RawProviderEvent) => RawProviderEvent;
636
-
637
- /**
638
- * LLM client with graceful degrade.
639
- *
640
- * OpenAI-compatible `/v1/chat/completions` client with:
641
- * - Exponential-backoff retry on 429 + 5xx gateway errors (502/503/504).
642
- * - Retry on transient network errors (fetch failed, AbortError, ECONNRESET).
643
- * - One retry at temperature 1 when a model explicitly requires it.
644
- * - Graceful json_schema → json_object degrade on 400 with schema-reject body.
645
- * - Fenced-JSON stripping (```json ... ```) for models that wrap structured output.
646
- * - Configurable base URL + api key / bearer, works with LiteLLM proxies, OpenAI
647
- * directly, cli-bridge subscriptions, and any router that speaks the spec.
648
- *
649
- * Usage:
650
- * const { value, result } = await callLlmJson<MyType>(
651
- * { model: 'gpt-4o', messages: [...], jsonSchema: { name: 'x', schema: {...} } },
652
- * { baseUrl: 'https://router.tangle.tools/v1', apiKey: process.env.KEY },
653
- * )
654
- *
655
- * `createChatClient` wraps this implementation for provider-neutral package
656
- * entry points. Direct callers can use `callLlm` or `callLlmJson`.
657
- */
658
-
659
- type LlmThinkingMode = 'enabled' | 'disabled';
660
- interface LlmClientOptions {
661
- /** Base URL (without trailing slash). Must end at the `/v1` prefix. */
662
- baseUrl?: string;
663
- /** Bearer token — either `apiKey` or `bearer` populates `Authorization: Bearer ...`. */
664
- apiKey?: string;
665
- bearer?: string;
666
- /** Override for the `Authorization` header (e.g. `X-Auth: ...`). Takes precedence over apiKey/bearer. */
667
- authHeader?: {
668
- name: string;
669
- value: string;
670
- };
671
- /** Stable provider idempotency key, reused across retries of this logical call. */
672
- idempotencyKey?: string;
673
- /** Default timeout in ms. Per-call can override. */
674
- defaultTimeoutMs?: number;
675
- /**
676
- * Caller-supplied abort signal — e.g. a campaign-wide cancel. Linked to
677
- * each attempt's per-attempt timeout controller, so aborting it cancels
678
- * the in-flight fetch. A caller abort is FATAL: it is not retried even
679
- * though an AbortError otherwise matches the transient patterns.
680
- */
681
- signal?: AbortSignal;
682
- /**
683
- * Cross-attempt wall-clock budget in ms, measured from the first attempt.
684
- * Before launching each attempt the loop checks the remaining budget and
685
- * stops retrying once it is exhausted, rather than waiting the full
686
- * per-attempt timeout on every retry. Bounds total time independent of
687
- * total attempts × `timeoutMs`.
688
- */
689
- deadlineMs?: number;
690
- /** Total provider attempts. Default 3. */
691
- maximumAttempts?: number;
692
- /** Token rates used when the provider omits cost or package pricing does not cover the model. */
693
- customTokenPricing?: CustomTokenPricing;
694
- /**
695
- * Transport for requests that declare `jsonSchema`. `native` sends
696
- * `response_format: json_schema`; `json-object` sends the broadly supported
697
- * JSON mode and relies on the caller to include the schema in model-visible
698
- * instructions. Default: `native`.
699
- */
700
- jsonSchemaTransport?: 'native' | 'json-object';
701
- /**
702
- * JSON payload parsing policy. `extract` accepts fenced or prose-prefixed JSON.
703
- * `exact` requires the complete response content to be one JSON value.
704
- * Default: `extract`.
705
- */
706
- jsonPayloadMode?: 'extract' | 'exact';
707
- /** Default provider reasoning mode. A per-call request value takes precedence. */
708
- thinking?: LlmThinkingMode;
709
- /** Fetch implementation — defaults to global `fetch`. Override for custom transport (e.g. tests). */
710
- fetch?: typeof fetch;
711
- /**
712
- * Optional raw HTTP capture sink. When provided, every request, response,
713
- * and error (across all retry attempts) is recorded to the sink, with auth
714
- * headers and credential-shaped body fields redacted by default. This is
715
- * the layer-1 forensics primitive: structured `LlmSpan`s record intent,
716
- * raw events record what actually crossed the wire.
717
- */
718
- rawSink?: RawProviderSink;
719
- /**
720
- * Logical provider id attached to raw events. When omitted, derived from
721
- * `baseUrl` via `providerFromBaseUrl`.
722
- */
723
- provider?: string;
724
- /** Trace context attached to raw events; populated by emitter-aware callers. */
725
- traceContext?: {
726
- runId?: string;
727
- spanId?: string;
728
- };
729
- /** Override the redaction strategy for this call. Defaults to `defaultProviderRedactor`. */
730
- redactor?: ProviderRedactor;
731
- }
732
- interface LlmRouteRequirements {
733
- /**
734
- * Throw if `opts.baseUrl` is undefined, i.e. the call would fall back to
735
- * `DEFAULT_BASE_URL`. Set this for evaluation runs where silently using
736
- * the public/free-tier router is a defect — the launch reviewer needs to
737
- * know exactly which provider answered.
738
- */
739
- requireExplicitBaseUrl?: boolean;
740
- /**
741
- * Allowlist of acceptable base URLs. Strings match by prefix
742
- * (case-insensitive); RegExps test against the full base URL.
743
- */
744
- allowedBaseUrls?: Array<string | RegExp>;
745
- /** Blocklist that takes precedence over `allowedBaseUrls`. */
746
- blockedBaseUrls?: Array<string | RegExp>;
747
- /** Throw if no auth header / api key is configured. */
748
- requireAuth?: boolean;
749
- /**
750
- * Logical provider id the configured `baseUrl` is expected to match (via
751
- * `providerFromBaseUrl`). Mainly useful when paired with `requireExplicitBaseUrl`.
752
- */
753
- expectedProvider?: string;
754
- }
755
-
1
+ import { s as TraceStore } from "../store-CT9YIIve.js";
2
+ import { c as CostLedgerHandle } from "../cost-ledger-Dye6jCgg.js";
3
+ import { o as LlmClientOptions, u as LlmRouteRequirements } from "../llm-client-B_nIBlYo.js";
4
+ import { h as FeedbackTrajectoryStore } from "../feedback-trajectory-CVaeREXV.js";
5
+ import { z } from "zod";
6
+ import { ServerType } from "@hono/node-server";
7
+ import { Hono } from "hono";
8
+ //#region src/wire/schemas.d.ts
756
9
  declare const RubricDimensionSchema: z.ZodObject<{
10
+ id: z.ZodString;
11
+ description: z.ZodString;
12
+ weight: z.ZodDefault<z.ZodNumber>;
13
+ min: z.ZodDefault<z.ZodNumber>;
14
+ max: z.ZodDefault<z.ZodNumber>;
15
+ }, z.core.$strip>;
16
+ declare const FailureModeSchema: z.ZodObject<{
17
+ id: z.ZodString;
18
+ description: z.ZodString;
19
+ }, z.core.$strip>;
20
+ declare const RubricSchema: z.ZodObject<{
21
+ name: z.ZodString;
22
+ description: z.ZodString;
23
+ systemPrompt: z.ZodString;
24
+ dimensions: z.ZodArray<z.ZodObject<{
757
25
  id: z.ZodString;
758
26
  description: z.ZodString;
759
27
  weight: z.ZodDefault<z.ZodNumber>;
760
28
  min: z.ZodDefault<z.ZodNumber>;
761
29
  max: z.ZodDefault<z.ZodNumber>;
762
- }, z.core.$strip>;
763
- declare const FailureModeSchema: z.ZodObject<{
30
+ }, z.core.$strip>>;
31
+ failureModes: z.ZodDefault<z.ZodArray<z.ZodObject<{
32
+ id: z.ZodString;
33
+ description: z.ZodString;
34
+ }, z.core.$strip>>>;
35
+ wins: z.ZodDefault<z.ZodArray<z.ZodObject<{
764
36
  id: z.ZodString;
765
37
  description: z.ZodString;
38
+ }, z.core.$strip>>>;
766
39
  }, z.core.$strip>;
767
- declare const RubricSchema: z.ZodObject<{
40
+ declare const JudgeRequestSchema: z.ZodObject<{
41
+ rubricName: z.ZodOptional<z.ZodString>;
42
+ rubric: z.ZodOptional<z.ZodObject<{
768
43
  name: z.ZodString;
769
44
  description: z.ZodString;
770
45
  systemPrompt: z.ZodString;
771
46
  dimensions: z.ZodArray<z.ZodObject<{
772
- id: z.ZodString;
773
- description: z.ZodString;
774
- weight: z.ZodDefault<z.ZodNumber>;
775
- min: z.ZodDefault<z.ZodNumber>;
776
- max: z.ZodDefault<z.ZodNumber>;
47
+ id: z.ZodString;
48
+ description: z.ZodString;
49
+ weight: z.ZodDefault<z.ZodNumber>;
50
+ min: z.ZodDefault<z.ZodNumber>;
51
+ max: z.ZodDefault<z.ZodNumber>;
777
52
  }, z.core.$strip>>;
778
53
  failureModes: z.ZodDefault<z.ZodArray<z.ZodObject<{
779
- id: z.ZodString;
780
- description: z.ZodString;
54
+ id: z.ZodString;
55
+ description: z.ZodString;
781
56
  }, z.core.$strip>>>;
782
57
  wins: z.ZodDefault<z.ZodArray<z.ZodObject<{
783
- id: z.ZodString;
784
- description: z.ZodString;
58
+ id: z.ZodString;
59
+ description: z.ZodString;
785
60
  }, z.core.$strip>>>;
786
- }, z.core.$strip>;
787
- declare const JudgeRequestSchema: z.ZodObject<{
788
- rubricName: z.ZodOptional<z.ZodString>;
789
- rubric: z.ZodOptional<z.ZodObject<{
790
- name: z.ZodString;
791
- description: z.ZodString;
792
- systemPrompt: z.ZodString;
793
- dimensions: z.ZodArray<z.ZodObject<{
794
- id: z.ZodString;
795
- description: z.ZodString;
796
- weight: z.ZodDefault<z.ZodNumber>;
797
- min: z.ZodDefault<z.ZodNumber>;
798
- max: z.ZodDefault<z.ZodNumber>;
799
- }, z.core.$strip>>;
800
- failureModes: z.ZodDefault<z.ZodArray<z.ZodObject<{
801
- id: z.ZodString;
802
- description: z.ZodString;
803
- }, z.core.$strip>>>;
804
- wins: z.ZodDefault<z.ZodArray<z.ZodObject<{
805
- id: z.ZodString;
806
- description: z.ZodString;
807
- }, z.core.$strip>>>;
808
- }, z.core.$strip>>;
809
- content: z.ZodString;
810
- context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
811
- model: z.ZodOptional<z.ZodString>;
61
+ }, z.core.$strip>>;
62
+ content: z.ZodString;
63
+ context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
64
+ model: z.ZodOptional<z.ZodString>;
812
65
  }, z.core.$strip>;
813
66
  declare const JudgeResultSchema: z.ZodObject<{
814
- composite: z.ZodNumber;
815
- dimensions: z.ZodRecord<z.ZodString, z.ZodNumber>;
816
- failureModes: z.ZodDefault<z.ZodArray<z.ZodString>>;
817
- wins: z.ZodDefault<z.ZodArray<z.ZodString>>;
818
- rationale: z.ZodString;
819
- rubricVersion: z.ZodString;
820
- model: z.ZodString;
821
- durationMs: z.ZodNumber;
67
+ composite: z.ZodNumber;
68
+ dimensions: z.ZodRecord<z.ZodString, z.ZodNumber>;
69
+ failureModes: z.ZodDefault<z.ZodArray<z.ZodString>>;
70
+ wins: z.ZodDefault<z.ZodArray<z.ZodString>>;
71
+ rationale: z.ZodString;
72
+ rubricVersion: z.ZodString;
73
+ model: z.ZodString;
74
+ durationMs: z.ZodNumber;
822
75
  }, z.core.$strip>;
823
76
  declare const RubricInfoSchema: z.ZodObject<{
77
+ name: z.ZodString;
78
+ description: z.ZodString;
79
+ dimensions: z.ZodArray<z.ZodObject<{
80
+ id: z.ZodString;
81
+ description: z.ZodString;
82
+ weight: z.ZodNumber;
83
+ }, z.core.$strip>>;
84
+ failureModes: z.ZodDefault<z.ZodArray<z.ZodString>>;
85
+ rubricVersion: z.ZodString;
86
+ }, z.core.$strip>;
87
+ declare const ListRubricsResponseSchema: z.ZodObject<{
88
+ rubrics: z.ZodArray<z.ZodObject<{
824
89
  name: z.ZodString;
825
90
  description: z.ZodString;
826
91
  dimensions: z.ZodArray<z.ZodObject<{
827
- id: z.ZodString;
828
- description: z.ZodString;
829
- weight: z.ZodNumber;
92
+ id: z.ZodString;
93
+ description: z.ZodString;
94
+ weight: z.ZodNumber;
830
95
  }, z.core.$strip>>;
831
96
  failureModes: z.ZodDefault<z.ZodArray<z.ZodString>>;
832
97
  rubricVersion: z.ZodString;
833
- }, z.core.$strip>;
834
- declare const ListRubricsResponseSchema: z.ZodObject<{
835
- rubrics: z.ZodArray<z.ZodObject<{
836
- name: z.ZodString;
837
- description: z.ZodString;
838
- dimensions: z.ZodArray<z.ZodObject<{
839
- id: z.ZodString;
840
- description: z.ZodString;
841
- weight: z.ZodNumber;
842
- }, z.core.$strip>>;
843
- failureModes: z.ZodDefault<z.ZodArray<z.ZodString>>;
844
- rubricVersion: z.ZodString;
845
- }, z.core.$strip>>;
98
+ }, z.core.$strip>>;
846
99
  }, z.core.$strip>;
847
100
  declare const VersionResponseSchema: z.ZodObject<{
848
- package: z.ZodString;
849
- version: z.ZodString;
850
- wireVersion: z.ZodString;
851
- apiSurface: z.ZodArray<z.ZodString>;
101
+ package: z.ZodString;
102
+ version: z.ZodString;
103
+ wireVersion: z.ZodString;
104
+ apiSurface: z.ZodArray<z.ZodString>;
852
105
  }, z.core.$strip>;
853
106
  declare const HealthResponseSchema: z.ZodObject<{
854
- status: z.ZodLiteral<"ok">;
855
- uptimeSec: z.ZodNumber;
107
+ status: z.ZodLiteral<"ok">;
108
+ uptimeSec: z.ZodNumber;
856
109
  }, z.core.$strip>;
857
110
  /**
858
111
  * Minimal `TraceEvent` shape that the production runtime emits.
@@ -861,274 +114,274 @@ declare const HealthResponseSchema: z.ZodObject<{
861
114
  * on internal types.
862
115
  */
863
116
  declare const TraceEventSchema: z.ZodObject<{
117
+ eventId: z.ZodString;
118
+ runId: z.ZodString;
119
+ spanId: z.ZodOptional<z.ZodString>;
120
+ kind: z.ZodEnum<{
121
+ budget_breach: "budget_breach";
122
+ budget_decrement: "budget_decrement";
123
+ custom: "custom";
124
+ error: "error";
125
+ log: "log";
126
+ policy_violation: "policy_violation";
127
+ redaction_applied: "redaction_applied";
128
+ state_mutation: "state_mutation";
129
+ }>;
130
+ timestamp: z.ZodNumber;
131
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
132
+ }, z.core.$strip>;
133
+ declare const TracesIngestRequestSchema: z.ZodObject<{
134
+ events: z.ZodArray<z.ZodObject<{
864
135
  eventId: z.ZodString;
865
136
  runId: z.ZodString;
866
137
  spanId: z.ZodOptional<z.ZodString>;
867
138
  kind: z.ZodEnum<{
868
- error: "error";
869
- custom: "custom";
870
- policy_violation: "policy_violation";
871
- log: "log";
872
- budget_decrement: "budget_decrement";
873
- budget_breach: "budget_breach";
874
- state_mutation: "state_mutation";
875
- redaction_applied: "redaction_applied";
139
+ budget_breach: "budget_breach";
140
+ budget_decrement: "budget_decrement";
141
+ custom: "custom";
142
+ error: "error";
143
+ log: "log";
144
+ policy_violation: "policy_violation";
145
+ redaction_applied: "redaction_applied";
146
+ state_mutation: "state_mutation";
876
147
  }>;
877
148
  timestamp: z.ZodNumber;
878
149
  payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
879
- }, z.core.$strip>;
880
- declare const TracesIngestRequestSchema: z.ZodObject<{
881
- events: z.ZodArray<z.ZodObject<{
882
- eventId: z.ZodString;
883
- runId: z.ZodString;
884
- spanId: z.ZodOptional<z.ZodString>;
885
- kind: z.ZodEnum<{
886
- error: "error";
887
- custom: "custom";
888
- policy_violation: "policy_violation";
889
- log: "log";
890
- budget_decrement: "budget_decrement";
891
- budget_breach: "budget_breach";
892
- state_mutation: "state_mutation";
893
- redaction_applied: "redaction_applied";
894
- }>;
895
- timestamp: z.ZodNumber;
896
- payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
897
- }, z.core.$strip>>;
150
+ }, z.core.$strip>>;
898
151
  }, z.core.$strip>;
899
152
  declare const TracesIngestResponseSchema: z.ZodObject<{
900
- accepted: z.ZodNumber;
901
- rejected: z.ZodNumber;
902
- errors: z.ZodDefault<z.ZodArray<z.ZodObject<{
903
- eventId: z.ZodString;
904
- message: z.ZodString;
905
- }, z.core.$strip>>>;
153
+ accepted: z.ZodNumber;
154
+ rejected: z.ZodNumber;
155
+ errors: z.ZodDefault<z.ZodArray<z.ZodObject<{
156
+ eventId: z.ZodString;
157
+ message: z.ZodString;
158
+ }, z.core.$strip>>>;
906
159
  }, z.core.$strip>;
907
160
  declare const FeedbackLabelSchema: z.ZodObject<{
161
+ id: z.ZodOptional<z.ZodString>;
162
+ source: z.ZodEnum<{
163
+ environment: "environment";
164
+ judge: "judge";
165
+ metric: "metric";
166
+ policy: "policy";
167
+ system: "system";
168
+ user: "user";
169
+ }>;
170
+ kind: z.ZodEnum<{
171
+ approve: "approve";
172
+ comment: "comment";
173
+ edit: "edit";
174
+ metric_outcome: "metric_outcome";
175
+ policy_block: "policy_block";
176
+ rank: "rank";
177
+ rate: "rate";
178
+ reject: "reject";
179
+ revision_request: "revision_request";
180
+ select: "select";
181
+ }>;
182
+ value: z.ZodUnknown;
183
+ reason: z.ZodOptional<z.ZodString>;
184
+ severity: z.ZodOptional<z.ZodEnum<{
185
+ critical: "critical";
186
+ error: "error";
187
+ info: "info";
188
+ warning: "warning";
189
+ }>>;
190
+ createdAt: z.ZodString;
191
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
192
+ }, z.core.$strip>;
193
+ declare const FeedbackAttemptSchema: z.ZodObject<{
194
+ id: z.ZodString;
195
+ stepIndex: z.ZodNumber;
196
+ artifactType: z.ZodEnum<{
197
+ action: "action";
198
+ code: "code";
199
+ data: "data";
200
+ decision: "decision";
201
+ other: "other";
202
+ plan: "plan";
203
+ research: "research";
204
+ text: "text";
205
+ ui: "ui";
206
+ }>;
207
+ artifact: z.ZodUnknown;
208
+ options: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
209
+ proposedAction: z.ZodOptional<z.ZodObject<{
210
+ type: z.ZodString;
211
+ risk: z.ZodOptional<z.ZodEnum<{
212
+ high: "high";
213
+ low: "low";
214
+ medium: "medium";
215
+ }>>;
216
+ costUsd: z.ZodOptional<z.ZodNumber>;
217
+ externalSideEffect: z.ZodOptional<z.ZodBoolean>;
218
+ requiresApproval: z.ZodOptional<z.ZodBoolean>;
219
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
220
+ }, z.core.$strip>>;
221
+ feedback: z.ZodOptional<z.ZodArray<z.ZodObject<{
908
222
  id: z.ZodOptional<z.ZodString>;
909
223
  source: z.ZodEnum<{
910
- judge: "judge";
911
- system: "system";
912
- user: "user";
913
- policy: "policy";
914
- environment: "environment";
915
- metric: "metric";
224
+ environment: "environment";
225
+ judge: "judge";
226
+ metric: "metric";
227
+ policy: "policy";
228
+ system: "system";
229
+ user: "user";
916
230
  }>;
917
231
  kind: z.ZodEnum<{
918
- approve: "approve";
919
- reject: "reject";
920
- select: "select";
921
- edit: "edit";
922
- rank: "rank";
923
- rate: "rate";
924
- comment: "comment";
925
- metric_outcome: "metric_outcome";
926
- policy_block: "policy_block";
927
- revision_request: "revision_request";
232
+ approve: "approve";
233
+ comment: "comment";
234
+ edit: "edit";
235
+ metric_outcome: "metric_outcome";
236
+ policy_block: "policy_block";
237
+ rank: "rank";
238
+ rate: "rate";
239
+ reject: "reject";
240
+ revision_request: "revision_request";
241
+ select: "select";
928
242
  }>;
929
243
  value: z.ZodUnknown;
930
244
  reason: z.ZodOptional<z.ZodString>;
931
245
  severity: z.ZodOptional<z.ZodEnum<{
932
- error: "error";
933
- info: "info";
934
- critical: "critical";
935
- warning: "warning";
246
+ critical: "critical";
247
+ error: "error";
248
+ info: "info";
249
+ warning: "warning";
936
250
  }>>;
937
251
  createdAt: z.ZodString;
938
252
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
253
+ }, z.core.$strip>>>;
254
+ createdAt: z.ZodString;
255
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
939
256
  }, z.core.$strip>;
940
- declare const FeedbackAttemptSchema: z.ZodObject<{
257
+ declare const FeedbackTrajectorySchema: z.ZodObject<{
258
+ id: z.ZodString;
259
+ projectId: z.ZodOptional<z.ZodString>;
260
+ scenarioId: z.ZodOptional<z.ZodString>;
261
+ task: z.ZodObject<{
262
+ intent: z.ZodString;
263
+ context: z.ZodOptional<z.ZodUnknown>;
264
+ }, z.core.$strip>;
265
+ attempts: z.ZodDefault<z.ZodArray<z.ZodObject<{
941
266
  id: z.ZodString;
942
267
  stepIndex: z.ZodNumber;
943
268
  artifactType: z.ZodEnum<{
944
- text: "text";
945
- code: "code";
946
- action: "action";
947
- decision: "decision";
948
- plan: "plan";
949
- research: "research";
950
- ui: "ui";
951
- data: "data";
952
- other: "other";
269
+ action: "action";
270
+ code: "code";
271
+ data: "data";
272
+ decision: "decision";
273
+ other: "other";
274
+ plan: "plan";
275
+ research: "research";
276
+ text: "text";
277
+ ui: "ui";
953
278
  }>;
954
279
  artifact: z.ZodUnknown;
955
280
  options: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
956
281
  proposedAction: z.ZodOptional<z.ZodObject<{
957
- type: z.ZodString;
958
- risk: z.ZodOptional<z.ZodEnum<{
959
- low: "low";
960
- high: "high";
961
- medium: "medium";
962
- }>>;
963
- costUsd: z.ZodOptional<z.ZodNumber>;
964
- externalSideEffect: z.ZodOptional<z.ZodBoolean>;
965
- requiresApproval: z.ZodOptional<z.ZodBoolean>;
966
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
282
+ type: z.ZodString;
283
+ risk: z.ZodOptional<z.ZodEnum<{
284
+ high: "high";
285
+ low: "low";
286
+ medium: "medium";
287
+ }>>;
288
+ costUsd: z.ZodOptional<z.ZodNumber>;
289
+ externalSideEffect: z.ZodOptional<z.ZodBoolean>;
290
+ requiresApproval: z.ZodOptional<z.ZodBoolean>;
291
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
967
292
  }, z.core.$strip>>;
968
293
  feedback: z.ZodOptional<z.ZodArray<z.ZodObject<{
969
- id: z.ZodOptional<z.ZodString>;
970
- source: z.ZodEnum<{
971
- judge: "judge";
972
- system: "system";
973
- user: "user";
974
- policy: "policy";
975
- environment: "environment";
976
- metric: "metric";
977
- }>;
978
- kind: z.ZodEnum<{
979
- approve: "approve";
980
- reject: "reject";
981
- select: "select";
982
- edit: "edit";
983
- rank: "rank";
984
- rate: "rate";
985
- comment: "comment";
986
- metric_outcome: "metric_outcome";
987
- policy_block: "policy_block";
988
- revision_request: "revision_request";
989
- }>;
990
- value: z.ZodUnknown;
991
- reason: z.ZodOptional<z.ZodString>;
992
- severity: z.ZodOptional<z.ZodEnum<{
993
- error: "error";
994
- info: "info";
995
- critical: "critical";
996
- warning: "warning";
997
- }>>;
998
- createdAt: z.ZodString;
999
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
294
+ id: z.ZodOptional<z.ZodString>;
295
+ source: z.ZodEnum<{
296
+ environment: "environment";
297
+ judge: "judge";
298
+ metric: "metric";
299
+ policy: "policy";
300
+ system: "system";
301
+ user: "user";
302
+ }>;
303
+ kind: z.ZodEnum<{
304
+ approve: "approve";
305
+ comment: "comment";
306
+ edit: "edit";
307
+ metric_outcome: "metric_outcome";
308
+ policy_block: "policy_block";
309
+ rank: "rank";
310
+ rate: "rate";
311
+ reject: "reject";
312
+ revision_request: "revision_request";
313
+ select: "select";
314
+ }>;
315
+ value: z.ZodUnknown;
316
+ reason: z.ZodOptional<z.ZodString>;
317
+ severity: z.ZodOptional<z.ZodEnum<{
318
+ critical: "critical";
319
+ error: "error";
320
+ info: "info";
321
+ warning: "warning";
322
+ }>>;
323
+ createdAt: z.ZodString;
324
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1000
325
  }, z.core.$strip>>>;
1001
326
  createdAt: z.ZodString;
1002
327
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1003
- }, z.core.$strip>;
1004
- declare const FeedbackTrajectorySchema: z.ZodObject<{
1005
- id: z.ZodString;
1006
- projectId: z.ZodOptional<z.ZodString>;
1007
- scenarioId: z.ZodOptional<z.ZodString>;
1008
- task: z.ZodObject<{
1009
- intent: z.ZodString;
1010
- context: z.ZodOptional<z.ZodUnknown>;
1011
- }, z.core.$strip>;
1012
- attempts: z.ZodDefault<z.ZodArray<z.ZodObject<{
1013
- id: z.ZodString;
1014
- stepIndex: z.ZodNumber;
1015
- artifactType: z.ZodEnum<{
1016
- text: "text";
1017
- code: "code";
1018
- action: "action";
1019
- decision: "decision";
1020
- plan: "plan";
1021
- research: "research";
1022
- ui: "ui";
1023
- data: "data";
1024
- other: "other";
1025
- }>;
1026
- artifact: z.ZodUnknown;
1027
- options: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
1028
- proposedAction: z.ZodOptional<z.ZodObject<{
1029
- type: z.ZodString;
1030
- risk: z.ZodOptional<z.ZodEnum<{
1031
- low: "low";
1032
- high: "high";
1033
- medium: "medium";
1034
- }>>;
1035
- costUsd: z.ZodOptional<z.ZodNumber>;
1036
- externalSideEffect: z.ZodOptional<z.ZodBoolean>;
1037
- requiresApproval: z.ZodOptional<z.ZodBoolean>;
1038
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1039
- }, z.core.$strip>>;
1040
- feedback: z.ZodOptional<z.ZodArray<z.ZodObject<{
1041
- id: z.ZodOptional<z.ZodString>;
1042
- source: z.ZodEnum<{
1043
- judge: "judge";
1044
- system: "system";
1045
- user: "user";
1046
- policy: "policy";
1047
- environment: "environment";
1048
- metric: "metric";
1049
- }>;
1050
- kind: z.ZodEnum<{
1051
- approve: "approve";
1052
- reject: "reject";
1053
- select: "select";
1054
- edit: "edit";
1055
- rank: "rank";
1056
- rate: "rate";
1057
- comment: "comment";
1058
- metric_outcome: "metric_outcome";
1059
- policy_block: "policy_block";
1060
- revision_request: "revision_request";
1061
- }>;
1062
- value: z.ZodUnknown;
1063
- reason: z.ZodOptional<z.ZodString>;
1064
- severity: z.ZodOptional<z.ZodEnum<{
1065
- error: "error";
1066
- info: "info";
1067
- critical: "critical";
1068
- warning: "warning";
1069
- }>>;
1070
- createdAt: z.ZodString;
1071
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1072
- }, z.core.$strip>>>;
1073
- createdAt: z.ZodString;
1074
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1075
- }, z.core.$strip>>>;
1076
- labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
1077
- id: z.ZodOptional<z.ZodString>;
1078
- source: z.ZodEnum<{
1079
- judge: "judge";
1080
- system: "system";
1081
- user: "user";
1082
- policy: "policy";
1083
- environment: "environment";
1084
- metric: "metric";
1085
- }>;
1086
- kind: z.ZodEnum<{
1087
- approve: "approve";
1088
- reject: "reject";
1089
- select: "select";
1090
- edit: "edit";
1091
- rank: "rank";
1092
- rate: "rate";
1093
- comment: "comment";
1094
- metric_outcome: "metric_outcome";
1095
- policy_block: "policy_block";
1096
- revision_request: "revision_request";
1097
- }>;
1098
- value: z.ZodUnknown;
1099
- reason: z.ZodOptional<z.ZodString>;
1100
- severity: z.ZodOptional<z.ZodEnum<{
1101
- error: "error";
1102
- info: "info";
1103
- critical: "critical";
1104
- warning: "warning";
1105
- }>>;
1106
- createdAt: z.ZodString;
1107
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1108
- }, z.core.$strip>>>;
1109
- outcome: z.ZodOptional<z.ZodObject<{
1110
- success: z.ZodOptional<z.ZodBoolean>;
1111
- score: z.ZodOptional<z.ZodNumber>;
1112
- metrics: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
1113
- costUsd: z.ZodOptional<z.ZodNumber>;
1114
- detail: z.ZodOptional<z.ZodString>;
1115
- observedAt: z.ZodOptional<z.ZodString>;
1116
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1117
- }, z.core.$strip>>;
1118
- split: z.ZodOptional<z.ZodEnum<{
1119
- train: "train";
1120
- dev: "dev";
1121
- test: "test";
1122
- holdout: "holdout";
328
+ }, z.core.$strip>>>;
329
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
330
+ id: z.ZodOptional<z.ZodString>;
331
+ source: z.ZodEnum<{
332
+ environment: "environment";
333
+ judge: "judge";
334
+ metric: "metric";
335
+ policy: "policy";
336
+ system: "system";
337
+ user: "user";
338
+ }>;
339
+ kind: z.ZodEnum<{
340
+ approve: "approve";
341
+ comment: "comment";
342
+ edit: "edit";
343
+ metric_outcome: "metric_outcome";
344
+ policy_block: "policy_block";
345
+ rank: "rank";
346
+ rate: "rate";
347
+ reject: "reject";
348
+ revision_request: "revision_request";
349
+ select: "select";
350
+ }>;
351
+ value: z.ZodUnknown;
352
+ reason: z.ZodOptional<z.ZodString>;
353
+ severity: z.ZodOptional<z.ZodEnum<{
354
+ critical: "critical";
355
+ error: "error";
356
+ info: "info";
357
+ warning: "warning";
1123
358
  }>>;
1124
- tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1125
359
  createdAt: z.ZodString;
1126
- updatedAt: z.ZodOptional<z.ZodString>;
1127
360
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
361
+ }, z.core.$strip>>>;
362
+ outcome: z.ZodOptional<z.ZodObject<{
363
+ success: z.ZodOptional<z.ZodBoolean>;
364
+ score: z.ZodOptional<z.ZodNumber>;
365
+ metrics: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
366
+ costUsd: z.ZodOptional<z.ZodNumber>;
367
+ detail: z.ZodOptional<z.ZodString>;
368
+ observedAt: z.ZodOptional<z.ZodString>;
369
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
370
+ }, z.core.$strip>>;
371
+ split: z.ZodOptional<z.ZodEnum<{
372
+ dev: "dev";
373
+ holdout: "holdout";
374
+ test: "test";
375
+ train: "train";
376
+ }>>;
377
+ tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
378
+ createdAt: z.ZodString;
379
+ updatedAt: z.ZodOptional<z.ZodString>;
380
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1128
381
  }, z.core.$strip>;
1129
382
  declare const FeedbackIngestResponseSchema: z.ZodObject<{
1130
- id: z.ZodString;
1131
- persisted: z.ZodBoolean;
383
+ id: z.ZodString;
384
+ persisted: z.ZodBoolean;
1132
385
  }, z.core.$strip>;
1133
386
  type TraceEvent = z.infer<typeof TraceEventSchema>;
1134
387
  type TracesIngestRequest = z.infer<typeof TracesIngestRequestSchema>;
@@ -1136,11 +389,11 @@ type TracesIngestResponse = z.infer<typeof TracesIngestResponseSchema>;
1136
389
  type FeedbackTrajectory = z.infer<typeof FeedbackTrajectorySchema>;
1137
390
  type FeedbackIngestResponse = z.infer<typeof FeedbackIngestResponseSchema>;
1138
391
  declare const ErrorResponseSchema: z.ZodObject<{
1139
- error: z.ZodObject<{
1140
- code: z.ZodString;
1141
- message: z.ZodString;
1142
- details: z.ZodOptional<z.ZodUnknown>;
1143
- }, z.core.$strip>;
392
+ error: z.ZodObject<{
393
+ code: z.ZodString;
394
+ message: z.ZodString;
395
+ details: z.ZodOptional<z.ZodUnknown>;
396
+ }, z.core.$strip>;
1144
397
  }, z.core.$strip>;
1145
398
  type RubricDimension = z.infer<typeof RubricDimensionSchema>;
1146
399
  type FailureMode = z.infer<typeof FailureModeSchema>;
@@ -1161,33 +414,22 @@ declare const WIRE_VERSION = "1.0.0";
1161
414
  * if the rubricVersion matches, the rubric was identical.
1162
415
  */
1163
416
  declare function hashRubric(rubric: Rubric): string;
1164
-
1165
- /**
1166
- * Pure handler functions — the "business logic" behind every wire-protocol
1167
- * method. The HTTP server (`server.ts`) and the stdio RPC (`rpc.ts`) both
1168
- * call these. Tests call these directly without spinning a server.
1169
- *
1170
- * Each handler:
1171
- * - Takes a parsed request (already Zod-validated by the transport).
1172
- * - Returns a result that matches the response schema.
1173
- * - Throws `WireError` for caller-fixable errors (404, 400, 422).
1174
- * - Lets unexpected errors bubble — the transport maps them to 500.
1175
- */
1176
-
417
+ //#endregion
418
+ //#region src/wire/handlers.d.ts
1177
419
  /** Caller-fixable error. The transport renders this to 4xx + ErrorResponse. */
1178
420
  declare class WireError extends Error {
1179
- readonly code: string;
1180
- readonly status: number;
1181
- readonly details?: unknown | undefined;
1182
- constructor(code: string, message: string, status?: number, details?: unknown | undefined);
421
+ readonly code: string;
422
+ readonly status: number;
423
+ readonly details?: unknown;
424
+ constructor(code: string, message: string, status?: number, details?: unknown);
1183
425
  }
1184
426
  interface HandleJudgeOptions {
1185
- costLedger?: CostLedgerHandle;
1186
- costPhase?: string;
1187
- llm?: LlmClientOptions;
1188
- defaultModel?: string;
1189
- routeRequirements?: LlmRouteRequirements;
1190
- signal?: AbortSignal;
427
+ costLedger?: CostLedgerHandle;
428
+ costPhase?: string;
429
+ llm?: LlmClientOptions;
430
+ defaultModel?: string;
431
+ routeRequirements?: LlmRouteRequirements;
432
+ signal?: AbortSignal;
1191
433
  }
1192
434
  declare function handleJudge(req: JudgeRequest, options?: HandleJudgeOptions): Promise<JudgeResult>;
1193
435
  declare function handleListRubrics(): ListRubricsResponse;
@@ -1201,8 +443,8 @@ declare function handleVersion(): VersionResponse;
1201
443
  * stores.
1202
444
  */
1203
445
  interface IngestionStores {
1204
- traceStore?: TraceStore;
1205
- feedbackStore?: FeedbackTrajectoryStore;
446
+ traceStore?: TraceStore;
447
+ feedbackStore?: FeedbackTrajectoryStore;
1206
448
  }
1207
449
  /**
1208
450
  * `POST /v1/traces/ingest` — accept a batch of `TraceEvent`s from the
@@ -1221,122 +463,408 @@ declare function handleTracesIngest(req: TracesIngestRequest, stores: IngestionS
1221
463
  * replaces the prior record.
1222
464
  */
1223
465
  declare function handleFeedbackIngest(req: FeedbackTrajectory, stores: IngestionStores): Promise<FeedbackIngestResponse>;
1224
-
466
+ //#endregion
467
+ //#region node_modules/.pnpm/openapi3-ts@4.6.0/node_modules/openapi3-ts/dist/model/specification-extension.d.ts
468
+ type IExtensionName = `x-${string}`;
469
+ type IExtensionType = any;
470
+ type ISpecificationExtension = {
471
+ [extensionName: IExtensionName]: IExtensionType;
472
+ };
473
+ //#endregion
474
+ //#region node_modules/.pnpm/openapi3-ts@4.6.0/node_modules/openapi3-ts/dist/model/oas-common.d.ts
475
+ interface ServerObject extends ISpecificationExtension {
476
+ url: string;
477
+ description?: string;
478
+ variables?: {
479
+ [v: string]: ServerVariableObject;
480
+ };
481
+ }
482
+ interface ServerVariableObject extends ISpecificationExtension {
483
+ enum?: string[] | boolean[] | number[];
484
+ default: string | boolean | number;
485
+ description?: string;
486
+ }
487
+ //#endregion
488
+ //#region node_modules/.pnpm/openapi3-ts@4.6.0/node_modules/openapi3-ts/dist/model/openapi31.d.ts
489
+ interface OpenAPIObject extends ISpecificationExtension {
490
+ openapi: string;
491
+ info: InfoObject;
492
+ servers?: ServerObject[];
493
+ paths?: PathsObject;
494
+ components?: ComponentsObject;
495
+ security?: SecurityRequirementObject[];
496
+ tags?: TagObject[];
497
+ externalDocs?: ExternalDocumentationObject;
498
+ webhooks?: PathsObject;
499
+ }
500
+ interface InfoObject extends ISpecificationExtension {
501
+ title: string;
502
+ description?: string;
503
+ termsOfService?: string;
504
+ contact?: ContactObject;
505
+ license?: LicenseObject;
506
+ version: string;
507
+ }
508
+ interface ContactObject extends ISpecificationExtension {
509
+ name?: string;
510
+ url?: string;
511
+ email?: string;
512
+ }
513
+ interface LicenseObject extends ISpecificationExtension {
514
+ name: string;
515
+ identifier?: string;
516
+ url?: string;
517
+ }
518
+ interface ComponentsObject extends ISpecificationExtension {
519
+ schemas?: {
520
+ [schema: string]: SchemaObject | ReferenceObject;
521
+ };
522
+ responses?: {
523
+ [response: string]: ResponseObject | ReferenceObject;
524
+ };
525
+ parameters?: {
526
+ [parameter: string]: ParameterObject | ReferenceObject;
527
+ };
528
+ examples?: {
529
+ [example: string]: ExampleObject | ReferenceObject;
530
+ };
531
+ requestBodies?: {
532
+ [request: string]: RequestBodyObject | ReferenceObject;
533
+ };
534
+ headers?: {
535
+ [header: string]: HeaderObject | ReferenceObject;
536
+ };
537
+ securitySchemes?: {
538
+ [securityScheme: string]: SecuritySchemeObject | ReferenceObject;
539
+ };
540
+ links?: {
541
+ [link: string]: LinkObject | ReferenceObject;
542
+ };
543
+ callbacks?: {
544
+ [callback: string]: CallbackObject | ReferenceObject;
545
+ };
546
+ pathItems?: {
547
+ [pathItem: string]: PathItemObject | ReferenceObject;
548
+ };
549
+ }
550
+ interface PathsObject extends ISpecificationExtension {
551
+ [path: string]: PathItemObject;
552
+ }
553
+ interface PathItemObject extends ISpecificationExtension {
554
+ $ref?: string;
555
+ summary?: string;
556
+ description?: string;
557
+ get?: OperationObject;
558
+ put?: OperationObject;
559
+ post?: OperationObject;
560
+ delete?: OperationObject;
561
+ options?: OperationObject;
562
+ head?: OperationObject;
563
+ patch?: OperationObject;
564
+ trace?: OperationObject;
565
+ servers?: ServerObject[];
566
+ parameters?: (ParameterObject | ReferenceObject)[];
567
+ }
568
+ interface OperationObject extends ISpecificationExtension {
569
+ tags?: string[];
570
+ summary?: string;
571
+ description?: string;
572
+ externalDocs?: ExternalDocumentationObject;
573
+ operationId?: string;
574
+ parameters?: (ParameterObject | ReferenceObject)[];
575
+ requestBody?: RequestBodyObject | ReferenceObject;
576
+ responses?: ResponsesObject;
577
+ callbacks?: CallbacksObject;
578
+ deprecated?: boolean;
579
+ security?: SecurityRequirementObject[];
580
+ servers?: ServerObject[];
581
+ }
582
+ interface ExternalDocumentationObject extends ISpecificationExtension {
583
+ description?: string;
584
+ url: string;
585
+ }
586
+ type ParameterLocation = 'query' | 'header' | 'path' | 'cookie';
587
+ type ParameterStyle = 'matrix' | 'label' | 'form' | 'simple' | 'spaceDelimited' | 'pipeDelimited' | 'deepObject';
588
+ interface BaseParameterObject extends ISpecificationExtension {
589
+ description?: string;
590
+ required?: boolean;
591
+ deprecated?: boolean;
592
+ allowEmptyValue?: boolean;
593
+ style?: ParameterStyle;
594
+ explode?: boolean;
595
+ allowReserved?: boolean;
596
+ schema?: SchemaObject | ReferenceObject;
597
+ examples?: {
598
+ [param: string]: ExampleObject | ReferenceObject;
599
+ };
600
+ example?: any;
601
+ content?: ContentObject;
602
+ }
603
+ interface ParameterObject extends BaseParameterObject {
604
+ name: string;
605
+ in: ParameterLocation;
606
+ }
607
+ interface RequestBodyObject extends ISpecificationExtension {
608
+ description?: string;
609
+ content: ContentObject;
610
+ required?: boolean;
611
+ }
612
+ interface ContentObject {
613
+ [mediatype: string]: MediaTypeObject;
614
+ }
615
+ interface MediaTypeObject extends ISpecificationExtension {
616
+ schema?: SchemaObject | ReferenceObject;
617
+ examples?: ExamplesObject;
618
+ example?: any;
619
+ encoding?: EncodingObject;
620
+ }
621
+ interface EncodingObject extends ISpecificationExtension {
622
+ [property: string]: EncodingPropertyObject | any;
623
+ }
624
+ interface EncodingPropertyObject {
625
+ contentType?: string;
626
+ headers?: {
627
+ [key: string]: HeaderObject | ReferenceObject;
628
+ };
629
+ style?: string;
630
+ explode?: boolean;
631
+ allowReserved?: boolean;
632
+ [key: string]: any;
633
+ }
634
+ interface ResponsesObject extends ISpecificationExtension {
635
+ default?: ResponseObject | ReferenceObject;
636
+ [statuscode: string]: ResponseObject | ReferenceObject | any;
637
+ }
638
+ interface ResponseObject extends ISpecificationExtension {
639
+ description: string;
640
+ headers?: HeadersObject;
641
+ content?: ContentObject;
642
+ links?: LinksObject;
643
+ }
644
+ interface CallbacksObject extends ISpecificationExtension {
645
+ [name: string]: CallbackObject | ReferenceObject | any;
646
+ }
647
+ interface CallbackObject extends ISpecificationExtension {
648
+ [name: string]: PathItemObject | any;
649
+ }
650
+ interface HeadersObject {
651
+ [name: string]: HeaderObject | ReferenceObject;
652
+ }
653
+ interface ExampleObject {
654
+ summary?: string;
655
+ description?: string;
656
+ value?: any;
657
+ externalValue?: string;
658
+ [property: string]: any;
659
+ }
660
+ interface LinksObject {
661
+ [name: string]: LinkObject | ReferenceObject;
662
+ }
663
+ interface LinkObject extends ISpecificationExtension {
664
+ operationRef?: string;
665
+ operationId?: string;
666
+ parameters?: LinkParametersObject;
667
+ requestBody?: any | string;
668
+ description?: string;
669
+ server?: ServerObject;
670
+ [property: string]: any;
671
+ }
672
+ interface LinkParametersObject {
673
+ [name: string]: any | string;
674
+ }
675
+ interface HeaderObject extends BaseParameterObject {
676
+ $ref?: string;
677
+ }
678
+ interface TagObject extends ISpecificationExtension {
679
+ name: string;
680
+ description?: string;
681
+ externalDocs?: ExternalDocumentationObject;
682
+ [extension: string]: any;
683
+ }
684
+ interface ExamplesObject {
685
+ [name: string]: ExampleObject | ReferenceObject;
686
+ }
687
+ interface ReferenceObject {
688
+ $ref: string;
689
+ summary?: string;
690
+ description?: string;
691
+ }
692
+ type SchemaObjectType = 'integer' | 'number' | 'string' | 'boolean' | 'object' | 'null' | 'array';
693
+ interface SchemaObject extends ISpecificationExtension {
694
+ $ref?: string;
695
+ discriminator?: DiscriminatorObject;
696
+ readOnly?: boolean;
697
+ writeOnly?: boolean;
698
+ xml?: XmlObject;
699
+ externalDocs?: ExternalDocumentationObject;
700
+ example?: any;
701
+ examples?: any[];
702
+ deprecated?: boolean;
703
+ type?: SchemaObjectType | SchemaObjectType[];
704
+ format?: 'int32' | 'int64' | 'float' | 'double' | 'byte' | 'binary' | 'date' | 'date-time' | 'password' | string;
705
+ allOf?: (SchemaObject | ReferenceObject)[];
706
+ oneOf?: (SchemaObject | ReferenceObject)[];
707
+ anyOf?: (SchemaObject | ReferenceObject)[];
708
+ not?: SchemaObject | ReferenceObject;
709
+ items?: SchemaObject | ReferenceObject;
710
+ properties?: {
711
+ [propertyName: string]: SchemaObject | ReferenceObject;
712
+ };
713
+ additionalProperties?: SchemaObject | ReferenceObject | boolean;
714
+ propertyNames?: SchemaObject | ReferenceObject;
715
+ description?: string;
716
+ default?: any;
717
+ title?: string;
718
+ multipleOf?: number;
719
+ maximum?: number;
720
+ const?: any;
721
+ exclusiveMaximum?: number;
722
+ minimum?: number;
723
+ exclusiveMinimum?: number;
724
+ maxLength?: number;
725
+ minLength?: number;
726
+ pattern?: string;
727
+ maxItems?: number;
728
+ minItems?: number;
729
+ uniqueItems?: boolean;
730
+ maxProperties?: number;
731
+ minProperties?: number;
732
+ required?: string[];
733
+ enum?: any[];
734
+ prefixItems?: (SchemaObject | ReferenceObject)[];
735
+ contentMediaType?: string;
736
+ contentEncoding?: string;
737
+ }
738
+ interface DiscriminatorObject {
739
+ propertyName: string;
740
+ mapping?: {
741
+ [key: string]: string;
742
+ };
743
+ }
744
+ interface XmlObject extends ISpecificationExtension {
745
+ name?: string;
746
+ namespace?: string;
747
+ prefix?: string;
748
+ attribute?: boolean;
749
+ wrapped?: boolean;
750
+ }
751
+ type SecuritySchemeType = 'apiKey' | 'http' | 'oauth2' | 'openIdConnect';
752
+ interface SecuritySchemeObject extends ISpecificationExtension {
753
+ type: SecuritySchemeType;
754
+ description?: string;
755
+ name?: string;
756
+ in?: string;
757
+ scheme?: string;
758
+ bearerFormat?: string;
759
+ flows?: OAuthFlowsObject;
760
+ openIdConnectUrl?: string;
761
+ }
762
+ interface OAuthFlowsObject extends ISpecificationExtension {
763
+ implicit?: OAuthFlowObject;
764
+ password?: OAuthFlowObject;
765
+ clientCredentials?: OAuthFlowObject;
766
+ authorizationCode?: OAuthFlowObject;
767
+ }
768
+ interface OAuthFlowObject extends ISpecificationExtension {
769
+ authorizationUrl?: string;
770
+ tokenUrl?: string;
771
+ refreshUrl?: string;
772
+ scopes: ScopesObject;
773
+ }
774
+ interface ScopesObject extends ISpecificationExtension {
775
+ [scope: string]: any;
776
+ }
777
+ interface SecurityRequirementObject {
778
+ [name: string]: string[];
779
+ }
780
+ //#endregion
781
+ //#region src/wire/openapi.d.ts
1225
782
  declare function buildOpenApi(packageVersion: string): OpenAPIObject;
1226
-
1227
- /**
1228
- * stdio RPC transport.
1229
- *
1230
- * For batch / cron use without a running server. The Python client falls
1231
- * back to this when no server is reachable.
1232
- *
1233
- * Protocol (line-delimited JSON over stdin/stdout):
1234
- * IN: one JSON object on stdin: {"method":"judge","params":{...}}
1235
- * OUT: one JSON object on stdout: {"result":{...}} or {"error":{...}}
1236
- *
1237
- * One request per process invocation. To pipeline many calls, the client
1238
- * writes JSONL to stdin and reads JSONL from stdout — see batch mode below.
1239
- */
1240
-
783
+ //#endregion
784
+ //#region src/wire/rpc.d.ts
1241
785
  interface RpcRequest {
1242
- method: 'judge' | 'listRubrics' | 'version';
1243
- params?: unknown;
786
+ method: 'judge' | 'listRubrics' | 'version';
787
+ params?: unknown;
1244
788
  }
1245
789
  interface RpcSuccess {
1246
- result: unknown;
790
+ result: unknown;
1247
791
  }
1248
792
  interface RpcError {
1249
- error: {
1250
- code: string;
1251
- message: string;
1252
- details?: unknown;
1253
- };
793
+ error: {
794
+ code: string;
795
+ message: string;
796
+ details?: unknown;
797
+ };
1254
798
  }
1255
799
  interface RpcOptions {
1256
- llm?: LlmClientOptions;
1257
- judgeModel?: string;
1258
- llmRouteRequirements?: LlmRouteRequirements;
800
+ llm?: LlmClientOptions;
801
+ judgeModel?: string;
802
+ llmRouteRequirements?: LlmRouteRequirements;
1259
803
  }
1260
804
  declare function dispatchRpc(req: RpcRequest, options?: RpcOptions): Promise<RpcSuccess | RpcError>;
1261
805
  /** Read one JSON request from stdin, write one JSON response to stdout. */
1262
806
  declare function runRpcOnce(method?: string, options?: RpcOptions): Promise<number>;
1263
807
  /** Read JSONL requests from stdin, write JSONL responses to stdout. */
1264
808
  declare function runRpcBatch(method?: string, options?: RpcOptions): Promise<number>;
1265
-
1266
- /**
1267
- * Built-in rubrics shipped with agent-eval.
1268
- *
1269
- * A rubric is a set of scoring axes plus a system prompt that tells the
1270
- * judging LLM how to grade against those axes. Built-in rubrics are
1271
- * curated for use cases that recur across Tangle projects — call them
1272
- * by name from any client.
1273
- *
1274
- * Adding a rubric:
1275
- * 1. Define the Rubric object below with a clear `description` and
1276
- * named `dimensions`.
1277
- * 2. Register it in `BUILTIN_RUBRICS` at the bottom.
1278
- * 3. Add a test in `tests/wire/rubrics.test.ts`.
1279
- *
1280
- * Custom rubrics: callers pass `rubric` inline to /v1/judge instead of
1281
- * `rubricName` — see schemas.ts.
1282
- */
1283
-
809
+ //#endregion
810
+ //#region src/wire/rubrics.d.ts
1284
811
  declare const BUILTIN_RUBRICS: Record<string, Rubric>;
1285
812
  /** Get a built-in rubric by name, or undefined. */
1286
813
  declare function getBuiltinRubric(name: string): Rubric | undefined;
1287
814
  /** List built-in rubrics with their stable versions. */
1288
815
  declare function listBuiltinRubrics(): {
1289
- name: string;
816
+ name: string;
817
+ description: string;
818
+ dimensions: {
819
+ id: string;
1290
820
  description: string;
1291
- dimensions: {
1292
- id: string;
1293
- description: string;
1294
- weight: number;
1295
- }[];
1296
- failureModes: string[];
1297
- rubricVersion: string;
821
+ weight: number;
822
+ }[];
823
+ failureModes: string[];
824
+ rubricVersion: string;
1298
825
  }[];
1299
-
826
+ //#endregion
827
+ //#region src/wire/server.d.ts
1300
828
  interface CreateAppOptions {
1301
- /** Stores wired to the ingestion endpoints. */
1302
- stores?: IngestionStores;
1303
- /** Model provider used by `/v1/judge`. */
1304
- llm?: LlmClientOptions;
1305
- /** Default judge model when a request does not provide one. */
1306
- judgeModel?: string;
1307
- /** Model route checks applied before every judge call. */
1308
- llmRouteRequirements?: LlmRouteRequirements;
1309
- /**
1310
- * Bearer-token auth. When provided, every endpoint EXCEPT `/healthz`
1311
- * and `/v1/version` requires `Authorization: Bearer <token>`. The
1312
- * token may be a static string OR a function for time-bounded /
1313
- * rotating tokens.
1314
- *
1315
- * Recommended for any server that accepts ingestion writes from the
1316
- * public internet. Read-only deployments may omit it.
1317
- */
1318
- auth?: {
1319
- bearer: string | ((token: string) => boolean | Promise<boolean>);
1320
- };
1321
- }
1322
- declare function createApp(opts?: CreateAppOptions): Hono<hono_types.BlankEnv, hono_types.BlankSchema, "/">;
829
+ /** Stores wired to the ingestion endpoints. */
830
+ stores?: IngestionStores;
831
+ /** Model provider used by `/v1/judge`. */
832
+ llm?: LlmClientOptions;
833
+ /** Default judge model when a request does not provide one. */
834
+ judgeModel?: string;
835
+ /** Model route checks applied before every judge call. */
836
+ llmRouteRequirements?: LlmRouteRequirements;
837
+ /**
838
+ * Bearer-token auth. When provided, every endpoint EXCEPT `/healthz`
839
+ * and `/v1/version` requires `Authorization: Bearer <token>`. The
840
+ * token may be a static string OR a function for time-bounded /
841
+ * rotating tokens.
842
+ *
843
+ * Recommended for any server that accepts ingestion writes from the
844
+ * public internet. Read-only deployments may omit it.
845
+ */
846
+ auth?: {
847
+ bearer: string | ((token: string) => boolean | Promise<boolean>);
848
+ };
849
+ }
850
+ declare function createApp(opts?: CreateAppOptions): Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
1323
851
  interface ServeOptions extends CreateAppOptions {
1324
- /** Default 5005. */
1325
- port?: number;
1326
- /** Default '127.0.0.1'. Set to '0.0.0.0' to listen on all interfaces. */
1327
- host?: string;
852
+ /** Default 5005. */
853
+ port?: number;
854
+ /** Default '127.0.0.1'. Set to '0.0.0.0' to listen on all interfaces. */
855
+ host?: string;
1328
856
  }
1329
857
  declare function startServer(opts?: ServeOptions): ServerType;
1330
858
  interface StartedServer {
1331
- server: ServerType;
1332
- /** The OS-assigned port. When opts.port was 0, this is the actual port the
1333
- * kernel bound — callers that need to dial back (smoke tests, sidecars
1334
- * registering with a parent) read this rather than guessing a free port. */
1335
- port: number;
1336
- /** Resolved host the server bound to (defaults to 127.0.0.1). */
1337
- host: string;
1338
- /** Close the server. Resolves once active connections have drained. */
1339
- close(): Promise<void>;
859
+ server: ServerType;
860
+ /** The OS-assigned port. When opts.port was 0, this is the actual port the
861
+ * kernel bound — callers that need to dial back (smoke tests, sidecars
862
+ * registering with a parent) read this rather than guessing a free port. */
863
+ port: number;
864
+ /** Resolved host the server bound to (defaults to 127.0.0.1). */
865
+ host: string;
866
+ /** Close the server. Resolves once active connections have drained. */
867
+ close(): Promise<void>;
1340
868
  }
1341
869
  /**
1342
870
  * Promise-returning variant of `startServer` that resolves once the server is
@@ -1344,5 +872,6 @@ interface StartedServer {
1344
872
  * (`startServerAsync({ port: 0 })`) and any caller that needs to dial back.
1345
873
  */
1346
874
  declare function startServerAsync(opts?: ServeOptions): Promise<StartedServer>;
1347
-
1348
- export { BUILTIN_RUBRICS, type ErrorResponse, ErrorResponseSchema, type FailureMode, FailureModeSchema, FeedbackAttemptSchema, type FeedbackIngestResponse, FeedbackIngestResponseSchema, FeedbackLabelSchema, type FeedbackTrajectory, FeedbackTrajectorySchema, type HandleJudgeOptions, HealthResponseSchema, type IngestionStores, type JudgeRequest, JudgeRequestSchema, type JudgeResult, JudgeResultSchema, type ListRubricsResponse, ListRubricsResponseSchema, type RpcOptions, type Rubric, type RubricDimension, RubricDimensionSchema, type RubricInfo, RubricInfoSchema, RubricSchema, type ServeOptions, type StartedServer, type TraceEvent, TraceEventSchema, type TracesIngestRequest, TracesIngestRequestSchema, type TracesIngestResponse, TracesIngestResponseSchema, type VersionResponse, VersionResponseSchema, WIRE_VERSION, WireError, buildOpenApi, createApp, dispatchRpc, getBuiltinRubric, handleFeedbackIngest, handleJudge, handleListRubrics, handleTracesIngest, handleVersion, hashRubric, listBuiltinRubrics, runRpcBatch, runRpcOnce, startServer, startServerAsync };
875
+ //#endregion
876
+ export { BUILTIN_RUBRICS, ErrorResponse, ErrorResponseSchema, FailureMode, FailureModeSchema, FeedbackAttemptSchema, FeedbackIngestResponse, FeedbackIngestResponseSchema, FeedbackLabelSchema, FeedbackTrajectory, FeedbackTrajectorySchema, HandleJudgeOptions, HealthResponseSchema, IngestionStores, JudgeRequest, JudgeRequestSchema, JudgeResult, JudgeResultSchema, ListRubricsResponse, ListRubricsResponseSchema, type RpcOptions, Rubric, RubricDimension, RubricDimensionSchema, RubricInfo, RubricInfoSchema, RubricSchema, type ServeOptions, type StartedServer, TraceEvent, TraceEventSchema, TracesIngestRequest, TracesIngestRequestSchema, TracesIngestResponse, TracesIngestResponseSchema, VersionResponse, VersionResponseSchema, WIRE_VERSION, WireError, buildOpenApi, createApp, dispatchRpc, getBuiltinRubric, handleFeedbackIngest, handleJudge, handleListRubrics, handleTracesIngest, handleVersion, hashRubric, listBuiltinRubrics, runRpcBatch, runRpcOnce, startServer, startServerAsync };
877
+ //# sourceMappingURL=index.d.ts.map