@cnc-tools/storm 0.0.0 → 0.6.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/exec/cleanup.d.ts +135 -0
- package/dist/commands/exec/cleanup.js +171 -0
- package/dist/commands/exec/command.d.ts +272 -0
- package/dist/commands/exec/command.js +23 -0
- package/dist/commands/exec/job-summary.d.ts +10 -0
- package/dist/commands/exec/job-summary.js +34 -0
- package/dist/commands/exec/live-view.d.ts +22 -0
- package/dist/commands/exec/live-view.js +395 -0
- package/dist/commands/exec/metadata.d.ts +66 -0
- package/dist/commands/exec/metadata.js +55 -0
- package/dist/commands/exec/mint-failed.d.ts +11 -0
- package/dist/commands/exec/mint-failed.js +33 -0
- package/dist/commands/exec/outcomes.d.ts +614 -0
- package/dist/commands/exec/outcomes.js +338 -0
- package/dist/commands/exec/progress.d.ts +44 -0
- package/dist/commands/exec/progress.js +277 -0
- package/dist/commands/exec/redaction.d.ts +15 -0
- package/dist/commands/exec/redaction.js +40 -0
- package/dist/commands/exec/run-collector.d.ts +30 -0
- package/dist/commands/exec/run-collector.js +73 -0
- package/dist/commands/exec/run-command.d.ts +221 -0
- package/dist/commands/exec/run-command.js +663 -0
- package/dist/commands/exec/run-metadata.d.ts +56 -0
- package/dist/commands/exec/run-metadata.js +58 -0
- package/dist/commands/exec/run-record.d.ts +170 -0
- package/dist/commands/exec/run-record.js +104 -0
- package/dist/commands/exec/tests-summary.d.ts +34 -0
- package/dist/commands/exec/tests-summary.js +141 -0
- package/dist/commands/exec/testserver-flags.d.ts +48 -0
- package/dist/commands/exec/testserver-flags.js +80 -0
- package/dist/commands/exec/text.d.ts +22 -0
- package/dist/commands/exec/text.js +74 -0
- package/dist/commands/exec/view.d.ts +35 -0
- package/dist/commands/exec/view.js +163 -0
- package/dist/commands/exec/waterfall.d.ts +25 -0
- package/dist/commands/exec/waterfall.js +108 -0
- package/dist/commands/exec/worker-chart.d.ts +79 -0
- package/dist/commands/exec/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 +80 -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 +320 -0
- package/dist/commands/vitest/command.d.ts +299 -0
- package/dist/commands/vitest/command.js +138 -0
- package/dist/commands/vitest/metadata.d.ts +66 -0
- package/dist/commands/vitest/metadata.js +35 -0
- package/dist/commands/vitest/outcomes.d.ts +273 -0
- package/dist/commands/vitest/outcomes.js +77 -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 +10 -0
- package/dist/config/index.js +13 -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 +27 -0
- package/dist/config/set.js +71 -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 +39 -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 +89 -0
- package/dist/context.js +45 -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 +78 -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 +455 -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/find-vitest.d.ts +7 -0
- package/dist/vitest/find-vitest.js +28 -0
- package/dist/vitest/fixtures.d.ts +64 -0
- package/dist/vitest/fixtures.js +172 -0
- package/dist/vitest/gateways.d.ts +78 -0
- package/dist/vitest/gateways.js +4 -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 +11 -0
- package/dist/vitest/live/list-gateway.js +107 -0
- package/dist/vitest/ownership.d.ts +29 -0
- package/dist/vitest/ownership.js +68 -0
- package/dist/vitest/plan.d.ts +66 -0
- package/dist/vitest/plan.js +104 -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 +33 -0
- package/skills/read-run-output.md +65 -0
- package/README.md +0 -3
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
// A run's state, built from its timed events by applying each in turn (`applyRunEvent`): what each lane, step, the
|
|
2
|
+
// command and the cleanup did and when, as typed facts. The live view draws it as the run goes; the waterfall
|
|
3
|
+
// (`timeline`) projects it once the run is done. Neither keeps a second copy of these rules. The core applies its own
|
|
4
|
+
// events; each resource lane (`ResourceLane`) applies its resource's own events to its own lane state, which the run's
|
|
5
|
+
// state keeps by resource name. It names no resource.
|
|
6
|
+
import { entry } from "./keyed.js";
|
|
7
|
+
/** The runner lane's steps, in order. */
|
|
8
|
+
export const RUNNER_STEPS = ["snapshot", "start", "upload", "apply", "install", "build"];
|
|
9
|
+
/** The state before any event: what applying a run's events starts from. */
|
|
10
|
+
export const EMPTY_RUN_STATE = {
|
|
11
|
+
origin: undefined,
|
|
12
|
+
lastAt: undefined,
|
|
13
|
+
version: undefined,
|
|
14
|
+
lanes: undefined,
|
|
15
|
+
base: undefined,
|
|
16
|
+
mint: undefined,
|
|
17
|
+
lanesStartedAt: undefined,
|
|
18
|
+
resources: {},
|
|
19
|
+
runner: undefined,
|
|
20
|
+
command: undefined,
|
|
21
|
+
cleanup: undefined,
|
|
22
|
+
tests: undefined,
|
|
23
|
+
stopping: false,
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The run's state after `timed`. The core applies its own events; `lanes`, the registry's resource lanes, apply each
|
|
27
|
+
* resource's own events, start and end. A resource without a lane keeps no state: its events' lines are notices.
|
|
28
|
+
*/
|
|
29
|
+
export function applyRunEvent(lanes, state, timed) {
|
|
30
|
+
const at = timed.at.getTime();
|
|
31
|
+
return applyEvent(lanes, { ...state, origin: state.origin ?? at, lastAt: at }, timed.event, at);
|
|
32
|
+
}
|
|
33
|
+
/** Whether a command that ended passed: it exited 0. */
|
|
34
|
+
export function commandPassed(outcome) {
|
|
35
|
+
return outcome.kind === "exited" && outcome.code === 0;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* What the cleanup couldn't do: what releasing the resources couldn't, and runner sandboxes it couldn't stop or
|
|
39
|
+
* delete.
|
|
40
|
+
*/
|
|
41
|
+
export function cleanupProblems(cleanup) {
|
|
42
|
+
return cleanup.resourceFailures + cleanup.notStopped + cleanup.notDeleted;
|
|
43
|
+
}
|
|
44
|
+
/** The sum of `failures`: what the cleanup lane counts against the resources. */
|
|
45
|
+
function totalResourceFailures(failures) {
|
|
46
|
+
return Object.values(failures).reduce((sum, count) => sum + (count ?? 0), 0);
|
|
47
|
+
}
|
|
48
|
+
function applyEvent(lanes, state, event, at) {
|
|
49
|
+
switch (event.kind) {
|
|
50
|
+
case "started":
|
|
51
|
+
return { ...state, version: { version: event.version, commit: event.commit }, lanes: event.lanes };
|
|
52
|
+
case "runner-prepared":
|
|
53
|
+
return {
|
|
54
|
+
...state,
|
|
55
|
+
base: { sha: event.base, ref: event.baseRef },
|
|
56
|
+
runner: {
|
|
57
|
+
status: "pending",
|
|
58
|
+
startedAt: at,
|
|
59
|
+
endedAt: undefined,
|
|
60
|
+
sandbox: undefined,
|
|
61
|
+
buildSandbox: undefined,
|
|
62
|
+
steps: RUNNER_STEPS.map((name) => ({
|
|
63
|
+
name,
|
|
64
|
+
status: "pending",
|
|
65
|
+
startedAt: undefined,
|
|
66
|
+
endedAt: undefined,
|
|
67
|
+
label: "",
|
|
68
|
+
latest: undefined,
|
|
69
|
+
})),
|
|
70
|
+
snapshot: undefined,
|
|
71
|
+
uploadBytes: undefined,
|
|
72
|
+
activity: undefined,
|
|
73
|
+
kept: undefined,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
case "minting":
|
|
77
|
+
return { ...state, mint: { status: "running", startedAt: at, endedAt: undefined, target: event.target } };
|
|
78
|
+
case "minted":
|
|
79
|
+
return state.mint === undefined
|
|
80
|
+
? state
|
|
81
|
+
: { ...state, mint: { ...state.mint, status: event.ok ? "done" : "failed", endedAt: at } };
|
|
82
|
+
// A GitHub Actions OIDC token request reports no end, so it has no span of its own.
|
|
83
|
+
case "requesting-token":
|
|
84
|
+
return state;
|
|
85
|
+
case "lanes-started":
|
|
86
|
+
return {
|
|
87
|
+
...state,
|
|
88
|
+
lanesStartedAt: at,
|
|
89
|
+
runner: state.runner === undefined ? undefined : { ...state.runner, status: "running", startedAt: at },
|
|
90
|
+
};
|
|
91
|
+
case "lane-started": {
|
|
92
|
+
// A resource lane starts with the lanes in a runner run, else at the run's start: what a resource does before
|
|
93
|
+
// its lane starts, such as resolving what to acquire, is part of acquiring it.
|
|
94
|
+
const startedAt = state.lanesStartedAt ?? state.origin ?? at;
|
|
95
|
+
let resources = state.resources;
|
|
96
|
+
for (const lane of lanes)
|
|
97
|
+
resources = startedLane(lane, resources, event.lane, startedAt);
|
|
98
|
+
return { ...state, resources };
|
|
99
|
+
}
|
|
100
|
+
case "lane-ended": {
|
|
101
|
+
if (event.lane === "runner")
|
|
102
|
+
return runnerEnded(state, event.outcome, at);
|
|
103
|
+
let resources = state.resources;
|
|
104
|
+
for (const lane of lanes)
|
|
105
|
+
resources = endedLane(lane, resources, event.lane, event.outcome, at);
|
|
106
|
+
return { ...state, resources };
|
|
107
|
+
}
|
|
108
|
+
case "command-started":
|
|
109
|
+
return {
|
|
110
|
+
...state,
|
|
111
|
+
command: { status: "running", startedAt: at, endedAt: undefined, argv: event.argv, outcome: undefined },
|
|
112
|
+
};
|
|
113
|
+
case "command-ended": {
|
|
114
|
+
if (state.command === undefined)
|
|
115
|
+
return state;
|
|
116
|
+
// The command's own end: in a runner run this event comes once its test events have settled.
|
|
117
|
+
const endedAt = state.command.startedAt + event.ms;
|
|
118
|
+
const status = commandPassed(event.outcome) ? "done" : "failed";
|
|
119
|
+
return { ...state, command: { ...state.command, status, endedAt, outcome: event.outcome } };
|
|
120
|
+
}
|
|
121
|
+
case "cleanup-started":
|
|
122
|
+
return {
|
|
123
|
+
...state,
|
|
124
|
+
cleanup: {
|
|
125
|
+
status: "running",
|
|
126
|
+
startedAt: at,
|
|
127
|
+
endedAt: undefined,
|
|
128
|
+
runner: event.runner,
|
|
129
|
+
keepSandboxMs: event.keepSandboxMs,
|
|
130
|
+
holdings: event.holdings,
|
|
131
|
+
resourceFailures: 0,
|
|
132
|
+
notStopped: 0,
|
|
133
|
+
notDeleted: 0,
|
|
134
|
+
waiting: false,
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
case "cleanup-finished": {
|
|
138
|
+
if (state.cleanup === undefined)
|
|
139
|
+
return state;
|
|
140
|
+
const cleanup = {
|
|
141
|
+
...state.cleanup,
|
|
142
|
+
endedAt: at,
|
|
143
|
+
resourceFailures: totalResourceFailures(event.resourceFailures),
|
|
144
|
+
notStopped: event.notStopped,
|
|
145
|
+
notDeleted: event.notDeleted,
|
|
146
|
+
waiting: false,
|
|
147
|
+
};
|
|
148
|
+
return { ...state, cleanup: { ...cleanup, status: cleanupProblems(cleanup) === 0 ? "done" : "failed" } };
|
|
149
|
+
}
|
|
150
|
+
case "runner":
|
|
151
|
+
return applyRunnerEvent(state, event.event, at);
|
|
152
|
+
case "test":
|
|
153
|
+
return { ...state, tests: applyTestEvent(state.tests ?? EMPTY_TESTS, event.event, at) };
|
|
154
|
+
// The run's summary counts unreadable lines and says the results may be incomplete; no view shows either live.
|
|
155
|
+
case "test-event-unreadable":
|
|
156
|
+
case "test-events-incomplete":
|
|
157
|
+
return state;
|
|
158
|
+
// A resource's own events reach its lane, if it has one. Its cleanup counts through `cleanup-finished`.
|
|
159
|
+
case "resource": {
|
|
160
|
+
let resources = state.resources;
|
|
161
|
+
for (const lane of lanes)
|
|
162
|
+
resources = appliedLane(lane, resources, event, at);
|
|
163
|
+
return { ...state, resources };
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/** The event resource `name` reported, when nested `event` is its; undefined when it is another resource's. */
|
|
168
|
+
function ownEvent(name, event) {
|
|
169
|
+
return event.resource === name ? event.event : undefined;
|
|
170
|
+
}
|
|
171
|
+
/** `resources` with `lane`'s state started at `startedAt`, when it is lane `started`. */
|
|
172
|
+
function startedLane(lane, resources, started, startedAt) {
|
|
173
|
+
if (lane.lane !== started)
|
|
174
|
+
return resources;
|
|
175
|
+
return { ...resources, ...entry(lane.resource, lane.start(startedAt)) };
|
|
176
|
+
}
|
|
177
|
+
/** `resources` after `event`, which reaches `lane` when it is its resource's and the lane has started. */
|
|
178
|
+
function appliedLane(lane, resources, event, at) {
|
|
179
|
+
const own = ownEvent(lane.resource, event);
|
|
180
|
+
const state = resources[lane.resource];
|
|
181
|
+
if (own === undefined || state === undefined)
|
|
182
|
+
return resources;
|
|
183
|
+
return { ...resources, ...entry(lane.resource, lane.apply(state, own, at)) };
|
|
184
|
+
}
|
|
185
|
+
/** `resources` with `lane` ended as `outcome` at `at`, when it is lane `ended` and has started. */
|
|
186
|
+
function endedLane(lane, resources, ended, outcome, at) {
|
|
187
|
+
const state = resources[lane.resource];
|
|
188
|
+
if (lane.lane !== ended || state === undefined)
|
|
189
|
+
return resources;
|
|
190
|
+
return { ...resources, ...entry(lane.resource, lane.ended(state, outcome, at)) };
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The runner lane ended as `outcome`. A runner lane that failed or stopped ends each of its steps still running the
|
|
194
|
+
* same way; a step that never started stays pending.
|
|
195
|
+
*/
|
|
196
|
+
function runnerEnded(state, outcome, at) {
|
|
197
|
+
if (state.runner === undefined)
|
|
198
|
+
return state;
|
|
199
|
+
const status = outcome === "ready" ? "done" : outcome;
|
|
200
|
+
return {
|
|
201
|
+
...state,
|
|
202
|
+
runner: {
|
|
203
|
+
...state.runner,
|
|
204
|
+
status,
|
|
205
|
+
endedAt: at,
|
|
206
|
+
steps: state.runner.steps.map((step) => outcome === "ready" || step.status !== "running" ? step : { ...step, status, endedAt: at, latest: undefined }),
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function applyRunnerEvent(state, event, at) {
|
|
211
|
+
switch (event.kind) {
|
|
212
|
+
case "snapshot-reused":
|
|
213
|
+
return withRunner(withStep(state, "snapshot", () => ({ status: "done", startedAt: at, endedAt: at })), () => ({ snapshot: { kind: "reused", id: event.snapshotId, base: event.base } }));
|
|
214
|
+
case "snapshot-build-started":
|
|
215
|
+
return withRunner(withStep(state, "snapshot", () => ({ status: "running", startedAt: at })), () => ({ snapshot: { kind: "building", summary: event.summary } }));
|
|
216
|
+
case "snapshot-built":
|
|
217
|
+
return withRunner(withStep(state, "snapshot", () => ({ status: "done", endedAt: at, latest: undefined })), () => ({ snapshot: { kind: "built", id: event.snapshotId, base: event.base }, activity: undefined }));
|
|
218
|
+
case "snapshot-saving":
|
|
219
|
+
return withRunner(state, () => ({ activity: "saving-snapshot" }));
|
|
220
|
+
case "runner-sandbox-starting":
|
|
221
|
+
return withStep(state, "start", () => ({ status: "running", startedAt: at }));
|
|
222
|
+
case "sandbox-started":
|
|
223
|
+
if (event.role !== "runner")
|
|
224
|
+
return withRunner(state, () => ({ buildSandbox: event.name }));
|
|
225
|
+
return withStep(withRunner(state, () => ({ sandbox: { name: event.name, region: event.region, vcpus: event.vcpus } })), "start", () => ({ status: "done", endedAt: at }));
|
|
226
|
+
case "uploading":
|
|
227
|
+
return withStep(state, "upload", () => ({ status: "running", startedAt: at }));
|
|
228
|
+
case "uploaded":
|
|
229
|
+
return withRunner(withStep(state, "upload", () => ({ status: "done", endedAt: at })), () => ({ uploadBytes: event.bytes }));
|
|
230
|
+
case "step-started":
|
|
231
|
+
// A snapshot build's own step is the snapshot step's label while it runs.
|
|
232
|
+
if (event.phase === "snapshot")
|
|
233
|
+
return withStep(state, "snapshot", () => ({ label: event.label, latest: undefined }));
|
|
234
|
+
return withStep(state, event.phase, () => ({ status: "running", startedAt: at, label: event.label }));
|
|
235
|
+
case "step-output":
|
|
236
|
+
return withStep(state, event.phase, () => ({ latest: event.line }));
|
|
237
|
+
case "step-finished":
|
|
238
|
+
if (event.phase === "snapshot")
|
|
239
|
+
return state;
|
|
240
|
+
return withStep(state, event.phase, () => ({ status: "done", endedAt: at, latest: undefined }));
|
|
241
|
+
case "stopping":
|
|
242
|
+
return { ...state, stopping: true };
|
|
243
|
+
case "command-stopped":
|
|
244
|
+
return state.command === undefined
|
|
245
|
+
? state
|
|
246
|
+
: { ...state, command: { ...state.command, status: "stopped", endedAt: at, outcome: "stopped" } };
|
|
247
|
+
case "waiting-for-snapshot":
|
|
248
|
+
return withRunner(state.cleanup === undefined ? state : { ...state, cleanup: { ...state.cleanup, waiting: true } }, () => ({ activity: "waiting-for-snapshot" }));
|
|
249
|
+
case "sandbox-kept":
|
|
250
|
+
return withRunner(state, () => ({ kept: { name: event.name, stopsAt: event.stopsAt } }));
|
|
251
|
+
// A step's outcome comes from its lane's end, not from the end of its output.
|
|
252
|
+
case "output-started":
|
|
253
|
+
case "output-ended":
|
|
254
|
+
case "snapshot-entry-not-written":
|
|
255
|
+
case "command-output-started":
|
|
256
|
+
return state;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
const EMPTY_TESTS = { workers: [], filesDone: 0, passed: 0, failed: 0 };
|
|
260
|
+
/**
|
|
261
|
+
* The tests after test event `event`, which arrived at `at`. Passed and failed count tests' final results; a worker's
|
|
262
|
+
* events show what it runs.
|
|
263
|
+
*/
|
|
264
|
+
function applyTestEvent(tests, event, at) {
|
|
265
|
+
if (event.kind === "test-result")
|
|
266
|
+
return {
|
|
267
|
+
...tests,
|
|
268
|
+
passed: tests.passed + (event.state === "pass" ? 1 : 0),
|
|
269
|
+
failed: tests.failed + (event.state === "fail" ? 1 : 0),
|
|
270
|
+
};
|
|
271
|
+
const existing = tests.workers.find((candidate) => candidate.worker === event.worker);
|
|
272
|
+
const worker = existing ?? {
|
|
273
|
+
worker: event.worker,
|
|
274
|
+
file: undefined,
|
|
275
|
+
fileStartedAt: undefined,
|
|
276
|
+
containerSince: undefined,
|
|
277
|
+
};
|
|
278
|
+
const put = (changed, rest = {}) => ({
|
|
279
|
+
...tests,
|
|
280
|
+
...rest,
|
|
281
|
+
workers: [...tests.workers.filter((candidate) => candidate.worker !== changed.worker), changed].toSorted((a, b) => a.worker - b.worker),
|
|
282
|
+
});
|
|
283
|
+
switch (event.kind) {
|
|
284
|
+
case "file-started":
|
|
285
|
+
return put({ ...worker, file: event.file, fileStartedAt: at, containerSince: undefined });
|
|
286
|
+
case "test-started":
|
|
287
|
+
return put({ ...worker, file: event.file, fileStartedAt: worker.fileStartedAt ?? at });
|
|
288
|
+
case "test-attempt-finished":
|
|
289
|
+
return put(worker);
|
|
290
|
+
case "file-finished":
|
|
291
|
+
return put({ ...worker, file: undefined, fileStartedAt: undefined, containerSince: undefined }, { filesDone: tests.filesDone + 1 });
|
|
292
|
+
case "container-starting":
|
|
293
|
+
return put({ ...worker, containerSince: at });
|
|
294
|
+
case "container-started":
|
|
295
|
+
return put({ ...worker, containerSince: undefined });
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
/** The state with the runner lane's fields changed by `change`; unchanged without a runner lane. */
|
|
299
|
+
function withRunner(state, change) {
|
|
300
|
+
return state.runner === undefined ? state : { ...state, runner: { ...state.runner, ...change() } };
|
|
301
|
+
}
|
|
302
|
+
/** The state with runner step `name` changed by `change`'s fields; unchanged without a runner lane. */
|
|
303
|
+
function withStep(state, name, change) {
|
|
304
|
+
if (state.runner === undefined)
|
|
305
|
+
return state;
|
|
306
|
+
return {
|
|
307
|
+
...state,
|
|
308
|
+
runner: {
|
|
309
|
+
...state.runner,
|
|
310
|
+
steps: state.runner.steps.map((step) => (step.name === name ? { ...step, ...change() } : step)),
|
|
311
|
+
},
|
|
312
|
+
};
|
|
313
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { type CredentialGateway, type CredentialSourceChoice, type GitHubActionsTokenGateway, type MintFailure, type MintTarget } from "../credential/index.ts";
|
|
2
|
+
import { type PreparedRunner, type RunnerContext, type RunnerFailure, type RunnerScopeReport, type RunnerSnapshotCacheFailure, type RunnerSnapshotEntry } from "../runner/index.ts";
|
|
3
|
+
import type { RunProgress } from "./events.ts";
|
|
4
|
+
import type { CommandGateway } from "./gateways.ts";
|
|
5
|
+
import type { CoreContext, RunProviders, ResourceCanceledFacts, ResourceCleanup, ResourceFacts, ResourceRefusal, ResourceRequests, ResourceUnprepared } from "./resource.ts";
|
|
6
|
+
import type { RanCommand } from "./timing.ts";
|
|
7
|
+
/**
|
|
8
|
+
* The gateways and seams the core reaches the world through: the mint and GitHub Actions' OIDC token issuer, which
|
|
9
|
+
* the run's credential source uses, the command, and the runner's (the checkout, the runner snapshot cache, Vercel
|
|
10
|
+
* Sandbox, the terminal and the timer), which only a runner run uses, but for the terminal, where a local command's
|
|
11
|
+
* output goes too, and the timer a token request's retries wait on. Each resource's provider declares its own beside these, and the app's context holds them all.
|
|
12
|
+
*/
|
|
13
|
+
export interface RunContext extends CoreContext, RunnerContext {
|
|
14
|
+
readonly credentials: CredentialGateway;
|
|
15
|
+
readonly githubActionsTokens: GitHubActionsTokenGateway;
|
|
16
|
+
readonly commands: CommandGateway;
|
|
17
|
+
}
|
|
18
|
+
/** What a runner run needs beyond a local run. */
|
|
19
|
+
export interface RunRunnerRequest {
|
|
20
|
+
/** The runner checked on this machine (`prepareRunner`). */
|
|
21
|
+
readonly prepared: PreparedRunner;
|
|
22
|
+
/** The team and project the run's credential is minted for: the runner sandbox runs there. */
|
|
23
|
+
readonly target: MintTarget;
|
|
24
|
+
/** The local user name, for each sandbox's `user` tag. */
|
|
25
|
+
readonly user: string;
|
|
26
|
+
/** How long the runner sandbox keeps running once the run ends, in milliseconds; 0 stops and deletes it. */
|
|
27
|
+
readonly keepSandboxMs: number;
|
|
28
|
+
}
|
|
29
|
+
/** What every run was asked to do, local or in a runner run. */
|
|
30
|
+
interface RunRequestBase {
|
|
31
|
+
/** The command. */
|
|
32
|
+
readonly argv: readonly string[];
|
|
33
|
+
/** The base of the command's environment. */
|
|
34
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
35
|
+
/** storm's version, reported first. */
|
|
36
|
+
readonly version: string;
|
|
37
|
+
/** The git commit storm was built from, as the version line shows it; null when unknown. */
|
|
38
|
+
readonly commit: string | null;
|
|
39
|
+
/** The config file the run's settings came from, reported after the version; null when none applied. */
|
|
40
|
+
readonly configFile: string | null;
|
|
41
|
+
/** Under `--verbose`: the run payload asks the command to print what each test did as it goes. */
|
|
42
|
+
readonly verbose?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/** A run whose command runs on this machine. */
|
|
45
|
+
export interface LocalRunRequest<K> extends RunRequestBase {
|
|
46
|
+
readonly runner?: undefined;
|
|
47
|
+
/** Each resource's part of the run's request, by name; a run that names none holds no resource. */
|
|
48
|
+
readonly resources: ResourceRequests<K>;
|
|
49
|
+
/**
|
|
50
|
+
* The credential source the run settled (`--credential`), which it does when a held resource takes the credential:
|
|
51
|
+
* the core builds the source once and hands it to every resource it acquires. None when no held resource takes it.
|
|
52
|
+
*/
|
|
53
|
+
readonly credential?: CredentialSourceChoice;
|
|
54
|
+
/**
|
|
55
|
+
* The file the run payload names for the command's test events, which the caller reads once the run is done; none
|
|
56
|
+
* when undefined. A runner run follows them in the runner sandbox instead.
|
|
57
|
+
*/
|
|
58
|
+
readonly testEvents?: string;
|
|
59
|
+
}
|
|
60
|
+
/** A runner run: the command runs in a runner sandbox, readied beside the resources. */
|
|
61
|
+
export interface RemoteRunRequest<K> extends RunRequestBase {
|
|
62
|
+
readonly runner: RunRunnerRequest;
|
|
63
|
+
/**
|
|
64
|
+
* Each resource's part of the run's request, by name; a run that names none holds no resource. A runner run always
|
|
65
|
+
* mints, for the runner sandbox, and shares that mint with the resources, so it names no credential source.
|
|
66
|
+
*/
|
|
67
|
+
readonly resources: ResourceRequests<K>;
|
|
68
|
+
}
|
|
69
|
+
/** What a run was asked to do. */
|
|
70
|
+
export type RunRequest<K> = LocalRunRequest<K> | RemoteRunRequest<K>;
|
|
71
|
+
/**
|
|
72
|
+
* How a run is stopped. `signal` aborting before the command starts cancels the run at its next step; once the
|
|
73
|
+
* command runs, the run waits for it whatever `signal` does. `terminate` aborting sends the command SIGTERM.
|
|
74
|
+
* In a runner run, `signal` aborting stops the run in any phase: it kills the remote command if it started and
|
|
75
|
+
* starts closing the runner's sandbox scope at once, and `terminate` goes unused.
|
|
76
|
+
*/
|
|
77
|
+
export interface RunControl {
|
|
78
|
+
readonly signal: AbortSignal;
|
|
79
|
+
readonly terminate: AbortSignal;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Why the runner couldn't run the command: a runner failure (`RunnerFailure`), or `credential-claims-missing`, a
|
|
83
|
+
* credential whose token names no team and project ids, found before any Sandbox call.
|
|
84
|
+
*/
|
|
85
|
+
export type RunRunnerFailure = RunnerFailure | {
|
|
86
|
+
readonly kind: "credential-claims-missing";
|
|
87
|
+
readonly target: MintTarget;
|
|
88
|
+
};
|
|
89
|
+
/** What a runner run got from the runner sandbox, once the command ran in it. */
|
|
90
|
+
export interface RanRunner {
|
|
91
|
+
readonly snapshotId: string;
|
|
92
|
+
readonly base: string;
|
|
93
|
+
/** Whether this run built the runner snapshot. */
|
|
94
|
+
readonly built: boolean;
|
|
95
|
+
readonly vcpus: number;
|
|
96
|
+
readonly region: string;
|
|
97
|
+
readonly runtime: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* How a run ended, over the registry's kinds `K`.
|
|
101
|
+
*
|
|
102
|
+
* - `ran`: the command ran and ended; the caller exits with its status (see `commandExitStatus`). `resources` holds
|
|
103
|
+
* what each acquired resource tells it.
|
|
104
|
+
* - `resource-unprepared`: a resource refused before the run held anything (`ResourceUnprepared`); nothing was
|
|
105
|
+
* minted, and it carries no cleanup.
|
|
106
|
+
* - `resource-refused`: a resource refused while the run acquired (`ResourceRefusal`), so the command didn't run.
|
|
107
|
+
* - `mint-failed`: the run's mint failed. In a runner run, the mint for the runner sandbox (`runner: true`), which
|
|
108
|
+
* happens first, whatever the resources hold; in a local run, the mint a resource needed and couldn't go on without
|
|
109
|
+
* (`runner: false`).
|
|
110
|
+
* - `spawn-failed`: the command couldn't start.
|
|
111
|
+
* - `canceled`: `signal` aborted before the command started, or in a runner run in any phase. `resources` holds what
|
|
112
|
+
* each resource the run asked for says of how far acquiring it got; in a runner run, `commandStopped` says whether
|
|
113
|
+
* the remote command had started and was killed.
|
|
114
|
+
* - `runner-failed`: in a runner run, the runner couldn't run the command.
|
|
115
|
+
* - `snapshot-gone`: in a runner run, cached runner snapshot `entry` was gone when the runner sandbox started from
|
|
116
|
+
* it; its entry was removed, unless `removal` says why it couldn't be.
|
|
117
|
+
*
|
|
118
|
+
* Every outcome but `resource-unprepared` carries `runnerCleanup`: in a runner run, the report of closing the runner's
|
|
119
|
+
* sandbox scope, which the run opens before it mints, so the report is there however the run ended, with the team and
|
|
120
|
+
* project its sandboxes are in; `null` otherwise.
|
|
121
|
+
* It carries `resourceCleanup` too (`ResourceCleanup`): every resource the run held is released before it returns,
|
|
122
|
+
* whichever way it ended, and in a runner run after the runner's sandboxes are stopped and deleted. `executeRun` sets
|
|
123
|
+
* both once.
|
|
124
|
+
*/
|
|
125
|
+
export type RunOutcome<K> = RanRun<K> | ResourceUnprepared<K> | (RunStopped<K> & RunCleanup<K>);
|
|
126
|
+
/** What closing a runner run's sandbox scope left, and the team and project its sandboxes are in: the run's target. */
|
|
127
|
+
export interface RunnerCleanupReport extends RunnerScopeReport {
|
|
128
|
+
readonly target: MintTarget;
|
|
129
|
+
}
|
|
130
|
+
/** What a run that got as far as acquiring reports of its cleanup. */
|
|
131
|
+
export interface RunCleanup<K> {
|
|
132
|
+
readonly runnerCleanup: RunnerCleanupReport | null;
|
|
133
|
+
readonly resourceCleanup: ResourceCleanup<K>;
|
|
134
|
+
}
|
|
135
|
+
/** The command ran and ended. */
|
|
136
|
+
export interface RanRun<K> extends RunCleanup<K> {
|
|
137
|
+
readonly kind: "ran";
|
|
138
|
+
readonly resources: ResourceFacts<K>;
|
|
139
|
+
readonly command: RanCommand;
|
|
140
|
+
/** In a runner run, the runner sandbox the command ran in; undefined otherwise. */
|
|
141
|
+
readonly runner: RanRunner | undefined;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* How a run ended short of the command ending, before the run releases its resources and attaches the runner's
|
|
145
|
+
* cleanup report. A resource's refusal is one of these.
|
|
146
|
+
*/
|
|
147
|
+
export type RunStopped<K> = ResourceRefusal<K> | {
|
|
148
|
+
readonly kind: "mint-failed";
|
|
149
|
+
readonly failure: MintFailure;
|
|
150
|
+
/** What the mint was for. */
|
|
151
|
+
readonly target: MintTarget;
|
|
152
|
+
/** Whether the mint was for the runner sandbox, in a runner run. */
|
|
153
|
+
readonly runner: boolean;
|
|
154
|
+
} | {
|
|
155
|
+
readonly kind: "spawn-failed";
|
|
156
|
+
readonly executable: string;
|
|
157
|
+
readonly message: string;
|
|
158
|
+
} | {
|
|
159
|
+
readonly kind: "canceled";
|
|
160
|
+
readonly resources: ResourceCanceledFacts<K>;
|
|
161
|
+
/** In a runner run, whether the remote command had started, and so was killed. */
|
|
162
|
+
readonly commandStopped?: boolean;
|
|
163
|
+
} | {
|
|
164
|
+
readonly kind: "runner-failed";
|
|
165
|
+
readonly failure: RunRunnerFailure;
|
|
166
|
+
} | {
|
|
167
|
+
readonly kind: "snapshot-gone";
|
|
168
|
+
readonly entry: RunnerSnapshotEntry;
|
|
169
|
+
/** Why its cache entry couldn't be removed; undefined when it was. */
|
|
170
|
+
readonly removal: RunnerSnapshotCacheFailure | undefined;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Runs `request.argv` with the resources it asks for, through `providers`, the registry's providers in order. It
|
|
174
|
+
* prepares each resource, acquires them all at once (`acquireResources`), runs the command with the run payload in
|
|
175
|
+
* `STORM_RUN`, waits for it, and releases every resource it held. It reports each step to `progress`. What
|
|
176
|
+
* preparing, acquiring and releasing do is each resource's own: see its provider. A run that asks for no resource goes
|
|
177
|
+
* straight to its command. It hands `context` to every provider as it is.
|
|
178
|
+
*
|
|
179
|
+
* In a runner run (`request.runner`), the command runs in a runner sandbox, readied beside the resources (see
|
|
180
|
+
* `provisionAndRunRemote`).
|
|
181
|
+
*
|
|
182
|
+
* Release happens in `finally`, however the run ended, a throw included: once the command has stopped and, in a
|
|
183
|
+
* runner run, the runner's sandboxes are closed, each resource is released in reverse order, even when the
|
|
184
|
+
* `cleanup-started` event can't be reported.
|
|
185
|
+
*/
|
|
186
|
+
export declare function executeRun<K, C extends RunContext>(providers: RunProviders<K, C>, context: C, request: RunRequest<K>, control: RunControl, progress: RunProgress<K>): Promise<RunOutcome<K>>;
|
|
187
|
+
export {};
|