niceeval 0.12.2-canary.31 → 0.13.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 (2039) hide show
  1. package/INDEX.md +10 -10
  2. package/README.md +2 -0
  3. package/README.zh.md +2 -0
  4. package/bin/niceeval.js +15 -0
  5. package/dist/agents/claude-code.cjs +9 -1
  6. package/dist/agents/claude-code.cjs.map +1 -1
  7. package/dist/agents/post-setup.cjs +0 -2
  8. package/dist/agents/post-setup.cjs.map +1 -1
  9. package/dist/agents/provisioner.cjs +2 -13
  10. package/dist/agents/provisioner.cjs.map +1 -1
  11. package/dist/agents/provisioner.d.cts +0 -5
  12. package/dist/agents/provisioner.d.mts +0 -5
  13. package/dist/agents/provisioner.d.ts +0 -5
  14. package/dist/agents/provisioner.js +22 -26
  15. package/dist/agents/sdk-streams.cjs +2 -1
  16. package/dist/agents/sdk-streams.cjs.map +1 -1
  17. package/dist/agents/types.cjs.map +1 -1
  18. package/dist/agents/types.d.cts +2 -10
  19. package/dist/agents/types.d.mts +2 -10
  20. package/dist/agents/types.d.ts +2 -10
  21. package/dist/analysis/api.cjs +689 -0
  22. package/dist/analysis/api.cjs.map +1 -0
  23. package/dist/analysis/api.d.cts +126 -0
  24. package/dist/analysis/api.d.mts +126 -0
  25. package/dist/analysis/api.d.ts +126 -0
  26. package/dist/analysis/api.js +24 -0
  27. package/dist/analysis/api.js.map +1 -0
  28. package/dist/analysis/bindings.cjs +617 -0
  29. package/dist/analysis/bindings.cjs.map +1 -0
  30. package/dist/analysis/bindings.d.cts +8313 -0
  31. package/dist/analysis/bindings.d.mts +8313 -0
  32. package/dist/analysis/bindings.d.ts +8313 -0
  33. package/dist/analysis/bindings.js +22 -0
  34. package/dist/analysis/bindings.js.map +1 -0
  35. package/dist/analysis/contracts.cjs +39 -0
  36. package/dist/analysis/contracts.cjs.map +1 -0
  37. package/dist/analysis/contracts.d.cts +293 -0
  38. package/dist/analysis/contracts.d.mts +293 -0
  39. package/dist/analysis/contracts.d.ts +293 -0
  40. package/dist/analysis/contracts.js +12 -0
  41. package/dist/analysis/contracts.js.map +1 -0
  42. package/dist/analysis/cost-decimal.cjs +177 -0
  43. package/dist/analysis/cost-decimal.cjs.map +1 -0
  44. package/dist/analysis/cost-decimal.d.cts +51 -0
  45. package/dist/analysis/cost-decimal.d.mts +51 -0
  46. package/dist/analysis/cost-decimal.d.ts +51 -0
  47. package/dist/analysis/cost-decimal.js +28 -0
  48. package/dist/analysis/cost-decimal.js.map +1 -0
  49. package/dist/analysis/cost-projection.cjs +430 -0
  50. package/dist/analysis/cost-projection.cjs.map +1 -0
  51. package/dist/analysis/cost-projection.d.cts +37 -0
  52. package/dist/analysis/cost-projection.d.mts +37 -0
  53. package/dist/analysis/cost-projection.d.ts +37 -0
  54. package/dist/analysis/cost-projection.js +10 -0
  55. package/dist/analysis/cost-projection.js.map +1 -0
  56. package/dist/analysis/cost.cjs +814 -0
  57. package/dist/analysis/cost.cjs.map +1 -0
  58. package/dist/analysis/cost.d.cts +310 -0
  59. package/dist/analysis/cost.d.mts +310 -0
  60. package/dist/analysis/cost.d.ts +310 -0
  61. package/dist/analysis/cost.js +26 -0
  62. package/dist/analysis/cost.js.map +1 -0
  63. package/dist/analysis/definitions.cjs +346 -0
  64. package/dist/analysis/definitions.cjs.map +1 -0
  65. package/dist/analysis/definitions.d.cts +230 -0
  66. package/dist/analysis/definitions.d.mts +230 -0
  67. package/dist/analysis/definitions.d.ts +230 -0
  68. package/dist/analysis/definitions.js +70 -0
  69. package/dist/analysis/definitions.js.map +1 -0
  70. package/dist/analysis/domain-view.cjs +3 -0
  71. package/dist/analysis/domain-view.cjs.map +1 -0
  72. package/dist/analysis/domain-view.d.cts +367 -0
  73. package/dist/analysis/domain-view.d.mts +367 -0
  74. package/dist/analysis/domain-view.d.ts +367 -0
  75. package/dist/analysis/domain-view.js +4 -0
  76. package/dist/analysis/domain-view.js.map +1 -0
  77. package/dist/analysis/file-changes.cjs +225 -0
  78. package/dist/analysis/file-changes.cjs.map +1 -0
  79. package/dist/analysis/file-changes.d.cts +30 -0
  80. package/dist/analysis/file-changes.d.mts +30 -0
  81. package/dist/analysis/file-changes.d.ts +30 -0
  82. package/dist/analysis/file-changes.js +6 -0
  83. package/dist/analysis/file-changes.js.map +1 -0
  84. package/dist/analysis/host.cjs +8 -0
  85. package/dist/analysis/host.cjs.map +1 -0
  86. package/dist/analysis/host.d.cts +19 -0
  87. package/dist/analysis/host.d.mts +19 -0
  88. package/dist/analysis/host.d.ts +19 -0
  89. package/dist/analysis/host.js +6 -0
  90. package/dist/analysis/host.js.map +1 -0
  91. package/dist/analysis/host.mjs +6 -0
  92. package/dist/analysis/host.mjs.map +1 -0
  93. package/dist/analysis/index.cjs +45 -8
  94. package/dist/analysis/index.cjs.map +1 -1
  95. package/dist/analysis/index.d.cts +10 -2
  96. package/dist/analysis/index.d.mts +10 -2
  97. package/dist/analysis/index.d.ts +10 -2
  98. package/dist/analysis/index.js +70 -6
  99. package/dist/analysis/index.mjs +70 -6
  100. package/dist/assertions/api.cjs.map +1 -1
  101. package/dist/assertions/api.d.cts +1 -1
  102. package/dist/assertions/api.d.mts +1 -1
  103. package/dist/assertions/api.d.ts +1 -1
  104. package/dist/assertions/diff.cjs +2 -2
  105. package/dist/assertions/diff.cjs.map +1 -1
  106. package/dist/assertions/diff.d.cts +2 -2
  107. package/dist/assertions/diff.d.mts +2 -2
  108. package/dist/assertions/diff.d.ts +2 -2
  109. package/dist/assertions/judge.cjs +11 -10
  110. package/dist/assertions/judge.cjs.map +1 -1
  111. package/dist/assertions/record/attachment.cjs +64 -81
  112. package/dist/assertions/record/attachment.cjs.map +1 -1
  113. package/dist/assertions/record/attachment.d.cts +88 -143
  114. package/dist/assertions/record/attachment.d.mts +88 -143
  115. package/dist/assertions/record/attachment.d.ts +88 -143
  116. package/dist/assertions/record/attachment.js +12 -16
  117. package/dist/assertions/record/codec.cjs +178 -100
  118. package/dist/assertions/record/codec.cjs.map +1 -1
  119. package/dist/assertions/record/codec.d.cts +75 -56
  120. package/dist/assertions/record/codec.d.mts +75 -56
  121. package/dist/assertions/record/codec.d.ts +75 -56
  122. package/dist/assertions/record/codec.js +36 -32
  123. package/dist/assertions/record/diff.cjs +545 -134
  124. package/dist/assertions/record/diff.cjs.map +1 -1
  125. package/dist/assertions/record/diff.d.cts +73 -25
  126. package/dist/assertions/record/diff.d.mts +73 -25
  127. package/dist/assertions/record/diff.d.ts +73 -25
  128. package/dist/assertions/record/diff.js +12 -14
  129. package/dist/assertions/record/index.js +70 -72
  130. package/dist/assertions/record/model.cjs.map +1 -1
  131. package/dist/assertions/record/model.d.cts +62 -70
  132. package/dist/assertions/record/model.d.mts +62 -70
  133. package/dist/assertions/record/model.d.ts +62 -70
  134. package/dist/assertions/record/producer.cjs +5 -2
  135. package/dist/assertions/record/producer.cjs.map +1 -1
  136. package/dist/assertions/record/producer.d.cts +18 -18
  137. package/dist/assertions/record/producer.d.mts +18 -18
  138. package/dist/assertions/record/producer.d.ts +18 -18
  139. package/dist/assertions/record/producer.js +2 -2
  140. package/dist/assertions/runtime.cjs +14 -9
  141. package/dist/assertions/runtime.cjs.map +1 -1
  142. package/dist/assertions/workspace-diff.cjs +18 -4
  143. package/dist/assertions/workspace-diff.cjs.map +1 -1
  144. package/dist/assertions/workspace-diff.d.cts +3 -1
  145. package/dist/assertions/workspace-diff.d.mts +3 -1
  146. package/dist/assertions/workspace-diff.d.ts +3 -1
  147. package/dist/assertions/workspace-diff.js +14 -12
  148. package/dist/attempt-locator-resolution.cjs +33 -38
  149. package/dist/attempt-locator-resolution.cjs.map +1 -1
  150. package/dist/attempt-locator-resolution.d.cts +15 -8
  151. package/dist/attempt-locator-resolution.d.mts +15 -8
  152. package/dist/attempt-locator-resolution.d.ts +15 -8
  153. package/dist/cli/record.cjs +16 -89
  154. package/dist/cli/record.cjs.map +1 -1
  155. package/dist/cli/record.d.cts +2 -9
  156. package/dist/cli/record.d.mts +2 -9
  157. package/dist/cli/record.d.ts +2 -9
  158. package/dist/cli/record.js +2 -6
  159. package/dist/cli.cjs +609 -245
  160. package/dist/cli.cjs.map +1 -1
  161. package/dist/cli.d.cts +6 -5
  162. package/dist/cli.d.mts +6 -5
  163. package/dist/cli.d.ts +6 -5
  164. package/dist/context/assert-first.cjs +13 -4
  165. package/dist/context/assert-first.cjs.map +1 -1
  166. package/dist/context/assert-first.d.cts +3 -4
  167. package/dist/context/assert-first.d.mts +3 -4
  168. package/dist/context/assert-first.d.ts +3 -4
  169. package/dist/context/send-retry.cjs +18 -21
  170. package/dist/context/send-retry.cjs.map +1 -1
  171. package/dist/context/send-retry.d.cts +0 -3
  172. package/dist/context/send-retry.d.mts +0 -3
  173. package/dist/context/send-retry.d.ts +0 -3
  174. package/dist/context/session.cjs +46 -42
  175. package/dist/context/session.cjs.map +1 -1
  176. package/dist/context/session.d.cts +4 -6
  177. package/dist/context/session.d.mts +4 -6
  178. package/dist/context/session.d.ts +4 -6
  179. package/dist/coordination/host/index.cjs +10 -0
  180. package/dist/coordination/host/index.cjs.map +1 -0
  181. package/dist/coordination/host/index.d.cts +6 -0
  182. package/dist/coordination/host/index.d.mts +6 -0
  183. package/dist/coordination/host/index.d.ts +6 -0
  184. package/dist/coordination/host/index.js +6 -0
  185. package/dist/coordination/host/index.mjs +6 -0
  186. package/dist/coordination/host/runtime.cjs +57 -0
  187. package/dist/coordination/host/runtime.cjs.map +1 -0
  188. package/dist/coordination/host/runtime.d.cts +13 -0
  189. package/dist/coordination/host/runtime.d.mts +13 -0
  190. package/dist/coordination/host/runtime.d.ts +13 -0
  191. package/dist/coordination/host/runtime.js +8 -0
  192. package/dist/coordination/host/types.cjs.map +1 -0
  193. package/dist/coordination/host/types.d.cts +37 -0
  194. package/dist/coordination/host/types.d.mts +37 -0
  195. package/dist/coordination/host/types.d.ts +37 -0
  196. package/dist/coordination/identity.cjs +48 -0
  197. package/dist/coordination/identity.cjs.map +1 -0
  198. package/dist/coordination/identity.d.cts +14 -0
  199. package/dist/coordination/identity.d.mts +14 -0
  200. package/dist/coordination/identity.d.ts +14 -0
  201. package/dist/coordination/identity.js +6 -0
  202. package/dist/coordination/index.cjs +23 -0
  203. package/dist/coordination/index.cjs.map +1 -0
  204. package/dist/coordination/index.d.cts +6 -0
  205. package/dist/coordination/index.d.mts +6 -0
  206. package/dist/coordination/index.d.ts +6 -0
  207. package/dist/coordination/index.js +16 -0
  208. package/dist/coordination/platform/index.cjs +18 -0
  209. package/dist/coordination/platform/index.cjs.map +1 -0
  210. package/dist/coordination/platform/index.d.cts +1 -0
  211. package/dist/coordination/platform/index.d.mts +1 -0
  212. package/dist/coordination/platform/index.d.ts +1 -0
  213. package/dist/coordination/platform/index.js +6 -0
  214. package/dist/coordination/platform/node.cjs +251 -0
  215. package/dist/coordination/platform/node.cjs.map +1 -0
  216. package/dist/coordination/platform/node.d.cts +3 -0
  217. package/dist/coordination/platform/node.d.mts +3 -0
  218. package/dist/coordination/platform/node.d.ts +3 -0
  219. package/dist/coordination/platform/node.js +6 -0
  220. package/dist/coordination/platform/node.js.map +1 -0
  221. package/dist/coordination/record-leases.cjs +22 -0
  222. package/dist/coordination/record-leases.cjs.map +1 -0
  223. package/dist/coordination/record-leases.d.cts +39 -0
  224. package/dist/coordination/record-leases.d.mts +39 -0
  225. package/dist/coordination/record-leases.d.ts +39 -0
  226. package/dist/coordination/record-leases.js +10 -0
  227. package/dist/coordination/record-leases.js.map +1 -0
  228. package/dist/eval/experiment-id.cjs +1 -5
  229. package/dist/eval/experiment-id.cjs.map +1 -1
  230. package/dist/eval/experiment-id.d.cts +0 -2
  231. package/dist/eval/experiment-id.d.mts +0 -2
  232. package/dist/eval/experiment-id.d.ts +0 -2
  233. package/dist/eval/experiment-id.js +0 -4
  234. package/dist/eval/record/attachment.cjs +7 -47
  235. package/dist/eval/record/attachment.cjs.map +1 -1
  236. package/dist/eval/record/attachment.d.cts +8 -24
  237. package/dist/eval/record/attachment.d.mts +8 -24
  238. package/dist/eval/record/attachment.d.ts +8 -24
  239. package/dist/eval/record/attachment.js +4 -10
  240. package/dist/eval/record/coherence.cjs +6 -6
  241. package/dist/eval/record/coherence.cjs.map +1 -1
  242. package/dist/eval/record/coherence.d.cts +16 -16
  243. package/dist/eval/record/coherence.d.mts +16 -16
  244. package/dist/eval/record/coherence.d.ts +16 -16
  245. package/dist/eval/record/coherence.js +2 -2
  246. package/dist/eval/record/eligibility.cjs +53 -135
  247. package/dist/eval/record/eligibility.cjs.map +1 -1
  248. package/dist/eval/record/eligibility.d.cts +38 -140
  249. package/dist/eval/record/eligibility.d.mts +38 -140
  250. package/dist/eval/record/eligibility.d.ts +38 -140
  251. package/dist/eval/record/eligibility.js +16 -38
  252. package/dist/eval/record/evaluation-plan.cjs +18 -23
  253. package/dist/eval/record/evaluation-plan.cjs.map +1 -1
  254. package/dist/eval/record/evaluation-plan.d.cts +6 -9
  255. package/dist/eval/record/evaluation-plan.d.mts +6 -9
  256. package/dist/eval/record/evaluation-plan.d.ts +6 -9
  257. package/dist/eval/record/evaluation-plan.js +2 -2
  258. package/dist/eval/record/evaluation-record.cjs +161 -454
  259. package/dist/eval/record/evaluation-record.cjs.map +1 -1
  260. package/dist/eval/record/evaluation-record.d.cts +67 -128
  261. package/dist/eval/record/evaluation-record.d.mts +67 -128
  262. package/dist/eval/record/evaluation-record.d.ts +67 -128
  263. package/dist/eval/record/evaluation-record.js +16 -16
  264. package/dist/eval/record/evaluation.cjs +59 -174
  265. package/dist/eval/record/evaluation.cjs.map +1 -1
  266. package/dist/eval/record/evaluation.d.cts +43 -119
  267. package/dist/eval/record/evaluation.d.mts +43 -119
  268. package/dist/eval/record/evaluation.d.ts +43 -119
  269. package/dist/eval/record/evaluation.js +20 -32
  270. package/dist/eval/record/index.js +144 -238
  271. package/dist/eval/record/membership-provenance.cjs +58 -191
  272. package/dist/eval/record/membership-provenance.cjs.map +1 -1
  273. package/dist/eval/record/membership-provenance.d.cts +83 -659
  274. package/dist/eval/record/membership-provenance.d.mts +83 -659
  275. package/dist/eval/record/membership-provenance.d.ts +83 -659
  276. package/dist/eval/record/membership-provenance.js +34 -54
  277. package/dist/eval/record/score.cjs +58 -170
  278. package/dist/eval/record/score.cjs.map +1 -1
  279. package/dist/eval/record/score.d.cts +36 -104
  280. package/dist/eval/record/score.d.mts +36 -104
  281. package/dist/eval/record/score.d.ts +36 -104
  282. package/dist/eval/record/score.js +22 -40
  283. package/dist/eval/record/sealed-assertion.cjs +10 -10
  284. package/dist/eval/record/sealed-assertion.cjs.map +1 -1
  285. package/dist/eval/record/sealed-assertion.d.cts +12 -12
  286. package/dist/eval/record/sealed-assertion.d.mts +12 -12
  287. package/dist/eval/record/sealed-assertion.d.ts +12 -12
  288. package/dist/eval/record/sealed-assertion.js +10 -10
  289. package/dist/eval/record/verdict.cjs +42 -64
  290. package/dist/eval/record/verdict.cjs.map +1 -1
  291. package/dist/eval/record/verdict.d.cts +35 -48
  292. package/dist/eval/record/verdict.d.mts +35 -48
  293. package/dist/eval/record/verdict.d.ts +35 -48
  294. package/dist/eval/record/verdict.js +16 -32
  295. package/dist/experiment/host/index.cjs +210 -0
  296. package/dist/experiment/host/index.cjs.map +1 -0
  297. package/dist/experiment/host/index.d.cts +125 -0
  298. package/dist/experiment/host/index.d.mts +125 -0
  299. package/dist/experiment/host/index.d.ts +125 -0
  300. package/dist/experiment/host/index.js +6 -0
  301. package/dist/experiment/host/index.mjs +6 -0
  302. package/dist/experiment/host/index.mjs.map +1 -0
  303. package/dist/fresh-import.cjs +33 -119
  304. package/dist/fresh-import.cjs.map +1 -1
  305. package/dist/i18n/en.cjs +10 -5
  306. package/dist/i18n/en.cjs.map +1 -1
  307. package/dist/i18n/en.d.cts +9 -4
  308. package/dist/i18n/en.d.mts +9 -4
  309. package/dist/i18n/en.d.ts +9 -4
  310. package/dist/index.cjs +1 -4
  311. package/dist/index.cjs.map +1 -1
  312. package/dist/index.d.cts +0 -2
  313. package/dist/index.d.mts +0 -2
  314. package/dist/index.d.ts +0 -2
  315. package/dist/index.js +18 -20
  316. package/dist/index.mjs +18 -20
  317. package/dist/o11y/cost.cjs +16 -6
  318. package/dist/o11y/cost.cjs.map +1 -1
  319. package/dist/o11y/parsers/bub.cjs +16 -4
  320. package/dist/o11y/parsers/bub.cjs.map +1 -1
  321. package/dist/o11y/parsers/hermes.cjs +19 -6
  322. package/dist/o11y/parsers/hermes.cjs.map +1 -1
  323. package/dist/o11y/parsers/openclaw.cjs +5 -10
  324. package/dist/o11y/parsers/openclaw.cjs.map +1 -1
  325. package/dist/o11y/parsers/opencode.cjs +6 -11
  326. package/dist/o11y/parsers/opencode.cjs.map +1 -1
  327. package/dist/o11y/prices.json +1335 -557
  328. package/dist/o11y/record/capture.cjs +38 -38
  329. package/dist/o11y/record/capture.cjs.map +1 -1
  330. package/dist/o11y/record/capture.d.cts +25 -25
  331. package/dist/o11y/record/capture.d.mts +25 -25
  332. package/dist/o11y/record/capture.d.ts +25 -25
  333. package/dist/o11y/record/capture.js +26 -26
  334. package/dist/o11y/record/codec.cjs +139 -140
  335. package/dist/o11y/record/codec.cjs.map +1 -1
  336. package/dist/o11y/record/codec.d.cts +262 -266
  337. package/dist/o11y/record/codec.d.mts +262 -266
  338. package/dist/o11y/record/codec.d.ts +262 -266
  339. package/dist/o11y/record/codec.js +58 -60
  340. package/dist/o11y/record/errors.cjs +20 -20
  341. package/dist/o11y/record/errors.cjs.map +1 -1
  342. package/dist/o11y/record/errors.d.cts +18 -18
  343. package/dist/o11y/record/errors.d.mts +18 -18
  344. package/dist/o11y/record/errors.d.ts +18 -18
  345. package/dist/o11y/record/errors.js +20 -20
  346. package/dist/o11y/record/families.cjs +269 -264
  347. package/dist/o11y/record/families.cjs.map +1 -1
  348. package/dist/o11y/record/families.d.cts +1589 -1573
  349. package/dist/o11y/record/families.d.mts +1589 -1573
  350. package/dist/o11y/record/families.d.ts +1589 -1573
  351. package/dist/o11y/record/families.js +64 -64
  352. package/dist/o11y/record/family-projectors.cjs +31 -58
  353. package/dist/o11y/record/family-projectors.cjs.map +1 -1
  354. package/dist/o11y/record/family-projectors.d.cts +2933 -34
  355. package/dist/o11y/record/family-projectors.d.mts +2933 -34
  356. package/dist/o11y/record/family-projectors.d.ts +2933 -34
  357. package/dist/o11y/record/family-projectors.js +10 -4
  358. package/dist/o11y/record/family-writers.cjs +207 -336
  359. package/dist/o11y/record/family-writers.cjs.map +1 -1
  360. package/dist/o11y/record/family-writers.d.cts +637 -5260
  361. package/dist/o11y/record/family-writers.d.mts +637 -5260
  362. package/dist/o11y/record/family-writers.d.ts +637 -5260
  363. package/dist/o11y/record/family-writers.js +14 -56
  364. package/dist/o11y/record/index.js +446 -484
  365. package/dist/o11y/record/limits.cjs +45 -45
  366. package/dist/o11y/record/limits.cjs.map +1 -1
  367. package/dist/o11y/record/limits.d.cts +32 -32
  368. package/dist/o11y/record/limits.d.mts +32 -32
  369. package/dist/o11y/record/limits.d.ts +32 -32
  370. package/dist/o11y/record/limits.js +64 -64
  371. package/dist/o11y/record/model.cjs +271 -277
  372. package/dist/o11y/record/model.cjs.map +1 -1
  373. package/dist/o11y/record/model.d.cts +160 -186
  374. package/dist/o11y/record/model.d.mts +160 -186
  375. package/dist/o11y/record/model.d.ts +160 -186
  376. package/dist/o11y/record/model.js +154 -154
  377. package/dist/o11y/record/runner-producer.cjs +649 -520
  378. package/dist/o11y/record/runner-producer.cjs.map +1 -1
  379. package/dist/o11y/record/runner-producer.d.cts +39 -25
  380. package/dist/o11y/record/runner-producer.d.mts +39 -25
  381. package/dist/o11y/record/runner-producer.d.ts +39 -25
  382. package/dist/o11y/record/runner-producer.js +26 -22
  383. package/dist/o11y/record/validation.cjs +75 -75
  384. package/dist/o11y/record/validation.cjs.map +1 -1
  385. package/dist/o11y/record/validation.d.cts +35 -35
  386. package/dist/o11y/record/validation.d.mts +35 -35
  387. package/dist/o11y/record/validation.d.ts +35 -35
  388. package/dist/o11y/record/validation.js +24 -24
  389. package/dist/o11y/types.cjs.map +1 -1
  390. package/dist/o11y/types.d.cts +7 -5
  391. package/dist/o11y/types.d.mts +7 -5
  392. package/dist/o11y/types.d.ts +7 -5
  393. package/dist/plugin/contracts.cjs.map +1 -1
  394. package/dist/plugin/contracts.d.cts +0 -3
  395. package/dist/plugin/contracts.d.mts +0 -3
  396. package/dist/plugin/contracts.d.ts +0 -3
  397. package/dist/plugins/record/attachment.cjs +0 -59
  398. package/dist/plugins/record/attachment.cjs.map +1 -1
  399. package/dist/plugins/record/attachment.d.cts +6 -14
  400. package/dist/plugins/record/attachment.d.mts +6 -14
  401. package/dist/plugins/record/attachment.d.ts +6 -14
  402. package/dist/plugins/record/attachment.js +0 -16
  403. package/dist/plugins/record/capability.cjs +0 -255
  404. package/dist/plugins/record/capability.cjs.map +1 -1
  405. package/dist/plugins/record/capability.d.cts +1 -93
  406. package/dist/plugins/record/capability.d.mts +1 -93
  407. package/dist/plugins/record/capability.d.ts +1 -93
  408. package/dist/plugins/record/capability.js +0 -22
  409. package/dist/plugins/record/codec.cjs +0 -241
  410. package/dist/plugins/record/codec.cjs.map +1 -1
  411. package/dist/plugins/record/codec.d.cts +2 -28
  412. package/dist/plugins/record/codec.d.mts +2 -28
  413. package/dist/plugins/record/codec.d.ts +2 -28
  414. package/dist/plugins/record/codec.js +0 -44
  415. package/dist/plugins/record/index.cjs +0 -51
  416. package/dist/plugins/record/index.cjs.map +1 -1
  417. package/dist/plugins/record/index.d.cts +5 -9
  418. package/dist/plugins/record/index.d.mts +5 -9
  419. package/dist/plugins/record/index.d.ts +5 -9
  420. package/dist/plugins/record/index.js +0 -90
  421. package/dist/plugins/record/migration.cjs +0 -30
  422. package/dist/plugins/record/migration.cjs.map +1 -1
  423. package/dist/plugins/record/migration.d.cts +3 -20
  424. package/dist/plugins/record/migration.d.mts +3 -20
  425. package/dist/plugins/record/migration.d.ts +3 -20
  426. package/dist/plugins/record/migration.js +0 -2
  427. package/dist/plugins/record/model.cjs.map +1 -1
  428. package/dist/plugins/record/model.d.cts +2 -93
  429. package/dist/plugins/record/model.d.mts +2 -93
  430. package/dist/plugins/record/model.d.ts +2 -93
  431. package/dist/plugins/record/provenance.cjs +0 -316
  432. package/dist/plugins/record/provenance.cjs.map +1 -1
  433. package/dist/plugins/record/provenance.d.cts +1 -78
  434. package/dist/plugins/record/provenance.d.mts +1 -78
  435. package/dist/plugins/record/provenance.d.ts +1 -78
  436. package/dist/plugins/record/provenance.js +0 -20
  437. package/dist/record/attachment/blob-policy.cjs +3 -0
  438. package/dist/record/attachment/blob-policy.cjs.map +1 -0
  439. package/dist/record/attachment/blob-policy.d.cts +18 -0
  440. package/dist/record/attachment/blob-policy.d.mts +18 -0
  441. package/dist/record/attachment/blob-policy.d.ts +18 -0
  442. package/dist/record/attachment/blob-policy.js +4 -0
  443. package/dist/record/attachment/blob-policy.js.map +1 -0
  444. package/dist/record/attachment/blob-ref.cjs +42 -0
  445. package/dist/record/attachment/blob-ref.cjs.map +1 -0
  446. package/dist/record/attachment/blob-ref.d.cts +22 -0
  447. package/dist/record/attachment/blob-ref.d.mts +22 -0
  448. package/dist/record/attachment/blob-ref.d.ts +22 -0
  449. package/dist/record/attachment/blob-ref.js +14 -0
  450. package/dist/record/attachment/blob-ref.js.map +1 -0
  451. package/dist/record/attachment/errors.cjs +6 -34
  452. package/dist/record/attachment/errors.cjs.map +1 -1
  453. package/dist/record/attachment/errors.d.cts +2 -24
  454. package/dist/record/attachment/errors.d.mts +2 -24
  455. package/dist/record/attachment/errors.d.ts +2 -24
  456. package/dist/record/attachment/errors.js +4 -10
  457. package/dist/record/attachment/index.cjs +2 -8
  458. package/dist/record/attachment/index.cjs.map +1 -1
  459. package/dist/record/attachment/index.d.cts +3 -3
  460. package/dist/record/attachment/index.d.mts +3 -3
  461. package/dist/record/attachment/index.d.ts +3 -3
  462. package/dist/record/attachment/index.js +6 -18
  463. package/dist/record/attachment/internal.cjs +5 -14
  464. package/dist/record/attachment/internal.cjs.map +1 -1
  465. package/dist/record/attachment/internal.d.cts +3 -2
  466. package/dist/record/attachment/internal.d.mts +3 -2
  467. package/dist/record/attachment/internal.d.ts +3 -2
  468. package/dist/record/attachment/internal.js +12 -30
  469. package/dist/record/attachment/runtime.cjs +155 -745
  470. package/dist/record/attachment/runtime.cjs.map +1 -1
  471. package/dist/record/attachment/runtime.d.cts +25 -68
  472. package/dist/record/attachment/runtime.d.mts +25 -68
  473. package/dist/record/attachment/runtime.d.ts +25 -68
  474. package/dist/record/attachment/runtime.js +16 -48
  475. package/dist/record/attachment/types.cjs +3 -26
  476. package/dist/record/attachment/types.cjs.map +1 -1
  477. package/dist/record/attachment/types.d.cts +33 -132
  478. package/dist/record/attachment/types.d.mts +33 -132
  479. package/dist/record/attachment/types.d.ts +33 -132
  480. package/dist/record/attachment/types.js +10 -22
  481. package/dist/record/codec/core.cjs +102 -85
  482. package/dist/record/codec/core.cjs.map +1 -1
  483. package/dist/record/codec/core.d.cts +205 -55
  484. package/dist/record/codec/core.d.mts +205 -55
  485. package/dist/record/codec/core.d.ts +205 -55
  486. package/dist/record/codec/core.js +50 -42
  487. package/dist/record/codec/identifiers.cjs +24 -2
  488. package/dist/record/codec/identifiers.cjs.map +1 -1
  489. package/dist/record/codec/identifiers.d.cts +11 -2
  490. package/dist/record/codec/identifiers.d.mts +11 -2
  491. package/dist/record/codec/identifiers.d.ts +11 -2
  492. package/dist/record/codec/identifiers.js +36 -18
  493. package/dist/record/codec/index.js +86 -60
  494. package/dist/record/definition/attachment.cjs +108 -0
  495. package/dist/record/definition/attachment.cjs.map +1 -0
  496. package/dist/record/definition/attachment.d.cts +77 -0
  497. package/dist/record/definition/attachment.d.mts +77 -0
  498. package/dist/record/definition/attachment.d.ts +77 -0
  499. package/dist/record/definition/attachment.js +8 -0
  500. package/dist/record/definition/attachment.js.map +1 -0
  501. package/dist/record/definition/canonical.cjs +271 -0
  502. package/dist/record/definition/canonical.cjs.map +1 -0
  503. package/dist/record/definition/canonical.d.cts +38 -0
  504. package/dist/record/definition/canonical.d.mts +38 -0
  505. package/dist/record/definition/canonical.d.ts +38 -0
  506. package/dist/record/definition/canonical.js +10 -0
  507. package/dist/record/definition/canonical.js.map +1 -0
  508. package/dist/record/definition/core.cjs +13 -0
  509. package/dist/record/definition/core.cjs.map +1 -0
  510. package/dist/record/definition/core.d.cts +10 -0
  511. package/dist/record/definition/core.d.mts +10 -0
  512. package/dist/record/definition/core.d.ts +10 -0
  513. package/dist/record/definition/core.js +6 -0
  514. package/dist/record/definition/core.js.map +1 -0
  515. package/dist/record/definition/index.cjs +21 -0
  516. package/dist/record/definition/index.cjs.map +1 -0
  517. package/dist/record/definition/index.d.cts +4 -0
  518. package/dist/record/definition/index.d.mts +4 -0
  519. package/dist/record/definition/index.d.ts +4 -0
  520. package/dist/record/definition/index.js +16 -0
  521. package/dist/record/definition/index.js.map +1 -0
  522. package/dist/record/definition/schema-codec.cjs +347 -0
  523. package/dist/record/definition/schema-codec.cjs.map +1 -0
  524. package/dist/record/definition/schema-codec.d.cts +48 -0
  525. package/dist/record/definition/schema-codec.d.mts +48 -0
  526. package/dist/record/definition/schema-codec.d.ts +48 -0
  527. package/dist/record/definition/schema-codec.js +8 -0
  528. package/dist/record/definition/schema-codec.js.map +1 -0
  529. package/dist/record/errors/record-errors.cjs +2 -2
  530. package/dist/record/errors/record-errors.cjs.map +1 -1
  531. package/dist/record/errors/record-errors.d.cts +2 -2
  532. package/dist/record/errors/record-errors.d.mts +2 -2
  533. package/dist/record/errors/record-errors.d.ts +2 -2
  534. package/dist/record/family/artifacts.cjs +83 -0
  535. package/dist/record/family/artifacts.cjs.map +1 -0
  536. package/dist/record/family/artifacts.d.cts +225 -0
  537. package/dist/record/family/artifacts.d.mts +225 -0
  538. package/dist/record/family/artifacts.d.ts +225 -0
  539. package/dist/record/family/artifacts.js +14 -0
  540. package/dist/record/family/artifacts.js.map +1 -0
  541. package/dist/record/family/assertions.cjs +172 -0
  542. package/dist/record/family/assertions.cjs.map +1 -0
  543. package/dist/record/family/assertions.d.cts +292 -0
  544. package/dist/record/family/assertions.d.mts +292 -0
  545. package/dist/record/family/assertions.d.ts +292 -0
  546. package/dist/record/family/assertions.js +20 -0
  547. package/dist/record/family/assertions.js.map +1 -0
  548. package/dist/record/family/catalog.cjs +91 -0
  549. package/dist/record/family/catalog.cjs.map +1 -0
  550. package/dist/record/family/catalog.d.cts +3653 -0
  551. package/dist/record/family/catalog.d.mts +3653 -0
  552. package/dist/record/family/catalog.d.ts +3653 -0
  553. package/dist/record/family/catalog.js +34 -0
  554. package/dist/record/family/catalog.js.map +1 -0
  555. package/dist/record/family/common.cjs +80 -0
  556. package/dist/record/family/common.cjs.map +1 -0
  557. package/dist/record/family/common.d.cts +44 -0
  558. package/dist/record/family/common.d.mts +44 -0
  559. package/dist/record/family/common.d.ts +44 -0
  560. package/dist/record/family/common.js +28 -0
  561. package/dist/record/family/common.js.map +1 -0
  562. package/dist/record/family/file-changes.cjs +278 -0
  563. package/dist/record/family/file-changes.cjs.map +1 -0
  564. package/dist/record/family/file-changes.d.cts +643 -0
  565. package/dist/record/family/file-changes.d.mts +643 -0
  566. package/dist/record/family/file-changes.d.ts +643 -0
  567. package/dist/record/family/file-changes.js +32 -0
  568. package/dist/record/family/file-changes.js.map +1 -0
  569. package/dist/record/family/index.cjs +24 -0
  570. package/dist/record/family/index.cjs.map +1 -0
  571. package/dist/record/family/index.d.cts +7 -0
  572. package/dist/record/family/index.d.mts +7 -0
  573. package/dist/record/family/index.d.ts +7 -0
  574. package/dist/record/family/index.js +148 -0
  575. package/dist/record/family/index.js.map +1 -0
  576. package/dist/record/family/observability.cjs +511 -0
  577. package/dist/record/family/observability.cjs.map +1 -0
  578. package/dist/record/family/observability.d.cts +2879 -0
  579. package/dist/record/family/observability.d.mts +2879 -0
  580. package/dist/record/family/observability.d.ts +2879 -0
  581. package/dist/record/family/observability.js +30 -0
  582. package/dist/record/family/observability.js.map +1 -0
  583. package/dist/record/family/source-navigation.cjs +215 -0
  584. package/dist/record/family/source-navigation.cjs.map +1 -0
  585. package/dist/record/family/source-navigation.d.cts +330 -0
  586. package/dist/record/family/source-navigation.d.mts +330 -0
  587. package/dist/record/family/source-navigation.d.ts +330 -0
  588. package/dist/record/family/source-navigation.js +24 -0
  589. package/dist/record/family/source-navigation.js.map +1 -0
  590. package/dist/record/family/sources.cjs +82 -0
  591. package/dist/record/family/sources.cjs.map +1 -0
  592. package/dist/record/family/sources.d.cts +81 -0
  593. package/dist/record/family/sources.d.mts +81 -0
  594. package/dist/record/family/sources.d.ts +81 -0
  595. package/dist/record/family/sources.js +14 -0
  596. package/dist/record/family/sources.js.map +1 -0
  597. package/dist/record/host/index.cjs +11 -0
  598. package/dist/record/host/index.cjs.map +1 -0
  599. package/dist/record/host/index.d.cts +7 -0
  600. package/dist/record/host/index.d.mts +7 -0
  601. package/dist/record/host/index.d.ts +7 -0
  602. package/dist/record/host/index.js +6 -0
  603. package/dist/record/host/index.js.map +1 -0
  604. package/dist/record/host/index.mjs +6 -0
  605. package/dist/record/host/index.mjs.map +1 -0
  606. package/dist/record/host/runtime.cjs +1696 -0
  607. package/dist/record/host/runtime.cjs.map +1 -0
  608. package/dist/record/host/runtime.d.cts +2 -0
  609. package/dist/record/host/runtime.d.mts +2 -0
  610. package/dist/record/host/runtime.d.ts +2 -0
  611. package/dist/record/host/runtime.js +6 -0
  612. package/dist/record/host/types.cjs +9 -0
  613. package/dist/record/host/types.cjs.map +1 -0
  614. package/dist/record/host/types.d.cts +259 -0
  615. package/dist/record/host/types.d.mts +259 -0
  616. package/dist/record/host/types.d.ts +259 -0
  617. package/dist/record/host/types.js +14 -0
  618. package/dist/record/host/types.js.map +1 -0
  619. package/dist/record/index.cjs +19 -52
  620. package/dist/record/index.cjs.map +1 -1
  621. package/dist/record/index.d.cts +14 -11
  622. package/dist/record/index.d.mts +14 -11
  623. package/dist/record/index.d.ts +14 -11
  624. package/dist/record/index.js +16 -310
  625. package/dist/record/index.mjs +20 -0
  626. package/dist/record/index.mjs.map +1 -0
  627. package/dist/record/maintenance/runtime.cjs +9 -11
  628. package/dist/record/maintenance/runtime.cjs.map +1 -1
  629. package/dist/record/maintenance/runtime.d.cts +4 -5
  630. package/dist/record/maintenance/runtime.d.mts +4 -5
  631. package/dist/record/maintenance/runtime.d.ts +4 -5
  632. package/dist/record/maintenance/types.cjs.map +1 -1
  633. package/dist/record/maintenance/types.d.cts +7 -8
  634. package/dist/record/maintenance/types.d.mts +7 -8
  635. package/dist/record/maintenance/types.d.ts +7 -8
  636. package/dist/record/migration/index.cjs +2 -25
  637. package/dist/record/migration/index.cjs.map +1 -1
  638. package/dist/record/migration/index.d.cts +11 -8
  639. package/dist/record/migration/index.d.mts +11 -8
  640. package/dist/record/migration/index.d.ts +11 -8
  641. package/dist/record/migration/index.js +2 -44
  642. package/dist/record/model/core.cjs +1 -4
  643. package/dist/record/model/core.cjs.map +1 -1
  644. package/dist/record/model/core.d.cts +59 -39
  645. package/dist/record/model/core.d.mts +59 -39
  646. package/dist/record/model/core.d.ts +59 -39
  647. package/dist/record/model/definition.cjs +147 -0
  648. package/dist/record/model/definition.cjs.map +1 -0
  649. package/dist/record/model/definition.d.cts +463 -0
  650. package/dist/record/model/definition.d.mts +463 -0
  651. package/dist/record/model/definition.d.ts +463 -0
  652. package/dist/record/model/definition.js +40 -0
  653. package/dist/record/model/definition.js.map +1 -0
  654. package/dist/record/model/identifiers.cjs +52 -10
  655. package/dist/record/model/identifiers.cjs.map +1 -1
  656. package/dist/record/model/identifiers.d.cts +44 -3
  657. package/dist/record/model/identifiers.d.mts +44 -3
  658. package/dist/record/model/identifiers.d.ts +44 -3
  659. package/dist/record/model/identifiers.js +62 -36
  660. package/dist/record/model/index.cjs +1 -0
  661. package/dist/record/model/index.cjs.map +1 -1
  662. package/dist/record/model/index.d.cts +1 -0
  663. package/dist/record/model/index.d.mts +1 -0
  664. package/dist/record/model/index.d.ts +1 -0
  665. package/dist/record/model/index.js +86 -48
  666. package/dist/record/model/read-state.cjs.map +1 -1
  667. package/dist/record/model/read-state.d.cts +6 -9
  668. package/dist/record/model/read-state.d.mts +6 -9
  669. package/dist/record/model/read-state.d.ts +6 -9
  670. package/dist/record/model/run-context.cjs +80 -0
  671. package/dist/record/model/run-context.cjs.map +1 -0
  672. package/dist/record/model/run-context.d.cts +30 -0
  673. package/dist/record/model/run-context.d.mts +30 -0
  674. package/dist/record/model/run-context.d.ts +30 -0
  675. package/dist/record/model/run-context.js +14 -0
  676. package/dist/record/model/run-context.js.map +1 -0
  677. package/dist/record/model/validation.cjs +155 -54
  678. package/dist/record/model/validation.cjs.map +1 -1
  679. package/dist/record/model/validation.d.cts +16 -11
  680. package/dist/record/model/validation.d.mts +16 -11
  681. package/dist/record/model/validation.d.ts +16 -11
  682. package/dist/record/model/validation.js +10 -8
  683. package/dist/record/platform/errors.cjs +2 -8
  684. package/dist/record/platform/errors.cjs.map +1 -1
  685. package/dist/record/platform/errors.d.cts +3 -13
  686. package/dist/record/platform/errors.d.mts +3 -13
  687. package/dist/record/platform/errors.d.ts +3 -13
  688. package/dist/record/platform/errors.js +0 -2
  689. package/dist/record/platform/index.js +38 -48
  690. package/dist/record/platform/node.cjs +3 -142
  691. package/dist/record/platform/node.cjs.map +1 -1
  692. package/dist/record/platform/node.d.cts +2 -4
  693. package/dist/record/platform/node.d.mts +2 -4
  694. package/dist/record/platform/node.d.ts +2 -4
  695. package/dist/record/platform/node.js +0 -4
  696. package/dist/record/platform/root.cjs +0 -11
  697. package/dist/record/platform/root.cjs.map +1 -1
  698. package/dist/record/platform/root.d.cts +0 -2
  699. package/dist/record/platform/root.d.mts +0 -2
  700. package/dist/record/platform/root.d.ts +0 -2
  701. package/dist/record/platform/services.cjs +1 -7
  702. package/dist/record/platform/services.cjs.map +1 -1
  703. package/dist/record/platform/services.d.cts +2 -29
  704. package/dist/record/platform/services.d.mts +2 -29
  705. package/dist/record/platform/services.d.ts +2 -29
  706. package/dist/record/platform/services.js +2 -6
  707. package/dist/record/reader/errors.cjs.map +1 -1
  708. package/dist/record/reader/errors.d.cts +3 -2
  709. package/dist/record/reader/errors.d.mts +3 -2
  710. package/dist/record/reader/errors.d.ts +3 -2
  711. package/dist/record/reader/format.cjs +26 -40
  712. package/dist/record/reader/format.cjs.map +1 -1
  713. package/dist/record/reader/format.d.cts +6 -7
  714. package/dist/record/reader/format.d.mts +6 -7
  715. package/dist/record/reader/format.d.ts +6 -7
  716. package/dist/record/reader/index.js +22 -30
  717. package/dist/record/reader/runtime.cjs +112 -636
  718. package/dist/record/reader/runtime.cjs.map +1 -1
  719. package/dist/record/reader/runtime.d.cts +43 -12
  720. package/dist/record/reader/runtime.d.mts +43 -12
  721. package/dist/record/reader/runtime.d.ts +43 -12
  722. package/dist/record/reader/runtime.js +6 -10
  723. package/dist/record/reader/types.cjs +3 -6
  724. package/dist/record/reader/types.cjs.map +1 -1
  725. package/dist/record/reader/types.d.cts +3 -42
  726. package/dist/record/reader/types.d.mts +3 -42
  727. package/dist/record/reader/types.d.ts +3 -42
  728. package/dist/record/reader/types.js +0 -4
  729. package/dist/record/writer/errors.cjs +7 -0
  730. package/dist/record/writer/errors.cjs.map +1 -1
  731. package/dist/record/writer/errors.d.cts +5 -0
  732. package/dist/record/writer/errors.d.mts +5 -0
  733. package/dist/record/writer/errors.d.ts +5 -0
  734. package/dist/record/writer/errors.js +6 -4
  735. package/dist/record/writer/index.cjs +0 -1
  736. package/dist/record/writer/index.cjs.map +1 -1
  737. package/dist/record/writer/index.d.cts +0 -1
  738. package/dist/record/writer/index.d.mts +0 -1
  739. package/dist/record/writer/index.d.ts +0 -1
  740. package/dist/record/writer/index.js +10 -10
  741. package/dist/record/writer/types.cjs.map +1 -1
  742. package/dist/record/writer/types.d.cts +12 -17
  743. package/dist/record/writer/types.d.mts +12 -17
  744. package/dist/record/writer/types.d.ts +12 -17
  745. package/dist/report/assets/colors.cjs +70 -0
  746. package/dist/report/assets/colors.cjs.map +1 -0
  747. package/dist/report/assets/colors.d.cts +22 -0
  748. package/dist/report/assets/colors.d.mts +22 -0
  749. package/dist/report/assets/colors.d.ts +22 -0
  750. package/dist/report/assets/colors.js +18 -0
  751. package/dist/report/assets/colors.js.map +1 -0
  752. package/dist/report/assets/enhance.js +466 -0
  753. package/dist/report/assets/series-encoding.cjs +116 -0
  754. package/dist/report/assets/series-encoding.cjs.map +1 -0
  755. package/dist/report/assets/series-encoding.d.cts +36 -0
  756. package/dist/report/assets/series-encoding.d.mts +36 -0
  757. package/dist/report/assets/series-encoding.d.ts +36 -0
  758. package/dist/report/assets/series-encoding.js +22 -0
  759. package/dist/report/assets/series-encoding.js.map +1 -0
  760. package/dist/report/assets/styles.css +2678 -0
  761. package/dist/report/built-in/analysis-values.cjs +28 -0
  762. package/dist/report/built-in/analysis-values.cjs.map +1 -0
  763. package/dist/report/built-in/analysis-values.d.cts +41 -0
  764. package/dist/report/built-in/analysis-values.d.mts +41 -0
  765. package/dist/report/built-in/analysis-values.d.ts +41 -0
  766. package/dist/report/built-in/analysis-values.js +10 -0
  767. package/dist/report/built-in/analysis-values.js.map +1 -0
  768. package/dist/report/built-in/attempt-overview.cjs +62 -384
  769. package/dist/report/built-in/attempt-overview.cjs.map +1 -1
  770. package/dist/report/built-in/attempt-overview.d.cts +4 -8
  771. package/dist/report/built-in/attempt-overview.d.mts +4 -8
  772. package/dist/report/built-in/attempt-overview.d.ts +4 -8
  773. package/dist/report/built-in/execution.cjs +40 -747
  774. package/dist/report/built-in/execution.cjs.map +1 -1
  775. package/dist/report/built-in/execution.d.cts +10 -19
  776. package/dist/report/built-in/execution.d.mts +10 -19
  777. package/dist/report/built-in/execution.d.ts +10 -19
  778. package/dist/report/built-in/index.cjs +15 -28
  779. package/dist/report/built-in/index.cjs.map +1 -1
  780. package/dist/report/built-in/index.d.cts +4 -6
  781. package/dist/report/built-in/index.d.mts +4 -6
  782. package/dist/report/built-in/index.d.ts +4 -6
  783. package/dist/report/built-in/index.js +22 -31
  784. package/dist/report/built-in/index.mjs +22 -31
  785. package/dist/report/built-in/machine.cjs +41 -0
  786. package/dist/report/built-in/machine.cjs.map +1 -0
  787. package/dist/report/built-in/machine.d.cts +29 -0
  788. package/dist/report/built-in/machine.d.mts +29 -0
  789. package/dist/report/built-in/machine.d.ts +29 -0
  790. package/dist/report/built-in/machine.js +8 -0
  791. package/dist/report/built-in/machine.js.map +1 -0
  792. package/dist/report/built-in/overview.cjs +38 -200
  793. package/dist/report/built-in/overview.cjs.map +1 -1
  794. package/dist/report/built-in/overview.d.cts +5 -5
  795. package/dist/report/built-in/overview.d.mts +5 -5
  796. package/dist/report/built-in/overview.d.ts +5 -5
  797. package/dist/report/built-in/overview.js +0 -2
  798. package/dist/report/built-in/result-components.cjs +325 -0
  799. package/dist/report/built-in/result-components.cjs.map +1 -0
  800. package/dist/report/built-in/result-components.d.cts +94 -0
  801. package/dist/report/built-in/result-components.d.mts +94 -0
  802. package/dist/report/built-in/result-components.d.ts +94 -0
  803. package/dist/report/built-in/result-components.js +24 -0
  804. package/dist/report/built-in/result-components.js.map +1 -0
  805. package/dist/report/built-in/run-membership-overview.cjs +48 -184
  806. package/dist/report/built-in/run-membership-overview.cjs.map +1 -1
  807. package/dist/report/built-in/run-membership-overview.d.cts +5 -5
  808. package/dist/report/built-in/run-membership-overview.d.mts +5 -5
  809. package/dist/report/built-in/run-membership-overview.d.ts +5 -5
  810. package/dist/report/built-in/sandbox-history.cjs +31 -372
  811. package/dist/report/built-in/sandbox-history.cjs.map +1 -1
  812. package/dist/report/built-in/sandbox-history.d.cts +5 -8
  813. package/dist/report/built-in/sandbox-history.d.mts +5 -8
  814. package/dist/report/built-in/sandbox-history.d.ts +5 -8
  815. package/dist/report/built-in/source.cjs +40 -150
  816. package/dist/report/built-in/source.cjs.map +1 -1
  817. package/dist/report/built-in/source.d.cts +10 -11
  818. package/dist/report/built-in/source.d.mts +10 -11
  819. package/dist/report/built-in/source.d.ts +10 -11
  820. package/dist/report/built-in/source.js +1 -0
  821. package/dist/report/built-in/standard.cjs +135 -0
  822. package/dist/report/built-in/standard.cjs.map +1 -0
  823. package/dist/report/built-in/standard.d.cts +91 -0
  824. package/dist/report/built-in/standard.d.mts +91 -0
  825. package/dist/report/built-in/standard.d.ts +91 -0
  826. package/dist/report/built-in/standard.js +17 -0
  827. package/dist/report/built-in/standard.js.map +1 -0
  828. package/dist/report/components/attempt-detail/compute.cjs +763 -0
  829. package/dist/report/components/attempt-detail/compute.cjs.map +1 -0
  830. package/dist/report/components/attempt-detail/compute.d.cts +370 -0
  831. package/dist/report/components/attempt-detail/compute.d.mts +370 -0
  832. package/dist/report/components/attempt-detail/compute.d.ts +370 -0
  833. package/dist/report/components/attempt-detail/compute.js +46 -0
  834. package/dist/report/components/attempt-detail/compute.js.map +1 -0
  835. package/dist/report/components/attempt-detail/content.cjs +411 -0
  836. package/dist/report/components/attempt-detail/content.cjs.map +1 -0
  837. package/dist/report/components/attempt-detail/content.d.cts +34 -0
  838. package/dist/report/components/attempt-detail/content.d.mts +34 -0
  839. package/dist/report/components/attempt-detail/content.d.ts +34 -0
  840. package/dist/report/components/attempt-detail/content.js +30 -0
  841. package/dist/report/components/attempt-detail/content.js.map +1 -0
  842. package/dist/report/components/attempt-detail/index.cjs +314 -0
  843. package/dist/report/components/attempt-detail/index.cjs.map +1 -0
  844. package/dist/report/components/attempt-detail/index.d.cts +27 -0
  845. package/dist/report/components/attempt-detail/index.d.mts +27 -0
  846. package/dist/report/components/attempt-detail/index.d.ts +27 -0
  847. package/dist/report/components/attempt-detail/index.js +34 -0
  848. package/dist/report/components/attempt-detail/index.js.map +1 -0
  849. package/dist/report/components/attempt-detail/validate.cjs +497 -0
  850. package/dist/report/components/attempt-detail/validate.cjs.map +1 -0
  851. package/dist/report/components/attempt-detail/validate.d.cts +14 -0
  852. package/dist/report/components/attempt-detail/validate.d.mts +14 -0
  853. package/dist/report/components/attempt-detail/validate.d.ts +14 -0
  854. package/dist/report/components/attempt-detail/validate.js +30 -0
  855. package/dist/report/components/attempt-detail/validate.js.map +1 -0
  856. package/dist/report/components/entity-lists/compute.cjs +426 -0
  857. package/dist/report/components/entity-lists/compute.cjs.map +1 -0
  858. package/dist/report/components/entity-lists/compute.d.cts +107 -0
  859. package/dist/report/components/entity-lists/compute.d.mts +107 -0
  860. package/dist/report/components/entity-lists/compute.d.ts +107 -0
  861. package/dist/report/components/entity-lists/compute.js +12 -0
  862. package/dist/report/components/entity-lists/compute.js.map +1 -0
  863. package/dist/report/components/entity-lists/content.cjs +275 -0
  864. package/dist/report/components/entity-lists/content.cjs.map +1 -0
  865. package/dist/report/components/entity-lists/content.d.cts +4 -0
  866. package/dist/report/components/entity-lists/content.d.mts +4 -0
  867. package/dist/report/components/entity-lists/content.d.ts +4 -0
  868. package/dist/report/components/entity-lists/content.js +8 -0
  869. package/dist/report/components/entity-lists/content.js.map +1 -0
  870. package/dist/report/components/entity-lists/index.cjs +48 -0
  871. package/dist/report/components/entity-lists/index.cjs.map +1 -0
  872. package/dist/report/components/entity-lists/index.d.cts +39 -0
  873. package/dist/report/components/entity-lists/index.d.mts +39 -0
  874. package/dist/report/components/entity-lists/index.d.ts +39 -0
  875. package/dist/report/components/entity-lists/index.js +22 -0
  876. package/dist/report/components/entity-lists/index.js.map +1 -0
  877. package/dist/report/components/experiment-detail/compute.cjs +228 -0
  878. package/dist/report/components/experiment-detail/compute.cjs.map +1 -0
  879. package/dist/report/components/experiment-detail/compute.d.cts +72 -0
  880. package/dist/report/components/experiment-detail/compute.d.mts +72 -0
  881. package/dist/report/components/experiment-detail/compute.d.ts +72 -0
  882. package/dist/report/components/experiment-detail/compute.js +6 -0
  883. package/dist/report/components/experiment-detail/compute.js.map +1 -0
  884. package/dist/report/components/experiment-detail/index.cjs +84 -0
  885. package/dist/report/components/experiment-detail/index.cjs.map +1 -0
  886. package/dist/report/components/experiment-detail/index.d.cts +13 -0
  887. package/dist/report/components/experiment-detail/index.d.mts +13 -0
  888. package/dist/report/components/experiment-detail/index.d.ts +13 -0
  889. package/dist/report/components/experiment-detail/index.js +6 -0
  890. package/dist/report/components/experiment-detail/index.js.map +1 -0
  891. package/dist/report/components/site-components/HeroCard.cjs +38 -0
  892. package/dist/report/components/site-components/HeroCard.cjs.map +1 -0
  893. package/dist/report/components/site-components/HeroCard.d.cts +14 -0
  894. package/dist/report/components/site-components/HeroCard.d.mts +14 -0
  895. package/dist/report/components/site-components/HeroCard.d.ts +14 -0
  896. package/dist/report/components/site-components/HeroCard.js +6 -0
  897. package/dist/report/components/site-components/HeroCard.js.map +1 -0
  898. package/dist/report/components/site-components/PoweredBy.cjs +12 -0
  899. package/dist/report/components/site-components/PoweredBy.cjs.map +1 -0
  900. package/dist/report/components/site-components/PoweredBy.d.cts +5 -0
  901. package/dist/report/components/site-components/PoweredBy.d.mts +5 -0
  902. package/dist/report/components/site-components/PoweredBy.d.ts +5 -0
  903. package/dist/report/components/site-components/PoweredBy.js +8 -0
  904. package/dist/report/components/site-components/PoweredBy.js.map +1 -0
  905. package/dist/report/components/site-components/compute.cjs +130 -0
  906. package/dist/report/components/site-components/compute.cjs.map +1 -0
  907. package/dist/report/components/site-components/compute.d.cts +36 -0
  908. package/dist/report/components/site-components/compute.d.mts +36 -0
  909. package/dist/report/components/site-components/compute.d.ts +36 -0
  910. package/dist/report/components/site-components/compute.js +16 -0
  911. package/dist/report/components/site-components/compute.js.map +1 -0
  912. package/dist/report/components/site-components/content.cjs +9 -0
  913. package/dist/report/components/site-components/content.cjs.map +1 -0
  914. package/dist/report/components/site-components/content.d.cts +118 -0
  915. package/dist/report/components/site-components/content.d.mts +118 -0
  916. package/dist/report/components/site-components/content.d.ts +118 -0
  917. package/dist/report/components/site-components/content.js +12 -0
  918. package/dist/report/components/site-components/content.js.map +1 -0
  919. package/dist/report/components/site-components/faces.cjs +33 -0
  920. package/dist/report/components/site-components/faces.cjs.map +1 -0
  921. package/dist/report/components/site-components/faces.d.cts +9 -0
  922. package/dist/report/components/site-components/faces.d.mts +9 -0
  923. package/dist/report/components/site-components/faces.d.ts +9 -0
  924. package/dist/report/components/site-components/faces.js +6 -0
  925. package/dist/report/components/site-components/faces.js.map +1 -0
  926. package/dist/report/components/site-components/hero-types.cjs +3 -0
  927. package/dist/report/components/site-components/hero-types.cjs.map +1 -0
  928. package/dist/report/components/site-components/hero-types.d.cts +17 -0
  929. package/dist/report/components/site-components/hero-types.d.mts +17 -0
  930. package/dist/report/components/site-components/hero-types.d.ts +17 -0
  931. package/dist/report/components/site-components/hero-types.js +4 -0
  932. package/dist/report/components/site-components/hero-types.js.map +1 -0
  933. package/dist/report/components/site-components/index.cjs +90 -0
  934. package/dist/report/components/site-components/index.cjs.map +1 -0
  935. package/dist/report/components/site-components/index.d.cts +58 -0
  936. package/dist/report/components/site-components/index.d.mts +58 -0
  937. package/dist/report/components/site-components/index.d.ts +58 -0
  938. package/dist/report/components/site-components/index.js +26 -0
  939. package/dist/report/components/site-components/index.js.map +1 -0
  940. package/dist/report/components/site-components/projections.cjs +86 -0
  941. package/dist/report/components/site-components/projections.cjs.map +1 -0
  942. package/dist/report/components/site-components/projections.d.cts +11 -0
  943. package/dist/report/components/site-components/projections.d.mts +11 -0
  944. package/dist/report/components/site-components/projections.d.ts +11 -0
  945. package/dist/report/components/site-components/projections.js +12 -0
  946. package/dist/report/components/site-components/projections.js.map +1 -0
  947. package/dist/report/components/site-components/scope-warnings.cjs +89 -0
  948. package/dist/report/components/site-components/scope-warnings.cjs.map +1 -0
  949. package/dist/report/components/site-components/scope-warnings.d.cts +34 -0
  950. package/dist/report/components/site-components/scope-warnings.d.mts +34 -0
  951. package/dist/report/components/site-components/scope-warnings.d.ts +34 -0
  952. package/dist/report/components/site-components/scope-warnings.js +8 -0
  953. package/dist/report/components/site-components/scope-warnings.js.map +1 -0
  954. package/dist/report/components/site-components/snapshot-diagnostics.cjs +43 -0
  955. package/dist/report/components/site-components/snapshot-diagnostics.cjs.map +1 -0
  956. package/dist/report/components/site-components/snapshot-diagnostics.d.cts +15 -0
  957. package/dist/report/components/site-components/snapshot-diagnostics.d.mts +15 -0
  958. package/dist/report/components/site-components/snapshot-diagnostics.d.ts +15 -0
  959. package/dist/report/components/site-components/snapshot-diagnostics.js +8 -0
  960. package/dist/report/components/site-components/snapshot-diagnostics.js.map +1 -0
  961. package/dist/report/components/site-components/validators.cjs +140 -0
  962. package/dist/report/components/site-components/validators.cjs.map +1 -0
  963. package/dist/report/components/site-components/validators.d.cts +9 -0
  964. package/dist/report/components/site-components/validators.d.mts +9 -0
  965. package/dist/report/components/site-components/validators.d.ts +9 -0
  966. package/dist/report/components/site-components/validators.js +16 -0
  967. package/dist/report/components/site-components/validators.js.map +1 -0
  968. package/dist/report/components/summaries/compute.cjs +224 -0
  969. package/dist/report/components/summaries/compute.cjs.map +1 -0
  970. package/dist/report/components/summaries/compute.d.cts +78 -0
  971. package/dist/report/components/summaries/compute.d.mts +78 -0
  972. package/dist/report/components/summaries/compute.d.ts +78 -0
  973. package/dist/report/components/summaries/compute.js +10 -0
  974. package/dist/report/components/summaries/compute.js.map +1 -0
  975. package/dist/report/components/summaries/index.cjs +68 -0
  976. package/dist/report/components/summaries/index.cjs.map +1 -0
  977. package/dist/report/components/summaries/index.d.cts +42 -0
  978. package/dist/report/components/summaries/index.d.mts +42 -0
  979. package/dist/report/components/summaries/index.d.ts +42 -0
  980. package/dist/report/components/summaries/index.js +12 -0
  981. package/dist/report/components/summaries/index.js.map +1 -0
  982. package/dist/report/components/summaries/stability-overview.cjs +27 -0
  983. package/dist/report/components/summaries/stability-overview.cjs.map +1 -0
  984. package/dist/report/components/summaries/stability-overview.d.cts +19 -0
  985. package/dist/report/components/summaries/stability-overview.d.mts +19 -0
  986. package/dist/report/components/summaries/stability-overview.d.ts +19 -0
  987. package/dist/report/components/summaries/stability-overview.js +6 -0
  988. package/dist/report/components/summaries/stability-overview.js.map +1 -0
  989. package/dist/report/definition/cell.cjs +90 -0
  990. package/dist/report/definition/cell.cjs.map +1 -0
  991. package/dist/report/definition/cell.d.cts +99 -0
  992. package/dist/report/definition/cell.d.mts +99 -0
  993. package/dist/report/definition/cell.d.ts +99 -0
  994. package/dist/report/definition/cell.js +8 -0
  995. package/dist/report/definition/cell.js.map +1 -0
  996. package/dist/report/definition/grid-layout.cjs +151 -0
  997. package/dist/report/definition/grid-layout.cjs.map +1 -0
  998. package/dist/report/definition/grid-layout.d.cts +77 -0
  999. package/dist/report/definition/grid-layout.d.mts +77 -0
  1000. package/dist/report/definition/grid-layout.d.ts +77 -0
  1001. package/dist/report/definition/grid-layout.js +20 -0
  1002. package/dist/report/definition/grid-layout.js.map +1 -0
  1003. package/dist/report/definition/primitives/callouts-logic.cjs +113 -0
  1004. package/dist/report/definition/primitives/callouts-logic.cjs.map +1 -0
  1005. package/dist/report/definition/primitives/callouts-logic.d.cts +26 -0
  1006. package/dist/report/definition/primitives/callouts-logic.d.mts +26 -0
  1007. package/dist/report/definition/primitives/callouts-logic.d.ts +26 -0
  1008. package/dist/report/definition/primitives/callouts-logic.js +20 -0
  1009. package/dist/report/definition/primitives/callouts-logic.js.map +1 -0
  1010. package/dist/report/definition/primitives/callouts.cjs +105 -0
  1011. package/dist/report/definition/primitives/callouts.cjs.map +1 -0
  1012. package/dist/report/definition/primitives/callouts.d.cts +9 -0
  1013. package/dist/report/definition/primitives/callouts.d.mts +9 -0
  1014. package/dist/report/definition/primitives/callouts.d.ts +9 -0
  1015. package/dist/report/definition/primitives/callouts.js +6 -0
  1016. package/dist/report/definition/primitives/callouts.js.map +1 -0
  1017. package/dist/report/definition/primitives/chart-map.cjs +138 -0
  1018. package/dist/report/definition/primitives/chart-map.cjs.map +1 -0
  1019. package/dist/report/definition/primitives/chart-map.d.cts +77 -0
  1020. package/dist/report/definition/primitives/chart-map.d.mts +77 -0
  1021. package/dist/report/definition/primitives/chart-map.d.ts +77 -0
  1022. package/dist/report/definition/primitives/chart-map.js +12 -0
  1023. package/dist/report/definition/primitives/chart-map.js.map +1 -0
  1024. package/dist/report/definition/primitives/chart.cjs +651 -0
  1025. package/dist/report/definition/primitives/chart.cjs.map +1 -0
  1026. package/dist/report/definition/primitives/chart.d.cts +43 -0
  1027. package/dist/report/definition/primitives/chart.d.mts +43 -0
  1028. package/dist/report/definition/primitives/chart.d.ts +43 -0
  1029. package/dist/report/definition/primitives/chart.js +8 -0
  1030. package/dist/report/definition/primitives/chart.js.map +1 -0
  1031. package/dist/report/definition/primitives/conversation.cjs +255 -0
  1032. package/dist/report/definition/primitives/conversation.cjs.map +1 -0
  1033. package/dist/report/definition/primitives/conversation.d.cts +71 -0
  1034. package/dist/report/definition/primitives/conversation.d.mts +71 -0
  1035. package/dist/report/definition/primitives/conversation.d.ts +71 -0
  1036. package/dist/report/definition/primitives/conversation.js +16 -0
  1037. package/dist/report/definition/primitives/conversation.js.map +1 -0
  1038. package/dist/report/definition/primitives/copy-block.cjs +55 -0
  1039. package/dist/report/definition/primitives/copy-block.cjs.map +1 -0
  1040. package/dist/report/definition/primitives/copy-block.d.cts +19 -0
  1041. package/dist/report/definition/primitives/copy-block.d.mts +19 -0
  1042. package/dist/report/definition/primitives/copy-block.d.ts +19 -0
  1043. package/dist/report/definition/primitives/copy-block.js +6 -0
  1044. package/dist/report/definition/primitives/copy-block.js.map +1 -0
  1045. package/dist/report/definition/primitives/diff-lines.cjs +163 -0
  1046. package/dist/report/definition/primitives/diff-lines.cjs.map +1 -0
  1047. package/dist/report/definition/primitives/diff-lines.d.cts +68 -0
  1048. package/dist/report/definition/primitives/diff-lines.d.mts +68 -0
  1049. package/dist/report/definition/primitives/diff-lines.d.ts +68 -0
  1050. package/dist/report/definition/primitives/diff-lines.js +28 -0
  1051. package/dist/report/definition/primitives/diff-lines.js.map +1 -0
  1052. package/dist/report/definition/primitives/diff-view.cjs +155 -0
  1053. package/dist/report/definition/primitives/diff-view.cjs.map +1 -0
  1054. package/dist/report/definition/primitives/diff-view.d.cts +14 -0
  1055. package/dist/report/definition/primitives/diff-view.d.mts +14 -0
  1056. package/dist/report/definition/primitives/diff-view.d.ts +14 -0
  1057. package/dist/report/definition/primitives/diff-view.js +8 -0
  1058. package/dist/report/definition/primitives/diff-view.js.map +1 -0
  1059. package/dist/report/definition/primitives/downloads.cjs +89 -0
  1060. package/dist/report/definition/primitives/downloads.cjs.map +1 -0
  1061. package/dist/report/definition/primitives/downloads.d.cts +28 -0
  1062. package/dist/report/definition/primitives/downloads.d.mts +28 -0
  1063. package/dist/report/definition/primitives/downloads.d.ts +28 -0
  1064. package/dist/report/definition/primitives/downloads.js +8 -0
  1065. package/dist/report/definition/primitives/downloads.js.map +1 -0
  1066. package/dist/report/definition/primitives/markdown.cjs +290 -0
  1067. package/dist/report/definition/primitives/markdown.cjs.map +1 -0
  1068. package/dist/report/definition/primitives/markdown.d.cts +29 -0
  1069. package/dist/report/definition/primitives/markdown.d.mts +29 -0
  1070. package/dist/report/definition/primitives/markdown.d.ts +29 -0
  1071. package/dist/report/definition/primitives/markdown.js +16 -0
  1072. package/dist/report/definition/primitives/markdown.js.map +1 -0
  1073. package/dist/report/definition/primitives/marks.cjs +96 -0
  1074. package/dist/report/definition/primitives/marks.cjs.map +1 -0
  1075. package/dist/report/definition/primitives/marks.d.cts +125 -0
  1076. package/dist/report/definition/primitives/marks.d.mts +125 -0
  1077. package/dist/report/definition/primitives/marks.d.ts +125 -0
  1078. package/dist/report/definition/primitives/marks.js +14 -0
  1079. package/dist/report/definition/primitives/marks.js.map +1 -0
  1080. package/dist/report/definition/primitives/points-dataset.cjs +147 -0
  1081. package/dist/report/definition/primitives/points-dataset.cjs.map +1 -0
  1082. package/dist/report/definition/primitives/points-dataset.d.cts +17 -0
  1083. package/dist/report/definition/primitives/points-dataset.d.mts +17 -0
  1084. package/dist/report/definition/primitives/points-dataset.d.ts +17 -0
  1085. package/dist/report/definition/primitives/points-dataset.js +6 -0
  1086. package/dist/report/definition/primitives/points-dataset.js.map +1 -0
  1087. package/dist/report/definition/primitives/shared.cjs +131 -0
  1088. package/dist/report/definition/primitives/shared.cjs.map +1 -0
  1089. package/dist/report/definition/primitives/shared.d.cts +67 -0
  1090. package/dist/report/definition/primitives/shared.d.mts +67 -0
  1091. package/dist/report/definition/primitives/shared.d.ts +67 -0
  1092. package/dist/report/definition/primitives/shared.js +34 -0
  1093. package/dist/report/definition/primitives/shared.js.map +1 -0
  1094. package/dist/report/definition/primitives/source-view.cjs +204 -0
  1095. package/dist/report/definition/primitives/source-view.cjs.map +1 -0
  1096. package/dist/report/definition/primitives/source-view.d.cts +47 -0
  1097. package/dist/report/definition/primitives/source-view.d.mts +47 -0
  1098. package/dist/report/definition/primitives/source-view.d.ts +47 -0
  1099. package/dist/report/definition/primitives/source-view.js +8 -0
  1100. package/dist/report/definition/primitives/source-view.js.map +1 -0
  1101. package/dist/report/definition/primitives/text-panel-state.cjs +38 -0
  1102. package/dist/report/definition/primitives/text-panel-state.cjs.map +1 -0
  1103. package/dist/report/definition/primitives/text-panel-state.d.cts +9 -0
  1104. package/dist/report/definition/primitives/text-panel-state.d.mts +9 -0
  1105. package/dist/report/definition/primitives/text-panel-state.d.ts +9 -0
  1106. package/dist/report/definition/primitives/text-panel-state.js +12 -0
  1107. package/dist/report/definition/primitives/text-panel-state.js.map +1 -0
  1108. package/dist/report/definition/primitives/tool-evidence.cjs +95 -0
  1109. package/dist/report/definition/primitives/tool-evidence.cjs.map +1 -0
  1110. package/dist/report/definition/primitives/tool-evidence.d.cts +11 -0
  1111. package/dist/report/definition/primitives/tool-evidence.d.mts +11 -0
  1112. package/dist/report/definition/primitives/tool-evidence.d.ts +11 -0
  1113. package/dist/report/definition/primitives/tool-evidence.js +6 -0
  1114. package/dist/report/definition/primitives/tool-evidence.js.map +1 -0
  1115. package/dist/report/definition/primitives/turn-trace.cjs +205 -0
  1116. package/dist/report/definition/primitives/turn-trace.cjs.map +1 -0
  1117. package/dist/report/definition/primitives/turn-trace.d.cts +8 -0
  1118. package/dist/report/definition/primitives/turn-trace.d.mts +8 -0
  1119. package/dist/report/definition/primitives/turn-trace.d.ts +8 -0
  1120. package/dist/report/definition/primitives/turn-trace.js +6 -0
  1121. package/dist/report/definition/primitives/turn-trace.js.map +1 -0
  1122. package/dist/report/definition/primitives/waterfall.cjs +206 -0
  1123. package/dist/report/definition/primitives/waterfall.cjs.map +1 -0
  1124. package/dist/report/definition/primitives/waterfall.d.cts +34 -0
  1125. package/dist/report/definition/primitives/waterfall.d.mts +34 -0
  1126. package/dist/report/definition/primitives/waterfall.d.ts +34 -0
  1127. package/dist/report/definition/primitives/waterfall.js +8 -0
  1128. package/dist/report/definition/primitives/waterfall.js.map +1 -0
  1129. package/dist/report/definition/primitives.cjs +826 -0
  1130. package/dist/report/definition/primitives.cjs.map +1 -0
  1131. package/dist/report/definition/primitives.d.cts +194 -0
  1132. package/dist/report/definition/primitives.d.mts +194 -0
  1133. package/dist/report/definition/primitives.d.ts +194 -0
  1134. package/dist/report/definition/primitives.js +84 -0
  1135. package/dist/report/definition/primitives.js.map +1 -0
  1136. package/dist/report/definition/report.cjs +778 -0
  1137. package/dist/report/definition/report.cjs.map +1 -0
  1138. package/dist/report/definition/report.d.cts +203 -0
  1139. package/dist/report/definition/report.d.mts +203 -0
  1140. package/dist/report/definition/report.d.ts +203 -0
  1141. package/dist/report/definition/report.js +16 -0
  1142. package/dist/report/definition/report.js.map +1 -0
  1143. package/dist/report/definition/table-text.cjs +184 -0
  1144. package/dist/report/definition/table-text.cjs.map +1 -0
  1145. package/dist/report/definition/table-text.d.cts +14 -0
  1146. package/dist/report/definition/table-text.d.mts +14 -0
  1147. package/dist/report/definition/table-text.d.ts +14 -0
  1148. package/dist/report/definition/table-text.js +6 -0
  1149. package/dist/report/definition/table-text.js.map +1 -0
  1150. package/dist/report/definition/tree.cjs +685 -0
  1151. package/dist/report/definition/tree.cjs.map +1 -0
  1152. package/dist/report/definition/tree.d.cts +165 -0
  1153. package/dist/report/definition/tree.d.mts +165 -0
  1154. package/dist/report/definition/tree.d.ts +165 -0
  1155. package/dist/report/definition/tree.js +44 -0
  1156. package/dist/report/definition/tree.js.map +1 -0
  1157. package/dist/report/execution/machine.cjs +587 -0
  1158. package/dist/report/execution/machine.cjs.map +1 -0
  1159. package/dist/report/execution/machine.d.cts +291 -0
  1160. package/dist/report/execution/machine.d.mts +291 -0
  1161. package/dist/report/execution/machine.d.ts +291 -0
  1162. package/dist/report/execution/machine.js +36 -0
  1163. package/dist/report/execution/machine.js.map +1 -0
  1164. package/dist/report/execution/model.cjs +91 -463
  1165. package/dist/report/execution/model.cjs.map +1 -1
  1166. package/dist/report/execution/model.d.cts +57 -39
  1167. package/dist/report/execution/model.d.mts +57 -39
  1168. package/dist/report/execution/model.d.ts +57 -39
  1169. package/dist/report/execution/model.js +36 -12
  1170. package/dist/report/execution/paths.cjs +182 -0
  1171. package/dist/report/execution/paths.cjs.map +1 -0
  1172. package/dist/report/execution/paths.d.cts +27 -0
  1173. package/dist/report/execution/paths.d.mts +27 -0
  1174. package/dist/report/execution/paths.d.ts +27 -0
  1175. package/dist/report/execution/paths.js +20 -0
  1176. package/dist/report/execution/paths.js.map +1 -0
  1177. package/dist/report/extension/assets.cjs +143 -0
  1178. package/dist/report/extension/assets.cjs.map +1 -0
  1179. package/dist/report/extension/assets.d.cts +17 -0
  1180. package/dist/report/extension/assets.d.mts +17 -0
  1181. package/dist/report/extension/assets.d.ts +17 -0
  1182. package/dist/report/extension/assets.js +10 -0
  1183. package/dist/report/extension/assets.js.map +1 -0
  1184. package/dist/report/extension/define.cjs +119 -0
  1185. package/dist/report/extension/define.cjs.map +1 -0
  1186. package/dist/report/extension/define.d.cts +11 -0
  1187. package/dist/report/extension/define.d.mts +11 -0
  1188. package/dist/report/extension/define.d.ts +11 -0
  1189. package/dist/report/extension/define.js +6 -0
  1190. package/dist/report/extension/define.js.map +1 -0
  1191. package/dist/report/extension/index.cjs +10 -0
  1192. package/dist/report/extension/index.cjs.map +1 -0
  1193. package/dist/report/extension/index.d.cts +6 -0
  1194. package/dist/report/extension/index.d.mts +6 -0
  1195. package/dist/report/extension/index.d.ts +6 -0
  1196. package/dist/report/extension/index.js +10 -0
  1197. package/dist/report/extension/index.js.map +1 -0
  1198. package/dist/report/extension/index.mjs +10 -0
  1199. package/dist/report/extension/index.mjs.map +1 -0
  1200. package/dist/report/extension/meta.cjs +59 -0
  1201. package/dist/report/extension/meta.cjs.map +1 -0
  1202. package/dist/report/extension/meta.d.cts +13 -0
  1203. package/dist/report/extension/meta.d.mts +13 -0
  1204. package/dist/report/extension/meta.d.ts +13 -0
  1205. package/dist/report/extension/meta.js +12 -0
  1206. package/dist/report/extension/meta.js.map +1 -0
  1207. package/dist/report/extension/types.cjs +3 -0
  1208. package/dist/report/extension/types.cjs.map +1 -0
  1209. package/dist/report/extension/types.d.cts +44 -0
  1210. package/dist/report/extension/types.d.mts +44 -0
  1211. package/dist/report/extension/types.d.ts +44 -0
  1212. package/dist/report/extension/types.js +4 -0
  1213. package/dist/report/extension/types.js.map +1 -0
  1214. package/dist/report/host/execute.cjs +457 -1238
  1215. package/dist/report/host/execute.cjs.map +1 -1
  1216. package/dist/report/host/execute.d.cts +66 -19
  1217. package/dist/report/host/execute.d.mts +66 -19
  1218. package/dist/report/host/execute.d.ts +66 -19
  1219. package/dist/report/host/execute.js +10 -2
  1220. package/dist/report/host/from-record.cjs +441 -27
  1221. package/dist/report/host/from-record.cjs.map +1 -1
  1222. package/dist/report/host/from-record.d.cts +62 -30
  1223. package/dist/report/host/from-record.d.mts +62 -30
  1224. package/dist/report/host/from-record.d.ts +62 -30
  1225. package/dist/report/host/from-record.js +8 -4
  1226. package/dist/report/host/index.cjs +31 -18
  1227. package/dist/report/host/index.cjs.map +1 -1
  1228. package/dist/report/host/index.d.cts +20 -11
  1229. package/dist/report/host/index.d.mts +20 -11
  1230. package/dist/report/host/index.d.ts +20 -11
  1231. package/dist/report/host/index.js +2 -20
  1232. package/dist/report/host/index.mjs +6 -0
  1233. package/dist/report/host/index.mjs.map +1 -0
  1234. package/dist/report/host/machine.cjs +102 -0
  1235. package/dist/report/host/machine.cjs.map +1 -0
  1236. package/dist/report/host/machine.d.cts +7 -0
  1237. package/dist/report/host/machine.d.mts +7 -0
  1238. package/dist/report/host/machine.d.ts +7 -0
  1239. package/dist/report/host/machine.js +6 -0
  1240. package/dist/report/host/machine.js.map +1 -0
  1241. package/dist/report/host/node/loader.cjs +40 -19
  1242. package/dist/report/host/node/loader.cjs.map +1 -1
  1243. package/dist/report/host/node/loader.d.cts +8 -7
  1244. package/dist/report/host/node/loader.d.mts +8 -7
  1245. package/dist/report/host/node/loader.d.ts +8 -7
  1246. package/dist/report/host/node.cjs +1 -1
  1247. package/dist/report/host/node.cjs.map +1 -1
  1248. package/dist/report/host/node.d.cts +3 -3
  1249. package/dist/report/host/node.d.mts +3 -3
  1250. package/dist/report/host/node.d.ts +3 -3
  1251. package/dist/report/host/progress.cjs +41 -0
  1252. package/dist/report/host/progress.cjs.map +1 -0
  1253. package/dist/report/host/progress.d.cts +22 -0
  1254. package/dist/report/host/progress.d.mts +22 -0
  1255. package/dist/report/host/progress.d.ts +22 -0
  1256. package/dist/report/host/progress.js +8 -0
  1257. package/dist/report/host/progress.js.map +1 -0
  1258. package/dist/report/host/show-target.cjs +214 -0
  1259. package/dist/report/host/show-target.cjs.map +1 -0
  1260. package/dist/report/host/show-target.d.cts +107 -0
  1261. package/dist/report/host/show-target.d.mts +107 -0
  1262. package/dist/report/host/show-target.d.ts +107 -0
  1263. package/dist/report/host/show-target.js +8 -0
  1264. package/dist/report/host/show-target.js.map +1 -0
  1265. package/dist/report/host/site-assets.cjs +11 -0
  1266. package/dist/report/host/site-assets.cjs.map +1 -0
  1267. package/dist/report/host/site-assets.d.cts +7 -0
  1268. package/dist/report/host/site-assets.d.mts +7 -0
  1269. package/dist/report/host/site-assets.d.ts +7 -0
  1270. package/dist/report/host/site-assets.js +8 -0
  1271. package/dist/report/host/site-assets.js.map +1 -0
  1272. package/dist/report/host/site-runtime.cjs +91 -0
  1273. package/dist/report/host/site-runtime.cjs.map +1 -0
  1274. package/dist/report/host/site-runtime.d.cts +9 -0
  1275. package/dist/report/host/site-runtime.d.mts +9 -0
  1276. package/dist/report/host/site-runtime.d.ts +9 -0
  1277. package/dist/report/host/site-runtime.js +10 -0
  1278. package/dist/report/host/site-runtime.js.map +1 -0
  1279. package/dist/report/host/static.cjs +694 -99
  1280. package/dist/report/host/static.cjs.map +1 -1
  1281. package/dist/report/host/static.d.cts +36 -19
  1282. package/dist/report/host/static.d.mts +36 -19
  1283. package/dist/report/host/static.d.ts +36 -19
  1284. package/dist/report/host/static.js +14 -4
  1285. package/dist/report/host/target-route.cjs +58 -0
  1286. package/dist/report/host/target-route.cjs.map +1 -0
  1287. package/dist/report/host/target-route.d.cts +15 -0
  1288. package/dist/report/host/target-route.d.mts +15 -0
  1289. package/dist/report/host/target-route.d.ts +15 -0
  1290. package/dist/report/host/target-route.js +8 -0
  1291. package/dist/report/host/target-route.js.map +1 -0
  1292. package/dist/report/host/view-session.cjs +68 -51
  1293. package/dist/report/host/view-session.cjs.map +1 -1
  1294. package/dist/report/host/view-session.d.cts +38 -44
  1295. package/dist/report/host/view-session.d.mts +38 -44
  1296. package/dist/report/host/view-session.d.ts +38 -44
  1297. package/dist/report/index.cjs +111 -52
  1298. package/dist/report/index.cjs.map +1 -1
  1299. package/dist/report/index.d.cts +39 -11
  1300. package/dist/report/index.d.mts +39 -11
  1301. package/dist/report/index.d.ts +39 -11
  1302. package/dist/report/index.js +188 -116
  1303. package/dist/report/index.mjs +188 -116
  1304. package/dist/report/library/details.cjs +166 -0
  1305. package/dist/report/library/details.cjs.map +1 -0
  1306. package/dist/report/library/details.d.cts +29 -0
  1307. package/dist/report/library/details.d.mts +29 -0
  1308. package/dist/report/library/details.d.ts +29 -0
  1309. package/dist/report/library/details.js +18 -0
  1310. package/dist/report/library/details.js.map +1 -0
  1311. package/dist/report/model/aggregate.cjs +243 -0
  1312. package/dist/report/model/aggregate.cjs.map +1 -0
  1313. package/dist/report/model/aggregate.d.cts +88 -0
  1314. package/dist/report/model/aggregate.d.mts +88 -0
  1315. package/dist/report/model/aggregate.d.ts +88 -0
  1316. package/dist/report/model/aggregate.js +26 -0
  1317. package/dist/report/model/aggregate.js.map +1 -0
  1318. package/dist/report/model/chart/math.cjs +206 -0
  1319. package/dist/report/model/chart/math.cjs.map +1 -0
  1320. package/dist/report/model/chart/math.d.cts +73 -0
  1321. package/dist/report/model/chart/math.d.mts +73 -0
  1322. package/dist/report/model/chart/math.d.ts +73 -0
  1323. package/dist/report/model/chart/math.js +14 -0
  1324. package/dist/report/model/chart/math.js.map +1 -0
  1325. package/dist/report/model/chart/plot.cjs +94 -0
  1326. package/dist/report/model/chart/plot.cjs.map +1 -0
  1327. package/dist/report/model/chart/plot.d.cts +52 -0
  1328. package/dist/report/model/chart/plot.d.mts +52 -0
  1329. package/dist/report/model/chart/plot.d.ts +52 -0
  1330. package/dist/report/model/chart/plot.js +8 -0
  1331. package/dist/report/model/chart/plot.js.map +1 -0
  1332. package/dist/report/model/conversions.cjs +100 -0
  1333. package/dist/report/model/conversions.cjs.map +1 -0
  1334. package/dist/report/model/conversions.d.cts +40 -0
  1335. package/dist/report/model/conversions.d.mts +40 -0
  1336. package/dist/report/model/conversions.d.ts +40 -0
  1337. package/dist/report/model/conversions.js +24 -0
  1338. package/dist/report/model/conversions.js.map +1 -0
  1339. package/dist/report/model/dataset.cjs +255 -0
  1340. package/dist/report/model/dataset.cjs.map +1 -0
  1341. package/dist/report/model/dataset.d.cts +33 -0
  1342. package/dist/report/model/dataset.d.mts +33 -0
  1343. package/dist/report/model/dataset.d.ts +33 -0
  1344. package/dist/report/model/dataset.js +22 -0
  1345. package/dist/report/model/dataset.js.map +1 -0
  1346. package/dist/report/model/format.cjs +377 -0
  1347. package/dist/report/model/format.cjs.map +1 -0
  1348. package/dist/report/model/format.d.cts +98 -0
  1349. package/dist/report/model/format.d.mts +98 -0
  1350. package/dist/report/model/format.d.ts +98 -0
  1351. package/dist/report/model/format.js +38 -0
  1352. package/dist/report/model/format.js.map +1 -0
  1353. package/dist/report/model/locale.cjs +437 -0
  1354. package/dist/report/model/locale.cjs.map +1 -0
  1355. package/dist/report/model/locale.d.cts +220 -0
  1356. package/dist/report/model/locale.d.mts +220 -0
  1357. package/dist/report/model/locale.d.ts +220 -0
  1358. package/dist/report/model/locale.js +20 -0
  1359. package/dist/report/model/locale.js.map +1 -0
  1360. package/dist/report/model/metrics.cjs +254 -0
  1361. package/dist/report/model/metrics.cjs.map +1 -0
  1362. package/dist/report/model/metrics.d.cts +73 -0
  1363. package/dist/report/model/metrics.d.mts +73 -0
  1364. package/dist/report/model/metrics.d.ts +73 -0
  1365. package/dist/report/model/metrics.js +26 -0
  1366. package/dist/report/model/metrics.js.map +1 -0
  1367. package/dist/report/model/pricing.cjs +126 -0
  1368. package/dist/report/model/pricing.cjs.map +1 -0
  1369. package/dist/report/model/pricing.d.cts +37 -0
  1370. package/dist/report/model/pricing.d.mts +37 -0
  1371. package/dist/report/model/pricing.d.ts +37 -0
  1372. package/dist/report/model/pricing.js +16 -0
  1373. package/dist/report/model/pricing.js.map +1 -0
  1374. package/dist/report/model/text-layout.cjs +8 -0
  1375. package/dist/report/model/text-layout.cjs.map +1 -1
  1376. package/dist/report/model/text-layout.d.cts +7 -0
  1377. package/dist/report/model/text-layout.d.mts +7 -0
  1378. package/dist/report/model/text-layout.d.ts +7 -0
  1379. package/dist/report/model/text-layout.js +30 -18
  1380. package/dist/report/model/types.cjs +3 -0
  1381. package/dist/report/model/types.cjs.map +1 -0
  1382. package/dist/report/model/types.d.cts +64 -0
  1383. package/dist/report/model/types.d.mts +64 -0
  1384. package/dist/report/model/types.d.ts +64 -0
  1385. package/dist/report/model/types.js +4 -0
  1386. package/dist/report/model/types.js.map +1 -0
  1387. package/dist/report/presentation.cjs +219 -0
  1388. package/dist/report/presentation.cjs.map +1 -0
  1389. package/dist/report/presentation.d.cts +114 -0
  1390. package/dist/report/presentation.d.mts +114 -0
  1391. package/dist/report/presentation.d.ts +114 -0
  1392. package/dist/report/presentation.js +18 -0
  1393. package/dist/report/react/enhance.js +466 -0
  1394. package/dist/report/react/index.cjs +40 -0
  1395. package/dist/report/react/index.cjs.map +1 -0
  1396. package/dist/report/react/index.d.cts +9 -0
  1397. package/dist/report/react/index.d.mts +9 -0
  1398. package/dist/report/react/index.d.ts +9 -0
  1399. package/dist/report/react/index.js +64 -0
  1400. package/dist/report/react/index.js.map +1 -0
  1401. package/dist/report/react/index.mjs +64 -0
  1402. package/dist/report/react/index.mjs.map +1 -0
  1403. package/dist/report/react/styles.css +2678 -0
  1404. package/dist/report/runtime/resolved-page.cjs +317 -0
  1405. package/dist/report/runtime/resolved-page.cjs.map +1 -0
  1406. package/dist/report/runtime/resolved-page.d.cts +133 -0
  1407. package/dist/report/runtime/resolved-page.d.mts +133 -0
  1408. package/dist/report/runtime/resolved-page.d.ts +133 -0
  1409. package/dist/report/runtime/resolved-page.js +14 -0
  1410. package/dist/report/runtime/resolved-page.js.map +1 -0
  1411. package/dist/report/runtime/text.cjs +32 -0
  1412. package/dist/report/runtime/text.cjs.map +1 -0
  1413. package/dist/report/runtime/text.d.cts +24 -0
  1414. package/dist/report/runtime/text.d.mts +24 -0
  1415. package/dist/report/runtime/text.d.ts +24 -0
  1416. package/dist/report/runtime/text.js +8 -0
  1417. package/dist/report/runtime/text.js.map +1 -0
  1418. package/dist/report/runtime/web.cjs +31 -0
  1419. package/dist/report/runtime/web.cjs.map +1 -0
  1420. package/dist/report/runtime/web.d.cts +21 -0
  1421. package/dist/report/runtime/web.d.mts +21 -0
  1422. package/dist/report/runtime/web.d.ts +21 -0
  1423. package/dist/report/runtime/web.js +8 -0
  1424. package/dist/report/runtime/web.js.map +1 -0
  1425. package/dist/report/theme.cjs +141 -0
  1426. package/dist/report/theme.cjs.map +1 -0
  1427. package/dist/report/theme.d.cts +57 -0
  1428. package/dist/report/theme.d.mts +57 -0
  1429. package/dist/report/theme.d.ts +57 -0
  1430. package/dist/report/theme.js +20 -0
  1431. package/dist/runner/accept.cjs +74 -87
  1432. package/dist/runner/accept.cjs.map +1 -1
  1433. package/dist/runner/accept.d.cts +14 -17
  1434. package/dist/runner/accept.d.mts +14 -17
  1435. package/dist/runner/accept.d.ts +14 -17
  1436. package/dist/runner/accept.js +4 -8
  1437. package/dist/runner/adoption.cjs +346 -408
  1438. package/dist/runner/adoption.cjs.map +1 -1
  1439. package/dist/runner/adoption.d.cts +132 -116
  1440. package/dist/runner/adoption.d.mts +132 -116
  1441. package/dist/runner/adoption.d.ts +132 -116
  1442. package/dist/runner/adoption.js +42 -46
  1443. package/dist/runner/attempt.cjs +175 -74
  1444. package/dist/runner/attempt.cjs.map +1 -1
  1445. package/dist/runner/attempt.d.cts +1 -1
  1446. package/dist/runner/attempt.d.mts +1 -1
  1447. package/dist/runner/attempt.d.ts +1 -1
  1448. package/dist/runner/cleanup-timeout.cjs +12 -6
  1449. package/dist/runner/cleanup-timeout.cjs.map +1 -1
  1450. package/dist/runner/cleanup-timeout.d.cts +5 -5
  1451. package/dist/runner/cleanup-timeout.d.mts +5 -5
  1452. package/dist/runner/cleanup-timeout.d.ts +5 -5
  1453. package/dist/runner/execution-identity.cjs +25 -0
  1454. package/dist/runner/execution-identity.cjs.map +1 -0
  1455. package/dist/runner/execution-identity.d.cts +39 -0
  1456. package/dist/runner/execution-identity.d.mts +39 -0
  1457. package/dist/runner/execution-identity.d.ts +39 -0
  1458. package/dist/runner/execution-identity.js +8 -0
  1459. package/dist/runner/execution-identity.js.map +1 -0
  1460. package/dist/runner/feedback/failure.cjs +0 -2
  1461. package/dist/runner/feedback/failure.cjs.map +1 -1
  1462. package/dist/runner/feedback/human.cjs +47 -20
  1463. package/dist/runner/feedback/human.cjs.map +1 -1
  1464. package/dist/runner/feedback/index.cjs.map +1 -1
  1465. package/dist/runner/feedback/index.d.cts +1 -1
  1466. package/dist/runner/feedback/index.d.mts +1 -1
  1467. package/dist/runner/feedback/index.d.ts +1 -1
  1468. package/dist/runner/feedback/json.cjs +29 -7
  1469. package/dist/runner/feedback/json.cjs.map +1 -1
  1470. package/dist/runner/feedback/json.d.cts +14 -1
  1471. package/dist/runner/feedback/json.d.mts +14 -1
  1472. package/dist/runner/feedback/json.d.ts +14 -1
  1473. package/dist/runner/feedback/reducer.cjs +3 -1
  1474. package/dist/runner/feedback/reducer.cjs.map +1 -1
  1475. package/dist/runner/feedback/sink.cjs +1 -1
  1476. package/dist/runner/feedback/sink.cjs.map +1 -1
  1477. package/dist/runner/feedback/sink.d.cts +6 -6
  1478. package/dist/runner/feedback/sink.d.mts +6 -6
  1479. package/dist/runner/feedback/sink.d.ts +6 -6
  1480. package/dist/runner/fingerprint.cjs +8 -2
  1481. package/dist/runner/fingerprint.cjs.map +1 -1
  1482. package/dist/runner/fingerprint.d.cts +9 -0
  1483. package/dist/runner/fingerprint.d.mts +9 -0
  1484. package/dist/runner/fingerprint.d.ts +9 -0
  1485. package/dist/runner/fingerprint.js +4 -2
  1486. package/dist/runner/gate-lease.cjs +24 -12
  1487. package/dist/runner/gate-lease.cjs.map +1 -1
  1488. package/dist/runner/ledger.cjs +27 -5
  1489. package/dist/runner/ledger.cjs.map +1 -1
  1490. package/dist/runner/lock.cjs +24 -11
  1491. package/dist/runner/lock.cjs.map +1 -1
  1492. package/dist/runner/project-current.cjs +63 -0
  1493. package/dist/runner/project-current.cjs.map +1 -1
  1494. package/dist/runner/project-current.d.cts +2 -0
  1495. package/dist/runner/project-current.d.mts +2 -0
  1496. package/dist/runner/project-current.d.ts +2 -0
  1497. package/dist/runner/record.cjs +659 -667
  1498. package/dist/runner/record.cjs.map +1 -1
  1499. package/dist/runner/record.d.cts +54 -81
  1500. package/dist/runner/record.d.mts +54 -81
  1501. package/dist/runner/record.d.ts +54 -81
  1502. package/dist/runner/rename-experiment.cjs +95 -54
  1503. package/dist/runner/rename-experiment.cjs.map +1 -1
  1504. package/dist/runner/rename-experiment.d.cts +19 -21
  1505. package/dist/runner/rename-experiment.d.mts +19 -21
  1506. package/dist/runner/rename-experiment.d.ts +19 -21
  1507. package/dist/runner/rename-experiment.js +2 -4
  1508. package/dist/runner/report.cjs +7 -2
  1509. package/dist/runner/report.cjs.map +1 -1
  1510. package/dist/runner/reporters/braintrust.cjs +4 -16
  1511. package/dist/runner/reporters/braintrust.cjs.map +1 -1
  1512. package/dist/runner/reporters/braintrust.d.cts +22 -5
  1513. package/dist/runner/reporters/braintrust.d.mts +22 -5
  1514. package/dist/runner/reporters/braintrust.d.ts +22 -5
  1515. package/dist/runner/reuse-plan.cjs +256 -435
  1516. package/dist/runner/reuse-plan.cjs.map +1 -1
  1517. package/dist/runner/reuse-plan.d.cts +43 -63
  1518. package/dist/runner/reuse-plan.d.mts +43 -63
  1519. package/dist/runner/reuse-plan.d.ts +43 -63
  1520. package/dist/runner/reuse-plan.js +6 -8
  1521. package/dist/runner/reuse-readback.cjs +157 -170
  1522. package/dist/runner/reuse-readback.cjs.map +1 -1
  1523. package/dist/runner/reuse-readback.d.cts +46 -62
  1524. package/dist/runner/reuse-readback.d.mts +46 -62
  1525. package/dist/runner/reuse-readback.d.ts +46 -62
  1526. package/dist/runner/reuse-readback.js +0 -2
  1527. package/dist/runner/run.cjs +110 -135
  1528. package/dist/runner/run.cjs.map +1 -1
  1529. package/dist/runner/run.d.cts +1 -1
  1530. package/dist/runner/run.d.mts +1 -1
  1531. package/dist/runner/run.d.ts +1 -1
  1532. package/dist/runner/sandbox-pool.cjs +55 -43
  1533. package/dist/runner/sandbox-pool.cjs.map +1 -1
  1534. package/dist/runner/sandbox-record-producer.cjs +21 -6
  1535. package/dist/runner/sandbox-record-producer.cjs.map +1 -1
  1536. package/dist/runner/sandbox-record-producer.d.cts +6 -4
  1537. package/dist/runner/sandbox-record-producer.d.mts +6 -4
  1538. package/dist/runner/sandbox-record-producer.d.ts +6 -4
  1539. package/dist/runner/sandbox-record-producer.js +4 -0
  1540. package/dist/runner/source-producer.cjs +208 -268
  1541. package/dist/runner/source-producer.cjs.map +1 -1
  1542. package/dist/runner/source-producer.d.cts +32 -17
  1543. package/dist/runner/source-producer.d.mts +32 -17
  1544. package/dist/runner/source-producer.d.ts +32 -17
  1545. package/dist/runner/source-producer.js +6 -4
  1546. package/dist/runner/timing.cjs +13 -9
  1547. package/dist/runner/timing.cjs.map +1 -1
  1548. package/dist/runner/types.cjs +3 -2
  1549. package/dist/runner/types.cjs.map +1 -1
  1550. package/dist/runner/types.d.cts +34 -52
  1551. package/dist/runner/types.d.mts +34 -52
  1552. package/dist/runner/types.d.ts +34 -52
  1553. package/dist/runner/types.js +30 -28
  1554. package/dist/sample/analysis.cjs +925 -919
  1555. package/dist/sample/analysis.cjs.map +1 -1
  1556. package/dist/sample/analysis.d.cts +32 -144
  1557. package/dist/sample/analysis.d.mts +32 -144
  1558. package/dist/sample/analysis.d.ts +32 -144
  1559. package/dist/sample/analysis.js +14 -26
  1560. package/dist/sample/capability.cjs +761 -0
  1561. package/dist/sample/capability.cjs.map +1 -0
  1562. package/dist/sample/capability.d.cts +189 -0
  1563. package/dist/sample/capability.d.mts +189 -0
  1564. package/dist/sample/capability.d.ts +189 -0
  1565. package/dist/sample/capability.js +36 -0
  1566. package/dist/sample/capability.js.map +1 -0
  1567. package/dist/sample/index.cjs +9 -13
  1568. package/dist/sample/index.cjs.map +1 -1
  1569. package/dist/sample/index.d.cts +2 -2
  1570. package/dist/sample/index.d.mts +2 -2
  1571. package/dist/sample/index.d.ts +2 -2
  1572. package/dist/sample/index.js +10 -24
  1573. package/dist/sandbox/build-coordinator.cjs +146 -147
  1574. package/dist/sandbox/build-coordinator.cjs.map +1 -1
  1575. package/dist/sandbox/case-types.cjs.map +1 -1
  1576. package/dist/sandbox/case-types.d.cts +6 -0
  1577. package/dist/sandbox/case-types.d.mts +6 -0
  1578. package/dist/sandbox/case-types.d.ts +6 -0
  1579. package/dist/sandbox/commands.cjs.map +1 -1
  1580. package/dist/sandbox/commands.d.cts +0 -2
  1581. package/dist/sandbox/commands.d.mts +0 -2
  1582. package/dist/sandbox/commands.d.ts +0 -2
  1583. package/dist/sandbox/compose.cjs +212 -153
  1584. package/dist/sandbox/compose.cjs.map +1 -1
  1585. package/dist/sandbox/compose.d.cts +11 -2
  1586. package/dist/sandbox/compose.d.mts +11 -2
  1587. package/dist/sandbox/compose.d.ts +11 -2
  1588. package/dist/sandbox/compose.js +32 -30
  1589. package/dist/sandbox/docker.cjs +59 -38
  1590. package/dist/sandbox/docker.cjs.map +1 -1
  1591. package/dist/sandbox/docker.d.cts +2 -1
  1592. package/dist/sandbox/docker.d.mts +2 -1
  1593. package/dist/sandbox/docker.d.ts +2 -1
  1594. package/dist/sandbox/e2b.cjs +30 -18
  1595. package/dist/sandbox/e2b.cjs.map +1 -1
  1596. package/dist/sandbox/index.cjs +2 -2
  1597. package/dist/sandbox/index.cjs.map +1 -1
  1598. package/dist/sandbox/index.d.cts +2 -2
  1599. package/dist/sandbox/index.d.mts +2 -2
  1600. package/dist/sandbox/index.d.ts +2 -2
  1601. package/dist/sandbox/index.js +52 -52
  1602. package/dist/sandbox/index.mjs +52 -52
  1603. package/dist/sandbox/io-retry.cjs +18 -14
  1604. package/dist/sandbox/io-retry.cjs.map +1 -1
  1605. package/dist/sandbox/io-retry.d.cts +7 -4
  1606. package/dist/sandbox/io-retry.d.mts +7 -4
  1607. package/dist/sandbox/io-retry.d.ts +7 -4
  1608. package/dist/sandbox/keep.cjs +79 -52
  1609. package/dist/sandbox/keep.cjs.map +1 -1
  1610. package/dist/sandbox/layer.cjs.map +1 -1
  1611. package/dist/sandbox/layer.d.cts +3 -3
  1612. package/dist/sandbox/layer.d.mts +3 -3
  1613. package/dist/sandbox/layer.d.ts +3 -3
  1614. package/dist/sandbox/paths.cjs +96 -12
  1615. package/dist/sandbox/paths.cjs.map +1 -1
  1616. package/dist/sandbox/paths.d.cts +16 -0
  1617. package/dist/sandbox/paths.d.mts +16 -0
  1618. package/dist/sandbox/paths.d.ts +16 -0
  1619. package/dist/sandbox/paths.js +10 -8
  1620. package/dist/sandbox/prepare-commands.cjs +0 -5
  1621. package/dist/sandbox/prepare-commands.cjs.map +1 -1
  1622. package/dist/sandbox/prepare-commands.d.cts +1 -1
  1623. package/dist/sandbox/prepare-commands.d.mts +1 -1
  1624. package/dist/sandbox/prepare-commands.d.ts +1 -1
  1625. package/dist/sandbox/record/attachment.cjs +16 -53
  1626. package/dist/sandbox/record/attachment.cjs.map +1 -1
  1627. package/dist/sandbox/record/attachment.d.cts +11 -15
  1628. package/dist/sandbox/record/attachment.d.mts +11 -15
  1629. package/dist/sandbox/record/attachment.d.ts +11 -15
  1630. package/dist/sandbox/record/attachment.js +2 -6
  1631. package/dist/sandbox/record/codec.cjs +17 -17
  1632. package/dist/sandbox/record/codec.cjs.map +1 -1
  1633. package/dist/sandbox/record/codec.d.cts +12 -12
  1634. package/dist/sandbox/record/codec.d.mts +12 -12
  1635. package/dist/sandbox/record/codec.d.ts +12 -12
  1636. package/dist/sandbox/record/codec.js +4 -4
  1637. package/dist/sandbox/record/model.cjs +7 -7
  1638. package/dist/sandbox/record/model.cjs.map +1 -1
  1639. package/dist/sandbox/record/model.d.cts +13 -13
  1640. package/dist/sandbox/record/model.d.mts +13 -13
  1641. package/dist/sandbox/record/model.d.ts +13 -13
  1642. package/dist/sandbox/record/model.js +6 -6
  1643. package/dist/sandbox/record/projector.cjs +16 -25
  1644. package/dist/sandbox/record/projector.cjs.map +1 -1
  1645. package/dist/sandbox/record/projector.d.cts +4 -18
  1646. package/dist/sandbox/record/projector.d.mts +4 -18
  1647. package/dist/sandbox/record/projector.d.ts +4 -18
  1648. package/dist/sandbox/record/projector.js +2 -2
  1649. package/dist/sandbox/registry.cjs +19 -9
  1650. package/dist/sandbox/registry.cjs.map +1 -1
  1651. package/dist/sandbox/request-executor.cjs +63 -0
  1652. package/dist/sandbox/request-executor.cjs.map +1 -0
  1653. package/dist/sandbox/request-executor.d.cts +16 -0
  1654. package/dist/sandbox/request-executor.d.mts +16 -0
  1655. package/dist/sandbox/request-executor.d.ts +16 -0
  1656. package/dist/sandbox/request-executor.js +8 -0
  1657. package/dist/sandbox/request-executor.js.map +1 -0
  1658. package/dist/sandbox/retry.cjs +42 -38
  1659. package/dist/sandbox/retry.cjs.map +1 -1
  1660. package/dist/sandbox/retry.d.cts +6 -6
  1661. package/dist/sandbox/retry.d.mts +6 -6
  1662. package/dist/sandbox/retry.d.ts +6 -6
  1663. package/dist/sandbox/runtime.cjs +47 -56
  1664. package/dist/sandbox/runtime.cjs.map +1 -1
  1665. package/dist/sandbox/runtime.d.cts +1 -1
  1666. package/dist/sandbox/runtime.d.mts +1 -1
  1667. package/dist/sandbox/runtime.d.ts +1 -1
  1668. package/dist/sandbox/transfer-errors.cjs +37 -5
  1669. package/dist/sandbox/transfer-errors.cjs.map +1 -1
  1670. package/dist/sandbox/transfer-errors.d.cts +14 -0
  1671. package/dist/sandbox/transfer-errors.d.mts +14 -0
  1672. package/dist/sandbox/transfer-errors.d.ts +14 -0
  1673. package/dist/sandbox/transfer-errors.js +12 -8
  1674. package/dist/sandbox/types.cjs.map +1 -1
  1675. package/dist/sandbox/types.d.cts +0 -7
  1676. package/dist/sandbox/types.d.mts +0 -7
  1677. package/dist/sandbox/types.d.ts +0 -7
  1678. package/dist/sandbox/vercel.cjs +10 -14
  1679. package/dist/sandbox/vercel.cjs.map +1 -1
  1680. package/dist/sources/attachment.cjs +103 -248
  1681. package/dist/sources/attachment.cjs.map +1 -1
  1682. package/dist/sources/attachment.d.cts +47 -319
  1683. package/dist/sources/attachment.d.mts +47 -319
  1684. package/dist/sources/attachment.d.ts +47 -319
  1685. package/dist/sources/attachment.js +8 -18
  1686. package/dist/sources/codec.cjs +56 -56
  1687. package/dist/sources/codec.cjs.map +1 -1
  1688. package/dist/sources/codec.d.cts +63 -63
  1689. package/dist/sources/codec.d.mts +63 -63
  1690. package/dist/sources/codec.d.ts +63 -63
  1691. package/dist/sources/codec.js +44 -44
  1692. package/dist/sources/index.cjs +0 -2
  1693. package/dist/sources/index.cjs.map +1 -1
  1694. package/dist/sources/index.d.cts +0 -2
  1695. package/dist/sources/index.d.mts +0 -2
  1696. package/dist/sources/index.d.ts +0 -2
  1697. package/dist/sources/index.js +72 -86
  1698. package/dist/sources/model.cjs +2 -2
  1699. package/dist/sources/model.cjs.map +1 -1
  1700. package/dist/sources/model.d.cts +41 -41
  1701. package/dist/sources/model.d.mts +41 -41
  1702. package/dist/sources/model.d.ts +41 -41
  1703. package/dist/sources/model.js +2 -2
  1704. package/dist/sources/projector.cjs +39 -268
  1705. package/dist/sources/projector.cjs.map +1 -1
  1706. package/dist/sources/projector.d.cts +40 -8
  1707. package/dist/sources/projector.d.mts +40 -8
  1708. package/dist/sources/projector.d.ts +40 -8
  1709. package/dist/sources/projector.js +4 -6
  1710. package/dist/types.js +30 -28
  1711. package/dist/view/data.cjs.map +1 -1
  1712. package/dist/view/data.d.cts +5 -4
  1713. package/dist/view/data.d.mts +5 -4
  1714. package/dist/view/data.d.ts +5 -4
  1715. package/dist/view/index.cjs +3 -4
  1716. package/dist/view/index.cjs.map +1 -1
  1717. package/dist/view/index.d.cts +2 -2
  1718. package/dist/view/index.d.mts +2 -2
  1719. package/dist/view/index.d.ts +2 -2
  1720. package/dist/view/index.js +2 -4
  1721. package/dist/view/report-view-cache.cjs +200 -0
  1722. package/dist/view/report-view-cache.cjs.map +1 -0
  1723. package/dist/view/report-view-cache.d.cts +67 -0
  1724. package/dist/view/report-view-cache.d.mts +67 -0
  1725. package/dist/view/report-view-cache.d.ts +67 -0
  1726. package/dist/view/report-view-cache.js +8 -0
  1727. package/dist/view/report-view-cache.js.map +1 -0
  1728. package/dist/view/server.cjs +99 -102
  1729. package/dist/view/server.cjs.map +1 -1
  1730. package/dist/view/server.d.cts +0 -6
  1731. package/dist/view/server.d.mts +0 -6
  1732. package/dist/view/server.d.ts +0 -6
  1733. package/dist/view/shared/types.cjs.map +1 -1
  1734. package/dist/view/site.cjs +19 -27
  1735. package/dist/view/site.cjs.map +1 -1
  1736. package/dist/view/site.d.cts +10 -12
  1737. package/dist/view/site.d.mts +10 -12
  1738. package/dist/view/site.d.ts +10 -12
  1739. package/dist/view/site.js +2 -4
  1740. package/docs-site/zh/examples/integrations/ai-sdk-v7.mdx +8 -8
  1741. package/docs-site/zh/examples/integrations/claude-sdk.mdx +8 -8
  1742. package/docs-site/zh/examples/integrations/codex-sdk.mdx +4 -4
  1743. package/docs-site/zh/examples/integrations/langgraph.mdx +6 -6
  1744. package/docs-site/zh/examples/integrations/pi-sdk.mdx +9 -9
  1745. package/docs-site/zh/explanation/adapter.mdx +3 -1
  1746. package/docs-site/zh/explanation/assert.mdx +6 -6
  1747. package/docs-site/zh/explanation/drive.mdx +1 -1
  1748. package/docs-site/zh/explanation/evals.mdx +6 -3
  1749. package/docs-site/zh/explanation/hitl.mdx +4 -2
  1750. package/docs-site/zh/explanation/judge.mdx +6 -6
  1751. package/docs-site/zh/explanation/overview.mdx +28 -29
  1752. package/docs-site/zh/explanation/record.mdx +26 -36
  1753. package/docs-site/zh/explanation/runner.mdx +7 -8
  1754. package/docs-site/zh/index.mdx +1 -1
  1755. package/docs-site/zh/introduction.mdx +1 -1
  1756. package/docs-site/zh/reference/cli.mdx +16 -19
  1757. package/docs-site/zh/reference/define-agent.mdx +0 -8
  1758. package/docs-site/zh/reference/define-config.mdx +6 -2
  1759. package/docs-site/zh/reference/define-eval.mdx +7 -5
  1760. package/docs-site/zh/reference/events.mdx +6 -3
  1761. package/docs-site/zh/reference/report-components.mdx +92 -88
  1762. package/docs-site/zh/reference/results-data.mdx +39 -49
  1763. package/docs-site/zh/troubleshooting/debug-sandbox.mdx +1 -1
  1764. package/docs-site/zh/troubleshooting/debugging.mdx +27 -28
  1765. package/docs-site/zh/tutorials/agent-feedback-loop.mdx +4 -4
  1766. package/docs-site/zh/tutorials/agent-onboarding.mdx +2 -2
  1767. package/docs-site/zh/tutorials/authoring.mdx +6 -3
  1768. package/docs-site/zh/tutorials/connect-your-agent.mdx +2 -2
  1769. package/docs-site/zh/tutorials/custom-reports.mdx +148 -76
  1770. package/docs-site/zh/tutorials/deploy-report-site.mdx +14 -17
  1771. package/docs-site/zh/tutorials/evaluation-kinds.mdx +3 -3
  1772. package/docs-site/zh/tutorials/fixtures.mdx +5 -5
  1773. package/docs-site/zh/tutorials/handle-execution-failures.mdx +1 -1
  1774. package/docs-site/zh/tutorials/install-custom-sandbox-agent.mdx +1 -1
  1775. package/docs-site/zh/tutorials/publish-report.mdx +28 -28
  1776. package/docs-site/zh/tutorials/quickstart.mdx +2 -2
  1777. package/docs-site/zh/tutorials/reporters.mdx +4 -4
  1778. package/docs-site/zh/tutorials/rerun-and-cache.mdx +5 -5
  1779. package/docs-site/zh/tutorials/sandbox-agent.mdx +2 -2
  1780. package/docs-site/zh/tutorials/sandbox-providers.mdx +3 -3
  1781. package/docs-site/zh/tutorials/theming.mdx +47 -19
  1782. package/docs-site/zh/tutorials/viewing-results.mdx +43 -80
  1783. package/docs-site/zh/tutorials/write-experiment.mdx +16 -11
  1784. package/docs-site/zh/tutorials/write-send.mdx +11 -3
  1785. package/package.json +83 -11
  1786. package/dist/assertions/record/diff-model.cjs +0 -120
  1787. package/dist/assertions/record/diff-model.cjs.map +0 -1
  1788. package/dist/assertions/record/diff-model.d.cts +0 -47
  1789. package/dist/assertions/record/diff-model.d.mts +0 -47
  1790. package/dist/assertions/record/diff-model.d.ts +0 -47
  1791. package/dist/assertions/record/diff-model.js +0 -12
  1792. package/dist/assertions/record/diff-model.js.map +0 -1
  1793. package/dist/projection/attachment-result.cjs +0 -50
  1794. package/dist/projection/attachment-result.cjs.map +0 -1
  1795. package/dist/projection/attachment-result.d.cts +0 -38
  1796. package/dist/projection/attachment-result.d.mts +0 -38
  1797. package/dist/projection/attachment-result.d.ts +0 -38
  1798. package/dist/projection/attachment-result.js +0 -6
  1799. package/dist/projection/attachment-result.js.map +0 -1
  1800. package/dist/projection/attempt-selection.cjs +0 -87
  1801. package/dist/projection/attempt-selection.cjs.map +0 -1
  1802. package/dist/projection/attempt-selection.d.cts +0 -40
  1803. package/dist/projection/attempt-selection.d.mts +0 -40
  1804. package/dist/projection/attempt-selection.d.ts +0 -40
  1805. package/dist/projection/attempt-selection.js +0 -8
  1806. package/dist/projection/attempt-selection.js.map +0 -1
  1807. package/dist/projection/coverage.cjs +0 -106
  1808. package/dist/projection/coverage.cjs.map +0 -1
  1809. package/dist/projection/coverage.d.cts +0 -43
  1810. package/dist/projection/coverage.d.mts +0 -43
  1811. package/dist/projection/coverage.d.ts +0 -43
  1812. package/dist/projection/coverage.js +0 -6
  1813. package/dist/projection/coverage.js.map +0 -1
  1814. package/dist/projection/index.cjs +0 -36
  1815. package/dist/projection/index.cjs.map +0 -1
  1816. package/dist/projection/index.d.cts +0 -25
  1817. package/dist/projection/index.d.mts +0 -25
  1818. package/dist/projection/index.d.ts +0 -25
  1819. package/dist/projection/index.js +0 -46
  1820. package/dist/projection/index.mjs +0 -46
  1821. package/dist/projection/model.cjs +0 -3
  1822. package/dist/projection/model.cjs.map +0 -1
  1823. package/dist/projection/model.d.cts +0 -49
  1824. package/dist/projection/model.d.mts +0 -49
  1825. package/dist/projection/model.d.ts +0 -49
  1826. package/dist/projection/model.js +0 -4
  1827. package/dist/projection/model.js.map +0 -1
  1828. package/dist/projection/projector.cjs +0 -111
  1829. package/dist/projection/projector.cjs.map +0 -1
  1830. package/dist/projection/projector.d.cts +0 -51
  1831. package/dist/projection/projector.d.mts +0 -51
  1832. package/dist/projection/projector.d.ts +0 -51
  1833. package/dist/projection/projector.js +0 -16
  1834. package/dist/projection/projector.js.map +0 -1
  1835. package/dist/projection/runtime.cjs +0 -246
  1836. package/dist/projection/runtime.cjs.map +0 -1
  1837. package/dist/projection/runtime.d.cts +0 -14
  1838. package/dist/projection/runtime.d.mts +0 -14
  1839. package/dist/projection/runtime.d.ts +0 -14
  1840. package/dist/projection/runtime.js +0 -6
  1841. package/dist/record/migration/errors.cjs +0 -68
  1842. package/dist/record/migration/errors.cjs.map +0 -1
  1843. package/dist/record/migration/errors.d.cts +0 -73
  1844. package/dist/record/migration/errors.d.mts +0 -73
  1845. package/dist/record/migration/errors.d.ts +0 -73
  1846. package/dist/record/migration/errors.js +0 -22
  1847. package/dist/record/migration/errors.js.map +0 -1
  1848. package/dist/record/migration/identity.cjs +0 -27
  1849. package/dist/record/migration/identity.cjs.map +0 -1
  1850. package/dist/record/migration/identity.d.cts +0 -5
  1851. package/dist/record/migration/identity.d.mts +0 -5
  1852. package/dist/record/migration/identity.d.ts +0 -5
  1853. package/dist/record/migration/identity.js +0 -8
  1854. package/dist/record/migration/internal.cjs +0 -3
  1855. package/dist/record/migration/internal.cjs.map +0 -1
  1856. package/dist/record/migration/internal.d.cts +0 -111
  1857. package/dist/record/migration/internal.d.mts +0 -111
  1858. package/dist/record/migration/internal.d.ts +0 -111
  1859. package/dist/record/migration/internal.js +0 -4
  1860. package/dist/record/migration/internal.js.map +0 -1
  1861. package/dist/record/migration/orchestrate.cjs +0 -368
  1862. package/dist/record/migration/orchestrate.cjs.map +0 -1
  1863. package/dist/record/migration/orchestrate.d.cts +0 -113
  1864. package/dist/record/migration/orchestrate.d.mts +0 -113
  1865. package/dist/record/migration/orchestrate.d.ts +0 -113
  1866. package/dist/record/migration/orchestrate.js +0 -16
  1867. package/dist/record/migration/orchestrate.js.map +0 -1
  1868. package/dist/record/migration/plan.cjs +0 -63
  1869. package/dist/record/migration/plan.cjs.map +0 -1
  1870. package/dist/record/migration/plan.d.cts +0 -32
  1871. package/dist/record/migration/plan.d.mts +0 -32
  1872. package/dist/record/migration/plan.d.ts +0 -32
  1873. package/dist/record/migration/plan.js +0 -10
  1874. package/dist/record/migration/plan.js.map +0 -1
  1875. package/dist/record/migration/registry.cjs +0 -150
  1876. package/dist/record/migration/registry.cjs.map +0 -1
  1877. package/dist/record/migration/registry.d.cts +0 -61
  1878. package/dist/record/migration/registry.d.mts +0 -61
  1879. package/dist/record/migration/registry.d.ts +0 -61
  1880. package/dist/record/migration/registry.js +0 -14
  1881. package/dist/record/migration/registry.js.map +0 -1
  1882. package/dist/record/migration/storage.cjs +0 -382
  1883. package/dist/record/migration/storage.cjs.map +0 -1
  1884. package/dist/record/migration/storage.d.cts +0 -18
  1885. package/dist/record/migration/storage.d.mts +0 -18
  1886. package/dist/record/migration/storage.d.ts +0 -18
  1887. package/dist/record/migration/storage.js +0 -6
  1888. package/dist/record/migration/storage.js.map +0 -1
  1889. package/dist/record/migration/types.cjs.map +0 -1
  1890. package/dist/record/migration/types.d.cts +0 -16
  1891. package/dist/record/migration/types.d.mts +0 -16
  1892. package/dist/record/migration/types.d.ts +0 -16
  1893. package/dist/record/reader/internal.cjs +0 -17
  1894. package/dist/record/reader/internal.cjs.map +0 -1
  1895. package/dist/record/reader/internal.d.cts +0 -26
  1896. package/dist/record/reader/internal.d.mts +0 -26
  1897. package/dist/record/reader/internal.d.ts +0 -26
  1898. package/dist/record/reader/internal.js +0 -8
  1899. package/dist/record/reader/internal.js.map +0 -1
  1900. package/dist/record/writer/runtime.cjs +0 -656
  1901. package/dist/record/writer/runtime.cjs.map +0 -1
  1902. package/dist/record/writer/runtime.d.cts +0 -7
  1903. package/dist/record/writer/runtime.d.mts +0 -7
  1904. package/dist/record/writer/runtime.d.ts +0 -7
  1905. package/dist/record/writer/runtime.js +0 -6
  1906. package/dist/report/author/identity.cjs +0 -268
  1907. package/dist/report/author/identity.cjs.map +0 -1
  1908. package/dist/report/author/identity.d.cts +0 -75
  1909. package/dist/report/author/identity.d.mts +0 -75
  1910. package/dist/report/author/identity.d.ts +0 -75
  1911. package/dist/report/author/identity.js +0 -34
  1912. package/dist/report/author/identity.js.map +0 -1
  1913. package/dist/report/author/index.cjs +0 -19
  1914. package/dist/report/author/index.cjs.map +0 -1
  1915. package/dist/report/author/index.d.cts +0 -4
  1916. package/dist/report/author/index.d.mts +0 -4
  1917. package/dist/report/author/index.d.ts +0 -4
  1918. package/dist/report/author/index.js +0 -30
  1919. package/dist/report/author/internal.cjs +0 -98
  1920. package/dist/report/author/internal.cjs.map +0 -1
  1921. package/dist/report/author/internal.d.cts +0 -91
  1922. package/dist/report/author/internal.d.mts +0 -91
  1923. package/dist/report/author/internal.d.ts +0 -91
  1924. package/dist/report/author/internal.js +0 -18
  1925. package/dist/report/author/internal.js.map +0 -1
  1926. package/dist/report/author/model.cjs +0 -467
  1927. package/dist/report/author/model.cjs.map +0 -1
  1928. package/dist/report/author/model.d.cts +0 -241
  1929. package/dist/report/author/model.d.mts +0 -241
  1930. package/dist/report/author/model.d.ts +0 -241
  1931. package/dist/report/author/model.js +0 -32
  1932. package/dist/report/author/model.js.map +0 -1
  1933. package/dist/report/execution/index.cjs +0 -20
  1934. package/dist/report/execution/index.cjs.map +0 -1
  1935. package/dist/report/execution/index.d.cts +0 -3
  1936. package/dist/report/execution/index.d.mts +0 -3
  1937. package/dist/report/execution/index.d.ts +0 -3
  1938. package/dist/report/execution/index.js +0 -30
  1939. package/dist/report/execution/problems.cjs +0 -210
  1940. package/dist/report/execution/problems.cjs.map +0 -1
  1941. package/dist/report/execution/problems.d.cts +0 -54
  1942. package/dist/report/execution/problems.d.mts +0 -54
  1943. package/dist/report/execution/problems.d.ts +0 -54
  1944. package/dist/report/execution/problems.js +0 -14
  1945. package/dist/report/execution/problems.js.map +0 -1
  1946. package/dist/report/execution/results.cjs +0 -26
  1947. package/dist/report/execution/results.cjs.map +0 -1
  1948. package/dist/report/execution/results.d.cts +0 -102
  1949. package/dist/report/execution/results.d.mts +0 -102
  1950. package/dist/report/execution/results.d.ts +0 -102
  1951. package/dist/report/execution/results.js +0 -8
  1952. package/dist/report/execution/results.js.map +0 -1
  1953. package/dist/report/host/html.cjs +0 -424
  1954. package/dist/report/host/html.cjs.map +0 -1
  1955. package/dist/report/host/html.d.cts +0 -28
  1956. package/dist/report/host/html.d.mts +0 -28
  1957. package/dist/report/host/html.d.ts +0 -28
  1958. package/dist/report/host/html.js +0 -6
  1959. package/dist/report/host/html.js.map +0 -1
  1960. package/dist/report/host/node/theme.cjs +0 -21
  1961. package/dist/report/host/node/theme.cjs.map +0 -1
  1962. package/dist/report/host/node/theme.d.cts +0 -1
  1963. package/dist/report/host/node/theme.d.mts +0 -1
  1964. package/dist/report/host/node/theme.d.ts +0 -1
  1965. package/dist/report/host/node/theme.js +0 -14
  1966. package/dist/report/host/presentation.cjs +0 -423
  1967. package/dist/report/host/presentation.cjs.map +0 -1
  1968. package/dist/report/host/presentation.d.cts +0 -42
  1969. package/dist/report/host/presentation.d.mts +0 -42
  1970. package/dist/report/host/presentation.d.ts +0 -42
  1971. package/dist/report/host/presentation.js +0 -16
  1972. package/dist/report/host/theme.cjs +0 -223
  1973. package/dist/report/host/theme.cjs.map +0 -1
  1974. package/dist/report/host/theme.d.cts +0 -64
  1975. package/dist/report/host/theme.d.mts +0 -64
  1976. package/dist/report/host/theme.d.ts +0 -64
  1977. package/dist/report/host/theme.js +0 -14
  1978. package/dist/report/host/theme.js.map +0 -1
  1979. package/dist/report/semantic/document.cjs +0 -593
  1980. package/dist/report/semantic/document.cjs.map +0 -1
  1981. package/dist/report/semantic/document.d.cts +0 -162
  1982. package/dist/report/semantic/document.d.mts +0 -162
  1983. package/dist/report/semantic/document.d.ts +0 -162
  1984. package/dist/report/semantic/document.js +0 -38
  1985. package/dist/report/semantic/document.js.map +0 -1
  1986. package/dist/report/semantic/index.cjs +0 -18
  1987. package/dist/report/semantic/index.cjs.map +0 -1
  1988. package/dist/report/semantic/index.d.cts +0 -1
  1989. package/dist/report/semantic/index.d.mts +0 -1
  1990. package/dist/report/semantic/index.d.ts +0 -1
  1991. package/dist/report/semantic/index.js +0 -38
  1992. package/dist/shared/facts.cjs +0 -24
  1993. package/dist/shared/facts.cjs.map +0 -1
  1994. package/dist/shared/facts.d.cts +0 -7
  1995. package/dist/shared/facts.d.mts +0 -7
  1996. package/dist/shared/facts.d.ts +0 -7
  1997. package/dist/shared/facts.js +0 -6
  1998. package/dist/shared/facts.js.map +0 -1
  1999. package/dist/show/json.cjs +0 -8
  2000. package/dist/show/json.cjs.map +0 -1
  2001. package/dist/show/json.d.cts +0 -2
  2002. package/dist/show/json.d.mts +0 -2
  2003. package/dist/show/json.d.ts +0 -2
  2004. package/dist/show/json.js +0 -8
  2005. package/dist/show/json.js.map +0 -1
  2006. package/dist/show/render.cjs +0 -7
  2007. package/dist/show/render.cjs.map +0 -1
  2008. package/dist/show/render.d.cts +0 -2
  2009. package/dist/show/render.d.mts +0 -2
  2010. package/dist/show/render.d.ts +0 -2
  2011. package/dist/show/render.js +0 -6
  2012. package/dist/show/render.js.map +0 -1
  2013. package/dist/sources/assemble.cjs +0 -634
  2014. package/dist/sources/assemble.cjs.map +0 -1
  2015. package/dist/sources/assemble.d.cts +0 -6
  2016. package/dist/sources/assemble.d.mts +0 -6
  2017. package/dist/sources/assemble.d.ts +0 -6
  2018. package/dist/sources/assemble.js +0 -6
  2019. package/dist/sources/assemble.js.map +0 -1
  2020. package/dist/sources/projection-model.cjs +0 -3
  2021. package/dist/sources/projection-model.cjs.map +0 -1
  2022. package/dist/sources/projection-model.d.cts +0 -327
  2023. package/dist/sources/projection-model.d.mts +0 -327
  2024. package/dist/sources/projection-model.d.ts +0 -327
  2025. package/dist/sources/projection-model.js +0 -4
  2026. package/dist/sources/projection-model.js.map +0 -1
  2027. /package/dist/{projection → coordination/host}/index.js.map +0 -0
  2028. /package/dist/{projection → coordination/host}/index.mjs.map +0 -0
  2029. /package/dist/{projection → coordination/host}/runtime.js.map +0 -0
  2030. /package/dist/{record/migration → coordination/host}/types.cjs +0 -0
  2031. /package/dist/{record/migration → coordination/host}/types.js +0 -0
  2032. /package/dist/{record/migration → coordination/host}/types.js.map +0 -0
  2033. /package/dist/{record/migration → coordination}/identity.js.map +0 -0
  2034. /package/dist/{report/author → coordination}/index.js.map +0 -0
  2035. /package/dist/{report/execution → coordination/platform}/index.js.map +0 -0
  2036. /package/dist/{report/semantic → experiment/host}/index.js.map +0 -0
  2037. /package/dist/record/{writer → host}/runtime.js.map +0 -0
  2038. /package/dist/report/{host/presentation.js.map → presentation.js.map} +0 -0
  2039. /package/dist/report/{host/node/theme.js.map → theme.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["api.ts"],"names":[],"mappings":";;;AA4KA;;;;GAIG;AACU,QAAA,oBAAoB,GAAkB,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAevF;;;;;GAKG;AACH,MAAa,6BAA8B,SAAQ,KAAK;IAE/B;IADZ,IAAI,GAAG,+BAA+B,CAAC;IAChD,YAAqB,MAA4G;QAC7H,KAAK,CAAC,kDAAkD,MAAM,EAAE,CAAC,CAAC;QADjD,WAAM,GAAN,MAAM,CAAsG;QAE7H,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAC;IAChD,CAAC;CACJ;AAND,sEAMC","sourcesContent":["import type { Effect } from \"effect\";\nimport type { BooleanMatch, MatchDiagnostic, ScoreMatch, ThresholdedScoreMatch, } from \"./match.ts\";\nimport type { AgentWorkspaceDiff } from \"./workspace-diff.ts\";\n/** The two Evaluation kinds deliberately share one Assertion entry model. */\nexport type AssertionEvaluationKind = \"pass\" | \"score\";\n/**\n * A bounded JSON-shaped value owned by the authoring runtime. It is a\n * domain value, not the durable Assertions attachment material type.\n */\nexport type AssertionSnapshotValue = null | boolean | number | string | readonly AssertionSnapshotValue[] | AssertionSnapshotObject;\nexport interface AssertionSnapshotObject {\n readonly [key: string]: AssertionSnapshotValue;\n}\nexport interface AssertionDisplay {\n readonly key?: string;\n readonly label?: string;\n readonly groupPath: readonly string[];\n}\nexport type AssertionCoverage = {\n readonly state: \"complete\";\n} | {\n readonly state: \"partial\";\n readonly reason: \"sampled\" | \"truncated\" | \"redacted\" | \"provider-limited\";\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"not-collected\" | \"source-unavailable\" | \"producer-failed\";\n} | {\n readonly state: \"not-applicable\";\n readonly reason: \"optional-material\" | \"unsupported-subject\";\n};\nexport type AssertionLimitation = {\n readonly kind: \"redacted\";\n readonly fieldCount: number;\n} | {\n readonly kind: \"sampled\";\n readonly captured: number;\n readonly knownTotal?: number;\n} | {\n readonly kind: \"truncated\";\n readonly omittedBytes: number;\n} | {\n readonly kind: \"provider-limited\";\n};\n/**\n * Authoring material intentionally has no blob ref, attachment entry ID, or\n * durable schema identity. The private producer adapter selects the exact\n * same-owner Attachment schema when it serializes this domain reference.\n */\nexport type AssertionMaterial = {\n readonly kind: \"snapshot\";\n readonly value: AssertionSnapshotValue;\n} | {\n readonly kind: \"record-attachment\";\n readonly preview: string;\n};\nexport type AssertionCriterion = {\n readonly kind: \"value-match\";\n readonly subject: \"explicit-value\";\n} | {\n readonly kind: \"scope-status\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly assertion: \"succeeded\" | \"no-failed-actions\";\n} | {\n readonly kind: \"occurrence\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly occurrence: \"tool\" | \"skill\" | \"event\";\n readonly assertion: \"present\" | \"absent\" | \"count\";\n readonly matcher?: string;\n readonly quantifier?: {\n readonly kind: \"absent\";\n } | {\n readonly kind: \"at-least\" | \"exact\";\n readonly count: number;\n };\n} | {\n readonly kind: \"judge-measurement\";\n readonly recipe: \"closed-qa\" | \"factuality\" | \"summarizes\";\n readonly scale: \"unit-interval\";\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"changed-paths\";\n readonly paths: readonly string[];\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"no-changes\";\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"file-changed\";\n readonly path: string;\n readonly status?: \"added\" | \"modified\" | \"deleted\";\n readonly before?: string;\n readonly after?: string;\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"file-deleted\";\n readonly path: string;\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"not-in-diff\";\n readonly pattern: string;\n readonly flags: string;\n readonly content: \"added\" | \"removed\" | \"both\";\n} | {\n readonly kind: \"direct-score\";\n readonly source: \"author\";\n} | {\n readonly kind: \"third-party\";\n readonly name: string;\n readonly schemaId: string;\n readonly data: AssertionSnapshotValue;\n};\nexport type AssertionScoreContribution = {\n readonly state: \"not-scored\";\n} | {\n readonly state: \"earned\";\n readonly points: number;\n readonly earned: number;\n} | {\n readonly state: \"unavailable\";\n readonly points: number;\n readonly reason: \"source-unavailable\" | \"evaluation-errored\" | \"not-applicable\";\n};\nexport type AssertionResult = {\n readonly state: \"matched\";\n readonly gate: \"not-gate\" | \"satisfied\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"earned\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n} | {\n readonly state: \"mismatched\";\n readonly reason: \"condition-not-met\";\n readonly gate: \"not-gate\" | \"failed\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"earned\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n readonly gate: \"not-gate\" | \"unavailable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n} | {\n readonly state: \"errored\";\n readonly reason: \"evaluator-failed\" | \"producer-interrupted\" | \"invalid-subject\";\n readonly gate: \"not-gate\" | \"unavailable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n} | {\n readonly state: \"not-applicable\";\n readonly reason: \"coverage-not-applicable\";\n readonly gate: \"not-gate\" | \"not-applicable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n};\n/** One fully formed author/runtime result, before durable attachment encoding. */\nexport interface SealedAssertionEntry {\n readonly display: AssertionDisplay;\n readonly criterion: AssertionCriterion;\n readonly subject: AssertionMaterial;\n readonly evidence: readonly AssertionMaterial[];\n readonly coverage: AssertionCoverage;\n readonly limitations: readonly AssertionLimitation[];\n readonly result: AssertionResult;\n}\n/**\n * Assertion handles are runtime-owned capabilities, not subjects for another\n * `t.check`. The symbol is public only for TypeScript's nominal boundary; the\n * runtime also keeps an unforgeable ownership registry.\n */\nexport const assertionHandleBrand: unique symbol = Symbol(\"niceeval.assertion-handle\");\nexport interface AssertionHandleBase {\n readonly [assertionHandleBrand]: true;\n key(value: string): this;\n label(value: string): this;\n /** Adds one display-only group segment to this already registered entry. */\n group(title: string): this;\n}\n/** A value that is not an AssertionHandle. */\nexport type AssertionSubject<Value> = Value extends AssertionHandleBase ? never : Value;\nexport interface AssertionStopError {\n readonly _tag: \"AssertionStopError\";\n readonly entryIndex: number;\n readonly reason: \"condition-not-met\" | \"source-unavailable\" | \"evaluator-failed\" | \"not-applicable\";\n}\n/**\n * A public authoring call reached an Attempt boundary which is no longer able\n * to accept it. Keeping this distinct from an evaluator failure lets a\n * detached Promise diagnose its own lifecycle error instead of looking like a\n * failed assertion.\n */\nexport class AssertionAuthoringClosedError extends Error {\n readonly _tag = \"AssertionAuthoringClosedError\";\n constructor(readonly reason: \"stop-latched\" | \"attempt-sealing\" | \"attempt-sealed\" | \"attempt-interrupted\" | \"runtime-unattached\") {\n super(`Cannot use an Assertion authoring handle after ${reason}`);\n this.name = \"AssertionAuthoringClosedError\";\n }\n}\n/**\n * The owning Attempt executes a requested stop barrier in its existing Effect\n * scope. Handles only enqueue this request; they never create a runtime.\n */\nexport type AssertionStopExecutor = <Value>(effect: Effect.Effect<Value, AssertionStopError, never>) => Promise<Value>;\n/** A Boolean entry is evaluated once and may retain a refinement witness. */\nexport type BooleanAssertionEvaluation<Refined> = {\n readonly state: \"matched\";\n readonly value: Refined;\n readonly diagnostic?: MatchDiagnostic;\n} | {\n readonly state: \"mismatched\";\n readonly diagnostic?: MatchDiagnostic;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n readonly diagnostic?: MatchDiagnostic;\n} | {\n readonly state: \"not-applicable\";\n readonly diagnostic?: MatchDiagnostic;\n};\n/** A measurement is always a finite unit-interval value when it is available. */\nexport type MeasurementAssertionEvaluation = {\n readonly state: \"measured\";\n readonly value: number;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n} | {\n readonly state: \"not-applicable\";\n} | {\n readonly state: \"errored\";\n};\nexport interface CapturedAssertionSnapshot {\n readonly material: Extract<AssertionMaterial, {\n readonly kind: \"snapshot\";\n }>;\n readonly coverage: AssertionCoverage;\n readonly limitations: readonly AssertionLimitation[];\n}\nexport interface AssertionRegistrationBase {\n readonly criterion: AssertionCriterion;\n readonly subject: AssertionMaterial;\n readonly evidence?: readonly AssertionMaterial[];\n readonly coverage?: AssertionCoverage;\n readonly limitations?: readonly AssertionLimitation[];\n}\n/**\n * Scope, Judge, and Sandbox adapters use this internal registration shape.\n * They still register exactly one Assertion entry; they do not manufacture a\n * separate intermediate value for a later consumer.\n */\nexport interface BooleanAssertionRegistration<Refined> extends AssertionRegistrationBase {\n readonly evaluate: () => Effect.Effect<BooleanAssertionEvaluation<Refined>, unknown, never>;\n}\nexport interface MeasurementAssertionRegistration extends AssertionRegistrationBase {\n readonly evaluate: () => Effect.Effect<MeasurementAssertionEvaluation, unknown, never>;\n}\nexport interface PassBooleanAssertionHandle<out Refined> extends AssertionHandleBase {\n readonly kind: \"boolean\";\n /** An unavailable/errored optional entry does not independently error Verdict. */\n optional(): this;\n gate(): this;\n orStop(): Promise<Refined>;\n}\nexport interface ScoreBooleanAssertionHandle<out Refined> extends AssertionHandleBase {\n readonly kind: \"boolean\";\n score(points: number): this;\n orStop(): Promise<Refined>;\n}\nexport interface PassMeasurementAssertionHandle<Thresholded extends boolean = false> extends AssertionHandleBase {\n readonly kind: \"measurement\";\n /** An unavailable/errored optional entry does not independently error Verdict. */\n optional(): this;\n atLeast(value: number): PassMeasurementAssertionHandle<true>;\n gate(this: PassMeasurementAssertionHandle<true>): this;\n orStop(this: PassMeasurementAssertionHandle<true>): Promise<number>;\n}\nexport interface ScoreMeasurementAssertionHandle<Thresholded extends boolean = false> extends AssertionHandleBase {\n readonly kind: \"measurement\";\n atLeast(value: number): ScoreMeasurementAssertionHandle<true>;\n score(points: number): this;\n orStop(this: ScoreMeasurementAssertionHandle<true>): Promise<number>;\n}\n/** A Boolean Assertion that intentionally has no author control-flow operation. */\ninterface PostRunPassBooleanAssertionHandle<Refined> extends AssertionHandleBase {\n readonly kind: \"boolean\";\n optional(): this;\n gate(): this;\n}\ninterface PostRunScoreBooleanAssertionHandle<Refined> extends AssertionHandleBase {\n readonly kind: \"boolean\";\n score(points: number): this;\n}\nexport type PostRunBooleanAssertionHandle<Kind extends AssertionEvaluationKind, Refined> = Kind extends \"pass\" ? PostRunPassBooleanAssertionHandle<Refined> : PostRunScoreBooleanAssertionHandle<Refined>;\n/** Direct score is an Assertion entry, but has no condition or stop barrier. */\nexport interface DirectScoreAssertionHandle extends AssertionHandleBase {\n readonly kind: \"direct-score\";\n}\nexport interface AssertionGroupContext {\n /**\n * Runs an ordinary author callback with one display-only group segment. The\n * callback remains inside the Attempt's outer Promise boundary; this facade\n * does not evaluate an Effect or create an independent runtime.\n */\n group<Value>(title: string, body: () => Value | PromiseLike<Value>): Promise<Awaited<Value>>;\n}\nexport interface PassAssertionsContext extends AssertionGroupContext {\n readonly evaluationKind: \"pass\";\n check<Value, Refined extends Value>(value: AssertionSubject<Value>, match: BooleanMatch<NoInfer<Value>, Refined, \"value\">): PassBooleanAssertionHandle<Refined>;\n check<Value>(value: AssertionSubject<Value>, match: ScoreMatch<NoInfer<Value>>): PassMeasurementAssertionHandle;\n check<Value>(value: AssertionSubject<Value>, match: ThresholdedScoreMatch<NoInfer<Value>>): PassMeasurementAssertionHandle<true>;\n}\nexport interface ScoreAssertionsContext extends AssertionGroupContext {\n readonly evaluationKind: \"score\";\n check<Value, Refined extends Value>(value: AssertionSubject<Value>, match: BooleanMatch<NoInfer<Value>, Refined, \"value\">): ScoreBooleanAssertionHandle<Refined>;\n check<Value>(value: AssertionSubject<Value>, match: ScoreMatch<NoInfer<Value>>): ScoreMeasurementAssertionHandle;\n check<Value>(value: AssertionSubject<Value>, match: ThresholdedScoreMatch<NoInfer<Value>>): ScoreMeasurementAssertionHandle<true>;\n score(points: number): DirectScoreAssertionHandle;\n}\nexport type AssertionsContext<Kind extends AssertionEvaluationKind> = Kind extends \"pass\" ? PassAssertionsContext : ScoreAssertionsContext;\nexport type BooleanAssertionHandle<Kind extends AssertionEvaluationKind, Refined> = Kind extends \"pass\" ? PassBooleanAssertionHandle<Refined> : ScoreBooleanAssertionHandle<Refined>;\nexport type MeasurementAssertionHandle<Kind extends AssertionEvaluationKind> = Kind extends \"pass\" ? PassMeasurementAssertionHandle : ScoreMeasurementAssertionHandle;\nexport interface AssertionSealOptions {\n readonly execution?: \"completed\" | \"errored\";\n readonly explicitlySkipped?: boolean;\n /**\n * The owning Attempt was interrupted before ordinary evaluation could\n * finish. Unsettled entries are sealed as producer-interrupted instead of\n * being silently omitted or evaluated on a detached runtime.\n */\n readonly interrupted?: boolean;\n}\nexport interface AssertionSealError {\n readonly _tag: \"AssertionSealError\";\n readonly code: \"pass-measurement-threshold-missing\";\n readonly entryIndex: number;\n}\n/** The sealed evaluation is a domain result, not a durable Record payload. */\nexport interface SealedAssertionEvaluationEntry {\n readonly required: boolean;\n readonly result: AssertionResult;\n}\nexport interface SealedAssertionEvaluation {\n readonly execution: \"completed\" | \"errored\";\n readonly explicitlySkipped: boolean;\n readonly assertions: readonly SealedAssertionEvaluationEntry[];\n}\n/**\n * One immutable result feeds the Verdict/Score fold and the private durable\n * producer adapter. No RecordAttachment writer type crosses this boundary.\n */\nexport interface SealedAssertionsRuntime {\n readonly entries: readonly SealedAssertionEntry[];\n readonly evaluation: SealedAssertionEvaluation;\n}\n/** The runtime Verdict is independent of the durable Verdict attachment codec. */\nexport interface AssertionVerdict {\n readonly state: \"passed\" | \"failed\" | \"errored\" | \"skipped\";\n}\nexport type AssertionScoreIncompleteReason = \"execution-errored\" | \"source-unavailable\" | \"evaluation-errored\" | \"not-applicable\";\n/** The runtime Score is independent of the durable Score attachment codec. */\nexport type AssertionScore = {\n readonly state: \"complete\";\n readonly earned: number;\n} | {\n readonly state: \"partial\";\n readonly earned: number;\n readonly reasons: readonly AssertionScoreIncompleteReason[];\n} | {\n readonly state: \"unavailable\";\n readonly reasons: readonly AssertionScoreIncompleteReason[];\n};\n/**\n * The attempt-owned frozen result is handed from Runner to the Evaluation\n * Record adapter. The adapter alone adds attachment schemas and writes.\n */\nexport interface SealedAttemptAssertions {\n readonly entries: readonly SealedAssertionEntry[];\n readonly evaluation: SealedAssertionEvaluation;\n readonly workspaceDiff?: AgentWorkspaceDiff;\n readonly verdict: AssertionVerdict;\n readonly score?: AssertionScore;\n}\nexport interface AssertionsRuntime<Kind extends AssertionEvaluationKind> {\n readonly evaluationKind: Kind;\n readonly t: AssertionsContext<Kind>;\n registerBoolean<Refined>(definition: BooleanAssertionRegistration<Refined>): BooleanAssertionHandle<Kind, Refined>;\n registerMeasurement(definition: MeasurementAssertionRegistration): MeasurementAssertionHandle<Kind>;\n seal(options?: AssertionSealOptions): Effect.Effect<SealedAssertionsRuntime, AssertionSealError, never>;\n}\n"]}
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["api.ts"],"names":[],"mappings":";;;AA4KA;;;;GAIG;AACU,QAAA,oBAAoB,GAAkB,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAevF;;;;;GAKG;AACH,MAAa,6BAA8B,SAAQ,KAAK;IAE/B;IADZ,IAAI,GAAG,+BAA+B,CAAC;IAChD,YAAqB,MAA4G;QAC7H,KAAK,CAAC,kDAAkD,MAAM,EAAE,CAAC,CAAC;QADjD,WAAM,GAAN,MAAM,CAAsG;QAE7H,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAC;IAChD,CAAC;CACJ;AAND,sEAMC","sourcesContent":["import type { Effect } from \"effect\";\nimport type { BooleanMatch, MatchDiagnostic, ScoreMatch, ThresholdedScoreMatch, } from \"./match.ts\";\nimport type { AgentWorkspaceDiff } from \"./workspace-diff.ts\";\n/** The two Evaluation kinds deliberately share one Assertion entry model. */\nexport type AssertionEvaluationKind = \"pass\" | \"score\";\n/**\n * A bounded JSON-shaped value owned by the authoring runtime. It is a\n * domain value, not the durable Assertions attachment material type.\n */\nexport type AssertionSnapshotValue = null | boolean | number | string | readonly AssertionSnapshotValue[] | AssertionSnapshotObject;\nexport interface AssertionSnapshotObject {\n readonly [key: string]: AssertionSnapshotValue;\n}\nexport interface AssertionDisplay {\n readonly key?: string;\n readonly label?: string;\n readonly groupPath: readonly string[];\n}\nexport type AssertionCoverage = {\n readonly state: \"complete\";\n} | {\n readonly state: \"partial\";\n readonly reason: \"sampled\" | \"truncated\" | \"redacted\" | \"provider-limited\";\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"not-collected\" | \"source-unavailable\" | \"producer-failed\";\n} | {\n readonly state: \"not-applicable\";\n readonly reason: \"optional-material\" | \"unsupported-subject\";\n};\nexport type AssertionLimitation = {\n readonly kind: \"redacted\";\n readonly fieldCount: number;\n} | {\n readonly kind: \"sampled\";\n readonly captured: number;\n readonly knownTotal?: number;\n} | {\n readonly kind: \"truncated\";\n readonly omittedBytes: number;\n} | {\n readonly kind: \"provider-limited\";\n};\n/**\n * Authoring material intentionally has no blob ref, attachment entry ID, or\n * durable schema identity. The private producer adapter selects the exact\n * same-owner Attachment schema when it serializes this domain reference.\n */\nexport type AssertionMaterial = {\n readonly kind: \"snapshot\";\n readonly value: AssertionSnapshotValue;\n} | {\n readonly kind: \"record-attachment\";\n readonly preview: string;\n};\nexport type AssertionCriterion = {\n readonly kind: \"value-match\";\n readonly subject: \"explicit-value\";\n} | {\n readonly kind: \"scope-status\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly assertion: \"succeeded\" | \"no-failed-actions\";\n} | {\n readonly kind: \"occurrence\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly occurrence: \"tool\" | \"skill\" | \"event\";\n readonly assertion: \"present\" | \"absent\" | \"count\";\n readonly matcher?: string;\n readonly quantifier?: {\n readonly kind: \"absent\";\n } | {\n readonly kind: \"at-least\" | \"exact\";\n readonly count: number;\n };\n} | {\n readonly kind: \"judge-measurement\";\n readonly recipe: \"closed-qa\" | \"factuality\" | \"summarizes\";\n readonly scale: \"unit-interval\";\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"changed-paths\";\n readonly paths: readonly string[];\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"no-changes\";\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"file-changed\";\n readonly path: string;\n readonly status?: \"added\" | \"modified\" | \"deleted\";\n readonly before?: string;\n readonly after?: string;\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"file-deleted\";\n readonly path: string;\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"not-in-diff\";\n readonly pattern: string;\n readonly flags: string;\n readonly content: \"added\" | \"removed\" | \"both\";\n} | {\n readonly kind: \"direct-score\";\n readonly source: \"author\";\n} | {\n readonly kind: \"third-party\";\n readonly name: string;\n readonly schemaId: string;\n readonly data: AssertionSnapshotValue;\n};\nexport type AssertionScoreContribution = {\n readonly state: \"not-scored\";\n} | {\n readonly state: \"earned\";\n readonly points: number;\n readonly earned: number;\n} | {\n readonly state: \"unavailable\";\n readonly points: number;\n readonly reason: \"source-unavailable\" | \"evaluation-errored\" | \"not-applicable\";\n};\nexport type AssertionResult = {\n readonly state: \"matched\";\n readonly gate: \"not-gate\" | \"satisfied\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"earned\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n} | {\n readonly state: \"mismatched\";\n readonly reason: \"condition-not-met\";\n readonly gate: \"not-gate\" | \"failed\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"earned\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n readonly gate: \"not-gate\" | \"unavailable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n} | {\n readonly state: \"errored\";\n readonly reason: \"evaluator-failed\" | \"producer-interrupted\" | \"invalid-subject\";\n readonly gate: \"not-gate\" | \"unavailable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n} | {\n readonly state: \"not-applicable\";\n readonly reason: \"coverage-not-applicable\";\n readonly gate: \"not-gate\" | \"not-applicable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n};\n/** One fully formed author/runtime result, before durable attachment encoding. */\nexport interface SealedAssertionEntry {\n readonly display: AssertionDisplay;\n readonly criterion: AssertionCriterion;\n readonly subject: AssertionMaterial;\n readonly evidence: readonly AssertionMaterial[];\n readonly coverage: AssertionCoverage;\n readonly limitations: readonly AssertionLimitation[];\n readonly result: AssertionResult;\n}\n/**\n * Assertion handles are runtime-owned capabilities, not subjects for another\n * `t.check`. The symbol is public only for TypeScript's nominal boundary; the\n * runtime also keeps an unforgeable ownership registry.\n */\nexport const assertionHandleBrand: unique symbol = Symbol(\"niceeval.assertion-handle\");\nexport interface AssertionHandleBase {\n readonly [assertionHandleBrand]: true;\n key(value: string): this;\n label(value: string): this;\n /** Adds one display-only group segment to this already registered entry. */\n group(title: string): this;\n}\n/** A value that is not an AssertionHandle. */\nexport type AssertionSubject<Value> = Value extends AssertionHandleBase ? never : Value;\nexport interface AssertionStopError {\n readonly _tag: \"AssertionStopError\";\n readonly entryIndex: number;\n readonly reason: \"condition-not-met\" | \"source-unavailable\" | \"evaluator-failed\" | \"not-applicable\";\n}\n/**\n * A public authoring call reached an Attempt boundary which is no longer able\n * to accept it. Keeping this distinct from an evaluator failure lets a\n * detached Promise diagnose its own lifecycle error instead of looking like a\n * failed assertion.\n */\nexport class AssertionAuthoringClosedError extends Error {\n readonly _tag = \"AssertionAuthoringClosedError\";\n constructor(readonly reason: \"stop-latched\" | \"attempt-sealing\" | \"attempt-sealed\" | \"attempt-interrupted\" | \"runtime-unattached\") {\n super(`Cannot use an Assertion authoring handle after ${reason}`);\n this.name = \"AssertionAuthoringClosedError\";\n }\n}\n/**\n * The owning Attempt executes a requested stop barrier in its existing Effect\n * scope. Handles only enqueue this request; they never create a runtime.\n */\nexport type AssertionStopExecutor = <Value>(effect: Effect.Effect<Value, AssertionStopError, never>) => Promise<Value>;\n/** A Boolean entry is evaluated once and may retain a refinement witness. */\nexport type BooleanAssertionEvaluation<Refined> = {\n readonly state: \"matched\";\n readonly value: Refined;\n readonly diagnostic?: MatchDiagnostic;\n} | {\n readonly state: \"mismatched\";\n readonly diagnostic?: MatchDiagnostic;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n readonly diagnostic?: MatchDiagnostic;\n} | {\n readonly state: \"not-applicable\";\n readonly diagnostic?: MatchDiagnostic;\n};\n/** A measurement is always a finite unit-interval value when it is available. */\nexport type MeasurementAssertionEvaluation = {\n readonly state: \"measured\";\n readonly value: number;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n} | {\n readonly state: \"not-applicable\";\n} | {\n readonly state: \"errored\";\n};\nexport interface CapturedAssertionSnapshot {\n readonly material: Extract<AssertionMaterial, {\n readonly kind: \"snapshot\";\n }>;\n readonly coverage: AssertionCoverage;\n readonly limitations: readonly AssertionLimitation[];\n}\nexport interface AssertionRegistrationBase {\n readonly criterion: AssertionCriterion;\n readonly subject: AssertionMaterial;\n readonly evidence?: readonly AssertionMaterial[];\n readonly coverage?: AssertionCoverage;\n readonly limitations?: readonly AssertionLimitation[];\n}\n/**\n * Scope, Judge, and Sandbox adapters use this internal registration shape.\n * They still register exactly one Assertion entry; they do not manufacture a\n * separate intermediate value for a later consumer.\n */\nexport interface BooleanAssertionRegistration<Refined> extends AssertionRegistrationBase {\n readonly evaluate: () => Effect.Effect<BooleanAssertionEvaluation<Refined>, unknown, never>;\n}\nexport interface MeasurementAssertionRegistration extends AssertionRegistrationBase {\n readonly evaluate: () => Effect.Effect<MeasurementAssertionEvaluation, unknown, never>;\n}\nexport interface PassBooleanAssertionHandle<out Refined> extends AssertionHandleBase {\n readonly kind: \"boolean\";\n /** An unavailable/errored optional entry does not independently error Verdict. */\n optional(): this;\n gate(): this;\n orStop(): Promise<Refined>;\n}\nexport interface ScoreBooleanAssertionHandle<out Refined> extends AssertionHandleBase {\n readonly kind: \"boolean\";\n score(points: number): this;\n orStop(): Promise<Refined>;\n}\nexport interface PassMeasurementAssertionHandle<Thresholded extends boolean = false> extends AssertionHandleBase {\n readonly kind: \"measurement\";\n /** An unavailable/errored optional entry does not independently error Verdict. */\n optional(): this;\n atLeast(value: number): PassMeasurementAssertionHandle<true>;\n gate(value: number): PassMeasurementAssertionHandle<true>;\n orStop(this: PassMeasurementAssertionHandle<true>): Promise<number>;\n}\nexport interface ScoreMeasurementAssertionHandle<Thresholded extends boolean = false> extends AssertionHandleBase {\n readonly kind: \"measurement\";\n atLeast(value: number): ScoreMeasurementAssertionHandle<true>;\n score(points: number): this;\n orStop(this: ScoreMeasurementAssertionHandle<true>): Promise<number>;\n}\n/** A Boolean Assertion that intentionally has no author control-flow operation. */\ninterface PostRunPassBooleanAssertionHandle<Refined> extends AssertionHandleBase {\n readonly kind: \"boolean\";\n optional(): this;\n gate(): this;\n}\ninterface PostRunScoreBooleanAssertionHandle<Refined> extends AssertionHandleBase {\n readonly kind: \"boolean\";\n score(points: number): this;\n}\nexport type PostRunBooleanAssertionHandle<Kind extends AssertionEvaluationKind, Refined> = Kind extends \"pass\" ? PostRunPassBooleanAssertionHandle<Refined> : PostRunScoreBooleanAssertionHandle<Refined>;\n/** Direct score is an Assertion entry, but has no condition or stop barrier. */\nexport interface DirectScoreAssertionHandle extends AssertionHandleBase {\n readonly kind: \"direct-score\";\n}\nexport interface AssertionGroupContext {\n /**\n * Runs an ordinary author callback with one display-only group segment. The\n * callback remains inside the Attempt's outer Promise boundary; this facade\n * does not evaluate an Effect or create an independent runtime.\n */\n group<Value>(title: string, body: () => Value | PromiseLike<Value>): Promise<Awaited<Value>>;\n}\nexport interface PassAssertionsContext extends AssertionGroupContext {\n readonly evaluationKind: \"pass\";\n check<Value, Refined extends Value>(value: AssertionSubject<Value>, match: BooleanMatch<NoInfer<Value>, Refined, \"value\">): PassBooleanAssertionHandle<Refined>;\n check<Value>(value: AssertionSubject<Value>, match: ScoreMatch<NoInfer<Value>>): PassMeasurementAssertionHandle;\n check<Value>(value: AssertionSubject<Value>, match: ThresholdedScoreMatch<NoInfer<Value>>): PassMeasurementAssertionHandle<true>;\n}\nexport interface ScoreAssertionsContext extends AssertionGroupContext {\n readonly evaluationKind: \"score\";\n check<Value, Refined extends Value>(value: AssertionSubject<Value>, match: BooleanMatch<NoInfer<Value>, Refined, \"value\">): ScoreBooleanAssertionHandle<Refined>;\n check<Value>(value: AssertionSubject<Value>, match: ScoreMatch<NoInfer<Value>>): ScoreMeasurementAssertionHandle;\n check<Value>(value: AssertionSubject<Value>, match: ThresholdedScoreMatch<NoInfer<Value>>): ScoreMeasurementAssertionHandle<true>;\n score(points: number): DirectScoreAssertionHandle;\n}\nexport type AssertionsContext<Kind extends AssertionEvaluationKind> = Kind extends \"pass\" ? PassAssertionsContext : ScoreAssertionsContext;\nexport type BooleanAssertionHandle<Kind extends AssertionEvaluationKind, Refined> = Kind extends \"pass\" ? PassBooleanAssertionHandle<Refined> : ScoreBooleanAssertionHandle<Refined>;\nexport type MeasurementAssertionHandle<Kind extends AssertionEvaluationKind> = Kind extends \"pass\" ? PassMeasurementAssertionHandle : ScoreMeasurementAssertionHandle;\nexport interface AssertionSealOptions {\n readonly execution?: \"completed\" | \"errored\";\n readonly explicitlySkipped?: boolean;\n /**\n * The owning Attempt was interrupted before ordinary evaluation could\n * finish. Unsettled entries are sealed as producer-interrupted instead of\n * being silently omitted or evaluated on a detached runtime.\n */\n readonly interrupted?: boolean;\n}\nexport interface AssertionSealError {\n readonly _tag: \"AssertionSealError\";\n readonly code: \"pass-measurement-threshold-missing\";\n readonly entryIndex: number;\n}\n/** The sealed evaluation is a domain result, not a durable Record payload. */\nexport interface SealedAssertionEvaluationEntry {\n readonly required: boolean;\n readonly result: AssertionResult;\n}\nexport interface SealedAssertionEvaluation {\n readonly execution: \"completed\" | \"errored\";\n readonly explicitlySkipped: boolean;\n readonly assertions: readonly SealedAssertionEvaluationEntry[];\n}\n/**\n * One immutable result feeds the Verdict/Score fold and the private durable\n * producer adapter. No RecordAttachment writer type crosses this boundary.\n */\nexport interface SealedAssertionsRuntime {\n readonly entries: readonly SealedAssertionEntry[];\n readonly evaluation: SealedAssertionEvaluation;\n}\n/** The runtime Verdict is independent of the durable Verdict attachment codec. */\nexport interface AssertionVerdict {\n readonly state: \"passed\" | \"failed\" | \"errored\" | \"skipped\";\n}\nexport type AssertionScoreIncompleteReason = \"execution-errored\" | \"source-unavailable\" | \"evaluation-errored\" | \"not-applicable\";\n/** The runtime Score is independent of the durable Score attachment codec. */\nexport type AssertionScore = {\n readonly state: \"complete\";\n readonly earned: number;\n} | {\n readonly state: \"partial\";\n readonly earned: number;\n readonly reasons: readonly AssertionScoreIncompleteReason[];\n} | {\n readonly state: \"unavailable\";\n readonly reasons: readonly AssertionScoreIncompleteReason[];\n};\n/**\n * The attempt-owned frozen result is handed from Runner to the Evaluation\n * Record adapter. The adapter alone adds attachment schemas and writes.\n */\nexport interface SealedAttemptAssertions {\n readonly entries: readonly SealedAssertionEntry[];\n readonly evaluation: SealedAssertionEvaluation;\n readonly workspaceDiff?: AgentWorkspaceDiff;\n readonly verdict: AssertionVerdict;\n readonly score?: AssertionScore;\n}\nexport interface AssertionsRuntime<Kind extends AssertionEvaluationKind> {\n readonly evaluationKind: Kind;\n readonly t: AssertionsContext<Kind>;\n registerBoolean<Refined>(definition: BooleanAssertionRegistration<Refined>): BooleanAssertionHandle<Kind, Refined>;\n registerMeasurement(definition: MeasurementAssertionRegistration): MeasurementAssertionHandle<Kind>;\n seal(options?: AssertionSealOptions): Effect.Effect<SealedAssertionsRuntime, AssertionSealError, never>;\n}\n"]}
@@ -276,7 +276,7 @@ export interface PassMeasurementAssertionHandle<Thresholded extends boolean = fa
276
276
  /** An unavailable/errored optional entry does not independently error Verdict. */
