@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
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
import type { RecipeRun } from "../config/recipe-run.ts";
|
|
2
1
|
import type { SuiteRunnerConfig } from "../config/runner.ts";
|
|
3
2
|
import type { ConfigSettings } from "../config/schema.ts";
|
|
4
3
|
import type { SuiteConfig, SuiteConfigMap } from "../config/suite.ts";
|
|
5
|
-
import type { RunnerRecipe as RunnerRecipeOf } from "../runner/recipe.ts";
|
|
6
4
|
import type { Resource } from "../sdk/extension/resource-definition.ts";
|
|
7
5
|
export { launchMachine, vercelSandbox } from "./runner.ts";
|
|
8
6
|
export { pnpmToolchains } from "./toolchain.ts";
|
|
9
|
-
export type { RecipeRun } from "../config/recipe-run.ts";
|
|
10
7
|
export type { LaunchMachineRunner, RunnerConfig, RunnerKind, SuiteRunnerConfig, VercelSandboxRunner, } from "../config/runner.ts";
|
|
11
8
|
export type { SuiteConfig, SuiteConfigMap } from "../config/suite.ts";
|
|
12
|
-
export type { CredentialDeclaration,
|
|
13
|
-
export type { RunTestPlan } from "../sdk/extension/resource-definition.ts";
|
|
9
|
+
export type { CredentialDeclaration, RunnerSandboxCount, RunnerStep, RunnerVcpuCount, RunnerVcpuRule, SandboxCountDefault, SandboxCountDefaultRule, ToolchainStep, UnsafeSecretEnvVar, VercelSandboxOptions, } from "../runner/vercel-sandbox-options.ts";
|
|
14
10
|
export type { Resource } from "../sdk/extension/resource-definition.ts";
|
|
15
11
|
export type { SecretSource } from "../sdk/extension/secret-source.ts";
|
|
16
|
-
export type { Present } from "../sdk/run/launcher.ts";
|
|
17
|
-
/**
|
|
18
|
-
* The runner recipe passed to `vercelSandbox(options)`: its `vcpus` may be a function of the run (`RecipeRun`), which
|
|
19
|
-
* reads a resource by its resource factory, `run.get(<name>)`, as a `Present` of its options.
|
|
20
|
-
*/
|
|
21
|
-
export type RunnerRecipe = RunnerRecipeOf<RecipeRun>;
|
|
22
12
|
/**
|
|
23
13
|
* What a `storm.config.ts` can give: the top-level settings (the project's tests), a run's resources, and named
|
|
24
14
|
* variations under `suites`. A flag (`--scope`, `--project`, or a resource's own flag) overrides the file, and the
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// The config file's published surface, `@vercel/storm/config`. A user's `storm.config.ts` imports it, so it
|
|
2
2
|
// imports nothing at run time outside `src/config-file/` (`runner.ts` and `toolchain.ts`, which import nothing
|
|
3
3
|
// either): loading it pulls in no Clinkr, zod, or CLI code. Everything it takes from the modules, the top-level
|
|
4
|
-
// settings, the runner value types, the suite types, the runner
|
|
5
|
-
//
|
|
6
|
-
//
|
|
4
|
+
// settings, the runner value types, the suite types, the Vercel Sandbox runner options' types, and the resource's type, is a
|
|
5
|
+
// type-only import, erased at run time. A resource comes from its resource factory, which the config file imports from
|
|
6
|
+
// the resource's own export, `@vercel/storm/<resource>`.
|
|
7
7
|
//
|
|
8
8
|
// Its declarations ship too, and storm bundles Clinkr, so a consumer has no Clinkr to resolve them against. Each type
|
|
9
9
|
// comes from the file that declares it, not its module's `index.ts`, whose declarations reach Clinkr:
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import type { RecipeRun } from "../config/recipe-run.ts";
|
|
2
1
|
import type { LaunchMachineRunner, VercelSandboxRunner } from "../config/runner.ts";
|
|
3
|
-
import type {
|
|
2
|
+
import type { VercelSandboxOptions } from "../runner/vercel-sandbox-options.ts";
|
|
4
3
|
/** Declares the launch machine runner: runs the command on the launch machine as it is, with no isolation. */
|
|
5
4
|
export declare function launchMachine(): LaunchMachineRunner;
|
|
6
5
|
/**
|
|
7
|
-
* Declares the Vercel Sandbox runner with `options`. At the top level of `storm.config.ts`, `options` must be
|
|
8
|
-
*
|
|
6
|
+
* Declares the Vercel Sandbox runner with `options`. At the top level of `storm.config.ts`, `options` must be complete
|
|
7
|
+
* `VercelSandboxOptions`; in a suite under `suites`, `options` may override only the top-level option keys that
|
|
9
8
|
* differ.
|
|
10
9
|
*/
|
|
11
|
-
export declare function vercelSandbox(options:
|
|
12
|
-
export declare function vercelSandbox(options: Partial<
|
|
10
|
+
export declare function vercelSandbox(options: VercelSandboxOptions): VercelSandboxRunner;
|
|
11
|
+
export declare function vercelSandbox(options: Partial<VercelSandboxOptions>): VercelSandboxRunner<Partial<VercelSandboxOptions>>;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ToolchainStep } from "../runner/vercel-sandbox-options.ts";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `snapshot.toolchains`. It rejects when `packageManager` isn't `pnpm@<x.y.z>` or `engines.node` isn't `>=<x.y.z>`,
|
|
7
|
-
* which keeps a cached runner snapshot at that base from being used.
|
|
3
|
+
* Node program run inside `pnpmToolchains` to read `packageManager` and `engines.node` from the staged `package.json`
|
|
4
|
+
* and print `<nodeMin> <pnpmVersion>`. Exported from this file (not `@vercel/storm/config`) so tests can run it
|
|
5
|
+
* directly without slicing the shell script.
|
|
8
6
|
*/
|
|
9
|
-
export declare
|
|
7
|
+
export declare const PNPM_TOOLCHAINS_MANIFEST_SCRIPT: string;
|
|
8
|
+
/**
|
|
9
|
+
* Plain-data toolchain step for a pnpm workspace whose root `package.json` declares `packageManager` (`pnpm@<x.y.z>`)
|
|
10
|
+
* and `engines.node` (`>=<x.y.z>`). storm stages `package.json` into `/vercel/sandbox/package.json` before toolchain
|
|
11
|
+
* steps run, and the script puts `git` on `PATH`, downloads Node into `~/.local/bin` when the runtime's Node is older
|
|
12
|
+
* than `engines.node`, and installs the `packageManager` pnpm through corepack. Give it as `snapshot.toolchains`, or
|
|
13
|
+
* spread it alongside other toolchain steps (`[...pnpmToolchains, ...]`).
|
|
14
|
+
*/
|
|
15
|
+
export declare const pnpmToolchains: readonly ToolchainStep[];
|
|
@@ -1,41 +1,57 @@
|
|
|
1
|
-
// The toolchain steps a pnpm workspace's runner
|
|
2
|
-
// `define.ts`, it imports nothing at run time, so a config file that uses it loads no Clinkr, zod or CLI code.
|
|
1
|
+
// The toolchain steps a pnpm workspace's Vercel Sandbox runner can use, exported from `@vercel/storm/config`. Like
|
|
2
|
+
// `define.ts`, it imports nothing at run time, so a config file that uses it loads no Clinkr, zod, or CLI code.
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `snapshot.toolchains`. It rejects when `packageManager` isn't `pnpm@<x.y.z>` or `engines.node` isn't `>=<x.y.z>`,
|
|
8
|
-
* which keeps a cached runner snapshot at that base from being used.
|
|
4
|
+
* Node program run inside `pnpmToolchains` to read `packageManager` and `engines.node` from the staged `package.json`
|
|
5
|
+
* and print `<nodeMin> <pnpmVersion>`. Exported from this file (not `@vercel/storm/config`) so tests can run it
|
|
6
|
+
* directly without slicing the shell script.
|
|
9
7
|
*/
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
export const PNPM_TOOLCHAINS_MANIFEST_SCRIPT = String.raw `
|
|
9
|
+
const fs = require("node:fs");
|
|
10
|
+
const manifest = JSON.parse(fs.readFileSync("package.json", "utf8"));
|
|
11
|
+
const fields = typeof manifest === "object" && manifest !== null ? manifest : {};
|
|
12
|
+
const packageManager = fields.packageManager;
|
|
13
|
+
const pnpm = typeof packageManager === "string" ? /^pnpm@(\d+\.\d+\.\d+)/.exec(packageManager)?.[1] : undefined;
|
|
14
|
+
if (pnpm === undefined) {
|
|
15
|
+
console.error("package.json's packageManager isn't a pnpm version: " + String(packageManager));
|
|
16
|
+
process.exit(1);
|
|
13
17
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
throw new Error(`package.json's packageManager isn't a pnpm version: ${String(packageManager)}`);
|
|
20
|
-
const engine = typeof engines === "object" && engines !== null ? engines["node"] : undefined;
|
|
21
|
-
const node = typeof engine === "string" ? /^>=\s*(\d+\.\d+\.\d+)$/.exec(engine)?.[1] : undefined;
|
|
22
|
-
if (node === undefined)
|
|
23
|
-
throw new Error("package.json's engines.node isn't a >= minimum");
|
|
24
|
-
return [
|
|
25
|
-
"set -euo pipefail",
|
|
26
|
-
'mkdir -p "$HOME/.local/bin"',
|
|
27
|
-
"command -v git >/dev/null || sudo dnf install -y -q git",
|
|
28
|
-
"git --version",
|
|
29
|
-
`if ! node -e 'const [a, b, c] = process.versions.node.split(".").map(Number); const [x, y, z] = "${node}".split(".").map(Number); process.exit(a !== x ? (a > x ? 0 : 1) : b !== y ? (b > y ? 0 : 1) : c >= z ? 0 : 1)'; then`,
|
|
30
|
-
' case "$(uname -m)" in aarch64) arch=arm64 ;; *) arch=x64 ;; esac',
|
|
31
|
-
` curl -fsSL "https://nodejs.org/dist/v${node}/node-v${node}-linux-$arch.tar.gz" | tar -xz -C "$HOME/.local"`,
|
|
32
|
-
` ln -sf "$HOME/.local/node-v${node}-linux-$arch/bin/"* "$HOME/.local/bin/"`,
|
|
33
|
-
"fi",
|
|
34
|
-
"hash -r",
|
|
35
|
-
"node --version",
|
|
36
|
-
'corepack enable --install-directory "$HOME/.local/bin" pnpm',
|
|
37
|
-
`corepack install -g pnpm@${pnpm}`,
|
|
38
|
-
"hash -r",
|
|
39
|
-
"pnpm --version",
|
|
40
|
-
].join("\n");
|
|
18
|
+
const engine = typeof fields.engines === "object" && fields.engines !== null ? fields.engines.node : undefined;
|
|
19
|
+
const node = typeof engine === "string" ? /^>=\s*(\d+\.\d+\.\d+)$/.exec(engine)?.[1] : undefined;
|
|
20
|
+
if (node === undefined) {
|
|
21
|
+
console.error("package.json's engines.node isn't a >= minimum");
|
|
22
|
+
process.exit(1);
|
|
41
23
|
}
|
|
24
|
+
process.stdout.write(node + " " + pnpm + "\n");
|
|
25
|
+
`.trim();
|
|
26
|
+
/**
|
|
27
|
+
* Plain-data toolchain step for a pnpm workspace whose root `package.json` declares `packageManager` (`pnpm@<x.y.z>`)
|
|
28
|
+
* and `engines.node` (`>=<x.y.z>`). storm stages `package.json` into `/vercel/sandbox/package.json` before toolchain
|
|
29
|
+
* steps run, and the script puts `git` on `PATH`, downloads Node into `~/.local/bin` when the runtime's Node is older
|
|
30
|
+
* than `engines.node`, and installs the `packageManager` pnpm through corepack. Give it as `snapshot.toolchains`, or
|
|
31
|
+
* spread it alongside other toolchain steps (`[...pnpmToolchains, ...]`).
|
|
32
|
+
*/
|
|
33
|
+
export const pnpmToolchains = [
|
|
34
|
+
{
|
|
35
|
+
label: "Installing the toolchains",
|
|
36
|
+
baseFiles: ["package.json"],
|
|
37
|
+
script: [
|
|
38
|
+
"set -euo pipefail",
|
|
39
|
+
'mkdir -p "$HOME/.local/bin"',
|
|
40
|
+
"command -v git >/dev/null || sudo dnf install -y -q git",
|
|
41
|
+
"git --version",
|
|
42
|
+
`STORM_TOOLCHAINS="$(node - <<'STORM_MANIFEST_EOF'\n${PNPM_TOOLCHAINS_MANIFEST_SCRIPT}\nSTORM_MANIFEST_EOF\n)"`,
|
|
43
|
+
'read -r STORM_NODE_MIN STORM_PNPM_VERSION <<< "$STORM_TOOLCHAINS"',
|
|
44
|
+
`if ! node -e 'const [a, b, c] = process.versions.node.split(".").map(Number); const [x, y, z] = process.argv[1].split(".").map(Number); process.exit(a !== x ? (a > x ? 0 : 1) : b !== y ? (b > y ? 0 : 1) : c >= z ? 0 : 1)' "$STORM_NODE_MIN"; then`,
|
|
45
|
+
' case "$(uname -m)" in aarch64) arch=arm64 ;; *) arch=x64 ;; esac',
|
|
46
|
+
' curl -fsSL "https://nodejs.org/dist/v${STORM_NODE_MIN}/node-v${STORM_NODE_MIN}-linux-$arch.tar.gz" | tar -xz -C "$HOME/.local"',
|
|
47
|
+
' ln -sf "$HOME/.local/node-v${STORM_NODE_MIN}-linux-$arch/bin/"* "$HOME/.local/bin/"',
|
|
48
|
+
"fi",
|
|
49
|
+
"hash -r",
|
|
50
|
+
"node --version",
|
|
51
|
+
'corepack enable --install-directory "$HOME/.local/bin" pnpm',
|
|
52
|
+
'corepack install -g "pnpm@${STORM_PNPM_VERSION}"',
|
|
53
|
+
"hash -r",
|
|
54
|
+
"pnpm --version",
|
|
55
|
+
].join("\n"),
|
|
56
|
+
},
|
|
57
|
+
];
|
package/dist/context.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type ConfigGateway, type CredentialResolver, type FileListsFileGateway, type StormConfigResolver } from "./config/index.ts";
|
|
2
|
-
import { type CredentialGateway, type GitHubActionsTokenGateway } from "./credential/index.ts";
|
|
2
|
+
import { type CredentialGateway, type GitHubActionsTokenGateway, type VercelOidcTokenGateway } from "./credential/index.ts";
|
|
3
3
|
import type { PackageBinService } from "./launcher-resolvers/index.ts";
|
|
4
4
|
import type { Presentation } from "./presentation.ts";
|
|
5
5
|
import type { RESOURCES, StormDriverContextMap, StormResourceContextMap } from "./extensions.ts";
|
|
6
6
|
import { type CommandGateway, type JobSummaryGateway, type PackageBinGateway, type ProgressTerminal } from "./core/index.ts";
|
|
7
7
|
import { type RunDirectoryGateway } from "./run-directory/index.ts";
|
|
8
|
-
import { type CheckoutGateway, type RunnerSandboxGateway, type
|
|
8
|
+
import { type CheckoutGateway, type RunnerSandboxGateway, type RunnerSnapshotIndexGateway, type RunnerTerminal } from "./runner/index.ts";
|
|
9
9
|
import { type Clock, type Timer } from "./time/index.ts";
|
|
10
10
|
/**
|
|
11
11
|
* The gateways and DI seams storm's commands reach the outside through. Each resource reaches it through its own
|
|
@@ -16,14 +16,16 @@ export interface StormContext {
|
|
|
16
16
|
readonly credentials: CredentialGateway;
|
|
17
17
|
/** GitHub Actions' OIDC token issuer, for `--credential github-actions`. */
|
|
18
18
|
readonly githubActionsTokens: GitHubActionsTokenGateway;
|
|
19
|
+
/** `VERCEL_OIDC_TOKEN` reader, for `--credential vercel-oidc`. */
|
|
20
|
+
readonly vercelOidcTokens: VercelOidcTokenGateway;
|
|
19
21
|
readonly commands: CommandGateway;
|
|
20
22
|
readonly config: ConfigGateway;
|
|
21
23
|
/** The file lists file a run's `--file-lists` names. */
|
|
22
24
|
readonly fileListsFiles: FileListsFileGateway;
|
|
23
25
|
/** The local Git checkout the runner uploads from. */
|
|
24
26
|
readonly checkout: CheckoutGateway;
|
|
25
|
-
/** The per-machine
|
|
26
|
-
readonly runnerSnapshots:
|
|
27
|
+
/** The per-machine local snapshot index. */
|
|
28
|
+
readonly runnerSnapshots: RunnerSnapshotIndexGateway;
|
|
27
29
|
/** Vercel Sandbox, where runner and build sandboxes run. */
|
|
28
30
|
readonly runnerSandboxes: RunnerSandboxGateway;
|
|
29
31
|
/** The terminal the command's output reaches, wherever the command runs. */
|
|
@@ -113,9 +115,9 @@ export declare function localServices(launcher: {
|
|
|
113
115
|
* The live Context: `vercel` for credentials, and for `--credential github-actions` GitHub Actions' token request, read
|
|
114
116
|
* from `env`'s `ACTIONS_ID_TOKEN_REQUEST_*` at each request, with a 10-second timeout; the command spawned as a
|
|
115
117
|
* real process; `storm.config.ts`
|
|
116
|
-
* imported by Node; for the runner, git and tar on the local checkout, the
|
|
118
|
+
* imported by Node; for the runner, git and tar on the local checkout, the local snapshot index under `env`'s
|
|
117
119
|
* `XDG_STATE_HOME` or `HOME`, Vercel Sandbox through `@vercel/sandbox` (loaded only when the runner first calls it) and
|
|
118
|
-
* this process's stdout and stderr; the run directories beside the
|
|
120
|
+
* this process's stdout and stderr; the run directories beside the local snapshot index; the live view on this
|
|
119
121
|
* process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any; a package's binary found in
|
|
120
122
|
* `node_modules/.bin`; and the system timer and clock. When `env` names no place for the state directory, every runner
|
|
121
123
|
* snapshot cache operation fails and says why, which a run treats as an empty cache, and so does opening a run
|
package/dist/context.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Context (`liveResourceContexts`, through the registry), and each driver its own (`liveDriverContexts`), which the app
|
|
3
3
|
// holds beside the context, so this file names no resource and no driver's gateway.
|
|
4
4
|
import { configResolver, credentialResolver, liveConfigGateway, liveFileListsFileGateway, } from "./config/index.js";
|
|
5
|
-
import { liveCredentialGateway, liveGitHubActionsTokenGateway, } from "./credential/index.js";
|
|
5
|
+
import { liveCredentialGateway, liveGitHubActionsTokenGateway, liveVercelOidcTokenGateway, } from "./credential/index.js";
|
|
6
6
|
import { packageBinService } from "./local-services.js";
|
|
7
7
|
import { liveCommandGateway, liveJobSummaryGateway, livePackageBinGateway, liveProgressTerminal, resolveStateDirectory, stateDirectoryPattern, } from "./core/index.js";
|
|
8
8
|
import { liveRunDirectoryGateway, RUNS_SUBPATH, unavailableRunDirectoryGateway, } from "./run-directory/index.js";
|
|
9
|
-
import { liveCheckoutGateway, liveRunnerSandboxGateway,
|
|
9
|
+
import { liveCheckoutGateway, liveRunnerSandboxGateway, liveRunnerSnapshotIndexGateway, liveRunnerTerminal, RUNNER_SNAPSHOTS_SUBPATH, unavailableRunnerSnapshotIndexGateway, } from "./runner/index.js";
|
|
10
10
|
import { systemClock, systemTimer } from "./time/index.js";
|
|
11
11
|
/**
|
|
12
12
|
* The launcher resolvers over an app's context, from its working directory, checking the file against every resource
|
|
@@ -31,9 +31,9 @@ export function localServices(launcher) {
|
|
|
31
31
|
* The live Context: `vercel` for credentials, and for `--credential github-actions` GitHub Actions' token request, read
|
|
32
32
|
* from `env`'s `ACTIONS_ID_TOKEN_REQUEST_*` at each request, with a 10-second timeout; the command spawned as a
|
|
33
33
|
* real process; `storm.config.ts`
|
|
34
|
-
* imported by Node; for the runner, git and tar on the local checkout, the
|
|
34
|
+
* imported by Node; for the runner, git and tar on the local checkout, the local snapshot index under `env`'s
|
|
35
35
|
* `XDG_STATE_HOME` or `HOME`, Vercel Sandbox through `@vercel/sandbox` (loaded only when the runner first calls it) and
|
|
36
|
-
* this process's stdout and stderr; the run directories beside the
|
|
36
|
+
* this process's stdout and stderr; the run directories beside the local snapshot index; the live view on this
|
|
37
37
|
* process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any; a package's binary found in
|
|
38
38
|
* `node_modules/.bin`; and the system timer and clock. When `env` names no place for the state directory, every runner
|
|
39
39
|
* snapshot cache operation fails and says why, which a run treats as an empty cache, and so does opening a run
|
|
@@ -45,13 +45,14 @@ export function liveContext(options) {
|
|
|
45
45
|
return {
|
|
46
46
|
credentials: liveCredentialGateway(),
|
|
47
47
|
githubActionsTokens: liveGitHubActionsTokenGateway({ env: options.env, timeoutMs: 10_000 }),
|
|
48
|
+
vercelOidcTokens: liveVercelOidcTokenGateway({ env: options.env }),
|
|
48
49
|
commands: liveCommandGateway(),
|
|
49
50
|
config: liveConfigGateway(),
|
|
50
51
|
fileListsFiles: liveFileListsFileGateway(),
|
|
51
52
|
checkout: liveCheckoutGateway(),
|
|
52
53
|
runnerSnapshots: snapshots.ok
|
|
53
|
-
?
|
|
54
|
-
:
|
|
54
|
+
? liveRunnerSnapshotIndexGateway({ directory: snapshots.directory })
|
|
55
|
+
: unavailableRunnerSnapshotIndexGateway(stateDirectoryPattern(RUNNER_SNAPSHOTS_SUBPATH), snapshots.reason),
|
|
55
56
|
runnerSandboxes: liveRunnerSandboxGateway(),
|
|
56
57
|
runnerTerminal: liveRunnerTerminal({
|
|
57
58
|
env: options.env,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type RunnerTerminal } from "../runner/index.ts";
|
|
2
|
+
import { type RunContext, type RunControl, type RunnerCredentialChoice, type RunRunnerRequest } from "./coordinator.ts";
|
|
2
3
|
import type { RunProgress } from "./events.ts";
|
|
4
|
+
import { type AcrossSandboxesOutcome } from "./outcomes.ts";
|
|
3
5
|
import { type ResourceDefinitionSet } from "./resource-definition-set.ts";
|
|
4
6
|
import type { ResourceContextMap, ResourceRequests, ResourceSkip } from "./resource.ts";
|
|
5
|
-
import { type RunContext, type RunControl, type RunRunnerRequest } from "./run.ts";
|
|
6
|
-
import { type AcrossSandboxesOutcome } from "./sandbox-end.ts";
|
|
7
7
|
/** One runner sandbox's command and optional test file list. */
|
|
8
8
|
export interface SandboxCommand {
|
|
9
9
|
readonly argv: readonly string[];
|
|
@@ -22,6 +22,8 @@ export interface AcrossSandboxesRequest {
|
|
|
22
22
|
*/
|
|
23
23
|
readonly sandboxes: readonly SandboxCommand[];
|
|
24
24
|
readonly resources: ResourceRequests;
|
|
25
|
+
/** The credential source the run uses for the runner sandboxes and its resources (`mint` or `vercel-oidc`). */
|
|
26
|
+
readonly credential: RunnerCredentialChoice;
|
|
25
27
|
readonly skipped?: readonly ResourceSkip[];
|
|
26
28
|
}
|
|
27
29
|
/** The gateways and seams a run across runner sandboxes reaches the outside through. */
|
|
@@ -32,10 +34,9 @@ export interface AcrossSandboxesContext extends RunContext {
|
|
|
32
34
|
/**
|
|
33
35
|
* Runs a run across runner sandboxes (`request.sandboxes`) with the resources it asks for (`request.resources`).
|
|
34
36
|
*
|
|
35
|
-
* -
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* runner snapshot failure, then resource refusal.
|
|
37
|
+
* - Opening, credential obtainment, snapshot choice, resource acquire/split, and final release run once for the run.
|
|
38
|
+
* - Snapshot choice and resource acquire/split run concurrently under `coordinateSetup`; sandboxes start readying from
|
|
39
|
+
* the chosen snapshot while resources finish acquiring and splitting.
|
|
39
40
|
* - One runner sandbox's failure or throw never stops the others.
|
|
40
41
|
* - `snapshot_gone` ends the run with `snapshot_gone` only when every runner sandbox reports it; partial
|
|
41
42
|
* `snapshot_gone` ends as `sandboxes_ran` with affected runner sandboxes `not-started`.
|