@cnc-tools/storm 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (442) hide show
  1. package/dist/bin/storm.js +7 -12
  2. package/dist/build-info.js +1 -1
  3. package/dist/chunks/chunk-2NZXL6OH.js +62 -0
  4. package/dist/chunks/{chunk-3ZZVZPMG.js → chunk-43MWZLJR.js} +1 -1
  5. package/dist/chunks/{chunk-NPPJ57W7.js → chunk-5UMJNVKT.js} +498 -215
  6. package/dist/chunks/{chunk-KR7WIYLG.js → chunk-6EQKA7LI.js} +200 -985
  7. package/dist/chunks/{chunk-4EU4AH7E.js → chunk-AX4EQZUS.js} +186 -144
  8. package/dist/chunks/{chunk-ETCZ6WP7.js → chunk-BW2ADH7U.js} +1 -1
  9. package/dist/chunks/chunk-DOFB2ACU.js +49 -0
  10. package/dist/chunks/chunk-EGNP3S6C.js +161 -0
  11. package/dist/chunks/chunk-GQIL3AHY.js +20 -0
  12. package/dist/chunks/{chunk-ICB4BZJX.js → chunk-GSC6SRTW.js} +7 -2
  13. package/dist/chunks/{chunk-OJOKQRM6.js → chunk-IYM44FUX.js} +30 -26
  14. package/dist/chunks/{chunk-GRMD7G4J.js → chunk-LQKNI3EG.js} +6 -5
  15. package/dist/chunks/chunk-N7E6DAUE.js +40 -0
  16. package/dist/chunks/chunk-NMVODY3P.js +19 -0
  17. package/dist/chunks/{chunk-TRFEAYNC.js → chunk-Q4TKRILH.js} +261 -354
  18. package/dist/chunks/{chunk-VZZTHCBW.js → chunk-RTILVSYQ.js} +5 -18
  19. package/dist/chunks/{chunk-L4ZPMSKQ.js → chunk-T6AZIDZD.js} +43 -363
  20. package/dist/chunks/chunk-X4WBJIOF.js +308 -0
  21. package/dist/chunks/chunk-YGS5VRQT.js +794 -0
  22. package/dist/chunks/{chunk-4PRAB24Y.js → chunk-YM6TZV4L.js} +394 -396
  23. package/dist/chunks/{chunk-AMTYHUYB.js → chunk-YT5OROR7.js} +22 -8
  24. package/dist/chunks/{chunk-O4BUT7BE.js → chunk-ZDJLKF2G.js} +1625 -1583
  25. package/dist/chunks/{live-app-LOGYUBKB.js → live-app-QFHS54SX.js} +25 -46
  26. package/dist/command-tree.d.ts +4 -1
  27. package/dist/command-tree.js +4 -1
  28. package/dist/commands/exec/cleanup.js +4 -4
  29. package/dist/commands/exec/command.d.ts +6 -55
  30. package/dist/commands/exec/command.js +51 -46
  31. package/dist/commands/exec/define-run-command.d.ts +664 -0
  32. package/dist/commands/exec/define-run-command.js +58 -0
  33. package/dist/commands/exec/driver-plan.d.ts +30 -0
  34. package/dist/commands/exec/driver-plan.js +44 -0
  35. package/dist/commands/exec/driver-refusals.d.ts +89 -0
  36. package/dist/commands/exec/driver-refusals.js +65 -0
  37. package/dist/commands/exec/exec-words.d.ts +5 -0
  38. package/dist/commands/exec/exec-words.js +31 -0
  39. package/dist/commands/exec/live-view.js +68 -42
  40. package/dist/commands/exec/mint-failed.js +4 -4
  41. package/dist/commands/exec/outcomes.d.ts +6 -48
  42. package/dist/commands/exec/outcomes.js +10 -12
  43. package/dist/commands/exec/plan-run.js +3 -3
  44. package/dist/commands/exec/progress.d.ts +21 -17
  45. package/dist/commands/exec/progress.js +59 -78
  46. package/dist/commands/exec/resource-flags.d.ts +10 -3
  47. package/dist/commands/exec/resource-flags.js +25 -14
  48. package/dist/commands/exec/resource-refusals.d.ts +1 -1
  49. package/dist/commands/exec/resource-refusals.js +9 -9
  50. package/dist/commands/exec/run-bin.d.ts +35 -0
  51. package/dist/commands/exec/run-bin.js +32 -0
  52. package/dist/commands/exec/run-command.d.ts +64 -23
  53. package/dist/commands/exec/run-command.js +35 -94
  54. package/dist/commands/exec/run-metadata.d.ts +25 -19
  55. package/dist/commands/exec/run-metadata.js +34 -18
  56. package/dist/commands/exec/snapshot-text.d.ts +31 -0
  57. package/dist/commands/exec/snapshot-text.js +72 -0
  58. package/dist/commands/exec/test-plan.d.ts +2 -2
  59. package/dist/commands/exec/test-plan.js +11 -8
  60. package/dist/commands/exec/tests-summary.d.ts +21 -12
  61. package/dist/commands/exec/tests-summary.js +67 -39
  62. package/dist/commands/exec/text.d.ts +5 -0
  63. package/dist/commands/exec/text.js +7 -0
  64. package/dist/commands/exec/view.js +12 -13
  65. package/dist/commands/exec/waterfall.js +4 -4
  66. package/dist/commands/exec/worker-chart.d.ts +19 -11
  67. package/dist/commands/exec/worker-chart.js +66 -36
  68. package/dist/commands/playwright/command.d.ts +658 -0
  69. package/dist/commands/playwright/command.js +31 -0
  70. package/dist/commands/playwright/metadata.js +8 -0
  71. package/dist/commands/runs/facts.d.ts +5 -28
  72. package/dist/commands/runs/facts.js +11 -33
  73. package/dist/commands/runs/list/command.d.ts +4 -50
  74. package/dist/commands/runs/list/command.js +15 -11
  75. package/dist/commands/runs/list/outcomes.d.ts +2 -25
  76. package/dist/commands/runs/logs/command.js +13 -9
  77. package/dist/commands/runs/logs/outcomes.js +1 -1
  78. package/dist/commands/runs/show/command.d.ts +6 -50
  79. package/dist/commands/runs/show/command.js +37 -47
  80. package/dist/commands/runs/show/metadata.js +1 -1
  81. package/dist/commands/runs/show/outcomes.d.ts +3 -25
  82. package/dist/commands/runs/show/outcomes.js +18 -31
  83. package/dist/commands/snapshots/build/command.d.ts +501 -0
  84. package/dist/commands/snapshots/build/command.js +336 -0
  85. package/dist/commands/snapshots/build/metadata.d.ts +28 -0
  86. package/dist/commands/snapshots/build/metadata.js +37 -0
  87. package/dist/commands/snapshots/build/outcomes.d.ts +254 -0
  88. package/dist/commands/snapshots/build/outcomes.js +155 -0
  89. package/dist/commands/snapshots/list/command.d.ts +238 -0
  90. package/dist/commands/snapshots/list/command.js +269 -0
  91. package/dist/commands/snapshots/list/metadata.d.ts +16 -0
  92. package/dist/commands/snapshots/list/metadata.js +24 -0
  93. package/dist/commands/snapshots/list/outcomes.d.ts +148 -0
  94. package/dist/commands/snapshots/list/outcomes.js +217 -0
  95. package/dist/commands/snapshots/metadata.d.ts +3 -0
  96. package/dist/commands/snapshots/metadata.js +7 -0
  97. package/dist/commands/vitest/command.d.ts +185 -304
  98. package/dist/commands/vitest/command.js +23 -181
  99. package/dist/commands/vitest/metadata.js +1 -1
  100. package/dist/config-file/define.d.ts +1 -1
  101. package/dist/context.d.ts +32 -30
  102. package/dist/context.js +13 -17
  103. package/dist/core/before-run.d.ts +5 -5
  104. package/dist/core/before-run.js +8 -8
  105. package/dist/core/definition-lookup.d.ts +5 -5
  106. package/dist/core/definition-lookup.js +13 -12
  107. package/dist/core/drivers-of.d.ts +23 -0
  108. package/dist/core/drivers-of.js +13 -0
  109. package/dist/core/events.d.ts +6 -9
  110. package/dist/core/gateways.d.ts +32 -24
  111. package/dist/core/index.d.ts +7 -5
  112. package/dist/core/index.js +9 -6
  113. package/dist/core/launcher-context.d.ts +11 -0
  114. package/dist/core/launcher-context.js +31 -0
  115. package/dist/core/live/package-bin-gateway.d.ts +6 -0
  116. package/dist/core/live/package-bin-gateway.js +24 -0
  117. package/dist/core/package-bin.d.ts +7 -0
  118. package/dist/core/package-bin.js +30 -0
  119. package/dist/core/presentations.d.ts +1 -1
  120. package/dist/core/presentations.js +6 -5
  121. package/dist/core/{resource-registry.d.ts → resource-definition-set.d.ts} +15 -14
  122. package/dist/core/resource-definition-set.js +31 -0
  123. package/dist/core/resource-reports.d.ts +1 -1
  124. package/dist/core/resource-reports.js +16 -15
  125. package/dist/core/resource.d.ts +4 -4
  126. package/dist/core/resources.d.ts +6 -6
  127. package/dist/core/resources.js +11 -11
  128. package/dist/core/run-state.d.ts +20 -31
  129. package/dist/core/run-state.js +34 -25
  130. package/dist/core/run.d.ts +30 -32
  131. package/dist/core/run.js +33 -39
  132. package/dist/core/setup-phases.d.ts +14 -0
  133. package/dist/core/setup-phases.js +24 -0
  134. package/dist/core/state-directory.d.ts +2 -2
  135. package/dist/core/state-directory.js +3 -3
  136. package/dist/core/timeline.d.ts +4 -2
  137. package/dist/core/timeline.js +11 -5
  138. package/dist/extension-commands.js +6 -10
  139. package/dist/extensions/github/{world.d.ts → context.d.ts} +1 -1
  140. package/dist/extensions/github/context.js +3 -0
  141. package/dist/extensions/github/definition.d.ts +1 -1
  142. package/dist/extensions/github/definition.js +3 -3
  143. package/dist/extensions/github/extension.d.ts +1 -1
  144. package/dist/extensions/github/index.d.ts +2 -2
  145. package/dist/extensions/github/index.js +4 -4
  146. package/dist/extensions/github/lifecycle.d.ts +3 -3
  147. package/dist/extensions/github/lifecycle.js +14 -14
  148. package/dist/extensions/github/live/context.d.ts +6 -0
  149. package/dist/extensions/github/live/context.js +16 -0
  150. package/dist/extensions/github/resource.d.ts +1 -1
  151. package/dist/extensions/playwright/driver.d.ts +8 -0
  152. package/dist/extensions/playwright/driver.js +60 -0
  153. package/dist/extensions/playwright/extension.d.ts +2 -0
  154. package/dist/extensions/playwright/extension.js +12 -0
  155. package/dist/extensions/playwright/plan/gateways.d.ts +62 -0
  156. package/dist/extensions/playwright/plan/gateways.js +4 -0
  157. package/dist/extensions/playwright/plan/list-output.d.ts +26 -0
  158. package/dist/extensions/playwright/plan/list-output.js +101 -0
  159. package/dist/extensions/playwright/plan/live/list-gateway.d.ts +15 -0
  160. package/dist/extensions/playwright/plan/live/list-gateway.js +100 -0
  161. package/dist/extensions/playwright/plan/plan.d.ts +44 -0
  162. package/dist/extensions/playwright/plan/plan.js +53 -0
  163. package/dist/extensions/testserver/command-tree.d.ts +1 -1
  164. package/dist/extensions/testserver/command-tree.js +2 -2
  165. package/dist/extensions/testserver/commands/app.d.ts +7 -7
  166. package/dist/extensions/testserver/commands/pool/create/command.d.ts +5 -5
  167. package/dist/extensions/testserver/commands/pool/create/command.js +12 -13
  168. package/dist/extensions/testserver/commands/pool/list/command.js +5 -6
  169. package/dist/extensions/testserver/{world.d.ts → context.d.ts} +1 -1
  170. package/dist/extensions/testserver/context.js +4 -0
  171. package/dist/extensions/testserver/definition.d.ts +2 -2
  172. package/dist/extensions/testserver/definition.js +8 -7
  173. package/dist/extensions/testserver/events.d.ts +1 -1
  174. package/dist/extensions/testserver/extension.d.ts +4 -3
  175. package/dist/extensions/testserver/extension.js +33 -20
  176. package/dist/extensions/testserver/index.d.ts +2 -2
  177. package/dist/extensions/testserver/index.js +2 -2
  178. package/dist/extensions/testserver/lifecycle.d.ts +6 -5
  179. package/dist/extensions/testserver/lifecycle.js +9 -8
  180. package/dist/extensions/testserver/live/context.d.ts +8 -0
  181. package/dist/extensions/testserver/live/{world.js → context.js} +6 -7
  182. package/dist/extensions/testserver/options/rules.d.ts +3 -3
  183. package/dist/extensions/testserver/options/rules.js +5 -4
  184. package/dist/extensions/testserver/options/sandboxes.d.ts +3 -2
  185. package/dist/extensions/testserver/options/sandboxes.js +3 -2
  186. package/dist/extensions/testserver/playwright/index.d.ts +33 -0
  187. package/dist/extensions/testserver/playwright/index.js +43 -0
  188. package/dist/extensions/testserver/presentation.d.ts +4 -4
  189. package/dist/extensions/testserver/presentation.js +7 -7
  190. package/dist/extensions/testserver/progress.d.ts +3 -3
  191. package/dist/extensions/testserver/progress.js +3 -3
  192. package/dist/extensions/testserver/provision.d.ts +2 -2
  193. package/dist/extensions/testserver/provision.js +10 -10
  194. package/dist/extensions/testserver/resource.d.ts +2 -2
  195. package/dist/extensions/testserver/result.d.ts +2 -2
  196. package/dist/extensions/testserver/result.js +1 -1
  197. package/dist/extensions/testserver/run/connection.d.ts +1 -1
  198. package/dist/extensions/testserver/run/connection.js +3 -3
  199. package/dist/extensions/testserver/run/sandbox.d.ts +31 -0
  200. package/dist/extensions/testserver/run/sandbox.js +58 -0
  201. package/dist/extensions/testserver/run-sandbox.d.ts +2 -2
  202. package/dist/extensions/testserver/run-sandbox.js +3 -3
  203. package/dist/extensions/testserver/vercel-cli/arguments.d.ts +2 -2
  204. package/dist/extensions/testserver/vercel-cli/arguments.js +6 -6
  205. package/dist/extensions/testserver/vercel-cli/auth-config.d.ts +7 -7
  206. package/dist/extensions/testserver/vercel-cli/auth-config.js +4 -4
  207. package/dist/extensions/testserver/vercel-cli/clock.js +1 -1
  208. package/dist/extensions/testserver/vercel-cli/config-files.js +1 -1
  209. package/dist/extensions/testserver/vercel-cli/context.d.ts +1 -1
  210. package/dist/extensions/testserver/vercel-cli/context.js +2 -2
  211. package/dist/extensions/testserver/vercel-cli/entry.d.ts +1 -1
  212. package/dist/extensions/testserver/vercel-cli/entry.js +1 -1
  213. package/dist/extensions/testserver/vercel-cli/environment.d.ts +5 -5
  214. package/dist/extensions/testserver/vercel-cli/environment.js +6 -6
  215. package/dist/extensions/testserver/vercel-cli/gateways.d.ts +1 -1
  216. package/dist/extensions/testserver/vercel-cli/gateways.js +3 -3
  217. package/dist/extensions/testserver/vercel-cli/index.d.ts +1 -1
  218. package/dist/extensions/testserver/vercel-cli/index.js +8 -9
  219. package/dist/extensions/testserver/vercel-cli/invocation.d.ts +13 -12
  220. package/dist/extensions/testserver/vercel-cli/invocation.js +1 -1
  221. package/dist/extensions/testserver/vercel-cli/{driver.d.ts → invoker.d.ts} +18 -17
  222. package/dist/extensions/testserver/vercel-cli/{driver.js → invoker.js} +8 -8
  223. package/dist/extensions/testserver/vercel-cli/live/config-files.d.ts +2 -2
  224. package/dist/extensions/testserver/vercel-cli/live/config-files.js +2 -2
  225. package/dist/extensions/testserver/vercel-cli/live/process-gateway.js +1 -1
  226. package/dist/extensions/testserver/vercel-cli/report.js +2 -2
  227. package/dist/extensions/testserver/vercel-cli/verbose.js +1 -1
  228. package/dist/extensions/testserver/vitest/config.d.ts +3 -3
  229. package/dist/extensions/testserver/vitest/config.js +5 -13
  230. package/dist/extensions/testserver/vitest/container-scope.d.ts +11 -11
  231. package/dist/extensions/testserver/vitest/container-scope.js +9 -9
  232. package/dist/extensions/testserver/vitest/container-start.d.ts +6 -6
  233. package/dist/extensions/testserver/vitest/container-start.js +14 -11
  234. package/dist/extensions/testserver/vitest/diagnostics.d.ts +1 -1
  235. package/dist/extensions/testserver/vitest/fixtures.d.ts +11 -11
  236. package/dist/extensions/testserver/vitest/fixtures.js +14 -23
  237. package/dist/extensions/testserver/vitest/index.d.ts +1 -1
  238. package/dist/extensions/testserver/vitest/index.js +4 -4
  239. package/dist/extensions/testserver/vitest/types.d.ts +16 -18
  240. package/dist/extensions/testserver/vitest/types.js +2 -2
  241. package/dist/extensions/testserver/vitest/worker-sandbox.d.ts +8 -0
  242. package/dist/extensions/testserver/vitest/worker-sandbox.js +17 -0
  243. package/dist/extensions/vitest/driver.d.ts +8 -0
  244. package/dist/extensions/vitest/driver.js +62 -0
  245. package/dist/extensions/vitest/extension.d.ts +2 -0
  246. package/dist/extensions/vitest/extension.js +8 -0
  247. package/dist/{vitest → extensions/vitest/plan}/gateways.d.ts +1 -26
  248. package/dist/extensions/vitest/plan/gateways.js +3 -0
  249. package/dist/{vitest → extensions/vitest/plan}/live/list-gateway.d.ts +1 -2
  250. package/dist/{vitest → extensions/vitest/plan}/live/list-gateway.js +1 -20
  251. package/dist/extensions/vitest/plan/plan-over.d.ts +38 -0
  252. package/dist/extensions/vitest/plan/plan-over.js +31 -0
  253. package/dist/extensions/vitest/plan/plan.d.ts +24 -0
  254. package/dist/{vitest → extensions/vitest/plan}/plan.js +11 -26
  255. package/dist/extensions.d.ts +40 -18
  256. package/dist/extensions.js +49 -22
  257. package/dist/forward-sigterm.js +1 -1
  258. package/dist/launcher-resolvers/index.d.ts +1 -1
  259. package/dist/launcher-resolvers/local-services.d.ts +9 -44
  260. package/dist/launcher-resolvers/local-services.js +4 -5
  261. package/dist/live-app.js +7 -6
  262. package/dist/local-services.d.ts +7 -15
  263. package/dist/local-services.js +8 -29
  264. package/dist/playwright/index.d.ts +1 -0
  265. package/dist/playwright/index.js +4 -0
  266. package/dist/playwright/reporter.d.ts +96 -0
  267. package/dist/playwright/reporter.js +162 -0
  268. package/dist/playwright/worker-index.d.ts +7 -0
  269. package/dist/playwright/worker-index.js +20 -0
  270. package/dist/run-directory/index.d.ts +1 -1
  271. package/dist/run-directory/index.js +2 -3
  272. package/dist/run-directory/plan.d.ts +3 -3
  273. package/dist/run-directory/plan.js +5 -5
  274. package/dist/run-directory/reader.js +2 -2
  275. package/dist/run-directory/recording.d.ts +8 -5
  276. package/dist/run-directory/recording.js +6 -6
  277. package/dist/run-directory/run-collector.d.ts +5 -5
  278. package/dist/run-directory/run-collector.js +5 -5
  279. package/dist/run-directory/run-record.d.ts +17 -90
  280. package/dist/run-directory/run-record.js +15 -55
  281. package/dist/run-directory/timeline-facts.d.ts +2 -1
  282. package/dist/run-directory/timeline-facts.js +4 -2
  283. package/dist/runner/build-snapshots.d.ts +115 -0
  284. package/dist/runner/build-snapshots.js +146 -0
  285. package/dist/runner/context.js +2 -1
  286. package/dist/runner/events.d.ts +24 -69
  287. package/dist/runner/gateways.d.ts +20 -18
  288. package/dist/runner/index.d.ts +8 -7
  289. package/dist/runner/index.js +5 -3
  290. package/dist/runner/live/checkout-gateway.js +15 -7
  291. package/dist/runner/live/snapshot-records.js +7 -17
  292. package/dist/runner/prepare.d.ts +17 -50
  293. package/dist/runner/prepare.js +21 -25
  294. package/dist/runner/ready.d.ts +15 -11
  295. package/dist/runner/ready.js +32 -40
  296. package/dist/runner/recipe.d.ts +4 -18
  297. package/dist/runner/recipe.js +1 -13
  298. package/dist/runner/scope.d.ts +8 -32
  299. package/dist/runner/scope.js +4 -12
  300. package/dist/runner/secrets.d.ts +6 -0
  301. package/dist/runner/secrets.js +10 -0
  302. package/dist/runner/session.d.ts +19 -38
  303. package/dist/runner/session.js +16 -55
  304. package/dist/runner/snapshot-build.d.ts +21 -11
  305. package/dist/runner/snapshot-build.js +11 -16
  306. package/dist/runner/snapshot-cache.d.ts +98 -72
  307. package/dist/runner/snapshot-cache.js +69 -118
  308. package/dist/runner/snapshot-inspect.d.ts +85 -0
  309. package/dist/runner/snapshot-inspect.js +164 -0
  310. package/dist/runner/snapshot-key.d.ts +13 -15
  311. package/dist/runner/snapshot-key.js +15 -22
  312. package/dist/sdk/extension/commands.d.ts +35 -17
  313. package/dist/sdk/extension/commands.js +13 -11
  314. package/dist/sdk/extension/driver.d.ts +143 -0
  315. package/dist/sdk/extension/driver.js +28 -0
  316. package/dist/sdk/extension/index.d.ts +2 -1
  317. package/dist/sdk/extension/index.js +15 -9
  318. package/dist/sdk/extension/{launcher-supplies.d.ts → launcher-context.d.ts} +3 -3
  319. package/dist/sdk/extension/launcher-context.js +5 -0
  320. package/dist/sdk/extension/lifecycle.d.ts +6 -5
  321. package/dist/sdk/extension/lifecycle.js +2 -2
  322. package/dist/sdk/extension/resource-definition.d.ts +13 -13
  323. package/dist/sdk/extension/resource-definition.js +2 -2
  324. package/dist/sdk/extension/resource.d.ts +13 -13
  325. package/dist/sdk/extension/resource.js +11 -11
  326. package/dist/sdk/extension/time.js +2 -2
  327. package/dist/sdk/index.d.ts +2 -0
  328. package/dist/sdk/index.js +3 -1
  329. package/dist/sdk/run/launcher.d.ts +1 -1
  330. package/dist/sdk/run/launcher.js +4 -3
  331. package/dist/sdk/run/payload.js +1 -1
  332. package/dist/sdk/run/test-events.d.ts +24 -18
  333. package/dist/sdk/run/test-events.js +5 -4
  334. package/dist/sdk/run/test-result-writer.d.ts +77 -0
  335. package/dist/sdk/run/test-result-writer.js +143 -0
  336. package/dist/sdk/run/worker-test-event-writer.d.ts +13 -0
  337. package/dist/sdk/run/worker-test-event-writer.js +31 -0
  338. package/dist/vendor/testserver-sdk/container/container.d.ts +1 -6
  339. package/dist/vendor/testserver-sdk/container/container.js +1 -5
  340. package/dist/vendor/testserver-sdk/factories/build.d.ts +12 -40
  341. package/dist/vendor/testserver-sdk/factories/build.js +15 -66
  342. package/dist/vendor/testserver-sdk/factories/gateways.d.ts +1 -2
  343. package/dist/vendor/testserver-sdk/factories/index.d.ts +1 -3
  344. package/dist/vendor/testserver-sdk/factories/index.js +3 -5
  345. package/dist/vendor/testserver-sdk/index.d.ts +1 -2
  346. package/dist/vendor/testserver-sdk/index.js +5 -6
  347. package/dist/vendor/testserver-sdk/records/body.d.ts +1 -1
  348. package/dist/vendor/testserver-sdk/records/body.js +1 -1
  349. package/dist/vitest/index.d.ts +2 -1
  350. package/dist/vitest/index.js +6 -4
  351. package/dist/vitest/test-events.d.ts +6 -16
  352. package/dist/vitest/test-events.js +15 -40
  353. package/dist/vitest/test-results.d.ts +9 -31
  354. package/dist/vitest/test-results.js +34 -105
  355. package/dist/vitest/worker-index.d.ts +6 -0
  356. package/dist/vitest/worker-index.js +17 -0
  357. package/package.json +23 -9
  358. package/skills/overview.md +6 -8
  359. package/skills/read-run-output.md +21 -7
  360. package/dist/chunks/chunk-FVMQKYTT.js +0 -10
  361. package/dist/chunks/chunk-SLNKW4ZM.js +0 -40
  362. package/dist/chunks/chunk-WNIQA5J6.js +0 -19
  363. package/dist/chunks/chunk-WSIF7SR6.js +0 -10
  364. package/dist/commands/vitest/outcomes.d.ts +0 -379
  365. package/dist/commands/vitest/outcomes.js +0 -70
  366. package/dist/core/launcher-supplies.d.ts +0 -11
  367. package/dist/core/launcher-supplies.js +0 -28
  368. package/dist/core/live/terminal-command-gateway.d.ts +0 -8
  369. package/dist/core/live/terminal-command-gateway.js +0 -49
  370. package/dist/core/resource-registry.js +0 -30
  371. package/dist/extensions/github/live/world.d.ts +0 -6
  372. package/dist/extensions/github/live/world.js +0 -16
  373. package/dist/extensions/github/world.js +0 -3
  374. package/dist/extensions/story/command-tree.d.ts +0 -6
  375. package/dist/extensions/story/command-tree.js +0 -21
  376. package/dist/extensions/story/commands/app.d.ts +0 -23
  377. package/dist/extensions/story/commands/app.js +0 -5
  378. package/dist/extensions/story/commands/run/command.d.ts +0 -211
  379. package/dist/extensions/story/commands/run/command.js +0 -259
  380. package/dist/extensions/story/commands/run/metadata.js +0 -8
  381. package/dist/extensions/story/commands/run/outcomes.d.ts +0 -101
  382. package/dist/extensions/story/commands/run/outcomes.js +0 -73
  383. package/dist/extensions/story/commands/tree.d.ts +0 -2
  384. package/dist/extensions/story/commands/tree.js +0 -6
  385. package/dist/extensions/story/extension.d.ts +0 -2
  386. package/dist/extensions/story/extension.js +0 -8
  387. package/dist/extensions/testserver/live/world.d.ts +0 -8
  388. package/dist/extensions/testserver/vitest/sandbox.d.ts +0 -25
  389. package/dist/extensions/testserver/vitest/sandbox.js +0 -43
  390. package/dist/extensions/testserver/world.js +0 -4
  391. package/dist/runner/snapshot-save.d.ts +0 -56
  392. package/dist/runner/snapshot-save.js +0 -151
  393. package/dist/sdk/extension/launcher-supplies.js +0 -3
  394. package/dist/story/align.d.ts +0 -37
  395. package/dist/story/align.js +0 -39
  396. package/dist/story/command-line.d.ts +0 -24
  397. package/dist/story/command-line.js +0 -88
  398. package/dist/story/definition.d.ts +0 -59
  399. package/dist/story/definition.js +0 -9
  400. package/dist/story/diff.d.ts +0 -9
  401. package/dist/story/diff.js +0 -97
  402. package/dist/story/errors.d.ts +0 -14
  403. package/dist/story/errors.js +0 -21
  404. package/dist/story/gateways.d.ts +0 -94
  405. package/dist/story/gateways.js +0 -3
  406. package/dist/story/host.d.ts +0 -30
  407. package/dist/story/host.js +0 -97
  408. package/dist/story/index.d.ts +0 -8
  409. package/dist/story/index.js +0 -11
  410. package/dist/story/json.d.ts +0 -16
  411. package/dist/story/json.js +0 -59
  412. package/dist/story/launch.d.ts +0 -70
  413. package/dist/story/launch.js +0 -77
  414. package/dist/story/live/recording-gateway.d.ts +0 -2
  415. package/dist/story/live/recording-gateway.js +0 -103
  416. package/dist/story/orphans.d.ts +0 -35
  417. package/dist/story/orphans.js +0 -51
  418. package/dist/story/recording.d.ts +0 -62
  419. package/dist/story/recording.js +0 -97
  420. package/dist/story/report.d.ts +0 -42
  421. package/dist/story/report.js +0 -129
  422. package/dist/story/sequence.d.ts +0 -30
  423. package/dist/story/sequence.js +0 -74
  424. package/dist/story/settle.d.ts +0 -96
  425. package/dist/story/settle.js +0 -71
  426. package/dist/story/start.d.ts +0 -50
  427. package/dist/story/start.js +0 -183
  428. package/dist/vendor/testserver-sdk/factories/definition.d.ts +0 -39
  429. package/dist/vendor/testserver-sdk/factories/definition.js +0 -16
  430. package/dist/vendor/testserver-sdk/factories/definitions.d.ts +0 -169
  431. package/dist/vendor/testserver-sdk/factories/definitions.js +0 -245
  432. package/dist/vendor/testserver-sdk/seed/index.d.ts +0 -1
  433. package/dist/vendor/testserver-sdk/seed/index.js +0 -3
  434. package/dist/vendor/testserver-sdk/seed/seed.d.ts +0 -221
  435. package/dist/vendor/testserver-sdk/seed/seed.js +0 -171
  436. package/dist/vitest/find-vitest.d.ts +0 -7
  437. package/dist/vitest/find-vitest.js +0 -28
  438. package/dist/vitest/gateways.js +0 -4
  439. package/dist/vitest/plan.d.ts +0 -51
  440. /package/dist/{extensions/story/commands/run → commands/playwright}/metadata.d.ts +0 -0
  441. /package/dist/{vitest → extensions/vitest/plan}/list-output.d.ts +0 -0
  442. /package/dist/{vitest → extensions/vitest/plan}/list-output.js +0 -0
