@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
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { type ResourceReports, type RunOutcome, type RunRequest, type RunState } from "../core/index.ts";
|
|
3
|
-
import type { RunnerSave } from "../runner/index.ts";
|
|
4
3
|
import type { Row } from "../sdk/extension/index.ts";
|
|
5
4
|
import type { TestEvent } from "../sdk/run/launcher.ts";
|
|
6
5
|
import { type TestPlanFacts } from "./plan.ts";
|
|
@@ -40,7 +39,7 @@ export type RecordedResources = {
|
|
|
40
39
|
};
|
|
41
40
|
};
|
|
42
41
|
/**
|
|
43
|
-
* How a run ended: its outcome's kind (`ran`, `canceled`, `
|
|
42
|
+
* How a run ended: its outcome's kind (`ran`, `canceled`, `spawn_failed`, …), the status storm exited with and the
|
|
44
43
|
* signal that ended the command, for a run whose command ran (null otherwise), how long the command took (null when it
|
|
45
44
|
* never ended), its tests' totals (null without a final result), why those may be incomplete (null unless a sandboxed
|
|
46
45
|
* run's final read of its test events file failed), what each resource instance it acquired reports of itself, as a
|
|
@@ -55,42 +54,15 @@ declare const snapshotSchema: z.ZodObject<{
|
|
|
55
54
|
id: z.ZodString;
|
|
56
55
|
base: z.ZodString;
|
|
57
56
|
built: z.ZodBoolean;
|
|
58
|
-
|
|
59
|
-
head: z.ZodNullable<z.ZodString>;
|
|
57
|
+
builtBehind: z.ZodNullable<z.ZodNumber>;
|
|
60
58
|
}, z.core.$strip>;
|
|
61
59
|
/**
|
|
62
60
|
* The runner snapshot a runner sandbox started from: its id, the base it is of, which the run's changes were uploaded
|
|
63
|
-
* on top of, whether the run built it or reused a cached one, and
|
|
64
|
-
*
|
|
61
|
+
* on top of and the commit it was built at, whether the run built it or reused a cached one, and how many commits HEAD
|
|
62
|
+
* has that its base lacks (`builtBehind`), null when the run state had no count. Version 5 records only base snapshots; storm does not read a version 4
|
|
63
|
+
* record, whose dev snapshot count may have been measured from another commit than its base.
|
|
65
64
|
*/
|
|
66
65
|
export type RunRecordSnapshot = Readonly<z.output<typeof snapshotSchema>>;
|
|
67
|
-
/**
|
|
68
|
-
* How saving the runner sandbox as a branch snapshot ended, as a `ran` outcome and `run.json` report it.
|
|
69
|
-
*/
|
|
70
|
-
export declare const saveSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
71
|
-
kind: z.ZodLiteral<"saved">;
|
|
72
|
-
snapshotId: z.ZodString;
|
|
73
|
-
base: z.ZodString;
|
|
74
|
-
branch: z.ZodString;
|
|
75
|
-
head: z.ZodString;
|
|
76
|
-
ms: z.ZodNumber;
|
|
77
|
-
sizeBytes: z.ZodNumber;
|
|
78
|
-
entryWritten: z.ZodBoolean;
|
|
79
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
80
|
-
kind: z.ZodLiteral<"skipped">;
|
|
81
|
-
reason: z.ZodLiteral<"detached-head">;
|
|
82
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
83
|
-
kind: z.ZodLiteral<"failed">;
|
|
84
|
-
step: z.ZodEnum<{
|
|
85
|
-
"save-snapshot": "save-snapshot";
|
|
86
|
-
scrub: "scrub";
|
|
87
|
-
}>;
|
|
88
|
-
message: z.ZodString;
|
|
89
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
90
|
-
kind: z.ZodLiteral<"stopped">;
|
|
91
|
-
}, z.core.$strip>], "kind">;
|
|
92
|
-
/** How saving the runner sandbox as a branch snapshot ended. */
|
|
93
|
-
export type RunRecordSave = z.output<typeof saveSchema>;
|
|
94
66
|
declare const whereSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
95
67
|
kind: z.ZodLiteral<"unsandboxed">;
|
|
96
68
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -107,40 +79,18 @@ declare const whereSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
107
79
|
id: z.ZodString;
|
|
108
80
|
base: z.ZodString;
|
|
109
81
|
built: z.ZodBoolean;
|
|
110
|
-
|
|
111
|
-
head: z.ZodNullable<z.ZodString>;
|
|
82
|
+
builtBehind: z.ZodNullable<z.ZodNumber>;
|
|
112
83
|
}, z.core.$strip>>;
|
|
113
84
|
keptUntil: z.ZodNullable<z.ZodString>;
|
|
114
|
-
|
|
115
|
-
kind: z.ZodLiteral<"saved">;
|
|
116
|
-
snapshotId: z.ZodString;
|
|
117
|
-
base: z.ZodString;
|
|
118
|
-
branch: z.ZodString;
|
|
119
|
-
head: z.ZodString;
|
|
120
|
-
ms: z.ZodNumber;
|
|
121
|
-
sizeBytes: z.ZodNumber;
|
|
122
|
-
entryWritten: z.ZodBoolean;
|
|
123
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
124
|
-
kind: z.ZodLiteral<"skipped">;
|
|
125
|
-
reason: z.ZodLiteral<"detached-head">;
|
|
126
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
127
|
-
kind: z.ZodLiteral<"failed">;
|
|
128
|
-
step: z.ZodEnum<{
|
|
129
|
-
"save-snapshot": "save-snapshot";
|
|
130
|
-
scrub: "scrub";
|
|
131
|
-
}>;
|
|
132
|
-
message: z.ZodString;
|
|
133
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
134
|
-
kind: z.ZodLiteral<"stopped">;
|
|
135
|
-
}, z.core.$strip>], "kind">>;
|
|
85
|
+
uploadBytes: z.ZodNullable<z.ZodNumber>;
|
|
136
86
|
}, z.core.$strip>], "kind">;
|
|
137
87
|
/**
|
|
138
|
-
* Where
|
|
88
|
+
* Where the command ran: on this machine (`unsandboxed`, with `--unsandboxed`), or in a runner sandbox (`runner`):
|
|
139
89
|
* the control plane team and project it runs in, its region, runtime and vCPUs, and the run's base, HEAD's merge-base
|
|
140
90
|
* with `baseRef`, all known as the run starts; then, once the run is over, the runner sandbox's name and the runner
|
|
141
91
|
* snapshot it started from, each null when the run stopped before it, when the runner sandbox's timeout stops it, as an
|
|
142
|
-
* ISO time, when the run kept it running (null when it stopped and deleted it), and how
|
|
143
|
-
*
|
|
92
|
+
* ISO time, when the run kept it running (null when it stopped and deleted it), and how many bytes of changes the run
|
|
93
|
+
* uploaded (null when the run stopped before the upload).
|
|
144
94
|
*/
|
|
145
95
|
export type RunRecordWhere = Readonly<z.output<typeof whereSchema>>;
|
|
146
96
|
declare const gitSchema: z.ZodObject<{
|
|
@@ -159,7 +109,7 @@ export type RunRecordGit = Readonly<z.output<typeof gitSchema>>;
|
|
|
159
109
|
*/
|
|
160
110
|
export type RunRecordPlan = TestPlanFacts;
|
|
161
111
|
declare const runRecordSchema: z.ZodObject<{
|
|
162
|
-
version: z.ZodLiteral<
|
|
112
|
+
version: z.ZodLiteral<5>;
|
|
163
113
|
startedAt: z.ZodString;
|
|
164
114
|
cwd: z.ZodString;
|
|
165
115
|
configFile: z.ZodNullable<z.ZodString>;
|
|
@@ -193,32 +143,10 @@ declare const runRecordSchema: z.ZodObject<{
|
|
|
193
143
|
id: z.ZodString;
|
|
194
144
|
base: z.ZodString;
|
|
195
145
|
built: z.ZodBoolean;
|
|
196
|
-
|
|
197
|
-
head: z.ZodNullable<z.ZodString>;
|
|
146
|
+
builtBehind: z.ZodNullable<z.ZodNumber>;
|
|
198
147
|
}, z.core.$strip>>;
|
|
199
148
|
keptUntil: z.ZodNullable<z.ZodString>;
|
|
200
|
-
|
|
201
|
-
kind: z.ZodLiteral<"saved">;
|
|
202
|
-
snapshotId: z.ZodString;
|
|
203
|
-
base: z.ZodString;
|
|
204
|
-
branch: z.ZodString;
|
|
205
|
-
head: z.ZodString;
|
|
206
|
-
ms: z.ZodNumber;
|
|
207
|
-
sizeBytes: z.ZodNumber;
|
|
208
|
-
entryWritten: z.ZodBoolean;
|
|
209
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
210
|
-
kind: z.ZodLiteral<"skipped">;
|
|
211
|
-
reason: z.ZodLiteral<"detached-head">;
|
|
212
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
213
|
-
kind: z.ZodLiteral<"failed">;
|
|
214
|
-
step: z.ZodEnum<{
|
|
215
|
-
"save-snapshot": "save-snapshot";
|
|
216
|
-
scrub: "scrub";
|
|
217
|
-
}>;
|
|
218
|
-
message: z.ZodString;
|
|
219
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
220
|
-
kind: z.ZodLiteral<"stopped">;
|
|
221
|
-
}, z.core.$strip>], "kind">>;
|
|
149
|
+
uploadBytes: z.ZodNullable<z.ZodNumber>;
|
|
222
150
|
}, z.core.$strip>], "kind">;
|
|
223
151
|
git: z.ZodNullable<z.ZodObject<{
|
|
224
152
|
branch: z.ZodNullable<z.ZodString>;
|
|
@@ -253,7 +181,7 @@ export type RunRecord = Readonly<Omit<z.output<typeof runRecordSchema>, "ended">
|
|
|
253
181
|
}>;
|
|
254
182
|
/** `run.json`'s text for `record`. */
|
|
255
183
|
export declare function runRecordText(record: RunRecord): string;
|
|
256
|
-
/** The run `text` records; undefined when there is no text, or it isn't a version
|
|
184
|
+
/** The run `text` records; undefined when there is no text, or it isn't a version 5 `run.json`. */
|
|
257
185
|
export declare function parseRunRecord(text: string | undefined): RunRecord | undefined;
|
|
258
186
|
/** The totals of `events`' final results; null without one. */
|
|
259
187
|
export declare function testTotals(events: readonly TestEvent[]): RunTestTotals | null;
|
|
@@ -266,15 +194,14 @@ export declare function testTotals(events: readonly TestEvent[]): RunTestTotals
|
|
|
266
194
|
*/
|
|
267
195
|
export declare function runEnd(outcome: RunOutcome, ran: RunState["command"], tests: RunTestEvents, reports: ResourceReports): RunRecordEnd;
|
|
268
196
|
/**
|
|
269
|
-
* Where the
|
|
197
|
+
* Where the command runs, as `run.json` records it as the run starts: unsandboxed, or in a runner sandbox, with
|
|
270
198
|
* no sandbox or snapshot yet.
|
|
271
199
|
*/
|
|
272
200
|
export declare function startedWhere(run: RunRequest): RunRecordWhere;
|
|
273
201
|
/**
|
|
274
202
|
* `where` once the run is over, from the runner's final state: for a sandboxed run, the runner sandbox the run started,
|
|
275
203
|
* the runner snapshot it started from, which the run reused or built, when its timeout stops the runner sandbox it
|
|
276
|
-
* kept running
|
|
277
|
-
* kept no runner sandbox, or saved none.
|
|
204
|
+
* kept running. Each is null when the run stopped before it, or kept no runner sandbox.
|
|
278
205
|
*/
|
|
279
|
-
export declare function endedWhere(where: RunRecordWhere, runner: RunState["runner"]
|
|
206
|
+
export declare function endedWhere(where: RunRecordWhere, runner: RunState["runner"]): RunRecordWhere;
|
|
280
207
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// What a run records about itself in its run directory's `run.json`, which `storm runs` reads back: written as
|
|
2
2
|
// the run directory opens, then replaced with how the run ended once it is over. The run directory gateway stores the
|
|
3
|
-
// text; this file owns its shape, version
|
|
4
|
-
// once it is over, and how the run ended. Reading it back asks the
|
|
5
|
-
// read as recorded, beside its definition's name, and `runs show` lists the rows storm rendered for
|
|
6
|
-
// ended, so a past run reads the same after a resource definition is renamed or its extension
|
|
3
|
+
// text; this file owns its shape, version 5, and what goes in it: where the command runs, as the run starts and
|
|
4
|
+
// once it is over, and how the run ended. Reading it back asks the resource definition set nothing: each resource
|
|
5
|
+
// instance's facts read as recorded, beside its definition's name, and `runs show` lists the rows storm rendered for
|
|
6
|
+
// them when the run ended, so a past run reads the same after a resource definition is renamed or its extension
|
|
7
|
+
// removed.
|
|
7
8
|
import { z } from "zod";
|
|
8
9
|
import { commandExitStatus, } from "../core/index.js";
|
|
9
10
|
import { planSchema } from "./plan.js";
|
|
@@ -26,47 +27,8 @@ const snapshotSchema = z.object({
|
|
|
26
27
|
id: z.string(),
|
|
27
28
|
base: z.string(),
|
|
28
29
|
built: z.boolean(),
|
|
29
|
-
|
|
30
|
-
head: z.string().nullable(),
|
|
30
|
+
builtBehind: z.number().nullable(),
|
|
31
31
|
});
|
|
32
|
-
/**
|
|
33
|
-
* How saving the runner sandbox as a branch snapshot ended, as a `ran` outcome and `run.json` report it.
|
|
34
|
-
*/
|
|
35
|
-
export const saveSchema = z.discriminatedUnion("kind", [
|
|
36
|
-
z.object({
|
|
37
|
-
/** It saved the runner sandbox as a branch snapshot. */
|
|
38
|
-
kind: z.literal("saved"),
|
|
39
|
-
/** The runner snapshot it saved. */
|
|
40
|
-
snapshotId: z.string(),
|
|
41
|
-
/** The base it is of: the base of the runner snapshot the run started from, a full SHA. */
|
|
42
|
-
base: z.string(),
|
|
43
|
-
/** The local branch it is for. */
|
|
44
|
-
branch: z.string(),
|
|
45
|
-
/** HEAD's commit as the run started, a full SHA. */
|
|
46
|
-
head: z.string(),
|
|
47
|
-
/** How long the save took, in milliseconds, from the scrub's start until the snapshot was saved. */
|
|
48
|
-
ms: z.number(),
|
|
49
|
-
/** The snapshot's size in bytes. */
|
|
50
|
-
sizeBytes: z.number(),
|
|
51
|
-
/** Whether the runner snapshot cache recorded it; a later run on the branch starts from it only when it did. */
|
|
52
|
-
entryWritten: z.boolean(),
|
|
53
|
-
}),
|
|
54
|
-
z.object({
|
|
55
|
-
/** It didn't save: HEAD was detached, so there is no branch to save for. */
|
|
56
|
-
kind: z.literal("skipped"),
|
|
57
|
-
reason: z.literal("detached-head"),
|
|
58
|
-
}),
|
|
59
|
-
z.object({
|
|
60
|
-
/** It didn't save: the scrub or the save failed. */
|
|
61
|
-
kind: z.literal("failed"),
|
|
62
|
-
step: z.enum(["scrub", "save-snapshot"]),
|
|
63
|
-
message: z.string(),
|
|
64
|
-
}),
|
|
65
|
-
z.object({
|
|
66
|
-
/** It didn't save, or recorded nothing: a signal stopped it. */
|
|
67
|
-
kind: z.literal("stopped"),
|
|
68
|
-
}),
|
|
69
|
-
]);
|
|
70
32
|
const whereSchema = z.discriminatedUnion("kind", [
|
|
71
33
|
z.object({ kind: z.literal("unsandboxed") }),
|
|
72
34
|
z.object({
|
|
@@ -81,12 +43,12 @@ const whereSchema = z.discriminatedUnion("kind", [
|
|
|
81
43
|
sandbox: z.string().nullable(),
|
|
82
44
|
snapshot: snapshotSchema.nullable(),
|
|
83
45
|
keptUntil: z.string().nullable(),
|
|
84
|
-
|
|
46
|
+
uploadBytes: z.number().nullable(),
|
|
85
47
|
}),
|
|
86
48
|
]);
|
|
87
49
|
const gitSchema = z.object({ branch: z.string().nullable(), commit: z.string(), dirty: z.boolean() });
|
|
88
50
|
const runRecordSchema = z.object({
|
|
89
|
-
version: z.literal(
|
|
51
|
+
version: z.literal(5),
|
|
90
52
|
startedAt: z.string(),
|
|
91
53
|
cwd: z.string(),
|
|
92
54
|
configFile: z.string().nullable(),
|
|
@@ -101,7 +63,7 @@ const runRecordSchema = z.object({
|
|
|
101
63
|
export function runRecordText(record) {
|
|
102
64
|
return JSON.stringify(record);
|
|
103
65
|
}
|
|
104
|
-
/** The run `text` records; undefined when there is no text, or it isn't a version
|
|
66
|
+
/** The run `text` records; undefined when there is no text, or it isn't a version 5 `run.json`. */
|
|
105
67
|
export function parseRunRecord(text) {
|
|
106
68
|
if (text === undefined)
|
|
107
69
|
return undefined;
|
|
@@ -159,7 +121,7 @@ export function runEnd(outcome, ran, tests, reports) {
|
|
|
159
121
|
};
|
|
160
122
|
}
|
|
161
123
|
/**
|
|
162
|
-
* Where the
|
|
124
|
+
* Where the command runs, as `run.json` records it as the run starts: unsandboxed, or in a runner sandbox, with
|
|
163
125
|
* no sandbox or snapshot yet.
|
|
164
126
|
*/
|
|
165
127
|
export function startedWhere(run) {
|
|
@@ -178,16 +140,15 @@ export function startedWhere(run) {
|
|
|
178
140
|
sandbox: null,
|
|
179
141
|
snapshot: null,
|
|
180
142
|
keptUntil: null,
|
|
181
|
-
|
|
143
|
+
uploadBytes: null,
|
|
182
144
|
};
|
|
183
145
|
}
|
|
184
146
|
/**
|
|
185
147
|
* `where` once the run is over, from the runner's final state: for a sandboxed run, the runner sandbox the run started,
|
|
186
148
|
* the runner snapshot it started from, which the run reused or built, when its timeout stops the runner sandbox it
|
|
187
|
-
* kept running
|
|
188
|
-
* kept no runner sandbox, or saved none.
|
|
149
|
+
* kept running. Each is null when the run stopped before it, or kept no runner sandbox.
|
|
189
150
|
*/
|
|
190
|
-
export function endedWhere(where, runner
|
|
151
|
+
export function endedWhere(where, runner) {
|
|
191
152
|
if (where.kind === "unsandboxed")
|
|
192
153
|
return where;
|
|
193
154
|
const snapshot = runner?.snapshot;
|
|
@@ -200,10 +161,9 @@ export function endedWhere(where, runner, save) {
|
|
|
200
161
|
id: snapshot.id,
|
|
201
162
|
base: snapshot.base,
|
|
202
163
|
built: snapshot.kind === "built",
|
|
203
|
-
|
|
204
|
-
head: snapshot.head,
|
|
164
|
+
builtBehind: snapshot.builtBehind,
|
|
205
165
|
},
|
|
206
166
|
keptUntil: runner?.kept?.stopsAt ?? null,
|
|
207
|
-
|
|
167
|
+
uploadBytes: runner?.uploadBytes ?? null,
|
|
208
168
|
};
|
|
209
169
|
}
|
|
@@ -26,6 +26,7 @@ export declare const timelineSchema: z.ZodObject<{
|
|
|
26
26
|
stopped: "stopped";
|
|
27
27
|
unfinished: "unfinished";
|
|
28
28
|
}>;
|
|
29
|
+
bytes: z.ZodOptional<z.ZodNumber>;
|
|
29
30
|
}, z.core.$strip>>;
|
|
30
31
|
idleMs: z.ZodNumber;
|
|
31
32
|
snapshot: z.ZodOptional<z.ZodEnum<{
|
|
@@ -48,6 +49,6 @@ export type TimelineFacts = z.output<typeof timelineSchema>;
|
|
|
48
49
|
export type TimelineFactsRow = TimelineFacts["rows"][number];
|
|
49
50
|
/**
|
|
50
51
|
* `timeline` as storm reports and keeps it, each row labeled as the waterfall names it now, a resource lane by its
|
|
51
|
-
* definition's lane kind among `laneKinds` (the
|
|
52
|
+
* definition's lane kind among `laneKinds` (the definition set's `presentations.laneKinds`).
|
|
52
53
|
*/
|
|
53
54
|
export declare function timelineFacts(timeline: Timeline, laneKinds: readonly LaneKind[]): TimelineFacts;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// directory's `timeline.json`, and what the waterfall and the job summary draw. Each row keeps the label storm gave
|
|
3
3
|
// it when the run ended, and its name and its steps' names are plain strings, so a past run's timeline still reads and
|
|
4
4
|
// draws as it was after a resource's lane or steps are renamed, or its extension removed: reading it back asks the
|
|
5
|
-
//
|
|
5
|
+
// resource definition set nothing.
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
/** Which row of the timeline: its name, and for a resource instance's lane the resource key, null for any other. */
|
|
8
8
|
const rowRefShape = {
|
|
@@ -36,6 +36,8 @@ export const timelineSchema = z.object({
|
|
|
36
36
|
startMs: z.number(),
|
|
37
37
|
endMs: z.number(),
|
|
38
38
|
outcome: timelineOutcomeSchema,
|
|
39
|
+
/** The runner's upload step's: how many bytes of changes it uploaded; absent on any other step and in a timeline written before storm recorded it. */
|
|
40
|
+
bytes: z.number().optional(),
|
|
39
41
|
})),
|
|
40
42
|
/** How long the lane, once ready, waited for the other before the command started. */
|
|
41
43
|
idleMs: z.number(),
|
|
@@ -49,7 +51,7 @@ export const timelineSchema = z.object({
|
|
|
49
51
|
});
|
|
50
52
|
/**
|
|
51
53
|
* `timeline` as storm reports and keeps it, each row labeled as the waterfall names it now, a resource lane by its
|
|
52
|
-
* definition's lane kind among `laneKinds` (the
|
|
54
|
+
* definition's lane kind among `laneKinds` (the definition set's `presentations.laneKinds`).
|
|
53
55
|
*/
|
|
54
56
|
export function timelineFacts(timeline, laneKinds) {
|
|
55
57
|
return {
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { RunnerContext } from "./context.ts";
|
|
2
|
+
import type { RunnerFailure, RunnerProgress } from "./events.ts";
|
|
3
|
+
import type { CheckoutHead, RunnerSnapshotCacheFailure, RunnerSnapshotEntry, SandboxAccess } from "./gateways.ts";
|
|
4
|
+
import type { PrepareRunnerOutcome, RunnerPrepareContext } from "./prepare.ts";
|
|
5
|
+
import type { CheckedRecipe } from "./recipe.ts";
|
|
6
|
+
import { type RunnerScopeFacts } from "./scope.ts";
|
|
7
|
+
import type { RunnerSecrets } from "./secrets.ts";
|
|
8
|
+
import { type BaseSnapshotPlan } from "./snapshot-build.ts";
|
|
9
|
+
/** What `prepareSnapshotBuild` checks: where, which recipe, and what to build. */
|
|
10
|
+
export interface SnapshotBuildRequest {
|
|
11
|
+
/** The directory the command started in, inside the checkout. */
|
|
12
|
+
readonly cwd: string;
|
|
13
|
+
readonly recipe: CheckedRecipe;
|
|
14
|
+
/** The ref `--base` names; undefined builds at the merge-base. */
|
|
15
|
+
readonly ref: string | undefined;
|
|
16
|
+
/** `--full`: build whatever the cache holds. */
|
|
17
|
+
readonly full: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A build, checked on this machine: the base snapshot it builds (`plan`), HEAD, whose `dirty` says the working tree
|
|
21
|
+
* has uncommitted changes, which a base snapshot doesn't hold, the ref `--base` named (null for the merge-base), HEAD's
|
|
22
|
+
* merge-base and its ref (null for a `--base` build in a checkout where no base ref shares history with HEAD), whether
|
|
23
|
+
* the commit it builds at is that merge-base (`atMergeBase`: a run here starts only from a snapshot at its merge-base,
|
|
24
|
+
* though a run in another checkout, or after a later merge-base, still might), and the base snapshots of `plan`'s base
|
|
25
|
+
* and key the cache holds with more than an hour left (`cached`, before the team and project filter).
|
|
26
|
+
*/
|
|
27
|
+
export interface PreparedSnapshotBuild {
|
|
28
|
+
readonly plan: BaseSnapshotPlan;
|
|
29
|
+
readonly head: CheckoutHead;
|
|
30
|
+
readonly ref: string | null;
|
|
31
|
+
readonly mergeBase: {
|
|
32
|
+
readonly commit: string;
|
|
33
|
+
readonly ref: string;
|
|
34
|
+
} | null;
|
|
35
|
+
readonly atMergeBase: boolean;
|
|
36
|
+
readonly cached: readonly RunnerSnapshotEntry[];
|
|
37
|
+
readonly full: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* How a build's local checks ended: a run's refusals, but `submodules`'s and `invalid-recipe`'s and `checkout-failed`'s
|
|
41
|
+
* that the build shares, or `ref-not-found` when `--base` names no local commit.
|
|
42
|
+
*/
|
|
43
|
+
export type PrepareSnapshotBuildOutcome = {
|
|
44
|
+
readonly kind: "ok";
|
|
45
|
+
readonly build: PreparedSnapshotBuild;
|
|
46
|
+
} | Exclude<PrepareRunnerOutcome, {
|
|
47
|
+
readonly kind: "ok";
|
|
48
|
+
}> | {
|
|
49
|
+
readonly kind: "ref-not-found";
|
|
50
|
+
readonly ref: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Runs a build's local checks, before anything is minted or started: the repository's root, HEAD, the submodule
|
|
54
|
+
* refusal, HEAD's merge-base (`resolveBase`, which refuses with `no-base-ref` only without `--base`), the commit
|
|
55
|
+
* `--base` resolves to locally, the snapshot steps and key at the commit it builds, the cache's base snapshots of it,
|
|
56
|
+
* and, when it builds at the merge-base, HEAD's count of commits after it. It never mints, acquires or creates, and removes no cache file.
|
|
57
|
+
*/
|
|
58
|
+
export declare function prepareSnapshotBuild(context: RunnerPrepareContext, request: SnapshotBuildRequest): Promise<PrepareSnapshotBuildOutcome>;
|
|
59
|
+
/** What `buildSnapshots` is handed: the checked build, where its sandboxes run, who starts them, and the secrets. */
|
|
60
|
+
export interface BuildSnapshotsRequest {
|
|
61
|
+
readonly build: PreparedSnapshotBuild;
|
|
62
|
+
/** The minted credential, and the team and project it names: the sandboxes run there. */
|
|
63
|
+
readonly access: SandboxAccess;
|
|
64
|
+
/** The local user, for each sandbox's `user` tag. */
|
|
65
|
+
readonly user: string;
|
|
66
|
+
/** The runner secrets' values: each recipe step gets the ones it names. */
|
|
67
|
+
readonly secrets: RunnerSecrets;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* How a build ended, before its sandbox scope closed.
|
|
71
|
+
*
|
|
72
|
+
* - `up-to-date`: the cache holds `snapshot`, a base snapshot at the commit for the access's team and project, so
|
|
73
|
+
* nothing started.
|
|
74
|
+
* - `built`: it built `snapshot` in `ms` (`sizeBytes`), and the cache recorded it.
|
|
75
|
+
* - `not-cached`: it built `snapshot`, but the cache couldn't write its entry (`failure`), so no run finds it.
|
|
76
|
+
* - `failed`: a step, a Sandbox call or the checkout failed.
|
|
77
|
+
* - `aborted`: the signal aborted. A base snapshot's save runs to its end once started, so a signal during it still
|
|
78
|
+
* leaves a saved snapshot, which `snapshot` names with whether the cache wrote its entry; null when it saved none.
|
|
79
|
+
*/
|
|
80
|
+
export type SnapshotBuildEnd = {
|
|
81
|
+
readonly kind: "up-to-date";
|
|
82
|
+
readonly snapshot: RunnerSnapshotEntry;
|
|
83
|
+
} | {
|
|
84
|
+
readonly kind: "built";
|
|
85
|
+
readonly snapshot: RunnerSnapshotEntry;
|
|
86
|
+
readonly ms: number;
|
|
87
|
+
readonly sizeBytes: number;
|
|
88
|
+
} | {
|
|
89
|
+
readonly kind: "not-cached";
|
|
90
|
+
readonly snapshot: RunnerSnapshotEntry;
|
|
91
|
+
readonly failure: RunnerSnapshotCacheFailure;
|
|
92
|
+
} | {
|
|
93
|
+
readonly kind: "failed";
|
|
94
|
+
readonly failure: RunnerFailure;
|
|
95
|
+
} | {
|
|
96
|
+
readonly kind: "aborted";
|
|
97
|
+
readonly snapshot: {
|
|
98
|
+
readonly entry: RunnerSnapshotEntry;
|
|
99
|
+
readonly cached: boolean;
|
|
100
|
+
} | null;
|
|
101
|
+
};
|
|
102
|
+
/** How a build ended (`SnapshotBuildEnd`), with what closing its sandbox scope left (`cleanup`). */
|
|
103
|
+
export type SnapshotBuildOutcome = SnapshotBuildEnd & {
|
|
104
|
+
readonly cleanup: RunnerScopeFacts;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Builds the checked build's base snapshot, reporting to `progress`, and closes every sandbox it started however it
|
|
108
|
+
* ends, keeping none. A cached base snapshot at the commit for the access's team and project is up to date, unless
|
|
109
|
+
* `full`, which builds a new one that replaces its cache entry. `signal` stops it in any stage: it says so, then
|
|
110
|
+
* closes the scope at once. A base snapshot's save isn't stopped by the signal, so after it the build checks the signal
|
|
111
|
+
* once and ends `aborted` with what it saved.
|
|
112
|
+
*/
|
|
113
|
+
export declare function buildSnapshots(context: RunnerContext, request: BuildSnapshotsRequest, control: {
|
|
114
|
+
readonly signal: AbortSignal;
|
|
115
|
+
}, progress: RunnerProgress): Promise<SnapshotBuildOutcome>;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// `storm snapshots build`: building one base snapshot that the runner snapshot cache lacks, with no run: at the
|
|
2
|
+
// merge-base by default, or at the commit `--base <ref>` names, which a run starts from only once that commit is its
|
|
3
|
+
// merge-base. It owns its sandbox scope from its first stage to its end, as a run's runner session does. It
|
|
4
|
+
// acquires no resource, runs no command, and keeps no sandbox.
|
|
5
|
+
import { resolveBase } from "./base.js";
|
|
6
|
+
import { runnerSandboxScope } from "./scope.js";
|
|
7
|
+
import { buildSnapshot } from "./snapshot-build.js";
|
|
8
|
+
import { hasTimeLeft } from "./snapshot-cache.js";
|
|
9
|
+
import { snapshotStepsAt } from "./snapshot-key.js";
|
|
10
|
+
/**
|
|
11
|
+
* Runs a build's local checks, before anything is minted or started: the repository's root, HEAD, the submodule
|
|
12
|
+
* refusal, HEAD's merge-base (`resolveBase`, which refuses with `no-base-ref` only without `--base`), the commit
|
|
13
|
+
* `--base` resolves to locally, the snapshot steps and key at the commit it builds, the cache's base snapshots of it,
|
|
14
|
+
* and, when it builds at the merge-base, HEAD's count of commits after it. It never mints, acquires or creates, and removes no cache file.
|
|
15
|
+
*/
|
|
16
|
+
export async function prepareSnapshotBuild(context, request) {
|
|
17
|
+
const { checkout } = context;
|
|
18
|
+
const { recipe, ref } = request;
|
|
19
|
+
const root = await checkout.repositoryRoot({ cwd: request.cwd });
|
|
20
|
+
if (!root.ok)
|
|
21
|
+
return { kind: "checkout-failed", failure: root.failure };
|
|
22
|
+
const repoRoot = root.value;
|
|
23
|
+
const head = await checkout.head({ repoRoot });
|
|
24
|
+
if (!head.ok)
|
|
25
|
+
return { kind: "checkout-failed", failure: head.failure };
|
|
26
|
+
const resolved = await resolveBase(checkout, { repoRoot, baseRefs: recipe.baseRefs });
|
|
27
|
+
if (resolved.kind === "failed")
|
|
28
|
+
return { kind: "checkout-failed", failure: resolved.failure };
|
|
29
|
+
const mergeBase = resolved.kind === "resolved" ? { commit: resolved.base, ref: resolved.ref } : null;
|
|
30
|
+
const submodules = await checkout.submodules({ repoRoot });
|
|
31
|
+
if (!submodules.ok)
|
|
32
|
+
return { kind: "checkout-failed", failure: submodules.failure };
|
|
33
|
+
if (submodules.value.length > 0)
|
|
34
|
+
return { kind: "submodules", paths: [...submodules.value] };
|
|
35
|
+
let base;
|
|
36
|
+
if (ref === undefined) {
|
|
37
|
+
if (resolved.kind !== "resolved")
|
|
38
|
+
return resolved;
|
|
39
|
+
base = resolved.base;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
const commit = await checkout.resolveCommit({ repoRoot, ref });
|
|
43
|
+
if (!commit.ok)
|
|
44
|
+
return { kind: "checkout-failed", failure: commit.failure };
|
|
45
|
+
if (commit.value === null)
|
|
46
|
+
return { kind: "ref-not-found", ref };
|
|
47
|
+
base = commit.value;
|
|
48
|
+
}
|
|
49
|
+
const steps = await snapshotStepsAt(checkout, { repoRoot, base, recipe });
|
|
50
|
+
if (!steps.ok)
|
|
51
|
+
return { kind: "invalid-recipe", path: steps.path, problem: steps.problem };
|
|
52
|
+
// An unreadable cache holds nothing to reuse: the build goes on, and builds.
|
|
53
|
+
const listed = await context.runnerSnapshots.listEntries();
|
|
54
|
+
const now = context.clock.now();
|
|
55
|
+
const cached = (listed.ok ? listed.value.entries : []).filter((entry) => entry.base === base &&
|
|
56
|
+
entry.recipeName === recipe.name &&
|
|
57
|
+
entry.region === recipe.region &&
|
|
58
|
+
entry.runtime === recipe.runtime &&
|
|
59
|
+
entry.snapshotKey === steps.key &&
|
|
60
|
+
hasTimeLeft(entry, now));
|
|
61
|
+
const atMergeBase = base === mergeBase?.commit;
|
|
62
|
+
// The built snapshot's count behind HEAD, for a build at the merge-base, the one snapshot a run here starts from.
|
|
63
|
+
let commitsAfterBase = null;
|
|
64
|
+
if (atMergeBase) {
|
|
65
|
+
const counted = await checkout.commitCount({ repoRoot, from: base, to: "HEAD" });
|
|
66
|
+
if (!counted.ok)
|
|
67
|
+
return { kind: "checkout-failed", failure: counted.failure };
|
|
68
|
+
commitsAfterBase = counted.value;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
kind: "ok",
|
|
72
|
+
build: {
|
|
73
|
+
plan: {
|
|
74
|
+
recipe,
|
|
75
|
+
repoRoot,
|
|
76
|
+
base,
|
|
77
|
+
toolchains: steps.toolchains,
|
|
78
|
+
prebuild: steps.prebuild,
|
|
79
|
+
snapshotKey: steps.key,
|
|
80
|
+
commitsAfterBase,
|
|
81
|
+
},
|
|
82
|
+
head: head.value,
|
|
83
|
+
ref: ref ?? null,
|
|
84
|
+
mergeBase,
|
|
85
|
+
atMergeBase,
|
|
86
|
+
cached,
|
|
87
|
+
full: request.full,
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Builds the checked build's base snapshot, reporting to `progress`, and closes every sandbox it started however it
|
|
93
|
+
* ends, keeping none. A cached base snapshot at the commit for the access's team and project is up to date, unless
|
|
94
|
+
* `full`, which builds a new one that replaces its cache entry. `signal` stops it in any stage: it says so, then
|
|
95
|
+
* closes the scope at once. A base snapshot's save isn't stopped by the signal, so after it the build checks the signal
|
|
96
|
+
* once and ends `aborted` with what it saved.
|
|
97
|
+
*/
|
|
98
|
+
export async function buildSnapshots(context, request, control, progress) {
|
|
99
|
+
const { signal } = control;
|
|
100
|
+
const scope = runnerSandboxScope(context, progress, { keepMs: 0 });
|
|
101
|
+
const stop = () => {
|
|
102
|
+
void progress.emit({ kind: "stopping", commandRunning: false, keepMs: 0 }).catch(() => undefined);
|
|
103
|
+
void scope.close().catch(() => undefined);
|
|
104
|
+
};
|
|
105
|
+
if (signal.aborted)
|
|
106
|
+
stop();
|
|
107
|
+
else
|
|
108
|
+
signal.addEventListener("abort", stop, { once: true });
|
|
109
|
+
try {
|
|
110
|
+
const ended = await buildIn(context, request, { scope, signal }, progress);
|
|
111
|
+
signal.removeEventListener("abort", stop);
|
|
112
|
+
return { ...ended, cleanup: await scope.close() };
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
signal.removeEventListener("abort", stop);
|
|
116
|
+
await scope.close();
|
|
117
|
+
throw error;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async function buildIn(context, request, control, progress) {
|
|
121
|
+
const { build, access, user, secrets } = request;
|
|
122
|
+
const { signal } = control;
|
|
123
|
+
if (signal.aborted)
|
|
124
|
+
return { kind: "aborted", snapshot: null };
|
|
125
|
+
const cached = build.cached.find((entry) => entry.teamId === access.teamId && entry.projectId === access.projectId);
|
|
126
|
+
if (!build.full && cached !== undefined)
|
|
127
|
+
return { kind: "up-to-date", snapshot: cached };
|
|
128
|
+
const why = build.full ? "full" : build.ref === null ? "no-snapshot" : "base";
|
|
129
|
+
const built = await buildSnapshot(context, {
|
|
130
|
+
prepared: build.plan,
|
|
131
|
+
access,
|
|
132
|
+
user,
|
|
133
|
+
secrets,
|
|
134
|
+
why: why === "no-snapshot" ? { kind: why, rejected: [] } : { kind: why },
|
|
135
|
+
}, control, progress);
|
|
136
|
+
if (built.kind === "aborted")
|
|
137
|
+
return { kind: "aborted", snapshot: null };
|
|
138
|
+
if (built.kind !== "ok")
|
|
139
|
+
return built;
|
|
140
|
+
const { entry, cacheFailure, ms, sizeBytes } = built.value;
|
|
141
|
+
if (signal.aborted)
|
|
142
|
+
return { kind: "aborted", snapshot: { entry, cached: cacheFailure === null } };
|
|
143
|
+
return cacheFailure === null
|
|
144
|
+
? { kind: "built", snapshot: entry, ms, sizeBytes }
|
|
145
|
+
: { kind: "not-cached", snapshot: entry, failure: cacheFailure };
|
|
146
|
+
}
|
package/dist/runner/context.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// What the runner
|
|
1
|
+
// What the runner reaches the world through as it readies and uses a runner sandbox, and the tags every sandbox it
|
|
2
|
+
// creates carries.
|
|
2
3
|
/** The `purpose` tag of a recipe's sandboxes. */
|
|
3
4
|
export function runnerPurpose(recipeName) {
|
|
4
5
|
return `storm-runner-${recipeName}`;
|