@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
package/dist/core/timeline.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export type TimelineStepName = string;
|
|
|
13
13
|
export interface TimelineStep extends TimelineSpan {
|
|
14
14
|
readonly name: TimelineStepName;
|
|
15
15
|
readonly outcome: TimelineOutcome;
|
|
16
|
+
/** The runner's `upload` step's: how many bytes of changes it uploaded; absent on any other step. */
|
|
17
|
+
readonly bytes?: number;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* The rows of a waterfall, by name: `mint`, the run's one mint; each resource instance's lane, by its lane's name;
|
|
@@ -64,8 +66,8 @@ export interface Timeline {
|
|
|
64
66
|
}
|
|
65
67
|
/**
|
|
66
68
|
* A run's waterfall, from its final state, with each resource lane's row from the progress of `resources`, the
|
|
67
|
-
*
|
|
68
|
-
* event.
|
|
69
|
+
* definition set's resource definitions. A span still running when the run ended is `unfinished`, ending at the run's
|
|
70
|
+
* last event.
|
|
69
71
|
*/
|
|
70
72
|
export declare function timeline(resources: readonly Pick<ResourceDefinition, "name" | "progress">[], state: RunState): Timeline;
|
|
71
73
|
/** A row by its name and its instance's key, as `sameRow` compares them. */
|
package/dist/core/timeline.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// A run's waterfall, projected from its final state: when each lane ran, what it did, how long a ready lane waited
|
|
2
2
|
// for the last one, and the critical path to the command's end. Each resource's progress projects its own lane's row's
|
|
3
|
-
// steps and counts (`ResourceProgress.row`); the core lays out every row.
|
|
3
|
+
// steps and counts (`ResourceProgress.row`); the core lays out every row. Callers project it through the resource
|
|
4
|
+
// definition set (`timeline`, `resource-definition-set.ts`).
|
|
4
5
|
/**
|
|
5
6
|
* A run's waterfall, from its final state, with each resource lane's row from the progress of `resources`, the
|
|
6
|
-
*
|
|
7
|
-
* event.
|
|
7
|
+
* definition set's resource definitions. A span still running when the run ended is `unfinished`, ending at the run's
|
|
8
|
+
* last event.
|
|
8
9
|
*/
|
|
9
10
|
export function timeline(resources, state) {
|
|
10
11
|
const { origin } = state;
|
|
@@ -48,7 +49,13 @@ export function timeline(resources, state) {
|
|
|
48
49
|
.filter((step) => step.status !== "pending" && !(step.name === "snapshot" && runner.snapshot?.kind === "reused"))
|
|
49
50
|
.flatMap((step) => step.startedAt === undefined
|
|
50
51
|
? []
|
|
51
|
-
: [
|
|
52
|
+
: [
|
|
53
|
+
{
|
|
54
|
+
name: step.name,
|
|
55
|
+
...span({ status: step.status, startedAt: step.startedAt, endedAt: step.endedAt }),
|
|
56
|
+
...(step.name === "upload" && runner.uploadBytes !== undefined ? { bytes: runner.uploadBytes } : {}),
|
|
57
|
+
},
|
|
58
|
+
])
|
|
52
59
|
.toSorted((a, b) => a.startMs - b.startMs);
|
|
53
60
|
const snapshot = runner.snapshot?.kind === "building" ? undefined : runner.snapshot?.kind;
|
|
54
61
|
rows.push(row(RUNNER, runner, { steps, snapshot }));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { MintTarget } from "../sdk/extension/index.ts";
|
|
2
|
+
/**
|
|
3
|
+
* A credential source's events: `minting` before its one mint, for `target`; `minted` after it, with whether it gave a
|
|
4
|
+
* credential (`ok`); and `requesting-token` before each GitHub Actions OIDC token request, a refresh included, but not
|
|
5
|
+
* before a retry.
|
|
6
|
+
*/
|
|
7
|
+
export type CredentialEvent = {
|
|
8
|
+
readonly kind: "minting";
|
|
9
|
+
readonly target: MintTarget;
|
|
10
|
+
} | {
|
|
11
|
+
readonly kind: "minted";
|
|
12
|
+
readonly target: MintTarget;
|
|
13
|
+
readonly ok: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
readonly kind: "requesting-token";
|
|
16
|
+
};
|
|
17
|
+
/** Hears a credential source's events. */
|
|
18
|
+
export interface CredentialProgress {
|
|
19
|
+
emit(event: CredentialEvent): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// What a credential source reports as it goes: before and after its mint, and before each GitHub Actions OIDC token
|
|
2
|
+
// request. A run emits them as its own events (`RunEvent` in `core/events.ts` holds them in its union), and the
|
|
3
|
+
// credential launcher resolver turns them into its progress lines (`config/credential-resolver.ts`).
|
|
4
|
+
export {};
|
|
@@ -2,5 +2,6 @@ export { Credential, type CredentialDiagnosis, type CredentialFailure, type Cred
|
|
|
2
2
|
export type { CredentialGateway, GitHubActionsTokenGateway, MintOutcome, TokenAttemptOutcome } from "./gateways.ts";
|
|
3
3
|
export { liveGitHubActionsTokenGateway } from "./live/github-actions-token-gateway.ts";
|
|
4
4
|
export { liveCredentialGateway } from "./live/vercel-cli-gateway.ts";
|
|
5
|
-
export
|
|
5
|
+
export type { CredentialEvent, CredentialProgress } from "./events.ts";
|
|
6
|
+
export { type CredentialContext, type CredentialSourceChoice, credentialSourceFor, type MintSource, REQUESTING_TOKEN_LINE, } from "./source.ts";
|
|
6
7
|
export { mintTargetText } from "./target.ts";
|
package/dist/credential/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
// The `credential` module's public surface. Other modules import only from here. It
|
|
2
|
-
// over its gateways
|
|
3
|
-
//
|
|
4
|
-
//
|
|
1
|
+
// The `credential` module's public surface. Other modules import only from here. It builds every credential source with
|
|
2
|
+
// one factory (`credentialSourceFor`), over its gateways, which reports each mint and token request as a credential
|
|
3
|
+
// event (`CredentialEvent`); the extension API (`src/sdk/extension/`) declares the credential, the sources' shape,
|
|
4
|
+
// their failures and how those are worded, which this surface re-exports for the launcher. It loads no Clinkr, at run
|
|
5
|
+
// time or in its declarations: the credential launcher resolver and the errors a command refuses with live in `config`
|
|
5
6
|
// (`credential-resolver.ts`, `credential-settle.ts`).
|
|
6
7
|
export { Credential, describeCredentialFailure, describeMintFailure, describeTokenRequestFailure, tokenRequestFailureFacts, tokenRequestFailureShape, } from "../sdk/extension/index.js";
|
|
7
8
|
export { liveGitHubActionsTokenGateway } from "./live/github-actions-token-gateway.js";
|
|
8
9
|
export { liveCredentialGateway } from "./live/vercel-cli-gateway.js";
|
|
9
|
-
export { credentialSourceFor,
|
|
10
|
+
export { credentialSourceFor, REQUESTING_TOKEN_LINE, } from "./source.js";
|
|
10
11
|
export { mintTargetText } from "./target.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Credential, CredentialSource, MintTarget } from "../sdk/extension/index.ts";
|
|
1
|
+
import type { Credential, CredentialSource, MintFailed, MintTarget } from "../sdk/extension/index.ts";
|
|
2
|
+
import type { CredentialProgress } from "./events.ts";
|
|
2
3
|
import type { CredentialGateway, GitHubActionsTokenGateway, MintOutcome } from "./gateways.ts";
|
|
3
4
|
/** The progress line a GitHub Actions OIDC token request prints as it starts. */
|
|
4
5
|
export declare const REQUESTING_TOKEN_LINE = "Requesting a GitHub Actions OIDC token\u2026";
|
|
@@ -12,21 +13,6 @@ export type CredentialSourceChoice = {
|
|
|
12
13
|
} | {
|
|
13
14
|
readonly source: "github-actions";
|
|
14
15
|
};
|
|
15
|
-
/**
|
|
16
|
-
* The mint as a credential source: it mints at most once. The first `obtain()` calls `mint`; every later call,
|
|
17
|
-
* concurrent ones included, returns the same outcome. A failed mint is kept like a successful one and never retried
|
|
18
|
-
* within the run. A minted credential lasts 12 hours, longer than any run.
|
|
19
|
-
*
|
|
20
|
-
* `mint` must not reject (`CredentialGateway.mint` never does). If it does anyway, `obtain()` still never throws: it
|
|
21
|
-
* returns the rejected promise, and keeps returning it.
|
|
22
|
-
*/
|
|
23
|
-
export declare function mintSource(target: MintTarget, mint: () => Promise<MintOutcome>): CredentialSource;
|
|
24
|
-
/**
|
|
25
|
-
* A credential the run already holds, as a credential source: `obtain()` hands it back and does nothing else. The
|
|
26
|
-
* run mints `credential` for `target` and its runner sandbox before it acquires its resources, and shares it with them
|
|
27
|
-
* through this.
|
|
28
|
-
*/
|
|
29
|
-
export declare function obtainedSource(target: MintTarget, credential: Credential): CredentialSource;
|
|
30
16
|
/** A clock as a credential source reads it; structural so this module needs no other module's time seams. */
|
|
31
17
|
interface SourceClock {
|
|
32
18
|
now(): Date;
|
|
@@ -36,23 +22,49 @@ interface SourceTimer {
|
|
|
36
22
|
sleep(ms: number, signal?: AbortSignal): Promise<void>;
|
|
37
23
|
}
|
|
38
24
|
/**
|
|
39
|
-
*
|
|
40
|
-
* and
|
|
25
|
+
* What a credential source reaches the world through: the mint, GitHub Actions' OIDC token issuer, the clock a token's
|
|
26
|
+
* age is read from and the timer a token request's retries wait on.
|
|
41
27
|
*/
|
|
42
|
-
export
|
|
28
|
+
export interface CredentialContext {
|
|
43
29
|
readonly credentials: CredentialGateway;
|
|
44
30
|
readonly githubActionsTokens: GitHubActionsTokenGateway;
|
|
45
31
|
readonly clock: SourceClock;
|
|
46
32
|
readonly timer: SourceTimer;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
33
|
+
}
|
|
34
|
+
/** The mint as a credential source: what it fails with is always the mint's failure, with its target. */
|
|
35
|
+
export interface MintSource extends CredentialSource {
|
|
36
|
+
obtain(): Promise<{
|
|
37
|
+
readonly ok: true;
|
|
38
|
+
readonly credential: Credential;
|
|
39
|
+
} | {
|
|
40
|
+
readonly ok: false;
|
|
41
|
+
readonly failure: MintFailed;
|
|
42
|
+
}>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The credential source `choice` names, over `context`, reporting to `progress`: the mint emits `minting` before its
|
|
46
|
+
* one mint and `minted` after it, and a GitHub Actions OIDC token request emits `requesting-token` before each
|
|
47
|
+
* request, refreshes included, not before each retry. Nothing happens until the first `obtain()`. The mint's source
|
|
48
|
+
* mints once and hands every later `obtain()` the same outcome, emitting nothing more.
|
|
49
|
+
*/
|
|
50
|
+
export declare function credentialSourceFor(choice: Extract<CredentialSourceChoice, {
|
|
51
|
+
readonly source: "mint";
|
|
52
|
+
}>, context: CredentialContext, progress: CredentialProgress): MintSource;
|
|
53
|
+
export declare function credentialSourceFor(choice: CredentialSourceChoice, context: CredentialContext, progress: CredentialProgress): CredentialSource;
|
|
54
|
+
/**
|
|
55
|
+
* The mint as a credential source: it mints at most once. The first `obtain()` calls `mint`; every later call,
|
|
56
|
+
* concurrent ones included, returns the same outcome. A failed mint is kept like a successful one and never retried
|
|
57
|
+
* within the run. A minted credential lasts 12 hours, longer than any run.
|
|
58
|
+
*
|
|
59
|
+
* `mint` must not reject (`CredentialGateway.mint` never does). If it does anyway, `obtain()` still never throws: it
|
|
60
|
+
* returns the rejected promise, and keeps returning it.
|
|
61
|
+
*/
|
|
62
|
+
export declare function mintSource(target: MintTarget, mint: () => Promise<MintOutcome>): MintSource;
|
|
51
63
|
/**
|
|
52
64
|
* A GitHub Actions OIDC token request as a credential source. The first `obtain()` requests a token; later ones hand
|
|
53
65
|
* back the same token while it is under 4 minutes old, counting from when its request was sent, and request a new
|
|
54
|
-
* one after. Concurrent `obtain()` calls share one request in flight. `
|
|
55
|
-
* refreshes included, not before each retry.
|
|
66
|
+
* one after. Concurrent `obtain()` calls share one request in flight. It emits `requesting-token` to `progress` before
|
|
67
|
+
* each request, refreshes included, not before each retry.
|
|
56
68
|
*
|
|
57
69
|
* One request makes up to 3 attempts, retrying only a network failure, a timeout or HTTP 502, 503 or 504, after
|
|
58
70
|
* waiting 1s, then 2s, on `timer`. A failure isn't kept: the next `obtain()` requests again. A failed refresh is a
|
|
@@ -62,6 +74,6 @@ export declare function githubActionsSource(context: {
|
|
|
62
74
|
readonly gateway: GitHubActionsTokenGateway;
|
|
63
75
|
readonly clock: SourceClock;
|
|
64
76
|
readonly timer: SourceTimer;
|
|
65
|
-
readonly
|
|
77
|
+
readonly progress: CredentialProgress;
|
|
66
78
|
}): CredentialSource;
|
|
67
79
|
export {};
|
|
@@ -1,5 +1,24 @@
|
|
|
1
|
+
// The credential sources, built by one factory (`credentialSourceFor`) from the credential choice, over the
|
|
2
|
+
// credential gateways, a clock and a timer, reporting each mint and token request to a `CredentialProgress`. The mint
|
|
3
|
+
// source and the GitHub Actions source it builds are exported for this module's own tests only.
|
|
1
4
|
/** The progress line a GitHub Actions OIDC token request prints as it starts. */
|
|
2
5
|
export const REQUESTING_TOKEN_LINE = "Requesting a GitHub Actions OIDC token…";
|
|
6
|
+
export function credentialSourceFor(choice, context, progress) {
|
|
7
|
+
if (choice.source === "github-actions")
|
|
8
|
+
return githubActionsSource({
|
|
9
|
+
gateway: context.githubActionsTokens,
|
|
10
|
+
clock: context.clock,
|
|
11
|
+
timer: context.timer,
|
|
12
|
+
progress,
|
|
13
|
+
});
|
|
14
|
+
const { target } = choice;
|
|
15
|
+
return mintSource(target, async () => {
|
|
16
|
+
await progress.emit({ kind: "minting", target });
|
|
17
|
+
const minted = await context.credentials.mint(target);
|
|
18
|
+
await progress.emit({ kind: "minted", target, ok: minted.ok });
|
|
19
|
+
return minted;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
3
22
|
/**
|
|
4
23
|
* The mint as a credential source: it mints at most once. The first `obtain()` calls `mint`; every later call,
|
|
5
24
|
* concurrent ones included, returns the same outcome. A failed mint is kept like a successful one and never retried
|
|
@@ -15,7 +34,9 @@ export function mintSource(target, mint) {
|
|
|
15
34
|
// The async wrapper turns a synchronous throw from `mint` into a rejection.
|
|
16
35
|
outcome ??= (async () => {
|
|
17
36
|
const minted = await mint();
|
|
18
|
-
return minted.ok
|
|
37
|
+
return minted.ok
|
|
38
|
+
? minted
|
|
39
|
+
: { ok: false, failure: { source: "mint", failure: minted.failure, target } };
|
|
19
40
|
})();
|
|
20
41
|
return outcome;
|
|
21
42
|
},
|
|
@@ -24,36 +45,6 @@ export function mintSource(target, mint) {
|
|
|
24
45
|
},
|
|
25
46
|
};
|
|
26
47
|
}
|
|
27
|
-
/**
|
|
28
|
-
* A credential the run already holds, as a credential source: `obtain()` hands it back and does nothing else. The
|
|
29
|
-
* run mints `credential` for `target` and its runner sandbox before it acquires its resources, and shares it with them
|
|
30
|
-
* through this.
|
|
31
|
-
*/
|
|
32
|
-
export function obtainedSource(target, credential) {
|
|
33
|
-
const outcome = Promise.resolve({ ok: true, credential });
|
|
34
|
-
return {
|
|
35
|
-
obtain: () => outcome,
|
|
36
|
-
origin: () => ({ source: "mint", target }),
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* The credential source `choice` names, over `context`'s gateways: the mint calls `report.onMint` before it mints,
|
|
41
|
-
* and a GitHub Actions OIDC token request calls `report.onRequest` before each request.
|
|
42
|
-
*/
|
|
43
|
-
export function credentialSourceFor(choice, context, report) {
|
|
44
|
-
if (choice.source === "github-actions")
|
|
45
|
-
return githubActionsSource({
|
|
46
|
-
gateway: context.githubActionsTokens,
|
|
47
|
-
clock: context.clock,
|
|
48
|
-
timer: context.timer,
|
|
49
|
-
onRequest: report.onRequest,
|
|
50
|
-
});
|
|
51
|
-
const { target } = choice;
|
|
52
|
-
return mintSource(target, async () => {
|
|
53
|
-
await report.onMint(target);
|
|
54
|
-
return await context.credentials.mint(target);
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
48
|
/** How long a GitHub Actions OIDC token is handed out after its request was sent: it expires after 5 minutes. */
|
|
58
49
|
const TOKEN_REFRESH_MS = 4 * 60_000;
|
|
59
50
|
/** The waits before each retry of a token request: one request makes one attempt more than there are waits. */
|
|
@@ -61,8 +52,8 @@ const RETRY_WAITS_MS = [1_000, 2_000];
|
|
|
61
52
|
/**
|
|
62
53
|
* A GitHub Actions OIDC token request as a credential source. The first `obtain()` requests a token; later ones hand
|
|
63
54
|
* back the same token while it is under 4 minutes old, counting from when its request was sent, and request a new
|
|
64
|
-
* one after. Concurrent `obtain()` calls share one request in flight. `
|
|
65
|
-
* refreshes included, not before each retry.
|
|
55
|
+
* one after. Concurrent `obtain()` calls share one request in flight. It emits `requesting-token` to `progress` before
|
|
56
|
+
* each request, refreshes included, not before each retry.
|
|
66
57
|
*
|
|
67
58
|
* One request makes up to 3 attempts, retrying only a network failure, a timeout or HTTP 502, 503 or 504, after
|
|
68
59
|
* waiting 1s, then 2s, on `timer`. A failure isn't kept: the next `obtain()` requests again. A failed refresh is a
|
|
@@ -72,7 +63,7 @@ export function githubActionsSource(context) {
|
|
|
72
63
|
let held;
|
|
73
64
|
let inFlight;
|
|
74
65
|
const request = async () => {
|
|
75
|
-
await context.
|
|
66
|
+
await context.progress.emit({ kind: "requesting-token" });
|
|
76
67
|
for (let attempt = 1;; attempt += 1) {
|
|
77
68
|
const sentAt = context.clock.now().getTime();
|
|
78
69
|
const outcome = await context.gateway.request();
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import type { Mount } from "@vercel/clinkr";
|
|
2
2
|
import type { StormApp } from "./context.ts";
|
|
3
3
|
import type { ExtensionCommands } from "./sdk/extension/commands.ts";
|
|
4
|
+
/** One extension's command tree, and the command path storm mounts it at. */
|
|
5
|
+
export interface ExtensionCommandsEntry {
|
|
6
|
+
readonly commands: ExtensionCommands<StormApp>;
|
|
7
|
+
/** Where the tree's commands sit in `storm`, such as `["ext", "testserver"]`. */
|
|
8
|
+
readonly path: readonly string[];
|
|
9
|
+
}
|
|
4
10
|
/**
|
|
5
|
-
* Every extension's command tree, in extension order, checked against the app Clinkr hands their
|
|
6
|
-
* commands take something `StormApp` lacks, or holds in another type, fails here.
|
|
11
|
+
* Every extension's command tree, in extension order, with its path, checked against the app Clinkr hands their
|
|
12
|
+
* commands: a tree whose commands take something `StormApp` lacks, or holds in another type, fails here.
|
|
7
13
|
*/
|
|
8
|
-
export declare const EXTENSION_COMMANDS: readonly
|
|
14
|
+
export declare const EXTENSION_COMMANDS: readonly ExtensionCommandsEntry[];
|
|
9
15
|
/**
|
|
10
|
-
* Every extension's command tree, mounted at
|
|
11
|
-
*
|
|
12
|
-
*
|
|
16
|
+
* Every extension's command tree, mounted at its path with its directory under `root`, storm's code root (`src/` or
|
|
17
|
+
* `dist/`), which `application.ts` mounts beside the launcher's own commands (the `ext` group is `commands/ext/`).
|
|
18
|
+
* Clinkr refuses a path that collides with a command of storm's own or another mount.
|
|
13
19
|
*/
|
|
14
20
|
export declare function extensionMounts(root: string): readonly Mount<StormApp>[];
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
// The extensions' own command trees,
|
|
2
|
-
//
|
|
3
|
-
// `command-tree.ts`, which loads no resource: help lists `ext testserver` without loading the registry, the
|
|
4
|
-
// the runner, or the SDK.
|
|
5
|
-
// `
|
|
6
|
-
//
|
|
1
|
+
// The extensions' own command trees, each with the path `application.ts` mounts it at. It is the one file besides the
|
|
2
|
+
// extension registry (`src/extensions.ts`) that names an extension, and it imports only each extension's
|
|
3
|
+
// `command-tree.ts`, which loads no resource: help lists `ext testserver` without loading the extension registry, the
|
|
4
|
+
// resources, the runner, or the SDK. This file places each tree, not its extension: the tree of an extension that
|
|
5
|
+
// brings a resource goes under `ext <name>`, so its storm commands can't collide with storm's own. `.oxlintrc.json`
|
|
6
|
+
// holds this file to `command-tree.ts`; `test/unit/extension-commands.test.ts` holds its list to the extensions'
|
|
7
|
+
// `commands`. `scripts/bundle.js` reads the list from tsc's build to bundle each tree's commands.
|
|
7
8
|
import { testserverExtensionCommands } from "./extensions/testserver/command-tree.js";
|
|
8
9
|
/**
|
|
9
|
-
* Every extension's command tree, in extension order, checked against the app Clinkr hands their
|
|
10
|
-
* commands take something `StormApp` lacks, or holds in another type, fails here.
|
|
10
|
+
* Every extension's command tree, in extension order, with its path, checked against the app Clinkr hands their
|
|
11
|
+
* commands: a tree whose commands take something `StormApp` lacks, or holds in another type, fails here.
|
|
11
12
|
*/
|
|
12
|
-
export const EXTENSION_COMMANDS = [
|
|
13
|
+
export const EXTENSION_COMMANDS = [
|
|
14
|
+
{ commands: testserverExtensionCommands, path: ["ext", "testserver"] },
|
|
15
|
+
];
|
|
13
16
|
/**
|
|
14
|
-
* Every extension's command tree, mounted at
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
+
* Every extension's command tree, mounted at its path with its directory under `root`, storm's code root (`src/` or
|
|
18
|
+
* `dist/`), which `application.ts` mounts beside the launcher's own commands (the `ext` group is `commands/ext/`).
|
|
19
|
+
* Clinkr refuses a path that collides with a command of storm's own or another mount.
|
|
17
20
|
*/
|
|
18
21
|
export function extensionMounts(root) {
|
|
19
|
-
return EXTENSION_COMMANDS.map(({
|
|
22
|
+
return EXTENSION_COMMANDS.map(({ commands, path }) => commands.mount({ path, root }));
|
|
20
23
|
}
|
|
@@ -4,7 +4,7 @@ import type { Clock } from "../../sdk/extension/index.ts";
|
|
|
4
4
|
* What the GitHub fixture repository reaches the outside through: the launcher environment, where its token is,
|
|
5
5
|
* GitHub's REST API, the random suffix a run prefix ends with, and the clock its time comes from.
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface GitHubFixtureRepoContext {
|
|
8
8
|
/** The launcher environment, which holds the token in the variable its `tokenEnv` names. */
|
|
9
9
|
readonly env: Readonly<Record<string, string | undefined>>;
|
|
10
10
|
/** GitHub's REST API. */
|
|
@@ -23,4 +23,4 @@ export declare const githubFixtureRepoDefinition: import("../../sdk/extension/re
|
|
|
23
23
|
readonly description: "Whether the run goes on without the GitHub fixture repository when the launcher environment variable its tokenEnv names is unset, overriding resources.githubFixtureRepo.optional in storm.config.ts; default false. --github-optional=false makes the repository required for this run, so a run without its token is refused with github_token_missing before anything starts. Gives the run the GitHub fixture repository resource, whose repo and tokenEnv only storm.config.ts gives.";
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
}, import("./run/payload.ts").GitHubFixtureRepoPayload, import("./
|
|
26
|
+
}, import("./run/payload.ts").GitHubFixtureRepoPayload, import("./context.ts").GitHubFixtureRepoContext>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// The GitHub fixture repository resource's definition: one `defineResource` call that holds its section
|
|
2
2
|
// `resources.githubFixtureRepo` in `storm.config.ts`, with its option rules (`options.ts`), its payload contract
|
|
3
|
-
// (`payload.ts`, `@vercel/storm/github/payload`), its
|
|
3
|
+
// (`payload.ts`, `@vercel/storm/github/payload`), its Context and its lifecycle, which words its refusals in
|
|
4
4
|
// `refusals.ts`. A config file makes its resource with its resource factory, `githubFixtureRepo({ … })` (`resource.ts`,
|
|
5
5
|
// `@vercel/storm/github`). `config` loads and merges against it; its lifecycle reads the options and their sources
|
|
6
6
|
// before the run starts. It has no progress of its own, its acquire answers no result, so a ran outcome says nothing of
|
|
7
7
|
// it, and it has no commands, so its extension (`extension.ts`) only lists it.
|
|
8
8
|
import { defineResource } from "../../sdk/extension/index.js";
|
|
9
9
|
import { githubFixtureRepoLifecycle } from "./lifecycle.js";
|
|
10
|
-
import {
|
|
10
|
+
import { liveGitHubFixtureRepoContext } from "./live/context.js";
|
|
11
11
|
import { githubFixtureRepoRules } from "./options.js";
|
|
12
12
|
import { GITHUB_FIXTURE_REPO_NAME, githubFixtureRepoPayload } from "./run/payload.js";
|
|
13
13
|
/**
|
|
@@ -24,6 +24,6 @@ export const githubFixtureRepoDefinition = defineResource({
|
|
|
24
24
|
flagPrefix: "github",
|
|
25
25
|
options: githubFixtureRepoRules,
|
|
26
26
|
payload: githubFixtureRepoPayload,
|
|
27
|
-
|
|
27
|
+
context: liveGitHubFixtureRepoContext,
|
|
28
28
|
lifecycle: githubFixtureRepoLifecycle,
|
|
29
29
|
});
|
|
@@ -15,4 +15,4 @@ export declare const githubExtension: import("../../sdk/extension/commands.ts").
|
|
|
15
15
|
readonly description: "Whether the run goes on without the GitHub fixture repository when the launcher environment variable its tokenEnv names is unset, overriding resources.githubFixtureRepo.optional in storm.config.ts; default false. --github-optional=false makes the repository required for this run, so a run without its token is refused with github_token_missing before anything starts. Gives the run the GitHub fixture repository resource, whose repo and tokenEnv only storm.config.ts gives.";
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
}, import("./resource.ts").GitHubFixtureRepoPayload, import("./
|
|
18
|
+
}, import("./resource.ts").GitHubFixtureRepoPayload, import("./context.ts").GitHubFixtureRepoContext>], unknown, readonly []>;
|
|
@@ -5,9 +5,9 @@ export { githubExtension } from "./extension.ts";
|
|
|
5
5
|
export { cleanupFixtureRepo, failureText, FIXTURE_RUN_PREFIX_PATTERN, FIXTURE_RUN_PREFIX_ROOT, type FixtureRepoCleanupFailure, fixtureRepoPayload, type FixtureRepoReleaseFacts, type FixtureRepoRequest, fixtureRunPrefix, type OpenedFixtureRepo, type OpenFixtureRepoOutcome, openFixtureRepo, } from "./fixture-repo.ts";
|
|
6
6
|
export type { DeleteFixtureBranchResult, GitHubFixtureRepoFacts, GitHubFixtureRepoFailure, GitHubFixtureRepoGateway, ListFixtureBranchesResult, ReadFixtureRepoResult, } from "./gateways.ts";
|
|
7
7
|
export { liveGitHubFixtureRepoGateway, type LiveGitHubFixtureRepoOptions } from "./live/fixture-repo-gateway.ts";
|
|
8
|
-
export { GITHUB_API_ORIGIN,
|
|
8
|
+
export { GITHUB_API_ORIGIN, liveGitHubFixtureRepoContext } from "./live/context.ts";
|
|
9
9
|
export { githubFixtureRepoDefinition } from "./definition.ts";
|
|
10
10
|
export { githubFixtureRepo, type GitHubFixtureRepoEntry } from "./resource.ts";
|
|
11
11
|
export { type GitHubFixtureRepoOptions, githubFixtureRepoRules, type GitHubFixtureRepoSources } from "./options.ts";
|
|
12
12
|
export { checkGitHubFixtureRepoPayload, GITHUB_FIXTURE_REPO_NAME, type GitHubFixtureRepoPayload, githubFixtureRepoPayload, } from "./run/payload.ts";
|
|
13
|
-
export type {
|
|
13
|
+
export type { GitHubFixtureRepoContext } from "./context.ts";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// The GitHub fixture repository resource's folder: the repository the run opens before its command and cleans up after
|
|
2
2
|
// it, its definition (`definition.ts`) with its option rules (`options.ts`) and its payload contract (`payload.ts`,
|
|
3
3
|
// `@vercel/storm/github/payload`), its resource factory (`resource.ts`, `@vercel/storm/github`), its lifecycle with how
|
|
4
|
-
// it refuses (`refusals.ts`), what releasing it reports, its gateway, and its
|
|
5
|
-
// GitHub extension (`extension.ts`) lists the definition for the registry (`src/extensions.ts`), the one place
|
|
6
|
-
// this folder that takes it. The rest of what it exports is for tests.
|
|
4
|
+
// it refuses (`refusals.ts`), what releasing it reports, its gateway, and its Context (`context.ts`) and live Context.
|
|
5
|
+
// The GitHub extension (`extension.ts`) lists the definition for the registry (`src/extensions.ts`), the one place
|
|
6
|
+
// outside this folder that takes it. The rest of what it exports is for tests.
|
|
7
7
|
export { fixtureRepoCleanedText, fixtureRepoCleanupFailureText, fixtureRepoCleanupWarnings, githubFixtureRepoReleased, } from "./release.js";
|
|
8
8
|
export { githubFixtureRepoUnavailable, githubTokenMissing } from "./refusals.js";
|
|
9
9
|
export { githubFixtureRepoLifecycle } from "./lifecycle.js";
|
|
10
10
|
export { githubExtension } from "./extension.js";
|
|
11
11
|
export { cleanupFixtureRepo, failureText, FIXTURE_RUN_PREFIX_PATTERN, FIXTURE_RUN_PREFIX_ROOT, fixtureRepoPayload, fixtureRunPrefix, openFixtureRepo, } from "./fixture-repo.js";
|
|
12
12
|
export { liveGitHubFixtureRepoGateway } from "./live/fixture-repo-gateway.js";
|
|
13
|
-
export { GITHUB_API_ORIGIN,
|
|
13
|
+
export { GITHUB_API_ORIGIN, liveGitHubFixtureRepoContext } from "./live/context.js";
|
|
14
14
|
export { githubFixtureRepoDefinition } from "./definition.js";
|
|
15
15
|
export { githubFixtureRepo } from "./resource.js";
|
|
16
16
|
export { githubFixtureRepoRules } from "./options.js";
|
|
@@ -2,13 +2,13 @@ import type { AcquireForRunAnswer, AcquireForRunInput, BeforeRunAnswer, BeforeRu
|
|
|
2
2
|
import { type OpenedFixtureRepo } from "./fixture-repo.ts";
|
|
3
3
|
import type { GitHubFixtureRepoOptions, GitHubFixtureRepoSources } from "./options.ts";
|
|
4
4
|
import type { GitHubFixtureRepoPayload } from "./run/payload.ts";
|
|
5
|
-
import type {
|
|
5
|
+
import type { GitHubFixtureRepoContext } from "./context.ts";
|
|
6
6
|
/** The token its `beforeRun` read from the launcher environment, which the command gets in its run payload. */
|
|
7
7
|
type Secrets = {
|
|
8
8
|
readonly token: string;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
|
-
* The GitHub fixture repository's lifecycle over `
|
|
11
|
+
* The GitHub fixture repository's lifecycle over `context`. Its acquire takes at most one repository, with the token,
|
|
12
12
|
* which never goes into a line it reports.
|
|
13
13
|
* - `acquireForRun` opens the repository (`openFixtureRepo`) with the token its `beforeRun` handed the run, with the
|
|
14
14
|
*run prefix's time from the clock and its suffix from `randomSuffix`; it hands the opened repository to `take` before
|
|
@@ -19,7 +19,7 @@ type Secrets = {
|
|
|
19
19
|
* what that did, each thing it couldn't do a warning, and answers, when it deleted them all, that they are deleted.
|
|
20
20
|
* An acquire that opened none took nothing.
|
|
21
21
|
*/
|
|
22
|
-
export declare function githubFixtureRepoLifecycle(
|
|
22
|
+
export declare function githubFixtureRepoLifecycle(context: GitHubFixtureRepoContext): {
|
|
23
23
|
secrets: ({ options }: {
|
|
24
24
|
readonly options: GitHubFixtureRepoOptions;
|
|
25
25
|
}) => readonly string[];
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
// The GitHub fixture repository resource's lifecycle, over its
|
|
2
|
-
// launcher environment variable its `tokenEnv` names, in the
|
|
3
|
-
// and hides the token as `<token>` in what it prints and writes; without it, an optional repository is
|
|
4
|
-
// required one refuses the run (`github_token_missing`, `refusals.ts`). It never needs the Vercel
|
|
5
|
-
// it checks the token can read the repository and picks the run prefix; releasing it deletes
|
|
6
|
-
// prefix. It has no progress of its own: it reports only lines and warnings (`report`).
|
|
1
|
+
// The GitHub fixture repository resource's lifecycle, over its Context. Before the run starts it reads the token from
|
|
2
|
+
// the launcher environment variable its `tokenEnv` names, in the Context's `env`. With the token, the run uses the
|
|
3
|
+
// repository and hides the token as `<token>` in what it prints and writes; without it, an optional repository is
|
|
4
|
+
// skipped, and a required one refuses the run (`github_token_missing`, `refusals.ts`). It never needs the Vercel
|
|
5
|
+
// credential. Acquiring it checks the token can read the repository and picks the run prefix; releasing it deletes
|
|
6
|
+
// every branch under the run prefix. It has no progress of its own: it reports only lines and warnings (`report`).
|
|
7
7
|
import { cleanupFixtureRepo, fixtureRepoPayload, openFixtureRepo } from "./fixture-repo.js";
|
|
8
8
|
import { githubFixtureRepoUnavailable, githubTokenMissing } from "./refusals.js";
|
|
9
9
|
import { fixtureRepoCleanedText, fixtureRepoCleanupWarnings, githubFixtureRepoReleased } from "./release.js";
|
|
10
10
|
/** The token in the launcher environment variable `tokenEnv` names; none when it is unset or empty. */
|
|
11
|
-
function tokenIn(
|
|
12
|
-
const token =
|
|
11
|
+
function tokenIn(context, tokenEnv) {
|
|
12
|
+
const token = context.env[tokenEnv];
|
|
13
13
|
return token === undefined || token === "" ? undefined : token;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* The GitHub fixture repository's lifecycle over `
|
|
16
|
+
* The GitHub fixture repository's lifecycle over `context`. Its acquire takes at most one repository, with the token,
|
|
17
17
|
* which never goes into a line it reports.
|
|
18
18
|
* - `acquireForRun` opens the repository (`openFixtureRepo`) with the token its `beforeRun` handed the run, with the
|
|
19
19
|
*run prefix's time from the clock and its suffix from `randomSuffix`; it hands the opened repository to `take` before
|
|
@@ -24,16 +24,16 @@ function tokenIn(world, tokenEnv) {
|
|
|
24
24
|
* what that did, each thing it couldn't do a warning, and answers, when it deleted them all, that they are deleted.
|
|
25
25
|
* An acquire that opened none took nothing.
|
|
26
26
|
*/
|
|
27
|
-
export function githubFixtureRepoLifecycle(
|
|
27
|
+
export function githubFixtureRepoLifecycle(context) {
|
|
28
28
|
return {
|
|
29
29
|
// No I/O: the token, when the launcher has it, for a refusal that comes before `beforeRun`.
|
|
30
30
|
secrets: ({ options }) => {
|
|
31
|
-
const token = tokenIn(
|
|
31
|
+
const token = tokenIn(context, options.tokenEnv);
|
|
32
32
|
return token === undefined ? [] : [token];
|
|
33
33
|
},
|
|
34
34
|
beforeRun: async ({ options, sources, }) => {
|
|
35
35
|
const { repo, tokenEnv, optional } = options;
|
|
36
|
-
const token = tokenIn(
|
|
36
|
+
const token = tokenIn(context, tokenEnv);
|
|
37
37
|
if (token !== undefined)
|
|
38
38
|
return { use: { secrets: { token }, needsVercelCredential: false, hiddenVariables: [] } };
|
|
39
39
|
if (optional)
|
|
@@ -43,7 +43,7 @@ export function githubFixtureRepoLifecycle(world) {
|
|
|
43
43
|
return githubTokenMissing({ tokenEnv, repo, requiredBy: sources.optional === "flag" ? "flag" : "config" });
|
|
44
44
|
},
|
|
45
45
|
acquireForRun: async ({ options, secrets, take, report, }) => {
|
|
46
|
-
const opened = await openFixtureRepo(
|
|
46
|
+
const opened = await openFixtureRepo(context, { repo: options.repo, token: secrets.token }, { startedAt: context.clock.now(), suffix: context.randomSuffix() });
|
|
47
47
|
if (opened.kind === "unavailable")
|
|
48
48
|
return githubFixtureRepoUnavailable({
|
|
49
49
|
repo: opened.repo,
|
|
@@ -59,7 +59,7 @@ export function githubFixtureRepoLifecycle(world) {
|
|
|
59
59
|
// An acquire takes at most one GitHub fixture repository.
|
|
60
60
|
if (repo === undefined)
|
|
61
61
|
return { nothingTaken: true };
|
|
62
|
-
const cleaned = await cleanupFixtureRepo(
|
|
62
|
+
const cleaned = await cleanupFixtureRepo(context, repo);
|
|
63
63
|
await report.cleanup(fixtureRepoCleanedText(repo.nameWithOwner, cleaned));
|
|
64
64
|
for (const { reason, message } of fixtureRepoCleanupWarnings(cleaned))
|
|
65
65
|
await report.warning(reason, message);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LauncherContext } from "../../../sdk/extension/index.ts";
|
|
2
|
+
import type { GitHubFixtureRepoContext } from "../context.ts";
|
|
3
|
+
/** GitHub's REST API origin, which the GitHub fixture repository resource calls. */
|
|
4
|
+
export declare const GITHUB_API_ORIGIN = "https://api.github.com";
|
|
5
|
+
/** The GitHub fixture repository's Context, live, over the launcher environment. */
|
|
6
|
+
export declare function liveGitHubFixtureRepoContext({ env, clock }: LauncherContext): GitHubFixtureRepoContext;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// The GitHub fixture repository resource's live Context: the launcher environment, GitHub's REST API at
|
|
2
|
+
// `api.github.com`, with a 10-second timeout per call, 8 random hex digits for a run prefix's suffix, and the
|
|
3
|
+
// launcher's clock, which a run prefix's time comes from.
|
|
4
|
+
import { randomBytes } from "node:crypto";
|
|
5
|
+
import { liveGitHubFixtureRepoGateway } from "./fixture-repo-gateway.js";
|
|
6
|
+
/** GitHub's REST API origin, which the GitHub fixture repository resource calls. */
|
|
7
|
+
export const GITHUB_API_ORIGIN = "https://api.github.com";
|
|
8
|
+
/** The GitHub fixture repository's Context, live, over the launcher environment. */
|
|
9
|
+
export function liveGitHubFixtureRepoContext({ env, clock }) {
|
|
10
|
+
return {
|
|
11
|
+
env,
|
|
12
|
+
githubFixtureRepos: liveGitHubFixtureRepoGateway({ origin: GITHUB_API_ORIGIN, timeoutMs: 10_000 }),
|
|
13
|
+
randomSuffix: () => randomBytes(4).toString("hex"),
|
|
14
|
+
clock,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -31,6 +31,6 @@ export declare const githubFixtureRepo: import("../../sdk/extension/resource-fac
|
|
|
31
31
|
readonly description: "Whether the run goes on without the GitHub fixture repository when the launcher environment variable its tokenEnv names is unset, overriding resources.githubFixtureRepo.optional in storm.config.ts; default false. --github-optional=false makes the repository required for this run, so a run without its token is refused with github_token_missing before anything starts. Gives the run the GitHub fixture repository resource, whose repo and tokenEnv only storm.config.ts gives.";
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
}, import("./run/payload.ts").GitHubFixtureRepoPayload, import("./
|
|
34
|
+
}, import("./run/payload.ts").GitHubFixtureRepoPayload, import("./context.ts").GitHubFixtureRepoContext>>;
|
|
35
35
|
/** The GitHub fixture repository resource's entry, which `githubFixtureRepo()` makes for `resources.githubFixtureRepo`. */
|
|
36
36
|
export type GitHubFixtureRepoEntry = ReturnType<typeof githubFixtureRepo>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type PlaywrightListGateway } from "./plan/plan.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The Playwright driver's Context: what its plan step reaches Playwright on this machine through, to count the tests.
|
|
4
|
+
*/
|
|
5
|
+
export interface PlaywrightDriverContext {
|
|
6
|
+
readonly list: PlaywrightListGateway;
|
|
7
|
+
}
|
|
8
|
+
export declare const playwrightDriver: import("../../sdk/extension/driver.ts").Driver<"playwright", PlaywrightDriverContext>;
|