@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,4 +1,4 @@
1
- import type { MintTarget } from "../credential/index.ts";
1
+ import type { CredentialEvent } from "../credential/index.ts";
2
2
  import type { LaneOutcome } from "../sdk/extension/index.ts";
3
3
  import type { RunnerEvent, RunnerSandboxPlan, SnapshotCacheNote } from "../runner/index.ts";
4
4
  import type { Clock } from "../time/index.ts";
@@ -15,10 +15,10 @@ import type { RanCommand } from "./timing.ts";
15
15
  * - `resource-skipped`: right after `started`, once for each resource instance whose `beforeRun` skipped it, in order:
16
16
  * the run goes on without instance `resource`, of `definition`, and `notice` says why.
17
17
  * - `runner-prepared`: what the runner's local checks found: the base, a full SHA, and the ref it is HEAD's
18
- * merge-base with; the untracked nested Git repositories the upload leaves out; what the cache read noticed; and
19
- * whether `--save-snapshot` saves nothing because HEAD is detached (`saveSkipped`).
20
- * - `minting`, `minted` and `requesting-token`: a credential's events (`CredentialEvent`): the run's one mint, which a
21
- * run makes for its runner sandbox, or for a resource when it has none, and a GitHub Actions OIDC token request.
18
+ * merge-base with; the untracked nested Git repositories the upload leaves out; and what the cache read noticed.
19
+ * - `minting`, `minted` and `requesting-token`: the events of the run's credential source (`CredentialEvent`, the
20
+ * `credential` module's): the run's one mint, which a run makes for its runner sandbox, or for a resource when it has
21
+ * none, and a GitHub Actions OIDC token request.
22
22
  * - `lanes-started`: acquiring the resources and readying the runner sandbox started together, after the mint;
23
23
  * without a resource, readying the runner sandbox started alone. A run without a runner lane reports none.
24
24
  * - `lane-started`: acquiring a resource instance with a lane started: its lane's name
@@ -36,7 +36,7 @@ import type { RanCommand } from "./timing.ts";
36
36
  * run killed reports the runner's `command-stopped` instead.
37
37
  * - `cleanup-started`: the run is cleaning up: with a runner sandbox (`runnerSandbox`, null without one) stopping and
38
38
  * deleting the runner's sandboxes, but for the runner sandbox, which it keeps running `ms` when that is above 0
