@cnc-tools/storm 0.0.0 → 0.6.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 (527) 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/exec/cleanup.d.ts +135 -0
  15. package/dist/commands/exec/cleanup.js +171 -0
  16. package/dist/commands/exec/command.d.ts +272 -0
  17. package/dist/commands/exec/command.js +23 -0
  18. package/dist/commands/exec/job-summary.d.ts +10 -0
  19. package/dist/commands/exec/job-summary.js +34 -0
  20. package/dist/commands/exec/live-view.d.ts +22 -0
  21. package/dist/commands/exec/live-view.js +395 -0
  22. package/dist/commands/exec/metadata.d.ts +66 -0
  23. package/dist/commands/exec/metadata.js +55 -0
  24. package/dist/commands/exec/mint-failed.d.ts +11 -0
  25. package/dist/commands/exec/mint-failed.js +33 -0
  26. package/dist/commands/exec/outcomes.d.ts +614 -0
  27. package/dist/commands/exec/outcomes.js +338 -0
  28. package/dist/commands/exec/progress.d.ts +44 -0
  29. package/dist/commands/exec/progress.js +277 -0
  30. package/dist/commands/exec/redaction.d.ts +15 -0
  31. package/dist/commands/exec/redaction.js +40 -0
  32. package/dist/commands/exec/run-collector.d.ts +30 -0
  33. package/dist/commands/exec/run-collector.js +73 -0
  34. package/dist/commands/exec/run-command.d.ts +221 -0
  35. package/dist/commands/exec/run-command.js +663 -0
  36. package/dist/commands/exec/run-metadata.d.ts +56 -0
  37. package/dist/commands/exec/run-metadata.js +58 -0
  38. package/dist/commands/exec/run-record.d.ts +170 -0
  39. package/dist/commands/exec/run-record.js +104 -0
  40. package/dist/commands/exec/tests-summary.d.ts +34 -0
  41. package/dist/commands/exec/tests-summary.js +141 -0
  42. package/dist/commands/exec/testserver-flags.d.ts +48 -0
  43. package/dist/commands/exec/testserver-flags.js +80 -0
  44. package/dist/commands/exec/text.d.ts +22 -0
  45. package/dist/commands/exec/text.js +74 -0
  46. package/dist/commands/exec/view.d.ts +35 -0
  47. package/dist/commands/exec/view.js +163 -0
  48. package/dist/commands/exec/waterfall.d.ts +25 -0
  49. package/dist/commands/exec/waterfall.js +108 -0
  50. package/dist/commands/exec/worker-chart.d.ts +79 -0
  51. package/dist/commands/exec/worker-chart.js +313 -0
  52. package/dist/commands/runs/facts.d.ts +150 -0
  53. package/dist/commands/runs/facts.js +292 -0
  54. package/dist/commands/runs/list/command.d.ts +86 -0
  55. package/dist/commands/runs/list/command.js +36 -0
  56. package/dist/commands/runs/list/metadata.d.ts +22 -0
  57. package/dist/commands/runs/list/metadata.js +19 -0
  58. package/dist/commands/runs/list/outcomes.d.ts +74 -0
  59. package/dist/commands/runs/list/outcomes.js +89 -0
  60. package/dist/commands/runs/logs/command.d.ts +72 -0
  61. package/dist/commands/runs/logs/command.js +51 -0
  62. package/dist/commands/runs/logs/metadata.d.ts +22 -0
  63. package/dist/commands/runs/logs/metadata.js +22 -0
  64. package/dist/commands/runs/logs/outcomes.d.ts +55 -0
  65. package/dist/commands/runs/logs/outcomes.js +80 -0
  66. package/dist/commands/runs/metadata.d.ts +3 -0
  67. package/dist/commands/runs/metadata.js +3 -0
  68. package/dist/commands/runs/past-run.d.ts +72 -0
  69. package/dist/commands/runs/past-run.js +99 -0
  70. package/dist/commands/runs/show/command.d.ts +176 -0
  71. package/dist/commands/runs/show/command.js +76 -0
  72. package/dist/commands/runs/show/metadata.d.ts +25 -0
  73. package/dist/commands/runs/show/metadata.js +22 -0
  74. package/dist/commands/runs/show/outcomes.d.ts +164 -0
  75. package/dist/commands/runs/show/outcomes.js +320 -0
  76. package/dist/commands/vitest/command.d.ts +299 -0
  77. package/dist/commands/vitest/command.js +138 -0
  78. package/dist/commands/vitest/metadata.d.ts +66 -0
  79. package/dist/commands/vitest/metadata.js +35 -0
  80. package/dist/commands/vitest/outcomes.d.ts +273 -0
  81. package/dist/commands/vitest/outcomes.js +77 -0
  82. package/dist/config/by-name.d.ts +24 -0
  83. package/dist/config/by-name.js +26 -0
  84. package/dist/config/errors.d.ts +58 -0
  85. package/dist/config/errors.js +101 -0
  86. package/dist/config/gateways.d.ts +32 -0
  87. package/dist/config/gateways.js +1 -0
  88. package/dist/config/index.d.ts +10 -0
  89. package/dist/config/index.js +13 -0
  90. package/dist/config/live/config-gateway.d.ts +6 -0
  91. package/dist/config/live/config-gateway.js +71 -0
  92. package/dist/config/load.d.ts +54 -0
  93. package/dist/config/load.js +175 -0
  94. package/dist/config/resolve.d.ts +49 -0
  95. package/dist/config/resolve.js +94 -0
  96. package/dist/config/resource-config.d.ts +132 -0
  97. package/dist/config/resource-config.js +19 -0
  98. package/dist/config/schema.d.ts +64 -0
  99. package/dist/config/schema.js +57 -0
  100. package/dist/config/set.d.ts +27 -0
  101. package/dist/config/set.js +71 -0
  102. package/dist/config/settings-file.d.ts +41 -0
  103. package/dist/config/settings-file.js +72 -0
  104. package/dist/config-file/define.d.ts +39 -0
  105. package/dist/config-file/define.js +9 -0
  106. package/dist/config-file/toolchain.d.ts +9 -0
  107. package/dist/config-file/toolchain.js +41 -0
  108. package/dist/context.d.ts +89 -0
  109. package/dist/context.js +45 -0
  110. package/dist/core/command-provider.d.ts +126 -0
  111. package/dist/core/command-provider.js +13 -0
  112. package/dist/core/command-slots.d.ts +67 -0
  113. package/dist/core/command-slots.js +136 -0
  114. package/dist/core/events.d.ts +128 -0
  115. package/dist/core/events.js +15 -0
  116. package/dist/core/gateways.d.ts +249 -0
  117. package/dist/core/gateways.js +1 -0
  118. package/dist/core/index.d.ts +20 -0
  119. package/dist/core/index.js +18 -0
  120. package/dist/core/keyed.d.ts +12 -0
  121. package/dist/core/keyed.js +24 -0
  122. package/dist/core/lane.d.ts +46 -0
  123. package/dist/core/lane.js +5 -0
  124. package/dist/core/limit.d.ts +9 -0
  125. package/dist/core/limit.js +29 -0
  126. package/dist/core/live/command-gateway.d.ts +11 -0
  127. package/dist/core/live/command-gateway.js +83 -0
  128. package/dist/core/live/job-summary-gateway.d.ts +5 -0
  129. package/dist/core/live/job-summary-gateway.js +20 -0
  130. package/dist/core/live/progress-terminal.d.ts +20 -0
  131. package/dist/core/live/progress-terminal.js +173 -0
  132. package/dist/core/live/run-directory-gateway.d.ts +24 -0
  133. package/dist/core/live/run-directory-gateway.js +437 -0
  134. package/dist/core/mint.d.ts +10 -0
  135. package/dist/core/mint.js +14 -0
  136. package/dist/core/payload.d.ts +26 -0
  137. package/dist/core/payload.js +33 -0
  138. package/dist/core/presentation.d.ts +87 -0
  139. package/dist/core/presentation.js +5 -0
  140. package/dist/core/presentations.d.ts +56 -0
  141. package/dist/core/presentations.js +66 -0
  142. package/dist/core/provider.d.ts +69 -0
  143. package/dist/core/provider.js +5 -0
  144. package/dist/core/resource.d.ts +262 -0
  145. package/dist/core/resource.js +6 -0
  146. package/dist/core/resources.d.ts +131 -0
  147. package/dist/core/resources.js +254 -0
  148. package/dist/core/run-directory.d.ts +69 -0
  149. package/dist/core/run-directory.js +94 -0
  150. package/dist/core/run-state.d.ts +152 -0
  151. package/dist/core/run-state.js +313 -0
  152. package/dist/core/run.d.ts +187 -0
  153. package/dist/core/run.js +321 -0
  154. package/dist/core/state-directory.d.ts +19 -0
  155. package/dist/core/state-directory.js +29 -0
  156. package/dist/core/timeline.d.ts +63 -0
  157. package/dist/core/timeline.js +97 -0
  158. package/dist/core/timing.d.ts +22 -0
  159. package/dist/core/timing.js +26 -0
  160. package/dist/credential/credential.d.ts +46 -0
  161. package/dist/credential/credential.js +80 -0
  162. package/dist/credential/diagnosis.d.ts +18 -0
  163. package/dist/credential/diagnosis.js +99 -0
  164. package/dist/credential/gateways.d.ts +109 -0
  165. package/dist/credential/gateways.js +1 -0
  166. package/dist/credential/index.d.ts +7 -0
  167. package/dist/credential/index.js +7 -0
  168. package/dist/credential/live/github-actions-token-gateway.d.ts +15 -0
  169. package/dist/credential/live/github-actions-token-gateway.js +43 -0
  170. package/dist/credential/live/github-actions-token-response.d.ts +19 -0
  171. package/dist/credential/live/github-actions-token-response.js +49 -0
  172. package/dist/credential/live/vercel-cli-gateway.d.ts +9 -0
  173. package/dist/credential/live/vercel-cli-gateway.js +64 -0
  174. package/dist/credential/live/vercel-output.d.ts +60 -0
  175. package/dist/credential/live/vercel-output.js +122 -0
  176. package/dist/credential/live/vercel-process.d.ts +14 -0
  177. package/dist/credential/live/vercel-process.js +3 -0
  178. package/dist/credential/settle.d.ts +31 -0
  179. package/dist/credential/settle.js +49 -0
  180. package/dist/credential/source.d.ts +110 -0
  181. package/dist/credential/source.js +114 -0
  182. package/dist/help-logo.d.ts +11 -0
  183. package/dist/help-logo.js +56 -0
  184. package/dist/presentation.d.ts +26 -0
  185. package/dist/presentation.js +21 -0
  186. package/dist/resources/github/cleanup.d.ts +23 -0
  187. package/dist/resources/github/cleanup.js +39 -0
  188. package/dist/resources/github/command.d.ts +74 -0
  189. package/dist/resources/github/command.js +117 -0
  190. package/dist/resources/github/config.d.ts +16 -0
  191. package/dist/resources/github/config.js +37 -0
  192. package/dist/resources/github/events.d.ts +26 -0
  193. package/dist/resources/github/events.js +2 -0
  194. package/dist/resources/github/fixture-repo.d.ts +69 -0
  195. package/dist/resources/github/fixture-repo.js +60 -0
  196. package/dist/resources/github/gateways.d.ts +62 -0
  197. package/dist/resources/github/gateways.js +1 -0
  198. package/dist/resources/github/index.d.ts +12 -0
  199. package/dist/resources/github/index.js +15 -0
  200. package/dist/resources/github/live/fixture-repo-gateway.d.ts +12 -0
  201. package/dist/resources/github/live/fixture-repo-gateway.js +92 -0
  202. package/dist/resources/github/live/gateways.d.ts +6 -0
  203. package/dist/resources/github/live/gateways.js +13 -0
  204. package/dist/resources/github/presentation.d.ts +13 -0
  205. package/dist/resources/github/presentation.js +43 -0
  206. package/dist/resources/github/provider.d.ts +66 -0
  207. package/dist/resources/github/provider.js +58 -0
  208. package/dist/resources/github/resource-provider.d.ts +6 -0
  209. package/dist/resources/github/resource-provider.js +20 -0
  210. package/dist/resources/github/resource.d.ts +33 -0
  211. package/dist/resources/github/resource.js +12 -0
  212. package/dist/resources/testserver/cleanup.d.ts +14 -0
  213. package/dist/resources/testserver/cleanup.js +22 -0
  214. package/dist/resources/testserver/command.d.ts +322 -0
  215. package/dist/resources/testserver/command.js +245 -0
  216. package/dist/resources/testserver/commands/app.d.ts +18 -0
  217. package/dist/resources/testserver/commands/app.js +3 -0
  218. package/dist/resources/testserver/commands/create/command.d.ts +136 -0
  219. package/dist/resources/testserver/commands/create/command.js +158 -0
  220. package/dist/resources/testserver/commands/create/metadata.d.ts +31 -0
  221. package/dist/resources/testserver/commands/create/metadata.js +45 -0
  222. package/dist/resources/testserver/commands/create/outcomes.d.ts +111 -0
  223. package/dist/resources/testserver/commands/create/outcomes.js +172 -0
  224. package/dist/resources/testserver/commands/list/command.d.ts +60 -0
  225. package/dist/resources/testserver/commands/list/command.js +56 -0
  226. package/dist/resources/testserver/commands/list/metadata.d.ts +9 -0
  227. package/dist/resources/testserver/commands/list/metadata.js +9 -0
  228. package/dist/resources/testserver/commands/list/outcomes.d.ts +54 -0
  229. package/dist/resources/testserver/commands/list/outcomes.js +152 -0
  230. package/dist/resources/testserver/config.d.ts +18 -0
  231. package/dist/resources/testserver/config.js +78 -0
  232. package/dist/resources/testserver/credential-facts.d.ts +80 -0
  233. package/dist/resources/testserver/credential-facts.js +83 -0
  234. package/dist/resources/testserver/events.d.ts +59 -0
  235. package/dist/resources/testserver/events.js +4 -0
  236. package/dist/resources/testserver/index.d.ts +16 -0
  237. package/dist/resources/testserver/index.js +24 -0
  238. package/dist/resources/testserver/lane.d.ts +28 -0
  239. package/dist/resources/testserver/lane.js +139 -0
  240. package/dist/resources/testserver/live/gateways.d.ts +6 -0
  241. package/dist/resources/testserver/live/gateways.js +26 -0
  242. package/dist/resources/testserver/options.d.ts +5 -0
  243. package/dist/resources/testserver/options.js +5 -0
  244. package/dist/resources/testserver/pool/channels.d.ts +80 -0
  245. package/dist/resources/testserver/pool/channels.js +48 -0
  246. package/dist/resources/testserver/pool/create.d.ts +48 -0
  247. package/dist/resources/testserver/pool/create.js +45 -0
  248. package/dist/resources/testserver/pool/directory.d.ts +4 -0
  249. package/dist/resources/testserver/pool/directory.js +5 -0
  250. package/dist/resources/testserver/pool/gateways.d.ts +190 -0
  251. package/dist/resources/testserver/pool/gateways.js +1 -0
  252. package/dist/resources/testserver/pool/host.d.ts +8 -0
  253. package/dist/resources/testserver/pool/host.js +21 -0
  254. package/dist/resources/testserver/pool/index.d.ts +9 -0
  255. package/dist/resources/testserver/pool/index.js +10 -0
  256. package/dist/resources/testserver/pool/inspect.d.ts +53 -0
  257. package/dist/resources/testserver/pool/inspect.js +45 -0
  258. package/dist/resources/testserver/pool/lease.d.ts +84 -0
  259. package/dist/resources/testserver/pool/lease.js +125 -0
  260. package/dist/resources/testserver/pool/live/pool-records.d.ts +17 -0
  261. package/dist/resources/testserver/pool/live/pool-records.js +70 -0
  262. package/dist/resources/testserver/pool/live/pool-store-gateway.d.ts +12 -0
  263. package/dist/resources/testserver/pool/live/pool-store-gateway.js +435 -0
  264. package/dist/resources/testserver/pool/staleness.d.ts +16 -0
  265. package/dist/resources/testserver/pool/staleness.js +27 -0
  266. package/dist/resources/testserver/presentation.d.ts +9 -0
  267. package/dist/resources/testserver/presentation.js +217 -0
  268. package/dist/resources/testserver/provider.d.ts +177 -0
  269. package/dist/resources/testserver/provider.js +254 -0
  270. package/dist/resources/testserver/ran.d.ts +87 -0
  271. package/dist/resources/testserver/ran.js +140 -0
  272. package/dist/resources/testserver/resource-provider.d.ts +12 -0
  273. package/dist/resources/testserver/resource-provider.js +38 -0
  274. package/dist/resources/testserver/resource.d.ts +32 -0
  275. package/dist/resources/testserver/resource.js +10 -0
  276. package/dist/resources/testserver/run-sandbox.d.ts +13 -0
  277. package/dist/resources/testserver/run-sandbox.js +6 -0
  278. package/dist/resources/testserver/sandbox/channels.d.ts +12 -0
  279. package/dist/resources/testserver/sandbox/channels.js +21 -0
  280. package/dist/resources/testserver/sandbox/create-failure.d.ts +35 -0
  281. package/dist/resources/testserver/sandbox/create-failure.js +65 -0
  282. package/dist/resources/testserver/sandbox/create.d.ts +29 -0
  283. package/dist/resources/testserver/sandbox/create.js +37 -0
  284. package/dist/resources/testserver/sandbox/gateways.d.ts +150 -0
  285. package/dist/resources/testserver/sandbox/gateways.js +1 -0
  286. package/dist/resources/testserver/sandbox/index.d.ts +6 -0
  287. package/dist/resources/testserver/sandbox/index.js +7 -0
  288. package/dist/resources/testserver/sandbox/live/builds-response.d.ts +9 -0
  289. package/dist/resources/testserver/sandbox/live/builds-response.js +27 -0
  290. package/dist/resources/testserver/sandbox/live/control-plane-gateway.d.ts +17 -0
  291. package/dist/resources/testserver/sandbox/live/control-plane-gateway.js +133 -0
  292. package/dist/resources/testserver/sandbox/live/create-response.d.ts +35 -0
  293. package/dist/resources/testserver/sandbox/live/create-response.js +78 -0
  294. package/dist/resources/testserver/sandbox/live/fetch-failure.d.ts +24 -0
  295. package/dist/resources/testserver/sandbox/live/fetch-failure.js +45 -0
  296. package/dist/resources/testserver/sandbox/live/health-check-gateway.d.ts +11 -0
  297. package/dist/resources/testserver/sandbox/live/health-check-gateway.js +36 -0
  298. package/dist/resources/testserver/sandbox/live/sse.d.ts +12 -0
  299. package/dist/resources/testserver/sandbox/live/sse.js +32 -0
  300. package/dist/resources.d.ts +455 -0
  301. package/dist/resources.js +88 -0
  302. package/dist/runner/base.d.ts +40 -0
  303. package/dist/runner/base.js +52 -0
  304. package/dist/runner/context.d.ts +13 -0
  305. package/dist/runner/context.js +9 -0
  306. package/dist/runner/events.d.ts +179 -0
  307. package/dist/runner/events.js +16 -0
  308. package/dist/runner/gateways.d.ts +351 -0
  309. package/dist/runner/gateways.js +3 -0
  310. package/dist/runner/index.d.ts +19 -0
  311. package/dist/runner/index.js +18 -0
  312. package/dist/runner/live/checkout-gateway.d.ts +3 -0
  313. package/dist/runner/live/checkout-gateway.js +206 -0
  314. package/dist/runner/live/git-output.d.ts +14 -0
  315. package/dist/runner/live/git-output.js +32 -0
  316. package/dist/runner/live/sandbox-errors.d.ts +7 -0
  317. package/dist/runner/live/sandbox-errors.js +21 -0
  318. package/dist/runner/live/sandbox-gateway.d.ts +7 -0
  319. package/dist/runner/live/sandbox-gateway.js +427 -0
  320. package/dist/runner/live/snapshot-cache-gateway.d.ts +12 -0
  321. package/dist/runner/live/snapshot-cache-gateway.js +104 -0
  322. package/dist/runner/live/snapshot-records.d.ts +11 -0
  323. package/dist/runner/live/snapshot-records.js +57 -0
  324. package/dist/runner/live/terminal.d.ts +16 -0
  325. package/dist/runner/live/terminal.js +37 -0
  326. package/dist/runner/live/user.d.ts +2 -0
  327. package/dist/runner/live/user.js +11 -0
  328. package/dist/runner/output.d.ts +23 -0
  329. package/dist/runner/output.js +58 -0
  330. package/dist/runner/prepare.d.ts +67 -0
  331. package/dist/runner/prepare.js +59 -0
  332. package/dist/runner/ready.d.ts +68 -0
  333. package/dist/runner/ready.js +159 -0
  334. package/dist/runner/recipe.d.ts +126 -0
  335. package/dist/runner/recipe.js +302 -0
  336. package/dist/runner/remote-command.d.ts +77 -0
  337. package/dist/runner/remote-command.js +127 -0
  338. package/dist/runner/scope.d.ts +58 -0
  339. package/dist/runner/scope.js +117 -0
  340. package/dist/runner/snapshot-build.d.ts +33 -0
  341. package/dist/runner/snapshot-build.js +112 -0
  342. package/dist/runner/snapshot-cache.d.ts +84 -0
  343. package/dist/runner/snapshot-cache.js +126 -0
  344. package/dist/runner/snapshot-key.d.ts +52 -0
  345. package/dist/runner/snapshot-key.js +91 -0
  346. package/dist/runner/steps.d.ts +41 -0
  347. package/dist/runner/steps.js +49 -0
  348. package/dist/sdk/container/api-request.d.ts +32 -0
  349. package/dist/sdk/container/api-request.js +46 -0
  350. package/dist/sdk/container/container.d.ts +144 -0
  351. package/dist/sdk/container/container.js +346 -0
  352. package/dist/sdk/container/feature-flags.d.ts +37 -0
  353. package/dist/sdk/container/feature-flags.js +118 -0
  354. package/dist/sdk/container/gateways.d.ts +108 -0
  355. package/dist/sdk/container/gateways.js +1 -0
  356. package/dist/sdk/container/index.d.ts +5 -0
  357. package/dist/sdk/container/index.js +5 -0
  358. package/dist/sdk/container/live/container-gateway.d.ts +17 -0
  359. package/dist/sdk/container/live/container-gateway.js +114 -0
  360. package/dist/sdk/factories/build.d.ts +66 -0
  361. package/dist/sdk/factories/build.js +98 -0
  362. package/dist/sdk/factories/definition.d.ts +28 -0
  363. package/dist/sdk/factories/definition.js +16 -0
  364. package/dist/sdk/factories/definitions.d.ts +166 -0
  365. package/dist/sdk/factories/definitions.js +235 -0
  366. package/dist/sdk/factories/gateways.d.ts +25 -0
  367. package/dist/sdk/factories/gateways.js +1 -0
  368. package/dist/sdk/factories/index.d.ts +5 -0
  369. package/dist/sdk/factories/index.js +5 -0
  370. package/dist/sdk/factories/live/factory-gateway.d.ts +10 -0
  371. package/dist/sdk/factories/live/factory-gateway.js +29 -0
  372. package/dist/sdk/index.d.ts +7 -0
  373. package/dist/sdk/index.js +15 -0
  374. package/dist/sdk/payload/index.d.ts +2 -0
  375. package/dist/sdk/payload/index.js +4 -0
  376. package/dist/sdk/payload/payload.d.ts +47 -0
  377. package/dist/sdk/payload/payload.js +74 -0
  378. package/dist/sdk/payload/test-events.d.ts +102 -0
  379. package/dist/sdk/payload/test-events.js +59 -0
  380. package/dist/sdk/proxy/exchange.d.ts +58 -0
  381. package/dist/sdk/proxy/exchange.js +173 -0
  382. package/dist/sdk/proxy/faulted-exchange.d.ts +10 -0
  383. package/dist/sdk/proxy/faulted-exchange.js +106 -0
  384. package/dist/sdk/proxy/faults.d.ts +133 -0
  385. package/dist/sdk/proxy/faults.js +147 -0
  386. package/dist/sdk/proxy/index.d.ts +3 -0
  387. package/dist/sdk/proxy/index.js +3 -0
  388. package/dist/sdk/proxy/proxy.d.ts +93 -0
  389. package/dist/sdk/proxy/proxy.js +99 -0
  390. package/dist/sdk/proxy/records.d.ts +56 -0
  391. package/dist/sdk/proxy/records.js +56 -0
  392. package/dist/sdk/records/body.d.ts +89 -0
  393. package/dist/sdk/records/body.js +236 -0
  394. package/dist/sdk/records/index.d.ts +2 -0
  395. package/dist/sdk/records/index.js +4 -0
  396. package/dist/sdk/records/records.d.ts +49 -0
  397. package/dist/sdk/records/records.js +16 -0
  398. package/dist/sdk/seed/index.d.ts +1 -0
  399. package/dist/sdk/seed/index.js +3 -0
  400. package/dist/sdk/seed/seed.d.ts +221 -0
  401. package/dist/sdk/seed/seed.js +171 -0
  402. package/dist/sdk/testserver/clock.d.ts +8 -0
  403. package/dist/sdk/testserver/clock.js +10 -0
  404. package/dist/sdk/testserver/failure.d.ts +73 -0
  405. package/dist/sdk/testserver/failure.js +61 -0
  406. package/dist/sdk/testserver/index.d.ts +5 -0
  407. package/dist/sdk/testserver/index.js +8 -0
  408. package/dist/sdk/testserver/live/connect-failure.d.ts +7 -0
  409. package/dist/sdk/testserver/live/connect-failure.js +30 -0
  410. package/dist/sdk/testserver/live/request.d.ts +69 -0
  411. package/dist/sdk/testserver/live/request.js +89 -0
  412. package/dist/sdk/testserver/service-ids.d.ts +19 -0
  413. package/dist/sdk/testserver/service-ids.js +77 -0
  414. package/dist/sdk/testserver/test-id.d.ts +15 -0
  415. package/dist/sdk/testserver/test-id.js +28 -0
  416. package/dist/story/align.d.ts +37 -0
  417. package/dist/story/align.js +39 -0
  418. package/dist/story/artifact.d.ts +60 -0
  419. package/dist/story/artifact.js +93 -0
  420. package/dist/story/definition.d.ts +52 -0
  421. package/dist/story/definition.js +9 -0
  422. package/dist/story/diff.d.ts +9 -0
  423. package/dist/story/diff.js +97 -0
  424. package/dist/story/errors.d.ts +14 -0
  425. package/dist/story/errors.js +21 -0
  426. package/dist/story/gateways.d.ts +74 -0
  427. package/dist/story/gateways.js +3 -0
  428. package/dist/story/host.d.ts +27 -0
  429. package/dist/story/host.js +97 -0
  430. package/dist/story/index.d.ts +7 -0
  431. package/dist/story/index.js +9 -0
  432. package/dist/story/json.d.ts +16 -0
  433. package/dist/story/json.js +59 -0
  434. package/dist/story/live/artifact-gateway.d.ts +2 -0
  435. package/dist/story/live/artifact-gateway.js +82 -0
  436. package/dist/story/mode.d.ts +17 -0
  437. package/dist/story/mode.js +21 -0
  438. package/dist/story/orphans.d.ts +17 -0
  439. package/dist/story/orphans.js +15 -0
  440. package/dist/story/report.d.ts +30 -0
  441. package/dist/story/report.js +118 -0
  442. package/dist/story/run.d.ts +49 -0
  443. package/dist/story/run.js +160 -0
  444. package/dist/story/sequence.d.ts +30 -0
  445. package/dist/story/sequence.js +74 -0
  446. package/dist/story/settle.d.ts +94 -0
  447. package/dist/story/settle.js +70 -0
  448. package/dist/time/duration.d.ts +19 -0
  449. package/dist/time/duration.js +37 -0
  450. package/dist/time/index.d.ts +2 -0
  451. package/dist/time/index.js +4 -0
  452. package/dist/time/time.d.ts +15 -0
  453. package/dist/time/time.js +23 -0
  454. package/dist/vercel-cli/ansi.d.ts +13 -0
  455. package/dist/vercel-cli/ansi.js +32 -0
  456. package/dist/vercel-cli/arguments.d.ts +25 -0
  457. package/dist/vercel-cli/arguments.js +78 -0
  458. package/dist/vercel-cli/auth-config.d.ts +43 -0
  459. package/dist/vercel-cli/auth-config.js +36 -0
  460. package/dist/vercel-cli/clock.d.ts +9 -0
  461. package/dist/vercel-cli/clock.js +10 -0
  462. package/dist/vercel-cli/config-files.d.ts +24 -0
  463. package/dist/vercel-cli/config-files.js +40 -0
  464. package/dist/vercel-cli/context.d.ts +12 -0
  465. package/dist/vercel-cli/context.js +12 -0
  466. package/dist/vercel-cli/driver.d.ts +218 -0
  467. package/dist/vercel-cli/driver.js +364 -0
  468. package/dist/vercel-cli/entry.d.ts +8 -0
  469. package/dist/vercel-cli/entry.js +13 -0
  470. package/dist/vercel-cli/environment.d.ts +33 -0
  471. package/dist/vercel-cli/environment.js +72 -0
  472. package/dist/vercel-cli/errors.d.ts +8 -0
  473. package/dist/vercel-cli/errors.js +8 -0
  474. package/dist/vercel-cli/gateways.d.ts +103 -0
  475. package/dist/vercel-cli/gateways.js +4 -0
  476. package/dist/vercel-cli/index.d.ts +10 -0
  477. package/dist/vercel-cli/index.js +15 -0
  478. package/dist/vercel-cli/invocation.d.ts +234 -0
  479. package/dist/vercel-cli/invocation.js +397 -0
  480. package/dist/vercel-cli/keys.d.ts +14 -0
  481. package/dist/vercel-cli/keys.js +12 -0
  482. package/dist/vercel-cli/live/config-files.d.ts +28 -0
  483. package/dist/vercel-cli/live/config-files.js +66 -0
  484. package/dist/vercel-cli/live/process-gateway.d.ts +14 -0
  485. package/dist/vercel-cli/live/process-gateway.js +178 -0
  486. package/dist/vercel-cli/redaction.d.ts +13 -0
  487. package/dist/vercel-cli/redaction.js +22 -0
  488. package/dist/vercel-cli/report.d.ts +22 -0
  489. package/dist/vercel-cli/report.js +110 -0
  490. package/dist/vercel-cli/verbose.d.ts +7 -0
  491. package/dist/vercel-cli/verbose.js +24 -0
  492. package/dist/version.d.ts +20 -0
  493. package/dist/version.js +57 -0
  494. package/dist/vitest/config.d.ts +51 -0
  495. package/dist/vitest/config.js +61 -0
  496. package/dist/vitest/container-scope.d.ts +108 -0
  497. package/dist/vitest/container-scope.js +234 -0
  498. package/dist/vitest/diagnostics.d.ts +146 -0
  499. package/dist/vitest/diagnostics.js +306 -0
  500. package/dist/vitest/find-vitest.d.ts +7 -0
  501. package/dist/vitest/find-vitest.js +28 -0
  502. package/dist/vitest/fixtures.d.ts +64 -0
  503. package/dist/vitest/fixtures.js +172 -0
  504. package/dist/vitest/gateways.d.ts +78 -0
  505. package/dist/vitest/gateways.js +4 -0
  506. package/dist/vitest/index.d.ts +3 -0
  507. package/dist/vitest/index.js +9 -0
  508. package/dist/vitest/list-output.d.ts +3 -0
  509. package/dist/vitest/list-output.js +19 -0
  510. package/dist/vitest/live/list-gateway.d.ts +11 -0
  511. package/dist/vitest/live/list-gateway.js +107 -0
  512. package/dist/vitest/ownership.d.ts +29 -0
  513. package/dist/vitest/ownership.js +68 -0
  514. package/dist/vitest/plan.d.ts +66 -0
  515. package/dist/vitest/plan.js +104 -0
  516. package/dist/vitest/sandbox.d.ts +16 -0
  517. package/dist/vitest/sandbox.js +35 -0
  518. package/dist/vitest/test-events.d.ts +41 -0
  519. package/dist/vitest/test-events.js +92 -0
  520. package/dist/vitest/test-results.d.ts +84 -0
  521. package/dist/vitest/test-results.js +160 -0
  522. package/dist/vitest/types.d.ts +68 -0
  523. package/dist/vitest/types.js +4 -0
  524. package/package.json +119 -3
  525. package/skills/overview.md +33 -0
  526. package/skills/read-run-output.md +65 -0
  527. package/README.md +0 -3
