@cnc-tools/storm 0.16.0 → 0.18.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 (290) hide show
  1. package/dist/bin/storm.js +54 -40
  2. package/dist/build-info.js +1 -1
  3. package/dist/chunks/{chunk-VL7WFTVQ.js → chunk-24UYAK4R.js} +465 -365
  4. package/dist/chunks/{chunk-DC2CDHNK.js → chunk-2JMWUKH3.js} +2074 -473
  5. package/dist/chunks/{chunk-FOZWA52V.js → chunk-3VXZONGE.js} +481 -376
  6. package/dist/chunks/{chunk-ZG3WQ4UF.js → chunk-55O4FCN4.js} +1 -1
  7. package/dist/chunks/{chunk-CN4EFA5J.js → chunk-72ZFEMAW.js} +1 -1
  8. package/dist/chunks/chunk-AS37D43E.js +2173 -0
  9. package/dist/chunks/chunk-CQAY6GLP.js +1260 -0
  10. package/dist/chunks/chunk-DZLU7BYK.js +340 -0
  11. package/dist/chunks/{chunk-R7XVBZOY.js → chunk-EEENLQHE.js} +59 -11
  12. package/dist/chunks/{chunk-TJNFVNKR.js → chunk-EI3XDCEI.js} +1 -1
  13. package/dist/chunks/{chunk-HVNK3I45.js → chunk-FDUY3BNF.js} +1 -1
  14. package/dist/chunks/{chunk-FCQUJDA4.js → chunk-GUCCYCIO.js} +4 -189
  15. package/dist/chunks/{chunk-OIY3DMF2.js → chunk-HBI4LEMH.js} +3 -3
  16. package/dist/chunks/{chunk-2MAD5NKK.js → chunk-K4MDQPLW.js} +1 -18
  17. package/dist/chunks/chunk-KK7PAWIZ.js +198 -0
  18. package/dist/chunks/{chunk-G3PHMXH5.js → chunk-KQ5FXRUD.js} +18 -1
  19. package/dist/chunks/{chunk-5VXBKPW6.js → chunk-LKXHGGGX.js} +1 -1
  20. package/dist/chunks/{chunk-P357TZAY.js → chunk-LOGHIUUB.js} +21 -18
  21. package/dist/chunks/{chunk-CK2GZEPK.js → chunk-OEPFINFT.js} +2 -2
  22. package/dist/chunks/{chunk-DWEAHX4T.js → chunk-OI4AP6Z7.js} +5 -5
  23. package/dist/chunks/{chunk-V4IKA3WI.js → chunk-PMBQWVTW.js} +26 -19
  24. package/dist/chunks/chunk-SZMYIIG2.js +88 -0
  25. package/dist/chunks/{chunk-5CCP36QQ.js → chunk-TXCOFC7N.js} +1 -1
  26. package/dist/chunks/{chunk-VUPZH7J2.js → chunk-UXD3TVWM.js} +1 -1
  27. package/dist/chunks/{chunk-3L52KNQA.js → chunk-WNW2QXQK.js} +8 -8
  28. package/dist/chunks/{chunk-AWBSONHB.js → chunk-XBDRVFEV.js} +55 -16
  29. package/dist/chunks/{live-app-WECQOQ4C.js → live-app-UY7BEDUN.js} +17 -13
  30. package/dist/cli.d.ts +28 -0
  31. package/dist/cli.js +64 -0
  32. package/dist/commands/exec/across-sandboxes-outcomes.d.ts +2 -2
  33. package/dist/commands/exec/across-sandboxes-outcomes.js +3 -3
  34. package/dist/commands/exec/before-run.d.ts +123 -0
  35. package/dist/commands/exec/before-run.js +105 -0
  36. package/dist/commands/exec/command.d.ts +67 -14
  37. package/dist/commands/exec/command.js +31 -95
  38. package/dist/commands/exec/driver-plan.d.ts +9 -4
  39. package/dist/commands/exec/driver-plan.js +8 -8
  40. package/dist/commands/exec/exec-words.js +1 -1
  41. package/dist/commands/exec/execute-run.d.ts +39 -0
  42. package/dist/commands/exec/execute-run.js +325 -0
  43. package/dist/commands/exec/live-view.d.ts +3 -3
  44. package/dist/commands/exec/live-view.js +16 -15
  45. package/dist/commands/exec/metadata.js +1 -1
  46. package/dist/commands/exec/mint-failed.d.ts +38 -0
  47. package/dist/commands/exec/mint-failed.js +27 -4
  48. package/dist/commands/exec/outcomes.d.ts +104 -22
  49. package/dist/commands/exec/outcomes.js +73 -26
  50. package/dist/commands/exec/plan-run.d.ts +58 -150
  51. package/dist/commands/exec/plan-run.js +239 -90
  52. package/dist/commands/exec/progress.d.ts +10 -6
  53. package/dist/commands/exec/progress.js +38 -25
  54. package/dist/commands/exec/run-bin.d.ts +11 -11
  55. package/dist/commands/exec/run-bin.js +9 -9
  56. package/dist/commands/exec/run-flags.d.ts +69 -0
  57. package/dist/commands/exec/run-flags.js +58 -0
  58. package/dist/commands/exec/run-metadata.js +4 -4
  59. package/dist/commands/exec/run-summary.d.ts +58 -0
  60. package/dist/commands/exec/run-summary.js +205 -0
  61. package/dist/commands/exec/runner-refusals.d.ts +82 -0
  62. package/dist/commands/exec/runner-refusals.js +71 -0
  63. package/dist/commands/exec/sandbox-progress.js +3 -0
  64. package/dist/commands/exec/stopped-outcome.d.ts +12 -0
  65. package/dist/commands/exec/stopped-outcome.js +77 -0
  66. package/dist/commands/exec/view.d.ts +20 -11
  67. package/dist/commands/exec/view.js +103 -47
  68. package/dist/commands/runs/facts.d.ts +8 -4
  69. package/dist/commands/runs/facts.js +19 -10
  70. package/dist/commands/runs/list/command.d.ts +16 -8
  71. package/dist/commands/runs/list/command.js +10 -10
  72. package/dist/commands/runs/list/outcomes.d.ts +8 -4
  73. package/dist/commands/runs/logs/command.js +10 -10
  74. package/dist/commands/runs/show/command.d.ts +16 -8
  75. package/dist/commands/runs/show/command.js +31 -29
  76. package/dist/commands/runs/show/metadata.js +1 -1
  77. package/dist/commands/runs/show/outcomes.d.ts +8 -4
  78. package/dist/commands/runs/show/outcomes.js +8 -6
  79. package/dist/commands/snapshots/access.d.ts +111 -0
  80. package/dist/commands/snapshots/access.js +96 -0
  81. package/dist/commands/snapshots/build/command.d.ts +376 -101
  82. package/dist/commands/snapshots/build/command.js +447 -149
  83. package/dist/commands/snapshots/build/metadata.d.ts +10 -0
  84. package/dist/commands/snapshots/build/metadata.js +31 -11
  85. package/dist/commands/snapshots/build/outcomes.d.ts +242 -47
  86. package/dist/commands/snapshots/build/outcomes.js +200 -36
  87. package/dist/commands/snapshots/list/command.d.ts +368 -27
  88. package/dist/commands/snapshots/list/command.js +298 -68
  89. package/dist/commands/snapshots/list/metadata.d.ts +16 -0
  90. package/dist/commands/snapshots/list/metadata.js +29 -6
  91. package/dist/commands/snapshots/list/outcomes.d.ts +247 -15
  92. package/dist/commands/snapshots/list/outcomes.js +223 -52
  93. package/dist/commands/snapshots/metadata.js +1 -1
  94. package/dist/commands/snapshots/prune/command.d.ts +430 -0
  95. package/dist/commands/snapshots/prune/command.js +161 -0
  96. package/dist/commands/snapshots/prune/metadata.d.ts +28 -0
  97. package/dist/commands/snapshots/prune/metadata.js +39 -0
  98. package/dist/commands/snapshots/prune/outcomes.d.ts +208 -0
  99. package/dist/commands/snapshots/prune/outcomes.js +78 -0
  100. package/dist/commands/suites/list/command.js +17 -17
  101. package/dist/commands/suites/list/outcomes.js +2 -2
  102. package/dist/commands/test/command.d.ts +67 -14
  103. package/dist/commands/test/command.js +49 -252
  104. package/dist/commands/test/outcomes.d.ts +33 -7
  105. package/dist/config/check-runner.d.ts +3 -3
  106. package/dist/config/check-runner.js +8 -7
  107. package/dist/config/credential-resolver.d.ts +50 -5
  108. package/dist/config/credential-resolver.js +51 -19
  109. package/dist/config/credential-settle.d.ts +6 -2
  110. package/dist/config/credential-settle.js +11 -5
  111. package/dist/config/index.d.ts +2 -2
  112. package/dist/config/index.js +1 -1
  113. package/dist/config/runner.d.ts +5 -5
  114. package/dist/config/runner.js +1 -1
  115. package/dist/config/schema.d.ts +2 -2
  116. package/dist/config/schema.js +1 -1
  117. package/dist/config-file/define.d.ts +1 -1
  118. package/dist/config-file/define.js +1 -1
  119. package/dist/config-file/runner.d.ts +5 -5
  120. package/dist/config-file/toolchain.d.ts +14 -4
  121. package/dist/config-file/toolchain.js +43 -7
  122. package/dist/context.d.ts +10 -6
  123. package/dist/context.js +8 -6
  124. package/dist/core/across-sandboxes.d.ts +7 -6
  125. package/dist/core/across-sandboxes.js +123 -152
  126. package/dist/core/coordinator.d.ts +166 -0
  127. package/dist/core/coordinator.js +233 -0
  128. package/dist/core/events.d.ts +2 -2
  129. package/dist/core/index.d.ts +4 -2
  130. package/dist/core/index.js +1 -1
  131. package/dist/core/outcomes.d.ts +148 -0
  132. package/dist/core/{sandbox-end.js → outcomes.js} +28 -4
  133. package/dist/core/resources.d.ts +31 -53
  134. package/dist/core/resources.js +32 -70
  135. package/dist/core/run-state.d.ts +7 -1
  136. package/dist/core/run-state.js +2 -0
  137. package/dist/core/run.d.ts +32 -236
  138. package/dist/core/run.js +107 -267
  139. package/dist/core/state-directory.d.ts +1 -1
  140. package/dist/core/state-directory.js +2 -2
  141. package/dist/credential/gateways.d.ts +15 -1
  142. package/dist/credential/index.d.ts +4 -3
  143. package/dist/credential/index.js +3 -2
  144. package/dist/credential/live/vercel-cli-gateway.d.ts +1 -1
  145. package/dist/credential/live/vercel-cli-gateway.js +1 -1
  146. package/dist/credential/live/vercel-oidc-token-gateway.d.ts +11 -0
  147. package/dist/credential/live/vercel-oidc-token-gateway.js +16 -0
  148. package/dist/credential/source.d.ts +73 -6
  149. package/dist/credential/source.js +55 -2
  150. package/dist/extension-commands.d.ts +1 -1
  151. package/dist/extension-commands.js +2 -2
  152. package/dist/extensions/testserver/commands/pool/create/command.d.ts +35 -2
  153. package/dist/extensions/testserver/commands/pool/create/command.js +7 -7
  154. package/dist/extensions/testserver/commands/pool/create/metadata.js +5 -5
  155. package/dist/extensions/testserver/commands/pool/create/outcomes.d.ts +17 -1
  156. package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
  157. package/dist/extensions/testserver/credential-facts.d.ts +6 -2
  158. package/dist/extensions/testserver/credential-facts.js +29 -11
  159. package/dist/extensions/testserver/lifecycle.js +7 -1
  160. package/dist/extensions/testserver/limit.d.ts +3 -0
  161. package/dist/extensions/testserver/limit.js +3 -0
  162. package/dist/extensions/testserver/provision.d.ts +8 -1
  163. package/dist/extensions/testserver/provision.js +8 -3
  164. package/dist/extensions/testserver/refusals.d.ts +6 -1
  165. package/dist/extensions/testserver/refusals.js +16 -1
  166. package/dist/extensions/testserver/resource.d.ts +1 -1
  167. package/dist/extensions/testserver/resource.js +1 -1
  168. package/dist/extensions/testserver/result.d.ts +1 -1
  169. package/dist/extensions/testserver/result.js +9 -4
  170. package/dist/planning/driver-file-lists.d.ts +0 -15
  171. package/dist/planning/driver-file-lists.js +2 -21
  172. package/dist/planning/plan-only.d.ts +3 -14
  173. package/dist/planning/plan-only.js +11 -20
  174. package/dist/planning/run-kind-flags.js +2 -2
  175. package/dist/planning/run-plan.d.ts +45 -12
  176. package/dist/planning/run-plan.js +4 -3
  177. package/dist/planning/suites.d.ts +1 -1
  178. package/dist/planning/suites.js +2 -2
  179. package/dist/planning/test-plan.d.ts +9 -0
  180. package/dist/planning/test-plan.js +9 -0
  181. package/dist/run-directory/recording.js +3 -3
  182. package/dist/run-directory/run-record.d.ts +26 -11
  183. package/dist/run-directory/run-record.js +16 -13
  184. package/dist/runner/base.js +1 -1
  185. package/dist/runner/build-snapshots.d.ts +60 -29
  186. package/dist/runner/build-snapshots.js +136 -29
  187. package/dist/runner/context.d.ts +15 -7
  188. package/dist/runner/context.js +19 -6
  189. package/dist/runner/events.d.ts +16 -10
  190. package/dist/runner/gateways.d.ts +122 -23
  191. package/dist/runner/gateways.js +1 -1
  192. package/dist/runner/gh.d.ts +42 -0
  193. package/dist/runner/gh.js +58 -0
  194. package/dist/runner/index.d.ts +13 -8
  195. package/dist/runner/index.js +12 -6
  196. package/dist/runner/live/checkout-gateway.js +7 -0
  197. package/dist/runner/live/gh-output.d.ts +17 -0
  198. package/dist/runner/live/gh-output.js +37 -0
  199. package/dist/runner/live/gh-token-gateway.d.ts +13 -0
  200. package/dist/runner/live/gh-token-gateway.js +51 -0
  201. package/dist/runner/live/sandbox-errors.d.ts +2 -0
  202. package/dist/runner/live/sandbox-errors.js +4 -0
  203. package/dist/runner/live/sandbox-gateway.js +140 -4
  204. package/dist/runner/live/snapshot-index-gateway.d.ts +12 -0
  205. package/dist/runner/live/{snapshot-cache-gateway.js → snapshot-index-gateway.js} +11 -11
  206. package/dist/runner/live/snapshot-records.js +12 -12
  207. package/dist/runner/local-snapshot-index.d.ts +205 -0
  208. package/dist/runner/local-snapshot-index.js +210 -0
  209. package/dist/runner/network-policy.d.ts +6 -6
  210. package/dist/runner/network-policy.js +7 -7
  211. package/dist/runner/policy-writes.d.ts +1 -1
  212. package/dist/runner/policy-writes.js +1 -1
  213. package/dist/runner/prepare.d.ts +14 -14
  214. package/dist/runner/prepare.js +20 -11
  215. package/dist/runner/ready.d.ts +19 -11
  216. package/dist/runner/ready.js +104 -33
  217. package/dist/runner/sandboxed-command.d.ts +3 -3
  218. package/dist/runner/sandboxed-command.js +3 -3
  219. package/dist/runner/scope.d.ts +15 -8
  220. package/dist/runner/scope.js +16 -5
  221. package/dist/runner/secrets.d.ts +41 -18
  222. package/dist/runner/secrets.js +226 -30
  223. package/dist/runner/session.d.ts +8 -8
  224. package/dist/runner/session.js +6 -3
  225. package/dist/runner/shared-snapshot-entry.d.ts +92 -0
  226. package/dist/runner/shared-snapshot-entry.js +168 -0
  227. package/dist/runner/shared-snapshot-list.d.ts +81 -0
  228. package/dist/runner/shared-snapshot-list.js +155 -0
  229. package/dist/runner/shared-snapshot-lookup.d.ts +51 -0
  230. package/dist/runner/shared-snapshot-lookup.js +118 -0
  231. package/dist/runner/shared-snapshot-prune.d.ts +58 -0
  232. package/dist/runner/shared-snapshot-prune.js +133 -0
  233. package/dist/runner/snapshot-build.d.ts +42 -14
  234. package/dist/runner/snapshot-build.js +79 -47
  235. package/dist/runner/snapshot-choice.js +2 -1
  236. package/dist/runner/snapshot-inspect.d.ts +39 -40
  237. package/dist/runner/snapshot-inspect.js +52 -35
  238. package/dist/runner/snapshot-key.d.ts +32 -17
  239. package/dist/runner/snapshot-key.js +43 -18
  240. package/dist/runner/snapshot-source.d.ts +31 -0
  241. package/dist/runner/snapshot-source.js +122 -0
  242. package/dist/runner/steps.d.ts +1 -1
  243. package/dist/runner/steps.js +1 -1
  244. package/dist/runner/{recipe-check.d.ts → vercel-sandbox-check.d.ts} +4 -2
  245. package/dist/runner/{recipe-check.js → vercel-sandbox-check.js} +7 -2
  246. package/dist/runner/{recipe.d.ts → vercel-sandbox-options.d.ts} +59 -28
  247. package/dist/runner/{recipe.js → vercel-sandbox-options.js} +128 -84
  248. package/dist/runner/vercel-sandbox-secrets.d.ts +116 -0
  249. package/dist/runner/{recipe-secrets.js → vercel-sandbox-secrets.js} +159 -26
  250. package/dist/sdk/extension/credential-diagnosis.d.ts +3 -1
  251. package/dist/sdk/extension/credential-diagnosis.js +25 -5
  252. package/dist/sdk/extension/credential-source.d.ts +20 -3
  253. package/dist/sdk/extension/credential-source.js +4 -4
  254. package/dist/sdk/extension/index.d.ts +3 -2
  255. package/dist/sdk/extension/index.js +2 -1
  256. package/dist/sdk/extension/resource-definition.d.ts +1 -1
  257. package/dist/sdk/extension/secret-source.d.ts +1 -1
  258. package/dist/sdk/extension/secret-source.js +1 -1
  259. package/dist/sdk/extension/vercel-oidc-facts.d.ts +20 -0
  260. package/dist/sdk/extension/vercel-oidc-facts.js +20 -0
  261. package/dist/shared/cleanup.d.ts +3 -3
  262. package/dist/shared/cleanup.js +15 -5
  263. package/dist/shared/snapshot-text.d.ts +4 -4
  264. package/dist/shared/snapshot-text.js +11 -11
  265. package/dist/time/duration.js +1 -1
  266. package/package.json +5 -3
  267. package/skills/overview.md +4 -4
  268. package/skills/plan-runs.md +1 -1
  269. package/skills/read-run-output.md +6 -6
  270. package/dist/application.d.ts +0 -21
  271. package/dist/application.js +0 -30
  272. package/dist/chunks/chunk-7EENF73W.js +0 -782
  273. package/dist/chunks/chunk-Z5PBVG3Y.js +0 -2599
  274. package/dist/commands/exec/across-sandboxes-run.d.ts +0 -180
  275. package/dist/commands/exec/across-sandboxes-run.js +0 -339
  276. package/dist/commands/exec/plan-only.d.ts +0 -10
  277. package/dist/commands/exec/plan-only.js +0 -45
  278. package/dist/commands/exec/run-command.d.ts +0 -475
  279. package/dist/commands/exec/run-command.js +0 -603
  280. package/dist/commands/exec/run-planned.d.ts +0 -20
  281. package/dist/commands/exec/run-planned.js +0 -22
  282. package/dist/commands/exec/sandbox-view.d.ts +0 -19
  283. package/dist/commands/exec/sandbox-view.js +0 -72
  284. package/dist/commands/test/plan.d.ts +0 -92
  285. package/dist/commands/test/plan.js +0 -125
  286. package/dist/core/sandbox-end.d.ts +0 -64
  287. package/dist/runner/live/snapshot-cache-gateway.d.ts +0 -12
  288. package/dist/runner/recipe-secrets.d.ts +0 -67
  289. package/dist/runner/snapshot-cache.d.ts +0 -148
  290. package/dist/runner/snapshot-cache.js +0 -126
