niceeval 0.17.1 → 0.19.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 (692) hide show
  1. package/INDEX.md +5 -2
  2. package/dist/adapter-usage.cjs.map +1 -1
  3. package/dist/adapter-usage.d.cts +1 -1
  4. package/dist/adapter-usage.d.mts +1 -1
  5. package/dist/adapter-usage.d.ts +1 -1
  6. package/dist/adapter.cjs +8 -3
  7. package/dist/adapter.cjs.map +1 -1
  8. package/dist/adapter.d.cts +26 -15
  9. package/dist/adapter.d.mts +26 -15
  10. package/dist/adapter.d.ts +26 -15
  11. package/dist/agents/{effect-runtime.cjs → agent-effects.cjs} +12 -18
  12. package/dist/agents/agent-effects.cjs.map +1 -0
  13. package/dist/agents/agent-effects.d.cts +23 -0
  14. package/dist/agents/agent-effects.d.mts +23 -0
  15. package/dist/agents/agent-effects.d.ts +23 -0
  16. package/dist/agents/agent-effects.js +16 -0
  17. package/dist/agents/agent-effects.js.map +1 -0
  18. package/dist/agents/ai-sdk.cjs +1 -1
  19. package/dist/agents/ai-sdk.cjs.map +1 -1
  20. package/dist/agents/bub.cjs +31 -18
  21. package/dist/agents/bub.cjs.map +1 -1
  22. package/dist/agents/bub.d.cts +9 -12
  23. package/dist/agents/bub.d.mts +9 -12
  24. package/dist/agents/bub.d.ts +9 -12
  25. package/dist/agents/claude-code-native.cjs +2 -2
  26. package/dist/agents/claude-code-native.cjs.map +1 -1
  27. package/dist/agents/claude-code.cjs +17 -11
  28. package/dist/agents/claude-code.cjs.map +1 -1
  29. package/dist/agents/claude-code.d.cts +11 -11
  30. package/dist/agents/claude-code.d.mts +11 -11
  31. package/dist/agents/claude-code.d.ts +11 -11
  32. package/dist/agents/codex-app-server.cjs +2 -2
  33. package/dist/agents/codex-app-server.cjs.map +1 -1
  34. package/dist/agents/codex.cjs +18 -12
  35. package/dist/agents/codex.cjs.map +1 -1
  36. package/dist/agents/codex.d.cts +12 -12
  37. package/dist/agents/codex.d.mts +12 -12
  38. package/dist/agents/codex.d.ts +12 -12
  39. package/dist/agents/deepseek-harness.cjs +2 -2
  40. package/dist/agents/deepseek-harness.cjs.map +1 -1
  41. package/dist/agents/hermes.cjs +3 -3
  42. package/dist/agents/hermes.cjs.map +1 -1
  43. package/dist/agents/index.cjs +3 -3
  44. package/dist/agents/index.cjs.map +1 -1
  45. package/dist/agents/index.d.cts +3 -3
  46. package/dist/agents/index.d.mts +3 -3
  47. package/dist/agents/index.d.ts +3 -3
  48. package/dist/agents/index.js +2 -2
  49. package/dist/agents/index.mjs +2 -2
  50. package/dist/agents/mcp.cjs.map +1 -1
  51. package/dist/agents/mcp.d.cts +2 -2
  52. package/dist/agents/mcp.d.mts +2 -2
  53. package/dist/agents/mcp.d.ts +2 -2
  54. package/dist/agents/omp.cjs +2 -2
  55. package/dist/agents/omp.cjs.map +1 -1
  56. package/dist/agents/openai-compat.cjs +2 -2
  57. package/dist/agents/openai-compat.cjs.map +1 -1
  58. package/dist/agents/openclaw.cjs +3 -3
  59. package/dist/agents/openclaw.cjs.map +1 -1
  60. package/dist/agents/opencode.cjs +16 -4
  61. package/dist/agents/opencode.cjs.map +1 -1
  62. package/dist/agents/plugin-extensions.cjs +71 -0
  63. package/dist/agents/plugin-extensions.cjs.map +1 -0
  64. package/dist/agents/plugin-extensions.d.cts +26 -0
  65. package/dist/agents/plugin-extensions.d.mts +26 -0
  66. package/dist/agents/plugin-extensions.d.ts +26 -0
  67. package/dist/agents/plugin-extensions.js +8 -0
  68. package/dist/agents/plugin-extensions.js.map +1 -0
  69. package/dist/agents/post-setup.cjs +14 -3
  70. package/dist/agents/post-setup.cjs.map +1 -1
  71. package/dist/agents/post-setup.d.cts +4 -2
  72. package/dist/agents/post-setup.d.mts +4 -2
  73. package/dist/agents/post-setup.d.ts +4 -2
  74. package/dist/agents/post-setup.js +8 -6
  75. package/dist/agents/sdk-streams.cjs +3 -3
  76. package/dist/agents/sdk-streams.cjs.map +1 -1
  77. package/dist/agents/{session-slot.cjs → session-key.cjs} +4 -4
  78. package/dist/agents/session-key.cjs.map +1 -0
  79. package/dist/agents/session-key.d.cts +12 -0
  80. package/dist/agents/session-key.d.mts +12 -0
  81. package/dist/agents/session-key.d.ts +12 -0
  82. package/dist/agents/session-key.js +6 -0
  83. package/dist/agents/session-key.js.map +1 -0
  84. package/dist/agents/shared.cjs +2 -2
  85. package/dist/agents/shared.cjs.map +1 -1
  86. package/dist/agents/shared.d.cts +4 -4
  87. package/dist/agents/shared.d.mts +4 -4
  88. package/dist/agents/shared.d.ts +4 -4
  89. package/dist/agents/skills.cjs.map +1 -1
  90. package/dist/agents/skills.d.cts +3 -3
  91. package/dist/agents/skills.d.mts +3 -3
  92. package/dist/agents/skills.d.ts +3 -3
  93. package/dist/agents/types.cjs.map +1 -1
  94. package/dist/agents/types.d.cts +55 -54
  95. package/dist/agents/types.d.mts +55 -54
  96. package/dist/agents/types.d.ts +55 -54
  97. package/dist/agents/ui-message-stream.cjs +4 -4
  98. package/dist/agents/ui-message-stream.cjs.map +1 -1
  99. package/dist/agents/unrecognized-events.cjs +32 -0
  100. package/dist/agents/unrecognized-events.cjs.map +1 -0
  101. package/dist/agents/unrecognized-events.d.cts +8 -0
  102. package/dist/agents/unrecognized-events.d.mts +8 -0
  103. package/dist/agents/unrecognized-events.d.ts +8 -0
  104. package/dist/agents/unrecognized-events.js +6 -0
  105. package/dist/agents/unrecognized-events.js.map +1 -0
  106. package/dist/assertions/api.cjs.map +1 -1
  107. package/dist/assertions/api.d.cts +3 -0
  108. package/dist/assertions/api.d.mts +3 -0
  109. package/dist/assertions/api.d.ts +3 -0
  110. package/dist/assertions/collection.cjs +1 -1
  111. package/dist/assertions/collection.cjs.map +1 -1
  112. package/dist/assertions/judge.cjs +1 -1
  113. package/dist/assertions/judge.cjs.map +1 -1
  114. package/dist/assertions/match.cjs +52 -21
  115. package/dist/assertions/match.cjs.map +1 -1
  116. package/dist/assertions/match.d.cts +16 -5
  117. package/dist/assertions/match.d.mts +16 -5
  118. package/dist/assertions/match.d.ts +16 -5
  119. package/dist/assertions/match.js +96 -94
  120. package/dist/assertions/measurements.cjs +61 -0
  121. package/dist/assertions/measurements.cjs.map +1 -0
  122. package/dist/assertions/measurements.d.cts +24 -0
  123. package/dist/assertions/measurements.d.mts +24 -0
  124. package/dist/assertions/measurements.d.ts +24 -0
  125. package/dist/assertions/measurements.js +8 -0
  126. package/dist/assertions/measurements.js.map +1 -0
  127. package/dist/assertions/numeric.cjs +2 -0
  128. package/dist/assertions/numeric.cjs.map +1 -1
  129. package/dist/assertions/numeric.d.cts +1 -1
  130. package/dist/assertions/numeric.d.mts +1 -1
  131. package/dist/assertions/numeric.d.ts +1 -1
  132. package/dist/assertions/quantity.cjs +42 -0
  133. package/dist/assertions/quantity.cjs.map +1 -0
  134. package/dist/assertions/quantity.d.cts +18 -0
  135. package/dist/assertions/quantity.d.mts +18 -0
  136. package/dist/assertions/quantity.d.ts +18 -0
  137. package/dist/assertions/quantity.js +22 -0
  138. package/dist/assertions/quantity.js.map +1 -0
  139. package/dist/assertions/record/attachment.cjs +2 -0
  140. package/dist/assertions/record/attachment.cjs.map +1 -1
  141. package/dist/assertions/record/codec.cjs +5 -1
  142. package/dist/assertions/record/codec.cjs.map +1 -1
  143. package/dist/assertions/record/model.cjs.map +1 -1
  144. package/dist/assertions/record/model.d.cts +3 -1
  145. package/dist/assertions/record/model.d.mts +3 -1
  146. package/dist/assertions/record/model.d.ts +3 -1
  147. package/dist/assertions/runtime.cjs +11 -6
  148. package/dist/assertions/runtime.cjs.map +1 -1
  149. package/dist/cli/program.cjs +3 -0
  150. package/dist/cli/program.cjs.map +1 -1
  151. package/dist/context/assert-first.cjs +6 -4
  152. package/dist/context/assert-first.cjs.map +1 -1
  153. package/dist/context/assert-first.d.cts +9 -3
  154. package/dist/context/assert-first.d.mts +9 -3
  155. package/dist/context/assert-first.d.ts +9 -3
  156. package/dist/context/notes.cjs +47 -0
  157. package/dist/context/notes.cjs.map +1 -0
  158. package/dist/context/notes.d.cts +10 -0
  159. package/dist/context/notes.d.mts +10 -0
  160. package/dist/context/notes.d.ts +10 -0
  161. package/dist/context/notes.js +6 -0
  162. package/dist/context/notes.js.map +1 -0
  163. package/dist/context/send-failures.cjs +1 -7
  164. package/dist/context/send-failures.cjs.map +1 -1
  165. package/dist/context/send-failures.d.cts +2 -3
  166. package/dist/context/send-failures.d.mts +2 -3
  167. package/dist/context/send-failures.d.ts +2 -3
  168. package/dist/context/send-retry.cjs +0 -1
  169. package/dist/context/send-retry.cjs.map +1 -1
  170. package/dist/context/send-retry.d.cts +1 -2
  171. package/dist/context/send-retry.d.mts +1 -2
  172. package/dist/context/send-retry.d.ts +1 -2
  173. package/dist/context/session.cjs +10 -17
  174. package/dist/context/session.cjs.map +1 -1
  175. package/dist/context/session.d.cts +4 -10
  176. package/dist/context/session.d.mts +4 -10
  177. package/dist/context/session.d.ts +4 -10
  178. package/dist/define.cjs +89 -64
  179. package/dist/define.cjs.map +1 -1
  180. package/dist/define.d.cts +3 -3
  181. package/dist/define.d.mts +3 -3
  182. package/dist/define.d.ts +3 -3
  183. package/dist/eval/cli/contribution.cjs +1 -1
  184. package/dist/eval/cli/contribution.cjs.map +1 -1
  185. package/dist/eval/host/index.cjs +1 -1
  186. package/dist/eval/host/index.cjs.map +1 -1
  187. package/dist/eval/record/evaluation.cjs +1 -1
  188. package/dist/eval/record/evaluation.cjs.map +1 -1
  189. package/dist/eval/record/membership-provenance.d.cts +3 -3
  190. package/dist/eval/record/membership-provenance.d.mts +3 -3
  191. package/dist/eval/record/membership-provenance.d.ts +3 -3
  192. package/dist/eval/record/score.cjs +2 -2
  193. package/dist/eval/record/score.cjs.map +1 -1
  194. package/dist/eval/record/sealed-assertion.cjs +1 -1
  195. package/dist/eval/record/sealed-assertion.cjs.map +1 -1
  196. package/dist/eval/record/verdict.cjs +2 -2
  197. package/dist/eval/record/verdict.cjs.map +1 -1
  198. package/dist/expect/index.cjs +13 -1
  199. package/dist/expect/index.cjs.map +1 -1
  200. package/dist/expect/index.d.cts +5 -1
  201. package/dist/expect/index.d.mts +5 -1
  202. package/dist/expect/index.d.ts +5 -1
  203. package/dist/expect/index.js +92 -72
  204. package/dist/expect/index.mjs +92 -72
  205. package/dist/experiment/host/cli/contribution.cjs +52 -39
  206. package/dist/experiment/host/cli/contribution.cjs.map +1 -1
  207. package/dist/experiment/host/cli/contribution.d.cts +18 -4
  208. package/dist/experiment/host/cli/contribution.d.mts +18 -4
  209. package/dist/experiment/host/cli/contribution.d.ts +18 -4
  210. package/dist/experiment/host/cli/contribution.js +2 -2
  211. package/dist/experiment/host/cli/debug-protocol.cjs +2 -2
  212. package/dist/experiment/host/cli/debug-protocol.cjs.map +1 -1
  213. package/dist/experiment/host/cli/debug-protocol.d.cts +2 -2
  214. package/dist/experiment/host/cli/debug-protocol.d.mts +2 -2
  215. package/dist/experiment/host/cli/debug-protocol.d.ts +2 -2
  216. package/dist/experiment/host/cli/output-protocol.cjs +1 -1
  217. package/dist/experiment/host/cli/output-protocol.cjs.map +1 -1
  218. package/dist/experiment/host/cli/output-protocol.d.cts +2 -2
  219. package/dist/experiment/host/cli/output-protocol.d.mts +2 -2
  220. package/dist/experiment/host/cli/output-protocol.d.ts +2 -2
  221. package/dist/experiment/host/current.cjs +2 -2
  222. package/dist/experiment/host/current.cjs.map +1 -1
  223. package/dist/experiment/host/index.cjs +1 -1
  224. package/dist/experiment/host/index.cjs.map +1 -1
  225. package/dist/experiment/host/operations.cjs +24 -23
  226. package/dist/experiment/host/operations.cjs.map +1 -1
  227. package/dist/experiment/host/runtime.cjs +11 -10
  228. package/dist/experiment/host/runtime.cjs.map +1 -1
  229. package/dist/experiment/host/runtime.d.cts +3 -3
  230. package/dist/experiment/host/runtime.d.mts +3 -3
  231. package/dist/experiment/host/runtime.d.ts +3 -3
  232. package/dist/experiment/host/teardown.cjs +4 -3
  233. package/dist/experiment/host/teardown.cjs.map +1 -1
  234. package/dist/experiment/host/teardown.d.cts +3 -3
  235. package/dist/experiment/host/teardown.d.mts +3 -3
  236. package/dist/experiment/host/teardown.d.ts +3 -3
  237. package/dist/experiment/host/types.cjs.map +1 -1
  238. package/dist/experiment/host/types.d.cts +19 -19
  239. package/dist/experiment/host/types.d.mts +19 -19
  240. package/dist/experiment/host/types.d.ts +19 -19
  241. package/dist/index.cjs +3 -19
  242. package/dist/index.cjs.map +1 -1
  243. package/dist/index.d.cts +4 -8
  244. package/dist/index.d.mts +4 -8
  245. package/dist/index.d.ts +4 -8
  246. package/dist/index.js +12 -34
  247. package/dist/index.mjs +12 -34
  248. package/dist/inspection/assertions.cjs +1 -1
  249. package/dist/inspection/assertions.cjs.map +1 -1
  250. package/dist/inspection/cli/contribution.cjs +8 -7
  251. package/dist/inspection/cli/contribution.cjs.map +1 -1
  252. package/dist/inspection/facts.cjs +4 -4
  253. package/dist/inspection/facts.cjs.map +1 -1
  254. package/dist/inspection/index.cjs +1 -5
  255. package/dist/inspection/index.cjs.map +1 -1
  256. package/dist/inspection/index.d.cts +1 -2
  257. package/dist/inspection/index.d.mts +1 -2
  258. package/dist/inspection/index.d.ts +1 -2
  259. package/dist/inspection/index.js +20 -26
  260. package/dist/inspection/lifecycle.cjs +7 -0
  261. package/dist/inspection/lifecycle.cjs.map +1 -0
  262. package/dist/inspection/lifecycle.d.cts +4 -0
  263. package/dist/inspection/lifecycle.d.mts +4 -0
  264. package/dist/inspection/lifecycle.d.ts +4 -0
  265. package/dist/inspection/lifecycle.js +6 -0
  266. package/dist/inspection/lifecycle.js.map +1 -0
  267. package/dist/inspection/notes.cjs +40 -0
  268. package/dist/inspection/notes.cjs.map +1 -0
  269. package/dist/inspection/notes.d.cts +12 -0
  270. package/dist/inspection/notes.d.mts +12 -0
  271. package/dist/inspection/notes.d.ts +12 -0
  272. package/dist/inspection/notes.js +8 -0
  273. package/dist/inspection/notes.js.map +1 -0
  274. package/dist/inspection/overview.cjs +12 -15
  275. package/dist/inspection/overview.cjs.map +1 -1
  276. package/dist/inspection/overview.d.cts +8 -6
  277. package/dist/inspection/overview.d.mts +8 -6
  278. package/dist/inspection/overview.d.ts +8 -6
  279. package/dist/inspection/planned-attempt.cjs +45 -0
  280. package/dist/inspection/planned-attempt.cjs.map +1 -0
  281. package/dist/inspection/planned-attempt.d.cts +109 -0
  282. package/dist/inspection/planned-attempt.d.mts +109 -0
  283. package/dist/inspection/planned-attempt.d.ts +109 -0
  284. package/dist/inspection/planned-attempt.js +24 -0
  285. package/dist/inspection/planned-attempt.js.map +1 -0
  286. package/dist/inspection/project-result.cjs +5 -5
  287. package/dist/inspection/project-result.cjs.map +1 -1
  288. package/dist/inspection/project-result.d.cts +58 -57
  289. package/dist/inspection/project-result.d.mts +58 -57
  290. package/dist/inspection/project-result.d.ts +58 -57
  291. package/dist/inspection/project-result.js +4 -4
  292. package/dist/inspection/project.cjs +3 -3
  293. package/dist/inspection/project.cjs.map +1 -1
  294. package/dist/inspection/protocol-values.cjs +1 -1
  295. package/dist/inspection/protocol-values.cjs.map +1 -1
  296. package/dist/inspection/protocol-values.d.cts +1 -1
  297. package/dist/inspection/protocol-values.d.mts +1 -1
  298. package/dist/inspection/protocol-values.d.ts +1 -1
  299. package/dist/inspection/protocol.cjs +8 -8
  300. package/dist/inspection/protocol.cjs.map +1 -1
  301. package/dist/inspection/protocol.d.cts +237 -219
  302. package/dist/inspection/protocol.d.mts +237 -219
  303. package/dist/inspection/protocol.d.ts +237 -219
  304. package/dist/inspection/public.cjs +1 -5
  305. package/dist/inspection/public.cjs.map +1 -1
  306. package/dist/inspection/public.d.cts +1 -2
  307. package/dist/inspection/public.d.mts +1 -2
  308. package/dist/inspection/public.d.ts +1 -2
  309. package/dist/inspection/public.js +14 -20
  310. package/dist/inspection/public.mjs +166 -129
  311. package/dist/inspection/query.cjs +1 -1
  312. package/dist/inspection/query.cjs.map +1 -1
  313. package/dist/inspection/results.cjs +61 -52
  314. package/dist/inspection/results.cjs.map +1 -1
  315. package/dist/inspection/results.d.cts +157 -140
  316. package/dist/inspection/results.d.mts +157 -140
  317. package/dist/inspection/results.d.ts +157 -140
  318. package/dist/inspection/select.cjs +33 -28
  319. package/dist/inspection/select.cjs.map +1 -1
  320. package/dist/inspection/source.cjs +1 -1
  321. package/dist/inspection/source.cjs.map +1 -1
  322. package/dist/inspection/sources.cjs +2 -2
  323. package/dist/inspection/sources.cjs.map +1 -1
  324. package/dist/inspection/trace.cjs +9 -8
  325. package/dist/inspection/trace.cjs.map +1 -1
  326. package/dist/inspection/trace.d.cts +4 -4
  327. package/dist/inspection/trace.d.mts +4 -4
  328. package/dist/inspection/trace.d.ts +4 -4
  329. package/dist/loaders/index.cjs +7 -279
  330. package/dist/loaders/index.cjs.map +1 -1
  331. package/dist/loaders/index.d.cts +2 -95
  332. package/dist/loaders/index.d.mts +2 -95
  333. package/dist/loaders/index.d.ts +2 -95
  334. package/dist/loaders/index.js +10 -12
  335. package/dist/loaders/index.mjs +10 -12
  336. package/dist/loaders/runtime.cjs +283 -0
  337. package/dist/loaders/runtime.cjs.map +1 -0
  338. package/dist/loaders/runtime.d.cts +95 -0
  339. package/dist/loaders/runtime.d.mts +95 -0
  340. package/dist/loaders/runtime.d.ts +95 -0
  341. package/dist/loaders/runtime.js +16 -0
  342. package/dist/loaders/runtime.js.map +1 -0
  343. package/dist/migrations/judge-provider.md +6 -6
  344. package/dist/{model-slots.cjs → model-roles.cjs} +26 -7
  345. package/dist/model-roles.cjs.map +1 -0
  346. package/dist/model-roles.d.cts +26 -0
  347. package/dist/model-roles.d.mts +26 -0
  348. package/dist/model-roles.d.ts +26 -0
  349. package/dist/model-roles.js +14 -0
  350. package/dist/model-roles.js.map +1 -0
  351. package/dist/o11y/adapter-usage-projection.cjs +9 -8
  352. package/dist/o11y/adapter-usage-projection.cjs.map +1 -1
  353. package/dist/o11y/adapter-usage-projection.d.cts +23 -15
  354. package/dist/o11y/adapter-usage-projection.d.mts +23 -15
  355. package/dist/o11y/adapter-usage-projection.d.ts +23 -15
  356. package/dist/o11y/cache-read.cjs +14 -14
  357. package/dist/o11y/cache-read.cjs.map +1 -1
  358. package/dist/o11y/cache-read.d.cts +5 -5
  359. package/dist/o11y/cache-read.d.mts +5 -5
  360. package/dist/o11y/cache-read.d.ts +5 -5
  361. package/dist/o11y/derive.cjs.map +1 -1
  362. package/dist/o11y/derive.d.cts +2 -2
  363. package/dist/o11y/derive.d.mts +2 -2
  364. package/dist/o11y/derive.d.ts +2 -2
  365. package/dist/o11y/eval-usage.cjs +9 -9
  366. package/dist/o11y/eval-usage.cjs.map +1 -1
  367. package/dist/o11y/eval-usage.d.cts +7 -7
  368. package/dist/o11y/eval-usage.d.mts +7 -7
  369. package/dist/o11y/eval-usage.d.ts +7 -7
  370. package/dist/o11y/parsers/bub.cjs +57 -81
  371. package/dist/o11y/parsers/bub.cjs.map +1 -1
  372. package/dist/o11y/parsers/index.cjs.map +1 -1
  373. package/dist/o11y/parsers/index.d.cts +2 -0
  374. package/dist/o11y/parsers/index.d.mts +2 -0
  375. package/dist/o11y/parsers/index.d.ts +2 -0
  376. package/dist/o11y/parsers/opencode.cjs +129 -217
  377. package/dist/o11y/parsers/opencode.cjs.map +1 -1
  378. package/dist/o11y/parsers/opencode.d.cts +2 -5
  379. package/dist/o11y/parsers/opencode.d.mts +2 -5
  380. package/dist/o11y/parsers/opencode.d.ts +2 -5
  381. package/dist/o11y/types.cjs.map +1 -1
  382. package/dist/o11y/types.d.cts +1 -1
  383. package/dist/o11y/types.d.mts +1 -1
  384. package/dist/o11y/types.d.ts +1 -1
  385. package/dist/plugin/contracts.cjs +170 -120
  386. package/dist/plugin/contracts.cjs.map +1 -1
  387. package/dist/plugin/contracts.d.cts +102 -90
  388. package/dist/plugin/contracts.d.mts +102 -90
  389. package/dist/plugin/contracts.d.ts +102 -90
  390. package/dist/plugin/contracts.js +16 -12
  391. package/dist/plugin/index.cjs.map +1 -1
  392. package/dist/plugin/index.d.cts +1 -1
  393. package/dist/plugin/index.d.mts +1 -1
  394. package/dist/plugin/index.d.ts +1 -1
  395. package/dist/plugin/link.cjs +69 -64
  396. package/dist/plugin/link.cjs.map +1 -1
  397. package/dist/plugin/link.d.cts +5 -3
  398. package/dist/plugin/link.d.mts +5 -3
  399. package/dist/plugin/link.d.ts +5 -3
  400. package/dist/plugin/link.js +12 -8
  401. package/dist/record/codec/seal-manifest.d.cts +3 -3
  402. package/dist/record/codec/seal-manifest.d.mts +3 -3
  403. package/dist/record/codec/seal-manifest.d.ts +3 -3
  404. package/dist/record/family/attempt-note/definition.cjs +12 -0
  405. package/dist/record/family/attempt-note/definition.cjs.map +1 -0
  406. package/dist/record/family/attempt-note/definition.d.cts +6 -0
  407. package/dist/record/family/attempt-note/definition.d.mts +6 -0
  408. package/dist/record/family/attempt-note/definition.d.ts +6 -0
  409. package/dist/record/family/attempt-note/definition.js +6 -0
  410. package/dist/record/family/attempt-note/definition.js.map +1 -0
  411. package/dist/record/family/attempt-note/persistence.cjs +10 -0
  412. package/dist/record/family/attempt-note/persistence.cjs.map +1 -0
  413. package/dist/record/family/attempt-note/persistence.d.cts +6 -0
  414. package/dist/record/family/attempt-note/persistence.d.mts +6 -0
  415. package/dist/record/family/attempt-note/persistence.d.ts +6 -0
  416. package/dist/record/family/attempt-note/persistence.js +6 -0
  417. package/dist/record/family/attempt-note/persistence.js.map +1 -0
  418. package/dist/record/family/attempt-note/schema.cjs +20 -0
  419. package/dist/record/family/attempt-note/schema.cjs.map +1 -0
  420. package/dist/record/family/attempt-note/schema.d.cts +21 -0
  421. package/dist/record/family/attempt-note/schema.d.mts +21 -0
  422. package/dist/record/family/attempt-note/schema.d.ts +21 -0
  423. package/dist/record/family/attempt-note/schema.js +10 -0
  424. package/dist/record/family/attempt-note/schema.js.map +1 -0
  425. package/dist/record/family/catalog.cjs +32 -29
  426. package/dist/record/family/catalog.cjs.map +1 -1
  427. package/dist/record/family/catalog.d.cts +7 -2
  428. package/dist/record/family/catalog.d.mts +7 -2
  429. package/dist/record/family/catalog.d.ts +7 -2
  430. package/dist/record/family/current.cjs +48 -45
  431. package/dist/record/family/current.cjs.map +1 -1
  432. package/dist/record/family/current.d.cts +15 -0
  433. package/dist/record/family/current.d.mts +15 -0
  434. package/dist/record/family/current.d.ts +15 -0
  435. package/dist/record/model/index.js +66 -64
  436. package/dist/record/model/run-context.cjs +9 -3
  437. package/dist/record/model/run-context.cjs.map +1 -1
  438. package/dist/record/model/run-context.d.cts +9 -2
  439. package/dist/record/model/run-context.d.mts +9 -2
  440. package/dist/record/model/run-context.d.ts +9 -2
  441. package/dist/record/model/run-context.js +8 -6
  442. package/dist/record/model/seal-manifest.d.cts +1 -1
  443. package/dist/record/model/seal-manifest.d.mts +1 -1
  444. package/dist/record/model/seal-manifest.d.ts +1 -1
  445. package/dist/run/cli/contribution.cjs +6 -32
  446. package/dist/run/cli/contribution.cjs.map +1 -1
  447. package/dist/run/host/runtime.cjs +1 -1
  448. package/dist/run/host/runtime.cjs.map +1 -1
  449. package/dist/run/storage/sqlite.cjs +7 -7
  450. package/dist/run/storage/sqlite.cjs.map +1 -1
  451. package/dist/runner/adapter-usage.cjs +5 -3
  452. package/dist/runner/adapter-usage.cjs.map +1 -1
  453. package/dist/runner/adapter-usage.d.cts +2 -2
  454. package/dist/runner/adapter-usage.d.mts +2 -2
  455. package/dist/runner/adapter-usage.d.ts +2 -2
  456. package/dist/runner/adoption.cjs +10 -12
  457. package/dist/runner/adoption.cjs.map +1 -1
  458. package/dist/runner/attempt-notes.cjs +8 -0
  459. package/dist/runner/attempt-notes.cjs.map +1 -0
  460. package/dist/runner/attempt-notes.d.cts +4 -0
  461. package/dist/runner/attempt-notes.d.mts +4 -0
  462. package/dist/runner/attempt-notes.d.ts +4 -0
  463. package/dist/runner/attempt-notes.js +8 -0
  464. package/dist/runner/attempt-notes.js.map +1 -0
  465. package/dist/runner/attempt.cjs +61 -73
  466. package/dist/runner/attempt.cjs.map +1 -1
  467. package/dist/runner/attempt.d.cts +3 -3
  468. package/dist/runner/attempt.d.mts +3 -3
  469. package/dist/runner/attempt.d.ts +3 -3
  470. package/dist/runner/command-plan.cjs +21 -26
  471. package/dist/runner/command-plan.cjs.map +1 -1
  472. package/dist/runner/command-plan.d.cts +4 -4
  473. package/dist/runner/command-plan.d.mts +4 -4
  474. package/dist/runner/command-plan.d.ts +4 -4
  475. package/dist/runner/command-plan.js +4 -4
  476. package/dist/runner/config-identity.cjs.map +1 -1
  477. package/dist/runner/config-identity.d.cts +2 -2
  478. package/dist/runner/config-identity.d.mts +2 -2
  479. package/dist/runner/config-identity.d.ts +2 -2
  480. package/dist/runner/discover.cjs +6 -6
  481. package/dist/runner/discover.cjs.map +1 -1
  482. package/dist/runner/eval-selection.cjs +15 -1
  483. package/dist/runner/eval-selection.cjs.map +1 -1
  484. package/dist/runner/eval-selection.d.cts +4 -0
  485. package/dist/runner/eval-selection.d.mts +4 -0
  486. package/dist/runner/eval-selection.d.ts +4 -0
  487. package/dist/runner/feedback/human.cjs +1 -1
  488. package/dist/runner/feedback/human.cjs.map +1 -1
  489. package/dist/runner/feedback/json.cjs +4 -2
  490. package/dist/runner/feedback/json.cjs.map +1 -1
  491. package/dist/runner/feedback/json.d.cts +1 -1
  492. package/dist/runner/feedback/json.d.mts +1 -1
  493. package/dist/runner/feedback/json.d.ts +1 -1
  494. package/dist/runner/feedback/sink.cjs +1 -1
  495. package/dist/runner/feedback/sink.cjs.map +1 -1
  496. package/dist/runner/feedback/sink.d.cts +1 -1
  497. package/dist/runner/feedback/sink.d.mts +1 -1
  498. package/dist/runner/feedback/sink.d.ts +1 -1
  499. package/dist/runner/fingerprint.cjs +1 -1
  500. package/dist/runner/fingerprint.cjs.map +1 -1
  501. package/dist/runner/lock.cjs +1 -3
  502. package/dist/runner/lock.cjs.map +1 -1
  503. package/dist/runner/lock.d.cts +0 -2
  504. package/dist/runner/lock.d.mts +0 -2
  505. package/dist/runner/lock.d.ts +0 -2
  506. package/dist/runner/lock.js +14 -16
  507. package/dist/runner/project-target.cjs.map +1 -1
  508. package/dist/runner/project-target.d.cts +2 -2
  509. package/dist/runner/project-target.d.mts +2 -2
  510. package/dist/runner/project-target.d.ts +2 -2
  511. package/dist/runner/record/attachments.cjs +2 -2
  512. package/dist/runner/record/attachments.cjs.map +1 -1
  513. package/dist/runner/record/planning.cjs +8 -2
  514. package/dist/runner/record/planning.cjs.map +1 -1
  515. package/dist/runner/record.cjs +2 -0
  516. package/dist/runner/record.cjs.map +1 -1
  517. package/dist/runner/report.cjs +3 -3
  518. package/dist/runner/report.cjs.map +1 -1
  519. package/dist/runner/report.d.cts +1 -1
  520. package/dist/runner/report.d.mts +1 -1
  521. package/dist/runner/report.d.ts +1 -1
  522. package/dist/runner/reuse-plan.cjs +2 -2
  523. package/dist/runner/reuse-plan.cjs.map +1 -1
  524. package/dist/runner/run.cjs +10 -45
  525. package/dist/runner/run.cjs.map +1 -1
  526. package/dist/runner/sandbox-pool.cjs +1 -2
  527. package/dist/runner/sandbox-pool.cjs.map +1 -1
  528. package/dist/runner/setup-prefix-preparation.cjs +1 -1
  529. package/dist/runner/setup-prefix-preparation.cjs.map +1 -1
  530. package/dist/runner/teardown-registry.cjs +2 -2
  531. package/dist/runner/teardown-registry.cjs.map +1 -1
  532. package/dist/runner/teardown-registry.d.cts +1 -1
  533. package/dist/runner/teardown-registry.d.mts +1 -1
  534. package/dist/runner/teardown-registry.d.ts +1 -1
  535. package/dist/runner/types.cjs +4 -4
  536. package/dist/runner/types.cjs.map +1 -1
  537. package/dist/runner/types.d.cts +64 -92
  538. package/dist/runner/types.d.mts +64 -92
  539. package/dist/runner/types.d.ts +64 -92
  540. package/dist/runner/types.js +2 -2
  541. package/dist/sandbox/action.cjs +1 -1
  542. package/dist/sandbox/action.cjs.map +1 -1
  543. package/dist/sandbox/cli/contribution.cjs +17 -14
  544. package/dist/sandbox/cli/contribution.cjs.map +1 -1
  545. package/dist/sandbox/cli/contribution.d.cts +1 -1
  546. package/dist/sandbox/cli/contribution.d.mts +1 -1
  547. package/dist/sandbox/cli/contribution.d.ts +1 -1
  548. package/dist/sandbox/commands.cjs +1 -1
  549. package/dist/sandbox/commands.cjs.map +1 -1
  550. package/dist/sandbox/commands.d.cts +1 -1
  551. package/dist/sandbox/commands.d.mts +1 -1
  552. package/dist/sandbox/commands.d.ts +1 -1
  553. package/dist/sandbox/compose.cjs +2 -2
  554. package/dist/sandbox/compose.cjs.map +1 -1
  555. package/dist/sandbox/docker-profile/registry.cjs +5 -10
  556. package/dist/sandbox/docker-profile/registry.cjs.map +1 -1
  557. package/dist/sandbox/docker-profile/registry.d.cts +0 -4
  558. package/dist/sandbox/docker-profile/registry.d.mts +0 -4
  559. package/dist/sandbox/docker-profile/registry.d.ts +0 -4
  560. package/dist/sandbox/docker-profile/registry.js +6 -14
  561. package/dist/sandbox/docker-profile/runtime.cjs +1 -1
  562. package/dist/sandbox/docker-profile/runtime.cjs.map +1 -1
  563. package/dist/sandbox/docker-profile/schema.cjs +12 -16
  564. package/dist/sandbox/docker-profile/schema.cjs.map +1 -1
  565. package/dist/sandbox/docker-profile/schema.d.cts +2 -6
  566. package/dist/sandbox/docker-profile/schema.d.mts +2 -6
  567. package/dist/sandbox/docker-profile/schema.d.ts +2 -6
  568. package/dist/sandbox/docker-profile/schema.js +24 -32
  569. package/dist/sandbox/incus.cjs +2 -2
  570. package/dist/sandbox/incus.cjs.map +1 -1
  571. package/dist/sandbox/index.cjs +4 -36
  572. package/dist/sandbox/index.cjs.map +1 -1
  573. package/dist/sandbox/index.d.cts +4 -8
  574. package/dist/sandbox/index.d.mts +4 -8
  575. package/dist/sandbox/index.d.ts +4 -8
  576. package/dist/sandbox/index.js +116 -174
  577. package/dist/sandbox/index.mjs +116 -174
  578. package/dist/sandbox/layer.cjs +3 -3
  579. package/dist/sandbox/layer.cjs.map +1 -1
  580. package/dist/sandbox/link.cjs +5 -0
  581. package/dist/sandbox/link.cjs.map +1 -1
  582. package/dist/sandbox/link.d.cts +3 -0
  583. package/dist/sandbox/link.d.mts +3 -0
  584. package/dist/sandbox/link.d.ts +3 -0
  585. package/dist/sandbox/runtime.cjs +9 -4
  586. package/dist/sandbox/runtime.cjs.map +1 -1
  587. package/dist/shared/failure-class.cjs +5 -5
  588. package/dist/shared/failure-class.cjs.map +1 -1
  589. package/dist/shared/failure-class.d.cts +4 -10
  590. package/dist/shared/failure-class.d.mts +4 -10
  591. package/dist/shared/failure-class.d.ts +4 -10
  592. package/dist/shared/types.cjs.map +1 -1
  593. package/dist/shared/types.d.cts +1 -1
  594. package/dist/shared/types.d.mts +1 -1
  595. package/dist/shared/types.d.ts +1 -1
  596. package/dist/show/contribution.cjs +17 -2
  597. package/dist/show/contribution.cjs.map +1 -1
  598. package/dist/show/contribution.d.cts +14 -0
  599. package/dist/show/contribution.d.mts +14 -0
  600. package/dist/show/contribution.d.ts +14 -0
  601. package/dist/show/model.cjs +8 -5
  602. package/dist/show/model.cjs.map +1 -1
  603. package/dist/show/model.d.cts +11 -8
  604. package/dist/show/model.d.mts +11 -8
  605. package/dist/show/model.d.ts +11 -8
  606. package/dist/show/render.cjs +34 -22
  607. package/dist/show/render.cjs.map +1 -1
  608. package/dist/sources/projector.cjs +1 -1
  609. package/dist/sources/projector.cjs.map +1 -1
  610. package/dist/types.cjs +1 -1
  611. package/dist/types.cjs.map +1 -1
  612. package/dist/types.d.cts +1 -1
  613. package/dist/types.d.mts +1 -1
  614. package/dist/types.d.ts +1 -1
  615. package/dist/types.js +2 -2
  616. package/dist/view/app-dist/.vite/manifest.json +2 -2
  617. package/dist/view/app-dist/assets/{index-B3ijZRph.js → index-CxrOUvHC.js} +17 -17
  618. package/dist/view/app-dist/assets/{quality-cost-scatter-B--DfJ9s.js → quality-cost-scatter-B6Aiss7x.js} +1 -1
  619. package/dist/view/app-dist/index.html +1 -1
  620. package/dist/view/cli/contribution.cjs +1 -1
  621. package/dist/view/cli/contribution.cjs.map +1 -1
  622. package/dist/view/function-runtime.mjs +318 -121
  623. package/dist/view/http-protocol.d.cts +1 -1
  624. package/dist/view/http-protocol.d.mts +1 -1
  625. package/dist/view/http-protocol.d.ts +1 -1
  626. package/dist/view/inspection-host.cjs +2 -2
  627. package/dist/view/inspection-host.cjs.map +1 -1
  628. package/dist/view/inspection-host.d.cts +349 -331
  629. package/dist/view/inspection-host.d.mts +349 -331
  630. package/dist/view/inspection-host.d.ts +349 -331
  631. package/docs-site/zh/examples/integrations/ai-sdk-v7.mdx +9 -9
  632. package/docs-site/zh/examples/integrations/claude-sdk.mdx +8 -8
  633. package/docs-site/zh/examples/integrations/codex-sdk.mdx +4 -4
  634. package/docs-site/zh/examples/integrations/langgraph.mdx +6 -6
  635. package/docs-site/zh/examples/integrations/pi-sdk.mdx +8 -8
  636. package/docs-site/zh/explanation/adapter.mdx +6 -6
  637. package/docs-site/zh/explanation/assert.mdx +7 -7
  638. package/docs-site/zh/explanation/drive.mdx +4 -4
  639. package/docs-site/zh/explanation/hitl.mdx +2 -2
  640. package/docs-site/zh/explanation/judge.mdx +3 -3
  641. package/docs-site/zh/index.mdx +18 -0
  642. package/docs-site/zh/introduction.mdx +4 -3
  643. package/docs-site/zh/reference/builtin-agents.mdx +46 -49
  644. package/docs-site/zh/reference/cli.mdx +16 -14
  645. package/docs-site/zh/reference/define-agent.mdx +19 -19
  646. package/docs-site/zh/reference/define-config.mdx +7 -15
  647. package/docs-site/zh/reference/define-eval.mdx +20 -14
  648. package/docs-site/zh/reference/define-experiment.mdx +18 -39
  649. package/docs-site/zh/reference/events.mdx +1 -1
  650. package/docs-site/zh/reference/expect.mdx +21 -0
  651. package/docs-site/zh/reference/official-adapters.mdx +12 -5
  652. package/docs-site/zh/troubleshooting/debugging.mdx +2 -2
  653. package/docs-site/zh/troubleshooting/recover-after-kill.mdx +1 -1
  654. package/docs-site/zh/tutorials/agent-onboarding.mdx +2 -2
  655. package/docs-site/zh/tutorials/authoring.mdx +4 -3
  656. package/docs-site/zh/tutorials/compare-runs.mdx +1 -1
  657. package/docs-site/zh/tutorials/concurrency.mdx +8 -8
  658. package/docs-site/zh/tutorials/configuration.mdx +5 -5
  659. package/docs-site/zh/tutorials/control-run-cost.mdx +49 -9
  660. package/docs-site/zh/tutorials/eval-groups.mdx +1 -1
  661. package/docs-site/zh/tutorials/evaluation-kinds.mdx +5 -5
  662. package/docs-site/zh/tutorials/experiment-services.mdx +32 -32
  663. package/docs-site/zh/tutorials/handle-execution-failures.mdx +2 -28
  664. package/docs-site/zh/tutorials/plugins.mdx +49 -143
  665. package/docs-site/zh/tutorials/sandbox-agent.mdx +1 -1
  666. package/docs-site/zh/tutorials/sandbox-reuse.mdx +7 -7
  667. package/docs-site/zh/tutorials/upgrade-0-18.mdx +64 -0
  668. package/docs-site/zh/tutorials/upgrade-0-19.mdx +121 -0
  669. package/docs-site/zh/tutorials/upgrade-0-20.mdx +12 -0
  670. package/docs-site/zh/tutorials/verify-judge.mdx +4 -3
  671. package/docs-site/zh/tutorials/viewing-results.mdx +2 -2
  672. package/docs-site/zh/tutorials/write-experiment.mdx +1 -1
  673. package/docs-site/zh/tutorials/write-send.mdx +13 -13
  674. package/package.json +1 -1
  675. package/dist/agents/effect-runtime.cjs.map +0 -1
  676. package/dist/agents/effect-runtime.d.cts +0 -29
  677. package/dist/agents/effect-runtime.d.mts +0 -29
  678. package/dist/agents/effect-runtime.d.ts +0 -29
  679. package/dist/agents/effect-runtime.js +0 -16
  680. package/dist/agents/effect-runtime.js.map +0 -1
  681. package/dist/agents/session-slot.cjs.map +0 -1
  682. package/dist/agents/session-slot.d.cts +0 -12
  683. package/dist/agents/session-slot.d.mts +0 -12
  684. package/dist/agents/session-slot.d.ts +0 -12
  685. package/dist/agents/session-slot.js +0 -6
  686. package/dist/agents/session-slot.js.map +0 -1
  687. package/dist/model-slots.cjs.map +0 -1
  688. package/dist/model-slots.d.cts +0 -19
  689. package/dist/model-slots.d.mts +0 -19
  690. package/dist/model-slots.d.ts +0 -19
  691. package/dist/model-slots.js +0 -8
  692. package/dist/model-slots.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"link.js","sourceRoot":"","sources":["link.ts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AC,CAAC;IACrP,CAAC;AACL,CAAC;AACD,SAAgB,wBAAwB,CAAC,GAAa;IAClD,IAAI,GAAG,CAAC,cAAc,KAAK,SAAS;QAChC,OAAO,GAAG,CAAC,cAAc,CAAC;IAC9B,MAAM,KAAK,GAAgB,EAAE,CAAC;IAC9B,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,KAAK,CAAC;AACjB,CAAC","sourcesContent":["// @concord-file ne-surface-plugin-link\n// @concord-implements docs/feature/plugins/lifecycle.md\n// @concord-implements docs/feature/plugins/use-case/terminal-bench-harness.md\nimport { Data } from \"effect\";\nimport { relative, sep } from \"node:path\";\nimport type { AgentRun, DiscoveredEval, ExperimentHookContext } from \"../runner/types.ts\";\nimport type { JsonValue } from \"../shared/types.ts\";\nimport { appendCommandOnlySandboxLayer, type SandboxLayer, } from \"../sandbox/layer.ts\";\nimport { sandboxLayerDefinitionIdentity } from \"../sandbox/link.ts\";\nimport { linkPluginLifecycles, pluginLifecycleIdentity, pluginLifecycleProjection, type LinkedPluginLifecycle, type PluginInstance, type PluginOwner, } from \"./contracts.ts\";\nexport type PluginLinkIssueCode = \"plugin-instance-invalid\" | \"plugin-owner-unsupported\" | \"plugin-pair-instance-conflict\";\nexport interface PluginOccurrenceProvenance {\n readonly attachment: PluginOwner;\n readonly owner: {\n readonly id: string;\n readonly source: string;\n readonly position: number;\n };\n}\nexport interface LinkedPluginOccurrence {\n readonly name: string;\n readonly instanceKey: string;\n readonly behaviorRevision: string;\n readonly provenance: PluginOccurrenceProvenance;\n readonly projection: JsonValue;\n readonly audit: JsonValue;\n}\n/** Kept empty during the resource-envelope removal so runner planning stays source-compatible. */\nexport interface LinkedPluginResourceDemand {\n readonly _removed?: never;\n}\nexport interface PluginPairLink {\n readonly evalLayer?: SandboxLayer;\n readonly groupLayer?: SandboxLayer;\n readonly experimentLayer?: SandboxLayer;\n readonly occurrences: readonly LinkedPluginOccurrence[];\n readonly resources: readonly LinkedPluginResourceDemand[];\n readonly experimentLifecycles: readonly LinkedPluginLifecycle[];\n readonly groupLifecycles: readonly LinkedPluginLifecycle[];\n readonly evalLifecycles: readonly LinkedPluginLifecycle[];\n readonly sandboxLifecycles: Readonly<{\n readonly experiment: readonly LinkedPluginLifecycle[];\n readonly group: readonly LinkedPluginLifecycle[];\n readonly eval: readonly LinkedPluginLifecycle[];\n }>;\n readonly pairProjection: JsonValue;\n}\nexport interface PreparedPluginRun {\n readonly sourceRun: AgentRun;\n readonly run: AgentRun;\n readonly experimentOccurrences: readonly LinkedPluginOccurrence[];\n readonly experimentLifecycles: readonly LinkedPluginLifecycle[];\n}\nexport interface PluginLinkIssue {\n readonly code: PluginLinkIssueCode;\n readonly experimentId: string;\n readonly evalId?: string;\n readonly message: string;\n readonly actions: readonly string[];\n}\nexport class PluginLinkError extends Data.TaggedError(\"PluginLinkError\")<{\n readonly code: \"plugin.link-failed\";\n readonly issues: readonly PluginLinkIssue[];\n readonly message: string;\n}> {\n}\nfunction pluginError(issues: readonly PluginLinkIssue[]): PluginLinkError {\n const frozen = Object.freeze(issues.map((issue) => Object.freeze({ ...issue, actions: Object.freeze([...issue.actions]) })));\n return new PluginLinkError({\n code: \"plugin.link-failed\",\n issues: frozen,\n message: `Plugin link failed for ${frozen.length} occurrences. No Sandbox was created.`,\n });\n}\nexport function pluginLinkErrorFromIssues(issues: readonly PluginLinkIssue[]): PluginLinkError {\n return pluginError(issues);\n}\nfunction sourceLabel(path: string): string {\n return relative(process.cwd(), path).split(sep).join(\"/\") || \".\";\n}\nfunction sandboxDeclaration(lifecycle: LinkedPluginLifecycle): JsonValue | undefined {\n return lifecycle.sandboxLayer === undefined\n ? undefined\n : Object.freeze({\n present: true,\n declaration: sandboxLayerDefinitionIdentity(lifecycle.sandboxLayer),\n });\n}\nfunction pluginLifecycleAttachmentIdentity(lifecycle: LinkedPluginLifecycle): JsonValue {\n const sandbox = sandboxDeclaration(lifecycle);\n if (sandbox === undefined)\n return pluginLifecycleIdentity(lifecycle);\n return Object.freeze({\n scope: lifecycle.scope,\n name: lifecycle.name,\n behaviorRevision: lifecycle.behaviorRevision,\n instanceKey: lifecycle.instanceKey,\n identity: lifecycle.identity,\n arrayPosition: lifecycle.arrayPosition,\n hasSetup: lifecycle.hasSetup,\n hasTeardown: lifecycle.hasTeardown,\n sandbox,\n });\n}\nfunction pluginOccurrenceProjection(lifecycle: LinkedPluginLifecycle): JsonValue {\n const sandbox = sandboxDeclaration(lifecycle);\n return Object.freeze({\n // Keep the established occurrence field order for attachments without a\n // sandbox fragment; some persisted projections are byte-sensitive.\n scope: lifecycle.scope,\n name: lifecycle.name,\n instanceKey: lifecycle.instanceKey,\n behaviorRevision: lifecycle.behaviorRevision,\n identity: lifecycle.identity,\n arrayPosition: lifecycle.arrayPosition,\n hasSetup: lifecycle.hasSetup,\n hasTeardown: lifecycle.hasTeardown,\n ...(sandbox === undefined ? {} : { sandbox }),\n });\n}\nfunction pluginAttachmentProjection(lifecycles: readonly LinkedPluginLifecycle[]): JsonValue {\n if (lifecycles.every((lifecycle) => lifecycle.sandboxLayer === undefined)) {\n return pluginLifecycleProjection(lifecycles);\n }\n const projection: JsonValue[] = lifecycles.map(pluginLifecycleAttachmentIdentity);\n Object.freeze(projection);\n return projection;\n}\nfunction occurrences(lifecycles: readonly LinkedPluginLifecycle[], scope: PluginOwner, ownerId: string, sourcePath: string): readonly LinkedPluginOccurrence[] {\n return Object.freeze(lifecycles.map((lifecycle) => {\n const provenance = Object.freeze({\n attachment: scope,\n owner: Object.freeze({ id: ownerId, source: sourceLabel(sourcePath), position: lifecycle.arrayPosition }),\n });\n const projection = pluginOccurrenceProjection(lifecycle);\n const sandbox = sandboxDeclaration(lifecycle);\n const contributions = [\n ...(lifecycle.hostDeclared ? [\"lifecycle\"] : []),\n ...(sandbox === undefined ? [] : [\"sandbox\"]),\n ];\n return Object.freeze({\n name: lifecycle.name,\n instanceKey: lifecycle.instanceKey,\n behaviorRevision: lifecycle.behaviorRevision,\n provenance,\n projection,\n audit: Object.freeze({\n scope,\n name: lifecycle.name,\n instanceKey: lifecycle.instanceKey,\n behaviorRevision: lifecycle.behaviorRevision,\n identity: lifecycle.identity,\n arrayPosition: lifecycle.arrayPosition,\n hasSetup: lifecycle.hasSetup,\n hasTeardown: lifecycle.hasTeardown,\n ...(sandbox === undefined ? {} : { sandbox }),\n ownerSource: provenance.owner,\n contributions,\n }) as JsonValue,\n });\n }));\n}\nfunction appendPluginSandboxLayers(base: SandboxLayer | undefined, lifecycles: readonly LinkedPluginLifecycle[]): SandboxLayer | undefined {\n let layer = base;\n for (const lifecycle of lifecycles) {\n if (lifecycle.sandboxLayer === undefined)\n continue;\n layer = layer === undefined\n ? appendCommandOnlySandboxLayer(undefined, lifecycle.sandboxLayer)\n : appendCommandOnlySandboxLayer(layer, lifecycle.sandboxLayer);\n }\n return layer;\n}\nasync function runTeardowns(lifecycles: readonly LinkedPluginLifecycle[], activated: number, context: ExperimentHookContext): Promise<void> {\n const failures: unknown[] = [];\n for (const lifecycle of lifecycles.slice(0, activated).reverse()) {\n if (lifecycle.teardown === undefined)\n continue;\n try {\n await (lifecycle.teardown as (ctx: ExperimentHookContext) => void | Promise<void>)(context);\n }\n catch (error) {\n failures.push(error);\n }\n }\n if (failures.length === 1)\n throw failures[0];\n if (failures.length > 1)\n throw new AggregateError(failures, \"Experiment Plugin teardown failed.\");\n}\n// @concord-code ne-surface-prepare-plugin-run\n// @concord-implements docs/feature/plugins/lifecycle.md\nexport function preparePluginRun(run: AgentRun): PreparedPluginRun {\n let lifecycles: readonly LinkedPluginLifecycle[];\n try {\n lifecycles = linkPluginLifecycles(run.plugins as readonly PluginInstance<\"experiment\">[], \"experiment\");\n if (run.adapter.kind === \"custom\" && lifecycles.length > 0) {\n throw new TypeError(\"Custom Adapter runs do not yet support Experiment lifecycle plugins.\");\n }\n }\n catch (error) {\n throw pluginError([{ code: \"plugin-owner-unsupported\", experimentId: run.experimentId, message: String(error), actions: [\"Attach each plugin only to a scope it declares.\"] }]);\n }\n const linkedOccurrences = occurrences(lifecycles, \"experiment\", run.experimentId, run.experimentSourcePath);\n const authorSetup = run.setup;\n const authorTeardown = run.teardown;\n let activated = 0;\n const setup = authorSetup === undefined && lifecycles.every((entry) => entry.setup === undefined)\n ? undefined\n : async (context: ExperimentHookContext): Promise<void> => {\n if (authorSetup !== undefined)\n await authorSetup(context);\n for (const lifecycle of lifecycles) {\n activated += 1;\n if (lifecycle.setup !== undefined)\n await (lifecycle.setup as (ctx: ExperimentHookContext) => void | Promise<void>)(context);\n }\n };\n const teardown = authorTeardown === undefined && lifecycles.every((entry) => entry.teardown === undefined)\n ? undefined\n : async (context: ExperimentHookContext): Promise<void> => {\n let pluginFailure: unknown;\n try {\n await runTeardowns(lifecycles, activated, context);\n }\n catch (error) {\n pluginFailure = error;\n }\n try {\n if (authorTeardown !== undefined)\n await authorTeardown(context);\n }\n catch (error) {\n if (pluginFailure === undefined)\n throw error;\n throw new AggregateError([pluginFailure, error], \"Experiment teardown failed.\");\n }\n if (pluginFailure !== undefined)\n throw pluginFailure;\n };\n const pluginBehavior = Object.freeze({ version: 1, lifecycles: pluginAttachmentProjection(lifecycles) }) as JsonValue;\n const effective = Object.freeze({ ...run, ...(setup === undefined ? {} : { setup }), ...(teardown === undefined ? {} : { teardown }), pluginBehavior }) as AgentRun;\n return Object.freeze({ sourceRun: run, run: effective, experimentOccurrences: linkedOccurrences, experimentLifecycles: lifecycles });\n}\n// @concord-code ne-surface-link-plugin-pair\n// @concord-implements docs/feature/plugins/lifecycle.md\nexport function linkPluginPair(evalDef: DiscoveredEval, preparedRun: PreparedPluginRun): PluginPairLink {\n try {\n const evalLifecycles = linkPluginLifecycles(evalDef.plugins as readonly PluginInstance<\"eval\">[], \"eval\");\n const groupLifecycles = evalDef.evalGroup === undefined\n ? Object.freeze([]) as readonly LinkedPluginLifecycle[]\n : linkPluginLifecycles(evalDef.evalGroup.plugins ?? [], \"group\");\n const allLifecycles = [...preparedRun.experimentLifecycles, ...groupLifecycles, ...evalLifecycles];\n if (preparedRun.run.adapter.kind === \"custom\" && allLifecycles.length > 0) {\n throw new TypeError(\"Custom Adapter runs do not yet support Experiment, Group, or Eval lifecycle plugins.\");\n }\n if (preparedRun.run.adapter.kind !== \"sandbox\" && allLifecycles.some((entry) => entry.sandboxLayer !== undefined)) {\n throw new TypeError(\"Plugin sandbox layer requires a Sandbox Agent and a physical Sandbox plan.\");\n }\n const evalOccurrences = occurrences(evalLifecycles, \"eval\", evalDef.id, evalDef.sourcePath);\n const groupOccurrences = evalDef.evalGroup === undefined\n ? Object.freeze([]) as readonly LinkedPluginOccurrence[]\n : occurrences(groupLifecycles, \"group\", evalDef.evalGroup.id, evalDef.evalGroup.sourcePath);\n const all = Object.freeze([...preparedRun.experimentOccurrences, ...groupOccurrences, ...evalOccurrences]);\n const experimentLayer = appendPluginSandboxLayers(preparedRun.run.sandbox, preparedRun.experimentLifecycles);\n const groupLayer = evalDef.evalGroup === undefined\n ? undefined\n : appendPluginSandboxLayers(evalDef.evalGroup.sandbox, groupLifecycles);\n const evalLayer = appendPluginSandboxLayers(evalDef.sandbox, evalLifecycles);\n const noSandboxLifecycles = Object.freeze({\n experiment: Object.freeze([]),\n group: Object.freeze([]),\n eval: Object.freeze([]),\n });\n return Object.freeze({\n ...(evalLayer === undefined ? {} : { evalLayer }),\n ...(groupLayer === undefined ? {} : { groupLayer }),\n ...(experimentLayer === undefined ? {} : { experimentLayer }),\n occurrences: all,\n resources: Object.freeze([]),\n experimentLifecycles: preparedRun.experimentLifecycles,\n groupLifecycles,\n evalLifecycles,\n // The runner field remains source-compatible while the old sandbox\n // lifecycle data path is retired. Plugin layers are already composed\n // into their actual owner layer above.\n sandboxLifecycles: noSandboxLifecycles,\n pairProjection: Object.freeze({\n version: 1,\n occurrences: all.map((entry) => entry.projection),\n }) as JsonValue,\n });\n }\n catch (error) {\n throw pluginError([{ code: \"plugin-owner-unsupported\", experimentId: preparedRun.run.experimentId, evalId: evalDef.id, message: String(error), actions: [\"Attach each plugin only to a scope it declares, without duplicates in one scope.\"] }]);\n }\n}\nexport function pluginBehaviorProjection(run: AgentRun): JsonValue {\n if (run.pluginBehavior !== undefined)\n return run.pluginBehavior;\n const empty: JsonValue[] = [];\n Object.freeze(empty);\n return empty;\n}\n"]}
