niceeval 0.13.3 → 0.13.4-canary.39

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 (487) hide show
  1. package/INDEX.md +5 -5
  2. package/dist/agents/index.cjs +2 -2
  3. package/dist/agents/index.cjs.map +1 -1
  4. package/dist/agents/project.json +6 -0
  5. package/dist/agents/streaming.cjs.map +1 -1
  6. package/dist/agents/types.cjs.map +1 -1
  7. package/dist/agents/types.d.cts +1 -1
  8. package/dist/agents/types.d.mts +1 -1
  9. package/dist/agents/types.d.ts +1 -1
  10. package/dist/analysis/bindings.d.cts +8 -8
  11. package/dist/analysis/bindings.d.mts +8 -8
  12. package/dist/analysis/bindings.d.ts +8 -8
  13. package/dist/analysis/contracts.cjs.map +1 -1
  14. package/dist/analysis/contracts.d.cts +8 -19
  15. package/dist/analysis/contracts.d.mts +8 -19
  16. package/dist/analysis/contracts.d.ts +8 -19
  17. package/dist/analysis/experiment-groups.cjs +7 -14
  18. package/dist/analysis/experiment-groups.cjs.map +1 -1
  19. package/dist/analysis/index.cjs.map +1 -1
  20. package/dist/analysis/index.d.cts +1 -1
  21. package/dist/analysis/index.d.mts +1 -1
  22. package/dist/analysis/index.d.ts +1 -1
  23. package/dist/cli/application.cjs +4 -13
  24. package/dist/cli/application.cjs.map +1 -1
  25. package/dist/cli/application.d.cts +62 -59
  26. package/dist/cli/application.d.mts +62 -59
  27. package/dist/cli/application.d.ts +62 -59
  28. package/dist/cli/application.js +6 -12
  29. package/dist/cli/bootstrap.cjs +28 -2
  30. package/dist/cli/bootstrap.cjs.map +1 -1
  31. package/dist/cli/contribution.cjs +185 -0
  32. package/dist/cli/contribution.cjs.map +1 -0
  33. package/dist/cli/contribution.d.cts +55 -0
  34. package/dist/cli/contribution.d.mts +55 -0
  35. package/dist/cli/contribution.d.ts +55 -0
  36. package/dist/cli/contribution.js +20 -0
  37. package/dist/cli/contribution.js.map +1 -0
  38. package/dist/cli/node-application.cjs +119 -87
  39. package/dist/cli/node-application.cjs.map +1 -1
  40. package/dist/cli/node-application.d.cts +2 -8
  41. package/dist/cli/node-application.d.mts +2 -8
  42. package/dist/cli/node-application.d.ts +2 -8
  43. package/dist/cli/node-application.js +12 -22
  44. package/dist/cli/program.cjs +87 -2756
  45. package/dist/cli/program.cjs.map +1 -1
  46. package/dist/cli/program.d.cts +11 -332
  47. package/dist/cli/program.d.mts +11 -332
  48. package/dist/cli/program.d.ts +11 -332
  49. package/dist/cli/program.js +4 -28
  50. package/dist/cli.cjs +0 -3
  51. package/dist/cli.cjs.map +1 -1
  52. package/dist/cli.d.cts +0 -1
  53. package/dist/cli.d.mts +0 -1
  54. package/dist/cli.d.ts +0 -1
  55. package/dist/cli.js +6 -14
  56. package/dist/define.cjs +1 -1
  57. package/dist/define.cjs.map +1 -1
  58. package/dist/docker/cache-administration.cjs +8 -0
  59. package/dist/docker/cache-administration.cjs.map +1 -0
  60. package/dist/docker/cache-administration.d.cts +33 -0
  61. package/dist/docker/cache-administration.d.mts +33 -0
  62. package/dist/docker/cache-administration.d.ts +33 -0
  63. package/dist/docker/cache-administration.js +6 -0
  64. package/dist/docker/cache-administration.js.map +1 -0
  65. package/dist/docker/cache-live.cjs +27 -0
  66. package/dist/docker/cache-live.cjs.map +1 -0
  67. package/dist/docker/cache-live.d.cts +3 -0
  68. package/dist/docker/cache-live.d.mts +3 -0
  69. package/dist/docker/cache-live.d.ts +3 -0
  70. package/dist/docker/cache-live.js +6 -0
  71. package/dist/docker/cache-live.js.map +1 -0
  72. package/dist/docker/cli/contribution.cjs +223 -0
  73. package/dist/docker/cli/contribution.cjs.map +1 -0
  74. package/dist/docker/cli/contribution.d.cts +48 -0
  75. package/dist/docker/cli/contribution.d.mts +48 -0
  76. package/dist/docker/cli/contribution.d.ts +48 -0
  77. package/dist/docker/cli/contribution.js +8 -0
  78. package/dist/docker/cli/contribution.js.map +1 -0
  79. package/dist/eval/cli/contribution.cjs +62 -0
  80. package/dist/eval/cli/contribution.cjs.map +1 -0
  81. package/dist/eval/cli/contribution.d.cts +21 -0
  82. package/dist/eval/cli/contribution.d.mts +21 -0
  83. package/dist/eval/cli/contribution.d.ts +21 -0
  84. package/dist/eval/cli/contribution.js +8 -0
  85. package/dist/eval/cli/contribution.js.map +1 -0
  86. package/dist/eval/host/index.cjs +23 -0
  87. package/dist/eval/host/index.cjs.map +1 -0
  88. package/dist/eval/host/index.d.cts +27 -0
  89. package/dist/eval/host/index.d.mts +27 -0
  90. package/dist/eval/host/index.d.ts +27 -0
  91. package/dist/eval/host/index.js +8 -0
  92. package/dist/eval/host/index.js.map +1 -0
  93. package/dist/eval/host/index.mjs +8 -0
  94. package/dist/eval/host/index.mjs.map +1 -0
  95. package/dist/experiment/host/cli/contribution.cjs +835 -0
  96. package/dist/experiment/host/cli/contribution.cjs.map +1 -0
  97. package/dist/experiment/host/cli/contribution.d.cts +329 -0
  98. package/dist/experiment/host/cli/contribution.d.mts +329 -0
  99. package/dist/experiment/host/cli/contribution.d.ts +329 -0
  100. package/dist/experiment/host/cli/contribution.js +22 -0
  101. package/dist/experiment/host/cli/contribution.js.map +1 -0
  102. package/dist/experiment/host/cli/index.cjs +9 -0
  103. package/dist/experiment/host/cli/index.cjs.map +1 -0
  104. package/dist/experiment/host/cli/index.d.cts +2 -0
  105. package/dist/experiment/host/cli/index.d.mts +2 -0
  106. package/dist/experiment/host/cli/index.d.ts +2 -0
  107. package/dist/experiment/host/cli/index.js +10 -0
  108. package/dist/experiment/host/cli/index.js.map +1 -0
  109. package/dist/experiment/host/cli/terminal.cjs +15 -0
  110. package/dist/experiment/host/cli/terminal.cjs.map +1 -0
  111. package/dist/experiment/host/cli/terminal.d.cts +14 -0
  112. package/dist/experiment/host/cli/terminal.d.mts +14 -0
  113. package/dist/experiment/host/cli/terminal.d.ts +14 -0
  114. package/dist/experiment/host/cli/terminal.js +8 -0
  115. package/dist/experiment/host/cli/terminal.js.map +1 -0
  116. package/dist/experiment/host/index.cjs +35 -58
  117. package/dist/experiment/host/index.cjs.map +1 -1
  118. package/dist/experiment/host/index.d.cts +5 -79
  119. package/dist/experiment/host/index.d.mts +5 -79
  120. package/dist/experiment/host/index.d.ts +5 -79
  121. package/dist/experiment/host/index.js +4 -2
  122. package/dist/experiment/host/index.mjs +4 -2
  123. package/dist/experiment/host/operations.cjs +678 -0
  124. package/dist/experiment/host/operations.cjs.map +1 -0
  125. package/dist/experiment/host/operations.d.cts +19 -0
  126. package/dist/experiment/host/operations.d.mts +19 -0
  127. package/dist/experiment/host/operations.d.ts +19 -0
  128. package/dist/experiment/host/operations.js +24 -0
  129. package/dist/experiment/host/operations.js.map +1 -0
  130. package/dist/experiment/host/presentation.cjs +81 -0
  131. package/dist/experiment/host/presentation.cjs.map +1 -0
  132. package/dist/experiment/host/presentation.d.cts +9 -0
  133. package/dist/experiment/host/presentation.d.mts +9 -0
  134. package/dist/experiment/host/presentation.d.ts +9 -0
  135. package/dist/experiment/host/presentation.js +8 -0
  136. package/dist/experiment/host/presentation.js.map +1 -0
  137. package/dist/experiment/host/teardown.cjs +394 -0
  138. package/dist/experiment/host/teardown.cjs.map +1 -0
  139. package/dist/experiment/host/teardown.d.cts +5 -0
  140. package/dist/experiment/host/teardown.d.mts +5 -0
  141. package/dist/experiment/host/teardown.d.ts +5 -0
  142. package/dist/experiment/host/teardown.js +8 -0
  143. package/dist/experiment/host/teardown.js.map +1 -0
  144. package/dist/experiment/host/types.cjs +9 -0
  145. package/dist/experiment/host/types.cjs.map +1 -0
  146. package/dist/experiment/host/types.d.cts +423 -0
  147. package/dist/experiment/host/types.d.mts +423 -0
  148. package/dist/experiment/host/types.d.ts +423 -0
  149. package/dist/experiment/host/types.js +6 -0
  150. package/dist/experiment/host/types.js.map +1 -0
  151. package/dist/i18n/en.cjs +8 -50
  152. package/dist/i18n/en.cjs.map +1 -1
  153. package/dist/i18n/en.d.cts +2 -6
  154. package/dist/i18n/en.d.mts +2 -6
  155. package/dist/i18n/en.d.ts +2 -6
  156. package/dist/o11y/project.json +6 -0
  157. package/dist/project/cli/contribution.cjs +66 -0
  158. package/dist/project/cli/contribution.cjs.map +1 -0
  159. package/dist/project/cli/contribution.d.cts +17 -0
  160. package/dist/project/cli/contribution.d.mts +17 -0
  161. package/dist/project/cli/contribution.d.ts +17 -0
  162. package/dist/project/cli/contribution.js +8 -0
  163. package/dist/project/cli/contribution.js.map +1 -0
  164. package/dist/project/cli/index.cjs +7 -0
  165. package/dist/project/cli/index.cjs.map +1 -0
  166. package/dist/project/cli/index.d.cts +1 -0
  167. package/dist/project/cli/index.d.mts +1 -0
  168. package/dist/project/cli/index.d.ts +1 -0
  169. package/dist/project/cli/index.js +8 -0
  170. package/dist/project/cli/index.js.map +1 -0
  171. package/dist/project/host/index.cjs +11 -0
  172. package/dist/project/host/index.cjs.map +1 -0
  173. package/dist/project/host/index.d.cts +4 -0
  174. package/dist/project/host/index.d.mts +4 -0
  175. package/dist/project/host/index.d.ts +4 -0
  176. package/dist/project/host/index.js +14 -0
  177. package/dist/project/host/index.js.map +1 -0
  178. package/dist/project/host/index.mjs +14 -0
  179. package/dist/project/host/index.mjs.map +1 -0
  180. package/dist/project/host.cjs +59 -0
  181. package/dist/project/host.cjs.map +1 -0
  182. package/dist/project/host.d.cts +17 -0
  183. package/dist/project/host.d.mts +17 -0
  184. package/dist/project/host.d.ts +17 -0
  185. package/dist/project/host.js +6 -0
  186. package/dist/project/host.js.map +1 -0
  187. package/dist/project/index.cjs +11 -0
  188. package/dist/project/index.cjs.map +1 -0
  189. package/dist/project/index.d.cts +4 -0
  190. package/dist/project/index.d.mts +4 -0
  191. package/dist/project/index.d.ts +4 -0
  192. package/dist/project/index.js +14 -0
  193. package/dist/project/index.js.map +1 -0
  194. package/dist/project/node.cjs +91 -0
  195. package/dist/project/node.cjs.map +1 -0
  196. package/dist/project/node.d.cts +6 -0
  197. package/dist/project/node.d.mts +6 -0
  198. package/dist/project/node.d.ts +6 -0
  199. package/dist/project/node.js +12 -0
  200. package/dist/project/node.js.map +1 -0
  201. package/dist/project/services.cjs +17 -0
  202. package/dist/project/services.cjs.map +1 -0
  203. package/dist/project/services.d.cts +47 -0
  204. package/dist/project/services.d.mts +47 -0
  205. package/dist/project/services.d.ts +47 -0
  206. package/dist/project/services.js +12 -0
  207. package/dist/project/services.js.map +1 -0
  208. package/dist/project/templates.cjs +28 -0
  209. package/dist/project/templates.cjs.map +1 -0
  210. package/dist/project/templates.d.cts +4 -0
  211. package/dist/project/templates.d.mts +4 -0
  212. package/dist/project/templates.d.ts +4 -0
  213. package/dist/project/templates.js +12 -0
  214. package/dist/project/templates.js.map +1 -0
  215. package/dist/project.json +6 -0
  216. package/dist/record/family/catalog.d.cts +10 -10
  217. package/dist/record/family/catalog.d.mts +10 -10
  218. package/dist/record/family/catalog.d.ts +10 -10
  219. package/dist/record/family/file-changes.d.cts +8 -8
  220. package/dist/record/family/file-changes.d.mts +8 -8
  221. package/dist/record/family/file-changes.d.ts +8 -8
  222. package/dist/record/host/cli/contribution.cjs +206 -0
  223. package/dist/record/host/cli/contribution.cjs.map +1 -0
  224. package/dist/record/host/cli/contribution.d.cts +32 -0
  225. package/dist/record/host/cli/contribution.d.mts +32 -0
  226. package/dist/record/host/cli/contribution.d.ts +32 -0
  227. package/dist/record/host/cli/contribution.js +10 -0
  228. package/dist/record/host/cli/contribution.js.map +1 -0
  229. package/dist/record/host/cli/index.cjs +8 -0
  230. package/dist/record/host/cli/index.cjs.map +1 -0
  231. package/dist/record/host/cli/index.d.cts +1 -0
  232. package/dist/record/host/cli/index.d.mts +1 -0
  233. package/dist/record/host/cli/index.d.ts +1 -0
  234. package/dist/record/host/cli/index.js +10 -0
  235. package/dist/record/host/cli/index.js.map +1 -0
  236. package/dist/record/host/cli/presentation.cjs +122 -0
  237. package/dist/record/host/cli/presentation.cjs.map +1 -0
  238. package/dist/record/host/cli/presentation.d.cts +7 -0
  239. package/dist/record/host/cli/presentation.d.mts +7 -0
  240. package/dist/record/host/cli/presentation.d.ts +7 -0
  241. package/dist/record/host/cli/presentation.js +12 -0
  242. package/dist/record/host/cli/presentation.js.map +1 -0
  243. package/dist/record/host/index.cjs.map +1 -1
  244. package/dist/record/host/index.d.cts +1 -1
  245. package/dist/record/host/index.d.mts +1 -1
  246. package/dist/record/host/index.d.ts +1 -1
  247. package/dist/record/host/runtime.cjs +184 -1
  248. package/dist/record/host/runtime.cjs.map +1 -1
  249. package/dist/record/host/types.cjs.map +1 -1
  250. package/dist/record/host/types.d.cts +120 -0
  251. package/dist/record/host/types.d.mts +120 -0
  252. package/dist/record/host/types.d.ts +120 -0
  253. package/dist/record/project.json +6 -0
  254. package/dist/report/assets/styles.css +80 -0
  255. package/dist/report/cli/contribution.cjs +325 -0
  256. package/dist/report/cli/contribution.cjs.map +1 -0
  257. package/dist/report/cli/contribution.d.cts +143 -0
  258. package/dist/report/cli/contribution.d.mts +143 -0
  259. package/dist/report/cli/contribution.d.ts +143 -0
  260. package/dist/report/cli/contribution.js +12 -0
  261. package/dist/report/cli/contribution.js.map +1 -0
  262. package/dist/report/client-dist/app.js +9 -9
  263. package/dist/report/components/attempt-detail/content.cjs +1 -1
  264. package/dist/report/components/attempt-detail/content.cjs.map +1 -1
  265. package/dist/report/components/entity-lists/compute.cjs +5 -0
  266. package/dist/report/components/entity-lists/compute.cjs.map +1 -1
  267. package/dist/report/components/entity-lists/compute.d.cts +2 -0
  268. package/dist/report/components/entity-lists/compute.d.mts +2 -0
  269. package/dist/report/components/entity-lists/compute.d.ts +2 -0
  270. package/dist/report/components/entity-lists/content.cjs +35 -12
  271. package/dist/report/components/entity-lists/content.cjs.map +1 -1
  272. package/dist/report/components/entity-lists/index.cjs +0 -3
  273. package/dist/report/components/entity-lists/index.cjs.map +1 -1
  274. package/dist/report/components/summaries/index.cjs +2 -4
  275. package/dist/report/components/summaries/index.cjs.map +1 -1
  276. package/dist/report/definition/cell.cjs +7 -2
  277. package/dist/report/definition/cell.cjs.map +1 -1
  278. package/dist/report/definition/cell.d.cts +2 -0
  279. package/dist/report/definition/cell.d.mts +2 -0
  280. package/dist/report/definition/cell.d.ts +2 -0
  281. package/dist/report/definition/primitives/assertion-evidence.cjs +190 -4
  282. package/dist/report/definition/primitives/assertion-evidence.cjs.map +1 -1
  283. package/dist/report/definition/primitives/assertion-evidence.d.cts +4 -0
  284. package/dist/report/definition/primitives/assertion-evidence.d.mts +4 -0
  285. package/dist/report/definition/primitives/assertion-evidence.d.ts +4 -0
  286. package/dist/report/execution/machine.cjs +2 -3
  287. package/dist/report/execution/machine.cjs.map +1 -1
  288. package/dist/report/execution/machine.d.cts +11 -8
  289. package/dist/report/execution/machine.d.mts +11 -8
  290. package/dist/report/execution/machine.d.ts +11 -8
  291. package/dist/report/host/from-record.cjs +13 -8
  292. package/dist/report/host/from-record.cjs.map +1 -1
  293. package/dist/report/host/index.cjs +5 -1
  294. package/dist/report/host/index.cjs.map +1 -1
  295. package/dist/report/host/index.d.cts +1 -0
  296. package/dist/report/host/index.d.mts +1 -0
  297. package/dist/report/host/index.d.ts +1 -0
  298. package/dist/report/host/index.js +8 -2
  299. package/dist/report/host/index.mjs +8 -2
  300. package/dist/report/host/machine.cjs +23 -22
  301. package/dist/report/host/machine.cjs.map +1 -1
  302. package/dist/report/host/machine.d.cts +1 -1
  303. package/dist/report/host/machine.d.mts +1 -1
  304. package/dist/report/host/machine.d.ts +1 -1
  305. package/dist/report/host/node/loader.cjs +4 -2
  306. package/dist/report/host/node/loader.cjs.map +1 -1
  307. package/dist/report/host/node/loader.d.cts +3 -1
  308. package/dist/report/host/node/loader.d.mts +3 -1
  309. package/dist/report/host/node/loader.d.ts +3 -1
  310. package/dist/report/host/node.cjs +44 -9
  311. package/dist/report/host/node.cjs.map +1 -1
  312. package/dist/report/host/node.d.cts +13 -3
  313. package/dist/report/host/node.d.mts +13 -3
  314. package/dist/report/host/node.d.ts +13 -3
  315. package/dist/report/host/node.js +44 -32
  316. package/dist/report/host/operations.cjs +14 -0
  317. package/dist/report/host/operations.cjs.map +1 -0
  318. package/dist/report/host/operations.d.cts +39 -0
  319. package/dist/report/host/operations.d.mts +39 -0
  320. package/dist/report/host/operations.d.ts +39 -0
  321. package/dist/report/host/operations.js +10 -0
  322. package/dist/report/host/operations.js.map +1 -0
  323. package/dist/report/model/chart/plot.cjs +1 -1
  324. package/dist/report/model/chart/plot.cjs.map +1 -1
  325. package/dist/report/model/locale.cjs +4 -0
  326. package/dist/report/model/locale.cjs.map +1 -1
  327. package/dist/report/model/locale.d.cts +3 -1
  328. package/dist/report/model/locale.d.mts +3 -1
  329. package/dist/report/model/locale.d.ts +3 -1
  330. package/dist/report/react/styles.css +80 -0
  331. package/dist/runner/build-preparation.cjs +5 -5
  332. package/dist/runner/build-preparation.cjs.map +1 -1
  333. package/dist/runner/build-preparation.d.cts +2 -3
  334. package/dist/runner/build-preparation.d.mts +2 -3
  335. package/dist/runner/build-preparation.d.ts +2 -3
  336. package/dist/runner/feedback/coordinator.cjs +18 -15
  337. package/dist/runner/feedback/coordinator.cjs.map +1 -1
  338. package/dist/runner/feedback/coordinator.d.cts +6 -0
  339. package/dist/runner/feedback/coordinator.d.mts +6 -0
  340. package/dist/runner/feedback/coordinator.d.ts +6 -0
  341. package/dist/runner/ledger.cjs +3 -13
  342. package/dist/runner/ledger.cjs.map +1 -1
  343. package/dist/runner/ledger.d.cts +1 -3
  344. package/dist/runner/ledger.d.mts +1 -3
  345. package/dist/runner/ledger.d.ts +1 -3
  346. package/dist/runner/run.cjs +63 -18
  347. package/dist/runner/run.cjs.map +1 -1
  348. package/dist/runner/session.cjs +10 -0
  349. package/dist/runner/session.cjs.map +1 -1
  350. package/dist/runner/session.d.cts +25 -0
  351. package/dist/runner/session.d.mts +25 -0
  352. package/dist/runner/session.d.ts +25 -0
  353. package/dist/runner/types.cjs.map +1 -1
  354. package/dist/runner/types.d.cts +1 -2
  355. package/dist/runner/types.d.mts +1 -2
  356. package/dist/runner/types.d.ts +1 -2
  357. package/dist/sandbox/build-coordinator.cjs +38 -19
  358. package/dist/sandbox/build-coordinator.cjs.map +1 -1
  359. package/dist/sandbox/build-coordinator.d.cts +47 -7
  360. package/dist/sandbox/build-coordinator.d.mts +47 -7
  361. package/dist/sandbox/build-coordinator.d.ts +47 -7
  362. package/dist/sandbox/build-coordinator.js +8 -4
  363. package/dist/sandbox/cli/contribution.cjs +128 -0
  364. package/dist/sandbox/cli/contribution.cjs.map +1 -0
  365. package/dist/sandbox/cli/contribution.d.cts +71 -0
  366. package/dist/sandbox/cli/contribution.d.mts +71 -0
  367. package/dist/sandbox/cli/contribution.d.ts +71 -0
  368. package/dist/sandbox/cli/contribution.js +8 -0
  369. package/dist/sandbox/cli/contribution.js.map +1 -0
  370. package/dist/sandbox/cli-commands.cjs +14 -21
  371. package/dist/sandbox/cli-commands.cjs.map +1 -1
  372. package/dist/sandbox/cli-commands.d.cts +12 -8
  373. package/dist/sandbox/cli-commands.d.mts +12 -8
  374. package/dist/sandbox/cli-commands.d.ts +12 -8
  375. package/dist/sandbox/compose.cjs +22 -2
  376. package/dist/sandbox/compose.cjs.map +1 -1
  377. package/dist/sandbox/compose.d.cts +1 -1
  378. package/dist/sandbox/compose.d.mts +1 -1
  379. package/dist/sandbox/compose.d.ts +1 -1
  380. package/dist/sandbox/docker-profile/cli.cjs +13 -9
  381. package/dist/sandbox/docker-profile/cli.cjs.map +1 -1
  382. package/dist/sandbox/docker-profile/cli.d.cts +2 -0
  383. package/dist/sandbox/docker-profile/cli.d.mts +2 -0
  384. package/dist/sandbox/docker-profile/cli.d.ts +2 -0
  385. package/dist/sandbox/docker-profile/runtime.cjs +68 -7
  386. package/dist/sandbox/docker-profile/runtime.cjs.map +1 -1
  387. package/dist/sandbox/docker-profile/runtime.d.cts +19 -1
  388. package/dist/sandbox/docker-profile/runtime.d.mts +19 -1
  389. package/dist/sandbox/docker-profile/runtime.d.ts +19 -1
  390. package/dist/sandbox/docker-profile/runtime.js +10 -8
  391. package/dist/sandbox/docker-profile/schema.cjs +68 -19
  392. package/dist/sandbox/docker-profile/schema.cjs.map +1 -1
  393. package/dist/sandbox/docker-profile/schema.d.cts +23 -9
  394. package/dist/sandbox/docker-profile/schema.d.mts +23 -9
  395. package/dist/sandbox/docker-profile/schema.d.ts +23 -9
  396. package/dist/sandbox/docker-task-build-cache.cjs +532 -0
  397. package/dist/sandbox/docker-task-build-cache.cjs.map +1 -0
  398. package/dist/sandbox/docker-task-build-cache.d.cts +68 -0
  399. package/dist/sandbox/docker-task-build-cache.d.mts +68 -0
  400. package/dist/sandbox/docker-task-build-cache.d.ts +68 -0
  401. package/dist/sandbox/docker-task-build-cache.js +20 -0
  402. package/dist/sandbox/docker-task-build-cache.js.map +1 -0
  403. package/dist/sandbox/docker.cjs +50 -0
  404. package/dist/sandbox/docker.cjs.map +1 -1
  405. package/dist/sandbox/docker.d.cts +15 -0
  406. package/dist/sandbox/docker.d.mts +15 -0
  407. package/dist/sandbox/docker.d.ts +15 -0
  408. package/dist/sandbox/dockerfile-build.cjs +55 -5
  409. package/dist/sandbox/dockerfile-build.cjs.map +1 -1
  410. package/dist/sandbox/dockerfile-build.d.cts +2 -2
  411. package/dist/sandbox/dockerfile-build.d.mts +2 -2
  412. package/dist/sandbox/dockerfile-build.d.ts +2 -2
  413. package/dist/sandbox/index.cjs +5 -3
  414. package/dist/sandbox/index.cjs.map +1 -1
  415. package/dist/sandbox/index.d.cts +4 -3
  416. package/dist/sandbox/index.d.mts +4 -3
  417. package/dist/sandbox/index.d.ts +4 -3
  418. package/dist/sandbox/index.js +16 -14
  419. package/dist/sandbox/index.mjs +16 -14
  420. package/dist/sandbox/keep.cjs +1 -3
  421. package/dist/sandbox/keep.cjs.map +1 -1
  422. package/dist/sandbox/layer.cjs +70 -79
  423. package/dist/sandbox/layer.cjs.map +1 -1
  424. package/dist/sandbox/layer.d.cts +6 -12
  425. package/dist/sandbox/layer.d.mts +6 -12
  426. package/dist/sandbox/layer.d.ts +6 -12
  427. package/dist/sandbox/layer.js +16 -18
  428. package/dist/sandbox/ledger-paths.cjs +4 -18
  429. package/dist/sandbox/ledger-paths.cjs.map +1 -1
  430. package/dist/sandbox/ledger-paths.d.cts +3 -13
  431. package/dist/sandbox/ledger-paths.d.mts +3 -13
  432. package/dist/sandbox/ledger-paths.d.ts +3 -13
  433. package/dist/sandbox/ledger-paths.js +4 -8
  434. package/dist/sandbox/registry.cjs +1 -1
  435. package/dist/sandbox/registry.cjs.map +1 -1
  436. package/dist/sandbox/runtime.cjs +27 -37
  437. package/dist/sandbox/runtime.cjs.map +1 -1
  438. package/dist/sandbox/runtime.d.cts +1 -2
  439. package/dist/sandbox/runtime.d.mts +1 -2
  440. package/dist/sandbox/runtime.d.ts +1 -2
  441. package/dist/sandbox/runtime.js +6 -8
  442. package/dist/sandbox/types.cjs.map +1 -1
  443. package/dist/sandbox/types.d.cts +3 -3
  444. package/dist/sandbox/types.d.mts +3 -3
  445. package/dist/sandbox/types.d.ts +3 -3
  446. package/dist/sources/project.json +6 -0
  447. package/dist/vendor/remark/remark-gfm.cjs +72 -72
  448. package/dist/vendor/remark/remark-gfm.cjs.map +1 -1
  449. package/dist/vendor/remark/remark-parse.cjs +54 -54
  450. package/dist/vendor/remark/remark-parse.cjs.map +1 -1
  451. package/dist/vendor/remark/remark.cjs +125 -125
  452. package/dist/vendor/remark/remark.cjs.map +2 -2
  453. package/docs-site/zh/README.md +1 -1
  454. package/docs-site/zh/explanation/assert.mdx +4 -0
  455. package/docs-site/zh/explanation/judge.mdx +40 -9
  456. package/docs-site/zh/reference/cli.mdx +67 -43
  457. package/docs-site/zh/reference/define-agent.mdx +2 -2
  458. package/docs-site/zh/reference/report-components.mdx +4 -3
  459. package/docs-site/zh/troubleshooting/debug-sandbox.mdx +6 -0
  460. package/docs-site/zh/troubleshooting/debugging.mdx +28 -1
  461. package/docs-site/zh/tutorials/agent-feedback-loop.mdx +4 -2
  462. package/docs-site/zh/tutorials/concurrency.mdx +2 -2
  463. package/docs-site/zh/tutorials/custom-reports.mdx +175 -9
  464. package/docs-site/zh/tutorials/docker-in-docker.mdx +52 -7
  465. package/docs-site/zh/tutorials/eval-groups.mdx +1 -2
  466. package/docs-site/zh/tutorials/evaluation-kinds.mdx +39 -6
  467. package/docs-site/zh/tutorials/nixos-managed-dind.mdx +14 -5
  468. package/docs-site/zh/tutorials/sandbox-providers.mdx +1 -28
  469. package/docs-site/zh/tutorials/sandbox-reuse.mdx +1 -1
  470. package/docs-site/zh/tutorials/viewing-results.mdx +2 -0
  471. package/package.json +24 -19
  472. package/README.md +0 -176
  473. package/README.zh.md +0 -176
  474. package/dist/cli/record.cjs +0 -246
  475. package/dist/cli/record.cjs.map +0 -1
  476. package/dist/cli/record.d.cts +0 -40
  477. package/dist/cli/record.d.mts +0 -40
  478. package/dist/cli/record.d.ts +0 -40
  479. package/dist/cli/record.js +0 -10
  480. package/dist/cli/record.js.map +0 -1
  481. package/dist/sandbox/local.cjs +0 -361
  482. package/dist/sandbox/local.cjs.map +0 -1
  483. package/dist/sandbox/local.d.cts +0 -80
  484. package/dist/sandbox/local.d.mts +0 -80
  485. package/dist/sandbox/local.d.ts +0 -80
  486. package/dist/sandbox/local.js +0 -6
  487. package/dist/sandbox/local.js.map +0 -1
