@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
@@ -1,182 +1,31 @@
1
1
  import {
2
- RAN_DESCRIPTION,
3
- RUN_CLI_OPTIONS,
4
- RUN_ERRORS,
5
- RUN_FIELDS,
6
- RUN_REQUEST_FIELDS,
7
- RUN_USAGE_FLAGS,
8
- canceledBeforeStart,
9
- checkoutFailedRefusal,
10
- ranSchema,
11
- renderRan,
12
- runCommand,
13
- runProblems
14
- } from "../../chunks/chunk-AKKNF3WZ.js";
2
+ defineRunCommand
3
+ } from "../../chunks/chunk-SXW6XN4R.js";
4
+ import "../../chunks/chunk-RYRJNHL7.js";
5
+ import "../../chunks/chunk-U7M3ZB3Z.js";
15
6
  import "../../chunks/chunk-I5GZLOLQ.js";
16
- import "../../chunks/chunk-JQ2HK4RN.js";
17
- import "../../chunks/chunk-WF4KJ7YG.js";
7
+ import "../../chunks/chunk-FK4RLDEK.js";
8
+ import "../../chunks/chunk-Y3BUNNRG.js";
9
+ import "../../chunks/chunk-4XT5RC5T.js";
18
10
  import {
19
- planSchema,
20
- resourceRunExamples
21
- } from "../../chunks/chunk-H2VCSNVU.js";
22
- import {
23
- describeVitestListFailure,
24
- planVitestRun,
25
- vitestRunArgv
26
- } from "../../chunks/chunk-AGWW3HDT.js";
27
- import "../../chunks/chunk-VJQLMGOH.js";
28
- import "../../chunks/chunk-XHJGHJBW.js";
29
- import {
30
- stormCommands
31
- } from "../../chunks/chunk-YF3ICDBY.js";
32
- import "../../chunks/chunk-J6ZNYUDV.js";
33
- import {
34
- defineOutcomes,
35
- refused
36
- } from "../../chunks/chunk-ZJ2USLAT.js";
37
-
38
- // src/commands/vitest/command.ts
39
- import { join, parse } from "node:path";
40
- import { z as z2 } from "zod";
41
-
42
- // src/commands/vitest/outcomes.ts
43
- import { z } from "zod";
44
- var listedShape = {
45
- /** The arguments given to `vitest run`, which `vitest list --json` was given too. */
46
- args: z.array(z.string()),
47
- /** The directory `vitest list` ran in, on this machine. */
48
- cwd: z.string()
49
- };
50
- var outcomes = defineOutcomes({
51
- results: {
52
- ran: {
53
- schema: ranSchema.extend({
54
- /**
55
- * The test plan: what `vitest list` counted before the run, and each resource option whose default is a
56
- * function of it, with its value and where that came from.
57
- */
58
- plan: planSchema
59
- }),
60
- description: RAN_DESCRIPTION,
61
- render: renderRan
62
- }
63
- },
64
- errors: {
65
- ...RUN_ERRORS,
66
- noMatchingTests: {
67
- exitCode: 1,
68
- description: "vitest list found no test for the arguments given to vitest run, so nothing was minted, acquired or started.",
69
- schema: z.object(listedShape),
70
- render: ({ args, cwd }) => ({
71
- message: `vitest list found no test for vitest run ${argsText(args)} in ${cwd}. The command didn't run.`,
72
- next: [
73
- {
74
- type: "text",
75
- text: `Change the arguments given to vitest run (${argsText(args)}), then retry. Put vitest's own dash options after --.`
76
- }
77
- ]
78
- })
79
- },
80
- vitestListFailed: {
81
- exitCode: 1,
82
- 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.",
83
- schema: z.object({
84
- /** How listing failed: vitest wasn't found or couldn't start (`start-failed`), didn't finish (`timed-out`), exited other than 0 (`exited`), or printed something other than a list of tests (`unreadable-output`). */
85
- kind: z.enum(["start-failed", "timed-out", "exited", "unreadable-output"]),
86
- /** What went wrong, such as the directories searched for vitest, or the last line of vitest's stderr. */
87
- message: z.string(),
88
- ...listedShape
89
- }),
90
- render: ({ kind, message, cwd }) => ({
91
- message: `Couldn't count the tests in ${cwd}: ${/[.!?]$/.test(message) ? message : `${message}.`} The command didn't run.`,
92
- next: [{ type: "text", text: LIST_FAILED_NEXT[kind] }]
93
- })
94
- }
95
- }
96
- });
97
- function argsText(args) {
98
- return args.length === 0 ? "(none)" : args.join(" ");
99
- }
100
- var LIST_FAILED_NEXT = {
101
- "start-failed": "Install vitest in the package, or run the command with storm exec, which counts nothing.",
102
- "timed-out": "Check why vitest list doesn't finish, such as a global setup that waits, then retry.",
103
- exited: "Fix what vitest list reports, then retry. vitest list takes the arguments vitest run does, but refuses some run-only options.",
104
- "unreadable-output": "Check that the package's vitest prints its list with --json, then retry."
105
- };
11
+ driverNamed
12
+ } from "../../chunks/chunk-ISGQJIQM.js";
13
+ import "../../chunks/chunk-IYM44FUX.js";
14
+ import "../../chunks/chunk-LQKNI3EG.js";
15
+ import "../../chunks/chunk-NMVODY3P.js";
16
+ import "../../chunks/chunk-TEEZL3GA.js";
17
+ import "../../chunks/chunk-TMQQYHUX.js";
18
+ import "../../chunks/chunk-FSP3SJ35.js";
19
+ import "../../chunks/chunk-ODQHQJLE.js";
20
+ import "../../chunks/chunk-YT5OROR7.js";
21
+ import "../../chunks/chunk-BW2ADH7U.js";
22
+ import "../../chunks/chunk-GQIL3AHY.js";
23
+ import "../../chunks/chunk-GSC6SRTW.js";
24
+ import "../../chunks/chunk-43MWZLJR.js";
25
+ import "../../chunks/chunk-YM6TZV4L.js";
106
26
 
