@cnc-tools/storm 0.11.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 (444) hide show
  1. package/dist/bin/storm.js +7 -12
  2. package/dist/build-info.js +1 -1
  3. package/dist/chunks/{chunk-3ZZVZPMG.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-ETCZ6WP7.js → chunk-BW2ADH7U.js} +1 -1
  7. package/dist/chunks/chunk-FK4RLDEK.js +40 -0
  8. package/dist/chunks/{chunk-KR7WIYLG.js → chunk-FSP3SJ35.js} +209 -964
  9. package/dist/chunks/chunk-GQIL3AHY.js +20 -0
  10. package/dist/chunks/{chunk-ICB4BZJX.js → chunk-GSC6SRTW.js} +7 -2
  11. package/dist/chunks/{chunk-NPPJ57W7.js → chunk-ISGQJIQM.js} +498 -215
  12. package/dist/chunks/{chunk-OJOKQRM6.js → chunk-IYM44FUX.js} +30 -26
  13. package/dist/chunks/{chunk-GRMD7G4J.js → chunk-LQKNI3EG.js} +6 -5
  14. package/dist/chunks/chunk-NMVODY3P.js +19 -0
  15. package/dist/chunks/{chunk-O4BUT7BE.js → chunk-ODQHQJLE.js} +3063 -2646
  16. package/dist/chunks/chunk-RYRJNHL7.js +55 -0
  17. package/dist/chunks/chunk-SXW6XN4R.js +161 -0
  18. package/dist/chunks/{chunk-L4ZPMSKQ.js → chunk-T6AZIDZD.js} +43 -363
  19. package/dist/chunks/chunk-TEEZL3GA.js +851 -0
  20. package/dist/chunks/{chunk-VZZTHCBW.js → chunk-TMQQYHUX.js} +5 -18
  21. package/dist/chunks/{chunk-TRFEAYNC.js → chunk-U7M3ZB3Z.js} +345 -304
  22. package/dist/chunks/{chunk-4EU4AH7E.js → chunk-Y3BUNNRG.js} +186 -144
  23. package/dist/chunks/{chunk-4PRAB24Y.js → chunk-YM6TZV4L.js} +394 -396
  24. package/dist/chunks/{chunk-AMTYHUYB.js → chunk-YT5OROR7.js} +22 -8
  25. package/dist/chunks/{live-app-LOGYUBKB.js → live-app-AZ5N5HBD.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 +54 -15
  30. package/dist/commands/exec/command.js +51 -46
  31. package/dist/commands/exec/define-run-command.d.ts +752 -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 +58 -28
  40. package/dist/commands/exec/mint-failed.js +4 -4
  41. package/dist/commands/exec/outcomes.d.ts +70 -8
  42. package/dist/commands/exec/outcomes.js +37 -8
  43. package/dist/commands/exec/plan-run.js +3 -3
  44. package/dist/commands/exec/progress.d.ts +35 -15
  45. package/dist/commands/exec/progress.js +82 -57
  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 +84 -24
  53. package/dist/commands/exec/run-command.js +84 -69
  54. package/dist/commands/exec/run-metadata.d.ts +29 -17
  55. package/dist/commands/exec/run-metadata.js +38 -16
  56. package/dist/commands/exec/snapshot-text.d.ts +40 -0
  57. package/dist/commands/exec/snapshot-text.js +112 -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 +22 -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 +746 -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 +21 -8
  72. package/dist/commands/runs/facts.js +19 -9
  73. package/dist/commands/runs/list/command.d.ts +34 -8
  74. package/dist/commands/runs/list/command.js +15 -11
  75. package/dist/commands/runs/list/outcomes.d.ts +17 -4
  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 +36 -8
  79. package/dist/commands/runs/show/command.js +48 -31
  80. package/dist/commands/runs/show/metadata.js +1 -1
  81. package/dist/commands/runs/show/outcomes.d.ts +18 -4
  82. package/dist/commands/runs/show/outcomes.js +35 -14
  83. package/dist/commands/snapshots/build/command.d.ts +898 -0
  84. package/dist/commands/snapshots/build/command.js +511 -0
  85. package/dist/commands/snapshots/build/metadata.d.ts +28 -0
  86. package/dist/commands/snapshots/build/metadata.js +34 -0
  87. package/dist/commands/snapshots/build/outcomes.d.ts +484 -0
  88. package/dist/commands/snapshots/build/outcomes.js +322 -0
  89. package/dist/commands/snapshots/list/command.d.ts +272 -0
  90. package/dist/commands/snapshots/list/command.js +305 -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 +183 -0
  94. package/dist/commands/snapshots/list/outcomes.js +257 -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 +267 -298
  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 +2 -4
  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 +27 -16
  129. package/dist/core/run-state.js +50 -18
  130. package/dist/core/run.d.ts +33 -27
  131. package/dist/core/run.js +24 -19
  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 +3 -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 +5 -5
  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 +69 -24
  280. package/dist/run-directory/run-record.js +39 -19
  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 +179 -0
  284. package/dist/runner/build-snapshots.js +235 -0
  285. package/dist/runner/context.js +2 -1
  286. package/dist/runner/events.d.ts +71 -32
  287. package/dist/runner/gateways.d.ts +30 -10
  288. package/dist/runner/index.d.ts +8 -6
  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 +8 -7
  292. package/dist/runner/prepare.d.ts +24 -46
  293. package/dist/runner/prepare.js +27 -20
  294. package/dist/runner/ready.d.ts +43 -10
  295. package/dist/runner/ready.js +51 -34
  296. package/dist/runner/recipe.d.ts +42 -12
  297. package/dist/runner/recipe.js +36 -7
  298. package/dist/runner/scope.d.ts +5 -12
  299. package/dist/runner/scope.js +0 -4
  300. package/dist/runner/secrets.d.ts +6 -0
  301. package/dist/runner/secrets.js +10 -0
  302. package/dist/runner/session.d.ts +46 -18
  303. package/dist/runner/session.js +58 -29
  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 +140 -62
  307. package/dist/runner/snapshot-cache.js +145 -102
  308. package/dist/runner/snapshot-inspect.d.ts +89 -0
  309. package/dist/runner/snapshot-inspect.js +173 -0
  310. package/dist/runner/snapshot-key.d.ts +5 -2
  311. package/dist/runner/snapshot-key.js +1 -1
  312. package/dist/runner/snapshot-save.d.ts +34 -20
  313. package/dist/runner/snapshot-save.js +46 -37
  314. package/dist/runner/snapshot-start.d.ts +25 -0
  315. package/dist/runner/snapshot-start.js +16 -0
  316. package/dist/sdk/extension/commands.d.ts +35 -17
  317. package/dist/sdk/extension/commands.js +13 -11
  318. package/dist/sdk/extension/driver.d.ts +143 -0
  319. package/dist/sdk/extension/driver.js +28 -0
  320. package/dist/sdk/extension/index.d.ts +2 -1
  321. package/dist/sdk/extension/index.js +15 -9
  322. package/dist/sdk/extension/{launcher-supplies.d.ts → launcher-context.d.ts} +3 -3
  323. package/dist/sdk/extension/launcher-context.js +5 -0
  324. package/dist/sdk/extension/lifecycle.d.ts +6 -5
  325. package/dist/sdk/extension/lifecycle.js +2 -2
  326. package/dist/sdk/extension/resource-definition.d.ts +13 -13
  327. package/dist/sdk/extension/resource-definition.js +2 -2
  328. package/dist/sdk/extension/resource.d.ts +13 -13
  329. package/dist/sdk/extension/resource.js +11 -11
  330. package/dist/sdk/extension/time.js +2 -2
  331. package/dist/sdk/index.d.ts +2 -0
  332. package/dist/sdk/index.js +3 -1
  333. package/dist/sdk/run/launcher.d.ts +1 -1
  334. package/dist/sdk/run/launcher.js +4 -3
  335. package/dist/sdk/run/payload.js +1 -1
  336. package/dist/sdk/run/test-events.d.ts +24 -18
  337. package/dist/sdk/run/test-events.js +5 -4
  338. package/dist/sdk/run/test-result-writer.d.ts +77 -0
  339. package/dist/sdk/run/test-result-writer.js +143 -0
  340. package/dist/sdk/run/worker-test-event-writer.d.ts +13 -0
  341. package/dist/sdk/run/worker-test-event-writer.js +31 -0
  342. package/dist/vendor/testserver-sdk/container/container.d.ts +1 -6
  343. package/dist/vendor/testserver-sdk/container/container.js +1 -5
  344. package/dist/vendor/testserver-sdk/factories/build.d.ts +12 -40
  345. package/dist/vendor/testserver-sdk/factories/build.js +15 -66
  346. package/dist/vendor/testserver-sdk/factories/gateways.d.ts +1 -2
  347. package/dist/vendor/testserver-sdk/factories/index.d.ts +1 -3
  348. package/dist/vendor/testserver-sdk/factories/index.js +3 -5
  349. package/dist/vendor/testserver-sdk/index.d.ts +1 -2
  350. package/dist/vendor/testserver-sdk/index.js +5 -6
  351. package/dist/vendor/testserver-sdk/records/body.d.ts +1 -1
  352. package/dist/vendor/testserver-sdk/records/body.js +1 -1
  353. package/dist/vitest/index.d.ts +2 -1
  354. package/dist/vitest/index.js +6 -4
  355. package/dist/vitest/test-events.d.ts +6 -16
  356. package/dist/vitest/test-events.js +15 -40
  357. package/dist/vitest/test-results.d.ts +9 -31
  358. package/dist/vitest/test-results.js +34 -105
  359. package/dist/vitest/worker-index.d.ts +6 -0
  360. package/dist/vitest/worker-index.js +17 -0
  361. package/package.json +23 -9
  362. package/skills/overview.md +6 -8
  363. package/skills/read-run-output.md +22 -7
  364. package/dist/chunks/chunk-FVMQKYTT.js +0 -10
  365. package/dist/chunks/chunk-SLNKW4ZM.js +0 -40
  366. package/dist/chunks/chunk-WNIQA5J6.js +0 -19
  367. package/dist/chunks/chunk-WSIF7SR6.js +0 -10
  368. package/dist/commands/vitest/outcomes.d.ts +0 -379
  369. package/dist/commands/vitest/outcomes.js +0 -70
  370. package/dist/core/launcher-supplies.d.ts +0 -11
  371. package/dist/core/launcher-supplies.js +0 -28
  372. package/dist/core/live/terminal-command-gateway.d.ts +0 -8
  373. package/dist/core/live/terminal-command-gateway.js +0 -49
  374. package/dist/core/resource-registry.js +0 -30
  375. package/dist/extensions/github/live/world.d.ts +0 -6
  376. package/dist/extensions/github/live/world.js +0 -16
  377. package/dist/extensions/github/world.js +0 -3
  378. package/dist/extensions/story/command-tree.d.ts +0 -6
  379. package/dist/extensions/story/command-tree.js +0 -21
  380. package/dist/extensions/story/commands/app.d.ts +0 -23
  381. package/dist/extensions/story/commands/app.js +0 -5
  382. package/dist/extensions/story/commands/run/command.d.ts +0 -211
  383. package/dist/extensions/story/commands/run/command.js +0 -259
  384. package/dist/extensions/story/commands/run/metadata.js +0 -8
  385. package/dist/extensions/story/commands/run/outcomes.d.ts +0 -101
  386. package/dist/extensions/story/commands/run/outcomes.js +0 -73
  387. package/dist/extensions/story/commands/tree.d.ts +0 -2
  388. package/dist/extensions/story/commands/tree.js +0 -6
  389. package/dist/extensions/story/extension.d.ts +0 -2
  390. package/dist/extensions/story/extension.js +0 -8
  391. package/dist/extensions/testserver/live/world.d.ts +0 -8
  392. package/dist/extensions/testserver/vitest/sandbox.d.ts +0 -25
  393. package/dist/extensions/testserver/vitest/sandbox.js +0 -43
  394. package/dist/extensions/testserver/world.js +0 -4
  395. package/dist/sdk/extension/launcher-supplies.js +0 -3
  396. package/dist/story/align.d.ts +0 -37
  397. package/dist/story/align.js +0 -39
  398. package/dist/story/command-line.d.ts +0 -24
  399. package/dist/story/command-line.js +0 -88
  400. package/dist/story/definition.d.ts +0 -59
  401. package/dist/story/definition.js +0 -9
  402. package/dist/story/diff.d.ts +0 -9
  403. package/dist/story/diff.js +0 -97
  404. package/dist/story/errors.d.ts +0 -14
  405. package/dist/story/errors.js +0 -21
  406. package/dist/story/gateways.d.ts +0 -94
  407. package/dist/story/gateways.js +0 -3
  408. package/dist/story/host.d.ts +0 -30
  409. package/dist/story/host.js +0 -97
  410. package/dist/story/index.d.ts +0 -8
  411. package/dist/story/index.js +0 -11
  412. package/dist/story/json.d.ts +0 -16
  413. package/dist/story/json.js +0 -59
  414. package/dist/story/launch.d.ts +0 -70
  415. package/dist/story/launch.js +0 -77
  416. package/dist/story/live/recording-gateway.d.ts +0 -2
  417. package/dist/story/live/recording-gateway.js +0 -103
  418. package/dist/story/orphans.d.ts +0 -35
  419. package/dist/story/orphans.js +0 -51
  420. package/dist/story/recording.d.ts +0 -62
  421. package/dist/story/recording.js +0 -97
  422. package/dist/story/report.d.ts +0 -42
  423. package/dist/story/report.js +0 -129
  424. package/dist/story/sequence.d.ts +0 -30
  425. package/dist/story/sequence.js +0 -74
  426. package/dist/story/settle.d.ts +0 -96
  427. package/dist/story/settle.js +0 -71
  428. package/dist/story/start.d.ts +0 -50
  429. package/dist/story/start.js +0 -183
  430. package/dist/vendor/testserver-sdk/factories/definition.d.ts +0 -39
  431. package/dist/vendor/testserver-sdk/factories/definition.js +0 -16
  432. package/dist/vendor/testserver-sdk/factories/definitions.d.ts +0 -169
  433. package/dist/vendor/testserver-sdk/factories/definitions.js +0 -245
  434. package/dist/vendor/testserver-sdk/seed/index.d.ts +0 -1
  435. package/dist/vendor/testserver-sdk/seed/index.js +0 -3
  436. package/dist/vendor/testserver-sdk/seed/seed.d.ts +0 -221
  437. package/dist/vendor/testserver-sdk/seed/seed.js +0 -171
  438. package/dist/vitest/find-vitest.d.ts +0 -7
  439. package/dist/vitest/find-vitest.js +0 -28
  440. package/dist/vitest/gateways.js +0 -4
  441. package/dist/vitest/plan.d.ts +0 -51
  442. /package/dist/{extensions/story/commands/run → commands/playwright}/metadata.d.ts +0 -0
  443. /package/dist/{vitest → extensions/vitest/plan}/list-output.d.ts +0 -0
  444. /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-FK4RLDEK.js";
7
10
  import {
8
- RESOURCE_FLAG_HELP,
9
- RESOURCE_USAGE_FLAGS,
10
11
  criticalPathStep,
11
12
  recordedPlan,
12
13
  resourceFlagFields,
@@ -16,42 +17,57 @@ import {
16
17
  testsChart,
17
18
  testsSummaryLines,
18
19
  waterfallLines
19
- } from "./chunk-4EU4AH7E.js";
20
+ } from "./chunk-Y3BUNNRG.js";
20
21
  import {
21
- REGISTRY,
22
+ builtAtText,
23
+ noSaveText,
24
+ rejectionLines,
25
+ snapshotCacheNoteText
26
+ } from "./chunk-4XT5RC5T.js";
27
+ import {
28
+ DEFINITION_SET,
22
29
  RESOURCES
23
- } from "./chunk-NPPJ57W7.js";
30
+ } from "./chunk-ISGQJIQM.js";
31
+ import {
32
+ sandboxConnectPage
33
+ } from "./chunk-NMVODY3P.js";
34
+ import {
35
+ noSaveReasonSchema,
36
+ recordRun,
37
+ saveSchema,
38
+ timelineSchema
39
+ } from "./chunk-TEEZL3GA.js";
24
40
  import {
25
41
  isoSecondsText,
26
42
  keepTimeText,
27
43
  paint,
28
44
  releaseText,
29
- sandboxConnectPage,
30
45
  seconds,
31
46
  short,
32
47
  shortFile,
33
48
  spread,
34
49
  truncate,
35
- visibleLength
36
- } from "./chunk-VZZTHCBW.js";
50
+ visibleLength,
51
+ withArticle
52
+ } from "./chunk-TMQQYHUX.js";
37
53
  import {
38
54
  EMPTY_RUN_STATE,
39
55
  cleanupProblems,
40
56
  commandExitStatus,
41
57
  executeRun,
42
58
  megabytesText,
43
- recordRun,
44
- saveSchema,
45
59
  secondsOf,
46
60
  secondsText,
61
+ setupPhaseKey,
62
+ setupPhaseWords,
47
63
  timedProgress,
48
- timelineSchema,
49
64
  warningTally
50
- } from "./chunk-KR7WIYLG.js";
65
+ } from "./chunk-FSP3SJ35.js";
51
66
  import {
52
67
  RUNNER_SECRET_MIN_LENGTH,
53
68
  configErrors,
54
69
  credentialErrors,
70
+ devSnapshotsTrusted,
55
71
  fileSettings,
56
72
  invalidConfig,
57
73
  loadSettingsFile,
@@ -60,25 +76,23 @@ import {
60
76
  prepareRunner,
61
77
  readRunnerSecrets,
62
78
  recipeRun,
63
- redactSecrets,
64
79
  requireTarget,
65
- runStepTakesSecret,
66
80
  settleCredential,
67
81
  settleRunResources
68
- } from "./chunk-O4BUT7BE.js";
82
+ } from "./chunk-ODQHQJLE.js";
69
83
  import {
70
84
  describeMintFailure,
71
85
  isCi
72
- } from "./chunk-AMTYHUYB.js";
86
+ } from "./chunk-YT5OROR7.js";
87
+ import {
88
+ NodeSignalCancellation
89
+ } from "./chunk-BW2ADH7U.js";
73
90
  import {
74
91
  defineErrors,
75
92
  defineOutcomes,
76
93
  refused,
77
94
  renderOutcome
78
- } from "./chunk-4PRAB24Y.js";
79
-
80
- // src/commands/exec/outcomes.ts
81
- import { z as z4 } from "zod";
95
+ } from "./chunk-YM6TZV4L.js";
82
96
 
