@cnc-tools/storm 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/dist/application.d.ts +22 -13
  2. package/dist/application.js +21 -10
  3. package/dist/bin/run.d.ts +18 -0
  4. package/dist/bin/run.js +31 -0
  5. package/dist/bin/storm.js +42 -26
  6. package/dist/build-info.js +1 -1
  7. package/dist/chunks/{chunk-5CCP36QQ.js → chunk-2RNDPDTJ.js} +2 -2
  8. package/dist/chunks/chunk-2VP4GRJM.js +1219 -0
  9. package/dist/chunks/{chunk-P357TZAY.js → chunk-4O5C2XGJ.js} +18 -15
  10. package/dist/chunks/{chunk-VL7WFTVQ.js → chunk-4WAMTUWZ.js} +419 -340
  11. package/dist/chunks/{chunk-OIY3DMF2.js → chunk-6UHIJXZG.js} +3 -3
  12. package/dist/chunks/{chunk-CN4EFA5J.js → chunk-72ZFEMAW.js} +1 -1
  13. package/dist/chunks/{chunk-CK2GZEPK.js → chunk-7DZE67QM.js} +2 -2
  14. package/dist/chunks/{chunk-VUPZH7J2.js → chunk-BCBKYOHW.js} +1 -1
  15. package/dist/chunks/{chunk-2MAD5NKK.js → chunk-CKGZA25H.js} +1 -18
  16. package/dist/chunks/{chunk-ZG3WQ4UF.js → chunk-D27KILIA.js} +1 -1
  17. package/dist/chunks/{chunk-V4IKA3WI.js → chunk-DADEYJDW.js} +24 -17
  18. package/dist/chunks/{chunk-R7XVBZOY.js → chunk-EEENLQHE.js} +59 -11
  19. package/dist/chunks/chunk-F4MOYHRY.js +198 -0
  20. package/dist/chunks/{chunk-HVNK3I45.js → chunk-FNBB6V4R.js} +1 -1
  21. package/dist/chunks/{chunk-G3PHMXH5.js → chunk-GRT3UIBV.js} +18 -1
  22. package/dist/chunks/chunk-HP3CURSZ.js +88 -0
  23. package/dist/chunks/{chunk-DWEAHX4T.js → chunk-HWIQ2S7K.js} +5 -5
  24. package/dist/chunks/chunk-JN3YY6ZH.js +2166 -0
  25. package/dist/chunks/{chunk-TJNFVNKR.js → chunk-LKTZ5OXS.js} +1 -1
  26. package/dist/chunks/{chunk-3L52KNQA.js → chunk-M7EKRGVD.js} +8 -8
  27. package/dist/chunks/chunk-MR77L2GK.js +340 -0
  28. package/dist/chunks/{chunk-DC2CDHNK.js → chunk-RNAS7JHE.js} +1438 -445
  29. package/dist/chunks/{chunk-FCQUJDA4.js → chunk-RWIXDDCK.js} +4 -189
  30. package/dist/chunks/{chunk-5VXBKPW6.js → chunk-WV3DP6NR.js} +1 -1
  31. package/dist/chunks/{chunk-AWBSONHB.js → chunk-XBDRVFEV.js} +55 -16
  32. package/dist/chunks/{chunk-FOZWA52V.js → chunk-YEPFSLQR.js} +480 -375
  33. package/dist/chunks/{live-app-WECQOQ4C.js → live-app-R76JQXZL.js} +15 -13
  34. package/dist/commands/exec/across-sandboxes-outcomes.d.ts +1 -1
  35. package/dist/commands/exec/across-sandboxes-outcomes.js +2 -2
  36. package/dist/commands/exec/before-run.d.ts +123 -0
  37. package/dist/commands/exec/before-run.js +105 -0
  38. package/dist/commands/exec/command.d.ts +31 -2
  39. package/dist/commands/exec/command.js +31 -95
  40. package/dist/commands/exec/driver-plan.d.ts +9 -4
  41. package/dist/commands/exec/driver-plan.js +8 -8
  42. package/dist/commands/exec/exec-words.js +1 -1
  43. package/dist/commands/exec/execute-run.d.ts +39 -0
  44. package/dist/commands/exec/execute-run.js +325 -0
  45. package/dist/commands/exec/live-view.d.ts +3 -3
  46. package/dist/commands/exec/live-view.js +16 -15
  47. package/dist/commands/exec/metadata.js +1 -1
  48. package/dist/commands/exec/mint-failed.d.ts +38 -0
  49. package/dist/commands/exec/mint-failed.js +27 -4
  50. package/dist/commands/exec/outcomes.d.ts +34 -8
  51. package/dist/commands/exec/outcomes.js +30 -23
  52. package/dist/commands/exec/plan-run.d.ts +58 -150
  53. package/dist/commands/exec/plan-run.js +232 -88
  54. package/dist/commands/exec/progress.d.ts +10 -6
  55. package/dist/commands/exec/progress.js +38 -25
  56. package/dist/commands/exec/run-bin.d.ts +11 -11
  57. package/dist/commands/exec/run-bin.js +9 -9
  58. package/dist/commands/exec/run-flags.d.ts +69 -0
  59. package/dist/commands/exec/run-flags.js +58 -0
  60. package/dist/commands/exec/run-metadata.js +4 -4
  61. package/dist/commands/exec/run-summary.d.ts +58 -0
  62. package/dist/commands/exec/run-summary.js +205 -0
  63. package/dist/commands/exec/runner-refusals.d.ts +82 -0
  64. package/dist/commands/exec/runner-refusals.js +71 -0
  65. package/dist/commands/exec/sandbox-progress.js +3 -0
  66. package/dist/commands/exec/stopped-outcome.d.ts +12 -0
  67. package/dist/commands/exec/stopped-outcome.js +77 -0
  68. package/dist/commands/exec/view.d.ts +20 -11
  69. package/dist/commands/exec/view.js +103 -47
  70. package/dist/commands/runs/facts.d.ts +7 -3
  71. package/dist/commands/runs/facts.js +17 -8
  72. package/dist/commands/runs/list/command.d.ts +14 -6
  73. package/dist/commands/runs/list/command.js +10 -10
  74. package/dist/commands/runs/list/outcomes.d.ts +7 -3
  75. package/dist/commands/runs/logs/command.js +10 -10
  76. package/dist/commands/runs/show/command.d.ts +14 -6
  77. package/dist/commands/runs/show/command.js +30 -28
  78. package/dist/commands/runs/show/outcomes.d.ts +7 -3
  79. package/dist/commands/runs/show/outcomes.js +7 -5
  80. package/dist/commands/snapshots/access.d.ts +111 -0
  81. package/dist/commands/snapshots/access.js +96 -0
  82. package/dist/commands/snapshots/build/command.d.ts +360 -93
  83. package/dist/commands/snapshots/build/command.js +446 -150
  84. package/dist/commands/snapshots/build/metadata.d.ts +10 -0
  85. package/dist/commands/snapshots/build/metadata.js +31 -11
  86. package/dist/commands/snapshots/build/outcomes.d.ts +234 -43
  87. package/dist/commands/snapshots/build/outcomes.js +200 -36
  88. package/dist/commands/snapshots/list/command.d.ts +366 -25
  89. package/dist/commands/snapshots/list/command.js +296 -66
  90. package/dist/commands/snapshots/list/metadata.d.ts +16 -0
  91. package/dist/commands/snapshots/list/metadata.js +29 -6
  92. package/dist/commands/snapshots/list/outcomes.d.ts +245 -13
  93. package/dist/commands/snapshots/list/outcomes.js +221 -50
  94. package/dist/commands/snapshots/metadata.js +1 -1
  95. package/dist/commands/snapshots/prune/command.d.ts +430 -0
  96. package/dist/commands/snapshots/prune/command.js +161 -0
  97. package/dist/commands/snapshots/prune/metadata.d.ts +28 -0
  98. package/dist/commands/snapshots/prune/metadata.js +39 -0
  99. package/dist/commands/snapshots/prune/outcomes.d.ts +208 -0
  100. package/dist/commands/snapshots/prune/outcomes.js +78 -0
  101. package/dist/commands/suites/list/command.js +17 -17
  102. package/dist/commands/suites/list/outcomes.js +2 -2
  103. package/dist/commands/test/command.d.ts +31 -2
  104. package/dist/commands/test/command.js +49 -252
  105. package/dist/commands/test/outcomes.d.ts +15 -1
  106. package/dist/config/check-runner.d.ts +3 -3
  107. package/dist/config/check-runner.js +8 -7
  108. package/dist/config/credential-resolver.d.ts +50 -5
  109. package/dist/config/credential-resolver.js +51 -19
  110. package/dist/config/credential-settle.d.ts +6 -2
  111. package/dist/config/credential-settle.js +11 -5
  112. package/dist/config/index.d.ts +2 -2
  113. package/dist/config/index.js +1 -1
  114. package/dist/config/runner.d.ts +5 -5
  115. package/dist/config/runner.js +1 -1
  116. package/dist/config/schema.d.ts +2 -2
  117. package/dist/config/schema.js +1 -1
  118. package/dist/config-file/define.d.ts +1 -1
  119. package/dist/config-file/define.js +1 -1
  120. package/dist/config-file/runner.d.ts +5 -5
  121. package/dist/config-file/toolchain.d.ts +1 -1
  122. package/dist/config-file/toolchain.js +2 -2
  123. package/dist/context.d.ts +8 -6
  124. package/dist/context.js +7 -6
  125. package/dist/core/across-sandboxes.d.ts +7 -6
  126. package/dist/core/across-sandboxes.js +123 -152
  127. package/dist/core/coordinator.d.ts +166 -0
  128. package/dist/core/coordinator.js +233 -0
  129. package/dist/core/events.d.ts +2 -2
  130. package/dist/core/index.d.ts +4 -2
  131. package/dist/core/index.js +1 -1
  132. package/dist/core/outcomes.d.ts +148 -0
  133. package/dist/core/{sandbox-end.js → outcomes.js} +28 -4
  134. package/dist/core/resources.d.ts +31 -53
  135. package/dist/core/resources.js +32 -70
  136. package/dist/core/run-state.d.ts +7 -1
  137. package/dist/core/run-state.js +2 -0
  138. package/dist/core/run.d.ts +32 -236
  139. package/dist/core/run.js +106 -266
  140. package/dist/core/state-directory.d.ts +1 -1
  141. package/dist/core/state-directory.js +2 -2
  142. package/dist/credential/gateways.d.ts +15 -1
  143. package/dist/credential/index.d.ts +4 -3
  144. package/dist/credential/index.js +3 -2
  145. package/dist/credential/live/vercel-cli-gateway.d.ts +1 -1
  146. package/dist/credential/live/vercel-cli-gateway.js +1 -1
  147. package/dist/credential/live/vercel-oidc-token-gateway.d.ts +11 -0
  148. package/dist/credential/live/vercel-oidc-token-gateway.js +16 -0
  149. package/dist/credential/source.d.ts +73 -6
  150. package/dist/credential/source.js +55 -2
  151. package/dist/extension-commands.d.ts +6 -1
  152. package/dist/extension-commands.js +15 -1
  153. package/dist/extensions/testserver/commands/pool/create/command.d.ts +35 -2
  154. package/dist/extensions/testserver/commands/pool/create/command.js +7 -7
  155. package/dist/extensions/testserver/commands/pool/create/metadata.js +5 -5
  156. package/dist/extensions/testserver/commands/pool/create/outcomes.d.ts +17 -1
  157. package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
  158. package/dist/extensions/testserver/credential-facts.d.ts +6 -2
  159. package/dist/extensions/testserver/credential-facts.js +29 -11
  160. package/dist/extensions/testserver/lifecycle.js +7 -1
  161. package/dist/extensions/testserver/limit.d.ts +3 -0
  162. package/dist/extensions/testserver/limit.js +3 -0
  163. package/dist/extensions/testserver/provision.d.ts +8 -1
  164. package/dist/extensions/testserver/provision.js +8 -3
  165. package/dist/extensions/testserver/refusals.d.ts +6 -1
  166. package/dist/extensions/testserver/refusals.js +16 -1
  167. package/dist/extensions/testserver/resource.d.ts +1 -1
  168. package/dist/extensions/testserver/resource.js +1 -1
  169. package/dist/extensions/testserver/result.d.ts +1 -1
  170. package/dist/extensions/testserver/result.js +9 -4
  171. package/dist/planning/driver-file-lists.d.ts +0 -15
  172. package/dist/planning/driver-file-lists.js +2 -21
  173. package/dist/planning/plan-only.d.ts +3 -14
  174. package/dist/planning/plan-only.js +11 -20
  175. package/dist/planning/run-kind-flags.js +2 -2
  176. package/dist/planning/run-plan.d.ts +45 -12
  177. package/dist/planning/run-plan.js +4 -3
  178. package/dist/planning/suites.d.ts +1 -1
  179. package/dist/planning/suites.js +2 -2
  180. package/dist/planning/test-plan.d.ts +9 -0
  181. package/dist/planning/test-plan.js +9 -0
  182. package/dist/run-directory/recording.js +2 -2
  183. package/dist/run-directory/run-record.d.ts +21 -6
  184. package/dist/run-directory/run-record.js +12 -9
  185. package/dist/runner/base.js +1 -1
  186. package/dist/runner/build-snapshots.d.ts +55 -29
  187. package/dist/runner/build-snapshots.js +130 -29
  188. package/dist/runner/context.d.ts +15 -7
  189. package/dist/runner/context.js +19 -6
  190. package/dist/runner/events.d.ts +16 -10
  191. package/dist/runner/gateways.d.ts +87 -21
  192. package/dist/runner/gateways.js +1 -1
  193. package/dist/runner/index.d.ts +11 -7
  194. package/dist/runner/index.js +9 -4
  195. package/dist/runner/live/sandbox-errors.d.ts +2 -0
  196. package/dist/runner/live/sandbox-errors.js +4 -0
  197. package/dist/runner/live/sandbox-gateway.js +129 -3
  198. package/dist/runner/live/snapshot-index-gateway.d.ts +12 -0
  199. package/dist/runner/live/{snapshot-cache-gateway.js → snapshot-index-gateway.js} +11 -11
  200. package/dist/runner/live/snapshot-records.js +6 -7
  201. package/dist/runner/local-snapshot-index.d.ts +199 -0
  202. package/dist/runner/local-snapshot-index.js +211 -0
  203. package/dist/runner/network-policy.d.ts +6 -6
  204. package/dist/runner/network-policy.js +7 -7
  205. package/dist/runner/policy-writes.d.ts +1 -1
  206. package/dist/runner/policy-writes.js +1 -1
  207. package/dist/runner/prepare.d.ts +14 -14
  208. package/dist/runner/prepare.js +20 -11
  209. package/dist/runner/ready.d.ts +18 -10
  210. package/dist/runner/ready.js +104 -33
  211. package/dist/runner/sandboxed-command.d.ts +3 -3
  212. package/dist/runner/sandboxed-command.js +3 -3
  213. package/dist/runner/scope.d.ts +10 -6
  214. package/dist/runner/scope.js +10 -3
  215. package/dist/runner/secrets.d.ts +13 -13
  216. package/dist/runner/secrets.js +18 -15
  217. package/dist/runner/session.d.ts +8 -8
  218. package/dist/runner/session.js +3 -3
  219. package/dist/runner/shared-snapshot-entry.d.ts +92 -0
  220. package/dist/runner/shared-snapshot-entry.js +168 -0
  221. package/dist/runner/shared-snapshot-list.d.ts +81 -0
  222. package/dist/runner/shared-snapshot-list.js +155 -0
  223. package/dist/runner/shared-snapshot-lookup.d.ts +51 -0
  224. package/dist/runner/shared-snapshot-lookup.js +118 -0
  225. package/dist/runner/shared-snapshot-prune.d.ts +58 -0
  226. package/dist/runner/shared-snapshot-prune.js +133 -0
  227. package/dist/runner/snapshot-build.d.ts +42 -14
  228. package/dist/runner/snapshot-build.js +32 -29
  229. package/dist/runner/snapshot-choice.js +1 -1
  230. package/dist/runner/snapshot-inspect.d.ts +39 -40
  231. package/dist/runner/snapshot-inspect.js +55 -35
  232. package/dist/runner/snapshot-key.d.ts +13 -12
  233. package/dist/runner/snapshot-key.js +13 -12
  234. package/dist/runner/steps.d.ts +1 -1
  235. package/dist/runner/steps.js +1 -1
  236. package/dist/runner/{recipe-check.d.ts → vercel-sandbox-check.d.ts} +2 -2
  237. package/dist/runner/{recipe-check.js → vercel-sandbox-check.js} +3 -2
  238. package/dist/runner/{recipe.d.ts → vercel-sandbox-options.d.ts} +24 -23
  239. package/dist/runner/{recipe.js → vercel-sandbox-options.js} +70 -69
  240. package/dist/runner/{recipe-secrets.d.ts → vercel-sandbox-secrets.d.ts} +6 -6
  241. package/dist/runner/{recipe-secrets.js → vercel-sandbox-secrets.js} +20 -20
  242. package/dist/sdk/extension/commands.d.ts +8 -3
  243. package/dist/sdk/extension/commands.js +3 -1
  244. package/dist/sdk/extension/credential-diagnosis.d.ts +3 -1
  245. package/dist/sdk/extension/credential-diagnosis.js +25 -5
  246. package/dist/sdk/extension/credential-source.d.ts +20 -3
  247. package/dist/sdk/extension/credential-source.js +4 -4
  248. package/dist/sdk/extension/index.d.ts +3 -2
  249. package/dist/sdk/extension/index.js +2 -1
  250. package/dist/sdk/extension/resource-definition.d.ts +1 -1
  251. package/dist/sdk/extension/secret-source.d.ts +1 -1
  252. package/dist/sdk/extension/secret-source.js +1 -1
  253. package/dist/sdk/extension/vercel-oidc-facts.d.ts +20 -0
  254. package/dist/sdk/extension/vercel-oidc-facts.js +20 -0
  255. package/dist/shared/cleanup.d.ts +3 -3
  256. package/dist/shared/cleanup.js +15 -5
  257. package/dist/shared/snapshot-text.d.ts +4 -4
  258. package/dist/shared/snapshot-text.js +11 -11
  259. package/dist/time/duration.js +1 -1
  260. package/package.json +3 -2
  261. package/skills/overview.md +4 -4
  262. package/skills/plan-runs.md +1 -1
  263. package/skills/read-run-output.md +6 -6
  264. package/dist/chunks/chunk-7EENF73W.js +0 -782
  265. package/dist/chunks/chunk-Z5PBVG3Y.js +0 -2599
  266. package/dist/commands/exec/across-sandboxes-run.d.ts +0 -180
  267. package/dist/commands/exec/across-sandboxes-run.js +0 -339
  268. package/dist/commands/exec/plan-only.d.ts +0 -10
  269. package/dist/commands/exec/plan-only.js +0 -45
  270. package/dist/commands/exec/run-command.d.ts +0 -475
  271. package/dist/commands/exec/run-command.js +0 -603
  272. package/dist/commands/exec/run-planned.d.ts +0 -20
  273. package/dist/commands/exec/run-planned.js +0 -22
  274. package/dist/commands/exec/sandbox-view.d.ts +0 -19
  275. package/dist/commands/exec/sandbox-view.js +0 -72
  276. package/dist/commands/test/plan.d.ts +0 -92
  277. package/dist/commands/test/plan.js +0 -125
  278. package/dist/core/sandbox-end.d.ts +0 -64
  279. package/dist/runner/live/snapshot-cache-gateway.d.ts +0 -12
  280. package/dist/runner/snapshot-cache.d.ts +0 -148
  281. package/dist/runner/snapshot-cache.js +0 -126
