@cnc-tools/storm 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (461) hide show
  1. package/dist/bin/storm.js +12 -9
  2. package/dist/build-info.js +1 -1
  3. package/dist/chunks/{chunk-YF3ICDBY.js → chunk-43MWZLJR.js} +1 -1
  4. package/dist/chunks/chunk-4XT5RC5T.js +98 -0
  5. package/dist/chunks/chunk-7D6LC5JY.js +340 -0
  6. package/dist/chunks/{chunk-WF4KJ7YG.js → chunk-BW2ADH7U.js} +1 -1
  7. package/dist/chunks/chunk-FK4RLDEK.js +40 -0
  8. package/dist/chunks/chunk-FSP3SJ35.js +1429 -0
  9. package/dist/chunks/{chunk-J6ZNYUDV.js → chunk-GQIL3AHY.js} +2 -3
  10. package/dist/chunks/chunk-GSC6SRTW.js +27 -0
  11. package/dist/chunks/chunk-ISGQJIQM.js +852 -0
  12. package/dist/chunks/chunk-IYM44FUX.js +1461 -0
  13. package/dist/chunks/{chunk-XHJGHJBW.js → chunk-LQKNI3EG.js} +38 -279
  14. package/dist/chunks/chunk-NMVODY3P.js +19 -0
  15. package/dist/chunks/{chunk-VJQLMGOH.js → chunk-ODQHQJLE.js} +2761 -3699
  16. package/dist/chunks/chunk-RYRJNHL7.js +55 -0
  17. package/dist/chunks/chunk-SXW6XN4R.js +161 -0
  18. package/dist/chunks/{chunk-OVXD7GES.js → chunk-T6AZIDZD.js} +43 -396
  19. package/dist/chunks/chunk-TEEZL3GA.js +851 -0
  20. package/dist/chunks/chunk-TMQQYHUX.js +80 -0
  21. package/dist/chunks/{chunk-AKKNF3WZ.js → chunk-U7M3ZB3Z.js} +565 -595
  22. package/dist/chunks/{chunk-JQ2HK4RN.js → chunk-Y3BUNNRG.js} +234 -57
  23. package/dist/chunks/{chunk-ZJ2USLAT.js → chunk-YM6TZV4L.js} +394 -416
  24. package/dist/chunks/chunk-YT5OROR7.js +271 -0
  25. package/dist/chunks/{live-app-RIJM3QFD.js → live-app-AZ5N5HBD.js} +36 -12
  26. package/dist/command-tree.d.ts +4 -1
  27. package/dist/command-tree.js +4 -1
  28. package/dist/commands/exec/cleanup.d.ts +3 -3
  29. package/dist/commands/exec/cleanup.js +6 -2
  30. package/dist/commands/exec/command.d.ts +56 -17
  31. package/dist/commands/exec/command.js +51 -39
  32. package/dist/commands/exec/define-run-command.d.ts +752 -0
  33. package/dist/commands/exec/define-run-command.js +58 -0
  34. package/dist/commands/exec/driver-plan.d.ts +30 -0
  35. package/dist/commands/exec/driver-plan.js +44 -0
  36. package/dist/commands/exec/driver-refusals.d.ts +89 -0
  37. package/dist/commands/exec/driver-refusals.js +65 -0
  38. package/dist/commands/exec/exec-words.d.ts +5 -0
  39. package/dist/commands/exec/exec-words.js +31 -0
  40. package/dist/commands/exec/job-summary.d.ts +1 -1
  41. package/dist/commands/exec/job-summary.js +1 -1
  42. package/dist/commands/exec/live-view.js +58 -28
  43. package/dist/commands/exec/mint-failed.js +5 -5
  44. package/dist/commands/exec/outcomes.d.ts +72 -10
  45. package/dist/commands/exec/outcomes.js +38 -10
  46. package/dist/commands/exec/plan-run.d.ts +3 -5
  47. package/dist/commands/exec/plan-run.js +3 -3
  48. package/dist/commands/exec/progress.d.ts +35 -15
  49. package/dist/commands/exec/progress.js +82 -57
  50. package/dist/commands/exec/resource-flags.d.ts +10 -3
  51. package/dist/commands/exec/resource-flags.js +25 -14
  52. package/dist/commands/exec/resource-refusals.d.ts +2 -2
  53. package/dist/commands/exec/resource-refusals.js +10 -10
  54. package/dist/commands/exec/run-bin.d.ts +35 -0
  55. package/dist/commands/exec/run-bin.js +32 -0
  56. package/dist/commands/exec/run-command.d.ts +85 -20
  57. package/dist/commands/exec/run-command.js +142 -238
  58. package/dist/commands/exec/run-metadata.d.ts +29 -17
  59. package/dist/commands/exec/run-metadata.js +38 -16
  60. package/dist/commands/exec/snapshot-text.d.ts +40 -0
  61. package/dist/commands/exec/snapshot-text.js +112 -0
  62. package/dist/commands/exec/test-plan.d.ts +3 -37
  63. package/dist/commands/exec/test-plan.js +11 -28
  64. package/dist/commands/exec/tests-summary.d.ts +21 -12
  65. package/dist/commands/exec/tests-summary.js +67 -39
  66. package/dist/commands/exec/text.d.ts +5 -0
  67. package/dist/commands/exec/text.js +7 -0
  68. package/dist/commands/exec/view.js +22 -13
  69. package/dist/commands/exec/waterfall.d.ts +3 -1
  70. package/dist/commands/exec/waterfall.js +20 -3
  71. package/dist/commands/exec/worker-chart.d.ts +19 -11
  72. package/dist/commands/exec/worker-chart.js +66 -36
  73. package/dist/commands/playwright/command.d.ts +746 -0
  74. package/dist/commands/playwright/command.js +31 -0
  75. package/dist/commands/playwright/metadata.d.ts +4 -0
  76. package/dist/commands/playwright/metadata.js +8 -0
  77. package/dist/commands/runs/facts.d.ts +22 -8
  78. package/dist/commands/runs/facts.js +19 -9
  79. package/dist/commands/runs/list/command.d.ts +34 -8
  80. package/dist/commands/runs/list/command.js +18 -13
  81. package/dist/commands/runs/list/outcomes.d.ts +17 -4
  82. package/dist/commands/runs/logs/command.js +20 -14
  83. package/dist/commands/runs/logs/outcomes.js +1 -1
  84. package/dist/commands/runs/past-run.d.ts +3 -27
  85. package/dist/commands/runs/past-run.js +3 -37
  86. package/dist/commands/runs/show/command.d.ts +36 -8
  87. package/dist/commands/runs/show/command.js +53 -33
  88. package/dist/commands/runs/show/metadata.js +1 -1
  89. package/dist/commands/runs/show/outcomes.d.ts +18 -4
  90. package/dist/commands/runs/show/outcomes.js +37 -16
  91. package/dist/commands/snapshots/build/command.d.ts +898 -0
  92. package/dist/commands/snapshots/build/command.js +511 -0
  93. package/dist/commands/snapshots/build/metadata.d.ts +28 -0
  94. package/dist/commands/snapshots/build/metadata.js +34 -0
  95. package/dist/commands/snapshots/build/outcomes.d.ts +484 -0
  96. package/dist/commands/snapshots/build/outcomes.js +322 -0
  97. package/dist/commands/snapshots/list/command.d.ts +272 -0
  98. package/dist/commands/snapshots/list/command.js +305 -0
  99. package/dist/commands/snapshots/list/metadata.d.ts +16 -0
  100. package/dist/commands/snapshots/list/metadata.js +24 -0
  101. package/dist/commands/snapshots/list/outcomes.d.ts +183 -0
  102. package/dist/commands/snapshots/list/outcomes.js +257 -0
  103. package/dist/commands/snapshots/metadata.d.ts +3 -0
  104. package/dist/commands/snapshots/metadata.js +7 -0
  105. package/dist/commands/vitest/command.d.ts +267 -298
  106. package/dist/commands/vitest/command.js +23 -174
  107. package/dist/commands/vitest/metadata.js +1 -1
  108. package/dist/config/credential-resolver.d.ts +6 -3
  109. package/dist/config/credential-resolver.js +6 -5
  110. package/dist/config-file/define.d.ts +1 -1
  111. package/dist/context.d.ts +44 -24
  112. package/dist/context.js +20 -13
  113. package/dist/core/before-run.d.ts +7 -6
  114. package/dist/core/before-run.js +9 -9
  115. package/dist/core/definition-lookup.d.ts +22 -0
  116. package/dist/core/definition-lookup.js +35 -0
  117. package/dist/core/drivers-of.d.ts +23 -0
  118. package/dist/core/drivers-of.js +13 -0
  119. package/dist/core/events.d.ts +6 -22
  120. package/dist/core/gateways.d.ts +38 -170
  121. package/dist/core/index.d.ts +13 -12
  122. package/dist/core/index.js +12 -11
  123. package/dist/core/launcher-context.d.ts +11 -0
  124. package/dist/core/launcher-context.js +31 -0
  125. package/dist/core/live/package-bin-gateway.d.ts +6 -0
  126. package/dist/core/live/package-bin-gateway.js +24 -0
  127. package/dist/core/package-bin.d.ts +7 -0
  128. package/dist/core/package-bin.js +30 -0
  129. package/dist/core/presentations.d.ts +5 -4
  130. package/dist/core/presentations.js +9 -9
  131. package/dist/core/resource-definition-set.d.ts +39 -0
  132. package/dist/core/resource-definition-set.js +31 -0
  133. package/dist/core/resource-reports.d.ts +38 -5
  134. package/dist/core/resource-reports.js +47 -17
  135. package/dist/core/resource.d.ts +4 -4
  136. package/dist/core/resources.d.ts +8 -7
  137. package/dist/core/resources.js +11 -13
  138. package/dist/core/run-state.d.ts +27 -16
  139. package/dist/core/run-state.js +50 -18
  140. package/dist/core/run.d.ts +42 -54
  141. package/dist/core/run.js +72 -122
  142. package/dist/core/setup-phases.d.ts +14 -0
  143. package/dist/core/setup-phases.js +24 -0
  144. package/dist/core/state-directory.d.ts +2 -2
  145. package/dist/core/state-directory.js +3 -3
  146. package/dist/core/timeline.d.ts +4 -2
  147. package/dist/core/timeline.js +11 -4
  148. package/dist/credential/events.d.ts +20 -0
  149. package/dist/credential/events.js +4 -0
  150. package/dist/credential/index.d.ts +2 -1
  151. package/dist/credential/index.js +6 -5
  152. package/dist/credential/source.d.ts +38 -26
  153. package/dist/credential/source.js +25 -34
  154. package/dist/extension-commands.d.ts +12 -6
  155. package/dist/extension-commands.js +16 -13
  156. package/dist/extensions/github/{world.d.ts → context.d.ts} +1 -1
  157. package/dist/extensions/github/context.js +3 -0
  158. package/dist/extensions/github/definition.d.ts +1 -1
  159. package/dist/extensions/github/definition.js +3 -3
  160. package/dist/extensions/github/extension.d.ts +1 -1
  161. package/dist/extensions/github/index.d.ts +2 -2
  162. package/dist/extensions/github/index.js +4 -4
  163. package/dist/extensions/github/lifecycle.d.ts +3 -3
  164. package/dist/extensions/github/lifecycle.js +14 -14
  165. package/dist/extensions/github/live/context.d.ts +6 -0
  166. package/dist/extensions/github/live/context.js +16 -0
  167. package/dist/extensions/github/resource.d.ts +1 -1
  168. package/dist/extensions/playwright/driver.d.ts +8 -0
  169. package/dist/extensions/playwright/driver.js +60 -0
  170. package/dist/extensions/playwright/extension.d.ts +2 -0
  171. package/dist/extensions/playwright/extension.js +12 -0
  172. package/dist/extensions/playwright/plan/gateways.d.ts +62 -0
  173. package/dist/extensions/playwright/plan/gateways.js +4 -0
  174. package/dist/extensions/playwright/plan/list-output.d.ts +26 -0
  175. package/dist/extensions/playwright/plan/list-output.js +101 -0
  176. package/dist/extensions/playwright/plan/live/list-gateway.d.ts +15 -0
  177. package/dist/extensions/playwright/plan/live/list-gateway.js +100 -0
  178. package/dist/extensions/playwright/plan/plan.d.ts +44 -0
  179. package/dist/extensions/playwright/plan/plan.js +53 -0
  180. package/dist/extensions/testserver/command-tree.d.ts +2 -2
  181. package/dist/extensions/testserver/command-tree.js +2 -3
  182. package/dist/extensions/testserver/commands/app.d.ts +7 -7
  183. package/dist/extensions/testserver/commands/pool/create/command.d.ts +5 -5
  184. package/dist/extensions/testserver/commands/pool/create/command.js +17 -12
  185. package/dist/extensions/testserver/commands/pool/list/command.js +8 -5
  186. package/dist/extensions/testserver/{world.d.ts → context.d.ts} +1 -1
  187. package/dist/extensions/testserver/context.js +4 -0
  188. package/dist/extensions/testserver/definition.d.ts +2 -2
  189. package/dist/extensions/testserver/definition.js +8 -7
  190. package/dist/extensions/testserver/events.d.ts +1 -1
  191. package/dist/extensions/testserver/extension.d.ts +4 -3
  192. package/dist/extensions/testserver/extension.js +33 -20
  193. package/dist/extensions/testserver/index.d.ts +2 -2
  194. package/dist/extensions/testserver/index.js +2 -2
  195. package/dist/extensions/testserver/lifecycle.d.ts +6 -5
  196. package/dist/extensions/testserver/lifecycle.js +9 -8
  197. package/dist/extensions/testserver/live/context.d.ts +8 -0
  198. package/dist/extensions/testserver/live/{world.js → context.js} +6 -7
  199. package/dist/extensions/testserver/options/rules.d.ts +3 -3
  200. package/dist/extensions/testserver/options/rules.js +5 -4
  201. package/dist/extensions/testserver/options/sandboxes.d.ts +3 -2
  202. package/dist/extensions/testserver/options/sandboxes.js +3 -2
  203. package/dist/extensions/testserver/playwright/index.d.ts +33 -0
  204. package/dist/extensions/testserver/playwright/index.js +43 -0
  205. package/dist/extensions/testserver/presentation.d.ts +4 -4
  206. package/dist/extensions/testserver/presentation.js +7 -7
  207. package/dist/extensions/testserver/progress.d.ts +3 -3
  208. package/dist/extensions/testserver/progress.js +3 -3
  209. package/dist/extensions/testserver/provision.d.ts +2 -2
  210. package/dist/extensions/testserver/provision.js +10 -10
  211. package/dist/extensions/testserver/resource.d.ts +2 -2
  212. package/dist/extensions/testserver/result.d.ts +2 -2
  213. package/dist/extensions/testserver/result.js +1 -1
  214. package/dist/extensions/testserver/run/connection.d.ts +1 -1
  215. package/dist/extensions/testserver/run/connection.js +3 -3
  216. package/dist/extensions/testserver/run/sandbox.d.ts +31 -0
  217. package/dist/extensions/testserver/run/sandbox.js +58 -0
  218. package/dist/extensions/testserver/run-sandbox.d.ts +2 -2
  219. package/dist/extensions/testserver/run-sandbox.js +3 -3
  220. package/dist/extensions/testserver/vercel-cli/arguments.d.ts +2 -2
  221. package/dist/extensions/testserver/vercel-cli/arguments.js +6 -6
  222. package/dist/extensions/testserver/vercel-cli/auth-config.d.ts +7 -7
  223. package/dist/extensions/testserver/vercel-cli/auth-config.js +4 -4
  224. package/dist/extensions/testserver/vercel-cli/clock.js +1 -1
  225. package/dist/extensions/testserver/vercel-cli/config-files.js +1 -1
  226. package/dist/extensions/testserver/vercel-cli/context.d.ts +1 -1
  227. package/dist/extensions/testserver/vercel-cli/context.js +2 -2
  228. package/dist/extensions/testserver/vercel-cli/entry.d.ts +1 -1
  229. package/dist/extensions/testserver/vercel-cli/entry.js +1 -1
  230. package/dist/extensions/testserver/vercel-cli/environment.d.ts +5 -5
  231. package/dist/extensions/testserver/vercel-cli/environment.js +6 -6
  232. package/dist/extensions/testserver/vercel-cli/gateways.d.ts +1 -1
  233. package/dist/extensions/testserver/vercel-cli/gateways.js +3 -3
  234. package/dist/extensions/testserver/vercel-cli/index.d.ts +1 -1
  235. package/dist/extensions/testserver/vercel-cli/index.js +8 -9
  236. package/dist/extensions/testserver/vercel-cli/invocation.d.ts +13 -12
  237. package/dist/extensions/testserver/vercel-cli/invocation.js +1 -1
  238. package/dist/extensions/testserver/vercel-cli/{driver.d.ts → invoker.d.ts} +18 -17
  239. package/dist/extensions/testserver/vercel-cli/{driver.js → invoker.js} +8 -8
  240. package/dist/extensions/testserver/vercel-cli/live/config-files.d.ts +2 -2
  241. package/dist/extensions/testserver/vercel-cli/live/config-files.js +2 -2
  242. package/dist/extensions/testserver/vercel-cli/live/process-gateway.js +1 -1
  243. package/dist/extensions/testserver/vercel-cli/report.js +2 -2
  244. package/dist/extensions/testserver/vercel-cli/verbose.js +1 -1
  245. package/dist/extensions/testserver/vitest/config.d.ts +8 -6
  246. package/dist/extensions/testserver/vitest/config.js +10 -16
  247. package/dist/extensions/testserver/vitest/container-scope.d.ts +11 -11
  248. package/dist/extensions/testserver/vitest/container-scope.js +9 -9
  249. package/dist/extensions/testserver/vitest/container-start.d.ts +6 -6
  250. package/dist/extensions/testserver/vitest/container-start.js +14 -11
  251. package/dist/extensions/testserver/vitest/diagnostics.d.ts +1 -1
  252. package/dist/extensions/testserver/vitest/fixtures.d.ts +12 -10
  253. package/dist/extensions/testserver/vitest/fixtures.js +44 -22
  254. package/dist/extensions/testserver/vitest/index.d.ts +1 -1
  255. package/dist/extensions/testserver/vitest/index.js +4 -4
  256. package/dist/extensions/testserver/vitest/types.d.ts +16 -18
  257. package/dist/extensions/testserver/vitest/types.js +2 -2
  258. package/dist/extensions/testserver/vitest/worker-sandbox.d.ts +8 -0
  259. package/dist/extensions/testserver/vitest/worker-sandbox.js +17 -0
  260. package/dist/extensions/vitest/driver.d.ts +8 -0
  261. package/dist/extensions/vitest/driver.js +62 -0
  262. package/dist/extensions/vitest/extension.d.ts +2 -0
  263. package/dist/extensions/vitest/extension.js +8 -0
  264. package/dist/{vitest → extensions/vitest/plan}/gateways.d.ts +1 -26
  265. package/dist/extensions/vitest/plan/gateways.js +3 -0
  266. package/dist/{vitest → extensions/vitest/plan}/live/list-gateway.d.ts +1 -2
  267. package/dist/{vitest → extensions/vitest/plan}/live/list-gateway.js +1 -20
  268. package/dist/extensions/vitest/plan/plan-over.d.ts +38 -0
  269. package/dist/extensions/vitest/plan/plan-over.js +31 -0
  270. package/dist/extensions/vitest/plan/plan.d.ts +24 -0
  271. package/dist/{vitest → extensions/vitest/plan}/plan.js +11 -26
  272. package/dist/extensions.d.ts +43 -30
  273. package/dist/extensions.js +50 -35
  274. package/dist/forward-sigterm.d.ts +8 -0
  275. package/dist/forward-sigterm.js +18 -0
  276. package/dist/launcher-resolvers/index.d.ts +1 -0
  277. package/dist/launcher-resolvers/index.js +2 -1
  278. package/dist/launcher-resolvers/local-services.d.ts +22 -0
  279. package/dist/launcher-resolvers/local-services.js +6 -0
  280. package/dist/live-app.js +9 -7
  281. package/dist/local-services.d.ts +11 -0
  282. package/dist/local-services.js +16 -0
  283. package/dist/playwright/index.d.ts +1 -0
  284. package/dist/playwright/index.js +4 -0
  285. package/dist/playwright/reporter.d.ts +96 -0
  286. package/dist/playwright/reporter.js +162 -0
  287. package/dist/playwright/worker-index.d.ts +7 -0
  288. package/dist/playwright/worker-index.js +20 -0
  289. package/dist/run-directory/gateways.d.ts +167 -0
  290. package/dist/run-directory/gateways.js +2 -0
  291. package/dist/run-directory/index.d.ts +8 -0
  292. package/dist/run-directory/index.js +13 -0
  293. package/dist/run-directory/plan.d.ts +35 -0
  294. package/dist/run-directory/plan.js +24 -0
  295. package/dist/run-directory/reader.d.ts +70 -0
  296. package/dist/run-directory/reader.js +51 -0
  297. package/dist/run-directory/recording.d.ts +95 -0
  298. package/dist/run-directory/recording.js +85 -0
  299. package/dist/{commands/exec → run-directory}/run-collector.d.ts +9 -8
  300. package/dist/{commands/exec → run-directory}/run-collector.js +8 -10
  301. package/dist/{core → run-directory}/run-directory.d.ts +3 -3
  302. package/dist/{core → run-directory}/run-directory.js +2 -2
  303. package/dist/{commands/exec → run-directory}/run-record.d.ts +94 -27
  304. package/dist/run-directory/run-record.js +229 -0
  305. package/dist/{commands/exec → run-directory}/timeline-facts.d.ts +5 -8
  306. package/dist/{commands/exec → run-directory}/timeline-facts.js +11 -25
  307. package/dist/runner/build-snapshots.d.ts +179 -0
  308. package/dist/runner/build-snapshots.js +235 -0
  309. package/dist/runner/context.js +2 -1
  310. package/dist/runner/events.d.ts +73 -33
  311. package/dist/runner/gateways.d.ts +30 -10
  312. package/dist/runner/index.d.ts +15 -17
  313. package/dist/runner/index.js +12 -14
  314. package/dist/runner/live/checkout-gateway.js +15 -7
  315. package/dist/runner/live/snapshot-records.js +8 -7
  316. package/dist/runner/prepare.d.ts +26 -26
  317. package/dist/runner/prepare.js +27 -14
  318. package/dist/runner/ready.d.ts +43 -10
  319. package/dist/runner/ready.js +51 -34
  320. package/dist/runner/recipe.d.ts +48 -4
  321. package/dist/runner/recipe.js +42 -1
  322. package/dist/runner/scope.d.ts +13 -13
  323. package/dist/runner/scope.js +9 -11
  324. package/dist/runner/secrets.d.ts +6 -0
  325. package/dist/runner/secrets.js +10 -0
  326. package/dist/runner/session.d.ts +128 -0
  327. package/dist/runner/session.js +138 -0
  328. package/dist/runner/snapshot-build.d.ts +21 -11
  329. package/dist/runner/snapshot-build.js +11 -16
  330. package/dist/runner/snapshot-cache.d.ts +140 -62
  331. package/dist/runner/snapshot-cache.js +145 -102
  332. package/dist/runner/snapshot-inspect.d.ts +89 -0
  333. package/dist/runner/snapshot-inspect.js +173 -0
  334. package/dist/runner/snapshot-key.d.ts +5 -2
  335. package/dist/runner/snapshot-key.js +1 -1
  336. package/dist/runner/snapshot-save.d.ts +35 -20
  337. package/dist/runner/snapshot-save.js +47 -37
  338. package/dist/runner/snapshot-start.d.ts +25 -0
  339. package/dist/runner/snapshot-start.js +16 -0
  340. package/dist/sdk/extension/ci.d.ts +2 -0
  341. package/dist/sdk/extension/ci.js +6 -0
  342. package/dist/sdk/extension/commands.d.ts +44 -28
  343. package/dist/sdk/extension/commands.js +15 -13
  344. package/dist/sdk/extension/driver.d.ts +143 -0
  345. package/dist/sdk/extension/driver.js +28 -0
  346. package/dist/sdk/extension/index.d.ts +3 -1
  347. package/dist/sdk/extension/index.js +16 -9
  348. package/dist/sdk/extension/{launcher-supplies.d.ts → launcher-context.d.ts} +3 -3
  349. package/dist/sdk/extension/launcher-context.js +5 -0
  350. package/dist/sdk/extension/lifecycle.d.ts +10 -8
  351. package/dist/sdk/extension/lifecycle.js +2 -2
  352. package/dist/sdk/extension/progress.js +2 -2
  353. package/dist/sdk/extension/resource-definition.d.ts +13 -13
  354. package/dist/sdk/extension/resource-definition.js +2 -2
  355. package/dist/sdk/extension/resource.d.ts +13 -13
  356. package/dist/sdk/extension/resource.js +11 -11
  357. package/dist/sdk/extension/time.js +2 -2
  358. package/dist/sdk/index.d.ts +2 -0
  359. package/dist/sdk/index.js +3 -1
  360. package/dist/sdk/run/launcher.d.ts +1 -1
  361. package/dist/sdk/run/launcher.js +4 -3
  362. package/dist/sdk/run/payload.js +1 -1
  363. package/dist/sdk/run/test-events.d.ts +24 -18
  364. package/dist/sdk/run/test-events.js +5 -4
  365. package/dist/sdk/run/test-result-writer.d.ts +77 -0
  366. package/dist/sdk/run/test-result-writer.js +143 -0
  367. package/dist/sdk/run/worker-test-event-writer.d.ts +13 -0
  368. package/dist/sdk/run/worker-test-event-writer.js +31 -0
  369. package/dist/vendor/testserver-sdk/container/container.d.ts +12 -12
  370. package/dist/vendor/testserver-sdk/container/container.js +39 -21
  371. package/dist/vendor/testserver-sdk/factories/build.d.ts +12 -40
  372. package/dist/vendor/testserver-sdk/factories/build.js +15 -66
  373. package/dist/vendor/testserver-sdk/factories/gateways.d.ts +1 -2
  374. package/dist/vendor/testserver-sdk/factories/index.d.ts +1 -3
  375. package/dist/vendor/testserver-sdk/factories/index.js +3 -5
  376. package/dist/vendor/testserver-sdk/index.d.ts +1 -2
  377. package/dist/vendor/testserver-sdk/index.js +5 -6
  378. package/dist/vendor/testserver-sdk/records/body.d.ts +1 -1
  379. package/dist/vendor/testserver-sdk/records/body.js +1 -1
  380. package/dist/vendor/testserver-sdk/testserver/failure.d.ts +4 -3
  381. package/dist/vendor/testserver-sdk/testserver/failure.js +4 -3
  382. package/dist/vitest/index.d.ts +2 -1
  383. package/dist/vitest/index.js +6 -4
  384. package/dist/vitest/test-events.d.ts +6 -16
  385. package/dist/vitest/test-events.js +15 -40
  386. package/dist/vitest/test-results.d.ts +9 -31
  387. package/dist/vitest/test-results.js +34 -105
  388. package/dist/vitest/worker-index.d.ts +6 -0
  389. package/dist/vitest/worker-index.js +17 -0
  390. package/package.json +23 -9
  391. package/skills/overview.md +6 -5
  392. package/skills/read-run-output.md +22 -7
  393. package/dist/chunks/chunk-AGWW3HDT.js +0 -2559
  394. package/dist/chunks/chunk-H2VCSNVU.js +0 -351
  395. package/dist/commands/exec/run-record.js +0 -135
  396. package/dist/commands/vitest/outcomes.d.ts +0 -379
  397. package/dist/commands/vitest/outcomes.js +0 -70
  398. package/dist/core/launcher-supplies.d.ts +0 -11
  399. package/dist/core/launcher-supplies.js +0 -28
  400. package/dist/core/mint.d.ts +0 -10
  401. package/dist/core/mint.js +0 -14
  402. package/dist/core/resource-registry.d.ts +0 -54
  403. package/dist/core/resource-registry.js +0 -57
  404. package/dist/extensions/github/live/world.d.ts +0 -6
  405. package/dist/extensions/github/live/world.js +0 -16
  406. package/dist/extensions/github/world.js +0 -3
  407. package/dist/extensions/testserver/live/world.d.ts +0 -8
  408. package/dist/extensions/testserver/vitest/sandbox.d.ts +0 -25
  409. package/dist/extensions/testserver/vitest/sandbox.js +0 -43
  410. package/dist/extensions/testserver/world.js +0 -4
  411. package/dist/sdk/extension/launcher-supplies.js +0 -3
  412. package/dist/story/align.d.ts +0 -37
  413. package/dist/story/align.js +0 -39
  414. package/dist/story/command-line.d.ts +0 -34
  415. package/dist/story/command-line.js +0 -100
  416. package/dist/story/definition.d.ts +0 -59
  417. package/dist/story/definition.js +0 -9
  418. package/dist/story/diff.d.ts +0 -9
  419. package/dist/story/diff.js +0 -97
  420. package/dist/story/errors.d.ts +0 -14
  421. package/dist/story/errors.js +0 -21
  422. package/dist/story/gateways.d.ts +0 -94
  423. package/dist/story/gateways.js +0 -3
  424. package/dist/story/host.d.ts +0 -30
  425. package/dist/story/host.js +0 -97
  426. package/dist/story/index.d.ts +0 -8
  427. package/dist/story/index.js +0 -10
  428. package/dist/story/json.d.ts +0 -16
  429. package/dist/story/json.js +0 -59
  430. package/dist/story/live/recording-gateway.d.ts +0 -2
  431. package/dist/story/live/recording-gateway.js +0 -103
  432. package/dist/story/mode.d.ts +0 -17
  433. package/dist/story/mode.js +0 -21
  434. package/dist/story/orphans.d.ts +0 -35
  435. package/dist/story/orphans.js +0 -51
  436. package/dist/story/recording.d.ts +0 -62
  437. package/dist/story/recording.js +0 -97
  438. package/dist/story/report.d.ts +0 -42
  439. package/dist/story/report.js +0 -130
  440. package/dist/story/sequence.d.ts +0 -30
  441. package/dist/story/sequence.js +0 -74
  442. package/dist/story/settle.d.ts +0 -96
  443. package/dist/story/settle.js +0 -71
  444. package/dist/story/start.d.ts +0 -50
  445. package/dist/story/start.js +0 -183
  446. package/dist/vendor/testserver-sdk/factories/definition.d.ts +0 -39
  447. package/dist/vendor/testserver-sdk/factories/definition.js +0 -16
  448. package/dist/vendor/testserver-sdk/factories/definitions.d.ts +0 -169
  449. package/dist/vendor/testserver-sdk/factories/definitions.js +0 -245
  450. package/dist/vendor/testserver-sdk/seed/index.d.ts +0 -1
  451. package/dist/vendor/testserver-sdk/seed/index.js +0 -3
  452. package/dist/vendor/testserver-sdk/seed/seed.d.ts +0 -221
  453. package/dist/vendor/testserver-sdk/seed/seed.js +0 -171
  454. package/dist/vitest/find-vitest.d.ts +0 -7
  455. package/dist/vitest/find-vitest.js +0 -28
  456. package/dist/vitest/gateways.js +0 -4
  457. package/dist/vitest/plan.d.ts +0 -51
  458. /package/dist/{vitest → extensions/vitest/plan}/list-output.d.ts +0 -0
  459. /package/dist/{vitest → extensions/vitest/plan}/list-output.js +0 -0
  460. /package/dist/{core → run-directory}/live/run-directory-gateway.d.ts +0 -0
  461. /package/dist/{core → run-directory}/live/run-directory-gateway.js +0 -0
