@cnc-tools/storm 0.14.2 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (401) hide show
  1. package/dist/application.js +3 -1
  2. package/dist/bin/storm.js +9 -7
  3. package/dist/build-info.js +1 -1
  4. package/dist/chunks/chunk-4U4DZ7VG.js +40 -0
  5. package/dist/chunks/{chunk-GSC6SRTW.js → chunk-5CCP36QQ.js} +1 -1
  6. package/dist/chunks/chunk-5GBMR4HM.js +966 -0
  7. package/dist/chunks/{chunk-43MWZLJR.js → chunk-5VXBKPW6.js} +1 -1
  8. package/dist/chunks/{chunk-RA4L2ACU.js → chunk-AWBSONHB.js} +88 -34
  9. package/dist/chunks/{chunk-BRUIATTR.js → chunk-CN4EFA5J.js} +59 -12
  10. package/dist/chunks/{chunk-3HBPNQ4Y.js → chunk-CXAT7ZKP.js} +2 -2
  11. package/dist/chunks/chunk-E4PJNZVG.js +783 -0
  12. package/dist/chunks/{chunk-T6AZIDZD.js → chunk-F6N34UWB.js} +12 -244
  13. package/dist/chunks/{chunk-RUPD4TLT.js → chunk-KC4KDJ5K.js} +147 -26
  14. package/dist/chunks/{chunk-I7AN3DIJ.js → chunk-L36GBUBB.js} +1626 -676
  15. package/dist/chunks/{chunk-XZCDA5PE.js → chunk-OX7X4B2L.js} +7 -2
  16. package/dist/chunks/{chunk-UUBZTGLV.js → chunk-PN5ULTTH.js} +140 -130
  17. package/dist/chunks/chunk-QUHY6FGN.js +108 -0
  18. package/dist/chunks/chunk-QVS7HRU7.js +74 -0
  19. package/dist/chunks/{chunk-UC6DULWY.js → chunk-R7XVBZOY.js} +130 -39
  20. package/dist/chunks/{chunk-LUOHJ3LB.js → chunk-RAQEXKL6.js} +1120 -465
  21. package/dist/chunks/{chunk-GJOEPJJL.js → chunk-SZEURWRS.js} +446 -52
  22. package/dist/chunks/chunk-TJNFVNKR.js +246 -0
  23. package/dist/chunks/{chunk-BW2ADH7U.js → chunk-VUPZH7J2.js} +1 -1
  24. package/dist/chunks/{chunk-HDL4WKIB.js → chunk-XEVHP5ZW.js} +2 -2
  25. package/dist/chunks/{chunk-VH2POPW5.js → chunk-YV7GE6EV.js} +635 -79
  26. package/dist/chunks/{chunk-GQIL3AHY.js → chunk-ZG3WQ4UF.js} +1 -1
  27. package/dist/chunks/{live-app-SZGEILCQ.js → live-app-PI3BAN6Y.js} +28 -23
  28. package/dist/command-tree.d.ts +2 -2
  29. package/dist/command-tree.js +2 -2
  30. package/dist/commands/exec/across-sandboxes-outcomes.d.ts +364 -0
  31. package/dist/commands/exec/across-sandboxes-outcomes.js +229 -0
  32. package/dist/commands/exec/across-sandboxes-run.d.ts +180 -0
  33. package/dist/commands/exec/across-sandboxes-run.js +339 -0
  34. package/dist/commands/exec/command.d.ts +577 -75
  35. package/dist/commands/exec/command.js +165 -32
  36. package/dist/commands/exec/driver-plan.d.ts +8 -2
  37. package/dist/commands/exec/driver-plan.js +13 -3
  38. package/dist/commands/exec/exec-words.d.ts +17 -3
  39. package/dist/commands/exec/exec-words.js +27 -16
  40. package/dist/commands/exec/live-view.d.ts +3 -4
  41. package/dist/commands/exec/live-view.js +37 -28
  42. package/dist/commands/exec/metadata.js +2 -2
  43. package/dist/commands/exec/mint-failed.d.ts +4 -4
  44. package/dist/commands/exec/mint-failed.js +6 -6
  45. package/dist/commands/exec/outcomes.d.ts +530 -73
  46. package/dist/commands/exec/outcomes.js +202 -66
  47. package/dist/commands/exec/plan-only.d.ts +10 -0
  48. package/dist/commands/exec/plan-only.js +46 -0
  49. package/dist/commands/exec/plan-run.d.ts +54 -35
  50. package/dist/commands/exec/plan-run.js +81 -38
  51. package/dist/commands/exec/planned-outcome.d.ts +15 -0
  52. package/dist/commands/exec/planned-outcome.js +35 -0
  53. package/dist/commands/exec/progress.d.ts +2 -2
  54. package/dist/commands/exec/progress.js +35 -18
  55. package/dist/commands/exec/resource-refusals.d.ts +2 -2
  56. package/dist/commands/exec/resource-refusals.js +3 -3
  57. package/dist/commands/exec/run-bin.d.ts +1 -1
  58. package/dist/commands/exec/run-bin.js +2 -2
  59. package/dist/commands/exec/run-command.d.ts +345 -63
  60. package/dist/commands/exec/run-command.js +308 -258
  61. package/dist/commands/exec/run-metadata.d.ts +42 -8
  62. package/dist/commands/exec/run-metadata.js +40 -21
  63. package/dist/commands/exec/run-planned.d.ts +20 -0
  64. package/dist/commands/exec/run-planned.js +22 -0
  65. package/dist/commands/exec/sandbox-lines.d.ts +42 -0
  66. package/dist/commands/exec/sandbox-lines.js +59 -0
  67. package/dist/commands/exec/sandbox-progress.d.ts +30 -0
  68. package/dist/commands/exec/sandbox-progress.js +232 -0
  69. package/dist/commands/exec/sandbox-view.d.ts +19 -0
  70. package/dist/commands/exec/sandbox-view.js +72 -0
  71. package/dist/commands/exec/view.d.ts +3 -2
  72. package/dist/commands/exec/view.js +10 -6
  73. package/dist/commands/runs/facts.d.ts +51 -9
  74. package/dist/commands/runs/facts.js +49 -29
  75. package/dist/commands/runs/list/command.d.ts +80 -4
  76. package/dist/commands/runs/list/command.js +11 -10
  77. package/dist/commands/runs/list/metadata.js +1 -1
  78. package/dist/commands/runs/list/outcomes.d.ts +40 -2
  79. package/dist/commands/runs/logs/command.d.ts +103 -8
  80. package/dist/commands/runs/logs/command.js +139 -24
  81. package/dist/commands/runs/logs/metadata.d.ts +4 -0
  82. package/dist/commands/runs/logs/metadata.js +14 -7
  83. package/dist/commands/runs/logs/outcomes.d.ts +49 -2
  84. package/dist/commands/runs/logs/outcomes.js +110 -6
  85. package/dist/commands/runs/past-run.d.ts +77 -6
  86. package/dist/commands/runs/past-run.js +133 -4
  87. package/dist/commands/runs/show/command.d.ts +568 -10
  88. package/dist/commands/runs/show/command.js +634 -119
  89. package/dist/commands/runs/show/metadata.d.ts +17 -0
  90. package/dist/commands/runs/show/metadata.js +48 -7
  91. package/dist/commands/runs/show/outcomes.d.ts +276 -5
  92. package/dist/commands/runs/show/outcomes.js +484 -96
  93. package/dist/commands/snapshots/build/command.d.ts +109 -18
  94. package/dist/commands/snapshots/build/command.js +72 -36
  95. package/dist/commands/snapshots/build/metadata.d.ts +4 -0
  96. package/dist/commands/snapshots/build/metadata.js +5 -1
  97. package/dist/commands/snapshots/build/outcomes.d.ts +53 -8
  98. package/dist/commands/snapshots/build/outcomes.js +26 -3
  99. package/dist/commands/snapshots/list/command.d.ts +72 -7
  100. package/dist/commands/snapshots/list/command.js +57 -24
  101. package/dist/commands/snapshots/list/metadata.d.ts +4 -0
  102. package/dist/commands/snapshots/list/metadata.js +4 -0
  103. package/dist/commands/snapshots/list/outcomes.d.ts +31 -0
  104. package/dist/commands/snapshots/list/outcomes.js +25 -2
  105. package/dist/commands/suites/list/command.d.ts +129 -0
  106. package/dist/commands/suites/list/command.js +162 -0
  107. package/dist/commands/suites/list/metadata.d.ts +11 -0
  108. package/dist/commands/suites/list/metadata.js +15 -0
  109. package/dist/commands/suites/list/outcomes.d.ts +91 -0
  110. package/dist/commands/suites/list/outcomes.js +122 -0
  111. package/dist/commands/suites/metadata.js +8 -0
  112. package/dist/commands/test/command.d.ts +1389 -0
  113. package/dist/commands/test/command.js +583 -0
  114. package/dist/commands/test/metadata.js +8 -0
  115. package/dist/commands/test/outcomes.d.ts +765 -0
  116. package/dist/commands/test/outcomes.js +140 -0
  117. package/dist/commands/test/plan.d.ts +92 -0
  118. package/dist/commands/test/plan.js +128 -0
  119. package/dist/commands/test/test-words.d.ts +12 -0
  120. package/dist/commands/test/test-words.js +42 -0
  121. package/dist/config/check-resources.d.ts +14 -0
  122. package/dist/config/check-resources.js +98 -0
  123. package/dist/config/check-runner.d.ts +13 -0
  124. package/dist/config/check-runner.js +54 -0
  125. package/dist/config/check-suites.d.ts +14 -0
  126. package/dist/config/check-suites.js +99 -0
  127. package/dist/config/gateways.d.ts +24 -0
  128. package/dist/config/index.d.ts +6 -3
  129. package/dist/config/index.js +3 -1
  130. package/dist/config/live/file-lists-file-gateway.d.ts +4 -0
  131. package/dist/config/live/file-lists-file-gateway.js +27 -0
  132. package/dist/config/load.d.ts +11 -10
  133. package/dist/config/load.js +35 -103
  134. package/dist/config/recipe-run.d.ts +8 -1
  135. package/dist/config/recipe-run.js +2 -1
  136. package/dist/config/resolve.d.ts +3 -2
  137. package/dist/config/resolve.js +6 -3
  138. package/dist/config/resolver.d.ts +20 -6
  139. package/dist/config/resolver.js +11 -8
  140. package/dist/config/runner.d.ts +24 -0
  141. package/dist/config/runner.js +4 -0
  142. package/dist/config/schema.d.ts +26 -18
  143. package/dist/config/schema.js +41 -9
  144. package/dist/config/settings-file.d.ts +9 -3
  145. package/dist/config/settings-file.js +41 -4
  146. package/dist/config/suite.d.ts +39 -0
  147. package/dist/config/suite.js +5 -0
  148. package/dist/config-file/define.d.ts +49 -18
  149. package/dist/config-file/define.js +9 -8
  150. package/dist/config-file/runner.d.ts +12 -0
  151. package/dist/config-file/runner.js +9 -0
  152. package/dist/context.d.ts +12 -8
  153. package/dist/context.js +9 -3
  154. package/dist/core/across-sandboxes.d.ts +43 -0
  155. package/dist/core/across-sandboxes.js +319 -0
  156. package/dist/core/before-run.d.ts +5 -3
  157. package/dist/core/before-run.js +12 -1
  158. package/dist/core/events.d.ts +62 -6
  159. package/dist/core/events.js +14 -0
  160. package/dist/core/index.d.ts +4 -2
  161. package/dist/core/index.js +3 -1
  162. package/dist/core/payload.d.ts +2 -1
  163. package/dist/core/payload.js +2 -1
  164. package/dist/core/presentations.js +1 -1
  165. package/dist/core/resource.d.ts +1 -1
  166. package/dist/core/resources.d.ts +56 -6
  167. package/dist/core/resources.js +81 -5
  168. package/dist/core/run-state.js +9 -0
  169. package/dist/core/run.d.ts +77 -15
  170. package/dist/core/run.js +150 -86
  171. package/dist/core/sandbox-end.d.ts +64 -0
  172. package/dist/core/sandbox-end.js +128 -0
  173. package/dist/core/timeline.d.ts +4 -4
  174. package/dist/core/timeline.js +3 -3
  175. package/dist/credential/live/vercel-cli-gateway.d.ts +7 -0
  176. package/dist/credential/live/vercel-cli-gateway.js +14 -1
  177. package/dist/extensions/github/context.d.ts +1 -1
  178. package/dist/extensions/github/definition.d.ts +11 -9
  179. package/dist/extensions/github/definition.js +8 -6
  180. package/dist/extensions/github/extension.d.ts +3 -3
  181. package/dist/extensions/github/fixture-repo.d.ts +21 -2
  182. package/dist/extensions/github/fixture-repo.js +31 -2
  183. package/dist/extensions/github/index.d.ts +2 -2
  184. package/dist/extensions/github/index.js +2 -2
  185. package/dist/extensions/github/lifecycle.d.ts +16 -6
  186. package/dist/extensions/github/lifecycle.js +42 -25
  187. package/dist/extensions/github/options.d.ts +17 -11
  188. package/dist/extensions/github/options.js +14 -13
  189. package/dist/extensions/github/refusals.d.ts +23 -6
  190. package/dist/extensions/github/refusals.js +34 -12
  191. package/dist/extensions/github/resource.d.ts +21 -12
  192. package/dist/extensions/github/resource.js +16 -8
  193. package/dist/extensions/github/run/payload.d.ts +6 -6
  194. package/dist/extensions/github/run/payload.js +3 -5
  195. package/dist/extensions/github/split.d.ts +10 -0
  196. package/dist/extensions/github/split.js +12 -0
  197. package/dist/extensions/playwright/driver.js +6 -26
  198. package/dist/extensions/playwright/extension.js +1 -1
  199. package/dist/extensions/testserver/commands/pool/create/command.js +8 -8
  200. package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
  201. package/dist/extensions/testserver/definition.d.ts +4 -4
  202. package/dist/extensions/testserver/definition.js +41 -31
  203. package/dist/extensions/testserver/extension.d.ts +4 -5
  204. package/dist/extensions/testserver/extension.js +14 -41
  205. package/dist/extensions/testserver/index.d.ts +1 -1
  206. package/dist/extensions/testserver/index.js +1 -1
  207. package/dist/extensions/testserver/lifecycle.d.ts +10 -2
  208. package/dist/extensions/testserver/lifecycle.js +29 -6
  209. package/dist/extensions/testserver/options/rules.d.ts +5 -5
  210. package/dist/extensions/testserver/options/rules.js +10 -8
  211. package/dist/extensions/testserver/options/sandboxes.d.ts +4 -2
  212. package/dist/extensions/testserver/options/sandboxes.js +8 -3
  213. package/dist/extensions/testserver/pool/gateways.d.ts +29 -4
  214. package/dist/extensions/testserver/pool/index.d.ts +2 -2
  215. package/dist/extensions/testserver/pool/index.js +1 -1
  216. package/dist/extensions/testserver/pool/lease.d.ts +10 -0
  217. package/dist/extensions/testserver/pool/lease.js +21 -0
  218. package/dist/extensions/testserver/pool/live/pool-store-gateway.js +38 -3
  219. package/dist/extensions/testserver/refusals.d.ts +12 -0
  220. package/dist/extensions/testserver/refusals.js +18 -0
  221. package/dist/extensions/testserver/release.d.ts +16 -0
  222. package/dist/extensions/testserver/release.js +56 -4
  223. package/dist/extensions/testserver/resource.d.ts +4 -4
  224. package/dist/extensions/testserver/resource.js +1 -1
  225. package/dist/extensions/testserver/split.d.ts +9 -0
  226. package/dist/extensions/testserver/split.js +22 -0
  227. package/dist/extensions/testserver/vitest/fixtures.d.ts +5 -5
  228. package/dist/extensions/testserver/vitest/fixtures.js +9 -38
  229. package/dist/extensions/vitest/driver.d.ts +7 -0
  230. package/dist/extensions/vitest/driver.js +33 -37
  231. package/dist/extensions/vitest/extension.js +1 -1
  232. package/dist/extensions/vitest/plan/plan-over.d.ts +8 -1
  233. package/dist/extensions/vitest/plan/plan-over.js +16 -2
  234. package/dist/extensions.d.ts +17 -16
  235. package/dist/extensions.js +5 -4
  236. package/dist/forward-sigterm.js +1 -1
  237. package/dist/launcher-resolvers/local-services.d.ts +1 -1
  238. package/dist/live-app.js +4 -3
  239. package/dist/local-services.js +1 -1
  240. package/dist/planning/driver-file-lists.d.ts +61 -0
  241. package/dist/planning/driver-file-lists.js +66 -0
  242. package/dist/{commands/exec → planning}/driver-refusals.d.ts +11 -10
  243. package/dist/{commands/exec → planning}/driver-refusals.js +18 -14
  244. package/dist/planning/file-lists-file.d.ts +58 -0
  245. package/dist/planning/file-lists-file.js +105 -0
  246. package/dist/planning/file-lists.d.ts +28 -0
  247. package/dist/planning/file-lists.js +52 -0
  248. package/dist/{commands/exec → planning}/final-results.d.ts +1 -1
  249. package/dist/{commands/exec → planning}/final-results.js +6 -6
  250. package/dist/planning/plan-only.d.ts +81 -0
  251. package/dist/planning/plan-only.js +83 -0
  252. package/dist/{commands/exec → planning}/redaction.d.ts +2 -2
  253. package/dist/{commands/exec → planning}/redaction.js +5 -4
  254. package/dist/{commands/exec → planning}/resource-flags.d.ts +5 -12
  255. package/dist/{commands/exec → planning}/resource-flags.js +6 -16
  256. package/dist/planning/run-kind-flags.d.ts +20 -0
  257. package/dist/planning/run-kind-flags.js +48 -0
  258. package/dist/planning/run-plan.d.ts +30 -0
  259. package/dist/planning/run-plan.js +4 -0
  260. package/dist/planning/sandbox-placeholders.d.ts +22 -0
  261. package/dist/planning/sandbox-placeholders.js +60 -0
  262. package/dist/planning/suite-not-found.d.ts +37 -0
  263. package/dist/planning/suite-not-found.js +36 -0
  264. package/dist/planning/suites.d.ts +43 -0
  265. package/dist/planning/suites.js +89 -0
  266. package/dist/{commands/exec → planning}/test-plan.d.ts +8 -3
  267. package/dist/{commands/exec → planning}/test-plan.js +32 -4
  268. package/dist/playwright/reporter.d.ts +20 -8
  269. package/dist/playwright/reporter.js +195 -15
  270. package/dist/presentation.d.ts +10 -6
  271. package/dist/presentation.js +13 -15
  272. package/dist/run-directory/gateways.d.ts +60 -4
  273. package/dist/run-directory/index.d.ts +4 -4
  274. package/dist/run-directory/index.js +2 -1
  275. package/dist/run-directory/live/run-directory-gateway.js +92 -16
  276. package/dist/run-directory/plan.d.ts +35 -2
  277. package/dist/run-directory/plan.js +44 -7
  278. package/dist/run-directory/reader.d.ts +26 -5
  279. package/dist/run-directory/reader.js +24 -1
  280. package/dist/run-directory/recording.d.ts +75 -49
  281. package/dist/run-directory/recording.js +214 -28
  282. package/dist/run-directory/run-directory.d.ts +22 -1
  283. package/dist/run-directory/run-directory.js +24 -0
  284. package/dist/run-directory/run-record.d.ts +144 -21
  285. package/dist/run-directory/run-record.js +118 -19
  286. package/dist/run-directory/timeline-facts.js +4 -4
  287. package/dist/runner/build-snapshots.d.ts +7 -7
  288. package/dist/runner/build-snapshots.js +12 -16
  289. package/dist/runner/events.d.ts +29 -8
  290. package/dist/runner/gateways.d.ts +49 -6
  291. package/dist/runner/index.d.ts +6 -4
  292. package/dist/runner/index.js +3 -2
  293. package/dist/runner/live/sandbox-gateway.js +161 -31
  294. package/dist/runner/network-policy.d.ts +55 -0
  295. package/dist/runner/network-policy.js +46 -0
  296. package/dist/runner/policy-writes.d.ts +40 -0
  297. package/dist/runner/policy-writes.js +124 -0
  298. package/dist/runner/prepare.d.ts +6 -7
  299. package/dist/runner/ready.d.ts +39 -10
  300. package/dist/runner/ready.js +59 -47
  301. package/dist/runner/recipe-check.d.ts +6 -0
  302. package/dist/runner/recipe-check.js +29 -0
  303. package/dist/runner/recipe-secrets.d.ts +67 -0
  304. package/dist/runner/recipe-secrets.js +230 -0
  305. package/dist/runner/recipe.d.ts +115 -26
  306. package/dist/runner/recipe.js +147 -154
  307. package/dist/runner/sandboxed-command.d.ts +22 -8
  308. package/dist/runner/sandboxed-command.js +33 -10
  309. package/dist/runner/scope.d.ts +107 -21
  310. package/dist/runner/scope.js +274 -54
  311. package/dist/runner/secrets.d.ts +42 -31
  312. package/dist/runner/secrets.js +62 -40
  313. package/dist/runner/session.d.ts +59 -26
  314. package/dist/runner/session.js +82 -41
  315. package/dist/runner/snapshot-build.d.ts +7 -4
  316. package/dist/runner/snapshot-build.js +48 -28
  317. package/dist/runner/snapshot-choice.d.ts +37 -0
  318. package/dist/runner/snapshot-choice.js +38 -0
  319. package/dist/runner/snapshot-key.d.ts +16 -14
  320. package/dist/runner/snapshot-key.js +24 -18
  321. package/dist/runner/steps.d.ts +13 -5
  322. package/dist/runner/steps.js +34 -4
  323. package/dist/runner/time-limit.d.ts +10 -0
  324. package/dist/runner/time-limit.js +43 -0
  325. package/dist/sdk/extension/commands.d.ts +1 -7
  326. package/dist/sdk/extension/driver.d.ts +39 -46
  327. package/dist/sdk/extension/driver.js +6 -6
  328. package/dist/sdk/extension/index.d.ts +3 -3
  329. package/dist/sdk/extension/index.js +3 -4
  330. package/dist/sdk/extension/lifecycle.d.ts +52 -9
  331. package/dist/sdk/extension/lifecycle.js +1 -1
  332. package/dist/sdk/extension/resource-definition.d.ts +13 -10
  333. package/dist/sdk/extension/resource-definition.js +7 -2
  334. package/dist/sdk/extension/resource.d.ts +2 -2
  335. package/dist/sdk/extension/secret-source.d.ts +58 -0
  336. package/dist/sdk/extension/secret-source.js +78 -0
  337. package/dist/sdk/index.d.ts +2 -2
  338. package/dist/sdk/index.js +1 -1
  339. package/dist/sdk/run/launcher.d.ts +1 -1
  340. package/dist/sdk/run/launcher.js +1 -1
  341. package/dist/sdk/run/payload.d.ts +16 -1
  342. package/dist/sdk/run/payload.js +17 -2
  343. package/dist/sdk/run/redact.js +2 -2
  344. package/dist/sdk/run/test-events.d.ts +23 -6
  345. package/dist/sdk/run/test-events.js +6 -4
  346. package/dist/sdk/run/test-result-writer.d.ts +8 -3
  347. package/dist/sdk/run/test-result-writer.js +22 -2
  348. package/dist/{commands/exec → shared}/cleanup.d.ts +3 -3
  349. package/dist/{commands/exec → shared}/cleanup.js +11 -6
  350. package/dist/shared/job-summary.d.ts +19 -0
  351. package/dist/{commands/exec → shared}/job-summary.js +17 -0
  352. package/dist/shared/sandbox-table.d.ts +48 -0
  353. package/dist/shared/sandbox-table.js +109 -0
  354. package/dist/{commands/exec → shared}/snapshot-text.d.ts +1 -1
  355. package/dist/{commands/exec → shared}/tests-summary.d.ts +22 -6
  356. package/dist/{commands/exec → shared}/tests-summary.js +74 -31
  357. package/dist/{commands/exec → shared}/text.d.ts +7 -2
  358. package/dist/{commands/exec → shared}/text.js +9 -1
  359. package/dist/{commands/exec → shared}/waterfall.d.ts +8 -6
  360. package/dist/{commands/exec → shared}/waterfall.js +71 -24
  361. package/dist/shared/worker-chart.d.ts +172 -0
  362. package/dist/shared/worker-chart.js +623 -0
  363. package/dist/vitest/config.d.ts +35 -11
  364. package/dist/vitest/config.js +47 -14
  365. package/dist/vitest/index.d.ts +1 -1
  366. package/dist/vitest/index.js +3 -3
  367. package/dist/vitest/sequencer.d.ts +23 -0
  368. package/dist/vitest/sequencer.js +73 -0
  369. package/dist/vitest/setup.d.ts +1 -0
  370. package/dist/vitest/setup.js +34 -0
  371. package/dist/vitest/test-events.d.ts +32 -6
  372. package/dist/vitest/test-events.js +25 -5
  373. package/dist/vitest/test-results.d.ts +8 -3
  374. package/dist/vitest/test-results.js +6 -0
  375. package/package.json +7 -2
  376. package/skills/overview.md +21 -17
  377. package/skills/plan-runs.md +67 -0
  378. package/skills/read-run-output.md +51 -19
  379. package/dist/chunks/chunk-E3QU74NX.js +0 -49
  380. package/dist/chunks/chunk-HP54VHGY.js +0 -201
  381. package/dist/chunks/chunk-NMVODY3P.js +0 -19
  382. package/dist/chunks/chunk-TVMEKVOW.js +0 -607
  383. package/dist/commands/exec/define-run-command.d.ts +0 -671
  384. package/dist/commands/exec/define-run-command.js +0 -91
  385. package/dist/commands/exec/job-summary.d.ts +0 -10
  386. package/dist/commands/exec/worker-chart.d.ts +0 -87
  387. package/dist/commands/exec/worker-chart.js +0 -343
  388. package/dist/commands/playwright/command.d.ts +0 -661
  389. package/dist/commands/playwright/command.js +0 -31
  390. package/dist/commands/playwright/metadata.js +0 -8
  391. package/dist/commands/vitest/command.d.ts +0 -662
  392. package/dist/commands/vitest/command.js +0 -31
  393. package/dist/commands/vitest/metadata.js +0 -8
  394. package/dist/sdk/extension/ci.d.ts +0 -2
  395. package/dist/sdk/extension/ci.js +0 -6
  396. package/dist/chunks/{chunk-YM6TZV4L.js → chunk-VL7WFTVQ.js} +52 -52
  397. package/dist/commands/{playwright → suites}/metadata.d.ts +1 -1
  398. package/dist/commands/{vitest → test}/metadata.d.ts +1 -1
  399. /package/dist/{commands → shared}/dashboard.d.ts +0 -0
  400. /package/dist/{commands → shared}/dashboard.js +0 -0
  401. /package/dist/{commands/exec → shared}/snapshot-text.js +0 -0
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  secondsOf,
3
3
  secondsText