83
97
  // src/commands/exec/cleanup.ts
84
98
  import { z } from "zod";
@@ -162,7 +176,7 @@ function runCleanupOf(reports) {
162
176
  rows
163
177
  };
164
178
  }
165
- var RUN_CLEANUP = runCleanupOf(REGISTRY.reports);
179
+ var RUN_CLEANUP = runCleanupOf(DEFINITION_SET.reports);
166
180
  function runnerCleanupOf(report) {
167
181
  if (report === null) return null;
168
182
  const { kept, target } = report;
@@ -179,6 +193,9 @@ function runnerCleanupOf(report) {
179
193
  };
180
194
  }
181
195
 
196
+ // src/commands/exec/outcomes.ts
197
+ import { z as z4 } from "zod";
198
+
182
199
  // src/commands/exec/mint-failed.ts
183
200
  import { z as z2 } from "zod";
184
201
  var mintFailedErrors = defineErrors({
@@ -343,7 +360,7 @@ var ranSchema = z4.object({
343
360
  * definition's name (`definition`), its facts (`facts`, what its acquire answered, unknown to the schema, or null
344
361
  * when it answered none) and the warnings its acquire reported (`warnings`).
345
362
  */
346
- resources: REGISTRY.reports.ranSchema,
363
+ resources: DEFINITION_SET.reports.ranSchema,
347
364
  /**
348
365
  * What the run's cleanup left: the runner sandbox it kept running and the runner's sandboxes it couldn't stop or
349
366
  * delete (`runner`, null without a runner sandbox), and what releasing each of its resource instances couldn't do,
@@ -361,10 +378,18 @@ var ranSchema = z4.object({
361
378
  snapshotId: z4.string(),
362
379
  /** The runner snapshot's base, a full SHA. */
363
380
  base: z4.string(),
364
- /** For a branch snapshot, the local branch of the run that saved it; null for a base snapshot. */
381
+ /** For a dev snapshot, the local branch of the run that saved it; null for a base snapshot. */
365
382
  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. */
383
+ /** For a dev snapshot, the HEAD commit of the run that saved it, a full SHA; null for a base snapshot. */
367
384
  snapshotHead: z4.string().nullable(),
385
+ /** The runner snapshot's kind: a base snapshot, built from its base, or a dev snapshot, saved from a run. */
386
+ snapshotKind: z4.enum(["base", "dev"]),
387
+ /** The commit the runner snapshot was built at, a full SHA: a base snapshot's base, or the commit that saved a dev snapshot. */
388
+ snapshotBuiltAt: z4.string(),
389
+ /** How many commits HEAD has that the snapshot's built-at commit lacks, 0 for a snapshot built at HEAD's commit; null when storm couldn't count them. */
390
+ builtBehind: z4.number().nullable(),
391
+ /** How many bytes of changes the run uploaded on top of the snapshot's base. */
392
+ uploadBytes: z4.number(),
368
393
  /** Whether this run built the runner snapshot. */
369
394
  built: z4.boolean(),
370
395
  vcpus: z4.number(),
@@ -372,8 +397,10 @@ var ranSchema = z4.object({
372
397
  runtime: z4.string(),
373
398
  /** How long the build step took, in milliseconds. */
374
399
  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()
400
+ /** How saving the runner sandbox as a dev snapshot ended; null when the run started no save. */
401
+ save: saveSchema.nullable(),
402
+ /** Why the run, whose command ended on its own, started no save of a dev snapshot; null when it started one. */
403
+ noSaveReason: noSaveReasonSchema.nullable()
377
404
  }).nullable(),
378
405
  /** 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
406
  timeline: timelineSchema,
@@ -383,7 +410,7 @@ var ranSchema = z4.object({
383
410
  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
411
  function renderRan(ran) {
385
412
  const warnings = [
386
- ...REGISTRY.reports.ranWarnings(ran.resources),
413
+ ...DEFINITION_SET.reports.ranWarnings(ran.resources),
387
414
  ...ran.runner !== null && ran.command.exitCode === null && ran.command.signal === null ? [
388
415
  {
389
416
  reason: "sandboxed_no_exit_code",
@@ -391,7 +418,7 @@ function renderRan(ran) {
391
418
  }
392
419
  ] : [],
393
420
  ...runnerCleanupWarnings(ran.cleanup.runner),
394
- ...REGISTRY.reports.cleanupWarnings(ran.cleanup.resources)
421
+ ...DEFINITION_SET.reports.cleanupWarnings(ran.cleanup.resources)
395
422
  ];
396
423
  const kept = ran.cleanup.runner?.kept ?? null;
397
424
  return renderOutcome({
@@ -419,6 +446,25 @@ var runErrors = defineErrors({
419
446
  ]
420
447
  })
421
448
  },
449
+ devSnapshotsNotTrusted: {
450
+ exitCode: 2,
451
+ description: "--save-dev-snapshot was given to a sandboxed run whose runner recipe's install or build step names a runner secret, and the recipe doesn't set trustDevSnapshots: true. A dev snapshot holds what a command wrote, and those steps run on top of it in later runs with their secrets, so only the recipe grants that trust. Nothing was minted, acquired or created.",
452
+ schema: z4.object({
453
+ /** The flag given, as typed. */
454
+ flag: z4.string(),
455
+ /** The config file that gave the runner recipe; null when none did. */
456
+ configFile: z4.string().nullable()
457
+ }),
458
+ render: ({ flag, configFile }) => ({
459
+ message: `${flag} saves a dev snapshot, and the runner recipe${configFile === null ? "" : ` in ${configFile}`} doesn't trust dev snapshots: its install or build step names a runner secret.`,
460
+ next: [
461
+ {
462
+ type: "text",
463
+ text: `Drop ${flag}, or set trustDevSnapshots: true under the runner key of storm.config.ts, which trusts every command run from a checkout with those secrets.`
464
+ }
465
+ ]
466
+ })
467
+ },
422
468
  missingRunner: {
423
469
  exitCode: 2,
424
470
  description: "A sandboxed run (no --unsandboxed) needs a runner recipe, and no storm.config.ts gives a runner key.",
@@ -593,134 +639,6 @@ var outcomes = defineOutcomes({
593
639
  errors: RUN_ERRORS
594
640
  });
595
641
 
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
642
  // src/commands/exec/progress.ts
725
643
  function lineProgress(write, options = { github: false }) {
726
644
  let failed = false;
@@ -749,7 +667,7 @@ function plainRenderer(options) {
749
667
  cleanupStartedAt: void 0,
750
668
  folded: false
751
669
  };
752
- const resources = REGISTRY.presentations.plain({ verbose: options.verbose === true });
670
+ const resources = DEFINITION_SET.presentations.plain({ verbose: options.verbose === true });
753
671
  return ({ event, at }) => {
754
672
  const now = at.getTime();
755
673
  state.origin ??= now;
@@ -763,9 +681,14 @@ function progressLine(elapsedMs, lane, text) {
763
681
  return `[+${secondsText(secondsOf(elapsedMs))}] ${lane.padEnd(LANE_WIDTH)} ${text}`;
764
682
  }
765
683
  var LANE_WIDTH = Math.max(
766
- ...["run", "mint", "runner", "command", "cleanup", ...REGISTRY.presentations.laneKinds.map(({ lane }) => lane)].map(
767
- (lane) => lane.length
768
- )
684
+ ...[
685
+ "run",
686
+ "mint",
687
+ "runner",
688
+ "command",
689
+ "cleanup",
690
+ ...DEFINITION_SET.presentations.laneKinds.map(({ lane }) => lane)
691
+ ].map((lane) => lane.length)
769
692
  );
770
693
  function eventLines(event, now, state, line, options) {
771
694
  const since = (start) => seconds(now - (start ?? now));
@@ -844,7 +767,7 @@ function eventLines(event, now, state, line, options) {
844
767
  }
845
768
  case "runner-prepared":
846
769
  return [
847
- line("runner", `base ${short(event.base)}, HEAD's merge-base with ${event.baseRef}`),
770
+ line("runner", `merge-base ${short(event.base)}, of HEAD and ${event.baseRef}`),
848
771
  ...preparedNoteTexts(event).map((text) => line("runner", text))
849
772
  ];
850
773
  // The command's own output carries its tests' results; the summary counts them.
@@ -862,12 +785,7 @@ function runnerLines(event, state, line, options) {
862
785
  case "snapshot-reused":
863
786
  return [line("runner", snapshotReusedText(event))];
864
787
  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
- ];
788
+ return snapshotBuildTexts(event).map((text) => line("runner", text));
871
789
  case "runner-sandbox-starting":
872
790
  return [];
873
791
  case "sandbox-started":
@@ -897,7 +815,7 @@ function runnerLines(event, state, line, options) {
897
815
  return [
898
816
  line(
899
817
  "runner",
900
- `built runner snapshot ${event.snapshotId} of base ${short(event.base)} in ${seconds(event.ms)} (${megabytesText(event.sizeBytes)})`
818
+ `built base snapshot ${event.snapshotId} at ${short(event.base)} in ${seconds(event.ms)} (${megabytesText(event.sizeBytes)})`
901
819
  )
902
820
  ];
903
821
  case "snapshot-entry-not-written":
@@ -926,26 +844,45 @@ function runnerLines(event, state, line, options) {
926
844
  ];
927
845
  case "sandbox-kept":
928
846
  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":
847
+ // The cleanup line says the run saves a dev snapshot.
848
+ case "dev-snapshot-saving":
931
849
  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))];
850
+ case "dev-snapshot-saved":
851
+ case "dev-snapshot-not-saved":
852
+ return [line("cleanup", devSnapshotSaveText(event))];
853
+ case "dev-snapshot-skipped":
854
+ return [line("cleanup", devSnapshotSkippedText(event))];
855
+ case "dev-snapshots-dropped":
856
+ case "dev-snapshots-not-dropped":
857
+ return [line("runner", devSnapshotsDropText(event))];
938
858
  }
939
859
  }
