@cnc-tools/storm 0.0.0 → 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 +119 -3
  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,76 @@
1
+ import { z } from "zod";
2
+ import { findConfigFile } from "../../../config/index.js";
3
+ import { runLogFile } from "../../../core/index.js";
4
+ import { LOG_STEPS, runFacts, scopeFacts } from "../facts.js";
5
+ import { finalResults, newestFinished, pastRun, runScope, runsInScope, selected } from "../past-run.js";
6
+ import { outcomes } from "./outcomes.js";
7
+ /**
8
+ * Shows a past run: run `id`, or without one the newest finished run of the config file found from the working
9
+ * directory, or of every run with `--all` or when none is found. It reads the run's `run.json`, its `timeline.json`,
10
+ * its `tests.jsonl`, which the run writes redacted once it is over, and which run logs it has, and changes nothing. `--failed` and
11
+ * `--test` select tests whose errors and test output it shows.
12
+ */
13
+ export function command(cmd) {
14
+ return cmd.define({
15
+ requestSchema: z.object({
16
+ id: z.string().min(1).optional(),
17
+ failed: z.boolean().default(false),
18
+ test: z.string().min(1).optional(),
19
+ all: z.boolean().default(false),
20
+ }),
21
+ cli: { positionals: ["id"] },
22
+ outcomes,
23
+ handler: async ({ app }, request) => {
24
+ const now = app.context.clock.now();
25
+ let id = request.id;
26
+ if (id === undefined) {
27
+ const listed = await app.context.runDirectories.list({ now });
28
+ if (!listed.ok)
29
+ return outcomes.runsUnreadable({ ...listed.failure });
30
+ const scope = runScope(request.all, await findConfigFile(app.context.config, app.cwd));
31
+ const newest = newestFinished(runsInScope(listed.runs, scope));
32
+ if (newest === undefined)
33
+ return outcomes.noRuns({ scope: scopeFacts(scope) });
34
+ id = newest.id;
35
+ }
36
+ const read = await app.context.runDirectories.read({ id, now });
37
+ if (read.kind === "failed")
38
+ return outcomes.runsUnreadable({ ...read.failure });
39
+ if (read.kind === "not-found")
40
+ return outcomes.runNotFound({ id });
41
+ const run = pastRun(read.directory);
42
+ const filters = { failed: request.failed, test: request.test };
43
+ const selecting = request.failed || request.test !== undefined;
44
+ return outcomes.shown({
45
+ ...runFacts(run, now),
46
+ finished: run.finished,
47
+ logs: LOG_STEPS.filter((step) => read.directory.logs.includes(step)).map((step) => ({
48
+ step,
49
+ path: `${run.path}/${runLogFile(step)}`,
50
+ })),
51
+ unreadableTestLines: run.unreadableTestLines,
52
+ timeline: run.timeline ?? null,
53
+ selection: { failed: request.failed, test: request.test ?? null },
54
+ tests: finalResults(run.events).map((result) => {
55
+ const chosen = selecting && selected(result, filters);
56
+ return {
57
+ id: result.id,
58
+ file: result.file,
59
+ test: result.test,
60
+ state: result.state,
61
+ retryCount: result.retryCount,
62
+ flaky: result.flaky,
63
+ errors: (result.errors ?? []).map((error) => ({
64
+ name: error.name,
65
+ message: error.message,
66
+ stack: error.stack ?? null,
67
+ diff: error.diff ?? null,
68
+ })),
69
+ selected: chosen,
70
+ output: chosen && result.output !== undefined ? { ...result.output } : null,
71
+ };
72
+ }),
73
+ });
74
+ },
75
+ });
76
+ }
@@ -0,0 +1,25 @@
1
+ export declare const metadata: {
2
+ description: string;
3
+ summary: string;
4
+ usages: string[];
5
+ fields: {
6
+ id: {
7
+ valueLabel: string;
8
+ description: string;
9
+ };
10
+ failed: {
11
+ description: string;
12
+ };
13
+ test: {
14
+ valueLabel: string;
15
+ description: string;
16
+ };
17
+ all: {
18
+ description: string;
19
+ };
20
+ };
21
+ examples: {
22
+ argv: string;
23
+ description: string;
24
+ }[];
25
+ };
@@ -0,0 +1,22 @@
1
+ export const metadata = {
2
+ description: "Show a past run from its run directory: its command, config file, working directory, the branch and commit it started from, start, how long it took and how it ended; where its command ran, on this machine or in a runner sandbox, with the sandbox's name, region, vCPUs, runtime and page in the Vercel dashboard, until when the run kept it running, with its Connect page while it runs, its control plane team and project, the run's base and the runner snapshot it started from, with its page; each Testserver sandbox it used, with its log viewer URL; the run logs it has, each with the storm runs logs command that prints it; its waterfall; and each test's final result, in color on a terminal that takes it. With --failed or --test, only the selected tests, how many of all they are, and each one's errors and test output, the last 8 MiB of what it printed, failure reports included. Without an id, the newest finished run of the storm.config.ts found from the working directory, or of every config with --all; pass the id `storm run` printed when another run may have finished since. A run's test results are saved once it finishes. Changes nothing.",
3
+ summary: "Show a past run and its tests.",
4
+ usages: ["[<id>] [--failed] [--test <TEXT>] [--all]"],
5
+ fields: {
6
+ id: {
7
+ valueLabel: "id",
8
+ description: "The run id, such as 20261103T192655-8277, which `storm run` and `storm runs list` print.",
9
+ },
10
+ failed: { description: "Show each failed test's errors and test output." },
11
+ test: {
12
+ valueLabel: "TEXT",
13
+ description: "Show the errors and test output of each test whose full name or file holds TEXT, in any state; with --failed, only failed ones.",
14
+ },
15
+ all: { description: "Without an id, show the newest finished run of any config file." },
16
+ },
17
+ examples: [
18
+ { argv: "20261103T192655-8277 --failed", description: "Show a run and its failed tests' errors and output." },
19
+ { argv: "--test whoami", description: "Show the newest run, and the output of every test about whoami." },
20
+ { argv: "20261103T192655-8277 --json", description: "Show a run as JSON." },
21
+ ],
22
+ };
@@ -0,0 +1,164 @@
1
+ import { z } from "zod";
2
+ /** How `runs show` ends. */
3
+ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
4
+ shown: z.ZodObject<{
5
+ id: z.ZodString;
6
+ path: z.ZodString;
7
+ active: z.ZodBoolean;
8
+ startedAt: z.ZodNullable<z.ZodString>;
9
+ cwd: z.ZodNullable<z.ZodString>;
10
+ configFile: z.ZodNullable<z.ZodString>;
11
+ argv: z.ZodNullable<z.ZodArray<z.ZodString>>;
12
+ where: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ kind: z.ZodLiteral<"local">;
14
+ }, z.core.$strip>, z.ZodObject<{
15
+ kind: z.ZodLiteral<"runner">;
16
+ team: z.ZodString;
17
+ project: z.ZodString;
18
+ region: z.ZodString;
19
+ runtime: z.ZodString;
20
+ vcpus: z.ZodNumber;
21
+ base: z.ZodString;
22
+ baseRef: z.ZodString;
23
+ sandbox: z.ZodNullable<z.ZodString>;
24
+ sandboxUrl: z.ZodNullable<z.ZodString>;
25
+ keptUntil: z.ZodNullable<z.ZodString>;
26
+ keptMinutesLeft: z.ZodNullable<z.ZodNumber>;
27
+ snapshot: z.ZodNullable<z.ZodObject<{
28
+ id: z.ZodString;
29
+ base: z.ZodString;
30
+ built: z.ZodBoolean;
31
+ url: z.ZodString;
32
+ }, z.core.$strip>>;
33
+ }, z.core.$strip>], "kind">>;
34
+ git: z.ZodNullable<z.ZodObject<{
35
+ branch: z.ZodNullable<z.ZodString>;
36
+ commit: z.ZodString;
37
+ dirty: z.ZodBoolean;
38
+ }, z.core.$strip>>;
39
+ ended: z.ZodNullable<z.ZodObject<{
40
+ outcome: z.ZodString;
41
+ exitCode: z.ZodNullable<z.ZodNumber>;
42
+ signal: z.ZodNullable<z.ZodString>;
43
+ ms: z.ZodNullable<z.ZodNumber>;
44
+ tests: z.ZodNullable<z.ZodObject<{
45
+ passed: z.ZodNumber;
46
+ failed: z.ZodNumber;
47
+ skipped: z.ZodNumber;
48
+ }, z.core.$strip>>;
49
+ testsIncomplete: z.ZodNullable<z.ZodString>;
50
+ resources: z.ZodNullable<z.ZodType<import("../../../core/resource.ts").ResourceRanFacts<import("../../../resources.ts").Resources>, import("../../../core/resource.ts").ResourceRanFacts<import("../../../resources.ts").Resources>, z.core.$ZodTypeInternals<import("../../../core/resource.ts").ResourceRanFacts<import("../../../resources.ts").Resources>, import("../../../core/resource.ts").ResourceRanFacts<import("../../../resources.ts").Resources>>>>;
51
+ }, z.core.$strip>>;
52
+ finished: z.ZodBoolean;
53
+ logs: z.ZodArray<z.ZodObject<{
54
+ step: z.ZodEnum<{
55
+ apply: "apply";
56
+ build: "build";
57
+ command: "command";
58
+ install: "install";
59
+ snapshot: "snapshot";
60
+ }>;
61
+ path: z.ZodString;
62
+ }, z.core.$strip>>;
63
+ unreadableTestLines: z.ZodNumber;
64
+ timeline: z.ZodNullable<z.ZodObject<{
65
+ startedAt: z.ZodString;
66
+ totalMs: z.ZodNumber;
67
+ rows: z.ZodArray<z.ZodObject<{
68
+ name: z.ZodEnum<{
69
+ cleanup: "cleanup";
70
+ mint: "mint";
71
+ runner: "runner";
72
+ tests: "tests";
73
+ testserver: "testserver";
74
+ }>;
75
+ startMs: z.ZodNumber;
76
+ endMs: z.ZodNumber;
77
+ outcome: z.ZodEnum<{
78
+ done: "done";
79
+ failed: "failed";
80
+ stopped: "stopped";
81
+ unfinished: "unfinished";
82
+ }>;
83
+ steps: z.ZodArray<z.ZodObject<{
84
+ name: z.ZodEnum<{
85
+ [x: string]: string;
86
+ }>;
87
+ startMs: z.ZodNumber;
88
+ endMs: z.ZodNumber;
89
+ outcome: z.ZodEnum<{
90
+ done: "done";
91
+ failed: "failed";
92
+ stopped: "stopped";
93
+ unfinished: "unfinished";
94
+ }>;
95
+ }, z.core.$strip>>;
96
+ idleMs: z.ZodNumber;
97
+ snapshot: z.ZodOptional<z.ZodEnum<{
98
+ built: "built";
99
+ reused: "reused";
100
+ }>>;
101
+ sandboxes: z.ZodOptional<z.ZodObject<{
102
+ reused: z.ZodNumber;
103
+ created: z.ZodNumber;
104
+ }, z.core.$strip>>;
105
+ }, z.core.$strip>>;
106
+ criticalPath: z.ZodArray<z.ZodEnum<{
107
+ cleanup: "cleanup";
108
+ mint: "mint";
109
+ runner: "runner";
110
+ tests: "tests";
111
+ testserver: "testserver";
112
+ }>>;
113
+ }, z.core.$strip>>;
114
+ selection: z.ZodObject<{
115
+ failed: z.ZodBoolean;
116
+ test: z.ZodNullable<z.ZodString>;
117
+ }, z.core.$strip>;
118
+ tests: z.ZodArray<z.ZodObject<{
119
+ id: z.ZodString;
120
+ file: z.ZodString;
121
+ test: z.ZodString;
122
+ state: z.ZodEnum<{
123
+ fail: "fail";
124
+ pass: "pass";
125
+ skip: "skip";
126
+ }>;
127
+ retryCount: z.ZodNumber;
128
+ flaky: z.ZodBoolean;
129
+ errors: z.ZodArray<z.ZodObject<{
130
+ name: z.ZodString;
131
+ message: z.ZodString;
132
+ stack: z.ZodNullable<z.ZodString>;
133
+ diff: z.ZodNullable<z.ZodString>;
134
+ }, z.core.$strip>>;
135
+ selected: z.ZodBoolean;
136
+ output: z.ZodNullable<z.ZodObject<{
137
+ text: z.ZodString;
138
+ droppedChars: z.ZodNumber;
139
+ }, z.core.$strip>>;
140
+ }, z.core.$strip>>;
141
+ }, z.core.$strip>;
142
+ }, {
143
+ shown: unknown;
144
+ }, {
145
+ runsUnreadable: z.ZodObject<{
146
+ path: z.ZodString;
147
+ message: z.ZodString;
148
+ }, z.core.$strip>;
149
+ runNotFound: z.ZodObject<{
150
+ id: z.ZodString;
151
+ }, z.core.$strip>;
152
+ noRuns: z.ZodObject<{
153
+ scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
154
+ kind: z.ZodLiteral<"config">;
155
+ configFile: z.ZodString;
156
+ }, z.core.$strip>, z.ZodObject<{
157
+ kind: z.ZodLiteral<"all">;
158
+ why: z.ZodEnum<{
159
+ flag: "flag";
160
+ "no-config-file": "no-config-file";
161
+ }>;
162
+ }, z.core.$strip>], "kind">;
163
+ }, z.core.$strip>;
164
+ }>;
@@ -0,0 +1,317 @@
1
+ import { capsFor } from "@cnc-tools/cli-kit/clinkr";
2
+ import { bold, paint } from "@cnc-tools/cli-kit/theme";
3
+ import { defineOutcomes } from "@vercel/clinkr";
4
+ import { z } from "zod";
5
+ import { RESOURCE_REPORTS } from "../../../resources.js";
6
+ import { timelineSchema } from "../../run/outcomes.js";
7
+ import { short } from "../../run/text.js";
8
+ import { waterfallLines } from "../../run/waterfall.js";
9
+ import { commandText, exitText, exitTone, gitText, keptText, LOG_STEPS, runFactsSchema, runNotFound, runsUnreadable, scopeSchema, startedText, tookText, totalsText, totalsTone, } from "../facts.js";
10
+ import { timelineFromFacts } from "../past-run.js";
11
+ const testSchema = z.object({
12
+ /** Vitest's id for the test, unique within the run. */
13
+ id: z.string(),
14
+ /** The test file, relative to the project. */
15
+ file: z.string(),
16
+ /** The test's full name. */
17
+ test: z.string(),
18
+ /** How it finally ended. */
19
+ state: z.enum(["pass", "fail", "skip"]),
20
+ /** How many times it was retried. */
21
+ retryCount: z.number(),
22
+ /** Whether it passed on a retry. */
23
+ flaky: z.boolean(),
24
+ /** Its errors: a failed test's, or a flaky pass's retries'. */
25
+ errors: z.array(z.object({ name: z.string(), message: z.string(), stack: z.string().nullable(), diff: z.string().nullable() })),
26
+ /** Whether --failed or --test selected it. */
27
+ selected: z.boolean(),
28
+ /**
29
+ * Its test output, for a selected test that printed any: the last characters of what it printed (`text`) and how
30
+ * many earlier ones were dropped (`droppedChars`); null otherwise.
31
+ */
32
+ output: z.object({ text: z.string(), droppedChars: z.number() }).nullable(),
33
+ });
34
+ const shownSchema = runFactsSchema.extend({
35
+ /** Whether the run finished, so its test results were saved. */
36
+ finished: z.boolean(),
37
+ /** The run logs it has, which `storm runs logs <id> --step <step>` prints: the command log (`command`) and each step's. */
38
+ logs: z.array(z.object({ step: z.enum(LOG_STEPS), path: z.string() })),
39
+ /** How many lines of its tests.jsonl held no test event. */
40
+ unreadableTestLines: z.number(),
41
+ /** Its waterfall, as its timeline.json holds it; null when it has none storm can read. */
42
+ timeline: timelineSchema.nullable(),
43
+ /** The tests --failed and --test select. */
44
+ selection: z.object({ failed: z.boolean(), test: z.string().nullable() }),
45
+ /** Each test's final result, in the order the run reported them. */
46
+ tests: z.array(testSchema),
47
+ });
48
+ /** How `runs show` ends. */
49
+ export const outcomes = defineOutcomes({
50
+ results: {
51
+ shown: {
52
+ schema: shownSchema,
53
+ description: "The run, its waterfall, and its tests, with the selected tests' errors and test output.",
54
+ render: (shown) => shownRendered(shown),
55
+ },
56
+ },
57
+ errors: {
58
+ runsUnreadable,
59
+ runNotFound,
60
+ noRuns: {
61
+ exitCode: 1,
62
+ description: "Without an id, no run in the scope has finished.",
63
+ schema: z.object({
64
+ /** Which runs it looked through. */
65
+ scope: scopeSchema,
66
+ }),
67
+ render: ({ scope }) => scope.kind === "config"
68
+ ? {
69
+ message: `Couldn't find a finished run of ${scope.configFile}.`,
70
+ next: [
71
+ {
72
+ type: "command",
73
+ argv: ["storm", "runs", "show", "--all"],
74
+ label: "Show the newest finished run of any config file",
75
+ },
76
+ ],
77
+ }
78
+ : { message: "Couldn't find a finished run.", next: [{ type: "text", text: "Run storm run first." }] },
79
+ },
80
+ },
81
+ });
82
+ /** The width the waterfall is laid out for. */
83
+ const WATERFALL_WIDTH = 80;
84
+ /** Where a fact's value starts: a 2-column gutter and the widest label. */
85
+ const LABEL_WIDTH = 16;
86
+ /** No color: the plain text a pipe, `--no-color` and a script reading stdout get. */
87
+ const NO_PAINT = { tone: (_intent, text) => text, strong: (text) => text };
88
+ /** The painter for `caps`: cli-kit's palette, or no color at all when it has none. */
89
+ function painterFor(caps) {
90
+ if (caps.colorDepth === "none")
91
+ return NO_PAINT;
92
+ return { tone: (intent, text) => (text === "" ? text : paint(caps, intent, text)), strong: (text) => bold(text) };
93
+ }
94
+ /**
95
+ * The run as `runs show` renders it: plain text in its content, and the same text painted for a person on a terminal
96
+ * that takes color: each URL in a link's color, the exit and the tests in the color of how they went, labels and
97
+ * notes muted, and each test's state in its color.
98
+ */
99
+ function shownRendered(shown) {
100
+ return {
101
+ content: { text: shownText(shown, NO_PAINT) },
102
+ draw: (terminal) => ({ report: "", answer: shownText(shown, painterFor(capsFor(terminal.stdout, terminal))) }),
103
+ };
104
+ }
105
+ /**
106
+ * The run as a person reads it: its facts, where it ran and what it used, its waterfall, a table of its tests, or with
107
+ * `--failed` or `--test` of the tests they select and how many of all those are, and a section for each selected test
108
+ * with its errors and test output, painted by `p`. Laid out here because test output is
109
+ * the test's own text, which no list may cut, and which it never paints.
110
+ */
111
+ function shownText(shown, p) {
112
+ const exitColor = exitTone(shown);
113
+ const totalsColor = totalsTone(shown);
114
+ const exit = exitText(shown);
115
+ const totals = totalsText(shown);
116
+ const facts = [
117
+ ["Run", shown.id],
118
+ ["Command", commandText(shown)],
119
+ ["Config", shown.configFile ?? (shown.argv === null ? "-" : "none")],
120
+ ["Directory", shown.cwd ?? "-"],
121
+ ["Git", gitText(shown)],
122
+ ["Started", startedText(shown)],
123
+ ["Took", tookText(shown)],
124
+ ["Exit", exitColor === undefined ? exit : { text: exit, tone: exitColor }],
125
+ ["Tests", totalsColor === undefined ? totals : { text: totals, tone: totalsColor }],
126
+ ["Run directory", `${shown.path}/`],
127
+ ...logsRows(shown),
128
+ ];
129
+ const blocks = [rowLines(facts, p)];
130
+ const where = [...whereRows(shown), ...RESOURCE_REPORTS.ranRows(shown.ended?.resources ?? {})];
131
+ if (where.length > 0)
132
+ blocks.push(rowLines(where, p));
133
+ if (shown.timeline !== null && shown.timeline.rows.length > 0)
134
+ blocks.push(waterfallLines(timelineFromFacts(shown.timeline), { width: WATERFALL_WIDTH, logs: undefined }));
135
+ const note = (text) => [` ${p.tone("muted", text)}`];
136
+ if (!shown.finished) {
137
+ blocks.push(note(shown.active
138
+ ? "The run is still going. Its test results are saved once it finishes."
139
+ : "The run didn't finish, so its test results weren't saved."));
140
+ return joinBlocks(blocks);
141
+ }
142
+ const { failed, test } = shown.selection;
143
+ const selecting = failed || test !== null;
144
+ const chosen = shown.tests.filter((each) => each.selected);
145
+ if (shown.tests.length === 0)
146
+ blocks.push(note("No final test results."));
147
+ else if (!selecting)
148
+ blocks.push(testTable(shown.tests, p));
149
+ // A selection's table lists only the tests it selects, each of which a section follows.
150
+ else if (chosen.length > 0)
151
+ blocks.push([
152
+ ...testTable(chosen, p),
153
+ ` ${p.tone("muted", `${chosen.length} of ${shown.tests.length} ${shown.tests.length === 1 ? "test" : "tests"}`)}`,
154
+ ]);
155
+ if (shown.unreadableTestLines > 0)
156
+ blocks.push(note(`${shown.unreadableTestLines} lines of tests.jsonl held no test event.`));
157
+ const incomplete = shown.ended?.testsIncomplete ?? null;
158
+ if (incomplete !== null)
159
+ blocks.push(note(`The test results may be incomplete: storm couldn't read the test events file once the command ended: ${incomplete}`));
160
+ if (selecting) {
161
+ if (chosen.length === 0)
162
+ blocks.push(note(failed && test === null
163
+ ? "No test failed."
164
+ : `No ${failed ? "failed " : ""}test's name or file holds ${JSON.stringify(test)}.`));
165
+ for (const each of chosen)
166
+ blocks.push(testSection(each, p));
167
+ }
168
+ return joinBlocks(blocks);
169
+ }
170
+ /** The row naming each run log the run has, with the command that prints it; none when it has none. */
171
+ function logsRows(shown) {
172
+ if (shown.logs.length === 0)
173
+ return [];
174
+ const width = Math.max(...shown.logs.map(({ step }) => step.length));
175
+ return [["Logs", shown.logs.map(({ step }) => `${step.padEnd(width)} storm runs logs ${shown.id} --step ${step}`)]];
176
+ }
177
+ /**
178
+ * Label and value rows, each value at the same column, labels muted; a value of several lines puts each under the
179
+ * first.
180
+ */
181
+ function rowLines(rows, p) {
182
+ return rows.flatMap(([label, value]) => {
183
+ const [first = "", ...rest] = isLineList(value) ? value : [value];
184
+ const gutter = ` ${" ".repeat(LABEL_WIDTH)}`;
185
+ return [
186
+ ` ${p.tone("muted", label)}${" ".repeat(Math.max(0, LABEL_WIDTH - label.length))}${lineText(first, p)}`,
187
+ ...rest.map((line) => `${gutter}${lineText(line, p)}`),
188
+ ];
189
+ });
190
+ }
191
+ function isLineList(value) {
192
+ return Array.isArray(value);
193
+ }
194
+ /** A URL in a fact's value, up to the next space. */
195
+ const URL_PATTERN = /https?:\/\/\S+/g;
196
+ /** A value's line as a person sees it: in its own color, or with each URL in it in a link's color. */
197
+ function lineText(line, p) {
198
+ if (typeof line !== "string")
199
+ return p.tone(line.tone, line.text);
200
+ return line.replace(URL_PATTERN, (url) => p.tone("accent", url));
201
+ }
202
+ /**
203
+ * Where the run's command ran: on this machine, or in a runner sandbox, with its page in the Vercel dashboard, until
204
+ * when the run kept it running, the control plane project it ran in, the run's base and the runner snapshot it started
205
+ * from, which the run's changes went on top of, with its page. None when unknown.
206
+ */
207
+ function whereRows(shown) {
208
+ const { where, ended } = shown;
209
+ if (where === null)
210
+ return [];
211
+ if (where.kind === "local")
212
+ return [["Ran on", "this machine"]];
213
+ const shape = `${where.region}, ${where.vcpus} vCPUs, ${where.runtime}`;
214
+ const sandbox = where.sandbox !== null
215
+ ? `runner sandbox ${where.sandbox} (${shape})`
216
+ : ended === null
217
+ ? `runner sandbox (${shape})`
218
+ : `runner sandbox, none started (${shape})`;
219
+ const { snapshot } = where;
220
+ return [
221
+ ["Ran in", sandbox],
222
+ ...(where.sandboxUrl === null ? [] : [["Sandbox page", where.sandboxUrl]]),
223
+ ...keptRows(shown),
224
+ ["Vercel project", `${where.team}/${where.project}`],
225
+ ["Base", `${short(where.base)}, HEAD's merge-base with ${where.baseRef}`],
226
+ ...(snapshot === null
227
+ ? []
228
+ : [
229
+ [
230
+ "Snapshot",
231
+ [`${snapshot.id} of ${short(snapshot.base)}, ${snapshot.built ? "built" : "reused"}`, ` ${snapshot.url}`],
232
+ ],
233
+ ]),
234
+ ];
235
+ }
236
+ /**
237
+ * The row for the runner sandbox the run kept running, if it did: until when, in success while it still runs, with its
238
+ * Connect page in the Vercel dashboard, or muted once it has stopped.
239
+ */
240
+ function keptRows(shown) {
241
+ const kept = keptText(shown);
242
+ if (kept === undefined || shown.where?.kind !== "runner")
243
+ return [];
244
+ const { sandboxUrl, keptMinutesLeft } = shown.where;
245
+ if (sandboxUrl === null || keptMinutesLeft === null || keptMinutesLeft === 0)
246
+ return [["Sandbox kept", { text: kept, tone: "muted" }]];
247
+ return [["Sandbox kept", [{ text: kept, tone: "success" }, `connect: ${sandboxUrl}/connect`]]];
248
+ }
249
+ /** The color a test's state shows in: passed in success, failed in error, skipped muted. */
250
+ const STATE_TONES = { pass: "success", fail: "error", skip: "muted" };
251
+ /**
252
+ * One row per test: its state in its color, its retries, whether it was flaky (`yes` in warn), its file and its full
253
+ * name, under a bold header. Columns are padded on the plain text, so color doesn't move them.
254
+ */
255
+ function testTable(tests, p) {
256
+ const header = ["STATE", "RETRIES", "FLAKY", "FILE", "TEST"];
257
+ const rows = tests.map((each) => [
258
+ each.state,
259
+ String(each.retryCount),
260
+ each.flaky ? "yes" : "no",
261
+ each.file,
262
+ each.test,
263
+ ]);
264
+ const widths = header.map((_, column) => Math.max(...[header, ...rows].map((row) => row[column]?.length ?? 0)));
265
+ const line = (cells, paintCell) => ` ${cells
266
+ .map((cell, column) => column === cells.length - 1
267
+ ? paintCell(cell, column)
268
+ : `${paintCell(cell, column)}${" ".repeat((widths[column] ?? 0) - cell.length)}`)
269
+ .join(" ")}`.trimEnd();
270
+ return [
271
+ line(header, (cell) => p.strong(cell)),
272
+ ...tests.map((each, index) => line(rows[index] ?? [], (cell, column) => column === 0 ? p.tone(STATE_TONES[each.state], cell) : column === 2 && each.flaky ? p.tone("warn", cell) : cell)),
273
+ ];
274
+ }
275
+ /**
276
+ * A selected test's heading, its state in its color and the rest bold, then each of its errors (its name and first
277
+ * line in error, its stack muted, its diff's lines in green and red as Vitest colors them), then its test output,
278
+ * never painted.
279
+ */
280
+ function testSection(test, p) {
281
+ const retried = test.retryCount === 0 ? "" : ` · retried ${test.retryCount}${test.flaky ? ", flaky" : ""}`;
282
+ const lines = [
283
+ `${p.tone(STATE_TONES[test.state], test.state)}${p.strong(` · ${test.file} · ${test.test}${retried}`)}`,
284
+ ];
285
+ for (const error of test.errors) {
286
+ const [first = "", ...rest] = error.message.replace(/\n+$/, "").split("\n");
287
+ lines.push(` ${p.tone("error", `${error.name}: ${first}`)}`, ...indented(rest.join("\n"), 4));
288
+ if (error.stack !== null)
289
+ lines.push(` ${p.tone("muted", "stack:")}`, ...indented(error.stack, 4).map((line) => p.tone("muted", line)));
290
+ if (error.diff !== null)
291
+ lines.push(` ${p.tone("muted", "diff:")}`, ...indented(error.diff, 4).map((line) => diffLine(line, p)));
292
+ }
293
+ if (test.output === null)
294
+ lines.push(` ${p.tone("muted", "no test output")}`);
295
+ else {
296
+ const dropped = test.output.droppedChars === 0
297
+ ? ""
298
+ : `, the last ${test.output.text.length} characters (${test.output.droppedChars} earlier ones dropped)`;
299
+ lines.push(` ${p.tone("muted", `test output${dropped}:`)}`, ...indented(test.output.text, 4));
300
+ }
301
+ return lines;
302
+ }
303
+ /** A diff's line, indented: one that adds (`+`) in success, one that removes (`-`) in error, others as they are. */
304
+ function diffLine(line, p) {
305
+ const marker = line.trimStart()[0];
306
+ return marker === "+" ? p.tone("success", line) : marker === "-" ? p.tone("error", line) : line;
307
+ }
308
+ /** `text`'s lines, each indented by `by` spaces; none for empty text. */
309
+ function indented(text, by) {
310
+ const trimmed = text.replace(/\n+$/, "");
311
+ if (trimmed === "")
312
+ return [];
313
+ return trimmed.split("\n").map((line) => (line === "" ? "" : `${" ".repeat(by)}${line}`));
314
+ }
315
+ function joinBlocks(blocks) {
316
+ return blocks.map((block) => block.join("\n")).join("\n\n");
317
+ }
@@ -0,0 +1,24 @@
1
+ import type { AnyResourceConfig, GivenOptions, GivenResources, ResolvedResources } from "./resource-config.ts";
2
+ /**
3
+ * Each resource's given options, by name, as `GivenResources<Configs>`. Sound because every key is the name of one of
4
+ * `Configs` and every value holds only that config's options, each passed by its own rule's `check`.
5
+ */
6
+ export declare function givenResourcesByName<Configs extends readonly AnyResourceConfig[]>(_configs: Configs, values: {
7
+ readonly [name: string]: {
8
+ readonly [option: string]: unknown;
9
+ };
10
+ }): GivenResources<Configs>;
11
+ /**
12
+ * One resource's given options as `GivenOptions<C>`. Sound because every key is one of `config.options` and every value
13
+ * passed that option's `check`.
14
+ */
15
+ export declare function givenOptionsOf<C extends AnyResourceConfig>(_config: C, values: {
16
+ readonly [option: string]: unknown;
17
+ }): GivenOptions<C>;
18
+ /**
19
+ * Each held resource's resolved options, by name, as `ResolvedResources<Configs>`. Sound because every key is the name
20
+ * of one of `Configs` and every value is what that config's `resolve` resolved to.
21
+ */
22
+ export declare function resolvedResourcesByName<Configs extends readonly AnyResourceConfig[]>(_configs: Configs, values: {
23
+ readonly [name: string]: unknown;
24
+ }): ResolvedResources<Configs>;
@@ -0,0 +1,26 @@
1
+ // The only casts in the config module. The generic machinery builds a record keyed by each resource config's name, or
2
+ // by each option's name, from a loop over `Object.keys` or over the configs it was handed. TypeScript widens such a
3
+ // record to `Record<string, …>` and can't relate it to the mapped type over the configs (`GivenResources`,
4
+ // `ResolvedResources`) or over one config's options (`GivenOptions`). Each function below states that fact once, for
5
+ // every call site.
6
+ /**
7
+ * Each resource's given options, by name, as `GivenResources<Configs>`. Sound because every key is the name of one of
8
+ * `Configs` and every value holds only that config's options, each passed by its own rule's `check`.
9
+ */
10
+ export function givenResourcesByName(_configs, values) {
11
+ return values;
12
+ }
13
+ /**
14
+ * One resource's given options as `GivenOptions<C>`. Sound because every key is one of `config.options` and every value
15
+ * passed that option's `check`.
16
+ */
17
+ export function givenOptionsOf(_config, values) {
18
+ return values;
19
+ }
20
+ /**
21
+ * Each held resource's resolved options, by name, as `ResolvedResources<Configs>`. Sound because every key is the name
22
+ * of one of `Configs` and every value is what that config's `resolve` resolved to.
23
+ */
24
+ export function resolvedResourcesByName(_configs, values) {
25
+ return values;
26
+ }