@cnc-tools/storm 0.14.2 → 0.16.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 (414) 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-2MAD5NKK.js +108 -0
  5. package/dist/chunks/{chunk-HDL4WKIB.js → chunk-3L52KNQA.js} +2 -2
  6. package/dist/chunks/{chunk-GSC6SRTW.js → chunk-5CCP36QQ.js} +1 -1
  7. package/dist/chunks/{chunk-43MWZLJR.js → chunk-5VXBKPW6.js} +1 -1
  8. package/dist/chunks/chunk-7EENF73W.js +782 -0
  9. package/dist/chunks/{chunk-RA4L2ACU.js → chunk-AWBSONHB.js} +88 -34
  10. package/dist/chunks/chunk-CK2GZEPK.js +40 -0
  11. package/dist/chunks/{chunk-BRUIATTR.js → chunk-CN4EFA5J.js} +59 -12
  12. package/dist/chunks/{chunk-I7AN3DIJ.js → chunk-DC2CDHNK.js} +1928 -738
  13. package/dist/chunks/{chunk-UUBZTGLV.js → chunk-DWEAHX4T.js} +140 -130
  14. package/dist/chunks/{chunk-T6AZIDZD.js → chunk-F6N34UWB.js} +12 -244
  15. package/dist/chunks/chunk-FCQUJDA4.js +963 -0
  16. package/dist/chunks/{chunk-VH2POPW5.js → chunk-FOZWA52V.js} +635 -79
  17. package/dist/chunks/{chunk-XZCDA5PE.js → chunk-G3PHMXH5.js} +7 -2
  18. package/dist/chunks/{chunk-3HBPNQ4Y.js → chunk-HVNK3I45.js} +2 -2
  19. package/dist/chunks/chunk-OIY3DMF2.js +74 -0
  20. package/dist/chunks/{chunk-GJOEPJJL.js → chunk-P357TZAY.js} +446 -52
  21. package/dist/chunks/{chunk-UC6DULWY.js → chunk-R7XVBZOY.js} +130 -39
  22. package/dist/chunks/chunk-TJNFVNKR.js +246 -0
  23. package/dist/chunks/{chunk-RUPD4TLT.js → chunk-V4IKA3WI.js} +198 -63
  24. package/dist/chunks/{chunk-BW2ADH7U.js → chunk-VUPZH7J2.js} +1 -1
  25. package/dist/chunks/{chunk-LUOHJ3LB.js → chunk-Z5PBVG3Y.js} +1131 -468
  26. package/dist/chunks/{chunk-GQIL3AHY.js → chunk-ZG3WQ4UF.js} +1 -1
  27. package/dist/chunks/{live-app-SZGEILCQ.js → live-app-WECQOQ4C.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 +230 -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 +583 -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 +533 -73
  46. package/dist/commands/exec/outcomes.js +203 -67
  47. package/dist/commands/exec/plan-only.d.ts +10 -0
  48. package/dist/commands/exec/plan-only.js +45 -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 +42 -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 +344 -63
  60. package/dist/commands/exec/run-command.js +312 -263
  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 +53 -10
  74. package/dist/commands/runs/facts.js +60 -32
  75. package/dist/commands/runs/list/command.d.ts +82 -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 +41 -2
  79. package/dist/commands/runs/logs/command.d.ts +109 -10
  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 +52 -3
  84. package/dist/commands/runs/logs/outcomes.js +110 -6
  85. package/dist/commands/runs/past-run.d.ts +91 -11
  86. package/dist/commands/runs/past-run.js +149 -9
  87. package/dist/commands/runs/show/command.d.ts +574 -12
  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 +279 -6
  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 +5 -1
  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 +163 -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 +1395 -0
  113. package/dist/commands/test/command.js +581 -0
  114. package/dist/commands/test/metadata.js +8 -0
  115. package/dist/commands/test/outcomes.d.ts +768 -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 +125 -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 +15 -0
  124. package/dist/config/check-runner.js +79 -0
  125. package/dist/config/check-suites.d.ts +14 -0
  126. package/dist/config/check-suites.js +100 -0
  127. package/dist/config/gateways.d.ts +31 -3
  128. package/dist/config/index.d.ts +8 -6
  129. package/dist/config/index.js +5 -4
  130. package/dist/config/live/config-gateway.js +5 -2
  131. package/dist/config/live/file-lists-file-gateway.d.ts +4 -0
  132. package/dist/config/live/file-lists-file-gateway.js +27 -0
  133. package/dist/config/load.d.ts +32 -14
  134. package/dist/config/load.js +162 -116
  135. package/dist/config/resolve.d.ts +3 -2
  136. package/dist/config/resolve.js +6 -3
  137. package/dist/config/resolver.d.ts +20 -6
  138. package/dist/config/resolver.js +11 -8
  139. package/dist/config/runner.d.ts +23 -0
  140. package/dist/config/runner.js +4 -0
  141. package/dist/config/schema.d.ts +39 -19
  142. package/dist/config/schema.js +50 -10
  143. package/dist/config/settings-file.d.ts +9 -3
  144. package/dist/config/settings-file.js +41 -4
  145. package/dist/config/suite.d.ts +39 -0
  146. package/dist/config/suite.js +5 -0
  147. package/dist/config/typed-options.d.ts +1 -6
  148. package/dist/config/typed-options.js +2 -10
  149. package/dist/config-file/define.d.ts +45 -24
  150. package/dist/config-file/define.js +9 -8
  151. package/dist/config-file/runner.d.ts +11 -0
  152. package/dist/config-file/runner.js +9 -0
  153. package/dist/config-file/toolchain.d.ts +13 -7
  154. package/dist/config-file/toolchain.js +51 -35
  155. package/dist/context.d.ts +12 -8
  156. package/dist/context.js +9 -3
  157. package/dist/core/across-sandboxes.d.ts +43 -0
  158. package/dist/core/across-sandboxes.js +319 -0
  159. package/dist/core/before-run.d.ts +5 -3
  160. package/dist/core/before-run.js +12 -1
  161. package/dist/core/events.d.ts +62 -6
  162. package/dist/core/events.js +14 -0
  163. package/dist/core/index.d.ts +4 -2
  164. package/dist/core/index.js +3 -1
  165. package/dist/core/payload.d.ts +2 -1
  166. package/dist/core/payload.js +2 -1
  167. package/dist/core/presentations.js +1 -1
  168. package/dist/core/resource.d.ts +1 -1
  169. package/dist/core/resources.d.ts +56 -6
  170. package/dist/core/resources.js +81 -5
  171. package/dist/core/run-state.js +9 -0
  172. package/dist/core/run.d.ts +77 -15
  173. package/dist/core/run.js +150 -86
  174. package/dist/core/sandbox-end.d.ts +64 -0
  175. package/dist/core/sandbox-end.js +128 -0
  176. package/dist/core/timeline.d.ts +4 -4
  177. package/dist/core/timeline.js +3 -3
  178. package/dist/credential/live/vercel-cli-gateway.d.ts +7 -0
  179. package/dist/credential/live/vercel-cli-gateway.js +14 -1
  180. package/dist/extensions/github/context.d.ts +1 -1
  181. package/dist/extensions/github/definition.d.ts +11 -9
  182. package/dist/extensions/github/definition.js +8 -6
  183. package/dist/extensions/github/extension.d.ts +3 -3
  184. package/dist/extensions/github/fixture-repo.d.ts +21 -2
  185. package/dist/extensions/github/fixture-repo.js +31 -2
  186. package/dist/extensions/github/index.d.ts +2 -2
  187. package/dist/extensions/github/index.js +2 -2
  188. package/dist/extensions/github/lifecycle.d.ts +16 -6
  189. package/dist/extensions/github/lifecycle.js +42 -25
  190. package/dist/extensions/github/options.d.ts +17 -11
  191. package/dist/extensions/github/options.js +14 -13
  192. package/dist/extensions/github/refusals.d.ts +23 -6
  193. package/dist/extensions/github/refusals.js +34 -12
  194. package/dist/extensions/github/resource.d.ts +21 -12
  195. package/dist/extensions/github/resource.js +16 -8
  196. package/dist/extensions/github/run/payload.d.ts +6 -6
  197. package/dist/extensions/github/run/payload.js +3 -5
  198. package/dist/extensions/github/split.d.ts +10 -0
  199. package/dist/extensions/github/split.js +12 -0
  200. package/dist/extensions/playwright/driver.js +6 -26
  201. package/dist/extensions/playwright/extension.js +1 -1
  202. package/dist/extensions/testserver/commands/pool/create/command.js +8 -8
  203. package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
  204. package/dist/extensions/testserver/definition.d.ts +4 -4
  205. package/dist/extensions/testserver/definition.js +41 -31
  206. package/dist/extensions/testserver/extension.d.ts +4 -5
  207. package/dist/extensions/testserver/extension.js +14 -41
  208. package/dist/extensions/testserver/index.d.ts +1 -1
  209. package/dist/extensions/testserver/index.js +1 -1
  210. package/dist/extensions/testserver/lifecycle.d.ts +10 -2
  211. package/dist/extensions/testserver/lifecycle.js +29 -6
  212. package/dist/extensions/testserver/options/rules.d.ts +5 -5
  213. package/dist/extensions/testserver/options/rules.js +10 -8
  214. package/dist/extensions/testserver/options/sandboxes.d.ts +4 -2
  215. package/dist/extensions/testserver/options/sandboxes.js +8 -3
  216. package/dist/extensions/testserver/pool/gateways.d.ts +29 -4
  217. package/dist/extensions/testserver/pool/index.d.ts +2 -2
  218. package/dist/extensions/testserver/pool/index.js +1 -1
  219. package/dist/extensions/testserver/pool/lease.d.ts +10 -0
  220. package/dist/extensions/testserver/pool/lease.js +21 -0
  221. package/dist/extensions/testserver/pool/live/pool-store-gateway.js +38 -3
  222. package/dist/extensions/testserver/refusals.d.ts +12 -0
  223. package/dist/extensions/testserver/refusals.js +18 -0
  224. package/dist/extensions/testserver/release.d.ts +16 -0
  225. package/dist/extensions/testserver/release.js +56 -4
  226. package/dist/extensions/testserver/resource.d.ts +6 -6
  227. package/dist/extensions/testserver/resource.js +3 -3
  228. package/dist/extensions/testserver/split.d.ts +9 -0
  229. package/dist/extensions/testserver/split.js +22 -0
  230. package/dist/extensions/testserver/vitest/fixtures.d.ts +5 -5
  231. package/dist/extensions/testserver/vitest/fixtures.js +9 -38
  232. package/dist/extensions/vitest/driver.d.ts +7 -0
  233. package/dist/extensions/vitest/driver.js +33 -37
  234. package/dist/extensions/vitest/extension.js +1 -1
  235. package/dist/extensions/vitest/plan/plan-over.d.ts +8 -1
  236. package/dist/extensions/vitest/plan/plan-over.js +16 -2
  237. package/dist/extensions.d.ts +17 -16
  238. package/dist/extensions.js +5 -4
  239. package/dist/forward-sigterm.js +1 -1
  240. package/dist/launcher-resolvers/local-services.d.ts +1 -1
  241. package/dist/live-app.js +4 -3
  242. package/dist/local-services.js +1 -1
  243. package/dist/planning/driver-file-lists.d.ts +61 -0
  244. package/dist/planning/driver-file-lists.js +66 -0
  245. package/dist/{commands/exec → planning}/driver-refusals.d.ts +11 -10
  246. package/dist/{commands/exec → planning}/driver-refusals.js +18 -14
  247. package/dist/planning/file-lists-file.d.ts +58 -0
  248. package/dist/planning/file-lists-file.js +105 -0
  249. package/dist/planning/file-lists.d.ts +28 -0
  250. package/dist/planning/file-lists.js +52 -0
  251. package/dist/{commands/exec → planning}/final-results.d.ts +1 -1
  252. package/dist/{commands/exec → planning}/final-results.js +6 -6
  253. package/dist/planning/plan-only.d.ts +84 -0
  254. package/dist/planning/plan-only.js +86 -0
  255. package/dist/{commands/exec → planning}/redaction.d.ts +2 -2
  256. package/dist/{commands/exec → planning}/redaction.js +5 -4
  257. package/dist/{commands/exec → planning}/resource-flags.d.ts +5 -12
  258. package/dist/{commands/exec → planning}/resource-flags.js +6 -16
  259. package/dist/planning/run-kind-flags.d.ts +20 -0
  260. package/dist/planning/run-kind-flags.js +48 -0
  261. package/dist/planning/run-plan.d.ts +29 -0
  262. package/dist/planning/run-plan.js +4 -0
  263. package/dist/planning/sandbox-placeholders.d.ts +22 -0
  264. package/dist/planning/sandbox-placeholders.js +60 -0
  265. package/dist/planning/suite-not-found.d.ts +37 -0
  266. package/dist/planning/suite-not-found.js +36 -0
  267. package/dist/planning/suites.d.ts +43 -0
  268. package/dist/planning/suites.js +89 -0
  269. package/dist/{commands/exec → planning}/test-plan.d.ts +8 -3
  270. package/dist/{commands/exec → planning}/test-plan.js +32 -5
  271. package/dist/playwright/reporter.d.ts +20 -8
  272. package/dist/playwright/reporter.js +195 -15
  273. package/dist/presentation.d.ts +10 -6
  274. package/dist/presentation.js +13 -15
  275. package/dist/run-directory/gateways.d.ts +60 -4
  276. package/dist/run-directory/index.d.ts +4 -4
  277. package/dist/run-directory/index.js +2 -1
  278. package/dist/run-directory/live/run-directory-gateway.js +92 -16
  279. package/dist/run-directory/plan.d.ts +35 -2
  280. package/dist/run-directory/plan.js +44 -7
  281. package/dist/run-directory/reader.d.ts +26 -5
  282. package/dist/run-directory/reader.js +24 -1
  283. package/dist/run-directory/recording.d.ts +75 -49
  284. package/dist/run-directory/recording.js +214 -28
  285. package/dist/run-directory/run-directory.d.ts +22 -1
  286. package/dist/run-directory/run-directory.js +24 -0
  287. package/dist/run-directory/run-record.d.ts +144 -21
  288. package/dist/run-directory/run-record.js +118 -19
  289. package/dist/run-directory/timeline-facts.js +4 -4
  290. package/dist/runner/base.d.ts +0 -6
  291. package/dist/runner/base.js +0 -15
  292. package/dist/runner/build-snapshots.d.ts +7 -7
  293. package/dist/runner/build-snapshots.js +19 -24
  294. package/dist/runner/events.d.ts +29 -8
  295. package/dist/runner/gateways.d.ts +54 -6
  296. package/dist/runner/index.d.ts +6 -4
  297. package/dist/runner/index.js +3 -2
  298. package/dist/runner/live/sandbox-gateway.js +173 -31
  299. package/dist/runner/network-policy.d.ts +55 -0
  300. package/dist/runner/network-policy.js +46 -0
  301. package/dist/runner/policy-writes.d.ts +40 -0
  302. package/dist/runner/policy-writes.js +124 -0
  303. package/dist/runner/prepare.d.ts +16 -16
  304. package/dist/runner/prepare.js +11 -12
  305. package/dist/runner/ready.d.ts +39 -10
  306. package/dist/runner/ready.js +59 -47
  307. package/dist/runner/recipe-check.d.ts +6 -0
  308. package/dist/runner/recipe-check.js +29 -0
  309. package/dist/runner/recipe-secrets.d.ts +67 -0
  310. package/dist/runner/recipe-secrets.js +230 -0
  311. package/dist/runner/recipe.d.ts +151 -63
  312. package/dist/runner/recipe.js +277 -200
  313. package/dist/runner/sandboxed-command.d.ts +22 -8
  314. package/dist/runner/sandboxed-command.js +33 -10
  315. package/dist/runner/scope.d.ts +107 -21
  316. package/dist/runner/scope.js +274 -54
  317. package/dist/runner/secrets.d.ts +42 -31
  318. package/dist/runner/secrets.js +62 -40
  319. package/dist/runner/session.d.ts +59 -26
  320. package/dist/runner/session.js +82 -41
  321. package/dist/runner/snapshot-build.d.ts +8 -5
  322. package/dist/runner/snapshot-build.js +56 -29
  323. package/dist/runner/snapshot-choice.d.ts +37 -0
  324. package/dist/runner/snapshot-choice.js +38 -0
  325. package/dist/runner/snapshot-inspect.d.ts +4 -4
  326. package/dist/runner/snapshot-inspect.js +7 -7
  327. package/dist/runner/snapshot-key.d.ts +27 -17
  328. package/dist/runner/snapshot-key.js +51 -26
  329. package/dist/runner/steps.d.ts +13 -5
  330. package/dist/runner/steps.js +34 -4
  331. package/dist/runner/time-limit.d.ts +10 -0
  332. package/dist/runner/time-limit.js +43 -0
  333. package/dist/sdk/extension/commands.d.ts +1 -7
  334. package/dist/sdk/extension/driver.d.ts +39 -46
  335. package/dist/sdk/extension/driver.js +6 -6
  336. package/dist/sdk/extension/index.d.ts +3 -3
  337. package/dist/sdk/extension/index.js +3 -4
  338. package/dist/sdk/extension/lifecycle.d.ts +52 -9
  339. package/dist/sdk/extension/lifecycle.js +1 -1
  340. package/dist/sdk/extension/resource-definition.d.ts +16 -12
  341. package/dist/sdk/extension/resource-definition.js +10 -4
  342. package/dist/sdk/extension/resource-factory.js +3 -4
  343. package/dist/sdk/extension/resource.d.ts +2 -2
  344. package/dist/sdk/extension/secret-source.d.ts +58 -0
  345. package/dist/sdk/extension/secret-source.js +78 -0
  346. package/dist/sdk/index.d.ts +2 -2
  347. package/dist/sdk/index.js +1 -1
  348. package/dist/sdk/run/launcher.d.ts +1 -1
  349. package/dist/sdk/run/launcher.js +1 -1
  350. package/dist/sdk/run/payload.d.ts +16 -1
  351. package/dist/sdk/run/payload.js +17 -2
  352. package/dist/sdk/run/present.d.ts +3 -3
  353. package/dist/sdk/run/present.js +1 -3
  354. package/dist/sdk/run/redact.js +2 -2
  355. package/dist/sdk/run/test-events.d.ts +23 -6
  356. package/dist/sdk/run/test-events.js +6 -4
  357. package/dist/sdk/run/test-result-writer.d.ts +8 -3
  358. package/dist/sdk/run/test-result-writer.js +22 -2
  359. package/dist/{commands/exec → shared}/cleanup.d.ts +3 -3
  360. package/dist/{commands/exec → shared}/cleanup.js +11 -6
  361. package/dist/shared/job-summary.d.ts +19 -0
  362. package/dist/{commands/exec → shared}/job-summary.js +17 -0
  363. package/dist/shared/sandbox-table.d.ts +48 -0
  364. package/dist/shared/sandbox-table.js +109 -0
  365. package/dist/{commands/exec → shared}/snapshot-text.d.ts +1 -1
  366. package/dist/{commands/exec → shared}/tests-summary.d.ts +22 -6
  367. package/dist/{commands/exec → shared}/tests-summary.js +74 -31
  368. package/dist/{commands/exec → shared}/text.d.ts +7 -2
  369. package/dist/{commands/exec → shared}/text.js +9 -1
  370. package/dist/{commands/exec → shared}/waterfall.d.ts +8 -6
  371. package/dist/{commands/exec → shared}/waterfall.js +71 -24
  372. package/dist/shared/worker-chart.d.ts +172 -0
  373. package/dist/shared/worker-chart.js +623 -0
  374. package/dist/vitest/config.d.ts +35 -11
  375. package/dist/vitest/config.js +47 -14
  376. package/dist/vitest/index.d.ts +1 -1
  377. package/dist/vitest/index.js +3 -3
  378. package/dist/vitest/sequencer.d.ts +23 -0
  379. package/dist/vitest/sequencer.js +73 -0
  380. package/dist/vitest/setup.d.ts +1 -0
  381. package/dist/vitest/setup.js +34 -0
  382. package/dist/vitest/test-events.d.ts +32 -6
  383. package/dist/vitest/test-events.js +25 -5
  384. package/dist/vitest/test-results.d.ts +8 -3
  385. package/dist/vitest/test-results.js +6 -0
  386. package/package.json +7 -2
  387. package/skills/overview.md +23 -17
  388. package/skills/plan-runs.md +67 -0
  389. package/skills/read-run-output.md +51 -19
  390. package/dist/chunks/chunk-E3QU74NX.js +0 -49
  391. package/dist/chunks/chunk-HP54VHGY.js +0 -201
  392. package/dist/chunks/chunk-NMVODY3P.js +0 -19
  393. package/dist/chunks/chunk-TVMEKVOW.js +0 -607
  394. package/dist/commands/exec/define-run-command.d.ts +0 -671
  395. package/dist/commands/exec/define-run-command.js +0 -91
  396. package/dist/commands/exec/job-summary.d.ts +0 -10
  397. package/dist/commands/exec/worker-chart.d.ts +0 -87
  398. package/dist/commands/exec/worker-chart.js +0 -343
  399. package/dist/commands/playwright/command.d.ts +0 -661
  400. package/dist/commands/playwright/command.js +0 -31
  401. package/dist/commands/playwright/metadata.js +0 -8
  402. package/dist/commands/vitest/command.d.ts +0 -662
  403. package/dist/commands/vitest/command.js +0 -31
  404. package/dist/commands/vitest/metadata.js +0 -8
  405. package/dist/config/recipe-run.d.ts +0 -26
  406. package/dist/config/recipe-run.js +0 -27
  407. package/dist/sdk/extension/ci.d.ts +0 -2
  408. package/dist/sdk/extension/ci.js +0 -6
  409. package/dist/chunks/{chunk-YM6TZV4L.js → chunk-VL7WFTVQ.js} +52 -52
  410. package/dist/commands/{playwright → suites}/metadata.d.ts +1 -1
  411. package/dist/commands/{vitest → test}/metadata.d.ts +1 -1
  412. /package/dist/{commands → shared}/dashboard.d.ts +0 -0
  413. /package/dist/{commands → shared}/dashboard.js +0 -0
  414. /package/dist/{commands/exec → shared}/snapshot-text.js +0 -0
@@ -1,65 +1,95 @@
1
+ import {
2
+ fileListMismatchText,
3
+ fileListMismatches,
4
+ testPlanText,
5
+ waterfallLines,
6
+ workerLaneNotes,
7
+ workerLanes,
8
+ workerLanesFromRecords,
9
+ workerParallelism,
10
+ workerSetupMs
11
+ } from "../../../chunks/chunk-FCQUJDA4.js";
12
+ import "../../../chunks/chunk-DWEAHX4T.js";
13
+ import "../../../chunks/chunk-R7XVBZOY.js";
14
+ import "../../../chunks/chunk-CN4EFA5J.js";
15
+ import {
16
+ builtAtText
17
+ } from "../../../chunks/chunk-3L52KNQA.js";
18
+ import "../../../chunks/chunk-ZG3WQ4UF.js";
19
+ import "../../../chunks/chunk-5CCP36QQ.js";
1
20
  import {
2
21
  LOG_STEPS,
3
22
  commandText,
23
+ deduplicateTestErrors,
4
24
  exitText,
5
25
  exitTone,
6
26
  finalResults,
7
27
  gitText,
8
28
  keptText,
9
29
  newestFinished,
30
+ ofSandbox,
31
+ parseWorkerFlag,
10
32
  runFacts,
11
33
  runFactsSchema,
12
34
  runNotFound,
13
35
  runScope,
14
36
  runsInScope,
15
37
  runsUnreadable,
38
+ sandboxDidNotPass,
39
+ sandboxIndexesText,
16
40
  scopeFacts,
17
41
  scopeSchema,
18
42
  selected,
43
+ sortBySlowest,
19
44
  startedText,
45
+ testFiles,
46
+ testTimings,
20
47
  tookText,
48
+ totalAttemptMs,
21
49
  totalsText,
22
50
  totalsTone
23
- } from "../../../chunks/chunk-RUPD4TLT.js";
51
+ } from "../../../chunks/chunk-V4IKA3WI.js";
24
52
  import {
25
- bold,
26
- capsFor,
27
- paint
28
- } from "../../../chunks/chunk-T6AZIDZD.js";
29
- import {
30
- testPlanText,
31
- waterfallLines
32
- } from "../../../chunks/chunk-TVMEKVOW.js";
53
+ capsFor
54
+ } from "../../../chunks/chunk-TJNFVNKR.js";
33
55
  import {
34
- builtAtText
35
- } from "../../../chunks/chunk-HDL4WKIB.js";
36
- import "../../../chunks/chunk-UUBZTGLV.js";
37
- import "../../../chunks/chunk-UC6DULWY.js";
38
- import "../../../chunks/chunk-BRUIATTR.js";
39
- import "../../../chunks/chunk-NMVODY3P.js";
56
+ SANDBOX_TABLE_HEADER,
57
+ sandboxCauseText,
58
+ sandboxPage,
59
+ sandboxStateText,
60
+ sandboxTableRows,
61
+ sandboxesPassedText,
62
+ sandboxesText,
63
+ startedSandboxesText
64
+ } from "../../../chunks/chunk-2MAD5NKK.js";
40
65
  import {
41
66
  pastRuns,
42
67
  planSchema,
68
+ sandboxRecordSchema,
43
69
  timelineSchema
44
- } from "../../../chunks/chunk-GJOEPJJL.js";
70
+ } from "../../../chunks/chunk-P357TZAY.js";
45
71
  import {
72
+ seconds,
46
73
  short
47
- } from "../../../chunks/chunk-XZCDA5PE.js";
74
+ } from "../../../chunks/chunk-G3PHMXH5.js";
75
+ import {
76
+ bold,
77
+ paint,
78
+ stripAnsi
79
+ } from "../../../chunks/chunk-F6N34UWB.js";
48
80
  import {
49
81
  megabytesText
50
- } from "../../../chunks/chunk-VH2POPW5.js";
82
+ } from "../../../chunks/chunk-FOZWA52V.js";
51
83
  import {
52
84
  findConfigFile
53
- } from "../../../chunks/chunk-I7AN3DIJ.js";
54
- import "../../../chunks/chunk-RA4L2ACU.js";
55
- import "../../../chunks/chunk-GQIL3AHY.js";
56
- import "../../../chunks/chunk-GSC6SRTW.js";
85
+ } from "../../../chunks/chunk-DC2CDHNK.js";
86
+ import "../../../chunks/chunk-AWBSONHB.js";
57
87
  import {
58
88
  stormCommands
59
- } from "../../../chunks/chunk-43MWZLJR.js";
89
+ } from "../../../chunks/chunk-5VXBKPW6.js";
60
90
  import {
61
91
  defineOutcomes
62
- } from "../../../chunks/chunk-YM6TZV4L.js";
92
+ } from "../../../chunks/chunk-VL7WFTVQ.js";
63
93
 
