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
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["loader.ts"],"names":[],"mappings":";;;AAgDA,0DAwBC;AAED,0DAUC;AAED,wDASC;AAQD,4DAEC;AAzGD,6EAA6E;AAC7E,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,+EAA+E;AAC/E,+CAAkD;AAClD,yCAA4D;AAC5D,mCAAsC;AACtC,8DAA6D;AAC7D,0DAA6E;AAC7E,6CAAqH;AAGrH;;;;;GAKG;AACH,MAAa,qBAAsB,SAAQ,aAAI,CAAC,WAAW,CAAC,uBAAuB,CAIjF;CACD;AALD,sDAKC;AAsBD,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,M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","sourcesContent":["// Trusted Node-side Report / Theme loading. Author modules are project code,\n// so the loader always uses the namespaced fresh project graph. In packaged\n// NiceEval, that graph resolves this exact install's `niceeval/*` imports to\n// the canonical CJS graph; the versioned Symbol.for descriptors below remain\n// the final authority even when a trusted module reaches another package copy.\nimport { readFile, stat } from \"node:fs/promises\";\nimport { dirname, extname, join, resolve } from \"node:path\";\nimport { Data, Effect } from \"effect\";\nimport { freshImportModule } from \"../../../fresh-import.ts\";\nimport { isReport, type ReportDefinition } from \"../../definition/report.ts\";\nimport { isThemeDefinition, registerThemeSourceBase, themeAssetInputs, type ThemeDefinition, } from \"../../theme.ts\";\nexport type ReportModuleLoadStage = \"config\" | \"report\" | \"theme\";\nexport type ReportModuleLoadCode = \"report-module-load-failed\" | \"report-module-invalid-default-export\" | \"report-module-invalid-report\" | \"report-module-invalid-theme\";\n/**\n * A recoverable, bounded failure at the trusted author-module boundary. A\n * Report definitions use a versioned Symbol.for descriptor, so the same\n * contract remains recognizable through an ESM/CJS or duplicate-package\n * boundary without accepting an arbitrary report-shaped object.\n */\nexport class ReportModuleLoadError extends Data.TaggedError(\"ReportModuleLoadError\")<{\n readonly code: ReportModuleLoadCode;\n readonly stage: ReportModuleLoadStage;\n readonly reason: string;\n}> {\n}\nexport interface LoadedTrustedConfig {\n /** Validated host products retained from config without structural casts. */\n readonly report?: ReportDefinition;\n readonly theme?: ThemeDefinition;\n /** The config entry and its project-relative static import closure. */\n readonly watchInputs: readonly string[];\n}\nexport interface LoadedTrustedReport {\n readonly report: ReportDefinition;\n /** The report entry and its project-relative static import closure. */\n readonly watchInputs: readonly string[];\n}\nexport interface LoadedTrustedTheme {\n readonly theme: ThemeDefinition;\n /** The theme entry and its project-relative static import closure. */\n readonly watchInputs: readonly string[];\n}\ninterface ModuleNamespace {\n readonly default?: unknown;\n readonly [name: string]: unknown;\n}\nconst SOURCE_EXTENSIONS = [\".ts\", \".tsx\", \".mts\", \".cts\", \".js\", \".mjs\", \".cjs\", \".jsx\"] as const;\n/** Fresh-loads optional `<cwd>/niceeval.config.ts` and validates its Report-facing fields. */\nexport function loadTrustedReportConfig(cwd: string): Effect.Effect<LoadedTrustedConfig, ReportModuleLoadError> {\n const path = join(cwd, \"niceeval.config.ts\");\n return Effect.gen(function* () {\n const exists = yield* regularFile(path, \"config\", true);\n if (!exists) {\n return Object.freeze({ watchInputs: Object.freeze([path]) });\n }\n const value = yield* loadSingleDefault(path, \"config\");\n if (!isPlainObject(value)) {\n return yield* Effect.fail(moduleError(\"report-module-invalid-default-export\", \"config\", \"config default export must be an object\"));\n }\n const report = value.report === undefined ? undefined : yield* validateReport(value.report, \"config\");\n const theme = value.theme === undefined ? undefined : yield* validateTheme(value.theme, \"config\");\n if (report?.theme !== undefined)\n registerThemeSourceBase(report.theme, dirname(path));\n if (theme !== undefined)\n registerThemeSourceBase(theme, dirname(path));\n const watchInputs = withThemeInputs(yield* staticModuleClosure(path, \"config\"), report?.theme, theme);\n return Object.freeze({\n ...(report === undefined ? {} : { report }),\n ...(theme === undefined ? {} : { theme }),\n watchInputs,\n });\n });\n}\n/** Fresh-loads one trusted author Report module and accepts exactly one default Report export. */\nexport function loadTrustedReportModule(path: string): Effect.Effect<LoadedTrustedReport, ReportModuleLoadError> {\n return Effect.gen(function* () {\n yield* regularFile(path, \"report\", false);\n const value = yield* loadSingleDefault(path, \"report\");\n const report = yield* validateReport(value, \"report\");\n if (report.theme !== undefined)\n registerThemeSourceBase(report.theme, dirname(path));\n const watchInputs = withThemeInputs(yield* staticModuleClosure(path, \"report\"), report.theme);\n return Object.freeze({ report, watchInputs });\n });\n}\n/** Fresh-loads one trusted author Theme module and accepts exactly one default closed Theme export. */\nexport function loadTrustedThemeModule(path: string): Effect.Effect<LoadedTrustedTheme, ReportModuleLoadError> {\n return Effect.gen(function* () {\n yield* regularFile(path, \"theme\", false);\n const value = yield* loadSingleDefault(path, \"theme\");\n const theme = yield* validateTheme(value, \"theme\");\n registerThemeSourceBase(theme, dirname(path));\n const watchInputs = withThemeInputs(yield* staticModuleClosure(path, \"theme\"), theme);\n return Object.freeze({ theme, watchInputs });\n });\n}\nfunction withThemeInputs(inputs: readonly string[], ...themes: readonly (ThemeDefinition | undefined)[]): readonly string[] {\n return Object.freeze([...new Set([\n ...inputs,\n ...themes.flatMap((theme) => themeAssetInputs(theme)),\n ])].sort());\n}\n/** Resolve a trusted CLI module path against the project; loader callers never receive a URL string. */\nexport function resolveTrustedModulePath(cwd: string, value: string): string {\n return resolve(cwd, value);\n}\nfunction regularFile(path: string, stage: ReportModuleLoadStage, optional: boolean): Effect.Effect<boolean, ReportModuleLoadError> {\n return Effect.tryPromise({\n try: async () => {\n try {\n return (await stat(path)).isFile();\n }\n catch (cause) {\n if (optional && isMissing(cause))\n return false;\n throw cause;\n }\n },\n catch: (cause) => moduleError(\"report-module-load-failed\", stage, loadReason(cause)),\n }).pipe(Effect.flatMap((isFile) => isFile\n ? Effect.succeed(true)\n : optional\n ? Effect.succeed(false)\n : Effect.fail(moduleError(\"report-module-load-failed\", stage, \"module path is not a file\"))));\n}\nfunction loadSingleDefault(path: string, stage: ReportModuleLoadStage): Effect.Effect<unknown, ReportModuleLoadError> {\n return Effect.tryPromise({\n try: () => freshImportModule(path) as Promise<ModuleNamespace>,\n catch: (cause) => moduleError(\"report-module-load-failed\", stage, loadReason(cause)),\n }).pipe(Effect.flatMap((module) => {\n // Node's ESM-CJS interop surfaces a `module.exports` alias and\n // static-analyzed re-export names (value undefined) on CommonJS\n // wrappers. Only when that marker exists are they namespace artifacts,\n // never author exports; the default Report remains the single real\n // export. A pure ESM namespace has no such marker, so a genuine named\n // export of undefined still fails the exact one-default-export check.\n const names = Object.keys(module);\n const cjsInterop = Object.hasOwn(module, \"module.exports\");\n const realExports = cjsInterop\n ? names.filter((name) => name !== \"__esModule\" && name !== \"module.exports\" && module[name] !== undefined)\n : names;\n if (realExports.length !== 1 || realExports[0] !== \"default\" || !Object.hasOwn(module, \"default\")) {\n return Effect.fail(moduleError(\"report-module-invalid-default-export\", stage, \"module must export exactly one default value\"));\n }\n return Effect.succeed(module.default);\n }));\n}\nfunction validateReport(value: unknown, stage: ReportModuleLoadStage): Effect.Effect<ReportDefinition, ReportModuleLoadError> {\n if (isReport(value))\n return Effect.succeed(value);\n return Effect.fail(moduleError(\"report-module-invalid-report\", stage, looksLikeReport(value)\n ? \"Report has no supported niceeval.report.definition/v2 descriptor\"\n : \"default export must be a Report created by defineReport\"));\n}\nfunction validateTheme(value: unknown, stage: ReportModuleLoadStage): Effect.Effect<ThemeDefinition, ReportModuleLoadError> {\n return isThemeDefinition(value)\n ? Effect.succeed(value)\n : Effect.fail(moduleError(\"report-module-invalid-theme\", stage, \"default export must be a closed Theme created by defineTheme\"));\n}\n/**\n * The watcher only needs static project edges. This deliberately recognizes\n * the trusted TS/ESM static import and re-export grammar used by Report\n * modules (including multi-line clauses); it is not an arbitrary JavaScript\n * parser. Bare package imports remain package-owned; relative / absolute\n * author imports are walked recursively. The loader remains the source of\n * truth, and a watch event is only a hint.\n */\nfunction staticModuleClosure(entry: string, stage: ReportModuleLoadStage): Effect.Effect<readonly string[], ReportModuleLoadError> {\n return Effect.tryPromise({\n try: async () => {\n const visited = new Set<string>();\n const visit = async (path: string): Promise<void> => {\n const absolute = resolve(path);\n if (visited.has(absolute))\n return;\n visited.add(absolute);\n const source = await readFile(absolute, \"utf8\");\n for (const specifier of staticSpecifiers(source)) {\n const imported = await resolveStaticImport(absolute, specifier);\n if (imported !== undefined)\n await visit(imported);\n }\n };\n await visit(entry);\n return Object.freeze([...visited].sort());\n },\n catch: (cause) => moduleError(\"report-module-load-failed\", stage, loadReason(cause)),\n });\n}\nfunction staticSpecifiers(source: string): readonly string[] {\n const result = new Set<string>();\n // Static `import ... from`, side-effect `import`, and all `export ... from`\n // forms. Dynamic import() intentionally stays outside the declared closure.\n const patterns = [\n /\\bimport\\s+(?:type\\s+)?(?:[\\s\\S]*?\\s+from\\s+)?[\"']([^\"']+)[\"']/g,\n /\\bexport\\s+(?:type\\s+)?[\\s\\S]*?\\s+from\\s+[\"']([^\"']+)[\"']/g,\n ] as const;\n for (const pattern of patterns) {\n for (const match of source.matchAll(pattern)) {\n const specifier = match[1];\n if (specifier !== undefined)\n result.add(specifier);\n }\n }\n return Object.freeze([...result]);\n}\nasync function resolveStaticImport(from: string, specifier: string): Promise<string | undefined> {\n if (!specifier.startsWith(\".\") && !specifier.startsWith(\"/\"))\n return undefined;\n const base = resolve(dirname(from), specifier);\n const candidates = extname(base) === \"\"\n ? [\n ...SOURCE_EXTENSIONS.map((extension) => `${base}${extension}`),\n ...SOURCE_EXTENSIONS.map((extension) => join(base, `index${extension}`)),\n ]\n : [base];\n for (const candidate of candidates) {\n try {\n if ((await stat(candidate)).isFile())\n return candidate;\n }\n catch {\n // A loader evaluation will surface a real unresolved import. Closure\n // discovery only reports files that can actually be watched.\n }\n }\n return undefined;\n}\nfunction isPlainObject(value: unknown): value is Readonly<Record<string, unknown>> {\n if (typeof value !== \"object\" || value === null || Array.isArray(value))\n return false;\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\nfunction looksLikeReport(value: unknown): boolean {\n return isPlainObject(value) && Object.hasOwn(value, \"pages\");\n}\nfunction isMissing(cause: unknown): boolean {\n return typeof cause === \"object\" && cause !== null &&\n Reflect.get(cause, \"code\") === \"ENOENT\";\n}\nfunction loadReason(cause: unknown): string {\n const raw = cause instanceof Error ? cause.message : \"module evaluation failed\";\n const bounded = raw.replace(/[\\u0000-\\u001f\\u007f-\\u009f]/g, \" \").slice(0, 512).trim();\n return bounded || \"module evaluation failed\";\n}\nfunction moduleError(code: ReportModuleLoadCode, stage: ReportModuleLoadStage, reason: string): ReportModuleLoadError {\n return new ReportModuleLoadError({ code, stage, reason });\n}\n"]}
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["loader.ts"],"names":[],"mappings":";;;AAgDA,0DA4BC;AAED,0DAUC;AAED,wDASC;AAQD,4DAEC;AA7GD,6EAA6E;AAC7E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KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,0BAA0B,CAAC;IAChF,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,+BAA+B,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACvF,OAAO,OAAO,IAAI,0BAA0B,CAAC;AACjD,CAAC;AACD,SAAS,WAAW,CAAC,IAA0B,EAAE,KAA4B,EAAE,MAAc;IACzF,OAAO,IAAI,qBAAqB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["// Trusted Node-side Report / Theme loading. Author modules are project code,\n// so the loader always uses the namespaced fresh project graph. In packaged\n// NiceEval, that graph resolves this exact install's `niceeval/*` imports to\n// the canonical CJS graph; the versioned Symbol.for descriptors below remain\n// the final authority even when a trusted module reaches another package copy.\nimport { readFile, stat } from \"node:fs/promises\";\nimport { dirname, extname, join, resolve } from \"node:path\";\nimport { Data, Effect } from \"effect\";\nimport { freshImportModule } from \"../../../fresh-import.ts\";\nimport { isReport, type ReportDefinition } from \"../../definition/report.ts\";\nimport { isThemeDefinition, registerThemeSourceBase, themeAssetInputs, type ThemeDefinition, } from \"../../theme.ts\";\nexport type ReportModuleLoadStage = \"config\" | \"report\" | \"theme\";\nexport type ReportModuleLoadCode = \"report-module-load-failed\" | \"report-module-invalid-default-export\" | \"report-module-invalid-report\" | \"report-module-invalid-theme\";\n/**\n * A recoverable, bounded failure at the trusted author-module boundary. A\n * Report definitions use a versioned Symbol.for descriptor, so the same\n * contract remains recognizable through an ESM/CJS or duplicate-package\n * boundary without accepting an arbitrary report-shaped object.\n */\nexport class ReportModuleLoadError extends Data.TaggedError(\"ReportModuleLoadError\")<{\n readonly code: ReportModuleLoadCode;\n readonly stage: ReportModuleLoadStage;\n readonly reason: string;\n}> {\n}\nexport interface LoadedTrustedConfig {\n /** Validated host products retained from config without structural casts. */\n readonly report?: ReportDefinition;\n readonly theme?: ThemeDefinition;\n /** The config entry and its project-relative static import closure. */\n readonly watchInputs: readonly string[];\n}\nexport interface LoadedTrustedReport {\n readonly report: ReportDefinition;\n /** The report entry and its project-relative static import closure. */\n readonly watchInputs: readonly string[];\n}\nexport interface LoadedTrustedTheme {\n readonly theme: ThemeDefinition;\n /** The theme entry and its project-relative static import closure. */\n readonly watchInputs: readonly string[];\n}\ninterface ModuleNamespace {\n readonly default?: unknown;\n readonly [name: string]: unknown;\n}\nconst SOURCE_EXTENSIONS = [\".ts\", \".tsx\", \".mts\", \".cts\", \".js\", \".mjs\", \".cjs\", \".jsx\"] as const;\n/** Fresh-loads optional `<cwd>/niceeval.config.ts` and validates its Report-facing fields. */\nexport function loadTrustedReportConfig(cwd: string, options: {\n readonly includeTheme?: boolean;\n} = {}): Effect.Effect<LoadedTrustedConfig, ReportModuleLoadError> {\n const path = join(cwd, \"niceeval.config.ts\");\n return Effect.gen(function* () {\n const exists = yield* regularFile(path, \"config\", true);\n if (!exists) {\n return Object.freeze({ watchInputs: Object.freeze([path]) });\n }\n const value = yield* loadSingleDefault(path, \"config\");\n if (!isPlainObject(value)) {\n return yield* Effect.fail(moduleError(\"report-module-invalid-default-export\", \"config\", \"config default export must be an object\"));\n }\n const report = value.report === undefined ? undefined : yield* validateReport(value.report, \"config\");\n const theme = options.includeTheme === false || value.theme === undefined\n ? undefined\n : yield* validateTheme(value.theme, \"config\");\n if (report?.theme !== undefined)\n registerThemeSourceBase(report.theme, dirname(path));\n if (theme !== undefined)\n registerThemeSourceBase(theme, dirname(path));\n const watchInputs = withThemeInputs(yield* staticModuleClosure(path, \"config\"), report?.theme, theme);\n return Object.freeze({\n ...(report === undefined ? {} : { report }),\n ...(theme === undefined ? {} : { theme }),\n watchInputs,\n });\n });\n}\n/** Fresh-loads one trusted author Report module and accepts exactly one default Report export. */\nexport function loadTrustedReportModule(path: string): Effect.Effect<LoadedTrustedReport, ReportModuleLoadError> {\n return Effect.gen(function* () {\n yield* regularFile(path, \"report\", false);\n const value = yield* loadSingleDefault(path, \"report\");\n const report = yield* validateReport(value, \"report\");\n if (report.theme !== undefined)\n registerThemeSourceBase(report.theme, dirname(path));\n const watchInputs = withThemeInputs(yield* staticModuleClosure(path, \"report\"), report.theme);\n return Object.freeze({ report, watchInputs });\n });\n}\n/** Fresh-loads one trusted author Theme module and accepts exactly one default closed Theme export. */\nexport function loadTrustedThemeModule(path: string): Effect.Effect<LoadedTrustedTheme, ReportModuleLoadError> {\n return Effect.gen(function* () {\n yield* regularFile(path, \"theme\", false);\n const value = yield* loadSingleDefault(path, \"theme\");\n const theme = yield* validateTheme(value, \"theme\");\n registerThemeSourceBase(theme, dirname(path));\n const watchInputs = withThemeInputs(yield* staticModuleClosure(path, \"theme\"), theme);\n return Object.freeze({ theme, watchInputs });\n });\n}\nfunction withThemeInputs(inputs: readonly string[], ...themes: readonly (ThemeDefinition | undefined)[]): readonly string[] {\n return Object.freeze([...new Set([\n ...inputs,\n ...themes.flatMap((theme) => themeAssetInputs(theme)),\n ])].sort());\n}\n/** Resolve a trusted CLI module path against the project; loader callers never receive a URL string. */\nexport function resolveTrustedModulePath(cwd: string, value: string): string {\n return resolve(cwd, value);\n}\nfunction regularFile(path: string, stage: ReportModuleLoadStage, optional: boolean): Effect.Effect<boolean, ReportModuleLoadError> {\n return Effect.tryPromise({\n try: async () => {\n try {\n return (await stat(path)).isFile();\n }\n catch (cause) {\n if (optional && isMissing(cause))\n return false;\n throw cause;\n }\n },\n catch: (cause) => moduleError(\"report-module-load-failed\", stage, loadReason(cause)),\n }).pipe(Effect.flatMap((isFile) => isFile\n ? Effect.succeed(true)\n : optional\n ? Effect.succeed(false)\n : Effect.fail(moduleError(\"report-module-load-failed\", stage, \"module path is not a file\"))));\n}\nfunction loadSingleDefault(path: string, stage: ReportModuleLoadStage): Effect.Effect<unknown, ReportModuleLoadError> {\n return Effect.tryPromise({\n try: () => freshImportModule(path) as Promise<ModuleNamespace>,\n catch: (cause) => moduleError(\"report-module-load-failed\", stage, loadReason(cause)),\n }).pipe(Effect.flatMap((module) => {\n // Node's ESM-CJS interop surfaces a `module.exports` alias and\n // static-analyzed re-export names (value undefined) on CommonJS\n // wrappers. Only when that marker exists are they namespace artifacts,\n // never author exports; the default Report remains the single real\n // export. A pure ESM namespace has no such marker, so a genuine named\n // export of undefined still fails the exact one-default-export check.\n const names = Object.keys(module);\n const cjsInterop = Object.hasOwn(module, \"module.exports\");\n const realExports = cjsInterop\n ? names.filter((name) => name !== \"__esModule\" && name !== \"module.exports\" && module[name] !== undefined)\n : names;\n if (realExports.length !== 1 || realExports[0] !== \"default\" || !Object.hasOwn(module, \"default\")) {\n return Effect.fail(moduleError(\"report-module-invalid-default-export\", stage, \"module must export exactly one default value\"));\n }\n return Effect.succeed(module.default);\n }));\n}\nfunction validateReport(value: unknown, stage: ReportModuleLoadStage): Effect.Effect<ReportDefinition, ReportModuleLoadError> {\n if (isReport(value))\n return Effect.succeed(value);\n return Effect.fail(moduleError(\"report-module-invalid-report\", stage, looksLikeReport(value)\n ? \"Report has no supported niceeval.report.definition/v2 descriptor\"\n : \"default export must be a Report created by defineReport\"));\n}\nfunction validateTheme(value: unknown, stage: ReportModuleLoadStage): Effect.Effect<ThemeDefinition, ReportModuleLoadError> {\n return isThemeDefinition(value)\n ? Effect.succeed(value)\n : Effect.fail(moduleError(\"report-module-invalid-theme\", stage, \"default export must be a closed Theme created by defineTheme\"));\n}\n/**\n * The watcher only needs static project edges. This deliberately recognizes\n * the trusted TS/ESM static import and re-export grammar used by Report\n * modules (including multi-line clauses); it is not an arbitrary JavaScript\n * parser. Bare package imports remain package-owned; relative / absolute\n * author imports are walked recursively. The loader remains the source of\n * truth, and a watch event is only a hint.\n */\nfunction staticModuleClosure(entry: string, stage: ReportModuleLoadStage): Effect.Effect<readonly string[], ReportModuleLoadError> {\n return Effect.tryPromise({\n try: async () => {\n const visited = new Set<string>();\n const visit = async (path: string): Promise<void> => {\n const absolute = resolve(path);\n if (visited.has(absolute))\n return;\n visited.add(absolute);\n const source = await readFile(absolute, \"utf8\");\n for (const specifier of staticSpecifiers(source)) {\n const imported = await resolveStaticImport(absolute, specifier);\n if (imported !== undefined)\n await visit(imported);\n }\n };\n await visit(entry);\n return Object.freeze([...visited].sort());\n },\n catch: (cause) => moduleError(\"report-module-load-failed\", stage, loadReason(cause)),\n });\n}\nfunction staticSpecifiers(source: string): readonly string[] {\n const result = new Set<string>();\n // Static `import ... from`, side-effect `import`, and all `export ... from`\n // forms. Dynamic import() intentionally stays outside the declared closure.\n const patterns = [\n /\\bimport\\s+(?:type\\s+)?(?:[\\s\\S]*?\\s+from\\s+)?[\"']([^\"']+)[\"']/g,\n /\\bexport\\s+(?:type\\s+)?[\\s\\S]*?\\s+from\\s+[\"']([^\"']+)[\"']/g,\n ] as const;\n for (const pattern of patterns) {\n for (const match of source.matchAll(pattern)) {\n const specifier = match[1];\n if (specifier !== undefined)\n result.add(specifier);\n }\n }\n return Object.freeze([...result]);\n}\nasync function resolveStaticImport(from: string, specifier: string): Promise<string | undefined> {\n if (!specifier.startsWith(\".\") && !specifier.startsWith(\"/\"))\n return undefined;\n const base = resolve(dirname(from), specifier);\n const candidates = extname(base) === \"\"\n ? [\n ...SOURCE_EXTENSIONS.map((extension) => `${base}${extension}`),\n ...SOURCE_EXTENSIONS.map((extension) => join(base, `index${extension}`)),\n ]\n : [base];\n for (const candidate of candidates) {\n try {\n if ((await stat(candidate)).isFile())\n return candidate;\n }\n catch {\n // A loader evaluation will surface a real unresolved import. Closure\n // discovery only reports files that can actually be watched.\n }\n }\n return undefined;\n}\nfunction isPlainObject(value: unknown): value is Readonly<Record<string, unknown>> {\n if (typeof value !== \"object\" || value === null || Array.isArray(value))\n return false;\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\nfunction looksLikeReport(value: unknown): boolean {\n return isPlainObject(value) && Object.hasOwn(value, \"pages\");\n}\nfunction isMissing(cause: unknown): boolean {\n return typeof cause === \"object\" && cause !== null &&\n Reflect.get(cause, \"code\") === \"ENOENT\";\n}\nfunction loadReason(cause: unknown): string {\n const raw = cause instanceof Error ? cause.message : \"module evaluation failed\";\n const bounded = raw.replace(/[\\u0000-\\u001f\\u007f-\\u009f]/g, \" \").slice(0, 512).trim();\n return bounded || \"module evaluation failed\";\n}\nfunction moduleError(code: ReportModuleLoadCode, stage: ReportModuleLoadStage, reason: string): ReportModuleLoadError {\n return new ReportModuleLoadError({ code, stage, reason });\n}\n"]}
@@ -36,7 +36,9 @@ export interface LoadedTrustedTheme {
36
36
  readonly watchInputs: readonly string[];
37
37
  }