4
- } from "./chunk-VH2POPW5.js";
4
+ } from "./chunk-YV7GE6EV.js";
5
5
 
6
- // src/commands/exec/text.ts
6
+ // src/shared/text.ts
7
7
  function seconds(ms) {
8
8
  return secondsText(secondsOf(ms));
9
9
  }
@@ -14,6 +14,10 @@ function keepTimeText(ms) {
14
14
  function releaseText(resources, done) {
15
15
  return resources.length === 0 ? void 0 : `${done ? "released" : "releasing"} ${resources.join(", ")}`;
16
16
  }
17
+ function orderText(steps) {
18
+ const last = steps.at(-1) ?? "";
19
+ return steps.length < 2 ? last : `${steps.slice(0, -1).join(", ")}, then ${last}`;
20
+ }
17
21
  function isoSecondsText(iso) {
18
22
  return iso.replace(/\.\d+Z$/, "Z");
19
23
  }
@@ -68,6 +72,7 @@ export {
68
72
  seconds,
69
73
  keepTimeText,
70
74
  releaseText,
75
+ orderText,
71
76
  isoSecondsText,
72
77
  short,
73
78
  shortFile,
@@ -1,26 +1,31 @@
1
1
  import {
2
2
  testserverPoolDefinition
3
- } from "./chunk-UC6DULWY.js";
3
+ } from "./chunk-R7XVBZOY.js";
4
+ import {
5
+ testserverExtensionCommands
6
+ } from "./chunk-ZG3WQ4UF.js";
7
+ import {
8
+ defineExtension
9
+ } from "./chunk-5CCP36QQ.js";
4
10
  import {
5
11
  driverContexts,
6
12
  driversOf,
7
13
  resourceDefinitionSet,
8
14
  resourcesOf
9
- } from "./chunk-VH2POPW5.js";
15
+ } from "./chunk-YV7GE6EV.js";
10
16
  import {
17
+ SECRET_MIN_LENGTH,
11
18
  argsText,
12
19
  booleanOption,
13
20
  defineDriver,
14
21
  defineResource,
22
+ describeSecretSource,
15
23
  mustBe,
16
- resourceFactory
17
- } from "./chunk-RA4L2ACU.js";
18
- import {
19
- testserverExtensionCommands
20
- } from "./chunk-GQIL3AHY.js";
21
- import {
22
- defineExtension
23
- } from "./chunk-GSC6SRTW.js";
24
+ readSecretSource,
25
+ readSecretSourceValue,
26
+ resourceFactory,
27
+ secretSourceSchema
28
+ } from "./chunk-AWBSONHB.js";
24
29
 