277
277
  optional(): this;
278
278
  atLeast(value: number): PassMeasurementAssertionHandle<true>;
279
- gate(this: PassMeasurementAssertionHandle<true>): this;
279
+ gate(value: number): PassMeasurementAssertionHandle<true>;
280
280
  orStop(this: PassMeasurementAssertionHandle<true>): Promise<number>;
281
281
  }
282
282
  export interface ScoreMeasurementAssertionHandle<Thresholded extends boolean = false> extends AssertionHandleBase {
@@ -276,7 +276,7 @@ export interface PassMeasurementAssertionHandle<Thresholded extends boolean = fa
276
276
  /** An unavailable/errored optional entry does not independently error Verdict. */
277
277
  optional(): this;
278
278
  atLeast(value: number): PassMeasurementAssertionHandle<true>;
279
- gate(this: PassMeasurementAssertionHandle<true>): this;
279
+ gate(value: number): PassMeasurementAssertionHandle<true>;
280
280
  orStop(this: PassMeasurementAssertionHandle<true>): Promise<number>;
281
281
  }
282
282
  export interface ScoreMeasurementAssertionHandle<Thresholded extends boolean = false> extends AssertionHandleBase {
@@ -276,7 +276,7 @@ export interface PassMeasurementAssertionHandle<Thresholded extends boolean = fa
276
276
  /** An unavailable/errored optional entry does not independently error Verdict. */
277
277
  optional(): this;
278
278
  atLeast(value: number): PassMeasurementAssertionHandle<true>;
279
- gate(this: PassMeasurementAssertionHandle<true>): this;
279
+ gate(value: number): PassMeasurementAssertionHandle<true>;
280
280
  orStop(this: PassMeasurementAssertionHandle<true>): Promise<number>;
281
281
  }