38
38
  /** Fresh-loads optional `<cwd>/niceeval.config.ts` and validates its Report-facing fields. */
39
- export declare function loadTrustedReportConfig(cwd: string): Effect.Effect<LoadedTrustedConfig, ReportModuleLoadError>;
39
+ export declare function loadTrustedReportConfig(cwd: string, options?: {
40
+ readonly includeTheme?: boolean;
41
+ }): Effect.Effect<LoadedTrustedConfig, ReportModuleLoadError>;
40
42
  /** Fresh-loads one trusted author Report module and accepts exactly one default Report export. */
41
43
  export declare function loadTrustedReportModule(path: string): Effect.Effect<LoadedTrustedReport, ReportModuleLoadError>;
42
44
  /** Fresh-loads one trusted author Theme module and accepts exactly one default closed Theme export. */
@@ -36,7 +36,9 @@ export interface LoadedTrustedTheme {
36
36
  readonly watchInputs: readonly string[];
37
37
  }
38
38
  /** Fresh-loads optional `<cwd>/niceeval.config.ts` and validates its Report-facing fields. */
39
- export declare function loadTrustedReportConfig(cwd: string): Effect.Effect<LoadedTrustedConfig, ReportModuleLoadError>;
39
+ export declare function loadTrustedReportConfig(cwd: string, options?: {
40
+ readonly includeTheme?: boolean;
41
+ }): Effect.Effect<LoadedTrustedConfig, ReportModuleLoadError>;
40
42
  /** Fresh-loads one trusted author Report module and accepts exactly one default Report export. */