107
27
  // src/commands/vitest/command.ts
108
- var command_default = stormCommands.define({
109
- requestSchema: z2.object({ ...RUN_REQUEST_FIELDS, args: z2.array(z2.string()).default([]) }),
110
- cli: { options: RUN_CLI_OPTIONS, positionals: ["args"] },
111
- help: {
112
- usages: [`${RUN_USAGE_FLAGS} [<vitest run args>...] [-- <vitest dash options>...]`],
113
- fields: {
114
- ...RUN_FIELDS,
115
- args: {
116
- valueLabel: "args",
117
- description: "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."
118
- }
119
- },
120
- examples: [
121
- {
122
- argv: "",
123
- 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."
124
- },
125
- {
126
- argv: "test/api -- -t creates",
127
- description: "Run the tests named creates in the files under test/api."
128
- },
129
- ...resourceRunExamples("vitest")
130
- ]
131
- },
132
- response: outcomes,
133
- validate: runProblems,
134
- handler: async (context, request) => await runCommand(context, request, {
135
- name: "vitest",
136
- planCommand: async (where, signal) => await planVitestCommand(context.app, request.args, where, signal),
137
- ran: (facts, { testPlan, options }) => outcomes.ran({ ...facts, plan: { tests: testPlan.tests, files: testPlan.files, options: [...options] } })
138
- })
139
- });
140
- async function planVitestCommand(app, args, where, signal) {
141
- const root = await app.context.checkout.repositoryRoot({ cwd: app.cwd });
142
- let cwd;
143
- let searchRoot;
144
- if (where.kind === "unsandboxed") {
145
- cwd = app.cwd;
146
- searchRoot = root.ok ? root.value : parse(app.cwd).root;
147
- } else {
148
- if (!root.ok) return refused(checkoutFailedRefusal(root.failure));
149
- cwd = join(root.value, where.recipe.cwd);
150
- searchRoot = root.value;
151
- }
152
- const found = await app.context.vitestList.findVitest({ from: cwd, root: searchRoot });
153
- if (!found.ok)
154
- return refused(
155
- outcomes.vitestListFailed({
156
- kind: "start-failed",
157
- message: `found no vitest in node_modules/.bin of ${found.searched.join(", ")}`,
158
- args: [...args],
159
- cwd
160
- })
161
- );
162
- const planned = await planVitestRun({ args, cwd, executable: found.path, signal }, app.context.vitestList);
163
- if (!planned.ok) {
164
- const { failure } = planned;
165
- if (failure.kind === "canceled") return refused(canceledBeforeStart());
166
- return refused(
167
- outcomes.vitestListFailed({
168
- kind: failure.kind,
169
- message: describeVitestListFailure(failure),
170
- args: [...args],
171
- cwd
172
- })
173
- );
174
- }
175
- const { tests, files } = planned.plan;
176
- if (tests === 0) return refused(outcomes.noMatchingTests({ args: [...args], cwd }));
177
- const executable = where.kind === "unsandboxed" ? found.path : "vitest";
178
- return { ok: true, argv: vitestRunArgv(executable, args), testPlan: { kind: "counted", tests, files } };
179
- }
28
+ var command_default = defineRunCommand(driverNamed("vitest"));
180
29
  export {
181
30
  command_default as default
182
31
  };
@@ -1,6 +1,6 @@
1
1
  // src/commands/vitest/metadata.ts
