@cnc-tools/storm 0.15.0 → 0.17.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 (305) hide show
  1. package/dist/application.d.ts +22 -13
  2. package/dist/application.js +21 -10
  3. package/dist/bin/run.d.ts +18 -0
  4. package/dist/bin/run.js +31 -0
  5. package/dist/bin/storm.js +42 -26
  6. package/dist/build-info.js +1 -1
  7. package/dist/chunks/{chunk-5CCP36QQ.js → chunk-2RNDPDTJ.js} +2 -2
  8. package/dist/chunks/chunk-2VP4GRJM.js +1219 -0
  9. package/dist/chunks/{chunk-SZEURWRS.js → chunk-4O5C2XGJ.js} +18 -15
  10. package/dist/chunks/{chunk-VL7WFTVQ.js → chunk-4WAMTUWZ.js} +419 -340
  11. package/dist/chunks/{chunk-QVS7HRU7.js → chunk-6UHIJXZG.js} +3 -3
  12. package/dist/chunks/{chunk-CN4EFA5J.js → chunk-72ZFEMAW.js} +1 -1
  13. package/dist/chunks/{chunk-4U4DZ7VG.js → chunk-7DZE67QM.js} +2 -2
  14. package/dist/chunks/{chunk-VUPZH7J2.js → chunk-BCBKYOHW.js} +1 -1
  15. package/dist/chunks/{chunk-QUHY6FGN.js → chunk-CKGZA25H.js} +1 -18
  16. package/dist/chunks/{chunk-ZG3WQ4UF.js → chunk-D27KILIA.js} +1 -1
  17. package/dist/chunks/{chunk-KC4KDJ5K.js → chunk-DADEYJDW.js} +174 -153
  18. package/dist/chunks/{chunk-R7XVBZOY.js → chunk-EEENLQHE.js} +59 -11
  19. package/dist/chunks/chunk-F4MOYHRY.js +198 -0
  20. package/dist/chunks/{chunk-CXAT7ZKP.js → chunk-FNBB6V4R.js} +1 -1
  21. package/dist/chunks/{chunk-OX7X4B2L.js → chunk-GRT3UIBV.js} +18 -1
  22. package/dist/chunks/chunk-HP3CURSZ.js +88 -0
  23. package/dist/chunks/{chunk-PN5ULTTH.js → chunk-HWIQ2S7K.js} +5 -5
  24. package/dist/chunks/chunk-JN3YY6ZH.js +2166 -0
  25. package/dist/chunks/{chunk-TJNFVNKR.js → chunk-LKTZ5OXS.js} +1 -1
  26. package/dist/chunks/{chunk-XEVHP5ZW.js → chunk-M7EKRGVD.js} +8 -8
  27. package/dist/chunks/chunk-MR77L2GK.js +340 -0
  28. package/dist/chunks/{chunk-L36GBUBB.js → chunk-RNAS7JHE.js} +1755 -522
  29. package/dist/chunks/{chunk-5GBMR4HM.js → chunk-RWIXDDCK.js} +4 -192
  30. package/dist/chunks/{chunk-5VXBKPW6.js → chunk-WV3DP6NR.js} +1 -1
  31. package/dist/chunks/{chunk-AWBSONHB.js → chunk-XBDRVFEV.js} +55 -16
  32. package/dist/chunks/{chunk-YV7GE6EV.js → chunk-YEPFSLQR.js} +480 -375
  33. package/dist/chunks/{live-app-PI3BAN6Y.js → live-app-R76JQXZL.js} +15 -13
  34. package/dist/commands/exec/across-sandboxes-outcomes.d.ts +1 -1
  35. package/dist/commands/exec/across-sandboxes-outcomes.js +4 -3
  36. package/dist/commands/exec/before-run.d.ts +123 -0
  37. package/dist/commands/exec/before-run.js +105 -0
  38. package/dist/commands/exec/command.d.ts +39 -4
  39. package/dist/commands/exec/command.js +31 -95
  40. package/dist/commands/exec/driver-plan.d.ts +9 -4
  41. package/dist/commands/exec/driver-plan.js +8 -8
  42. package/dist/commands/exec/exec-words.js +1 -1
  43. package/dist/commands/exec/execute-run.d.ts +39 -0
  44. package/dist/commands/exec/execute-run.js +325 -0
  45. package/dist/commands/exec/live-view.d.ts +3 -3
  46. package/dist/commands/exec/live-view.js +16 -15
  47. package/dist/commands/exec/metadata.js +1 -1
  48. package/dist/commands/exec/mint-failed.d.ts +38 -0
  49. package/dist/commands/exec/mint-failed.js +27 -4
  50. package/dist/commands/exec/outcomes.d.ts +38 -9
  51. package/dist/commands/exec/outcomes.js +32 -25
  52. package/dist/commands/exec/plan-run.d.ts +58 -150
  53. package/dist/commands/exec/plan-run.js +232 -88
  54. package/dist/commands/exec/planned-outcome.js +8 -1
  55. package/dist/commands/exec/progress.d.ts +10 -6
  56. package/dist/commands/exec/progress.js +38 -25
  57. package/dist/commands/exec/run-bin.d.ts +11 -11
  58. package/dist/commands/exec/run-bin.js +9 -9
  59. package/dist/commands/exec/run-flags.d.ts +69 -0
  60. package/dist/commands/exec/run-flags.js +58 -0
  61. package/dist/commands/exec/run-metadata.js +5 -5
  62. package/dist/commands/exec/run-summary.d.ts +58 -0
  63. package/dist/commands/exec/run-summary.js +205 -0
  64. package/dist/commands/exec/runner-refusals.d.ts +82 -0
  65. package/dist/commands/exec/runner-refusals.js +71 -0
  66. package/dist/commands/exec/sandbox-progress.js +3 -0
  67. package/dist/commands/exec/stopped-outcome.d.ts +12 -0
  68. package/dist/commands/exec/stopped-outcome.js +77 -0
  69. package/dist/commands/exec/view.d.ts +20 -11
  70. package/dist/commands/exec/view.js +103 -47
  71. package/dist/commands/runs/facts.d.ts +9 -4
  72. package/dist/commands/runs/facts.js +28 -11
  73. package/dist/commands/runs/list/command.d.ts +16 -6
  74. package/dist/commands/runs/list/command.js +10 -10
  75. package/dist/commands/runs/list/outcomes.d.ts +8 -3
  76. package/dist/commands/runs/logs/command.d.ts +6 -2
  77. package/dist/commands/runs/logs/command.js +10 -10
  78. package/dist/commands/runs/logs/outcomes.d.ts +3 -1
  79. package/dist/commands/runs/past-run.d.ts +14 -5
  80. package/dist/commands/runs/past-run.js +16 -5
  81. package/dist/commands/runs/show/command.d.ts +20 -8
  82. package/dist/commands/runs/show/command.js +30 -28
  83. package/dist/commands/runs/show/outcomes.d.ts +10 -4
  84. package/dist/commands/runs/show/outcomes.js +7 -5
  85. package/dist/commands/snapshots/access.d.ts +111 -0
  86. package/dist/commands/snapshots/access.js +96 -0
  87. package/dist/commands/snapshots/build/command.d.ts +360 -93
  88. package/dist/commands/snapshots/build/command.js +446 -150
  89. package/dist/commands/snapshots/build/metadata.d.ts +10 -0
  90. package/dist/commands/snapshots/build/metadata.js +31 -11
  91. package/dist/commands/snapshots/build/outcomes.d.ts +234 -43
  92. package/dist/commands/snapshots/build/outcomes.js +200 -36
  93. package/dist/commands/snapshots/list/command.d.ts +368 -27
  94. package/dist/commands/snapshots/list/command.js +296 -66
  95. package/dist/commands/snapshots/list/metadata.d.ts +16 -0
  96. package/dist/commands/snapshots/list/metadata.js +29 -6
  97. package/dist/commands/snapshots/list/outcomes.d.ts +245 -13
  98. package/dist/commands/snapshots/list/outcomes.js +221 -50
  99. package/dist/commands/snapshots/metadata.js +1 -1
  100. package/dist/commands/snapshots/prune/command.d.ts +430 -0
  101. package/dist/commands/snapshots/prune/command.js +161 -0
  102. package/dist/commands/snapshots/prune/metadata.d.ts +28 -0
  103. package/dist/commands/snapshots/prune/metadata.js +39 -0
  104. package/dist/commands/snapshots/prune/outcomes.d.ts +208 -0
  105. package/dist/commands/snapshots/prune/outcomes.js +78 -0
  106. package/dist/commands/suites/list/command.js +19 -18
  107. package/dist/commands/suites/list/outcomes.js +4 -4
  108. package/dist/commands/test/command.d.ts +39 -4
  109. package/dist/commands/test/command.js +50 -255
  110. package/dist/commands/test/metadata.js +1 -1
  111. package/dist/commands/test/outcomes.d.ts +19 -2
  112. package/dist/commands/test/outcomes.js +2 -2
  113. package/dist/config/check-runner.d.ts +5 -3
  114. package/dist/config/check-runner.js +33 -7
  115. package/dist/config/check-suites.js +1 -0
  116. package/dist/config/credential-resolver.d.ts +50 -5
  117. package/dist/config/credential-resolver.js +51 -19
  118. package/dist/config/credential-settle.d.ts +6 -2
  119. package/dist/config/credential-settle.js +11 -5
  120. package/dist/config/gateways.d.ts +7 -3
  121. package/dist/config/index.d.ts +4 -5
  122. package/dist/config/index.js +3 -4
  123. package/dist/config/live/config-gateway.js +5 -2
  124. package/dist/config/load.d.ts +21 -4
  125. package/dist/config/load.js +129 -15
  126. package/dist/config/runner.d.ts +7 -8
  127. package/dist/config/runner.js +1 -1
  128. package/dist/config/schema.d.ts +17 -5
  129. package/dist/config/schema.js +11 -3
  130. package/dist/config/typed-options.d.ts +1 -6
  131. package/dist/config/typed-options.js +2 -10
  132. package/dist/config-file/define.d.ts +1 -11
  133. package/dist/config-file/define.js +3 -3
  134. package/dist/config-file/runner.d.ts +5 -6
  135. package/dist/config-file/toolchain.d.ts +13 -7
  136. package/dist/config-file/toolchain.js +53 -37
  137. package/dist/context.d.ts +8 -6
  138. package/dist/context.js +7 -6
  139. package/dist/core/across-sandboxes.d.ts +7 -6
  140. package/dist/core/across-sandboxes.js +123 -152
  141. package/dist/core/coordinator.d.ts +166 -0
  142. package/dist/core/coordinator.js +233 -0
  143. package/dist/core/events.d.ts +2 -2
  144. package/dist/core/index.d.ts +4 -2
  145. package/dist/core/index.js +1 -1
  146. package/dist/core/outcomes.d.ts +148 -0
  147. package/dist/core/{sandbox-end.js → outcomes.js} +28 -4
  148. package/dist/core/resources.d.ts +31 -53
  149. package/dist/core/resources.js +32 -70
  150. package/dist/core/run-state.d.ts +7 -1
  151. package/dist/core/run-state.js +2 -0
  152. package/dist/core/run.d.ts +32 -236
  153. package/dist/core/run.js +106 -266
  154. package/dist/core/state-directory.d.ts +1 -1
  155. package/dist/core/state-directory.js +2 -2
  156. package/dist/credential/gateways.d.ts +15 -1
  157. package/dist/credential/index.d.ts +4 -3
  158. package/dist/credential/index.js +3 -2
  159. package/dist/credential/live/vercel-cli-gateway.d.ts +1 -1
  160. package/dist/credential/live/vercel-cli-gateway.js +1 -1
  161. package/dist/credential/live/vercel-oidc-token-gateway.d.ts +11 -0
  162. package/dist/credential/live/vercel-oidc-token-gateway.js +16 -0
  163. package/dist/credential/source.d.ts +73 -6
  164. package/dist/credential/source.js +55 -2
  165. package/dist/extension-commands.d.ts +6 -1
  166. package/dist/extension-commands.js +15 -1
  167. package/dist/extensions/github/resource.d.ts +1 -1
  168. package/dist/extensions/github/resource.js +1 -1
  169. package/dist/extensions/testserver/commands/pool/create/command.d.ts +35 -2
  170. package/dist/extensions/testserver/commands/pool/create/command.js +7 -7
  171. package/dist/extensions/testserver/commands/pool/create/metadata.js +5 -5
  172. package/dist/extensions/testserver/commands/pool/create/outcomes.d.ts +17 -1
  173. package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
  174. package/dist/extensions/testserver/credential-facts.d.ts +6 -2
  175. package/dist/extensions/testserver/credential-facts.js +29 -11
  176. package/dist/extensions/testserver/lifecycle.js +7 -1
  177. package/dist/extensions/testserver/limit.d.ts +3 -0
  178. package/dist/extensions/testserver/limit.js +3 -0
  179. package/dist/extensions/testserver/provision.d.ts +8 -1
  180. package/dist/extensions/testserver/provision.js +8 -3
  181. package/dist/extensions/testserver/refusals.d.ts +6 -1
  182. package/dist/extensions/testserver/refusals.js +16 -1
  183. package/dist/extensions/testserver/resource.d.ts +2 -2
  184. package/dist/extensions/testserver/resource.js +2 -2
  185. package/dist/extensions/testserver/result.d.ts +1 -1
  186. package/dist/extensions/testserver/result.js +9 -4
  187. package/dist/planning/driver-file-lists.d.ts +0 -15
  188. package/dist/planning/driver-file-lists.js +2 -21
  189. package/dist/planning/plan-only.d.ts +7 -15
  190. package/dist/planning/plan-only.js +16 -22
  191. package/dist/planning/run-kind-flags.js +2 -2
  192. package/dist/planning/run-plan.d.ts +45 -13
  193. package/dist/planning/run-plan.js +4 -3
  194. package/dist/planning/suites.d.ts +1 -1
  195. package/dist/planning/suites.js +2 -2
  196. package/dist/planning/test-plan.d.ts +9 -0
  197. package/dist/planning/test-plan.js +10 -2
  198. package/dist/run-directory/recording.js +2 -2
  199. package/dist/run-directory/run-record.d.ts +21 -6
  200. package/dist/run-directory/run-record.js +12 -9
  201. package/dist/runner/base.d.ts +0 -6
  202. package/dist/runner/base.js +1 -16
  203. package/dist/runner/build-snapshots.d.ts +55 -29
  204. package/dist/runner/build-snapshots.js +135 -35
  205. package/dist/runner/context.d.ts +15 -7
  206. package/dist/runner/context.js +19 -6
  207. package/dist/runner/events.d.ts +16 -10
  208. package/dist/runner/gateways.d.ts +92 -21
  209. package/dist/runner/gateways.js +1 -1
  210. package/dist/runner/index.d.ts +11 -7
  211. package/dist/runner/index.js +9 -4
  212. package/dist/runner/live/sandbox-errors.d.ts +2 -0
  213. package/dist/runner/live/sandbox-errors.js +4 -0
  214. package/dist/runner/live/sandbox-gateway.js +141 -3
  215. package/dist/runner/live/snapshot-index-gateway.d.ts +12 -0
  216. package/dist/runner/live/{snapshot-cache-gateway.js → snapshot-index-gateway.js} +11 -11
  217. package/dist/runner/live/snapshot-records.js +6 -7
  218. package/dist/runner/local-snapshot-index.d.ts +199 -0
  219. package/dist/runner/local-snapshot-index.js +211 -0
  220. package/dist/runner/network-policy.d.ts +6 -6
  221. package/dist/runner/network-policy.js +7 -7
  222. package/dist/runner/policy-writes.d.ts +1 -1
  223. package/dist/runner/policy-writes.js +1 -1
  224. package/dist/runner/prepare.d.ts +25 -24
  225. package/dist/runner/prepare.js +28 -20
  226. package/dist/runner/ready.d.ts +18 -10
  227. package/dist/runner/ready.js +104 -33
  228. package/dist/runner/sandboxed-command.d.ts +3 -3
  229. package/dist/runner/sandboxed-command.js +3 -3
  230. package/dist/runner/scope.d.ts +10 -6
  231. package/dist/runner/scope.js +10 -3
  232. package/dist/runner/secrets.d.ts +13 -13
  233. package/dist/runner/secrets.js +18 -15
  234. package/dist/runner/session.d.ts +8 -8
  235. package/dist/runner/session.js +3 -3
  236. package/dist/runner/shared-snapshot-entry.d.ts +92 -0
  237. package/dist/runner/shared-snapshot-entry.js +168 -0
  238. package/dist/runner/shared-snapshot-list.d.ts +81 -0
  239. package/dist/runner/shared-snapshot-list.js +155 -0
  240. package/dist/runner/shared-snapshot-lookup.d.ts +51 -0
  241. package/dist/runner/shared-snapshot-lookup.js +118 -0
  242. package/dist/runner/shared-snapshot-prune.d.ts +58 -0
  243. package/dist/runner/shared-snapshot-prune.js +133 -0
  244. package/dist/runner/snapshot-build.d.ts +42 -14
  245. package/dist/runner/snapshot-build.js +38 -28
  246. package/dist/runner/snapshot-choice.js +1 -1
  247. package/dist/runner/snapshot-inspect.d.ts +39 -40
  248. package/dist/runner/snapshot-inspect.js +58 -38
  249. package/dist/runner/snapshot-key.d.ts +30 -21
  250. package/dist/runner/snapshot-key.js +49 -29
  251. package/dist/runner/steps.d.ts +1 -1
  252. package/dist/runner/steps.js +1 -1
  253. package/dist/runner/{recipe-check.d.ts → vercel-sandbox-check.d.ts} +2 -2
  254. package/dist/runner/{recipe-check.js → vercel-sandbox-check.js} +3 -2
  255. package/dist/runner/{recipe.d.ts → vercel-sandbox-options.d.ts} +82 -82
  256. package/dist/runner/vercel-sandbox-options.js +510 -0
  257. package/dist/runner/{recipe-secrets.d.ts → vercel-sandbox-secrets.d.ts} +6 -6
  258. package/dist/runner/{recipe-secrets.js → vercel-sandbox-secrets.js} +20 -20
  259. package/dist/sdk/extension/commands.d.ts +8 -3
  260. package/dist/sdk/extension/commands.js +3 -1
  261. package/dist/sdk/extension/credential-diagnosis.d.ts +3 -1
  262. package/dist/sdk/extension/credential-diagnosis.js +25 -5
  263. package/dist/sdk/extension/credential-source.d.ts +20 -3
  264. package/dist/sdk/extension/credential-source.js +4 -4
  265. package/dist/sdk/extension/index.d.ts +3 -2
  266. package/dist/sdk/extension/index.js +2 -1
  267. package/dist/sdk/extension/resource-definition.d.ts +4 -3
  268. package/dist/sdk/extension/resource-definition.js +3 -2
  269. package/dist/sdk/extension/resource-factory.js +3 -4
  270. package/dist/sdk/extension/secret-source.d.ts +1 -1
  271. package/dist/sdk/extension/secret-source.js +1 -1
  272. package/dist/sdk/extension/vercel-oidc-facts.d.ts +20 -0
  273. package/dist/sdk/extension/vercel-oidc-facts.js +20 -0
  274. package/dist/sdk/run/present.d.ts +3 -3
  275. package/dist/sdk/run/present.js +1 -3
  276. package/dist/shared/cleanup.d.ts +3 -3
  277. package/dist/shared/cleanup.js +15 -5
  278. package/dist/shared/snapshot-text.d.ts +4 -4
  279. package/dist/shared/snapshot-text.js +11 -11
  280. package/dist/time/duration.js +1 -1
  281. package/package.json +3 -2
  282. package/skills/overview.md +6 -4
  283. package/skills/plan-runs.md +2 -2
  284. package/skills/read-run-output.md +6 -6
  285. package/dist/chunks/chunk-E4PJNZVG.js +0 -783
  286. package/dist/chunks/chunk-RAQEXKL6.js +0 -2591
  287. package/dist/commands/exec/across-sandboxes-run.d.ts +0 -180
  288. package/dist/commands/exec/across-sandboxes-run.js +0 -339
  289. package/dist/commands/exec/plan-only.d.ts +0 -10
  290. package/dist/commands/exec/plan-only.js +0 -46
  291. package/dist/commands/exec/run-command.d.ts +0 -476
  292. package/dist/commands/exec/run-command.js +0 -604
  293. package/dist/commands/exec/run-planned.d.ts +0 -20
  294. package/dist/commands/exec/run-planned.js +0 -22
  295. package/dist/commands/exec/sandbox-view.d.ts +0 -19
  296. package/dist/commands/exec/sandbox-view.js +0 -72
  297. package/dist/commands/test/plan.d.ts +0 -92
  298. package/dist/commands/test/plan.js +0 -128
  299. package/dist/config/recipe-run.d.ts +0 -33
  300. package/dist/config/recipe-run.js +0 -28
  301. package/dist/core/sandbox-end.d.ts +0 -64
  302. package/dist/runner/live/snapshot-cache-gateway.d.ts +0 -12
  303. package/dist/runner/recipe.js +0 -425
  304. package/dist/runner/snapshot-cache.d.ts +0 -148
  305. package/dist/runner/snapshot-cache.js +0 -126
