@cnc-tools/storm 0.11.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 (444) hide show
  1. package/dist/bin/storm.js +7 -12
  2. package/dist/build-info.js +1 -1
  3. package/dist/chunks/{chunk-3ZZVZPMG.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-ETCZ6WP7.js → chunk-BW2ADH7U.js} +1 -1
  7. package/dist/chunks/chunk-FK4RLDEK.js +40 -0
  8. package/dist/chunks/{chunk-KR7WIYLG.js → chunk-FSP3SJ35.js} +209 -964
  9. package/dist/chunks/chunk-GQIL3AHY.js +20 -0
  10. package/dist/chunks/{chunk-ICB4BZJX.js → chunk-GSC6SRTW.js} +7 -2
  11. package/dist/chunks/{chunk-NPPJ57W7.js → chunk-ISGQJIQM.js} +498 -215
  12. package/dist/chunks/{chunk-OJOKQRM6.js → chunk-IYM44FUX.js} +30 -26
  13. package/dist/chunks/{chunk-GRMD7G4J.js → chunk-LQKNI3EG.js} +6 -5
  14. package/dist/chunks/chunk-NMVODY3P.js +19 -0
  15. package/dist/chunks/{chunk-O4BUT7BE.js → chunk-ODQHQJLE.js} +3063 -2646
  16. package/dist/chunks/chunk-RYRJNHL7.js +55 -0
  17. package/dist/chunks/chunk-SXW6XN4R.js +161 -0
  18. package/dist/chunks/{chunk-L4ZPMSKQ.js → chunk-T6AZIDZD.js} +43 -363
  19. package/dist/chunks/chunk-TEEZL3GA.js +851 -0
  20. package/dist/chunks/{chunk-VZZTHCBW.js → chunk-TMQQYHUX.js} +5 -18
  21. package/dist/chunks/{chunk-TRFEAYNC.js → chunk-U7M3ZB3Z.js} +345 -304
  22. package/dist/chunks/{chunk-4EU4AH7E.js → chunk-Y3BUNNRG.js} +186 -144
  23. package/dist/chunks/{chunk-4PRAB24Y.js → chunk-YM6TZV4L.js} +394 -396
  24. package/dist/chunks/{chunk-AMTYHUYB.js → chunk-YT5OROR7.js} +22 -8
  25. package/dist/chunks/{live-app-LOGYUBKB.js → live-app-AZ5N5HBD.js} +25 -46
  26. package/dist/command-tree.d.ts +4 -1
  27. package/dist/command-tree.js +4 -1
  28. package/dist/commands/exec/cleanup.js +4 -4
  29. package/dist/commands/exec/command.d.ts +54 -15
  30. package/dist/commands/exec/command.js +51 -46
  31. package/dist/commands/exec/define-run-command.d.ts +752 -0
  32. package/dist/commands/exec/define-run-command.js +58 -0
  33. package/dist/commands/exec/driver-plan.d.ts +30 -0
  34. package/dist/commands/exec/driver-plan.js +44 -0
  35. package/dist/commands/exec/driver-refusals.d.ts +89 -0
  36. package/dist/commands/exec/driver-refusals.js +65 -0
  37. package/dist/commands/exec/exec-words.d.ts +5 -0
  38. package/dist/commands/exec/exec-words.js +31 -0
  39. package/dist/commands/exec/live-view.js +58 -28
  40. package/dist/commands/exec/mint-failed.js +4 -4
  41. package/dist/commands/exec/outcomes.d.ts +70 -8
  42. package/dist/commands/exec/outcomes.js +37 -8
  43. package/dist/commands/exec/plan-run.js +3 -3
  44. package/dist/commands/exec/progress.d.ts +35 -15
  45. package/dist/commands/exec/progress.js +82 -57
  46. package/dist/commands/exec/resource-flags.d.ts +10 -3
  47. package/dist/commands/exec/resource-flags.js +25 -14
  48. package/dist/commands/exec/resource-refusals.d.ts +1 -1
  49. package/dist/commands/exec/resource-refusals.js +9 -9
  50. package/dist/commands/exec/run-bin.d.ts +35 -0
  51. package/dist/commands/exec/run-bin.js +32 -0
  52. package/dist/commands/exec/run-command.d.ts +84 -24
  53. package/dist/commands/exec/run-command.js +84 -69
  54. package/dist/commands/exec/run-metadata.d.ts +29 -17
  55. package/dist/commands/exec/run-metadata.js +38 -16
  56. package/dist/commands/exec/snapshot-text.d.ts +40 -0
  57. package/dist/commands/exec/snapshot-text.js +112 -0
  58. package/dist/commands/exec/test-plan.d.ts +2 -2
  59. package/dist/commands/exec/test-plan.js +11 -8
  60. package/dist/commands/exec/tests-summary.d.ts +21 -12
  61. package/dist/commands/exec/tests-summary.js +67 -39
  62. package/dist/commands/exec/text.d.ts +5 -0
  63. package/dist/commands/exec/text.js +7 -0
  64. package/dist/commands/exec/view.js +22 -13
  65. package/dist/commands/exec/waterfall.js +4 -4
  66. package/dist/commands/exec/worker-chart.d.ts +19 -11
  67. package/dist/commands/exec/worker-chart.js +66 -36
  68. package/dist/commands/playwright/command.d.ts +746 -0
  69. package/dist/commands/playwright/command.js +31 -0
  70. package/dist/commands/playwright/metadata.js +8 -0
  71. package/dist/commands/runs/facts.d.ts +21 -8
  72. package/dist/commands/runs/facts.js +19 -9
  73. package/dist/commands/runs/list/command.d.ts +34 -8
  74. package/dist/commands/runs/list/command.js +15 -11
  75. package/dist/commands/runs/list/outcomes.d.ts +17 -4
  76. package/dist/commands/runs/logs/command.js +13 -9
  77. package/dist/commands/runs/logs/outcomes.js +1 -1
  78. package/dist/commands/runs/show/command.d.ts +36 -8
  79. package/dist/commands/runs/show/command.js +48 -31
  80. package/dist/commands/runs/show/metadata.js +1 -1
  81. package/dist/commands/runs/show/outcomes.d.ts +18 -4
  82. package/dist/commands/runs/show/outcomes.js +35 -14
  83. package/dist/commands/snapshots/build/command.d.ts +898 -0
  84. package/dist/commands/snapshots/build/command.js +511 -0
  85. package/dist/commands/snapshots/build/metadata.d.ts +28 -0
  86. package/dist/commands/snapshots/build/metadata.js +34 -0
  87. package/dist/commands/snapshots/build/outcomes.d.ts +484 -0
  88. package/dist/commands/snapshots/build/outcomes.js +322 -0
  89. package/dist/commands/snapshots/list/command.d.ts +272 -0
  90. package/dist/commands/snapshots/list/command.js +305 -0
  91. package/dist/commands/snapshots/list/metadata.d.ts +16 -0
  92. package/dist/commands/snapshots/list/metadata.js +24 -0
  93. package/dist/commands/snapshots/list/outcomes.d.ts +183 -0
  94. package/dist/commands/snapshots/list/outcomes.js +257 -0
  95. package/dist/commands/snapshots/metadata.d.ts +3 -0
  96. package/dist/commands/snapshots/metadata.js +7 -0
  97. package/dist/commands/vitest/command.d.ts +267 -298
  98. package/dist/commands/vitest/command.js +23 -181
  99. package/dist/commands/vitest/metadata.js +1 -1
  100. package/dist/config-file/define.d.ts +1 -1
  101. package/dist/context.d.ts +32 -30
  102. package/dist/context.js +13 -17
  103. package/dist/core/before-run.d.ts +5 -5
  104. package/dist/core/before-run.js +8 -8
  105. package/dist/core/definition-lookup.d.ts +5 -5
  106. package/dist/core/definition-lookup.js +13 -12
  107. package/dist/core/drivers-of.d.ts +23 -0
  108. package/dist/core/drivers-of.js +13 -0
  109. package/dist/core/events.d.ts +2 -4
  110. package/dist/core/gateways.d.ts +32 -24
  111. package/dist/core/index.d.ts +7 -5
  112. package/dist/core/index.js +9 -6
  113. package/dist/core/launcher-context.d.ts +11 -0
  114. package/dist/core/launcher-context.js +31 -0
  115. package/dist/core/live/package-bin-gateway.d.ts +6 -0
  116. package/dist/core/live/package-bin-gateway.js +24 -0
  117. package/dist/core/package-bin.d.ts +7 -0
  118. package/dist/core/package-bin.js +30 -0
  119. package/dist/core/presentations.d.ts +1 -1
  120. package/dist/core/presentations.js +6 -5
  121. package/dist/core/{resource-registry.d.ts → resource-definition-set.d.ts} +15 -14
  122. package/dist/core/resource-definition-set.js +31 -0
  123. package/dist/core/resource-reports.d.ts +1 -1
  124. package/dist/core/resource-reports.js +16 -15
  125. package/dist/core/resource.d.ts +4 -4
  126. package/dist/core/resources.d.ts +6 -6
  127. package/dist/core/resources.js +11 -11
  128. package/dist/core/run-state.d.ts +27 -16
  129. package/dist/core/run-state.js +50 -18
  130. package/dist/core/run.d.ts +33 -27
  131. package/dist/core/run.js +24 -19
  132. package/dist/core/setup-phases.d.ts +14 -0
  133. package/dist/core/setup-phases.js +24 -0
  134. package/dist/core/state-directory.d.ts +2 -2
  135. package/dist/core/state-directory.js +3 -3
  136. package/dist/core/timeline.d.ts +4 -2
  137. package/dist/core/timeline.js +11 -5
  138. package/dist/extension-commands.js +6 -10
  139. package/dist/extensions/github/{world.d.ts → context.d.ts} +1 -1
  140. package/dist/extensions/github/context.js +3 -0
  141. package/dist/extensions/github/definition.d.ts +1 -1
  142. package/dist/extensions/github/definition.js +3 -3
  143. package/dist/extensions/github/extension.d.ts +1 -1
  144. package/dist/extensions/github/index.d.ts +2 -2
  145. package/dist/extensions/github/index.js +4 -4
  146. package/dist/extensions/github/lifecycle.d.ts +3 -3
  147. package/dist/extensions/github/lifecycle.js +14 -14
  148. package/dist/extensions/github/live/context.d.ts +6 -0
  149. package/dist/extensions/github/live/context.js +16 -0
  150. package/dist/extensions/github/resource.d.ts +1 -1
  151. package/dist/extensions/playwright/driver.d.ts +8 -0
  152. package/dist/extensions/playwright/driver.js +60 -0
  153. package/dist/extensions/playwright/extension.d.ts +2 -0
  154. package/dist/extensions/playwright/extension.js +12 -0
  155. package/dist/extensions/playwright/plan/gateways.d.ts +62 -0
  156. package/dist/extensions/playwright/plan/gateways.js +4 -0
  157. package/dist/extensions/playwright/plan/list-output.d.ts +26 -0
  158. package/dist/extensions/playwright/plan/list-output.js +101 -0
  159. package/dist/extensions/playwright/plan/live/list-gateway.d.ts +15 -0
  160. package/dist/extensions/playwright/plan/live/list-gateway.js +100 -0
  161. package/dist/extensions/playwright/plan/plan.d.ts +44 -0
  162. package/dist/extensions/playwright/plan/plan.js +53 -0
  163. package/dist/extensions/testserver/command-tree.d.ts +1 -1
  164. package/dist/extensions/testserver/command-tree.js +2 -2
  165. package/dist/extensions/testserver/commands/app.d.ts +7 -7
  166. package/dist/extensions/testserver/commands/pool/create/command.d.ts +5 -5
  167. package/dist/extensions/testserver/commands/pool/create/command.js +12 -13
  168. package/dist/extensions/testserver/commands/pool/list/command.js +5 -6
  169. package/dist/extensions/testserver/{world.d.ts → context.d.ts} +1 -1
  170. package/dist/extensions/testserver/context.js +4 -0
  171. package/dist/extensions/testserver/definition.d.ts +2 -2
  172. package/dist/extensions/testserver/definition.js +8 -7
  173. package/dist/extensions/testserver/events.d.ts +1 -1
  174. package/dist/extensions/testserver/extension.d.ts +4 -3
  175. package/dist/extensions/testserver/extension.js +33 -20
  176. package/dist/extensions/testserver/index.d.ts +2 -2
  177. package/dist/extensions/testserver/index.js +2 -2
  178. package/dist/extensions/testserver/lifecycle.d.ts +6 -5
  179. package/dist/extensions/testserver/lifecycle.js +9 -8
  180. package/dist/extensions/testserver/live/context.d.ts +8 -0
  181. package/dist/extensions/testserver/live/{world.js → context.js} +6 -7
  182. package/dist/extensions/testserver/options/rules.d.ts +3 -3
  183. package/dist/extensions/testserver/options/rules.js +5 -4
  184. package/dist/extensions/testserver/options/sandboxes.d.ts +3 -2
  185. package/dist/extensions/testserver/options/sandboxes.js +3 -2
  186. package/dist/extensions/testserver/playwright/index.d.ts +33 -0
  187. package/dist/extensions/testserver/playwright/index.js +43 -0
  188. package/dist/extensions/testserver/presentation.d.ts +4 -4
  189. package/dist/extensions/testserver/presentation.js +7 -7
  190. package/dist/extensions/testserver/progress.d.ts +3 -3
  191. package/dist/extensions/testserver/progress.js +3 -3
  192. package/dist/extensions/testserver/provision.d.ts +2 -2
  193. package/dist/extensions/testserver/provision.js +10 -10
  194. package/dist/extensions/testserver/resource.d.ts +2 -2
  195. package/dist/extensions/testserver/result.d.ts +2 -2
  196. package/dist/extensions/testserver/result.js +1 -1
  197. package/dist/extensions/testserver/run/connection.d.ts +1 -1
  198. package/dist/extensions/testserver/run/connection.js +3 -3
  199. package/dist/extensions/testserver/run/sandbox.d.ts +31 -0
  200. package/dist/extensions/testserver/run/sandbox.js +58 -0
  201. package/dist/extensions/testserver/run-sandbox.d.ts +2 -2
  202. package/dist/extensions/testserver/run-sandbox.js +3 -3
  203. package/dist/extensions/testserver/vercel-cli/arguments.d.ts +2 -2
  204. package/dist/extensions/testserver/vercel-cli/arguments.js +6 -6
  205. package/dist/extensions/testserver/vercel-cli/auth-config.d.ts +7 -7
  206. package/dist/extensions/testserver/vercel-cli/auth-config.js +4 -4
  207. package/dist/extensions/testserver/vercel-cli/clock.js +1 -1
  208. package/dist/extensions/testserver/vercel-cli/config-files.js +1 -1
  209. package/dist/extensions/testserver/vercel-cli/context.d.ts +1 -1
  210. package/dist/extensions/testserver/vercel-cli/context.js +2 -2
  211. package/dist/extensions/testserver/vercel-cli/entry.d.ts +1 -1
  212. package/dist/extensions/testserver/vercel-cli/entry.js +1 -1
  213. package/dist/extensions/testserver/vercel-cli/environment.d.ts +5 -5
  214. package/dist/extensions/testserver/vercel-cli/environment.js +6 -6
  215. package/dist/extensions/testserver/vercel-cli/gateways.d.ts +1 -1
  216. package/dist/extensions/testserver/vercel-cli/gateways.js +3 -3
  217. package/dist/extensions/testserver/vercel-cli/index.d.ts +1 -1
  218. package/dist/extensions/testserver/vercel-cli/index.js +8 -9
  219. package/dist/extensions/testserver/vercel-cli/invocation.d.ts +13 -12
  220. package/dist/extensions/testserver/vercel-cli/invocation.js +1 -1
  221. package/dist/extensions/testserver/vercel-cli/{driver.d.ts → invoker.d.ts} +18 -17
  222. package/dist/extensions/testserver/vercel-cli/{driver.js → invoker.js} +8 -8
  223. package/dist/extensions/testserver/vercel-cli/live/config-files.d.ts +2 -2
  224. package/dist/extensions/testserver/vercel-cli/live/config-files.js +2 -2
  225. package/dist/extensions/testserver/vercel-cli/live/process-gateway.js +1 -1
  226. package/dist/extensions/testserver/vercel-cli/report.js +2 -2
  227. package/dist/extensions/testserver/vercel-cli/verbose.js +1 -1
  228. package/dist/extensions/testserver/vitest/config.d.ts +3 -3
  229. package/dist/extensions/testserver/vitest/config.js +5 -13
  230. package/dist/extensions/testserver/vitest/container-scope.d.ts +11 -11
  231. package/dist/extensions/testserver/vitest/container-scope.js +9 -9
  232. package/dist/extensions/testserver/vitest/container-start.d.ts +6 -6
  233. package/dist/extensions/testserver/vitest/container-start.js +14 -11
  234. package/dist/extensions/testserver/vitest/diagnostics.d.ts +1 -1
  235. package/dist/extensions/testserver/vitest/fixtures.d.ts +11 -11
  236. package/dist/extensions/testserver/vitest/fixtures.js +14 -23
  237. package/dist/extensions/testserver/vitest/index.d.ts +1 -1
  238. package/dist/extensions/testserver/vitest/index.js +4 -4
  239. package/dist/extensions/testserver/vitest/types.d.ts +16 -18
  240. package/dist/extensions/testserver/vitest/types.js +2 -2
  241. package/dist/extensions/testserver/vitest/worker-sandbox.d.ts +8 -0
  242. package/dist/extensions/testserver/vitest/worker-sandbox.js +17 -0
  243. package/dist/extensions/vitest/driver.d.ts +8 -0
  244. package/dist/extensions/vitest/driver.js +62 -0
  245. package/dist/extensions/vitest/extension.d.ts +2 -0
  246. package/dist/extensions/vitest/extension.js +8 -0
  247. package/dist/{vitest → extensions/vitest/plan}/gateways.d.ts +1 -26
  248. package/dist/extensions/vitest/plan/gateways.js +3 -0
  249. package/dist/{vitest → extensions/vitest/plan}/live/list-gateway.d.ts +1 -2
  250. package/dist/{vitest → extensions/vitest/plan}/live/list-gateway.js +1 -20
  251. package/dist/extensions/vitest/plan/plan-over.d.ts +38 -0
  252. package/dist/extensions/vitest/plan/plan-over.js +31 -0
  253. package/dist/extensions/vitest/plan/plan.d.ts +24 -0
  254. package/dist/{vitest → extensions/vitest/plan}/plan.js +11 -26
  255. package/dist/extensions.d.ts +40 -18
  256. package/dist/extensions.js +49 -22
  257. package/dist/forward-sigterm.js +1 -1
  258. package/dist/launcher-resolvers/index.d.ts +1 -1
  259. package/dist/launcher-resolvers/local-services.d.ts +9 -44
  260. package/dist/launcher-resolvers/local-services.js +4 -5
  261. package/dist/live-app.js +7 -6
  262. package/dist/local-services.d.ts +7 -15
  263. package/dist/local-services.js +8 -29
  264. package/dist/playwright/index.d.ts +1 -0
  265. package/dist/playwright/index.js +4 -0
  266. package/dist/playwright/reporter.d.ts +96 -0
  267. package/dist/playwright/reporter.js +162 -0
  268. package/dist/playwright/worker-index.d.ts +7 -0
  269. package/dist/playwright/worker-index.js +20 -0
  270. package/dist/run-directory/index.d.ts +1 -1
  271. package/dist/run-directory/index.js +3 -3
  272. package/dist/run-directory/plan.d.ts +3 -3
  273. package/dist/run-directory/plan.js +5 -5
  274. package/dist/run-directory/reader.js +2 -2
  275. package/dist/run-directory/recording.d.ts +8 -5
  276. package/dist/run-directory/recording.js +5 -5
  277. package/dist/run-directory/run-collector.d.ts +5 -5
  278. package/dist/run-directory/run-collector.js +5 -5
  279. package/dist/run-directory/run-record.d.ts +69 -24
  280. package/dist/run-directory/run-record.js +39 -19
  281. package/dist/run-directory/timeline-facts.d.ts +2 -1
  282. package/dist/run-directory/timeline-facts.js +4 -2
  283. package/dist/runner/build-snapshots.d.ts +179 -0
  284. package/dist/runner/build-snapshots.js +235 -0
  285. package/dist/runner/context.js +2 -1
  286. package/dist/runner/events.d.ts +71 -32
  287. package/dist/runner/gateways.d.ts +30 -10
  288. package/dist/runner/index.d.ts +8 -6
  289. package/dist/runner/index.js +5 -3
  290. package/dist/runner/live/checkout-gateway.js +15 -7
  291. package/dist/runner/live/snapshot-records.js +8 -7
  292. package/dist/runner/prepare.d.ts +24 -46
  293. package/dist/runner/prepare.js +27 -20
  294. package/dist/runner/ready.d.ts +43 -10
  295. package/dist/runner/ready.js +51 -34
  296. package/dist/runner/recipe.d.ts +42 -12
  297. package/dist/runner/recipe.js +36 -7
  298. package/dist/runner/scope.d.ts +5 -12
  299. package/dist/runner/scope.js +0 -4
  300. package/dist/runner/secrets.d.ts +6 -0
  301. package/dist/runner/secrets.js +10 -0
  302. package/dist/runner/session.d.ts +46 -18
  303. package/dist/runner/session.js +58 -29
  304. package/dist/runner/snapshot-build.d.ts +21 -11
  305. package/dist/runner/snapshot-build.js +11 -16
  306. package/dist/runner/snapshot-cache.d.ts +140 -62
  307. package/dist/runner/snapshot-cache.js +145 -102
  308. package/dist/runner/snapshot-inspect.d.ts +89 -0
  309. package/dist/runner/snapshot-inspect.js +173 -0
  310. package/dist/runner/snapshot-key.d.ts +5 -2
  311. package/dist/runner/snapshot-key.js +1 -1
  312. package/dist/runner/snapshot-save.d.ts +34 -20
  313. package/dist/runner/snapshot-save.js +46 -37
  314. package/dist/runner/snapshot-start.d.ts +25 -0
  315. package/dist/runner/snapshot-start.js +16 -0
  316. package/dist/sdk/extension/commands.d.ts +35 -17
  317. package/dist/sdk/extension/commands.js +13 -11
  318. package/dist/sdk/extension/driver.d.ts +143 -0
  319. package/dist/sdk/extension/driver.js +28 -0
  320. package/dist/sdk/extension/index.d.ts +2 -1
  321. package/dist/sdk/extension/index.js +15 -9
  322. package/dist/sdk/extension/{launcher-supplies.d.ts → launcher-context.d.ts} +3 -3
  323. package/dist/sdk/extension/launcher-context.js +5 -0
  324. package/dist/sdk/extension/lifecycle.d.ts +6 -5
  325. package/dist/sdk/extension/lifecycle.js +2 -2
  326. package/dist/sdk/extension/resource-definition.d.ts +13 -13
  327. package/dist/sdk/extension/resource-definition.js +2 -2
  328. package/dist/sdk/extension/resource.d.ts +13 -13
  329. package/dist/sdk/extension/resource.js +11 -11
  330. package/dist/sdk/extension/time.js +2 -2
  331. package/dist/sdk/index.d.ts +2 -0
  332. package/dist/sdk/index.js +3 -1
  333. package/dist/sdk/run/launcher.d.ts +1 -1
  334. package/dist/sdk/run/launcher.js +4 -3
  335. package/dist/sdk/run/payload.js +1 -1
  336. package/dist/sdk/run/test-events.d.ts +24 -18
  337. package/dist/sdk/run/test-events.js +5 -4
  338. package/dist/sdk/run/test-result-writer.d.ts +77 -0
  339. package/dist/sdk/run/test-result-writer.js +143 -0
  340. package/dist/sdk/run/worker-test-event-writer.d.ts +13 -0
  341. package/dist/sdk/run/worker-test-event-writer.js +31 -0
  342. package/dist/vendor/testserver-sdk/container/container.d.ts +1 -6
  343. package/dist/vendor/testserver-sdk/container/container.js +1 -5
  344. package/dist/vendor/testserver-sdk/factories/build.d.ts +12 -40
  345. package/dist/vendor/testserver-sdk/factories/build.js +15 -66
  346. package/dist/vendor/testserver-sdk/factories/gateways.d.ts +1 -2
  347. package/dist/vendor/testserver-sdk/factories/index.d.ts +1 -3
  348. package/dist/vendor/testserver-sdk/factories/index.js +3 -5
  349. package/dist/vendor/testserver-sdk/index.d.ts +1 -2
  350. package/dist/vendor/testserver-sdk/index.js +5 -6
  351. package/dist/vendor/testserver-sdk/records/body.d.ts +1 -1
  352. package/dist/vendor/testserver-sdk/records/body.js +1 -1
  353. package/dist/vitest/index.d.ts +2 -1
  354. package/dist/vitest/index.js +6 -4
  355. package/dist/vitest/test-events.d.ts +6 -16
  356. package/dist/vitest/test-events.js +15 -40
  357. package/dist/vitest/test-results.d.ts +9 -31
  358. package/dist/vitest/test-results.js +34 -105
  359. package/dist/vitest/worker-index.d.ts +6 -0
  360. package/dist/vitest/worker-index.js +17 -0
  361. package/package.json +23 -9
  362. package/skills/overview.md +6 -8
  363. package/skills/read-run-output.md +22 -7
  364. package/dist/chunks/chunk-FVMQKYTT.js +0 -10
  365. package/dist/chunks/chunk-SLNKW4ZM.js +0 -40
  366. package/dist/chunks/chunk-WNIQA5J6.js +0 -19
  367. package/dist/chunks/chunk-WSIF7SR6.js +0 -10
  368. package/dist/commands/vitest/outcomes.d.ts +0 -379
  369. package/dist/commands/vitest/outcomes.js +0 -70
  370. package/dist/core/launcher-supplies.d.ts +0 -11
  371. package/dist/core/launcher-supplies.js +0 -28
  372. package/dist/core/live/terminal-command-gateway.d.ts +0 -8
  373. package/dist/core/live/terminal-command-gateway.js +0 -49
  374. package/dist/core/resource-registry.js +0 -30
  375. package/dist/extensions/github/live/world.d.ts +0 -6
  376. package/dist/extensions/github/live/world.js +0 -16
  377. package/dist/extensions/github/world.js +0 -3
  378. package/dist/extensions/story/command-tree.d.ts +0 -6
  379. package/dist/extensions/story/command-tree.js +0 -21
  380. package/dist/extensions/story/commands/app.d.ts +0 -23
  381. package/dist/extensions/story/commands/app.js +0 -5
  382. package/dist/extensions/story/commands/run/command.d.ts +0 -211
  383. package/dist/extensions/story/commands/run/command.js +0 -259
  384. package/dist/extensions/story/commands/run/metadata.js +0 -8
  385. package/dist/extensions/story/commands/run/outcomes.d.ts +0 -101
  386. package/dist/extensions/story/commands/run/outcomes.js +0 -73
  387. package/dist/extensions/story/commands/tree.d.ts +0 -2
  388. package/dist/extensions/story/commands/tree.js +0 -6
  389. package/dist/extensions/story/extension.d.ts +0 -2
  390. package/dist/extensions/story/extension.js +0 -8
  391. package/dist/extensions/testserver/live/world.d.ts +0 -8
  392. package/dist/extensions/testserver/vitest/sandbox.d.ts +0 -25
  393. package/dist/extensions/testserver/vitest/sandbox.js +0 -43
  394. package/dist/extensions/testserver/world.js +0 -4
  395. package/dist/sdk/extension/launcher-supplies.js +0 -3
  396. package/dist/story/align.d.ts +0 -37
  397. package/dist/story/align.js +0 -39
  398. package/dist/story/command-line.d.ts +0 -24
  399. package/dist/story/command-line.js +0 -88
  400. package/dist/story/definition.d.ts +0 -59
  401. package/dist/story/definition.js +0 -9
  402. package/dist/story/diff.d.ts +0 -9
  403. package/dist/story/diff.js +0 -97
  404. package/dist/story/errors.d.ts +0 -14
  405. package/dist/story/errors.js +0 -21
  406. package/dist/story/gateways.d.ts +0 -94
  407. package/dist/story/gateways.js +0 -3
  408. package/dist/story/host.d.ts +0 -30
  409. package/dist/story/host.js +0 -97
  410. package/dist/story/index.d.ts +0 -8
  411. package/dist/story/index.js +0 -11
  412. package/dist/story/json.d.ts +0 -16
  413. package/dist/story/json.js +0 -59
  414. package/dist/story/launch.d.ts +0 -70
  415. package/dist/story/launch.js +0 -77
  416. package/dist/story/live/recording-gateway.d.ts +0 -2
  417. package/dist/story/live/recording-gateway.js +0 -103
  418. package/dist/story/orphans.d.ts +0 -35
  419. package/dist/story/orphans.js +0 -51
  420. package/dist/story/recording.d.ts +0 -62
  421. package/dist/story/recording.js +0 -97
  422. package/dist/story/report.d.ts +0 -42
  423. package/dist/story/report.js +0 -129
  424. package/dist/story/sequence.d.ts +0 -30
  425. package/dist/story/sequence.js +0 -74
  426. package/dist/story/settle.d.ts +0 -96
  427. package/dist/story/settle.js +0 -71
  428. package/dist/story/start.d.ts +0 -50
  429. package/dist/story/start.js +0 -183
  430. package/dist/vendor/testserver-sdk/factories/definition.d.ts +0 -39
  431. package/dist/vendor/testserver-sdk/factories/definition.js +0 -16
  432. package/dist/vendor/testserver-sdk/factories/definitions.d.ts +0 -169
  433. package/dist/vendor/testserver-sdk/factories/definitions.js +0 -245
  434. package/dist/vendor/testserver-sdk/seed/index.d.ts +0 -1
  435. package/dist/vendor/testserver-sdk/seed/index.js +0 -3
  436. package/dist/vendor/testserver-sdk/seed/seed.d.ts +0 -221
  437. package/dist/vendor/testserver-sdk/seed/seed.js +0 -171
  438. package/dist/vitest/find-vitest.d.ts +0 -7
  439. package/dist/vitest/find-vitest.js +0 -28
  440. package/dist/vitest/gateways.js +0 -4
  441. package/dist/vitest/plan.d.ts +0 -51
  442. /package/dist/{extensions/story/commands/run → commands/playwright}/metadata.d.ts +0 -0
  443. /package/dist/{vitest → extensions/vitest/plan}/list-output.d.ts +0 -0
  444. /package/dist/{vitest → extensions/vitest/plan}/list-output.js +0 -0
