@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,273 @@
1
+ import { z } from "zod";
2
+ /** How `vitest` ends: as `exec` does, its `ran` with the test plan, or refused before the run when counting fails. */
3
+ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
4
+ ran: z.ZodObject<{
5
+ version: z.ZodString;
6
+ commit: z.ZodNullable<z.ZodString>;
7
+ configFile: z.ZodNullable<z.ZodString>;
8
+ resources: 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>>>;
9
+ cleanup: z.ZodType<import("../exec/cleanup.ts").StormCleanupFacts, import("../exec/cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("../exec/cleanup.ts").StormCleanupFacts, import("../exec/cleanup.ts").StormCleanupFacts>>;
10
+ command: z.ZodObject<{
11
+ exitCode: z.ZodNullable<z.ZodNumber>;
12
+ signal: z.ZodNullable<z.ZodString>;
13
+ }, z.core.$strip>;
14
+ runner: z.ZodNullable<z.ZodObject<{
15
+ snapshotId: z.ZodString;
16
+ base: z.ZodString;
17
+ built: z.ZodBoolean;
18
+ vcpus: z.ZodNumber;
19
+ region: z.ZodString;
20
+ runtime: z.ZodString;
21
+ }, z.core.$strip>>;
22
+ timeline: z.ZodObject<{
23
+ startedAt: z.ZodString;
24
+ totalMs: z.ZodNumber;
25
+ rows: z.ZodArray<z.ZodObject<{
26
+ name: z.ZodEnum<{
27
+ cleanup: "cleanup";
28
+ mint: "mint";
29
+ runner: "runner";
30
+ tests: "tests";
31
+ testserver: "testserver";
32
+ }>;
33
+ startMs: z.ZodNumber;
34
+ endMs: z.ZodNumber;
35
+ outcome: z.ZodEnum<{
36
+ done: "done";
37
+ failed: "failed";
38
+ stopped: "stopped";
39
+ unfinished: "unfinished";
40
+ }>;
41
+ steps: z.ZodArray<z.ZodObject<{
42
+ name: z.ZodEnum<{
43
+ [x: string]: string;
44
+ }>;
45
+ startMs: z.ZodNumber;
46
+ endMs: z.ZodNumber;
47
+ outcome: z.ZodEnum<{
48
+ done: "done";
49
+ failed: "failed";
50
+ stopped: "stopped";
51
+ unfinished: "unfinished";
52
+ }>;
53
+ }, z.core.$strip>>;
54
+ idleMs: z.ZodNumber;
55
+ snapshot: z.ZodOptional<z.ZodEnum<{
56
+ built: "built";
57
+ reused: "reused";
58
+ }>>;
59
+ sandboxes: z.ZodOptional<z.ZodObject<{
60
+ reused: z.ZodNumber;
61
+ created: z.ZodNumber;
62
+ }, z.core.$strip>>;
63
+ }, z.core.$strip>>;
64
+ criticalPath: z.ZodArray<z.ZodEnum<{
65
+ cleanup: "cleanup";
66
+ mint: "mint";
67
+ runner: "runner";
68
+ tests: "tests";
69
+ testserver: "testserver";
70
+ }>>;
71
+ }, z.core.$strip>;
72
+ runId: z.ZodNullable<z.ZodString>;
73
+ plan: z.ZodObject<{
74
+ tests: z.ZodNumber;
75
+ files: z.ZodNumber;
76
+ sandboxes: z.ZodNullable<z.ZodNumber>;
77
+ sandboxesFrom: z.ZodNullable<z.ZodEnum<{
78
+ auto: "auto";
79
+ file: "file";
80
+ flag: "flag";
81
+ }>>;
82
+ }, z.core.$strip>;
83
+ }, z.core.$strip>;
84
+ }, {
85
+ ran: unknown;
86
+ }, {
87
+ noMatchingTests: z.ZodObject<{
88
+ args: z.ZodArray<z.ZodString>;
89
+ cwd: z.ZodString;
90
+ }, z.core.$strip>;
91
+ vitestListFailed: z.ZodObject<{
92
+ args: z.ZodArray<z.ZodString>;
93
+ cwd: z.ZodString;
94
+ kind: z.ZodEnum<{
95
+ exited: "exited";
96
+ "start-failed": "start-failed";
97
+ "timed-out": "timed-out";
98
+ "unreadable-output": "unreadable-output";
99
+ }>;
100
+ message: z.ZodString;
101
+ }, z.core.$strip>;
102
+ credentialRejected: import("@vercel/clinkr").SharedError<"credential_rejected", [{
103
+ origin: {
104
+ source: "mint";
105
+ team: string;
106
+ project: string;
107
+ } | {
108
+ source: "github-actions";
109
+ claims: {
110
+ aud: string;
111
+ repository: string;
112
+ } | null;
113
+ };
114
+ fix: string;
115
+ status: number;
116
+ vercelId: string | null;
117
+ ttlMinutes: number;
118
+ failedCreates: {
119
+ kind: "connect-failed" | "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
120
+ detail: string | null;
121
+ }[];
122
+ unpooled: {
123
+ testserverUrl: string;
124
+ path: string;
125
+ message: string;
126
+ }[];
127
+ sandboxMayExist: boolean;
128
+ } & {
129
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
130
+ }]>;
131
+ credentialUnused: import("@vercel/clinkr").SharedError<"credential_unused", [data: {
132
+ flags: string[];
133
+ configFile: string | null;
134
+ }]>;
135
+ githubFixtureRepoUnavailable: import("@vercel/clinkr").SharedError<"github_fixture_repo_unavailable", [{
136
+ repo: string;
137
+ status: number | null;
138
+ message: string;
139
+ } & {
140
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
141
+ }]>;
142
+ githubTokenMissing: import("@vercel/clinkr").SharedError<"github_token_missing", [data: {
143
+ tokenEnv: string;
144
+ repo: string;
145
+ configFile: string | null;
146
+ requiredBy: "config" | "set";
147
+ }]>;
148
+ invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
149
+ file: string;
150
+ problems: {
151
+ key: string | null;
152
+ location: {
153
+ line: number;
154
+ column: number | null;
155
+ } | null;
156
+ problem: string;
157
+ }[];
158
+ }]>;
159
+ invalidResourceOptions: import("@vercel/clinkr").SharedError<"invalid_resource_options", [data: {
160
+ configFile: string | null;
161
+ problems: {
162
+ key: string;
163
+ problem: string;
164
+ values: {
165
+ key: string;
166
+ value: string;
167
+ source: "default" | "file" | "flag";
168
+ }[];
169
+ }[];
170
+ }]>;
171
+ mintFailed: import("@vercel/clinkr").SharedError<"mint_failed", [data: {
172
+ team: string;
173
+ project: string;
174
+ cause: string;
175
+ fix: string;
176
+ runner: boolean;
177
+ cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
178
+ }]>;
179
+ missingRunner: import("@vercel/clinkr").SharedError<"missing_runner", [data: {
180
+ configFile: string | null;
181
+ }]>;
182
+ missingTarget: import("@vercel/clinkr").SharedError<"missing_target", [data: {
183
+ missing: ("project" | "scope")[];
184
+ }]>;
185
+ noBaseRef: import("@vercel/clinkr").SharedError<"no_base_ref", [data: {
186
+ refs: {
187
+ ref: string;
188
+ reason: "missing" | "unrelated";
189
+ }[];
190
+ }]>;
191
+ noSandboxes: import("@vercel/clinkr").SharedError<"no_sandboxes", [{
192
+ requested: number;
193
+ ttlMinutes: number;
194
+ failedCreates: {
195
+ kind: "connect-failed" | "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
196
+ detail: string | null;
197
+ }[];
198
+ sandboxMayExist: boolean;
199
+ } & {
200
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
201
+ }]>;
202
+ noUsableSandboxes: import("@vercel/clinkr").SharedError<"no_usable_sandboxes", [{
203
+ requested: number;
204
+ build: string;
205
+ } & {
206
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
207
+ }]>;
208
+ poolUnavailable: import("@vercel/clinkr").SharedError<"pool_unavailable", [data: {
209
+ path: string;
210
+ message: string;
211
+ }]>;
212
+ poolUnreadable: import("@vercel/clinkr").SharedError<"pool_unreadable", [{
213
+ path: string;
214
+ message: string;
215
+ } & {
216
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
217
+ }]>;
218
+ runnerFailed: import("@vercel/clinkr").SharedError<"runner_failed", [data: {
219
+ failure: {
220
+ kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
221
+ label: string;
222
+ exitCode: number | null;
223
+ tail: string[];
224
+ } | {
225
+ kind: "sandbox-api-failed";
226
+ operation: string;
227
+ status: number | null;
228
+ message: string;
229
+ } | {
230
+ kind: "checkout-failed";
231
+ message: string;
232
+ command: string | null;
233
+ } | {
234
+ kind: "credential-claims-missing";
235
+ team: string;
236
+ project: string;
237
+ };
238
+ cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
239
+ }]>;
240
+ snapshotGone: import("@vercel/clinkr").SharedError<"snapshot_gone", [data: {
241
+ snapshotId: string;
242
+ base: string;
243
+ removal: {
244
+ path: string;
245
+ message: string;
246
+ } | null;
247
+ cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
248
+ }]>;
249
+ spawnFailed: import("@vercel/clinkr").SharedError<"spawn_failed", [data: {
250
+ executable: string;
251
+ message: string;
252
+ cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
253
+ }]>;
254
+ submodulesRefused: import("@vercel/clinkr").SharedError<"submodules_refused", [data: {
255
+ paths: string[];
256
+ }]>;
257
+ tokenRequestFailed: import("@vercel/clinkr").SharedError<"token_request_failed", [{
258
+ cause: "request-failed" | "variables-missing";
259
+ missing: ("ACTIONS_ID_TOKEN_REQUEST_TOKEN" | "ACTIONS_ID_TOKEN_REQUEST_URL")[] | null;
260
+ status: number | null;
261
+ said: string | null;
262
+ detail: string;
263
+ fix: string;
264
+ ttlMinutes: number;
265
+ failedCreates: {
266
+ kind: "connect-failed" | "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
267
+ detail: string | null;
268
+ }[];
269
+ sandboxMayExist: boolean;
270
+ } & {
271
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
272
+ }]>;
273
+ }>;
@@ -0,0 +1,77 @@
1
+ import { defineOutcomes } from "@vercel/clinkr";
2
+ import { z } from "zod";
3
+ import { RAN_DESCRIPTION, RUN_ERRORS, ranSchema, renderRan } from "../exec/outcomes.js";
4
+ /** What `vitest list` counted before the run, and the Testserver sandbox count the run asked for. */
5
+ const planSchema = z.object({
6
+ /** How many tests `vitest list --json <args>` counted. */
7
+ tests: z.number(),
8
+ /** How many distinct test files they are in. */
9
+ files: z.number(),
10
+ /** How many Testserver sandboxes the run asked for; null without a Testserver side. */
11
+ sandboxes: z.number().nullable(),
12
+ /** Where that count came from: `--testserver-sandboxes` (`flag`), `resources.testserverPool.sandboxes` in storm.config.ts (`file`), or one per 4 test files, at most 8 (`auto`); null without a Testserver side. */
13
+ sandboxesFrom: z.enum(["flag", "file", "auto"]).nullable(),
14
+ });
15
+ /** Where `vitest list` ran and what it was given, which both refusals report. */
16
+ const listedShape = {
17
+ /** The arguments given to `vitest run`, which `vitest list --json` was given too. */
18
+ args: z.array(z.string()),
19
+ /** The directory `vitest list` ran in, on this machine. */
20
+ cwd: z.string(),
21
+ };
22
+ /** How `vitest` ends: as `exec` does, its `ran` with the test plan, or refused before the run when counting fails. */
23
+ export const outcomes = defineOutcomes({
24
+ results: {
25
+ ran: {
26
+ schema: ranSchema.extend({
27
+ /** The test plan: what `vitest list` counted before the run, and how many Testserver sandboxes the run asked for and why. */
28
+ plan: planSchema,
29
+ }),
30
+ description: RAN_DESCRIPTION,
31
+ render: renderRan,
32
+ },
33
+ },
34
+ errors: {
35
+ ...RUN_ERRORS,
36
+ noMatchingTests: {
37
+ exitCode: 1,
38
+ description: "vitest list found no test for the arguments given to vitest run, so nothing was minted, leased or started.",
39
+ schema: z.object(listedShape),
40
+ render: ({ args, cwd }) => ({
41
+ message: `vitest list found no test for vitest run ${argsText(args)} in ${cwd}. The command didn't run.`,
42
+ next: [
43
+ {
44
+ type: "text",
45
+ text: `Change the arguments given to vitest run (${argsText(args)}), then retry. Put vitest's own dash options after --.`,
46
+ },
47
+ ],
48
+ }),
49
+ },
50
+ vitestListFailed: {
51
+ exitCode: 1,
52
+ description: "storm couldn't count the tests before the run: vitest wasn't found or failed to start, didn't finish within 60s, exited other than 0, or printed something other than a list of tests. Nothing was minted, leased or started.",
53
+ schema: z.object({
54
+ /** How listing failed: vitest wasn't found or couldn't start (`start-failed`), didn't finish (`timed-out`), exited other than 0 (`exited`), or printed something other than a list of tests (`unreadable-output`). */
55
+ kind: z.enum(["start-failed", "timed-out", "exited", "unreadable-output"]),
56
+ /** What went wrong, such as the directories searched for vitest, or the last line of vitest's stderr. */
57
+ message: z.string(),
58
+ ...listedShape,
59
+ }),
60
+ render: ({ kind, message, cwd }) => ({
61
+ message: `Couldn't count the tests in ${cwd}: ${/[.!?]$/.test(message) ? message : `${message}.`} The command didn't run.`,
62
+ next: [{ type: "text", text: LIST_FAILED_NEXT[kind] }],
63
+ }),
64
+ },
65
+ },
66
+ });
67
+ /** The arguments as a person reads them: `(none)` when there are none. */
68
+ function argsText(args) {
69
+ return args.length === 0 ? "(none)" : args.join(" ");
70
+ }
71
+ /** What to do about each kind of listing failure. */
72
+ const LIST_FAILED_NEXT = {
73
+ "start-failed": "Install vitest in the package, or run the command with storm exec, which counts nothing.",
74
+ "timed-out": "Check why vitest list doesn't finish, such as a global setup that waits, then retry.",
75
+ exited: "Fix what vitest list reports, then retry. vitest list takes the arguments vitest run does, but refuses some run-only options.",
76
+ "unreadable-output": "Check that the package's vitest prints its list with --json, then retry.",
77
+ };
@@ -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
+ }
@@ -0,0 +1,58 @@
1
+ import { z } from "zod";
2
+ declare const problemSchema: z.ZodObject<{
3
+ key: z.ZodNullable<z.ZodString>;
4
+ location: z.ZodNullable<z.ZodObject<{
5
+ line: z.ZodNumber;
6
+ column: z.ZodNullable<z.ZodNumber>;
7
+ }, z.core.$strip>>;
8
+ problem: z.ZodString;
9
+ }, z.core.$strip>;
10
+ type Problem = z.output<typeof problemSchema>;
11
+ /** One problem as a person reads it: `<file>: <key> <problem>.`, `<file>:<line>:<col> <problem>.` or `<file>: <problem>.` */
12
+ export declare function configProblemLine(file: string, { key, location, problem }: Problem): string;
13
+ declare const optionProblemSchema: z.ZodObject<{
14
+ key: z.ZodString;
15
+ problem: z.ZodString;
16
+ values: z.ZodArray<z.ZodObject<{
17
+ key: z.ZodString;
18
+ value: z.ZodString;
19
+ source: z.ZodEnum<{
20
+ default: "default";
21
+ file: "file";
22
+ flag: "flag";
23
+ }>;
24
+ }, z.core.$strip>>;
25
+ }, z.core.$strip>;
26
+ type OptionProblem = z.output<typeof optionProblemSchema>;
27
+ /** One resource option problem as a person reads it: `<key> <problem>: <where each value came from>.` */
28
+ export declare function optionProblemLine({ key, problem, values }: OptionProblem, configFile: string | null): string;
29
+ export declare const configErrors: import("@vercel/clinkr").SharedErrors<{
30
+ invalidConfig: z.ZodObject<{
31
+ file: z.ZodString;
32
+ problems: z.ZodArray<z.ZodObject<{
33
+ key: z.ZodNullable<z.ZodString>;
34
+ location: z.ZodNullable<z.ZodObject<{
35
+ line: z.ZodNumber;
36
+ column: z.ZodNullable<z.ZodNumber>;
37
+ }, z.core.$strip>>;
38
+ problem: z.ZodString;
39
+ }, z.core.$strip>>;
40
+ }, z.core.$strip>;
41
+ invalidResourceOptions: z.ZodObject<{
42
+ configFile: z.ZodNullable<z.ZodString>;
43
+ problems: z.ZodArray<z.ZodObject<{
44
+ key: z.ZodString;
45
+ problem: z.ZodString;
46
+ values: z.ZodArray<z.ZodObject<{
47
+ key: z.ZodString;
48
+ value: z.ZodString;
49
+ source: z.ZodEnum<{
50
+ default: "default";
51
+ file: "file";
52
+ flag: "flag";
53
+ }>;
54
+ }, z.core.$strip>>;
55
+ }, z.core.$strip>>;
56
+ }, z.core.$strip>;
57
+ }>;
58
+ export {};
@@ -0,0 +1,101 @@
1
+ // The errors the commands that read `storm.config.ts` share about it: a file they can't use, and a held resource's
2
+ // options that don't fit together once the file and the flags are merged. Both exit 2. A missing control plane team
3
+ // or project is the credential module's (`missing_target`).
4
+ import { defineErrors } from "@vercel/clinkr";
5
+ import { z } from "zod";
6
+ const problemSchema = z.object({
7
+ /** The key the problem is about; null when it is about the whole file. */
8
+ key: z.string().nullable(),
9
+ /** Where Node said the import failed; null otherwise. */
10
+ location: z.object({ line: z.number(), column: z.number().nullable() }).nullable(),
11
+ /** What is wrong, worded to follow the key, or the file name when there is no key. */
12
+ problem: z.string(),
13
+ });
14
+ /** One problem as a person reads it: `<file>: <key> <problem>.`, `<file>:<line>:<col> <problem>.` or `<file>: <problem>.` */
15
+ export function configProblemLine(file, { key, location, problem }) {
16
+ const sentence = `${problem.replace(/\.$/, "")}.`;
17
+ if (key !== null)
18
+ return `${file}: ${key} ${sentence}`;
19
+ if (location !== null)
20
+ return `${file}:${location.line}${location.column === null ? "" : `:${location.column}`} ${sentence}`;
21
+ return `${file}: ${sentence}`;
22
+ }
23
+ /** A value one resource option problem is about: its key path, its value as text, and where it came from. */
24
+ const optionValueSchema = z.object({
25
+ /** The option's key path, such as resources.testserverPool.ttl. */
26
+ key: z.string(),
27
+ /** Its value, as text. */
28
+ value: z.string(),
29
+ /** Where it came from: a flag (a --set, or the command's own flag for the option), the config file or the default. */
30
+ source: z.enum(["flag", "file", "default"]),
31
+ });
32
+ const optionProblemSchema = z.object({
33
+ /** The key path of the option the problem is about, such as resources.testserverPool.ttl. */
34
+ key: z.string(),
35
+ /** What is wrong, worded to follow the key path, as the resource's rule words it. */
36
+ problem: z.string(),
37
+ /** Each value the problem is about, with its source; empty for a required option nothing gave. */
38
+ values: z.array(optionValueSchema),
39
+ });
40
+ /** Where one value came from, for a person: `resources.x.y is 20m from the command line`. */
41
+ function optionValueText({ key, value, source }, configFile) {
42
+ switch (source) {
43
+ case "flag":
44
+ return `${key} is ${value} from the command line`;
45
+ case "file":
46
+ return `${key} is ${value} in ${configFile ?? "storm.config.ts"}`;
47
+ case "default":
48
+ return `${key} is ${value} by default`;
49
+ }
50
+ }
51
+ /** One resource option problem as a person reads it: `<key> <problem>: <where each value came from>.` */
52
+ export function optionProblemLine({ key, problem, values }, configFile) {
53
+ const where = values.map((value) => optionValueText(value, configFile));
54
+ const sources = where.length === 0
55
+ ? ""
56
+ : `: ${where.length === 1 ? where.join("") : `${where.slice(0, -1).join(", ")} and ${where.at(-1) ?? ""}`}`;
57
+ return `${key} ${problem.replace(/\.$/, "")}${sources}.`;
58
+ }
59
+ export const configErrors = defineErrors({
60
+ invalidConfig: {
61
+ exitCode: 2,
62
+ description: "storm.config.ts can't be used: it can't be imported, doesn't default-export an object, has an unknown key, or a value in it is invalid. storm checks the whole file whenever a command loads it.",
63
+ schema: z.object({
64
+ /** The config file's absolute path. */
65
+ file: z.string(),
66
+ problems: z.array(problemSchema),
67
+ }),
68
+ render: ({ file, problems }) => {
69
+ const [first, ...rest] = problems;
70
+ return {
71
+ message: first === undefined ? `${file} can't be used.` : configProblemLine(file, first),
72
+ ...(rest.length === 0 ? {} : { rows: [["Also", rest.map((problem) => configProblemLine(file, problem))]] }),
73
+ next: [{ type: "text", text: `Fix ${file}, then retry.` }],
74
+ };
75
+ },
76
+ },
77
+ invalidResourceOptions: {
78
+ exitCode: 2,
79
+ description: "A resource's options, once its defaults, storm.config.ts and the flags are merged, don't fit together, or one it requires is missing: such as resources.testserverPool.ttl not longer than its minTimeLeft. Each problem names the values it is about and where each came from.",
80
+ schema: z.object({
81
+ /** The config file that applied; null when none did. */
82
+ configFile: z.string().nullable(),
83
+ problems: z.array(optionProblemSchema),
84
+ }),
85
+ render: ({ configFile, problems }) => {
86
+ const [first, ...rest] = problems;
87
+ return {
88
+ message: first === undefined ? "A resource's options don't fit together." : optionProblemLine(first, configFile),
89
+ ...(rest.length === 0
90
+ ? {}
91
+ : { rows: [["Also", rest.map((problem) => optionProblemLine(problem, configFile))]] }),
92
+ next: [
93
+ {
94
+ type: "text",
95
+ text: `Change the options on the command line or in ${configFile ?? "storm.config.ts"}, then retry.`,
96
+ },
97
+ ],
98
+ };
99
+ },
100
+ },
101
+ });
@@ -0,0 +1,32 @@
1
+ /** Where Node said an import failed, in the config file: a line, and a column when it gave one. */
2
+ export interface ConfigLocation {
3
+ readonly line: number;
4
+ readonly column?: number;
5
+ }
6
+ /**
7
+ * What importing a config file gave:
8
+ *
9
+ * - `default-export`: the module's default export, whatever it is.
10
+ * - `no-default-export`: the module imported but exports no default.
11
+ * - `import-failed`: Node couldn't import it: a syntax error, TypeScript it can't strip, a throw while it ran, or a
12
+ * file it can't read. `message` is Node's, and `location` where Node gave one in the config file.
13
+ */
14
+ export type ConfigImport = {
15
+ readonly kind: "default-export";
16
+ readonly value: unknown;
17
+ } | {
18
+ readonly kind: "no-default-export";
19
+ } | {
20
+ readonly kind: "import-failed";
21
+ readonly message: string;
22
+ readonly location?: ConfigLocation;
23
+ };
24
+ /** What finding and loading `storm.config.ts` needs from the world. No method rejects. */
25
+ export interface ConfigGateway {
26
+ /** Whether `directory` holds a `storm.config.ts` file. A directory storm can't read holds none. */
27
+ hasConfigFile(directory: string): Promise<boolean>;
28
+ /** Whether `directory` is a git worktree's root: it holds `.git`, a directory or a file. */
29
+ isWorktreeRoot(directory: string): Promise<boolean>;
30
+ /** Imports the config file at `path`, running it. */
31
+ importConfig(path: string): Promise<ConfigImport>;
32
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ export { givenOptionsOf } from "./by-name.ts";
2
+ export { configErrors, configProblemLine, optionProblemLine } from "./errors.ts";
3
+ export type { ConfigGateway, ConfigImport, ConfigLocation } from "./gateways.ts";
4
+ export { liveConfigGateway } from "./live/config-gateway.ts";
5
+ export { type ConfigProblem, type ConfigValues, findConfigFile, type LoadedConfig, loadConfig } from "./load.ts";
6
+ export { type AnyResourceConfig, type GivenOptions, type GivenResources, optionKeyPath, type OptionOf, type OptionProblem, type OptionRule, type OptionRules, type OptionSettings, type OptionsResolution, readBooleanText, readTextAsIs, readWholeNumberText, type ResolvedOf, type ResolvedResources, type ResourceConfig, type ResourceFactory, type Setting, type SettingSource, type SettingsOf, } from "./resource-config.ts";
7
+ export { mergeResourceOptions, type ResolvedSettings, resolveResourceOptions, resolveSettings, type ResourceOptionProblem, type ResourceOptionsResolution, type SettingFlags, } from "./resolve.ts";
8
+ export { type Checked, checkBoolean, type CheckedSettings, checkNonEmptyString, CONFIG_FILE_NAME, CONFIG_SETTING_KEYS, type ConfigKey, type ConfigSettingKey, type ConfigSettings, describeValue, type SettingValue, type ValueProblem, wrongValue, } from "./schema.ts";
9
+ export { type OwnFlags, parseSetFlags, type SetFlagsParse, setKeyPaths } from "./set.ts";
10
+ export { fileOptions, fileSettings, invalidConfig, invalidResourceOptions, loadSettingsFile, type SettingsFile, settleResourceOptions, } from "./settings-file.ts";
@@ -0,0 +1,13 @@
1
+ // The `config` module's public surface: finding, loading and checking `storm.config.ts` against the resource
2
+ // configs a caller passes in, reading `--set` against them, and resolving each top-level setting and each held
3
+ // resource's options. It names no resource. Each resource folder imports the resource config vocabulary to declare its
4
+ // own section; the composition layer passes the registry's resource configs in.
5
+ export { givenOptionsOf } from "./by-name.js";
6
+ export { configErrors, configProblemLine, optionProblemLine } from "./errors.js";
7
+ export { liveConfigGateway } from "./live/config-gateway.js";
8
+ export { findConfigFile, loadConfig } from "./load.js";
9
+ export { optionKeyPath, readBooleanText, readTextAsIs, readWholeNumberText, } from "./resource-config.js";
10
+ export { mergeResourceOptions, resolveResourceOptions, resolveSettings, } from "./resolve.js";
11
+ export { checkBoolean, checkNonEmptyString, CONFIG_FILE_NAME, CONFIG_SETTING_KEYS, describeValue, wrongValue, } from "./schema.js";
12
+ export { parseSetFlags, setKeyPaths } from "./set.js";
13
+ export { fileOptions, fileSettings, invalidConfig, invalidResourceOptions, loadSettingsFile, settleResourceOptions, } from "./settings-file.js";
@@ -0,0 +1,6 @@
1
+ import type { ConfigGateway } from "../gateways.ts";
2
+ /**
3
+ * The live config gateway: `stat` for the config file and `.git`, and a plain `import()`, so Node's own type
4
+ * stripping loads the file. Node caches a module by its URL, so a process imports each config file once.
5
+ */
6
+ export declare function liveConfigGateway(): ConfigGateway;