2
2
  var metadata = {
3
- description: "Run vitest run with the run payload in STORM_RUN, after counting its tests and sizing the run. storm's flags come first; every other argument goes to vitest run unchanged, in order. Put vitest's own dash options, such as -t or --project, after --. Before anything is minted, acquired or started, it counts the tests with vitest list --json and the same arguments, on this machine, with this machine's environment: in the working directory for an unsandboxed run (--unsandboxed), and in <repository root>/<runner cwd> for a sandboxed run, the directory where vitest runs in the runner sandbox. It refuses with no_matching_tests when vitest lists none, and with vitest_list_failed when listing fails; vitest list refuses some options only vitest run takes. A signal while it counts stops vitest list and cancels the run. A vitest config that resolves only inside the runner sandbox can't be counted here: run it with storm exec. A resource of the run may size itself from the count: an option whose default is a function of the test plan takes its own flag if given, else its key in storm.config.ts, else the default for the count; the run says each such option's value and where it came from on stderr before it acquires anything. In an unsandboxed run, vitest is the nearest node_modules/.bin/vitest from the working directory up to the repository's root, or the filesystem's root outside a repository; in a sandboxed run, vitest from the runner's PATH, which starts with node_modules/.bin of the runner cwd and of the repository's root. Otherwise it runs as storm exec does: in a runner sandbox by default or on this machine with --unsandboxed, with a live view or plain lines on stderr, a waterfall, a run directory that storm runs show reads back, and the exit code of vitest. The run's result and its run directory's run.json carry the test plan: the tests and files counted, and each option sized from them, with its value and where it came from.",
3
+ description: "Run vitest run with the run payload in STORM_RUN, after counting its tests and sizing the run. storm's flags come first; every other argument goes to vitest run unchanged, in order. Put vitest's own dash options, such as -t or --project, after --. Before anything is minted, acquired or started, it counts the tests with vitest list --json and the same arguments, on this machine, with this machine's environment: in the working directory for an unsandboxed run (--unsandboxed), and in <repository root>/<runner cwd> for a sandboxed run, the directory where vitest runs in the runner sandbox. It refuses with no_matching_tests when vitest lists none, and with driver_plan_failed when listing fails; vitest list refuses some options only vitest run takes. A signal while it counts stops vitest list and cancels the run. A vitest config that resolves only inside the runner sandbox can't be counted here: run it with storm exec. A resource of the run may size itself from the count: an option whose default is a function of the test plan takes its own flag if given, else its key in storm.config.ts, else the default for the count; the run says each such option's value and where it came from on stderr before it acquires anything. In an unsandboxed run, vitest is the nearest node_modules/.bin/vitest from the working directory up to the repository's root, or the filesystem's root outside a repository; in a sandboxed run, vitest from the runner's PATH, which starts with node_modules/.bin of the runner cwd and of the repository's root. Otherwise it runs as storm exec does: in a runner sandbox by default or on this machine with --unsandboxed, with a live view or plain lines on stderr, a waterfall, a run directory that storm runs show reads back, and the exit code of vitest. The run's result and its run directory's run.json carry the test plan: the tests and files counted, and each option sized from them, with its value and where it came from.",
4
4
  summary: "Count the tests, size the run, and run vitest."
5
5
  };
6
6
  export {
@@ -1,6 +1,6 @@
1
1
  import { type Refusable } from "@vercel/clinkr";
2
2
  import { z } from "zod";
3
- import { type Credential, type CredentialFailure, type CredentialOrigin, type CredentialSourceChoice, credentialSourceFor } from "../credential/index.ts";
3
+ import { type Credential, type CredentialContext, type CredentialFailure, type CredentialOrigin, type CredentialSourceChoice } from "../credential/index.ts";
4
4
  import { type credentialErrors } from "./credential-settle.ts";
5
5
  /**
6
6
  * The errors a credential source's `obtain()` refuses with. A command that obtains a credential spreads them into its
@@ -108,7 +108,10 @@ export interface CredentialTarget {
108
108
  readonly scope: GivenSetting | undefined;
109
109
  readonly project: GivenSetting | undefined;
110
110
  }
111
- /** How a command shows a credential source's steps: one line before each mint or token request. */
111
+ /**
112
+ * How a command shows a credential source's steps: one line before each mint or token request, from the source's
113
+ * `minting` and `requesting-token` events; its `minted` event shows nothing.
114
+ */
112
115
  export interface CredentialReport {
113
116
  readonly progress?: ((line: string) => Promise<void>) | undefined;
114
117
  }
@@ -127,5 +130,5 @@ export interface CredentialResolver {
127
130
  }, ReturnType<typeof credentialErrors.missingTarget>>;
128
131
  }
129
132
  /** The credential launcher resolver over `gateways`. */
130
- export declare function credentialResolver(gateways: Parameters<typeof credentialSourceFor>[1]): CredentialResolver;
133
+ export declare function credentialResolver(gateways: CredentialContext): CredentialResolver;
131
134
  export {};
