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
@@ -244,7 +244,7 @@ export declare const FileChangesAttachmentSchema: Schema.filter<Schema.Struct<{
244
244
  readonly state: "partial";
245
245
  readonly limitations: readonly [{
246
246
  readonly code: "capture-failed" | "capture-interrupted";
247
- readonly stage: "normalize" | "export" | "checkpoint" | "finalizer-export";
247
+ readonly stage: "normalize" | "checkpoint" | "export" | "finalizer-export";
248
248
  readonly atWindowId: string | null;
249
249
  } | {
250
250
  readonly code: "collection-cap-reached";
@@ -257,7 +257,7 @@ export declare const FileChangesAttachmentSchema: Schema.filter<Schema.Struct<{
257
257
  readonly omittedAtLeast: number;
258
258
  }, ...({
259
259
  readonly code: "capture-failed" | "capture-interrupted";
260
- readonly stage: "normalize" | "export" | "checkpoint" | "finalizer-export";
260
+ readonly stage: "normalize" | "checkpoint" | "export" | "finalizer-export";
261
261
  readonly atWindowId: string | null;
262
262
  } | {
263
263
  readonly code: "collection-cap-reached";
@@ -276,7 +276,7 @@ export declare const FileChangesAttachmentSchema: Schema.filter<Schema.Struct<{
276
276
  readonly state: "partial";
277
277
  readonly limitations: readonly [{
278
278
  readonly code: "capture-failed" | "capture-interrupted";
279
- readonly stage: "normalize" | "export" | "checkpoint" | "finalizer-export";
279
+ readonly stage: "normalize" | "checkpoint" | "export" | "finalizer-export";
280
280
  readonly atWindowId: string | null;
281
281
  } | {
282
282
  readonly code: "collection-cap-reached";
@@ -289,7 +289,7 @@ export declare const FileChangesAttachmentSchema: Schema.filter<Schema.Struct<{
289
289
  readonly omittedAtLeast: number;
290
290
  }, ...({
291
291
  readonly code: "capture-failed" | "capture-interrupted";
292
- readonly stage: "normalize" | "export" | "checkpoint" | "finalizer-export";
292
+ readonly stage: "normalize" | "checkpoint" | "export" | "finalizer-export";
293
293
  readonly atWindowId: string | null;
294
294
  } | {
295
295
  readonly code: "collection-cap-reached";
@@ -449,7 +449,7 @@ export declare const fileChangesRecordAttachment: import("../definition/attachme
449
449
  readonly state: "partial";
450
450
  readonly limitations: readonly [{
451
451
  readonly code: "capture-failed" | "capture-interrupted";
452
- readonly stage: "normalize" | "export" | "checkpoint" | "finalizer-export";
452
+ readonly stage: "normalize" | "checkpoint" | "export" | "finalizer-export";
453
453
  readonly atWindowId: string | null;
454
454
  } | {
455
455
  readonly code: "collection-cap-reached";
@@ -462,7 +462,7 @@ export declare const fileChangesRecordAttachment: import("../definition/attachme
462
462
  readonly omittedAtLeast: number;
463
463
  }, ...({
464
464
  readonly code: "capture-failed" | "capture-interrupted";
465
- readonly stage: "normalize" | "export" | "checkpoint" | "finalizer-export";
465
+ readonly stage: "normalize" | "checkpoint" | "export" | "finalizer-export";
466
466
  readonly atWindowId: string | null;
467
467
  } | {
468
468
  readonly code: "collection-cap-reached";
@@ -481,7 +481,7 @@ export declare const fileChangesRecordAttachment: import("../definition/attachme
481
481
  readonly state: "partial";
482
482
  readonly limitations: readonly [{
483
483
  readonly code: "capture-failed" | "capture-interrupted";
484
- readonly stage: "normalize" | "export" | "checkpoint" | "finalizer-export";
484
+ readonly stage: "normalize" | "checkpoint" | "export" | "finalizer-export";
485
485
  readonly atWindowId: string | null;
486
486
  } | {
487
487
  readonly code: "collection-cap-reached";
@@ -494,7 +494,7 @@ export declare const fileChangesRecordAttachment: import("../definition/attachme
494
494
  readonly omittedAtLeast: number;
495
495
  }, ...({
496
496
  readonly code: "capture-failed" | "capture-interrupted";
497
- readonly stage: "normalize" | "export" | "checkpoint" | "finalizer-export";
497
+ readonly stage: "normalize" | "checkpoint" | "export" | "finalizer-export";
498
498
  readonly atWindowId: string | null;
499
499
  } | {
500
500
  readonly code: "collection-cap-reached";
@@ -0,0 +1,206 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateCliCommand = exports.cleanCliCommand = exports.RECORD_MAINTENANCE_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 root_ts_1 = require("../../platform/root.cjs");
8
+ const runtime_ts_1 = require("../runtime.cjs");
9
+ const presentation_ts_1 = require("./presentation.cjs");
10
+ exports.RECORD_MAINTENANCE_CLI_OPTIONS = Object.freeze({
11
+ record: Object.freeze({
12
+ type: "string",
13
+ help: Object.freeze({
14
+ summary: "Use a specific NiceEval record root.",
15
+ visibility: "public",
16
+ }),
17
+ }),
18
+ yes: Object.freeze({
19
+ type: "boolean",
20
+ help: Object.freeze({
21
+ summary: "Confirm the planned Record maintenance operation.",
22
+ visibility: "public",
23
+ }),
24
+ }),
25
+ help: Object.freeze({
26
+ type: "boolean",
27
+ short: "h",
28
+ help: Object.freeze({
29
+ summary: "Print help for this Record maintenance command.",
30
+ visibility: "public",
31
+ }),
32
+ }),
33
+ });
34
+ const CLEAN_HELP = `niceeval clean — delete incomplete Record Runs
35
+
36
+ Usage:
37
+ niceeval clean [--record <root>] [--yes]
38
+
39
+ Options:
40
+ --record <root> use a specific NiceEval Record root
41
+ --yes confirm deletion of the listed incomplete Runs
42
+ -h, --help print this help
43
+ `;
44
+ const MIGRATE_HELP = `niceeval migrate — migrate a Record through fixed adjacent steps
45
+
46
+ Usage:
47
+ niceeval migrate [--record <root>] [--yes]
48
+
49
+ Options:
50
+ --record <root> use a specific NiceEval Record root
51
+ --yes confirm application of the displayed migration plan
52
+ -h, --help print this help
53
+ `;
54
+ function assertNever(value) {
55
+ throw new Error(`Unreachable Record CLI contribution value: ${String(value)}`);
56
+ }
57
+ function recordCliFailure(command, operation, cause) {
58
+ return new contribution_ts_1.CliFeatureError({
59
+ feature: `record ${command}`,
60
+ operation,
61
+ cause,
62
+ exitCode: 1,
63
+ });
64
+ }
65
+ function write(command, channel, text) {
66
+ return effect_1.Effect.flatMap(application_ts_1.CliOutput, (output) => channel === "stdout" ? output.writeStdout(text) : output.writeStderr(text)).pipe(effect_1.Effect.mapError((cause) => recordCliFailure(command, `write ${channel}`, cause)));
67
+ }
68
+ function recordRootErrorCode(error) {
69
+ switch (error.code) {
70
+ case "record-root-empty":
71
+ case "record-root-relative":
72
+ case "record-root-non-file-url":
73
+ case "record-root-file-url-invalid":
74
+ return error.code;
75
+ }
76
+ }
77
+ function parseRecordCommand(command, argv) {
78
+ return effect_1.Effect.gen(function* () {
79
+ const parser = yield* application_ts_1.CliArguments;
80
+ const parsed = yield* effect_1.Effect.try({
81
+ try: () => parser.parse(argv, exports.RECORD_MAINTENANCE_CLI_OPTIONS),
82
+ catch: (cause) => recordCliFailure(command, "parse command", cause),
83
+ });
84
+ if (parsed.values.help === true) {
85
+ yield* write(command, "stdout", command === "clean" ? CLEAN_HELP : MIGRATE_HELP);
86
+ return 0;
87
+ }
88
+ if (parsed.positionals.length > 0) {
89
+ yield* write(command, "stderr", `niceeval ${command} does not accept positional arguments.\n`);
90
+ return 1;
91
+ }
92
+ const invocation = yield* application_ts_1.CliInvocationFacts;
93
+ const facts = yield* invocation.facts.pipe(effect_1.Effect.mapError((cause) => recordCliFailure(command, "read invocation facts", cause)));
94
+ const path = yield* application_ts_1.CliPath;
95
+ const rootPath = path.resolve(facts.cwd, typeof parsed.values.record === "string" ? parsed.values.record : ".niceeval/record");
96
+ const root = (0, root_ts_1.makeRecordRoot)(rootPath);
97
+ if (effect_1.Either.isLeft(root)) {
98
+ yield* write(command, "stderr", `${recordRootErrorCode(root.left)}\n`);
99
+ return 1;
100
+ }
101
+ return Object.freeze({ rootPath, root: root.right, yes: parsed.values.yes === true });
102
+ });
103
+ }
104
+ function emitMaintenanceFailure(command, failure, recordPath) {
105
+ return write(command, "stderr", (0, presentation_ts_1.renderRecordMaintenanceFailure)(failure, recordPath)).pipe(effect_1.Effect.as(1));
106
+ }
107
+ function runClean(input) {
108
+ return effect_1.Effect.gen(function* () {
109
+ const planned = yield* effect_1.Effect.either(runtime_ts_1.recordHost.maintenance.planClean({ root: input.root }));
110
+ if (effect_1.Either.isLeft(planned))
111
+ return yield* emitMaintenanceFailure("clean", planned.left, input.rootPath);
112
+ const plan = planned.right;
113
+ switch (plan._tag) {
114
+ case "RecordCleanAlreadyClean":
115
+ yield* write("clean", "stdout", "No incomplete Runs found.\n");
116
+ return 0;
117
+ case "RecordCleanConfirmationRequired": {
118
+ const listed = plan.runIds.map((runId) => ` ${runId}`).join("\n");
119
+ if (!input.yes) {
120
+ yield* write("clean", "stdout", `Incomplete Runs:\n${listed}\n`);
121
+ yield* write("clean", "stderr", "record-clean-confirmation-required\nReview the listed Runs and rerun with --yes.\n");
122
+ return 1;
123
+ }
124
+ const applied = yield* effect_1.Effect.either(runtime_ts_1.recordHost.maintenance.applyClean({
125
+ root: input.root,
126
+ plan,
127
+ }));
128
+ if (effect_1.Either.isLeft(applied))
129
+ return yield* emitMaintenanceFailure("clean", applied.left, input.rootPath);
130
+ const lines = ["Cleaned incomplete Runs:"];
131
+ if (applied.right.deleted.length === 0)
132
+ lines.push(" deleted: none");
133
+ else
134
+ lines.push(...applied.right.deleted.map((runId) => ` deleted: ${runId}`));
135
+ lines.push(...applied.right.skipped.map((runId) => ` skipped complete: ${runId}`));
136
+ yield* write("clean", "stdout", `${lines.join("\n")}\n`);
137
+ return 0;
138
+ }
139
+ default:
140
+ return assertNever(plan);
141
+ }
142
+ });
143
+ }
144
+ function runMigrate(input) {
145
+ return effect_1.Effect.gen(function* () {
146
+ const planned = yield* effect_1.Effect.either(runtime_ts_1.recordHost.maintenance.planMigrate({ root: input.root }));
147
+ if (effect_1.Either.isLeft(planned))
148
+ return yield* emitMaintenanceFailure("migrate", planned.left, input.rootPath);
149
+ const plan = planned.right;
150
+ const planText = (0, presentation_ts_1.renderMigrationPlan)(plan);
151
+ switch (plan._tag) {
152
+ case "RecordMigrationAlreadyCurrent":
153
+ yield* write("migrate", "stdout", `${planText}Record migration already-current.\n`);
154
+ return 0;
155
+ case "RecordMigrationUnsupported":
156
+ yield* write("migrate", "stdout", planText);
157
+ yield* write("migrate", "stderr", "record-format-unsupported\nInstall a NiceEval version that supports this Record format.\n");
158
+ return 1;
159
+ case "RecordMigrationRestoreRequired":
160
+ yield* write("migrate", "stdout", planText);
161
+ yield* write("migrate", "stderr", "record-migration-git-restore-required\nA clean Git restore point is required; --yes cannot bypass this preflight.\n");
162
+ return 1;
163
+ case "RecordMigrationReady": {
164
+ yield* write("migrate", "stdout", planText);
165
+ if (!input.yes) {
166
+ yield* write("migrate", "stderr", "record-migration-confirmation-required\nReview the migration plan and rerun with --yes.\n");
167
+ return 1;
168
+ }
169
+ const applied = yield* effect_1.Effect.either(runtime_ts_1.recordHost.maintenance.applyMigrate({
170
+ root: input.root,
171
+ plan,
172
+ }));
173
+ if (effect_1.Either.isLeft(applied))
174
+ return yield* emitMaintenanceFailure("migrate", applied.left, input.rootPath);
175
+ switch (applied.right._tag) {
176
+ case "RecordMigrationAlreadyCurrent":
177
+ yield* write("migrate", "stdout", "Record migration already-current.\n");
178
+ return 0;
179
+ case "RecordMigrationApplied":
180
+ yield* write("migrate", "stdout", "Record migration migrated.\n");
181
+ return 0;
182
+ default:
183
+ return assertNever(applied.right);
184
+ }
185
+ }
186
+ default:
187
+ return assertNever(plan);
188
+ }
189
+ });
190
+ }
191
+ function makeRecordCliCommand(command, summary, execute) {
192
+ return Object.freeze({
193
+ name: command,
194
+ summary,
195
+ options: exports.RECORD_MAINTENANCE_CLI_OPTIONS,
196
+ run: (argv) => effect_1.Effect.gen(function* () {
197
+ const parsed = yield* parseRecordCommand(command, argv);
198
+ if (typeof parsed === "number")
199
+ return parsed;
200
+ return yield* execute(parsed);
201
+ }),
202
+ });
203
+ }
204
+ exports.cleanCliCommand = makeRecordCliCommand("clean", "delete incomplete Record Runs", runClean);
205
+ exports.migrateCliCommand = makeRecordCliCommand("migrate", "migrate a Record through fixed adjacent steps", runMigrate);
206
+ //# sourceMappingURL=contribution.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contribution.js","sourceRoot":"","sources":["contribution.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AACxC,gEAA8H;AAC9H,kEAA6F;AAE7F,oDAA4G;AAE5G,8CAA2C;AAE3C,uDAAyF;AAC5E,QAAA,8BAA8B,GAAG,MAAM,CAAC,MAAM,CAAC;IACxD,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;QAClB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,sCAAsC;YAC/C,UAAU,EAAE,QAAQ;SACvB,CAAC;KACL,CAAC;IACF,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,mDAAmD;YAC5D,UAAU,EAAE,QAAQ;SACvB,CAAC;KACL,CAAC;IACF,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV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,CAAC,CAAC;wBACzE,OAAO,CAAC,CAAC;oBACb,KAAK,wBAAwB;wBACzB,KAAK,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,QAAQ,EAAE,8BAA8B,CAAC,CAAC;wBAClE,OAAO,CAAC,CAAC;oBACb;wBACI,OAAO,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBAC1C,CAAC;YACL,CAAC;YACD;gBACI,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AACD,SAAS,oBAAoB,CAAI,OAA4B,EAAE,OAAe,EAAE,OAA6F;IACzK,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,OAAO;QACb,OAAO;QACP,OAAO,EAAE,sCAA8B;QACvC,GAAG,EAAE,CAAC,IAAuB,EAAE,EAAE,CAAC,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;YAClD,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACxD,IAAI,OAAO,MAAM,KAAK,QAAQ;gBAC1B,OAAO,MAAM,CAAC;YAClB,OAAO,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAClC,CAAC,CAAC;KACL,CAAC,CAAC;AACP,CAAC;AACY,QAAA,eAAe,GAAG,oBAAoB,CAAC,OAAO,EAAE,+BAA+B,EAAE,QAAQ,CAAC,CAAC;AAC3F,QAAA,iBAAiB,GAAG,oBAAoB,CAAC,SAAS,EAAE,+CAA+C,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import { Effect, Either } from \"effect\";\nimport { CliArguments, CliInvocationFacts, CliOutput, CliPath, type CliOptionDefinition, } from \"../../../cli/application.ts\";\nimport { CliFeatureError, type CliCommandContribution, } from \"../../../cli/contribution.ts\";\nimport { RecordCoordination } from \"../../../coordination/record-leases.ts\";\nimport { makeRecordRoot, type RecordRoot, type RecordRootConstructionError, } from \"../../platform/root.ts\";\nimport { RecordFileSystem, RecordGit } from \"../../platform/services.ts\";\nimport { recordHost } from \"../runtime.ts\";\nimport type { RecordCleanOperationPlan, RecordMaintenanceOperationFailure, RecordMigrateOperationPlan, } from \"../types.ts\";\nimport { renderMigrationPlan, renderRecordMaintenanceFailure, } from \"./presentation.ts\";\nexport const RECORD_MAINTENANCE_CLI_OPTIONS = Object.freeze({\n record: Object.freeze({\n type: \"string\",\n help: Object.freeze({\n summary: \"Use a specific NiceEval record root.\",\n visibility: \"public\",\n }),\n }),\n yes: Object.freeze({\n type: \"boolean\",\n help: Object.freeze({\n summary: \"Confirm the planned Record maintenance operation.\",\n visibility: \"public\",\n }),\n }),\n help: Object.freeze({\n type: \"boolean\",\n short: \"h\",\n help: Object.freeze({\n summary: \"Print help for this Record maintenance command.\",\n visibility: \"public\",\n }),\n }),\n} satisfies Readonly<Record<string, CliOptionDefinition>>);\nconst CLEAN_HELP = `niceeval clean — delete incomplete Record Runs\n\nUsage:\n niceeval clean [--record <root>] [--yes]\n\nOptions:\n --record <root> use a specific NiceEval Record root\n --yes confirm deletion of the listed incomplete Runs\n -h, --help print this help\n`;\nconst MIGRATE_HELP = `niceeval migrate — migrate a Record through fixed adjacent steps\n\nUsage:\n niceeval migrate [--record <root>] [--yes]\n\nOptions:\n --record <root> use a specific NiceEval Record root\n --yes confirm application of the displayed migration plan\n -h, --help print this help\n`;\ntype RecordCliBaseRequirement = CliArguments | CliInvocationFacts | CliOutput | CliPath;\ntype RecordCliError = CliFeatureError;\nfunction assertNever(value: never): never {\n throw new Error(`Unreachable Record CLI contribution value: ${String(value)}`);\n}\nfunction recordCliFailure(command: \"clean\" | \"migrate\", operation: string, cause: unknown): RecordCliError {\n return new CliFeatureError({\n feature: `record ${command}`,\n operation,\n cause,\n exitCode: 1,\n });\n}\nfunction write(command: \"clean\" | \"migrate\", channel: \"stdout\" | \"stderr\", text: string): Effect.Effect<void, RecordCliError, CliOutput> {\n return Effect.flatMap(CliOutput, (output) => channel === \"stdout\" ? output.writeStdout(text) : output.writeStderr(text)).pipe(Effect.mapError((cause) => recordCliFailure(command, `write ${channel}`, cause)));\n}\nfunction recordRootErrorCode(error: RecordRootConstructionError): string {\n switch (error.code) {\n case \"record-root-empty\":\n case \"record-root-relative\":\n case \"record-root-non-file-url\":\n case \"record-root-file-url-invalid\":\n return error.code;\n }\n}\ninterface ParsedRecordCommand {\n readonly rootPath: string;\n readonly root: RecordRoot;\n readonly yes: boolean;\n}\nfunction parseRecordCommand(command: \"clean\" | \"migrate\", argv: readonly string[]): Effect.Effect<ParsedRecordCommand | number, RecordCliError, CliArguments | CliInvocationFacts | CliOutput | CliPath> {\n return Effect.gen(function* () {\n const parser = yield* CliArguments;\n const parsed = yield* Effect.try({\n try: () => parser.parse(argv, RECORD_MAINTENANCE_CLI_OPTIONS),\n catch: (cause) => recordCliFailure(command, \"parse command\", cause),\n });\n if (parsed.values.help === true) {\n yield* write(command, \"stdout\", command === \"clean\" ? CLEAN_HELP : MIGRATE_HELP);\n return 0;\n }\n if (parsed.positionals.length > 0) {\n yield* write(command, \"stderr\", `niceeval ${command} does not accept positional arguments.\\n`);\n return 1;\n }\n const invocation = yield* CliInvocationFacts;\n const facts = yield* invocation.facts.pipe(Effect.mapError((cause) => recordCliFailure(command, \"read invocation facts\", cause)));\n const path = yield* CliPath;\n const rootPath = path.resolve(facts.cwd, typeof parsed.values.record === \"string\" ? parsed.values.record : \".niceeval/record\");\n const root = makeRecordRoot(rootPath);\n if (Either.isLeft(root)) {\n yield* write(command, \"stderr\", `${recordRootErrorCode(root.left)}\\n`);\n return 1;\n }\n return Object.freeze({ rootPath, root: root.right, yes: parsed.values.yes === true });\n });\n}\nfunction emitMaintenanceFailure(command: \"clean\" | \"migrate\", failure: RecordMaintenanceOperationFailure, recordPath: string): Effect.Effect<number, RecordCliError, CliOutput> {\n return write(command, \"stderr\", renderRecordMaintenanceFailure(failure, recordPath)).pipe(Effect.as(1));\n}\nfunction runClean(input: ParsedRecordCommand): Effect.Effect<number, RecordCliError, CliOutput | RecordCoordination | RecordFileSystem> {\n return Effect.gen(function* () {\n const planned = yield* Effect.either(recordHost.maintenance.planClean({ root: input.root }));\n if (Either.isLeft(planned))\n return yield* emitMaintenanceFailure(\"clean\", planned.left, input.rootPath);\n const plan: RecordCleanOperationPlan = planned.right;\n switch (plan._tag) {\n case \"RecordCleanAlreadyClean\":\n yield* write(\"clean\", \"stdout\", \"No incomplete Runs found.\\n\");\n return 0;\n case \"RecordCleanConfirmationRequired\": {\n const listed = plan.runIds.map((runId) => ` ${runId}`).join(\"\\n\");\n if (!input.yes) {\n yield* write(\"clean\", \"stdout\", `Incomplete Runs:\\n${listed}\\n`);\n yield* write(\"clean\", \"stderr\", \"record-clean-confirmation-required\\nReview the listed Runs and rerun with --yes.\\n\");\n return 1;\n }\n const applied = yield* Effect.either(recordHost.maintenance.applyClean({\n root: input.root,\n plan,\n }));\n if (Either.isLeft(applied))\n return yield* emitMaintenanceFailure(\"clean\", applied.left, input.rootPath);\n const lines = [\"Cleaned incomplete Runs:\"];\n if (applied.right.deleted.length === 0)\n lines.push(\" deleted: none\");\n else\n lines.push(...applied.right.deleted.map((runId) => ` deleted: ${runId}`));\n lines.push(...applied.right.skipped.map((runId) => ` skipped complete: ${runId}`));\n yield* write(\"clean\", \"stdout\", `${lines.join(\"\\n\")}\\n`);\n return 0;\n }\n default:\n return assertNever(plan);\n }\n });\n}\nfunction runMigrate(input: ParsedRecordCommand): Effect.Effect<number, RecordCliError, CliOutput | RecordCoordination | RecordFileSystem | RecordGit> {\n return Effect.gen(function* () {\n const planned = yield* Effect.either(recordHost.maintenance.planMigrate({ root: input.root }));\n if (Either.isLeft(planned))\n return yield* emitMaintenanceFailure(\"migrate\", planned.left, input.rootPath);\n const plan: RecordMigrateOperationPlan = planned.right;\n const planText = renderMigrationPlan(plan);\n switch (plan._tag) {\n case \"RecordMigrationAlreadyCurrent\":\n yield* write(\"migrate\", \"stdout\", `${planText}Record migration already-current.\\n`);\n return 0;\n case \"RecordMigrationUnsupported\":\n yield* write(\"migrate\", \"stdout\", planText);\n yield* write(\"migrate\", \"stderr\", \"record-format-unsupported\\nInstall a NiceEval version that supports this Record format.\\n\");\n return 1;\n case \"RecordMigrationRestoreRequired\":\n yield* write(\"migrate\", \"stdout\", planText);\n yield* write(\"migrate\", \"stderr\", \"record-migration-git-restore-required\\nA clean Git restore point is required; --yes cannot bypass this preflight.\\n\");\n return 1;\n case \"RecordMigrationReady\": {\n yield* write(\"migrate\", \"stdout\", planText);\n if (!input.yes) {\n yield* write(\"migrate\", \"stderr\", \"record-migration-confirmation-required\\nReview the migration plan and rerun with --yes.\\n\");\n return 1;\n }\n const applied = yield* Effect.either(recordHost.maintenance.applyMigrate({\n root: input.root,\n plan,\n }));\n if (Either.isLeft(applied))\n return yield* emitMaintenanceFailure(\"migrate\", applied.left, input.rootPath);\n switch (applied.right._tag) {\n case \"RecordMigrationAlreadyCurrent\":\n yield* write(\"migrate\", \"stdout\", \"Record migration already-current.\\n\");\n return 0;\n case \"RecordMigrationApplied\":\n yield* write(\"migrate\", \"stdout\", \"Record migration migrated.\\n\");\n return 0;\n default:\n return assertNever(applied.right);\n }\n }\n default:\n return assertNever(plan);\n }\n });\n}\nfunction makeRecordCliCommand<R>(command: \"clean\" | \"migrate\", summary: string, execute: (input: ParsedRecordCommand) => Effect.Effect<number, RecordCliError, CliOutput | R>): CliCommandContribution<RecordCliBaseRequirement | R, RecordCliError> {\n return Object.freeze({\n name: command,\n summary,\n options: RECORD_MAINTENANCE_CLI_OPTIONS,\n run: (argv: readonly string[]) => Effect.gen(function* () {\n const parsed = yield* parseRecordCommand(command, argv);\n if (typeof parsed === \"number\")\n return parsed;\n return yield* execute(parsed);\n }),\n });\n}\nexport const cleanCliCommand = makeRecordCliCommand(\"clean\", \"delete incomplete Record Runs\", runClean);\nexport const migrateCliCommand = makeRecordCliCommand(\"migrate\", \"migrate a Record through fixed adjacent steps\", runMigrate);\n"]}
@@ -0,0 +1,32 @@
1
+ import { CliArguments, CliInvocationFacts, CliOutput, CliPath } from "../../../cli/application.cjs";
2
+ import { CliFeatureError, type CliCommandContribution } from "../../../cli/contribution.cjs";
3
+ import { RecordCoordination } from "../../../coordination/record-leases.cjs";
4
+ import { RecordFileSystem, RecordGit } from "../../platform/services.cjs";
5
+ export declare const RECORD_MAINTENANCE_CLI_OPTIONS: Readonly<{
6
+ record: Readonly<{
7
+ type: "string";
8
+ help: Readonly<{
9
+ summary: "Use a specific NiceEval record root.";
10
+ visibility: "public";
11
+ }>;
12
+ }>;
13
+ yes: Readonly<{
14
+ type: "boolean";
15
+ help: Readonly<{
16
+ summary: "Confirm the planned Record maintenance operation.";
17
+ visibility: "public";
18
+ }>;
19
+ }>;
20
+ help: Readonly<{
21
+ type: "boolean";
22
+ short: "h";
23
+ help: Readonly<{
24
+ summary: "Print help for this Record maintenance command.";
25
+ visibility: "public";
26
+ }>;
27
+ }>;
28
+ }>;
29
+ type RecordCliBaseRequirement = CliArguments | CliInvocationFacts | CliOutput | CliPath;
30
+ export declare const cleanCliCommand: CliCommandContribution<RecordCoordination | RecordFileSystem | RecordCliBaseRequirement, CliFeatureError>;
31
+ export declare const migrateCliCommand: CliCommandContribution<RecordCoordination | RecordFileSystem | RecordGit | RecordCliBaseRequirement, CliFeatureError>;
32
+ export {};
@@ -0,0 +1,32 @@
1
+ import { CliArguments, CliInvocationFacts, CliOutput, CliPath } from "../../../cli/application.mjs";
2
+ import { CliFeatureError, type CliCommandContribution } from "../../../cli/contribution.mjs";
3
+ import { RecordCoordination } from "../../../coordination/record-leases.mjs";
4
+ import { RecordFileSystem, RecordGit } from "../../platform/services.mjs";
5
+ export declare const RECORD_MAINTENANCE_CLI_OPTIONS: Readonly<{
6
+ record: Readonly<{
7
+ type: "string";
8
+ help: Readonly<{
9
+ summary: "Use a specific NiceEval record root.";
10
+ visibility: "public";
11
+ }>;
12
+ }>;
13
+ yes: Readonly<{
14
+ type: "boolean";
15
+ help: Readonly<{
16
+ summary: "Confirm the planned Record maintenance operation.";
17
+ visibility: "public";
18
+ }>;
19
+ }>;
20
+ help: Readonly<{
21
+ type: "boolean";
22
+ short: "h";
23
+ help: Readonly<{
24
+ summary: "Print help for this Record maintenance command.";
25
+ visibility: "public";
26
+ }>;
27
+ }>;
28
+ }>;
29
+ type RecordCliBaseRequirement = CliArguments | CliInvocationFacts | CliOutput | CliPath;
30
+ export declare const cleanCliCommand: CliCommandContribution<RecordCoordination | RecordFileSystem | RecordCliBaseRequirement, CliFeatureError>;
31
+ export declare const migrateCliCommand: CliCommandContribution<RecordCoordination | RecordFileSystem | RecordGit | RecordCliBaseRequirement, CliFeatureError>;
32
+ export {};
@@ -0,0 +1,32 @@
1
+ import { CliArguments, CliInvocationFacts, CliOutput, CliPath } from "../../../cli/application.js";
2
+ import { CliFeatureError, type CliCommandContribution } from "../../../cli/contribution.js";
3
+ import { RecordCoordination } from "../../../coordination/record-leases.js";
4
+ import { RecordFileSystem, RecordGit } from "../../platform/services.js";
5
+ export declare const RECORD_MAINTENANCE_CLI_OPTIONS: Readonly<{
6
+ record: Readonly<{
7
+ type: "string";
8
+ help: Readonly<{
9
+ summary: "Use a specific NiceEval record root.";
10
+ visibility: "public";
11
+ }>;
12
+ }>;
13
+ yes: Readonly<{
14
+ type: "boolean";
15
+ help: Readonly<{
16
+ summary: "Confirm the planned Record maintenance operation.";
17
+ visibility: "public";
18
+ }>;
19
+ }>;
20
+ help: Readonly<{
21
+ type: "boolean";
22
+ short: "h";
23
+ help: Readonly<{
24
+ summary: "Print help for this Record maintenance command.";
25
+ visibility: "public";
26
+ }>;
27
+ }>;
28
+ }>;
29
+ type RecordCliBaseRequirement = CliArguments | CliInvocationFacts | CliOutput | CliPath;
30
+ export declare const cleanCliCommand: CliCommandContribution<RecordCoordination | RecordFileSystem | RecordCliBaseRequirement, CliFeatureError>;
31
+ export declare const migrateCliCommand: CliCommandContribution<RecordCoordination | RecordFileSystem | RecordGit | RecordCliBaseRequirement, CliFeatureError>;
32
+ export {};
@@ -0,0 +1,10 @@
1
+ import { createRequire as __niceevalCreateRequire } from "node:module";
2
+ const __niceevalRequire = __niceevalCreateRequire(import.meta.url);
3
+ const __niceevalCanonical = __niceevalRequire("./contribution.cjs");
4
+ const __niceevalExport0 = __niceevalCanonical["RECORD_MAINTENANCE_CLI_OPTIONS"];
5
+ export { __niceevalExport0 as RECORD_MAINTENANCE_CLI_OPTIONS };
6
+ const __niceevalExport1 = __niceevalCanonical["cleanCliCommand"];
7
+ export { __niceevalExport1 as cleanCliCommand };
8
+ const __niceevalExport2 = __niceevalCanonical["migrateCliCommand"];
9
+ export { __niceevalExport2 as migrateCliCommand };
10
+ //# sourceMappingURL=contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contribution.js","sources":[],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RECORD_MAINTENANCE_CLI_OPTIONS = exports.migrateCliCommand = exports.cleanCliCommand = void 0;
4
+ var contribution_ts_1 = require("./contribution.cjs");
5
+ Object.defineProperty(exports, "cleanCliCommand", { enumerable: true, get: function () { return contribution_ts_1.cleanCliCommand; } });
6
+ Object.defineProperty(exports, "migrateCliCommand", { enumerable: true, get: function () { return contribution_ts_1.migrateCliCommand; } });
7
+ Object.defineProperty(exports, "RECORD_MAINTENANCE_CLI_OPTIONS", { enumerable: true, get: function () { return contribution_ts_1.RECORD_MAINTENANCE_CLI_OPTIONS; } });
8
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,qDAAwG;AAA/F,kHAAA,eAAe,OAAA;AAAE,oHAAA,iBAAiB,OAAA;AAAE,iIAAA,8BAA8B,OAAA","sourcesContent":["export { cleanCliCommand, migrateCliCommand, RECORD_MAINTENANCE_CLI_OPTIONS, } from \"./contribution.ts\";\n"]}
@@ -0,0 +1 @@
1
+ export { cleanCliCommand, migrateCliCommand, RECORD_MAINTENANCE_CLI_OPTIONS, } from "./contribution.cjs";
@@ -0,0 +1 @@
1
+ export { cleanCliCommand, migrateCliCommand, RECORD_MAINTENANCE_CLI_OPTIONS, } from "./contribution.mjs";
@@ -0,0 +1 @@
1
+ export { cleanCliCommand, migrateCliCommand, RECORD_MAINTENANCE_CLI_OPTIONS, } from "./contribution.js";
@@ -0,0 +1,10 @@
1
+ import { createRequire as __niceevalCreateRequire } from "node:module";
2
+ const __niceevalRequire = __niceevalCreateRequire(import.meta.url);
3
+ const __niceevalCanonical = __niceevalRequire("./index.cjs");
4
+ const __niceevalExport0 = __niceevalCanonical["RECORD_MAINTENANCE_CLI_OPTIONS"];
5
+ export { __niceevalExport0 as RECORD_MAINTENANCE_CLI_OPTIONS };
6
+ const __niceevalExport1 = __niceevalCanonical["cleanCliCommand"];
7
+ export { __niceevalExport1 as cleanCliCommand };
8
+ const __niceevalExport2 = __niceevalCanonical["migrateCliCommand"];
9
+ export { __niceevalExport2 as migrateCliCommand };
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"names":[],"mappings":""}
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.renderRecordMaintenanceFailure = renderRecordMaintenanceFailure;
4
+ exports.renderAutomaticMigrationFailure = renderAutomaticMigrationFailure;
5
+ exports.renderAutomaticMigrationResult = renderAutomaticMigrationResult;
6
+ exports.renderMigrationPlan = renderMigrationPlan;
7
+ function assertNever(value) {
8
+ throw new Error(`Unreachable Record CLI presentation value: ${String(value)}`);
9
+ }
10
+ function shellQuote(value) {
11
+ return `'${value.replaceAll("'", `'"'"'`)}'`;
12
+ }
13
+ function recoveryCommands(restoreCommit, recordPath) {
14
+ const root = shellQuote(recordPath);
15
+ const commit = shellQuote(restoreCommit);
16
+ const sentinel = shellQuote(`${recordPath}/migration.in-progress`);
17
+ return [
18
+ `Restore command: git -C ${root} restore --source=${commit} --staged --worktree -- .`,
19
+ `Verify command: git -C ${root} diff --quiet ${commit} -- . && git -C ${root} diff --cached --quiet ${commit} -- .`,
20
+ `Clear sentinel after verification: rm -f -- ${sentinel}`,
21
+ ].join("\n") + "\n";
22
+ }
23
+ function renderRecordMaintenanceFailure(failure, recordPath) {
24
+ switch (failure._tag) {
25
+ case "RecordMaintenanceBusy":
26
+ return `${failure.code}\nClose the Record command holding the lock, then retry.\n`;
27
+ case "RecordMigrationInterrupted":
28
+ return `${failure.code}\n${failure.restoreSafe === true
29
+ ? "Restore the complete Record from the recorded Git commit; do not rerun migrate on mixed bytes."
30
+ : "Inspect and preserve concurrent Record edits before choosing a manual recovery; no automatic Git restore command is safe."}\n${failure.restoreSafe === true && failure.restoreCommit !== undefined
31
+ ? recoveryCommands(failure.restoreCommit, recordPath)
32
+ : ""}`;
33
+ case "RecordMigrationPlanStale":
34
+ return `${failure.code}\nReview the new migration plan and rerun migrate.\n`;
35
+ case "RecordMigrationGitRestoreRequired":
36
+ return `${failure.code}\nCommit, restore, or otherwise obtain a clean Git restore point for this Record before migrating.\n`;
37
+ case "RecordMigrationInvalid":
38
+ return `${failure.code}\nRestore the Record from Git before retrying migration.\n`;
39
+ case "RecordMigrationRecoveryRequired":
40
+ return `${failure.code}\n${failure.restoreSafe
41
+ ? "Restore the complete Record from Git before retrying migration."
42
+ : "Inspect and preserve concurrent Record edits before choosing a manual recovery; no automatic Git restore command is safe."}\nCause: ${failure.causeCode}\n${failure.restoreSafe ? recoveryCommands(failure.restoreCommit, recordPath) : ""}`;
43
+ case "RecordFormatUnsupported":
44
+ return `${failure.code}\nInstall a NiceEval version that supports this Record format.\n`;
45
+ case "RecordMigrationRequired":
46
+ return `${failure.code}\nRun: niceeval migrate\n`;
47
+ case "RecordMaintenanceOperationFailed":
48
+ return `${failure.code}\n`;
49
+ default:
50
+ return assertNever(failure);
51
+ }
52
+ }
53
+ function failureCode(value) {
54
+ if (typeof value !== "object" || value === null)
55
+ return undefined;
56
+ const code = Reflect.get(value, "code");
57
+ return typeof code === "string" ? code : undefined;
58
+ }
59
+ /** Shared CLI wording for ordinary-entry automatic migration failures. */
60
+ function renderAutomaticMigrationFailure(error) {
61
+ const code = failureCode(error);
62
+ if (code === "record-auto-migration-git-save-required") {
63
+ return "record-auto-migration-git-save-required\n" +
64
+ "Save every portable Record byte first (for example: git add .niceeval/record && git commit), then retry the same command.\n";
65
+ }
66
+ if (code === "record-maintenance-busy" || code === "record-writer-busy") {
67
+ return `${code}\nClose the command using this Record, then retry.\n`;
68
+ }
69
+ if (code === "record-format-unsupported") {
70
+ return "record-format-unsupported\nUse the NiceEval version that wrote this future or unknown Record format.\n";
71
+ }
72
+ if (code === "record-migration-recovery-required" || code === "record-migration-interrupted") {
73
+ return `${code}\nRestore and verify the complete Record from Git before retrying.\n`;
74
+ }
75
+ return undefined;
76
+ }
77
+ /** Shared CLI notice emitted exactly once after an automatic migration. */
78
+ function renderAutomaticMigrationResult(result) {
79
+ if (result.state !== "migrated")
80
+ return undefined;
81
+ const droppedFacts = [...new Set(result.attachments.flatMap((attachment) => attachment.retention.droppedFacts))];
82
+ const rerunRecommendations = [...new Set(result.attachments.flatMap((attachment) => attachment.retention.rerunRecommendation === null
83
+ ? []
84
+ : [attachment.retention.rerunRecommendation]))];
85
+ return `Record automatically migrated ${result.attachments.length} attachment${result.attachments.length === 1 ? "" : "s"}; restore commit ${result.restoreCommit}.${droppedFacts.length === 0 ? "" : ` Dropped facts: ${droppedFacts.join(", ")}.`}${rerunRecommendations.length === 0 ? "" : ` ${rerunRecommendations.join(" ")}`}\n`;
86
+ }
87
+ function renderMigrationImpact(attachments) {
88
+ return [...new Map(attachments.map((attachment) => {
89
+ const key = `${attachment.family}@${attachment.fromSchemaVersion}->${attachment.toSchemaVersion}`;
90
+ return [key, attachment];
91
+ })).values()].map((attachment) => {
92
+ const retention = attachment.retention;
93
+ const lines = [
94
+ `impact ${attachment.family}@${attachment.fromSchemaVersion}->${attachment.toSchemaVersion}:`,
95
+ ` retained facts: ${retention.retainedFacts.length === 0 ? "none" : retention.retainedFacts.join(", ")}`,
96
+ ` dropped facts: ${retention.droppedFacts.length === 0 ? "none" : retention.droppedFacts.join(", ")}`,
97
+ ];
98
+ if (retention.rerunRecommendation !== null) {
99
+ lines.push(` rerun recommendation: ${retention.rerunRecommendation}`);
100
+ }
101
+ return lines.join("\n");
102
+ }).join("\n");
103
+ }
104
+ function renderMigrationPlan(plan) {
105
+ switch (plan._tag) {
106
+ case "RecordMigrationAlreadyCurrent":
107
+ return `Record migration plan: already-current\nformat: ${plan.format}\n`;
108
+ case "RecordMigrationUnsupported":
109
+ return `Record migration plan: unsupported-format\nformat: ${plan.format}\n`;
110
+ case "RecordMigrationRestoreRequired": {
111
+ const impact = renderMigrationImpact(plan.attachments);
112
+ return `Record migration plan: migration-required\nformat: ${plan.format}\nattachments: ${plan.attachments.length}\n${impact === "" ? "" : `${impact}\n`}backup: ${plan.backup.state}\n`;
113
+ }
114
+ case "RecordMigrationReady": {
115
+ const impact = renderMigrationImpact(plan.attachments);
116
+ return `Record migration plan: migration-required\nformat: ${plan.format}\nattachments: ${plan.attachments.length}\n${impact === "" ? "" : `${impact}\n`}backup: git-restore-point\nrestore commit: ${plan.restoreCommit}\n`;
117
+ }
118
+ default:
119
+ return assertNever(plan);
120
+ }
121
+ }
122
+ //# sourceMappingURL=presentation.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation.js","sourceRoot":"","sources":["presentation.ts"],"names":[],"mappings":";;AAiBA,wEA6BC;AAQD,0EAgBC;AAED,wEAQC;AAkBD,kDAiBC;AAlHD,SAAS,WAAW,CAAC,KAAY;IAC7B,MAAM,IAAI,KAAK,CAAC,8CAA8C,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACnF,CAAC;AACD,SAAS,UAAU,CAAC,KAAa;IAC7B,OAAO,IAAI,KAAK,CAAC,UAAU,C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C9E,KAAK,4BAA4B;YAC7B,OAAO,sDAAsD,IAAI,CAAC,MAAM,IAAI,CAAC;QACjF,KAAK,gCAAgC,CAAC,CAAC,CAAC;YACpC,MAAM,MAAM,GAAG,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACvD,OAAO,sDAAsD,IAAI,CAAC,MAAM,kBAAkB,IAAI,CAAC,WAAW,CAAC,MAAM,KAAK,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,WAAW,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;QAC7L,CAAC;QACD,KAAK,sBAAsB,CAAC,CAAC,CAAC;YAC1B,MAAM,MAAM,GAAG,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACvD,OAAO,sDAAsD,IAAI,CAAC,MAAM,kBAAkB,IAAI,CAAC,WAAW,CAAC,MAAM,KAAK,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,8CAA8C,IAAI,CAAC,aAAa,IAAI,CAAC;QACjO,CAAC;QACD;YACI,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;AACL,CAAC","sourcesContent":["import type { RecordAttachmentMigrationTarget, RecordAutomaticMigrationResult, RecordMaintenanceOperationFailure, RecordMigrateOperationPlan, } from \"../types.ts\";\nfunction assertNever(value: never): never {\n throw new Error(`Unreachable Record CLI presentation value: ${String(value)}`);\n}\nfunction shellQuote(value: string): string {\n return `'${value.replaceAll(\"'\", `'\"'\"'`)}'`;\n}\nfunction recoveryCommands(restoreCommit: string, recordPath: string): string {\n const root = shellQuote(recordPath);\n const commit = shellQuote(restoreCommit);\n const sentinel = shellQuote(`${recordPath}/migration.in-progress`);\n return [\n `Restore command: git -C ${root} restore --source=${commit} --staged --worktree -- .`,\n `Verify command: git -C ${root} diff --quiet ${commit} -- . && git -C ${root} diff --cached --quiet ${commit} -- .`,\n `Clear sentinel after verification: rm -f -- ${sentinel}`,\n ].join(\"\\n\") + \"\\n\";\n}\nexport function renderRecordMaintenanceFailure(failure: RecordMaintenanceOperationFailure, recordPath: string): string {\n switch (failure._tag) {\n case \"RecordMaintenanceBusy\":\n return `${failure.code}\\nClose the Record command holding the lock, then retry.\\n`;\n case \"RecordMigrationInterrupted\":\n return `${failure.code}\\n${failure.restoreSafe === true\n ? \"Restore the complete Record from the recorded Git commit; do not rerun migrate on mixed bytes.\"\n : \"Inspect and preserve concurrent Record edits before choosing a manual recovery; no automatic Git restore command is safe.\"}\\n${failure.restoreSafe === true && failure.restoreCommit !== undefined\n ? recoveryCommands(failure.restoreCommit, recordPath)\n : \"\"}`;\n case \"RecordMigrationPlanStale\":\n return `${failure.code}\\nReview the new migration plan and rerun migrate.\\n`;\n case \"RecordMigrationGitRestoreRequired\":\n return `${failure.code}\\nCommit, restore, or otherwise obtain a clean Git restore point for this Record before migrating.\\n`;\n case \"RecordMigrationInvalid\":\n return `${failure.code}\\nRestore the Record from Git before retrying migration.\\n`;\n case \"RecordMigrationRecoveryRequired\":\n return `${failure.code}\\n${failure.restoreSafe\n ? \"Restore the complete Record from Git before retrying migration.\"\n : \"Inspect and preserve concurrent Record edits before choosing a manual recovery; no automatic Git restore command is safe.\"}\\nCause: ${failure.causeCode}\\n${failure.restoreSafe ? recoveryCommands(failure.restoreCommit, recordPath) : \"\"}`;\n case \"RecordFormatUnsupported\":\n return `${failure.code}\\nInstall a NiceEval version that supports this Record format.\\n`;\n case \"RecordMigrationRequired\":\n return `${failure.code}\\nRun: niceeval migrate\\n`;\n case \"RecordMaintenanceOperationFailed\":\n return `${failure.code}\\n`;\n default:\n return assertNever(failure);\n }\n}\nfunction failureCode(value: unknown): string | undefined {\n if (typeof value !== \"object\" || value === null)\n return undefined;\n const code = Reflect.get(value, \"code\");\n return typeof code === \"string\" ? code : undefined;\n}\n/** Shared CLI wording for ordinary-entry automatic migration failures. */\nexport function renderAutomaticMigrationFailure(error: unknown): string | undefined {\n const code = failureCode(error);\n if (code === \"record-auto-migration-git-save-required\") {\n return \"record-auto-migration-git-save-required\\n\" +\n \"Save every portable Record byte first (for example: git add .niceeval/record && git commit), then retry the same command.\\n\";\n }\n if (code === \"record-maintenance-busy\" || code === \"record-writer-busy\") {\n return `${code}\\nClose the command using this Record, then retry.\\n`;\n }\n if (code === \"record-format-unsupported\") {\n return \"record-format-unsupported\\nUse the NiceEval version that wrote this future or unknown Record format.\\n\";\n }\n if (code === \"record-migration-recovery-required\" || code === \"record-migration-interrupted\") {\n return `${code}\\nRestore and verify the complete Record from Git before retrying.\\n`;\n }\n return undefined;\n}\n/** Shared CLI notice emitted exactly once after an automatic migration. */\nexport function renderAutomaticMigrationResult(result: RecordAutomaticMigrationResult): string | undefined {\n if (result.state !== \"migrated\")\n return undefined;\n const droppedFacts = [...new Set(result.attachments.flatMap((attachment) => attachment.retention.droppedFacts))];\n const rerunRecommendations = [...new Set(result.attachments.flatMap((attachment) => attachment.retention.rerunRecommendation === null\n ? []\n : [attachment.retention.rerunRecommendation]))];\n return `Record automatically migrated ${result.attachments.length} attachment${result.attachments.length === 1 ? \"\" : \"s\"}; restore commit ${result.restoreCommit}.${droppedFacts.length === 0 ? \"\" : ` Dropped facts: ${droppedFacts.join(\", \")}.`}${rerunRecommendations.length === 0 ? \"\" : ` ${rerunRecommendations.join(\" \")}`}\\n`;\n}\nfunction renderMigrationImpact(attachments: readonly RecordAttachmentMigrationTarget[]): string {\n return [...new Map(attachments.map((attachment) => {\n const key = `${attachment.family}@${attachment.fromSchemaVersion}->${attachment.toSchemaVersion}`;\n return [key, attachment] as const;\n })).values()].map((attachment) => {\n const retention = attachment.retention;\n const lines = [\n `impact ${attachment.family}@${attachment.fromSchemaVersion}->${attachment.toSchemaVersion}:`,\n ` retained facts: ${retention.retainedFacts.length === 0 ? \"none\" : retention.retainedFacts.join(\", \")}`,\n ` dropped facts: ${retention.droppedFacts.length === 0 ? \"none\" : retention.droppedFacts.join(\", \")}`,\n ];\n if (retention.rerunRecommendation !== null) {\n lines.push(` rerun recommendation: ${retention.rerunRecommendation}`);\n }\n return lines.join(\"\\n\");\n }).join(\"\\n\");\n}\nexport function renderMigrationPlan(plan: RecordMigrateOperationPlan): string {\n switch (plan._tag) {\n case \"RecordMigrationAlreadyCurrent\":\n return `Record migration plan: already-current\\nformat: ${plan.format}\\n`;\n case \"RecordMigrationUnsupported\":\n return `Record migration plan: unsupported-format\\nformat: ${plan.format}\\n`;\n case \"RecordMigrationRestoreRequired\": {\n const impact = renderMigrationImpact(plan.attachments);\n return `Record migration plan: migration-required\\nformat: ${plan.format}\\nattachments: ${plan.attachments.length}\\n${impact === \"\" ? \"\" : `${impact}\\n`}backup: ${plan.backup.state}\\n`;\n }\n case \"RecordMigrationReady\": {\n const impact = renderMigrationImpact(plan.attachments);\n return `Record migration plan: migration-required\\nformat: ${plan.format}\\nattachments: ${plan.attachments.length}\\n${impact === \"\" ? \"\" : `${impact}\\n`}backup: git-restore-point\\nrestore commit: ${plan.restoreCommit}\\n`;\n }\n default:\n return assertNever(plan);\n }\n}\n"]}