@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
@@ -2,6 +2,6 @@
2
2
  // folders use of the run payload and the redaction of secrets, and what an extension's run side reads the run payload
3
3
  // with (`readRunPayload`). It is not a published export: a command and a support library import `../index.ts`,
4
4
  // `@vercel/storm/sdk`.
5
- export { readRunPayload, RUN_PAYLOAD_VARIABLE } from "./payload.js";
5
+ export { readRunPayload, RUN_PAYLOAD_VARIABLE, } from "./payload.js";
6
6
  export { parseTestEvent, testEventLine, } from "./test-events.js";
7
7
  export { redactSecrets } from "./redact.js";
@@ -2,14 +2,28 @@ import type { Present } from "./present.ts";
2
2
  import { type PayloadContract } from "./contract.ts";
3
3
  /**
4
4
  * The run payload, version 3, as a command reads it: where the command may append test events (`testEvents`, a file
5
- * path), when the run follows them; whether the run is verbose (`verbose`, under `storm vitest --verbose` or
5
+ * path), when the run follows them; whether the run is verbose (`verbose`, under `storm test --verbose` or
6
6
  * `storm exec --verbose`), so the command prints what each test did as it goes, passing or not; and what each acquired
7
7
  * resource instance hands the command, read by its definition with `get`.
8
8
  */