@@ -6,53 +6,8 @@ import {
6
6
  openRunnerSession,
7
7
  parseTestEvent,
8
8
  systemClock,
9
- systemTimer,
10
- testEventLine
11
- } from "./chunk-O4BUT7BE.js";
12
-
13
- // src/run-directory/run-directory.ts
14
- import { join } from "node:path";
15
- var RUNS_SUBPATH = ["runs"];
16
- var RUN_DIRECTORIES_KEPT = 1e3;
17
- var RUN_FILE = "run.json";
18
- var TESTS_FILE = "tests.jsonl";
19
- var TESTS_PARTIAL_FILE = ".tests.jsonl.partial";
20
- var TEST_EVENTS_STAGING_FILE = ".test-events.jsonl";
21
- var TIMELINE_FILE = "timeline.json";
22
- var EVENTS_FILE = "events.jsonl";
23
- var COMMAND_LOG = "command.log";
24
- var RUN_LOGS = ["snapshot", "apply", "install", "build", "command"];
25
- function runLogFile(log) {
26
- return log === "command" ? COMMAND_LOG : `${log}.log`;
27
- }
28
- var ACTIVE_MARKER = "active.json";
29
- var RUN_ID_PATTERN = /^\d{8}T\d{6}-[0-9a-z]+$/;
30
- function runIdPrefix(startedAt) {
31
- return startedAt.toISOString().replace(/[-:]/g, "").replace(/\.\d+Z$/, "");
32
- }
33
- function testEventsPath(path) {
34
- return join(path, TEST_EVENTS_STAGING_FILE);
35
- }
36
- function stepLogPath(path, step) {
37
- return join(path, runLogFile(step));
38
- }
39
- function stepLog(path, step) {
40
- return step === "snapshot" || step === "apply" || step === "install" || step === "build" ? stepLogPath(path, step) : void 0;
41
- }
42
- function runDirectoryObserver(directory) {
43
- return {
44
- observe: async ({ event, at }) => {
45
- if (event.kind === "runner" && event.event.kind === "step-output") {
46
- directory.appendStepOutput(event.event.phase, `${at.toISOString()} ${event.event.line}`);
47
- return;
48
- }
49
- directory.appendEvent(JSON.stringify({ at: at.toISOString(), ...event }));
50
- }
51
- };
52
- }
53
-
54
- // src/run-directory/run-record.ts
55
- import { z as z3 } from "zod";
9
+ systemTimer
10
+ } from "./chunk-ODQHQJLE.js";
56
11
 