@@ -1,7 +1,40 @@
1
1
  import { z } from "zod";
2
- import type { ResourceDefinition, Row, Warning } from "../sdk/extension/index.ts";
3
- import { type InstanceFacts, type InstanceWarnings } from "./resource-registry.ts";
2
+ import type { Row, Warning } from "../sdk/extension/index.ts";
3
+ import type { DefinitionLookup } from "./definition-lookup.ts";
4
4
  import type { ResourceCleanupRecords, ResourceRanRecords } from "./resource.ts";
5
+ /**
6
+ * A map of resource instances, by resource key, each record naming its definition beside its warnings: what the run's
7
+ * cleanup reports of the instances it released.
8
+ */
9
+ export interface InstanceWarnings {
10
+ readonly [key: string]: {
11
+ readonly definition: string;
12
+ readonly warnings: readonly Warning[];
13
+ };
14
+ }
15
+ /**
16
+ * A map of resource instances, by resource key, each record naming its definition beside its `facts` and its
17
+ * warnings: what a `ran` outcome reports of a run's resource instances.
18
+ */
19
+ export interface InstanceFacts {
20
+ readonly [key: string]: {
21
+ readonly definition: string;
22
+ readonly facts: unknown;
23
+ readonly warnings: readonly Warning[];
24
+ };
25
+ }
26
+ /**
27
+ * The schema of a map of resource instances, by resource key, whose records are each definition's `[name, schema]`:
28
+ * each record is `{ definition: name, facts, warnings }` of one of them, `facts` by the schema it is given. The core
29
+ * gives every definition `z.unknown()`, so `--json-schema` shows each instance's result facts as unknown, and storm
30
+ * reads them as recorded. A map with no definitions to hold is empty.
31
+ */
32
+ export declare function instanceSchema(records: readonly (readonly [string, z.ZodType])[]): z.ZodType<InstanceFacts, InstanceFacts>;
33
+ /**
34
+ * The schema of a map of resource instances, by resource key, as the run's cleanup reports them: each record is
35
+ * `{ definition, warnings }`, `definition` one of `names`. A map with no definitions to hold is empty.
36
+ */
37
+ export declare function cleanupInstanceSchema(names: readonly string[]): z.ZodType<InstanceWarnings, InstanceWarnings>;
5
38
  /**
6
39
  * Every resource definition's reports, for each resource instance a run's maps hold.
7
40
  *
@@ -18,7 +51,7 @@ import type { ResourceCleanupRecords, ResourceRanRecords } from "./resource.ts";
18
51
  * - `ranRows`: the rows `storm runs show` lists for a ran outcome's resources, instance by instance, from its ran
19
52
  * records, which storm keeps in `run.json`.
20
53
  * - `canceledLines`: what a canceled run changed in its resource instances, for a person, from its cleanup records,
21
- * instance by instance, in registry order, then the order the run took them: what each acquire said a canceled run
54
+ * instance by instance, in definition order, then the order the run took them: what each acquire said a canceled run
22
55
  * changed, then what its release finished, then its release's warnings.
23
56
  */
