@cnc-tools/storm 0.9.1 → 0.11.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/storm.js +11 -2
- package/dist/application.d.ts +5 -5
- package/dist/application.js +11 -9
- package/dist/bin/storm.js +32 -20
- package/dist/build-info.js +1 -1
- package/dist/chunks/chunk-3ZZVZPMG.js +10 -0
- package/dist/chunks/{chunk-WV6WQFC6.js → chunk-4EU4AH7E.js} +150 -26
- package/dist/chunks/chunk-4PRAB24Y.js +4400 -0
- package/dist/chunks/chunk-AMTYHUYB.js +257 -0
- package/dist/chunks/chunk-ETCZ6WP7.js +431 -0
- package/dist/chunks/chunk-FVMQKYTT.js +10 -0
- package/dist/chunks/chunk-GRMD7G4J.js +1267 -0
- package/dist/chunks/chunk-ICB4BZJX.js +22 -0
- package/dist/chunks/chunk-KR7WIYLG.js +2184 -0
- package/dist/chunks/chunk-L4ZPMSKQ.js +808 -0
- package/dist/chunks/chunk-NPPJ57W7.js +569 -0
- package/dist/chunks/chunk-O4BUT7BE.js +3361 -0
- package/dist/chunks/chunk-OJOKQRM6.js +1457 -0
- package/dist/chunks/chunk-SLNKW4ZM.js +40 -0
- package/dist/chunks/chunk-TRFEAYNC.js +1952 -0
- package/dist/chunks/chunk-VZZTHCBW.js +93 -0
- package/dist/chunks/chunk-WNIQA5J6.js +19 -0
- package/dist/chunks/chunk-WSIF7SR6.js +10 -0
- package/dist/chunks/{live-app-X3PW2W42.js → live-app-LOGYUBKB.js} +73 -20
- package/dist/command-tree.d.ts +3 -0
- package/dist/command-tree.js +3 -0
- package/dist/commands/dashboard.d.ts +1 -1
- package/dist/commands/dashboard.js +1 -1
- package/dist/commands/exec/cleanup.d.ts +28 -44
- package/dist/commands/exec/cleanup.js +25 -55
- package/dist/commands/exec/command.d.ts +73 -545
- package/dist/commands/exec/command.js +65 -25
- package/dist/commands/exec/job-summary.d.ts +2 -2
- package/dist/commands/exec/job-summary.js +3 -3
- package/dist/commands/exec/live-view.d.ts +9 -9
- package/dist/commands/exec/live-view.js +49 -42
- package/dist/commands/exec/metadata.d.ts +0 -65
- package/dist/commands/exec/metadata.js +2 -61
- package/dist/commands/exec/mint-failed.d.ts +1 -1
- package/dist/commands/exec/mint-failed.js +8 -8
- package/dist/commands/exec/outcomes.d.ts +63 -468
- package/dist/commands/exec/outcomes.js +47 -75
- package/dist/commands/exec/plan-run.d.ts +148 -0
- package/dist/commands/exec/plan-run.js +121 -0
- package/dist/commands/exec/progress.d.ts +26 -16
- package/dist/commands/exec/progress.js +63 -42
- package/dist/commands/exec/redaction.d.ts +3 -3
- package/dist/commands/exec/redaction.js +4 -4
- package/dist/commands/exec/resource-flags.d.ts +50 -0
- package/dist/commands/exec/resource-flags.js +125 -0
- package/dist/commands/exec/resource-refusals.d.ts +64 -0
- package/dist/commands/exec/resource-refusals.js +58 -0
- package/dist/commands/exec/run-command.d.ts +87 -167
- package/dist/commands/exec/run-command.js +296 -418
- package/dist/commands/exec/run-metadata.d.ts +20 -43
- package/dist/commands/exec/run-metadata.js +18 -37
- package/dist/commands/exec/test-plan.d.ts +11 -0
- package/dist/commands/exec/test-plan.js +39 -0
- package/dist/commands/exec/tests-summary.d.ts +5 -5
- package/dist/commands/exec/tests-summary.js +2 -2
- package/dist/commands/exec/text.d.ts +8 -2
- package/dist/commands/exec/text.js +8 -0
- package/dist/commands/exec/view.d.ts +5 -7
- package/dist/commands/exec/view.js +22 -14
- package/dist/commands/exec/waterfall.d.ts +4 -9
- package/dist/commands/exec/waterfall.js +22 -26
- package/dist/commands/exec/worker-chart.d.ts +1 -1
- package/dist/commands/ext/metadata.d.ts +4 -0
- package/dist/commands/ext/metadata.js +8 -0
- package/dist/commands/runs/facts.d.ts +11 -6
- package/dist/commands/runs/facts.js +27 -15
- package/dist/commands/runs/list/command.d.ts +15 -8
- package/dist/commands/runs/list/command.js +39 -32
- package/dist/commands/runs/list/metadata.d.ts +16 -14
- package/dist/commands/runs/list/metadata.js +17 -15
- package/dist/commands/runs/list/outcomes.d.ts +6 -2
- package/dist/commands/runs/logs/command.d.ts +3 -4
- package/dist/commands/runs/logs/command.js +46 -41
- package/dist/commands/runs/logs/metadata.d.ts +17 -15
- package/dist/commands/runs/logs/metadata.js +20 -18
- package/dist/commands/runs/past-run.d.ts +3 -33
- package/dist/commands/runs/past-run.js +3 -52
- package/dist/commands/runs/show/command.d.ts +57 -42
- package/dist/commands/runs/show/command.js +93 -82
- package/dist/commands/runs/show/metadata.d.ts +20 -18
- package/dist/commands/runs/show/metadata.js +20 -18
- package/dist/commands/runs/show/outcomes.d.ts +27 -19
- package/dist/commands/runs/show/outcomes.js +8 -6
- package/dist/commands/vitest/command.d.ts +95 -560
- package/dist/commands/vitest/command.js +84 -100
- package/dist/commands/vitest/metadata.d.ts +0 -65
- package/dist/commands/vitest/metadata.js +2 -41
- package/dist/commands/vitest/outcomes.d.ts +44 -274
- package/dist/commands/vitest/outcomes.js +7 -14
- package/dist/config/credential-resolver.d.ts +134 -0
- package/dist/config/credential-resolver.js +70 -0
- package/dist/{credential/settle.d.ts → config/credential-settle.d.ts} +1 -2
- package/dist/config/errors.d.ts +1 -1
- package/dist/config/errors.js +5 -5
- package/dist/config/index.d.ts +7 -6
- package/dist/config/index.js +13 -9
- package/dist/config/load.d.ts +16 -13
- package/dist/config/load.js +55 -40
- package/dist/config/recipe-run.d.ts +26 -0
- package/dist/config/recipe-run.js +27 -0
- package/dist/config/resolve.d.ts +103 -15
- package/dist/config/resolve.js +137 -47
- package/dist/config/resolver.d.ts +40 -0
- package/dist/config/resolver.js +31 -0
- package/dist/config/schema.d.ts +13 -17
- package/dist/config/schema.js +14 -35
- package/dist/config/settings-file.d.ts +28 -16
- package/dist/config/settings-file.js +39 -24
- package/dist/config/typed-options.d.ts +21 -0
- package/dist/config/typed-options.js +28 -0
- package/dist/config-file/define.d.ts +33 -31
- package/dist/config-file/define.js +14 -4
- package/dist/config-file/toolchain.d.ts +1 -1
- package/dist/context.d.ts +60 -29
- package/dist/context.js +32 -13
- package/dist/core/before-run.d.ts +38 -0
- package/dist/core/before-run.js +44 -0
- package/dist/core/definition-lookup.d.ts +22 -0
- package/dist/core/definition-lookup.js +34 -0
- package/dist/core/events.d.ts +59 -64
- package/dist/core/gateways.d.ts +23 -164
- package/dist/core/index.d.ts +14 -15
- package/dist/core/index.js +13 -11
- package/dist/core/launcher-supplies.d.ts +11 -0
- package/dist/core/launcher-supplies.js +28 -0
- package/dist/core/live/terminal-command-gateway.d.ts +8 -0
- package/dist/core/live/terminal-command-gateway.js +49 -0
- package/dist/core/payload.d.ts +13 -14
- package/dist/core/payload.js +9 -8
- package/dist/core/presentations.d.ts +38 -37
- package/dist/core/presentations.js +48 -56
- package/dist/core/reports.d.ts +5 -0
- package/dist/core/reports.js +13 -0
- package/dist/core/resource-registry.d.ts +38 -0
- package/dist/core/resource-registry.js +30 -0
- package/dist/core/resource-reports.d.ts +69 -0
- package/dist/core/resource-reports.js +67 -0
- package/dist/core/resource.d.ts +135 -243
- package/dist/core/resource.js +7 -5
- package/dist/core/resources-of.d.ts +16 -0
- package/dist/core/resources-of.js +8 -0
- package/dist/core/resources.d.ts +97 -84
- package/dist/core/resources.js +166 -165
- package/dist/core/run-state.d.ts +30 -42
- package/dist/core/run-state.js +56 -60
- package/dist/core/run.d.ts +83 -90
- package/dist/core/run.js +109 -155
- package/dist/core/state-directory.js +4 -3
- package/dist/core/timeline.d.ts +42 -24
- package/dist/core/timeline.js +46 -27
- package/dist/core/timing.d.ts +3 -3
- package/dist/core/timing.js +1 -1
- package/dist/credential/events.d.ts +20 -0
- package/dist/credential/events.js +4 -0
- package/dist/credential/gateways.d.ts +1 -80
- package/dist/credential/index.d.ts +4 -5
- package/dist/credential/index.js +8 -5
- package/dist/credential/live/github-actions-token-response.js +1 -1
- package/dist/credential/live/vercel-cli-gateway.d.ts +2 -1
- package/dist/credential/live/vercel-cli-gateway.js +1 -1
- package/dist/credential/live/vercel-output.d.ts +1 -1
- package/dist/credential/source.d.ts +44 -75
- package/dist/credential/source.js +33 -28
- package/dist/credential/target.d.ts +1 -1
- package/dist/extension-commands.d.ts +20 -0
- package/dist/extension-commands.js +27 -0
- package/dist/extensions/github/definition.d.ts +26 -0
- package/dist/extensions/github/definition.js +29 -0
- package/dist/extensions/github/extension.d.ts +18 -0
- package/dist/extensions/github/extension.js +6 -0
- package/dist/{resources → extensions}/github/fixture-repo.d.ts +11 -8
- package/dist/{resources → extensions}/github/fixture-repo.js +8 -4
- package/dist/extensions/github/index.d.ts +13 -0
- package/dist/extensions/github/index.js +17 -0
- package/dist/extensions/github/lifecycle.d.ts +30 -0
- package/dist/extensions/github/lifecycle.js +69 -0
- package/dist/extensions/github/live/world.d.ts +6 -0
- package/dist/extensions/github/live/world.js +16 -0
- package/dist/extensions/github/options.d.ts +36 -0
- package/dist/extensions/github/options.js +36 -0
- package/dist/extensions/github/refusals.d.ts +32 -0
- package/dist/extensions/github/refusals.js +43 -0
- package/dist/extensions/github/release.d.ts +17 -0
- package/dist/extensions/github/release.js +34 -0
- package/dist/extensions/github/resource.d.ts +36 -0
- package/dist/extensions/github/resource.js +21 -0
- package/dist/extensions/github/run/payload.d.ts +27 -0
- package/dist/extensions/github/run/payload.js +42 -0
- package/dist/extensions/github/world.d.ts +15 -0
- package/dist/extensions/github/world.js +3 -0
- package/dist/extensions/story/command-tree.d.ts +6 -0
- package/dist/extensions/story/command-tree.js +21 -0
- package/dist/extensions/story/commands/app.d.ts +23 -0
- package/dist/extensions/story/commands/app.js +5 -0
- package/dist/extensions/story/commands/run/command.d.ts +211 -0
- package/dist/extensions/story/commands/run/command.js +259 -0
- package/dist/extensions/story/commands/run/metadata.d.ts +4 -0
- package/dist/extensions/story/commands/run/metadata.js +8 -0
- package/dist/extensions/story/commands/run/outcomes.d.ts +101 -0
- package/dist/extensions/story/commands/run/outcomes.js +73 -0
- package/dist/extensions/story/commands/tree.d.ts +2 -0
- package/dist/extensions/story/commands/tree.js +6 -0
- package/dist/extensions/story/extension.d.ts +2 -0
- package/dist/extensions/story/extension.js +8 -0
- package/dist/extensions/testserver/canceled.d.ts +7 -0
- package/dist/extensions/testserver/canceled.js +27 -0
- package/dist/extensions/testserver/command-tree.d.ts +6 -0
- package/dist/extensions/testserver/command-tree.js +20 -0
- package/dist/extensions/testserver/commands/app.d.ts +22 -0
- package/dist/extensions/testserver/commands/app.js +5 -0
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/create/command.d.ts +277 -237
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/create/command.js +112 -141
- package/dist/extensions/testserver/commands/pool/create/metadata.d.ts +33 -0
- package/dist/extensions/testserver/commands/pool/create/metadata.js +55 -0
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/create/outcomes.d.ts +132 -112
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/create/outcomes.js +6 -24
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/list/command.d.ts +3 -4
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/list/command.js +34 -28
- package/dist/extensions/testserver/commands/pool/list/metadata.d.ts +11 -0
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/list/metadata.js +7 -5
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/list/outcomes.js +1 -1
- package/dist/extensions/testserver/commands/pool/metadata.d.ts +3 -0
- package/dist/extensions/testserver/commands/pool/metadata.js +7 -0
- package/dist/extensions/testserver/commands/tree.d.ts +2 -0
- package/dist/extensions/testserver/commands/tree.js +6 -0
- package/dist/{resources → extensions}/testserver/credential-facts.d.ts +6 -40
- package/dist/{resources → extensions}/testserver/credential-facts.js +13 -35
- package/dist/extensions/testserver/definition.d.ts +57 -0
- package/dist/extensions/testserver/definition.js +71 -0
- package/dist/{resources → extensions}/testserver/events.d.ts +5 -4
- package/dist/extensions/testserver/events.js +4 -0
- package/dist/extensions/testserver/extension.d.ts +46 -0
- package/dist/extensions/testserver/extension.js +68 -0
- package/dist/extensions/testserver/index.d.ts +20 -0
- package/dist/extensions/testserver/index.js +31 -0
- package/dist/extensions/testserver/lifecycle.d.ts +24 -0
- package/dist/extensions/testserver/lifecycle.js +116 -0
- package/dist/{core → extensions/testserver}/limit.js +1 -0
- package/dist/extensions/testserver/live/world.d.ts +8 -0
- package/dist/extensions/testserver/live/world.js +38 -0
- package/dist/{resources/testserver/sandbox → extensions/testserver/options}/channels.d.ts +1 -1
- package/dist/extensions/testserver/options/index.d.ts +5 -0
- package/dist/extensions/testserver/options/index.js +11 -0
- package/dist/extensions/testserver/options/rules.d.ts +69 -0
- package/dist/extensions/testserver/options/rules.js +92 -0
- package/dist/extensions/testserver/options/sandboxes.d.ts +29 -0
- package/dist/extensions/testserver/options/sandboxes.js +33 -0
- package/dist/extensions/testserver/options/ttl.d.ts +23 -0
- package/dist/extensions/testserver/options/ttl.js +42 -0
- package/dist/{resources → extensions}/testserver/pool/channels.d.ts +3 -3
- package/dist/{resources → extensions}/testserver/pool/channels.js +2 -2
- package/dist/{resources → extensions}/testserver/pool/create.d.ts +1 -2
- package/dist/{resources → extensions}/testserver/pool/create.js +2 -1
- package/dist/{resources → extensions}/testserver/pool/index.d.ts +0 -1
- package/dist/{resources → extensions}/testserver/pool/index.js +2 -3
- package/dist/{resources → extensions}/testserver/pool/inspect.d.ts +1 -1
- package/dist/{resources → extensions}/testserver/pool/lease.d.ts +1 -1
- package/dist/extensions/testserver/pool/live/pool-store-gateway.d.ts +12 -0
- package/dist/{resources → extensions}/testserver/pool/live/pool-store-gateway.js +4 -4
- package/dist/{resources → extensions}/testserver/pool/pull-request.d.ts +8 -5
- package/dist/{resources → extensions}/testserver/pool/pull-request.js +2 -2
- package/dist/extensions/testserver/pr-build-facts.d.ts +156 -0
- package/dist/extensions/testserver/pr-build-facts.js +309 -0
- package/dist/extensions/testserver/presentation.d.ts +11 -0
- package/dist/{resources → extensions}/testserver/presentation.js +35 -56
- package/dist/{resources/testserver/lane.d.ts → extensions/testserver/progress.d.ts} +10 -6
- package/dist/{resources/testserver/lane.js → extensions/testserver/progress.js} +21 -16
- package/dist/extensions/testserver/provision.d.ts +160 -0
- package/dist/{resources/testserver/provider.js → extensions/testserver/provision.js} +80 -108
- package/dist/{resources → extensions}/testserver/pull-request/gateways.d.ts +1 -1
- package/dist/extensions/testserver/pull-request/gateways.js +5 -0
- package/dist/{resources → extensions}/testserver/pull-request/index.js +2 -2
- package/dist/{resources → extensions}/testserver/pull-request/live/github-token-gateway.d.ts +4 -4
- package/dist/{resources → extensions}/testserver/pull-request/live/github-token-gateway.js +4 -4
- package/dist/extensions/testserver/refusals.d.ts +72 -0
- package/dist/extensions/testserver/refusals.js +117 -0
- package/dist/extensions/testserver/release.d.ts +14 -0
- package/dist/extensions/testserver/release.js +26 -0
- package/dist/extensions/testserver/resource.d.ts +57 -0
- package/dist/extensions/testserver/resource.js +19 -0
- package/dist/extensions/testserver/result.d.ts +55 -0
- package/dist/extensions/testserver/result.js +98 -0
- package/dist/extensions/testserver/run/connection.d.ts +21 -0
- package/dist/extensions/testserver/run/connection.js +39 -0
- package/dist/extensions/testserver/run-sandbox.d.ts +16 -0
- package/dist/extensions/testserver/run-sandbox.js +11 -0
- package/dist/{resources → extensions}/testserver/sandbox/create.d.ts +1 -11
- package/dist/{resources → extensions}/testserver/sandbox/create.js +0 -15
- package/dist/{resources → extensions}/testserver/sandbox/gateways.d.ts +1 -1
- package/dist/{resources → extensions}/testserver/sandbox/index.d.ts +1 -3
- package/dist/extensions/testserver/sandbox/index.js +6 -0
- package/dist/extensions/testserver/testserver-sdk.d.ts +1 -0
- package/dist/extensions/testserver/testserver-sdk.js +4 -0
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/arguments.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/context.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/driver.d.ts +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/gateways.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/index.js +4 -4
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/invocation.d.ts +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/invocation.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/redaction.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/report.d.ts +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/report.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/verbose.js +1 -1
- package/dist/extensions/testserver/vitest/config.d.ts +30 -0
- package/dist/extensions/testserver/vitest/config.js +41 -0
- package/dist/{vitest → extensions/testserver/vitest}/container-scope.d.ts +25 -14
- package/dist/{vitest → extensions/testserver/vitest}/container-scope.js +55 -17
- package/dist/extensions/testserver/vitest/container-start.d.ts +19 -0
- package/dist/extensions/testserver/vitest/container-start.js +31 -0
- package/dist/{vitest → extensions/testserver/vitest}/diagnostics.d.ts +66 -29
- package/dist/{vitest → extensions/testserver/vitest}/diagnostics.js +146 -50
- package/dist/{vitest → extensions/testserver/vitest}/fixtures.d.ts +7 -5
- package/dist/{vitest → extensions/testserver/vitest}/fixtures.js +69 -26
- package/dist/extensions/testserver/vitest/index.d.ts +3 -0
- package/dist/extensions/testserver/vitest/index.js +10 -0
- package/dist/extensions/testserver/vitest/sandbox.d.ts +25 -0
- package/dist/extensions/testserver/vitest/sandbox.js +43 -0
- package/dist/{vitest → extensions/testserver/vitest}/types.d.ts +1 -1
- package/dist/extensions/testserver/world.d.ts +25 -0
- package/dist/extensions/testserver/world.js +4 -0
- package/dist/extensions.d.ts +144 -0
- package/dist/extensions.js +41 -0
- package/dist/forward-sigterm.d.ts +8 -0
- package/dist/forward-sigterm.js +18 -0
- package/dist/help-logo.js +5 -5
- package/dist/launch.js +46 -0
- package/dist/launcher-resolvers/index.d.ts +2 -0
- package/dist/launcher-resolvers/index.js +8 -0
- package/dist/launcher-resolvers/local-services.d.ts +57 -0
- package/dist/launcher-resolvers/local-services.js +7 -0
- package/dist/live-app.js +12 -7
- package/dist/local-services.d.ts +19 -0
- package/dist/local-services.js +37 -0
- package/dist/presentation.js +2 -2
- package/dist/run-directory/gateways.d.ts +167 -0
- package/dist/run-directory/gateways.js +2 -0
- package/dist/run-directory/index.d.ts +8 -0
- package/dist/run-directory/index.js +13 -0
- package/dist/run-directory/plan.d.ts +35 -0
- package/dist/run-directory/plan.js +24 -0
- package/dist/run-directory/reader.d.ts +70 -0
- package/dist/run-directory/reader.js +51 -0
- package/dist/run-directory/recording.d.ts +92 -0
- package/dist/run-directory/recording.js +85 -0
- package/dist/run-directory/run-collector.d.ts +36 -0
- package/dist/{commands/exec → run-directory}/run-collector.js +10 -12
- package/dist/{core → run-directory}/run-directory.d.ts +13 -14
- package/dist/{core → run-directory}/run-directory.js +11 -11
- package/dist/{commands/exec → run-directory}/run-record.d.ts +92 -61
- package/dist/run-directory/run-record.js +209 -0
- package/dist/run-directory/timeline-facts.d.ts +53 -0
- package/dist/run-directory/timeline-facts.js +76 -0
- package/dist/runner/base.js +1 -1
- package/dist/runner/context.js +1 -1
- package/dist/runner/events.d.ts +6 -5
- package/dist/runner/events.js +1 -1
- package/dist/runner/gateways.d.ts +11 -11
- package/dist/runner/gateways.js +1 -1
- package/dist/runner/index.d.ts +13 -17
- package/dist/runner/index.js +10 -14
- package/dist/runner/live/sandbox-gateway.js +4 -4
- package/dist/runner/live/terminal.d.ts +1 -1
- package/dist/runner/live/terminal.js +1 -1
- package/dist/runner/prepare.d.ts +40 -17
- package/dist/runner/prepare.js +17 -11
- package/dist/runner/ready.js +2 -2
- package/dist/runner/recipe.d.ts +38 -20
- package/dist/runner/recipe.js +31 -17
- package/dist/runner/{remote-command.d.ts → sandboxed-command.d.ts} +18 -19
- package/dist/runner/{remote-command.js → sandboxed-command.js} +21 -22
- package/dist/runner/scope.d.ts +21 -14
- package/dist/runner/scope.js +12 -10
- package/dist/runner/secrets.js +1 -1
- package/dist/runner/session.d.ts +100 -0
- package/dist/runner/session.js +109 -0
- package/dist/runner/snapshot-key.d.ts +1 -1
- package/dist/runner/snapshot-key.js +4 -4
- package/dist/runner/snapshot-save.d.ts +3 -2
- package/dist/runner/snapshot-save.js +8 -7
- package/dist/sdk/extension/ci.d.ts +2 -0
- package/dist/sdk/extension/ci.js +6 -0
- package/dist/sdk/extension/commands.d.ts +69 -0
- package/dist/sdk/extension/commands.js +31 -0
- package/dist/{credential/diagnosis.d.ts → sdk/extension/credential-diagnosis.d.ts} +1 -7
- package/dist/{credential/diagnosis.js → sdk/extension/credential-diagnosis.js} +2 -11
- package/dist/sdk/extension/credential-source.d.ts +132 -0
- package/dist/sdk/extension/credential-source.js +5 -0
- package/dist/{credential → sdk/extension}/credential.d.ts +8 -7
- package/dist/{credential → sdk/extension}/credential.js +9 -6
- package/dist/sdk/extension/index.d.ts +16 -0
- package/dist/sdk/extension/index.js +40 -0
- package/dist/sdk/extension/launcher-supplies.d.ts +24 -0
- package/dist/sdk/extension/launcher-supplies.js +3 -0
- package/dist/sdk/extension/lifecycle.d.ts +212 -0
- package/dist/sdk/extension/lifecycle.js +9 -0
- package/dist/sdk/extension/presentation.d.ts +31 -0
- package/dist/sdk/extension/presentation.js +7 -0
- package/dist/sdk/extension/progress.d.ts +75 -0
- package/dist/sdk/extension/progress.js +8 -0
- package/dist/sdk/extension/reports.d.ts +15 -0
- package/dist/sdk/extension/reports.js +5 -0
- package/dist/sdk/extension/resource-definition.d.ts +204 -0
- package/dist/sdk/extension/resource-definition.js +24 -0
- package/dist/sdk/extension/resource-factory.d.ts +10 -0
- package/dist/sdk/extension/resource-factory.js +15 -0
- package/dist/sdk/extension/resource.d.ts +60 -0
- package/dist/sdk/extension/resource.js +42 -0
- package/dist/sdk/extension/rules.d.ts +16 -0
- package/dist/sdk/extension/rules.js +30 -0
- package/dist/sdk/extension/span.d.ts +8 -0
- package/dist/sdk/extension/span.js +4 -0
- package/dist/sdk/extension/time.d.ts +11 -0
- package/dist/sdk/extension/time.js +4 -0
- package/dist/sdk/extension/token-request-facts.d.ts +39 -0
- package/dist/sdk/extension/token-request-facts.js +35 -0
- package/dist/sdk/index.d.ts +4 -7
- package/dist/sdk/index.js +7 -15
- package/dist/sdk/run/contract.d.ts +32 -0
- package/dist/sdk/run/contract.js +12 -0
- package/dist/sdk/run/launcher.d.ts +5 -0
- package/dist/sdk/run/launcher.js +6 -0
- package/dist/sdk/run/payload.d.ts +58 -0
- package/dist/sdk/run/payload.js +73 -0
- package/dist/sdk/run/present.d.ts +11 -0
- package/dist/sdk/run/present.js +4 -0
- package/dist/sdk/run/redact.d.ts +5 -0
- package/dist/sdk/run/redact.js +12 -0
- package/dist/story/align.d.ts +1 -1
- package/dist/story/align.js +1 -1
- package/dist/story/command-line.d.ts +6 -16
- package/dist/story/command-line.js +11 -23
- package/dist/story/errors.d.ts +1 -1
- package/dist/story/errors.js +1 -1
- package/dist/story/host.d.ts +1 -1
- package/dist/story/host.js +2 -2
- package/dist/story/index.d.ts +2 -2
- package/dist/story/index.js +4 -3
- package/dist/story/launch.d.ts +70 -0
- package/dist/story/launch.js +77 -0
- package/dist/story/report.d.ts +2 -2
- package/dist/story/report.js +3 -4
- package/dist/story/settle.d.ts +7 -7
- package/dist/story/settle.js +5 -5
- package/dist/story/start.d.ts +2 -2
- package/dist/time/duration.js +2 -2
- package/dist/time/index.js +2 -1
- package/dist/time/time.d.ts +2 -11
- package/dist/time/time.js +2 -2
- package/dist/{sdk → vendor/testserver-sdk}/container/api-request.d.ts +14 -2
- package/dist/vendor/testserver-sdk/container/api-request.js +68 -0
- package/dist/vendor/testserver-sdk/container/container.d.ts +199 -0
- package/dist/vendor/testserver-sdk/container/container.js +458 -0
- package/dist/vendor/testserver-sdk/container/external.d.ts +111 -0
- package/dist/vendor/testserver-sdk/container/external.js +76 -0
- package/dist/vendor/testserver-sdk/container/gateways.d.ts +156 -0
- package/dist/{sdk → vendor/testserver-sdk}/container/index.d.ts +2 -1
- package/dist/{sdk → vendor/testserver-sdk}/container/index.js +2 -1
- package/dist/vendor/testserver-sdk/container/live/container-gateway.d.ts +22 -0
- package/dist/vendor/testserver-sdk/container/live/container-gateway.js +165 -0
- package/dist/vendor/testserver-sdk/container/recorder.d.ts +69 -0
- package/dist/vendor/testserver-sdk/container/recorder.js +121 -0
- package/dist/{sdk → vendor/testserver-sdk}/factories/build.d.ts +33 -12
- package/dist/{sdk → vendor/testserver-sdk}/factories/build.js +36 -14
- package/dist/vendor/testserver-sdk/factories/definition.d.ts +39 -0
- package/dist/{sdk → vendor/testserver-sdk}/factories/definition.js +1 -1
- package/dist/{sdk → vendor/testserver-sdk}/factories/definitions.d.ts +7 -4
- package/dist/{sdk → vendor/testserver-sdk}/factories/definitions.js +10 -0
- package/dist/vendor/testserver-sdk/factories/gateways.d.ts +31 -0
- package/dist/vendor/testserver-sdk/factories/index.d.ts +4 -0
- package/dist/{sdk → vendor/testserver-sdk}/factories/index.js +3 -3
- package/dist/vendor/testserver-sdk/index.d.ts +6 -0
- package/dist/vendor/testserver-sdk/index.js +11 -0
- package/dist/{sdk → vendor/testserver-sdk}/proxy/exchange.d.ts +2 -1
- package/dist/{sdk → vendor/testserver-sdk}/proxy/exchange.js +8 -4
- package/dist/{sdk → vendor/testserver-sdk}/proxy/faulted-exchange.js +7 -2
- package/dist/{sdk → vendor/testserver-sdk}/proxy/faults.d.ts +2 -1
- package/dist/{sdk → vendor/testserver-sdk}/proxy/records.d.ts +10 -1
- package/dist/{sdk → vendor/testserver-sdk}/proxy/records.js +13 -0
- package/dist/{sdk → vendor/testserver-sdk}/records/index.d.ts +1 -1
- package/dist/{sdk → vendor/testserver-sdk}/records/records.d.ts +17 -1
- package/dist/vendor/testserver-sdk/testserver/external-ids.d.ts +38 -0
- package/dist/vendor/testserver-sdk/testserver/external-ids.js +46 -0
- package/dist/vendor/testserver-sdk/testserver/failure.d.ts +102 -0
- package/dist/vendor/testserver-sdk/testserver/failure.js +109 -0
- package/dist/vendor/testserver-sdk/testserver/index.d.ts +7 -0
- package/dist/vendor/testserver-sdk/testserver/index.js +11 -0
- package/dist/{sdk → vendor/testserver-sdk}/testserver/live/request.d.ts +8 -10
- package/dist/{sdk → vendor/testserver-sdk}/testserver/live/request.js +8 -6
- package/dist/vendor/testserver-sdk/testserver/routes.d.ts +60 -0
- package/dist/vendor/testserver-sdk/testserver/routes.js +84 -0
- package/dist/vendor/testserver-sdk/testserver/service-ids.d.ts +31 -0
- package/dist/{sdk → vendor/testserver-sdk}/testserver/service-ids.js +27 -4
- package/dist/vitest/config.d.ts +2 -28
- package/dist/vitest/config.js +6 -36
- package/dist/vitest/gateways.js +1 -1
- package/dist/vitest/index.d.ts +2 -3
- package/dist/vitest/index.js +5 -9
- package/dist/vitest/plan.d.ts +1 -16
- package/dist/vitest/plan.js +4 -36
- package/dist/vitest/test-events.d.ts +1 -18
- package/dist/vitest/test-events.js +2 -31
- package/package.json +52 -23
- package/skills/overview.md +12 -9
- package/skills/read-run-output.md +26 -3
- package/skills/testserver-builds.md +8 -8
- package/dist/chunks/chunk-5CQCRX2L.js +0 -5768
- package/dist/chunks/chunk-5U5Q6VZR.js +0 -556
- package/dist/chunks/chunk-7O6UN63H.js +0 -63
- package/dist/chunks/chunk-NX55IJ5S.js +0 -1842
- package/dist/chunks/chunk-OCZJE5XV.js +0 -910
- package/dist/chunks/chunk-RRQ2ZGSE.js +0 -1512
- package/dist/chunks/chunk-S5NAIZYS.js +0 -13
- package/dist/chunks/chunk-UHO5OCEX.js +0 -360
- package/dist/chunks/chunk-WBIHJM7D.js +0 -188
- package/dist/combine-errors.d.ts +0 -11
- package/dist/combine-errors.js +0 -19
- package/dist/commands/exec/run-collector.d.ts +0 -30
- package/dist/commands/exec/run-record.js +0 -152
- package/dist/commands/exec/testserver-flags.d.ts +0 -48
- package/dist/commands/exec/testserver-flags.js +0 -80
- package/dist/config/by-name.d.ts +0 -24
- package/dist/config/by-name.js +0 -26
- package/dist/config/resource-config.d.ts +0 -132
- package/dist/config/resource-config.js +0 -19
- package/dist/config/set.d.ts +0 -27
- package/dist/config/set.js +0 -71
- package/dist/core/command-provider.d.ts +0 -126
- package/dist/core/command-provider.js +0 -13
- package/dist/core/command-slots.d.ts +0 -73
- package/dist/core/command-slots.js +0 -140
- package/dist/core/keyed.d.ts +0 -12
- package/dist/core/keyed.js +0 -24
- package/dist/core/lane.d.ts +0 -46
- package/dist/core/lane.js +0 -5
- package/dist/core/mint.d.ts +0 -10
- package/dist/core/mint.js +0 -14
- package/dist/core/presentation.d.ts +0 -87
- package/dist/core/presentation.js +0 -5
- package/dist/core/provider.d.ts +0 -79
- package/dist/core/provider.js +0 -5
- package/dist/resource-commands.d.ts +0 -13
- package/dist/resource-commands.js +0 -22
- package/dist/resources/github/cleanup.d.ts +0 -23
- package/dist/resources/github/cleanup.js +0 -39
- package/dist/resources/github/command.d.ts +0 -126
- package/dist/resources/github/command.js +0 -117
- package/dist/resources/github/config.d.ts +0 -16
- package/dist/resources/github/config.js +0 -37
- package/dist/resources/github/events.d.ts +0 -26
- package/dist/resources/github/events.js +0 -2
- package/dist/resources/github/index.d.ts +0 -12
- package/dist/resources/github/index.js +0 -15
- package/dist/resources/github/live/gateways.d.ts +0 -6
- package/dist/resources/github/live/gateways.js +0 -13
- package/dist/resources/github/presentation.d.ts +0 -13
- package/dist/resources/github/presentation.js +0 -43
- package/dist/resources/github/provider.d.ts +0 -66
- package/dist/resources/github/provider.js +0 -58
- package/dist/resources/github/resource-provider.d.ts +0 -6
- package/dist/resources/github/resource-provider.js +0 -20
- package/dist/resources/github/resource.d.ts +0 -33
- package/dist/resources/github/resource.js +0 -12
- package/dist/resources/testserver/cleanup.d.ts +0 -14
- package/dist/resources/testserver/cleanup.js +0 -22
- package/dist/resources/testserver/command-tree.d.ts +0 -4
- package/dist/resources/testserver/command-tree.js +0 -12
- package/dist/resources/testserver/command.d.ts +0 -520
- package/dist/resources/testserver/command.js +0 -252
- package/dist/resources/testserver/commands/app.d.ts +0 -18
- package/dist/resources/testserver/commands/app.js +0 -3
- package/dist/resources/testserver/commands/create/metadata.d.ts +0 -31
- package/dist/resources/testserver/commands/create/metadata.js +0 -53
- package/dist/resources/testserver/commands/list/metadata.d.ts +0 -9
- package/dist/resources/testserver/config.d.ts +0 -18
- package/dist/resources/testserver/config.js +0 -88
- package/dist/resources/testserver/events.js +0 -4
- package/dist/resources/testserver/index.d.ts +0 -16
- package/dist/resources/testserver/index.js +0 -25
- package/dist/resources/testserver/live/gateways.d.ts +0 -8
- package/dist/resources/testserver/live/gateways.js +0 -39
- package/dist/resources/testserver/options.d.ts +0 -5
- package/dist/resources/testserver/options.js +0 -5
- package/dist/resources/testserver/pool/directory.d.ts +0 -4
- package/dist/resources/testserver/pool/directory.js +0 -5
- package/dist/resources/testserver/pool/live/pool-store-gateway.d.ts +0 -12
- package/dist/resources/testserver/pr-build-facts.d.ts +0 -130
- package/dist/resources/testserver/pr-build-facts.js +0 -261
- package/dist/resources/testserver/presentation.d.ts +0 -9
- package/dist/resources/testserver/provider.d.ts +0 -187
- package/dist/resources/testserver/pull-request/gateways.js +0 -5
- package/dist/resources/testserver/ran.d.ts +0 -92
- package/dist/resources/testserver/ran.js +0 -156
- package/dist/resources/testserver/resource-provider.d.ts +0 -12
- package/dist/resources/testserver/resource-provider.js +0 -32
- package/dist/resources/testserver/resource.d.ts +0 -36
- package/dist/resources/testserver/resource.js +0 -10
- package/dist/resources/testserver/run-sandbox.d.ts +0 -13
- package/dist/resources/testserver/run-sandbox.js +0 -6
- package/dist/resources/testserver/sandbox/index.js +0 -8
- package/dist/resources.d.ts +0 -702
- package/dist/resources.js +0 -83
- package/dist/sdk/container/api-request.js +0 -46
- package/dist/sdk/container/container.d.ts +0 -144
- package/dist/sdk/container/container.js +0 -346
- package/dist/sdk/container/gateways.d.ts +0 -108
- package/dist/sdk/container/live/container-gateway.d.ts +0 -17
- package/dist/sdk/container/live/container-gateway.js +0 -114
- package/dist/sdk/factories/definition.d.ts +0 -28
- package/dist/sdk/factories/gateways.d.ts +0 -25
- package/dist/sdk/factories/index.d.ts +0 -5
- package/dist/sdk/factories/live/factory-gateway.d.ts +0 -10
- package/dist/sdk/factories/live/factory-gateway.js +0 -29
- package/dist/sdk/host.d.ts +0 -2
- package/dist/sdk/host.js +0 -7
- package/dist/sdk/payload/index.d.ts +0 -2
- package/dist/sdk/payload/index.js +0 -4
- package/dist/sdk/payload/payload.d.ts +0 -47
- package/dist/sdk/payload/payload.js +0 -74
- package/dist/sdk/testserver/failure.d.ts +0 -73
- package/dist/sdk/testserver/failure.js +0 -61
- package/dist/sdk/testserver/index.d.ts +0 -5
- package/dist/sdk/testserver/index.js +0 -8
- package/dist/sdk/testserver/service-ids.d.ts +0 -19
- package/dist/story/mode.d.ts +0 -17
- package/dist/story/mode.js +0 -21
- package/dist/vitest/sandbox.d.ts +0 -22
- package/dist/vitest/sandbox.js +0 -41
- /package/dist/{credential/settle.js → config/credential-settle.js} +0 -0
- /package/dist/{resources → extensions}/github/gateways.d.ts +0 -0
- /package/dist/{resources → extensions}/github/gateways.js +0 -0
- /package/dist/{resources → extensions}/github/live/fixture-repo-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/github/live/fixture-repo-gateway.js +0 -0
- /package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/list/outcomes.d.ts +0 -0
- /package/dist/{core → extensions/testserver}/limit.d.ts +0 -0
- /package/dist/{resources/testserver/sandbox → extensions/testserver/options}/build-reference.d.ts +0 -0
- /package/dist/{resources/testserver/sandbox → extensions/testserver/options}/build-reference.js +0 -0
- /package/dist/{resources/testserver/sandbox → extensions/testserver/options}/channels.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/gateways.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pool/gateways.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/host.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pool/host.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/inspect.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/lease.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/live/pool-records.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pool/live/pool-records.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/staleness.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pool/staleness.js +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/index.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/github-rest.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/github-rest.js +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/pull-request-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/pull-request-gateway.js +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/testserver-workflow-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/testserver-workflow-gateway.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/create-failure.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/create-failure.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/gateways.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/builds-response.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/builds-response.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/control-plane-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/control-plane-gateway.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/create-response.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/create-response.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/fetch-failure.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/fetch-failure.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/health-check-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/health-check-gateway.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/sse.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/sse.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/ansi.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/ansi.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/arguments.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/auth-config.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/auth-config.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/clock.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/clock.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/config-files.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/config-files.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/context.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/driver.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/entry.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/entry.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/environment.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/environment.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/errors.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/errors.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/gateways.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/index.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/keys.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/keys.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/live/config-files.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/live/config-files.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/live/process-gateway.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/live/process-gateway.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/redaction.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/verbose.d.ts +0 -0
- /package/dist/{vitest → extensions/testserver/vitest}/types.js +0 -0
- /package/dist/{core → run-directory}/live/run-directory-gateway.d.ts +0 -0
- /package/dist/{core → run-directory}/live/run-directory-gateway.js +0 -0
- /package/dist/sdk/{payload → run}/test-events.d.ts +0 -0
- /package/dist/sdk/{payload → run}/test-events.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/container/feature-flags.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/container/feature-flags.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/container/gateways.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/factories/gateways.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/faulted-exchange.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/faults.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/index.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/index.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/proxy.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/proxy.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/records/body.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/records/body.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/records/index.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/records/records.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/seed/index.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/seed/index.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/seed/seed.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/seed/seed.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/clock.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/clock.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/live/connect-failure.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/live/connect-failure.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/test-id.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/test-id.js +0 -0
|
@@ -1,910 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEFAULT_TTL_MINUTES,
|
|
3
|
-
TESTSERVER_REPO,
|
|
4
|
-
buildReferenceText,
|
|
5
|
-
checkRecipe,
|
|
6
|
-
describeTokenRequestFailure,
|
|
7
|
-
parseBuildReference,
|
|
8
|
-
parseDuration,
|
|
9
|
-
parseTtl,
|
|
10
|
-
rejectedCredentialFix,
|
|
11
|
-
shortSha
|
|
12
|
-
} from "./chunk-5CQCRX2L.js";
|
|
13
|
-
|
|
14
|
-
// src/config/load.ts
|
|
15
|
-
import { dirname, join } from "node:path";
|
|
16
|
-
|
|
17
|
-
// src/config/by-name.ts
|
|
18
|
-
function givenResourcesByName(_configs, values) {
|
|
19
|
-
return values;
|
|
20
|
-
}
|
|
21
|
-
function givenOptionsOf(_config, values) {
|
|
22
|
-
return values;
|
|
23
|
-
}
|
|
24
|
-
function resolvedResourcesByName(_configs, values) {
|
|
25
|
-
return values;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// src/config/schema.ts
|
|
29
|
-
var CONFIG_FILE_NAME = "storm.config.ts";
|
|
30
|
-
function wrongValue(problem) {
|
|
31
|
-
return { ok: false, problems: [{ path: [], problem }] };
|
|
32
|
-
}
|
|
33
|
-
function checkNonEmptyString(value) {
|
|
34
|
-
return typeof value === "string" && value.length > 0 ? { ok: true, value } : wrongValue(`must be a non-empty string, not ${describeValue(value)}`);
|
|
35
|
-
}
|
|
36
|
-
function checkBoolean(value) {
|
|
37
|
-
return typeof value === "boolean" ? { ok: true, value } : wrongValue(`must be true or false, not ${describeValue(value)}`);
|
|
38
|
-
}
|
|
39
|
-
var SETTING_CHECKS = {
|
|
40
|
-
scope: checkNonEmptyString,
|
|
41
|
-
project: checkNonEmptyString,
|
|
42
|
-
runner: checkRecipe
|
|
43
|
-
};
|
|
44
|
-
function isConfigSettingKey(key) {
|
|
45
|
-
return Object.hasOwn(SETTING_CHECKS, key);
|
|
46
|
-
}
|
|
47
|
-
function checkSettingValue(key, value) {
|
|
48
|
-
return SETTING_CHECKS[key](value);
|
|
49
|
-
}
|
|
50
|
-
function describeValue(value) {
|
|
51
|
-
if (typeof value === "string") return JSON.stringify(value);
|
|
52
|
-
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
53
|
-
if (value === null) return "null";
|
|
54
|
-
if (value === void 0) return "undefined";
|
|
55
|
-
if (typeof value === "function") return "a function";
|
|
56
|
-
if (Array.isArray(value)) return "an array";
|
|
57
|
-
return typeof value === "object" ? "an object" : `a ${typeof value}`;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// src/config/load.ts
|
|
61
|
-
async function findConfigFile(gateway, startDirectory) {
|
|
62
|
-
if (await gateway.hasConfigFile(startDirectory)) return join(startDirectory, CONFIG_FILE_NAME);
|
|
63
|
-
const root = await worktreeRoot(gateway, startDirectory);
|
|
64
|
-
if (root === void 0) return void 0;
|
|
65
|
-
for (let directory = startDirectory; directory !== root; ) {
|
|
66
|
-
directory = dirname(directory);
|
|
67
|
-
if (await gateway.hasConfigFile(directory)) return join(directory, CONFIG_FILE_NAME);
|
|
68
|
-
}
|
|
69
|
-
return void 0;
|
|
70
|
-
}
|
|
71
|
-
async function worktreeRoot(gateway, directory) {
|
|
72
|
-
for (let current = directory; ; current = dirname(current)) {
|
|
73
|
-
if (await gateway.isWorktreeRoot(current)) return current;
|
|
74
|
-
if (dirname(current) === current) return void 0;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
async function loadConfig(gateway, startDirectory, configs) {
|
|
78
|
-
const path = await findConfigFile(gateway, startDirectory);
|
|
79
|
-
if (path === void 0) return { kind: "none" };
|
|
80
|
-
const imported = await gateway.importConfig(path);
|
|
81
|
-
switch (imported.kind) {
|
|
82
|
-
case "import-failed":
|
|
83
|
-
return {
|
|
84
|
-
kind: "invalid",
|
|
85
|
-
path,
|
|
86
|
-
problems: [{ key: null, location: imported.location ?? null, problem: imported.message }]
|
|
87
|
-
};
|
|
88
|
-
case "no-default-export":
|
|
89
|
-
return {
|
|
90
|
-
kind: "invalid",
|
|
91
|
-
path,
|
|
92
|
-
problems: [fileProblem("has no default export; export default defineConfig({ \u2026 })")]
|
|
93
|
-
};
|
|
94
|
-
case "default-export":
|
|
95
|
-
return checkFile(path, imported.value, configs);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
function checkFile(path, value, configs) {
|
|
99
|
-
if (!isRecord(value))
|
|
100
|
-
return {
|
|
101
|
-
kind: "invalid",
|
|
102
|
-
path,
|
|
103
|
-
problems: [fileProblem(`must default-export an object, not ${describeValue(value)}`)]
|
|
104
|
-
};
|
|
105
|
-
const settings = {};
|
|
106
|
-
const problems = [];
|
|
107
|
-
let resources = {};
|
|
108
|
-
for (const [key, keyValue] of Object.entries(value)) {
|
|
109
|
-
if (key === "resources") resources = checkResources(keyValue, configs, problems);
|
|
110
|
-
else if (isConfigSettingKey(key)) {
|
|
111
|
-
if (keyValue !== void 0) checkSetting(key, keyValue, settings, problems);
|
|
112
|
-
} else problems.push({ key, location: null, problem: `is not a ${CONFIG_FILE_NAME} key` });
|
|
113
|
-
}
|
|
114
|
-
if (problems.length > 0) return { kind: "invalid", path, problems };
|
|
115
|
-
return {
|
|
116
|
-
kind: "loaded",
|
|
117
|
-
path,
|
|
118
|
-
values: { settings, resources: givenResourcesByName(configs, resources) }
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function checkSetting(key, value, settings, problems) {
|
|
122
|
-
const checked = checkSettingValue(key, value);
|
|
123
|
-
if (checked.ok) Object.assign(settings, { [key]: checked.value });
|
|
124
|
-
else
|
|
125
|
-
for (const { path: inside, problem } of checked.problems)
|
|
126
|
-
problems.push({ key: [key, ...inside].join("."), location: null, problem });
|
|
127
|
-
}
|
|
128
|
-
function checkResources(value, configs, problems) {
|
|
129
|
-
if (value === void 0) return {};
|
|
130
|
-
if (!isRecord(value)) {
|
|
131
|
-
problems.push({ key: "resources", location: null, problem: `must be an object, not ${describeValue(value)}` });
|
|
132
|
-
return {};
|
|
133
|
-
}
|
|
134
|
-
const byName = new Map(configs.map((config) => [config.name, config]));
|
|
135
|
-
const holds = configs.length === 0 ? "none" : configs.map((each) => each.name).join(", ");
|
|
136
|
-
const found = {};
|
|
137
|
-
for (const [name, resource] of Object.entries(value)) {
|
|
138
|
-
const config = byName.get(name);
|
|
139
|
-
if (config === void 0) {
|
|
140
|
-
problems.push({
|
|
141
|
-
key: `resources.${name}`,
|
|
142
|
-
location: null,
|
|
143
|
-
problem: `is not a resource; resources holds ${holds}`
|
|
144
|
-
});
|
|
145
|
-
continue;
|
|
146
|
-
}
|
|
147
|
-
if (resource === void 0) continue;
|
|
148
|
-
const options = checkResource(config, resource, problems);
|
|
149
|
-
if (options !== void 0) found[name] = options;
|
|
150
|
-
}
|
|
151
|
-
return found;
|
|
152
|
-
}
|
|
153
|
-
function checkResource(config, value, problems) {
|
|
154
|
-
const { name, factory } = config;
|
|
155
|
-
const options = isRecord(value) && value["kind"] === factory.kind ? value["options"] : void 0;
|
|
156
|
-
if (!isRecord(options)) {
|
|
157
|
-
problems.push({
|
|
158
|
-
key: `resources.${name}`,
|
|
159
|
-
location: null,
|
|
160
|
-
problem: `must be made by ${factory.call} from ${factory.subpath}, not ${describeValue(value)}`
|
|
161
|
-
});
|
|
162
|
-
return void 0;
|
|
163
|
-
}
|
|
164
|
-
const checked = {};
|
|
165
|
-
let valid = true;
|
|
166
|
-
for (const [option, optionValue] of Object.entries(options)) {
|
|
167
|
-
const key = `resources.${name}.${option}`;
|
|
168
|
-
const rule = Object.hasOwn(config.options, option) ? config.options[option] : void 0;
|
|
169
|
-
if (rule === void 0) {
|
|
170
|
-
valid = false;
|
|
171
|
-
problems.push({ key, location: null, problem: `is not a ${name} option` });
|
|
172
|
-
continue;
|
|
173
|
-
}
|
|
174
|
-
if (optionValue === void 0) continue;
|
|
175
|
-
const result = rule.check(optionValue);
|
|
176
|
-
if (result.ok) checked[option] = result.value;
|
|
177
|
-
else {
|
|
178
|
-
valid = false;
|
|
179
|
-
for (const { path: inside, problem } of result.problems)
|
|
180
|
-
problems.push({ key: [key, ...inside].join("."), location: null, problem });
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return valid ? givenOptionsOf(config, checked) : void 0;
|
|
184
|
-
}
|
|
185
|
-
function isRecord(value) {
|
|
186
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
187
|
-
}
|
|
188
|
-
function fileProblem(problem) {
|
|
189
|
-
return { key: null, location: null, problem };
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// src/config/resource-config.ts
|
|
193
|
-
function optionKeyPath(resource, option) {
|
|
194
|
-
return ["resources", resource, option].join(".");
|
|
195
|
-
}
|
|
196
|
-
function readBooleanText(text) {
|
|
197
|
-
return text === "true" ? true : text === "false" ? false : text;
|
|
198
|
-
}
|
|
199
|
-
function readWholeNumberText(text) {
|
|
200
|
-
return /^\d+$/.test(text) ? Number(text) : text;
|
|
201
|
-
}
|
|
202
|
-
function readTextAsIs(text) {
|
|
203
|
-
return text;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
// src/config/resolve.ts
|
|
207
|
-
function resolveSettings(flags, file) {
|
|
208
|
-
const pick = (flag, fromFile) => flag !== void 0 ? { value: flag, source: "flag" } : fromFile === void 0 ? void 0 : { value: fromFile, source: "file" };
|
|
209
|
-
return {
|
|
210
|
-
scope: pick(flags.scope, file?.scope),
|
|
211
|
-
project: pick(flags.project, file?.project),
|
|
212
|
-
runner: pick(void 0, file?.runner)
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
function mergeResourceOptions(config, file, flags) {
|
|
216
|
-
const fromFile = file ?? {};
|
|
217
|
-
const fromFlags = flags ?? {};
|
|
218
|
-
const merged = {};
|
|
219
|
-
const problems = [];
|
|
220
|
-
for (const [option, rule] of Object.entries(config.options)) {
|
|
221
|
-
const flag = fromFlags[option];
|
|
222
|
-
const given = fromFile[option];
|
|
223
|
-
if (flag !== void 0) merged[option] = { value: flag, source: "flag" };
|
|
224
|
-
else if (given !== void 0) merged[option] = { value: given, source: "file" };
|
|
225
|
-
else if (rule.default !== void 0) merged[option] = { value: rule.default, source: "default" };
|
|
226
|
-
else if (rule.required === true) {
|
|
227
|
-
const key = optionKeyPath(config.name, option);
|
|
228
|
-
problems.push({
|
|
229
|
-
key,
|
|
230
|
-
problem: `is required; give it in ${config.factory.call} or with --set ${key}=<value>`,
|
|
231
|
-
values: []
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
if (problems.length > 0) return { ok: false, problems };
|
|
236
|
-
return { ok: true, value: merged };
|
|
237
|
-
}
|
|
238
|
-
function resolveResourceOptions(configs, file, sets) {
|
|
239
|
-
const fromFile = file ?? {};
|
|
240
|
-
const fromSets = sets;
|
|
241
|
-
const resolved = {};
|
|
242
|
-
const problems = [];
|
|
243
|
-
for (const config of configs) {
|
|
244
|
-
const given = fromFile[config.name];
|
|
245
|
-
const set = fromSets[config.name];
|
|
246
|
-
if (given === void 0 && set === void 0) continue;
|
|
247
|
-
const merged = mergeResourceOptions(config, given, set);
|
|
248
|
-
if (!merged.ok) {
|
|
249
|
-
problems.push(...merged.problems);
|
|
250
|
-
continue;
|
|
251
|
-
}
|
|
252
|
-
const settings = merged.value;
|
|
253
|
-
const result = config.resolve(merged.value);
|
|
254
|
-
if (result.ok) resolved[config.name] = result.value;
|
|
255
|
-
else
|
|
256
|
-
for (const { option, problem, involves } of result.problems)
|
|
257
|
-
problems.push({
|
|
258
|
-
key: optionKeyPath(config.name, option),
|
|
259
|
-
problem,
|
|
260
|
-
values: involves.flatMap((each) => {
|
|
261
|
-
const setting = settings[each];
|
|
262
|
-
return setting === void 0 ? [] : [{ key: optionKeyPath(config.name, each), value: setting.value, source: setting.source }];
|
|
263
|
-
})
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
if (problems.length > 0) return { ok: false, problems };
|
|
267
|
-
return { ok: true, value: resolvedResourcesByName(configs, resolved) };
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
// src/config/settings-file.ts
|
|
271
|
-
import { refused } from "@vercel/clinkr";
|
|
272
|
-
|
|
273
|
-
// src/config/errors.ts
|
|
274
|
-
import { defineErrors } from "@vercel/clinkr";
|
|
275
|
-
import { z } from "zod";
|
|
276
|
-
var problemSchema = z.object({
|
|
277
|
-
/** The key the problem is about; null when it is about the whole file. */
|
|
278
|
-
key: z.string().nullable(),
|
|
279
|
-
/** Where Node said the import failed; null otherwise. */
|
|
280
|
-
location: z.object({ line: z.number(), column: z.number().nullable() }).nullable(),
|
|
281
|
-
/** What is wrong, worded to follow the key, or the file name when there is no key. */
|
|
282
|
-
problem: z.string()
|
|
283
|
-
});
|
|
284
|
-
function configProblemLine(file, { key, location, problem }) {
|
|
285
|
-
const sentence2 = `${problem.replace(/\.$/, "")}.`;
|
|
286
|
-
if (key !== null) return `${file}: ${key} ${sentence2}`;
|
|
287
|
-
if (location !== null)
|
|
288
|
-
return `${file}:${location.line}${location.column === null ? "" : `:${location.column}`} ${sentence2}`;
|
|
289
|
-
return `${file}: ${sentence2}`;
|
|
290
|
-
}
|
|
291
|
-
var optionValueSchema = z.object({
|
|
292
|
-
/** The option's key path, such as resources.testserverPool.ttl. */
|
|
293
|
-
key: z.string(),
|
|
294
|
-
/** Its value, as text. */
|
|
295
|
-
value: z.string(),
|
|
296
|
-
/** Where it came from: a flag (a --set, or the command's own flag for the option), the config file or the default. */
|
|
297
|
-
source: z.enum(["flag", "file", "default"])
|
|
298
|
-
});
|
|
299
|
-
var optionProblemSchema = z.object({
|
|
300
|
-
/** The key path of the option the problem is about, such as resources.testserverPool.ttl. */
|
|
301
|
-
key: z.string(),
|
|
302
|
-
/** What is wrong, worded to follow the key path, as the resource's rule words it. */
|
|
303
|
-
problem: z.string(),
|
|
304
|
-
/** Each value the problem is about, with its source; empty for a required option nothing gave. */
|
|
305
|
-
values: z.array(optionValueSchema)
|
|
306
|
-
});
|
|
307
|
-
function optionValueText({ key, value, source }, configFile) {
|
|
308
|
-
switch (source) {
|
|
309
|
-
case "flag":
|
|
310
|
-
return `${key} is ${value} from the command line`;
|
|
311
|
-
case "file":
|
|
312
|
-
return `${key} is ${value} in ${configFile ?? "storm.config.ts"}`;
|
|
313
|
-
case "default":
|
|
314
|
-
return `${key} is ${value} by default`;
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
function optionProblemLine({ key, problem, values }, configFile) {
|
|
318
|
-
const where = values.map((value) => optionValueText(value, configFile));
|
|
319
|
-
const sources = where.length === 0 ? "" : `: ${where.length === 1 ? where.join("") : `${where.slice(0, -1).join(", ")} and ${where.at(-1) ?? ""}`}`;
|
|
320
|
-
return `${key} ${problem.replace(/\.$/, "")}${sources}.`;
|
|
321
|
-
}
|
|
322
|
-
var configErrors = defineErrors({
|
|
323
|
-
invalidConfig: {
|
|
324
|
-
exitCode: 2,
|
|
325
|
-
description: "storm.config.ts can't be used: it can't be imported, doesn't default-export an object, has an unknown key, or a value in it is invalid. storm checks the whole file whenever a command loads it.",
|
|
326
|
-
schema: z.object({
|
|
327
|
-
/** The config file's absolute path. */
|
|
328
|
-
file: z.string(),
|
|
329
|
-
problems: z.array(problemSchema)
|
|
330
|
-
}),
|
|
331
|
-
render: ({ file, problems }) => {
|
|
332
|
-
const [first, ...rest] = problems;
|
|
333
|
-
return {
|
|
334
|
-
message: first === void 0 ? `${file} can't be used.` : configProblemLine(file, first),
|
|
335
|
-
...rest.length === 0 ? {} : { rows: [["Also", rest.map((problem) => configProblemLine(file, problem))]] },
|
|
336
|
-
next: [{ type: "text", text: `Fix ${file}, then retry.` }]
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
},
|
|
340
|
-
invalidResourceOptions: {
|
|
341
|
-
exitCode: 2,
|
|
342
|
-
description: "A resource's options, once its defaults, storm.config.ts and the flags are merged, don't fit together, or one it requires is missing: such as resources.testserverPool.ttl not longer than its minTimeLeft. Each problem names the values it is about and where each came from.",
|
|
343
|
-
schema: z.object({
|
|
344
|
-
/** The config file that applied; null when none did. */
|
|
345
|
-
configFile: z.string().nullable(),
|
|
346
|
-
problems: z.array(optionProblemSchema)
|
|
347
|
-
}),
|
|
348
|
-
render: ({ configFile, problems }) => {
|
|
349
|
-
const [first, ...rest] = problems;
|
|
350
|
-
return {
|
|
351
|
-
message: first === void 0 ? "A resource's options don't fit together." : optionProblemLine(first, configFile),
|
|
352
|
-
...rest.length === 0 ? {} : { rows: [["Also", rest.map((problem) => optionProblemLine(problem, configFile))]] },
|
|
353
|
-
next: [
|
|
354
|
-
{
|
|
355
|
-
type: "text",
|
|
356
|
-
text: `Change the options on the command line or in ${configFile ?? "storm.config.ts"}, then retry.`
|
|
357
|
-
}
|
|
358
|
-
]
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
});
|
|
363
|
-
|
|
364
|
-
// src/config/settings-file.ts
|
|
365
|
-
async function loadSettingsFile(gateway, cwd, configs) {
|
|
366
|
-
const loaded = await loadConfig(gateway, cwd, configs);
|
|
367
|
-
if (loaded.kind === "invalid") return refused(invalidConfig(loaded.path, loaded.problems));
|
|
368
|
-
return loaded.kind === "loaded" ? { ok: true, path: loaded.path, values: loaded.values, configs } : { ok: true, path: null, values: void 0, configs };
|
|
369
|
-
}
|
|
370
|
-
function fileSettings(file, flags) {
|
|
371
|
-
return resolveSettings(flags, file.values?.settings);
|
|
372
|
-
}
|
|
373
|
-
function fileOptions(file, config) {
|
|
374
|
-
if (!file.configs.includes(config)) throw new Error(`The config file wasn't checked against ${config.name}`);
|
|
375
|
-
const resources = file.values?.resources;
|
|
376
|
-
const given = resources?.[config.name];
|
|
377
|
-
return given === void 0 ? void 0 : givenOptionsOf(config, given);
|
|
378
|
-
}
|
|
379
|
-
function settleResourceOptions(file, sets) {
|
|
380
|
-
const resolved = resolveResourceOptions(file.configs, file.values?.resources, sets);
|
|
381
|
-
if (!resolved.ok) return refused(invalidResourceOptions(file.path, resolved.problems));
|
|
382
|
-
return { ok: true, options: resolved.value };
|
|
383
|
-
}
|
|
384
|
-
function invalidConfig(file, problems) {
|
|
385
|
-
return configErrors.invalidConfig({
|
|
386
|
-
file,
|
|
387
|
-
problems: problems.map(({ key, location, problem }) => ({
|
|
388
|
-
key,
|
|
389
|
-
location: location === null ? null : { line: location.line, column: location.column ?? null },
|
|
390
|
-
problem
|
|
391
|
-
}))
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
function invalidResourceOptions(configFile, problems) {
|
|
395
|
-
return configErrors.invalidResourceOptions({
|
|
396
|
-
configFile,
|
|
397
|
-
problems: problems.map(({ key, problem, values }) => ({
|
|
398
|
-
key,
|
|
399
|
-
problem,
|
|
400
|
-
values: values.map(({ key: valueKey, value, source }) => ({ key: valueKey, value: valueText(value), source }))
|
|
401
|
-
}))
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
function valueText(value) {
|
|
405
|
-
return typeof value === "string" ? value : describeValue(value);
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
// src/config/live/config-gateway.ts
|
|
409
|
-
import { stat } from "node:fs/promises";
|
|
410
|
-
import { basename, join as join2 } from "node:path";
|
|
411
|
-
import { pathToFileURL } from "node:url";
|
|
412
|
-
function liveConfigGateway() {
|
|
413
|
-
return {
|
|
414
|
-
hasConfigFile: async (directory) => await kind(join2(directory, CONFIG_FILE_NAME)) === "file",
|
|
415
|
-
isWorktreeRoot: async (directory) => await kind(join2(directory, ".git")) !== void 0,
|
|
416
|
-
importConfig: async (path) => {
|
|
417
|
-
try {
|
|
418
|
-
const module = await import(pathToFileURL(path).href);
|
|
419
|
-
return "default" in module ? { kind: "default-export", value: module["default"] } : { kind: "no-default-export" };
|
|
420
|
-
} catch (error) {
|
|
421
|
-
return importFailure(error, path);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
async function kind(path) {
|
|
427
|
-
try {
|
|
428
|
-
return (await stat(path)).isFile() ? "file" : "other";
|
|
429
|
-
} catch {
|
|
430
|
-
return void 0;
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
function importFailure(error, path) {
|
|
434
|
-
if (!(error instanceof Error)) return { kind: "import-failed", message: String(error) };
|
|
435
|
-
const location = errorLocation(error, basename(path));
|
|
436
|
-
return { kind: "import-failed", message: error.message, ...location === void 0 ? {} : { location } };
|
|
437
|
-
}
|
|
438
|
-
function errorLocation(error, name) {
|
|
439
|
-
const lines = (error.stack ?? "").split("\n");
|
|
440
|
-
const escaped = name.replaceAll(".", "\\.");
|
|
441
|
-
if (error instanceof SyntaxError) {
|
|
442
|
-
const line = new RegExp(`${escaped}:(\\d+)$`).exec(lines[0] ?? "")?.[1];
|
|
443
|
-
if (line === void 0) return void 0;
|
|
444
|
-
const frame = lines.slice(1);
|
|
445
|
-
const carets = frame.slice(0, frame.indexOf("")).find((text) => /^ *\^+$/.test(text));
|
|
446
|
-
return carets === void 0 ? { line: Number(line) } : { line: Number(line), column: carets.indexOf("^") + 1 };
|
|
447
|
-
}
|
|
448
|
-
for (const text of lines) {
|
|
449
|
-
const frame = new RegExp(`${escaped}:(\\d+):(\\d+)\\)?$`).exec(text);
|
|
450
|
-
if (frame !== null) return { line: Number(frame[1]), column: Number(frame[2]) };
|
|
451
|
-
}
|
|
452
|
-
return void 0;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
// src/config/set.ts
|
|
456
|
-
function setTargets(configs, ownFlags) {
|
|
457
|
-
return configs.flatMap(
|
|
458
|
-
(config) => Object.entries(config.options).flatMap(([option, rule]) => {
|
|
459
|
-
const path = optionKeyPath(config.name, option);
|
|
460
|
-
return Object.hasOwn(ownFlags, path) ? [] : [[path, { resource: config.name, option, rule }]];
|
|
461
|
-
})
|
|
462
|
-
);
|
|
463
|
-
}
|
|
464
|
-
function parseSetFlags(texts, configs, ownFlags = {}) {
|
|
465
|
-
const targets = setTargets(configs, ownFlags);
|
|
466
|
-
const byPath = new Map(targets);
|
|
467
|
-
const paths = targets.map(([path]) => path);
|
|
468
|
-
const values = {};
|
|
469
|
-
const seen = /* @__PURE__ */ new Set();
|
|
470
|
-
const problems = [];
|
|
471
|
-
for (const text of texts) {
|
|
472
|
-
const equals = text.indexOf("=");
|
|
473
|
-
if (equals <= 0) {
|
|
474
|
-
problems.push(
|
|
475
|
-
`--set ${text} must be <key path>=<value>${paths[0] === void 0 ? "" : `, such as ${paths[0]}=<value>`}`
|
|
476
|
-
);
|
|
477
|
-
continue;
|
|
478
|
-
}
|
|
479
|
-
const path = text.slice(0, equals);
|
|
480
|
-
const flag = Object.hasOwn(ownFlags, path) ? ownFlags[path] : void 0;
|
|
481
|
-
if (flag !== void 0) {
|
|
482
|
-
problems.push(`--set ${path} has its own flag; use ${flag}`);
|
|
483
|
-
continue;
|
|
484
|
-
}
|
|
485
|
-
const target = byPath.get(path);
|
|
486
|
-
if (target === void 0) {
|
|
487
|
-
problems.push(
|
|
488
|
-
paths.length === 0 ? `--set ${path} isn't a key path --set takes; it takes none` : `--set ${path} isn't a key path --set takes; it takes ${paths.join(", ")}`
|
|
489
|
-
);
|
|
490
|
-
continue;
|
|
491
|
-
}
|
|
492
|
-
if (seen.has(path)) {
|
|
493
|
-
problems.push(`--set ${path} is given more than once`);
|
|
494
|
-
continue;
|
|
495
|
-
}
|
|
496
|
-
seen.add(path);
|
|
497
|
-
const checked = target.rule.check(target.rule.readText(text.slice(equals + 1)));
|
|
498
|
-
if (!checked.ok) {
|
|
499
|
-
problems.push(...checked.problems.map(({ problem }) => `--set ${path} ${problem}`));
|
|
500
|
-
continue;
|
|
501
|
-
}
|
|
502
|
-
values[target.resource] = { ...values[target.resource], [target.option]: checked.value };
|
|
503
|
-
}
|
|
504
|
-
if (problems.length > 0) return { ok: false, problems };
|
|
505
|
-
return { ok: true, values: givenResourcesByName(configs, values) };
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
// src/resources/testserver/options.ts
|
|
509
|
-
var MIN_SANDBOXES = 1;
|
|
510
|
-
var MAX_SANDBOXES = 32;
|
|
511
|
-
var CREATE_CONCURRENCY = 8;
|
|
512
|
-
|
|
513
|
-
// src/resources/testserver/config.ts
|
|
514
|
-
var NAME = "testserverPool";
|
|
515
|
-
function sandboxCount(value) {
|
|
516
|
-
return typeof value === "number" && Number.isInteger(value) && value >= MIN_SANDBOXES && value <= MAX_SANDBOXES ? { ok: true, value } : wrongValue(`must be a whole number from ${MIN_SANDBOXES} to ${MAX_SANDBOXES}, not ${describeValue(value)}`);
|
|
517
|
-
}
|
|
518
|
-
function checkBuild(value) {
|
|
519
|
-
if (typeof value !== "string" || value.length === 0)
|
|
520
|
-
return wrongValue(`must be a non-empty string, not ${describeValue(value)}`);
|
|
521
|
-
const parsed = parseBuildReference(value);
|
|
522
|
-
return parsed.ok ? { ok: true, value: buildReferenceText(parsed.reference) } : wrongValue(parsed.problem);
|
|
523
|
-
}
|
|
524
|
-
function duration(value) {
|
|
525
|
-
return typeof value === "string" && parseDuration(value) !== void 0 ? { ok: true, value } : wrongValue(`must be a whole number of minutes or hours, such as 30m or 2h, not ${describeValue(value)}`);
|
|
526
|
-
}
|
|
527
|
-
function ttl(value) {
|
|
528
|
-
return typeof value === "string" && parseTtl(value) !== void 0 ? { ok: true, value } : wrongValue(`must be a whole number of minutes or hours from 10m to 5h, not ${describeValue(value)}`);
|
|
529
|
-
}
|
|
530
|
-
var KIND = "testserverPool";
|
|
531
|
-
var testserverPoolConfig = {
|
|
532
|
-
name: NAME,
|
|
533
|
-
factory: { kind: KIND, call: "testserverPool({ \u2026 })", subpath: "@vercel/storm/testserver" },
|
|
534
|
-
options: {
|
|
535
|
-
sandboxes: { check: sandboxCount, readText: readWholeNumberText, default: MIN_SANDBOXES },
|
|
536
|
-
build: { check: checkBuild, readText: readTextAsIs, default: "stable" },
|
|
537
|
-
minTimeLeft: { check: duration, readText: readTextAsIs, default: "30m" },
|
|
538
|
-
ttl: { check: ttl, readText: readTextAsIs, default: "5h" },
|
|
539
|
-
noCreate: { check: checkBoolean, readText: readBooleanText, default: false }
|
|
540
|
-
},
|
|
541
|
-
resolve({ sandboxes, build, minTimeLeft, ttl: ttl2, noCreate }) {
|
|
542
|
-
const minTimeLeftMinutes = parseDuration(minTimeLeft.value) ?? 0;
|
|
543
|
-
const settings = { sandboxes: sandboxes.value, build: build.value, minTimeLeftMinutes };
|
|
544
|
-
if (noCreate.value) {
|
|
545
|
-
if (ttl2.source !== "flag") return { ok: true, value: { ...settings, provisioning: { kind: "no-create" } } };
|
|
546
|
-
return refuse({
|
|
547
|
-
option: "ttl",
|
|
548
|
-
problem: `doesn't apply with ${optionKeyPath(NAME, "noCreate")}=true, which creates no Testserver sandbox`,
|
|
549
|
-
involves: ["ttl", "noCreate"]
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
const ttlMinutes = parseTtl(ttl2.value) ?? DEFAULT_TTL_MINUTES;
|
|
553
|
-
if (ttlMinutes > minTimeLeftMinutes)
|
|
554
|
-
return { ok: true, value: { ...settings, provisioning: { kind: "create", ttlMinutes } } };
|
|
555
|
-
return refuse(
|
|
556
|
-
ttl2.source === "default" && minTimeLeft.source !== "default" ? {
|
|
557
|
-
option: "minTimeLeft",
|
|
558
|
-
problem: `must be shorter than ${optionKeyPath(NAME, "ttl")} (${ttl2.value}), not ${minTimeLeft.value}`,
|
|
559
|
-
involves: ["minTimeLeft", "ttl"]
|
|
560
|
-
} : {
|
|
561
|
-
option: "ttl",
|
|
562
|
-
problem: `must be longer than ${optionKeyPath(NAME, "minTimeLeft")} (${minTimeLeft.value}), not ${ttl2.value}`,
|
|
563
|
-
involves: ["ttl", "minTimeLeft"]
|
|
564
|
-
}
|
|
565
|
-
);
|
|
566
|
-
}
|
|
567
|
-
};
|
|
568
|
-
function refuse(problem) {
|
|
569
|
-
return { ok: false, problems: [problem] };
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
// src/resources/testserver/credential-facts.ts
|
|
573
|
-
import { z as z2 } from "zod";
|
|
574
|
-
var REQUESTING_TOKEN_LINE = "Requesting a GitHub Actions OIDC token\u2026";
|
|
575
|
-
var tokenRequestFailureShape = {
|
|
576
|
-
/** Why it failed: the job's variables are missing, or the request failed. */
|
|
577
|
-
cause: z2.enum(["variables-missing", "request-failed"]),
|
|
578
|
-
/** The variables that aren't set, under variables-missing; null otherwise. */
|
|
579
|
-
missing: z2.array(z2.enum(["ACTIONS_ID_TOKEN_REQUEST_URL", "ACTIONS_ID_TOKEN_REQUEST_TOKEN"])).nullable(),
|
|
580
|
-
/** The HTTP status GitHub answered the last attempt with; null when it answered none, or 2xx without a token. */
|
|
581
|
-
status: z2.number().nullable(),
|
|
582
|
-
/** What GitHub or the connection said to the last attempt, at most 200 characters; null when nothing. */
|
|
583
|
-
said: z2.string().nullable(),
|
|
584
|
-
/** The cause, for a person. */
|
|
585
|
-
detail: z2.string(),
|
|
586
|
-
/** The one fix. */
|
|
587
|
-
fix: z2.string()
|
|
588
|
-
};
|
|
589
|
-
function tokenRequestFailureFacts(failure) {
|
|
590
|
-
const { cause: detail, fix } = describeTokenRequestFailure(failure);
|
|
591
|
-
if (failure.kind === "variables-missing")
|
|
592
|
-
return { cause: failure.kind, missing: [...failure.missing], status: null, said: null, detail, fix };
|
|
593
|
-
const { last } = failure;
|
|
594
|
-
return {
|
|
595
|
-
cause: failure.kind,
|
|
596
|
-
missing: null,
|
|
597
|
-
status: last.kind === "http-error" ? last.status : null,
|
|
598
|
-
said: "said" in last ? last.said : null,
|
|
599
|
-
detail,
|
|
600
|
-
fix
|
|
601
|
-
};
|
|
602
|
-
}
|
|
603
|
-
var credentialOriginSchema = z2.discriminatedUnion("source", [
|
|
604
|
-
z2.object({
|
|
605
|
-
/** The mint. */
|
|
606
|
-
source: z2.literal("mint"),
|
|
607
|
-
/** The control plane team the credential was minted for. */
|
|
608
|
-
team: z2.string(),
|
|
609
|
-
/** The control plane project the credential was minted for. */
|
|
610
|
-
project: z2.string()
|
|
611
|
-
}),
|
|
612
|
-
z2.object({
|
|
613
|
-
/** A GitHub Actions OIDC token request. */
|
|
614
|
-
source: z2.literal("github-actions"),
|
|
615
|
-
/** The token's aud and repository claims; null when they can't be read. */
|
|
616
|
-
claims: z2.object({ aud: z2.string(), repository: z2.string() }).nullable()
|
|
617
|
-
})
|
|
618
|
-
]);
|
|
619
|
-
var rejectedCredentialShape = {
|
|
620
|
-
origin: credentialOriginSchema,
|
|
621
|
-
/** The one fix: a trusted team and project for the mint, a Trusted Source rule for a GitHub Actions OIDC token. */
|
|
622
|
-
fix: z2.string()
|
|
623
|
-
};
|
|
624
|
-
function rejectedCredentialFacts(origin) {
|
|
625
|
-
return {
|
|
626
|
-
origin: origin.source === "mint" ? { source: "mint", ...origin.target } : { source: "github-actions", claims: origin.claims === void 0 ? null : { ...origin.claims } },
|
|
627
|
-
fix: rejectedCredentialFix(origin)
|
|
628
|
-
};
|
|
629
|
-
}
|
|
630
|
-
function rejectedCredentialText(origin) {
|
|
631
|
-
return origin.source === "mint" ? `the credential minted for project ${origin.project} on team ${origin.team}` : "the GitHub Actions OIDC token";
|
|
632
|
-
}
|
|
633
|
-
function credentialOriginRows(origin) {
|
|
634
|
-
return origin.source === "mint" ? [["Team", origin.team], ["Project", origin.project]] : [
|
|
635
|
-
["aud", origin.claims?.aud ?? "unreadable"],
|
|
636
|
-
["repository", origin.claims?.repository ?? "unreadable"]
|
|
637
|
-
];
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
// src/resources/testserver/pr-build-facts.ts
|
|
641
|
-
import { z as z3 } from "zod";
|
|
642
|
-
var pullRequestFailureKinds = [
|
|
643
|
-
"no-token",
|
|
644
|
-
"not-found",
|
|
645
|
-
"rejected",
|
|
646
|
-
"http-error",
|
|
647
|
-
"connect-failed",
|
|
648
|
-
"timeout",
|
|
649
|
-
"malformed"
|
|
650
|
-
];
|
|
651
|
-
var prBuildsFailureKinds = ["not-found", "rejected", "http-error", "connect-failed", "timeout", "malformed"];
|
|
652
|
-
var pullRequestUnreadableSchema = z3.object({
|
|
653
|
-
/** The pull request number. */
|
|
654
|
-
pr: z3.number(),
|
|
655
|
-
/** The repository, vercel/api. */
|
|
656
|
-
repo: z3.string(),
|
|
657
|
-
/** Why: no GitHub token on the host, or how reading the pull request from GitHub failed. */
|
|
658
|
-
kind: z3.enum(pullRequestFailureKinds),
|
|
659
|
-
/** The HTTP status GitHub answered with; null when it answered none, or with no-token. */
|
|
660
|
-
status: z3.number().nullable(),
|
|
661
|
-
/** What GitHub or the connection said, with no token in it; null when nothing. */
|
|
662
|
-
message: z3.string().nullable(),
|
|
663
|
-
/** Where the GitHub token came from: GITHUB_TOKEN, GH_TOKEN or gh auth token; null with no-token. */
|
|
664
|
-
tokenOrigin: z3.enum(["GITHUB_TOKEN", "GH_TOKEN", "gh auth token"]).nullable()
|
|
665
|
-
});
|
|
666
|
-
var prBuildsUnlistedSchema = z3.object({
|
|
667
|
-
pr: z3.number(),
|
|
668
|
-
/** How reading the runs of vercel/api's Testserver workflow on the pull request, or a run's PR build, from GitHub failed. */
|
|
669
|
-
failure: z3.object({
|
|
670
|
-
kind: z3.enum(prBuildsFailureKinds),
|
|
671
|
-
/** The HTTP status GitHub answered with; null when it answered none. */
|
|
672
|
-
status: z3.number().nullable(),
|
|
673
|
-
/** What GitHub or the connection said, with no token in it. */
|
|
674
|
-
detail: z3.string()
|
|
675
|
-
})
|
|
676
|
-
});
|
|
677
|
-
var prBuildNotReadySchema = z3.object({
|
|
678
|
-
pr: z3.number(),
|
|
679
|
-
/** The pull request's head commit, 40 hex characters. */
|
|
680
|
-
headSha: z3.string(),
|
|
681
|
-
/** The newest PR build of an older head commit of the pull request; null when it has none. */
|
|
682
|
-
newest: z3.object({
|
|
683
|
-
build: z3.string(),
|
|
684
|
-
/** The head commit the build was made from. */
|
|
685
|
-
headSha: z3.string(),
|
|
686
|
-
createdAt: z3.string()
|
|
687
|
-
}).nullable()
|
|
688
|
-
});
|
|
689
|
-
var prBuildExpiredSchema = z3.object({
|
|
690
|
-
pr: z3.number(),
|
|
691
|
-
headSha: z3.string(),
|
|
692
|
-
/** The newest PR build made from the head commit. */
|
|
693
|
-
build: z3.string(),
|
|
694
|
-
/** When the Testserver control plane stopped creating Testserver sandboxes from it. */
|
|
695
|
-
expiresAt: z3.string()
|
|
696
|
-
});
|
|
697
|
-
function prBuildRefusalFacts(refusal) {
|
|
698
|
-
switch (refusal.kind) {
|
|
699
|
-
case "pull-request-unreadable": {
|
|
700
|
-
const { failure } = refusal;
|
|
701
|
-
const said = pullRequestSaid(failure);
|
|
702
|
-
return {
|
|
703
|
-
key: "pullRequestUnreadable",
|
|
704
|
-
data: {
|
|
705
|
-
pr: refusal.pr,
|
|
706
|
-
repo: TESTSERVER_REPO,
|
|
707
|
-
kind: failure.kind,
|
|
708
|
-
status: "status" in failure ? failure.status : null,
|
|
709
|
-
message: said,
|
|
710
|
-
tokenOrigin: refusal.tokenOrigin ?? null
|
|
711
|
-
}
|
|
712
|
-
};
|
|
713
|
-
}
|
|
714
|
-
case "pr-builds-unlisted": {
|
|
715
|
-
const { failure } = refusal;
|
|
716
|
-
return {
|
|
717
|
-
key: "prBuildsUnlisted",
|
|
718
|
-
data: {
|
|
719
|
-
pr: refusal.pr,
|
|
720
|
-
failure: {
|
|
721
|
-
kind: failure.kind,
|
|
722
|
-
status: "status" in failure ? failure.status : null,
|
|
723
|
-
detail: gitHubSaid(failure)
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
};
|
|
727
|
-
}
|
|
728
|
-
case "pr-build-not-ready": {
|
|
729
|
-
const { newest } = refusal;
|
|
730
|
-
return {
|
|
731
|
-
key: "prBuildNotReady",
|
|
732
|
-
data: {
|
|
733
|
-
pr: refusal.pr,
|
|
734
|
-
headSha: refusal.headSha,
|
|
735
|
-
newest: newest === void 0 ? null : { build: newest.build, headSha: newest.headSha, createdAt: newest.createdAt }
|
|
736
|
-
}
|
|
737
|
-
};
|
|
738
|
-
}
|
|
739
|
-
case "pr-build-expired":
|
|
740
|
-
return {
|
|
741
|
-
key: "prBuildExpired",
|
|
742
|
-
data: { pr: refusal.pr, headSha: refusal.headSha, build: refusal.build, expiresAt: refusal.expiresAt }
|
|
743
|
-
};
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
function pullRequestSaid(failure) {
|
|
747
|
-
return failure.kind === "no-token" || failure.kind === "not-found" ? null : gitHubSaid(failure);
|
|
748
|
-
}
|
|
749
|
-
function gitHubSaid(failure) {
|
|
750
|
-
switch (failure.kind) {
|
|
751
|
-
case "not-found":
|
|
752
|
-
return "HTTP 404";
|
|
753
|
-
case "rejected":
|
|
754
|
-
case "http-error":
|
|
755
|
-
return failure.message;
|
|
756
|
-
case "connect-failed":
|
|
757
|
-
return failure.code;
|
|
758
|
-
case "timeout":
|
|
759
|
-
return `no answer within ${failure.seconds}s`;
|
|
760
|
-
case "malformed":
|
|
761
|
-
return failure.detail;
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
function sentence(text) {
|
|
765
|
-
return /[.!?]$/.test(text) ? text : `${text}.`;
|
|
766
|
-
}
|
|
767
|
-
function pullRequestName(pr) {
|
|
768
|
-
return `${TESTSERVER_REPO}#${pr}`;
|
|
769
|
-
}
|
|
770
|
-
function pullRequestUrl(pr) {
|
|
771
|
-
return `https://github.com/${TESTSERVER_REPO}/pull/${pr}`;
|
|
772
|
-
}
|
|
773
|
-
function checksStep(pr) {
|
|
774
|
-
return {
|
|
775
|
-
type: "external",
|
|
776
|
-
argv: ["gh", "pr", "checks", String(pr), "--repo", TESTSERVER_REPO],
|
|
777
|
-
label: "Show the pull request's checks"
|
|
778
|
-
};
|
|
779
|
-
}
|
|
780
|
-
function prBuildRefusalErrors(outcome) {
|
|
781
|
-
const pullRequestUnreadable = {
|
|
782
|
-
exitCode: 1,
|
|
783
|
-
description: "storm couldn't read the vercel/api pull request that the PR build reference names from GitHub. It has no GitHub token, or GitHub refused the request. storm reads the token from GITHUB_TOKEN, then GH_TOKEN, then gh auth token.",
|
|
784
|
-
schema: pullRequestUnreadableSchema,
|
|
785
|
-
render: ({ pr, kind: kind2, status, message, tokenOrigin }) => {
|
|
786
|
-
const name = pullRequestName(pr);
|
|
787
|
-
const origin = tokenOrigin ?? "the host";
|
|
788
|
-
const text = (() => {
|
|
789
|
-
switch (kind2) {
|
|
790
|
-
case "no-token":
|
|
791
|
-
return `storm needs a GitHub token to read ${name}. Set GITHUB_TOKEN or GH_TOKEN, or run gh auth login.`;
|
|
792
|
-
case "not-found":
|
|
793
|
-
return `${name} doesn't exist, or the token from ${origin} can't read ${TESTSERVER_REPO}.`;
|
|
794
|
-
case "rejected":
|
|
795
|
-
return `GitHub refused the token from ${origin} (HTTP ${status ?? "error"}): ${message ?? ""}`;
|
|
796
|
-
case "http-error":
|
|
797
|
-
return `GitHub couldn't read ${name} (HTTP ${status ?? "error"}): ${message ?? ""}`;
|
|
798
|
-
case "connect-failed":
|
|
799
|
-
return `Couldn't reach GitHub to read ${name} (${message ?? "no connection"}).`;
|
|
800
|
-
case "timeout":
|
|
801
|
-
return `GitHub didn't answer the request for ${name}: ${message ?? "timeout"}.`;
|
|
802
|
-
case "malformed":
|
|
803
|
-
return `GitHub's answer for ${name} isn't a pull request: ${message ?? ""}`;
|
|
804
|
-
}
|
|
805
|
-
})();
|
|
806
|
-
return {
|
|
807
|
-
message: `${sentence(text)} ${outcome}`,
|
|
808
|
-
rows: [
|
|
809
|
-
["Pull request", pullRequestUrl(pr)],
|
|
810
|
-
...tokenOrigin === null ? [] : [["GitHub token from", tokenOrigin]]
|
|
811
|
-
],
|
|
812
|
-
next: [
|
|
813
|
-
{ type: "external", argv: ["gh", "auth", "status"], label: "Check the GitHub login" },
|
|
814
|
-
{
|
|
815
|
-
type: "text",
|
|
816
|
-
text: `Run gh auth login, or set GITHUB_TOKEN to a token that can read ${TESTSERVER_REPO}. Then retry.`
|
|
817
|
-
}
|
|
818
|
-
]
|
|
819
|
-
};
|
|
820
|
-
}
|
|
821
|
-
};
|
|
822
|
-
const prBuildsUnlisted = {
|
|
823
|
-
exitCode: 1,
|
|
824
|
-
description: "storm couldn't read from GitHub the runs of vercel/api's Testserver workflow on the pull request that the PR build reference names, or the PR build a run published.",
|
|
825
|
-
schema: prBuildsUnlistedSchema,
|
|
826
|
-
render: ({ pr, failure }) => ({
|
|
827
|
-
message: `${sentence(`Couldn't read ${pullRequestName(pr)}'s Testserver builds from GitHub Actions: ${failure.kind}${failure.status === null ? "" : ` (HTTP ${failure.status})`}: ${failure.detail}`)} ${outcome}`,
|
|
828
|
-
next: [
|
|
829
|
-
{ type: "external", argv: ["gh", "auth", "status"], label: "Check the GitHub login" },
|
|
830
|
-
{ type: "text", text: `Make sure that the token can read ${TESTSERVER_REPO}'s Actions, then retry.` }
|
|
831
|
-
]
|
|
832
|
-
})
|
|
833
|
-
};
|
|
834
|
-
const prBuildNotReady = {
|
|
835
|
-
exitCode: 1,
|
|
836
|
-
description: "No run of vercel/api's Testserver workflow for the pull request's head commit has published a Testserver build: the Bundle & Publish check of the newest push has not finished, or it failed. storm never runs on a build from an older commit.",
|
|
837
|
-
schema: prBuildNotReadySchema,
|
|
838
|
-
render: ({ pr, headSha, newest }) => {
|
|
839
|
-
const name = pullRequestName(pr);
|
|
840
|
-
const text = newest === null ? `${name} has no Testserver build from its head, ${shortSha(headSha)}, yet.` : `${name}'s newest Testserver build, ${newest.build}, is from ${shortSha(newest.headSha)}; the PR's head is ${shortSha(headSha)}.`;
|
|
841
|
-
return {
|
|
842
|
-
message: `${text} ${outcome}`,
|
|
843
|
-
rows: [
|
|
844
|
-
["Pull request", pullRequestUrl(pr)],
|
|
845
|
-
["Head commit", headSha],
|
|
846
|
-
["Newest build", newest === null ? "none" : `${newest.build} (${newest.createdAt})`]
|
|
847
|
-
],
|
|
848
|
-
next: [
|
|
849
|
-
{
|
|
850
|
-
type: "text",
|
|
851
|
-
text: "Wait for the Bundle & Publish check on the PR's head to pass, then retry. If the check failed, push a fix to the PR."
|
|
852
|
-
},
|
|
853
|
-
checksStep(pr)
|
|
854
|
-
]
|
|
855
|
-
};
|
|
856
|
-
}
|
|
857
|
-
};
|
|
858
|
-
const prBuildExpired = {
|
|
859
|
-
exitCode: 1,
|
|
860
|
-
description: "The newest Testserver build from the vercel/api pull request's head commit was published 7 days ago or more, so the Testserver control plane creates no Testserver sandbox from it.",
|
|
861
|
-
schema: prBuildExpiredSchema,
|
|
862
|
-
render: ({ pr, headSha, build, expiresAt }) => ({
|
|
863
|
-
message: `${pullRequestName(pr)}'s build for its head, ${build}, expired at ${expiresAt}. ${outcome}`,
|
|
864
|
-
rows: [
|
|
865
|
-
["Pull request", pullRequestUrl(pr)],
|
|
866
|
-
["Head commit", headSha]
|
|
867
|
-
],
|
|
868
|
-
next: [
|
|
869
|
-
{
|
|
870
|
-
type: "text",
|
|
871
|
-
text: `Push to the PR, or rerun its Testserver workflow (gh run rerun <run-id> --repo ${TESTSERVER_REPO}, or the PR's Checks page). Then retry.`
|
|
872
|
-
},
|
|
873
|
-
checksStep(pr)
|
|
874
|
-
]
|
|
875
|
-
})
|
|
876
|
-
};
|
|
877
|
-
return { pullRequestUnreadable, prBuildsUnlisted, prBuildNotReady, prBuildExpired };
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
export {
|
|
881
|
-
givenOptionsOf,
|
|
882
|
-
configErrors,
|
|
883
|
-
wrongValue,
|
|
884
|
-
checkBoolean,
|
|
885
|
-
describeValue,
|
|
886
|
-
liveConfigGateway,
|
|
887
|
-
findConfigFile,
|
|
888
|
-
optionKeyPath,
|
|
889
|
-
readBooleanText,
|
|
890
|
-
readTextAsIs,
|
|
891
|
-
mergeResourceOptions,
|
|
892
|
-
parseSetFlags,
|
|
893
|
-
loadSettingsFile,
|
|
894
|
-
fileSettings,
|
|
895
|
-
fileOptions,
|
|
896
|
-
settleResourceOptions,
|
|
897
|
-
invalidConfig,
|
|
898
|
-
invalidResourceOptions,
|
|
899
|
-
CREATE_CONCURRENCY,
|
|
900
|
-
testserverPoolConfig,
|
|
901
|
-
REQUESTING_TOKEN_LINE,
|
|
902
|
-
tokenRequestFailureShape,
|
|
903
|
-
tokenRequestFailureFacts,
|
|
904
|
-
rejectedCredentialShape,
|
|
905
|
-
rejectedCredentialFacts,
|
|
906
|
-
rejectedCredentialText,
|
|
907
|
-
credentialOriginRows,
|
|
908
|
-
prBuildRefusalFacts,
|
|
909
|
-
prBuildRefusalErrors
|
|
910
|
-
};
|