@cnc-tools/storm 0.14.2 → 0.16.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/application.js +3 -1
- package/dist/bin/storm.js +9 -7
- package/dist/build-info.js +1 -1
- package/dist/chunks/chunk-2MAD5NKK.js +108 -0
- package/dist/chunks/{chunk-HDL4WKIB.js → chunk-3L52KNQA.js} +2 -2
- package/dist/chunks/{chunk-GSC6SRTW.js → chunk-5CCP36QQ.js} +1 -1
- package/dist/chunks/{chunk-43MWZLJR.js → chunk-5VXBKPW6.js} +1 -1
- package/dist/chunks/chunk-7EENF73W.js +782 -0
- package/dist/chunks/{chunk-RA4L2ACU.js → chunk-AWBSONHB.js} +88 -34
- package/dist/chunks/chunk-CK2GZEPK.js +40 -0
- package/dist/chunks/{chunk-BRUIATTR.js → chunk-CN4EFA5J.js} +59 -12
- package/dist/chunks/{chunk-I7AN3DIJ.js → chunk-DC2CDHNK.js} +1928 -738
- package/dist/chunks/{chunk-UUBZTGLV.js → chunk-DWEAHX4T.js} +140 -130
- package/dist/chunks/{chunk-T6AZIDZD.js → chunk-F6N34UWB.js} +12 -244
- package/dist/chunks/chunk-FCQUJDA4.js +963 -0
- package/dist/chunks/{chunk-VH2POPW5.js → chunk-FOZWA52V.js} +635 -79
- package/dist/chunks/{chunk-XZCDA5PE.js → chunk-G3PHMXH5.js} +7 -2
- package/dist/chunks/{chunk-3HBPNQ4Y.js → chunk-HVNK3I45.js} +2 -2
- package/dist/chunks/chunk-OIY3DMF2.js +74 -0
- package/dist/chunks/{chunk-GJOEPJJL.js → chunk-P357TZAY.js} +446 -52
- package/dist/chunks/{chunk-UC6DULWY.js → chunk-R7XVBZOY.js} +130 -39
- package/dist/chunks/chunk-TJNFVNKR.js +246 -0
- package/dist/chunks/{chunk-RUPD4TLT.js → chunk-V4IKA3WI.js} +198 -63
- package/dist/chunks/{chunk-BW2ADH7U.js → chunk-VUPZH7J2.js} +1 -1
- package/dist/chunks/{chunk-LUOHJ3LB.js → chunk-Z5PBVG3Y.js} +1131 -468
- package/dist/chunks/{chunk-GQIL3AHY.js → chunk-ZG3WQ4UF.js} +1 -1
- package/dist/chunks/{live-app-SZGEILCQ.js → live-app-WECQOQ4C.js} +28 -23
- package/dist/command-tree.d.ts +2 -2
- package/dist/command-tree.js +2 -2
- package/dist/commands/exec/across-sandboxes-outcomes.d.ts +364 -0
- package/dist/commands/exec/across-sandboxes-outcomes.js +230 -0
- package/dist/commands/exec/across-sandboxes-run.d.ts +180 -0
- package/dist/commands/exec/across-sandboxes-run.js +339 -0
- package/dist/commands/exec/command.d.ts +583 -75
- package/dist/commands/exec/command.js +165 -32
- package/dist/commands/exec/driver-plan.d.ts +8 -2
- package/dist/commands/exec/driver-plan.js +13 -3
- package/dist/commands/exec/exec-words.d.ts +17 -3
- package/dist/commands/exec/exec-words.js +27 -16
- package/dist/commands/exec/live-view.d.ts +3 -4
- package/dist/commands/exec/live-view.js +37 -28
- package/dist/commands/exec/metadata.js +2 -2
- package/dist/commands/exec/mint-failed.d.ts +4 -4
- package/dist/commands/exec/mint-failed.js +6 -6
- package/dist/commands/exec/outcomes.d.ts +533 -73
- package/dist/commands/exec/outcomes.js +203 -67
- package/dist/commands/exec/plan-only.d.ts +10 -0
- package/dist/commands/exec/plan-only.js +45 -0
- package/dist/commands/exec/plan-run.d.ts +54 -35
- package/dist/commands/exec/plan-run.js +81 -38
- package/dist/commands/exec/planned-outcome.d.ts +15 -0
- package/dist/commands/exec/planned-outcome.js +42 -0
- package/dist/commands/exec/progress.d.ts +2 -2
- package/dist/commands/exec/progress.js +35 -18
- package/dist/commands/exec/resource-refusals.d.ts +2 -2
- package/dist/commands/exec/resource-refusals.js +3 -3
- package/dist/commands/exec/run-bin.d.ts +1 -1
- package/dist/commands/exec/run-bin.js +2 -2
- package/dist/commands/exec/run-command.d.ts +344 -63
- package/dist/commands/exec/run-command.js +312 -263
- package/dist/commands/exec/run-metadata.d.ts +42 -8
- package/dist/commands/exec/run-metadata.js +40 -21
- package/dist/commands/exec/run-planned.d.ts +20 -0
- package/dist/commands/exec/run-planned.js +22 -0
- package/dist/commands/exec/sandbox-lines.d.ts +42 -0
- package/dist/commands/exec/sandbox-lines.js +59 -0
- package/dist/commands/exec/sandbox-progress.d.ts +30 -0
- package/dist/commands/exec/sandbox-progress.js +232 -0
- package/dist/commands/exec/sandbox-view.d.ts +19 -0
- package/dist/commands/exec/sandbox-view.js +72 -0
- package/dist/commands/exec/view.d.ts +3 -2
- package/dist/commands/exec/view.js +10 -6
- package/dist/commands/runs/facts.d.ts +53 -10
- package/dist/commands/runs/facts.js +60 -32
- package/dist/commands/runs/list/command.d.ts +82 -4
- package/dist/commands/runs/list/command.js +11 -10
- package/dist/commands/runs/list/metadata.js +1 -1
- package/dist/commands/runs/list/outcomes.d.ts +41 -2
- package/dist/commands/runs/logs/command.d.ts +109 -10
- package/dist/commands/runs/logs/command.js +139 -24
- package/dist/commands/runs/logs/metadata.d.ts +4 -0
- package/dist/commands/runs/logs/metadata.js +14 -7
- package/dist/commands/runs/logs/outcomes.d.ts +52 -3
- package/dist/commands/runs/logs/outcomes.js +110 -6
- package/dist/commands/runs/past-run.d.ts +91 -11
- package/dist/commands/runs/past-run.js +149 -9
- package/dist/commands/runs/show/command.d.ts +574 -12
- package/dist/commands/runs/show/command.js +634 -119
- package/dist/commands/runs/show/metadata.d.ts +17 -0
- package/dist/commands/runs/show/metadata.js +48 -7
- package/dist/commands/runs/show/outcomes.d.ts +279 -6
- package/dist/commands/runs/show/outcomes.js +484 -96
- package/dist/commands/snapshots/build/command.d.ts +109 -18
- package/dist/commands/snapshots/build/command.js +72 -36
- package/dist/commands/snapshots/build/metadata.d.ts +4 -0
- package/dist/commands/snapshots/build/metadata.js +5 -1
- package/dist/commands/snapshots/build/outcomes.d.ts +53 -8
- package/dist/commands/snapshots/build/outcomes.js +26 -3
- package/dist/commands/snapshots/list/command.d.ts +72 -7
- package/dist/commands/snapshots/list/command.js +57 -24
- package/dist/commands/snapshots/list/metadata.d.ts +4 -0
- package/dist/commands/snapshots/list/metadata.js +5 -1
- package/dist/commands/snapshots/list/outcomes.d.ts +31 -0
- package/dist/commands/snapshots/list/outcomes.js +25 -2
- package/dist/commands/suites/list/command.d.ts +129 -0
- package/dist/commands/suites/list/command.js +163 -0
- package/dist/commands/suites/list/metadata.d.ts +11 -0
- package/dist/commands/suites/list/metadata.js +15 -0
- package/dist/commands/suites/list/outcomes.d.ts +91 -0
- package/dist/commands/suites/list/outcomes.js +122 -0
- package/dist/commands/suites/metadata.js +8 -0
- package/dist/commands/test/command.d.ts +1395 -0
- package/dist/commands/test/command.js +581 -0
- package/dist/commands/test/metadata.js +8 -0
- package/dist/commands/test/outcomes.d.ts +768 -0
- package/dist/commands/test/outcomes.js +140 -0
- package/dist/commands/test/plan.d.ts +92 -0
- package/dist/commands/test/plan.js +125 -0
- package/dist/commands/test/test-words.d.ts +12 -0
- package/dist/commands/test/test-words.js +42 -0
- package/dist/config/check-resources.d.ts +14 -0
- package/dist/config/check-resources.js +98 -0
- package/dist/config/check-runner.d.ts +15 -0
- package/dist/config/check-runner.js +79 -0
- package/dist/config/check-suites.d.ts +14 -0
- package/dist/config/check-suites.js +100 -0
- package/dist/config/gateways.d.ts +31 -3
- package/dist/config/index.d.ts +8 -6
- package/dist/config/index.js +5 -4
- package/dist/config/live/config-gateway.js +5 -2
- package/dist/config/live/file-lists-file-gateway.d.ts +4 -0
- package/dist/config/live/file-lists-file-gateway.js +27 -0
- package/dist/config/load.d.ts +32 -14
- package/dist/config/load.js +162 -116
- package/dist/config/resolve.d.ts +3 -2
- package/dist/config/resolve.js +6 -3
- package/dist/config/resolver.d.ts +20 -6
- package/dist/config/resolver.js +11 -8
- package/dist/config/runner.d.ts +23 -0
- package/dist/config/runner.js +4 -0
- package/dist/config/schema.d.ts +39 -19
- package/dist/config/schema.js +50 -10
- package/dist/config/settings-file.d.ts +9 -3
- package/dist/config/settings-file.js +41 -4
- package/dist/config/suite.d.ts +39 -0
- package/dist/config/suite.js +5 -0
- package/dist/config/typed-options.d.ts +1 -6
- package/dist/config/typed-options.js +2 -10
- package/dist/config-file/define.d.ts +45 -24
- package/dist/config-file/define.js +9 -8
- package/dist/config-file/runner.d.ts +11 -0
- package/dist/config-file/runner.js +9 -0
- package/dist/config-file/toolchain.d.ts +13 -7
- package/dist/config-file/toolchain.js +51 -35
- package/dist/context.d.ts +12 -8
- package/dist/context.js +9 -3
- package/dist/core/across-sandboxes.d.ts +43 -0
- package/dist/core/across-sandboxes.js +319 -0
- package/dist/core/before-run.d.ts +5 -3
- package/dist/core/before-run.js +12 -1
- package/dist/core/events.d.ts +62 -6
- package/dist/core/events.js +14 -0
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.js +3 -1
- package/dist/core/payload.d.ts +2 -1
- package/dist/core/payload.js +2 -1
- package/dist/core/presentations.js +1 -1
- package/dist/core/resource.d.ts +1 -1
- package/dist/core/resources.d.ts +56 -6
- package/dist/core/resources.js +81 -5
- package/dist/core/run-state.js +9 -0
- package/dist/core/run.d.ts +77 -15
- package/dist/core/run.js +150 -86
- package/dist/core/sandbox-end.d.ts +64 -0
- package/dist/core/sandbox-end.js +128 -0
- package/dist/core/timeline.d.ts +4 -4
- package/dist/core/timeline.js +3 -3
- package/dist/credential/live/vercel-cli-gateway.d.ts +7 -0
- package/dist/credential/live/vercel-cli-gateway.js +14 -1
- package/dist/extensions/github/context.d.ts +1 -1
- package/dist/extensions/github/definition.d.ts +11 -9
- package/dist/extensions/github/definition.js +8 -6
- package/dist/extensions/github/extension.d.ts +3 -3
- package/dist/extensions/github/fixture-repo.d.ts +21 -2
- package/dist/extensions/github/fixture-repo.js +31 -2
- package/dist/extensions/github/index.d.ts +2 -2
- package/dist/extensions/github/index.js +2 -2
- package/dist/extensions/github/lifecycle.d.ts +16 -6
- package/dist/extensions/github/lifecycle.js +42 -25
- package/dist/extensions/github/options.d.ts +17 -11
- package/dist/extensions/github/options.js +14 -13
- package/dist/extensions/github/refusals.d.ts +23 -6
- package/dist/extensions/github/refusals.js +34 -12
- package/dist/extensions/github/resource.d.ts +21 -12
- package/dist/extensions/github/resource.js +16 -8
- package/dist/extensions/github/run/payload.d.ts +6 -6
- package/dist/extensions/github/run/payload.js +3 -5
- package/dist/extensions/github/split.d.ts +10 -0
- package/dist/extensions/github/split.js +12 -0
- package/dist/extensions/playwright/driver.js +6 -26
- package/dist/extensions/playwright/extension.js +1 -1
- package/dist/extensions/testserver/commands/pool/create/command.js +8 -8
- package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
- package/dist/extensions/testserver/definition.d.ts +4 -4
- package/dist/extensions/testserver/definition.js +41 -31
- package/dist/extensions/testserver/extension.d.ts +4 -5
- package/dist/extensions/testserver/extension.js +14 -41
- package/dist/extensions/testserver/index.d.ts +1 -1
- package/dist/extensions/testserver/index.js +1 -1
- package/dist/extensions/testserver/lifecycle.d.ts +10 -2
- package/dist/extensions/testserver/lifecycle.js +29 -6
- package/dist/extensions/testserver/options/rules.d.ts +5 -5
- package/dist/extensions/testserver/options/rules.js +10 -8
- package/dist/extensions/testserver/options/sandboxes.d.ts +4 -2
- package/dist/extensions/testserver/options/sandboxes.js +8 -3
- package/dist/extensions/testserver/pool/gateways.d.ts +29 -4
- package/dist/extensions/testserver/pool/index.d.ts +2 -2
- package/dist/extensions/testserver/pool/index.js +1 -1
- package/dist/extensions/testserver/pool/lease.d.ts +10 -0
- package/dist/extensions/testserver/pool/lease.js +21 -0
- package/dist/extensions/testserver/pool/live/pool-store-gateway.js +38 -3
- package/dist/extensions/testserver/refusals.d.ts +12 -0
- package/dist/extensions/testserver/refusals.js +18 -0
- package/dist/extensions/testserver/release.d.ts +16 -0
- package/dist/extensions/testserver/release.js +56 -4
- package/dist/extensions/testserver/resource.d.ts +6 -6
- package/dist/extensions/testserver/resource.js +3 -3
- package/dist/extensions/testserver/split.d.ts +9 -0
- package/dist/extensions/testserver/split.js +22 -0
- package/dist/extensions/testserver/vitest/fixtures.d.ts +5 -5
- package/dist/extensions/testserver/vitest/fixtures.js +9 -38
- package/dist/extensions/vitest/driver.d.ts +7 -0
- package/dist/extensions/vitest/driver.js +33 -37
- package/dist/extensions/vitest/extension.js +1 -1
- package/dist/extensions/vitest/plan/plan-over.d.ts +8 -1
- package/dist/extensions/vitest/plan/plan-over.js +16 -2
- package/dist/extensions.d.ts +17 -16
- package/dist/extensions.js +5 -4
- package/dist/forward-sigterm.js +1 -1
- package/dist/launcher-resolvers/local-services.d.ts +1 -1
- package/dist/live-app.js +4 -3
- package/dist/local-services.js +1 -1
- package/dist/planning/driver-file-lists.d.ts +61 -0
- package/dist/planning/driver-file-lists.js +66 -0
- package/dist/{commands/exec → planning}/driver-refusals.d.ts +11 -10
- package/dist/{commands/exec → planning}/driver-refusals.js +18 -14
- package/dist/planning/file-lists-file.d.ts +58 -0
- package/dist/planning/file-lists-file.js +105 -0
- package/dist/planning/file-lists.d.ts +28 -0
- package/dist/planning/file-lists.js +52 -0
- package/dist/{commands/exec → planning}/final-results.d.ts +1 -1
- package/dist/{commands/exec → planning}/final-results.js +6 -6
- package/dist/planning/plan-only.d.ts +84 -0
- package/dist/planning/plan-only.js +86 -0
- package/dist/{commands/exec → planning}/redaction.d.ts +2 -2
- package/dist/{commands/exec → planning}/redaction.js +5 -4
- package/dist/{commands/exec → planning}/resource-flags.d.ts +5 -12
- package/dist/{commands/exec → planning}/resource-flags.js +6 -16
- package/dist/planning/run-kind-flags.d.ts +20 -0
- package/dist/planning/run-kind-flags.js +48 -0
- package/dist/planning/run-plan.d.ts +29 -0
- package/dist/planning/run-plan.js +4 -0
- package/dist/planning/sandbox-placeholders.d.ts +22 -0
- package/dist/planning/sandbox-placeholders.js +60 -0
- package/dist/planning/suite-not-found.d.ts +37 -0
- package/dist/planning/suite-not-found.js +36 -0
- package/dist/planning/suites.d.ts +43 -0
- package/dist/planning/suites.js +89 -0
- package/dist/{commands/exec → planning}/test-plan.d.ts +8 -3
- package/dist/{commands/exec → planning}/test-plan.js +32 -5
- package/dist/playwright/reporter.d.ts +20 -8
- package/dist/playwright/reporter.js +195 -15
- package/dist/presentation.d.ts +10 -6
- package/dist/presentation.js +13 -15
- package/dist/run-directory/gateways.d.ts +60 -4
- package/dist/run-directory/index.d.ts +4 -4
- package/dist/run-directory/index.js +2 -1
- package/dist/run-directory/live/run-directory-gateway.js +92 -16
- package/dist/run-directory/plan.d.ts +35 -2
- package/dist/run-directory/plan.js +44 -7
- package/dist/run-directory/reader.d.ts +26 -5
- package/dist/run-directory/reader.js +24 -1
- package/dist/run-directory/recording.d.ts +75 -49
- package/dist/run-directory/recording.js +214 -28
- package/dist/run-directory/run-directory.d.ts +22 -1
- package/dist/run-directory/run-directory.js +24 -0
- package/dist/run-directory/run-record.d.ts +144 -21
- package/dist/run-directory/run-record.js +118 -19
- package/dist/run-directory/timeline-facts.js +4 -4
- package/dist/runner/base.d.ts +0 -6
- package/dist/runner/base.js +0 -15
- package/dist/runner/build-snapshots.d.ts +7 -7
- package/dist/runner/build-snapshots.js +19 -24
- package/dist/runner/events.d.ts +29 -8
- package/dist/runner/gateways.d.ts +54 -6
- package/dist/runner/index.d.ts +6 -4
- package/dist/runner/index.js +3 -2
- package/dist/runner/live/sandbox-gateway.js +173 -31
- package/dist/runner/network-policy.d.ts +55 -0
- package/dist/runner/network-policy.js +46 -0
- package/dist/runner/policy-writes.d.ts +40 -0
- package/dist/runner/policy-writes.js +124 -0
- package/dist/runner/prepare.d.ts +16 -16
- package/dist/runner/prepare.js +11 -12
- package/dist/runner/ready.d.ts +39 -10
- package/dist/runner/ready.js +59 -47
- package/dist/runner/recipe-check.d.ts +6 -0
- package/dist/runner/recipe-check.js +29 -0
- package/dist/runner/recipe-secrets.d.ts +67 -0
- package/dist/runner/recipe-secrets.js +230 -0
- package/dist/runner/recipe.d.ts +151 -63
- package/dist/runner/recipe.js +277 -200
- package/dist/runner/sandboxed-command.d.ts +22 -8
- package/dist/runner/sandboxed-command.js +33 -10
- package/dist/runner/scope.d.ts +107 -21
- package/dist/runner/scope.js +274 -54
- package/dist/runner/secrets.d.ts +42 -31
- package/dist/runner/secrets.js +62 -40
- package/dist/runner/session.d.ts +59 -26
- package/dist/runner/session.js +82 -41
- package/dist/runner/snapshot-build.d.ts +8 -5
- package/dist/runner/snapshot-build.js +56 -29
- package/dist/runner/snapshot-choice.d.ts +37 -0
- package/dist/runner/snapshot-choice.js +38 -0
- package/dist/runner/snapshot-inspect.d.ts +4 -4
- package/dist/runner/snapshot-inspect.js +7 -7
- package/dist/runner/snapshot-key.d.ts +27 -17
- package/dist/runner/snapshot-key.js +51 -26
- package/dist/runner/steps.d.ts +13 -5
- package/dist/runner/steps.js +34 -4
- package/dist/runner/time-limit.d.ts +10 -0
- package/dist/runner/time-limit.js +43 -0
- package/dist/sdk/extension/commands.d.ts +1 -7
- package/dist/sdk/extension/driver.d.ts +39 -46
- package/dist/sdk/extension/driver.js +6 -6
- package/dist/sdk/extension/index.d.ts +3 -3
- package/dist/sdk/extension/index.js +3 -4
- package/dist/sdk/extension/lifecycle.d.ts +52 -9
- package/dist/sdk/extension/lifecycle.js +1 -1
- package/dist/sdk/extension/resource-definition.d.ts +16 -12
- package/dist/sdk/extension/resource-definition.js +10 -4
- package/dist/sdk/extension/resource-factory.js +3 -4
- package/dist/sdk/extension/resource.d.ts +2 -2
- package/dist/sdk/extension/secret-source.d.ts +58 -0
- package/dist/sdk/extension/secret-source.js +78 -0
- package/dist/sdk/index.d.ts +2 -2
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/run/launcher.d.ts +1 -1
- package/dist/sdk/run/launcher.js +1 -1
- package/dist/sdk/run/payload.d.ts +16 -1
- package/dist/sdk/run/payload.js +17 -2
- package/dist/sdk/run/present.d.ts +3 -3
- package/dist/sdk/run/present.js +1 -3
- package/dist/sdk/run/redact.js +2 -2
- package/dist/sdk/run/test-events.d.ts +23 -6
- package/dist/sdk/run/test-events.js +6 -4
- package/dist/sdk/run/test-result-writer.d.ts +8 -3
- package/dist/sdk/run/test-result-writer.js +22 -2
- package/dist/{commands/exec → shared}/cleanup.d.ts +3 -3
- package/dist/{commands/exec → shared}/cleanup.js +11 -6
- package/dist/shared/job-summary.d.ts +19 -0
- package/dist/{commands/exec → shared}/job-summary.js +17 -0
- package/dist/shared/sandbox-table.d.ts +48 -0
- package/dist/shared/sandbox-table.js +109 -0
- package/dist/{commands/exec → shared}/snapshot-text.d.ts +1 -1
- package/dist/{commands/exec → shared}/tests-summary.d.ts +22 -6
- package/dist/{commands/exec → shared}/tests-summary.js +74 -31
- package/dist/{commands/exec → shared}/text.d.ts +7 -2
- package/dist/{commands/exec → shared}/text.js +9 -1
- package/dist/{commands/exec → shared}/waterfall.d.ts +8 -6
- package/dist/{commands/exec → shared}/waterfall.js +71 -24
- package/dist/shared/worker-chart.d.ts +172 -0
- package/dist/shared/worker-chart.js +623 -0
- package/dist/vitest/config.d.ts +35 -11
- package/dist/vitest/config.js +47 -14
- package/dist/vitest/index.d.ts +1 -1
- package/dist/vitest/index.js +3 -3
- package/dist/vitest/sequencer.d.ts +23 -0
- package/dist/vitest/sequencer.js +73 -0
- package/dist/vitest/setup.d.ts +1 -0
- package/dist/vitest/setup.js +34 -0
- package/dist/vitest/test-events.d.ts +32 -6
- package/dist/vitest/test-events.js +25 -5
- package/dist/vitest/test-results.d.ts +8 -3
- package/dist/vitest/test-results.js +6 -0
- package/package.json +7 -2
- package/skills/overview.md +23 -17
- package/skills/plan-runs.md +67 -0
- package/skills/read-run-output.md +51 -19
- package/dist/chunks/chunk-E3QU74NX.js +0 -49
- package/dist/chunks/chunk-HP54VHGY.js +0 -201
- package/dist/chunks/chunk-NMVODY3P.js +0 -19
- package/dist/chunks/chunk-TVMEKVOW.js +0 -607
- package/dist/commands/exec/define-run-command.d.ts +0 -671
- package/dist/commands/exec/define-run-command.js +0 -91
- package/dist/commands/exec/job-summary.d.ts +0 -10
- package/dist/commands/exec/worker-chart.d.ts +0 -87
- package/dist/commands/exec/worker-chart.js +0 -343
- package/dist/commands/playwright/command.d.ts +0 -661
- package/dist/commands/playwright/command.js +0 -31
- package/dist/commands/playwright/metadata.js +0 -8
- package/dist/commands/vitest/command.d.ts +0 -662
- package/dist/commands/vitest/command.js +0 -31
- package/dist/commands/vitest/metadata.js +0 -8
- package/dist/config/recipe-run.d.ts +0 -26
- package/dist/config/recipe-run.js +0 -27
- package/dist/sdk/extension/ci.d.ts +0 -2
- package/dist/sdk/extension/ci.js +0 -6
- package/dist/chunks/{chunk-YM6TZV4L.js → chunk-VL7WFTVQ.js} +52 -52
- package/dist/commands/{playwright → suites}/metadata.d.ts +1 -1
- package/dist/commands/{vitest → test}/metadata.d.ts +1 -1
- /package/dist/{commands → shared}/dashboard.d.ts +0 -0
- /package/dist/{commands → shared}/dashboard.js +0 -0
- /package/dist/{commands/exec → shared}/snapshot-text.js +0 -0
|
@@ -43,13 +43,16 @@ export type NoSecrets = Readonly<Record<never, string>>;
|
|
|
43
43
|
/**
|
|
44
44
|
* What a run uses a resource with, once its `beforeRun` lets the run go on: the secrets it hands the run, by name,
|
|
45
45
|
* which the run hides as `<token>` and hands its `acquireForRun`; whether it needs the Vercel credential, which the
|
|
46
|
-
* launcher chooses a source for (`--credential`) only when one of the run's resources does;
|
|
46
|
+
* launcher chooses a source for (`--credential`) only when one of the run's resources does; whether it needs a runner
|
|
47
|
+
* sandbox (`needsRunnerSandbox`), true for a resource whose acquire answers sandbox credentials, which only a runner
|
|
48
|
+
* sandbox's firewall can add, so the launcher refuses a run with no runner sandbox before it starts; and the launcher
|
|
47
49
|
* environment's variables it hides from the command (`hiddenVariables`), which the launcher leaves out of the
|
|
48
50
|
* command's environment.
|
|
49
51
|
*/
|
|
50
52
|
export interface ResourceUse<Secrets> {
|
|
51
53
|
readonly secrets: Secrets;
|
|
52
54
|
readonly needsVercelCredential: boolean;
|
|
55
|
+
readonly needsRunnerSandbox: boolean;
|
|
53
56
|
readonly hiddenVariables: readonly string[];
|
|
54
57
|
}
|
|
55
58
|
/**
|
|
@@ -121,15 +124,33 @@ export interface ResultAnswer<Facts> {
|
|
|
121
124
|
readonly facts: Facts;
|
|
122
125
|
readonly rows: readonly Row[];
|
|
123
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* A sandbox credential: a secret a sandbox's firewall adds, outside the sandbox, as the header `header` to the
|
|
129
|
+
* sandbox's requests to `domain` while the credential is in place, replacing a header of that name the request carries.
|
|
130
|
+
* A resource's is in place in the runner sandbox while the command runs, beside the runner's own (`runner.credentials`),
|
|
131
|
+
* which are in place for the steps too. `domain` is a bare hostname, `header` an HTTP field name, and `value` the whole
|
|
132
|
+
* header value, a secret that never enters the sandbox: no run payload, environment, file, or command argument holds
|
|
133
|
+
* it, and the launcher revokes it as soon as the command ends. `requests` says which requests to `domain` get it:
|
|
134
|
+
* `read` (the default), only `GET` and `HEAD`, and the firewall answers every other request to `domain` with 403; or
|
|
135
|
+
* `all`, every request.
|
|
136
|
+
*/
|
|
137
|
+
export interface SandboxCredential {
|
|
138
|
+
readonly domain: string;
|
|
139
|
+
readonly header: string;
|
|
140
|
+
readonly value: string;
|
|
141
|
+
readonly requests?: "read" | "all";
|
|
142
|
+
}
|
|
124
143
|
/**
|
|
125
144
|
* An acquired resource instance: what it hands the command through the run payload (`payload`, what its payload
|
|
126
|
-
* contract holds);
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* acquired (`
|
|
145
|
+
* contract holds); the sandbox credentials the runner sandbox's firewall adds to the command's requests (`credentials`,
|
|
146
|
+
* `SandboxCredential`), for a resource whose `beforeRun` said it needs a runner sandbox; its result (`result`,
|
|
147
|
+
* `ResultAnswer`), none when a `ran` outcome reports nothing of it; for a resource with its own progress, the progress
|
|
148
|
+
* event the launcher emits once it says the run acquired it (`announce`), such as what it holds; and what a canceled
|
|
149
|
+
* run says it changed, should the run be canceled after it acquired (`canceled`).
|
|
130
150
|
*/
|
|
131
151
|
export interface Acquired<Payload, Result = never, Event = never> {
|
|
132
152
|
readonly payload: Payload;
|
|
153
|
+
readonly credentials?: readonly SandboxCredential[];
|
|
133
154
|
readonly result?: Result;
|
|
134
155
|
readonly announce?: Event;
|
|
135
156
|
readonly canceled?: readonly string[];
|
|
@@ -151,13 +172,31 @@ export type AcquireForRunAnswer<Payload, Result = never, Event = never> = {
|
|
|
151
172
|
} | {
|
|
152
173
|
readonly mintFailed: MintFailed;
|
|
153
174
|
};
|
|
175
|
+
/** What `split` works from: the acquired payload and the run's number of runner sandboxes, at least 1. */
|
|
176
|
+
export interface SplitInput<Payload> {
|
|
177
|
+
readonly payload: Payload;
|
|
178
|
+
readonly sandboxes: number;
|
|
179
|
+
}
|
|
154
180
|
/**
|
|
155
|
-
*
|
|
156
|
-
|
|
157
|
-
|
|
181
|
+
* How `split` answers: `parts`, one payload for each runner sandbox in order of runner sandbox index, or a refusal.
|
|
182
|
+
*/
|
|
183
|
+
export type SplitAnswer<Payload> = {
|
|
184
|
+
readonly parts: readonly Payload[];
|
|
185
|
+
} | Refusal;
|
|
186
|
+
/**
|
|
187
|
+
* What `releaseAfterRun` works from, beside its Context:
|
|
188
|
+
*
|
|
189
|
+
* - `taken`: everything its acquire took, in the order it called `take`, whether or not the acquire finished.
|
|
190
|
+
* - `runnerSandboxFenced`: true when the launcher fenced the run's runner sandbox as the run ended: it stopped it, or
|
|
191
|
+
* kept it, and the kept runner sandbox is fenced because it has no network access (`deny-all`). Always true in a
|
|
192
|
+
* run with no runner, which has nothing to fence. False when the launcher couldn't confirm that the runner sandbox
|
|
193
|
+
* stopped, so code in it may still run and may still reach what the acquire took. A resource whose things another
|
|
194
|
+
* run could take must then not give them back for reuse. A resource that gives nothing back for reuse ignores it.
|
|
195
|
+
* - `report`: what it reports as it goes (`Report`), each thing it couldn't release a warning.
|
|
158
196
|
*/
|
|
159
197
|
export interface ReleaseAfterRunInput<Taken, Event = never> {
|
|
160
198
|
readonly taken: readonly Taken[];
|
|
199
|
+
readonly runnerSandboxFenced: boolean;
|
|
161
200
|
readonly report: Report<Event>;
|
|
162
201
|
}
|
|
163
202
|
/**
|
|
@@ -200,8 +239,11 @@ export interface LifecycleTypes {
|
|
|
200
239
|
* runner sandbox starts and before the run directory opens. It may do I/O.
|
|
201
240
|
* - `acquireForRun`: for every resource instance the run uses at once, while the runner, when there is one, readies
|
|
202
241
|
* the runner sandbox. A refusal aborts `signal` for the others.
|
|
242
|
+
* - `split`: divides the acquired payload across the runner sandboxes of a run across runner sandboxes, in order of
|
|
243
|
+
* runner sandbox index, or refuses.
|
|
203
244
|
* - `releaseAfterRun`: however the run ends, after the command stops (and the runner's sandboxes are closed), one
|
|
204
|
-
* resource instance at a time, in the reverse of the registry's order.
|
|
245
|
+
* resource instance at a time, in the reverse of the registry's order. A runner sandbox the launcher couldn't
|
|
246
|
+
* confirm stopped may still run then, which its input says (`runnerSandboxFenced` is false).
|
|
205
247
|
*/
|
|
206
248
|
export interface ResourceLifecycle<T extends LifecycleTypes = LifecycleTypes> {
|
|
207
249
|
readonly secrets?: (input: {
|
|
@@ -209,5 +251,6 @@ export interface ResourceLifecycle<T extends LifecycleTypes = LifecycleTypes> {
|
|
|
209
251
|
}) => readonly string[];
|
|
210
252
|
readonly beforeRun: (input: BeforeRunInput<T["options"], T["sources"]>) => Promise<BeforeRunAnswer<T["secrets"]>>;
|
|
211
253
|
readonly acquireForRun: (input: AcquireForRunInput<T["options"], T["secrets"], T["taken"], T["event"]>) => Promise<AcquireForRunAnswer<T["payload"], ResultAnswer<unknown>, T["event"]>>;
|
|
254
|
+
readonly split: (input: SplitInput<T["payload"]>) => SplitAnswer<T["payload"]>;
|
|
212
255
|
readonly releaseAfterRun: (input: ReleaseAfterRunInput<T["taken"], T["event"]>) => Promise<ReleaseAfterRunAnswer>;
|
|
213
256
|
}
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
// point with the inputs and answers below. Each lifecycle point says in its answer how it ended: a lifecycle point that
|
|
5
5
|
// refuses a run words its refusal where it refuses (`Refusal`), a warning takes a snake_case reason of the resource's
|
|
6
6
|
// own, and an acquire's result (`ResultAnswer`) is typed by the lifecycle. The lifecycle holds `beforeRun`, the
|
|
7
|
-
// optional `secrets`, `acquireForRun` and `releaseAfterRun`. A resource instance is acquired once its `acquireForRun`
|
|
7
|
+
// optional `secrets`, `acquireForRun`, `split`, and `releaseAfterRun`. A resource instance is acquired once its `acquireForRun`
|
|
8
8
|
// succeeds, until its `releaseAfterRun`. It names no resource.
|
|
9
9
|
export {};
|
|
@@ -11,10 +11,10 @@ export interface Setting<T> {
|
|
|
11
11
|
readonly source: SettingSource;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* What a run counted before it started: `counted`, the test files `storm
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* What a run counted before it started: `counted`, the test files `storm test`'s driver (`vitest list` or
|
|
15
|
+
* `playwright test --list`) lists, and the tests in them when the driver counted them too (`tests`, absent when the
|
|
16
|
+
* driver counts only test files without `--count-tests`); `not-counted` for a run that counts nothing, such as
|
|
17
|
+
* `storm exec`'s, and for a command that plans no run, such as an extension's own command.
|
|
18
18
|
*/
|
|
19
19
|
export type RunTestPlan = {
|
|
20
20
|
readonly kind: "counted";
|
|
@@ -29,16 +29,19 @@ export type RunTestPlan = {
|
|
|
29
29
|
*/
|
|
30
30
|
export interface PlannedRun {
|
|
31
31
|
readonly testPlan: RunTestPlan;
|
|
32
|
+
readonly sandboxes: number;
|
|
32
33
|
}
|
|
33
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* The planned run of a run that counts nothing and is not across runner sandboxes, or of a command that plans no run.
|
|
36
|
+
*/
|
|
34
37
|
export declare const NOT_COUNTED: PlannedRun;
|
|
35
38
|
/** An option's default: a value, or a function of the planned run that gives one. */
|
|
36
39
|
export type OptionDefault<T> = T | ((run: PlannedRun) => T);
|
|
37
40
|
/**
|
|
38
41
|
* A run flag's help: Clinkr's field description, its `description`, and the label of its value, such as `N` in
|
|
39
42
|
* `--<prefix>-<option> <N>`. A boolean flag takes no label.
|
|
40
|
-
* storm bundles Clinkr, so a published declaration names none of Clinkr's types (`tools/storm/AGENTS.md`); `
|
|
41
|
-
* and `
|
|
43
|
+
* storm bundles Clinkr, so a published declaration names none of Clinkr's types (`tools/storm/AGENTS.md`); `test`'s
|
|
44
|
+
* and `exec`'s help, which hand it to Clinkr, check that the shape still fits.
|
|
42
45
|
*/
|
|
43
46
|
export interface FlagHelp {
|
|
44
47
|
readonly description?: string;
|
|
@@ -51,11 +54,11 @@ export interface FlagHelp {
|
|
|
51
54
|
* value, which a transform may normalize, such as a URL to a short form. Its error messages follow
|
|
52
55
|
* the option's key path, `must be …, not …` (`mustBe`), so the file and the flag say the same.
|
|
53
56
|
* - `default`: the value when neither the file nor a flag gives one; or a function of the planned run, such as one
|
|
54
|
-
* that sizes the option from the test files `storm
|
|
57
|
+
* that sizes the option from the test files `storm test` counted, called once as the options resolve, whose value
|
|
55
58
|
* `schema` checks too. An option whose default is a function takes a string, number or boolean, and the run's test
|
|
56
59
|
* plan lists it with its value and where that came from.
|
|
57
60
|
* - `required`: a resource without this option is a problem.
|
|
58
|
-
* - `flag`: the option's run flag on `
|
|
61
|
+
* - `flag`: the option's run flag on `storm test` and `storm exec`, `--<flagPrefix>-<option>`, with its help, whose
|
|
59
62
|
* request field the launcher makes from `schema`. An option without one comes only from the file or its default. The
|
|
60
63
|
* usage names a boolean flag as `--x=false` when its default is true, since only that value changes the request then.
|
|
61
64
|
*/
|
|
@@ -170,7 +173,7 @@ export interface ResourceDefinition<Name extends string = string, Rules extends
|
|
|
170
173
|
readonly name: Name;
|
|
171
174
|
readonly flagPrefix: string;
|
|
172
175
|
readonly options: Rules;
|
|
173
|
-
check(settings: OptionSettings<Rules
|
|
176
|
+
check(settings: OptionSettings<Rules>, run: PlannedRun): readonly OptionProblem<keyof Rules & string>[];
|
|
174
177
|
readonly payload: PayloadContract<Payload>;
|
|
175
178
|
readonly context: (launcher: LauncherContext) => Context;
|
|
176
179
|
readonly lifecycle: (context: unknown) => ResourceLifecycle;
|
|
@@ -192,8 +195,9 @@ export type PayloadOf<D extends ResourceDefinition> = D["payload"] extends Paylo
|
|
|
192
195
|
export type SourcesOf<D extends ResourceDefinition> = OptionSources<D["options"]>;
|
|
193
196
|
/**
|
|
194
197
|
* The key of definition `definition`'s default resource under `resources`: its name. A run's own flags for the
|
|
195
|
-
* definition's options set this resource, and a read that names no key, such as a
|
|
196
|
-
* reads it. For now a config file may hold only default resources (`defineConfig`
|
|
198
|
+
* definition's options set this resource, and a read that names no key, such as a command's
|
|
199
|
+
* `readRunPayload().get(contract)`, reads it. For now a config file may hold only default resources (`defineConfig`
|
|
200
|
+
* and `loadConfig` check each key).
|
|
197
201
|
*/
|
|
198
202
|
export declare function defaultResourceKey(definition: {
|
|
199
203
|
readonly name: string;
|
|
@@ -4,12 +4,18 @@
|
|
|
4
4
|
// (`resource.ts`), and a config file makes a resource with its resource factory (`resource-factory.ts`);
|
|
5
5
|
// the extension API declares the shapes and names no resource. `config` (`load.ts`, `resolve.ts`) loops over the
|
|
6
6
|
// definitions its caller passes in, and keeps each resource as a plain record by its resource key.
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* The planned run of a run that counts nothing and is not across runner sandboxes, or of a command that plans no run.
|
|
9
|
+
*/
|
|
10
|
+
export const NOT_COUNTED = Object.freeze({
|
|
11
|
+
testPlan: Object.freeze({ kind: "not-counted" }),
|
|
12
|
+
sandboxes: 1,
|
|
13
|
+
});
|
|
9
14
|
/**
|
|
10
15
|
* The key of definition `definition`'s default resource under `resources`: its name. A run's own flags for the
|
|
11
|
-
* definition's options set this resource, and a read that names no key, such as a
|
|
12
|
-
* reads it. For now a config file may hold only default resources (`defineConfig`
|
|
16
|
+
* definition's options set this resource, and a read that names no key, such as a command's
|
|
17
|
+
* `readRunPayload().get(contract)`, reads it. For now a config file may hold only default resources (`defineConfig`
|
|
18
|
+
* and `loadConfig` check each key).
|
|
13
19
|
*/
|
|
14
20
|
export function defaultResourceKey(definition) {
|
|
15
21
|
return definition.name;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// A resource factory (`GLOSSARY.md`, **Resource factory**): what a config file calls to make a resource
|
|
2
2
|
// (`<name>({ … })`). Each extension folder's `resource.ts`, its published export, makes its factory from its definition
|
|
3
|
-
// with `resourceFactory`. The factory holds its definition
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// list of factories. It names no resource.
|
|
3
|
+
// with `resourceFactory`. The factory holds its definition (`definition`). A list of definitions holds definitions, not
|
|
4
|
+
// factories: a factory's call signature checks its options contravariantly, so a definition with a required option
|
|
5
|
+
// wouldn't fit a list of factories. It names no resource.
|
|
7
6
|
/** The resource factory of `definition`: what a config file calls to make a resource of it. */
|
|
8
7
|
export function resourceFactory(definition) {
|
|
9
8
|
const make = (given = {}) => ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LauncherContext } from "./launcher-context.ts";
|
|
2
2
|
import type { ResourceLifecycle } from "./lifecycle.ts";
|
|
3
3
|
import type { ResourceProgress } from "./progress.ts";
|
|
4
|
-
import type { DefaultsFit, OptionProblem, OptionRules, OptionSettings, OptionSources, ResolvedOptions, ResourceDefinition } from "./resource-definition.ts";
|
|
4
|
+
import type { DefaultsFit, OptionProblem, OptionRules, OptionSettings, OptionSources, PlannedRun, ResolvedOptions, ResourceDefinition } from "./resource-definition.ts";
|
|
5
5
|
import type { Span } from "./span.ts";
|
|
6
6
|
import type { PayloadContract } from "../run/contract.ts";
|
|
7
7
|
/**
|
|
@@ -35,7 +35,7 @@ export interface ResourceSpec<Name extends string, Rules extends OptionRules, Pa
|
|
|
35
35
|
readonly name: Name;
|
|
36
36
|
readonly flagPrefix: string;
|
|
37
37
|
readonly options: Rules & DefaultsFit<Rules>;
|
|
38
|
-
readonly check?: (settings: OptionSettings<Rules
|
|
38
|
+
readonly check?: (settings: OptionSettings<Rules>, run: PlannedRun) => readonly OptionProblem<keyof Rules & string>[];
|
|
39
39
|
readonly payload: PayloadContract<Payload> & {
|
|
40
40
|
readonly name: NoInfer<Name>;
|
|
41
41
|
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** An environment variable name: ASCII letters, digits, and underscores, not starting with a digit. */
|
|
3
|
+
export declare const ENV_VAR_NAME_PATTERN: RegExp;
|
|
4
|
+
/** The human-readable rule for an environment variable name, shared by Zod and recipe checks. */
|
|
5
|
+
export declare const ENV_VAR_NAME_RULE = "an environment variable name, letters, digits, and underscores, not starting with a digit";
|
|
6
|
+
/**
|
|
7
|
+
* The fewest characters a secret value may have. The run replaces each value wherever it appears in what it prints and
|
|
8
|
+
* writes, so a short one would replace ordinary output.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SECRET_MIN_LENGTH = 8;
|
|
11
|
+
/**
|
|
12
|
+
* Where a secret's value comes from. A discriminated union on `kind`; today only `"env"` (a launcher environment
|
|
13
|
+
* variable) is supported.
|
|
14
|
+
*/
|
|
15
|
+
export type SecretSource = {
|
|
16
|
+
/** Reads the secret from a launcher environment variable. */
|
|
17
|
+
readonly kind: "env";
|
|
18
|
+
/** The launcher environment variable's name, such as `NPM_AUTH`. */
|
|
19
|
+
readonly name: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* What keeps one secret source's value from being used: it is unset or empty (`missing`), its value holds a carriage
|
|
23
|
+
* return or a line feed (`multiline`), which can't enter an HTTP header and which line-by-line output would split past
|
|
24
|
+
* redaction, or it is shorter than `SECRET_MIN_LENGTH` (`short`).
|
|
25
|
+
*/
|
|
26
|
+
export type SecretProblem = "missing" | "multiline" | "short";
|
|
27
|
+
/** The result of reading one `SecretSource` through `readSecretSource`. */
|
|
28
|
+
export type SecretSourceRead = {
|
|
29
|
+
readonly ok: true;
|
|
30
|
+
readonly value: string;
|
|
31
|
+
} | {
|
|
32
|
+
readonly ok: false;
|
|
33
|
+
readonly problem: SecretProblem;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* A stable identity string for a `SecretSource`, used in runner snapshot keys (`env:<name>`). Never contains the
|
|
37
|
+
* secret's value.
|
|
38
|
+
*/
|
|
39
|
+
export declare function secretSourceId(source: SecretSource): string;
|
|
40
|
+
/** Describes `source` for user-facing messages and refusal fields (for `env`, the environment variable name). */
|
|
41
|
+
export declare function describeSecretSource(source: SecretSource): string;
|
|
42
|
+
/**
|
|
43
|
+
* Reads `source`'s raw, non-empty value from `env` using an own-property lookup (`Object.hasOwn`, so keys on
|
|
44
|
+
* `Object.prototype` such as `toString` are not treated as set), without checking line breaks or length. Returns
|
|
45
|
+
* `undefined` when unset or empty. For redaction-only paths that hide any set value without refusing a run.
|
|
46
|
+
*/
|
|
47
|
+
export declare function readSecretSourceValue(source: SecretSource, env: Readonly<Record<string, string | undefined>>): string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Reads `source`'s value from `env` and enforces the shared secret rules: non-empty (`missing`), single line without
|
|
50
|
+
* carriage returns or line feeds (`multiline`), and at least `SECRET_MIN_LENGTH` characters (`short`). Values are
|
|
51
|
+
* never trimmed.
|
|
52
|
+
*/
|
|
53
|
+
export declare function readSecretSource(source: SecretSource, env: Readonly<Record<string, string | undefined>>): SecretSourceRead;
|
|
54
|
+
/**
|
|
55
|
+
* Zod schema validating a `SecretSource` for extension option rules: a plain object with exact keys
|
|
56
|
+
* `{ kind: "env", name: <environment variable name> }`.
|
|
57
|
+
*/
|
|
58
|
+
export declare const secretSourceSchema: z.ZodType<SecretSource>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// A secret source: where storm reads a secret's value before passing it to the Sandbox firewall. Today the only kind
|
|
2
|
+
// is `"env"`, a launcher environment variable; future kinds (such as `"vercel-env"` and `"vercel-connect"`) will join
|
|
3
|
+
// the union without changing the config shape.
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { mustBe } from "./rules.js";
|
|
6
|
+
/** An environment variable name: ASCII letters, digits, and underscores, not starting with a digit. */
|
|
7
|
+
export const ENV_VAR_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
8
|
+
/** The human-readable rule for an environment variable name, shared by Zod and recipe checks. */
|
|
9
|
+
export const ENV_VAR_NAME_RULE = "an environment variable name, letters, digits, and underscores, not starting with a digit";
|
|
10
|
+
/**
|
|
11
|
+
* The fewest characters a secret value may have. The run replaces each value wherever it appears in what it prints and
|
|
12
|
+
* writes, so a short one would replace ordinary output.
|
|
13
|
+
*/
|
|
14
|
+
export const SECRET_MIN_LENGTH = 8;
|
|
15
|
+
/**
|
|
16
|
+
* A stable identity string for a `SecretSource`, used in runner snapshot keys (`env:<name>`). Never contains the
|
|
17
|
+
* secret's value.
|
|
18
|
+
*/
|
|
19
|
+
export function secretSourceId(source) {
|
|
20
|
+
switch (source.kind) {
|
|
21
|
+
case "env":
|
|
22
|
+
return `env:${source.name}`;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** Describes `source` for user-facing messages and refusal fields (for `env`, the environment variable name). */
|
|
26
|
+
export function describeSecretSource(source) {
|
|
27
|
+
switch (source.kind) {
|
|
28
|
+
case "env":
|
|
29
|
+
return source.name;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Reads `source`'s raw, non-empty value from `env` using an own-property lookup (`Object.hasOwn`, so keys on
|
|
34
|
+
* `Object.prototype` such as `toString` are not treated as set), without checking line breaks or length. Returns
|
|
35
|
+
* `undefined` when unset or empty. For redaction-only paths that hide any set value without refusing a run.
|
|
36
|
+
*/
|
|
37
|
+
export function readSecretSourceValue(source, env) {
|
|
38
|
+
switch (source.kind) {
|
|
39
|
+
case "env": {
|
|
40
|
+
const value = Object.hasOwn(env, source.name) ? env[source.name] : undefined;
|
|
41
|
+
return value === undefined || value === "" ? undefined : value;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Reads `source`'s value from `env` and enforces the shared secret rules: non-empty (`missing`), single line without
|
|
47
|
+
* carriage returns or line feeds (`multiline`), and at least `SECRET_MIN_LENGTH` characters (`short`). Values are
|
|
48
|
+
* never trimmed.
|
|
49
|
+
*/
|
|
50
|
+
export function readSecretSource(source, env) {
|
|
51
|
+
const value = readSecretSourceValue(source, env);
|
|
52
|
+
if (value === undefined)
|
|
53
|
+
return { ok: false, problem: "missing" };
|
|
54
|
+
if (/[\r\n]/.test(value))
|
|
55
|
+
return { ok: false, problem: "multiline" };
|
|
56
|
+
if (value.length < SECRET_MIN_LENGTH)
|
|
57
|
+
return { ok: false, problem: "short" };
|
|
58
|
+
return { ok: true, value };
|
|
59
|
+
}
|
|
60
|
+
function isPlainObject(value) {
|
|
61
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
62
|
+
return false;
|
|
63
|
+
const proto = Object.getPrototypeOf(value);
|
|
64
|
+
return proto === Object.prototype || proto === null;
|
|
65
|
+
}
|
|
66
|
+
const SECRET_SOURCE_DESC = 'a secret source, { kind: "env", name }';
|
|
67
|
+
/**
|
|
68
|
+
* Zod schema validating a `SecretSource` for extension option rules: a plain object with exact keys
|
|
69
|
+
* `{ kind: "env", name: <environment variable name> }`.
|
|
70
|
+
*/
|
|
71
|
+
export const secretSourceSchema = z
|
|
72
|
+
.custom(isPlainObject, mustBe(SECRET_SOURCE_DESC))
|
|
73
|
+
.pipe(z
|
|
74
|
+
.strictObject({
|
|
75
|
+
kind: z.literal("env", mustBe('"env"')),
|
|
76
|
+
name: z.string(mustBe(ENV_VAR_NAME_RULE)).regex(ENV_VAR_NAME_PATTERN, mustBe(ENV_VAR_NAME_RULE)),
|
|
77
|
+
}, mustBe(SECRET_SOURCE_DESC))
|
|
78
|
+
.readonly());
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { Present } from "./run/present.ts";
|
|
2
|
-
export { readRunPayload, RUN_PAYLOAD_VARIABLE, type RunPayload, RunPayloadError } from "./run/payload.ts";
|
|
2
|
+
export { readRunPayload, RUN_PAYLOAD_VARIABLE, type RunPayload, type RunPayloadSandbox, RunPayloadError, } from "./run/payload.ts";
|
|
3
3
|
export type { PayloadCheck, PayloadCheckResult, PayloadContract } from "./run/contract.ts";
|
|
4
|
-
export { parseTestEvent, type TestEvent, testEventLine, type TestEventState, type TestResultError, type TestResultEvent, type TestResultOutput, type WorkerTestEvent, } from "./run/test-events.ts";
|
|
4
|
+
export { type FileTimingEvent, parseTestEvent, type TestEvent, testEventLine, type TestEventState, type TestResultError, type TestResultEvent, type TestResultOutput, type WorkerTestEvent, } from "./run/test-events.ts";
|
|
5
5
|
export { ERROR_TEXT_CHARS, keepLast, MAX_ERRORS, OUTPUT_CHARS, type ReportedResultError, type ReportedTestResult, STACK_LINES, testEventsFile, type TestResultWriter, testResultWriter, } from "./run/test-result-writer.ts";
|
|
6
6
|
export { type ReportedWorkerTestEvent, type WorkerTestEventWriter, workerTestEventWriter, } from "./run/worker-test-event-writer.ts";
|
package/dist/sdk/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// nothing here imports them. Everything under `src/sdk/` depends only on Node builtins and `zod`, and
|
|
4
4
|
// `extension/commands.ts` on Clinkr, and on nothing outside this directory; `tsconfig.sdk.json` and `.oxlintrc.json`
|
|
5
5
|
// check it.
|
|
6
|
-
export { readRunPayload, RUN_PAYLOAD_VARIABLE, RunPayloadError } from "./run/payload.js";
|
|
6
|
+
export { readRunPayload, RUN_PAYLOAD_VARIABLE, RunPayloadError, } from "./run/payload.js";
|
|
7
7
|
export { parseTestEvent, testEventLine, } from "./run/test-events.js";
|
|
8
8
|
export { ERROR_TEXT_CHARS, keepLast, MAX_ERRORS, OUTPUT_CHARS, STACK_LINES, testEventsFile, testResultWriter, } from "./run/test-result-writer.js";
|
|
9
9
|
export { workerTestEventWriter, } from "./run/worker-test-event-writer.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { Present } from "./present.ts";
|
|
2
|
-
export { readRunPayload, RUN_PAYLOAD_VARIABLE, type RunPayloadInstance, type RunPayloadJson } from "./payload.ts";
|
|
2
|
+
export { readRunPayload, RUN_PAYLOAD_VARIABLE, type RunPayloadInstance, type RunPayloadJson, type RunPayloadSandbox, } from "./payload.ts";
|
|
3
3
|
export type { PayloadCheck, PayloadCheckResult, PayloadContract } from "./contract.ts";
|
|
4
4
|
export { parseTestEvent, type TestEvent, testEventLine, type TestResultEvent, type WorkerTestEvent, } from "./test-events.ts";
|
|
5
5
|
export { redactSecrets } from "./redact.ts";
|
package/dist/sdk/run/launcher.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
// folders use of the run payload and the redaction of secrets, and what an extension's run side reads the run payload
|
|
3
3
|
// with (`readRunPayload`). It is not a published export: a command and a support library import `../index.ts`,
|
|
4
4
|
// `@vercel/storm/sdk`.
|
|
5
|
-
export { readRunPayload, RUN_PAYLOAD_VARIABLE } from "./payload.js";
|
|
5
|
+
export { readRunPayload, RUN_PAYLOAD_VARIABLE, } from "./payload.js";
|
|
6
6
|
export { parseTestEvent, testEventLine, } from "./test-events.js";
|
|
7
7
|
export { redactSecrets } from "./redact.js";
|
|
@@ -2,14 +2,28 @@ import type { Present } from "./present.ts";
|
|
|
2
2
|
import { type PayloadContract } from "./contract.ts";
|
|
3
3
|
/**
|
|
4
4
|
* The run payload, version 3, as a command reads it: where the command may append test events (`testEvents`, a file
|
|
5
|
-
* path), when the run follows them; whether the run is verbose (`verbose`, under `storm
|
|
5
|
+
* path), when the run follows them; whether the run is verbose (`verbose`, under `storm test --verbose` or
|
|
6
6
|
* `storm exec --verbose`), so the command prints what each test did as it goes, passing or not; and what each acquired
|
|
7
7
|
* resource instance hands the command, read by its definition with `get`.
|
|
8
8
|
*/
|
|
9
|
+
/** Which runner sandbox the command runs in, and its file list, in the run payload of a run across runner sandboxes. */
|
|
10
|
+
export interface RunPayloadSandbox {
|
|
11
|
+
/** The runner sandbox index, counting from 0. */
|
|
12
|
+
readonly index: number;
|
|
13
|
+
/** Total number of runner sandboxes in this run. */
|
|
14
|
+
readonly count: number;
|
|
15
|
+
/** This runner sandbox's file list, as paths relative to the project; absent when the run has no file lists. */
|
|
16
|
+
readonly files?: readonly string[];
|
|
17
|
+
}
|
|
9
18
|
export interface RunPayload {
|
|
10
19
|
readonly version: 3;
|
|
11
20
|
readonly testEvents?: string;
|
|
12
21
|
readonly verbose?: true;
|
|
22
|
+
/**
|
|
23
|
+
* In a run across runner sandboxes, this runner sandbox's runner sandbox index, the number of runner sandboxes, and
|
|
24
|
+
* its file list when it has one.
|
|
25
|
+
*/
|
|
26
|
+
readonly sandbox?: RunPayloadSandbox;
|
|
13
27
|
/**
|
|
14
28
|
* The section the run payload holds for the default resource of payload contract `contract`'s resource, the
|
|
15
29
|
* resource keyed by its name: `{ present: true, value }` with the section, checked by the contract's payload check,
|
|
@@ -34,6 +48,7 @@ export interface RunPayloadJson<Resources extends object = Readonly<Record<strin
|
|
|
34
48
|
readonly resources: Resources;
|
|
35
49
|
readonly testEvents?: string;
|
|
36
50
|
readonly verbose?: true;
|
|
51
|
+
readonly sandbox?: RunPayloadSandbox;
|
|
37
52
|
}
|
|
38
53
|
/** The variable a run hands its command the run payload in. */
|
|
39
54
|
export declare const RUN_PAYLOAD_VARIABLE = "STORM_RUN";
|
package/dist/sdk/run/payload.js
CHANGED
|
@@ -8,11 +8,17 @@ const RUN_PAYLOAD_VERSION = 3;
|
|
|
8
8
|
* What `readRunPayload` checks: the version, that each resource instance under `resources` names its definition, and
|
|
9
9
|
* `testEvents` and `verbose`.
|
|
10
10
|
*/
|
|
11
|
+
const runPayloadSandboxSchema = z.object({
|
|
12
|
+
index: z.number().int().nonnegative(),
|
|
13
|
+
count: z.number().int().positive(),
|
|
14
|
+
files: z.array(z.string().min(1)).optional(),
|
|
15
|
+
});
|
|
11
16
|
const runPayloadSchema = z.object({
|
|
12
17
|
version: z.literal(RUN_PAYLOAD_VERSION),
|
|
13
18
|
resources: z.record(z.string(), z.object({ definition: z.string().min(1), payload: z.unknown() })),
|
|
14
19
|
testEvents: z.string().min(1).optional(),
|
|
15
20
|
verbose: z.literal(true).optional(),
|
|
21
|
+
sandbox: runPayloadSandboxSchema.optional(),
|
|
16
22
|
});
|
|
17
23
|
/**
|
|
18
24
|
* `readRunPayload` found `STORM_RUN` missing, not JSON, or not a version 3 run payload, or an instance of another
|
|
@@ -30,7 +36,7 @@ export class RunPayloadError extends Error {
|
|
|
30
36
|
export function readRunPayload(env = process.env) {
|
|
31
37
|
const raw = env[RUN_PAYLOAD_VARIABLE];
|
|
32
38
|
if (raw === undefined || raw === "") {
|
|
33
|
-
throw new RunPayloadError(`${RUN_PAYLOAD_VARIABLE} is not set: run this command under \`storm
|
|
39
|
+
throw new RunPayloadError(`${RUN_PAYLOAD_VARIABLE} is not set: run this command under \`storm test\` or \`storm exec\``);
|
|
34
40
|
}
|
|
35
41
|
let json;
|
|
36
42
|
try {
|
|
@@ -47,11 +53,20 @@ export function readRunPayload(env = process.env) {
|
|
|
47
53
|
const issue = parsed.error.issues[0];
|
|
48
54
|
throw notValid(issue?.path ?? [], issue?.message ?? "invalid");
|
|
49
55
|
}
|
|
50
|
-
const { resources, testEvents, verbose } = parsed.data;
|
|
56
|
+
const { resources, testEvents, verbose, sandbox } = parsed.data;
|
|
51
57
|
return {
|
|
52
58
|
version: RUN_PAYLOAD_VERSION,
|
|
53
59
|
...(testEvents === undefined ? {} : { testEvents }),
|
|
54
60
|
...(verbose === undefined ? {} : { verbose }),
|
|
61
|
+
...(sandbox === undefined
|
|
62
|
+
? {}
|
|
63
|
+
: {
|
|
64
|
+
sandbox: {
|
|
65
|
+
index: sandbox.index,
|
|
66
|
+
count: sandbox.count,
|
|
67
|
+
...(sandbox.files === undefined ? {} : { files: [...sandbox.files] }),
|
|
68
|
+
},
|
|
69
|
+
}),
|
|
55
70
|
get(contract) {
|
|
56
71
|
const key = defaultResourceKey(contract);
|
|
57
72
|
const instance = Object.hasOwn(resources, key) ? resources[key] : undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A resource read by its
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* A resource read by its payload contract: `present: true` with `value`, what the reader gets of it, when the run has
|
|
3
|
+
* the resource; `present: false` when the run doesn't, such as a run whose config file and flags give it nothing, or
|
|
4
|
+
* whose `beforeRun` skipped it.
|
|
5
5
|
*/
|
|
6
6
|
export type Present<T> = {
|
|
7
7
|
readonly present: true;
|
package/dist/sdk/run/present.js
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
// Whether a run has a resource, and what of it the reader gets when it does. A
|
|
2
|
-
// reads a resource's options by its resource factory, `run.get(<name>)`, which returns one; it lives in the SDK, which
|
|
3
|
-
// imports nothing outside `src/sdk/`, so the run payload's reads can return it too.
|
|
1
|
+
// Whether a run has a resource, and what of it the reader gets when it does. A command's run payload reads return one.
|
|
4
2
|
export {};
|
package/dist/sdk/run/redact.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// Hiding secrets in text: storm shows a
|
|
2
|
-
// run prints and writes.
|
|
1
|
+
// Hiding secrets in text: storm shows a secret, such as a resource's token or a sandbox credential's value, as
|
|
2
|
+
// `<token>` wherever it appears in what a run prints and writes.
|
|
3
3
|
/** What a hidden secret reads as. */
|
|
4
4
|
const REDACTED = "<token>";
|
|
5
5
|
/**
|
|
@@ -7,9 +7,11 @@ export type TestEventState = "pass" | "fail" | "skip";
|
|
|
7
7
|
* epoch).
|
|
8
8
|
*
|
|
9
9
|
* - `file-started` and `file-finished`: the worker started and finished the file.
|
|
10
|
-
* - `test-started`: the worker started an attempt at test `test`, one of the file's `fileTests` tests.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* - `test-started`: the worker started an attempt at test `test`, one of the file's `fileTests` tests. `id` is the
|
|
11
|
+
* test runner's id for the test, unique within the run and the same as its final result's (`TestResultEvent.id`),
|
|
12
|
+
* so a reader joins a test's attempts to its final result by it; `test` is the test's name, for display only.
|
|
13
|
+
* - `test-attempt-finished`: that attempt, by the same `id`, ended `state` after `ms`, any setup phase among it. A
|
|
14
|
+
* retried test reports one for each attempt, so these are not the test's final result.
|
|
13
15
|
* - `setup-started` and `setup-finished`: a setup phase, in which the worker set something up for the file's tests, or
|
|
14
16
|
* for one test, before they could run. Its writer supplies two names: `label`, what it set up, a singular noun the
|
|
15
17
|
* launcher prints as it is (`<label> starts 5`, `waiting on a <label>`), and `resource`, the name of the resource
|
|
@@ -32,6 +34,7 @@ export type WorkerTestEvent = {
|
|
|
32
34
|
readonly file: string;
|
|
33
35
|
readonly worker: number;
|
|
34
36
|
readonly at: number;
|
|
37
|
+
readonly id: string;
|
|
35
38
|
readonly test: string;
|
|
36
39
|
readonly fileTests: number;
|
|
37
40
|
} | {
|
|
@@ -39,6 +42,7 @@ export type WorkerTestEvent = {
|
|
|
39
42
|
readonly file: string;
|
|
40
43
|
readonly worker: number;
|
|
41
44
|
readonly at: number;
|
|
45
|
+
readonly id: string;
|
|
42
46
|
readonly test: string;
|
|
43
47
|
readonly state: TestEventState;
|
|
44
48
|
readonly ms: number;
|
|
@@ -96,12 +100,25 @@ export interface TestResultEvent {
|
|
|
96
100
|
readonly errors?: readonly TestResultError[];
|
|
97
101
|
readonly output?: TestResultOutput;
|
|
98
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* A test file's start or finish reported by the test runner's main process, where no worker index is known.
|
|
105
|
+
* A worker's own `file-started` / `file-finished` event carries `worker` (`WorkerTestEvent`).
|
|
106
|
+
*/
|
|
107
|
+
export type FileTimingEvent = {
|
|
108
|
+
readonly kind: "file-started";
|
|
109
|
+
readonly file: string;
|
|
110
|
+
readonly at: number;
|
|
111
|
+
} | {
|
|
112
|
+
readonly kind: "file-finished";
|
|
113
|
+
readonly file: string;
|
|
114
|
+
readonly at: number;
|
|
115
|
+
};
|
|
99
116
|
/**
|
|
100
117
|
* What a command's test runner reports as it goes, one JSON object a line, appended to the run payload's
|
|
101
|
-
* `testEvents` file: a worker's progress through a file (`WorkerTestEvent`),
|
|
102
|
-
* (`TestResultEvent`).
|
|
118
|
+
* `testEvents` file: a worker's progress through a file (`WorkerTestEvent`), a main-process file start or finish
|
|
119
|
+
* (`FileTimingEvent`), or a test's final result (`TestResultEvent`).
|
|
103
120
|
*/
|
|
104
|
-
export type TestEvent = WorkerTestEvent | TestResultEvent;
|
|
121
|
+
export type TestEvent = WorkerTestEvent | FileTimingEvent | TestResultEvent;
|
|
105
122
|
/** The line a test event is appended as: its JSON, without a newline. */
|
|
106
123
|
export declare function testEventLine(event: TestEvent): string;
|
|
107
124
|
/** The test event on `line`, or undefined when it holds none: not JSON, or not an event this SDK knows. */
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
const where = { file: z.string(), worker: z.number().int().nonnegative(), at: z.number() };
|
|
3
|
+
const fileWhere = { file: z.string(), worker: z.number().int().nonnegative().exactOptional(), at: z.number() };
|
|
4
|
+
const attempt = { id: z.string().min(1), test: z.string() };
|
|
3
5
|
const setup = { label: z.string().min(1), resource: z.string().min(1) };
|
|
4
6
|
const state = z.enum(["pass", "fail", "skip"]);
|
|
5
7
|
const testEventSchema = z.discriminatedUnion("kind", [
|
|
6
|
-
z.object({ kind: z.literal("file-started"), ...
|
|
7
|
-
z.object({ kind: z.literal("file-finished"), ...
|
|
8
|
-
z.object({ kind: z.literal("test-started"), ...where,
|
|
8
|
+
z.object({ kind: z.literal("file-started"), ...fileWhere }),
|
|
9
|
+
z.object({ kind: z.literal("file-finished"), ...fileWhere }),
|
|
10
|
+
z.object({ kind: z.literal("test-started"), ...where, ...attempt, fileTests: z.number().int().nonnegative() }),
|
|
9
11
|
z.object({
|
|
10
12
|
kind: z.literal("test-attempt-finished"),
|
|
11
13
|
...where,
|
|
12
|
-
|
|
14
|
+
...attempt,
|
|
13
15
|
state,
|
|
14
16
|
ms: z.number().nonnegative(),
|
|
15
17
|
}),
|