64
94
  // src/commands/runs/show/command.ts
65
95
  import { z as z2 } from "zod";
@@ -67,57 +97,277 @@ import { z as z2 } from "zod";
67
97
  // src/commands/runs/show/outcomes.ts
68
98
  import { z } from "zod";
69
99
  var testSchema = z.object({
70
- /** Vitest's id for the test, unique within the run. */
100
+ /** The test runner's id for the test, unique within the run. */
71
101
  id: z.string(),
72
102
  /** The test file, relative to the project. */
73
103
  file: z.string(),
74
104
  /** The test's full name. */
75
105
  test: z.string(),
106
+ /**
107
+ * The runner sandbox index of the runner sandbox that ran it, in a run across runner sandboxes; null in any other
108
+ * run.
109
+ */
110
+ sandbox: z.number().nullable(),
76
111
  /** How it finally ended. */
77
112
  state: z.enum(["pass", "fail", "skip"]),
113
+ /** Sum of the durations of the test's attempts, its `test-attempt-finished` events by `id`, in milliseconds; null when none was recorded. */
114
+ durationMs: z.number().nullable(),
115
+ /** Worker index (from 0; `w0` is 0) that ran the test's last attempt; null when the run has no attempt of it. */
116
+ worker: z.number().nullable(),
78
117
  /** How many times it was retried. */
79
118
  retryCount: z.number(),
80
- /** Whether it passed on a retry. */
119
+ /** Passed after failing an earlier attempt. */
81
120
  flaky: z.boolean(),
82
- /** Its errors: a failed test's, or a flaky pass's retries'. */
121
+ /** Whether `--failed`, `--test`, or `--worker` selected it, so its test output is filled in. */
122
+ selected: z.boolean(),
123
+ /** Deduplicated errors reported by the test runner across attempts, with ANSI escapes stripped and occurrence counts. */
83
124
  errors: z.array(
84
- z.object({ name: z.string(), message: z.string(), stack: z.string().nullable(), diff: z.string().nullable() })
125
+ z.object({
126
+ name: z.string(),
127
+ message: z.string(),
128
+ stack: z.string().nullable(),
129
+ diff: z.string().nullable(),
130
+ occurrences: z.number().int().min(1)
131
+ })
85
132
  ),
86
- /** Whether --failed or --test selected it. */
87
- selected: z.boolean(),
133
+ /** Console output captured for this test, with ANSI escapes stripped; null unless selected and the test printed something. */
134
+ output: z.object({ text: z.string(), droppedChars: z.number() }).nullable()
135
+ });
136
+ var workerFileSchema = z.object({
137
+ /** The test file, relative to the project. */
138
+ file: z.string(),
139
+ /** When the file started, in milliseconds since the run started. */
140
+ startMs: z.number(),
141
+ /** When the file finished, in milliseconds since the run started. */
142
+ endMs: z.number(),
143
+ /** File duration in milliseconds (`endMs - startMs`). */
144
+ durationMs: z.number()
145
+ });
146
+ var workerSetupSchema = z.object({
147
+ /** What the worker set up, as the phase's writer worded it. */
148
+ label: z.string(),
149
+ /** The resource that owns the setup, by its name. */
150
+ resource: z.string(),
151
+ /** When the setup started, in milliseconds since the run started. */
152
+ startMs: z.number(),
153
+ /** When the setup (and any warmup) finished, in milliseconds since the run started. */
154
+ endMs: z.number(),
155
+ /** Total span duration in milliseconds (`endMs - startMs`). */
156
+ durationMs: z.number(),
157
+ /** The setup's own duration excluding warmup when finished; null for an unfinished setup. */
158
+ setupMs: z.number().nullable(),
159
+ /** Warmup duration after the setup when reported; null otherwise. */
160
+ warmupMs: z.number().nullable(),
161
+ /** Whether the setup succeeded. */
162
+ ok: z.boolean()
163
+ });
164
+ var workerSummarySchema = z.object({
165
+ /** Worker index (from 0; `w0` is 0). */
166
+ worker: z.number(),
167
+ /** When the worker started its first file, in milliseconds since the run started. */
168
+ startMs: z.number(),
169
+ /** When the worker finished its last file, in milliseconds since the run started. */
170
+ endMs: z.number(),
171
+ /** Total wall duration of this worker (`endMs - startMs`). */
172
+ durationMs: z.number(),
173
+ /** Total merged setup duration on this worker, in milliseconds. */
174
+ setupMs: z.number(),
175
+ /** Distinct tests started on this worker. */
176
+ tests: z.number(),
177
+ /** Files this worker ran, in order. */
178
+ files: z.array(workerFileSchema),
179
+ /** Setup phases on this worker. */
180
+ setups: z.array(workerSetupSchema)
181
+ });
182
+ var parallelismSchema = z.object({
183
+ /** Total observed workers. */
184
+ workerCount: z.number(),
185
+ /** Wall duration of the `command` row, in milliseconds. */
186
+ testsWallMs: z.number(),
187
+ /** Total active test-running worker time (excluding setup spans), in milliseconds. */
188
+ totalActiveMs: z.number(),
189
+ /** Average active worker concurrency (`totalActiveMs / testsWallMs`). */
190
+ avgConcurrency: z.number(),
191
+ /** Peak concurrent active test-running workers (excluding setup spans). */
192
+ peakConcurrency: z.number(),
193
+ /** Wall time from the second-to-last worker's finish to the last worker's finish, in milliseconds. */
194
+ singleWorkerTailMs: z.number(),
195
+ /** Total test attempt time recorded across workers, in milliseconds. */
196
+ attemptMs: z.number(),
197
+ /** The worker that finished last and held up the run's completion. */
198
+ waitedOn: z.object({
199
+ /** Worker index (from 0; `w0` is 0). */
200
+ worker: z.number(),
201
+ /** Longest file on this worker (tie-breaking to the last file). */
202
+ file: z.string(),
203
+ /** Duration of that file, in milliseconds. */
204
+ fileDurationMs: z.number(),
205
+ /** How many files this worker ran. */
206
+ fileCount: z.number(),
207
+ /** Total wall duration of this worker, in milliseconds. */
208
+ durationMs: z.number(),
209
+ /** Total merged setup duration on this worker, in milliseconds. */
210
+ setupMs: z.number()
211
+ })
212
+ });
213
+ var logSchema = z.object({ step: z.enum(LOG_STEPS), path: z.string() });
214
+ var fileSchema = z.object({
215
+ /** The test file, relative to the project. */
216
+ file: z.string(),
217
+ /** The runner sandbox index of the runner sandbox that ran it; null in any other run. */
218
+ sandbox: z.number().nullable(),
219
+ /** When its first file-started test event says a worker started it, as an ISO time; null without one. */
220
+ startedAt: z.string().nullable(),
221
+ /** When its last file-finished test event says a worker finished it, as an ISO time; null without one. */
222
+ finishedAt: z.string().nullable(),
223
+ /** From startedAt to finishedAt, in milliseconds; null when either is. */
224
+ ms: z.number().nullable(),
225
+ /** How many of its tests' final results passed, failed, and were skipped; each 0 when it reported none. */
226
+ tests: z.object({ passed: z.number(), failed: z.number(), skipped: z.number() })
227
+ });
228
+ var runnerSandboxEntrySchema = z.object({
229
+ /** The runner sandbox index. */
230
+ sandbox: z.number(),
231
+ /** The runner sandbox entry, sandboxes/<runner sandbox index>/ in the run directory. */
232
+ path: z.string(),
233
+ /** The run logs it holds: its command log (`command`) and its step logs, each with its path. */
234
+ logs: z.array(logSchema),
235
+ /** The runner sandbox's waterfall, as its timeline.json holds it; null when it has none storm can read. */
236
+ timeline: timelineSchema.nullable(),
88
237
  /**
89
- * Its test output, for a selected test that printed any: the last characters of what it printed (`text`) and how
90
- * many earlier ones were dropped (`droppedChars`); null otherwise.
238
+ * The parallelism summary across the runner sandbox's workers in its `command` row, from its own test events; null
239
+ * when it has no worker events or no `command` row.
91
240
  */
92
- output: z.object({ text: z.string(), droppedChars: z.number() }).nullable()
241
+ parallelism: parallelismSchema.nullable(),
242
+ /**
243
+ * Each of the runner sandbox's workers, by its worker index from 0 within the runner sandbox, sorted by finish time
244
+ * descending; empty when it has no worker events or no `command` row.
245
+ */
246
+ workers: z.array(workerSummarySchema)
247
+ });
248
+ var shownSandboxSchema = sandboxRecordSchema.extend({
249
+ /**
250
+ * The last lines of the runner sandbox's command log, with ANSI escape sequences stripped, for a runner sandbox that
251
+ * is not passed; empty otherwise. Null when --failed leaves it out: the runner sandbox's command failed and its
252
+ * failed tests say why.
253
+ */
254
+ tail: z.array(z.string()).readonly().nullable()
93
255
  });
