@cnc-tools/storm 0.10.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 +12 -9
- package/dist/build-info.js +1 -1
- package/dist/chunks/{chunk-YF3ICDBY.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-WF4KJ7YG.js → chunk-BW2ADH7U.js} +1 -1
- package/dist/chunks/chunk-FK4RLDEK.js +40 -0
- package/dist/chunks/chunk-FSP3SJ35.js +1429 -0
- package/dist/chunks/{chunk-J6ZNYUDV.js → chunk-GQIL3AHY.js} +2 -3
- package/dist/chunks/chunk-GSC6SRTW.js +27 -0
- package/dist/chunks/chunk-ISGQJIQM.js +852 -0
- package/dist/chunks/chunk-IYM44FUX.js +1461 -0
- package/dist/chunks/{chunk-XHJGHJBW.js → chunk-LQKNI3EG.js} +38 -279
- package/dist/chunks/chunk-NMVODY3P.js +19 -0
- package/dist/chunks/{chunk-VJQLMGOH.js → chunk-ODQHQJLE.js} +2761 -3699
- package/dist/chunks/chunk-RYRJNHL7.js +55 -0
- package/dist/chunks/chunk-SXW6XN4R.js +161 -0
- package/dist/chunks/{chunk-OVXD7GES.js → chunk-T6AZIDZD.js} +43 -396
- package/dist/chunks/chunk-TEEZL3GA.js +851 -0
- package/dist/chunks/chunk-TMQQYHUX.js +80 -0
- package/dist/chunks/{chunk-AKKNF3WZ.js → chunk-U7M3ZB3Z.js} +565 -595
- package/dist/chunks/{chunk-JQ2HK4RN.js → chunk-Y3BUNNRG.js} +234 -57
- package/dist/chunks/{chunk-ZJ2USLAT.js → chunk-YM6TZV4L.js} +394 -416
- package/dist/chunks/chunk-YT5OROR7.js +271 -0
- package/dist/chunks/{live-app-RIJM3QFD.js → live-app-AZ5N5HBD.js} +36 -12
- package/dist/command-tree.d.ts +4 -1
- package/dist/command-tree.js +4 -1
- package/dist/commands/exec/cleanup.d.ts +3 -3
- package/dist/commands/exec/cleanup.js +6 -2
- package/dist/commands/exec/command.d.ts +56 -17
- package/dist/commands/exec/command.js +51 -39
- 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/job-summary.d.ts +1 -1
- package/dist/commands/exec/job-summary.js +1 -1
- package/dist/commands/exec/live-view.js +58 -28
- package/dist/commands/exec/mint-failed.js +5 -5
- package/dist/commands/exec/outcomes.d.ts +72 -10
- package/dist/commands/exec/outcomes.js +38 -10
- package/dist/commands/exec/plan-run.d.ts +3 -5
- 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 +2 -2
- package/dist/commands/exec/resource-refusals.js +10 -10
- 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 +85 -20
- package/dist/commands/exec/run-command.js +142 -238
- 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 +3 -37
- package/dist/commands/exec/test-plan.js +11 -28
- 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.d.ts +3 -1
- package/dist/commands/exec/waterfall.js +20 -3
- 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.d.ts +4 -0
- package/dist/commands/playwright/metadata.js +8 -0
- package/dist/commands/runs/facts.d.ts +22 -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 +18 -13
- package/dist/commands/runs/list/outcomes.d.ts +17 -4
- package/dist/commands/runs/logs/command.js +20 -14
- package/dist/commands/runs/logs/outcomes.js +1 -1
- package/dist/commands/runs/past-run.d.ts +3 -27
- package/dist/commands/runs/past-run.js +3 -37
- package/dist/commands/runs/show/command.d.ts +36 -8
- package/dist/commands/runs/show/command.js +53 -33
- 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 +37 -16
- 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 -174
- package/dist/commands/vitest/metadata.js +1 -1
- package/dist/config/credential-resolver.d.ts +6 -3
- package/dist/config/credential-resolver.js +6 -5
- package/dist/config-file/define.d.ts +1 -1
- package/dist/context.d.ts +44 -24
- package/dist/context.js +20 -13
- package/dist/core/before-run.d.ts +7 -6
- package/dist/core/before-run.js +9 -9
- package/dist/core/definition-lookup.d.ts +22 -0
- package/dist/core/definition-lookup.js +35 -0
- package/dist/core/drivers-of.d.ts +23 -0
- package/dist/core/drivers-of.js +13 -0
- package/dist/core/events.d.ts +6 -22
- package/dist/core/gateways.d.ts +38 -170
- package/dist/core/index.d.ts +13 -12
- package/dist/core/index.js +12 -11
- 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 +5 -4
- package/dist/core/presentations.js +9 -9
- package/dist/core/resource-definition-set.d.ts +39 -0
- package/dist/core/resource-definition-set.js +31 -0
- package/dist/core/resource-reports.d.ts +38 -5
- package/dist/core/resource-reports.js +47 -17
- package/dist/core/resource.d.ts +4 -4
- package/dist/core/resources.d.ts +8 -7
- package/dist/core/resources.js +11 -13
- package/dist/core/run-state.d.ts +27 -16
- package/dist/core/run-state.js +50 -18
- package/dist/core/run.d.ts +42 -54
- package/dist/core/run.js +72 -122
- 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 -4
- package/dist/credential/events.d.ts +20 -0
- package/dist/credential/events.js +4 -0
- package/dist/credential/index.d.ts +2 -1
- package/dist/credential/index.js +6 -5
- package/dist/credential/source.d.ts +38 -26
- package/dist/credential/source.js +25 -34
- package/dist/extension-commands.d.ts +12 -6
- package/dist/extension-commands.js +16 -13
- 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 +2 -2
- package/dist/extensions/testserver/command-tree.js +2 -3
- 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 +17 -12
- package/dist/extensions/testserver/commands/pool/list/command.js +8 -5
- 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 +8 -6
- package/dist/extensions/testserver/vitest/config.js +10 -16
- 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 +12 -10
- package/dist/extensions/testserver/vitest/fixtures.js +44 -22
- 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 +43 -30
- package/dist/extensions.js +50 -35
- package/dist/forward-sigterm.d.ts +8 -0
- package/dist/forward-sigterm.js +18 -0
- package/dist/launcher-resolvers/index.d.ts +1 -0
- package/dist/launcher-resolvers/index.js +2 -1
- package/dist/launcher-resolvers/local-services.d.ts +22 -0
- package/dist/launcher-resolvers/local-services.js +6 -0
- package/dist/live-app.js +9 -7
- package/dist/local-services.d.ts +11 -0
- package/dist/local-services.js +16 -0
- 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/gateways.d.ts +167 -0
- package/dist/run-directory/gateways.js +2 -0
- package/dist/run-directory/index.d.ts +8 -0
- package/dist/run-directory/index.js +13 -0
- package/dist/run-directory/plan.d.ts +35 -0
- package/dist/run-directory/plan.js +24 -0
- package/dist/run-directory/reader.d.ts +70 -0
- package/dist/run-directory/reader.js +51 -0
- package/dist/run-directory/recording.d.ts +95 -0
- package/dist/run-directory/recording.js +85 -0
- package/dist/{commands/exec → run-directory}/run-collector.d.ts +9 -8
- package/dist/{commands/exec → run-directory}/run-collector.js +8 -10
- package/dist/{core → run-directory}/run-directory.d.ts +3 -3
- package/dist/{core → run-directory}/run-directory.js +2 -2
- package/dist/{commands/exec → run-directory}/run-record.d.ts +94 -27
- package/dist/run-directory/run-record.js +229 -0
- package/dist/{commands/exec → run-directory}/timeline-facts.d.ts +5 -8
- package/dist/{commands/exec → run-directory}/timeline-facts.js +11 -25
- 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 +73 -33
- package/dist/runner/gateways.d.ts +30 -10
- package/dist/runner/index.d.ts +15 -17
- package/dist/runner/index.js +12 -14
- package/dist/runner/live/checkout-gateway.js +15 -7
- package/dist/runner/live/snapshot-records.js +8 -7
- package/dist/runner/prepare.d.ts +26 -26
- package/dist/runner/prepare.js +27 -14
- package/dist/runner/ready.d.ts +43 -10
- package/dist/runner/ready.js +51 -34
- package/dist/runner/recipe.d.ts +48 -4
- package/dist/runner/recipe.js +42 -1
- package/dist/runner/scope.d.ts +13 -13
- package/dist/runner/scope.js +9 -11
- package/dist/runner/secrets.d.ts +6 -0
- package/dist/runner/secrets.js +10 -0
- package/dist/runner/session.d.ts +128 -0
- package/dist/runner/session.js +138 -0
- 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 +35 -20
- package/dist/runner/snapshot-save.js +47 -37
- package/dist/runner/snapshot-start.d.ts +25 -0
- package/dist/runner/snapshot-start.js +16 -0
- package/dist/sdk/extension/ci.d.ts +2 -0
- package/dist/sdk/extension/ci.js +6 -0
- package/dist/sdk/extension/commands.d.ts +44 -28
- package/dist/sdk/extension/commands.js +15 -13
- package/dist/sdk/extension/driver.d.ts +143 -0
- package/dist/sdk/extension/driver.js +28 -0
- package/dist/sdk/extension/index.d.ts +3 -1
- package/dist/sdk/extension/index.js +16 -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 +10 -8
- package/dist/sdk/extension/lifecycle.js +2 -2
- package/dist/sdk/extension/progress.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 +12 -12
- package/dist/vendor/testserver-sdk/container/container.js +39 -21
- 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/vendor/testserver-sdk/testserver/failure.d.ts +4 -3
- package/dist/vendor/testserver-sdk/testserver/failure.js +4 -3
- 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 -5
- package/skills/read-run-output.md +22 -7
- package/dist/chunks/chunk-AGWW3HDT.js +0 -2559
- package/dist/chunks/chunk-H2VCSNVU.js +0 -351
- package/dist/commands/exec/run-record.js +0 -135
- 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/mint.d.ts +0 -10
- package/dist/core/mint.js +0 -14
- package/dist/core/resource-registry.d.ts +0 -54
- package/dist/core/resource-registry.js +0 -57
- 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/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 -34
- package/dist/story/command-line.js +0 -100
- 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 -10
- package/dist/story/json.d.ts +0 -16
- package/dist/story/json.js +0 -59
- package/dist/story/live/recording-gateway.d.ts +0 -2
- package/dist/story/live/recording-gateway.js +0 -103
- package/dist/story/mode.d.ts +0 -17
- package/dist/story/mode.js +0 -21
- 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 -130
- 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/{vitest → extensions/vitest/plan}/list-output.d.ts +0 -0
- /package/dist/{vitest → extensions/vitest/plan}/list-output.js +0 -0
- /package/dist/{core → run-directory}/live/run-directory-gateway.d.ts +0 -0
- /package/dist/{core → run-directory}/live/run-directory-gateway.js +0 -0
|
@@ -1,7 +1,40 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import type {
|
|
3
|
-
import
|
|
2
|
+
import type { Row, Warning } from "../sdk/extension/index.ts";
|
|
3
|
+
import type { DefinitionLookup } from "./definition-lookup.ts";
|
|
4
4
|
import type { ResourceCleanupRecords, ResourceRanRecords } from "./resource.ts";
|
|
5
|
+
/**
|
|
6
|
+
* A map of resource instances, by resource key, each record naming its definition beside its warnings: what the run's
|
|
7
|
+
* cleanup reports of the instances it released.
|
|
8
|
+
*/
|
|
9
|
+
export interface InstanceWarnings {
|
|
10
|
+
readonly [key: string]: {
|
|
11
|
+
readonly definition: string;
|
|
12
|
+
readonly warnings: readonly Warning[];
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A map of resource instances, by resource key, each record naming its definition beside its `facts` and its
|
|
17
|
+
* warnings: what a `ran` outcome reports of a run's resource instances.
|
|
18
|
+
*/
|
|
19
|
+
export interface InstanceFacts {
|
|
20
|
+
readonly [key: string]: {
|
|
21
|
+
readonly definition: string;
|
|
22
|
+
readonly facts: unknown;
|
|
23
|
+
readonly warnings: readonly Warning[];
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The schema of a map of resource instances, by resource key, whose records are each definition's `[name, schema]`:
|
|
28
|
+
* each record is `{ definition: name, facts, warnings }` of one of them, `facts` by the schema it is given. The core
|
|
29
|
+
* gives every definition `z.unknown()`, so `--json-schema` shows each instance's result facts as unknown, and storm
|
|
30
|
+
* reads them as recorded. A map with no definitions to hold is empty.
|
|
31
|
+
*/
|
|
32
|
+
export declare function instanceSchema(records: readonly (readonly [string, z.ZodType])[]): z.ZodType<InstanceFacts, InstanceFacts>;
|
|
33
|
+
/**
|
|
34
|
+
* The schema of a map of resource instances, by resource key, as the run's cleanup reports them: each record is
|
|
35
|
+
* `{ definition, warnings }`, `definition` one of `names`. A map with no definitions to hold is empty.
|
|
36
|
+
*/
|
|
37
|
+
export declare function cleanupInstanceSchema(names: readonly string[]): z.ZodType<InstanceWarnings, InstanceWarnings>;
|
|
5
38
|
/**
|
|
6
39
|
* Every resource definition's reports, for each resource instance a run's maps hold.
|
|
7
40
|
*
|
|
@@ -18,7 +51,7 @@ import type { ResourceCleanupRecords, ResourceRanRecords } from "./resource.ts";
|
|
|
18
51
|
* - `ranRows`: the rows `storm runs show` lists for a ran outcome's resources, instance by instance, from its ran
|
|
19
52
|
* records, which storm keeps in `run.json`.
|
|
20
53
|
* - `canceledLines`: what a canceled run changed in its resource instances, for a person, from its cleanup records,
|
|
21
|
-
* instance by instance, in
|
|
54
|
+
* instance by instance, in definition order, then the order the run took them: what each acquire said a canceled run
|
|
22
55
|
* changed, then what its release finished, then its release's warnings.
|
|
23
56
|
*/
|
|
24
57
|
export interface ResourceReports {
|
|
@@ -32,5 +65,5 @@ export interface ResourceReports {
|
|
|
32
65
|
ranRows(ran: ResourceRanRecords): readonly Row[];
|
|
33
66
|
canceledLines(cleanup: ResourceCleanupRecords): readonly string[];
|
|
34
67
|
}
|
|
35
|
-
/** Every one of `
|
|
36
|
-
export declare function resourceReports(
|
|
68
|
+
/** Every one of `lookup`'s definitions' reports, each instance's from its definition. */
|
|
69
|
+
export declare function resourceReports(lookup: DefinitionLookup): ResourceReports;
|
|
@@ -1,35 +1,65 @@
|
|
|
1
1
|
// How the composition layer asks every resource instance the same thing at once when it reports a run: each record
|
|
2
|
-
// names its definition, by which the
|
|
3
|
-
// definition, then in the map's order. A run's records hold what each resource answered at its lifecycle
|
|
4
|
-
// the warnings it reported there (`ResourceRanRecords`, `ResourceCleanupRecords`); everything else here
|
|
5
|
-
// those warnings, in the launcher, not the resource, in the same words for every resource: the rows an
|
|
6
|
-
// the outcome's warnings and a canceled run's text. The rows and warnings derive from an outcome's data,
|
|
7
|
-
// which holds each warning
|
|
2
|
+
// names its definition, by which the resource definition set orders it. Each map's instances are reported in definition
|
|
3
|
+
// order, by definition, then in the map's order. A run's records hold what each resource answered at its lifecycle
|
|
4
|
+
// points and the warnings it reported there (`ResourceRanRecords`, `ResourceCleanupRecords`); everything else here
|
|
5
|
+
// derives from those warnings, in the launcher, not the resource, in the same words for every resource: the rows an
|
|
6
|
+
// error lists, the outcome's warnings and a canceled run's text. The rows and warnings derive from an outcome's data,
|
|
7
|
+
// its JSON, which holds each warning, by the schemas of a map of instances: a `ran` outcome's (`instanceSchema`), each
|
|
8
|
+
// `{ definition, facts, warnings }`, discriminated by `definition`, and the cleanup's (`cleanupInstanceSchema`), each
|
|
9
|
+
// `{ definition, warnings }`. The definition set builds the reports once (`resourceDefinitionSet`,
|
|
10
|
+
// `resource-definition-set.ts`).
|
|
8
11
|
import { z } from "zod";
|
|
9
12
|
import { warningRows } from "./reports.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
/** One warning, as outcomes report it: its reason and its sentence. */
|
|
14
|
+
const warningSchema = z.object({
|
|
15
|
+
/** Its snake_case reason. */
|
|
16
|
+
reason: z.string(),
|
|
17
|
+
message: z.string(),
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* The schema of a map of resource instances, by resource key, whose records are each definition's `[name, schema]`:
|
|
21
|
+
* each record is `{ definition: name, facts, warnings }` of one of them, `facts` by the schema it is given. The core
|
|
22
|
+
* gives every definition `z.unknown()`, so `--json-schema` shows each instance's result facts as unknown, and storm
|
|
23
|
+
* reads them as recorded. A map with no definitions to hold is empty.
|
|
24
|
+
*/
|
|
25
|
+
export function instanceSchema(records) {
|
|
26
|
+
const [first, ...rest] = records.map(([name, facts]) => z.object({ definition: z.literal(name), facts, warnings: z.array(warningSchema) }));
|
|
27
|
+
const record = first === undefined ? z.never() : z.discriminatedUnion("definition", [first, ...rest]);
|
|
28
|
+
return z.record(z.string(), record);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The schema of a map of resource instances, by resource key, as the run's cleanup reports them: each record is
|
|
32
|
+
* `{ definition, warnings }`, `definition` one of `names`. A map with no definitions to hold is empty.
|
|
33
|
+
*/
|
|
34
|
+
export function cleanupInstanceSchema(names) {
|
|
35
|
+
const [first, ...rest] = names;
|
|
36
|
+
const record = first === undefined
|
|
37
|
+
? z.never()
|
|
38
|
+
: z.object({ definition: z.enum([first, ...rest]), warnings: z.array(warningSchema) });
|
|
39
|
+
return z.record(z.string(), record);
|
|
40
|
+
}
|
|
41
|
+
/** Every one of `lookup`'s definitions' reports, each instance's from its definition. */
|
|
42
|
+
export function resourceReports(lookup) {
|
|
43
|
+
const { definitions: resources, inDefinitionOrder } = lookup;
|
|
14
44
|
// Each warning of `facts`' instances, in order.
|
|
15
|
-
const warningsOf = (facts) =>
|
|
45
|
+
const warningsOf = (facts) => inDefinitionOrder(facts).flatMap(({ record }) => record.warnings.map(({ reason, message }) => ({ reason, message })));
|
|
16
46
|
return {
|
|
17
47
|
cleanupSchema: cleanupInstanceSchema(resources.map(({ name }) => name)),
|
|
18
|
-
// `{ definition, warnings }` for each instance, in
|
|
19
|
-
cleanupFacts: (cleanup) => Object.fromEntries(
|
|
48
|
+
// `{ definition, warnings }` for each instance, in definition order, then the records' order.
|
|
49
|
+
cleanupFacts: (cleanup) => Object.fromEntries(inDefinitionOrder(cleanup).map(({ key, record: { definition, warnings } }) => [key, { definition, warnings }])),
|
|
20
50
|
cleanupRows: (facts) => warningRows(warningsOf(facts)),
|
|
21
51
|
cleanupWarnings: warningsOf,
|
|
22
52
|
ranSchema: instanceSchema(resources.map(({ name }) => [name, z.unknown()])),
|
|
23
|
-
// `{ definition, facts, warnings }` for each instance, in
|
|
24
|
-
ranFacts: (ran) => Object.fromEntries(
|
|
53
|
+
// `{ definition, facts, warnings }` for each instance, in definition order, then the records' order.
|
|
54
|
+
ranFacts: (ran) => Object.fromEntries(inDefinitionOrder(ran).map(({ key, record: { definition, facts, warnings } }) => [
|
|
25
55
|
key,
|
|
26
56
|
{ definition, facts, warnings },
|
|
27
57
|
])),
|
|
28
58
|
ranWarnings: warningsOf,
|
|
29
|
-
ranRows: (ran) =>
|
|
59
|
+
ranRows: (ran) => inDefinitionOrder(ran).flatMap(({ record }) => record.rows),
|
|
30
60
|
// The run releases its instances in reverse order, so the cleanup records come in reverse order of the run's
|
|
31
61
|
// instances; reversed, they come in the order the run took them.
|
|
32
|
-
canceledLines: (cleanup) =>
|
|
62
|
+
canceledLines: (cleanup) => inDefinitionOrder(Object.fromEntries(Object.entries(cleanup).toReversed())).flatMap(({ record }) => [
|
|
33
63
|
...record.canceled,
|
|
34
64
|
...record.done,
|
|
35
65
|
...record.warnings.map(({ message }) => message),
|
package/dist/core/resource.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Refusal, Row, Warning } from "../sdk/extension/index.ts";
|
|
2
2
|
/**
|
|
3
|
-
* Each definition's
|
|
4
|
-
* which all of its resource instances share.
|
|
3
|
+
* Each definition's Context, by its name: what the launcher hands each lifecycle. Every definition has one, used or
|
|
4
|
+
* not, which all of its resource instances share.
|
|
5
5
|
*/
|
|
6
|
-
export type
|
|
6
|
+
export type ResourceContextMap = Readonly<Record<string, unknown>>;
|
|
7
7
|
/** The core's own lane: readying the runner sandbox. */
|
|
8
8
|
export type CoreLane = "runner";
|
|
9
9
|
/**
|
|
@@ -114,7 +114,7 @@ export interface ResourceEvent {
|
|
|
114
114
|
* with as `resource_refused`, with the run's cleanup.
|
|
115
115
|
*/
|
|
116
116
|
export interface ResourceRefusal {
|
|
117
|
-
readonly kind: "
|
|
117
|
+
readonly kind: "resource_refused";
|
|
118
118
|
readonly resource: string;
|
|
119
119
|
readonly definition: string;
|
|
120
120
|
readonly refusal: Refusal;
|
package/dist/core/resources.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { CredentialSource } from "../credential/index.ts";
|
|
2
|
-
import type { LaneOutcome
|
|
2
|
+
import type { LaneOutcome } from "../sdk/extension/index.ts";
|
|
3
3
|
import type { RunEvent, RunProgress } from "./events.ts";
|
|
4
|
-
import type {
|
|
4
|
+
import type { DefinitionLookup } from "./definition-lookup.ts";
|
|
5
|
+
import type { RunInstance, ResourceCleanupRecords, ResourcePayloads, ResourceRanRecords, ResourceRefusal, ResourceRequests, ResourceContextMap, RunLane } from "./resource.ts";
|
|
5
6
|
import type { RunStopped } from "./run.ts";
|
|
6
7
|
/**
|
|
7
8
|
* How acquiring one resource instance ended, as the policy ranks it: what its acquire answered stays in the instance.
|
|
8
|
-
* `refused` carries the outcome it ends the run with: its own refusal, or the run's `
|
|
9
|
+
* `refused` carries the outcome it ends the run with: its own refusal, or the run's `mint_failed`.
|
|
9
10
|
*/
|
|
10
11
|
type InstanceOutcome = {
|
|
11
12
|
readonly kind: "acquired";
|
|
@@ -17,7 +18,7 @@ type InstanceOutcome = {
|
|
|
17
18
|
};
|
|
18
19
|
/** The run's credential source failing a mint a resource instance couldn't go on without. */
|
|
19
20
|
type MintFailedStop = Extract<RunStopped, {
|
|
20
|
-
readonly kind: "
|
|
21
|
+
readonly kind: "mint_failed";
|
|
21
22
|
}>;
|
|
22
23
|
/**
|
|
23
24
|
* Finishes one lane's task: reports how lane `lane` ended, by `outcomeOf` its value or as failed when it throws, and
|
|
@@ -60,9 +61,9 @@ export interface ResourceInstance {
|
|
|
60
61
|
}
|
|
61
62
|
/**
|
|
62
63
|
* Each resource `requests` holds, in its order, bound to this run as a resource instance of its definition from
|
|
63
|
-
* `
|
|
64
|
+
* `lookup`, over the definition's Context from `resourceContexts`.
|
|
64
65
|
*/
|
|
65
|
-
export declare function resourceInstances(
|
|
66
|
+
export declare function resourceInstances({ named }: DefinitionLookup, resourceContexts: ResourceContextMap, requests: ResourceRequests): readonly ResourceInstance[];
|
|
66
67
|
/**
|
|
67
68
|
* A lane beside the resources: the runner sandbox, readied by the runner. `stopped` is the outcome its value ends the
|
|
68
69
|
* run with, which ranks above every resource's refusal; undefined when it doesn't end the run.
|
|
@@ -94,7 +95,7 @@ export type Acquisition<T> = {
|
|
|
94
95
|
*
|
|
95
96
|
* A throw rethrows, the beside lane's first, then the resources' in order. Otherwise the outcome ranks, the same with
|
|
96
97
|
* or without a lane beside them: the user's `signal` (`canceled`), then the beside lane's failure, then each instance's
|
|
97
|
-
* refusal in order (its own, or the run's `
|
|
98
|
+
* refusal in order (its own, or the run's `mint_failed` when the mint it needed failed), then an instance's
|
|
98
99
|
* cancellation. A refusal aborts the other instances, so one that stops on that abort answers `canceled`; ranking every
|
|
99
100
|
* refusal above every cancellation keeps the refusal that caused it.
|
|
100
101
|
*/
|
package/dist/core/resources.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
// How a run acquires, announces, hands over and releases its resource instances, through each definition's lifecycle
|
|
2
|
-
// over its
|
|
2
|
+
// over its Context (`acquireForRun`, `releaseAfterRun`). One policy serves a run with or without a lane beside the
|
|
3
3
|
// resources, and names no resource. `instanceOf` binds each of the run's resources to the run as a resource instance,
|
|
4
4
|
// which calls its definition's lifecycle itself, keeps what its acquire took, how acquiring it answered and the
|
|
5
5
|
// warnings it reported, reports what it reports under its key, and hands each its own back: the routing the core view
|
|
6
6
|
// of a resource rests on (`ResourceDefinition`).
|
|
7
|
-
import { resourceRegistry } from "./resource-registry.js";
|
|
8
7
|
/**
|
|
9
8
|
* Each resource `requests` holds, in its order, bound to this run as a resource instance of its definition from
|
|
10
|
-
* `
|
|
9
|
+
* `lookup`, over the definition's Context from `resourceContexts`.
|
|
11
10
|
*/
|
|
12
|
-
export function resourceInstances(
|
|
13
|
-
|
|
14
|
-
return Object.entries(requests).map(([key, request]) => instanceOf(named(request.definition, key), key, worlds, request));
|
|
11
|
+
export function resourceInstances({ named }, resourceContexts, requests) {
|
|
12
|
+
return Object.entries(requests).map(([key, request]) => instanceOf(named(request.definition, key), key, resourceContexts, request));
|
|
15
13
|
}
|
|
16
14
|
/**
|
|
17
15
|
* The resource under key `key`, of definition `resource`, bound to this run. It hands the lifecycle only its own
|
|
18
|
-
* definition's
|
|
19
|
-
* back only what this instance's acquire and release answered.
|
|
16
|
+
* definition's Context, its acquire's own options and secrets, and its release only what its own acquire took, and
|
|
17
|
+
* reads back only what this instance's acquire and release answered.
|
|
20
18
|
*/
|
|
21
|
-
function instanceOf(resource, key,
|
|
19
|
+
function instanceOf(resource, key, resourceContexts, request) {
|
|
22
20
|
const { name } = resource;
|
|
23
|
-
const lifecycle = resource.lifecycle(
|
|
21
|
+
const lifecycle = resource.lifecycle(resourceContexts[name]);
|
|
24
22
|
const taken = [];
|
|
25
23
|
let result;
|
|
26
24
|
// What a canceled run says acquiring it changed, once its acquire answered: none for one that never answered, was
|
|
@@ -62,7 +60,7 @@ function instanceOf(resource, key, worlds, request) {
|
|
|
62
60
|
}), resourceLaneOutcome);
|
|
63
61
|
if ("refused" in answered) {
|
|
64
62
|
const outcome = {
|
|
65
|
-
kind: "
|
|
63
|
+
kind: "resource_refused",
|
|
66
64
|
resource: key,
|
|
67
65
|
definition: name,
|
|
68
66
|
refusal: answered,
|
|
@@ -71,7 +69,7 @@ function instanceOf(resource, key, worlds, request) {
|
|
|
71
69
|
}
|
|
72
70
|
if ("mintFailed" in answered) {
|
|
73
71
|
const { failure, target } = answered.mintFailed;
|
|
74
|
-
return { kind: "refused", outcome: { kind: "
|
|
72
|
+
return { kind: "refused", outcome: { kind: "mint_failed", failure, target, runner: false } };
|
|
75
73
|
}
|
|
76
74
|
result = answered;
|
|
77
75
|
canceled = "acquired" in answered ? (answered.acquired.canceled ?? []) : answered.canceled;
|
|
@@ -120,7 +118,7 @@ function instanceOf(resource, key, worlds, request) {
|
|
|
120
118
|
*
|
|
121
119
|
* A throw rethrows, the beside lane's first, then the resources' in order. Otherwise the outcome ranks, the same with
|
|
122
120
|
* or without a lane beside them: the user's `signal` (`canceled`), then the beside lane's failure, then each instance's
|
|
123
|
-
* refusal in order (its own, or the run's `
|
|
121
|
+
* refusal in order (its own, or the run's `mint_failed` when the mint it needed failed), then an instance's
|
|
124
122
|
* cancellation. A refusal aborts the other instances, so one that stops on that abort answers `canceled`; ranking every
|
|
125
123
|
* refusal above every cancellation keeps the refusal that caused it.
|
|
126
124
|
*/
|
package/dist/core/run-state.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { MintTarget } from "../credential/index.ts";
|
|
2
2
|
import type { LaneStates, ResourceDefinition, Span, SpanStatus } from "../sdk/extension/index.ts";
|
|
3
|
-
import type { KeptSandbox, RunnerSandboxPlan } from "../runner/index.ts";
|
|
3
|
+
import type { KeptSandbox, RunnerNoSaveReason, RunnerSandboxPlan, StartedFromSnapshot } from "../runner/index.ts";
|
|
4
4
|
import type { TimedRunEvent } from "./events.ts";
|
|
5
5
|
import type { RunInstance } from "./resource.ts";
|
|
6
|
+
import { type SetupPhaseName } from "./setup-phases.ts";
|
|
6
7
|
import type { RanCommand } from "./timing.ts";
|
|
7
8
|
/** The runner lane's steps, in order. */
|
|
8
9
|
export type RunnerStepName = "snapshot" | "start" | "upload" | "apply" | "install" | "build";
|
|
@@ -24,7 +25,8 @@ export interface RunnerStepState {
|
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
27
|
* What the runner did with its runner snapshot: reused or built one, of the base it holds, or is building one. A reused
|
|
27
|
-
*
|
|
28
|
+
* dev snapshot names the branch and HEAD commit of the run that saved it; each is null for a base snapshot. `snapshot`
|
|
29
|
+
* says its kind, its built-at commit and how far it is behind the run.
|
|
28
30
|
*/
|
|
29
31
|
export type RunnerSnapshotState = {
|
|
30
32
|
readonly kind: "reused" | "built";
|
|
@@ -32,33 +34,39 @@ export type RunnerSnapshotState = {
|
|
|
32
34
|
readonly base: string;
|
|
33
35
|
readonly branch: string | null;
|
|
34
36
|
readonly head: string | null;
|
|
37
|
+
readonly snapshot: StartedFromSnapshot;
|
|
35
38
|
} | {
|
|
36
39
|
readonly kind: "building";
|
|
37
40
|
readonly summary: string;
|
|
38
41
|
};
|
|
39
42
|
/**
|
|
40
|
-
* Saving the runner sandbox as a
|
|
41
|
-
* `
|
|
43
|
+
* Saving the runner sandbox as a dev snapshot: under way, saved as runner snapshot `id` at HEAD commit `head`, or
|
|
44
|
+
* not saved. `branch` is HEAD's branch, null when detached.
|
|
42
45
|
*/
|
|
43
|
-
export type
|
|
46
|
+
export type DevSnapshotSaveState = {
|
|
44
47
|
readonly kind: "saving";
|
|
45
|
-
readonly branch: string;
|
|
48
|
+
readonly branch: string | null;
|
|
46
49
|
} | {
|
|
47
50
|
readonly kind: "saved";
|
|
48
51
|
readonly id: string;
|
|
49
|
-
readonly branch: string;
|
|
52
|
+
readonly branch: string | null;
|
|
50
53
|
readonly head: string;
|
|
51
54
|
} | {
|
|
52
55
|
readonly kind: "not-saved";
|
|
53
56
|
};
|
|
54
|
-
/** One
|
|
57
|
+
/** One test worker, as its test events show it. */
|
|
55
58
|
export interface TestWorkerState {
|
|
59
|
+
/** Its worker index, from 0. */
|
|
56
60
|
readonly worker: number;
|
|
57
61
|
/** The file it runs, and when it started it; undefined between files. */
|
|
58
62
|
readonly file: string | undefined;
|
|
59
63
|
readonly fileStartedAt: number | undefined;
|
|
60
|
-
/**
|
|
61
|
-
|
|
64
|
+
/**
|
|
65
|
+
* The setup phases it waits on, by their writer's names, in the order they started: one for each resource's phases
|
|
66
|
+
* under each label (`setupPhaseKey`), from its start until its own finish, or until the worker's file starts or
|
|
67
|
+
* finishes. One phase finishing leaves the others under way. Empty when none is under way.
|
|
68
|
+
*/
|
|
69
|
+
readonly settingUp: readonly SetupPhaseName[];
|
|
62
70
|
}
|
|
63
71
|
/** The command's tests, as the test events the run followed show them. */
|
|
64
72
|
export interface TestsState {
|
|
@@ -85,8 +93,10 @@ export interface RunnerState extends Span {
|
|
|
85
93
|
readonly activity: "saving-snapshot" | "waiting-for-snapshot" | undefined;
|
|
86
94
|
/** The runner sandbox the run kept running once it ended, once closing kept it. */
|
|
87
95
|
readonly kept: KeptSandbox | undefined;
|
|
88
|
-
/** Saving the runner sandbox as a
|
|
89
|
-
readonly save:
|
|
96
|
+
/** Saving the runner sandbox as a dev snapshot, once it began. */
|
|
97
|
+
readonly save: DevSnapshotSaveState | undefined;
|
|
98
|
+
/** Why the run, whose command ended on its own, started no save, once it said so. */
|
|
99
|
+
readonly noSave: RunnerNoSaveReason | undefined;
|
|
90
100
|
}
|
|
91
101
|
/** The command: its argument list and how it ended; `stopped` when the run killed it. */
|
|
92
102
|
export interface CommandState extends Span {
|
|
@@ -97,7 +107,7 @@ export interface CommandState extends Span {
|
|
|
97
107
|
export interface CleanupState extends Span {
|
|
98
108
|
/**
|
|
99
109
|
* What it does with the runner sandbox while it stops and deletes the runner's other sandboxes: keeps it running `ms`
|
|
100
|
-
* (`keep`, stopping and deleting it at 0) or saves it as a
|
|
110
|
+
* (`keep`, stopping and deleting it at 0) or saves it as a dev snapshot (`save`); null without a runner sandbox.
|
|
101
111
|
*/
|
|
102
112
|
readonly runnerSandbox: RunnerSandboxPlan | null;
|
|
103
113
|
/** The resource keys of the resource instances it releases: each whose acquire took anything, in order. */
|
|
@@ -150,9 +160,10 @@ export interface RunState {
|
|
|
150
160
|
/** The state before any event: what applying a run's events starts from. */
|
|
151
161
|
export declare const EMPTY_RUN_STATE: RunState;
|
|
152
162
|
/**
|
|
153
|
-
* The run's state after `timed`. The core applies its own events; the progress of `resources`, the
|
|
154
|
-
* resources or any others, applies each resource instance's own events, start and end. A resource without
|
|
155
|
-
* keeps no state: its events' lines are notices. An event of a definition none of `resources` has reaches no
|
|
163
|
+
* The run's state after `timed`. The core applies its own events; the progress of `resources`, the definition set's
|
|
164
|
+
* defined resources or any others, applies each resource instance's own events, start and end. A resource without
|
|
165
|
+
* progress keeps no state: its events' lines are notices. An event of a definition none of `resources` has reaches no
|
|
166
|
+
* lane.
|
|
156
167
|
*/
|
|
157
168
|
export declare function applyRunEvent(resources: readonly Pick<ResourceDefinition, "name" | "progress">[], state: RunState, timed: TimedRunEvent): RunState;
|
|
158
169
|
/** Whether a command that ended passed: it exited 0. */
|
package/dist/core/run-state.js
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
// (`timeline`) projects it once the run is done. Neither keeps a second copy of these rules. The core applies its own
|
|
4
4
|
// events; each resource's progress (`ResourceProgress`) applies its resource instance's own events, its acquire's
|
|
5
5
|
// `announce` among them, to its own lane state, which the run's state keeps by resource key, with its definition's
|
|
6
|
-
// name.
|
|
6
|
+
// name. Callers apply events through the resource definition set (`applyEvent`, `resource-definition-set.ts`). It names
|
|
7
|
+
// no resource.
|
|
8
|
+
import { setupPhaseKey } from "./setup-phases.js";
|
|
7
9
|
/** The runner lane's steps, in order. */
|
|
8
10
|
export const RUNNER_STEPS = ["snapshot", "start", "upload", "apply", "install", "build"];
|
|
9
11
|
/** The state before any event: what applying a run's events starts from. */
|
|
@@ -23,9 +25,10 @@ export const EMPTY_RUN_STATE = {
|
|
|
23
25
|
stopping: false,
|
|
24
26
|
};
|
|
25
27
|
/**
|
|
26
|
-
* The run's state after `timed`. The core applies its own events; the progress of `resources`, the
|
|
27
|
-
* resources or any others, applies each resource instance's own events, start and end. A resource without
|
|
28
|
-
* keeps no state: its events' lines are notices. An event of a definition none of `resources` has reaches no
|
|
28
|
+
* The run's state after `timed`. The core applies its own events; the progress of `resources`, the definition set's
|
|
29
|
+
* defined resources or any others, applies each resource instance's own events, start and end. A resource without
|
|
30
|
+
* progress keeps no state: its events' lines are notices. An event of a definition none of `resources` has reaches no
|
|
31
|
+
* lane.
|
|
29
32
|
*/
|
|
30
33
|
export function applyRunEvent(resources, state, timed) {
|
|
31
34
|
const at = timed.at.getTime();
|
|
@@ -72,6 +75,7 @@ function applyEvent(resources, state, event, at) {
|
|
|
72
75
|
activity: undefined,
|
|
73
76
|
kept: undefined,
|
|
74
77
|
save: undefined,
|
|
78
|
+
noSave: undefined,
|
|
75
79
|
},
|
|
76
80
|
};
|
|
77
81
|
case "minting":
|
|
@@ -207,13 +211,32 @@ function applyRunnerEvent(state, event, at) {
|
|
|
207
211
|
switch (event.kind) {
|
|
208
212
|
case "snapshot-reused":
|
|
209
213
|
return withRunner(withStep(state, "snapshot", () => ({ status: "done", startedAt: at, endedAt: at })), () => ({
|
|
210
|
-
snapshot: {
|
|
214
|
+
snapshot: {
|
|
215
|
+
kind: "reused",
|
|
216
|
+
id: event.snapshotId,
|
|
217
|
+
base: event.base,
|
|
218
|
+
branch: event.branch,
|
|
219
|
+
head: event.head,
|
|
220
|
+
snapshot: event.snapshot,
|
|
221
|
+
},
|
|
211
222
|
}));
|
|
212
223
|
case "snapshot-build-started":
|
|
213
224
|
return withRunner(withStep(state, "snapshot", () => ({ status: "running", startedAt: at })), () => ({ snapshot: { kind: "building", summary: event.summary } }));
|
|
214
225
|
case "snapshot-built":
|
|
215
226
|
return withRunner(withStep(state, "snapshot", () => ({ status: "done", endedAt: at, latest: undefined })), () => ({
|
|
216
|
-
snapshot: {
|
|
227
|
+
snapshot: {
|
|
228
|
+
kind: "built",
|
|
229
|
+
id: event.snapshotId,
|
|
230
|
+
base: event.base,
|
|
231
|
+
branch: null,
|
|
232
|
+
head: null,
|
|
233
|
+
// A run builds its base snapshot at its own base.
|
|
234
|
+
snapshot: {
|
|
235
|
+
kind: "base",
|
|
236
|
+
builtAt: event.base,
|
|
237
|
+
builtBehind: event.builtBehind,
|
|
238
|
+
},
|
|
239
|
+
},
|
|
217
240
|
activity: undefined,
|
|
218
241
|
}));
|
|
219
242
|
case "snapshot-saving":
|
|
@@ -249,21 +272,23 @@ function applyRunnerEvent(state, event, at) {
|
|
|
249
272
|
return withRunner(state.cleanup === undefined ? state : { ...state, cleanup: { ...state.cleanup, waiting: true } }, () => ({ activity: "waiting-for-snapshot" }));
|
|
250
273
|
case "sandbox-kept":
|
|
251
274
|
return withRunner(state, () => ({ kept: { name: event.name, stopsAt: event.stopsAt } }));
|
|
252
|
-
case "
|
|
275
|
+
case "dev-snapshot-saving":
|
|
253
276
|
return withRunner(state, () => ({ save: { kind: "saving", branch: event.branch } }));
|
|
254
|
-
case "
|
|
277
|
+
case "dev-snapshot-saved":
|
|
255
278
|
return withRunner(state, () => ({
|
|
256
279
|
save: { kind: "saved", id: event.snapshotId, branch: event.branch, head: event.head },
|
|
257
280
|
}));
|
|
258
|
-
case "
|
|
281
|
+
case "dev-snapshot-not-saved":
|
|
259
282
|
return withRunner(state, () => ({ save: { kind: "not-saved" } }));
|
|
283
|
+
case "dev-snapshot-skipped":
|
|
284
|
+
return withRunner(state, () => ({ noSave: event.reason }));
|
|
260
285
|
// A step's outcome comes from its lane's end, not from the end of its output.
|
|
261
286
|
case "output-started":
|
|
262
287
|
case "output-ended":
|
|
263
288
|
case "snapshot-entry-not-written":
|
|
264
289
|
case "command-output-started":
|
|
265
|
-
case "
|
|
266
|
-
case "
|
|
290
|
+
case "dev-snapshots-dropped":
|
|
291
|
+
case "dev-snapshots-not-dropped":
|
|
267
292
|
return state;
|
|
268
293
|
}
|
|
269
294
|
}
|
|
@@ -284,7 +309,7 @@ function applyTestEvent(tests, event, at) {
|
|
|
284
309
|
worker: event.worker,
|
|
285
310
|
file: undefined,
|
|
286
311
|
fileStartedAt: undefined,
|
|
287
|
-
|
|
312
|
+
settingUp: [],
|
|
288
313
|
};
|
|
289
314
|
const put = (changed, rest = {}) => ({
|
|
290
315
|
...tests,
|
|
@@ -293,19 +318,26 @@ function applyTestEvent(tests, event, at) {
|
|
|
293
318
|
});
|
|
294
319
|
switch (event.kind) {
|
|
295
320
|
case "file-started":
|
|
296
|
-
return put({ ...worker, file: event.file, fileStartedAt: at,
|
|
321
|
+
return put({ ...worker, file: event.file, fileStartedAt: at, settingUp: [] });
|
|
297
322
|
case "test-started":
|
|
298
323
|
return put({ ...worker, file: event.file, fileStartedAt: worker.fileStartedAt ?? at });
|
|
299
324
|
case "test-attempt-finished":
|
|
300
325
|
return put(worker);
|
|
301
326
|
case "file-finished":
|
|
302
|
-
return put({ ...worker, file: undefined, fileStartedAt: undefined,
|
|
303
|
-
case "
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
327
|
+
return put({ ...worker, file: undefined, fileStartedAt: undefined, settingUp: [] }, { filesDone: tests.filesDone + 1 });
|
|
328
|
+
case "setup-started": {
|
|
329
|
+
const { label, resource } = event;
|
|
330
|
+
return put({ ...worker, settingUp: [...withoutPhase(worker.settingUp, event), { label, resource }] });
|
|
331
|
+
}
|
|
332
|
+
case "setup-finished":
|
|
333
|
+
return put({ ...worker, settingUp: withoutPhase(worker.settingUp, event) });
|
|
307
334
|
}
|
|
308
335
|
}
|
|
336
|
+
/** The setup phases under way in `settingUp`, less those that share `phase`'s key. */
|
|
337
|
+
function withoutPhase(settingUp, phase) {
|
|
338
|
+
const key = setupPhaseKey(phase);
|
|
339
|
+
return settingUp.filter((under) => setupPhaseKey(under) !== key);
|
|
340
|
+
}
|
|
309
341
|
/** The state with the runner lane's fields changed by `change`; unchanged without a runner lane. */
|
|
310
342
|
function withRunner(state, change) {
|
|
311
343
|
return state.runner === undefined ? state : { ...state, runner: { ...state.runner, ...change() } };
|