@@ -0,0 +1,80 @@
1
+ // A run's own flags for the Testserver pool resource's options, `exec`'s and `vitest`'s, `--testserver-<option>`, the
2
+ // one way to give one on the command line: `--set` refuses their key paths and names the flag (`TESTSERVER_OWN_FLAGS`).
3
+ // Each flag's value passes its option's rule, as a value from the file does, and counts as a flag's when the options
4
+ // are merged, so the precedence (flag, then file, then default) and the checks across options stay the resource
5
+ // config's.
6
+ import { fileOptions, givenOptionsOf, optionKeyPath, } from "../../config/index.js";
7
+ import { RESOURCE_CONFIGS } from "../../resources.js";
8
+ /**
9
+ * Each Testserver pool option's flag, by option. An option the resource gains or loses fails to compile here until its
10
+ * flag follows; the run's request fields (`RUN_REQUEST_FIELDS`) declare each by hand, and the run's help names each
11
+ * flag.
12
+ */
13
+ export const TESTSERVER_FLAGS = {
14
+ sandboxes: { field: "testserverSandboxes", flag: "--testserver-sandboxes" },
15
+ build: { field: "testserverBuild", flag: "--testserver-build" },
16
+ minTimeLeft: { field: "testserverMinTimeLeft", flag: "--testserver-min-time-left" },
17
+ ttl: { field: "testserverTtl", flag: "--testserver-ttl" },
18
+ noCreate: { field: "testserverNoCreate", flag: "--testserver-no-create" },
19
+ };
20
+ function isTestserverPoolConfig(config) {
21
+ return config.name === "testserverPool";
22
+ }
23
+ function testserverPoolConfig() {
24
+ const config = RESOURCE_CONFIGS.find(isTestserverPoolConfig);
25
+ if (config === undefined)
26
+ throw new Error("The registry has no testserverPool resource config");
27
+ return config;
28
+ }
29
+ const CONFIG = testserverPoolConfig();
30
+ /** Each option's rule, by name, as the generic machinery reads them. */
31
+ const RULES = CONFIG.options;
32
+ /** The key path of each option with a flag, with that flag, for `parseSetFlags`, which refuses them by the flag. */
33
+ export const TESTSERVER_OWN_FLAGS = Object.fromEntries(Object.entries(TESTSERVER_FLAGS).map(([option, { flag }]) => [optionKeyPath(CONFIG.name, option), flag]));
34
+ /** Checks each flag given in `request` by its option's rule. */
35
+ function readTestserverFlags(request) {
36
+ const values = {};
37
+ const problems = [];
38
+ for (const [option, { field, flag }] of Object.entries(TESTSERVER_FLAGS)) {
39
+ const value = request[field];
40
+ if (value === undefined)
41
+ continue;
42
+ const rule = RULES[option];
43
+ if (rule === undefined)
44
+ throw new Error(`testserverPool has no option ${option}`);
45
+ const checked = rule.check(value);
46
+ if (checked.ok)
47
+ values[option] = checked.value;
48
+ else
49
+ problems.push(...checked.problems.map(({ problem }) => ({ field, message: `${flag} ${problem}.` })));
50
+ }
51
+ if (problems.length > 0)
52
+ return { ok: false, problems };
53
+ return { ok: true, values: Object.keys(values).length === 0 ? undefined : givenOptionsOf(CONFIG, values) };
54
+ }
55
+ /** Each flag value in `request` its option's rule refuses, such as `--testserver-sandboxes` of 40. */
56
+ export function testserverFlagProblems(request) {
57
+ const read = readTestserverFlags(request);
58
+ return read.ok ? [] : read.problems;
59
+ }
60
+ /**
61
+ * The values `--set` gave, `sets`, with the Testserver pool options the flags in `request` gave. `--set` takes none of
62
+ * them, so nothing is overridden. Any flag gives the run the Testserver pool resource, as the file's section does.
63
+ */
64
+ export function withTestserverFlags(sets, request) {
65
+ const read = readTestserverFlags(request);
66
+ // `validate` refused every flag value its option's rule refuses.
67
+ if (!read.ok)
68
+ throw new Error(`The flags should have been refused: ${read.problems.map((p) => p.message).join(" ")}`);
69
+ return read.values === undefined ? sets : { ...sets, testserverPool: read.values };
70
+ }
71
+ /**
72
+ * Where the Testserver sandbox count of a run holding the Testserver pool resource came from: `--testserver-sandboxes`
73
+ * in `request`, else `resources.testserverPool.sandboxes` in `file`, else the option's default. `--set` takes no
74
+ * Testserver pool option, so these are the only sources.
75
+ */
76
+ export function testserverSandboxesSource(request, file) {
77
+ if (request[TESTSERVER_FLAGS.sandboxes.field] !== undefined)
78
+ return "flag";
79
+ return fileOptions(file, CONFIG)?.sandboxes === undefined ? "default" : "file";
80
+ }
@@ -0,0 +1,22 @@
1
+ import { type Paint } from "../../core/index.ts";
2
+ /** `ms` as progress and the summaries show it: seconds to one decimal and `s`. */
3
+ export declare function seconds(ms: number): string;
4
+ /** A keep time as progress names it: whole hours as `2h`, otherwise minutes, such as `30m` or `90m`. */
5
+ export declare function keepTimeText(ms: number): string;
6
+ /** An ISO time as progress and `storm runs` show it: to the second, in UTC. */
7
+ export declare function isoSecondsText(iso: string): string;
8
+ /** A commit as progress names it: its first 12 characters. */
9
+ export declare function short(sha: string): string;
10
+ /** A test file as the tests summary names it: its last two path parts, without `.test.ts` or the like. */
11
+ export declare function shortFile(file: string): string;
12
+ /** The middle of a sorted list, or the mean of its two middles. */
13
+ export declare function median(values: readonly number[]): number | undefined;
14
+ export type { Paint } from "../../core/index.ts";
15
+ /** The paint for `color`: green, red, yellow, cyan, dim and bold, or none. */
16
+ export declare function paint(color: boolean): Paint;
17
+ /** `text`'s width in columns, color codes left out; each character counts as one. */
18
+ export declare function visibleLength(text: string): number;
19
+ /** `text` cut to `width` visible columns, ending in `…` when cut; color codes are dropped from a cut text. */
20
+ export declare function truncate(text: string, width: number): string;
21
+ /** `left` and `right` on one line of `width` columns, `right` flush right, `left` cut to fit. */
22
+ export declare function spread(left: string, right: string, width: number): string;
@@ -0,0 +1,74 @@
1
+ // Text helpers the run's progress, live view and summaries share: durations, commits and test files as they show,
2
+ // color codes by role, and widths that skip them.
3
+ import { secondsOf, secondsText } from "../../core/index.js";
4
+ /** `ms` as progress and the summaries show it: seconds to one decimal and `s`. */
5
+ export function seconds(ms) {
6
+ return secondsText(secondsOf(ms));
7
+ }
8
+ /** A keep time as progress names it: whole hours as `2h`, otherwise minutes, such as `30m` or `90m`. */
9
+ export function keepTimeText(ms) {
10
+ const minutes = Math.round(ms / 60_000);
11
+ return minutes >= 60 && minutes % 60 === 0 ? `${minutes / 60}h` : `${minutes}m`;
12
+ }
13
+ /** An ISO time as progress and `storm runs` show it: to the second, in UTC. */
14
+ export function isoSecondsText(iso) {
15
+ return iso.replace(/\.\d+Z$/, "Z");
16
+ }
17
+ /** A commit as progress names it: its first 12 characters. */
18
+ export function short(sha) {
19
+ return sha.slice(0, 12);
20
+ }
21
+ /** A test file as the tests summary names it: its last two path parts, without `.test.ts` or the like. */
22
+ export function shortFile(file) {
23
+ const parts = file.split("/").filter((part) => part !== "");
24
+ return parts
25
+ .slice(-2)
26
+ .join("/")
27
+ .replace(/\.(test|spec)\.[cm]?[jt]sx?$/, "")
28
+ .replace(/\.[cm]?[jt]sx?$/, "");
29
+ }
30
+ /** The middle of a sorted list, or the mean of its two middles. */
31
+ export function median(values) {
32
+ const sorted = [...values].toSorted((a, b) => a - b);
33
+ if (sorted.length === 0)
34
+ return undefined;
35
+ const middle = Math.floor(sorted.length / 2);
36
+ return sorted.length % 2 === 1 ? sorted[middle] : ((sorted[middle - 1] ?? 0) + (sorted[middle] ?? 0)) / 2;
37
+ }
38
+ const code = (open, close) => (text) => text === "" ? text : `\u001b[${open}m${text}\u001b[${close}m`;
39
+ /** The paint for `color`: green, red, yellow, cyan, dim and bold, or none. */
40
+ export function paint(color) {
41
+ if (!color) {
42
+ const none = (text) => text;
43
+ return { done: none, failed: none, stopped: none, active: none, faint: none, strong: none };
44
+ }
45
+ return {
46
+ done: code(32, 39),
47
+ failed: code(31, 39),
48
+ stopped: code(33, 39),
49
+ active: code(36, 39),
50
+ faint: code(2, 22),
51
+ strong: code(1, 22),
52
+ };
53
+ }
54
+ // oxlint-disable-next-line no-control-regex -- a color code starts with ESC.
55
+ const COLOR_CODE = /\u001b\[[0-9;]*m/g;
56
+ /** `text`'s width in columns, color codes left out; each character counts as one. */
57
+ export function visibleLength(text) {
58
+ return Array.from(text.replace(COLOR_CODE, "")).length;
59
+ }
60
+ /** `text` cut to `width` visible columns, ending in `…` when cut; color codes are dropped from a cut text. */
61
+ export function truncate(text, width) {
62
+ if (visibleLength(text) <= width)
63
+ return text;
64
+ const plain = Array.from(text.replace(COLOR_CODE, ""));
65
+ return width <= 0 ? "" : `${plain.slice(0, width - 1).join("")}…`;
66
+ }
67
+ /** `left` and `right` on one line of `width` columns, `right` flush right, `left` cut to fit. */
68
+ export function spread(left, right, width) {
69
+ if (right === "")
70
+ return truncate(left, width);
71
+ const room = width - visibleLength(right) - 1;
72
+ const fitted = truncate(left, Math.max(0, room));
73
+ return `${fitted}${" ".repeat(Math.max(1, width - visibleLength(fitted) - visibleLength(right)))}${right}`;
74
+ }
@@ -0,0 +1,35 @@
1
+ import type { Presentation } from "../../presentation.ts";
2
+ import { type ProgressTerminal } from "../../core/index.ts";
3
+ import { type StormRunObserver } from "../../resources.ts";
4
+ import type { RunnerTerminal } from "../../runner/index.ts";
5
+ import type { Clock } from "../../time/index.ts";
6
+ import { type Paint } from "./text.ts";
7
+ /** A run's view: what hears its events, where the command's output goes, and how the summary prints. */
8
+ export interface RunView {
9
+ readonly observer: StormRunObserver;
10
+ /** The terminal the command's output reaches, in either kind of run. */
11
+ readonly runnerTerminal: RunnerTerminal;
12
+ /** The width the summary is laid out in. */
13
+ readonly width: number;
14
+ readonly paint: Paint;
15
+ /** Ends any live region, then prints `summary`'s lines; under `--json`, prints nothing. */
16
+ finish(summary: readonly string[]): Promise<void>;
17
+ }
18
+ /**
19
+ * The view for `presentation`. Without `progress`, as under `--json`, it shows nothing. A plain view writes its
20
+ * lines through `progress`; a live view draws on `context.progressTerminal`, where the command's output also goes,
21
+ * above the live region, and with `showOutput` each step's output too. `verbose` tells each
22
+ * resource's presentation, such as the Testserver pool's, which then adds each create's progress messages, and adds
23
+ * each step's output to a live view.
24
+ */
25
+ export declare function runView(options: {
26
+ readonly presentation: Presentation;
27
+ readonly progress: ((line: string) => Promise<void>) | undefined;
28
+ readonly context: {
29
+ readonly progressTerminal: ProgressTerminal;
30
+ readonly runnerTerminal: RunnerTerminal;
31
+ readonly clock: Clock;
32
+ };
33
+ readonly showOutput: boolean;
34
+ readonly verbose: boolean;
35
+ }): RunView;
@@ -0,0 +1,163 @@
1
+ // How a run shows as it goes and once it is done, by presentation: nothing under `--json`, plain lines, or a live
2
+ // view on a terminal. Each view also says where the command's output goes, in either kind of run, so the live region
3
+ // is the one writer on the terminal.
4
+ import { EMPTY_RUN_STATE } from "../../core/index.js";
5
+ import { applyStormRunEvent, RESOURCE_PRESENTATIONS, } from "../../resources.js";
6
+ import { activePhase, headerLine, phaseFrame, phaseRecord } from "./live-view.js";
7
+ import { cacheWriteFailureText, lineProgress, preparedNoteTexts, progressLine } from "./progress.js";
8
+ import { paint } from "./text.js";
9
+ /** The plain summary's width when stderr reports none: 80 columns. */
10
+ const PLAIN_WIDTH = 80;
11
+ /**
12
+ * The view for `presentation`. Without `progress`, as under `--json`, it shows nothing. A plain view writes its
13
+ * lines through `progress`; a live view draws on `context.progressTerminal`, where the command's output also goes,
14
+ * above the live region, and with `showOutput` each step's output too. `verbose` tells each
15
+ * resource's presentation, such as the Testserver pool's, which then adds each create's progress messages, and adds
16
+ * each step's output to a live view.
17
+ */
18
+ export function runView(options) {
19
+ const { presentation, progress, context } = options;
20
+ if (progress === undefined)
21
+ return {
22
+ observer: { observe: async () => { } },
23
+ runnerTerminal: context.runnerTerminal,
24
+ width: PLAIN_WIDTH,
25
+ paint: paint(false),
26
+ finish: async () => { },
27
+ };
28
+ if (presentation.kind === "plain") {
29
+ const writer = droppingWriter(progress);
30
+ return {
31
+ observer: lineProgress(writer, { github: presentation.github, verbose: options.verbose }),
32
+ runnerTerminal: context.runnerTerminal,
33
+ width: Math.min(Math.max(presentation.columns ?? PLAIN_WIDTH, 60), 120),
34
+ paint: paint(presentation.color),
35
+ finish: async (summary) => {
36
+ for (const line of summary)
37
+ await writer(line);
38
+ },
39
+ };
40
+ }
41
+ return liveView(context, paint(presentation.color), {
42
+ showOutput: options.showOutput || options.verbose,
43
+ verbose: options.verbose,
44
+ });
45
+ }
46
+ /** `write`, until a write fails: then it drops every later line and still resolves. */
47
+ function droppingWriter(write) {
48
+ let failed = false;
49
+ return async (line) => {
50
+ if (failed)
51
+ return;
52
+ try {
53
+ await write(line);
54
+ }
55
+ catch {
56
+ failed = true;
57
+ }
58
+ };
59
+ }
60
+ /**
61
+ * The live view: the run's phases in order. The phase that runs shows in the live region, drawn from the state the
62
+ * run's events build; once the next starts, it is printed above in its final form, so the terminal reads in time
63
+ * order. The command's output, local or remote, prints above the region as it arrives. What a phase can't hold, such as a cache note or a resource's notice, is printed above as it happens, as a
64
+ * plain line.
65
+ */
66
+ function liveView(context, colors, options) {
67
+ const { showOutput } = options;
68
+ const terminal = context.progressTerminal;
69
+ let state = EMPTY_RUN_STATE;
70
+ let phase;
71
+ let headerPrinted = false;
72
+ /** Whether the region shows. */
73
+ let live = false;
74
+ let finished = false;
75
+ // One column short of the width: the live region keeps the last column free, so no row touches the edge.
76
+ const width = () => terminal.columns() - 1;
77
+ const frame = () => phase === undefined || finished ? [] : phaseFrame(state, phase, context.clock.now().getTime(), width(), colors);
78
+ const print = (lines) => {
79
+ if (lines.length > 0)
80
+ terminal.print("stderr", lines.map((line) => `${line}\n`).join(""));
81
+ };
82
+ const header = () => {
83
+ if (headerPrinted)
84
+ return [];
85
+ headerPrinted = true;
86
+ return [headerLine(state, colors)];
87
+ };
88
+ return {
89
+ observer: {
90
+ observe: async (timed) => {
91
+ if (finished)
92
+ return;
93
+ state = applyStormRunEvent(state, timed);
94
+ const next = activePhase(state);
95
+ if (next !== phase) {
96
+ print([
97
+ ...(next === undefined ? [] : header()),
98
+ ...(phase === undefined ? [] : phaseRecord(state, phase, width(), colors)),
99
+ ]);
100
+ phase = next;
101
+ }
102
+ print(noticeLines(timed, state.origin ?? timed.at.getTime(), options.verbose));
103
+ const { event } = timed;
104
+ if (showOutput && event.kind === "runner" && event.event.kind === "step-output")
105
+ print([event.event.line]);
106
+ if (!live) {
107
+ terminal.show(frame);
108
+ live = true;
109
+ }
110
+ },
111
+ },
112
+ runnerTerminal: {
113
+ color: context.runnerTerminal.color,
114
+ writeStdout: (text) => terminal.print("stdout", text),
115
+ writeStderr: (text) => terminal.print("stderr", text),
116
+ },
117
+ // The terminal may have been resized by the time the summary prints.
118
+ get width() {
119
+ return terminal.columns();
120
+ },
121
+ paint: colors,
122
+ finish: async (summary) => {
123
+ if (finished)
124
+ return;
125
+ finished = true;
126
+ print([...header(), ...(phase === undefined ? [] : phaseRecord(state, phase, width(), colors)), ...summary]);
127
+ terminal.settle();
128
+ },
129
+ };
130
+ }
131
+ /**
132
+ * The notices for `timed`: what the live view's phases can't hold, such as a cache note or a resource's notice, as
133
+ * plain lines with their time since `origin` and their lane. `verbose` tells the resources' presentations.
134
+ */
135
+ function noticeLines(timed, origin, verbose) {
136
+ const line = (lane, text) => progressLine(timed.at.getTime() - origin, lane, text);
137
+ const { event } = timed;
138
+ switch (event.kind) {
139
+ case "runner-prepared":
140
+ return preparedNoteTexts(event).map((text) => line("runner", text));
141
+ case "runner":
142
+ return event.event.kind === "snapshot-entry-not-written"
143
+ ? [line("runner", cacheWriteFailureText(event.event.failure))]
144
+ : [];
145
+ case "resource":
146
+ return RESOURCE_PRESENTATIONS.notices(event, { verbose }).map(({ lane, text }) => line(lane, text));
147
+ case "started":
148
+ case "requesting-token":
149
+ case "minting":
150
+ case "minted":
151
+ case "cleanup-started":
152
+ case "cleanup-finished":
153
+ case "command-started":
154
+ case "command-ended":
155
+ case "lanes-started":
156
+ case "lane-started":
157
+ case "lane-ended":
158
+ case "test":
159
+ case "test-event-unreadable":
160
+ case "test-events-incomplete":
161
+ return [];
162
+ }
163
+ }
@@ -0,0 +1,25 @@
1
+ import { type StormTimeline, type StormTimelineRowName } from "../../resources.ts";
2
+ import { type Paint } from "./text.ts";
3
+ import { type WorkerLane } from "./worker-chart.ts";
4
+ /** What the waterfall says beside the timeline. */
5
+ export interface WaterfallExtras {
6
+ /** The terminal's width, at least 60. */
7
+ readonly width: number;
8
+ /** The run directory, as a person reads it, such as `~/.local/state/storm/runs/…`; undefined when none. */
9
+ readonly logs: string | undefined;
10
+ /** Lines between the critical path and the logs line, such as the tests' summary. */
11
+ readonly details?: readonly string[];
12
+ /** The worker chart, drawn under the `tests` row as its breakdown; none when empty. */
13
+ readonly workers?: readonly WorkerLane[];
14
+ /** How bars are painted: the critical path's stand out, the idle stretch and the axis are faint. */
15
+ readonly paint?: Paint;
16
+ }
17
+ /**
18
+ * A lane as the waterfall and the job summary name it: the credential, each resource lane by its presentation's label,
19
+ * such as `testserver-setup`, the runner's setup, the tests and the cleanup.
20
+ */
21
+ export declare function laneLabel(name: StormTimelineRowName): string;
22
+ /** A critical path step: its lane's label, and for the runner what it did with its runner snapshot. */
23
+ export declare function criticalPathStep(name: StormTimelineRowName, timeline: StormTimeline): string;
24
+ /** The waterfall's lines for `timeline`. */
25
+ export declare function waterfallLines(timeline: StormTimeline, extras: WaterfallExtras): string[];
@@ -0,0 +1,108 @@
1
+ // The waterfall a run prints once it is done: a time axis, one bar for each lane, the worker chart under the tests
2
+ // lane, the critical path, and where the run directory is. It reads the same with or without color, at 80 columns.
3
+ import { RESOURCE_PRESENTATIONS, } from "../../resources.js";
4
+ import { paint as paintFor, seconds, visibleLength } from "./text.js";
5
+ import { workerLabelWidth, workerLaneLines, workerTailWidth } from "./worker-chart.js";
6
+ /**
7
+ * A lane as the waterfall and the job summary name it: the credential, each resource lane by its presentation's label,
8
+ * such as `testserver-setup`, the runner's setup, the tests and the cleanup.
9
+ */
10
+ export function laneLabel(name) {
11
+ if (name === "mint")
12
+ return "credential";
13
+ if (name === "runner")
14
+ return "runner-setup";
15
+ return RESOURCE_PRESENTATIONS.lanes.find(({ lane }) => lane === name)?.label ?? name;
16
+ }
17
+ /** A critical path step: its lane's label, and for the runner what it did with its runner snapshot. */
18
+ export function criticalPathStep(name, timeline) {
19
+ const snapshot = timeline.rows.find((candidate) => candidate.name === name)?.snapshot;
20
+ return snapshot === undefined ? laneLabel(name) : `${laneLabel(name)} (snapshot ${snapshot})`;
21
+ }
22
+ /**
23
+ * The label column: a space, the widest lane label, such as `testserver-setup`, and a space; wider for a worker's
24
+ * label.
25
+ */
26
+ const LABEL_WIDTH = Math.max(...[
27
+ "credential",
28
+ "runner-setup",
29
+ "tests",
30
+ "cleanup",
31
+ ...RESOURCE_PRESENTATIONS.lanes.map(({ label }) => label),
32
+ ].map((label) => label.length)) + 2;
33
+ /** Columns kept after the bars for the duration that follows the longest one; more for a worker's tail. */
34
+ const TAIL_WIDTH = 14;
35
+ /** Axis steps, in seconds, from which the smallest that leaves room for its labels is chosen. */
36
+ const AXIS_STEPS = [1, 2, 5, 10, 15, 20, 30, 60, 120, 300, 600, 900, 1800, 3600, 7200];
37
+ /** The waterfall's lines for `timeline`. */
38
+ export function waterfallLines(timeline, extras) {
39
+ const style = extras.paint ?? paintFor(false);
40
+ const width = Math.max(60, extras.width);
41
+ const workers = extras.workers ?? [];
42
+ const labelWidth = Math.max(LABEL_WIDTH, workers.length === 0 ? 0 : workerLabelWidth(workers, width));
43
+ const tailWidth = Math.max(TAIL_WIDTH, workers.length === 0 ? 0 : workerTailWidth(workers));
44
+ const barWidth = width - labelWidth - tailWidth;
45
+ const total = Math.max(timeline.totalMs, 1);
46
+ const column = (ms) => Math.round((ms / total) * barWidth);
47
+ const lines = [];
48
+ if (timeline.rows.length > 0) {
49
+ lines.push(style.faint(axis(total, labelWidth, barWidth, tailWidth, column)));
50
+ for (const row of timeline.rows) {
51
+ const critical = timeline.criticalPath.includes(row.name);
52
+ lines.push(...rowLines(row, { labelWidth, column, width, style }, critical));
53
+ if (row.name === "tests" && workers.length > 0)
54
+ lines.push(...workerLaneLines(workers, { labelWidth, column, width, paint: style }));
55
+ }
56
+ }
57
+ if (timeline.criticalPath.length > 0)
58
+ lines.push(` critical path: ${timeline.criticalPath.map((name) => criticalPathStep(name, timeline)).join(" → ")}`);
59
+ lines.push(...(extras.details ?? []));
60
+ if (extras.logs !== undefined)
61
+ lines.push(` logs ${extras.logs}`);
62
+ return lines;
63
+ }
64
+ /** The axis: a label at each step that leaves at least 10 columns between labels. */
65
+ function axis(total, labelWidth, barWidth, tailWidth, column) {
66
+ const stepSeconds = AXIS_STEPS.find((candidate) => (candidate * 1000 * barWidth) / total >= 10) ?? AXIS_STEPS.at(-1) ?? 1;
67
+ const cells = Array.from({ length: barWidth + tailWidth }, () => " ");
68
+ for (let at = 0; at * 1000 <= total; at += stepSeconds) {
69
+ const label = stepSeconds >= 60 ? `${at / 60}m` : `${at}s`;
70
+ const start = column(at * 1000);
71
+ if (start + label.length > cells.length)
72
+ break;
73
+ for (let index = 0; index < label.length; index += 1)
74
+ cells[start + index] = label[index] ?? " ";
75
+ }
76
+ return `${" ".repeat(labelWidth)}${cells.join("").trimEnd()}`;
77
+ }
78
+ /** A row's bar, its duration and what it is made of; the breakdown moves to its own line when it doesn't fit. */
79
+ function rowLines(row, layout, critical) {
80
+ const { labelWidth, column, width, style } = layout;
81
+ const start = column(row.startMs);
82
+ const end = Math.max(start, column(row.endMs));
83
+ const idleEnd = Math.max(end, column(row.endMs + row.idleMs));
84
+ const bar = "█".repeat(end - start);
85
+ const idle = "░".repeat(idleEnd - end);
86
+ const outcome = row.outcome === "done"
87
+ ? ""
88
+ : ` ${row.outcome === "failed" ? style.failed(row.outcome) : style.stopped(row.outcome)}`;
89
+ const idleText = row.idleMs > 0 ? ` · idle ${seconds(row.idleMs)}` : "";
90
+ const head = `${` ${laneLabel(row.name)}`.padEnd(labelWidth)}${" ".repeat(start)}`;
91
+ const text = ` ${seconds(row.endMs - row.startMs)}${idleText}${outcome}`;
92
+ const line = `${head}${critical ? style.active(bar) : bar}${style.faint(idle)}▏${text}`;
93
+ const breakdown = breakdownText(row);
94
+ if (breakdown === "")
95
+ return [line];
96
+ const plainWidth = head.length + bar.length + idle.length + 1 + visibleLength(text);
97
+ if (plainWidth + 3 + breakdown.length <= width)
98
+ return [`${line} ${breakdown}`];
99
+ return [line, `${" ".repeat(labelWidth)}${breakdown}`];
100
+ }
101
+ /** What a row is made of: its steps' durations, and for a lane that counts them how many were reused and created. */
102
+ function breakdownText(row) {
103
+ const steps = row.steps.map((step) => `${step.name} ${seconds(step.endMs - step.startMs)}${step.outcome === "done" ? "" : ` ${step.outcome}`}`);
104
+ if (row.sandboxes === undefined)
105
+ return steps.join(" · ");
106
+ const counts = `${row.sandboxes.reused} reused, ${row.sandboxes.created} created`;
107
+ return [counts, ...(steps.length > 1 ? steps : [])].join(" · ");
108
+ }
@@ -0,0 +1,79 @@
1
+ import type { TimelineSpan } from "../../core/index.ts";
2
+ import type { TestEvent } from "../../sdk/index.ts";
3
+ import { type Paint } from "./text.ts";
4
+ /** The most workers the chart draws; the rest, those that finished first, are counted on one line. */
5
+ export declare const MAX_WORKER_ROWS = 16;
6
+ /** A stretch of a worker's time, in milliseconds since the run started. */
7
+ interface Span {
8
+ readonly startMs: number;
9
+ readonly endMs: number;
10
+ }
11
+ interface FileRun extends Span {
12
+ readonly file: string;
13
+ /** The file as the chart names it: its file name, with as many directories as tell it from the chart's others. */
14
+ readonly name: string;
15
+ }
16
+ interface ContainerStart extends Span {
17
+ readonly ok: boolean;
18
+ }
19
+ /**
20
+ * What a vitest worker did, by the run's clock: the files it ran, in order, the containers it started, and how many
21
+ * tests it started, each once however often it was retried.
22
+ */
23
+ export interface WorkerLane extends Span {
24
+ readonly worker: number;
25
+ readonly files: readonly FileRun[];
26
+ readonly starts: readonly ContainerStart[];
27
+ readonly tests: number;
28
+ }
29
+ /** How a worker's clock maps to the run's, and the tests lane the workers' rows stay within. */
30
+ export interface WorkerClock {
31
+ /** When the run started, in milliseconds since the epoch by the run's clock. */
32
+ readonly runStartedAt: number;
33
+ /** What to add to a worker's clock to read the run's: 0 when they share a clock. */
34
+ readonly offsetMs: number;
35
+ /** The tests lane, in milliseconds since the run started. */
36
+ readonly tests: TimelineSpan;
37
+ }
38
+ /** The tests' part of the waterfall: the worker chart, and the lines after the critical path. */
39
+ export interface TestsChart {
40
+ readonly lanes: readonly WorkerLane[];
41
+ readonly notes: readonly string[];
42
+ }
43
+ /**
44
+ * The worker chart for `events` and the tests' lines that go with it: the totals, the container starts beside the
45
+ * `░` that marks them, and what the other glyphs mean; undefined when no worker started a file, so the summary
46
+ * stands alone. `unreadable` counts the lines in the test events file that held none; `incomplete` is why its final
47
+ * read failed, when it did.
48
+ */
49
+ export declare function testsChart(events: readonly TestEvent[], unreadable: number, clock: WorkerClock, incomplete?: string): TestsChart | undefined;
50
+ /**
51
+ * Each worker's files and container starts, from its events, by the run's clock, by worker; a worker that started no
52
+ * file has none. A file without a `file-finished`, from a run that stopped, ends at its worker's last event. The
53
+ * workers' time is moved, keeping its shape, to lie within the tests lane, however far the clocks disagree, and cut
54
+ * to the lane where it is longer.
55
+ */
56
+ export declare function workerLanes(events: readonly TestEvent[], clock: WorkerClock): WorkerLane[];
57
+ /**
58
+ * What to add to a worker's clock to read the run's, from when the run heard each worker test event (`arrivedAt`, by
59
+ * its clock) and when the worker reported it (`at`, by the worker's): the smallest difference, since an event arrives
60
+ * no sooner than it happened. 0 without one.
61
+ */
62
+ export declare function workerClockOffset(heard: readonly {
63
+ readonly at: number;
64
+ readonly arrivedAt: number;
65
+ }[]): number;
66
+ /** The label column the worker chart needs at `width` columns: its widest label, cut to fit, and a space. */
67
+ export declare function workerLabelWidth(lanes: readonly WorkerLane[], width: number): number;
68
+ /** How the waterfall lays out the worker chart: its label column, where a time falls, its width and its paint. */
69
+ export interface WorkerLayout {
70
+ readonly labelWidth: number;
71
+ readonly column: (ms: number) => number;
72
+ readonly width: number;
73
+ readonly paint: Paint;
74
+ }
75
+ /** The worker chart's lines: a row for each worker shown, then how many more there are. */
76
+ export declare function workerLaneLines(lanes: readonly WorkerLane[], layout: WorkerLayout): string[];
77
+ /** The columns the worker chart needs after its longest bar: `▏` and the widest tail. */
78
+ export declare function workerTailWidth(lanes: readonly WorkerLane[]): number;
79
+ export {};