@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,84 +3,74 @@ import {
|
|
|
3
3
|
resolveProjectTests,
|
|
4
4
|
resolveSuite,
|
|
5
5
|
targetRedactor
|
|
6
|
-
} from "../../chunks/chunk-
|
|
6
|
+
} from "../../chunks/chunk-6UHIJXZG.js";
|
|
7
7
|
import {
|
|
8
8
|
suiteNamesText,
|
|
9
9
|
suiteNotFoundErrors
|
|
10
|
-
} from "../../chunks/chunk-
|
|
10
|
+
} from "../../chunks/chunk-7DZE67QM.js";
|
|
11
11
|
import {
|
|
12
12
|
DRIVER_FILE_LISTS_HELP,
|
|
13
13
|
DRIVER_SANDBOXES_HELP,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
RUN_CLI_OPTIONS,
|
|
15
|
+
RUN_REQUEST_FIELDS,
|
|
16
|
+
driverSandboxesProblem,
|
|
17
|
+
executePlannedRun,
|
|
18
|
+
planRun,
|
|
19
|
+
runFlagProblems,
|
|
17
20
|
runHelp,
|
|
18
|
-
|
|
19
|
-
} from "../../chunks/chunk-
|
|
21
|
+
sandboxesFlagProblems
|
|
22
|
+
} from "../../chunks/chunk-JN3YY6ZH.js";
|
|
23
|
+
import "../../chunks/chunk-RWIXDDCK.js";
|
|
24
|
+
import "../../chunks/chunk-MR77L2GK.js";
|
|
25
|
+
import "../../chunks/chunk-I5GZLOLQ.js";
|
|
20
26
|
import {
|
|
21
27
|
PLANNED_DESCRIPTION,
|
|
22
28
|
RAN_DESCRIPTION,
|
|
23
|
-
RUN_CLI_OPTIONS,
|
|
24
29
|
RUN_ERRORS,
|
|
25
|
-
RUN_REQUEST_FIELDS,
|
|
26
30
|
SANDBOXES_RAN_DESCRIPTION,
|
|
27
|
-
canceledBeforeStart,
|
|
28
|
-
checkoutFailedRefusal,
|
|
29
31
|
fileListErrors,
|
|
30
|
-
planCommandRun,
|
|
31
32
|
plannedSchema,
|
|
32
33
|
ranSchema,
|
|
33
|
-
readFileListsFile,
|
|
34
34
|
renderPlanned,
|
|
35
35
|
renderRan,
|
|
36
36
|
renderSandboxesRan,
|
|
37
|
-
resolveCallerFileLists,
|
|
38
|
-
runFlagProblems,
|
|
39
37
|
sandboxesDefaultErrors,
|
|
40
38
|
sandboxesErrors,
|
|
41
|
-
sandboxesFlagProblems,
|
|
42
39
|
sandboxesRanSchema
|
|
43
|
-
} from "../../chunks/chunk-
|
|
44
|
-
import "../../chunks/chunk-
|
|
45
|
-
import
|
|
46
|
-
|
|
47
|
-
recordedPlan
|
|
48
|
-
} from "../../chunks/chunk-5GBMR4HM.js";
|
|
40
|
+
} from "../../chunks/chunk-2VP4GRJM.js";
|
|
41
|
+
import "../../chunks/chunk-FNBB6V4R.js";
|
|
42
|
+
import "../../chunks/chunk-M7EKRGVD.js";
|
|
43
|
+
import "../../chunks/chunk-F4MOYHRY.js";
|
|
49
44
|
import {
|
|
50
45
|
DRIVER_NAMES,
|
|
51
46
|
driverNamed
|
|
52
|
-
} from "../../chunks/chunk-
|
|
53
|
-
import "../../chunks/chunk-
|
|
54
|
-
import "../../chunks/chunk-
|
|
55
|
-
import "../../chunks/chunk-
|
|
56
|
-
import "../../chunks/chunk-
|
|
57
|
-
import "../../chunks/chunk-
|
|
58
|
-
import "../../chunks/chunk-
|
|
59
|
-
import "../../chunks/chunk-
|
|
60
|
-
import "../../chunks/chunk-QUHY6FGN.js";
|
|
47
|
+
} from "../../chunks/chunk-HWIQ2S7K.js";
|
|
48
|
+
import "../../chunks/chunk-EEENLQHE.js";
|
|
49
|
+
import "../../chunks/chunk-72ZFEMAW.js";
|
|
50
|
+
import "../../chunks/chunk-BCBKYOHW.js";
|
|
51
|
+
import "../../chunks/chunk-D27KILIA.js";
|
|
52
|
+
import "../../chunks/chunk-2RNDPDTJ.js";
|
|
53
|
+
import "../../chunks/chunk-CKGZA25H.js";
|
|
54
|
+
import "../../chunks/chunk-GRT3UIBV.js";
|
|
61
55
|
import {
|
|
62
56
|
planSchema
|
|
63
|
-
} from "../../chunks/chunk-
|
|
64
|
-
import "../../chunks/chunk-OX7X4B2L.js";
|
|
57
|
+
} from "../../chunks/chunk-4O5C2XGJ.js";
|
|
65
58
|
import "../../chunks/chunk-F6N34UWB.js";
|
|
66
|
-
import "../../chunks/chunk-
|
|
59
|
+
import "../../chunks/chunk-YEPFSLQR.js";
|
|
67
60
|
import {
|
|
68
61
|
CONFIG_FILE_NAME,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
} from "../../chunks/chunk-L36GBUBB.js";
|
|
62
|
+
CONFIG_FILE_NAMES_TEXT
|
|
63
|
+
} from "../../chunks/chunk-RNAS7JHE.js";
|
|
72
64
|
import {
|
|
73
|
-
DRIVER_PLAN_FAILURE_KINDS
|
|
74
|
-
|
|
75
|
-
} from "../../chunks/chunk-AWBSONHB.js";
|
|
65
|
+
DRIVER_PLAN_FAILURE_KINDS
|
|
66
|
+
} from "../../chunks/chunk-XBDRVFEV.js";
|
|
76
67
|
import {
|
|
77
68
|
stormCommands
|
|
78
|
-
} from "../../chunks/chunk-
|
|
69
|
+
} from "../../chunks/chunk-WV3DP6NR.js";
|
|
79
70
|
import {
|
|
80
71
|
defineErrors,
|
|
81
|
-
defineOutcomes
|
|
82
|
-
|
|
83
|
-
} from "../../chunks/chunk-VL7WFTVQ.js";
|
|
72
|
+
defineOutcomes
|
|
73
|
+
} from "../../chunks/chunk-4WAMTUWZ.js";
|
|
84
74
|
|
|
85
75
|
// src/commands/test/command.ts
|
|
86
76
|
import { z as z3 } from "zod";
|
|
@@ -187,7 +177,7 @@ var testErrors = defineErrors({
|
|
|
187
177
|
configFile: z2.string().nullable()
|
|
188
178
|
}),
|
|
189
179
|
render: ({ suites, configFile }) => ({
|
|
190
|
-
message: configFile === null ? `No ${
|
|
180
|
+
message: configFile === null ? `No ${CONFIG_FILE_NAMES_TEXT} applies here, so storm test has no driver to run. The command didn't run.` : `${configFile} names no top-level driver for storm test. The command didn't run.`,
|
|
191
181
|
...suites.length === 0 ? {} : { rows: [["Suites", suiteNamesText(suites)]] },
|
|
192
182
|
next: [
|
|
193
183
|
{
|
|
@@ -257,200 +247,6 @@ var outcomes = defineOutcomes({
|
|
|
257
247
|
}
|
|
258
248
|
});
|
|
259
249
|
|
|
260
|
-
// src/planning/driver-file-lists.ts
|
|
261
|
-
function driverSandboxesRun(run) {
|
|
262
|
-
const asked = run.asked.from === "flag" ? run.asked.count : Math.min(run.asked.default, run.max);
|
|
263
|
-
const lists = dealFileLists(run.testFiles, asked);
|
|
264
|
-
return {
|
|
265
|
-
count: {
|
|
266
|
-
count: lists.length,
|
|
267
|
-
from: run.asked.from,
|
|
268
|
-
max: run.max,
|
|
269
|
-
...run.asked.from === "default" ? { default: run.asked.default } : {},
|
|
270
|
-
...lists.length < asked ? { requested: asked } : {}
|
|
271
|
-
},
|
|
272
|
-
sandboxes: lists.map((files) => ({ argv: run.argv, files }))
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
function driverCallerFileListsRun(run) {
|
|
276
|
-
const resolved = resolveCallerFileLists(run.testFiles, run.lists);
|
|
277
|
-
if (!resolved.ok) return resolved;
|
|
278
|
-
return {
|
|
279
|
-
ok: true,
|
|
280
|
-
sandboxes: {
|
|
281
|
-
count: {
|
|
282
|
-
count: resolved.lists.length,
|
|
283
|
-
from: "file-lists",
|
|
284
|
-
max: run.max,
|
|
285
|
-
...resolved.leftOut > 0 ? { leftOut: resolved.leftOut } : {}
|
|
286
|
-
},
|
|
287
|
-
sandboxes: resolved.lists.map((files) => ({ argv: run.argv, files }))
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
// src/commands/exec/run-bin.ts
|
|
293
|
-
import { join } from "node:path";
|
|
294
|
-
async function findRunBin(app, name, where) {
|
|
295
|
-
if (where.kind === "unsandboxed") {
|
|
296
|
-
const cwd2 = app.cwd;
|
|
297
|
-
const found2 = await app.packageBins.find(name, cwd2);
|
|
298
|
-
return found2.ok ? { kind: "found", cwd: cwd2, counts: found2.path, runs: found2.path } : { kind: "not-found", cwd: cwd2, searched: found2.searched };
|
|
299
|
-
}
|
|
300
|
-
const root = await app.context.checkout.repositoryRoot({ cwd: app.cwd });
|
|
301
|
-
if (!root.ok) return { kind: "checkout-failed", failure: root.failure };
|
|
302
|
-
const cwd = join(root.value, where.recipe.cwd);
|
|
303
|
-
const found = await app.context.packageBins.find({ name, from: cwd, root: root.value });
|
|
304
|
-
return found.ok ? { kind: "found", cwd, counts: found.path, runs: name } : { kind: "not-found", cwd, searched: found.searched };
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
// src/commands/exec/driver-plan.ts
|
|
308
|
-
function driverCount(driver, testPlan, countTests) {
|
|
309
|
-
if (!testPlan && !countTests) return void 0;
|
|
310
|
-
return { countTests: driver.countsFilesOnly !== true || countTests };
|
|
311
|
-
}
|
|
312
|
-
async function planDriverCommand(app, driver, errors, args, count, where, signal) {
|
|
313
|
-
const { bin: name } = driver.program;
|
|
314
|
-
if (count === void 0 && where.kind === "runner")
|
|
315
|
-
return { ok: true, argv: driver.launch(name, args), testPlan: NOT_COUNTED.testPlan };
|
|
316
|
-
const bin = await findRunBin(app, name, where);
|
|
317
|
-
if (bin.kind === "checkout-failed") return refused(checkoutFailedRefusal(bin.failure));
|
|
318
|
-
const planned = { args, cwd: bin.cwd };
|
|
319
|
-
if (bin.kind === "not-found")
|
|
320
|
-
return refused(
|
|
321
|
-
errors.planFailed(
|
|
322
|
-
driver.name,
|
|
323
|
-
{ kind: "start-failed", message: `found no ${name} in node_modules/.bin of ${bin.searched.join(", ")}` },
|
|
324
|
-
planned
|
|
325
|
-
)
|
|
326
|
-
);
|
|
327
|
-
if (count === void 0) return { ok: true, argv: driver.launch(bin.runs, args), testPlan: NOT_COUNTED.testPlan };
|
|
328
|
-
const contexts = app.driverContexts;
|
|
329
|
-
const answer = await driver.plan(contexts[driver.name])({
|
|
330
|
-
...planned,
|
|
331
|
-
bin: bin.counts,
|
|
332
|
-
countTests: count.countTests,
|
|
333
|
-
signal
|
|
334
|
-
});
|
|
335
|
-
if (!answer.ok) {
|
|
336
|
-
const { kind, message } = answer;
|
|
337
|
-
if (kind === "canceled") return refused(canceledBeforeStart());
|
|
338
|
-
return refused(errors.planFailed(driver.name, { kind, message }, planned));
|
|
339
|
-
}
|
|
340
|
-
const { tests, files } = answer.plan;
|
|
341
|
-
if ((tests ?? files) === 0) return refused(errors.noMatchingTests(driver.name, planned));
|
|
342
|
-
return {
|
|
343
|
-
ok: true,
|
|
344
|
-
argv: driver.launch(bin.runs, args),
|
|
345
|
-
testPlan: { kind: "counted", ...tests === void 0 ? {} : { tests }, files },
|
|
346
|
-
...answer.testFiles === void 0 ? {} : { testFiles: answer.testFiles }
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
// src/commands/test/plan.ts
|
|
351
|
-
function driverSandboxesProblem(driver, args, asks) {
|
|
352
|
-
const flag = asks.fileLists !== void 0 ? "--file-lists" : asks.sandboxes !== void 0 ? "--sandboxes" : void 0;
|
|
353
|
-
if (flag === void 0) return void 0;
|
|
354
|
-
if (driver.fileLists === void 0)
|
|
355
|
-
return {
|
|
356
|
-
kind: "unsupported",
|
|
357
|
-
flag,
|
|
358
|
-
problem: `The ${driver.name} driver has no file list support, so storm test can't run it across runner sandboxes.`
|
|
359
|
-
};
|
|
360
|
-
const checked = driver.fileLists.validate(args);
|
|
361
|
-
return checked.ok ? void 0 : { kind: "args", flag, problem: checked.problem };
|
|
362
|
-
}
|
|
363
|
-
function testSandboxesProblems(request) {
|
|
364
|
-
const { sandboxes } = request;
|
|
365
|
-
return sandboxes === void 0 || Number.isInteger(sandboxes) && sandboxes >= 1 ? [] : [{ field: "sandboxes", message: `--sandboxes takes a whole number from 1, not ${sandboxes}.` }];
|
|
366
|
-
}
|
|
367
|
-
async function planTestRun({ app, signal }, driver, errors, args, request, asks) {
|
|
368
|
-
const { countTests, sandboxes, fileLists: listsPath } = asks;
|
|
369
|
-
const planDriverSandboxes = (make) => async (plan, planSignal) => {
|
|
370
|
-
const planned = await planDriverCommand(
|
|
371
|
-
app,
|
|
372
|
-
driver,
|
|
373
|
-
errors,
|
|
374
|
-
args,
|
|
375
|
-
{ countTests: driver.countsFilesOnly !== true || countTests },
|
|
376
|
-
plan.where,
|
|
377
|
-
planSignal
|
|
378
|
-
);
|
|
379
|
-
if (!planned.ok) return planned;
|
|
380
|
-
const { argv, testPlan, testFiles } = planned;
|
|
381
|
-
if (testFiles === void 0)
|
|
382
|
-
throw new Error(
|
|
383
|
-
`planTestRun: driver ${driver.name} has file list support, and its plan step answered no test files`
|
|
384
|
-
);
|
|
385
|
-
const made = make({ argv, testFiles, testPlan }, plan);
|
|
386
|
-
if (!made.ok) return made;
|
|
387
|
-
return { ok: true, argv, testPlan, testFiles, sandboxes: made.sandboxes };
|
|
388
|
-
};
|
|
389
|
-
let lists;
|
|
390
|
-
if (listsPath !== void 0) {
|
|
391
|
-
const read = await readFileListsFile(app.context.fileListsFiles, { path: listsPath, cwd: app.cwd, sandboxes });
|
|
392
|
-
if (!read.ok)
|
|
393
|
-
return refused(
|
|
394
|
-
read.kind === "unreadable" ? fileListErrors.fileListsUnreadable({ path: read.path, problem: read.problem, message: read.message }) : fileListErrors.invalidFileLists({
|
|
395
|
-
path: read.path,
|
|
396
|
-
problems: read.problems.map(
|
|
397
|
-
(problem) => problem.kind === "in-two-lists" ? { ...problem, sandboxes: [...problem.sandboxes] } : { ...problem }
|
|
398
|
-
)
|
|
399
|
-
})
|
|
400
|
-
);
|
|
401
|
-
lists = read.lists;
|
|
402
|
-
}
|
|
403
|
-
const asked = lists !== void 0 ? { count: lists.lists.length, flag: "--file-lists" } : sandboxes === void 0 ? void 0 : { count: sandboxes, flag: "--sandboxes" };
|
|
404
|
-
if (asked !== void 0) {
|
|
405
|
-
const planSandboxes = planDriverSandboxes(
|
|
406
|
-
({ argv, testFiles }, { max }) => {
|
|
407
|
-
if (lists === void 0)
|
|
408
|
-
return {
|
|
409
|
-
ok: true,
|
|
410
|
-
sandboxes: driverSandboxesRun({ argv, testFiles, asked: { from: "flag", count: asked.count }, max })
|
|
411
|
-
};
|
|
412
|
-
const resolved = driverCallerFileListsRun({ argv, testFiles, lists, max });
|
|
413
|
-
return resolved.ok ? resolved : refused(
|
|
414
|
-
fileListErrors.fileListsUnlisted({
|
|
415
|
-
path: lists.path,
|
|
416
|
-
files: [...resolved.unlisted],
|
|
417
|
-
listed: resolved.listed
|
|
418
|
-
})
|
|
419
|
-
);
|
|
420
|
-
}
|
|
421
|
-
);
|
|
422
|
-
return await planAskedSandboxesRun(app, request, asked, planSandboxes, signal);
|
|
423
|
-
}
|
|
424
|
-
const planCommand = async (where, planSignal, { testPlan }) => await planDriverCommand(app, driver, errors, args, driverCount(driver, testPlan, countTests), where, planSignal);
|
|
425
|
-
if (driver.fileLists === void 0) return await planCommandRun(app, request, planCommand, signal);
|
|
426
|
-
const planDefaultSandboxes = planDriverSandboxes(({ argv, testFiles, testPlan }, { where, max, settings }) => {
|
|
427
|
-
const sandboxesDefault = where.recipe.sandboxes?.default;
|
|
428
|
-
if (sandboxesDefault === void 0)
|
|
429
|
-
throw new Error("planTestRun: a run across runner sandboxes from the default needs runner.sandboxes.default");
|
|
430
|
-
const resolved = resolveSandboxCountDefault(sandboxesDefault, testPlan);
|
|
431
|
-
if (!resolved.ok)
|
|
432
|
-
return refused(
|
|
433
|
-
invalidConfig(where.configFile, [{ key: SANDBOXES_DEFAULT_KEY, location: null, problem: resolved.problem }])
|
|
434
|
-
);
|
|
435
|
-
const checked = driver.fileLists?.validate(args);
|
|
436
|
-
if (checked !== void 0 && !checked.ok)
|
|
437
|
-
return refused(
|
|
438
|
-
sandboxesDefaultErrors.sandboxesDefaultRefused({
|
|
439
|
-
key: SANDBOXES_DEFAULT_KEY,
|
|
440
|
-
sandboxes: Math.min(resolved.sandboxes, max, testFiles.length),
|
|
441
|
-
field: "args",
|
|
442
|
-
problem: checked.problem,
|
|
443
|
-
configFile: settings.configFile
|
|
444
|
-
})
|
|
445
|
-
);
|
|
446
|
-
return {
|
|
447
|
-
ok: true,
|
|
448
|
-
sandboxes: driverSandboxesRun({ argv, testFiles, asked: { from: "default", default: resolved.sandboxes }, max })
|
|
449
|
-
};
|
|
450
|
-
});
|
|
451
|
-
return await planDefaultSandboxesRun(app, request, planCommand, planDefaultSandboxes, signal);
|
|
452
|
-
}
|
|
453
|
-
|
|
454
250
|
// src/commands/test/test-words.ts
|
|
455
251
|
var TEST_HELP = {
|
|
456
252
|
usage: "[--suite <NAME>] [--count-tests] [--sandboxes <N> | --file-lists <PATH>] [<args>...] [-- <dash options>...]",
|
|
@@ -493,6 +289,10 @@ var COUNT_TESTS_FLAG_HELP = {
|
|
|
493
289
|
|
|
494
290
|
// src/commands/test/command.ts
|
|
495
291
|
var help = runHelp(TEST_HELP, "args");
|
|
292
|
+
function testSandboxesProblems(request) {
|
|
293
|
+
const { sandboxes } = request;
|
|
294
|
+
return sandboxes === void 0 || Number.isInteger(sandboxes) && sandboxes >= 1 ? [] : [{ field: "sandboxes", message: `--sandboxes takes a whole number from 1, not ${sandboxes}.` }];
|
|
295
|
+
}
|
|
496
296
|
var command_default = stormCommands.define({
|
|
497
297
|
requestSchema: z3.object({
|
|
498
298
|
...RUN_REQUEST_FIELDS,
|
|
@@ -543,18 +343,16 @@ var command_default = stormCommands.define({
|
|
|
543
343
|
configFile: file.path
|
|
544
344
|
});
|
|
545
345
|
await ui.progress?.(preRunLine(target, request.args.length, targetRedactor(target, app.env)));
|
|
546
|
-
const plan = await
|
|
547
|
-
|
|
548
|
-
driver,
|
|
549
|
-
testDriverRefusals,
|
|
550
|
-
args,
|
|
346
|
+
const plan = await planRun(
|
|
347
|
+
app,
|
|
551
348
|
{ ...request, settingsFile: target.settingsFile, suite: target.name },
|
|
552
|
-
{ countTests: request.countTests,
|
|
349
|
+
{ kind: "driver", driver, args, countTests: request.countTests, errors: testDriverRefusals },
|
|
350
|
+
context.signal
|
|
553
351
|
);
|
|
554
352
|
if (!plan.ok) return plan.refusal;
|
|
555
353
|
const test = { driver: driver.name, suite: target.name };
|
|
556
354
|
const extraMismatchHint = driver.fileLists?.extraMismatchHint;
|
|
557
|
-
return await
|
|
355
|
+
return await executePlannedRun(
|
|
558
356
|
context,
|
|
559
357
|
request,
|
|
560
358
|
{
|
|
@@ -562,15 +360,12 @@ var command_default = stormCommands.define({
|
|
|
562
360
|
test,
|
|
563
361
|
hints: driver.hints,
|
|
564
362
|
...extraMismatchHint === void 0 ? {} : { extraMismatchHint },
|
|
565
|
-
ran: (facts,
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
...test
|
|
572
|
-
});
|
|
573
|
-
},
|
|
363
|
+
ran: (facts, plan2, noFinalTestResults) => outcomes.ran({
|
|
364
|
+
...facts,
|
|
365
|
+
...plan2 === void 0 ? {} : { plan: plan2 },
|
|
366
|
+
noFinalTestResults,
|
|
367
|
+
...test
|
|
368
|
+
}),
|
|
574
369
|
sandboxesRan: (facts, noFinalTestResults) => outcomes.sandboxesRan({ ...facts, noFinalTestResults, ...test }),
|
|
575
370
|
planned: (facts) => outcomes.planned(facts)
|
|
576
371
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/commands/test/metadata.ts
|
|
2
2
|
var metadata = {
|
|
3
3
|
summary: "Run the project's tests, or a suite of them.",
|
|
4
|
-
description:
|
|
4
|
+
description: `Run the project's tests declared at the top level of storm.config.ts, or a named suite with --suite <name>. Pass extra arguments for the test runner directly, with dash options after --; command-line arguments go before the config file's args. Where the tests run is declared by runner in storm.config.ts (launchMachine() or vercelSandbox({ \u2026 })); a suite inherits the top-level runner unless it sets its own. With testPlan: true in storm.config.ts or --count-tests, storm counts the tests before the run starts; --count-tests counts each test when a driver otherwise counts only test files. With --sandboxes <n>, --file-lists <path>, or sandboxes.default in vercelSandbox({ \u2026 }), and a driver with file list support, it is a run across runner sandboxes: storm lists the test files on this machine, deals them into file lists (or takes yours), and runs each list in its own runner sandbox, all started from one runner snapshot. With --plan-only, it prints the planned run and starts nothing. storm finds storm.config.ts in the working directory or a parent up to the git worktree's root; storm.config.mts works the same, always loads as an ES module, and suits a package.json without "type": "module", and one directory may hold only one of the two.`
|
|
5
5
|
};
|
|
6
6
|
export {
|
|
7
7
|
metadata
|
|
@@ -267,7 +267,7 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
267
267
|
sandbox: z.ZodNumber;
|
|
268
268
|
name: z.ZodString;
|
|
269
269
|
stopsAt: z.ZodString;
|
|
270
|
-
url: z.ZodString
|
|
270
|
+
url: z.ZodNullable<z.ZodString>;
|
|
271
271
|
}, z.core.$strip>>;
|
|
272
272
|
notKept: z.ZodArray<z.ZodObject<{
|
|
273
273
|
sandbox: z.ZodNumber;
|
|
@@ -316,7 +316,10 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
316
316
|
testFiles: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
317
317
|
runnerSandboxes: z.ZodNullable<z.ZodObject<{
|
|
318
318
|
max: z.ZodNumber;
|
|
319
|
-
default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.
|
|
319
|
+
default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
320
|
+
filesPerSandbox: z.ZodNumber;
|
|
321
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
322
|
+
}, z.core.$strip>]>>;
|
|
320
323
|
}, z.core.$strip>>;
|
|
321
324
|
sandboxes: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
322
325
|
sandbox: z.ZodNumber;
|
|
@@ -550,6 +553,13 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
550
553
|
minLength: number;
|
|
551
554
|
configFile: string | null;
|
|
552
555
|
}]>;
|
|
556
|
+
vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
557
|
+
cause: "invalid-token" | "missing-token";
|
|
558
|
+
detail: string;
|
|
559
|
+
fix: string;
|
|
560
|
+
runner: boolean;
|
|
561
|
+
cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
|
|
562
|
+
}]>;
|
|
553
563
|
}, {
|
|
554
564
|
readonly conflictingOptions: import("@vercel/clinkr").SharedError<"conflicting_options", [data: {
|
|
555
565
|
conflicts: {
|
|
@@ -762,4 +772,11 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
762
772
|
minLength: number;
|
|
763
773
|
configFile: string | null;
|
|
764
774
|
}]>;
|
|
775
|
+
readonly vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
776
|
+
cause: "invalid-token" | "missing-token";
|
|
777
|
+
detail: string;
|
|
778
|
+
fix: string;
|
|
779
|
+
runner: boolean;
|
|
780
|
+
cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
|
|
781
|
+
}]>;
|
|
765
782
|
}>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// `missing_driver`, and `driver_sandboxes_refused`), and the driver's two planning refusals.
|
|
4
4
|
import { defineErrors, defineOutcomes } from "@vercel/clinkr";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
import { CONFIG_FILE_NAME } from "../../config/index.js";
|
|
6
|
+
import { CONFIG_FILE_NAME, CONFIG_FILE_NAMES_TEXT } from "../../config/index.js";
|
|
7
7
|
import { DRIVER_NAMES, driverNamed } from "../../extensions.js";
|
|
8
8
|
import { driverRefusals } from "../../planning/driver-refusals.js";
|
|
9
9
|
import { suiteNamesText, suiteNotFoundErrors } from "../../planning/suite-not-found.js";
|
|
@@ -63,7 +63,7 @@ const testErrors = defineErrors({
|
|
|
63
63
|
}),
|
|
64
64
|
render: ({ suites, configFile }) => ({
|
|
65
65
|
message: configFile === null
|
|
66
|
-
? `No ${
|
|
66
|
+
? `No ${CONFIG_FILE_NAMES_TEXT} applies here, so storm test has no driver to run. The command didn't run.`
|
|
67
67
|
: `${configFile} names no top-level driver for storm test. The command didn't run.`,
|
|
68
68
|
...(suites.length === 0 ? {} : { rows: [["Suites", suiteNamesText(suites)]] }),
|
|
69
69
|
next: [
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { type ResourceDefinition } from "../sdk/extension/index.ts";
|
|
1
2
|
import type { CheckedRunner } from "./runner.ts";
|
|
2
3
|
import type { Checked } from "./schema.ts";
|
|
3
4
|
/**
|
|
4
5
|
* Checks a `runner` value from `storm.config.ts`. When `inherited` is given (the top level's raw `vercelSandbox`
|
|
5
|
-
* options object), a suite's `vercelSandbox` options merge shallowly over `inherited` before
|
|
6
|
-
* the suite may override only the top-level keys that differ.
|
|
6
|
+
* options object), a suite's `vercelSandbox` options merge shallowly over `inherited` before
|
|
7
|
+
* `checkVercelSandboxOptions` runs, so the suite may override only the top-level keys that differ. A declared `vcpus`
|
|
8
|
+
* rule is also checked against `definitions` so unknown resources or options fail at config load.
|
|
7
9
|
*/
|
|
8
|
-
export declare function checkRunner(value: unknown, inherited?: Readonly<Record<string, unknown
|
|
10
|
+
export declare function checkRunner(value: unknown, inherited?: Readonly<Record<string, unknown>>, definitions?: readonly ResourceDefinition[]): Checked<CheckedRunner>;
|
|
9
11
|
/**
|
|
10
12
|
* The raw options object of a top-level `vercelSandbox(...)` value, for a suite's `vercelSandbox(...)` to merge over;
|
|
11
13
|
* undefined when the top level declares no `vercel-sandbox` runner or its options are not a plain object.
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
// Checks a `runner` value from `storm.config.ts` (top-level or suite) and extracts top-level `vercelSandbox` options
|
|
2
|
-
// so a suite of the same kind can merge its partial options over them before `
|
|
3
|
-
|
|
2
|
+
// so a suite of the same kind can merge its partial options over them before `checkVercelSandboxOptions` fills
|
|
3
|
+
// defaults.
|
|
4
|
+
import { checkVercelSandboxOptions } from "../runner/index.js";
|
|
4
5
|
import { describeValue } from "../sdk/extension/index.js";
|
|
5
6
|
const FACTORY_HINT = "must be made by vercelSandbox({ … }) or launchMachine()";
|
|
6
7
|
/**
|
|
7
8
|
* Checks a `runner` value from `storm.config.ts`. When `inherited` is given (the top level's raw `vercelSandbox`
|
|
8
|
-
* options object), a suite's `vercelSandbox` options merge shallowly over `inherited` before
|
|
9
|
-
* the suite may override only the top-level keys that differ.
|
|
9
|
+
* options object), a suite's `vercelSandbox` options merge shallowly over `inherited` before
|
|
10
|
+
* `checkVercelSandboxOptions` runs, so the suite may override only the top-level keys that differ. A declared `vcpus`
|
|
11
|
+
* rule is also checked against `definitions` so unknown resources or options fail at config load.
|
|
10
12
|
*/
|
|
11
|
-
export function checkRunner(value, inherited) {
|
|
13
|
+
export function checkRunner(value, inherited, definitions = []) {
|
|
12
14
|
if (!isRecord(value)) {
|
|
13
15
|
return { ok: false, problems: [{ path: [], problem: `${FACTORY_HINT}, not ${describeValue(value)}` }] };
|
|
14
16
|
}
|
|
@@ -32,13 +34,37 @@ export function checkRunner(value, inherited) {
|
|
|
32
34
|
...inherited,
|
|
33
35
|
...Object.fromEntries(Object.entries(options).filter(([, entry]) => entry !== undefined)),
|
|
34
36
|
};
|
|
35
|
-
const checked =
|
|
37
|
+
const checked = checkVercelSandboxOptions(rawOptions);
|
|
36
38
|
if (!checked.ok)
|
|
37
39
|
return checked;
|
|
38
|
-
|
|
40
|
+
const vcpusProblems = checkVcpusRuleDefinitions(checked.value.vcpus, definitions);
|
|
41
|
+
if (vcpusProblems.length > 0)
|
|
42
|
+
return { ok: false, problems: vcpusProblems };
|
|
43
|
+
return { ok: true, value: { kind: "vercel-sandbox", options: checked.value } };
|
|
39
44
|
}
|
|
40
45
|
return { ok: false, problems: [{ path: [], problem: `${FACTORY_HINT}, not ${describeValue(value)}` }] };
|
|
41
46
|
}
|
|
47
|
+
/** Checks that a declared `vcpus` rule names a known resource definition and one of its options. */
|
|
48
|
+
function checkVcpusRuleDefinitions(vcpus, definitions) {
|
|
49
|
+
if (typeof vcpus === "number")
|
|
50
|
+
return [];
|
|
51
|
+
const definition = definitions.find((each) => each.name === vcpus.resource);
|
|
52
|
+
if (definition === undefined) {
|
|
53
|
+
const known = definitions.length === 0 ? "none" : definitions.map((each) => each.name).join(", ");
|
|
54
|
+
return [{ path: ["vcpus", "resource"], problem: `is not a resource; storm has ${known}` }];
|
|
55
|
+
}
|
|
56
|
+
if (!Object.hasOwn(definition.options, vcpus.option)) {
|
|
57
|
+
const optionNames = Object.keys(definition.options);
|
|
58
|
+
const available = optionNames.length === 0 ? "none" : optionNames.join(", ");
|
|
59
|
+
return [
|
|
60
|
+
{
|
|
61
|
+
path: ["vcpus", "option"],
|
|
62
|
+
problem: `is not a ${definition.name} option; ${definition.name} has ${available}`,
|
|
63
|
+
},
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
42
68
|
/**
|
|
43
69
|
* The raw options object of a top-level `vercelSandbox(...)` value, for a suite's `vercelSandbox(...)` to merge over;
|
|
44
70
|
* undefined when the top level declares no `vercel-sandbox` runner or its options are not a plain object.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Refusable } from "@vercel/clinkr";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { type Credential, type CredentialContext, type CredentialFailure, type CredentialOrigin, type CredentialSourceChoice } from "../credential/index.ts";
|
|
3
|
+
import { type Credential, type CredentialContext, type CredentialFailure, type CredentialOrigin, type CredentialSourceChoice, type VercelProjectOutcome } from "../credential/index.ts";
|
|
4
4
|
import { type credentialErrors } from "./credential-settle.ts";
|
|
5
5
|
/**
|
|
6
6
|
* The errors a credential source's `obtain()` refuses with. A command that obtains a credential spreads them into its
|
|
@@ -27,6 +27,14 @@ export declare const credentialSourceErrors: import("@vercel/clinkr").SharedErro
|
|
|
27
27
|
detail: z.ZodString;
|
|
28
28
|
fix: z.ZodString;
|
|
29
29
|
}, z.core.$strip>;
|
|
30
|
+
vercelOidcTokenFailed: z.ZodObject<{
|
|
31
|
+
cause: z.ZodEnum<{
|
|
32
|
+
"invalid-token": "invalid-token";
|
|
33
|
+
"missing-token": "missing-token";
|
|
34
|
+
}>;
|
|
35
|
+
detail: z.ZodString;
|
|
36
|
+
fix: z.ZodString;
|
|
37
|
+
}, z.core.$strip>;
|
|
30
38
|
}, {
|
|
31
39
|
readonly mintFailed: {
|
|
32
40
|
readonly exitCode: 1;
|
|
@@ -82,16 +90,39 @@ export declare const credentialSourceErrors: import("@vercel/clinkr").SharedErro
|
|
|
82
90
|
}[];
|
|
83
91
|
};
|
|
84
92
|
};
|
|
93
|
+
readonly vercelOidcTokenFailed: {
|
|
94
|
+
readonly exitCode: 1;
|
|
95
|
+
readonly description: "With --credential vercel-oidc, VERCEL_OIDC_TOKEN is missing, empty, or not a valid Vercel project OIDC token.";
|
|
96
|
+
readonly schema: z.ZodObject<{
|
|
97
|
+
cause: z.ZodEnum<{
|
|
98
|
+
"invalid-token": "invalid-token";
|
|
99
|
+
"missing-token": "missing-token";
|
|
100
|
+
}>;
|
|
101
|
+
detail: z.ZodString;
|
|
102
|
+
fix: z.ZodString;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
readonly render: ({ detail, fix }: {
|
|
105
|
+
cause: "invalid-token" | "missing-token";
|
|
106
|
+
detail: string;
|
|
107
|
+
fix: string;
|
|
108
|
+
}) => {
|
|
109
|
+
message: string;
|
|
110
|
+
next: {
|
|
111
|
+
type: "text";
|
|
112
|
+
text: string;
|
|
113
|
+
}[];
|
|
114
|
+
};
|
|
115
|
+
};
|
|
85
116
|
}>;
|
|
86
117
|
/** The error a credential source's `obtain()` refuses with. */
|
|
87
|
-
export type CredentialSourceError = ReturnType<typeof credentialSourceErrors.mintFailed> | ReturnType<typeof credentialSourceErrors.tokenRequestFailed>;
|
|
118
|
+
export type CredentialSourceError = ReturnType<typeof credentialSourceErrors.mintFailed> | ReturnType<typeof credentialSourceErrors.tokenRequestFailed> | ReturnType<typeof credentialSourceErrors.vercelOidcTokenFailed>;
|
|
88
119
|
/** A credential source's failure as the error `obtain()` refuses with. */
|
|
89
120
|
export declare function credentialSourceError(failure: CredentialFailure): CredentialSourceError;
|
|
90
121
|
/** A credential source as a command gets it from the credential launcher resolver. */
|
|
91
122
|
export interface CommandCredentialSource {
|
|
92
123
|
/**
|
|
93
124
|
* A credential to use now, getting one first if the source holds none it would hand out, or the error to end the
|
|
94
|
-
* command with: `mint_failed` or `
|
|
125
|
+
* command with: `mint_failed`, `token_request_failed`, or `vercel_oidc_token_failed`.
|
|
95
126
|
*/
|
|
96
127
|
obtain(): Promise<Refusable<{
|
|
97
128
|
readonly credential: Credential;
|
|
@@ -115,6 +146,13 @@ export interface CredentialTarget {
|
|
|
115
146
|
export interface CredentialReport {
|
|
116
147
|
readonly progress?: ((line: string) => Promise<void>) | undefined;
|
|
117
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* A credential source for a Vercel Sandbox, as a command gets it from the credential launcher resolver: what it
|
|
151
|
+
* obtains carries the team and project the credential names, or why it has none (`VercelProjectOutcome`).
|
|
152
|
+
*/
|
|
153
|
+
export interface CommandVercelProjectSource {
|
|
154
|
+
readonly obtain: () => Promise<VercelProjectOutcome>;
|
|
155
|
+
}
|
|
118
156
|
/**
|
|
119
157
|
* The credential launcher resolver. A command that uses it spreads `credentialErrors` and `credentialSourceErrors` into
|
|
120
158
|
* its outcomes.
|
|
@@ -122,12 +160,19 @@ export interface CredentialReport {
|
|
|
122
160
|
export interface CredentialResolver {
|
|
123
161
|
/**
|
|
124
162
|
* The credential source `choice` names. The mint needs the target's team and project, and refuses with
|
|
125
|
-
* `missing_target` without either;
|
|
126
|
-
* `obtain()`.
|
|
163
|
+
* `missing_target` without either; `github-actions` and `vercel-oidc` need neither. It gets nothing until `obtain()`.
|
|
127
164
|
*/
|
|
128
165
|
source(choice: CredentialSourceChoice["source"], target: CredentialTarget, report?: CredentialReport): Refusable<{
|
|
129
166
|
readonly source: CommandCredentialSource;
|
|
130
167
|
}, ReturnType<typeof credentialErrors.missingTarget>>;
|
|
168
|
+
/**
|
|
169
|
+
* The credential source `choice` names for a Vercel Sandbox (`mint` or `vercel-oidc`), whose credential comes with
|
|
170
|
+
* the team and project it names (`vercelProjectSource`). It refuses as `source` does, and gets nothing until
|
|
171
|
+
* `obtain()`.
|
|
172
|
+
*/
|
|
173
|
+
vercelProjectSource(choice: "mint" | "vercel-oidc", target: CredentialTarget, report?: CredentialReport): Refusable<{
|
|
174
|
+
readonly source: CommandVercelProjectSource;
|
|
175
|
+
}, ReturnType<typeof credentialErrors.missingTarget>>;
|
|
131
176
|
}
|
|
132
177
|
/** The credential launcher resolver over `gateways`. */
|
|
133
178
|
export declare function credentialResolver(gateways: CredentialContext): CredentialResolver;
|