@@ -3,84 +3,74 @@ import {
3
3
  resolveProjectTests,
4
4
  resolveSuite,
5
5
  targetRedactor
6
- } from "../../chunks/chunk-QVS7HRU7.js";
6
+ } from "../../chunks/chunk-6UHIJXZG.js";
7
7
  import {
8
8
  suiteNamesText,
9
9
  suiteNotFoundErrors
10
- } from "../../chunks/chunk-4U4DZ7VG.js";
10
+ } from "../../chunks/chunk-7DZE67QM.js";
11
11
  import {
12
12
  DRIVER_FILE_LISTS_HELP,
13
13
  DRIVER_SANDBOXES_HELP,
14
- SANDBOXES_DEFAULT_KEY,
15
- planAskedSandboxesRun,
16
- planDefaultSandboxesRun,
14
+ RUN_CLI_OPTIONS,
15
+ RUN_REQUEST_FIELDS,
16
+ driverSandboxesProblem,
17
+ executePlannedRun,
18
+ planRun,
19
+ runFlagProblems,
17
20
  runHelp,
18
- runPlanned
19
- } from "../../chunks/chunk-E4PJNZVG.js";
21
+ sandboxesFlagProblems
22
+ } from "../../chunks/chunk-JN3YY6ZH.js";
23
+ import "../../chunks/chunk-RWIXDDCK.js";
24
+ import "../../chunks/chunk-MR77L2GK.js";
25
+ import "../../chunks/chunk-I5GZLOLQ.js";
20
26
  import {
21
27
  PLANNED_DESCRIPTION,
22
28
  RAN_DESCRIPTION,
23
- RUN_CLI_OPTIONS,
24
29
  RUN_ERRORS,
25
- RUN_REQUEST_FIELDS,
26
30
  SANDBOXES_RAN_DESCRIPTION,
27
- canceledBeforeStart,
28
- checkoutFailedRefusal,
29
31
  fileListErrors,
30
- planCommandRun,
31
32
  plannedSchema,
32
33
  ranSchema,
33
- readFileListsFile,
34
34
  renderPlanned,
35
35
  renderRan,
36
36
  renderSandboxesRan,
37
- resolveCallerFileLists,
38
- runFlagProblems,
39
37
  sandboxesDefaultErrors,
40
38
  sandboxesErrors,
41
- sandboxesFlagProblems,
42
39
  sandboxesRanSchema
43
- } from "../../chunks/chunk-RAQEXKL6.js";
44
- import "../../chunks/chunk-I5GZLOLQ.js";
45
- import {
46
- dealFileLists,
47
- recordedPlan
48
- } from "../../chunks/chunk-5GBMR4HM.js";
40
+ } from "../../chunks/chunk-2VP4GRJM.js";
41
+ import "../../chunks/chunk-FNBB6V4R.js";
42
+ import "../../chunks/chunk-M7EKRGVD.js";
43
+ import "../../chunks/chunk-F4MOYHRY.js";
49
44
  import {
50
45
  DRIVER_NAMES,
51
46
  driverNamed
52
- } from "../../chunks/chunk-PN5ULTTH.js";
53
- import "../../chunks/chunk-R7XVBZOY.js";
54
- import "../../chunks/chunk-CN4EFA5J.js";
55
- import "../../chunks/chunk-CXAT7ZKP.js";
56
- import "../../chunks/chunk-XEVHP5ZW.js";
57
- import "../../chunks/chunk-VUPZH7J2.js";
58
- import "../../chunks/chunk-ZG3WQ4UF.js";
59
- import "../../chunks/chunk-5CCP36QQ.js";
60
- import "../../chunks/chunk-QUHY6FGN.js";
47
+ } from "../../chunks/chunk-HWIQ2S7K.js";
48
+ import "../../chunks/chunk-EEENLQHE.js";
49
+ import "../../chunks/chunk-72ZFEMAW.js";
50
+ import "../../chunks/chunk-BCBKYOHW.js";
51
+ import "../../chunks/chunk-D27KILIA.js";
52
+ import "../../chunks/chunk-2RNDPDTJ.js";
53
+ import "../../chunks/chunk-CKGZA25H.js";
54
+ import "../../chunks/chunk-GRT3UIBV.js";
61
55
  import {
62
56
  planSchema
63
- } from "../../chunks/chunk-SZEURWRS.js";
64
- import "../../chunks/chunk-OX7X4B2L.js";
57
+ } from "../../chunks/chunk-4O5C2XGJ.js";
65
58
  import "../../chunks/chunk-F6N34UWB.js";
