@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,299 @@
1
+ import { type CommandBuilder } from "@vercel/clinkr";
2
+ import { z } from "zod";
3
+ import type { StormApp } from "../../context.ts";
4
+ /**
5
+ * `storm vitest`: runs `vitest run <args>` in a run (`runCommand`), as `exec` runs a command, after counting the
6
+ * tests and sizing the run before anything is minted, leased or started (`planRun`). Every argument that isn't one of
7
+ * storm's flags goes to `vitest run` unchanged, in order; vitest's own dash options come after `--`, which Clinkr
8
+ * reads into the same `args`.
9
+ */
10
+ export declare function command(cmd: CommandBuilder<StormApp>): import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
11
+ set: z.ZodDefault<z.ZodArray<z.ZodString>>;
12
+ testserverSandboxes: z.ZodOptional<z.ZodNumber>;
13
+ testserverBuild: z.ZodOptional<z.ZodString>;
14
+ testserverMinTimeLeft: z.ZodOptional<z.ZodString>;
15
+ testserverTtl: z.ZodOptional<z.ZodString>;
16
+ testserverNoCreate: z.ZodOptional<z.ZodBoolean>;
17
+ scope: z.ZodOptional<z.ZodString>;
18
+ project: z.ZodOptional<z.ZodString>;
19
+ credential: z.ZodOptional<z.ZodEnum<{
20
+ "github-actions": "github-actions";
21
+ mint: "mint";
22
+ }>>;
23
+ local: z.ZodDefault<z.ZodBoolean>;
24
+ rebuildSnapshot: z.ZodDefault<z.ZodBoolean>;
25
+ showOutput: z.ZodDefault<z.ZodBoolean>;
26
+ keepSandbox: z.ZodOptional<z.ZodString>;
27
+ verbose: z.ZodDefault<z.ZodBoolean>;
28
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
29
+ }, z.core.$strip>, import("@vercel/clinkr").Outcomes<{
30
+ ran: z.ZodObject<{
31
+ version: z.ZodString;
32
+ commit: z.ZodNullable<z.ZodString>;
33
+ configFile: z.ZodNullable<z.ZodString>;
34
+ 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>>>;
35
+ 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>>;
36
+ command: z.ZodObject<{
37
+ exitCode: z.ZodNullable<z.ZodNumber>;
38
+ signal: z.ZodNullable<z.ZodString>;
39
+ }, z.core.$strip>;
40
+ runner: z.ZodNullable<z.ZodObject<{
41
+ snapshotId: z.ZodString;
42
+ base: z.ZodString;
43
+ built: z.ZodBoolean;
44
+ vcpus: z.ZodNumber;
45
+ region: z.ZodString;
46
+ runtime: z.ZodString;
47
+ }, z.core.$strip>>;
48
+ timeline: z.ZodObject<{
49
+ startedAt: z.ZodString;
50
+ totalMs: z.ZodNumber;
51
+ rows: z.ZodArray<z.ZodObject<{
52
+ name: z.ZodEnum<{
53
+ cleanup: "cleanup";
54
+ mint: "mint";
55
+ runner: "runner";
56
+ tests: "tests";
57
+ testserver: "testserver";
58
+ }>;
59
+ startMs: z.ZodNumber;
60
+ endMs: z.ZodNumber;
61
+ outcome: z.ZodEnum<{
62
+ done: "done";
63
+ failed: "failed";
64
+ stopped: "stopped";
65
+ unfinished: "unfinished";
66
+ }>;
67
+ steps: z.ZodArray<z.ZodObject<{
68
+ name: z.ZodEnum<{
69
+ [x: string]: string;
70
+ }>;
71
+ startMs: z.ZodNumber;
72
+ endMs: z.ZodNumber;
73
+ outcome: z.ZodEnum<{
74
+ done: "done";
75
+ failed: "failed";
76
+ stopped: "stopped";
77
+ unfinished: "unfinished";
78
+ }>;
79
+ }, z.core.$strip>>;
80
+ idleMs: z.ZodNumber;
81
+ snapshot: z.ZodOptional<z.ZodEnum<{
82
+ built: "built";
83
+ reused: "reused";
84
+ }>>;
85
+ sandboxes: z.ZodOptional<z.ZodObject<{
86
+ reused: z.ZodNumber;
87
+ created: z.ZodNumber;
88
+ }, z.core.$strip>>;
89
+ }, z.core.$strip>>;
90
+ criticalPath: z.ZodArray<z.ZodEnum<{
91
+ cleanup: "cleanup";
92
+ mint: "mint";
93
+ runner: "runner";
94
+ tests: "tests";
95
+ testserver: "testserver";
96
+ }>>;
97
+ }, z.core.$strip>;
98
+ runId: z.ZodNullable<z.ZodString>;
99
+ plan: z.ZodObject<{
100
+ tests: z.ZodNumber;
101
+ files: z.ZodNumber;
102
+ sandboxes: z.ZodNullable<z.ZodNumber>;
103
+ sandboxesFrom: z.ZodNullable<z.ZodEnum<{
104
+ auto: "auto";
105
+ file: "file";
106
+ flag: "flag";
107
+ }>>;
108
+ }, z.core.$strip>;
109
+ }, z.core.$strip>;
110
+ }, {
111
+ ran: unknown;
112
+ }, {
113
+ noMatchingTests: z.ZodObject<{
114
+ args: z.ZodArray<z.ZodString>;
115
+ cwd: z.ZodString;
116
+ }, z.core.$strip>;
117
+ vitestListFailed: z.ZodObject<{
118
+ args: z.ZodArray<z.ZodString>;
119
+ cwd: z.ZodString;
120
+ kind: z.ZodEnum<{
121
+ exited: "exited";
122
+ "start-failed": "start-failed";
123
+ "timed-out": "timed-out";
124
+ "unreadable-output": "unreadable-output";
125
+ }>;
126
+ message: z.ZodString;
127
+ }, z.core.$strip>;
128
+ credentialRejected: import("@vercel/clinkr").SharedError<"credential_rejected", [{
129
+ origin: {
130
+ source: "mint";
131
+ team: string;
132
+ project: string;
133
+ } | {
134
+ source: "github-actions";
135
+ claims: {
136
+ aud: string;
137
+ repository: string;
138
+ } | null;
139
+ };
140
+ fix: string;
141
+ status: number;
142
+ vercelId: string | null;
143
+ ttlMinutes: number;
144
+ failedCreates: {
145
+ kind: "connect-failed" | "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
146
+ detail: string | null;
147
+ }[];
148
+ unpooled: {
149
+ testserverUrl: string;
150
+ path: string;
151
+ message: string;
152
+ }[];
153
+ sandboxMayExist: boolean;
154
+ } & {
155
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
156
+ }]>;
157
+ credentialUnused: import("@vercel/clinkr").SharedError<"credential_unused", [data: {
158
+ flags: string[];
159
+ configFile: string | null;
160
+ }]>;
161
+ githubFixtureRepoUnavailable: import("@vercel/clinkr").SharedError<"github_fixture_repo_unavailable", [{
162
+ repo: string;
163
+ status: number | null;
164
+ message: string;
165
+ } & {
166
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
167
+ }]>;
168
+ githubTokenMissing: import("@vercel/clinkr").SharedError<"github_token_missing", [data: {
169
+ tokenEnv: string;
170
+ repo: string;
171
+ configFile: string | null;
172
+ requiredBy: "config" | "set";
173
+ }]>;
174
+ invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
175
+ file: string;
176
+ problems: {
177
+ key: string | null;
178
+ location: {
179
+ line: number;
180
+ column: number | null;
181
+ } | null;
182
+ problem: string;
183
+ }[];
184
+ }]>;
185
+ invalidResourceOptions: import("@vercel/clinkr").SharedError<"invalid_resource_options", [data: {
186
+ configFile: string | null;
187
+ problems: {
188
+ key: string;
189
+ problem: string;
190
+ values: {
191
+ key: string;
192
+ value: string;
193
+ source: "default" | "file" | "flag";
194
+ }[];
195
+ }[];
196
+ }]>;
197
+ mintFailed: import("@vercel/clinkr").SharedError<"mint_failed", [data: {
198
+ team: string;
199
+ project: string;
200
+ cause: string;
201
+ fix: string;
202
+ runner: boolean;
203
+ cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
204
+ }]>;
205
+ missingRunner: import("@vercel/clinkr").SharedError<"missing_runner", [data: {
206
+ configFile: string | null;
207
+ }]>;
208
+ missingTarget: import("@vercel/clinkr").SharedError<"missing_target", [data: {
209
+ missing: ("project" | "scope")[];
210
+ }]>;
211
+ noBaseRef: import("@vercel/clinkr").SharedError<"no_base_ref", [data: {
212
+ refs: {
213
+ ref: string;
214
+ reason: "missing" | "unrelated";
215
+ }[];
216
+ }]>;
217
+ noSandboxes: import("@vercel/clinkr").SharedError<"no_sandboxes", [{
218
+ requested: number;
219
+ ttlMinutes: number;
220
+ failedCreates: {
221
+ kind: "connect-failed" | "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
222
+ detail: string | null;
223
+ }[];
224
+ sandboxMayExist: boolean;
225
+ } & {
226
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
227
+ }]>;
228
+ noUsableSandboxes: import("@vercel/clinkr").SharedError<"no_usable_sandboxes", [{
229
+ requested: number;
230
+ build: string;
231
+ } & {
232
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
233
+ }]>;
234
+ poolUnavailable: import("@vercel/clinkr").SharedError<"pool_unavailable", [data: {
235
+ path: string;
236
+ message: string;
237
+ }]>;
238
+ poolUnreadable: import("@vercel/clinkr").SharedError<"pool_unreadable", [{
239
+ path: string;
240
+ message: string;
241
+ } & {
242
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
243
+ }]>;
244
+ runnerFailed: import("@vercel/clinkr").SharedError<"runner_failed", [data: {
245
+ failure: {
246
+ kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
247
+ label: string;
248
+ exitCode: number | null;
249
+ tail: string[];
250
+ } | {
251
+ kind: "sandbox-api-failed";
252
+ operation: string;
253
+ status: number | null;
254
+ message: string;
255
+ } | {
256
+ kind: "checkout-failed";
257
+ message: string;
258
+ command: string | null;
259
+ } | {
260
+ kind: "credential-claims-missing";
261
+ team: string;
262
+ project: string;
263
+ };
264
+ cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
265
+ }]>;
266
+ snapshotGone: import("@vercel/clinkr").SharedError<"snapshot_gone", [data: {
267
+ snapshotId: string;
268
+ base: string;
269
+ removal: {
270
+ path: string;
271
+ message: string;
272
+ } | null;
273
+ cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
274
+ }]>;
275
+ spawnFailed: import("@vercel/clinkr").SharedError<"spawn_failed", [data: {
276
+ executable: string;
277
+ message: string;
278
+ cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
279
+ }]>;
280
+ submodulesRefused: import("@vercel/clinkr").SharedError<"submodules_refused", [data: {
281
+ paths: string[];
282
+ }]>;
283
+ tokenRequestFailed: import("@vercel/clinkr").SharedError<"token_request_failed", [{
284
+ cause: "request-failed" | "variables-missing";
285
+ missing: ("ACTIONS_ID_TOKEN_REQUEST_TOKEN" | "ACTIONS_ID_TOKEN_REQUEST_URL")[] | null;
286
+ status: number | null;
287
+ said: string | null;
288
+ detail: string;
289
+ fix: string;
290
+ ttlMinutes: number;
291
+ failedCreates: {
292
+ kind: "connect-failed" | "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
293
+ detail: string | null;
294
+ }[];
295
+ sandboxMayExist: boolean;
296
+ } & {
297
+ readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
298
+ }]>;
299
+ }>, StormApp, false>;
@@ -0,0 +1,138 @@
1
+ import { refused } from "@vercel/clinkr";
2
+ import { join, parse } from "node:path";
3
+ import { z } from "zod";
4
+ import { AUTO_SANDBOXES_MAX, autoSandboxes, describeVitestListFailure, formatPlan, planVitestRun, vitestRunArgv, WORKERS_PER_SANDBOX, } from "../../vitest/plan.js";
5
+ import { canceledBeforeStart, checkoutFailedRefusal, RUN_CLI_OPTIONS, RUN_REQUEST_FIELDS, runCommand, runProblems, } from "../exec/run-command.js";
6
+ import { testserverSandboxesSource } from "../exec/testserver-flags.js";
7
+ import { outcomes } from "./outcomes.js";
8
+ /**
9
+ * `storm vitest`: runs `vitest run <args>` in a run (`runCommand`), as `exec` runs a command, after counting the
10
+ * tests and sizing the run before anything is minted, leased or started (`planRun`). Every argument that isn't one of
11
+ * storm's flags goes to `vitest run` unchanged, in order; vitest's own dash options come after `--`, which Clinkr
12
+ * reads into the same `args`.
13
+ */
14
+ export function command(cmd) {
15
+ return cmd.define({
16
+ requestSchema: z.object({ ...RUN_REQUEST_FIELDS, args: z.array(z.string()).default([]) }),
17
+ cli: { options: RUN_CLI_OPTIONS, positionals: ["args"] },
18
+ outcomes,
19
+ validate: runProblems,
20
+ handler: async (context, request) => await runCommand(context, request, {
21
+ name: "vitest",
22
+ prepare: async (settled, signal) => await planRun(context.app, context.ui.progress, request, settled, signal),
23
+ ran: (facts, plan) => outcomes.ran({ ...facts, plan }),
24
+ }),
25
+ });
26
+ }
27
+ /**
28
+ * Plans a settled run's `vitest run`, before anything is minted, leased or started, and before a runner run's local
29
+ * checks:
30
+ *
31
+ * 1. Where to count: a local run's working directory; a runner run's `<repository root>/<runner.cwd>`, the directory on
32
+ * this machine that vitest runs in, in the runner sandbox, under `/vercel/sandbox/<runner.cwd>`. A runner run whose
33
+ * repository root git can't say is `runner_failed`, as its local checks would end it.
34
+ * 2. Finds `vitest` in `node_modules/.bin` of that directory and each above it, up to the repository's root, or the
35
+ * filesystem's root outside a repository: `vitest_list_failed` (`start-failed`) naming each directory searched when
36
+ * none has it.
37
+ * 3. Counts the tests with `vitest list --json <args>` there, with this machine's environment:
38
+ * `vitest_list_failed` when it fails, `no_matching_tests` when it lists none. `signal` aborting stops it, and the
39
+ * run cancels (`canceledBeforeStart`).
40
+ * 4. With a Testserver side whose sandbox count came from neither `--testserver-sandboxes` nor the config file, asks
41
+ * for one Testserver sandbox per 4 test files, at most 8 (`autoSandboxes`), in both the resource's options, which a
42
+ * runner recipe's `vcpus` function reads, and its request.
43
+ * 5. Says the plan on stderr, unless under `--json`.
44
+ *
45
+ * The command a local run runs is the `vitest` found; a runner run's is plain `vitest`, which the runner's `PATH`
46
+ * finds in `node_modules/.bin` of `runner.cwd` and of the repository's root.
47
+ */
48
+ async function planRun(app, progress, request, settled, signal) {
49
+ const { args } = request;
50
+ const { where } = settled;
51
+ const root = await app.context.checkout.repositoryRoot({ cwd: app.cwd });
52
+ let cwd;
53
+ let searchRoot;
54
+ if (where.kind === "local") {
55
+ cwd = app.cwd;
56
+ searchRoot = root.ok ? root.value : parse(app.cwd).root;
57
+ }
58
+ else {
59
+ if (!root.ok)
60
+ return refused(checkoutFailedRefusal(root.failure));
61
+ cwd = join(root.value, where.recipe.cwd);
62
+ searchRoot = root.value;
63
+ }
64
+ const found = await app.context.vitestList.findVitest({ from: cwd, root: searchRoot });
65
+ if (!found.ok)
66
+ return refused(outcomes.vitestListFailed({
67
+ kind: "start-failed",
68
+ message: `found no vitest in node_modules/.bin of ${found.searched.join(", ")}`,
69
+ args: [...args],
70
+ cwd,
71
+ }));
72
+ const planned = await planVitestRun({ args, cwd, executable: found.path, signal }, app.context.vitestList);
73
+ if (!planned.ok) {
74
+ const { failure } = planned;
75
+ if (failure.kind === "canceled")
76
+ return refused(canceledBeforeStart());
77
+ return refused(outcomes.vitestListFailed({
78
+ kind: failure.kind,
79
+ message: describeVitestListFailure(failure),
80
+ args: [...args],
81
+ cwd,
82
+ }));
83
+ }
84
+ const { tests, files } = planned.plan;
85
+ if (tests === 0)
86
+ return refused(outcomes.noMatchingTests({ args: [...args], cwd }));
87
+ const sized = sizeRun(settled, request, { tests, files });
88
+ await progress?.(planLine(sized.plan));
89
+ const executable = where.kind === "local" ? found.path : "vitest";
90
+ return { ok: true, argv: vitestRunArgv(executable, args), settled: sized.settled, plan: sized.plan };
91
+ }
92
+ /**
93
+ * The run's test plan, and the settled run with the Testserver sandbox count it asks for: without a Testserver side,
94
+ * none; from `--testserver-sandboxes` or the config file, as settled; otherwise `autoSandboxes(files)`, in place of the
95
+ * option's default in both the resource's options and its request.
96
+ */
97
+ function sizeRun(settled, request, { tests, files }) {
98
+ const pool = settled.options.testserverPool;
99
+ const requested = settled.settlement.requests.testserverPool;
100
+ const counted = { tests, files, sandboxes: null, sandboxesFrom: null };
101
+ if (pool === undefined || requested === undefined)
102
+ return { settled, plan: counted };
103
+ const source = testserverSandboxesSource(request, settled.file);
104
+ if (source !== "default")
105
+ return { settled, plan: { ...counted, sandboxes: pool.sandboxes, sandboxesFrom: source } };
106
+ const sandboxes = autoSandboxes(files);
107
+ return {
108
+ settled: {
109
+ ...settled,
110
+ options: { ...settled.options, testserverPool: { ...pool, sandboxes } },
111
+ settlement: {
112
+ ...settled.settlement,
113
+ requests: { ...settled.settlement.requests, testserverPool: { ...requested, sandboxes } },
114
+ },
115
+ },
116
+ plan: { ...counted, sandboxes, sandboxesFrom: "auto" },
117
+ };
118
+ }
119
+ /**
120
+ * The plan as a person reads it before the run: `Running 65 tests in 19 files on 5 Testserver sandboxes (one per 4
121
+ * files, at most 8)`, naming where the count came from, or without a Testserver side `Running 65 tests in 19 files`.
122
+ */
123
+ function planLine(plan) {
124
+ const counted = `Running ${formatPlan(plan)}`;
125
+ if (plan.sandboxes === null)
126
+ return counted;
127
+ const on = `${counted} on ${plan.sandboxes} Testserver ${plan.sandboxes === 1 ? "sandbox" : "sandboxes"}`;
128
+ switch (plan.sandboxesFrom) {
129
+ case "auto":
130
+ return `${on} (one per ${WORKERS_PER_SANDBOX} files, at most ${AUTO_SANDBOXES_MAX})`;
131
+ case "flag":
132
+ return `${on} (--testserver-sandboxes)`;
133
+ case "file":
134
+ return `${on} (resources.testserverPool.sandboxes in storm.config.ts)`;
135
+ case null:
136
+ return on;
137
+ }
138
+ }
@@ -0,0 +1,66 @@
1
+ export declare const metadata: {
2
+ description: string;
3
+ summary: string;
4
+ usages: string[];
5
+ fields: {
6
+ testserverBuild: {
7
+ readonly valueLabel: "BUILD";
8
+ readonly description: "The build the Testserver sandboxes run: a build name or the build channel stable or latest_main, overriding resources.testserverPool.build in storm.config.ts; default stable. Gives the run a Testserver side.";
9
+ };
10
+ testserverMinTimeLeft: {
11
+ readonly valueLabel: "DURATION";
12
+ readonly description: "The least time left a Testserver sandbox from the pool needs, in whole minutes or hours (30m, 2h), overriding resources.testserverPool.minTimeLeft in storm.config.ts; default 30m. Gives the run a Testserver side.";
13
+ };
14
+ testserverTtl: {
15
+ readonly valueLabel: "DURATION";
16
+ readonly description: "How long each Testserver sandbox the run creates lives, 10m to 5h and longer than minTimeLeft, overriding resources.testserverPool.ttl in storm.config.ts; default 5h. Not with noCreate. Gives the run a Testserver side.";
17
+ };
18
+ testserverNoCreate: {
19
+ readonly description: "Run only on Testserver sandboxes already in the pool, never minting for Testserver or creating: needs no --scope or --project with --local, and takes no --testserver-ttl. Turns on resources.testserverPool.noCreate whatever storm.config.ts says; without it, the file's noCreate, default false, applies. Gives the run a Testserver side.";
20
+ };
21
+ set: {
22
+ readonly valueLabel: "KEY=VALUE";
23
+ readonly description: "Set a resource's option for this run by its key path in storm.config.ts, resources.<name>.<option>, overriding the file and the default; repeat it for each option. The key paths: resources.githubFixtureRepo.repo, the GitHub repository as owner/name, required; resources.githubFixtureRepo.tokenEnv, the host environment variable holding its token, required; resources.githubFixtureRepo.optional, true or false, default false: false refuses the run without the token, true goes on without the repository. The Testserver pool resource's options have their own flags, --testserver-<option>, which --set doesn't take. Any --set of a resource's option gives the run that resource, as storm.config.ts does. An unknown key path, one given twice, one with its own flag, or a value its option refuses is a usage error. Options that don't fit together once merged, or a required one nothing gives, are invalid_resource_options, naming where each value came from.";
24
+ };
25
+ credential: {
26
+ readonly valueLabel: "SOURCE";
27
+ readonly description: "The credential source: mint, the default, mints one with the vercel CLI for --scope and --project; github-actions requests a GitHub Actions OIDC token, in a GitHub Actions job with permissions id-token: write, anew once it is 4 minutes old, and needs no --scope or --project. Only --local takes it: a runner run needs the mint. Only a run holding a resource that takes a credential takes it, the Testserver pool resource without noCreate (resources.testserverPool in storm.config.ts, or any --testserver-* flag but --testserver-no-create); otherwise it is credential_unused. No config key.";
28
+ };
29
+ local: {
30
+ readonly description: "Run the command on this machine instead of in a runner sandbox. Without it, the command runs in a Vercel Sandbox started from a runner snapshot of the base, with this checkout's changes applied, installed and built, from the runner key of storm.config.ts, and its output streams back with paths rewritten to this checkout's. No config key.";
31
+ };
32
+ rebuildSnapshot: {
33
+ readonly description: "Build a runner snapshot of the base whatever the runner snapshot cache holds, replacing an entry for the same base. Not with --local. No config key.";
34
+ };
35
+ keepSandbox: {
36
+ readonly valueLabel: "DURATION";
37
+ readonly description: "How long the runner sandbox keeps running once the run ends, however it ends, so you can connect to it from its page in the Vercel dashboard: 0, which stops and deletes it with the run's other sandboxes, or a whole number of minutes or hours up to 5h (30m, 2h). The run asks Vercel Sandbox to extend the runner sandbox's timeout when it would stop sooner; it never shortens it, so the sandbox may run past the keep time until its own timeout. The run says until when it runs, and storm runs show and runs list say so too. Default: keepSandbox in the runner recipe, else 30m, or 0 when CI is set. Not with --local.";
38
+ };
39
+ showOutput: {
40
+ readonly description: "In a runner run on a terminal, print the runner's step output (a snapshot build, the install, the build) above the live view instead of keeping only each step's last line there. Plain output always prints it. Either way, the run directory keeps it whole. Not with --local. No config key.";
41
+ };
42
+ verbose: {
43
+ readonly description: "Print more as it happens: each Testserver sandbox create's progress messages, the runner's step output as with --show-output, and verbose in the run payload, which has the Vitest adapter's reporters print each test as it finishes and its fixtures print each container start, proxied request and vercel invocation, for passing tests too. No config key.";
44
+ };
45
+ scope: {
46
+ readonly valueLabel: "TEAM";
47
+ readonly description: "The control plane team: the Vercel team whose project's development OIDC tokens the Testserver control plane trusts. Required, from this flag or scope in storm.config.ts, unless --local without a Testserver side, with noCreate or with --credential github-actions.";
48
+ };
49
+ project: {
50
+ readonly valueLabel: "PROJECT";
51
+ readonly description: "The control plane project: the Vercel project, within the team, to mint the credential for. Required, from this flag or project in storm.config.ts, unless --local without a Testserver side, with noCreate or with --credential github-actions.";
52
+ };
53
+ testserverSandboxes: {
54
+ valueLabel: string;
55
+ description: string;
56
+ };
57
+ args: {
58
+ valueLabel: string;
59
+ description: string;
60
+ };
61
+ };
62
+ examples: {
63
+ argv: string;
64
+ description: string;
65
+ }[];
66
+ };
@@ -0,0 +1,35 @@
1
+ import { RUN_FIELDS, RUN_USAGE_FLAGS } from "../exec/run-metadata.js";
2
+ export const metadata = {
3
+ description: "Run vitest run with the run payload in STORM_RUN, after counting its tests and sizing the run. storm's flags come first; every other argument goes to vitest run unchanged, in order. Put vitest's own dash options, such as -t or --project, after --. Before anything is minted, leased or started, it counts the tests with vitest list --json and the same arguments, on this machine, with this machine's environment: in the working directory for a local run (--local), and in <repository root>/<runner cwd> for a runner run, the directory where vitest runs in the runner sandbox. It refuses with no_matching_tests when vitest lists none, and with vitest_list_failed when listing fails; vitest list refuses some options only vitest run takes. A signal while it counts stops vitest list and cancels the run. A vitest config that resolves only inside the runner sandbox can't be counted here: run it with storm exec. With a Testserver side (resources.testserverPool in storm.config.ts, or any --testserver-* flag), the run gets --testserver-sandboxes if given, else resources.testserverPool.sandboxes in storm.config.ts, else one Testserver sandbox per 4 test files, at least 1 and at most 8; it says the count and where it came from on stderr before it leases. In a local run, vitest is the nearest node_modules/.bin/vitest from the working directory up to the repository's root, or the filesystem's root outside a repository; in a runner run, vitest from the runner's PATH, which starts with node_modules/.bin of the runner cwd and of the repository's root. Otherwise it runs as storm exec does: in a runner sandbox by default or on this machine with --local, with a live view or plain lines on stderr, a waterfall, a run directory that storm runs show reads back, and the exit code of vitest. The run's result and its run directory's run.json carry the test plan: the tests and files counted, and the Testserver sandbox count and where it came from.",
4
+ summary: "Count the tests, size the run, and run vitest.",
5
+ usages: [`${RUN_USAGE_FLAGS} [<vitest run args>...] [-- <vitest dash options>...]`],
6
+ fields: {
7
+ ...RUN_FIELDS,
8
+ testserverSandboxes: {
9
+ valueLabel: "N",
10
+ description: "How many Testserver sandboxes the command gets, 1 to 32, overriding resources.testserverPool.sandboxes in storm.config.ts; without either, one per 4 test files vitest list counted, at least 1 and at most 8. Gives the run a Testserver side.",
11
+ },
12
+ args: {
13
+ valueLabel: "args",
14
+ description: "What vitest run gets, unchanged and in order: every argument that isn't one of storm's flags, such as file filters, then everything after --, such as -t or --project. vitest list --json gets the same arguments when it counts the tests.",
15
+ },
16
+ },
17
+ examples: [
18
+ {
19
+ argv: "",
20
+ description: "Run every test in a runner sandbox, with the runner recipe, team and project from storm.config.ts, and its Testserver side sized from the test count.",
21
+ },
22
+ {
23
+ argv: "test/api -- -t creates",
24
+ description: "Run the tests named creates in the files under test/api.",
25
+ },
26
+ {
27
+ argv: "--local --testserver-no-create",
28
+ description: "Run on this machine, on Testserver sandboxes already in the pool, never minting.",
29
+ },
30
+ {
31
+ argv: "--testserver-sandboxes 6 -- --project testserver",
32
+ description: "Run vitest's testserver project against 6 Testserver sandboxes, whatever the test count.",
33
+ },
34
+ ],
35
+ };