@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
@@ -1,6 +1,5 @@
1
1
  import { z } from "zod";
2
2
  import { type ResourceReports, type RunOutcome, type RunRequest, type RunState } from "../core/index.ts";
3
- import type { RunnerSave } from "../runner/index.ts";
4
3
  import type { Row } from "../sdk/extension/index.ts";
5
4
  import type { TestEvent } from "../sdk/run/launcher.ts";
6
5
  import { type TestPlanFacts } from "./plan.ts";
@@ -40,7 +39,7 @@ export type RecordedResources = {
40
39
  };
41
40
  };
42
41
  /**
43
- * How a run ended: its outcome's kind (`ran`, `canceled`, `spawn-failed`, …), the status storm exited with and the
42
+ * How a run ended: its outcome's kind (`ran`, `canceled`, `spawn_failed`, …), the status storm exited with and the
44
43
  * signal that ended the command, for a run whose command ran (null otherwise), how long the command took (null when it
45
44
  * never ended), its tests' totals (null without a final result), why those may be incomplete (null unless a sandboxed
46
45
  * run's final read of its test events file failed), what each resource instance it acquired reports of itself, as a
@@ -55,42 +54,15 @@ declare const snapshotSchema: z.ZodObject<{
55
54
  id: z.ZodString;
56
55
  base: z.ZodString;
57
56
  built: z.ZodBoolean;
58
- branch: z.ZodNullable<z.ZodString>;
59
- head: z.ZodNullable<z.ZodString>;
57
+ builtBehind: z.ZodNullable<z.ZodNumber>;
60
58
  }, z.core.$strip>;
61
59
  /**
62
60
  * The runner snapshot a runner sandbox started from: its id, the base it is of, which the run's changes were uploaded
63
- * on top of, whether the run built it or reused a cached one, and for a branch snapshot the branch and HEAD commit of
64
- * the run that saved it (each null for a base snapshot).
61
+ * on top of and the commit it was built at, whether the run built it or reused a cached one, and how many commits HEAD
62
+ * has that its base lacks (`builtBehind`), null when the run state had no count. Version 5 records only base snapshots; storm does not read a version 4
63
+ * record, whose dev snapshot count may have been measured from another commit than its base.
65
64
  */
66
65
  export type RunRecordSnapshot = Readonly<z.output<typeof snapshotSchema>>;
67
- /**
68
- * How saving the runner sandbox as a branch snapshot ended, as a `ran` outcome and `run.json` report it.
69
- */
70
- export declare const saveSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
71
- kind: z.ZodLiteral<"saved">;
72
- snapshotId: z.ZodString;
73
- base: z.ZodString;
74
- branch: z.ZodString;
75
- head: z.ZodString;
76
- ms: z.ZodNumber;
77
- sizeBytes: z.ZodNumber;
78
- entryWritten: z.ZodBoolean;
79
- }, z.core.$strip>, z.ZodObject<{
80
- kind: z.ZodLiteral<"skipped">;
81
- reason: z.ZodLiteral<"detached-head">;
82
- }, z.core.$strip>, z.ZodObject<{
83
- kind: z.ZodLiteral<"failed">;
84
- step: z.ZodEnum<{
85
- "save-snapshot": "save-snapshot";
86
- scrub: "scrub";
87
- }>;
88
- message: z.ZodString;
89
- }, z.core.$strip>, z.ZodObject<{
90
- kind: z.ZodLiteral<"stopped">;
91
- }, z.core.$strip>], "kind">;
92
- /** How saving the runner sandbox as a branch snapshot ended. */
93
- export type RunRecordSave = z.output<typeof saveSchema>;
94
66
  declare const whereSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
95
67
  kind: z.ZodLiteral<"unsandboxed">;
96
68
  }, z.core.$strip>, z.ZodObject<{
@@ -107,40 +79,18 @@ declare const whereSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
107
79
  id: z.ZodString;
108
80
  base: z.ZodString;
109
81
  built: z.ZodBoolean;
110
- branch: z.ZodNullable<z.ZodString>;
111
- head: z.ZodNullable<z.ZodString>;
82
+ builtBehind: z.ZodNullable<z.ZodNumber>;
112
83
  }, z.core.$strip>>;
113
84
  keptUntil: z.ZodNullable<z.ZodString>;