940
860
  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)})`;
861
+ return `snapshot ${event.snapshotId}, ${builtAtText({ ...event.snapshot, atMergeBase: event.snapshot.builtAt === event.base })}`;
862
+ }
863
+ function snapshotBuildTexts(event) {
864
+ const building = `building a base snapshot at ${short(event.base)}`;
865
+ const tail = `this takes a few minutes: ${event.summary}`;
866
+ const { why } = event;
867
+ switch (why.kind) {
868
+ case "no-snapshot":
869
+ return [`${building} (${SNAPSHOT_BUILD_REASON_TEXT[why.kind]}); ${tail}`, ...rejectionLines(why.rejected)];
870
+ case "full":
871
+ case "base":
872
+ return [`${building} (${SNAPSHOT_BUILD_REASON_TEXT[why.kind]}); ${tail}`];
873
+ }
943
874
  }
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)})`;
875
+ function devSnapshotSkippedText(event) {
876
+ return `no new dev snapshot: ${noSaveText(event.reason)}`;
877
+ }
878
+ function devSnapshotSaveText(event) {
879
+ if (event.kind === "dev-snapshot-saved") {
880
+ return `saved dev snapshot ${event.snapshotId} for ${headText(event.branch)} at ${short(event.head)} in ${seconds(event.ms)} (${megabytesText(event.sizeBytes)})`;
947
881
  }
948
- return `not saving a branch snapshot: ${notSavedReason(event.save)}`;
882
+ return `not saving a dev snapshot: ${notSavedReason(event.save)}`;
883
+ }
884
+ function headText(branch) {
885
+ return branch ?? "a detached HEAD";
949
886
  }
