@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,33 @@
|
|
|
1
|
+
import { RUN_PAYLOAD_VARIABLE } from "../sdk/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* The run payload for a run holding `resources`, each resource's entry under its name (the resource providers'
|
|
4
|
+
* `payload`); `{}` for a run that holds none. It names `testEvents` as the file the command appends test events to,
|
|
5
|
+
* when the run follows them, and says whether the run is `verbose`. The registry's test (`registry-types.test.ts`)
|
|
6
|
+
* checks that its resources' entries are the SDK's `RunPayloadResources`.
|
|
7
|
+
*/
|
|
8
|
+
export function runPayload(resources, options = {}) {
|
|
9
|
+
return {
|
|
10
|
+
version: 2,
|
|
11
|
+
resources,
|
|
12
|
+
...(options.testEvents === undefined ? {} : { testEvents: options.testEvents }),
|
|
13
|
+
...(options.verbose === true ? { verbose: true } : {}),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The command's environment: `env` whole, less unset variables, with `STORM_RUN` set to the run payload's JSON. A
|
|
18
|
+
* variable the command must not see is the caller's to leave out of `env`.
|
|
19
|
+
*/
|
|
20
|
+
export function commandEnvironment(env, payload) {
|
|
21
|
+
const kept = Object.entries(env).filter((pair) => pair[1] !== undefined);
|
|
22
|
+
return { ...Object.fromEntries(kept), [RUN_PAYLOAD_VARIABLE]: JSON.stringify(payload) };
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* `env` with color set for a local command whose stdout and stderr are pipes, so it can't tell whether a terminal
|
|
26
|
+
* shows color: `FORCE_COLOR=1` when the terminal storm writes its output to shows color, else `NO_COLOR=1`. An
|
|
27
|
+
* `env` that sets either already is left as it is.
|
|
28
|
+
*/
|
|
29
|
+
export function colorEnvironment(env, color) {
|
|
30
|
+
if (env["FORCE_COLOR"] !== undefined || env["NO_COLOR"] !== undefined)
|
|
31
|
+
return env;
|
|
32
|
+
return { ...env, ...(color ? { FORCE_COLOR: "1" } : { NO_COLOR: "1" }) };
|
|
33
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { ResourceKind } from "./resource.ts";
|
|
2
|
+
import type { SpanStatus } from "./run-state.ts";
|
|
3
|
+
/** How a frame's parts are painted: color codes on a terminal that shows color, the text alone otherwise. */
|
|
4
|
+
export interface Paint {
|
|
5
|
+
readonly done: (text: string) => string;
|
|
6
|
+
readonly failed: (text: string) => string;
|
|
7
|
+
readonly stopped: (text: string) => string;
|
|
8
|
+
readonly active: (text: string) => string;
|
|
9
|
+
readonly faint: (text: string) => string;
|
|
10
|
+
readonly strong: (text: string) => string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A line a resource's own event adds to the run's progress, and the lane the line names: the run's, the cleanup's, or
|
|
14
|
+
* the resource's own lane, `Lane`.
|
|
15
|
+
*/
|
|
16
|
+
export interface ResourceNotice<Lane extends string = never> {
|
|
17
|
+
readonly lane: "run" | "cleanup" | Lane;
|
|
18
|
+
readonly text: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* How a lane's parts are drawn, live at `now`, or in a final form, with `now` undefined, where a span still running
|
|
22
|
+
* shows no time. `line` lays out one text under the lane's row, cut to the width when live; `elapsed` is a span's
|
|
23
|
+
* time, such as `4.2s`, or nothing when it has no end and no `now`; `seconds` is a duration as progress shows it.
|
|
24
|
+
*/
|
|
25
|
+
export interface LaneDraw {
|
|
26
|
+
readonly now: number | undefined;
|
|
27
|
+
readonly paint: Paint;
|
|
28
|
+
readonly glyph: (status: SpanStatus) => string;
|
|
29
|
+
readonly line: (text: string) => string;
|
|
30
|
+
readonly elapsed: (from: number | undefined, to: number | undefined) => string;
|
|
31
|
+
readonly seconds: (ms: number) => string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* What the views draw of one lane of kind `Kind`. The views lay out each row: its glyph, the lane's name and the
|
|
35
|
+
* text, with what goes flush right; a lane gives the text.
|
|
36
|
+
*
|
|
37
|
+
* - `label`: its row's name on the waterfall and in the job summary, such as `<lane>-setup`.
|
|
38
|
+
* - `steps`: its steps' names, in the waterfall's order, which a ran outcome's timeline names.
|
|
39
|
+
* - `lanesRow`: its row beside the runner's in a runner run, from its state, undefined until its lane starts; `run`
|
|
40
|
+
* says whether the run is stopping and whether the runner still runs. `right` is all the row has flush right, its
|
|
41
|
+
* time included.
|
|
42
|
+
* - `localRow`: its row in a local run, alone, and what the row under it says, if anything.
|
|
43
|
+
* - `record`: its final form: its row's text and the lines under it.
|
|
44
|
+
*/
|
|
45
|
+
export interface LanePresentation<Kind extends ResourceKind> {
|
|
46
|
+
readonly label: string;
|
|
47
|
+
readonly steps: readonly Kind["laneStep"][];
|
|
48
|
+
readonly lanesRow: (state: Kind["laneState"] | undefined, draw: LaneDraw, run: {
|
|
49
|
+
readonly stopping: boolean;
|
|
50
|
+
readonly runnerRunning: boolean;
|
|
51
|
+
}) => {
|
|
52
|
+
readonly text: string;
|
|
53
|
+
readonly right: string;
|
|
54
|
+
};
|
|
55
|
+
readonly localRow: (state: Kind["laneState"], draw: LaneDraw) => {
|
|
56
|
+
readonly text: string;
|
|
57
|
+
readonly below?: string;
|
|
58
|
+
};
|
|
59
|
+
readonly record: (state: Kind["laneState"], draw: LaneDraw) => {
|
|
60
|
+
readonly text: string;
|
|
61
|
+
readonly lines: readonly string[];
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** Whether a resource's release is under way (`doing`) or over (`done`), as a line about it says it. */
|
|
65
|
+
export type ReleaseTense = "doing" | "done";
|
|
66
|
+
/**
|
|
67
|
+
* How resource `Kind` shows in a run's progress.
|
|
68
|
+
*
|
|
69
|
+
* - `plain`: plain progress for one run: each of its own events' lines, given when it happened; a resource may
|
|
70
|
+
* remember earlier events, such as when a step started.
|
|
71
|
+
* - `notices`: the live view's notices for one of its own events: what its lane's rows can't hold, printed above.
|
|
72
|
+
* - `release`: what releasing it does, as the cleanup line and the stopping line say it: from what the run held of it
|
|
73
|
+
* as cleanup started (`holding`), such as `releasing 2 leases`, or, on the stopping line, before the run knows that,
|
|
74
|
+
* with `holding` undefined, such as `releasing the leases`. `tense` is `doing` while the cleanup runs and `done` once
|
|
75
|
+
* it ended. Undefined says nothing.
|
|
76
|
+
* - `lane`: what the views draw of its lane; none for a kind without one.
|
|
77
|
+
*/
|
|
78
|
+
export interface ResourcePresentation<Kind extends ResourceKind> {
|
|
79
|
+
readonly plain: (options: {
|
|
80
|
+
readonly verbose: boolean;
|
|
81
|
+
}) => (event: Kind["event"], now: number) => readonly ResourceNotice<Kind["lane"]>[];
|
|
82
|
+
readonly notices: (event: Kind["event"], options: {
|
|
83
|
+
readonly verbose: boolean;
|
|
84
|
+
}) => readonly ResourceNotice<Kind["lane"]>[];
|
|
85
|
+
readonly release: (holding: Kind["holding"] | undefined, tense: ReleaseTense) => string | undefined;
|
|
86
|
+
readonly lane: [Kind["lane"]] extends [never] ? undefined : LanePresentation<Kind>;
|
|
87
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// The presentation contract: how a resource shows in a run's progress. A resource renders its own events as plain
|
|
2
|
+
// lines and as the live view's notices, and, with a lane, its lane's rows in the live view's blocks and its row's label
|
|
3
|
+
// on the waterfall. The `run` command's views own the layout around them: the time and lane prefix of a plain line,
|
|
4
|
+
// each block's rows and their order, the glyphs and the widths. It names no resource.
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { LaneStates } from "./lane.ts";
|
|
2
|
+
import type { LaneDraw, ReleaseTense, ResourceNotice } from "./presentation.ts";
|
|
3
|
+
import type { ProviderList } from "./provider.ts";
|
|
4
|
+
import type { ResourceEvent, ResourceHoldings, RunLane } from "./resource.ts";
|
|
5
|
+
import type { Span, SpanStatus } from "./run-state.ts";
|
|
6
|
+
/**
|
|
7
|
+
* One resource lane as the views draw it, bound to its resource's name: each operation reads the lane's state from
|
|
8
|
+
* the run's (`LaneStates`), and answers nothing when its lane hasn't started. Each row comes with the lane's span or
|
|
9
|
+
* status, which the views draw its glyph and time by.
|
|
10
|
+
*/
|
|
11
|
+
export interface PresentedLane<K> {
|
|
12
|
+
readonly lane: RunLane<K>;
|
|
13
|
+
readonly label: string;
|
|
14
|
+
readonly steps: readonly string[];
|
|
15
|
+
lanesRow(states: LaneStates<K>, draw: LaneDraw, run: {
|
|
16
|
+
readonly stopping: boolean;
|
|
17
|
+
readonly runnerRunning: boolean;
|
|
18
|
+
}): {
|
|
19
|
+
readonly status: SpanStatus | undefined;
|
|
20
|
+
readonly text: string;
|
|
21
|
+
readonly right: string;
|
|
22
|
+
};
|
|
23
|
+
localRow(states: LaneStates<K>, draw: LaneDraw): {
|
|
24
|
+
readonly span: Span;
|
|
25
|
+
readonly text: string;
|
|
26
|
+
readonly below: string | undefined;
|
|
27
|
+
} | undefined;
|
|
28
|
+
record(states: LaneStates<K>, draw: LaneDraw): {
|
|
29
|
+
readonly span: Span;
|
|
30
|
+
readonly text: string;
|
|
31
|
+
readonly lines: readonly string[];
|
|
32
|
+
} | undefined;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Every resource's presentation, in provider order, over kinds map `K`.
|
|
36
|
+
*
|
|
37
|
+
* - `plain`: plain progress for one run: the lines of a resource's own event, given when it happened.
|
|
38
|
+
* - `notices`: the live view's notices for a resource's own event.
|
|
39
|
+
* - `releaseTexts`: what releasing each resource in `holdings` does, in provider order, for the cleanup line.
|
|
40
|
+
* - `stoppingTexts`: what releasing each of the `held` resources does, in provider order, for the stopping line, before
|
|
41
|
+
* the run knows what it holds of each.
|
|
42
|
+
* - `lanes`: each resource lane as the views draw it, in provider order.
|
|
43
|
+
*/
|
|
44
|
+
export interface ResourcePresentations<K> {
|
|
45
|
+
plain(options: {
|
|
46
|
+
readonly verbose: boolean;
|
|
47
|
+
}): (event: ResourceEvent<K>, now: number) => readonly ResourceNotice<RunLane<K>>[];
|
|
48
|
+
notices(event: ResourceEvent<K>, options: {
|
|
49
|
+
readonly verbose: boolean;
|
|
50
|
+
}): readonly ResourceNotice<RunLane<K>>[];
|
|
51
|
+
releaseTexts(holdings: ResourceHoldings<K>, tense: ReleaseTense): readonly string[];
|
|
52
|
+
stoppingTexts(held: readonly (keyof K & string)[]): readonly string[];
|
|
53
|
+
readonly lanes: readonly PresentedLane<K>[];
|
|
54
|
+
}
|
|
55
|
+
/** Every one of `providers`' presentations, bound to their names, in order. */
|
|
56
|
+
export declare function resourcePresentations<K>(providers: ProviderList<K>): ResourcePresentations<K>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// How the `run` command's views ask every resource how it shows, through each provider's presentation, in provider
|
|
2
|
+
// order: the presentation counterpart of `command-slots.ts`. `presentationSlotOf` binds one provider's presentation
|
|
3
|
+
// to its name, so each function below indexes the run's maps by that name and never relates a name to the kinds map.
|
|
4
|
+
/** `provider`'s presentation, bound to its name. */
|
|
5
|
+
function presentationSlotOf(provider) {
|
|
6
|
+
const { name, presentation } = provider;
|
|
7
|
+
const lane = presentation.lane;
|
|
8
|
+
const laneName = provider.run.lane;
|
|
9
|
+
return {
|
|
10
|
+
plain: (options) => {
|
|
11
|
+
const own = presentation.plain(options);
|
|
12
|
+
// Each union is distributed over every name, so its member whose `resource` is `name` carries this resource's
|
|
13
|
+
// event.
|
|
14
|
+
return (nested, now) => (nested.resource === name ? own(nested.event, now) : undefined);
|
|
15
|
+
},
|
|
16
|
+
notices: (nested, options) => (nested.resource === name ? presentation.notices(nested.event, options) : undefined),
|
|
17
|
+
releaseText: (holdings, tense) => Object.hasOwn(holdings, name) ? presentation.release(holdings[name], tense) : undefined,
|
|
18
|
+
stoppingText: (held) => (held.includes(name) ? presentation.release(undefined, "doing") : undefined),
|
|
19
|
+
lane: lane === undefined || laneName === undefined
|
|
20
|
+
? undefined
|
|
21
|
+
: {
|
|
22
|
+
lane: laneName,
|
|
23
|
+
label: lane.label,
|
|
24
|
+
steps: lane.steps,
|
|
25
|
+
lanesRow: (states, draw, run) => {
|
|
26
|
+
const state = states[name];
|
|
27
|
+
return { status: state?.status, ...lane.lanesRow(state, draw, run) };
|
|
28
|
+
},
|
|
29
|
+
localRow: (states, draw) => {
|
|
30
|
+
const state = states[name];
|
|
31
|
+
if (state === undefined)
|
|
32
|
+
return undefined;
|
|
33
|
+
const { text, below } = lane.localRow(state, draw);
|
|
34
|
+
return { span: state, text, below };
|
|
35
|
+
},
|
|
36
|
+
record: (states, draw) => {
|
|
37
|
+
const state = states[name];
|
|
38
|
+
return state === undefined ? undefined : { span: state, ...lane.record(state, draw) };
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/** Every one of `providers`' presentations, bound to their names, in order. */
|
|
44
|
+
export function resourcePresentations(providers) {
|
|
45
|
+
const slots = providers.map((provider) => presentationSlotOf(provider));
|
|
46
|
+
const first = (answers, what) => {
|
|
47
|
+
const found = answers.find((answer) => answer !== undefined);
|
|
48
|
+
if (found === undefined)
|
|
49
|
+
throw new Error(`No resource answered ${what}`);
|
|
50
|
+
return found;
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
plain: (options) => {
|
|
54
|
+
const renderers = slots.map((slot) => slot.plain(options));
|
|
55
|
+
return (event, now) => first(renderers.map((render) => render(event, now)), `${event.resource}'s event`);
|
|
56
|
+
},
|
|
57
|
+
notices: (event, options) => first(slots.map((slot) => slot.notices(event, options)), `${event.resource}'s event`),
|
|
58
|
+
releaseTexts: (holdings, tense) => present(slots.map((slot) => slot.releaseText(holdings, tense))),
|
|
59
|
+
stoppingTexts: (held) => present(slots.map((slot) => slot.stoppingText(held))),
|
|
60
|
+
lanes: slots.flatMap(({ lane }) => (lane === undefined ? [] : [lane])),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** The texts there are, in order. */
|
|
64
|
+
function present(texts) {
|
|
65
|
+
return texts.filter((text) => text !== undefined);
|
|
66
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { CommandMount } from "@vercel/clinkr";
|
|
2
|
+
import type { AnyResourceConfig, OptionsResolution } from "../config/index.ts";
|
|
3
|
+
import type { RunnerResources } from "../runner/index.ts";
|
|
4
|
+
import type { CommandProvider, ResourceCleanupReport, ResourceRanReport } from "./command-provider.ts";
|
|
5
|
+
import type { ResourceLane } from "./lane.ts";
|
|
6
|
+
import type { ResourcePresentation } from "./presentation.ts";
|
|
7
|
+
import type { KindAt, ResourceKind, RunProvider } from "./resource.ts";
|
|
8
|
+
/** What the host hands a resource to build its live gateways: the host's environment. */
|
|
9
|
+
export interface ResourceHost {
|
|
10
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
11
|
+
}
|
|
12
|
+
/** A resource config that fits resource `Name` of kind `Kind`: its name, and it resolves to the kind's options. */
|
|
13
|
+
export type FittingConfig<Name extends string, Kind extends ResourceKind> = AnyResourceConfig & {
|
|
14
|
+
readonly name: Name;
|
|
15
|
+
resolve(settings: never): OptionsResolution<Kind["options"], string>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A command tree a resource adds to the host's CLI, whose commands take app `App` (`CommandBuilder<App>`): Clinkr
|
|
19
|
+
* mounts the tree's directory at `mount.path` and hands each command the host's app. A tree that takes `App` is a tree
|
|
20
|
+
* of every app that is one, so the registry checks the host's app by typing the trees with it.
|
|
21
|
+
*/
|
|
22
|
+
export interface ResourceCommandTree<App> {
|
|
23
|
+
readonly mount: CommandMount;
|
|
24
|
+
/** For its type only: what the tree's commands take, as a parameter, so the tree is a tree of any app that is one. */
|
|
25
|
+
readonly takes?: (app: App) => void;
|
|
26
|
+
}
|
|
27
|
+
/** A resource's lane: none for a kind without one. */
|
|
28
|
+
type LaneOf<Name extends string, Kind extends ResourceKind> = [Kind["lane"]] extends [never] ? undefined : ResourceLane<Name, Kind>;
|
|
29
|
+
/** A resource's ran report: none for a kind that reports nothing in a `ran` outcome. */
|
|
30
|
+
type RanReportOf<Kind extends ResourceKind> = [Kind["ranFacts"]] extends [never] ? undefined : ResourceRanReport<Kind>;
|
|
31
|
+
/**
|
|
32
|
+
* The provider of resource `Name`, of kind `Kind`, whose command half is `Command`, with its own errors, and whose
|
|
33
|
+
* resource config is `Config`.
|
|
34
|
+
*
|
|
35
|
+
* - `run`: the run half.
|
|
36
|
+
* - `command`: the command half.
|
|
37
|
+
* - `config`: its section under `resources` in the config file.
|
|
38
|
+
* - `cleanup`: what outcomes report of its cleanup.
|
|
39
|
+
* - `ran`: what a `ran` outcome reports of it, under `resources.<name>`; none when its kind reports nothing.
|
|
40
|
+
* - `lane`: its lane; none when its kind has none.
|
|
41
|
+
* - `presentation`: how it shows in a run's progress.
|
|
42
|
+
* - `liveGateways`: its gateways, built live from the host.
|
|
43
|
+
* - `hostVariablesToDrop`: the host's variables the run's command must not see, such as stale ones that could point it
|
|
44
|
+
* at something else than the run payload names.
|
|
45
|
+
* - `runnerResources`: what a runner recipe's `vcpus` function sees of it, from its resolved options.
|
|
46
|
+
* - `commands`: the command tree it adds to the host's CLI, whose commands take app `App`; none for a resource that
|
|
47
|
+
* adds none.
|
|
48
|
+
*/
|
|
49
|
+
export interface Provider<Name extends string, Kind extends ResourceKind, Command extends CommandProvider<Kind>, Config extends FittingConfig<Name, Kind>, App = unknown> {
|
|
50
|
+
readonly name: Name;
|
|
51
|
+
readonly run: RunProvider<Name, Kind>;
|
|
52
|
+
readonly command: Command;
|
|
53
|
+
readonly config: Config;
|
|
54
|
+
readonly cleanup: ResourceCleanupReport<Kind["cleanup"], Kind["cleanupFacts"]>;
|
|
55
|
+
readonly ran: RanReportOf<Kind>;
|
|
56
|
+
readonly lane: LaneOf<Name, Kind>;
|
|
57
|
+
readonly presentation: ResourcePresentation<Kind>;
|
|
58
|
+
readonly liveGateways: (host: ResourceHost) => Kind["gateways"];
|
|
59
|
+
readonly hostVariablesToDrop?: readonly string[];
|
|
60
|
+
readonly runnerResources?: (options: Kind["options"]) => RunnerResources;
|
|
61
|
+
readonly commands?: ResourceCommandTree<App>;
|
|
62
|
+
}
|
|
63
|
+
/** Every provider of a registry, in order: one union member per resource, as `RunProviders` has. */
|
|
64
|
+
export type ProviderList<K> = readonly {
|
|
65
|
+
readonly [N in keyof K & string]: ProviderAt<K, N>;
|
|
66
|
+
}[keyof K & string][];
|
|
67
|
+
/** A provider of kinds map `K`, under name `N`, as the core's bindings take it. */
|
|
68
|
+
export type ProviderAt<K, N extends keyof K & string> = Provider<N, KindAt<K, N>, CommandProvider<KindAt<K, N>>, FittingConfig<N, KindAt<K, N>>, never>;
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// A resource's provider as one value: everything its folder hands the host. The folder exports one `Provider`, and
|
|
2
|
+
// only the registry (`src/resources.ts`) takes it; the host reaches the resource through nothing else. It holds the run
|
|
3
|
+
// half (`RunProvider`), the command half (`CommandProvider`), the resource config, the cleanup and ran reports, the
|
|
4
|
+
// lane, the presentation, the live gateways, and what the host does for it around a run. It names no resource.
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import type { CredentialSource, MintFailure, MintTarget } from "../credential/index.ts";
|
|
2
|
+
import type { Clock } from "../time/index.ts";
|
|
3
|
+
import type { Span } from "./run-state.ts";
|
|
4
|
+
/** What one resource's provider works with. A resource folder declares one of these. */
|
|
5
|
+
export interface ResourceKind {
|
|
6
|
+
/**
|
|
7
|
+
* Its resolved options: what its resource config (`config/`) resolves a held resource's section of
|
|
8
|
+
* `storm.config.ts` and its `--set` values to, which its command half settles into its request.
|
|
9
|
+
*/
|
|
10
|
+
readonly options: unknown;
|
|
11
|
+
/**
|
|
12
|
+
* The resource's part of the run request, under `request.resources.<name>`: the same in a local run and a runner run,
|
|
13
|
+
* since the run, not the resource, holds the credential choice (`LocalRunRequest.credential`).
|
|
14
|
+
*/
|
|
15
|
+
readonly request: unknown;
|
|
16
|
+
/** What acquiring it works from: its part of the run request when the run holds it (`RunProvider.requested`). */
|
|
17
|
+
readonly acquireRequest: unknown;
|
|
18
|
+
/**
|
|
19
|
+
* The gateways and seams it needs beyond the core's (`CoreContext`). The app's flat context must hold them; the
|
|
20
|
+
* registry checks it.
|
|
21
|
+
*/
|
|
22
|
+
readonly gateways: object;
|
|
23
|
+
/** What acquiring it hands the command, through the run payload. */
|
|
24
|
+
readonly connection: unknown;
|
|
25
|
+
/** One thing acquiring it holds, which the run releases however it ends. */
|
|
26
|
+
readonly owned: unknown;
|
|
27
|
+
/**
|
|
28
|
+
* What the run holds of it when cleanup starts (`RunProvider.holding`), from which its presentation names what
|
|
29
|
+
* releasing it does, such as how many leases. Plain JSON: it goes into the `cleanup-started` event, which the run
|
|
30
|
+
* directory keeps.
|
|
31
|
+
*/
|
|
32
|
+
readonly holding: unknown;
|
|
33
|
+
/** What acquiring it tells a `ran` outcome, under `resources.<name>`. */
|
|
34
|
+
readonly facts: unknown;
|
|
35
|
+
/** What a `canceled` outcome says of it, under `resources.<name>`, from how far acquiring it got. */
|
|
36
|
+
readonly canceledFacts: unknown;
|
|
37
|
+
/** Its refusals before the run holds anything: the run ends `resource-unprepared` with one; `never` for none. */
|
|
38
|
+
readonly prepareRefusal: unknown;
|
|
39
|
+
/** Its refusals while the run acquires: the run ends `resource-refused` with one. */
|
|
40
|
+
readonly refusal: unknown;
|
|
41
|
+
/** What releasing it did. */
|
|
42
|
+
readonly cleanup: unknown;
|
|
43
|
+
/** What outcomes report of its cleanup, under `cleanup.resources.<name>`: its cleanup report's facts. */
|
|
44
|
+
readonly cleanupFacts: unknown;
|
|
45
|
+
/**
|
|
46
|
+
* What a `ran` outcome reports of it, under `resources.<name>`: its ran report's facts, from its facts and its
|
|
47
|
+
* request; `never` for a resource that reports nothing there.
|
|
48
|
+
*/
|
|
49
|
+
readonly ranFacts: unknown;
|
|
50
|
+
/** The reasons of the errors its command half ends a run with: its settle's, its prepare's and its acquire's. */
|
|
51
|
+
readonly reason: string;
|
|
52
|
+
/** Its own run events, nested as `{ kind: "resource", resource: <name>, event }`; `never` for none. */
|
|
53
|
+
readonly event: unknown;
|
|
54
|
+
/**
|
|
55
|
+
* Its lane's name, which starts with a `lane-started` event and ends with a `lane-ended` event; `never` for a
|
|
56
|
+
* resource without a lane.
|
|
57
|
+
*/
|
|
58
|
+
readonly lane: string;
|
|
59
|
+
/** Its lane's state, which its lane (`ResourceLane`) applies its events to: a span; `never` without a lane. */
|
|
60
|
+
readonly laneState: Span;
|
|
61
|
+
/** The names of its lane's steps on the waterfall; `never` without a lane, or for a lane without steps. */
|
|
62
|
+
readonly laneStep: string;
|
|
63
|
+
/** Its entry under `resources.<name>` in the run payload. */
|
|
64
|
+
readonly payload: unknown;
|
|
65
|
+
}
|
|
66
|
+
/** The core's own seams, which every provider may use. */
|
|
67
|
+
export interface CoreContext {
|
|
68
|
+
readonly clock: Clock;
|
|
69
|
+
}
|
|
70
|
+
/** A provider's own progress: it emits only its own events, and the core nests them under its name. */
|
|
71
|
+
export interface ResourceProgress<Kind extends ResourceKind> {
|
|
72
|
+
emit(event: Kind["event"]): Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
/** What a provider's acquire gets from the run. */
|
|
75
|
+
export interface ResourceAcquireInput<Kind extends ResourceKind, Ctx> {
|
|
76
|
+
readonly context: Ctx;
|
|
77
|
+
readonly request: Kind["acquireRequest"];
|
|
78
|
+
/**
|
|
79
|
+
* The user's signal combined with the run's internal abort, which another resource's refusal or, in a runner run, the
|
|
80
|
+
* runner lane's failure aborts. An acquire that sees it aborted stops as soon as it safely can.
|
|
81
|
+
*/
|
|
82
|
+
readonly signal: AbortSignal;
|
|
83
|
+
readonly progress: ResourceProgress<Kind>;
|
|
84
|
+
/**
|
|
85
|
+
* The ownership sink. The acquire pushes each thing it holds here before it awaits anything else, so the run releases
|
|
86
|
+
* it however the run ends, a throw included.
|
|
87
|
+
*/
|
|
88
|
+
readonly owned: Kind["owned"][];
|
|
89
|
+
/**
|
|
90
|
+
* The run's credential source, when it has one: in a runner run, the one mint it shares with the runner sandbox; in a
|
|
91
|
+
* local run, the source the run's credential choice names, which the core builds once and reports (`minting`,
|
|
92
|
+
* `minted`, `requesting-token`). Undefined in a local run that settled no choice, which it does only when no held
|
|
93
|
+
* resource takes the credential (`CommandProvider.takesCredential`).
|
|
94
|
+
*/
|
|
95
|
+
readonly credential: CredentialSource | undefined;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* How acquiring a resource ended: `acquired`, with what it hands the command and tells the outcome; `refused` with one
|
|
99
|
+
* of its refusals; `mint-failed`, when the run's mint for `target` failed and the resource had nothing to go on
|
|
100
|
+
* without it, which ends the run as the run's own `mint-failed`; or `canceled`, stopped by the signal, with what a
|
|
101
|
+
* canceled outcome says of it.
|
|
102
|
+
*/
|
|
103
|
+
export type ResourceAcquireOutcome<Kind extends ResourceKind> = {
|
|
104
|
+
readonly kind: "acquired";
|
|
105
|
+
readonly connection: Kind["connection"];
|
|
106
|
+
readonly facts: Kind["facts"];
|
|
107
|
+
} | {
|
|
108
|
+
readonly kind: "refused";
|
|
109
|
+
readonly refusal: Kind["refusal"];
|
|
110
|
+
} | {
|
|
111
|
+
readonly kind: "mint-failed";
|
|
112
|
+
readonly failure: MintFailure;
|
|
113
|
+
readonly target: MintTarget;
|
|
114
|
+
} | {
|
|
115
|
+
readonly kind: "canceled";
|
|
116
|
+
readonly facts: Kind["canceledFacts"];
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* The run half of one provider. It depends on its own name and kind only, never on the registry, so it can't see or
|
|
120
|
+
* emit another resource's events or read another resource's gateways. `Ctx` is the context it needs: the core's seams
|
|
121
|
+
* and its own gateways. The registry instantiates `Ctx` with the app's flat context, which checks that the context holds
|
|
122
|
+
* what the provider needs. Each operation is a function property, not a method, so its parameters are checked
|
|
123
|
+
* contravariantly: a method's would be checked both ways, and a context lacking the provider's gateways would pass.
|
|
124
|
+
*
|
|
125
|
+
* - `lane`: the run lane acquiring it reports, which starts with a `lane-started` event and ends with a `lane-ended`
|
|
126
|
+
* event; undefined for a kind without one, and required for every other (`LaneNameOf`).
|
|
127
|
+
* - `requested`: what acquiring it works from, given its part of the run request; undefined when the run doesn't hold
|
|
128
|
+
* it, though its request may still have `prepare` say something.
|
|
129
|
+
* - `prepare`: before the run acquires anything, given its part of the run request: what acquiring it needs, such as
|
|
130
|
+
* files it keeps, or a notice that the run goes without it. A refusal ends the run holding nothing.
|
|
131
|
+
* - `acquire`: acquires it, pushing what it holds onto `owned` as it goes, or refuses the run: with one of its own
|
|
132
|
+
* refusals, or `mint-failed` when the run's mint failed and it can't go on without it.
|
|
133
|
+
* - `ready`: once every resource is acquired and the runner, if any, is ready, just before the command starts: reports
|
|
134
|
+
* it ready, such as listing what it holds.
|
|
135
|
+
* - `holding`: what the run holds of it, from `owned`, as cleanup starts, which its presentation names what releasing it
|
|
136
|
+
* does from; undefined, or none, when there is nothing to name.
|
|
137
|
+
* - `release`: releases everything in `owned`, after the command has stopped and the runner's sandboxes are closed,
|
|
138
|
+
* and answers what that did; undefined when the run held nothing it reports.
|
|
139
|
+
* - `failures`: how many things `release` couldn't do, which the cleanup lane counts.
|
|
140
|
+
* - `payload`: its entry under `resources.<name>` in the run payload.
|
|
141
|
+
* - `canceledFacts`: what a canceled run says of it, when acquiring it didn't end `canceled` itself: from its facts
|
|
142
|
+
* once acquired, else from its request alone. None says nothing.
|
|
143
|
+
*/
|
|
144
|
+
export interface RunProvider<Name extends string, Kind extends ResourceKind, Ctx = CoreContext & Kind["gateways"]> {
|
|
145
|
+
readonly name: Name;
|
|
146
|
+
readonly lane: LaneNameOf<Kind>;
|
|
147
|
+
readonly requested: (request: Kind["request"]) => Kind["acquireRequest"] | undefined;
|
|
148
|
+
readonly prepare?: (context: Ctx, request: Kind["request"], progress: ResourceProgress<Kind>) => Promise<Kind["prepareRefusal"] | undefined>;
|
|
149
|
+
readonly acquire: (input: ResourceAcquireInput<Kind, Ctx>) => Promise<ResourceAcquireOutcome<Kind>>;
|
|
150
|
+
readonly ready?: (input: {
|
|
151
|
+
readonly connection: Kind["connection"];
|
|
152
|
+
readonly progress: ResourceProgress<Kind>;
|
|
153
|
+
}) => Promise<void>;
|
|
154
|
+
readonly holding?: (owned: readonly Kind["owned"][]) => Kind["holding"] | undefined;
|
|
155
|
+
readonly release: (context: Ctx, owned: readonly Kind["owned"][], progress: ResourceProgress<Kind>) => Promise<Kind["cleanup"] | undefined>;
|
|
156
|
+
readonly failures: (cleanup: Kind["cleanup"]) => number;
|
|
157
|
+
readonly payload: (connection: Kind["connection"]) => Kind["payload"];
|
|
158
|
+
readonly canceledFacts?: (request: Kind["acquireRequest"], facts: Kind["facts"] | undefined) => Kind["canceledFacts"];
|
|
159
|
+
}
|
|
160
|
+
/** The lane a run half of kind `Kind` names: undefined for a kind without one (`lane` is `never`). */
|
|
161
|
+
export type LaneNameOf<Kind extends ResourceKind> = [Kind["lane"]] extends [never] ? undefined : Kind["lane"];
|
|
162
|
+
/** The kind of resource `N` in kinds map `K`. */
|
|
163
|
+
export type KindAt<K, N extends keyof K> = Extract<K[N], ResourceKind>;
|
|
164
|
+
/** A kinds map with any resources: what code that needs no resource's own types takes, such as the run's state. */
|
|
165
|
+
export type AnyResources = {
|
|
166
|
+
readonly [name: string]: ResourceKind;
|
|
167
|
+
};
|
|
168
|
+
/** Every run half of a registry, in order, each taking the app's context `C`: one union member per resource. */
|
|
169
|
+
export type RunProviders<K, C> = readonly {
|
|
170
|
+
readonly [N in keyof K & string]: RunProvider<N, KindAt<K, N>, C>;
|
|
171
|
+
}[keyof K & string][];
|
|
172
|
+
/** The kind of provider `P`, from its run half. */
|
|
173
|
+
type KindOf<P> = P extends {
|
|
174
|
+
readonly run: RunProvider<string, infer Kind>;
|
|
175
|
+
} ? Kind : never;
|
|
176
|
+
/** The kinds map of a provider list, by each provider's name: the registry derives its kinds this way, never twice. */
|
|
177
|
+
export type KindsOf<L extends readonly {
|
|
178
|
+
readonly name: string;
|
|
179
|
+
}[]> = {
|
|
180
|
+
readonly [P in L[number] as P["name"]]: KindOf<P>;
|
|
181
|
+
};
|
|
182
|
+
/** The core's own lane: the runner sandbox, in a runner run. */
|
|
183
|
+
export type CoreLane = "runner";
|
|
184
|
+
/** A lane of a run: the runner's, or a resource's. */
|
|
185
|
+
export type RunLane<K> = CoreLane | KindAt<K, keyof K>["lane"];
|
|
186
|
+
/**
|
|
187
|
+
* Each resource's part of the run request, by name, the same in either kind of run: what the run's policy binds each
|
|
188
|
+
* provider to. A resource the run doesn't ask for is absent.
|
|
189
|
+
*/
|
|
190
|
+
export type ResourceRequests<K> = {
|
|
191
|
+
readonly [N in keyof K]?: KindAt<K, N>["request"];
|
|
192
|
+
};
|
|
193
|
+
/** What each acquired resource tells a `ran` outcome, by name. */
|
|
194
|
+
export type ResourceFacts<K> = {
|
|
195
|
+
readonly [N in keyof K]?: KindAt<K, N>["facts"];
|
|
196
|
+
};
|
|
197
|
+
/** Each held resource's resolved options, by name: what its command half settles. */
|
|
198
|
+
export type ResourceOptions<K> = {
|
|
199
|
+
readonly [N in keyof K]?: KindAt<K, N>["options"];
|
|
200
|
+
};
|
|
201
|
+
/** What outcomes report of each resource's cleanup, by name: the run cleanup's `resources`. */
|
|
202
|
+
export type ResourceCleanupFacts<K> = {
|
|
203
|
+
readonly [N in keyof K]?: KindAt<K, N>["cleanupFacts"];
|
|
204
|
+
};
|
|
205
|
+
/** What a `ran` outcome reports of each acquired resource that reports something, by name: `resources`. */
|
|
206
|
+
export type ResourceRanFacts<K> = {
|
|
207
|
+
readonly [N in keyof K]?: KindAt<K, N>["ranFacts"];
|
|
208
|
+
};
|
|
209
|
+
/** The reasons of every resource's errors. */
|
|
210
|
+
export type ResourceReason<K> = KindAt<K, keyof K>["reason"];
|
|
211
|
+
/** What a `canceled` outcome says of each resource the run asked for, by name. */
|
|
212
|
+
export type ResourceCanceledFacts<K> = {
|
|
213
|
+
readonly [N in keyof K]?: KindAt<K, N>["canceledFacts"];
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* What releasing each resource a run held did, by name. It names only the resources whose release reported
|
|
217
|
+
* something; `{}` means none did.
|
|
218
|
+
*/
|
|
219
|
+
export type ResourceCleanup<K> = {
|
|
220
|
+
readonly [N in keyof K]?: KindAt<K, N>["cleanup"];
|
|
221
|
+
};
|
|
222
|
+
/** What the run holds of each resource as cleanup starts, by name; a resource with nothing to name is absent. */
|
|
223
|
+
export type ResourceHoldings<K> = {
|
|
224
|
+
readonly [N in keyof K]?: KindAt<K, N>["holding"];
|
|
225
|
+
};
|
|
226
|
+
/** How many things releasing each resource the run held couldn't do, by name. */
|
|
227
|
+
export type ResourceFailures<K> = {
|
|
228
|
+
readonly [N in keyof K]?: number;
|
|
229
|
+
};
|
|
230
|
+
/** The run payload's `resources`: each acquired resource's entry, by name. */
|
|
231
|
+
export type ResourcePayloads<K> = {
|
|
232
|
+
readonly [N in keyof K]?: KindAt<K, N>["payload"];
|
|
233
|
+
};
|
|
234
|
+
/** A resource's own run event, nested with its name. One union member per resource, so `resource` narrows `event`. */
|
|
235
|
+
export type ResourceEvent<K> = {
|
|
236
|
+
readonly [N in keyof K & string]: {
|
|
237
|
+
readonly kind: "resource";
|
|
238
|
+
readonly resource: N;
|
|
239
|
+
readonly event: KindAt<K, N>["event"];
|
|
240
|
+
};
|
|
241
|
+
}[keyof K & string];
|
|
242
|
+
/** A resource's refusal while the run acquires, one union member per resource, so `resource` narrows `refusal`. */
|
|
243
|
+
export type ResourceRefusal<K> = {
|
|
244
|
+
readonly [N in keyof K & string]: {
|
|
245
|
+
readonly kind: "resource-refused";
|
|
246
|
+
readonly resource: N;
|
|
247
|
+
readonly refusal: KindAt<K, N>["refusal"];
|
|
248
|
+
};
|
|
249
|
+
}[keyof K & string];
|
|
250
|
+
/**
|
|
251
|
+
* A resource's refusal before the run holds anything, one union member per resource, so `resource` narrows `refusal`;
|
|
252
|
+
* a resource whose prepare never refuses has `refusal: never`. The run ends with it before it acquires, so it carries no
|
|
253
|
+
* cleanup.
|
|
254
|
+
*/
|
|
255
|
+
export type ResourceUnprepared<K> = {
|
|
256
|
+
readonly [N in keyof K & string]: {
|
|
257
|
+
readonly kind: "resource-unprepared";
|
|
258
|
+
readonly resource: N;
|
|
259
|
+
readonly refusal: KindAt<K, N>["prepareRefusal"];
|
|
260
|
+
};
|
|
261
|
+
}[keyof K & string];
|
|
262
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// The core's resource contract: what one resource declares (`ResourceKind`), the run half its provider implements
|
|
2
|
+
// (`RunProvider`), and the types a run builds over the registry's kinds `K`. It names no resource. Each resource's
|
|
3
|
+
// folder under `src/resources/` declares its kind and writes its provider against it; `src/resources.ts`, in the
|
|
4
|
+
// composition layer, lists the providers and derives `K` from that list. `core/keyed.ts` holds the only casts that
|
|
5
|
+
// relate a resource's name to `K`.
|
|
6
|
+
export {};
|