@@ -1,13 +1,13 @@
1
1
  // The credential launcher resolver: how a command gets the credential source `--credential` names, and then a
2
2
  // credential, without settling the choice or building the source itself, and the errors a source's `obtain()` refuses
3
- // a command with: the mint failed (`mint_failed`), or the GitHub Actions OIDC token request did
4
- // (`token_request_failed`). The launcher builds it once, over its credential gateways, clock and timer, and hands it to
5
- // every command. It lives in `config`, beside the config launcher resolver, and not in `credential`, since it loads
6
- // Clinkr and the `credential` module loads none.
3
+ // a command with: the mint failed (`mint_failed`), the GitHub Actions OIDC token request failed
4
+ // (`token_request_failed`), or reading `VERCEL_OIDC_TOKEN` failed (`vercel_oidc_token_failed`). The launcher builds
5
+ // it once, over its credential gateways, clock, and timer, and hands it to every command. It lives in `config`, beside
6
+ // the config launcher resolver, and not in `credential`, since it loads Clinkr and the `credential` module loads none.
7
7
  import { defineErrors } from "@vercel/clinkr";
8
8
  import { z } from "zod";
9
- import { credentialSourceFor, describeMintFailure, mintTargetText, REQUESTING_TOKEN_LINE, tokenRequestFailureFacts, tokenRequestFailureShape, } from "../credential/index.js";
10
- import { settleCredential } from "./credential-settle.js";
9
+ import { credentialSourceFor, describeMintFailure, mintTargetText, REQUESTING_TOKEN_LINE, tokenRequestFailureFacts, tokenRequestFailureShape, vercelOidcTokenFailureFacts, vercelOidcTokenFailureShape, vercelProjectSource, } from "../credential/index.js";
10
+ import { requireTarget, settleCredential } from "./credential-settle.js";
11
11
  /**
12
12
  * The errors a credential source's `obtain()` refuses with. A command that obtains a credential spreads them into its
13
13
  * outcomes.
@@ -31,12 +31,29 @@ export const credentialSourceErrors = defineErrors({
31
31
  next: [{ type: "text", text: fix }],
32
32
  }),
33
33
  },
34
+ vercelOidcTokenFailed: {
35
+ exitCode: 1,
36
+ description: "With --credential vercel-oidc, VERCEL_OIDC_TOKEN is missing, empty, or not a valid Vercel project OIDC token.",
37
+ schema: z.object(vercelOidcTokenFailureShape),
38
+ render: ({ detail, fix }) => ({
39
+ message: `Couldn't use VERCEL_OIDC_TOKEN: ${detail}.`,
40
+ next: [{ type: "text", text: fix }],
41
+ }),
42
+ },
34
43
  });
35
44
  /** A credential source's failure as the error `obtain()` refuses with. */