41
43
  export declare function loadTrustedReportModule(path: string): Effect.Effect<LoadedTrustedReport, ReportModuleLoadError>;
42
44
  /** Fresh-loads one trusted author Theme module and accepts exactly one default closed Theme export. */
@@ -36,7 +36,9 @@ export interface LoadedTrustedTheme {
36
36
  readonly watchInputs: readonly string[];
37
37
  }
38
38
  /** Fresh-loads optional `<cwd>/niceeval.config.ts` and validates its Report-facing fields. */
39
- export declare function loadTrustedReportConfig(cwd: string): Effect.Effect<LoadedTrustedConfig, ReportModuleLoadError>;
39
+ export declare function loadTrustedReportConfig(cwd: string, options?: {
40
+ readonly includeTheme?: boolean;
41
+ }): Effect.Effect<LoadedTrustedConfig, ReportModuleLoadError>;
40
42
  /** Fresh-loads one trusted author Report module and accepts exactly one default Report export. */
41
43
  export declare function loadTrustedReportModule(path: string): Effect.Effect<LoadedTrustedReport, ReportModuleLoadError>;
42
44
  /** Fresh-loads one trusted author Theme module and accepts exactly one default closed Theme export. */
@@ -1,26 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NodeReportFileSystemLive = exports.NodeReportViewHostLive = exports.NodeReportViewHost = exports.ReportModuleLoadError = exports.resolveTrustedModulePath = exports.loadTrustedThemeModule = exports.loadTrustedReportModule = exports.loadTrustedReportConfig = exports.themeStylesheet = exports.isThemeDefinition = exports.defineTheme = exports.chalk = exports.basalt = void 0;
3
+ exports.NodeReportCliLive = exports.NodeReportBrowserLive = exports.NodeReportModulePlatformLive = exports.NodeReportHostLive = exports.NodeReportFileSystemLive = exports.nodeReportFileSystemService = exports.NodeReportViewHostLive = exports.nodeReportViewHostService = exports.NodeReportViewHost = exports.ReportModuleLoadError = exports.resolveTrustedModulePath = exports.loadTrustedThemeModule = exports.loadTrustedReportModule = exports.loadTrustedReportConfig = exports.themeStylesheet = exports.isThemeDefinition = exports.defineTheme = exports.chalk = exports.basalt = void 0;
4
4
  exports.openNodeReportView = openNodeReportView;
5
5
  exports.openNodeReportViewServer = openNodeReportViewServer;
6
6
  exports.makeNodeReportFileSystem = makeNodeReportFileSystem;
7
7
  const promises_1 = require("node:fs/promises");
8
+ const node_child_process_1 = require("node:child_process");
8
9
  const node_path_1 = require("node:path");
9
10
  const effect_1 = require("effect");
10
11
  const view_session_ts_1 = require("./view-session.cjs");
12
+ const static_ts_1 = require("./static.cjs");
11
13
  const server_ts_1 = require("../../view/server.cjs");
