@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,131 @@
|
|
|
1
|
+
import type { CredentialSource } from "../credential/index.ts";
|
|
2
|
+
import type { LaneOutcome, RunProgress } from "./events.ts";
|
|
3
|
+
import type { RunProviders, ResourceCanceledFacts, ResourceCleanup, ResourceFacts, ResourceFailures, ResourceHoldings, ResourcePayloads, ResourceRefusal, ResourceRequests, ResourceUnprepared, RunLane } from "./resource.ts";
|
|
4
|
+
import type { RunStopped } from "./run.ts";
|
|
5
|
+
/**
|
|
6
|
+
* How acquiring one resource ended, as the policy ranks it: its own outcome stays in its slot. `refused` carries the
|
|
7
|
+
* outcome it ends the run with: its own refusal, or the run's `mint-failed`.
|
|
8
|
+
*/
|
|
9
|
+
type SlotOutcome<K> = {
|
|
10
|
+
readonly kind: "acquired";
|
|
11
|
+
} | {
|
|
12
|
+
readonly kind: "refused";
|
|
13
|
+
readonly outcome: ResourceRefusal<K> | MintFailedStop;
|
|
14
|
+
} | {
|
|
15
|
+
readonly kind: "canceled";
|
|
16
|
+
};
|
|
17
|
+
/** A local run's mint failing a resource that couldn't go on without it. */
|
|
18
|
+
type MintFailedStop = Extract<RunStopped<never>, {
|
|
19
|
+
readonly kind: "mint-failed";
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Settles one lane's task: reports how lane `lane` ended, by `outcomeOf` its value or as failed when it throws, and
|
|
23
|
+
* answers the value. A slot hands its provider's own acquire to it, so the lane ends as soon as the acquire does.
|
|
24
|
+
*/
|
|
25
|
+
type LaneSettle<K> = <V>(lane: RunLane<K> | undefined, task: Promise<V>, outcomeOf: (value: V) => LaneOutcome) => Promise<V>;
|
|
26
|
+
/**
|
|
27
|
+
* One provider, bound to one run: its part of the run request, what it owns, and how acquiring it ended. Everything
|
|
28
|
+
* it answers is keyed by its name.
|
|
29
|
+
*/
|
|
30
|
+
export interface ResourceSlot<K> {
|
|
31
|
+
readonly name: keyof K & string;
|
|
32
|
+
readonly lane: RunLane<K> | undefined;
|
|
33
|
+
/** Whether the run holds it: the run asked for it, and its provider's `requested` answered a request. */
|
|
34
|
+
readonly held: boolean;
|
|
35
|
+
prepare(progress: RunProgress<K>): Promise<ResourceUnprepared<K> | undefined>;
|
|
36
|
+
/** Reports its lane's start, when the run holds it and it has a lane, just before the run acquires it. */
|
|
37
|
+
startLane(progress: RunProgress<K>): Promise<void>;
|
|
38
|
+
/** Acquires it through `settle`, when the run holds it; undefined when it doesn't. */
|
|
39
|
+
acquire(input: {
|
|
40
|
+
readonly signal: AbortSignal;
|
|
41
|
+
readonly credential: CredentialSource | undefined;
|
|
42
|
+
readonly progress: RunProgress<K>;
|
|
43
|
+
readonly settle: LaneSettle<K>;
|
|
44
|
+
}): Promise<SlotOutcome<K> | undefined>;
|
|
45
|
+
/** Reports it ready, once acquired. */
|
|
46
|
+
ready(progress: RunProgress<K>): Promise<void>;
|
|
47
|
+
/** Its run payload entry, once acquired. */
|
|
48
|
+
payload(): ResourcePayloads<K>;
|
|
49
|
+
/** What it tells a `ran` outcome, once acquired. */
|
|
50
|
+
facts(): ResourceFacts<K>;
|
|
51
|
+
/** What a `canceled` outcome says of it, by how far acquiring it got; nothing when the run doesn't hold it. */
|
|
52
|
+
canceledFacts(): ResourceCanceledFacts<K>;
|
|
53
|
+
/** What the run holds of it, from what it owns, as its presentation names it once cleanup starts. */
|
|
54
|
+
holding(): ResourceHoldings<K>;
|
|
55
|
+
/** Releases what it owns, when the run holds it, and answers what that did. */
|
|
56
|
+
release(progress: RunProgress<K>): Promise<ResourceCleanup<K>>;
|
|
57
|
+
/** How many things releasing it couldn't do, from the run's `cleanup`. */
|
|
58
|
+
failures(cleanup: ResourceCleanup<K>): ResourceFailures<K>;
|
|
59
|
+
}
|
|
60
|
+
/** Each of `providers`, bound to this run, in order. */
|
|
61
|
+
export declare function resourceSlots<K, C>(providers: RunProviders<K, C>, context: C, requests: ResourceRequests<K>): readonly ResourceSlot<K>[];
|
|
62
|
+
/** The lanes of the resources the run holds, in provider order, which the `started` event reports. */
|
|
63
|
+
export declare function heldLanes<K>(slots: readonly ResourceSlot<K>[]): readonly RunLane<K>[];
|
|
64
|
+
/**
|
|
65
|
+
* Prepares each resource in order, before the run acquires anything: the first refusal ends the run, holding
|
|
66
|
+
* nothing.
|
|
67
|
+
*/
|
|
68
|
+
export declare function prepareResources<K>(slots: readonly ResourceSlot<K>[], progress: RunProgress<K>): Promise<ResourceUnprepared<K> | undefined>;
|
|
69
|
+
/**
|
|
70
|
+
* A lane a runner run readies beside its resources: the runner sandbox. `stopped` is the outcome its value ends the
|
|
71
|
+
* run with, which ranks above every resource's refusal; undefined when it doesn't end the run.
|
|
72
|
+
*/
|
|
73
|
+
export interface BesideLane<K, T> {
|
|
74
|
+
readonly lane: RunLane<K>;
|
|
75
|
+
readonly start: (signal: AbortSignal) => Promise<T>;
|
|
76
|
+
readonly outcomeOf: (value: T) => LaneOutcome;
|
|
77
|
+
readonly stopped: (value: T) => RunStopped<K> | undefined;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* How acquiring a run's resources ended: `stopped` with the outcome that ends the run before its command, or every
|
|
81
|
+
* resource the run asked for `acquired`, with the beside lane's value, if it had one.
|
|
82
|
+
*/
|
|
83
|
+
export type Acquisition<K, T> = {
|
|
84
|
+
readonly kind: "stopped";
|
|
85
|
+
readonly outcome: RunStopped<K>;
|
|
86
|
+
} | {
|
|
87
|
+
readonly kind: "acquired";
|
|
88
|
+
readonly beside: T | undefined;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Acquires every resource the run holds at once, in order, and in a runner run readies the runner lane (`beside`)
|
|
92
|
+
* beside them. Everything runs under one internal abort combined with the user's `signal`: a resource that refuses or
|
|
93
|
+
* throws, a lane that ends short of ready, or a lane whose end can't be reported aborts the rest, so all settle soon.
|
|
94
|
+
* It waits for all of them before it answers, so the run's cleanup sees everything they own. First each resource with a
|
|
95
|
+
* lane reports its lane's start, in order, so every acquire then starts at once, beside the beside lane; each of those
|
|
96
|
+
* lanes reports how it ended as it settles, a throw as failed.
|
|
97
|
+
*
|
|
98
|
+
* A throw rethrows, the beside lane's first, then the resources' in order. Otherwise the outcome ranks, the same in
|
|
99
|
+
* both kinds of run: the user's `signal` (`canceled`), then the beside lane's failure, then each resource's refusal in
|
|
100
|
+
* order (its own, or the run's `mint-failed` when the mint it needed failed), then a resource's cancellation. A refusal aborts the other resources, so one that stops on that abort answers
|
|
101
|
+
* `canceled`; ranking every refusal above every cancellation keeps the refusal that caused it.
|
|
102
|
+
*/
|
|
103
|
+
export declare function acquireResources<K, T>(slots: readonly ResourceSlot<K>[], input: {
|
|
104
|
+
readonly credential: CredentialSource | undefined;
|
|
105
|
+
readonly signal: AbortSignal;
|
|
106
|
+
readonly progress: RunProgress<K>;
|
|
107
|
+
readonly beside?: BesideLane<K, T>;
|
|
108
|
+
}): Promise<Acquisition<K, T>>;
|
|
109
|
+
/** The `canceled` stop of a run whose resources got as far as `slots` say. */
|
|
110
|
+
export declare function canceledHolding<K>(slots: readonly ResourceSlot<K>[]): Extract<RunStopped<K>, {
|
|
111
|
+
kind: "canceled";
|
|
112
|
+
}>;
|
|
113
|
+
/** Reports each acquired resource ready, in order, just before the command starts. */
|
|
114
|
+
export declare function readyResources<K>(slots: readonly ResourceSlot<K>[], progress: RunProgress<K>): Promise<void>;
|
|
115
|
+
/** The run payload's `resources`: each acquired resource's entry, under its name, in order. */
|
|
116
|
+
export declare function resourcesPayload<K>(slots: readonly ResourceSlot<K>[]): ResourcePayloads<K>;
|
|
117
|
+
/** What the acquired resources tell a `ran` outcome, under each one's name. */
|
|
118
|
+
export declare function resourcesFacts<K>(slots: readonly ResourceSlot<K>[]): ResourceFacts<K>;
|
|
119
|
+
/** The resources the run holds, in provider order, which the `started` event reports. */
|
|
120
|
+
export declare function heldResources<K>(slots: readonly ResourceSlot<K>[]): readonly (keyof K & string)[];
|
|
121
|
+
/** What the run holds of each resource, under its name, as cleanup starts. */
|
|
122
|
+
export declare function resourceHoldings<K>(slots: readonly ResourceSlot<K>[]): ResourceHoldings<K>;
|
|
123
|
+
/**
|
|
124
|
+
* Releases every resource the run holds, in reverse order, and answers what that did, keyed by resource name: only the
|
|
125
|
+
* resources whose release reported something. Each release runs even when one before it threw; the first throw is
|
|
126
|
+
* rethrown once all have run.
|
|
127
|
+
*/
|
|
128
|
+
export declare function releaseResources<K>(slots: readonly ResourceSlot<K>[], progress: RunProgress<K>): Promise<ResourceCleanup<K>>;
|
|
129
|
+
/** How many things releasing each resource in `cleanup` couldn't do, in the order the run released them. */
|
|
130
|
+
export declare function resourceFailures<K>(slots: readonly ResourceSlot<K>[], cleanup: ResourceCleanup<K>): ResourceFailures<K>;
|
|
131
|
+
export {};
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
// How a run prepares, acquires, readies, hands over and releases its resources, through each resource's provider. One
|
|
2
|
+
// policy serves a local run and a runner run alike, and names no resource. `slotOf` binds each provider to the run;
|
|
3
|
+
// its closures keep the provider's kind tied to its name, so the policy below works over slots and never relates a
|
|
4
|
+
// name to the kinds map.
|
|
5
|
+
import { entry } from "./keyed.js";
|
|
6
|
+
/** Each of `providers`, bound to this run, in order. */
|
|
7
|
+
export function resourceSlots(providers, context, requests) {
|
|
8
|
+
return providers.map((provider) => slotOf(provider, context, requests));
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* `provider` bound to this run. Inside, `N` is one name, so every `K[N]` lines up; the only places the name meets the
|
|
12
|
+
* map are the helpers in `keyed.ts`.
|
|
13
|
+
*/
|
|
14
|
+
function slotOf(provider, context, requests) {
|
|
15
|
+
const { name } = provider;
|
|
16
|
+
const request = requests[name];
|
|
17
|
+
const acquireRequest = request === undefined ? undefined : provider.requested(request);
|
|
18
|
+
const owned = [];
|
|
19
|
+
let settled;
|
|
20
|
+
// The core nests the provider's own events under its name; the provider never builds the wrapper.
|
|
21
|
+
const scoped = (progress) => ({
|
|
22
|
+
emit: (event) => {
|
|
23
|
+
const nested = { kind: "resource", resource: name, event };
|
|
24
|
+
return progress.emit(nested);
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
const acquired = () => (settled?.kind === "acquired" ? settled : undefined);
|
|
28
|
+
const lane = provider.lane;
|
|
29
|
+
return {
|
|
30
|
+
name,
|
|
31
|
+
lane,
|
|
32
|
+
held: acquireRequest !== undefined,
|
|
33
|
+
prepare: async (progress) => {
|
|
34
|
+
if (request === undefined || provider.prepare === undefined)
|
|
35
|
+
return undefined;
|
|
36
|
+
const refused = await provider.prepare(context, request, scoped(progress));
|
|
37
|
+
return refused === undefined ? undefined : { kind: "resource-unprepared", resource: name, refusal: refused };
|
|
38
|
+
},
|
|
39
|
+
startLane: async (progress) => {
|
|
40
|
+
if (acquireRequest !== undefined && lane !== undefined)
|
|
41
|
+
await progress.emit({ kind: "lane-started", lane });
|
|
42
|
+
},
|
|
43
|
+
acquire: async ({ signal, credential, progress, settle }) => {
|
|
44
|
+
if (acquireRequest === undefined)
|
|
45
|
+
return undefined;
|
|
46
|
+
settled = await settle(lane, provider.acquire({
|
|
47
|
+
context,
|
|
48
|
+
request: acquireRequest,
|
|
49
|
+
signal,
|
|
50
|
+
progress: scoped(progress),
|
|
51
|
+
owned,
|
|
52
|
+
credential,
|
|
53
|
+
}), resourceLaneOutcome);
|
|
54
|
+
if (settled.kind === "refused")
|
|
55
|
+
return { kind: "refused", outcome: { kind: "resource-refused", resource: name, refusal: settled.refusal } };
|
|
56
|
+
if (settled.kind === "mint-failed") {
|
|
57
|
+
const { failure, target } = settled;
|
|
58
|
+
return { kind: "refused", outcome: { kind: "mint-failed", failure, target, runner: false } };
|
|
59
|
+
}
|
|
60
|
+
return { kind: settled.kind };
|
|
61
|
+
},
|
|
62
|
+
ready: async (progress) => {
|
|
63
|
+
const resource = acquired();
|
|
64
|
+
if (resource === undefined || provider.ready === undefined)
|
|
65
|
+
return;
|
|
66
|
+
await provider.ready({ connection: resource.connection, progress: scoped(progress) });
|
|
67
|
+
},
|
|
68
|
+
payload: () => {
|
|
69
|
+
const resource = acquired();
|
|
70
|
+
return resource === undefined ? {} : entry(name, provider.payload(resource.connection));
|
|
71
|
+
},
|
|
72
|
+
facts: () => {
|
|
73
|
+
const resource = acquired();
|
|
74
|
+
return resource === undefined ? {} : entry(name, resource.facts);
|
|
75
|
+
},
|
|
76
|
+
canceledFacts: () => {
|
|
77
|
+
if (acquireRequest === undefined)
|
|
78
|
+
return {};
|
|
79
|
+
if (settled?.kind === "canceled")
|
|
80
|
+
return entry(name, settled.facts);
|
|
81
|
+
if (provider.canceledFacts === undefined)
|
|
82
|
+
return {};
|
|
83
|
+
return entry(name, provider.canceledFacts(acquireRequest, acquired()?.facts));
|
|
84
|
+
},
|
|
85
|
+
holding: () => {
|
|
86
|
+
const holding = provider.holding?.(owned);
|
|
87
|
+
return holding === undefined ? {} : entry(name, holding);
|
|
88
|
+
},
|
|
89
|
+
release: async (progress) => {
|
|
90
|
+
if (acquireRequest === undefined)
|
|
91
|
+
return {};
|
|
92
|
+
const released = await provider.release(context, owned, scoped(progress));
|
|
93
|
+
return released === undefined ? {} : entry(name, released);
|
|
94
|
+
},
|
|
95
|
+
failures: (cleanup) => {
|
|
96
|
+
const released = cleanup[name];
|
|
97
|
+
return released === undefined ? {} : entry(name, provider.failures(released));
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/** The lanes of the resources the run holds, in provider order, which the `started` event reports. */
|
|
102
|
+
export function heldLanes(slots) {
|
|
103
|
+
return slots.flatMap((slot) => (slot.held && slot.lane !== undefined ? [slot.lane] : []));
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Prepares each resource in order, before the run acquires anything: the first refusal ends the run, holding
|
|
107
|
+
* nothing.
|
|
108
|
+
*/
|
|
109
|
+
export async function prepareResources(slots, progress) {
|
|
110
|
+
for (const slot of slots) {
|
|
111
|
+
const refused = await slot.prepare(progress);
|
|
112
|
+
if (refused !== undefined)
|
|
113
|
+
return refused;
|
|
114
|
+
}
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Acquires every resource the run holds at once, in order, and in a runner run readies the runner lane (`beside`)
|
|
119
|
+
* beside them. Everything runs under one internal abort combined with the user's `signal`: a resource that refuses or
|
|
120
|
+
* throws, a lane that ends short of ready, or a lane whose end can't be reported aborts the rest, so all settle soon.
|
|
121
|
+
* It waits for all of them before it answers, so the run's cleanup sees everything they own. First each resource with a
|
|
122
|
+
* lane reports its lane's start, in order, so every acquire then starts at once, beside the beside lane; each of those
|
|
123
|
+
* lanes reports how it ended as it settles, a throw as failed.
|
|
124
|
+
*
|
|
125
|
+
* A throw rethrows, the beside lane's first, then the resources' in order. Otherwise the outcome ranks, the same in
|
|
126
|
+
* both kinds of run: the user's `signal` (`canceled`), then the beside lane's failure, then each resource's refusal in
|
|
127
|
+
* order (its own, or the run's `mint-failed` when the mint it needed failed), then a resource's cancellation. A refusal aborts the other resources, so one that stops on that abort answers
|
|
128
|
+
* `canceled`; ranking every refusal above every cancellation keeps the refusal that caused it.
|
|
129
|
+
*/
|
|
130
|
+
export async function acquireResources(slots, input) {
|
|
131
|
+
const { progress, beside } = input;
|
|
132
|
+
const internal = new AbortController();
|
|
133
|
+
const signal = AbortSignal.any([input.signal, internal.signal]);
|
|
134
|
+
// Each lane says how it ended, whichever way, a rejection as failed. Anything that ends short of ready, or can't
|
|
135
|
+
// report its end, stops the rest.
|
|
136
|
+
const settle = async (lane, task, outcomeOf) => {
|
|
137
|
+
let value;
|
|
138
|
+
let outcome;
|
|
139
|
+
try {
|
|
140
|
+
value = await task;
|
|
141
|
+
outcome = outcomeOf(value);
|
|
142
|
+
if (lane !== undefined)
|
|
143
|
+
await progress.emit({ kind: "lane-ended", lane, outcome });
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
// A lane that ended without saying so still says it failed; one whose report failed has said nothing more.
|
|
147
|
+
if (lane !== undefined && outcome === undefined)
|
|
148
|
+
await progress.emit({ kind: "lane-ended", lane, outcome: "failed" }).catch(() => undefined);
|
|
149
|
+
internal.abort();
|
|
150
|
+
throw error;
|
|
151
|
+
}
|
|
152
|
+
if (outcome !== "ready")
|
|
153
|
+
internal.abort();
|
|
154
|
+
return value;
|
|
155
|
+
};
|
|
156
|
+
for (const slot of slots)
|
|
157
|
+
await slot.startLane(progress);
|
|
158
|
+
const resourceTasks = slots.map((slot) => slot.acquire({ signal, credential: input.credential, progress, settle }));
|
|
159
|
+
const besideTask = beside === undefined ? Promise.resolve(undefined) : settle(beside.lane, beside.start(signal), beside.outcomeOf);
|
|
160
|
+
const [[besideSettled], resourcesSettled] = await Promise.all([
|
|
161
|
+
Promise.allSettled([besideTask]),
|
|
162
|
+
Promise.allSettled(resourceTasks),
|
|
163
|
+
]);
|
|
164
|
+
if (besideSettled.status === "rejected")
|
|
165
|
+
throw besideSettled.reason;
|
|
166
|
+
const outcomes = [];
|
|
167
|
+
for (const one of resourcesSettled) {
|
|
168
|
+
if (one.status === "rejected")
|
|
169
|
+
throw one.reason;
|
|
170
|
+
outcomes.push(one.value);
|
|
171
|
+
}
|
|
172
|
+
if (input.signal.aborted)
|
|
173
|
+
return { kind: "stopped", outcome: canceledHolding(slots) };
|
|
174
|
+
const besideValue = besideSettled.value;
|
|
175
|
+
const besideStopped = besideValue === undefined ? undefined : beside?.stopped(besideValue);
|
|
176
|
+
if (besideStopped !== undefined)
|
|
177
|
+
return { kind: "stopped", outcome: besideStopped };
|
|
178
|
+
for (const outcome of outcomes)
|
|
179
|
+
if (outcome?.kind === "refused")
|
|
180
|
+
return { kind: "stopped", outcome: outcome.outcome };
|
|
181
|
+
if (outcomes.some((outcome) => outcome?.kind === "canceled"))
|
|
182
|
+
return { kind: "stopped", outcome: canceledHolding(slots) };
|
|
183
|
+
return { kind: "acquired", beside: besideValue };
|
|
184
|
+
}
|
|
185
|
+
/** How a resource's lane ended, by how acquiring it did: ready once acquired, stopped when canceled, else failed. */
|
|
186
|
+
function resourceLaneOutcome(outcome) {
|
|
187
|
+
if (outcome.kind === "acquired")
|
|
188
|
+
return "ready";
|
|
189
|
+
return outcome.kind === "canceled" ? "stopped" : "failed";
|
|
190
|
+
}
|
|
191
|
+
/** The `canceled` stop of a run whose resources got as far as `slots` say. */
|
|
192
|
+
export function canceledHolding(slots) {
|
|
193
|
+
let resources = {};
|
|
194
|
+
for (const slot of slots)
|
|
195
|
+
resources = { ...resources, ...slot.canceledFacts() };
|
|
196
|
+
return { kind: "canceled", resources };
|
|
197
|
+
}
|
|
198
|
+
/** Reports each acquired resource ready, in order, just before the command starts. */
|
|
199
|
+
export async function readyResources(slots, progress) {
|
|
200
|
+
for (const slot of slots)
|
|
201
|
+
await slot.ready(progress);
|
|
202
|
+
}
|
|
203
|
+
/** The run payload's `resources`: each acquired resource's entry, under its name, in order. */
|
|
204
|
+
export function resourcesPayload(slots) {
|
|
205
|
+
let resources = {};
|
|
206
|
+
for (const slot of slots)
|
|
207
|
+
resources = { ...resources, ...slot.payload() };
|
|
208
|
+
return resources;
|
|
209
|
+
}
|
|
210
|
+
/** What the acquired resources tell a `ran` outcome, under each one's name. */
|
|
211
|
+
export function resourcesFacts(slots) {
|
|
212
|
+
let facts = {};
|
|
213
|
+
for (const slot of slots)
|
|
214
|
+
facts = { ...facts, ...slot.facts() };
|
|
215
|
+
return facts;
|
|
216
|
+
}
|
|
217
|
+
/** The resources the run holds, in provider order, which the `started` event reports. */
|
|
218
|
+
export function heldResources(slots) {
|
|
219
|
+
return slots.flatMap((slot) => (slot.held ? [slot.name] : []));
|
|
220
|
+
}
|
|
221
|
+
/** What the run holds of each resource, under its name, as cleanup starts. */
|
|
222
|
+
export function resourceHoldings(slots) {
|
|
223
|
+
let holdings = {};
|
|
224
|
+
for (const slot of slots)
|
|
225
|
+
holdings = { ...holdings, ...slot.holding() };
|
|
226
|
+
return holdings;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Releases every resource the run holds, in reverse order, and answers what that did, keyed by resource name: only the
|
|
230
|
+
* resources whose release reported something. Each release runs even when one before it threw; the first throw is
|
|
231
|
+
* rethrown once all have run.
|
|
232
|
+
*/
|
|
233
|
+
export async function releaseResources(slots, progress) {
|
|
234
|
+
let cleanup = {};
|
|
235
|
+
const thrown = [];
|
|
236
|
+
for (const slot of slots.toReversed()) {
|
|
237
|
+
try {
|
|
238
|
+
cleanup = { ...cleanup, ...(await slot.release(progress)) };
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
thrown.push(error);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (thrown.length > 0)
|
|
245
|
+
throw thrown[0];
|
|
246
|
+
return cleanup;
|
|
247
|
+
}
|
|
248
|
+
/** How many things releasing each resource in `cleanup` couldn't do, in the order the run released them. */
|
|
249
|
+
export function resourceFailures(slots, cleanup) {
|
|
250
|
+
let failures = {};
|
|
251
|
+
for (const slot of slots.toReversed())
|
|
252
|
+
failures = { ...failures, ...slot.failures(cleanup) };
|
|
253
|
+
return failures;
|
|
254
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { RunObserver } from "./events.ts";
|
|
2
|
+
import type { AnyResources } from "./resource.ts";
|
|
3
|
+
import type { RunDirectory, RunDirectoryStep, RunLog } from "./gateways.ts";
|
|
4
|
+
/** The subpath of storm's state directory that holds the run directories. */
|
|
5
|
+
export declare const RUNS_SUBPATH: readonly string[];
|
|
6
|
+
/**
|
|
7
|
+
* How many completed run directories are kept: a run removes all but the newest 1000 completed ones. A run directory
|
|
8
|
+
* still active, its run going on, is never removed and doesn't count.
|
|
9
|
+
*/
|
|
10
|
+
export declare const RUN_DIRECTORIES_KEPT = 1000;
|
|
11
|
+
/**
|
|
12
|
+
* The file that records what a run was, written as its run directory opens and replaced once the run ends: the run's
|
|
13
|
+
* start, working directory, config file, command and kind, and then how it ended. Its contents are the composition
|
|
14
|
+
* layer's; the run directory only stores them.
|
|
15
|
+
*/
|
|
16
|
+
export declare const RUN_FILE = "run.json";
|
|
17
|
+
/**
|
|
18
|
+
* The file that holds a run's test events, redacted: storm streams them to `TESTS_PARTIAL_FILE` as it gets them,
|
|
19
|
+
* from the events it followed in a runner run or the ones a local command staged (`TEST_EVENTS_STAGING_FILE`), then
|
|
20
|
+
* renames that file to this one once the run is over, and never before. Whatever reads it may show it whole.
|
|
21
|
+
*/
|
|
22
|
+
export declare const TESTS_FILE = "tests.jsonl";
|
|
23
|
+
/**
|
|
24
|
+
* The private file storm appends a run's redacted test events to before it publishes them as `TESTS_FILE`. No
|
|
25
|
+
* reader opens it. Closing the run directory removes it when the run didn't publish it, and pruning removes one a run
|
|
26
|
+
* that never closed its run directory left behind.
|
|
27
|
+
*/
|
|
28
|
+
export declare const TESTS_PARTIAL_FILE = ".tests.jsonl.partial";
|
|
29
|
+
/**
|
|
30
|
+
* The private file a local command appends its test events to while it runs, as they come, unredacted. Nothing reads
|
|
31
|
+
* it but the run that staged it. Closing the run directory removes it, whether or not the run wrote `TESTS_FILE`, and
|
|
32
|
+
* pruning removes one a run that never closed its run directory left behind.
|
|
33
|
+
*/
|
|
34
|
+
export declare const TEST_EVENTS_STAGING_FILE = ".test-events.jsonl";
|
|
35
|
+
/** The file that holds a run's timeline, written once the run is over. */
|
|
36
|
+
export declare const TIMELINE_FILE = "timeline.json";
|
|
37
|
+
/** The file that holds a run's events, one JSON object a line. */
|
|
38
|
+
export declare const EVENTS_FILE = "events.jsonl";
|
|
39
|
+
/** The command log: the file that holds the command's output, its stdout and stderr in arrival order. */
|
|
40
|
+
export declare const COMMAND_LOG = "command.log";
|
|
41
|
+
/** Every run log a run directory can hold, in the order the run writes them: each step's, then the command's. */
|
|
42
|
+
export declare const RUN_LOGS: readonly RunLog[];
|
|
43
|
+
/** Run log `log`'s file name: `command.log`, or the step's log, such as `install.log`. */
|
|
44
|
+
export declare function runLogFile(log: RunLog): string;
|
|
45
|
+
/**
|
|
46
|
+
* The file that marks a run directory active while its run goes on: `{ pid, hostname, startedAt }`, the process
|
|
47
|
+
* that holds it, on which host, and when its run started. Closing the run directory removes it.
|
|
48
|
+
*/
|
|
49
|
+
export declare const ACTIVE_MARKER = "active.json";
|
|
50
|
+
/** A run directory's name: its run id, the start in UTC to the second, a dash and a suffix. */
|
|
51
|
+
export declare const RUN_ID_PATTERN: RegExp;
|
|
52
|
+
/** A run id's first part: `startedAt` in UTC as `YYYYMMDDTHHMMSS`. */
|
|
53
|
+
export declare function runIdPrefix(startedAt: Date): string;
|
|
54
|
+
/**
|
|
55
|
+
* The test events file a local command's run payload names in run directory `path`: the staging file
|
|
56
|
+
* (`TEST_EVENTS_STAGING_FILE`), which the command appends to as it goes. Once the run is over, storm writes the
|
|
57
|
+
* run's test events redacted to `TESTS_FILE`, and closing the run directory removes it.
|
|
58
|
+
*/
|
|
59
|
+
export declare function testEventsPath(path: string): string;
|
|
60
|
+
/** Where a step's log is in run directory `path`. */
|
|
61
|
+
export declare function stepLogPath(path: string, step: RunDirectoryStep): string;
|
|
62
|
+
/** Where a lane's step `step`'s log is in run directory `path`; undefined for a step that writes none. */
|
|
63
|
+
export declare function stepLog(path: string, step: string): string | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Writes each event to `directory`: a step's output line to the step's log, prefixed with its time, and every other
|
|
66
|
+
* event to `events.jsonl` as `{"at": <ISO time>, ...event}`. A step's output stays out of `events.jsonl`, since its
|
|
67
|
+
* log holds it.
|
|
68
|
+
*/
|
|
69
|
+
export declare function runDirectoryObserver(directory: RunDirectory): RunObserver<AnyResources>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// What a run writes to its run directory, beside the progress a person reads: every event, timed, in
|
|
2
|
+
// `events.jsonl`, and each step's output in its own log with each line's time.
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
/** The subpath of storm's state directory that holds the run directories. */
|
|
5
|
+
export const RUNS_SUBPATH = ["runs"];
|
|
6
|
+
/**
|
|
7
|
+
* How many completed run directories are kept: a run removes all but the newest 1000 completed ones. A run directory
|
|
8
|
+
* still active, its run going on, is never removed and doesn't count.
|
|
9
|
+
*/
|
|
10
|
+
export const RUN_DIRECTORIES_KEPT = 1000;
|
|
11
|
+
/**
|
|
12
|
+
* The file that records what a run was, written as its run directory opens and replaced once the run ends: the run's
|
|
13
|
+
* start, working directory, config file, command and kind, and then how it ended. Its contents are the composition
|
|
14
|
+
* layer's; the run directory only stores them.
|
|
15
|
+
*/
|
|
16
|
+
export const RUN_FILE = "run.json";
|
|
17
|
+
/**
|
|
18
|
+
* The file that holds a run's test events, redacted: storm streams them to `TESTS_PARTIAL_FILE` as it gets them,
|
|
19
|
+
* from the events it followed in a runner run or the ones a local command staged (`TEST_EVENTS_STAGING_FILE`), then
|
|
20
|
+
* renames that file to this one once the run is over, and never before. Whatever reads it may show it whole.
|
|
21
|
+
*/
|
|
22
|
+
export const TESTS_FILE = "tests.jsonl";
|
|
23
|
+
/**
|
|
24
|
+
* The private file storm appends a run's redacted test events to before it publishes them as `TESTS_FILE`. No
|
|
25
|
+
* reader opens it. Closing the run directory removes it when the run didn't publish it, and pruning removes one a run
|
|
26
|
+
* that never closed its run directory left behind.
|
|
27
|
+
*/
|
|
28
|
+
export const TESTS_PARTIAL_FILE = ".tests.jsonl.partial";
|
|
29
|
+
/**
|
|
30
|
+
* The private file a local command appends its test events to while it runs, as they come, unredacted. Nothing reads
|
|
31
|
+
* it but the run that staged it. Closing the run directory removes it, whether or not the run wrote `TESTS_FILE`, and
|
|
32
|
+
* pruning removes one a run that never closed its run directory left behind.
|
|
33
|
+
*/
|
|
34
|
+
export const TEST_EVENTS_STAGING_FILE = ".test-events.jsonl";
|
|
35
|
+
/** The file that holds a run's timeline, written once the run is over. */
|
|
36
|
+
export const TIMELINE_FILE = "timeline.json";
|
|
37
|
+
/** The file that holds a run's events, one JSON object a line. */
|
|
38
|
+
export const EVENTS_FILE = "events.jsonl";
|
|
39
|
+
/** The command log: the file that holds the command's output, its stdout and stderr in arrival order. */
|
|
40
|
+
export const COMMAND_LOG = "command.log";
|
|
41
|
+
/** Every run log a run directory can hold, in the order the run writes them: each step's, then the command's. */
|
|
42
|
+
export const RUN_LOGS = ["snapshot", "apply", "install", "build", "command"];
|
|
43
|
+
/** Run log `log`'s file name: `command.log`, or the step's log, such as `install.log`. */
|
|
44
|
+
export function runLogFile(log) {
|
|
45
|
+
return log === "command" ? COMMAND_LOG : `${log}.log`;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The file that marks a run directory active while its run goes on: `{ pid, hostname, startedAt }`, the process
|
|
49
|
+
* that holds it, on which host, and when its run started. Closing the run directory removes it.
|
|
50
|
+
*/
|
|
51
|
+
export const ACTIVE_MARKER = "active.json";
|
|
52
|
+
/** A run directory's name: its run id, the start in UTC to the second, a dash and a suffix. */
|
|
53
|
+
export const RUN_ID_PATTERN = /^\d{8}T\d{6}-[0-9a-z]+$/;
|
|
54
|
+
/** A run id's first part: `startedAt` in UTC as `YYYYMMDDTHHMMSS`. */
|
|
55
|
+
export function runIdPrefix(startedAt) {
|
|
56
|
+
return startedAt
|
|
57
|
+
.toISOString()
|
|
58
|
+
.replace(/[-:]/g, "")
|
|
59
|
+
.replace(/\.\d+Z$/, "");
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The test events file a local command's run payload names in run directory `path`: the staging file
|
|
63
|
+
* (`TEST_EVENTS_STAGING_FILE`), which the command appends to as it goes. Once the run is over, storm writes the
|
|
64
|
+
* run's test events redacted to `TESTS_FILE`, and closing the run directory removes it.
|
|
65
|
+
*/
|
|
66
|
+
export function testEventsPath(path) {
|
|
67
|
+
return join(path, TEST_EVENTS_STAGING_FILE);
|
|
68
|
+
}
|
|
69
|
+
/** Where a step's log is in run directory `path`. */
|
|
70
|
+
export function stepLogPath(path, step) {
|
|
71
|
+
return join(path, runLogFile(step));
|
|
72
|
+
}
|
|
73
|
+
/** Where a lane's step `step`'s log is in run directory `path`; undefined for a step that writes none. */
|
|
74
|
+
export function stepLog(path, step) {
|
|
75
|
+
return step === "snapshot" || step === "apply" || step === "install" || step === "build"
|
|
76
|
+
? stepLogPath(path, step)
|
|
77
|
+
: undefined;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Writes each event to `directory`: a step's output line to the step's log, prefixed with its time, and every other
|
|
81
|
+
* event to `events.jsonl` as `{"at": <ISO time>, ...event}`. A step's output stays out of `events.jsonl`, since its
|
|
82
|
+
* log holds it.
|
|
83
|
+
*/
|
|
84
|
+
export function runDirectoryObserver(directory) {
|
|
85
|
+
return {
|
|
86
|
+
observe: async ({ event, at }) => {
|
|
87
|
+
if (event.kind === "runner" && event.event.kind === "step-output") {
|
|
88
|
+
directory.appendStepOutput(event.event.phase, `${at.toISOString()} ${event.event.line}`);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
directory.appendEvent(JSON.stringify({ at: at.toISOString(), ...event }));
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|