36
45
  export function credentialSourceError(failure) {
37
- return failure.source === "mint"
38
- ? credentialSourceErrors.mintFailed({ ...failure.target, ...describeMintFailure(failure.failure, failure.target) })
39
- : credentialSourceErrors.tokenRequestFailed(tokenRequestFailureFacts(failure.failure));
46
+ switch (failure.source) {
47
+ case "mint":
48
+ return credentialSourceErrors.mintFailed({
49
+ ...failure.target,
50
+ ...describeMintFailure(failure.failure, failure.target),
51
+ });
52
+ case "github-actions":
53
+ return credentialSourceErrors.tokenRequestFailed(tokenRequestFailureFacts(failure.failure));
54
+ case "vercel-oidc":
55
+ return credentialSourceErrors.vercelOidcTokenFailed(vercelOidcTokenFailureFacts(failure.failure));
56
+ }
40
57
  }
41
58
  /** The credential launcher resolver over `gateways`. */
42
59
  export function credentialResolver(gateways) {
@@ -45,16 +62,7 @@ export function credentialResolver(gateways) {
45
62
  const chosen = settleCredential(choice, target.scope, target.project);
46
63
  if (!chosen.ok)
47
64
  return chosen;
48
- const { progress } = report;
49
- // The source's events as the command's lines: one before the mint and one before each token request.
50
- const source = credentialSourceFor(chosen.credential, gateways, {
51
- emit: async (event) => {
52
- if (event.kind === "minting")
53
- await progress?.(`Minting a credential for ${mintTargetText(event.target)}…`);
54
- else if (event.kind === "requesting-token")
55
- await progress?.(REQUESTING_TOKEN_LINE);
56
- },
57
- });
65
+ const source = credentialSourceFor(chosen.credential, gateways, commandLines(report));
58
66
  return {
59
67
  ok: true,
60
68
  source: {
@@ -66,5 +74,29 @@ export function credentialResolver(gateways) {
66
74
  },
67
75
  };
68
76
  },
77
+ vercelProjectSource(choice, target, report = {}) {
78
+ let credential;
79
+ if (choice === "vercel-oidc")
80
+ credential = { source: choice };
81
+ else {
82
+ const required = requireTarget(target.scope, target.project);
83
+ if (!required.ok)
84
+ return required;
85
+ credential = { source: choice, target: required.target };
86
+ }
87
+ const { obtain } = vercelProjectSource(credential, gateways, commandLines(report));
88
+ return { ok: true, source: { obtain } };
89
+ },
90
+ };
91
+ }
92
+ /** A credential source's events as a command's lines: one before the mint and one before each token request. */
93
+ function commandLines({ progress }) {
94
+ return {
95
+ emit: async (event) => {
96
+ if (event.kind === "minting")
97
+ await progress?.(`Minting a credential for ${mintTargetText(event.target)}…`);
98
+ else if (event.kind === "requesting-token")
99
+ await progress?.(REQUESTING_TOKEN_LINE);
100
+ },
69
101
  };
70
102
  }