114
- save: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
115
- kind: z.ZodLiteral<"saved">;
116
- snapshotId: z.ZodString;
117
- base: z.ZodString;
118
- branch: z.ZodString;
119
- head: z.ZodString;
120
- ms: z.ZodNumber;
121
- sizeBytes: z.ZodNumber;
122
- entryWritten: z.ZodBoolean;
123
- }, z.core.$strip>, z.ZodObject<{
124
- kind: z.ZodLiteral<"skipped">;
125
- reason: z.ZodLiteral<"detached-head">;
126
- }, z.core.$strip>, z.ZodObject<{
127
- kind: z.ZodLiteral<"failed">;
128
- step: z.ZodEnum<{
129
- "save-snapshot": "save-snapshot";
130
- scrub: "scrub";
131
- }>;
132
- message: z.ZodString;
133
- }, z.core.$strip>, z.ZodObject<{
134
- kind: z.ZodLiteral<"stopped">;
135
- }, z.core.$strip>], "kind">>;
85
+ uploadBytes: z.ZodNullable<z.ZodNumber>;
136
86
  }, z.core.$strip>], "kind">;
137
87
  /**
138
- * Where a run's command ran: on this machine (`unsandboxed`, with `--unsandboxed`), or in a runner sandbox (`runner`):
88
+ * Where the command ran: on this machine (`unsandboxed`, with `--unsandboxed`), or in a runner sandbox (`runner`):
139
89
  * the control plane team and project it runs in, its region, runtime and vCPUs, and the run's base, HEAD's merge-base
140
90
  * with `baseRef`, all known as the run starts; then, once the run is over, the runner sandbox's name and the runner
141
91
  * snapshot it started from, each null when the run stopped before it, when the runner sandbox's timeout stops it, as an
142
- * ISO time, when the run kept it running (null when it stopped and deleted it), and how saving it as a branch snapshot
143
- * ended (null when the run started no save). A reused runner snapshot can be of an older base.
92
+ * ISO time, when the run kept it running (null when it stopped and deleted it), and how many bytes of changes the run
93
+ * uploaded (null when the run stopped before the upload).
144
94
  */
145
95
  export type RunRecordWhere = Readonly<z.output<typeof whereSchema>>;
146
96
  declare const gitSchema: z.ZodObject<{
@@ -159,7 +109,7 @@ export type RunRecordGit = Readonly<z.output<typeof gitSchema>>;
159
109
  */
160
110
  export type RunRecordPlan = TestPlanFacts;
161
111
  declare const runRecordSchema: z.ZodObject<{
162
- version: z.ZodLiteral<3>;
112
+ version: z.ZodLiteral<5>;
163
113
  startedAt: z.ZodString;
164
114
  cwd: z.ZodString;
165
115
  configFile: z.ZodNullable<z.ZodString>;
@@ -193,32 +143,10 @@ declare const runRecordSchema: z.ZodObject<{
193
143
  id: z.ZodString;
194
144
  base: z.ZodString;
195
145
  built: z.ZodBoolean;
196
- branch: z.ZodNullable<z.ZodString>;
197
- head: z.ZodNullable<z.ZodString>;
146
+ builtBehind: z.ZodNullable<z.ZodNumber>;
198
147
  }, z.core.$strip>>;
199
148
  keptUntil: z.ZodNullable<z.ZodString>;
200
- save: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
201
- kind: z.ZodLiteral<"saved">;
202
- snapshotId: z.ZodString;
203
- base: z.ZodString;
204
- branch: z.ZodString;
205
- head: z.ZodString;
206
- ms: z.ZodNumber;
207
- sizeBytes: z.ZodNumber;
208
- entryWritten: z.ZodBoolean;
209
- }, z.core.$strip>, z.ZodObject<{
210
- kind: z.ZodLiteral<"skipped">;
211
- reason: z.ZodLiteral<"detached-head">;
212
- }, z.core.$strip>, z.ZodObject<{
213
- kind: z.ZodLiteral<"failed">;
214
- step: z.ZodEnum<{
215
- "save-snapshot": "save-snapshot";
216
- scrub: "scrub";
217
- }>;
218
- message: z.ZodString;
219
- }, z.core.$strip>, z.ZodObject<{
220
- kind: z.ZodLiteral<"stopped">;
221
- }, z.core.$strip>], "kind">>;
149
+ uploadBytes: z.ZodNullable<z.ZodNumber>;
222
150
  }, z.core.$strip>], "kind">;
