@cnc-tools/storm 0.14.2 → 0.15.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-4U4DZ7VG.js +40 -0
- package/dist/chunks/{chunk-GSC6SRTW.js → chunk-5CCP36QQ.js} +1 -1
- package/dist/chunks/chunk-5GBMR4HM.js +966 -0
- package/dist/chunks/{chunk-43MWZLJR.js → chunk-5VXBKPW6.js} +1 -1
- package/dist/chunks/{chunk-RA4L2ACU.js → chunk-AWBSONHB.js} +88 -34
- package/dist/chunks/{chunk-BRUIATTR.js → chunk-CN4EFA5J.js} +59 -12
- package/dist/chunks/{chunk-3HBPNQ4Y.js → chunk-CXAT7ZKP.js} +2 -2
- package/dist/chunks/chunk-E4PJNZVG.js +783 -0
- package/dist/chunks/{chunk-T6AZIDZD.js → chunk-F6N34UWB.js} +12 -244
- package/dist/chunks/{chunk-RUPD4TLT.js → chunk-KC4KDJ5K.js} +147 -26
- package/dist/chunks/{chunk-I7AN3DIJ.js → chunk-L36GBUBB.js} +1626 -676
- package/dist/chunks/{chunk-XZCDA5PE.js → chunk-OX7X4B2L.js} +7 -2
- package/dist/chunks/{chunk-UUBZTGLV.js → chunk-PN5ULTTH.js} +140 -130
- package/dist/chunks/chunk-QUHY6FGN.js +108 -0
- package/dist/chunks/chunk-QVS7HRU7.js +74 -0
- package/dist/chunks/{chunk-UC6DULWY.js → chunk-R7XVBZOY.js} +130 -39
- package/dist/chunks/{chunk-LUOHJ3LB.js → chunk-RAQEXKL6.js} +1120 -465
- package/dist/chunks/{chunk-GJOEPJJL.js → chunk-SZEURWRS.js} +446 -52
- package/dist/chunks/chunk-TJNFVNKR.js +246 -0
- package/dist/chunks/{chunk-BW2ADH7U.js → chunk-VUPZH7J2.js} +1 -1
- package/dist/chunks/{chunk-HDL4WKIB.js → chunk-XEVHP5ZW.js} +2 -2
- package/dist/chunks/{chunk-VH2POPW5.js → chunk-YV7GE6EV.js} +635 -79
- package/dist/chunks/{chunk-GQIL3AHY.js → chunk-ZG3WQ4UF.js} +1 -1
- package/dist/chunks/{live-app-SZGEILCQ.js → live-app-PI3BAN6Y.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 +229 -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 +577 -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 +530 -73
- package/dist/commands/exec/outcomes.js +202 -66
- package/dist/commands/exec/plan-only.d.ts +10 -0
- package/dist/commands/exec/plan-only.js +46 -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 +35 -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 +345 -63
- package/dist/commands/exec/run-command.js +308 -258
- 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 +51 -9
- package/dist/commands/runs/facts.js +49 -29
- package/dist/commands/runs/list/command.d.ts +80 -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 +40 -2
- package/dist/commands/runs/logs/command.d.ts +103 -8
- 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 +49 -2
- package/dist/commands/runs/logs/outcomes.js +110 -6
- package/dist/commands/runs/past-run.d.ts +77 -6
- package/dist/commands/runs/past-run.js +133 -4
- package/dist/commands/runs/show/command.d.ts +568 -10
- 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 +276 -5
- 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 +4 -0
- 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 +162 -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 +1389 -0
- package/dist/commands/test/command.js +583 -0
- package/dist/commands/test/metadata.js +8 -0
- package/dist/commands/test/outcomes.d.ts +765 -0
- package/dist/commands/test/outcomes.js +140 -0
- package/dist/commands/test/plan.d.ts +92 -0
- package/dist/commands/test/plan.js +128 -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 +13 -0
- package/dist/config/check-runner.js +54 -0
- package/dist/config/check-suites.d.ts +14 -0
- package/dist/config/check-suites.js +99 -0
- package/dist/config/gateways.d.ts +24 -0
- package/dist/config/index.d.ts +6 -3
- package/dist/config/index.js +3 -1
- 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 +11 -10
- package/dist/config/load.js +35 -103
- package/dist/config/recipe-run.d.ts +8 -1
- package/dist/config/recipe-run.js +2 -1
- 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 +24 -0
- package/dist/config/runner.js +4 -0
- package/dist/config/schema.d.ts +26 -18
- package/dist/config/schema.js +41 -9
- 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-file/define.d.ts +49 -18
- package/dist/config-file/define.js +9 -8
- package/dist/config-file/runner.d.ts +12 -0
- package/dist/config-file/runner.js +9 -0
- 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 +4 -4
- package/dist/extensions/testserver/resource.js +1 -1
- 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 +81 -0
- package/dist/planning/plan-only.js +83 -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 +30 -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 -4
- 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/build-snapshots.d.ts +7 -7
- package/dist/runner/build-snapshots.js +12 -16
- package/dist/runner/events.d.ts +29 -8
- package/dist/runner/gateways.d.ts +49 -6
- package/dist/runner/index.d.ts +6 -4
- package/dist/runner/index.js +3 -2
- package/dist/runner/live/sandbox-gateway.js +161 -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 +6 -7
- 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 +115 -26
- package/dist/runner/recipe.js +147 -154
- 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 +7 -4
- package/dist/runner/snapshot-build.js +48 -28
- package/dist/runner/snapshot-choice.d.ts +37 -0
- package/dist/runner/snapshot-choice.js +38 -0
- package/dist/runner/snapshot-key.d.ts +16 -14
- package/dist/runner/snapshot-key.js +24 -18
- 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 +13 -10
- package/dist/sdk/extension/resource-definition.js +7 -2
- 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/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 +21 -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/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
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type
|
|
2
|
+
import { type DriverPlanFailureKind, type DriverPlanned, type DriverRefusalWords } from "../sdk/extension/index.ts";
|
|
3
3
|
/**
|
|
4
|
-
* The two errors
|
|
5
|
-
* `errors` goes in the command's outcomes, `noMatchingTests` and `planFailed` build one
|
|
4
|
+
* The two errors a driver's plan step ends a command with, worded through `wordsFor` by `data.driver`, and how to
|
|
5
|
+
* build each for a driver: `errors` goes in the command's outcomes, and `noMatchingTests` and `planFailed` build one
|
|
6
|
+
* with that driver's name in it.
|
|
6
7
|
*/
|
|
7
|
-
export declare function driverRefusals(
|
|
8
|
+
export declare function driverRefusals(wordsFor: (driver: string) => DriverRefusalWords): {
|
|
8
9
|
errors: import("@vercel/clinkr").SharedErrors<{
|
|
9
10
|
noMatchingTests: z.ZodObject<{
|
|
10
11
|
driver: z.ZodString;
|
|
@@ -26,13 +27,13 @@ export declare function driverRefusals({ name, refusals }: Pick<Driver, "name" |
|
|
|
26
27
|
}, {
|
|
27
28
|
readonly noMatchingTests: {
|
|
28
29
|
readonly exitCode: 1;
|
|
29
|
-
readonly description:
|
|
30
|
+
readonly description: "The run counted tests before starting (testPlan: true or --count-tests), and the driver's plan step found no matching test or test file, so nothing was minted, acquired, or started.";
|
|
30
31
|
readonly schema: z.ZodObject<{
|
|
31
32
|
driver: z.ZodString;
|
|
32
33
|
args: z.ZodArray<z.ZodString>;
|
|
33
34
|
cwd: z.ZodString;
|
|
34
35
|
}, z.core.$strip>;
|
|
35
|
-
readonly render: ({ args, cwd }: {
|
|
36
|
+
readonly render: ({ driver, args, cwd }: {
|
|
36
37
|
driver: string;
|
|
37
38
|
args: string[];
|
|
38
39
|
cwd: string;
|
|
@@ -46,7 +47,7 @@ export declare function driverRefusals({ name, refusals }: Pick<Driver, "name" |
|
|
|
46
47
|
};
|
|
47
48
|
readonly driverPlanFailed: {
|
|
48
49
|
readonly exitCode: 1;
|
|
49
|
-
readonly description:
|
|
50
|
+
readonly description: "storm couldn't plan the run: the driver's program wasn't found, or its plan step failed to start, timed out, exited non-zero, or returned unreadable output. Nothing was minted, acquired, or started.";
|
|
50
51
|
readonly schema: z.ZodObject<{
|
|
51
52
|
driver: z.ZodString;
|
|
52
53
|
kind: z.ZodEnum<{
|
|
@@ -59,7 +60,7 @@ export declare function driverRefusals({ name, refusals }: Pick<Driver, "name" |
|
|
|
59
60
|
args: z.ZodArray<z.ZodString>;
|
|
60
61
|
cwd: z.ZodString;
|
|
61
62
|
}, z.core.$strip>;
|
|
62
|
-
readonly render: ({ kind, message, cwd }: {
|
|
63
|
+
readonly render: ({ driver, kind, message, cwd }: {
|
|
63
64
|
driver: string;
|
|
64
65
|
kind: "exited" | "start-failed" | "timed-out" | "unreadable-output";
|
|
65
66
|
message: string;
|
|
@@ -75,12 +76,12 @@ export declare function driverRefusals({ name, refusals }: Pick<Driver, "name" |
|
|
|
75
76
|
};
|
|
76
77
|
}>;
|
|
77
78
|
/** `no_matching_tests`: the plan step counted no test for `planned`. */
|
|
78
|
-
noMatchingTests: ({ args, cwd }: DriverPlanned) => import("@vercel/clinkr").CommandError<"no_matching_tests">;
|
|
79
|
+
noMatchingTests: (driver: string, { args, cwd }: DriverPlanned) => import("@vercel/clinkr").CommandError<"no_matching_tests">;
|
|
79
80
|
/**
|
|
80
81
|
* `driver_plan_failed`: why `planned` gave no test plan, by how the plan step failed and what went wrong, in the
|
|
81
82
|
* driver's words, or the launcher's for a binary it didn't find.
|
|
82
83
|
*/
|
|
83
|
-
planFailed: ({ kind, message }: {
|
|
84
|
+
planFailed: (driver: string, { kind, message }: {
|
|
84
85
|
readonly kind: DriverPlanFailureKind;
|
|
85
86
|
readonly message: string;
|
|
86
87
|
}, { args, cwd }: DriverPlanned) => import("@vercel/clinkr").CommandError<"driver_plan_failed">;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// anything is minted, acquired or started (exit 1).
|
|
11
11
|
import { defineErrors } from "@vercel/clinkr";
|
|
12
12
|
import { z } from "zod";
|
|
13
|
-
import { DRIVER_PLAN_FAILURE_KINDS, } from "
|
|
13
|
+
import { DRIVER_PLAN_FAILURE_KINDS, } from "../sdk/extension/index.js";
|
|
14
14
|
/** What both errors carry: the driver, and where its plan step ran and what it was given. */
|
|
15
15
|
const plannedShape = {
|
|
16
16
|
/** The driver whose plan step gave no test plan, by its name. */
|
|
@@ -21,23 +21,27 @@ const plannedShape = {
|
|
|
21
21
|
cwd: z.string(),
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
|
-
* The two errors
|
|
25
|
-
* `errors` goes in the command's outcomes, `noMatchingTests` and `planFailed` build one
|
|
24
|
+
* The two errors a driver's plan step ends a command with, worded through `wordsFor` by `data.driver`, and how to
|
|
25
|
+
* build each for a driver: `errors` goes in the command's outcomes, and `noMatchingTests` and `planFailed` build one
|
|
26
|
+
* with that driver's name in it.
|
|
26
27
|
*/
|
|
27
|
-
export function driverRefusals(
|
|
28
|
+
export function driverRefusals(wordsFor) {
|
|
28
29
|
const errors = defineErrors({
|
|
29
30
|
noMatchingTests: {
|
|
30
31
|
exitCode: 1,
|
|
31
|
-
description:
|
|
32
|
+
description: "The run counted tests before starting (testPlan: true or --count-tests), and the driver's plan step found no matching test or test file, so nothing was minted, acquired, or started.",
|
|
32
33
|
schema: z.object(plannedShape),
|
|
33
|
-
render: ({ args, cwd }) =>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
render: ({ driver, args, cwd }) => {
|
|
35
|
+
const words = wordsFor(driver).noMatchingTests;
|
|
36
|
+
return {
|
|
37
|
+
message: words.message({ args, cwd }),
|
|
38
|
+
next: [{ type: "text", text: words.next({ args, cwd }) }],
|
|
39
|
+
};
|
|
40
|
+
},
|
|
37
41
|
},
|
|
38
42
|
driverPlanFailed: {
|
|
39
43
|
exitCode: 1,
|
|
40
|
-
description:
|
|
44
|
+
description: "storm couldn't plan the run: the driver's program wasn't found, or its plan step failed to start, timed out, exited non-zero, or returned unreadable output. Nothing was minted, acquired, or started.",
|
|
41
45
|
schema: z.object({
|
|
42
46
|
driver: plannedShape.driver,
|
|
43
47
|
/** How the plan step failed: the program wasn't found or couldn't start (`start-failed`), didn't finish (`timed-out`), exited other than 0 (`exited`), or answered something other than a list of tests (`unreadable-output`). */
|
|
@@ -47,20 +51,20 @@ export function driverRefusals({ name, refusals }) {
|
|
|
47
51
|
args: plannedShape.args,
|
|
48
52
|
cwd: plannedShape.cwd,
|
|
49
53
|
}),
|
|
50
|
-
render: ({ kind, message, cwd }) => ({
|
|
54
|
+
render: ({ driver, kind, message, cwd }) => ({
|
|
51
55
|
message: `Couldn't plan the run in ${cwd}: ${/[.!?]$/.test(message) ? message : `${message}.`} The command didn't run.`,
|
|
52
|
-
next: [{ type: "text", text:
|
|
56
|
+
next: [{ type: "text", text: wordsFor(driver).planFailed.next[kind] }],
|
|
53
57
|
}),
|
|
54
58
|
},
|
|
55
59
|
});
|
|
56
60
|
return {
|
|
57
61
|
errors,
|
|
58
62
|
/** `no_matching_tests`: the plan step counted no test for `planned`. */
|
|
59
|
-
noMatchingTests: ({ args, cwd }) => errors.noMatchingTests({ driver
|
|
63
|
+
noMatchingTests: (driver, { args, cwd }) => errors.noMatchingTests({ driver, args: [...args], cwd }),
|
|
60
64
|
/**
|
|
61
65
|
* `driver_plan_failed`: why `planned` gave no test plan, by how the plan step failed and what went wrong, in the
|
|
62
66
|
* driver's words, or the launcher's for a binary it didn't find.
|
|
63
67
|
*/
|
|
64
|
-
planFailed: ({ kind, message }, { args, cwd }) => errors.driverPlanFailed({ driver
|
|
68
|
+
planFailed: (driver, { kind, message }, { args, cwd }) => errors.driverPlanFailed({ driver, kind, message, args: [...args], cwd }),
|
|
65
69
|
};
|
|
66
70
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { FileListsFileGateway } from "../config/index.ts";
|
|
2
|
+
/** A caller's file lists, in order of runner sandbox index, as its file gives them, and the file's path as given. */
|
|
3
|
+
export interface CallerFileList {
|
|
4
|
+
readonly path: string;
|
|
5
|
+
readonly lists: readonly (readonly string[])[];
|
|
6
|
+
}
|
|
7
|
+
/** Why a caller's file lists file can't be used, in its shape, before the config file loads. */
|
|
8
|
+
export type FileListProblem = {
|
|
9
|
+
readonly kind: "empty-list";
|
|
10
|
+
readonly sandbox: number;
|
|
11
|
+
} | {
|
|
12
|
+
readonly kind: "in-two-lists";
|
|
13
|
+
readonly file: string;
|
|
14
|
+
readonly sandboxes: readonly number[];
|
|
15
|
+
} | {
|
|
16
|
+
readonly kind: "count-mismatch";
|
|
17
|
+
readonly lists: number;
|
|
18
|
+
readonly sandboxes: number;
|
|
19
|
+
};
|
|
20
|
+
/** Result of reading and validating a file lists file before the config file loads. */
|
|
21
|
+
export type ReadFileListsFileResult = {
|
|
22
|
+
readonly ok: true;
|
|
23
|
+
readonly lists: CallerFileList;
|
|
24
|
+
} | {
|
|
25
|
+
readonly ok: false;
|
|
26
|
+
readonly kind: "unreadable";
|
|
27
|
+
readonly path: string;
|
|
28
|
+
readonly problem: "unreadable" | "not-json" | "not-lists";
|
|
29
|
+
readonly message: string;
|
|
30
|
+
} | {
|
|
31
|
+
readonly ok: false;
|
|
32
|
+
readonly kind: "invalid";
|
|
33
|
+
readonly path: string;
|
|
34
|
+
readonly problems: readonly FileListProblem[];
|
|
35
|
+
};
|
|
36
|
+
/** Reads and validates the file lists file at `path`, relative to `cwd`, or stdin when `path` is `"-"`. */
|
|
37
|
+
export declare function readFileListsFile(gateway: FileListsFileGateway, request: {
|
|
38
|
+
readonly path: string;
|
|
39
|
+
readonly cwd: string;
|
|
40
|
+
readonly sandboxes: number | undefined;
|
|
41
|
+
}): Promise<ReadFileListsFileResult>;
|
|
42
|
+
/** Checks a parsed file lists array for empty lists, duplicate files, and `--sandboxes` count mismatches. */
|
|
43
|
+
export declare function fileListsProblems(lists: readonly (readonly string[])[], sandboxes: number | undefined): readonly FileListProblem[];
|
|
44
|
+
/** Formats one `FileListProblem` as a sentence. */
|
|
45
|
+
export declare function fileListsProblemText(problem: FileListProblem): string;
|
|
46
|
+
/**
|
|
47
|
+
* Matches a caller's file lists against the run's listed `testFiles`, normalizing each path to the listing's form
|
|
48
|
+
* and counting how many listed files were left out; or reports every unlisted path.
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolveCallerFileLists(testFiles: readonly string[], caller: CallerFileList): {
|
|
51
|
+
readonly ok: true;
|
|
52
|
+
readonly lists: readonly (readonly string[])[];
|
|
53
|
+
readonly leftOut: number;
|
|
54
|
+
} | {
|
|
55
|
+
readonly ok: false;
|
|
56
|
+
readonly unlisted: readonly string[];
|
|
57
|
+
readonly listed: number;
|
|
58
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Pure parsing and validation of a caller's file lists file (`--file-lists <path>`): JSON array of non-empty
|
|
2
|
+
// arrays of test file paths, no duplicate files across lists, optional `--sandboxes` count match, and verification
|
|
3
|
+
// against the run's listed test files.
|
|
4
|
+
import { isAbsolute, resolve } from "node:path";
|
|
5
|
+
import { comparedPath } from "./file-lists.js";
|
|
6
|
+
/** Reads and validates the file lists file at `path`, relative to `cwd`, or stdin when `path` is `"-"`. */
|
|
7
|
+
export async function readFileListsFile(gateway, request) {
|
|
8
|
+
const { path, cwd, sandboxes } = request;
|
|
9
|
+
const resolvedPath = path === "-" ? "-" : isAbsolute(path) ? path : resolve(cwd, path);
|
|
10
|
+
const read = await gateway.readFileListsFile({ path: resolvedPath });
|
|
11
|
+
if (read.kind !== "read")
|
|
12
|
+
return { ok: false, kind: "unreadable", path, problem: read.kind, message: read.message };
|
|
13
|
+
const lists = fileListsOf(read.value);
|
|
14
|
+
if (!lists.ok)
|
|
15
|
+
return { ok: false, kind: "unreadable", path, problem: "not-lists", message: lists.problem };
|
|
16
|
+
const problems = fileListsProblems(lists.lists, sandboxes);
|
|
17
|
+
if (problems.length > 0)
|
|
18
|
+
return { ok: false, kind: "invalid", path, problems };
|
|
19
|
+
return { ok: true, lists: { path, lists: lists.lists } };
|
|
20
|
+
}
|
|
21
|
+
function fileListsOf(value) {
|
|
22
|
+
const shape = "an array with one array of test file paths for each runner sandbox";
|
|
23
|
+
if (!Array.isArray(value))
|
|
24
|
+
return { ok: false, problem: `holds ${describe(value)}, not ${shape}` };
|
|
25
|
+
if (value.length === 0)
|
|
26
|
+
return { ok: false, problem: `holds an empty array, not ${shape}, at least one` };
|
|
27
|
+
const lists = [];
|
|
28
|
+
for (const [index, list] of value.entries()) {
|
|
29
|
+
if (!Array.isArray(list))
|
|
30
|
+
return {
|
|
31
|
+
ok: false,
|
|
32
|
+
problem: `holds ${describe(list)} as the list of runner sandbox ${index}, not an array of paths`,
|
|
33
|
+
};
|
|
34
|
+
const bad = list.findIndex((file) => typeof file !== "string" || file === "");
|
|
35
|
+
if (bad !== -1)
|
|
36
|
+
return {
|
|
37
|
+
ok: false,
|
|
38
|
+
problem: `holds ${describe(list[bad])} in the list of runner sandbox ${index}, at item ${bad + 1}, not a test file's path`,
|
|
39
|
+
};
|
|
40
|
+
lists.push(list);
|
|
41
|
+
}
|
|
42
|
+
return { ok: true, lists };
|
|
43
|
+
}
|
|
44
|
+
function describe(value) {
|
|
45
|
+
if (value === null)
|
|
46
|
+
return "null";
|
|
47
|
+
if (Array.isArray(value))
|
|
48
|
+
return "an array";
|
|
49
|
+
if (typeof value === "string")
|
|
50
|
+
return value === "" ? "an empty string" : `the string ${JSON.stringify(value)}`;
|
|
51
|
+
if (typeof value === "object")
|
|
52
|
+
return "an object";
|
|
53
|
+
return `${typeof value} ${JSON.stringify(value) ?? typeof value}`;
|
|
54
|
+
}
|
|
55
|
+
/** Checks a parsed file lists array for empty lists, duplicate files, and `--sandboxes` count mismatches. */
|
|
56
|
+
export function fileListsProblems(lists, sandboxes) {
|
|
57
|
+
const named = new Map();
|
|
58
|
+
lists.forEach((list, index) => {
|
|
59
|
+
for (const file of list) {
|
|
60
|
+
const key = comparedPath(file);
|
|
61
|
+
named.set(key, [...(named.get(key) ?? []), index]);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return [
|
|
65
|
+
...lists.flatMap((list, index) => (list.length === 0 ? [{ kind: "empty-list", sandbox: index }] : [])),
|
|
66
|
+
...[...named].flatMap(([file, at]) => at.length > 1 ? [{ kind: "in-two-lists", file, sandboxes: at }] : []),
|
|
67
|
+
...(sandboxes !== undefined && sandboxes !== lists.length
|
|
68
|
+
? [{ kind: "count-mismatch", lists: lists.length, sandboxes }]
|
|
69
|
+
: []),
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
function numbersText(numbers) {
|
|
73
|
+
const words = numbers.map(String);
|
|
74
|
+
if (words.length <= 2)
|
|
75
|
+
return words.join(" and ");
|
|
76
|
+
return `${words.slice(0, -1).join(", ")}, and ${words.at(-1) ?? ""}`;
|
|
77
|
+
}
|
|
78
|
+
/** Formats one `FileListProblem` as a sentence. */
|
|
79
|
+
export function fileListsProblemText(problem) {
|
|
80
|
+
switch (problem.kind) {
|
|
81
|
+
case "empty-list":
|
|
82
|
+
return `The list of runner sandbox ${problem.sandbox} holds no test file.`;
|
|
83
|
+
case "in-two-lists": {
|
|
84
|
+
const distinct = [...new Set(problem.sandboxes)];
|
|
85
|
+
return distinct.length === 1
|
|
86
|
+
? `${problem.file} is in the list of runner sandbox ${distinct[0] ?? ""} ${problem.sandboxes.length} times.`
|
|
87
|
+
: `${problem.file} is in the lists of runner sandboxes ${numbersText(problem.sandboxes)}.`;
|
|
88
|
+
}
|
|
89
|
+
case "count-mismatch":
|
|
90
|
+
return `The file holds ${problem.lists} ${problem.lists === 1 ? "list" : "lists"}, and --sandboxes asks for ${problem.sandboxes} ${problem.sandboxes === 1 ? "runner sandbox" : "runner sandboxes"}.`;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Matches a caller's file lists against the run's listed `testFiles`, normalizing each path to the listing's form
|
|
95
|
+
* and counting how many listed files were left out; or reports every unlisted path.
|
|
96
|
+
*/
|
|
97
|
+
export function resolveCallerFileLists(testFiles, caller) {
|
|
98
|
+
const listed = new Map(testFiles.map((file) => [comparedPath(file), file]));
|
|
99
|
+
const unlisted = caller.lists.flat().filter((file) => !listed.has(comparedPath(file)));
|
|
100
|
+
if (unlisted.length > 0)
|
|
101
|
+
return { ok: false, unlisted, listed: listed.size };
|
|
102
|
+
const lists = caller.lists.map((list) => list.map((file) => listed.get(comparedPath(file)) ?? file));
|
|
103
|
+
const held = lists.reduce((sum, list) => sum + list.length, 0);
|
|
104
|
+
return { ok: true, lists, leftOut: listed.size - held };
|
|
105
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The file lists of a run of `count` runner sandboxes over `files`, in order of runner sandbox index: distinct paths,
|
|
3
|
+
* sorted by UTF-16 code units, dealt round-robin. Never produces an empty list: with fewer test files than runner
|
|
4
|
+
* sandboxes, returns one list per test file.
|
|
5
|
+
*/
|
|
6
|
+
export declare function dealFileLists(files: readonly string[], count: number): readonly (readonly string[])[];
|
|
7
|
+
/** A path in the canonical form both sides of a comparison take: `/` separators and no leading `./`. */
|
|
8
|
+
export declare function comparedPath(path: string): string;
|
|
9
|
+
/** How what one runner sandbox reported differs from its file list: missing and extra test files, each sorted. */
|
|
10
|
+
export interface FileListMismatch {
|
|
11
|
+
readonly sandbox: number;
|
|
12
|
+
readonly missing: readonly string[];
|
|
13
|
+
readonly extra: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
/** What the comparison reads of one runner sandbox once the run is over. */
|
|
16
|
+
export interface ComparedFileList {
|
|
17
|
+
readonly sandbox: number;
|
|
18
|
+
readonly files: readonly string[] | null;
|
|
19
|
+
readonly exitCode: number | null;
|
|
20
|
+
readonly reported: readonly string[];
|
|
21
|
+
readonly whole: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** Compares what each runner sandbox reported with its file list. Changes no exit status. */
|
|
24
|
+
export declare function fileListMismatches(sandboxes: readonly ComparedFileList[]): readonly FileListMismatch[];
|
|
25
|
+
/** A mismatch as one sentence, with an optional hint when extra files were reported. */
|
|
26
|
+
export declare function fileListMismatchText({ sandbox, missing, extra }: FileListMismatch, options?: {
|
|
27
|
+
readonly extraHint?: string;
|
|
28
|
+
}): string;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Pure dealing of test files into file lists (sorted round-robin by count) and mismatch comparison once a run across
|
|
2
|
+
// runner sandboxes ends. Names no test runner.
|
|
3
|
+
function byCodeUnits(a, b) {
|
|
4
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The file lists of a run of `count` runner sandboxes over `files`, in order of runner sandbox index: distinct paths,
|
|
8
|
+
* sorted by UTF-16 code units, dealt round-robin. Never produces an empty list: with fewer test files than runner
|
|
9
|
+
* sandboxes, returns one list per test file.
|
|
10
|
+
*/
|
|
11
|
+
export function dealFileLists(files, count) {
|
|
12
|
+
const sorted = [...new Set(files)].toSorted(byCodeUnits);
|
|
13
|
+
const lists = Array.from({ length: Math.min(count, sorted.length) }, () => []);
|
|
14
|
+
sorted.forEach((file, index) => lists[index % lists.length]?.push(file));
|
|
15
|
+
return lists;
|
|
16
|
+
}
|
|
17
|
+
/** A path in the canonical form both sides of a comparison take: `/` separators and no leading `./`. */
|
|
18
|
+
export function comparedPath(path) {
|
|
19
|
+
let normal = path.replaceAll("\\", "/").replace(/\/{2,}/g, "/");
|
|
20
|
+
while (normal.startsWith("./"))
|
|
21
|
+
normal = normal.slice(2);
|
|
22
|
+
return normal;
|
|
23
|
+
}
|
|
24
|
+
/** Compares what each runner sandbox reported with its file list. Changes no exit status. */
|
|
25
|
+
export function fileListMismatches(sandboxes) {
|
|
26
|
+
return sandboxes.flatMap(({ sandbox, files, exitCode, reported, whole }) => {
|
|
27
|
+
if (files === null || exitCode === null || !whole)
|
|
28
|
+
return [];
|
|
29
|
+
const listed = new Set(files.map(comparedPath));
|
|
30
|
+
const seen = new Set(reported.map(comparedPath));
|
|
31
|
+
const missing = [...listed].filter((file) => !seen.has(file)).toSorted(byCodeUnits);
|
|
32
|
+
const extra = [...seen].filter((file) => !listed.has(file)).toSorted(byCodeUnits);
|
|
33
|
+
return missing.length === 0 && extra.length === 0 ? [] : [{ sandbox, missing, extra }];
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const NAMED_PATHS = 3;
|
|
37
|
+
function pathsText(paths) {
|
|
38
|
+
const named = paths.slice(0, NAMED_PATHS).join(", ");
|
|
39
|
+
return paths.length > NAMED_PATHS ? `${named}, and ${paths.length - NAMED_PATHS} more` : named;
|
|
40
|
+
}
|
|
41
|
+
/** A mismatch as one sentence, with an optional hint when extra files were reported. */
|
|
42
|
+
export function fileListMismatchText({ sandbox, missing, extra }, options = {}) {
|
|
43
|
+
const files = (n) => `${n} test ${n === 1 ? "file" : "files"}`;
|
|
44
|
+
const parts = [
|
|
45
|
+
...(missing.length === 0
|
|
46
|
+
? []
|
|
47
|
+
: [`reported nothing for ${files(missing.length)} of its file list: ${pathsText(missing)}`]),
|
|
48
|
+
...(extra.length === 0 ? [] : [`reported ${files(extra.length)} not in its file list: ${pathsText(extra)}`]),
|
|
49
|
+
];
|
|
50
|
+
const hint = extra.length > 0 && options.extraHint !== undefined ? ` ${options.extraHint}` : "";
|
|
51
|
+
return `Runner sandbox ${sandbox} ${parts.join("; it ")}.${hint}`;
|
|
52
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DriverHints } from "
|
|
1
|
+
import type { DriverHints } from "../sdk/extension/index.ts";
|
|
2
2
|
/** What the run's tests said, as the run ended, which decides whether its `ran` result warns `no_final_test_results`. */
|
|
3
3
|
export interface FinalResultsRead {
|
|
4
4
|
/** How many final test results (`test-result` events) the run's test events hold. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// The `no_final_test_results` warning of a run whose command exited 0 but saved no final test result.
|
|
2
|
-
// passed while it saved nothing, which is a setup that looks correct and isn't: the test runner's
|
|
3
|
-
// storm's reporter, or a `--reporter` on its command line replaced it. So its `ran` result says so
|
|
1
|
+
// The `no_final_test_results` warning of a `storm test` run whose command exited 0 but saved no final test result.
|
|
2
|
+
// Such a run looks passed while it saved nothing, which is a setup that looks correct and isn't: the test runner's
|
|
3
|
+
// config doesn't list storm's reporter, or a `--reporter` on its command line replaced it. So its `ran` result says so
|
|
4
4
|
// (`noFinalTestResults`), warns, and lists the steps that add storm's reporter as its next steps: the run's driver's
|
|
5
|
-
// (`DriverHints.addReporter`), which name the config file and the exact code, so an agent can follow them as written
|
|
6
|
-
//
|
|
7
|
-
//
|
|
5
|
+
// (`DriverHints.addReporter`), which name the config file and the exact code, so an agent can follow them as written.
|
|
6
|
+
// The warning changes no exit code: storm exits with the command's. Its message is the launcher's and names no test
|
|
7
|
+
// runner.
|
|
8
8
|
/**
|
|
9
9
|
* Whether a run whose command ended with `exitCode` and whose tests said `read` saved no final test result: its
|
|
10
10
|
* command exited 0, storm handed it a test events file, and storm read every line of its test events and found no
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ResolvedResourceRecord } from "../config/index.ts";
|
|
3
|
+
import type { ResourceLifecycles } from "../core/index.ts";
|
|
4
|
+
import { type PlanOption } from "../run-directory/index.ts";
|
|
5
|
+
import { type RunTestPlan } from "../sdk/extension/index.ts";
|
|
6
|
+
import type { PlannedSandboxesRun, PlannedWhere } from "./run-plan.ts";
|
|
7
|
+
/** What a `planned` outcome says of the planned run. No field carries the credential. */
|
|
8
|
+
export declare const plannedSchema: z.ZodObject<{
|
|
9
|
+
version: z.ZodString;
|
|
10
|
+
commit: z.ZodNullable<z.ZodString>;
|
|
11
|
+
configFile: z.ZodNullable<z.ZodString>;
|
|
12
|
+
argv: z.ZodArray<z.ZodString>;
|
|
13
|
+
plan: z.ZodNullable<z.ZodObject<{
|
|
14
|
+
tests: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
files: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
options: z.ZodArray<z.ZodObject<{
|
|
17
|
+
path: z.ZodString;
|
|
18
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
19
|
+
from: z.ZodEnum<{
|
|
20
|
+
default: "default";
|
|
21
|
+
file: "file";
|
|
22
|
+
flag: "flag";
|
|
23
|
+
}>;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
sandboxes: z.ZodOptional<z.ZodObject<{
|
|
26
|
+
count: z.ZodNumber;
|
|
27
|
+
from: z.ZodEnum<{
|
|
28
|
+
default: "default";
|
|
29
|
+
"file-lists": "file-lists";
|
|
30
|
+
flag: "flag";
|
|
31
|
+
}>;
|
|
32
|
+
max: z.ZodNumber;
|
|
33
|
+
default: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
requested: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
leftOut: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
testFiles: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
39
|
+
runnerSandboxes: z.ZodNullable<z.ZodObject<{
|
|
40
|
+
max: z.ZodNumber;
|
|
41
|
+
default: z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"function">]>>;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
sandboxes: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
44
|
+
sandbox: z.ZodNumber;
|
|
45
|
+
argv: z.ZodArray<z.ZodString>;
|
|
46
|
+
files: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
47
|
+
}, z.core.$strip>>>;
|
|
48
|
+
options: z.ZodArray<z.ZodObject<{
|
|
49
|
+
path: z.ZodString;
|
|
50
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
51
|
+
from: z.ZodEnum<{
|
|
52
|
+
default: "default";
|
|
53
|
+
file: "file";
|
|
54
|
+
flag: "flag";
|
|
55
|
+
}>;
|
|
56
|
+
}, z.core.$strip>>;
|
|
57
|
+
vcpus: z.ZodNullable<z.ZodNumber>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
/** What a `planned` outcome holds. */
|
|
60
|
+
export type PlannedFacts = z.input<typeof plannedSchema>;
|
|
61
|
+
/** The secrets a planned run hides as `<token>`: runner secrets and each resource's pure `secrets`. */
|
|
62
|
+
export declare function plannedSecrets(lifecycles: ResourceLifecycles, where: PlannedWhere, resources: {
|
|
63
|
+
readonly [key: string]: ResolvedResourceRecord;
|
|
64
|
+
}): readonly string[];
|
|
65
|
+
/** Builds and redacts the `PlannedFacts` for a run, across runner sandboxes or not. */
|
|
66
|
+
export declare function buildPlannedFacts(input: {
|
|
67
|
+
readonly version: string;
|
|
68
|
+
readonly commit: string | null;
|
|
69
|
+
readonly configFile: string | null;
|
|
70
|
+
readonly argv: readonly string[];
|
|
71
|
+
readonly where: PlannedWhere;
|
|
72
|
+
readonly testPlan: RunTestPlan;
|
|
73
|
+
readonly planOptions: readonly PlanOption[];
|
|
74
|
+
readonly testFiles: readonly string[] | undefined;
|
|
75
|
+
readonly sandboxes: PlannedSandboxesRun | undefined;
|
|
76
|
+
readonly resources: {
|
|
77
|
+
readonly [key: string]: ResolvedResourceRecord;
|
|
78
|
+
};
|
|
79
|
+
readonly lifecycles: ResourceLifecycles;
|
|
80
|
+
readonly vcpus: number | null;
|
|
81
|
+
}): PlannedFacts;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// The planned run a `--plan-only` run answers: the shape of its facts (`plannedSchema`), and the pure builder of them,
|
|
2
|
+
// which ALWAYS routes every string through `redactor` / `redactStrings` so declared runner secrets and resource
|
|
3
|
+
// secrets are hidden as `<token>`.
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { planSchema } from "../run-directory/index.js";
|
|
6
|
+
import { optionKeyPath } from "../sdk/extension/index.js";
|
|
7
|
+
import { redactor, redactStrings } from "./redaction.js";
|
|
8
|
+
import { recordedPlan } from "./test-plan.js";
|
|
9
|
+
const plannedOptionSchema = z.object({
|
|
10
|
+
/** The option's key path, `resources.<key>.<option>`. */
|
|
11
|
+
path: z.string(),
|
|
12
|
+
/** Its value; a value that is not a string, a number, or a boolean as its JSON text. */
|
|
13
|
+
value: z.union([z.string(), z.number(), z.boolean()]),
|
|
14
|
+
/** Where the value came from: its flag (`flag`), storm.config.ts (`file`), or its default (`default`). */
|
|
15
|
+
from: z.enum(["flag", "file", "default"]),
|
|
16
|
+
});
|
|
17
|
+
/** What a `planned` outcome says of the planned run. No field carries the credential. */
|
|
18
|
+
export const plannedSchema = z.object({
|
|
19
|
+
version: z.string(),
|
|
20
|
+
commit: z.string().nullable(),
|
|
21
|
+
configFile: z.string().nullable(),
|
|
22
|
+
argv: z.array(z.string()),
|
|
23
|
+
plan: planSchema.nullable(),
|
|
24
|
+
testFiles: z.array(z.string()).nullable(),
|
|
25
|
+
runnerSandboxes: z
|
|
26
|
+
.object({ max: z.number(), default: z.union([z.number(), z.literal("function")]).nullable() })
|
|
27
|
+
.nullable(),
|
|
28
|
+
sandboxes: z
|
|
29
|
+
.array(z.object({ sandbox: z.number(), argv: z.array(z.string()), files: z.array(z.string()).nullable() }))
|
|
30
|
+
.nullable(),
|
|
31
|
+
options: z.array(plannedOptionSchema),
|
|
32
|
+
vcpus: z.number().nullable(),
|
|
33
|
+
});
|
|
34
|
+
/** The secrets a planned run hides as `<token>`: runner secrets and each resource's pure `secrets`. */
|
|
35
|
+
export function plannedSecrets(lifecycles, where, resources) {
|
|
36
|
+
return [...lifecycles.secrets(resources), ...(where.kind === "runner" ? where.secrets : [])];
|
|
37
|
+
}
|
|
38
|
+
/** Builds and redacts the `PlannedFacts` for a run, across runner sandboxes or not. */
|
|
39
|
+
export function buildPlannedFacts(input) {
|
|
40
|
+
const { where, sandboxes, resources, lifecycles } = input;
|
|
41
|
+
const policy = where.kind === "runner" ? where.recipe.sandboxes : undefined;
|
|
42
|
+
const basePlan = recordedPlan(input.testPlan, input.planOptions);
|
|
43
|
+
const plan = sandboxes !== undefined
|
|
44
|
+
? {
|
|
45
|
+
...(basePlan ?? { options: [] }),
|
|
46
|
+
options: (basePlan?.options ?? []).map((option) => ({ ...option })),
|
|
47
|
+
sandboxes: { ...sandboxes.count },
|
|
48
|
+
}
|
|
49
|
+
: basePlan === undefined
|
|
50
|
+
? null
|
|
51
|
+
: { ...basePlan, options: basePlan.options.map((option) => ({ ...option })) };
|
|
52
|
+
const facts = {
|
|
53
|
+
version: input.version,
|
|
54
|
+
commit: input.commit,
|
|
55
|
+
configFile: input.configFile,
|
|
56
|
+
argv: [...input.argv],
|
|
57
|
+
plan,
|
|
58
|
+
testFiles: input.testFiles === undefined ? null : [...input.testFiles],
|
|
59
|
+
runnerSandboxes: policy === undefined
|
|
60
|
+
? null
|
|
61
|
+
: {
|
|
62
|
+
max: policy.max,
|
|
63
|
+
default: policy.default === undefined ? null : typeof policy.default === "function" ? "function" : policy.default,
|
|
64
|
+
},
|
|
65
|
+
sandboxes: sandboxes === undefined
|
|
66
|
+
? null
|
|
67
|
+
: sandboxes.sandboxes.map(({ argv, files }, index) => ({
|
|
68
|
+
sandbox: index,
|
|
69
|
+
argv: [...argv],
|
|
70
|
+
files: files === null ? null : [...files],
|
|
71
|
+
})),
|
|
72
|
+
options: Object.entries(resources).flatMap(([key, { options, sources }]) => Object.entries(options).map(([option, value]) => ({
|
|
73
|
+
path: optionKeyPath(key, option),
|
|
74
|
+
value: typeof value === "string" || typeof value === "number" || typeof value === "boolean"
|
|
75
|
+
? value
|
|
76
|
+
: (JSON.stringify(value) ?? String(value)),
|
|
77
|
+
from: sources[option] ?? "default",
|
|
78
|
+
}))),
|
|
79
|
+
vcpus: input.vcpus,
|
|
80
|
+
};
|
|
81
|
+
const redact = redactor(plannedSecrets(lifecycles, where, resources));
|
|
82
|
+
return redactStrings(facts, redact);
|
|
83
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RunObserver } from "
|
|
2
|
-
import type { RunnerTerminal } from "
|
|
1
|
+
import type { RunObserver } from "../core/index.ts";
|
|
2
|
+
import type { RunnerTerminal } from "../runner/index.ts";
|
|
3
3
|
/** Text with each secret replaced by `<token>`; the identity when there is none. */
|
|
4
4
|
export type Redact = (text: string) => string;
|
|
5
5
|
/** A redaction of `secrets`, each replaced by `<token>` wherever it appears. */
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
// Hiding a run's secrets, such as a
|
|
2
|
-
// events (which feed progress, the run directory's `events.jsonl`,
|
|
3
|
-
// command's output (the terminal and `command.log`), and the test
|
|
4
|
-
|
|
1
|
+
// Hiding a run's secrets, such as a sandbox credential's value or a token a resource reads from the launcher
|
|
2
|
+
// environment, in what the run prints and writes: its events (which feed progress, the run directory's `events.jsonl`,
|
|
3
|
+
// the timeline, the job summary, and the outcome), the command's output (the terminal and `command.log`), and the test
|
|
4
|
+
// events the command staged in the run directory.
|
|
5
|
+
import { redactSecrets } from "../sdk/run/launcher.js";
|
|
5
6
|
/** A redaction of `secrets`, each replaced by `<token>` wherever it appears. */
|
|
6
7
|
export function redactor(secrets) {
|
|
7
8
|
const kept = secrets.filter((secret) => secret !== "");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ArgumentIssue } from "@vercel/clinkr";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import type { ResourceFlagOptions } from "
|
|
4
|
-
import { type FlagHelp, type OptionRule } from "
|
|
5
|
-
import type { RunExamples } from "
|
|
3
|
+
import type { ResourceFlagOptions } from "../config/index.ts";
|
|
4
|
+
import { type FlagHelp, type OptionRule } from "../sdk/extension/index.ts";
|
|
5
|
+
import type { RunExamples } from "../sdk/extension/commands.ts";
|
|
6
6
|
/**
|
|
7
7
|
* One resource option's run flag: its definition's name and option, the key of the resource it sets (the
|
|
8
8
|
* definition's default resource), its request field and spelling, its option's rule, and its help, Clinkr's field
|
|
@@ -28,15 +28,8 @@ export declare const RESOURCE_FLAG_HELP: {
|
|
|
28
28
|
* `=false` when its option rule's default is true, since only that value changes the request then.
|
|
29
29
|
*/
|
|
30
30
|
export declare const RESOURCE_USAGE_FLAGS: string;
|
|
31
|
-
/**
|
|
32
|
-
export
|
|
33
|
-
readonly driver: string;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* The run examples every extension brings to the help of the run command `of`, in extension order: those for `exec`
|
|
37
|
-
* (`RunExamples.exec`), or those under a driver's name (`RunExamples.drivers`), none when no extension names it.
|
|
38
|
-
*/
|
|
39
|
-
export declare function resourceRunExamples(of: RunExamplesOf): RunExamples["exec"];
|
|
31
|
+
/** The run examples every extension brings to `storm exec`'s help, in extension order (`RunExamples.exec`). */
|
|
32
|
+
export declare function resourceRunExamples(): RunExamples["exec"];
|
|
40
33
|
/**
|
|
41
34
|
* The request fields of every resource option's flag, by field. Two resources whose flags would share a field, or a
|
|
42
35
|
* field the run's own fields already have, fail here, as storm loads.
|