@@ -39,10 +39,14 @@ interface GivenSetting {
39
39
  export declare function requireTarget(scope: GivenSetting | undefined, project: GivenSetting | undefined): Refusable<{
40
40
  readonly target: MintTarget;
41
41
  }, MissingTarget>;
42
+ /**
43
+ * The control plane team and project the flags or the config file give, as a command shows them, or null when either
44
+ * is unset. With `--credential mint` they are the mint's target.
45
+ */
46
+ export declare function givenTarget(scope: GivenSetting | undefined, project: GivenSetting | undefined): MintTarget | null;
42
47
  /**
43
48
  * The credential source `--credential` names: the mint needs the control plane team and project, refusing with
44
- * `missing_target` when either is unset; a GitHub Actions OIDC token request needs neither, and leaves any given
45
- * unused.
49
+ * `missing_target` when either is unset; `github-actions` and `vercel-oidc` need neither, and leave any given unused.
46
50
  */
47
51
  export declare function settleCredential(source: CredentialSourceChoice["source"], scope: GivenSetting | undefined, project: GivenSetting | undefined): Refusable<{
48
52
  readonly credential: CredentialSourceChoice;
@@ -1,6 +1,6 @@
1
1
  // How a command settles the credential source `--credential` names, before it gets a credential: the mint needs the
2
- // control plane team and project, and refuses with `missing_target` without either; a GitHub Actions OIDC token request
3
- // needs neither.
2
+ // control plane team and project, and refuses with `missing_target` without either; a GitHub Actions OIDC token
3
+ // request or `VERCEL_OIDC_TOKEN` needs neither.
4
4
  import { defineErrors, refused } from "@vercel/clinkr";
5
5
  import { z } from "zod";
6
6
  /** The errors settling a credential source refuses a command with. */
@@ -34,13 +34,19 @@ export function requireTarget(scope, project) {
34
34
  }));
35
35
  return { ok: true, target: { team: scope.value, project: project.value } };
36
36
  }
37
+ /**
38
+ * The control plane team and project the flags or the config file give, as a command shows them, or null when either
39
+ * is unset. With `--credential mint` they are the mint's target.
40
+ */
41
+ export function givenTarget(scope, project) {
42
+ return scope === undefined || project === undefined ? null : { team: scope.value, project: project.value };
43
+ }
37
44
  /**
38
45
  * The credential source `--credential` names: the mint needs the control plane team and project, refusing with
39
- * `missing_target` when either is unset; a GitHub Actions OIDC token request needs neither, and leaves any given
40
- * unused.
46
+ * `missing_target` when either is unset; `github-actions` and `vercel-oidc` need neither, and leave any given unused.
41
47
  */
