@cnc-tools/storm 0.11.0 → 0.13.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 (442) hide show
  1. package/dist/bin/storm.js +7 -12
  2. package/dist/build-info.js +1 -1
  3. package/dist/chunks/chunk-2NZXL6OH.js +62 -0
  4. package/dist/chunks/{chunk-3ZZVZPMG.js → chunk-43MWZLJR.js} +1 -1
  5. package/dist/chunks/{chunk-NPPJ57W7.js → chunk-5UMJNVKT.js} +498 -215
  6. package/dist/chunks/{chunk-KR7WIYLG.js → chunk-6EQKA7LI.js} +200 -985
  7. package/dist/chunks/{chunk-4EU4AH7E.js → chunk-AX4EQZUS.js} +186 -144
  8. package/dist/chunks/{chunk-ETCZ6WP7.js → chunk-BW2ADH7U.js} +1 -1
  9. package/dist/chunks/chunk-DOFB2ACU.js +49 -0
  10. package/dist/chunks/chunk-EGNP3S6C.js +161 -0
  11. package/dist/chunks/chunk-GQIL3AHY.js +20 -0
  12. package/dist/chunks/{chunk-ICB4BZJX.js → chunk-GSC6SRTW.js} +7 -2
  13. package/dist/chunks/{chunk-OJOKQRM6.js → chunk-IYM44FUX.js} +30 -26
  14. package/dist/chunks/{chunk-GRMD7G4J.js → chunk-LQKNI3EG.js} +6 -5
  15. package/dist/chunks/chunk-N7E6DAUE.js +40 -0
  16. package/dist/chunks/chunk-NMVODY3P.js +19 -0
  17. package/dist/chunks/{chunk-TRFEAYNC.js → chunk-Q4TKRILH.js} +261 -354
  18. package/dist/chunks/{chunk-VZZTHCBW.js → chunk-RTILVSYQ.js} +5 -18
  19. package/dist/chunks/{chunk-L4ZPMSKQ.js → chunk-T6AZIDZD.js} +43 -363
  20. package/dist/chunks/chunk-X4WBJIOF.js +308 -0
  21. package/dist/chunks/chunk-YGS5VRQT.js +794 -0
  22. package/dist/chunks/{chunk-4PRAB24Y.js → chunk-YM6TZV4L.js} +394 -396
  23. package/dist/chunks/{chunk-AMTYHUYB.js → chunk-YT5OROR7.js} +22 -8
  24. package/dist/chunks/{chunk-O4BUT7BE.js → chunk-ZDJLKF2G.js} +1625 -1583
  25. package/dist/chunks/{live-app-LOGYUBKB.js → live-app-QFHS54SX.js} +25 -46
  26. package/dist/command-tree.d.ts +4 -1
  27. package/dist/command-tree.js +4 -1
  28. package/dist/commands/exec/cleanup.js +4 -4
  29. package/dist/commands/exec/command.d.ts +6 -55
  30. package/dist/commands/exec/command.js +51 -46
  31. package/dist/commands/exec/define-run-command.d.ts +664 -0
  32. package/dist/commands/exec/define-run-command.js +58 -0
  33. package/dist/commands/exec/driver-plan.d.ts +30 -0
  34. package/dist/commands/exec/driver-plan.js +44 -0
  35. package/dist/commands/exec/driver-refusals.d.ts +89 -0
  36. package/dist/commands/exec/driver-refusals.js +65 -0
  37. package/dist/commands/exec/exec-words.d.ts +5 -0
  38. package/dist/commands/exec/exec-words.js +31 -0
  39. package/dist/commands/exec/live-view.js +68 -42
  40. package/dist/commands/exec/mint-failed.js +4 -4
  41. package/dist/commands/exec/outcomes.d.ts +6 -48
  42. package/dist/commands/exec/outcomes.js +10 -12
  43. package/dist/commands/exec/plan-run.js +3 -3
  44. package/dist/commands/exec/progress.d.ts +21 -17
  45. package/dist/commands/exec/progress.js +59 -78
  46. package/dist/commands/exec/resource-flags.d.ts +10 -3
  47. package/dist/commands/exec/resource-flags.js +25 -14
  48. package/dist/commands/exec/resource-refusals.d.ts +1 -1
  49. package/dist/commands/exec/resource-refusals.js +9 -9
  50. package/dist/commands/exec/run-bin.d.ts +35 -0
  51. package/dist/commands/exec/run-bin.js +32 -0
  52. package/dist/commands/exec/run-command.d.ts +64 -23
  53. package/dist/commands/exec/run-command.js +35 -94
  54. package/dist/commands/exec/run-metadata.d.ts +25 -19
  55. package/dist/commands/exec/run-metadata.js +34 -18
  56. package/dist/commands/exec/snapshot-text.d.ts +31 -0
  57. package/dist/commands/exec/snapshot-text.js +72 -0
  58. package/dist/commands/exec/test-plan.d.ts +2 -2
  59. package/dist/commands/exec/test-plan.js +11 -8
  60. package/dist/commands/exec/tests-summary.d.ts +21 -12
  61. package/dist/commands/exec/tests-summary.js +67 -39
  62. package/dist/commands/exec/text.d.ts +5 -0
  63. package/dist/commands/exec/text.js +7 -0
  64. package/dist/commands/exec/view.js +12 -13
  65. package/dist/commands/exec/waterfall.js +4 -4
  66. package/dist/commands/exec/worker-chart.d.ts +19 -11
  67. package/dist/commands/exec/worker-chart.js +66 -36
  68. package/dist/commands/playwright/command.d.ts +658 -0
  69. package/dist/commands/playwright/command.js +31 -0
  70. package/dist/commands/playwright/metadata.js +8 -0
  71. package/dist/commands/runs/facts.d.ts +5 -28
  72. package/dist/commands/runs/facts.js +11 -33
  73. package/dist/commands/runs/list/command.d.ts +4 -50
  74. package/dist/commands/runs/list/command.js +15 -11
  75. package/dist/commands/runs/list/outcomes.d.ts +2 -25
  76. package/dist/commands/runs/logs/command.js +13 -9
  77. package/dist/commands/runs/logs/outcomes.js +1 -1
  78. package/dist/commands/runs/show/command.d.ts +6 -50
  79. package/dist/commands/runs/show/command.js +37 -47
  80. package/dist/commands/runs/show/metadata.js +1 -1
  81. package/dist/commands/runs/show/outcomes.d.ts +3 -25
  82. package/dist/commands/runs/show/outcomes.js +18 -31
  83. package/dist/commands/snapshots/build/command.d.ts +501 -0
  84. package/dist/commands/snapshots/build/command.js +336 -0
  85. package/dist/commands/snapshots/build/metadata.d.ts +28 -0
  86. package/dist/commands/snapshots/build/metadata.js +37 -0
  87. package/dist/commands/snapshots/build/outcomes.d.ts +254 -0
  88. package/dist/commands/snapshots/build/outcomes.js +155 -0
  89. package/dist/commands/snapshots/list/command.d.ts +238 -0
  90. package/dist/commands/snapshots/list/command.js +269 -0
  91. package/dist/commands/snapshots/list/metadata.d.ts +16 -0
  92. package/dist/commands/snapshots/list/metadata.js +24 -0
  93. package/dist/commands/snapshots/list/outcomes.d.ts +148 -0
  94. package/dist/commands/snapshots/list/outcomes.js +217 -0
  95. package/dist/commands/snapshots/metadata.d.ts +3 -0
  96. package/dist/commands/snapshots/metadata.js +7 -0
  97. package/dist/commands/vitest/command.d.ts +185 -304
  98. package/dist/commands/vitest/command.js +23 -181
  99. package/dist/commands/vitest/metadata.js +1 -1
  100. package/dist/config-file/define.d.ts +1 -1
  101. package/dist/context.d.ts +32 -30
  102. package/dist/context.js +13 -17
  103. package/dist/core/before-run.d.ts +5 -5
  104. package/dist/core/before-run.js +8 -8
  105. package/dist/core/definition-lookup.d.ts +5 -5
  106. package/dist/core/definition-lookup.js +13 -12
  107. package/dist/core/drivers-of.d.ts +23 -0
  108. package/dist/core/drivers-of.js +13 -0
  109. package/dist/core/events.d.ts +6 -9
  110. package/dist/core/gateways.d.ts +32 -24
  111. package/dist/core/index.d.ts +7 -5
  112. package/dist/core/index.js +9 -6
  113. package/dist/core/launcher-context.d.ts +11 -0
  114. package/dist/core/launcher-context.js +31 -0
  115. package/dist/core/live/package-bin-gateway.d.ts +6 -0
  116. package/dist/core/live/package-bin-gateway.js +24 -0
  117. package/dist/core/package-bin.d.ts +7 -0
  118. package/dist/core/package-bin.js +30 -0
  119. package/dist/core/presentations.d.ts +1 -1
  120. package/dist/core/presentations.js +6 -5
  121. package/dist/core/{resource-registry.d.ts → resource-definition-set.d.ts} +15 -14
  122. package/dist/core/resource-definition-set.js +31 -0
  123. package/dist/core/resource-reports.d.ts +1 -1
  124. package/dist/core/resource-reports.js +16 -15
  125. package/dist/core/resource.d.ts +4 -4
  126. package/dist/core/resources.d.ts +6 -6
  127. package/dist/core/resources.js +11 -11
  128. package/dist/core/run-state.d.ts +20 -31
  129. package/dist/core/run-state.js +34 -25
  130. package/dist/core/run.d.ts +30 -32
  131. package/dist/core/run.js +33 -39
  132. package/dist/core/setup-phases.d.ts +14 -0
  133. package/dist/core/setup-phases.js +24 -0
  134. package/dist/core/state-directory.d.ts +2 -2
  135. package/dist/core/state-directory.js +3 -3
  136. package/dist/core/timeline.d.ts +4 -2
  137. package/dist/core/timeline.js +11 -5
  138. package/dist/extension-commands.js +6 -10
  139. package/dist/extensions/github/{world.d.ts → context.d.ts} +1 -1
  140. package/dist/extensions/github/context.js +3 -0
  141. package/dist/extensions/github/definition.d.ts +1 -1
  142. package/dist/extensions/github/definition.js +3 -3
  143. package/dist/extensions/github/extension.d.ts +1 -1
  144. package/dist/extensions/github/index.d.ts +2 -2
  145. package/dist/extensions/github/index.js +4 -4
  146. package/dist/extensions/github/lifecycle.d.ts +3 -3
  147. package/dist/extensions/github/lifecycle.js +14 -14
  148. package/dist/extensions/github/live/context.d.ts +6 -0
  149. package/dist/extensions/github/live/context.js +16 -0
  150. package/dist/extensions/github/resource.d.ts +1 -1
  151. package/dist/extensions/playwright/driver.d.ts +8 -0
  152. package/dist/extensions/playwright/driver.js +60 -0
  153. package/dist/extensions/playwright/extension.d.ts +2 -0
  154. package/dist/extensions/playwright/extension.js +12 -0
  155. package/dist/extensions/playwright/plan/gateways.d.ts +62 -0
  156. package/dist/extensions/playwright/plan/gateways.js +4 -0
  157. package/dist/extensions/playwright/plan/list-output.d.ts +26 -0
  158. package/dist/extensions/playwright/plan/list-output.js +101 -0
  159. package/dist/extensions/playwright/plan/live/list-gateway.d.ts +15 -0
  160. package/dist/extensions/playwright/plan/live/list-gateway.js +100 -0
  161. package/dist/extensions/playwright/plan/plan.d.ts +44 -0
  162. package/dist/extensions/playwright/plan/plan.js +53 -0
  163. package/dist/extensions/testserver/command-tree.d.ts +1 -1
  164. package/dist/extensions/testserver/command-tree.js +2 -2
  165. package/dist/extensions/testserver/commands/app.d.ts +7 -7
  166. package/dist/extensions/testserver/commands/pool/create/command.d.ts +5 -5
  167. package/dist/extensions/testserver/commands/pool/create/command.js +12 -13
  168. package/dist/extensions/testserver/commands/pool/list/command.js +5 -6
  169. package/dist/extensions/testserver/{world.d.ts → context.d.ts} +1 -1
  170. package/dist/extensions/testserver/context.js +4 -0
  171. package/dist/extensions/testserver/definition.d.ts +2 -2
  172. package/dist/extensions/testserver/definition.js +8 -7
  173. package/dist/extensions/testserver/events.d.ts +1 -1
  174. package/dist/extensions/testserver/extension.d.ts +4 -3
  175. package/dist/extensions/testserver/extension.js +33 -20
  176. package/dist/extensions/testserver/index.d.ts +2 -2
  177. package/dist/extensions/testserver/index.js +2 -2
  178. package/dist/extensions/testserver/lifecycle.d.ts +6 -5
  179. package/dist/extensions/testserver/lifecycle.js +9 -8
  180. package/dist/extensions/testserver/live/context.d.ts +8 -0
  181. package/dist/extensions/testserver/live/{world.js → context.js} +6 -7
  182. package/dist/extensions/testserver/options/rules.d.ts +3 -3
  183. package/dist/extensions/testserver/options/rules.js +5 -4
  184. package/dist/extensions/testserver/options/sandboxes.d.ts +3 -2
  185. package/dist/extensions/testserver/options/sandboxes.js +3 -2
  186. package/dist/extensions/testserver/playwright/index.d.ts +33 -0
  187. package/dist/extensions/testserver/playwright/index.js +43 -0
  188. package/dist/extensions/testserver/presentation.d.ts +4 -4
  189. package/dist/extensions/testserver/presentation.js +7 -7
  190. package/dist/extensions/testserver/progress.d.ts +3 -3
  191. package/dist/extensions/testserver/progress.js +3 -3
  192. package/dist/extensions/testserver/provision.d.ts +2 -2
  193. package/dist/extensions/testserver/provision.js +10 -10
  194. package/dist/extensions/testserver/resource.d.ts +2 -2
  195. package/dist/extensions/testserver/result.d.ts +2 -2
  196. package/dist/extensions/testserver/result.js +1 -1
  197. package/dist/extensions/testserver/run/connection.d.ts +1 -1
  198. package/dist/extensions/testserver/run/connection.js +3 -3
  199. package/dist/extensions/testserver/run/sandbox.d.ts +31 -0
  200. package/dist/extensions/testserver/run/sandbox.js +58 -0
  201. package/dist/extensions/testserver/run-sandbox.d.ts +2 -2
  202. package/dist/extensions/testserver/run-sandbox.js +3 -3
  203. package/dist/extensions/testserver/vercel-cli/arguments.d.ts +2 -2
  204. package/dist/extensions/testserver/vercel-cli/arguments.js +6 -6
  205. package/dist/extensions/testserver/vercel-cli/auth-config.d.ts +7 -7
  206. package/dist/extensions/testserver/vercel-cli/auth-config.js +4 -4
  207. package/dist/extensions/testserver/vercel-cli/clock.js +1 -1
  208. package/dist/extensions/testserver/vercel-cli/config-files.js +1 -1
  209. package/dist/extensions/testserver/vercel-cli/context.d.ts +1 -1
  210. package/dist/extensions/testserver/vercel-cli/context.js +2 -2
  211. package/dist/extensions/testserver/vercel-cli/entry.d.ts +1 -1
  212. package/dist/extensions/testserver/vercel-cli/entry.js +1 -1
  213. package/dist/extensions/testserver/vercel-cli/environment.d.ts +5 -5
  214. package/dist/extensions/testserver/vercel-cli/environment.js +6 -6
  215. package/dist/extensions/testserver/vercel-cli/gateways.d.ts +1 -1
  216. package/dist/extensions/testserver/vercel-cli/gateways.js +3 -3
  217. package/dist/extensions/testserver/vercel-cli/index.d.ts +1 -1
  218. package/dist/extensions/testserver/vercel-cli/index.js +8 -9
  219. package/dist/extensions/testserver/vercel-cli/invocation.d.ts +13 -12
  220. package/dist/extensions/testserver/vercel-cli/invocation.js +1 -1
  221. package/dist/extensions/testserver/vercel-cli/{driver.d.ts → invoker.d.ts} +18 -17
  222. package/dist/extensions/testserver/vercel-cli/{driver.js → invoker.js} +8 -8
  223. package/dist/extensions/testserver/vercel-cli/live/config-files.d.ts +2 -2
  224. package/dist/extensions/testserver/vercel-cli/live/config-files.js +2 -2
  225. package/dist/extensions/testserver/vercel-cli/live/process-gateway.js +1 -1
  226. package/dist/extensions/testserver/vercel-cli/report.js +2 -2
  227. package/dist/extensions/testserver/vercel-cli/verbose.js +1 -1
  228. package/dist/extensions/testserver/vitest/config.d.ts +3 -3
  229. package/dist/extensions/testserver/vitest/config.js +5 -13
  230. package/dist/extensions/testserver/vitest/container-scope.d.ts +11 -11
  231. package/dist/extensions/testserver/vitest/container-scope.js +9 -9
  232. package/dist/extensions/testserver/vitest/container-start.d.ts +6 -6
  233. package/dist/extensions/testserver/vitest/container-start.js +14 -11
  234. package/dist/extensions/testserver/vitest/diagnostics.d.ts +1 -1
  235. package/dist/extensions/testserver/vitest/fixtures.d.ts +11 -11
  236. package/dist/extensions/testserver/vitest/fixtures.js +14 -23
  237. package/dist/extensions/testserver/vitest/index.d.ts +1 -1
  238. package/dist/extensions/testserver/vitest/index.js +4 -4
  239. package/dist/extensions/testserver/vitest/types.d.ts +16 -18
  240. package/dist/extensions/testserver/vitest/types.js +2 -2
  241. package/dist/extensions/testserver/vitest/worker-sandbox.d.ts +8 -0
  242. package/dist/extensions/testserver/vitest/worker-sandbox.js +17 -0
  243. package/dist/extensions/vitest/driver.d.ts +8 -0
  244. package/dist/extensions/vitest/driver.js +62 -0
  245. package/dist/extensions/vitest/extension.d.ts +2 -0
  246. package/dist/extensions/vitest/extension.js +8 -0
  247. package/dist/{vitest → extensions/vitest/plan}/gateways.d.ts +1 -26
  248. package/dist/extensions/vitest/plan/gateways.js +3 -0
  249. package/dist/{vitest → extensions/vitest/plan}/live/list-gateway.d.ts +1 -2
  250. package/dist/{vitest → extensions/vitest/plan}/live/list-gateway.js +1 -20
  251. package/dist/extensions/vitest/plan/plan-over.d.ts +38 -0
  252. package/dist/extensions/vitest/plan/plan-over.js +31 -0
  253. package/dist/extensions/vitest/plan/plan.d.ts +24 -0
  254. package/dist/{vitest → extensions/vitest/plan}/plan.js +11 -26
  255. package/dist/extensions.d.ts +40 -18
  256. package/dist/extensions.js +49 -22
  257. package/dist/forward-sigterm.js +1 -1
  258. package/dist/launcher-resolvers/index.d.ts +1 -1
  259. package/dist/launcher-resolvers/local-services.d.ts +9 -44
  260. package/dist/launcher-resolvers/local-services.js +4 -5
  261. package/dist/live-app.js +7 -6
  262. package/dist/local-services.d.ts +7 -15
  263. package/dist/local-services.js +8 -29
  264. package/dist/playwright/index.d.ts +1 -0
  265. package/dist/playwright/index.js +4 -0
  266. package/dist/playwright/reporter.d.ts +96 -0
  267. package/dist/playwright/reporter.js +162 -0
  268. package/dist/playwright/worker-index.d.ts +7 -0
  269. package/dist/playwright/worker-index.js +20 -0
  270. package/dist/run-directory/index.d.ts +1 -1
  271. package/dist/run-directory/index.js +2 -3
  272. package/dist/run-directory/plan.d.ts +3 -3
  273. package/dist/run-directory/plan.js +5 -5
  274. package/dist/run-directory/reader.js +2 -2
  275. package/dist/run-directory/recording.d.ts +8 -5
  276. package/dist/run-directory/recording.js +6 -6
  277. package/dist/run-directory/run-collector.d.ts +5 -5
  278. package/dist/run-directory/run-collector.js +5 -5
  279. package/dist/run-directory/run-record.d.ts +17 -90
  280. package/dist/run-directory/run-record.js +15 -55
  281. package/dist/run-directory/timeline-facts.d.ts +2 -1
  282. package/dist/run-directory/timeline-facts.js +4 -2
  283. package/dist/runner/build-snapshots.d.ts +115 -0
  284. package/dist/runner/build-snapshots.js +146 -0
  285. package/dist/runner/context.js +2 -1
  286. package/dist/runner/events.d.ts +24 -69
  287. package/dist/runner/gateways.d.ts +20 -18
  288. package/dist/runner/index.d.ts +8 -7
  289. package/dist/runner/index.js +5 -3
  290. package/dist/runner/live/checkout-gateway.js +15 -7
  291. package/dist/runner/live/snapshot-records.js +7 -17
  292. package/dist/runner/prepare.d.ts +17 -50
  293. package/dist/runner/prepare.js +21 -25
  294. package/dist/runner/ready.d.ts +15 -11
  295. package/dist/runner/ready.js +32 -40
  296. package/dist/runner/recipe.d.ts +4 -18
  297. package/dist/runner/recipe.js +1 -13
  298. package/dist/runner/scope.d.ts +8 -32
  299. package/dist/runner/scope.js +4 -12
  300. package/dist/runner/secrets.d.ts +6 -0
  301. package/dist/runner/secrets.js +10 -0
  302. package/dist/runner/session.d.ts +19 -38
  303. package/dist/runner/session.js +16 -55
  304. package/dist/runner/snapshot-build.d.ts +21 -11
  305. package/dist/runner/snapshot-build.js +11 -16
  306. package/dist/runner/snapshot-cache.d.ts +98 -72
  307. package/dist/runner/snapshot-cache.js +69 -118
  308. package/dist/runner/snapshot-inspect.d.ts +85 -0
  309. package/dist/runner/snapshot-inspect.js +164 -0
  310. package/dist/runner/snapshot-key.d.ts +13 -15
  311. package/dist/runner/snapshot-key.js +15 -22
  312. package/dist/sdk/extension/commands.d.ts +35 -17
  313. package/dist/sdk/extension/commands.js +13 -11
  314. package/dist/sdk/extension/driver.d.ts +143 -0
  315. package/dist/sdk/extension/driver.js +28 -0
  316. package/dist/sdk/extension/index.d.ts +2 -1
  317. package/dist/sdk/extension/index.js +15 -9
  318. package/dist/sdk/extension/{launcher-supplies.d.ts → launcher-context.d.ts} +3 -3
  319. package/dist/sdk/extension/launcher-context.js +5 -0
  320. package/dist/sdk/extension/lifecycle.d.ts +6 -5
  321. package/dist/sdk/extension/lifecycle.js +2 -2
  322. package/dist/sdk/extension/resource-definition.d.ts +13 -13
  323. package/dist/sdk/extension/resource-definition.js +2 -2
  324. package/dist/sdk/extension/resource.d.ts +13 -13
  325. package/dist/sdk/extension/resource.js +11 -11
  326. package/dist/sdk/extension/time.js +2 -2
  327. package/dist/sdk/index.d.ts +2 -0
  328. package/dist/sdk/index.js +3 -1
  329. package/dist/sdk/run/launcher.d.ts +1 -1
  330. package/dist/sdk/run/launcher.js +4 -3
  331. package/dist/sdk/run/payload.js +1 -1
  332. package/dist/sdk/run/test-events.d.ts +24 -18
  333. package/dist/sdk/run/test-events.js +5 -4
  334. package/dist/sdk/run/test-result-writer.d.ts +77 -0
  335. package/dist/sdk/run/test-result-writer.js +143 -0
  336. package/dist/sdk/run/worker-test-event-writer.d.ts +13 -0
  337. package/dist/sdk/run/worker-test-event-writer.js +31 -0
  338. package/dist/vendor/testserver-sdk/container/container.d.ts +1 -6
  339. package/dist/vendor/testserver-sdk/container/container.js +1 -5
  340. package/dist/vendor/testserver-sdk/factories/build.d.ts +12 -40
  341. package/dist/vendor/testserver-sdk/factories/build.js +15 -66
  342. package/dist/vendor/testserver-sdk/factories/gateways.d.ts +1 -2
  343. package/dist/vendor/testserver-sdk/factories/index.d.ts +1 -3
  344. package/dist/vendor/testserver-sdk/factories/index.js +3 -5
  345. package/dist/vendor/testserver-sdk/index.d.ts +1 -2
  346. package/dist/vendor/testserver-sdk/index.js +5 -6
  347. package/dist/vendor/testserver-sdk/records/body.d.ts +1 -1
  348. package/dist/vendor/testserver-sdk/records/body.js +1 -1
  349. package/dist/vitest/index.d.ts +2 -1
  350. package/dist/vitest/index.js +6 -4
  351. package/dist/vitest/test-events.d.ts +6 -16
  352. package/dist/vitest/test-events.js +15 -40
  353. package/dist/vitest/test-results.d.ts +9 -31
  354. package/dist/vitest/test-results.js +34 -105
  355. package/dist/vitest/worker-index.d.ts +6 -0
  356. package/dist/vitest/worker-index.js +17 -0
  357. package/package.json +23 -9
  358. package/skills/overview.md +6 -8
  359. package/skills/read-run-output.md +21 -7
  360. package/dist/chunks/chunk-FVMQKYTT.js +0 -10
  361. package/dist/chunks/chunk-SLNKW4ZM.js +0 -40
  362. package/dist/chunks/chunk-WNIQA5J6.js +0 -19
  363. package/dist/chunks/chunk-WSIF7SR6.js +0 -10
  364. package/dist/commands/vitest/outcomes.d.ts +0 -379
  365. package/dist/commands/vitest/outcomes.js +0 -70
  366. package/dist/core/launcher-supplies.d.ts +0 -11
  367. package/dist/core/launcher-supplies.js +0 -28
  368. package/dist/core/live/terminal-command-gateway.d.ts +0 -8
  369. package/dist/core/live/terminal-command-gateway.js +0 -49
  370. package/dist/core/resource-registry.js +0 -30
  371. package/dist/extensions/github/live/world.d.ts +0 -6
  372. package/dist/extensions/github/live/world.js +0 -16
  373. package/dist/extensions/github/world.js +0 -3
  374. package/dist/extensions/story/command-tree.d.ts +0 -6
  375. package/dist/extensions/story/command-tree.js +0 -21
  376. package/dist/extensions/story/commands/app.d.ts +0 -23
  377. package/dist/extensions/story/commands/app.js +0 -5
  378. package/dist/extensions/story/commands/run/command.d.ts +0 -211
  379. package/dist/extensions/story/commands/run/command.js +0 -259
  380. package/dist/extensions/story/commands/run/metadata.js +0 -8
  381. package/dist/extensions/story/commands/run/outcomes.d.ts +0 -101
  382. package/dist/extensions/story/commands/run/outcomes.js +0 -73
  383. package/dist/extensions/story/commands/tree.d.ts +0 -2
  384. package/dist/extensions/story/commands/tree.js +0 -6
  385. package/dist/extensions/story/extension.d.ts +0 -2
  386. package/dist/extensions/story/extension.js +0 -8
  387. package/dist/extensions/testserver/live/world.d.ts +0 -8
  388. package/dist/extensions/testserver/vitest/sandbox.d.ts +0 -25
  389. package/dist/extensions/testserver/vitest/sandbox.js +0 -43
  390. package/dist/extensions/testserver/world.js +0 -4
  391. package/dist/runner/snapshot-save.d.ts +0 -56
  392. package/dist/runner/snapshot-save.js +0 -151
  393. package/dist/sdk/extension/launcher-supplies.js +0 -3
  394. package/dist/story/align.d.ts +0 -37
  395. package/dist/story/align.js +0 -39
  396. package/dist/story/command-line.d.ts +0 -24
  397. package/dist/story/command-line.js +0 -88
  398. package/dist/story/definition.d.ts +0 -59
  399. package/dist/story/definition.js +0 -9
  400. package/dist/story/diff.d.ts +0 -9
  401. package/dist/story/diff.js +0 -97
  402. package/dist/story/errors.d.ts +0 -14
  403. package/dist/story/errors.js +0 -21
  404. package/dist/story/gateways.d.ts +0 -94
  405. package/dist/story/gateways.js +0 -3
  406. package/dist/story/host.d.ts +0 -30
  407. package/dist/story/host.js +0 -97
  408. package/dist/story/index.d.ts +0 -8
  409. package/dist/story/index.js +0 -11
  410. package/dist/story/json.d.ts +0 -16
  411. package/dist/story/json.js +0 -59
  412. package/dist/story/launch.d.ts +0 -70
  413. package/dist/story/launch.js +0 -77
  414. package/dist/story/live/recording-gateway.d.ts +0 -2
  415. package/dist/story/live/recording-gateway.js +0 -103
  416. package/dist/story/orphans.d.ts +0 -35
  417. package/dist/story/orphans.js +0 -51
  418. package/dist/story/recording.d.ts +0 -62
  419. package/dist/story/recording.js +0 -97
  420. package/dist/story/report.d.ts +0 -42
  421. package/dist/story/report.js +0 -129
  422. package/dist/story/sequence.d.ts +0 -30
  423. package/dist/story/sequence.js +0 -74
  424. package/dist/story/settle.d.ts +0 -96
  425. package/dist/story/settle.js +0 -71
  426. package/dist/story/start.d.ts +0 -50
  427. package/dist/story/start.js +0 -183
  428. package/dist/vendor/testserver-sdk/factories/definition.d.ts +0 -39
  429. package/dist/vendor/testserver-sdk/factories/definition.js +0 -16
  430. package/dist/vendor/testserver-sdk/factories/definitions.d.ts +0 -169
  431. package/dist/vendor/testserver-sdk/factories/definitions.js +0 -245
  432. package/dist/vendor/testserver-sdk/seed/index.d.ts +0 -1
  433. package/dist/vendor/testserver-sdk/seed/index.js +0 -3
  434. package/dist/vendor/testserver-sdk/seed/seed.d.ts +0 -221
  435. package/dist/vendor/testserver-sdk/seed/seed.js +0 -171
  436. package/dist/vitest/find-vitest.d.ts +0 -7
  437. package/dist/vitest/find-vitest.js +0 -28
  438. package/dist/vitest/gateways.js +0 -4
  439. package/dist/vitest/plan.d.ts +0 -51
  440. /package/dist/{extensions/story/commands/run → commands/playwright}/metadata.d.ts +0 -0
  441. /package/dist/{vitest → extensions/vitest/plan}/list-output.d.ts +0 -0
  442. /package/dist/{vitest → extensions/vitest/plan}/list-output.js +0 -0