1
+ {"version":3,"file":"link.js","sourceRoot":"","sources":["link.ts"],"names":[],"mappings":";;;AA0EA,8DAEC;AA8ED,4CAiEC;AAGD,wCAgEC;AACD,4DAMC;AAED,sDAKC;AACD,0DAIC;AAjTD,gBAAgB;AAChB,wDAAwD;AACxD,8EAA8E;AAC9E,mCAA8B;AAC9B,yEAAmE;AACnE,yCAA0C;AAG1C,kDAAwF;AACxF,gDAAoE;AACpE,iDAAoM;AAkDpM,MAAa,eAAgB,SAAQ,aAAI,CAAC,WAAW,CAAC,iBAAiB,CAIrE;CACD;AALD,0CAKC;AACD,SAAS,WAAW,CAAC,MAAkC;IACnD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7H,OAAO,IAAI,eAAe,CAAC;QACvB,IAAI,EAAE,oBAAoB;QAC1B,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,0BAA0B,MAAM,CAAC,MAAM,uCAAuC;KAC1F,CAAC,CAAC;AACP,CAAC;AACD,SAAgB,yBAAyB,CAAC,MAAkC;IACxE,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AACD,SAAS,WAAW,CAAC,IAAY;IAC7B,OAAO,IAAA,oBAAQ,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,eAAG,CAAC,CAAC,IAAI,CAAC,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concord-implements docs/feature/plugins/use-case/terminal-bench-harness.md\nimport { Data } from \"effect\";\nimport { extendCodingAgent } from \"../agents/plugin-extensions.ts\";\nimport { relative, sep } from \"node:path\";\nimport type { AgentRun, DiscoveredEval, ExperimentHookContext } from \"../runner/types.ts\";\nimport type { JsonValue } from \"../shared/types.ts\";\nimport { appendCommandOnlySandboxLayer, type SandboxLayer, } from \"../sandbox/layer.ts\";\nimport { sandboxLayerDefinitionIdentity } from \"../sandbox/link.ts\";\nimport { linkPluginLifecycles, pluginInstanceDataOf, pluginLifecycleIdentity, pluginLifecycleProjection, type LinkedPluginLifecycle, type PluginInstance, type PluginOwner, } from \"./contracts.ts\";\nexport type PluginLinkIssueCode = \"plugin-instance-invalid\" | \"plugin-owner-unsupported\" | \"plugin-pair-instance-conflict\" | \"plugin-requires-eval-group\";\nexport interface PluginOccurrenceProvenance {\n readonly attachment: PluginOwner;\n readonly owner: {\n readonly id: string;\n readonly source: string;\n readonly position: number;\n };\n}\nexport interface LinkedPluginOccurrence {\n readonly name: string;\n readonly key: string;\n readonly provenance: PluginOccurrenceProvenance;\n readonly projection: JsonValue;\n readonly audit: JsonValue;\n}\n/** Kept empty during the resource-envelope removal so runner planning stays source-compatible. */\nexport interface LinkedPluginResourceDemand {\n readonly _removed?: never;\n}\nexport interface PluginPairLink {\n readonly evalLayer?: SandboxLayer;\n readonly groupLayer?: SandboxLayer;\n readonly experimentLayer?: SandboxLayer;\n readonly occurrences: readonly LinkedPluginOccurrence[];\n readonly resources: readonly LinkedPluginResourceDemand[];\n readonly experimentLifecycles: readonly LinkedPluginLifecycle[];\n readonly groupLifecycles: readonly LinkedPluginLifecycle[];\n readonly evalLifecycles: readonly LinkedPluginLifecycle[];\n readonly sandboxLifecycles: Readonly<{\n readonly experiment: readonly LinkedPluginLifecycle[];\n readonly group: readonly LinkedPluginLifecycle[];\n readonly eval: readonly LinkedPluginLifecycle[];\n }>;\n readonly pairProjection: JsonValue;\n}\nexport interface PreparedPluginRun {\n readonly sourceRun: AgentRun;\n readonly run: AgentRun;\n readonly experimentOccurrences: readonly LinkedPluginOccurrence[];\n readonly experimentLifecycles: readonly LinkedPluginLifecycle[];\n}\nexport interface PluginLinkIssue {\n readonly code: PluginLinkIssueCode;\n readonly experimentId: string;\n readonly evalId?: string;\n readonly message: string;\n readonly actions: readonly string[];\n}\nexport class PluginLinkError extends Data.TaggedError(\"PluginLinkError\")<{\n readonly code: \"plugin.link-failed\";\n readonly issues: readonly PluginLinkIssue[];\n readonly message: string;\n}> {\n}\nfunction pluginError(issues: readonly PluginLinkIssue[]): PluginLinkError {\n const frozen = Object.freeze(issues.map((issue) => Object.freeze({ ...issue, actions: Object.freeze([...issue.actions]) })));\n return new PluginLinkError({\n code: \"plugin.link-failed\",\n issues: frozen,\n message: `Plugin link failed for ${frozen.length} occurrences. No Sandbox was created.`,\n });\n}\nexport function pluginLinkErrorFromIssues(issues: readonly PluginLinkIssue[]): PluginLinkError {\n return pluginError(issues);\n}\nfunction sourceLabel(path: string): string {\n return relative(process.cwd(), path).split(sep).join(\"/\") || \".\";\n}\nfunction sandboxDeclaration(lifecycle: LinkedPluginLifecycle): JsonValue | undefined {\n return lifecycle.sandboxLayer === undefined\n ? undefined\n : Object.freeze({\n present: true,\n declaration: sandboxLayerDefinitionIdentity(lifecycle.sandboxLayer),\n });\n}\nfunction pluginLifecycleAttachmentIdentity(lifecycle: LinkedPluginLifecycle): JsonValue {\n return { ...pluginLifecycleIdentity(lifecycle) as object, ...(sandboxDeclaration(lifecycle) === undefined ? {} : { sandbox: sandboxDeclaration(lifecycle)! }) } as JsonValue;\n}\nfunction pluginOccurrenceProjection(lifecycle: LinkedPluginLifecycle): JsonValue { return pluginLifecycleAttachmentIdentity(lifecycle); }\nfunction pluginAttachmentProjection(lifecycles: readonly LinkedPluginLifecycle[]): JsonValue {\n return lifecycles.map(pluginLifecycleAttachmentIdentity);\n}\nfunction occurrences(lifecycles: readonly LinkedPluginLifecycle[], scope: PluginOwner, ownerId: string, sourcePath: string): readonly LinkedPluginOccurrence[] {\n return Object.freeze(lifecycles.map((lifecycle) => {\n const provenance = Object.freeze({\n attachment: scope,\n owner: Object.freeze({ id: ownerId, source: sourceLabel(sourcePath), position: lifecycle.arrayPosition }),\n });\n const projection = pluginOccurrenceProjection(lifecycle);\n const sandbox = sandboxDeclaration(lifecycle);\n const contributions = [\n ...(lifecycle.hostDeclared ? [\"lifecycle\"] : []),\n ...(sandbox === undefined ? [] : [\"sandbox\"]),\n ];\n return Object.freeze({\n name: lifecycle.name,\n key: lifecycle.key,\n provenance,\n projection,\n audit: Object.freeze({\n scope,\n name: lifecycle.name,\n key: lifecycle.key,\n identity: lifecycle.identity,\n requires: lifecycle.requires,\n shape: lifecycle.shape,\n arrayPosition: lifecycle.arrayPosition,\n hasSetup: lifecycle.hasSetup,\n hasTeardown: lifecycle.hasTeardown,\n ...(sandbox === undefined ? {} : { sandbox }),\n ownerSource: provenance.owner,\n contributions,\n }) as JsonValue,\n });\n }));\n}\nfunction appendPluginSandboxLayers(base: SandboxLayer | undefined, lifecycles: readonly LinkedPluginLifecycle[]): SandboxLayer | undefined {\n let layer = base;\n for (const lifecycle of lifecycles) {\n if (lifecycle.sandboxLayer === undefined)\n continue;\n layer = layer === undefined\n ? appendCommandOnlySandboxLayer(undefined, lifecycle.sandboxLayer)\n : appendCommandOnlySandboxLayer(layer, lifecycle.sandboxLayer);\n }\n return layer;\n}\nasync function runTeardowns(lifecycles: readonly LinkedPluginLifecycle[], activated: number, context: ExperimentHookContext): Promise<void> {\n for (const lifecycle of lifecycles.slice(0, activated).reverse()) {\n if (lifecycle.teardown === undefined)\n continue;\n try {\n await (lifecycle.teardown as (ctx: ExperimentHookContext) => void | Promise<void>)(context);\n }\n catch (error) {\n context.diagnostic({ code: \"plugin-after-failed\", level: \"warning\", message: String(error) });\n }\n }\n}\n// @concord-code\n// @concord-implements docs/feature/plugins/lifecycle.md\nexport function preparePluginRun(run: AgentRun): PreparedPluginRun {\n let lifecycles: readonly LinkedPluginLifecycle[];\n try {\n lifecycles = linkPluginLifecycles(run.plugins ?? [], \"experiment\");\n }\n catch (error) {\n throw pluginError([{ code: \"plugin-owner-unsupported\", experimentId: run.experimentId, message: String(error), actions: [\"Attach each plugin only to a scope it declares.\"] }]);\n }\n const contributions = (run.plugins ?? []).flatMap((plugin, position) => {\n const data = pluginInstanceDataOf(plugin);\n return data.agent === undefined ? [] : [{ extension: data.agent, source: `${run.experimentSourcePath}:plugins[${position}] ${data.name} (${data.key})` }];\n });\n let adapter = run.adapter;\n if (contributions.length > 0) {\n if (adapter.kind === \"custom\")\n throw pluginError([{ code: \"plugin-owner-unsupported\", experimentId: run.experimentId,\n message: \"Custom Adapters do not support Plugin agent extensions.\", actions: [\"Use a built-in coding Agent for agent extensions.\"] }]);\n try {\n adapter = extendCodingAgent(adapter, contributions);\n }\n catch (error) {\n throw pluginError([{ code: \"plugin-owner-unsupported\", experimentId: run.experimentId,\n message: String(error), actions: [\"Resolve Agent extension conflicts at the reported declarations.\"] }]);\n }\n }\n const linkedOccurrences = occurrences(lifecycles, \"experiment\", run.experimentId, run.experimentSourcePath);\n const authorSetup = run.setup;\n const authorTeardown = run.teardown;\n let activated = 0;\n const setup = authorSetup === undefined && lifecycles.every((entry) => !entry.hostDeclared)\n ? undefined\n : async (context: ExperimentHookContext): Promise<void> => {\n if (authorSetup !== undefined)\n await authorSetup(context);\n for (const lifecycle of lifecycles) {\n activated += 1;\n if (lifecycle.setup !== undefined)\n await (lifecycle.setup as (ctx: ExperimentHookContext) => void | Promise<void>)(context);\n }\n };\n const teardown = authorTeardown === undefined && lifecycles.every((entry) => entry.teardown === undefined)\n ? undefined\n : async (context: ExperimentHookContext): Promise<void> => {\n let pluginFailure: unknown;\n try {\n await runTeardowns(lifecycles, activated, context);\n }\n catch (error) {\n pluginFailure = error;\n }\n try {\n if (authorTeardown !== undefined)\n await authorTeardown(context);\n }\n catch (error) {\n if (pluginFailure === undefined)\n throw error;\n throw new AggregateError([pluginFailure, error], \"Experiment teardown failed.\");\n }\n if (pluginFailure !== undefined)\n throw pluginFailure;\n };\n const pluginBehavior = Object.freeze({ version: 1, lifecycles: pluginAttachmentProjection(lifecycles) }) as JsonValue;\n const effective = Object.freeze({ ...run, adapter, ...(adapter.kind === \"custom\" ? {} : { agent: adapter }), ...(setup === undefined ? {} : { setup }), ...(teardown === undefined ? {} : { teardown }), pluginBehavior }) as AgentRun;\n return Object.freeze({ sourceRun: run, run: effective, experimentOccurrences: linkedOccurrences, experimentLifecycles: lifecycles });\n}\n// @concord-code\n// @concord-implements docs/feature/plugins/lifecycle.md\nexport function linkPluginPair(evalDef: DiscoveredEval, preparedRun: PreparedPluginRun): PluginPairLink {\n try {\n const ownEvalLifecycles = linkPluginLifecycles(evalDef.plugins as readonly PluginInstance<\"eval\">[], \"eval\");\n const ownGroupLifecycles = evalDef.evalGroup === undefined\n ? Object.freeze([]) as readonly LinkedPluginLifecycle[]\n : linkPluginLifecycles(evalDef.evalGroup.plugins ?? [], \"group\");\n const allLifecycles = [...preparedRun.experimentLifecycles, ...ownGroupLifecycles, ...ownEvalLifecycles];\n const seen = new Map<string, LinkedPluginLifecycle>();\n for (const lifecycle of allLifecycles) {\n if (lifecycle.requires.evalGroup && evalDef.evalGroup === undefined) {\n throw pluginError([{ code: \"plugin-requires-eval-group\", experimentId: preparedRun.run.experimentId, evalId: evalDef.id,\n message: `Plugin ${lifecycle.name} (${lifecycle.key}) requires an Eval Group: ${evalDef.id}.`, actions: [\"Group every selected Eval in this Plugin's scope.\"] }]);\n }\n const id = JSON.stringify([lifecycle.name, lifecycle.key]);\n const previous = seen.get(id);\n if (previous !== undefined)\n throw pluginError([{ code: \"plugin-pair-instance-conflict\", experimentId: preparedRun.run.experimentId, evalId: evalDef.id,\n message: `Duplicate Plugin (${lifecycle.name}, ${lifecycle.key}) at ${previous.scope}.plugins[${previous.arrayPosition}] and ${lifecycle.scope}.plugins[${lifecycle.arrayPosition}].`, actions: [\"Use a distinct key for each condition in one Attempt.\"] }]);\n seen.set(id, lifecycle);\n }\n const groupLifecycles = groupPluginLifecycles(evalDef, preparedRun.run);\n const evalLifecycles = attemptPluginLifecycles(evalDef, preparedRun.run);\n if (preparedRun.run.adapter.kind !== \"sandbox\" && allLifecycles.some((entry) => entry.sandboxLayer !== undefined)) {\n throw new TypeError(\"Plugin sandbox layer requires a Sandbox Agent and a physical Sandbox plan.\");\n }\n const evalOccurrences = occurrences(ownEvalLifecycles, \"eval\", evalDef.id, evalDef.sourcePath);\n const groupOccurrences = evalDef.evalGroup === undefined\n ? Object.freeze([]) as readonly LinkedPluginOccurrence[]\n : occurrences(ownGroupLifecycles, \"group\", evalDef.evalGroup.id, evalDef.evalGroup.sourcePath);\n const all = Object.freeze([...preparedRun.experimentOccurrences, ...groupOccurrences, ...evalOccurrences]);\n const experimentLayer = appendPluginSandboxLayers(preparedRun.run.sandbox, preparedRun.experimentLifecycles);\n const groupLayer = evalDef.evalGroup === undefined\n ? undefined\n : appendPluginSandboxLayers(evalDef.evalGroup.sandbox, ownGroupLifecycles);\n const evalLayer = appendPluginSandboxLayers(evalDef.sandbox, ownEvalLifecycles);\n const noSandboxLifecycles = Object.freeze({\n experiment: Object.freeze([]),\n group: Object.freeze([]),\n eval: Object.freeze([]),\n });\n return Object.freeze({\n ...(evalLayer === undefined ? {} : { evalLayer }),\n ...(groupLayer === undefined ? {} : { groupLayer }),\n ...(experimentLayer === undefined ? {} : { experimentLayer }),\n occurrences: all,\n resources: Object.freeze([]),\n experimentLifecycles: preparedRun.experimentLifecycles,\n groupLifecycles,\n evalLifecycles,\n // The runner field remains source-compatible while the old sandbox\n // lifecycle data path is retired. Plugin layers are already composed\n // into their actual owner layer above.\n sandboxLifecycles: noSandboxLifecycles,\n pairProjection: Object.freeze({\n version: 1,\n occurrences: all.map((entry) => entry.projection),\n }) as JsonValue,\n });\n }\n catch (error) {\n if (error instanceof PluginLinkError)\n throw error;\n throw pluginError([{ code: \"plugin-owner-unsupported\", experimentId: preparedRun.run.experimentId, evalId: evalDef.id, message: String(error), actions: [\"Attach each plugin only to a scope it declares, without duplicates in one scope.\"] }]);\n }\n}\nexport function pluginBehaviorProjection(run: AgentRun): JsonValue {\n if (run.pluginBehavior !== undefined)\n return run.pluginBehavior;\n const empty: JsonValue[] = [];\n Object.freeze(empty);\n return empty;\n}\n/** Expand host timing independently from the attachment owner. */\nexport function groupPluginLifecycles(evalDef: DiscoveredEval, run: AgentRun): readonly LinkedPluginLifecycle[] {\n if (evalDef.evalGroup === undefined)\n return [];\n return [...linkPluginLifecycles(run.plugins ?? [], \"experiment\", \"group\"),\n ...linkPluginLifecycles(evalDef.evalGroup.plugins ?? [], \"group\", \"group\")];\n}\nexport function attemptPluginLifecycles(evalDef: DiscoveredEval, run: AgentRun): readonly LinkedPluginLifecycle[] {\n return [...linkPluginLifecycles(run.plugins ?? [], \"experiment\", \"attempt\"),\n ...linkPluginLifecycles(evalDef.evalGroup?.plugins ?? [], \"group\", \"attempt\"),\n ...linkPluginLifecycles(evalDef.plugins, \"eval\", \"attempt\")];\n}\n"]}
@@ -2,7 +2,7 @@ import type { AgentRun, DiscoveredEval } from "../runner/types.cjs";
2
2
  import type { JsonValue } from "../shared/types.cjs";