@@ -1,183 +1,26 @@
1
1
  import {
2
2
  testserverPoolDefinition
3
- } from "./chunk-OJOKQRM6.js";
3
+ } from "./chunk-IYM44FUX.js";
4
4
  import {
5
- storyExtensionCommands,
6
- testserverExtensionCommands
7
- } from "./chunk-SLNKW4ZM.js";
8
- import {
9
- defineExtension
10
- } from "./chunk-ICB4BZJX.js";
11
- import {
12
- resourceRegistry,
5
+ driverContexts,
6
+ driversOf,
7
+ resourceDefinitionSet,
13
8
  resourcesOf
14
- } from "./chunk-KR7WIYLG.js";
9
+ } from "./chunk-6EQKA7LI.js";
15
10
  import {
11
+ argsText,
16
12
  booleanOption,
13
+ defineDriver,
17
14
  defineResource,
18
15
  mustBe,
19
16
  resourceFactory
20
- } from "./chunk-AMTYHUYB.js";
21
-
22
- // src/vitest/list-output.ts
23
- import { z } from "zod";
24
- var VITEST_LIST = z.array(z.looseObject({ name: z.string(), file: z.string() }));
25
- function readVitestList(stdout) {
26
- let document;
27
- try {
28
- document = JSON.parse(stdout);
29
- } catch {
30
- throw new Error("`vitest list --json` did not print JSON");
31
- }
32
- const parsed = VITEST_LIST.safeParse(document);
33
- if (!parsed.success) throw new Error("`vitest list --json` did not print a list of tests");
34
- return parsed.data.map(({ name, file }) => ({ name, file }));
35
- }
36
-
37
- // src/vitest/live/list-gateway.ts
38
- import { spawn } from "node:child_process";
39
- import { constants } from "node:fs";
40
- import { access } from "node:fs/promises";
41
- import { join as join2 } from "node:path";
42
-
43
- // src/vitest/find-vitest.ts
44
- import { dirname, join, relative, isAbsolute } from "node:path";
45
- var VITEST_BIN = join("node_modules", ".bin", "vitest");
46
- function vitestSearchDirectories(from, root) {
47
- const inside = from === root || isInside(root, from);
48
- const directories = [];
49
- let directory = from;
50
- for (; ; ) {
51
- directories.push(directory);
52
- if (inside && directory === root) return directories;
53
- const parent = dirname(directory);
54
- if (parent === directory) return directories;
55
- directory = parent;
56
- }
57
- }
58
- function isInside(directory, path) {
59
- const between = relative(directory, path);
60
- return between !== "" && !between.startsWith("..") && !isAbsolute(between);
61
- }
62
-
63
- // src/vitest/live/list-gateway.ts
64
- var liveVitestListGateway = {
65
- async findVitest({ from, root }) {
66
- const searched = vitestSearchDirectories(from, root);
67
- for (const directory of searched) {
68
- const path = join2(directory, VITEST_BIN);
69
- try {
70
- await access(path, constants.X_OK);
71
- return { ok: true, path };
72
- } catch {
73
- }
74
- }
75
- return { ok: false, searched };
76
- },
77
- listTests(request) {
78
- return new Promise((resolve) => {
79
- let settled = false;
80
- const settle = (result) => {
81
- if (settled) return;
82
- settled = true;
83
- resolve(result);
84
- };
85
- const timeout = AbortSignal.timeout(request.timeoutMs);
86
- const child = spawn(request.executable ?? "vitest", listArgv(request.args), {
87
- ...request.cwd === void 0 ? {} : { cwd: request.cwd },
88
- stdio: ["ignore", "pipe", "pipe"],
89
- signal: request.signal === void 0 ? timeout : AbortSignal.any([timeout, request.signal])
90
- });
91
- let stopped;
92
- let stdout = "";
93
- let stderr = "";
94
- child.stdout.setEncoding("utf8").on("data", (chunk) => {
95
- stdout += chunk;
96
- });
97
- child.stderr.setEncoding("utf8").on("data", (chunk) => {
98
- stderr += chunk;
99
- });
100
- child.on("error", (error) => {
101
- if (error.name !== "AbortError") {
102
- settle({ ok: false, failure: { kind: "start-failed", message: error.message } });
103
- return;
104
- }
105
- stopped = request.signal?.aborted === true ? { kind: "canceled" } : { kind: "timed-out", timeoutMs: request.timeoutMs };
106
- if (child.exitCode !== null || child.signalCode !== null) settle({ ok: false, failure: stopped });
107
- });
108
- child.on("exit", () => {
109
- if (stopped !== void 0) settle({ ok: false, failure: stopped });
110
- });
111
- child.on("close", (exitCode, signal) => {
112
- if (stopped !== void 0) {
113
- settle({ ok: false, failure: stopped });
114
- return;
115
- }
116
- if (exitCode !== 0) {
117
- settle({ ok: false, failure: { kind: "exited", exitCode, signal, lastStderrLine: lastLine(stderr) } });
118
- return;
119
- }
120
- try {
121
- settle({ ok: true, tests: readVitestList(stdout) });
122
- } catch (error) {
123
- settle({ ok: false, failure: { kind: "unreadable-output", message: error.message } });
124
- }
125
- });
126
- });
127
- }
128
- };
129
- function lastLine(text) {
130
- return text.split(/\r?\n/).map((line) => line.trim()).findLast((line) => line !== "" && !/^at\s/.test(line)) ?? "";
131
- }
132
- function listArgv(args) {
133
- const end = args.indexOf("--");
134
- return end === -1 ? ["list", ...args, "--json"] : ["list", ...args.slice(0, end), "--json", ...args.slice(end)];
135
- }
136
-
137
- // src/vitest/plan.ts
138
- var LIST_TIMEOUT_MS = 6e4;
139
- async function planVitestRun(options, gateway = liveVitestListGateway) {
140
- const timeoutMs = options.timeoutMs ?? LIST_TIMEOUT_MS;
141
- if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
142
- throw new TypeError(`planVitestRun: timeoutMs is ${String(timeoutMs)}, not a positive number`);
143
- }
144
- const listed = await gateway.listTests({
145
- args: options.args,
146
- ...options.cwd === void 0 ? {} : { cwd: options.cwd },
147
- ...options.executable === void 0 ? {} : { executable: options.executable },
148
- timeoutMs,
149
- ...options.signal === void 0 ? {} : { signal: options.signal }
150
- });
151
- return listed.ok ? { ok: true, plan: planOf(listed.tests) } : { ok: false, failure: listed.failure };
152
- }
153
- function vitestRunArgv(executable, args) {
154
- return [executable, "run", ...args];
155
- }
156
- function formatPlan(plan) {
157
- return `${plan.tests} ${plan.tests === 1 ? "test" : "tests"} in ${plan.files} ${plan.files === 1 ? "file" : "files"}`;
158
- }
159
- function planOf(tests) {
160
- return { tests: tests.length, files: new Set(tests.map((test) => test.file)).size };
161
- }
162
- function describeVitestListFailure(failure) {
163
- switch (failure.kind) {
164
- case "start-failed":
165
- return `\`vitest list\` failed to start: ${failure.message}`;
166
- case "timed-out":
167
- return `\`vitest list\` did not finish in ${failure.timeoutMs / 1e3}s`;
168
- case "exited": {
169
- const how = failure.exitCode === null ? `was ended by ${failure.signal ?? "a signal"}` : `exited ${failure.exitCode}`;
170
- return `\`vitest list\` ${how}${failure.lastStderrLine === "" ? "" : `: ${failure.lastStderrLine}`}`;
171
- }
172
- case "unreadable-output":
173
- return failure.message;
174
- case "canceled":
175
- return "`vitest list` was canceled";
176
- }
177
- }
178
-
179
- // src/extensions/story/extension.ts
180
- var storyExtension = defineExtension({ name: "story", resources: [], commands: storyExtensionCommands });
17
+ } from "./chunk-YT5OROR7.js";
18
+ import {
19
+ testserverExtensionCommands
20
+ } from "./chunk-GQIL3AHY.js";
21
+ import {
22
+ defineExtension
23
+ } from "./chunk-GSC6SRTW.js";
181
24
 
