@cnc-tools/storm 0.11.0 → 0.12.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-3ZZVZPMG.js → chunk-43MWZLJR.js} +1 -1
- package/dist/chunks/chunk-4XT5RC5T.js +98 -0
- package/dist/chunks/chunk-7D6LC5JY.js +340 -0
- package/dist/chunks/{chunk-ETCZ6WP7.js → chunk-BW2ADH7U.js} +1 -1
- package/dist/chunks/chunk-FK4RLDEK.js +40 -0
- package/dist/chunks/{chunk-KR7WIYLG.js → chunk-FSP3SJ35.js} +209 -964
- package/dist/chunks/chunk-GQIL3AHY.js +20 -0
- package/dist/chunks/{chunk-ICB4BZJX.js → chunk-GSC6SRTW.js} +7 -2
- package/dist/chunks/{chunk-NPPJ57W7.js → chunk-ISGQJIQM.js} +498 -215
- 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-NMVODY3P.js +19 -0
- package/dist/chunks/{chunk-O4BUT7BE.js → chunk-ODQHQJLE.js} +3063 -2646
- package/dist/chunks/chunk-RYRJNHL7.js +55 -0
- package/dist/chunks/chunk-SXW6XN4R.js +161 -0
- package/dist/chunks/{chunk-L4ZPMSKQ.js → chunk-T6AZIDZD.js} +43 -363
- package/dist/chunks/chunk-TEEZL3GA.js +851 -0
- package/dist/chunks/{chunk-VZZTHCBW.js → chunk-TMQQYHUX.js} +5 -18
- package/dist/chunks/{chunk-TRFEAYNC.js → chunk-U7M3ZB3Z.js} +345 -304
- package/dist/chunks/{chunk-4EU4AH7E.js → chunk-Y3BUNNRG.js} +186 -144
- 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/{live-app-LOGYUBKB.js → live-app-AZ5N5HBD.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 +54 -15
- package/dist/commands/exec/command.js +51 -46
- package/dist/commands/exec/define-run-command.d.ts +752 -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 +58 -28
- package/dist/commands/exec/mint-failed.js +4 -4
- package/dist/commands/exec/outcomes.d.ts +70 -8
- package/dist/commands/exec/outcomes.js +37 -8
- package/dist/commands/exec/plan-run.js +3 -3
- package/dist/commands/exec/progress.d.ts +35 -15
- package/dist/commands/exec/progress.js +82 -57
- 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 +84 -24
- package/dist/commands/exec/run-command.js +84 -69
- package/dist/commands/exec/run-metadata.d.ts +29 -17
- package/dist/commands/exec/run-metadata.js +38 -16
- package/dist/commands/exec/snapshot-text.d.ts +40 -0
- package/dist/commands/exec/snapshot-text.js +112 -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 +22 -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 +746 -0
- package/dist/commands/playwright/command.js +31 -0
- package/dist/commands/playwright/metadata.js +8 -0
- package/dist/commands/runs/facts.d.ts +21 -8
- package/dist/commands/runs/facts.js +19 -9
- package/dist/commands/runs/list/command.d.ts +34 -8
- package/dist/commands/runs/list/command.js +15 -11
- package/dist/commands/runs/list/outcomes.d.ts +17 -4
- 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 +36 -8
- package/dist/commands/runs/show/command.js +48 -31
- package/dist/commands/runs/show/metadata.js +1 -1
- package/dist/commands/runs/show/outcomes.d.ts +18 -4
- package/dist/commands/runs/show/outcomes.js +35 -14
- package/dist/commands/snapshots/build/command.d.ts +898 -0
- package/dist/commands/snapshots/build/command.js +511 -0
- package/dist/commands/snapshots/build/metadata.d.ts +28 -0
- package/dist/commands/snapshots/build/metadata.js +34 -0
- package/dist/commands/snapshots/build/outcomes.d.ts +484 -0
- package/dist/commands/snapshots/build/outcomes.js +322 -0
- package/dist/commands/snapshots/list/command.d.ts +272 -0
- package/dist/commands/snapshots/list/command.js +305 -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 +183 -0
- package/dist/commands/snapshots/list/outcomes.js +257 -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 +267 -298
- 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 +2 -4
- 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 +27 -16
- package/dist/core/run-state.js +50 -18
- package/dist/core/run.d.ts +33 -27
- package/dist/core/run.js +24 -19
- 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 +3 -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 +5 -5
- 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 +69 -24
- package/dist/run-directory/run-record.js +39 -19
- 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 +179 -0
- package/dist/runner/build-snapshots.js +235 -0
- package/dist/runner/context.js +2 -1
- package/dist/runner/events.d.ts +71 -32
- package/dist/runner/gateways.d.ts +30 -10
- package/dist/runner/index.d.ts +8 -6
- package/dist/runner/index.js +5 -3
- package/dist/runner/live/checkout-gateway.js +15 -7
- package/dist/runner/live/snapshot-records.js +8 -7
- package/dist/runner/prepare.d.ts +24 -46
- package/dist/runner/prepare.js +27 -20
- package/dist/runner/ready.d.ts +43 -10
- package/dist/runner/ready.js +51 -34
- package/dist/runner/recipe.d.ts +42 -12
- package/dist/runner/recipe.js +36 -7
- package/dist/runner/scope.d.ts +5 -12
- package/dist/runner/scope.js +0 -4
- package/dist/runner/secrets.d.ts +6 -0
- package/dist/runner/secrets.js +10 -0
- package/dist/runner/session.d.ts +46 -18
- package/dist/runner/session.js +58 -29
- package/dist/runner/snapshot-build.d.ts +21 -11
- package/dist/runner/snapshot-build.js +11 -16
- package/dist/runner/snapshot-cache.d.ts +140 -62
- package/dist/runner/snapshot-cache.js +145 -102
- package/dist/runner/snapshot-inspect.d.ts +89 -0
- package/dist/runner/snapshot-inspect.js +173 -0
- package/dist/runner/snapshot-key.d.ts +5 -2
- package/dist/runner/snapshot-key.js +1 -1
- package/dist/runner/snapshot-save.d.ts +34 -20
- package/dist/runner/snapshot-save.js +46 -37
- package/dist/runner/snapshot-start.d.ts +25 -0
- package/dist/runner/snapshot-start.js +16 -0
- 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 +22 -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/sdk/extension/launcher-supplies.js +0 -3
- package/dist/story/align.d.ts +0 -37
- package/dist/story/align.js +0 -39
- package/dist/story/command-line.d.ts +0 -24
- package/dist/story/command-line.js +0 -88
- package/dist/story/definition.d.ts +0 -59
- package/dist/story/definition.js +0 -9
- package/dist/story/diff.d.ts +0 -9
- package/dist/story/diff.js +0 -97
- package/dist/story/errors.d.ts +0 -14
- package/dist/story/errors.js +0 -21
- package/dist/story/gateways.d.ts +0 -94
- package/dist/story/gateways.js +0 -3
- package/dist/story/host.d.ts +0 -30
- package/dist/story/host.js +0 -97
- package/dist/story/index.d.ts +0 -8
- package/dist/story/index.js +0 -11
- package/dist/story/json.d.ts +0 -16
- package/dist/story/json.js +0 -59
- package/dist/story/launch.d.ts +0 -70
- package/dist/story/launch.js +0 -77
- package/dist/story/live/recording-gateway.d.ts +0 -2
- package/dist/story/live/recording-gateway.js +0 -103
- package/dist/story/orphans.d.ts +0 -35
- package/dist/story/orphans.js +0 -51
- package/dist/story/recording.d.ts +0 -62
- package/dist/story/recording.js +0 -97
- package/dist/story/report.d.ts +0 -42
- package/dist/story/report.js +0 -129
- package/dist/story/sequence.d.ts +0 -30
- package/dist/story/sequence.js +0 -74
- package/dist/story/settle.d.ts +0 -96
- package/dist/story/settle.js +0 -71
- package/dist/story/start.d.ts +0 -50
- package/dist/story/start.js +0 -183
- package/dist/vendor/testserver-sdk/factories/definition.d.ts +0 -39
- package/dist/vendor/testserver-sdk/factories/definition.js +0 -16
- package/dist/vendor/testserver-sdk/factories/definitions.d.ts +0 -169
- package/dist/vendor/testserver-sdk/factories/definitions.js +0 -245
- package/dist/vendor/testserver-sdk/seed/index.d.ts +0 -1
- package/dist/vendor/testserver-sdk/seed/index.js +0 -3
- package/dist/vendor/testserver-sdk/seed/seed.d.ts +0 -221
- package/dist/vendor/testserver-sdk/seed/seed.js +0 -171
- package/dist/vitest/find-vitest.d.ts +0 -7
- package/dist/vitest/find-vitest.js +0 -28
- package/dist/vitest/gateways.js +0 -4
- package/dist/vitest/plan.d.ts +0 -51
- /package/dist/{extensions/story/commands/run → commands/playwright}/metadata.d.ts +0 -0
- /package/dist/{vitest → extensions/vitest/plan}/list-output.d.ts +0 -0
- /package/dist/{vitest → extensions/vitest/plan}/list-output.js +0 -0
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renderOutcome
|
|
3
|
+
} from "../../../chunks/chunk-T6AZIDZD.js";
|
|
4
|
+
import {
|
|
5
|
+
RUN_CLEANUP,
|
|
6
|
+
headText,
|
|
7
|
+
lineProgress,
|
|
8
|
+
notDeletedText,
|
|
9
|
+
notStoppedText,
|
|
10
|
+
prepareRefusal,
|
|
11
|
+
progressLine,
|
|
12
|
+
runErrors,
|
|
13
|
+
runSaveDefault,
|
|
14
|
+
runnerFailureFacts
|
|
15
|
+
} from "../../../chunks/chunk-U7M3ZB3Z.js";
|
|
16
|
+
import "../../../chunks/chunk-I5GZLOLQ.js";
|
|
17
|
+
import {
|
|
18
|
+
redactStrings,
|
|
19
|
+
redactor
|
|
20
|
+
} from "../../../chunks/chunk-FK4RLDEK.js";
|
|
21
|
+
import "../../../chunks/chunk-Y3BUNNRG.js";
|
|
22
|
+
import {
|
|
23
|
+
noSaveText
|
|
24
|
+
} from "../../../chunks/chunk-4XT5RC5T.js";
|
|
25
|
+
import {
|
|
26
|
+
RESOURCES
|
|
27
|
+
} from "../../../chunks/chunk-ISGQJIQM.js";
|
|
28
|
+
import "../../../chunks/chunk-IYM44FUX.js";
|
|
29
|
+
import "../../../chunks/chunk-LQKNI3EG.js";
|
|
30
|
+
import "../../../chunks/chunk-NMVODY3P.js";
|
|
31
|
+
import "../../../chunks/chunk-TEEZL3GA.js";
|
|
32
|
+
import {
|
|
33
|
+
seconds,
|
|
34
|
+
short
|
|
35
|
+
} from "../../../chunks/chunk-TMQQYHUX.js";
|
|
36
|
+
import {
|
|
37
|
+
megabytesText
|
|
38
|
+
} from "../../../chunks/chunk-FSP3SJ35.js";
|
|
39
|
+
import {
|
|
40
|
+
RUNNER_SECRET_MIN_LENGTH,
|
|
41
|
+
buildSnapshots,
|
|
42
|
+
configErrors,
|
|
43
|
+
credentialErrors,
|
|
44
|
+
credentialSourceErrors,
|
|
45
|
+
fileSettings,
|
|
46
|
+
loadSettingsFile,
|
|
47
|
+
prepareSnapshotBuild,
|
|
48
|
+
readRunnerSecrets,
|
|
49
|
+
recipeRun,
|
|
50
|
+
requireTarget
|
|
51
|
+
} from "../../../chunks/chunk-ODQHQJLE.js";
|
|
52
|
+
import "../../../chunks/chunk-YT5OROR7.js";
|
|
53
|
+
import "../../../chunks/chunk-BW2ADH7U.js";
|
|
54
|
+
import "../../../chunks/chunk-GQIL3AHY.js";
|
|
55
|
+
import "../../../chunks/chunk-GSC6SRTW.js";
|
|
56
|
+
import {
|
|
57
|
+
stormCommands
|
|
58
|
+
} from "../../../chunks/chunk-43MWZLJR.js";
|
|
59
|
+
import {
|
|
60
|
+
defineOutcomes
|
|
61
|
+
} from "../../../chunks/chunk-YM6TZV4L.js";
|
|
62
|
+
|
|
63
|
+
// src/commands/snapshots/build/command.ts
|
|
64
|
+
import { z as z2 } from "zod";
|
|
65
|
+
|
|
66
|
+
// src/commands/snapshots/build/outcomes.ts
|
|
67
|
+
import { z } from "zod";
|
|
68
|
+
var snapshotSchema = z.object({
|
|
69
|
+
snapshotId: z.string(),
|
|
70
|
+
/** A base snapshot, built from a base, or a dev snapshot, saved from a runner sandbox. */
|
|
71
|
+
kind: z.enum(["base", "dev"]),
|
|
72
|
+
/** Its base, a full SHA. */
|
|
73
|
+
base: z.string(),
|
|
74
|
+
/** The commit it was built at: a base snapshot's base, or the commit that saved a dev snapshot. */
|
|
75
|
+
builtAt: z.string(),
|
|
76
|
+
/** For a dev snapshot, the branch of the run that saved it; null for a base snapshot and a detached HEAD. */
|
|
77
|
+
branch: z.string().nullable(),
|
|
78
|
+
/** When it expires, as an ISO time. */
|
|
79
|
+
expiresAt: z.string()
|
|
80
|
+
});
|
|
81
|
+
var baseSnapshotSchema = snapshotSchema.extend({ cached: z.boolean() }).nullable();
|
|
82
|
+
function baseSnapshotOf(baseSnapshot) {
|
|
83
|
+
return baseSnapshot === null ? null : { ...snapshotOf(baseSnapshot.entry), cached: baseSnapshot.cached };
|
|
84
|
+
}
|
|
85
|
+
function builtRows(baseSnapshot, named) {
|
|
86
|
+
if (baseSnapshot === null || baseSnapshot.snapshotId === named?.snapshotId) return [];
|
|
87
|
+
return [["Built", `${snapshotText(baseSnapshot)}${baseSnapshot.cached ? "" : ", not in the cache"}`]];
|
|
88
|
+
}
|
|
89
|
+
function snapshotOf(entry) {
|
|
90
|
+
return {
|
|
91
|
+
snapshotId: entry.snapshotId,
|
|
92
|
+
kind: entry.head === void 0 ? "base" : "dev",
|
|
93
|
+
base: entry.base,
|
|
94
|
+
builtAt: entry.head ?? entry.base,
|
|
95
|
+
branch: entry.branch ?? null,
|
|
96
|
+
expiresAt: entry.expiresAt
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
var noDevSnapshotReasonSchema = z.enum(["not-trusted", "reuse-off", "base-only"]);
|
|
100
|
+
function baseChecksOf(warnings) {
|
|
101
|
+
return {
|
|
102
|
+
uncommitted: warnings === null ? null : warnings.some(({ kind }) => kind === "uncommitted"),
|
|
103
|
+
onBaseRef: warnings === null ? null : !warnings.some(({ kind }) => kind === "not-on-base-ref")
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
var whereFields = {
|
|
107
|
+
/** The config file that gave the runner recipe. */
|
|
108
|
+
configFile: z.string().nullable(),
|
|
109
|
+
recipe: z.string(),
|
|
110
|
+
/** The team and project the credential was minted for: the sandboxes ran there, and the snapshots are theirs. */
|
|
111
|
+
team: z.string(),
|
|
112
|
+
project: z.string(),
|
|
113
|
+
/** HEAD's commit, a full SHA. */
|
|
114
|
+
head: z.string(),
|
|
115
|
+
/** What it built at: HEAD's merge-base with `baseRef`, or with --base the commit the ref names, a full SHA. */
|
|
116
|
+
base: z.string(),
|
|
117
|
+
baseRef: z.string(),
|
|
118
|
+
/** Why it saved no dev snapshot; null when it saved one, or the checkout's dev snapshot is up to date. */
|
|
119
|
+
noDevSnapshotReason: noDevSnapshotReasonSchema.nullable(),
|
|
120
|
+
/** With --base, whether the working tree had uncommitted changes, which a base snapshot doesn't hold; else null. */
|
|
121
|
+
uncommitted: z.boolean().nullable(),
|
|
122
|
+
/**
|
|
123
|
+
* With --base, whether one of the recipe's baseRefs holds the commit in its history; else null. When none does, a
|
|
124
|
+
* rewrite of the commit makes the snapshot unusable.
|
|
125
|
+
*/
|
|
126
|
+
onBaseRef: z.boolean().nullable()
|
|
127
|
+
};
|
|
128
|
+
var savedAgainstRunDefaultSchema = z.enum(["recipe", "ci"]);
|
|
129
|
+
var droppedSchema = z.object({ snapshotIds: z.array(z.string()), failures: z.array(z.string()) });
|
|
130
|
+
var builtSchema = z.object({
|
|
131
|
+
...whereFields,
|
|
132
|
+
/** The base snapshot it built, and whether the cache holds it; null when it built none. */
|
|
133
|
+
baseSnapshot: baseSnapshotSchema,
|
|
134
|
+
/** The snapshot the runner sandbox started from; null when it started none. */
|
|
135
|
+
startedFrom: snapshotSchema.nullable(),
|
|
136
|
+
/** The dev snapshot it saved at HEAD's commit, how long the save took and its size; null when it saved none. */
|
|
137
|
+
devSnapshot: snapshotSchema.extend({ ms: z.number(), sizeBytes: z.number() }).nullable(),
|
|
138
|
+
/** What --full dropped from the cache: the dev snapshots built on the base snapshot it replaced, and what failed. */
|
|
139
|
+
dropped: droppedSchema,
|
|
140
|
+
/**
|
|
141
|
+
* Why a run here that gives no flag would save no dev snapshot, when this build saved one: the recipe sets
|
|
142
|
+
* `saveDevSnapshot: false` (`recipe`), or `CI` is set (`ci`), each a run's `noSaveReason`. Both are defaults for
|
|
143
|
+
* runs, and this command is not a run. Null when it saved none, or when such a run would save one too.
|
|
144
|
+
*/
|
|
145
|
+
savedAgainstRunDefault: savedAgainstRunDefaultSchema.nullable(),
|
|
146
|
+
/** What the build couldn't clean up. */
|
|
147
|
+
cleanup: RUN_CLEANUP.schema
|
|
148
|
+
});
|
|
149
|
+
var upToDateSchema = z.object({
|
|
150
|
+
...whereFields,
|
|
151
|
+
/** The snapshot the next run here starts from, or with --base the base snapshot the cache holds at that commit. */
|
|
152
|
+
snapshot: snapshotSchema
|
|
153
|
+
});
|
|
154
|
+
var NO_DEV_SNAPSHOT_TEXT = {
|
|
155
|
+
"not-trusted": "the runner recipe doesn't trust dev snapshots (trustDevSnapshots)",
|
|
156
|
+
"reuse-off": "the runner recipe reuses no dev snapshot (reuseDevSnapshot: false)",
|
|
157
|
+
"base-only": "--base builds only a base snapshot"
|
|
158
|
+
};
|
|
159
|
+
function noDevSnapshotFact(devSnapshots) {
|
|
160
|
+
if (devSnapshots === null) return "base-only";
|
|
161
|
+
return devSnapshots === "reuse" ? null : devSnapshots;
|
|
162
|
+
}
|
|
163
|
+
function snapshotText({ kind, snapshotId, builtAt }) {
|
|
164
|
+
return `${kind} snapshot ${snapshotId} at ${short(builtAt)}`;
|
|
165
|
+
}
|
|
166
|
+
function droppedOf(dropped) {
|
|
167
|
+
return dropped === null ? null : { snapshotIds: [...dropped.snapshotIds], failures: dropped.failures.map(({ message }) => message) };
|
|
168
|
+
}
|
|
169
|
+
function droppedRows(full, dropped) {
|
|
170
|
+
if (dropped === null)
|
|
171
|
+
return full ? [
|
|
172
|
+
[
|
|
173
|
+
"Dropped",
|
|
174
|
+
"nothing: the new base snapshot isn't cached, so the one it replaces and its dev snapshots stay usable"
|
|
175
|
+
]
|
|
176
|
+
] : [];
|
|
177
|
+
return [
|
|
178
|
+
...dropped.snapshotIds.length === 0 ? [] : [["Dropped", dropped.snapshotIds.join(", ")]],
|
|
179
|
+
...dropped.failures.length === 0 ? [] : [["Not dropped", dropped.failures]]
|
|
180
|
+
];
|
|
181
|
+
}
|
|
182
|
+
function warningsOf(facts) {
|
|
183
|
+
return [
|
|
184
|
+
...facts.uncommitted === true ? [
|
|
185
|
+
{
|
|
186
|
+
reason: "uncommitted_changes_not_included",
|
|
187
|
+
message: "The working tree has uncommitted changes: a base snapshot holds only the commit's tracked files."
|
|
188
|
+
}
|
|
189
|
+
] : [],
|
|
190
|
+
...facts.onBaseRef === false ? [
|
|
191
|
+
{
|
|
192
|
+
reason: "commit_not_on_base_ref",
|
|
193
|
+
message: `${facts.baseRef}'s commit is in the history of none of the runner recipe's baseRefs: a rewrite of it makes the snapshot unusable.`
|
|
194
|
+
}
|
|
195
|
+
] : []
|
|
196
|
+
];
|
|
197
|
+
}
|
|
198
|
+
var outcomes = defineOutcomes({
|
|
199
|
+
results: {
|
|
200
|
+
built: {
|
|
201
|
+
schema: builtSchema,
|
|
202
|
+
description: "It built what the cache lacked: a base snapshot, a dev snapshot at HEAD's commit, or both; with --base, a base snapshot at that commit. savedAgainstRunDefault says when it saved a dev snapshot that a run here with no flag would not save, because the recipe sets saveDevSnapshot: false or CI is set.",
|
|
203
|
+
render: (built) => {
|
|
204
|
+
const next = built.devSnapshot ?? built.baseSnapshot;
|
|
205
|
+
const rows = [
|
|
206
|
+
["Recipe", built.recipe],
|
|
207
|
+
...builtRows(built.baseSnapshot, next),
|
|
208
|
+
...built.startedFrom === null || built.startedFrom.snapshotId === built.baseSnapshot?.snapshotId ? [] : [["Started from", snapshotText(built.startedFrom)]],
|
|
209
|
+
...built.devSnapshot === null ? [] : [
|
|
210
|
+
[
|
|
211
|
+
"Saved",
|
|
212
|
+
`${snapshotText(built.devSnapshot)} in ${seconds(built.devSnapshot.ms)} (${megabytesText(built.devSnapshot.sizeBytes)})`
|
|
213
|
+
]
|
|
214
|
+
],
|
|
215
|
+
...built.dropped.snapshotIds.length === 0 ? [] : [["Dropped", built.dropped.snapshotIds.join(", ")]],
|
|
216
|
+
...RUN_CLEANUP.rows(built.cleanup)
|
|
217
|
+
];
|
|
218
|
+
const message = built.noDevSnapshotReason === "base-only" || next === null ? `Built ${next === null ? "nothing" : snapshotText(next)}.` : `The next run here starts from ${snapshotText(next)}.${built.noDevSnapshotReason === null ? "" : ` It saved no dev snapshot: ${NO_DEV_SNAPSHOT_TEXT[built.noDevSnapshotReason]}.`}${built.savedAgainstRunDefault === null ? "" : ` It saved a dev snapshot although ${noSaveText(built.savedAgainstRunDefault)}: that is a default for runs, and this command is not a run.`}`;
|
|
219
|
+
const warnings = [
|
|
220
|
+
...warningsOf(built),
|
|
221
|
+
...built.dropped.failures.map((failure) => ({
|
|
222
|
+
reason: "dev_snapshot_not_dropped",
|
|
223
|
+
message: `Couldn't drop a dev snapshot built on the replaced base snapshot from the cache: ${failure}. A later run may start from it.`
|
|
224
|
+
}))
|
|
225
|
+
];
|
|
226
|
+
return renderOutcome({ rows, message, ...warnings.length === 0 ? {} : { warnings } });
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
upToDate: {
|
|
230
|
+
schema: upToDateSchema,
|
|
231
|
+
description: "Nothing to build, so nothing started: the next run here starts from a dev snapshot built at HEAD's commit with a clean working tree, or, for a recipe that saves no dev snapshot, from a base snapshot that fits; with --base, the cache holds a base snapshot at that commit.",
|
|
232
|
+
render: (facts) => {
|
|
233
|
+
const { snapshot } = facts;
|
|
234
|
+
const message = facts.noDevSnapshotReason === "base-only" ? `The cache holds ${snapshotText(snapshot)} for this team and project. --full builds a new one.` : `Up to date: the next run here starts from ${snapshotText(snapshot)}.${facts.noDevSnapshotReason === null ? "" : ` It saves no dev snapshot: ${NO_DEV_SNAPSHOT_TEXT[facts.noDevSnapshotReason]}.`}`;
|
|
235
|
+
const warnings = warningsOf(facts);
|
|
236
|
+
return renderOutcome({
|
|
237
|
+
rows: [["Recipe", facts.recipe]],
|
|
238
|
+
message,
|
|
239
|
+
...warnings.length === 0 ? {} : { warnings }
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
errors: {
|
|
245
|
+
invalidConfig: configErrors.invalidConfig,
|
|
246
|
+
missingRunner: runErrors.missingRunner,
|
|
247
|
+
missingTarget: credentialErrors.missingTarget,
|
|
248
|
+
runnerSecretsInvalid: runErrors.runnerSecretsInvalid,
|
|
249
|
+
noBaseRef: runErrors.noBaseRef,
|
|
250
|
+
submodulesRefused: runErrors.submodulesRefused,
|
|
251
|
+
mintFailed: credentialSourceErrors.mintFailed,
|
|
252
|
+
tokenRequestFailed: credentialSourceErrors.tokenRequestFailed,
|
|
253
|
+
runnerFailed: runErrors.runnerFailed,
|
|
254
|
+
snapshotGone: runErrors.snapshotGone,
|
|
255
|
+
refNotFound: {
|
|
256
|
+
exitCode: 1,
|
|
257
|
+
description: "--base names no commit in this clone: storm resolves it from local refs only, and never fetches.",
|
|
258
|
+
schema: z.object({
|
|
259
|
+
/** The ref as given. */
|
|
260
|
+
ref: z.string()
|
|
261
|
+
}),
|
|
262
|
+
render: ({ ref }) => ({
|
|
263
|
+
message: `--base ${ref} names no commit in this clone. storm reads local refs only, and never fetches.`,
|
|
264
|
+
next: [{ type: "text", text: `Fetch the ref, such as git fetch origin, then run again.` }]
|
|
265
|
+
})
|
|
266
|
+
},
|
|
267
|
+
devSnapshotNotSaved: {
|
|
268
|
+
exitCode: 1,
|
|
269
|
+
description: "It readied a runner sandbox for this checkout but couldn't save it as a dev snapshot: the scrub or the save failed. baseSnapshot names the base snapshot it built first, if any, and whether the cache holds it.",
|
|
270
|
+
schema: z.object({
|
|
271
|
+
/** What failed, the scrub or the save, with what it said. */
|
|
272
|
+
step: z.enum(["scrub", "save-snapshot"]),
|
|
273
|
+
message: z.string(),
|
|
274
|
+
/** The base snapshot it built first, and whether the cache holds it; null when it built none. */
|
|
275
|
+
baseSnapshot: baseSnapshotSchema,
|
|
276
|
+
cleanup: RUN_CLEANUP.schema
|
|
277
|
+
}),
|
|
278
|
+
render: ({
|
|
279
|
+
step,
|
|
280
|
+
message,
|
|
281
|
+
baseSnapshot,
|
|
282
|
+
cleanup
|
|
283
|
+
}) => {
|
|
284
|
+
const rows = [...builtRows(baseSnapshot, null), ...RUN_CLEANUP.rows(cleanup)];
|
|
285
|
+
return {
|
|
286
|
+
message: `Couldn't save the dev snapshot: the ${step === "scrub" ? "scrub" : "save"} failed: ${message}`,
|
|
287
|
+
...rows.length === 0 ? {} : { rows },
|
|
288
|
+
next: [{ type: "text", text: "Run storm snapshots build again." }]
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
snapshotNotCached: {
|
|
293
|
+
exitCode: 1,
|
|
294
|
+
description: "It saved the snapshot the build ends with, the dev snapshot or, with --base or a recipe that saves no dev snapshot, the base snapshot, but couldn't write its cache entry, so no run finds it.",
|
|
295
|
+
schema: z.object({
|
|
296
|
+
/** The snapshot it saved, whose cache entry it couldn't write. */
|
|
297
|
+
snapshot: snapshotSchema,
|
|
298
|
+
/** The cache file the write failed on. */
|
|
299
|
+
path: z.string(),
|
|
300
|
+
/** What the operating system said. */
|
|
301
|
+
message: z.string(),
|
|
302
|
+
/**
|
|
303
|
+
* The base snapshot it built, and whether the cache holds it; null when it built none. With --base or a recipe
|
|
304
|
+
* that saves no dev snapshot, it is `snapshot`, not cached.
|
|
305
|
+
*/
|
|
306
|
+
baseSnapshot: baseSnapshotSchema,
|
|
307
|
+
/** Whether --full was given: build without the cache, and drop the dev snapshots on the base snapshot it replaces. */
|
|
308
|
+
full: z.boolean(),
|
|
309
|
+
/**
|
|
310
|
+
* What --full dropped from the cache: the dev snapshots built on the base snapshot it replaced, and what failed;
|
|
311
|
+
* null when it dropped nothing: without --full, or when the new base snapshot isn't cached, so the one it
|
|
312
|
+
* replaces and its dev snapshots stay usable.
|
|
313
|
+
*/
|
|
314
|
+
dropped: droppedSchema.nullable(),
|
|
315
|
+
cleanup: RUN_CLEANUP.schema
|
|
316
|
+
}),
|
|
317
|
+
render: (facts) => ({
|
|
318
|
+
message: `Saved ${snapshotText(facts.snapshot)}, but couldn't write its cache entry: ${facts.message}`,
|
|
319
|
+
rows: [
|
|
320
|
+
["Path", facts.path],
|
|
321
|
+
...builtRows(facts.baseSnapshot, facts.snapshot),
|
|
322
|
+
...droppedRows(facts.full, facts.dropped),
|
|
323
|
+
...RUN_CLEANUP.rows(facts.cleanup)
|
|
324
|
+
],
|
|
325
|
+
next: [
|
|
326
|
+
{
|
|
327
|
+
type: "text",
|
|
328
|
+
text: `Run storm snapshots build again once storm can write ${facts.path}.`
|
|
329
|
+
}
|
|
330
|
+
]
|
|
331
|
+
})
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
// src/commands/snapshots/build/command.ts
|
|
337
|
+
var command_default = stormCommands.define({
|
|
338
|
+
requestSchema: z2.object({
|
|
339
|
+
full: z2.boolean().default(false),
|
|
340
|
+
base: z2.string().min(1).optional(),
|
|
341
|
+
scope: z2.string().min(1).optional(),
|
|
342
|
+
project: z2.string().min(1).optional()
|
|
343
|
+
}),
|
|
344
|
+
cli: { options: { project: { short: "p" } } },
|
|
345
|
+
response: outcomes,
|
|
346
|
+
handler: async ({ app, ui, signal }, request) => {
|
|
347
|
+
const file = await loadSettingsFile(app.context.config, app.cwd, RESOURCES);
|
|
348
|
+
if (!file.ok) return file.refusal;
|
|
349
|
+
const configFile = file.path;
|
|
350
|
+
const settings = fileSettings(file, request);
|
|
351
|
+
if (settings.runner === void 0) return runErrors.missingRunner({ configFile });
|
|
352
|
+
const recipe = settings.runner.value;
|
|
353
|
+
const required = requireTarget(settings.scope, settings.project);
|
|
354
|
+
if (!required.ok) return required.refusal;
|
|
355
|
+
const { target } = required;
|
|
356
|
+
const chosen = app.credentials.source(
|
|
357
|
+
"mint",
|
|
358
|
+
{ scope: settings.scope, project: settings.project },
|
|
359
|
+
{ progress: ui.progress }
|
|
360
|
+
);
|
|
361
|
+
if (!chosen.ok) return chosen.refusal;
|
|
362
|
+
const secrets = readRunnerSecrets(recipe, app.env);
|
|
363
|
+
if (!secrets.ok)
|
|
364
|
+
return runErrors.runnerSecretsInvalid({
|
|
365
|
+
variables: secrets.variables.map(({ name, problem }) => ({ name, problem })),
|
|
366
|
+
minLength: RUNNER_SECRET_MIN_LENGTH,
|
|
367
|
+
configFile
|
|
368
|
+
});
|
|
369
|
+
const redact = redactor(Object.values(secrets.values));
|
|
370
|
+
const mode = request.base === void 0 ? { kind: "checkout", full: request.full } : { kind: "base", ref: request.base, full: request.full };
|
|
371
|
+
const prepared = await prepareSnapshotBuild(app.context, {
|
|
372
|
+
cwd: app.cwd,
|
|
373
|
+
recipe,
|
|
374
|
+
vcpusRun: recipeRun({}),
|
|
375
|
+
mode
|
|
376
|
+
});
|
|
377
|
+
if (prepared.kind === "ref-not-found") return outcomes.refNotFound({ ref: prepared.ref });
|
|
378
|
+
if (prepared.kind !== "ok") return redactStrings(prepareRefusal(prepared, configFile), redact);
|
|
379
|
+
const { build } = prepared;
|
|
380
|
+
const progress = buildProgress(app, ui.progress, (line) => redactStrings(line, redact));
|
|
381
|
+
if (build.kind === "checkout") await progress.prepared(build.prepared);
|
|
382
|
+
if (signal.aborted) return outcomes.canceled({ changed: "Nothing was built.\nNothing was minted or started." });
|
|
383
|
+
const got = await chosen.source.obtain();
|
|
384
|
+
if (!got.ok) return got.refusal;
|
|
385
|
+
const owner = got.credential.vercelProject();
|
|
386
|
+
if (owner === void 0)
|
|
387
|
+
return runErrors.runnerFailed({
|
|
388
|
+
failure: runnerFailureFacts({ kind: "credential-claims-missing", target }),
|
|
389
|
+
cleanup: RUN_CLEANUP.facts({ runnerCleanup: null, resourceCleanup: {} })
|
|
390
|
+
});
|
|
391
|
+
const ended = await buildSnapshots(
|
|
392
|
+
app.context,
|
|
393
|
+
{ build, access: { credential: got.credential, ...owner }, user: app.user, secrets: secrets.values },
|
|
394
|
+
{ signal },
|
|
395
|
+
progress
|
|
396
|
+
);
|
|
397
|
+
const outcome = redactStrings(ended, redact);
|
|
398
|
+
const cleanup = RUN_CLEANUP.facts({ runnerCleanup: { ...outcome.cleanup, target }, resourceCleanup: {} });
|
|
399
|
+
const head = build.kind === "checkout" ? build.prepared.head.commit : build.head.commit;
|
|
400
|
+
const where = {
|
|
401
|
+
configFile,
|
|
402
|
+
recipe: recipe.name,
|
|
403
|
+
team: target.team,
|
|
404
|
+
project: target.project,
|
|
405
|
+
head,
|
|
406
|
+
base: build.kind === "checkout" ? build.prepared.base : build.plan.base,
|
|
407
|
+
baseRef: build.kind === "checkout" ? build.prepared.baseRef : build.ref,
|
|
408
|
+
noDevSnapshotReason: noDevSnapshotFact(build.kind === "checkout" ? build.prepared.devSnapshots : null),
|
|
409
|
+
...baseChecksOf(build.kind === "base" ? build.warnings : null)
|
|
410
|
+
};
|
|
411
|
+
switch (outcome.kind) {
|
|
412
|
+
case "up-to-date":
|
|
413
|
+
return outcomes.upToDate({ ...where, snapshot: snapshotOf(outcome.snapshot) });
|
|
414
|
+
case "built": {
|
|
415
|
+
const { devSnapshot } = outcome;
|
|
416
|
+
const runDefault = runSaveDefault(recipe, app.env);
|
|
417
|
+
const savedAgainstRunDefault = devSnapshot !== null && runDefault.kind === "never" && (runDefault.reason === "recipe" || runDefault.reason === "ci") ? runDefault.reason : null;
|
|
418
|
+
return outcomes.built({
|
|
419
|
+
...where,
|
|
420
|
+
baseSnapshot: baseSnapshotOf(outcome.baseSnapshot),
|
|
421
|
+
startedFrom: outcome.startedFrom === null ? null : snapshotOf(outcome.startedFrom),
|
|
422
|
+
devSnapshot: devSnapshot === null ? null : { ...snapshotOf(devSnapshot.entry), ms: devSnapshot.ms, sizeBytes: devSnapshot.sizeBytes },
|
|
423
|
+
dropped: droppedOf(outcome.dropped) ?? { snapshotIds: [], failures: [] },
|
|
424
|
+
savedAgainstRunDefault,
|
|
425
|
+
cleanup
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
case "dev-snapshot-not-saved":
|
|
429
|
+
return outcomes.devSnapshotNotSaved({
|
|
430
|
+
step: outcome.step,
|
|
431
|
+
message: outcome.message,
|
|
432
|
+
baseSnapshot: baseSnapshotOf(outcome.baseSnapshot),
|
|
433
|
+
cleanup
|
|
434
|
+
});
|
|
435
|
+
case "not-cached":
|
|
436
|
+
return outcomes.snapshotNotCached({
|
|
437
|
+
snapshot: snapshotOf(outcome.snapshot),
|
|
438
|
+
path: outcome.failure.path,
|
|
439
|
+
message: outcome.failure.message,
|
|
440
|
+
baseSnapshot: baseSnapshotOf(outcome.baseSnapshot),
|
|
441
|
+
full: build.full,
|
|
442
|
+
dropped: droppedOf(outcome.dropped),
|
|
443
|
+
cleanup
|
|
444
|
+
});
|
|
445
|
+
case "snapshot-gone":
|
|
446
|
+
return runErrors.snapshotGone({
|
|
447
|
+
snapshotId: outcome.entry.snapshotId,
|
|
448
|
+
base: outcome.entry.base,
|
|
449
|
+
removal: outcome.removal === void 0 ? null : { ...outcome.removal },
|
|
450
|
+
cleanup
|
|
451
|
+
});
|
|
452
|
+
case "failed":
|
|
453
|
+
return runErrors.runnerFailed({ failure: runnerFailureFacts(outcome.failure), cleanup });
|
|
454
|
+
case "aborted":
|
|
455
|
+
return outcomes.canceled({ changed: abortedChanges(outcome, cleanup.runner) });
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
function abortedChanges(outcome, runner) {
|
|
460
|
+
const { baseSnapshot, dropped } = outcome;
|
|
461
|
+
const problems = runner === null ? [] : [...runner.notStopped.map(notStoppedText), ...runner.notDeleted.map(notDeletedText)];
|
|
462
|
+
return [
|
|
463
|
+
"The build stopped.",
|
|
464
|
+
...baseSnapshot === null ? [] : [
|
|
465
|
+
baseSnapshot.cached ? `It saved and cached ${snapshotText(snapshotOf(baseSnapshot.entry))} first.` : `It saved ${snapshotText(snapshotOf(baseSnapshot.entry))} first, but couldn't write its cache entry, so no run finds it.`
|
|
466
|
+
],
|
|
467
|
+
...dropped === null || dropped.snapshotIds.length === 0 ? [] : [`It dropped the dev snapshots built on the base snapshot it replaced: ${dropped.snapshotIds.join(", ")}.`],
|
|
468
|
+
...(dropped?.failures ?? []).map(
|
|
469
|
+
({ message }) => `Couldn't drop a dev snapshot built on the replaced base snapshot from the cache: ${message}. A later run may start from it.`
|
|
470
|
+
),
|
|
471
|
+
...problems.length === 0 ? ["Every sandbox it started is stopped and deleted."] : problems
|
|
472
|
+
].join("\n");
|
|
473
|
+
}
|
|
474
|
+
function buildProgress(app, progress, redact) {
|
|
475
|
+
if (progress === void 0) return { emit: async () => {
|
|
476
|
+
}, prepared: async () => {
|
|
477
|
+
} };
|
|
478
|
+
const write = (line) => progress(redact(line));
|
|
479
|
+
const observer = lineProgress(write, { github: app.presentation.github === true });
|
|
480
|
+
let origin;
|
|
481
|
+
const observe = async (event) => {
|
|
482
|
+
const at = app.context.clock.now();
|
|
483
|
+
origin ??= at.getTime();
|
|
484
|
+
await observer.observe({ event, at });
|
|
485
|
+
};
|
|
486
|
+
return {
|
|
487
|
+
prepared: async (prepared) => {
|
|
488
|
+
await observe({
|
|
489
|
+
kind: "runner-prepared",
|
|
490
|
+
base: prepared.base,
|
|
491
|
+
baseRef: prepared.baseRef,
|
|
492
|
+
nestedRepositories: prepared.upload.nestedRepositories,
|
|
493
|
+
notes: prepared.notes
|
|
494
|
+
});
|
|
495
|
+
},
|
|
496
|
+
emit: async (event) => {
|
|
497
|
+
if (event.kind === "dev-snapshot-saving") {
|
|
498
|
+
const at = app.context.clock.now();
|
|
499
|
+
origin ??= at.getTime();
|
|
500
|
+
await write(
|
|
501
|
+
progressLine(at.getTime() - origin, "cleanup", `saving a dev snapshot of ${headText(event.branch)}\u2026`)
|
|
502
|
+
);
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
await observe({ kind: "runner", event });
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
export {
|
|
510
|
+
command_default as default
|
|
511
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const metadata: {
|
|
2
|
+
description: string;
|
|
3
|
+
summary: string;
|
|
4
|
+
help: {
|
|
5
|
+
usages: string[];
|
|
6
|
+
fields: {
|
|
7
|
+
full: {
|
|
8
|
+
description: string;
|
|
9
|
+
};
|
|
10
|
+
base: {
|
|
11
|
+
valueLabel: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
scope: {
|
|
15
|
+
valueLabel: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
project: {
|
|
19
|
+
valueLabel: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
examples: {
|
|
24
|
+
argv: string;
|
|
25
|
+
description: string;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// src/commands/snapshots/build/metadata.ts
|
|
2
|
+
var metadata = {
|
|
3
|
+
description: "Build what the runner snapshot cache on this machine lacks for this checkout, with no test run: it acquires no resource, runs no command, and writes no run directory. It mints a credential as a run does, and prints the runner's progress lines and step output as a run does when stderr isn't a terminal. With no flag it prepares the next run: it picks a runner snapshot as a run does and builds a base snapshot at the merge-base when none fits; a dev snapshot built at HEAD's commit, with a clean working tree, is up to date and starts nothing; otherwise it starts a runner sandbox from the pick, uploads and applies this checkout's changes, runs the recipe's install and build, and saves the sandbox as a dev snapshot at HEAD's commit. This command is not a run, so no run default applies to it: the recipe's saveDevSnapshot, CI, and the keep time do not change what it saves. When it saves a dev snapshot although a run here saves none by default, it says so. Two recipe keys do change what it saves, because no run would start from its dev snapshot: a recipe whose install or build step names a runner secret and that doesn't set trustDevSnapshots, or that sets reuseDevSnapshot: false, gets no dev snapshot, only a base snapshot when none fits. Every sandbox it starts is stopped and deleted, however it ends.",
|
|
4
|
+
summary: "Build the runner snapshots this checkout lacks.",
|
|
5
|
+
help: {
|
|
6
|
+
usages: ["[--full] [--base <REF>] [--scope <TEAM> --project <PROJECT>]"],
|
|
7
|
+
fields: {
|
|
8
|
+
full: {
|
|
9
|
+
description: "Use nothing from the cache: build a new base snapshot at the merge-base, or at --base's commit, which replaces the cache entry of a base snapshot there, then, without --base, the working tree on top. It removes the cache entries of every dev snapshot built on the base snapshot it replaced, from any checkout, and says which; the snapshots are left to expire."
|
|
10
|
+
},
|
|
11
|
+
base: {
|
|
12
|
+
valueLabel: "REF",
|
|
13
|
+
description: "Build only a base snapshot, at the commit this ref names, resolved from local refs (storm never fetches), and no dev snapshot. When the cache holds one there for the team and project with more than an hour left, it starts nothing, unless --full. The commit need not be in HEAD's history; it warns when the working tree has uncommitted changes, which a base snapshot doesn't hold, and when the commit is in the history of none of the recipe's baseRefs, since a rewrite of it makes the snapshot unusable."
|
|
14
|
+
},
|
|
15
|
+
scope: {
|
|
16
|
+
valueLabel: "TEAM",
|
|
17
|
+
description: "The Vercel team whose project the credential is minted for and the sandboxes run in. Required, from this flag or scope in storm.config.ts."
|
|
18
|
+
},
|
|
19
|
+
project: {
|
|
20
|
+
valueLabel: "PROJECT",
|
|
21
|
+
description: "The Vercel project, within the team, to mint the credential for. Required, from this flag or project in storm.config.ts."
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
examples: [
|
|
25
|
+
{ argv: "", description: "Build what the next run here starts from, and save a dev snapshot at HEAD." },
|
|
26
|
+
{ argv: "--full", description: "Build a fresh base snapshot at the merge-base, and a dev snapshot on top." },
|
|
27
|
+
{ argv: "--base origin/main", description: "Build only a base snapshot at origin/main's commit." },
|
|
28
|
+
{ argv: "--json", description: "Build, then print what was built as JSON." }
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
metadata
|
|
34
|
+
};
|