@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
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
RESOURCES,
|
|
4
4
|
liveDriverContexts,
|
|
5
5
|
liveResourceContexts
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-HWIQ2S7K.js";
|
|
7
|
+
import "./chunk-EEENLQHE.js";
|
|
8
|
+
import "./chunk-72ZFEMAW.js";
|
|
9
|
+
import "./chunk-D27KILIA.js";
|
|
10
|
+
import "./chunk-2RNDPDTJ.js";
|
|
11
11
|
import {
|
|
12
12
|
RUNS_SUBPATH,
|
|
13
13
|
liveRunDirectoryGateway,
|
|
14
14
|
unavailableRunDirectoryGateway
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4O5C2XGJ.js";
|
|
16
16
|
import {
|
|
17
17
|
liveCommandGateway,
|
|
18
18
|
liveJobSummaryGateway,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
liveProgressTerminal,
|
|
21
21
|
resolveStateDirectory,
|
|
22
22
|
stateDirectoryPattern
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-YEPFSLQR.js";
|
|
24
24
|
import {
|
|
25
25
|
RUNNER_SNAPSHOTS_SUBPATH,
|
|
26
26
|
configResolver,
|
|
@@ -31,17 +31,18 @@ import {
|
|
|
31
31
|
liveFileListsFileGateway,
|
|
32
32
|
liveGitHubActionsTokenGateway,
|
|
33
33
|
liveRunnerSandboxGateway,
|
|
34
|
-
|
|
34
|
+
liveRunnerSnapshotIndexGateway,
|
|
35
35
|
liveRunnerTerminal,
|
|
36
|
+
liveVercelOidcTokenGateway,
|
|
36
37
|
localUserName,
|
|
37
38
|
systemClock,
|
|
38
39
|
systemTimer,
|
|
39
|
-
|
|
40
|
-
} from "./chunk-
|
|
41
|
-
import "./chunk-
|
|
40
|
+
unavailableRunnerSnapshotIndexGateway
|
|
41
|
+
} from "./chunk-RNAS7JHE.js";
|
|
42
|
+
import "./chunk-XBDRVFEV.js";
|
|
42
43
|
import {
|
|
43
44
|
resolveColorDepth
|
|
44
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-4WAMTUWZ.js";
|
|
45
46
|
|
|
46
47
|
// src/local-services.ts
|
|
47
48
|
import { parse } from "node:path";
|
|
@@ -75,11 +76,12 @@ function liveContext(options) {
|
|
|
75
76
|
return {
|
|
76
77
|
credentials: liveCredentialGateway(),
|
|
77
78
|
githubActionsTokens: liveGitHubActionsTokenGateway({ env: options.env, timeoutMs: 1e4 }),
|
|
79
|
+
vercelOidcTokens: liveVercelOidcTokenGateway({ env: options.env }),
|
|
78
80
|
commands: liveCommandGateway(),
|
|
79
81
|
config: liveConfigGateway(),
|
|
80
82
|
fileListsFiles: liveFileListsFileGateway(),
|
|
81
83
|
checkout: liveCheckoutGateway(),
|
|
82
|
-
runnerSnapshots: snapshots.ok ?
|
|
84
|
+
runnerSnapshots: snapshots.ok ? liveRunnerSnapshotIndexGateway({ directory: snapshots.directory }) : unavailableRunnerSnapshotIndexGateway(stateDirectoryPattern(RUNNER_SNAPSHOTS_SUBPATH), snapshots.reason),
|
|
83
85
|
runnerSandboxes: liveRunnerSandboxGateway(),
|
|
84
86
|
runnerTerminal: liveRunnerTerminal({
|
|
85
87
|
env: options.env,
|
|
@@ -99,7 +99,7 @@ export declare const sandboxesRanSchema: z.ZodObject<{
|
|
|
99
99
|
sandbox: z.ZodNumber;
|
|
100
100
|
name: z.ZodString;
|
|
101
101
|
stopsAt: z.ZodString;
|
|
102
|
-
url: z.ZodString
|
|
102
|
+
url: z.ZodNullable<z.ZodString>;
|
|
103
103
|
}, z.core.$strip>>;
|
|
104
104
|
notKept: z.ZodArray<z.ZodObject<{
|
|
105
105
|
sandbox: z.ZodNumber;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// `invalid_file_lists`, `file_lists_unlisted`).
|
|
4
4
|
import { defineErrors, renderOutcome } from "@vercel/clinkr";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
+
import { CONFIG_FILE_NAMES_TEXT } from "../../config/index.js";
|
|
6
7
|
import { DEFINITION_SET } from "../../extensions.js";
|
|
7
8
|
import { noFinalResultsContent } from "../../planning/final-results.js";
|
|
8
9
|
import { fileListsProblemText } from "../../planning/file-lists-file.js";
|
|
@@ -15,7 +16,7 @@ const keptSandboxSchema = z.object({
|
|
|
15
16
|
sandbox: z.number(),
|
|
16
17
|
name: z.string(),
|
|
17
18
|
stopsAt: z.string(),
|
|
18
|
-
url: z.string(),
|
|
19
|
+
url: z.string().nullable(),
|
|
19
20
|
});
|
|
20
21
|
const notKeptSandboxSchema = z.object({ sandbox: z.number(), name: z.string(), message: z.string() });
|
|
21
22
|
/**
|
|
@@ -77,7 +78,7 @@ export function renderSandboxesRan(ran, options = {}) {
|
|
|
77
78
|
})),
|
|
78
79
|
...noFinal.warnings,
|
|
79
80
|
];
|
|
80
|
-
const kept = ran.kept.map(({ sandbox, name, stopsAt, url }) => `Kept runner sandbox ${sandbox}, ${name}, running until ${isoSecondsText(stopsAt)}, so you can connect to it: ${url}`);
|
|
81
|
+
const kept = ran.kept.map(({ sandbox, name, stopsAt, url }) => `Kept runner sandbox ${sandbox}, ${name}, running until ${isoSecondsText(stopsAt)}, so you can connect to it${url === null ? "" : `: ${url}`}`);
|
|
81
82
|
return renderOutcome({
|
|
82
83
|
...(kept.length === 0 ? {} : { message: kept.join("\n") }),
|
|
83
84
|
...(warnings.length === 0 ? {} : { warnings }),
|
|
@@ -107,7 +108,7 @@ export const sandboxesErrors = defineErrors({
|
|
|
107
108
|
configFile: z.string().nullable(),
|
|
108
109
|
}),
|
|
109
110
|
render: ({ flag, configFile }) => ({
|
|
110
|
-
message: `${flag} needs runner.sandboxes in storm.config.ts, and ${configFile
|
|
111
|
+
message: `${flag} needs runner.sandboxes in storm.config.ts, and ${configFile === null ? `no ${CONFIG_FILE_NAMES_TEXT} applies` : `${configFile} has none`}. The run didn't start.`,
|
|
111
112
|
next: [
|
|
112
113
|
{
|
|
113
114
|
type: "text",
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { type ExecutionContext } from "@vercel/clinkr";
|
|
2
|
+
import type { StormApp } from "../../context.ts";
|
|
3
|
+
import type { CredentialSourceChoice } from "../../credential/index.ts";
|
|
4
|
+
import type { ResourceLifecycles } from "../../core/index.ts";
|
|
5
|
+
import type { RunPlan, VercelSandboxPlannedRunner } from "../../planning/run-plan.ts";
|
|
6
|
+
import type { TestPlanFacts } from "../../run-directory/index.ts";
|
|
7
|
+
import { type CheckedVercelSandboxOptions } from "../../runner/index.ts";
|
|
8
|
+
import type { RunCommandRequest } from "./run-flags.ts";
|
|
9
|
+
/**
|
|
10
|
+
* Resolved runner once the run's resources' `beforeRun` let it go on: on the launch machine, with the credential source
|
|
11
|
+
* it chose when a resource needs the Vercel credential; or in a Vercel Sandbox, whose one mint the resources share.
|
|
12
|
+
*/
|
|
13
|
+
export type ResolvedRunRunner = {
|
|
14
|
+
readonly kind: "launch-machine";
|
|
15
|
+
readonly credential: CredentialSourceChoice | undefined;
|
|
16
|
+
} | VercelSandboxPlannedRunner;
|
|
17
|
+
/**
|
|
18
|
+
* Calls each resource's `beforeRun` in registry order, with its options and their sources, then chooses the credential
|
|
19
|
+
* source, refusing in order: a resource's `beforeRun` refusal (`resource_refused_before_run`), with the config file
|
|
20
|
+
* beside it, which stops the resources after it from being asked; a `--credential` no used resource needs
|
|
21
|
+
* (`credential_unused`); on the launch machine, a used resource that needs a runner sandbox
|
|
22
|
+
* (`resource_needs_runner_sandbox`, naming every such resource by its key; a skipped resource never refuses); and on
|
|
23
|
+
* the launch machine where a used resource needs the Vercel credential, the credential source (`missing_target` for
|
|
24
|
+
* the mint). Each refusal ends the command before the run starts, so it leaves no run directory.
|
|
25
|
+
*/
|
|
26
|
+
export declare function resourcesBeforeRun(lifecycles: ResourceLifecycles, plan: RunPlan, request: Pick<RunCommandRequest, "credential">): Promise<{
|
|
27
|
+
readonly ok: false;
|
|
28
|
+
readonly refusal: import("@vercel/clinkr").CommandError<"missing_target">;
|
|
29
|
+
} | {
|
|
30
|
+
readonly ok: false;
|
|
31
|
+
readonly refusal: import("@vercel/clinkr").CommandError<"credential_unused">;
|
|
32
|
+
} | {
|
|
33
|
+
readonly ok: false;
|
|
34
|
+
readonly refusal: import("@vercel/clinkr").CommandError<"resource_needs_runner_sandbox">;
|
|
35
|
+
} | {
|
|
36
|
+
readonly ok: false;
|
|
37
|
+
readonly refusal: import("@vercel/clinkr").CommandError<"resource_refused_before_run">;
|
|
38
|
+
} | {
|
|
39
|
+
readonly ok: true;
|
|
40
|
+
readonly runner: ResolvedRunRunner;
|
|
41
|
+
readonly used: {
|
|
42
|
+
readonly ok: true;
|
|
43
|
+
readonly requests: import("../../core/resource.ts").ResourceRequests;
|
|
44
|
+
readonly skipped: readonly import("../../core/resource.ts").ResourceSkip[];
|
|
45
|
+
readonly secrets: readonly string[];
|
|
46
|
+
readonly needsVercelCredential: boolean;
|
|
47
|
+
readonly needRunnerSandbox: readonly string[];
|
|
48
|
+
readonly hiddenVariables: readonly string[];
|
|
49
|
+
};
|
|
50
|
+
}>;
|
|
51
|
+
/** What the resources' `beforeRun` answered, once they let the run go on. */
|
|
52
|
+
export type BeforeRun = Extract<Awaited<ReturnType<typeof resourcesBeforeRun>>, {
|
|
53
|
+
readonly ok: true;
|
|
54
|
+
}>;
|
|
55
|
+
/**
|
|
56
|
+
* Keep time of each runner sandbox, in milliseconds:
|
|
57
|
+
* - `"single"`: `--keep-sandbox`, else `runner.keepSandbox`, else 0.
|
|
58
|
+
* - `"sandboxes"`: `--keep-sandbox`, else 0 (multi-sandbox runs intentionally ignore `runner.keepSandbox`).
|
|
59
|
+
*/
|
|
60
|
+
export declare function resolveKeepMs(flag: string | undefined, options: CheckedVercelSandboxOptions, mode: "single" | "sandboxes"): number;
|
|
61
|
+
/**
|
|
62
|
+
* Runs `prepareRunner` for a Vercel Sandbox runner and redacts any preparation refusal with `secrets`. Shared by
|
|
63
|
+
* `--plan-only`, single-run execution, and multi-sandbox execution.
|
|
64
|
+
*/
|
|
65
|
+
export declare function prepareRunnerForRun(app: StormApp, runner: VercelSandboxPlannedRunner, input: {
|
|
66
|
+
readonly configFile: string | null;
|
|
67
|
+
readonly resources: Readonly<Record<string, {
|
|
68
|
+
readonly definition: string;
|
|
69
|
+
readonly options: unknown;
|
|
70
|
+
}>>;
|
|
71
|
+
readonly sandboxes: number;
|
|
72
|
+
readonly secrets: readonly string[];
|
|
73
|
+
}): Promise<{
|
|
74
|
+
readonly ok: true;
|
|
75
|
+
readonly prepared: import("../../runner/prepare.ts").PreparedRunner;
|
|
76
|
+
readonly refusal?: never;
|
|
77
|
+
} | {
|
|
78
|
+
readonly prepared?: never;
|
|
79
|
+
readonly ok: false;
|
|
80
|
+
readonly refusal: import("@vercel/clinkr").CommandError<"invalid_config"> | import("@vercel/clinkr").CommandError<"no_base_ref"> | import("@vercel/clinkr").CommandError<"runner_failed"> | import("@vercel/clinkr").CommandError<"submodules_refused">;
|
|
81
|
+
}>;
|
|
82
|
+
/** Shared pre-start sequence: `resourcesBeforeRun`, signal cancel check, and test-plan progress line. */
|
|
83
|
+
export declare function beforeRunStarts({ ui, signal }: ExecutionContext<StormApp>, lifecycles: ResourceLifecycles, planned: RunPlan, request: Pick<RunCommandRequest, "credential">, plan: TestPlanFacts | undefined): Promise<{
|
|
84
|
+
readonly ok: false;
|
|
85
|
+
readonly refusal: import("@vercel/clinkr").CommandError<"missing_target">;
|
|
86
|
+
} | {
|
|
87
|
+
readonly ok: false;
|
|
88
|
+
readonly refusal: import("@vercel/clinkr").CommandError<"credential_unused">;
|
|
89
|
+
} | {
|
|
90
|
+
readonly ok: false;
|
|
91
|
+
readonly refusal: import("@vercel/clinkr").CommandError<"resource_needs_runner_sandbox">;
|
|
92
|
+
} | {
|
|
93
|
+
readonly ok: false;
|
|
94
|
+
readonly refusal: import("@vercel/clinkr").CommandError<"resource_refused_before_run">;
|
|
95
|
+
} | {
|
|
96
|
+
readonly ok: true;
|
|
97
|
+
readonly runner: ResolvedRunRunner;
|
|
98
|
+
readonly used: {
|
|
99
|
+
readonly ok: true;
|
|
100
|
+
readonly requests: import("../../core/resource.ts").ResourceRequests;
|
|
101
|
+
readonly skipped: readonly import("../../core/resource.ts").ResourceSkip[];
|
|
102
|
+
readonly secrets: readonly string[];
|
|
103
|
+
readonly needsVercelCredential: boolean;
|
|
104
|
+
readonly needRunnerSandbox: readonly string[];
|
|
105
|
+
readonly hiddenVariables: readonly string[];
|
|
106
|
+
};
|
|
107
|
+
} | {
|
|
108
|
+
readonly ok: false;
|
|
109
|
+
readonly refusal: import("@vercel/clinkr").ClinkrError<"canceled">;
|
|
110
|
+
}>;
|
|
111
|
+
/** Builds a `RunRunnerRequest` from a prepared Vercel Sandbox runner. */
|
|
112
|
+
export declare function runnerRequestFor(app: StormApp, runner: VercelSandboxPlannedRunner, used: BeforeRun["used"], options: {
|
|
113
|
+
readonly configFile: string | null;
|
|
114
|
+
readonly sandboxes: number;
|
|
115
|
+
readonly keepMs: number;
|
|
116
|
+
}): Promise<{
|
|
117
|
+
readonly prepared?: never;
|
|
118
|
+
readonly ok: false;
|
|
119
|
+
readonly refusal: import("@vercel/clinkr").CommandError<"invalid_config"> | import("@vercel/clinkr").CommandError<"no_base_ref"> | import("@vercel/clinkr").CommandError<"runner_failed"> | import("@vercel/clinkr").CommandError<"submodules_refused">;
|
|
120
|
+
} | {
|
|
121
|
+
readonly ok: true;
|
|
122
|
+
readonly runner: import("../../runner/session.ts").RunnerSessionRequest;
|
|
123
|
+
}>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Pre-start resource checks and Vercel Sandbox runner preparation shared by `--plan-only`, single runs, and runs
|
|
2
|
+
// across runner sandboxes: calling each resource's `beforeRun`, settling the launch-machine credential source,
|
|
3
|
+
// resolving runner keep time, and running redacted `prepareRunner`.
|
|
4
|
+
import { refused } from "@vercel/clinkr";
|
|
5
|
+
import { settleCredential } from "../../config/index.js";
|
|
6
|
+
import { redactor, redactStrings } from "../../planning/redaction.js";
|
|
7
|
+
import { testPlanLine } from "../../planning/test-plan.js";
|
|
8
|
+
import { prepareRunner } from "../../runner/index.js";
|
|
9
|
+
import { parseKeepTime } from "../../time/index.js";
|
|
10
|
+
import { canceledBeforeStart, runErrors } from "./outcomes.js";
|
|
11
|
+
import { resourceRefusedBeforeRun } from "./resource-refusals.js";
|
|
12
|
+
import { prepareRefusal, vcpuResources } from "./runner-refusals.js";
|
|
13
|
+
/**
|
|
14
|
+
* Calls each resource's `beforeRun` in registry order, with its options and their sources, then chooses the credential
|
|
15
|
+
* source, refusing in order: a resource's `beforeRun` refusal (`resource_refused_before_run`), with the config file
|
|
16
|
+
* beside it, which stops the resources after it from being asked; a `--credential` no used resource needs
|
|
17
|
+
* (`credential_unused`); on the launch machine, a used resource that needs a runner sandbox
|
|
18
|
+
* (`resource_needs_runner_sandbox`, naming every such resource by its key; a skipped resource never refuses); and on
|
|
19
|
+
* the launch machine where a used resource needs the Vercel credential, the credential source (`missing_target` for
|
|
20
|
+
* the mint). Each refusal ends the command before the run starts, so it leaves no run directory.
|
|
21
|
+
*/
|
|
22
|
+
export async function resourcesBeforeRun(lifecycles, plan, request) {
|
|
23
|
+
const { configFile, resources, settings } = plan;
|
|
24
|
+
const used = await lifecycles.beforeRun(resources);
|
|
25
|
+
if (!used.ok)
|
|
26
|
+
return refused(resourceRefusedBeforeRun(used.resource, used.refusal, configFile));
|
|
27
|
+
if (plan.runner.kind === "launch-machine" && request.credential !== undefined && !used.needsVercelCredential)
|
|
28
|
+
return refused(runErrors.credentialUnused({ flags: ["--credential"], configFile }));
|
|
29
|
+
if (plan.runner.kind === "launch-machine" && used.needRunnerSandbox.length > 0)
|
|
30
|
+
return refused(runErrors.resourceNeedsRunnerSandbox({ resources: [...used.needRunnerSandbox], configFile }));
|
|
31
|
+
let runner;
|
|
32
|
+
if (plan.runner.kind === "vercel-sandbox")
|
|
33
|
+
runner = plan.runner;
|
|
34
|
+
else if (used.needsVercelCredential) {
|
|
35
|
+
const chosen = settleCredential(request.credential ?? "mint", settings.scope, settings.project);
|
|
36
|
+
if (!chosen.ok)
|
|
37
|
+
return chosen;
|
|
38
|
+
runner = { kind: "launch-machine", credential: chosen.credential };
|
|
39
|
+
}
|
|
40
|
+
else
|
|
41
|
+
runner = { kind: "launch-machine", credential: undefined };
|
|
42
|
+
return { ok: true, runner, used };
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Keep time of each runner sandbox, in milliseconds:
|
|
46
|
+
* - `"single"`: `--keep-sandbox`, else `runner.keepSandbox`, else 0.
|
|
47
|
+
* - `"sandboxes"`: `--keep-sandbox`, else 0 (multi-sandbox runs intentionally ignore `runner.keepSandbox`).
|
|
48
|
+
*/
|
|
49
|
+
export function resolveKeepMs(flag, options, mode) {
|
|
50
|
+
const fromFlag = flag === undefined ? undefined : parseKeepTime(flag);
|
|
51
|
+
const minutes = mode === "single" ? (fromFlag ?? options.keepSandboxMinutes ?? 0) : (fromFlag ?? 0);
|
|
52
|
+
return minutes * 60_000;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Runs `prepareRunner` for a Vercel Sandbox runner and redacts any preparation refusal with `secrets`. Shared by
|
|
56
|
+
* `--plan-only`, single-run execution, and multi-sandbox execution.
|
|
57
|
+
*/
|
|
58
|
+
export async function prepareRunnerForRun(app, runner, input) {
|
|
59
|
+
const prepared = await prepareRunner(app.context, {
|
|
60
|
+
cwd: app.cwd,
|
|
61
|
+
options: runner.options,
|
|
62
|
+
vcpuRun: { resources: vcpuResources(input.resources), sandboxes: input.sandboxes },
|
|
63
|
+
});
|
|
64
|
+
if (prepared.kind === "ok")
|
|
65
|
+
return { ok: true, prepared: prepared.prepared };
|
|
66
|
+
const refusal = prepareRefusal(prepared, input.configFile);
|
|
67
|
+
return {
|
|
68
|
+
ok: false,
|
|
69
|
+
refusal: input.secrets.length === 0 ? refusal : redactStrings(refusal, redactor(input.secrets)),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/** Shared pre-start sequence: `resourcesBeforeRun`, signal cancel check, and test-plan progress line. */
|
|
73
|
+
export async function beforeRunStarts({ ui, signal }, lifecycles, planned, request, plan) {
|
|
74
|
+
const before = await resourcesBeforeRun(lifecycles, planned, request);
|
|
75
|
+
if (!before.ok)
|
|
76
|
+
return before;
|
|
77
|
+
if (signal.aborted)
|
|
78
|
+
return { ok: false, refusal: canceledBeforeStart() };
|
|
79
|
+
if (plan !== undefined)
|
|
80
|
+
await ui.progress?.(testPlanLine(plan));
|
|
81
|
+
return before;
|
|
82
|
+
}
|
|
83
|
+
/** Builds a `RunRunnerRequest` from a prepared Vercel Sandbox runner. */
|
|
84
|
+
export async function runnerRequestFor(app, runner, used, options) {
|
|
85
|
+
const secrets = [...used.secrets, ...runner.secrets];
|
|
86
|
+
const prepared = await prepareRunnerForRun(app, runner, {
|
|
87
|
+
configFile: options.configFile,
|
|
88
|
+
resources: used.requests,
|
|
89
|
+
sandboxes: options.sandboxes,
|
|
90
|
+
secrets,
|
|
91
|
+
});
|
|
92
|
+
if (!prepared.ok)
|
|
93
|
+
return prepared;
|
|
94
|
+
const session = {
|
|
95
|
+
prepared: prepared.prepared,
|
|
96
|
+
target: runner.target,
|
|
97
|
+
user: app.user,
|
|
98
|
+
credentials: runner.credentials,
|
|
99
|
+
...(Object.keys(runner.unsafeSecretEnvVars).length === 0
|
|
100
|
+
? {}
|
|
101
|
+
: { unsafeSecretEnvVars: runner.unsafeSecretEnvVars }),
|
|
102
|
+
keepMs: options.keepMs,
|
|
103
|
+
};
|
|
104
|
+
return { ok: true, runner: session };
|
|
105
|
+
}
|
|
@@ -5,6 +5,7 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
5
5
|
credential: z.ZodOptional<z.ZodEnum<{
|
|
6
6
|
"github-actions": "github-actions";
|
|
7
7
|
mint: "mint";
|
|
8
|
+
"vercel-oidc": "vercel-oidc";
|
|
8
9
|
}>>;
|
|
9
10
|
showOutput: z.ZodDefault<z.ZodBoolean>;
|
|
10
11
|
keepSandbox: z.ZodOptional<z.ZodString>;
|
|
@@ -177,7 +178,7 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
177
178
|
sandbox: z.ZodNumber;
|
|
178
179
|
name: z.ZodString;
|
|
179
180
|
stopsAt: z.ZodString;
|
|
180
|
-
url: z.ZodString
|
|
181
|
+
url: z.ZodNullable<z.ZodString>;
|
|
181
182
|
}, z.core.$strip>>;
|
|
182
183
|
notKept: z.ZodArray<z.ZodObject<{
|
|
183
184
|
sandbox: z.ZodNumber;
|
|
@@ -223,7 +224,10 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
223
224
|
testFiles: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
224
225
|
runnerSandboxes: z.ZodNullable<z.ZodObject<{
|
|
225
226
|
max: z.ZodNumber;
|
|
226
|
-
default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.
|
|
227
|
+
default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
228
|
+
filesPerSandbox: z.ZodNumber;
|
|
229
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
230
|
+
}, z.core.$strip>]>>;
|
|
227
231
|
}, z.core.$strip>>;
|
|
228
232
|
sandboxes: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
229
233
|
sandbox: z.ZodNumber;
|
|
@@ -396,6 +400,13 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
396
400
|
minLength: number;
|
|
397
401
|
configFile: string | null;
|
|
398
402
|
}]>;
|
|
403
|
+
vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
404
|
+
cause: "invalid-token" | "missing-token";
|
|
405
|
+
detail: string;
|
|
406
|
+
fix: string;
|
|
407
|
+
runner: boolean;
|
|
408
|
+
cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
|
|
409
|
+
}]>;
|
|
399
410
|
}, {
|
|
400
411
|
readonly conflictingOptions: import("@vercel/clinkr").SharedError<"conflicting_options", [data: {
|
|
401
412
|
conflicts: {
|
|
@@ -547,6 +558,13 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
547
558
|
minLength: number;
|
|
548
559
|
configFile: string | null;
|
|
549
560
|
}]>;
|
|
561
|
+
readonly vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
562
|
+
cause: "invalid-token" | "missing-token";
|
|
563
|
+
detail: string;
|
|
564
|
+
fix: string;
|
|
565
|
+
runner: boolean;
|
|
566
|
+
cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
|
|
567
|
+
}]>;
|
|
550
568
|
}>, import("@vercel/clinkr").OutcomeOf<import("@vercel/clinkr").Outcomes<{
|
|
551
569
|
ran: z.ZodObject<{
|
|
552
570
|
version: z.ZodString;
|
|
@@ -709,7 +727,7 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
709
727
|
sandbox: z.ZodNumber;
|
|
710
728
|
name: z.ZodString;
|
|
711
729
|
stopsAt: z.ZodString;
|
|
712
|
-
url: z.ZodString
|
|
730
|
+
url: z.ZodNullable<z.ZodString>;
|
|
713
731
|
}, z.core.$strip>>;
|
|
714
732
|
notKept: z.ZodArray<z.ZodObject<{
|
|
715
733
|
sandbox: z.ZodNumber;
|
|
@@ -755,7 +773,10 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
755
773
|
testFiles: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
756
774
|
runnerSandboxes: z.ZodNullable<z.ZodObject<{
|
|
757
775
|
max: z.ZodNumber;
|
|
758
|
-
default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.
|
|
776
|
+
default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
777
|
+
filesPerSandbox: z.ZodNumber;
|
|
778
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
779
|
+
}, z.core.$strip>]>>;
|
|
759
780
|
}, z.core.$strip>>;
|
|
760
781
|
sandboxes: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
761
782
|
sandbox: z.ZodNumber;
|
|
@@ -928,6 +949,13 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
928
949
|
minLength: number;
|
|
929
950
|
configFile: string | null;
|
|
930
951
|
}]>;
|
|
952
|
+
vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
953
|
+
cause: "invalid-token" | "missing-token";
|
|
954
|
+
detail: string;
|
|
955
|
+
fix: string;
|
|
956
|
+
runner: boolean;
|
|
957
|
+
cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
|
|
958
|
+
}]>;
|
|
931
959
|
}, {
|
|
932
960
|
readonly conflictingOptions: import("@vercel/clinkr").SharedError<"conflicting_options", [data: {
|
|
933
961
|
conflicts: {
|
|
@@ -1079,5 +1107,12 @@ declare const _default: import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
|
1079
1107
|
minLength: number;
|
|
1080
1108
|
configFile: string | null;
|
|
1081
1109
|
}]>;
|
|
1110
|
+
readonly vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
1111
|
+
cause: "invalid-token" | "missing-token";
|
|
1112
|
+
detail: string;
|
|
1113
|
+
fix: string;
|
|
1114
|
+
runner: boolean;
|
|
1115
|
+
cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
|
|
1116
|
+
}]>;
|
|
1082
1117
|
}>>, import("../../context.ts").StormApp, false>;
|
|
1083
1118
|
export default _default;
|
|
@@ -1,93 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
planAskedSandboxesRun,
|
|
3
|
-
runHelp,
|
|
4
|
-
runPlanned
|
|
5
|
-
} from "../../chunks/chunk-E4PJNZVG.js";
|
|
6
1
|
import {
|
|
7
2
|
RUN_CLI_OPTIONS,
|
|
8
3
|
RUN_REQUEST_FIELDS,
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
executePlannedRun,
|
|
5
|
+
placeholderProblems,
|
|
6
|
+
planRun,
|
|
11
7
|
runFlagProblems,
|
|
8
|
+
runHelp,
|
|
12
9
|
sandboxesFlagProblems
|
|
13
|
-
} from "../../chunks/chunk-
|
|
10
|
+
} from "../../chunks/chunk-JN3YY6ZH.js";
|
|
11
|
+
import "../../chunks/chunk-RWIXDDCK.js";
|
|
12
|
+
import "../../chunks/chunk-MR77L2GK.js";
|
|
14
13
|
import "../../chunks/chunk-I5GZLOLQ.js";
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import "../../chunks/chunk-
|
|
19
|
-
import "../../chunks/chunk-
|
|
20
|
-
import "../../chunks/chunk-
|
|
21
|
-
import "../../chunks/chunk-
|
|
22
|
-
import "../../chunks/chunk-
|
|
23
|
-
import "../../chunks/chunk-
|
|
24
|
-
import "../../chunks/chunk-
|
|
25
|
-
import "../../chunks/chunk-
|
|
26
|
-
import "../../chunks/chunk-
|
|
14
|
+
import {
|
|
15
|
+
outcomes
|
|
16
|
+
} from "../../chunks/chunk-2VP4GRJM.js";
|
|
17
|
+
import "../../chunks/chunk-FNBB6V4R.js";
|
|
18
|
+
import "../../chunks/chunk-M7EKRGVD.js";
|
|
19
|
+
import "../../chunks/chunk-F4MOYHRY.js";
|
|
20
|
+
import "../../chunks/chunk-HWIQ2S7K.js";
|
|
21
|
+
import "../../chunks/chunk-EEENLQHE.js";
|
|
22
|
+
import "../../chunks/chunk-72ZFEMAW.js";
|
|
23
|
+
import "../../chunks/chunk-BCBKYOHW.js";
|
|
24
|
+
import "../../chunks/chunk-D27KILIA.js";
|
|
25
|
+
import "../../chunks/chunk-2RNDPDTJ.js";
|
|
26
|
+
import "../../chunks/chunk-CKGZA25H.js";
|
|
27
|
+
import "../../chunks/chunk-GRT3UIBV.js";
|
|
28
|
+
import "../../chunks/chunk-4O5C2XGJ.js";
|
|
27
29
|
import "../../chunks/chunk-F6N34UWB.js";
|
|
28
|
-
import "../../chunks/chunk-
|
|
30
|
+
import "../../chunks/chunk-YEPFSLQR.js";
|
|
29
31
|
import {
|
|
30
32
|
effectiveConfig
|
|
31
|
-
} from "../../chunks/chunk-
|
|
32
|
-
import
|
|
33
|
-
NOT_COUNTED
|
|
34
|
-
} from "../../chunks/chunk-AWBSONHB.js";
|
|
33
|
+
} from "../../chunks/chunk-RNAS7JHE.js";
|
|
34
|
+
import "../../chunks/chunk-XBDRVFEV.js";
|
|
35
35
|
import {
|
|
36
36
|
stormCommands
|
|
37
|
-
} from "../../chunks/chunk-
|
|
38
|
-
import "../../chunks/chunk-
|
|
37
|
+
} from "../../chunks/chunk-WV3DP6NR.js";
|
|
38
|
+
import "../../chunks/chunk-4WAMTUWZ.js";
|
|
39
39
|
|
|
40
40
|
// src/commands/exec/command.ts
|
|
41
41
|
import { z } from "zod";
|
|
42
42
|
|
|
43
|
-
// src/planning/sandbox-placeholders.ts
|
|
44
|
-
var PLACEHOLDER = /(?<!\$)\{(sandbox\+1|sandbox(?:es)?)\}/g;
|
|
45
|
-
function placeholdersOf(argv) {
|
|
46
|
-
return new Set(
|
|
47
|
-
argv.flatMap((argument) => [...argument.matchAll(PLACEHOLDER)].map(([, name]) => name))
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
function commandForSandbox(argv, sandbox, count) {
|
|
51
|
-
return argv.map(
|
|
52
|
-
(argument) => argument.replace(
|
|
53
|
-
PLACEHOLDER,
|
|
54
|
-
(_match, name) => String(name === "sandbox" ? sandbox : name === "sandbox+1" ? sandbox + 1 : count)
|
|
55
|
-
)
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
function commandsForSandboxes(argv, count) {
|
|
59
|
-
return Array.from({ length: count }, (_, index) => commandForSandbox(argv, index, count));
|
|
60
|
-
}
|
|
61
|
-
function placeholderListText(names) {
|
|
62
|
-
const words = names.map((name) => `{${name}}`);
|
|
63
|
-
if (words.length <= 2) return words.join(" and ");
|
|
64
|
-
return `${words.slice(0, -1).join(", ")}, and ${words.at(-1) ?? ""}`;
|
|
65
|
-
}
|
|
66
|
-
function placeholderProblems(request) {
|
|
67
|
-
const { sandboxes, command } = request;
|
|
68
|
-
const held = placeholdersOf(command);
|
|
69
|
-
if (sandboxes === void 0)
|
|
70
|
-
return held.size === 0 ? [] : [
|
|
71
|
-
{
|
|
72
|
-
field: "command",
|
|
73
|
-
message: `The command holds ${placeholderListText([...held])}, which only --sandboxes replaces. Add --sandboxes <n>, or write $ before the brace to keep it as it is.`
|
|
74
|
-
}
|
|
75
|
-
];
|
|
76
|
-
return [
|
|
77
|
-
...Number.isInteger(sandboxes) && sandboxes >= 1 ? [] : [{ field: "sandboxes", message: `--sandboxes takes a whole number from 1, not ${sandboxes}.` }],
|
|
78
|
-
...held.has("sandbox") || held.has("sandbox+1") ? [] : [
|
|
79
|
-
{
|
|
80
|
-
field: "command",
|
|
81
|
-
message: "--sandboxes needs {sandbox} or {sandbox+1} in an argument of the command, such as -g {sandbox+1}/{sandboxes}: without it, every runner sandbox runs the same command."
|
|
82
|
-
}
|
|
83
|
-
]
|
|
84
|
-
];
|
|
85
|
-
}
|
|
86
|
-
|
|
87
43
|
// src/commands/exec/exec-words.ts
|
|
88
44
|
var EXEC_HELP = {
|
|
89
45
|
usage: "[--sandboxes <N>] -- <command...>",
|
|
90
|
-
args: "The command to run, after --, as an argument list with no shell. On the launch machine, it gets this machine's working directory and environment, less the launcher variables its resources hide, plus STORM_RUN, and FORCE_COLOR or NO_COLOR only when neither is set and the launcher asks for or opts out of color; in a runner sandbox, the runner
|
|
46
|
+
args: "The command to run, after --, as an argument list with no shell. On the launch machine, it gets this machine's working directory and environment, less the launcher variables its resources hide, plus STORM_RUN, and FORCE_COLOR or NO_COLOR only when neither is set and the launcher asks for or opts out of color; in a runner sandbox, the Vercel Sandbox runner's cwd, its env, the runner's PATH, STORM_RUN, and FORCE_COLOR or NO_COLOR only when that env sets neither and the launcher asks for or opts out of color, with paths under the repository's root rewritten.",
|
|
91
47
|
verbose: "which asks the command to print what each test does as it happens, for passing tests too",
|
|
92
48
|
examples: [
|
|
93
49
|
{
|
|
@@ -146,31 +102,11 @@ var command_default = stormCommands.define({
|
|
|
146
102
|
const { app, signal } = context;
|
|
147
103
|
const file = await app.config.loadFile();
|
|
148
104
|
if (!file.ok) return file.refusal;
|
|
149
|
-
const {
|
|
105
|
+
const { command } = request;
|
|
150
106
|
const planRequest = { ...request, settingsFile: effectiveConfig(file, null), suite: null };
|
|
151
|
-
const
|
|
152
|
-
ok: true,
|
|
153
|
-
argv: command,
|
|
154
|
-
testPlan: NOT_COUNTED.testPlan
|
|
155
|
-
});
|
|
156
|
-
const planSandboxes = (count) => async ({ max }) => ({
|
|
157
|
-
ok: true,
|
|
158
|
-
argv: command,
|
|
159
|
-
testPlan: NOT_COUNTED.testPlan,
|
|
160
|
-
sandboxes: {
|
|
161
|
-
count: { count, from: "flag", max },
|
|
162
|
-
sandboxes: commandsForSandboxes(command, count).map((argv) => ({ argv, files: null }))
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
const plan = sandboxes === void 0 ? await planCommandRun(app, planRequest, planCommand, signal) : await planAskedSandboxesRun(
|
|
166
|
-
app,
|
|
167
|
-
planRequest,
|
|
168
|
-
{ count: sandboxes, flag: "--sandboxes" },
|
|
169
|
-
planSandboxes(sandboxes),
|
|
170
|
-
signal
|
|
171
|
-
);
|
|
107
|
+
const plan = await planRun(app, planRequest, { kind: "exec", command }, signal);
|
|
172
108
|
if (!plan.ok) return plan.refusal;
|
|
173
|
-
return await
|
|
109
|
+
return await executePlannedRun(
|
|
174
110
|
context,
|
|
175
111
|
request,
|
|
176
112
|
{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { StormApp } from "../../context.ts";
|
|
2
2
|
import { type Driver, type RunTestPlan } from "../../sdk/extension/index.ts";
|
|
3
3
|
import type { DriverRefusals } from "../../planning/driver-refusals.ts";
|
|
4
|
-
import type {
|
|
5
|
-
import { canceledBeforeStart
|
|
6
|
-
import { checkoutFailedRefusal } from "./
|
|
4
|
+
import type { PlannedRunner } from "../../planning/run-plan.ts";
|
|
5
|
+
import { canceledBeforeStart } from "./outcomes.ts";
|
|
6
|
+
import { checkoutFailedRefusal } from "./runner-refusals.ts";
|
|
7
7
|
/**
|
|
8
8
|
* Whether a driver run counts before it starts: nothing when neither `testPlan` nor `--count-tests` asks; otherwise
|
|
9
9
|
* each test when `--count-tests` was passed or the driver always counts each test (`driver.countsFilesOnly !== true`).
|
|
@@ -38,7 +38,12 @@ export type DriverPlanRefusal = ReturnType<typeof canceledBeforeStart> | ReturnT
|
|
|
38
38
|
* the driver's argv (`launch`) over the binary the run starts. `errors` are the builders of the driver's two errors
|
|
39
39
|
* (`driverRefusals`), the ones its command's outcomes list, which `driver.refusals`, the driver's words, word.
|
|
40
40
|
*/
|
|
41
|
-
export declare function planDriverCommand(app: Pick<StormApp, "context" | "cwd" | "packageBins" | "driverContexts">, driver: Driver, errors: DriverRefusals, args: readonly string[], count: DriverCount,
|
|
41
|
+
export declare function planDriverCommand(app: Pick<StormApp, "context" | "cwd" | "packageBins" | "driverContexts">, driver: Driver, errors: DriverRefusals, args: readonly string[], count: DriverCount, runner: PlannedRunner, signal: AbortSignal): Promise<{
|
|
42
|
+
readonly ok: true;
|
|
43
|
+
readonly argv: readonly string[];
|
|
44
|
+
readonly testPlan: RunTestPlan;
|
|
45
|
+
readonly testFiles?: readonly string[];
|
|
46
|
+
} | {
|
|
42
47
|
readonly ok: false;
|
|
43
48
|
readonly refusal: DriverPlanRefusal;
|
|
44
49
|
}>;
|