@cnc-tools/storm 0.15.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application.d.ts +22 -13
- package/dist/application.js +21 -10
- package/dist/bin/run.d.ts +18 -0
- package/dist/bin/run.js +31 -0
- package/dist/bin/storm.js +42 -26
- package/dist/build-info.js +1 -1
- package/dist/chunks/{chunk-5CCP36QQ.js → chunk-2RNDPDTJ.js} +2 -2
- package/dist/chunks/chunk-2VP4GRJM.js +1219 -0
- package/dist/chunks/{chunk-SZEURWRS.js → chunk-4O5C2XGJ.js} +18 -15
- package/dist/chunks/{chunk-VL7WFTVQ.js → chunk-4WAMTUWZ.js} +419 -340
- package/dist/chunks/{chunk-QVS7HRU7.js → chunk-6UHIJXZG.js} +3 -3
- package/dist/chunks/{chunk-CN4EFA5J.js → chunk-72ZFEMAW.js} +1 -1
- package/dist/chunks/{chunk-4U4DZ7VG.js → chunk-7DZE67QM.js} +2 -2
- package/dist/chunks/{chunk-VUPZH7J2.js → chunk-BCBKYOHW.js} +1 -1
- package/dist/chunks/{chunk-QUHY6FGN.js → chunk-CKGZA25H.js} +1 -18
- package/dist/chunks/{chunk-ZG3WQ4UF.js → chunk-D27KILIA.js} +1 -1
- package/dist/chunks/{chunk-KC4KDJ5K.js → chunk-DADEYJDW.js} +174 -153
- package/dist/chunks/{chunk-R7XVBZOY.js → chunk-EEENLQHE.js} +59 -11
- package/dist/chunks/chunk-F4MOYHRY.js +198 -0
- package/dist/chunks/{chunk-CXAT7ZKP.js → chunk-FNBB6V4R.js} +1 -1
- package/dist/chunks/{chunk-OX7X4B2L.js → chunk-GRT3UIBV.js} +18 -1
- package/dist/chunks/chunk-HP3CURSZ.js +88 -0
- package/dist/chunks/{chunk-PN5ULTTH.js → chunk-HWIQ2S7K.js} +5 -5
- package/dist/chunks/chunk-JN3YY6ZH.js +2166 -0
- package/dist/chunks/{chunk-TJNFVNKR.js → chunk-LKTZ5OXS.js} +1 -1
- package/dist/chunks/{chunk-XEVHP5ZW.js → chunk-M7EKRGVD.js} +8 -8
- package/dist/chunks/chunk-MR77L2GK.js +340 -0
- package/dist/chunks/{chunk-L36GBUBB.js → chunk-RNAS7JHE.js} +1755 -522
- package/dist/chunks/{chunk-5GBMR4HM.js → chunk-RWIXDDCK.js} +4 -192
- package/dist/chunks/{chunk-5VXBKPW6.js → chunk-WV3DP6NR.js} +1 -1
- package/dist/chunks/{chunk-AWBSONHB.js → chunk-XBDRVFEV.js} +55 -16
- package/dist/chunks/{chunk-YV7GE6EV.js → chunk-YEPFSLQR.js} +480 -375
- package/dist/chunks/{live-app-PI3BAN6Y.js → live-app-R76JQXZL.js} +15 -13
- package/dist/commands/exec/across-sandboxes-outcomes.d.ts +1 -1
- package/dist/commands/exec/across-sandboxes-outcomes.js +4 -3
- package/dist/commands/exec/before-run.d.ts +123 -0
- package/dist/commands/exec/before-run.js +105 -0
- package/dist/commands/exec/command.d.ts +39 -4
- package/dist/commands/exec/command.js +31 -95
- package/dist/commands/exec/driver-plan.d.ts +9 -4
- package/dist/commands/exec/driver-plan.js +8 -8
- package/dist/commands/exec/exec-words.js +1 -1
- package/dist/commands/exec/execute-run.d.ts +39 -0
- package/dist/commands/exec/execute-run.js +325 -0
- package/dist/commands/exec/live-view.d.ts +3 -3
- package/dist/commands/exec/live-view.js +16 -15
- package/dist/commands/exec/metadata.js +1 -1
- package/dist/commands/exec/mint-failed.d.ts +38 -0
- package/dist/commands/exec/mint-failed.js +27 -4
- package/dist/commands/exec/outcomes.d.ts +38 -9
- package/dist/commands/exec/outcomes.js +32 -25
- package/dist/commands/exec/plan-run.d.ts +58 -150
- package/dist/commands/exec/plan-run.js +232 -88
- package/dist/commands/exec/planned-outcome.js +8 -1
- package/dist/commands/exec/progress.d.ts +10 -6
- package/dist/commands/exec/progress.js +38 -25
- package/dist/commands/exec/run-bin.d.ts +11 -11
- package/dist/commands/exec/run-bin.js +9 -9
- package/dist/commands/exec/run-flags.d.ts +69 -0
- package/dist/commands/exec/run-flags.js +58 -0
- package/dist/commands/exec/run-metadata.js +5 -5
- package/dist/commands/exec/run-summary.d.ts +58 -0
- package/dist/commands/exec/run-summary.js +205 -0
- package/dist/commands/exec/runner-refusals.d.ts +82 -0
- package/dist/commands/exec/runner-refusals.js +71 -0
- package/dist/commands/exec/sandbox-progress.js +3 -0
- package/dist/commands/exec/stopped-outcome.d.ts +12 -0
- package/dist/commands/exec/stopped-outcome.js +77 -0
- package/dist/commands/exec/view.d.ts +20 -11
- package/dist/commands/exec/view.js +103 -47
- package/dist/commands/runs/facts.d.ts +9 -4
- package/dist/commands/runs/facts.js +28 -11
- package/dist/commands/runs/list/command.d.ts +16 -6
- package/dist/commands/runs/list/command.js +10 -10
- package/dist/commands/runs/list/outcomes.d.ts +8 -3
- package/dist/commands/runs/logs/command.d.ts +6 -2
- package/dist/commands/runs/logs/command.js +10 -10
- package/dist/commands/runs/logs/outcomes.d.ts +3 -1
- package/dist/commands/runs/past-run.d.ts +14 -5
- package/dist/commands/runs/past-run.js +16 -5
- package/dist/commands/runs/show/command.d.ts +20 -8
- package/dist/commands/runs/show/command.js +30 -28
- package/dist/commands/runs/show/outcomes.d.ts +10 -4
- package/dist/commands/runs/show/outcomes.js +7 -5
- package/dist/commands/snapshots/access.d.ts +111 -0
- package/dist/commands/snapshots/access.js +96 -0
- package/dist/commands/snapshots/build/command.d.ts +360 -93
- package/dist/commands/snapshots/build/command.js +446 -150
- package/dist/commands/snapshots/build/metadata.d.ts +10 -0
- package/dist/commands/snapshots/build/metadata.js +31 -11
- package/dist/commands/snapshots/build/outcomes.d.ts +234 -43
- package/dist/commands/snapshots/build/outcomes.js +200 -36
- package/dist/commands/snapshots/list/command.d.ts +368 -27
- package/dist/commands/snapshots/list/command.js +296 -66
- package/dist/commands/snapshots/list/metadata.d.ts +16 -0
- package/dist/commands/snapshots/list/metadata.js +29 -6
- package/dist/commands/snapshots/list/outcomes.d.ts +245 -13
- package/dist/commands/snapshots/list/outcomes.js +221 -50
- package/dist/commands/snapshots/metadata.js +1 -1
- package/dist/commands/snapshots/prune/command.d.ts +430 -0
- package/dist/commands/snapshots/prune/command.js +161 -0
- package/dist/commands/snapshots/prune/metadata.d.ts +28 -0
- package/dist/commands/snapshots/prune/metadata.js +39 -0
- package/dist/commands/snapshots/prune/outcomes.d.ts +208 -0
- package/dist/commands/snapshots/prune/outcomes.js +78 -0
- package/dist/commands/suites/list/command.js +19 -18
- package/dist/commands/suites/list/outcomes.js +4 -4
- package/dist/commands/test/command.d.ts +39 -4
- package/dist/commands/test/command.js +50 -255
- package/dist/commands/test/metadata.js +1 -1
- package/dist/commands/test/outcomes.d.ts +19 -2
- package/dist/commands/test/outcomes.js +2 -2
- package/dist/config/check-runner.d.ts +5 -3
- package/dist/config/check-runner.js +33 -7
- package/dist/config/check-suites.js +1 -0
- package/dist/config/credential-resolver.d.ts +50 -5
- package/dist/config/credential-resolver.js +51 -19
- package/dist/config/credential-settle.d.ts +6 -2
- package/dist/config/credential-settle.js +11 -5
- package/dist/config/gateways.d.ts +7 -3
- package/dist/config/index.d.ts +4 -5
- package/dist/config/index.js +3 -4
- package/dist/config/live/config-gateway.js +5 -2
- package/dist/config/load.d.ts +21 -4
- package/dist/config/load.js +129 -15
- package/dist/config/runner.d.ts +7 -8
- package/dist/config/runner.js +1 -1
- package/dist/config/schema.d.ts +17 -5
- package/dist/config/schema.js +11 -3
- package/dist/config/typed-options.d.ts +1 -6
- package/dist/config/typed-options.js +2 -10
- package/dist/config-file/define.d.ts +1 -11
- package/dist/config-file/define.js +3 -3
- package/dist/config-file/runner.d.ts +5 -6
- package/dist/config-file/toolchain.d.ts +13 -7
- package/dist/config-file/toolchain.js +53 -37
- package/dist/context.d.ts +8 -6
- package/dist/context.js +7 -6
- package/dist/core/across-sandboxes.d.ts +7 -6
- package/dist/core/across-sandboxes.js +123 -152
- package/dist/core/coordinator.d.ts +166 -0
- package/dist/core/coordinator.js +233 -0
- package/dist/core/events.d.ts +2 -2
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.js +1 -1
- package/dist/core/outcomes.d.ts +148 -0
- package/dist/core/{sandbox-end.js → outcomes.js} +28 -4
- package/dist/core/resources.d.ts +31 -53
- package/dist/core/resources.js +32 -70
- package/dist/core/run-state.d.ts +7 -1
- package/dist/core/run-state.js +2 -0
- package/dist/core/run.d.ts +32 -236
- package/dist/core/run.js +106 -266
- package/dist/core/state-directory.d.ts +1 -1
- package/dist/core/state-directory.js +2 -2
- package/dist/credential/gateways.d.ts +15 -1
- package/dist/credential/index.d.ts +4 -3
- package/dist/credential/index.js +3 -2
- package/dist/credential/live/vercel-cli-gateway.d.ts +1 -1
- package/dist/credential/live/vercel-cli-gateway.js +1 -1
- package/dist/credential/live/vercel-oidc-token-gateway.d.ts +11 -0
- package/dist/credential/live/vercel-oidc-token-gateway.js +16 -0
- package/dist/credential/source.d.ts +73 -6
- package/dist/credential/source.js +55 -2
- package/dist/extension-commands.d.ts +6 -1
- package/dist/extension-commands.js +15 -1
- package/dist/extensions/github/resource.d.ts +1 -1
- package/dist/extensions/github/resource.js +1 -1
- package/dist/extensions/testserver/commands/pool/create/command.d.ts +35 -2
- package/dist/extensions/testserver/commands/pool/create/command.js +7 -7
- package/dist/extensions/testserver/commands/pool/create/metadata.js +5 -5
- package/dist/extensions/testserver/commands/pool/create/outcomes.d.ts +17 -1
- package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
- package/dist/extensions/testserver/credential-facts.d.ts +6 -2
- package/dist/extensions/testserver/credential-facts.js +29 -11
- package/dist/extensions/testserver/lifecycle.js +7 -1
- package/dist/extensions/testserver/limit.d.ts +3 -0
- package/dist/extensions/testserver/limit.js +3 -0
- package/dist/extensions/testserver/provision.d.ts +8 -1
- package/dist/extensions/testserver/provision.js +8 -3
- package/dist/extensions/testserver/refusals.d.ts +6 -1
- package/dist/extensions/testserver/refusals.js +16 -1
- package/dist/extensions/testserver/resource.d.ts +2 -2
- package/dist/extensions/testserver/resource.js +2 -2
- package/dist/extensions/testserver/result.d.ts +1 -1
- package/dist/extensions/testserver/result.js +9 -4
- package/dist/planning/driver-file-lists.d.ts +0 -15
- package/dist/planning/driver-file-lists.js +2 -21
- package/dist/planning/plan-only.d.ts +7 -15
- package/dist/planning/plan-only.js +16 -22
- package/dist/planning/run-kind-flags.js +2 -2
- package/dist/planning/run-plan.d.ts +45 -13
- package/dist/planning/run-plan.js +4 -3
- package/dist/planning/suites.d.ts +1 -1
- package/dist/planning/suites.js +2 -2
- package/dist/planning/test-plan.d.ts +9 -0
- package/dist/planning/test-plan.js +10 -2
- package/dist/run-directory/recording.js +2 -2
- package/dist/run-directory/run-record.d.ts +21 -6
- package/dist/run-directory/run-record.js +12 -9
- package/dist/runner/base.d.ts +0 -6
- package/dist/runner/base.js +1 -16
- package/dist/runner/build-snapshots.d.ts +55 -29
- package/dist/runner/build-snapshots.js +135 -35
- package/dist/runner/context.d.ts +15 -7
- package/dist/runner/context.js +19 -6
- package/dist/runner/events.d.ts +16 -10
- package/dist/runner/gateways.d.ts +92 -21
- package/dist/runner/gateways.js +1 -1
- package/dist/runner/index.d.ts +11 -7
- package/dist/runner/index.js +9 -4
- package/dist/runner/live/sandbox-errors.d.ts +2 -0
- package/dist/runner/live/sandbox-errors.js +4 -0
- package/dist/runner/live/sandbox-gateway.js +141 -3
- package/dist/runner/live/snapshot-index-gateway.d.ts +12 -0
- package/dist/runner/live/{snapshot-cache-gateway.js → snapshot-index-gateway.js} +11 -11
- package/dist/runner/live/snapshot-records.js +6 -7
- package/dist/runner/local-snapshot-index.d.ts +199 -0
- package/dist/runner/local-snapshot-index.js +211 -0
- package/dist/runner/network-policy.d.ts +6 -6
- package/dist/runner/network-policy.js +7 -7
- package/dist/runner/policy-writes.d.ts +1 -1
- package/dist/runner/policy-writes.js +1 -1
- package/dist/runner/prepare.d.ts +25 -24
- package/dist/runner/prepare.js +28 -20
- package/dist/runner/ready.d.ts +18 -10
- package/dist/runner/ready.js +104 -33
- package/dist/runner/sandboxed-command.d.ts +3 -3
- package/dist/runner/sandboxed-command.js +3 -3
- package/dist/runner/scope.d.ts +10 -6
- package/dist/runner/scope.js +10 -3
- package/dist/runner/secrets.d.ts +13 -13
- package/dist/runner/secrets.js +18 -15
- package/dist/runner/session.d.ts +8 -8
- package/dist/runner/session.js +3 -3
- package/dist/runner/shared-snapshot-entry.d.ts +92 -0
- package/dist/runner/shared-snapshot-entry.js +168 -0
- package/dist/runner/shared-snapshot-list.d.ts +81 -0
- package/dist/runner/shared-snapshot-list.js +155 -0
- package/dist/runner/shared-snapshot-lookup.d.ts +51 -0
- package/dist/runner/shared-snapshot-lookup.js +118 -0
- package/dist/runner/shared-snapshot-prune.d.ts +58 -0
- package/dist/runner/shared-snapshot-prune.js +133 -0
- package/dist/runner/snapshot-build.d.ts +42 -14
- package/dist/runner/snapshot-build.js +38 -28
- package/dist/runner/snapshot-choice.js +1 -1
- package/dist/runner/snapshot-inspect.d.ts +39 -40
- package/dist/runner/snapshot-inspect.js +58 -38
- package/dist/runner/snapshot-key.d.ts +30 -21
- package/dist/runner/snapshot-key.js +49 -29
- package/dist/runner/steps.d.ts +1 -1
- package/dist/runner/steps.js +1 -1
- package/dist/runner/{recipe-check.d.ts → vercel-sandbox-check.d.ts} +2 -2
- package/dist/runner/{recipe-check.js → vercel-sandbox-check.js} +3 -2
- package/dist/runner/{recipe.d.ts → vercel-sandbox-options.d.ts} +82 -82
- package/dist/runner/vercel-sandbox-options.js +510 -0
- package/dist/runner/{recipe-secrets.d.ts → vercel-sandbox-secrets.d.ts} +6 -6
- package/dist/runner/{recipe-secrets.js → vercel-sandbox-secrets.js} +20 -20
- package/dist/sdk/extension/commands.d.ts +8 -3
- package/dist/sdk/extension/commands.js +3 -1
- package/dist/sdk/extension/credential-diagnosis.d.ts +3 -1
- package/dist/sdk/extension/credential-diagnosis.js +25 -5
- package/dist/sdk/extension/credential-source.d.ts +20 -3
- package/dist/sdk/extension/credential-source.js +4 -4
- package/dist/sdk/extension/index.d.ts +3 -2
- package/dist/sdk/extension/index.js +2 -1
- package/dist/sdk/extension/resource-definition.d.ts +4 -3
- package/dist/sdk/extension/resource-definition.js +3 -2
- package/dist/sdk/extension/resource-factory.js +3 -4
- package/dist/sdk/extension/secret-source.d.ts +1 -1
- package/dist/sdk/extension/secret-source.js +1 -1
- package/dist/sdk/extension/vercel-oidc-facts.d.ts +20 -0
- package/dist/sdk/extension/vercel-oidc-facts.js +20 -0
- package/dist/sdk/run/present.d.ts +3 -3
- package/dist/sdk/run/present.js +1 -3
- package/dist/shared/cleanup.d.ts +3 -3
- package/dist/shared/cleanup.js +15 -5
- package/dist/shared/snapshot-text.d.ts +4 -4
- package/dist/shared/snapshot-text.js +11 -11
- package/dist/time/duration.js +1 -1
- package/package.json +3 -2
- package/skills/overview.md +6 -4
- package/skills/plan-runs.md +2 -2
- package/skills/read-run-output.md +6 -6
- package/dist/chunks/chunk-E4PJNZVG.js +0 -783
- package/dist/chunks/chunk-RAQEXKL6.js +0 -2591
- package/dist/commands/exec/across-sandboxes-run.d.ts +0 -180
- package/dist/commands/exec/across-sandboxes-run.js +0 -339
- package/dist/commands/exec/plan-only.d.ts +0 -10
- package/dist/commands/exec/plan-only.js +0 -46
- package/dist/commands/exec/run-command.d.ts +0 -476
- package/dist/commands/exec/run-command.js +0 -604
- package/dist/commands/exec/run-planned.d.ts +0 -20
- package/dist/commands/exec/run-planned.js +0 -22
- package/dist/commands/exec/sandbox-view.d.ts +0 -19
- package/dist/commands/exec/sandbox-view.js +0 -72
- package/dist/commands/test/plan.d.ts +0 -92
- package/dist/commands/test/plan.js +0 -128
- package/dist/config/recipe-run.d.ts +0 -33
- package/dist/config/recipe-run.js +0 -28
- package/dist/core/sandbox-end.d.ts +0 -64
- package/dist/runner/live/snapshot-cache-gateway.d.ts +0 -12
- package/dist/runner/recipe.js +0 -425
- package/dist/runner/snapshot-cache.d.ts +0 -148
- 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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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;
|
|
@@ -900,7 +907,10 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
900
907
|
testFiles: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
901
908
|
runnerSandboxes: z.ZodNullable<z.ZodObject<{
|
|
902
909
|
max: z.ZodNumber;
|
|
903
|
-
default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.
|
|
910
|
+
default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
911
|
+
filesPerSandbox: z.ZodNumber;
|
|
912
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
913
|
+
}, z.core.$strip>]>>;
|
|
904
914
|
}, z.core.$strip>>;
|
|
905
915
|
sandboxes: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
906
916
|
sandbox: z.ZodNumber;
|
|
@@ -1073,6 +1083,13 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
1073
1083
|
minLength: number;
|
|
1074
1084
|
configFile: string | null;
|
|
1075
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
|
+
}]>;
|
|
1076
1093
|
}, {
|
|
1077
1094
|
readonly conflictingOptions: import("@vercel/clinkr").SharedError<"conflicting_options", [data: {
|
|
1078
1095
|
conflicts: {
|
|
@@ -1224,4 +1241,16 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
1224
1241
|
minLength: number;
|
|
1225
1242
|
configFile: string | null;
|
|
1226
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
|
+
}]>;
|
|
1227
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">;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineErrors, defineOutcomes, renderOutcome } from "@vercel/clinkr";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { DEFINITION_SET } from "../../extensions.js";
|
|
4
|
-
import { configErrors, credentialErrors } from "../../config/index.js";
|
|
4
|
+
import { CONFIG_FILE_NAMES_TEXT, configErrors, credentialErrors } from "../../config/index.js";
|
|
5
5
|
import { keptText, RUN_CLEANUP, runnerCleanupWarnings } from "../../shared/cleanup.js";
|
|
6
6
|
import { noFinalResultsContent } from "../../planning/final-results.js";
|
|
7
7
|
import { plannedSchema } from "../../planning/plan-only.js";
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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()),
|
|
@@ -320,7 +320,7 @@ export const runErrors = defineErrors({
|
|
|
320
320
|
}),
|
|
321
321
|
render: ({ configFile }) => ({
|
|
322
322
|
message: configFile === null
|
|
323
|
-
?
|
|
323
|
+
? `No runner is declared, and no ${CONFIG_FILE_NAMES_TEXT} applies.`
|
|
324
324
|
: `No runner is declared in ${configFile}.`,
|
|
325
325
|
next: [
|
|
326
326
|
{
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
readonly
|
|
24
|
-
readonly
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
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
|
|
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
|
-
|
|
61
|
-
readonly
|
|
62
|
-
|
|
63
|
-
readonly
|
|
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.
|
|
79
|
-
*
|
|
80
|
-
*
|
|
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
|
|
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
|
|
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 {};
|