14
+ const operations_ts_1 = require("./operations.cjs");
15
+ const loader_ts_1 = require("./node/loader.cjs");
12
16
  var theme_ts_1 = require("../theme.cjs");
13
17
  Object.defineProperty(exports, "basalt", { enumerable: true, get: function () { return theme_ts_1.basalt; } });
14
18
  Object.defineProperty(exports, "chalk", { enumerable: true, get: function () { return theme_ts_1.chalk; } });
15
19
  Object.defineProperty(exports, "defineTheme", { enumerable: true, get: function () { return theme_ts_1.defineTheme; } });
16
20
  Object.defineProperty(exports, "isThemeDefinition", { enumerable: true, get: function () { return theme_ts_1.isThemeDefinition; } });
17
21
  Object.defineProperty(exports, "themeStylesheet", { enumerable: true, get: function () { return theme_ts_1.themeStylesheet; } });
18
- var loader_ts_1 = require("./node/loader.cjs");
19
- Object.defineProperty(exports, "loadTrustedReportConfig", { enumerable: true, get: function () { return loader_ts_1.loadTrustedReportConfig; } });
20
- Object.defineProperty(exports, "loadTrustedReportModule", { enumerable: true, get: function () { return loader_ts_1.loadTrustedReportModule; } });
21
- Object.defineProperty(exports, "loadTrustedThemeModule", { enumerable: true, get: function () { return loader_ts_1.loadTrustedThemeModule; } });
22
- Object.defineProperty(exports, "resolveTrustedModulePath", { enumerable: true, get: function () { return loader_ts_1.resolveTrustedModulePath; } });
23
- Object.defineProperty(exports, "ReportModuleLoadError", { enumerable: true, get: function () { return loader_ts_1.ReportModuleLoadError; } });
22
+ var loader_ts_2 = require("./node/loader.cjs");
23
+ Object.defineProperty(exports, "loadTrustedReportConfig", { enumerable: true, get: function () { return loader_ts_2.loadTrustedReportConfig; } });
24
+ Object.defineProperty(exports, "loadTrustedReportModule", { enumerable: true, get: function () { return loader_ts_2.loadTrustedReportModule; } });
25
+ Object.defineProperty(exports, "loadTrustedThemeModule", { enumerable: true, get: function () { return loader_ts_2.loadTrustedThemeModule; } });
26
+ Object.defineProperty(exports, "resolveTrustedModulePath", { enumerable: true, get: function () { return loader_ts_2.resolveTrustedModulePath; } });
27
+ Object.defineProperty(exports, "ReportModuleLoadError", { enumerable: true, get: function () { return loader_ts_2.ReportModuleLoadError; } });
24
28
  /**
25
29
  * Node-only orchestration seam. The live implementation can add a watcher,
26
30
  * module loader, and HTTP server without changing the fixed-execution session
@@ -29,10 +33,11 @@ Object.defineProperty(exports, "ReportModuleLoadError", { enumerable: true, get:
29
33
  class NodeReportViewHost extends effect_1.Context.Tag("@niceeval/report/NodeReportViewHost")() {
30
34
  }
31
35
  exports.NodeReportViewHost = NodeReportViewHost;
32
- exports.NodeReportViewHostLive = Object.freeze({
36
+ exports.nodeReportViewHostService = Object.freeze({
33
37
  open: view_session_ts_1.openReportViewSession,
34
38
  serve: server_ts_1.openViewServer,
35
39
  });
40
+ exports.NodeReportViewHostLive = effect_1.Layer.succeed(NodeReportViewHost, exports.nodeReportViewHostService);
36
41
  function openNodeReportView(request) {
37
42
  return effect_1.Effect.flatMap(NodeReportViewHost, (host) => host.open(request));
38
43
  }
@@ -109,7 +114,37 @@ function makeNodeReportFileSystem() {
109
114
  },
110
115
  });
111
116
  }
112
- exports.NodeReportFileSystemLive = makeNodeReportFileSystem();
117
+ exports.nodeReportFileSystemService = makeNodeReportFileSystem();
118
+ exports.NodeReportFileSystemLive = effect_1.Layer.succeed(static_ts_1.ReportFileSystem, exports.nodeReportFileSystemService);
119
+ /** Complete Node transport/filesystem provisioning for Report Host operations. */
120
+ exports.NodeReportHostLive = effect_1.Layer.merge(exports.NodeReportViewHostLive, exports.NodeReportFileSystemLive);
121
+ exports.NodeReportModulePlatformLive = effect_1.Layer.succeed(operations_ts_1.ReportModulePlatform, {
122
+ loadConfig: (cwd, options) => (0, loader_ts_1.loadTrustedReportConfig)(cwd, options).pipe(effect_1.Effect.mapError((cause) => new operations_ts_1.ReportPlatformError({ operation: "load-config", cause }))),
123
+ loadReport: (path) => (0, loader_ts_1.loadTrustedReportModule)(path).pipe(effect_1.Effect.mapError((cause) => new operations_ts_1.ReportPlatformError({ operation: "load-report", cause }))),
124
+ loadTheme: (path) => (0, loader_ts_1.loadTrustedThemeModule)(path).pipe(effect_1.Effect.mapError((cause) => new operations_ts_1.ReportPlatformError({ operation: "load-theme", cause }))),
125
+ resolveModulePath: loader_ts_1.resolveTrustedModulePath,
126
+ });
127
+ exports.NodeReportBrowserLive = effect_1.Layer.succeed(operations_ts_1.ReportBrowser, {
128
+ open: (url) => effect_1.Effect.async((resume) => {
129
+ const command = process.platform === "darwin" ? "open" : process.platform === "win32" ? "cmd" : "xdg-open";
130
+ const args = process.platform === "win32" ? ["/c", "start", "", url] : [url];
131
+ let settled = false;
132
+ const finish = (opened) => {
133
+ if (settled)
134
+ return;
135
+ settled = true;
136
+ clearTimeout(timer);
137
+ resume(effect_1.Effect.succeed(opened));
138
+ };
139
+ const child = (0, node_child_process_1.spawn)(command, args, { detached: true, stdio: "ignore" });
140
+ const timer = setTimeout(() => finish(true), 1500);
141
+ child.once("error", () => finish(false));
142
+ child.once("exit", (code) => finish(code === 0));
143
+ child.unref();
144
+ }),
145
+ });
146
+ /** All Report-owned Node capabilities; the central CLI only composes this Layer. */
147
+ exports.NodeReportCliLive = effect_1.Layer.mergeAll(exports.NodeReportHostLive, exports.NodeReportModulePlatformLive, exports.NodeReportBrowserLive);
113
148
  /**
114
149
  * `writeFile` and the completion marker are valid only after the exporter has
115
150
  * prepared this invocation's root. They may make nested directories, but can
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sourceRoot":"","sources":["node.ts"],"names":[],"mappings":";;;AA+BA,gDAEC;AAED,4DAQC;AAKD,4DA8DC;AA9GD,+CAA4E;AAC5E,yCAA4D;AAC5D,mCAAyC;AAEzC,uDAA8I;AAE9I,oDAA0H;AAC1H,wCAA8F;AAArF,kGAAA,MAAM,OAAA;AAAE,iGAAA,KAAK,OAAA;AAAE,uGAAA,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AQ,IAAI,KAAK,KAAK,IAAI;QAC9C,MAAM,IAAI,KAAK,IAAK,KAEtB,CAAC,IAAI,KAAK,QAAQ,CAAC;AACzB,CAAC;AACD,SAAS,iBAAiB,CAAC,SAAiB,EAAE,KAAc;IACxD,IAAI,KAAK,YAAY,uBAAuB,EAAE,CAAC;QAC3C,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,6BAA6B,EAAE,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,4BAA4B;QAClC,qEAAqE;QACrE,2EAA2E;QAC3E,SAAS;KACZ,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { mkdir, open as openFile, stat, writeFile } from \"node:fs/promises\";\nimport { dirname, relative, resolve, sep } from \"node:path\";\nimport { Context, Effect } from \"effect\";\nimport type * as Scope from \"effect/Scope\";\nimport { openReportViewSession, type OpenReportViewSessionInput, type ReportViewOpenError, type ReportViewSession, } from \"./view-session.ts\";\nimport type { ReportFileSystemError, ReportFileSystemFailure, ReportHostOutputPath, ReportFileSystemService, ReportExportTargetExists, } from \"./static.ts\";\nimport { openViewServer, type NodeViewServerError, type ReportViewServer, type ViewOptions, } from \"../../view/server.ts\";\nexport { basalt, chalk, defineTheme, isThemeDefinition, themeStylesheet, } from \"../theme.ts\";\nexport type { ReportTheme, ThemeColor, ThemeDefinition, ThemeHex, ThemeSeries, } from \"../theme.ts\";\nexport { loadTrustedReportConfig, loadTrustedReportModule, loadTrustedThemeModule, resolveTrustedModulePath, ReportModuleLoadError, } from \"./node/loader.ts\";\nexport type { LoadedTrustedConfig, LoadedTrustedReport, LoadedTrustedTheme, ReportModuleLoadCode, ReportModuleLoadStage, } from \"./node/loader.ts\";\nexport type { NodeViewServerError, ReportViewServer, ViewOptions, } from \"../../view/server.ts\";\nexport type { OpenReportViewSessionInput, ReportViewRebuild, } from \"./view-session.ts\";\n/** Node host request after its loader/watcher has closed over all live inputs. */\nexport type ReportViewRequest = OpenReportViewSessionInput;\nexport interface NodeReportViewHostService {\n readonly open: (request: ReportViewRequest) => Effect.Effect<ReportViewSession, ReportViewOpenError, Scope.Scope>;\n /** The live Node transport/watch composition, when this host provides it. */\n readonly serve?: (options: ViewOptions) => Effect.Effect<ReportViewServer, NodeViewServerError | ReportViewOpenError, Scope.Scope>;\n}\n/**\n * Node-only orchestration seam. The live implementation can add a watcher,\n * module loader, and HTTP server without changing the fixed-execution session\n * contract or accepting Record service objects from callers.\n */\nexport class NodeReportViewHost extends Context.Tag(\"@niceeval/report/NodeReportViewHost\")<NodeReportViewHost, NodeReportViewHostService>() {\n}\nexport const NodeReportViewHostLive: NodeReportViewHostService = Object.freeze({\n open: openReportViewSession,\n serve: openViewServer,\n});\nexport function openNodeReportView(request: ReportViewRequest): Effect.Effect<ReportViewSession, ReportViewOpenError, Scope.Scope | NodeReportViewHost> {\n return Effect.flatMap(NodeReportViewHost, (host) => host.open(request));\n}\n/** Opens the HTTP and watcher host around caller-supplied fixed rebuilds; host defaults to loopback. */\nexport function openNodeReportViewServer(options: ViewOptions): Effect.Effect<ReportViewServer, NodeViewServerError | ReportViewOpenError, Scope.Scope | NodeReportViewHost> {\n return Effect.flatMap(NodeReportViewHost, (host) => host.serve === undefined\n ? Effect.fail(Object.freeze({\n code: \"report-view-server-failed\" as const,\n operation: \"open\" as const,\n reason: \"the configured Node Report host does not provide an HTTP server\",\n }))\n : host.serve(options));\n}\n/**\n * Concrete Node filesystem boundary for static exports. The exporter itself\n * remains platform-neutral and sees only this Effect service.\n */\nexport function makeNodeReportFileSystem(): ReportFileSystemService {\n return Object.freeze({\n // This deliberately has no success cache. Every export invocation must\n // re-check its target so a completed or incomplete prior directory is\n // consistently reported as target-exists before its first file write.\n prepareOutput: (out: string) => Effect.tryPromise({\n try: async () => {\n const root = resolve(out);\n await mkdir(dirname(root), { recursive: true });\n try {\n await mkdir(root);\n }\n catch (error) {\n if (isAlreadyExists(error))\n throw new OutputTargetExistsError();\n throw error;\n }\n },\n catch: (error): ReportFileSystemFailure => fileSystemFailure(\"prepare-output\", error),\n }),\n writeFile: (input: {\n readonly out: string;\n readonly path: ReportHostOutputPath;\n readonly bytes: Uint8Array;\n }) => Effect.tryPromise({\n try: async () => {\n const root = await preparedOutputRoot(input.out);\n const target = resolve(root, input.path.value);\n if (!isOutputChild(root, target)) {\n throw new Error(`Report host output escapes its root: ${input.path.value}`);\n }\n await mkdir(dirname(target), { recursive: true });\n await writeFile(target, input.bytes, { flag: \"wx\" });\n },\n catch: (error): ReportFileSystemFailure => fileSystemFailure(\"write\", error),\n }),\n writeCompleteMarker: (out: string) => Effect.tryPromise({\n try: async () => {\n const root = await preparedOutputRoot(out);\n const marker = resolve(root, \"_niceeval/complete\");\n await mkdir(dirname(marker), { recursive: true });\n await writeFile(marker, new Uint8Array(), { flag: \"wx\" });\n },\n catch: (error): ReportFileSystemFailure => fileSystemFailure(\"complete-marker\", error),\n }),\n syncDirectory: (out: string) => {\n const root = resolve(out);\n const acquire = Effect.tryPromise({\n try: () => openFile(root, \"r\"),\n catch: (error): ReportFileSystemFailure => fileSystemFailure(\"sync-directory\", error),\n });\n return Effect.scoped(Effect.acquireRelease(acquire, (handle) => Effect.tryPromise({\n try: () => handle.close(),\n // A close failure cannot produce a second public filesystem error\n // after the primary operation; the handle is nevertheless scoped.\n catch: () => undefined,\n }).pipe(Effect.ignore)).pipe(Effect.flatMap((handle) => Effect.tryPromise({\n try: () => handle.sync(),\n catch: (error): ReportFileSystemFailure => fileSystemFailure(\"sync-directory\", error),\n }))));\n },\n });\n}\nexport const NodeReportFileSystemLive: ReportFileSystemService = makeNodeReportFileSystem();\n/**\n * `writeFile` and the completion marker are valid only after the exporter has\n * prepared this invocation's root. They may make nested directories, but can\n * never recreate a missing root and silently bypass `prepareOutput`.\n */\nasync function preparedOutputRoot(out: string): Promise<string> {\n const root = resolve(out);\n const metadata = await stat(root);\n if (!metadata.isDirectory()) {\n throw new Error(\"the prepared report output root is not a directory\");\n }\n return root;\n}\nfunction isOutputChild(root: string, target: string): boolean {\n const path = relative(root, target);\n return path === \"\" || (!path.startsWith(`..${sep}`) && path !== \"..\" && !path.startsWith(sep));\n}\nclass OutputTargetExistsError extends Error {\n}\nfunction isAlreadyExists(error: unknown): boolean {\n return typeof error === \"object\" && error !== null &&\n \"code\" in error && (error as {\n readonly code?: unknown;\n }).code === \"EEXIST\";\n}\nfunction fileSystemFailure(operation: string, error: unknown): ReportFileSystemError | ReportExportTargetExists {\n if (error instanceof OutputTargetExistsError) {\n return Object.freeze({ code: \"report-export-target-exists\" });\n }\n return Object.freeze({\n code: \"report-export-write-failed\",\n // The public error is intentionally stable and never includes a Node\n // errno message, absolute target path, or caller-provided filesystem text.\n operation,\n });\n}\n"]}
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["node.ts"],"names":[],"mappings":";;;AAoCA,gDAEC;AAED,4DAQC;AAKD,4DA8DC;AAnHD,+CAA4E;AAC5E,2DAA2C;AAC3C,yCAA4D;AAC5D,mCAAgD;AAEhD,uDAA8I;AAE9I,2CAA+C;AAC/C,oDAA0H;AAC1H,mDAA4F;AAC5F,gDAAuI;AACvI,wCAA8F;AAArF,kGAAA,MAAM,OAAA;AAAE,iGAAA,KAAK,OAAA;AAAE,uGAAA,WAAW,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AAAE,2GAAA,eAAe,OAAA;AAEvE,8CAA8J;AAArJ,oHAAA,uBAAuB,OAAA;AAAE,oHAAA,uBAAuB,OAAA;AAAE,mHAAA,sBAAsB,OAAA;AAAE,qHAAA,wBAAwB,OAAA;AAAE,kHAAA,qBAAqB,OAAA;AAWlI;;;;GAIG;AACH,MAAa,kBAAmB,SAAQ,gBAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,EAAiD;CAC1I;AADD,gDACC;AACY,QAAA,yBAAyB,GAA8B,MAAM,CAAC,MAAM,CAAC;IAC9E,IAAI,EAAE,uCAAqB;IAC3B,KAAK,EAAE,0BAAc;CACxB,CA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rE,2EAA2E;QAC3E,SAAS;KACZ,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { mkdir, open as openFile, stat, writeFile } from \"node:fs/promises\";\nimport { spawn } from \"node:child_process\";\nimport { dirname, relative, resolve, sep } from \"node:path\";\nimport { Context, Effect, Layer } from \"effect\";\nimport type * as Scope from \"effect/Scope\";\nimport { openReportViewSession, type OpenReportViewSessionInput, type ReportViewOpenError, type ReportViewSession, } from \"./view-session.ts\";\nimport type { ReportFileSystemError, ReportFileSystemFailure, ReportHostOutputPath, ReportFileSystemService, ReportExportTargetExists, } from \"./static.ts\";\nimport { ReportFileSystem } from \"./static.ts\";\nimport { openViewServer, type NodeViewServerError, type ReportViewServer, type ViewOptions, } from \"../../view/server.ts\";\nimport { ReportBrowser, ReportModulePlatform, ReportPlatformError, } from \"./operations.ts\";\nimport { loadTrustedReportConfig, loadTrustedReportModule, loadTrustedThemeModule, resolveTrustedModulePath, } from \"./node/loader.ts\";\nexport { basalt, chalk, defineTheme, isThemeDefinition, themeStylesheet, } from \"../theme.ts\";\nexport type { ReportTheme, ThemeColor, ThemeDefinition, ThemeHex, ThemeSeries, } from \"../theme.ts\";\nexport { loadTrustedReportConfig, loadTrustedReportModule, loadTrustedThemeModule, resolveTrustedModulePath, ReportModuleLoadError, } from \"./node/loader.ts\";\nexport type { LoadedTrustedConfig, LoadedTrustedReport, LoadedTrustedTheme, ReportModuleLoadCode, ReportModuleLoadStage, } from \"./node/loader.ts\";\nexport type { NodeViewServerError, ReportViewServer, ViewOptions, } from \"../../view/server.ts\";\nexport type { OpenReportViewSessionInput, ReportViewRebuild, } from \"./view-session.ts\";\n/** Node host request after its loader/watcher has closed over all live inputs. */\nexport type ReportViewRequest = OpenReportViewSessionInput;\nexport interface NodeReportViewHostService {\n readonly open: (request: ReportViewRequest) => Effect.Effect<ReportViewSession, ReportViewOpenError, Scope.Scope>;\n /** The live Node transport/watch composition, when this host provides it. */\n readonly serve?: (options: ViewOptions) => Effect.Effect<ReportViewServer, NodeViewServerError | ReportViewOpenError, Scope.Scope>;\n}\n/**\n * Node-only orchestration seam. The live implementation can add a watcher,\n * module loader, and HTTP server without changing the fixed-execution session\n * contract or accepting Record service objects from callers.\n */\nexport class NodeReportViewHost extends Context.Tag(\"@niceeval/report/NodeReportViewHost\")<NodeReportViewHost, NodeReportViewHostService>() {\n}\nexport const nodeReportViewHostService: NodeReportViewHostService = Object.freeze({\n open: openReportViewSession,\n serve: openViewServer,\n});\nexport const NodeReportViewHostLive = Layer.succeed(NodeReportViewHost, nodeReportViewHostService);\nexport function openNodeReportView(request: ReportViewRequest): Effect.Effect<ReportViewSession, ReportViewOpenError, Scope.Scope | NodeReportViewHost> {\n return Effect.flatMap(NodeReportViewHost, (host) => host.open(request));\n}\n/** Opens the HTTP and watcher host around caller-supplied fixed rebuilds; host defaults to loopback. */\nexport function openNodeReportViewServer(options: ViewOptions): Effect.Effect<ReportViewServer, NodeViewServerError | ReportViewOpenError, Scope.Scope | NodeReportViewHost> {\n return Effect.flatMap(NodeReportViewHost, (host) => host.serve === undefined\n ? Effect.fail(Object.freeze({\n code: \"report-view-server-failed\" as const,\n operation: \"open\" as const,\n reason: \"the configured Node Report host does not provide an HTTP server\",\n }))\n : host.serve(options));\n}\n/**\n * Concrete Node filesystem boundary for static exports. The exporter itself\n * remains platform-neutral and sees only this Effect service.\n */\nexport function makeNodeReportFileSystem(): ReportFileSystemService {\n return Object.freeze({\n // This deliberately has no success cache. Every export invocation must\n // re-check its target so a completed or incomplete prior directory is\n // consistently reported as target-exists before its first file write.\n prepareOutput: (out: string) => Effect.tryPromise({\n try: async () => {\n const root = resolve(out);\n await mkdir(dirname(root), { recursive: true });\n try {\n await mkdir(root);\n }\n catch (error) {\n if (isAlreadyExists(error))\n throw new OutputTargetExistsError();\n throw error;\n }\n },\n catch: (error): ReportFileSystemFailure => fileSystemFailure(\"prepare-output\", error),\n }),\n writeFile: (input: {\n readonly out: string;\n readonly path: ReportHostOutputPath;\n readonly bytes: Uint8Array;\n }) => Effect.tryPromise({\n try: async () => {\n const root = await preparedOutputRoot(input.out);\n const target = resolve(root, input.path.value);\n if (!isOutputChild(root, target)) {\n throw new Error(`Report host output escapes its root: ${input.path.value}`);\n }\n await mkdir(dirname(target), { recursive: true });\n await writeFile(target, input.bytes, { flag: \"wx\" });\n },\n catch: (error): ReportFileSystemFailure => fileSystemFailure(\"write\", error),\n }),\n writeCompleteMarker: (out: string) => Effect.tryPromise({\n try: async () => {\n const root = await preparedOutputRoot(out);\n const marker = resolve(root, \"_niceeval/complete\");\n await mkdir(dirname(marker), { recursive: true });\n await writeFile(marker, new Uint8Array(), { flag: \"wx\" });\n },\n catch: (error): ReportFileSystemFailure => fileSystemFailure(\"complete-marker\", error),\n }),\n syncDirectory: (out: string) => {\n const root = resolve(out);\n const acquire = Effect.tryPromise({\n try: () => openFile(root, \"r\"),\n catch: (error): ReportFileSystemFailure => fileSystemFailure(\"sync-directory\", error),\n });\n return Effect.scoped(Effect.acquireRelease(acquire, (handle) => Effect.tryPromise({\n try: () => handle.close(),\n // A close failure cannot produce a second public filesystem error\n // after the primary operation; the handle is nevertheless scoped.\n catch: () => undefined,\n }).pipe(Effect.ignore)).pipe(Effect.flatMap((handle) => Effect.tryPromise({\n try: () => handle.sync(),\n catch: (error): ReportFileSystemFailure => fileSystemFailure(\"sync-directory\", error),\n }))));\n },\n });\n}\nexport const nodeReportFileSystemService: ReportFileSystemService = makeNodeReportFileSystem();\nexport const NodeReportFileSystemLive = Layer.succeed(ReportFileSystem, nodeReportFileSystemService);\n/** Complete Node transport/filesystem provisioning for Report Host operations. */\nexport const NodeReportHostLive = Layer.merge(NodeReportViewHostLive, NodeReportFileSystemLive);\nexport const NodeReportModulePlatformLive = Layer.succeed(ReportModulePlatform, {\n loadConfig: (cwd, options) => loadTrustedReportConfig(cwd, options).pipe(Effect.mapError((cause) => new ReportPlatformError({ operation: \"load-config\", cause }))),\n loadReport: (path) => loadTrustedReportModule(path).pipe(Effect.mapError((cause) => new ReportPlatformError({ operation: \"load-report\", cause }))),\n loadTheme: (path) => loadTrustedThemeModule(path).pipe(Effect.mapError((cause) => new ReportPlatformError({ operation: \"load-theme\", cause }))),\n resolveModulePath: resolveTrustedModulePath,\n});\nexport const NodeReportBrowserLive = Layer.succeed(ReportBrowser, {\n open: (url) => Effect.async<boolean, ReportPlatformError>((resume) => {\n const command = process.platform === \"darwin\" ? \"open\" : process.platform === \"win32\" ? \"cmd\" : \"xdg-open\";\n const args = process.platform === \"win32\" ? [\"/c\", \"start\", \"\", url] : [url];\n let settled = false;\n const finish = (opened: boolean): void => {\n if (settled)\n return;\n settled = true;\n clearTimeout(timer);\n resume(Effect.succeed(opened));\n };\n const child = spawn(command, args, { detached: true, stdio: \"ignore\" });\n const timer = setTimeout(() => finish(true), 1500);\n child.once(\"error\", () => finish(false));\n child.once(\"exit\", (code) => finish(code === 0));\n child.unref();\n }),\n});\n/** All Report-owned Node capabilities; the central CLI only composes this Layer. */\nexport const NodeReportCliLive = Layer.mergeAll(NodeReportHostLive, NodeReportModulePlatformLive, NodeReportBrowserLive);\n/**\n * `writeFile` and the completion marker are valid only after the exporter has\n * prepared this invocation's root. They may make nested directories, but can\n * never recreate a missing root and silently bypass `prepareOutput`.\n */\nasync function preparedOutputRoot(out: string): Promise<string> {\n const root = resolve(out);\n const metadata = await stat(root);\n if (!metadata.isDirectory()) {\n throw new Error(\"the prepared report output root is not a directory\");\n }\n return root;\n}\nfunction isOutputChild(root: string, target: string): boolean {\n const path = relative(root, target);\n return path === \"\" || (!path.startsWith(`..${sep}`) && path !== \"..\" && !path.startsWith(sep));\n}\nclass OutputTargetExistsError extends Error {\n}\nfunction isAlreadyExists(error: unknown): boolean {\n return typeof error === \"object\" && error !== null &&\n \"code\" in error && (error as {\n readonly code?: unknown;\n }).code === \"EEXIST\";\n}\nfunction fileSystemFailure(operation: string, error: unknown): ReportFileSystemError | ReportExportTargetExists {\n if (error instanceof OutputTargetExistsError) {\n return Object.freeze({ code: \"report-export-target-exists\" });\n }\n return Object.freeze({\n code: \"report-export-write-failed\",\n // The public error is intentionally stable and never includes a Node\n // errno message, absolute target path, or caller-provided filesystem text.\n operation,\n });\n}\n"]}
@@ -1,8 +1,10 @@
1
- import { Context, Effect } from "effect";
1
+ import { Context, Effect, Layer } from "effect";
2
2
  import type * as Scope from "effect/Scope";