@@ -0,0 +1,835 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.experimentCliContributions = exports.SESSION_CLI_OPTIONS = exports.ACCEPT_CLI_OPTIONS = exports.DEBUG_CLI_OPTIONS = exports.EXP_TEARDOWN_CLI_OPTIONS = exports.EXP_RENAME_CLI_OPTIONS = exports.EXP_LIST_CLI_OPTIONS = exports.EXP_NORMAL_CLI_OPTIONS = exports.CHECK_CLI_OPTIONS = void 0;
4
+ const effect_1 = require("effect");
5
+ const application_ts_1 = require("../../../cli/application.cjs");
6
+ const contribution_ts_1 = require("../../../cli/contribution.cjs");
7
+ const project_configuration_ts_1 = require("../../../cli/project-configuration.cjs");
8
+ const presentation_ts_1 = require("../../../record/host/cli/presentation.cjs");
9
+ const index_ts_1 = require("../../../runner/feedback/index.cjs");
10
+ const session_ts_1 = require("../../../runner/session.cjs");
11
+ const aggregate_ts_1 = require("../../../shared/aggregate.cjs");
12
+ const index_ts_2 = require("../../../i18n/index.cjs");
13
+ const index_ts_3 = require("../index.cjs");
14
+ const terminal_ts_1 = require("./terminal.cjs");
15
+ const option = (type, summary, multiple) => Object.freeze({
16
+ type,
17
+ ...(multiple === undefined ? {} : { multiple }),
18
+ help: Object.freeze({ summary, visibility: "public" }),
19
+ });
20
+ const optionalTier = (summary, defaultValue, values, separated = false) => Object.freeze({
21
+ type: "boolean",
22
+ optionalValue: Object.freeze({
23
+ default: defaultValue,
24
+ ...(separated ? { separated: true } : {}),
25
+ values: Object.freeze([...values]),
26
+ }),
27
+ help: Object.freeze({ summary, visibility: "public" }),
28
+ });
29
+ const HELP_OPTION = Object.freeze({
30
+ type: "boolean",
31
+ short: "h",
32
+ help: Object.freeze({ summary: "Show command help.", visibility: "public" }),
33
+ });
34
+ exports.CHECK_CLI_OPTIONS = Object.freeze({
35
+ tag: option("string", "Select only Evals with this tag."),
36
+ help: HELP_OPTION,
37
+ });
38
+ exports.EXP_NORMAL_CLI_OPTIONS = Object.freeze({
39
+ attempts: option("string", "Run each selected Eval this many times."),
40
+ "max-concurrency": option("string", "Limit concurrent Attempt execution."),
41
+ "max-build-concurrency": option("string", "Limit concurrent Sandbox build preparation."),
42
+ timeout: option("string", "Set the per-Attempt timeout in milliseconds."),
43
+ budget: option("string", "Set the Invocation budget in USD."),
44
+ tag: option("string", "Select only Evals with this tag."),
45
+ junit: option("string", "Write a required JUnit report."),
46
+ json: option("boolean", "Write the command's machine document or event stream."),
47
+ dry: option("boolean", "Plan without creating an Invocation."),
48
+ rerun: optionalTier("Require failed or all targets to run again.", "failed", ["failed", "all"], true),
49
+ "keep-sandbox": optionalTier("Keep failed or all finished Sandboxes.", "failed", ["failed", "all"]),
50
+ "early-exit": option("boolean", "Stop remaining attempts after a passing result."),
51
+ "no-early-exit": option("boolean", "Force all configured attempts to run."),
52
+ record: option("string", "Use this Record root."),
53
+ help: HELP_OPTION,
54
+ });
55
+ exports.EXP_LIST_CLI_OPTIONS = Object.freeze({
56
+ tag: option("string", "Select only Evals with this tag."),
57
+ json: option("boolean", "Write the catalog machine document."),
58
+ help: HELP_OPTION,
59
+ });
60
+ exports.EXP_RENAME_CLI_OPTIONS = Object.freeze({
61
+ dry: option("boolean", "Preview the explicit Experiment rename."),
62
+ json: option("boolean", "Write the rename machine document."),
63
+ help: HELP_OPTION,
64
+ });
65
+ exports.EXP_TEARDOWN_CLI_OPTIONS = Object.freeze({
66
+ teardown: option("boolean", "Run explicit Experiment teardown recovery."),
67
+ json: option("boolean", "Write machine output where the operation supports it."),
68
+ "recover-shared-state": option("string", "Name a shared-state key for explicit recovery."),
69
+ "owner-token": option("string", "Provide the exact shared-state owner token."),
70
+ "confirm-owner-terminated": option("boolean", "Confirm the recorded owner has terminated."),
71
+ "confirm-remote-quiesced": option("boolean", "Confirm remote shared state is quiesced."),
72
+ help: HELP_OPTION,
73
+ });
74
+ exports.DEBUG_CLI_OPTIONS = Object.freeze({
75
+ json: option("boolean", "Write the command-plan machine document."),
76
+ help: HELP_OPTION,
77
+ });
78
+ exports.ACCEPT_CLI_OPTIONS = Object.freeze({
79
+ record: option("string", "Use this Record root."),
80
+ help: HELP_OPTION,
81
+ });
82
+ exports.SESSION_CLI_OPTIONS = Object.freeze({
83
+ all: option("boolean", "Include completed invocation status entries."),
84
+ json: option("boolean", "Write the status machine document."),
85
+ help: HELP_OPTION,
86
+ });
87
+ /** `exp` is a command family; its composition schema is its own frozen union. */
88
+ const EXP_CLI_OPTIONS = Object.freeze({
89
+ ...exports.EXP_NORMAL_CLI_OPTIONS,
90
+ ...exports.EXP_LIST_CLI_OPTIONS,
91
+ ...exports.EXP_RENAME_CLI_OPTIONS,
92
+ ...exports.EXP_TEARDOWN_CLI_OPTIONS,
93
+ });
94
+ const SHARED_STATE_RECOVERY_USAGE = ` niceeval exp <selector> --teardown --recover-shared-state <key>
95
+ --owner-token <token> --confirm-owner-terminated --confirm-remote-quiesced`;
96
+ const CHECK_HELP = `Check Experiment selection:
97
+ niceeval check [<experiment-prefix> [<eval-prefix>...]] [--tag <tag>]
98
+
99
+ Options:
100
+ --tag <tag> select only Evals with this tag
101
+ -h, --help show this help
102
+ `;
103
+ const EXP_HELP = `Run and maintain Experiments:
104
+ niceeval exp [<experiment-prefix> [<eval-prefix>...]] [options]
105
+ niceeval exp list [<experiment-prefix>] [--tag <tag>] [--json]
106
+ niceeval exp rename <old-id> <new-id> [--dry] [--json]
107
+ ${SHARED_STATE_RECOVERY_USAGE}
108
+
109
+ Run options:
110
+ --attempts <n> run each selected Eval this many times
111
+ --max-concurrency <n> limit concurrent Attempt execution
112
+ --max-build-concurrency <n> limit concurrent Sandbox build preparation
113
+ --timeout <ms> set the per-Attempt timeout
114
+ --budget <usd> set the Invocation budget
115
+ --tag <tag> select only Evals with this tag
116
+ --rerun[=failed|all] require selected targets to run again
117
+ --keep-sandbox[=failed|all] retain selected finished Sandboxes
118
+ --early-exit / --no-early-exit
119
+ --dry plan without creating an Invocation
120
+ --json write machine output or the Invocation event stream
121
+ --junit <path> write a required JUnit report
122
+ --record <root> use this Record root
123
+
124
+ Recovery options:
125
+ --teardown run only explicit Experiment teardown recovery
126
+ --recover-shared-state <key> inspect or recover this immutable shared-state owner
127
+ --owner-token <token> provide the exact owner token shown by inspection
128
+ --confirm-owner-terminated confirm the recorded owner has terminated
129
+ --confirm-remote-quiesced confirm remote shared state is quiesced
130
+ -h, --help show this help
131
+ `;
132
+ const DEBUG_HELP = `Inspect one Experiment lifecycle plan:
133
+ niceeval debug <experiment-selector> <eval-selector> [--json]
134
+
135
+ Options:
136
+ --json write the command-plan machine document
137
+ -h, --help show this help
138
+ `;
139
+ const ACCEPT_HELP = `Accept exact historical Attempt locators:
140
+ niceeval accept @<locator>... [--record <root>]
141
+
142
+ Options:
143
+ --record <root> use this Record root
144
+ -h, --help show this help
145
+ `;
146
+ const SESSION_HELP = `Inspect project-local ephemeral Invocation status:
147
+ niceeval session list [--all] [<experiment-prefix>]
148
+ niceeval session show <invocation-id>
149
+
150
+ Options:
151
+ --all include completed Invocation status entries
152
+ --json write the status machine document
153
+ -h, --help show this help
154
+ `;
155
+ const EXP_COMMAND_SUMMARY = `list, plan, run, rename, or recover Experiments
156
+ explicit sharedState recovery:
157
+ ${SHARED_STATE_RECOVERY_USAGE}`;
158
+ function failure(operation, cause, exitCode = 1, display) {
159
+ return new contribution_ts_1.CliFeatureError({
160
+ feature: "experiments",
161
+ operation,
162
+ cause,
163
+ exitCode,
164
+ ...(display === undefined ? {} : { display }),
165
+ });
166
+ }
167
+ function write(channel, text) {
168
+ return effect_1.Effect.flatMap(application_ts_1.CliOutput, (output) => channel === "stdout" ? output.writeStdout(text) : output.writeStderr(text)).pipe(effect_1.Effect.mapError((cause) => failure(`write ${channel}`, cause)));
169
+ }
170
+ function numberFlag(value, name, positive = false) {
171
+ if (value === undefined)
172
+ return undefined;
173
+ if (typeof value !== "string" || !/^[0-9]+(?:\.[0-9]+)?$/u.test(value))
174
+ throw new Error(`${name} requires a number.`);
175
+ const parsed = Number(value);
176
+ if (!Number.isFinite(parsed) || parsed < 0 || (positive && (!Number.isInteger(parsed) || parsed === 0))) {
177
+ throw new Error(positive ? `${name} requires a positive integer.` : `${name} requires a non-negative finite number.`);
178
+ }
179
+ return parsed;
180
+ }
181
+ function enumFlag(value, name, values) {
182
+ if (value === undefined)
183
+ return undefined;
184
+ if (typeof value !== "string" || !values.includes(value))
185
+ throw new Error(`${name} accepts ${values.join(" or ")}.`);
186
+ return value;
187
+ }
188
+ function jsonDocument(value) {
189
+ return `${JSON.stringify(value)}\n`;
190
+ }
191
+ function catalogText(catalog) {
192
+ return catalog.experiments.map((experiment) => [
193
+ experiment.id,
194
+ experiment.description ?? "—",
195
+ experiment.agent,
196
+ experiment.model ?? "—",
197
+ `attempts=${experiment.attempts}`,
198
+ `evals=${experiment.evalIds.length}`,
199
+ `labels=${JSON.stringify(experiment.labels)}`,
200
+ ].join("\t")).join("\n") + (catalog.experiments.length === 0 ? "" : "\n");
201
+ }
202
+ function catalogJson(catalog) {
203
+ return jsonDocument({
204
+ format: "niceeval.experiments",
205
+ schemaVersion: 1,
206
+ experiments: catalog.experiments.map((experiment) => ({
207
+ experimentId: experiment.id,
208
+ ...(experiment.description === undefined ? {} : { description: experiment.description }),
209
+ agent: experiment.agent,
210
+ ...(experiment.model === undefined ? {} : { model: experiment.model }),
211
+ attempts: experiment.attempts,
212
+ evalCount: experiment.evalIds.length,
213
+ labels: experiment.labels,
214
+ selectedEvalIds: experiment.evalIds,
215
+ })),
216
+ });
217
+ }
218
+ function checkText(result) {
219
+ return result.status === "linked"
220
+ ? `Sandbox layers linked: ${result.pairCount} pair${result.pairCount === 1 ? "" : "s"}.\n`
221
+ : `Experiment selection: ${result.status}.\n`;
222
+ }
223
+ function selectionProblemText(result) {
224
+ if (result.status === "experiment-no-match") {
225
+ return (0, index_ts_2.t)("cli.experiment.noMatch", {
226
+ arg: result.selector ?? (0, index_ts_2.t)("cli.all"),
227
+ experiments: (0, aggregate_ts_1.browsableExperimentPaths)(result.candidates ?? []).join(", ") || (0, index_ts_2.t)("cli.none"),
228
+ });
229
+ }
230
+ if (result.status === "eval-no-match") {
231
+ return (0, index_ts_2.t)("cli.experiment.noEvalPrefixMatch", {
232
+ pattern: result.selector ?? "",
233
+ selection: (result.experimentIds ?? []).join(", ") || (0, index_ts_2.t)("cli.all"),
234
+ });
235
+ }
236
+ return (0, index_ts_2.t)("cli.experiment.noEvalsSelected", {
237
+ selection: (result.experimentIds ?? []).join(", ") || (0, index_ts_2.t)("cli.all"),
238
+ experiments: (0, aggregate_ts_1.browsableExperimentPaths)(result.candidates ?? result.experimentIds ?? []).join(", ") || (0, index_ts_2.t)("cli.none"),
239
+ });
240
+ }
241
+ function acceptText(results) {
242
+ return results.map((result) => (0, index_ts_2.t)("cli.accept.done", {
243
+ runId: result.runId,
244
+ sourceLocator: result.sourceLocator,
245
+ locator: result.locator,
246
+ fingerprint: result.fingerprint,
247
+ })).join("");
248
+ }
249
+ function sharedStateEvidenceText(evidence) {
250
+ return (0, index_ts_2.t)("cli.exp.sharedStateRecoveryTarget", {
251
+ key: evidence.key,
252
+ experimentId: evidence.experimentId,
253
+ ownerToken: evidence.ownerToken,
254
+ host: evidence.host,
255
+ pid: evidence.pid,
256
+ processIdentity: evidence.processIdentity,
257
+ heartbeatAt: evidence.heartbeatAt,
258
+ });
259
+ }
260
+ function teardownInspectionEvidence(inspection) {
261
+ return "evidence" in inspection ? inspection.evidence : undefined;
262
+ }
263
+ function teardownInspectionProblemText(inspection) {
264
+ switch (inspection.status) {
265
+ case "no-evidence":
266
+ return `No recoverable sharedState ownership evidence exists for ${JSON.stringify(inspection.key)}.\n`;
267
+ case "selection-not-unique":
268
+ return "sharedState recovery requires an experiment selector that resolves to exactly one Experiment.\n";
269
+ case "experiment-mismatch":
270
+ return `sharedState key ${JSON.stringify(inspection.evidence.key)} belongs to experiment ${inspection.evidence.experimentId}, not ${inspection.selectedExperimentId}; refusing recovery.\n`;
271
+ case "teardown-required":
272
+ return (0, index_ts_2.t)("cli.exp.sharedStateRecoveryTeardownRequired", { experimentId: inspection.experimentId });
273
+ case "recovery-confirmation-required":
274
+ return (0, index_ts_2.t)("cli.exp.sharedStateRecoveryFlags");
275
+ default:
276
+ return undefined;
277
+ }
278
+ }
279
+ function teardownFailure(operation, cause, recoveryKey) {
280
+ const code = typeof cause === "object" && cause !== null && typeof Reflect.get(cause, "code") === "string"
281
+ ? String(Reflect.get(cause, "code"))
282
+ : undefined;
283
+ const message = cause instanceof Error ? cause.message : String(cause);
284
+ const display = code === "shared-state-recovery-registration-failed" && recoveryKey !== undefined
285
+ ? (0, index_ts_2.t)("cli.exp.sharedStateRecoveryRegistrationFailed", { key: recoveryKey, message })
286
+ : code === "shared-state-recovery-already-released-registration-failed" && recoveryKey !== undefined
287
+ ? (0, index_ts_2.t)("cli.exp.sharedStateRecoveryAlreadyReleasedRegistrationFailed", { key: recoveryKey, message })
288
+ : code === "shared-state-recovery-completion-failed"
289
+ ? `sharedState recovery could not release its exact owner token: ${message}\n`
290
+ : recoveryKey === undefined
291
+ ? undefined
292
+ : `sharedState recovery refused: ${message}\n`;
293
+ return failure(operation, cause, 1, display);
294
+ }
295
+ function invocationText(result) {
296
+ return `Invocation ${result.receipt.invocationId} · ${result.receipt.completion}\nRuns: ${result.receipt.runIds.join(", ") || "none"}\nResults: ${result.summary.passed} passed · ${result.summary.failed} failed · ${result.summary.errored} errored · ${result.summary.skipped} skipped\n`;
297
+ }
298
+ function dryRows(plan) {
299
+ const rows = new Map();
300
+ for (const slot of plan.slots) {
301
+ const key = JSON.stringify([slot.target.experimentId, slot.target.evalId]);
302
+ const row = rows.get(key) ?? {
303
+ experimentId: slot.target.experimentId,
304
+ evalId: slot.target.evalId,
305
+ ...(slot.target.evalGroupId === undefined ? {} : { evalGroupId: slot.target.evalGroupId, evalGroupIndex: slot.target.evalGroupIndex }),
306
+ slots: [],
307
+ readbacks: [],
308
+ };
309
+ row.slots.push({
310
+ ...slot.target,
311
+ state: slot.state === "reuse" ? "reused" : "gap",
312
+ comparisons: slot.comparisons,
313
+ ...(slot.state === "gap" ? { reason: slot.reason, scope: slot.scope } : {}),
314
+ });
315
+ if (plan.lockedPairs.includes(key))
316
+ row.locked = true;
317
+ rows.set(key, row);
318
+ }
319
+ for (const readback of plan.readbacks) {
320
+ const key = JSON.stringify([readback.target.experimentId, readback.target.evalId]);
321
+ const row = rows.get(key) ?? { experimentId: readback.target.experimentId, evalId: readback.target.evalId, slots: [], readbacks: [] };
322
+ row.readbacks.push(readback);
323
+ if (plan.lockedPairs.includes(key))
324
+ row.locked = true;
325
+ rows.set(key, row);
326
+ }
327
+ return [...rows.values()].map((row) => ({
328
+ ...row,
329
+ slots: [...row.slots].sort((left, right) => left.attempt - right.attempt),
330
+ readbacks: [...row.readbacks].sort((left, right) => left.target.attempt - right.target.attempt),
331
+ })).sort((left, right) => left.experimentId.localeCompare(right.experimentId) || left.evalId.localeCompare(right.evalId));
332
+ }
333
+ function dryText(plan, shape, pluginCount) {
334
+ const rows = dryRows(plan);
335
+ const reused = plan.slots.filter((slot) => slot.state === "reuse").length;
336
+ const lines = [
337
+ `plan: ${shape.totalAttempts} attempts · ${shape.evals} evals × ${shape.configurations} configs · runs ${shape.attempts}`,
338
+ ...(reused === 0 ? [] : [`reuse: ${reused}/${shape.totalAttempts} exact current Record attempts`]),
339
+ `plugins: ${pluginCount} lifecycle occurrences`,
340
+ ];
341
+ for (const row of rows) {
342
+ const slots = row.slots;
343
+ const reusedAttempts = slots.filter((slot) => slot.state === "reused").map((slot) => slot.attempt);
344
+ const gaps = slots.filter((slot) => slot.state === "gap");
345
+ const parts = [
346
+ ...(row.locked ? ["locked"] : []),
347
+ ...(reusedAttempts.length === 0 ? [] : [`reused ${reusedAttempts.join(",")}`]),
348
+ ...gaps.map((slot) => `gap ${slot.attempt}:${slot.reason ?? "unknown"}`),
349
+ ];
350
+ lines.push(`${row.experimentId} ${row.evalId} ${parts.join(" · ") || "no slots"}`);
351
+ const hasIdentityGap = gaps.some((slot) => slot.reason === "identity-mismatch");
352
+ for (const readback of row.readbacks) {
353
+ const verdict = readback.state === "reused"
354
+ ? readback.verdict
355
+ : readback.verdict.state === "available"
356
+ ? readback.verdict.value
357
+ : readback.verdict.state;
358
+ lines.push(` source ${readback.source.locator} · ${readback.state} · verdict ${verdict}`);
359
+ if (hasIdentityGap && readback.state === "prior")
360
+ lines.push(` accept: niceeval accept ${readback.source.locator}`);
361
+ }
362
+ }
363
+ return `${lines.join("\n")}\n`;
364
+ }
365
+ function dryJson(plan, shape, plugins) {
366
+ return jsonDocument({
367
+ format: "niceeval.current-reuse-plan/v1",
368
+ schemaVersion: 1,
369
+ total: shape.totalAttempts,
370
+ evals: shape.evals,
371
+ configs: shape.configurations,
372
+ attempts: shape.attempts,
373
+ reused: plan.slots.filter((slot) => slot.state === "reuse").length,
374
+ matrix: dryRows(plan),
375
+ plugins,
376
+ });
377
+ }
378
+ const RENAME_REASON_MESSAGE = {
379
+ "source-empty": "cli.rename.error.sourceEmpty",
380
+ "target-not-found": "cli.rename.error.targetNotFound",
381
+ "target-has-results": "cli.rename.error.targetHasResults",
382
+ "source-unreadable": "cli.rename.error.sourceUnreadable",
383
+ "artifact-unavailable": "cli.rename.error.artifactUnavailable",
384
+ "nothing-to-migrate": "cli.rename.error.nothingToMigrate",
385
+ };
386
+ function renameText(result) {
387
+ if (result.status === "done") {
388
+ const lines = [
389
+ (0, index_ts_2.t)("cli.rename.doneHeader", { oldId: result.oldId, newId: result.newId, count: result.migrated.length }),
390
+ (0, index_ts_2.t)("cli.rename.snapshotPath", { path: result.snapshotPath }),
391
+ ...result.migrated.map((entry) => (0, index_ts_2.t)("cli.rename.doneRow", {
392
+ evalId: entry.evalId,
393
+ sourceLocator: entry.sourceLocator,
394
+ locator: entry.locator,
395
+ })),
396
+ ];
397
+ return `${lines.join("\n")}\n`;
398
+ }
399
+ if (result.status === "rejected") {
400
+ const lines = [(0, index_ts_2.t)(RENAME_REASON_MESSAGE[result.reason], {
401
+ oldId: result.oldId,
402
+ newId: result.newId,
403
+ evalId: result.evalId ?? "",
404
+ })];
405
+ if ((result.conflictingEvals?.length ?? 0) > 0) {
406
+ lines.push((0, index_ts_2.t)("cli.rename.conflicting", { evals: result.conflictingEvals.join(", ") }));
407
+ }
408
+ return `${lines.join("\n")}\n`;
409
+ }
410
+ const lines = [(0, index_ts_2.t)("cli.rename.previewHeader", { oldId: result.oldId, newId: result.newId })];
411
+ if (result.blocked !== undefined) {
412
+ lines.push((0, index_ts_2.t)("cli.rename.blocked", { reason: result.blocked.reason }));
413
+ lines.push(...(result.blocked.conflictingEvals ?? []).map((evalId) => ` ${evalId}`));
414
+ if (result.blocked.detail !== undefined)
415
+ lines.push(` ${result.blocked.detail}`);
416
+ }
417
+ if (result.migrations.length > 0) {
418
+ lines.push((0, index_ts_2.t)("cli.rename.migratingHeader", { count: result.migrations.length }));
419
+ lines.push(...result.migrations.map((entry) => (0, index_ts_2.t)("cli.rename.migratingRow", {
420
+ evalId: entry.evalId,
421
+ sourceLocator: entry.sourceLocator,
422
+ newId: result.newId,
423
+ })));
424
+ }
425
+ if (result.excluded.length > 0) {
426
+ lines.push((0, index_ts_2.t)("cli.rename.excludedHeader", { count: result.excluded.length }));
427
+ lines.push(...result.excluded.map((entry) => (0, index_ts_2.t)("cli.rename.excludedRow", { evalId: entry.evalId, reason: entry.reason })));
428
+ }
429
+ return `${lines.join("\n")}\n`;
430
+ }
431
+ function renameJson(result) {
432
+ return jsonDocument({ format: "niceeval.experimentRename", schemaVersion: 1, ...result });
433
+ }
434
+ function parsed(argv, options) {
435
+ return effect_1.Effect.flatMap(application_ts_1.CliArguments, (argumentsService) => effect_1.Effect.try({
436
+ try: () => argumentsService.parse(argv, options),
437
+ catch: (cause) => failure("parse command", cause),
438
+ }));
439
+ }
440
+ function factsAndConfig() {
441
+ return effect_1.Effect.gen(function* () {
442
+ const facts = yield* application_ts_1.CliInvocationFacts;
443
+ const invocation = yield* facts.facts.pipe(effect_1.Effect.mapError((cause) => failure("read invocation facts", cause)));
444
+ const project = yield* project_configuration_ts_1.ProjectConfiguration;
445
+ const config = yield* project.load(invocation.cwd).pipe(effect_1.Effect.mapError((cause) => failure("load config", cause)));
446
+ return Object.freeze({ invocation, config });
447
+ });
448
+ }
449
+ function selection(positionals) {
450
+ const [experimentSelector, ...evalSelectors] = positionals;
451
+ return Object.freeze({
452
+ ...(experimentSelector === undefined ? {} : { experimentSelector }),
453
+ ...(evalSelectors.length === 0 ? {} : { evalSelectors: Object.freeze(evalSelectors) }),
454
+ });
455
+ }
456
+ function overrides(values) {
457
+ const attempts = numberFlag(values.attempts, "--attempts", true);
458
+ const timeoutMs = numberFlag(values.timeout, "--timeout");
459
+ const budget = numberFlag(values.budget, "--budget");
460
+ const maxConcurrency = numberFlag(values["max-concurrency"], "--max-concurrency", true);
461
+ const maxBuildConcurrency = numberFlag(values["max-build-concurrency"], "--max-build-concurrency", true);
462
+ const rerun = enumFlag(values.rerun, "--rerun", ["failed", "all"]);
463
+ const keepSandbox = enumFlag(values["keep-sandbox"], "--keep-sandbox", ["failed", "all"]);
464
+ return Object.freeze({
465
+ ...(attempts === undefined ? {} : { attempts }),
466
+ ...(timeoutMs === undefined ? {} : { timeoutMs }),
467
+ ...(budget === undefined ? {} : { budget }),
468
+ ...(maxConcurrency === undefined ? {} : { maxConcurrency }),
469
+ ...(maxBuildConcurrency === undefined ? {} : { maxBuildConcurrency }),
470
+ ...(rerun === undefined ? {} : { rerun: rerun }),
471
+ ...(keepSandbox === undefined ? {} : { keepSandbox: keepSandbox }),
472
+ ...(values["no-early-exit"] === true ? { earlyExit: false } : values["early-exit"] === true ? { earlyExit: true } : {}),
473
+ });
474
+ }
475
+ const checkCommand = Object.freeze({
476
+ name: "check",
477
+ summary: "check Experiment and Sandbox selection",
478
+ options: exports.CHECK_CLI_OPTIONS,
479
+ run: (argv) => effect_1.Effect.gen(function* () {
480
+ const input = yield* parsed(argv, exports.CHECK_CLI_OPTIONS);
481
+ if (input.values.help === true)
482
+ return yield* write("stdout", CHECK_HELP).pipe(effect_1.Effect.as(0));
483
+ const { invocation, config } = yield* factsAndConfig();
484
+ const result = yield* index_ts_3.experimentHost.check({ cwd: invocation.cwd, config, ...selection(input.positionals) }).pipe(effect_1.Effect.mapError((cause) => failure("check", cause)));
485
+ if (result.status !== "linked") {
486
+ yield* write("stderr", selectionProblemText(result));
487
+ return 1;
488
+ }
489
+ yield* write("stdout", checkText(result));
490
+ return 0;
491
+ }),
492
+ });
493
+ const expCommand = Object.freeze({
494
+ name: "exp",
495
+ summary: EXP_COMMAND_SUMMARY,
496
+ options: EXP_CLI_OPTIONS,
497
+ run: (argv) => effect_1.Effect.gen(function* () {
498
+ // First parse only determines the family branch. The second, branch-owned
499
+ // schema rejects irrelevant flags before facts, config, or .env are read.
500
+ const preliminary = yield* parsed(argv, EXP_CLI_OPTIONS);
501
+ const teardownMode = preliminary.values.teardown === true;
502
+ const preliminaryVerb = preliminary.positionals[0];
503
+ if (preliminaryVerb === "help" && preliminary.positionals.length === 1) {
504
+ return yield* write("stdout", EXP_HELP).pipe(effect_1.Effect.as(0));
505
+ }
506
+ const input = yield* parsed(argv, teardownMode
507
+ ? exports.EXP_TEARDOWN_CLI_OPTIONS
508
+ : preliminaryVerb === "list"
509
+ ? exports.EXP_LIST_CLI_OPTIONS
510
+ : preliminaryVerb === "rename"
511
+ ? exports.EXP_RENAME_CLI_OPTIONS
512
+ : exports.EXP_NORMAL_CLI_OPTIONS);
513
+ if (input.values.help === true)
514
+ return yield* write("stdout", EXP_HELP).pipe(effect_1.Effect.as(0));
515
+ const [verb, ...rest] = input.positionals;
516
+ const facts = yield* application_ts_1.CliInvocationFacts;
517
+ const invocation = yield* facts.facts.pipe(effect_1.Effect.mapError((cause) => failure("read invocation facts", cause)));
518
+ if (teardownMode) {
519
+ const project = yield* project_configuration_ts_1.ProjectConfiguration;
520
+ yield* project.load(invocation.cwd).pipe(effect_1.Effect.mapError((cause) => failure("load config", cause)));
521
+ if (typeof input.values["recover-shared-state"] === "string" && input.values.json === true) {
522
+ yield* write("stderr", (0, index_ts_2.t)("cli.exp.sharedStateRecoveryJsonUnsupported"));
523
+ return 1;
524
+ }
525
+ if (input.positionals.length > 1) {
526
+ return yield* write("stderr", "niceeval exp --teardown accepts at most one Experiment selector.\n").pipe(effect_1.Effect.as(1));
527
+ }
528
+ const selector = input.positionals[0];
529
+ const recoveryKey = typeof input.values["recover-shared-state"] === "string"
530
+ ? input.values["recover-shared-state"]
531
+ : undefined;
532
+ const inspection = yield* index_ts_3.experimentHost.teardown.inspect({
533
+ cwd: invocation.cwd,
534
+ currentHost: invocation.hostname,
535
+ ...(selector === undefined ? {} : { experimentSelector: selector }),
536
+ ...(recoveryKey === undefined ? {} : { recoveryKey }),
537
+ }).pipe(effect_1.Effect.mapError((cause) => failure("inspect teardown", cause)));
538
+ if (inspection.status === "experiment-no-match" || inspection.status === "eval-no-match" || inspection.status === "empty-selection") {
539
+ yield* write("stderr", selectionProblemText(inspection));
540
+ return 1;
541
+ }
542
+ const evidence = teardownInspectionEvidence(inspection);
543
+ if (evidence !== undefined)
544
+ yield* write("stderr", sharedStateEvidenceText(evidence));
545
+ if (inspection.status === "no-evidence" ||
546
+ inspection.status === "selection-not-unique" ||
547
+ inspection.status === "experiment-mismatch") {
548
+ yield* write("stderr", teardownInspectionProblemText(inspection));
549
+ return 1;
550
+ }
551
+ // Recovery evidence is deliberately available before confirmations. This
552
+ // preserves the after-kill operator flow while keeping the normal
553
+ // teardown path free of Record migration and Invocation construction.
554
+ if (recoveryKey !== undefined && (typeof input.values["owner-token"] !== "string" ||
555
+ input.values["confirm-owner-terminated"] !== true ||
556
+ input.values["confirm-remote-quiesced"] !== true)) {
557
+ yield* write("stderr", (0, index_ts_2.t)("cli.exp.sharedStateRecoveryFlags"));
558
+ return 1;
559
+ }
560
+ if (inspection.status === "teardown-required") {
561
+ yield* write("stderr", teardownInspectionProblemText(inspection));
562
+ return 1;
563
+ }
564
+ const interruption = yield* application_ts_1.CliInterruption;
565
+ const output = yield* application_ts_1.CliOutput;
566
+ const result = yield* index_ts_3.experimentHost.teardown.run({
567
+ cwd: invocation.cwd,
568
+ currentHost: invocation.hostname,
569
+ ...(selector === undefined ? {} : { experimentSelector: selector }),
570
+ ...(recoveryKey === undefined ? {} : { recoveryKey }),
571
+ ...(typeof input.values["owner-token"] === "string" ? { ownerToken: input.values["owner-token"] } : {}),
572
+ ...(input.values["confirm-owner-terminated"] === true ? { confirmOwnerTerminated: true } : {}),
573
+ ...(input.values["confirm-remote-quiesced"] === true ? { confirmRemoteQuiesced: true } : {}),
574
+ signal: interruption.invocationSignal,
575
+ observer: Object.freeze({
576
+ observe(event) {
577
+ if (event.type === "diagnostic")
578
+ output.writeStderrSync(`${event.message}\n`);
579
+ },
580
+ }),
581
+ }).pipe(effect_1.Effect.mapError((cause) => teardownFailure("run teardown", cause, recoveryKey)));
582
+ if (result.status === "completed") {
583
+ for (const experiment of result.experiments) {
584
+ if (experiment.outcome === "succeeded") {
585
+ yield* write("stderr", (0, index_ts_2.t)("cli.exp.teardownDone", { experimentId: experiment.experimentId }));
586
+ }
587
+ else if (experiment.outcome === "failed") {
588
+ yield* write("stderr", (0, index_ts_2.t)("cli.exp.teardownFailed", {
589
+ experimentId: experiment.experimentId,
590
+ message: experiment.error ?? "unknown",
591
+ }));
592
+ }
593
+ }
594
+ }
595
+ else if (result.status === "recovered" || result.status === "already-released") {
596
+ if (result.status === "recovered") {
597
+ yield* write("stderr", (0, index_ts_2.t)("cli.exp.teardownDone", { experimentId: result.experimentId }));
598
+ }
599
+ if (result.status === "already-released")
600
+ yield* write("stderr", (0, index_ts_2.t)("cli.exp.sharedStateRecoveryAlreadyReleased", { key: result.key }));
601
+ yield* write("stderr", (0, index_ts_2.t)("runner.sharedStateExplicitRecovered", {
602
+ key: result.key,
603
+ experimentId: result.experimentId,
604
+ ownerToken: result.ownerToken,
605
+ }));
606
+ }
607
+ else if (result.status === "recovery-teardown-failed") {
608
+ yield* write("stderr", (0, index_ts_2.t)("cli.exp.teardownFailed", {
609
+ experimentId: result.evidence.experimentId,
610
+ message: result.error,
611
+ }));
612
+ }
613
+ else {
614
+ const changedEvidence = teardownInspectionEvidence(result);
615
+ if (changedEvidence !== undefined)
616
+ yield* write("stderr", sharedStateEvidenceText(changedEvidence));
617
+ const problem = teardownInspectionProblemText(result);
618
+ if (problem !== undefined)
619
+ yield* write("stderr", problem);
620
+ }
621
+ return result.status === "completed" || result.status === "recovered" || result.status === "already-released" ? 0 : 1;
622
+ }
623
+ if (verb === "list") {
624
+ if (rest.length > 1)
625
+ return yield* write("stderr", "niceeval exp list accepts at most one experiment prefix.\n").pipe(effect_1.Effect.as(1));
626
+ const project = yield* project_configuration_ts_1.ProjectConfiguration;
627
+ yield* project.load(invocation.cwd).pipe(effect_1.Effect.mapError((cause) => failure("load config", cause)));
628
+ const result = yield* index_ts_3.experimentHost.catalog({ cwd: invocation.cwd, ...selection(rest), ...(typeof input.values.tag === "string" ? { tag: input.values.tag } : {}) }).pipe(effect_1.Effect.mapError((cause) => failure("list", cause)));
629
+ if (result.experiments.length === 0 && rest[0] !== undefined) {
630
+ yield* write("stderr", (0, index_ts_2.t)("cli.experiment.noMatch", {
631
+ arg: rest[0],
632
+ experiments: (0, aggregate_ts_1.browsableExperimentPaths)(result.experimentIds).join(", ") || (0, index_ts_2.t)("cli.none"),
633
+ }));
634
+ return 1;
635
+ }
636
+ yield* write("stdout", input.values.json === true ? catalogJson(result) : catalogText(result));
637
+ return 0;
638
+ }
639
+ if (verb === "rename") {
640
+ const [oldId, newId] = rest;
641
+ if (oldId === undefined || newId === undefined || rest.length !== 2)
642
+ return yield* write("stderr", "usage: niceeval exp rename <old-id> <new-id>\n").pipe(effect_1.Effect.as(1));
643
+ const renameInput = { cwd: invocation.cwd, oldId, newId };
644
+ const result = input.values.dry === true
645
+ ? yield* index_ts_3.experimentHost.rename.plan(renameInput).pipe(effect_1.Effect.mapError((cause) => failure("plan rename", cause)))
646
+ : yield* index_ts_3.experimentHost.rename.apply(renameInput).pipe(effect_1.Effect.mapError((cause) => failure("rename", cause)));
647
+ yield* write("stdout", input.values.json === true ? renameJson(result) : renameText(result));
648
+ return result.status === "rejected" || (result.status === "plan" && result.blocked !== undefined) ? 1 : 0;
649
+ }
650
+ const project = yield* project_configuration_ts_1.ProjectConfiguration;
651
+ const config = yield* project.load(invocation.cwd).pipe(effect_1.Effect.mapError((cause) => failure("load config", cause)));
652
+ const plan = yield* index_ts_3.experimentHost.invocation.plan({
653
+ cwd: invocation.cwd,
654
+ config,
655
+ ...selection(input.positionals),
656
+ ...(typeof input.values.tag === "string" ? { tag: input.values.tag } : {}),
657
+ ...(typeof input.values.record === "string" ? { recordRoot: input.values.record } : {}),
658
+ overrides: overrides(input.values),
659
+ preview: input.values.dry === true,
660
+ }).pipe(effect_1.Effect.mapError((cause) => failure("plan invocation", cause, 1, (0, presentation_ts_1.renderAutomaticMigrationFailure)(cause))));
661
+ const migrationNotice = (0, presentation_ts_1.renderAutomaticMigrationResult)(plan.automaticMigration);
662
+ if (migrationNotice !== undefined)
663
+ yield* write("stderr", migrationNotice);
664
+ if (plan.status !== "ready") {
665
+ yield* write("stderr", selectionProblemText(plan));
666
+ return 1;
667
+ }
668
+ if (input.values.dry === true) {
669
+ if (plan.dry === undefined)
670
+ return yield* effect_1.Effect.fail(failure("preview invocation", new Error("Experiment Host did not return the requested dry plan.")));
671
+ yield* write("stdout", input.values.json === true
672
+ ? dryJson(plan.dry, plan.shape, plan.pluginAudit.occurrences)
673
+ : dryText(plan.dry, plan.shape, plan.pluginAudit.occurrences.length));
674
+ return 0;
675
+ }
676
+ const interruption = yield* application_ts_1.CliInterruption;
677
+ if (!(yield* effect_1.Effect.sync(interruption.enterGracefulDispatch)))
678
+ return yield* effect_1.Effect.interrupt;
679
+ const terminal = yield* terminal_ts_1.ExperimentCliTerminal;
680
+ const profile = (0, index_ts_1.resolveOutputForm)({
681
+ json: input.values.json === true,
682
+ isTTY: invocation.stderr.isTTY,
683
+ });
684
+ const renderer = profile === "human"
685
+ ? (0, index_ts_1.createHumanRenderer)({
686
+ io: terminal.feedback,
687
+ command: ["niceeval", "exp", ...input.positionals].join(" ").trim(),
688
+ })
689
+ : (0, index_ts_1.createJsonRenderer)({ io: terminal.feedback });
690
+ const coordinator = (0, index_ts_1.createFeedbackCoordinator)({
691
+ profile,
692
+ renderer,
693
+ io: terminal.feedback,
694
+ // Experiment Host installs one lossless multiplexing sink for feedback
695
+ // and the project-local Session observer.
696
+ activateSink: false,
697
+ });
698
+ const outcome = yield* effect_1.Effect.either(effect_1.Effect.scoped(effect_1.Effect.gen(function* () {
699
+ yield* effect_1.Effect.acquireRelease(effect_1.Effect.sync(() => (0, index_ts_1.createInputGuard)({
700
+ stdin: terminal.stdin,
701
+ stderrIsTTY: terminal.feedback.stderr.isTTY,
702
+ coordinator,
703
+ onInterrupt: interruption.requestInterrupt,
704
+ })), (guard) => effect_1.Effect.sync(guard.stop));
705
+ return yield* index_ts_3.experimentHost.invocation.run({
706
+ plan: plan.plan,
707
+ signal: interruption.invocationSignal,
708
+ feedback: Object.freeze({ coordinator }),
709
+ ...(typeof input.values.junit === "string" ? { junitPath: input.values.junit } : {}),
710
+ });
711
+ })));
712
+ if (effect_1.Either.isLeft(outcome)) {
713
+ if (outcome.left.code === "runner-record-assertions-invalid") {
714
+ yield* write("stderr", `error: ${outcome.left.message}\n`);
715
+ return 1;
716
+ }
717
+ return yield* effect_1.Effect.fail(failure("run invocation", outcome.left));
718
+ }
719
+ const result = outcome.right;
720
+ if (result.exitCode === undefined) {
721
+ return yield* effect_1.Effect.fail(failure("finish invocation feedback", new Error("Experiment Host returned without the requested presentation exit fold.")));
722
+ }
723
+ return result.exitCode;
724
+ }),
725
+ });
726
+ const debugCommand = Object.freeze({
727
+ name: "debug",
728
+ summary: "show one Experiment lifecycle plan",
729
+ options: exports.DEBUG_CLI_OPTIONS,
730
+ run: (argv) => effect_1.Effect.gen(function* () {
731
+ const input = yield* parsed(argv, exports.DEBUG_CLI_OPTIONS);
732
+ if (input.values.help === true)
733
+ return yield* write("stdout", DEBUG_HELP).pipe(effect_1.Effect.as(0));
734
+ const [experimentSelector, evalSelector] = input.positionals;
735
+ if (experimentSelector === undefined || evalSelector === undefined || input.positionals.length !== 2) {
736
+ return yield* write("stderr", (0, index_ts_2.t)("cli.debug.usage")).pipe(effect_1.Effect.as(1));
737
+ }
738
+ const { invocation, config } = yield* factsAndConfig();
739
+ const result = yield* index_ts_3.experimentHost.debug({ cwd: invocation.cwd, config, experimentSelector, evalSelector }).pipe(effect_1.Effect.mapError((cause) => failure("debug", cause)));
740
+ switch (result.status) {
741
+ case "experiment-no-match":
742
+ yield* write("stderr", (0, index_ts_2.t)("cli.debug.experimentNoMatch", {
743
+ selector: result.selector,
744
+ candidates: result.candidates.join(", ") || (0, index_ts_2.t)("cli.none"),
745
+ }));
746
+ return 1;
747
+ case "experiment-ambiguous":
748
+ yield* write("stderr", (0, index_ts_2.t)("cli.debug.experimentAmbiguous", {
749
+ selector: result.selector,
750
+ candidates: result.candidates.join(", "),
751
+ }));
752
+ return 1;
753
+ case "eval-no-match":
754
+ yield* write("stderr", (0, index_ts_2.t)("cli.debug.evalNoMatch", {
755
+ selector: result.selector,
756
+ experimentId: result.experimentId,
757
+ candidates: result.candidates.join(", ") || (0, index_ts_2.t)("cli.none"),
758
+ }));
759
+ return 1;
760
+ case "eval-ambiguous":
761
+ yield* write("stderr", (0, index_ts_2.t)("cli.debug.evalAmbiguous", {
762
+ selector: result.selector,
763
+ experimentId: result.experimentId,
764
+ candidates: result.candidates.join(", "),
765
+ }));
766
+ return 1;
767
+ case "planned":
768
+ yield* write("stdout", input.values.json === true
769
+ ? jsonDocument({
770
+ format: "niceeval.debug-plan/v1",
771
+ schemaVersion: 1,
772
+ experimentId: result.experimentId,
773
+ evalId: result.evalId,
774
+ commandPlan: result.commandPlan,
775
+ })
776
+ : (0, index_ts_1.renderHumanCommandPlan)(result.commandPlan, {
777
+ isTTY: invocation.stdout.isTTY,
778
+ noColor: invocation.noColor,
779
+ width: invocation.stdout.columns,
780
+ }));
781
+ return 0;
782
+ }
783
+ }),
784
+ });
785
+ const acceptCommand = Object.freeze({
786
+ name: "accept",
787
+ summary: "accept exact historical Attempt locators",
788
+ options: exports.ACCEPT_CLI_OPTIONS,
789
+ run: (argv) => effect_1.Effect.gen(function* () {
790
+ const input = yield* parsed(argv, exports.ACCEPT_CLI_OPTIONS);
791
+ if (input.values.help === true)
792
+ return yield* write("stdout", ACCEPT_HELP).pipe(effect_1.Effect.as(0));
793
+ if (input.positionals.length === 0)
794
+ return yield* write("stderr", "usage: niceeval accept @<locator>...\n").pipe(effect_1.Effect.as(1));
795
+ const { invocation, config } = yield* factsAndConfig();
796
+ const result = yield* index_ts_3.experimentHost.accept({ cwd: invocation.cwd, config, locators: Object.freeze(input.positionals), ...(typeof input.values.record === "string" ? { recordRoot: input.values.record } : {}) }).pipe(effect_1.Effect.mapError((cause) => failure("accept", cause, 1, (0, index_ts_2.t)("cli.accept.failed", {
797
+ error: cause.message,
798
+ }))));
799
+ yield* write("stdout", acceptText(result));
800
+ return 0;
801
+ }),
802
+ });
803
+ const sessionCommand = Object.freeze({
804
+ name: "session",
805
+ summary: "inspect project-local ephemeral Invocation status",
806
+ options: exports.SESSION_CLI_OPTIONS,
807
+ run: (argv) => effect_1.Effect.gen(function* () {
808
+ const input = yield* parsed(argv, exports.SESSION_CLI_OPTIONS);
809
+ if (input.values.help === true)
810
+ return yield* write("stdout", SESSION_HELP).pipe(effect_1.Effect.as(0));
811
+ const [verb = "list", value] = input.positionals;
812
+ const facts = yield* application_ts_1.CliInvocationFacts;
813
+ const invocation = yield* facts.facts.pipe(effect_1.Effect.mapError((cause) => failure("read invocation facts", cause)));
814
+ if (verb === "list") {
815
+ const result = yield* index_ts_3.experimentHost.invocationStatus.list({ cwd: invocation.cwd, ...(input.values.all === true ? { all: true } : {}), ...(value === undefined ? {} : { experimentSelector: value }) }).pipe(effect_1.Effect.mapError((cause) => failure("list invocation status", cause)));
816
+ yield* write("stdout", input.values.json === true ? jsonDocument(result) : (0, session_ts_1.renderSessionListText)(result, Date.now(), input.values.all === true));
817
+ return 0;
818
+ }
819
+ if (verb === "show" && value !== undefined && input.positionals.length === 2) {
820
+ const result = yield* index_ts_3.experimentHost.invocationStatus.show({ cwd: invocation.cwd, invocationSelector: value }).pipe(effect_1.Effect.mapError((cause) => failure("show invocation status", cause)));
821
+ yield* write("stdout", input.values.json === true ? jsonDocument(result) : (0, session_ts_1.renderSessionShowText)(result));
822
+ return 0;
823
+ }
824
+ return yield* write("stderr", "usage: niceeval session [list [<experiment-prefix>] | show <invocation-id>]\n").pipe(effect_1.Effect.as(1));
825
+ }),
826
+ });
827
+ /** The composition root receives frozen feature values; it never registers services. */
828
+ exports.experimentCliContributions = Object.freeze([
829
+ checkCommand,
830
+ expCommand,
831
+ debugCommand,
832
+ acceptCommand,
833
+ sessionCommand,
834
+ ]);
835
+ //# sourceMappingURL=contribution.cjs.map