42
48
  export function settleCredential(source, scope, project) {
43
- if (source === "github-actions")
49
+ if (source === "github-actions" || source === "vercel-oidc")
44
50
  return { ok: true, credential: { source } };
45
51
  const required = requireTarget(scope, project);
46
52
  if (!required.ok)
@@ -1,5 +1,5 @@
1
- export { type CommandCredentialSource, type CredentialReport, credentialResolver, type CredentialResolver, credentialSourceError, type CredentialSourceError, credentialSourceErrors, type CredentialTarget, } from "./credential-resolver.ts";
2
- export { credentialErrors, requireTarget, settleCredential } from "./credential-settle.ts";
1
+ export { type CommandCredentialSource, type CommandVercelProjectSource, type CredentialReport, credentialResolver, type CredentialResolver, credentialSourceError, type CredentialSourceError, credentialSourceErrors, type CredentialTarget, } from "./credential-resolver.ts";
2
+ export { credentialErrors, givenTarget, requireTarget, settleCredential } from "./credential-settle.ts";
3
3
  export { configErrors, configProblemLine, optionProblemLine } from "./errors.ts";
4
4
  export type { ConfigGateway, ConfigImport, ConfigLocation, FileListsFileGateway, FileListsFileRead, } from "./gateways.ts";
5
5
  export { liveConfigGateway } from "./live/config-gateway.ts";
@@ -6,7 +6,7 @@
6
6
  // definition's own names (`defineResource`, the option rules and helpers, the merged options' types) are the extension
7
7
  // API's, which a caller imports from `sdk/extension/index.ts`.
8
8
  export { credentialResolver, credentialSourceError, credentialSourceErrors, } from "./credential-resolver.js";
9
- export { credentialErrors, requireTarget, settleCredential } from "./credential-settle.js";
9
+ export { credentialErrors, givenTarget, requireTarget, settleCredential } from "./credential-settle.js";
10
10
  export { configErrors, configProblemLine, optionProblemLine } from "./errors.js";
11
11
  export { liveConfigGateway } from "./live/config-gateway.js";
12
12
  export { liveFileListsFileGateway } from "./live/file-lists-file-gateway.js";
@@ -1,4 +1,4 @@
1
- import type { CheckedRecipe, RunnerRecipe } from "../runner/recipe.ts";
1
+ import type { CheckedVercelSandboxOptions, VercelSandboxOptions } from "../runner/vercel-sandbox-options.ts";
2
2
  /** One runner kind storm supports. */
3
3
  export type RunnerKind = "launch-machine" | "vercel-sandbox";
4
4
  /** The launch machine runner value, made by `launchMachine()`. */
@@ -6,18 +6,18 @@ export interface LaunchMachineRunner {
6
6
  readonly kind: "launch-machine";
7
7
  }
8
8
  /** The Vercel Sandbox runner value, made by `vercelSandbox(options)`. */
9
- export interface VercelSandboxRunner<TOptions = RunnerRecipe> {
9
+ export interface VercelSandboxRunner<TOptions = VercelSandboxOptions> {
10
10
  readonly kind: "vercel-sandbox";
11
11
  readonly options: TOptions;
12
12
  }
13
13
  /** A top-level `runner` value in `storm.config.ts`: complete Vercel Sandbox options, or the launch machine. */
14
14
  export type RunnerConfig = LaunchMachineRunner | VercelSandboxRunner;
15
15
  /** A suite's `runner` value in `storm.config.ts`: complete or partial Vercel Sandbox options, or the launch machine. */
16
- export type SuiteRunnerConfig = LaunchMachineRunner | VercelSandboxRunner<Partial<RunnerRecipe>>;
17
- /** A checked `runner` value after loading `storm.config.ts`, with defaults filled in on a Vercel Sandbox recipe. */
16
+ export type SuiteRunnerConfig = LaunchMachineRunner | VercelSandboxRunner<Partial<VercelSandboxOptions>>;
17
+ /** A checked `runner` value after loading `storm.config.ts`, with defaults filled in on Vercel Sandbox options. */
18
18
  export type CheckedRunner = {
19
19
  readonly kind: "launch-machine";
20
20
  } | {
21
21
  readonly kind: "vercel-sandbox";
22
- readonly recipe: CheckedRecipe;
22
+ readonly options: CheckedVercelSandboxOptions;
23
23
  };
@@ -1,4 +1,4 @@
1
1
  // The declared `runner` value in `storm.config.ts` and its checked form: two peer runner kinds, the launch machine
2
2
  // (`launchMachine()`) and Vercel Sandbox (`vercelSandbox(options)`). Type-only so `@vercel/storm/config`'s
3
- // declarations reach only `runner/recipe.ts`, never Clinkr or zod.
3
+ // declarations reach only `runner/vercel-sandbox-options.ts`, never Clinkr or zod.
4
4
  export {};
@@ -44,7 +44,7 @@ export interface ConfigSettings {
44
44
  export type ConfigSettingKey = keyof ConfigSettings;
45
45
  /** A top-level key of `storm.config.ts`: a setting, `resources`, or `suites`. */
46
46
  export type ConfigKey = ConfigSettingKey | "resources" | "suites";
47
- /** The keys whose checked value differs from what the file gives: a Vercel Sandbox recipe gains its defaults. */
47
+ /** The keys whose checked value differs from what the file gives: the Vercel Sandbox runner options gain their defaults. */
48
48
  interface CheckedSettingValues {
49
49
  readonly runner: CheckedRunner;
50
50
  }
@@ -56,7 +56,7 @@ export type CheckedSettings = {
56
56
  };
57
57
  /**
58
58
  * One thing wrong with a value: the path inside the value (empty for the value itself, `["snapshot", "vcpus"]` inside
59
- * a runner recipe), and what is wrong, worded to follow the key (`must be …, not …`).
59
+ * the Vercel Sandbox runner options), and what is wrong, worded to follow the key (`must be …, not …`).
60
60
  */
61
61
  export interface ValueProblem {
62
62
  readonly path: readonly string[];
@@ -48,7 +48,7 @@ function checkDriver(value, drivers) {
48
48
  }
49
49
  /**
50
50
  * Each top-level setting's rule. Typed against `ConfigSettings`, so a key it gains or loses, or a value type that
51
- * changes, fails to compile here until its rule follows. A runner recipe's problems name the key inside the recipe.
51
+ * changes, fails to compile here until its rule follows. A Vercel Sandbox runner's problems name the key inside the runner options.
52
52
  */
53
53
  const SETTING_CHECKS = {
54
54
  scope: (value) => checkWith(nonEmptyString, value),
@@ -6,7 +6,7 @@ export { launchMachine, vercelSandbox } from "./runner.ts";
6
6
  export { pnpmToolchains } from "./toolchain.ts";
7
7
  export type { LaunchMachineRunner, RunnerConfig, RunnerKind, SuiteRunnerConfig, VercelSandboxRunner, } from "../config/runner.ts";
8
8
  export type { SuiteConfig, SuiteConfigMap } from "../config/suite.ts";
9
- export type { CredentialDeclaration, RunnerRecipe, RunnerSandboxCount, RunnerStep, RunnerVcpuCount, RunnerVcpuRule, SandboxCountDefault, SandboxCountDefaultRule, ToolchainStep, UnsafeSecretEnvVar, } from "../runner/recipe.ts";
9
+ export type { CredentialDeclaration, GhCredentialSource, GhTokenFormat, ManagedCredential, RunnerSandboxCount, RunnerStep, RunnerVcpuCount, RunnerVcpuRule, SandboxCountDefault, SandboxCountDefaultRule, SandboxCredentialSource, SnapshotSource, ToolchainStep, UnsafeSecretEnvVar, VercelSandboxOptions, } from "../runner/vercel-sandbox-options.ts";
10
10
  export type { Resource } from "../sdk/extension/resource-definition.ts";
11
11
  export type { SecretSource } from "../sdk/extension/secret-source.ts";
12
12
  /**
@@ -1,7 +1,7 @@
1
1
  // The config file's published surface, `@vercel/storm/config`. A user's `storm.config.ts` imports it, so it
2
2
  // imports nothing at run time outside `src/config-file/` (`runner.ts` and `toolchain.ts`, which import nothing
3
3
  // either): loading it pulls in no Clinkr, zod, or CLI code. Everything it takes from the modules, the top-level
4
- // settings, the runner value types, the suite types, the runner recipe's types, and the resource's type, is a
4
+ // settings, the runner value types, the suite types, the Vercel Sandbox runner options' types, and the resource's type, is a
5
5
  // type-only import, erased at run time. A resource comes from its resource factory, which the config file imports from
6
6
  // the resource's own export, `@vercel/storm/<resource>`.
7
7
  //
@@ -1,11 +1,11 @@
1
1
  import type { LaunchMachineRunner, VercelSandboxRunner } from "../config/runner.ts";
2
- import type { RunnerRecipe } from "../runner/recipe.ts";
2
+ import type { VercelSandboxOptions } from "../runner/vercel-sandbox-options.ts";
3
3
  /** Declares the launch machine runner: runs the command on the launch machine as it is, with no isolation. */
4
4
  export declare function launchMachine(): LaunchMachineRunner;
5
5
  /**
6
- * Declares the Vercel Sandbox runner with `options`. At the top level of `storm.config.ts`, `options` must be a
7
- * complete runner recipe; in a suite under `suites`, `options` may override only the top-level recipe keys that
6
+ * Declares the Vercel Sandbox runner with `options`. At the top level of `storm.config.ts`, `options` must be complete
7
+ * `VercelSandboxOptions`; in a suite under `suites`, `options` may override only the top-level option keys that
8
8
  * differ.
9
9
  */
10
- export declare function vercelSandbox(options: RunnerRecipe): VercelSandboxRunner;
11
- export declare function vercelSandbox(options: Partial<RunnerRecipe>): VercelSandboxRunner<Partial<RunnerRecipe>>;
10
+ export declare function vercelSandbox(options: VercelSandboxOptions): VercelSandboxRunner;
11
+ export declare function vercelSandbox(options: Partial<VercelSandboxOptions>): VercelSandboxRunner<Partial<VercelSandboxOptions>>;
@@ -1,15 +1,25 @@
1
- import type { ToolchainStep } from "../runner/recipe.ts";
1
+ import type { ToolchainStep } from "../runner/vercel-sandbox-options.ts";
2
2
  /**
3
3
  * Node program run inside `pnpmToolchains` to read `packageManager` and `engines.node` from the staged `package.json`
4
4
  * and print `<nodeMin> <pnpmVersion>`. Exported from this file (not `@vercel/storm/config`) so tests can run it
5
5
  * directly without slicing the shell script.
6
6
  */
7
7
  export declare const PNPM_TOOLCHAINS_MANIFEST_SCRIPT: string;
8
+ /**
9
+ * Bash snippet run at the start of `pnpmToolchains` to put `$HOME/.local/bin` first on `PATH` and persist it
10
+ * idempotently in `$HOME/.bash_profile` and `$HOME/.bashrc`, preserving any pre-existing `$HOME/.bash_login` or
11
+ * `$HOME/.profile`. Uses a storm-owned marker comment so an image's earlier `PATH` export never stops storm from
12
+ * appending at the end of the file. Exported from this file (not `@vercel/storm/config`) so tests can run it
13
+ * directly under `bash -lc` against synthetic `$HOME` fixtures.
14
+ */
15
+ export declare const PNPM_TOOLCHAINS_PROFILE_SCRIPT: string;
8
16
  /**
9
17
  * Plain-data toolchain step for a pnpm workspace whose root `package.json` declares `packageManager` (`pnpm@<x.y.z>`)
10
18
  * and `engines.node` (`>=<x.y.z>`). storm stages `package.json` into `/vercel/sandbox/package.json` before toolchain
11
- * steps run, and the script puts `git` on `PATH`, downloads Node into `~/.local/bin` when the runtime's Node is older
12
- * than `engines.node`, and installs the `packageManager` pnpm through corepack. Give it as `snapshot.toolchains`, or
13
- * spread it alongside other toolchain steps (`[...pnpmToolchains, ...]`).
19
+ * steps run, and the script puts `$HOME/.local/bin` first on `PATH` (persisting it idempotently to `$HOME/.bash_profile`
20
+ * and `$HOME/.bashrc` so pre-installed shims such as `~/.global/pnpm/bin` never shadow installed tools), installs `git`
21
+ * when absent via `dnf` or `apt-get`, downloads Node into `$HOME/.local/bin` when the image's Node is older than
22
+ * `engines.node`, and installs the `packageManager` pnpm through corepack. Give it as `snapshot.toolchains`, or spread
23
+ * it alongside other toolchain steps (`[...pnpmToolchains, ...]`).
14
24
  */
15
25
  export declare const pnpmToolchains: readonly ToolchainStep[];
@@ -1,5 +1,5 @@
1
- // The toolchain steps a pnpm workspace's runner recipe can use, exported from `@vercel/storm/config`. Like
2
- // `define.ts`, it imports nothing at run time, so a config file that uses it loads no Clinkr, zod or CLI code.
1
+ // The toolchain steps a pnpm workspace's Vercel Sandbox runner can use, exported from `@vercel/storm/config`. Like
2
+ // `define.ts`, it imports nothing at run time, so a config file that uses it loads no Clinkr, zod, or CLI code.
3
3
  /**
4
4
  * Node program run inside `pnpmToolchains` to read `packageManager` and `engines.node` from the staged `package.json`
5
5
  * and print `<nodeMin> <pnpmVersion>`. Exported from this file (not `@vercel/storm/config`) so tests can run it
@@ -23,12 +23,39 @@ if (node === undefined) {
23
23
  }
24
24
  process.stdout.write(node + " " + pnpm + "\n");
25
25
  `.trim();
26
+ /**
27
+ * Bash snippet run at the start of `pnpmToolchains` to put `$HOME/.local/bin` first on `PATH` and persist it
28
+ * idempotently in `$HOME/.bash_profile` and `$HOME/.bashrc`, preserving any pre-existing `$HOME/.bash_login` or
29
+ * `$HOME/.profile`. Uses a storm-owned marker comment so an image's earlier `PATH` export never stops storm from
30
+ * appending at the end of the file. Exported from this file (not `@vercel/storm/config`) so tests can run it
31
+ * directly under `bash -lc` against synthetic `$HOME` fixtures.
32
+ */
33
+ export const PNPM_TOOLCHAINS_PROFILE_SCRIPT = [
34
+ 'mkdir -p "$HOME/.local/bin"',
35
+ 'export PATH="$HOME/.local/bin:$PATH"',
36
+ // A login shell reads only the first of these files it finds, so a new `.bash_profile` sources the one it hides.
37
+ 'if [ ! -f "$HOME/.bash_profile" ]; then',
38
+ " for STORM_LOGIN in .bash_login .profile; do",
39
+ ' if [ -f "$HOME/$STORM_LOGIN" ]; then',
40
+ ' printf \'[ -f "$HOME/%s" ] && . "$HOME/%s"\\n\' "$STORM_LOGIN" "$STORM_LOGIN" > "$HOME/.bash_profile"',
41
+ " break",
42
+ " fi",
43
+ " done",
44
+ "fi",
45
+ "STORM_LOCAL_BIN_EXPORT='export PATH=\"$HOME/.local/bin:$PATH\" # storm:local-bin'",
46
+ 'for STORM_PROFILE in "$HOME/.bash_profile" "$HOME/.bashrc"; do',
47
+ ' touch "$STORM_PROFILE"',
48
+ ' grep -Fqx "$STORM_LOCAL_BIN_EXPORT" "$STORM_PROFILE" || printf \'\\n%s\\n\' "$STORM_LOCAL_BIN_EXPORT" >> "$STORM_PROFILE"',
49
+ "done",
50
+ ].join("\n");
26
51
  /**
27
52
  * Plain-data toolchain step for a pnpm workspace whose root `package.json` declares `packageManager` (`pnpm@<x.y.z>`)
28
53
  * and `engines.node` (`>=<x.y.z>`). storm stages `package.json` into `/vercel/sandbox/package.json` before toolchain
29
- * steps run, and the script puts `git` on `PATH`, downloads Node into `~/.local/bin` when the runtime's Node is older
30
- * than `engines.node`, and installs the `packageManager` pnpm through corepack. Give it as `snapshot.toolchains`, or
31
- * spread it alongside other toolchain steps (`[...pnpmToolchains, ...]`).
54
+ * steps run, and the script puts `$HOME/.local/bin` first on `PATH` (persisting it idempotently to `$HOME/.bash_profile`
55
+ * and `$HOME/.bashrc` so pre-installed shims such as `~/.global/pnpm/bin` never shadow installed tools), installs `git`
56
+ * when absent via `dnf` or `apt-get`, downloads Node into `$HOME/.local/bin` when the image's Node is older than
57
+ * `engines.node`, and installs the `packageManager` pnpm through corepack. Give it as `snapshot.toolchains`, or spread
58
+ * it alongside other toolchain steps (`[...pnpmToolchains, ...]`).
32
59
  */
33
60
  export const pnpmToolchains = [
34
61
  {
@@ -36,8 +63,17 @@ export const pnpmToolchains = [
36
63
  baseFiles: ["package.json"],
37
64
  script: [
38
65
  "set -euo pipefail",
39
- 'mkdir -p "$HOME/.local/bin"',
40
- "command -v git >/dev/null || sudo dnf install -y -q git",
66
+ PNPM_TOOLCHAINS_PROFILE_SCRIPT,
67
+ "if ! command -v git >/dev/null; then",
68
+ " if command -v dnf >/dev/null; then",
69
+ " sudo dnf install -y -q git",
70
+ " elif command -v apt-get >/dev/null; then",
71
+ " sudo apt-get update -qq && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -qq git",
72
+ " else",
73
+ ' echo "git is not installed and neither dnf nor apt-get is available" >&2',
74
+ " exit 1",
75
+ " fi",
76
+ "fi",
41
77
  "git --version",
42
78
  `STORM_TOOLCHAINS="$(node - <<'STORM_MANIFEST_EOF'\n${PNPM_TOOLCHAINS_MANIFEST_SCRIPT}\nSTORM_MANIFEST_EOF\n)"`,
43
79
  'read -r STORM_NODE_MIN STORM_PNPM_VERSION <<< "$STORM_TOOLCHAINS"',
package/dist/context.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { type ConfigGateway, type CredentialResolver, type FileListsFileGateway, type StormConfigResolver } from "./config/index.ts";
2
- import { type CredentialGateway, type GitHubActionsTokenGateway } from "./credential/index.ts";
2
+ import { type CredentialGateway, type GitHubActionsTokenGateway, type VercelOidcTokenGateway } from "./credential/index.ts";
3
3
  import type { PackageBinService } from "./launcher-resolvers/index.ts";
4
4
  import type { Presentation } from "./presentation.ts";
5
5
  import type { RESOURCES, StormDriverContextMap, StormResourceContextMap } from "./extensions.ts";
6
6
  import { type CommandGateway, type JobSummaryGateway, type PackageBinGateway, type ProgressTerminal } from "./core/index.ts";
7
7
  import { type RunDirectoryGateway } from "./run-directory/index.ts";
8
- import { type CheckoutGateway, type RunnerSandboxGateway, type RunnerSnapshotCacheGateway, type RunnerTerminal } from "./runner/index.ts";
8
+ import { type CheckoutGateway, type GhTokenGateway, type RunnerSandboxGateway, type RunnerSnapshotIndexGateway, type RunnerTerminal } from "./runner/index.ts";
9
9
  import { type Clock, type Timer } from "./time/index.ts";
10
10
  /**
11
11
  * The gateways and DI seams storm's commands reach the outside through. Each resource reaches it through its own
@@ -16,14 +16,18 @@ export interface StormContext {
16
16
  readonly credentials: CredentialGateway;
17
17
  /** GitHub Actions' OIDC token issuer, for `--credential github-actions`. */
18
18
  readonly githubActionsTokens: GitHubActionsTokenGateway;
19
+ /** `VERCEL_OIDC_TOKEN` reader, for `--credential vercel-oidc`. */
20
+ readonly vercelOidcTokens: VercelOidcTokenGateway;
19
21
  readonly commands: CommandGateway;
20
22
  readonly config: ConfigGateway;
21
23
  /** The file lists file a run's `--file-lists` names. */
22
24
  readonly fileListsFiles: FileListsFileGateway;
23
25
  /** The local Git checkout the runner uploads from. */
24
26
  readonly checkout: CheckoutGateway;
25
- /** The per-machine runner snapshot cache. */
26
- readonly runnerSnapshots: RunnerSnapshotCacheGateway;
27
+ /** Reads a GitHub token via `gh auth token` for `{ kind: "gh" }` sandbox credentials. */
28
+ readonly ghTokens: GhTokenGateway;
29
+ /** The per-machine local snapshot index. */
30
+ readonly runnerSnapshots: RunnerSnapshotIndexGateway;
27
31
  /** Vercel Sandbox, where runner and build sandboxes run. */
28
32
  readonly runnerSandboxes: RunnerSandboxGateway;
29
33
  /** The terminal the command's output reaches, wherever the command runs. */
@@ -113,9 +117,9 @@ export declare function localServices(launcher: {
113
117
  * The live Context: `vercel` for credentials, and for `--credential github-actions` GitHub Actions' token request, read
114
118
  * from `env`'s `ACTIONS_ID_TOKEN_REQUEST_*` at each request, with a 10-second timeout; the command spawned as a
115
119
  * real process; `storm.config.ts`
116
- * imported by Node; for the runner, git and tar on the local checkout, the runner snapshot cache under `env`'s
120
+ * imported by Node; for the runner, git and tar on the local checkout, the local snapshot index under `env`'s
117
121
  * `XDG_STATE_HOME` or `HOME`, Vercel Sandbox through `@vercel/sandbox` (loaded only when the runner first calls it) and
118
- * this process's stdout and stderr; the run directories beside the runner snapshot cache; the live view on this
122
+ * this process's stdout and stderr; the run directories beside the local snapshot index; the live view on this
119
123
  * process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any; a package's binary found in
120
124
  * `node_modules/.bin`; and the system timer and clock. When `env` names no place for the state directory, every runner
121
125
  * snapshot cache operation fails and says why, which a run treats as an empty cache, and so does opening a run
package/dist/context.js CHANGED
@@ -2,11 +2,11 @@
2
2
  // Context (`liveResourceContexts`, through the registry), and each driver its own (`liveDriverContexts`), which the app
3
3
  // holds beside the context, so this file names no resource and no driver's gateway.
4
4
  import { configResolver, credentialResolver, liveConfigGateway, liveFileListsFileGateway, } from "./config/index.js";
5
- import { liveCredentialGateway, liveGitHubActionsTokenGateway, } from "./credential/index.js";
5
+ import { liveCredentialGateway, liveGitHubActionsTokenGateway, liveVercelOidcTokenGateway, } from "./credential/index.js";
6
6
  import { packageBinService } from "./local-services.js";
7
7
  import { liveCommandGateway, liveJobSummaryGateway, livePackageBinGateway, liveProgressTerminal, resolveStateDirectory, stateDirectoryPattern, } from "./core/index.js";
8
8
  import { liveRunDirectoryGateway, RUNS_SUBPATH, unavailableRunDirectoryGateway, } from "./run-directory/index.js";
9
- import { liveCheckoutGateway, liveRunnerSandboxGateway, liveRunnerSnapshotCacheGateway, liveRunnerTerminal, RUNNER_SNAPSHOTS_SUBPATH, unavailableRunnerSnapshotCacheGateway, } from "./runner/index.js";
9
+ import { liveCheckoutGateway, liveGhTokenGateway, liveRunnerSandboxGateway, liveRunnerSnapshotIndexGateway, liveRunnerTerminal, RUNNER_SNAPSHOTS_SUBPATH, unavailableRunnerSnapshotIndexGateway, } from "./runner/index.js";
10
10
  import { systemClock, systemTimer } from "./time/index.js";
11
11
  /**
12
12
  * The launcher resolvers over an app's context, from its working directory, checking the file against every resource
@@ -31,9 +31,9 @@ export function localServices(launcher) {
31
31
  * The live Context: `vercel` for credentials, and for `--credential github-actions` GitHub Actions' token request, read
32
32
  * from `env`'s `ACTIONS_ID_TOKEN_REQUEST_*` at each request, with a 10-second timeout; the command spawned as a
33
33
  * real process; `storm.config.ts`
34
- * imported by Node; for the runner, git and tar on the local checkout, the runner snapshot cache under `env`'s
34
+ * imported by Node; for the runner, git and tar on the local checkout, the local snapshot index under `env`'s
35
35
  * `XDG_STATE_HOME` or `HOME`, Vercel Sandbox through `@vercel/sandbox` (loaded only when the runner first calls it) and
36
- * this process's stdout and stderr; the run directories beside the runner snapshot cache; the live view on this
36
+ * this process's stdout and stderr; the run directories beside the local snapshot index; the live view on this
37
37
  * process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any; a package's binary found in
38
38
  * `node_modules/.bin`; and the system timer and clock. When `env` names no place for the state directory, every runner
39
39
  * snapshot cache operation fails and says why, which a run treats as an empty cache, and so does opening a run
@@ -45,13 +45,15 @@ export function liveContext(options) {
45
45
  return {
46
46
  credentials: liveCredentialGateway(),
47
47
  githubActionsTokens: liveGitHubActionsTokenGateway({ env: options.env, timeoutMs: 10_000 }),
48
+ vercelOidcTokens: liveVercelOidcTokenGateway({ env: options.env }),
48
49
  commands: liveCommandGateway(),
49
50
  config: liveConfigGateway(),
50
51
  fileListsFiles: liveFileListsFileGateway(),
51
52
  checkout: liveCheckoutGateway(),
53
+ ghTokens: liveGhTokenGateway({ env: options.env }),
52
54
  runnerSnapshots: snapshots.ok
53
- ? liveRunnerSnapshotCacheGateway({ directory: snapshots.directory })
54
- : unavailableRunnerSnapshotCacheGateway(stateDirectoryPattern(RUNNER_SNAPSHOTS_SUBPATH), snapshots.reason),
55
+ ? liveRunnerSnapshotIndexGateway({ directory: snapshots.directory })
56
+ : unavailableRunnerSnapshotIndexGateway(stateDirectoryPattern(RUNNER_SNAPSHOTS_SUBPATH), snapshots.reason),
55
57
  runnerSandboxes: liveRunnerSandboxGateway(),
56
58
  runnerTerminal: liveRunnerTerminal({
57
59
  env: options.env,
@@ -1,9 +1,9 @@
1
1
  import { type RunnerTerminal } from "../runner/index.ts";
2
+ import { type RunContext, type RunControl, type RunnerCredentialChoice, type RunRunnerRequest } from "./coordinator.ts";
2
3
  import type { RunProgress } from "./events.ts";
4
+ import { type AcrossSandboxesOutcome } from "./outcomes.ts";
3
5
  import { type ResourceDefinitionSet } from "./resource-definition-set.ts";
4
6
  import type { ResourceContextMap, ResourceRequests, ResourceSkip } from "./resource.ts";
5
- import { type RunContext, type RunControl, type RunRunnerRequest } from "./run.ts";
6
- import { type AcrossSandboxesOutcome } from "./sandbox-end.ts";
7
7
  /** One runner sandbox's command and optional test file list. */
8
8
  export interface SandboxCommand {
9
9
  readonly argv: readonly string[];
@@ -22,6 +22,8 @@ export interface AcrossSandboxesRequest {
22
22
  */
23
23
  readonly sandboxes: readonly SandboxCommand[];
24
24
  readonly resources: ResourceRequests;
25
+ /** The credential source the run uses for the runner sandboxes and its resources (`mint` or `vercel-oidc`). */
26
+ readonly credential: RunnerCredentialChoice;
25
27
  readonly skipped?: readonly ResourceSkip[];
26
28
  }
27
29
  /** The gateways and seams a run across runner sandboxes reaches the outside through. */
@@ -32,10 +34,9 @@ export interface AcrossSandboxesContext extends RunContext {
32
34
  /**
33
35
  * Runs a run across runner sandboxes (`request.sandboxes`) with the resources it asks for (`request.resources`).
34
36
  *
35
- * - Steps that run once (opening, mint, snapshot choice, resource acquire/split, and final release) run once for the
36
- * run.
37
- * - Failure ranking between snapshot choice and resource acquire/split is deterministic: user cancellation first, then
38
- * runner snapshot failure, then resource refusal.
37
+ * - Opening, credential obtainment, snapshot choice, resource acquire/split, and final release run once for the run.
38
+ * - Snapshot choice and resource acquire/split run concurrently under `coordinateSetup`; sandboxes start readying from
39
+ * the chosen snapshot while resources finish acquiring and splitting.
39
40
  * - One runner sandbox's failure or throw never stops the others.
40
41
  * - `snapshot_gone` ends the run with `snapshot_gone` only when every runner sandbox reports it; partial
41
42
  * `snapshot_gone` ends as `sandboxes_ran` with affected runner sandboxes `not-started`.