@@ -2,11 +2,12 @@ import {
2
2
  versionText
3
3
  } from "./chunk-I5GZLOLQ.js";
4
4
  import {
5
- forwardSigterm
6
- } from "./chunk-WNIQA5J6.js";
5
+ redactStrings,
6
+ redactingObserver,
7
+ redactingTerminal,
8
+ redactor
9
+ } from "./chunk-N7E6DAUE.js";
7
10
  import {
8
- RESOURCE_FLAG_HELP,
9
- RESOURCE_USAGE_FLAGS,
10
11
  criticalPathStep,
11
12
  recordedPlan,
12
13
  resourceFlagFields,
@@ -16,38 +17,49 @@ import {
16
17
  testsChart,
17
18
  testsSummaryLines,
18
19
  waterfallLines
19
- } from "./chunk-4EU4AH7E.js";
20
+ } from "./chunk-AX4EQZUS.js";
20
21
  import {
21
- REGISTRY,
22
+ builtAtText,
23
+ rejectionLines,
24
+ snapshotCacheNoteText
25
+ } from "./chunk-2NZXL6OH.js";
26
+ import {
27
+ DEFINITION_SET,
22
28
  RESOURCES
23
- } from "./chunk-NPPJ57W7.js";
29
+ } from "./chunk-5UMJNVKT.js";
30
+ import {
31
+ sandboxConnectPage
32
+ } from "./chunk-NMVODY3P.js";
33
+ import {
34
+ recordRun,
35
+ timelineSchema
36
+ } from "./chunk-YGS5VRQT.js";
24
37
  import {
25
38
  isoSecondsText,
26
39
  keepTimeText,
27
40
  paint,
28
41
  releaseText,
29
- sandboxConnectPage,
30
42
  seconds,
31
43
  short,
32
44
  shortFile,
33
45
  spread,
34
46
  truncate,
35
- visibleLength
36
- } from "./chunk-VZZTHCBW.js";
47
+ visibleLength,
48
+ withArticle
49
+ } from "./chunk-RTILVSYQ.js";
37
50
  import {
38
51
  EMPTY_RUN_STATE,
39
52
  cleanupProblems,
40
53
  commandExitStatus,
41
54
  executeRun,
42
55
  megabytesText,
43
- recordRun,
44
- saveSchema,
45
56
  secondsOf,
46
57
  secondsText,
58
+ setupPhaseKey,
59
+ setupPhaseWords,
47
60
  timedProgress,
48
- timelineSchema,
49
61
  warningTally
50
- } from "./chunk-KR7WIYLG.js";
62
+ } from "./chunk-6EQKA7LI.js";
51
63
  import {
52
64
  RUNNER_SECRET_MIN_LENGTH,
53
65
  configErrors,
@@ -60,25 +72,23 @@ import {
60
72
  prepareRunner,
61
73
  readRunnerSecrets,
62
74
  recipeRun,
63
- redactSecrets,
64
75
  requireTarget,
65
- runStepTakesSecret,
66
76
  settleCredential,
67
77
  settleRunResources
68
- } from "./chunk-O4BUT7BE.js";
78
+ } from "./chunk-ZDJLKF2G.js";
69
79
  import {
70
80
  describeMintFailure,
71
81
  isCi
72
- } from "./chunk-AMTYHUYB.js";
82
+ } from "./chunk-YT5OROR7.js";
83
+ import {
84
+ NodeSignalCancellation
85
+ } from "./chunk-BW2ADH7U.js";
73
86
  import {
74
87
  defineErrors,
75
88
  defineOutcomes,
76
89
  refused,
77
90
  renderOutcome
78
- } from "./chunk-4PRAB24Y.js";
79
-
80
- // src/commands/exec/outcomes.ts
81
- import { z as z4 } from "zod";
91
+ } from "./chunk-YM6TZV4L.js";
82
92
 