94
256
  var shownSchema = runFactsSchema.extend({
95
- /** A `storm vitest` or `storm playwright` run's test plan, as its `ran` result carried it; null for a run that counted no tests, such as `storm exec`'s, or when unknown. */
257
+ /** The driver that ran the tests (`vitest`, `playwright`); null for a `storm exec` run or a past run recorded without one. */
258
+ driver: z.string().nullable(),
259
+ /** The suite name for a `storm test` run; null for the project's tests, `storm exec`, or a past run recorded without one. */
260
+ suite: z.string().nullable(),
261
+ /**
262
+ * For a run across runner sandboxes, one runner sandbox record for each runner sandbox, as its `run.json` holds them,
263
+ * in order of runner sandbox index, each pending until its runner sandbox ends. Null for any other run, or when
264
+ * unknown.
265
+ */
266
+ sandboxes: z.array(shownSandboxSchema).nullable(),
267
+ /** A `storm test` run's test plan, as its `ran` result carried it; null for a run that counted no tests, such as `storm exec`'s, or when unknown. */
96
268
  plan: planSchema.nullable(),
97
269
  /** Whether the run finished, so its test results were saved. */
98
270
  finished: z.boolean(),
99
- /** The run logs it has, which `storm runs logs <id> --step <step>` prints: the command log (`command`) and each step's. */
100
- logs: z.array(z.object({ step: z.enum(LOG_STEPS), path: z.string() })),
271
+ /**
272
+ * The run logs it has, which `storm runs logs <id> --step <step>` prints: the command log (`command`) and each
273
+ * step's. A run across runner sandboxes has no command log of its own.
274
+ */
275
+ logs: z.array(logSchema),
101
276
  /** How many lines of its tests.jsonl held no test event. */
102
277
  unreadableTestLines: z.number(),
103
- /** Its waterfall, as its timeline.json holds it; null when it has none storm can read. */
278
+ /**
279
+ * Its waterfall, as its timeline.json holds it; null when it has none storm can read, as for a run across runner
280
+ * sandboxes, whose runner sandbox entries hold one each.
281
+ */
104
282
  timeline: timelineSchema.nullable(),
105
- /** The tests --failed and --test select. */
106
- selection: z.object({ failed: z.boolean(), test: z.string().nullable() }),
107
- /** Each test's final result, in the order the run reported them. */
108
- tests: z.array(testSchema)
283
+ /** How the waterfall renders workers under the `command` row: `"sparkline"` by default, or `"lanes"` with `--workers`. */
284
+ workerView: z.enum(["sparkline", "lanes"]),
285
+ /** Whether the test list was sorted slowest-first (`--slowest`). */
286
+ slowest: z.boolean(),
287
+ /** Intra-sandbox parallelism summary across workers in the `command` row; null when no worker events or `command` row exist. */
288
+ parallelism: parallelismSchema.nullable(),
289
+ /** Per-worker execution summaries, sorted by finish time descending; empty when no worker events or `command` row exist. */
290
+ workers: z.array(workerSummarySchema),
291
+ /**
292
+ * For a run across runner sandboxes, each runner sandbox entry in its run directory, in order of runner sandbox
293
+ * index, only --sandbox's with --sandbox; null for any other run.
294
+ */
295
+ sandboxEntries: z.array(runnerSandboxEntrySchema).nullable(),
296
+ /** The selection flags applied to this view: --failed, --summary, --test, --worker, and --sandbox. */
297
+ selection: z.object({
298
+ failed: z.boolean(),
299
+ summary: z.boolean(),
300
+ test: z.string().nullable(),
301
+ worker: z.number().nullable(),
302
+ sandbox: z.number().nullable()
303
+ }),
304
+ /** Total final test results in the selected runner sandbox (or whole run) before --failed or --test filtering. */
305
+ totalTests: z.number(),
306
+ /**
307
+ * Each test's final result, in the order the run reported them; filtered by --sandbox, --failed, --test, and --worker, sorted
308
+ * slowest-first with --slowest, and empty with --summary.
309
+ */
310
+ tests: z.array(testSchema),
311
+ /**
312
+ * Each test file its test events name, ordered by runner sandbox index, then by path: the runner sandbox that ran
313
+ * it, its time from its file-started and file-finished test events, and the counts of its tests' final results by
314
+ * state; only --sandbox's with --sandbox.
315
+ */
316
+ files: z.array(fileSchema),
317
+ /**
318
+ * For a finished run across runner sandboxes whose runner sandboxes have file lists, each runner sandbox whose
319
+ * reported test files differ from its list; empty when every runner sandbox reported its list, or before the run
320
+ * finishes; null for any other run.
321
+ */
322
+ fileListMismatches: z.array(z.object({ sandbox: z.number(), missing: z.array(z.string()), extra: z.array(z.string()) })).nullable()
109
323
  });