24
57
  export interface ResourceReports {
@@ -32,5 +65,5 @@ export interface ResourceReports {
32
65
  ranRows(ran: ResourceRanRecords): readonly Row[];
33
66
  canceledLines(cleanup: ResourceCleanupRecords): readonly string[];
34
67
  }
35
- /** Every one of `resources`' reports, each instance's from its definition. */
36
- export declare function resourceReports(resources: readonly ResourceDefinition[]): ResourceReports;
68
+ /** Every one of `lookup`'s definitions' reports, each instance's from its definition. */
69
+ export declare function resourceReports(lookup: DefinitionLookup): ResourceReports;
@@ -1,35 +1,65 @@
1
1
  // How the composition layer asks every resource instance the same thing at once when it reports a run: each record
2
- // names its definition, by which the registry orders it. Each map's instances are reported in registry order, by
3
- // definition, then in the map's order. A run's records hold what each resource answered at its lifecycle points and
4
- // the warnings it reported there (`ResourceRanRecords`, `ResourceCleanupRecords`); everything else here derives from
5
- // those warnings, in the launcher, not the resource, in the same words for every resource: the rows an error lists,
6
- // the outcome's warnings and a canceled run's text. The rows and warnings derive from an outcome's data, its JSON,
7
- // which holds each warning.
2
+ // names its definition, by which the resource definition set orders it. Each map's instances are reported in definition
3
+ // order, by definition, then in the map's order. A run's records hold what each resource answered at its lifecycle
4
+ // points and the warnings it reported there (`ResourceRanRecords`, `ResourceCleanupRecords`); everything else here
5
+ // derives from those warnings, in the launcher, not the resource, in the same words for every resource: the rows an
6
+ // error lists, the outcome's warnings and a canceled run's text. The rows and warnings derive from an outcome's data,
7
+ // its JSON, which holds each warning, by the schemas of a map of instances: a `ran` outcome's (`instanceSchema`), each
8
+ // `{ definition, facts, warnings }`, discriminated by `definition`, and the cleanup's (`cleanupInstanceSchema`), each
9
+ // `{ definition, warnings }`. The definition set builds the reports once (`resourceDefinitionSet`,
10
+ // `resource-definition-set.ts`).
8
11
  import { z } from "zod";
9
12
  import { warningRows } from "./reports.js";
10
- import { cleanupInstanceSchema, instanceSchema, resourceRegistry, } from "./resource-registry.js";
11
- /** Every one of `resources`' reports, each instance's from its definition. */
12
- export function resourceReports(resources) {
13
- const { inRegistryOrder } = resourceRegistry(resources);
13
+ /** One warning, as outcomes report it: its reason and its sentence. */
14
+ const warningSchema = z.object({
15
+ /** Its snake_case reason. */
16
+ reason: z.string(),
17
+ message: z.string(),
18
+ });
19
+ /**
20
+ * The schema of a map of resource instances, by resource key, whose records are each definition's `[name, schema]`:
21
+ * each record is `{ definition: name, facts, warnings }` of one of them, `facts` by the schema it is given. The core
22
+ * gives every definition `z.unknown()`, so `--json-schema` shows each instance's result facts as unknown, and storm
23
+ * reads them as recorded. A map with no definitions to hold is empty.
24
+ */
25
+ export function instanceSchema(records) {
26
+ const [first, ...rest] = records.map(([name, facts]) => z.object({ definition: z.literal(name), facts, warnings: z.array(warningSchema) }));
27
+ const record = first === undefined ? z.never() : z.discriminatedUnion("definition", [first, ...rest]);
28
+ return z.record(z.string(), record);
29
+ }
30
+ /**
31
+ * The schema of a map of resource instances, by resource key, as the run's cleanup reports them: each record is
32
+ * `{ definition, warnings }`, `definition` one of `names`. A map with no definitions to hold is empty.
33
+ */
34
+ export function cleanupInstanceSchema(names) {
35
+ const [first, ...rest] = names;
36
+ const record = first === undefined
37
+ ? z.never()
38
+ : z.object({ definition: z.enum([first, ...rest]), warnings: z.array(warningSchema) });
39
+ return z.record(z.string(), record);
40
+ }
41
+ /** Every one of `lookup`'s definitions' reports, each instance's from its definition. */
42
+ export function resourceReports(lookup) {
43
+ const { definitions: resources, inDefinitionOrder } = lookup;
14
44
  // Each warning of `facts`' instances, in order.
15
- const warningsOf = (facts) => inRegistryOrder(facts).flatMap(({ record }) => record.warnings.map(({ reason, message }) => ({ reason, message })));
45
+ const warningsOf = (facts) => inDefinitionOrder(facts).flatMap(({ record }) => record.warnings.map(({ reason, message }) => ({ reason, message })));
16
46
  return {
17
47
  cleanupSchema: cleanupInstanceSchema(resources.map(({ name }) => name)),
18
- // `{ definition, warnings }` for each instance, in registry order, then the records' order.
19
- cleanupFacts: (cleanup) => Object.fromEntries(inRegistryOrder(cleanup).map(({ key, record: { definition, warnings } }) => [key, { definition, warnings }])),
48
+ // `{ definition, warnings }` for each instance, in definition order, then the records' order.
49
+ cleanupFacts: (cleanup) => Object.fromEntries(inDefinitionOrder(cleanup).map(({ key, record: { definition, warnings } }) => [key, { definition, warnings }])),
20
50
  cleanupRows: (facts) => warningRows(warningsOf(facts)),
21
51
  cleanupWarnings: warningsOf,
22
52
  ranSchema: instanceSchema(resources.map(({ name }) => [name, z.unknown()])),
23
- // `{ definition, facts, warnings }` for each instance, in registry order, then the records' order.
24
- ranFacts: (ran) => Object.fromEntries(inRegistryOrder(ran).map(({ key, record: { definition, facts, warnings } }) => [
53
+ // `{ definition, facts, warnings }` for each instance, in definition order, then the records' order.
54
+ ranFacts: (ran) => Object.fromEntries(inDefinitionOrder(ran).map(({ key, record: { definition, facts, warnings } }) => [
25
55
  key,
26
56
  { definition, facts, warnings },
27
57
  ])),
28
58
  ranWarnings: warningsOf,
29
- ranRows: (ran) => inRegistryOrder(ran).flatMap(({ record }) => record.rows),
59
+ ranRows: (ran) => inDefinitionOrder(ran).flatMap(({ record }) => record.rows),
30
60
  // The run releases its instances in reverse order, so the cleanup records come in reverse order of the run's
31
61
  // instances; reversed, they come in the order the run took them.
32
- canceledLines: (cleanup) => inRegistryOrder(Object.fromEntries(Object.entries(cleanup).toReversed())).flatMap(({ record }) => [
62
+ canceledLines: (cleanup) => inDefinitionOrder(Object.fromEntries(Object.entries(cleanup).toReversed())).flatMap(({ record }) => [
33
63
  ...record.canceled,
34
64
  ...record.done,
35
65
  ...record.warnings.map(({ message }) => message),
@@ -1,9 +1,9 @@
1
1
  import type { Refusal, Row, Warning } from "../sdk/extension/index.ts";
2
2
  /**
3
- * Each definition's world, by its name: what the launcher hands each lifecycle. Every definition has one, used or not,
4
- * which all of its resource instances share.
3
+ * Each definition's Context, by its name: what the launcher hands each lifecycle. Every definition has one, used or
4
+ * not, which all of its resource instances share.
5
5
  */
6
- export type ResourceWorlds = Readonly<Record<string, unknown>>;
6
+ export type ResourceContextMap = Readonly<Record<string, unknown>>;
7
7
  /** The core's own lane: readying the runner sandbox. */
8
8
  export type CoreLane = "runner";
9
9
  /**
@@ -114,7 +114,7 @@ export interface ResourceEvent {
114
114
  * with as `resource_refused`, with the run's cleanup.
115
115
  */
116
116
  export interface ResourceRefusal {
117
- readonly kind: "resource-refused";
117
+ readonly kind: "resource_refused";
118
118
  readonly resource: string;
119
119
  readonly definition: string;
120
120
  readonly refusal: Refusal;
@@ -1,11 +1,12 @@
1
1
  import type { CredentialSource } from "../credential/index.ts";
2
- import type { LaneOutcome, ResourceDefinition } from "../sdk/extension/index.ts";
2
+ import type { LaneOutcome } from "../sdk/extension/index.ts";
3
3
  import type { RunEvent, RunProgress } from "./events.ts";
4
- import type { RunInstance, ResourceCleanupRecords, ResourcePayloads, ResourceRanRecords, ResourceRefusal, ResourceRequests, ResourceWorlds, RunLane } from "./resource.ts";
4
+ import type { DefinitionLookup } from "./definition-lookup.ts";
5
+ import type { RunInstance, ResourceCleanupRecords, ResourcePayloads, ResourceRanRecords, ResourceRefusal, ResourceRequests, ResourceContextMap, RunLane } from "./resource.ts";
5
6
  import type { RunStopped } from "./run.ts";
6
7
  /**
7
8
  * How acquiring one resource instance ended, as the policy ranks it: what its acquire answered stays in the instance.
8
- * `refused` carries the outcome it ends the run with: its own refusal, or the run's `mint-failed`.
9
+ * `refused` carries the outcome it ends the run with: its own refusal, or the run's `mint_failed`.
9
10
  */
10
11
  type InstanceOutcome = {
11
12
  readonly kind: "acquired";
@@ -17,7 +18,7 @@ type InstanceOutcome = {
17
18
  };
18
19
  /** The run's credential source failing a mint a resource instance couldn't go on without. */
19
20
  type MintFailedStop = Extract<RunStopped, {
20
- readonly kind: "mint-failed";
21
+ readonly kind: "mint_failed";
21
22
  }>;
22
23
  /**
23
24
  * Finishes one lane's task: reports how lane `lane` ended, by `outcomeOf` its value or as failed when it throws, and
@@ -60,9 +61,9 @@ export interface ResourceInstance {
60
61
  }
61
62
  /**
62
63
  * Each resource `requests` holds, in its order, bound to this run as a resource instance of its definition from
63
- * `resources`, over the definition's world from `worlds`.
64
+ * `lookup`, over the definition's Context from `resourceContexts`.
64
65
  */
65
- export declare function resourceInstances(resources: readonly ResourceDefinition[], worlds: ResourceWorlds, requests: ResourceRequests): readonly ResourceInstance[];
66
+ export declare function resourceInstances({ named }: DefinitionLookup, resourceContexts: ResourceContextMap, requests: ResourceRequests): readonly ResourceInstance[];
66
67
  /**
67
68
  * A lane beside the resources: the runner sandbox, readied by the runner. `stopped` is the outcome its value ends the
68
69
  * run with, which ranks above every resource's refusal; undefined when it doesn't end the run.
@@ -94,7 +95,7 @@ export type Acquisition<T> = {
94
95
  *
95
96
  * A throw rethrows, the beside lane's first, then the resources' in order. Otherwise the outcome ranks, the same with
96
97
  * or without a lane beside them: the user's `signal` (`canceled`), then the beside lane's failure, then each instance's
97
- * refusal in order (its own, or the run's `mint-failed` when the mint it needed failed), then an instance's
98
+ * refusal in order (its own, or the run's `mint_failed` when the mint it needed failed), then an instance's
98
99
  * cancellation. A refusal aborts the other instances, so one that stops on that abort answers `canceled`; ranking every
99
100
  * refusal above every cancellation keeps the refusal that caused it.
100
101
  */
@@ -1,26 +1,24 @@
1
1
  // How a run acquires, announces, hands over and releases its resource instances, through each definition's lifecycle
2
- // over its world (`acquireForRun`, `releaseAfterRun`). One policy serves a run with or without a lane beside the
2
+ // over its Context (`acquireForRun`, `releaseAfterRun`). One policy serves a run with or without a lane beside the
3
3
  // resources, and names no resource. `instanceOf` binds each of the run's resources to the run as a resource instance,
4
4
  // which calls its definition's lifecycle itself, keeps what its acquire took, how acquiring it answered and the
5
5
  // warnings it reported, reports what it reports under its key, and hands each its own back: the routing the core view
6
6
  // of a resource rests on (`ResourceDefinition`).
7
- import { resourceRegistry } from "./resource-registry.js";
8
7
  /**
9
8
  * Each resource `requests` holds, in its order, bound to this run as a resource instance of its definition from
10
- * `resources`, over the definition's world from `worlds`.
9
+ * `lookup`, over the definition's Context from `resourceContexts`.
11
10
  */
12
- export function resourceInstances(resources, worlds, requests) {
13
- const { named } = resourceRegistry(resources);
14
- return Object.entries(requests).map(([key, request]) => instanceOf(named(request.definition, key), key, worlds, request));
11
+ export function resourceInstances({ named }, resourceContexts, requests) {
12
+ return Object.entries(requests).map(([key, request]) => instanceOf(named(request.definition, key), key, resourceContexts, request));
15
13
  }
16
14
  /**
17
15
  * The resource under key `key`, of definition `resource`, bound to this run. It hands the lifecycle only its own
18
- * definition's world, its acquire's own options and secrets, and its release only what its own acquire took, and reads
19
- * back only what this instance's acquire and release answered.
16
+ * definition's Context, its acquire's own options and secrets, and its release only what its own acquire took, and
17
+ * reads back only what this instance's acquire and release answered.
20
18
  */
21
- function instanceOf(resource, key, worlds, request) {
19
+ function instanceOf(resource, key, resourceContexts, request) {
22
20
  const { name } = resource;
23
- const lifecycle = resource.lifecycle(worlds[name]);
21
+ const lifecycle = resource.lifecycle(resourceContexts[name]);
24
22
  const taken = [];
25
23
  let result;
26
24
  // What a canceled run says acquiring it changed, once its acquire answered: none for one that never answered, was
@@ -62,7 +60,7 @@ function instanceOf(resource, key, worlds, request) {
62
60
  }), resourceLaneOutcome);
63
61
  if ("refused" in answered) {
64
62
  const outcome = {
65
- kind: "resource-refused",
63
+ kind: "resource_refused",
66
64
  resource: key,
67
65
  definition: name,
68
66
  refusal: answered,
@@ -71,7 +69,7 @@ function instanceOf(resource, key, worlds, request) {
71
69
  }
72
70
  if ("mintFailed" in answered) {
73
71
  const { failure, target } = answered.mintFailed;
74
- return { kind: "refused", outcome: { kind: "mint-failed", failure, target, runner: false } };
72
+ return { kind: "refused", outcome: { kind: "mint_failed", failure, target, runner: false } };
75
73
  }
76
74
  result = answered;
77
75
  canceled = "acquired" in answered ? (answered.acquired.canceled ?? []) : answered.canceled;
@@ -120,7 +118,7 @@ function instanceOf(resource, key, worlds, request) {
120
118
  *
121
119
  * A throw rethrows, the beside lane's first, then the resources' in order. Otherwise the outcome ranks, the same with
122
120
  * or without a lane beside them: the user's `signal` (`canceled`), then the beside lane's failure, then each instance's
123
- * refusal in order (its own, or the run's `mint-failed` when the mint it needed failed), then an instance's
121
+ * refusal in order (its own, or the run's `mint_failed` when the mint it needed failed), then an instance's
124
122
  * cancellation. A refusal aborts the other instances, so one that stops on that abort answers `canceled`; ranking every
125
123
  * refusal above every cancellation keeps the refusal that caused it.
126
124
  */
@@ -1,8 +1,9 @@
1
1
  import type { MintTarget } from "../credential/index.ts";
2
2
  import type { LaneStates, ResourceDefinition, Span, SpanStatus } from "../sdk/extension/index.ts";
3
- import type { KeptSandbox, RunnerSandboxPlan } from "../runner/index.ts";
3
+ import type { KeptSandbox, RunnerNoSaveReason, RunnerSandboxPlan, StartedFromSnapshot } from "../runner/index.ts";
4
4
  import type { TimedRunEvent } from "./events.ts";
5
5
  import type { RunInstance } from "./resource.ts";
6
+ import { type SetupPhaseName } from "./setup-phases.ts";
6
7
  import type { RanCommand } from "./timing.ts";
7
8
  /** The runner lane's steps, in order. */
8
9
  export type RunnerStepName = "snapshot" | "start" | "upload" | "apply" | "install" | "build";
@@ -24,7 +25,8 @@ export interface RunnerStepState {
24
25
  }
25
26
  /**
26
27
  * What the runner did with its runner snapshot: reused or built one, of the base it holds, or is building one. A reused
27
- * branch snapshot names the branch and HEAD commit of the run that saved it; each is null for a base snapshot.
28
+ * dev snapshot names the branch and HEAD commit of the run that saved it; each is null for a base snapshot. `snapshot`
29
+ * says its kind, its built-at commit and how far it is behind the run.
28
30
  */
29
31
  export type RunnerSnapshotState = {
30
32
  readonly kind: "reused" | "built";
@@ -32,33 +34,39 @@ export type RunnerSnapshotState = {
32
34
  readonly base: string;
33
35
  readonly branch: string | null;
34
36
  readonly head: string | null;
37
+ readonly snapshot: StartedFromSnapshot;
35
38
  } | {
36
39
  readonly kind: "building";
37
40
  readonly summary: string;
38
41
  };
39
42
  /**
40
- * Saving the runner sandbox as a branch snapshot of `branch` (`--save-snapshot`): under way, saved as runner snapshot
41
- * `id` at HEAD commit `head`, or not saved.
43
+ * Saving the runner sandbox as a dev snapshot: under way, saved as runner snapshot `id` at HEAD commit `head`, or
44
+ * not saved. `branch` is HEAD's branch, null when detached.
42
45
  */
43
- export type BranchSnapshotSaveState = {
46
+ export type DevSnapshotSaveState = {
44
47
  readonly kind: "saving";
45
- readonly branch: string;
48
+ readonly branch: string | null;
46
49
  } | {
47
50
  readonly kind: "saved";
48
51
  readonly id: string;
49
- readonly branch: string;
52
+ readonly branch: string | null;
50
53
  readonly head: string;
51
54
  } | {
52
55
  readonly kind: "not-saved";
53
56
  };
54
- /** One vitest worker, as its test events show it. */
57
+ /** One test worker, as its test events show it. */
55
58
  export interface TestWorkerState {
59
+ /** Its worker index, from 0. */
56
60
  readonly worker: number;
57
61
  /** The file it runs, and when it started it; undefined between files. */
58
62
  readonly file: string | undefined;
59
63
  readonly fileStartedAt: number | undefined;
60
- /** When the container start it waits on began; undefined when none is starting. */
61
- readonly containerSince: number | undefined;
64
+ /**
65
+ * The setup phases it waits on, by their writer's names, in the order they started: one for each resource's phases
66
+ * under each label (`setupPhaseKey`), from its start until its own finish, or until the worker's file starts or
67
+ * finishes. One phase finishing leaves the others under way. Empty when none is under way.
68
+ */
69
+ readonly settingUp: readonly SetupPhaseName[];
62
70
  }
63
71
  /** The command's tests, as the test events the run followed show them. */
64
72
  export interface TestsState {
@@ -85,8 +93,10 @@ export interface RunnerState extends Span {
85
93
  readonly activity: "saving-snapshot" | "waiting-for-snapshot" | undefined;
86
94
  /** The runner sandbox the run kept running once it ended, once closing kept it. */
87
95
  readonly kept: KeptSandbox | undefined;
88
- /** Saving the runner sandbox as a branch snapshot, once it began. */
89
- readonly save: BranchSnapshotSaveState | undefined;
96
+ /** Saving the runner sandbox as a dev snapshot, once it began. */
97
+ readonly save: DevSnapshotSaveState | undefined;
98
+ /** Why the run, whose command ended on its own, started no save, once it said so. */
99
+ readonly noSave: RunnerNoSaveReason | undefined;
90
100
  }
91
101
  /** The command: its argument list and how it ended; `stopped` when the run killed it. */
92
102
  export interface CommandState extends Span {
@@ -97,7 +107,7 @@ export interface CommandState extends Span {
97
107
  export interface CleanupState extends Span {
98
108
  /**
99
109
  * What it does with the runner sandbox while it stops and deletes the runner's other sandboxes: keeps it running `ms`
100
- * (`keep`, stopping and deleting it at 0) or saves it as a branch snapshot (`save`); null without a runner sandbox.
110
+ * (`keep`, stopping and deleting it at 0) or saves it as a dev snapshot (`save`); null without a runner sandbox.
101
111
  */
102
112
  readonly runnerSandbox: RunnerSandboxPlan | null;
103
113
  /** The resource keys of the resource instances it releases: each whose acquire took anything, in order. */
@@ -150,9 +160,10 @@ export interface RunState {
150
160
  /** The state before any event: what applying a run's events starts from. */
151
161
  export declare const EMPTY_RUN_STATE: RunState;
152
162
  /**
153
- * The run's state after `timed`. The core applies its own events; the progress of `resources`, the registry's defined
154
- * resources or any others, applies each resource instance's own events, start and end. A resource without progress
155
- * keeps no state: its events' lines are notices. An event of a definition none of `resources` has reaches no lane.
163
+ * The run's state after `timed`. The core applies its own events; the progress of `resources`, the definition set's
164
+ * defined resources or any others, applies each resource instance's own events, start and end. A resource without
165
+ * progress keeps no state: its events' lines are notices. An event of a definition none of `resources` has reaches no
166
+ * lane.
156
167
  */
157
168
  export declare function applyRunEvent(resources: readonly Pick<ResourceDefinition, "name" | "progress">[], state: RunState, timed: TimedRunEvent): RunState;
158
169
  /** Whether a command that ended passed: it exited 0. */
@@ -3,7 +3,9 @@
3
3
  // (`timeline`) projects it once the run is done. Neither keeps a second copy of these rules. The core applies its own
4
4
  // events; each resource's progress (`ResourceProgress`) applies its resource instance's own events, its acquire's
5
5
  // `announce` among them, to its own lane state, which the run's state keeps by resource key, with its definition's
6
- // name. It names no resource.
6
+ // name. Callers apply events through the resource definition set (`applyEvent`, `resource-definition-set.ts`). It names
7
+ // no resource.
8
+ import { setupPhaseKey } from "./setup-phases.js";
7
9
  /** The runner lane's steps, in order. */
8
10
  export const RUNNER_STEPS = ["snapshot", "start", "upload", "apply", "install", "build"];
9
11
  /** The state before any event: what applying a run's events starts from. */
@@ -23,9 +25,10 @@ export const EMPTY_RUN_STATE = {
23
25
  stopping: false,
24
26
  };
25
27
  /**
26
- * The run's state after `timed`. The core applies its own events; the progress of `resources`, the registry's defined
27
- * resources or any others, applies each resource instance's own events, start and end. A resource without progress
28
- * keeps no state: its events' lines are notices. An event of a definition none of `resources` has reaches no lane.
28
+ * The run's state after `timed`. The core applies its own events; the progress of `resources`, the definition set's
29
+ * defined resources or any others, applies each resource instance's own events, start and end. A resource without
30
+ * progress keeps no state: its events' lines are notices. An event of a definition none of `resources` has reaches no
31
+ * lane.
29
32
  */
30
33
  export function applyRunEvent(resources, state, timed) {
31
34
  const at = timed.at.getTime();
@@ -72,6 +75,7 @@ function applyEvent(resources, state, event, at) {
72
75
  activity: undefined,
73
76
  kept: undefined,
74
77
  save: undefined,
78
+ noSave: undefined,
75
79
  },
76
80
  };
77
81
  case "minting":
@@ -207,13 +211,32 @@ function applyRunnerEvent(state, event, at) {
207
211
  switch (event.kind) {
208
212
  case "snapshot-reused":
209
213
  return withRunner(withStep(state, "snapshot", () => ({ status: "done", startedAt: at, endedAt: at })), () => ({
210
- snapshot: { kind: "reused", id: event.snapshotId, base: event.base, branch: event.branch, head: event.head },
214
+ snapshot: {
215
+ kind: "reused",
216
+ id: event.snapshotId,
217
+ base: event.base,
218
+ branch: event.branch,
219
+ head: event.head,
220
+ snapshot: event.snapshot,
221
+ },
211
222
  }));
212
223
  case "snapshot-build-started":
213
224
  return withRunner(withStep(state, "snapshot", () => ({ status: "running", startedAt: at })), () => ({ snapshot: { kind: "building", summary: event.summary } }));
214
225
  case "snapshot-built":
215
226
  return withRunner(withStep(state, "snapshot", () => ({ status: "done", endedAt: at, latest: undefined })), () => ({
216
- snapshot: { kind: "built", id: event.snapshotId, base: event.base, branch: null, head: null },
227
+ snapshot: {
228
+ kind: "built",
229
+ id: event.snapshotId,
230
+ base: event.base,
231
+ branch: null,
232
+ head: null,
233
+ // A run builds its base snapshot at its own base.
234
+ snapshot: {
235
+ kind: "base",
236
+ builtAt: event.base,
237
+ builtBehind: event.builtBehind,
238
+ },
239
+ },
217
240
  activity: undefined,
218
241
  }));
219
242
  case "snapshot-saving":
@@ -249,21 +272,23 @@ function applyRunnerEvent(state, event, at) {
249
272
  return withRunner(state.cleanup === undefined ? state : { ...state, cleanup: { ...state.cleanup, waiting: true } }, () => ({ activity: "waiting-for-snapshot" }));
250
273
  case "sandbox-kept":
251
274
  return withRunner(state, () => ({ kept: { name: event.name, stopsAt: event.stopsAt } }));
252
- case "branch-snapshot-saving":
275
+ case "dev-snapshot-saving":
253
276
  return withRunner(state, () => ({ save: { kind: "saving", branch: event.branch } }));
254
- case "branch-snapshot-saved":
277
+ case "dev-snapshot-saved":
255
278
  return withRunner(state, () => ({
256
279
  save: { kind: "saved", id: event.snapshotId, branch: event.branch, head: event.head },
257
280
  }));
258
- case "branch-snapshot-not-saved":
281
+ case "dev-snapshot-not-saved":
259
282
  return withRunner(state, () => ({ save: { kind: "not-saved" } }));
283
+ case "dev-snapshot-skipped":
284
+ return withRunner(state, () => ({ noSave: event.reason }));
260
285
  // A step's outcome comes from its lane's end, not from the end of its output.
261
286
  case "output-started":
262
287
  case "output-ended":
263
288
  case "snapshot-entry-not-written":
264
289
  case "command-output-started":
265
- case "branch-snapshots-dropped":
266
- case "branch-snapshots-not-dropped":
290
+ case "dev-snapshots-dropped":
291
+ case "dev-snapshots-not-dropped":
267
292
  return state;
268
293
  }
269
294
  }
@@ -284,7 +309,7 @@ function applyTestEvent(tests, event, at) {
284
309
  worker: event.worker,
285
310
  file: undefined,
286
311
  fileStartedAt: undefined,
287
- containerSince: undefined,
312
+ settingUp: [],
288
313
  };
289
314
  const put = (changed, rest = {}) => ({
290
315
  ...tests,
@@ -293,19 +318,26 @@ function applyTestEvent(tests, event, at) {
293
318
  });
294
319
  switch (event.kind) {
295
320
  case "file-started":
296
- return put({ ...worker, file: event.file, fileStartedAt: at, containerSince: undefined });
321
+ return put({ ...worker, file: event.file, fileStartedAt: at, settingUp: [] });
297
322
  case "test-started":
298
323
  return put({ ...worker, file: event.file, fileStartedAt: worker.fileStartedAt ?? at });
299
324
  case "test-attempt-finished":
300
325
  return put(worker);
301
326
  case "file-finished":
302
- return put({ ...worker, file: undefined, fileStartedAt: undefined, containerSince: undefined }, { filesDone: tests.filesDone + 1 });
303
- case "container-starting":
304
- return put({ ...worker, containerSince: at });
305
- case "container-started":
306
- return put({ ...worker, containerSince: undefined });
327
+ return put({ ...worker, file: undefined, fileStartedAt: undefined, settingUp: [] }, { filesDone: tests.filesDone + 1 });
328
+ case "setup-started": {
329
+ const { label, resource } = event;
330
+ return put({ ...worker, settingUp: [...withoutPhase(worker.settingUp, event), { label, resource }] });
331
+ }
332
+ case "setup-finished":
333
+ return put({ ...worker, settingUp: withoutPhase(worker.settingUp, event) });
307
334
  }
308
335
  }
336
+ /** The setup phases under way in `settingUp`, less those that share `phase`'s key. */
337
+ function withoutPhase(settingUp, phase) {
338
+ const key = setupPhaseKey(phase);
339
+ return settingUp.filter((under) => setupPhaseKey(under) !== key);
340
+ }
309
341
  /** The state with the runner lane's fields changed by `change`; unchanged without a runner lane. */
310
342
  function withRunner(state, change) {
311
343
  return state.runner === undefined ? state : { ...state, runner: { ...state.runner, ...change() } };