@cnc-tools/storm 0.0.0 → 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 +119 -3
- package/skills/overview.md +32 -0
- package/skills/read-run-output.md +65 -0
- package/README.md +0 -3
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type StormRunState } from "../../resources.ts";
|
|
2
|
+
import { type Paint } from "./text.ts";
|
|
3
|
+
/**
|
|
4
|
+
* A run's phases, in order. In a runner run the resources' lanes and the runner run at once, as `lanes`; locally
|
|
5
|
+
* the resources' lanes run alone, as `resources`.
|
|
6
|
+
*/
|
|
7
|
+
export type LivePhase = "credential" | "lanes" | "resources" | "tests" | "cleanup";
|
|
8
|
+
/** The phase that runs now; undefined before the first. */
|
|
9
|
+
export declare function activePhase(state: StormRunState): LivePhase | undefined;
|
|
10
|
+
/** The run's first line: storm's version and, in a runner run, the base. Like a final form, it isn't cut. */
|
|
11
|
+
export declare function headerLine(state: StormRunState, paint: Paint): string;
|
|
12
|
+
/**
|
|
13
|
+
* Phase `phase`'s live block at `now`, `width` columns wide. Its height stays the same while the phase runs; only
|
|
14
|
+
* the tests block grows, once, when its first test event arrives.
|
|
15
|
+
*/
|
|
16
|
+
export declare function phaseFrame(state: StormRunState, phase: LivePhase, now: number, width: number, paint: Paint): string[];
|
|
17
|
+
/**
|
|
18
|
+
* Phase `phase`'s final form, laid out in `width` columns: what stays above once the next phase starts. Nothing in
|
|
19
|
+
* it is cut, since a Testserver sandbox's log viewer URL or a step's time is no use in part; a line too long for
|
|
20
|
+
* the width wraps.
|
|
21
|
+
*/
|
|
22
|
+
export declare function phaseRecord(state: StormRunState, phase: LivePhase, width: number, paint: Paint): string[];
|
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
// The live view of a run on a terminal: its phases drawn by pure renderers from the run's state (`StormRunState`,
|
|
2
|
+
// built by `applyStormRunEvent`). A run goes through its phases in order: the credential, then the resources' lanes
|
|
3
|
+
// and the runner side by side (or the resources' lanes alone, locally; or the runner alone without a resource lane),
|
|
4
|
+
// then the tests and the cleanup. The phase that runs shows live in a block of fixed height; once the next one
|
|
5
|
+
// starts, it is printed above for good in its final form. Each resource lane's rows are its presentation's text
|
|
6
|
+
// (`RESOURCE_PRESENTATIONS`), laid out here.
|
|
7
|
+
import { cleanupProblems, megabytesText, } from "../../core/index.js";
|
|
8
|
+
import { RESOURCE_PRESENTATIONS } from "../../resources.js";
|
|
9
|
+
import { versionText } from "../../version.js";
|
|
10
|
+
import { commandEnd, LANE_WIDTH } from "./progress.js";
|
|
11
|
+
import { isoSecondsText, keepTimeText, seconds, short, shortFile, spread, truncate, visibleLength, } from "./text.js";
|
|
12
|
+
/** Spinner frames, one each tick. */
|
|
13
|
+
const SPINNER = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
14
|
+
/** Where text under a lane row starts: under the lane's text, past ` ✓ testserver `. */
|
|
15
|
+
const INDENT = " ".repeat(LANE_WIDTH + 5);
|
|
16
|
+
/** A lane row's head: its glyph and its lane's name, padded so every row's text starts in one column. */
|
|
17
|
+
function laneHead(glyph, lane) {
|
|
18
|
+
return ` ${glyph} ${lane.padEnd(LANE_WIDTH)} `;
|
|
19
|
+
}
|
|
20
|
+
/** The phase that runs now; undefined before the first. */
|
|
21
|
+
export function activePhase(state) {
|
|
22
|
+
if (state.cleanup !== undefined)
|
|
23
|
+
return "cleanup";
|
|
24
|
+
if (state.command !== undefined)
|
|
25
|
+
return "tests";
|
|
26
|
+
if (state.lanesStartedAt !== undefined && state.runner !== undefined)
|
|
27
|
+
return "lanes";
|
|
28
|
+
if (Object.keys(state.resources).length > 0 && state.runner === undefined)
|
|
29
|
+
return "resources";
|
|
30
|
+
if (state.mint !== undefined)
|
|
31
|
+
return "credential";
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The resource lanes the run holds, as `started` said, in provider order; before it, every one, so a lanes block that
|
|
36
|
+
* drew before `started` would keep each resource's row.
|
|
37
|
+
*/
|
|
38
|
+
function heldLanes(state) {
|
|
39
|
+
const held = state.lanes;
|
|
40
|
+
return RESOURCE_PRESENTATIONS.lanes.filter(({ lane }) => held?.includes(lane) ?? true);
|
|
41
|
+
}
|
|
42
|
+
/** The run's first line: storm's version and, in a runner run, the base. Like a final form, it isn't cut. */
|
|
43
|
+
export function headerLine(state, paint) {
|
|
44
|
+
const version = state.version === undefined ? "" : versionText(state.version.version, state.version.commit);
|
|
45
|
+
const header = [
|
|
46
|
+
`storm ${version}`.trimEnd(),
|
|
47
|
+
...(state.base === undefined ? [] : [`base ${short(state.base.sha)} (merge-base ${state.base.ref})`]),
|
|
48
|
+
].join(" · ");
|
|
49
|
+
return paint.strong(header);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Phase `phase`'s live block at `now`, `width` columns wide. Its height stays the same while the phase runs; only
|
|
53
|
+
* the tests block grows, once, when its first test event arrives.
|
|
54
|
+
*/
|
|
55
|
+
export function phaseFrame(state, phase, now, width, paint) {
|
|
56
|
+
const view = {
|
|
57
|
+
now,
|
|
58
|
+
width,
|
|
59
|
+
paint,
|
|
60
|
+
glyph: (status) => statusGlyph(status, now, paint),
|
|
61
|
+
// A live row is cut to the width: one that wrapped would take a row the next redraw doesn't erase.
|
|
62
|
+
row: (left, right) => spread(left, right, width),
|
|
63
|
+
line: (text) => truncate(text, width),
|
|
64
|
+
};
|
|
65
|
+
switch (phase) {
|
|
66
|
+
case "credential":
|
|
67
|
+
return state.mint === undefined ? [] : [credentialLine(state.mint, view)];
|
|
68
|
+
case "lanes":
|
|
69
|
+
return lanesFrame(state, view);
|
|
70
|
+
case "resources":
|
|
71
|
+
return localResourcesFrame(state, view);
|
|
72
|
+
case "tests":
|
|
73
|
+
return testsFrame(state, view);
|
|
74
|
+
case "cleanup":
|
|
75
|
+
return state.cleanup === undefined ? [] : [cleanupLine(state.cleanup, state.runner?.kept, view, false)];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Phase `phase`'s final form, laid out in `width` columns: what stays above once the next phase starts. Nothing in
|
|
80
|
+
* it is cut, since a Testserver sandbox's log viewer URL or a step's time is no use in part; a line too long for
|
|
81
|
+
* the width wraps.
|
|
82
|
+
*/
|
|
83
|
+
export function phaseRecord(state, phase, width, paint) {
|
|
84
|
+
// A span still running when its phase is printed shows as stopped, with no time.
|
|
85
|
+
const view = {
|
|
86
|
+
now: undefined,
|
|
87
|
+
width,
|
|
88
|
+
paint,
|
|
89
|
+
glyph: (status) => statusGlyph(status === "running" ? "stopped" : status, 0, paint),
|
|
90
|
+
row: (left, right) => visibleLength(left) + visibleLength(right) + 1 <= width
|
|
91
|
+
? spread(left, right, width)
|
|
92
|
+
: `${left}${right === "" ? "" : ` ${right}`}`,
|
|
93
|
+
line: (text) => text,
|
|
94
|
+
};
|
|
95
|
+
switch (phase) {
|
|
96
|
+
case "credential":
|
|
97
|
+
return state.mint === undefined ? [] : [credentialLine(state.mint, view)];
|
|
98
|
+
case "lanes":
|
|
99
|
+
return lanesRecord(state, view);
|
|
100
|
+
case "resources":
|
|
101
|
+
return localResourcesRecord(state, view);
|
|
102
|
+
case "tests":
|
|
103
|
+
return state.command === undefined ? [] : [testsLine(state, state.command, view, false)];
|
|
104
|
+
case "cleanup":
|
|
105
|
+
return state.cleanup === undefined ? [] : [cleanupLine(state.cleanup, state.runner?.kept, view, true)];
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/** What a resource lane's presentation draws with: `view`, with its span's time and durations. */
|
|
109
|
+
function laneDraw(view) {
|
|
110
|
+
return {
|
|
111
|
+
now: view.now,
|
|
112
|
+
paint: view.paint,
|
|
113
|
+
glyph: view.glyph,
|
|
114
|
+
line: view.line,
|
|
115
|
+
elapsed: (from, to) => elapsed(view, from, to),
|
|
116
|
+
seconds,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function elapsed(view, from, to) {
|
|
120
|
+
const end = to ?? view.now;
|
|
121
|
+
return from === undefined || end === undefined ? "" : seconds(end - from);
|
|
122
|
+
}
|
|
123
|
+
function credentialLine(mint, view) {
|
|
124
|
+
return view.row(` ${view.glyph(mint.status)} credential ${mint.target.team}/${mint.target.project}`, elapsed(view, mint.startedAt, mint.endedAt));
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The lanes block: a row for each resource lane the run holds, a runner row with its current step and the steps it
|
|
128
|
+
* finished, and the running step's latest output line; without a resource lane, the runner's two rows alone.
|
|
129
|
+
*/
|
|
130
|
+
function lanesFrame(state, view) {
|
|
131
|
+
const { runner } = state;
|
|
132
|
+
if (runner === undefined)
|
|
133
|
+
return [];
|
|
134
|
+
const { paint } = view;
|
|
135
|
+
const stopping = (status) => state.stopping && status === "running";
|
|
136
|
+
const draw = laneDraw(view);
|
|
137
|
+
const resourceRows = heldLanes(state).map((lane) => {
|
|
138
|
+
const { status, text, right } = lane.lanesRow(state.resources, draw, {
|
|
139
|
+
stopping: state.stopping,
|
|
140
|
+
runnerRunning: runner.status === "running",
|
|
141
|
+
});
|
|
142
|
+
return view.row(`${laneHead(view.glyph(status ?? "running"), lane.lane)}${text}`, right);
|
|
143
|
+
});
|
|
144
|
+
const current = runner.steps.find(({ status }) => status === "running") ??
|
|
145
|
+
[...runner.steps]
|
|
146
|
+
.filter((step) => step.status !== "pending" && step.endedAt !== undefined)
|
|
147
|
+
.toSorted((a, b) => (a.endedAt ?? 0) - (b.endedAt ?? 0))
|
|
148
|
+
.at(-1);
|
|
149
|
+
const currentText = current === undefined
|
|
150
|
+
? ""
|
|
151
|
+
: [
|
|
152
|
+
`${current.name}${stepLabel(current, runner) === "" ? "" : ` · ${stepLabel(current, runner)}`}`,
|
|
153
|
+
current.startedAt === current.endedAt ? "" : elapsed(view, current.startedAt, current.endedAt),
|
|
154
|
+
current.status === "failed" || current.status === "stopped" ? view.glyph(current.status) : "",
|
|
155
|
+
]
|
|
156
|
+
.filter((part) => part !== "")
|
|
157
|
+
.join(" ");
|
|
158
|
+
const crumbs = stepsText(runner.steps.filter((step) => step !== current), view);
|
|
159
|
+
const runnerText = stopping(runner.status) ? `stopping · ${currentText}` : currentText;
|
|
160
|
+
const runnerRow = view.row(`${laneHead(runnerGlyph(runner, view), "runner")}${runnerText}${crumbs === "" ? "" : ` ${paint.faint(crumbs)}`}`, elapsed(view, runner.startedAt, runner.endedAt));
|
|
161
|
+
const running = runner.steps.find(({ status }) => status === "running");
|
|
162
|
+
const latest = running === undefined ? undefined : latestLine(running, runner);
|
|
163
|
+
const output = activityText(runner) ?? (latest === "" ? undefined : latest);
|
|
164
|
+
return [...resourceRows, runnerRow, output === undefined ? "" : view.line(`${INDENT}${paint.faint(output)}`)];
|
|
165
|
+
}
|
|
166
|
+
/** The lanes' final form: each resource lane's line and the lines under it, the runner line and its steps. */
|
|
167
|
+
function lanesRecord(state, view) {
|
|
168
|
+
const { runner } = state;
|
|
169
|
+
const lines = [];
|
|
170
|
+
const draw = laneDraw(view);
|
|
171
|
+
for (const lane of RESOURCE_PRESENTATIONS.lanes) {
|
|
172
|
+
const record = lane.record(state.resources, draw);
|
|
173
|
+
if (record === undefined)
|
|
174
|
+
continue;
|
|
175
|
+
const { span } = record;
|
|
176
|
+
const waited = span.status === "done" &&
|
|
177
|
+
span.endedAt !== undefined &&
|
|
178
|
+
runner?.endedAt !== undefined &&
|
|
179
|
+
runner.endedAt > span.endedAt
|
|
180
|
+
? ` · waited ${seconds(runner.endedAt - span.endedAt)}`
|
|
181
|
+
: "";
|
|
182
|
+
lines.push(view.row(`${laneHead(view.glyph(span.status), lane.lane)}${record.text}`, `${elapsed(view, span.startedAt, span.endedAt)}${waited}`), ...record.lines);
|
|
183
|
+
}
|
|
184
|
+
if (runner !== undefined) {
|
|
185
|
+
const snapshot = runner.steps.find(({ name }) => name === "snapshot");
|
|
186
|
+
const parts = [
|
|
187
|
+
...(runner.sandbox === undefined
|
|
188
|
+
? []
|
|
189
|
+
: [`${runner.sandbox.name} · ${runner.sandbox.region} · ${runner.sandbox.vcpus} vCPU`]),
|
|
190
|
+
...(snapshot === undefined || snapshot.status === "pending" ? [] : [snapshotText(snapshot, runner)]),
|
|
191
|
+
...(runner.status === "failed" || runner.status === "stopped" ? [runner.status] : []),
|
|
192
|
+
];
|
|
193
|
+
lines.push(view.row(`${laneHead(runnerGlyph(runner, view), "runner")}${parts.join(" · ")}`, elapsed(view, runner.startedAt, runner.endedAt)));
|
|
194
|
+
const steps = stepsText(runner.steps, view);
|
|
195
|
+
if (steps !== "")
|
|
196
|
+
lines.push(view.line(`${INDENT}${steps}`));
|
|
197
|
+
}
|
|
198
|
+
return lines;
|
|
199
|
+
}
|
|
200
|
+
/** The runner lane's glyph: failed when a step failed, else the lane's own. */
|
|
201
|
+
function runnerGlyph(runner, view) {
|
|
202
|
+
return view.glyph(runner.steps.some(({ status }) => status === "failed") ? "failed" : runner.status);
|
|
203
|
+
}
|
|
204
|
+
/** What the runner did with its runner snapshot, for the runner's final form. */
|
|
205
|
+
function snapshotText(step, runner) {
|
|
206
|
+
if (runner.snapshot?.kind === "reused" || runner.snapshot?.kind === "built")
|
|
207
|
+
return `snapshot ${runner.snapshot.kind}`;
|
|
208
|
+
return `snapshot build ${step.status === "running" ? "stopped" : step.status}`;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* What a runner step does or found, after its name on the runner row: the snapshot step's runner snapshot, reused,
|
|
212
|
+
* built or building, and while it builds, the build's own step; the upload's size; any other step's label.
|
|
213
|
+
*/
|
|
214
|
+
function stepLabel(step, runner) {
|
|
215
|
+
if (step.name === "snapshot") {
|
|
216
|
+
const { snapshot } = runner;
|
|
217
|
+
if (snapshot === undefined)
|
|
218
|
+
return step.label;
|
|
219
|
+
if (snapshot.kind !== "building")
|
|
220
|
+
return `${snapshot.id} ${snapshot.kind}`;
|
|
221
|
+
return step.label === "" ? `building: ${snapshot.summary}` : step.label;
|
|
222
|
+
}
|
|
223
|
+
if (step.name === "upload" && runner.uploadBytes !== undefined)
|
|
224
|
+
return megabytesText(runner.uploadBytes);
|
|
225
|
+
return step.label;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* The running step's last output line; before a snapshot build's first step, that its build sandbox started.
|
|
229
|
+
*/
|
|
230
|
+
function latestLine(step, runner) {
|
|
231
|
+
if (step.latest !== undefined)
|
|
232
|
+
return step.latest.trim();
|
|
233
|
+
if (step.name === "snapshot" && step.label === "" && runner.buildSandbox !== undefined)
|
|
234
|
+
return `build sandbox ${runner.buildSandbox} started`;
|
|
235
|
+
return undefined;
|
|
236
|
+
}
|
|
237
|
+
/** What the runner does outside its steps, for the lanes block's output row. */
|
|
238
|
+
function activityText(runner) {
|
|
239
|
+
switch (runner.activity) {
|
|
240
|
+
case "saving-snapshot":
|
|
241
|
+
return "saving the build sandbox as a runner snapshot";
|
|
242
|
+
case "waiting-for-snapshot":
|
|
243
|
+
return WAITING_FOR_SNAPSHOT;
|
|
244
|
+
case undefined:
|
|
245
|
+
return undefined;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
const WAITING_FOR_SNAPSHOT = "waiting for the runner snapshot still saving";
|
|
249
|
+
/**
|
|
250
|
+
* The finished steps that took time, in order: `start 0.9s · upload 0.5s · install 3.9s ✗`. A reused runner
|
|
251
|
+
* snapshot took none, so it isn't there.
|
|
252
|
+
*/
|
|
253
|
+
function stepsText(steps, view) {
|
|
254
|
+
return steps
|
|
255
|
+
.filter((step) => step.status !== "pending" &&
|
|
256
|
+
step.status !== "running" &&
|
|
257
|
+
step.startedAt !== undefined &&
|
|
258
|
+
step.endedAt !== undefined &&
|
|
259
|
+
(step.endedAt > step.startedAt || step.status !== "done"))
|
|
260
|
+
.map((step) => {
|
|
261
|
+
const mark = step.status === "done" ? "" : ` ${view.glyph(step.status)}`;
|
|
262
|
+
return `${step.name} ${seconds((step.endedAt ?? 0) - (step.startedAt ?? 0))}${mark}`;
|
|
263
|
+
})
|
|
264
|
+
.join(" · ");
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* The local resources block: each started resource lane's row, and under it what the lane says goes under its row,
|
|
268
|
+
* such as the creates in flight, else blank. A mint in flight, which the run makes once for whichever resource asked,
|
|
269
|
+
* takes the row under the first lane's.
|
|
270
|
+
*/
|
|
271
|
+
function localResourcesFrame(state, view) {
|
|
272
|
+
const { mint } = state;
|
|
273
|
+
const draw = laneDraw(view);
|
|
274
|
+
const mintRow = mint !== undefined && mint.status === "running"
|
|
275
|
+
? view.row(` ${view.glyph("running")} minting a credential for ${mint.target.team}/${mint.target.project}`, elapsed(view, mint.startedAt, mint.endedAt))
|
|
276
|
+
: undefined;
|
|
277
|
+
const rows = RESOURCE_PRESENTATIONS.lanes.flatMap((lane) => {
|
|
278
|
+
const row = lane.localRow(state.resources, draw);
|
|
279
|
+
return row === undefined ? [] : [{ lane: lane.lane, ...row }];
|
|
280
|
+
});
|
|
281
|
+
return rows.flatMap(({ lane, span, text, below }, index) => [
|
|
282
|
+
view.row(`${laneHead(view.glyph(span.status), lane)}${text}`, elapsed(view, span.startedAt, span.endedAt)),
|
|
283
|
+
index === 0 && mintRow !== undefined
|
|
284
|
+
? mintRow
|
|
285
|
+
: below !== undefined
|
|
286
|
+
? view.line(` ${view.glyph("running")} ${below}`)
|
|
287
|
+
: "",
|
|
288
|
+
]);
|
|
289
|
+
}
|
|
290
|
+
/** The local resources' final form: the mint they waited on, if any, then each lane's line and the lines under it. */
|
|
291
|
+
function localResourcesRecord(state, view) {
|
|
292
|
+
const { mint } = state;
|
|
293
|
+
const draw = laneDraw(view);
|
|
294
|
+
const lanes = RESOURCE_PRESENTATIONS.lanes.flatMap((lane) => {
|
|
295
|
+
const record = lane.record(state.resources, draw);
|
|
296
|
+
if (record === undefined)
|
|
297
|
+
return [];
|
|
298
|
+
const { span } = record;
|
|
299
|
+
return [
|
|
300
|
+
view.row(`${laneHead(view.glyph(span.status), lane.lane)}${record.text}`, elapsed(view, span.startedAt, span.endedAt)),
|
|
301
|
+
...record.lines,
|
|
302
|
+
];
|
|
303
|
+
});
|
|
304
|
+
if (lanes.length === 0)
|
|
305
|
+
return [];
|
|
306
|
+
return [...(mint === undefined ? [] : [credentialLine(mint, view)]), ...lanes];
|
|
307
|
+
}
|
|
308
|
+
/** The tests block: one row, which says what they've done so far once their first test event arrives. */
|
|
309
|
+
function testsFrame(state, view) {
|
|
310
|
+
return state.command === undefined ? [] : [testsLine(state, state.command, view, true)];
|
|
311
|
+
}
|
|
312
|
+
/** How long a file runs before the tests row names it as the longest running. */
|
|
313
|
+
const LONG_FILE_MS = 10_000;
|
|
314
|
+
/**
|
|
315
|
+
* The tests row. Live, once a test event arrived, what the tests have done so far, how many files run and how many
|
|
316
|
+
* of those wait on a container, and the file that has run longest once it passes 10 seconds; until then, and in its
|
|
317
|
+
* final form, the command and how it ended.
|
|
318
|
+
*/
|
|
319
|
+
function testsLine(state, command, view, live) {
|
|
320
|
+
const { tests } = state;
|
|
321
|
+
const end = command.outcome === undefined ? undefined : endText(command.outcome);
|
|
322
|
+
const parts = [command.argv.join(" ")];
|
|
323
|
+
if (end !== undefined)
|
|
324
|
+
parts.push(end);
|
|
325
|
+
else if (live && state.stopping)
|
|
326
|
+
parts.push("stopping");
|
|
327
|
+
const head = ` ${view.glyph(command.status)} tests `;
|
|
328
|
+
const time = elapsed(view, command.startedAt, command.endedAt);
|
|
329
|
+
const text = live && end === undefined && !state.stopping && tests !== undefined
|
|
330
|
+
? testsProgress(tests, view, view.width - visibleLength(head) - visibleLength(time) - 1)
|
|
331
|
+
: parts.join(" ");
|
|
332
|
+
return view.row(`${head}${text}`, time);
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* `12 passed · 1 failed · 3 files done · 4 running (2 waiting on a container) · longest: sdk/seed 14.2s`. When
|
|
336
|
+
* that is wider than `room`, the waiting count goes first, so the longest running file still shows.
|
|
337
|
+
*/
|
|
338
|
+
function testsProgress(tests, view, room) {
|
|
339
|
+
const { paint, now } = view;
|
|
340
|
+
const running = tests.workers.filter((worker) => worker.file !== undefined || worker.containerSince !== undefined);
|
|
341
|
+
const waiting = tests.workers.filter((worker) => worker.containerSince !== undefined).length;
|
|
342
|
+
const longest = [...running].toSorted((a, b) => (a.fileStartedAt ?? 0) - (b.fileStartedAt ?? 0))[0];
|
|
343
|
+
const longestMs = longest?.fileStartedAt === undefined || now === undefined ? undefined : now - longest.fileStartedAt;
|
|
344
|
+
const text = (showWaiting) => [
|
|
345
|
+
`${tests.passed} passed`,
|
|
346
|
+
...(tests.failed === 0 ? [] : [paint.failed(`${tests.failed} failed`)]),
|
|
347
|
+
`${tests.filesDone} ${tests.filesDone === 1 ? "file" : "files"} done`,
|
|
348
|
+
`${running.length} running${waiting === 0 || !showWaiting ? "" : ` (${waiting} waiting on a container)`}`,
|
|
349
|
+
...(longest?.file === undefined || longestMs === undefined || longestMs < LONG_FILE_MS
|
|
350
|
+
? []
|
|
351
|
+
: [`longest: ${shortFile(longest.file)} ${seconds(longestMs)}`]),
|
|
352
|
+
].join(" · ");
|
|
353
|
+
const full = text(true);
|
|
354
|
+
return visibleLength(full) <= room ? full : text(false);
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* The cleanup row: what it does while it runs, what it did in its final form, with the runner sandbox it `kept`
|
|
358
|
+
* running, if it kept one.
|
|
359
|
+
*/
|
|
360
|
+
function cleanupLine(cleanup, kept, view, record) {
|
|
361
|
+
const done = record || cleanup.status !== "running";
|
|
362
|
+
const releases = RESOURCE_PRESENTATIONS.releaseTexts(cleanup.holdings, done ? "done" : "doing");
|
|
363
|
+
const release = releases.length === 0 ? undefined : releases.join(", ");
|
|
364
|
+
const sandbox = kept !== undefined
|
|
365
|
+
? `kept the runner sandbox until ${isoSecondsText(kept.stopsAt)}`
|
|
366
|
+
: !done && cleanup.keepSandboxMs > 0
|
|
367
|
+
? `keeping the runner sandbox running ${keepTimeText(cleanup.keepSandboxMs)}`
|
|
368
|
+
: `${done ? "stopped and deleted" : "stopping and deleting"} the runner sandbox`;
|
|
369
|
+
const text = !done && cleanup.waiting
|
|
370
|
+
? `${WAITING_FOR_SNAPSHOT}…`
|
|
371
|
+
: cleanup.runner
|
|
372
|
+
? `${sandbox}${release === undefined ? "" : `, ${release}`}`
|
|
373
|
+
: (release ?? "nothing to release");
|
|
374
|
+
const leftBehind = cleanupProblems(cleanup);
|
|
375
|
+
const ending = done ? (leftBehind === 0 ? "" : `: ${leftBehind} left behind`) : "…";
|
|
376
|
+
return view.row(` ${view.glyph(cleanup.status)} cleanup ${text}${!done && cleanup.waiting ? "" : ending}`, elapsed(view, cleanup.startedAt, cleanup.endedAt));
|
|
377
|
+
}
|
|
378
|
+
function statusGlyph(status, now, paint) {
|
|
379
|
+
switch (status) {
|
|
380
|
+
case "pending":
|
|
381
|
+
return paint.faint("·");
|
|
382
|
+
case "running":
|
|
383
|
+
return paint.active(SPINNER[Math.floor(now / 90) % SPINNER.length] ?? "·");
|
|
384
|
+
case "done":
|
|
385
|
+
return paint.done("✓");
|
|
386
|
+
case "failed":
|
|
387
|
+
return paint.failed("✗");
|
|
388
|
+
case "stopped":
|
|
389
|
+
return paint.stopped("■");
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
/** How the command ended, after its argument list on the tests row. */
|
|
393
|
+
function endText(outcome) {
|
|
394
|
+
return outcome === "stopped" ? "stopped" : commandEnd(outcome);
|
|
395
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const metadata: {
|
|
2
|
+
description: string;
|
|
3
|
+
summary: string;
|
|
4
|
+
usages: string[];
|
|
5
|
+
fields: {
|
|
6
|
+
set: {
|
|
7
|
+
valueLabel: string;
|
|
8
|
+
description: string;
|
|
9
|
+
};
|
|
10
|
+
credential: {
|
|
11
|
+
valueLabel: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
local: {
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
rebuildSnapshot: {
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
keepSandbox: {
|
|
21
|
+
valueLabel: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
showOutput: {
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
verbose: {
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
scope: {
|
|
31
|
+
valueLabel: string;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
project: {
|
|
35
|
+
valueLabel: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
command: {
|
|
39
|
+
valueLabel: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
examples: {
|
|
44
|
+
argv: string;
|
|
45
|
+
description: string;
|
|
46
|
+
}[];
|
|
47
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export const metadata = {
|
|
2
|
+
description: "Run the command after -- with the run payload in STORM_RUN. With a Testserver side (resources.testserverPool in storm.config.ts, or a --set resources.testserverPool.<option>), first lease usable Testserver sandboxes from the pool and create the rest, and release the leases once it ends; without one, the run payload names no Testserver sandbox. Shows on stderr what runs when and what runs at once, live on a terminal and one line at a time elsewhere, then a waterfall of the run's lanes naming its critical path, and exits with the command's code. Each run writes what it was and how it ended, its events, its steps' output, its command's output, its test events and its timeline to a run directory under ${XDG_STATE_HOME:-~/.local/state}/storm/runs/, named for its run id, keeping the newest 1000 completed ones and every one whose run is still going; the summary names the run id, storm runs show reads the run back, and storm runs logs prints its command's output and its steps' logs. The command runs in a runner sandbox, a Vercel Sandbox readied from the runner recipe in storm.config.ts while any Testserver sandboxes are leased and created, or with --local on this machine. A flag or --set overrides storm.config.ts, found in the working directory or a parent up to the git worktree's root and checked whole, which overrides the built-in default. With resources.githubFixtureRepo, in storm.config.ts or by a --set of its options, the run reads a token for that GitHub repository from the host variable its tokenEnv names (refusing without it, unless optional), checks the token can read the repository, hands the command the repository, the token and a run prefix (run/<UTC timestamp>-<suffix>) in the run payload, shows the token as <token> in what it prints and writes, and deletes every branch under the run prefix once the command has stopped.",
|
|
3
|
+
summary: "Run a command, in a runner sandbox or locally, with or without Testserver sandboxes.",
|
|
4
|
+
usages: [
|
|
5
|
+
"[--set <KEY=VALUE>]... [--credential <SOURCE>] [--scope <TEAM> --project <PROJECT>] [--local | [--rebuild-snapshot] [--show-output] [--keep-sandbox <DURATION>]] [--verbose] -- <command...>",
|
|
6
|
+
],
|
|
7
|
+
fields: {
|
|
8
|
+
set: {
|
|
9
|
+
valueLabel: "KEY=VALUE",
|
|
10
|
+
description: "Set a resource's option for this run by its key path in storm.config.ts, resources.<name>.<option>, overriding the file and the default; repeat it for each option. The key paths: resources.testserverPool.sandboxes, how many Testserver sandboxes the command gets, 1 to 32, default 1; resources.testserverPool.build, a build name or the build channel stable or latest_main, default stable; resources.testserverPool.minTimeLeft, the least time left a Testserver sandbox from the pool needs, in whole minutes or hours (30m, 2h), default 30m; resources.testserverPool.ttl, how long each Testserver sandbox the run creates lives, 10m to 5h and longer than minTimeLeft, default 5h; resources.testserverPool.noCreate, true or false, default false: true runs only on Testserver sandboxes already in the pool, never minting for Testserver or creating, takes no --set of ttl, and needs no --scope or --project with --local; resources.githubFixtureRepo.repo, the GitHub repository as owner/name, required; resources.githubFixtureRepo.tokenEnv, the host environment variable holding its token, required; resources.githubFixtureRepo.optional, true or false, default false: false refuses the run without the token, true goes on without the repository. Any --set of a resource's option gives the run that resource, as storm.config.ts does: for resources.testserverPool, a Testserver side. An unknown key path, one given twice, or a value its option refuses is a usage error. Options that don't fit together once merged, such as a ttl not longer than minTimeLeft, or a required one nothing gives, are invalid_resource_options, naming where each value came from.",
|
|
11
|
+
},
|
|
12
|
+
credential: {
|
|
13
|
+
valueLabel: "SOURCE",
|
|
14
|
+
description: "The credential source: mint, the default, mints one with the vercel CLI for --scope and --project; github-actions requests a GitHub Actions OIDC token, in a GitHub Actions job with permissions id-token: write, anew once it is 4 minutes old, and needs no --scope or --project. Only --local takes it: a runner run needs the mint. Only a run holding a resource that takes a credential takes it, the Testserver pool resource without noCreate (resources.testserverPool in storm.config.ts, or a --set resources.testserverPool.<option>); otherwise it is credential_unused. No config key.",
|
|
15
|
+
},
|
|
16
|
+
local: {
|
|
17
|
+
description: "Run the command on this machine instead of in a runner sandbox. Without it, the command runs in a Vercel Sandbox started from a runner snapshot of the base, with this checkout's changes applied, installed and built, from the runner key of storm.config.ts, and its output streams back with paths rewritten to this checkout's. No config key.",
|
|
18
|
+
},
|
|
19
|
+
rebuildSnapshot: {
|
|
20
|
+
description: "Build a runner snapshot of the base whatever the runner snapshot cache holds, replacing an entry for the same base. Not with --local. No config key.",
|
|
21
|
+
},
|
|
22
|
+
keepSandbox: {
|
|
23
|
+
valueLabel: "DURATION",
|
|
24
|
+
description: "How long the runner sandbox keeps running once the run ends, however it ends, so you can connect to it from its page in the Vercel dashboard: 0, which stops and deletes it with the run's other sandboxes, or a whole number of minutes or hours up to 5h (30m, 2h). The run asks Vercel Sandbox to extend the runner sandbox's timeout when it would stop sooner; it never shortens it, so the sandbox may run past the keep time until its own timeout. The run says until when it runs, and storm runs show and runs list say so too. Default: keepSandbox in the runner recipe, else 30m, or 0 when CI is set. Not with --local.",
|
|
25
|
+
},
|
|
26
|
+
showOutput: {
|
|
27
|
+
description: "In a runner run on a terminal, print the runner's step output (a snapshot build, the install, the build) above the live view instead of keeping only each step's last line there. Plain output always prints it. Either way, the run directory keeps it whole. Not with --local. No config key.",
|
|
28
|
+
},
|
|
29
|
+
verbose: {
|
|
30
|
+
description: "Print more as it happens: each Testserver sandbox create's progress messages, the runner's step output as with --show-output, and verbose in the run payload, which has the Vitest adapter's reporters print each test as it finishes and its fixtures print each container start, proxied request and vercel invocation, for passing tests too. No config key.",
|
|
31
|
+
},
|
|
32
|
+
scope: {
|
|
33
|
+
valueLabel: "TEAM",
|
|
34
|
+
description: "The control plane team: the Vercel team whose project's development OIDC tokens the Testserver control plane trusts. Required, from this flag or scope in storm.config.ts, unless --local without a Testserver side, with noCreate or with --credential github-actions.",
|
|
35
|
+
},
|
|
36
|
+
project: {
|
|
37
|
+
valueLabel: "PROJECT",
|
|
38
|
+
description: "The control plane project: the Vercel project, within the team, to mint the credential for. Required, from this flag or project in storm.config.ts, unless --local without a Testserver side, with noCreate or with --credential github-actions.",
|
|
39
|
+
},
|
|
40
|
+
command: {
|
|
41
|
+
valueLabel: "command",
|
|
42
|
+
description: "The command to run, after --, as an argument list with no shell.",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
examples: [
|
|
46
|
+
{
|
|
47
|
+
argv: "--set resources.testserverPool.sandboxes=4 -- vitest run",
|
|
48
|
+
description: "Run vitest in a runner sandbox against 4 Testserver sandboxes, with the runner recipe, team and project from storm.config.ts.",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
argv: "--local --set resources.testserverPool.sandboxes=4 --scope vercel --project vercel -- pnpm vitest run",
|
|
52
|
+
description: "Run the tests on this machine against 4 Testserver sandboxes on the stable build channel.",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
argv: "--keep-sandbox 2h -- pnpm test",
|
|
56
|
+
description: "Run the tests in a runner sandbox and keep it running 2 hours after the run, to debug in it.",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
argv: "-- pnpm test",
|
|
60
|
+
description: "Run the tests in a runner sandbox with no Testserver sandbox, when storm.config.ts has no resources.testserverPool.",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
argv: "--local --set resources.testserverPool.ttl=30m --set resources.testserverPool.minTimeLeft=25m -- pnpm vitest run",
|
|
64
|
+
description: "Create Testserver sandboxes that live 30 minutes, with team and project from storm.config.ts.",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
argv: "--local --set resources.testserverPool.noCreate=true --set resources.testserverPool.sandboxes=4 -- pnpm vitest run",
|
|
68
|
+
description: "Run only on Testserver sandboxes already in the pool, never minting.",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
argv: "--local --verbose --set resources.testserverPool.sandboxes=2 -- pnpm vitest run",
|
|
72
|
+
description: "Run the tests, printing each create's progress and, through the Vitest adapter, each test as it ends.",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
argv: "--local --credential github-actions --set resources.testserverPool.ttl=30m --set resources.testserverPool.minTimeLeft=25m -- vitest run",
|
|
76
|
+
description: "In a GitHub Actions job, create Testserver sandboxes with a GitHub Actions OIDC token.",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
argv: "--local --set resources.testserverPool.build=latest_main --set resources.testserverPool.minTimeLeft=75m --scope vercel --project vercel -- pnpm vitest run",
|
|
80
|
+
description: "Run them on the newest main build, with Testserver sandboxes that live at least 75 more minutes.",
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const mintFailedErrors: import("@vercel/clinkr").SharedErrors<{
|
|
3
|
+
mintFailed: z.ZodObject<{
|
|
4
|
+
team: z.ZodString;
|
|
5
|
+
project: z.ZodString;
|
|
6
|
+
cause: z.ZodString;
|
|
7
|
+
fix: z.ZodString;
|
|
8
|
+
runner: z.ZodBoolean;
|
|
9
|
+
cleanup: z.ZodType<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("./cleanup.ts").StormCleanupFacts, import("./cleanup.ts").StormCleanupFacts>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// The `run` command's `mint_failed`: the run's mint failed. In a runner run, the core mints for the runner sandbox
|
|
2
|
+
// first, whatever the resources hold (`runner: true`); in a local run that settled the mint, the core's credential
|
|
3
|
+
// source mints when a resource first asks for a credential, and the run ends this way when that resource can't go on
|
|
4
|
+
// without it (`runner: false`).
|
|
5
|
+
import { defineErrors } from "@vercel/clinkr";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { RUN_CLEANUP } from "../../resources.js";
|
|
8
|
+
export const mintFailedErrors = defineErrors({
|
|
9
|
+
mintFailed: {
|
|
10
|
+
exitCode: 1,
|
|
11
|
+
description: "The vercel CLI couldn't mint a credential, so the command didn't run. In a runner run, the credential was for the runner sandbox, which always needs one; in a local run, for a resource that couldn't go on without it.",
|
|
12
|
+
schema: z.object({
|
|
13
|
+
team: z.string(),
|
|
14
|
+
project: z.string(),
|
|
15
|
+
cause: z.string(),
|
|
16
|
+
fix: z.string(),
|
|
17
|
+
/** Whether the credential was for the runner sandbox (a runner run). */
|
|
18
|
+
runner: z.boolean(),
|
|
19
|
+
/** What the run couldn't clean up. */
|
|
20
|
+
cleanup: RUN_CLEANUP.schema,
|
|
21
|
+
}),
|
|
22
|
+
render: ({ cause, fix, runner, cleanup }) => {
|
|
23
|
+
const rows = RUN_CLEANUP.rows(cleanup);
|
|
24
|
+
return {
|
|
25
|
+
message: runner
|
|
26
|
+
? `Couldn't mint a credential for the runner sandbox: ${cause}. The command didn't run.`
|
|
27
|
+
: `Couldn't mint a credential: ${cause}. A resource the run holds needed it, so the command didn't run.`,
|
|
28
|
+
...(rows.length === 0 ? {} : { rows }),
|
|
29
|
+
next: [{ type: "text", text: fix }],
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|