@cnc-tools/storm 0.14.2 → 0.15.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 (401) hide show
  1. package/dist/application.js +3 -1
  2. package/dist/bin/storm.js +9 -7
  3. package/dist/build-info.js +1 -1
  4. package/dist/chunks/chunk-4U4DZ7VG.js +40 -0
  5. package/dist/chunks/{chunk-GSC6SRTW.js → chunk-5CCP36QQ.js} +1 -1
  6. package/dist/chunks/chunk-5GBMR4HM.js +966 -0
  7. package/dist/chunks/{chunk-43MWZLJR.js → chunk-5VXBKPW6.js} +1 -1
  8. package/dist/chunks/{chunk-RA4L2ACU.js → chunk-AWBSONHB.js} +88 -34
  9. package/dist/chunks/{chunk-BRUIATTR.js → chunk-CN4EFA5J.js} +59 -12
  10. package/dist/chunks/{chunk-3HBPNQ4Y.js → chunk-CXAT7ZKP.js} +2 -2
  11. package/dist/chunks/chunk-E4PJNZVG.js +783 -0
  12. package/dist/chunks/{chunk-T6AZIDZD.js → chunk-F6N34UWB.js} +12 -244
  13. package/dist/chunks/{chunk-RUPD4TLT.js → chunk-KC4KDJ5K.js} +147 -26
  14. package/dist/chunks/{chunk-I7AN3DIJ.js → chunk-L36GBUBB.js} +1626 -676
  15. package/dist/chunks/{chunk-XZCDA5PE.js → chunk-OX7X4B2L.js} +7 -2
  16. package/dist/chunks/{chunk-UUBZTGLV.js → chunk-PN5ULTTH.js} +140 -130
  17. package/dist/chunks/chunk-QUHY6FGN.js +108 -0
  18. package/dist/chunks/chunk-QVS7HRU7.js +74 -0
  19. package/dist/chunks/{chunk-UC6DULWY.js → chunk-R7XVBZOY.js} +130 -39
  20. package/dist/chunks/{chunk-LUOHJ3LB.js → chunk-RAQEXKL6.js} +1120 -465
  21. package/dist/chunks/{chunk-GJOEPJJL.js → chunk-SZEURWRS.js} +446 -52
  22. package/dist/chunks/chunk-TJNFVNKR.js +246 -0
  23. package/dist/chunks/{chunk-BW2ADH7U.js → chunk-VUPZH7J2.js} +1 -1
  24. package/dist/chunks/{chunk-HDL4WKIB.js → chunk-XEVHP5ZW.js} +2 -2
  25. package/dist/chunks/{chunk-VH2POPW5.js → chunk-YV7GE6EV.js} +635 -79
  26. package/dist/chunks/{chunk-GQIL3AHY.js → chunk-ZG3WQ4UF.js} +1 -1
  27. package/dist/chunks/{live-app-SZGEILCQ.js → live-app-PI3BAN6Y.js} +28 -23
  28. package/dist/command-tree.d.ts +2 -2
  29. package/dist/command-tree.js +2 -2
  30. package/dist/commands/exec/across-sandboxes-outcomes.d.ts +364 -0
  31. package/dist/commands/exec/across-sandboxes-outcomes.js +229 -0
  32. package/dist/commands/exec/across-sandboxes-run.d.ts +180 -0
  33. package/dist/commands/exec/across-sandboxes-run.js +339 -0
  34. package/dist/commands/exec/command.d.ts +577 -75
  35. package/dist/commands/exec/command.js +165 -32
  36. package/dist/commands/exec/driver-plan.d.ts +8 -2
  37. package/dist/commands/exec/driver-plan.js +13 -3
  38. package/dist/commands/exec/exec-words.d.ts +17 -3
  39. package/dist/commands/exec/exec-words.js +27 -16
  40. package/dist/commands/exec/live-view.d.ts +3 -4
  41. package/dist/commands/exec/live-view.js +37 -28
  42. package/dist/commands/exec/metadata.js +2 -2
  43. package/dist/commands/exec/mint-failed.d.ts +4 -4
  44. package/dist/commands/exec/mint-failed.js +6 -6
  45. package/dist/commands/exec/outcomes.d.ts +530 -73
  46. package/dist/commands/exec/outcomes.js +202 -66
  47. package/dist/commands/exec/plan-only.d.ts +10 -0
  48. package/dist/commands/exec/plan-only.js +46 -0
  49. package/dist/commands/exec/plan-run.d.ts +54 -35
  50. package/dist/commands/exec/plan-run.js +81 -38
  51. package/dist/commands/exec/planned-outcome.d.ts +15 -0
  52. package/dist/commands/exec/planned-outcome.js +35 -0
  53. package/dist/commands/exec/progress.d.ts +2 -2
  54. package/dist/commands/exec/progress.js +35 -18
  55. package/dist/commands/exec/resource-refusals.d.ts +2 -2
  56. package/dist/commands/exec/resource-refusals.js +3 -3
  57. package/dist/commands/exec/run-bin.d.ts +1 -1
  58. package/dist/commands/exec/run-bin.js +2 -2
  59. package/dist/commands/exec/run-command.d.ts +345 -63
  60. package/dist/commands/exec/run-command.js +308 -258
  61. package/dist/commands/exec/run-metadata.d.ts +42 -8
  62. package/dist/commands/exec/run-metadata.js +40 -21
  63. package/dist/commands/exec/run-planned.d.ts +20 -0
  64. package/dist/commands/exec/run-planned.js +22 -0
  65. package/dist/commands/exec/sandbox-lines.d.ts +42 -0
  66. package/dist/commands/exec/sandbox-lines.js +59 -0
  67. package/dist/commands/exec/sandbox-progress.d.ts +30 -0
  68. package/dist/commands/exec/sandbox-progress.js +232 -0
  69. package/dist/commands/exec/sandbox-view.d.ts +19 -0
  70. package/dist/commands/exec/sandbox-view.js +72 -0
  71. package/dist/commands/exec/view.d.ts +3 -2
  72. package/dist/commands/exec/view.js +10 -6
  73. package/dist/commands/runs/facts.d.ts +51 -9
  74. package/dist/commands/runs/facts.js +49 -29
  75. package/dist/commands/runs/list/command.d.ts +80 -4
  76. package/dist/commands/runs/list/command.js +11 -10
  77. package/dist/commands/runs/list/metadata.js +1 -1
  78. package/dist/commands/runs/list/outcomes.d.ts +40 -2
  79. package/dist/commands/runs/logs/command.d.ts +103 -8
  80. package/dist/commands/runs/logs/command.js +139 -24
  81. package/dist/commands/runs/logs/metadata.d.ts +4 -0
  82. package/dist/commands/runs/logs/metadata.js +14 -7
  83. package/dist/commands/runs/logs/outcomes.d.ts +49 -2
  84. package/dist/commands/runs/logs/outcomes.js +110 -6
  85. package/dist/commands/runs/past-run.d.ts +77 -6
  86. package/dist/commands/runs/past-run.js +133 -4
  87. package/dist/commands/runs/show/command.d.ts +568 -10
  88. package/dist/commands/runs/show/command.js +634 -119
  89. package/dist/commands/runs/show/metadata.d.ts +17 -0
  90. package/dist/commands/runs/show/metadata.js +48 -7
  91. package/dist/commands/runs/show/outcomes.d.ts +276 -5
  92. package/dist/commands/runs/show/outcomes.js +484 -96
  93. package/dist/commands/snapshots/build/command.d.ts +109 -18
  94. package/dist/commands/snapshots/build/command.js +72 -36
  95. package/dist/commands/snapshots/build/metadata.d.ts +4 -0
  96. package/dist/commands/snapshots/build/metadata.js +5 -1
  97. package/dist/commands/snapshots/build/outcomes.d.ts +53 -8
  98. package/dist/commands/snapshots/build/outcomes.js +26 -3
  99. package/dist/commands/snapshots/list/command.d.ts +72 -7
  100. package/dist/commands/snapshots/list/command.js +57 -24
  101. package/dist/commands/snapshots/list/metadata.d.ts +4 -0
  102. package/dist/commands/snapshots/list/metadata.js +4 -0
  103. package/dist/commands/snapshots/list/outcomes.d.ts +31 -0
  104. package/dist/commands/snapshots/list/outcomes.js +25 -2
  105. package/dist/commands/suites/list/command.d.ts +129 -0
  106. package/dist/commands/suites/list/command.js +162 -0
  107. package/dist/commands/suites/list/metadata.d.ts +11 -0
  108. package/dist/commands/suites/list/metadata.js +15 -0
  109. package/dist/commands/suites/list/outcomes.d.ts +91 -0
  110. package/dist/commands/suites/list/outcomes.js +122 -0
  111. package/dist/commands/suites/metadata.js +8 -0
  112. package/dist/commands/test/command.d.ts +1389 -0
  113. package/dist/commands/test/command.js +583 -0
  114. package/dist/commands/test/metadata.js +8 -0
  115. package/dist/commands/test/outcomes.d.ts +765 -0
  116. package/dist/commands/test/outcomes.js +140 -0
  117. package/dist/commands/test/plan.d.ts +92 -0
  118. package/dist/commands/test/plan.js +128 -0
  119. package/dist/commands/test/test-words.d.ts +12 -0
  120. package/dist/commands/test/test-words.js +42 -0
  121. package/dist/config/check-resources.d.ts +14 -0
  122. package/dist/config/check-resources.js +98 -0
  123. package/dist/config/check-runner.d.ts +13 -0
  124. package/dist/config/check-runner.js +54 -0
  125. package/dist/config/check-suites.d.ts +14 -0
  126. package/dist/config/check-suites.js +99 -0
  127. package/dist/config/gateways.d.ts +24 -0
  128. package/dist/config/index.d.ts +6 -3
  129. package/dist/config/index.js +3 -1
  130. package/dist/config/live/file-lists-file-gateway.d.ts +4 -0
  131. package/dist/config/live/file-lists-file-gateway.js +27 -0
  132. package/dist/config/load.d.ts +11 -10
  133. package/dist/config/load.js +35 -103
  134. package/dist/config/recipe-run.d.ts +8 -1
  135. package/dist/config/recipe-run.js +2 -1
  136. package/dist/config/resolve.d.ts +3 -2
  137. package/dist/config/resolve.js +6 -3
  138. package/dist/config/resolver.d.ts +20 -6
  139. package/dist/config/resolver.js +11 -8
  140. package/dist/config/runner.d.ts +24 -0
  141. package/dist/config/runner.js +4 -0
  142. package/dist/config/schema.d.ts +26 -18
  143. package/dist/config/schema.js +41 -9
  144. package/dist/config/settings-file.d.ts +9 -3
  145. package/dist/config/settings-file.js +41 -4
  146. package/dist/config/suite.d.ts +39 -0
  147. package/dist/config/suite.js +5 -0
  148. package/dist/config-file/define.d.ts +49 -18
  149. package/dist/config-file/define.js +9 -8
  150. package/dist/config-file/runner.d.ts +12 -0
  151. package/dist/config-file/runner.js +9 -0
  152. package/dist/context.d.ts +12 -8
  153. package/dist/context.js +9 -3
  154. package/dist/core/across-sandboxes.d.ts +43 -0
  155. package/dist/core/across-sandboxes.js +319 -0
  156. package/dist/core/before-run.d.ts +5 -3
  157. package/dist/core/before-run.js +12 -1
  158. package/dist/core/events.d.ts +62 -6
  159. package/dist/core/events.js +14 -0
  160. package/dist/core/index.d.ts +4 -2
  161. package/dist/core/index.js +3 -1
  162. package/dist/core/payload.d.ts +2 -1
  163. package/dist/core/payload.js +2 -1
  164. package/dist/core/presentations.js +1 -1
  165. package/dist/core/resource.d.ts +1 -1
  166. package/dist/core/resources.d.ts +56 -6
  167. package/dist/core/resources.js +81 -5
  168. package/dist/core/run-state.js +9 -0
  169. package/dist/core/run.d.ts +77 -15
  170. package/dist/core/run.js +150 -86
  171. package/dist/core/sandbox-end.d.ts +64 -0
  172. package/dist/core/sandbox-end.js +128 -0
  173. package/dist/core/timeline.d.ts +4 -4
  174. package/dist/core/timeline.js +3 -3
  175. package/dist/credential/live/vercel-cli-gateway.d.ts +7 -0
  176. package/dist/credential/live/vercel-cli-gateway.js +14 -1
  177. package/dist/extensions/github/context.d.ts +1 -1
  178. package/dist/extensions/github/definition.d.ts +11 -9
  179. package/dist/extensions/github/definition.js +8 -6
  180. package/dist/extensions/github/extension.d.ts +3 -3
  181. package/dist/extensions/github/fixture-repo.d.ts +21 -2
  182. package/dist/extensions/github/fixture-repo.js +31 -2
  183. package/dist/extensions/github/index.d.ts +2 -2
  184. package/dist/extensions/github/index.js +2 -2
  185. package/dist/extensions/github/lifecycle.d.ts +16 -6
  186. package/dist/extensions/github/lifecycle.js +42 -25
  187. package/dist/extensions/github/options.d.ts +17 -11
  188. package/dist/extensions/github/options.js +14 -13
  189. package/dist/extensions/github/refusals.d.ts +23 -6
  190. package/dist/extensions/github/refusals.js +34 -12
  191. package/dist/extensions/github/resource.d.ts +21 -12
  192. package/dist/extensions/github/resource.js +16 -8
  193. package/dist/extensions/github/run/payload.d.ts +6 -6
  194. package/dist/extensions/github/run/payload.js +3 -5
  195. package/dist/extensions/github/split.d.ts +10 -0
  196. package/dist/extensions/github/split.js +12 -0
  197. package/dist/extensions/playwright/driver.js +6 -26
  198. package/dist/extensions/playwright/extension.js +1 -1
  199. package/dist/extensions/testserver/commands/pool/create/command.js +8 -8
  200. package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
  201. package/dist/extensions/testserver/definition.d.ts +4 -4
  202. package/dist/extensions/testserver/definition.js +41 -31
  203. package/dist/extensions/testserver/extension.d.ts +4 -5
  204. package/dist/extensions/testserver/extension.js +14 -41
  205. package/dist/extensions/testserver/index.d.ts +1 -1
  206. package/dist/extensions/testserver/index.js +1 -1
  207. package/dist/extensions/testserver/lifecycle.d.ts +10 -2
  208. package/dist/extensions/testserver/lifecycle.js +29 -6
  209. package/dist/extensions/testserver/options/rules.d.ts +5 -5
  210. package/dist/extensions/testserver/options/rules.js +10 -8
  211. package/dist/extensions/testserver/options/sandboxes.d.ts +4 -2
  212. package/dist/extensions/testserver/options/sandboxes.js +8 -3
  213. package/dist/extensions/testserver/pool/gateways.d.ts +29 -4
  214. package/dist/extensions/testserver/pool/index.d.ts +2 -2
  215. package/dist/extensions/testserver/pool/index.js +1 -1
  216. package/dist/extensions/testserver/pool/lease.d.ts +10 -0
  217. package/dist/extensions/testserver/pool/lease.js +21 -0
  218. package/dist/extensions/testserver/pool/live/pool-store-gateway.js +38 -3
  219. package/dist/extensions/testserver/refusals.d.ts +12 -0
  220. package/dist/extensions/testserver/refusals.js +18 -0
  221. package/dist/extensions/testserver/release.d.ts +16 -0
  222. package/dist/extensions/testserver/release.js +56 -4
  223. package/dist/extensions/testserver/resource.d.ts +4 -4
  224. package/dist/extensions/testserver/resource.js +1 -1
  225. package/dist/extensions/testserver/split.d.ts +9 -0
  226. package/dist/extensions/testserver/split.js +22 -0
  227. package/dist/extensions/testserver/vitest/fixtures.d.ts +5 -5
  228. package/dist/extensions/testserver/vitest/fixtures.js +9 -38
  229. package/dist/extensions/vitest/driver.d.ts +7 -0
  230. package/dist/extensions/vitest/driver.js +33 -37
  231. package/dist/extensions/vitest/extension.js +1 -1
  232. package/dist/extensions/vitest/plan/plan-over.d.ts +8 -1
  233. package/dist/extensions/vitest/plan/plan-over.js +16 -2
  234. package/dist/extensions.d.ts +17 -16
  235. package/dist/extensions.js +5 -4
  236. package/dist/forward-sigterm.js +1 -1
  237. package/dist/launcher-resolvers/local-services.d.ts +1 -1
  238. package/dist/live-app.js +4 -3
  239. package/dist/local-services.js +1 -1
  240. package/dist/planning/driver-file-lists.d.ts +61 -0
  241. package/dist/planning/driver-file-lists.js +66 -0
  242. package/dist/{commands/exec → planning}/driver-refusals.d.ts +11 -10
  243. package/dist/{commands/exec → planning}/driver-refusals.js +18 -14
  244. package/dist/planning/file-lists-file.d.ts +58 -0
  245. package/dist/planning/file-lists-file.js +105 -0
  246. package/dist/planning/file-lists.d.ts +28 -0
  247. package/dist/planning/file-lists.js +52 -0
  248. package/dist/{commands/exec → planning}/final-results.d.ts +1 -1
  249. package/dist/{commands/exec → planning}/final-results.js +6 -6
  250. package/dist/planning/plan-only.d.ts +81 -0
  251. package/dist/planning/plan-only.js +83 -0
  252. package/dist/{commands/exec → planning}/redaction.d.ts +2 -2
  253. package/dist/{commands/exec → planning}/redaction.js +5 -4
  254. package/dist/{commands/exec → planning}/resource-flags.d.ts +5 -12
  255. package/dist/{commands/exec → planning}/resource-flags.js +6 -16
  256. package/dist/planning/run-kind-flags.d.ts +20 -0
  257. package/dist/planning/run-kind-flags.js +48 -0
  258. package/dist/planning/run-plan.d.ts +30 -0
  259. package/dist/planning/run-plan.js +4 -0
  260. package/dist/planning/sandbox-placeholders.d.ts +22 -0
  261. package/dist/planning/sandbox-placeholders.js +60 -0
  262. package/dist/planning/suite-not-found.d.ts +37 -0
  263. package/dist/planning/suite-not-found.js +36 -0
  264. package/dist/planning/suites.d.ts +43 -0
  265. package/dist/planning/suites.js +89 -0
  266. package/dist/{commands/exec → planning}/test-plan.d.ts +8 -3
  267. package/dist/{commands/exec → planning}/test-plan.js +32 -4
  268. package/dist/playwright/reporter.d.ts +20 -8
  269. package/dist/playwright/reporter.js +195 -15
  270. package/dist/presentation.d.ts +10 -6
  271. package/dist/presentation.js +13 -15
  272. package/dist/run-directory/gateways.d.ts +60 -4
  273. package/dist/run-directory/index.d.ts +4 -4
  274. package/dist/run-directory/index.js +2 -1
  275. package/dist/run-directory/live/run-directory-gateway.js +92 -16
  276. package/dist/run-directory/plan.d.ts +35 -2
  277. package/dist/run-directory/plan.js +44 -7
  278. package/dist/run-directory/reader.d.ts +26 -5
  279. package/dist/run-directory/reader.js +24 -1
  280. package/dist/run-directory/recording.d.ts +75 -49
  281. package/dist/run-directory/recording.js +214 -28
  282. package/dist/run-directory/run-directory.d.ts +22 -1
  283. package/dist/run-directory/run-directory.js +24 -0
  284. package/dist/run-directory/run-record.d.ts +144 -21
  285. package/dist/run-directory/run-record.js +118 -19
  286. package/dist/run-directory/timeline-facts.js +4 -4
  287. package/dist/runner/build-snapshots.d.ts +7 -7
  288. package/dist/runner/build-snapshots.js +12 -16
  289. package/dist/runner/events.d.ts +29 -8
  290. package/dist/runner/gateways.d.ts +49 -6
  291. package/dist/runner/index.d.ts +6 -4
  292. package/dist/runner/index.js +3 -2
  293. package/dist/runner/live/sandbox-gateway.js +161 -31
  294. package/dist/runner/network-policy.d.ts +55 -0
  295. package/dist/runner/network-policy.js +46 -0
  296. package/dist/runner/policy-writes.d.ts +40 -0
  297. package/dist/runner/policy-writes.js +124 -0
  298. package/dist/runner/prepare.d.ts +6 -7
  299. package/dist/runner/ready.d.ts +39 -10
  300. package/dist/runner/ready.js +59 -47
  301. package/dist/runner/recipe-check.d.ts +6 -0
  302. package/dist/runner/recipe-check.js +29 -0
  303. package/dist/runner/recipe-secrets.d.ts +67 -0
  304. package/dist/runner/recipe-secrets.js +230 -0
  305. package/dist/runner/recipe.d.ts +115 -26
  306. package/dist/runner/recipe.js +147 -154
  307. package/dist/runner/sandboxed-command.d.ts +22 -8
  308. package/dist/runner/sandboxed-command.js +33 -10
  309. package/dist/runner/scope.d.ts +107 -21
  310. package/dist/runner/scope.js +274 -54
  311. package/dist/runner/secrets.d.ts +42 -31
  312. package/dist/runner/secrets.js +62 -40
  313. package/dist/runner/session.d.ts +59 -26
  314. package/dist/runner/session.js +82 -41
  315. package/dist/runner/snapshot-build.d.ts +7 -4
  316. package/dist/runner/snapshot-build.js +48 -28
  317. package/dist/runner/snapshot-choice.d.ts +37 -0
  318. package/dist/runner/snapshot-choice.js +38 -0
  319. package/dist/runner/snapshot-key.d.ts +16 -14
  320. package/dist/runner/snapshot-key.js +24 -18
  321. package/dist/runner/steps.d.ts +13 -5
  322. package/dist/runner/steps.js +34 -4
  323. package/dist/runner/time-limit.d.ts +10 -0
  324. package/dist/runner/time-limit.js +43 -0
  325. package/dist/sdk/extension/commands.d.ts +1 -7
  326. package/dist/sdk/extension/driver.d.ts +39 -46
  327. package/dist/sdk/extension/driver.js +6 -6
  328. package/dist/sdk/extension/index.d.ts +3 -3
  329. package/dist/sdk/extension/index.js +3 -4
  330. package/dist/sdk/extension/lifecycle.d.ts +52 -9
  331. package/dist/sdk/extension/lifecycle.js +1 -1
  332. package/dist/sdk/extension/resource-definition.d.ts +13 -10
  333. package/dist/sdk/extension/resource-definition.js +7 -2
  334. package/dist/sdk/extension/resource.d.ts +2 -2
  335. package/dist/sdk/extension/secret-source.d.ts +58 -0
  336. package/dist/sdk/extension/secret-source.js +78 -0
  337. package/dist/sdk/index.d.ts +2 -2
  338. package/dist/sdk/index.js +1 -1
  339. package/dist/sdk/run/launcher.d.ts +1 -1
  340. package/dist/sdk/run/launcher.js +1 -1
  341. package/dist/sdk/run/payload.d.ts +16 -1
  342. package/dist/sdk/run/payload.js +17 -2
  343. package/dist/sdk/run/redact.js +2 -2
  344. package/dist/sdk/run/test-events.d.ts +23 -6
  345. package/dist/sdk/run/test-events.js +6 -4
  346. package/dist/sdk/run/test-result-writer.d.ts +8 -3
  347. package/dist/sdk/run/test-result-writer.js +22 -2
  348. package/dist/{commands/exec → shared}/cleanup.d.ts +3 -3
  349. package/dist/{commands/exec → shared}/cleanup.js +11 -6
  350. package/dist/shared/job-summary.d.ts +19 -0
  351. package/dist/{commands/exec → shared}/job-summary.js +17 -0
  352. package/dist/shared/sandbox-table.d.ts +48 -0
  353. package/dist/shared/sandbox-table.js +109 -0
  354. package/dist/{commands/exec → shared}/snapshot-text.d.ts +1 -1
  355. package/dist/{commands/exec → shared}/tests-summary.d.ts +22 -6
  356. package/dist/{commands/exec → shared}/tests-summary.js +74 -31
  357. package/dist/{commands/exec → shared}/text.d.ts +7 -2
  358. package/dist/{commands/exec → shared}/text.js +9 -1
  359. package/dist/{commands/exec → shared}/waterfall.d.ts +8 -6
  360. package/dist/{commands/exec → shared}/waterfall.js +71 -24
  361. package/dist/shared/worker-chart.d.ts +172 -0
  362. package/dist/shared/worker-chart.js +623 -0
  363. package/dist/vitest/config.d.ts +35 -11
  364. package/dist/vitest/config.js +47 -14
  365. package/dist/vitest/index.d.ts +1 -1
  366. package/dist/vitest/index.js +3 -3
  367. package/dist/vitest/sequencer.d.ts +23 -0
  368. package/dist/vitest/sequencer.js +73 -0
  369. package/dist/vitest/setup.d.ts +1 -0
  370. package/dist/vitest/setup.js +34 -0
  371. package/dist/vitest/test-events.d.ts +32 -6
  372. package/dist/vitest/test-events.js +25 -5
  373. package/dist/vitest/test-results.d.ts +8 -3
  374. package/dist/vitest/test-results.js +6 -0
  375. package/package.json +7 -2
  376. package/skills/overview.md +21 -17
  377. package/skills/plan-runs.md +67 -0
  378. package/skills/read-run-output.md +51 -19
  379. package/dist/chunks/chunk-E3QU74NX.js +0 -49
  380. package/dist/chunks/chunk-HP54VHGY.js +0 -201
  381. package/dist/chunks/chunk-NMVODY3P.js +0 -19
  382. package/dist/chunks/chunk-TVMEKVOW.js +0 -607
  383. package/dist/commands/exec/define-run-command.d.ts +0 -671
  384. package/dist/commands/exec/define-run-command.js +0 -91
  385. package/dist/commands/exec/job-summary.d.ts +0 -10
  386. package/dist/commands/exec/worker-chart.d.ts +0 -87
  387. package/dist/commands/exec/worker-chart.js +0 -343
  388. package/dist/commands/playwright/command.d.ts +0 -661
  389. package/dist/commands/playwright/command.js +0 -31
  390. package/dist/commands/playwright/metadata.js +0 -8
  391. package/dist/commands/vitest/command.d.ts +0 -662
  392. package/dist/commands/vitest/command.js +0 -31
  393. package/dist/commands/vitest/metadata.js +0 -8
  394. package/dist/sdk/extension/ci.d.ts +0 -2
  395. package/dist/sdk/extension/ci.js +0 -6
  396. package/dist/chunks/{chunk-YM6TZV4L.js → chunk-VL7WFTVQ.js} +52 -52
  397. package/dist/commands/{playwright → suites}/metadata.d.ts +1 -1
  398. package/dist/commands/{vitest → test}/metadata.d.ts +1 -1
  399. /package/dist/{commands → shared}/dashboard.d.ts +0 -0
  400. /package/dist/{commands → shared}/dashboard.js +0 -0
  401. /package/dist/{commands/exec → shared}/snapshot-text.js +0 -0
