@cnc-tools/storm 0.10.0 → 0.12.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 (461) hide show
  1. package/dist/bin/storm.js +12 -9
  2. package/dist/build-info.js +1 -1
  3. package/dist/chunks/{chunk-YF3ICDBY.js → chunk-43MWZLJR.js} +1 -1
  4. package/dist/chunks/chunk-4XT5RC5T.js +98 -0
  5. package/dist/chunks/chunk-7D6LC5JY.js +340 -0
  6. package/dist/chunks/{chunk-WF4KJ7YG.js → chunk-BW2ADH7U.js} +1 -1
  7. package/dist/chunks/chunk-FK4RLDEK.js +40 -0
  8. package/dist/chunks/chunk-FSP3SJ35.js +1429 -0
  9. package/dist/chunks/{chunk-J6ZNYUDV.js → chunk-GQIL3AHY.js} +2 -3
  10. package/dist/chunks/chunk-GSC6SRTW.js +27 -0
  11. package/dist/chunks/chunk-ISGQJIQM.js +852 -0
  12. package/dist/chunks/chunk-IYM44FUX.js +1461 -0
  13. package/dist/chunks/{chunk-XHJGHJBW.js → chunk-LQKNI3EG.js} +38 -279
  14. package/dist/chunks/chunk-NMVODY3P.js +19 -0
  15. package/dist/chunks/{chunk-VJQLMGOH.js → chunk-ODQHQJLE.js} +2761 -3699
  16. package/dist/chunks/chunk-RYRJNHL7.js +55 -0
  17. package/dist/chunks/chunk-SXW6XN4R.js +161 -0
  18. package/dist/chunks/{chunk-OVXD7GES.js → chunk-T6AZIDZD.js} +43 -396
  19. package/dist/chunks/chunk-TEEZL3GA.js +851 -0
  20. package/dist/chunks/chunk-TMQQYHUX.js +80 -0
  21. package/dist/chunks/{chunk-AKKNF3WZ.js → chunk-U7M3ZB3Z.js} +565 -595
  22. package/dist/chunks/{chunk-JQ2HK4RN.js → chunk-Y3BUNNRG.js} +234 -57
  23. package/dist/chunks/{chunk-ZJ2USLAT.js → chunk-YM6TZV4L.js} +394 -416
  24. package/dist/chunks/chunk-YT5OROR7.js +271 -0
  25. package/dist/chunks/{live-app-RIJM3QFD.js → live-app-AZ5N5HBD.js} +36 -12
  26. package/dist/command-tree.d.ts +4 -1
  27. package/dist/command-tree.js +4 -1
  28. package/dist/commands/exec/cleanup.d.ts +3 -3
  29. package/dist/commands/exec/cleanup.js +6 -2
  30. package/dist/commands/exec/command.d.ts +56 -17
  31. package/dist/commands/exec/command.js +51 -39
  32. package/dist/commands/exec/define-run-command.d.ts +752 -0
  33. package/dist/commands/exec/define-run-command.js +58 -0
  34. package/dist/commands/exec/driver-plan.d.ts +30 -0
  35. package/dist/commands/exec/driver-plan.js +44 -0
  36. package/dist/commands/exec/driver-refusals.d.ts +89 -0
  37. package/dist/commands/exec/driver-refusals.js +65 -0
  38. package/dist/commands/exec/exec-words.d.ts +5 -0
  39. package/dist/commands/exec/exec-words.js +31 -0
  40. package/dist/commands/exec/job-summary.d.ts +1 -1
  41. package/dist/commands/exec/job-summary.js +1 -1
  42. package/dist/commands/exec/live-view.js +58 -28
  43. package/dist/commands/exec/mint-failed.js +5 -5
  44. package/dist/commands/exec/outcomes.d.ts +72 -10
  45. package/dist/commands/exec/outcomes.js +38 -10
  46. package/dist/commands/exec/plan-run.d.ts +3 -5
  47. package/dist/commands/exec/plan-run.js +3 -3
  48. package/dist/commands/exec/progress.d.ts +35 -15
  49. package/dist/commands/exec/progress.js +82 -57
  50. package/dist/commands/exec/resource-flags.d.ts +10 -3
  51. package/dist/commands/exec/resource-flags.js +25 -14
  52. package/dist/commands/exec/resource-refusals.d.ts +2 -2
  53. package/dist/commands/exec/resource-refusals.js +10 -10
  54. package/dist/commands/exec/run-bin.d.ts +35 -0
  55. package/dist/commands/exec/run-bin.js +32 -0
  56. package/dist/commands/exec/run-command.d.ts +85 -20
  57. package/dist/commands/exec/run-command.js +142 -238
  58. package/dist/commands/exec/run-metadata.d.ts +29 -17
  59. package/dist/commands/exec/run-metadata.js +38 -16
  60. package/dist/commands/exec/snapshot-text.d.ts +40 -0
  61. package/dist/commands/exec/snapshot-text.js +112 -0
  62. package/dist/commands/exec/test-plan.d.ts +3 -37
  63. package/dist/commands/exec/test-plan.js +11 -28
  64. package/dist/commands/exec/tests-summary.d.ts +21 -12
  65. package/dist/commands/exec/tests-summary.js +67 -39
  66. package/dist/commands/exec/text.d.ts +5 -0
  67. package/dist/commands/exec/text.js +7 -0
  68. package/dist/commands/exec/view.js +22 -13
  69. package/dist/commands/exec/waterfall.d.ts +3 -1
  70. package/dist/commands/exec/waterfall.js +20 -3
  71. package/dist/commands/exec/worker-chart.d.ts +19 -11
  72. package/dist/commands/exec/worker-chart.js +66 -36
  73. package/dist/commands/playwright/command.d.ts +746 -0
  74. package/dist/commands/playwright/command.js +31 -0
  75. package/dist/commands/playwright/metadata.d.ts +4 -0
  76. package/dist/commands/playwright/metadata.js +8 -0
  77. package/dist/commands/runs/facts.d.ts +22 -8
  78. package/dist/commands/runs/facts.js +19 -9
  79. package/dist/commands/runs/list/command.d.ts +34 -8
  80. package/dist/commands/runs/list/command.js +18 -13
  81. package/dist/commands/runs/list/outcomes.d.ts +17 -4
  82. package/dist/commands/runs/logs/command.js +20 -14
  83. package/dist/commands/runs/logs/outcomes.js +1 -1
  84. package/dist/commands/runs/past-run.d.ts +3 -27
  85. package/dist/commands/runs/past-run.js +3 -37
  86. package/dist/commands/runs/show/command.d.ts +36 -8
  87. package/dist/commands/runs/show/command.js +53 -33
  88. package/dist/commands/runs/show/metadata.js +1 -1
  89. package/dist/commands/runs/show/outcomes.d.ts +18 -4
  90. package/dist/commands/runs/show/outcomes.js +37 -16
  91. package/dist/commands/snapshots/build/command.d.ts +898 -0
  92. package/dist/commands/snapshots/build/command.js +511 -0
  93. package/dist/commands/snapshots/build/metadata.d.ts +28 -0
  94. package/dist/commands/snapshots/build/metadata.js +34 -0
  95. package/dist/commands/snapshots/build/outcomes.d.ts +484 -0
  96. package/dist/commands/snapshots/build/outcomes.js +322 -0
  97. package/dist/commands/snapshots/list/command.d.ts +272 -0
  98. package/dist/commands/snapshots/list/command.js +305 -0
  99. package/dist/commands/snapshots/list/metadata.d.ts +16 -0
  100. package/dist/commands/snapshots/list/metadata.js +24 -0
  101. package/dist/commands/snapshots/list/outcomes.d.ts +183 -0
  102. package/dist/commands/snapshots/list/outcomes.js +257 -0
  103. package/dist/commands/snapshots/metadata.d.ts +3 -0
  104. package/dist/commands/snapshots/metadata.js +7 -0
  105. package/dist/commands/vitest/command.d.ts +267 -298
  106. package/dist/commands/vitest/command.js +23 -174
  107. package/dist/commands/vitest/metadata.js +1 -1
  108. package/dist/config/credential-resolver.d.ts +6 -3
  109. package/dist/config/credential-resolver.js +6 -5
  110. package/dist/config-file/define.d.ts +1 -1
  111. package/dist/context.d.ts +44 -24
  112. package/dist/context.js +20 -13
  113. package/dist/core/before-run.d.ts +7 -6
  114. package/dist/core/before-run.js +9 -9
  115. package/dist/core/definition-lookup.d.ts +22 -0
  116. package/dist/core/definition-lookup.js +35 -0
  117. package/dist/core/drivers-of.d.ts +23 -0
  118. package/dist/core/drivers-of.js +13 -0
  119. package/dist/core/events.d.ts +6 -22
  120. package/dist/core/gateways.d.ts +38 -170
  121. package/dist/core/index.d.ts +13 -12
  122. package/dist/core/index.js +12 -11
  123. package/dist/core/launcher-context.d.ts +11 -0
  124. package/dist/core/launcher-context.js +31 -0
  125. package/dist/core/live/package-bin-gateway.d.ts +6 -0
  126. package/dist/core/live/package-bin-gateway.js +24 -0
  127. package/dist/core/package-bin.d.ts +7 -0
  128. package/dist/core/package-bin.js +30 -0
  129. package/dist/core/presentations.d.ts +5 -4
  130. package/dist/core/presentations.js +9 -9
  131. package/dist/core/resource-definition-set.d.ts +39 -0
  132. package/dist/core/resource-definition-set.js +31 -0
  133. package/dist/core/resource-reports.d.ts +38 -5
  134. package/dist/core/resource-reports.js +47 -17
  135. package/dist/core/resource.d.ts +4 -4
  136. package/dist/core/resources.d.ts +8 -7
  137. package/dist/core/resources.js +11 -13
  138. package/dist/core/run-state.d.ts +27 -16
  139. package/dist/core/run-state.js +50 -18
  140. package/dist/core/run.d.ts +42 -54
  141. package/dist/core/run.js +72 -122
  142. package/dist/core/setup-phases.d.ts +14 -0
  143. package/dist/core/setup-phases.js +24 -0
  144. package/dist/core/state-directory.d.ts +2 -2
  145. package/dist/core/state-directory.js +3 -3
  146. package/dist/core/timeline.d.ts +4 -2
  147. package/dist/core/timeline.js +11 -4
  148. package/dist/credential/events.d.ts +20 -0
  149. package/dist/credential/events.js +4 -0
  150. package/dist/credential/index.d.ts +2 -1
  151. package/dist/credential/index.js +6 -5
  152. package/dist/credential/source.d.ts +38 -26
  153. package/dist/credential/source.js +25 -34
  154. package/dist/extension-commands.d.ts +12 -6
  155. package/dist/extension-commands.js +16 -13
  156. package/dist/extensions/github/{world.d.ts → context.d.ts} +1 -1
  157. package/dist/extensions/github/context.js +3 -0
  158. package/dist/extensions/github/definition.d.ts +1 -1
  159. package/dist/extensions/github/definition.js +3 -3
  160. package/dist/extensions/github/extension.d.ts +1 -1
  161. package/dist/extensions/github/index.d.ts +2 -2
  162. package/dist/extensions/github/index.js +4 -4
  163. package/dist/extensions/github/lifecycle.d.ts +3 -3
  164. package/dist/extensions/github/lifecycle.js +14 -14
  165. package/dist/extensions/github/live/context.d.ts +6 -0
  166. package/dist/extensions/github/live/context.js +16 -0
  167. package/dist/extensions/github/resource.d.ts +1 -1
  168. package/dist/extensions/playwright/driver.d.ts +8 -0
  169. package/dist/extensions/playwright/driver.js +60 -0
  170. package/dist/extensions/playwright/extension.d.ts +2 -0
  171. package/dist/extensions/playwright/extension.js +12 -0
  172. package/dist/extensions/playwright/plan/gateways.d.ts +62 -0
  173. package/dist/extensions/playwright/plan/gateways.js +4 -0
  174. package/dist/extensions/playwright/plan/list-output.d.ts +26 -0
  175. package/dist/extensions/playwright/plan/list-output.js +101 -0
  176. package/dist/extensions/playwright/plan/live/list-gateway.d.ts +15 -0
  177. package/dist/extensions/playwright/plan/live/list-gateway.js +100 -0
  178. package/dist/extensions/playwright/plan/plan.d.ts +44 -0
  179. package/dist/extensions/playwright/plan/plan.js +53 -0
  180. package/dist/extensions/testserver/command-tree.d.ts +2 -2
  181. package/dist/extensions/testserver/command-tree.js +2 -3
  182. package/dist/extensions/testserver/commands/app.d.ts +7 -7
  183. package/dist/extensions/testserver/commands/pool/create/command.d.ts +5 -5
  184. package/dist/extensions/testserver/commands/pool/create/command.js +17 -12
  185. package/dist/extensions/testserver/commands/pool/list/command.js +8 -5
  186. package/dist/extensions/testserver/{world.d.ts → context.d.ts} +1 -1
  187. package/dist/extensions/testserver/context.js +4 -0
  188. package/dist/extensions/testserver/definition.d.ts +2 -2
  189. package/dist/extensions/testserver/definition.js +8 -7
  190. package/dist/extensions/testserver/events.d.ts +1 -1
  191. package/dist/extensions/testserver/extension.d.ts +4 -3
  192. package/dist/extensions/testserver/extension.js +33 -20
  193. package/dist/extensions/testserver/index.d.ts +2 -2
  194. package/dist/extensions/testserver/index.js +2 -2
  195. package/dist/extensions/testserver/lifecycle.d.ts +6 -5
  196. package/dist/extensions/testserver/lifecycle.js +9 -8
  197. package/dist/extensions/testserver/live/context.d.ts +8 -0
  198. package/dist/extensions/testserver/live/{world.js → context.js} +6 -7
  199. package/dist/extensions/testserver/options/rules.d.ts +3 -3
  200. package/dist/extensions/testserver/options/rules.js +5 -4
  201. package/dist/extensions/testserver/options/sandboxes.d.ts +3 -2
  202. package/dist/extensions/testserver/options/sandboxes.js +3 -2
  203. package/dist/extensions/testserver/playwright/index.d.ts +33 -0
  204. package/dist/extensions/testserver/playwright/index.js +43 -0
  205. package/dist/extensions/testserver/presentation.d.ts +4 -4
  206. package/dist/extensions/testserver/presentation.js +7 -7
  207. package/dist/extensions/testserver/progress.d.ts +3 -3
  208. package/dist/extensions/testserver/progress.js +3 -3
  209. package/dist/extensions/testserver/provision.d.ts +2 -2
  210. package/dist/extensions/testserver/provision.js +10 -10
  211. package/dist/extensions/testserver/resource.d.ts +2 -2
  212. package/dist/extensions/testserver/result.d.ts +2 -2
  213. package/dist/extensions/testserver/result.js +1 -1
  214. package/dist/extensions/testserver/run/connection.d.ts +1 -1
  215. package/dist/extensions/testserver/run/connection.js +3 -3
  216. package/dist/extensions/testserver/run/sandbox.d.ts +31 -0
  217. package/dist/extensions/testserver/run/sandbox.js +58 -0
  218. package/dist/extensions/testserver/run-sandbox.d.ts +2 -2
  219. package/dist/extensions/testserver/run-sandbox.js +3 -3
  220. package/dist/extensions/testserver/vercel-cli/arguments.d.ts +2 -2
  221. package/dist/extensions/testserver/vercel-cli/arguments.js +6 -6
  222. package/dist/extensions/testserver/vercel-cli/auth-config.d.ts +7 -7
  223. package/dist/extensions/testserver/vercel-cli/auth-config.js +4 -4
  224. package/dist/extensions/testserver/vercel-cli/clock.js +1 -1
  225. package/dist/extensions/testserver/vercel-cli/config-files.js +1 -1
  226. package/dist/extensions/testserver/vercel-cli/context.d.ts +1 -1
  227. package/dist/extensions/testserver/vercel-cli/context.js +2 -2
  228. package/dist/extensions/testserver/vercel-cli/entry.d.ts +1 -1
  229. package/dist/extensions/testserver/vercel-cli/entry.js +1 -1
  230. package/dist/extensions/testserver/vercel-cli/environment.d.ts +5 -5
  231. package/dist/extensions/testserver/vercel-cli/environment.js +6 -6
  232. package/dist/extensions/testserver/vercel-cli/gateways.d.ts +1 -1
  233. package/dist/extensions/testserver/vercel-cli/gateways.js +3 -3
  234. package/dist/extensions/testserver/vercel-cli/index.d.ts +1 -1
  235. package/dist/extensions/testserver/vercel-cli/index.js +8 -9
  236. package/dist/extensions/testserver/vercel-cli/invocation.d.ts +13 -12
  237. package/dist/extensions/testserver/vercel-cli/invocation.js +1 -1
  238. package/dist/extensions/testserver/vercel-cli/{driver.d.ts → invoker.d.ts} +18 -17
  239. package/dist/extensions/testserver/vercel-cli/{driver.js → invoker.js} +8 -8
  240. package/dist/extensions/testserver/vercel-cli/live/config-files.d.ts +2 -2
  241. package/dist/extensions/testserver/vercel-cli/live/config-files.js +2 -2
  242. package/dist/extensions/testserver/vercel-cli/live/process-gateway.js +1 -1
  243. package/dist/extensions/testserver/vercel-cli/report.js +2 -2
  244. package/dist/extensions/testserver/vercel-cli/verbose.js +1 -1
  245. package/dist/extensions/testserver/vitest/config.d.ts +8 -6
  246. package/dist/extensions/testserver/vitest/config.js +10 -16
  247. package/dist/extensions/testserver/vitest/container-scope.d.ts +11 -11
  248. package/dist/extensions/testserver/vitest/container-scope.js +9 -9
  249. package/dist/extensions/testserver/vitest/container-start.d.ts +6 -6
  250. package/dist/extensions/testserver/vitest/container-start.js +14 -11
  251. package/dist/extensions/testserver/vitest/diagnostics.d.ts +1 -1
  252. package/dist/extensions/testserver/vitest/fixtures.d.ts +12 -10
  253. package/dist/extensions/testserver/vitest/fixtures.js +44 -22
  254. package/dist/extensions/testserver/vitest/index.d.ts +1 -1
  255. package/dist/extensions/testserver/vitest/index.js +4 -4
  256. package/dist/extensions/testserver/vitest/types.d.ts +16 -18
  257. package/dist/extensions/testserver/vitest/types.js +2 -2
  258. package/dist/extensions/testserver/vitest/worker-sandbox.d.ts +8 -0
  259. package/dist/extensions/testserver/vitest/worker-sandbox.js +17 -0
  260. package/dist/extensions/vitest/driver.d.ts +8 -0
  261. package/dist/extensions/vitest/driver.js +62 -0
  262. package/dist/extensions/vitest/extension.d.ts +2 -0
  263. package/dist/extensions/vitest/extension.js +8 -0
  264. package/dist/{vitest → extensions/vitest/plan}/gateways.d.ts +1 -26
  265. package/dist/extensions/vitest/plan/gateways.js +3 -0
  266. package/dist/{vitest → extensions/vitest/plan}/live/list-gateway.d.ts +1 -2
  267. package/dist/{vitest → extensions/vitest/plan}/live/list-gateway.js +1 -20
  268. package/dist/extensions/vitest/plan/plan-over.d.ts +38 -0
  269. package/dist/extensions/vitest/plan/plan-over.js +31 -0
  270. package/dist/extensions/vitest/plan/plan.d.ts +24 -0
  271. package/dist/{vitest → extensions/vitest/plan}/plan.js +11 -26
  272. package/dist/extensions.d.ts +43 -30
  273. package/dist/extensions.js +50 -35
  274. package/dist/forward-sigterm.d.ts +8 -0
  275. package/dist/forward-sigterm.js +18 -0
  276. package/dist/launcher-resolvers/index.d.ts +1 -0
  277. package/dist/launcher-resolvers/index.js +2 -1
  278. package/dist/launcher-resolvers/local-services.d.ts +22 -0
  279. package/dist/launcher-resolvers/local-services.js +6 -0
  280. package/dist/live-app.js +9 -7
  281. package/dist/local-services.d.ts +11 -0
  282. package/dist/local-services.js +16 -0
  283. package/dist/playwright/index.d.ts +1 -0
  284. package/dist/playwright/index.js +4 -0
  285. package/dist/playwright/reporter.d.ts +96 -0
  286. package/dist/playwright/reporter.js +162 -0
  287. package/dist/playwright/worker-index.d.ts +7 -0
  288. package/dist/playwright/worker-index.js +20 -0
  289. package/dist/run-directory/gateways.d.ts +167 -0
  290. package/dist/run-directory/gateways.js +2 -0
  291. package/dist/run-directory/index.d.ts +8 -0
  292. package/dist/run-directory/index.js +13 -0
  293. package/dist/run-directory/plan.d.ts +35 -0
  294. package/dist/run-directory/plan.js +24 -0
  295. package/dist/run-directory/reader.d.ts +70 -0
  296. package/dist/run-directory/reader.js +51 -0
  297. package/dist/run-directory/recording.d.ts +95 -0
  298. package/dist/run-directory/recording.js +85 -0
  299. package/dist/{commands/exec → run-directory}/run-collector.d.ts +9 -8
  300. package/dist/{commands/exec → run-directory}/run-collector.js +8 -10
  301. package/dist/{core → run-directory}/run-directory.d.ts +3 -3
  302. package/dist/{core → run-directory}/run-directory.js +2 -2
  303. package/dist/{commands/exec → run-directory}/run-record.d.ts +94 -27
  304. package/dist/run-directory/run-record.js +229 -0
  305. package/dist/{commands/exec → run-directory}/timeline-facts.d.ts +5 -8
  306. package/dist/{commands/exec → run-directory}/timeline-facts.js +11 -25
  307. package/dist/runner/build-snapshots.d.ts +179 -0
  308. package/dist/runner/build-snapshots.js +235 -0
  309. package/dist/runner/context.js +2 -1
  310. package/dist/runner/events.d.ts +73 -33
  311. package/dist/runner/gateways.d.ts +30 -10
  312. package/dist/runner/index.d.ts +15 -17
  313. package/dist/runner/index.js +12 -14
  314. package/dist/runner/live/checkout-gateway.js +15 -7
  315. package/dist/runner/live/snapshot-records.js +8 -7
  316. package/dist/runner/prepare.d.ts +26 -26
  317. package/dist/runner/prepare.js +27 -14
  318. package/dist/runner/ready.d.ts +43 -10
  319. package/dist/runner/ready.js +51 -34
  320. package/dist/runner/recipe.d.ts +48 -4
  321. package/dist/runner/recipe.js +42 -1
  322. package/dist/runner/scope.d.ts +13 -13
  323. package/dist/runner/scope.js +9 -11
  324. package/dist/runner/secrets.d.ts +6 -0
  325. package/dist/runner/secrets.js +10 -0
  326. package/dist/runner/session.d.ts +128 -0
  327. package/dist/runner/session.js +138 -0
  328. package/dist/runner/snapshot-build.d.ts +21 -11
  329. package/dist/runner/snapshot-build.js +11 -16
  330. package/dist/runner/snapshot-cache.d.ts +140 -62
  331. package/dist/runner/snapshot-cache.js +145 -102
  332. package/dist/runner/snapshot-inspect.d.ts +89 -0
  333. package/dist/runner/snapshot-inspect.js +173 -0
  334. package/dist/runner/snapshot-key.d.ts +5 -2
  335. package/dist/runner/snapshot-key.js +1 -1
  336. package/dist/runner/snapshot-save.d.ts +35 -20
  337. package/dist/runner/snapshot-save.js +47 -37
  338. package/dist/runner/snapshot-start.d.ts +25 -0
  339. package/dist/runner/snapshot-start.js +16 -0
  340. package/dist/sdk/extension/ci.d.ts +2 -0
  341. package/dist/sdk/extension/ci.js +6 -0
  342. package/dist/sdk/extension/commands.d.ts +44 -28
  343. package/dist/sdk/extension/commands.js +15 -13
  344. package/dist/sdk/extension/driver.d.ts +143 -0
  345. package/dist/sdk/extension/driver.js +28 -0
  346. package/dist/sdk/extension/index.d.ts +3 -1
  347. package/dist/sdk/extension/index.js +16 -9
  348. package/dist/sdk/extension/{launcher-supplies.d.ts → launcher-context.d.ts} +3 -3
  349. package/dist/sdk/extension/launcher-context.js +5 -0
  350. package/dist/sdk/extension/lifecycle.d.ts +10 -8
  351. package/dist/sdk/extension/lifecycle.js +2 -2
  352. package/dist/sdk/extension/progress.js +2 -2
  353. package/dist/sdk/extension/resource-definition.d.ts +13 -13
  354. package/dist/sdk/extension/resource-definition.js +2 -2
  355. package/dist/sdk/extension/resource.d.ts +13 -13
  356. package/dist/sdk/extension/resource.js +11 -11
  357. package/dist/sdk/extension/time.js +2 -2
  358. package/dist/sdk/index.d.ts +2 -0
  359. package/dist/sdk/index.js +3 -1
  360. package/dist/sdk/run/launcher.d.ts +1 -1
  361. package/dist/sdk/run/launcher.js +4 -3
  362. package/dist/sdk/run/payload.js +1 -1
  363. package/dist/sdk/run/test-events.d.ts +24 -18
  364. package/dist/sdk/run/test-events.js +5 -4
  365. package/dist/sdk/run/test-result-writer.d.ts +77 -0
  366. package/dist/sdk/run/test-result-writer.js +143 -0
  367. package/dist/sdk/run/worker-test-event-writer.d.ts +13 -0
  368. package/dist/sdk/run/worker-test-event-writer.js +31 -0
  369. package/dist/vendor/testserver-sdk/container/container.d.ts +12 -12
  370. package/dist/vendor/testserver-sdk/container/container.js +39 -21
  371. package/dist/vendor/testserver-sdk/factories/build.d.ts +12 -40
  372. package/dist/vendor/testserver-sdk/factories/build.js +15 -66
  373. package/dist/vendor/testserver-sdk/factories/gateways.d.ts +1 -2
  374. package/dist/vendor/testserver-sdk/factories/index.d.ts +1 -3
  375. package/dist/vendor/testserver-sdk/factories/index.js +3 -5
  376. package/dist/vendor/testserver-sdk/index.d.ts +1 -2
  377. package/dist/vendor/testserver-sdk/index.js +5 -6
  378. package/dist/vendor/testserver-sdk/records/body.d.ts +1 -1
  379. package/dist/vendor/testserver-sdk/records/body.js +1 -1
  380. package/dist/vendor/testserver-sdk/testserver/failure.d.ts +4 -3
  381. package/dist/vendor/testserver-sdk/testserver/failure.js +4 -3
  382. package/dist/vitest/index.d.ts +2 -1
  383. package/dist/vitest/index.js +6 -4
  384. package/dist/vitest/test-events.d.ts +6 -16
  385. package/dist/vitest/test-events.js +15 -40
  386. package/dist/vitest/test-results.d.ts +9 -31
  387. package/dist/vitest/test-results.js +34 -105
  388. package/dist/vitest/worker-index.d.ts +6 -0
  389. package/dist/vitest/worker-index.js +17 -0
  390. package/package.json +23 -9
  391. package/skills/overview.md +6 -5
  392. package/skills/read-run-output.md +22 -7
  393. package/dist/chunks/chunk-AGWW3HDT.js +0 -2559
  394. package/dist/chunks/chunk-H2VCSNVU.js +0 -351
  395. package/dist/commands/exec/run-record.js +0 -135
  396. package/dist/commands/vitest/outcomes.d.ts +0 -379
  397. package/dist/commands/vitest/outcomes.js +0 -70
  398. package/dist/core/launcher-supplies.d.ts +0 -11
  399. package/dist/core/launcher-supplies.js +0 -28
  400. package/dist/core/mint.d.ts +0 -10
  401. package/dist/core/mint.js +0 -14
  402. package/dist/core/resource-registry.d.ts +0 -54
  403. package/dist/core/resource-registry.js +0 -57
  404. package/dist/extensions/github/live/world.d.ts +0 -6
  405. package/dist/extensions/github/live/world.js +0 -16
  406. package/dist/extensions/github/world.js +0 -3
  407. package/dist/extensions/testserver/live/world.d.ts +0 -8
  408. package/dist/extensions/testserver/vitest/sandbox.d.ts +0 -25
  409. package/dist/extensions/testserver/vitest/sandbox.js +0 -43
  410. package/dist/extensions/testserver/world.js +0 -4
  411. package/dist/sdk/extension/launcher-supplies.js +0 -3
  412. package/dist/story/align.d.ts +0 -37
  413. package/dist/story/align.js +0 -39
  414. package/dist/story/command-line.d.ts +0 -34
  415. package/dist/story/command-line.js +0 -100
  416. package/dist/story/definition.d.ts +0 -59
  417. package/dist/story/definition.js +0 -9
  418. package/dist/story/diff.d.ts +0 -9
  419. package/dist/story/diff.js +0 -97
  420. package/dist/story/errors.d.ts +0 -14
  421. package/dist/story/errors.js +0 -21
  422. package/dist/story/gateways.d.ts +0 -94
  423. package/dist/story/gateways.js +0 -3
  424. package/dist/story/host.d.ts +0 -30
  425. package/dist/story/host.js +0 -97
  426. package/dist/story/index.d.ts +0 -8
  427. package/dist/story/index.js +0 -10
  428. package/dist/story/json.d.ts +0 -16
  429. package/dist/story/json.js +0 -59
  430. package/dist/story/live/recording-gateway.d.ts +0 -2
  431. package/dist/story/live/recording-gateway.js +0 -103
  432. package/dist/story/mode.d.ts +0 -17
  433. package/dist/story/mode.js +0 -21
  434. package/dist/story/orphans.d.ts +0 -35
  435. package/dist/story/orphans.js +0 -51
  436. package/dist/story/recording.d.ts +0 -62
  437. package/dist/story/recording.js +0 -97
  438. package/dist/story/report.d.ts +0 -42
  439. package/dist/story/report.js +0 -130
  440. package/dist/story/sequence.d.ts +0 -30
  441. package/dist/story/sequence.js +0 -74
  442. package/dist/story/settle.d.ts +0 -96
  443. package/dist/story/settle.js +0 -71
  444. package/dist/story/start.d.ts +0 -50
  445. package/dist/story/start.js +0 -183
  446. package/dist/vendor/testserver-sdk/factories/definition.d.ts +0 -39
  447. package/dist/vendor/testserver-sdk/factories/definition.js +0 -16
  448. package/dist/vendor/testserver-sdk/factories/definitions.d.ts +0 -169
  449. package/dist/vendor/testserver-sdk/factories/definitions.js +0 -245
  450. package/dist/vendor/testserver-sdk/seed/index.d.ts +0 -1
  451. package/dist/vendor/testserver-sdk/seed/index.js +0 -3
  452. package/dist/vendor/testserver-sdk/seed/seed.d.ts +0 -221
  453. package/dist/vendor/testserver-sdk/seed/seed.js +0 -171
  454. package/dist/vitest/find-vitest.d.ts +0 -7
  455. package/dist/vitest/find-vitest.js +0 -28
  456. package/dist/vitest/gateways.js +0 -4
  457. package/dist/vitest/plan.d.ts +0 -51
  458. /package/dist/{vitest → extensions/vitest/plan}/list-output.d.ts +0 -0
  459. /package/dist/{vitest → extensions/vitest/plan}/list-output.js +0 -0
  460. /package/dist/{core → run-directory}/live/run-directory-gateway.d.ts +0 -0
  461. /package/dist/{core → run-directory}/live/run-directory-gateway.js +0 -0