57
12
  // src/core/reports.ts
58
13
  var WARNINGS_HEADING = "Warnings";
@@ -63,11 +18,46 @@ function warningRows(warnings) {
63
18
  return warnings.length === 0 ? [] : [[WARNINGS_HEADING, warnings.map(({ message }) => message)]];
64
19
  }
65
20
 
21
+ // src/core/state-directory.ts
22
+ import { isAbsolute, join } from "node:path";
23
+ function stateDirectoryPattern(subpath) {
24
+ return ["${XDG_STATE_HOME:-~/.local/state}/storm", ...subpath].join("/");
25
+ }
26
+ function resolveStateDirectory(env, subpath) {
27
+ const state = env["XDG_STATE_HOME"];
28
+ if (state !== void 0 && state !== "" && isAbsolute(state))
29
+ return { ok: true, directory: join(state, "storm", ...subpath) };
30
+ const home = env["HOME"];
31
+ if (home === void 0 || home === "")
32
+ return { ok: false, reason: "HOME isn't set, and XDG_STATE_HOME isn't an absolute path" };
33
+ if (!isAbsolute(home))
34
+ return { ok: false, reason: `HOME isn't an absolute path (${home}), and XDG_STATE_HOME isn't either` };
35
+ return { ok: true, directory: join(home, ".local", "state", "storm", ...subpath) };
36
+ }
37
+
38
+ // src/core/timing.ts
39
+ import { constants } from "node:os";
40
+ function secondsOf(ms) {
41
+ return Math.round(ms / 100) / 10;
42
+ }
43
+ function secondsText(value) {
44
+ return `${value.toFixed(1)}s`;
45
+ }
46
+ function megabytesText(bytes) {
47
+ return `${(bytes / 1e6).toFixed(1)} MB`;
48
+ }
49
+ function commandExitStatus(outcome) {
50
+ if (outcome.kind === "exited") return outcome.code;
51
+ if (outcome.kind === "no-exit-code") return 1;
52
+ const number = constants.signals[outcome.signal];
53
+ return number === void 0 ? 1 : 128 + number;
54
+ }
55
+
66
56
  // src/core/before-run.ts