110
324
  var outcomes = defineOutcomes({
111
325
  results: {
112
326
  shown: {
113
327
  schema: shownSchema,
114
- description: "The run, its waterfall, and its tests, with the selected tests' errors and test output.",
328
+ description: "The run, its waterfall, its runner sandboxes, its test files, and its tests, with the selected tests' errors and test output.",
115
329
  render: (shown) => shownRendered(shown)
116
330
  }
117
331
  },
118
332
  errors: {
119
333
  runsUnreadable,
120
334
  runNotFound,
335
+ unknownSandbox: {
336
+ exitCode: 2,
337
+ description: "The run has no runner sandbox with the runner sandbox index given to --sandbox, or the run is not a run across runner sandboxes.",
338
+ schema: z.object({
339
+ /** The run id. */
340
+ id: z.string(),
341
+ /** The runner sandbox index asked for. */
342
+ sandbox: z.number(),
343
+ /** The run's runner sandbox indexes; empty for any other run. */
344
+ sandboxes: z.array(z.number())
345
+ }),
346
+ render: ({ id, sandbox, sandboxes }) => ({
347
+ message: sandboxes.length === 0 ? `Can't use --sandbox with run ${id}. It is not a run across runner sandboxes.` : `Can't show runner sandbox ${sandbox} of run ${id}. It has ${sandboxesText(sandboxes.length)}: ${sandboxIndexesText(sandboxes)}.`,
348
+ next: [{ type: "command", argv: ["storm", "runs", "show", id], label: "Show the whole run" }]
349
+ })
350
+ },
351
+ workerNeedsSandbox: {
352
+ exitCode: 2,
353
+ description: "--worker on a run across runner sandboxes without --sandbox: each runner sandbox has its own worker indexes, so a worker index names no one worker.",
354
+ schema: z.object({
355
+ /** The run id. */
356
+ id: z.string(),
357
+ /** The worker index asked for. */
358
+ worker: z.number(),
359
+ /** The run's runner sandbox indexes. */
360
+ sandboxes: z.array(z.number())
361
+ }),
362
+ render: ({ id, worker, sandboxes }) => ({
363
+ message: `Can't use --worker without --sandbox on run ${id}. Each of its ${sandboxesText(sandboxes.length)} has its own worker indexes, so w${worker} can name a worker in each of them.`,
364
+ next: sandboxes.map((sandbox) => ({
365
+ type: "command",
366
+ argv: ["storm", "runs", "show", id, "--sandbox", String(sandbox), "--worker", `w${worker}`],
367
+ label: `Show the tests that ran on worker w${worker} of runner sandbox ${sandbox}`
368
+ }))
369
+ })
370
+ },
121
371
  noRuns: {
122
372
  exitCode: 1,
123
373
  description: "Without an id, no run in the scope has finished.",
@@ -136,17 +386,21 @@ var outcomes = defineOutcomes({
136
386
  ]
137
387
  } : {
138
388
  message: "Couldn't find a finished run.",
139
- next: [{ type: "text", text: "Start one with storm vitest or storm exec." }]
389
+ next: [{ type: "text", text: "Start one with storm test or storm exec." }]
140
390
  }
141
391
  }
142
392
  }
143
393
  });