223
151
  git: z.ZodNullable<z.ZodObject<{
224
152
  branch: z.ZodNullable<z.ZodString>;
@@ -253,7 +181,7 @@ export type RunRecord = Readonly<Omit<z.output<typeof runRecordSchema>, "ended">
253
181
  }>;
254
182
  /** `run.json`'s text for `record`. */
255
183
  export declare function runRecordText(record: RunRecord): string;
256
- /** The run `text` records; undefined when there is no text, or it isn't a version 3 `run.json`. */
184
+ /** The run `text` records; undefined when there is no text, or it isn't a version 5 `run.json`. */
257
185
  export declare function parseRunRecord(text: string | undefined): RunRecord | undefined;
258
186
  /** The totals of `events`' final results; null without one. */
259
187
  export declare function testTotals(events: readonly TestEvent[]): RunTestTotals | null;
@@ -266,15 +194,14 @@ export declare function testTotals(events: readonly TestEvent[]): RunTestTotals
266
194
  */
267
195
  export declare function runEnd(outcome: RunOutcome, ran: RunState["command"], tests: RunTestEvents, reports: ResourceReports): RunRecordEnd;
268
196
  /**
269
- * Where the run's command runs, as `run.json` records it as the run starts: unsandboxed, or in a runner sandbox, with
197
+ * Where the command runs, as `run.json` records it as the run starts: unsandboxed, or in a runner sandbox, with
270
198
  * no sandbox or snapshot yet.
271
199
  */
272
200
  export declare function startedWhere(run: RunRequest): RunRecordWhere;
273
201
  /**
274
202
  * `where` once the run is over, from the runner's final state: for a sandboxed run, the runner sandbox the run started,
275
203
  * the runner snapshot it started from, which the run reused or built, when its timeout stops the runner sandbox it
276
- * kept running, and how saving it as a branch snapshot ended (`save`). Each is null when the run stopped before it,
277
- * kept no runner sandbox, or saved none.
204
+ * kept running. Each is null when the run stopped before it, or kept no runner sandbox.
278
205
  */
279
- export declare function endedWhere(where: RunRecordWhere, runner: RunState["runner"], save: RunnerSave | null): RunRecordWhere;
206
+ export declare function endedWhere(where: RunRecordWhere, runner: RunState["runner"]): RunRecordWhere;
280
207
  export {};
@@ -1,9 +1,10 @@
1
1
  // What a run records about itself in its run directory's `run.json`, which `storm runs` reads back: written as
2
2
  // the run directory opens, then replaced with how the run ended once it is over. The run directory gateway stores the
3
- // text; this file owns its shape, version 3, and what goes in it: where the run's command runs, as the run starts and
4
- // once it is over, and how the run ended. Reading it back asks the registry nothing: each resource instance's facts
5
- // read as recorded, beside its definition's name, and `runs show` lists the rows storm rendered for them when the run
6
- // ended, so a past run reads the same after a resource definition is renamed or its extension removed.
3
+ // text; this file owns its shape, version 5, and what goes in it: where the command runs, as the run starts and
4
+ // once it is over, and how the run ended. Reading it back asks the resource definition set nothing: each resource
5
+ // instance's facts read as recorded, beside its definition's name, and `runs show` lists the rows storm rendered for
6
+ // them when the run ended, so a past run reads the same after a resource definition is renamed or its extension
7
+ // removed.
7
8
  import { z } from "zod";
8
9
  import { commandExitStatus, } from "../core/index.js";
9
10
  import { planSchema } from "./plan.js";
@@ -26,47 +27,8 @@ const snapshotSchema = z.object({
26
27
  id: z.string(),
27
28
  base: z.string(),
28
29
  built: z.boolean(),
29
- branch: z.string().nullable(),
30
- head: z.string().nullable(),
30
+ builtBehind: z.number().nullable(),
31
31
  });
