@cnc-tools/storm 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/storm.js +54 -40
- package/dist/build-info.js +1 -1
- package/dist/chunks/{chunk-VL7WFTVQ.js → chunk-24UYAK4R.js} +465 -365
- package/dist/chunks/{chunk-DC2CDHNK.js → chunk-2JMWUKH3.js} +2074 -473
- package/dist/chunks/{chunk-FOZWA52V.js → chunk-3VXZONGE.js} +481 -376
- package/dist/chunks/{chunk-ZG3WQ4UF.js → chunk-55O4FCN4.js} +1 -1
- package/dist/chunks/{chunk-CN4EFA5J.js → chunk-72ZFEMAW.js} +1 -1
- package/dist/chunks/chunk-AS37D43E.js +2173 -0
- package/dist/chunks/chunk-CQAY6GLP.js +1260 -0
- package/dist/chunks/chunk-DZLU7BYK.js +340 -0
- package/dist/chunks/{chunk-R7XVBZOY.js → chunk-EEENLQHE.js} +59 -11
- package/dist/chunks/{chunk-TJNFVNKR.js → chunk-EI3XDCEI.js} +1 -1
- package/dist/chunks/{chunk-HVNK3I45.js → chunk-FDUY3BNF.js} +1 -1
- package/dist/chunks/{chunk-FCQUJDA4.js → chunk-GUCCYCIO.js} +4 -189
- package/dist/chunks/{chunk-OIY3DMF2.js → chunk-HBI4LEMH.js} +3 -3
- package/dist/chunks/{chunk-2MAD5NKK.js → chunk-K4MDQPLW.js} +1 -18
- package/dist/chunks/chunk-KK7PAWIZ.js +198 -0
- package/dist/chunks/{chunk-G3PHMXH5.js → chunk-KQ5FXRUD.js} +18 -1
- package/dist/chunks/{chunk-5VXBKPW6.js → chunk-LKXHGGGX.js} +1 -1
- package/dist/chunks/{chunk-P357TZAY.js → chunk-LOGHIUUB.js} +21 -18
- package/dist/chunks/{chunk-CK2GZEPK.js → chunk-OEPFINFT.js} +2 -2
- package/dist/chunks/{chunk-DWEAHX4T.js → chunk-OI4AP6Z7.js} +5 -5
- package/dist/chunks/{chunk-V4IKA3WI.js → chunk-PMBQWVTW.js} +26 -19
- package/dist/chunks/chunk-SZMYIIG2.js +88 -0
- package/dist/chunks/{chunk-5CCP36QQ.js → chunk-TXCOFC7N.js} +1 -1
- package/dist/chunks/{chunk-VUPZH7J2.js → chunk-UXD3TVWM.js} +1 -1
- package/dist/chunks/{chunk-3L52KNQA.js → chunk-WNW2QXQK.js} +8 -8
- package/dist/chunks/{chunk-AWBSONHB.js → chunk-XBDRVFEV.js} +55 -16
- package/dist/chunks/{live-app-WECQOQ4C.js → live-app-UY7BEDUN.js} +17 -13
- package/dist/cli.d.ts +28 -0
- package/dist/cli.js +64 -0
- package/dist/commands/exec/across-sandboxes-outcomes.d.ts +2 -2
- package/dist/commands/exec/across-sandboxes-outcomes.js +3 -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 +67 -14
- 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 +104 -22
- package/dist/commands/exec/outcomes.js +73 -26
- package/dist/commands/exec/plan-run.d.ts +58 -150
- package/dist/commands/exec/plan-run.js +239 -90
- 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 +4 -4
- 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 +8 -4
- package/dist/commands/runs/facts.js +19 -10
- package/dist/commands/runs/list/command.d.ts +16 -8
- package/dist/commands/runs/list/command.js +10 -10
- package/dist/commands/runs/list/outcomes.d.ts +8 -4
- package/dist/commands/runs/logs/command.js +10 -10
- package/dist/commands/runs/show/command.d.ts +16 -8
- package/dist/commands/runs/show/command.js +31 -29
- package/dist/commands/runs/show/metadata.js +1 -1
- package/dist/commands/runs/show/outcomes.d.ts +8 -4
- package/dist/commands/runs/show/outcomes.js +8 -6
- 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 +376 -101
- package/dist/commands/snapshots/build/command.js +447 -149
- 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 +242 -47
- 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 +298 -68
- 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 +247 -15
- package/dist/commands/snapshots/list/outcomes.js +223 -52
- 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 +17 -17
- package/dist/commands/suites/list/outcomes.js +2 -2
- package/dist/commands/test/command.d.ts +67 -14
- package/dist/commands/test/command.js +49 -252
- package/dist/commands/test/outcomes.d.ts +33 -7
- package/dist/config/check-runner.d.ts +3 -3
- package/dist/config/check-runner.js +8 -7
- 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/index.d.ts +2 -2
- package/dist/config/index.js +1 -1
- package/dist/config/runner.d.ts +5 -5
- package/dist/config/runner.js +1 -1
- package/dist/config/schema.d.ts +2 -2
- package/dist/config/schema.js +1 -1
- package/dist/config-file/define.d.ts +1 -1
- package/dist/config-file/define.js +1 -1
- package/dist/config-file/runner.d.ts +5 -5
- package/dist/config-file/toolchain.d.ts +14 -4
- package/dist/config-file/toolchain.js +43 -7
- package/dist/context.d.ts +10 -6
- package/dist/context.js +8 -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 +107 -267
- 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 +1 -1
- package/dist/extension-commands.js +2 -2
- 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 +1 -1
- package/dist/extensions/testserver/resource.js +1 -1
- 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 +3 -14
- package/dist/planning/plan-only.js +11 -20
- package/dist/planning/run-kind-flags.js +2 -2
- package/dist/planning/run-plan.d.ts +45 -12
- 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 +9 -0
- package/dist/run-directory/recording.js +3 -3
- package/dist/run-directory/run-record.d.ts +26 -11
- package/dist/run-directory/run-record.js +16 -13
- package/dist/runner/base.js +1 -1
- package/dist/runner/build-snapshots.d.ts +60 -29
- package/dist/runner/build-snapshots.js +136 -29
- 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 +122 -23
- package/dist/runner/gateways.js +1 -1
- package/dist/runner/gh.d.ts +42 -0
- package/dist/runner/gh.js +58 -0
- package/dist/runner/index.d.ts +13 -8
- package/dist/runner/index.js +12 -6
- package/dist/runner/live/checkout-gateway.js +7 -0
- package/dist/runner/live/gh-output.d.ts +17 -0
- package/dist/runner/live/gh-output.js +37 -0
- package/dist/runner/live/gh-token-gateway.d.ts +13 -0
- package/dist/runner/live/gh-token-gateway.js +51 -0
- 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 +140 -4
- 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 +12 -12
- package/dist/runner/local-snapshot-index.d.ts +205 -0
- package/dist/runner/local-snapshot-index.js +210 -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 +14 -14
- package/dist/runner/prepare.js +20 -11
- package/dist/runner/ready.d.ts +19 -11
- 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 +15 -8
- package/dist/runner/scope.js +16 -5
- package/dist/runner/secrets.d.ts +41 -18
- package/dist/runner/secrets.js +226 -30
- package/dist/runner/session.d.ts +8 -8
- package/dist/runner/session.js +6 -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 +79 -47
- package/dist/runner/snapshot-choice.js +2 -1
- package/dist/runner/snapshot-inspect.d.ts +39 -40
- package/dist/runner/snapshot-inspect.js +52 -35
- package/dist/runner/snapshot-key.d.ts +32 -17
- package/dist/runner/snapshot-key.js +43 -18
- package/dist/runner/snapshot-source.d.ts +31 -0
- package/dist/runner/snapshot-source.js +122 -0
- 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} +4 -2
- package/dist/runner/{recipe-check.js → vercel-sandbox-check.js} +7 -2
- package/dist/runner/{recipe.d.ts → vercel-sandbox-options.d.ts} +59 -28
- package/dist/runner/{recipe.js → vercel-sandbox-options.js} +128 -84
- package/dist/runner/vercel-sandbox-secrets.d.ts +116 -0
- package/dist/runner/{recipe-secrets.js → vercel-sandbox-secrets.js} +159 -26
- 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 +1 -1
- 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/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 +5 -3
- package/skills/overview.md +4 -4
- package/skills/plan-runs.md +1 -1
- package/skills/read-run-output.md +6 -6
- package/dist/application.d.ts +0 -21
- package/dist/application.js +0 -30
- package/dist/chunks/chunk-7EENF73W.js +0 -782
- package/dist/chunks/chunk-Z5PBVG3Y.js +0 -2599
- 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 -45
- package/dist/commands/exec/run-command.d.ts +0 -475
- package/dist/commands/exec/run-command.js +0 -603
- 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 -125
- package/dist/core/sandbox-end.d.ts +0 -64
- package/dist/runner/live/snapshot-cache-gateway.d.ts +0 -12
- package/dist/runner/recipe-secrets.d.ts +0 -67
- 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-HBI4LEMH.js";
|
|
7
7
|
import {
|
|
8
8
|
suiteNamesText,
|
|
9
9
|
suiteNotFoundErrors
|
|
10
|
-
} from "../../chunks/chunk-
|
|
10
|
+
} from "../../chunks/chunk-OEPFINFT.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-AS37D43E.js";
|
|
23
|
+
import "../../chunks/chunk-GUCCYCIO.js";
|
|
24
|
+
import "../../chunks/chunk-DZLU7BYK.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-FCQUJDA4.js";
|
|
40
|
+
} from "../../chunks/chunk-CQAY6GLP.js";
|
|
41
|
+
import "../../chunks/chunk-FDUY3BNF.js";
|
|
42
|
+
import "../../chunks/chunk-WNW2QXQK.js";
|
|
43
|
+
import "../../chunks/chunk-KK7PAWIZ.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-2MAD5NKK.js";
|
|
47
|
+
} from "../../chunks/chunk-OI4AP6Z7.js";
|
|
48
|
+
import "../../chunks/chunk-EEENLQHE.js";
|
|
49
|
+
import "../../chunks/chunk-72ZFEMAW.js";
|
|
50
|
+
import "../../chunks/chunk-UXD3TVWM.js";
|
|
51
|
+
import "../../chunks/chunk-55O4FCN4.js";
|
|
52
|
+
import "../../chunks/chunk-TXCOFC7N.js";
|
|
53
|
+
import "../../chunks/chunk-K4MDQPLW.js";
|
|
54
|
+
import "../../chunks/chunk-KQ5FXRUD.js";
|
|
61
55
|
import {
|
|
62
56
|
planSchema
|
|
63
|
-
} from "../../chunks/chunk-
|
|
64
|
-
import "../../chunks/chunk-G3PHMXH5.js";
|
|
57
|
+
} from "../../chunks/chunk-LOGHIUUB.js";
|
|
65
58
|
import "../../chunks/chunk-F6N34UWB.js";
|
|
66
|
-
import "../../chunks/chunk-
|
|
59
|
+
import "../../chunks/chunk-3VXZONGE.js";
|
|
67
60
|
import {
|
|
68
61
|
CONFIG_FILE_NAME,
|
|
69
|
-
CONFIG_FILE_NAMES_TEXT
|
|
70
|
-
|
|
71
|
-
} from "../../chunks/chunk-DC2CDHNK.js";
|
|
62
|
+
CONFIG_FILE_NAMES_TEXT
|
|
63
|
+
} from "../../chunks/chunk-2JMWUKH3.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-LKXHGGGX.js";
|
|
79
70
|
import {
|
|
80
71
|
defineErrors,
|
|
81
|
-
defineOutcomes
|
|
82
|
-
|
|
83
|
-
} from "../../chunks/chunk-VL7WFTVQ.js";
|
|
72
|
+
defineOutcomes
|
|
73
|
+
} from "../../chunks/chunk-24UYAK4R.js";
|
|
84
74
|
|
|
85
75
|
// src/commands/test/command.ts
|
|
86
76
|
import { z as z3 } from "zod";
|
|
@@ -257,198 +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(
|
|
427
|
-
({ argv, testFiles, testPlan }, { where, max, settings }) => {
|
|
428
|
-
const sandboxesDefault = where.recipe.sandboxes?.default;
|
|
429
|
-
if (sandboxesDefault === void 0)
|
|
430
|
-
throw new Error("planTestRun: a run across runner sandboxes from the default needs runner.sandboxes.default");
|
|
431
|
-
const resolved = resolveSandboxCountDefault(sandboxesDefault, testPlan);
|
|
432
|
-
const checked = driver.fileLists?.validate(args);
|
|
433
|
-
if (checked !== void 0 && !checked.ok)
|
|
434
|
-
return refused(
|
|
435
|
-
sandboxesDefaultErrors.sandboxesDefaultRefused({
|
|
436
|
-
key: SANDBOXES_DEFAULT_KEY,
|
|
437
|
-
sandboxes: Math.min(resolved, max, testFiles.length),
|
|
438
|
-
field: "args",
|
|
439
|
-
problem: checked.problem,
|
|
440
|
-
configFile: settings.configFile
|
|
441
|
-
})
|
|
442
|
-
);
|
|
443
|
-
return {
|
|
444
|
-
ok: true,
|
|
445
|
-
sandboxes: driverSandboxesRun({ argv, testFiles, asked: { from: "default", default: resolved }, max })
|
|
446
|
-
};
|
|
447
|
-
}
|
|
448
|
-
);
|
|
449
|
-
return await planDefaultSandboxesRun(app, request, planCommand, planDefaultSandboxes, signal);
|
|
450
|
-
}
|
|
451
|
-
|
|
452
250
|
// src/commands/test/test-words.ts
|
|
453
251
|
var TEST_HELP = {
|
|
454
252
|
usage: "[--suite <NAME>] [--count-tests] [--sandboxes <N> | --file-lists <PATH>] [<args>...] [-- <dash options>...]",
|
|
@@ -491,6 +289,10 @@ var COUNT_TESTS_FLAG_HELP = {
|
|
|
491
289
|
|
|
492
290
|
// src/commands/test/command.ts
|
|
493
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
|
+
}
|
|
494
296
|
var command_default = stormCommands.define({
|
|
495
297
|
requestSchema: z3.object({
|
|
496
298
|
...RUN_REQUEST_FIELDS,
|
|
@@ -541,18 +343,16 @@ var command_default = stormCommands.define({
|
|
|
541
343
|
configFile: file.path
|
|
542
344
|
});
|
|
543
345
|
await ui.progress?.(preRunLine(target, request.args.length, targetRedactor(target, app.env)));
|
|
544
|
-
const plan = await
|
|
545
|
-
|
|
546
|
-
driver,
|
|
547
|
-
testDriverRefusals,
|
|
548
|
-
args,
|
|
346
|
+
const plan = await planRun(
|
|
347
|
+
app,
|
|
549
348
|
{ ...request, settingsFile: target.settingsFile, suite: target.name },
|
|
550
|
-
{ countTests: request.countTests,
|
|
349
|
+
{ kind: "driver", driver, args, countTests: request.countTests, errors: testDriverRefusals },
|
|
350
|
+
context.signal
|
|
551
351
|
);
|
|
552
352
|
if (!plan.ok) return plan.refusal;
|
|
553
353
|
const test = { driver: driver.name, suite: target.name };
|
|
554
354
|
const extraMismatchHint = driver.fileLists?.extraMismatchHint;
|
|
555
|
-
return await
|
|
355
|
+
return await executePlannedRun(
|
|
556
356
|
context,
|
|
557
357
|
request,
|
|
558
358
|
{
|
|
@@ -560,15 +360,12 @@ var command_default = stormCommands.define({
|
|
|
560
360
|
test,
|
|
561
361
|
hints: driver.hints,
|
|
562
362
|
...extraMismatchHint === void 0 ? {} : { extraMismatchHint },
|
|
563
|
-
ran: (facts,
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
...test
|
|
570
|
-
});
|
|
571
|
-
},
|
|
363
|
+
ran: (facts, plan2, noFinalTestResults) => outcomes.ran({
|
|
364
|
+
...facts,
|
|
365
|
+
...plan2 === void 0 ? {} : { plan: plan2 },
|
|
366
|
+
noFinalTestResults,
|
|
367
|
+
...test
|
|
368
|
+
}),
|
|
572
369
|
sandboxesRan: (facts, noFinalTestResults) => outcomes.sandboxesRan({ ...facts, noFinalTestResults, ...test }),
|
|
573
370
|
planned: (facts) => outcomes.planned(facts)
|
|
574
371
|
},
|
|
@@ -96,7 +96,7 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
96
96
|
built: z.ZodBoolean;
|
|
97
97
|
vcpus: z.ZodNumber;
|
|
98
98
|
region: z.ZodString;
|
|
99
|
-
|
|
99
|
+
image: z.ZodString;
|
|
100
100
|
buildMs: z.ZodNumber;
|
|
101
101
|
}, z.core.$strip>>;
|
|
102
102
|
timeline: z.ZodObject<{
|
|
@@ -259,7 +259,7 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
259
259
|
built: z.ZodBoolean;
|
|
260
260
|
vcpus: z.ZodNumber;
|
|
261
261
|
region: z.ZodString;
|
|
262
|
-
|
|
262
|
+
image: z.ZodString;
|
|
263
263
|
uploadBytes: z.ZodNullable<z.ZodNumber>;
|
|
264
264
|
}, z.core.$strip>;
|
|
265
265
|
cleanup: z.ZodType<import("../../shared/cleanup.ts").StormCleanupFacts, import("../../shared/cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("../../shared/cleanup.ts").StormCleanupFacts, import("../../shared/cleanup.ts").StormCleanupFacts>>;
|
|
@@ -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;
|
|
@@ -356,9 +356,11 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
356
356
|
configFile: string | null;
|
|
357
357
|
}]>;
|
|
358
358
|
credentialsInvalid: import("@vercel/clinkr").SharedError<"credentials_invalid", [data: {
|
|
359
|
-
|
|
359
|
+
problems: {
|
|
360
360
|
name: string;
|
|
361
|
-
problem: "missing" | "multiline" | "short";
|
|
361
|
+
problem: "gh-failed" | "gh-not-authenticated" | "gh-not-installed" | "gh-preframed" | "gh-timed-out" | "missing" | "multiline" | "short";
|
|
362
|
+
detail: string;
|
|
363
|
+
hint: string;
|
|
362
364
|
}[];
|
|
363
365
|
minLength: number;
|
|
364
366
|
configFile: string | null;
|
|
@@ -426,6 +428,10 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
426
428
|
}[];
|
|
427
429
|
}[];
|
|
428
430
|
}]>;
|
|
431
|
+
keepSandboxManagedCredentials: import("@vercel/clinkr").SharedError<"keep_sandbox_managed_credentials", [data: {
|
|
432
|
+
providers: string[];
|
|
433
|
+
configFile: string | null;
|
|
434
|
+
}]>;
|
|
429
435
|
keepSandboxUnsafeSecretEnvVars: import("@vercel/clinkr").SharedError<"keep_sandbox_unsafe_secret_env_vars", [data: {
|
|
430
436
|
variables: string[];
|
|
431
437
|
configFile: string | null;
|
|
@@ -553,6 +559,13 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
553
559
|
minLength: number;
|
|
554
560
|
configFile: string | null;
|
|
555
561
|
}]>;
|
|
562
|
+
vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
563
|
+
cause: "invalid-token" | "missing-token";
|
|
564
|
+
detail: string;
|
|
565
|
+
fix: string;
|
|
566
|
+
runner: boolean;
|
|
567
|
+
cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
|
|
568
|
+
}]>;
|
|
556
569
|
}, {
|
|
557
570
|
readonly conflictingOptions: import("@vercel/clinkr").SharedError<"conflicting_options", [data: {
|
|
558
571
|
conflicts: {
|
|
@@ -568,9 +581,11 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
568
581
|
configFile: string | null;
|
|
569
582
|
}]>;
|
|
570
583
|
readonly credentialsInvalid: import("@vercel/clinkr").SharedError<"credentials_invalid", [data: {
|
|
571
|
-
|
|
584
|
+
problems: {
|
|
572
585
|
name: string;
|
|
573
|
-
problem: "missing" | "multiline" | "short";
|
|
586
|
+
problem: "gh-failed" | "gh-not-authenticated" | "gh-not-installed" | "gh-preframed" | "gh-timed-out" | "missing" | "multiline" | "short";
|
|
587
|
+
detail: string;
|
|
588
|
+
hint: string;
|
|
574
589
|
}[];
|
|
575
590
|
minLength: number;
|
|
576
591
|
configFile: string | null;
|
|
@@ -638,6 +653,10 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
638
653
|
}[];
|
|
639
654
|
}[];
|
|
640
655
|
}]>;
|
|
656
|
+
readonly keepSandboxManagedCredentials: import("@vercel/clinkr").SharedError<"keep_sandbox_managed_credentials", [data: {
|
|
657
|
+
providers: string[];
|
|
658
|
+
configFile: string | null;
|
|
659
|
+
}]>;
|
|
641
660
|
readonly keepSandboxUnsafeSecretEnvVars: import("@vercel/clinkr").SharedError<"keep_sandbox_unsafe_secret_env_vars", [data: {
|
|
642
661
|
variables: string[];
|
|
643
662
|
configFile: string | null;
|
|
@@ -765,4 +784,11 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
765
784
|
minLength: number;
|
|
766
785
|
configFile: string | null;
|
|
767
786
|
}]>;
|
|
787
|
+
readonly vercelOidcTokenFailed: import("@vercel/clinkr").SharedError<"vercel_oidc_token_failed", [data: {
|
|
788
|
+
cause: "invalid-token" | "missing-token";
|
|
789
|
+
detail: string;
|
|
790
|
+
fix: string;
|
|
791
|
+
runner: boolean;
|
|
792
|
+
cleanup: import("../../shared/cleanup.ts").StormCleanupFacts;
|
|
793
|
+
}]>;
|
|
768
794
|
}>;
|
|
@@ -3,9 +3,9 @@ import type { CheckedRunner } from "./runner.ts";
|
|
|
3
3
|
import type { Checked } from "./schema.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Checks a `runner` value from `storm.config.ts`. When `inherited` is given (the top level's raw `vercelSandbox`
|
|
6
|
-
* options object), a suite's `vercelSandbox` options merge shallowly over `inherited` before
|
|
7
|
-
* the suite may override only the top-level keys that differ. A declared `vcpus`
|
|
8
|
-
* `definitions` so unknown resources or options fail at config load.
|
|
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.
|
|
9
9
|
*/
|
|
10
10
|
export declare function checkRunner(value: unknown, inherited?: Readonly<Record<string, unknown>>, definitions?: readonly ResourceDefinition[]): Checked<CheckedRunner>;
|
|
11
11
|
/**
|
|
@@ -1,13 +1,14 @@
|
|
|
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. A declared `vcpus`
|
|
10
|
-
* `definitions` so unknown resources or options fail at config load.
|
|
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.
|
|
11
12
|
*/
|
|
12
13
|
export function checkRunner(value, inherited, definitions = []) {
|
|
13
14
|
if (!isRecord(value)) {
|
|
@@ -33,13 +34,13 @@ export function checkRunner(value, inherited, definitions = []) {
|
|
|
33
34
|
...inherited,
|
|
34
35
|
...Object.fromEntries(Object.entries(options).filter(([, entry]) => entry !== undefined)),
|
|
35
36
|
};
|
|
36
|
-
const checked =
|
|
37
|
+
const checked = checkVercelSandboxOptions(rawOptions);
|
|
37
38
|
if (!checked.ok)
|
|
38
39
|
return checked;
|
|
39
40
|
const vcpusProblems = checkVcpusRuleDefinitions(checked.value.vcpus, definitions);
|
|
40
41
|
if (vcpusProblems.length > 0)
|
|
41
42
|
return { ok: false, problems: vcpusProblems };
|
|
42
|
-
return { ok: true, value: { kind: "vercel-sandbox",
|
|
43
|
+
return { ok: true, value: { kind: "vercel-sandbox", options: checked.value } };
|
|
43
44
|
}
|
|
44
45
|
return { ok: false, problems: [{ path: [], problem: `${FACTORY_HINT}, not ${describeValue(value)}` }] };
|
|
45
46
|
}
|
|
@@ -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;
|