950
887
  function notSavedReason(save) {
951
888
  switch (save.kind) {
@@ -955,11 +892,16 @@ function notSavedReason(save) {
955
892
  return "the run is stopping";
956
893
  }
957
894
  }
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`;
895
+ var SNAPSHOT_BUILD_REASON_TEXT = {
896
+ "no-snapshot": "no cached snapshot fits",
897
+ full: "--full",
898
+ base: "the cache has no base snapshot at that commit"
899
+ };
900
+ function devSnapshotsDropText(event) {
901
+ if (event.kind === "dev-snapshots-not-dropped")
902
+ return `couldn't drop a dev snapshot built on the replaced base snapshot from the cache: ${event.message}; a later run may start from it`;
961
903
  const count = event.snapshotIds.length;
962
- return `dropped ${count} branch ${count === 1 ? "snapshot" : "snapshots"} of ${event.branch} from the cache: ${event.snapshotIds.join(", ")}`;
904
+ return `dropped ${count} dev ${count === 1 ? "snapshot" : "snapshots"} built on the replaced base snapshot from the cache: ${event.snapshotIds.join(", ")}`;
963
905
  }
964
906
  function releasingText(instances) {
965
907
  const release = releaseText(
@@ -976,7 +918,7 @@ function closeFold(state) {
976
918
  function cleanupText(sandbox, release) {
977
919
  if (sandbox === null) return release === void 0 ? "nothing to release" : `${release}\u2026`;
978
920
  if (sandbox.kind === "save")
979
- return `saving a branch snapshot of ${sandbox.branch}${release === void 0 ? "" : ` while ${release}`}\u2026`;
921
+ return `saving a dev snapshot of ${headText(sandbox.branch)}${release === void 0 ? "" : ` while ${release}`}\u2026`;
980
922
  const sandboxes = sandbox.ms > 0 ? `keeping the runner sandbox running ${keepTimeText(sandbox.ms)}` : "stopping and deleting the runner's sandboxes";
981
923
  return `${sandboxes}${release === void 0 ? "" : `, then ${release}`}\u2026`;
982
924
  }
@@ -990,18 +932,6 @@ function commandEnd(outcome) {
990
932
  return "ended without an exit code";
991
933
  }
992
934
  }
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
935
  function resourceWarningText(warning) {
1006
936
  return `warning: ${warning.message}`;
1007
937
  }
@@ -1011,14 +941,52 @@ function skippedText(skipped) {
1011
941
  function preparedNoteTexts(prepared) {
1012
942
  return [
1013
943
  ...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"] : []
944
+ ...prepared.notes.map(snapshotCacheNoteText)
1016
945
  ];
1017
946
  }
1018
947
  function cacheWriteFailureText(failure) {
1019
948
  return `couldn't record the runner snapshot in the cache at ${failure.path}: ${failure.message}; later runs won't reuse it`;
1020
949
  }
1021
950
 
951
+ // src/commands/exec/run-command.ts
952
+ import { z as z5 } from "zod";
953
+
954
+ // src/forward-sigterm.ts
955
+ function forwardSigterm(signal) {
956
+ const terminate = new AbortController();
957
+ const forward = () => {
958
+ const reason = signal.reason;
959
+ if (reason instanceof NodeSignalCancellation && reason.signal === "SIGTERM") terminate.abort(reason);
960
+ };
961
+ if (signal.aborted) forward();
962
+ else signal.addEventListener("abort", forward, { once: true });
963
+ return { terminate: terminate.signal, release: () => signal.removeEventListener("abort", forward) };
964
+ }
965
+
966
+ // src/commands/exec/job-summary.ts
967
+ function jobSummaryMarkdown(timeline, extras) {
968
+ const lines = [`### storm ${extras.command}`, ""];
969
+ if (timeline.rows.length > 0) {
970
+ lines.push("| Lane | Start | Duration | Idle | Steps |", "| --- | ---: | ---: | ---: | --- |");
971
+ for (const row of timeline.rows) lines.push(tableRow(row));
972
+ lines.push("");
973
+ }
974
+ if (timeline.criticalPath.length > 0) {
975
+ const path = timeline.criticalPath.map((step) => criticalPathStep(step, timeline));
976
+ lines.push(`Critical path: ${path.join(" \u2192 ")}`, "");
977
+ }
978
+ for (const detail of extras.details ?? []) lines.push(`${detail.trim()} `);
979
+ if ((extras.details ?? []).length > 0) lines.push("");
980
+ if (extras.logs !== void 0) lines.push(`Run directory: \`${extras.logs}\``, "");
981
+ return lines.join("\n");
982
+ }
983
+ function tableRow(row) {
984
+ const outcome = row.outcome === "done" ? "" : ` (${row.outcome})`;
985
+ const steps = row.steps.map((step) => `${step.name} ${seconds(step.endMs - step.startMs)}`).join(" \xB7 ");
986
+ const idle = row.idleMs > 0 ? seconds(row.idleMs) : "";
987
+ return `| ${row.label}${outcome} | +${seconds(row.startMs)} | ${seconds(row.endMs - row.startMs)} | ${idle} | ${steps} |`;
988
+ }
989
+
1022
990
  // src/commands/exec/live-view.ts
1023
991
  var SPINNER = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
1024
992
  var INDENT = " ".repeat(LANE_WIDTH + 5);
@@ -1034,10 +1002,10 @@ function activePhase(state) {
1034
1002
  return void 0;
1035
1003
  }
1036
1004
  function instanceLanes(state) {
1037
- return REGISTRY.presentations.lanes(state.instances ?? []);
1005
+ return DEFINITION_SET.presentations.lanes(state.instances ?? []);
1038
1006
  }
1039
1007
  function startedLanes(state) {
1040
- return REGISTRY.presentations.lanes(
1008
+ return DEFINITION_SET.presentations.lanes(
1041
1009
  Object.entries(state.resources).map(([resource, { definition }]) => ({ resource, definition }))
1042
1010
  );
1043
1011
  }
@@ -1045,7 +1013,7 @@ function headerLine(state, paint2) {
1045
1013
  const version = state.version === void 0 ? "" : versionText(state.version.version, state.version.commit);
1046
1014
  const header = [
1047
1015
  `storm ${version}`.trimEnd(),
1048
- ...state.base === void 0 ? [] : [`base ${short(state.base.sha)} (merge-base ${state.base.ref})`]
1016
+ ...state.base === void 0 ? [] : [`merge-base ${short(state.base.sha)} (with ${state.base.ref})`]
1049
1017
  ].join(" \xB7 ");
1050
1018
  return paint2.strong(header);
1051
1019
  }
@@ -1139,7 +1107,8 @@ function lanesFrame(state, view) {
1139
1107
  ].filter((part) => part !== "").join(" ");
1140
1108
  const crumbs = stepsText(
1141
1109
  runner.steps.filter((step) => step !== current),
1142
- view
1110
+ view,
1111
+ void 0
1143
1112
  );
1144
1113
  const runnerText = stopping(runner.status) ? `stopping \xB7 ${currentText}` : currentText;
1145
1114
  const runnerRow = view.row(
@@ -1181,7 +1150,7 @@ function lanesRecord(state, view) {
1181
1150
  elapsed(view, runner.startedAt, runner.endedAt)
1182
1151
  )
1183
1152
  );
1184
- const steps = stepsText(runner.steps, view);
1153
+ const steps = stepsText(runner.steps, view, runner.uploadBytes);
1185
1154
  if (steps !== "") lines.push(view.line(`${INDENT}${steps}`));
1186
1155
  }
1187
1156
  return lines;
@@ -1190,8 +1159,11 @@ function runnerGlyph(runner, view) {
1190
1159
  return view.glyph(runner.steps.some(({ status }) => status === "failed") ? "failed" : runner.status);
1191
1160
  }
1192
1161
  function snapshotText(step, runner) {
1193
- if (runner.snapshot?.kind === "reused" || runner.snapshot?.kind === "built")
1194
- return `snapshot ${runner.snapshot.kind}`;
1162
+ if (runner.snapshot?.kind === "built") return "snapshot built";
1163
+ if (runner.snapshot?.kind === "reused") {
1164
+ const { snapshot, base } = runner.snapshot;
1165
+ return `snapshot ${builtAtText({ ...snapshot, atMergeBase: snapshot.builtAt === base })}`;
1166
+ }
1195
1167
  return `snapshot build ${step.status === "running" ? "stopped" : step.status}`;
1196
1168
  }
1197
1169
  function stepLabel(step, runner) {
@@ -1221,12 +1193,13 @@ function activityText(runner) {
1221
1193
  }
1222
1194
  }
1223
1195
  var WAITING_FOR_SNAPSHOT = "waiting for the runner snapshot still saving";
1224
- function stepsText(steps, view) {
1196
+ function stepsText(steps, view, uploadBytes) {
1225
1197
  return steps.filter(
1226
1198
  (step) => step.status !== "pending" && step.status !== "running" && step.startedAt !== void 0 && step.endedAt !== void 0 && (step.endedAt > step.startedAt || step.status !== "done")
1227
1199
  ).map((step) => {
1228
1200
  const mark = step.status === "done" ? "" : ` ${view.glyph(step.status)}`;
1229
- return `${step.name} ${seconds((step.endedAt ?? 0) - (step.startedAt ?? 0))}${mark}`;
1201
+ const size = step.name === "upload" && uploadBytes !== void 0 ? ` (${megabytesText(uploadBytes)})` : "";
1202
+ return `${step.name} ${seconds((step.endedAt ?? 0) - (step.startedAt ?? 0))}${size}${mark}`;
1230
1203
  }).join(" \xB7 ");
1231
1204
  }
1232
1205
  function unsandboxedResourcesFrame(state, view) {
@@ -1280,20 +1253,33 @@ function testsLine(state, command, view, live) {
1280
1253
  }
1281
1254
  function testsProgress(tests, view, room) {
1282
1255
  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;
1256
+ const running = tests.workers.filter((worker) => worker.file !== void 0 || worker.settingUp.length > 0);
1257
+ const waiting = waitingText(tests.workers.map(({ settingUp }) => settingUp));
1285
1258
  const longest = [...running].toSorted((a, b) => (a.fileStartedAt ?? 0) - (b.fileStartedAt ?? 0))[0];
1286
1259
  const longestMs = longest?.fileStartedAt === void 0 || now === void 0 ? void 0 : now - longest.fileStartedAt;
1287
1260
  const text = (showWaiting) => [
1288
1261
  `${tests.passed} passed`,
1289
1262
  ...tests.failed === 0 ? [] : [paint2.failed(`${tests.failed} failed`)],
1290
1263
  `${tests.filesDone} ${tests.filesDone === 1 ? "file" : "files"} done`,
1291
- `${running.length} running${waiting === 0 || !showWaiting ? "" : ` (${waiting} waiting on a container)`}`,
1264
+ `${running.length} running${waiting === void 0 || !showWaiting ? "" : ` (${waiting})`}`,
1292
1265
  ...longest?.file === void 0 || longestMs === void 0 || longestMs < LONG_FILE_MS ? [] : [`longest: ${shortFile(longest.file)} ${seconds(longestMs)}`]
1293
1266
  ].join(" \xB7 ");
1294
1267
  const full = text(true);
1295
1268
  return visibleLength(full) <= room ? full : text(false);
1296
1269
  }
1270
+ function waitingText(waiting) {
1271
+ const words = setupPhaseWords(waiting.flat());
1272
+ const counts = /* @__PURE__ */ new Map();
1273
+ for (const phases of waiting)
1274
+ for (const phase of phases) {
1275
+ const key = setupPhaseKey(phase);
1276
+ const group = counts.get(key) ?? { text: words(phase), count: 0 };
1277
+ counts.set(key, group);
1278
+ group.count += 1;
1279
+ }
1280
+ if (counts.size === 0) return void 0;
1281
+ return [...counts.values()].map(({ text, count }) => `${count} waiting on ${withArticle(text)}`).join(", ");
1282
+ }
1297
1283
  function cleanupLine(cleanup, runner, view, record) {
1298
1284
  const done = record || cleanup.status !== "running";
1299
1285
  const release = releaseText(cleanup.resources, done);
@@ -1315,8 +1301,8 @@ function runnerSandboxText(sandbox, runner, done) {
1315
1301
  return !done && sandbox.ms > 0 ? `keeping the runner sandbox running ${keepTimeText(sandbox.ms)}` : removed;
1316
1302
  case "save": {
1317
1303
  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;
1304
+ if (save?.kind === "saved") return `saved dev snapshot ${save.id} of ${headText(save.branch)}`;
1305
+ return !done && save?.kind !== "not-saved" ? `saving a dev snapshot of ${headText(sandbox.branch)}` : removed;
1320
1306
  }
1321
1307
  }
1322
1308
  }
@@ -1403,7 +1389,7 @@ function liveView(context, colors, options) {
1403
1389
  observer: {
1404
1390
  observe: async (timed) => {
1405
1391
  if (finished) return;
1406
- state = REGISTRY.applyEvent(state, timed);
1392
+ state = DEFINITION_SET.applyEvent(state, timed);
1407
1393
  const next = activePhase(state);
1408
1394
  if (next !== phase) {
1409
1395
  print([
@@ -1448,7 +1434,7 @@ function noticeLines(timed, origin, verbose) {
1448
1434
  case "runner":
1449
1435
  return runnerNoticeLines(event.event, line);
1450
1436
  case "resource":
1451
- return REGISTRY.presentations.notices(event, { verbose }).map(({ lane, text }) => line(lane, text));
1437
+ return DEFINITION_SET.presentations.notices(event, { verbose }).map(({ lane, text }) => line(lane, text));
1452
1438
  // A line a resource instance reported prints as it is, in its lane, and a warning marked as one.
1453
1439
  case "resource-notice":
1454
1440
  return [line(event.lane, event.text)];
@@ -1479,15 +1465,19 @@ function runnerNoticeLines(event, line) {
1479
1465
  switch (event.kind) {
1480
1466
  case "snapshot-entry-not-written":
1481
1467
  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))];
1468
+ case "dev-snapshots-dropped":
1469
+ case "dev-snapshots-not-dropped":
1470
+ return [line("runner", devSnapshotsDropText(event))];
1471
+ case "dev-snapshot-saved":
1472
+ case "dev-snapshot-not-saved":
1473
+ return [line("cleanup", devSnapshotSaveText(event))];
1474
+ case "dev-snapshot-skipped":
1475
+ return [line("cleanup", devSnapshotSkippedText(event))];
1476
+ // The runner row shows the build; its reasons, when a cached snapshot didn't fit, are lines of their own.
1477
+ case "snapshot-build-started":
1478
+ return event.why.kind === "no-snapshot" && event.why.rejected.length > 0 ? snapshotBuildTexts(event).map((text) => line("runner", text)) : [];
1488
1479
  // The live view's phases show the rest.
1489
1480
  case "snapshot-reused":
1490
- case "snapshot-build-started":
1491
1481
  case "runner-sandbox-starting":
1492
1482
  case "sandbox-started":
1493
1483
  case "output-started":
@@ -1504,19 +1494,90 @@ function runnerNoticeLines(event, line) {
1504
1494
  case "stopping":
1505
1495
  case "waiting-for-snapshot":
1506
1496
  case "sandbox-kept":
1507
- case "branch-snapshot-saving":
1497
+ case "dev-snapshot-saving":
1508
1498
  return [];
1509
1499
  }
1510
1500
  }
1511
1501
 
1502
+ // src/commands/exec/plan-run.ts
1503
+ async function planRun(app, lifecycles, request, planCommand, signal) {
1504
+ const file = await loadSettingsFile(app.context.config, app.cwd, RESOURCES);
1505
+ if (!file.ok) return file;
1506
+ const configFile = file.path;
1507
+ const settings = fileSettings(file, request);
1508
+ let where;
1509
+ if (request.unsandboxed) where = { kind: "unsandboxed" };
1510
+ else {
1511
+ if (settings.runner === void 0) return refused(runErrors.missingRunner({ configFile }));
1512
+ const required = requireTarget(settings.scope, settings.project);
1513
+ if (!required.ok) return required;
1514
+ const recipe = settings.runner.value;
1515
+ const secrets = readRunnerSecrets(recipe, app.env);
1516
+ if (!secrets.ok)
1517
+ return refused(
1518
+ runErrors.runnerSecretsInvalid({
1519
+ variables: secrets.variables.map(({ name, problem }) => ({ name, problem })),
1520
+ minLength: RUNNER_SECRET_MIN_LENGTH,
1521
+ configFile
1522
+ })
1523
+ );
1524
+ where = { kind: "runner", recipe, target: required.target, secrets: secrets.values };
1525
+ }
1526
+ const merged = settleRunResources(file, request.given);
1527
+ if (!merged.ok) return merged;
1528
+ const command = await planCommand(where, signal);
1529
+ if (signal.aborted) return refused(canceledBeforeStart());
1530
+ if (!command.ok) {
1531
+ const secrets = [
1532
+ ...where.kind === "runner" ? Object.values(where.secrets) : [],
1533
+ ...lifecycles.secrets(merged.options)
1534
+ ];
1535
+ return refused(secrets.length === 0 ? command.refusal : redactStrings(command.refusal, redactor(secrets)));
1536
+ }
1537
+ const run = Object.freeze({ testPlan: command.testPlan });
1538
+ const resolved = merged.plan(run);
1539
+ if (!resolved.ok) return resolved;
1540
+ return {
1541
+ ok: true,
1542
+ configFile,
1543
+ settings,
1544
+ where,
1545
+ argv: command.argv,
1546
+ testPlan: command.testPlan,
1547
+ resources: resolved.resources,
1548
+ planOptions: resolved.planned.map(planOption)
1549
+ };
1550
+ }
1551
+ function planOption({ path, value, source }) {
1552
+ return { path, value, from: source };
1553
+ }
1554
+ async function resourcesBeforeRun(lifecycles, plan, request) {
1555
+ const { configFile, resources, settings } = plan;
1556
+ const used = await lifecycles.beforeRun(resources);
1557
+ if (!used.ok) return refused(resourceRefusedBeforeRun(used.resource, used.refusal, configFile));
1558
+ if (request.credential !== void 0 && !used.needsVercelCredential)
1559
+ return refused(runErrors.credentialUnused({ flags: ["--credential"], configFile }));
1560
+ let where;
1561
+ if (plan.where.kind === "runner") where = plan.where;
1562
+ else if (used.needsVercelCredential) {
1563
+ const chosen = settleCredential(request.credential ?? "mint", settings.scope, settings.project);
1564
+ if (!chosen.ok) return chosen;
1565
+ where = { kind: "unsandboxed", credential: chosen.credential };
1566
+ } else where = { kind: "unsandboxed", credential: void 0 };
1567
+ return { ok: true, where, used };
1568
+ }
1569
+ function canceledBeforeStart() {
1570
+ return outcomes.canceled({ changed: "The command didn't run.\nNothing was minted, acquired or started." });
1571
+ }
1572
+
1512
1573
  // src/commands/exec/run-command.ts
1513
1574
  var OWN_RUN_FIELDS = {
1514
1575
  scope: z5.string().min(1).optional(),
1515
1576
  project: z5.string().min(1).optional(),
1516
1577
  credential: z5.enum(["mint", "github-actions"]).optional(),
1517
1578
  unsandboxed: z5.boolean().default(false),
1518
- rebuildSnapshot: z5.boolean().default(false),
1519
- saveSnapshot: z5.boolean().optional(),
1579
+ saveDevSnapshot: z5.boolean().optional(),
1580
+ noReuseDevSnapshot: z5.boolean().default(false),
1520
1581
  showOutput: z5.boolean().default(false),
1521
1582
  keepSandbox: z5.string().optional(),
1522
1583
  verbose: z5.boolean().default(false)
@@ -1525,7 +1586,7 @@ var RUN_REQUEST_FIELDS = { ...OWN_RUN_FIELDS, ...resourceFlagFields(Object.keys(
1525
1586
  var RUN_CLI_OPTIONS = { project: { short: "p" } };
1526
1587
  var runRequestSchema = z5.object(RUN_REQUEST_FIELDS);
1527
1588
  async function runCommand({ app, ui, signal }, request, spec) {
1528
- const lifecycles = REGISTRY.lifecycles(app.worlds);
1589
+ const lifecycles = DEFINITION_SET.lifecycles(app.resourceContexts);
1529
1590
  const planned = await planRun(
1530
1591
  app,
1531
1592
  lifecycles,
@@ -1566,7 +1627,7 @@ async function runCommand({ app, ui, signal }, request, spec) {
1566
1627
  });
1567
1628
  const git = await checkoutGit(app.context.checkout, app.cwd);
1568
1629
  const recording = await recordRun(app.context.runDirectories, {
1569
- registry: REGISTRY,
1630
+ definitionSet: DEFINITION_SET,
1570
1631
  startedAt: app.context.clock.now(),
1571
1632
  cwd: app.cwd,
1572
1633
  configFile,
@@ -1581,9 +1642,9 @@ async function runCommand({ app, ui, signal }, request, spec) {
1581
1642
  let outcome;
1582
1643
  try {
1583
1644
  const ended = await executeRun(
1584
- REGISTRY,
1645
+ DEFINITION_SET,
1585
1646
  { ...app.context, runnerTerminal: secrets.length === 0 ? terminal : redactingTerminal(terminal, redact) },
1586
- app.worlds,
1647
+ app.resourceContexts,
1587
1648
  run.runner === void 0 && recording.testEvents !== void 0 ? { ...run, testEvents: recording.testEvents } : run,
1588
1649
  { signal, terminate: sigterm.terminate },
1589
1650
  timedProgress(app.context.clock, secrets.length === 0 ? observer : redactingObserver(observer, redact))
@@ -1595,7 +1656,7 @@ async function runCommand({ app, ui, signal }, request, spec) {
1595
1656
  throw error;
1596
1657
  }
1597
1658
  sigterm.release();
1598
- const ran = await summarize(app, { command: spec.name, view, recording, outcome });
1659
+ const ran = await summarize(app, { command: spec.name, hints: spec.hints, view, recording, outcome });
1599
1660
  switch (outcome.kind) {
1600
1661
  case "ran": {
1601
1662
  app.exit.status = commandExitStatus(outcome.command);
@@ -1605,7 +1666,7 @@ async function runCommand({ app, ui, signal }, request, spec) {
1605
1666
  version: app.version,
1606
1667
  commit: app.commit,
1607
1668
  configFile,
1608
- resources: REGISTRY.reports.ranFacts(outcome.resources),
1669
+ resources: DEFINITION_SET.reports.ranFacts(outcome.resources),
1609
1670
  cleanup: RUN_CLEANUP.facts(outcome),
1610
1671
  command: command.kind === "exited" ? { exitCode: command.code, signal: null } : command.kind === "signaled" ? { exitCode: null, signal: command.signal } : { exitCode: null, signal: null },
1611
1672
  runner: outcome.runner === void 0 ? null : {
@@ -1613,12 +1674,17 @@ async function runCommand({ app, ui, signal }, request, spec) {
1613
1674
  base: outcome.runner.base,
1614
1675
  snapshotBranch: outcome.runner.snapshotBranch,
1615
1676
  snapshotHead: outcome.runner.snapshotHead,
1677
+ snapshotKind: outcome.runner.snapshot.kind,
1678
+ snapshotBuiltAt: outcome.runner.snapshot.builtAt,
1679
+ builtBehind: outcome.runner.snapshot.builtBehind,
1680
+ uploadBytes: outcome.runner.uploadBytes,
1616
1681
  built: outcome.runner.built,
1617
1682
  vcpus: outcome.runner.vcpus,
1618
1683
  region: outcome.runner.region,
1619
1684
  runtime: outcome.runner.runtime,
1620
1685
  buildMs: outcome.runner.buildMs,
1621
- save: outcome.runner.save
1686
+ save: outcome.runner.save,
1687
+ noSaveReason: outcome.runner.noSave
1622
1688
  },
1623
1689
  timeline: ran,
1624
1690
  runId: recording.opened.ok ? recording.opened.id : null
@@ -1626,18 +1692,18 @@ async function runCommand({ app, ui, signal }, request, spec) {
1626
1692
  { testPlan, options: planOptions }
1627
1693
  );
1628
1694
  }
1629
- case "resource-refused":
1695
+ case "resource_refused":
1630
1696
  return resourceRefused(outcome, RUN_CLEANUP.facts(outcome));
1631
1697
  // The run's mint: in a sandboxed run for the runner sandbox, in an unsandboxed run for a resource that needed it:
1632
1698
  // its `acquireForRun` answered `mintFailed`, which the launcher owns.
1633
- case "mint-failed":
1699
+ case "mint_failed":
1634
1700
  return mintFailedErrors.mintFailed({
1635
1701
  ...outcome.target,
1636
1702
  ...describeMintFailure(outcome.failure, outcome.target),
1637
1703
  runner: outcome.runner,
1638
1704
  cleanup: RUN_CLEANUP.facts(outcome)
1639
1705
  });
1640
- case "spawn-failed":
1706
+ case "spawn_failed":
1641
1707
  return runErrors.spawnFailed({
1642
1708
  executable: outcome.executable,
1643
1709
  message: outcome.message,
@@ -1646,12 +1712,12 @@ async function runCommand({ app, ui, signal }, request, spec) {
1646
1712
  });
1647
1713
  case "canceled":
1648
1714
  return outcomes.canceled({ changed: canceledChanges(outcome) });
1649
- case "runner-failed":
1715
+ case "runner_failed":
1650
1716
  return runErrors.runnerFailed({
1651
1717
  failure: runnerFailureFacts(outcome.failure),
1652
1718
  cleanup: RUN_CLEANUP.facts(outcome)
1653
1719
  });
1654
- case "snapshot-gone":
1720
+ case "snapshot_gone":
1655
1721
  return runErrors.snapshotGone({
1656
1722
  snapshotId: outcome.entry.snapshotId,
1657
1723
  base: outcome.entry.base,
@@ -1661,15 +1727,9 @@ async function runCommand({ app, ui, signal }, request, spec) {
1661
1727
  }
1662
1728
  }
1663
1729
  function runProblems(request) {
1664
- const { credential, unsandboxed, rebuildSnapshot, saveSnapshot, showOutput, keepSandbox } = request;
1730
+ const { credential, unsandboxed, saveDevSnapshot, showOutput, keepSandbox } = request;
1665
1731
  return [
1666
1732
  ...resourceFlagProblems(request),
1667
- ...rebuildSnapshot && unsandboxed ? [
1668
- {
1669
- field: "rebuildSnapshot",
1670
- message: "--rebuild-snapshot builds a runner snapshot; drop it or --unsandboxed."
1671
- }
1672
- ] : [],
1673
1733
  ...!unsandboxed && credential === "github-actions" ? [
1674
1734
  {
1675
1735
  field: "credential",
@@ -1694,16 +1754,16 @@ function runProblems(request) {
1694
1754
  message: "--keep-sandbox keeps a sandboxed run's runner sandbox; drop it or --unsandboxed."
1695
1755
  }
1696
1756
  ] : [],
1697
- ...saveSnapshot === true && unsandboxed ? [
1757
+ ...saveDevSnapshot === true && unsandboxed ? [
1698
1758
  {
1699
- field: "saveSnapshot",
1700
- message: "--save-snapshot saves a sandboxed run's runner sandbox; drop it or --unsandboxed."
1759
+ field: "saveDevSnapshot",
1760
+ message: "--save-dev-snapshot saves a sandboxed run's runner sandbox; drop it or --unsandboxed."
1701
1761
  }
1702
1762
  ] : [],
1703
- ...saveSnapshot === true && keepsSandbox(keepSandbox) ? [
1763
+ ...saveDevSnapshot === true && keepsSandbox(keepSandbox) ? [
1704
1764
  {
1705
- field: "saveSnapshot",
1706
- message: "--save-snapshot saves the runner sandbox instead of keeping it; drop --keep-sandbox or set it to 0."
1765
+ field: "saveDevSnapshot",
1766
+ message: "--save-dev-snapshot saves the runner sandbox instead of keeping it; drop --keep-sandbox or set it to 0."
1707
1767
  }
1708
1768
  ] : []
1709
1769
  ];
@@ -1719,14 +1779,17 @@ async function runRequestFor(app, options) {
1719
1779
  };
1720
1780
  return { ok: true, run: run2 };
1721
1781
  }
1782
+ if (request.saveDevSnapshot && !devSnapshotsTrusted(where.recipe))
1783
+ return {
1784
+ ok: false,
1785
+ refusal: runErrors.devSnapshotsNotTrusted({ flag: "--save-dev-snapshot", configFile })
1786
+ };
1722
1787
  const prepared = await prepareRunner(app.context, {
1723
1788
  cwd: app.cwd,
1724
1789
  recipe: where.recipe,
1725
1790
  // The recipe's `vcpus` reads each of the run's resources by its definition: one its `beforeRun` skipped isn't.
1726
1791
  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
1792
+ reuseDevSnapshots: !request.noReuseDevSnapshot && where.recipe.reuseDevSnapshot
1730
1793
  });
1731
1794
  if (prepared.kind !== "ok") {
1732
1795
  const refusal = prepareRefusal(prepared, configFile);
@@ -1736,7 +1799,6 @@ async function runRequestFor(app, options) {
1736
1799
  refusal: secrets.length === 0 ? refusal : redactStrings(refusal, redactor(secrets))
1737
1800
  };
1738
1801
  }
1739
- const { save } = prepared.prepared;
1740
1802
  const keepMs = keepSandboxMinutes(request.keepSandbox, where.recipe, app.env) * 6e4;
1741
1803
  const run = {
1742
1804
  ...base,
@@ -1747,7 +1809,8 @@ async function runRequestFor(app, options) {
1747
1809
  target: where.target,
1748
1810
  user: app.user,
1749
1811
  secrets: where.secrets,
1750
- sandbox: save?.kind === "branch" ? { kind: "save", branch: save.branch, always: save.always, otherwiseKeepMs: keepMs } : { kind: "keep", ms: keepMs }
1812
+ save: saveMode(request, where.recipe, app.env),
1813
+ keepMs
1751
1814
  }
1752
1815
  };
1753
1816
  return { ok: true, run };
@@ -1778,10 +1841,10 @@ async function summarize(app, run) {
1778
1841
  const { timeline, tests } = recorded;
1779
1842
  const logs = recording.opened.ok ? recording.opened.path : void 0;
1780
1843
  const failed = tests.events.some((event) => event.kind === "test-result" && event.state === "fail");
1781
- const testsLines = testsSummaryLines(tests.events, tests.unreadable, tests.incomplete);
1844
+ const testsLines = testsSummaryLines(tests.events, run.hints, tests.unreadable, tests.incomplete);
1782
1845
  const stepLogs = failedStepLogs(timeline, recording, app.env);
1783
1846
  const clock = workerClock(recorded);
1784
- const charted = clock === void 0 ? void 0 : testsChart(tests.events, tests.unreadable, clock, tests.incomplete);
1847
+ const charted = clock === void 0 ? void 0 : testsChart(tests.events, run.hints, tests.unreadable, clock, tests.incomplete);
1785
1848
  const summarized = await app.context.jobSummary.appendJobSummary(
1786
1849
  jobSummaryMarkdown(timeline, {
1787
1850
  command: run.command,
@@ -1842,9 +1905,16 @@ function keepsSandbox(flag) {
1842
1905
  return flag !== void 0 && (parseKeepTime(flag) ?? 0) > 0;
1843
1906
  }
1844
1907
  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";
1908
+ const flag = request.saveDevSnapshot;
1909
+ if (flag !== void 0) return flag ? { kind: "always" } : { kind: "never", reason: "no-save-flag" };
1910
+ if (keepsSandbox(request.keepSandbox)) return { kind: "never", reason: "keep-sandbox" };
1911
+ if (recipe.saveDevSnapshot !== void 0)
1912
+ return recipe.saveDevSnapshot ? { kind: "always" } : { kind: "never", reason: "recipe" };
1913
+ if (isCi(env)) return { kind: "never", reason: "ci" };
1914
+ return devSnapshotsTrusted(recipe) ? { kind: "new-head" } : { kind: "never", reason: "not-trusted" };
1915
+ }
1916
+ function runSaveDefault(recipe, env) {
1917
+ return saveMode({}, recipe, env);
1848
1918
  }
1849
1919
  var DEFAULT_KEEP_SANDBOX_MINUTES = 30;
1850
1920
  function keepSandboxMinutes(flag, recipe, env) {
@@ -1881,7 +1951,7 @@ function canceledChanges(outcome) {
1881
1951
  ];
1882
1952
  const cleanup = RUN_CLEANUP.facts(outcome).runner;
1883
1953
  if (cleanup !== null) lines.push(...runnerCleanupLines(cleanup));
1884
- lines.push(...REGISTRY.reports.canceledLines(outcome.resourceCleanup));
1954
+ lines.push(...DEFINITION_SET.reports.canceledLines(outcome.resourceCleanup));
1885
1955
  return lines.join("\n");
1886
1956
  }
1887
1957
  function runnerCleanupLines({ kept, notKept, notStopped, notDeleted }) {
@@ -1898,55 +1968,26 @@ function runnerCleanupLines({ kept, notKept, notStopped, notDeleted }) {
1898
1968
  ];
1899
1969
  }
1900
1970
 
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
1971
  export {
1972
+ notStoppedText,
1973
+ notDeletedText,
1974
+ RUN_CLEANUP,
1939
1975
  ranSchema,
1940
1976
  RAN_DESCRIPTION,
1941
1977
  renderRan,
1978
+ runErrors,
1942
1979
  RUN_ERRORS,
1943
1980
  outcomes,
1981
+ lineProgress,
1982
+ progressLine,
1983
+ headText,
1944
1984
  canceledBeforeStart,
1945
1985
  RUN_REQUEST_FIELDS,
1946
1986
  RUN_CLI_OPTIONS,
1947
1987
  runCommand,
1948
1988
  runProblems,
1989
+ prepareRefusal,
1949
1990
  checkoutFailedRefusal,
1950
- RUN_USAGE_FLAGS,
1951
- RUN_FIELDS
1991
+ runSaveDefault,
1992
+ runnerFailureFacts
1952
1993
  };