39
- * (`keep`) or saves as a branch snapshot of `branch` while it releases the resources (`save`, only when the save
39
+ * (`keep`) or saves as a dev snapshot of `branch` while it releases the resources (`save`, only when the save
40
40
  * runs); and releasing its resource instances whose acquires took anything (`resources`, their resource keys, in
41
41
  * order).
42
42
  * - `cleanup-finished`: it is done; `resourceWarnings` counts the warnings releasing the run's resource instances
@@ -66,7 +66,6 @@ export type RunEvent = {
66
66
  readonly baseRef: string;
67
67
  readonly nestedRepositories: readonly string[];
68
68
  readonly notes: readonly SnapshotCacheNote[];
69
- readonly saveSkipped: boolean;
70
69
  } | CredentialEvent | {
71
70
  readonly kind: "lanes-started";
72
71
  } | ({
@@ -103,21 +102,6 @@ export type RunEvent = {
103
102
  readonly kind: "runner";
104
103
  readonly event: RunnerEvent;
105
104
  } | ResourceEvent | ResourceNoticeEvent | ResourceWarningEvent;
106
- /** A credential's events: the run's one mint, and a GitHub Actions OIDC token request. */
107
- export type CredentialEvent = {
108
- readonly kind: "minting";
109
- readonly target: MintTarget;
110
- } | {
111
- readonly kind: "minted";
112
- readonly target: MintTarget;
113
- readonly ok: boolean;
114
- } | {
115
- readonly kind: "requesting-token";
116
- };
117
- /** Hears a credential's events. */
118
- export interface CredentialProgress {
119
- emit(event: CredentialEvent): Promise<void>;
120
- }
121
105
  /** Hears a run's events as they happen. */
122
106
  export interface RunProgress {
123
107
  emit(event: RunEvent): Promise<void>;
@@ -1,11 +1,10 @@
1
- import type { RunnerStepPhase } from "../runner/index.ts";
2
1
  /** One chunk of a spawned command's output, as it arrives; a chunk may hold part of a line, or several. */
3
2
  export interface CommandOutputChunk {
4
3
  readonly stream: "stdout" | "stderr";
5
4
  readonly data: string;
6
5
  }
7
6
  /**
8
- * One execution of a run's command: its argument list, its whole environment, when to stop it, and where its output
7
+ * One execution of the command: its argument list, its whole environment, when to stop it, and where its output
9
8
  * goes.
10
9
  */
11
10
  export interface CommandRequest {
@@ -36,178 +35,12 @@ export type CommandOutcome = {
36
35
  readonly message: string;
37
36
  };
38
37
  /**
39
- * Runs a run's command with the terminal's stdin, hands its stdout and stderr to `onOutput`, and waits for it and for
38
+ * Runs the command with the terminal's stdin, hands its stdout and stderr to `onOutput`, and waits for it and for
40
39
  * the last of its output. It never rejects: a command that can't start is `spawn-failed`.
41
40
  */
42
41
  export interface CommandGateway {
43
42
  run(request: CommandRequest): Promise<CommandOutcome>;
44
43
  }
45
- /** What a run directory operation couldn't do: the path and what the OS said, or why there is no place for it. */
46
- export interface RunDirectoryFailure {
47
- readonly path: string;
48
- readonly message: string;
49
- }
50
- /** The output of a step in a run directory: a snapshot build's steps, applying the changes, the install, the build. */
51
- export type RunDirectoryStep = RunnerStepPhase;
52
- /** A run log: a step's log, or the command log (`command`), the command's output, in a run directory. */
53
- export type RunLog = RunDirectoryStep | "command";
54
- /**
55
- * One run's run directory, open for writing: `run.json` (what the run was, and once it ended how), `events.jsonl` (the
56
- * run's events, one JSON object a line), a log of each step's output (`snapshot.log`, `apply.log`, `install.log`,
57
- * `build.log`), `command.log` (the command's stdout and stderr in arrival order, wherever it runs),
58
- * `.test-events.jsonl` (the test events the command stages here, unredacted, while it runs, which `close` removes),
59
- * `.tests.jsonl.partial` (the run's redacted test events as storm gets them), `tests.jsonl` (that file, published once
60
- * the run is over) and `timeline.json`. While it is open, `active.json` marks it active, so no run prunes it. Writes
61
- * never throw; `run.json`, `tests.jsonl` and `timeline.json` each appear whole, one after another in the order asked,
62
- * so a reader sees a file whole or not at all; the first write that fails stops the rest, and `close` answers it.
63
- */
64
- export interface RunDirectory {
65
- readonly path: string;
66
- /** Its run id, the directory's name. */
67
- readonly id: string;
68
- /** Replaces `run.json` whole. */
69
- writeRun(text: string): void;
70
- /** Appends one line to `events.jsonl`. */
71
- appendEvent(line: string): void;
72
- /** Appends one line of a step's output to its log. */
73
- appendStepOutput(step: RunDirectoryStep, line: string): void;
74
- /** Appends the command's output, as it came. */
75
- appendCommandOutput(text: string): void;
76
- /** Appends one redacted test event line to the private file that becomes `tests.jsonl`. */
77
- appendTestEvent(line: string): void;
78
- /**
79
- * Publishes the redacted test events appended so far as `tests.jsonl`, after any earlier replacement. A run that
80
- * appended none publishes an empty file. Appends after this are dropped.
81
- */
82
- publishTestEvents(): void;
83
- /** Writes `timeline.json` whole, after any earlier replacement. */
84
- writeTimeline(text: string): void;
85
- /**
86
- * Streams the non-empty lines the command staged in `.test-events.jsonl`, the test events file its run payload names,
87
- * to `onLine`, in order. A file that doesn't exist reads as empty; any other read failure is returned after the lines
88
- * read before it.
89
- */
90
- readTestEvents(onLine: (line: string) => void): Promise<StagedTestEventsRead>;
91
- /**
92
- * Waits for every write so far, ends writing, removes the test events the command staged whatever failed before, and
93
- * removes the active marker, so the run directory is completed; answers the first write that failed, or else a staged
94
- * test events file or a marker it couldn't remove, if any.
95
- */
96
- close(): Promise<RunDirectoryFailure | undefined>;
97
- }
98
- /** How reading the command's staged test events went: read whole, or stopped by a failure. */
99
- export type StagedTestEventsRead = {
100
- readonly ok: true;
101
- } | {
102
- readonly ok: false;
103
- readonly failure: RunDirectoryFailure;
104
- };
105
- /** How opening a run directory went: the directory, and what pruning older ones couldn't remove; or a failure. */
106
- export type OpenRunDirectoryResult = {
107
- readonly ok: true;
108
- readonly directory: RunDirectory;
109
- readonly pruneFailures: readonly RunDirectoryFailure[];
110
- } | {
111
- readonly ok: false;
112
- readonly failure: RunDirectoryFailure;
113
- };
114
- /** A run directory as a listing finds it: its run id, path, whether it is active, and its `run.json`, if readable. */
115
- export interface ListedRunDirectory {
116
- readonly id: string;
117
- readonly path: string;
118
- readonly active: boolean;
119
- /** `run.json` as it reads; undefined when the run directory has none or it can't be read. */
120
- readonly run: string | undefined;
121
- }
122
- /** How listing the run directories went: each one, newest first; or a failure. */
123
- export type ListRunDirectoriesResult = {
124
- readonly ok: true;
125
- readonly runs: readonly ListedRunDirectory[];
126
- } | {
127
- readonly ok: false;
128
- readonly failure: RunDirectoryFailure;
129
- };
130
- /**
131
- * A run directory as reading it finds it: its listing, its test events and timeline as they read, and the run logs it
132
- * holds.
133
- */
134
- export interface PastRunDirectory extends ListedRunDirectory {
135
- /**
136
- * The lines of `tests.jsonl`, the run's redacted test events; undefined until the run has written it, once it was
137
- * over. The test events the command stages while it runs are never read back.
138
- */
139
- readonly tests: readonly string[] | undefined;
140
- /** `timeline.json` as it reads; undefined when there is none. */
141
- readonly timeline: string | undefined;
142
- /** The run logs it holds, in `RUN_LOGS`' order. */
143
- readonly logs: readonly RunLog[];
144
- }
145
- /**
146
- * How reading a run log went: `found`, its `text` as it is now, less a UTF-8 character still being written at its end;
147
- * `not-found` when the run directory or the log doesn't exist; or a failure.
148
- */
149
- export type ReadRunLogResult = {
150
- readonly kind: "found";
151
- readonly path: string;
152
- readonly text: string;
153
- } | {
154
- readonly kind: "not-found";
155
- } | {
156
- readonly kind: "failed";
157
- readonly failure: RunDirectoryFailure;
158
- };
159
- /** How reading one run directory went: found, not found, or a failure. */
160
- export type ReadRunDirectoryResult = {
161
- readonly kind: "found";
162
- readonly directory: PastRunDirectory;
163
- } | {
164
- readonly kind: "not-found";
165
- } | {
166
- readonly kind: "failed";
167
- readonly failure: RunDirectoryFailure;
168
- };
169
- /**
170
- * The run directories: `${XDG_STATE_HOME:-~/.local/state}/storm/runs/<run id>/`, one for each recent run. A
171
- * run id is the run's start in UTC, `YYYYMMDDTHHMMSS`, a dash and a short random suffix, so runs started in the
172
- * same second from different worktrees don't collide.
173
- *
174
- * A run directory is active from when it is opened until it is closed, and completed after. One whose run ended
175
- * without closing it, its holder gone, is completed too: on the same host, once its process no longer runs; held on
176
- * another host, or with a marker that can't be read, 24 hours after.
177
- */
178
- export interface RunDirectoryGateway {
179
- /**
180
- * Makes a run directory for a run started at `startedAt`, active, holding `run` as its `run.json`, then removes
181
- * every completed run directory but the newest `keep`, and removes the private test event files a run that ended without
182
- * closing its run directory left in each completed one it keeps. Active run directories, this one among them, all
183
- * stay as they are.
184
- */
185
- open(request: {
186
- readonly startedAt: Date;
187
- readonly keep: number;
188
- readonly run: string;
189
- }): Promise<OpenRunDirectoryResult>;
190
- /**
191
- * Every run directory, newest first, with whether it is active at `now` and its `run.json`. A run directory whose
192
- * `run.json` can't be read is listed without it. No run directories yet is an empty list.
193
- */
194
- list(request: {
195
- readonly now: Date;
196
- }): Promise<ListRunDirectoriesResult>;
197
- /**
198
- * Run directory `id`, with whether it is active at `now`, its `run.json`, test events and timeline, and the run logs
199
- * it holds.
200
- */
201
- read(request: {
202
- readonly id: string;
203
- readonly now: Date;
204
- }): Promise<ReadRunDirectoryResult>;
205
- /** Run log `log` of run directory `id`, as it is now. */
206
- readLog(request: {
207
- readonly id: string;
208
- readonly log: RunLog;
209
- }): Promise<ReadRunLogResult>;
210
- }
211
44
  /**
212
45
  * The terminal a run's live view shows on, a DI seam: a live region pinned at the bottom of stderr, redrawn in
213
46
  * place, with text printed above it. Writes never throw; once one fails, as one does with EIO after SIGHUP closes
@@ -240,9 +73,44 @@ export type JobSummaryResult = {
240
73
  readonly kind: "none";
241
74
  } | {
242
75
  readonly kind: "failed";
243
- readonly failure: RunDirectoryFailure;
76
+ readonly failure: JobSummaryFailure;
244
77
  };
78
+ /** What appending to the job summary couldn't do: the path and what the OS said. */
79
+ export interface JobSummaryFailure {
80
+ readonly path: string;
81
+ readonly message: string;
82
+ }
245
83
  /** The GitHub Actions job summary a run appends its Markdown summary to. */
246
84
  export interface JobSummaryGateway {
247
85
  appendJobSummary(markdown: string): Promise<JobSummaryResult>;
248
86
  }
87
+ /** Where to look for a package's binary: in `node_modules/.bin` of `from` and of each directory above it, up to `root`. */
88
+ export interface FindPackageBinRequest {
89
+ /** The binary's name, such as `vitest` or `playwright`. */
90
+ readonly name: string;
91
+ /** The directory the binary runs in, an absolute path. */
92
+ readonly from: string;
93
+ /**
94
+ * The last directory to look in, an absolute path: the repository's root, or the filesystem's root outside a
95
+ * repository. When `from` isn't inside it, the search goes on up to the filesystem's root.
96
+ */
97
+ readonly root: string;
98
+ }
99
+ /**
100
+ * The binary found nearest `from`, as an absolute path to its `node_modules/.bin/<name>`; or, when no directory has
101
+ * one, every directory looked in, nearest first (`packageBinSearchDirectories`).
102
+ */
103
+ export type FindPackageBinResult = {
104
+ readonly ok: true;
105
+ readonly path: string;
106
+ } | {
107
+ readonly ok: false;
108
+ readonly searched: readonly string[];
109
+ };
110
+ /** The binaries packages install on this machine, in `node_modules/.bin`. */
111
+ export interface PackageBinGateway {
112
+ /**
113
+ * Finds the binary a package's scripts would run: the nearest `node_modules/.bin/<name>` from `from` up to `root`.
114
+ */
115
+ find(request: FindPackageBinRequest): Promise<FindPackageBinResult>;
116
+ }
@@ -1,20 +1,21 @@
1
1
  export { warningRows, warningTally } from "./reports.ts";
2
- export { bindLifecycles, type ResourceLifecycles, type ResourcesBeforeRun } from "./before-run.ts";
3
- export { cleanupInstanceSchema, type InstanceFacts, instanceSchema, type InstanceWarnings, resourceRegistry, } from "./resource-registry.ts";
4
- export { type ResourceReports, resourceReports } from "./resource-reports.ts";
2
+ export type { ResourceLifecycles, ResourcesBeforeRun } from "./before-run.ts";
3
+ export { type ResourceDefinitionSet, resourceDefinitionSet } from "./resource-definition-set.ts";
4
+ export { cleanupInstanceSchema, type InstanceFacts, instanceSchema, type InstanceWarnings, type ResourceReports, } from "./resource-reports.ts";
5
5
  export { resourcesOf } from "./resources-of.ts";
6
- export { launcherSupplies, worldsOf } from "./launcher-supplies.ts";
7
- export { type LaneKind, type PresentedInstance, type PresentedLane, type ResourcePresentations, resourcePresentations, } from "./presentations.ts";
8
- export { type CredentialEvent, type CredentialProgress, observeAll, type RunEvent, type RunObserver, type RunProgress, silentProgress, type TimedRunEvent, timedProgress, } from "./events.ts";
9
- export type { CommandGateway, CommandOutcome, CommandOutputChunk, CommandRequest, JobSummaryGateway, JobSummaryResult, ListedRunDirectory, ListRunDirectoriesResult, OpenRunDirectoryResult, PastRunDirectory, ProgressTerminal, ReadRunDirectoryResult, ReadRunLogResult, RunDirectory, RunDirectoryFailure, RunDirectoryGateway, RunDirectoryStep, RunLog, StagedTestEventsRead, } from "./gateways.ts";
6
+ export { driversOf, type DriverContextMap, driverContexts } from "./drivers-of.ts";
7
+ export { type SetupPhaseName, setupPhaseKey, setupPhaseWords } from "./setup-phases.ts";
8
+ export { launcherContext } from "./launcher-context.ts";
9
+ export type { LaneKind, PresentedInstance, PresentedLane, ResourcePresentations } from "./presentations.ts";
10
+ export { observeAll, type RunEvent, type RunObserver, type RunProgress, silentProgress, type TimedRunEvent, timedProgress, } from "./events.ts";
11
+ export type { CommandGateway, CommandOutcome, CommandOutputChunk, CommandRequest, FindPackageBinRequest, FindPackageBinResult, JobSummaryFailure, JobSummaryGateway, JobSummaryResult, PackageBinGateway, ProgressTerminal, } from "./gateways.ts";
10
12
  export { liveCommandGateway } from "./live/command-gateway.ts";
11
13
  export { liveJobSummaryGateway } from "./live/job-summary-gateway.ts";
12
14
  export { liveProgressTerminal } from "./live/progress-terminal.ts";
13
- export { liveRunDirectoryGateway, unavailableRunDirectoryGateway } from "./live/run-directory-gateway.ts";
14
- export type { CoreLane, RunInstance, ResourceAcquired, ResourceCleanupRecords, ResourceEvent, ResourceNoticeEvent, ResourceWarningEvent, ResourceOptions, ResourcePayloads, ResourceRanRecords, ResourceRefusal, ResourceInputs, ResourceRequest, ResourceRequests, ResourceSkip, ResourceWorlds, RunLane, } from "./resource.ts";
15
- export { ACTIVE_MARKER, COMMAND_LOG, EVENTS_FILE, RUN_DIRECTORIES_KEPT, RUN_LOGS, runLogFile, RUN_FILE, RUN_ID_PATTERN, runDirectoryObserver, runIdPrefix, RUNS_SUBPATH, stepLog, stepLogPath, TEST_EVENTS_STAGING_FILE, testEventsPath, TESTS_FILE, TESTS_PARTIAL_FILE, TIMELINE_FILE, } from "./run-directory.ts";
15
+ export { livePackageBinGateway } from "./live/package-bin-gateway.ts";
16
+ export type { CoreLane, RunInstance, ResourceAcquired, ResourceCleanupRecords, ResourceEvent, ResourceNoticeEvent, ResourceWarningEvent, ResourceOptions, ResourcePayloads, ResourceRanRecords, ResourceRefusal, ResourceInputs, ResourceRequest, ResourceRequests, ResourceSkip, ResourceContextMap, RunLane, } from "./resource.ts";
16
17
  export { executeRun, type UnsandboxedRunRequest, type RanRun, type RanRunner, type SandboxedRunRequest, type RunCleanup, type RunContext, type RunnerCleanupFacts, type RunControl, type RunOutcome, type RunRequest, type RunRunnerFailure, type RunRunnerRequest, type RunStopped, } from "./run.ts";
17
18
  export { resolveStateDirectory, stateDirectoryPattern } from "./state-directory.ts";
18
19
  export { commandExitStatus, megabytesText, type RanCommand, secondsOf, secondsText } from "./timing.ts";
19
- export { cleanupProblems, commandPassed, type CleanupState, type CommandState, applyRunEvent, EMPTY_RUN_STATE, RUNNER_STEPS, type RunnerSnapshotState, type RunnerState, type RunnerStepName, type RunnerStepState, type RunState, type TestsState, type TestWorkerState, } from "./run-state.ts";
20
- export { sameRow, timeline, type Timeline, type TimelineOutcome, type TimelineRow, type TimelineRowName, type TimelineRowRef, type TimelineSpan, type TimelineStep, type TimelineStepName, } from "./timeline.ts";
20
+ export { cleanupProblems, commandPassed, type CleanupState, type CommandState, EMPTY_RUN_STATE, RUNNER_STEPS, type RunnerSnapshotState, type RunnerState, type RunnerStepName, type RunnerStepState, type RunState, type TestsState, type TestWorkerState, } from "./run-state.ts";
21
+ export { sameRow, type Timeline, type TimelineOutcome, type TimelineRow, type TimelineRowName, type TimelineRowRef, type TimelineSpan, type TimelineStep, type TimelineStepName, } from "./timeline.ts";
@@ -1,22 +1,23 @@
1
- // The `core` module's caller-facing interface: what the composition layer runs a command with, over the registry's
2
- // resource definitions, with the types of its outcome and progress, and the words every resource's warnings show in.
1
+ // The `core` module's caller-facing interface: the resource definition set the composition layer builds from its
2
+ // resource definitions (`resourceDefinitionSet`), what it runs a command with over that definition set, with the types
3
+ // of its outcome and progress, the words every resource's warnings show in, and the extensions' drivers as one list,
4
+ // with their Contexts (`driversOf`, `driverContexts`).
3
5
  // The resource contract each extension folder implements, its definition, lifecycle and progress, is the extension
4
6
  // API's, which a caller imports from `sdk/extension/index.ts`. It names no resource.
5
7
  export { warningRows, warningTally } from "./reports.js";
6
- export { bindLifecycles } from "./before-run.js";
7
- export { cleanupInstanceSchema, instanceSchema, resourceRegistry, } from "./resource-registry.js";
8
- export { resourceReports } from "./resource-reports.js";
8
+ export { resourceDefinitionSet } from "./resource-definition-set.js";
9
+ export { cleanupInstanceSchema, instanceSchema, } from "./resource-reports.js";
9
10
  export { resourcesOf } from "./resources-of.js";
10
- export { launcherSupplies, worldsOf } from "./launcher-supplies.js";
11
- export { resourcePresentations, } from "./presentations.js";
11
+ export { driversOf, driverContexts } from "./drivers-of.js";
12
+ export { setupPhaseKey, setupPhaseWords } from "./setup-phases.js";
13
+ export { launcherContext } from "./launcher-context.js";
12
14
  export { observeAll, silentProgress, timedProgress, } from "./events.js";
13
15
  export { liveCommandGateway } from "./live/command-gateway.js";
14
16
  export { liveJobSummaryGateway } from "./live/job-summary-gateway.js";
15
17
  export { liveProgressTerminal } from "./live/progress-terminal.js";
16
- export { liveRunDirectoryGateway, unavailableRunDirectoryGateway } from "./live/run-directory-gateway.js";
17
- export { ACTIVE_MARKER, COMMAND_LOG, EVENTS_FILE, RUN_DIRECTORIES_KEPT, RUN_LOGS, runLogFile, RUN_FILE, RUN_ID_PATTERN, runDirectoryObserver, runIdPrefix, RUNS_SUBPATH, stepLog, stepLogPath, TEST_EVENTS_STAGING_FILE, testEventsPath, TESTS_FILE, TESTS_PARTIAL_FILE, TIMELINE_FILE, } from "./run-directory.js";
18
+ export { livePackageBinGateway } from "./live/package-bin-gateway.js";
18
19
  export { executeRun, } from "./run.js";
19
20
  export { resolveStateDirectory, stateDirectoryPattern } from "./state-directory.js";
20
21
  export { commandExitStatus, megabytesText, secondsOf, secondsText } from "./timing.js";
21
- export { cleanupProblems, commandPassed, applyRunEvent, EMPTY_RUN_STATE, RUNNER_STEPS, } from "./run-state.js";
22
- export { sameRow, timeline, } from "./timeline.js";
22
+ export { cleanupProblems, commandPassed, EMPTY_RUN_STATE, RUNNER_STEPS, } from "./run-state.js";
23
+ export { sameRow, } from "./timeline.js";
@@ -0,0 +1,11 @@
1
+ import type { LauncherContext, ResourceDefinition } from "../sdk/extension/index.ts";
2
+ /**
3
+ * What the launcher gives definition `name` to build its Context from, over the launcher environment `env`, the
4
+ * system clock and timer.
5
+ */
6
+ export declare function launcherContext(env: Readonly<Record<string, string | undefined>>, name: string): LauncherContext;
7
+ /**
8
+ * Every definition's Context, by its name, each built from what the launcher gives it over `env`. `resources` lists
9
+ * every definition once, as the definition set's list does.
10
+ */
11
+ export declare function resourceContexts(resources: readonly Pick<ResourceDefinition, "name" | "context">[], env: Readonly<Record<string, string | undefined>>): Readonly<Record<string, unknown>>;
@@ -0,0 +1,31 @@
1
+ // What the launcher gives a resource definition to build its Context from (`launcherContext`, of the extension API's
2
+ // `LauncherContext`), and every definition's Context, built from that (`resourceContexts`, which the resource
3
+ // definition set's `contexts` calls). A resource's `defineResource` names how it builds its Context (`context`). It is
4
+ // not `StormContext`, which holds what storm's own commands reach the outside through: the launcher builds a
5
+ // `LauncherContext` for one resource definition, from the process environment and the system clock and timer. It
6
+ // names no resource.
7
+ import { systemClock, systemTimer } from "../time/index.js";
8
+ import { resolveStateDirectory, stateDirectoryPattern } from "./state-directory.js";
9
+ /**
10
+ * What the launcher gives definition `name` to build its Context from, over the launcher environment `env`, the
11
+ * system clock and timer.
12
+ */
13
+ export function launcherContext(env, name) {
14
+ const subpath = [name];
15
+ const resolved = resolveStateDirectory(env, subpath);
16
+ return {
17
+ env,
18
+ stateDirectory: resolved.ok
19
+ ? resolved
20
+ : { ok: false, reason: resolved.reason, pattern: stateDirectoryPattern(subpath) },
21
+ clock: systemClock,
22
+ timer: systemTimer,
23
+ };
24
+ }
25
+ /**
26
+ * Every definition's Context, by its name, each built from what the launcher gives it over `env`. `resources` lists
27
+ * every definition once, as the definition set's list does.
28
+ */
29
+ export function resourceContexts(resources, env) {
30
+ return Object.fromEntries(resources.map(({ name, context }) => [name, context(launcherContext(env, name))]));
31
+ }
@@ -0,0 +1,6 @@
1
+ import type { PackageBinGateway } from "../gateways.ts";
2
+ /**
3
+ * The live package binary gateway: `find` answers the first `node_modules/.bin/<name>` this process may execute
4
+ * (`access` with `X_OK`), in `packageBinSearchDirectories` order.
5
+ */
6
+ export declare const livePackageBinGateway: PackageBinGateway;
@@ -0,0 +1,24 @@
1
+ // Finding a package's binary on this machine: the first `node_modules/.bin/<name>` this process may execute.
2
+ import { constants } from "node:fs";
3
+ import { access } from "node:fs/promises";
4
+ import { packageBinPath, packageBinSearchDirectories } from "../package-bin.js";
5
+ /**
6
+ * The live package binary gateway: `find` answers the first `node_modules/.bin/<name>` this process may execute
7
+ * (`access` with `X_OK`), in `packageBinSearchDirectories` order.
8
+ */
9
+ export const livePackageBinGateway = {
10
+ async find({ name, from, root }) {
11
+ const searched = packageBinSearchDirectories(from, root);
12
+ for (const directory of searched) {
13
+ const path = packageBinPath(directory, name);
14
+ try {
15
+ await access(path, constants.X_OK);
16
+ return { ok: true, path };
17
+ }
18
+ catch {
19
+ // Not there, or not executable: look further up.
20
+ }
21
+ }
22
+ return { ok: false, searched };
23
+ },
24
+ };
@@ -0,0 +1,7 @@
1
+ /** Where the binary `name` sits under `directory`: its `node_modules/.bin/<name>`. */
2
+ export declare function packageBinPath(directory: string, name: string): string;
3
+ /**
4
+ * The directories whose `node_modules/.bin` may hold a package's binary, nearest first: `from`, then each directory
5
+ * above it, up to and including `root`. When `from` isn't `root` or inside it, up to the filesystem's root.
6
+ */
7
+ export declare function packageBinSearchDirectories(from: string, root: string): readonly string[];
@@ -0,0 +1,30 @@
1
+ // Where to look for a package's binary, such as `vitest` or `playwright`, in `node_modules/.bin`. Pure, so the live
2
+ // package binary gateway and its fake look in the same directories.
3
+ import { dirname, isAbsolute, join, relative } from "node:path";
4
+ /** Where the binary `name` sits under `directory`: its `node_modules/.bin/<name>`. */
5
+ export function packageBinPath(directory, name) {
6
+ return join(directory, "node_modules", ".bin", name);
7
+ }
8
+ /**
9
+ * The directories whose `node_modules/.bin` may hold a package's binary, nearest first: `from`, then each directory
10
+ * above it, up to and including `root`. When `from` isn't `root` or inside it, up to the filesystem's root.
11
+ */
12
+ export function packageBinSearchDirectories(from, root) {
13
+ const inside = from === root || isInside(root, from);
14
+ const directories = [];
15
+ let directory = from;
16
+ for (;;) {
17
+ directories.push(directory);
18
+ if (inside && directory === root)
19
+ return directories;
20
+ const parent = dirname(directory);
21
+ if (parent === directory)
22
+ return directories;
23
+ directory = parent;
24
+ }
25
+ }
26
+ /** Whether `path` is inside `directory`, below it. */
27
+ function isInside(directory, path) {
28
+ const between = relative(directory, path);
29
+ return between !== "" && !between.startsWith("..") && !isAbsolute(between);
30
+ }
@@ -1,4 +1,5 @@
1
- import type { LaneDraw, LaneStates, ResourceDefinition, ResourceNotice, Span } from "../sdk/extension/index.ts";
1
+ import type { LaneDraw, LaneStates, ResourceNotice, Span } from "../sdk/extension/index.ts";
2
+ import type { DefinitionLookup } from "./definition-lookup.ts";
2
3
  import type { ResourceEvent } from "./resource.ts";
3
4
  /**
4
5
  * One resource instance's lane as the views draw it, bound to its resource key: each operation reads the lane's state
@@ -38,7 +39,7 @@ export interface PresentedInstance {
38
39
  *
39
40
  * - `plain`: plain progress for one run: the lines of an instance's own progress event, given when it happened.
40
41
  * - `notices`: the live view's notices for an instance's own progress event.
41
- * - `laneKinds`: the lane of each definition with its own progress, in registry order, as the views name it.
42
+ * - `laneKinds`: the lane of each definition with its own progress, in definition order, as the views name it.
42
43
  * - `lanes`: the lane of each of `instances` whose definition has its own progress, in their order, as the views draw
43
44
  * it.
44
45
  */
@@ -52,5 +53,5 @@ export interface ResourcePresentations {
52
53
  readonly laneKinds: readonly LaneKind[];
53
54
  lanes(instances: readonly PresentedInstance[]): readonly PresentedLane[];
54
55
  }
55
- /** Every one of `resources`' presentations, each instance's from its definition. */
56
- export declare function resourcePresentations(resources: readonly ResourceDefinition[]): ResourcePresentations;
56
+ /** Every one of `lookup`'s definitions' presentations, each instance's from its definition. */
57
+ export declare function resourcePresentations(lookup: DefinitionLookup): ResourcePresentations;
@@ -1,17 +1,17 @@
1
- // How a run's views (`exec`'s and `vitest`'s) ask every resource instance how it shows: each function below hands each
2
- // resource instance to its definition, whose progress reads the run's maps by the resource key. It hands each
3
- // progress's `plain` the launcher's `seconds` formatter. A resource without progress reports its lines itself
4
- // (`resource-notice`), which the views print as they are, and every resource its warnings (`resource-warning`), which
5
- // they mark as warnings.
6
- import { resourceRegistry } from "./resource-registry.js";
1
+ // How a run's views (`exec`'s, `vitest`'s and `playwright`'s) ask every resource instance how it shows: each function
2
+ // below hands each resource instance to its definition, whose progress reads the run's maps by the resource key. It
3
+ // hands each progress's `plain` the launcher's `seconds` formatter. A resource without progress reports its lines
4
+ // itself (`resource-notice`), which the views print as they are, and every resource its warnings (`resource-warning`),
5
+ // which they mark as warnings. The resource definition set builds the presentations once (`resourceDefinitionSet`,
6
+ // `resource-definition-set.ts`).
7
7
  import { secondsOf, secondsText } from "./timing.js";
8
8
  /** `ms` as progress shows it: seconds to one decimal and `s`, the formatter each presentation's `plain` gets. */
9
9
  function seconds(ms) {
10
10
  return secondsText(secondsOf(ms));
11
11
  }
12
- /** Every one of `resources`' presentations, each instance's from its definition. */
13
- export function resourcePresentations(resources) {
14
- const { named } = resourceRegistry(resources);
12
+ /** Every one of `lookup`'s definitions' presentations, each instance's from its definition. */
13
+ export function resourcePresentations(lookup) {
14
+ const { definitions: resources, named } = lookup;
15
15
  return {
16
16
  plain: (options) => {
17
17
  // Each resource's plain progress, made once for the run, since it may remember earlier events.
@@ -0,0 +1,39 @@
1
+ import type { ResourceDefinition } from "../sdk/extension/index.ts";
2
+ import { type ResourceLifecycles } from "./before-run.ts";
3
+ import { type DefinitionLookup } from "./definition-lookup.ts";
4
+ import type { TimedRunEvent } from "./events.ts";
5
+ import { type ResourcePresentations } from "./presentations.ts";
6
+ import type { ResourceContextMap } from "./resource.ts";
7
+ import { type ResourceReports } from "./resource-reports.ts";
8
+ import { type RunState } from "./run-state.ts";
9
+ import { type Timeline } from "./timeline.ts";
10
+ /** Where the definition set keeps its lookup, which only the core reads. */
11
+ export declare const LOOKUP: unique symbol;
12
+ /**
13
+ * Resource definitions, in definition order, and everything the launcher derives from them, in that order.
14
+ *
15
+ * - `definitions`: the definitions, in definition order.
16
+ * - `reports`: every definition's reports, for each resource instance a run's maps hold.
17
+ * - `presentations`: how every definition's instances show in a run's progress.
18
+ * - `applyEvent`: the run's state after `timed`, through the definitions' progress. A run's final state is
19
+ * `events.reduce(definitionSet.applyEvent, EMPTY_RUN_STATE)`. An event of a definition the definition set lacks
20
+ * reaches no lane.
21
+ * - `timeline`: a run's waterfall, from its final state, with each resource lane's row.
22
+ * - `lifecycles`: every definition's lifecycle, over its Context from `contexts`, by its name: what a run calls before
23
+ * it starts. Each call builds each definition's lifecycle once.
24
+ * - `contexts`: every definition's Context, by its name, each built from what the launcher gives it over `env`, with
25
+ * its own state directory.
26
+ */
27
+ export interface ResourceDefinitionSet {
28
+ readonly definitions: readonly ResourceDefinition[];
29
+ readonly reports: ResourceReports;
30
+ readonly presentations: ResourcePresentations;
31
+ readonly applyEvent: (state: RunState, timed: TimedRunEvent) => RunState;
32
+ readonly timeline: (state: RunState) => Timeline;
33
+ readonly lifecycles: (contexts: ResourceContextMap) => ResourceLifecycles;
34
+ readonly contexts: (env: Readonly<Record<string, string | undefined>>) => ResourceContextMap;
35
+ /** The lookup of a definition by its name, which `executeRun` binds each resource instance with. */
36
+ readonly [LOOKUP]: DefinitionLookup;
37
+ }
38
+ /** The definition set of `definitions`, in their order, each looked up by its name. */
39
+ export declare function resourceDefinitionSet(definitions: readonly ResourceDefinition[]): ResourceDefinitionSet;
@@ -0,0 +1,31 @@
1
+ // The resource definition set: the one value the core builds from a list of resource definitions, in definition order
2
+ // (`resourceDefinitionSet`), which the composition layer builds once (`src/extensions.ts`) and every caller shares. It
3
+ // holds the definitions, their reports (`resource-reports.ts`) and their presentations (`presentations.ts`), the run's
4
+ // state and waterfall through their progress (`run-state.ts`, `timeline.ts`), their lifecycles over given Contexts
5
+ // (`before-run.ts`), and their Contexts built from a launcher environment (`launcher-context.ts`). It builds the lookup
6
+ // of a definition by its name once (`definition-lookup.ts`) and hands it to what it builds; the lookup stays the
7
+ // core's: `executeRun` reads it from the definition set under `LOOKUP`, which `index.ts` doesn't export. It names no
8
+ // resource.
9
+ import { bindLifecycles } from "./before-run.js";
10
+ import { definitionLookup } from "./definition-lookup.js";
11
+ import { resourceContexts } from "./launcher-context.js";
12
+ import { resourcePresentations } from "./presentations.js";
13
+ import { resourceReports } from "./resource-reports.js";
14
+ import { applyRunEvent } from "./run-state.js";
15
+ import { timeline } from "./timeline.js";
16
+ /** Where the definition set keeps its lookup, which only the core reads. */
17
+ export const LOOKUP = Symbol("definition lookup");
18
+ /** The definition set of `definitions`, in their order, each looked up by its name. */
19
+ export function resourceDefinitionSet(definitions) {
20
+ const lookup = definitionLookup(definitions);
21
+ return {
22
+ definitions,
23
+ reports: resourceReports(lookup),
24
+ presentations: resourcePresentations(lookup),
25
+ applyEvent: (state, timed) => applyRunEvent(definitions, state, timed),
26
+ timeline: (state) => timeline(definitions, state),
27
+ lifecycles: (contexts) => bindLifecycles(lookup, contexts),
28
+ contexts: (env) => resourceContexts(definitions, env),
29
+ [LOOKUP]: lookup,
30
+ };
31
+ }