3
3
  import { type OpenReportViewSessionInput, type ReportViewOpenError, type ReportViewSession } from "./view-session.cjs";
4
4
  import type { ReportFileSystemService } from "./static.cjs";
5
+ import { ReportFileSystem } from "./static.cjs";
5
6
  import { type NodeViewServerError, type ReportViewServer, type ViewOptions } from "../../view/server.cjs";
7
+ import { ReportBrowser, ReportModulePlatform } from "./operations.cjs";
6
8
  export { basalt, chalk, defineTheme, isThemeDefinition, themeStylesheet, } from "../theme.cjs";
7
9
  export type { ReportTheme, ThemeColor, ThemeDefinition, ThemeHex, ThemeSeries, } from "../theme.cjs";
8
10
  export { loadTrustedReportConfig, loadTrustedReportModule, loadTrustedThemeModule, resolveTrustedModulePath, ReportModuleLoadError, } from "./node/loader.cjs";
@@ -24,7 +26,8 @@ declare const NodeReportViewHost_base: Context.TagClass<NodeReportViewHost, "@ni
24
26
  */
25
27
  export declare class NodeReportViewHost extends NodeReportViewHost_base {
26
28
  }
27
- export declare const NodeReportViewHostLive: NodeReportViewHostService;
29
+ export declare const nodeReportViewHostService: NodeReportViewHostService;
30
+ export declare const NodeReportViewHostLive: Layer.Layer<NodeReportViewHost, never, never>;
28
31
  export declare function openNodeReportView(request: ReportViewRequest): Effect.Effect<ReportViewSession, ReportViewOpenError, Scope.Scope | NodeReportViewHost>;
