@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,85 @@
|
|
|
1
|
+
import type { CheckoutFailure, CheckoutHead, RunnerSnapshotEntry, UnreadableSnapshotEntry } from "./gateways.ts";
|
|
2
|
+
import type { CheckedRecipe } from "./recipe.ts";
|
|
3
|
+
import { type SnapshotCacheContext, type SnapshotRejectionReason } from "./snapshot-cache.ts";
|
|
4
|
+
/**
|
|
5
|
+
* One cached runner snapshot, as a checkout sees it: from the checkout's Git history, whether HEAD is its base or
|
|
6
|
+
* holds it (`inHistory`), which an amend or a rebase can change, and how many commits HEAD has that its base lacks
|
|
7
|
+
* (`builtBehind`). `inHistory` is null when storm didn't check it: outside a Git checkout, or without a recipe or a
|
|
8
|
+
* base; `builtBehind` is null then too, and when the base isn't in HEAD's history. `picked` says a run here starts
|
|
9
|
+
* from it, for its team and project.
|
|
10
|
+
* `reason` says why a run here doesn't (`SnapshotRejectionReason`), `other-recipe` for another recipe's, or null for
|
|
11
|
+
* a picked one and when storm checked nothing.
|
|
12
|
+
*/
|
|
13
|
+
export interface InspectedSnapshot {
|
|
14
|
+
readonly entry: RunnerSnapshotEntry;
|
|
15
|
+
readonly inHistory: boolean | null;
|
|
16
|
+
readonly builtBehind: number | null;
|
|
17
|
+
readonly expired: boolean;
|
|
18
|
+
readonly picked: boolean;
|
|
19
|
+
readonly reason: SnapshotRejectionReason | "other-recipe" | null;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Why the inspection picked for no recipe: the directory is in no Git checkout (`no-checkout`), no runner recipe
|
|
23
|
+
* applies there (`no-recipe`), or no base ref of the recipe exists locally and shares history with HEAD (`no-base`).
|
|
24
|
+
*/
|
|
25
|
+
export type UnpickedReason = "no-checkout" | "no-recipe" | "no-base";
|
|
26
|
+
/** What `inspectSnapshotCache` found. */
|
|
27
|
+
export interface SnapshotCacheInspection {
|
|
28
|
+
/** Where the cache lives. */
|
|
29
|
+
readonly directory: string;
|
|
30
|
+
/** The checkout the directory is in: its root, HEAD, and HEAD's merge-base with a base ref; null without one. */
|
|
31
|
+
readonly checkout: {
|
|
32
|
+
readonly repoRoot: string;
|
|
33
|
+
readonly head: CheckoutHead;
|
|
34
|
+
readonly mergeBase: {
|
|
35
|
+
readonly commit: string;
|
|
36
|
+
readonly ref: string;
|
|
37
|
+
} | null;
|
|
38
|
+
} | null;
|
|
39
|
+
/** The recipe a run here uses, by name, when storm picked for it; else why it picked for none. */
|
|
40
|
+
readonly picking: {
|
|
41
|
+
readonly kind: "recipe";
|
|
42
|
+
readonly recipe: string;
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: "none";
|
|
45
|
+
readonly why: UnpickedReason;
|
|
46
|
+
};
|
|
47
|
+
/** The recipe's snapshots, and with `all` every other recipe's too. */
|
|
48
|
+
readonly snapshots: readonly InspectedSnapshot[];
|
|
49
|
+
readonly unreadable: readonly UnreadableSnapshotEntry[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* How an inspection ended: what it found; the cache it couldn't list; git failing while it checked the checkout or a
|
|
53
|
+
* snapshot (`checkout-failed`); or a step function of the recipe that failed or returned something storm can't use at
|
|
54
|
+
* the merge-base (`invalid-recipe`), as a run's local checks refuse it, with `path` the key inside the recipe.
|
|
55
|
+
*/
|
|
56
|
+
export type SnapshotCacheInspectionOutcome = {
|
|
57
|
+
readonly kind: "ok";
|
|
58
|
+
readonly inspection: SnapshotCacheInspection;
|
|
59
|
+
} | {
|
|
60
|
+
readonly kind: "cache-unreadable";
|
|
61
|
+
readonly path: string;
|
|
62
|
+
readonly message: string;
|
|
63
|
+
} | {
|
|
64
|
+
readonly kind: "checkout-failed";
|
|
65
|
+
readonly failure: CheckoutFailure;
|
|
66
|
+
} | {
|
|
67
|
+
readonly kind: "invalid-recipe";
|
|
68
|
+
readonly path: readonly string[];
|
|
69
|
+
readonly problem: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Inspects the cache from `cwd` for `recipe`, the runner recipe that applies there, if any. With a recipe, in a Git
|
|
73
|
+
* checkout whose HEAD shares history with one of its base refs, it marks for each team and project the snapshot a run
|
|
74
|
+
* here starts from, by a run's own rule (`classifySnapshotEntries`, `pickSnapshot`), and gives each other
|
|
75
|
+
* snapshot of the recipe the reason it isn't picked. It runs the recipe's snapshot steps at the merge-base for the
|
|
76
|
+
* run's snapshot key, as a run does. Otherwise it picks none and
|
|
77
|
+
* says why. `all` adds the snapshots of other recipes, and of the recipe's other regions and runtimes, as
|
|
78
|
+
* `other-recipe`. It lists the cache once and classifies that listing, which removes no file, so an expired entry of
|
|
79
|
+
* the recipe stays and is `expired`. A git failure ends it with `checkout-failed`, as it ends a run.
|
|
80
|
+
*/
|
|
81
|
+
export declare function inspectSnapshotCache(context: SnapshotCacheContext, request: {
|
|
82
|
+
readonly cwd: string;
|
|
83
|
+
readonly recipe: CheckedRecipe | undefined;
|
|
84
|
+
readonly all: boolean;
|
|
85
|
+
}): Promise<SnapshotCacheInspectionOutcome>;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// What the runner snapshot cache holds, as a checkout sees it: every cached snapshot with where it was built, in
|
|
2
|
+
// commits, and for the checkout's recipe which one a run here starts from and why not from each other one. It reads
|
|
3
|
+
// the cache and Git, and changes nothing: no file is removed, nothing is minted, and no sandbox starts.
|
|
4
|
+
import { resolveBase } from "./base.js";
|
|
5
|
+
import { classifySnapshotEntries, isExpiredEntry, pickSnapshot, } from "./snapshot-cache.js";
|
|
6
|
+
import { snapshotStepsAt } from "./snapshot-key.js";
|
|
7
|
+
/**
|
|
8
|
+
* Inspects the cache from `cwd` for `recipe`, the runner recipe that applies there, if any. With a recipe, in a Git
|
|
9
|
+
* checkout whose HEAD shares history with one of its base refs, it marks for each team and project the snapshot a run
|
|
10
|
+
* here starts from, by a run's own rule (`classifySnapshotEntries`, `pickSnapshot`), and gives each other
|
|
11
|
+
* snapshot of the recipe the reason it isn't picked. It runs the recipe's snapshot steps at the merge-base for the
|
|
12
|
+
* run's snapshot key, as a run does. Otherwise it picks none and
|
|
13
|
+
* says why. `all` adds the snapshots of other recipes, and of the recipe's other regions and runtimes, as
|
|
14
|
+
* `other-recipe`. It lists the cache once and classifies that listing, which removes no file, so an expired entry of
|
|
15
|
+
* the recipe stays and is `expired`. A git failure ends it with `checkout-failed`, as it ends a run.
|
|
16
|
+
*/
|
|
17
|
+
export async function inspectSnapshotCache(context, request) {
|
|
18
|
+
const { checkout, runnerSnapshots } = context;
|
|
19
|
+
const { recipe } = request;
|
|
20
|
+
const listed = await runnerSnapshots.listEntries();
|
|
21
|
+
if (!listed.ok)
|
|
22
|
+
return { kind: "cache-unreadable", ...listed.failure };
|
|
23
|
+
const { directory, entries, unreadable } = listed.value;
|
|
24
|
+
const now = context.clock.now();
|
|
25
|
+
const ofRecipe = (entry) => recipe !== undefined &&
|
|
26
|
+
entry.recipeName === recipe.name &&
|
|
27
|
+
entry.region === recipe.region &&
|
|
28
|
+
entry.runtime === recipe.runtime;
|
|
29
|
+
const shows = (entry) => request.all || recipe === undefined || ofRecipe(entry);
|
|
30
|
+
const shown = entries.filter(shows);
|
|
31
|
+
const root = await checkout.repositoryRoot({ cwd: request.cwd });
|
|
32
|
+
const head = root.ok ? await checkout.head({ repoRoot: root.value }) : undefined;
|
|
33
|
+
if (!root.ok || head === undefined || !head.ok) {
|
|
34
|
+
return {
|
|
35
|
+
kind: "ok",
|
|
36
|
+
inspection: {
|
|
37
|
+
directory,
|
|
38
|
+
checkout: null,
|
|
39
|
+
picking: { kind: "none", why: "no-checkout" },
|
|
40
|
+
snapshots: shown.map((entry) => unchecked(entry, now)),
|
|
41
|
+
unreadable,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const repoRoot = root.value;
|
|
46
|
+
const resolved = recipe === undefined ? undefined : await resolveBase(checkout, { repoRoot, baseRefs: recipe.baseRefs });
|
|
47
|
+
if (resolved?.kind === "failed")
|
|
48
|
+
return { kind: "checkout-failed", failure: resolved.failure };
|
|
49
|
+
if (recipe === undefined || resolved === undefined || resolved.kind !== "resolved") {
|
|
50
|
+
return {
|
|
51
|
+
kind: "ok",
|
|
52
|
+
inspection: {
|
|
53
|
+
directory,
|
|
54
|
+
checkout: { repoRoot, head: head.value, mergeBase: null },
|
|
55
|
+
picking: { kind: "none", why: recipe === undefined ? "no-recipe" : "no-base" },
|
|
56
|
+
snapshots: shown.map((entry) => unchecked(entry, now)),
|
|
57
|
+
unreadable,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const mergeBase = resolved.base;
|
|
62
|
+
const steps = await snapshotStepsAt(checkout, { repoRoot, base: mergeBase, recipe });
|
|
63
|
+
if (!steps.ok)
|
|
64
|
+
return { kind: "invalid-recipe", path: steps.path, problem: steps.problem };
|
|
65
|
+
const afterBase = await checkout.commitCount({ repoRoot, from: mergeBase, to: "HEAD" });
|
|
66
|
+
if (!afterBase.ok)
|
|
67
|
+
return { kind: "checkout-failed", failure: afterBase.failure };
|
|
68
|
+
// The one listing above is classified as a run would, but nothing is removed: an expired entry is `expired`.
|
|
69
|
+
const read = classifySnapshotEntries(context, {
|
|
70
|
+
entries,
|
|
71
|
+
recipe,
|
|
72
|
+
base: mergeBase,
|
|
73
|
+
snapshotKey: steps.key,
|
|
74
|
+
commitsAfterBase: afterBase.value,
|
|
75
|
+
});
|
|
76
|
+
// The choice is per team and project, since the credential that names them isn't minted here. Every entry that isn't
|
|
77
|
+
// a candidate keeps the classification's reason, since it is ruled out whoever the run's credential names.
|
|
78
|
+
const owners = new Map(read.candidates.map(({ entry }) => [`${entry.teamId}\0${entry.projectId}`, entry]));
|
|
79
|
+
const picked = new Set();
|
|
80
|
+
for (const owner of owners.values()) {
|
|
81
|
+
const pick = pickSnapshot(read.candidates, owner);
|
|
82
|
+
if (pick !== undefined)
|
|
83
|
+
picked.add(pick);
|
|
84
|
+
}
|
|
85
|
+
const place = historyPlacer(context, { repoRoot, mergeBase, commitsAfterBase: afterBase.value });
|
|
86
|
+
const snapshots = [];
|
|
87
|
+
for (const verdict of read.verdicts) {
|
|
88
|
+
const { entry } = verdict;
|
|
89
|
+
if (!shows(entry))
|
|
90
|
+
continue;
|
|
91
|
+
const expired = isExpiredEntry(entry, now);
|
|
92
|
+
if (verdict.kind === "candidate") {
|
|
93
|
+
const { candidate } = verdict;
|
|
94
|
+
snapshots.push({
|
|
95
|
+
entry,
|
|
96
|
+
inHistory: true,
|
|
97
|
+
builtBehind: candidate.builtBehind,
|
|
98
|
+
expired,
|
|
99
|
+
picked: picked.has(candidate),
|
|
100
|
+
reason: null,
|
|
101
|
+
});
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
// Where a snapshot no run here starts from sits in HEAD's history, for the list only.
|
|
105
|
+
const placed = await place(entry.base);
|
|
106
|
+
if (!placed.ok)
|
|
107
|
+
return { kind: "checkout-failed", failure: placed.failure };
|
|
108
|
+
snapshots.push({
|
|
109
|
+
entry,
|
|
110
|
+
...placed.value,
|
|
111
|
+
expired,
|
|
112
|
+
picked: false,
|
|
113
|
+
reason: verdict.kind === "rejected" ? verdict.rejection.reason : "other-recipe",
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
kind: "ok",
|
|
118
|
+
inspection: {
|
|
119
|
+
directory,
|
|
120
|
+
checkout: { repoRoot, head: head.value, mergeBase: { commit: mergeBase, ref: resolved.ref } },
|
|
121
|
+
picking: { kind: "recipe", recipe: recipe.name },
|
|
122
|
+
snapshots,
|
|
123
|
+
unreadable,
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/** An entry storm checked nothing of: outside a Git checkout, or with no recipe or no base to pick for. */
|
|
128
|
+
function unchecked(entry, now) {
|
|
129
|
+
return {
|
|
130
|
+
entry,
|
|
131
|
+
inHistory: null,
|
|
132
|
+
builtBehind: null,
|
|
133
|
+
expired: isExpiredEntry(entry, now),
|
|
134
|
+
picked: false,
|
|
135
|
+
reason: null,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Where a base sits in HEAD's history, for the list: whether HEAD is it or holds it, and if so how many commits HEAD
|
|
140
|
+
* has that it lacks. Git is asked at most once per base, and nothing for the merge-base, whose count the caller has.
|
|
141
|
+
*/
|
|
142
|
+
function historyPlacer(context, request) {
|
|
143
|
+
const { repoRoot } = request;
|
|
144
|
+
const known = new Map([
|
|
145
|
+
[request.mergeBase, { inHistory: true, builtBehind: request.commitsAfterBase }],
|
|
146
|
+
]);
|
|
147
|
+
return async (base) => {
|
|
148
|
+
const answer = known.get(base);
|
|
149
|
+
if (answer !== undefined)
|
|
150
|
+
return { ok: true, value: answer };
|
|
151
|
+
const contained = await context.checkout.contains({ repoRoot, ancestor: base, descendant: "HEAD" });
|
|
152
|
+
if (!contained.ok)
|
|
153
|
+
return contained;
|
|
154
|
+
let placed = { inHistory: false, builtBehind: null };
|
|
155
|
+
if (contained.value) {
|
|
156
|
+
const counted = await context.checkout.commitCount({ repoRoot, from: base, to: "HEAD" });
|
|
157
|
+
if (!counted.ok)
|
|
158
|
+
return counted;
|
|
159
|
+
placed = { inHistory: true, builtBehind: counted.value };
|
|
160
|
+
}
|
|
161
|
+
known.set(base, placed);
|
|
162
|
+
return { ok: true, value: placed };
|
|
163
|
+
};
|
|
164
|
+
}
|
|
@@ -3,9 +3,9 @@ import { type CheckedRecipe, type ResolvedRunnerStep, type RunnerStep } from "./
|
|
|
3
3
|
/**
|
|
4
4
|
* Bump when a runner snapshot changes in a way its steps' text doesn't show (the scripts between the steps, what is
|
|
5
5
|
* uploaded, the build sandbox), or the key's encoding changes, so earlier snapshots stop matching. 2 added each step's
|
|
6
|
-
* runner secret names.
|
|
6
|
+
* runner secret names. 3 dropped dev snapshots.
|
|
7
7
|
*/
|
|
8
|
-
export declare const SNAPSHOT_FORMAT =
|
|
8
|
+
export declare const SNAPSHOT_FORMAT = 3;
|
|
9
9
|
/** Where the repository lives in every runner and build sandbox. */
|
|
10
10
|
export declare const SANDBOX_ROOT = "/vercel/sandbox";
|
|
11
11
|
/** The names of the files uploaded to a sandbox's staging directory. */
|
|
@@ -16,14 +16,8 @@ export declare const STAGED_FILES: {
|
|
|
16
16
|
readonly untrackedTarball: "untracked.tgz";
|
|
17
17
|
readonly untrackedFileList: "untracked-files";
|
|
18
18
|
};
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
* commit isn't in a sandbox's repository. Then removes untracked files and directories, nested Git repositories
|
|
22
|
-
* included, keeping ignored ones such as `node_modules` and build outputs.
|
|
23
|
-
*/
|
|
24
|
-
export declare const RESET_TO_BASE: readonly string[];
|
|
25
|
-
/** A bash script that stops at the first failure and runs in the repository's root. */
|
|
26
|
-
export declare function bashScript(lines: readonly string[]): string;
|
|
19
|
+
/** A bash script that stops at the first failure and runs in the repository's root, `/vercel/sandbox` by default. */
|
|
20
|
+
export declare function bashScript(lines: readonly string[], root?: string): string;
|
|
27
21
|
/**
|
|
28
22
|
* Extracts the base's files from `<staging>/base.tgz` and commits exactly its tracked files
|
|
29
23
|
* (`<staging>/base-files`), before the prebuild steps. `git add -A` would drop tracked files `.gitignore` matches.
|
|
@@ -31,11 +25,12 @@ export declare function bashScript(lines: readonly string[]): string;
|
|
|
31
25
|
export declare function baseIndexScript(base: string, staging: string): string;
|
|
32
26
|
/**
|
|
33
27
|
* Applies and commits a run's patch and untracked files, uploaded to `staging`, in a runner sandbox. It first resets
|
|
34
|
-
* the repository to its root commit, the base's tracked files,
|
|
35
|
-
*
|
|
36
|
-
*
|
|
28
|
+
* the repository to its root commit, which holds the base's tracked files (`baseIndexScript`), since the real base
|
|
29
|
+
* commit isn't in a sandbox's repository, and removes untracked files and nested Git repositories `.gitignore`
|
|
30
|
+
* doesn't match, keeping ignored ones such as `node_modules` and build outputs. `root` is the repository, which an
|
|
31
|
+
* integration test points at a temporary checkout.
|
|
37
32
|
*/
|
|
38
|
-
export declare function applyScript(staging: string): string;
|
|
33
|
+
export declare function applyScript(staging: string, root?: string): string;
|
|
39
34
|
/**
|
|
40
35
|
* The snapshot key: sha256 hex over `format=<SNAPSHOT_FORMAT>`, each toolchain step's label, script and
|
|
41
36
|
* `secrets=<its runner secret names, sorted, joined with ",">`, the base-index script with the placeholders `<base>`
|
|
@@ -66,5 +61,8 @@ export type SnapshotStepsAt = {
|
|
|
66
61
|
export declare function snapshotStepsAt(checkout: CheckoutGateway, request: {
|
|
67
62
|
readonly repoRoot: string;
|
|
68
63
|
readonly base: string;
|
|
69
|
-
readonly recipe:
|
|
64
|
+
readonly recipe: {
|
|
65
|
+
readonly snapshot: Pick<CheckedRecipe["snapshot"], "toolchains" | "prebuild">;
|
|
66
|
+
readonly secrets: CheckedRecipe["secrets"];
|
|
67
|
+
};
|
|
70
68
|
}): Promise<SnapshotStepsAt>;
|
|
@@ -7,9 +7,9 @@ import { resolveSteps } from "./recipe.js";
|
|
|
7
7
|
/**
|
|
8
8
|
* Bump when a runner snapshot changes in a way its steps' text doesn't show (the scripts between the steps, what is
|
|
9
9
|
* uploaded, the build sandbox), or the key's encoding changes, so earlier snapshots stop matching. 2 added each step's
|
|
10
|
-
* runner secret names.
|
|
10
|
+
* runner secret names. 3 dropped dev snapshots.
|
|
11
11
|
*/
|
|
12
|
-
export const SNAPSHOT_FORMAT =
|
|
12
|
+
export const SNAPSHOT_FORMAT = 3;
|
|
13
13
|
/** Where the repository lives in every runner and build sandbox. */
|
|
14
14
|
export const SANDBOX_ROOT = "/vercel/sandbox";
|
|
15
15
|
/** The names of the files uploaded to a sandbox's staging directory. */
|
|
@@ -22,19 +22,9 @@ export const STAGED_FILES = {
|
|
|
22
22
|
};
|
|
23
23
|
/** The identity of the commits the scripts make, with no hook or signing in the way. */
|
|
24
24
|
const GIT_IDENTITY = "-c user.email=storm-runner@vercel.invalid -c user.name='storm runner' -c commit.gpgsign=false";
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
* included, keeping ignored ones such as `node_modules` and build outputs.
|
|
29
|
-
*/
|
|
30
|
-
export const RESET_TO_BASE = [
|
|
31
|
-
"root=$(git rev-list --max-parents=0 HEAD)",
|
|
32
|
-
'git reset -q --hard "$root"',
|
|
33
|
-
"git clean -ffdq",
|
|
34
|
-
];
|
|
35
|
-
/** A bash script that stops at the first failure and runs in the repository's root. */
|
|
36
|
-
export function bashScript(lines) {
|
|
37
|
-
return ["set -euo pipefail", `cd ${SANDBOX_ROOT}`, ...lines].join("\n");
|
|
25
|
+
/** A bash script that stops at the first failure and runs in the repository's root, `/vercel/sandbox` by default. */
|
|
26
|
+
export function bashScript(lines, root = SANDBOX_ROOT) {
|
|
27
|
+
return ["set -euo pipefail", `cd ${root}`, ...lines].join("\n");
|
|
38
28
|
}
|
|
39
29
|
/**
|
|
40
30
|
* Extracts the base's files from `<staging>/base.tgz` and commits exactly its tracked files
|
|
@@ -54,26 +44,29 @@ export function baseIndexScript(base, staging) {
|
|
|
54
44
|
}
|
|
55
45
|
/**
|
|
56
46
|
* Applies and commits a run's patch and untracked files, uploaded to `staging`, in a runner sandbox. It first resets
|
|
57
|
-
* the repository to its root commit, the base's tracked files,
|
|
58
|
-
*
|
|
59
|
-
*
|
|
47
|
+
* the repository to its root commit, which holds the base's tracked files (`baseIndexScript`), since the real base
|
|
48
|
+
* commit isn't in a sandbox's repository, and removes untracked files and nested Git repositories `.gitignore`
|
|
49
|
+
* doesn't match, keeping ignored ones such as `node_modules` and build outputs. `root` is the repository, which an
|
|
50
|
+
* integration test points at a temporary checkout.
|
|
60
51
|
*/
|
|
61
|
-
export function applyScript(staging) {
|
|
52
|
+
export function applyScript(staging, root = SANDBOX_ROOT) {
|
|
62
53
|
const patch = `${staging}/${STAGED_FILES.patch}`;
|
|
63
54
|
const tarball = `${staging}/${STAGED_FILES.untrackedTarball}`;
|
|
64
55
|
const fileList = `${staging}/${STAGED_FILES.untrackedFileList}`;
|
|
65
56
|
return bashScript([
|
|
66
|
-
|
|
57
|
+
"root=$(git rev-list --max-parents=0 HEAD)",
|
|
58
|
+
'git reset -q --hard "$root"',
|
|
59
|
+
"git clean -ffdq",
|
|
67
60
|
// A build may have rewritten tracked files with the same content.
|
|
68
61
|
"git update-index -q --refresh || true",
|
|
69
62
|
`if [ -s ${patch} ]; then git apply --index --binary ${patch}; fi`,
|
|
70
63
|
`if [ -s ${tarball} ]; then`,
|
|
71
|
-
` tar --warning=no-unknown-keyword -xzf ${tarball} -C ${
|
|
64
|
+
` tar --warning=no-unknown-keyword -xzf ${tarball} -C ${root}`,
|
|
72
65
|
` git --literal-pathspecs add -f --pathspec-from-file=${fileList} --pathspec-file-nul`,
|
|
73
66
|
"fi",
|
|
74
67
|
`git ${GIT_IDENTITY} commit -q --no-verify --allow-empty -m run`,
|
|
75
68
|
`rm -f ${patch} ${tarball} ${fileList}`,
|
|
76
|
-
]);
|
|
69
|
+
], root);
|
|
77
70
|
}
|
|
78
71
|
/**
|
|
79
72
|
* The snapshot key: sha256 hex over `format=<SNAPSHOT_FORMAT>`, each toolchain step's label, script and
|
|
@@ -3,7 +3,7 @@ export { type CommandMetadata, type CommandTree, commandTree, defineOutcomes, re
|
|
|
3
3
|
/**
|
|
4
4
|
* What an extension's author declares of its commands: its command tree, whose commands take `App`, the tree's own app;
|
|
5
5
|
* `app`, which projects it from `LauncherApp`, what the mount reads of the launcher's app; the help header of the group
|
|
6
|
-
* storm mounts it as; and the tree's directory. The path of that group is the
|
|
6
|
+
* storm mounts it as; and the tree's directory. The path of that group is the launcher's (`src/extension-commands.ts`),
|
|
7
7
|
* not the extension's.
|
|
8
8
|
*/
|
|
9
9
|
export interface ExtensionCommandsDefinition<LauncherApp, App> {
|
|
@@ -16,24 +16,28 @@ export interface ExtensionCommandsDefinition<LauncherApp, App> {
|
|
|
16
16
|
*/
|
|
17
17
|
readonly directory: string;
|
|
18
18
|
/**
|
|
19
|
-
* The tree's app, from the launcher's: what its commands use of it, such as the extension's resources'
|
|
20
|
-
* launcher resolvers. Clinkr calls it when a command of the tree runs, so help never calls it.
|
|
19
|
+
* The tree's app, from the launcher's: what its commands use of it, such as the extension's resources' Contexts and
|
|
20
|
+
* the launcher resolvers. Clinkr calls it when a command of the tree runs, so help never calls it.
|
|
21
21
|
*/
|
|
22
22
|
readonly app: (launcherApp: LauncherApp) => App;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* An extension's commands, as `defineExtensionCommands` returns them: the definition but for its tree and its
|
|
26
26
|
* projection, and `mount`, which mounts the tree's directory group, its directory under the code root the launcher
|
|
27
|
-
* gives, at the path the launcher gives, with the extension's description and the projection. A launcher that types
|
|
28
|
-
* mounts with its own app compiles only while that app is a `LauncherApp`.
|
|
27
|
+
* gives, at the path the launcher gives, with the extension's description and the projection. A launcher that types
|
|
28
|
+
* its mounts with its own app compiles only while that app is a `LauncherApp`.
|
|
29
29
|
*/
|
|
30
30
|
export interface ExtensionCommands<LauncherApp> {
|
|
31
31
|
readonly description: string;
|
|
32
32
|
readonly directory: string;
|
|
33
|
-
readonly mount: (placement:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
readonly mount: (placement: ExtensionCommandsPlacement) => Mount<LauncherApp>;
|
|
34
|
+
}
|
|
35
|
+
/** Where the launcher mounts an extension's commands: the launcher's choice, never the extension's. */
|
|
36
|
+
export interface ExtensionCommandsPlacement {
|
|
37
|
+
/** Where the tree's commands sit in `storm`, such as `["ext", "<name>"]`. */
|
|
38
|
+
readonly path: readonly string[];
|
|
39
|
+
/** Storm's code root (`src/` or `dist/`), which the tree's directory is under. */
|
|
40
|
+
readonly root: string;
|
|
37
41
|
}
|
|
38
42
|
/** Declares an extension's commands. Only this function calls Clinkr's `mount`, since it knows the tree's app type. */
|
|
39
43
|
export declare function defineExtensionCommands<LauncherApp, App>(definition: ExtensionCommandsDefinition<LauncherApp, App>): ExtensionCommands<LauncherApp>;
|
|
@@ -42,28 +46,42 @@ interface ClinkrExample {
|
|
|
42
46
|
readonly argv: string;
|
|
43
47
|
readonly description?: string;
|
|
44
48
|
}
|
|
45
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* The run examples an extension brings to the run commands' help, which each lists after its own: those for
|
|
51
|
+
* `storm exec`, which has no driver, and those for each driver's command, by the driver's name
|
|
52
|
+
* (`Driver.name`). A name is a plain string, with no import behind it: examples under a name no driver in the
|
|
53
|
+
* registry has show in no help.
|
|
54
|
+
*/
|
|
46
55
|
export interface RunExamples {
|
|
47
56
|
readonly exec: readonly ClinkrExample[];
|
|
48
|
-
readonly
|
|
57
|
+
readonly drivers: {
|
|
58
|
+
readonly [driver: string]: readonly ClinkrExample[];
|
|
59
|
+
};
|
|
49
60
|
}
|
|
50
61
|
/** What an extension reads of each resource it brings: its definition's name. */
|
|
51
62
|
interface NamedResource {
|
|
52
63
|
readonly name: string;
|
|
53
64
|
}
|
|
65
|
+
/** What an extension reads of each driver it brings: its name. */
|
|
66
|
+
interface NamedDriver {
|
|
67
|
+
readonly name: string;
|
|
68
|
+
}
|
|
54
69
|
/**
|
|
55
|
-
* Extension `Name`, with its resources, in order, each as its `defineResource` returned it; when it
|
|
56
|
-
*
|
|
57
|
-
*
|
|
70
|
+
* Extension `Name`, with its resources, in order, each as its `defineResource` returned it; when it brings any, its
|
|
71
|
+
* drivers, in order, each as its `defineDriver` returned it; when it has commands, its commands (from
|
|
72
|
+
* `defineExtensionCommands`, in its light `command-tree.ts`), whose tree's commands take `LauncherApp`; and when it has
|
|
73
|
+
* any, the run examples its resources' flags bring to the run commands' help (`RunExamples`).
|
|
58
74
|
*/
|
|
59
|
-
export interface Extension<Name extends string, Resources extends readonly NamedResource[], LauncherApp> {
|
|
75
|
+
export interface Extension<Name extends string, Resources extends readonly NamedResource[], LauncherApp, Drivers extends readonly NamedDriver[] = readonly []> {
|
|
60
76
|
readonly name: Name;
|
|
61
77
|
readonly resources: Resources;
|
|
78
|
+
readonly drivers?: Drivers;
|
|
62
79
|
readonly commands?: ExtensionCommands<LauncherApp>;
|
|
63
80
|
readonly examples?: RunExamples;
|
|
64
81
|
}
|
|
65
82
|
/**
|
|
66
83
|
* Declares an extension. Its name is one command word. Each of its resources comes from `defineResource`, and it may
|
|
67
|
-
* have none, when it brings only commands.
|
|
84
|
+
* have none, when it brings only commands or drivers. Each of its drivers comes from `defineDriver`. Where its commands
|
|
85
|
+
* go is the launcher's choice (`src/extension-commands.ts`).
|
|
68
86
|
*/
|
|
69
|
-
export declare function defineExtension<const Name extends string, const Resources extends readonly NamedResource[], LauncherApp = unknown>(extension: Extension<Name, Resources, LauncherApp>): Extension<Name, Resources, LauncherApp>;
|
|
87
|
+
export declare function defineExtension<const Name extends string, const Resources extends readonly NamedResource[], LauncherApp = unknown, const Drivers extends readonly NamedDriver[] = readonly []>(extension: Extension<Name, Resources, LauncherApp, Drivers>): Extension<Name, Resources, LauncherApp, Drivers>;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
// An extension as one value (`defineExtension`, `Extension`), its own command tree as storm mounts it, its run
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// An extension as one value (`defineExtension`, `Extension`), its own command tree as storm mounts it, its run examples
|
|
2
|
+
// (`RunExamples`), and what its commands are written with: the extension's light entry for its commands, which loads
|
|
3
|
+
// only Clinkr. An extension's `extension.ts` joins its resources and its drivers with its command tree and its run
|
|
4
4
|
// examples here, so a published resource export, which loads only the resource, never reaches Clinkr. Its
|
|
5
5
|
// `command-tree.ts` declares its commands with `defineExtensionCommands`, and `src/extension-commands.ts` mounts them
|
|
6
|
-
// without loading the extension's resources, so help never loads the registry. The extension doesn't choose
|
|
7
|
-
// commands go: `src/extension-commands.ts` gives each tree its path. The registry
|
|
8
|
-
// the extensions and takes their resources in order, and
|
|
9
|
-
// order. Its commands declare their tree, metadata and outcomes
|
|
10
|
-
// (`commandTree`, `CommandMetadata`, `defineOutcomes`, `renderOutcome`,
|
|
11
|
-
// imports Clinkr itself. The re-exports reach no published export: only the
|
|
12
|
-
// `src/extension-commands.ts` load a command tree. The module's run-time entry, `index.ts`,
|
|
6
|
+
// without loading the extension's resources, so help never loads the extension registry. The extension doesn't choose
|
|
7
|
+
// where its commands go: `src/extension-commands.ts` gives each tree its path. The extension registry
|
|
8
|
+
// (`src/extensions.ts`) lists the extensions and takes their resources and their drivers in order, and each run
|
|
9
|
+
// command's help lists their run examples for it in that order. Its commands declare their tree, metadata and outcomes
|
|
10
|
+
// with what this entry re-exports of Clinkr (`commandTree`, `CommandMetadata`, `defineOutcomes`, `renderOutcome`,
|
|
11
|
+
// `Row`, `Warning`), so no extension folder imports Clinkr itself. The re-exports reach no published export: only the
|
|
12
|
+
// extension registry and `src/extension-commands.ts` load a command tree. The module's run-time entry, `index.ts`,
|
|
13
|
+
// loads none of this.
|
|
13
14
|
import { join } from "node:path";
|
|
14
15
|
import { mount } from "@vercel/clinkr";
|
|
15
16
|
export { commandTree, defineOutcomes, renderOutcome, } from "@vercel/clinkr";
|
|
@@ -24,7 +25,8 @@ export function defineExtensionCommands(definition) {
|
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
27
|
* Declares an extension. Its name is one command word. Each of its resources comes from `defineResource`, and it may
|
|
27
|
-
* have none, when it brings only commands.
|
|
28
|
+
* have none, when it brings only commands or drivers. Each of its drivers comes from `defineDriver`. Where its commands
|
|
29
|
+
* go is the launcher's choice (`src/extension-commands.ts`).
|
|
28
30
|
*/
|
|
29
31
|
export function defineExtension(extension) {
|
|
30
32
|
return extension;
|