@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
@@ -3,7 +3,7 @@ export { type CommandMetadata, type CommandTree, commandTree, defineOutcomes, re
3
3
  /**
4
4
  * What an extension's author declares of its commands: its command tree, whose commands take `App`, the tree's own app;
5
5
  * `app`, which projects it from `LauncherApp`, what the mount reads of the launcher's app; the help header of the group
6
- * storm mounts it as; and the tree's directory. The path of that group is the registry's (`src/extension-commands.ts`),
6
+ * storm mounts it as; and the tree's directory. The path of that group is the launcher's (`src/extension-commands.ts`),
7
7
  * not the extension's.
8
8
  */
9
9
  export interface ExtensionCommandsDefinition<LauncherApp, App> {
@@ -16,24 +16,28 @@ export interface ExtensionCommandsDefinition<LauncherApp, App> {
16
16
  */
17
17
  readonly directory: string;
18
18
  /**
19
- * The tree's app, from the launcher's: what its commands use of it, such as the extension's resources' worlds and the
20
- * launcher resolvers. Clinkr calls it when a command of the tree runs, so help never calls it.
19
+ * The tree's app, from the launcher's: what its commands use of it, such as the extension's resources' Contexts and
20
+ * the launcher resolvers. Clinkr calls it when a command of the tree runs, so help never calls it.
21
21
  */
22
22
  readonly app: (launcherApp: LauncherApp) => App;
23
23
  }
24
24
  /**
25
25
  * An extension's commands, as `defineExtensionCommands` returns them: the definition but for its tree and its
26
26
  * projection, and `mount`, which mounts the tree's directory group, its directory under the code root the launcher
27
- * gives, at the path the launcher gives, with the extension's description and the projection. A launcher that types its
28
- * mounts with its own app compiles only while that app is a `LauncherApp`.
27
+ * gives, at the path the launcher gives, with the extension's description and the projection. A launcher that types
28
+ * its mounts with its own app compiles only while that app is a `LauncherApp`.
29
29
  */
30
30
  export interface ExtensionCommands<LauncherApp> {
31
31
  readonly description: string;
32
32
  readonly directory: string;
33
- readonly mount: (placement: {
34
- readonly path: readonly string[];
35
- readonly root: string;
36
- }) => Mount<LauncherApp>;
33
+ readonly mount: (placement: ExtensionCommandsPlacement) => Mount<LauncherApp>;
34
+ }
35
+ /** Where the launcher mounts an extension's commands: the launcher's choice, never the extension's. */
36
+ export interface ExtensionCommandsPlacement {
37
+ /** Where the tree's commands sit in `storm`, such as `["ext", "<name>"]`. */
38
+ readonly path: readonly string[];
39
+ /** Storm's code root (`src/` or `dist/`), which the tree's directory is under. */
40
+ readonly root: string;
37
41
  }
38
42
  /** Declares an extension's commands. Only this function calls Clinkr's `mount`, since it knows the tree's app type. */
39
43
  export declare function defineExtensionCommands<LauncherApp, App>(definition: ExtensionCommandsDefinition<LauncherApp, App>): ExtensionCommands<LauncherApp>;
@@ -42,28 +46,42 @@ interface ClinkrExample {
42
46
  readonly argv: string;
43
47
  readonly description?: string;
44
48
  }
45
- /** The run examples an extension brings to `exec`'s and `vitest`'s help, which each lists after its own. */
49
+ /**
50
+ * The run examples an extension brings to the run commands' help, which each lists after its own: those for
51
+ * `storm exec`, which has no driver, and those for each driver's command, by the driver's name
52
+ * (`Driver.name`). A name is a plain string, with no import behind it: examples under a name no driver in the
53
+ * registry has show in no help.
54
+ */
46
55
  export interface RunExamples {
47
56
  readonly exec: readonly ClinkrExample[];
48
- readonly vitest: readonly ClinkrExample[];
57
+ readonly drivers: {
58
+ readonly [driver: string]: readonly ClinkrExample[];
59
+ };
49
60
  }
50
61
  /** What an extension reads of each resource it brings: its definition's name. */
51
62
  interface NamedResource {
52
63
  readonly name: string;
53
64
  }
65
+ /** What an extension reads of each driver it brings: its name. */
66
+ interface NamedDriver {
67
+ readonly name: string;
68
+ }
54
69
  /**
55
- * Extension `Name`, with its resources, in order, each as its `defineResource` returned it; when it has commands, its
56
- * commands (from `defineExtensionCommands`, in its light `command-tree.ts`), whose tree's commands take `LauncherApp`;
57
- * and when it has any, the run examples its resources' flags bring to `exec`'s and `vitest`'s help (`RunExamples`).
70
+ * Extension `Name`, with its resources, in order, each as its `defineResource` returned it; when it brings any, its
71
+ * drivers, in order, each as its `defineDriver` returned it; when it has commands, its commands (from
72
+ * `defineExtensionCommands`, in its light `command-tree.ts`), whose tree's commands take `LauncherApp`; and when it has
73
+ * any, the run examples its resources' flags bring to the run commands' help (`RunExamples`).
58
74
  */
59
- export interface Extension<Name extends string, Resources extends readonly NamedResource[], LauncherApp> {
75
+ export interface Extension<Name extends string, Resources extends readonly NamedResource[], LauncherApp, Drivers extends readonly NamedDriver[] = readonly []> {
60
76
  readonly name: Name;
61
77
  readonly resources: Resources;
78
+ readonly drivers?: Drivers;
62
79
  readonly commands?: ExtensionCommands<LauncherApp>;
63
80
  readonly examples?: RunExamples;
64
81
  }
65
82
  /**
66
83
  * Declares an extension. Its name is one command word. Each of its resources comes from `defineResource`, and it may
67
- * have none, when it brings only commands. Where its commands go is the registry's choice (`src/extension-commands.ts`).
84
+ * have none, when it brings only commands or drivers. Each of its drivers comes from `defineDriver`. Where its commands
85
+ * go is the launcher's choice (`src/extension-commands.ts`).
68
86
  */
69
- export declare function defineExtension<const Name extends string, const Resources extends readonly NamedResource[], LauncherApp = unknown>(extension: Extension<Name, Resources, LauncherApp>): Extension<Name, Resources, LauncherApp>;
87
+ export declare function defineExtension<const Name extends string, const Resources extends readonly NamedResource[], LauncherApp = unknown, const Drivers extends readonly NamedDriver[] = readonly []>(extension: Extension<Name, Resources, LauncherApp, Drivers>): Extension<Name, Resources, LauncherApp, Drivers>;
@@ -1,15 +1,16 @@
1
- // An extension as one value (`defineExtension`, `Extension`), its own command tree as storm mounts it, its run
2
- // examples (`RunExamples`), and what its commands are written with: the extension's light entry for its commands,
3
- // which loads only Clinkr. An extension's `extension.ts` joins its resources with its command tree and its run
1
+ // An extension as one value (`defineExtension`, `Extension`), its own command tree as storm mounts it, its run examples
2
+ // (`RunExamples`), and what its commands are written with: the extension's light entry for its commands, which loads
3
+ // only Clinkr. An extension's `extension.ts` joins its resources and its drivers with its command tree and its run
4
4
  // examples here, so a published resource export, which loads only the resource, never reaches Clinkr. Its
5
5
  // `command-tree.ts` declares its commands with `defineExtensionCommands`, and `src/extension-commands.ts` mounts them
6
- // without loading the extension's resources, so help never loads the registry. The extension doesn't choose where its
7
- // commands go: `src/extension-commands.ts` gives each tree its path. The registry (`src/extensions.ts`) lists
8
- // the extensions and takes their resources in order, and `exec`'s and `vitest`'s help lists their run examples in that
9
- // order. Its commands declare their tree, metadata and outcomes with what this entry re-exports of Clinkr
10
- // (`commandTree`, `CommandMetadata`, `defineOutcomes`, `renderOutcome`, `Row`, `Warning`), so no extension folder
11
- // imports Clinkr itself. The re-exports reach no published export: only the registry and
12
- // `src/extension-commands.ts` load a command tree. The module's run-time entry, `index.ts`, loads none of this.
6
+ // without loading the extension's resources, so help never loads the extension registry. The extension doesn't choose
7
+ // where its commands go: `src/extension-commands.ts` gives each tree its path. The extension registry
8
+ // (`src/extensions.ts`) lists the extensions and takes their resources and their drivers in order, and each run
9
+ // command's help lists their run examples for it in that order. Its commands declare their tree, metadata and outcomes
10
+ // with what this entry re-exports of Clinkr (`commandTree`, `CommandMetadata`, `defineOutcomes`, `renderOutcome`,
11
+ // `Row`, `Warning`), so no extension folder imports Clinkr itself. The re-exports reach no published export: only the
12
+ // extension registry and `src/extension-commands.ts` load a command tree. The module's run-time entry, `index.ts`,
13
+ // loads none of this.
13
14
  import { join } from "node:path";
14
15
  import { mount } from "@vercel/clinkr";
15
16
  export { commandTree, defineOutcomes, renderOutcome, } from "@vercel/clinkr";
@@ -24,7 +25,8 @@ export function defineExtensionCommands(definition) {
24
25
  }
25
26
  /**
26
27
  * Declares an extension. Its name is one command word. Each of its resources comes from `defineResource`, and it may
27
- * have none, when it brings only commands. Where its commands go is the registry's choice (`src/extension-commands.ts`).
28
+ * have none, when it brings only commands or drivers. Each of its drivers comes from `defineDriver`. Where its commands
29
+ * go is the launcher's choice (`src/extension-commands.ts`).
28
30
  */
29
31
  export function defineExtension(extension) {
30
32
  return extension;
@@ -0,0 +1,143 @@
1
+ /** A driver's words in its command's leaf help. */
2
+ export interface DriverHelp {
3
+ /** The usage after the flags every run takes, such as `[<vitest run args>...] [-- <vitest dash options>...]`. */
4
+ readonly usage: string;
5
+ /** What the driver's arguments are and where they go: their request field's description. */
6
+ readonly args: string;
7
+ /**
8
+ * What `verbose` in the run payload does under the driver's program, which ends the description of the run flag
9
+ * `--verbose`: a clause that follows `… and verbose in the run payload, `, without its full stop, such as
10
+ * `which has its reporters print each test as it finishes`.
11
+ */
12
+ readonly verbose: string;
13
+ /** The driver's own examples, which its command lists before the run examples the extensions bring. */
14
+ readonly examples: readonly {
15
+ readonly argv: string;
16
+ readonly description: string;
17
+ }[];
18
+ }
19
+ /** What a run's summary says to do next, in words that name the driver's program. */
20
+ export interface DriverHints {
21
+ /**
22
+ * What to do about a run whose tests reported no final result, such as how to list storm's reporter in the program's
23
+ * config. The summary's tests line says it after `no final test results: `.
24
+ */
25
+ readonly noFinalResults: string;
26
+ }
27
+ /** What a driver's plan step works from. */
28
+ export interface DriverPlanRequest {
29
+ /** The driver's arguments, which the command gets too. */
30
+ readonly args: readonly string[];
31
+ /** The directory on this machine the program runs in to say what it would run. */
32
+ readonly cwd: string;
33
+ /** The program's binary to start there: the path of the one the launcher found. */
34
+ readonly bin: string;
35
+ /** Aborts once the invocation is signaled: the plan step stops what it started and answers `canceled`. */
36
+ readonly signal: AbortSignal;
37
+ }
38
+ /** How a plan step fails, which `driver_plan_failed` carries as `data.kind`. */
39
+ export declare const DRIVER_PLAN_FAILURE_KINDS: readonly ["start-failed", "timed-out", "exited", "unreadable-output"];
40
+ /**
41
+ * How a plan step fails: the program couldn't start (`start-failed`), didn't finish in the time the driver gives it
42
+ * (`timed-out`), exited other than 0 (`exited`), or answered something the driver can't read (`unreadable-output`).
43
+ */
44
+ export type DriverPlanFailureKind = (typeof DRIVER_PLAN_FAILURE_KINDS)[number];
45
+ /**
46
+ * What a plan step answers: the test plan, the tests the program would run and the files they are in, or why it
47
+ * couldn't say, already worded. `kind` is one of the ways it fails, or `canceled` when the request's signal stopped it,
48
+ * which cancels the run. `message` says what went wrong in the driver's words, with the timeout, the exit code or the
49
+ * signal that ended the program in it; `driver_plan_failed` carries it, and the launcher reads none for `canceled`.
50
+ */
51
+ export type DriverPlanAnswer = {
52
+ readonly ok: true;
53
+ readonly plan: {
54
+ readonly tests: number;
55
+ readonly files: number;
56
+ };
57
+ } | {
58
+ readonly ok: false;
59
+ readonly kind: DriverPlanFailureKind | "canceled";
60
+ readonly message: string;
61
+ };
62
+ /** Where a plan step ran and what it was given, which both refusals report. */
63
+ export interface DriverPlanned {
64
+ readonly args: readonly string[];
65
+ readonly cwd: string;
66
+ }
67
+ /**
68
+ * What a driver's two refusals say, in words that name its program. Each description is the error's own, which
69
+ * `--json-schema` shows.
70
+ */
71
+ export interface DriverRefusalWords {
72
+ /** `no_matching_tests`: the plan step ran and counted no test. */
73
+ readonly noMatchingTests: {
74
+ readonly description: string;
75
+ /** What went wrong. */
76
+ message(planned: DriverPlanned): string;
77
+ /** What to do next. */
78
+ next(planned: DriverPlanned): string;
79
+ };
80
+ /**
81
+ * `driver_plan_failed`: the program wasn't found, or the plan step failed. What went wrong is the plan step's
82
+ * `message` (`DriverPlanAnswer`), or the launcher's for a binary it didn't find.
83
+ */
84
+ readonly planFailed: {
85
+ readonly description: string;
86
+ /** What to do next, for each way the plan step fails. */
87
+ readonly next: {
88
+ readonly [Kind in DriverPlanFailureKind]: string;
89
+ };
90
+ };
91
+ }
92
+ /**
93
+ * Everything a driver's author writes of it with `defineDriver`:
94
+ *
95
+ * - `name`: its command's word, which `driver_plan_failed` and `no_matching_tests` carry as `data.driver`, and the
96
+ * name the launcher keeps its Context by.
97
+ * - `program`: its program, by the name of the binary the launcher looks for in `node_modules/.bin`.
98
+ * - `context`: its Context, what its plan step reaches the outside through, built live. Tests hand
99
+ * the plan step a Context over fakes.
100
+ * - `launch`: the argv that starts the program with `args`, such as `[bin, "run", ...args]`. `bin` is the path of the
101
+ * binary the launcher found, or the program's bare name where the runner's `PATH` finds it.
102
+ * - `plan`: its plan step, over its Context: asks the program what it would run with the request's arguments, without
103
+ * running it, and words its failure. The launcher calls it once, before anything is minted, acquired or started.
104
+ * - `help`: its part of its command's leaf help.
105
+ * - `hints`: what its run's summary says to do next.
106
+ * - `refusals`: what its two refusals say, beside the message its plan step answers.
107
+ */
108
+ export interface DriverSpec<Name extends string, Context> {
109
+ readonly name: Name;
110
+ readonly program: {
111
+ readonly bin: string;
112
+ };
113
+ readonly context: () => Context;
114
+ readonly launch: (bin: string, args: readonly string[]) => readonly string[];
115
+ readonly plan: (context: NoInfer<Context>) => (request: DriverPlanRequest) => Promise<DriverPlanAnswer>;
116
+ readonly help: DriverHelp;
117
+ readonly hints: DriverHints;
118
+ readonly refusals: DriverRefusalWords;
119
+ }
120
+ /**
121
+ * A driver, as `defineDriver` returns it: storm's knowledge of one program that the command starts, such as a test
122
+ * runner. Its name and its Context keep their types. With its type parameters' defaults it is any driver, which the
123
+ * registry's list holds: its plan step takes the Context as `unknown`.
124
+ */
125
+ export interface Driver<Name extends string = string, Context = unknown> {
126
+ readonly name: Name;
127
+ readonly program: {
128
+ readonly bin: string;
129
+ };
130
+ readonly context: () => Context;
131
+ readonly launch: (bin: string, args: readonly string[]) => readonly string[];
132
+ readonly plan: (context: unknown) => (request: DriverPlanRequest) => Promise<DriverPlanAnswer>;
133
+ readonly help: DriverHelp;
134
+ readonly hints: DriverHints;
135
+ readonly refusals: DriverRefusalWords;
136
+ }
137
+ /**
138
+ * One driver, as one plain object: its extension lists it (`drivers`, `defineExtension`), and the registry takes it
139
+ * from there. The launcher makes its run command from it.
140
+ */
141
+ export declare function defineDriver<const Name extends string, Context>(spec: DriverSpec<Name, Context>): Driver<Name, Context>;
142
+ /** Arguments as a person reads them, for a driver's words: `(none)` when there are none. */
143
+ export declare function argsText(args: readonly string[]): string;
@@ -0,0 +1,28 @@
1
+ // How an extension folder writes its driver: one `defineDriver` call, in its `driver.ts`, which holds everything the
2
+ // launcher knows of one program that the command starts (`GLOSSARY.md`, **Driver**), and returns one plain object,
3
+ // the driver (`Driver`). The launcher finds the program, asks the driver's plan step what it would run, starts it, and
4
+ // words its run command's leaf help, its two refusals and its run's summary with the driver's words. A driver has only
5
+ // this launcher side: storm's own code for a test runner is a test runner library, which belongs to no extension.
6
+ //
7
+ // The types flow from the call: its plan step takes the Context its `context` builds. The launcher sees the same object
8
+ // through the bare `Driver`, whose Context is `unknown`; `defineDriver` turns one into the other with its one cast,
9
+ // below. It loads nothing at run time.
10
+ /** How a plan step fails, which `driver_plan_failed` carries as `data.kind`. */
11
+ export const DRIVER_PLAN_FAILURE_KINDS = ["start-failed", "timed-out", "exited", "unreadable-output"];
12
+ /**
13
+ * One driver, as one plain object: its extension lists it (`drivers`, `defineExtension`), and the registry takes it
14
+ * from there. The launcher makes its run command from it.
15
+ */
16
+ export function defineDriver(spec) {
17
+ const { name, program, context, launch, plan, help, hints, refusals } = spec;
18
+ const driver = { name, program, context, launch, plan, help, hints, refusals };
19
+ // The one cast: the launcher's view of the driver's plan step, whose parameter is the driver's Context and which the
20
+ // launcher calls with `unknown`. Only the Context's routing is left for it to rest on: the launcher hands a Context
21
+ // only to the plan step of the driver that built it, by the driver's name (`planDriverCommand`,
22
+ // `commands/exec/driver-plan.ts`), which `test/unit/commands/driver-plan.test.ts` holds.
23
+ return driver;
24
+ }
25
+ /** Arguments as a person reads them, for a driver's words: `(none)` when there are none. */
26
+ export function argsText(args) {
27
+ return args.length === 0 ? "(none)" : args.join(" ");
28
+ }
@@ -5,8 +5,9 @@ export type { CredentialFailure, CredentialOrigin, CredentialOutcome, Credential
5
5
  export { tokenRequestFailureFacts, tokenRequestFailureShape } from "./token-request-facts.ts";
6
6
  export type { Clock, Timer } from "./time.ts";
7
7
  export { defineResource, type ResourceSpec } from "./resource.ts";
8
+ export { argsText, defineDriver, type Driver, DRIVER_PLAN_FAILURE_KINDS, type DriverHelp, type DriverHints, type DriverPlanAnswer, type DriverPlanFailureKind, type DriverPlanned, type DriverPlanRequest, type DriverRefusalWords, type DriverSpec, } from "./driver.ts";
8
9
  export type { Acquired, AcquireForRunAnswer, AcquireForRunInput, BeforeRunAnswer, BeforeRunInput, LifecycleTypes, MintFailed, NextStep, NoSecrets, Refusal, RefusalContent, ReleaseAfterRunAnswer, ReleaseAfterRunInput, Released, Report, ResourceLifecycle, ResourceUse, ResultAnswer, } from "./lifecycle.ts";
9
- export type { LauncherSupplies, StateDirectory } from "./launcher-supplies.ts";
10
+ export type { LauncherContext, StateDirectory } from "./launcher-context.ts";
10
11
  export type { LaneDraw, Paint, ResourceNotice } from "./presentation.ts";
11
12
  export type { LaneOutcome, LaneRow, LaneStates, ResourceProgress } from "./progress.ts";
12
13
  export type { Row, Warning } from "./reports.ts";
@@ -1,22 +1,27 @@
1
- // The extension API, the part of the SDK an extension uses to plug into the launcher: its run-time entry, which loads no
2
- // Clinkr. The SDK declares the extension contract and the launcher implements it, so nothing here imports a launcher
1
+ // The extension API, the part of the SDK an extension uses to plug into the launcher: its run-time entry, which loads
2
+ // no Clinkr. The SDK declares the extension contract and the launcher implements it, so nothing here imports a launcher
3
3
  // module (`tools/storm/adr/0001-sdk-declares-the-extension-contract.md`). It is not a published export: only the
4
4
  // extensions in this repository use it. A extension folder imports storm through it, its light `commands.ts`
5
- // (`defineExtension`, with which an extension's `extension.ts` joins its resource definitions, its command tree and its
6
- // run examples, and what its `command-tree.ts` and commands are written with, the one SDK file that loads Clinkr), the
7
- // launcher resolvers (`src/launcher-resolvers/`, which only an extension's commands import) and the run API's launcher
8
- // entry. The launcher's modules import it too, for the contract they implement. It holds:
5
+ // (`defineExtension`, with which an extension's `extension.ts` joins its resource definitions, its drivers, its command
6
+ // tree and its run examples, and what its `command-tree.ts` and commands are written with, the one SDK file that loads
7
+ // Clinkr), the launcher resolvers (`src/launcher-resolvers/`, which only an extension's commands import) and the run
8
+ // API's launcher entry. The launcher's modules import it too, for the contract they implement. It holds:
9
9
  //
10
10
  // - how a resource is written: one `defineResource` per resource (`resource.ts`), in its folder's `definition.ts`,
11
11
  // which holds its resource definition (`ResourceDefinition`, `resource-definition.ts`): its options, the checks
12
- // across them, its payload contract, its world, its lifecycle and its optional progress; and its resource factory
12
+ // across them, its payload contract, its Context, its lifecycle and its optional progress; and its resource factory
13
13
  // (`resourceFactory`, `ResourceFactory`, `resource-factory.ts`, in its folder's `resource.ts`), which a config file
14
14
  // calls to make a resource (`Resource`). Its option rules and their run flags (`OptionRule`, `OptionRules`,
15
15
  // `FlagHelp`) come with the option helpers (`booleanOption`, `mustBe`, `nonEmptyString`, `optionKeyPath`, `rules.ts`)
16
16
  // and the types its lifecycle reads its options by (`ResolvedOptions`, `OptionSources`);
17
+ // - how a driver is written: one `defineDriver` per driver (`driver.ts`), in its folder's `driver.ts`, which holds
18
+ // what the launcher knows of one program that the command starts (`Driver`): its name, its program, its Context,
19
+ // the argv that starts it, its plan step over its Context (`DriverPlanRequest`, `DriverPlanAnswer`) and its words,
20
+ // its part of its command's help (`DriverHelp`), what its run's summary says to do next (`DriverHints`) and what its
21
+ // two refusals say (`DriverRefusalWords`);
17
22
  // - each lifecycle point's input and answer (`lifecycle.ts`), the refusal a lifecycle point words where it refuses
18
- // (`Refusal`, `RefusalContent`, `NextStep`), and what the launcher hands a world builder (`LauncherSupplies`,
19
- // `launcher-supplies.ts`), with the clock and timer (`Clock`, `Timer`, `time.ts`);
23
+ // (`Refusal`, `RefusalContent`, `NextStep`), and what the launcher hands a Context builder (`LauncherContext`,
24
+ // `launcher-context.ts`), with the clock and timer (`Clock`, `Timer`, `time.ts`);
20
25
  // - a resource's own progress (`ResourceProgress`, `progress.ts`; `LaneDraw`, `Paint`, `ResourceNotice`,
21
26
  // `presentation.ts`; `Span`, `span.ts`), typed by the resource's own event, lane-state and step types, and the rows
22
27
  // and warnings a resource renders (`Row`, `Warning`, `reports.ts`);
@@ -35,6 +40,7 @@ export { Credential } from "./credential.js";
35
40
  export { describeCredentialFailure, describeMintFailure, describeTokenRequestFailure, } from "./credential-diagnosis.js";
36
41
  export { tokenRequestFailureFacts, tokenRequestFailureShape } from "./token-request-facts.js";
37
42
  export { defineResource } from "./resource.js";
43
+ export { argsText, defineDriver, DRIVER_PLAN_FAILURE_KINDS, } from "./driver.js";
38
44
  export { defaultResourceKey, resourceCall, NOT_COUNTED, optionKeyPath, } from "./resource-definition.js";
39
45
  export { resourceFactory } from "./resource-factory.js";
40
46
  export { booleanOption, describeValue, mustBe, nonEmptyString } from "./rules.js";
@@ -13,10 +13,10 @@ export type StateDirectory = {
13
13
  readonly pattern: string;
14
14
  };
15
15
  /**
16
- * What the launcher hands a resource definition to build its world from: the launcher environment, its own state
17
- * directory, and the launcher's clock and timer, so a extension folder imports no clock or timer of its own.
16
+ * What the launcher gives a resource definition to build its Context from: the launcher environment, its own state
17
+ * directory, and the launcher's clock and timer, so an extension folder imports no clock or timer of its own.
18
18
  */
19
- export interface LauncherSupplies {
19
+ export interface LauncherContext {
20
20
  readonly env: Readonly<Record<string, string | undefined>>;
21
21
  readonly stateDirectory: StateDirectory;
22
22
  readonly clock: Clock;
@@ -0,0 +1,5 @@
1
+ // What the launcher gives a resource definition to build its Context from (`LauncherContext`), which a definition's
2
+ // `context` takes. The core builds it (`launcherContext`, `core/launcher-context.ts`). It is not `StormContext`, which
3
+ // holds what storm's own commands reach the outside through: the launcher builds a `LauncherContext` for one resource
4
+ // definition, from the process environment and the system clock and timer. It names no resource.
5
+ export {};
@@ -1,6 +1,7 @@
1
1
  import type { CredentialFailure, CredentialSource } from "./credential-source.ts";
2
2
  import type { Row } from "./reports.ts";
3
- /** What a person or agent can do next about a refusal: run a command, storm's or another tool's, open a page, or read a sentence. */
3
+ /** What a person or agent can do next about a refusal: run a command, storm's or another tool's, open a page, or read a
4
+ * sentence. */
4
5
  export type NextStep = {
5
6
  readonly type: "command" | "external";
6
7
  readonly argv: readonly string[];
@@ -43,7 +44,7 @@ export type NoSecrets = Readonly<Record<never, string>>;
43
44
  * What a run uses a resource with, once its `beforeRun` lets the run go on: the secrets it hands the run, by name,
44
45
  * which the run hides as `<token>` and hands its `acquireForRun`; whether it needs the Vercel credential, which the
45
46
  * launcher chooses a source for (`--credential`) only when one of the run's resources does; and the launcher
46
- * environment's variables it hides from the run's command (`hiddenVariables`), which the launcher leaves out of the
47
+ * environment's variables it hides from the command (`hiddenVariables`), which the launcher leaves out of the
47
48
  * command's environment.
48
49
  */
49
50
  export interface ResourceUse<Secrets> {
@@ -86,7 +87,7 @@ export type Report<Event = never> = [Event] extends [never] ? ReportLines : Repo
86
87
  readonly progress: (event: Event) => Promise<void>;
87
88
  };
88
89
  /**
89
- * What `acquireForRun` works from, beside its world: only what the launcher owns.
90
+ * What `acquireForRun` works from, beside its Context: only what the launcher owns.
90
91
  *
91
92
  * - `options` and `secrets`: its resolved options, and the secrets its `beforeRun` handed the run.
92
93
  * - `credential`: the run's credential source, which it calls `obtain()` on only when it needs a credential, and which
@@ -151,7 +152,7 @@ export type AcquireForRunAnswer<Payload, Result = never, Event = never> = {
151
152
  readonly mintFailed: MintFailed;
152
153
  };
153
154
  /**
154
- * What `releaseAfterRun` works from, beside its world: everything its acquire took, in the order it called `take`,
155
+ * What `releaseAfterRun` works from, beside its Context: everything its acquire took, in the order it called `take`,
155
156
  * whether or not the acquire finished, and what it reports as it goes (`Report`), each thing it couldn't release a
156
157
  * warning.
157
158
  */
@@ -188,7 +189,7 @@ export interface LifecycleTypes {
188
189
  readonly event: unknown;
189
190
  }
190
191
  /**
191
- * The lifecycle of one resource definition, typed by `T`, over the world its `lifecycle(world)` was given; with no
192
+ * The lifecycle of one resource definition, typed by `T`, over the Context its `lifecycle(context)` was given; with no
192
193
  * `T`, any resource's lifecycle as the core calls it. storm calls each on the launch machine. Each is a function
193
194
  * property, so its parameter is checked contravariantly.
194
195
  *
@@ -1,6 +1,6 @@
1
1
  // A resource definition's lifecycle: what the launcher calls on each of its resource instances, over the definition's
2
- // world, around a run, all on the launch machine, and what each lifecycle point works from and answers. A resource
3
- // folder writes `lifecycle(world)` in its `lifecycle.ts`, which its `defineResource` carries, typing each lifecycle
2
+ // Context, around a run, all on the launch machine, and what each lifecycle point works from and answers. A resource
3
+ // folder writes `lifecycle(context)` in its `lifecycle.ts`, which its `defineResource` carries, typing each lifecycle
4
4
  // point with the inputs and answers below. Each lifecycle point says in its answer how it ended: a lifecycle point that
5
5
  // refuses a run words its refusal where it refuses (`Refusal`), a warning takes a snake_case reason of the resource's
6
6
  // own, and an acquire's result (`ResultAnswer`) is typed by the lifecycle. The lifecycle holds `beforeRun`, the
@@ -1,6 +1,6 @@
1
1
  import type { z } from "zod";
2
2
  import type { PayloadContract } from "../run/contract.ts";
3
- import type { LauncherSupplies } from "./launcher-supplies.ts";
3
+ import type { LauncherContext } from "./launcher-context.ts";
4
4
  import type { ResourceLifecycle } from "./lifecycle.ts";
5
5
  import type { ResourceProgress } from "./progress.ts";
6
6
  /** Where a value came from: a flag (`--scope`, a command's own option flag), the file, or a default. */
@@ -11,9 +11,9 @@ export interface Setting<T> {
11
11
  readonly source: SettingSource;
12
12
  }
13
13
  /**
14
- * What a run counted before it started: `counted`, the tests `storm vitest`'s `vitest list` lists and the files they
15
- * are in; `not-counted` for a run that counts nothing, such as `storm exec`'s, and for a command that plans no run,
16
- * such as an extension's own command.
14
+ * What a run counted before it started: `counted`, the tests `storm vitest`'s `vitest list` or `storm playwright`'s
15
+ * `playwright test --list` lists and the files they are in; `not-counted` for a run that counts nothing, such as `storm
16
+ * exec`'s, and for a command that plans no run, such as an extension's own command.
17
17
  */
18
18
  export type RunTestPlan = {
19
19
  readonly kind: "counted";
@@ -54,9 +54,9 @@ export interface FlagHelp {
54
54
  * `schema` checks too. An option whose default is a function takes a string, number or boolean, and the run's test
55
55
  * plan lists it with its value and where that came from.
56
56
  * - `required`: a resource without this option is a problem.
57
- * - `flag`: the option's run flag on `exec` and `vitest`, `--<flagPrefix>-<option>`, with its help, whose request field
58
- * the launcher makes from `schema`. An option without one comes only from the file or its default. The usage names a
59
- * boolean flag as `--x=false` when its default is true, since only that value changes the request then.
57
+ * - `flag`: the option's run flag on `exec`, `vitest` and `playwright`, `--<flagPrefix>-<option>`, with its help, whose
58
+ * request field the launcher makes from `schema`. An option without one comes only from the file or its default. The
59
+ * usage names a boolean flag as `--x=false` when its default is true, since only that value changes the request then.
60
60
  */
61
61
  export interface OptionRule<T> {
62
62
  readonly schema: z.ZodType<T>;
@@ -155,24 +155,24 @@ export type DefaultsFit<Rules> = {
155
155
  * - `payload`: its payload contract: its name and the check of what storm wrote under `resources.<key>.payload` in the
156
156
  * run payload, the section the resource hands its command, which a command reads with
157
157
  * `readRunPayload().get(contract)`.
158
- * - `world`: its world, built live from what the launcher supplies (`LauncherSupplies`), which keeps its type, since an
158
+ * - `context`: its Context, built live from what the launcher gives (`LauncherContext`), which keeps its type, since an
159
159
  * extension's commands read it.
160
- * - `lifecycle`: its lifecycle over its world, which the launcher hands it by its name, seen as `unknown` wherever the
161
- * resource has types of its own (`ResourceLifecycle`).
160
+ * - `lifecycle`: its lifecycle over its Context, which the launcher hands it by its name, seen as `unknown` wherever
161
+ * the resource has types of its own (`ResourceLifecycle`).
162
162
  * - `progress`: its own progress, joined with what the views draw of it; absent for a resource without it.
163
163
  *
164
164
  * `check` is a method, so a list of definitions fits the bare `ResourceDefinition`: a method's parameter is checked
165
165
  * both ways, where a function property's would be checked only contravariantly. The definition isn't callable: what a
166
166
  * config file calls to make a resource is its resource factory (`resourceFactory`).
167
167
  */
168
- export interface ResourceDefinition<Name extends string = string, Rules extends OptionRules = OptionRules, Payload = unknown, World = unknown> {
168
+ export interface ResourceDefinition<Name extends string = string, Rules extends OptionRules = OptionRules, Payload = unknown, Context = unknown> {
169
169
  readonly name: Name;
170
170
  readonly flagPrefix: string;
171
171
  readonly options: Rules;
172
172
  check(settings: OptionSettings<Rules>): readonly OptionProblem<keyof Rules & string>[];
173
173
  readonly payload: PayloadContract<Payload>;
174
- readonly world: (supplies: LauncherSupplies) => World;
175
- readonly lifecycle: (world: unknown) => ResourceLifecycle;
174
+ readonly context: (launcher: LauncherContext) => Context;
175
+ readonly lifecycle: (context: unknown) => ResourceLifecycle;
176
176
  readonly progress?: ResourceProgress;
177
177
  }
178
178
  /** A definition's option names. */
@@ -2,8 +2,8 @@
2
2
  // the launcher fulfills it, as one interface (`ResourceDefinition`), with the types storm reads its options and its
3
3
  // merged options by. Each extension folder writes its definition with the extension API's `defineResource`
4
4
  // (`resource.ts`), and a config file makes a resource with its resource factory (`resource-factory.ts`);
5
- // the extension API declares the shapes and names no resource. `config` (`load.ts`, `resolve.ts`) loops over the definitions
6
- // its caller passes in, and keeps each resource as a plain record by its resource key.
5
+ // the extension API declares the shapes and names no resource. `config` (`load.ts`, `resolve.ts`) loops over the
6
+ // definitions its caller passes in, and keeps each resource as a plain record by its resource key.
7
7
  /** The planned run of a run that counts nothing, such as `storm exec`'s, or of a command that plans no run. */
8
8
  export const NOT_COUNTED = Object.freeze({ testPlan: Object.freeze({ kind: "not-counted" }) });
9
9
  /**
@@ -1,4 +1,4 @@
1
- import type { LauncherSupplies } from "./launcher-supplies.ts";
1
+ import type { LauncherContext } from "./launcher-context.ts";
2
2
  import type { ResourceLifecycle } from "./lifecycle.ts";
3
3
  import type { ResourceProgress } from "./progress.ts";
4
4
  import type { DefaultsFit, OptionProblem, OptionRules, OptionSettings, OptionSources, ResolvedOptions, ResourceDefinition } from "./resource-definition.ts";
@@ -16,22 +16,22 @@ import type { PayloadContract } from "../run/contract.ts";
16
16
  * - `payload`: its payload contract, whose name must be its name: the check of what storm wrote under
17
17
  * `resources.<key>.payload` in the run payload, the section the resource hands its command, which a command reads
18
18
  * with `readRunPayload().get(contract)`.
19
- * - `world`: its world, built live from what the launcher supplies.
20
- * - `lifecycle`: its lifecycle over its world (`ResourceLifecycle`), each lifecycle point typed by the definition: its
21
- * options, its payload and its progress events. What its acquire takes, the secrets its `beforeRun` hands the run,
22
- * its refusals, its warnings and its acquire's result come from the lifecycle itself.
19
+ * - `context`: its Context, built live from what the launcher gives.
20
+ * - `lifecycle`: its lifecycle over its Context (`ResourceLifecycle`), each lifecycle point typed by the definition:
21
+ * its options, its payload and its progress events. What its acquire takes, the secrets its `beforeRun` hands the
22
+ * run, its refusals, its warnings and its acquire's result come from the lifecycle itself.
23
23
  * - `progress`: its own progress, joined with how it draws; none for a resource whose instances report only lines
24
24
  * (`report`).
25
25
  *
26
26
  * The line between storm and the extension: the extension writes every value here, and storm's part reaches it only as
27
- * the parameters of the extension's functions: `world` gets what the launcher supplies (`LauncherSupplies`), each
27
+ * the parameters of the extension's functions: `context` gets what the launcher gives (`LauncherContext`), each
28
28
  * lifecycle point its input (`take`, `report`, `credential`, `signal`), `check` each option's value and source, and the
29
29
  * progress its drawing (`LaneDraw`, `seconds`). Storm's helpers and types, such as `optionKeyPath` and the option
30
30
  * builders, are vocabulary the extension writes its values with. The one exception: a resource whose payload contract
31
- * another storm tree reads, such as the SDK's Vitest adapter, adopts that tree's contract and name, and its call says
32
- * so.
31
+ * another storm tree reads, such as an extension's Vitest fixtures, adopts that tree's contract and name, and its call
32
+ * says so.
33
33
  */
34
- export interface ResourceSpec<Name extends string, Rules extends OptionRules, Payload, World, Secrets extends Readonly<Record<string, string>>, Taken, Lane extends string, State extends Span, Event, Step extends string> {
34
+ export interface ResourceSpec<Name extends string, Rules extends OptionRules, Payload, Context, Secrets extends Readonly<Record<string, string>>, Taken, Lane extends string, State extends Span, Event, Step extends string> {
35
35
  readonly name: Name;
36
36
  readonly flagPrefix: string;
37
37
  readonly options: Rules & DefaultsFit<Rules>;
@@ -39,8 +39,8 @@ export interface ResourceSpec<Name extends string, Rules extends OptionRules, Pa
39
39
  readonly payload: PayloadContract<Payload> & {
40
40
  readonly name: NoInfer<Name>;
41
41
  };
42
- readonly world: (supplies: LauncherSupplies) => World;
43
- readonly lifecycle: (world: NoInfer<World>) => ResourceLifecycle<{
42
+ readonly context: (launcher: LauncherContext) => Context;
43
+ readonly lifecycle: (context: NoInfer<Context>) => ResourceLifecycle<{
44
44
  readonly options: NoInfer<ResolvedOptions<Rules>>;
45
45
  readonly sources: NoInfer<OptionSources<Rules>>;
46
46
  readonly secrets: Secrets;
@@ -53,8 +53,8 @@ export interface ResourceSpec<Name extends string, Rules extends OptionRules, Pa
53
53
  /**
54
54
  * One resource definition, configuring and fulfilling it, as one plain object: the registry lists it through its
55
55
  * extension, and its folder's `resource.ts` makes its resource factory from it (`resourceFactory`), which a config file
56
- * calls to make a resource (`<name>({ … })`). Its name, options, payload contract and world keep their types; its
56
+ * calls to make a resource (`<name>({ … })`). Its name, options, payload contract and Context keep their types; its
57
57
  * lifecycle and progress are what the core calls. A `check` it leaves out checks nothing. Throws when its payload
58
58
  * contract names another resource.
59
59
  */
60
- export declare function defineResource<const Name extends string, const Rules extends OptionRules, Payload, World, Secrets extends Readonly<Record<string, string>>, Taken = never, Lane extends string = never, State extends Span = never, Event = never, Step extends string = never>(spec: ResourceSpec<Name, Rules, Payload, World, Secrets, Taken, Lane, State, Event, Step>): ResourceDefinition<Name, Rules, Payload, World>;
60
+ export declare function defineResource<const Name extends string, const Rules extends OptionRules, Payload, Context, Secrets extends Readonly<Record<string, string>>, Taken = never, Lane extends string = never, State extends Span = never, Event = never, Step extends string = never>(spec: ResourceSpec<Name, Rules, Payload, Context, Secrets, Taken, Lane, State, Event, Step>): ResourceDefinition<Name, Rules, Payload, Context>;