@@ -23,15 +23,16 @@ export type VercelStopSignal = (typeof STOP_SIGNALS)[number];
23
23
  /**
24
24
  * How an invocation ended:
25
25
  *
26
- * - `exited`: `vercel` exited on its own, with `exitCode`, or a signal the driver didn't send ended it.
26
+ * - `exited`: `vercel` exited on its own, with `exitCode`, or a signal the invoker didn't send ended it.
27
27
  * - `stopped`: the test's `stop()` sent `stopSignal`, and it then ended with `exitCode` or `signal`.
28
- * `killAttemptedAfterGrace` says the driver attempted SIGKILL after `STOP_GRACE_MS` while still awaiting
28
+ * `killAttemptedAfterGrace` says the invoker attempted SIGKILL after `STOP_GRACE_MS` while still awaiting
29
29
  * completion. It does not confirm delivery: the child may have exited while its output pipes remain open.
30
- * - `timed-out`, `aborted`, `closed`, `abandoned`: the driver killed it after `timeoutMs`, when the test's signal
30
+ * - `timed-out`, `aborted`, `closed`, `abandoned`: the invoker killed it after `timeoutMs`, when the test's signal
31
31
  * aborted, when `close()` was called, or when its `interact` block threw while it still ran, and it then ended
32
32
  * with `exitCode` or `signal`.
33
33
  * - `not-started`: it never started: `missing` when its executable wasn't found (or its `cwd` doesn't exist),
34
- * `auth-config` when the driver couldn't read or write the `auth.json` its saved login or logged-out run needs.
34
+ * `auth-config` when the invoker couldn't read or write the `auth.json` its saved login or logged-out invocation
35
+ * needs.
35
36
  */