@@ -242,7 +242,7 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
242
242
  };
243
243
  readonly credentialUnused: {
244
244
  readonly exitCode: 2;
245
- readonly description: "--credential was given to a run with no resource that takes a credential.";
245
+ readonly description: "--credential was given to a launch machine run with no resource that takes a credential.";
246
246
  readonly schema: z.ZodObject<{
247
247
  flags: z.ZodArray<z.ZodString>;
248
248
  configFile: z.ZodNullable<z.ZodString>;
@@ -294,7 +294,7 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
294
294
  };
295
295
  readonly credentialsInvalid: {
296
296
  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.";
297
+ readonly description: "With the Vercel Sandbox runner, launcher environment variables named by credentials 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.";
298
298
  readonly schema: z.ZodObject<{
299
299
  variables: z.ZodArray<z.ZodObject<{
300
300
  name: z.ZodString;
@@ -325,7 +325,7 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
325
325
  };
326
326
  readonly keepSandboxUnsafeSecretEnvVars: {
327
327
  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.";
328
+ 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
329
  readonly schema: z.ZodObject<{
330
330
  variables: z.ZodArray<z.ZodString>;
331
331
  configFile: z.ZodNullable<z.ZodString>;
@@ -343,7 +343,7 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
343
343
  };
344
344
  readonly unsafeSecretEnvVarsInvalid: {
345
345
  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.";
346
+ 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
347
  readonly schema: z.ZodObject<{
348
348
  variables: z.ZodArray<z.ZodObject<{
349
349
  name: z.ZodString;
@@ -374,7 +374,7 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
374
374
  };
375
375
  readonly noBaseRef: {
376
376
  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.";
377
+ 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
378
  readonly schema: z.ZodObject<{
379
379
  refs: z.ZodArray<z.ZodObject<{
380
380
  ref: z.ZodString;
@@ -416,7 +416,7 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
416
416
  };
417
417
  readonly snapshotGone: {
418
418
  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.";
419
+ 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
420
  readonly schema: z.ZodObject<{
421
421
  snapshotId: z.ZodString;
422
422
  base: z.ZodString;
@@ -445,7 +445,7 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
445
445
  };
446
446
  readonly runnerFailed: {
447
447
  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.";
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 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
449
  readonly schema: z.ZodObject<{
450
450
  failure: z.ZodUnion<readonly [z.ZodObject<{
451
451
  kind: z.ZodEnum<{
@@ -690,6 +690,13 @@ export declare const RUN_ERRORS: {
690
690
  minLength: number;
691
691
  configFile: string | null;
692
692
  }]>;
693
+ vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
694
+ cause: "invalid-token" | "missing-token";
695
+ detail: string;
696
+ fix: string;
697
+ runner: boolean;
698
+ cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
699
+ }]>;
693
700
  };
694
701
  /** How `exec` ends. No outcome carries the credential. */
695
702
  export declare const outcomes: import("@vercel/clinkr").Outcomes<{
@@ -854,7 +861,7 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
854
861
  sandbox: z.ZodNumber;
855
862
  name: z.ZodString;
856
863
  stopsAt: z.ZodString;
857
- url: z.ZodString;
864
+ url: z.ZodNullable<z.ZodString>;
858
865
  }, z.core.$strip>>;
859
866
  notKept: z.ZodArray<z.ZodObject<{
860
867
  sandbox: z.ZodNumber;
@@ -1076,6 +1083,13 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
1076
1083
  minLength: number;
1077
1084
  configFile: string | null;
1078
1085
  }]>;
1086
+ vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
1087
+ cause: "invalid-token" | "missing-token";
1088
+ detail: string;
1089
+ fix: string;
1090
+ runner: boolean;
1091
+ cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
1092
+ }]>;
1079
1093
  }, {
1080
1094
  readonly conflictingOptions: import("@vercel/clinkr").SharedError<"conflicting_options", [data: {
1081
1095
  conflicts: {
@@ -1227,4 +1241,16 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
1227
1241
  minLength: number;
1228
1242
  configFile: string | null;
1229
1243
  }]>;
1244
+ readonly vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
1245
+ cause: "invalid-token" | "missing-token";
1246
+ detail: string;
1247
+ fix: string;
1248
+ runner: boolean;
1249
+ cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
1250
+ }]>;
1230
1251
  }>;
1252
+ /**
1253
+ * A run canceled before it started, while storm planned it or called its resources' `beforeRun`: nothing was minted,
1254
+ * acquired, or started, and the command didn't run.
1255
+ */
1256
+ export declare function canceledBeforeStart(): import("@vercel/clinkr").ClinkrError<"canceled">;
@@ -41,7 +41,7 @@ const runnerFailureSchema = z.union([
41
41
  kind: z.literal("network-policy-failed"),
42
42
  /** The write that failed: the one that puts credentials in place, or the one that removes them. */
43
43
  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. */
44
+ /** 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
45
  around: z.enum(["snapshot-steps", "run-steps", "snapshot-save", "command"]),
46
46
  /** `api` when the Sandbox API refused or failed, `timed-out` when it didn't answer in time. */
47
47
  reason: z.enum(["api", "timed-out"]),
@@ -57,7 +57,7 @@ function listed(names) {
57
57
  return names.join("");
58
58
  return `${names.slice(0, -1).join(", ")} and ${names.at(-1) ?? ""}`;
59
59
  }
60
- /** Renders `credentialsInvalid` and `unsafeSecretEnvVarsInvalid`, naming the recipe key and row label. */
60
+ /** Renders `credentialsInvalid` and `unsafeSecretEnvVarsInvalid`, naming the runner options key and row label. */
61
61
  function renderInvalidSecretVariables(key, rowLabel, variables, minLength, configFile) {
62
62
  const named = (problem) => variables.filter((variable) => variable.problem === problem).map(({ name }) => name);
63
63
  const [missing, multiline, short] = [named("missing"), named("multiline"), named("short")];
@@ -103,7 +103,7 @@ function runnerFailureText(failure) {
103
103
  case "snapshot-build-step-failed":
104
104
  return {
105
105
  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.",
106
+ next: "Fix the step in vercelSandbox({ … }), then retry. A failed build records no runner snapshot.",
107
107
  };
108
108
  case "apply-failed":
109
109
  return {
@@ -113,12 +113,12 @@ function runnerFailureText(failure) {
113
113
  case "install-failed":
114
114
  return {
115
115
  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.",
116
+ next: "Fix run.install in vercelSandbox({ … }), or what it installs, then retry.",
117
117
  };
118
118
  case "build-failed":
119
119
  return {
120
120
  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.",
121
+ next: "Fix the build, or run.build in vercelSandbox({ … }), then retry.",
122
122
  };
123
123
  case "sandbox-api-failed":
124
124
  return {
@@ -135,19 +135,19 @@ function runnerFailureText(failure) {
135
135
  const next = "Retry; if it keeps failing, check the Vercel Sandbox status and the project's Sandbox access.";
136
136
  if (failure.around === "command")
137
137
  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.`,
138
+ 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
139
  next,
140
140
  };
141
141
  if (failure.operation === "remove")
142
142
  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.`,
143
+ 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
144
  next,
145
145
  };
146
146
  const steps = failure.around === "snapshot-steps"
147
147
  ? "the snapshot build's toolchain and prebuild steps"
148
148
  : "the install and build steps";
149
149
  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.`,
150
+ 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
151
  next,
152
152
  };
153
153
  }
@@ -275,7 +275,7 @@ export const runErrors = defineErrors({
275
275
  },
276
276
  credentialUnused: {
277
277
  exitCode: 2,
278
- description: "--credential was given to a run with no resource that takes a credential.",
278
+ description: "--credential was given to a launch machine run with no resource that takes a credential.",
279
279
  schema: z.object({
280
280
  /** The flags given that none of the run's resources takes, as typed, such as --credential. */
281
281
  flags: z.array(z.string()),
@@ -336,24 +336,24 @@ export const runErrors = defineErrors({
336
336
  },
337
337
  credentialsInvalid: {
338
338
  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.",
339
+ description: "With the Vercel Sandbox runner, launcher environment variables named by credentials 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.",
340
340
  schema: z.object({
341
- /** Each variable storm can't use and why, once, in the order the recipe first names it. */
341
+ /** Each variable storm can't use and why, once, in the order the runner options first name it. */
342
342
  variables: z.array(z.object({ name: z.string(), problem: z.enum(["missing", "multiline", "short"]) })),
343
343
  /** The fewest characters a credential's value may have. */
344
344
  minLength: z.number(),
345
- /** The config file that gave the runner recipe. */
345
+ /** The config file that gave the Vercel Sandbox runner options. */
346
346
  configFile: z.string().nullable(),
347
347
  }),
348
348
  render: ({ variables, minLength, configFile }) => renderInvalidSecretVariables("runner.credentials", "Credentials", variables, minLength, configFile),
349
349
  },
350
350
  keepSandboxUnsafeSecretEnvVars: {
351
351
  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.",
352
+ 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
353
  schema: z.object({
354
- /** The environment variable names the recipe's unsafeSecretEnvVars exposes to the command, in the recipe's order. */
354
+ /** The environment variable names the runner's unsafeSecretEnvVars exposes to the command, in the runner options' order. */
355
355
  variables: z.array(z.string()),
356
- /** The config file that gave the runner recipe. */
356
+ /** The config file that gave the Vercel Sandbox runner options. */
357
357
  configFile: z.string().nullable(),
358
358
  }),
359
359
  render: ({ variables, configFile }) => ({
@@ -372,20 +372,20 @@ export const runErrors = defineErrors({
372
372
  },
373
373
  unsafeSecretEnvVarsInvalid: {
374
374
  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.",
375
+ 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
376
  schema: z.object({
377
- /** Each variable storm can't use and why, once, in the order the recipe first names it. */
377
+ /** Each variable storm can't use and why, once, in the order the runner options first name it. */
378
378
  variables: z.array(z.object({ name: z.string(), problem: z.enum(["missing", "multiline", "short"]) })),
379
379
  /** The fewest characters an unsafe secret environment variable's value may have. */
380
380
  minLength: z.number(),
381
- /** The config file that gave the runner recipe. */
381
+ /** The config file that gave the Vercel Sandbox runner options. */
382
382
  configFile: z.string().nullable(),
383
383
  }),
384
384
  render: ({ variables, minLength, configFile }) => renderInvalidSecretVariables("runner.unsafeSecretEnvVars", "Unsafe secret environment variables", variables, minLength, configFile),
385
385
  },
386
386
  noBaseRef: {
387
387
  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.",
388
+ 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
389
  schema: z.object({
390
390
  /** Each ref in baseRefs, and why it gave no base. */
391
391
  refs: z.array(z.object({ ref: z.string(), reason: z.enum(["missing", "unrelated"]) })),
@@ -424,12 +424,12 @@ export const runErrors = defineErrors({
424
424
  },
425
425
  snapshotGone: {
426
426
  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.",
427
+ 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
428
  schema: z.object({
429
429
  snapshotId: z.string(),
430
430
  /** The runner snapshot's base, a full SHA. */
431
431
  base: z.string(),
432
- /** Why its cache entry couldn't be removed; null when it was. */
432
+ /** Why its local snapshot index entry couldn't be removed; null when it was. */
433
433
  removal: z.object({ path: z.string(), message: z.string() }).nullable(),
434
434
  /** What the run couldn't clean up. */
435
435
  cleanup: RUN_CLEANUP.schema,
@@ -437,7 +437,7 @@ export const runErrors = defineErrors({
437
437
  render: ({ snapshotId, removal, cleanup }) => {
438
438
  const rows = RUN_CLEANUP.rows(cleanup);
439
439
  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.`,
440
+ 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
441
  ...(rows.length === 0 ? {} : { rows }),
442
442
  next: [
443
443
  {
@@ -452,7 +452,7 @@ export const runErrors = defineErrors({
452
452
  },
453
453
  runnerFailed: {
454
454
  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.",
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 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
456
  schema: z.object({
457
457
  failure: runnerFailureSchema,
458
458
  /** What the run couldn't clean up; its `runner` is null when the run failed before it started a sandbox. */
@@ -518,3 +518,10 @@ export const outcomes = defineOutcomes({
518
518
  },
519
519
  errors: { ...RUN_ERRORS, ...sandboxesErrors },
520
520
  });
521
+ /**
522
+ * A run canceled before it started, while storm planned it or called its resources' `beforeRun`: nothing was minted,
523
+ * acquired, or started, and the command didn't run.
524
+ */
525
+ export function canceledBeforeStart() {
526
+ return outcomes.canceled({ changed: "The command didn't run.\nNothing was minted, acquired or started." });
527
+ }
@@ -1,67 +1,60 @@
1
- import { type CommandError } from "@vercel/clinkr";
2
1
  import type { StormApp } from "../../context.ts";
3
- import type { CredentialSourceChoice } from "../../credential/index.ts";
4
- import { type ResourceFlagOptions, type SettingsFile } from "../../config/index.ts";
5
- import type { RunTestPlan } from "../../sdk/extension/index.ts";
2
+ import { settleCredential, settleRunResources } from "../../config/index.ts";
6
3
  import type { ResourceLifecycles } from "../../core/index.ts";
7
- import type { PlannedSandboxesRun, PlannedWhere } from "../../planning/run-plan.ts";
8
- /**
9
- * A command's part of planning its run: argv, test plan, optional listed test files, and optional planned runner
10
- * sandboxes.
11
- */
12
- export interface PlannedCommand<TTestPlan extends RunTestPlan> {
13
- readonly ok: true;
14
- readonly argv: readonly string[];
15
- readonly testPlan: TTestPlan;
16
- readonly testFiles?: readonly string[];
17
- readonly sandboxes?: PlannedSandboxesRun;
4
+ import type { DriverRefusals } from "../../planning/driver-refusals.ts";
5
+ import type { RunPlan } from "../../planning/run-plan.ts";
6
+ import { type Driver } from "../../sdk/extension/index.ts";
7
+ import { fileListErrors, sandboxesDefaultErrors, sandboxesErrors } from "./across-sandboxes-outcomes.ts";
8
+ import { type DriverPlanRefusal } from "./driver-plan.ts";
9
+ import { canceledBeforeStart, runErrors } from "./outcomes.ts";
10
+ import { type RunPlanRequest } from "./run-flags.ts";
11
+ /** Planning target for `storm exec`: a direct command argument list with no driver. */
12
+ export interface ExecPlanTarget {
13
+ readonly kind: "exec";
14
+ readonly command: readonly string[];
18
15
  }
19
- /**
20
- * What the config file says to a command's part of planning: whether it plans the tests (`testPlan`) and its path.
21
- */
22
- export interface PlannedSettings {
23
- readonly testPlan: boolean;
24
- readonly configFile: string | null;
16
+ /** Planning target for `storm test`: a driver, its combined arguments, test counting, and driver refusal builders. */
17
+ export interface DriverPlanTarget {
18
+ readonly kind: "driver";
19
+ readonly driver: Driver;
20
+ readonly args: readonly string[];
21
+ readonly countTests: boolean;
22
+ readonly errors: DriverRefusals;
25
23
  }
26
- /**
27
- * A command's part of planning its run, once storm knows where the run runs and before it resolves the resources'
28
- * options: the argv, and what the command counted, which the options' defaults get; or a refusal, which ends the run
29
- * there, with the run's secrets hidden. Nothing is minted, acquired or started yet. Once `signal`, the invocation's,
30
- * aborts, it stops what it started as soon as it can; the run then cancels, whatever it answers.
31
- */
32
- export type PlanCommand<TTestPlan extends RunTestPlan, TRefusal> = (where: PlannedWhere, signal: AbortSignal, settings: PlannedSettings) => Promise<PlannedCommand<TTestPlan> | {
24
+ /** What `planRun` plans: either a direct command (`exec`) or a driver run (`driver`). */
25
+ export type PlanTarget = ExecPlanTarget | DriverPlanTarget;
26
+ type SandboxesMaxRefusal = ReturnType<typeof sandboxesErrors.missingSandboxesMax> | ReturnType<typeof sandboxesErrors.sandboxesOverMax>;
27
+ type FileListRefusal = ReturnType<typeof fileListErrors.fileListsUnreadable> | ReturnType<typeof fileListErrors.invalidFileLists> | ReturnType<typeof fileListErrors.fileListsUnlisted>;
28
+ type SandboxesDefaultRefusal = ReturnType<typeof sandboxesDefaultErrors.sandboxesDefaultRefused>;
29
+ type BasePlanRefusal = ReturnType<typeof runErrors.missingRunner> | ReturnType<typeof runErrors.conflictingOptions> | ReturnType<typeof runErrors.credentialsInvalid> | ReturnType<typeof runErrors.keepSandboxUnsafeSecretEnvVars> | ReturnType<typeof runErrors.unsafeSecretEnvVarsInvalid> | Extract<ReturnType<typeof settleCredential>, {
30
+ readonly ok: false;
31
+ }>["refusal"] | Extract<ReturnType<typeof settleRunResources>, {
32
+ readonly ok: false;
33
+ }>["refusal"] | ReturnType<typeof canceledBeforeStart> | SandboxesMaxRefusal;
34
+ type ExecPlanRefusal = BasePlanRefusal;
35
+ type DriverPlanTargetRefusal = BasePlanRefusal | DriverPlanRefusal | FileListRefusal | SandboxesDefaultRefusal;
36
+ type PlanRefusal = ExecPlanRefusal | DriverPlanTargetRefusal;
37
+ type PlanOutcome<TRefusal> = {
38
+ readonly ok: true;
39
+ readonly planned: RunPlan;
40
+ readonly lifecycles: ResourceLifecycles;
41
+ } | {
33
42
  readonly ok: false;
34
43
  readonly refusal: TRefusal;
35
- }>;
44
+ };
36
45
  /**
37
- * Where a run runs once its resources' `beforeRun` let it go on: on the launch machine, with the
38
- * credential source it chose when one of the run's resources needs the Vercel credential; or in a runner sandbox, as
39
- * planned, whose one mint the resources share.
46
+ * What is wrong with `--sandboxes` or `--file-lists` for `driver` and the run's arguments `args` (the command line's,
47
+ * then the config file's): a driver without file list support (`Driver.fileLists`) takes neither, and a driver with it
48
+ * checks the arguments (`fileLists.validate`). Undefined without either flag, or when the driver takes them.
40
49
  */
41
- export type RunWhere = {
42
- readonly kind: "unsandboxed";
43
- readonly credential: CredentialSourceChoice | undefined;
44
- } | Extract<PlannedWhere, {
45
- readonly kind: "runner";
46
- }>;
47
- /** What `planRun` and `resourcesBeforeRun` read of a run's request. */
48
- export interface PlanRequest {
49
- readonly given: ResourceFlagOptions;
50
- readonly scope?: string | undefined;
51
- readonly project?: string | undefined;
52
- readonly runner?: "launch-machine" | undefined;
53
- readonly showOutput: boolean;
54
- readonly keepSandbox?: string | undefined;
55
- readonly credential?: CredentialSourceChoice["source"] | undefined;
56
- /** `--sandboxes`, on `storm exec` and `storm test`. */
50
+ export declare function driverSandboxesProblem(driver: Driver, args: readonly string[], asks: {
57
51
  readonly sandboxes?: number | undefined;
58
- /** `--file-lists`, on `storm test`. */
59
52
  readonly fileLists?: string | undefined;
60
- /** The effective config file (with any selected suite's runner and resources laid over the top level). */
61
- readonly settingsFile: SettingsFile;
62
- /** The selected suite's name, or null when running the top level or `storm exec`. */
63
- readonly suite: string | null;
64
- }
53
+ }): {
54
+ readonly kind: "unsupported" | "args";
55
+ readonly flag: "--sandboxes" | "--file-lists";
56
+ readonly problem: string;
57
+ } | undefined;
65
58
  /**
66
59
  * Plans a run before anything is minted, acquired, or started, refusing in this order:
67
60
  *
@@ -75,101 +68,16 @@ export interface PlanRequest {
75
68
  * 4. Merges each resource's options once (`settleRunResources`): a required option nothing gives is
76
69
  * `invalid_resource_options`. The merged options, each function default given `NOT_COUNTED`, name each resource's
77
70
  * secrets.
78
- * 5. Asks the command for its part (`planCommand`), with the file's `testPlan`: its argv, and what it counted, or its
79
- * refusal, with the credentials' values and the resources' secrets hidden, from each resource's pure `secrets` over
80
- * the merged options. A signal by then cancels the run (`canceledBeforeStart`).
71
+ * 5. Plans the target (`exec` or `driver`), reading `--file-lists` (`file_lists_unreadable`, `invalid_file_lists`)
72
+ * before checking `runner.sandboxes.max` (`missing_sandboxes_max`, `sandboxes_over_max`), running the driver's plan
73
+ * step when needed, and dealing file lists or applying `runner.sandboxes.default`. Any refusal from target planning
74
+ * hides runner secrets and each resource's pure `secrets` over the merged options. A signal by then cancels the run
75
+ * (`canceledBeforeStart`).
81
76
  * 6. Plans the merged options for the planned run (`plan`), each function default given the planned run once, and runs
82
- * the checks across them: `invalid_resource_options`.
83
- */
84
- export declare function planRun<TTestPlan extends RunTestPlan, TRefusal extends CommandError>(app: StormApp, lifecycles: ResourceLifecycles, request: PlanRequest, planCommand: PlanCommand<TTestPlan, TRefusal>, signal: AbortSignal): Promise<{
85
- readonly ok: false;
86
- readonly refusal: CommandError<"invalid_resource_options">;
87
- } | {
88
- readonly ok: false;
89
- readonly refusal: CommandError<"missing_target">;
90
- } | {
91
- readonly ok: false;
92
- readonly refusal: TRefusal;
93
- } | {
94
- readonly ok: false;
95
- readonly refusal: import("@vercel/clinkr").ClinkrError<"canceled">;
96
- } | {
97
- readonly ok: false;
98
- readonly refusal: CommandError<"conflicting_options">;
99
- } | {
100
- readonly ok: false;
101
- readonly refusal: CommandError<"credentials_invalid">;
102
- } | {
103
- readonly ok: false;
104
- readonly refusal: CommandError<"keep_sandbox_unsafe_secret_env_vars">;
105
- } | {
106
- readonly ok: false;
107
- readonly refusal: CommandError<"missing_runner">;
108
- } | {
109
- readonly ok: false;
110
- readonly refusal: CommandError<"unsafe_secret_env_vars_invalid">;
111
- } | {
112
- readonly ok: true;
113
- readonly configFile: string | null;
114
- readonly settings: import("../../config/resolve.ts").ResolvedSettings;
115
- readonly where: PlannedWhere;
116
- readonly argv: readonly string[];
117
- readonly testPlan: TTestPlan;
118
- readonly testFiles: readonly string[] | undefined;
119
- readonly sandboxes: PlannedSandboxesRun | undefined;
120
- readonly resources: {
121
- readonly [key: string]: import("../../config/resolve.ts").ResolvedResourceRecord;
122
- };
123
- readonly planOptions: Readonly<{
124
- path: string;
125
- value: string | number | boolean;
126
- from: "default" | "file" | "flag";
127
- }>[];
128
- }>;
129
- /** A planned run, as `planRun` answers it. */
130
- export type RunPlan = Extract<Awaited<ReturnType<typeof planRun>>, {
131
- readonly ok: true;
132
- }>;
133
- /**
134
- * Calls each resource's `beforeRun` in registry order, with its options and their sources, then chooses the credential
135
- * source, refusing in this order: a resource's `beforeRun` refusal (`resource_refused_before_run`), with the config
136
- * file beside it, which stops the resources after it from being asked; a `--credential` no used resource needs
137
- * (`credential_unused`); in an unsandboxed run, a used resource that needs a runner sandbox
138
- * (`resource_needs_runner_sandbox`, naming every such resource by its key; a skipped resource never refuses); in an
139
- * unsandboxed run where a used resource needs the Vercel credential, the credential source (`missing_target` for the
140
- * mint). Each refusal ends the command before the run starts, so it leaves no run directory.
141
- */
142
- export declare function resourcesBeforeRun(lifecycles: ResourceLifecycles, plan: RunPlan, request: Pick<PlanRequest, "credential">): Promise<{
143
- readonly ok: false;
144
- readonly refusal: CommandError<"missing_target">;
145
- } | {
146
- readonly ok: false;
147
- readonly refusal: CommandError<"credential_unused">;
148
- } | {
149
- readonly ok: false;
150
- readonly refusal: CommandError<"resource_needs_runner_sandbox">;
151
- } | {
152
- readonly ok: false;
153
- readonly refusal: CommandError<"resource_refused_before_run">;
154
- } | {
155
- readonly ok: true;
156
- readonly where: RunWhere;
157
- readonly used: {
158
- readonly ok: true;
159
- readonly requests: import("../../core/resource.ts").ResourceRequests;
160
- readonly skipped: readonly import("../../core/resource.ts").ResourceSkip[];
161
- readonly secrets: readonly string[];
162
- readonly needsVercelCredential: boolean;
163
- readonly needRunnerSandbox: readonly string[];
164
- readonly hiddenVariables: readonly string[];
165
- };
166
- }>;
167
- /** What the resources' `beforeRun` answered, once they let the run go on. */
168
- export type BeforeRun = Extract<Awaited<ReturnType<typeof resourcesBeforeRun>>, {
169
- readonly ok: true;
170
- }>;
171
- /**
172
- * A run canceled before it started, while storm planned it or called its resources' `beforeRun`: nothing was minted,
173
- * acquired or started, and the command didn't run.
77
+ * the checks across them (`invalid_resource_options`), then refuses `--show-output` when `runner.sandboxes.default`
78
+ * made the run across runner sandboxes (`sandboxes_default_refused`).
174
79
  */
175
- export declare function canceledBeforeStart(): import("@vercel/clinkr").ClinkrError<"canceled">;
80
+ export declare function planRun(app: StormApp, request: RunPlanRequest, target: ExecPlanTarget, signal: AbortSignal): Promise<PlanOutcome<ExecPlanRefusal>>;
81
+ export declare function planRun(app: StormApp, request: RunPlanRequest, target: DriverPlanTarget, signal: AbortSignal): Promise<PlanOutcome<DriverPlanTargetRefusal>>;
82
+ export declare function planRun(app: StormApp, request: RunPlanRequest, target: PlanTarget, signal: AbortSignal): Promise<PlanOutcome<PlanRefusal>>;
83
+ export {};