@@ -1,8 +1,22 @@
1
1
  import type { CommandHelp } from "@vercel/clinkr";
2
- import type { DriverHelp } from "../../sdk/extension/index.ts";
3
- import { type RunExamplesOf } from "./resource-flags.ts";
2
+ /** One run command's words for its leaf help. */
3
+ export interface RunHelpWording {
4
+ /** The usage after the flags every run takes, such as `-- <command...>`. */
5
+ readonly usage: string;
6
+ /** What the command's positional arguments are and where they go. */
7
+ readonly args: string;
8
+ /** Clause that finishes `--verbose`'s description. */
9
+ readonly verbose: string;
10
+ /** The command's own examples. */
11
+ readonly examples: readonly {
12
+ readonly argv: string;
13
+ readonly description: string;
14
+ }[];
15
+ }
4
16
  /** The flags every run takes, as a usage line names them, before the command's own arguments. */
5
17
  export declare const RUN_USAGE_FLAGS: string;
18
+ /** The flags `storm exec` takes, adding `[--runner <KIND>]` for selecting the launch machine runner. */
19
+ export declare const EXEC_USAGE_FLAGS: string;
6
20
  /**
7
21
  * The field descriptions of the flags every run takes: the resources' flags, then the run's own, `--verbose`'s ending
8
22
  * in `verbose`, the driver's words for it.
@@ -12,9 +26,6 @@ export declare function runFields(verbose: string): {
12
26
  valueLabel: string;
13
27
  description: string;
14
28
  };
15
- unsandboxed: {
16
- description: string;
17
- };
18
29
  keepSandbox: {
19
30
  valueLabel: string;
20
31
  description: string;
@@ -25,6 +36,9 @@ export declare function runFields(verbose: string): {
25
36
  verbose: {
26
37
  description: string;
27
38
  };
39
+ planOnly: {
40
+ description: string;
41
+ };
28
42
  scope: {
29
43
  valueLabel: string;
30
44
  description: string;
@@ -35,8 +49,28 @@ export declare function runFields(verbose: string): {
35
49
  };
36
50
  };
37
51
  /**
38
- * A run command's leaf help: the usage of the flags every run takes, then the command's own; every run's field
52
+ * A run command's leaf help: the usage of the flags the command takes, then the command's own; every run's field
39
53
  * descriptions, `--verbose`'s ending in the command's words for it, and the command's for its arguments, in request
40
- * field `field`; and the command's own examples, then the run examples the extensions bring to it (`of`).
54
+ * field `field`; and the command's own examples, then the run examples the extensions bring to it when
55
+ * `includeResourceExamples` is true.
56
+ */
57
+ export declare function runHelp(words: RunHelpWording, field: "command" | "args", options?: {
58
+ readonly includeResourceExamples?: boolean;
59
+ readonly runnerFlag?: boolean;
60
+ }): CommandHelp;
61
+ /**
62
+ * The field description of `--sandboxes` on `storm test`, for a driver with file list support (`Driver.fileLists`).
63
+ * Names no test runner.
41
64
  */