66
- import "../../chunks/chunk-YV7GE6EV.js";
59
+ import "../../chunks/chunk-YEPFSLQR.js";
67
60
  import {
68
61
  CONFIG_FILE_NAME,
69
- invalidConfig,
70
- resolveSandboxCountDefault
71
- } from "../../chunks/chunk-L36GBUBB.js";
62
+ CONFIG_FILE_NAMES_TEXT
63
+ } from "../../chunks/chunk-RNAS7JHE.js";
72
64
  import {
73
- DRIVER_PLAN_FAILURE_KINDS,
74
- NOT_COUNTED
75
- } from "../../chunks/chunk-AWBSONHB.js";
65
+ DRIVER_PLAN_FAILURE_KINDS
66
+ } from "../../chunks/chunk-XBDRVFEV.js";
76
67
  import {
77
68
  stormCommands
78
- } from "../../chunks/chunk-5VXBKPW6.js";
69
+ } from "../../chunks/chunk-WV3DP6NR.js";
79
70
  import {
80
71
  defineErrors,
81
- defineOutcomes,
82
- refused
83
- } from "../../chunks/chunk-VL7WFTVQ.js";
72
+ defineOutcomes
73
+ } from "../../chunks/chunk-4WAMTUWZ.js";
84
74
 
85
75
  // src/commands/test/command.ts
