@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
@@ -19,7 +19,7 @@ export declare const ranSchema: z.ZodObject<{
19
19
  built: z.ZodBoolean;
20
20
  vcpus: z.ZodNumber;
21
21
  region: z.ZodString;
22
- runtime: z.ZodString;
22
+ image: z.ZodString;
23
23
  buildMs: z.ZodNumber;
24
24
  }, z.core.$strip>>;
25
25
  timeline: z.ZodObject<{
@@ -109,13 +109,20 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
109
109
  configFile: z.ZodNullable<z.ZodString>;
110
110
  }, z.core.$strip>;
111
111
  credentialsInvalid: z.ZodObject<{
112
- variables: z.ZodArray<z.ZodObject<{
112
+ problems: z.ZodArray<z.ZodObject<{
113
113
  name: z.ZodString;
114
114
  problem: z.ZodEnum<{
115
+ "gh-failed": "gh-failed";
116
+ "gh-not-authenticated": "gh-not-authenticated";
117
+ "gh-not-installed": "gh-not-installed";
118
+ "gh-preframed": "gh-preframed";
119
+ "gh-timed-out": "gh-timed-out";
115
120
  missing: "missing";
116
121
  multiline: "multiline";
117
122
  short: "short";
118
123
  }>;
124
+ detail: z.ZodString;
125
+ hint: z.ZodString;
119
126
  }, z.core.$strip>>;
120
127
  minLength: z.ZodNumber;
121
128
  configFile: z.ZodNullable<z.ZodString>;
@@ -124,6 +131,10 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
124
131
  variables: z.ZodArray<z.ZodString>;
125
132
  configFile: z.ZodNullable<z.ZodString>;
126
133
  }, z.core.$strip>;
134
+ keepSandboxManagedCredentials: z.ZodObject<{
135
+ providers: z.ZodArray<z.ZodString>;
136
+ configFile: z.ZodNullable<z.ZodString>;
137
+ }, z.core.$strip>;
127
138
  unsafeSecretEnvVarsInvalid: z.ZodObject<{
128
139
  variables: z.ZodArray<z.ZodObject<{
129
140
  name: z.ZodString;
@@ -242,7 +253,7 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
242
253
  };
243
254
  readonly credentialUnused: {
244
255
  readonly exitCode: 2;
245
- readonly description: "--credential was given to a run with no resource that takes a credential.";
256
+ readonly description: "--credential was given to a launch machine run with no resource that takes a credential.";
246
257
  readonly schema: z.ZodObject<{
247
258
  flags: z.ZodArray<z.ZodString>;
248
259
  configFile: z.ZodNullable<z.ZodString>;
@@ -294,23 +305,32 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
294
305
  };
295
306
  readonly credentialsInvalid: {
296
307
  readonly exitCode: 2;
297
- readonly description: "With the Vercel Sandbox runner, launcher environment variables named by the runner recipe's credentials key (source: { kind: \"env\", name }) can't be used, so the run didn't start: it minted, acquired, and created nothing. Each variable has one problem, the first of: missing, unset or empty; multiline, its value holds a carriage return or a line feed, which line-by-line output would split past storm's redaction; short, its value holds fewer than 8 characters, and storm shows each value as <token> wherever it appears in what it prints and writes, so a value that short would hide ordinary output.";
308
+ readonly description: "With the Vercel Sandbox runner, one or more sandbox credentials declared by credentials in vercelSandbox({ … }) can't be read or used on this machine, so the run didn't start: it minted, acquired, and created nothing. Each problem names the credential source, a machine-readable problem code, a human-readable detail, and an actionable next step without revealing any secret value or file contents.";
298
309
  readonly schema: z.ZodObject<{
299
- variables: z.ZodArray<z.ZodObject<{
310
+ problems: z.ZodArray<z.ZodObject<{
300
311
  name: z.ZodString;
301
312
  problem: z.ZodEnum<{
313
+ "gh-failed": "gh-failed";
314
+ "gh-not-authenticated": "gh-not-authenticated";
315
+ "gh-not-installed": "gh-not-installed";
316
+ "gh-preframed": "gh-preframed";
317
+ "gh-timed-out": "gh-timed-out";
302
318
  missing: "missing";
303
319
  multiline: "multiline";
304
320
  short: "short";
305
321
  }>;
322
+ detail: z.ZodString;
323
+ hint: z.ZodString;
306
324
  }, z.core.$strip>>;
307
325
  minLength: z.ZodNumber;
308
326
  configFile: z.ZodNullable<z.ZodString>;
309
327
  }, z.core.$strip>;
310
- readonly render: ({ variables, minLength, configFile }: {
311
- variables: {
328
+ readonly render: ({ problems, configFile }: {
329
+ problems: {
312
330
  name: string;
313
- problem: "missing" | "multiline" | "short";
331
+ problem: "gh-failed" | "gh-not-authenticated" | "gh-not-installed" | "gh-preframed" | "gh-timed-out" | "missing" | "multiline" | "short";
332
+ detail: string;
333
+ hint: string;
314
334
  }[];
315
335
  minLength: number;
316
336
  configFile: string | null;
@@ -325,7 +345,7 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
325
345
  };
326
346
  readonly keepSandboxUnsafeSecretEnvVars: {
327
347
  readonly exitCode: 2;
328
- readonly description: "With the Vercel Sandbox runner, --keep-sandbox asked to keep the runner sandbox for a recipe whose unsafeSecretEnvVars passes secrets into the command's environment, so the run didn't start: it minted, acquired, and created nothing. Anyone who can update the Vercel project can connect to a kept runner sandbox and read what the command wrote.";
348
+ readonly description: "With the Vercel Sandbox runner, --keep-sandbox asked to keep the runner sandbox for a runner whose unsafeSecretEnvVars passes secrets into the command's environment, so the run didn't start: it minted, acquired, and created nothing. Anyone who can update the Vercel project can connect to a kept runner sandbox and read what the command wrote.";
329
349
  readonly schema: z.ZodObject<{
330
350
  variables: z.ZodArray<z.ZodString>;
331
351
  configFile: z.ZodNullable<z.ZodString>;
@@ -341,9 +361,27 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
341
361
  }[];
342
362
  };
343
363
  };
364
+ readonly keepSandboxManagedCredentials: {
365
+ readonly exitCode: 2;
366
+ readonly description: "With the Vercel Sandbox runner, --keep-sandbox asked to keep the runner sandbox for a runner whose managedCredentials asks Vercel Sandbox to inject managed credentials, so the run didn't start: it minted, acquired, and created nothing. Vercel Sandbox rejects deny-all on a sandbox with managed credentials, so storm cannot fence it before keeping it running.";
367
+ readonly schema: z.ZodObject<{
368
+ providers: z.ZodArray<z.ZodString>;
369
+ configFile: z.ZodNullable<z.ZodString>;
370
+ }, z.core.$strip>;
371
+ readonly render: ({ providers, configFile }: {
372
+ providers: string[];
373
+ configFile: string | null;
374
+ }) => {
375
+ message: string;
376
+ next: {
377
+ type: "text";
378
+ text: string;
379
+ }[];
380
+ };
381
+ };
344
382
  readonly unsafeSecretEnvVarsInvalid: {
345
383
  readonly exitCode: 2;
346
- readonly description: "With the Vercel Sandbox runner, launcher environment variables named by the runner recipe's unsafeSecretEnvVars key (source: { kind: \"env\", name }) can't be used, so the run didn't start: it minted, acquired, and created nothing. Each variable has one problem, the first of: missing, unset or empty; multiline, its value holds a carriage return or a line feed, which line-by-line output would split past storm's redaction; short, its value holds fewer than 8 characters, and storm shows each value as <token> wherever it appears in what it prints and writes, so a value that short would hide ordinary output.";
384
+ readonly description: "With the Vercel Sandbox runner, launcher environment variables named by unsafeSecretEnvVars in vercelSandbox({ … }) (source: { kind: \"env\", name }) can't be used, so the run didn't start: it minted, acquired, and created nothing. Each variable has one problem, the first of: missing, unset or empty; multiline, its value holds a carriage return or a line feed, which line-by-line output would split past storm's redaction; short, its value holds fewer than 8 characters, and storm shows each value as <token> wherever it appears in what it prints and writes, so a value that short would hide ordinary output.";
347
385
  readonly schema: z.ZodObject<{
348
386
  variables: z.ZodArray<z.ZodObject<{
349
387
  name: z.ZodString;
@@ -374,7 +412,7 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
374
412
  };
375
413
  readonly noBaseRef: {
376
414
  readonly exitCode: 1;
377
- readonly description: "With the Vercel Sandbox runner, none of the runner recipe's baseRefs exists locally and shares history with HEAD, so there is no base. storm never fetches.";
415
+ readonly description: "With the Vercel Sandbox runner, none of the runner's baseRefs exists locally and shares history with HEAD, so there is no base. storm never fetches.";
378
416
  readonly schema: z.ZodObject<{
379
417
  refs: z.ZodArray<z.ZodObject<{
380
418
  ref: z.ZodString;
@@ -416,7 +454,7 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
416
454
  };
417
455
  readonly snapshotGone: {
418
456
  readonly exitCode: 1;
419
- readonly description: "With the Vercel Sandbox runner, the cached runner snapshot the run picked was gone (the Sandbox API answered 410), so its cache entry was removed and the command didn't run. The next run picks another runner snapshot or builds one.";
457
+ readonly description: "With the Vercel Sandbox runner, the runner snapshot the run picked was gone (the Sandbox API answered 410), so its local snapshot index entry was removed and the command didn't run. The next run picks another runner snapshot or builds one.";
420
458
  readonly schema: z.ZodObject<{
421
459
  snapshotId: z.ZodString;
422
460
  base: z.ZodString;
@@ -445,7 +483,7 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
445
483
  };
446
484
  readonly runnerFailed: {
447
485
  readonly exitCode: 1;
448
- readonly description: "With the Vercel Sandbox runner, the runner couldn't run the command: a snapshot build step, applying the changes, the install, or the build failed (with the step's last 40 output lines), a Vercel Sandbox call failed, a network policy write that puts the recipe steps' credentials in place or removes them failed, git or tar failed on this machine, or the credential names no team and project ids.";
486
+ readonly description: "With the Vercel Sandbox runner, the runner couldn't run the command: a snapshot build step, applying the changes, the install, or the build failed (with the step's last 40 output lines), a Vercel Sandbox call failed, a network policy write that puts the runner steps' credentials in place or removes them failed, git or tar failed on this machine, or the credential names no team and project ids.";
449
487
  readonly schema: z.ZodObject<{
450
488
  failure: z.ZodUnion<readonly [z.ZodObject<{
451
489
  kind: z.ZodEnum<{
@@ -566,9 +604,11 @@ export declare const RUN_ERRORS: {
566
604
  configFile: string | null;
567
605
  }]>;
568
606
  credentialsInvalid: import("@vercel/clinkr").SharedError<"credentials_invalid", [data: {
569
- variables: {
607
+ problems: {
570
608
  name: string;
571
- problem: "missing" | "multiline" | "short";
609
+ problem: "gh-failed" | "gh-not-authenticated" | "gh-not-installed" | "gh-preframed" | "gh-timed-out" | "missing" | "multiline" | "short";
610
+ detail: string;
611
+ hint: string;
572
612
  }[];
573
613
  minLength: number;
574
614
  configFile: string | null;
@@ -596,6 +636,10 @@ export declare const RUN_ERRORS: {
596
636
  }[];
597
637
  }[];
598
638
  }]>;
639
+ keepSandboxManagedCredentials: import("@vercel/clinkr").SharedError<"keep_sandbox_managed_credentials", [data: {
640
+ providers: string[];
641
+ configFile: string | null;
642
+ }]>;
599
643
  keepSandboxUnsafeSecretEnvVars: import("@vercel/clinkr").SharedError<"keep_sandbox_unsafe_secret_env_vars", [data: {
600
644
  variables: string[];
601
645
  configFile: string | null;
@@ -690,6 +734,13 @@ export declare const RUN_ERRORS: {
690
734
  minLength: number;
691
735
  configFile: string | null;
692
736
  }]>;
737
+ vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
738
+ cause: "invalid-token" | "missing-token";
739
+ detail: string;
740
+ fix: string;
741
+ runner: boolean;
742
+ cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
743
+ }]>;
693
744
  };
694
745
  /** How `exec` ends. No outcome carries the credential. */
695
746
  export declare const outcomes: import("@vercel/clinkr").Outcomes<{
@@ -711,7 +762,7 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
711
762
  built: z.ZodBoolean;
712
763
  vcpus: z.ZodNumber;
713
764
  region: z.ZodString;
714
- runtime: z.ZodString;
765
+ image: z.ZodString;
715
766
  buildMs: z.ZodNumber;
716
767
  }, z.core.$strip>>;
717
768
  timeline: z.ZodObject<{
@@ -846,7 +897,7 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
846
897
  built: z.ZodBoolean;
847
898
  vcpus: z.ZodNumber;
848
899
  region: z.ZodString;
849
- runtime: z.ZodString;
900
+ image: z.ZodString;
850
901
  uploadBytes: z.ZodNullable<z.ZodNumber>;
851
902
  }, z.core.$strip>;
852
903
  cleanup: z.ZodType<import("../../shared/cleanup.ts").StormCleanupFacts, import("../../shared/cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("../../shared/cleanup.ts").StormCleanupFacts, import("../../shared/cleanup.ts").StormCleanupFacts>>;
@@ -854,7 +905,7 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
854
905
  sandbox: z.ZodNumber;
855
906
  name: z.ZodString;
856
907
  stopsAt: z.ZodString;
857
- url: z.ZodString;
908
+ url: z.ZodNullable<z.ZodString>;
858
909
  }, z.core.$strip>>;
859
910
  notKept: z.ZodArray<z.ZodObject<{
860
911
  sandbox: z.ZodNumber;
@@ -940,9 +991,11 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
940
991
  configFile: string | null;
941
992
  }]>;
942
993
  credentialsInvalid: import("@vercel/clinkr").SharedError<"credentials_invalid", [data: {
943
- variables: {
994
+ problems: {
944
995
  name: string;
945
- problem: "missing" | "multiline" | "short";
996
+ problem: "gh-failed" | "gh-not-authenticated" | "gh-not-installed" | "gh-preframed" | "gh-timed-out" | "missing" | "multiline" | "short";
997
+ detail: string;
998
+ hint: string;
946
999
  }[];
947
1000
  minLength: number;
948
1001
  configFile: string | null;
@@ -970,6 +1023,10 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
970
1023
  }[];
971
1024
  }[];
972
1025
  }]>;
1026
+ keepSandboxManagedCredentials: import("@vercel/clinkr").SharedError<"keep_sandbox_managed_credentials", [data: {
1027
+ providers: string[];
1028
+ configFile: string | null;
1029
+ }]>;
973
1030
  keepSandboxUnsafeSecretEnvVars: import("@vercel/clinkr").SharedError<"keep_sandbox_unsafe_secret_env_vars", [data: {
974
1031
  variables: string[];
975
1032
  configFile: string | null;
@@ -1076,6 +1133,13 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
1076
1133
  minLength: number;
1077
1134
  configFile: string | null;
1078
1135
  }]>;
1136
+ vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
1137
+ cause: "invalid-token" | "missing-token";
1138
+ detail: string;
1139
+ fix: string;
1140
+ runner: boolean;
1141
+ cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
1142
+ }]>;
1079
1143
  }, {
1080
1144
  readonly conflictingOptions: import("@vercel/clinkr").SharedError<"conflicting_options", [data: {
1081
1145
  conflicts: {
@@ -1091,9 +1155,11 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
1091
1155
  configFile: string | null;
1092
1156
  }]>;
1093
1157
  readonly credentialsInvalid: import("@vercel/clinkr").SharedError<"credentials_invalid", [data: {
1094
- variables: {
1158
+ problems: {
1095
1159
  name: string;
1096
- problem: "missing" | "multiline" | "short";
1160
+ problem: "gh-failed" | "gh-not-authenticated" | "gh-not-installed" | "gh-preframed" | "gh-timed-out" | "missing" | "multiline" | "short";
1161
+ detail: string;
1162
+ hint: string;
1097
1163
  }[];
1098
1164
  minLength: number;
1099
1165
  configFile: string | null;
@@ -1121,6 +1187,10 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
1121
1187
  }[];
1122
1188
  }[];
1123
1189
  }]>;
1190
+ readonly keepSandboxManagedCredentials: import("@vercel/clinkr").SharedError<"keep_sandbox_managed_credentials", [data: {
1191
+ providers: string[];
1192
+ configFile: string | null;
1193
+ }]>;
1124
1194
  readonly keepSandboxUnsafeSecretEnvVars: import("@vercel/clinkr").SharedError<"keep_sandbox_unsafe_secret_env_vars", [data: {
1125
1195
  variables: string[];
1126
1196
  configFile: string | null;
@@ -1227,4 +1297,16 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
1227
1297
  minLength: number;
1228
1298
  configFile: string | null;
1229
1299
  }]>;
1300
+ readonly vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
1301
+ cause: "invalid-token" | "missing-token";
1302
+ detail: string;
1303
+ fix: string;
1304
+ runner: boolean;
1305
+ cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
1306
+ }]>;
1230
1307
  }>;
1308
+ /**
1309
+ * A run canceled before it started, while storm planned it or called its resources' `beforeRun`: nothing was minted,
1310
+ * acquired, or started, and the command didn't run.
1311
+ */
1312
+ export declare function canceledBeforeStart(): import("@vercel/clinkr").ClinkrError<"canceled">;
@@ -2,6 +2,7 @@ import { defineErrors, defineOutcomes, renderOutcome } from "@vercel/clinkr";
2
2
  import { z } from "zod";
3
3
  import { DEFINITION_SET } from "../../extensions.js";
4
4
  import { CONFIG_FILE_NAMES_TEXT, configErrors, credentialErrors } from "../../config/index.js";
5
+ import { CREDENTIAL_PROBLEM_KINDS } from "../../runner/index.js";
5
6
  import { keptText, RUN_CLEANUP, runnerCleanupWarnings } from "../../shared/cleanup.js";
6
7
  import { noFinalResultsContent } from "../../planning/final-results.js";
7
8
  import { plannedSchema } from "../../planning/plan-only.js";
@@ -41,7 +42,7 @@ const runnerFailureSchema = z.union([
41
42
  kind: z.literal("network-policy-failed"),
42
43
  /** The write that failed: the one that puts credentials in place, or the one that removes them. */
43
44
  operation: z.enum(["inject", "remove"]),
44
- /** Where the write was: around the recipe's snapshot steps or its run steps and their credentials, before a runner snapshot is saved, or as the command starts, with the credentials its resources give it beside the recipe's. */
45
+ /** Where the write was: around the runner's snapshot steps or its run steps and their credentials, before a runner snapshot is saved, or as the command starts, with the credentials its resources give it beside the runner's. */
45
46
  around: z.enum(["snapshot-steps", "run-steps", "snapshot-save", "command"]),
46
47
  /** `api` when the Sandbox API refused or failed, `timed-out` when it didn't answer in time. */
47
48
  reason: z.enum(["api", "timed-out"]),
@@ -57,7 +58,22 @@ function listed(names) {
57
58
  return names.join("");
58
59
  return `${names.slice(0, -1).join(", ")} and ${names.at(-1) ?? ""}`;
59
60
  }
60
- /** Renders `credentialsInvalid` and `unsafeSecretEnvVarsInvalid`, naming the recipe key and row label. */
61
+ /** Renders `credentialsInvalid`, naming each unusable credential source's detail and deduplicated next steps. */
62
+ function renderInvalidCredentials(problems, configFile) {
63
+ const hints = [...new Set(problems.map(({ hint }) => hint))];
64
+ return {
65
+ message: `runner.credentials${configFile === null ? "" : ` in ${configFile}`} names ${problems.length === 1 ? "a credential" : "credentials"} storm can't use. The run didn't start.`,
66
+ rows: [["Credentials", problems.map(({ detail }) => detail)]],
67
+ next: [
68
+ { type: "text", text: hints.join(" ") },
69
+ {
70
+ type: "text",
71
+ text: "Or run on the launch machine with runner: launchMachine() (or --runner launch-machine for storm exec), which reads none of these credentials.",
72
+ },
73
+ ],
74
+ };
75
+ }
76
+ /** Renders `unsafeSecretEnvVarsInvalid`, naming the runner options key and row label. */
61
77
  function renderInvalidSecretVariables(key, rowLabel, variables, minLength, configFile) {
62
78
  const named = (problem) => variables.filter((variable) => variable.problem === problem).map(({ name }) => name);
63
79
  const [missing, multiline, short] = [named("missing"), named("multiline"), named("short")];
@@ -103,7 +119,7 @@ function runnerFailureText(failure) {
103
119
  case "snapshot-build-step-failed":
104
120
  return {
105
121
  message: `The runner snapshot build's step "${failure.label}" ${stepEnded(failure.exitCode)}. The command didn't run.`,
106
- next: "Fix the step in the runner recipe, then retry. A failed build records no runner snapshot.",
122
+ next: "Fix the step in vercelSandbox({ … }), then retry. A failed build records no runner snapshot.",
107
123
  };
108
124
  case "apply-failed":
109
125
  return {
@@ -113,12 +129,12 @@ function runnerFailureText(failure) {
113
129
  case "install-failed":
114
130
  return {
115
131
  message: `The runner's install, "${failure.label}", ${stepEnded(failure.exitCode)}. The command didn't run.`,
116
- next: "Fix run.install in the runner recipe, or what it installs, then retry.",
132
+ next: "Fix run.install in vercelSandbox({ … }), or what it installs, then retry.",
117
133
  };
118
134
  case "build-failed":
119
135
  return {
120
136
  message: `The runner's build, "${failure.label}", ${stepEnded(failure.exitCode)}. The command didn't run.`,
121
- next: "Fix the build, or run.build in the runner recipe, then retry.",
137
+ next: "Fix the build, or run.build in vercelSandbox({ … }), then retry.",
122
138
  };
123
139
  case "sandbox-api-failed":
124
140
  return {
@@ -135,19 +151,19 @@ function runnerFailureText(failure) {
135
151
  const next = "Retry; if it keeps failing, check the Vercel Sandbox status and the project's Sandbox access.";
136
152
  if (failure.around === "command")
137
153
  return {
138
- message: `Couldn't give the command the credentials its resources give it, beside the recipe's: writing the runner sandbox's network policy failed (${detail}). The command didn't run.`,
154
+ message: `Couldn't give the command the credentials its resources give it, beside the runner's: writing the runner sandbox's network policy failed (${detail}). The command didn't run.`,
139
155
  next,
140
156
  };
141
157
  if (failure.operation === "remove")
142
158
  return {
143
- message: `Couldn't remove the recipe's credentials from the sandbox's network policy before saving the runner snapshot (${detail}). storm stops and deletes the sandbox, and keeps neither it nor a runner snapshot of it. The command didn't run.`,
159
+ message: `Couldn't remove the runner's credentials from the sandbox's network policy before saving the runner snapshot (${detail}). storm stops and deletes the sandbox, and keeps neither it nor a runner snapshot of it. The command didn't run.`,
144
160
  next,
145
161
  };
146
162
  const steps = failure.around === "snapshot-steps"
147
163
  ? "the snapshot build's toolchain and prebuild steps"
148
164
  : "the install and build steps";
149
165
  return {
150
- message: `Couldn't give ${steps} the recipe's credentials: writing the sandbox's network policy failed (${detail}). None of those steps ran, and the command didn't run.`,
166
+ message: `Couldn't give ${steps} the runner's credentials: writing the sandbox's network policy failed (${detail}). None of those steps ran, and the command didn't run.`,
151
167
  next,
152
168
  };
153
169
  }
@@ -198,7 +214,7 @@ export const ranSchema = z.object({
198
214
  built: z.boolean(),
199
215
  vcpus: z.number(),
200
216
  region: z.string(),
201
- runtime: z.string(),
217
+ image: z.string(),
202
218
  /** How long the build step took, in milliseconds. */
203
219
  buildMs: z.number(),
204
220
  })
@@ -275,7 +291,7 @@ export const runErrors = defineErrors({
275
291
  },
276
292
  credentialUnused: {
277
293
  exitCode: 2,
278
- description: "--credential was given to a run with no resource that takes a credential.",
294
+ description: "--credential was given to a launch machine run with no resource that takes a credential.",
279
295
  schema: z.object({
280
296
  /** The flags given that none of the run's resources takes, as typed, such as --credential. */
281
297
  flags: z.array(z.string()),
@@ -336,24 +352,29 @@ export const runErrors = defineErrors({
336
352
  },
337
353
  credentialsInvalid: {
338
354
  exitCode: 2,
339
- description: "With the Vercel Sandbox runner, launcher environment variables named by the runner recipe's credentials key (source: { kind: \"env\", name }) can't be used, so the run didn't start: it minted, acquired, and created nothing. Each variable has one problem, the first of: missing, unset or empty; multiline, its value holds a carriage return or a line feed, which line-by-line output would split past storm's redaction; short, its value holds fewer than 8 characters, and storm shows each value as <token> wherever it appears in what it prints and writes, so a value that short would hide ordinary output.",
355
+ description: "With the Vercel Sandbox runner, one or more sandbox credentials declared by credentials in vercelSandbox({ … }) can't be read or used on this machine, so the run didn't start: it minted, acquired, and created nothing. Each problem names the credential source, a machine-readable problem code, a human-readable detail, and an actionable next step without revealing any secret value or file contents.",
340
356
  schema: z.object({
341
- /** Each variable storm can't use and why, once, in the order the recipe first names it. */
342
- variables: z.array(z.object({ name: z.string(), problem: z.enum(["missing", "multiline", "short"]) })),
357
+ /** Each credential source storm can't use and why, in the order the runner options first name it. */
358
+ problems: z.array(z.object({
359
+ name: z.string(),
360
+ problem: z.enum(CREDENTIAL_PROBLEM_KINDS),
361
+ detail: z.string(),
362
+ hint: z.string(),
363
+ })),
343
364
  /** The fewest characters a credential's value may have. */
344
365
  minLength: z.number(),
345
- /** The config file that gave the runner recipe. */
366
+ /** The config file that gave the Vercel Sandbox runner options. */
346
367
  configFile: z.string().nullable(),
347
368
  }),
348
- render: ({ variables, minLength, configFile }) => renderInvalidSecretVariables("runner.credentials", "Credentials", variables, minLength, configFile),
369
+ render: ({ problems, configFile }) => renderInvalidCredentials(problems, configFile),
349
370
  },
350
371
  keepSandboxUnsafeSecretEnvVars: {
351
372
  exitCode: 2,
352
- description: "With the Vercel Sandbox runner, --keep-sandbox asked to keep the runner sandbox for a recipe whose unsafeSecretEnvVars passes secrets into the command's environment, so the run didn't start: it minted, acquired, and created nothing. Anyone who can update the Vercel project can connect to a kept runner sandbox and read what the command wrote.",
373
+ description: "With the Vercel Sandbox runner, --keep-sandbox asked to keep the runner sandbox for a runner whose unsafeSecretEnvVars passes secrets into the command's environment, so the run didn't start: it minted, acquired, and created nothing. Anyone who can update the Vercel project can connect to a kept runner sandbox and read what the command wrote.",
353
374
  schema: z.object({
354
- /** The environment variable names the recipe's unsafeSecretEnvVars exposes to the command, in the recipe's order. */
375
+ /** The environment variable names the runner's unsafeSecretEnvVars exposes to the command, in the runner options' order. */
355
376
  variables: z.array(z.string()),
356
- /** The config file that gave the runner recipe. */
377
+ /** The config file that gave the Vercel Sandbox runner options. */
357
378
  configFile: z.string().nullable(),
358
379
  }),
359
380
  render: ({ variables, configFile }) => ({
@@ -370,22 +391,41 @@ export const runErrors = defineErrors({
370
391
  ],
371
392
  }),
372
393
  },
394
+ keepSandboxManagedCredentials: {
395
+ exitCode: 2,
396
+ description: "With the Vercel Sandbox runner, --keep-sandbox asked to keep the runner sandbox for a runner whose managedCredentials asks Vercel Sandbox to inject managed credentials, so the run didn't start: it minted, acquired, and created nothing. Vercel Sandbox rejects deny-all on a sandbox with managed credentials, so storm cannot fence it before keeping it running.",
397
+ schema: z.object({
398
+ /** The Vercel-managed credential providers the runner declares, in the runner options' order. */
399
+ providers: z.array(z.string()),
400
+ /** The config file that gave the Vercel Sandbox runner options. */
401
+ configFile: z.string().nullable(),
402
+ }),
403
+ render: ({ providers, configFile }) => ({
404
+ message: `Can't keep the runner sandbox when runner.managedCredentials${configFile === null ? "" : ` in ${configFile}`} is set (${listed(providers)}). Vercel Sandbox rejects deny-all on a sandbox with managed credentials, so storm cannot fence a kept runner sandbox. The run didn't start.`,
405
+ next: [
406
+ {
407
+ type: "text",
408
+ text: "Drop --keep-sandbox, or pass --keep-sandbox 0, so the runner sandbox stops and deletes.",
409
+ },
410
+ ],
411
+ }),
412
+ },
373
413
  unsafeSecretEnvVarsInvalid: {
374
414
  exitCode: 2,
375
- description: "With the Vercel Sandbox runner, launcher environment variables named by the runner recipe's unsafeSecretEnvVars key (source: { kind: \"env\", name }) can't be used, so the run didn't start: it minted, acquired, and created nothing. Each variable has one problem, the first of: missing, unset or empty; multiline, its value holds a carriage return or a line feed, which line-by-line output would split past storm's redaction; short, its value holds fewer than 8 characters, and storm shows each value as <token> wherever it appears in what it prints and writes, so a value that short would hide ordinary output.",
415
+ description: "With the Vercel Sandbox runner, launcher environment variables named by unsafeSecretEnvVars in vercelSandbox({ … }) (source: { kind: \"env\", name }) can't be used, so the run didn't start: it minted, acquired, and created nothing. Each variable has one problem, the first of: missing, unset or empty; multiline, its value holds a carriage return or a line feed, which line-by-line output would split past storm's redaction; short, its value holds fewer than 8 characters, and storm shows each value as <token> wherever it appears in what it prints and writes, so a value that short would hide ordinary output.",
376
416
  schema: z.object({
377
- /** Each variable storm can't use and why, once, in the order the recipe first names it. */
417
+ /** Each variable storm can't use and why, once, in the order the runner options first name it. */
378
418
  variables: z.array(z.object({ name: z.string(), problem: z.enum(["missing", "multiline", "short"]) })),
379
419
  /** The fewest characters an unsafe secret environment variable's value may have. */
380
420
  minLength: z.number(),
381
- /** The config file that gave the runner recipe. */
421
+ /** The config file that gave the Vercel Sandbox runner options. */
382
422
  configFile: z.string().nullable(),
383
423
  }),
384
424
  render: ({ variables, minLength, configFile }) => renderInvalidSecretVariables("runner.unsafeSecretEnvVars", "Unsafe secret environment variables", variables, minLength, configFile),
385
425
  },
386
426
  noBaseRef: {
387
427
  exitCode: 1,
388
- description: "With the Vercel Sandbox runner, none of the runner recipe's baseRefs exists locally and shares history with HEAD, so there is no base. storm never fetches.",
428
+ description: "With the Vercel Sandbox runner, none of the runner's baseRefs exists locally and shares history with HEAD, so there is no base. storm never fetches.",
389
429
  schema: z.object({
390
430
  /** Each ref in baseRefs, and why it gave no base. */
391
431
  refs: z.array(z.object({ ref: z.string(), reason: z.enum(["missing", "unrelated"]) })),
@@ -424,12 +464,12 @@ export const runErrors = defineErrors({
424
464
  },
425
465
  snapshotGone: {
426
466
  exitCode: 1,
427
- description: "With the Vercel Sandbox runner, the cached runner snapshot the run picked was gone (the Sandbox API answered 410), so its cache entry was removed and the command didn't run. The next run picks another runner snapshot or builds one.",
467
+ description: "With the Vercel Sandbox runner, the runner snapshot the run picked was gone (the Sandbox API answered 410), so its local snapshot index entry was removed and the command didn't run. The next run picks another runner snapshot or builds one.",
428
468
  schema: z.object({
429
469
  snapshotId: z.string(),
430
470
  /** The runner snapshot's base, a full SHA. */
431
471
  base: z.string(),
432
- /** Why its cache entry couldn't be removed; null when it was. */
472
+ /** Why its local snapshot index entry couldn't be removed; null when it was. */
433
473
  removal: z.object({ path: z.string(), message: z.string() }).nullable(),
434
474
  /** What the run couldn't clean up. */
435
475
  cleanup: RUN_CLEANUP.schema,
@@ -437,7 +477,7 @@ export const runErrors = defineErrors({
437
477
  render: ({ snapshotId, removal, cleanup }) => {
438
478
  const rows = RUN_CLEANUP.rows(cleanup);
439
479
  return {
440
- message: `Runner snapshot ${snapshotId} is gone, before its cache entry said it expires. ${removal === null ? "Removed its cache entry." : `Couldn't remove its cache entry at ${removal.path}: ${removal.message}.`} The command didn't run.`,
480
+ message: `Runner snapshot ${snapshotId} is gone, before its local snapshot index entry said it expires. ${removal === null ? "Removed its local snapshot index entry." : `Couldn't remove its local snapshot index entry at ${removal.path}: ${removal.message}.`} The command didn't run.`,
441
481
  ...(rows.length === 0 ? {} : { rows }),
442
482
  next: [
443
483
  {
@@ -452,7 +492,7 @@ export const runErrors = defineErrors({
452
492
  },
453
493
  runnerFailed: {
454
494
  exitCode: 1,
455
- description: "With the Vercel Sandbox runner, the runner couldn't run the command: a snapshot build step, applying the changes, the install, or the build failed (with the step's last 40 output lines), a Vercel Sandbox call failed, a network policy write that puts the recipe steps' credentials in place or removes them failed, git or tar failed on this machine, or the credential names no team and project ids.",
495
+ description: "With the Vercel Sandbox runner, the runner couldn't run the command: a snapshot build step, applying the changes, the install, or the build failed (with the step's last 40 output lines), a Vercel Sandbox call failed, a network policy write that puts the runner steps' credentials in place or removes them failed, git or tar failed on this machine, or the credential names no team and project ids.",
456
496
  schema: z.object({
457
497
  failure: runnerFailureSchema,
458
498
  /** What the run couldn't clean up; its `runner` is null when the run failed before it started a sandbox. */
@@ -518,3 +558,10 @@ export const outcomes = defineOutcomes({
518
558
  },
519
559
  errors: { ...RUN_ERRORS, ...sandboxesErrors },
520
560
  });
561
+ /**
562
+ * A run canceled before it started, while storm planned it or called its resources' `beforeRun`: nothing was minted,
563
+ * acquired, or started, and the command didn't run.
564
+ */
565
+ export function canceledBeforeStart() {
566
+ return outcomes.canceled({ changed: "The command didn't run.\nNothing was minted, acquired or started." });
567
+ }