29
32
  /** Opens the HTTP and watcher host around caller-supplied fixed rebuilds; host defaults to loopback. */
30
33
  export declare function openNodeReportViewServer(options: ViewOptions): Effect.Effect<ReportViewServer, NodeViewServerError | ReportViewOpenError, Scope.Scope | NodeReportViewHost>;
@@ -33,4 +36,11 @@ export declare function openNodeReportViewServer(options: ViewOptions): Effect.E
33
36
  * remains platform-neutral and sees only this Effect service.
34
37
  */
35
38
  export declare function makeNodeReportFileSystem(): ReportFileSystemService;
36
- export declare const NodeReportFileSystemLive: ReportFileSystemService;
39
+ export declare const nodeReportFileSystemService: ReportFileSystemService;
40
+ export declare const NodeReportFileSystemLive: Layer.Layer<ReportFileSystem, never, never>;
41
+ /** Complete Node transport/filesystem provisioning for Report Host operations. */
42
+ export declare const NodeReportHostLive: Layer.Layer<ReportFileSystem | NodeReportViewHost, never, never>;
43
+ export declare const NodeReportModulePlatformLive: Layer.Layer<ReportModulePlatform, never, never>;
44
+ export declare const NodeReportBrowserLive: Layer.Layer<ReportBrowser, never, never>;
45
+ /** All Report-owned Node capabilities; the central CLI only composes this Layer. */
46
+ export declare const NodeReportCliLive: Layer.Layer<ReportFileSystem | ReportModulePlatform | ReportBrowser | NodeReportViewHost, never, never>;
@@ -1,8 +1,10 @@
1
- import { Context, Effect } from "effect";
1
+ import { Context, Effect, Layer } from "effect";
2
2
  import type * as Scope from "effect/Scope";
