@cnc-tools/storm 0.0.0-stage → 0.5.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/bin/node-version.js +24 -0
- package/bin/storm.js +16 -0
- package/dist/application.d.ts +13 -0
- package/dist/application.js +23 -0
- package/dist/bin/storm.d.ts +1 -0
- package/dist/bin/storm.js +45 -0
- package/dist/build-info.js +3 -0
- package/dist/closed-terminal.d.ts +7 -0
- package/dist/closed-terminal.js +18 -0
- package/dist/combine-errors.d.ts +11 -0
- package/dist/combine-errors.js +19 -0
- package/dist/commands/dashboard.d.ts +11 -0
- package/dist/commands/dashboard.js +18 -0
- package/dist/commands/run/cleanup.d.ts +135 -0
- package/dist/commands/run/cleanup.js +171 -0
- package/dist/commands/run/command.d.ts +327 -0
- package/dist/commands/run/command.js +620 -0
- package/dist/commands/run/job-summary.d.ts +6 -0
- package/dist/commands/run/job-summary.js +31 -0
- package/dist/commands/run/live-view.d.ts +22 -0
- package/dist/commands/run/live-view.js +395 -0
- package/dist/commands/run/metadata.d.ts +47 -0
- package/dist/commands/run/metadata.js +83 -0
- package/dist/commands/run/mint-failed.d.ts +11 -0
- package/dist/commands/run/mint-failed.js +33 -0
- package/dist/commands/run/outcomes.d.ts +307 -0
- package/dist/commands/run/outcomes.js +332 -0
- package/dist/commands/run/progress.d.ts +44 -0
- package/dist/commands/run/progress.js +277 -0
- package/dist/commands/run/redaction.d.ts +15 -0
- package/dist/commands/run/redaction.js +40 -0
- package/dist/commands/run/run-collector.d.ts +30 -0
- package/dist/commands/run/run-collector.js +73 -0
- package/dist/commands/run/run-record.d.ts +144 -0
- package/dist/commands/run/run-record.js +96 -0
- package/dist/commands/run/tests-summary.d.ts +34 -0
- package/dist/commands/run/tests-summary.js +141 -0
- package/dist/commands/run/text.d.ts +22 -0
- package/dist/commands/run/text.js +74 -0
- package/dist/commands/run/view.d.ts +35 -0
- package/dist/commands/run/view.js +163 -0
- package/dist/commands/run/waterfall.d.ts +25 -0
- package/dist/commands/run/waterfall.js +108 -0
- package/dist/commands/run/worker-chart.d.ts +79 -0
- package/dist/commands/run/worker-chart.js +313 -0
- package/dist/commands/runs/facts.d.ts +150 -0
- package/dist/commands/runs/facts.js +292 -0
- package/dist/commands/runs/list/command.d.ts +86 -0
- package/dist/commands/runs/list/command.js +36 -0
- package/dist/commands/runs/list/metadata.d.ts +22 -0
- package/dist/commands/runs/list/metadata.js +19 -0
- package/dist/commands/runs/list/outcomes.d.ts +74 -0
- package/dist/commands/runs/list/outcomes.js +89 -0
- package/dist/commands/runs/logs/command.d.ts +72 -0
- package/dist/commands/runs/logs/command.js +51 -0
- package/dist/commands/runs/logs/metadata.d.ts +22 -0
- package/dist/commands/runs/logs/metadata.js +22 -0
- package/dist/commands/runs/logs/outcomes.d.ts +55 -0
- package/dist/commands/runs/logs/outcomes.js +77 -0
- package/dist/commands/runs/metadata.d.ts +3 -0
- package/dist/commands/runs/metadata.js +3 -0
- package/dist/commands/runs/past-run.d.ts +72 -0
- package/dist/commands/runs/past-run.js +99 -0
- package/dist/commands/runs/show/command.d.ts +176 -0
- package/dist/commands/runs/show/command.js +76 -0
- package/dist/commands/runs/show/metadata.d.ts +25 -0
- package/dist/commands/runs/show/metadata.js +22 -0
- package/dist/commands/runs/show/outcomes.d.ts +164 -0
- package/dist/commands/runs/show/outcomes.js +317 -0
- package/dist/config/by-name.d.ts +24 -0
- package/dist/config/by-name.js +26 -0
- package/dist/config/errors.d.ts +58 -0
- package/dist/config/errors.js +101 -0
- package/dist/config/gateways.d.ts +32 -0
- package/dist/config/gateways.js +1 -0
- package/dist/config/index.d.ts +9 -0
- package/dist/config/index.js +12 -0
- package/dist/config/live/config-gateway.d.ts +6 -0
- package/dist/config/live/config-gateway.js +71 -0
- package/dist/config/load.d.ts +54 -0
- package/dist/config/load.js +175 -0
- package/dist/config/resolve.d.ts +49 -0
- package/dist/config/resolve.js +94 -0
- package/dist/config/resource-config.d.ts +132 -0
- package/dist/config/resource-config.js +19 -0
- package/dist/config/schema.d.ts +64 -0
- package/dist/config/schema.js +57 -0
- package/dist/config/set.d.ts +16 -0
- package/dist/config/set.js +55 -0
- package/dist/config/settings-file.d.ts +41 -0
- package/dist/config/settings-file.js +72 -0
- package/dist/config-file/define.d.ts +37 -0
- package/dist/config-file/define.js +9 -0
- package/dist/config-file/toolchain.d.ts +9 -0
- package/dist/config-file/toolchain.js +41 -0
- package/dist/context.d.ts +86 -0
- package/dist/context.js +43 -0
- package/dist/core/command-provider.d.ts +126 -0
- package/dist/core/command-provider.js +13 -0
- package/dist/core/command-slots.d.ts +67 -0
- package/dist/core/command-slots.js +136 -0
- package/dist/core/events.d.ts +128 -0
- package/dist/core/events.js +15 -0
- package/dist/core/gateways.d.ts +249 -0
- package/dist/core/gateways.js +1 -0
- package/dist/core/index.d.ts +20 -0
- package/dist/core/index.js +18 -0
- package/dist/core/keyed.d.ts +12 -0
- package/dist/core/keyed.js +24 -0
- package/dist/core/lane.d.ts +46 -0
- package/dist/core/lane.js +5 -0
- package/dist/core/limit.d.ts +9 -0
- package/dist/core/limit.js +29 -0
- package/dist/core/live/command-gateway.d.ts +11 -0
- package/dist/core/live/command-gateway.js +83 -0
- package/dist/core/live/job-summary-gateway.d.ts +5 -0
- package/dist/core/live/job-summary-gateway.js +20 -0
- package/dist/core/live/progress-terminal.d.ts +20 -0
- package/dist/core/live/progress-terminal.js +173 -0
- package/dist/core/live/run-directory-gateway.d.ts +24 -0
- package/dist/core/live/run-directory-gateway.js +437 -0
- package/dist/core/mint.d.ts +10 -0
- package/dist/core/mint.js +14 -0
- package/dist/core/payload.d.ts +26 -0
- package/dist/core/payload.js +33 -0
- package/dist/core/presentation.d.ts +87 -0
- package/dist/core/presentation.js +5 -0
- package/dist/core/presentations.d.ts +56 -0
- package/dist/core/presentations.js +66 -0
- package/dist/core/provider.d.ts +69 -0
- package/dist/core/provider.js +5 -0
- package/dist/core/resource.d.ts +262 -0
- package/dist/core/resource.js +6 -0
- package/dist/core/resources.d.ts +131 -0
- package/dist/core/resources.js +254 -0
- package/dist/core/run-directory.d.ts +69 -0
- package/dist/core/run-directory.js +94 -0
- package/dist/core/run-state.d.ts +152 -0
- package/dist/core/run-state.js +313 -0
- package/dist/core/run.d.ts +187 -0
- package/dist/core/run.js +321 -0
- package/dist/core/state-directory.d.ts +19 -0
- package/dist/core/state-directory.js +29 -0
- package/dist/core/timeline.d.ts +63 -0
- package/dist/core/timeline.js +97 -0
- package/dist/core/timing.d.ts +22 -0
- package/dist/core/timing.js +26 -0
- package/dist/credential/credential.d.ts +46 -0
- package/dist/credential/credential.js +80 -0
- package/dist/credential/diagnosis.d.ts +18 -0
- package/dist/credential/diagnosis.js +99 -0
- package/dist/credential/gateways.d.ts +109 -0
- package/dist/credential/gateways.js +1 -0
- package/dist/credential/index.d.ts +7 -0
- package/dist/credential/index.js +7 -0
- package/dist/credential/live/github-actions-token-gateway.d.ts +15 -0
- package/dist/credential/live/github-actions-token-gateway.js +43 -0
- package/dist/credential/live/github-actions-token-response.d.ts +19 -0
- package/dist/credential/live/github-actions-token-response.js +49 -0
- package/dist/credential/live/vercel-cli-gateway.d.ts +9 -0
- package/dist/credential/live/vercel-cli-gateway.js +64 -0
- package/dist/credential/live/vercel-output.d.ts +60 -0
- package/dist/credential/live/vercel-output.js +122 -0
- package/dist/credential/live/vercel-process.d.ts +14 -0
- package/dist/credential/live/vercel-process.js +3 -0
- package/dist/credential/settle.d.ts +31 -0
- package/dist/credential/settle.js +49 -0
- package/dist/credential/source.d.ts +110 -0
- package/dist/credential/source.js +114 -0
- package/dist/help-logo.d.ts +11 -0
- package/dist/help-logo.js +56 -0
- package/dist/presentation.d.ts +26 -0
- package/dist/presentation.js +21 -0
- package/dist/resources/github/cleanup.d.ts +23 -0
- package/dist/resources/github/cleanup.js +39 -0
- package/dist/resources/github/command.d.ts +74 -0
- package/dist/resources/github/command.js +117 -0
- package/dist/resources/github/config.d.ts +16 -0
- package/dist/resources/github/config.js +37 -0
- package/dist/resources/github/events.d.ts +26 -0
- package/dist/resources/github/events.js +2 -0
- package/dist/resources/github/fixture-repo.d.ts +69 -0
- package/dist/resources/github/fixture-repo.js +60 -0
- package/dist/resources/github/gateways.d.ts +62 -0
- package/dist/resources/github/gateways.js +1 -0
- package/dist/resources/github/index.d.ts +12 -0
- package/dist/resources/github/index.js +15 -0
- package/dist/resources/github/live/fixture-repo-gateway.d.ts +12 -0
- package/dist/resources/github/live/fixture-repo-gateway.js +92 -0
- package/dist/resources/github/live/gateways.d.ts +6 -0
- package/dist/resources/github/live/gateways.js +13 -0
- package/dist/resources/github/presentation.d.ts +13 -0
- package/dist/resources/github/presentation.js +43 -0
- package/dist/resources/github/provider.d.ts +66 -0
- package/dist/resources/github/provider.js +58 -0
- package/dist/resources/github/resource-provider.d.ts +6 -0
- package/dist/resources/github/resource-provider.js +20 -0
- package/dist/resources/github/resource.d.ts +33 -0
- package/dist/resources/github/resource.js +12 -0
- package/dist/resources/testserver/cleanup.d.ts +14 -0
- package/dist/resources/testserver/cleanup.js +22 -0
- package/dist/resources/testserver/command.d.ts +322 -0
- package/dist/resources/testserver/command.js +245 -0
- package/dist/resources/testserver/commands/app.d.ts +18 -0
- package/dist/resources/testserver/commands/app.js +3 -0
- package/dist/resources/testserver/commands/create/command.d.ts +136 -0
- package/dist/resources/testserver/commands/create/command.js +158 -0
- package/dist/resources/testserver/commands/create/metadata.d.ts +31 -0
- package/dist/resources/testserver/commands/create/metadata.js +45 -0
- package/dist/resources/testserver/commands/create/outcomes.d.ts +111 -0
- package/dist/resources/testserver/commands/create/outcomes.js +172 -0
- package/dist/resources/testserver/commands/list/command.d.ts +60 -0
- package/dist/resources/testserver/commands/list/command.js +56 -0
- package/dist/resources/testserver/commands/list/metadata.d.ts +9 -0
- package/dist/resources/testserver/commands/list/metadata.js +9 -0
- package/dist/resources/testserver/commands/list/outcomes.d.ts +54 -0
- package/dist/resources/testserver/commands/list/outcomes.js +152 -0
- package/dist/resources/testserver/config.d.ts +18 -0
- package/dist/resources/testserver/config.js +77 -0
- package/dist/resources/testserver/credential-facts.d.ts +80 -0
- package/dist/resources/testserver/credential-facts.js +83 -0
- package/dist/resources/testserver/events.d.ts +59 -0
- package/dist/resources/testserver/events.js +4 -0
- package/dist/resources/testserver/index.d.ts +16 -0
- package/dist/resources/testserver/index.js +24 -0
- package/dist/resources/testserver/lane.d.ts +28 -0
- package/dist/resources/testserver/lane.js +139 -0
- package/dist/resources/testserver/live/gateways.d.ts +6 -0
- package/dist/resources/testserver/live/gateways.js +26 -0
- package/dist/resources/testserver/options.d.ts +5 -0
- package/dist/resources/testserver/options.js +5 -0
- package/dist/resources/testserver/pool/channels.d.ts +80 -0
- package/dist/resources/testserver/pool/channels.js +48 -0
- package/dist/resources/testserver/pool/create.d.ts +48 -0
- package/dist/resources/testserver/pool/create.js +45 -0
- package/dist/resources/testserver/pool/directory.d.ts +4 -0
- package/dist/resources/testserver/pool/directory.js +5 -0
- package/dist/resources/testserver/pool/gateways.d.ts +190 -0
- package/dist/resources/testserver/pool/gateways.js +1 -0
- package/dist/resources/testserver/pool/host.d.ts +8 -0
- package/dist/resources/testserver/pool/host.js +21 -0
- package/dist/resources/testserver/pool/index.d.ts +9 -0
- package/dist/resources/testserver/pool/index.js +10 -0
- package/dist/resources/testserver/pool/inspect.d.ts +53 -0
- package/dist/resources/testserver/pool/inspect.js +45 -0
- package/dist/resources/testserver/pool/lease.d.ts +84 -0
- package/dist/resources/testserver/pool/lease.js +125 -0
- package/dist/resources/testserver/pool/live/pool-records.d.ts +17 -0
- package/dist/resources/testserver/pool/live/pool-records.js +70 -0
- package/dist/resources/testserver/pool/live/pool-store-gateway.d.ts +12 -0
- package/dist/resources/testserver/pool/live/pool-store-gateway.js +435 -0
- package/dist/resources/testserver/pool/staleness.d.ts +16 -0
- package/dist/resources/testserver/pool/staleness.js +27 -0
- package/dist/resources/testserver/presentation.d.ts +9 -0
- package/dist/resources/testserver/presentation.js +217 -0
- package/dist/resources/testserver/provider.d.ts +177 -0
- package/dist/resources/testserver/provider.js +254 -0
- package/dist/resources/testserver/ran.d.ts +87 -0
- package/dist/resources/testserver/ran.js +140 -0
- package/dist/resources/testserver/resource-provider.d.ts +12 -0
- package/dist/resources/testserver/resource-provider.js +38 -0
- package/dist/resources/testserver/resource.d.ts +32 -0
- package/dist/resources/testserver/resource.js +10 -0
- package/dist/resources/testserver/run-sandbox.d.ts +13 -0
- package/dist/resources/testserver/run-sandbox.js +6 -0
- package/dist/resources/testserver/sandbox/channels.d.ts +12 -0
- package/dist/resources/testserver/sandbox/channels.js +21 -0
- package/dist/resources/testserver/sandbox/create-failure.d.ts +35 -0
- package/dist/resources/testserver/sandbox/create-failure.js +65 -0
- package/dist/resources/testserver/sandbox/create.d.ts +29 -0
- package/dist/resources/testserver/sandbox/create.js +37 -0
- package/dist/resources/testserver/sandbox/gateways.d.ts +150 -0
- package/dist/resources/testserver/sandbox/gateways.js +1 -0
- package/dist/resources/testserver/sandbox/index.d.ts +6 -0
- package/dist/resources/testserver/sandbox/index.js +7 -0
- package/dist/resources/testserver/sandbox/live/builds-response.d.ts +9 -0
- package/dist/resources/testserver/sandbox/live/builds-response.js +27 -0
- package/dist/resources/testserver/sandbox/live/control-plane-gateway.d.ts +17 -0
- package/dist/resources/testserver/sandbox/live/control-plane-gateway.js +133 -0
- package/dist/resources/testserver/sandbox/live/create-response.d.ts +35 -0
- package/dist/resources/testserver/sandbox/live/create-response.js +78 -0
- package/dist/resources/testserver/sandbox/live/fetch-failure.d.ts +24 -0
- package/dist/resources/testserver/sandbox/live/fetch-failure.js +45 -0
- package/dist/resources/testserver/sandbox/live/health-check-gateway.d.ts +11 -0
- package/dist/resources/testserver/sandbox/live/health-check-gateway.js +36 -0
- package/dist/resources/testserver/sandbox/live/sse.d.ts +12 -0
- package/dist/resources/testserver/sandbox/live/sse.js +32 -0
- package/dist/resources.d.ts +452 -0
- package/dist/resources.js +88 -0
- package/dist/runner/base.d.ts +40 -0
- package/dist/runner/base.js +52 -0
- package/dist/runner/context.d.ts +13 -0
- package/dist/runner/context.js +9 -0
- package/dist/runner/events.d.ts +179 -0
- package/dist/runner/events.js +16 -0
- package/dist/runner/gateways.d.ts +351 -0
- package/dist/runner/gateways.js +3 -0
- package/dist/runner/index.d.ts +19 -0
- package/dist/runner/index.js +18 -0
- package/dist/runner/live/checkout-gateway.d.ts +3 -0
- package/dist/runner/live/checkout-gateway.js +206 -0
- package/dist/runner/live/git-output.d.ts +14 -0
- package/dist/runner/live/git-output.js +32 -0
- package/dist/runner/live/sandbox-errors.d.ts +7 -0
- package/dist/runner/live/sandbox-errors.js +21 -0
- package/dist/runner/live/sandbox-gateway.d.ts +7 -0
- package/dist/runner/live/sandbox-gateway.js +427 -0
- package/dist/runner/live/snapshot-cache-gateway.d.ts +12 -0
- package/dist/runner/live/snapshot-cache-gateway.js +104 -0
- package/dist/runner/live/snapshot-records.d.ts +11 -0
- package/dist/runner/live/snapshot-records.js +57 -0
- package/dist/runner/live/terminal.d.ts +16 -0
- package/dist/runner/live/terminal.js +37 -0
- package/dist/runner/live/user.d.ts +2 -0
- package/dist/runner/live/user.js +11 -0
- package/dist/runner/output.d.ts +23 -0
- package/dist/runner/output.js +58 -0
- package/dist/runner/prepare.d.ts +67 -0
- package/dist/runner/prepare.js +59 -0
- package/dist/runner/ready.d.ts +68 -0
- package/dist/runner/ready.js +159 -0
- package/dist/runner/recipe.d.ts +126 -0
- package/dist/runner/recipe.js +302 -0
- package/dist/runner/remote-command.d.ts +77 -0
- package/dist/runner/remote-command.js +127 -0
- package/dist/runner/scope.d.ts +58 -0
- package/dist/runner/scope.js +117 -0
- package/dist/runner/snapshot-build.d.ts +33 -0
- package/dist/runner/snapshot-build.js +112 -0
- package/dist/runner/snapshot-cache.d.ts +84 -0
- package/dist/runner/snapshot-cache.js +126 -0
- package/dist/runner/snapshot-key.d.ts +52 -0
- package/dist/runner/snapshot-key.js +91 -0
- package/dist/runner/steps.d.ts +41 -0
- package/dist/runner/steps.js +49 -0
- package/dist/sdk/container/api-request.d.ts +32 -0
- package/dist/sdk/container/api-request.js +46 -0
- package/dist/sdk/container/container.d.ts +144 -0
- package/dist/sdk/container/container.js +346 -0
- package/dist/sdk/container/feature-flags.d.ts +37 -0
- package/dist/sdk/container/feature-flags.js +118 -0
- package/dist/sdk/container/gateways.d.ts +108 -0
- package/dist/sdk/container/gateways.js +1 -0
- package/dist/sdk/container/index.d.ts +5 -0
- package/dist/sdk/container/index.js +5 -0
- package/dist/sdk/container/live/container-gateway.d.ts +17 -0
- package/dist/sdk/container/live/container-gateway.js +114 -0
- package/dist/sdk/factories/build.d.ts +66 -0
- package/dist/sdk/factories/build.js +98 -0
- package/dist/sdk/factories/definition.d.ts +28 -0
- package/dist/sdk/factories/definition.js +16 -0
- package/dist/sdk/factories/definitions.d.ts +166 -0
- package/dist/sdk/factories/definitions.js +235 -0
- package/dist/sdk/factories/gateways.d.ts +25 -0
- package/dist/sdk/factories/gateways.js +1 -0
- package/dist/sdk/factories/index.d.ts +5 -0
- package/dist/sdk/factories/index.js +5 -0
- package/dist/sdk/factories/live/factory-gateway.d.ts +10 -0
- package/dist/sdk/factories/live/factory-gateway.js +29 -0
- package/dist/sdk/index.d.ts +7 -0
- package/dist/sdk/index.js +15 -0
- package/dist/sdk/payload/index.d.ts +2 -0
- package/dist/sdk/payload/index.js +4 -0
- package/dist/sdk/payload/payload.d.ts +47 -0
- package/dist/sdk/payload/payload.js +74 -0
- package/dist/sdk/payload/test-events.d.ts +102 -0
- package/dist/sdk/payload/test-events.js +59 -0
- package/dist/sdk/proxy/exchange.d.ts +58 -0
- package/dist/sdk/proxy/exchange.js +173 -0
- package/dist/sdk/proxy/faulted-exchange.d.ts +10 -0
- package/dist/sdk/proxy/faulted-exchange.js +106 -0
- package/dist/sdk/proxy/faults.d.ts +133 -0
- package/dist/sdk/proxy/faults.js +147 -0
- package/dist/sdk/proxy/index.d.ts +3 -0
- package/dist/sdk/proxy/index.js +3 -0
- package/dist/sdk/proxy/proxy.d.ts +93 -0
- package/dist/sdk/proxy/proxy.js +99 -0
- package/dist/sdk/proxy/records.d.ts +56 -0
- package/dist/sdk/proxy/records.js +56 -0
- package/dist/sdk/records/body.d.ts +89 -0
- package/dist/sdk/records/body.js +236 -0
- package/dist/sdk/records/index.d.ts +2 -0
- package/dist/sdk/records/index.js +4 -0
- package/dist/sdk/records/records.d.ts +49 -0
- package/dist/sdk/records/records.js +16 -0
- package/dist/sdk/seed/index.d.ts +1 -0
- package/dist/sdk/seed/index.js +3 -0
- package/dist/sdk/seed/seed.d.ts +221 -0
- package/dist/sdk/seed/seed.js +171 -0
- package/dist/sdk/testserver/clock.d.ts +8 -0
- package/dist/sdk/testserver/clock.js +10 -0
- package/dist/sdk/testserver/failure.d.ts +73 -0
- package/dist/sdk/testserver/failure.js +61 -0
- package/dist/sdk/testserver/index.d.ts +5 -0
- package/dist/sdk/testserver/index.js +8 -0
- package/dist/sdk/testserver/live/connect-failure.d.ts +7 -0
- package/dist/sdk/testserver/live/connect-failure.js +30 -0
- package/dist/sdk/testserver/live/request.d.ts +69 -0
- package/dist/sdk/testserver/live/request.js +89 -0
- package/dist/sdk/testserver/service-ids.d.ts +19 -0
- package/dist/sdk/testserver/service-ids.js +77 -0
- package/dist/sdk/testserver/test-id.d.ts +15 -0
- package/dist/sdk/testserver/test-id.js +28 -0
- package/dist/story/align.d.ts +37 -0
- package/dist/story/align.js +39 -0
- package/dist/story/artifact.d.ts +60 -0
- package/dist/story/artifact.js +93 -0
- package/dist/story/definition.d.ts +52 -0
- package/dist/story/definition.js +9 -0
- package/dist/story/diff.d.ts +9 -0
- package/dist/story/diff.js +97 -0
- package/dist/story/errors.d.ts +14 -0
- package/dist/story/errors.js +21 -0
- package/dist/story/gateways.d.ts +74 -0
- package/dist/story/gateways.js +3 -0
- package/dist/story/host.d.ts +27 -0
- package/dist/story/host.js +97 -0
- package/dist/story/index.d.ts +7 -0
- package/dist/story/index.js +9 -0
- package/dist/story/json.d.ts +16 -0
- package/dist/story/json.js +59 -0
- package/dist/story/live/artifact-gateway.d.ts +2 -0
- package/dist/story/live/artifact-gateway.js +82 -0
- package/dist/story/mode.d.ts +17 -0
- package/dist/story/mode.js +21 -0
- package/dist/story/orphans.d.ts +17 -0
- package/dist/story/orphans.js +15 -0
- package/dist/story/report.d.ts +30 -0
- package/dist/story/report.js +118 -0
- package/dist/story/run.d.ts +49 -0
- package/dist/story/run.js +160 -0
- package/dist/story/sequence.d.ts +30 -0
- package/dist/story/sequence.js +74 -0
- package/dist/story/settle.d.ts +94 -0
- package/dist/story/settle.js +70 -0
- package/dist/time/duration.d.ts +19 -0
- package/dist/time/duration.js +37 -0
- package/dist/time/index.d.ts +2 -0
- package/dist/time/index.js +4 -0
- package/dist/time/time.d.ts +15 -0
- package/dist/time/time.js +23 -0
- package/dist/vercel-cli/ansi.d.ts +13 -0
- package/dist/vercel-cli/ansi.js +32 -0
- package/dist/vercel-cli/arguments.d.ts +25 -0
- package/dist/vercel-cli/arguments.js +78 -0
- package/dist/vercel-cli/auth-config.d.ts +43 -0
- package/dist/vercel-cli/auth-config.js +36 -0
- package/dist/vercel-cli/clock.d.ts +9 -0
- package/dist/vercel-cli/clock.js +10 -0
- package/dist/vercel-cli/config-files.d.ts +24 -0
- package/dist/vercel-cli/config-files.js +40 -0
- package/dist/vercel-cli/context.d.ts +12 -0
- package/dist/vercel-cli/context.js +12 -0
- package/dist/vercel-cli/driver.d.ts +218 -0
- package/dist/vercel-cli/driver.js +364 -0
- package/dist/vercel-cli/entry.d.ts +8 -0
- package/dist/vercel-cli/entry.js +13 -0
- package/dist/vercel-cli/environment.d.ts +33 -0
- package/dist/vercel-cli/environment.js +72 -0
- package/dist/vercel-cli/errors.d.ts +8 -0
- package/dist/vercel-cli/errors.js +8 -0
- package/dist/vercel-cli/gateways.d.ts +103 -0
- package/dist/vercel-cli/gateways.js +4 -0
- package/dist/vercel-cli/index.d.ts +10 -0
- package/dist/vercel-cli/index.js +15 -0
- package/dist/vercel-cli/invocation.d.ts +234 -0
- package/dist/vercel-cli/invocation.js +397 -0
- package/dist/vercel-cli/keys.d.ts +14 -0
- package/dist/vercel-cli/keys.js +12 -0
- package/dist/vercel-cli/live/config-files.d.ts +28 -0
- package/dist/vercel-cli/live/config-files.js +66 -0
- package/dist/vercel-cli/live/process-gateway.d.ts +14 -0
- package/dist/vercel-cli/live/process-gateway.js +178 -0
- package/dist/vercel-cli/redaction.d.ts +13 -0
- package/dist/vercel-cli/redaction.js +22 -0
- package/dist/vercel-cli/report.d.ts +22 -0
- package/dist/vercel-cli/report.js +110 -0
- package/dist/vercel-cli/verbose.d.ts +7 -0
- package/dist/vercel-cli/verbose.js +24 -0
- package/dist/version.d.ts +20 -0
- package/dist/version.js +57 -0
- package/dist/vitest/config.d.ts +51 -0
- package/dist/vitest/config.js +61 -0
- package/dist/vitest/container-scope.d.ts +108 -0
- package/dist/vitest/container-scope.js +234 -0
- package/dist/vitest/diagnostics.d.ts +146 -0
- package/dist/vitest/diagnostics.js +306 -0
- package/dist/vitest/fixtures.d.ts +64 -0
- package/dist/vitest/fixtures.js +172 -0
- package/dist/vitest/gateways.d.ts +47 -0
- package/dist/vitest/gateways.js +3 -0
- package/dist/vitest/index.d.ts +3 -0
- package/dist/vitest/index.js +9 -0
- package/dist/vitest/list-output.d.ts +3 -0
- package/dist/vitest/list-output.js +19 -0
- package/dist/vitest/live/list-gateway.d.ts +7 -0
- package/dist/vitest/live/list-gateway.js +60 -0
- package/dist/vitest/ownership.d.ts +29 -0
- package/dist/vitest/ownership.js +68 -0
- package/dist/vitest/plan.d.ts +33 -0
- package/dist/vitest/plan.js +73 -0
- package/dist/vitest/sandbox.d.ts +16 -0
- package/dist/vitest/sandbox.js +35 -0
- package/dist/vitest/test-events.d.ts +41 -0
- package/dist/vitest/test-events.js +92 -0
- package/dist/vitest/test-results.d.ts +84 -0
- package/dist/vitest/test-results.js +160 -0
- package/dist/vitest/types.d.ts +68 -0
- package/dist/vitest/types.js +4 -0
- package/package.json +123 -4
- package/skills/overview.md +32 -0
- package/skills/read-run-output.md +65 -0
- package/README.md +0 -3
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// The Node version check `storm.js` runs before it loads anything else. Plain JavaScript without
|
|
2
|
+
// syntax newer than Node 12's (no `?.`, no `??`), so an old Node reaches the message instead of a
|
|
3
|
+
// syntax error.
|
|
4
|
+
|
|
5
|
+
const REQUIRED = [22, 19, 0];
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The message to print when `version` (as in `process.versions.node`, such as `22.18.0`) is older
|
|
9
|
+
* than Node 22.19.0, or `undefined` when it is new enough.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} version
|
|
12
|
+
* @returns {string | undefined}
|
|
13
|
+
*/
|
|
14
|
+
export function nodeVersionProblem(version) {
|
|
15
|
+
// A part that isn't a number counts as 0, and so does a missing one.
|
|
16
|
+
const parts = version.split(".").map((part) => Number.parseInt(part, 10) || 0);
|
|
17
|
+
for (let index = 0; index < REQUIRED.length; index++) {
|
|
18
|
+
const part = parts[index] ?? 0;
|
|
19
|
+
const required = REQUIRED[index] ?? 0;
|
|
20
|
+
if (part > required) return undefined;
|
|
21
|
+
if (part < required) return `storm needs Node 22.19 or later (this is Node ${version})`;
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
package/bin/storm.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Checks the Node version first: an older Node stops here with the version storm needs, before
|
|
3
|
+
// it loads any source. Then runs the TypeScript source in the cnc workspace (no build step), and the
|
|
4
|
+
// built JavaScript in a published install, where Node cannot strip types under node_modules. The
|
|
5
|
+
// entry is imported dynamically, because static imports load before the check runs.
|
|
6
|
+
import { existsSync } from "node:fs";
|
|
7
|
+
import { nodeVersionProblem } from "./node-version.js";
|
|
8
|
+
|
|
9
|
+
const problem = nodeVersionProblem(process.versions.node);
|
|
10
|
+
if (problem !== undefined) {
|
|
11
|
+
process.stderr.write(`${problem}\n`);
|
|
12
|
+
process.exitCode = 1;
|
|
13
|
+
} else {
|
|
14
|
+
const source = new URL("../src/bin/storm.ts", import.meta.url);
|
|
15
|
+
await import((existsSync(source) ? source : new URL("../dist/bin/storm.js", import.meta.url)).href);
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ClinkrApplication } from "@vercel/clinkr";
|
|
2
|
+
import type { StormApp } from "./context.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Discovers the `storm` command tree under `commands/`, and mounts each resource's own command tree beside it
|
|
5
|
+
* (`RESOURCE_MOUNTS`), such as the Testserver pool's `pool`; `version` is what root `--version` prints, the version
|
|
6
|
+
* and commit as a run's version line shows them (`versionText`). `accessible` is whether accessible mode is on
|
|
7
|
+
* (`VERCEL_ACCESSIBLE=1`), which leaves the help logo out of root help. Its skills, which `storm skills get` prints
|
|
8
|
+
* for agents, are the Markdown files in `skills/`, beside `src/` and `dist/`, so the path resolves the same from the
|
|
9
|
+
* source and the build.
|
|
10
|
+
*/
|
|
11
|
+
export declare function loadStormApplication(version: string, options: {
|
|
12
|
+
readonly accessible: boolean;
|
|
13
|
+
}): Promise<ClinkrApplication<StormApp>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { createApplication } from "@vercel/clinkr";
|
|
3
|
+
import { stormHelpLogo } from "./help-logo.js";
|
|
4
|
+
import { RESOURCE_MOUNTS } from "./resources.js";
|
|
5
|
+
const DESCRIPTION = "Run a command against Vercel Testserver sandboxes.";
|
|
6
|
+
/**
|
|
7
|
+
* Discovers the `storm` command tree under `commands/`, and mounts each resource's own command tree beside it
|
|
8
|
+
* (`RESOURCE_MOUNTS`), such as the Testserver pool's `pool`; `version` is what root `--version` prints, the version
|
|
9
|
+
* and commit as a run's version line shows them (`versionText`). `accessible` is whether accessible mode is on
|
|
10
|
+
* (`VERCEL_ACCESSIBLE=1`), which leaves the help logo out of root help. Its skills, which `storm skills get` prints
|
|
11
|
+
* for agents, are the Markdown files in `skills/`, beside `src/` and `dist/`, so the path resolves the same from the
|
|
12
|
+
* source and the build.
|
|
13
|
+
*/
|
|
14
|
+
export async function loadStormApplication(version, options) {
|
|
15
|
+
const { accessible } = options;
|
|
16
|
+
return await createApplication("storm", import.meta.dirname, {
|
|
17
|
+
description: DESCRIPTION,
|
|
18
|
+
version,
|
|
19
|
+
helpLogo: (terminal) => stormHelpLogo(terminal, { accessible }),
|
|
20
|
+
mounts: RESOURCE_MOUNTS,
|
|
21
|
+
skills: join(import.meta.dirname, "../skills"),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// The `storm` executable that `bin/storm.js` loads after its Node version check: read the version and the
|
|
2
|
+
// git commit it was built from, run the command tree under `runNodeCli` over the live Context, then exit with the
|
|
3
|
+
// status a command recorded past Clinkr's (a run's command's code), or else Clinkr's. When the terminal has closed
|
|
4
|
+
// before the outcome is written (EIO after SIGHUP), it exits with the status the run reached instead of failing.
|
|
5
|
+
import { readFileSync } from "node:fs";
|
|
6
|
+
import { runNodeCli } from "@vercel/clinkr/node";
|
|
7
|
+
import { loadStormApplication } from "../application.js";
|
|
8
|
+
import { closedTerminalStatus, isClosedTerminalError } from "../closed-terminal.js";
|
|
9
|
+
import { liveContext } from "../context.js";
|
|
10
|
+
import { resolvePresentation } from "../presentation.js";
|
|
11
|
+
import { RESOURCE_CONFIGS } from "../resources.js";
|
|
12
|
+
import { localUserName } from "../runner/index.js";
|
|
13
|
+
import { buildCommit, versionText } from "../version.js";
|
|
14
|
+
// `../../package.json` is the package manifest from both `src/bin/` and `dist/bin/`.
|
|
15
|
+
const manifest = JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf8"));
|
|
16
|
+
const commit = await buildCommit(import.meta.url);
|
|
17
|
+
let app;
|
|
18
|
+
let signalReason;
|
|
19
|
+
let status;
|
|
20
|
+
try {
|
|
21
|
+
const accessible = process.env["VERCEL_ACCESSIBLE"] === "1";
|
|
22
|
+
status = await runNodeCli(await loadStormApplication(versionText(manifest.version, commit), { accessible }), {
|
|
23
|
+
app: (host) => {
|
|
24
|
+
signalReason = () => host.signal.reason;
|
|
25
|
+
app = {
|
|
26
|
+
context: liveContext({ env: host.env }),
|
|
27
|
+
resourceConfigs: RESOURCE_CONFIGS,
|
|
28
|
+
env: host.env,
|
|
29
|
+
cwd: host.cwd,
|
|
30
|
+
version: manifest.version,
|
|
31
|
+
commit,
|
|
32
|
+
user: localUserName(),
|
|
33
|
+
presentation: resolvePresentation(host),
|
|
34
|
+
exit: { status: undefined },
|
|
35
|
+
};
|
|
36
|
+
return app;
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
if (!isClosedTerminalError(error))
|
|
42
|
+
throw error;
|
|
43
|
+
status = closedTerminalStatus(app?.exit.status, signalReason?.());
|
|
44
|
+
}
|
|
45
|
+
process.exitCode = app?.exit.status ?? status;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Whether `error` is a write to a terminal that has closed. */
|
|
2
|
+
export declare function isClosedTerminalError(error: unknown): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* The exit status after a closed terminal kept the outcome from being written: the status the command recorded
|
|
5
|
+
* (a run's command's code), else 128 + n for the first signal, as Clinkr would have exited, else 1.
|
|
6
|
+
*/
|
|
7
|
+
export declare function closedTerminalStatus(recorded: number | undefined, signalReason: unknown): number;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// What storm exits with when Clinkr can't write a command's outcome because the terminal has closed. After
|
|
2
|
+
// SIGHUP from a closed terminal, a write to it fails with EIO, which Clinkr's writer rejects with (unlike EPIPE, a
|
|
3
|
+
// closed pipe, which it ignores). By then the command has returned: a run has stopped and deleted its sandboxes and
|
|
4
|
+
// released its leases, and only its outcome went unwritten.
|
|
5
|
+
import { NodeSignalCancellation } from "@vercel/clinkr/node";
|
|
6
|
+
/** Whether `error` is a write to a terminal that has closed. */
|
|
7
|
+
export function isClosedTerminalError(error) {
|
|
8
|
+
return error instanceof Error && Reflect.get(error, "code") === "EIO";
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The exit status after a closed terminal kept the outcome from being written: the status the command recorded
|
|
12
|
+
* (a run's command's code), else 128 + n for the first signal, as Clinkr would have exited, else 1.
|
|
13
|
+
*/
|
|
14
|
+
export function closedTerminalStatus(recorded, signalReason) {
|
|
15
|
+
if (recorded !== undefined)
|
|
16
|
+
return recorded;
|
|
17
|
+
return signalReason instanceof NodeSignalCancellation ? signalReason.exitStatus : 1;
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AnyResourceError, RefusalDefinition } from "./core/index.ts";
|
|
2
|
+
/** One record with every member of a union of records. */
|
|
3
|
+
type Intersection<U> = (U extends unknown ? (part: U) => void : never) extends (all: infer I) => void ? I : never;
|
|
4
|
+
/**
|
|
5
|
+
* Every error of `records`, in order, as one record. It throws when two records name the same key, since one reason
|
|
6
|
+
* has one definition.
|
|
7
|
+
*/
|
|
8
|
+
export declare function combineErrors<R extends {
|
|
9
|
+
readonly [key: string]: AnyResourceError | RefusalDefinition;
|
|
10
|
+
}>(records: readonly R[]): Intersection<R>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// One record of named errors, or of error definitions, from several, for a command's `defineOutcomes`: the `run`
|
|
2
|
+
// command lists every resource's errors this way, and defines every resource's refusal errors from their combined
|
|
3
|
+
// definitions. Spreading the records would keep the last of two errors with the same key without a word, so this
|
|
4
|
+
// refuses a key two records share. It moves into Clinkr once a second consumer needs it.
|
|
5
|
+
/**
|
|
6
|
+
* Every error of `records`, in order, as one record. It throws when two records name the same key, since one reason
|
|
7
|
+
* has one definition.
|
|
8
|
+
*/
|
|
9
|
+
export function combineErrors(records) {
|
|
10
|
+
const combined = {};
|
|
11
|
+
for (const record of records)
|
|
12
|
+
for (const [key, error] of Object.entries(record)) {
|
|
13
|
+
if (Object.hasOwn(combined, key))
|
|
14
|
+
throw new Error(`Two resources define the error ${key}`);
|
|
15
|
+
combined[key] = error;
|
|
16
|
+
}
|
|
17
|
+
// Each key holds the error of the one record that names it, so the object has every record's members.
|
|
18
|
+
return combined;
|
|
19
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Where a runner run ran: the control plane team and project its sandboxes are in. */
|
|
2
|
+
export interface DashboardProject {
|
|
3
|
+
readonly team: string;
|
|
4
|
+
readonly project: string;
|
|
5
|
+
}
|
|
6
|
+
/** Sandbox `name`'s page in the Vercel dashboard, with what ran in it. */
|
|
7
|
+
export declare function sandboxPage(where: DashboardProject, name: string): string;
|
|
8
|
+
/** Sandbox `name`'s Connect page in the Vercel dashboard, which says how to open a shell in it. */
|
|
9
|
+
export declare function sandboxConnectPage(where: DashboardProject, name: string): string;
|
|
10
|
+
/** Snapshot `id`'s page in the Vercel dashboard. */
|
|
11
|
+
export declare function snapshotPage(where: DashboardProject, id: string): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// The Vercel dashboard's pages for a runner run's sandboxes and snapshots, which `storm run` and `storm runs`
|
|
2
|
+
// link to. Each URL takes the control plane team's slug, which `--scope` names, and the project's name.
|
|
3
|
+
/** The project's page in the Vercel dashboard. */
|
|
4
|
+
function projectPage({ team, project }) {
|
|
5
|
+
return `https://vercel.com/${encodeURIComponent(team)}/${encodeURIComponent(project)}`;
|
|
6
|
+
}
|
|
7
|
+
/** Sandbox `name`'s page in the Vercel dashboard, with what ran in it. */
|
|
8
|
+
export function sandboxPage(where, name) {
|
|
9
|
+
return `${projectPage(where)}/sandboxes/${encodeURIComponent(name)}`;
|
|
10
|
+
}
|
|
11
|
+
/** Sandbox `name`'s Connect page in the Vercel dashboard, which says how to open a shell in it. */
|
|
12
|
+
export function sandboxConnectPage(where, name) {
|
|
13
|
+
return `${sandboxPage(where, name)}/connect`;
|
|
14
|
+
}
|
|
15
|
+
/** Snapshot `id`'s page in the Vercel dashboard. */
|
|
16
|
+
export function snapshotPage(where, id) {
|
|
17
|
+
return `${projectPage(where)}/sandboxes/snapshots/${encodeURIComponent(id)}`;
|
|
18
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { type CommandError, type Row, type SharedError, type SnakeCase } from "@vercel/clinkr";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import type { RefusalDefinitions, RefusalFact, RefusalSchemaOf, ResourceCleanupFacts, ResourceReports, RunnerCleanupReport } from "../../core/index.ts";
|
|
4
|
+
import type { Resources, StormResourceCleanup } from "../../resources.ts";
|
|
5
|
+
/** A sandbox a runner run couldn't stop; its own timeout stops it. */
|
|
6
|
+
declare const notStoppedSchema: z.ZodObject<{
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
role: z.ZodEnum<{
|
|
9
|
+
runner: "runner";
|
|
10
|
+
"snapshot-build": "snapshot-build";
|
|
11
|
+
}>;
|
|
12
|
+
timeoutMinutes: z.ZodNumber;
|
|
13
|
+
message: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
/** A stopped sandbox a runner run couldn't delete; it stays listed in the Vercel project. */
|
|
16
|
+
declare const notDeletedSchema: z.ZodObject<{
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
role: z.ZodEnum<{
|
|
19
|
+
runner: "runner";
|
|
20
|
+
"snapshot-build": "snapshot-build";
|
|
21
|
+
}>;
|
|
22
|
+
message: z.ZodString;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
/** The runner sandbox a runner run kept running once it ended, so a person can connect to it. */
|
|
25
|
+
declare const keptSchema: z.ZodObject<{
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
stopsAt: z.ZodString;
|
|
28
|
+
url: z.ZodString;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
/** The runner sandbox a runner run couldn't keep running, so it stopped and deleted it. */
|
|
31
|
+
declare const notKeptSchema: z.ZodObject<{
|
|
32
|
+
name: z.ZodString;
|
|
33
|
+
message: z.ZodString;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
/**
|
|
36
|
+
* What closing a runner run's sandboxes left: the run's cleanup's `runner`, null with --local. `kept` is the runner
|
|
37
|
+
* sandbox it kept running, and `notKept` the one it couldn't keep running, so stopped and deleted; each null otherwise,
|
|
38
|
+
* such as with a keep time of 0.
|
|
39
|
+
*/
|
|
40
|
+
export declare const runnerCleanupSchema: z.ZodObject<{
|
|
41
|
+
kept: z.ZodNullable<z.ZodObject<{
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
stopsAt: z.ZodString;
|
|
44
|
+
url: z.ZodString;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
notKept: z.ZodNullable<z.ZodObject<{
|
|
47
|
+
name: z.ZodString;
|
|
48
|
+
message: z.ZodString;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
notStopped: z.ZodArray<z.ZodObject<{
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
role: z.ZodEnum<{
|
|
53
|
+
runner: "runner";
|
|
54
|
+
"snapshot-build": "snapshot-build";
|
|
55
|
+
}>;
|
|
56
|
+
timeoutMinutes: z.ZodNumber;
|
|
57
|
+
message: z.ZodString;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
notDeleted: z.ZodArray<z.ZodObject<{
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
role: z.ZodEnum<{
|
|
62
|
+
runner: "runner";
|
|
63
|
+
"snapshot-build": "snapshot-build";
|
|
64
|
+
}>;
|
|
65
|
+
message: z.ZodString;
|
|
66
|
+
}, z.core.$strip>>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
export type RunnerCleanup = z.infer<typeof runnerCleanupSchema>;
|
|
69
|
+
/** A sandbox a runner run couldn't stop, as a sentence. */
|
|
70
|
+
export declare function notStoppedText(sandbox: z.infer<typeof notStoppedSchema>): string;
|
|
71
|
+
/** A stopped sandbox a runner run couldn't delete, as a sentence. */
|
|
72
|
+
export declare function notDeletedText(sandbox: z.infer<typeof notDeletedSchema>): string;
|
|
73
|
+
/** The runner sandbox a run kept running, as a sentence. */
|
|
74
|
+
export declare function keptText(kept: z.infer<typeof keptSchema>): string;
|
|
75
|
+
/** The runner sandbox a run couldn't keep running, as a sentence. */
|
|
76
|
+
export declare function notKeptText(sandbox: z.infer<typeof notKeptSchema>): string;
|
|
77
|
+
/**
|
|
78
|
+
* Rows for the runner sandbox the run kept running, or couldn't keep, and the runner's sandboxes that couldn't be
|
|
79
|
+
* stopped or deleted, when there are any.
|
|
80
|
+
*/
|
|
81
|
+
export declare function runnerCleanupRows(cleanup: RunnerCleanup | null): (readonly ["Sandbox kept", readonly [`${string}, running until ${string}`, string]] | readonly ["Sandbox not kept", string] | readonly ["Sandboxes not deleted", string[]] | readonly ["Sandboxes not stopped", string[]])[];
|
|
82
|
+
/** Warnings for the runner sandbox the run couldn't keep running, and the sandboxes that couldn't be stopped or deleted. */
|
|
83
|
+
export declare function runnerCleanupWarnings(cleanup: RunnerCleanup | null): {
|
|
84
|
+
reason: string;
|
|
85
|
+
message: string;
|
|
86
|
+
}[];
|
|
87
|
+
/** What the run's cleanup left, as its outcomes report it under `cleanup`. */
|
|
88
|
+
export interface StormCleanupFacts {
|
|
89
|
+
/**
|
|
90
|
+
* In a runner run, the runner sandbox it kept running or couldn't keep, and the runner's sandboxes that couldn't be
|
|
91
|
+
* stopped or deleted; null otherwise.
|
|
92
|
+
*/
|
|
93
|
+
readonly runner: RunnerCleanup | null;
|
|
94
|
+
/** What releasing each resource the run held couldn't do, by name; `{}` when it held none. */
|
|
95
|
+
readonly resources: ResourceCleanupFacts<Resources>;
|
|
96
|
+
}
|
|
97
|
+
/** What a run that ended with its runner scope closed and its resources released held to clean up. */
|
|
98
|
+
export interface CleanupReport {
|
|
99
|
+
readonly runnerCleanup: RunnerCleanupReport | null;
|
|
100
|
+
readonly resourceCleanup: StormResourceCleanup;
|
|
101
|
+
}
|
|
102
|
+
/** Each of refusal definitions `R`, defined with the run's cleanup beside its own data. */
|
|
103
|
+
export type WithCleanup<R> = {
|
|
104
|
+
readonly [Key in keyof R & string]: SharedError<SnakeCase<Key>, [
|
|
105
|
+
z.input<RefusalSchemaOf<R[Key]>> & {
|
|
106
|
+
readonly cleanup: StormCleanupFacts;
|
|
107
|
+
}
|
|
108
|
+
]>;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* A resource's refusal errors, as the `run` command lists and returns them: each defined with the run's cleanup beside
|
|
112
|
+
* its own data (`errors`), and `build`, the one a refusal fact names, with the run's cleanup.
|
|
113
|
+
*/
|
|
114
|
+
export interface CleanupReporting<R> {
|
|
115
|
+
readonly errors: WithCleanup<R>;
|
|
116
|
+
build(fact: RefusalFact, cleanup: StormCleanupFacts): CommandError<SnakeCase<keyof R & string>>;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The run's cleanup, as its outcomes report it.
|
|
120
|
+
*
|
|
121
|
+
* - `schema`: `cleanup`.
|
|
122
|
+
* - `facts`: a run's cleanup, from what it held to clean up.
|
|
123
|
+
* - `rows`: the rows an outcome lists for what the cleanup couldn't do: the runner's first, then each resource's in
|
|
124
|
+
* provider order.
|
|
125
|
+
* - `withCleanup`: refusal errors, defined from their definitions with the run's cleanup beside each one's data.
|
|
126
|
+
*/
|
|
127
|
+
export interface RunCleanup {
|
|
128
|
+
readonly schema: z.ZodType<StormCleanupFacts, StormCleanupFacts>;
|
|
129
|
+
facts(report: CleanupReport): StormCleanupFacts;
|
|
130
|
+
rows(cleanup: StormCleanupFacts): readonly Row[];
|
|
131
|
+
withCleanup<R extends RefusalDefinitions>(definitions: R): CleanupReporting<R>;
|
|
132
|
+
}
|
|
133
|
+
/** The run's cleanup, reporting each resource's from `reports`. */
|
|
134
|
+
export declare function runCleanupOf(reports: ResourceReports<Resources>): RunCleanup;
|
|
135
|
+
export {};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// The run's cleanup, as its outcomes report it: the runner sandbox a runner run kept running, and what closing a runner
|
|
2
|
+
// run's sandboxes and releasing each resource the run held couldn't do. The run owns it, not a resource: every outcome
|
|
3
|
+
// after the run starts acquiring carries it as `cleanup`, with `runner` (the runner sandbox a runner run kept running
|
|
4
|
+
// or couldn't keep, and the sandboxes it couldn't stop or delete; null with --local) and
|
|
5
|
+
// `resources` (each held resource's cleanup facts, by name, from its cleanup report). The `run` command's own outcomes
|
|
6
|
+
// declare `cleanup` in their schemas; a resource's refusal errors don't know it, so a resource hands their definitions,
|
|
7
|
+
// and the registry defines them through `withCleanup`, with `cleanup` beside each one's data, and builds the one a
|
|
8
|
+
// refusal names with the run's cleanup.
|
|
9
|
+
import { defineErrors, } from "@vercel/clinkr";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { sandboxConnectPage } from "../dashboard.js";
|
|
12
|
+
import { isoSecondsText } from "./text.js";
|
|
13
|
+
/** A sandbox a runner run couldn't stop; its own timeout stops it. */
|
|
14
|
+
const notStoppedSchema = z.object({
|
|
15
|
+
name: z.string(),
|
|
16
|
+
role: z.enum(["runner", "snapshot-build"]),
|
|
17
|
+
/** The sandbox's own timeout, in minutes, within which it stops. */
|
|
18
|
+
timeoutMinutes: z.number(),
|
|
19
|
+
message: z.string(),
|
|
20
|
+
});
|
|
21
|
+
/** A stopped sandbox a runner run couldn't delete; it stays listed in the Vercel project. */
|
|
22
|
+
const notDeletedSchema = z.object({
|
|
23
|
+
name: z.string(),
|
|
24
|
+
role: z.enum(["runner", "snapshot-build"]),
|
|
25
|
+
message: z.string(),
|
|
26
|
+
});
|
|
27
|
+
/** The runner sandbox a runner run kept running once it ended, so a person can connect to it. */
|
|
28
|
+
const keptSchema = z.object({
|
|
29
|
+
name: z.string(),
|
|
30
|
+
/** When its timeout stops it, as an ISO time: the keep time from when the run ended, or later. */
|
|
31
|
+
stopsAt: z.string(),
|
|
32
|
+
/** Its Connect page in the Vercel dashboard, which says how to open a shell in it. */
|
|
33
|
+
url: z.string(),
|
|
34
|
+
});
|
|
35
|
+
/** The runner sandbox a runner run couldn't keep running, so it stopped and deleted it. */
|
|
36
|
+
const notKeptSchema = z.object({ name: z.string(), message: z.string() });
|
|
37
|
+
/**
|
|
38
|
+
* What closing a runner run's sandboxes left: the run's cleanup's `runner`, null with --local. `kept` is the runner
|
|
39
|
+
* sandbox it kept running, and `notKept` the one it couldn't keep running, so stopped and deleted; each null otherwise,
|
|
40
|
+
* such as with a keep time of 0.
|
|
41
|
+
*/
|
|
42
|
+
export const runnerCleanupSchema = z.object({
|
|
43
|
+
kept: keptSchema.nullable(),
|
|
44
|
+
notKept: notKeptSchema.nullable(),
|
|
45
|
+
notStopped: z.array(notStoppedSchema),
|
|
46
|
+
notDeleted: z.array(notDeletedSchema),
|
|
47
|
+
});
|
|
48
|
+
function sandboxRole(role) {
|
|
49
|
+
return role === "runner" ? "runner sandbox" : "build sandbox";
|
|
50
|
+
}
|
|
51
|
+
/** A sandbox a runner run couldn't stop, as a sentence. */
|
|
52
|
+
export function notStoppedText(sandbox) {
|
|
53
|
+
return `Couldn't stop the ${sandboxRole(sandbox.role)} ${sandbox.name}: ${sandbox.message}. Its own timeout stops it within ${sandbox.timeoutMinutes} minutes.`;
|
|
54
|
+
}
|
|
55
|
+
/** A stopped sandbox a runner run couldn't delete, as a sentence. */
|
|
56
|
+
export function notDeletedText(sandbox) {
|
|
57
|
+
return `Stopped the ${sandboxRole(sandbox.role)} ${sandbox.name}, but couldn't delete it: ${sandbox.message}. It stays listed in the Vercel project.`;
|
|
58
|
+
}
|
|
59
|
+
/** The runner sandbox a run kept running, as a sentence. */
|
|
60
|
+
export function keptText(kept) {
|
|
61
|
+
return `Kept the runner sandbox ${kept.name} running until ${isoSecondsText(kept.stopsAt)}, so you can connect to it: ${kept.url}`;
|
|
62
|
+
}
|
|
63
|
+
/** The runner sandbox a run couldn't keep running, as a sentence. */
|
|
64
|
+
export function notKeptText(sandbox) {
|
|
65
|
+
return `Couldn't keep the runner sandbox ${sandbox.name} running: ${sandbox.message}. Stopped and deleted it instead.`;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Rows for the runner sandbox the run kept running, or couldn't keep, and the runner's sandboxes that couldn't be
|
|
69
|
+
* stopped or deleted, when there are any.
|
|
70
|
+
*/
|
|
71
|
+
export function runnerCleanupRows(cleanup) {
|
|
72
|
+
if (cleanup === null)
|
|
73
|
+
return [];
|
|
74
|
+
const { kept, notKept } = cleanup;
|
|
75
|
+
return [
|
|
76
|
+
...(kept === null
|
|
77
|
+
? []
|
|
78
|
+
: [["Sandbox kept", [`${kept.name}, running until ${isoSecondsText(kept.stopsAt)}`, kept.url]]]),
|
|
79
|
+
...(notKept === null ? [] : [["Sandbox not kept", notKeptText(notKept)]]),
|
|
80
|
+
...(cleanup.notStopped.length === 0
|
|
81
|
+
? []
|
|
82
|
+
: [["Sandboxes not stopped", cleanup.notStopped.map(notStoppedText)]]),
|
|
83
|
+
...(cleanup.notDeleted.length === 0
|
|
84
|
+
? []
|
|
85
|
+
: [["Sandboxes not deleted", cleanup.notDeleted.map(notDeletedText)]]),
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
/** Warnings for the runner sandbox the run couldn't keep running, and the sandboxes that couldn't be stopped or deleted. */
|
|
89
|
+
export function runnerCleanupWarnings(cleanup) {
|
|
90
|
+
if (cleanup === null)
|
|
91
|
+
return [];
|
|
92
|
+
return [
|
|
93
|
+
...(cleanup.notKept === null ? [] : [{ reason: "runner_sandbox_not_kept", message: notKeptText(cleanup.notKept) }]),
|
|
94
|
+
...cleanup.notStopped.map((sandbox) => ({
|
|
95
|
+
reason: "runner_sandbox_not_stopped",
|
|
96
|
+
message: notStoppedText(sandbox),
|
|
97
|
+
})),
|
|
98
|
+
...cleanup.notDeleted.map((sandbox) => ({
|
|
99
|
+
reason: "runner_sandbox_not_deleted",
|
|
100
|
+
message: notDeletedText(sandbox),
|
|
101
|
+
})),
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
/** The run's cleanup, reporting each resource's from `reports`. */
|
|
105
|
+
export function runCleanupOf(reports) {
|
|
106
|
+
const schema = z.object({ runner: runnerCleanupSchema.nullable(), resources: reports.cleanupSchema });
|
|
107
|
+
const rows = (cleanup) => [
|
|
108
|
+
...runnerCleanupRows(cleanup.runner),
|
|
109
|
+
...reports.cleanupRows(cleanup.resources),
|
|
110
|
+
];
|
|
111
|
+
return {
|
|
112
|
+
schema,
|
|
113
|
+
facts: ({ runnerCleanup, resourceCleanup }) => ({
|
|
114
|
+
runner: runnerCleanupFacts(runnerCleanup),
|
|
115
|
+
resources: reports.cleanupFacts(resourceCleanup),
|
|
116
|
+
}),
|
|
117
|
+
rows,
|
|
118
|
+
withCleanup: (definitions) => {
|
|
119
|
+
const extended = Object.fromEntries(Object.entries(definitions).map(([key, own]) => {
|
|
120
|
+
// Its own shape with `cleanup` beside it, as a fresh object schema, so `cleanup` keeps its type.
|
|
121
|
+
const extendedSchema = z.object({ ...own.schema.shape, cleanup: schema });
|
|
122
|
+
const definition = {
|
|
123
|
+
...own,
|
|
124
|
+
schema: extendedSchema,
|
|
125
|
+
render: (data) => {
|
|
126
|
+
// Its own `render` takes the data its own schema parses, which the extended data holds, with `cleanup`
|
|
127
|
+
// beside it.
|
|
128
|
+
const { rows: ownRows = [], ...content } = own.render(data);
|
|
129
|
+
const all = [...ownRows, ...rows(data.cleanup)];
|
|
130
|
+
return { ...content, ...(all.length === 0 ? {} : { rows: all }) };
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
return [key, definition];
|
|
134
|
+
}));
|
|
135
|
+
const built = defineErrors(extended);
|
|
136
|
+
return {
|
|
137
|
+
// `defineErrors` keeps each key and its reason, and each schema is the definition's own with `cleanup` beside
|
|
138
|
+
// it.
|
|
139
|
+
errors: built,
|
|
140
|
+
build: ({ key, data }, cleanup) => {
|
|
141
|
+
const error = built[key];
|
|
142
|
+
// A resource's refusal facts name one of its own definitions (`CommandProvider`), each defined here, so the
|
|
143
|
+
// error is there, and its reason is one of the definitions' keys.
|
|
144
|
+
if (error === undefined)
|
|
145
|
+
throw new Error(`No refusal error is defined under ${key}`);
|
|
146
|
+
return error({ ...data, cleanup });
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* In a runner run, what closing the runner's sandbox scope left, as outcomes report it, with the kept runner sandbox's
|
|
154
|
+
* Connect page in the project its sandboxes are in; null otherwise.
|
|
155
|
+
*/
|
|
156
|
+
function runnerCleanupFacts(report) {
|
|
157
|
+
if (report === null)
|
|
158
|
+
return null;
|
|
159
|
+
const { kept, target } = report;
|
|
160
|
+
return {
|
|
161
|
+
kept: kept === null ? null : { name: kept.name, stopsAt: kept.stopsAt, url: sandboxConnectPage(target, kept.name) },
|
|
162
|
+
notKept: report.notKept === null ? null : { ...report.notKept },
|
|
163
|
+
notStopped: report.notStopped.map(({ name, role, timeoutMinutes, message }) => ({
|
|
164
|
+
name,
|
|
165
|
+
role,
|
|
166
|
+
timeoutMinutes,
|
|
167
|
+
message,
|
|
168
|
+
})),
|
|
169
|
+
notDeleted: report.notDeleted.map(({ name, role, message }) => ({ name, role, message })),
|
|
170
|
+
};
|
|
171
|
+
}
|