3
3
  import { type SandboxLayer } from "../sandbox/layer.cjs";
4
4
  import { type LinkedPluginLifecycle, type PluginOwner } from "./contracts.cjs";
5
- export type PluginLinkIssueCode = "plugin-instance-invalid" | "plugin-owner-unsupported" | "plugin-pair-instance-conflict";
5
+ export type PluginLinkIssueCode = "plugin-instance-invalid" | "plugin-owner-unsupported" | "plugin-pair-instance-conflict" | "plugin-requires-eval-group";
6
6
  export interface PluginOccurrenceProvenance {
7
7
  readonly attachment: PluginOwner;
8
8
  readonly owner: {
@@ -13,8 +13,7 @@ export interface PluginOccurrenceProvenance {
13
13
  }
14
14
  export interface LinkedPluginOccurrence {
15
15
  readonly name: string;
16
- readonly instanceKey: string;
17
- readonly behaviorRevision: string;
16
+ readonly key: string;
18
17
  readonly provenance: PluginOccurrenceProvenance;
19
18
  readonly projection: JsonValue;
20
19
  readonly audit: JsonValue;
@@ -65,4 +64,7 @@ export declare function pluginLinkErrorFromIssues(issues: readonly PluginLinkIss
65
64
  export declare function preparePluginRun(run: AgentRun): PreparedPluginRun;
66
65
  export declare function linkPluginPair(evalDef: DiscoveredEval, preparedRun: PreparedPluginRun): PluginPairLink;
67
66
  export declare function pluginBehaviorProjection(run: AgentRun): JsonValue;
67
+ /** Expand host timing independently from the attachment owner. */
68
+ export declare function groupPluginLifecycles(evalDef: DiscoveredEval, run: AgentRun): readonly LinkedPluginLifecycle[];
69
+ export declare function attemptPluginLifecycles(evalDef: DiscoveredEval, run: AgentRun): readonly LinkedPluginLifecycle[];
68
70
  export {};
@@ -2,7 +2,7 @@ import type { AgentRun, DiscoveredEval } from "../runner/types.mjs";
2
2
  import type { JsonValue } from "../shared/types.mjs";
3
3
  import { type SandboxLayer } from "../sandbox/layer.mjs";
4
4
  import { type LinkedPluginLifecycle, type PluginOwner } from "./contracts.mjs";
5
- export type PluginLinkIssueCode = "plugin-instance-invalid" | "plugin-owner-unsupported" | "plugin-pair-instance-conflict";
5
+ export type PluginLinkIssueCode = "plugin-instance-invalid" | "plugin-owner-unsupported" | "plugin-pair-instance-conflict" | "plugin-requires-eval-group";
6
6
  export interface PluginOccurrenceProvenance {
7
7
  readonly attachment: PluginOwner;
8
8
  readonly owner: {
@@ -13,8 +13,7 @@ export interface PluginOccurrenceProvenance {
13
13
  }
14
14
  export interface LinkedPluginOccurrence {
15
15
  readonly name: string;
16
- readonly instanceKey: string;
17
- readonly behaviorRevision: string;
16
+ readonly key: string;
18
17
  readonly provenance: PluginOccurrenceProvenance;
19
18
  readonly projection: JsonValue;
20
19
  readonly audit: JsonValue;
@@ -65,4 +64,7 @@ export declare function pluginLinkErrorFromIssues(issues: readonly PluginLinkIss
65
64
  export declare function preparePluginRun(run: AgentRun): PreparedPluginRun;
66
65
  export declare function linkPluginPair(evalDef: DiscoveredEval, preparedRun: PreparedPluginRun): PluginPairLink;
67
66
  export declare function pluginBehaviorProjection(run: AgentRun): JsonValue;
67
+ /** Expand host timing independently from the attachment owner. */
68
+ export declare function groupPluginLifecycles(evalDef: DiscoveredEval, run: AgentRun): readonly LinkedPluginLifecycle[];
69
+ export declare function attemptPluginLifecycles(evalDef: DiscoveredEval, run: AgentRun): readonly LinkedPluginLifecycle[];
68
70
  export {};
@@ -2,7 +2,7 @@ import type { AgentRun, DiscoveredEval } from "../runner/types.js";
2
2
  import type { JsonValue } from "../shared/types.js";
3
3
  import { type SandboxLayer } from "../sandbox/layer.js";
4
4
  import { type LinkedPluginLifecycle, type PluginOwner } from "./contracts.js";
5
- export type PluginLinkIssueCode = "plugin-instance-invalid" | "plugin-owner-unsupported" | "plugin-pair-instance-conflict";
5
+ export type PluginLinkIssueCode = "plugin-instance-invalid" | "plugin-owner-unsupported" | "plugin-pair-instance-conflict" | "plugin-requires-eval-group";
6
6
  export interface PluginOccurrenceProvenance {
7
7
  readonly attachment: PluginOwner;
8
8
  readonly owner: {
@@ -13,8 +13,7 @@ export interface PluginOccurrenceProvenance {
13
13
  }
14
14
  export interface LinkedPluginOccurrence {
15
15
  readonly name: string;
16
- readonly instanceKey: string;
17
- readonly behaviorRevision: string;
16
+ readonly key: string;
18
17
  readonly provenance: PluginOccurrenceProvenance;
19
18
  readonly projection: JsonValue;
20
19
  readonly audit: JsonValue;
@@ -65,4 +64,7 @@ export declare function pluginLinkErrorFromIssues(issues: readonly PluginLinkIss
65
64
  export declare function preparePluginRun(run: AgentRun): PreparedPluginRun;
66
65
  export declare function linkPluginPair(evalDef: DiscoveredEval, preparedRun: PreparedPluginRun): PluginPairLink;
67
66
  export declare function pluginBehaviorProjection(run: AgentRun): JsonValue;
67
+ /** Expand host timing independently from the attachment owner. */
68
+ export declare function groupPluginLifecycles(evalDef: DiscoveredEval, run: AgentRun): readonly LinkedPluginLifecycle[];
69
+ export declare function attemptPluginLifecycles(evalDef: DiscoveredEval, run: AgentRun): readonly LinkedPluginLifecycle[];
68
70
  export {};
@@ -3,12 +3,16 @@ const __niceevalRequire = __niceevalCreateRequire(import.meta.url);
3
3
  const __niceevalCanonical = __niceevalRequire("./link.cjs");
4
4
  const __niceevalExport0 = __niceevalCanonical["PluginLinkError"];
5
5
  export { __niceevalExport0 as PluginLinkError };
6
- const __niceevalExport1 = __niceevalCanonical["linkPluginPair"];
7
- export { __niceevalExport1 as linkPluginPair };
8
- const __niceevalExport2 = __niceevalCanonical["pluginBehaviorProjection"];
9
- export { __niceevalExport2 as pluginBehaviorProjection };
10
- const __niceevalExport3 = __niceevalCanonical["pluginLinkErrorFromIssues"];
11
- export { __niceevalExport3 as pluginLinkErrorFromIssues };
12
- const __niceevalExport4 = __niceevalCanonical["preparePluginRun"];
13
- export { __niceevalExport4 as preparePluginRun };
6
+ const __niceevalExport1 = __niceevalCanonical["attemptPluginLifecycles"];
7
+ export { __niceevalExport1 as attemptPluginLifecycles };
8
+ const __niceevalExport2 = __niceevalCanonical["groupPluginLifecycles"];
9
+ export { __niceevalExport2 as groupPluginLifecycles };
10
+ const __niceevalExport3 = __niceevalCanonical["linkPluginPair"];
11
+ export { __niceevalExport3 as linkPluginPair };
12
+ const __niceevalExport4 = __niceevalCanonical["pluginBehaviorProjection"];
13
+ export { __niceevalExport4 as pluginBehaviorProjection };
14
+ const __niceevalExport5 = __niceevalCanonical["pluginLinkErrorFromIssues"];
15
+ export { __niceevalExport5 as pluginLinkErrorFromIssues };
16
+ const __niceevalExport6 = __niceevalCanonical["preparePluginRun"];
17
+ export { __niceevalExport6 as preparePluginRun };
14
18
  //# sourceMappingURL=link.js.map
@@ -14,7 +14,7 @@ export declare const SealManifestDefinition: import("../definition/core.cjs").Re
14
14
  readonly format: "niceeval.seal-manifest";
15
15
  readonly runId: import("../model/identifiers.cjs").RunId;
16
16
  readonly entries: readonly {
17
- readonly kind: "core" | "attachment-envelope" | "payload" | "blob";
17
+ readonly kind: "attachment-envelope" | "core" | "payload" | "blob";
18
18
  readonly path: import("../model/identifiers.cjs").CanonicalRunRelativePath;
19
19
  readonly byteLength: number;
20
20
  readonly sha256: Sha256Digest;
@@ -37,7 +37,7 @@ export declare const SealManifestPublicationDefinition: import("../definition/co
37
37
  readonly format: "niceeval.seal-manifest";
38
38
  readonly runId: import("../model/identifiers.cjs").RunId;
39
39
  readonly entries: readonly {
40
- readonly kind: "core" | "attachment-envelope" | "payload" | "blob";
40
+ readonly kind: "attachment-envelope" | "core" | "payload" | "blob";
41
41
  readonly path: import("../model/identifiers.cjs").CanonicalRunRelativePath;
42
42
  readonly byteLength: number;
43
43
  readonly sha256: Sha256Digest;
@@ -65,7 +65,7 @@ export declare const RecordPublishRecoveryDefinition: import("../definition/core
65
65
  readonly destinationPath: string;
66
66
  readonly sealManifestSha256: Sha256Digest;
67
67
  readonly inventory: readonly {
68
- readonly kind: "core" | "attachment-envelope" | "payload" | "blob";
68
+ readonly kind: "attachment-envelope" | "core" | "payload" | "blob";
69
69
  readonly path: import("../model/identifiers.cjs").CanonicalRunRelativePath;
70
70
  readonly byteLength: number;
71
71
  readonly sha256: Sha256Digest;
@@ -14,7 +14,7 @@ export declare const SealManifestDefinition: import("../definition/core.mjs").Re
14
14
  readonly format: "niceeval.seal-manifest";
15
15
  readonly runId: import("../model/identifiers.mjs").RunId;
16
16
  readonly entries: readonly {
17
- readonly kind: "core" | "attachment-envelope" | "payload" | "blob";
17
+ readonly kind: "attachment-envelope" | "core" | "payload" | "blob";
18
18
  readonly path: import("../model/identifiers.mjs").CanonicalRunRelativePath;
19
19
  readonly byteLength: number;
20
20
  readonly sha256: Sha256Digest;
@@ -37,7 +37,7 @@ export declare const SealManifestPublicationDefinition: import("../definition/co
37
37
  readonly format: "niceeval.seal-manifest";
38
38
  readonly runId: import("../model/identifiers.mjs").RunId;
39
39
  readonly entries: readonly {
40
- readonly kind: "core" | "attachment-envelope" | "payload" | "blob";
40
+ readonly kind: "attachment-envelope" | "core" | "payload" | "blob";
41
41
  readonly path: import("../model/identifiers.mjs").CanonicalRunRelativePath;
42
42
  readonly byteLength: number;
43
43
  readonly sha256: Sha256Digest;
@@ -65,7 +65,7 @@ export declare const RecordPublishRecoveryDefinition: import("../definition/core
65
65
  readonly destinationPath: string;
66
66
  readonly sealManifestSha256: Sha256Digest;
67
67
  readonly inventory: readonly {
68
- readonly kind: "core" | "attachment-envelope" | "payload" | "blob";
68
+ readonly kind: "attachment-envelope" | "core" | "payload" | "blob";
69
69
  readonly path: import("../model/identifiers.mjs").CanonicalRunRelativePath;
70
70
  readonly byteLength: number;
71
71
  readonly sha256: Sha256Digest;
@@ -14,7 +14,7 @@ export declare const SealManifestDefinition: import("../definition/core.js").Rec
14
14
  readonly format: "niceeval.seal-manifest";
15
15
  readonly runId: import("../model/identifiers.js").RunId;
16
16
  readonly entries: readonly {
17
- readonly kind: "core" | "attachment-envelope" | "payload" | "blob";
17
+ readonly kind: "attachment-envelope" | "core" | "payload" | "blob";
18
18
  readonly path: import("../model/identifiers.js").CanonicalRunRelativePath;
19
19
  readonly byteLength: number;
20
20
  readonly sha256: Sha256Digest;
@@ -37,7 +37,7 @@ export declare const SealManifestPublicationDefinition: import("../definition/co
37
37
  readonly format: "niceeval.seal-manifest";
38
38
  readonly runId: import("../model/identifiers.js").RunId;
39
39
  readonly entries: readonly {
40
- readonly kind: "core" | "attachment-envelope" | "payload" | "blob";
40
+ readonly kind: "attachment-envelope" | "core" | "payload" | "blob";
41
41
  readonly path: import("../model/identifiers.js").CanonicalRunRelativePath;
42
42
  readonly byteLength: number;
43
43
  readonly sha256: Sha256Digest;
@@ -65,7 +65,7 @@ export declare const RecordPublishRecoveryDefinition: import("../definition/core
65
65
  readonly destinationPath: string;
66
66
  readonly sealManifestSha256: Sha256Digest;
67
67
  readonly inventory: readonly {
68
- readonly kind: "core" | "attachment-envelope" | "payload" | "blob";
68
+ readonly kind: "attachment-envelope" | "core" | "payload" | "blob";
69
69
  readonly path: import("../model/identifiers.js").CanonicalRunRelativePath;
70
70
  readonly byteLength: number;
71
71
  readonly sha256: Sha256Digest;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.attemptNotesRecordAttachment = void 0;
4
+ const index_ts_1 = require("../../attachment/index.cjs");
5
+ const schema_ts_1 = require("./schema.cjs");
6
+ exports.attemptNotesRecordAttachment = (0, index_ts_1.defineRecordAttachment)({
7
+ owner: index_ts_1.RecordOwner.attempt,
8
+ family: "niceeval.attempt-note",
9
+ schema: schema_ts_1.AttemptNotesSchema,
10
+ validate: () => [],
11
+ });
12
+ //# sourceMappingURL=definition.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.js","sourceRoot":"","sources":["definition.ts"],"names":[],"mappings":";;;AAAA,wDAAgF;AAChF,2CAAiD;AACpC,QAAA,4BAA4B,GAAG,IAAA,iCAAsB,EAAC;IAC/D,KAAK,EAAE,sBAAW,CAAC,OAAO;IAC1B,MAAM,EAAE,uBAAuB;IAC/B,MAAM,EAAE,8BAAkB;IAC1B,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE;CACrB,CAAC,CAAC","sourcesContent":["import { defineRecordAttachment, RecordOwner } from \"../../attachment/index.ts\";\nimport { AttemptNotesSchema } from \"./schema.ts\";\nexport const attemptNotesRecordAttachment = defineRecordAttachment({\n owner: RecordOwner.attempt,\n family: \"niceeval.attempt-note\",\n schema: AttemptNotesSchema,\n validate: () => [],\n});\n"]}
@@ -0,0 +1,6 @@
1
+ export declare const attemptNotesRecordAttachment: import("../../attachment/protocol.cjs").RecordAttachmentDefinition<"attempt", "niceeval.attempt-note", import("effect/Schema").$Array<import("effect/Schema").Struct<{
2
+ readonly label: import("effect/Schema").String;
3
+ readonly sequence: import("effect/Schema").Number;
4
+ readonly value: import("effect/Schema").Codec<import("./schema.cjs").NoteValue, import("./schema.cjs").NoteValue, never, never>;
5
+ readonly unit: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["ms", "seconds", "tokens", "usd", "ratio", "count", "bytes"]>>;
6
+ }>>>;
@@ -0,0 +1,6 @@
1
+ export declare const attemptNotesRecordAttachment: import("../../attachment/protocol.mjs").RecordAttachmentDefinition<"attempt", "niceeval.attempt-note", import("effect/Schema").$Array<import("effect/Schema").Struct<{
2
+ readonly label: import("effect/Schema").String;
3
+ readonly sequence: import("effect/Schema").Number;
4
+ readonly value: import("effect/Schema").Codec<import("./schema.mjs").NoteValue, import("./schema.mjs").NoteValue, never, never>;
5
+ readonly unit: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["ms", "seconds", "tokens", "usd", "ratio", "count", "bytes"]>>;
6
+ }>>>;
@@ -0,0 +1,6 @@
1
+ export declare const attemptNotesRecordAttachment: import("../../attachment/protocol.js").RecordAttachmentDefinition<"attempt", "niceeval.attempt-note", import("effect/Schema").$Array<import("effect/Schema").Struct<{
2
+ readonly label: import("effect/Schema").String;
3
+ readonly sequence: import("effect/Schema").Number;
4
+ readonly value: import("effect/Schema").Codec<import("./schema.js").NoteValue, import("./schema.js").NoteValue, never, never>;
5
+ readonly unit: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["ms", "seconds", "tokens", "usd", "ratio", "count", "bytes"]>>;
6
+ }>>>;
@@ -0,0 +1,6 @@
1
+ import { createRequire as __niceevalCreateRequire } from "node:module";
2
+ const __niceevalRequire = __niceevalCreateRequire(import.meta.url);
3
+ const __niceevalCanonical = __niceevalRequire("./definition.cjs");
4
+ const __niceevalExport0 = __niceevalCanonical["attemptNotesRecordAttachment"];
5
+ export { __niceevalExport0 as attemptNotesRecordAttachment };
6
+ //# sourceMappingURL=definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.js","sources":[],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.attemptNotesRecordAttachmentPersistence = void 0;
4
+ const index_ts_1 = require("../../attachment/index.cjs");
5
+ const definition_ts_1 = require("./definition.cjs");
6
+ exports.attemptNotesRecordAttachmentPersistence = (0, index_ts_1.defineRecordAttachmentPersistence)({
7
+ attachment: definition_ts_1.attemptNotesRecordAttachment,
8
+ revision: 1,
9
+ });
10
+ //# sourceMappingURL=persistence.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persistence.js","sourceRoot":"","sources":["persistence.ts"],"names":[],"mappings":";;;AAAA,wDAA8E;AAC9E,mDAA+D;AAClD,QAAA,uCAAuC,GAAG,IAAA,4CAAiC,EAAC;IACrF,UAAU,EAAE,4CAA4B;IACxC,QAAQ,EAAE,CAAC;CACd,CAAC,CAAC","sourcesContent":["import { defineRecordAttachmentPersistence } from \"../../attachment/index.ts\";\nimport { attemptNotesRecordAttachment } from \"./definition.ts\";\nexport const attemptNotesRecordAttachmentPersistence = defineRecordAttachmentPersistence({\n attachment: attemptNotesRecordAttachment,\n revision: 1,\n});\n"]}
@@ -0,0 +1,6 @@
1
+ export declare const attemptNotesRecordAttachmentPersistence: import("../../attachment/protocol.cjs").RecordAttachmentPersistence<import("../../attachment/protocol.cjs").RecordAttachmentDefinition<"attempt", "niceeval.attempt-note", import("effect/Schema").$Array<import("effect/Schema").Struct<{
2
+ readonly label: import("effect/Schema").String;
3
+ readonly sequence: import("effect/Schema").Number;
4
+ readonly value: import("effect/Schema").Codec<import("./schema.cjs").NoteValue, import("./schema.cjs").NoteValue, never, never>;
5
+ readonly unit: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["ms", "seconds", "tokens", "usd", "ratio", "count", "bytes"]>>;
6
+ }>>>, 1>;
@@ -0,0 +1,6 @@
1
+ export declare const attemptNotesRecordAttachmentPersistence: import("../../attachment/protocol.mjs").RecordAttachmentPersistence<import("../../attachment/protocol.mjs").RecordAttachmentDefinition<"attempt", "niceeval.attempt-note", import("effect/Schema").$Array<import("effect/Schema").Struct<{
2
+ readonly label: import("effect/Schema").String;
3
+ readonly sequence: import("effect/Schema").Number;
4
+ readonly value: import("effect/Schema").Codec<import("./schema.mjs").NoteValue, import("./schema.mjs").NoteValue, never, never>;
5
+ readonly unit: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["ms", "seconds", "tokens", "usd", "ratio", "count", "bytes"]>>;
6
+ }>>>, 1>;
@@ -0,0 +1,6 @@
1
+ export declare const attemptNotesRecordAttachmentPersistence: import("../../attachment/protocol.js").RecordAttachmentPersistence<import("../../attachment/protocol.js").RecordAttachmentDefinition<"attempt", "niceeval.attempt-note", import("effect/Schema").$Array<import("effect/Schema").Struct<{
2
+ readonly label: import("effect/Schema").String;
3
+ readonly sequence: import("effect/Schema").Number;
4
+ readonly value: import("effect/Schema").Codec<import("./schema.js").NoteValue, import("./schema.js").NoteValue, never, never>;
5
+ readonly unit: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["ms", "seconds", "tokens", "usd", "ratio", "count", "bytes"]>>;
6
+ }>>>, 1>;
@@ -0,0 +1,6 @@
1
+ import { createRequire as __niceevalCreateRequire } from "node:module";
2
+ const __niceevalRequire = __niceevalCreateRequire(import.meta.url);
3
+ const __niceevalCanonical = __niceevalRequire("./persistence.cjs");
4
+ const __niceevalExport0 = __niceevalCanonical["attemptNotesRecordAttachmentPersistence"];
5
+ export { __niceevalExport0 as attemptNotesRecordAttachmentPersistence };
6
+ //# sourceMappingURL=persistence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persistence.js","sources":[],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AttemptNotesSchema = exports.AttemptNoteSchema = exports.AttemptNoteLimits = void 0;
4
+ const effect_1 = require("effect");
5
+ const common_ts_1 = require("../common.cjs");
6
+ exports.AttemptNoteLimits = Object.freeze({ maximumEntries: 64, maximumJsonBytes: 64 * 1024 });
7
+ const NoteJsonSchema = effect_1.Schema.suspend(() => effect_1.Schema.Union([
8
+ effect_1.Schema.Null, effect_1.Schema.Boolean, effect_1.Schema.Finite, effect_1.Schema.String, effect_1.Schema.Array(NoteJsonSchema), effect_1.Schema.Record(effect_1.Schema.String, NoteJsonSchema),
9
+ ]));
10
+ exports.AttemptNoteSchema = effect_1.Schema.Struct({
11
+ label: effect_1.Schema.String,
12
+ sequence: common_ts_1.NonNegativeSafeIntegerSchema,
13
+ value: NoteJsonSchema,
14
+ unit: effect_1.Schema.optional(effect_1.Schema.Literals(["ms", "seconds", "tokens", "usd", "ratio", "count", "bytes"])),
15
+ });
16
+ exports.AttemptNotesSchema = effect_1.Schema.Array(exports.AttemptNoteSchema).check(effect_1.Schema.makeFilter((notes) => notes.length <= exports.AttemptNoteLimits.maximumEntries && new Set(notes.map((note) => note.label)).size === notes.length &&
17
+ notes.every((note, index) => note.sequence === index &&
18
+ (note.unit === undefined || typeof note.value === "number") &&
19
+ new TextEncoder().encode(JSON.stringify(note)).byteLength <= exports.AttemptNoteLimits.maximumJsonBytes)));
20
+ //# sourceMappingURL=schema.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,4CAA4D;AAI/C,QAAA,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE,gBAAgB,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;AACpG,MAAM,cAAc,GAA4B,eAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,eAAM,CAAC,KAAK,CAAC;IAC9E,eAAM,CAAC,IAAI,EAAE,eAAM,CAAC,OAAO,EAAE,eAAM,CAAC,MAAM,EAAE,eAAM,CAAC,MAAM,EAAE,eAAM,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,eAAM,CAAC,MAAM,CAAC,eAAM,CAAC,MAAM,EAAE,cAAc,CAAC;CACxI,CAAC,CAAC,CAAC;AACS,QAAA,iBAAiB,GAAG,eAAM,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,eAAM,CAAC,MAAM;IACpB,QAAQ,EAAE,wCAA4B;IACtC,KAAK,EAAE,cAAc;IACrB,IAAI,EAAE,eAAM,CAAC,QAAQ,CAAC,eAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;CACxG,CAAC,CAAC;AAEU,QAAA,kBAAkB,GAAG,eAAM,CAAC,KAAK,CAAC,yBAAiB,CAAC,CAAC,KAAK,CAAC,eAAM,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,yBAAiB,CAAC,cAAc,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM;IACnN,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,KAAK;QAChD,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC;QAC3D,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,IAAI,yBAAiB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC","sourcesContent":["import { Schema } from \"effect\";\nimport { NonNegativeSafeIntegerSchema } from \"../common.ts\";\nexport type NoteValue = string | number | boolean | null | readonly NoteValue[] | {\n readonly [key: string]: NoteValue;\n};\nexport const AttemptNoteLimits = Object.freeze({ maximumEntries: 64, maximumJsonBytes: 64 * 1024 });\nconst NoteJsonSchema: Schema.Codec<NoteValue> = Schema.suspend(() => Schema.Union([\n Schema.Null, Schema.Boolean, Schema.Finite, Schema.String, Schema.Array(NoteJsonSchema), Schema.Record(Schema.String, NoteJsonSchema),\n]));\nexport const AttemptNoteSchema = Schema.Struct({\n label: Schema.String,\n sequence: NonNegativeSafeIntegerSchema,\n value: NoteJsonSchema,\n unit: Schema.optional(Schema.Literals([\"ms\", \"seconds\", \"tokens\", \"usd\", \"ratio\", \"count\", \"bytes\"])),\n});\nexport type AttemptNote = Schema.Schema.Type<typeof AttemptNoteSchema>;\nexport const AttemptNotesSchema = Schema.Array(AttemptNoteSchema).check(Schema.makeFilter((notes) => notes.length <= AttemptNoteLimits.maximumEntries && new Set(notes.map((note) => note.label)).size === notes.length &&\n notes.every((note, index) => note.sequence === index &&\n (note.unit === undefined || typeof note.value === \"number\") &&\n new TextEncoder().encode(JSON.stringify(note)).byteLength <= AttemptNoteLimits.maximumJsonBytes)));\n"]}
@@ -0,0 +1,21 @@
1
+ import { Schema } from "effect";
2
+ export type NoteValue = string | number | boolean | null | readonly NoteValue[] | {
3
+ readonly [key: string]: NoteValue;
4
+ };
5
+ export declare const AttemptNoteLimits: Readonly<{
6
+ maximumEntries: 64;
7
+ maximumJsonBytes: number;
8
+ }>;
9
+ export declare const AttemptNoteSchema: Schema.Struct<{
10
+ readonly label: Schema.String;
11
+ readonly sequence: Schema.Number;
12
+ readonly value: Schema.Codec<NoteValue, NoteValue, never, never>;
13
+ readonly unit: Schema.optional<Schema.Literals<readonly ["ms", "seconds", "tokens", "usd", "ratio", "count", "bytes"]>>;
14
+ }>;
15
+ export type AttemptNote = Schema.Schema.Type<typeof AttemptNoteSchema>;
16
+ export declare const AttemptNotesSchema: Schema.$Array<Schema.Struct<{
17
+ readonly label: Schema.String;
18
+ readonly sequence: Schema.Number;
19
+ readonly value: Schema.Codec<NoteValue, NoteValue, never, never>;
20
+ readonly unit: Schema.optional<Schema.Literals<readonly ["ms", "seconds", "tokens", "usd", "ratio", "count", "bytes"]>>;
21
+ }>>;
@@ -0,0 +1,21 @@
1
+ import { Schema } from "effect";
2
+ export type NoteValue = string | number | boolean | null | readonly NoteValue[] | {
3
+ readonly [key: string]: NoteValue;
4
+ };
5
+ export declare const AttemptNoteLimits: Readonly<{
6
+ maximumEntries: 64;
7
+ maximumJsonBytes: number;
8
+ }>;
9
+ export declare const AttemptNoteSchema: Schema.Struct<{
10
+ readonly label: Schema.String;
11
+ readonly sequence: Schema.Number;
12
+ readonly value: Schema.Codec<NoteValue, NoteValue, never, never>;
13
+ readonly unit: Schema.optional<Schema.Literals<readonly ["ms", "seconds", "tokens", "usd", "ratio", "count", "bytes"]>>;
14
+ }>;
15
+ export type AttemptNote = Schema.Schema.Type<typeof AttemptNoteSchema>;
16
+ export declare const AttemptNotesSchema: Schema.$Array<Schema.Struct<{
17
+ readonly label: Schema.String;
18
+ readonly sequence: Schema.Number;
19
+ readonly value: Schema.Codec<NoteValue, NoteValue, never, never>;
20
+ readonly unit: Schema.optional<Schema.Literals<readonly ["ms", "seconds", "tokens", "usd", "ratio", "count", "bytes"]>>;
21
+ }>>;
@@ -0,0 +1,21 @@
1
+ import { Schema } from "effect";
2
+ export type NoteValue = string | number | boolean | null | readonly NoteValue[] | {
3
+ readonly [key: string]: NoteValue;
4
+ };
5
+ export declare const AttemptNoteLimits: Readonly<{
6
+ maximumEntries: 64;
7
+ maximumJsonBytes: number;
8
+ }>;
9
+ export declare const AttemptNoteSchema: Schema.Struct<{
10
+ readonly label: Schema.String;
11
+ readonly sequence: Schema.Number;
12
+ readonly value: Schema.Codec<NoteValue, NoteValue, never, never>;
13
+ readonly unit: Schema.optional<Schema.Literals<readonly ["ms", "seconds", "tokens", "usd", "ratio", "count", "bytes"]>>;
14
+ }>;
15
+ export type AttemptNote = Schema.Schema.Type<typeof AttemptNoteSchema>;
16
+ export declare const AttemptNotesSchema: Schema.$Array<Schema.Struct<{
17
+ readonly label: Schema.String;
18
+ readonly sequence: Schema.Number;
19
+ readonly value: Schema.Codec<NoteValue, NoteValue, never, never>;
20
+ readonly unit: Schema.optional<Schema.Literals<readonly ["ms", "seconds", "tokens", "usd", "ratio", "count", "bytes"]>>;
21
+ }>>;
@@ -0,0 +1,10 @@
1
+ import { createRequire as __niceevalCreateRequire } from "node:module";
2
+ const __niceevalRequire = __niceevalCreateRequire(import.meta.url);
3
+ const __niceevalCanonical = __niceevalRequire("./schema.cjs");
4
+ const __niceevalExport0 = __niceevalCanonical["AttemptNoteLimits"];
5
+ export { __niceevalExport0 as AttemptNoteLimits };
6
+ const __niceevalExport1 = __niceevalCanonical["AttemptNoteSchema"];
7
+ export { __niceevalExport1 as AttemptNoteSchema };
8
+ const __niceevalExport2 = __niceevalCanonical["AttemptNotesSchema"];
9
+ export { __niceevalExport2 as AttemptNotesSchema };
10
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sources":[],"names":[],"mappings":""}