@cnc-tools/storm 0.11.0 → 0.13.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/dist/bin/storm.js +7 -12
- package/dist/build-info.js +1 -1
- package/dist/chunks/chunk-2NZXL6OH.js +62 -0
- package/dist/chunks/{chunk-3ZZVZPMG.js → chunk-43MWZLJR.js} +1 -1
- package/dist/chunks/{chunk-NPPJ57W7.js → chunk-5UMJNVKT.js} +498 -215
- package/dist/chunks/{chunk-KR7WIYLG.js → chunk-6EQKA7LI.js} +200 -985
- package/dist/chunks/{chunk-4EU4AH7E.js → chunk-AX4EQZUS.js} +186 -144
- package/dist/chunks/{chunk-ETCZ6WP7.js → chunk-BW2ADH7U.js} +1 -1
- package/dist/chunks/chunk-DOFB2ACU.js +49 -0
- package/dist/chunks/chunk-EGNP3S6C.js +161 -0
- package/dist/chunks/chunk-GQIL3AHY.js +20 -0
- package/dist/chunks/{chunk-ICB4BZJX.js → chunk-GSC6SRTW.js} +7 -2
- package/dist/chunks/{chunk-OJOKQRM6.js → chunk-IYM44FUX.js} +30 -26
- package/dist/chunks/{chunk-GRMD7G4J.js → chunk-LQKNI3EG.js} +6 -5
- package/dist/chunks/chunk-N7E6DAUE.js +40 -0
- package/dist/chunks/chunk-NMVODY3P.js +19 -0
- package/dist/chunks/{chunk-TRFEAYNC.js → chunk-Q4TKRILH.js} +261 -354
- package/dist/chunks/{chunk-VZZTHCBW.js → chunk-RTILVSYQ.js} +5 -18
- package/dist/chunks/{chunk-L4ZPMSKQ.js → chunk-T6AZIDZD.js} +43 -363
- package/dist/chunks/chunk-X4WBJIOF.js +308 -0
- package/dist/chunks/chunk-YGS5VRQT.js +794 -0
- package/dist/chunks/{chunk-4PRAB24Y.js → chunk-YM6TZV4L.js} +394 -396
- package/dist/chunks/{chunk-AMTYHUYB.js → chunk-YT5OROR7.js} +22 -8
- package/dist/chunks/{chunk-O4BUT7BE.js → chunk-ZDJLKF2G.js} +1625 -1583
- package/dist/chunks/{live-app-LOGYUBKB.js → live-app-QFHS54SX.js} +25 -46
- package/dist/command-tree.d.ts +4 -1
- package/dist/command-tree.js +4 -1
- package/dist/commands/exec/cleanup.js +4 -4
- package/dist/commands/exec/command.d.ts +6 -55
- package/dist/commands/exec/command.js +51 -46
- package/dist/commands/exec/define-run-command.d.ts +664 -0
- package/dist/commands/exec/define-run-command.js +58 -0
- package/dist/commands/exec/driver-plan.d.ts +30 -0
- package/dist/commands/exec/driver-plan.js +44 -0
- package/dist/commands/exec/driver-refusals.d.ts +89 -0
- package/dist/commands/exec/driver-refusals.js +65 -0
- package/dist/commands/exec/exec-words.d.ts +5 -0
- package/dist/commands/exec/exec-words.js +31 -0
- package/dist/commands/exec/live-view.js +68 -42
- package/dist/commands/exec/mint-failed.js +4 -4
- package/dist/commands/exec/outcomes.d.ts +6 -48
- package/dist/commands/exec/outcomes.js +10 -12
- package/dist/commands/exec/plan-run.js +3 -3
- package/dist/commands/exec/progress.d.ts +21 -17
- package/dist/commands/exec/progress.js +59 -78
- package/dist/commands/exec/resource-flags.d.ts +10 -3
- package/dist/commands/exec/resource-flags.js +25 -14
- package/dist/commands/exec/resource-refusals.d.ts +1 -1
- package/dist/commands/exec/resource-refusals.js +9 -9
- package/dist/commands/exec/run-bin.d.ts +35 -0
- package/dist/commands/exec/run-bin.js +32 -0
- package/dist/commands/exec/run-command.d.ts +64 -23
- package/dist/commands/exec/run-command.js +35 -94
- package/dist/commands/exec/run-metadata.d.ts +25 -19
- package/dist/commands/exec/run-metadata.js +34 -18
- package/dist/commands/exec/snapshot-text.d.ts +31 -0
- package/dist/commands/exec/snapshot-text.js +72 -0
- package/dist/commands/exec/test-plan.d.ts +2 -2
- package/dist/commands/exec/test-plan.js +11 -8
- package/dist/commands/exec/tests-summary.d.ts +21 -12
- package/dist/commands/exec/tests-summary.js +67 -39
- package/dist/commands/exec/text.d.ts +5 -0
- package/dist/commands/exec/text.js +7 -0
- package/dist/commands/exec/view.js +12 -13
- package/dist/commands/exec/waterfall.js +4 -4
- package/dist/commands/exec/worker-chart.d.ts +19 -11
- package/dist/commands/exec/worker-chart.js +66 -36
- package/dist/commands/playwright/command.d.ts +658 -0
- package/dist/commands/playwright/command.js +31 -0
- package/dist/commands/playwright/metadata.js +8 -0
- package/dist/commands/runs/facts.d.ts +5 -28
- package/dist/commands/runs/facts.js +11 -33
- package/dist/commands/runs/list/command.d.ts +4 -50
- package/dist/commands/runs/list/command.js +15 -11
- package/dist/commands/runs/list/outcomes.d.ts +2 -25
- package/dist/commands/runs/logs/command.js +13 -9
- package/dist/commands/runs/logs/outcomes.js +1 -1
- package/dist/commands/runs/show/command.d.ts +6 -50
- package/dist/commands/runs/show/command.js +37 -47
- package/dist/commands/runs/show/metadata.js +1 -1
- package/dist/commands/runs/show/outcomes.d.ts +3 -25
- package/dist/commands/runs/show/outcomes.js +18 -31
- package/dist/commands/snapshots/build/command.d.ts +501 -0
- package/dist/commands/snapshots/build/command.js +336 -0
- package/dist/commands/snapshots/build/metadata.d.ts +28 -0
- package/dist/commands/snapshots/build/metadata.js +37 -0
- package/dist/commands/snapshots/build/outcomes.d.ts +254 -0
- package/dist/commands/snapshots/build/outcomes.js +155 -0
- package/dist/commands/snapshots/list/command.d.ts +238 -0
- package/dist/commands/snapshots/list/command.js +269 -0
- package/dist/commands/snapshots/list/metadata.d.ts +16 -0
- package/dist/commands/snapshots/list/metadata.js +24 -0
- package/dist/commands/snapshots/list/outcomes.d.ts +148 -0
- package/dist/commands/snapshots/list/outcomes.js +217 -0
- package/dist/commands/snapshots/metadata.d.ts +3 -0
- package/dist/commands/snapshots/metadata.js +7 -0
- package/dist/commands/vitest/command.d.ts +185 -304
- package/dist/commands/vitest/command.js +23 -181
- package/dist/commands/vitest/metadata.js +1 -1
- package/dist/config-file/define.d.ts +1 -1
- package/dist/context.d.ts +32 -30
- package/dist/context.js +13 -17
- package/dist/core/before-run.d.ts +5 -5
- package/dist/core/before-run.js +8 -8
- package/dist/core/definition-lookup.d.ts +5 -5
- package/dist/core/definition-lookup.js +13 -12
- package/dist/core/drivers-of.d.ts +23 -0
- package/dist/core/drivers-of.js +13 -0
- package/dist/core/events.d.ts +6 -9
- package/dist/core/gateways.d.ts +32 -24
- package/dist/core/index.d.ts +7 -5
- package/dist/core/index.js +9 -6
- package/dist/core/launcher-context.d.ts +11 -0
- package/dist/core/launcher-context.js +31 -0
- package/dist/core/live/package-bin-gateway.d.ts +6 -0
- package/dist/core/live/package-bin-gateway.js +24 -0
- package/dist/core/package-bin.d.ts +7 -0
- package/dist/core/package-bin.js +30 -0
- package/dist/core/presentations.d.ts +1 -1
- package/dist/core/presentations.js +6 -5
- package/dist/core/{resource-registry.d.ts → resource-definition-set.d.ts} +15 -14
- package/dist/core/resource-definition-set.js +31 -0
- package/dist/core/resource-reports.d.ts +1 -1
- package/dist/core/resource-reports.js +16 -15
- package/dist/core/resource.d.ts +4 -4
- package/dist/core/resources.d.ts +6 -6
- package/dist/core/resources.js +11 -11
- package/dist/core/run-state.d.ts +20 -31
- package/dist/core/run-state.js +34 -25
- package/dist/core/run.d.ts +30 -32
- package/dist/core/run.js +33 -39
- package/dist/core/setup-phases.d.ts +14 -0
- package/dist/core/setup-phases.js +24 -0
- package/dist/core/state-directory.d.ts +2 -2
- package/dist/core/state-directory.js +3 -3
- package/dist/core/timeline.d.ts +4 -2
- package/dist/core/timeline.js +11 -5
- package/dist/extension-commands.js +6 -10
- package/dist/extensions/github/{world.d.ts → context.d.ts} +1 -1
- package/dist/extensions/github/context.js +3 -0
- package/dist/extensions/github/definition.d.ts +1 -1
- package/dist/extensions/github/definition.js +3 -3
- package/dist/extensions/github/extension.d.ts +1 -1
- package/dist/extensions/github/index.d.ts +2 -2
- package/dist/extensions/github/index.js +4 -4
- package/dist/extensions/github/lifecycle.d.ts +3 -3
- package/dist/extensions/github/lifecycle.js +14 -14
- package/dist/extensions/github/live/context.d.ts +6 -0
- package/dist/extensions/github/live/context.js +16 -0
- package/dist/extensions/github/resource.d.ts +1 -1
- package/dist/extensions/playwright/driver.d.ts +8 -0
- package/dist/extensions/playwright/driver.js +60 -0
- package/dist/extensions/playwright/extension.d.ts +2 -0
- package/dist/extensions/playwright/extension.js +12 -0
- package/dist/extensions/playwright/plan/gateways.d.ts +62 -0
- package/dist/extensions/playwright/plan/gateways.js +4 -0
- package/dist/extensions/playwright/plan/list-output.d.ts +26 -0
- package/dist/extensions/playwright/plan/list-output.js +101 -0
- package/dist/extensions/playwright/plan/live/list-gateway.d.ts +15 -0
- package/dist/extensions/playwright/plan/live/list-gateway.js +100 -0
- package/dist/extensions/playwright/plan/plan.d.ts +44 -0
- package/dist/extensions/playwright/plan/plan.js +53 -0
- package/dist/extensions/testserver/command-tree.d.ts +1 -1
- package/dist/extensions/testserver/command-tree.js +2 -2
- package/dist/extensions/testserver/commands/app.d.ts +7 -7
- package/dist/extensions/testserver/commands/pool/create/command.d.ts +5 -5
- package/dist/extensions/testserver/commands/pool/create/command.js +12 -13
- package/dist/extensions/testserver/commands/pool/list/command.js +5 -6
- package/dist/extensions/testserver/{world.d.ts → context.d.ts} +1 -1
- package/dist/extensions/testserver/context.js +4 -0
- package/dist/extensions/testserver/definition.d.ts +2 -2
- package/dist/extensions/testserver/definition.js +8 -7
- package/dist/extensions/testserver/events.d.ts +1 -1
- package/dist/extensions/testserver/extension.d.ts +4 -3
- package/dist/extensions/testserver/extension.js +33 -20
- package/dist/extensions/testserver/index.d.ts +2 -2
- package/dist/extensions/testserver/index.js +2 -2
- package/dist/extensions/testserver/lifecycle.d.ts +6 -5
- package/dist/extensions/testserver/lifecycle.js +9 -8
- package/dist/extensions/testserver/live/context.d.ts +8 -0
- package/dist/extensions/testserver/live/{world.js → context.js} +6 -7
- package/dist/extensions/testserver/options/rules.d.ts +3 -3
- package/dist/extensions/testserver/options/rules.js +5 -4
- package/dist/extensions/testserver/options/sandboxes.d.ts +3 -2
- package/dist/extensions/testserver/options/sandboxes.js +3 -2
- package/dist/extensions/testserver/playwright/index.d.ts +33 -0
- package/dist/extensions/testserver/playwright/index.js +43 -0
- package/dist/extensions/testserver/presentation.d.ts +4 -4
- package/dist/extensions/testserver/presentation.js +7 -7
- package/dist/extensions/testserver/progress.d.ts +3 -3
- package/dist/extensions/testserver/progress.js +3 -3
- package/dist/extensions/testserver/provision.d.ts +2 -2
- package/dist/extensions/testserver/provision.js +10 -10
- package/dist/extensions/testserver/resource.d.ts +2 -2
- package/dist/extensions/testserver/result.d.ts +2 -2
- package/dist/extensions/testserver/result.js +1 -1
- package/dist/extensions/testserver/run/connection.d.ts +1 -1
- package/dist/extensions/testserver/run/connection.js +3 -3
- package/dist/extensions/testserver/run/sandbox.d.ts +31 -0
- package/dist/extensions/testserver/run/sandbox.js +58 -0
- package/dist/extensions/testserver/run-sandbox.d.ts +2 -2
- package/dist/extensions/testserver/run-sandbox.js +3 -3
- package/dist/extensions/testserver/vercel-cli/arguments.d.ts +2 -2
- package/dist/extensions/testserver/vercel-cli/arguments.js +6 -6
- package/dist/extensions/testserver/vercel-cli/auth-config.d.ts +7 -7
- package/dist/extensions/testserver/vercel-cli/auth-config.js +4 -4
- package/dist/extensions/testserver/vercel-cli/clock.js +1 -1
- package/dist/extensions/testserver/vercel-cli/config-files.js +1 -1
- package/dist/extensions/testserver/vercel-cli/context.d.ts +1 -1
- package/dist/extensions/testserver/vercel-cli/context.js +2 -2
- package/dist/extensions/testserver/vercel-cli/entry.d.ts +1 -1
- package/dist/extensions/testserver/vercel-cli/entry.js +1 -1
- package/dist/extensions/testserver/vercel-cli/environment.d.ts +5 -5
- package/dist/extensions/testserver/vercel-cli/environment.js +6 -6
- package/dist/extensions/testserver/vercel-cli/gateways.d.ts +1 -1
- package/dist/extensions/testserver/vercel-cli/gateways.js +3 -3
- package/dist/extensions/testserver/vercel-cli/index.d.ts +1 -1
- package/dist/extensions/testserver/vercel-cli/index.js +8 -9
- package/dist/extensions/testserver/vercel-cli/invocation.d.ts +13 -12
- package/dist/extensions/testserver/vercel-cli/invocation.js +1 -1
- package/dist/extensions/testserver/vercel-cli/{driver.d.ts → invoker.d.ts} +18 -17
- package/dist/extensions/testserver/vercel-cli/{driver.js → invoker.js} +8 -8
- package/dist/extensions/testserver/vercel-cli/live/config-files.d.ts +2 -2
- package/dist/extensions/testserver/vercel-cli/live/config-files.js +2 -2
- package/dist/extensions/testserver/vercel-cli/live/process-gateway.js +1 -1
- package/dist/extensions/testserver/vercel-cli/report.js +2 -2
- package/dist/extensions/testserver/vercel-cli/verbose.js +1 -1
- package/dist/extensions/testserver/vitest/config.d.ts +3 -3
- package/dist/extensions/testserver/vitest/config.js +5 -13
- package/dist/extensions/testserver/vitest/container-scope.d.ts +11 -11
- package/dist/extensions/testserver/vitest/container-scope.js +9 -9
- package/dist/extensions/testserver/vitest/container-start.d.ts +6 -6
- package/dist/extensions/testserver/vitest/container-start.js +14 -11
- package/dist/extensions/testserver/vitest/diagnostics.d.ts +1 -1
- package/dist/extensions/testserver/vitest/fixtures.d.ts +11 -11
- package/dist/extensions/testserver/vitest/fixtures.js +14 -23
- package/dist/extensions/testserver/vitest/index.d.ts +1 -1
- package/dist/extensions/testserver/vitest/index.js +4 -4
- package/dist/extensions/testserver/vitest/types.d.ts +16 -18
- package/dist/extensions/testserver/vitest/types.js +2 -2
- package/dist/extensions/testserver/vitest/worker-sandbox.d.ts +8 -0
- package/dist/extensions/testserver/vitest/worker-sandbox.js +17 -0
- package/dist/extensions/vitest/driver.d.ts +8 -0
- package/dist/extensions/vitest/driver.js +62 -0
- package/dist/extensions/vitest/extension.d.ts +2 -0
- package/dist/extensions/vitest/extension.js +8 -0
- package/dist/{vitest → extensions/vitest/plan}/gateways.d.ts +1 -26
- package/dist/extensions/vitest/plan/gateways.js +3 -0
- package/dist/{vitest → extensions/vitest/plan}/live/list-gateway.d.ts +1 -2
- package/dist/{vitest → extensions/vitest/plan}/live/list-gateway.js +1 -20
- package/dist/extensions/vitest/plan/plan-over.d.ts +38 -0
- package/dist/extensions/vitest/plan/plan-over.js +31 -0
- package/dist/extensions/vitest/plan/plan.d.ts +24 -0
- package/dist/{vitest → extensions/vitest/plan}/plan.js +11 -26
- package/dist/extensions.d.ts +40 -18
- package/dist/extensions.js +49 -22
- package/dist/forward-sigterm.js +1 -1
- package/dist/launcher-resolvers/index.d.ts +1 -1
- package/dist/launcher-resolvers/local-services.d.ts +9 -44
- package/dist/launcher-resolvers/local-services.js +4 -5
- package/dist/live-app.js +7 -6
- package/dist/local-services.d.ts +7 -15
- package/dist/local-services.js +8 -29
- package/dist/playwright/index.d.ts +1 -0
- package/dist/playwright/index.js +4 -0
- package/dist/playwright/reporter.d.ts +96 -0
- package/dist/playwright/reporter.js +162 -0
- package/dist/playwright/worker-index.d.ts +7 -0
- package/dist/playwright/worker-index.js +20 -0
- package/dist/run-directory/index.d.ts +1 -1
- package/dist/run-directory/index.js +2 -3
- package/dist/run-directory/plan.d.ts +3 -3
- package/dist/run-directory/plan.js +5 -5
- package/dist/run-directory/reader.js +2 -2
- package/dist/run-directory/recording.d.ts +8 -5
- package/dist/run-directory/recording.js +6 -6
- package/dist/run-directory/run-collector.d.ts +5 -5
- package/dist/run-directory/run-collector.js +5 -5
- package/dist/run-directory/run-record.d.ts +17 -90
- package/dist/run-directory/run-record.js +15 -55
- package/dist/run-directory/timeline-facts.d.ts +2 -1
- package/dist/run-directory/timeline-facts.js +4 -2
- package/dist/runner/build-snapshots.d.ts +115 -0
- package/dist/runner/build-snapshots.js +146 -0
- package/dist/runner/context.js +2 -1
- package/dist/runner/events.d.ts +24 -69
- package/dist/runner/gateways.d.ts +20 -18
- package/dist/runner/index.d.ts +8 -7
- package/dist/runner/index.js +5 -3
- package/dist/runner/live/checkout-gateway.js +15 -7
- package/dist/runner/live/snapshot-records.js +7 -17
- package/dist/runner/prepare.d.ts +17 -50
- package/dist/runner/prepare.js +21 -25
- package/dist/runner/ready.d.ts +15 -11
- package/dist/runner/ready.js +32 -40
- package/dist/runner/recipe.d.ts +4 -18
- package/dist/runner/recipe.js +1 -13
- package/dist/runner/scope.d.ts +8 -32
- package/dist/runner/scope.js +4 -12
- package/dist/runner/secrets.d.ts +6 -0
- package/dist/runner/secrets.js +10 -0
- package/dist/runner/session.d.ts +19 -38
- package/dist/runner/session.js +16 -55
- package/dist/runner/snapshot-build.d.ts +21 -11
- package/dist/runner/snapshot-build.js +11 -16
- package/dist/runner/snapshot-cache.d.ts +98 -72
- package/dist/runner/snapshot-cache.js +69 -118
- package/dist/runner/snapshot-inspect.d.ts +85 -0
- package/dist/runner/snapshot-inspect.js +164 -0
- package/dist/runner/snapshot-key.d.ts +13 -15
- package/dist/runner/snapshot-key.js +15 -22
- package/dist/sdk/extension/commands.d.ts +35 -17
- package/dist/sdk/extension/commands.js +13 -11
- package/dist/sdk/extension/driver.d.ts +143 -0
- package/dist/sdk/extension/driver.js +28 -0
- package/dist/sdk/extension/index.d.ts +2 -1
- package/dist/sdk/extension/index.js +15 -9
- package/dist/sdk/extension/{launcher-supplies.d.ts → launcher-context.d.ts} +3 -3
- package/dist/sdk/extension/launcher-context.js +5 -0
- package/dist/sdk/extension/lifecycle.d.ts +6 -5
- package/dist/sdk/extension/lifecycle.js +2 -2
- package/dist/sdk/extension/resource-definition.d.ts +13 -13
- package/dist/sdk/extension/resource-definition.js +2 -2
- package/dist/sdk/extension/resource.d.ts +13 -13
- package/dist/sdk/extension/resource.js +11 -11
- package/dist/sdk/extension/time.js +2 -2
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/index.js +3 -1
- package/dist/sdk/run/launcher.d.ts +1 -1
- package/dist/sdk/run/launcher.js +4 -3
- package/dist/sdk/run/payload.js +1 -1
- package/dist/sdk/run/test-events.d.ts +24 -18
- package/dist/sdk/run/test-events.js +5 -4
- package/dist/sdk/run/test-result-writer.d.ts +77 -0
- package/dist/sdk/run/test-result-writer.js +143 -0
- package/dist/sdk/run/worker-test-event-writer.d.ts +13 -0
- package/dist/sdk/run/worker-test-event-writer.js +31 -0
- package/dist/vendor/testserver-sdk/container/container.d.ts +1 -6
- package/dist/vendor/testserver-sdk/container/container.js +1 -5
- package/dist/vendor/testserver-sdk/factories/build.d.ts +12 -40
- package/dist/vendor/testserver-sdk/factories/build.js +15 -66
- package/dist/vendor/testserver-sdk/factories/gateways.d.ts +1 -2
- package/dist/vendor/testserver-sdk/factories/index.d.ts +1 -3
- package/dist/vendor/testserver-sdk/factories/index.js +3 -5
- package/dist/vendor/testserver-sdk/index.d.ts +1 -2
- package/dist/vendor/testserver-sdk/index.js +5 -6
- package/dist/vendor/testserver-sdk/records/body.d.ts +1 -1
- package/dist/vendor/testserver-sdk/records/body.js +1 -1
- package/dist/vitest/index.d.ts +2 -1
- package/dist/vitest/index.js +6 -4
- package/dist/vitest/test-events.d.ts +6 -16
- package/dist/vitest/test-events.js +15 -40
- package/dist/vitest/test-results.d.ts +9 -31
- package/dist/vitest/test-results.js +34 -105
- package/dist/vitest/worker-index.d.ts +6 -0
- package/dist/vitest/worker-index.js +17 -0
- package/package.json +23 -9
- package/skills/overview.md +6 -8
- package/skills/read-run-output.md +21 -7
- package/dist/chunks/chunk-FVMQKYTT.js +0 -10
- package/dist/chunks/chunk-SLNKW4ZM.js +0 -40
- package/dist/chunks/chunk-WNIQA5J6.js +0 -19
- package/dist/chunks/chunk-WSIF7SR6.js +0 -10
- package/dist/commands/vitest/outcomes.d.ts +0 -379
- package/dist/commands/vitest/outcomes.js +0 -70
- package/dist/core/launcher-supplies.d.ts +0 -11
- package/dist/core/launcher-supplies.js +0 -28
- package/dist/core/live/terminal-command-gateway.d.ts +0 -8
- package/dist/core/live/terminal-command-gateway.js +0 -49
- package/dist/core/resource-registry.js +0 -30
- package/dist/extensions/github/live/world.d.ts +0 -6
- package/dist/extensions/github/live/world.js +0 -16
- package/dist/extensions/github/world.js +0 -3
- package/dist/extensions/story/command-tree.d.ts +0 -6
- package/dist/extensions/story/command-tree.js +0 -21
- package/dist/extensions/story/commands/app.d.ts +0 -23
- package/dist/extensions/story/commands/app.js +0 -5
- package/dist/extensions/story/commands/run/command.d.ts +0 -211
- package/dist/extensions/story/commands/run/command.js +0 -259
- package/dist/extensions/story/commands/run/metadata.js +0 -8
- package/dist/extensions/story/commands/run/outcomes.d.ts +0 -101
- package/dist/extensions/story/commands/run/outcomes.js +0 -73
- package/dist/extensions/story/commands/tree.d.ts +0 -2
- package/dist/extensions/story/commands/tree.js +0 -6
- package/dist/extensions/story/extension.d.ts +0 -2
- package/dist/extensions/story/extension.js +0 -8
- package/dist/extensions/testserver/live/world.d.ts +0 -8
- package/dist/extensions/testserver/vitest/sandbox.d.ts +0 -25
- package/dist/extensions/testserver/vitest/sandbox.js +0 -43
- package/dist/extensions/testserver/world.js +0 -4
- package/dist/runner/snapshot-save.d.ts +0 -56
- package/dist/runner/snapshot-save.js +0 -151
- package/dist/sdk/extension/launcher-supplies.js +0 -3
- package/dist/story/align.d.ts +0 -37
- package/dist/story/align.js +0 -39
- package/dist/story/command-line.d.ts +0 -24
- package/dist/story/command-line.js +0 -88
- package/dist/story/definition.d.ts +0 -59
- package/dist/story/definition.js +0 -9
- package/dist/story/diff.d.ts +0 -9
- package/dist/story/diff.js +0 -97
- package/dist/story/errors.d.ts +0 -14
- package/dist/story/errors.js +0 -21
- package/dist/story/gateways.d.ts +0 -94
- package/dist/story/gateways.js +0 -3
- package/dist/story/host.d.ts +0 -30
- package/dist/story/host.js +0 -97
- package/dist/story/index.d.ts +0 -8
- package/dist/story/index.js +0 -11
- package/dist/story/json.d.ts +0 -16
- package/dist/story/json.js +0 -59
- package/dist/story/launch.d.ts +0 -70
- package/dist/story/launch.js +0 -77
- package/dist/story/live/recording-gateway.d.ts +0 -2
- package/dist/story/live/recording-gateway.js +0 -103
- package/dist/story/orphans.d.ts +0 -35
- package/dist/story/orphans.js +0 -51
- package/dist/story/recording.d.ts +0 -62
- package/dist/story/recording.js +0 -97
- package/dist/story/report.d.ts +0 -42
- package/dist/story/report.js +0 -129
- package/dist/story/sequence.d.ts +0 -30
- package/dist/story/sequence.js +0 -74
- package/dist/story/settle.d.ts +0 -96
- package/dist/story/settle.js +0 -71
- package/dist/story/start.d.ts +0 -50
- package/dist/story/start.js +0 -183
- package/dist/vendor/testserver-sdk/factories/definition.d.ts +0 -39
- package/dist/vendor/testserver-sdk/factories/definition.js +0 -16
- package/dist/vendor/testserver-sdk/factories/definitions.d.ts +0 -169
- package/dist/vendor/testserver-sdk/factories/definitions.js +0 -245
- package/dist/vendor/testserver-sdk/seed/index.d.ts +0 -1
- package/dist/vendor/testserver-sdk/seed/index.js +0 -3
- package/dist/vendor/testserver-sdk/seed/seed.d.ts +0 -221
- package/dist/vendor/testserver-sdk/seed/seed.js +0 -171
- package/dist/vitest/find-vitest.d.ts +0 -7
- package/dist/vitest/find-vitest.js +0 -28
- package/dist/vitest/gateways.js +0 -4
- package/dist/vitest/plan.d.ts +0 -51
- /package/dist/{extensions/story/commands/run → commands/playwright}/metadata.d.ts +0 -0
- /package/dist/{vitest → extensions/vitest/plan}/list-output.d.ts +0 -0
- /package/dist/{vitest → extensions/vitest/plan}/list-output.js +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// src/commands/snapshots/list/metadata.ts
|
|
2
|
+
var metadata = {
|
|
3
|
+
description: "List the runner snapshots cached on this machine, under ${XDG_STATE_HOME:-~/.local/state}/storm/runner/snapshots/, and mark the one a run here starts from. A runner snapshot is a base snapshot, built at a base by the runner recipe's toolchain and prebuild steps: a run builds one at HEAD's merge-base with a base ref when nothing fits, and storm snapshots build builds one without a run. A run starts only from a snapshot whose base is its merge-base and whose snapshot steps are the recipe's there. By default it lists the snapshots of the runner recipe in the storm.config.ts found from the working directory; without one it lists every snapshot and marks none. Each row gives the snapshot's base (with HEAD when it is HEAD's commit, and not in history when HEAD's history doesn't hold it, as after an amend or a rebase), when it was created, when it expires, and its id. The lines after the table say why a run here starts from the marked one, or why it builds a base snapshot, and why it starts from none of the others. It reads the cache and Git and runs the recipe's step functions at the merge-base, as a run does: it mints no credential, starts nothing, and changes nothing. A git failure or a step function that fails at the merge-base ends it with an error, as it would end a run here.",
|
|
4
|
+
summary: "List the cached runner snapshots.",
|
|
5
|
+
aliases: ["ls"],
|
|
6
|
+
help: {
|
|
7
|
+
fields: {
|
|
8
|
+
all: {
|
|
9
|
+
description: "Also list the snapshots of other runner recipes, and of this recipe's other regions and runtimes, with a RECIPE column. A run here starts from none of them."
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
examples: [
|
|
13
|
+
{ argv: "", description: "List this recipe's cached snapshots, and mark the one a run here starts from." },
|
|
14
|
+
{ argv: "--all", description: "List every runner snapshot cached on this machine." },
|
|
15
|
+
{
|
|
16
|
+
argv: "--json",
|
|
17
|
+
description: "List the snapshots as JSON, each with its commits and why a run here doesn't start from it."
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
metadata
|
|
24
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { InspectedSnapshot } from "../../../runner/index.ts";
|
|
3
|
+
declare const snapshotSchema: z.ZodObject<{
|
|
4
|
+
snapshotId: z.ZodString;
|
|
5
|
+
recipe: z.ZodString;
|
|
6
|
+
region: z.ZodString;
|
|
7
|
+
runtime: z.ZodString;
|
|
8
|
+
teamId: z.ZodString;
|
|
9
|
+
projectId: z.ZodString;
|
|
10
|
+
base: z.ZodString;
|
|
11
|
+
inHistory: z.ZodNullable<z.ZodBoolean>;
|
|
12
|
+
builtBehind: z.ZodNullable<z.ZodNumber>;
|
|
13
|
+
createdAt: z.ZodString;
|
|
14
|
+
expiresAt: z.ZodString;
|
|
15
|
+
expired: z.ZodBoolean;
|
|
16
|
+
picked: z.ZodBoolean;
|
|
17
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
18
|
+
expired: "expired";
|
|
19
|
+
"expires-soon": "expires-soon";
|
|
20
|
+
"other-base": "other-base";
|
|
21
|
+
"other-owner": "other-owner";
|
|
22
|
+
"other-recipe": "other-recipe";
|
|
23
|
+
"steps-changed": "steps-changed";
|
|
24
|
+
}>>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
type SnapshotFacts = z.output<typeof snapshotSchema>;
|
|
27
|
+
/** One inspected snapshot as the result reports it. */
|
|
28
|
+
export declare function snapshotFacts(snapshot: InspectedSnapshot): SnapshotFacts;
|
|
29
|
+
/**
|
|
30
|
+
* The snapshots in the table's order: those built in HEAD's history first, fewest commits behind HEAD first, and
|
|
31
|
+
* those storm couldn't count last; then the newest, then by id.
|
|
32
|
+
*/
|
|
33
|
+
export declare function inTableOrder(snapshots: readonly SnapshotFacts[]): SnapshotFacts[];
|
|
34
|
+
/** How `snapshots list` ends. */
|
|
35
|
+
export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
36
|
+
listed: z.ZodObject<{
|
|
37
|
+
directory: z.ZodString;
|
|
38
|
+
configFile: z.ZodNullable<z.ZodString>;
|
|
39
|
+
picking: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
40
|
+
kind: z.ZodLiteral<"recipe">;
|
|
41
|
+
recipe: z.ZodString;
|
|
42
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
43
|
+
kind: z.ZodLiteral<"none">;
|
|
44
|
+
why: z.ZodEnum<{
|
|
45
|
+
"no-base": "no-base";
|
|
46
|
+
"no-checkout": "no-checkout";
|
|
47
|
+
"no-recipe": "no-recipe";
|
|
48
|
+
}>;
|
|
49
|
+
}, z.core.$strip>], "kind">;
|
|
50
|
+
all: z.ZodBoolean;
|
|
51
|
+
head: z.ZodNullable<z.ZodString>;
|
|
52
|
+
mergeBase: z.ZodNullable<z.ZodString>;
|
|
53
|
+
mergeBaseRef: z.ZodNullable<z.ZodString>;
|
|
54
|
+
readAt: z.ZodString;
|
|
55
|
+
snapshots: z.ZodArray<z.ZodObject<{
|
|
56
|
+
snapshotId: z.ZodString;
|
|
57
|
+
recipe: z.ZodString;
|
|
58
|
+
region: z.ZodString;
|
|
59
|
+
runtime: z.ZodString;
|
|
60
|
+
teamId: z.ZodString;
|
|
61
|
+
projectId: z.ZodString;
|
|
62
|
+
base: z.ZodString;
|
|
63
|
+
inHistory: z.ZodNullable<z.ZodBoolean>;
|
|
64
|
+
builtBehind: z.ZodNullable<z.ZodNumber>;
|
|
65
|
+
createdAt: z.ZodString;
|
|
66
|
+
expiresAt: z.ZodString;
|
|
67
|
+
expired: z.ZodBoolean;
|
|
68
|
+
picked: z.ZodBoolean;
|
|
69
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
70
|
+
expired: "expired";
|
|
71
|
+
"expires-soon": "expires-soon";
|
|
72
|
+
"other-base": "other-base";
|
|
73
|
+
"other-owner": "other-owner";
|
|
74
|
+
"other-recipe": "other-recipe";
|
|
75
|
+
"steps-changed": "steps-changed";
|
|
76
|
+
}>>;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
unreadable: z.ZodArray<z.ZodObject<{
|
|
79
|
+
file: z.ZodString;
|
|
80
|
+
reason: z.ZodString;
|
|
81
|
+
}, z.core.$strip>>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
}, {
|
|
84
|
+
listed: unknown;
|
|
85
|
+
}, {
|
|
86
|
+
invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
|
|
87
|
+
file: string;
|
|
88
|
+
problems: {
|
|
89
|
+
key: string | null;
|
|
90
|
+
location: {
|
|
91
|
+
line: number;
|
|
92
|
+
column: number | null;
|
|
93
|
+
} | null;
|
|
94
|
+
problem: string;
|
|
95
|
+
}[];
|
|
96
|
+
}]>;
|
|
97
|
+
snapshotCacheUnreadable: z.ZodObject<{
|
|
98
|
+
path: z.ZodString;
|
|
99
|
+
message: z.ZodString;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
checkoutFailed: z.ZodObject<{
|
|
102
|
+
message: z.ZodString;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
}, {
|
|
105
|
+
readonly invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
|
|
106
|
+
file: string;
|
|
107
|
+
problems: {
|
|
108
|
+
key: string | null;
|
|
109
|
+
location: {
|
|
110
|
+
line: number;
|
|
111
|
+
column: number | null;
|
|
112
|
+
} | null;
|
|
113
|
+
problem: string;
|
|
114
|
+
}[];
|
|
115
|
+
}]>;
|
|
116
|
+
readonly snapshotCacheUnreadable: {
|
|
117
|
+
readonly exitCode: 1;
|
|
118
|
+
readonly description: "storm couldn't read the runner snapshot cache's directory.";
|
|
119
|
+
readonly schema: z.ZodObject<{
|
|
120
|
+
path: z.ZodString;
|
|
121
|
+
message: z.ZodString;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
readonly render: ({ path: where, message }: {
|
|
124
|
+
readonly path: string;
|
|
125
|
+
readonly message: string;
|
|
126
|
+
}) => {
|
|
127
|
+
message: string;
|
|
128
|
+
rows: (readonly ["Path", string])[];
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
readonly checkoutFailed: {
|
|
132
|
+
readonly exitCode: 1;
|
|
133
|
+
readonly description: "git failed while storm checked the checkout or a cached snapshot's base, as a run here would refuse.";
|
|
134
|
+
readonly schema: z.ZodObject<{
|
|
135
|
+
message: z.ZodString;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
readonly render: ({ message }: {
|
|
138
|
+
readonly message: string;
|
|
139
|
+
}) => {
|
|
140
|
+
message: string;
|
|
141
|
+
next: {
|
|
142
|
+
type: "text";
|
|
143
|
+
text: string;
|
|
144
|
+
}[];
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
}>;
|
|
148
|
+
export {};
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { path, renderOutcome } from "@vercel/clinkr/vcli-kit";
|
|
2
|
+
import { defineOutcomes } from "@vercel/clinkr";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { configErrors } from "../../../config/index.js";
|
|
5
|
+
import { builtAtText, REJECTION_REASONS, REJECTIONS_SHOWN, rejectionText } from "../../exec/snapshot-text.js";
|
|
6
|
+
import { short } from "../../exec/text.js";
|
|
7
|
+
/** Why a run here doesn't start from a snapshot: a run's own reasons, or that it is another recipe's. */
|
|
8
|
+
const reasonSchema = z.enum([...REJECTION_REASONS, "other-recipe"]);
|
|
9
|
+
const snapshotSchema = z.object({
|
|
10
|
+
/** The snapshot's id in Vercel Sandbox. */
|
|
11
|
+
snapshotId: z.string(),
|
|
12
|
+
/** The runner recipe's name, region and runtime it was built for. */
|
|
13
|
+
recipe: z.string(),
|
|
14
|
+
region: z.string(),
|
|
15
|
+
runtime: z.string(),
|
|
16
|
+
/** The team and project ids it was built for. */
|
|
17
|
+
teamId: z.string(),
|
|
18
|
+
projectId: z.string(),
|
|
19
|
+
/** Its base, a full SHA: the commit it was built at, whose tracked files its repository holds. */
|
|
20
|
+
base: z.string(),
|
|
21
|
+
/** Whether HEAD is the base or holds it in its history; null when storm didn't check. An amend or a rebase can take a commit out of it. */
|
|
22
|
+
inHistory: z.boolean().nullable(),
|
|
23
|
+
/** How many commits HEAD has that the base lacks, 0 for HEAD's commit; null when HEAD's history doesn't hold it or storm didn't count. */
|
|
24
|
+
builtBehind: z.number().nullable(),
|
|
25
|
+
/** When it was created and when it expires, as ISO times. */
|
|
26
|
+
createdAt: z.string(),
|
|
27
|
+
expiresAt: z.string(),
|
|
28
|
+
/** Whether it had expired when storm read the cache. */
|
|
29
|
+
expired: z.boolean(),
|
|
30
|
+
/** Whether a run here, with a credential for its team and project, starts from it. */
|
|
31
|
+
picked: z.boolean(),
|
|
32
|
+
/** Why a run here doesn't start from it; null for a picked one, and when storm picked for no recipe. */
|
|
33
|
+
reason: reasonSchema.nullable(),
|
|
34
|
+
});
|
|
35
|
+
const listedSchema = z.object({
|
|
36
|
+
/** Where the runner snapshot cache lives. */
|
|
37
|
+
directory: z.string(),
|
|
38
|
+
/** The config file whose runner recipe storm picked for; null when none applies. */
|
|
39
|
+
configFile: z.string().nullable(),
|
|
40
|
+
/** The recipe a run here uses, when storm marked what it starts from; else why it marked nothing: the directory is in no Git checkout, no runner recipe applies, or no base ref of the recipe shares history with HEAD. */
|
|
41
|
+
picking: z.discriminatedUnion("kind", [
|
|
42
|
+
z.object({ kind: z.literal("recipe"), recipe: z.string() }),
|
|
43
|
+
z.object({ kind: z.literal("none"), why: z.enum(["no-checkout", "no-recipe", "no-base"]) }),
|
|
44
|
+
]),
|
|
45
|
+
/** Whether --all asked for other recipes' snapshots too. */
|
|
46
|
+
all: z.boolean(),
|
|
47
|
+
/** HEAD's commit, a full SHA; null outside a Git checkout. */
|
|
48
|
+
head: z.string().nullable(),
|
|
49
|
+
/** HEAD's merge-base with a base ref of the recipe, a full SHA, and that ref; null when storm picked for no recipe. */
|
|
50
|
+
mergeBase: z.string().nullable(),
|
|
51
|
+
mergeBaseRef: z.string().nullable(),
|
|
52
|
+
/** When storm read the cache, as an ISO time: what "ago" and "in" count from. */
|
|
53
|
+
readAt: z.string(),
|
|
54
|
+
/** The snapshots, in the table's order. */
|
|
55
|
+
snapshots: z.array(snapshotSchema),
|
|
56
|
+
/** The cache files storm can't read, each with why. */
|
|
57
|
+
unreadable: z.array(z.object({ file: z.string(), reason: z.string() })),
|
|
58
|
+
});
|
|
59
|
+
/** One inspected snapshot as the result reports it. */
|
|
60
|
+
export function snapshotFacts(snapshot) {
|
|
61
|
+
const { entry } = snapshot;
|
|
62
|
+
return {
|
|
63
|
+
snapshotId: entry.snapshotId,
|
|
64
|
+
recipe: entry.recipeName,
|
|
65
|
+
region: entry.region,
|
|
66
|
+
runtime: entry.runtime,
|
|
67
|
+
teamId: entry.teamId,
|
|
68
|
+
projectId: entry.projectId,
|
|
69
|
+
base: entry.base,
|
|
70
|
+
inHistory: snapshot.inHistory,
|
|
71
|
+
builtBehind: snapshot.builtBehind,
|
|
72
|
+
createdAt: entry.createdAt,
|
|
73
|
+
expiresAt: entry.expiresAt,
|
|
74
|
+
expired: snapshot.expired,
|
|
75
|
+
picked: snapshot.picked,
|
|
76
|
+
reason: snapshot.reason,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The snapshots in the table's order: those built in HEAD's history first, fewest commits behind HEAD first, and
|
|
81
|
+
* those storm couldn't count last; then the newest, then by id.
|
|
82
|
+
*/
|
|
83
|
+
export function inTableOrder(snapshots) {
|
|
84
|
+
const last = Number.MAX_SAFE_INTEGER;
|
|
85
|
+
return snapshots.toSorted((a, b) => (a.builtBehind ?? last) - (b.builtBehind ?? last) ||
|
|
86
|
+
Date.parse(b.createdAt) - Date.parse(a.createdAt) ||
|
|
87
|
+
a.snapshotId.localeCompare(b.snapshotId));
|
|
88
|
+
}
|
|
89
|
+
/** A span of time as the table says it: whole days, else hours, else minutes. */
|
|
90
|
+
function spanText(ms) {
|
|
91
|
+
const minutes = Math.floor(Math.abs(ms) / 60_000);
|
|
92
|
+
if (minutes >= 24 * 60)
|
|
93
|
+
return `${Math.floor(minutes / (24 * 60))}d`;
|
|
94
|
+
return minutes >= 60 ? `${Math.floor(minutes / 60)}h` : `${minutes}m`;
|
|
95
|
+
}
|
|
96
|
+
/** The base cell: the commit, with `HEAD` when it is HEAD's commit and `not in history` when HEAD lacks it. */
|
|
97
|
+
function baseCell(snapshot) {
|
|
98
|
+
const where = snapshot.builtBehind === 0 ? ", HEAD" : snapshot.inHistory === false ? ", not in history" : "";
|
|
99
|
+
return `${short(snapshot.base)}${where}`;
|
|
100
|
+
}
|
|
101
|
+
/** The table's rows, one per snapshot, with a `RECIPE` column under `--all`. */
|
|
102
|
+
function tableOf(listed) {
|
|
103
|
+
const now = Date.parse(listed.readAt);
|
|
104
|
+
const recipeColumn = listed.all || listed.picking.kind === "none";
|
|
105
|
+
return {
|
|
106
|
+
columns: ["", "BASE", "CREATED", "EXPIRES", ...(recipeColumn ? ["RECIPE"] : []), "ID"],
|
|
107
|
+
rows: listed.snapshots.map((snapshot) => [
|
|
108
|
+
snapshot.picked ? "▸" : "",
|
|
109
|
+
baseCell(snapshot),
|
|
110
|
+
`${spanText(now - Date.parse(snapshot.createdAt))} ago`,
|
|
111
|
+
snapshot.expired ? "expired" : `in ${spanText(Date.parse(snapshot.expiresAt) - now)}`,
|
|
112
|
+
...(recipeColumn ? [snapshot.recipe] : []),
|
|
113
|
+
snapshot.snapshotId,
|
|
114
|
+
]),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/** Why storm marked no snapshot, when it picked for no recipe. */
|
|
118
|
+
const UNPICKED_TEXT = {
|
|
119
|
+
"no-checkout": "This directory is in no Git checkout, so storm can't say which snapshot a run starts from.",
|
|
120
|
+
"no-recipe": "No runner recipe applies here, so no run here starts from one of them.",
|
|
121
|
+
"no-base": "No base ref of the runner recipe shares history with HEAD, so a run here can't pick a base.",
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* The lines after the table: for each team and project, the snapshot a run here starts from, or that it builds a
|
|
125
|
+
* base snapshot; then why it starts from none of the recipe's others, `REJECTIONS_SHOWN` at most.
|
|
126
|
+
*/
|
|
127
|
+
function explanationOf(listed) {
|
|
128
|
+
if (listed.picking.kind === "none")
|
|
129
|
+
return UNPICKED_TEXT[listed.picking.why];
|
|
130
|
+
const ofRecipe = listed.snapshots.filter((snapshot) => snapshot.reason !== "other-recipe");
|
|
131
|
+
const owners = [...new Set(ofRecipe.map(({ teamId, projectId }) => `${teamId}/${projectId}`))];
|
|
132
|
+
const building = listed.mergeBase === null
|
|
133
|
+
? "builds a base snapshot"
|
|
134
|
+
: `builds a base snapshot at the merge-base (${short(listed.mergeBase)})`;
|
|
135
|
+
const lines = [];
|
|
136
|
+
if (owners.length === 0)
|
|
137
|
+
lines.push(`A run here ${building}: the cache holds no snapshot of recipe ${listed.picking.recipe}.`);
|
|
138
|
+
for (const owner of owners) {
|
|
139
|
+
const who = owners.length === 1 ? "A run here" : `A run here for team and project ${owner}`;
|
|
140
|
+
const owned = ofRecipe.filter((snapshot) => `${snapshot.teamId}/${snapshot.projectId}` === owner);
|
|
141
|
+
const pick = owned.find((snapshot) => snapshot.picked);
|
|
142
|
+
lines.push(pick !== undefined
|
|
143
|
+
? `${who} starts from ${pick.snapshotId}, ${builtAtText({ base: pick.base, builtBehind: pick.builtBehind, mergeBase: listed.mergeBase ?? undefined })}.`
|
|
144
|
+
: `${who} ${building}: no cached snapshot fits.`);
|
|
145
|
+
}
|
|
146
|
+
if (owners.length > 1)
|
|
147
|
+
lines.push("The run's credential decides the team and project.");
|
|
148
|
+
const others = ofRecipe.filter((snapshot) => !snapshot.picked && snapshot.reason !== null && snapshot.reason !== "other-recipe");
|
|
149
|
+
for (const snapshot of others.slice(0, REJECTIONS_SHOWN))
|
|
150
|
+
lines.push(` ${snapshot.snapshotId}: ${rejectionText(snapshot.reason, snapshot)}`);
|
|
151
|
+
if (others.length > REJECTIONS_SHOWN)
|
|
152
|
+
lines.push(` and ${others.length - REJECTIONS_SHOWN} more: --json lists each one's reason`);
|
|
153
|
+
return lines.join("\n");
|
|
154
|
+
}
|
|
155
|
+
/** How `snapshots list` ends. */
|
|
156
|
+
export const outcomes = defineOutcomes({
|
|
157
|
+
results: {
|
|
158
|
+
listed: {
|
|
159
|
+
schema: listedSchema,
|
|
160
|
+
description: "The cached runner snapshots in the scope, with the one a run here starts from marked; none is an empty list.",
|
|
161
|
+
render: (listed) => renderOutcome({
|
|
162
|
+
rows: [
|
|
163
|
+
["Cache", path(listed.directory)],
|
|
164
|
+
...(listed.picking.kind === "recipe" ? [["Recipe", listed.picking.recipe]] : []),
|
|
165
|
+
...(listed.configFile === null ? [] : [["Config", path(listed.configFile)]]),
|
|
166
|
+
],
|
|
167
|
+
...(listed.snapshots.length === 0 ? {} : { table: tableOf(listed) }),
|
|
168
|
+
message: listed.snapshots.length === 0 && listed.picking.kind === "none"
|
|
169
|
+
? `No runner snapshots are cached. ${UNPICKED_TEXT[listed.picking.why]}`
|
|
170
|
+
: explanationOf(listed),
|
|
171
|
+
...(listed.unreadable.length === 0
|
|
172
|
+
? {}
|
|
173
|
+
: {
|
|
174
|
+
warnings: listed.unreadable.map(({ file, reason }) => ({
|
|
175
|
+
reason: "snapshot_file_unreadable",
|
|
176
|
+
message: `storm can't read the cache file ${file}: ${reason}. No run starts from it.`,
|
|
177
|
+
})),
|
|
178
|
+
}),
|
|
179
|
+
next: [
|
|
180
|
+
{
|
|
181
|
+
type: "text",
|
|
182
|
+
text: "storm snapshots build builds a base snapshot at the merge-base without a test run.",
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
}),
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
errors: {
|
|
189
|
+
invalidConfig: configErrors.invalidConfig,
|
|
190
|
+
snapshotCacheUnreadable: {
|
|
191
|
+
exitCode: 1,
|
|
192
|
+
description: "storm couldn't read the runner snapshot cache's directory.",
|
|
193
|
+
schema: z.object({
|
|
194
|
+
/** The directory the read failed on. */
|
|
195
|
+
path: z.string(),
|
|
196
|
+
/** What the OS said. */
|
|
197
|
+
message: z.string(),
|
|
198
|
+
}),
|
|
199
|
+
render: ({ path: where, message }) => ({
|
|
200
|
+
message: `Couldn't read the runner snapshot cache: ${message}`,
|
|
201
|
+
rows: [["Path", where]],
|
|
202
|
+
}),
|
|
203
|
+
},
|
|
204
|
+
checkoutFailed: {
|
|
205
|
+
exitCode: 1,
|
|
206
|
+
description: "git failed while storm checked the checkout or a cached snapshot's base, as a run here would refuse.",
|
|
207
|
+
schema: z.object({
|
|
208
|
+
/** What git said. */
|
|
209
|
+
message: z.string(),
|
|
210
|
+
}),
|
|
211
|
+
render: ({ message }) => ({
|
|
212
|
+
message: `git failed on this machine: ${message}.`,
|
|
213
|
+
next: [{ type: "text", text: "Fix the checkout, then run again." }],
|
|
214
|
+
}),
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
});
|