282
282
  export interface ScoreMeasurementAssertionHandle<Thresholded extends boolean = false> extends AssertionHandleBase {
@@ -180,8 +180,8 @@ function touchedWindowsOf(diff, path) {
180
180
  return diff.files[path]?.windows;
181
181
  }
182
182
  /**
183
- * exact touched-path set 的三值求值(docs/roadmap/assertion-authoring/architecture.md
184
- * 「Sandbox diff collector」):
183
+ * exact touched-path set 的三值求值(docs/feature/sandbox/architecture.md
184
+ * 「变更归因:send 区间与分类账」):
185
185
  * - 已观察到 expected 外的确定 path,立即 failed(partial 也如此,不会被后续窗口推翻);
186
186
  * - collector complete 时,集合相等 passed,不等 failed;
187
187
  * - collector partial 且尚无矛盾(observed ⊆ expected)时 unavailable。
@@ -1 +1 @@
1
- {"version":3,"file":"diff.js","sourceRoot":"","sources":["diff.ts"],"names":[],"mappings":";;AAOA,wCA4CC;AAmBD,kCAEC;AAED,kCAcC;AAMD,0CAOC;AAED,gDASC;AAED,wCAMC;AAED,sCAEC;AAYD,4EAUC;AACD,oFAIC;AACD,oEASC;AAED,oCAEC;AAED,kCAEC;AAED,4CAEC;AAqBD,oDAmBC;AAED,8CAEC;AA6CD,4DAcC;AA9QD,6DAA6D;AAC7D,SAAgB,cAAc,CAAC,OAAqB;IAChD,MAAM,OAAO,GAAG,IAAI,GAAG,EAKnB,CAAC;IACL,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC3B,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;YAC1D,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAChC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;YACrC,IAAI,KAAK,EAAE,CAAC;gBACR,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC;gBACpB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAClC,qDAAqD;gBACrD,+BAA+B;gBAC/B,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,KAAK,CAA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ACzC,CAAC,CAAC;IACP,CAAC;IACD,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1D,CAAC","sourcesContent":["// agent 归因 diff 的派生视图:从落盘事实(DiffWindow[])派生文件级摘要与终态读取。\n// 派生物可随时重算、不落盘——符合「聚合在消费方」铁律(docs/feature/record/architecture.md「diff.json」)。\n// 本文件同时承载 Sandbox 事实(docs/roadmap/assertion-authoring/architecture.md「Sandbox diff collector」)\n// 的纯证据解析:exact touched-path set、noChanges 同源、同一 change entry 的 before/after 候选。\n// 这里只做证据解析与候选分类,不消费 BooleanMatch——matcher 应用留在接线层,避免复制 Match 内核。\nimport type { DiffArtifact, DiffData, DiffFileSummary, DiffWindow, WindowChange } from \"./types.ts\";\n/** 从窗口序列派生 DiffData:files 摘要(net / 触及窗口)+ get(最后触及窗口的终态)。 */\nexport function deriveDiffData(windows: DiffArtifact): DiffData {\n const touched = new Map<string, {\n first: WindowChange;\n last: WindowChange;\n windows: string[];\n elided?: DiffFileSummary[\"elided\"];\n }>();\n for (const window of windows) {\n for (const [path, change] of Object.entries(window.changes)) {\n const entry = touched.get(path);\n const reason = change.elided?.reason;\n if (entry) {\n entry.last = change;\n entry.windows.push(window.window);\n // 任一窗口省略过内容,这个文件的内容视图就不完整;binary 压过 oversized-text——\n // 一个文件不会因为某一窗口恰好小于阈值就变回可内联的文本。\n if (reason !== undefined && (entry.elided === undefined || reason === \"binary\"))\n entry.elided = reason;\n }\n else {\n touched.set(path, { first: change, last: change, windows: [window.window], ...(reason ? { elided: reason } : {}) });\n }\n }\n }\n const files: globalThis.Record<string, DiffFileSummary> = {};\n for (const [path, entry] of touched) {\n files[path] = {\n net: computeNet(entry.first, entry.last),\n windows: entry.windows,\n ...(entry.elided ? { elided: entry.elided } : {}),\n };\n }\n return {\n windows,\n files,\n get(path: string): string | undefined {\n const entry = touched.get(path);\n if (!entry)\n return undefined;\n if (entry.last.status === \"deleted\")\n return undefined;\n return entry.last.after;\n },\n };\n}\n/** 净效果:首个触及窗口的起点 vs 最后触及窗口的终点。 */\nfunction computeNet(first: WindowChange, last: WindowChange): DiffFileSummary[\"net\"] {\n const existedBefore = first.status !== \"added\";\n const existsAfter = last.status !== \"deleted\";\n if (!existedBefore && !existsAfter)\n return \"none\"; // 创建又删除\n if (!existedBefore && existsAfter)\n return \"added\";\n if (existedBefore && !existsAfter)\n return \"deleted\";\n // 改回原样 = none;比较首窗口起点与末窗口终点的内容(内容被省略的条目按字节数近似)。\n const beforeContent = first.before ?? first.elided?.beforeBytes;\n const afterContent = last.after ?? last.elided?.afterBytes;\n if (beforeContent !== undefined && afterContent !== undefined && beforeContent === afterContent)\n return \"none\";\n return \"modified\";\n}\n/** DiffArtifact 里是否有任何窗口触及过任何文件。 */\nexport function diffIsEmpty(diff: DiffData): boolean {\n return Object.keys(diff.files).length === 0;\n}\n/** 正则是否命中任何被触及的路径或任何窗口的 before/after 内容。 */\nexport function diffMatches(diff: DiffData, re: RegExp): boolean {\n for (const path of Object.keys(diff.files)) {\n if (re.test(path))\n return true;\n }\n for (const window of diff.windows) {\n for (const change of Object.values(window.changes)) {\n if (change.after !== undefined && re.test(change.after))\n return true;\n if (change.before !== undefined && re.test(change.before))\n return true;\n }\n }\n return false;\n}\n/**\n * 该文件最后一个触及窗口的内容有没有被省略——`get(path)` 返回 undefined 的两个原因\n * (净删除 / 从未触及,与内容被省略)由它区分:内容断言据此如实报证据不可用,\n * 不把「读不到内容」静默折成判过或判败(docs/feature/sandbox/architecture.md「导出往返是常数次」)。\n */\nexport function elidedContentAt(diff: DiffData, path: string): NonNullable<WindowChange[\"elided\"]> | undefined {\n for (let i = diff.windows.length - 1; i >= 0; i--) {\n const change = diff.windows[i]!.changes[path];\n if (change !== undefined)\n return change.elided;\n }\n return undefined;\n}\n/** 全部内容被省略的路径(任一窗口),按路径序;内容扫描类断言用它说明缺口。 */\nexport function elidedContentPaths(diff: DiffData): string[] {\n const paths = new Set<string>();\n for (const window of diff.windows) {\n for (const [path, change] of Object.entries(window.changes)) {\n if (change.elided)\n paths.add(path);\n }\n }\n return [...paths].sort();\n}\n/** 内容被省略的条目怎么向人交代:reason + 已知字节数。 */\nexport function describeElided(elided: NonNullable<WindowChange[\"elided\"]>): string {\n const bytes = [\n elided.beforeBytes === undefined ? undefined : `before ${elided.beforeBytes} bytes`,\n elided.afterBytes === undefined ? undefined : `after ${elided.afterBytes} bytes`,\n ].filter((part) => part !== undefined);\n return bytes.length > 0 ? `${elided.reason} (${bytes.join(\", \")})` : elided.reason;\n}\n/** 空 diff(remote / skipped attempt)。 */\nexport function emptyDiffData(): DiffData {\n return deriveDiffData([]);\n}\n// ── Sandbox 事实的纯证据解析 ──\n//\n// changedPaths() / noChanges() / fileChanged() 共用这里的能力,不复制第二套路径集合或\n// change entry 逻辑。这些函数是纯 evaluator / 证据解析:输入落盘事实,输出三值结果或\n// 候选分类,不登记判定用途、不触碰 collector、不产生公共 Fact。\n/**\n * 校验 `changedPaths()` 的 expected 路径列表。\n * 每条 expected path 必须已经是 Sandbox workdir 相对的 canonical POSIX 路径;空数组\n * 合法——`noChanges()` 就是空 exact set 的同源形态,path 顺序无意义。\n */\n/** Canonical Sandbox workdir-relative path shared by registration and storage. */\nexport function isCanonicalWorkspaceRelativePath(value: unknown): value is string {\n if (typeof value !== \"string\"\n || value.length === 0\n || value.includes(\"\\u0000\")\n || value.includes(\"\\\\\")\n || value.startsWith(\"/\")\n || /^[A-Za-z]:\\//.test(value)) {\n return false;\n }\n return value.split(\"/\").every((segment) => segment.length > 0 && segment !== \".\" && segment !== \"..\");\n}\nexport function assertCanonicalWorkspaceRelativePath(value: unknown, owner: string): asserts value is string {\n if (!isCanonicalWorkspaceRelativePath(value)) {\n throw new TypeError(`${owner} must be a canonical portable workspace-relative path without absolute, ., .., empty, NUL, or backslash segments`);\n }\n}\nexport function validateExpectedTouchedPaths(expected: readonly string[]): void {\n const seen = new Set<string>();\n for (const path of expected) {\n assertCanonicalWorkspaceRelativePath(path, \"changedPaths() path\");\n if (seen.has(path)) {\n throw new Error(`changedPaths(): duplicate expected path ${JSON.stringify(path)}`);\n }\n seen.add(path);\n }\n}\n/** 被 agent 触及的 exact path set(diff.files 的 keys),按路径序;added / modified / deleted 与净改回原样都保留。 */\nexport function touchedPaths(diff: DiffData): string[] {\n return Object.keys(diff.files).sort();\n}\n/** 该 path 的净效果;从未被触及返回 undefined。 */\nexport function netChangeOf(diff: DiffData, path: string): DiffFileSummary[\"net\"] | undefined {\n return diff.files[path]?.net;\n}\n/** 触及该 path 的窗口标签(按时序);从未被触及返回 undefined。 */\nexport function touchedWindowsOf(diff: DiffData, path: string): string[] | undefined {\n return diff.files[path]?.windows;\n}\nexport type TouchedPathsOutcome = {\n readonly outcome: \"passed\";\n} | {\n readonly outcome: \"failed\";\n /** expected 之外的确定触及 path。 */\n readonly unexpected: readonly string[];\n /** expected 中未被触及的 path。 */\n readonly missing: readonly string[];\n} | {\n readonly outcome: \"unavailable\";\n readonly reason: string;\n};\n/**\n * exact touched-path set 的三值求值(docs/roadmap/assertion-authoring/architecture.md\n * 「Sandbox diff collector」):\n * - 已观察到 expected 外的确定 path,立即 failed(partial 也如此,不会被后续窗口推翻);\n * - collector complete 时,集合相等 passed,不等 failed;\n * - collector partial 且尚无矛盾(observed ⊆ expected)时 unavailable。\n * `noChanges()` 是 expected 为空集的同源调用。\n */\nexport function evaluateTouchedPaths(diff: DiffData, expected: readonly string[], complete = true): TouchedPathsOutcome {\n validateExpectedTouchedPaths(expected);\n const expectedSet = new Set(expected);\n const observed = touchedPaths(diff);\n const observedSet = new Set(observed);\n const unexpected = observed.filter((path) => !expectedSet.has(path));\n if (unexpected.length > 0) {\n return {\n outcome: \"failed\",\n unexpected,\n missing: [...expectedSet].filter((path) => !observedSet.has(path)).sort(),\n };\n }\n if (!complete)\n return { outcome: \"unavailable\", reason: \"evidence-coverage:diff=partial\" };\n const missing = [...expectedSet].filter((path) => !observedSet.has(path)).sort();\n if (missing.length > 0)\n return { outcome: \"failed\", unexpected: [], missing };\n return { outcome: \"passed\" };\n}\n/** `noChanges()` 的纯求值:expected 固定为空集,与 changedPaths([]) 同一能力。 */\nexport function evaluateNoChanges(diff: DiffData, complete = true): TouchedPathsOutcome {\n return evaluateTouchedPaths(diff, [], complete);\n}\n/** 一条 change entry 的某一侧(before / after)内容证据状态。 */\nexport type ChangeContentState = {\n readonly state: \"available\";\n readonly text: string;\n} | {\n /** 确定性缺失:added 无 before、deleted 无 after。matcher 要求该侧即确定不满足。 */\n readonly state: \"absent\";\n} | {\n /** 内容被省略(binary / oversized-text),字节数只知部分时省略 bytes。 */\n readonly state: \"elided\";\n readonly reason: \"binary\" | \"oversized-text\";\n readonly bytes?: number;\n} | {\n /** 内容证据不在(如 provider 不支持内容导出);与「缺失」相反,不能确定该侧不成立。 */\n readonly state: \"unavailable\";\n readonly reason: string;\n};\n/** 同一 change entry 的 before / after 证据候选:接线层在此之上应用 BooleanMatch。 */\nexport interface ChangeEntryCandidate {\n readonly window: string;\n readonly status: WindowChange[\"status\"];\n readonly before: ChangeContentState;\n readonly after: ChangeContentState;\n}\nfunction contentStateOf(change: WindowChange, side: \"before\" | \"after\"): ChangeContentState {\n if (side === \"before\" && change.status === \"added\")\n return { state: \"absent\" };\n if (side === \"after\" && change.status === \"deleted\")\n return { state: \"absent\" };\n const elided = change.elided;\n if (elided) {\n const bytes = side === \"before\" ? elided.beforeBytes : elided.afterBytes;\n return { state: \"elided\", reason: elided.reason, ...(bytes !== undefined ? { bytes } : {}) };\n }\n const text = side === \"before\" ? change.before : change.after;\n if (text === undefined)\n return { state: \"unavailable\", reason: \"content-evidence-missing\" };\n return { state: \"available\", text };\n}\n/**\n * 解析某 path 在全部窗口中的 change entry 候选,按时序。\n * before / after matcher 必须由**同一条** entry 满足;返回 undefined 表示从未被触及\n * (无候选即确定不满足,不存在「两个 matcher 分别由不同窗口满足」的路径)。\n */\nexport function changeEntryCandidatesFor(diff: DiffData, path: string): ChangeEntryCandidate[] | undefined {\n const candidates: ChangeEntryCandidate[] = [];\n for (const window of diff.windows) {\n const change = window.changes[path];\n if (change === undefined)\n continue;\n candidates.push({\n window: window.window,\n status: change.status,\n before: contentStateOf(change, \"before\"),\n after: contentStateOf(change, \"after\"),\n });\n }\n return candidates.length > 0 ? candidates : undefined;\n}\nexport type { DiffArtifact, DiffData, DiffWindow, WindowChange } from \"./types.ts\";\n"]}
1
+ {"version":3,"file":"diff.js","sourceRoot":"","sources":["diff.ts"],"names":[],"mappings":";;AAOA,wCA4CC;AAmBD,kCAEC;AAED,kCAcC;AAMD,0CAOC;AAED,gDASC;AAED,wCAMC;AAED,sCAEC;AAYD,4EAUC;AACD,oFAIC;AACD,oEASC;AAED,oCAEC;AAED,kCAEC;AAED,4CAEC;AAqBD,oDAmBC;AAED,8CAEC;AA6CD,4DAcC;AA9QD,6DAA6D;AAC7D,SAAgB,cAAc,CAAC,OAAqB;IAChD,MAAM,OAAO,GAAG,IAAI,GAAG,EAKnB,CAAC;IACL,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC3B,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;YAC1D,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAChC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;YACrC,IAAI,KAAK,EAAE,CAAC;gBACR,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC;gBACpB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAClC,qDAAqD;gBACrD,+BAA+B;gBAC/B,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,QAAQ,CAAC;oBAC3E,KAAK,CAAC,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C,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1D,CAAC","sourcesContent":["// agent 归因 diff 的派生视图:从落盘事实(DiffWindow[])派生文件级摘要与终态读取。\n// 派生物可随时重算、不落盘——符合「聚合在消费方」铁律(docs/feature/record/architecture.md「diff.json」)。\n// 本文件同时承载 Sandbox 事实(docs/feature/sandbox/architecture.md「变更归因:send 区间与分类账」)\n// 的纯证据解析:exact touched-path set、noChanges 同源、同一 change entry 的 before/after 候选。\n// 这里只做证据解析与候选分类,不消费 BooleanMatch——matcher 应用留在接线层,避免复制 Match 内核。\nimport type { DiffArtifact, DiffData, DiffFileSummary, DiffWindow, WindowChange } from \"./types.ts\";\n/** 从窗口序列派生 DiffData:files 摘要(net / 触及窗口)+ get(最后触及窗口的终态)。 */\nexport function deriveDiffData(windows: DiffArtifact): DiffData {\n const touched = new Map<string, {\n first: WindowChange;\n last: WindowChange;\n windows: string[];\n elided?: DiffFileSummary[\"elided\"];\n }>();\n for (const window of windows) {\n for (const [path, change] of Object.entries(window.changes)) {\n const entry = touched.get(path);\n const reason = change.elided?.reason;\n if (entry) {\n entry.last = change;\n entry.windows.push(window.window);\n // 任一窗口省略过内容,这个文件的内容视图就不完整;binary 压过 oversized-text——\n // 一个文件不会因为某一窗口恰好小于阈值就变回可内联的文本。\n if (reason !== undefined && (entry.elided === undefined || reason === \"binary\"))\n entry.elided = reason;\n }\n else {\n touched.set(path, { first: change, last: change, windows: [window.window], ...(reason ? { elided: reason } : {}) });\n }\n }\n }\n const files: globalThis.Record<string, DiffFileSummary> = {};\n for (const [path, entry] of touched) {\n files[path] = {\n net: computeNet(entry.first, entry.last),\n windows: entry.windows,\n ...(entry.elided ? { elided: entry.elided } : {}),\n };\n }\n return {\n windows,\n files,\n get(path: string): string | undefined {\n const entry = touched.get(path);\n if (!entry)\n return undefined;\n if (entry.last.status === \"deleted\")\n return undefined;\n return entry.last.after;\n },\n };\n}\n/** 净效果:首个触及窗口的起点 vs 最后触及窗口的终点。 */\nfunction computeNet(first: WindowChange, last: WindowChange): DiffFileSummary[\"net\"] {\n const existedBefore = first.status !== \"added\";\n const existsAfter = last.status !== \"deleted\";\n if (!existedBefore && !existsAfter)\n return \"none\"; // 创建又删除\n if (!existedBefore && existsAfter)\n return \"added\";\n if (existedBefore && !existsAfter)\n return \"deleted\";\n // 改回原样 = none;比较首窗口起点与末窗口终点的内容(内容被省略的条目按字节数近似)。\n const beforeContent = first.before ?? first.elided?.beforeBytes;\n const afterContent = last.after ?? last.elided?.afterBytes;\n if (beforeContent !== undefined && afterContent !== undefined && beforeContent === afterContent)\n return \"none\";\n return \"modified\";\n}\n/** DiffArtifact 里是否有任何窗口触及过任何文件。 */\nexport function diffIsEmpty(diff: DiffData): boolean {\n return Object.keys(diff.files).length === 0;\n}\n/** 正则是否命中任何被触及的路径或任何窗口的 before/after 内容。 */\nexport function diffMatches(diff: DiffData, re: RegExp): boolean {\n for (const path of Object.keys(diff.files)) {\n if (re.test(path))\n return true;\n }\n for (const window of diff.windows) {\n for (const change of Object.values(window.changes)) {\n if (change.after !== undefined && re.test(change.after))\n return true;\n if (change.before !== undefined && re.test(change.before))\n return true;\n }\n }\n return false;\n}\n/**\n * 该文件最后一个触及窗口的内容有没有被省略——`get(path)` 返回 undefined 的两个原因\n * (净删除 / 从未触及,与内容被省略)由它区分:内容断言据此如实报证据不可用,\n * 不把「读不到内容」静默折成判过或判败(docs/feature/sandbox/architecture.md「导出往返是常数次」)。\n */\nexport function elidedContentAt(diff: DiffData, path: string): NonNullable<WindowChange[\"elided\"]> | undefined {\n for (let i = diff.windows.length - 1; i >= 0; i--) {\n const change = diff.windows[i]!.changes[path];\n if (change !== undefined)\n return change.elided;\n }\n return undefined;\n}\n/** 全部内容被省略的路径(任一窗口),按路径序;内容扫描类断言用它说明缺口。 */\nexport function elidedContentPaths(diff: DiffData): string[] {\n const paths = new Set<string>();\n for (const window of diff.windows) {\n for (const [path, change] of Object.entries(window.changes)) {\n if (change.elided)\n paths.add(path);\n }\n }\n return [...paths].sort();\n}\n/** 内容被省略的条目怎么向人交代:reason + 已知字节数。 */\nexport function describeElided(elided: NonNullable<WindowChange[\"elided\"]>): string {\n const bytes = [\n elided.beforeBytes === undefined ? undefined : `before ${elided.beforeBytes} bytes`,\n elided.afterBytes === undefined ? undefined : `after ${elided.afterBytes} bytes`,\n ].filter((part) => part !== undefined);\n return bytes.length > 0 ? `${elided.reason} (${bytes.join(\", \")})` : elided.reason;\n}\n/** 空 diff(remote / skipped attempt)。 */\nexport function emptyDiffData(): DiffData {\n return deriveDiffData([]);\n}\n// ── Sandbox 事实的纯证据解析 ──\n//\n// changedPaths() / noChanges() / fileChanged() 共用这里的能力,不复制第二套路径集合或\n// change entry 逻辑。这些函数是纯 evaluator / 证据解析:输入落盘事实,输出三值结果或\n// 候选分类,不登记判定用途、不触碰 collector、不产生公共 Fact。\n/**\n * 校验 `changedPaths()` 的 expected 路径列表。\n * 每条 expected path 必须已经是 Sandbox workdir 相对的 canonical POSIX 路径;空数组\n * 合法——`noChanges()` 就是空 exact set 的同源形态,path 顺序无意义。\n */\n/** Canonical Sandbox workdir-relative path shared by registration and storage. */\nexport function isCanonicalWorkspaceRelativePath(value: unknown): value is string {\n if (typeof value !== \"string\"\n || value.length === 0\n || value.includes(\"\\u0000\")\n || value.includes(\"\\\\\")\n || value.startsWith(\"/\")\n || /^[A-Za-z]:\\//.test(value)) {\n return false;\n }\n return value.split(\"/\").every((segment) => segment.length > 0 && segment !== \".\" && segment !== \"..\");\n}\nexport function assertCanonicalWorkspaceRelativePath(value: unknown, owner: string): asserts value is string {\n if (!isCanonicalWorkspaceRelativePath(value)) {\n throw new TypeError(`${owner} must be a canonical portable workspace-relative path without absolute, ., .., empty, NUL, or backslash segments`);\n }\n}\nexport function validateExpectedTouchedPaths(expected: readonly string[]): void {\n const seen = new Set<string>();\n for (const path of expected) {\n assertCanonicalWorkspaceRelativePath(path, \"changedPaths() path\");\n if (seen.has(path)) {\n throw new Error(`changedPaths(): duplicate expected path ${JSON.stringify(path)}`);\n }\n seen.add(path);\n }\n}\n/** 被 agent 触及的 exact path set(diff.files 的 keys),按路径序;added / modified / deleted 与净改回原样都保留。 */\nexport function touchedPaths(diff: DiffData): string[] {\n return Object.keys(diff.files).sort();\n}\n/** 该 path 的净效果;从未被触及返回 undefined。 */\nexport function netChangeOf(diff: DiffData, path: string): DiffFileSummary[\"net\"] | undefined {\n return diff.files[path]?.net;\n}\n/** 触及该 path 的窗口标签(按时序);从未被触及返回 undefined。 */\nexport function touchedWindowsOf(diff: DiffData, path: string): string[] | undefined {\n return diff.files[path]?.windows;\n}\nexport type TouchedPathsOutcome = {\n readonly outcome: \"passed\";\n} | {\n readonly outcome: \"failed\";\n /** expected 之外的确定触及 path。 */\n readonly unexpected: readonly string[];\n /** expected 中未被触及的 path。 */\n readonly missing: readonly string[];\n} | {\n readonly outcome: \"unavailable\";\n readonly reason: string;\n};\n/**\n * exact touched-path set 的三值求值(docs/feature/sandbox/architecture.md\n * 「变更归因:send 区间与分类账」):\n * - 已观察到 expected 外的确定 path,立即 failed(partial 也如此,不会被后续窗口推翻);\n * - collector complete 时,集合相等 passed,不等 failed;\n * - collector partial 且尚无矛盾(observed ⊆ expected)时 unavailable。\n * `noChanges()` 是 expected 为空集的同源调用。\n */\nexport function evaluateTouchedPaths(diff: DiffData, expected: readonly string[], complete = true): TouchedPathsOutcome {\n validateExpectedTouchedPaths(expected);\n const expectedSet = new Set(expected);\n const observed = touchedPaths(diff);\n const observedSet = new Set(observed);\n const unexpected = observed.filter((path) => !expectedSet.has(path));\n if (unexpected.length > 0) {\n return {\n outcome: \"failed\",\n unexpected,\n missing: [...expectedSet].filter((path) => !observedSet.has(path)).sort(),\n };\n }\n if (!complete)\n return { outcome: \"unavailable\", reason: \"evidence-coverage:diff=partial\" };\n const missing = [...expectedSet].filter((path) => !observedSet.has(path)).sort();\n if (missing.length > 0)\n return { outcome: \"failed\", unexpected: [], missing };\n return { outcome: \"passed\" };\n}\n/** `noChanges()` 的纯求值:expected 固定为空集,与 changedPaths([]) 同一能力。 */\nexport function evaluateNoChanges(diff: DiffData, complete = true): TouchedPathsOutcome {\n return evaluateTouchedPaths(diff, [], complete);\n}\n/** 一条 change entry 的某一侧(before / after)内容证据状态。 */\nexport type ChangeContentState = {\n readonly state: \"available\";\n readonly text: string;\n} | {\n /** 确定性缺失:added 无 before、deleted 无 after。matcher 要求该侧即确定不满足。 */\n readonly state: \"absent\";\n} | {\n /** 内容被省略(binary / oversized-text),字节数只知部分时省略 bytes。 */\n readonly state: \"elided\";\n readonly reason: \"binary\" | \"oversized-text\";\n readonly bytes?: number;\n} | {\n /** 内容证据不在(如 provider 不支持内容导出);与「缺失」相反,不能确定该侧不成立。 */\n readonly state: \"unavailable\";\n readonly reason: string;\n};\n/** 同一 change entry 的 before / after 证据候选:接线层在此之上应用 BooleanMatch。 */\nexport interface ChangeEntryCandidate {\n readonly window: string;\n readonly status: WindowChange[\"status\"];\n readonly before: ChangeContentState;\n readonly after: ChangeContentState;\n}\nfunction contentStateOf(change: WindowChange, side: \"before\" | \"after\"): ChangeContentState {\n if (side === \"before\" && change.status === \"added\")\n return { state: \"absent\" };\n if (side === \"after\" && change.status === \"deleted\")\n return { state: \"absent\" };\n const elided = change.elided;\n if (elided) {\n const bytes = side === \"before\" ? elided.beforeBytes : elided.afterBytes;\n return { state: \"elided\", reason: elided.reason, ...(bytes !== undefined ? { bytes } : {}) };\n }\n const text = side === \"before\" ? change.before : change.after;\n if (text === undefined)\n return { state: \"unavailable\", reason: \"content-evidence-missing\" };\n return { state: \"available\", text };\n}\n/**\n * 解析某 path 在全部窗口中的 change entry 候选,按时序。\n * before / after matcher 必须由**同一条** entry 满足;返回 undefined 表示从未被触及\n * (无候选即确定不满足,不存在「两个 matcher 分别由不同窗口满足」的路径)。\n */\nexport function changeEntryCandidatesFor(diff: DiffData, path: string): ChangeEntryCandidate[] | undefined {\n const candidates: ChangeEntryCandidate[] = [];\n for (const window of diff.windows) {\n const change = window.changes[path];\n if (change === undefined)\n continue;\n candidates.push({\n window: window.window,\n status: change.status,\n before: contentStateOf(change, \"before\"),\n after: contentStateOf(change, \"after\"),\n });\n }\n return candidates.length > 0 ? candidates : undefined;\n}\nexport type { DiffArtifact, DiffData, DiffWindow, WindowChange } from \"./types.ts\";\n"]}
@@ -45,8 +45,8 @@ export type TouchedPathsOutcome = {
45
45
  readonly reason: string;
46
46
  };
47
47
  /**
48
- * exact touched-path set 的三值求值(docs/roadmap/assertion-authoring/architecture.md
49
- * 「Sandbox diff collector」):
48
+ * exact touched-path set 的三值求值(docs/feature/sandbox/architecture.md
49
+ * 「变更归因:send 区间与分类账」):
50
50
  * - 已观察到 expected 外的确定 path,立即 failed(partial 也如此,不会被后续窗口推翻);
51
51
  * - collector complete 时,集合相等 passed,不等 failed;
52
52
  * - collector partial 且尚无矛盾(observed ⊆ expected)时 unavailable。
@@ -45,8 +45,8 @@ export type TouchedPathsOutcome = {
45
45
  readonly reason: string;
46
46
  };
47
47
  /**
48
- * exact touched-path set 的三值求值(docs/roadmap/assertion-authoring/architecture.md
49
- * 「Sandbox diff collector」):
48
+ * exact touched-path set 的三值求值(docs/feature/sandbox/architecture.md
49
+ * 「变更归因:send 区间与分类账」):
50
50
  * - 已观察到 expected 外的确定 path,立即 failed(partial 也如此,不会被后续窗口推翻);
51
51
  * - collector complete 时,集合相等 passed,不等 failed;
52
52
  * - collector partial 且尚无矛盾(observed ⊆ expected)时 unavailable。
@@ -45,8 +45,8 @@ export type TouchedPathsOutcome = {
45
45
  readonly reason: string;
46
46
  };
47
47
  /**
48
- * exact touched-path set 的三值求值(docs/roadmap/assertion-authoring/architecture.md
49
- * 「Sandbox diff collector」):
48
+ * exact touched-path set 的三值求值(docs/feature/sandbox/architecture.md
49
+ * 「变更归因:send 区间与分类账」):
50
50
  * - 已观察到 expected 外的确定 path,立即 failed(partial 也如此,不会被后续窗口推翻);
51
51
  * - collector complete 时,集合相等 passed,不等 failed;
52
52
  * - collector partial 且尚无矛盾(observed ⊆ expected)时 unavailable。
@@ -71,7 +71,7 @@ function headerValue(headers, name) {
71
71
  }
72
72
  return undefined;
73
73
  }
74
- function retryAfterMs(headers) {
74
+ function retryAfterMs(headers, nowMs) {
75
75
  const raw = headerValue(headers, "retry-after")?.trim();
76
76
  if (!raw)
77
77
  return undefined;
@@ -79,7 +79,7 @@ function retryAfterMs(headers) {
79
79
  if (Number.isFinite(seconds) && seconds >= 0)
80
80
  return Math.round(seconds * 1000);
81
81
  const timestamp = Date.parse(raw);
82
- return Number.isFinite(timestamp) ? Math.max(0, timestamp - Date.now()) : undefined;
82
+ return Number.isFinite(timestamp) ? Math.max(0, timestamp - nowMs) : undefined;
83
83
  }
84
84
  function isTransientJudgeStatus(status) {
85
85
  return status === 408 || status === 429 || (status !== undefined && status >= 500 && status <= 599);
@@ -214,7 +214,7 @@ function probeAttempt(judge, apiKey, endpoint, attempt, callerSignal) {
214
214
  if (response.response.ok)
215
215
  return undefined;
216
216
  if (isTransientJudgeStatus(response.response.status) && attempt < PROBE_MAX_ATTEMPTS) {
217
- const delay = retryAfterMs(response.response.headers);
217
+ const delay = retryAfterMs(response.response.headers, yield* effect_1.Clock.currentTimeMillis);
218
218
  if (delay !== undefined)
219
219
  yield* effect_1.Effect.sleep(delay);
220
220
  return retryProbe;
@@ -315,18 +315,19 @@ function evaluateJudgeRecipe(input) {
315
315
  evidence: evidenceFor(frozenMaterial),
316
316
  ...(typeof rationale === "string" && rationale.trim() !== "" ? { explanation: (0, display_ts_1.summaryText)(rationale) } : {}),
317
317
  });
318
- }), effect_1.Effect.catchAll((failure) => {
318
+ }), effect_1.Effect.catchAll((failure) => effect_1.Effect.gen(function* () {
319
319
  const error = failure.error;
320
320
  if (!isTransportFailure(error))
321
- return effect_1.Effect.succeed(evaluatorError("judge-evaluator-error", errorSummary(error)));
321
+ return evaluatorError("judge-evaluator-error", errorSummary(error));
322
322
  if (!isTransientJudgeFailure(error) || attempt + 1 >= JUDGE_MAX_ATTEMPTS) {
323
- return effect_1.Effect.succeed(unavailable("judge-call-failed", judgeFailureEvidence(error, model, attempts, retried)));
323
+ return unavailable("judge-call-failed", judgeFailureEvidence(error, model, attempts, retried));
324
324
  }
325
- const retryAfter = retryAfterMs(objectField(error, "headers"));
326
- const delay = retryAfter ?? (input.random ?? Math.random)() * JUDGE_RETRY_BASE_DELAY_MS * 2 ** attempt;
325
+ const retryAfter = retryAfterMs(objectField(error, "headers"), yield* effect_1.Clock.currentTimeMillis);
326
+ const delay = retryAfter ?? (input.random ? input.random() : yield* effect_1.Random.next) * JUDGE_RETRY_BASE_DELAY_MS * 2 ** attempt;
327
327
  retried = true;
328
- return judgeSleep(delay).pipe(effect_1.Effect.zipRight(evaluate(attempt + 1)));
329
- }))));
328
+ yield* judgeSleep(delay);
329
+ return yield* evaluate(attempt + 1);
330
+ })))));
330
331
  return evaluate(0).pipe(effect_1.Effect.timeoutTo({
331
332
  duration: resolved.timeoutMs,
332
333
  onSuccess: (evaluation) => evaluation,
@@ -1 +1 @@
1
- {"version":3,"file":"judge.js","sourceRoot":"","sources":["judge.ts"],"names":[],"mappings":";;;;;AAyMA,kDAKC;AAwDD,4CAaC;AAgBD,sDAIC;AA2ED,4DAEC;AApXD,2EAA2E;AAC3E,6DAA6D;AAC7D,yCAA0D;AAC1D,mCAAgC;AAChC,oDAA4B;AAC5B,6CAA2C;AAG3C,wCAAoC;AACpC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,yBAAyB,GAAG,IAAI,CAAC;AACvC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAqB7B,SAAS,YAAY,CAAC,KAAc;IAChC,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,GAA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AChE,OAAO,mBAAmB,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Native LLM-as-Judge evaluator. The Assert-first path keeps provider I/O,\n// timeout, retry, and interruption inside the owning Effect.\nimport { ClosedQA, Factuality, Summary } from \"autoevals\";\nimport { Effect } from \"effect\";\nimport OpenAI from \"openai\";\nimport { summaryText } from \"./display.ts\";\nimport type { MeasurementAssertionEvaluation } from \"./api.ts\";\nimport type { JudgeMaterial, ResolvedJudgeConfig } from \"./types.ts\";\nimport { getEnv } from \"../util.ts\";\nconst JUDGE_MAX_ATTEMPTS = 3;\nconst JUDGE_RETRY_BASE_DELAY_MS = 1000;\nconst PROBE_TIMEOUT_MS = 20000;\nconst PROBE_MAX_ATTEMPTS = 2;\nexport type JudgeRecipe = \"closedQA\" | \"factuality\" | \"summarizes\";\ntype AutoevalResult = {\n score?: number | null;\n metadata?: Record<string, unknown>;\n};\ntype JudgeMeasurementResult = {\n readonly state: \"measured\";\n readonly value: number;\n readonly evidence?: string;\n readonly explanation?: string;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"source-unavailable\";\n readonly detail: string;\n readonly evidence?: string;\n} | {\n readonly state: \"errored\";\n readonly code: string;\n readonly message: string;\n};\nfunction errorSummary(error: unknown): string {\n const message = error instanceof Error ? error.message : String(error);\n return message.replace(/\\s+/g, \" \").slice(0, 300);\n}\nfunction objectField(value: unknown, key: string): unknown {\n if (typeof value !== \"object\" || value === null)\n return undefined;\n try {\n return Reflect.get(value, key);\n }\n catch {\n return undefined;\n }\n}\nfunction judgeStatus(error: unknown): number | undefined {\n let current: unknown = error;\n for (let depth = 0; current !== undefined && depth < 5; depth++) {\n const status = objectField(current, \"status\");\n if (typeof status === \"number\" && Number.isInteger(status))\n return status;\n const nested = objectField(current, \"error\");\n const nestedStatus = objectField(nested, \"status\");\n if (typeof nestedStatus === \"number\" && Number.isInteger(nestedStatus))\n return nestedStatus;\n current = objectField(current, \"cause\");\n }\n return undefined;\n}\nfunction judgeCode(error: unknown): string | undefined {\n let current: unknown = error;\n for (let depth = 0; current !== undefined && depth < 5; depth++) {\n const code = objectField(current, \"code\");\n if (typeof code === \"string\" && code !== \"\")\n return code;\n const nestedCode = objectField(objectField(current, \"error\"), \"code\");\n if (typeof nestedCode === \"string\" && nestedCode !== \"\")\n return nestedCode;\n current = objectField(current, \"cause\");\n }\n return undefined;\n}\nfunction headerValue(headers: unknown, name: string): string | undefined {\n if (headers instanceof Headers)\n return headers.get(name) ?? undefined;\n if (typeof headers !== \"object\" || headers === null)\n return undefined;\n const lower = name.toLowerCase();\n for (const [key, value] of Object.entries(headers)) {\n if (key.toLowerCase() === lower && typeof value === \"string\")\n return value;\n }\n return undefined;\n}\nfunction retryAfterMs(headers: unknown): number | undefined {\n const raw = headerValue(headers, \"retry-after\")?.trim();\n if (!raw)\n return undefined;\n const seconds = Number(raw);\n if (Number.isFinite(seconds) && seconds >= 0)\n return Math.round(seconds * 1000);\n const timestamp = Date.parse(raw);\n return Number.isFinite(timestamp) ? Math.max(0, timestamp - Date.now()) : undefined;\n}\nfunction isTransientJudgeStatus(status: number | undefined): boolean {\n return status === 408 || status === 429 || (status !== undefined && status >= 500 && status <= 599);\n}\nfunction isConnectionFailure(error: unknown): boolean {\n let current: unknown = error;\n for (let depth = 0; current !== undefined && depth < 5; depth++) {\n const name = objectField(current, \"name\");\n const code = objectField(current, \"code\");\n if (name === \"APIUserAbortError\")\n return false;\n if (name === \"APIConnectionError\" || name === \"APIConnectionTimeoutError\")\n return true;\n if (typeof code === \"string\" && /^(?:ECONN|ENOTFOUND|EAI_AGAIN|ENETUNREACH|EHOSTUNREACH|ETIMEDOUT|ERR_TLS)/i.test(code))\n return true;\n if (/fetch failed|socket hang up|connection (?:reset|closed|refused)|network error|other side closed|timed? out|timeout|\\b(?:ECONNRESET|ECONNREFUSED|ENOTFOUND|EAI_AGAIN|ETIMEDOUT)\\b/i.test(errorSummary(current))) {\n return true;\n }\n current = objectField(current, \"cause\");\n }\n return false;\n}\nfunction isTransportFailure(error: unknown): boolean {\n return judgeStatus(error) !== undefined || isConnectionFailure(error);\n}\nfunction isTransientJudgeFailure(error: unknown): boolean {\n const status = judgeStatus(error);\n return isTransientJudgeStatus(status) || (status === undefined && isConnectionFailure(error));\n}\ninterface JudgeProviderFailure {\n readonly _tag: \"JudgeProviderFailure\";\n readonly error: unknown;\n}\ninterface JudgeProbeTimeout {\n readonly _tag: \"JudgeProbeTimeout\";\n}\ntype JudgeProbeFailure = JudgeProviderFailure | JudgeProbeTimeout;\n/**\n * An author-facing AbortSignal is external to this fiber. It must interrupt\n * the owning Effect instead of being reclassified as a Judge result.\n */\nfunction interruptWhenAborted(signal: AbortSignal): Effect.Effect<never> {\n return Effect.async<never>((resume) => {\n let completed = false;\n const interrupted = () => {\n if (completed)\n return;\n completed = true;\n resume(Effect.interrupt);\n };\n signal.addEventListener(\"abort\", interrupted, { once: true });\n // Register first, then inspect state so an abort cannot fall between the\n // initial check and listener installation.\n if (signal.aborted)\n interrupted();\n return Effect.sync(() => {\n completed = true;\n signal.removeEventListener(\"abort\", interrupted);\n });\n });\n}\nfunction interruptibleByCaller<A, E, R>(effect: Effect.Effect<A, E, R>, signal: AbortSignal | undefined): Effect.Effect<A, E, R> {\n if (signal === undefined)\n return effect;\n return Effect.suspend(() => signal.aborted\n ? Effect.interrupt\n : Effect.raceFirst(effect, interruptWhenAborted(signal)));\n}\nfunction formatSeconds(ms: number): string {\n const seconds = ms / 1000;\n return `${Number.isInteger(seconds) ? seconds : seconds.toFixed(1)}s`;\n}\nfunction judgeFailureEvidence(error: unknown, model: string, attempts: number, retried: boolean): string {\n const parts = [`model=${model}`];\n const status = judgeStatus(error);\n const code = judgeCode(error);\n if (status !== undefined)\n parts.push(`HTTP ${status}`);\n if (code !== undefined)\n parts.push(`code=${code}`);\n parts.push(errorSummary(error));\n parts.push(retried ? `retry=yes · attempts=${attempts}` : \"retry=no\");\n if (attempts >= JUDGE_MAX_ATTEMPTS)\n parts.push(\"retries exhausted\");\n return parts.join(\" · \");\n}\nfunction judgeClient(apiKey: string, baseURL: string, signal?: AbortSignal): OpenAI {\n return new OpenAI({\n apiKey,\n baseURL,\n maxRetries: 0,\n fetch: signal\n ? (input, init) => fetch(input, {\n ...init,\n signal: init?.signal ? AbortSignal.any([signal, init.signal]) : signal,\n })\n : undefined,\n });\n}\ntype AutoevalOpenAIClient = NonNullable<Parameters<typeof ClosedQA>[0][\"client\"]>;\nfunction bridgeAutoevalClient(client: OpenAI): {\n readonly client: AutoevalOpenAIClient;\n} {\n // @ts-expect-error autoevals and this package resolve equivalent OpenAI SDKs through distinct peer contexts.\n return { client };\n}\nexport function freezeJudgeMaterial(material: JudgeMaterial): JudgeMaterial {\n if (typeof material !== \"object\" || material === null || typeof material.input !== \"string\" || typeof material.output !== \"string\") {\n throw new TypeError(\"t.judge requires material { input: string, output: string }\");\n }\n return Object.freeze({ input: material.input, output: material.output });\n}\nfunction evidenceFor(material: JudgeMaterial): string {\n return JSON.stringify({ input: summaryText(material.input), output: summaryText(material.output) });\n}\nfunction missingConfiguration(resolved: ResolvedJudgeConfig): JudgeMeasurementResult | undefined {\n if (!resolved.model)\n return unavailable(\"judge-model-unresolved\");\n if (!getEnv(resolved.apiKeyEnv))\n return unavailable(`judge-key-unresolved (${resolved.apiKeyEnv} unset)`);\n return undefined;\n}\nconst retryProbe = Symbol(\"retry-judge-probe\");\nfunction probeAttempt(judge: ResolvedJudgeConfig, apiKey: string, endpoint: string, attempt: number, callerSignal: AbortSignal | undefined): Effect.Effect<string | undefined | typeof retryProbe, JudgeProbeFailure> {\n const probe = Effect.gen(function* () {\n const response = yield* Effect.tryPromise({\n try: async (effectSignal) => {\n // This is the probe's sole Promise adapter boundary. The Effect fiber\n // owns provider cancellation; caller aborts interrupt that fiber first.\n const response = await fetch(`${endpoint}/chat/completions`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\", Authorization: `Bearer ${apiKey}` },\n body: JSON.stringify({ model: judge.model, messages: [{ role: \"user\", content: \"Reply with the single word: ok\" }] }),\n signal: effectSignal,\n });\n return {\n response,\n body: response.ok ? \"\" : await response.text().catch(() => \"\"),\n };\n },\n catch: (error): JudgeProviderFailure => ({ _tag: \"JudgeProviderFailure\", error }),\n });\n if (response.response.ok)\n return undefined;\n if (isTransientJudgeStatus(response.response.status) && attempt < PROBE_MAX_ATTEMPTS) {\n const delay = retryAfterMs(response.response.headers);\n if (delay !== undefined)\n yield* Effect.sleep(delay);\n return retryProbe;\n }\n return `Judge precheck failed for ${endpoint} (${judge.model}): HTTP ${response.response.status} ${response.body.slice(0, 300)}`;\n }).pipe(Effect.timeoutFail({\n duration: PROBE_TIMEOUT_MS,\n onTimeout: (): JudgeProbeTimeout => ({ _tag: \"JudgeProbeTimeout\" }),\n }));\n return interruptibleByCaller(probe, callerSignal);\n}\nfunction probeFailureMessage(failure: JudgeProbeFailure, judge: ResolvedJudgeConfig, endpoint: string): string {\n if (failure._tag === \"JudgeProbeTimeout\") {\n return `Judge precheck timed out for ${endpoint} (${judge.model}) after ${PROBE_TIMEOUT_MS / 1000}s`;\n }\n return `Judge precheck failed for ${endpoint} (${judge.model}): ${errorSummary(failure.error)}`;\n}\n/**\n * A precheck only tests a configured, credentialed endpoint. Missing model or\n * key remains a normal zero-network unavailable Assertion when an author consumes it.\n */\nexport function probeJudgeEffect(judge: ResolvedJudgeConfig, signal?: AbortSignal): Effect.Effect<string | undefined> {\n return Effect.suspend(() => {\n const apiKey = getEnv(judge.apiKeyEnv);\n if (!judge.model || !apiKey)\n return Effect.succeed(undefined);\n const endpoint = judge.baseUrl.replace(/\\/$/, \"\");\n const probe = (attempt: number): Effect.Effect<string | undefined> => probeAttempt(judge, apiKey, endpoint, attempt, signal).pipe(Effect.flatMap((result) => result === retryProbe\n ? probe(attempt + 1)\n : Effect.succeed(result)), Effect.catchAll((failure) => attempt === PROBE_MAX_ATTEMPTS\n ? Effect.succeed(probeFailureMessage(failure, judge, endpoint))\n : probe(attempt + 1)));\n return probe(1);\n });\n}\nfunction unavailableForCall(model: string, timeoutMs: number, attempts: number, retried: boolean): JudgeMeasurementResult {\n return unavailable(\"judge-call-failed\", `model=${model} · timed out after ${formatSeconds(timeoutMs)} · retry=${retried ? \"yes\" : \"no\"} · attempts=${attempts}`);\n}\nfunction unavailable(detail: string, evidence?: string): JudgeMeasurementResult {\n return {\n state: \"unavailable\",\n reason: \"source-unavailable\",\n detail,\n ...(evidence === undefined ? {} : { evidence }),\n };\n}\nfunction evaluatorError(code: string, message: string): JudgeMeasurementResult {\n return { state: \"errored\", code, message };\n}\n/** Throws synchronously at the author callsite when the Eval did not opt in. */\nexport function assertJudgeCapability(judge: ResolvedJudgeConfig | undefined): asserts judge is ResolvedJudgeConfig {\n if (judge === undefined) {\n throw new Error(\"Judge Assertion requires defineEval({ judge: true }) or defineScoreEval({ judge: true })\");\n }\n}\nexport interface JudgeRecipeExecution {\n readonly judge: ResolvedJudgeConfig;\n readonly recipe: JudgeRecipe;\n readonly reference: string;\n readonly material: JudgeMaterial;\n readonly signal?: AbortSignal;\n readonly random?: () => number;\n}\nfunction evaluateAutoeval(input: JudgeRecipeExecution, material: JudgeMaterial, apiKey: string, model: string): Effect.Effect<AutoevalResult, JudgeProviderFailure> {\n const provider = Effect.tryPromise({\n try: (effectSignal) => {\n const client = bridgeAutoevalClient(judgeClient(apiKey, input.judge.baseUrl, effectSignal));\n return Promise.resolve(input.recipe === \"closedQA\"\n ? ClosedQA({ input: material.input, output: material.output, criteria: input.reference, model, ...client })\n : input.recipe === \"factuality\"\n ? Factuality({ input: material.input, output: material.output, expected: input.reference, model, ...client })\n : Summary({ input: material.input, output: material.output, expected: input.reference, model, ...client }));\n },\n catch: (error): JudgeProviderFailure => ({ _tag: \"JudgeProviderFailure\", error }),\n });\n return provider;\n}\nfunction judgeSleep(delayMs: number): Effect.Effect<void> {\n return Effect.sleep(delayMs);\n}\n/**\n * The real Judge invocation. Provider I/O is adapted once, then retry,\n * timeout, interruption, and delay remain inside the owning Effect.\n */\nfunction evaluateJudgeRecipe(input: JudgeRecipeExecution): Effect.Effect<JudgeMeasurementResult> {\n const evaluation = Effect.suspend(() => {\n const { judge: resolved } = input;\n const frozenMaterial = freezeJudgeMaterial(input.material);\n const missing = missingConfiguration(resolved);\n if (missing !== undefined)\n return Effect.succeed(missing);\n const model = resolved.model!;\n const apiKey = getEnv(resolved.apiKeyEnv)!;\n let attempts = 0;\n let retried = false;\n const evaluate = (attempt: number): Effect.Effect<JudgeMeasurementResult> => Effect.sync(() => {\n attempts = attempt + 1;\n }).pipe(Effect.zipRight(evaluateAutoeval(input, frozenMaterial, apiKey, model).pipe(Effect.flatMap((result): Effect.Effect<JudgeMeasurementResult> => {\n if (typeof result.score !== \"number\" || !Number.isFinite(result.score) || result.score < 0 || result.score > 1) {\n return Effect.succeed(evaluatorError(\"judge-invalid-response\", \"Judge returned no finite score in [0, 1]\"));\n }\n const rationale = result.metadata?.rationale;\n return Effect.succeed({\n state: \"measured\" as const,\n value: result.score,\n evidence: evidenceFor(frozenMaterial),\n ...(typeof rationale === \"string\" && rationale.trim() !== \"\" ? { explanation: summaryText(rationale) } : {}),\n });\n }), Effect.catchAll((failure: JudgeProviderFailure): Effect.Effect<JudgeMeasurementResult> => {\n const error = failure.error;\n if (!isTransportFailure(error))\n return Effect.succeed(evaluatorError(\"judge-evaluator-error\", errorSummary(error)));\n if (!isTransientJudgeFailure(error) || attempt + 1 >= JUDGE_MAX_ATTEMPTS) {\n return Effect.succeed(unavailable(\"judge-call-failed\", judgeFailureEvidence(error, model, attempts, retried)));\n }\n const retryAfter = retryAfterMs(objectField(error, \"headers\"));\n const delay = retryAfter ?? (input.random ?? Math.random)() * JUDGE_RETRY_BASE_DELAY_MS * 2 ** attempt;\n retried = true;\n return judgeSleep(delay).pipe(Effect.zipRight(evaluate(attempt + 1)));\n }))));\n return evaluate(0).pipe(Effect.timeoutTo({\n duration: resolved.timeoutMs,\n onSuccess: (evaluation) => evaluation,\n onTimeout: () => unavailableForCall(model, resolved.timeoutMs, attempts, retried),\n }));\n });\n return interruptibleByCaller(evaluation, input.signal);\n}\n/** Assert-first bridge: one provider Promise adaptation in the Attempt Effect. */\nexport function evaluateJudgeMeasurement(input: JudgeRecipeExecution): Effect.Effect<MeasurementAssertionEvaluation, never, never> {\n return evaluateJudgeRecipe(input);\n}\n"]}
1
+ {"version":3,"file":"judge.js","sourceRoot":"","sources":["judge.ts"],"names":[],"mappings":";;;;;AAyMA,kDAKC;AAwDD,4CAaC;AAgBD,sDAIC;AA4ED,4DAEC;AArXD,2EAA2E;AAC3E,6DAA6D;AAC7D,yCAA0D;AAC1D,mCAA+C;AAC/C,oDAA4B;AAC5B,6CAA2C;AAG3C,wCAAoC;AACpC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,yBAAyB,GAAG,IAAI,CAAC;AACvC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAqB7B,SAAS,YAAY,CAAC,KAAc;IAChC,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACtD,CAAC;AACD,SAAS,WAAW,CAAC,KAAc,EAAE,GAAW;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAC3C,OAAO,SAAS,CAAC;IACrB,IAAI,CAAC;QACD,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACnC,CAAC;IACD,MAAM,CAAC;QACH,OAAO,SAAS,CAAC;IACrB,CAAC;AACL,CAAC;AACD,SAAS,WAAW,CAAC,KAAc;IAC/B,IAAI,OAAO,GAAY,KAAK,CAAC;IAC7B,KA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,EAAE,KAAK,CAAC,CAAC,cAAK,CAAC,iBAAiB,CAAC,CAAC;YAC/F,MAAM,KAAK,GAAG,UAAU,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,eAAM,CAAC,IAAI,CAAC,GAAG,yBAAyB,GAAG,CAAC,IAAI,OAAO,CAAC;YAC5H,OAAO,GAAG,IAAI,CAAC;YACf,KAAK,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YACzB,OAAO,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACP,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAM,CAAC,SAAS,CAAC;YACrC,QAAQ,EAAE,QAAQ,CAAC,SAAS;YAC5B,SAAS,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU;YACrC,SAAS,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC;SACpF,CAAC,CAAC,CAAC;IACR,CAAC,CAAC,CAAC;IACH,OAAO,qBAAqB,CAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;AAC3D,CAAC;AACD,kFAAkF;AAClF,SAAgB,wBAAwB,CAAC,KAA2B;IAChE,OAAO,mBAAmB,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Native LLM-as-Judge evaluator. The Assert-first path keeps provider I/O,\n// timeout, retry, and interruption inside the owning Effect.\nimport { ClosedQA, Factuality, Summary } from \"autoevals\";\nimport { Clock, Effect, Random } from \"effect\";\nimport OpenAI from \"openai\";\nimport { summaryText } from \"./display.ts\";\nimport type { MeasurementAssertionEvaluation } from \"./api.ts\";\nimport type { JudgeMaterial, ResolvedJudgeConfig } from \"./types.ts\";\nimport { getEnv } from \"../util.ts\";\nconst JUDGE_MAX_ATTEMPTS = 3;\nconst JUDGE_RETRY_BASE_DELAY_MS = 1000;\nconst PROBE_TIMEOUT_MS = 20000;\nconst PROBE_MAX_ATTEMPTS = 2;\nexport type JudgeRecipe = \"closedQA\" | \"factuality\" | \"summarizes\";\ntype AutoevalResult = {\n score?: number | null;\n metadata?: Record<string, unknown>;\n};\ntype JudgeMeasurementResult = {\n readonly state: \"measured\";\n readonly value: number;\n readonly evidence?: string;\n readonly explanation?: string;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"source-unavailable\";\n readonly detail: string;\n readonly evidence?: string;\n} | {\n readonly state: \"errored\";\n readonly code: string;\n readonly message: string;\n};\nfunction errorSummary(error: unknown): string {\n const message = error instanceof Error ? error.message : String(error);\n return message.replace(/\\s+/g, \" \").slice(0, 300);\n}\nfunction objectField(value: unknown, key: string): unknown {\n if (typeof value !== \"object\" || value === null)\n return undefined;\n try {\n return Reflect.get(value, key);\n }\n catch {\n return undefined;\n }\n}\nfunction judgeStatus(error: unknown): number | undefined {\n let current: unknown = error;\n for (let depth = 0; current !== undefined && depth < 5; depth++) {\n const status = objectField(current, \"status\");\n if (typeof status === \"number\" && Number.isInteger(status))\n return status;\n const nested = objectField(current, \"error\");\n const nestedStatus = objectField(nested, \"status\");\n if (typeof nestedStatus === \"number\" && Number.isInteger(nestedStatus))\n return nestedStatus;\n current = objectField(current, \"cause\");\n }\n return undefined;\n}\nfunction judgeCode(error: unknown): string | undefined {\n let current: unknown = error;\n for (let depth = 0; current !== undefined && depth < 5; depth++) {\n const code = objectField(current, \"code\");\n if (typeof code === \"string\" && code !== \"\")\n return code;\n const nestedCode = objectField(objectField(current, \"error\"), \"code\");\n if (typeof nestedCode === \"string\" && nestedCode !== \"\")\n return nestedCode;\n current = objectField(current, \"cause\");\n }\n return undefined;\n}\nfunction headerValue(headers: unknown, name: string): string | undefined {\n if (headers instanceof Headers)\n return headers.get(name) ?? undefined;\n if (typeof headers !== \"object\" || headers === null)\n return undefined;\n const lower = name.toLowerCase();\n for (const [key, value] of Object.entries(headers)) {\n if (key.toLowerCase() === lower && typeof value === \"string\")\n return value;\n }\n return undefined;\n}\nfunction retryAfterMs(headers: unknown, nowMs: number): number | undefined {\n const raw = headerValue(headers, \"retry-after\")?.trim();\n if (!raw)\n return undefined;\n const seconds = Number(raw);\n if (Number.isFinite(seconds) && seconds >= 0)\n return Math.round(seconds * 1000);\n const timestamp = Date.parse(raw);\n return Number.isFinite(timestamp) ? Math.max(0, timestamp - nowMs) : undefined;\n}\nfunction isTransientJudgeStatus(status: number | undefined): boolean {\n return status === 408 || status === 429 || (status !== undefined && status >= 500 && status <= 599);\n}\nfunction isConnectionFailure(error: unknown): boolean {\n let current: unknown = error;\n for (let depth = 0; current !== undefined && depth < 5; depth++) {\n const name = objectField(current, \"name\");\n const code = objectField(current, \"code\");\n if (name === \"APIUserAbortError\")\n return false;\n if (name === \"APIConnectionError\" || name === \"APIConnectionTimeoutError\")\n return true;\n if (typeof code === \"string\" && /^(?:ECONN|ENOTFOUND|EAI_AGAIN|ENETUNREACH|EHOSTUNREACH|ETIMEDOUT|ERR_TLS)/i.test(code))\n return true;\n if (/fetch failed|socket hang up|connection (?:reset|closed|refused)|network error|other side closed|timed? out|timeout|\\b(?:ECONNRESET|ECONNREFUSED|ENOTFOUND|EAI_AGAIN|ETIMEDOUT)\\b/i.test(errorSummary(current))) {\n return true;\n }\n current = objectField(current, \"cause\");\n }\n return false;\n}\nfunction isTransportFailure(error: unknown): boolean {\n return judgeStatus(error) !== undefined || isConnectionFailure(error);\n}\nfunction isTransientJudgeFailure(error: unknown): boolean {\n const status = judgeStatus(error);\n return isTransientJudgeStatus(status) || (status === undefined && isConnectionFailure(error));\n}\ninterface JudgeProviderFailure {\n readonly _tag: \"JudgeProviderFailure\";\n readonly error: unknown;\n}\ninterface JudgeProbeTimeout {\n readonly _tag: \"JudgeProbeTimeout\";\n}\ntype JudgeProbeFailure = JudgeProviderFailure | JudgeProbeTimeout;\n/**\n * An author-facing AbortSignal is external to this fiber. It must interrupt\n * the owning Effect instead of being reclassified as a Judge result.\n */\nfunction interruptWhenAborted(signal: AbortSignal): Effect.Effect<never> {\n return Effect.async<never>((resume) => {\n let completed = false;\n const interrupted = () => {\n if (completed)\n return;\n completed = true;\n resume(Effect.interrupt);\n };\n signal.addEventListener(\"abort\", interrupted, { once: true });\n // Register first, then inspect state so an abort cannot fall between the\n // initial check and listener installation.\n if (signal.aborted)\n interrupted();\n return Effect.sync(() => {\n completed = true;\n signal.removeEventListener(\"abort\", interrupted);\n });\n });\n}\nfunction interruptibleByCaller<A, E, R>(effect: Effect.Effect<A, E, R>, signal: AbortSignal | undefined): Effect.Effect<A, E, R> {\n if (signal === undefined)\n return effect;\n return Effect.suspend(() => signal.aborted\n ? Effect.interrupt\n : Effect.raceFirst(effect, interruptWhenAborted(signal)));\n}\nfunction formatSeconds(ms: number): string {\n const seconds = ms / 1000;\n return `${Number.isInteger(seconds) ? seconds : seconds.toFixed(1)}s`;\n}\nfunction judgeFailureEvidence(error: unknown, model: string, attempts: number, retried: boolean): string {\n const parts = [`model=${model}`];\n const status = judgeStatus(error);\n const code = judgeCode(error);\n if (status !== undefined)\n parts.push(`HTTP ${status}`);\n if (code !== undefined)\n parts.push(`code=${code}`);\n parts.push(errorSummary(error));\n parts.push(retried ? `retry=yes · attempts=${attempts}` : \"retry=no\");\n if (attempts >= JUDGE_MAX_ATTEMPTS)\n parts.push(\"retries exhausted\");\n return parts.join(\" · \");\n}\nfunction judgeClient(apiKey: string, baseURL: string, signal?: AbortSignal): OpenAI {\n return new OpenAI({\n apiKey,\n baseURL,\n maxRetries: 0,\n fetch: signal\n ? (input, init) => fetch(input, {\n ...init,\n signal: init?.signal ? AbortSignal.any([signal, init.signal]) : signal,\n })\n : undefined,\n });\n}\ntype AutoevalOpenAIClient = NonNullable<Parameters<typeof ClosedQA>[0][\"client\"]>;\nfunction bridgeAutoevalClient(client: OpenAI): {\n readonly client: AutoevalOpenAIClient;\n} {\n // @ts-expect-error autoevals and this package resolve equivalent OpenAI SDKs through distinct peer contexts.\n return { client };\n}\nexport function freezeJudgeMaterial(material: JudgeMaterial): JudgeMaterial {\n if (typeof material !== \"object\" || material === null || typeof material.input !== \"string\" || typeof material.output !== \"string\") {\n throw new TypeError(\"t.judge requires material { input: string, output: string }\");\n }\n return Object.freeze({ input: material.input, output: material.output });\n}\nfunction evidenceFor(material: JudgeMaterial): string {\n return JSON.stringify({ input: summaryText(material.input), output: summaryText(material.output) });\n}\nfunction missingConfiguration(resolved: ResolvedJudgeConfig): JudgeMeasurementResult | undefined {\n if (!resolved.model)\n return unavailable(\"judge-model-unresolved\");\n if (!getEnv(resolved.apiKeyEnv))\n return unavailable(`judge-key-unresolved (${resolved.apiKeyEnv} unset)`);\n return undefined;\n}\nconst retryProbe = Symbol(\"retry-judge-probe\");\nfunction probeAttempt(judge: ResolvedJudgeConfig, apiKey: string, endpoint: string, attempt: number, callerSignal: AbortSignal | undefined): Effect.Effect<string | undefined | typeof retryProbe, JudgeProbeFailure> {\n const probe = Effect.gen(function* () {\n const response = yield* Effect.tryPromise({\n try: async (effectSignal) => {\n // This is the probe's sole Promise adapter boundary. The Effect fiber\n // owns provider cancellation; caller aborts interrupt that fiber first.\n const response = await fetch(`${endpoint}/chat/completions`, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\", Authorization: `Bearer ${apiKey}` },\n body: JSON.stringify({ model: judge.model, messages: [{ role: \"user\", content: \"Reply with the single word: ok\" }] }),\n signal: effectSignal,\n });\n return {\n response,\n body: response.ok ? \"\" : await response.text().catch(() => \"\"),\n };\n },\n catch: (error): JudgeProviderFailure => ({ _tag: \"JudgeProviderFailure\", error }),\n });\n if (response.response.ok)\n return undefined;\n if (isTransientJudgeStatus(response.response.status) && attempt < PROBE_MAX_ATTEMPTS) {\n const delay = retryAfterMs(response.response.headers, yield* Clock.currentTimeMillis);\n if (delay !== undefined)\n yield* Effect.sleep(delay);\n return retryProbe;\n }\n return `Judge precheck failed for ${endpoint} (${judge.model}): HTTP ${response.response.status} ${response.body.slice(0, 300)}`;\n }).pipe(Effect.timeoutFail({\n duration: PROBE_TIMEOUT_MS,\n onTimeout: (): JudgeProbeTimeout => ({ _tag: \"JudgeProbeTimeout\" }),\n }));\n return interruptibleByCaller(probe, callerSignal);\n}\nfunction probeFailureMessage(failure: JudgeProbeFailure, judge: ResolvedJudgeConfig, endpoint: string): string {\n if (failure._tag === \"JudgeProbeTimeout\") {\n return `Judge precheck timed out for ${endpoint} (${judge.model}) after ${PROBE_TIMEOUT_MS / 1000}s`;\n }\n return `Judge precheck failed for ${endpoint} (${judge.model}): ${errorSummary(failure.error)}`;\n}\n/**\n * A precheck only tests a configured, credentialed endpoint. Missing model or\n * key remains a normal zero-network unavailable Assertion when an author consumes it.\n */\nexport function probeJudgeEffect(judge: ResolvedJudgeConfig, signal?: AbortSignal): Effect.Effect<string | undefined> {\n return Effect.suspend(() => {\n const apiKey = getEnv(judge.apiKeyEnv);\n if (!judge.model || !apiKey)\n return Effect.succeed(undefined);\n const endpoint = judge.baseUrl.replace(/\\/$/, \"\");\n const probe = (attempt: number): Effect.Effect<string | undefined> => probeAttempt(judge, apiKey, endpoint, attempt, signal).pipe(Effect.flatMap((result) => result === retryProbe\n ? probe(attempt + 1)\n : Effect.succeed(result)), Effect.catchAll((failure) => attempt === PROBE_MAX_ATTEMPTS\n ? Effect.succeed(probeFailureMessage(failure, judge, endpoint))\n : probe(attempt + 1)));\n return probe(1);\n });\n}\nfunction unavailableForCall(model: string, timeoutMs: number, attempts: number, retried: boolean): JudgeMeasurementResult {\n return unavailable(\"judge-call-failed\", `model=${model} · timed out after ${formatSeconds(timeoutMs)} · retry=${retried ? \"yes\" : \"no\"} · attempts=${attempts}`);\n}\nfunction unavailable(detail: string, evidence?: string): JudgeMeasurementResult {\n return {\n state: \"unavailable\",\n reason: \"source-unavailable\",\n detail,\n ...(evidence === undefined ? {} : { evidence }),\n };\n}\nfunction evaluatorError(code: string, message: string): JudgeMeasurementResult {\n return { state: \"errored\", code, message };\n}\n/** Throws synchronously at the author callsite when the Eval did not opt in. */\nexport function assertJudgeCapability(judge: ResolvedJudgeConfig | undefined): asserts judge is ResolvedJudgeConfig {\n if (judge === undefined) {\n throw new Error(\"Judge Assertion requires defineEval({ judge: true }) or defineScoreEval({ judge: true })\");\n }\n}\nexport interface JudgeRecipeExecution {\n readonly judge: ResolvedJudgeConfig;\n readonly recipe: JudgeRecipe;\n readonly reference: string;\n readonly material: JudgeMaterial;\n readonly signal?: AbortSignal;\n readonly random?: () => number;\n}\nfunction evaluateAutoeval(input: JudgeRecipeExecution, material: JudgeMaterial, apiKey: string, model: string): Effect.Effect<AutoevalResult, JudgeProviderFailure> {\n const provider = Effect.tryPromise({\n try: (effectSignal) => {\n const client = bridgeAutoevalClient(judgeClient(apiKey, input.judge.baseUrl, effectSignal));\n return Promise.resolve(input.recipe === \"closedQA\"\n ? ClosedQA({ input: material.input, output: material.output, criteria: input.reference, model, ...client })\n : input.recipe === \"factuality\"\n ? Factuality({ input: material.input, output: material.output, expected: input.reference, model, ...client })\n : Summary({ input: material.input, output: material.output, expected: input.reference, model, ...client }));\n },\n catch: (error): JudgeProviderFailure => ({ _tag: \"JudgeProviderFailure\", error }),\n });\n return provider;\n}\nfunction judgeSleep(delayMs: number): Effect.Effect<void> {\n return Effect.sleep(delayMs);\n}\n/**\n * The real Judge invocation. Provider I/O is adapted once, then retry,\n * timeout, interruption, and delay remain inside the owning Effect.\n */\nfunction evaluateJudgeRecipe(input: JudgeRecipeExecution): Effect.Effect<JudgeMeasurementResult> {\n const evaluation = Effect.suspend(() => {\n const { judge: resolved } = input;\n const frozenMaterial = freezeJudgeMaterial(input.material);\n const missing = missingConfiguration(resolved);\n if (missing !== undefined)\n return Effect.succeed(missing);\n const model = resolved.model!;\n const apiKey = getEnv(resolved.apiKeyEnv)!;\n let attempts = 0;\n let retried = false;\n const evaluate = (attempt: number): Effect.Effect<JudgeMeasurementResult> => Effect.sync(() => {\n attempts = attempt + 1;\n }).pipe(Effect.zipRight(evaluateAutoeval(input, frozenMaterial, apiKey, model).pipe(Effect.flatMap((result): Effect.Effect<JudgeMeasurementResult> => {\n if (typeof result.score !== \"number\" || !Number.isFinite(result.score) || result.score < 0 || result.score > 1) {\n return Effect.succeed(evaluatorError(\"judge-invalid-response\", \"Judge returned no finite score in [0, 1]\"));\n }\n const rationale = result.metadata?.rationale;\n return Effect.succeed({\n state: \"measured\" as const,\n value: result.score,\n evidence: evidenceFor(frozenMaterial),\n ...(typeof rationale === \"string\" && rationale.trim() !== \"\" ? { explanation: summaryText(rationale) } : {}),\n });\n }), Effect.catchAll((failure: JudgeProviderFailure): Effect.Effect<JudgeMeasurementResult> => Effect.gen(function* () {\n const error = failure.error;\n if (!isTransportFailure(error))\n return evaluatorError(\"judge-evaluator-error\", errorSummary(error));\n if (!isTransientJudgeFailure(error) || attempt + 1 >= JUDGE_MAX_ATTEMPTS) {\n return unavailable(\"judge-call-failed\", judgeFailureEvidence(error, model, attempts, retried));\n }\n const retryAfter = retryAfterMs(objectField(error, \"headers\"), yield* Clock.currentTimeMillis);\n const delay = retryAfter ?? (input.random ? input.random() : yield* Random.next) * JUDGE_RETRY_BASE_DELAY_MS * 2 ** attempt;\n retried = true;\n yield* judgeSleep(delay);\n return yield* evaluate(attempt + 1);\n })))));\n return evaluate(0).pipe(Effect.timeoutTo({\n duration: resolved.timeoutMs,\n onSuccess: (evaluation) => evaluation,\n onTimeout: () => unavailableForCall(model, resolved.timeoutMs, attempts, retried),\n }));\n });\n return interruptibleByCaller(evaluation, input.signal);\n}\n/** Assert-first bridge: one provider Promise adaptation in the Attempt Effect. */\nexport function evaluateJudgeMeasurement(input: JudgeRecipeExecution): Effect.Effect<MeasurementAssertionEvaluation, never, never> {\n return evaluateJudgeRecipe(input);\n}\n"]}