@@ -46,12 +46,13 @@ export function credentialResolver(gateways) {
46
46
  if (!chosen.ok)
47
47
  return chosen;
48
48
  const { progress } = report;
49
+ // The source's events as the command's lines: one before the mint and one before each token request.
49
50
  const source = credentialSourceFor(chosen.credential, gateways, {
50
- onMint: async (mintTarget) => {
51
- await progress?.(`Minting a credential for ${mintTargetText(mintTarget)}…`);
52
- },
53
- onRequest: async () => {
54
- await progress?.(REQUESTING_TOKEN_LINE);
51
+ emit: async (event) => {
52
+ if (event.kind === "minting")
53
+ await progress?.(`Minting a credential for ${mintTargetText(event.target)}…`);
54
+ else if (event.kind === "requesting-token")
55
+ await progress?.(REQUESTING_TOKEN_LINE);
55
56
  },
56
57
  });
57
58
  return {
@@ -5,7 +5,7 @@ import type { RunnerRecipe as RunnerRecipeOf } from "../runner/recipe.ts";
5
5
  export { pnpmToolchains } from "./toolchain.ts";
6
6
  export type { RecipeRun } from "../config/recipe-run.ts";
7
7
  export type { Resource } from "../sdk/extension/resource-definition.ts";
8
- export type { RunnerStep, RunnerStepContext, RunnerSteps } from "../runner/recipe.ts";
8
+ export type { RunnerStep, RunnerStepContext, RunnerStepList } from "../runner/recipe.ts";
9
9
  export type { Present } from "../sdk/run/launcher.ts";
10
10
  /**
11
11
  * The runner recipe, the `runner` key: its `vcpus` may be a function of the run (`RecipeRun`), which reads a resource
package/dist/context.d.ts CHANGED
@@ -1,14 +1,16 @@
1
1
  import { type ConfigGateway, type ConfigResolver, type CredentialResolver } from "./config/index.ts";
2
2
  import { type CredentialGateway, type GitHubActionsTokenGateway } from "./credential/index.ts";
3
+ import type { PackageBinService } from "./launcher-resolvers/index.ts";
3
4
  import type { Presentation } from "./presentation.ts";
4
- import type { RESOURCES, StormWorlds } from "./extensions.ts";
5
- import { type CommandGateway, type JobSummaryGateway, type ProgressTerminal, type RunDirectoryGateway } from "./core/index.ts";
5
+ import type { RESOURCES, StormDriverContextMap, StormResourceContextMap } from "./extensions.ts";
6
+ import { type CommandGateway, type JobSummaryGateway, type PackageBinGateway, type ProgressTerminal } from "./core/index.ts";
7
+ import { type RunDirectoryGateway } from "./run-directory/index.ts";
6
8
  import { type CheckoutGateway, type RunnerSandboxGateway, type RunnerSnapshotCacheGateway, type RunnerTerminal } from "./runner/index.ts";
7
9
  import { type Clock, type Timer } from "./time/index.ts";
8
- import { type VitestListGateway } from "./vitest/plan.ts";
9
10
  /**
10
- * The gateways and DI seams storm's commands reach the outside through. Each resource reaches it through its own world
11
- * instead (`StormApp.worlds`). Tests build it over fakes.
11
+ * The gateways and DI seams storm's commands reach the outside through. Each resource reaches it through its own
12
+ * Context instead (`StormApp.resourceContexts`), and each driver's plan step through its driver's
13
+ * (`StormApp.driverContexts`). Tests build it over fakes.
12
14
  */
13
15
  export interface StormContext {
14
16
  readonly credentials: CredentialGateway;
@@ -30,15 +32,15 @@ export interface StormContext {
30
32
  readonly progressTerminal: ProgressTerminal;
31
33
  /** The GitHub Actions job summary a run appends its summary to, in a step that has one. */
32
34
  readonly jobSummary: JobSummaryGateway;
33
- /** vitest on this machine, which `storm vitest` finds and counts the tests with before a run starts. */
34
- readonly vitestList: VitestListGateway;
35
+ /** The binaries packages install on this machine, among them `vitest` and `playwright`, which a run finds there. */
36
+ readonly packageBins: PackageBinGateway;
35
37
  readonly timer: Timer;
36
38
  readonly clock: Clock;
37
39
  }
38
40
  /**
39
- * Where a command records the status the process exits with, past Clinkr's: a Clinkr handler's result exits only
40
- * 0 or 1, so a run, `exec`'s or `vitest`'s, records its command's code (or `128 + n` for a signal) here, and `bin/storm.ts` exits with
41
- * it when it is set.
41
+ * Where a command records the status the process exits with, past Clinkr's: a Clinkr handler's result exits only 0 or
42
+ * 1, so a run records its command's code (or `128 + n` for a signal) here, and `bin/storm.ts` exits with it when it is
43
+ * set.
42
44
  */
43
45
  export interface StormExit {
44
46
  status: number | undefined;
@@ -48,13 +50,17 @@ export interface StormExit {
48
50
  * which their mount projects from this one, and the mounts are checked against it (`EXTENSION_COMMANDS`,
49
51
  * `src/extension-commands.ts`).
50
52
  */
51
- export interface StormApp extends LauncherResolvers {
53
+ export interface StormApp extends LauncherResolvers, LocalServices {
52
54
  readonly context: StormContext;
53
- /** Each definition's world, by its name, built once for the command: what a run hands each resource instance. */
54
- readonly worlds: StormWorlds;
55
+ /** Each definition's Context, by its name, built once for the command: what a run hands each resource instance. */
56
+ readonly resourceContexts: StormResourceContextMap;
57
+ /**
58
+ * Each driver's Context, by its name, built once for the command: what a run command hands its driver's plan step.
59
+ */
60
+ readonly driverContexts: StormDriverContextMap;
55
61
  /** Every resource definition, which a command checks `storm.config.ts` against. */
56
62
  readonly resourceDefinitions: typeof RESOURCES;
57
- /** The launcher environment: the base of a run's command's environment. */
63
+ /** The launcher environment: the base of the command's environment. */
58
64
  readonly env: Readonly<Record<string, string | undefined>>;
59
65
  /** The launcher's working directory, where the search for `storm.config.ts` starts. */
60
66
  readonly cwd: string;
@@ -72,8 +78,8 @@ export interface StormApp extends LauncherResolvers {
72
78
  readonly exit: StormExit;
73
79
  }
74
80
  /**
75
- * The launcher resolvers, which every command gets in its app, an extension's own commands among them, so none calls the
76
- * config loading or the credential settling itself.
81
+ * The launcher resolvers, which every command gets in its app, an extension's own commands among them, so none calls
82
+ * the config loading or the credential settling itself.
77
83
  */
78
84
  export interface LauncherResolvers {
79
85
  /** Loads `storm.config.ts` and gives one resource's options and the control plane target. */
@@ -86,16 +92,30 @@ export interface LauncherResolvers {
86
92
  * definition.
87
93
  */
88
94
  export declare function launcherResolvers(app: Pick<StormApp, "context" | "cwd" | "resourceDefinitions">): LauncherResolvers;
95
+ /**
96
+ * The local services, which every command gets in its app. An extension's own commands reach this machine only through
97
+ * them, since they never see the Context; `storm vitest` finds `vitest` for a run on this machine through the package
98
+ * binary service too, and `exec`'s, `vitest`'s and `playwright`'s runs reach the Context's gateways directly.
99
+ */
100
+ export interface LocalServices {
101
+ /** Finds a package's binary on this machine, as `storm vitest` finds `vitest` there. */
102
+ readonly packageBins: PackageBinService;
103
+ }
104
+ /** The local services over an app's context. */
105
+ export declare function localServices(launcher: {
106
+ readonly context: StormContext;
107
+ }): LocalServices;
89
108
  /**
90
109
  * The live Context: `vercel` for credentials, and for `--credential github-actions` GitHub Actions' token request, read
91
- * from `env`'s `ACTIONS_ID_TOKEN_REQUEST_*` at each request, with a 10-second timeout; a run's command spawned as a
92
- * real process; `storm.config.ts` imported by Node; for the runner, git and tar on the local checkout, the
93
- * runner snapshot cache under `env`'s `XDG_STATE_HOME` or `HOME`, Vercel Sandbox through `@vercel/sandbox` (loaded
94
- * only when the runner first calls it) and this process's stdout and stderr; the run directories beside the runner
95
- * snapshot cache; the live view on this process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any;
96
- * `vitest` found in `node_modules/.bin` and spawned as a real process; and the system timer and clock. When `env` names
97
- * no place for the state directory, every runner snapshot cache operation fails and says why, which a run treats as an
98
- * empty cache, and so does opening a run directory, which a run goes on without.
110
+ * from `env`'s `ACTIONS_ID_TOKEN_REQUEST_*` at each request, with a 10-second timeout; the command spawned as a
111
+ * real process; `storm.config.ts`
112
+ * imported by Node; for the runner, git and tar on the local checkout, the runner snapshot cache under `env`'s
113
+ * `XDG_STATE_HOME` or `HOME`, Vercel Sandbox through `@vercel/sandbox` (loaded only when the runner first calls it) and
114
+ * this process's stdout and stderr; the run directories beside the runner snapshot cache; the live view on this
115
+ * process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any; a package's binary found in
116
+ * `node_modules/.bin`; and the system timer and clock. When `env` names no place for the state directory, every runner
117
+ * snapshot cache operation fails and says why, which a run treats as an empty cache, and so does opening a run
118
+ * directory, which a run goes on without.
99
119
  */
100
120
  export declare function liveContext(options: {
101
121
  readonly env: Readonly<Record<string, string | undefined>>;
package/dist/context.js CHANGED
@@ -1,11 +1,13 @@
1
- // The composition layer's wiring: the one place storm's own live gateways are built. Each resource builds its own world
2
- // (`liveWorlds`, through the registry), which the app holds beside the context, so this file names no resource.
1
+ // The composition layer's wiring: the one place storm's own live gateways are built. Each resource builds its own
2
+ // Context (`liveResourceContexts`, through the registry), and each driver its own (`liveDriverContexts`), which the app
3
+ // holds beside the context, so this file names no resource and no driver's gateway.
3
4
  import { configResolver, credentialResolver, liveConfigGateway, } from "./config/index.js";
4
5
  import { liveCredentialGateway, liveGitHubActionsTokenGateway, } from "./credential/index.js";
5
- import { liveCommandGateway, liveJobSummaryGateway, liveProgressTerminal, liveRunDirectoryGateway, resolveStateDirectory, RUNS_SUBPATH, stateDirectoryPattern, unavailableRunDirectoryGateway, } from "./core/index.js";
6
+ import { packageBinService } from "./local-services.js";
7
+ import { liveCommandGateway, liveJobSummaryGateway, livePackageBinGateway, liveProgressTerminal, resolveStateDirectory, stateDirectoryPattern, } from "./core/index.js";
8
+ import { liveRunDirectoryGateway, RUNS_SUBPATH, unavailableRunDirectoryGateway, } from "./run-directory/index.js";
6
9
  import { liveCheckoutGateway, liveRunnerSandboxGateway, liveRunnerSnapshotCacheGateway, liveRunnerTerminal, RUNNER_SNAPSHOTS_SUBPATH, unavailableRunnerSnapshotCacheGateway, } from "./runner/index.js";
7
10
  import { systemClock, systemTimer } from "./time/index.js";
8
- import { liveVitestListGateway } from "./vitest/plan.js";
9
11
  /**
10
12
  * The launcher resolvers over an app's context, from its working directory, checking the file against every resource
11
13
  * definition.
@@ -16,16 +18,21 @@ export function launcherResolvers(app) {
16
18
  credentials: credentialResolver(app.context),
17
19
  };
18
20
  }
21
+ /** The local services over an app's context. */
22
+ export function localServices(launcher) {
23
+ return { packageBins: packageBinService(launcher.context) };
24
+ }
19
25
  /**
20
26
  * The live Context: `vercel` for credentials, and for `--credential github-actions` GitHub Actions' token request, read
21
- * from `env`'s `ACTIONS_ID_TOKEN_REQUEST_*` at each request, with a 10-second timeout; a run's command spawned as a
22
- * real process; `storm.config.ts` imported by Node; for the runner, git and tar on the local checkout, the
23
- * runner snapshot cache under `env`'s `XDG_STATE_HOME` or `HOME`, Vercel Sandbox through `@vercel/sandbox` (loaded
24
- * only when the runner first calls it) and this process's stdout and stderr; the run directories beside the runner
25
- * snapshot cache; the live view on this process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any;
26
- * `vitest` found in `node_modules/.bin` and spawned as a real process; and the system timer and clock. When `env` names
27
- * no place for the state directory, every runner snapshot cache operation fails and says why, which a run treats as an
28
- * empty cache, and so does opening a run directory, which a run goes on without.
27
+ * from `env`'s `ACTIONS_ID_TOKEN_REQUEST_*` at each request, with a 10-second timeout; the command spawned as a
28
+ * real process; `storm.config.ts`
29
+ * imported by Node; for the runner, git and tar on the local checkout, the runner snapshot cache under `env`'s
30
+ * `XDG_STATE_HOME` or `HOME`, Vercel Sandbox through `@vercel/sandbox` (loaded only when the runner first calls it) and
31
+ * this process's stdout and stderr; the run directories beside the runner snapshot cache; the live view on this
32
+ * process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any; a package's binary found in
33
+ * `node_modules/.bin`; and the system timer and clock. When `env` names no place for the state directory, every runner
34
+ * snapshot cache operation fails and says why, which a run treats as an empty cache, and so does opening a run
35
+ * directory, which a run goes on without.
29
36
  */
30
37
  export function liveContext(options) {
31
38
  const snapshots = resolveStateDirectory(options.env, RUNNER_SNAPSHOTS_SUBPATH);
@@ -46,7 +53,7 @@ export function liveContext(options) {
46
53
  : unavailableRunDirectoryGateway(stateDirectoryPattern(RUNS_SUBPATH), runs.reason),
47
54
  progressTerminal: liveProgressTerminal(),
48
55
  jobSummary: liveJobSummaryGateway({ path: options.env["GITHUB_STEP_SUMMARY"] }),
49
- vitestList: liveVitestListGateway,
56
+ packageBins: livePackageBinGateway,
50
57
  timer: systemTimer,
51
58
  clock: systemClock,
52
59
  };
@@ -1,5 +1,6 @@
1
- import type { Refusal, ResourceDefinition } from "../sdk/extension/index.ts";
2
- import type { ResourceInputs, ResourceOptions, ResourceRequests, ResourceSkip, ResourceWorlds } from "./resource.ts";
1
+ import type { Refusal } from "../sdk/extension/index.ts";
2
+ import type { DefinitionLookup } from "./definition-lookup.ts";
3
+ import type { ResourceContextMap, ResourceInputs, ResourceOptions, ResourceRequests, ResourceSkip } from "./resource.ts";
3
4
  /**
4
5
  * How every resource's `beforeRun` answered, in order: `ok`, with each used instance's part of the run request, each
5
6
  * skipped one's notice, the values the run hides as `<token>`, whether any used instance needs the Vercel credential,
@@ -20,7 +21,7 @@ export type ResourcesBeforeRun = {
20
21
  readonly refusal: Refusal;
21
22
  };
22
23
  /**
23
- * Every resource definition's lifecycle, over its world, for the run's resources in order.
24
+ * Every resource definition's lifecycle, over its Context, for the run's resources in order.
24
25
  *
25
26
  * - `secrets`: each resource's secrets from its definition's pure `secrets`, for a refusal that comes before
26
27
  * `beforeRun`.
@@ -31,7 +32,7 @@ export interface ResourceLifecycles {
31
32
  beforeRun(inputs: ResourceInputs): Promise<ResourcesBeforeRun>;
32
33
  }
33
34
  /**
34
- * Every one of `resources`' lifecycles, each over its own world from `worlds`, by its definition's name, for the run's
35
- * resources in their order.
35
+ * Every one of `lookup`'s definitions' lifecycles, each over its own Context from `resourceContexts`, by its
36
+ * definition's name, for the run's resources in their order.
36
37
  */
37
- export declare function bindLifecycles(resources: readonly ResourceDefinition[], worlds: ResourceWorlds): ResourceLifecycles;
38
+ export declare function bindLifecycles(lookup: DefinitionLookup, resourceContexts: ResourceContextMap): ResourceLifecycles;
@@ -1,15 +1,15 @@
1
1
  // How the launcher calls the lifecycle of each of the run's resources before the run starts: each definition's
2
- // lifecycle, over its own world. `bindLifecycles` builds each definition's lifecycle once, then hands each resource of
3
- // the run to its definition's, with only that resource's options and sources.
4
- import { resourceRegistry } from "./resource-registry.js";
2
+ // lifecycle, over its own Context. `bindLifecycles` builds each definition's lifecycle once, then hands each resource
3
+ // of the run to its definition's, with only that resource's options and sources. The resource definition set's
4
+ // `lifecycles(contexts)` calls it (`resourceDefinitionSet`, `resource-definition-set.ts`).
5
5
  /**
6
- * Every one of `resources`' lifecycles, each over its own world from `worlds`, by its definition's name, for the run's
7
- * resources in their order.
6
+ * Every one of `lookup`'s definitions' lifecycles, each over its own Context from `resourceContexts`, by its
7
+ * definition's name, for the run's resources in their order.
8
8
  */
9
- export function bindLifecycles(resources, worlds) {
10
- const { named } = resourceRegistry(resources);
11
- // Each definition's lifecycle, over its own world, built once.
12
- const lifecycles = new Map(resources.map((resource) => [resource, resource.lifecycle(worlds[resource.name])]));
9
+ export function bindLifecycles(lookup, resourceContexts) {
10
+ const { definitions: resources, named } = lookup;
11
+ // Each definition's lifecycle, over its own Context, built once.
12
+ const lifecycles = new Map(resources.map((resource) => [resource, resource.lifecycle(resourceContexts[resource.name])]));
13
13
  const lifecycleOf = (definition, key) => {
14
14
  const lifecycle = lifecycles.get(named(definition, key));
15
15
  if (lifecycle === undefined)
@@ -0,0 +1,22 @@
1
+ import type { ResourceDefinition } from "../sdk/extension/index.ts";
2
+ /** One map's resource instance with its definition. */
3
+ export interface InstanceOf<R> {
4
+ readonly key: string;
5
+ readonly record: R;
6
+ readonly resource: ResourceDefinition;
7
+ }
8
+ /** Resource definitions, in definition order, looked up by name. */
9
+ export interface DefinitionLookup {
10
+ /** The definitions, in definition order. */
11
+ readonly definitions: readonly ResourceDefinition[];
12
+ /** The resource definition named `definition`, the definition of resource instance `key`; throws when none is. */
13
+ readonly named: (definition: string, key: string) => ResourceDefinition;
14
+ /** Each of `map`'s resource instances with its definition, in definition order, then the map's order. */
15
+ readonly inDefinitionOrder: <R extends {
16
+ readonly definition: string;
17
+ }>(map: {
18
+ readonly [key: string]: R;
19
+ }) => readonly InstanceOf<R>[];
20
+ }
21
+ /** `definitions`, in definition order, looked up by each one's name. */
22
+ export declare function definitionLookup(definitions: readonly ResourceDefinition[]): DefinitionLookup;
@@ -0,0 +1,35 @@
1
+ // The resource definition set's lookup of a resource instance's definition by its name, with the one definition order,
2
+ // which every loop over the instances shares: definition order, then the map's order. The definition set
3
+ // (`resourceDefinitionSet`, `resource-definition-set.ts`) builds it once and hands it to what it builds; it stays the
4
+ // core's, since `index.ts` exports none of this file. The core holds each definition as `defineResource` returned it,
5
+ // seen through the bare `ResourceDefinition`, whose types are `unknown` wherever the resource has types of its own.
6
+ // `defineResource` turns the typed object into that view with one cast, which rests on the core's routing: the core
7
+ // hands each Context, thing taken, event, lane state and record back only to the definition or resource instance that
8
+ // produced it, by its definition's name or its resource key, which `test/unit/core/resource-events.test.ts` holds. It
9
+ // names no resource.
10
+ /** `definitions`, in definition order, looked up by each one's name. */
11
+ export function definitionLookup(definitions) {
12
+ // Built once; the first definition of a name wins, as in definition order.
13
+ const byName = new Map();
14
+ for (const definition of definitions)
15
+ if (!byName.has(definition.name))
16
+ byName.set(definition.name, definition);
17
+ const named = (definition, key) => {
18
+ const resource = byName.get(definition);
19
+ if (resource === undefined)
20
+ throw new Error(`${key}'s definition, ${definition}, isn't in the definition set`);
21
+ return resource;
22
+ };
23
+ return {
24
+ definitions,
25
+ named,
26
+ inDefinitionOrder: (map) => {
27
+ const entries = Object.entries(map).map(([key, record]) => ({
28
+ key,
29
+ record,
30
+ resource: named(record.definition, key),
31
+ }));
32
+ return definitions.flatMap((resource) => entries.filter((entry) => entry.resource === resource));
33
+ },
34
+ };
35
+ }
@@ -0,0 +1,23 @@
1
+ import type { Driver } from "../sdk/extension/index.ts";
2
+ /** What `driversOf` reads of an extension: its drivers, if it brings any, each named. */
3
+ type WithDrivers = {
4
+ readonly drivers?: readonly {
5
+ readonly name: string;
6
+ }[];
7
+ };
8
+ /** One extension's drivers, as the tuple it lists: none for an extension that brings no driver. */
9
+ type DriversIn<Extension extends WithDrivers> = Extension extends {
10
+ readonly drivers?: infer Drivers;
11
+ } ? Drivers extends readonly unknown[] ? Drivers : readonly [] : readonly [];
12
+ /** Every extension's drivers, each extension's in turn, as one tuple, so each driver keeps its place and its type. */
13
+ export type DriversOf<E extends readonly WithDrivers[]> = E extends readonly [
14
+ infer First extends WithDrivers,
15
+ ...infer Rest extends readonly WithDrivers[]
16
+ ] ? readonly [...DriversIn<First>, ...DriversOf<Rest>] : readonly [];
17
+ /** Every extension's drivers, each extension's in turn: the registry's list of drivers. */
18
+ export declare function driversOf<const E extends readonly WithDrivers[]>(extensions: E): DriversOf<E>;
19
+ /** Each driver's Context, by the driver's name, which the launcher hands only that driver's plan step. */
20
+ export type DriverContextMap = Readonly<Record<string, unknown>>;
21
+ /** Every driver's Context, by its name, each built live by its own `context`. `drivers` lists every driver once. */
22
+ export declare function driverContexts(drivers: readonly Pick<Driver, "name" | "context">[]): DriverContextMap;
23
+ export {};
@@ -0,0 +1,13 @@
1
+ // The extensions' drivers as one list, and their Contexts: the registry (`src/extensions.ts`) takes its list,
2
+ // `DRIVERS`, from its extensions with `driversOf`, as it takes their resources with `resourcesOf` (`resources-of.ts`),
3
+ // and builds each driver's Context with `driverContexts`. An extension lists each of its drivers as its `defineDriver`
4
+ // returned it (`src/sdk/extension/driver.ts`). It names no driver.
5
+ /** Every extension's drivers, each extension's in turn: the registry's list of drivers. */
6
+ export function driversOf(extensions) {
7
+ // `flatMap` keeps the order `DriversOf` spells and loses only the tuple.
8
+ return extensions.flatMap(({ drivers }) => drivers ?? []);
9
+ }
10
+ /** Every driver's Context, by its name, each built live by its own `context`. `drivers` lists every driver once. */
11
+ export function driverContexts(drivers) {
12
+ return Object.fromEntries(drivers.map(({ name, context }) => [name, context()]));
13
+ }