32
- /**
33
- * How saving the runner sandbox as a branch snapshot ended, as a `ran` outcome and `run.json` report it.
34
- */
35
- export const saveSchema = z.discriminatedUnion("kind", [
36
- z.object({
37
- /** It saved the runner sandbox as a branch snapshot. */
38
- kind: z.literal("saved"),
39
- /** The runner snapshot it saved. */
40
- snapshotId: z.string(),
41
- /** The base it is of: the base of the runner snapshot the run started from, a full SHA. */
42
- base: z.string(),
43
- /** The local branch it is for. */
44
- branch: z.string(),
45
- /** HEAD's commit as the run started, a full SHA. */
46
- head: z.string(),
47
- /** How long the save took, in milliseconds, from the scrub's start until the snapshot was saved. */
48
- ms: z.number(),
49
- /** The snapshot's size in bytes. */
50
- sizeBytes: z.number(),
51
- /** Whether the runner snapshot cache recorded it; a later run on the branch starts from it only when it did. */
52
- entryWritten: z.boolean(),
53
- }),
54
- z.object({
55
- /** It didn't save: HEAD was detached, so there is no branch to save for. */
56
- kind: z.literal("skipped"),
57
- reason: z.literal("detached-head"),
58
- }),
59
- z.object({
60
- /** It didn't save: the scrub or the save failed. */
61
- kind: z.literal("failed"),
62
- step: z.enum(["scrub", "save-snapshot"]),
63
- message: z.string(),
64
- }),
65
- z.object({
66
- /** It didn't save, or recorded nothing: a signal stopped it. */
67
- kind: z.literal("stopped"),
68
- }),
69
- ]);
70
32
  const whereSchema = z.discriminatedUnion("kind", [
71
33
  z.object({ kind: z.literal("unsandboxed") }),
72
34
  z.object({
@@ -81,12 +43,12 @@ const whereSchema = z.discriminatedUnion("kind", [
81
43
  sandbox: z.string().nullable(),
82
44
  snapshot: snapshotSchema.nullable(),
83
45
  keptUntil: z.string().nullable(),
84
- save: saveSchema.nullable(),
46
+ uploadBytes: z.number().nullable(),
85
47
  }),
86
48
  ]);
87
49
  const gitSchema = z.object({ branch: z.string().nullable(), commit: z.string(), dirty: z.boolean() });
88
50
  const runRecordSchema = z.object({
89
- version: z.literal(3),
51
+ version: z.literal(5),
90
52
  startedAt: z.string(),
91
53
  cwd: z.string(),
92
54
  configFile: z.string().nullable(),
@@ -101,7 +63,7 @@ const runRecordSchema = z.object({
101
63
  export function runRecordText(record) {
102
64
  return JSON.stringify(record);
103
65
  }
104
- /** The run `text` records; undefined when there is no text, or it isn't a version 3 `run.json`. */
66
+ /** The run `text` records; undefined when there is no text, or it isn't a version 5 `run.json`. */
105
67
  export function parseRunRecord(text) {
106
68
  if (text === undefined)
107
69
  return undefined;
@@ -159,7 +121,7 @@ export function runEnd(outcome, ran, tests, reports) {
159
121
  };
160
122
  }
161
123
  /**
162
- * Where the run's command runs, as `run.json` records it as the run starts: unsandboxed, or in a runner sandbox, with
124
+ * Where the command runs, as `run.json` records it as the run starts: unsandboxed, or in a runner sandbox, with
163
125
  * no sandbox or snapshot yet.
164
126
  */
165
127
  export function startedWhere(run) {
@@ -178,16 +140,15 @@ export function startedWhere(run) {
178
140
  sandbox: null,
179
141
  snapshot: null,
180
142
  keptUntil: null,
181
- save: null,
143
+ uploadBytes: null,
182
144
  };
183
145
  }
184
146
  /**
185
147
  * `where` once the run is over, from the runner's final state: for a sandboxed run, the runner sandbox the run started,
186
148
  * the runner snapshot it started from, which the run reused or built, when its timeout stops the runner sandbox it
187
- * kept running, and how saving it as a branch snapshot ended (`save`). Each is null when the run stopped before it,
188
- * kept no runner sandbox, or saved none.
149
+ * kept running. Each is null when the run stopped before it, or kept no runner sandbox.
189
150
  */
190
- export function endedWhere(where, runner, save) {
151
+ export function endedWhere(where, runner) {
191
152
  if (where.kind === "unsandboxed")
192
153
  return where;
193
154
  const snapshot = runner?.snapshot;
@@ -200,10 +161,9 @@ export function endedWhere(where, runner, save) {
200
161
  id: snapshot.id,
201
162
  base: snapshot.base,
202
163
  built: snapshot.kind === "built",
203
- branch: snapshot.branch,
204
- head: snapshot.head,
164
+ builtBehind: snapshot.builtBehind,
205
165
  },
206
166
  keptUntil: runner?.kept?.stopsAt ?? null,
207
- save,
167
+ uploadBytes: runner?.uploadBytes ?? null,
208
168
  };
209
169
  }
@@ -26,6 +26,7 @@ export declare const timelineSchema: z.ZodObject<{
26
26
  stopped: "stopped";
27
27
  unfinished: "unfinished";
28
28
  }>;
29
+ bytes: z.ZodOptional<z.ZodNumber>;
29
30
  }, z.core.$strip>>;
30
31
  idleMs: z.ZodNumber;
31
32
  snapshot: z.ZodOptional<z.ZodEnum<{
@@ -48,6 +49,6 @@ export type TimelineFacts = z.output<typeof timelineSchema>;
48
49
  export type TimelineFactsRow = TimelineFacts["rows"][number];
49
50
  /**
50
51
  * `timeline` as storm reports and keeps it, each row labeled as the waterfall names it now, a resource lane by its
51
- * definition's lane kind among `laneKinds` (the registry's `presentations.laneKinds`).
52
+ * definition's lane kind among `laneKinds` (the definition set's `presentations.laneKinds`).
52
53
  */
53
54
  export declare function timelineFacts(timeline: Timeline, laneKinds: readonly LaneKind[]): TimelineFacts;
@@ -2,7 +2,7 @@
2
2
  // directory's `timeline.json`, and what the waterfall and the job summary draw. Each row keeps the label storm gave
3
3
  // it when the run ended, and its name and its steps' names are plain strings, so a past run's timeline still reads and
4
4
  // draws as it was after a resource's lane or steps are renamed, or its extension removed: reading it back asks the
5
- // registry nothing.
5
+ // resource definition set nothing.
6
6
  import { z } from "zod";
7
7
  /** Which row of the timeline: its name, and for a resource instance's lane the resource key, null for any other. */
8
8
  const rowRefShape = {
@@ -36,6 +36,8 @@ export const timelineSchema = z.object({
36
36
  startMs: z.number(),
37
37
  endMs: z.number(),
38
38
  outcome: timelineOutcomeSchema,
39
+ /** The runner's upload step's: how many bytes of changes it uploaded; absent on any other step and in a timeline written before storm recorded it. */
40
+ bytes: z.number().optional(),
39
41
  })),
40
42
  /** How long the lane, once ready, waited for the other before the command started. */
41
43
  idleMs: z.number(),
@@ -49,7 +51,7 @@ export const timelineSchema = z.object({
49
51
  });
50
52
  /**
51
53
  * `timeline` as storm reports and keeps it, each row labeled as the waterfall names it now, a resource lane by its
52
- * definition's lane kind among `laneKinds` (the registry's `presentations.laneKinds`).
54
+ * definition's lane kind among `laneKinds` (the definition set's `presentations.laneKinds`).
53
55
  */
54
56
  export function timelineFacts(timeline, laneKinds) {
55
57
  return {
@@ -0,0 +1,115 @@
1
+ import type { RunnerContext } from "./context.ts";
2
+ import type { RunnerFailure, RunnerProgress } from "./events.ts";
3
+ import type { CheckoutHead, RunnerSnapshotCacheFailure, RunnerSnapshotEntry, SandboxAccess } from "./gateways.ts";
4
+ import type { PrepareRunnerOutcome, RunnerPrepareContext } from "./prepare.ts";
5
+ import type { CheckedRecipe } from "./recipe.ts";
6
+ import { type RunnerScopeFacts } from "./scope.ts";
7
+ import type { RunnerSecrets } from "./secrets.ts";
8
+ import { type BaseSnapshotPlan } from "./snapshot-build.ts";
9
+ /** What `prepareSnapshotBuild` checks: where, which recipe, and what to build. */
10
+ export interface SnapshotBuildRequest {
11
+ /** The directory the command started in, inside the checkout. */
12
+ readonly cwd: string;
13
+ readonly recipe: CheckedRecipe;
14
+ /** The ref `--base` names; undefined builds at the merge-base. */
15
+ readonly ref: string | undefined;
16
+ /** `--full`: build whatever the cache holds. */
17
+ readonly full: boolean;
18
+ }
19
+ /**
20
+ * A build, checked on this machine: the base snapshot it builds (`plan`), HEAD, whose `dirty` says the working tree
21
+ * has uncommitted changes, which a base snapshot doesn't hold, the ref `--base` named (null for the merge-base), HEAD's
22
+ * merge-base and its ref (null for a `--base` build in a checkout where no base ref shares history with HEAD), whether
23
+ * the commit it builds at is that merge-base (`atMergeBase`: a run here starts only from a snapshot at its merge-base,
24
+ * though a run in another checkout, or after a later merge-base, still might), and the base snapshots of `plan`'s base
25
+ * and key the cache holds with more than an hour left (`cached`, before the team and project filter).
26
+ */
27
+ export interface PreparedSnapshotBuild {
28
+ readonly plan: BaseSnapshotPlan;
29
+ readonly head: CheckoutHead;
30
+ readonly ref: string | null;
31
+ readonly mergeBase: {
32
+ readonly commit: string;
33
+ readonly ref: string;
34
+ } | null;
35
+ readonly atMergeBase: boolean;
36
+ readonly cached: readonly RunnerSnapshotEntry[];
37
+ readonly full: boolean;
38
+ }
39
+ /**
40
+ * How a build's local checks ended: a run's refusals, but `submodules`'s and `invalid-recipe`'s and `checkout-failed`'s
41
+ * that the build shares, or `ref-not-found` when `--base` names no local commit.
42
+ */
43
+ export type PrepareSnapshotBuildOutcome = {
44
+ readonly kind: "ok";
45
+ readonly build: PreparedSnapshotBuild;
46
+ } | Exclude<PrepareRunnerOutcome, {
47
+ readonly kind: "ok";
48
+ }> | {
49
+ readonly kind: "ref-not-found";
50
+ readonly ref: string;
51
+ };
52
+ /**
53
+ * Runs a build's local checks, before anything is minted or started: the repository's root, HEAD, the submodule
54
+ * refusal, HEAD's merge-base (`resolveBase`, which refuses with `no-base-ref` only without `--base`), the commit
55
+ * `--base` resolves to locally, the snapshot steps and key at the commit it builds, the cache's base snapshots of it,
56
+ * and, when it builds at the merge-base, HEAD's count of commits after it. It never mints, acquires or creates, and removes no cache file.
57
+ */
58
+ export declare function prepareSnapshotBuild(context: RunnerPrepareContext, request: SnapshotBuildRequest): Promise<PrepareSnapshotBuildOutcome>;
59
+ /** What `buildSnapshots` is handed: the checked build, where its sandboxes run, who starts them, and the secrets. */
60
+ export interface BuildSnapshotsRequest {
61
+ readonly build: PreparedSnapshotBuild;
62
+ /** The minted credential, and the team and project it names: the sandboxes run there. */
63
+ readonly access: SandboxAccess;
64
+ /** The local user, for each sandbox's `user` tag. */
65
+ readonly user: string;
66
+ /** The runner secrets' values: each recipe step gets the ones it names. */
67
+ readonly secrets: RunnerSecrets;
68
+ }
69
+ /**
70
+ * How a build ended, before its sandbox scope closed.
71
+ *
72
+ * - `up-to-date`: the cache holds `snapshot`, a base snapshot at the commit for the access's team and project, so
73
+ * nothing started.
74
+ * - `built`: it built `snapshot` in `ms` (`sizeBytes`), and the cache recorded it.
75
+ * - `not-cached`: it built `snapshot`, but the cache couldn't write its entry (`failure`), so no run finds it.
76
+ * - `failed`: a step, a Sandbox call or the checkout failed.
77
+ * - `aborted`: the signal aborted. A base snapshot's save runs to its end once started, so a signal during it still
78
+ * leaves a saved snapshot, which `snapshot` names with whether the cache wrote its entry; null when it saved none.
79
+ */
80
+ export type SnapshotBuildEnd = {
81
+ readonly kind: "up-to-date";
82
+ readonly snapshot: RunnerSnapshotEntry;
83
+ } | {
84
+ readonly kind: "built";
85
+ readonly snapshot: RunnerSnapshotEntry;
86
+ readonly ms: number;
87
+ readonly sizeBytes: number;
88
+ } | {
89
+ readonly kind: "not-cached";
90
+ readonly snapshot: RunnerSnapshotEntry;
91
+ readonly failure: RunnerSnapshotCacheFailure;
92
+ } | {
93
+ readonly kind: "failed";
94
+ readonly failure: RunnerFailure;
95
+ } | {
96
+ readonly kind: "aborted";
97
+ readonly snapshot: {
98
+ readonly entry: RunnerSnapshotEntry;
99
+ readonly cached: boolean;
100
+ } | null;
101
+ };
102
+ /** How a build ended (`SnapshotBuildEnd`), with what closing its sandbox scope left (`cleanup`). */
103
+ export type SnapshotBuildOutcome = SnapshotBuildEnd & {
104
+ readonly cleanup: RunnerScopeFacts;
105
+ };
106
+ /**
107
+ * Builds the checked build's base snapshot, reporting to `progress`, and closes every sandbox it started however it
108
+ * ends, keeping none. A cached base snapshot at the commit for the access's team and project is up to date, unless
109
+ * `full`, which builds a new one that replaces its cache entry. `signal` stops it in any stage: it says so, then
110
+ * closes the scope at once. A base snapshot's save isn't stopped by the signal, so after it the build checks the signal
111
+ * once and ends `aborted` with what it saved.
112
+ */
113
+ export declare function buildSnapshots(context: RunnerContext, request: BuildSnapshotsRequest, control: {
114
+ readonly signal: AbortSignal;
115
+ }, progress: RunnerProgress): Promise<SnapshotBuildOutcome>;
@@ -0,0 +1,146 @@
1
+ // `storm snapshots build`: building one base snapshot that the runner snapshot cache lacks, with no run: at the
2
+ // merge-base by default, or at the commit `--base <ref>` names, which a run starts from only once that commit is its
3
+ // merge-base. It owns its sandbox scope from its first stage to its end, as a run's runner session does. It
4
+ // acquires no resource, runs no command, and keeps no sandbox.
5
+ import { resolveBase } from "./base.js";
6
+ import { runnerSandboxScope } from "./scope.js";
7
+ import { buildSnapshot } from "./snapshot-build.js";
8
+ import { hasTimeLeft } from "./snapshot-cache.js";
9
+ import { snapshotStepsAt } from "./snapshot-key.js";
10
+ /**
11
+ * Runs a build's local checks, before anything is minted or started: the repository's root, HEAD, the submodule
12
+ * refusal, HEAD's merge-base (`resolveBase`, which refuses with `no-base-ref` only without `--base`), the commit
13
+ * `--base` resolves to locally, the snapshot steps and key at the commit it builds, the cache's base snapshots of it,
14
+ * and, when it builds at the merge-base, HEAD's count of commits after it. It never mints, acquires or creates, and removes no cache file.
15
+ */
16
+ export async function prepareSnapshotBuild(context, request) {
17
+ const { checkout } = context;
18
+ const { recipe, ref } = request;
19
+ const root = await checkout.repositoryRoot({ cwd: request.cwd });
20
+ if (!root.ok)
21
+ return { kind: "checkout-failed", failure: root.failure };
22
+ const repoRoot = root.value;
23
+ const head = await checkout.head({ repoRoot });
24
+ if (!head.ok)
25
+ return { kind: "checkout-failed", failure: head.failure };
26
+ const resolved = await resolveBase(checkout, { repoRoot, baseRefs: recipe.baseRefs });
27
+ if (resolved.kind === "failed")
28
+ return { kind: "checkout-failed", failure: resolved.failure };
29
+ const mergeBase = resolved.kind === "resolved" ? { commit: resolved.base, ref: resolved.ref } : null;
30
+ const submodules = await checkout.submodules({ repoRoot });
31
+ if (!submodules.ok)
32
+ return { kind: "checkout-failed", failure: submodules.failure };
33
+ if (submodules.value.length > 0)
34
+ return { kind: "submodules", paths: [...submodules.value] };
35
+ let base;
36
+ if (ref === undefined) {
37
+ if (resolved.kind !== "resolved")
38
+ return resolved;
39
+ base = resolved.base;
40
+ }
41
+ else {
42
+ const commit = await checkout.resolveCommit({ repoRoot, ref });
43
+ if (!commit.ok)
44
+ return { kind: "checkout-failed", failure: commit.failure };
45
+ if (commit.value === null)
46
+ return { kind: "ref-not-found", ref };
47
+ base = commit.value;
48
+ }
49
+ const steps = await snapshotStepsAt(checkout, { repoRoot, base, recipe });
50
+ if (!steps.ok)
51
+ return { kind: "invalid-recipe", path: steps.path, problem: steps.problem };
52
+ // An unreadable cache holds nothing to reuse: the build goes on, and builds.
53
+ const listed = await context.runnerSnapshots.listEntries();
54
+ const now = context.clock.now();
55
+ const cached = (listed.ok ? listed.value.entries : []).filter((entry) => entry.base === base &&
56
+ entry.recipeName === recipe.name &&
57
+ entry.region === recipe.region &&
58
+ entry.runtime === recipe.runtime &&
59
+ entry.snapshotKey === steps.key &&
60
+ hasTimeLeft(entry, now));
61
+ const atMergeBase = base === mergeBase?.commit;
62
+ // The built snapshot's count behind HEAD, for a build at the merge-base, the one snapshot a run here starts from.
63
+ let commitsAfterBase = null;
64
+ if (atMergeBase) {
65
+ const counted = await checkout.commitCount({ repoRoot, from: base, to: "HEAD" });
66
+ if (!counted.ok)
67
+ return { kind: "checkout-failed", failure: counted.failure };
68
+ commitsAfterBase = counted.value;
69
+ }
70
+ return {
71
+ kind: "ok",
72
+ build: {
73
+ plan: {
74
+ recipe,
75
+ repoRoot,
76
+ base,
77
+ toolchains: steps.toolchains,
78
+ prebuild: steps.prebuild,
79
+ snapshotKey: steps.key,
80
+ commitsAfterBase,
81
+ },
82
+ head: head.value,
83
+ ref: ref ?? null,
84
+ mergeBase,
85
+ atMergeBase,
86
+ cached,
87
+ full: request.full,
88
+ },
89
+ };
90
+ }
91
+ /**
92
+ * Builds the checked build's base snapshot, reporting to `progress`, and closes every sandbox it started however it
93
+ * ends, keeping none. A cached base snapshot at the commit for the access's team and project is up to date, unless
94
+ * `full`, which builds a new one that replaces its cache entry. `signal` stops it in any stage: it says so, then
95
+ * closes the scope at once. A base snapshot's save isn't stopped by the signal, so after it the build checks the signal
96
+ * once and ends `aborted` with what it saved.
97
+ */
98
+ export async function buildSnapshots(context, request, control, progress) {
99
+ const { signal } = control;
100
+ const scope = runnerSandboxScope(context, progress, { keepMs: 0 });
101
+ const stop = () => {
102
+ void progress.emit({ kind: "stopping", commandRunning: false, keepMs: 0 }).catch(() => undefined);
103
+ void scope.close().catch(() => undefined);
104
+ };
105
+ if (signal.aborted)
106
+ stop();
107
+ else
108
+ signal.addEventListener("abort", stop, { once: true });
109
+ try {
110
+ const ended = await buildIn(context, request, { scope, signal }, progress);
111
+ signal.removeEventListener("abort", stop);
112
+ return { ...ended, cleanup: await scope.close() };
113
+ }
114
+ catch (error) {
115
+ signal.removeEventListener("abort", stop);
116
+ await scope.close();
117
+ throw error;
118
+ }
119
+ }
120
+ async function buildIn(context, request, control, progress) {
121
+ const { build, access, user, secrets } = request;
122
+ const { signal } = control;
123
+ if (signal.aborted)
124
+ return { kind: "aborted", snapshot: null };
125
+ const cached = build.cached.find((entry) => entry.teamId === access.teamId && entry.projectId === access.projectId);
126
+ if (!build.full && cached !== undefined)
127
+ return { kind: "up-to-date", snapshot: cached };
128
+ const why = build.full ? "full" : build.ref === null ? "no-snapshot" : "base";
129
+ const built = await buildSnapshot(context, {
130
+ prepared: build.plan,
131
+ access,
132
+ user,
133
+ secrets,
134
+ why: why === "no-snapshot" ? { kind: why, rejected: [] } : { kind: why },
135
+ }, control, progress);
136
+ if (built.kind === "aborted")
137
+ return { kind: "aborted", snapshot: null };
138
+ if (built.kind !== "ok")
139
+ return built;
140
+ const { entry, cacheFailure, ms, sizeBytes } = built.value;
141
+ if (signal.aborted)
142
+ return { kind: "aborted", snapshot: { entry, cached: cacheFailure === null } };
143
+ return cacheFailure === null
144
+ ? { kind: "built", snapshot: entry, ms, sizeBytes }
145
+ : { kind: "not-cached", snapshot: entry, failure: cacheFailure };
146
+ }
@@ -1,4 +1,5 @@
1
- // What the runner's sandbox side reaches the world through, and the tags every sandbox it creates carries.
1
+ // What the runner reaches the world through as it readies and uses a runner sandbox, and the tags every sandbox it
2
+ // creates carries.
2
3
  /** The `purpose` tag of a recipe's sandboxes. */
3
4
  export function runnerPurpose(recipeName) {
4
5
  return `storm-runner-${recipeName}`;