@cnc-tools/storm 0.0.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/node-version.js +24 -0
- package/bin/storm.js +16 -0
- package/dist/application.d.ts +13 -0
- package/dist/application.js +23 -0
- package/dist/bin/storm.d.ts +1 -0
- package/dist/bin/storm.js +45 -0
- package/dist/build-info.js +3 -0
- package/dist/closed-terminal.d.ts +7 -0
- package/dist/closed-terminal.js +18 -0
- package/dist/combine-errors.d.ts +11 -0
- package/dist/combine-errors.js +19 -0
- package/dist/commands/dashboard.d.ts +11 -0
- package/dist/commands/dashboard.js +18 -0
- package/dist/commands/exec/cleanup.d.ts +135 -0
- package/dist/commands/exec/cleanup.js +171 -0
- package/dist/commands/exec/command.d.ts +272 -0
- package/dist/commands/exec/command.js +23 -0
- package/dist/commands/exec/job-summary.d.ts +10 -0
- package/dist/commands/exec/job-summary.js +34 -0
- package/dist/commands/exec/live-view.d.ts +22 -0
- package/dist/commands/exec/live-view.js +395 -0
- package/dist/commands/exec/metadata.d.ts +66 -0
- package/dist/commands/exec/metadata.js +55 -0
- package/dist/commands/exec/mint-failed.d.ts +11 -0
- package/dist/commands/exec/mint-failed.js +33 -0
- package/dist/commands/exec/outcomes.d.ts +614 -0
- package/dist/commands/exec/outcomes.js +338 -0
- package/dist/commands/exec/progress.d.ts +44 -0
- package/dist/commands/exec/progress.js +277 -0
- package/dist/commands/exec/redaction.d.ts +15 -0
- package/dist/commands/exec/redaction.js +40 -0
- package/dist/commands/exec/run-collector.d.ts +30 -0
- package/dist/commands/exec/run-collector.js +73 -0
- package/dist/commands/exec/run-command.d.ts +221 -0
- package/dist/commands/exec/run-command.js +663 -0
- package/dist/commands/exec/run-metadata.d.ts +56 -0
- package/dist/commands/exec/run-metadata.js +58 -0
- package/dist/commands/exec/run-record.d.ts +170 -0
- package/dist/commands/exec/run-record.js +104 -0
- package/dist/commands/exec/tests-summary.d.ts +34 -0
- package/dist/commands/exec/tests-summary.js +141 -0
- package/dist/commands/exec/testserver-flags.d.ts +48 -0
- package/dist/commands/exec/testserver-flags.js +80 -0
- package/dist/commands/exec/text.d.ts +22 -0
- package/dist/commands/exec/text.js +74 -0
- package/dist/commands/exec/view.d.ts +35 -0
- package/dist/commands/exec/view.js +163 -0
- package/dist/commands/exec/waterfall.d.ts +25 -0
- package/dist/commands/exec/waterfall.js +108 -0
- package/dist/commands/exec/worker-chart.d.ts +79 -0
- package/dist/commands/exec/worker-chart.js +313 -0
- package/dist/commands/runs/facts.d.ts +150 -0
- package/dist/commands/runs/facts.js +292 -0
- package/dist/commands/runs/list/command.d.ts +86 -0
- package/dist/commands/runs/list/command.js +36 -0
- package/dist/commands/runs/list/metadata.d.ts +22 -0
- package/dist/commands/runs/list/metadata.js +19 -0
- package/dist/commands/runs/list/outcomes.d.ts +74 -0
- package/dist/commands/runs/list/outcomes.js +89 -0
- package/dist/commands/runs/logs/command.d.ts +72 -0
- package/dist/commands/runs/logs/command.js +51 -0
- package/dist/commands/runs/logs/metadata.d.ts +22 -0
- package/dist/commands/runs/logs/metadata.js +22 -0
- package/dist/commands/runs/logs/outcomes.d.ts +55 -0
- package/dist/commands/runs/logs/outcomes.js +80 -0
- package/dist/commands/runs/metadata.d.ts +3 -0
- package/dist/commands/runs/metadata.js +3 -0
- package/dist/commands/runs/past-run.d.ts +72 -0
- package/dist/commands/runs/past-run.js +99 -0
- package/dist/commands/runs/show/command.d.ts +176 -0
- package/dist/commands/runs/show/command.js +76 -0
- package/dist/commands/runs/show/metadata.d.ts +25 -0
- package/dist/commands/runs/show/metadata.js +22 -0
- package/dist/commands/runs/show/outcomes.d.ts +164 -0
- package/dist/commands/runs/show/outcomes.js +320 -0
- package/dist/commands/vitest/command.d.ts +299 -0
- package/dist/commands/vitest/command.js +138 -0
- package/dist/commands/vitest/metadata.d.ts +66 -0
- package/dist/commands/vitest/metadata.js +35 -0
- package/dist/commands/vitest/outcomes.d.ts +273 -0
- package/dist/commands/vitest/outcomes.js +77 -0
- package/dist/config/by-name.d.ts +24 -0
- package/dist/config/by-name.js +26 -0
- package/dist/config/errors.d.ts +58 -0
- package/dist/config/errors.js +101 -0
- package/dist/config/gateways.d.ts +32 -0
- package/dist/config/gateways.js +1 -0
- package/dist/config/index.d.ts +10 -0
- package/dist/config/index.js +13 -0
- package/dist/config/live/config-gateway.d.ts +6 -0
- package/dist/config/live/config-gateway.js +71 -0
- package/dist/config/load.d.ts +54 -0
- package/dist/config/load.js +175 -0
- package/dist/config/resolve.d.ts +49 -0
- package/dist/config/resolve.js +94 -0
- package/dist/config/resource-config.d.ts +132 -0
- package/dist/config/resource-config.js +19 -0
- package/dist/config/schema.d.ts +64 -0
- package/dist/config/schema.js +57 -0
- package/dist/config/set.d.ts +27 -0
- package/dist/config/set.js +71 -0
- package/dist/config/settings-file.d.ts +41 -0
- package/dist/config/settings-file.js +72 -0
- package/dist/config-file/define.d.ts +39 -0
- package/dist/config-file/define.js +9 -0
- package/dist/config-file/toolchain.d.ts +9 -0
- package/dist/config-file/toolchain.js +41 -0
- package/dist/context.d.ts +89 -0
- package/dist/context.js +45 -0
- package/dist/core/command-provider.d.ts +126 -0
- package/dist/core/command-provider.js +13 -0
- package/dist/core/command-slots.d.ts +67 -0
- package/dist/core/command-slots.js +136 -0
- package/dist/core/events.d.ts +128 -0
- package/dist/core/events.js +15 -0
- package/dist/core/gateways.d.ts +249 -0
- package/dist/core/gateways.js +1 -0
- package/dist/core/index.d.ts +20 -0
- package/dist/core/index.js +18 -0
- package/dist/core/keyed.d.ts +12 -0
- package/dist/core/keyed.js +24 -0
- package/dist/core/lane.d.ts +46 -0
- package/dist/core/lane.js +5 -0
- package/dist/core/limit.d.ts +9 -0
- package/dist/core/limit.js +29 -0
- package/dist/core/live/command-gateway.d.ts +11 -0
- package/dist/core/live/command-gateway.js +83 -0
- package/dist/core/live/job-summary-gateway.d.ts +5 -0
- package/dist/core/live/job-summary-gateway.js +20 -0
- package/dist/core/live/progress-terminal.d.ts +20 -0
- package/dist/core/live/progress-terminal.js +173 -0
- package/dist/core/live/run-directory-gateway.d.ts +24 -0
- package/dist/core/live/run-directory-gateway.js +437 -0
- package/dist/core/mint.d.ts +10 -0
- package/dist/core/mint.js +14 -0
- package/dist/core/payload.d.ts +26 -0
- package/dist/core/payload.js +33 -0
- package/dist/core/presentation.d.ts +87 -0
- package/dist/core/presentation.js +5 -0
- package/dist/core/presentations.d.ts +56 -0
- package/dist/core/presentations.js +66 -0
- package/dist/core/provider.d.ts +69 -0
- package/dist/core/provider.js +5 -0
- package/dist/core/resource.d.ts +262 -0
- package/dist/core/resource.js +6 -0
- package/dist/core/resources.d.ts +131 -0
- package/dist/core/resources.js +254 -0
- package/dist/core/run-directory.d.ts +69 -0
- package/dist/core/run-directory.js +94 -0
- package/dist/core/run-state.d.ts +152 -0
- package/dist/core/run-state.js +313 -0
- package/dist/core/run.d.ts +187 -0
- package/dist/core/run.js +321 -0
- package/dist/core/state-directory.d.ts +19 -0
- package/dist/core/state-directory.js +29 -0
- package/dist/core/timeline.d.ts +63 -0
- package/dist/core/timeline.js +97 -0
- package/dist/core/timing.d.ts +22 -0
- package/dist/core/timing.js +26 -0
- package/dist/credential/credential.d.ts +46 -0
- package/dist/credential/credential.js +80 -0
- package/dist/credential/diagnosis.d.ts +18 -0
- package/dist/credential/diagnosis.js +99 -0
- package/dist/credential/gateways.d.ts +109 -0
- package/dist/credential/gateways.js +1 -0
- package/dist/credential/index.d.ts +7 -0
- package/dist/credential/index.js +7 -0
- package/dist/credential/live/github-actions-token-gateway.d.ts +15 -0
- package/dist/credential/live/github-actions-token-gateway.js +43 -0
- package/dist/credential/live/github-actions-token-response.d.ts +19 -0
- package/dist/credential/live/github-actions-token-response.js +49 -0
- package/dist/credential/live/vercel-cli-gateway.d.ts +9 -0
- package/dist/credential/live/vercel-cli-gateway.js +64 -0
- package/dist/credential/live/vercel-output.d.ts +60 -0
- package/dist/credential/live/vercel-output.js +122 -0
- package/dist/credential/live/vercel-process.d.ts +14 -0
- package/dist/credential/live/vercel-process.js +3 -0
- package/dist/credential/settle.d.ts +31 -0
- package/dist/credential/settle.js +49 -0
- package/dist/credential/source.d.ts +110 -0
- package/dist/credential/source.js +114 -0
- package/dist/help-logo.d.ts +11 -0
- package/dist/help-logo.js +56 -0
- package/dist/presentation.d.ts +26 -0
- package/dist/presentation.js +21 -0
- package/dist/resources/github/cleanup.d.ts +23 -0
- package/dist/resources/github/cleanup.js +39 -0
- package/dist/resources/github/command.d.ts +74 -0
- package/dist/resources/github/command.js +117 -0
- package/dist/resources/github/config.d.ts +16 -0
- package/dist/resources/github/config.js +37 -0
- package/dist/resources/github/events.d.ts +26 -0
- package/dist/resources/github/events.js +2 -0
- package/dist/resources/github/fixture-repo.d.ts +69 -0
- package/dist/resources/github/fixture-repo.js +60 -0
- package/dist/resources/github/gateways.d.ts +62 -0
- package/dist/resources/github/gateways.js +1 -0
- package/dist/resources/github/index.d.ts +12 -0
- package/dist/resources/github/index.js +15 -0
- package/dist/resources/github/live/fixture-repo-gateway.d.ts +12 -0
- package/dist/resources/github/live/fixture-repo-gateway.js +92 -0
- package/dist/resources/github/live/gateways.d.ts +6 -0
- package/dist/resources/github/live/gateways.js +13 -0
- package/dist/resources/github/presentation.d.ts +13 -0
- package/dist/resources/github/presentation.js +43 -0
- package/dist/resources/github/provider.d.ts +66 -0
- package/dist/resources/github/provider.js +58 -0
- package/dist/resources/github/resource-provider.d.ts +6 -0
- package/dist/resources/github/resource-provider.js +20 -0
- package/dist/resources/github/resource.d.ts +33 -0
- package/dist/resources/github/resource.js +12 -0
- package/dist/resources/testserver/cleanup.d.ts +14 -0
- package/dist/resources/testserver/cleanup.js +22 -0
- package/dist/resources/testserver/command.d.ts +322 -0
- package/dist/resources/testserver/command.js +245 -0
- package/dist/resources/testserver/commands/app.d.ts +18 -0
- package/dist/resources/testserver/commands/app.js +3 -0
- package/dist/resources/testserver/commands/create/command.d.ts +136 -0
- package/dist/resources/testserver/commands/create/command.js +158 -0
- package/dist/resources/testserver/commands/create/metadata.d.ts +31 -0
- package/dist/resources/testserver/commands/create/metadata.js +45 -0
- package/dist/resources/testserver/commands/create/outcomes.d.ts +111 -0
- package/dist/resources/testserver/commands/create/outcomes.js +172 -0
- package/dist/resources/testserver/commands/list/command.d.ts +60 -0
- package/dist/resources/testserver/commands/list/command.js +56 -0
- package/dist/resources/testserver/commands/list/metadata.d.ts +9 -0
- package/dist/resources/testserver/commands/list/metadata.js +9 -0
- package/dist/resources/testserver/commands/list/outcomes.d.ts +54 -0
- package/dist/resources/testserver/commands/list/outcomes.js +152 -0
- package/dist/resources/testserver/config.d.ts +18 -0
- package/dist/resources/testserver/config.js +78 -0
- package/dist/resources/testserver/credential-facts.d.ts +80 -0
- package/dist/resources/testserver/credential-facts.js +83 -0
- package/dist/resources/testserver/events.d.ts +59 -0
- package/dist/resources/testserver/events.js +4 -0
- package/dist/resources/testserver/index.d.ts +16 -0
- package/dist/resources/testserver/index.js +24 -0
- package/dist/resources/testserver/lane.d.ts +28 -0
- package/dist/resources/testserver/lane.js +139 -0
- package/dist/resources/testserver/live/gateways.d.ts +6 -0
- package/dist/resources/testserver/live/gateways.js +26 -0
- package/dist/resources/testserver/options.d.ts +5 -0
- package/dist/resources/testserver/options.js +5 -0
- package/dist/resources/testserver/pool/channels.d.ts +80 -0
- package/dist/resources/testserver/pool/channels.js +48 -0
- package/dist/resources/testserver/pool/create.d.ts +48 -0
- package/dist/resources/testserver/pool/create.js +45 -0
- package/dist/resources/testserver/pool/directory.d.ts +4 -0
- package/dist/resources/testserver/pool/directory.js +5 -0
- package/dist/resources/testserver/pool/gateways.d.ts +190 -0
- package/dist/resources/testserver/pool/gateways.js +1 -0
- package/dist/resources/testserver/pool/host.d.ts +8 -0
- package/dist/resources/testserver/pool/host.js +21 -0
- package/dist/resources/testserver/pool/index.d.ts +9 -0
- package/dist/resources/testserver/pool/index.js +10 -0
- package/dist/resources/testserver/pool/inspect.d.ts +53 -0
- package/dist/resources/testserver/pool/inspect.js +45 -0
- package/dist/resources/testserver/pool/lease.d.ts +84 -0
- package/dist/resources/testserver/pool/lease.js +125 -0
- package/dist/resources/testserver/pool/live/pool-records.d.ts +17 -0
- package/dist/resources/testserver/pool/live/pool-records.js +70 -0
- package/dist/resources/testserver/pool/live/pool-store-gateway.d.ts +12 -0
- package/dist/resources/testserver/pool/live/pool-store-gateway.js +435 -0
- package/dist/resources/testserver/pool/staleness.d.ts +16 -0
- package/dist/resources/testserver/pool/staleness.js +27 -0
- package/dist/resources/testserver/presentation.d.ts +9 -0
- package/dist/resources/testserver/presentation.js +217 -0
- package/dist/resources/testserver/provider.d.ts +177 -0
- package/dist/resources/testserver/provider.js +254 -0
- package/dist/resources/testserver/ran.d.ts +87 -0
- package/dist/resources/testserver/ran.js +140 -0
- package/dist/resources/testserver/resource-provider.d.ts +12 -0
- package/dist/resources/testserver/resource-provider.js +38 -0
- package/dist/resources/testserver/resource.d.ts +32 -0
- package/dist/resources/testserver/resource.js +10 -0
- package/dist/resources/testserver/run-sandbox.d.ts +13 -0
- package/dist/resources/testserver/run-sandbox.js +6 -0
- package/dist/resources/testserver/sandbox/channels.d.ts +12 -0
- package/dist/resources/testserver/sandbox/channels.js +21 -0
- package/dist/resources/testserver/sandbox/create-failure.d.ts +35 -0
- package/dist/resources/testserver/sandbox/create-failure.js +65 -0
- package/dist/resources/testserver/sandbox/create.d.ts +29 -0
- package/dist/resources/testserver/sandbox/create.js +37 -0
- package/dist/resources/testserver/sandbox/gateways.d.ts +150 -0
- package/dist/resources/testserver/sandbox/gateways.js +1 -0
- package/dist/resources/testserver/sandbox/index.d.ts +6 -0
- package/dist/resources/testserver/sandbox/index.js +7 -0
- package/dist/resources/testserver/sandbox/live/builds-response.d.ts +9 -0
- package/dist/resources/testserver/sandbox/live/builds-response.js +27 -0
- package/dist/resources/testserver/sandbox/live/control-plane-gateway.d.ts +17 -0
- package/dist/resources/testserver/sandbox/live/control-plane-gateway.js +133 -0
- package/dist/resources/testserver/sandbox/live/create-response.d.ts +35 -0
- package/dist/resources/testserver/sandbox/live/create-response.js +78 -0
- package/dist/resources/testserver/sandbox/live/fetch-failure.d.ts +24 -0
- package/dist/resources/testserver/sandbox/live/fetch-failure.js +45 -0
- package/dist/resources/testserver/sandbox/live/health-check-gateway.d.ts +11 -0
- package/dist/resources/testserver/sandbox/live/health-check-gateway.js +36 -0
- package/dist/resources/testserver/sandbox/live/sse.d.ts +12 -0
- package/dist/resources/testserver/sandbox/live/sse.js +32 -0
- package/dist/resources.d.ts +455 -0
- package/dist/resources.js +88 -0
- package/dist/runner/base.d.ts +40 -0
- package/dist/runner/base.js +52 -0
- package/dist/runner/context.d.ts +13 -0
- package/dist/runner/context.js +9 -0
- package/dist/runner/events.d.ts +179 -0
- package/dist/runner/events.js +16 -0
- package/dist/runner/gateways.d.ts +351 -0
- package/dist/runner/gateways.js +3 -0
- package/dist/runner/index.d.ts +19 -0
- package/dist/runner/index.js +18 -0
- package/dist/runner/live/checkout-gateway.d.ts +3 -0
- package/dist/runner/live/checkout-gateway.js +206 -0
- package/dist/runner/live/git-output.d.ts +14 -0
- package/dist/runner/live/git-output.js +32 -0
- package/dist/runner/live/sandbox-errors.d.ts +7 -0
- package/dist/runner/live/sandbox-errors.js +21 -0
- package/dist/runner/live/sandbox-gateway.d.ts +7 -0
- package/dist/runner/live/sandbox-gateway.js +427 -0
- package/dist/runner/live/snapshot-cache-gateway.d.ts +12 -0
- package/dist/runner/live/snapshot-cache-gateway.js +104 -0
- package/dist/runner/live/snapshot-records.d.ts +11 -0
- package/dist/runner/live/snapshot-records.js +57 -0
- package/dist/runner/live/terminal.d.ts +16 -0
- package/dist/runner/live/terminal.js +37 -0
- package/dist/runner/live/user.d.ts +2 -0
- package/dist/runner/live/user.js +11 -0
- package/dist/runner/output.d.ts +23 -0
- package/dist/runner/output.js +58 -0
- package/dist/runner/prepare.d.ts +67 -0
- package/dist/runner/prepare.js +59 -0
- package/dist/runner/ready.d.ts +68 -0
- package/dist/runner/ready.js +159 -0
- package/dist/runner/recipe.d.ts +126 -0
- package/dist/runner/recipe.js +302 -0
- package/dist/runner/remote-command.d.ts +77 -0
- package/dist/runner/remote-command.js +127 -0
- package/dist/runner/scope.d.ts +58 -0
- package/dist/runner/scope.js +117 -0
- package/dist/runner/snapshot-build.d.ts +33 -0
- package/dist/runner/snapshot-build.js +112 -0
- package/dist/runner/snapshot-cache.d.ts +84 -0
- package/dist/runner/snapshot-cache.js +126 -0
- package/dist/runner/snapshot-key.d.ts +52 -0
- package/dist/runner/snapshot-key.js +91 -0
- package/dist/runner/steps.d.ts +41 -0
- package/dist/runner/steps.js +49 -0
- package/dist/sdk/container/api-request.d.ts +32 -0
- package/dist/sdk/container/api-request.js +46 -0
- package/dist/sdk/container/container.d.ts +144 -0
- package/dist/sdk/container/container.js +346 -0
- package/dist/sdk/container/feature-flags.d.ts +37 -0
- package/dist/sdk/container/feature-flags.js +118 -0
- package/dist/sdk/container/gateways.d.ts +108 -0
- package/dist/sdk/container/gateways.js +1 -0
- package/dist/sdk/container/index.d.ts +5 -0
- package/dist/sdk/container/index.js +5 -0
- package/dist/sdk/container/live/container-gateway.d.ts +17 -0
- package/dist/sdk/container/live/container-gateway.js +114 -0
- package/dist/sdk/factories/build.d.ts +66 -0
- package/dist/sdk/factories/build.js +98 -0
- package/dist/sdk/factories/definition.d.ts +28 -0
- package/dist/sdk/factories/definition.js +16 -0
- package/dist/sdk/factories/definitions.d.ts +166 -0
- package/dist/sdk/factories/definitions.js +235 -0
- package/dist/sdk/factories/gateways.d.ts +25 -0
- package/dist/sdk/factories/gateways.js +1 -0
- package/dist/sdk/factories/index.d.ts +5 -0
- package/dist/sdk/factories/index.js +5 -0
- package/dist/sdk/factories/live/factory-gateway.d.ts +10 -0
- package/dist/sdk/factories/live/factory-gateway.js +29 -0
- package/dist/sdk/index.d.ts +7 -0
- package/dist/sdk/index.js +15 -0
- package/dist/sdk/payload/index.d.ts +2 -0
- package/dist/sdk/payload/index.js +4 -0
- package/dist/sdk/payload/payload.d.ts +47 -0
- package/dist/sdk/payload/payload.js +74 -0
- package/dist/sdk/payload/test-events.d.ts +102 -0
- package/dist/sdk/payload/test-events.js +59 -0
- package/dist/sdk/proxy/exchange.d.ts +58 -0
- package/dist/sdk/proxy/exchange.js +173 -0
- package/dist/sdk/proxy/faulted-exchange.d.ts +10 -0
- package/dist/sdk/proxy/faulted-exchange.js +106 -0
- package/dist/sdk/proxy/faults.d.ts +133 -0
- package/dist/sdk/proxy/faults.js +147 -0
- package/dist/sdk/proxy/index.d.ts +3 -0
- package/dist/sdk/proxy/index.js +3 -0
- package/dist/sdk/proxy/proxy.d.ts +93 -0
- package/dist/sdk/proxy/proxy.js +99 -0
- package/dist/sdk/proxy/records.d.ts +56 -0
- package/dist/sdk/proxy/records.js +56 -0
- package/dist/sdk/records/body.d.ts +89 -0
- package/dist/sdk/records/body.js +236 -0
- package/dist/sdk/records/index.d.ts +2 -0
- package/dist/sdk/records/index.js +4 -0
- package/dist/sdk/records/records.d.ts +49 -0
- package/dist/sdk/records/records.js +16 -0
- package/dist/sdk/seed/index.d.ts +1 -0
- package/dist/sdk/seed/index.js +3 -0
- package/dist/sdk/seed/seed.d.ts +221 -0
- package/dist/sdk/seed/seed.js +171 -0
- package/dist/sdk/testserver/clock.d.ts +8 -0
- package/dist/sdk/testserver/clock.js +10 -0
- package/dist/sdk/testserver/failure.d.ts +73 -0
- package/dist/sdk/testserver/failure.js +61 -0
- package/dist/sdk/testserver/index.d.ts +5 -0
- package/dist/sdk/testserver/index.js +8 -0
- package/dist/sdk/testserver/live/connect-failure.d.ts +7 -0
- package/dist/sdk/testserver/live/connect-failure.js +30 -0
- package/dist/sdk/testserver/live/request.d.ts +69 -0
- package/dist/sdk/testserver/live/request.js +89 -0
- package/dist/sdk/testserver/service-ids.d.ts +19 -0
- package/dist/sdk/testserver/service-ids.js +77 -0
- package/dist/sdk/testserver/test-id.d.ts +15 -0
- package/dist/sdk/testserver/test-id.js +28 -0
- package/dist/story/align.d.ts +37 -0
- package/dist/story/align.js +39 -0
- package/dist/story/artifact.d.ts +60 -0
- package/dist/story/artifact.js +93 -0
- package/dist/story/definition.d.ts +52 -0
- package/dist/story/definition.js +9 -0
- package/dist/story/diff.d.ts +9 -0
- package/dist/story/diff.js +97 -0
- package/dist/story/errors.d.ts +14 -0
- package/dist/story/errors.js +21 -0
- package/dist/story/gateways.d.ts +74 -0
- package/dist/story/gateways.js +3 -0
- package/dist/story/host.d.ts +27 -0
- package/dist/story/host.js +97 -0
- package/dist/story/index.d.ts +7 -0
- package/dist/story/index.js +9 -0
- package/dist/story/json.d.ts +16 -0
- package/dist/story/json.js +59 -0
- package/dist/story/live/artifact-gateway.d.ts +2 -0
- package/dist/story/live/artifact-gateway.js +82 -0
- package/dist/story/mode.d.ts +17 -0
- package/dist/story/mode.js +21 -0
- package/dist/story/orphans.d.ts +17 -0
- package/dist/story/orphans.js +15 -0
- package/dist/story/report.d.ts +30 -0
- package/dist/story/report.js +118 -0
- package/dist/story/run.d.ts +49 -0
- package/dist/story/run.js +160 -0
- package/dist/story/sequence.d.ts +30 -0
- package/dist/story/sequence.js +74 -0
- package/dist/story/settle.d.ts +94 -0
- package/dist/story/settle.js +70 -0
- package/dist/time/duration.d.ts +19 -0
- package/dist/time/duration.js +37 -0
- package/dist/time/index.d.ts +2 -0
- package/dist/time/index.js +4 -0
- package/dist/time/time.d.ts +15 -0
- package/dist/time/time.js +23 -0
- package/dist/vercel-cli/ansi.d.ts +13 -0
- package/dist/vercel-cli/ansi.js +32 -0
- package/dist/vercel-cli/arguments.d.ts +25 -0
- package/dist/vercel-cli/arguments.js +78 -0
- package/dist/vercel-cli/auth-config.d.ts +43 -0
- package/dist/vercel-cli/auth-config.js +36 -0
- package/dist/vercel-cli/clock.d.ts +9 -0
- package/dist/vercel-cli/clock.js +10 -0
- package/dist/vercel-cli/config-files.d.ts +24 -0
- package/dist/vercel-cli/config-files.js +40 -0
- package/dist/vercel-cli/context.d.ts +12 -0
- package/dist/vercel-cli/context.js +12 -0
- package/dist/vercel-cli/driver.d.ts +218 -0
- package/dist/vercel-cli/driver.js +364 -0
- package/dist/vercel-cli/entry.d.ts +8 -0
- package/dist/vercel-cli/entry.js +13 -0
- package/dist/vercel-cli/environment.d.ts +33 -0
- package/dist/vercel-cli/environment.js +72 -0
- package/dist/vercel-cli/errors.d.ts +8 -0
- package/dist/vercel-cli/errors.js +8 -0
- package/dist/vercel-cli/gateways.d.ts +103 -0
- package/dist/vercel-cli/gateways.js +4 -0
- package/dist/vercel-cli/index.d.ts +10 -0
- package/dist/vercel-cli/index.js +15 -0
- package/dist/vercel-cli/invocation.d.ts +234 -0
- package/dist/vercel-cli/invocation.js +397 -0
- package/dist/vercel-cli/keys.d.ts +14 -0
- package/dist/vercel-cli/keys.js +12 -0
- package/dist/vercel-cli/live/config-files.d.ts +28 -0
- package/dist/vercel-cli/live/config-files.js +66 -0
- package/dist/vercel-cli/live/process-gateway.d.ts +14 -0
- package/dist/vercel-cli/live/process-gateway.js +178 -0
- package/dist/vercel-cli/redaction.d.ts +13 -0
- package/dist/vercel-cli/redaction.js +22 -0
- package/dist/vercel-cli/report.d.ts +22 -0
- package/dist/vercel-cli/report.js +110 -0
- package/dist/vercel-cli/verbose.d.ts +7 -0
- package/dist/vercel-cli/verbose.js +24 -0
- package/dist/version.d.ts +20 -0
- package/dist/version.js +57 -0
- package/dist/vitest/config.d.ts +51 -0
- package/dist/vitest/config.js +61 -0
- package/dist/vitest/container-scope.d.ts +108 -0
- package/dist/vitest/container-scope.js +234 -0
- package/dist/vitest/diagnostics.d.ts +146 -0
- package/dist/vitest/diagnostics.js +306 -0
- package/dist/vitest/find-vitest.d.ts +7 -0
- package/dist/vitest/find-vitest.js +28 -0
- package/dist/vitest/fixtures.d.ts +64 -0
- package/dist/vitest/fixtures.js +172 -0
- package/dist/vitest/gateways.d.ts +78 -0
- package/dist/vitest/gateways.js +4 -0
- package/dist/vitest/index.d.ts +3 -0
- package/dist/vitest/index.js +9 -0
- package/dist/vitest/list-output.d.ts +3 -0
- package/dist/vitest/list-output.js +19 -0
- package/dist/vitest/live/list-gateway.d.ts +11 -0
- package/dist/vitest/live/list-gateway.js +107 -0
- package/dist/vitest/ownership.d.ts +29 -0
- package/dist/vitest/ownership.js +68 -0
- package/dist/vitest/plan.d.ts +66 -0
- package/dist/vitest/plan.js +104 -0
- package/dist/vitest/sandbox.d.ts +16 -0
- package/dist/vitest/sandbox.js +35 -0
- package/dist/vitest/test-events.d.ts +41 -0
- package/dist/vitest/test-events.js +92 -0
- package/dist/vitest/test-results.d.ts +84 -0
- package/dist/vitest/test-results.js +160 -0
- package/dist/vitest/types.d.ts +68 -0
- package/dist/vitest/types.js +4 -0
- package/package.json +119 -3
- package/skills/overview.md +33 -0
- package/skills/read-run-output.md +65 -0
- package/README.md +0 -3
|
@@ -0,0 +1,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
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { MintTarget } from "../credential/index.ts";
|
|
2
|
+
import type { KeptSandbox } from "../runner/index.ts";
|
|
3
|
+
import type { TimedRunEvent } from "./events.ts";
|
|
4
|
+
import type { LaneStates, ResourceLanes } from "./lane.ts";
|
|
5
|
+
import type { ResourceHoldings, RunLane } from "./resource.ts";
|
|
6
|
+
import type { RanCommand } from "./timing.ts";
|
|
7
|
+
/** Where a lane, step or span is: not started, running, done, failed, or stopped short of done. */
|
|
8
|
+
export type SpanStatus = "pending" | "running" | "done" | "failed" | "stopped";
|
|
9
|
+
/** When something started and ended, and how; `endedAt` is undefined while it runs. */
|
|
10
|
+
export interface Span {
|
|
11
|
+
readonly status: SpanStatus;
|
|
12
|
+
readonly startedAt: number;
|
|
13
|
+
readonly endedAt: number | undefined;
|
|
14
|
+
}
|
|
15
|
+
/** The runner lane's steps, in order. */
|
|
16
|
+
export type RunnerStepName = "snapshot" | "start" | "upload" | "apply" | "install" | "build";
|
|
17
|
+
/** The runner lane's steps, in order. */
|
|
18
|
+
export declare const RUNNER_STEPS: readonly RunnerStepName[];
|
|
19
|
+
/** One step of the runner lane. */
|
|
20
|
+
export interface RunnerStepState {
|
|
21
|
+
readonly name: RunnerStepName;
|
|
22
|
+
readonly status: SpanStatus;
|
|
23
|
+
readonly startedAt: number | undefined;
|
|
24
|
+
readonly endedAt: number | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The label its `step-started` gave, such as the install's `pnpm install`; for the snapshot step, the snapshot
|
|
27
|
+
* build's current step. Empty until one did.
|
|
28
|
+
*/
|
|
29
|
+
readonly label: string;
|
|
30
|
+
/** The last line the step printed, while it runs. */
|
|
31
|
+
readonly latest: string | undefined;
|
|
32
|
+
}
|
|
33
|
+
/** What the runner did with its runner snapshot: reused or built one, of the base it holds, or is building one. */
|
|
34
|
+
export type RunnerSnapshotState = {
|
|
35
|
+
readonly kind: "reused" | "built";
|
|
36
|
+
readonly id: string;
|
|
37
|
+
readonly base: string;
|
|
38
|
+
} | {
|
|
39
|
+
readonly kind: "building";
|
|
40
|
+
readonly summary: string;
|
|
41
|
+
};
|
|
42
|
+
/** One vitest worker, as its test events show it. */
|
|
43
|
+
export interface TestWorkerState {
|
|
44
|
+
readonly worker: number;
|
|
45
|
+
/** The file it runs, and when it started it; undefined between files. */
|
|
46
|
+
readonly file: string | undefined;
|
|
47
|
+
readonly fileStartedAt: number | undefined;
|
|
48
|
+
/** When the container start it waits on began; undefined when none is starting. */
|
|
49
|
+
readonly containerSince: number | undefined;
|
|
50
|
+
}
|
|
51
|
+
/** The command's tests, as their test events show them, in a runner run. */
|
|
52
|
+
export interface TestsState {
|
|
53
|
+
readonly workers: readonly TestWorkerState[];
|
|
54
|
+
readonly filesDone: number;
|
|
55
|
+
/** Tests whose final result passed or failed, as `test-result` events report them; attempts don't count. */
|
|
56
|
+
readonly passed: number;
|
|
57
|
+
readonly failed: number;
|
|
58
|
+
}
|
|
59
|
+
/** The runner lane: readying the runner sandbox, in a runner run. */
|
|
60
|
+
export interface RunnerState extends Span {
|
|
61
|
+
readonly sandbox: {
|
|
62
|
+
readonly name: string;
|
|
63
|
+
readonly region: string;
|
|
64
|
+
readonly vcpus: number;
|
|
65
|
+
} | undefined;
|
|
66
|
+
/** The build sandbox's name, once a snapshot build started one. */
|
|
67
|
+
readonly buildSandbox: string | undefined;
|
|
68
|
+
readonly steps: readonly RunnerStepState[];
|
|
69
|
+
readonly snapshot: RunnerSnapshotState | undefined;
|
|
70
|
+
/** The bytes the upload sent, once it is done. */
|
|
71
|
+
readonly uploadBytes: number | undefined;
|
|
72
|
+
/** What the runner does outside its steps: saving a runner snapshot, or waiting for one still saving. */
|
|
73
|
+
readonly activity: "saving-snapshot" | "waiting-for-snapshot" | undefined;
|
|
74
|
+
/** The runner sandbox the run kept running once it ended, once closing kept it. */
|
|
75
|
+
readonly kept: KeptSandbox | undefined;
|
|
76
|
+
}
|
|
77
|
+
/** The command: its argument list and how it ended; `stopped` when the run killed it. */
|
|
78
|
+
export interface CommandState extends Span {
|
|
79
|
+
readonly argv: readonly string[];
|
|
80
|
+
readonly outcome: RanCommand | "stopped" | undefined;
|
|
81
|
+
}
|
|
82
|
+
/** The cleanup over the registry's kinds `K`: what it stops and releases, and what it couldn't. */
|
|
83
|
+
export interface CleanupState<K> extends Span {
|
|
84
|
+
/** Whether it stops and deletes the runner's sandboxes. */
|
|
85
|
+
readonly runner: boolean;
|
|
86
|
+
/** How long it keeps the runner sandbox running, in milliseconds; 0 when it stops and deletes it. */
|
|
87
|
+
readonly keepSandboxMs: number;
|
|
88
|
+
/** What the run held of each resource as cleanup started, which each resource's presentation names. */
|
|
89
|
+
readonly holdings: ResourceHoldings<K>;
|
|
90
|
+
/** What releasing the resources the run held couldn't do, summed over them, such as leases not released. */
|
|
91
|
+
readonly resourceFailures: number;
|
|
92
|
+
readonly notStopped: number;
|
|
93
|
+
readonly notDeleted: number;
|
|
94
|
+
/** Whether it waits for a runner snapshot still saving. */
|
|
95
|
+
readonly waiting: boolean;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* A run's state over the registry's kinds `K`, built from its timed events by `applyRunEvent`. Times are milliseconds
|
|
99
|
+
* since the epoch.
|
|
100
|
+
*/
|
|
101
|
+
export interface RunState<K> {
|
|
102
|
+
/** When the run started: its first event's time; undefined before it. */
|
|
103
|
+
readonly origin: number | undefined;
|
|
104
|
+
/** Its last event's time. */
|
|
105
|
+
readonly lastAt: number | undefined;
|
|
106
|
+
/** storm's version and the commit it was built from, as `started` reported them. */
|
|
107
|
+
readonly version: {
|
|
108
|
+
readonly version: string;
|
|
109
|
+
readonly commit: string | null;
|
|
110
|
+
} | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* The lanes of the resources the run holds, as `started` reported them; undefined until then, when a view can't
|
|
113
|
+
* yet know which lanes the run has.
|
|
114
|
+
*/
|
|
115
|
+
readonly lanes: readonly RunLane<K>[] | undefined;
|
|
116
|
+
/** In a runner run, the base and the ref it is HEAD's merge-base with. */
|
|
117
|
+
readonly base: {
|
|
118
|
+
readonly sha: string;
|
|
119
|
+
readonly ref: string;
|
|
120
|
+
} | undefined;
|
|
121
|
+
readonly mint: (Span & {
|
|
122
|
+
readonly target: MintTarget;
|
|
123
|
+
}) | undefined;
|
|
124
|
+
/** In a runner run, when the resources' lanes and the runner lane started together. */
|
|
125
|
+
readonly lanesStartedAt: number | undefined;
|
|
126
|
+
/** Each resource lane's state, by resource name, once the lane started. */
|
|
127
|
+
readonly resources: LaneStates<K>;
|
|
128
|
+
readonly runner: RunnerState | undefined;
|
|
129
|
+
readonly command: CommandState | undefined;
|
|
130
|
+
readonly cleanup: CleanupState<K> | undefined;
|
|
131
|
+
/** In a runner run, the tests' progress, once a test event arrived. */
|
|
132
|
+
readonly tests: TestsState | undefined;
|
|
133
|
+
/** Whether a signal is stopping the run. */
|
|
134
|
+
readonly stopping: boolean;
|
|
135
|
+
}
|
|
136
|
+
/** A kinds map with no resources: the empty state's, which every registry's state takes as its start. */
|
|
137
|
+
type NoResources = Record<never, never>;
|
|
138
|
+
/** The state before any event: what applying a run's events starts from. */
|
|
139
|
+
export declare const EMPTY_RUN_STATE: RunState<NoResources>;
|
|
140
|
+
/**
|
|
141
|
+
* The run's state after `timed`. The core applies its own events; `lanes`, the registry's resource lanes, apply each
|
|
142
|
+
* resource's own events, start and end. A resource without a lane keeps no state: its events' lines are notices.
|
|
143
|
+
*/
|
|
144
|
+
export declare function applyRunEvent<K>(lanes: ResourceLanes<K>, state: RunState<K>, timed: TimedRunEvent<K>): RunState<K>;
|
|
145
|
+
/** Whether a command that ended passed: it exited 0. */
|
|
146
|
+
export declare function commandPassed(outcome: RanCommand): boolean;
|
|
147
|
+
/**
|
|
148
|
+
* What the cleanup couldn't do: what releasing the resources couldn't, and runner sandboxes it couldn't stop or
|
|
149
|
+
* delete.
|
|
150
|
+
*/
|
|
151
|
+
export declare function cleanupProblems<K>(cleanup: CleanupState<K>): number;
|
|
152
|
+
export {};
|