86
76
  import { z as z3 } from "zod";
@@ -187,7 +177,7 @@ var testErrors = defineErrors({
187
177
  configFile: z2.string().nullable()
188
178
  }),
189
179
  render: ({ suites, configFile }) => ({
190
- message: configFile === null ? `No ${CONFIG_FILE_NAME} applies here, so storm test has no driver to run. The command didn't run.` : `${configFile} names no top-level driver for storm test. The command didn't run.`,
180
+ message: configFile === null ? `No ${CONFIG_FILE_NAMES_TEXT} applies here, so storm test has no driver to run. The command didn't run.` : `${configFile} names no top-level driver for storm test. The command didn't run.`,
191
181
  ...suites.length === 0 ? {} : { rows: [["Suites", suiteNamesText(suites)]] },
192
182
  next: [
193
183
  {
@@ -257,200 +247,6 @@ var outcomes = defineOutcomes({
257
247
  }
258
248
  });
259
249
 
260
- // src/planning/driver-file-lists.ts
261
- function driverSandboxesRun(run) {
262
- const asked = run.asked.from === "flag" ? run.asked.count : Math.min(run.asked.default, run.max);
263
- const lists = dealFileLists(run.testFiles, asked);
264
- return {
265
- count: {
266
- count: lists.length,
267
- from: run.asked.from,
268
- max: run.max,
269
- ...run.asked.from === "default" ? { default: run.asked.default } : {},
270
- ...lists.length < asked ? { requested: asked } : {}
271
- },
272
- sandboxes: lists.map((files) => ({ argv: run.argv, files }))
273
- };
274
- }
275
- function driverCallerFileListsRun(run) {
276
- const resolved = resolveCallerFileLists(run.testFiles, run.lists);
277
- if (!resolved.ok) return resolved;
278
- return {
279
- ok: true,
280
- sandboxes: {
281
- count: {
282
- count: resolved.lists.length,
283
- from: "file-lists",
284
- max: run.max,
285
- ...resolved.leftOut > 0 ? { leftOut: resolved.leftOut } : {}
286
- },
287
- sandboxes: resolved.lists.map((files) => ({ argv: run.argv, files }))
288
- }
289
- };
290
- }
291
-
292
- // src/commands/exec/run-bin.ts
293
- import { join } from "node:path";
294
- async function findRunBin(app, name, where) {
295
- if (where.kind === "unsandboxed") {
296
- const cwd2 = app.cwd;
297
- const found2 = await app.packageBins.find(name, cwd2);
298
- return found2.ok ? { kind: "found", cwd: cwd2, counts: found2.path, runs: found2.path } : { kind: "not-found", cwd: cwd2, searched: found2.searched };
299
- }
300
- const root = await app.context.checkout.repositoryRoot({ cwd: app.cwd });
301
- if (!root.ok) return { kind: "checkout-failed", failure: root.failure };
302
- const cwd = join(root.value, where.recipe.cwd);
303
- const found = await app.context.packageBins.find({ name, from: cwd, root: root.value });
304
- return found.ok ? { kind: "found", cwd, counts: found.path, runs: name } : { kind: "not-found", cwd, searched: found.searched };
305
- }
306
-
307
- // src/commands/exec/driver-plan.ts
308
- function driverCount(driver, testPlan, countTests) {
309
- if (!testPlan && !countTests) return void 0;
310
- return { countTests: driver.countsFilesOnly !== true || countTests };
311
- }
312
- async function planDriverCommand(app, driver, errors, args, count, where, signal) {
313
- const { bin: name } = driver.program;
314
- if (count === void 0 && where.kind === "runner")
315
- return { ok: true, argv: driver.launch(name, args), testPlan: NOT_COUNTED.testPlan };
316
- const bin = await findRunBin(app, name, where);
317
- if (bin.kind === "checkout-failed") return refused(checkoutFailedRefusal(bin.failure));
318
- const planned = { args, cwd: bin.cwd };
319
- if (bin.kind === "not-found")
320
- return refused(
321
- errors.planFailed(
322
- driver.name,
323
- { kind: "start-failed", message: `found no ${name} in node_modules/.bin of ${bin.searched.join(", ")}` },
324
- planned
325
- )
326
- );
327
- if (count === void 0) return { ok: true, argv: driver.launch(bin.runs, args), testPlan: NOT_COUNTED.testPlan };
328
- const contexts = app.driverContexts;
329
- const answer = await driver.plan(contexts[driver.name])({
330
- ...planned,
331
- bin: bin.counts,
332
- countTests: count.countTests,
333
- signal
334
- });
335
- if (!answer.ok) {
336
- const { kind, message } = answer;
337
- if (kind === "canceled") return refused(canceledBeforeStart());
338
- return refused(errors.planFailed(driver.name, { kind, message }, planned));
339
- }
340
- const { tests, files } = answer.plan;
341
- if ((tests ?? files) === 0) return refused(errors.noMatchingTests(driver.name, planned));
342
- return {
343
- ok: true,
344
- argv: driver.launch(bin.runs, args),
345
- testPlan: { kind: "counted", ...tests === void 0 ? {} : { tests }, files },
346
- ...answer.testFiles === void 0 ? {} : { testFiles: answer.testFiles }
347
- };
348
- }
349
-
350
- // src/commands/test/plan.ts
351
- function driverSandboxesProblem(driver, args, asks) {
352
- const flag = asks.fileLists !== void 0 ? "--file-lists" : asks.sandboxes !== void 0 ? "--sandboxes" : void 0;
353
- if (flag === void 0) return void 0;
354
- if (driver.fileLists === void 0)
355
- return {
356
- kind: "unsupported",
357
- flag,
358
- problem: `The ${driver.name} driver has no file list support, so storm test can't run it across runner sandboxes.`
359
- };
360
- const checked = driver.fileLists.validate(args);
361
- return checked.ok ? void 0 : { kind: "args", flag, problem: checked.problem };
362
- }
363
- function testSandboxesProblems(request) {
364
- const { sandboxes } = request;
365
- return sandboxes === void 0 || Number.isInteger(sandboxes) && sandboxes >= 1 ? [] : [{ field: "sandboxes", message: `--sandboxes takes a whole number from 1, not ${sandboxes}.` }];
366
- }
367
- async function planTestRun({ app, signal }, driver, errors, args, request, asks) {
368
- const { countTests, sandboxes, fileLists: listsPath } = asks;
369
- const planDriverSandboxes = (make) => async (plan, planSignal) => {
370
- const planned = await planDriverCommand(
371
- app,
372
- driver,
373
- errors,
374
- args,
375
- { countTests: driver.countsFilesOnly !== true || countTests },
376
- plan.where,
377
- planSignal
378
- );
379
- if (!planned.ok) return planned;
380
- const { argv, testPlan, testFiles } = planned;
381
- if (testFiles === void 0)
382
- throw new Error(
383
- `planTestRun: driver ${driver.name} has file list support, and its plan step answered no test files`
384
- );
385
- const made = make({ argv, testFiles, testPlan }, plan);
386
- if (!made.ok) return made;
387
- return { ok: true, argv, testPlan, testFiles, sandboxes: made.sandboxes };
388
- };
389
- let lists;
390
- if (listsPath !== void 0) {
391
- const read = await readFileListsFile(app.context.fileListsFiles, { path: listsPath, cwd: app.cwd, sandboxes });
392
- if (!read.ok)
393
- return refused(
394
- read.kind === "unreadable" ? fileListErrors.fileListsUnreadable({ path: read.path, problem: read.problem, message: read.message }) : fileListErrors.invalidFileLists({
395
- path: read.path,
396
- problems: read.problems.map(
397
- (problem) => problem.kind === "in-two-lists" ? { ...problem, sandboxes: [...problem.sandboxes] } : { ...problem }
398
- )
399
- })
400
- );
401
- lists = read.lists;
402
- }
403
- const asked = lists !== void 0 ? { count: lists.lists.length, flag: "--file-lists" } : sandboxes === void 0 ? void 0 : { count: sandboxes, flag: "--sandboxes" };
404
- if (asked !== void 0) {
405
- const planSandboxes = planDriverSandboxes(
406
- ({ argv, testFiles }, { max }) => {
407
- if (lists === void 0)
408
- return {
409
- ok: true,
410
- sandboxes: driverSandboxesRun({ argv, testFiles, asked: { from: "flag", count: asked.count }, max })
411
- };
412
- const resolved = driverCallerFileListsRun({ argv, testFiles, lists, max });
413
- return resolved.ok ? resolved : refused(
414
- fileListErrors.fileListsUnlisted({
415
- path: lists.path,
416
- files: [...resolved.unlisted],
417
- listed: resolved.listed
418
- })
419
- );
420
- }
421
- );
422
- return await planAskedSandboxesRun(app, request, asked, planSandboxes, signal);
423
- }
424
- const planCommand = async (where, planSignal, { testPlan }) => await planDriverCommand(app, driver, errors, args, driverCount(driver, testPlan, countTests), where, planSignal);
425
- if (driver.fileLists === void 0) return await planCommandRun(app, request, planCommand, signal);
426
- const planDefaultSandboxes = planDriverSandboxes(({ argv, testFiles, testPlan }, { where, max, settings }) => {
427
- const sandboxesDefault = where.recipe.sandboxes?.default;
428
- if (sandboxesDefault === void 0)
429
- throw new Error("planTestRun: a run across runner sandboxes from the default needs runner.sandboxes.default");
430
- const resolved = resolveSandboxCountDefault(sandboxesDefault, testPlan);
431
- if (!resolved.ok)
432
- return refused(
433
- invalidConfig(where.configFile, [{ key: SANDBOXES_DEFAULT_KEY, location: null, problem: resolved.problem }])
434
- );
435
- const checked = driver.fileLists?.validate(args);
436
- if (checked !== void 0 && !checked.ok)
437
- return refused(
438
- sandboxesDefaultErrors.sandboxesDefaultRefused({
439
- key: SANDBOXES_DEFAULT_KEY,
440
- sandboxes: Math.min(resolved.sandboxes, max, testFiles.length),
441
- field: "args",
442
- problem: checked.problem,
443
- configFile: settings.configFile
444
- })
445
- );
446
- return {
447
- ok: true,
448
- sandboxes: driverSandboxesRun({ argv, testFiles, asked: { from: "default", default: resolved.sandboxes }, max })
449
- };
450
- });
451
- return await planDefaultSandboxesRun(app, request, planCommand, planDefaultSandboxes, signal);
452
- }
453
-
454
250
  // src/commands/test/test-words.ts
455
251
  var TEST_HELP = {
456
252
  usage: "[--suite <NAME>] [--count-tests] [--sandboxes <N> | --file-lists <PATH>] [<args>...] [-- <dash options>...]",
@@ -493,6 +289,10 @@ var COUNT_TESTS_FLAG_HELP = {
493
289
 
494
290
  // src/commands/test/command.ts
495
291
  var help = runHelp(TEST_HELP, "args");
292
+ function testSandboxesProblems(request) {
293
+ const { sandboxes } = request;
294
+ return sandboxes === void 0 || Number.isInteger(sandboxes) && sandboxes >= 1 ? [] : [{ field: "sandboxes", message: `--sandboxes takes a whole number from 1, not ${sandboxes}.` }];
295
+ }
496
296
  var command_default = stormCommands.define({
497
297
  requestSchema: z3.object({
498
298
  ...RUN_REQUEST_FIELDS,
@@ -543,18 +343,16 @@ var command_default = stormCommands.define({
543
343
  configFile: file.path
544
344
  });
545
345
  await ui.progress?.(preRunLine(target, request.args.length, targetRedactor(target, app.env)));
546
- const plan = await planTestRun(
547
- context,
548
- driver,
549
- testDriverRefusals,
550
- args,
346
+ const plan = await planRun(
347
+ app,
551
348
  { ...request, settingsFile: target.settingsFile, suite: target.name },
552
- { countTests: request.countTests, sandboxes, fileLists }
349
+ { kind: "driver", driver, args, countTests: request.countTests, errors: testDriverRefusals },
350
+ context.signal
553
351
  );
554
352
  if (!plan.ok) return plan.refusal;
555
353
  const test = { driver: driver.name, suite: target.name };
556
354
  const extraMismatchHint = driver.fileLists?.extraMismatchHint;
557
- return await runPlanned(
355
+ return await executePlannedRun(
558
356
  context,
559
357
  request,
560
358
  {
@@ -562,15 +360,12 @@ var command_default = stormCommands.define({
562
360
  test,
563
361
  hints: driver.hints,
564
362
  ...extraMismatchHint === void 0 ? {} : { extraMismatchHint },
565
- ran: (facts, { testPlan, options }, noFinalTestResults) => {
566
- const recorded = recordedPlan(testPlan, options);
567
- return outcomes.ran({
568
- ...facts,
569
- ...recorded === void 0 ? {} : { plan: recorded },
570
- noFinalTestResults,
571
- ...test
572
- });
573
- },
363
+ ran: (facts, plan2, noFinalTestResults) => outcomes.ran({
364
+ ...facts,
365
+ ...plan2 === void 0 ? {} : { plan: plan2 },
366
+ noFinalTestResults,
367
+ ...test
368
+ }),
574
369
  sandboxesRan: (facts, noFinalTestResults) => outcomes.sandboxesRan({ ...facts, noFinalTestResults, ...test }),
575
370
  planned: (facts) => outcomes.planned(facts)
576
371
  },
@@ -1,7 +1,7 @@
1
1
  // src/commands/test/metadata.ts
2
2
  var metadata = {
3
3
  summary: "Run the project's tests, or a suite of them.",
4
- description: "Run the project's tests declared at the top level of storm.config.ts, or a named suite with --suite <name>. Pass extra arguments for the test runner directly, with dash options after --; command-line arguments go before the config file's args. Where the tests run is declared by runner in storm.config.ts (launchMachine() or vercelSandbox({ \u2026 })); a suite inherits the top-level runner unless it sets its own. With testPlan: true in storm.config.ts or --count-tests, storm counts the tests before the run starts; --count-tests counts each test when a driver otherwise counts only test files. With --sandboxes <n>, --file-lists <path>, or sandboxes.default in vercelSandbox({ \u2026 }), and a driver with file list support, it is a run across runner sandboxes: storm lists the test files on this machine, deals them into file lists (or takes yours), and runs each list in its own runner sandbox, all started from one runner snapshot. With --plan-only, it prints the planned run and starts nothing."
4
+ description: `Run the project's tests declared at the top level of storm.config.ts, or a named suite with --suite <name>. Pass extra arguments for the test runner directly, with dash options after --; command-line arguments go before the config file's args. Where the tests run is declared by runner in storm.config.ts (launchMachine() or vercelSandbox({ \u2026 })); a suite inherits the top-level runner unless it sets its own. With testPlan: true in storm.config.ts or --count-tests, storm counts the tests before the run starts; --count-tests counts each test when a driver otherwise counts only test files. With --sandboxes <n>, --file-lists <path>, or sandboxes.default in vercelSandbox({ \u2026 }), and a driver with file list support, it is a run across runner sandboxes: storm lists the test files on this machine, deals them into file lists (or takes yours), and runs each list in its own runner sandbox, all started from one runner snapshot. With --plan-only, it prints the planned run and starts nothing. storm finds storm.config.ts in the working directory or a parent up to the git worktree's root; storm.config.mts works the same, always loads as an ES module, and suits a package.json without "type": "module", and one directory may hold only one of the two.`
5
5
  };
6
6
  export {
7
7
  metadata
@@ -267,7 +267,7 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
267
267
  sandbox: z.ZodNumber;
268
268
  name: z.ZodString;
269
269
  stopsAt: z.ZodString;
270
- url: z.ZodString;
270
+ url: z.ZodNullable<z.ZodString>;
271
271
  }, z.core.$strip>>;
272
272
  notKept: z.ZodArray<z.ZodObject<{
273
273
  sandbox: z.ZodNumber;
@@ -316,7 +316,10 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
316
316
  testFiles: z.ZodNullable<z.ZodArray<z.ZodString>>;
317
317
  runnerSandboxes: z.ZodNullable<z.ZodObject<{
318
318
  max: z.ZodNumber;
319
- default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"function">]>>;
319
+ default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
320
+ filesPerSandbox: z.ZodNumber;
321
+ max: z.ZodOptional<z.ZodNumber>;
322
+ }, z.core.$strip>]>>;
320
323
  }, z.core.$strip>>;
321
324
  sandboxes: z.ZodNullable<z.ZodArray<z.ZodObject<{
322
325
  sandbox: z.ZodNumber;
@@ -550,6 +553,13 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
550
553
  minLength: number;
551
554
  configFile: string | null;
552
555
  }]>;
556
+ vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
557
+ cause: "invalid-token" | "missing-token";
558
+ detail: string;
559
+ fix: string;
560
+ runner: boolean;
561
+ cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
562
+ }]>;
553
563
  }, {
554
564
  readonly conflictingOptions: import("@vercel/clinkr").SharedError<"conflicting_options", [data: {
555
565
  conflicts: {
@@ -762,4 +772,11 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
762
772
  minLength: number;
763
773
  configFile: string | null;
764
774
  }]>;
775
+ readonly vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
776
+ cause: "invalid-token" | "missing-token";
777
+ detail: string;
778
+ fix: string;
779
+ runner: boolean;
780
+ cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
781
+ }]>;
765
782
  }>;
@@ -3,7 +3,7 @@
3
3
  // `missing_driver`, and `driver_sandboxes_refused`), and the driver's two planning refusals.
4
4
  import { defineErrors, defineOutcomes } from "@vercel/clinkr";
5
5
  import { z } from "zod";
6
- import { CONFIG_FILE_NAME } from "../../config/index.js";
6
+ import { CONFIG_FILE_NAME, CONFIG_FILE_NAMES_TEXT } from "../../config/index.js";
7
7
  import { DRIVER_NAMES, driverNamed } from "../../extensions.js";
8
8
  import { driverRefusals } from "../../planning/driver-refusals.js";
9
9
  import { suiteNamesText, suiteNotFoundErrors } from "../../planning/suite-not-found.js";
@@ -63,7 +63,7 @@ const testErrors = defineErrors({
63
63
  }),
64
64
  render: ({ suites, configFile }) => ({
65
65
  message: configFile === null
66
- ? `No ${CONFIG_FILE_NAME} applies here, so storm test has no driver to run. The command didn't run.`
66
+ ? `No ${CONFIG_FILE_NAMES_TEXT} applies here, so storm test has no driver to run. The command didn't run.`
67
67
  : `${configFile} names no top-level driver for storm test. The command didn't run.`,
68
68
  ...(suites.length === 0 ? {} : { rows: [["Suites", suiteNamesText(suites)]] }),
69
69
  next: [
@@ -1,11 +1,13 @@
1
+ import { type ResourceDefinition } from "../sdk/extension/index.ts";
1
2
  import type { CheckedRunner } from "./runner.ts";
2
3
  import type { Checked } from "./schema.ts";
3
4
  /**
4
5
  * Checks a `runner` value from `storm.config.ts`. When `inherited` is given (the top level's raw `vercelSandbox`
5
- * options object), a suite's `vercelSandbox` options merge shallowly over `inherited` before `checkRecipe` runs, so
6
- * the suite may override only the top-level keys that differ.
6
+ * options object), a suite's `vercelSandbox` options merge shallowly over `inherited` before
7
+ * `checkVercelSandboxOptions` runs, so the suite may override only the top-level keys that differ. A declared `vcpus`
8
+ * rule is also checked against `definitions` so unknown resources or options fail at config load.
7
9
  */
8
- export declare function checkRunner(value: unknown, inherited?: Readonly<Record<string, unknown>>): Checked<CheckedRunner>;
10
+ export declare function checkRunner(value: unknown, inherited?: Readonly<Record<string, unknown>>, definitions?: readonly ResourceDefinition[]): Checked<CheckedRunner>;
9
11
  /**
10
12
  * The raw options object of a top-level `vercelSandbox(...)` value, for a suite's `vercelSandbox(...)` to merge over;
11
13
  * undefined when the top level declares no `vercel-sandbox` runner or its options are not a plain object.
@@ -1,14 +1,16 @@
1
1
  // Checks a `runner` value from `storm.config.ts` (top-level or suite) and extracts top-level `vercelSandbox` options
2
- // so a suite of the same kind can merge its partial options over them before `checkRecipe` fills defaults.
3
- import { checkRecipe } from "../runner/index.js";
2
+ // so a suite of the same kind can merge its partial options over them before `checkVercelSandboxOptions` fills
3
+ // defaults.
4
+ import { checkVercelSandboxOptions } from "../runner/index.js";
4
5
  import { describeValue } from "../sdk/extension/index.js";
5
6
  const FACTORY_HINT = "must be made by vercelSandbox({ … }) or launchMachine()";
6
7
  /**
7
8
  * Checks a `runner` value from `storm.config.ts`. When `inherited` is given (the top level's raw `vercelSandbox`
8
- * options object), a suite's `vercelSandbox` options merge shallowly over `inherited` before `checkRecipe` runs, so
9
- * the suite may override only the top-level keys that differ.
9
+ * options object), a suite's `vercelSandbox` options merge shallowly over `inherited` before
10
+ * `checkVercelSandboxOptions` runs, so the suite may override only the top-level keys that differ. A declared `vcpus`
11
+ * rule is also checked against `definitions` so unknown resources or options fail at config load.
10
12
  */
11
- export function checkRunner(value, inherited) {
13
+ export function checkRunner(value, inherited, definitions = []) {
12
14
  if (!isRecord(value)) {
13
15
  return { ok: false, problems: [{ path: [], problem: `${FACTORY_HINT}, not ${describeValue(value)}` }] };
14
16
  }
@@ -32,13 +34,37 @@ export function checkRunner(value, inherited) {
32
34
  ...inherited,
33
35
  ...Object.fromEntries(Object.entries(options).filter(([, entry]) => entry !== undefined)),
34
36
  };
35
- const checked = checkRecipe(rawOptions);
37
+ const checked = checkVercelSandboxOptions(rawOptions);
36
38
  if (!checked.ok)
37
39
  return checked;
38
- return { ok: true, value: { kind: "vercel-sandbox", recipe: checked.value } };
40
+ const vcpusProblems = checkVcpusRuleDefinitions(checked.value.vcpus, definitions);
41
+ if (vcpusProblems.length > 0)
42
+ return { ok: false, problems: vcpusProblems };
43
+ return { ok: true, value: { kind: "vercel-sandbox", options: checked.value } };
39
44
  }
40
45
  return { ok: false, problems: [{ path: [], problem: `${FACTORY_HINT}, not ${describeValue(value)}` }] };
41
46
  }
47
+ /** Checks that a declared `vcpus` rule names a known resource definition and one of its options. */
48
+ function checkVcpusRuleDefinitions(vcpus, definitions) {
49
+ if (typeof vcpus === "number")
50
+ return [];
51
+ const definition = definitions.find((each) => each.name === vcpus.resource);
52
+ if (definition === undefined) {
53
+ const known = definitions.length === 0 ? "none" : definitions.map((each) => each.name).join(", ");
54
+ return [{ path: ["vcpus", "resource"], problem: `is not a resource; storm has ${known}` }];
55
+ }
56
+ if (!Object.hasOwn(definition.options, vcpus.option)) {
57
+ const optionNames = Object.keys(definition.options);
58
+ const available = optionNames.length === 0 ? "none" : optionNames.join(", ");
59
+ return [
60
+ {
61
+ path: ["vcpus", "option"],
62
+ problem: `is not a ${definition.name} option; ${definition.name} has ${available}`,
63
+ },
64
+ ];
65
+ }
66
+ return [];
67
+ }
42
68
  /**
43
69
  * The raw options object of a top-level `vercelSandbox(...)` value, for a suite's `vercelSandbox(...)` to merge over;
44
70
  * undefined when the top level declares no `vercel-sandbox` runner or its options are not a plain object.
@@ -20,6 +20,7 @@ export function checkSuites(value, options, problems) {
20
20
  return {};
21
21
  }
22
22
  const settingContext = {
23
+ definitions: options.definitions,
23
24
  drivers: options.drivers,
24
25
  topLevelRunnerOptions: options.topLevelRunnerOptions,
25
26
  };
@@ -1,6 +1,6 @@
1
1
  import { type Refusable } from "@vercel/clinkr";
2
2
  import { z } from "zod";
3
- import { type Credential, type CredentialContext, type CredentialFailure, type CredentialOrigin, type CredentialSourceChoice } from "../credential/index.ts";
3
+ import { type Credential, type CredentialContext, type CredentialFailure, type CredentialOrigin, type CredentialSourceChoice, type VercelProjectOutcome } from "../credential/index.ts";
4
4
  import { type credentialErrors } from "./credential-settle.ts";
5
5
  /**
6
6
  * The errors a credential source's `obtain()` refuses with. A command that obtains a credential spreads them into its
@@ -27,6 +27,14 @@ export declare const credentialSourceErrors: import("@vercel/clinkr").SharedErro
27
27
  detail: z.ZodString;
28
28
  fix: z.ZodString;
29
29
  }, z.core.$strip>;
30
+ vercelOidcTokenFailed: z.ZodObject<{
31
+ cause: z.ZodEnum<{
32
+ "invalid-token": "invalid-token";
33
+ "missing-token": "missing-token";
34
+ }>;
35
+ detail: z.ZodString;
36
+ fix: z.ZodString;
37
+ }, z.core.$strip>;
30
38
  }, {
31
39
  readonly mintFailed: {
32
40
  readonly exitCode: 1;
@@ -82,16 +90,39 @@ export declare const credentialSourceErrors: import("@vercel/clinkr").SharedErro
82
90
  }[];
83
91
  };
84
92
  };
93
+ readonly vercelOidcTokenFailed: {
94
+ readonly exitCode: 1;
95
+ readonly description: "With --credential vercel-oidc, VERCEL_OIDC_TOKEN is missing, empty, or not a valid Vercel project OIDC token.";
96
+ readonly schema: z.ZodObject<{
97
+ cause: z.ZodEnum<{
98
+ "invalid-token": "invalid-token";
99
+ "missing-token": "missing-token";
100
+ }>;
101
+ detail: z.ZodString;
102
+ fix: z.ZodString;
103
+ }, z.core.$strip>;
104
+ readonly render: ({ detail, fix }: {
105
+ cause: "invalid-token" | "missing-token";
106
+ detail: string;
107
+ fix: string;
108
+ }) => {
109
+ message: string;
110
+ next: {
111
+ type: "text";
112
+ text: string;
113
+ }[];
114
+ };
115
+ };
85
116
  }>;
86
117
  /** The error a credential source's `obtain()` refuses with. */
87
- export type CredentialSourceError = ReturnType<typeof credentialSourceErrors.mintFailed> | ReturnType<typeof credentialSourceErrors.tokenRequestFailed>;
118
+ export type CredentialSourceError = ReturnType<typeof credentialSourceErrors.mintFailed> | ReturnType<typeof credentialSourceErrors.tokenRequestFailed> | ReturnType<typeof credentialSourceErrors.vercelOidcTokenFailed>;
88
119
  /** A credential source's failure as the error `obtain()` refuses with. */
89
120
  export declare function credentialSourceError(failure: CredentialFailure): CredentialSourceError;
90
121
  /** A credential source as a command gets it from the credential launcher resolver. */
91
122
  export interface CommandCredentialSource {
92
123
  /**
93
124
  * A credential to use now, getting one first if the source holds none it would hand out, or the error to end the
94
- * command with: `mint_failed` or `token_request_failed`.
125
+ * command with: `mint_failed`, `token_request_failed`, or `vercel_oidc_token_failed`.
95
126
  */
96
127
  obtain(): Promise<Refusable<{
97
128
  readonly credential: Credential;
@@ -115,6 +146,13 @@ export interface CredentialTarget {
115
146
  export interface CredentialReport {
116
147
  readonly progress?: ((line: string) => Promise<void>) | undefined;
117
148
  }
149
+ /**
150
+ * A credential source for a Vercel Sandbox, as a command gets it from the credential launcher resolver: what it
151
+ * obtains carries the team and project the credential names, or why it has none (`VercelProjectOutcome`).
152
+ */
153
+ export interface CommandVercelProjectSource {
154
+ readonly obtain: () => Promise<VercelProjectOutcome>;
155
+ }
118
156
  /**
119
157
  * The credential launcher resolver. A command that uses it spreads `credentialErrors` and `credentialSourceErrors` into
120
158
  * its outcomes.
@@ -122,12 +160,19 @@ export interface CredentialReport {
122
160
  export interface CredentialResolver {
123
161
  /**
124
162
  * The credential source `choice` names. The mint needs the target's team and project, and refuses with
125
- * `missing_target` without either; a GitHub Actions OIDC token request needs neither. It gets nothing until
126
- * `obtain()`.
163
+ * `missing_target` without either; `github-actions` and `vercel-oidc` need neither. It gets nothing until `obtain()`.
127
164
  */
128
165
  source(choice: CredentialSourceChoice["source"], target: CredentialTarget, report?: CredentialReport): Refusable<{
129
166
  readonly source: CommandCredentialSource;
130
167
  }, ReturnType<typeof credentialErrors.missingTarget>>;
168
+ /**
169
+ * The credential source `choice` names for a Vercel Sandbox (`mint` or `vercel-oidc`), whose credential comes with
170
+ * the team and project it names (`vercelProjectSource`). It refuses as `source` does, and gets nothing until
171
+ * `obtain()`.
172
+ */
173
+ vercelProjectSource(choice: "mint" | "vercel-oidc", target: CredentialTarget, report?: CredentialReport): Refusable<{
174
+ readonly source: CommandVercelProjectSource;
175
+ }, ReturnType<typeof credentialErrors.missingTarget>>;
131
176
  }
132
177
  /** The credential launcher resolver over `gateways`. */
133
178
  export declare function credentialResolver(gateways: CredentialContext): CredentialResolver;