144
394
  var WATERFALL_WIDTH = 80;
145
395
  var LABEL_WIDTH = 16;
146
- var NO_PAINT = { tone: (_intent, text) => text, strong: (text) => text };
396
+ var NO_PAINT = { colorDepth: "none", tone: (_intent, text) => text, strong: (text) => text };
147
397
  function painterFor(caps) {
148
398
  if (caps.colorDepth === "none") return NO_PAINT;
149
- return { tone: (intent, text) => text === "" ? text : paint(caps, intent, text), strong: (text) => bold(text) };
399
+ return {
400
+ colorDepth: caps.colorDepth,
401
+ tone: (intent, text) => text === "" ? text : paint(caps, intent, text),
402
+ strong: (text) => bold(text)
403
+ };
150
404
  }
151
405
  function shownRendered(shown) {
152
406
  return {
@@ -157,8 +411,10 @@ function shownRendered(shown) {
157
411
  function shownText(shown, p) {
158
412
  const exitColor = exitTone(shown);
159
413
  const totalsColor = totalsTone(shown);
160
- const exit = exitText(shown);
414
+ const exit = `${exitText(shown)}${shown.sandboxes === null || shown.active || shown.ended === null ? "" : sandboxesPassedText(shown.sandboxes)}`;
161
415
  const totals = totalsText(shown);
416
+ const expectsTests = shown.driver !== null;
417
+ const showTestsRow = expectsTests || shown.totalTests > 0 || shown.ended !== null && shown.ended.tests !== null;
162
418
  const facts = [
163
419
  ["Run", shown.id],
164
420
  ["Command", commandText(shown)],
@@ -169,65 +425,98 @@ function shownText(shown, p) {
169
425
  ["Started", startedText(shown)],
170
426
  ["Took", tookText(shown)],
171
427
  ["Exit", exitColor === void 0 ? exit : { text: exit, tone: exitColor }],
172
- ["Tests", totalsColor === void 0 ? totals : { text: totals, tone: totalsColor }],
428
+ ...showTestsRow ? [["Tests", totalsColor === void 0 ? totals : { text: totals, tone: totalsColor }]] : [],
173
429
  ["Run directory", `${shown.path}/`],
174
430
  ...logsRows(shown)
175
431
  ];
176
432
  const blocks = [rowLines(facts, p)];
177
433
  const where = [...whereRows(shown), ...shown.ended?.resourceRows ?? []];
178
434
  if (where.length > 0) blocks.push(rowLines(where, p));
179
- if (shown.timeline !== null && shown.timeline.rows.length > 0)
180
- blocks.push(waterfallLines(shown.timeline, { width: WATERFALL_WIDTH, logs: void 0 }));
181
435
  const note = (text) => [` ${p.tone("muted", text)}`];
182
- if (!shown.finished) {
183
- blocks.push(
184
- note(
185
- shown.active ? "The run is still going. Its test results are saved once it finishes." : "The run didn't finish, so its test results weren't saved."
186
- )
187
- );
188
- return joinBlocks(blocks);
189
- }
190
- const { failed, test } = shown.selection;
191
- const selecting = failed || test !== null;
192
- const chosen = shown.tests.filter((each) => each.selected);
193
- if (shown.tests.length === 0) blocks.push(note("No final test results."));
194
- else if (!selecting) blocks.push(testTable(shown.tests, p));
195
- else if (chosen.length > 0)
436
+ const { sandboxes } = shown;
437
+ const { failed, summary, test, worker } = shown.selection;
438
+ const sandboxChosen = (sandbox) => shown.selection.sandbox === null || shown.selection.sandbox === sandbox;
439
+ if (sandboxes !== null) {
196
440
  blocks.push([
197
- ...testTable(chosen, p),
198
- ` ${p.tone("muted", `${chosen.length} of ${shown.tests.length} ${shown.tests.length === 1 ? "test" : "tests"}`)}`
441
+ ...sandboxTable(sandboxes, p),
442
+ ...(shown.fileListMismatches ?? []).map((mismatch) => ` ${p.tone("warn", fileListMismatchText(mismatch))}`)
199
443
  ]);
200
- if (shown.unreadableTestLines > 0)
201
- blocks.push(note(`${shown.unreadableTestLines} lines of tests.jsonl held no test event.`));
202
- const incomplete = shown.ended?.testsIncomplete ?? null;
203
- if (incomplete !== null)
444
+ if (!summary) {
445
+ const waterfallSandboxes = sandboxes.filter(
446
+ ({ sandbox, state }) => sandboxChosen(sandbox) && (!failed || state !== "passed")
447
+ );
448
+ for (const each of waterfallSandboxes)
449
+ blocks.push(sandboxWaterfall(each, shown.sandboxEntries ?? [], shown.workerView, p));
450
+ }
451
+ } else if (!summary && shown.timeline !== null && shown.timeline.rows.length > 0) {
452
+ blocks.push(timelineWaterfall(shown.timeline, shown, shown.workerView, p));
453
+ }
454
+ if (summary) return joinBlocks(blocks);
455
+ if (!shown.finished) {
204
456
  blocks.push(
205
457
  note(
206
- `The test results may be incomplete: storm couldn't read the test events file once the command ended: ${incomplete}`
458
+ shown.active ? "The run is still going. Its test results are saved once it finishes." : "The run didn't finish, so its test results weren't saved."
207
459
  )
208
460
  );
209
- if (selecting) {
210
- if (chosen.length === 0)
461
+ } else {
462
+ const selecting = failed || test !== null || worker !== null;
463
+ const chosen = shown.tests.filter((each) => each.selected);
464
+ const acrossSandboxes = sandboxes !== null;
465
+ if (shown.totalTests === 0) {
466
+ if (expectsTests) blocks.push(note("No final test results."));
467
+ } else if (!selecting) blocks.push(testTable(shown.tests, acrossSandboxes, p));
468
+ else if (chosen.length > 0)
469
+ blocks.push([
470
+ ...testTable(chosen, acrossSandboxes, p),
471
+ ` ${p.tone("muted", `${chosen.length} of ${shown.totalTests} ${shown.totalTests === 1 ? "test" : "tests"}`)}`
472
+ ]);
473
+ if (shown.unreadableTestLines > 0)
474
+ blocks.push(note(`${shown.unreadableTestLines} lines of tests.jsonl held no test event.`));
475
+ const incomplete = shown.ended?.testsIncomplete ?? null;
476
+ if (incomplete !== null)
211
477
  blocks.push(
212
478
  note(
213
- failed && test === null ? "No test failed." : `No ${failed ? "failed " : ""}test's name or file holds ${JSON.stringify(test)}.`
479
+ `The test results may be incomplete: storm couldn't read the test events file once the command ended: ${incomplete}`
214
480
  )
215
481
  );
216
- for (const each of chosen) blocks.push(testSection(each, p));
482
+ if (selecting) {
483
+ if (chosen.length === 0) blocks.push(note(emptySelectionText(shown.selection)));
484
+ for (const each of chosen) blocks.push(testSection(each, p));
485
+ }
486
+ }
487
+ if (failed && sandboxes !== null) {
488
+ const unpassed = sandboxes.filter(
489
+ ({ sandbox, state }) => sandboxChosen(sandbox) && sandboxDidNotPass(state, shown.active)
490
+ );
491
+ if (unpassed.length === 0 && shown.finished)
492
+ blocks.push(
493
+ note(shown.selection.sandbox === null ? "Every runner sandbox passed." : "The runner sandbox passed.")
494
+ );
495
+ for (const each of unpassed) blocks.push(sandboxSection(shown, each, p));
217
496
  }
218
497
  return joinBlocks(blocks);
219
498
  }
499
+ function emptySelectionText({ failed, test, worker }) {
500
+ const kind = failed ? "failed " : "";
501
+ if (worker !== null) {
502
+ if (test === null) return `No ${kind}test ran on worker w${worker}.`;
503
+ return `No ${kind}test on worker w${worker} holds ${JSON.stringify(test)}.`;
504
+ }
505
+ if (failed && test === null) return "No test failed.";
506
+ return `No ${kind}test's name or file holds ${JSON.stringify(test)}.`;
507
+ }
220
508
  function logsRows(shown) {
221
509
  if (shown.logs.length === 0) return [];
222
510
  const width = Math.max(...shown.logs.map(({ step }) => step.length));
223
511
  return [["Logs", shown.logs.map(({ step }) => `${step.padEnd(width)} storm runs logs ${shown.id} --step ${step}`)]];
224
512
  }
225
513
  function rowLines(rows, p) {
514
+ const width = Math.max(LABEL_WIDTH, ...rows.map(([label]) => label.length + 2));
226
515
  return rows.flatMap(([label, value]) => {
227
516
  const [first = "", ...rest] = isLineList(value) ? value : [value];
228
- const gutter = ` ${" ".repeat(LABEL_WIDTH)}`;
517
+ const gutter = ` ${" ".repeat(width)}`;
229
518
  return [
230
- ` ${p.tone("muted", label)}${" ".repeat(Math.max(0, LABEL_WIDTH - label.length))}${lineText(first, p)}`,
519
+ ` ${p.tone("muted", label)}${" ".repeat(width - label.length)}${lineText(first, p)}`,
231
520
  ...rest.map((line) => `${gutter}${lineText(line, p)}`)
232
521
  ];
233
522
  });
@@ -243,13 +532,13 @@ function lineText(line, p) {
243
532
  function whereRows(shown) {
244
533
  const { where, ended } = shown;
245
534
  if (where === null) return [];
246
- if (where.kind === "unsandboxed") return [["Ran on", "this machine"]];
535
+ if (where.kind === "launch-machine") return [["Ran on", "this machine"]];
247
536
  const shape = `${where.region}, ${where.vcpus} vCPUs, ${where.runtime}`;
248
- const sandbox = where.sandbox !== null ? `runner sandbox ${where.sandbox} (${shape})` : ended === null ? `runner sandbox (${shape})` : `runner sandbox, none started (${shape})`;
537
+ const sandbox = shown.sandboxes !== null ? `${startedSandboxesText(shown.sandboxes, ended !== null)} (${shape})` : where.sandbox !== null ? `runner sandbox ${where.sandbox} (${shape})` : ended === null ? `runner sandbox (${shape})` : `runner sandbox, none started (${shape})`;
249
538
  const { snapshot } = where;
250
539
  return [
251
540
  ["Ran in", sandbox],
252
- ...where.sandboxUrl === null ? [] : [["Sandbox page", where.sandboxUrl]],
541
+ ...where.sandboxUrl === null ? [] : [["Runner sandbox page", where.sandboxUrl]],
253
542
  ...keptRows(shown),
254
543
  ["Vercel project", `${where.team}/${where.project}`],
255
544
  ["Merge-base", `${short(where.base)}, of HEAD and ${where.baseRef}`],
@@ -272,44 +561,121 @@ function snapshotCommitLines(snapshot, mergeBase) {
272
561
  }
273
562
  function keptRows(shown) {
274
563
  const kept = keptText(shown);
275
- if (kept === void 0 || shown.where?.kind !== "runner") return [];
564
+ if (kept === void 0 || shown.where?.kind !== "vercel-sandbox") return [];
276
565
  const { sandboxUrl, keptMinutesLeft } = shown.where;
277
566
  if (sandboxUrl === null || keptMinutesLeft === null || keptMinutesLeft === 0)
278
- return [["Sandbox kept", { text: kept, tone: "muted" }]];
279
- return [["Sandbox kept", [{ text: kept, tone: "success" }, `connect: ${sandboxUrl}/connect`]]];
567
+ return [["Runner sandbox kept", { text: kept, tone: "muted" }]];
568
+ return [["Runner sandbox kept", [{ text: kept, tone: "success" }, `connect: ${sandboxUrl}/connect`]]];
280
569
  }
281
570
  var STATE_TONES = { pass: "success", fail: "error", skip: "muted" };
282
- function testTable(tests, p) {
283
- const header = ["STATE", "RETRIES", "FLAKY", "FILE", "TEST"];
571
+ function tableLines(header, rows, p, paintCell) {
572
+ const widths = header.map((_, column) => Math.max(...[header, ...rows].map((row) => row[column]?.length ?? 0)));
573
+ const line = (cells, paintOne) => ` ${cells.map(
574
+ (cell, column) => column === cells.length - 1 ? paintOne(cell, column) : `${paintOne(cell, column)}${" ".repeat((widths[column] ?? 0) - cell.length)}`
575
+ ).join(" ")}`.trimEnd();
576
+ return [
577
+ line(header, (cell) => p.strong(cell)),
578
+ ...rows.map((cells, row) => line(cells, (cell, column) => paintCell(cell, row, column)))
579
+ ];
580
+ }
581
+ function testTable(tests, acrossSandboxes, p) {
582
+ const lead = acrossSandboxes ? 1 : 0;
284
583
  const rows = tests.map((each) => [
584
+ ...acrossSandboxes ? [each.sandbox === null ? "-" : String(each.sandbox)] : [],
285
585
  each.state,
586
+ each.durationMs === null ? "-" : seconds(each.durationMs),
286
587
  String(each.retryCount),
287
588
  each.flaky ? "yes" : "no",
288
589
  each.file,
289
590
  each.test
290
591
  ]);
291
- const widths = header.map((_, column) => Math.max(...[header, ...rows].map((row) => row[column]?.length ?? 0)));
292
- const line = (cells, paintCell) => ` ${cells.map(
293
- (cell2, column) => column === cells.length - 1 ? paintCell(cell2, column) : `${paintCell(cell2, column)}${" ".repeat((widths[column] ?? 0) - cell2.length)}`
294
- ).join(" ")}`.trimEnd();
295
- return [
296
- line(header, (cell2) => p.strong(cell2)),
297
- ...tests.map(
298
- (each, index) => line(
299
- rows[index] ?? [],
300
- (cell2, column) => column === 0 ? p.tone(STATE_TONES[each.state], cell2) : column === 2 && each.flaky ? p.tone("warn", cell2) : cell2
592
+ const header = [...acrossSandboxes ? ["RUNNER SANDBOX"] : [], "STATE", "TOOK", "RETRIES", "FLAKY", "FILE", "TEST"];
593
+ return tableLines(header, rows, p, (cell, row, column) => {
594
+ const test = tests[row];
595
+ if (test === void 0) return cell;
596
+ if (column === lead) return p.tone(STATE_TONES[test.state], cell);
597
+ if (column === lead + 1 && test.durationMs === null) return p.tone("muted", cell);
598
+ return column === lead + 3 && test.flaky ? p.tone("warn", cell) : cell;
599
+ });
600
+ }
601
+ var SANDBOX_TONES = {
602
+ passed: "success",
603
+ failed: "error",
604
+ "not-started": "error",
605
+ canceled: "warn",
606
+ pending: "muted"
607
+ };
608
+ function sandboxTable(sandboxes, p) {
609
+ return tableLines(SANDBOX_TABLE_HEADER, sandboxTableRows(sandboxes), p, (cell, row, column) => {
610
+ const sandbox = sandboxes[row];
611
+ return column === 1 && sandbox !== void 0 ? p.tone(SANDBOX_TONES[sandbox.state], cell) : cell;
612
+ });
613
+ }
614
+ function sandboxWaterfall(sandbox, entries, workerView, p) {
615
+ const heading = p.strong(`runner sandbox ${sandbox.sandbox}`);
616
+ const entry = entries.find((each) => each.sandbox === sandbox.sandbox);
617
+ const timeline = entry?.timeline ?? null;
618
+ if (entry === void 0 || timeline === null || timeline.rows.length === 0)
619
+ return [heading, ` ${p.tone("muted", "No timeline.")}`];
620
+ return [heading, ...timelineWaterfall(timeline, entry, workerView, p)];
621
+ }
622
+ function timelineWaterfall(timeline, workers, workerView, p) {
623
+ const lanes = workerLanesFromRecords(workers.workers);
624
+ const details = lanes.length > 0 && workerView === "lanes" ? workerLaneNotes(lanes, workers.parallelism?.attemptMs ?? 0) : [];
625
+ return waterfallLines(timeline, {
626
+ width: WATERFALL_WIDTH,
627
+ colorDepth: p.colorDepth,
628
+ logs: void 0,
629
+ ...lanes.length === 0 ? {} : { workers: lanes, workerView },
630
+ ...details.length === 0 ? {} : { details }
631
+ });
632
+ }
633
+ function sandboxSection(shown, sandbox, p) {
634
+ const { where } = shown;
635
+ const logs = shown.sandboxEntries?.find((entry) => entry.sandbox === sandbox.sandbox)?.logs ?? [];
636
+ const width = Math.max(0, ...logs.map(({ step }) => step.length));
637
+ const rows = [
638
+ ...sandbox.failedStage === null ? [] : [["Failed stage", sandbox.failedStage]],
639
+ ["Cause", sandboxCauseText(sandbox)],
640
+ ["Command", commandText({ argv: sandbox.argv })],
641
+ [
642
+ "Runner sandbox",
643
+ sandbox.name === null ? { text: "none started", tone: "muted" } : where?.kind === "vercel-sandbox" ? [sandbox.name, ` ${sandboxPage(where, sandbox.name)}`] : sandbox.name
644
+ ],
645
+ [
646
+ "Logs",
647
+ logs.length === 0 ? { text: "none", tone: "muted" } : logs.map(
648
+ ({ step }) => `${step.padEnd(width)} storm runs logs ${shown.id} --sandbox ${sandbox.sandbox} --step ${step}`
301
649
  )
302
- )
650
+ ]
651
+ ];
652
+ const lines = [
653
+ `${p.tone(SANDBOX_TONES[sandbox.state], sandboxStateText(sandbox.state))}${p.strong(` \xB7 runner sandbox ${sandbox.sandbox}`)}`,
654
+ ...rowLines(rows, p)
655
+ ];
656
+ if (sandbox.tail === null) return lines;
657
+ if (sandbox.tail.length === 0)
658
+ return sandbox.state === "failed" || sandbox.state === "canceled" ? [...lines, ` ${p.tone("muted", "no command output")}`] : lines;
659
+ const last = sandbox.tail.length === 1 ? "last line" : `last ${sandbox.tail.length} lines`;
660
+ return [
661
+ ...lines,
662
+ ` ${p.tone("muted", `the command log's ${last}:`)}`,
663
+ ...sandbox.tail.map((line) => line === "" ? "" : ` ${line}`)
303
664
  ];
304
665
  }
305
666
  function testSection(test, p) {
306
667
  const retried = test.retryCount === 0 ? "" : ` \xB7 retried ${test.retryCount}${test.flaky ? ", flaky" : ""}`;
668
+ const sandbox = test.sandbox === null ? "" : ` \xB7 runner sandbox ${test.sandbox}`;
307
669
  const lines = [
308
- `${p.tone(STATE_TONES[test.state], test.state)}${p.strong(` \xB7 ${test.file} \xB7 ${test.test}${retried}`)}`
670
+ `${p.tone(STATE_TONES[test.state], test.state)}${p.strong(`${sandbox} \xB7 ${test.file} \xB7 ${test.test}${retried}`)}`
309
671
  ];
310
672
  for (const error of test.errors) {
311
673
  const [first = "", ...rest] = error.message.replace(/\n+$/, "").split("\n");
312
- lines.push(` ${p.tone("error", `${error.name}: ${first}`)}`, ...indented(rest.join("\n"), 4));
674
+ const repeat = error.occurrences > 1 ? ` (${error.occurrences} occurrences)` : "";
675
+ lines.push(
676
+ ` ${p.tone("error", `${error.name}: ${first}`)}${repeat === "" ? "" : p.tone("muted", repeat)}`,
677
+ ...indented(rest.join("\n"), 4)
678
+ );
313
679
  if (error.stack !== null)
314
680
  lines.push(` ${p.tone("muted", "stack:")}`, ...indented(error.stack, 4).map((line) => p.tone("muted", line)));
315
681
  if (error.diff !== null)
@@ -340,11 +706,30 @@ var command_default = stormCommands.define({
340
706
  requestSchema: z2.object({
341
707
  id: z2.string().min(1).optional(),
342
708
  failed: z2.boolean().default(false),
709
+ summary: z2.boolean().default(false),
343
710
  test: z2.string().min(1).optional(),
711
+ workers: z2.boolean().default(false),
712
+ worker: z2.string().optional(),
713
+ slowest: z2.boolean().default(false),
714
+ sandbox: z2.number().int().min(0).optional(),
344
715
  all: z2.boolean().default(false)
345
716
  }),
346
717
  cli: { positionals: ["id"] },
347
718
  response: outcomes,
719
+ validate: (request) => [
720
+ ...request.worker !== void 0 && parseWorkerFlag(request.worker) === void 0 ? [
721
+ {
722
+ field: "worker",
723
+ message: `--worker takes a worker index from 0 such as 0 or w0, not ${JSON.stringify(request.worker)}.`
724
+ }
725
+ ] : [],
726
+ ...request.summary && (request.failed || request.test !== void 0 || request.worker !== void 0) ? [
727
+ {
728
+ field: "summary",
729
+ message: "--summary omits tests and timelines, and can't be combined with --failed, --test, or --worker."
730
+ }
731
+ ] : []
732
+ ],
348
733
  handler: async ({ app }, request) => {
349
734
  const now = app.context.clock.now();
350
735
  const runs = pastRuns(app.context.runDirectories);
@@ -361,39 +746,169 @@ var command_default = stormCommands.define({
361
746
  if (read.kind === "failed") return outcomes.runsUnreadable({ ...read.failure });
362
747
  if (read.kind === "not-found") return outcomes.runNotFound({ id });
363
748
  const { run } = read;
364
- const filters = { failed: request.failed, test: request.test };
365
- const selecting = request.failed || request.test !== void 0;
749
+ const sandboxRecords = run.record?.sandboxes;
750
+ if (request.sandbox !== void 0 && !(sandboxRecords ?? []).some(({ sandbox }) => sandbox === request.sandbox))
751
+ return outcomes.unknownSandbox({
752
+ id,
753
+ sandbox: request.sandbox,
754
+ sandboxes: (sandboxRecords ?? []).map(({ sandbox }) => sandbox)
755
+ });
756
+ const workerFilter = request.worker === void 0 ? void 0 : parseWorkerFlag(request.worker);
757
+ if (workerFilter !== void 0 && sandboxRecords !== void 0 && request.sandbox === void 0)
758
+ return outcomes.workerNeedsSandbox({
759
+ id,
760
+ worker: workerFilter,
761
+ sandboxes: sandboxRecords.map(({ sandbox }) => sandbox)
762
+ });
763
+ const filters = { failed: request.failed, test: request.test, worker: workerFilter };
764
+ const selecting = request.failed || request.test !== void 0 || workerFilter !== void 0;
366
765
  const plan = run.record?.plan;
367
- return outcomes.shown({
368
- ...runFacts(run, now),
369
- plan: plan === void 0 ? null : { ...plan, options: plan.options.map((option) => ({ ...option })) },
370
- finished: run.finished,
371
- logs: LOG_STEPS.flatMap((step) => run.logs.filter(({ log }) => log === step).map(({ path }) => ({ step, path }))),
372
- unreadableTestLines: run.unreadableTestLines,
373
- timeline: run.timeline ?? null,
374
- selection: { failed: request.failed, test: request.test ?? null },
375
- tests: finalResults(run.events).map((result) => {
376
- const chosen = selecting && selected(result, filters);
377
- return {
766
+ const events = ofSandbox(run.events, request.sandbox);
767
+ const shownRun = runFacts(run, now);
768
+ const whole = run.unreadableTestLines === 0 && (shownRun.ended?.testsIncomplete ?? null) === null;
769
+ const mismatches = sandboxRecords === void 0 ? null : !run.finished ? [] : fileListMismatches(
770
+ sandboxRecords.map((record) => ({
771
+ sandbox: record.sandbox,
772
+ files: record.files,
773
+ exitCode: record.exitCode,
774
+ reported: run.events.filter((event) => event.sandbox === record.sandbox).map((event) => event.file),
775
+ whole
776
+ }))
777
+ );
778
+ const unpassedSandboxes = new Set(
779
+ (sandboxRecords ?? []).filter(({ state }) => sandboxDidNotPass(state, run.active)).map(({ sandbox }) => sandbox)
780
+ );
781
+ const sandboxesWithFailedTests = /* @__PURE__ */ new Set();
782
+ for (const result of finalResults(run.events)) {
783
+ if (result.state === "fail" && result.sandbox !== void 0) sandboxesWithFailedTests.add(result.sandbox);
784
+ }
785
+ const cleanedSandboxes = shownRun.sandboxes === null ? null : shownRun.sandboxes.map((sandbox) => ({
786
+ ...sandbox,
787
+ tail: request.failed && sandbox.failedStage === "command" && sandboxesWithFailedTests.has(sandbox.sandbox) ? null : sandbox.tail.map(stripAnsi)
788
+ }));
789
+ const { parallelism, workers } = workerFacts(events, run.timeline);
790
+ const timings = testTimings(events);
791
+ const results = finalResults(events);
792
+ const totalTests = results.length;
793
+ const allTests = request.summary ? [] : results.flatMap((result) => {
794
+ const timing = timings.get(result.sandbox)?.get(result.id);
795
+ const testWorker = timing?.worker ?? null;
796
+ const chosen = selecting && selected(result, filters, testWorker);
797
+ if (selecting && !chosen) return [];
798
+ return [
799
+ {
378
800
  id: result.id,
379
801
  file: result.file,
380
802
  test: result.test,
803
+ sandbox: result.sandbox ?? null,
381
804
  state: result.state,
805
+ durationMs: timing?.durationMs ?? null,
806
+ worker: testWorker,
382
807
  retryCount: result.retryCount,
383
808
  flaky: result.flaky,
384
- errors: (result.errors ?? []).map((error) => ({
385
- name: error.name,
386
- message: error.message,
387
- stack: error.stack ?? null,
388
- diff: error.diff ?? null
389
- })),
809
+ errors: deduplicateTestErrors(result.errors),
390
810
  selected: chosen,
391
- output: chosen && result.output !== void 0 ? { ...result.output } : null
392
- };
393
- })
811
+ output: chosen && result.output !== void 0 ? { text: stripAnsi(result.output.text), droppedChars: result.output.droppedChars } : null
812
+ }
813
+ ];
814
+ });
815
+ const tests = request.slowest ? sortBySlowest(allTests) : allTests;
816
+ const selectedFileKeys = new Set(allTests.map((each) => `${each.sandbox ?? ""}\0${each.file}`));
817
+ const allFiles = request.summary ? [] : testFiles(events).filter((file) => !selecting || selectedFileKeys.has(`${file.sandbox ?? ""}\0${file.file}`)).map((file) => ({ ...file, tests: { ...file.tests } }));
818
+ return outcomes.shown({
819
+ ...shownRun,
820
+ driver: run.record?.driver ?? null,
821
+ suite: run.record?.suite ?? null,
822
+ sandboxes: cleanedSandboxes,
823
+ plan: plan === void 0 ? null : { ...plan, options: plan.options.map((option) => ({ ...option })) },
824
+ finished: run.finished,
825
+ logs: LOG_STEPS.flatMap((step) => run.logs.filter(({ log }) => log === step).map(({ path }) => ({ step, path }))),
826
+ unreadableTestLines: run.unreadableTestLines,
827
+ timeline: request.summary ? null : run.timeline ?? null,
828
+ workerView: request.workers ? "lanes" : "sparkline",
829
+ slowest: request.slowest,
830
+ parallelism,
831
+ workers,
832
+ sandboxEntries: request.summary || sandboxRecords === void 0 ? null : run.sandboxes.filter(
833
+ ({ sandbox }) => (request.sandbox === void 0 || sandbox === request.sandbox) && (!request.failed || unpassedSandboxes.has(sandbox))
834
+ ).map((entry) => ({
835
+ sandbox: entry.sandbox,
836
+ path: entry.path,
837
+ logs: LOG_STEPS.flatMap(
838
+ (step) => entry.logs.filter(({ log }) => log === step).map(({ path }) => ({ step, path }))
839
+ ),
840
+ timeline: entry.timeline ?? null,
841
+ ...workerFacts(ofSandbox(run.events, entry.sandbox), entry.timeline)
842
+ })),
843
+ selection: {
844
+ failed: request.failed,
845
+ summary: request.summary,
846
+ test: request.test ?? null,
847
+ worker: workerFilter ?? null,
848
+ sandbox: request.sandbox ?? null
849
+ },
850
+ totalTests,
851
+ tests,
852
+ files: allFiles,
853
+ fileListMismatches: mismatches === null ? null : mismatches.map(({ sandbox, missing, extra }) => ({ sandbox, missing: [...missing], extra: [...extra] }))
394
854
  });
395
855
  }
396
856
  });
857
+ function workerFacts(events, timeline) {
858
+ const commandRow = timeline?.rows.find((row) => row.name === "command");
859
+ if (timeline === void 0 || commandRow === void 0) return { parallelism: null, workers: [] };
860
+ const startedAt = Date.parse(timeline.startedAt);
861
+ const lanes = workerLanes(events, {
862
+ runStartedAt: Number.isNaN(startedAt) ? 0 : startedAt,
863
+ offsetMs: 0,
864
+ tests: commandRow
865
+ });
866
+ const parallelism = workerParallelism(lanes, commandRow);
867
+ const workers = [...lanes].toSorted((a, b) => b.endMs - a.endMs || a.worker - b.worker).map((lane) => ({
868
+ worker: lane.worker,
869
+ startMs: lane.startMs,
870
+ endMs: lane.endMs,
871
+ durationMs: lane.endMs - lane.startMs,
872
+ setupMs: workerSetupMs(lane),
873
+ tests: lane.tests,
874
+ files: lane.files.map((file) => ({
875
+ file: file.file,
876
+ startMs: file.startMs,
877
+ endMs: file.endMs,
878
+ durationMs: file.endMs - file.startMs
879
+ })),
880
+ setups: lane.setups.map((setup) => ({
881
+ label: setup.label,
882
+ resource: setup.resource,
883
+ startMs: setup.startMs,
884
+ endMs: setup.endMs,
885
+ durationMs: setup.endMs - setup.startMs,
886
+ setupMs: setup.setupMs ?? null,
887
+ warmupMs: setup.warmupMs ?? null,
888
+ ok: setup.ok
889
+ }))
890
+ }));
891
+ return {
892
+ parallelism: parallelism === void 0 ? null : {
893
+ workerCount: parallelism.workerCount,
894
+ testsWallMs: parallelism.testsWallMs,
895
+ totalActiveMs: parallelism.totalActiveMs,
896
+ avgConcurrency: parallelism.avgConcurrency,
897
+ peakConcurrency: parallelism.peakConcurrency,
898
+ singleWorkerTailMs: parallelism.singleWorkerTailMs,
899
+ attemptMs: totalAttemptMs(events),
900
+ waitedOn: {
901
+ worker: parallelism.waitedOn.worker,
902
+ file: parallelism.waitedOn.file,
903
+ fileDurationMs: parallelism.waitedOn.fileDurationMs,
904
+ fileCount: parallelism.waitedOn.fileCount,
905
+ durationMs: parallelism.waitedOn.durationMs,
906
+ setupMs: parallelism.waitedOn.setupMs
907
+ }
908
+ },
909
+ workers
910
+ };
911
+ }
397
912
  export {
398
913
  command_default as default
399
914
  };