36
37
  export type InvocationEnd = {
37
38
  readonly kind: "exited";
@@ -65,7 +66,7 @@ export type InvocationEnd = {
65
66
  readonly reason: NotStartedReason;
66
67
  readonly message: string;
67
68
  };
68
- /** Why an invocation never started: the process gateway's start failure, or `auth.json` the driver couldn't settle. */
69
+ /** Why an invocation never started: the process gateway's start failure, or `auth.json` the invoker couldn't settle. */
69
70
  export type NotStartedReason = StartError["code"] | "auth-config";
70
71
  /**
71
72
  * What an invocation's stdin was: `ignored` (`/dev/null`, a script's), `terminal` (piped for `press` and `type`,
@@ -82,7 +83,7 @@ export type VercelInvocationStdin = {
82
83
  } | {
83
84
  readonly kind: "open";
84
85
  };
85
- /** One `vercel` process the driver started, as a test's report shows it. Every token reads `<token>`. */
86
+ /** One `vercel` process the invoker started, as a test's report shows it. Every token reads `<token>`. */
86
87
  export interface VercelInvocation {
87
88
  /** 1 for a test's first invocation, and so on. */
88
89
  readonly number: number;
@@ -100,7 +101,7 @@ export interface VercelInvocation {
100
101
  /** How it ended; absent while it runs. */
101
102
  readonly end?: InvocationEnd;
102
103
  /**
103
- * Whether every byte of stdout and stderr reached the driver. False only when a hard kill's bounded drain ran out
104
+ * Whether every byte of stdout and stderr reached the invoker. False only when a hard kill's bounded drain ran out
104
105
  * because a descendant still held an output pipe.
105
106
  */
106
107
  readonly outputComplete: boolean;
@@ -130,13 +131,13 @@ export interface VercelResult {
130
131
  readonly exitCode: number | null;
131
132
  /** The signal that ended it, such as `SIGKILL`; `null` when it exited. */
132
133
  readonly signal: string | null;
133
- /** Whether the driver killed it after its timeout. */
134
+ /** Whether the invoker killed it after its timeout. */
134
135
  readonly timedOut: boolean;
135
- /** Whether the driver killed it because the test's signal aborted. */
136
+ /** Whether the invoker killed it because the test's signal aborted. */
136
137
  readonly aborted: boolean;
137
138
  /** Whether the test's `stop()` signalled it. */
138
139
  readonly stopped: boolean;
139
- /** Whether every byte of stdout and stderr reached the driver; false after a hard kill's drain ran out. */
140
+ /** Whether every byte of stdout and stderr reached the invoker; false after a hard kill's drain ran out. */
140
141
  readonly outputComplete: boolean;
141
142
  /**
142
143
  * Its stdout with the same ANSI stripping `waitFor` uses: escape sequences removed, a spinner's `\r` frames kept.
@@ -157,7 +158,7 @@ export interface VercelResult {
157
158
  */
158
159
  readonly requests: readonly ProxyRequestRecord[];
159
160
  }
160
- /** What an invocation needs from the driver that started it. */
161
+ /** What an invocation needs from the invoker that started it. */
161
162
  export interface InvocationDeps {
162
163
  readonly clock: VercelCliClock;
163
164
  readonly redactor: Redactor;
@@ -165,7 +166,7 @@ export interface InvocationDeps {
165
166
  readonly requests: readonly ProxyRequestRecord[];
166
167
  };
167
168
  }
168
- /** Why the driver hard-terminates an invocation's process tree. */
169
+ /** Why the invoker hard-terminates an invocation's process tree. */
169
170
  type KillReason = "timeout" | "abort" | "close" | "abandon";
170
171
  export declare class Invocation {
171
172
  #private;
@@ -1,4 +1,4 @@
1
- // One invocation: a `vercel` process the driver started, with its output, how it ended, the proxy's records added
1
+ // One invocation: a `vercel` process the invoker started, with its output, how it ended, the proxy's records added
2
2
  // while it ran, and, for an interactive invocation, the cursor `waitFor` searches from.
3
3
  import { isOpenRecord } from "../../../vendor/testserver-sdk/index.js";
4
4
  import { AnsiStripper } from "./ansi.js";
@@ -4,17 +4,17 @@ import { type VercelAuth } from "./auth-config.ts";
4
4
  import type { VercelCliContext } from "./context.ts";
5
5
  import { type VercelInvocation, type VercelResult, type VercelStopSignal } from "./invocation.ts";
6
6
  import { type VercelKey } from "./keys.ts";
7
- /** How long an invocation may run before the driver kills it, unless the driver or the call says otherwise. */
7
+ /** How long an invocation may run before the invoker kills it, unless the invoker or the call says otherwise. */
8
8
  export declare const VERCEL_TIMEOUT_MS = 45000;
9
9
  export interface VercelCliOptions {
10
10
  /**
11
- * A directory the test created for itself, and removes after it. It is each invocation's `HOME`; the driver
11
+ * A directory the test created for itself, and removes after it. It is each invocation's `HOME`; the invoker
12
12
  * makes `<home>/global-config` and `<home>/work` in it.
13
13
  */
14
14
  readonly home: string;
15
15
  /**
16
16
  * The test's proxy: invocations send to its `url`, and results hold the records added to `requests`. Its
17
- * `redact`, when given, redacts everything the driver returns or prints after the driver's own tokens, so a token
17
+ * `redact`, when given, redacts everything the invoker returns or prints after the invoker's own tokens, so a token
18
18
  * the proxy's container has seen reads `<token>` too. A `ContainerProxy` has one.
19
19
  */
20
20
  readonly proxy: {
@@ -45,8 +45,8 @@ export interface VercelCliOptions {
45
45
  readonly onInvocationEnd?: (invocation: VercelInvocation) => void;
46
46
  }
47
47
  /**
48
- * Who `vercel` acts as by default: a token and the team it runs in. A login from the SDK's `seed.login` is one, as
49
- * is any `{ token, team }` with those fields.
48
+ * Who `vercel` acts as by default: a token and the team it runs in, any `{ token, team }` with those fields, such as
49
+ * a token and a team a test built through Testserver's factories.
50
50
  */
51
51
  export interface VercelIdentity {
52
52
  /** The token `--token` sends: a seeded token. */
@@ -62,7 +62,7 @@ export interface VercelIdentity {
62
62
  export interface VercelCallOptions {
63
63
  /**
64
64
  * The token it runs as, in place of the default identity's: a seeded token, or a raw bearer secret. Under
65
- * `auth: "saved"`, the token the driver saves; under `auth: "none"`, a usage error.
65
+ * `auth: "saved"`, the token the invoker saves; under `auth: "none"`, a usage error.
66
66
  */
67
67
  readonly as?: {
68
68
  readonly secretString: string;
@@ -71,12 +71,12 @@ export interface VercelCallOptions {
71
71
  * How it authenticates, in place of the default `actAs` set, else `"flag"`:
72
72
  *
73
73
  * - `"flag"`: `--token <secret>`, with the token `as` or the default identity names.
74
- * - `"saved"`: no `--token`. The driver first saves that token as `token` in `<globalConfigDir>/auth.json`,
74
+ * - `"saved"`: no `--token`. The invoker first saves that token as `token` in `<globalConfigDir>/auth.json`,
75
75
  * keeping the file's other keys, so `vercel` reads it as it reads a `vercel login`.
76
- * - `"none"`: no `--token`, and the driver removes `token`, `refreshToken` and `expiresAt` from `auth.json`, keeping
76
+ * - `"none"`: no `--token`, and the invoker removes `token`, `refreshToken` and `expiresAt` from `auth.json`, keeping
77
77
  * its other keys: a logged-out `vercel`. It needs no default identity.
78
78
  *
79
- * The driver writes `auth.json` only when it differs from what the call needs in those keys. Under `"saved"` and
79
+ * The invoker writes `auth.json` only when it differs from what the call needs in those keys. Under `"saved"` and
80
80
  * `"none"`, only the call's own `scope` sends `--scope`: `vercel` picks the team as after a login, the saved
81
81
  * `currentTeam` or else the user's default team. Starting a call whose `auth.json` differs from what an invocation
82
82
  * still running needs (another token, or none) is a usage error.
@@ -93,14 +93,14 @@ export interface VercelCallOptions {
93
93
  readonly cwd?: string;
94
94
  /**
95
95
  * Variables added to its environment. `PATH` replaces the one from `hostEnv`; setting any other variable the
96
- * driver sets (`HOME`, `SystemRoot`, `TEMP`, `FORCE_TTY`, `CI`, `CLI_WIDTH`, `COLUMNS`, `NO_COLOR`,
96
+ * invoker sets (`HOME`, `SystemRoot`, `TEMP`, `FORCE_TTY`, `CI`, `CLI_WIDTH`, `COLUMNS`, `NO_COLOR`,
97
97
  * `NO_UPDATE_NOTIFIER`, `VERCEL_TELEMETRY_DISABLED`, `VERCEL_TEST_KEYRING_UNAVAILABLE`), or `VERCEL_TOKEN`, which
98
98
  * would undo `auth`, is a usage error. A bare `command.file`,
99
99
  * such as the default `vercel`, is looked up on this `PATH`, so a `PATH` without `vercel` needs an absolute
100
100
  * `command`.
101
101
  */
102
102
  readonly env?: Readonly<Record<string, string>>;
103
- /** How long it may run before it's killed; default the driver's `timeoutMs`. */
103
+ /** How long it may run before it's killed; default the invoker's `timeoutMs`. */
104
104
  readonly timeoutMs?: number;
105
105
  }
106
106
  /**
@@ -176,8 +176,8 @@ export interface VercelCli {
176
176
  /**
177
177
  * Sets who `vercel` acts as by default: `token.secretString` for `--token` and `team.slug` for `--scope` (none for
178
178
  * `team: null`), and `auth`, how a call authenticates unless it says otherwise (default `"flag"`). Calling it again
179
- * replaces the default, `auth` included. The token reads `<token>` in everything the driver returns or prints from now on. A
180
- * call's `as`, `scope` or `auth` overrides it; the default scope steps aside when a call's arguments name
179
+ * replaces the default, `auth` included. The token reads `<token>` in everything the invoker returns or prints from
180
+ * now on. A call's `as`, `scope` or `auth` overrides it; the default scope steps aside when a call's arguments name
181
181
  * `--scope`, `-S` or `--team`, and under `"saved"` and `"none"`.
182
182
  */
183
183
  actAs(identity: VercelIdentity, options?: {
@@ -187,15 +187,16 @@ export interface VercelCli {
187
187
  * Runs `vercel` with `args`, and resolves however it ends: its `stdout` and `stderr` with ANSI codes removed, as
188
188
  * `waitFor` removes them, and `rawStdout` and `rawStderr` as they arrived. At a terminal, stdin closes at once:
189
189
  * nobody types. Rejects with a `VercelCliError` only when it can't start, and with a `TypeError` for arguments or
190
- * options the driver refuses, or when there is no token to act as.
190
+ * options the invoker refuses, or when there is no token to act as.
191
191
  */
192
192
  run(args: readonly string[], options?: VercelRunOptions): Promise<VercelResult>;
193
193
  /**
194
194
  * Runs `vercel` with `args` and hands the running invocation to `block`, which waits for its output, answers its
195
195
  * prompts at a terminal (`terminal: true`), or stops it. Once `block` returns, closes stdin at a terminal (an open
196
- * `stdin` stays open), waits for `vercel` to end, and resolves with its result, as `run` does: a command that runs until stopped, such as
197
- * `vercel dev`, needs `stop()` in the block, or it runs until its timeout. When `block` throws, kills `vercel` if it
198
- * still runs (it ends `abandoned`) and rejects with what `block` threw. Rejects as `run` does otherwise.
196
+ * `stdin` stays open), waits for `vercel` to end, and resolves with its result, as `run` does: a command that runs
197
+ * until stopped, such as `vercel dev`, needs `stop()` in the block, or it runs until its timeout. When `block`
198
+ * throws, kills `vercel` if it still runs (it ends `abandoned`) and rejects with what `block` threw. Rejects as `run`
199
+ * does otherwise.
199
200
  */
200
201
  interact(args: readonly string[], block: InteractBlock<InteractiveInvocation>): Promise<VercelResult>;
201
202
  interact(args: readonly string[], options: VercelRunOptions & {
@@ -1,4 +1,4 @@
1
- // The Vercel CLI driver: runs the production `vercel` CLI against one test's proxy, as the default identity
1
+ // The Vercel CLI invoker: runs the production `vercel` CLI against one test's proxy, as the default identity
2
2
  // `actAs` sets or the token a call names, with `--token`, a saved login or logged out, in directories the test's
3
3
  // invocations share. `createVercelCli` takes its Context; `vercelCli` (`entry.ts`), the published entry, passes the
4
4
  // live one.
@@ -12,9 +12,9 @@ import { Invocation, STOP_SIGNALS, WAIT_FOR_TIMEOUT_MS, } from "./invocation.js"
12
12
  import { KEY_SEQUENCES } from "./keys.js";
13
13
  import { Redactor } from "./redaction.js";
14
14
  import { describeEnd, describeInvocation, describeInvocations } from "./report.js";
15
- /** How long an invocation may run before the driver kills it, unless the driver or the call says otherwise. */
15
+ /** How long an invocation may run before the invoker kills it, unless the invoker or the call says otherwise. */
16
16
  export const VERCEL_TIMEOUT_MS = 45_000;
17
- /** The `vercel` the driver runs when `command` isn't given: `vercel` on `PATH`. */
17
+ /** The `vercel` the invoker runs when `command` isn't given: `vercel` on `PATH`. */
18
18
  const DEFAULT_COMMAND = { file: "vercel", args: [] };
19
19
  /** A `VercelCli` over `context`. It prepares `<home>/global-config` and `<home>/work` first. */
20
20
  export async function createVercelCli(options, context) {
@@ -36,8 +36,8 @@ export async function createVercelCli(options, context) {
36
36
  let identity;
37
37
  let defaultAuth = "flag";
38
38
  /**
39
- * The last `auth.json` settlement, which the next one waits for: compatible saved logins and logged-out runs may
40
- * start at once, and each reads, then may write, the one file, so they settle it one at a time.
39
+ * The last `auth.json` settlement, which the next one waits for: compatible saved logins and logged-out invocations
40
+ * may start at once, and each reads, then may write, the one file, so they settle it one at a time.
41
41
  */
42
42
  let authFileSettling = Promise.resolve();
43
43
  const settleAuthFileInTurn = (authentication) => {
@@ -47,10 +47,10 @@ export async function createVercelCli(options, context) {
47
47
  };
48
48
  /**
49
49
  * Starts an invocation. Everything before the process starts runs synchronously, as the call is made: it resolves
50
- * the call's identity and how it authenticates, refuses what the driver owns and an `auth.json` another running
50
+ * the call's identity and how it authenticates, refuses what the invoker owns and an `auth.json` another running
51
51
  * invocation needs otherwise with a `TypeError`, and registers the invocation, so a later `actAs` doesn't change it
52
52
  * and `close()` kills it even while it is starting. Then it settles `auth.json` for a saved login or a logged-out
53
- * run, after any settlement already under way, and starts the process.
53
+ * invocation, after any settlement already under way, and starts the process.
54
54
  */
55
55
  const launch = async (args, call, how) => {
56
56
  const { interactive, stdin } = how;
@@ -251,7 +251,7 @@ export async function createVercelCli(options, context) {
251
251
  }
252
252
  /** A `TypeError` for starting `wanted` while `other`, still running, needs `auth.json` to hold something else. */
253
253
  function authFileConflictError(wanted, other) {
254
- const run = wanted.mode === "none" ? 'a logged-out run (auth "none")' : 'a saved login (auth "saved")';
254
+ const run = wanted.mode === "none" ? 'a logged-out invocation (auth "none")' : 'a saved login (auth "saved")';
255
255
  const needs = wanted.mode === "none" ? "without a token" : "to hold its token";
256
256
  const otherNeeds = other.authentication.mode === "none" ? "without one" : "to hold another token";
257
257
  return new TypeError(`vercel-cli: ${run} needs ${AUTH_CONFIG_FILE} ${needs}, but invocation ${other.number}, still running, needs it ${otherNeeds}; let it end first`);
@@ -16,8 +16,8 @@ export declare function writeGlobalConfig(globalConfigDir: string, config: Globa
16
16
  export declare function readAuthConfig(globalConfigDir: string): Promise<AuthConfig | undefined>;
17
17
  /**
18
18
  * Writes `config` as the CLI's `auth.json` in `globalConfigDir`, creating the directory if needed, at once
19
- * (`replaceConfigFile`), so a running `vercel` never reads part of it. Under a saved login the driver replaces its
20
- * `token` before each invocation, and under a logged-out run removes it; every other key is the test's.
19
+ * (`replaceConfigFile`), so a running `vercel` never reads part of it. Under a saved login the invoker replaces its
20
+ * `token` before each invocation, and under a logged-out invocation removes it; every other key is the test's.
21
21
  */
22
22
  export declare function writeAuthConfig(globalConfigDir: string, config: AuthConfig): Promise<void>;
23
23
  /**
@@ -25,8 +25,8 @@ export function readAuthConfig(globalConfigDir) {
25
25
  }
26
26
  /**
27
27
  * Writes `config` as the CLI's `auth.json` in `globalConfigDir`, creating the directory if needed, at once
28
- * (`replaceConfigFile`), so a running `vercel` never reads part of it. Under a saved login the driver replaces its
29
- * `token` before each invocation, and under a logged-out run removes it; every other key is the test's.
28
+ * (`replaceConfigFile`), so a running `vercel` never reads part of it. Under a saved login the invoker replaces its
29
+ * `token` before each invocation, and under a logged-out invocation removes it; every other key is the test's.
30
30
  */
31
31
  export function writeAuthConfig(globalConfigDir, config) {
32
32
  return writeConfigFile(globalConfigDir, AUTH_CONFIG_FILE, config);
@@ -93,7 +93,7 @@ function startProcess(request) {
93
93
  stopDraining();
94
94
  }, TERMINATE_DRAIN_MS);
95
95
  };
96
- // A write racing the process's exit fails with EPIPE; the driver learns of the exit from `exited`.
96
+ // A write racing the process's exit fails with EPIPE; the invoker learns of the exit from `exited`.
97
97
  child.stdin?.on("error", () => {
98
98
  stdinOpen = false;
99
99
  });
@@ -1,4 +1,4 @@
1
- // The Vercel CLI driver's failure report: pure functions over invocation records, so a test's fixture can print
1
+ // The Vercel CLI invoker's failure report: pure functions over invocation records, so a test's fixture can print
2
2
  // them and unit tests can check them.
3
3
  import { isOpenRecord } from "../../../vendor/testserver-sdk/index.js";
4
4
  import { STOP_GRACE_MS } from "./invocation.js";
@@ -25,7 +25,7 @@ export function describeInvocation(invocation) {
25
25
  ` ${describeEnd(invocation.end, invocation.durationMs)}`,
26
26
  ...(invocation.outputComplete
27
27
  ? []
28
- : [" output incomplete: a descendant kept stdout or stderr open after the driver killed vercel"]),
28
+ : [" output incomplete: a descendant kept stdout or stderr open after the invoker killed vercel"]),
29
29
  ` ${describeRequests(invocation.requests)}`,
30
30
  ];
31
31
  if (invocation.overlapped.length > 0) {
@@ -1,4 +1,4 @@
1
- // The driver's default `onInvocationEnd` in a verbose run: pure over the environment and a printer, so `entry.ts`
1
+ // The invoker's default `onInvocationEnd` in a verbose run: pure over the environment and a printer, so `entry.ts`
2
2
  // passes `process.env` and stderr, and unit tests pass their own.
3
3
  import { readRunPayload, RUN_PAYLOAD_VARIABLE, RunPayloadError } from "../../../sdk/index.js";
4
4
  import { describeInvocation } from "./report.js";
@@ -1,13 +1,15 @@
1
- export { WORKERS_PER_SANDBOX } from "./sandbox.ts";
1
+ export { WORKERS_PER_SANDBOX } from "../run/sandbox.ts";
2
2
  /**
3
3
  * A vitest `retry` for a testserver project: one more attempt for a test that failed because Testserver couldn't
4
4
  * serve a call for a reason outside the test (`TESTSERVER_TRANSIENT_FAILURE`): its connection failed, such as a
5
5
  * `read ECONNRESET` between the runner and the Testserver URL, or Testserver had stopped the container, as its idle
6
- * eviction does to a container no request has reached for a while, whether the test made the call or its proxy
7
- * forwarded it. None for any other failure. The adapter ends a file's container after a test whose factory call, API
8
- * request or proxied request failed so, so the retry runs on a new container, where a factory call that half-happened
9
- * on the old one can't collide with it. vitest's own output marks a test it rescued `(retry x1)`. Spread it to change
10
- * the count: `retry: { ...testserverTransientRetry, count: 2 }`.
6
+ * eviction does to a container no request has reached for a while, whether the test made the call, its proxy
7
+ * forwarded it, or the call was the start of its container. None for any other failure. The library ends a file's
8
+ * container after a test whose factory call, API request or proxied request failed so, so the retry runs on a new
9
+ * container, where a factory call that half-happened on the old one can't collide with it. vitest's own output marks
10
+ * a test it rescued `(retry x1)`. Spread it to change the count: `retry: { ...testserverTransientRetry, count: 2 }`;
11
+ * under Vitest before 5.0.4, only the first retry can start a container again after a failed start (the library's
12
+ * `README.md`, `stormContainer`).
11
13
  */
12
14
  export declare const testserverTransientRetry: {
13
15
  readonly count: number;
@@ -3,19 +3,19 @@
3
3
  // `@vercel/storm/testserver/vitest`: loading the fixtures' `test` extends vitest's, which throws inside a config file.
4
4
  // So nothing here imports `./fixtures.ts` or vitest.
5
5
  import { TESTSERVER_TRANSIENT_FAILURE } from "../../../vendor/testserver-sdk/index.js";
6
- import { readRunPayload, RUN_PAYLOAD_VARIABLE } from "../../../sdk/index.js";
7
- import { testserverConnection } from "../run/connection.js";
8
- import { sandboxCount, WORKERS_PER_SANDBOX } from "./sandbox.js";
9
- export { WORKERS_PER_SANDBOX } from "./sandbox.js";
6
+ import { workersForSandboxes, WORKERS_PER_SANDBOX } from "../run/sandbox.js";
7
+ export { WORKERS_PER_SANDBOX } from "../run/sandbox.js";
10
8
  /**
11
9
  * A vitest `retry` for a testserver project: one more attempt for a test that failed because Testserver couldn't
12
10
  * serve a call for a reason outside the test (`TESTSERVER_TRANSIENT_FAILURE`): its connection failed, such as a
13
11
  * `read ECONNRESET` between the runner and the Testserver URL, or Testserver had stopped the container, as its idle
14
- * eviction does to a container no request has reached for a while, whether the test made the call or its proxy
15
- * forwarded it. None for any other failure. The adapter ends a file's container after a test whose factory call, API
16
- * request or proxied request failed so, so the retry runs on a new container, where a factory call that half-happened
17
- * on the old one can't collide with it. vitest's own output marks a test it rescued `(retry x1)`. Spread it to change
18
- * the count: `retry: { ...testserverTransientRetry, count: 2 }`.
12
+ * eviction does to a container no request has reached for a while, whether the test made the call, its proxy
13
+ * forwarded it, or the call was the start of its container. None for any other failure. The library ends a file's
14
+ * container after a test whose factory call, API request or proxied request failed so, so the retry runs on a new
15
+ * container, where a factory call that half-happened on the old one can't collide with it. vitest's own output marks
16
+ * a test it rescued `(retry x1)`. Spread it to change the count: `retry: { ...testserverTransientRetry, count: 2 }`;
17
+ * under Vitest before 5.0.4, only the first retry can start a container again after a failed start (the library's
18
+ * `README.md`, `stormContainer`).
19
19
  */
20
20
  export const testserverTransientRetry = {
21
21
  count: 1,
@@ -29,11 +29,5 @@ export const testserverTransientRetry = {
29
29
  */
30
30
  export function testserverWorkers(options = {}) {
31
31
  const { workersPerSandbox = WORKERS_PER_SANDBOX, env = process.env } = options;
32
- if (!Number.isInteger(workersPerSandbox) || workersPerSandbox < 1) {
33
- throw new Error(`workersPerSandbox is ${String(workersPerSandbox)}, not a positive integer`);
34
- }
35
- const raw = env[RUN_PAYLOAD_VARIABLE];
36
- if (raw === undefined || raw === "")
37
- return workersPerSandbox;
38
- return workersPerSandbox * sandboxCount(readRunPayload(env).get(testserverConnection));
32
+ return workersForSandboxes(workersPerSandbox, env);
39
33
  }
@@ -1,14 +1,14 @@
1
1
  import { type Container, type ServiceWarmup, type TestserverServiceId } from "../../../vendor/testserver-sdk/index.js";
2
2
  /**
3
- * How long the Vitest adapter's container lives: `'file'`, one container shared by a test file's tests and replaced
4
- * after a test that failed because of a Testserver failure (`endsSharedContainer`), for a test with different
3
+ * How long the Testserver Vitest fixtures' container lives: `'file'`, one container shared by a test file's tests and
4
+ * replaced after a test that failed because of a Testserver failure (`endsSharedContainer`), for a test with different
5
5
  * feature flags, or for a test it reached after Testserver had stopped it, as Testserver's idle eviction does, or
6
6
  * `'test'`, one per test.
7
7
  */
8
8
  export type ContainerScope = "file" | "test";
9
9
  /** The default container scope: a test file's tests share one container. */
10
10
  export declare const CONTAINER_SCOPE: ContainerScope;
11
- /** What the adapter needs of a container to share it: the `Container` fields it reports on, and `end`. */
11
+ /** What the library needs of a container to share it: the `Container` fields it reports on, and `end`. */
12
12
  export type SharedContainer = Pick<Container, "testId" | "testserverUrl" | "featureFlags" | "factoryCalls" | "apiRequests" | "externalCalls" | "setupCalls" | "warmups" | "log" | "redact" | "end">;
13
13
  /**
14
14
  * Where the container `FileContainer.acquire` hands out came from: `reused`, the file's running container; `new`,
@@ -97,15 +97,15 @@ export interface ContainerRequest<C extends SharedContainer> {
97
97
  *
98
98
  * In `'file'` scope, hands the test the file's container, starting it if need be, or replacing it when its feature
99
99
  * flags differ from the test's. A test that aborts while it is starting never gets it, but the container stays the
100
- * file's, for its next test. A test handed a container an earlier test used notes its container log's last record,
101
- * so its report can print only the records after it. When that note finds Testserver has stopped the container
100
+ * file's, for its next test. A test handed a container an earlier test used notes its container log's last record, so
101
+ * its report can print only the records after it. When that note finds Testserver has stopped the container
102
102
  * (`container-stopped`), as its idle eviction does between tests, the test gets a new container in its place, before
103
- * its body runs.
104
- * After a failed test, the test's failure handler, which Vitest awaits even when a fixture's cleanup throws, reads
105
- * the container log, then ends the container when the failure may come from it (`endsSharedContainer`), so the next
106
- * test that asks starts a new one, and otherwise keeps it for the next test. The failure report covers only this
107
- * test's activity (its setup calls, factory calls, API requests and external calls) and container log, and says
108
- * whether the container was kept, ended, or failed to end. A concurrent test can't share the file's container, and fails before anything starts.
103
+ * its body runs. After a failed test, the test's failure handler, which Vitest awaits even when a fixture's cleanup
104
+ * throws, reads the container log, then ends the container when the failure may come from it (`endsSharedContainer`),
105
+ * so the next test that asks starts a new one, and otherwise keeps it for the next test. The failure report covers only
106
+ * this test's activity (its setup calls, factory calls, API requests and external calls) and container log, and says
107
+ * whether the container was kept, ended, or failed to end. A concurrent test can't share the file's container, and
108
+ * fails before anything starts.
109
109
  */
110
110
  export declare function provideContainer<C extends SharedContainer>(request: ContainerRequest<C>): Promise<C>;
111
111
  /**
@@ -115,15 +115,15 @@ export class FileContainer {
115
115
  *
116
116
  * In `'file'` scope, hands the test the file's container, starting it if need be, or replacing it when its feature
117
117
  * flags differ from the test's. A test that aborts while it is starting never gets it, but the container stays the
118
- * file's, for its next test. A test handed a container an earlier test used notes its container log's last record,
119
- * so its report can print only the records after it. When that note finds Testserver has stopped the container
118
+ * file's, for its next test. A test handed a container an earlier test used notes its container log's last record, so
119
+ * its report can print only the records after it. When that note finds Testserver has stopped the container
120
120
  * (`container-stopped`), as its idle eviction does between tests, the test gets a new container in its place, before
121
- * its body runs.
122
- * After a failed test, the test's failure handler, which Vitest awaits even when a fixture's cleanup throws, reads
123
- * the container log, then ends the container when the failure may come from it (`endsSharedContainer`), so the next
124
- * test that asks starts a new one, and otherwise keeps it for the next test. The failure report covers only this
125
- * test's activity (its setup calls, factory calls, API requests and external calls) and container log, and says
126
- * whether the container was kept, ended, or failed to end. A concurrent test can't share the file's container, and fails before anything starts.
121
+ * its body runs. After a failed test, the test's failure handler, which Vitest awaits even when a fixture's cleanup
122
+ * throws, reads the container log, then ends the container when the failure may come from it (`endsSharedContainer`),
123
+ * so the next test that asks starts a new one, and otherwise keeps it for the next test. The failure report covers only
124
+ * this test's activity (its setup calls, factory calls, API requests and external calls) and container log, and says
125
+ * whether the container was kept, ended, or failed to end. A concurrent test can't share the file's container, and
126
+ * fails before anything starts.
127
127
  */
128
128
  export async function provideContainer(request) {
129
129
  const { signal, onCleanup, onTestFailed, report } = request;
@@ -179,7 +179,7 @@ export async function provideContainer(request) {
179
179
  }
180
180
  /**
181
181
  * Whether a failed test's failure may come from the file's container, so `'file'` scope ends the container rather
182
- * than hand it to the file's next test. It reads what the adapter recorded of the test, never the test's errors: the
182
+ * than hand it to the file's next test. It reads what the library recorded of the test, never the test's errors: the
183
183
  * test was aborted (a timeout aborts it); one of the setup calls, factory calls, API requests or external calls it
184
184
  * made, those after the counts in `before`, failed (`activityFailed`), whether the test caught the error or not; a
185
185
  * fixture saw Testserver fail the test
@@ -1,5 +1,5 @@
1
1
  import type { ServiceWarmup } from "../../../vendor/testserver-sdk/index.js";
2
- import type { TestEventReporter } from "../../../vitest/index.ts";
2
+ import type { WorkerTestEventWriter } from "../../../sdk/index.ts";
3
3
  /** A container start `reportedStart` reported: what `start` returned, how long it took, and any warmup after it. */
4
4
  export interface ReportedStart<T> {
5
5
  readonly value: T;
@@ -11,9 +11,9 @@ export interface ReportedStart<T> {
11
11
  };
12
12
  }
13
13
  /**
14
- * `start`, then `warm` on what it returned when given, reporting to `report`, for `file`: `container-starting`,
15
- * then, once both have ended, `container-started` with the start's `ms` and, when `warm` ran, `warmupMs` and how
16
- * many services failed (`warmupFailed`). A start that throws reports `ok: false` without warmup fields, and so does a
17
- * `warm` that throws, which leaves ending the container to `warm`.
14
+ * `start`, then `warm` on what it returned when given, reporting to `report`, for `file`: `setup-started`, then, once
15
+ * both have ended, `setup-finished` with the start's `ms` and, when `warm` ran, `warmupMs`, each with the label
16
+ * "container" and the Testserver pool's name as its resource. A start that throws reports `ok: false` without
17
+ * `warmupMs`, and so does a `warm` that throws, which leaves ending the container to `warm`.
18
18
  */
19
- export declare function reportedStart<T>(report: TestEventReporter, file: string, start: () => Promise<T>, warm?: (value: T) => Promise<ServiceWarmup>, now?: () => number): Promise<ReportedStart<T>>;
19
+ export declare function reportedStart<T>(report: WorkerTestEventWriter, file: string, start: () => Promise<T>, warm?: (value: T) => Promise<ServiceWarmup>, now?: () => number): Promise<ReportedStart<T>>;
@@ -1,31 +1,34 @@
1
- // How a vitest worker reports a container start as test events (`container-starting`, then `container-started`, with
2
- // the warmup after it), through the worker's test event reporter (`src/vitest/`).
1
+ // How a vitest worker reports a container start as a setup phase of its test events (`setup-started`, then
2
+ // `setup-finished`, with the warmup after it), labelled "container" and owned by the Testserver pool, through the
3
+ // worker's test event writer (`testEventReporter`, `src/vitest/`).
4
+ import { TESTSERVER_POOL_NAME } from "../run/connection.js";
5
+ /** What every container start's setup events carry: the label the launcher words its text with, and the resource. */
6
+ const CONTAINER_SETUP = { label: "container", resource: TESTSERVER_POOL_NAME };
3
7
  /**
4
- * `start`, then `warm` on what it returned when given, reporting to `report`, for `file`: `container-starting`,
5
- * then, once both have ended, `container-started` with the start's `ms` and, when `warm` ran, `warmupMs` and how
6
- * many services failed (`warmupFailed`). A start that throws reports `ok: false` without warmup fields, and so does a
7
- * `warm` that throws, which leaves ending the container to `warm`.
8
+ * `start`, then `warm` on what it returned when given, reporting to `report`, for `file`: `setup-started`, then, once
9
+ * both have ended, `setup-finished` with the start's `ms` and, when `warm` ran, `warmupMs`, each with the label
10
+ * "container" and the Testserver pool's name as its resource. A start that throws reports `ok: false` without
11
+ * `warmupMs`, and so does a `warm` that throws, which leaves ending the container to `warm`.
8
12
  */
9
13
  export async function reportedStart(report, file, start, warm, now = Date.now) {
10
14
  const startedAt = now();
11
- report({ kind: "container-starting", file });
15
+ report({ kind: "setup-started", file, ...CONTAINER_SETUP });
12
16
  let startMs;
13
17
  try {
14
18
  const value = await start();
15
19
  startMs = now() - startedAt;
16
20
  if (warm === undefined) {
17
- report({ kind: "container-started", file, ms: startMs, ok: true });
21
+ report({ kind: "setup-finished", file, ...CONTAINER_SETUP, ms: startMs, ok: true });
18
22
  return { value, startMs };
19
23
  }
20
24
  const warmStartedAt = now();
21
25
  const warmup = await warm(value);
22
26
  const warmupMs = now() - warmStartedAt;
23
- const warmupFailed = warmup.services.filter((service) => !service.ok).length;
24
- report({ kind: "container-started", file, ms: startMs, ok: true, warmupMs, warmupFailed });
27
+ report({ kind: "setup-finished", file, ...CONTAINER_SETUP, ms: startMs, ok: true, warmupMs });
25
28
  return { value, startMs, warmup: { ms: warmupMs, warmup } };
26
29
  }
27
30
  catch (error) {
28
- report({ kind: "container-started", file, ms: startMs ?? now() - startedAt, ok: false });
31
+ report({ kind: "setup-finished", file, ...CONTAINER_SETUP, ms: startMs ?? now() - startedAt, ok: false });
29
32
  throw error;
30
33
  }
31
34
  }
@@ -103,7 +103,7 @@ export interface ContainerReport extends ContainerActivity {
103
103
  readonly testserverUrl: string;
104
104
  /** The feature flags the container was started with; `{}` for none. */
105
105
  readonly featureFlags: FeatureFlags;
106
- /** The container's warmups: one when the adapter started it with `warmServices`, none without. */
106
+ /** The container's warmups: one when the library started it with `warmServices`, none without. */
107
107
  readonly warmups: readonly ServiceWarmup[];
108
108
  readonly log: ContainerLogSlice;
109
109
  readonly redact: Redact;
@@ -1,8 +1,8 @@
1
- import type { StormTest } from "./types.ts";
1
+ import type { TestserverTest } from "./types.ts";
2
2
  declare module "vitest" {
3
3
  interface TaskMeta {
4
4
  /**
5
- * What the storm Vitest adapter recorded for the test: the Testserver URL its container is on, and the
5
+ * What the Testserver Vitest fixtures recorded for the test: the Testserver URL its container is on, and the
6
6
  * container's test id once the test was handed it (missing if its start failed or the test aborted first).
7
7
  */
8
8
  storm?: {
@@ -19,15 +19,16 @@ declare module "vitest" {
19
19
  * the file's start and finish, each attempt at a test, its start and how it ended, and each container start and how
20
20
  * long it took. A retried test reports each attempt; its final result comes from `stormReporter`
21
21
  * (`@vercel/storm/vitest/config`), in vitest's main process. `stormEvents`, `stormFileEvents` and
22
- * `stormTestEvents` are the adapter's own, which tests don't use.
22
+ * `stormTestEvents` are the library's own, which tests don't use.
23
23
  *
24
24
  * - `verbose` (per worker): whether the run is verbose, under a run's `--verbose`, from the run payload. Then
25
25
  * `container` prints each container start and `proxy` each request as it is recorded, for passing tests too, and
26
- * a test's own fixture can print what it does, as the Vercel CLI driver's invocations.
27
- * - `testserverUrl` (per worker): this worker's Testserver sandbox, `sandboxes[(VITEST_POOL_ID - 1) % N]` from the
28
- * Testserver connection the run payload holds (`readRunPayload().get(testserverConnection)`). Outside a storm run,
29
- * or with a `VITEST_POOL_ID` that isn't a positive integer, it throws, so the test fails rather than skips.
30
- * - `stormFile` (per file): the adapter's own state for the file, which tests don't use: its `container`, the
26
+ * a test's own fixture can print what it does, as the Vercel CLI invoker's invocations.
27
+ * - `testserverUrl` (per worker): this worker's Testserver sandbox, `sandboxes[workerIndex % N]` from the Testserver
28
+ * connection the run payload holds (`readRunPayload().get(testserverConnection)`), by the worker's worker index,
29
+ * its `VITEST_POOL_ID` less one (`workerTestserverUrl`, `worker-sandbox.ts`). Outside a storm run, or with a
30
+ * `VITEST_POOL_ID` that isn't a positive integer, it throws, so the test fails rather than skips.
31
+ * - `stormFile` (per file): the library's own state for the file, which tests don't use: its `container`, the
31
32
  * holder of the file's container, and its `acquisitions`, the container and proxy starts still in flight. Creating
32
33
  * it starts nothing. When the file finishes, it ends the file's container once any start in flight settles, and
33
34
  * waits for every other start, so the file's worker can't exit while one is still starting.
@@ -49,7 +50,8 @@ declare module "vitest" {
49
50
  * A concurrent test fails instead. In `'test'` scope, a container started for the test, labeled with the test's
50
51
  * name, and ended after it. The test's `task.meta.storm` records the Testserver URL and, once the test has the
51
52
  * container, its test id.
52
- * - `seed`: a `Seeder` over `container`, per test.
53
+ * A retry of a test whose container failed to start starts one again, once: Vitest before 5.0.4 sets no fixture up
54
+ * again after its setup throws, so in a later attempt `proxy` fails, saying the attempt has no container.
53
55
  * - `proxy`: a proxy adding `container`'s test id, per test, closed after it. Once closed, its cleanup fails the
54
56
  * test when a fault rule forwarded a request and Testserver failed (`fault.upstream.error`), or Testserver refused a
55
57
  * request because it had stopped the container; a rule with hits left doesn't.
@@ -64,4 +66,4 @@ declare module "vitest" {
64
66
  * prints the requests it received, each a fault rule matched tagged with the fault, then each fault rule with hits
65
67
  * left. Tokens are redacted throughout.
66
68
  */
67
- export declare const test: StormTest;
69
+ export declare const test: TestserverTest;