42
- export declare function runHelp(words: DriverHelp, field: "command" | "args", of: RunExamplesOf): CommandHelp;
65
+ export declare const DRIVER_SANDBOXES_HELP: {
66
+ valueLabel: string;
67
+ description: string;
68
+ };
69
+ /**
70
+ * The field description of `--file-lists` on `storm test`, for a driver with file list support (`Driver.fileLists`).
71
+ * Names no test runner.
72
+ */
73
+ export declare const DRIVER_FILE_LISTS_HELP: {
74
+ valueLabel: string;
75
+ description: string;
76
+ };
@@ -1,40 +1,41 @@
1
- // The help every run command shares, `exec`'s, `vitest`'s, and `playwright`'s: the usage of the flags every run takes,
2
- // and their field descriptions: the run's own, and each resource option's flag, from the registry's resource
3
- // definitions (`resource-flags.ts`). `runHelp` makes each one's leaf help from it and the command's own words: `exec`'s
4
- // (`exec-words.ts`), or its driver's for a driver's command (`defineRunCommand`, `define-run-command.ts`). It names no
5
- // test runner: what `--verbose` does under a driver's program is the driver's to say (`DriverHelp.verbose`).
6
- import { RESOURCE_FLAG_HELP, RESOURCE_USAGE_FLAGS, resourceRunExamples } from "./resource-flags.js";
1
+ // The help every run command shares, `test`'s and `exec`'s: the usage of the flags every run takes, and their field
2
+ // descriptions: the run's own, and each resource option's flag, from the registry's resource definitions
3
+ // (`resource-flags.ts`). `runHelp` makes each one's leaf help from it and the command's own words (`test-words.ts`,
4
+ // `exec-words.ts`). It names no test runner.
5
+ import { RESOURCE_FLAG_HELP, RESOURCE_USAGE_FLAGS, resourceRunExamples } from "../../planning/resource-flags.js";
7
6
  /** The flags every run takes, as a usage line names them, before the command's own arguments. */