3
3
  import { type OpenReportViewSessionInput, type ReportViewOpenError, type ReportViewSession } from "./view-session.mjs";
4
4
  import type { ReportFileSystemService } from "./static.mjs";
5
+ import { ReportFileSystem } from "./static.mjs";
5
6
  import { type NodeViewServerError, type ReportViewServer, type ViewOptions } from "../../view/server.mjs";
7
+ import { ReportBrowser, ReportModulePlatform } from "./operations.mjs";
6
8
  export { basalt, chalk, defineTheme, isThemeDefinition, themeStylesheet, } from "../theme.mjs";
7
9
  export type { ReportTheme, ThemeColor, ThemeDefinition, ThemeHex, ThemeSeries, } from "../theme.mjs";
8
10
  export { loadTrustedReportConfig, loadTrustedReportModule, loadTrustedThemeModule, resolveTrustedModulePath, ReportModuleLoadError, } from "./node/loader.mjs";
@@ -24,7 +26,8 @@ declare const NodeReportViewHost_base: Context.TagClass<NodeReportViewHost, "@ni
24
26
  */
25
27
  export declare class NodeReportViewHost extends NodeReportViewHost_base {
26
28
  }
27
- export declare const NodeReportViewHostLive: NodeReportViewHostService;
29
+ export declare const nodeReportViewHostService: NodeReportViewHostService;
30
+ export declare const NodeReportViewHostLive: Layer.Layer<NodeReportViewHost, never, never>;
28
31
  export declare function openNodeReportView(request: ReportViewRequest): Effect.Effect<ReportViewSession, ReportViewOpenError, Scope.Scope | NodeReportViewHost>;
29
32
  /** Opens the HTTP and watcher host around caller-supplied fixed rebuilds; host defaults to loopback. */
30
33
  export declare function openNodeReportViewServer(options: ViewOptions): Effect.Effect<ReportViewServer, NodeViewServerError | ReportViewOpenError, Scope.Scope | NodeReportViewHost>;
@@ -33,4 +36,11 @@ export declare function openNodeReportViewServer(options: ViewOptions): Effect.E
33
36
  * remains platform-neutral and sees only this Effect service.
34
37
  */
35
38
  export declare function makeNodeReportFileSystem(): ReportFileSystemService;
36
- export declare const NodeReportFileSystemLive: ReportFileSystemService;
39
+ export declare const nodeReportFileSystemService: ReportFileSystemService;
40
+ export declare const NodeReportFileSystemLive: Layer.Layer<ReportFileSystem, never, never>;
41
+ /** Complete Node transport/filesystem provisioning for Report Host operations. */
42
+ export declare const NodeReportHostLive: Layer.Layer<ReportFileSystem | NodeReportViewHost, never, never>;
43
+ export declare const NodeReportModulePlatformLive: Layer.Layer<ReportModulePlatform, never, never>;
44
+ export declare const NodeReportBrowserLive: Layer.Layer<ReportBrowser, never, never>;
45
+ /** All Report-owned Node capabilities; the central CLI only composes this Layer. */
46
+ export declare const NodeReportCliLive: Layer.Layer<ReportFileSystem | ReportModulePlatform | ReportBrowser | NodeReportViewHost, never, never>;
@@ -1,8 +1,10 @@
1
- import { Context, Effect } from "effect";
1
+ import { Context, Effect, Layer } from "effect";
2
2
  import type * as Scope from "effect/Scope";
3
3
  import { type OpenReportViewSessionInput, type ReportViewOpenError, type ReportViewSession } from "./view-session.js";
4
4
  import type { ReportFileSystemService } from "./static.js";
5
+ import { ReportFileSystem } from "./static.js";
5
6
  import { type NodeViewServerError, type ReportViewServer, type ViewOptions } from "../../view/server.js";
7
+ import { ReportBrowser, ReportModulePlatform } from "./operations.js";
6
8
  export { basalt, chalk, defineTheme, isThemeDefinition, themeStylesheet, } from "../theme.js";
7
9
  export type { ReportTheme, ThemeColor, ThemeDefinition, ThemeHex, ThemeSeries, } from "../theme.js";
8
10
  export { loadTrustedReportConfig, loadTrustedReportModule, loadTrustedThemeModule, resolveTrustedModulePath, ReportModuleLoadError, } from "./node/loader.js";
@@ -24,7 +26,8 @@ declare const NodeReportViewHost_base: Context.TagClass<NodeReportViewHost, "@ni
24
26
  */
25
27
  export declare class NodeReportViewHost extends NodeReportViewHost_base {
26
28
  }
27
- export declare const NodeReportViewHostLive: NodeReportViewHostService;
29
+ export declare const nodeReportViewHostService: NodeReportViewHostService;
30
+ export declare const NodeReportViewHostLive: Layer.Layer<NodeReportViewHost, never, never>;
28
31
  export declare function openNodeReportView(request: ReportViewRequest): Effect.Effect<ReportViewSession, ReportViewOpenError, Scope.Scope | NodeReportViewHost>;
29
32
  /** Opens the HTTP and watcher host around caller-supplied fixed rebuilds; host defaults to loopback. */
30
33
  export declare function openNodeReportViewServer(options: ViewOptions): Effect.Effect<ReportViewServer, NodeViewServerError | ReportViewOpenError, Scope.Scope | NodeReportViewHost>;
@@ -33,4 +36,11 @@ export declare function openNodeReportViewServer(options: ViewOptions): Effect.E
33
36
  * remains platform-neutral and sees only this Effect service.
34
37
  */
35
38
  export declare function makeNodeReportFileSystem(): ReportFileSystemService;
36
- export declare const NodeReportFileSystemLive: ReportFileSystemService;
39
+ export declare const nodeReportFileSystemService: ReportFileSystemService;
40
+ export declare const NodeReportFileSystemLive: Layer.Layer<ReportFileSystem, never, never>;
41
+ /** Complete Node transport/filesystem provisioning for Report Host operations. */
42
+ export declare const NodeReportHostLive: Layer.Layer<ReportFileSystem | NodeReportViewHost, never, never>;
43
+ export declare const NodeReportModulePlatformLive: Layer.Layer<ReportModulePlatform, never, never>;
44
+ export declare const NodeReportBrowserLive: Layer.Layer<ReportBrowser, never, never>;
45
+ /** All Report-owned Node capabilities; the central CLI only composes this Layer. */
46
+ export declare const NodeReportCliLive: Layer.Layer<ReportFileSystem | ReportModulePlatform | ReportBrowser | NodeReportViewHost, never, never>;
@@ -1,36 +1,48 @@
1
1
  import { createRequire as __niceevalCreateRequire } from "node:module";
2
2
  const __niceevalRequire = __niceevalCreateRequire(import.meta.url);
3
3
  const __niceevalCanonical = __niceevalRequire("./node.cjs");
