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
@@ -4,8 +4,24 @@ import type { SandboxBuildRecord, TimingActivity } from "../runner/types.js";
4
4
  import type { BuildKey } from "./identity.js";
5
5
  /** Run 级开放 activity key;与 Record 契约同名。 */
6
6
  export declare const SANDBOX_BUILD_ACTIVITY: "sandbox.build";
7
+ declare const MaterializationScopeIdBrand: unique symbol;
8
+ export type MaterializationScopeId = string & {
9
+ readonly [MaterializationScopeIdBrand]: true;
10
+ };
11
+ declare const SandboxBuildRefBrand: unique symbol;
12
+ export type SandboxBuildRef = string & {
13
+ readonly [SandboxBuildRefBrand]: true;
14
+ };
15
+ export declare function materializationScopeId(input: {
16
+ readonly providerFamily: string;
17
+ readonly authorityFingerprint: string;
18
+ readonly materializationProtocolVersion: number;
19
+ }): MaterializationScopeId;
20
+ export declare function sandboxBuildRef(scopeId: MaterializationScopeId, buildKey: BuildKey): SandboxBuildRef;
7
21
  /** 一条待协调的构建工作(同 BuildKey 只保留第一次出现的 inputs / provider)。 */
8
22
  export interface SandboxBuildWork {
23
+ readonly ref: SandboxBuildRef;
24
+ readonly scopeId: MaterializationScopeId;
9
25
  readonly buildKey: BuildKey;
10
26
  readonly provider: string;
11
27
  /** 解析后的构建输入投影;不含凭据值。 */
@@ -13,17 +29,36 @@ export interface SandboxBuildWork {
13
29
  /** 有界人读标签;省略时用 BuildKey 短前缀。 */
14
30
  readonly label?: string;
15
31
  }
32
+ export interface SandboxBuildUseHandle {
33
+ readonly locator: JsonValue;
34
+ release(): Promise<void> | void;
35
+ }
36
+ export interface SandboxBuildArtifactSource {
37
+ readonly locator: JsonValue;
38
+ readonly source: "cache" | "build";
39
+ acquireUse(signal: AbortSignal): Promise<SandboxBuildUseHandle>;
40
+ release(): Promise<void> | void;
41
+ }
42
+ export type SandboxBuildLookup = {
43
+ readonly _tag: "Hit";
44
+ readonly source: SandboxBuildArtifactSource;
45
+ } | {
46
+ readonly _tag: "Miss";
47
+ } | {
48
+ readonly _tag: "Unsupported";
49
+ };
16
50
  /** provider 侧 cache 查询与真实构建。 */
17
51
  export interface SandboxBuildProvider {
18
52
  /** 查 provider 原生 cache / 本地 build registry;命中返回 locator。 */
19
- lookup(work: SandboxBuildWork, signal: AbortSignal): Promise<JsonValue | undefined>;
53
+ lookup(work: SandboxBuildWork, signal: AbortSignal): Promise<SandboxBuildLookup>;
20
54
  /** cache miss 时调用原生构建 API。 */
21
- build(work: SandboxBuildWork, ctx: SandboxBuildExecutionContext): Promise<JsonValue>;
55
+ build(work: SandboxBuildWork, ctx: SandboxBuildExecutionContext): Promise<SandboxBuildArtifactSource>;
22
56
  /** 可选:Invocation abort / timeout 时取消远端 build。 */
23
57
  cancel?(work: SandboxBuildWork): Promise<void>;
24
58
  }
25
59
  /** 构建执行上下文:子 activity 挂在当前 sandbox.build 节点下。 */
26
60
  export interface SandboxBuildExecutionContext {
61
+ readonly operationId: string;
27
62
  readonly signal: AbortSignal;
28
63
  readonly timing: RunTimingRecorder;
29
64
  readonly parent: TimingActivity;
@@ -52,12 +87,15 @@ export interface PrepareSandboxBuildsOptions {
52
87
  /** 构建协调器对外的有界 activity 事件(与 Run feedback 的 run-activity 字段对齐)。 */
53
88
  export type SandboxBuildActivityEvent = {
54
89
  status: "started";
90
+ ref: SandboxBuildRef;
55
91
  buildKey: BuildKey;
56
92
  id: string;
57
93
  key: typeof SANDBOX_BUILD_ACTIVITY;
58
94
  label: string;
59
95
  } | {
60
96
  status: "done" | "failed";
97
+ outcome: SandboxBuildRecord["status"];
98
+ ref: SandboxBuildRef;
61
99
  buildKey: BuildKey;
62
100
  id: string;
63
101
  key: typeof SANDBOX_BUILD_ACTIVITY;
@@ -65,6 +103,7 @@ export type SandboxBuildActivityEvent = {
65
103
  durationMs: number;
66
104
  };
67
105
  export interface SandboxBuildFailure {
106
+ readonly ref: SandboxBuildRef;
68
107
  readonly buildKey: BuildKey;
69
108
  readonly timingNodeId: string;
70
109
  readonly status: "failed" | "cancelled";
@@ -72,20 +111,20 @@ export interface SandboxBuildFailure {
72
111
  }
73
112
  export interface SandboxBuildPreparation {
74
113
  /** 成功(hit / built)的 BuildKey → locator。 */
75
- readonly locators: ReadonlyMap<BuildKey, JsonValue>;
114
+ readonly sources: ReadonlyMap<SandboxBuildRef, SandboxBuildArtifactSource>;
76
115
  /** 实际查询或构建过的每条 provenance(不含完全携带、从未过问的 key)。 */
77
116
  readonly records: readonly SandboxBuildRecord[];
78
117
  /** 失败或取消的 BuildKey → 共用同一 Run timing origin 的错误。 */
79
- readonly failures: ReadonlyMap<BuildKey, SandboxBuildFailure>;
118
+ readonly failures: ReadonlyMap<SandboxBuildRef, SandboxBuildFailure>;
80
119
  }
81
120
  /** 进行中的 Run 级共享准备:逐 BuildKey 放行,依赖者只等自己引用的那几个 key。 */
82
121
  export interface RunningSandboxBuilds {
83
122
  /** 已结算 key 的实时视图(随构建推进增补,不等整批收工)。 */
84
- readonly locators: ReadonlyMap<BuildKey, JsonValue>;
123
+ readonly sources: ReadonlyMap<SandboxBuildRef, SandboxBuildArtifactSource>;
85
124
  /** 已失败 / 已取消 key 的实时视图。 */
86
- readonly failures: ReadonlyMap<BuildKey, SandboxBuildFailure>;
125
+ readonly failures: ReadonlyMap<SandboxBuildRef, SandboxBuildFailure>;
87
126
  /** 等某个 BuildKey 结算;不在本次协调范围内的 key 立即返回。 */
88
- settled(buildKey: BuildKey): Promise<void>;
127
+ settled(ref: SandboxBuildRef): Promise<void>;
89
128
  /** 全部 key 结算后的汇总(provenance 在这里齐全)。 */
90
129
  readonly done: Promise<SandboxBuildPreparation>;
91
130
  }
@@ -109,3 +148,4 @@ export declare function buildFailureOrigin(failure: SandboxBuildFailure): {
109
148
  timingNodeId: string;
110
149
  cause?: SandboxBuildFailure["error"]["cause"];
111
150
  };
151
+ export {};
@@ -5,8 +5,12 @@ const __niceevalExport0 = __niceevalCanonical["SANDBOX_BUILD_ACTIVITY"];
5
5
  export { __niceevalExport0 as SANDBOX_BUILD_ACTIVITY };
6
6
  const __niceevalExport1 = __niceevalCanonical["buildFailureOrigin"];
7
7
  export { __niceevalExport1 as buildFailureOrigin };
8
- const __niceevalExport2 = __niceevalCanonical["prepareSandboxBuilds"];
9
- export { __niceevalExport2 as prepareSandboxBuilds };
10
- const __niceevalExport3 = __niceevalCanonical["startSandboxBuilds"];
11
- export { __niceevalExport3 as startSandboxBuilds };
8
+ const __niceevalExport2 = __niceevalCanonical["materializationScopeId"];
9
+ export { __niceevalExport2 as materializationScopeId };
10
+ const __niceevalExport3 = __niceevalCanonical["prepareSandboxBuilds"];
11
+ export { __niceevalExport3 as prepareSandboxBuilds };
12
+ const __niceevalExport4 = __niceevalCanonical["sandboxBuildRef"];
13
+ export { __niceevalExport4 as sandboxBuildRef };
14
+ const __niceevalExport5 = __niceevalCanonical["startSandboxBuilds"];
15
+ export { __niceevalExport5 as startSandboxBuilds };
12
16
  //# sourceMappingURL=build-coordinator.js.map
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sandboxCliCommand = exports.SANDBOX_CLI_OPTIONS = void 0;
4
+ const effect_1 = require("effect");
5
+ const application_ts_1 = require("../../cli/application.cjs");
6
+ const contribution_ts_1 = require("../../cli/contribution.cjs");
7
+ const project_configuration_ts_1 = require("../../cli/project-configuration.cjs");
8
+ const cli_commands_ts_1 = require("../cli-commands.cjs");
9
+ /** Sandbox owns this schema: its flags never enter the core CLI parser. */
10
+ exports.SANDBOX_CLI_OPTIONS = Object.freeze({
11
+ all: Object.freeze({ type: "boolean", help: Object.freeze({ summary: "Destroy every kept sandbox.", visibility: "public" }) }),
12
+ window: Object.freeze({ type: "string", help: Object.freeze({ summary: "Select one recorded change window.", visibility: "public" }) }),
13
+ path: Object.freeze({ type: "string", help: Object.freeze({ summary: "Select one path in a sandbox diff.", visibility: "public" }) }),
14
+ "leave-running": Object.freeze({ type: "boolean", help: Object.freeze({ summary: "Keep a sandbox alive after leaving its shell.", visibility: "public" }) }),
15
+ record: Object.freeze({ type: "string", help: Object.freeze({ summary: "Use a specific NiceEval record root.", visibility: "public" }) }),
16
+ orphans: Object.freeze({ type: "boolean", help: Object.freeze({ summary: "Inspect unregistered sandbox instances left by terminated runs.", visibility: "public" }) }),
17
+ force: Object.freeze({ type: "boolean", help: Object.freeze({ summary: "Prune unverified orphan candidates too.", visibility: "public" }) }),
18
+ help: Object.freeze({ type: "boolean", short: "h", help: Object.freeze({ summary: "Show Sandbox command help.", visibility: "public" }) }),
19
+ });
20
+ const SANDBOX_HELP = `niceeval sandbox — inspect and manage kept sandboxes
21
+
22
+ Usage:
23
+ niceeval sandbox list [--orphans] [--record <record-root>]
24
+ niceeval sandbox enter <id> [--leave-running] [--record <record-root>]
25
+ niceeval sandbox history <id> [--record <record-root>]
26
+ niceeval sandbox diff <id> [--window <window>] [--path <file>] [--record <record-root>]
27
+ niceeval sandbox stop <id...> [--all] [--record <record-root>]
28
+ niceeval sandbox prune [--force] [--record <record-root>]
29
+
30
+ Commands:
31
+ list list kept sandboxes or inspect orphan candidates
32
+ enter open a shell in a kept sandbox
33
+ history show the kept sandbox's change windows
34
+ diff print patches from one or all change windows
35
+ stop destroy kept sandboxes and remove their registry entries
36
+ prune destroy orphaned sandbox instances
37
+ `;
38
+ const SANDBOX_SUBCOMMANDS = ["list", "enter", "history", "diff", "stop", "prune"];
39
+ function sandboxFailure(operation, cause, exitCode = 1) {
40
+ return new contribution_ts_1.CliFeatureError({ feature: "sandbox", operation, cause, exitCode });
41
+ }
42
+ function isSandboxSubcommand(value) {
43
+ return value !== undefined && SANDBOX_SUBCOMMANDS.includes(value);
44
+ }
45
+ function parseSandboxArgs(argv, parse) {
46
+ const parsed = parse(argv, exports.SANDBOX_CLI_OPTIONS);
47
+ return Object.freeze({
48
+ positionals: Object.freeze([...parsed.positionals]),
49
+ providedOptions: Object.freeze(parsed.tokens
50
+ .filter((token) => token.kind === "option")
51
+ .map((token) => token.name)),
52
+ help: parsed.values.help === true,
53
+ flags: Object.freeze({
54
+ all: parsed.values.all === true,
55
+ ...(typeof parsed.values.window === "string" ? { window: parsed.values.window } : {}),
56
+ ...(typeof parsed.values.path === "string" ? { path: parsed.values.path } : {}),
57
+ leaveRunning: parsed.values["leave-running"] === true,
58
+ ...(typeof parsed.values.record === "string" ? { record: parsed.values.record } : {}),
59
+ orphans: parsed.values.orphans === true,
60
+ force: parsed.values.force === true,
61
+ }),
62
+ });
63
+ }
64
+ const SANDBOX_SUBCOMMAND_OPTIONS = Object.freeze({
65
+ list: Object.freeze(["orphans", "record", "help"]),
66
+ enter: Object.freeze(["leave-running", "record", "help"]),
67
+ history: Object.freeze(["record", "help"]),
68
+ diff: Object.freeze(["window", "path", "record", "help"]),
69
+ stop: Object.freeze(["all", "record", "help"]),
70
+ prune: Object.freeze(["force", "record", "help"]),
71
+ });
72
+ function write(channel, text) {
73
+ return effect_1.Effect.flatMap(application_ts_1.CliOutput, (output) => channel === "stdout" ? output.writeStdout(text) : output.writeStderr(text)).pipe(effect_1.Effect.mapError((cause) => sandboxFailure(`write ${channel}`, cause)));
74
+ }
75
+ function unknownSandboxCommand(command) {
76
+ return command === undefined
77
+ ? `usage: niceeval sandbox <${SANDBOX_SUBCOMMANDS.join("|")}> …\n`
78
+ : `unknown sandbox command ${JSON.stringify(command)}\n${SANDBOX_HELP}`;
79
+ }
80
+ /**
81
+ * Feature-owned root contribution. Syntax outcomes deliberately finish before
82
+ * credential preparation, so help, version, empty input, and unknown input do
83
+ * not load .env, config, or a provider SDK.
84
+ */
85
+ exports.sandboxCliCommand = Object.freeze({
86
+ name: "sandbox",
87
+ summary: "inspect, enter, and clean up kept sandboxes",
88
+ options: exports.SANDBOX_CLI_OPTIONS,
89
+ run: (argv) => effect_1.Effect.gen(function* () {
90
+ const argumentsService = yield* application_ts_1.CliArguments;
91
+ const parsed = yield* effect_1.Effect.try({
92
+ try: () => parseSandboxArgs(argv, argumentsService.parse),
93
+ catch: (cause) => sandboxFailure("parse sandbox command", cause, 1),
94
+ });
95
+ const subcommand = parsed.positionals[0];
96
+ if (subcommand === undefined && parsed.help) {
97
+ yield* write("stdout", SANDBOX_HELP);
98
+ return 0;
99
+ }
100
+ if (!isSandboxSubcommand(subcommand)) {
101
+ yield* write("stderr", unknownSandboxCommand(subcommand));
102
+ return 1;
103
+ }
104
+ const unsupportedOption = parsed.providedOptions.find((name) => !SANDBOX_SUBCOMMAND_OPTIONS[subcommand].includes(name));
105
+ if (unsupportedOption !== undefined) {
106
+ yield* write("stderr", `niceeval sandbox ${subcommand} does not accept --${unsupportedOption}.\n`);
107
+ return 1;
108
+ }
109
+ if (parsed.help) {
110
+ yield* write("stdout", SANDBOX_HELP);
111
+ return 0;
112
+ }
113
+ const invocation = yield* application_ts_1.CliInvocationFacts;
114
+ const facts = yield* invocation.facts.pipe(effect_1.Effect.mapError((cause) => sandboxFailure("read invocation facts", cause)));
115
+ const configuration = yield* project_configuration_ts_1.ProjectConfiguration;
116
+ yield* configuration.prepare(facts.cwd).pipe(effect_1.Effect.mapError((cause) => sandboxFailure("prepare project credentials", cause)));
117
+ const path = yield* application_ts_1.CliPath;
118
+ const record = parsed.flags.record === undefined ? undefined : path.resolve(facts.cwd, parsed.flags.record);
119
+ const commandFacts = Object.freeze({
120
+ leaseHolder: `${facts.pid}@${facts.hostname}`,
121
+ ...(facts.noColor === undefined ? {} : { noColor: facts.noColor }),
122
+ stdout: facts.stdout,
123
+ });
124
+ const output = yield* application_ts_1.CliOutput;
125
+ return yield* (0, cli_commands_ts_1.runSandboxCommandEffect)(facts.cwd, [...parsed.positionals], record === undefined ? parsed.flags : { ...parsed.flags, record }, { out: output.writeStdoutSync, err: output.writeStderrSync }, commandFacts).pipe(effect_1.Effect.mapError((cause) => sandboxFailure("run sandbox command", cause)));
126
+ }),
127
+ });
128
+ //# sourceMappingURL=contribution.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contribution.js","sourceRoot":"","sources":["contribution.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,6DAAiJ;AACjJ,+DAAyF;AACzF,iFAA0E;AAC1E,wDAAkH;AAClH,2EAA2E;AAC9D,QAAA,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7C,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,6BAA6B,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IAC9H,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,oCAAoC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IACvI,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAA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/H,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,wBAAO,CAAC;QAC5B,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC5G,MAAM,YAAY,GAAwB,MAAM,CAAC,MAAM,CAAC;YACpD,WAAW,EAAE,GAAG,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,QAAQ,EAAE;YAC7C,GAAG,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;YAClE,MAAM,EAAE,KAAK,CAAC,MAAM;SACvB,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,0BAAS,CAAC;QAChC,OAAO,KAAK,CAAC,CAAC,IAAA,yCAAuB,EAAC,KAAK,CAAC,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,eAAe,EAAE,GAAG,EAAE,MAAM,CAAC,eAAe,EAAE,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,eAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5S,CAAC,CAAC;CACL,CAAC,CAAC","sourcesContent":["import { Effect } from \"effect\";\nimport { CliArguments, CliInvocationFacts, CliOutput, CliPath, type CliOptionDefinition, type CliParsedTokens, } from \"../../cli/application.ts\";\nimport { CliFeatureError, type CliCommandContribution } from \"../../cli/contribution.ts\";\nimport { ProjectConfiguration } from \"../../cli/project-configuration.ts\";\nimport { runSandboxCommandEffect, type SandboxCommandFacts, type SandboxCommandFlags, } from \"../cli-commands.ts\";\n/** Sandbox owns this schema: its flags never enter the core CLI parser. */\nexport const SANDBOX_CLI_OPTIONS = Object.freeze({\n all: Object.freeze({ type: \"boolean\", help: Object.freeze({ summary: \"Destroy every kept sandbox.\", visibility: \"public\" }) }),\n window: Object.freeze({ type: \"string\", help: Object.freeze({ summary: \"Select one recorded change window.\", visibility: \"public\" }) }),\n path: Object.freeze({ type: \"string\", help: Object.freeze({ summary: \"Select one path in a sandbox diff.\", visibility: \"public\" }) }),\n \"leave-running\": Object.freeze({ type: \"boolean\", help: Object.freeze({ summary: \"Keep a sandbox alive after leaving its shell.\", visibility: \"public\" }) }),\n record: Object.freeze({ type: \"string\", help: Object.freeze({ summary: \"Use a specific NiceEval record root.\", visibility: \"public\" }) }),\n orphans: Object.freeze({ type: \"boolean\", help: Object.freeze({ summary: \"Inspect unregistered sandbox instances left by terminated runs.\", visibility: \"public\" }) }),\n force: Object.freeze({ type: \"boolean\", help: Object.freeze({ summary: \"Prune unverified orphan candidates too.\", visibility: \"public\" }) }),\n help: Object.freeze({ type: \"boolean\", short: \"h\", help: Object.freeze({ summary: \"Show Sandbox command help.\", visibility: \"public\" }) }),\n} satisfies Readonly<Record<string, CliOptionDefinition>>);\nconst SANDBOX_HELP = `niceeval sandbox — inspect and manage kept sandboxes\n\nUsage:\n niceeval sandbox list [--orphans] [--record <record-root>]\n niceeval sandbox enter <id> [--leave-running] [--record <record-root>]\n niceeval sandbox history <id> [--record <record-root>]\n niceeval sandbox diff <id> [--window <window>] [--path <file>] [--record <record-root>]\n niceeval sandbox stop <id...> [--all] [--record <record-root>]\n niceeval sandbox prune [--force] [--record <record-root>]\n\nCommands:\n list list kept sandboxes or inspect orphan candidates\n enter open a shell in a kept sandbox\n history show the kept sandbox's change windows\n diff print patches from one or all change windows\n stop destroy kept sandboxes and remove their registry entries\n prune destroy orphaned sandbox instances\n`;\nconst SANDBOX_SUBCOMMANDS = [\"list\", \"enter\", \"history\", \"diff\", \"stop\", \"prune\"] as const;\ntype SandboxSubcommand = (typeof SANDBOX_SUBCOMMANDS)[number];\ninterface ParsedSandboxArgs {\n readonly positionals: readonly string[];\n readonly providedOptions: readonly string[];\n readonly flags: SandboxCommandFlags;\n readonly help: boolean;\n}\ntype SandboxCliError = CliFeatureError;\nfunction sandboxFailure(operation: string, cause: unknown, exitCode = 1): SandboxCliError {\n return new CliFeatureError({ feature: \"sandbox\", operation, cause, exitCode });\n}\nfunction isSandboxSubcommand(value: string | undefined): value is SandboxSubcommand {\n return value !== undefined && (SANDBOX_SUBCOMMANDS as readonly string[]).includes(value);\n}\nfunction parseSandboxArgs(argv: readonly string[], parse: (argv: readonly string[], options: Readonly<Record<string, CliOptionDefinition>>) => CliParsedTokens): ParsedSandboxArgs {\n const parsed = parse(argv, SANDBOX_CLI_OPTIONS);\n return Object.freeze({\n positionals: Object.freeze([...parsed.positionals]),\n providedOptions: Object.freeze(parsed.tokens\n .filter((token) => token.kind === \"option\")\n .map((token) => token.name)),\n help: parsed.values.help === true,\n flags: Object.freeze({\n all: parsed.values.all === true,\n ...(typeof parsed.values.window === \"string\" ? { window: parsed.values.window } : {}),\n ...(typeof parsed.values.path === \"string\" ? { path: parsed.values.path } : {}),\n leaveRunning: parsed.values[\"leave-running\"] === true,\n ...(typeof parsed.values.record === \"string\" ? { record: parsed.values.record } : {}),\n orphans: parsed.values.orphans === true,\n force: parsed.values.force === true,\n }),\n });\n}\nconst SANDBOX_SUBCOMMAND_OPTIONS: Readonly<Record<SandboxSubcommand, readonly string[]>> = Object.freeze({\n list: Object.freeze([\"orphans\", \"record\", \"help\"]),\n enter: Object.freeze([\"leave-running\", \"record\", \"help\"]),\n history: Object.freeze([\"record\", \"help\"]),\n diff: Object.freeze([\"window\", \"path\", \"record\", \"help\"]),\n stop: Object.freeze([\"all\", \"record\", \"help\"]),\n prune: Object.freeze([\"force\", \"record\", \"help\"]),\n});\nfunction write(channel: \"stdout\" | \"stderr\", text: string): Effect.Effect<void, SandboxCliError, CliOutput> {\n return Effect.flatMap(CliOutput, (output) => channel === \"stdout\" ? output.writeStdout(text) : output.writeStderr(text)).pipe(Effect.mapError((cause) => sandboxFailure(`write ${channel}`, cause)));\n}\nfunction unknownSandboxCommand(command: string | undefined): string {\n return command === undefined\n ? `usage: niceeval sandbox <${SANDBOX_SUBCOMMANDS.join(\"|\")}> …\\n`\n : `unknown sandbox command ${JSON.stringify(command)}\\n${SANDBOX_HELP}`;\n}\n/**\n * Feature-owned root contribution. Syntax outcomes deliberately finish before\n * credential preparation, so help, version, empty input, and unknown input do\n * not load .env, config, or a provider SDK.\n */\nexport const sandboxCliCommand: CliCommandContribution<CliArguments | CliInvocationFacts | CliOutput | CliPath | ProjectConfiguration, SandboxCliError> = Object.freeze({\n name: \"sandbox\",\n summary: \"inspect, enter, and clean up kept sandboxes\",\n options: SANDBOX_CLI_OPTIONS,\n run: (argv: readonly string[]) => Effect.gen(function* () {\n const argumentsService = yield* CliArguments;\n const parsed = yield* Effect.try({\n try: () => parseSandboxArgs(argv, argumentsService.parse),\n catch: (cause) => sandboxFailure(\"parse sandbox command\", cause, 1),\n });\n const subcommand = parsed.positionals[0];\n if (subcommand === undefined && parsed.help) {\n yield* write(\"stdout\", SANDBOX_HELP);\n return 0;\n }\n if (!isSandboxSubcommand(subcommand)) {\n yield* write(\"stderr\", unknownSandboxCommand(subcommand));\n return 1;\n }\n const unsupportedOption = parsed.providedOptions.find((name) => !SANDBOX_SUBCOMMAND_OPTIONS[subcommand].includes(name));\n if (unsupportedOption !== undefined) {\n yield* write(\"stderr\", `niceeval sandbox ${subcommand} does not accept --${unsupportedOption}.\\n`);\n return 1;\n }\n if (parsed.help) {\n yield* write(\"stdout\", SANDBOX_HELP);\n return 0;\n }\n const invocation = yield* CliInvocationFacts;\n const facts = yield* invocation.facts.pipe(Effect.mapError((cause) => sandboxFailure(\"read invocation facts\", cause)));\n const configuration = yield* ProjectConfiguration;\n yield* configuration.prepare(facts.cwd).pipe(Effect.mapError((cause) => sandboxFailure(\"prepare project credentials\", cause)));\n const path = yield* CliPath;\n const record = parsed.flags.record === undefined ? undefined : path.resolve(facts.cwd, parsed.flags.record);\n const commandFacts: SandboxCommandFacts = Object.freeze({\n leaseHolder: `${facts.pid}@${facts.hostname}`,\n ...(facts.noColor === undefined ? {} : { noColor: facts.noColor }),\n stdout: facts.stdout,\n });\n const output = yield* CliOutput;\n return yield* runSandboxCommandEffect(facts.cwd, [...parsed.positionals], record === undefined ? parsed.flags : { ...parsed.flags, record }, { out: output.writeStdoutSync, err: output.writeStderrSync }, commandFacts).pipe(Effect.mapError((cause) => sandboxFailure(\"run sandbox command\", cause)));\n }),\n});\n"]}
@@ -0,0 +1,71 @@
1
+ import { CliArguments, CliInvocationFacts, CliOutput, CliPath } from "../../cli/application.cjs";
2
+ import { CliFeatureError, type CliCommandContribution } from "../../cli/contribution.cjs";
3
+ import { ProjectConfiguration } from "../../cli/project-configuration.cjs";
4
+ /** Sandbox owns this schema: its flags never enter the core CLI parser. */
5
+ export declare const SANDBOX_CLI_OPTIONS: Readonly<{
6
+ all: Readonly<{
7
+ type: "boolean";
8
+ help: Readonly<{
9
+ summary: "Destroy every kept sandbox.";
10
+ visibility: "public";
11
+ }>;
12
+ }>;
13
+ window: Readonly<{
14
+ type: "string";
15
+ help: Readonly<{
16
+ summary: "Select one recorded change window.";
17
+ visibility: "public";
18
+ }>;
19
+ }>;
20
+ path: Readonly<{
21
+ type: "string";
22
+ help: Readonly<{
23
+ summary: "Select one path in a sandbox diff.";
24
+ visibility: "public";
25
+ }>;
26
+ }>;
27
+ "leave-running": Readonly<{
28
+ type: "boolean";
29
+ help: Readonly<{
30
+ summary: "Keep a sandbox alive after leaving its shell.";
31
+ visibility: "public";
32
+ }>;
33
+ }>;
34
+ record: Readonly<{
35
+ type: "string";
36
+ help: Readonly<{
37
+ summary: "Use a specific NiceEval record root.";
38
+ visibility: "public";
39
+ }>;
40
+ }>;
41
+ orphans: Readonly<{
42
+ type: "boolean";
43
+ help: Readonly<{
44
+ summary: "Inspect unregistered sandbox instances left by terminated runs.";
45
+ visibility: "public";
46
+ }>;
47
+ }>;
48
+ force: Readonly<{
49
+ type: "boolean";
50
+ help: Readonly<{
51
+ summary: "Prune unverified orphan candidates too.";
52
+ visibility: "public";
53
+ }>;
54
+ }>;
55
+ help: Readonly<{
56
+ type: "boolean";
57
+ short: "h";
58
+ help: Readonly<{
59
+ summary: "Show Sandbox command help.";
60
+ visibility: "public";
61
+ }>;
62
+ }>;
63
+ }>;
64
+ type SandboxCliError = CliFeatureError;
65
+ /**
66
+ * Feature-owned root contribution. Syntax outcomes deliberately finish before
67
+ * credential preparation, so help, version, empty input, and unknown input do
68
+ * not load .env, config, or a provider SDK.
69
+ */
70
+ export declare const sandboxCliCommand: CliCommandContribution<CliArguments | CliInvocationFacts | CliOutput | CliPath | ProjectConfiguration, SandboxCliError>;
71
+ export {};
@@ -0,0 +1,71 @@
1
+ import { CliArguments, CliInvocationFacts, CliOutput, CliPath } from "../../cli/application.mjs";
2
+ import { CliFeatureError, type CliCommandContribution } from "../../cli/contribution.mjs";
3
+ import { ProjectConfiguration } from "../../cli/project-configuration.mjs";
4
+ /** Sandbox owns this schema: its flags never enter the core CLI parser. */
5
+ export declare const SANDBOX_CLI_OPTIONS: Readonly<{
6
+ all: Readonly<{
7
+ type: "boolean";
8
+ help: Readonly<{
9
+ summary: "Destroy every kept sandbox.";
10
+ visibility: "public";
11
+ }>;
12
+ }>;
13
+ window: Readonly<{
14
+ type: "string";
15
+ help: Readonly<{
16
+ summary: "Select one recorded change window.";
17
+ visibility: "public";
18
+ }>;
19
+ }>;
20
+ path: Readonly<{
21
+ type: "string";
22
+ help: Readonly<{
23
+ summary: "Select one path in a sandbox diff.";
24
+ visibility: "public";
25
+ }>;
26
+ }>;
27
+ "leave-running": Readonly<{
28
+ type: "boolean";
29
+ help: Readonly<{
30
+ summary: "Keep a sandbox alive after leaving its shell.";
31
+ visibility: "public";
32
+ }>;
33
+ }>;
34
+ record: Readonly<{
35
+ type: "string";
36
+ help: Readonly<{
37
+ summary: "Use a specific NiceEval record root.";
38
+ visibility: "public";
39
+ }>;
40
+ }>;
41
+ orphans: Readonly<{
42
+ type: "boolean";
43
+ help: Readonly<{
44
+ summary: "Inspect unregistered sandbox instances left by terminated runs.";
45
+ visibility: "public";
46
+ }>;
47
+ }>;
48
+ force: Readonly<{
49
+ type: "boolean";
50
+ help: Readonly<{
51
+ summary: "Prune unverified orphan candidates too.";
52
+ visibility: "public";
53
+ }>;
54
+ }>;
55
+ help: Readonly<{
56
+ type: "boolean";
57
+ short: "h";
58
+ help: Readonly<{
59
+ summary: "Show Sandbox command help.";
60
+ visibility: "public";
61
+ }>;
62
+ }>;
63
+ }>;
64
+ type SandboxCliError = CliFeatureError;
65
+ /**
66
+ * Feature-owned root contribution. Syntax outcomes deliberately finish before
67
+ * credential preparation, so help, version, empty input, and unknown input do
68
+ * not load .env, config, or a provider SDK.
69
+ */
70
+ export declare const sandboxCliCommand: CliCommandContribution<CliArguments | CliInvocationFacts | CliOutput | CliPath | ProjectConfiguration, SandboxCliError>;
71
+ export {};
@@ -0,0 +1,71 @@
1
+ import { CliArguments, CliInvocationFacts, CliOutput, CliPath } from "../../cli/application.js";
2
+ import { CliFeatureError, type CliCommandContribution } from "../../cli/contribution.js";
3
+ import { ProjectConfiguration } from "../../cli/project-configuration.js";
4
+ /** Sandbox owns this schema: its flags never enter the core CLI parser. */
5
+ export declare const SANDBOX_CLI_OPTIONS: Readonly<{
6
+ all: Readonly<{
7
+ type: "boolean";
8
+ help: Readonly<{
9
+ summary: "Destroy every kept sandbox.";
10
+ visibility: "public";
11
+ }>;
12
+ }>;
13
+ window: Readonly<{
14
+ type: "string";
15
+ help: Readonly<{
16
+ summary: "Select one recorded change window.";
17
+ visibility: "public";
18
+ }>;
19
+ }>;
20
+ path: Readonly<{
21
+ type: "string";
22
+ help: Readonly<{
23
+ summary: "Select one path in a sandbox diff.";
24
+ visibility: "public";
25
+ }>;
26
+ }>;
27
+ "leave-running": Readonly<{
28
+ type: "boolean";
29
+ help: Readonly<{
30
+ summary: "Keep a sandbox alive after leaving its shell.";
31
+ visibility: "public";
32
+ }>;
33
+ }>;
34
+ record: Readonly<{
35
+ type: "string";
36
+ help: Readonly<{
37
+ summary: "Use a specific NiceEval record root.";
38
+ visibility: "public";
39
+ }>;
40
+ }>;
41
+ orphans: Readonly<{
42
+ type: "boolean";
43
+ help: Readonly<{
44
+ summary: "Inspect unregistered sandbox instances left by terminated runs.";
45
+ visibility: "public";
46
+ }>;
47
+ }>;
48
+ force: Readonly<{
49
+ type: "boolean";
50
+ help: Readonly<{
51
+ summary: "Prune unverified orphan candidates too.";
52
+ visibility: "public";
53
+ }>;
54
+ }>;
55
+ help: Readonly<{
56
+ type: "boolean";
57
+ short: "h";
58
+ help: Readonly<{
59
+ summary: "Show Sandbox command help.";
60
+ visibility: "public";
61
+ }>;
62
+ }>;
63
+ }>;
64
+ type SandboxCliError = CliFeatureError;
65
+ /**
66
+ * Feature-owned root contribution. Syntax outcomes deliberately finish before
67
+ * credential preparation, so help, version, empty input, and unknown input do
68
+ * not load .env, config, or a provider SDK.
69
+ */
70
+ export declare const sandboxCliCommand: CliCommandContribution<CliArguments | CliInvocationFacts | CliOutput | CliPath | ProjectConfiguration, SandboxCliError>;
71
+ export {};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __niceevalCreateRequire } from "node:module";
2
+ const __niceevalRequire = __niceevalCreateRequire(import.meta.url);
3
+ const __niceevalCanonical = __niceevalRequire("./contribution.cjs");
4
+ const __niceevalExport0 = __niceevalCanonical["SANDBOX_CLI_OPTIONS"];
5
+ export { __niceevalExport0 as SANDBOX_CLI_OPTIONS };
6
+ const __niceevalExport1 = __niceevalCanonical["sandboxCliCommand"];
7
+ export { __niceevalExport1 as sandboxCliCommand };
8
+ //# sourceMappingURL=contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contribution.js","sources":[],"names":[],"mappings":""}
@@ -7,8 +7,6 @@ exports.keptSandboxReminderEffect = keptSandboxReminderEffect;
7
7
  // `niceeval sandbox` 命令组:查看与销毁留存的沙箱(见 docs/feature/sandbox/cli.md)。
8
8
  // 不读 niceeval.config.ts、不发现 eval,只操作留存注册表(.niceeval/sandboxes/ 逐条目文件)
9
9
  // 与内置 provider 的 detached 能力;provider 名的路由发生在 CLI / 注册表边界(sandbox/ 域内)。
10
- const node_os_1 = require("node:os");
11
- const node_path_1 = require("node:path");
12
10
  const effect_1 = require("effect");
13
11
  const keep_ts_1 = require("./keep.cjs");
14
12
  const keep_registry_ts_1 = require("./keep-registry.cjs");
@@ -59,18 +57,17 @@ function refreshedEntryState(entry, state, now) {
59
57
  /** `list`/`history` 一次性面板的传输能力:是 TTY 且没有要求朴素输出时才画框
60
58
  * (docs/feature/sandbox/cli.md「输出体裁」)——`sandbox` 命令组只在启动时探测一次,
61
59
  * 不像 `exp` 的 live 面板那样需要随 resize 重新判断。 */
62
- function panelCapabilityForIo(io) {
60
+ function panelCapabilityForFacts(facts) {
63
61
  return (0, panel_ts_1.panelCapabilityOf)({
64
- isTTY: io.isTTY ?? process.stdout.isTTY,
65
- noColor: process.env.NO_COLOR,
66
- width: io.columns ?? process.stdout.columns,
62
+ isTTY: facts.stdout.isTTY,
63
+ noColor: facts.noColor,
64
+ width: facts.stdout.columns,
67
65
  });
68
66
  }
69
- /** Effect 主入口:CLI 可将它接进自己的唯一 runtime,不启动嵌套 Promise runtime。 */
70
- function runSandboxCommandEffect(cwd, positionals, flags, io = { out: (s) => process.stdout.write(s), err: (s) => process.stderr.write(s) }) {
67
+ function runSandboxCommandEffect(cwd, positionals, flags, io, facts) {
71
68
  return effect_1.Effect.gen(function* () {
72
69
  const sub = positionals[0];
73
- const root = yield* resolveRegistryRootEffect(cwd, flags.run);
70
+ const root = yield* resolveRegistryRootEffect(cwd, flags.record);
74
71
  if (root === undefined) {
75
72
  io.err(`No .niceeval directory found from ${cwd} upward. Run this inside the project, or pass --record <record-root> to point at it.\n`);
76
73
  return 1;
@@ -79,13 +76,13 @@ function runSandboxCommandEffect(cwd, positionals, flags, io = { out: (s) => pro
79
76
  case "list":
80
77
  return yield* (flags.orphans
81
78
  ? listOrphansCommandEffect(root, io)
82
- : listCommandEffect(root, io, panelCapabilityForIo(io)));
79
+ : listCommandEffect(root, io, panelCapabilityForFacts(facts)));
83
80
  case "stop":
84
81
  return yield* stopCommandEffect(root, positionals.slice(1), flags, io);
85
82
  case "enter":
86
- return yield* enterCommandEffect(root, positionals.slice(1), flags, io);
83
+ return yield* enterCommandEffect(root, positionals.slice(1), flags, io, facts);
87
84
  case "history":
88
- return yield* historyCommandEffect(root, positionals.slice(1), flags, io, panelCapabilityForIo(io));
85
+ return yield* historyCommandEffect(root, positionals.slice(1), flags, io, panelCapabilityForFacts(facts));
89
86
  case "diff":
90
87
  return yield* diffCommandEffect(root, positionals.slice(1), flags, io);
91
88
  case "prune":
@@ -166,9 +163,8 @@ function orphanReminderEffect(cwd) {
166
163
  }
167
164
  function resolveRegistryRootEffect(cwd, runFlag) {
168
165
  if (runFlag !== undefined) {
169
- const base = (0, node_path_1.resolve)(cwd, runFlag);
170
166
  // --record 可以指 .niceeval 本身或它的父目录。
171
- return effect_1.Effect.succeed(base.endsWith(".niceeval") ? base : `${base}/.niceeval`);
167
+ return effect_1.Effect.succeed(runFlag.endsWith(".niceeval") ? runFlag : `${runFlag}/.niceeval`);
172
168
  }
173
169
  return (0, keep_registry_ts_1.findNiceevalRootEffect)(cwd);
174
170
  }
@@ -252,9 +248,6 @@ function resolveEntriesEffect(root, ids, io) {
252
248
  return resolved;
253
249
  }));
254
250
  }
255
- function leaseHolder() {
256
- return `${process.pid}@${(0, node_os_1.hostname)()}`;
257
- }
258
251
  function stopCommandEffect(root, ids, flags, io) {
259
252
  return effect_1.Effect.gen(function* () {
260
253
  let targets;
@@ -294,8 +287,8 @@ function stopCommandEffect(root, ids, flags, io) {
294
287
  return code;
295
288
  });
296
289
  }
297
- function withLeaseEffect(root, id, entry, op, io, fn) {
298
- const lease = { holder: leaseHolder(), op, acquiredAt: new Date().toISOString(), ttlMs: LEASE_TTL_MS };
290
+ function withLeaseEffect(root, id, entry, op, io, facts, fn) {
291
+ const lease = { holder: facts.leaseHolder, op, acquiredAt: new Date().toISOString(), ttlMs: LEASE_TTL_MS };
299
292
  return (0, keep_registry_ts_1.acquireKeptLeaseEffect)(root, id, lease).pipe(effect_1.Effect.flatMap((acquired) => {
300
293
  if (!acquired.acquired) {
301
294
  io.err(`${entry.sandboxId} is in use by ${acquired.lease.holder} since ${acquired.lease.acquiredAt}\n`);
@@ -304,7 +297,7 @@ function withLeaseEffect(root, id, entry, op, io, fn) {
304
297
  return ensuringWithTypedFinalizer(fn(), (0, keep_registry_ts_1.releaseKeptLeaseEffect)(root, id, acquired.token));
305
298
  }));
306
299
  }
307
- function enterCommandEffect(root, ids, flags, io) {
300
+ function enterCommandEffect(root, ids, flags, io, facts) {
308
301
  return resolveEntriesEffect(root, ids.slice(0, 1), io).pipe(effect_1.Effect.flatMap((resolved) => {
309
302
  if (!resolved || resolved.length === 0) {
310
303
  if (ids.length === 0)
@@ -326,7 +319,7 @@ function enterCommandEffect(root, ids, flags, io) {
326
319
  io.err(`${entry.sandboxId} (${entry.provider}) could not be inspected — check credentials or retry later.\n`);
327
320
  return effect_1.Effect.succeed(1);
328
321
  }
329
- return withLeaseEffect(root, id, entry, "enter", io, () => effect_1.Effect.gen(function* () {
322
+ return withLeaseEffect(root, id, entry, "enter", io, facts, () => effect_1.Effect.gen(function* () {
330
323
  yield* providerEffect("wake kept sandbox", () => (0, keep_ts_1.wakeDetached)(entry.provider, entry.sandboxId));
331
324
  yield* (0, keep_registry_ts_1.updateKeptEntryEffect)(root, id, (current) => refreshedEntryState(current, "alive", new Date().toISOString()));
332
325
  const code = yield* providerEffect("open kept sandbox shell", () => (0, keep_ts_1.openInteractiveShell)(entry.provider, entry.sandboxId, entry.workdir)).pipe(effect_1.Effect.catchAll((error) => effect_1.Effect.sync(() => {