8
- export const RUN_USAGE_FLAGS = `${RESOURCE_USAGE_FLAGS} [--credential <SOURCE>] [--scope <TEAM> --project <PROJECT>] [--unsandboxed | [--show-output] [--keep-sandbox <DURATION>]] [--verbose]`;
7
+ export const RUN_USAGE_FLAGS = `${RESOURCE_USAGE_FLAGS} [--credential <SOURCE>] [--scope <TEAM> --project <PROJECT>] [--show-output] [--keep-sandbox <DURATION>] [--verbose] [--plan-only]`;
8
+ /** The flags `storm exec` takes, adding `[--runner <KIND>]` for selecting the launch machine runner. */
9
+ export const EXEC_USAGE_FLAGS = `${RESOURCE_USAGE_FLAGS} [--credential <SOURCE>] [--scope <TEAM> --project <PROJECT>] [--runner <KIND> | [--show-output] [--keep-sandbox <DURATION>]] [--verbose] [--plan-only]`;
9
10
  /**
10
11
  * The field descriptions of the run's own flags. `--verbose`'s ends in `verbose`, the driver's words for what
11
- * `verbose` in the run payload does under its program (`DriverHelp.verbose`).
12
+ * `verbose` in the run payload does under its program.
12
13
  */
13
14
  const ownRunFields = (verbose) => ({
14
15
  credential: {
15
16
  valueLabel: "SOURCE",
16
- 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.",
17
- },
18
- unsandboxed: {
19
- 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.",
17
+ 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. Fits the launch machine runner only: the Vercel Sandbox runner 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. This credential is the Vercel OIDC token storm uses for its own calls, not a sandbox credential that runner.credentials declares: the word has both uses until a rename. No config key.",
20
18
  },
21
19
  keepSandbox: {
22
20
  valueLabel: "DURATION",
23
- 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). 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.",
21
+ description: "Keep the runner sandbox running this long 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 keeps its runner sandbox only when this flag or keepSandbox in vercelSandbox({ … }) asks; by default it stops and deletes it, after a failure too. A kept runner sandbox holds the checkout, the installed packages, and everything the command wrote, including its test output; storm removes nothing from it, and it holds no credential, the recipe's or a resource's, since storm revokes every sandbox credential before it keeps the sandbox. Anyone who can update the Vercel project can connect to it. Refused when the runner recipe sets unsafeSecretEnvVars, because a run that passes secrets into the runner sandbox's environment never keeps its runner sandbox. storm gives the kept runner sandbox no network access before it releases the run's resources: once the run releases its resources, another run can take them. Before it keeps the sandbox, the run ends every process it started there. 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 vercelSandbox({ … }), else 0; a run across runner sandboxes keeps each runner sandbox only with --keep-sandbox and ignores keepSandbox in vercelSandbox({ … }). Fits the Vercel Sandbox runner only.",
24
22
  },
25
23
  showOutput: {
26
- 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.",
24
+ description: "With the Vercel Sandbox runner 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. Fits the Vercel Sandbox runner only. No config key.",
27
25
  },
28
26
  verbose: {
29
27
  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, ${verbose}. No config key.`,
30
28
  },
29
+ planOnly: {
30
+ description: "Plan the run and print the planned run, then exit 0, with nothing started: storm loads storm.config.ts, does the local checks, and runs the plan step, which may list the test files on this machine, and mints nothing, acquires no resource, starts no sandbox, and opens no run directory. It prints the plan line, one line for each runner sandbox with the number of its test files (or its command, for storm exec), and the vCPUs of the runner sandbox; under --json, the planned result holds the test files, the plan with the number of runner sandboxes, where it came from, and its max, runner.sandboxes, each runner sandbox's command and file list, each resource option with its value and where it came from, and the vCPUs. With --sandboxes or --file-lists it shows the plan of those, and a refusal a run gets before it mints, it gets too. It calls no resource's own checks before the run, and needs no credential. No config key.",
31
+ },
31
32
  scope: {
32
33
  valueLabel: "TEAM",
33
- 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.",
34
+ description: "The control plane team: the Vercel team whose project the credential is minted for and the Vercel Sandbox runner's sandboxes run in. Required, from this flag or scope in storm.config.ts, unless a launch machine run has no resource that takes a credential or takes --credential github-actions.",
34
35
  },
35
36
  project: {
36
37
  valueLabel: "PROJECT",
37
- 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.",
38
+ 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 a launch machine run has no resource that takes a credential or takes --credential github-actions.",
38
39
  },
39
40
  });
40
41
  /**
@@ -45,14 +46,32 @@ export function runFields(verbose) {
45
46
  return { ...RESOURCE_FLAG_HELP, ...ownRunFields(verbose) };
46
47
  }
47
48
  /**
48
- * A run command's leaf help: the usage of the flags every run takes, then the command's own; every run's field
49
+ * A run command's leaf help: the usage of the flags the command takes, then the command's own; every run's field
49
50
  * descriptions, `--verbose`'s ending in the command's words for it, and the command's for its arguments, in request
50
- * field `field`; and the command's own examples, then the run examples the extensions bring to it (`of`).
51
+ * field `field`; and the command's own examples, then the run examples the extensions bring to it when
52
+ * `includeResourceExamples` is true.
51
53
  */
52
- export function runHelp(words, field, of) {
54
+ export function runHelp(words, field, options = {}) {
55
+ const usageFlags = options.runnerFlag === true ? EXEC_USAGE_FLAGS : RUN_USAGE_FLAGS;
53
56
  return {
54
- usages: [`${RUN_USAGE_FLAGS} ${words.usage}`],
57
+ usages: [`${usageFlags} ${words.usage}`],
55
58
  fields: { ...runFields(words.verbose), [field]: { valueLabel: field, description: words.args } },
56
- examples: [...words.examples, ...resourceRunExamples(of)],
59
+ examples: [...words.examples, ...(options.includeResourceExamples === true ? resourceRunExamples() : [])],
57
60
  };
58
61
  }
62
+ /**
63
+ * The field description of `--sandboxes` on `storm test`, for a driver with file list support (`Driver.fileLists`).
64
+ * Names no test runner.
65
+ */
66
+ export const DRIVER_SANDBOXES_HELP = {
67
+ valueLabel: "N",
68
+ description: "Run in N runner sandboxes at once, a run across runner sandboxes, with a driver that has file list support, else driver_sandboxes_refused: storm lists the run's test files on this machine, whether or not storm.config.ts sets testPlan, sorts them, deals them in turn into N file lists, the first file to runner sandbox 0's list, the second to runner sandbox 1's, and so on, and runs each file list in its own runner sandbox, all started from one runner snapshot, with the run's arguments unchanged and each runner sandbox's file list in STORM_RUN. With fewer test files than N, the run has one runner sandbox for each test file, and the plan line says so. N is a whole number from 1 to runner.sandboxes.max in storm.config.ts, and a config file without runner.sandboxes takes no --sandboxes. Each runner sandbox's command output goes only to its command.log in the run directory, under sandboxes/<index>/, and the run prints one status line for each runner sandbox's step, then each runner sandbox's waterfall, a table of the runner sandboxes, and a warning, file_list_mismatch, for each runner sandbox that reported nothing for a test file of its list or reported a test file not in its list; storm exits 0 when every runner sandbox passed, else 1, warning or not. The run keeps each runner sandbox only with --keep-sandbox. To give your own lists, use --file-lists. Fits the Vercel Sandbox runner only. Not with --show-output. Config key: runner.sandboxes.default, the number of runner sandboxes of a run with neither --sandboxes nor --file-lists, a whole number or a function of the test plan, lowered to runner.sandboxes.max when it is above it; with it, every such run is a run across runner sandboxes, also with one runner sandbox.",
69
+ };
70
+ /**
71
+ * The field description of `--file-lists` on `storm test`, for a driver with file list support (`Driver.fileLists`).
72
+ * Names no test runner.
73
+ */
74
+ export const DRIVER_FILE_LISTS_HELP = {
75
+ valueLabel: "PATH",
76
+ description: "Run with your own file lists, a run across runner sandboxes, with a driver that has file list support, else driver_sandboxes_refused: PATH is a JSON file (or - to read from stdin) that holds an array with one array of test file paths for each runner sandbox, in order of runner sandbox index, such as [[\"test/a.test.ts\", \"test/b.test.ts\"], [\"test/c.test.ts\"]], each path relative to the project, as the planned result's testFiles under --plan-only --json names it. The number of lists is the number of runner sandboxes, at most runner.sandboxes.max in storm.config.ts; with --sandboxes too, the two numbers must agree. storm lists the run's test files on this machine with the run's arguments, so a file filter among them limits which paths a list can hold, passes each runner sandbox's assigned file list in STORM_RUN while keeping the run's arguments unchanged, and refuses before it mints a file it can't read or that isn't that shape (file_lists_unreadable), an empty list, a test file in two lists, or a number of lists that differs from --sandboxes (invalid_file_lists), a path the listing doesn't have (file_lists_unlisted), and more lists than the max (sandboxes_over_max). A test file in no list is left out of the run, and the plan line says how many it runs: Running 12 of 57 test files in 2 runner sandboxes (--file-lists, max 4). The rest is as with --sandboxes. Fits the Vercel Sandbox runner only. Not with --show-output. It overrides runner.sandboxes.default. No config key.",
77
+ };
@@ -0,0 +1,20 @@
1
+ import type { CommandResult, ExecutionContext } from "@vercel/clinkr";
2
+ import type { StormApp } from "../../context.ts";
3
+ import type { PlannedFacts } from "../../planning/plan-only.ts";
4
+ import type { RunTestPlan } from "../../sdk/extension/index.ts";
5
+ import { type PlannedRun, type RunCommandRequest, type RunCommandSpec } from "./run-command.ts";
6
+ import { type AcrossSandboxesSpec } from "./across-sandboxes-run.ts";
7
+ /**
8
+ * How one command ends its planned run: its name and its words, and its outcome for each way the run can go: `ran`,
9
+ * `sandboxes_ran`, and under `--plan-only`, `planned`.
10
+ */
11
+ export interface PlannedRunSpec<TTestPlan extends RunTestPlan, TRan, TSandboxesRan, TPlanned> extends RunCommandSpec<TTestPlan, TRan>, AcrossSandboxesSpec<TSandboxesRan> {
12
+ /** The `planned` outcome, for a run with `--plan-only`. */
13
+ planned(facts: PlannedFacts): TPlanned;
14
+ }
15
+ /**
16
+ * Does what `request` asks of planned run `plan`: with `--plan-only`, answers the planned run and starts nothing
17
+ * (`plannedRun`); else runs it, as a run across runner sandboxes when its plan holds them
18
+ * (`runPlannedAcrossSandboxes`), and else as a run that is not (`runPlannedCommand`).
19
+ */
20
+ export declare function runPlanned<TTestPlan extends RunTestPlan, TRan extends CommandResult, TSandboxesRan, TPlanned>(context: ExecutionContext<StormApp>, request: RunCommandRequest, spec: PlannedRunSpec<TTestPlan, TRan, TSandboxesRan, TPlanned>, plan: PlannedRun<TTestPlan>): Promise<TPlanned | TRan | TSandboxesRan | import("@vercel/clinkr").ClinkrError<"canceled"> | import("@vercel/clinkr").CommandError<"credential_unused"> | import("@vercel/clinkr").CommandError<"invalid_config"> | import("@vercel/clinkr").CommandError<"mint_failed"> | import("@vercel/clinkr").CommandError<"missing_target"> | import("@vercel/clinkr").CommandError<"no_base_ref"> | import("@vercel/clinkr").CommandError<"resource_needs_runner_sandbox"> | import("@vercel/clinkr").CommandError<"resource_refused"> | import("@vercel/clinkr").CommandError<"resource_refused_before_run"> | import("@vercel/clinkr").CommandError<"runner_failed"> | import("@vercel/clinkr").CommandError<"snapshot_gone"> | import("@vercel/clinkr").CommandError<"spawn_failed"> | import("@vercel/clinkr").CommandError<"submodules_refused">>;
@@ -0,0 +1,22 @@
1
+ // What a run command does with its planned run, which `exec`, `vitest` and `playwright` share: the one place that tells
2
+ // `--plan-only`, a run that is not across runner sandboxes, and a run across runner sandboxes apart. A command plans
3
+ // its run first, in the way its request asks (`planCommandRun`, `planAskedSandboxesRun`, or `planDefaultSandboxesRun`),
4
+ // and hands the plan here, so no way of planning has a `--plan-only` branch of its own.
5
+ import { plannedRun } from "./plan-only.js";
6
+ import { runPlannedCommand } from "./run-command.js";
7
+ import { runPlannedAcrossSandboxes, acrossSandboxesWhere } from "./across-sandboxes-run.js";
8
+ /**
9
+ * Does what `request` asks of planned run `plan`: with `--plan-only`, answers the planned run and starts nothing
10
+ * (`plannedRun`); else runs it, as a run across runner sandboxes when its plan holds them
11
+ * (`runPlannedAcrossSandboxes`), and else as a run that is not (`runPlannedCommand`).
12
+ */
13
+ export async function runPlanned(context, request, spec, plan) {
14
+ const { planned, lifecycles } = plan;
15
+ if (request.planOnly)
16
+ return await plannedRun(context.app, planned, lifecycles, (facts) => spec.planned(facts));
17
+ const { sandboxes } = planned;
18
+ if (sandboxes === undefined)
19
+ return await runPlannedCommand(context, request, spec, planned, lifecycles);
20
+ const where = acrossSandboxesWhere(planned.where);
21
+ return await runPlannedAcrossSandboxes(context, request, spec, { ...planned, sandboxes, where }, lifecycles);
22
+ }
@@ -0,0 +1,42 @@
1
+ import { type FileListMismatch } from "../../planning/file-lists.ts";
2
+ import type { SandboxRecord } from "../../run-directory/index.ts";
3
+ import { type Paint } from "../../shared/text.ts";
4
+ /** A runner sandbox's status line: `[+4.9s] runner sandbox 1 <text>`, `elapsedMs` since the run started. */
5
+ export declare function sandboxLine(elapsedMs: number, sandbox: number, text: string): string;
6
+ /** The lines a run across runner sandboxes prints as its runner sandboxes start. */
7
+ export declare function acrossSandboxesHeaderLines(run: {
8
+ readonly version: string;
9
+ readonly commit: string | null;
10
+ readonly argv: readonly string[];
11
+ readonly count: number;
12
+ readonly runDirectory: string;
13
+ }): readonly string[];
14
+ /** Counts of a runner sandbox's tests by final result. */
15
+ export interface SandboxTestTally {
16
+ passed: number;
17
+ failed: number;
18
+ skipped: number;
19
+ }
20
+ /** A runner sandbox's tests' totals as its status and end lines say them. */
21
+ export declare function sandboxTestsText(totals: Readonly<SandboxTestTally> | null | undefined): string | undefined;
22
+ /** One runner sandbox's waterfall at the end of the run. */
23
+ export interface EndedSandboxWaterfall {
24
+ readonly sandbox: number;
25
+ readonly waterfall: readonly string[];
26
+ }
27
+ /** The lines a run across runner sandboxes ends with. */
28
+ export declare function acrossSandboxesEndLines(input: {
29
+ readonly sandboxes: readonly EndedSandboxWaterfall[];
30
+ readonly records: readonly SandboxRecord[];
31
+ readonly tests: readonly string[];
32
+ readonly runId: string | undefined;
33
+ readonly logs: string;
34
+ readonly mismatches?: readonly FileListMismatch[];
35
+ readonly extraMismatchHint?: string;
36
+ readonly paint?: Paint;
37
+ }): string[];
38
+ /**
39
+ * Whether a run across runner sandboxes' end lines say `storm runs show <run id> --failed`: a runner sandbox is not
40
+ * `passed`.
41
+ */
42
+ export declare function showsFailed(records: readonly Pick<SandboxRecord, "state">[], runId: string | undefined): boolean;
@@ -0,0 +1,59 @@
1
+ // What a run across runner sandboxes prints besides what it shows while it runs (`sandbox-progress.ts`): the header
2
+ // once its runner sandboxes start, and its end lines once every runner sandbox ended.
3
+ import { fileListMismatchText } from "../../planning/file-lists.js";
4
+ import { sandboxTableLines, sandboxesText, sandboxTotalsLine } from "../../shared/sandbox-table.js";
5
+ import { paint as paintFor, seconds } from "../../shared/text.js";
6
+ import { versionText } from "../../version.js";
7
+ /** A runner sandbox's status line: `[+4.9s] runner sandbox 1 <text>`, `elapsedMs` since the run started. */
8
+ export function sandboxLine(elapsedMs, sandbox, text) {
9
+ return `${`[+${seconds(elapsedMs)}]`.padEnd(8)} runner sandbox ${sandbox} ${text}`;
10
+ }
11
+ function shellWord(argument) {
12
+ return /^[\w@%+=:,./{}-]+$/.test(argument) ? argument : `'${argument.replaceAll("'", `'\\''`)}'`;
13
+ }
14
+ /** The lines a run across runner sandboxes prints as its runner sandboxes start. */
15
+ export function acrossSandboxesHeaderLines(run) {
16
+ return [
17
+ `storm ${versionText(run.version, run.commit)} · ${sandboxesText(run.count)} · ${run.argv.map(shellWord).join(" ")}`,
18
+ `run directory ${run.runDirectory}`,
19
+ ];
20
+ }
21
+ /** A runner sandbox's tests' totals as its status and end lines say them. */
22
+ export function sandboxTestsText(totals) {
23
+ if (totals === null || totals === undefined)
24
+ return undefined;
25
+ const { passed, failed, skipped } = totals;
26
+ if (failed === 0 && skipped === 0)
27
+ return `${passed} ${passed === 1 ? "test" : "tests"} passed`;
28
+ return [
29
+ ...(passed > 0 ? [`${passed} passed`] : []),
30
+ ...(failed > 0 ? [`${failed} failed`] : []),
31
+ ...(skipped > 0 ? [`${skipped} skipped`] : []),
32
+ ].join(", ");
33
+ }
34
+ /** The lines a run across runner sandboxes ends with. */
35
+ export function acrossSandboxesEndLines(input) {
36
+ const style = input.paint ?? paintFor(false);
37
+ const { records } = input;
38
+ return [
39
+ ...input.sandboxes.flatMap(({ sandbox, waterfall }) => [
40
+ "",
41
+ style.strong(` runner sandbox ${sandbox}`),
42
+ ...waterfall,
43
+ ]),
44
+ "",
45
+ ...input.tests,
46
+ ...sandboxTableLines(records, style),
47
+ ` ${sandboxTotalsLine(records)}`,
48
+ ...(input.mismatches ?? []).map((mismatch) => style.stopped(` ${fileListMismatchText(mismatch, input.extraMismatchHint === undefined ? {} : { extraHint: input.extraMismatchHint })}`)),
49
+ ...(showsFailed(records, input.runId) ? [` storm runs show ${input.runId ?? ""} --failed`] : []),
50
+ ` logs ${input.logs}`,
51
+ ];
52
+ }
53
+ /**
54
+ * Whether a run across runner sandboxes' end lines say `storm runs show <run id> --failed`: a runner sandbox is not
55
+ * `passed`.
56
+ */
57
+ export function showsFailed(records, runId) {
58
+ return runId !== undefined && records.some(({ state }) => state !== "passed");
59
+ }
@@ -0,0 +1,30 @@
1
+ import type { TimedRunEvent } from "../../core/index.ts";
2
+ import { type Paint } from "../../shared/text.ts";
3
+ import { type SandboxTestTally } from "./sandbox-lines.ts";
4
+ /** The least time between two progress lines of one runner sandbox: 10 seconds. */
5
+ export declare const PROGRESS_INTERVAL_MS = 10000;
6
+ /** How many failed tests each runner sandbox names in a line of its own while it runs; its end line counts the rest. */
7
+ export declare const FAILED_TEST_LINES = 5;
8
+ /** The test files a runner sandbox runs now, longest first, up to `named`. */
9
+ export declare function runningFilesText(running: ReadonlyMap<string, number>, now: number, named?: number): string | undefined;
10
+ /** A running runner sandbox's progress parts (files, test totals, and currently running files) and counts text. */
11
+ export declare function sandboxProgressText(progress: {
12
+ readonly finishedFiles: number;
13
+ readonly listed: number | null;
14
+ readonly totals: Readonly<SandboxTestTally> | undefined;
15
+ readonly runningFiles?: string | undefined;
16
+ }): {
17
+ readonly parts: readonly string[];
18
+ readonly counts: string;
19
+ } | undefined;
20
+ /** What a run across runner sandboxes shows while it runs, from its events and the time. */
21
+ export interface SandboxProgress {
22
+ lines(timed: TimedRunEvent): readonly string[];
23
+ tick(now: number): readonly string[];
24
+ rows(now: number, style?: Paint): readonly string[];
25
+ }
26
+ export declare function sandboxProgress(options: {
27
+ readonly count: number;
28
+ readonly header: readonly string[];
29
+ readonly listed?: readonly (number | null)[];
30
+ }): SandboxProgress;
@@ -0,0 +1,232 @@
1
+ // What a run across runner sandboxes shows while it runs (`sandboxProgress`), in every presentation but `--json`.
2
+ // Interactive TTY: live area with one row per runner sandbox (phase + elapsed time, finished/listed files, totals, 1
3
+ // longest running test file) plus up to 5 failed-test lines per runner sandbox. Non-TTY / CI: 10-second progress lines
4
+ // naming up to 2 longest-running test files.
5
+ import { sandboxStateText } from "../../shared/sandbox-table.js";
6
+ import { isoSecondsText, keepTimeText, paint as paintFor, seconds } from "../../shared/text.js";
7
+ import { commandEnd, plainRenderer, progressLine } from "./progress.js";
8
+ import { sandboxLine, sandboxTestsText } from "./sandbox-lines.js";
9
+ /** The least time between two progress lines of one runner sandbox: 10 seconds. */
10
+ export const PROGRESS_INTERVAL_MS = 10_000;
11
+ /** How many failed tests each runner sandbox names in a line of its own while it runs; its end line counts the rest. */
12
+ export const FAILED_TEST_LINES = 5;
13
+ const NAMED_RUNNING_FILES = 2;
14
+ const STEP_TEXT = {
15
+ snapshot: "building the runner snapshot",
16
+ apply: "applying the changes",
17
+ install: "installing",
18
+ build: "building",
19
+ };
20
+ function wholeSeconds(ms) {
21
+ return `${Math.max(0, Math.floor(ms / 1000))}s`;
22
+ }
23
+ /** The test files a runner sandbox runs now, longest first, up to `named`. */
24
+ export function runningFilesText(running, now, named = NAMED_RUNNING_FILES) {
25
+ if (running.size === 0)
26
+ return undefined;
27
+ const longest = [...running].toSorted(([, a], [, b]) => a - b);
28
+ const shown = longest.slice(0, named).map(([file, since]) => `${file} ${wholeSeconds(now - since)}`);
29
+ const more = longest.length - shown.length;
30
+ return `waiting on ${[...shown, ...(more > 0 ? [`${more} more`] : [])].join(", ")}`;
31
+ }
32
+ /** A running runner sandbox's progress parts (files, test totals, and currently running files) and counts text. */
33
+ export function sandboxProgressText(progress) {
34
+ const { finishedFiles, listed, runningFiles } = progress;
35
+ const files = listed !== null && (finishedFiles > 0 || runningFiles !== undefined)
36
+ ? [`${finishedFiles} of ${listed} files`]
37
+ : finishedFiles > 0
38
+ ? [`${finishedFiles} ${finishedFiles === 1 ? "file" : "files"} done`]
39
+ : [];
40
+ const tests = sandboxTestsText(progress.totals);
41
+ const countParts = [...files, ...(tests === undefined ? [] : [tests])];
42
+ const parts = [...countParts, ...(runningFiles === undefined ? [] : [runningFiles])];
43
+ if (parts.length === 0)
44
+ return undefined;
45
+ return { parts, counts: countParts.join(" · ") };
46
+ }
47
+ function endedText(ended) {
48
+ const state = sandboxStateText(ended.state);
49
+ // A canceled runner sandbox's cause only repeats its state.
50
+ if (ended.state === "canceled")
51
+ return state;
52
+ if (ended.exitCode !== null)
53
+ return `${state}: exit ${ended.exitCode}`;
54
+ return ended.cause === null ? state : `${state}: ${ended.cause}`;
55
+ }
56
+ function endTone(state, style) {
57
+ if (state === "passed")
58
+ return style.done;
59
+ return state === "canceled" ? style.stopped : style.failed;
60
+ }
61
+ export function sandboxProgress(options) {
62
+ const { count } = options;
63
+ const own = plainRenderer({ github: false });
64
+ let origin;
65
+ let started = false;
66
+ let stopping = false;
67
+ const activities = new Map();
68
+ const listed = (sandbox) => options.listed?.[sandbox] ?? null;
69
+ const activity = (sandbox) => {
70
+ const known = activities.get(sandbox);
71
+ if (known !== undefined)
72
+ return known;
73
+ const fresh = {
74
+ phase: { kind: "waiting" },
75
+ finished: new Set(),
76
+ running: new Map(),
77
+ totals: undefined,
78
+ failedLines: 0,
79
+ lastLineAt: 0,
80
+ lastCounts: undefined,
81
+ };
82
+ activities.set(sandbox, fresh);
83
+ return fresh;
84
+ };
85
+ const progressOf = (sandbox, now, namedRunning) => {
86
+ const current = activity(sandbox);
87
+ return sandboxProgressText({
88
+ finishedFiles: current.finished.size,
89
+ listed: listed(sandbox),
90
+ totals: current.totals,
91
+ runningFiles: runningFilesText(current.running, now, namedRunning),
92
+ });
93
+ };
94
+ const lines = (timed) => {
95
+ const { event, at } = timed;
96
+ const now = at.getTime();
97
+ origin ??= now;
98
+ const elapsed = now - origin;
99
+ const line = (sandbox, text) => sandboxLine(elapsed, sandbox, text);
100
+ if (event.kind === "sandboxes-started") {
101
+ started = true;
102
+ return options.header;
103
+ }
104
+ if (event.kind === "sandbox-ended") {
105
+ const current = activity(event.sandbox);
106
+ if (current.phase.kind === "ended" && current.phase.state === event.state)
107
+ return [];
108
+ const text = endedText(event);
109
+ if (current.phase.kind !== "ended")
110
+ current.phase = { kind: "ended", text, state: event.state };
111
+ return [line(event.sandbox, text)];
112
+ }
113
+ if (event.kind === "cleanup-started" || event.kind === "cleanup-finished")
114
+ return [];
115
+ if (event.kind === "runner" && event.event.kind === "step-output")
116
+ return [];
117
+ if (event.kind !== "sandbox")
118
+ return own(timed);
119
+ const { sandbox, event: inner } = event;
120
+ const current = activity(sandbox);
121
+ if (inner.kind === "command-started") {
122
+ current.phase = { kind: "running", since: now };
123
+ current.lastLineAt = now;
124
+ return [line(sandbox, "command started")];
125
+ }
126
+ if (inner.kind === "command-ended") {
127
+ const { outcome } = inner;
128
+ const state = outcome.kind === "exited" && outcome.code === 0 ? "passed" : "failed";
129
+ const how = state === "passed"
130
+ ? "passed"
131
+ : `failed: ${outcome.kind === "exited" ? `exit ${outcome.code}` : commandEnd(outcome)}`;
132
+ const tests = sandboxTestsText(current.totals);
133
+ const text = `${how} after ${seconds(inner.ms)}${tests === undefined ? "" : ` · ${tests}`}`;
134
+ current.phase = { kind: "ended", text, state };
135
+ current.running.clear();
136
+ return [line(sandbox, text)];
137
+ }
138
+ if (inner.kind === "test") {
139
+ const test = inner.event;
140
+ const runs = current.phase.kind === "running";
141
+ if (test.kind === "file-started" && runs)
142
+ current.running.set(test.file, now);
143
+ if (test.kind === "file-finished") {
144
+ current.running.delete(test.file);
145
+ current.finished.add(test.file);
146
+ }
147
+ if (test.kind !== "test-result")
148
+ return [];
149
+ const counted = current.totals ?? { passed: 0, failed: 0, skipped: 0 };
150
+ if (test.state === "pass")
151
+ counted.passed += 1;
152
+ else if (test.state === "fail")
153
+ counted.failed += 1;
154
+ else
155
+ counted.skipped += 1;
156
+ current.totals = counted;
157
+ if (test.state !== "fail" || !runs)
158
+ return [];
159
+ current.failedLines += 1;
160
+ if (current.failedLines <= FAILED_TEST_LINES)
161
+ return [line(sandbox, `test failed: ${test.file} > ${test.test}`)];
162
+ return current.failedLines === FAILED_TEST_LINES + 1
163
+ ? [line(sandbox, "more tests failed; its end line counts them")]
164
+ : [];
165
+ }
166
+ if (inner.kind !== "runner")
167
+ return [];
168
+ const runner = inner.event;
169
+ if (current.phase.kind === "waiting" || current.phase.kind === "preparing") {
170
+ if (runner.kind === "runner-sandbox-starting")
171
+ current.phase = { kind: "preparing", text: "starting its runner sandbox", since: now };
172
+ if (runner.kind === "uploading")
173
+ current.phase = { kind: "preparing", text: "uploading the changes", since: now };
174
+ if (runner.kind === "step-started")
175
+ current.phase = { kind: "preparing", text: STEP_TEXT[runner.phase], since: now };
176
+ }
177
+ if (runner.kind === "sandbox-started" && runner.role === "runner")
178
+ return [line(sandbox, `runner sandbox ${runner.name} started (${seconds(runner.ms)})`)];
179
+ if (runner.kind === "sandbox-kept")
180
+ return [line(sandbox, `runner sandbox ${runner.name} kept until ${isoSecondsText(runner.stopsAt)}`)];
181
+ if (runner.kind !== "stopping" || stopping)
182
+ return [];
183
+ stopping = true;
184
+ const then = runner.keepMs > 0
185
+ ? `keeping each runner sandbox running ${keepTimeText(runner.keepMs)}`
186
+ : "stopping and deleting the runner's sandboxes";
187
+ return [
188
+ progressLine(elapsed, "cleanup", `stopping: killing each runner sandbox's command that runs, then ${then}…`),
189
+ ];
190
+ };
191
+ const tick = (now) => {
192
+ if (origin === undefined)
193
+ return [];
194
+ const due = [];
195
+ for (const [sandbox, current] of [...activities].toSorted(([a], [b]) => a - b)) {
196
+ const { phase } = current;
197
+ if (phase.kind !== "running" || now - current.lastLineAt < PROGRESS_INTERVAL_MS)
198
+ continue;
199
+ const progress = progressOf(sandbox, now);
200
+ if (progress === undefined)
201
+ continue;
202
+ if (progress.counts === current.lastCounts && current.running.size === 0)
203
+ continue;
204
+ current.lastLineAt = now;
205
+ current.lastCounts = progress.counts;
206
+ due.push(sandboxLine(now - origin, sandbox, [`running ${seconds(now - phase.since)}`, ...progress.parts].join(" · ")));
207
+ }
208
+ return due;
209
+ };
210
+ const rows = (now, style = paintFor(false)) => {
211
+ if (!started)
212
+ return [];
213
+ return Array.from({ length: count }, (_, index) => {
214
+ const sandbox = index;
215
+ const label = style.strong(` runner sandbox ${sandbox}`);
216
+ const { phase } = activity(sandbox);
217
+ switch (phase.kind) {
218
+ case "waiting":
219
+ return `${label} ${style.faint("waiting")}`;
220
+ case "preparing":
221
+ return `${label} ${style.active(`${phase.text} ${wholeSeconds(now - phase.since)}`)}`;
222
+ case "running": {
223
+ const progress = progressOf(sandbox, now, 1);
224
+ return `${label} ${[seconds(now - phase.since), ...(progress?.parts ?? [])].join(" · ")}`;
225
+ }
226
+ case "ended":
227
+ return `${label} ${endTone(phase.state, style)(phase.text)}`;
228
+ }
229
+ });
230
+ };
231
+ return { lines, tick, rows };
232
+ }
@@ -0,0 +1,19 @@
1
+ import type { StormApp } from "../../context.ts";
2
+ import type { RunObserver } from "../../core/index.ts";
3
+ import type { SandboxProgress } from "./sandbox-progress.ts";
4
+ /**
5
+ * The view of a run across runner sandboxes: the observer that shows each event, and `finish`, which ends what it
6
+ * started.
7
+ */
8
+ export interface SandboxView {
9
+ readonly observer: RunObserver;
10
+ finish(): void;
11
+ }
12
+ /** How long the plain view waits before it asks again for the progress lines that came due. */
13
+ export declare const PROGRESS_TICK_MS = 1000;
14
+ /**
15
+ * The view of a run across runner sandboxes over `status`, by the app's presentation; `progress` undefined shows
16
+ * nothing. The plain view waits on the app's timer between its asks, from when it is made until `finish`, which ends
17
+ * the wait at once.
18
+ */
19
+ export declare function sandboxView(app: Pick<StormApp, "context" | "presentation">, progress: ((line: string) => Promise<void>) | undefined, status: SandboxProgress): SandboxView;