@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
package/dist/core/gateways.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface CommandOutputChunk {
|
|
|
4
4
|
readonly data: string;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* One execution of
|
|
7
|
+
* One execution of the command: its argument list, its whole environment, when to stop it, and where its output
|
|
8
8
|
* goes.
|
|
9
9
|
*/
|
|
10
10
|
export interface CommandRequest {
|
|
@@ -35,34 +35,12 @@ export type CommandOutcome = {
|
|
|
35
35
|
readonly message: string;
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
|
-
* Runs
|
|
38
|
+
* Runs the command with the terminal's stdin, hands its stdout and stderr to `onOutput`, and waits for it and for
|
|
39
39
|
* the last of its output. It never rejects: a command that can't start is `spawn-failed`.
|
|
40
40
|
*/
|
|
41
41
|
export interface CommandGateway {
|
|
42
42
|
run(request: CommandRequest): Promise<CommandOutcome>;
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
45
|
-
* One command run in the launcher's terminal: its argument list, its whole environment, its working directory, and
|
|
46
|
-
* when to stop it.
|
|
47
|
-
*/
|
|
48
|
-
export interface TerminalCommandRequest {
|
|
49
|
-
/** The command, run as given, with no shell. `argv[0]` is the executable. */
|
|
50
|
-
readonly argv: readonly string[];
|
|
51
|
-
/** The command's whole environment; nothing else is inherited. */
|
|
52
|
-
readonly env: Readonly<Record<string, string>>;
|
|
53
|
-
/** The directory it runs in, an absolute path. */
|
|
54
|
-
readonly cwd: string;
|
|
55
|
-
/** Aborting it sends the command SIGTERM. The command may still take its time to exit. */
|
|
56
|
-
readonly terminate: AbortSignal;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Runs a command in the launcher's terminal: it shares storm's stdin, stdout and stderr, so its output reaches the
|
|
60
|
-
* terminal as it prints it, with its colors and its live updates, and storm sees none of it. It waits for the command.
|
|
61
|
-
* It never rejects: a command that can't start is `spawn-failed`.
|
|
62
|
-
*/
|
|
63
|
-
export interface TerminalCommandGateway {
|
|
64
|
-
run(request: TerminalCommandRequest): Promise<CommandOutcome>;
|
|
65
|
-
}
|
|
66
44
|
/**
|
|
67
45
|
* The terminal a run's live view shows on, a DI seam: a live region pinned at the bottom of stderr, redrawn in
|
|
68
46
|
* place, with text printed above it. Writes never throw; once one fails, as one does with EIO after SIGHUP closes
|
|
@@ -106,3 +84,33 @@ export interface JobSummaryFailure {
|
|
|
106
84
|
export interface JobSummaryGateway {
|
|
107
85
|
appendJobSummary(markdown: string): Promise<JobSummaryResult>;
|
|
108
86
|
}
|
|
87
|
+
/** Where to look for a package's binary: in `node_modules/.bin` of `from` and of each directory above it, up to `root`. */
|
|
88
|
+
export interface FindPackageBinRequest {
|
|
89
|
+
/** The binary's name, such as `vitest` or `playwright`. */
|
|
90
|
+
readonly name: string;
|
|
91
|
+
/** The directory the binary runs in, an absolute path. */
|
|
92
|
+
readonly from: string;
|
|
93
|
+
/**
|
|
94
|
+
* The last directory to look in, an absolute path: the repository's root, or the filesystem's root outside a
|
|
95
|
+
* repository. When `from` isn't inside it, the search goes on up to the filesystem's root.
|
|
96
|
+
*/
|
|
97
|
+
readonly root: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The binary found nearest `from`, as an absolute path to its `node_modules/.bin/<name>`; or, when no directory has
|
|
101
|
+
* one, every directory looked in, nearest first (`packageBinSearchDirectories`).
|
|
102
|
+
*/
|
|
103
|
+
export type FindPackageBinResult = {
|
|
104
|
+
readonly ok: true;
|
|
105
|
+
readonly path: string;
|
|
106
|
+
} | {
|
|
107
|
+
readonly ok: false;
|
|
108
|
+
readonly searched: readonly string[];
|
|
109
|
+
};
|
|
110
|
+
/** The binaries packages install on this machine, in `node_modules/.bin`. */
|
|
111
|
+
export interface PackageBinGateway {
|
|
112
|
+
/**
|
|
113
|
+
* Finds the binary a package's scripts would run: the nearest `node_modules/.bin/<name>` from `from` up to `root`.
|
|
114
|
+
*/
|
|
115
|
+
find(request: FindPackageBinRequest): Promise<FindPackageBinResult>;
|
|
116
|
+
}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
export { warningRows, warningTally } from "./reports.ts";
|
|
2
2
|
export type { ResourceLifecycles, ResourcesBeforeRun } from "./before-run.ts";
|
|
3
|
-
export { type
|
|
3
|
+
export { type ResourceDefinitionSet, resourceDefinitionSet } from "./resource-definition-set.ts";
|
|
4
4
|
export { cleanupInstanceSchema, type InstanceFacts, instanceSchema, type InstanceWarnings, type ResourceReports, } from "./resource-reports.ts";
|
|
5
5
|
export { resourcesOf } from "./resources-of.ts";
|
|
6
|
-
export {
|
|
6
|
+
export { driversOf, type DriverContextMap, driverContexts } from "./drivers-of.ts";
|
|
7
|
+
export { type SetupPhaseName, setupPhaseKey, setupPhaseWords } from "./setup-phases.ts";
|
|
8
|
+
export { launcherContext } from "./launcher-context.ts";
|
|
7
9
|
export type { LaneKind, PresentedInstance, PresentedLane, ResourcePresentations } from "./presentations.ts";
|
|
8
10
|
export { observeAll, type RunEvent, type RunObserver, type RunProgress, silentProgress, type TimedRunEvent, timedProgress, } from "./events.ts";
|
|
9
|
-
export type { CommandGateway, CommandOutcome, CommandOutputChunk, CommandRequest, JobSummaryFailure, JobSummaryGateway, JobSummaryResult,
|
|
11
|
+
export type { CommandGateway, CommandOutcome, CommandOutputChunk, CommandRequest, FindPackageBinRequest, FindPackageBinResult, JobSummaryFailure, JobSummaryGateway, JobSummaryResult, PackageBinGateway, ProgressTerminal, } from "./gateways.ts";
|
|
10
12
|
export { liveCommandGateway } from "./live/command-gateway.ts";
|
|
11
|
-
export { liveTerminalCommandGateway } from "./live/terminal-command-gateway.ts";
|
|
12
13
|
export { liveJobSummaryGateway } from "./live/job-summary-gateway.ts";
|
|
13
14
|
export { liveProgressTerminal } from "./live/progress-terminal.ts";
|
|
14
|
-
export
|
|
15
|
+
export { livePackageBinGateway } from "./live/package-bin-gateway.ts";
|
|
16
|
+
export type { CoreLane, RunInstance, ResourceAcquired, ResourceCleanupRecords, ResourceEvent, ResourceNoticeEvent, ResourceWarningEvent, ResourceOptions, ResourcePayloads, ResourceRanRecords, ResourceRefusal, ResourceInputs, ResourceRequest, ResourceRequests, ResourceSkip, ResourceContextMap, RunLane, } from "./resource.ts";
|
|
15
17
|
export { executeRun, type UnsandboxedRunRequest, type RanRun, type RanRunner, type SandboxedRunRequest, type RunCleanup, type RunContext, type RunnerCleanupFacts, type RunControl, type RunOutcome, type RunRequest, type RunRunnerFailure, type RunRunnerRequest, type RunStopped, } from "./run.ts";
|
|
16
18
|
export { resolveStateDirectory, stateDirectoryPattern } from "./state-directory.ts";
|
|
17
19
|
export { commandExitStatus, megabytesText, type RanCommand, secondsOf, secondsText } from "./timing.ts";
|
package/dist/core/index.js
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
// The `core` module's caller-facing interface: the
|
|
2
|
-
// (`
|
|
3
|
-
// and the words every resource's warnings show in
|
|
1
|
+
// The `core` module's caller-facing interface: the resource definition set the composition layer builds from its
|
|
2
|
+
// resource definitions (`resourceDefinitionSet`), what it runs a command with over that definition set, with the types
|
|
3
|
+
// of its outcome and progress, the words every resource's warnings show in, and the extensions' drivers as one list,
|
|
4
|
+
// with their Contexts (`driversOf`, `driverContexts`).
|
|
4
5
|
// The resource contract each extension folder implements, its definition, lifecycle and progress, is the extension
|
|
5
6
|
// API's, which a caller imports from `sdk/extension/index.ts`. It names no resource.
|
|
6
7
|
export { warningRows, warningTally } from "./reports.js";
|
|
7
|
-
export {
|
|
8
|
+
export { resourceDefinitionSet } from "./resource-definition-set.js";
|
|
8
9
|
export { cleanupInstanceSchema, instanceSchema, } from "./resource-reports.js";
|
|
9
10
|
export { resourcesOf } from "./resources-of.js";
|
|
10
|
-
export {
|
|
11
|
+
export { driversOf, driverContexts } from "./drivers-of.js";
|
|
12
|
+
export { setupPhaseKey, setupPhaseWords } from "./setup-phases.js";
|
|
13
|
+
export { launcherContext } from "./launcher-context.js";
|
|
11
14
|
export { observeAll, silentProgress, timedProgress, } from "./events.js";
|
|
12
15
|
export { liveCommandGateway } from "./live/command-gateway.js";
|
|
13
|
-
export { liveTerminalCommandGateway } from "./live/terminal-command-gateway.js";
|
|
14
16
|
export { liveJobSummaryGateway } from "./live/job-summary-gateway.js";
|
|
15
17
|
export { liveProgressTerminal } from "./live/progress-terminal.js";
|
|
18
|
+
export { livePackageBinGateway } from "./live/package-bin-gateway.js";
|
|
16
19
|
export { executeRun, } from "./run.js";
|
|
17
20
|
export { resolveStateDirectory, stateDirectoryPattern } from "./state-directory.js";
|
|
18
21
|
export { commandExitStatus, megabytesText, secondsOf, secondsText } from "./timing.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LauncherContext, ResourceDefinition } from "../sdk/extension/index.ts";
|
|
2
|
+
/**
|
|
3
|
+
* What the launcher gives definition `name` to build its Context from, over the launcher environment `env`, the
|
|
4
|
+
* system clock and timer.
|
|
5
|
+
*/
|
|
6
|
+
export declare function launcherContext(env: Readonly<Record<string, string | undefined>>, name: string): LauncherContext;
|
|
7
|
+
/**
|
|
8
|
+
* Every definition's Context, by its name, each built from what the launcher gives it over `env`. `resources` lists
|
|
9
|
+
* every definition once, as the definition set's list does.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resourceContexts(resources: readonly Pick<ResourceDefinition, "name" | "context">[], env: Readonly<Record<string, string | undefined>>): Readonly<Record<string, unknown>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// What the launcher gives a resource definition to build its Context from (`launcherContext`, of the extension API's
|
|
2
|
+
// `LauncherContext`), and every definition's Context, built from that (`resourceContexts`, which the resource
|
|
3
|
+
// definition set's `contexts` calls). A resource's `defineResource` names how it builds its Context (`context`). It is
|
|
4
|
+
// not `StormContext`, which holds what storm's own commands reach the outside through: the launcher builds a
|
|
5
|
+
// `LauncherContext` for one resource definition, from the process environment and the system clock and timer. It
|
|
6
|
+
// names no resource.
|
|
7
|
+
import { systemClock, systemTimer } from "../time/index.js";
|
|
8
|
+
import { resolveStateDirectory, stateDirectoryPattern } from "./state-directory.js";
|
|
9
|
+
/**
|
|
10
|
+
* What the launcher gives definition `name` to build its Context from, over the launcher environment `env`, the
|
|
11
|
+
* system clock and timer.
|
|
12
|
+
*/
|
|
13
|
+
export function launcherContext(env, name) {
|
|
14
|
+
const subpath = [name];
|
|
15
|
+
const resolved = resolveStateDirectory(env, subpath);
|
|
16
|
+
return {
|
|
17
|
+
env,
|
|
18
|
+
stateDirectory: resolved.ok
|
|
19
|
+
? resolved
|
|
20
|
+
: { ok: false, reason: resolved.reason, pattern: stateDirectoryPattern(subpath) },
|
|
21
|
+
clock: systemClock,
|
|
22
|
+
timer: systemTimer,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Every definition's Context, by its name, each built from what the launcher gives it over `env`. `resources` lists
|
|
27
|
+
* every definition once, as the definition set's list does.
|
|
28
|
+
*/
|
|
29
|
+
export function resourceContexts(resources, env) {
|
|
30
|
+
return Object.fromEntries(resources.map(({ name, context }) => [name, context(launcherContext(env, name))]));
|
|
31
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PackageBinGateway } from "../gateways.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The live package binary gateway: `find` answers the first `node_modules/.bin/<name>` this process may execute
|
|
4
|
+
* (`access` with `X_OK`), in `packageBinSearchDirectories` order.
|
|
5
|
+
*/
|
|
6
|
+
export declare const livePackageBinGateway: PackageBinGateway;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Finding a package's binary on this machine: the first `node_modules/.bin/<name>` this process may execute.
|
|
2
|
+
import { constants } from "node:fs";
|
|
3
|
+
import { access } from "node:fs/promises";
|
|
4
|
+
import { packageBinPath, packageBinSearchDirectories } from "../package-bin.js";
|
|
5
|
+
/**
|
|
6
|
+
* The live package binary gateway: `find` answers the first `node_modules/.bin/<name>` this process may execute
|
|
7
|
+
* (`access` with `X_OK`), in `packageBinSearchDirectories` order.
|
|
8
|
+
*/
|
|
9
|
+
export const livePackageBinGateway = {
|
|
10
|
+
async find({ name, from, root }) {
|
|
11
|
+
const searched = packageBinSearchDirectories(from, root);
|
|
12
|
+
for (const directory of searched) {
|
|
13
|
+
const path = packageBinPath(directory, name);
|
|
14
|
+
try {
|
|
15
|
+
await access(path, constants.X_OK);
|
|
16
|
+
return { ok: true, path };
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
// Not there, or not executable: look further up.
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return { ok: false, searched };
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Where the binary `name` sits under `directory`: its `node_modules/.bin/<name>`. */
|
|
2
|
+
export declare function packageBinPath(directory: string, name: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* The directories whose `node_modules/.bin` may hold a package's binary, nearest first: `from`, then each directory
|
|
5
|
+
* above it, up to and including `root`. When `from` isn't `root` or inside it, up to the filesystem's root.
|
|
6
|
+
*/
|
|
7
|
+
export declare function packageBinSearchDirectories(from: string, root: string): readonly string[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Where to look for a package's binary, such as `vitest` or `playwright`, in `node_modules/.bin`. Pure, so the live
|
|
2
|
+
// package binary gateway and its fake look in the same directories.
|
|
3
|
+
import { dirname, isAbsolute, join, relative } from "node:path";
|
|
4
|
+
/** Where the binary `name` sits under `directory`: its `node_modules/.bin/<name>`. */
|
|
5
|
+
export function packageBinPath(directory, name) {
|
|
6
|
+
return join(directory, "node_modules", ".bin", name);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The directories whose `node_modules/.bin` may hold a package's binary, nearest first: `from`, then each directory
|
|
10
|
+
* above it, up to and including `root`. When `from` isn't `root` or inside it, up to the filesystem's root.
|
|
11
|
+
*/
|
|
12
|
+
export function packageBinSearchDirectories(from, root) {
|
|
13
|
+
const inside = from === root || isInside(root, from);
|
|
14
|
+
const directories = [];
|
|
15
|
+
let directory = from;
|
|
16
|
+
for (;;) {
|
|
17
|
+
directories.push(directory);
|
|
18
|
+
if (inside && directory === root)
|
|
19
|
+
return directories;
|
|
20
|
+
const parent = dirname(directory);
|
|
21
|
+
if (parent === directory)
|
|
22
|
+
return directories;
|
|
23
|
+
directory = parent;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/** Whether `path` is inside `directory`, below it. */
|
|
27
|
+
function isInside(directory, path) {
|
|
28
|
+
const between = relative(directory, path);
|
|
29
|
+
return between !== "" && !between.startsWith("..") && !isAbsolute(between);
|
|
30
|
+
}
|
|
@@ -39,7 +39,7 @@ export interface PresentedInstance {
|
|
|
39
39
|
*
|
|
40
40
|
* - `plain`: plain progress for one run: the lines of an instance's own progress event, given when it happened.
|
|
41
41
|
* - `notices`: the live view's notices for an instance's own progress event.
|
|
42
|
-
* - `laneKinds`: the lane of each definition with its own progress, in
|
|
42
|
+
* - `laneKinds`: the lane of each definition with its own progress, in definition order, as the views name it.
|
|
43
43
|
* - `lanes`: the lane of each of `instances` whose definition has its own progress, in their order, as the views draw
|
|
44
44
|
* it.
|
|
45
45
|
*/
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
// How a run's views (`exec`'s and `
|
|
2
|
-
// resource instance to its definition, whose progress reads the run's maps by the resource key. It
|
|
3
|
-
// progress's `plain` the launcher's `seconds` formatter. A resource without progress reports its lines
|
|
4
|
-
// (`resource-notice`), which the views print as they are, and every resource its warnings (`resource-warning`),
|
|
5
|
-
// they mark as warnings. The
|
|
1
|
+
// How a run's views (`exec`'s, `vitest`'s and `playwright`'s) ask every resource instance how it shows: each function
|
|
2
|
+
// below hands each resource instance to its definition, whose progress reads the run's maps by the resource key. It
|
|
3
|
+
// hands each progress's `plain` the launcher's `seconds` formatter. A resource without progress reports its lines
|
|
4
|
+
// itself (`resource-notice`), which the views print as they are, and every resource its warnings (`resource-warning`),
|
|
5
|
+
// which they mark as warnings. The resource definition set builds the presentations once (`resourceDefinitionSet`,
|
|
6
|
+
// `resource-definition-set.ts`).
|
|
6
7
|
import { secondsOf, secondsText } from "./timing.js";
|
|
7
8
|
/** `ms` as progress shows it: seconds to one decimal and `s`, the formatter each presentation's `plain` gets. */
|
|
8
9
|
function seconds(ms) {
|
|
@@ -3,36 +3,37 @@ import { type ResourceLifecycles } from "./before-run.ts";
|
|
|
3
3
|
import { type DefinitionLookup } from "./definition-lookup.ts";
|
|
4
4
|
import type { TimedRunEvent } from "./events.ts";
|
|
5
5
|
import { type ResourcePresentations } from "./presentations.ts";
|
|
6
|
-
import type {
|
|
6
|
+
import type { ResourceContextMap } from "./resource.ts";
|
|
7
7
|
import { type ResourceReports } from "./resource-reports.ts";
|
|
8
8
|
import { type RunState } from "./run-state.ts";
|
|
9
9
|
import { type Timeline } from "./timeline.ts";
|
|
10
|
-
/** Where the
|
|
10
|
+
/** Where the definition set keeps its lookup, which only the core reads. */
|
|
11
11
|
export declare const LOOKUP: unique symbol;
|
|
12
12
|
/**
|
|
13
|
-
* Resource definitions, in
|
|
13
|
+
* Resource definitions, in definition order, and everything the launcher derives from them, in that order.
|
|
14
14
|
*
|
|
15
|
-
* - `definitions`: the definitions, in
|
|
15
|
+
* - `definitions`: the definitions, in definition order.
|
|
16
16
|
* - `reports`: every definition's reports, for each resource instance a run's maps hold.
|
|
17
17
|
* - `presentations`: how every definition's instances show in a run's progress.
|
|
18
18
|
* - `applyEvent`: the run's state after `timed`, through the definitions' progress. A run's final state is
|
|
19
|
-
* `events.reduce(
|
|
19
|
+
* `events.reduce(definitionSet.applyEvent, EMPTY_RUN_STATE)`. An event of a definition the definition set lacks
|
|
20
|
+
* reaches no lane.
|
|
20
21
|
* - `timeline`: a run's waterfall, from its final state, with each resource lane's row.
|
|
21
|
-
* - `lifecycles`: every definition's lifecycle, over its
|
|
22
|
-
* starts. Each call builds each definition's lifecycle once.
|
|
23
|
-
* - `
|
|
24
|
-
* own state directory.
|
|
22
|
+
* - `lifecycles`: every definition's lifecycle, over its Context from `contexts`, by its name: what a run calls before
|
|
23
|
+
* it starts. Each call builds each definition's lifecycle once.
|
|
24
|
+
* - `contexts`: every definition's Context, by its name, each built from what the launcher gives it over `env`, with
|
|
25
|
+
* its own state directory.
|
|
25
26
|
*/
|
|
26
|
-
export interface
|
|
27
|
+
export interface ResourceDefinitionSet {
|
|
27
28
|
readonly definitions: readonly ResourceDefinition[];
|
|
28
29
|
readonly reports: ResourceReports;
|
|
29
30
|
readonly presentations: ResourcePresentations;
|
|
30
31
|
readonly applyEvent: (state: RunState, timed: TimedRunEvent) => RunState;
|
|
31
32
|
readonly timeline: (state: RunState) => Timeline;
|
|
32
|
-
readonly lifecycles: (
|
|
33
|
-
readonly
|
|
33
|
+
readonly lifecycles: (contexts: ResourceContextMap) => ResourceLifecycles;
|
|
34
|
+
readonly contexts: (env: Readonly<Record<string, string | undefined>>) => ResourceContextMap;
|
|
34
35
|
/** The lookup of a definition by its name, which `executeRun` binds each resource instance with. */
|
|
35
36
|
readonly [LOOKUP]: DefinitionLookup;
|
|
36
37
|
}
|
|
37
|
-
/** The
|
|
38
|
-
export declare function
|
|
38
|
+
/** The definition set of `definitions`, in their order, each looked up by its name. */
|
|
39
|
+
export declare function resourceDefinitionSet(definitions: readonly ResourceDefinition[]): ResourceDefinitionSet;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// The resource definition set: the one value the core builds from a list of resource definitions, in definition order
|
|
2
|
+
// (`resourceDefinitionSet`), which the composition layer builds once (`src/extensions.ts`) and every caller shares. It
|
|
3
|
+
// holds the definitions, their reports (`resource-reports.ts`) and their presentations (`presentations.ts`), the run's
|
|
4
|
+
// state and waterfall through their progress (`run-state.ts`, `timeline.ts`), their lifecycles over given Contexts
|
|
5
|
+
// (`before-run.ts`), and their Contexts built from a launcher environment (`launcher-context.ts`). It builds the lookup
|
|
6
|
+
// of a definition by its name once (`definition-lookup.ts`) and hands it to what it builds; the lookup stays the
|
|
7
|
+
// core's: `executeRun` reads it from the definition set under `LOOKUP`, which `index.ts` doesn't export. It names no
|
|
8
|
+
// resource.
|
|
9
|
+
import { bindLifecycles } from "./before-run.js";
|
|
10
|
+
import { definitionLookup } from "./definition-lookup.js";
|
|
11
|
+
import { resourceContexts } from "./launcher-context.js";
|
|
12
|
+
import { resourcePresentations } from "./presentations.js";
|
|
13
|
+
import { resourceReports } from "./resource-reports.js";
|
|
14
|
+
import { applyRunEvent } from "./run-state.js";
|
|
15
|
+
import { timeline } from "./timeline.js";
|
|
16
|
+
/** Where the definition set keeps its lookup, which only the core reads. */
|
|
17
|
+
export const LOOKUP = Symbol("definition lookup");
|
|
18
|
+
/** The definition set of `definitions`, in their order, each looked up by its name. */
|
|
19
|
+
export function resourceDefinitionSet(definitions) {
|
|
20
|
+
const lookup = definitionLookup(definitions);
|
|
21
|
+
return {
|
|
22
|
+
definitions,
|
|
23
|
+
reports: resourceReports(lookup),
|
|
24
|
+
presentations: resourcePresentations(lookup),
|
|
25
|
+
applyEvent: (state, timed) => applyRunEvent(definitions, state, timed),
|
|
26
|
+
timeline: (state) => timeline(definitions, state),
|
|
27
|
+
lifecycles: (contexts) => bindLifecycles(lookup, contexts),
|
|
28
|
+
contexts: (env) => resourceContexts(definitions, env),
|
|
29
|
+
[LOOKUP]: lookup,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -51,7 +51,7 @@ export declare function cleanupInstanceSchema(names: readonly string[]): z.ZodTy
|
|
|
51
51
|
* - `ranRows`: the rows `storm runs show` lists for a ran outcome's resources, instance by instance, from its ran
|
|
52
52
|
* records, which storm keeps in `run.json`.
|
|
53
53
|
* - `canceledLines`: what a canceled run changed in its resource instances, for a person, from its cleanup records,
|
|
54
|
-
* 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
|
|
55
55
|
* changed, then what its release finished, then its release's warnings.
|
|
56
56
|
*/
|
|
57
57
|
export interface ResourceReports {
|
|
@@ -1,12 +1,13 @@
|
|
|
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, by the schemas of a map of instances: a `ran` outcome's (`instanceSchema`), each
|
|
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
8
|
// `{ definition, facts, warnings }`, discriminated by `definition`, and the cleanup's (`cleanupInstanceSchema`), each
|
|
9
|
-
// `{ definition, warnings }`. The
|
|
9
|
+
// `{ definition, warnings }`. The definition set builds the reports once (`resourceDefinitionSet`,
|
|
10
|
+
// `resource-definition-set.ts`).
|
|
10
11
|
import { z } from "zod";
|
|
11
12
|
import { warningRows } from "./reports.js";
|
|
12
13
|
/** One warning, as outcomes report it: its reason and its sentence. */
|
|
@@ -39,26 +40,26 @@ export function cleanupInstanceSchema(names) {
|
|
|
39
40
|
}
|
|
40
41
|
/** Every one of `lookup`'s definitions' reports, each instance's from its definition. */
|
|
41
42
|
export function resourceReports(lookup) {
|
|
42
|
-
const { definitions: resources,
|
|
43
|
+
const { definitions: resources, inDefinitionOrder } = lookup;
|
|
43
44
|
// Each warning of `facts`' instances, in order.
|
|
44
|
-
const warningsOf = (facts) =>
|
|
45
|
+
const warningsOf = (facts) => inDefinitionOrder(facts).flatMap(({ record }) => record.warnings.map(({ reason, message }) => ({ reason, message })));
|
|
45
46
|
return {
|
|
46
47
|
cleanupSchema: cleanupInstanceSchema(resources.map(({ name }) => name)),
|
|
47
|
-
// `{ definition, warnings }` for each instance, in
|
|
48
|
-
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 }])),
|
|
49
50
|
cleanupRows: (facts) => warningRows(warningsOf(facts)),
|
|
50
51
|
cleanupWarnings: warningsOf,
|
|
51
52
|
ranSchema: instanceSchema(resources.map(({ name }) => [name, z.unknown()])),
|
|
52
|
-
// `{ definition, facts, warnings }` for each instance, in
|
|
53
|
-
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 } }) => [
|
|
54
55
|
key,
|
|
55
56
|
{ definition, facts, warnings },
|
|
56
57
|
])),
|
|
57
58
|
ranWarnings: warningsOf,
|
|
58
|
-
ranRows: (ran) =>
|
|
59
|
+
ranRows: (ran) => inDefinitionOrder(ran).flatMap(({ record }) => record.rows),
|
|
59
60
|
// The run releases its instances in reverse order, so the cleanup records come in reverse order of the run's
|
|
60
61
|
// instances; reversed, they come in the order the run took them.
|
|
61
|
-
canceledLines: (cleanup) =>
|
|
62
|
+
canceledLines: (cleanup) => inDefinitionOrder(Object.fromEntries(Object.entries(cleanup).toReversed())).flatMap(({ record }) => [
|
|
62
63
|
...record.canceled,
|
|
63
64
|
...record.done,
|
|
64
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
|
@@ -2,11 +2,11 @@ import type { CredentialSource } from "../credential/index.ts";
|
|
|
2
2
|
import type { LaneOutcome } from "../sdk/extension/index.ts";
|
|
3
3
|
import type { RunEvent, RunProgress } from "./events.ts";
|
|
4
4
|
import type { DefinitionLookup } from "./definition-lookup.ts";
|
|
5
|
-
import type { RunInstance, ResourceCleanupRecords, ResourcePayloads, ResourceRanRecords, ResourceRefusal, ResourceRequests,
|
|
5
|
+
import type { RunInstance, ResourceCleanupRecords, ResourcePayloads, ResourceRanRecords, ResourceRefusal, ResourceRequests, ResourceContextMap, RunLane } from "./resource.ts";
|
|
6
6
|
import type { RunStopped } from "./run.ts";
|
|
7
7
|
/**
|
|
8
8
|
* How acquiring one resource instance ended, as the policy ranks it: what its acquire answered stays in the instance.
|
|
9
|
-
* `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`.
|
|
10
10
|
*/
|
|
11
11
|
type InstanceOutcome = {
|
|
12
12
|
readonly kind: "acquired";
|
|
@@ -18,7 +18,7 @@ type InstanceOutcome = {
|
|
|
18
18
|
};
|
|
19
19
|
/** The run's credential source failing a mint a resource instance couldn't go on without. */
|
|
20
20
|
type MintFailedStop = Extract<RunStopped, {
|
|
21
|
-
readonly kind: "
|
|
21
|
+
readonly kind: "mint_failed";
|
|
22
22
|
}>;
|
|
23
23
|
/**
|
|
24
24
|
* Finishes one lane's task: reports how lane `lane` ended, by `outcomeOf` its value or as failed when it throws, and
|
|
@@ -61,9 +61,9 @@ export interface ResourceInstance {
|
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* Each resource `requests` holds, in its order, bound to this run as a resource instance of its definition from
|
|
64
|
-
* `lookup`, over the definition's
|
|
64
|
+
* `lookup`, over the definition's Context from `resourceContexts`.
|
|
65
65
|
*/
|
|
66
|
-
export declare function resourceInstances({ named }: DefinitionLookup,
|
|
66
|
+
export declare function resourceInstances({ named }: DefinitionLookup, resourceContexts: ResourceContextMap, requests: ResourceRequests): readonly ResourceInstance[];
|
|
67
67
|
/**
|
|
68
68
|
* A lane beside the resources: the runner sandbox, readied by the runner. `stopped` is the outcome its value ends the
|
|
69
69
|
* run with, which ranks above every resource's refusal; undefined when it doesn't end the run.
|
|
@@ -95,7 +95,7 @@ export type Acquisition<T> = {
|
|
|
95
95
|
*
|
|
96
96
|
* A throw rethrows, the beside lane's first, then the resources' in order. Otherwise the outcome ranks, the same with
|
|
97
97
|
* or without a lane beside them: the user's `signal` (`canceled`), then the beside lane's failure, then each instance's
|
|
98
|
-
* 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
|
|
99
99
|
* cancellation. A refusal aborts the other instances, so one that stops on that abort answers `canceled`; ranking every
|
|
100
100
|
* refusal above every cancellation keeps the refusal that caused it.
|
|
101
101
|
*/
|
package/dist/core/resources.js
CHANGED
|
@@ -1,24 +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
7
|
/**
|
|
8
8
|
* Each resource `requests` holds, in its order, bound to this run as a resource instance of its definition from
|
|
9
|
-
* `lookup`, over the definition's
|
|
9
|
+
* `lookup`, over the definition's Context from `resourceContexts`.
|
|
10
10
|
*/
|
|
11
|
-
export function resourceInstances({ named },
|
|
12
|
-
return Object.entries(requests).map(([key, request]) => instanceOf(named(request.definition, key), key,
|
|
11
|
+
export function resourceInstances({ named }, resourceContexts, requests) {
|
|
12
|
+
return Object.entries(requests).map(([key, request]) => instanceOf(named(request.definition, key), key, resourceContexts, request));
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* The resource under key `key`, of definition `resource`, bound to this run. It hands the lifecycle only its own
|
|
16
|
-
* definition's
|
|
17
|
-
* 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.
|
|
18
18
|
*/
|
|
19
|
-
function instanceOf(resource, key,
|
|
19
|
+
function instanceOf(resource, key, resourceContexts, request) {
|
|
20
20
|
const { name } = resource;
|
|
21
|
-
const lifecycle = resource.lifecycle(
|
|
21
|
+
const lifecycle = resource.lifecycle(resourceContexts[name]);
|
|
22
22
|
const taken = [];
|
|
23
23
|
let result;
|
|
24
24
|
// What a canceled run says acquiring it changed, once its acquire answered: none for one that never answered, was
|
|
@@ -60,7 +60,7 @@ function instanceOf(resource, key, worlds, request) {
|
|
|
60
60
|
}), resourceLaneOutcome);
|
|
61
61
|
if ("refused" in answered) {
|
|
62
62
|
const outcome = {
|
|
63
|
-
kind: "
|
|
63
|
+
kind: "resource_refused",
|
|
64
64
|
resource: key,
|
|
65
65
|
definition: name,
|
|
66
66
|
refusal: answered,
|
|
@@ -69,7 +69,7 @@ function instanceOf(resource, key, worlds, request) {
|
|
|
69
69
|
}
|
|
70
70
|
if ("mintFailed" in answered) {
|
|
71
71
|
const { failure, target } = answered.mintFailed;
|
|
72
|
-
return { kind: "refused", outcome: { kind: "
|
|
72
|
+
return { kind: "refused", outcome: { kind: "mint_failed", failure, target, runner: false } };
|
|
73
73
|
}
|
|
74
74
|
result = answered;
|
|
75
75
|
canceled = "acquired" in answered ? (answered.acquired.canceled ?? []) : answered.canceled;
|
|
@@ -118,7 +118,7 @@ function instanceOf(resource, key, worlds, request) {
|
|
|
118
118
|
*
|
|
119
119
|
* A throw rethrows, the beside lane's first, then the resources' in order. Otherwise the outcome ranks, the same with
|
|
120
120
|
* or without a lane beside them: the user's `signal` (`canceled`), then the beside lane's failure, then each instance's
|
|
121
|
-
* 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
|
|
122
122
|
* cancellation. A refusal aborts the other instances, so one that stops on that abort answers `canceled`; ranking every
|
|
123
123
|
* refusal above every cancellation keeps the refusal that caused it.
|
|
124
124
|
*/
|