9
+ /** Which runner sandbox the command runs in, and its file list, in the run payload of a run across runner sandboxes. */
10
+ export interface RunPayloadSandbox {
11
+ /** The runner sandbox index, counting from 0. */
12
+ readonly index: number;
13
+ /** Total number of runner sandboxes in this run. */
14
+ readonly count: number;
15
+ /** This runner sandbox's file list, as paths relative to the project; absent when the run has no file lists. */
16
+ readonly files?: readonly string[];
17
+ }
9
18
  export interface RunPayload {
10
19
  readonly version: 3;
11
20
  readonly testEvents?: string;
12
21
  readonly verbose?: true;
22
+ /**
23
+ * In a run across runner sandboxes, this runner sandbox's runner sandbox index, the number of runner sandboxes, and
24
+ * its file list when it has one.
25
+ */
26
+ readonly sandbox?: RunPayloadSandbox;
13
27
  /**
14
28
  * The section the run payload holds for the default resource of payload contract `contract`'s resource, the
15
29
  * resource keyed by its name: `{ present: true, value }` with the section, checked by the contract's payload check,
@@ -34,6 +48,7 @@ export interface RunPayloadJson<Resources extends object = Readonly<Record<strin
34
48
  readonly resources: Resources;
35
49
  readonly testEvents?: string;
36
50
  readonly verbose?: true;
51
+ readonly sandbox?: RunPayloadSandbox;
37
52
  }
38
53
  /** The variable a run hands its command the run payload in. */
39
54
  export declare const RUN_PAYLOAD_VARIABLE = "STORM_RUN";
@@ -8,11 +8,17 @@ const RUN_PAYLOAD_VERSION = 3;
8
8
  * What `readRunPayload` checks: the version, that each resource instance under `resources` names its definition, and
9
9
  * `testEvents` and `verbose`.
10
10
  */
11
+ const runPayloadSandboxSchema = z.object({
12
+ index: z.number().int().nonnegative(),
13
+ count: z.number().int().positive(),
14
+ files: z.array(z.string().min(1)).optional(),
15
+ });
11
16
  const runPayloadSchema = z.object({
12
17
  version: z.literal(RUN_PAYLOAD_VERSION),
13
18
  resources: z.record(z.string(), z.object({ definition: z.string().min(1), payload: z.unknown() })),
14
19
  testEvents: z.string().min(1).optional(),
15
20
  verbose: z.literal(true).optional(),
21
+ sandbox: runPayloadSandboxSchema.optional(),
16
22
  });
17
23
  /**
18
24
  * `readRunPayload` found `STORM_RUN` missing, not JSON, or not a version 3 run payload, or an instance of another
@@ -30,7 +36,7 @@ export class RunPayloadError extends Error {
30
36
  export function readRunPayload(env = process.env) {
31
37
  const raw = env[RUN_PAYLOAD_VARIABLE];
32
38
  if (raw === undefined || raw === "") {
33
- throw new RunPayloadError(`${RUN_PAYLOAD_VARIABLE} is not set: run this command under \`storm vitest\`, \`storm playwright\` or \`storm exec\``);
39
+ throw new RunPayloadError(`${RUN_PAYLOAD_VARIABLE} is not set: run this command under \`storm test\` or \`storm exec\``);
34
40
  }
35
41
  let json;
36
42
  try {
@@ -47,11 +53,20 @@ export function readRunPayload(env = process.env) {
47
53
  const issue = parsed.error.issues[0];
48
54
  throw notValid(issue?.path ?? [], issue?.message ?? "invalid");
49
55
  }
50
- const { resources, testEvents, verbose } = parsed.data;
56
+ const { resources, testEvents, verbose, sandbox } = parsed.data;
51
57
  return {
52
58
  version: RUN_PAYLOAD_VERSION,
53
59
  ...(testEvents === undefined ? {} : { testEvents }),
54
60
  ...(verbose === undefined ? {} : { verbose }),
61
+ ...(sandbox === undefined
62
+ ? {}
63
+ : {
64
+ sandbox: {
65
+ index: sandbox.index,
66
+ count: sandbox.count,
67
+ ...(sandbox.files === undefined ? {} : { files: [...sandbox.files] }),
68
+ },
69
+ }),
55
70
  get(contract) {
56
71
  const key = defaultResourceKey(contract);
57
72
  const instance = Object.hasOwn(resources, key) ? resources[key] : undefined;
@@ -1,5 +1,5 @@
1
- // Hiding secrets in text: storm shows a resource secret or a runner secret as `<token>` wherever it appears in what a
2
- // run prints and writes.
1
+ // Hiding secrets in text: storm shows a secret, such as a resource's token or a sandbox credential's value, as
2
+ // `<token>` wherever it appears in what a run prints and writes.
3
3
  /** What a hidden secret reads as. */
4
4
  const REDACTED = "<token>";
5
5
  /**
@@ -7,9 +7,11 @@ export type TestEventState = "pass" | "fail" | "skip";
7
7
  * epoch).
8
8
  *
9
9
  * - `file-started` and `file-finished`: the worker started and finished the file.
10
- * - `test-started`: the worker started an attempt at test `test`, one of the file's `fileTests` tests.
11
- * - `test-attempt-finished`: that attempt ended `state` after `ms`, any setup phase among it. A retried test reports
12
- * one for each attempt, so these are not the test's final result.
10
+ * - `test-started`: the worker started an attempt at test `test`, one of the file's `fileTests` tests. `id` is the
11
+ * test runner's id for the test, unique within the run and the same as its final result's (`TestResultEvent.id`),
12
+ * so a reader joins a test's attempts to its final result by it; `test` is the test's name, for display only.
13
+ * - `test-attempt-finished`: that attempt, by the same `id`, ended `state` after `ms`, any setup phase among it. A
14
+ * retried test reports one for each attempt, so these are not the test's final result.
13
15
  * - `setup-started` and `setup-finished`: a setup phase, in which the worker set something up for the file's tests, or
14
16
  * for one test, before they could run. Its writer supplies two names: `label`, what it set up, a singular noun the
15
17
  * launcher prints as it is (`<label> starts 5`, `waiting on a <label>`), and `resource`, the name of the resource
@@ -32,6 +34,7 @@ export type WorkerTestEvent = {
32
34
  readonly file: string;
33
35
  readonly worker: number;
34
36
  readonly at: number;
37
+ readonly id: string;
35
38
  readonly test: string;
36
39
  readonly fileTests: number;
37
40
  } | {
@@ -39,6 +42,7 @@ export type WorkerTestEvent = {
39
42
  readonly file: string;
40
43
  readonly worker: number;
41
44
  readonly at: number;
45
+ readonly id: string;
42
46
  readonly test: string;
43
47
  readonly state: TestEventState;
44
48
  readonly ms: number;
@@ -96,12 +100,25 @@ export interface TestResultEvent {
96
100
  readonly errors?: readonly TestResultError[];
97
101
  readonly output?: TestResultOutput;
98
102
  }
103
+ /**
104
+ * A test file's start or finish reported by the test runner's main process, where no worker index is known.
105
+ * A worker's own `file-started` / `file-finished` event carries `worker` (`WorkerTestEvent`).
106
+ */
107
+ export type FileTimingEvent = {
108
+ readonly kind: "file-started";
109
+ readonly file: string;
110
+ readonly at: number;
111
+ } | {
112
+ readonly kind: "file-finished";
113
+ readonly file: string;
114
+ readonly at: number;
115
+ };
99
116
  /**
100
117
  * What a command's test runner reports as it goes, one JSON object a line, appended to the run payload's
101
- * `testEvents` file: a worker's progress through a file (`WorkerTestEvent`), or a test's final result
102
- * (`TestResultEvent`).
118
+ * `testEvents` file: a worker's progress through a file (`WorkerTestEvent`), a main-process file start or finish
119
+ * (`FileTimingEvent`), or a test's final result (`TestResultEvent`).
103
120
  */
104
- export type TestEvent = WorkerTestEvent | TestResultEvent;
121
+ export type TestEvent = WorkerTestEvent | FileTimingEvent | TestResultEvent;
105
122
  /** The line a test event is appended as: its JSON, without a newline. */
106
123
  export declare function testEventLine(event: TestEvent): string;
107
124
  /** The test event on `line`, or undefined when it holds none: not JSON, or not an event this SDK knows. */
@@ -1,15 +1,17 @@
1
1
  import { z } from "zod";
2
2
  const where = { file: z.string(), worker: z.number().int().nonnegative(), at: z.number() };
3
+ const fileWhere = { file: z.string(), worker: z.number().int().nonnegative().exactOptional(), at: z.number() };
4
+ const attempt = { id: z.string().min(1), test: z.string() };
3
5
  const setup = { label: z.string().min(1), resource: z.string().min(1) };
4
6
  const state = z.enum(["pass", "fail", "skip"]);
5
7
  const testEventSchema = z.discriminatedUnion("kind", [
6
- z.object({ kind: z.literal("file-started"), ...where }),
7
- z.object({ kind: z.literal("file-finished"), ...where }),
8
- z.object({ kind: z.literal("test-started"), ...where, test: z.string(), fileTests: z.number().int().nonnegative() }),
8
+ z.object({ kind: z.literal("file-started"), ...fileWhere }),
9
+ z.object({ kind: z.literal("file-finished"), ...fileWhere }),
10
+ z.object({ kind: z.literal("test-started"), ...where, ...attempt, fileTests: z.number().int().nonnegative() }),
9
11
  z.object({
10
12
  kind: z.literal("test-attempt-finished"),
11
13
  ...where,
12
- test: z.string(),
14
+ ...attempt,
13
15
  state,
14
16
  ms: z.number().nonnegative(),
15
17
  }),
@@ -44,10 +44,15 @@ export interface TestResultWriter {
44
44
  /** Keeps `content`, a console write the test `id` made, as the end of its test output so far. */
45
45
  output(id: string, content: string): void;
46
46
  /**
47
- * Appends the test's final result as a `test-result` event, with the time, its errors cut to size and its test
48
- * output, and drops any later result for the same `id`. A result that can't be written as a line is dropped alone.
47
+ * Appends the test's final result as a `test-result` event, with the time (`at`, defaulting to `now()`), its errors
48
+ * cut to size and its test output, and drops any later result for the same `id`. A result that can't be written as a
49
+ * line is dropped alone.
49
50
  */
50
- write(result: ReportedTestResult): void;
51
+ write(result: ReportedTestResult, at?: number): void;
52
+ /** Appends a main-process `file-started` event for `file` (no worker index). */
53
+ fileStarted(file: string): void;
54
+ /** Appends a main-process `file-finished` event for `file` (no worker index), at `at` (defaulting to `now()`). */
55
+ fileFinished(file: string, at?: number): void;
51
56
  /** Drops the test output held for tests no result was written for, once the test run has ended. */
52
57
  end(): void;
53
58
  }
@@ -46,7 +46,7 @@ export function testResultWriter(env, append = (path, text) => appendFileSync(pa
46
46
  // result is cut to the limit.
47
47
  outputs.set(id, grown.text.length > 2 * OUTPUT_CHARS ? keepLast(grown, OUTPUT_CHARS) : grown);
48
48
  },
49
- write: (result) => {
49
+ write: (result, at) => {
50
50
  if (path === undefined || !accepts(result.id))
51
51
  return;
52
52
  written.add(result.id);
@@ -64,7 +64,7 @@ export function testResultWriter(env, append = (path, text) => appendFileSync(pa
64
64
  state: result.state,
65
65
  retryCount: result.retryCount,
66
66
  flaky: result.flaky,
67
- at: now(),
67
+ at: at ?? now(),
68
68
  ...(errors.length > 0 ? { errors } : {}),
69
69
  ...(output === undefined ? {} : { output }),
70
70
  });
@@ -80,6 +80,26 @@ export function testResultWriter(env, append = (path, text) => appendFileSync(pa
80
80
  failed = true;
81
81
  }
82
82
  },
83
+ fileStarted: (file) => {
84
+ if (path === undefined || failed || file === "")
85
+ return;
86
+ try {
87
+ append(path, `${testEventLine({ kind: "file-started", file, at: now() })}\n`);
88
+ }
89
+ catch {
90
+ failed = true;
91
+ }
92
+ },
93
+ fileFinished: (file, at) => {
94
+ if (path === undefined || failed || file === "")
95
+ return;
96
+ try {
97
+ append(path, `${testEventLine({ kind: "file-finished", file, at: at ?? now() })}\n`);
98
+ }
99
+ catch {
100
+ failed = true;
101
+ }
102
+ },
83
103
  end: () => {
84
104
  outputs.clear();
85
105
  },
@@ -1,6 +1,6 @@
1
1
  import type { Row } from "@vercel/clinkr";
2
2
  import { z } from "zod";
3
- import type { InstanceWarnings, ResourceCleanupRecords, RunnerCleanupFacts } from "../../core/index.ts";
3
+ import type { InstanceWarnings, ResourceCleanupRecords, RunnerCleanupFacts } from "../core/index.ts";
4
4
  /** One of the runner's sandboxes the run couldn't stop; its own timeout stops it. */
5
5
  declare const notStoppedSchema: z.ZodObject<{
6
6
  name: z.ZodString;
@@ -20,7 +20,7 @@ declare const notDeletedSchema: z.ZodObject<{
20
20
  }>;
21
21
  message: z.ZodString;
22
22
  }, z.core.$strip>;
23
- /** The runner sandbox the run kept running once it ended, so a person can connect to it. */
23
+ /** The runner sandbox the run kept running once it ended, with no network access, so a person can connect to it. */
24
24
  declare const keptSchema: z.ZodObject<{
25
25
  name: z.ZodString;
26
26
  stopsAt: z.ZodString;
@@ -77,7 +77,7 @@ export declare function notKeptText(sandbox: z.infer<typeof notKeptSchema>): str
77
77
  * Rows for the runner sandbox the run kept running, or couldn't keep, and the runner's sandboxes that couldn't be
78
78
  * stopped or deleted, when there are any.
79
79
  */
80
- export declare function runnerCleanupRows(cleanup: RunnerCleanup | null): (readonly ["Sandbox kept", readonly [`${string}, running until ${string}`, string]] | readonly ["Sandbox not kept", string] | readonly ["Sandboxes not deleted", string[]] | readonly ["Sandboxes not stopped", string[]])[];
80
+ export declare function runnerCleanupRows(cleanup: RunnerCleanup | null): (readonly ["Runner sandbox kept", readonly [`${string}, running until ${string}, with no network access`, string]] | readonly ["Runner sandbox not kept", string] | readonly ["Sandboxes not deleted", string[]] | readonly ["Sandboxes not stopped", string[]])[];
81
81
  /** Warnings for the runner sandbox the run couldn't keep running, and the sandboxes that couldn't be stopped or deleted. */
82
82
  export declare function runnerCleanupWarnings(cleanup: RunnerCleanup | null): {
83
83
  reason: string;
@@ -7,8 +7,8 @@
7
7
  // among them (`resource-refusals.ts`). `RUN_CLEANUP` is the run's cleanup over the resource definition set's resource
8
8
  // reports (`DEFINITION_SET.reports`, `src/extensions.ts`).
9
9
  import { z } from "zod";
10
- import { DEFINITION_SET } from "../../extensions.js";
11
- import { sandboxConnectPage } from "../dashboard.js";
10
+ import { DEFINITION_SET } from "../extensions.js";
11
+ import { sandboxConnectPage } from "./dashboard.js";
12
12
  import { isoSecondsText } from "./text.js";
13
13
  /** One of the runner's sandboxes the run couldn't stop; its own timeout stops it. */
14
14
  const notStoppedSchema = z.object({
@@ -24,7 +24,7 @@ const notDeletedSchema = z.object({
24
24
  role: z.enum(["runner", "snapshot-build"]),
25
25
  message: z.string(),
26
26
  });
27
- /** The runner sandbox the run kept running once it ended, so a person can connect to it. */
27
+ /** The runner sandbox the run kept running once it ended, with no network access, so a person can connect to it. */
28
28
  const keptSchema = z.object({
29
29
  name: z.string(),
30
30
  /** When its timeout stops it, as an ISO time: the keep time from when the run ended, or later. */
@@ -58,7 +58,7 @@ export function notDeletedText(sandbox) {
58
58
  }
59
59
  /** The runner sandbox a run kept running, as a sentence. */
60
60
  export function keptText(kept) {
61
- return `Kept the runner sandbox ${kept.name} running until ${isoSecondsText(kept.stopsAt)}, so you can connect to it: ${kept.url}`;
61
+ return `Kept the runner sandbox ${kept.name} running until ${isoSecondsText(kept.stopsAt)}, with no network access, so you can connect to it: ${kept.url}`;
62
62
  }
63
63
  /** The runner sandbox a run couldn't keep running, as a sentence. */
64
64
  export function notKeptText(sandbox) {
@@ -75,8 +75,13 @@ export function runnerCleanupRows(cleanup) {
75
75
  return [
76
76
  ...(kept === null
77
77
  ? []
78
- : [["Sandbox kept", [`${kept.name}, running until ${isoSecondsText(kept.stopsAt)}`, kept.url]]]),
79
- ...(notKept === null ? [] : [["Sandbox not kept", notKeptText(notKept)]]),
78
+ : [
79
+ [
80
+ "Runner sandbox kept",
81
+ [`${kept.name}, running until ${isoSecondsText(kept.stopsAt)}, with no network access`, kept.url],
82
+ ],
83
+ ]),
84
+ ...(notKept === null ? [] : [["Runner sandbox not kept", notKeptText(notKept)]]),
80
85
  ...(cleanup.notStopped.length === 0
81
86
  ? []
82
87
  : [["Sandboxes not stopped", cleanup.notStopped.map(notStoppedText)]]),
@@ -0,0 +1,19 @@
1
+ import type { SandboxRecord, TimelineFacts } from "../run-directory/index.ts";
2
+ /**
3
+ * The job summary's Markdown for `timeline`, headed with the invoking command, `storm <command>`; `details` are
4
+ * lines after the critical path, such as the tests'.
5
+ */
6
+ export declare function jobSummaryMarkdown(timeline: TimelineFacts, extras: {
7
+ readonly command: string;
8
+ readonly logs: string | undefined;
9
+ readonly details?: readonly string[];
10
+ }): string;
11
+ /**
12
+ * The job summary's Markdown for a run across runner sandboxes, headed with the invoking command, `storm <command>`:
13
+ * the runner sandbox table, the totals line, the tests' lines (`details`), and where its run directory is.
14
+ */
15
+ export declare function acrossSandboxesJobSummaryMarkdown(records: readonly SandboxRecord[], extras: {
16
+ readonly command: string;
17
+ readonly logs: string | undefined;
18
+ readonly details?: readonly string[];
19
+ }): string;
@@ -1,5 +1,6 @@
1
1
  // The Markdown summary a run appends to a GitHub Actions job summary: its waterfall as a table, the critical path,
2
2
  // and where its run directory is, so a CI run that uploads it as an artifact can find it.
3
+ import { SANDBOX_TABLE_HEADER, sandboxTableRows, sandboxTotalsLine } from "./sandbox-table.js";
3
4
  import { seconds } from "./text.js";
4
5
  import { criticalPathStep } from "./waterfall.js";
5
6
  /**
@@ -32,3 +33,19 @@ function tableRow(row) {
32
33
  const idle = row.idleMs > 0 ? seconds(row.idleMs) : "";
33
34
  return `| ${row.label}${outcome} | +${seconds(row.startMs)} | ${seconds(row.endMs - row.startMs)} | ${idle} | ${steps} |`;
34
35
  }
36
+ /**
37
+ * The job summary's Markdown for a run across runner sandboxes, headed with the invoking command, `storm <command>`:
38
+ * the runner sandbox table, the totals line, the tests' lines (`details`), and where its run directory is.
39
+ */
40
+ export function acrossSandboxesJobSummaryMarkdown(records, extras) {
41
+ const lines = [`### storm ${extras.command}`, ""];
42
+ const rows = sandboxTableRows(records);
43
+ lines.push(`| ${SANDBOX_TABLE_HEADER.join(" | ")} |`, `| ${SANDBOX_TABLE_HEADER.map((_, column) => (column >= 2 && column <= 4 ? "---:" : "---")).join(" | ")} |`, ...rows.map((row) => `| ${row.map((cell) => cell.replaceAll("|", "\\|")).join(" | ")} |`), "", sandboxTotalsLine(records), "");
44
+ for (const detail of extras.details ?? [])
45
+ lines.push(`${detail.trim()} `);
46
+ if ((extras.details ?? []).length > 0)
47
+ lines.push("");
48
+ if (extras.logs !== undefined)
49
+ lines.push(`Run directory: \`${extras.logs}\``, "");
50
+ return lines.join("\n");
51
+ }
@@ -0,0 +1,48 @@
1
+ import type { SandboxRecord, SandboxState } from "../run-directory/index.ts";
2
+ import { type Paint } from "./text.ts";
3
+ /** The runner sandbox table's columns. */
4
+ export declare const SANDBOX_TABLE_HEADER: readonly ["RUNNER SANDBOX", "STATE", "EXIT", "PREPARED", "COMMAND", "TESTS", "NAME"];
5
+ /** Tests' totals, such as `5 passed · 1 failed`, `no tests`, or `-` when unknown (null). */
6
+ export declare function testTotalsText(totals: {
7
+ readonly passed: number;
8
+ readonly failed: number;
9
+ readonly skipped: number;
10
+ } | null): string;
11
+ /** A runner sandbox state as a person reads it: the state, with a space for a dash, such as `not started`. */
12
+ export declare function sandboxStateText(state: SandboxState): string;
13
+ /** `count` runner sandboxes, such as `1 runner sandbox` or `2 runner sandboxes`. */
14
+ export declare function sandboxesText(count: number): string;
15
+ /**
16
+ * What follows the exit status of a run across runner sandboxes that has ended: how many of its runner sandboxes
17
+ * passed, such as ` (1 of 2 runner sandboxes passed)`.
18
+ */
19
+ export declare function sandboxesPassedText(sandboxes: readonly Pick<SandboxRecord, "state">[]): string;
20
+ /**
21
+ * Where a run across runner sandboxes ran its commands: `2 runner sandboxes`. Once the run has ended (`ended`), only
22
+ * the runner sandboxes that started count, and the ones that never started are named: `1 runner sandbox, 1 not
23
+ * started`.
24
+ */
25
+ export declare function startedSandboxesText(sandboxes: readonly Pick<SandboxRecord, "name">[], ended: boolean): string;
26
+ /** What a row of the runner sandbox table reads of a runner sandbox's record. */
27
+ export type SandboxTableRecord = Pick<SandboxRecord, "sandbox" | "state" | "exitCode" | "preparedMs" | "commandMs" | "tests" | "name" | "keptUntil">;
28
+ /**
29
+ * The runner sandbox table's rows, one for each runner sandbox, under `SANDBOX_TABLE_HEADER`: its runner sandbox index,
30
+ * its runner sandbox state, its command's exit code, the time from the run's start to its command's start, how long its
31
+ * command took, its tests' totals, and its runner sandbox, with until when the run kept it; `-` for each that is
32
+ * unknown.
33
+ */
34
+ export declare function sandboxTableRows(sandboxes: readonly SandboxTableRecord[]): string[][];
35
+ /**
36
+ * Why a runner sandbox is in its runner sandbox state, as one line: its record's cause, or for a runner sandbox whose
37
+ * command exited, the exit code; `-` when neither is known, such as for a pending runner sandbox.
38
+ */
39
+ export declare function sandboxCauseText(sandbox: Pick<SandboxRecord, "cause" | "exitCode">): string;
40
+ /**
41
+ * How many runner sandboxes are in each runner sandbox state, as the totals line says it: `3 runner sandboxes: 2
42
+ * passed, 1 failed`.
43
+ */
44
+ export declare function sandboxTotalsLine(records: readonly Pick<SandboxRecord, "state">[]): string;
45
+ /**
46
+ * The runner sandbox table as lines, under its header, each column as wide as its widest cell, the state in its color.
47
+ */
48
+ export declare function sandboxTableLines(records: readonly SandboxRecord[], style?: Paint): string[];
@@ -0,0 +1,109 @@
1
+ // Shared formatting for the summaries and tables of a run across runner sandboxes, reused by `storm runs show`, the
2
+ // run's end summary, and the GitHub Actions job summary with no import between `commands/exec/` and `commands/runs/`.
3
+ import { isoSecondsText, paint as paintFor, seconds } from "./text.js";
4
+ /** The runner sandbox table's columns. */
5
+ export const SANDBOX_TABLE_HEADER = [
6
+ "RUNNER SANDBOX",
7
+ "STATE",
8
+ "EXIT",
9
+ "PREPARED",
10
+ "COMMAND",
11
+ "TESTS",
12
+ "NAME",
13
+ ];
14
+ /** Tests' totals, such as `5 passed · 1 failed`, `no tests`, or `-` when unknown (null). */
15
+ export function testTotalsText(totals) {
16
+ if (totals === null)
17
+ return "-";
18
+ const parts = [
19
+ ...(totals.passed > 0 ? [`${totals.passed} passed`] : []),
20
+ ...(totals.failed > 0 ? [`${totals.failed} failed`] : []),
21
+ ...(totals.skipped > 0 ? [`${totals.skipped} skipped`] : []),
22
+ ];
23
+ return parts.length === 0 ? "no tests" : parts.join(" · ");
24
+ }
25
+ /** A runner sandbox state as a person reads it: the state, with a space for a dash, such as `not started`. */
26
+ export function sandboxStateText(state) {
27
+ return state.replace("-", " ");
28
+ }
29
+ /** `count` runner sandboxes, such as `1 runner sandbox` or `2 runner sandboxes`. */
30
+ export function sandboxesText(count) {
31
+ return `${count} ${count === 1 ? "runner sandbox" : "runner sandboxes"}`;
32
+ }
33
+ /**
34
+ * What follows the exit status of a run across runner sandboxes that has ended: how many of its runner sandboxes
35
+ * passed, such as ` (1 of 2 runner sandboxes passed)`.
36
+ */
37
+ export function sandboxesPassedText(sandboxes) {
38
+ const passed = sandboxes.filter(({ state }) => state === "passed").length;
39
+ return ` (${passed} of ${sandboxesText(sandboxes.length)} passed)`;
40
+ }
41
+ /**
42
+ * Where a run across runner sandboxes ran its commands: `2 runner sandboxes`. Once the run has ended (`ended`), only
43
+ * the runner sandboxes that started count, and the ones that never started are named: `1 runner sandbox, 1 not
44
+ * started`.
45
+ */
46
+ export function startedSandboxesText(sandboxes, ended) {
47
+ const started = ended ? sandboxes.filter(({ name }) => name !== null).length : sandboxes.length;
48
+ const missing = sandboxes.length - started;
49
+ return `${started} runner ${started === 1 ? "sandbox" : "sandboxes"}${missing === 0 ? "" : `, ${missing} not started`}`;
50
+ }
51
+ /**
52
+ * The runner sandbox table's rows, one for each runner sandbox, under `SANDBOX_TABLE_HEADER`: its runner sandbox index,
53
+ * its runner sandbox state, its command's exit code, the time from the run's start to its command's start, how long its
54
+ * command took, its tests' totals, and its runner sandbox, with until when the run kept it; `-` for each that is
55
+ * unknown.
56
+ */
57
+ export function sandboxTableRows(sandboxes) {
58
+ const time = (ms) => (ms === null ? "-" : seconds(ms));
59
+ return sandboxes.map((each) => [
60
+ String(each.sandbox),
61
+ sandboxStateText(each.state),
62
+ each.exitCode === null ? "-" : String(each.exitCode),
63
+ time(each.preparedMs),
64
+ time(each.commandMs),
65
+ testTotalsText(each.tests),
66
+ each.name === null
67
+ ? "-"
68
+ : `${each.name}${each.keptUntil === null ? "" : ` (kept until ${isoSecondsText(each.keptUntil)})`}`,
69
+ ]);
70
+ }
71
+ /**
72
+ * Why a runner sandbox is in its runner sandbox state, as one line: its record's cause, or for a runner sandbox whose
73
+ * command exited, the exit code; `-` when neither is known, such as for a pending runner sandbox.
74
+ */
75
+ export function sandboxCauseText(sandbox) {
76
+ if (sandbox.cause !== null)
77
+ return sandbox.cause;
78
+ return sandbox.exitCode === null ? "-" : `the command exited ${sandbox.exitCode}`;
79
+ }
80
+ /**
81
+ * How many runner sandboxes are in each runner sandbox state, as the totals line says it: `3 runner sandboxes: 2
82
+ * passed, 1 failed`.
83
+ */
84
+ export function sandboxTotalsLine(records) {
85
+ const states = ["passed", "failed", "not-started", "canceled", "pending"];
86
+ const counted = states.flatMap((state) => {
87
+ const number = records.filter((record) => record.state === state).length;
88
+ return number === 0 ? [] : [`${number} ${sandboxStateText(state)}`];
89
+ });
90
+ return `${sandboxesText(records.length)}: ${counted.join(", ")}`;
91
+ }
92
+ /**
93
+ * The runner sandbox table as lines, under its header, each column as wide as its widest cell, the state in its color.
94
+ */
95
+ export function sandboxTableLines(records, style = paintFor(false)) {
96
+ const rows = [[...SANDBOX_TABLE_HEADER], ...sandboxTableRows(records)];
97
+ const widths = SANDBOX_TABLE_HEADER.map((_, column) => Math.max(...rows.map((row) => row[column]?.length ?? 0)));
98
+ const tone = (state) => state === "passed" ? style.done : state === "canceled" || state === "pending" ? style.stopped : style.failed;
99
+ return rows.map((row, index) => {
100
+ const record = index === 0 ? undefined : records[index - 1];
101
+ const cells = row.map((cell, column) => {
102
+ const padded = column === row.length - 1 ? cell : cell.padEnd(widths[column] ?? 0);
103
+ if (index === 0)
104
+ return style.strong(padded);
105
+ return column === 1 && record !== undefined ? tone(record.state)(padded) : padded;
106
+ });
107
+ return ` ${cells.join(" ")}`.trimEnd();
108
+ });
109
+ }
@@ -1,4 +1,4 @@
1
- import type { RejectedSnapshot, SnapshotCacheNote, SnapshotRejectionReason } from "../../runner/index.ts";
1
+ import type { RejectedSnapshot, SnapshotCacheNote, SnapshotRejectionReason } from "../runner/index.ts";
2
2
  /** How many of the snapshots a run doesn't start from its build line lists, before it counts the rest. */
3
3
  export declare const REJECTIONS_SHOWN = 5;
4
4
  /** `count` commits, as text: `1 commit`, `24 commits`. */
@@ -1,6 +1,17 @@
1
- import { setupPhaseWords } from "../../core/index.ts";
2
- import type { DriverHints } from "../../sdk/extension/index.ts";
3
- import type { TestEvent } from "../../sdk/run/launcher.ts";
1
+ import { type SetupPhaseName, setupPhaseWords } from "../core/index.ts";
2
+ import type { DriverHints } from "../sdk/extension/index.ts";
3
+ import type { TestEvent } from "../sdk/run/launcher.ts";
4
+ /** One finished, successful setup phase as the setup summary counts it. */
5
+ export interface SetupPhaseTiming {
6
+ readonly label: string;
7
+ readonly resource: string;
8
+ readonly ms: number;
9
+ readonly warmupMs?: number | undefined;
10
+ }
11
+ /** A test event, optionally tagged with the 0-based runner sandbox index that emitted it. */
12
+ export type SandboxTaggedTestEvent = TestEvent & {
13
+ readonly sandbox?: number | undefined;
14
+ };
4
15
  /**
5
16
  * What the summary says about the tests, a line apiece: `tests`, the totals and how busy the workers were;
6
17
  * `setups`, a line for each resource's setup phases under each label (`setupsText`); `slowest`, the slowest files;
@@ -21,7 +32,7 @@ export interface TestsSummary {
21
32
  * driver (`hints`), and counts the workers' test attempts instead. `unreadable` counts the lines in the test events
22
33
  * file that held none; `incomplete` is why the final read of the test events failed, when it did.
23
34
  */
24
- export declare function testsSummaryLines(events: readonly TestEvent[], hints: Pick<DriverHints, "noFinalResults">, unreadable?: number, incomplete?: string): string[];
35
+ export declare function testsSummaryLines(events: readonly SandboxTaggedTestEvent[], hints: Pick<DriverHints, "noFinalResults">, unreadable?: number, incomplete?: string): string[];
25
36
  /** What the summary says when the final read of the test events failed with `message`. */
26
37
  export declare function incompleteText(message: string): string;
27
38
  /**
@@ -35,9 +46,14 @@ export declare function noFinalResultsText(hint: string): string;
35
46
  * What the summary says about the tests, from `events`, of which `unreadable` lines held none, and `incomplete`, why the
36
47
  * final read of the test events file failed. `hints` are the run's driver's, for a run with no final result.
37
48
  */
38
- export declare function testsSummary(events: readonly TestEvent[], hints: Pick<DriverHints, "noFinalResults">, unreadable?: number, incomplete?: string): TestsSummary;
49
+ export declare function testsSummary(events: readonly SandboxTaggedTestEvent[], hints: Pick<DriverHints, "noFinalResults">, unreadable?: number, incomplete?: string): TestsSummary;
39
50
  /**
40
51
  * How the setup phases in `events` are worded, every view's alike (`setupPhaseWords`): by label, and with the
41
52
  * resource beside it where two resources' phases share one.
42
53
  */
43
- export declare function setupWordsOf(events: readonly TestEvent[]): ReturnType<typeof setupPhaseWords>;
54
+ export declare function setupWordsOf(events: readonly SandboxTaggedTestEvent[]): ReturnType<typeof setupPhaseWords>;
55
+ /**
56
+ * Formats one summary line per resource and setup label from finished, successful setup phases (`phases`), disambiguated
57
+ * against all setup phases (`allPhases`), with each group's share of `testMs` when non-zero.
58
+ */
59
+ export declare function formatSetupPhases(phases: readonly SetupPhaseTiming[], allPhases: readonly SetupPhaseName[], testMs: number): string[];