25
30
  // src/extensions/github/release.ts
26
31
  function fixtureRepoCleanupFailureText(cleanup, failure) {
@@ -44,19 +49,32 @@ function githubFixtureRepoReleased(cleaned) {
44
49
 
45
50
  // src/extensions/github/refusals.ts
46
51
  function githubTokenMissing(data) {
47
- const { tokenEnv, repo, requiredBy } = data;
52
+ const { source, repo, requiredBy } = data;
53
+ const variable = describeSecretSource(source);
48
54
  return {
49
55
  refused: "github_token_missing",
50
56
  data: { ...data },
51
- message: `${tokenEnv} is not set: resources.githubFixtureRepo needs a token for ${repo} from it. The run didn't start.`,
57
+ message: `${variable} is not set: resources.githubFixtureRepo needs a token for ${repo} from it. The run didn't start.`,
52
58
  next: [
53
59
  {
54
60
  type: "text",
55
- text: requiredBy === "flag" ? `Set ${tokenEnv} to a token limited to ${repo}: --github-optional=false makes the repository required for this run.` : `Set ${tokenEnv} to a token limited to ${repo}, or let runs go on without the repository with githubFixtureRepo({ \u2026, optional: true }) or --github-optional.`
61
+ text: requiredBy === "flag" ? `Set ${variable} to a token limited to ${repo}: --github-optional=false makes the repository required for this run.` : `Set ${variable} to a token limited to ${repo}, or let runs go on without the repository with githubFixtureRepo({ \u2026, optional: true }) or --github-optional.`
56
62
  }
57
63
  ]
58
64
  };
59
65
  }
66
+ function githubTokenInvalid(data) {
67
+ const { source, repo, problem, minLength } = data;
68
+ const variable = describeSecretSource(source);
69
+ const reason = problem === "multiline" ? "holds a carriage return or a line feed" : `holds fewer than ${minLength} characters`;
70
+ const fix = problem === "multiline" ? `Set ${variable} to a token for ${repo} on one line: storm puts it in an HTTP header, hides it in output a line at a time, and doesn't trim it.` : `Set ${variable} to the full token for ${repo} (at least ${minLength} characters).`;
71
+ return {
72
+ refused: "github_token_invalid",
73
+ data: { ...data },
74
+ message: `${variable} ${reason}: resources.githubFixtureRepo can't use it as a token for ${repo}. The run didn't start.`,
75
+ next: [{ type: "text", text: fix }]
76
+ };
77
+ }
60
78
  function githubFixtureRepoUnavailable(data) {
61
79
  const { repo, status, message } = data;
62
80
  return {
@@ -66,7 +84,7 @@ function githubFixtureRepoUnavailable(data) {
66
84
  next: [
67
85
  {
68
86
  type: "text",
69
- text: `Check that the token in resources.githubFixtureRepo's tokenEnv can read ${repo}, then retry.`
87
+ text: `Check that the token from resources.githubFixtureRepo's token.source can read ${repo}, then retry.`
70
88
  }
71
89
  ]
72
90
  };
@@ -79,7 +97,23 @@ function fixtureRunPrefix(startedAt, suffix) {
79
97
  return `${FIXTURE_RUN_PREFIX_ROOT}${stamp}-${suffix}`;
80
98
  }
81
99
  function fixtureRepoPayload(opened) {
82
- return { url: opened.url, nameWithOwner: opened.nameWithOwner, token: opened.token, runPrefix: opened.runPrefix };
100
+ return { url: opened.url, nameWithOwner: opened.nameWithOwner, runPrefix: opened.runPrefix };
101
+ }
102
+ var GITHUB_API_HOST = "api.github.com";
103
+ var GITHUB_GIT_HOST = "github.com";
104
+ function githubBasicCredential(token) {
105
+ return Buffer.from(`x-access-token:${token}`, "utf8").toString("base64");
106
+ }
107
+ function fixtureRepoCredentials(token) {
108
+ return [
109
+ { domain: GITHUB_API_HOST, header: "authorization", value: `Bearer ${token}`, requests: "all" },
110
+ {
111
+ domain: GITHUB_GIT_HOST,
112
+ header: "authorization",
113
+ value: `Basic ${githubBasicCredential(token)}`,
114
+ requests: "all"
115
+ }
116
+ ];
83
117
  }
84
118
  async function openFixtureRepo(context, request, prefix) {
85
119
  const read = await context.githubFixtureRepos.readRepo(request);
@@ -113,31 +147,45 @@ function failureText(failure) {
113
147
  return failure.status === null ? failure.message : `HTTP ${failure.status}: ${failure.message}`;
114
148
  }
115
149
 
116
- // src/extensions/github/lifecycle.ts
117
- function tokenIn(context, tokenEnv) {
118
- const token = context.env[tokenEnv];
119
- return token === void 0 || token === "" ? void 0 : token;
150
+ // src/extensions/github/split.ts
151
+ function splitFixtureRepo({
152
+ payload,
153
+ sandboxes
154
+ }) {
155
+ return { parts: Array.from({ length: sandboxes }, () => payload) };
120
156
  }
157
+
158
+ // src/extensions/github/lifecycle.ts
121
159
  function githubFixtureRepoLifecycle(context) {
122
160
  return {
123
- // No I/O: the token, when the launcher has it, for a refusal that comes before `beforeRun`.
161
+ // No I/O: the token and its `Basic` form, when the launcher has it, for a refusal that comes before `beforeRun`.
124
162
  secrets: ({ options }) => {
125
- const token = tokenIn(context, options.tokenEnv);
126
- return token === void 0 ? [] : [token];
163
+ const token = readSecretSourceValue(options.token.source, context.env);
164
+ return token === void 0 ? [] : [token, githubBasicCredential(token)];
127
165
  },
128
166
  beforeRun: async ({
129
167
  options,
130
168
  sources
131
169
  }) => {
132
- const { repo, tokenEnv, optional } = options;
133
- const token = tokenIn(context, tokenEnv);
134
- if (token !== void 0)
135
- return { use: { secrets: { token }, needsVercelCredential: false, hiddenVariables: [] } };
170
+ const { repo, token: tokenConfig, optional } = options;
171
+ const { source } = tokenConfig;
172
+ const read = readSecretSource(source, context.env);
173
+ if (read.ok)
174
+ return {
175
+ use: {
176
+ secrets: { token: read.value, basic: githubBasicCredential(read.value) },
177
+ needsVercelCredential: false,
178
+ needsRunnerSandbox: true,
179
+ hiddenVariables: []
180
+ }
181
+ };
182
+ if (read.problem !== "missing")
183
+ return githubTokenInvalid({ source, repo, problem: read.problem, minLength: SECRET_MIN_LENGTH });
136
184
  if (optional)
137
185
  return {
138
- skip: `${tokenEnv} is unset and resources.githubFixtureRepo is optional, so the run goes on without ${repo}`
186
+ skip: `${describeSecretSource(source)} is unset and resources.githubFixtureRepo is optional, so the run goes on without ${repo}`
139
187
  };
140
- return githubTokenMissing({ tokenEnv, repo, requiredBy: sources.optional === "flag" ? "flag" : "config" });
188
+ return githubTokenMissing({ source, repo, requiredBy: sources.optional === "flag" ? "flag" : "config" });
141
189
  },
142
190
  acquireForRun: async ({
143
191
  options,
@@ -159,8 +207,11 @@ function githubFixtureRepoLifecycle(context) {
159
207
  take(opened.repo);
160
208
  const { nameWithOwner, runPrefix } = opened.repo;
161
209
  await report.run(`GitHub fixture repository ${nameWithOwner}, the run's branches under ${runPrefix}/`);
162
- return { acquired: { payload: fixtureRepoPayload(opened.repo) } };
210
+ return {
211
+ acquired: { payload: fixtureRepoPayload(opened.repo), credentials: fixtureRepoCredentials(secrets.token) }
212
+ };
163
213
  },
214
+ split: splitFixtureRepo,
164
215
  releaseAfterRun: async ({
165
216
  taken: [repo],
166
217
  report
@@ -267,28 +318,28 @@ function liveGitHubFixtureRepoContext({ env, clock }) {
267
318
  // src/extensions/github/options.ts
268
319
  import { z as z2 } from "zod";
269
320
  var REPO_NAME = /^[\w.-]+\/[\w.-]+$/;
270
- var ENV_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
271
321
  var REPO = "a repository as owner/name";
272
322
  var repoName = z2.string(mustBe(REPO)).regex(REPO_NAME, mustBe(REPO));
273
- var ENV = "an environment variable's name";
274
- var envName = z2.string(mustBe(ENV)).regex(ENV_NAME, mustBe(ENV));
323
+ var tokenOption = z2.strictObject({ source: secretSourceSchema }, mustBe('a token declaration, { source: { kind: "env", name } }')).readonly();
275
324
  var githubFixtureRepoRules = {
276
325
  /** The repository, as `owner/name`. storm creates no repository; this one must exist. */
277
326
  repo: { schema: repoName, required: true },
278
327
  /**
279
- * The launcher environment variable that holds the token for `repo`, such as `CNC_GITHUB_FIXTURE_TOKEN`. Use a
280
- * token limited to this one repository: the command gets it in its run payload.
328
+ * Where the token for `repo` comes from (`{ source: { kind: "env", name } }`, such as
329
+ * `{ source: { kind: "env", name: "CNC_GITHUB_FIXTURE_TOKEN" } }`). Use a token limited to this one repository:
330
+ * while the command runs, the runner sandbox's firewall adds it to every request to `api.github.com` and
331
+ * `github.com`, so code in the sandbox can use it, though no file, environment, or run payload there holds it.
281
332
  */
282
- tokenEnv: { schema: envName, required: true },
333
+ token: { schema: tokenOption, required: true },
283
334
  /**
284
- * What a run does when `tokenEnv` is unset or empty: `false`, the default, refuses the run; `true` runs without the
285
- * resource and says so in one line.
335
+ * What a run does when `token.source` is unset or empty: `false`, the default, refuses the run; `true` runs without
336
+ * the resource and says so in one line.
286
337
  */
287
338
  optional: {
288
339
  schema: booleanOption,
289
340
  default: false,
290
341
  flag: {
291
- description: "Whether the run goes on without the GitHub fixture repository when the launcher environment variable its tokenEnv names is unset, overriding resources.githubFixtureRepo.optional in storm.config.ts; default false. --github-optional=false makes the repository required for this run, so a run without its token is refused with github_token_missing before anything starts. Gives the run the GitHub fixture repository resource, whose repo and tokenEnv only storm.config.ts gives."
342
+ description: "Whether the run goes on without the GitHub fixture repository when the launcher environment variable its token.source names is unset, overriding resources.githubFixtureRepo.optional in storm.config.ts; default false. --github-optional=false makes the repository required for this run, so a run without its token is refused with github_token_missing before anything starts. Gives the run the GitHub fixture repository resource, whose repo and token only storm.config.ts gives."
292
343
  }
293
344
  }
294
345
  };
@@ -297,12 +348,11 @@ var githubFixtureRepoRules = {
297
348
  var GITHUB_FIXTURE_REPO_NAME = "githubFixtureRepo";
298
349
  function checkGitHubFixtureRepoPayload(section) {
299
350
  if (!isObject(section)) return { ok: false, at: [], problem: "must be an object" };
300
- const { url, nameWithOwner, token, runPrefix } = section;
351
+ const { url, nameWithOwner, runPrefix } = section;
301
352
  if (!filled(url)) return refused("url");
302
353
  if (!filled(nameWithOwner)) return refused("nameWithOwner");
303
- if (!filled(token)) return refused("token");
304
354
  if (!filled(runPrefix)) return refused("runPrefix");
305
- return { ok: true, value: { url, nameWithOwner, token, runPrefix } };
355
+ return { ok: true, value: { url, nameWithOwner, runPrefix } };
306
356
  }
307
357
  function isObject(value) {
308
358
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -527,23 +577,6 @@ var playwrightDriver = defineDriver({
527
577
  const { failure } = planned;
528
578
  return { ok: false, kind: failure.kind, message: describePlaywrightListFailure(failure) };
529
579
  },
530
- help: {
531
- usage: "[<playwright test args>...] [-- <playwright dash options>...]",
532
- args: "What playwright test gets, unchanged and in order: every argument that isn't one of storm's flags, such as file filters, then everything after --, such as --project or --grep. Give file filters before --: Playwright reads each argument after --project as another project. playwright test --list gets the same arguments when it counts the tests, where storm.config.ts sets testPlan.",
533
- // Nothing storm brings a Playwright project reads the run payload's `verbose`: storm's Playwright reporter never
534
- // prints (`printsToStdio()` is false).
535
- verbose: "which test code can read; storm's Playwright reporter prints nothing either way",
536
- examples: [
537
- {
538
- argv: "",
539
- description: "Run every test in a runner sandbox, with the runner recipe, team, project and resources from storm.config.ts. Where it sets testPlan, storm counts the tests first, and each resource that sizes itself is sized from that count."
540
- },
541
- {
542
- argv: "--unsandboxed tests/login.spec.ts -- --project chromium",
543
- description: "Run the chromium project's tests in tests/login.spec.ts on this machine."
544
- }
545
- ]
546
- },
547
580
  hints: {
548
581
  // No final result: the Playwright config doesn't list storm's Playwright reporter, or a `--reporter` on
549
582
  // Playwright's command line replaced it. A config lists a reporter as a tuple of its module name.
@@ -552,17 +585,15 @@ var playwrightDriver = defineDriver({
552
585
  // install storm under either of its npm names.
553
586
  addReporter: [
554
587
  'In the Playwright config the run loads (playwright.config.ts, or the file --config names), set reporter to a list that holds ["@vercel/storm/playwright/reporter"], as in defineConfig({ reporter: [["list"], ["@vercel/storm/playwright/reporter"]] }). If reporter already names reporters, keep them and add ["@vercel/storm/playwright/reporter"] to the list. In a package that installs storm as @cnc-tools/storm, name "@cnc-tools/storm/playwright/reporter".',
555
- "Remove any --reporter from the arguments given to playwright test, since it replaces the config's reporters, storm's among them. Then run the same storm playwright command again."
588
+ "Remove any --reporter from the arguments given to playwright test, since it replaces the config's reporters, storm's among them. Then run the same storm test command again."
556
589
  ]
557
590
  },
558
591
  refusals: {
559
592
  noMatchingTests: {
560
- description: "storm.config.ts sets testPlan, and playwright test --list found no test for the arguments given to playwright test, so nothing was minted, acquired or started.",
561
593
  message: ({ args, cwd }) => `playwright test --list found no test for playwright test ${argsText(args)} in ${cwd}. The command didn't run.`,
562
594
  next: ({ args }) => `Change the arguments given to playwright test (${argsText(args)}), then retry. Put Playwright's own dash options after --.`
563
595
  },
564
596
  planFailed: {
565
- description: "storm couldn't plan the run: playwright wasn't found, or, where storm.config.ts sets testPlan, playwright test --list failed to start, didn't finish within 120s, exited other than 0, or wrote something other than a list of tests. Nothing was minted, acquired or started.",
566
597
  next: {
567
598
  "start-failed": "Install @playwright/test in the package, or run the command with storm exec, which needs no playwright.",
568
599
  "timed-out": "Check why playwright test --list doesn't finish, such as a config file that waits, then retry.",
@@ -592,60 +623,34 @@ var testserverExtension = defineExtension({
592
623
  description: "Run a script in a runner sandbox against 4 Testserver sandboxes."
593
624
  },
594
625
  {
595
- argv: "--unsandboxed --testserver-sandboxes 4 --scope vercel --project vercel -- pnpm test",
596
- description: "Run the tests on this machine against 4 Testserver sandboxes on the stable build channel."
626
+ argv: "--runner launch-machine --testserver-sandboxes 4 --scope vercel --project vercel -- pnpm test",
627
+ description: "Run the tests on the launch machine against 4 Testserver sandboxes on the stable build channel."
597
628
  },
598
629
  {
599
- argv: "--unsandboxed --testserver-ttl 30m --testserver-min-time-left 25m -- pnpm test",
630
+ argv: "--runner launch-machine --testserver-ttl 30m --testserver-min-time-left 25m -- pnpm test",
600
631
  description: "Create Testserver sandboxes that live 30 minutes, with team and project from storm.config.ts."
601
632
  },
602
633
  {
603
- argv: "--unsandboxed --testserver-build pr:104196 -- pnpm test",
604
- description: "Run the tests on this machine against the Testserver build of vercel/api pull request 104196's head commit."
634
+ argv: "--runner launch-machine --testserver-build pr:104196 -- pnpm test",
635
+ description: "Run the tests on the launch machine against the Testserver build of vercel/api pull request 104196's head commit."
605
636
  },
606
637
  {
607
- argv: "--unsandboxed --testserver-create=false --testserver-sandboxes 4 -- pnpm test",
638
+ argv: "--runner launch-machine --testserver-create=false --testserver-sandboxes 4 -- pnpm test",
608
639
  description: "Run only on Testserver sandboxes already in the pool, never minting."
609
640
  },
610
641
  {
611
- argv: "--unsandboxed --verbose --testserver-sandboxes 2 -- pnpm test",
642
+ argv: "--runner launch-machine --verbose --testserver-sandboxes 2 -- pnpm test",
612
643
  description: "Run the tests, printing each create's progress and, through storm's Vitest reporters, each test as it ends."
613
644
  },
614
645
  {
615
- argv: "--unsandboxed --credential github-actions --testserver-ttl 30m --testserver-min-time-left 25m -- pnpm test",
646
+ argv: "--runner launch-machine --credential github-actions --testserver-ttl 30m --testserver-min-time-left 25m -- pnpm test",
616
647
  description: "In a GitHub Actions job, create Testserver sandboxes with a GitHub Actions OIDC token."
617
648
  },
618
649
  {
619
- argv: "--unsandboxed --testserver-build latest_main --testserver-min-time-left 75m --scope vercel --project vercel -- pnpm test",
650
+ argv: "--runner launch-machine --testserver-build latest_main --testserver-min-time-left 75m --scope vercel --project vercel -- pnpm test",
620
651
  description: "Run them on the newest main build, with Testserver sandboxes that live at least 75 more minutes."
621
652
  }
622
- ],
623
- drivers: {
624
- vitest: [
625
- {
626
- argv: "--testserver-build pr:104196",
627
- description: "Run every test against the Testserver build of vercel/api pull request 104196's head commit."
628
- },
629
- {
630
- argv: "--unsandboxed --testserver-create=false",
631
- description: "Run on this machine, on Testserver sandboxes already in the pool, never minting."
632
- },
633
- {
634
- argv: "--testserver-sandboxes 6 -- --project testserver",
635
- description: "Run vitest's testserver project against 6 Testserver sandboxes, whatever the test count."
636
- }
637
- ],
638
- playwright: [
639
- {
640
- argv: "--unsandboxed --testserver-sandboxes 1 -- --project chromium",
641
- description: "Run Playwright's chromium project on this machine against 1 Testserver sandbox."
642
- },
643
- {
644
- argv: "--testserver-build pr:104196",
645
- description: "Run every test against the Testserver build of vercel/api pull request 104196's head commit."
646
- }
647
- ]
648
- }
653
+ ]
649
654
  }
650
655
  });
651
656
 
@@ -748,6 +753,7 @@ function listArgv2(args, flags) {
748
753
  }
749
754
 
750
755
  // src/extensions/vitest/plan/plan-over.ts
756
+ import { relative, sep } from "node:path";
751
757
  var LIST_TIMEOUT_MS2 = 6e4;
752
758
  async function planVitestRunOver(options, gateway) {
753
759
  const timeoutMs = options.timeoutMs ?? LIST_TIMEOUT_MS2;
@@ -761,12 +767,23 @@ async function planVitestRunOver(options, gateway) {
761
767
  timeoutMs,
762
768
  ...options.signal === void 0 ? {} : { signal: options.signal }
763
769
  };
770
+ const from = options.cwd ?? process.cwd();
764
771
  if (options.countTests === true) {
765
772
  const listed2 = await gateway.listTests(request);
766
- return listed2.ok ? { ok: true, plan: planOf2(listed2.tests) } : { ok: false, failure: listed2.failure };
773
+ return listed2.ok ? {
774
+ ok: true,
775
+ plan: planOf2(listed2.tests),
776
+ testFiles: testFilesOf(
777
+ from,
778
+ listed2.tests.map(({ file }) => file)
779
+ )
780
+ } : { ok: false, failure: listed2.failure };
767
781
  }
768
782
  const listed = await gateway.listFiles(request);
769
- return listed.ok ? { ok: true, plan: planOfFiles(listed.files) } : { ok: false, failure: listed.failure };
783
+ return listed.ok ? { ok: true, plan: planOfFiles(listed.files), testFiles: testFilesOf(from, listed.files) } : { ok: false, failure: listed.failure };
784
+ }
785
+ function testFilesOf(cwd, files) {
786
+ return [...new Set(files.map((file) => relative(cwd, file).split(sep).join("/")))].toSorted();
770
787
  }
771
788
  function planOf2(tests) {
772
789
  return { tests: tests.length, files: new Set(tests.map((test) => test.file)).size };
@@ -797,6 +814,19 @@ function describeVitestListFailure(failure) {
797
814
  }
798
815
 
799
816
  // src/extensions/vitest/driver.ts
817
+ function validateVitestShardArgs(args) {
818
+ for (const arg of args) {
819
+ if (arg === "--") break;
820
+ if (arg === "--shard" || arg.startsWith("--shard=")) {
821
+ return {
822
+ ok: false,
823
+ problem: "storm's --sandboxes and --file-lists assign each runner sandbox's test files through STORM_RUN and can't be combined with vitest's --shard; drop --shard from vitest's arguments."
824
+ };
825
+ }
826
+ }
827
+ return { ok: true };
828
+ }
829
+ var VITEST_EXTRA_MISMATCH_HINT = 'Check that vitest.config.ts includes stormSequencer() (or ...stormVitestConfig()) from "@vercel/storm/vitest/config" so each runner sandbox runs only its assigned test files from STORM_RUN.';
800
830
  var vitestDriver = defineDriver({
801
831
  name: "vitest",
802
832
  program: { bin: "vitest" },
@@ -806,53 +836,31 @@ var vitestDriver = defineDriver({
806
836
  // `--count-tests`, which may take 60s (`LIST_TIMEOUT_MS`); a failure in `describeVitestListFailure`'s words.
807
837
  plan: ({ list }) => async ({ args, cwd, bin, countTests, signal }) => {
808
838
  const planned = await planVitestRunOver({ args, cwd, executable: bin, countTests, signal }, list);
809
- if (planned.ok) return planned;
839
+ if (planned.ok) return { ok: true, plan: planned.plan, testFiles: planned.testFiles };
810
840
  const { failure } = planned;
811
841
  return { ok: false, kind: failure.kind, message: describeVitestListFailure(failure) };
812
842
  },
813
- countTests: {
814
- description: "Count each test before the run with vitest list --json, not only the test files with vitest list --filesOnly --json. vitest list then imports every test file on this machine to collect its tests, which can take most of a minute for a suite of hundreds of files and needs what the test files import to resolve here, such as a current build of the workspace's packages. In return, the run refuses with no_matching_tests when a -t matches no test, and its test plan holds the number of tests. It counts whether or not storm.config.ts sets testPlan. Without it, a run whose storm.config.ts sets testPlan counts only the files, which applies the file filters and --project but not -t: a -t that matches no test starts the run, and vitest run skips every test and exits 0."
815
- },
816
- help: {
817
- usage: "[--count-tests] [<vitest run args>...] [-- <vitest dash options>...]",
818
- args: "What vitest run gets, unchanged and in order: every argument that isn't one of storm's flags, such as file filters, then everything after --, such as -t or --project. vitest list gets the same arguments when it counts the test files, where storm.config.ts sets testPlan, or the tests with --count-tests.",
819
- // What a Vitest project's storm code does with the run payload's `verbose`: `stormReporters()` picks vitest's
820
- // `verbose` reporter (`@vercel/storm/vitest/config`), and an extension's Vitest fixtures print as each test
821
- // goes.
822
- verbose: "which has storm's Vitest reporters print each test as it finishes and an extension's Vitest fixtures print each setup phase, proxied request, and vercel invocation, for passing tests too",
823
- examples: [
824
- {
825
- argv: "",
826
- description: "Run every test in a runner sandbox, with the runner recipe, team, project and resources from storm.config.ts. Where it sets testPlan, storm counts the test files first, and each resource that sizes itself is sized from that count."
827
- },
828
- {
829
- argv: "test/api -- -t creates",
830
- description: "Run the tests named creates in the files under test/api."
831
- },
832
- {
833
- argv: "--count-tests test/api -- -t creates",
834
- description: "Count the tests named creates in the files under test/api before the run, refusing with no_matching_tests when there is none, then run them."
835
- }
836
- ]
843
+ countsFilesOnly: true,
844
+ fileLists: {
845
+ validate: validateVitestShardArgs,
846
+ extraMismatchHint: VITEST_EXTRA_MISMATCH_HINT
837
847
  },
838
848
  hints: {
839
849
  // No final result: the Vitest config lacks `stormReporter`, or a `--reporter` on vitest's command line replaced it.
840
850
  noFinalResults: "add stormReporter() to vitest.config's reporters (@vercel/storm/vitest/config)",
841
- // `stormReporters()` keeps vitest's own output and reports nothing outside a storm run, so the steps add it
842
- // unconditionally. The package may install storm under either of its npm names.
851
+ // `stormVitestConfig()` returns `{}` outside a storm run and sets reporters, setupFiles, and sequencer under one,
852
+ // so the steps add it unconditionally. The package may install storm under either of its npm names.
843
853
  addReporter: [
844
- 'In the Vitest config the run loads (vitest.config.ts, or the file --config names), import { stormReporters } from "@vercel/storm/vitest/config" and set test.reporters to stormReporters(), as in defineConfig({ test: { reporters: stormReporters() } }). If test.reporters already lists reporters, keep them and add stormReporter() from the same module to the list instead. In a package that installs storm as @cnc-tools/storm, import from "@cnc-tools/storm/vitest/config".',
845
- "Remove any --reporter from the arguments given to vitest run, since it replaces the config's reporters, storm's among them. Then run the same storm vitest command again."
854
+ 'In the Vitest config the run loads (vitest.config.ts, or the file --config names), import { stormVitestConfig } from "@vercel/storm/vitest/config" and spread stormVitestConfig() into test, as in defineConfig({ test: { ...stormVitestConfig() } }). If test.reporters already lists reporters, keep them and add stormReporter() from the same module to the list instead. If test.setupFiles already lists files, keep them and add stormSetupFile() from the same module to the list. In a package that installs storm as @cnc-tools/storm, import from "@cnc-tools/storm/vitest/config".',
855
+ "Remove any --reporter from the arguments given to vitest run, since it replaces the config's reporters, storm's among them. Then run the same storm test command again."
846
856
  ]
847
857
  },
848
858
  refusals: {
849
859
  noMatchingTests: {
850
- description: "The run counts, since storm.config.ts sets testPlan or the run took --count-tests, and vitest list found no test file for the arguments given to vitest run, or no test with --count-tests, so nothing was minted, acquired or started.",
851
860
  message: ({ args, cwd }) => `vitest list found no test for vitest run ${argsText(args)} in ${cwd}. The command didn't run.`,
852
861
  next: ({ args }) => `Change the arguments given to vitest run (${argsText(args)}), then retry. Put vitest's own dash options after --.`
853
862
  },
854
863
  planFailed: {
855
- description: "storm couldn't plan the run: vitest wasn't found, or, for a run that counts, vitest list failed to start, didn't finish within 60s, exited other than 0, or printed something other than a list of files or tests. Nothing was minted, acquired or started.",
856
864
  next: {
857
865
  "start-failed": "Install vitest in the package, or run the command with storm exec, which needs no vitest.",
858
866
  "timed-out": "Check why vitest list doesn't finish, such as a global setup that waits, then retry. Without --count-tests it counts only the files, which imports no test file, and without testPlan in storm.config.ts it counts nothing.",
@@ -874,6 +882,7 @@ function liveResourceContexts(env) {
874
882
  return DEFINITION_SET.contexts(env);
875
883
  }
876
884
  var DRIVERS = driversOf(EXTENSIONS);
885
+ var DRIVER_NAMES = DRIVERS.map((driver) => driver.name);
877
886
  function driverNamed(name) {
878
887
  const drivers = DRIVERS;
879
888
  const driver = drivers.find((each) => each.name === name);
@@ -889,6 +898,7 @@ export {
889
898
  RESOURCES,
890
899
  DEFINITION_SET,
891
900
  liveResourceContexts,
901
+ DRIVER_NAMES,
892
902
  driverNamed,
893
903
  liveDriverContexts
894
904
  };
@@ -0,0 +1,108 @@
1
+ import {
2
+ isoSecondsText,
3
+ paint,
4
+ seconds
5
+ } from "./chunk-OX7X4B2L.js";
6
+
7
+ // src/shared/dashboard.ts
8
+ function projectPage({ team, project }) {
9
+ return `https://vercel.com/${encodeURIComponent(team)}/${encodeURIComponent(project)}`;
10
+ }
11
+ function sandboxPage(where, name) {
12
+ return `${projectPage(where)}/sandboxes/${encodeURIComponent(name)}`;
13
+ }
14
+ function sandboxConnectPage(where, name) {
15
+ return `${sandboxPage(where, name)}/connect`;
16
+ }
17
+ function snapshotPage(where, id) {
18
+ return `${projectPage(where)}/sandboxes/snapshots/${encodeURIComponent(id)}`;
19
+ }
20
+
21
+ // src/shared/sandbox-table.ts
22
+ var SANDBOX_TABLE_HEADER = [
23
+ "RUNNER SANDBOX",
24
+ "STATE",
25
+ "EXIT",
26
+ "PREPARED",
27
+ "COMMAND",
28
+ "TESTS",
29
+ "NAME"
30
+ ];
31
+ function testTotalsText(totals) {
32
+ if (totals === null) return "-";
33
+ const parts = [
34
+ ...totals.passed > 0 ? [`${totals.passed} passed`] : [],
35
+ ...totals.failed > 0 ? [`${totals.failed} failed`] : [],
36
+ ...totals.skipped > 0 ? [`${totals.skipped} skipped`] : []
37
+ ];
38
+ return parts.length === 0 ? "no tests" : parts.join(" \xB7 ");
39
+ }
40
+ function sandboxStateText(state) {
41
+ return state.replace("-", " ");
42
+ }
43
+ function sandboxesText(count) {
44
+ return `${count} ${count === 1 ? "runner sandbox" : "runner sandboxes"}`;
45
+ }
46
+ function sandboxesPassedText(sandboxes) {
47
+ const passed = sandboxes.filter(({ state }) => state === "passed").length;
48
+ return ` (${passed} of ${sandboxesText(sandboxes.length)} passed)`;
49
+ }
50
+ function startedSandboxesText(sandboxes, ended) {
51
+ const started = ended ? sandboxes.filter(({ name }) => name !== null).length : sandboxes.length;
52
+ const missing = sandboxes.length - started;
53
+ return `${started} runner ${started === 1 ? "sandbox" : "sandboxes"}${missing === 0 ? "" : `, ${missing} not started`}`;
54
+ }
55
+ function sandboxTableRows(sandboxes) {
56
+ const time = (ms) => ms === null ? "-" : seconds(ms);
57
+ return sandboxes.map((each) => [
58
+ String(each.sandbox),
59
+ sandboxStateText(each.state),
60
+ each.exitCode === null ? "-" : String(each.exitCode),
61
+ time(each.preparedMs),
62
+ time(each.commandMs),
63
+ testTotalsText(each.tests),
64
+ each.name === null ? "-" : `${each.name}${each.keptUntil === null ? "" : ` (kept until ${isoSecondsText(each.keptUntil)})`}`
65
+ ]);
66
+ }
67
+ function sandboxCauseText(sandbox) {
68
+ if (sandbox.cause !== null) return sandbox.cause;
69
+ return sandbox.exitCode === null ? "-" : `the command exited ${sandbox.exitCode}`;
70
+ }
71
+ function sandboxTotalsLine(records) {
72
+ const states = ["passed", "failed", "not-started", "canceled", "pending"];
73
+ const counted = states.flatMap((state) => {
74
+ const number = records.filter((record) => record.state === state).length;
75
+ return number === 0 ? [] : [`${number} ${sandboxStateText(state)}`];
76
+ });
77
+ return `${sandboxesText(records.length)}: ${counted.join(", ")}`;
78
+ }
79
+ function sandboxTableLines(records, style = paint(false)) {
80
+ const rows = [[...SANDBOX_TABLE_HEADER], ...sandboxTableRows(records)];
81
+ const widths = SANDBOX_TABLE_HEADER.map((_, column) => Math.max(...rows.map((row) => row[column]?.length ?? 0)));
82
+ const tone = (state) => state === "passed" ? style.done : state === "canceled" || state === "pending" ? style.stopped : style.failed;
83
+ return rows.map((row, index) => {
84
+ const record = index === 0 ? void 0 : records[index - 1];
85
+ const cells = row.map((cell, column) => {
86
+ const padded = column === row.length - 1 ? cell : cell.padEnd(widths[column] ?? 0);
87
+ if (index === 0) return style.strong(padded);
88
+ return column === 1 && record !== void 0 ? tone(record.state)(padded) : padded;
89
+ });
90
+ return ` ${cells.join(" ")}`.trimEnd();
91
+ });
92
+ }
93
+
94
+ export {
95
+ sandboxPage,
96
+ sandboxConnectPage,
97
+ snapshotPage,
98
+ SANDBOX_TABLE_HEADER,
99
+ testTotalsText,
100
+ sandboxStateText,
101
+ sandboxesText,
102
+ sandboxesPassedText,
103
+ startedSandboxesText,
104
+ sandboxTableRows,
105
+ sandboxCauseText,
106
+ sandboxTotalsLine,
107
+ sandboxTableLines
108
+ };