67
- function bindLifecycles(lookup, worlds) {
57
+ function bindLifecycles(lookup, resourceContexts2) {
68
58
  const { definitions: resources, named } = lookup;
69
59
  const lifecycles = new Map(
70
- resources.map((resource) => [resource, resource.lifecycle(worlds[resource.name])])
60
+ resources.map((resource) => [resource, resource.lifecycle(resourceContexts2[resource.name])])
71
61
  );
72
62
  const lifecycleOf = (definition, key) => {
73
63
  const lifecycle = lifecycles.get(named(definition, key));
@@ -107,13 +97,13 @@ function definitionLookup(definitions) {
107
97
  for (const definition of definitions) if (!byName.has(definition.name)) byName.set(definition.name, definition);
108
98
  const named = (definition, key) => {
109
99
  const resource = byName.get(definition);
110
- if (resource === void 0) throw new Error(`${key}'s definition, ${definition}, isn't in the registry`);
100
+ if (resource === void 0) throw new Error(`${key}'s definition, ${definition}, isn't in the definition set`);
111
101
  return resource;
112
102
  };
113
103
  return {
114
104
  definitions,
115
105
  named,
116
- inRegistryOrder: (map) => {
106
+ inDefinitionOrder: (map) => {
117
107
  const entries = Object.entries(map).map(([key, record]) => ({
118
108
  key,
119
109
  record,
@@ -124,25 +114,8 @@ function definitionLookup(definitions) {
124
114
  };
125
115
  }
126
116
 
127
- // src/core/state-directory.ts
128
- import { isAbsolute, join as join2 } from "node:path";
129
- function stateDirectoryPattern(subpath) {
130
- return ["${XDG_STATE_HOME:-~/.local/state}/storm", ...subpath].join("/");
131
- }
132
- function resolveStateDirectory(env, subpath) {
133
- const state = env["XDG_STATE_HOME"];
134
- if (state !== void 0 && state !== "" && isAbsolute(state))
135
- return { ok: true, directory: join2(state, "storm", ...subpath) };
136
- const home = env["HOME"];
137
- if (home === void 0 || home === "")
138
- return { ok: false, reason: "HOME isn't set, and XDG_STATE_HOME isn't an absolute path" };
139
- if (!isAbsolute(home))
140
- return { ok: false, reason: `HOME isn't an absolute path (${home}), and XDG_STATE_HOME isn't either` };
141
- return { ok: true, directory: join2(home, ".local", "state", "storm", ...subpath) };
142
- }
143
-
144
- // src/core/launcher-supplies.ts
145
- function launcherSupplies(env, name) {
117
+ // src/core/launcher-context.ts
118
+ function launcherContext(env, name) {
146
119
  const subpath = [name];
147
120
  const resolved = resolveStateDirectory(env, subpath);
148
121
  return {
@@ -152,26 +125,8 @@ function launcherSupplies(env, name) {
152
125
  timer: systemTimer
153
126
  };
154
127
  }
155
- function worldsOf(resources, env) {
156
- return Object.fromEntries(resources.map(({ name, world }) => [name, world(launcherSupplies(env, name))]));
157
- }
158
-
159
- // src/core/timing.ts
160
- import { constants } from "node:os";
161
- function secondsOf(ms) {
162
- return Math.round(ms / 100) / 10;
163
- }
164
- function secondsText(value) {
165
- return `${value.toFixed(1)}s`;
166
- }
167
- function megabytesText(bytes) {
168
- return `${(bytes / 1e6).toFixed(1)} MB`;
169
- }
170
- function commandExitStatus(outcome) {
171
- if (outcome.kind === "exited") return outcome.code;
172
- if (outcome.kind === "no-exit-code") return 1;
173
- const number = constants.signals[outcome.signal];
174
- return number === void 0 ? 1 : 128 + number;
128
+ function resourceContexts(resources, env) {
129
+ return Object.fromEntries(resources.map(({ name, context }) => [name, context(launcherContext(env, name))]));
175
130
  }
176
131
 
177
132
  // src/core/presentations.ts
@@ -245,29 +200,31 @@ function cleanupInstanceSchema(names) {
245
200
  return z.record(z.string(), record);
246
201
  }
247
202
  function resourceReports(lookup) {
248
- const { definitions: resources, inRegistryOrder } = lookup;
249
- const warningsOf = (facts) => inRegistryOrder(facts).flatMap(({ record }) => record.warnings.map(({ reason, message }) => ({ reason, message })));
203
+ const { definitions: resources, inDefinitionOrder } = lookup;
204
+ const warningsOf = (facts) => inDefinitionOrder(facts).flatMap(
205
+ ({ record }) => record.warnings.map(({ reason, message }) => ({ reason, message }))
206
+ );
250
207
  return {
251
208
  cleanupSchema: cleanupInstanceSchema(resources.map(({ name }) => name)),
252
- // `{ definition, warnings }` for each instance, in registry order, then the records' order.
209
+ // `{ definition, warnings }` for each instance, in definition order, then the records' order.
253
210
  cleanupFacts: (cleanup) => Object.fromEntries(
254
- inRegistryOrder(cleanup).map(({ key, record: { definition, warnings } }) => [key, { definition, warnings }])
211
+ inDefinitionOrder(cleanup).map(({ key, record: { definition, warnings } }) => [key, { definition, warnings }])
255
212
  ),
256
213
  cleanupRows: (facts) => warningRows(warningsOf(facts)),
257
214
  cleanupWarnings: warningsOf,
258
215
  ranSchema: instanceSchema(resources.map(({ name }) => [name, z.unknown()])),
259
- // `{ definition, facts, warnings }` for each instance, in registry order, then the records' order.
216
+ // `{ definition, facts, warnings }` for each instance, in definition order, then the records' order.
260
217
  ranFacts: (ran) => Object.fromEntries(
261
- inRegistryOrder(ran).map(({ key, record: { definition, facts, warnings } }) => [
218
+ inDefinitionOrder(ran).map(({ key, record: { definition, facts, warnings } }) => [
262
219
  key,
263
220
  { definition, facts, warnings }
264
221
  ])
265
222
  ),
266
223
  ranWarnings: warningsOf,
267
- ranRows: (ran) => inRegistryOrder(ran).flatMap(({ record }) => record.rows),
224
+ ranRows: (ran) => inDefinitionOrder(ran).flatMap(({ record }) => record.rows),
268
225
  // The run releases its instances in reverse order, so the cleanup records come in reverse order of the run's
269
226
  // instances; reversed, they come in the order the run took them.
270
- canceledLines: (cleanup) => inRegistryOrder(Object.fromEntries(Object.entries(cleanup).toReversed())).flatMap(({ record }) => [
227
+ canceledLines: (cleanup) => inDefinitionOrder(Object.fromEntries(Object.entries(cleanup).toReversed())).flatMap(({ record }) => [
271
228
  ...record.canceled,
272
229
  ...record.done,
273
230
  ...record.warnings.map(({ message }) => message)
@@ -275,6 +232,20 @@ function resourceReports(lookup) {
275
232
  };
276
233
  }
277
234
 
235
+ // src/core/setup-phases.ts
236
+ function setupPhaseKey({ resource, label }) {
237
+ return `${resource}\0${label}`;
238
+ }
239
+ function setupPhaseWords(phases) {
240
+ const resources = /* @__PURE__ */ new Map();
241
+ for (const { label, resource } of phases) {
242
+ const owners = resources.get(label) ?? /* @__PURE__ */ new Set();
243
+ resources.set(label, owners);
244
+ owners.add(resource);
245
+ }
246
+ return ({ label, resource }) => (resources.get(label)?.size ?? 0) > 1 ? `${label} (${resource})` : label;
247
+ }
248
+
278
249
  // src/core/run-state.ts
279
250
  var RUNNER_STEPS = ["snapshot", "start", "upload", "apply", "install", "build"];
280
251
  var EMPTY_RUN_STATE = {
@@ -331,7 +302,8 @@ function applyEvent(resources, state, event, at) {
331
302
  uploadBytes: void 0,
332
303
  activity: void 0,
333
304
  kept: void 0,
334
- save: void 0
305
+ save: void 0,
306
+ noSave: void 0
335
307
  }
336
308
  };
337
309
  case "minting":
@@ -460,7 +432,14 @@ function applyRunnerEvent(state, event, at) {
460
432
  return withRunner(
461
433
  withStep(state, "snapshot", () => ({ status: "done", startedAt: at, endedAt: at })),
462
434
  () => ({
463
- snapshot: { kind: "reused", id: event.snapshotId, base: event.base, branch: event.branch, head: event.head }
435
+ snapshot: {
436
+ kind: "reused",
437
+ id: event.snapshotId,
438
+ base: event.base,
439
+ branch: event.branch,
440
+ head: event.head,
441
+ snapshot: event.snapshot
442
+ }
464
443
  })
465
444
  );
466
445
  case "snapshot-build-started":
@@ -472,7 +451,19 @@ function applyRunnerEvent(state, event, at) {
472
451
  return withRunner(
473
452
  withStep(state, "snapshot", () => ({ status: "done", endedAt: at, latest: void 0 })),
474
453
  () => ({
475
- snapshot: { kind: "built", id: event.snapshotId, base: event.base, branch: null, head: null },
454
+ snapshot: {
455
+ kind: "built",
456
+ id: event.snapshotId,
457
+ base: event.base,
458
+ branch: null,
459
+ head: null,
460
+ // A run builds its base snapshot at its own base.
461
+ snapshot: {
462
+ kind: "base",
463
+ builtAt: event.base,
464
+ builtBehind: event.builtBehind
465
+ }
466
+ },
476
467
  activity: void 0
477
468
  })
478
469
  );
@@ -514,21 +505,23 @@ function applyRunnerEvent(state, event, at) {
514
505
  );
515
506
  case "sandbox-kept":
516
507
  return withRunner(state, () => ({ kept: { name: event.name, stopsAt: event.stopsAt } }));
517
- case "branch-snapshot-saving":
508
+ case "dev-snapshot-saving":
518
509
  return withRunner(state, () => ({ save: { kind: "saving", branch: event.branch } }));
519
- case "branch-snapshot-saved":
510
+ case "dev-snapshot-saved":
520
511
  return withRunner(state, () => ({
521
512
  save: { kind: "saved", id: event.snapshotId, branch: event.branch, head: event.head }
522
513
  }));
523
- case "branch-snapshot-not-saved":
514
+ case "dev-snapshot-not-saved":
524
515
  return withRunner(state, () => ({ save: { kind: "not-saved" } }));
516
+ case "dev-snapshot-skipped":
517
+ return withRunner(state, () => ({ noSave: event.reason }));
525
518
  // A step's outcome comes from its lane's end, not from the end of its output.
526
519
  case "output-started":
527
520
  case "output-ended":
528
521
  case "snapshot-entry-not-written":
529
522
  case "command-output-started":
530
- case "branch-snapshots-dropped":
531
- case "branch-snapshots-not-dropped":
523
+ case "dev-snapshots-dropped":
524
+ case "dev-snapshots-not-dropped":
532
525
  return state;
533
526
  }
534
527
  }
@@ -545,7 +538,7 @@ function applyTestEvent(tests, event, at) {
545
538
  worker: event.worker,
546
539
  file: void 0,
547
540
  fileStartedAt: void 0,
548
- containerSince: void 0
541
+ settingUp: []
549
542
  };
550
543
  const put = (changed, rest = {}) => ({
551
544
  ...tests,
@@ -556,22 +549,28 @@ function applyTestEvent(tests, event, at) {
556
549
  });
557
550
  switch (event.kind) {
558
551
  case "file-started":
559
- return put({ ...worker, file: event.file, fileStartedAt: at, containerSince: void 0 });
552
+ return put({ ...worker, file: event.file, fileStartedAt: at, settingUp: [] });
560
553
  case "test-started":
561
554
  return put({ ...worker, file: event.file, fileStartedAt: worker.fileStartedAt ?? at });
562
555
  case "test-attempt-finished":
563
556
  return put(worker);
564
557
  case "file-finished":
565
558
  return put(
566
- { ...worker, file: void 0, fileStartedAt: void 0, containerSince: void 0 },
559
+ { ...worker, file: void 0, fileStartedAt: void 0, settingUp: [] },
567
560
  { filesDone: tests.filesDone + 1 }
568
561
  );
569
- case "container-starting":
570
- return put({ ...worker, containerSince: at });
571
- case "container-started":
572
- return put({ ...worker, containerSince: void 0 });
562
+ case "setup-started": {
563
+ const { label, resource } = event;
564
+ return put({ ...worker, settingUp: [...withoutPhase(worker.settingUp, event), { label, resource }] });
565
+ }
566
+ case "setup-finished":
567
+ return put({ ...worker, settingUp: withoutPhase(worker.settingUp, event) });
573
568
  }
574
569
  }
570
+ function withoutPhase(settingUp, phase) {
571
+ const key = setupPhaseKey(phase);
572
+ return settingUp.filter((under) => setupPhaseKey(under) !== key);
573
+ }
575
574
  function withRunner(state, change) {
576
575
  return state.runner === void 0 ? state : { ...state, runner: { ...state.runner, ...change() } };
577
576
  }
@@ -623,7 +622,13 @@ function timeline(resources, state) {
623
622
  const runnerStarted = runner !== void 0 && runner.status !== "pending";
624
623
  if (runnerStarted) {
625
624
  const steps = runner.steps.filter((step) => step.status !== "pending" && !(step.name === "snapshot" && runner.snapshot?.kind === "reused")).flatMap(
626
- (step) => step.startedAt === void 0 ? [] : [{ name: step.name, ...span({ status: step.status, startedAt: step.startedAt, endedAt: step.endedAt }) }]
625
+ (step) => step.startedAt === void 0 ? [] : [
626
+ {
627
+ name: step.name,
628
+ ...span({ status: step.status, startedAt: step.startedAt, endedAt: step.endedAt }),
629
+ ...step.name === "upload" && runner.uploadBytes !== void 0 ? { bytes: runner.uploadBytes } : {}
630
+ }
631
+ ]
627
632
  ).toSorted((a, b) => a.startMs - b.startMs);
628
633
  const snapshot = runner.snapshot?.kind === "building" ? void 0 : runner.snapshot?.kind;
629
634
  rows.push(row(RUNNER, runner, { steps, snapshot }));
@@ -672,9 +677,9 @@ function outcomeOf(status) {
672
677
  return status === "running" || status === "pending" ? "unfinished" : status;
673
678
  }
674
679
 
675
- // src/core/resource-registry.ts
680
+ // src/core/resource-definition-set.ts
676
681
  var LOOKUP = /* @__PURE__ */ Symbol("definition lookup");
677
- function resourceRegistry(definitions) {
682
+ function resourceDefinitionSet(definitions) {
678
683
  const lookup = definitionLookup(definitions);
679
684
  return {
680
685
  definitions,
@@ -682,8 +687,8 @@ function resourceRegistry(definitions) {
682
687
  presentations: resourcePresentations(lookup),
683
688
  applyEvent: (state, timed) => applyRunEvent(definitions, state, timed),
684
689
  timeline: (state) => timeline(definitions, state),
685
- lifecycles: (worlds) => bindLifecycles(lookup, worlds),
686
- worlds: (env) => worldsOf(definitions, env),
690
+ lifecycles: (contexts) => bindLifecycles(lookup, contexts),
691
+ contexts: (env) => resourceContexts(definitions, env),
687
692
  [LOOKUP]: lookup
688
693
  };
689
694
  }
@@ -693,6 +698,14 @@ function resourcesOf(extensions) {
693
698
  return extensions.flatMap(({ resources }) => resources);
694
699
  }
695
700
 
701
+ // src/core/drivers-of.ts
702
+ function driversOf(extensions) {
703
+ return extensions.flatMap(({ drivers }) => drivers ?? []);
704
+ }
705
+ function driverContexts(drivers) {
706
+ return Object.fromEntries(drivers.map(({ name, context }) => [name, context()]));
707
+ }
708
+
696
709
  // src/core/events.ts
697
710
  function timedProgress(clock, observer) {
698
711
  return { emit: (event) => observer.observe({ event, at: clock.now() }) };
@@ -728,7 +741,7 @@ function runCommand(request) {
728
741
  request.terminate.removeEventListener("abort", onTerminate);
729
742
  resolve(outcome);
730
743
  };
731
- const ended2 = (code, signal) => signal !== null ? { kind: "signaled", signal } : { kind: "exited", code: code ?? 0 };
744
+ const ended = (code, signal) => signal !== null ? { kind: "signaled", signal } : { kind: "exited", code: code ?? 0 };
732
745
  const command = spawn(executable, args, {
733
746
  stdio: ["inherit", "pipe", "pipe"],
734
747
  shell: false,
@@ -756,61 +769,18 @@ function runCommand(request) {
756
769
  command.once("error", (error) => {
757
770
  if (!started) settle({ kind: "spawn-failed", message: error.message });
758
771
  });
759
- command.once("close", (code, signal) => settle(ended2(code, signal)));
772
+ command.once("close", (code, signal) => settle(ended(code, signal)));
760
773
  command.once("exit", (code, signal) => {
761
774
  draining = setTimeout(() => {
762
775
  command.stdout.destroy();
763
776
  command.stderr.destroy();
764
- settle(ended2(code, signal));
777
+ settle(ended(code, signal));
765
778
  }, PIPE_DRAIN_MS);
766
779
  });
767
780
  request.terminate.addEventListener("abort", onTerminate, { once: true });
768
781
  });
769
782
  }
770
783
 
771
- // src/core/live/terminal-command-gateway.ts
772
- import { spawn as spawn2 } from "node:child_process";
773
- function liveTerminalCommandGateway() {
774
- return {
775
- run: (request) => runInTerminal(request)
776
- };
777
- }
778
- function runInTerminal(request) {
779
- const [executable, ...args] = request.argv;
780
- if (executable === void 0) throw new Error("liveTerminalCommandGateway: the command's argv is empty");
781
- return new Promise((resolve) => {
782
- let started = false;
783
- let settled = false;
784
- const settle = (outcome) => {
785
- if (settled) return;
786
- settled = true;
787
- request.terminate.removeEventListener("abort", onTerminate);
788
- resolve(outcome);
789
- };
790
- const command = spawn2(executable, args, {
791
- cwd: request.cwd,
792
- stdio: "inherit",
793
- shell: false,
794
- env: { ...request.env }
795
- });
796
- const onTerminate = () => {
797
- if (started) command.kill("SIGTERM");
798
- };
799
- command.once("spawn", () => {
800
- started = true;
801
- if (request.terminate.aborted) command.kill("SIGTERM");
802
- });
803
- command.once("error", (error) => {
804
- if (!started) settle({ kind: "spawn-failed", message: error.message });
805
- });
806
- command.once(
807
- "exit",
808
- (code, signal) => settle(signal !== null ? { kind: "signaled", signal } : { kind: "exited", code: code ?? 0 })
809
- );
810
- request.terminate.addEventListener("abort", onTerminate, { once: true });
811
- });
812
- }
813
-
814
784
  // src/core/live/job-summary-gateway.ts
815
785
  import { appendFile } from "node:fs/promises";
816
786
  function liveJobSummaryGateway(options) {
@@ -969,6 +939,48 @@ function clip(line, width) {
969
939
  return out;
970
940
  }
971
941
 
942
+ // src/core/live/package-bin-gateway.ts
943
+ import { constants as constants2 } from "node:fs";
944
+ import { access } from "node:fs/promises";
945
+
946
+ // src/core/package-bin.ts
947
+ import { dirname, isAbsolute as isAbsolute2, join as join2, relative } from "node:path";
948
+ function packageBinPath(directory, name) {
949
+ return join2(directory, "node_modules", ".bin", name);
950
+ }
951
+ function packageBinSearchDirectories(from, root) {
952
+ const inside = from === root || isInside(root, from);
953
+ const directories = [];
954
+ let directory = from;
955
+ for (; ; ) {
956
+ directories.push(directory);
957
+ if (inside && directory === root) return directories;
958
+ const parent = dirname(directory);
959
+ if (parent === directory) return directories;
960
+ directory = parent;
961
+ }
962
+ }
963
+ function isInside(directory, path) {
964
+ const between = relative(directory, path);
965
+ return between !== "" && !between.startsWith("..") && !isAbsolute2(between);
966
+ }
967
+
968
+ // src/core/live/package-bin-gateway.ts
969
+ var livePackageBinGateway = {
970
+ async find({ name, from, root }) {
971
+ const searched = packageBinSearchDirectories(from, root);
972
+ for (const directory of searched) {
973
+ const path = packageBinPath(directory, name);
974
+ try {
975
+ await access(path, constants2.X_OK);
976
+ return { ok: true, path };
977
+ } catch {
978
+ }
979
+ }
980
+ return { ok: false, searched };
981
+ }
982
+ };
983
+
972
984
  // src/core/run.ts
973
985
  import { posix } from "node:path";
974
986
 
@@ -991,14 +1003,14 @@ function colorEnvironment(env, color) {
991
1003
  }
992
1004
 
993
1005
  // src/core/resources.ts
994
- function resourceInstances({ named }, worlds, requests) {
1006
+ function resourceInstances({ named }, resourceContexts2, requests) {
995
1007
  return Object.entries(requests).map(
996
- ([key, request]) => instanceOf(named(request.definition, key), key, worlds, request)
1008
+ ([key, request]) => instanceOf(named(request.definition, key), key, resourceContexts2, request)
997
1009
  );
998
1010
  }
999
- function instanceOf(resource, key, worlds, request) {
1011
+ function instanceOf(resource, key, resourceContexts2, request) {
1000
1012
  const { name } = resource;
1001
- const lifecycle = resource.lifecycle(worlds[name]);
1013
+ const lifecycle = resource.lifecycle(resourceContexts2[name]);
1002
1014
  const taken = [];
1003
1015
  let result;
1004
1016
  let canceled = [];
@@ -1037,7 +1049,7 @@ function instanceOf(resource, key, worlds, request) {
1037
1049
  );
1038
1050
  if ("refused" in answered) {
1039
1051
  const outcome = {
1040
- kind: "resource-refused",
1052
+ kind: "resource_refused",
1041
1053
  resource: key,
1042
1054
  definition: name,
1043
1055
  refusal: answered
@@ -1046,7 +1058,7 @@ function instanceOf(resource, key, worlds, request) {
1046
1058
  }
1047
1059
  if ("mintFailed" in answered) {
1048
1060
  const { failure, target } = answered.mintFailed;
1049
- return { kind: "refused", outcome: { kind: "mint-failed", failure, target, runner: false } };
1061
+ return { kind: "refused", outcome: { kind: "mint_failed", failure, target, runner: false } };
1050
1062
  }
1051
1063
  result = answered;
1052
1064
  canceled = "acquired" in answered ? answered.acquired.canceled ?? [] : answered.canceled;
@@ -1167,8 +1179,8 @@ function resourceWarnings(cleanup) {
1167
1179
  }
1168
1180
 
1169
1181
  // src/core/run.ts
1170
- async function executeRun(registry, context, worlds, request, control, progress) {
1171
- const instances = resourceInstances(registry[LOOKUP], worlds, request.resources);
1182
+ async function executeRun(definitionSet, context, resourceContexts2, request, control, progress) {
1183
+ const instances = resourceInstances(definitionSet[LOOKUP], resourceContexts2, request.resources);
1172
1184
  await progress.emit({
1173
1185
  kind: "started",
1174
1186
  version: request.version,
@@ -1184,8 +1196,7 @@ async function executeRun(registry, context, worlds, request, control, progress)
1184
1196
  base: prepared.base,
1185
1197
  baseRef: prepared.baseRef,
1186
1198
  nestedRepositories: prepared.upload.nestedRepositories,
1187
- notes: prepared.notes,
1188
- saveSkipped: prepared.save?.kind === "skipped"
1199
+ notes: prepared.notes
1189
1200
  });
1190
1201
  }
1191
1202
  let cleanupStarted = false;
@@ -1203,10 +1214,10 @@ async function executeRun(registry, context, worlds, request, control, progress)
1203
1214
  resourceCleanup = await releaseResources(instances, progress);
1204
1215
  }
1205
1216
  })();
1206
- let ended2;
1217
+ let ended;
1207
1218
  let runnerCleanup = null;
1208
1219
  try {
1209
- ({ ended: ended2, runnerCleanup } = request.runner === void 0 ? { ended: await runUnsandboxed(context, request, instances, control, progress), runnerCleanup: null } : await runSandboxed(context, request, instances, control, progress, { startCleanup, release }));
1220
+ ({ ended, runnerCleanup } = request.runner === void 0 ? { ended: await runUnsandboxed(context, request, instances, control, progress), runnerCleanup: null } : await runSandboxed(context, request, instances, control, progress, { startCleanup, release }));
1210
1221
  } finally {
1211
1222
  await release(null);
1212
1223
  }
@@ -1216,8 +1227,8 @@ async function executeRun(registry, context, worlds, request, control, progress)
1216
1227
  notStopped: runnerCleanup?.notStopped.length ?? 0,
1217
1228
  notDeleted: runnerCleanup?.notDeleted.length ?? 0
1218
1229
  });
1219
- if (ended2.kind !== "command-ended") return { ...ended2, runnerCleanup, resourceCleanup };
1220
- const { kind: _kind, ...ran } = ended2;
1230
+ if (ended.kind !== "command-ended") return { ...ended, runnerCleanup, resourceCleanup };
1231
+ const { kind: _kind, ...ran } = ended;
1221
1232
  return {
1222
1233
  kind: "ran",
1223
1234
  ...ran,
@@ -1260,7 +1271,7 @@ async function runUnsandboxed(context, request, instances, control, progress) {
1260
1271
  write("stdout", splitters.stdout.flush());
1261
1272
  write("stderr", splitters.stderr.flush());
1262
1273
  if (command.kind === "spawn-failed")
1263
- return { kind: "spawn-failed", executable: request.argv[0] ?? "", message: command.message };
1274
+ return { kind: "spawn_failed", executable: request.argv[0] ?? "", message: command.message };
1264
1275
  await progress.emit({
1265
1276
  kind: "command-ended",
1266
1277
  command: posix.basename(request.argv[0] ?? ""),
@@ -1274,19 +1285,19 @@ function runnerLaneOutcome(outcome) {
1274
1285
  return outcome.kind === "aborted" ? "stopped" : "failed";
1275
1286
  }
1276
1287
  function runnerStopped(outcome) {
1277
- if (outcome.kind === "failed") return { kind: "runner-failed", failure: outcome.failure };
1288
+ if (outcome.kind === "failed") return { kind: "runner_failed", failure: outcome.failure };
1278
1289
  if (outcome.kind === "snapshot-gone")
1279
- return { kind: "snapshot-gone", entry: outcome.entry, removal: outcome.removal };
1290
+ return { kind: "snapshot_gone", entry: outcome.entry, removal: outcome.removal };
1280
1291
  return void 0;
1281
1292
  }
1282
1293
  async function runSandboxed(context, request, instances, control, progress, cleanup) {
1283
1294
  const runnerProgress = { emit: (event) => progress.emit({ kind: "runner", event }) };
1284
1295
  const session = openRunnerSession(context, request.runner, { signal: control.signal, cleanup }, runnerProgress);
1285
1296
  try {
1286
- const ended2 = await runInSandbox(context, request, instances, session, control, progress);
1297
+ const ended = await runInSandbox(context, request, instances, session, control, progress);
1287
1298
  const finished = await session.finish();
1288
1299
  return {
1289
- ended: ended2.kind === "command-ended" ? { ...ended2, runner: { ...ended2.runner, save: finished.save } } : ended2,
1300
+ ended: ended.kind === "command-ended" ? { ...ended, runner: { ...ended.runner, save: finished.save, noSave: finished.noSave } } : ended,
1290
1301
  runnerCleanup: finished.cleanup
1291
1302
  };
1292
1303
  } finally {
@@ -1299,10 +1310,10 @@ async function runInSandbox(context, request, instances, session, control, progr
1299
1310
  if (control.signal.aborted) return canceled();
1300
1311
  const mint = credentialSourceFor({ source: "mint", target: runner.target }, context, progress);
1301
1312
  const minted = await mint.obtain();
1302
- if (!minted.ok) return { kind: "mint-failed", failure: minted.failure.failure, target: runner.target, runner: true };
1313
+ if (!minted.ok) return { kind: "mint_failed", failure: minted.failure.failure, target: runner.target, runner: true };
1303
1314
  const project = minted.credential.vercelProject();
1304
1315
  if (project === void 0)
1305
- return { kind: "runner-failed", failure: { kind: "credential-claims-missing", target: runner.target } };
1316
+ return { kind: "runner_failed", failure: { kind: "credential-claims-missing", target: runner.target } };
1306
1317
  if (control.signal.aborted) return canceled();
1307
1318
  const acquisition = await readyBoth(
1308
1319
  {
@@ -1347,7 +1358,7 @@ async function runInSandbox(context, request, instances, session, control, progr
1347
1358
  await testEvents;
1348
1359
  if (sandboxed.kind === "killed" || sandboxed.kind === "failed" && control.signal.aborted)
1349
1360
  return { ...canceledStop(), commandStopped: true };
1350
- if (sandboxed.kind === "failed") return { kind: "runner-failed", failure: sandboxed.failure };
1361
+ if (sandboxed.kind === "failed") return { kind: "runner_failed", failure: sandboxed.failure };
1351
1362
  const command = sandboxed.exitCode === null ? { kind: "no-exit-code" } : { kind: "exited", code: sandboxed.exitCode };
1352
1363
  await progress.emit({
1353
1364
  kind: "command-ended",
@@ -1365,11 +1376,14 @@ async function runInSandbox(context, request, instances, session, control, progr
1365
1376
  snapshotBranch: ready.startedFrom.branch ?? null,
1366
1377
  snapshotHead: ready.startedFrom.head ?? null,
1367
1378
  built: ready.built,
1379
+ snapshot: ready.snapshot,
1380
+ uploadBytes: ready.uploadBytes,
1368
1381
  vcpus: ready.vcpus,
1369
1382
  region: ready.region,
1370
1383
  runtime: ready.runtime,
1371
1384
  buildMs: ready.buildMs,
1372
- save: null
1385
+ save: null,
1386
+ noSave: null
1373
1387
  }
1374
1388
  };
1375
1389
  }
@@ -1388,772 +1402,6 @@ async function readyBoth(request, control, progress) {
1388
1402
  });
1389
1403
  }
1390
1404
 
1391
- // src/run-directory/plan.ts
1392
- import { z as z2 } from "zod";
1393
- var planOptionSchema = z2.object({
1394
- /** The option's key path, `resources.<key>.<option>`, under its resource key. */
1395
- path: z2.string(),
1396
- /** Its value. */
1397
- value: z2.union([z2.string(), z2.number(), z2.boolean()]),
1398
- /** Where the value came from: its flag (`flag`), storm.config.ts (`file`), or its default, given the test plan (`default`). */
1399
- from: z2.enum(["flag", "file", "default"])
1400
- });
1401
- var planSchema = z2.object({
1402
- /** How many tests `vitest list --json <args>` counted. */
1403
- tests: z2.number().int().nonnegative(),
1404
- /** How many distinct test files they are in. */
1405
- files: z2.number().int().nonnegative(),
1406
- /**
1407
- * Each resource option whose default is a function of the test plan, with its value and where that came from; empty
1408
- * when the run has none.
1409
- */
1410
- options: z2.array(planOptionSchema)
1411
- });
1412
-
1413
- // src/run-directory/run-record.ts
1414
- var testTotalsSchema = z3.object({
1415
- passed: z3.number().int().nonnegative(),
1416
- failed: z3.number().int().nonnegative(),
1417
- skipped: z3.number().int().nonnegative()
1418
- });
1419
- var endedSchema = z3.object({
1420
- outcome: z3.string(),
1421
- exitCode: z3.number().int().nullable(),
1422
- signal: z3.string().nullable(),
1423
- ms: z3.number().nonnegative().nullable(),
1424
- tests: testTotalsSchema.nullable(),
1425
- testsIncomplete: z3.string().nullable(),
1426
- resources: z3.record(z3.string(), z3.object({ definition: z3.string(), facts: z3.unknown() })).nullable(),
1427
- resourceRows: z3.array(z3.tuple([z3.string(), z3.union([z3.string(), z3.array(z3.string())])]))
1428
- });
1429
- var snapshotSchema = z3.object({
1430
- id: z3.string(),
1431
- base: z3.string(),
1432
- built: z3.boolean(),
1433
- branch: z3.string().nullable(),
1434
- head: z3.string().nullable()
1435
- });
1436
- var saveSchema = z3.discriminatedUnion("kind", [
1437
- z3.object({
1438
- /** It saved the runner sandbox as a branch snapshot. */
1439
- kind: z3.literal("saved"),
1440
- /** The runner snapshot it saved. */
1441
- snapshotId: z3.string(),
1442
- /** The base it is of: the base of the runner snapshot the run started from, a full SHA. */
1443
- base: z3.string(),
1444
- /** The local branch it is for. */
1445
- branch: z3.string(),
1446
- /** HEAD's commit as the run started, a full SHA. */
1447
- head: z3.string(),
1448
- /** How long the save took, in milliseconds, from the scrub's start until the snapshot was saved. */
1449
- ms: z3.number(),
1450
- /** The snapshot's size in bytes. */
1451
- sizeBytes: z3.number(),
1452
- /** Whether the runner snapshot cache recorded it; a later run on the branch starts from it only when it did. */
1453
- entryWritten: z3.boolean()
1454
- }),
1455
- z3.object({
1456
- /** It didn't save: HEAD was detached, so there is no branch to save for. */
1457
- kind: z3.literal("skipped"),
1458
- reason: z3.literal("detached-head")
1459
- }),
1460
- z3.object({
1461
- /** It didn't save: the scrub or the save failed. */
1462
- kind: z3.literal("failed"),
1463
- step: z3.enum(["scrub", "save-snapshot"]),
1464
- message: z3.string()
1465
- }),
1466
- z3.object({
1467
- /** It didn't save, or recorded nothing: a signal stopped it. */
1468
- kind: z3.literal("stopped")
1469
- })
1470
- ]);
1471
- var whereSchema = z3.discriminatedUnion("kind", [
1472
- z3.object({ kind: z3.literal("unsandboxed") }),
1473
- z3.object({
1474
- kind: z3.literal("runner"),
1475
- team: z3.string(),
1476
- project: z3.string(),
1477
- region: z3.string(),
1478
- runtime: z3.string(),
1479
- vcpus: z3.number().int().positive(),
1480
- base: z3.string(),
1481
- baseRef: z3.string(),
1482
- sandbox: z3.string().nullable(),
1483
- snapshot: snapshotSchema.nullable(),
1484
- keptUntil: z3.string().nullable(),
1485
- save: saveSchema.nullable()
1486
- })
1487
- ]);
1488
- var gitSchema = z3.object({ branch: z3.string().nullable(), commit: z3.string(), dirty: z3.boolean() });
1489
- var runRecordSchema = z3.object({
1490
- version: z3.literal(3),
1491
- startedAt: z3.string(),
1492
- cwd: z3.string(),
1493
- configFile: z3.string().nullable(),
1494
- argv: z3.array(z3.string()).readonly(),
1495
- // Only a `storm vitest` run has one.
1496
- plan: planSchema.exactOptional(),
1497
- where: whereSchema,
1498
- git: gitSchema.nullable(),
1499
- ended: endedSchema.exactOptional()
1500
- });
1501
- function runRecordText(record) {
1502
- return JSON.stringify(record);
1503
- }
1504
- function parseRunRecord(text) {
1505
- if (text === void 0) return void 0;
1506
- let json;
1507
- try {
1508
- json = JSON.parse(text);
1509
- } catch {
1510
- return void 0;
1511
- }
1512
- const parsed = runRecordSchema.safeParse(json);
1513
- return parsed.success ? parsed.data : void 0;
1514
- }
1515
- function testTotals(events) {
1516
- let passed = 0;
1517
- let failed = 0;
1518
- let skipped = 0;
1519
- let any = false;
1520
- for (const event of events) {
1521
- if (event.kind !== "test-result") continue;
1522
- any = true;
1523
- if (event.state === "pass") passed += 1;
1524
- else if (event.state === "fail") failed += 1;
1525
- else skipped += 1;
1526
- }
1527
- return any ? { passed, failed, skipped } : null;
1528
- }
1529
- function runEnd(outcome, ran, tests, reports) {
1530
- const command = outcome.kind === "ran" ? outcome.command : void 0;
1531
- const ranRecords = outcome.kind === "ran" ? outcome.resources : void 0;
1532
- const ms = ran?.outcome === void 0 || ran.outcome === "stopped" || ran.endedAt === void 0 ? null : ran.endedAt - ran.startedAt;
1533
- return {
1534
- outcome: outcome.kind,
1535
- exitCode: command === void 0 ? null : commandExitStatus(command),
1536
- signal: command?.kind === "signaled" ? command.signal : null,
1537
- ms,
1538
- tests: testTotals(tests.events),
1539
- testsIncomplete: tests.incomplete ?? null,
1540
- resources: ranRecords === void 0 ? null : reports.ranFacts(ranRecords),
1541
- resourceRows: ranRecords === void 0 ? [] : reports.ranRows(ranRecords)
1542
- };
1543
- }
1544
- function startedWhere(run) {
1545
- if (run.runner === void 0) return { kind: "unsandboxed" };
1546
- const { prepared, target } = run.runner;
1547
- return {
1548
- kind: "runner",
1549
- team: target.team,
1550
- project: target.project,
1551
- region: prepared.recipe.region,
1552
- runtime: prepared.recipe.runtime,
1553
- vcpus: prepared.vcpus,
1554
- base: prepared.base,
1555
- baseRef: prepared.baseRef,
1556
- sandbox: null,
1557
- snapshot: null,
1558
- keptUntil: null,
1559
- save: null
1560
- };
1561
- }
1562
- function endedWhere(where, runner, save) {
1563
- if (where.kind === "unsandboxed") return where;
1564
- const snapshot = runner?.snapshot;
1565
- return {
1566
- ...where,
1567
- sandbox: runner?.sandbox?.name ?? null,
1568
- snapshot: snapshot === void 0 || snapshot.kind === "building" ? null : {
1569
- id: snapshot.id,
1570
- base: snapshot.base,
1571
- built: snapshot.kind === "built",
1572
- branch: snapshot.branch,
1573
- head: snapshot.head
1574
- },
1575
- keptUntil: runner?.kept?.stopsAt ?? null,
1576
- save
1577
- };
1578
- }
1579
-
1580
- // src/run-directory/timeline-facts.ts
1581
- import { z as z4 } from "zod";
1582
- var rowRefShape = {
1583
- /** The row's name: `mint`, a resource lane's name, `runner`, `tests` or `cleanup`. */
1584
- name: z4.string(),
1585
- /** For a resource instance's lane, the resource key; null for every other row. */
1586
- resource: z4.string().nullable()
1587
- };
1588
- var timelineOutcomeSchema = z4.enum(["done", "failed", "stopped", "unfinished"]);
1589
- var timelineSchema = z4.object({
1590
- /** When the run started, as an ISO time. */
1591
- startedAt: z4.string(),
1592
- /** From the run's start to its last event. */
1593
- totalMs: z4.number(),
1594
- /**
1595
- * The lanes in order: mint, each resource instance's lane, runner, tests, cleanup; each only when the run got that
1596
- * far.
1597
- */
1598
- rows: z4.array(
1599
- z4.object({
1600
- ...rowRefShape,
1601
- /** The row's label, as the waterfall named it when the run ended, such as `credential` or `runner-setup`. */
1602
- label: z4.string(),
1603
- startMs: z4.number(),
1604
- endMs: z4.number(),
1605
- outcome: timelineOutcomeSchema,
1606
- /** The lane's steps: a resource lane's, as its presentation named them, and the runner's snapshot, start, upload, apply, install and build. */
1607
- steps: z4.array(
1608
- z4.object({
1609
- name: z4.string(),
1610
- startMs: z4.number(),
1611
- endMs: z4.number(),
1612
- outcome: timelineOutcomeSchema
1613
- })
1614
- ),
1615
- /** How long the lane, once ready, waited for the other before the command started. */
1616
- idleMs: z4.number(),
1617
- /** The runner lane's: whether it reused or built its runner snapshot. */
1618
- snapshot: z4.enum(["reused", "built"]).optional(),
1619
- /** A resource lane's that counts them: how many of the things it holds it reused, and how many it created. */
1620
- sandboxes: z4.object({ reused: z4.number(), created: z4.number() }).optional()
1621
- })
1622
- ),
1623
- /** The lanes the command waited on, then the command, each by its row; empty when the command didn't start. */
1624
- criticalPath: z4.array(z4.object(rowRefShape))
1625
- });
1626
- function timelineFacts(timeline2, laneKinds) {
1627
- return {
1628
- startedAt: timeline2.startedAt,
1629
- totalMs: timeline2.totalMs,
1630
- rows: timeline2.rows.map((row) => ({
1631
- ...row,
1632
- label: laneLabel(row.name, laneKinds),
1633
- steps: row.steps.map((step) => ({ ...step }))
1634
- })),
1635
- criticalPath: timeline2.criticalPath.map((step) => ({ ...step }))
1636
- };
1637
- }
1638
- function laneLabel(name, laneKinds) {
1639
- if (name === "mint") return "credential";
1640
- if (name === "runner") return "runner-setup";
1641
- return laneKinds.find(({ lane }) => lane === name)?.label ?? name;
1642
- }
1643
-
1644
- // src/run-directory/reader.ts
1645
- function pastRuns(gateway) {
1646
- return {
1647
- list: async (request) => {
1648
- const listed = await gateway.list(request);
1649
- return listed.ok ? { ok: true, runs: listed.runs.map(listedRun) } : listed;
1650
- },
1651
- read: async (request) => {
1652
- const read2 = await gateway.read(request);
1653
- return read2.kind === "found" ? { kind: "found", run: pastRun(read2.directory) } : read2;
1654
- },
1655
- readLog: async (request) => await gateway.readLog(request)
1656
- };
1657
- }
1658
- function listedRun({ id, path, active, run }) {
1659
- return { id, path, active, record: parseRunRecord(run) };
1660
- }
1661
- function pastRun(directory) {
1662
- const parsed = (directory.tests ?? []).map(parseTestEvent);
1663
- return {
1664
- ...listedRun(directory),
1665
- finished: directory.tests !== void 0,
1666
- events: parsed.filter((event) => event !== void 0),
1667
- unreadableTestLines: parsed.filter((event) => event === void 0).length,
1668
- timeline: parseTimeline(directory.timeline),
1669
- logs: directory.logs.map((log) => ({ log, path: `${directory.path}/${runLogFile(log)}` }))
1670
- };
1671
- }
1672
- function parseTimeline(text) {
1673
- if (text === void 0) return void 0;
1674
- let json;
1675
- try {
1676
- json = JSON.parse(text);
1677
- } catch {
1678
- return void 0;
1679
- }
1680
- const parsed = timelineSchema.safeParse(json);
1681
- return parsed.success ? parsed.data : void 0;
1682
- }
1683
-
1684
- // src/run-directory/live/run-directory-gateway.ts
1685
- import { randomBytes } from "node:crypto";
1686
- import { createReadStream, createWriteStream } from "node:fs";
1687
- import { mkdir, readdir, readFile, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
1688
- import { hostname as osHostname } from "node:os";
1689
- import { join as join3 } from "node:path";
1690
- import { z as z5 } from "zod";
1691
- var DIRECTORY_MODE = 448;
1692
- var FILE_MODE = 384;
1693
- var ACTIVE_MARKER_TRUST_MS = 24 * 60 * 60 * 1e3;
1694
- var LIST_BATCH = 32;
1695
- function liveRunDirectoryGateway(options) {
1696
- const holders = {
1697
- self: options.holder ?? { pid: process.pid, hostname: osHostname() },
1698
- isAlive: options.isAlive ?? isAlive
1699
- };
1700
- return {
1701
- open: (request) => open(options.directory, holders, request),
1702
- list: (request) => list(options.directory, holders, request.now),
1703
- read: (request) => read(options.directory, holders, request),
1704
- readLog: (request) => readLog(options.directory, request)
1705
- };
1706
- }
1707
- function unavailableRunDirectoryGateway(location, reason) {
1708
- const failure = () => ({ path: location, message: reason });
1709
- return {
1710
- open: async () => ({ ok: false, failure: failure() }),
1711
- list: async () => ({ ok: false, failure: failure() }),
1712
- read: async () => ({ kind: "failed", failure: failure() }),
1713
- readLog: async () => ({ kind: "failed", failure: failure() })
1714
- };
1715
- }
1716
- var markerSchema = z5.object({
1717
- pid: z5.number().int().positive(),
1718
- hostname: z5.string().min(1),
1719
- startedAt: z5.iso.datetime()
1720
- });
1721
- async function open(root, holders, request) {
1722
- const id = `${runIdPrefix(request.startedAt)}-${randomBytes(2).toString("hex")}`;
1723
- const path = join3(root, id);
1724
- const opening = join3(root, `.opening-${id}-${randomBytes(4).toString("hex")}`);
1725
- try {
1726
- await mkdir(root, { recursive: true, mode: DIRECTORY_MODE });
1727
- await mkdir(opening, { mode: DIRECTORY_MODE });
1728
- const marker = { ...holders.self, startedAt: request.startedAt.toISOString() };
1729
- await writeFile(join3(opening, ACTIVE_MARKER), `${JSON.stringify(marker)}
1730
- `, { mode: FILE_MODE, flag: "wx" });
1731
- await writeFile(join3(opening, RUN_FILE), `${request.run}
1732
- `, { mode: FILE_MODE, flag: "wx" });
1733
- await rename(opening, path);
1734
- } catch (error) {
1735
- await rm(opening, { recursive: true, force: true }).catch(() => void 0);
1736
- return { ok: false, failure: { path, message: messageOf(error) } };
1737
- }
1738
- return {
1739
- ok: true,
1740
- directory: runDirectory(path, id),
1741
- pruneFailures: await prune(root, request.keep, holders, request.startedAt)
1742
- };
1743
- }
1744
- async function prune(root, keep, holders, now) {
1745
- let names;
1746
- try {
1747
- names = (await readdir(root)).filter((name) => RUN_ID_PATTERN.test(name));
1748
- } catch (error) {
1749
- return [{ path: root, message: messageOf(error) }];
1750
- }
1751
- const completed = [];
1752
- for (const name of names) if (!await isActive(join3(root, name), holders, now)) completed.push(name);
1753
- const failures = [];
1754
- const newestFirst = completed.toSorted().toReversed();
1755
- for (const name of newestFirst.slice(keep)) {
1756
- const path = join3(root, name);
1757
- try {
1758
- await rm(path, { recursive: true, force: true });
1759
- } catch (error) {
1760
- failures.push({ path, message: messageOf(error) });
1761
- }
1762
- }
1763
- const kept = newestFirst.slice(0, keep);
1764
- const leftovers = kept.flatMap(
1765
- (name) => [TEST_EVENTS_STAGING_FILE, TESTS_PARTIAL_FILE].map((file) => join3(root, name, file))
1766
- );
1767
- for (let start = 0; start < leftovers.length; start += LIST_BATCH) {
1768
- const removed = await Promise.all(
1769
- leftovers.slice(start, start + LIST_BATCH).map(async (file) => {
1770
- try {
1771
- await rm(file, { force: true });
1772
- return [];
1773
- } catch (error) {
1774
- return [{ path: file, message: messageOf(error) }];
1775
- }
1776
- })
1777
- );
1778
- failures.push(...removed.flat());
1779
- }
1780
- return failures;
1781
- }
1782
- async function list(root, holders, now) {
1783
- let names;
1784
- try {
1785
- names = (await readdir(root)).filter((name) => RUN_ID_PATTERN.test(name));
1786
- } catch (error) {
1787
- if (errorCode(error) === "ENOENT") return { ok: true, runs: [] };
1788
- return { ok: false, failure: { path: root, message: messageOf(error) } };
1789
- }
1790
- const ordered = names.toSorted().toReversed();
1791
- const runs = [];
1792
- for (let start = 0; start < ordered.length; start += LIST_BATCH) {
1793
- runs.push(
1794
- ...await Promise.all(
1795
- ordered.slice(start, start + LIST_BATCH).map(async (id) => {
1796
- const path = join3(root, id);
1797
- const run = await readOptional(join3(path, RUN_FILE));
1798
- return {
1799
- id,
1800
- path,
1801
- active: await isActive(path, holders, now),
1802
- run: run.kind === "found" ? run.text : void 0
1803
- };
1804
- })
1805
- )
1806
- );
1807
- }
1808
- return { ok: true, runs };
1809
- }
1810
- async function read(root, holders, request) {
1811
- if (!RUN_ID_PATTERN.test(request.id)) return { kind: "not-found" };
1812
- const path = join3(root, request.id);
1813
- try {
1814
- if (!(await stat(path)).isDirectory()) return { kind: "not-found" };
1815
- } catch (error) {
1816
- if (errorCode(error) === "ENOENT") return { kind: "not-found" };
1817
- return { kind: "failed", failure: { path, message: messageOf(error) } };
1818
- }
1819
- const [run, tests, timeline2] = await Promise.all(
1820
- [RUN_FILE, TESTS_FILE, TIMELINE_FILE].map((name) => readOptional(join3(path, name)))
1821
- );
1822
- for (const file of [run, tests, timeline2])
1823
- if (file?.kind === "failed") return { kind: "failed", failure: file.failure };
1824
- const text = (file) => file?.kind === "found" ? file.text : void 0;
1825
- const testsText = text(tests);
1826
- const held = await Promise.all(RUN_LOGS.map(async (log) => await exists(join3(path, runLogFile(log))) ? log : []));
1827
- return {
1828
- kind: "found",
1829
- directory: {
1830
- id: request.id,
1831
- path,
1832
- active: await isActive(path, holders, request.now),
1833
- run: text(run),
1834
- tests: testsText === void 0 ? void 0 : testsText.split("\n").filter((line) => line !== ""),
1835
- timeline: text(timeline2),
1836
- logs: held.flat()
1837
- }
1838
- };
1839
- }
1840
- async function exists(file) {
1841
- try {
1842
- await stat(file);
1843
- return true;
1844
- } catch {
1845
- return false;
1846
- }
1847
- }
1848
- async function readLog(root, request) {
1849
- if (!RUN_ID_PATTERN.test(request.id)) return { kind: "not-found" };
1850
- const file = join3(root, request.id, runLogFile(request.log));
1851
- try {
1852
- return { kind: "found", path: file, text: completeUtf8(await readFile(file)).toString("utf8") };
1853
- } catch (error) {
1854
- if (errorCode(error) === "ENOENT") return { kind: "not-found" };
1855
- return { kind: "failed", failure: { path: file, message: messageOf(error) } };
1856
- }
1857
- }
1858
- function completeUtf8(bytes) {
1859
- for (let back = 1; back <= Math.min(3, bytes.length); back += 1) {
1860
- const byte = bytes[bytes.length - back] ?? 0;
1861
- if ((byte & 192) === 128) continue;
1862
- const needs = byte >= 240 ? 4 : byte >= 224 ? 3 : byte >= 192 ? 2 : 1;
1863
- return needs > back ? bytes.subarray(0, bytes.length - back) : bytes;
1864
- }
1865
- return bytes;
1866
- }
1867
- async function readOptional(file) {
1868
- try {
1869
- return { kind: "found", text: await readFile(file, "utf8") };
1870
- } catch (error) {
1871
- if (errorCode(error) === "ENOENT") return { kind: "missing" };
1872
- return { kind: "failed", failure: { path: file, message: messageOf(error) } };
1873
- }
1874
- }
1875
- async function isActive(path, holders, now) {
1876
- const file = join3(path, ACTIVE_MARKER);
1877
- let text;
1878
- try {
1879
- text = await readFile(file, "utf8");
1880
- } catch (error) {
1881
- if (errorCode(error) === "ENOENT") return false;
1882
- return trustedSince(file, now);
1883
- }
1884
- const parsed = markerSchema.safeParse(parseJson(text));
1885
- if (!parsed.success) return trustedSince(file, now);
1886
- const { pid, hostname, startedAt } = parsed.data;
1887
- if (hostname === holders.self.hostname) return holders.isAlive(pid);
1888
- return now.getTime() - Date.parse(startedAt) < ACTIVE_MARKER_TRUST_MS;
1889
- }
1890
- async function trustedSince(file, now) {
1891
- try {
1892
- return now.getTime() - (await stat(file)).mtime.getTime() < ACTIVE_MARKER_TRUST_MS;
1893
- } catch {
1894
- return false;
1895
- }
1896
- }
1897
- function parseJson(text) {
1898
- try {
1899
- return JSON.parse(text);
1900
- } catch {
1901
- return void 0;
1902
- }
1903
- }
1904
- function isAlive(pid) {
1905
- try {
1906
- process.kill(pid, 0);
1907
- return true;
1908
- } catch (error) {
1909
- return errorCode(error) !== "ESRCH";
1910
- }
1911
- }
1912
- function errorCode(error) {
1913
- return error instanceof Error && "code" in error && typeof error.code === "string" ? error.code : void 0;
1914
- }
1915
- function runDirectory(path, id) {
1916
- const streams = /* @__PURE__ */ new Map();
1917
- let failure;
1918
- let closed = false;
1919
- let testsPublished = false;
1920
- let changing = Promise.resolve();
1921
- const inTurn = (file, change) => {
1922
- if (failure !== void 0 || closed) return;
1923
- changing = changing.then(async () => {
1924
- if (failure !== void 0) return;
1925
- try {
1926
- await change();
1927
- } catch (error) {
1928
- failure ??= { path: file, message: messageOf(error) };
1929
- }
1930
- });
1931
- };
1932
- const replace = (name, text) => {
1933
- const file = join3(path, name);
1934
- inTurn(file, async () => {
1935
- const temporary = join3(path, `.${name}.${randomBytes(4).toString("hex")}.tmp`);
1936
- try {
1937
- await writeFile(temporary, text, { mode: FILE_MODE, flag: "wx" });
1938
- await rename(temporary, file);
1939
- } catch (error) {
1940
- await rm(temporary, { force: true }).catch(() => void 0);
1941
- throw error;
1942
- }
1943
- });
1944
- };
1945
- const stream = (name) => {
1946
- if (failure !== void 0 || closed) return void 0;
1947
- let opened = streams.get(name);
1948
- if (opened === void 0) {
1949
- const file = join3(path, name);
1950
- opened = createWriteStream(file, { flags: "a", mode: FILE_MODE });
1951
- opened.on("error", (error) => {
1952
- failure ??= { path: file, message: messageOf(error) };
1953
- });
1954
- streams.set(name, opened);
1955
- }
1956
- return opened;
1957
- };
1958
- const append = (name, text) => void stream(name)?.write(text);
1959
- const endStream = async (name) => {
1960
- const opened = streams.get(name);
1961
- if (opened === void 0) return;
1962
- streams.delete(name);
1963
- await ended(opened);
1964
- };
1965
- return {
1966
- path,
1967
- id,
1968
- writeRun: (text) => replace(RUN_FILE, `${text}
1969
- `),
1970
- appendEvent: (line) => append(EVENTS_FILE, `${line}
1971
- `),
1972
- appendStepOutput: (step, line) => append(runLogFile(step), `${line}
1973
- `),
1974
- appendCommandOutput: (text) => append(COMMAND_LOG, text),
1975
- appendTestEvent: (line) => {
1976
- if (!testsPublished) append(TESTS_PARTIAL_FILE, `${line}
1977
- `);
1978
- },
1979
- publishTestEvents: () => {
1980
- if (testsPublished) return;
1981
- testsPublished = true;
1982
- const partial = join3(path, TESTS_PARTIAL_FILE);
1983
- inTurn(join3(path, TESTS_FILE), async () => {
1984
- await endStream(TESTS_PARTIAL_FILE);
1985
- if (failure !== void 0) return;
1986
- await writeFile(partial, "", { mode: FILE_MODE, flag: "a" });
1987
- await rename(partial, join3(path, TESTS_FILE));
1988
- });
1989
- },
1990
- writeTimeline: (text) => replace(TIMELINE_FILE, `${text}
1991
- `),
1992
- readTestEvents: (onLine) => readStagedTestEvents(join3(path, TEST_EVENTS_STAGING_FILE), onLine),
1993
- close: async () => {
1994
- closed = true;
1995
- await changing;
1996
- await Promise.all([...streams.values()].map(ended));
1997
- streams.clear();
1998
- for (const name of [TEST_EVENTS_STAGING_FILE, TESTS_PARTIAL_FILE]) {
1999
- const file = join3(path, name);
2000
- try {
2001
- await rm(file, { force: true });
2002
- } catch (error) {
2003
- failure ??= { path: file, message: messageOf(error) };
2004
- }
2005
- }
2006
- const marker = join3(path, ACTIVE_MARKER);
2007
- try {
2008
- await unlink(marker);
2009
- } catch (error) {
2010
- failure ??= { path: marker, message: messageOf(error) };
2011
- }
2012
- return failure;
2013
- }
2014
- };
2015
- }
2016
- function ended(stream) {
2017
- return new Promise((resolve) => {
2018
- if (stream.closed || stream.destroyed) resolve();
2019
- else {
2020
- stream.once("close", () => resolve());
2021
- stream.end();
2022
- }
2023
- });
2024
- }
2025
- async function readStagedTestEvents(file, onLine) {
2026
- let pending = "";
2027
- try {
2028
- for await (const chunk of createReadStream(file, { encoding: "utf8" })) {
2029
- const lines = `${pending}${String(chunk)}`.split("\n");
2030
- pending = lines.pop() ?? "";
2031
- for (const line of lines) if (line !== "") onLine(line);
2032
- }
2033
- if (pending !== "") onLine(pending);
2034
- return { ok: true };
2035
- } catch (error) {
2036
- if (errorCode(error) === "ENOENT") return { ok: true };
2037
- return { ok: false, failure: { path: file, message: messageOf(error) } };
2038
- }
2039
- }
2040
- function messageOf(error) {
2041
- return error instanceof Error ? error.message : String(error);
2042
- }
2043
-
2044
- // src/run-directory/run-collector.ts
2045
- function runCollector(registry, directory) {
2046
- let state = EMPTY_RUN_STATE;
2047
- const events = [];
2048
- let unreadable = 0;
2049
- let incomplete;
2050
- let workerOffsetMs = Infinity;
2051
- const collect = (event) => {
2052
- directory?.appendTestEvent(testEventLine(event));
2053
- events.push(summaryEvent(event));
2054
- };
2055
- return {
2056
- observer: {
2057
- observe: async (timed) => {
2058
- const { event } = timed;
2059
- if (event.kind === "runner" && event.event.kind === "step-output") return;
2060
- state = registry.applyEvent(state, timed);
2061
- if (event.kind === "test") {
2062
- collect(event.event);
2063
- if (event.event.kind !== "test-result")
2064
- workerOffsetMs = Math.min(workerOffsetMs, timed.at.getTime() - event.event.at);
2065
- } else if (event.kind === "test-event-unreadable") unreadable += 1;
2066
- else if (event.kind === "test-events-incomplete") incomplete ??= event.message;
2067
- }
2068
- },
2069
- readStaged: async (runDirectory2, redact) => {
2070
- const read2 = await runDirectory2.readTestEvents((line) => {
2071
- const event = parseTestEvent(line);
2072
- if (event === void 0) unreadable += 1;
2073
- else collect(redact(event));
2074
- });
2075
- if (!read2.ok) incomplete ??= read2.failure.message;
2076
- },
2077
- finish: () => ({
2078
- state,
2079
- tests: { events, unreadable, incomplete },
2080
- workerOffsetMs: workerOffsetMs === Infinity ? 0 : workerOffsetMs
2081
- })
2082
- };
2083
- }
2084
- function summaryEvent(event) {
2085
- if (event.kind !== "test-result") return event;
2086
- return {
2087
- kind: event.kind,
2088
- id: event.id,
2089
- file: event.file,
2090
- test: event.test,
2091
- state: event.state,
2092
- retryCount: event.retryCount,
2093
- flaky: event.flaky,
2094
- at: event.at
2095
- };
2096
- }
2097
-
2098
- // src/run-directory/recording.ts
2099
- async function recordRun(gateway, start) {
2100
- const { registry } = start;
2101
- const record = start.redact({
2102
- version: 3,
2103
- startedAt: start.startedAt.toISOString(),
2104
- cwd: start.cwd,
2105
- configFile: start.configFile,
2106
- argv: start.argv,
2107
- ...start.plan === void 0 ? {} : { plan: start.plan },
2108
- where: startedWhere(start.run),
2109
- git: start.git
2110
- });
2111
- const result = await gateway.open({
2112
- startedAt: start.startedAt,
2113
- keep: RUN_DIRECTORIES_KEPT,
2114
- run: runRecordText(record)
2115
- });
2116
- const directory = result.ok ? result.directory : void 0;
2117
- const opened = result.ok ? { ok: true, id: result.directory.id, path: result.directory.path, pruneFailures: result.pruneFailures } : { ok: false, failure: result.failure };
2118
- const collector = runCollector(registry, directory);
2119
- return {
2120
- opened,
2121
- testEvents: directory === void 0 ? void 0 : testEventsPath(directory.path),
2122
- observer: (beside) => directory === void 0 ? observeAll(collector.observer, beside) : observeAll(collector.observer, beside, runDirectoryObserver(directory)),
2123
- terminal: (terminal) => directory === void 0 ? terminal : {
2124
- color: terminal.color,
2125
- writeStdout: (text) => {
2126
- directory.appendCommandOutput(text);
2127
- terminal.writeStdout(text);
2128
- },
2129
- writeStderr: (text) => {
2130
- directory.appendCommandOutput(text);
2131
- terminal.writeStderr(text);
2132
- }
2133
- },
2134
- stepLog: (step) => directory === void 0 ? void 0 : stepLog(directory.path, step),
2135
- end: async (outcome) => {
2136
- if (directory !== void 0) await collector.readStaged(directory, start.redact);
2137
- const { state, tests, workerOffsetMs } = collector.finish();
2138
- const timeline2 = timelineFacts(registry.timeline(state), registry.presentations.laneKinds);
2139
- directory?.publishTestEvents();
2140
- directory?.writeTimeline(JSON.stringify(timeline2, null, 2));
2141
- directory?.writeRun(
2142
- runRecordText({
2143
- ...record,
2144
- where: endedWhere(record.where, state.runner, outcome.kind === "ran" ? outcome.runner?.save ?? null : null),
2145
- ended: runEnd(outcome, state.command, tests, registry.reports)
2146
- })
2147
- );
2148
- const writeFailure = await directory?.close();
2149
- return { state, timeline: timeline2, tests, workerOffsetMs, writeFailure };
2150
- },
2151
- abandon: async () => {
2152
- await directory?.close();
2153
- }
2154
- };
2155
- }
2156
-
2157
1405
  export {
2158
1406
  warningTally,
2159
1407
  stateDirectoryPattern,
@@ -2162,23 +1410,20 @@ export {
2162
1410
  secondsText,
2163
1411
  megabytesText,
2164
1412
  commandExitStatus,
1413
+ setupPhaseKey,
1414
+ setupPhaseWords,
2165
1415
  EMPTY_RUN_STATE,
2166
1416
  cleanupProblems,
2167
1417
  sameRow,
2168
- resourceRegistry,
1418
+ resourceDefinitionSet,
2169
1419
  resourcesOf,
1420
+ driversOf,
1421
+ driverContexts,
2170
1422
  timedProgress,
1423
+ observeAll,
2171
1424
  liveCommandGateway,
2172
- liveTerminalCommandGateway,
2173
1425
  liveJobSummaryGateway,
2174
1426
  liveProgressTerminal,
2175
- executeRun,
2176
- RUNS_SUBPATH,
2177
- liveRunDirectoryGateway,
2178
- unavailableRunDirectoryGateway,
2179
- planSchema,
2180
- saveSchema,
2181
- timelineSchema,
2182
- recordRun,
2183
- pastRuns
1427
+ livePackageBinGateway,
1428
+ executeRun
2184
1429
  };