@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
package/dist/runner/events.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CheckoutFailure, RunnerSandboxRole, RunnerSnapshotCacheFailure } from "./gateways.ts";
|
|
2
|
+
import type { RejectedSnapshot } from "./snapshot-cache.ts";
|
|
2
3
|
/**
|
|
3
4
|
* Where a step runs, which names its progress lines: `snapshot` (`[runner snapshot]`), `apply` (`[runner]`), `install`
|
|
4
5
|
* (`[runner install]`) and `build` (`[runner build]`).
|
|
@@ -29,19 +30,34 @@ export interface NotKeptSandbox {
|
|
|
29
30
|
readonly name: string;
|
|
30
31
|
readonly message: string;
|
|
31
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Why a base snapshot is being built: no cached snapshot fits the run or the checkout (`no-snapshot`), with why each
|
|
35
|
+
* cached snapshot of the recipe didn't (`rejected`); `storm snapshots build --full` asked for a new one whatever the
|
|
36
|
+
* cache holds (`full`); or `storm snapshots build --base <ref>` asked for one at a commit the cache has none of
|
|
37
|
+
* (`base`).
|
|
38
|
+
*/
|
|
39
|
+
export type SnapshotBuildReason = {
|
|
40
|
+
readonly kind: "no-snapshot";
|
|
41
|
+
readonly rejected: readonly RejectedSnapshot[];
|
|
42
|
+
} | {
|
|
43
|
+
readonly kind: "full";
|
|
44
|
+
} | {
|
|
45
|
+
readonly kind: "base";
|
|
46
|
+
};
|
|
32
47
|
/**
|
|
33
48
|
* What the runner reports, in order.
|
|
34
49
|
*
|
|
35
|
-
* - `snapshot-reused`: the run starts from cached runner snapshot `snapshotId`,
|
|
36
|
-
*
|
|
37
|
-
* - `snapshot-build-started`:
|
|
38
|
-
*
|
|
50
|
+
* - `snapshot-reused`: the run starts from cached runner snapshot `snapshotId`, built at `base`; `builtBehind` is how
|
|
51
|
+
* many commits HEAD has that `base` lacks.
|
|
52
|
+
* - `snapshot-build-started`: a base snapshot of `base` is being built, and `why` (`SnapshotBuildReason`); `summary`
|
|
53
|
+
* says what the build does.
|
|
39
54
|
* - `runner-sandbox-starting`: the runner sandbox is starting from runner snapshot `snapshotId`.
|
|
40
55
|
* - `sandbox-started`: a runner or build sandbox started, in `ms`.
|
|
41
56
|
* - `output-started` and `output-ended`: where a section's streamed output starts and ends, for a rule line.
|
|
42
57
|
* - `step-started`, `step-output` (one line, without its newline) and `step-finished`: a step's progress.
|
|
43
58
|
* - `snapshot-saving`: the build sandbox is being saved as a runner snapshot.
|
|
44
|
-
* - `snapshot-built`: it was, in `ms` from the build's start
|
|
59
|
+
* - `snapshot-built`: it was, in `ms` from the build's start; `builtBehind` is how many commits HEAD has that `base`
|
|
60
|
+
* lacks, null for a `storm snapshots build --base` commit that isn't HEAD's merge-base.
|
|
45
61
|
* - `snapshot-entry-not-written`: the cache couldn't record the new snapshot; the run goes on.
|
|
46
62
|
* - `uploading`: the run's changes are being uploaded to the runner sandbox.
|
|
47
63
|
* - `uploaded`: the run's changes, `bytes` in all, reached the runner sandbox.
|
|
@@ -53,23 +69,16 @@ export interface NotKeptSandbox {
|
|
|
53
69
|
* and releasing the run's resources.
|
|
54
70
|
* - `waiting-for-snapshot`: closing waits up to `settleMs` for a runner snapshot still saving.
|
|
55
71
|
* - `sandbox-kept`: closing kept runner sandbox `name` running until `stopsAt`, an ISO time.
|
|
56
|
-
* - `branch-snapshot-saving`: the run saves the runner sandbox as a branch snapshot of `branch`, once the command
|
|
57
|
-
* ended.
|
|
58
|
-
* - `branch-snapshot-saved`: it did, as runner snapshot `snapshotId` of `branch` at HEAD commit `head`, in `ms`.
|
|
59
|
-
* - `branch-snapshot-not-saved`: it didn't, and `save` says why.
|
|
60
|
-
* - `branch-snapshots-dropped`: `--rebuild-snapshot` removed `branch`'s branch snapshot entries from the cache.
|
|
61
|
-
* - `branch-snapshots-not-dropped`: it couldn't list the cache or remove one of them.
|
|
62
72
|
*/
|
|
63
73
|
export type RunnerEvent = {
|
|
64
74
|
readonly kind: "snapshot-reused";
|
|
65
75
|
readonly snapshotId: string;
|
|
66
76
|
readonly base: string;
|
|
67
|
-
readonly
|
|
68
|
-
readonly head: string | null;
|
|
77
|
+
readonly builtBehind: number;
|
|
69
78
|
} | {
|
|
70
79
|
readonly kind: "snapshot-build-started";
|
|
71
80
|
readonly base: string;
|
|
72
|
-
readonly
|
|
81
|
+
readonly why: SnapshotBuildReason;
|
|
73
82
|
readonly summary: string;
|
|
74
83
|
} | {
|
|
75
84
|
readonly kind: "runner-sandbox-starting";
|
|
@@ -112,6 +121,7 @@ export type RunnerEvent = {
|
|
|
112
121
|
readonly base: string;
|
|
113
122
|
readonly ms: number;
|
|
114
123
|
readonly sizeBytes: number;
|
|
124
|
+
readonly builtBehind: number | null;
|
|
115
125
|
} | {
|
|
116
126
|
readonly kind: "snapshot-entry-not-written";
|
|
117
127
|
readonly failure: RunnerSnapshotCacheFailure;
|
|
@@ -139,29 +149,6 @@ export type RunnerEvent = {
|
|
|
139
149
|
readonly kind: "sandbox-kept";
|
|
140
150
|
readonly name: string;
|
|
141
151
|
readonly stopsAt: string;
|
|
142
|
-
} | {
|
|
143
|
-
readonly kind: "branch-snapshot-saving";
|
|
144
|
-
readonly branch: string;
|
|
145
|
-
} | {
|
|
146
|
-
readonly kind: "branch-snapshot-saved";
|
|
147
|
-
readonly snapshotId: string;
|
|
148
|
-
readonly branch: string;
|
|
149
|
-
readonly head: string;
|
|
150
|
-
readonly ms: number;
|
|
151
|
-
readonly sizeBytes: number;
|
|
152
|
-
} | {
|
|
153
|
-
readonly kind: "branch-snapshot-not-saved";
|
|
154
|
-
readonly save: Exclude<RunnerSave, {
|
|
155
|
-
readonly kind: "saved" | "skipped";
|
|
156
|
-
}>;
|
|
157
|
-
} | {
|
|
158
|
-
readonly kind: "branch-snapshots-dropped";
|
|
159
|
-
readonly branch: string;
|
|
160
|
-
readonly snapshotIds: readonly string[];
|
|
161
|
-
} | {
|
|
162
|
-
readonly kind: "branch-snapshots-not-dropped";
|
|
163
|
-
readonly branch: string;
|
|
164
|
-
readonly failure: RunnerSnapshotCacheFailure;
|
|
165
152
|
};
|
|
166
153
|
/** Hears the runner's events as they happen. */
|
|
167
154
|
export interface RunnerProgress {
|
|
@@ -191,38 +178,6 @@ export type RunnerFailure = {
|
|
|
191
178
|
readonly kind: "checkout-failed";
|
|
192
179
|
readonly failure: CheckoutFailure;
|
|
193
180
|
};
|
|
194
|
-
/**
|
|
195
|
-
* How saving the runner sandbox as a branch snapshot ended.
|
|
196
|
-
*
|
|
197
|
-
* - `saved`: it is runner snapshot `snapshotId` of `base`, for `branch` at HEAD commit `head`, saved in `ms` from the
|
|
198
|
-
* save's start; `entryWritten` says whether the cache recorded it.
|
|
199
|
-
* - `skipped`: in a run that saves always, HEAD was detached as the run started, so there is no branch to save it for
|
|
200
|
-
* (`prepareRunner`); the run keeps its runner sandbox as a run that saves none.
|
|
201
|
-
* - `failed`: the scrub or the save failed with `message`.
|
|
202
|
-
* - `stopped`: a signal stopped it before it saved, or before the cache recorded the snapshot.
|
|
203
|
-
*
|
|
204
|
-
* A run whose save started never keeps its runner sandbox, however the save ended; a run whose save never started
|
|
205
|
-
* has none of these, and keeps its runner sandbox for the keep time (`RunnerSandboxPlan`).
|
|
206
|
-
*/
|
|
207
|
-
export type RunnerSave = {
|
|
208
|
-
readonly kind: "saved";
|
|
209
|
-
readonly snapshotId: string;
|
|
210
|
-
readonly base: string;
|
|
211
|
-
readonly branch: string;
|
|
212
|
-
readonly head: string;
|
|
213
|
-
readonly ms: number;
|
|
214
|
-
readonly sizeBytes: number;
|
|
215
|
-
readonly entryWritten: boolean;
|
|
216
|
-
} | {
|
|
217
|
-
readonly kind: "skipped";
|
|
218
|
-
readonly reason: "detached-head";
|
|
219
|
-
} | {
|
|
220
|
-
readonly kind: "failed";
|
|
221
|
-
readonly step: "scrub" | "save-snapshot";
|
|
222
|
-
readonly message: string;
|
|
223
|
-
} | {
|
|
224
|
-
readonly kind: "stopped";
|
|
225
|
-
};
|
|
226
181
|
/** How one stage of readying the runner ended: its value, a failure, or a stop because the run was aborted. */
|
|
227
182
|
export type RunnerStage<T> = {
|
|
228
183
|
readonly kind: "ok";
|
|
@@ -85,6 +85,14 @@ export interface CheckoutGateway {
|
|
|
85
85
|
readonly repoRoot: string;
|
|
86
86
|
readonly ref: string;
|
|
87
87
|
}): Promise<BaseCandidate>;
|
|
88
|
+
/**
|
|
89
|
+
* The commit a local ref or a commit name resolves to, a full SHA (`git rev-parse --verify <ref>^{commit}`); null
|
|
90
|
+
* when it names no commit in the clone. It never fetches.
|
|
91
|
+
*/
|
|
92
|
+
resolveCommit(request: {
|
|
93
|
+
readonly repoRoot: string;
|
|
94
|
+
readonly ref: string;
|
|
95
|
+
}): Promise<CheckoutResult<string | null>>;
|
|
88
96
|
/**
|
|
89
97
|
* Whether commit `ancestor` is `descendant` or one of its ancestors (`git merge-base --is-ancestor`). An
|
|
90
98
|
* `ancestor` missing from the clone is not. `descendant` may be `HEAD`.
|
|
@@ -94,10 +102,14 @@ export interface CheckoutGateway {
|
|
|
94
102
|
readonly ancestor: string;
|
|
95
103
|
readonly descendant: string;
|
|
96
104
|
}): Promise<CheckoutResult<boolean>>;
|
|
97
|
-
/**
|
|
98
|
-
|
|
105
|
+
/**
|
|
106
|
+
* How many commits `to` has in its history that `from` doesn't (`git rev-list --count from..to`): 0 when `to` is
|
|
107
|
+
* `from` or one of its ancestors. Each may be `HEAD`. A commit missing from the clone is a failure.
|
|
108
|
+
*/
|
|
109
|
+
commitCount(request: {
|
|
99
110
|
readonly repoRoot: string;
|
|
100
|
-
readonly
|
|
111
|
+
readonly from: string;
|
|
112
|
+
readonly to: string;
|
|
101
113
|
}): Promise<CheckoutResult<number>>;
|
|
102
114
|
/** The text of `path`, relative to the repository's root, at `commit`. */
|
|
103
115
|
readFileAt(request: {
|
|
@@ -122,8 +134,7 @@ export interface CheckoutGateway {
|
|
|
122
134
|
}
|
|
123
135
|
/**
|
|
124
136
|
* One runner snapshot the cache records: who it belongs to, what it was built from, and when it expires. Times
|
|
125
|
-
* are ISO strings.
|
|
126
|
-
* without them records a base snapshot, built from its base. An entry has both or neither.
|
|
137
|
+
* are ISO strings. Every entry records a base snapshot, built at its base, which may be any commit.
|
|
127
138
|
*/
|
|
128
139
|
export interface RunnerSnapshotEntry {
|
|
129
140
|
readonly teamId: string;
|
|
@@ -133,17 +144,8 @@ export interface RunnerSnapshotEntry {
|
|
|
133
144
|
readonly recipeName: string;
|
|
134
145
|
/** The snapshot key at `base` (`snapshotKey`). */
|
|
135
146
|
readonly snapshotKey: string;
|
|
136
|
-
/** The base commit's full SHA
|
|
147
|
+
/** The base commit's full SHA: the commit the snapshot was built at, whose tracked files its repository commits. */
|
|
137
148
|
readonly base: string;
|
|
138
|
-
/** For a branch snapshot, the local branch of the run that saved it. */
|
|
139
|
-
readonly branch?: string;
|
|
140
|
-
/** For a branch snapshot, the full SHA of the HEAD commit of the run that saved it. */
|
|
141
|
-
readonly head?: string;
|
|
142
|
-
/**
|
|
143
|
-
* For a branch snapshot, the root of the checkout the run that saved it ran from. Only a run from that checkout
|
|
144
|
-
* starts from it, so a branch of the same name in another checkout never inherits what this run left.
|
|
145
|
-
*/
|
|
146
|
-
readonly repoRoot?: string;
|
|
147
149
|
readonly snapshotId: string;
|
|
148
150
|
readonly createdAt: string;
|
|
149
151
|
readonly expiresAt: string;
|
|
@@ -180,7 +182,7 @@ export type RunnerSnapshotCacheOperation = {
|
|
|
180
182
|
};
|
|
181
183
|
/**
|
|
182
184
|
* The per-machine runner snapshot cache: one record per runner snapshot, keyed by the entry's identity (team,
|
|
183
|
-
* project, region, runtime, recipe name, snapshot key
|
|
185
|
+
* project, region, runtime, recipe name, snapshot key and base).
|
|
184
186
|
* Every method returns its expected failures and never rejects. Which entries a run may use, and when one has
|
|
185
187
|
* expired, is the caller's.
|
|
186
188
|
*/
|
|
@@ -271,7 +273,7 @@ export interface StagedFile {
|
|
|
271
273
|
readonly name: string;
|
|
272
274
|
readonly content: Uint8Array;
|
|
273
275
|
}
|
|
274
|
-
/** A runner snapshot a build sandbox
|
|
276
|
+
/** A runner snapshot a build sandbox was saved as. */
|
|
275
277
|
export interface SavedSnapshot {
|
|
276
278
|
readonly snapshotId: string;
|
|
277
279
|
/** When the Sandbox API says it expires, as an ISO string, when it says. */
|
|
@@ -330,7 +332,7 @@ export interface RunnerSandboxGateway {
|
|
|
330
332
|
readonly path: string;
|
|
331
333
|
readonly fromLine: number;
|
|
332
334
|
}, onOutput: (chunk: SandboxOutputChunk) => void, signal?: AbortSignal): Promise<RunnerSandboxOperation>;
|
|
333
|
-
/** Saves a build
|
|
335
|
+
/** Saves a build sandbox as a runner snapshot that expires after `expirationMs`; that stops the sandbox. */
|
|
334
336
|
saveSnapshot(sandbox: RunnerSandbox, request: {
|
|
335
337
|
readonly expirationMs: number;
|
|
336
338
|
}): Promise<RunnerSandboxResult<SavedSnapshot>>;
|
package/dist/runner/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { RunnerContext } from "./context.ts";
|
|
2
|
-
export {
|
|
2
|
+
export { buildSnapshots, prepareSnapshotBuild, type PrepareSnapshotBuildOutcome, type SnapshotBuildOutcome, } from "./build-snapshots.ts";
|
|
3
|
+
export { type KeptSandbox, type RunnerEvent, type RunnerFailure, type RunnerProgress, type RunnerStepPhase, type SnapshotBuildReason, } from "./events.ts";
|
|
3
4
|
export type { CheckoutFailure, CheckoutGateway, RunnerSandboxGateway, RunnerSnapshotCacheFailure, RunnerSnapshotCacheGateway, RunnerSnapshotEntry, RunnerTerminal, } from "./gateways.ts";
|
|
4
5
|
export { liveCheckoutGateway } from "./live/checkout-gateway.ts";
|
|
5
6
|
export { liveRunnerSandboxGateway } from "./live/sandbox-gateway.ts";
|
|
@@ -7,11 +8,11 @@ export { liveRunnerTerminal } from "./live/terminal.ts";
|
|
|
7
8
|
export { localUserName } from "./live/user.ts";
|
|
8
9
|
export { liveRunnerSnapshotCacheGateway, unavailableRunnerSnapshotCacheGateway, } from "./live/snapshot-cache-gateway.ts";
|
|
9
10
|
export { lineSplitter } from "./output.ts";
|
|
10
|
-
export { prepareRunner, type PrepareRunnerOutcome
|
|
11
|
+
export { prepareRunner, type PrepareRunnerOutcome } from "./prepare.ts";
|
|
11
12
|
export type { ReadyRunnerOutcome } from "./ready.ts";
|
|
12
|
-
export { type CheckedRecipe, checkRecipe
|
|
13
|
+
export { type CheckedRecipe, checkRecipe } from "./recipe.ts";
|
|
13
14
|
export { SANDBOX_TEST_EVENTS_PATH } from "./sandboxed-command.ts";
|
|
14
|
-
export { readRunnerSecrets, RUNNER_SECRET_MIN_LENGTH, type RunnerSecrets } from "./secrets.ts";
|
|
15
|
-
export type
|
|
16
|
-
export { type
|
|
17
|
-
export { RUNNER_SNAPSHOTS_SUBPATH, type SnapshotCacheNote } from "./snapshot-cache.ts";
|
|
15
|
+
export { declaredSecretValues, readRunnerSecrets, RUNNER_SECRET_MIN_LENGTH, type RunnerSecrets } from "./secrets.ts";
|
|
16
|
+
export { type RunnerCleanupFacts, openRunnerSession, type RunnerSession, type RunnerSessionCleanup, type RunnerSessionRequest, } from "./session.ts";
|
|
17
|
+
export { type InspectedSnapshot, inspectSnapshotCache, type SnapshotCacheInspection, type UnpickedReason, } from "./snapshot-inspect.ts";
|
|
18
|
+
export { type RejectedSnapshot, RUNNER_SNAPSHOTS_SUBPATH, type SnapshotCacheNote, type SnapshotRejectionReason, } from "./snapshot-cache.ts";
|
package/dist/runner/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// The `runner` module's public surface: running a command in a runner sandbox, through a run's runner session. Other
|
|
2
2
|
// modules import only from here, and it holds only what another module under `src/` imports; the runner's own tests
|
|
3
3
|
// import the files that declare the rest (`README.md`).
|
|
4
|
+
export { buildSnapshots, prepareSnapshotBuild, } from "./build-snapshots.js";
|
|
4
5
|
export {} from "./events.js";
|
|
5
6
|
export { liveCheckoutGateway } from "./live/checkout-gateway.js";
|
|
6
7
|
export { liveRunnerSandboxGateway } from "./live/sandbox-gateway.js";
|
|
@@ -9,8 +10,9 @@ export { localUserName } from "./live/user.js";
|
|
|
9
10
|
export { liveRunnerSnapshotCacheGateway, unavailableRunnerSnapshotCacheGateway, } from "./live/snapshot-cache-gateway.js";
|
|
10
11
|
export { lineSplitter } from "./output.js";
|
|
11
12
|
export { prepareRunner } from "./prepare.js";
|
|
12
|
-
export { checkRecipe
|
|
13
|
+
export { checkRecipe } from "./recipe.js";
|
|
13
14
|
export { SANDBOX_TEST_EVENTS_PATH } from "./sandboxed-command.js";
|
|
14
|
-
export { readRunnerSecrets, RUNNER_SECRET_MIN_LENGTH } from "./secrets.js";
|
|
15
|
+
export { declaredSecretValues, readRunnerSecrets, RUNNER_SECRET_MIN_LENGTH } from "./secrets.js";
|
|
15
16
|
export { openRunnerSession, } from "./session.js";
|
|
16
|
-
export {
|
|
17
|
+
export { inspectSnapshotCache, } from "./snapshot-inspect.js";
|
|
18
|
+
export { RUNNER_SNAPSHOTS_SUBPATH, } from "./snapshot-cache.js";
|
|
@@ -19,8 +19,9 @@ export function liveCheckoutGateway() {
|
|
|
19
19
|
repositoryRoot: ({ cwd }) => repositoryRoot(cwd),
|
|
20
20
|
head: ({ repoRoot }) => head(repoRoot),
|
|
21
21
|
baseCandidate: ({ repoRoot, ref }) => baseCandidate(repoRoot, ref),
|
|
22
|
+
resolveCommit: ({ repoRoot, ref }) => resolveCommit(repoRoot, ref),
|
|
22
23
|
contains: ({ repoRoot, ancestor, descendant }) => contains(repoRoot, ancestor, descendant),
|
|
23
|
-
|
|
24
|
+
commitCount: ({ repoRoot, from, to }) => commitCount(repoRoot, from, to),
|
|
24
25
|
readFileAt: ({ repoRoot, commit, path }) => readFileAt(repoRoot, commit, path),
|
|
25
26
|
submodules: ({ repoRoot }) => submodules(repoRoot),
|
|
26
27
|
assembleUpload: ({ repoRoot, base }) => assembleUpload(repoRoot, base),
|
|
@@ -62,6 +63,13 @@ async function baseCandidate(repoRoot, ref) {
|
|
|
62
63
|
return mergeBase.exitCode === 1 ? { kind: "unrelated" } : { kind: "failed", failure: mergeBase.failure };
|
|
63
64
|
return { kind: "merge-base", base: mergeBase.stdout.toString("utf8").trim() };
|
|
64
65
|
}
|
|
66
|
+
async function resolveCommit(repoRoot, ref) {
|
|
67
|
+
// `--end-of-options` keeps a ref that starts with `-` from reading as an option.
|
|
68
|
+
const run = await git(repoRoot, ["rev-parse", "--verify", "--quiet", "--end-of-options", `${ref}^{commit}`]);
|
|
69
|
+
if (!run.ok)
|
|
70
|
+
return run.exitCode === 1 ? { ok: true, value: null } : run;
|
|
71
|
+
return { ok: true, value: run.stdout.toString("utf8").trim() };
|
|
72
|
+
}
|
|
65
73
|
async function contains(repoRoot, ancestor, descendant) {
|
|
66
74
|
// A base missing from the clone (`cat-file -e` exits non-zero) is no ancestor of anything here.
|
|
67
75
|
const present = await git(repoRoot, ["cat-file", "-e", `${ancestor}^{commit}`]);
|
|
@@ -72,14 +80,14 @@ async function contains(repoRoot, ancestor, descendant) {
|
|
|
72
80
|
return { ok: true, value: true };
|
|
73
81
|
return run.exitCode === 1 ? { ok: true, value: false } : run;
|
|
74
82
|
}
|
|
75
|
-
async function
|
|
76
|
-
const run = await git(repoRoot, ["
|
|
83
|
+
async function commitCount(repoRoot, from, to) {
|
|
84
|
+
const run = await git(repoRoot, ["rev-list", "--count", `${from}..${to}`]);
|
|
77
85
|
if (!run.ok)
|
|
78
86
|
return run;
|
|
79
|
-
const
|
|
80
|
-
return Number.isSafeInteger(
|
|
81
|
-
? { ok: true, value:
|
|
82
|
-
: { ok: false, failure: { message: `git
|
|
87
|
+
const count = Number(run.stdout.toString("utf8").trim());
|
|
88
|
+
return Number.isSafeInteger(count)
|
|
89
|
+
? { ok: true, value: count }
|
|
90
|
+
: { ok: false, failure: { message: `git rev-list printed no count for ${from}..${to}` } };
|
|
83
91
|
}
|
|
84
92
|
async function readFileAt(repoRoot, commit, path) {
|
|
85
93
|
const object = `${commit}:${path}`;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// The runner snapshot cache's file format: one JSON object per runner snapshot, carrying `version: 1`. A reader
|
|
2
|
-
// rejects a version it doesn't know
|
|
3
|
-
//
|
|
4
|
-
//
|
|
2
|
+
// rejects a version it doesn't know, and drops keys it doesn't know. A file is named for its entry's identity
|
|
3
|
+
// (`snapshotEntryIdentity`), and the gateway lists a file whose name isn't as unreadable. So a file an older storm
|
|
4
|
+
// wrote for a dev snapshot, named for an identity that held its checkout's root and commit, is listed as unreadable,
|
|
5
|
+
// and no run starts from it: there is no migration.
|
|
5
6
|
import { z } from "zod";
|
|
6
7
|
const isoTime = z.string().refine((value) => !Number.isNaN(Date.parse(value)), { message: "not a time" });
|
|
7
8
|
const nonEmpty = z.string().min(1);
|
|
8
|
-
const entrySchema = z
|
|
9
|
-
.object({
|
|
9
|
+
const entrySchema = z.object({
|
|
10
10
|
version: z.literal(1),
|
|
11
11
|
teamId: nonEmpty,
|
|
12
12
|
projectId: nonEmpty,
|
|
@@ -15,17 +15,10 @@ const entrySchema = z
|
|
|
15
15
|
recipeName: nonEmpty,
|
|
16
16
|
snapshotKey: nonEmpty,
|
|
17
17
|
base: nonEmpty,
|
|
18
|
-
branch: nonEmpty.exactOptional(),
|
|
19
|
-
head: nonEmpty.exactOptional(),
|
|
20
|
-
repoRoot: nonEmpty.exactOptional(),
|
|
21
18
|
snapshotId: nonEmpty,
|
|
22
19
|
createdAt: isoTime,
|
|
23
20
|
expiresAt: isoTime,
|
|
24
|
-
})
|
|
25
|
-
.refine((entry) => {
|
|
26
|
-
const present = [entry.branch, entry.head, entry.repoRoot].filter((value) => value !== undefined).length;
|
|
27
|
-
return present === 0 || present === 3;
|
|
28
|
-
}, { message: "has some of branch, head and repoRoot without the others" });
|
|
21
|
+
});
|
|
29
22
|
/** The entry a cache file holds, or why it holds none. */
|
|
30
23
|
export function parseSnapshotEntry(text) {
|
|
31
24
|
let json;
|
|
@@ -49,7 +42,7 @@ export function parseSnapshotEntry(text) {
|
|
|
49
42
|
}
|
|
50
43
|
/** The text of the file that records `entry`. */
|
|
51
44
|
export function snapshotEntryText(entry) {
|
|
52
|
-
const { teamId, projectId, region, runtime, recipeName, snapshotKey, base
|
|
45
|
+
const { teamId, projectId, region, runtime, recipeName, snapshotKey, base } = entry;
|
|
53
46
|
const { snapshotId, createdAt, expiresAt } = entry;
|
|
54
47
|
const record = {
|
|
55
48
|
version: 1,
|
|
@@ -60,9 +53,6 @@ export function snapshotEntryText(entry) {
|
|
|
60
53
|
recipeName,
|
|
61
54
|
snapshotKey,
|
|
62
55
|
base,
|
|
63
|
-
...(branch === undefined ? {} : { branch }),
|
|
64
|
-
...(head === undefined ? {} : { head }),
|
|
65
|
-
...(repoRoot === undefined ? {} : { repoRoot }),
|
|
66
56
|
snapshotId,
|
|
67
57
|
createdAt,
|
|
68
58
|
expiresAt,
|
package/dist/runner/prepare.d.ts
CHANGED
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
import { type RefusedBaseRef } from "./base.ts";
|
|
2
|
-
import type { CheckoutFailure,
|
|
2
|
+
import type { CheckoutFailure, CheckoutUpload } from "./gateways.ts";
|
|
3
3
|
import { type CheckedRecipe, type ResolvedRunnerStep, type VcpusRun } from "./recipe.ts";
|
|
4
|
-
import { type RunnerSnapshotCandidate, type SnapshotCacheContext, type SnapshotCacheNote } from "./snapshot-cache.ts";
|
|
4
|
+
import { type RejectedSnapshot, type RunnerSnapshotCandidate, type SnapshotCacheContext, type SnapshotCacheNote } from "./snapshot-cache.ts";
|
|
5
5
|
/** What `prepareRunner` needs: the checkout, the runner snapshot cache and the clock. */
|
|
6
6
|
export type RunnerPrepareContext = SnapshotCacheContext;
|
|
7
|
-
/**
|
|
8
|
-
* Whether a run saves its runner sandbox as a branch snapshot of HEAD's branch once the command ends.
|
|
9
|
-
*
|
|
10
|
-
* - `new-head`: when the command exited 0 and the run didn't start from a branch snapshot HEAD's commit saved;
|
|
11
|
-
* nothing, and no word of it, with a detached HEAD. What a run does when neither `--save-snapshot` nor the
|
|
12
|
-
* recipe's `saveSnapshot` is given.
|
|
13
|
-
* - `always`: whatever the command's exit code and whatever runner snapshot the run started from; with a detached HEAD
|
|
14
|
-
* the run says it saves nothing (`--save-snapshot`, or the recipe's `saveSnapshot: true`).
|
|
15
|
-
* - `never`: `--save-snapshot=false`, or the recipe's `saveSnapshot: false`; with neither given, `CI` set, or a
|
|
16
|
-
* recipe whose install or build step names a runner secret.
|
|
17
|
-
*/
|
|
18
|
-
export type RunnerSaveMode = "new-head" | "always" | "never";
|
|
19
7
|
/** What `prepareRunner` checks a run with; `Run` is what the recipe's `vcpus` function is called with. */
|
|
20
8
|
export interface PrepareRunnerRequest<Run> {
|
|
21
9
|
/** The directory the run started in, inside the checkout. */
|
|
@@ -23,24 +11,12 @@ export interface PrepareRunnerRequest<Run> {
|
|
|
23
11
|
readonly recipe: CheckedRecipe<Run>;
|
|
24
12
|
/** The run, for the recipe's `vcpus`, with the keys of its resources. */
|
|
25
13
|
readonly vcpusRun: VcpusRun<Run>;
|
|
26
|
-
/** `--rebuild-snapshot`: the run builds a runner snapshot whatever the cache holds, so the cache isn't read. */
|
|
27
|
-
readonly rebuild: boolean;
|
|
28
|
-
/** Whether the run saves the runner sandbox as a branch snapshot of HEAD's branch once the command ends. */
|
|
29
|
-
readonly save: RunnerSaveMode;
|
|
30
|
-
/**
|
|
31
|
-
* Whether `--save-snapshot`, or the recipe's `saveSnapshot: true` without `--save-snapshot=false`, trusts commands
|
|
32
|
-
* that ran on this branch with the install and build steps' runner secrets. Without that trust, a recipe whose
|
|
33
|
-
* install or build step names one starts only from a base snapshot.
|
|
34
|
-
*/
|
|
35
|
-
readonly trustBranchSnapshots: boolean;
|
|
36
14
|
}
|
|
37
15
|
/** The runner, checked on this machine, ready for the runner sandbox. */
|
|
38
16
|
export interface PreparedRunner {
|
|
39
17
|
readonly recipe: CheckedRecipe;
|
|
40
18
|
readonly repoRoot: string;
|
|
41
|
-
/**
|
|
42
|
-
readonly head: CheckoutHead;
|
|
43
|
-
/** The run's base, a full SHA, and the ref it is HEAD's merge-base with. */
|
|
19
|
+
/** The run's base, HEAD's merge-base with a base ref, as a full SHA, and that ref. */
|
|
44
20
|
readonly base: string;
|
|
45
21
|
readonly baseRef: string;
|
|
46
22
|
/** The recipe's snapshot steps at the base, each with the runner secret names it gets, and their snapshot key. */
|
|
@@ -49,34 +25,24 @@ export interface PreparedRunner {
|
|
|
49
25
|
readonly snapshotKey: string;
|
|
50
26
|
/** The runner sandbox's vCPUs for the run. */
|
|
51
27
|
readonly vcpus: number;
|
|
28
|
+
/** What the run uploads on top of the base. */
|
|
52
29
|
readonly upload: CheckoutUpload;
|
|
53
30
|
/**
|
|
54
|
-
* The cached runner snapshots the run may start from,
|
|
55
|
-
*
|
|
31
|
+
* The cached runner snapshots the run may start from, each at the run's base with its snapshot key, before the team
|
|
32
|
+
* and project filter (`pickSnapshot`).
|
|
56
33
|
*/
|
|
57
34
|
readonly candidates: readonly RunnerSnapshotCandidate[];
|
|
58
|
-
|
|
59
|
-
|
|
35
|
+
/** The recipe's other cached snapshots, each with why the run doesn't start from it, before that filter. */
|
|
36
|
+
readonly rejected: readonly RejectedSnapshot[];
|
|
37
|
+
/** How many commits HEAD has that the run's base lacks. */
|
|
38
|
+
readonly commitsAfterBase: number;
|
|
39
|
+
/** What removing expired entries noticed (`removeExpiredEntries`), for the run to report. */
|
|
60
40
|
readonly notes: readonly SnapshotCacheNote[];
|
|
61
|
-
/**
|
|
62
|
-
* The branch the run saves a branch snapshot of, and whether it saves whatever the command's exit code and whatever
|
|
63
|
-
* runner snapshot it started from (`always`) or only when the command exits 0 and that isn't a branch snapshot
|
|
64
|
-
* HEAD's commit saved; in a run that saves always, why it saves none (`skipped`, with a detached HEAD); null when
|
|
65
|
-
* the run saves none and says nothing of it: a run that saves never, or a detached HEAD in any other.
|
|
66
|
-
*/
|
|
67
|
-
readonly save: {
|
|
68
|
-
readonly kind: "branch";
|
|
69
|
-
readonly branch: string;
|
|
70
|
-
readonly always: boolean;
|
|
71
|
-
} | {
|
|
72
|
-
readonly kind: "skipped";
|
|
73
|
-
readonly reason: "detached-head";
|
|
74
|
-
} | null;
|
|
75
41
|
}
|
|
76
42
|
/**
|
|
77
43
|
* How the local checks ended.
|
|
78
44
|
*
|
|
79
|
-
* - `ok`: the
|
|
45
|
+
* - `ok`: the checks passed, so the runner can ready the runner sandbox.
|
|
80
46
|
* - `no-base-ref`: no ref in `baseRefs` exists locally and shares history with HEAD; `refs` says why for each.
|
|
81
47
|
* - `submodules`: the checkout has Git submodules, at `paths`.
|
|
82
48
|
* - `invalid-recipe`: a step function or `vcpus` failed or returned something storm can't use, such as a step naming
|
|
@@ -102,9 +68,10 @@ export type PrepareRunnerOutcome = {
|
|
|
102
68
|
readonly failure: CheckoutFailure;
|
|
103
69
|
};
|
|
104
70
|
/**
|
|
105
|
-
* Runs the local checks in order: the repository's root,
|
|
106
|
-
* the base and their key, the runner's vCPUs, the upload,
|
|
107
|
-
*
|
|
108
|
-
*
|
|
71
|
+
* Runs the local checks in order: the repository's root, the base, the submodule refusal, the snapshot steps at
|
|
72
|
+
* the base and their key, the runner's vCPUs, the upload, HEAD's count of commits after the base, and the cache read,
|
|
73
|
+
* which removes expired entries' files (`removeExpiredEntries`) and classifies the rest (`classifySnapshotEntries`)
|
|
74
|
+
* against the merge-base and its snapshot key. So every git call and step function call happens here, before anything
|
|
75
|
+
* is minted. It never mints, acquires or creates.
|
|
109
76
|
*/
|
|
110
77
|
export declare function prepareRunner<Run>(context: RunnerPrepareContext, request: PrepareRunnerRequest<Run>): Promise<PrepareRunnerOutcome>;
|
package/dist/runner/prepare.js
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
// anything, so a missing base, a checkout with submodules or a recipe storm can't use fails with nothing to
|
|
3
3
|
// clean up.
|
|
4
4
|
import { resolveBase } from "./base.js";
|
|
5
|
-
import { resolveVcpus
|
|
6
|
-
import {
|
|
5
|
+
import { resolveVcpus } from "./recipe.js";
|
|
6
|
+
import { classifySnapshotEntries, removeExpiredEntries, } from "./snapshot-cache.js";
|
|
7
7
|
import { snapshotStepsAt } from "./snapshot-key.js";
|
|
8
8
|
/**
|
|
9
|
-
* Runs the local checks in order: the repository's root,
|
|
10
|
-
* the base and their key, the runner's vCPUs, the upload,
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* Runs the local checks in order: the repository's root, the base, the submodule refusal, the snapshot steps at
|
|
10
|
+
* the base and their key, the runner's vCPUs, the upload, HEAD's count of commits after the base, and the cache read,
|
|
11
|
+
* which removes expired entries' files (`removeExpiredEntries`) and classifies the rest (`classifySnapshotEntries`)
|
|
12
|
+
* against the merge-base and its snapshot key. So every git call and step function call happens here, before anything
|
|
13
|
+
* is minted. It never mints, acquires or creates.
|
|
13
14
|
*/
|
|
14
15
|
export async function prepareRunner(context, request) {
|
|
15
16
|
const { checkout } = context;
|
|
@@ -18,9 +19,6 @@ export async function prepareRunner(context, request) {
|
|
|
18
19
|
if (!root.ok)
|
|
19
20
|
return { kind: "checkout-failed", failure: root.failure };
|
|
20
21
|
const repoRoot = root.value;
|
|
21
|
-
const head = await checkout.head({ repoRoot });
|
|
22
|
-
if (!head.ok)
|
|
23
|
-
return { kind: "checkout-failed", failure: head.failure };
|
|
24
22
|
const resolved = await resolveBase(checkout, { repoRoot, baseRefs: recipe.baseRefs });
|
|
25
23
|
if (resolved.kind === "failed")
|
|
26
24
|
return { kind: "checkout-failed", failure: resolved.failure };
|
|
@@ -41,16 +39,22 @@ export async function prepareRunner(context, request) {
|
|
|
41
39
|
const upload = await checkout.assembleUpload({ repoRoot, base });
|
|
42
40
|
if (!upload.ok)
|
|
43
41
|
return { kind: "checkout-failed", failure: upload.failure };
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
const afterBase = await checkout.commitCount({ repoRoot, from: base, to: "HEAD" });
|
|
43
|
+
if (!afterBase.ok)
|
|
44
|
+
return { kind: "checkout-failed", failure: afterBase.failure };
|
|
45
|
+
const listing = await removeExpiredEntries(context);
|
|
46
|
+
const cache = classifySnapshotEntries(context, {
|
|
47
|
+
entries: listing.entries,
|
|
48
|
+
recipe,
|
|
49
|
+
base,
|
|
50
|
+
snapshotKey: steps.key,
|
|
51
|
+
commitsAfterBase: afterBase.value,
|
|
52
|
+
});
|
|
48
53
|
return {
|
|
49
54
|
kind: "ok",
|
|
50
55
|
prepared: {
|
|
51
56
|
recipe,
|
|
52
57
|
repoRoot,
|
|
53
|
-
head: head.value,
|
|
54
58
|
base,
|
|
55
59
|
baseRef: resolved.ref,
|
|
56
60
|
toolchains: steps.toolchains,
|
|
@@ -59,17 +63,9 @@ export async function prepareRunner(context, request) {
|
|
|
59
63
|
vcpus: vcpus.vcpus,
|
|
60
64
|
upload: upload.value,
|
|
61
65
|
candidates: cache.candidates,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
rejected: cache.rejected,
|
|
67
|
+
commitsAfterBase: afterBase.value,
|
|
68
|
+
notes: listing.notes,
|
|
65
69
|
},
|
|
66
70
|
};
|
|
67
71
|
}
|
|
68
|
-
/** What a run in `mode` saves with HEAD on `branch`, null when detached. */
|
|
69
|
-
function plannedSave(mode, branch) {
|
|
70
|
-
if (mode === "never")
|
|
71
|
-
return null;
|
|
72
|
-
if (branch !== null)
|
|
73
|
-
return { kind: "branch", branch, always: mode === "always" };
|
|
74
|
-
return mode === "always" ? { kind: "skipped", reason: "detached-head" } : null;
|
|
75
|
-
}
|
package/dist/runner/ready.d.ts
CHANGED
|
@@ -9,13 +9,15 @@ export declare const APPLY_LABEL = "Applying your changes";
|
|
|
9
9
|
/** A runner sandbox ready for the command. */
|
|
10
10
|
export interface ReadyRunner {
|
|
11
11
|
readonly sandbox: RunnerSandbox;
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*/
|
|
16
|
-
readonly startedFrom: RunnerSnapshotEntry;
|
|
12
|
+
/** The base snapshot it started from, and its base, which its repository holds as its first commit. */
|
|
13
|
+
readonly snapshotId: string;
|
|
14
|
+
readonly base: string;
|
|
17
15
|
/** Whether this run built the runner snapshot. */
|
|
18
16
|
readonly built: boolean;
|
|
17
|
+
/** How many commits HEAD has that the snapshot's base lacks. */
|
|
18
|
+
readonly builtBehind: number;
|
|
19
|
+
/** How many bytes of changes the run uploaded on top of the snapshot's base. */
|
|
20
|
+
readonly uploadBytes: number;
|
|
19
21
|
/** How long the build step took, in milliseconds. */
|
|
20
22
|
readonly buildMs: number;
|
|
21
23
|
readonly vcpus: number;
|
|
@@ -57,18 +59,20 @@ export type ReadyRunnerOutcome = {
|
|
|
57
59
|
export interface ReadyRunnerRequest {
|
|
58
60
|
readonly prepared: PreparedRunner;
|
|
59
61
|
readonly access: SandboxAccess;
|
|
60
|
-
/** The local user, for
|
|
62
|
+
/** The local user, for the build sandbox's and the runner sandbox's `user` tag. */
|
|
61
63
|
readonly user: string;
|
|
62
64
|
/**
|
|
63
|
-
* Every runner secret's value, of which each
|
|
64
|
-
* ones
|
|
65
|
+
* Every runner secret's value, of which each toolchain and prebuild step of a build, and the install and build
|
|
66
|
+
* steps, get the ones they name.
|
|
65
67
|
*/
|
|
66
68
|
readonly secrets: RunnerSecrets;
|
|
67
69
|
}
|
|
68
70
|
/**
|
|
69
|
-
* Readies the runner sandbox for a prepared run.
|
|
70
|
-
*
|
|
71
|
-
* snapshot
|
|
71
|
+
* Readies the runner sandbox for a prepared run. It picks, of the prepared candidates, the one for the access's team
|
|
72
|
+
* and project (`pickSnapshot`) and reports `snapshot-reused`; with no pick, it builds a base
|
|
73
|
+
* snapshot at the run's base, saying why each cached snapshot of the recipe doesn't fit (`no-snapshot`,
|
|
74
|
+
* `snapshotRejections`; `buildSnapshot`). Then it starts the runner sandbox from that snapshot, uploads what the
|
|
75
|
+
* checkout changes on top of the run's base, applies it, and runs the install and the build.
|
|
72
76
|
*/
|
|
73
77
|
export declare function readyRunner(context: RunnerContext, request: ReadyRunnerRequest, control: {
|
|
74
78
|
readonly scope: RunnerSandboxScope;
|