@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,111 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** How `pool create` ends. No outcome carries the credential. */
|
|
3
|
+
export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
4
|
+
created: z.ZodObject<{
|
|
5
|
+
testserverUrl: z.ZodString;
|
|
6
|
+
logViewerUrl: z.ZodString;
|
|
7
|
+
requestedBuild: z.ZodString;
|
|
8
|
+
resolvedBuild: z.ZodString;
|
|
9
|
+
ttlMinutes: z.ZodNumber;
|
|
10
|
+
configFile: z.ZodNullable<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
}, {
|
|
13
|
+
created: unknown;
|
|
14
|
+
}, {
|
|
15
|
+
poolUnavailable: z.ZodObject<{
|
|
16
|
+
path: z.ZodString;
|
|
17
|
+
message: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
mintFailed: z.ZodObject<{
|
|
20
|
+
team: z.ZodString;
|
|
21
|
+
project: z.ZodString;
|
|
22
|
+
cause: z.ZodString;
|
|
23
|
+
fix: z.ZodString;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
tokenRequestFailed: z.ZodObject<{
|
|
26
|
+
cause: z.ZodEnum<{
|
|
27
|
+
"request-failed": "request-failed";
|
|
28
|
+
"variables-missing": "variables-missing";
|
|
29
|
+
}>;
|
|
30
|
+
missing: z.ZodNullable<z.ZodArray<z.ZodEnum<{
|
|
31
|
+
ACTIONS_ID_TOKEN_REQUEST_TOKEN: "ACTIONS_ID_TOKEN_REQUEST_TOKEN";
|
|
32
|
+
ACTIONS_ID_TOKEN_REQUEST_URL: "ACTIONS_ID_TOKEN_REQUEST_URL";
|
|
33
|
+
}>>>;
|
|
34
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
35
|
+
said: z.ZodNullable<z.ZodString>;
|
|
36
|
+
detail: z.ZodString;
|
|
37
|
+
fix: z.ZodString;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
credentialRejected: z.ZodObject<{
|
|
40
|
+
origin: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
41
|
+
source: z.ZodLiteral<"mint">;
|
|
42
|
+
team: z.ZodString;
|
|
43
|
+
project: z.ZodString;
|
|
44
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
45
|
+
source: z.ZodLiteral<"github-actions">;
|
|
46
|
+
claims: z.ZodNullable<z.ZodObject<{
|
|
47
|
+
aud: z.ZodString;
|
|
48
|
+
repository: z.ZodString;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
}, z.core.$strip>], "source">;
|
|
51
|
+
fix: z.ZodString;
|
|
52
|
+
status: z.ZodNumber;
|
|
53
|
+
vercelId: z.ZodNullable<z.ZodString>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
testserverUnreachable: z.ZodObject<{
|
|
56
|
+
attempts: z.ZodNumber;
|
|
57
|
+
code: z.ZodString;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
poolWriteFailed: z.ZodObject<{
|
|
60
|
+
testserverUrl: z.ZodString;
|
|
61
|
+
logViewerUrl: z.ZodString;
|
|
62
|
+
requestedBuild: z.ZodString;
|
|
63
|
+
resolvedBuild: z.ZodString;
|
|
64
|
+
ttlMinutes: z.ZodNumber;
|
|
65
|
+
configFile: z.ZodNullable<z.ZodString>;
|
|
66
|
+
path: z.ZodString;
|
|
67
|
+
message: z.ZodString;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
createFailed: z.ZodObject<{
|
|
70
|
+
kind: z.ZodEnum<{
|
|
71
|
+
dropped: "dropped";
|
|
72
|
+
"http-error": "http-error";
|
|
73
|
+
malformed: "malformed";
|
|
74
|
+
"stream-ended": "stream-ended";
|
|
75
|
+
"stream-error": "stream-error";
|
|
76
|
+
timeout: "timeout";
|
|
77
|
+
}>;
|
|
78
|
+
build: z.ZodString;
|
|
79
|
+
ttlMinutes: z.ZodNumber;
|
|
80
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
81
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
82
|
+
seconds: z.ZodNullable<z.ZodNumber>;
|
|
83
|
+
sandboxMayExist: z.ZodBoolean;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
|
|
86
|
+
file: string;
|
|
87
|
+
problems: {
|
|
88
|
+
key: string | null;
|
|
89
|
+
location: {
|
|
90
|
+
line: number;
|
|
91
|
+
column: number | null;
|
|
92
|
+
} | null;
|
|
93
|
+
problem: string;
|
|
94
|
+
}[];
|
|
95
|
+
}]>;
|
|
96
|
+
invalidResourceOptions: import("@vercel/clinkr").SharedError<"invalid_resource_options", [data: {
|
|
97
|
+
configFile: string | null;
|
|
98
|
+
problems: {
|
|
99
|
+
key: string;
|
|
100
|
+
problem: string;
|
|
101
|
+
values: {
|
|
102
|
+
key: string;
|
|
103
|
+
value: string;
|
|
104
|
+
source: "default" | "file" | "flag";
|
|
105
|
+
}[];
|
|
106
|
+
}[];
|
|
107
|
+
}]>;
|
|
108
|
+
missingTarget: import("@vercel/clinkr").SharedError<"missing_target", [data: {
|
|
109
|
+
missing: ("project" | "scope")[];
|
|
110
|
+
}]>;
|
|
111
|
+
}>;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { defineOutcomes, renderOutcome } from "@vercel/clinkr";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { configErrors } from "../../../../config/index.js";
|
|
4
|
+
import { credentialErrors } from "../../../../credential/index.js";
|
|
5
|
+
import { credentialOriginRows, rejectedCredentialShape, rejectedCredentialText, tokenRequestFailureShape, } from "../../credential-facts.js";
|
|
6
|
+
import { describeTtl } from "../../sandbox/index.js";
|
|
7
|
+
/** The `next` hint for a failed create that may have left a Testserver sandbox (`mayLeaveSandbox`), living `ttlMinutes`. */
|
|
8
|
+
function sandboxMayExist(ttlMinutes) {
|
|
9
|
+
return `A Testserver sandbox may exist anyway. Nothing can delete it, and it expires within ${describeTtl(ttlMinutes)}.`;
|
|
10
|
+
}
|
|
11
|
+
const createFailedKinds = ["http-error", "stream-error", "stream-ended", "dropped", "timeout", "malformed"];
|
|
12
|
+
/** The Testserver sandbox's details every outcome that reports a created one carries. */
|
|
13
|
+
const sandboxSchema = z.object({
|
|
14
|
+
/** The Testserver URL, with no trailing slash. */
|
|
15
|
+
testserverUrl: z.string(),
|
|
16
|
+
/** The log viewer URL, with no trailing slash. */
|
|
17
|
+
logViewerUrl: z.string(),
|
|
18
|
+
/** The build or build channel given with --build. */
|
|
19
|
+
requestedBuild: z.string(),
|
|
20
|
+
/** The build the Testserver sandbox runs. */
|
|
21
|
+
resolvedBuild: z.string(),
|
|
22
|
+
/** Its TTL, in minutes. */
|
|
23
|
+
ttlMinutes: z.number(),
|
|
24
|
+
/** The config file the settings came from (its absolute path); null when none applied. */
|
|
25
|
+
configFile: z.string().nullable(),
|
|
26
|
+
});
|
|
27
|
+
/** How `pool create` ends. No outcome carries the credential. */
|
|
28
|
+
export const outcomes = defineOutcomes({
|
|
29
|
+
results: {
|
|
30
|
+
created: {
|
|
31
|
+
schema: sandboxSchema,
|
|
32
|
+
description: "Created one Testserver sandbox with the TTL --ttl gives and added it to the pool, unleased.",
|
|
33
|
+
render: (sandbox) => renderOutcome({
|
|
34
|
+
done: ["Created", sandbox.testserverUrl],
|
|
35
|
+
rows: [
|
|
36
|
+
["Log viewer URL", sandbox.logViewerUrl],
|
|
37
|
+
["Requested build", sandbox.requestedBuild],
|
|
38
|
+
["Resolved build", sandbox.resolvedBuild],
|
|
39
|
+
["TTL", describeTtl(sandbox.ttlMinutes)],
|
|
40
|
+
],
|
|
41
|
+
message: "Added it to the pool, unleased.",
|
|
42
|
+
}),
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
errors: {
|
|
46
|
+
...configErrors,
|
|
47
|
+
...credentialErrors,
|
|
48
|
+
poolUnavailable: {
|
|
49
|
+
exitCode: 1,
|
|
50
|
+
description: "storm couldn't use the pool, so it minted no credential and created no Testserver sandbox.",
|
|
51
|
+
schema: z.object({
|
|
52
|
+
/** The pool directory that couldn't be made, or where the pool would live. */
|
|
53
|
+
path: z.string(),
|
|
54
|
+
/** What the OS said, or why there is no place for the pool. */
|
|
55
|
+
message: z.string(),
|
|
56
|
+
}),
|
|
57
|
+
render: ({ path, message }) => ({
|
|
58
|
+
message: `Couldn't prepare the pool: ${message}`,
|
|
59
|
+
rows: [["Pool path", path]],
|
|
60
|
+
next: [{ type: "text", text: "Fix the pool path, then retry. No Testserver sandbox was created." }],
|
|
61
|
+
}),
|
|
62
|
+
},
|
|
63
|
+
mintFailed: {
|
|
64
|
+
exitCode: 1,
|
|
65
|
+
description: "The vercel CLI couldn't mint a credential for the team and project.",
|
|
66
|
+
schema: z.object({ team: z.string(), project: z.string(), cause: z.string(), fix: z.string() }),
|
|
67
|
+
render: ({ cause, fix }) => ({
|
|
68
|
+
message: `Couldn't mint a credential: ${cause}.`,
|
|
69
|
+
next: [{ type: "text", text: fix }],
|
|
70
|
+
}),
|
|
71
|
+
},
|
|
72
|
+
tokenRequestFailed: {
|
|
73
|
+
exitCode: 1,
|
|
74
|
+
description: "With --credential github-actions, the GitHub Actions OIDC token request failed.",
|
|
75
|
+
schema: z.object(tokenRequestFailureShape),
|
|
76
|
+
render: ({ detail, fix }) => ({
|
|
77
|
+
message: `Couldn't request a GitHub Actions OIDC token: ${detail}.`,
|
|
78
|
+
next: [{ type: "text", text: fix }],
|
|
79
|
+
}),
|
|
80
|
+
},
|
|
81
|
+
credentialRejected: {
|
|
82
|
+
exitCode: 1,
|
|
83
|
+
description: "The Testserver control plane refused the credential, minted or a GitHub Actions OIDC token (a redirect to SSO, a 401 or a 403).",
|
|
84
|
+
schema: z.object({
|
|
85
|
+
...rejectedCredentialShape,
|
|
86
|
+
status: z.number(),
|
|
87
|
+
vercelId: z.string().nullable(),
|
|
88
|
+
}),
|
|
89
|
+
render: ({ origin, fix, status, vercelId }) => ({
|
|
90
|
+
message: `The Testserver control plane rejected ${rejectedCredentialText(origin)} (HTTP ${status}, x-vercel-id ${vercelId ?? "unknown"}).`,
|
|
91
|
+
rows: credentialOriginRows(origin),
|
|
92
|
+
next: [{ type: "text", text: fix }],
|
|
93
|
+
}),
|
|
94
|
+
},
|
|
95
|
+
testserverUnreachable: {
|
|
96
|
+
exitCode: 1,
|
|
97
|
+
description: "No create reached the Testserver control plane, after every attempt.",
|
|
98
|
+
schema: z.object({ attempts: z.number(), code: z.string() }),
|
|
99
|
+
render: ({ attempts, code }) => ({
|
|
100
|
+
message: `Couldn't reach the Testserver control plane after ${attempts} attempts (${code}).`,
|
|
101
|
+
next: [{ type: "text", text: "Check your network connection and any VPN or proxy, then retry." }],
|
|
102
|
+
}),
|
|
103
|
+
},
|
|
104
|
+
poolWriteFailed: {
|
|
105
|
+
exitCode: 1,
|
|
106
|
+
description: "Created the Testserver sandbox, but couldn't add it to the pool.",
|
|
107
|
+
schema: sandboxSchema.extend({
|
|
108
|
+
/** The pool file or directory the write failed on. */
|
|
109
|
+
path: z.string(),
|
|
110
|
+
/** What the OS said. */
|
|
111
|
+
message: z.string(),
|
|
112
|
+
}),
|
|
113
|
+
render: (failure) => ({
|
|
114
|
+
message: `Created the Testserver sandbox ${failure.testserverUrl}, but couldn't add it to the pool: ${failure.message}`,
|
|
115
|
+
rows: [
|
|
116
|
+
["Testserver URL", failure.testserverUrl],
|
|
117
|
+
["Log viewer URL", failure.logViewerUrl],
|
|
118
|
+
["Requested build", failure.requestedBuild],
|
|
119
|
+
["Resolved build", failure.resolvedBuild],
|
|
120
|
+
["Pool path", failure.path],
|
|
121
|
+
],
|
|
122
|
+
next: [
|
|
123
|
+
{
|
|
124
|
+
type: "text",
|
|
125
|
+
text: `The Testserver sandbox exists and expires within ${describeTtl(failure.ttlMinutes)}; nothing can delete it. Fix the pool path, then retry.`,
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
}),
|
|
129
|
+
},
|
|
130
|
+
createFailed: {
|
|
131
|
+
exitCode: 1,
|
|
132
|
+
description: "The create reached the Testserver control plane and failed.",
|
|
133
|
+
schema: z.object({
|
|
134
|
+
kind: z.enum(createFailedKinds),
|
|
135
|
+
build: z.string(),
|
|
136
|
+
/** The TTL the create asked for, in minutes: how long a Testserver sandbox it may have left lives. */
|
|
137
|
+
ttlMinutes: z.number(),
|
|
138
|
+
/** What the Testserver control plane or the connection said; null for stream-ended and timeout. */
|
|
139
|
+
detail: z.string().nullable(),
|
|
140
|
+
/** The HTTP status of an http-error; otherwise null. */
|
|
141
|
+
status: z.number().nullable(),
|
|
142
|
+
/** How long a timed-out create ran; otherwise null. */
|
|
143
|
+
seconds: z.number().nullable(),
|
|
144
|
+
/** Whether a Testserver sandbox may exist despite the failure: all kinds but http-error. */
|
|
145
|
+
sandboxMayExist: z.boolean(),
|
|
146
|
+
}),
|
|
147
|
+
render: (failure) => ({
|
|
148
|
+
message: createFailedMessage(failure),
|
|
149
|
+
...(failure.sandboxMayExist ? { next: [{ type: "text", text: sandboxMayExist(failure.ttlMinutes) }] } : {}),
|
|
150
|
+
}),
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
function createFailedMessage(failure) {
|
|
155
|
+
const said = failure.detail ?? "";
|
|
156
|
+
switch (failure.kind) {
|
|
157
|
+
case "http-error":
|
|
158
|
+
return `The Testserver control plane failed the create with HTTP ${failure.status ?? "an error"}: ${said}`;
|
|
159
|
+
case "stream-error":
|
|
160
|
+
return `The Testserver control plane couldn't create a Testserver sandbox on ${failure.build}: ${said}`;
|
|
161
|
+
case "stream-ended":
|
|
162
|
+
return "The create stream ended without a Testserver sandbox config.";
|
|
163
|
+
case "dropped":
|
|
164
|
+
return `The connection to the Testserver control plane dropped during the create: ${said}`;
|
|
165
|
+
case "timeout":
|
|
166
|
+
return failure.seconds === null
|
|
167
|
+
? "The create didn't finish in time."
|
|
168
|
+
: `The create didn't finish within ${failure.seconds}s.`;
|
|
169
|
+
case "malformed":
|
|
170
|
+
return `The Testserver control plane's sandbox config is malformed: ${said}`;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { CommandBuilder } from "@vercel/clinkr";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import type { TestserverCommandApp } from "../app.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Lists the pool: every pool entry, health-checked in parallel whether leased or not, with its lease state and
|
|
6
|
+
* time left, the entry files storm can't read, and the channel resolutions. It changes nothing and never
|
|
7
|
+
* mints.
|
|
8
|
+
*/
|
|
9
|
+
export declare function command(cmd: CommandBuilder<TestserverCommandApp>): import("@vercel/clinkr").CommandDefinition<z.ZodObject<{}, z.core.$strict>, import("@vercel/clinkr").Outcomes<{
|
|
10
|
+
listed: z.ZodObject<{
|
|
11
|
+
poolPath: z.ZodString;
|
|
12
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
13
|
+
testserverUrl: z.ZodString;
|
|
14
|
+
logViewerUrl: z.ZodString;
|
|
15
|
+
requestedBuild: z.ZodString;
|
|
16
|
+
resolvedBuild: z.ZodString;
|
|
17
|
+
createdAt: z.ZodString;
|
|
18
|
+
ttlMinutes: z.ZodNumber;
|
|
19
|
+
minutesLeft: z.ZodNumber;
|
|
20
|
+
lease: z.ZodObject<{
|
|
21
|
+
state: z.ZodEnum<{
|
|
22
|
+
free: "free";
|
|
23
|
+
leased: "leased";
|
|
24
|
+
stale: "stale";
|
|
25
|
+
}>;
|
|
26
|
+
pid: z.ZodNullable<z.ZodNumber>;
|
|
27
|
+
hostname: z.ZodNullable<z.ZodString>;
|
|
28
|
+
startedAt: z.ZodNullable<z.ZodString>;
|
|
29
|
+
holderAlive: z.ZodNullable<z.ZodBoolean>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
leaseGuard: z.ZodBoolean;
|
|
32
|
+
health: z.ZodObject<{
|
|
33
|
+
kind: z.ZodEnum<{
|
|
34
|
+
answers: "answers";
|
|
35
|
+
expired: "expired";
|
|
36
|
+
failed: "failed";
|
|
37
|
+
}>;
|
|
38
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
39
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
unreadable: z.ZodArray<z.ZodObject<{
|
|
43
|
+
file: z.ZodString;
|
|
44
|
+
reason: z.ZodString;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
channels: z.ZodArray<z.ZodObject<{
|
|
47
|
+
channel: z.ZodString;
|
|
48
|
+
build: z.ZodString;
|
|
49
|
+
learnedAt: z.ZodString;
|
|
50
|
+
ageMinutes: z.ZodNumber;
|
|
51
|
+
}, z.core.$strip>>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
}, {
|
|
54
|
+
listed: unknown;
|
|
55
|
+
}, {
|
|
56
|
+
poolUnreadable: z.ZodObject<{
|
|
57
|
+
path: z.ZodString;
|
|
58
|
+
message: z.ZodString;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
}>, TestserverCommandApp, false>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { inspectPool } from "../../pool/index.js";
|
|
3
|
+
import { outcomes } from "./outcomes.js";
|
|
4
|
+
/**
|
|
5
|
+
* Lists the pool: every pool entry, health-checked in parallel whether leased or not, with its lease state and
|
|
6
|
+
* time left, the entry files storm can't read, and the channel resolutions. It changes nothing and never
|
|
7
|
+
* mints.
|
|
8
|
+
*/
|
|
9
|
+
export function command(cmd) {
|
|
10
|
+
return cmd.define({
|
|
11
|
+
requestSchema: z.object({}).strict(),
|
|
12
|
+
outcomes,
|
|
13
|
+
handler: async ({ app }) => {
|
|
14
|
+
const inspected = await inspectPool(app.context);
|
|
15
|
+
if (!inspected.ok)
|
|
16
|
+
return outcomes.poolUnreadable({ ...inspected.failure });
|
|
17
|
+
const { directory, entries, unreadable, channels } = inspected.value;
|
|
18
|
+
return outcomes.listed({
|
|
19
|
+
poolPath: directory,
|
|
20
|
+
entries: entries.map(listedEntry),
|
|
21
|
+
unreadable: unreadable.map(({ file, reason }) => ({ file, reason })),
|
|
22
|
+
channels: channels.map(({ channel, build, learnedAt, ageMinutes }) => ({
|
|
23
|
+
channel,
|
|
24
|
+
build,
|
|
25
|
+
learnedAt,
|
|
26
|
+
ageMinutes,
|
|
27
|
+
})),
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function listedEntry(inspected) {
|
|
33
|
+
const { entry, lease, health } = inspected;
|
|
34
|
+
return {
|
|
35
|
+
testserverUrl: entry.testserverUrl,
|
|
36
|
+
logViewerUrl: entry.logViewerUrl,
|
|
37
|
+
requestedBuild: entry.requestedBuild,
|
|
38
|
+
resolvedBuild: entry.resolvedBuild,
|
|
39
|
+
createdAt: entry.createdAt,
|
|
40
|
+
ttlMinutes: entry.ttlMinutes,
|
|
41
|
+
minutesLeft: inspected.minutesLeft,
|
|
42
|
+
lease: lease.state === "free"
|
|
43
|
+
? { state: lease.state, pid: null, hostname: null, startedAt: null, holderAlive: null }
|
|
44
|
+
: {
|
|
45
|
+
state: lease.state,
|
|
46
|
+
pid: lease.holder?.pid ?? null,
|
|
47
|
+
hostname: lease.holder?.hostname ?? null,
|
|
48
|
+
startedAt: lease.startedAt,
|
|
49
|
+
holderAlive: lease.holder?.alive ?? null,
|
|
50
|
+
},
|
|
51
|
+
leaseGuard: inspected.leaseGuard,
|
|
52
|
+
health: health.kind === "failed"
|
|
53
|
+
? { kind: health.kind, status: null, detail: health.detail }
|
|
54
|
+
: { kind: health.kind, status: health.status, detail: null },
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const metadata = {
|
|
2
|
+
description: "List every pool entry with its lease, the time it has left, and a fresh health check, along with the channel resolutions and any entry files storm can't read. Changes nothing: expired entries stay until a later run drops them, and stale leases until a later run reclaims them.",
|
|
3
|
+
summary: "List the pool's Testserver sandboxes.",
|
|
4
|
+
aliases: ["ls"],
|
|
5
|
+
examples: [
|
|
6
|
+
{ argv: "", description: "List the pool." },
|
|
7
|
+
{ argv: "--json", description: "List the pool as JSON, with each lease's holder." },
|
|
8
|
+
],
|
|
9
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** How `pool list` ends. It never mints, so no outcome can carry a credential. */
|
|
3
|
+
export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
4
|
+
listed: z.ZodObject<{
|
|
5
|
+
poolPath: z.ZodString;
|
|
6
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
7
|
+
testserverUrl: z.ZodString;
|
|
8
|
+
logViewerUrl: z.ZodString;
|
|
9
|
+
requestedBuild: z.ZodString;
|
|
10
|
+
resolvedBuild: z.ZodString;
|
|
11
|
+
createdAt: z.ZodString;
|
|
12
|
+
ttlMinutes: z.ZodNumber;
|
|
13
|
+
minutesLeft: z.ZodNumber;
|
|
14
|
+
lease: z.ZodObject<{
|
|
15
|
+
state: z.ZodEnum<{
|
|
16
|
+
free: "free";
|
|
17
|
+
leased: "leased";
|
|
18
|
+
stale: "stale";
|
|
19
|
+
}>;
|
|
20
|
+
pid: z.ZodNullable<z.ZodNumber>;
|
|
21
|
+
hostname: z.ZodNullable<z.ZodString>;
|
|
22
|
+
startedAt: z.ZodNullable<z.ZodString>;
|
|
23
|
+
holderAlive: z.ZodNullable<z.ZodBoolean>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
leaseGuard: z.ZodBoolean;
|
|
26
|
+
health: z.ZodObject<{
|
|
27
|
+
kind: z.ZodEnum<{
|
|
28
|
+
answers: "answers";
|
|
29
|
+
expired: "expired";
|
|
30
|
+
failed: "failed";
|
|
31
|
+
}>;
|
|
32
|
+
status: z.ZodNullable<z.ZodNumber>;
|
|
33
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
unreadable: z.ZodArray<z.ZodObject<{
|
|
37
|
+
file: z.ZodString;
|
|
38
|
+
reason: z.ZodString;
|
|
39
|
+
}, z.core.$strip>>;
|
|
40
|
+
channels: z.ZodArray<z.ZodObject<{
|
|
41
|
+
channel: z.ZodString;
|
|
42
|
+
build: z.ZodString;
|
|
43
|
+
learnedAt: z.ZodString;
|
|
44
|
+
ageMinutes: z.ZodNumber;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
}, {
|
|
48
|
+
listed: unknown;
|
|
49
|
+
}, {
|
|
50
|
+
poolUnreadable: z.ZodObject<{
|
|
51
|
+
path: z.ZodString;
|
|
52
|
+
message: z.ZodString;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
}>;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { defineOutcomes, renderOutcome } from "@vercel/clinkr";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
const entrySchema = z.object({
|
|
4
|
+
/** The Testserver URL, with no trailing slash. */
|
|
5
|
+
testserverUrl: z.string(),
|
|
6
|
+
/** The log viewer URL, with no trailing slash. */
|
|
7
|
+
logViewerUrl: z.string(),
|
|
8
|
+
/** The build or build channel the Testserver sandbox was created with. */
|
|
9
|
+
requestedBuild: z.string(),
|
|
10
|
+
/** The build the Testserver sandbox runs. */
|
|
11
|
+
resolvedBuild: z.string(),
|
|
12
|
+
/** When its create started, by the client clock. */
|
|
13
|
+
createdAt: z.string(),
|
|
14
|
+
ttlMinutes: z.number(),
|
|
15
|
+
/** Whole minutes left by its TTL; negative once past it. */
|
|
16
|
+
minutesLeft: z.number(),
|
|
17
|
+
lease: z.object({
|
|
18
|
+
/** `free` with no lease; `stale` when its holder died or the lease outlived the TTL; otherwise `leased`. */
|
|
19
|
+
state: z.enum(["free", "leased", "stale"]),
|
|
20
|
+
/** The holder's pid and hostname; null when free or when the lease file can't be read. */
|
|
21
|
+
pid: z.number().nullable(),
|
|
22
|
+
hostname: z.string().nullable(),
|
|
23
|
+
/** When the lease was taken, or the lease file's modification time when it can't be read; null when free. */
|
|
24
|
+
startedAt: z.string().nullable(),
|
|
25
|
+
/** Whether the holder still runs; null when free, when it runs on another host, or when the lease file can't be read. */
|
|
26
|
+
holderAlive: z.boolean().nullable(),
|
|
27
|
+
}),
|
|
28
|
+
/**
|
|
29
|
+
* Whether a lease guard directory is present beside its lease: held by a running storm run, or left behind
|
|
30
|
+
* by one that died. A guard left behind stops every run from releasing, reclaiming, or dropping that lease
|
|
31
|
+
* until it is removed by hand.
|
|
32
|
+
*/
|
|
33
|
+
leaseGuard: z.boolean(),
|
|
34
|
+
health: z.object({
|
|
35
|
+
/** `answers` with a 2xx, `expired` with a 410 or 502, `failed` otherwise. */
|
|
36
|
+
kind: z.enum(["answers", "expired", "failed"]),
|
|
37
|
+
/** The HTTP status it answered with; null when the health check failed. */
|
|
38
|
+
status: z.number().nullable(),
|
|
39
|
+
/** Why the health check failed; null otherwise. */
|
|
40
|
+
detail: z.string().nullable(),
|
|
41
|
+
}),
|
|
42
|
+
});
|
|
43
|
+
const listedSchema = z.object({
|
|
44
|
+
/** Where the pool lives. */
|
|
45
|
+
poolPath: z.string(),
|
|
46
|
+
/** Every pool entry, by host. */
|
|
47
|
+
entries: z.array(entrySchema),
|
|
48
|
+
/** The entry files storm can't read, which it leaves on disk. */
|
|
49
|
+
unreadable: z.array(z.object({ file: z.string(), reason: z.string() })),
|
|
50
|
+
/** What each build channel last resolved to. */
|
|
51
|
+
channels: z.array(z.object({ channel: z.string(), build: z.string(), learnedAt: z.string(), ageMinutes: z.number() })),
|
|
52
|
+
});
|
|
53
|
+
/** How `pool list` ends. It never mints, so no outcome can carry a credential. */
|
|
54
|
+
export const outcomes = defineOutcomes({
|
|
55
|
+
results: {
|
|
56
|
+
listed: {
|
|
57
|
+
schema: listedSchema,
|
|
58
|
+
description: "The pool's entries, each health-checked; an empty pool has none.",
|
|
59
|
+
render: (listed) => renderOutcome({
|
|
60
|
+
rows: [["Pool", listed.poolPath]],
|
|
61
|
+
...(listed.entries.length === 0
|
|
62
|
+
? { message: "The pool is empty." }
|
|
63
|
+
: {
|
|
64
|
+
table: {
|
|
65
|
+
columns: ["TESTSERVER URL", "LEASE", "HEALTH", "LEFT", "RESOLVED BUILD", "REQUESTED BUILD"],
|
|
66
|
+
rows: listed.entries.map((entry) => [
|
|
67
|
+
entry.testserverUrl,
|
|
68
|
+
leaseCell(entry),
|
|
69
|
+
healthCell(entry),
|
|
70
|
+
entry.minutesLeft > 0 ? `${entry.minutesLeft}m` : "none",
|
|
71
|
+
entry.resolvedBuild,
|
|
72
|
+
entry.requestedBuild,
|
|
73
|
+
]),
|
|
74
|
+
},
|
|
75
|
+
}),
|
|
76
|
+
sections: [
|
|
77
|
+
...(listed.channels.length === 0
|
|
78
|
+
? []
|
|
79
|
+
: [
|
|
80
|
+
{
|
|
81
|
+
heading: "Channel resolutions",
|
|
82
|
+
rows: listed.channels.map(({ channel, build, ageMinutes }) => [
|
|
83
|
+
channel,
|
|
84
|
+
`${build}, learned ${ageMinutes}m ago`,
|
|
85
|
+
]),
|
|
86
|
+
},
|
|
87
|
+
]),
|
|
88
|
+
...(listed.unreadable.length === 0
|
|
89
|
+
? []
|
|
90
|
+
: [
|
|
91
|
+
{
|
|
92
|
+
heading: "Unreadable entry files",
|
|
93
|
+
rows: listed.unreadable.map(({ file, reason }) => [file, reason]),
|
|
94
|
+
},
|
|
95
|
+
]),
|
|
96
|
+
],
|
|
97
|
+
warnings: warnings(listed.entries),
|
|
98
|
+
}),
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
errors: {
|
|
102
|
+
poolUnreadable: {
|
|
103
|
+
exitCode: 1,
|
|
104
|
+
description: "storm couldn't read the pool.",
|
|
105
|
+
schema: z.object({
|
|
106
|
+
/** The pool file or directory the read failed on. */
|
|
107
|
+
path: z.string(),
|
|
108
|
+
/** What the OS said. */
|
|
109
|
+
message: z.string(),
|
|
110
|
+
}),
|
|
111
|
+
render: ({ path, message }) => ({
|
|
112
|
+
message: `Couldn't read the pool: ${message}`,
|
|
113
|
+
rows: [["Pool path", path]],
|
|
114
|
+
}),
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
function leaseCell(entry) {
|
|
119
|
+
const { lease } = entry;
|
|
120
|
+
if (lease.state === "free")
|
|
121
|
+
return "free";
|
|
122
|
+
if (lease.pid === null)
|
|
123
|
+
return `${lease.state}, holder unknown (unreadable lease file)`;
|
|
124
|
+
return `${lease.state}, pid ${lease.pid} on ${lease.hostname ?? ""}`;
|
|
125
|
+
}
|
|
126
|
+
function healthCell(entry) {
|
|
127
|
+
const { health } = entry;
|
|
128
|
+
switch (health.kind) {
|
|
129
|
+
case "answers":
|
|
130
|
+
return "answers";
|
|
131
|
+
case "expired":
|
|
132
|
+
return `expired (HTTP ${health.status ?? "?"})`;
|
|
133
|
+
case "failed":
|
|
134
|
+
return `failed (${health.detail ?? "unknown"})`;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function warnings(entries) {
|
|
138
|
+
const found = [];
|
|
139
|
+
const expired = entries.filter((entry) => entry.health.kind === "expired").length;
|
|
140
|
+
if (expired > 0)
|
|
141
|
+
found.push({
|
|
142
|
+
reason: "expired_entries",
|
|
143
|
+
message: `${expired === 1 ? "1 Testserver sandbox has" : `${expired} Testserver sandboxes have`} expired. A later storm run drops ${expired === 1 ? "it" : "them"} from the pool.`,
|
|
144
|
+
});
|
|
145
|
+
const guarded = entries.filter((entry) => entry.leaseGuard);
|
|
146
|
+
if (guarded.length > 0)
|
|
147
|
+
found.push({
|
|
148
|
+
reason: "lease_guard_present",
|
|
149
|
+
message: `A lease guard is present on the lease on ${guarded.map((entry) => entry.testserverUrl).join(", ")}. A storm run holds one while it releases, reclaims, or drops that lease; if no storm run is active, it was left behind, and no run will release, reclaim, or drop that lease until you remove its leases/<host>.guard directory in the pool by hand.`,
|
|
150
|
+
});
|
|
151
|
+
return found;
|
|
152
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ResourceConfig } from "../../config/index.ts";
|
|
2
|
+
import type { TestserverPoolRequest } from "./provider.ts";
|
|
3
|
+
import type { TestserverPoolOptions } from "./resource.ts";
|
|
4
|
+
/**
|
|
5
|
+
* A held Testserver pool resource's resolved options: how many Testserver sandboxes, on which build, with how much
|
|
6
|
+
* time left, and how the run gets the ones the pool can't supply. They are its request in either kind of run as they
|
|
7
|
+
* stand (`command.ts`).
|
|
8
|
+
*/
|
|
9
|
+
export type TestserverPoolSettings = TestserverPoolRequest;
|
|
10
|
+
/**
|
|
11
|
+
* The Testserver pool resource's config. Every option has a default, so a run that holds the resource, by the file or
|
|
12
|
+
* by a `--set` of any option, has them all. Its checks across options:
|
|
13
|
+
*
|
|
14
|
+
* - under `noCreate`, which creates no Testserver sandbox, a `ttl` from a flag is refused, and the file's is unused;
|
|
15
|
+
* - otherwise the `ttl` must be longer than `minTimeLeft`, or no Testserver sandbox the run created would have the time
|
|
16
|
+
* left the run asks for.
|
|
17
|
+
*/
|
|
18
|
+
export declare const testserverPoolConfig: ResourceConfig<"testserverPool", TestserverPoolOptions, TestserverPoolSettings, keyof TestserverPoolOptions>;
|