@cnc-tools/storm 0.0.0-stage → 0.5.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 (513) hide show
  1. package/bin/node-version.js +24 -0
  2. package/bin/storm.js +16 -0
  3. package/dist/application.d.ts +13 -0
  4. package/dist/application.js +23 -0
  5. package/dist/bin/storm.d.ts +1 -0
  6. package/dist/bin/storm.js +45 -0
  7. package/dist/build-info.js +3 -0
  8. package/dist/closed-terminal.d.ts +7 -0
  9. package/dist/closed-terminal.js +18 -0
  10. package/dist/combine-errors.d.ts +11 -0
  11. package/dist/combine-errors.js +19 -0
  12. package/dist/commands/dashboard.d.ts +11 -0
  13. package/dist/commands/dashboard.js +18 -0
  14. package/dist/commands/run/cleanup.d.ts +135 -0
  15. package/dist/commands/run/cleanup.js +171 -0
  16. package/dist/commands/run/command.d.ts +327 -0
  17. package/dist/commands/run/command.js +620 -0
  18. package/dist/commands/run/job-summary.d.ts +6 -0
  19. package/dist/commands/run/job-summary.js +31 -0
  20. package/dist/commands/run/live-view.d.ts +22 -0
  21. package/dist/commands/run/live-view.js +395 -0
  22. package/dist/commands/run/metadata.d.ts +47 -0
  23. package/dist/commands/run/metadata.js +83 -0
  24. package/dist/commands/run/mint-failed.d.ts +11 -0
  25. package/dist/commands/run/mint-failed.js +33 -0
  26. package/dist/commands/run/outcomes.d.ts +307 -0
  27. package/dist/commands/run/outcomes.js +332 -0
  28. package/dist/commands/run/progress.d.ts +44 -0
  29. package/dist/commands/run/progress.js +277 -0
  30. package/dist/commands/run/redaction.d.ts +15 -0
  31. package/dist/commands/run/redaction.js +40 -0
  32. package/dist/commands/run/run-collector.d.ts +30 -0
  33. package/dist/commands/run/run-collector.js +73 -0
  34. package/dist/commands/run/run-record.d.ts +144 -0
  35. package/dist/commands/run/run-record.js +96 -0
  36. package/dist/commands/run/tests-summary.d.ts +34 -0
  37. package/dist/commands/run/tests-summary.js +141 -0
  38. package/dist/commands/run/text.d.ts +22 -0
  39. package/dist/commands/run/text.js +74 -0
  40. package/dist/commands/run/view.d.ts +35 -0
  41. package/dist/commands/run/view.js +163 -0
  42. package/dist/commands/run/waterfall.d.ts +25 -0
  43. package/dist/commands/run/waterfall.js +108 -0
  44. package/dist/commands/run/worker-chart.d.ts +79 -0
  45. package/dist/commands/run/worker-chart.js +313 -0
  46. package/dist/commands/runs/facts.d.ts +150 -0
  47. package/dist/commands/runs/facts.js +292 -0
  48. package/dist/commands/runs/list/command.d.ts +86 -0
  49. package/dist/commands/runs/list/command.js +36 -0
  50. package/dist/commands/runs/list/metadata.d.ts +22 -0
  51. package/dist/commands/runs/list/metadata.js +19 -0
  52. package/dist/commands/runs/list/outcomes.d.ts +74 -0
  53. package/dist/commands/runs/list/outcomes.js +89 -0
  54. package/dist/commands/runs/logs/command.d.ts +72 -0
  55. package/dist/commands/runs/logs/command.js +51 -0
  56. package/dist/commands/runs/logs/metadata.d.ts +22 -0
  57. package/dist/commands/runs/logs/metadata.js +22 -0
  58. package/dist/commands/runs/logs/outcomes.d.ts +55 -0
  59. package/dist/commands/runs/logs/outcomes.js +77 -0
  60. package/dist/commands/runs/metadata.d.ts +3 -0
  61. package/dist/commands/runs/metadata.js +3 -0
  62. package/dist/commands/runs/past-run.d.ts +72 -0
  63. package/dist/commands/runs/past-run.js +99 -0
  64. package/dist/commands/runs/show/command.d.ts +176 -0
  65. package/dist/commands/runs/show/command.js +76 -0
  66. package/dist/commands/runs/show/metadata.d.ts +25 -0
  67. package/dist/commands/runs/show/metadata.js +22 -0
  68. package/dist/commands/runs/show/outcomes.d.ts +164 -0
  69. package/dist/commands/runs/show/outcomes.js +317 -0
  70. package/dist/config/by-name.d.ts +24 -0
  71. package/dist/config/by-name.js +26 -0
  72. package/dist/config/errors.d.ts +58 -0
  73. package/dist/config/errors.js +101 -0
  74. package/dist/config/gateways.d.ts +32 -0
  75. package/dist/config/gateways.js +1 -0
  76. package/dist/config/index.d.ts +9 -0
  77. package/dist/config/index.js +12 -0
  78. package/dist/config/live/config-gateway.d.ts +6 -0
  79. package/dist/config/live/config-gateway.js +71 -0
  80. package/dist/config/load.d.ts +54 -0
  81. package/dist/config/load.js +175 -0
  82. package/dist/config/resolve.d.ts +49 -0
  83. package/dist/config/resolve.js +94 -0
  84. package/dist/config/resource-config.d.ts +132 -0
  85. package/dist/config/resource-config.js +19 -0
  86. package/dist/config/schema.d.ts +64 -0
  87. package/dist/config/schema.js +57 -0
  88. package/dist/config/set.d.ts +16 -0
  89. package/dist/config/set.js +55 -0
  90. package/dist/config/settings-file.d.ts +41 -0
  91. package/dist/config/settings-file.js +72 -0
  92. package/dist/config-file/define.d.ts +37 -0
  93. package/dist/config-file/define.js +9 -0
  94. package/dist/config-file/toolchain.d.ts +9 -0
  95. package/dist/config-file/toolchain.js +41 -0
  96. package/dist/context.d.ts +86 -0
  97. package/dist/context.js +43 -0
  98. package/dist/core/command-provider.d.ts +126 -0
  99. package/dist/core/command-provider.js +13 -0
  100. package/dist/core/command-slots.d.ts +67 -0
  101. package/dist/core/command-slots.js +136 -0
  102. package/dist/core/events.d.ts +128 -0
  103. package/dist/core/events.js +15 -0
  104. package/dist/core/gateways.d.ts +249 -0
  105. package/dist/core/gateways.js +1 -0
  106. package/dist/core/index.d.ts +20 -0
  107. package/dist/core/index.js +18 -0
  108. package/dist/core/keyed.d.ts +12 -0
  109. package/dist/core/keyed.js +24 -0
  110. package/dist/core/lane.d.ts +46 -0
  111. package/dist/core/lane.js +5 -0
  112. package/dist/core/limit.d.ts +9 -0
  113. package/dist/core/limit.js +29 -0
  114. package/dist/core/live/command-gateway.d.ts +11 -0
  115. package/dist/core/live/command-gateway.js +83 -0
  116. package/dist/core/live/job-summary-gateway.d.ts +5 -0
  117. package/dist/core/live/job-summary-gateway.js +20 -0
  118. package/dist/core/live/progress-terminal.d.ts +20 -0
  119. package/dist/core/live/progress-terminal.js +173 -0
  120. package/dist/core/live/run-directory-gateway.d.ts +24 -0
  121. package/dist/core/live/run-directory-gateway.js +437 -0
  122. package/dist/core/mint.d.ts +10 -0
  123. package/dist/core/mint.js +14 -0
  124. package/dist/core/payload.d.ts +26 -0
  125. package/dist/core/payload.js +33 -0
  126. package/dist/core/presentation.d.ts +87 -0
  127. package/dist/core/presentation.js +5 -0
  128. package/dist/core/presentations.d.ts +56 -0
  129. package/dist/core/presentations.js +66 -0
  130. package/dist/core/provider.d.ts +69 -0
  131. package/dist/core/provider.js +5 -0
  132. package/dist/core/resource.d.ts +262 -0
  133. package/dist/core/resource.js +6 -0
  134. package/dist/core/resources.d.ts +131 -0
  135. package/dist/core/resources.js +254 -0
  136. package/dist/core/run-directory.d.ts +69 -0
  137. package/dist/core/run-directory.js +94 -0
  138. package/dist/core/run-state.d.ts +152 -0
  139. package/dist/core/run-state.js +313 -0
  140. package/dist/core/run.d.ts +187 -0
  141. package/dist/core/run.js +321 -0
  142. package/dist/core/state-directory.d.ts +19 -0
  143. package/dist/core/state-directory.js +29 -0
  144. package/dist/core/timeline.d.ts +63 -0
  145. package/dist/core/timeline.js +97 -0
  146. package/dist/core/timing.d.ts +22 -0
  147. package/dist/core/timing.js +26 -0
  148. package/dist/credential/credential.d.ts +46 -0
  149. package/dist/credential/credential.js +80 -0
  150. package/dist/credential/diagnosis.d.ts +18 -0
  151. package/dist/credential/diagnosis.js +99 -0
  152. package/dist/credential/gateways.d.ts +109 -0
  153. package/dist/credential/gateways.js +1 -0
  154. package/dist/credential/index.d.ts +7 -0
  155. package/dist/credential/index.js +7 -0
  156. package/dist/credential/live/github-actions-token-gateway.d.ts +15 -0
  157. package/dist/credential/live/github-actions-token-gateway.js +43 -0
  158. package/dist/credential/live/github-actions-token-response.d.ts +19 -0
  159. package/dist/credential/live/github-actions-token-response.js +49 -0
  160. package/dist/credential/live/vercel-cli-gateway.d.ts +9 -0
  161. package/dist/credential/live/vercel-cli-gateway.js +64 -0
  162. package/dist/credential/live/vercel-output.d.ts +60 -0
  163. package/dist/credential/live/vercel-output.js +122 -0
  164. package/dist/credential/live/vercel-process.d.ts +14 -0
  165. package/dist/credential/live/vercel-process.js +3 -0
  166. package/dist/credential/settle.d.ts +31 -0
  167. package/dist/credential/settle.js +49 -0
  168. package/dist/credential/source.d.ts +110 -0
  169. package/dist/credential/source.js +114 -0
  170. package/dist/help-logo.d.ts +11 -0
  171. package/dist/help-logo.js +56 -0
  172. package/dist/presentation.d.ts +26 -0
  173. package/dist/presentation.js +21 -0
  174. package/dist/resources/github/cleanup.d.ts +23 -0
  175. package/dist/resources/github/cleanup.js +39 -0
  176. package/dist/resources/github/command.d.ts +74 -0
  177. package/dist/resources/github/command.js +117 -0
  178. package/dist/resources/github/config.d.ts +16 -0
  179. package/dist/resources/github/config.js +37 -0
  180. package/dist/resources/github/events.d.ts +26 -0
  181. package/dist/resources/github/events.js +2 -0
  182. package/dist/resources/github/fixture-repo.d.ts +69 -0
  183. package/dist/resources/github/fixture-repo.js +60 -0
  184. package/dist/resources/github/gateways.d.ts +62 -0
  185. package/dist/resources/github/gateways.js +1 -0
  186. package/dist/resources/github/index.d.ts +12 -0
  187. package/dist/resources/github/index.js +15 -0
  188. package/dist/resources/github/live/fixture-repo-gateway.d.ts +12 -0
  189. package/dist/resources/github/live/fixture-repo-gateway.js +92 -0
  190. package/dist/resources/github/live/gateways.d.ts +6 -0
  191. package/dist/resources/github/live/gateways.js +13 -0
  192. package/dist/resources/github/presentation.d.ts +13 -0
  193. package/dist/resources/github/presentation.js +43 -0
  194. package/dist/resources/github/provider.d.ts +66 -0
  195. package/dist/resources/github/provider.js +58 -0
  196. package/dist/resources/github/resource-provider.d.ts +6 -0
  197. package/dist/resources/github/resource-provider.js +20 -0
  198. package/dist/resources/github/resource.d.ts +33 -0
  199. package/dist/resources/github/resource.js +12 -0
  200. package/dist/resources/testserver/cleanup.d.ts +14 -0
  201. package/dist/resources/testserver/cleanup.js +22 -0
  202. package/dist/resources/testserver/command.d.ts +322 -0
  203. package/dist/resources/testserver/command.js +245 -0
  204. package/dist/resources/testserver/commands/app.d.ts +18 -0
  205. package/dist/resources/testserver/commands/app.js +3 -0
  206. package/dist/resources/testserver/commands/create/command.d.ts +136 -0
  207. package/dist/resources/testserver/commands/create/command.js +158 -0
  208. package/dist/resources/testserver/commands/create/metadata.d.ts +31 -0
  209. package/dist/resources/testserver/commands/create/metadata.js +45 -0
  210. package/dist/resources/testserver/commands/create/outcomes.d.ts +111 -0
  211. package/dist/resources/testserver/commands/create/outcomes.js +172 -0
  212. package/dist/resources/testserver/commands/list/command.d.ts +60 -0
  213. package/dist/resources/testserver/commands/list/command.js +56 -0
  214. package/dist/resources/testserver/commands/list/metadata.d.ts +9 -0
  215. package/dist/resources/testserver/commands/list/metadata.js +9 -0
  216. package/dist/resources/testserver/commands/list/outcomes.d.ts +54 -0
  217. package/dist/resources/testserver/commands/list/outcomes.js +152 -0
  218. package/dist/resources/testserver/config.d.ts +18 -0
  219. package/dist/resources/testserver/config.js +77 -0
  220. package/dist/resources/testserver/credential-facts.d.ts +80 -0
  221. package/dist/resources/testserver/credential-facts.js +83 -0
  222. package/dist/resources/testserver/events.d.ts +59 -0
  223. package/dist/resources/testserver/events.js +4 -0
  224. package/dist/resources/testserver/index.d.ts +16 -0
  225. package/dist/resources/testserver/index.js +24 -0
  226. package/dist/resources/testserver/lane.d.ts +28 -0
  227. package/dist/resources/testserver/lane.js +139 -0
  228. package/dist/resources/testserver/live/gateways.d.ts +6 -0
  229. package/dist/resources/testserver/live/gateways.js +26 -0
  230. package/dist/resources/testserver/options.d.ts +5 -0
  231. package/dist/resources/testserver/options.js +5 -0
  232. package/dist/resources/testserver/pool/channels.d.ts +80 -0
  233. package/dist/resources/testserver/pool/channels.js +48 -0
  234. package/dist/resources/testserver/pool/create.d.ts +48 -0
  235. package/dist/resources/testserver/pool/create.js +45 -0
  236. package/dist/resources/testserver/pool/directory.d.ts +4 -0
  237. package/dist/resources/testserver/pool/directory.js +5 -0
  238. package/dist/resources/testserver/pool/gateways.d.ts +190 -0
  239. package/dist/resources/testserver/pool/gateways.js +1 -0
  240. package/dist/resources/testserver/pool/host.d.ts +8 -0
  241. package/dist/resources/testserver/pool/host.js +21 -0
  242. package/dist/resources/testserver/pool/index.d.ts +9 -0
  243. package/dist/resources/testserver/pool/index.js +10 -0
  244. package/dist/resources/testserver/pool/inspect.d.ts +53 -0
  245. package/dist/resources/testserver/pool/inspect.js +45 -0
  246. package/dist/resources/testserver/pool/lease.d.ts +84 -0
  247. package/dist/resources/testserver/pool/lease.js +125 -0
  248. package/dist/resources/testserver/pool/live/pool-records.d.ts +17 -0
  249. package/dist/resources/testserver/pool/live/pool-records.js +70 -0
  250. package/dist/resources/testserver/pool/live/pool-store-gateway.d.ts +12 -0
  251. package/dist/resources/testserver/pool/live/pool-store-gateway.js +435 -0
  252. package/dist/resources/testserver/pool/staleness.d.ts +16 -0
  253. package/dist/resources/testserver/pool/staleness.js +27 -0
  254. package/dist/resources/testserver/presentation.d.ts +9 -0
  255. package/dist/resources/testserver/presentation.js +217 -0
  256. package/dist/resources/testserver/provider.d.ts +177 -0
  257. package/dist/resources/testserver/provider.js +254 -0
  258. package/dist/resources/testserver/ran.d.ts +87 -0
  259. package/dist/resources/testserver/ran.js +140 -0
  260. package/dist/resources/testserver/resource-provider.d.ts +12 -0
  261. package/dist/resources/testserver/resource-provider.js +38 -0
  262. package/dist/resources/testserver/resource.d.ts +32 -0
  263. package/dist/resources/testserver/resource.js +10 -0
  264. package/dist/resources/testserver/run-sandbox.d.ts +13 -0
  265. package/dist/resources/testserver/run-sandbox.js +6 -0
  266. package/dist/resources/testserver/sandbox/channels.d.ts +12 -0
  267. package/dist/resources/testserver/sandbox/channels.js +21 -0
  268. package/dist/resources/testserver/sandbox/create-failure.d.ts +35 -0
  269. package/dist/resources/testserver/sandbox/create-failure.js +65 -0
  270. package/dist/resources/testserver/sandbox/create.d.ts +29 -0
  271. package/dist/resources/testserver/sandbox/create.js +37 -0
  272. package/dist/resources/testserver/sandbox/gateways.d.ts +150 -0
  273. package/dist/resources/testserver/sandbox/gateways.js +1 -0
  274. package/dist/resources/testserver/sandbox/index.d.ts +6 -0
  275. package/dist/resources/testserver/sandbox/index.js +7 -0
  276. package/dist/resources/testserver/sandbox/live/builds-response.d.ts +9 -0
  277. package/dist/resources/testserver/sandbox/live/builds-response.js +27 -0
  278. package/dist/resources/testserver/sandbox/live/control-plane-gateway.d.ts +17 -0
  279. package/dist/resources/testserver/sandbox/live/control-plane-gateway.js +133 -0
  280. package/dist/resources/testserver/sandbox/live/create-response.d.ts +35 -0
  281. package/dist/resources/testserver/sandbox/live/create-response.js +78 -0
  282. package/dist/resources/testserver/sandbox/live/fetch-failure.d.ts +24 -0
  283. package/dist/resources/testserver/sandbox/live/fetch-failure.js +45 -0
  284. package/dist/resources/testserver/sandbox/live/health-check-gateway.d.ts +11 -0
  285. package/dist/resources/testserver/sandbox/live/health-check-gateway.js +36 -0
  286. package/dist/resources/testserver/sandbox/live/sse.d.ts +12 -0
  287. package/dist/resources/testserver/sandbox/live/sse.js +32 -0
  288. package/dist/resources.d.ts +452 -0
  289. package/dist/resources.js +88 -0
  290. package/dist/runner/base.d.ts +40 -0
  291. package/dist/runner/base.js +52 -0
  292. package/dist/runner/context.d.ts +13 -0
  293. package/dist/runner/context.js +9 -0
  294. package/dist/runner/events.d.ts +179 -0
  295. package/dist/runner/events.js +16 -0
  296. package/dist/runner/gateways.d.ts +351 -0
  297. package/dist/runner/gateways.js +3 -0
  298. package/dist/runner/index.d.ts +19 -0
  299. package/dist/runner/index.js +18 -0
  300. package/dist/runner/live/checkout-gateway.d.ts +3 -0
  301. package/dist/runner/live/checkout-gateway.js +206 -0
  302. package/dist/runner/live/git-output.d.ts +14 -0
  303. package/dist/runner/live/git-output.js +32 -0
  304. package/dist/runner/live/sandbox-errors.d.ts +7 -0
  305. package/dist/runner/live/sandbox-errors.js +21 -0
  306. package/dist/runner/live/sandbox-gateway.d.ts +7 -0
  307. package/dist/runner/live/sandbox-gateway.js +427 -0
  308. package/dist/runner/live/snapshot-cache-gateway.d.ts +12 -0
  309. package/dist/runner/live/snapshot-cache-gateway.js +104 -0
  310. package/dist/runner/live/snapshot-records.d.ts +11 -0
  311. package/dist/runner/live/snapshot-records.js +57 -0
  312. package/dist/runner/live/terminal.d.ts +16 -0
  313. package/dist/runner/live/terminal.js +37 -0
  314. package/dist/runner/live/user.d.ts +2 -0
  315. package/dist/runner/live/user.js +11 -0
  316. package/dist/runner/output.d.ts +23 -0
  317. package/dist/runner/output.js +58 -0
  318. package/dist/runner/prepare.d.ts +67 -0
  319. package/dist/runner/prepare.js +59 -0
  320. package/dist/runner/ready.d.ts +68 -0
  321. package/dist/runner/ready.js +159 -0
  322. package/dist/runner/recipe.d.ts +126 -0
  323. package/dist/runner/recipe.js +302 -0
  324. package/dist/runner/remote-command.d.ts +77 -0
  325. package/dist/runner/remote-command.js +127 -0
  326. package/dist/runner/scope.d.ts +58 -0
  327. package/dist/runner/scope.js +117 -0
  328. package/dist/runner/snapshot-build.d.ts +33 -0
  329. package/dist/runner/snapshot-build.js +112 -0
  330. package/dist/runner/snapshot-cache.d.ts +84 -0
  331. package/dist/runner/snapshot-cache.js +126 -0
  332. package/dist/runner/snapshot-key.d.ts +52 -0
  333. package/dist/runner/snapshot-key.js +91 -0
  334. package/dist/runner/steps.d.ts +41 -0
  335. package/dist/runner/steps.js +49 -0
  336. package/dist/sdk/container/api-request.d.ts +32 -0
  337. package/dist/sdk/container/api-request.js +46 -0
  338. package/dist/sdk/container/container.d.ts +144 -0
  339. package/dist/sdk/container/container.js +346 -0
  340. package/dist/sdk/container/feature-flags.d.ts +37 -0
  341. package/dist/sdk/container/feature-flags.js +118 -0
  342. package/dist/sdk/container/gateways.d.ts +108 -0
  343. package/dist/sdk/container/gateways.js +1 -0
  344. package/dist/sdk/container/index.d.ts +5 -0
  345. package/dist/sdk/container/index.js +5 -0
  346. package/dist/sdk/container/live/container-gateway.d.ts +17 -0
  347. package/dist/sdk/container/live/container-gateway.js +114 -0
  348. package/dist/sdk/factories/build.d.ts +66 -0
  349. package/dist/sdk/factories/build.js +98 -0
  350. package/dist/sdk/factories/definition.d.ts +28 -0
  351. package/dist/sdk/factories/definition.js +16 -0
  352. package/dist/sdk/factories/definitions.d.ts +166 -0
  353. package/dist/sdk/factories/definitions.js +235 -0
  354. package/dist/sdk/factories/gateways.d.ts +25 -0
  355. package/dist/sdk/factories/gateways.js +1 -0
  356. package/dist/sdk/factories/index.d.ts +5 -0
  357. package/dist/sdk/factories/index.js +5 -0
  358. package/dist/sdk/factories/live/factory-gateway.d.ts +10 -0
  359. package/dist/sdk/factories/live/factory-gateway.js +29 -0
  360. package/dist/sdk/index.d.ts +7 -0
  361. package/dist/sdk/index.js +15 -0
  362. package/dist/sdk/payload/index.d.ts +2 -0
  363. package/dist/sdk/payload/index.js +4 -0
  364. package/dist/sdk/payload/payload.d.ts +47 -0
  365. package/dist/sdk/payload/payload.js +74 -0
  366. package/dist/sdk/payload/test-events.d.ts +102 -0
  367. package/dist/sdk/payload/test-events.js +59 -0
  368. package/dist/sdk/proxy/exchange.d.ts +58 -0
  369. package/dist/sdk/proxy/exchange.js +173 -0
  370. package/dist/sdk/proxy/faulted-exchange.d.ts +10 -0
  371. package/dist/sdk/proxy/faulted-exchange.js +106 -0
  372. package/dist/sdk/proxy/faults.d.ts +133 -0
  373. package/dist/sdk/proxy/faults.js +147 -0
  374. package/dist/sdk/proxy/index.d.ts +3 -0
  375. package/dist/sdk/proxy/index.js +3 -0
  376. package/dist/sdk/proxy/proxy.d.ts +93 -0
  377. package/dist/sdk/proxy/proxy.js +99 -0
  378. package/dist/sdk/proxy/records.d.ts +56 -0
  379. package/dist/sdk/proxy/records.js +56 -0
  380. package/dist/sdk/records/body.d.ts +89 -0
  381. package/dist/sdk/records/body.js +236 -0
  382. package/dist/sdk/records/index.d.ts +2 -0
  383. package/dist/sdk/records/index.js +4 -0
  384. package/dist/sdk/records/records.d.ts +49 -0
  385. package/dist/sdk/records/records.js +16 -0
  386. package/dist/sdk/seed/index.d.ts +1 -0
  387. package/dist/sdk/seed/index.js +3 -0
  388. package/dist/sdk/seed/seed.d.ts +221 -0
  389. package/dist/sdk/seed/seed.js +171 -0
  390. package/dist/sdk/testserver/clock.d.ts +8 -0
  391. package/dist/sdk/testserver/clock.js +10 -0
  392. package/dist/sdk/testserver/failure.d.ts +73 -0
  393. package/dist/sdk/testserver/failure.js +61 -0
  394. package/dist/sdk/testserver/index.d.ts +5 -0
  395. package/dist/sdk/testserver/index.js +8 -0
  396. package/dist/sdk/testserver/live/connect-failure.d.ts +7 -0
  397. package/dist/sdk/testserver/live/connect-failure.js +30 -0
  398. package/dist/sdk/testserver/live/request.d.ts +69 -0
  399. package/dist/sdk/testserver/live/request.js +89 -0
  400. package/dist/sdk/testserver/service-ids.d.ts +19 -0
  401. package/dist/sdk/testserver/service-ids.js +77 -0
  402. package/dist/sdk/testserver/test-id.d.ts +15 -0
  403. package/dist/sdk/testserver/test-id.js +28 -0
  404. package/dist/story/align.d.ts +37 -0
  405. package/dist/story/align.js +39 -0
  406. package/dist/story/artifact.d.ts +60 -0
  407. package/dist/story/artifact.js +93 -0
  408. package/dist/story/definition.d.ts +52 -0
  409. package/dist/story/definition.js +9 -0
  410. package/dist/story/diff.d.ts +9 -0
  411. package/dist/story/diff.js +97 -0
  412. package/dist/story/errors.d.ts +14 -0
  413. package/dist/story/errors.js +21 -0
  414. package/dist/story/gateways.d.ts +74 -0
  415. package/dist/story/gateways.js +3 -0
  416. package/dist/story/host.d.ts +27 -0
  417. package/dist/story/host.js +97 -0
  418. package/dist/story/index.d.ts +7 -0
  419. package/dist/story/index.js +9 -0
  420. package/dist/story/json.d.ts +16 -0
  421. package/dist/story/json.js +59 -0
  422. package/dist/story/live/artifact-gateway.d.ts +2 -0
  423. package/dist/story/live/artifact-gateway.js +82 -0
  424. package/dist/story/mode.d.ts +17 -0
  425. package/dist/story/mode.js +21 -0
  426. package/dist/story/orphans.d.ts +17 -0
  427. package/dist/story/orphans.js +15 -0
  428. package/dist/story/report.d.ts +30 -0
  429. package/dist/story/report.js +118 -0
  430. package/dist/story/run.d.ts +49 -0
  431. package/dist/story/run.js +160 -0
  432. package/dist/story/sequence.d.ts +30 -0
  433. package/dist/story/sequence.js +74 -0
  434. package/dist/story/settle.d.ts +94 -0
  435. package/dist/story/settle.js +70 -0
  436. package/dist/time/duration.d.ts +19 -0
  437. package/dist/time/duration.js +37 -0
  438. package/dist/time/index.d.ts +2 -0
  439. package/dist/time/index.js +4 -0
  440. package/dist/time/time.d.ts +15 -0
  441. package/dist/time/time.js +23 -0
  442. package/dist/vercel-cli/ansi.d.ts +13 -0
  443. package/dist/vercel-cli/ansi.js +32 -0
  444. package/dist/vercel-cli/arguments.d.ts +25 -0
  445. package/dist/vercel-cli/arguments.js +78 -0
  446. package/dist/vercel-cli/auth-config.d.ts +43 -0
  447. package/dist/vercel-cli/auth-config.js +36 -0
  448. package/dist/vercel-cli/clock.d.ts +9 -0
  449. package/dist/vercel-cli/clock.js +10 -0
  450. package/dist/vercel-cli/config-files.d.ts +24 -0
  451. package/dist/vercel-cli/config-files.js +40 -0
  452. package/dist/vercel-cli/context.d.ts +12 -0
  453. package/dist/vercel-cli/context.js +12 -0
  454. package/dist/vercel-cli/driver.d.ts +218 -0
  455. package/dist/vercel-cli/driver.js +364 -0
  456. package/dist/vercel-cli/entry.d.ts +8 -0
  457. package/dist/vercel-cli/entry.js +13 -0
  458. package/dist/vercel-cli/environment.d.ts +33 -0
  459. package/dist/vercel-cli/environment.js +72 -0
  460. package/dist/vercel-cli/errors.d.ts +8 -0
  461. package/dist/vercel-cli/errors.js +8 -0
  462. package/dist/vercel-cli/gateways.d.ts +103 -0
  463. package/dist/vercel-cli/gateways.js +4 -0
  464. package/dist/vercel-cli/index.d.ts +10 -0
  465. package/dist/vercel-cli/index.js +15 -0
  466. package/dist/vercel-cli/invocation.d.ts +234 -0
  467. package/dist/vercel-cli/invocation.js +397 -0
  468. package/dist/vercel-cli/keys.d.ts +14 -0
  469. package/dist/vercel-cli/keys.js +12 -0
  470. package/dist/vercel-cli/live/config-files.d.ts +28 -0
  471. package/dist/vercel-cli/live/config-files.js +66 -0
  472. package/dist/vercel-cli/live/process-gateway.d.ts +14 -0
  473. package/dist/vercel-cli/live/process-gateway.js +178 -0
  474. package/dist/vercel-cli/redaction.d.ts +13 -0
  475. package/dist/vercel-cli/redaction.js +22 -0
  476. package/dist/vercel-cli/report.d.ts +22 -0
  477. package/dist/vercel-cli/report.js +110 -0
  478. package/dist/vercel-cli/verbose.d.ts +7 -0
  479. package/dist/vercel-cli/verbose.js +24 -0
  480. package/dist/version.d.ts +20 -0
  481. package/dist/version.js +57 -0
  482. package/dist/vitest/config.d.ts +51 -0
  483. package/dist/vitest/config.js +61 -0
  484. package/dist/vitest/container-scope.d.ts +108 -0
  485. package/dist/vitest/container-scope.js +234 -0
  486. package/dist/vitest/diagnostics.d.ts +146 -0
  487. package/dist/vitest/diagnostics.js +306 -0
  488. package/dist/vitest/fixtures.d.ts +64 -0
  489. package/dist/vitest/fixtures.js +172 -0
  490. package/dist/vitest/gateways.d.ts +47 -0
  491. package/dist/vitest/gateways.js +3 -0
  492. package/dist/vitest/index.d.ts +3 -0
  493. package/dist/vitest/index.js +9 -0
  494. package/dist/vitest/list-output.d.ts +3 -0
  495. package/dist/vitest/list-output.js +19 -0
  496. package/dist/vitest/live/list-gateway.d.ts +7 -0
  497. package/dist/vitest/live/list-gateway.js +60 -0
  498. package/dist/vitest/ownership.d.ts +29 -0
  499. package/dist/vitest/ownership.js +68 -0
  500. package/dist/vitest/plan.d.ts +33 -0
  501. package/dist/vitest/plan.js +73 -0
  502. package/dist/vitest/sandbox.d.ts +16 -0
  503. package/dist/vitest/sandbox.js +35 -0
  504. package/dist/vitest/test-events.d.ts +41 -0
  505. package/dist/vitest/test-events.js +92 -0
  506. package/dist/vitest/test-results.d.ts +84 -0
  507. package/dist/vitest/test-results.js +160 -0
  508. package/dist/vitest/types.d.ts +68 -0
  509. package/dist/vitest/types.js +4 -0
  510. package/package.json +123 -4
  511. package/skills/overview.md +32 -0
  512. package/skills/read-run-output.md +65 -0
  513. package/README.md +0 -3