182
25
  // src/extensions/github/release.ts
183
26
  function fixtureRepoCleanupFailureText(cleanup, failure) {
@@ -271,15 +114,15 @@ function failureText(failure) {
271
114
  }
272
115
 
273
116
  // src/extensions/github/lifecycle.ts
274
- function tokenIn(world, tokenEnv) {
275
- const token = world.env[tokenEnv];
117
+ function tokenIn(context, tokenEnv) {
118
+ const token = context.env[tokenEnv];
276
119
  return token === void 0 || token === "" ? void 0 : token;
277
120
  }
278
- function githubFixtureRepoLifecycle(world) {
121
+ function githubFixtureRepoLifecycle(context) {
279
122
  return {
280
123
  // No I/O: the token, when the launcher has it, for a refusal that comes before `beforeRun`.
281
124
  secrets: ({ options }) => {
282
- const token = tokenIn(world, options.tokenEnv);
125
+ const token = tokenIn(context, options.tokenEnv);
283
126
  return token === void 0 ? [] : [token];
284
127
  },
285
128
  beforeRun: async ({
@@ -287,7 +130,7 @@ function githubFixtureRepoLifecycle(world) {
287
130
  sources
288
131
  }) => {
289
132
  const { repo, tokenEnv, optional } = options;
290
- const token = tokenIn(world, tokenEnv);
133
+ const token = tokenIn(context, tokenEnv);
291
134
  if (token !== void 0)
292
135
  return { use: { secrets: { token }, needsVercelCredential: false, hiddenVariables: [] } };
293
136
  if (optional)
@@ -303,9 +146,9 @@ function githubFixtureRepoLifecycle(world) {
303
146
  report
304
147
  }) => {
305
148
  const opened = await openFixtureRepo(
306
- world,
149
+ context,
307
150
  { repo: options.repo, token: secrets.token },
308
- { startedAt: world.clock.now(), suffix: world.randomSuffix() }
151
+ { startedAt: context.clock.now(), suffix: context.randomSuffix() }
309
152
  );
310
153
  if (opened.kind === "unavailable")
311
154
  return githubFixtureRepoUnavailable({
@@ -323,7 +166,7 @@ function githubFixtureRepoLifecycle(world) {
323
166
  report
324
167
  }) => {
325
168
  if (repo === void 0) return { nothingTaken: true };
326
- const cleaned = await cleanupFixtureRepo(world, repo);
169
+ const cleaned = await cleanupFixtureRepo(context, repo);
327
170
  await report.cleanup(fixtureRepoCleanedText(repo.nameWithOwner, cleaned));
328
171
  for (const { reason, message } of fixtureRepoCleanupWarnings(cleaned)) await report.warning(reason, message);
329
172
  return githubFixtureRepoReleased(cleaned);
@@ -331,14 +174,14 @@ function githubFixtureRepoLifecycle(world) {
331
174
  };
332
175
  }
333
176
 
334
- // src/extensions/github/live/world.ts
177
+ // src/extensions/github/live/context.ts
335
178
  import { randomBytes } from "node:crypto";
336
179
 
337
180
  // src/extensions/github/live/fixture-repo-gateway.ts
338
- import { z as z2 } from "zod";
339
- var repoSchema = z2.object({ full_name: z2.string().min(1), clone_url: z2.string().min(1) });
340
- var refsSchema = z2.array(z2.object({ ref: z2.string() }));
341
- var errorSchema = z2.object({ message: z2.string() });
181
+ import { z } from "zod";
182
+ var repoSchema = z.object({ full_name: z.string().min(1), clone_url: z.string().min(1) });
183
+ var refsSchema = z.array(z.object({ ref: z.string() }));
184
+ var errorSchema = z.object({ message: z.string() });
342
185
  function liveGitHubFixtureRepoGateway(options) {
343
186
  return {
344
187
  readRepo: async ({ repo, token }) => {
@@ -410,25 +253,25 @@ async function call(options, token, method, path) {
410
253
  }
411
254
  }
412
255
 
413
- // src/extensions/github/live/world.ts
256
+ // src/extensions/github/live/context.ts
414
257
  var GITHUB_API_ORIGIN = "https://api.github.com";
415
- function liveGitHubWorld(supplies) {
258
+ function liveGitHubFixtureRepoContext({ env, clock }) {
416
259
  return {
417
- env: supplies.env,
260
+ env,
418
261
  githubFixtureRepos: liveGitHubFixtureRepoGateway({ origin: GITHUB_API_ORIGIN, timeoutMs: 1e4 }),
419
262
  randomSuffix: () => randomBytes(4).toString("hex"),
420
- clock: supplies.clock
263
+ clock
421
264
  };
422
265
  }
423
266
 
424
267
  // src/extensions/github/options.ts
425
- import { z as z3 } from "zod";
268
+ import { z as z2 } from "zod";
426
269
  var REPO_NAME = /^[\w.-]+\/[\w.-]+$/;
427
270
  var ENV_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
428
271
  var REPO = "a repository as owner/name";
429
- var repoName = z3.string(mustBe(REPO)).regex(REPO_NAME, mustBe(REPO));
272
+ var repoName = z2.string(mustBe(REPO)).regex(REPO_NAME, mustBe(REPO));
430
273
  var ENV = "an environment variable's name";
431
- var envName = z3.string(mustBe(ENV)).regex(ENV_NAME, mustBe(ENV));
274
+ var envName = z2.string(mustBe(ENV)).regex(ENV_NAME, mustBe(ENV));
432
275
  var githubFixtureRepoRules = {
433
276
  /** The repository, as `owner/name`. storm creates no repository; this one must exist. */
434
277
  repo: { schema: repoName, required: true },
@@ -478,7 +321,7 @@ var githubFixtureRepoDefinition = defineResource({
478
321
  flagPrefix: "github",
479
322
  options: githubFixtureRepoRules,
480
323
  payload: githubFixtureRepoPayload,
481
- world: liveGitHubWorld,
324
+ context: liveGitHubFixtureRepoContext,
482
325
  lifecycle: githubFixtureRepoLifecycle
483
326
  });
484
327
 
@@ -488,6 +331,249 @@ var githubExtension = defineExtension({ name: "github", resources: [githubFixtur
488
331
  // src/extensions/github/resource.ts
489
332
  var githubFixtureRepo = resourceFactory(githubFixtureRepoDefinition);
490
333
 
334
+ // src/extensions/playwright/plan/live/list-gateway.ts
335
+ import { spawn } from "node:child_process";
336
+ import { mkdtemp, readFile, rm } from "node:fs/promises";
337
+ import { tmpdir } from "node:os";
338
+ import { join } from "node:path";
339
+
340
+ // src/extensions/playwright/plan/list-output.ts
341
+ import { resolve } from "node:path";
342
+ import { z as z3 } from "zod";
343
+ var SPEC = z3.looseObject({
344
+ title: z3.string(),
345
+ /** Its file, relative to the config's `rootDir`. */
346
+ file: z3.string(),
347
+ tests: z3.array(z3.looseObject({ projectName: z3.string() }))
348
+ });
349
+ var SUITE = z3.lazy(
350
+ () => z3.looseObject({ title: z3.string(), specs: z3.array(SPEC).optional(), suites: z3.array(SUITE).optional() })
351
+ );
352
+ var REPORT = z3.looseObject({
353
+ config: z3.looseObject({ rootDir: z3.string() }),
354
+ suites: z3.array(SUITE),
355
+ errors: z3.array(z3.looseObject({ message: z3.string().optional() })).optional()
356
+ });
357
+ function readPlaywrightList(report) {
358
+ let document;
359
+ try {
360
+ document = JSON.parse(report);
361
+ } catch {
362
+ throw new Error("`playwright test --list --reporter=json` did not write JSON");
363
+ }
364
+ const parsed = REPORT.safeParse(document);
365
+ if (!parsed.success) throw new Error("`playwright test --list --reporter=json` did not write a list of tests");
366
+ const { config, suites, errors } = parsed.data;
367
+ const tests = [];
368
+ for (const file of suites) collect(file, [], config.rootDir, tests);
369
+ return { tests, errors: (errors ?? []).map(({ message }) => message ?? "") };
370
+ }
371
+ function collect(suite, titles, rootDir, into) {
372
+ for (const spec of suite.specs ?? []) {
373
+ const name = [...titles, spec.title].join(" > ");
374
+ const file = resolve(rootDir, spec.file);
375
+ for (const { projectName } of spec.tests) into.push({ name, file, project: projectName });
376
+ }
377
+ for (const nested of suite.suites ?? []) collect(nested, [...titles, nested.title], rootDir, into);
378
+ }
379
+ var NO_TESTS_FOUND = /^Error: No tests found\b/;
380
+ function playwrightListResult(end) {
381
+ let list;
382
+ if (end.report !== void 0) {
383
+ try {
384
+ list = readPlaywrightList(end.report);
385
+ } catch (error) {
386
+ if (end.exitCode === 0)
387
+ return { ok: false, failure: { kind: "unreadable-output", message: error.message } };
388
+ }
389
+ }
390
+ if (end.exitCode === 0) {
391
+ if (list !== void 0) return { ok: true, tests: list.tests };
392
+ return {
393
+ ok: false,
394
+ failure: { kind: "unreadable-output", message: "`playwright test --list --reporter=json` wrote no report" }
395
+ };
396
+ }
397
+ if (list !== void 0 && list.tests.length === 0 && list.errors.length > 0) {
398
+ if (list.errors.every((message) => NO_TESTS_FOUND.test(message))) return { ok: true, tests: [] };
399
+ }
400
+ const said = firstLine(list?.errors.find((message) => message !== "") ?? "") || lastLine(end.stderr);
401
+ return { ok: false, failure: { kind: "exited", exitCode: end.exitCode, signal: end.signal, said } };
402
+ }
403
+ function firstLine(text) {
404
+ return text.split(/\r?\n/).map((line) => line.trim()).find((line) => line !== "") ?? "";
405
+ }
406
+ function lastLine(text) {
407
+ return text.split(/\r?\n/).map((line) => line.trim()).findLast((line) => line !== "" && !/^at\s/.test(line)) ?? "";
408
+ }
409
+
410
+ // src/extensions/playwright/plan/live/list-gateway.ts
411
+ var JSON_OUTPUT_FILE = "PLAYWRIGHT_JSON_OUTPUT_FILE";
412
+ var livePlaywrightListGateway = {
413
+ async listTests(request) {
414
+ let directory;
415
+ try {
416
+ directory = await mkdtemp(join(tmpdir(), "storm-playwright-list-"));
417
+ } catch (error) {
418
+ return { ok: false, failure: { kind: "start-failed", message: error.message } };
419
+ }
420
+ const reportFile = join(directory, "list.json");
421
+ try {
422
+ const ended = await run(request, reportFile);
423
+ if ("failure" in ended) return { ok: false, failure: ended.failure };
424
+ let report;
425
+ try {
426
+ report = await readFile(reportFile, "utf8");
427
+ } catch {
428
+ }
429
+ return playwrightListResult({ ...ended, report });
430
+ } finally {
431
+ await rm(directory, { recursive: true, force: true }).catch(() => void 0);
432
+ }
433
+ }
434
+ };
435
+ function run(request, reportFile) {
436
+ return new Promise((resolve2) => {
437
+ let settled = false;
438
+ const settle = (ended) => {
439
+ if (settled) return;
440
+ settled = true;
441
+ resolve2(ended);
442
+ };
443
+ const timeout = AbortSignal.timeout(request.timeoutMs);
444
+ const child = spawn(request.executable ?? "playwright", listArgv(request.args), {
445
+ ...request.cwd === void 0 ? {} : { cwd: request.cwd },
446
+ env: { ...process.env, [JSON_OUTPUT_FILE]: reportFile },
447
+ stdio: ["ignore", "ignore", "pipe"],
448
+ signal: request.signal === void 0 ? timeout : AbortSignal.any([timeout, request.signal])
449
+ });
450
+ let stopped;
451
+ let stderr = "";
452
+ child.stderr.setEncoding("utf8").on("data", (chunk) => {
453
+ stderr += chunk;
454
+ });
455
+ child.on("error", (error) => {
456
+ if (error.name !== "AbortError") {
457
+ settle({ failure: { kind: "start-failed", message: error.message } });
458
+ return;
459
+ }
460
+ stopped = request.signal?.aborted === true ? { kind: "canceled" } : { kind: "timed-out", timeoutMs: request.timeoutMs };
461
+ if (child.exitCode !== null || child.signalCode !== null) settle({ failure: stopped });
462
+ });
463
+ child.on("exit", () => {
464
+ if (stopped !== void 0) settle({ failure: stopped });
465
+ });
466
+ child.on("close", (exitCode, signal) => {
467
+ settle(stopped === void 0 ? { exitCode, signal, stderr } : { failure: stopped });
468
+ });
469
+ });
470
+ }
471
+ function listArgv(args) {
472
+ const end = args.indexOf("--");
473
+ const flags = ["--list", "--reporter=json"];
474
+ return end === -1 ? ["test", ...args, ...flags] : ["test", ...args.slice(0, end), ...flags, ...args.slice(end)];
475
+ }
476
+
477
+ // src/extensions/playwright/plan/plan.ts
478
+ var LIST_TIMEOUT_MS = 12e4;
479
+ async function planPlaywrightRun(options, gateway = livePlaywrightListGateway) {
480
+ const timeoutMs = options.timeoutMs ?? LIST_TIMEOUT_MS;
481
+ if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
482
+ throw new TypeError(`planPlaywrightRun: timeoutMs is ${String(timeoutMs)}, not a positive number`);
483
+ }
484
+ const listed = await gateway.listTests({
485
+ args: options.args,
486
+ ...options.cwd === void 0 ? {} : { cwd: options.cwd },
487
+ ...options.executable === void 0 ? {} : { executable: options.executable },
488
+ timeoutMs,
489
+ ...options.signal === void 0 ? {} : { signal: options.signal }
490
+ });
491
+ return listed.ok ? { ok: true, plan: planOf(listed.tests) } : { ok: false, failure: listed.failure };
492
+ }
493
+ function playwrightRunArgv(executable, args) {
494
+ return [executable, "test", ...args];
495
+ }
496
+ function planOf(tests) {
497
+ return { tests: tests.length, files: new Set(tests.map((test) => test.file)).size };
498
+ }
499
+ function describePlaywrightListFailure(failure) {
500
+ switch (failure.kind) {
501
+ case "start-failed":
502
+ return `\`playwright test --list\` failed to start: ${failure.message}`;
503
+ case "timed-out":
504
+ return `\`playwright test --list\` did not finish in ${failure.timeoutMs / 1e3}s`;
505
+ case "exited": {
506
+ const how = failure.exitCode === null ? `was ended by ${failure.signal ?? "a signal"}` : `exited ${failure.exitCode}`;
507
+ return `\`playwright test --list\` ${how}${failure.said === "" ? "" : `: ${failure.said}`}`;
508
+ }
509
+ case "unreadable-output":
510
+ return failure.message;
511
+ case "canceled":
512
+ return "`playwright test --list` was canceled";
513
+ }
514
+ }
515
+
516
+ // src/extensions/playwright/driver.ts
517
+ var playwrightDriver = defineDriver({
518
+ name: "playwright",
519
+ program: { bin: "playwright" },
520
+ context: () => ({ list: livePlaywrightListGateway }),
521
+ launch: playwrightRunArgv,
522
+ // `playwright test <args> --list`, which may take 120s (`LIST_TIMEOUT_MS`); a failure in
523
+ // `describePlaywrightListFailure`'s words.
524
+ plan: ({ list }) => async ({ args, cwd, bin, signal }) => {
525
+ const planned = await planPlaywrightRun({ args, cwd, executable: bin, signal }, list);
526
+ if (planned.ok) return planned;
527
+ const { failure } = planned;
528
+ return { ok: false, kind: failure.kind, message: describePlaywrightListFailure(failure) };
529
+ },
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.",
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, each resource that sizes itself sized from the test 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
+ hints: {
548
+ // No final result: the Playwright config doesn't list storm's Playwright reporter, or a `--reporter` on
549
+ // Playwright's command line replaced it. A config lists a reporter as a tuple of its module name.
550
+ noFinalResults: 'add ["@vercel/storm/playwright/reporter"] to the reporter list in playwright.config'
551
+ },
552
+ refusals: {
553
+ noMatchingTests: {
554
+ description: "playwright test --list found no test for the arguments given to playwright test, so nothing was minted, acquired or started.",
555
+ message: ({ args, cwd }) => `playwright test --list found no test for playwright test ${argsText(args)} in ${cwd}. The command didn't run.`,
556
+ next: ({ args }) => `Change the arguments given to playwright test (${argsText(args)}), then retry. Put Playwright's own dash options after --.`
557
+ },
558
+ planFailed: {
559
+ description: "storm couldn't count the tests before the run: playwright wasn't found or 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.",
560
+ next: {
561
+ "start-failed": "Install @playwright/test in the package, or run the command with storm exec, which counts nothing.",
562
+ "timed-out": "Check why playwright test --list doesn't finish, such as a config file that waits, then retry.",
563
+ exited: "Fix what playwright test --list reports, then retry.",
564
+ "unreadable-output": "Check that the package's playwright writes its list with --reporter=json to the file PLAYWRIGHT_JSON_OUTPUT_FILE names, then retry."
565
+ }
566
+ }
567
+ }
568
+ });
569
+
570
+ // src/extensions/playwright/extension.ts
571
+ var playwrightExtension = defineExtension({
572
+ name: "playwright",
573
+ resources: [],
574
+ drivers: [playwrightDriver]
575
+ });
576
+
491
577
  // src/extensions/testserver/extension.ts
492
578
  var testserverExtension = defineExtension({
493
579
  name: "testserver",
@@ -517,7 +603,7 @@ var testserverExtension = defineExtension({
517
603
  },
518
604
  {
519
605
  argv: "--unsandboxed --verbose --testserver-sandboxes 2 -- pnpm test",
520
- description: "Run the tests, printing each create's progress and, through the Vitest adapter, each test as it ends."
606
+ description: "Run the tests, printing each create's progress and, through storm's Vitest reporters, each test as it ends."
521
607
  },
522
608
  {
523
609
  argv: "--unsandboxed --credential github-actions --testserver-ttl 30m --testserver-min-time-left 25m -- pnpm test",
@@ -528,42 +614,239 @@ var testserverExtension = defineExtension({
528
614
  description: "Run them on the newest main build, with Testserver sandboxes that live at least 75 more minutes."
529
615
  }
530
616
  ],
531
- vitest: [
532
- {
533
- argv: "--testserver-build pr:104196",
534
- description: "Run every test against the Testserver build of vercel/api pull request 104196's head commit."
535
- },
617
+ drivers: {
618
+ vitest: [
619
+ {
620
+ argv: "--testserver-build pr:104196",
621
+ description: "Run every test against the Testserver build of vercel/api pull request 104196's head commit."
622
+ },
623
+ {
624
+ argv: "--unsandboxed --testserver-create=false",
625
+ description: "Run on this machine, on Testserver sandboxes already in the pool, never minting."
626
+ },
627
+ {
628
+ argv: "--testserver-sandboxes 6 -- --project testserver",
629
+ description: "Run vitest's testserver project against 6 Testserver sandboxes, whatever the test count."
630
+ }
631
+ ],
632
+ playwright: [
633
+ {
634
+ argv: "--unsandboxed --testserver-sandboxes 1 -- --project chromium",
635
+ description: "Run Playwright's chromium project on this machine against 1 Testserver sandbox."
636
+ },
637
+ {
638
+ argv: "--testserver-build pr:104196",
639
+ description: "Run every test against the Testserver build of vercel/api pull request 104196's head commit."
640
+ }
641
+ ]
642
+ }
643
+ }
644
+ });
645
+
646
+ // src/extensions/testserver/resource.ts
647
+ var testserverPool = resourceFactory(testserverPoolDefinition);
648
+
649
+ // src/extensions/vitest/plan/live/list-gateway.ts
650
+ import { spawn as spawn2 } from "node:child_process";
651
+
652
+ // src/extensions/vitest/plan/list-output.ts
653
+ import { z as z4 } from "zod";
654
+ var VITEST_LIST = z4.array(z4.looseObject({ name: z4.string(), file: z4.string() }));
655
+ function readVitestList(stdout) {
656
+ let document;
657
+ try {
658
+ document = JSON.parse(stdout);
659
+ } catch {
660
+ throw new Error("`vitest list --json` did not print JSON");
661
+ }
662
+ const parsed = VITEST_LIST.safeParse(document);
663
+ if (!parsed.success) throw new Error("`vitest list --json` did not print a list of tests");
664
+ return parsed.data.map(({ name, file }) => ({ name, file }));
665
+ }
666
+
667
+ // src/extensions/vitest/plan/live/list-gateway.ts
668
+ var liveVitestListGateway = {
669
+ listTests(request) {
670
+ return new Promise((resolve2) => {
671
+ let settled = false;
672
+ const settle = (result) => {
673
+ if (settled) return;
674
+ settled = true;
675
+ resolve2(result);
676
+ };
677
+ const timeout = AbortSignal.timeout(request.timeoutMs);
678
+ const child = spawn2(request.executable ?? "vitest", listArgv2(request.args), {
679
+ ...request.cwd === void 0 ? {} : { cwd: request.cwd },
680
+ stdio: ["ignore", "pipe", "pipe"],
681
+ signal: request.signal === void 0 ? timeout : AbortSignal.any([timeout, request.signal])
682
+ });
683
+ let stopped;
684
+ let stdout = "";
685
+ let stderr = "";
686
+ child.stdout.setEncoding("utf8").on("data", (chunk) => {
687
+ stdout += chunk;
688
+ });
689
+ child.stderr.setEncoding("utf8").on("data", (chunk) => {
690
+ stderr += chunk;
691
+ });
692
+ child.on("error", (error) => {
693
+ if (error.name !== "AbortError") {
694
+ settle({ ok: false, failure: { kind: "start-failed", message: error.message } });
695
+ return;
696
+ }
697
+ stopped = request.signal?.aborted === true ? { kind: "canceled" } : { kind: "timed-out", timeoutMs: request.timeoutMs };
698
+ if (child.exitCode !== null || child.signalCode !== null) settle({ ok: false, failure: stopped });
699
+ });
700
+ child.on("exit", () => {
701
+ if (stopped !== void 0) settle({ ok: false, failure: stopped });
702
+ });
703
+ child.on("close", (exitCode, signal) => {
704
+ if (stopped !== void 0) {
705
+ settle({ ok: false, failure: stopped });
706
+ return;
707
+ }
708
+ if (exitCode !== 0) {
709
+ settle({ ok: false, failure: { kind: "exited", exitCode, signal, lastStderrLine: lastLine2(stderr) } });
710
+ return;
711
+ }
712
+ try {
713
+ settle({ ok: true, tests: readVitestList(stdout) });
714
+ } catch (error) {
715
+ settle({ ok: false, failure: { kind: "unreadable-output", message: error.message } });
716
+ }
717
+ });
718
+ });
719
+ }
720
+ };
721
+ function lastLine2(text) {
722
+ return text.split(/\r?\n/).map((line) => line.trim()).findLast((line) => line !== "" && !/^at\s/.test(line)) ?? "";
723
+ }
724
+ function listArgv2(args) {
725
+ const end = args.indexOf("--");
726
+ return end === -1 ? ["list", ...args, "--json"] : ["list", ...args.slice(0, end), "--json", ...args.slice(end)];
727
+ }
728
+
729
+ // src/extensions/vitest/plan/plan-over.ts
730
+ var LIST_TIMEOUT_MS2 = 6e4;
731
+ async function planVitestRunOver(options, gateway) {
732
+ const timeoutMs = options.timeoutMs ?? LIST_TIMEOUT_MS2;
733
+ if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
734
+ throw new TypeError(`planVitestRun: timeoutMs is ${String(timeoutMs)}, not a positive number`);
735
+ }
736
+ const listed = await gateway.listTests({
737
+ args: options.args,
738
+ ...options.cwd === void 0 ? {} : { cwd: options.cwd },
739
+ ...options.executable === void 0 ? {} : { executable: options.executable },
740
+ timeoutMs,
741
+ ...options.signal === void 0 ? {} : { signal: options.signal }
742
+ });
743
+ return listed.ok ? { ok: true, plan: planOf2(listed.tests) } : { ok: false, failure: listed.failure };
744
+ }
745
+ function planOf2(tests) {
746
+ return { tests: tests.length, files: new Set(tests.map((test) => test.file)).size };
747
+ }
748
+
749
+ // src/extensions/vitest/plan/plan.ts
750
+ function vitestRunArgv(executable, args) {
751
+ return [executable, "run", ...args];
752
+ }
753
+ function describeVitestListFailure(failure) {
754
+ switch (failure.kind) {
755
+ case "start-failed":
756
+ return `\`vitest list\` failed to start: ${failure.message}`;
757
+ case "timed-out":
758
+ return `\`vitest list\` did not finish in ${failure.timeoutMs / 1e3}s`;
759
+ case "exited": {
760
+ const how = failure.exitCode === null ? `was ended by ${failure.signal ?? "a signal"}` : `exited ${failure.exitCode}`;
761
+ return `\`vitest list\` ${how}${failure.lastStderrLine === "" ? "" : `: ${failure.lastStderrLine}`}`;
762
+ }
763
+ case "unreadable-output":
764
+ return failure.message;
765
+ case "canceled":
766
+ return "`vitest list` was canceled";
767
+ }
768
+ }
769
+
770
+ // src/extensions/vitest/driver.ts
771
+ var vitestDriver = defineDriver({
772
+ name: "vitest",
773
+ program: { bin: "vitest" },
774
+ context: () => ({ list: liveVitestListGateway }),
775
+ launch: vitestRunArgv,
776
+ // `vitest list --json <args>`, which may take 60s (`LIST_TIMEOUT_MS`); a failure in `describeVitestListFailure`'s
777
+ // words.
778
+ plan: ({ list }) => async ({ args, cwd, bin, signal }) => {
779
+ const planned = await planVitestRunOver({ args, cwd, executable: bin, signal }, list);
780
+ if (planned.ok) return planned;
781
+ const { failure } = planned;
782
+ return { ok: false, kind: failure.kind, message: describeVitestListFailure(failure) };
783
+ },
784
+ help: {
785
+ usage: "[<vitest run args>...] [-- <vitest dash options>...]",
786
+ 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 --json gets the same arguments when it counts the tests.",
787
+ // What a Vitest project's storm code does with the run payload's `verbose`: `stormReporters()` picks vitest's
788
+ // `verbose` reporter (`@vercel/storm/vitest/config`), and an extension's Vitest fixtures print as each test
789
+ // goes.
790
+ 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",
791
+ examples: [
536
792
  {
537
- argv: "--unsandboxed --testserver-create=false",
538
- description: "Run on this machine, on Testserver sandboxes already in the pool, never minting."
793
+ argv: "",
794
+ description: "Run every test in a runner sandbox, with the runner recipe, team, project and resources from storm.config.ts, each resource that sizes itself sized from the test count."
539
795
  },
540
796
  {
541
- argv: "--testserver-sandboxes 6 -- --project testserver",
542
- description: "Run vitest's testserver project against 6 Testserver sandboxes, whatever the test count."
797
+ argv: "test/api -- -t creates",
798
+ description: "Run the tests named creates in the files under test/api."
543
799
  }
544
800
  ]
801
+ },
802
+ hints: {
803
+ // No final result: the Vitest config lacks `stormReporter`, or a `--reporter` on vitest's command line replaced it.
804
+ noFinalResults: "add stormReporter() to vitest.config's reporters (@vercel/storm/vitest/config)"
805
+ },
806
+ refusals: {
807
+ noMatchingTests: {
808
+ description: "vitest list found no test for the arguments given to vitest run, so nothing was minted, acquired or started.",
809
+ message: ({ args, cwd }) => `vitest list found no test for vitest run ${argsText(args)} in ${cwd}. The command didn't run.`,
810
+ next: ({ args }) => `Change the arguments given to vitest run (${argsText(args)}), then retry. Put vitest's own dash options after --.`
811
+ },
812
+ planFailed: {
813
+ description: "storm couldn't count the tests before the run: vitest wasn't found or failed to start, didn't finish within 60s, exited other than 0, or printed something other than a list of tests. Nothing was minted, acquired or started.",
814
+ next: {
815
+ "start-failed": "Install vitest in the package, or run the command with storm exec, which counts nothing.",
816
+ "timed-out": "Check why vitest list doesn't finish, such as a global setup that waits, then retry.",
817
+ exited: "Fix what vitest list reports, then retry. vitest list takes the arguments vitest run does, but refuses some run-only options.",
818
+ "unreadable-output": "Check that the package's vitest prints its list with --json, then retry."
819
+ }
820
+ }
545
821
  }
546
822
  });
547
823
 
548
- // src/extensions/testserver/resource.ts
549
- var testserverPool = resourceFactory(testserverPoolDefinition);
824
+ // src/extensions/vitest/extension.ts
825
+ var vitestExtension = defineExtension({ name: "vitest", resources: [], drivers: [vitestDriver] });
550
826
 
551
827
  // src/extensions.ts
552
- var EXTENSIONS = [githubExtension, testserverExtension, storyExtension];
828
+ var EXTENSIONS = [githubExtension, testserverExtension, vitestExtension, playwrightExtension];
553
829
  var RESOURCES = resourcesOf(EXTENSIONS);
554
- var REGISTRY = resourceRegistry(RESOURCES);
555
- function liveWorlds(env) {
556
- return REGISTRY.worlds(env);
830
+ var DEFINITION_SET = resourceDefinitionSet(RESOURCES);
831
+ function liveResourceContexts(env) {
832
+ return DEFINITION_SET.contexts(env);
833
+ }
834
+ var DRIVERS = driversOf(EXTENSIONS);
835
+ function driverNamed(name) {
836
+ const drivers = DRIVERS;
837
+ const driver = drivers.find((each) => each.name === name);
838
+ if (driver === void 0) throw new Error(`No extension in src/extensions.ts brings a driver named ${name}`);
839
+ return driver;
840
+ }
841
+ function liveDriverContexts() {
842
+ return driverContexts(DRIVERS);
557
843
  }
558
844
 
559
845
  export {
560
- liveVitestListGateway,
561
- planVitestRun,
562
- vitestRunArgv,
563
- formatPlan,
564
- describeVitestListFailure,
565
846
  EXTENSIONS,
566
847
  RESOURCES,
567
- REGISTRY,
568
- liveWorlds
848
+ DEFINITION_SET,
849
+ liveResourceContexts,
850
+ driverNamed,
851
+ liveDriverContexts
569
852
  };