4
- const __niceevalExport0 = __niceevalCanonical["NodeReportFileSystemLive"];
5
- export { __niceevalExport0 as NodeReportFileSystemLive };
6
- const __niceevalExport1 = __niceevalCanonical["NodeReportViewHost"];
7
- export { __niceevalExport1 as NodeReportViewHost };
8
- const __niceevalExport2 = __niceevalCanonical["NodeReportViewHostLive"];
9
- export { __niceevalExport2 as NodeReportViewHostLive };
10
- const __niceevalExport3 = __niceevalCanonical["ReportModuleLoadError"];
11
- export { __niceevalExport3 as ReportModuleLoadError };
12
- const __niceevalExport4 = __niceevalCanonical["basalt"];
13
- export { __niceevalExport4 as basalt };
14
- const __niceevalExport5 = __niceevalCanonical["chalk"];
15
- export { __niceevalExport5 as chalk };
16
- const __niceevalExport6 = __niceevalCanonical["defineTheme"];
17
- export { __niceevalExport6 as defineTheme };
18
- const __niceevalExport7 = __niceevalCanonical["isThemeDefinition"];
19
- export { __niceevalExport7 as isThemeDefinition };
20
- const __niceevalExport8 = __niceevalCanonical["loadTrustedReportConfig"];
21
- export { __niceevalExport8 as loadTrustedReportConfig };
22
- const __niceevalExport9 = __niceevalCanonical["loadTrustedReportModule"];
23
- export { __niceevalExport9 as loadTrustedReportModule };
24
- const __niceevalExport10 = __niceevalCanonical["loadTrustedThemeModule"];
25
- export { __niceevalExport10 as loadTrustedThemeModule };
26
- const __niceevalExport11 = __niceevalCanonical["makeNodeReportFileSystem"];
27
- export { __niceevalExport11 as makeNodeReportFileSystem };
28
- const __niceevalExport12 = __niceevalCanonical["openNodeReportView"];
29
- export { __niceevalExport12 as openNodeReportView };
30
- const __niceevalExport13 = __niceevalCanonical["openNodeReportViewServer"];
31
- export { __niceevalExport13 as openNodeReportViewServer };
32
- const __niceevalExport14 = __niceevalCanonical["resolveTrustedModulePath"];
33
- export { __niceevalExport14 as resolveTrustedModulePath };
34
- const __niceevalExport15 = __niceevalCanonical["themeStylesheet"];
35
- export { __niceevalExport15 as themeStylesheet };
4
+ const __niceevalExport0 = __niceevalCanonical["NodeReportBrowserLive"];
5
+ export { __niceevalExport0 as NodeReportBrowserLive };
6
+ const __niceevalExport1 = __niceevalCanonical["NodeReportCliLive"];
7
+ export { __niceevalExport1 as NodeReportCliLive };
8
+ const __niceevalExport2 = __niceevalCanonical["NodeReportFileSystemLive"];
9
+ export { __niceevalExport2 as NodeReportFileSystemLive };
10
+ const __niceevalExport3 = __niceevalCanonical["NodeReportHostLive"];
11
+ export { __niceevalExport3 as NodeReportHostLive };
12
+ const __niceevalExport4 = __niceevalCanonical["NodeReportModulePlatformLive"];
13
+ export { __niceevalExport4 as NodeReportModulePlatformLive };
14
+ const __niceevalExport5 = __niceevalCanonical["NodeReportViewHost"];
15
+ export { __niceevalExport5 as NodeReportViewHost };
16
+ const __niceevalExport6 = __niceevalCanonical["NodeReportViewHostLive"];
17
+ export { __niceevalExport6 as NodeReportViewHostLive };
18
+ const __niceevalExport7 = __niceevalCanonical["ReportModuleLoadError"];
19
+ export { __niceevalExport7 as ReportModuleLoadError };
20
+ const __niceevalExport8 = __niceevalCanonical["basalt"];
21
+ export { __niceevalExport8 as basalt };
22
+ const __niceevalExport9 = __niceevalCanonical["chalk"];
23
+ export { __niceevalExport9 as chalk };
24
+ const __niceevalExport10 = __niceevalCanonical["defineTheme"];
25
+ export { __niceevalExport10 as defineTheme };
26
+ const __niceevalExport11 = __niceevalCanonical["isThemeDefinition"];
27
+ export { __niceevalExport11 as isThemeDefinition };
28
+ const __niceevalExport12 = __niceevalCanonical["loadTrustedReportConfig"];
29
+ export { __niceevalExport12 as loadTrustedReportConfig };
30
+ const __niceevalExport13 = __niceevalCanonical["loadTrustedReportModule"];
31
+ export { __niceevalExport13 as loadTrustedReportModule };
32
+ const __niceevalExport14 = __niceevalCanonical["loadTrustedThemeModule"];
33
+ export { __niceevalExport14 as loadTrustedThemeModule };
34
+ const __niceevalExport15 = __niceevalCanonical["makeNodeReportFileSystem"];
35
+ export { __niceevalExport15 as makeNodeReportFileSystem };
36
+ const __niceevalExport16 = __niceevalCanonical["nodeReportFileSystemService"];
37
+ export { __niceevalExport16 as nodeReportFileSystemService };
38
+ const __niceevalExport17 = __niceevalCanonical["nodeReportViewHostService"];
39
+ export { __niceevalExport17 as nodeReportViewHostService };
40
+ const __niceevalExport18 = __niceevalCanonical["openNodeReportView"];
41
+ export { __niceevalExport18 as openNodeReportView };
42
+ const __niceevalExport19 = __niceevalCanonical["openNodeReportViewServer"];
43
+ export { __niceevalExport19 as openNodeReportViewServer };
44
+ const __niceevalExport20 = __niceevalCanonical["resolveTrustedModulePath"];
45
+ export { __niceevalExport20 as resolveTrustedModulePath };
46
+ const __niceevalExport21 = __niceevalCanonical["themeStylesheet"];
47
+ export { __niceevalExport21 as themeStylesheet };
36
48
  //# sourceMappingURL=node.js.map
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReportBrowser = exports.ReportModulePlatform = exports.ReportPlatformError = void 0;
4
+ const effect_1 = require("effect");
5
+ class ReportPlatformError extends effect_1.Data.TaggedError("ReportPlatformError") {
6
+ }
7
+ exports.ReportPlatformError = ReportPlatformError;
8
+ class ReportModulePlatform extends effect_1.Context.Tag("@niceeval/report/ReportModulePlatform")() {
9
+ }
10
+ exports.ReportModulePlatform = ReportModulePlatform;
11
+ class ReportBrowser extends effect_1.Context.Tag("@niceeval/report/ReportBrowser")() {
12
+ }
13
+ exports.ReportBrowser = ReportBrowser;
14
+ //# sourceMappingURL=operations.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["operations.ts"],"names":[],"mappings":";;;AAAA,mCAA+C;AAG/C,MAAa,mBAAoB,SAAQ,aAAI,CAAC,WAAW,CAAC,qBAAqB,CAG7E;CACD;AAJD,kDAIC;AAmBD,MAAa,oBAAqB,SAAQ,gBAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,EAAqD;CAClJ;AADD,oDACC;AAID,MAAa,aAAc,SAAQ,gBAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,EAAuC;CACtH;AADD,sCACC","sourcesContent":["import { Context, Data, Effect } from \"effect\";\nimport type { ReportDefinition } from \"../definition/report.ts\";\nimport type { ThemeDefinition } from \"../theme.ts\";\nexport class ReportPlatformError extends Data.TaggedError(\"ReportPlatformError\")<{\n readonly operation: \"load-config\" | \"load-report\" | \"load-theme\" | \"open-browser\";\n readonly cause: unknown;\n}> {\n}\nexport interface ReportModulePlatformService {\n readonly loadConfig: (cwd: string, options?: {\n readonly includeTheme?: boolean;\n }) => Effect.Effect<{\n readonly report?: ReportDefinition;\n readonly theme?: ThemeDefinition;\n readonly watchInputs: readonly string[];\n }, ReportPlatformError>;\n readonly loadReport: (path: string) => Effect.Effect<{\n readonly report: ReportDefinition;\n readonly watchInputs: readonly string[];\n }, ReportPlatformError>;\n readonly loadTheme: (path: string) => Effect.Effect<{\n readonly theme: ThemeDefinition;\n readonly watchInputs: readonly string[];\n }, ReportPlatformError>;\n readonly resolveModulePath: (cwd: string, value: string) => string;\n}\nexport class ReportModulePlatform extends Context.Tag(\"@niceeval/report/ReportModulePlatform\")<ReportModulePlatform, ReportModulePlatformService>() {\n}\nexport interface ReportBrowserService {\n readonly open: (url: string) => Effect.Effect<boolean, ReportPlatformError>;\n}\nexport class ReportBrowser extends Context.Tag(\"@niceeval/report/ReportBrowser\")<ReportBrowser, ReportBrowserService>() {\n}\n"]}
@@ -0,0 +1,39 @@
1
+ import { Context, Effect } from "effect";
2
+ import type { ReportDefinition } from "../definition/report.cjs";
3
+ import type { ThemeDefinition } from "../theme.cjs";
4
+ declare const ReportPlatformError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
5
+ readonly _tag: "ReportPlatformError";
6
+ } & Readonly<A>;
7
+ export declare class ReportPlatformError extends ReportPlatformError_base<{
8
+ readonly operation: "load-config" | "load-report" | "load-theme" | "open-browser";
9
+ readonly cause: unknown;
10
+ }> {
11
+ }
12
+ export interface ReportModulePlatformService {
13
+ readonly loadConfig: (cwd: string, options?: {
14
+ readonly includeTheme?: boolean;
15
+ }) => Effect.Effect<{
16
+ readonly report?: ReportDefinition;
17
+ readonly theme?: ThemeDefinition;
18
+ readonly watchInputs: readonly string[];
19
+ }, ReportPlatformError>;
20
+ readonly loadReport: (path: string) => Effect.Effect<{
21
+ readonly report: ReportDefinition;
22
+ readonly watchInputs: readonly string[];
23
+ }, ReportPlatformError>;
24
+ readonly loadTheme: (path: string) => Effect.Effect<{
25
+ readonly theme: ThemeDefinition;
26
+ readonly watchInputs: readonly string[];
27
+ }, ReportPlatformError>;
28
+ readonly resolveModulePath: (cwd: string, value: string) => string;
29
+ }
30
+ declare const ReportModulePlatform_base: Context.TagClass<ReportModulePlatform, "@niceeval/report/ReportModulePlatform", ReportModulePlatformService>;
31
+ export declare class ReportModulePlatform extends ReportModulePlatform_base {
32
+ }
33
+ export interface ReportBrowserService {
34
+ readonly open: (url: string) => Effect.Effect<boolean, ReportPlatformError>;
35
+ }
36
+ declare const ReportBrowser_base: Context.TagClass<ReportBrowser, "@niceeval/report/ReportBrowser", ReportBrowserService>;
37
+ export declare class ReportBrowser extends ReportBrowser_base {
38
+ }
39
+ export {};
@@ -0,0 +1,39 @@
1
+ import { Context, Effect } from "effect";
2
+ import type { ReportDefinition } from "../definition/report.mjs";
3
+ import type { ThemeDefinition } from "../theme.mjs";
4
+ declare const ReportPlatformError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
5
+ readonly _tag: "ReportPlatformError";
6
+ } & Readonly<A>;
7
+ export declare class ReportPlatformError extends ReportPlatformError_base<{
8
+ readonly operation: "load-config" | "load-report" | "load-theme" | "open-browser";
9
+ readonly cause: unknown;
10
+ }> {
11
+ }
12
+ export interface ReportModulePlatformService {
13
+ readonly loadConfig: (cwd: string, options?: {
14
+ readonly includeTheme?: boolean;
15
+ }) => Effect.Effect<{
16
+ readonly report?: ReportDefinition;
17
+ readonly theme?: ThemeDefinition;
18
+ readonly watchInputs: readonly string[];
19
+ }, ReportPlatformError>;
20
+ readonly loadReport: (path: string) => Effect.Effect<{
21
+ readonly report: ReportDefinition;
22
+ readonly watchInputs: readonly string[];
23
+ }, ReportPlatformError>;
24
+ readonly loadTheme: (path: string) => Effect.Effect<{
25
+ readonly theme: ThemeDefinition;
26
+ readonly watchInputs: readonly string[];
27
+ }, ReportPlatformError>;
28
+ readonly resolveModulePath: (cwd: string, value: string) => string;
29
+ }
30
+ declare const ReportModulePlatform_base: Context.TagClass<ReportModulePlatform, "@niceeval/report/ReportModulePlatform", ReportModulePlatformService>;
31
+ export declare class ReportModulePlatform extends ReportModulePlatform_base {
32
+ }
33
+ export interface ReportBrowserService {
34
+ readonly open: (url: string) => Effect.Effect<boolean, ReportPlatformError>;
35
+ }
36
+ declare const ReportBrowser_base: Context.TagClass<ReportBrowser, "@niceeval/report/ReportBrowser", ReportBrowserService>;
37
+ export declare class ReportBrowser extends ReportBrowser_base {
38
+ }
39
+ export {};