@@ -0,0 +1,15 @@
1
+ /** Progress that reports nothing. */
2
+ export const silentProgress = { emit: async () => { } };
3
+ /** Progress that stamps each event with `clock`'s time as it is emitted, and hands it to `observer`. */
4
+ export function timedProgress(clock, observer) {
5
+ return { emit: (event) => observer.observe({ event, at: clock.now() }) };
6
+ }
7
+ /** An observer that hands each event to every one of `observers`, in order. */
8
+ export function observeAll(...observers) {
9
+ return {
10
+ observe: async (timed) => {
11
+ for (const observer of observers)
12
+ await observer.observe(timed);
13
+ },
14
+ };
15
+ }
@@ -0,0 +1,249 @@
1
+ import type { RunnerStepPhase } from "../runner/index.ts";
2
+ /** One chunk of a local command's output, as it arrives; a chunk may hold part of a line, or several. */
3
+ export interface CommandOutputChunk {
4
+ readonly stream: "stdout" | "stderr";
5
+ readonly data: string;
6
+ }
7
+ /**
8
+ * One execution of a run's command: its argument list, its whole environment, when to stop it, and where its output
9
+ * goes.
10
+ */
11
+ export interface CommandRequest {
12
+ /** The command: the argument list after `--`, run as given, with no shell. `argv[0]` is the executable. */
13
+ readonly argv: readonly string[];
14
+ /** The command's whole environment; nothing else is inherited. */
15
+ readonly env: Readonly<Record<string, string>>;
16
+ /** Aborting it sends the command SIGTERM. The command may still take its time to exit. */
17
+ readonly terminate: AbortSignal;
18
+ /** Hears each chunk of the command's stdout and stderr, as UTF-8 text, in the order it arrives. */
19
+ readonly onOutput: (chunk: CommandOutputChunk) => void;
20
+ }
21
+ /**
22
+ * How a command ended.
23
+ *
24
+ * - `exited`: it exited with `code`.
25
+ * - `signaled`: a signal ended it; `signal` is its name, such as `SIGINT`.
26
+ * - `spawn-failed`: it never started (no such executable, or not executable); `message` is what the OS said.
27
+ */
28
+ export type CommandOutcome = {
29
+ readonly kind: "exited";
30
+ readonly code: number;
31
+ } | {
32
+ readonly kind: "signaled";
33
+ readonly signal: string;
34
+ } | {
35
+ readonly kind: "spawn-failed";
36
+ readonly message: string;
37
+ };
38
+ /**
39
+ * Runs a run's command with the terminal's stdin, hands its stdout and stderr to `onOutput`, and waits for it and for
40
+ * the last of its output. It never rejects: a command that can't start is `spawn-failed`.
41
+ */
42
+ export interface CommandGateway {
43
+ run(request: CommandRequest): Promise<CommandOutcome>;
44
+ }
45
+ /** What a run directory operation couldn't do: the path and what the OS said, or why there is no place for it. */
46
+ export interface RunDirectoryFailure {
47
+ readonly path: string;
48
+ readonly message: string;
49
+ }
50
+ /** The output of a step in a run directory: a snapshot build's steps, applying the changes, the install, the build. */
51
+ export type RunDirectoryStep = RunnerStepPhase;
52
+ /** A run log: a step's log, or the command log (`command`), the command's output, in a run directory. */
53
+ export type RunLog = RunDirectoryStep | "command";
54
+ /**
55
+ * One run's run directory, open for writing: `run.json` (what the run was, and once it ended how), `events.jsonl`
56
+ * (the run's events, one JSON object a line), a log of each step's output (`snapshot.log`, `apply.log`,
57
+ * `install.log`, `build.log`), `command.log` (the command's stdout and stderr in arrival order, in either kind of
58
+ * run), `.test-events.jsonl` (the test events a local command stages, unredacted, while it runs, which `close`
59
+ * removes), `.tests.jsonl.partial` (the run's redacted test events as storm gets them), `tests.jsonl` (that file,
60
+ * published once the run is over) and `timeline.json`. While it is open, `active.json` marks it active, so no run
61
+ * prunes it. Writes never throw; `run.json`, `tests.jsonl` and `timeline.json` each appear whole, one after another in
62
+ * the order asked, so a reader sees a file whole or not at all; the first write that fails stops the rest, and `close`
63
+ * answers it.
64
+ */
65
+ export interface RunDirectory {
66
+ readonly path: string;
67
+ /** Its run id, the directory's name. */
68
+ readonly id: string;
69
+ /** Replaces `run.json` whole. */
70
+ writeRun(text: string): void;
71
+ /** Appends one line to `events.jsonl`. */
72
+ appendEvent(line: string): void;
73
+ /** Appends one line of a step's output to its log. */
74
+ appendStepOutput(step: RunDirectoryStep, line: string): void;
75
+ /** Appends the command's output, as it came. */
76
+ appendCommandOutput(text: string): void;
77
+ /** Appends one redacted test event line to the private file that becomes `tests.jsonl`. */
78
+ appendTestEvent(line: string): void;
79
+ /**
80
+ * Publishes the redacted test events appended so far as `tests.jsonl`, after any earlier replacement. A run that
81
+ * appended none publishes an empty file. Appends after this are dropped.
82
+ */
83
+ publishTestEvents(): void;
84
+ /** Writes `timeline.json` whole, after any earlier replacement. */
85
+ writeTimeline(text: string): void;
86
+ /**
87
+ * Streams the non-empty lines a local command staged in `.test-events.jsonl`, the test events file its run payload
88
+ * names, to `onLine`, in order. A file that doesn't exist reads as empty; any other read failure is returned after
89
+ * the lines read before it.
90
+ */
91
+ readTestEvents(onLine: (line: string) => void): Promise<StagedTestEventsRead>;
92
+ /**
93
+ * Waits for every write so far, ends writing, removes the test events a local command staged whatever failed before,
94
+ * and removes the active marker, so the run directory is completed; answers the first write that failed, or else a
95
+ * staged test events file or a marker it couldn't remove, if any.
96
+ */
97
+ close(): Promise<RunDirectoryFailure | undefined>;
98
+ }
99
+ /** How reading a local command's staged test events went: read whole, or stopped by a failure. */
100
+ export type StagedTestEventsRead = {
101
+ readonly ok: true;
102
+ } | {
103
+ readonly ok: false;
104
+ readonly failure: RunDirectoryFailure;
105
+ };
106
+ /** How opening a run directory went: the directory, and what pruning older ones couldn't remove; or a failure. */
107
+ export type OpenRunDirectoryResult = {
108
+ readonly ok: true;
109
+ readonly directory: RunDirectory;
110
+ readonly pruneFailures: readonly RunDirectoryFailure[];
111
+ } | {
112
+ readonly ok: false;
113
+ readonly failure: RunDirectoryFailure;
114
+ };
115
+ /** A run directory as a listing finds it: its run id, path, whether it is active, and its `run.json`, if readable. */
116
+ export interface ListedRunDirectory {
117
+ readonly id: string;
118
+ readonly path: string;
119
+ readonly active: boolean;
120
+ /** `run.json` as it reads; undefined when the run directory has none or it can't be read. */
121
+ readonly run: string | undefined;
122
+ }
123
+ /** How listing the run directories went: each one, newest first; or a failure. */
124
+ export type ListRunDirectoriesResult = {
125
+ readonly ok: true;
126
+ readonly runs: readonly ListedRunDirectory[];
127
+ } | {
128
+ readonly ok: false;
129
+ readonly failure: RunDirectoryFailure;
130
+ };
131
+ /**
132
+ * A run directory as reading it finds it: its listing, its test events and timeline as they read, and the run logs it
133
+ * holds.
134
+ */
135
+ export interface PastRunDirectory extends ListedRunDirectory {
136
+ /**
137
+ * The lines of `tests.jsonl`, the run's redacted test events; undefined until the run has written it, once it was
138
+ * over. The test events a local command stages while it runs are never read back.
139
+ */
140
+ readonly tests: readonly string[] | undefined;
141
+ /** `timeline.json` as it reads; undefined when there is none. */
142
+ readonly timeline: string | undefined;
143
+ /** The run logs it holds, in `RUN_LOGS`' order. */
144
+ readonly logs: readonly RunLog[];
145
+ }
146
+ /**
147
+ * How reading a run log went: `found`, its `text` as it is now, less a UTF-8 character still being written at its end;
148
+ * `not-found` when the run directory or the log doesn't exist; or a failure.
149
+ */
150
+ export type ReadRunLogResult = {
151
+ readonly kind: "found";
152
+ readonly path: string;
153
+ readonly text: string;
154
+ } | {
155
+ readonly kind: "not-found";
156
+ } | {
157
+ readonly kind: "failed";
158
+ readonly failure: RunDirectoryFailure;
159
+ };
160
+ /** How reading one run directory went: found, not found, or a failure. */
161
+ export type ReadRunDirectoryResult = {
162
+ readonly kind: "found";
163
+ readonly directory: PastRunDirectory;
164
+ } | {
165
+ readonly kind: "not-found";
166
+ } | {
167
+ readonly kind: "failed";
168
+ readonly failure: RunDirectoryFailure;
169
+ };
170
+ /**
171
+ * The run directories: `${XDG_STATE_HOME:-~/.local/state}/storm/runs/<run id>/`, one for each recent run. A
172
+ * run id is the run's start in UTC, `YYYYMMDDTHHMMSS`, a dash and a short random suffix, so runs started in the
173
+ * same second from different worktrees don't collide.
174
+ *
175
+ * A run directory is active from when it is opened until it is closed, and completed after. One whose run ended
176
+ * without closing it, its holder gone, is completed too: on the same host, once its process no longer runs; held on
177
+ * another host, or with a marker that can't be read, 24 hours after.
178
+ */
179
+ export interface RunDirectoryGateway {
180
+ /**
181
+ * Makes a run directory for a run started at `startedAt`, active, holding `run` as its `run.json`, then removes
182
+ * every completed run directory but the newest `keep`, and removes the private test event files a run that ended without
183
+ * closing its run directory left in each completed one it keeps. Active run directories, this one among them, all
184
+ * stay as they are.
185
+ */
186
+ open(request: {
187
+ readonly startedAt: Date;
188
+ readonly keep: number;
189
+ readonly run: string;
190
+ }): Promise<OpenRunDirectoryResult>;
191
+ /**
192
+ * Every run directory, newest first, with whether it is active at `now` and its `run.json`. A run directory whose
193
+ * `run.json` can't be read is listed without it. No run directories yet is an empty list.
194
+ */
195
+ list(request: {
196
+ readonly now: Date;
197
+ }): Promise<ListRunDirectoriesResult>;
198
+ /**
199
+ * Run directory `id`, with whether it is active at `now`, its `run.json`, test events and timeline, and the run logs
200
+ * it holds.
201
+ */
202
+ read(request: {
203
+ readonly id: string;
204
+ readonly now: Date;
205
+ }): Promise<ReadRunDirectoryResult>;
206
+ /** Run log `log` of run directory `id`, as it is now. */
207
+ readLog(request: {
208
+ readonly id: string;
209
+ readonly log: RunLog;
210
+ }): Promise<ReadRunLogResult>;
211
+ }
212
+ /**
213
+ * The terminal a run's live view shows on, a DI seam: a live region pinned at the bottom of stderr, redrawn in
214
+ * place, with text printed above it. Writes never throw; once one fails, as one does with EIO after SIGHUP closes
215
+ * the terminal, it writes nothing more.
216
+ */
217
+ export interface ProgressTerminal {
218
+ /** The terminal's width now, in columns. */
219
+ columns(): number;
220
+ /**
221
+ * Shows `frame`'s lines in the live region: drawn now, then redrawn on a steady tick, about every 90 ms, until
222
+ * `settle`. Each line is cut to the terminal's width, and the frame to the rows above the terminal's last row, at
223
+ * least one, when the terminal reports its height. A redraw erases every row the region took, whatever the
224
+ * terminal's width since; on a terminal that reflows rows when narrowed, a row then takes more than one. Showing
225
+ * again after `settle` starts a new live region below the settled one. An empty frame draws nothing, and settling
226
+ * on one leaves nothing.
227
+ */
228
+ show(frame: () => readonly string[]): void;
229
+ /** Writes `text` to stdout or stderr above the live region, which is redrawn below it. */
230
+ print(stream: "stdout" | "stderr", text: string): void;
231
+ /** Draws the frame one last time and leaves it in place, ending the live region and restoring the cursor. */
232
+ settle(): void;
233
+ }
234
+ /**
235
+ * How appending to the job summary went: `appended`; `none`, outside a GitHub Actions step that has a job summary
236
+ * file (`GITHUB_STEP_SUMMARY`); or `failed`.
237
+ */
238
+ export type JobSummaryResult = {
239
+ readonly kind: "appended";
240
+ } | {
241
+ readonly kind: "none";
242
+ } | {
243
+ readonly kind: "failed";
244
+ readonly failure: RunDirectoryFailure;
245
+ };
246
+ /** The GitHub Actions job summary a run appends its Markdown summary to. */
247
+ export interface JobSummaryGateway {
248
+ appendJobSummary(markdown: string): Promise<JobSummaryResult>;
249
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ export { type AnyResourceError, type CommandProvider, defineRefusals, type RefusalDefinition, type RefusalDefinitions, type RefusalFact, type RefusalFactOf, type RefusalSchemaOf, type ResourceCleanupReport, type ResourceErrors, type ResourceRanReport, type ResourceSettleInput, type ResourceSettlement, type UnpreparedErrorOf, } from "./command-provider.ts";
2
+ export { bindCommands, type ResourceCommands, type ResourceReports, resourceReports, type ResourcesSettlement, } from "./command-slots.ts";
3
+ export type { FittingConfig, Provider, ProviderList, ResourceCommandTree, ResourceHost } from "./provider.ts";
4
+ export type { LaneDraw, LanePresentation, Paint, ReleaseTense, ResourceNotice, ResourcePresentation, } from "./presentation.ts";
5
+ export { type PresentedLane, type ResourcePresentations, resourcePresentations } from "./presentations.ts";
6
+ export { type CredentialEvent, type CredentialProgress, type LaneOutcome, observeAll, type RunEvent, type RunObserver, type RunProgress, silentProgress, type TimedRunEvent, timedProgress, } from "./events.ts";
7
+ export type { CommandGateway, CommandOutcome, CommandOutputChunk, CommandRequest, JobSummaryGateway, JobSummaryResult, ListedRunDirectory, ListRunDirectoriesResult, OpenRunDirectoryResult, PastRunDirectory, ProgressTerminal, ReadRunDirectoryResult, ReadRunLogResult, RunDirectory, RunDirectoryFailure, RunDirectoryGateway, RunDirectoryStep, RunLog, StagedTestEventsRead, } from "./gateways.ts";
8
+ export { runLimited } from "./limit.ts";
9
+ export { liveCommandGateway } from "./live/command-gateway.ts";
10
+ export { liveJobSummaryGateway } from "./live/job-summary-gateway.ts";
11
+ export { liveProgressTerminal } from "./live/progress-terminal.ts";
12
+ export { liveRunDirectoryGateway, unavailableRunDirectoryGateway } from "./live/run-directory-gateway.ts";
13
+ export type { LaneRow, LaneStates, ResourceLane, ResourceLanes } from "./lane.ts";
14
+ export type { AnyResources, CoreContext, CoreLane, KindAt, KindsOf, LaneNameOf, ResourceAcquireInput, ResourceAcquireOutcome, ResourceCanceledFacts, ResourceCleanup, ResourceCleanupFacts, ResourceEvent, ResourceFacts, ResourceFailures, ResourceHoldings, ResourceKind, ResourceOptions, ResourcePayloads, ResourceProgress, ResourceRanFacts, ResourceReason, ResourceRefusal, ResourceRequests, ResourceUnprepared, RunLane, RunProvider, RunProviders, } from "./resource.ts";
15
+ export { ACTIVE_MARKER, COMMAND_LOG, EVENTS_FILE, RUN_DIRECTORIES_KEPT, RUN_LOGS, runLogFile, RUN_FILE, RUN_ID_PATTERN, runDirectoryObserver, runIdPrefix, RUNS_SUBPATH, stepLog, stepLogPath, TEST_EVENTS_STAGING_FILE, testEventsPath, TESTS_FILE, TESTS_PARTIAL_FILE, TIMELINE_FILE, } from "./run-directory.ts";
16
+ export { executeRun, type LocalRunRequest, type RanRun, type RanRunner, type RemoteRunRequest, type RunCleanup, type RunContext, type RunnerCleanupReport, type RunControl, type RunOutcome, type RunRequest, type RunRunnerFailure, type RunRunnerRequest, type RunStopped, } from "./run.ts";
17
+ export { resolveStateDirectory, stateDirectoryPattern } from "./state-directory.ts";
18
+ export { commandExitStatus, megabytesText, type RanCommand, secondsOf, secondsText } from "./timing.ts";
19
+ export { cleanupProblems, commandPassed, type CleanupState, type CommandState, applyRunEvent, EMPTY_RUN_STATE, RUNNER_STEPS, type RunnerSnapshotState, type RunnerState, type RunnerStepName, type RunnerStepState, type RunState, type Span, type SpanStatus, type TestsState, type TestWorkerState, } from "./run-state.ts";
20
+ export { timeline, type Timeline, type TimelineOutcome, type TimelineRow, type TimelineRowName, type TimelineSpan, type TimelineStep, type TimelineStepName, } from "./timeline.ts";
@@ -0,0 +1,18 @@
1
+ // The `core` module's caller-facing interface: the resource contract each resource folder implements, run and command
2
+ // halves, and what the composition layer runs a command with, with the types of its outcome and progress. It names no
3
+ // resource; the composition layer's registry (`src/resources.ts`) fixes the kinds map `K`.
4
+ export { defineRefusals, } from "./command-provider.js";
5
+ export { bindCommands, resourceReports, } from "./command-slots.js";
6
+ export { resourcePresentations } from "./presentations.js";
7
+ export { observeAll, silentProgress, timedProgress, } from "./events.js";
8
+ export { runLimited } from "./limit.js";
9
+ export { liveCommandGateway } from "./live/command-gateway.js";
10
+ export { liveJobSummaryGateway } from "./live/job-summary-gateway.js";
11
+ export { liveProgressTerminal } from "./live/progress-terminal.js";
12
+ export { liveRunDirectoryGateway, unavailableRunDirectoryGateway } from "./live/run-directory-gateway.js";
13
+ export { ACTIVE_MARKER, COMMAND_LOG, EVENTS_FILE, RUN_DIRECTORIES_KEPT, RUN_LOGS, runLogFile, RUN_FILE, RUN_ID_PATTERN, runDirectoryObserver, runIdPrefix, RUNS_SUBPATH, stepLog, stepLogPath, TEST_EVENTS_STAGING_FILE, testEventsPath, TESTS_FILE, TESTS_PARTIAL_FILE, TIMELINE_FILE, } from "./run-directory.js";
14
+ export { executeRun, } from "./run.js";
15
+ export { resolveStateDirectory, stateDirectoryPattern } from "./state-directory.js";
16
+ export { commandExitStatus, megabytesText, secondsOf, secondsText } from "./timing.js";
17
+ export { cleanupProblems, commandPassed, applyRunEvent, EMPTY_RUN_STATE, RUNNER_STEPS, } from "./run-state.js";
18
+ export { timeline, } from "./timeline.js";
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * `{ [name]: value }` as the map `M` keyed by resource name that it is, such as `ResourceCleanup<K>`: `value` is what
4
+ * `M` holds under `name`.
5
+ */
6
+ export declare function entry<M, N extends keyof M & string>(name: N, value: M[N]): M;
7
+ /**
8
+ * The schema of map `M`, keyed by resource name, from each resource's `[name, schema]`, where `schema` holds what `M`
9
+ * holds under `name`, made optional: what `z.object` builds of them, typed as `M`, as its input and its output, which
10
+ * zod can't infer from entries it builds at run time.
11
+ */
12
+ export declare function keyedSchema<M>(entries: readonly (readonly [string, z.ZodType])[]): z.ZodType<M, M>;
@@ -0,0 +1,24 @@
1
+ // The only cast that relates a resource's name to the kinds map `K`. Inside the core, one provider's name is a generic
2
+ // `N` indexing a generic `K`. An object built with `N` as a computed key, `{ [name]: value }`, is what a map keyed by
3
+ // resource name holds under `name`, but TypeScript widens it to `{ [x: string]: … }` and can't relate that to the map.
4
+ // `entry` states the fact once, for every call site; its parameters are typed by the caller's `N`, so a wrong value
5
+ // fails at the call, not here. Resources and commands never cast. The nested `resource` event and the
6
+ // `resource-refused` and `resource-unprepared` outcomes, distributed over every name, need no cast: TypeScript relates
7
+ // an object of one name's member to them. `keyedSchema` states the same fact of a schema zod builds at run time from
8
+ // each resource's entry.
9
+ import { z } from "zod";
10
+ /**
11
+ * `{ [name]: value }` as the map `M` keyed by resource name that it is, such as `ResourceCleanup<K>`: `value` is what
12
+ * `M` holds under `name`.
13
+ */
14
+ export function entry(name, value) {
15
+ return { [name]: value };
16
+ }
17
+ /**
18
+ * The schema of map `M`, keyed by resource name, from each resource's `[name, schema]`, where `schema` holds what `M`
19
+ * holds under `name`, made optional: what `z.object` builds of them, typed as `M`, as its input and its output, which
20
+ * zod can't infer from entries it builds at run time.
21
+ */
22
+ export function keyedSchema(entries) {
23
+ return z.object(Object.fromEntries(entries));
24
+ }
@@ -0,0 +1,46 @@
1
+ import type { LaneOutcome } from "./events.ts";
2
+ import type { KindAt, ResourceKind } from "./resource.ts";
3
+ import type { Span } from "./run-state.ts";
4
+ /** A resource lane's row on the waterfall: its steps that started, in order, and what it holds, if it counts that. */
5
+ export interface LaneRow<Step extends string> {
6
+ readonly steps: readonly {
7
+ readonly name: Step;
8
+ readonly span: Span;
9
+ }[];
10
+ /** How many things the lane holds that it reused, and how many it created. */
11
+ readonly sandboxes?: {
12
+ readonly reused: number;
13
+ readonly created: number;
14
+ };
15
+ }
16
+ /**
17
+ * The lane of resource `Name`, of kind `Kind`. It is pure: it applies events and projects state, and reaches nothing.
18
+ * Each operation is a function property, as `RunProvider`'s are, so its parameters are checked contravariantly.
19
+ *
20
+ * - `resource`: the resource's name, whose nested `resource` events the lane applies.
21
+ * - `lane`: the lane's name, which `lane-started` and `lane-ended` events name.
22
+ * - `start`: the lane's state when it starts, at `startedAt`.
23
+ * - `apply`: the lane after one of the resource's own events, at `at`.
24
+ * - `ended`: the lane once it ended as `outcome` at `at`: its span ends, and a lane that failed or stopped ends each of
25
+ * its steps still running the same way.
26
+ * - `row`: its waterfall row's steps and counts.
27
+ */
28
+ export interface ResourceLane<Name extends string, Kind extends ResourceKind> {
29
+ readonly resource: Name;
30
+ readonly lane: Kind["lane"];
31
+ readonly start: (startedAt: number) => Kind["laneState"];
32
+ readonly apply: (state: Kind["laneState"], event: Kind["event"], at: number) => Kind["laneState"];
33
+ readonly ended: (state: Kind["laneState"], outcome: LaneOutcome, at: number) => Kind["laneState"];
34
+ readonly row: (state: Kind["laneState"]) => LaneRow<Kind["laneStep"]>;
35
+ }
36
+ /**
37
+ * Every resource lane of a registry, in the order the waterfall shows their rows: one union member per resource, as
38
+ * `Providers` has. A resource without a lane has none in the list.
39
+ */
40
+ export type ResourceLanes<K> = readonly {
41
+ readonly [N in keyof K & string]: ResourceLane<N, KindAt<K, N>>;
42
+ }[keyof K & string][];
43
+ /** Each resource lane's state, by resource name; a resource whose lane hasn't started, or that has none, is absent. */
44
+ export type LaneStates<K> = {
45
+ readonly [N in keyof K]?: KindAt<K, N>["laneState"];
46
+ };
@@ -0,0 +1,5 @@
1
+ // The lane contract: what a resource with a lane gives the run's state. Its lane applies the resource's own events to
2
+ // its own lane state, from the lane's start to its end, and projects its row on the waterfall. Each resource folder
3
+ // writes its lane against its own name and kind; the registry lists them, and the run's state applies every event
4
+ // through them (`applyRunEvent`). It names no resource.
5
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Runs `task` for indexes `0` to `count - 1`, at most `limit` at a time, in index order. Before starting each
3
+ * task it asks `proceed`; once that says no, no further task starts, and the ones in flight still finish. The
4
+ * result holds each started task's value at its index and `undefined` for those never started.
5
+ *
6
+ * When a task rejects, no further task starts; once every started task has settled, it rejects with the first
7
+ * rejection. So nothing it started is still running when it returns or rejects.
8
+ */
9
+ export declare function runLimited<T>(count: number, limit: number, proceed: () => boolean, task: (index: number) => Promise<T>): Promise<readonly (T | undefined)[]>;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Runs `task` for indexes `0` to `count - 1`, at most `limit` at a time, in index order. Before starting each
3
+ * task it asks `proceed`; once that says no, no further task starts, and the ones in flight still finish. The
4
+ * result holds each started task's value at its index and `undefined` for those never started.
5
+ *
6
+ * When a task rejects, no further task starts; once every started task has settled, it rejects with the first
7
+ * rejection. So nothing it started is still running when it returns or rejects.
8
+ */
9
+ export async function runLimited(count, limit, proceed, task) {
10
+ const results = Array.from({ length: count }, () => undefined);
11
+ let failure;
12
+ let next = 0;
13
+ const worker = async () => {
14
+ while (failure === undefined && next < count && proceed()) {
15
+ const index = next;
16
+ next += 1;
17
+ try {
18
+ results[index] = await task(index);
19
+ }
20
+ catch (error) {
21
+ failure ??= { error };
22
+ }
23
+ }
24
+ };
25
+ await Promise.all(Array.from({ length: Math.min(limit, count) }, worker));
26
+ if (failure !== undefined)
27
+ throw failure.error;
28
+ return results;
29
+ }
@@ -0,0 +1,11 @@
1
+ import type { CommandGateway } from "../gateways.ts";
2
+ /**
3
+ * The live command gateway: spawns `argv[0]` with the rest of `argv`, no shell, the given environment only, the
4
+ * terminal's stdin, and its stdout and stderr through pipes, each decoded as UTF-8 and handed to `onOutput` as it
5
+ * arrives. The command runs in storm's process group, so Ctrl+C and a closed terminal reach it directly. Aborting
6
+ * `terminate` sends SIGTERM. It settles once the process has exited and both pipes have closed, so no output is lost,
7
+ * or `PIPE_DRAIN_MS` after the process exited when a process it left behind still holds a pipe open: then it stops
8
+ * reading, so that process can't keep the run waiting. An `error` before the process spawns (ENOENT, EACCES) is
9
+ * `spawn-failed`.
10
+ */
11
+ export declare function liveCommandGateway(): CommandGateway;
@@ -0,0 +1,83 @@
1
+ import { spawn } from "node:child_process";
2
+ import { StringDecoder } from "node:string_decoder";
3
+ /**
4
+ * The live command gateway: spawns `argv[0]` with the rest of `argv`, no shell, the given environment only, the
5
+ * terminal's stdin, and its stdout and stderr through pipes, each decoded as UTF-8 and handed to `onOutput` as it
6
+ * arrives. The command runs in storm's process group, so Ctrl+C and a closed terminal reach it directly. Aborting
7
+ * `terminate` sends SIGTERM. It settles once the process has exited and both pipes have closed, so no output is lost,
8
+ * or `PIPE_DRAIN_MS` after the process exited when a process it left behind still holds a pipe open: then it stops
9
+ * reading, so that process can't keep the run waiting. An `error` before the process spawns (ENOENT, EACCES) is
10
+ * `spawn-failed`.
11
+ */
12
+ export function liveCommandGateway() {
13
+ return {
14
+ run: (request) => runCommand(request),
15
+ };
16
+ }
17
+ /**
18
+ * How long the gateway waits for the pipes to close once the command exited: 2 seconds. A process the command left
19
+ * running, such as a server a global setup didn't stop, can hold them open for as long as it runs.
20
+ */
21
+ const PIPE_DRAIN_MS = 2_000;
22
+ function runCommand(request) {
23
+ const [executable, ...args] = request.argv;
24
+ if (executable === undefined)
25
+ throw new Error("liveCommandGateway: the command's argv is empty");
26
+ return new Promise((resolve) => {
27
+ let started = false;
28
+ let settled = false;
29
+ let draining;
30
+ const settle = (outcome) => {
31
+ if (settled)
32
+ return;
33
+ settled = true;
34
+ clearTimeout(draining);
35
+ request.terminate.removeEventListener("abort", onTerminate);
36
+ resolve(outcome);
37
+ };
38
+ const ended = (code, signal) => signal !== null ? { kind: "signaled", signal } : { kind: "exited", code: code ?? 0 };
39
+ const command = spawn(executable, args, {
40
+ stdio: ["inherit", "pipe", "pipe"],
41
+ shell: false,
42
+ env: { ...request.env },
43
+ });
44
+ const onTerminate = () => {
45
+ if (started)
46
+ command.kill("SIGTERM");
47
+ };
48
+ // A multibyte character split across two chunks decodes whole.
49
+ for (const stream of ["stdout", "stderr"]) {
50
+ const decoder = new StringDecoder("utf8");
51
+ const pipe = command[stream];
52
+ pipe.on("data", (chunk) => {
53
+ const data = decoder.write(chunk);
54
+ if (data !== "")
55
+ request.onOutput({ stream, data });
56
+ });
57
+ pipe.on("end", () => {
58
+ const data = decoder.end();
59
+ if (data !== "")
60
+ request.onOutput({ stream, data });
61
+ });
62
+ }
63
+ command.once("spawn", () => {
64
+ started = true;
65
+ if (request.terminate.aborted)
66
+ command.kill("SIGTERM");
67
+ });
68
+ command.once("error", (error) => {
69
+ if (!started)
70
+ settle({ kind: "spawn-failed", message: error.message });
71
+ });
72
+ // `close` comes after `exit` once the pipes have closed too, so the last output has been handed on.
73
+ command.once("close", (code, signal) => settle(ended(code, signal)));
74
+ command.once("exit", (code, signal) => {
75
+ draining = setTimeout(() => {
76
+ command.stdout.destroy();
77
+ command.stderr.destroy();
78
+ settle(ended(code, signal));
79
+ }, PIPE_DRAIN_MS);
80
+ });
81
+ request.terminate.addEventListener("abort", onTerminate, { once: true });
82
+ });
83
+ }
@@ -0,0 +1,5 @@
1
+ import type { JobSummaryGateway } from "../gateways.ts";
2
+ /** The job summary at `path`, the step's `GITHUB_STEP_SUMMARY`; with none, appending is `none`. */
3
+ export declare function liveJobSummaryGateway(options: {
4
+ readonly path: string | undefined;
5
+ }): JobSummaryGateway;
@@ -0,0 +1,20 @@
1
+ // The GitHub Actions job summary: the file `GITHUB_STEP_SUMMARY` names, which GitHub renders as Markdown on the job's
2
+ // page once the step ends.
3
+ import { appendFile } from "node:fs/promises";
4
+ /** The job summary at `path`, the step's `GITHUB_STEP_SUMMARY`; with none, appending is `none`. */
5
+ export function liveJobSummaryGateway(options) {
6
+ const { path } = options;
7
+ return {
8
+ appendJobSummary: async (markdown) => {
9
+ if (path === undefined || path === "")
10
+ return { kind: "none" };
11
+ try {
12
+ await appendFile(path, markdown.endsWith("\n") ? markdown : `${markdown}\n`);
13
+ return { kind: "appended" };
14
+ }
15
+ catch (error) {
16
+ return { kind: "failed", failure: { path, message: error instanceof Error ? error.message : String(error) } };
17
+ }
18
+ },
19
+ };
20
+ }
@@ -0,0 +1,20 @@
1
+ import type { ProgressTerminal } from "../gateways.ts";
2
+ /** How often the live region is redrawn, so its spinners turn and its elapsed times count. */
3
+ export declare const LIVE_TICK_MS = 90;
4
+ /** The part of a writable stream the terminal uses: `process.stdout` and `process.stderr` have it. */
5
+ export interface ProgressStream {
6
+ readonly columns?: number;
7
+ readonly rows?: number | undefined;
8
+ write(text: string): unknown;
9
+ on(event: "error", listener: (error: Error) => void): unknown;
10
+ }
11
+ /** A progress terminal over `stdout` and `stderr`, by default this process's. */
12
+ export declare function liveProgressTerminal(options?: {
13
+ readonly stdout?: ProgressStream;
14
+ readonly stderr?: ProgressStream;
15
+ }): ProgressTerminal;
16
+ /**
17
+ * `line` cut to `width` visible columns, color codes kept whole and a reset added when it is cut. Each character
18
+ * counts as one column.
19
+ */
20
+ export declare function clip(line: string, width: number): string;