83
93
  // src/commands/exec/cleanup.ts
84
94
  import { z } from "zod";
@@ -162,7 +172,7 @@ function runCleanupOf(reports) {
162
172
  rows
163
173
  };
164
174
  }
165
- var RUN_CLEANUP = runCleanupOf(REGISTRY.reports);
175
+ var RUN_CLEANUP = runCleanupOf(DEFINITION_SET.reports);
166
176
  function runnerCleanupOf(report) {
167
177
  if (report === null) return null;
168
178
  const { kept, target } = report;
@@ -179,6 +189,9 @@ function runnerCleanupOf(report) {
179
189
  };
180
190
  }
181
191
 
192
+ // src/commands/exec/outcomes.ts
193
+ import { z as z4 } from "zod";
194
+
182
195
  // src/commands/exec/mint-failed.ts
183
196
  import { z as z2 } from "zod";
184
197
  var mintFailedErrors = defineErrors({
@@ -343,7 +356,7 @@ var ranSchema = z4.object({
343
356
  * definition's name (`definition`), its facts (`facts`, what its acquire answered, unknown to the schema, or null
344
357
  * when it answered none) and the warnings its acquire reported (`warnings`).
345
358
  */
346
- resources: REGISTRY.reports.ranSchema,
359
+ resources: DEFINITION_SET.reports.ranSchema,
347
360
  /**
348
361
  * What the run's cleanup left: the runner sandbox it kept running and the runner's sandboxes it couldn't stop or
349
362
  * delete (`runner`, null without a runner sandbox), and what releasing each of its resource instances couldn't do,
@@ -359,21 +372,19 @@ var ranSchema = z4.object({
359
372
  runner: z4.object({
360
373
  /** The runner snapshot it started from. */
361
374
  snapshotId: z4.string(),
362
- /** The runner snapshot's base, a full SHA. */
375
+ /** The runner snapshot's base, a full SHA: the commit it was built at. */
363
376
  base: z4.string(),
364
- /** For a branch snapshot, the local branch of the run that saved it; null for a base snapshot. */
365
- snapshotBranch: z4.string().nullable(),
366
- /** For a branch snapshot, the HEAD commit of the run that saved it, a full SHA; null for a base snapshot. */
367
- snapshotHead: z4.string().nullable(),
377
+ /** How many commits HEAD has that the snapshot's base lacks, 0 for a snapshot built at HEAD's commit. */
378
+ builtBehind: z4.number(),
379
+ /** How many bytes of changes the run uploaded on top of the snapshot's base. */
380
+ uploadBytes: z4.number(),
368
381
  /** Whether this run built the runner snapshot. */
369
382
  built: z4.boolean(),
370
383
  vcpus: z4.number(),
371
384
  region: z4.string(),
372
385
  runtime: z4.string(),
373
386
  /** How long the build step took, in milliseconds. */
374
- buildMs: z4.number(),
375
- /** How saving the runner sandbox as a branch snapshot ended; null when the run started no save. */
376
- save: saveSchema.nullable()
387
+ buildMs: z4.number()
377
388
  }).nullable(),
378
389
  /** The run's waterfall, as the run directory's timeline.json holds it: each lane's label, span and steps in milliseconds since the run started, how they ended, idle time, and the critical path. */
379
390
  timeline: timelineSchema,
@@ -383,7 +394,7 @@ var ranSchema = z4.object({
383
394
  var RAN_DESCRIPTION = "The command ran and ended. storm exits with its code, or 128 + n when signal n ended it, whatever this result's exit code.";
384
395
  function renderRan(ran) {
385
396
  const warnings = [
386
- ...REGISTRY.reports.ranWarnings(ran.resources),
397
+ ...DEFINITION_SET.reports.ranWarnings(ran.resources),
387
398
  ...ran.runner !== null && ran.command.exitCode === null && ran.command.signal === null ? [
388
399
  {
389
400
  reason: "sandboxed_no_exit_code",
@@ -391,7 +402,7 @@ function renderRan(ran) {
391
402
  }
392
403
  ] : [],
393
404
  ...runnerCleanupWarnings(ran.cleanup.runner),
394
- ...REGISTRY.reports.cleanupWarnings(ran.cleanup.resources)
405
+ ...DEFINITION_SET.reports.cleanupWarnings(ran.cleanup.resources)
395
406
  ];
396
407
  const kept = ran.cleanup.runner?.kept ?? null;
397
408
  return renderOutcome({
@@ -593,134 +604,6 @@ var outcomes = defineOutcomes({
593
604
  errors: RUN_ERRORS
594
605
  });
595
606
 
596
- // src/commands/exec/redaction.ts
597
- function redactor(secrets) {
598
- const kept = secrets.filter((secret) => secret !== "");
599
- return kept.length === 0 ? (text) => text : (text) => redactSecrets(text, kept);
600
- }
601
- function redactStrings(value, redact) {
602
- if (typeof value === "string") return redact(value);
603
- if (Array.isArray(value)) return value.map((each) => redactStrings(each, redact));
604
- if (typeof value === "object" && value !== null) {
605
- const prototype = Object.getPrototypeOf(value);
606
- if (prototype !== Object.prototype && prototype !== null) return value;
607
- return Object.fromEntries(
608
- Object.entries(value).map(([key, each]) => [key, redactStrings(each, redact)])
609
- );
610
- }
611
- return value;
612
- }
613
- function redactingObserver(observer, redact) {
614
- return {
615
- observe: async (timed) => await observer.observe({ event: redactStrings(timed.event, redact), at: timed.at })
616
- };
617
- }
618
- function redactingTerminal(terminal, redact) {
619
- return {
620
- color: terminal.color,
621
- writeStdout: (text) => terminal.writeStdout(redact(text)),
622
- writeStderr: (text) => terminal.writeStderr(redact(text))
623
- };
624
- }
625
-
626
- // src/commands/exec/plan-run.ts
627
- async function planRun(app, lifecycles, request, planCommand, signal) {
628
- const file = await loadSettingsFile(app.context.config, app.cwd, RESOURCES);
629
- if (!file.ok) return file;
630
- const configFile = file.path;
631
- const settings = fileSettings(file, request);
632
- let where;
633
- if (request.unsandboxed) where = { kind: "unsandboxed" };
634
- else {
635
- if (settings.runner === void 0) return refused(runErrors.missingRunner({ configFile }));
636
- const required = requireTarget(settings.scope, settings.project);
637
- if (!required.ok) return required;
638
- const recipe = settings.runner.value;
639
- const secrets = readRunnerSecrets(recipe, app.env);
640
- if (!secrets.ok)
641
- return refused(
642
- runErrors.runnerSecretsInvalid({
643
- variables: secrets.variables.map(({ name, problem }) => ({ name, problem })),
644
- minLength: RUNNER_SECRET_MIN_LENGTH,
645
- configFile
646
- })
647
- );
648
- where = { kind: "runner", recipe, target: required.target, secrets: secrets.values };
649
- }
650
- const merged = settleRunResources(file, request.given);
651
- if (!merged.ok) return merged;
652
- const command = await planCommand(where, signal);
653
- if (signal.aborted) return refused(canceledBeforeStart());
654
- if (!command.ok) {
655
- const secrets = [
656
- ...where.kind === "runner" ? Object.values(where.secrets) : [],
657
- ...lifecycles.secrets(merged.options)
658
- ];
659
- return refused(secrets.length === 0 ? command.refusal : redactStrings(command.refusal, redactor(secrets)));
660
- }
661
- const run = Object.freeze({ testPlan: command.testPlan });
662
- const resolved = merged.plan(run);
663
- if (!resolved.ok) return resolved;
664
- return {
665
- ok: true,
666
- configFile,
667
- settings,
668
- where,
669
- argv: command.argv,
670
- testPlan: command.testPlan,
671
- resources: resolved.resources,
672
- planOptions: resolved.planned.map(planOption)
673
- };
674
- }
675
- function planOption({ path, value, source }) {
676
- return { path, value, from: source };
677
- }
678
- async function resourcesBeforeRun(lifecycles, plan, request) {
679
- const { configFile, resources, settings } = plan;
680
- const used = await lifecycles.beforeRun(resources);
681
- if (!used.ok) return refused(resourceRefusedBeforeRun(used.resource, used.refusal, configFile));
682
- if (request.credential !== void 0 && !used.needsVercelCredential)
683
- return refused(runErrors.credentialUnused({ flags: ["--credential"], configFile }));
684
- let where;
685
- if (plan.where.kind === "runner") where = plan.where;
686
- else if (used.needsVercelCredential) {
687
- const chosen = settleCredential(request.credential ?? "mint", settings.scope, settings.project);
688
- if (!chosen.ok) return chosen;
689
- where = { kind: "unsandboxed", credential: chosen.credential };
690
- } else where = { kind: "unsandboxed", credential: void 0 };
691
- return { ok: true, where, used };
692
- }
693
- function canceledBeforeStart() {
694
- return outcomes.canceled({ changed: "The command didn't run.\nNothing was minted, acquired or started." });
695
- }
696
-
697
- // src/commands/exec/run-command.ts
698
- import { z as z5 } from "zod";
699
-
700
- // src/commands/exec/job-summary.ts
701
- function jobSummaryMarkdown(timeline, extras) {
702
- const lines = [`### storm ${extras.command}`, ""];
703
- if (timeline.rows.length > 0) {
704
- lines.push("| Lane | Start | Duration | Idle | Steps |", "| --- | ---: | ---: | ---: | --- |");
705
- for (const row of timeline.rows) lines.push(tableRow(row));
706
- lines.push("");
707
- }
708
- if (timeline.criticalPath.length > 0) {
709
- const path = timeline.criticalPath.map((step) => criticalPathStep(step, timeline));
710
- lines.push(`Critical path: ${path.join(" \u2192 ")}`, "");
711
- }
712
- for (const detail of extras.details ?? []) lines.push(`${detail.trim()} `);
713
- if ((extras.details ?? []).length > 0) lines.push("");
714
- if (extras.logs !== void 0) lines.push(`Run directory: \`${extras.logs}\``, "");
715
- return lines.join("\n");
716
- }
717
- function tableRow(row) {
718
- const outcome = row.outcome === "done" ? "" : ` (${row.outcome})`;
719
- const steps = row.steps.map((step) => `${step.name} ${seconds(step.endMs - step.startMs)}`).join(" \xB7 ");
720
- const idle = row.idleMs > 0 ? seconds(row.idleMs) : "";
721
- return `| ${row.label}${outcome} | +${seconds(row.startMs)} | ${seconds(row.endMs - row.startMs)} | ${idle} | ${steps} |`;
722
- }
723
-
724
607
  // src/commands/exec/progress.ts
725
608
  function lineProgress(write, options = { github: false }) {
726
609
  let failed = false;
@@ -747,9 +630,10 @@ function plainRenderer(options) {
747
630
  lanesStartedAt: void 0,
748
631
  readyAt: { runner: void 0, resources: {} },
749
632
  cleanupStartedAt: void 0,
633
+ mergeBase: void 0,
750
634
  folded: false
751
635
  };
752
- const resources = REGISTRY.presentations.plain({ verbose: options.verbose === true });
636
+ const resources = DEFINITION_SET.presentations.plain({ verbose: options.verbose === true });
753
637
  return ({ event, at }) => {
754
638
  const now = at.getTime();
755
639
  state.origin ??= now;
@@ -763,9 +647,14 @@ function progressLine(elapsedMs, lane, text) {
763
647
  return `[+${secondsText(secondsOf(elapsedMs))}] ${lane.padEnd(LANE_WIDTH)} ${text}`;
764
648
  }
765
649
  var LANE_WIDTH = Math.max(
766
- ...["run", "mint", "runner", "command", "cleanup", ...REGISTRY.presentations.laneKinds.map(({ lane }) => lane)].map(
767
- (lane) => lane.length
768
- )
650
+ ...[
651
+ "run",
652
+ "mint",
653
+ "runner",
654
+ "command",
655
+ "cleanup",
656
+ ...DEFINITION_SET.presentations.laneKinds.map(({ lane }) => lane)
657
+ ].map((lane) => lane.length)
769
658
  );
770
659
  function eventLines(event, now, state, line, options) {
771
660
  const since = (start) => seconds(now - (start ?? now));
@@ -828,7 +717,7 @@ function eventLines(event, now, state, line, options) {
828
717
  return [line("command", `${event.command} ${commandEnd(event.outcome)} after ${seconds(event.ms)}`)];
829
718
  case "cleanup-started":
830
719
  state.cleanupStartedAt = now;
831
- return [line("cleanup", cleanupText(event.runnerSandbox, releaseText(event.resources, false)))];
720
+ return [line("cleanup", cleanupText(event.keepMs, releaseText(event.resources, false)))];
832
721
  case "cleanup-finished": {
833
722
  const problems = [
834
723
  ...event.notStopped === 0 ? [] : [`${event.notStopped} not stopped`],
@@ -843,8 +732,9 @@ function eventLines(event, now, state, line, options) {
843
732
  ];
844
733
  }
845
734
  case "runner-prepared":
735
+ state.mergeBase = event.base;
846
736
  return [
847
- line("runner", `base ${short(event.base)}, HEAD's merge-base with ${event.baseRef}`),
737
+ line("runner", `merge-base ${short(event.base)}, of HEAD and ${event.baseRef}`),
848
738
  ...preparedNoteTexts(event).map((text) => line("runner", text))
849
739
  ];
850
740
  // The command's own output carries its tests' results; the summary counts them.
@@ -860,14 +750,9 @@ function eventLines(event, now, state, line, options) {
860
750
  function runnerLines(event, state, line, options) {
861
751
  switch (event.kind) {
862
752
  case "snapshot-reused":
863
- return [line("runner", snapshotReusedText(event))];
753
+ return [line("runner", snapshotReusedText(event, state.mergeBase))];
864
754
  case "snapshot-build-started":
865
- return [
866
- line(
867
- "runner",
868
- `building a runner snapshot of base ${short(event.base)} (${event.reason === "rebuild" ? "--rebuild-snapshot" : "no cached runner snapshot fits"}); this takes a few minutes: ${event.summary}`
869
- )
870
- ];
755
+ return snapshotBuildTexts(event).map((text) => line("runner", text));
871
756
  case "runner-sandbox-starting":
872
757
  return [];
873
758
  case "sandbox-started":
@@ -897,7 +782,7 @@ function runnerLines(event, state, line, options) {
897
782
  return [
898
783
  line(
899
784
  "runner",
900
- `built runner snapshot ${event.snapshotId} of base ${short(event.base)} in ${seconds(event.ms)} (${megabytesText(event.sizeBytes)})`
785
+ `built base snapshot ${event.snapshotId} at ${short(event.base)} in ${seconds(event.ms)} (${megabytesText(event.sizeBytes)})`
901
786
  )
902
787
  ];
903
788
  case "snapshot-entry-not-written":
@@ -926,41 +811,28 @@ function runnerLines(event, state, line, options) {
926
811
  ];
927
812
  case "sandbox-kept":
928
813
  return [line("cleanup", `kept the runner sandbox ${event.name} running until ${isoSecondsText(event.stopsAt)}`)];
929
- // The cleanup line says the run saves a branch snapshot.
930
- case "branch-snapshot-saving":
931
- return [];
932
- case "branch-snapshot-saved":
933
- case "branch-snapshot-not-saved":
934
- return [line("cleanup", branchSnapshotSaveText(event))];
935
- case "branch-snapshots-dropped":
936
- case "branch-snapshots-not-dropped":
937
- return [line("runner", branchSnapshotsDropText(event))];
938
- }
939
- }
940
- function snapshotReusedText(event) {
941
- const reused = `reusing runner snapshot ${event.snapshotId} of base ${short(event.base)}`;
942
- return event.branch === null || event.head === null ? reused : `${reused} (branch ${event.branch} at ${short(event.head)})`;
943
- }
944
- function branchSnapshotSaveText(event) {
945
- if (event.kind === "branch-snapshot-saved") {
946
- return `saved branch snapshot ${event.snapshotId} for ${event.branch} at ${short(event.head)} in ${seconds(event.ms)} (${megabytesText(event.sizeBytes)})`;
947
814
  }
948
- return `not saving a branch snapshot: ${notSavedReason(event.save)}`;
949
815
  }
950
- function notSavedReason(save) {
951
- switch (save.kind) {
952
- case "failed":
953
- return `the ${save.step === "scrub" ? "scrub" : "save"} failed: ${save.message}`;
954
- case "stopped":
955
- return "the run is stopping";
816
+ function snapshotReusedText(event, mergeBase) {
817
+ return `snapshot ${event.snapshotId}, ${builtAtText({ base: event.base, builtBehind: event.builtBehind, mergeBase })}`;
818
+ }
819
+ function snapshotBuildTexts(event) {
820
+ const building = `building a base snapshot at ${short(event.base)}`;
821
+ const tail = `this takes a few minutes: ${event.summary}`;
822
+ const { why } = event;
823
+ switch (why.kind) {
824
+ case "no-snapshot":
825
+ return [`${building} (${SNAPSHOT_BUILD_REASON_TEXT[why.kind]}); ${tail}`, ...rejectionLines(why.rejected)];
826
+ case "full":
827
+ case "base":
828
+ return [`${building} (${SNAPSHOT_BUILD_REASON_TEXT[why.kind]}); ${tail}`];
956
829
  }
957
830
  }
958
- function branchSnapshotsDropText(event) {
959
- if (event.kind === "branch-snapshots-not-dropped")
960
- return `couldn't drop a branch snapshot of ${event.branch} from the cache at ${event.failure.path}: ${event.failure.message}; a later run on the branch may start from it`;
961
- const count = event.snapshotIds.length;
962
- return `dropped ${count} branch ${count === 1 ? "snapshot" : "snapshots"} of ${event.branch} from the cache: ${event.snapshotIds.join(", ")}`;
963
- }
831
+ var SNAPSHOT_BUILD_REASON_TEXT = {
832
+ "no-snapshot": "no cached snapshot fits",
833
+ full: "--full",
834
+ base: "the cache has no base snapshot at that commit"
835
+ };
964
836
  function releasingText(instances) {
965
837
  const release = releaseText(
966
838
  instances.map(({ resource }) => resource),
@@ -973,11 +845,9 @@ function closeFold(state) {
973
845
  state.folded = false;
974
846
  return ["::endgroup::"];
975
847
  }
976
- function cleanupText(sandbox, release) {
977
- if (sandbox === null) return release === void 0 ? "nothing to release" : `${release}\u2026`;
978
- if (sandbox.kind === "save")
979
- return `saving a branch snapshot of ${sandbox.branch}${release === void 0 ? "" : ` while ${release}`}\u2026`;
980
- const sandboxes = sandbox.ms > 0 ? `keeping the runner sandbox running ${keepTimeText(sandbox.ms)}` : "stopping and deleting the runner's sandboxes";
848
+ function cleanupText(keepMs, release) {
849
+ if (keepMs === null) return release === void 0 ? "nothing to release" : `${release}\u2026`;
850
+ const sandboxes = keepMs > 0 ? `keeping the runner sandbox running ${keepTimeText(keepMs)}` : "stopping and deleting the runner's sandboxes";
981
851
  return `${sandboxes}${release === void 0 ? "" : `, then ${release}`}\u2026`;
982
852
  }
983
853
  function commandEnd(outcome) {
@@ -990,18 +860,6 @@ function commandEnd(outcome) {
990
860
  return "ended without an exit code";
991
861
  }
992
862
  }
993
- function noteText(note) {
994
- switch (note.kind) {
995
- case "cache-unreadable":
996
- return `couldn't read the runner snapshot cache at ${note.failure.path}: ${note.failure.message}; treating it as empty`;
997
- case "expired-entry-not-removed":
998
- return `couldn't remove the expired cache entry for runner snapshot ${note.entry.snapshotId} at ${note.failure.path}: ${note.failure.message}`;
999
- case "candidate-steps-failed":
1000
- return `not reusing cached runner snapshots of base ${short(note.base)}: runner.${note.path.join(".")} ${note.problem.replace(/\.$/, "")}`;
1001
- case "candidate-check-failed":
1002
- return `not reusing cached runner snapshots of base ${short(note.base)}: ${note.failure.message.replace(/\.$/, "")}`;
1003
- }
1004
- }
1005
863
  function resourceWarningText(warning) {
1006
864
  return `warning: ${warning.message}`;
1007
865
  }
@@ -1011,14 +869,52 @@ function skippedText(skipped) {
1011
869
  function preparedNoteTexts(prepared) {
1012
870
  return [
1013
871
  ...prepared.nestedRepositories.length === 0 ? [] : [`leaving out untracked nested Git repositories: ${prepared.nestedRepositories.join(", ")}`],
1014
- ...prepared.notes.map(noteText),
1015
- ...prepared.saveSkipped ? ["not saving a branch snapshot: HEAD is detached"] : []
872
+ ...prepared.notes.map(snapshotCacheNoteText)
1016
873
  ];
1017
874
  }
1018
875
  function cacheWriteFailureText(failure) {
1019
876
  return `couldn't record the runner snapshot in the cache at ${failure.path}: ${failure.message}; later runs won't reuse it`;
1020
877
  }
1021
878
 
879
+ // src/commands/exec/run-command.ts
880
+ import { z as z5 } from "zod";
881
+
882
+ // src/forward-sigterm.ts
883
+ function forwardSigterm(signal) {
884
+ const terminate = new AbortController();
885
+ const forward = () => {
886
+ const reason = signal.reason;
887
+ if (reason instanceof NodeSignalCancellation && reason.signal === "SIGTERM") terminate.abort(reason);
888
+ };
889
+ if (signal.aborted) forward();
890
+ else signal.addEventListener("abort", forward, { once: true });
891
+ return { terminate: terminate.signal, release: () => signal.removeEventListener("abort", forward) };
892
+ }
893
+
894
+ // src/commands/exec/job-summary.ts
895
+ function jobSummaryMarkdown(timeline, extras) {
896
+ const lines = [`### storm ${extras.command}`, ""];
897
+ if (timeline.rows.length > 0) {
898
+ lines.push("| Lane | Start | Duration | Idle | Steps |", "| --- | ---: | ---: | ---: | --- |");
899
+ for (const row of timeline.rows) lines.push(tableRow(row));
900
+ lines.push("");
901
+ }
902
+ if (timeline.criticalPath.length > 0) {
903
+ const path = timeline.criticalPath.map((step) => criticalPathStep(step, timeline));
904
+ lines.push(`Critical path: ${path.join(" \u2192 ")}`, "");
905
+ }
906
+ for (const detail of extras.details ?? []) lines.push(`${detail.trim()} `);
907
+ if ((extras.details ?? []).length > 0) lines.push("");
908
+ if (extras.logs !== void 0) lines.push(`Run directory: \`${extras.logs}\``, "");
909
+ return lines.join("\n");
910
+ }
911
+ function tableRow(row) {
912
+ const outcome = row.outcome === "done" ? "" : ` (${row.outcome})`;
913
+ const steps = row.steps.map((step) => `${step.name} ${seconds(step.endMs - step.startMs)}`).join(" \xB7 ");
914
+ const idle = row.idleMs > 0 ? seconds(row.idleMs) : "";
915
+ return `| ${row.label}${outcome} | +${seconds(row.startMs)} | ${seconds(row.endMs - row.startMs)} | ${idle} | ${steps} |`;
916
+ }
917
+
1022
918
  // src/commands/exec/live-view.ts
1023
919
  var SPINNER = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
1024
920
  var INDENT = " ".repeat(LANE_WIDTH + 5);
@@ -1034,10 +930,10 @@ function activePhase(state) {
1034
930
  return void 0;
1035
931
  }
1036
932
  function instanceLanes(state) {
1037
- return REGISTRY.presentations.lanes(state.instances ?? []);
933
+ return DEFINITION_SET.presentations.lanes(state.instances ?? []);
1038
934
  }
1039
935
  function startedLanes(state) {
1040
- return REGISTRY.presentations.lanes(
936
+ return DEFINITION_SET.presentations.lanes(
1041
937
  Object.entries(state.resources).map(([resource, { definition }]) => ({ resource, definition }))
1042
938
  );
1043
939
  }
@@ -1045,7 +941,7 @@ function headerLine(state, paint2) {
1045
941
  const version = state.version === void 0 ? "" : versionText(state.version.version, state.version.commit);
1046
942
  const header = [
1047
943
  `storm ${version}`.trimEnd(),
1048
- ...state.base === void 0 ? [] : [`base ${short(state.base.sha)} (merge-base ${state.base.ref})`]
944
+ ...state.base === void 0 ? [] : [`merge-base ${short(state.base.sha)} (with ${state.base.ref})`]
1049
945
  ].join(" \xB7 ");
1050
946
  return paint2.strong(header);
1051
947
  }
@@ -1139,7 +1035,8 @@ function lanesFrame(state, view) {
1139
1035
  ].filter((part) => part !== "").join(" ");
1140
1036
  const crumbs = stepsText(
1141
1037
  runner.steps.filter((step) => step !== current),
1142
- view
1038
+ view,
1039
+ void 0
1143
1040
  );
1144
1041
  const runnerText = stopping(runner.status) ? `stopping \xB7 ${currentText}` : currentText;
1145
1042
  const runnerRow = view.row(
@@ -1172,7 +1069,7 @@ function lanesRecord(state, view) {
1172
1069
  const snapshot = runner.steps.find(({ name }) => name === "snapshot");
1173
1070
  const parts = [
1174
1071
  ...runner.sandbox === void 0 ? [] : [`${runner.sandbox.name} \xB7 ${runner.sandbox.region} \xB7 ${runner.sandbox.vcpus} vCPU`],
1175
- ...snapshot === void 0 || snapshot.status === "pending" ? [] : [snapshotText(snapshot, runner)],
1072
+ ...snapshot === void 0 || snapshot.status === "pending" ? [] : [snapshotText(snapshot, runner, state.base?.sha)],
1176
1073
  ...runner.status === "failed" || runner.status === "stopped" ? [runner.status] : []
1177
1074
  ];
1178
1075
  lines.push(
@@ -1181,7 +1078,7 @@ function lanesRecord(state, view) {
1181
1078
  elapsed(view, runner.startedAt, runner.endedAt)
1182
1079
  )
1183
1080
  );
1184
- const steps = stepsText(runner.steps, view);
1081
+ const steps = stepsText(runner.steps, view, runner.uploadBytes);
1185
1082
  if (steps !== "") lines.push(view.line(`${INDENT}${steps}`));
1186
1083
  }
1187
1084
  return lines;
@@ -1189,9 +1086,12 @@ function lanesRecord(state, view) {
1189
1086
  function runnerGlyph(runner, view) {
1190
1087
  return view.glyph(runner.steps.some(({ status }) => status === "failed") ? "failed" : runner.status);
1191
1088
  }
1192
- function snapshotText(step, runner) {
1193
- if (runner.snapshot?.kind === "reused" || runner.snapshot?.kind === "built")
1194
- return `snapshot ${runner.snapshot.kind}`;
1089
+ function snapshotText(step, runner, mergeBase) {
1090
+ if (runner.snapshot?.kind === "built") return "snapshot built";
1091
+ if (runner.snapshot?.kind === "reused") {
1092
+ const { base, builtBehind } = runner.snapshot;
1093
+ return `snapshot ${builtAtText({ base, builtBehind, mergeBase })}`;
1094
+ }
1195
1095
  return `snapshot build ${step.status === "running" ? "stopped" : step.status}`;
1196
1096
  }
1197
1097
  function stepLabel(step, runner) {
@@ -1221,12 +1121,13 @@ function activityText(runner) {
1221
1121
  }
1222
1122
  }
1223
1123
  var WAITING_FOR_SNAPSHOT = "waiting for the runner snapshot still saving";
1224
- function stepsText(steps, view) {
1124
+ function stepsText(steps, view, uploadBytes) {
1225
1125
  return steps.filter(
1226
1126
  (step) => step.status !== "pending" && step.status !== "running" && step.startedAt !== void 0 && step.endedAt !== void 0 && (step.endedAt > step.startedAt || step.status !== "done")
1227
1127
  ).map((step) => {
1228
1128
  const mark = step.status === "done" ? "" : ` ${view.glyph(step.status)}`;
1229
- return `${step.name} ${seconds((step.endedAt ?? 0) - (step.startedAt ?? 0))}${mark}`;
1129
+ const size = step.name === "upload" && uploadBytes !== void 0 ? ` (${megabytesText(uploadBytes)})` : "";
1130
+ return `${step.name} ${seconds((step.endedAt ?? 0) - (step.startedAt ?? 0))}${size}${mark}`;
1230
1131
  }).join(" \xB7 ");
1231
1132
  }
1232
1133
  function unsandboxedResourcesFrame(state, view) {
@@ -1280,25 +1181,38 @@ function testsLine(state, command, view, live) {
1280
1181
  }
1281
1182
  function testsProgress(tests, view, room) {
1282
1183
  const { paint: paint2, now } = view;
1283
- const running = tests.workers.filter((worker) => worker.file !== void 0 || worker.containerSince !== void 0);
1284
- const waiting = tests.workers.filter((worker) => worker.containerSince !== void 0).length;
1184
+ const running = tests.workers.filter((worker) => worker.file !== void 0 || worker.settingUp.length > 0);
1185
+ const waiting = waitingText(tests.workers.map(({ settingUp }) => settingUp));
1285
1186
  const longest = [...running].toSorted((a, b) => (a.fileStartedAt ?? 0) - (b.fileStartedAt ?? 0))[0];
1286
1187
  const longestMs = longest?.fileStartedAt === void 0 || now === void 0 ? void 0 : now - longest.fileStartedAt;
1287
1188
  const text = (showWaiting) => [
1288
1189
  `${tests.passed} passed`,
1289
1190
  ...tests.failed === 0 ? [] : [paint2.failed(`${tests.failed} failed`)],
1290
1191
  `${tests.filesDone} ${tests.filesDone === 1 ? "file" : "files"} done`,
1291
- `${running.length} running${waiting === 0 || !showWaiting ? "" : ` (${waiting} waiting on a container)`}`,
1192
+ `${running.length} running${waiting === void 0 || !showWaiting ? "" : ` (${waiting})`}`,
1292
1193
  ...longest?.file === void 0 || longestMs === void 0 || longestMs < LONG_FILE_MS ? [] : [`longest: ${shortFile(longest.file)} ${seconds(longestMs)}`]
1293
1194
  ].join(" \xB7 ");
1294
1195
  const full = text(true);
1295
1196
  return visibleLength(full) <= room ? full : text(false);
1296
1197
  }
1198
+ function waitingText(waiting) {
1199
+ const words = setupPhaseWords(waiting.flat());
1200
+ const counts = /* @__PURE__ */ new Map();
1201
+ for (const phases of waiting)
1202
+ for (const phase of phases) {
1203
+ const key = setupPhaseKey(phase);
1204
+ const group = counts.get(key) ?? { text: words(phase), count: 0 };
1205
+ counts.set(key, group);
1206
+ group.count += 1;
1207
+ }
1208
+ if (counts.size === 0) return void 0;
1209
+ return [...counts.values()].map(({ text, count }) => `${count} waiting on ${withArticle(text)}`).join(", ");
1210
+ }
1297
1211
  function cleanupLine(cleanup, runner, view, record) {
1298
1212
  const done = record || cleanup.status !== "running";
1299
1213
  const release = releaseText(cleanup.resources, done);
1300
- const { runnerSandbox } = cleanup;
1301
- const text = !done && cleanup.waiting ? `${WAITING_FOR_SNAPSHOT}\u2026` : runnerSandbox === null ? release ?? "nothing to release" : `${runnerSandboxText(runnerSandbox, runner, done)}${release === void 0 ? "" : `, ${release}`}`;
1214
+ const { keepMs } = cleanup;
1215
+ const text = !done && cleanup.waiting ? `${WAITING_FOR_SNAPSHOT}\u2026` : keepMs === null ? release ?? "nothing to release" : `${runnerSandboxText(keepMs, runner, done)}${release === void 0 ? "" : `, ${release}`}`;
1302
1216
  const leftBehind = cleanupProblems(cleanup);
1303
1217
  const ending = done ? leftBehind === 0 ? "" : `: ${leftBehind} left behind` : "\u2026";
1304
1218
  return view.row(
@@ -1306,19 +1220,11 @@ function cleanupLine(cleanup, runner, view, record) {
1306
1220
  elapsed(view, cleanup.startedAt, cleanup.endedAt)
1307
1221
  );
1308
1222
  }
1309
- function runnerSandboxText(sandbox, runner, done) {
1223
+ function runnerSandboxText(keepMs, runner, done) {
1310
1224
  const kept = runner?.kept;
1311
1225
  if (kept !== void 0) return `kept the runner sandbox until ${isoSecondsText(kept.stopsAt)}`;
1312
1226
  const removed = `${done ? "stopped and deleted" : "stopping and deleting"} the runner sandbox`;
1313
- switch (sandbox.kind) {
1314
- case "keep":
1315
- return !done && sandbox.ms > 0 ? `keeping the runner sandbox running ${keepTimeText(sandbox.ms)}` : removed;
1316
- case "save": {
1317
- const save = runner?.save;
1318
- if (save?.kind === "saved") return `saved branch snapshot ${save.id} of ${save.branch}`;
1319
- return !done && save?.kind !== "not-saved" ? `saving a branch snapshot of ${sandbox.branch}` : removed;
1320
- }
1321
- }
1227
+ return !done && keepMs > 0 ? `keeping the runner sandbox running ${keepTimeText(keepMs)}` : removed;
1322
1228
  }
1323
1229
  function statusGlyph(status, now, paint2) {
1324
1230
  switch (status) {
@@ -1403,7 +1309,7 @@ function liveView(context, colors, options) {
1403
1309
  observer: {
1404
1310
  observe: async (timed) => {
1405
1311
  if (finished) return;
1406
- state = REGISTRY.applyEvent(state, timed);
1312
+ state = DEFINITION_SET.applyEvent(state, timed);
1407
1313
  const next = activePhase(state);
1408
1314
  if (next !== phase) {
1409
1315
  print([
@@ -1448,7 +1354,7 @@ function noticeLines(timed, origin, verbose) {
1448
1354
  case "runner":
1449
1355
  return runnerNoticeLines(event.event, line);
1450
1356
  case "resource":
1451
- return REGISTRY.presentations.notices(event, { verbose }).map(({ lane, text }) => line(lane, text));
1357
+ return DEFINITION_SET.presentations.notices(event, { verbose }).map(({ lane, text }) => line(lane, text));
1452
1358
  // A line a resource instance reported prints as it is, in its lane, and a warning marked as one.
1453
1359
  case "resource-notice":
1454
1360
  return [line(event.lane, event.text)];
@@ -1479,15 +1385,11 @@ function runnerNoticeLines(event, line) {
1479
1385
  switch (event.kind) {
1480
1386
  case "snapshot-entry-not-written":
1481
1387
  return [line("runner", cacheWriteFailureText(event.failure))];
1482
- case "branch-snapshots-dropped":
1483
- case "branch-snapshots-not-dropped":
1484
- return [line("runner", branchSnapshotsDropText(event))];
1485
- case "branch-snapshot-saved":
1486
- case "branch-snapshot-not-saved":
1487
- return [line("cleanup", branchSnapshotSaveText(event))];
1388
+ // The runner row shows the build; its reasons, when a cached snapshot didn't fit, are lines of their own.
1389
+ case "snapshot-build-started":
1390
+ return event.why.kind === "no-snapshot" && event.why.rejected.length > 0 ? snapshotBuildTexts(event).map((text) => line("runner", text)) : [];
1488
1391
  // The live view's phases show the rest.
1489
1392
  case "snapshot-reused":
1490
- case "snapshot-build-started":
1491
1393
  case "runner-sandbox-starting":
1492
1394
  case "sandbox-started":
1493
1395
  case "output-started":
@@ -1504,19 +1406,87 @@ function runnerNoticeLines(event, line) {
1504
1406
  case "stopping":
1505
1407
  case "waiting-for-snapshot":
1506
1408
  case "sandbox-kept":
1507
- case "branch-snapshot-saving":
1508
1409
  return [];
1509
1410
  }
1510
1411
  }
1511
1412
 
1413
+ // src/commands/exec/plan-run.ts
1414
+ async function planRun(app, lifecycles, request, planCommand, signal) {
1415
+ const file = await loadSettingsFile(app.context.config, app.cwd, RESOURCES);
1416
+ if (!file.ok) return file;
1417
+ const configFile = file.path;
1418
+ const settings = fileSettings(file, request);
1419
+ let where;
1420
+ if (request.unsandboxed) where = { kind: "unsandboxed" };
1421
+ else {
1422
+ if (settings.runner === void 0) return refused(runErrors.missingRunner({ configFile }));
1423
+ const required = requireTarget(settings.scope, settings.project);
1424
+ if (!required.ok) return required;
1425
+ const recipe = settings.runner.value;
1426
+ const secrets = readRunnerSecrets(recipe, app.env);
1427
+ if (!secrets.ok)
1428
+ return refused(
1429
+ runErrors.runnerSecretsInvalid({
1430
+ variables: secrets.variables.map(({ name, problem }) => ({ name, problem })),
1431
+ minLength: RUNNER_SECRET_MIN_LENGTH,
1432
+ configFile
1433
+ })
1434
+ );
1435
+ where = { kind: "runner", recipe, target: required.target, secrets: secrets.values };
1436
+ }
1437
+ const merged = settleRunResources(file, request.given);
1438
+ if (!merged.ok) return merged;
1439
+ const command = await planCommand(where, signal);
1440
+ if (signal.aborted) return refused(canceledBeforeStart());
1441
+ if (!command.ok) {
1442
+ const secrets = [
1443
+ ...where.kind === "runner" ? Object.values(where.secrets) : [],
1444
+ ...lifecycles.secrets(merged.options)
1445
+ ];
1446
+ return refused(secrets.length === 0 ? command.refusal : redactStrings(command.refusal, redactor(secrets)));
1447
+ }
1448
+ const run = Object.freeze({ testPlan: command.testPlan });
1449
+ const resolved = merged.plan(run);
1450
+ if (!resolved.ok) return resolved;
1451
+ return {
1452
+ ok: true,
1453
+ configFile,
1454
+ settings,
1455
+ where,
1456
+ argv: command.argv,
1457
+ testPlan: command.testPlan,
1458
+ resources: resolved.resources,
1459
+ planOptions: resolved.planned.map(planOption)
1460
+ };
1461
+ }
1462
+ function planOption({ path, value, source }) {
1463
+ return { path, value, from: source };
1464
+ }
1465
+ async function resourcesBeforeRun(lifecycles, plan, request) {
1466
+ const { configFile, resources, settings } = plan;
1467
+ const used = await lifecycles.beforeRun(resources);
1468
+ if (!used.ok) return refused(resourceRefusedBeforeRun(used.resource, used.refusal, configFile));
1469
+ if (request.credential !== void 0 && !used.needsVercelCredential)
1470
+ return refused(runErrors.credentialUnused({ flags: ["--credential"], configFile }));
1471
+ let where;
1472
+ if (plan.where.kind === "runner") where = plan.where;
1473
+ else if (used.needsVercelCredential) {
1474
+ const chosen = settleCredential(request.credential ?? "mint", settings.scope, settings.project);
1475
+ if (!chosen.ok) return chosen;
1476
+ where = { kind: "unsandboxed", credential: chosen.credential };
1477
+ } else where = { kind: "unsandboxed", credential: void 0 };
1478
+ return { ok: true, where, used };
1479
+ }
1480
+ function canceledBeforeStart() {
1481
+ return outcomes.canceled({ changed: "The command didn't run.\nNothing was minted, acquired or started." });
1482
+ }
1483
+
1512
1484
  // src/commands/exec/run-command.ts
1513
1485
  var OWN_RUN_FIELDS = {
1514
1486
  scope: z5.string().min(1).optional(),
1515
1487
  project: z5.string().min(1).optional(),
1516
1488
  credential: z5.enum(["mint", "github-actions"]).optional(),
1517
1489
  unsandboxed: z5.boolean().default(false),
1518
- rebuildSnapshot: z5.boolean().default(false),
1519
- saveSnapshot: z5.boolean().optional(),
1520
1490
  showOutput: z5.boolean().default(false),
1521
1491
  keepSandbox: z5.string().optional(),
1522
1492
  verbose: z5.boolean().default(false)
@@ -1525,7 +1495,7 @@ var RUN_REQUEST_FIELDS = { ...OWN_RUN_FIELDS, ...resourceFlagFields(Object.keys(
1525
1495
  var RUN_CLI_OPTIONS = { project: { short: "p" } };
1526
1496
  var runRequestSchema = z5.object(RUN_REQUEST_FIELDS);
1527
1497
  async function runCommand({ app, ui, signal }, request, spec) {
1528
- const lifecycles = REGISTRY.lifecycles(app.worlds);
1498
+ const lifecycles = DEFINITION_SET.lifecycles(app.resourceContexts);
1529
1499
  const planned = await planRun(
1530
1500
  app,
1531
1501
  lifecycles,
@@ -1566,7 +1536,7 @@ async function runCommand({ app, ui, signal }, request, spec) {
1566
1536
  });
1567
1537
  const git = await checkoutGit(app.context.checkout, app.cwd);
1568
1538
  const recording = await recordRun(app.context.runDirectories, {
1569
- registry: REGISTRY,
1539
+ definitionSet: DEFINITION_SET,
1570
1540
  startedAt: app.context.clock.now(),
1571
1541
  cwd: app.cwd,
1572
1542
  configFile,
@@ -1581,9 +1551,9 @@ async function runCommand({ app, ui, signal }, request, spec) {
1581
1551
  let outcome;
1582
1552
  try {
1583
1553
  const ended = await executeRun(
1584
- REGISTRY,
1554
+ DEFINITION_SET,
1585
1555
  { ...app.context, runnerTerminal: secrets.length === 0 ? terminal : redactingTerminal(terminal, redact) },
1586
- app.worlds,
1556
+ app.resourceContexts,
1587
1557
  run.runner === void 0 && recording.testEvents !== void 0 ? { ...run, testEvents: recording.testEvents } : run,
1588
1558
  { signal, terminate: sigterm.terminate },
1589
1559
  timedProgress(app.context.clock, secrets.length === 0 ? observer : redactingObserver(observer, redact))
@@ -1595,7 +1565,7 @@ async function runCommand({ app, ui, signal }, request, spec) {
1595
1565
  throw error;
1596
1566
  }
1597
1567
  sigterm.release();
1598
- const ran = await summarize(app, { command: spec.name, view, recording, outcome });
1568
+ const ran = await summarize(app, { command: spec.name, hints: spec.hints, view, recording, outcome });
1599
1569
  switch (outcome.kind) {
1600
1570
  case "ran": {
1601
1571
  app.exit.status = commandExitStatus(outcome.command);
@@ -1605,20 +1575,19 @@ async function runCommand({ app, ui, signal }, request, spec) {
1605
1575
  version: app.version,
1606
1576
  commit: app.commit,
1607
1577
  configFile,
1608
- resources: REGISTRY.reports.ranFacts(outcome.resources),
1578
+ resources: DEFINITION_SET.reports.ranFacts(outcome.resources),
1609
1579
  cleanup: RUN_CLEANUP.facts(outcome),
1610
1580
  command: command.kind === "exited" ? { exitCode: command.code, signal: null } : command.kind === "signaled" ? { exitCode: null, signal: command.signal } : { exitCode: null, signal: null },
1611
1581
  runner: outcome.runner === void 0 ? null : {
1612
1582
  snapshotId: outcome.runner.snapshotId,
1613
1583
  base: outcome.runner.base,
1614
- snapshotBranch: outcome.runner.snapshotBranch,
1615
- snapshotHead: outcome.runner.snapshotHead,
1584
+ builtBehind: outcome.runner.builtBehind,
1585
+ uploadBytes: outcome.runner.uploadBytes,
1616
1586
  built: outcome.runner.built,
1617
1587
  vcpus: outcome.runner.vcpus,
1618
1588
  region: outcome.runner.region,
1619
1589
  runtime: outcome.runner.runtime,
1620
- buildMs: outcome.runner.buildMs,
1621
- save: outcome.runner.save
1590
+ buildMs: outcome.runner.buildMs
1622
1591
  },
1623
1592
  timeline: ran,
1624
1593
  runId: recording.opened.ok ? recording.opened.id : null
@@ -1626,18 +1595,18 @@ async function runCommand({ app, ui, signal }, request, spec) {
1626
1595
  { testPlan, options: planOptions }
1627
1596
  );
1628
1597
  }
1629
- case "resource-refused":
1598
+ case "resource_refused":
1630
1599
  return resourceRefused(outcome, RUN_CLEANUP.facts(outcome));
1631
1600
  // The run's mint: in a sandboxed run for the runner sandbox, in an unsandboxed run for a resource that needed it:
1632
1601
  // its `acquireForRun` answered `mintFailed`, which the launcher owns.
1633
- case "mint-failed":
1602
+ case "mint_failed":
1634
1603
  return mintFailedErrors.mintFailed({
1635
1604
  ...outcome.target,
1636
1605
  ...describeMintFailure(outcome.failure, outcome.target),
1637
1606
  runner: outcome.runner,
1638
1607
  cleanup: RUN_CLEANUP.facts(outcome)
1639
1608
  });
1640
- case "spawn-failed":
1609
+ case "spawn_failed":
1641
1610
  return runErrors.spawnFailed({
1642
1611
  executable: outcome.executable,
1643
1612
  message: outcome.message,
@@ -1646,12 +1615,12 @@ async function runCommand({ app, ui, signal }, request, spec) {
1646
1615
  });
1647
1616
  case "canceled":
1648
1617
  return outcomes.canceled({ changed: canceledChanges(outcome) });
1649
- case "runner-failed":
1618
+ case "runner_failed":
1650
1619
  return runErrors.runnerFailed({
1651
1620
  failure: runnerFailureFacts(outcome.failure),
1652
1621
  cleanup: RUN_CLEANUP.facts(outcome)
1653
1622
  });
1654
- case "snapshot-gone":
1623
+ case "snapshot_gone":
1655
1624
  return runErrors.snapshotGone({
1656
1625
  snapshotId: outcome.entry.snapshotId,
1657
1626
  base: outcome.entry.base,
@@ -1661,15 +1630,9 @@ async function runCommand({ app, ui, signal }, request, spec) {
1661
1630
  }
1662
1631
  }
1663
1632
  function runProblems(request) {
1664
- const { credential, unsandboxed, rebuildSnapshot, saveSnapshot, showOutput, keepSandbox } = request;
1633
+ const { credential, unsandboxed, showOutput, keepSandbox } = request;
1665
1634
  return [
1666
1635
  ...resourceFlagProblems(request),
1667
- ...rebuildSnapshot && unsandboxed ? [
1668
- {
1669
- field: "rebuildSnapshot",
1670
- message: "--rebuild-snapshot builds a runner snapshot; drop it or --unsandboxed."
1671
- }
1672
- ] : [],
1673
1636
  ...!unsandboxed && credential === "github-actions" ? [
1674
1637
  {
1675
1638
  field: "credential",
@@ -1693,18 +1656,6 @@ function runProblems(request) {
1693
1656
  field: "keepSandbox",
1694
1657
  message: "--keep-sandbox keeps a sandboxed run's runner sandbox; drop it or --unsandboxed."
1695
1658
  }
1696
- ] : [],
1697
- ...saveSnapshot === true && unsandboxed ? [
1698
- {
1699
- field: "saveSnapshot",
1700
- message: "--save-snapshot saves a sandboxed run's runner sandbox; drop it or --unsandboxed."
1701
- }
1702
- ] : [],
1703
- ...saveSnapshot === true && keepsSandbox(keepSandbox) ? [
1704
- {
1705
- field: "saveSnapshot",
1706
- message: "--save-snapshot saves the runner sandbox instead of keeping it; drop --keep-sandbox or set it to 0."
1707
- }
1708
1659
  ] : []
1709
1660
  ];
1710
1661
  }
@@ -1723,10 +1674,7 @@ async function runRequestFor(app, options) {
1723
1674
  cwd: app.cwd,
1724
1675
  recipe: where.recipe,
1725
1676
  // The recipe's `vcpus` reads each of the run's resources by its definition: one its `beforeRun` skipped isn't.
1726
- vcpusRun: recipeRun(recipeResources(used.requests)),
1727
- rebuild: request.rebuildSnapshot,
1728
- save: saveMode(request, where.recipe, app.env),
1729
- trustBranchSnapshots: request.saveSnapshot ?? where.recipe.saveSnapshot === true
1677
+ vcpusRun: recipeRun(recipeResources(used.requests))
1730
1678
  });
1731
1679
  if (prepared.kind !== "ok") {
1732
1680
  const refusal = prepareRefusal(prepared, configFile);
@@ -1736,7 +1684,6 @@ async function runRequestFor(app, options) {
1736
1684
  refusal: secrets.length === 0 ? refusal : redactStrings(refusal, redactor(secrets))
1737
1685
  };
1738
1686
  }
1739
- const { save } = prepared.prepared;
1740
1687
  const keepMs = keepSandboxMinutes(request.keepSandbox, where.recipe, app.env) * 6e4;
1741
1688
  const run = {
1742
1689
  ...base,
@@ -1747,7 +1694,7 @@ async function runRequestFor(app, options) {
1747
1694
  target: where.target,
1748
1695
  user: app.user,
1749
1696
  secrets: where.secrets,
1750
- sandbox: save?.kind === "branch" ? { kind: "save", branch: save.branch, always: save.always, otherwiseKeepMs: keepMs } : { kind: "keep", ms: keepMs }
1697
+ keepMs
1751
1698
  }
1752
1699
  };
1753
1700
  return { ok: true, run };
@@ -1778,10 +1725,10 @@ async function summarize(app, run) {
1778
1725
  const { timeline, tests } = recorded;
1779
1726
  const logs = recording.opened.ok ? recording.opened.path : void 0;
1780
1727
  const failed = tests.events.some((event) => event.kind === "test-result" && event.state === "fail");
1781
- const testsLines = testsSummaryLines(tests.events, tests.unreadable, tests.incomplete);
1728
+ const testsLines = testsSummaryLines(tests.events, run.hints, tests.unreadable, tests.incomplete);
1782
1729
  const stepLogs = failedStepLogs(timeline, recording, app.env);
1783
1730
  const clock = workerClock(recorded);
1784
- const charted = clock === void 0 ? void 0 : testsChart(tests.events, tests.unreadable, clock, tests.incomplete);
1731
+ const charted = clock === void 0 ? void 0 : testsChart(tests.events, run.hints, tests.unreadable, clock, tests.incomplete);
1785
1732
  const summarized = await app.context.jobSummary.appendJobSummary(
1786
1733
  jobSummaryMarkdown(timeline, {
1787
1734
  command: run.command,
@@ -1838,14 +1785,6 @@ function recipeResources(requests) {
1838
1785
  })
1839
1786
  );
1840
1787
  }
1841
- function keepsSandbox(flag) {
1842
- return flag !== void 0 && (parseKeepTime(flag) ?? 0) > 0;
1843
- }
1844
- function saveMode(request, recipe, env) {
1845
- const choice = request.saveSnapshot ?? (keepsSandbox(request.keepSandbox) ? false : recipe.saveSnapshot);
1846
- if (choice !== void 0) return choice ? "always" : "never";
1847
- return isCi(env) || runStepTakesSecret(recipe) ? "never" : "new-head";
1848
- }
1849
1788
  var DEFAULT_KEEP_SANDBOX_MINUTES = 30;
1850
1789
  function keepSandboxMinutes(flag, recipe, env) {
1851
1790
  const fromFlag = flag === void 0 ? void 0 : parseKeepTime(flag);
@@ -1881,7 +1820,7 @@ function canceledChanges(outcome) {
1881
1820
  ];
1882
1821
  const cleanup = RUN_CLEANUP.facts(outcome).runner;
1883
1822
  if (cleanup !== null) lines.push(...runnerCleanupLines(cleanup));
1884
- lines.push(...REGISTRY.reports.canceledLines(outcome.resourceCleanup));
1823
+ lines.push(...DEFINITION_SET.reports.canceledLines(outcome.resourceCleanup));
1885
1824
  return lines.join("\n");
1886
1825
  }
1887
1826
  function runnerCleanupLines({ kept, notKept, notStopped, notDeleted }) {
@@ -1898,55 +1837,23 @@ function runnerCleanupLines({ kept, notKept, notStopped, notDeleted }) {
1898
1837
  ];
1899
1838
  }
1900
1839
 
1901
- // src/commands/exec/run-metadata.ts
1902
- var RUN_USAGE_FLAGS = `${RESOURCE_USAGE_FLAGS} [--credential <SOURCE>] [--scope <TEAM> --project <PROJECT>] [--unsandboxed | [--rebuild-snapshot] [--save-snapshot[=false]] [--show-output] [--keep-sandbox <DURATION>]] [--verbose]`;
1903
- var OWN_RUN_FIELDS2 = {
1904
- credential: {
1905
- valueLabel: "SOURCE",
1906
- description: "The credential source: mint, the default, mints one with the vercel CLI for --scope and --project; github-actions requests a GitHub Actions OIDC token, in a GitHub Actions job with permissions id-token: write, anew once it is 4 minutes old, and needs no --scope or --project. Only --unsandboxed takes it: a sandboxed run needs the mint. Only a run with a resource that takes a credential takes it, as that resource's options decide; otherwise it is credential_unused. No config key."
1907
- },
1908
- unsandboxed: {
1909
- description: "Run the command on this machine, with no isolation: it sees this machine's files and environment, less the variables the resources drop. Without it, the command runs in a Vercel Sandbox started from a runner snapshot of the base, with this checkout's changes applied, installed and built, from the runner key of storm.config.ts, and its output streams back with paths rewritten to this checkout's. No config key."
1910
- },
1911
- rebuildSnapshot: {
1912
- description: "Build a runner snapshot of the base whatever the runner snapshot cache holds, replacing an entry for the same base, and drop this branch's saved branch snapshots from the cache. Not with --unsandboxed. No config key."
1913
- },
1914
- saveSnapshot: {
1915
- description: "Whether the run saves the runner sandbox as this branch's runner snapshot once the command ends on its own, after a successful install and build, so the next run on the branch starts from this run's install and build outputs. Without the flag, a sandboxed run on a branch saves one when the command exits 0, unless it started from a branch snapshot that HEAD's commit saved, so each commit saves once; it saves none when the command fails, when CI is set, with --keep-sandbox above 0, with a detached HEAD, or when the runner recipe's install or build step names a runner secret, since those steps would run in a later run on top of what this run's command wrote; such a recipe also reuses no branch snapshot unless --save-snapshot or saveSnapshot: true trusts it. --save-snapshot saves whatever the command's exit code and whatever the run started from, under CI too, and with a detached HEAD says as the run starts that it saves nothing; not with --unsandboxed, or with --keep-sandbox above 0. --save-snapshot=false saves none. The save resets the working tree to the snapshot's base, keeps .git and ignored files such as node_modules and build outputs, and empties /tmp; the snapshot keeps whatever the command wrote there and to $HOME, a resource's token included. A run that starts a save keeps no runner sandbox, however the save ends; a run that starts none, such as one a signal stops, one whose install or build fails, or, without the flag, one whose command fails, keeps it for the keep time. Without the flag and without --keep-sandbox above 0, saveSnapshot in the runner recipe says the same as the flag for every run: false saves none, true saves as --save-snapshot does."
1916
- },
1917
- keepSandbox: {
1918
- valueLabel: "DURATION",
1919
- description: "How long the runner sandbox keeps running once the run ends, however it ends, so you can connect to it from its page in the Vercel dashboard: 0, which stops and deletes it with the run's other sandboxes, or a whole number of minutes or hours up to 5h (30m, 2h). A run that starts saving a branch snapshot keeps no runner sandbox (see --save-snapshot); given above 0, this flag has the run save none. The run asks Vercel Sandbox to extend the runner sandbox's timeout when it would stop sooner; it never shortens it, so the sandbox may run past the keep time until its own timeout. The run says until when it runs, and storm runs show and runs list say so too. Default: keepSandbox in the runner recipe, else 30m, or 0 when CI is set. Not with --unsandboxed."
1920
- },
1921
- showOutput: {
1922
- description: "In a sandboxed run on a terminal, print the runner's step output (a snapshot build, the install, the build) above the live view instead of keeping only each step's last line there. Plain output always prints it. Either way, the run directory keeps it whole. Not with --unsandboxed. No config key."
1923
- },
1924
- verbose: {
1925
- description: "Print more as it happens: each resource's detailed progress, the runner's step output as with --show-output, and verbose in the run payload, which has the Vitest adapter's reporters print each test as it finishes and its fixtures print each container start, proxied request and vercel invocation, for passing tests too. No config key."
1926
- },
1927
- scope: {
1928
- valueLabel: "TEAM",
1929
- description: "The control plane team: the Vercel team whose project the credential is minted for and a sandboxed run's sandboxes run in. Required, from this flag or scope in storm.config.ts, unless an unsandboxed run has no resource that takes a credential or takes --credential github-actions."
1930
- },
1931
- project: {
1932
- valueLabel: "PROJECT",
1933
- description: "The control plane project: the Vercel project, within the team, to mint the credential for. Required, from this flag or project in storm.config.ts, unless an unsandboxed run has no resource that takes a credential or takes --credential github-actions."
1934
- }
1935
- };
1936
- var RUN_FIELDS = { ...RESOURCE_FLAG_HELP, ...OWN_RUN_FIELDS2 };
1937
-
1938
1840
  export {
1841
+ notStoppedText,
1842
+ notDeletedText,
1843
+ RUN_CLEANUP,
1939
1844
  ranSchema,
1940
1845
  RAN_DESCRIPTION,
1941
1846
  renderRan,
1847
+ runErrors,
1942
1848
  RUN_ERRORS,
1943
1849
  outcomes,
1850
+ lineProgress,
1944
1851
  canceledBeforeStart,
1945
1852
  RUN_REQUEST_FIELDS,
1946
1853
  RUN_CLI_OPTIONS,
1947
1854
  runCommand,
1948
1855
  runProblems,
1856
+ prepareRefusal,
1949
1857
  checkoutFailedRefusal,
1950
- RUN_USAGE_FLAGS,
1951
- RUN_FIELDS
1858
+ runnerFailureFacts
1952
1859
  };