@cnc-tools/storm 0.14.1 → 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 +18 -8
- 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-27P2QSIM.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-ZH5R7W4A.js → chunk-KC4KDJ5K.js} +147 -26
- package/dist/chunks/{chunk-5ED3IDUJ.js → chunk-L36GBUBB.js} +1652 -681
- package/dist/chunks/{chunk-QBR5VHJ7.js → chunk-OX7X4B2L.js} +7 -2
- package/dist/chunks/{chunk-Z5OXOZD3.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-YBPTMJUM.js → chunk-RAQEXKL6.js} +1120 -465
- package/dist/chunks/{chunk-RKONDLPS.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-XPCUINWS.js → chunk-XEVHP5ZW.js} +2 -2
- package/dist/chunks/{chunk-5TMHYH7G.js → chunk-YV7GE6EV.js} +638 -80
- package/dist/chunks/{chunk-GQIL3AHY.js → chunk-ZG3WQ4UF.js} +1 -1
- package/dist/chunks/{live-app-FBVWUUMT.js → live-app-PI3BAN6Y.js} +37 -26
- 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 +13 -8
- package/dist/context.js +13 -4
- 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 +7 -4
- package/dist/core/payload.js +10 -4
- 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.d.ts +3 -1
- package/dist/live-app.js +9 -5
- 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 +59 -8
- package/dist/runner/index.d.ts +6 -4
- package/dist/runner/index.js +3 -2
- package/dist/runner/live/sandbox-gateway.js +177 -33
- package/dist/runner/live/terminal.d.ts +15 -3
- package/dist/runner/live/terminal.js +25 -3
- 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 +118 -28
- package/dist/runner/recipe.js +147 -154
- package/dist/runner/sandboxed-command.d.ts +24 -10
- package/dist/runner/sandboxed-command.js +37 -12
- 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-BFLYGMG3.js +0 -607
- package/dist/chunks/chunk-HOKDKP5A.js +0 -49
- package/dist/chunks/chunk-IVRRGGCD.js +0 -201
- package/dist/chunks/chunk-NMVODY3P.js +0 -19
- 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
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// them when the run ended, so a past run reads the same after a resource definition is renamed or its extension
|
|
7
7
|
// removed.
|
|
8
8
|
import { z } from "zod";
|
|
9
|
-
import { commandExitStatus, } from "../core/index.js";
|
|
9
|
+
import { commandExitStatus, SANDBOX_FAILED_STAGES, acrossSandboxesExitStatus, } from "../core/index.js";
|
|
10
10
|
import { planSchema } from "./plan.js";
|
|
11
11
|
const testTotalsSchema = z.object({
|
|
12
12
|
passed: z.number().int().nonnegative(),
|
|
@@ -18,6 +18,8 @@ const endedSchema = z.object({
|
|
|
18
18
|
exitCode: z.number().int().nullable(),
|
|
19
19
|
signal: z.string().nullable(),
|
|
20
20
|
ms: z.number().nonnegative().nullable(),
|
|
21
|
+
// Absent in a record that storm 0.13.0 wrote.
|
|
22
|
+
wallMs: z.number().nonnegative().exactOptional(),
|
|
21
23
|
tests: testTotalsSchema.nullable(),
|
|
22
24
|
testsIncomplete: z.string().nullable(),
|
|
23
25
|
resources: z.record(z.string(), z.object({ definition: z.string(), facts: z.unknown() })).nullable(),
|
|
@@ -30,9 +32,9 @@ const snapshotSchema = z.object({
|
|
|
30
32
|
builtBehind: z.number().nullable(),
|
|
31
33
|
});
|
|
32
34
|
const whereSchema = z.discriminatedUnion("kind", [
|
|
33
|
-
z.object({ kind: z.literal("
|
|
35
|
+
z.object({ kind: z.literal("launch-machine") }),
|
|
34
36
|
z.object({
|
|
35
|
-
kind: z.literal("
|
|
37
|
+
kind: z.literal("vercel-sandbox"),
|
|
36
38
|
team: z.string(),
|
|
37
39
|
project: z.string(),
|
|
38
40
|
region: z.string(),
|
|
@@ -47,16 +49,60 @@ const whereSchema = z.discriminatedUnion("kind", [
|
|
|
47
49
|
}),
|
|
48
50
|
]);
|
|
49
51
|
const gitSchema = z.object({ branch: z.string().nullable(), commit: z.string(), dirty: z.boolean() });
|
|
52
|
+
/** One runner sandbox of a run across runner sandboxes, as `run.json`, `storm runs`, and `sandboxes_ran` report it. */
|
|
53
|
+
export const sandboxRecordSchema = z.object({
|
|
54
|
+
/** The runner sandbox index, from 0. */
|
|
55
|
+
sandbox: z.number().int().nonnegative(),
|
|
56
|
+
/** The runner sandbox's command. */
|
|
57
|
+
argv: z.array(z.string()).readonly(),
|
|
58
|
+
/**
|
|
59
|
+
* The file list: the test files the runner sandbox runs, as paths relative to the project; null for a storm exec run.
|
|
60
|
+
*/
|
|
61
|
+
files: z.array(z.string()).readonly().nullable(),
|
|
62
|
+
/** The runner sandbox state: passed, failed, not-started, canceled, or pending while the run goes on. */
|
|
63
|
+
state: z.enum(["pending", "passed", "failed", "not-started", "canceled"]),
|
|
64
|
+
/** The factual stage that failed; null when passed, canceled, pending, or recorded by an older storm. */
|
|
65
|
+
failedStage: z.enum(SANDBOX_FAILED_STAGES).nullable(),
|
|
66
|
+
/** The command's exit code; null when no command ended with one. */
|
|
67
|
+
exitCode: z.number().int().nullable(),
|
|
68
|
+
/**
|
|
69
|
+
* One line that says why the runner sandbox is failed without an exit code, not-started, or canceled; null otherwise.
|
|
70
|
+
*/
|
|
71
|
+
cause: z.string().nullable(),
|
|
72
|
+
/** The runner sandbox's name; null when none started. */
|
|
73
|
+
name: z.string().nullable(),
|
|
74
|
+
/** When the runner sandbox the run kept stops, as an ISO time; null when it was not kept. */
|
|
75
|
+
keptUntil: z.string().nullable(),
|
|
76
|
+
/**
|
|
77
|
+
* From the run's start to the start of the runner sandbox's command, in milliseconds; null when the command never
|
|
78
|
+
* started.
|
|
79
|
+
*/
|
|
80
|
+
preparedMs: z.number().nonnegative().nullable(),
|
|
81
|
+
/** How long the command took, in milliseconds; null when it did not end on its own. */
|
|
82
|
+
commandMs: z.number().nonnegative().nullable(),
|
|
83
|
+
/** The runner sandbox's tests' totals, by their final results; null without one. */
|
|
84
|
+
tests: testTotalsSchema.nullable(),
|
|
85
|
+
/** The last lines of the runner sandbox's command log, for a runner sandbox that is not passed; empty otherwise. */
|
|
86
|
+
tail: z.array(z.string()).readonly(),
|
|
87
|
+
});
|
|
88
|
+
/** How many of its command log's last lines a runner sandbox record keeps. */
|
|
89
|
+
export const SANDBOX_TAIL_LINES = 20;
|
|
50
90
|
const runRecordSchema = z.object({
|
|
51
91
|
version: z.literal(5),
|
|
52
92
|
startedAt: z.string(),
|
|
53
93
|
cwd: z.string(),
|
|
54
94
|
configFile: z.string().nullable(),
|
|
55
95
|
argv: z.array(z.string()).readonly(),
|
|
56
|
-
|
|
96
|
+
/** The driver name for a driver run (`vitest`, `playwright`); absent for a run with no driver (`storm exec`). */
|
|
97
|
+
driver: z.string().exactOptional(),
|
|
98
|
+
/** The suite name for a `storm test` run (`null` for the project's tests); absent for other run commands. */
|
|
99
|
+
suite: z.string().nullable().exactOptional(),
|
|
100
|
+
// Only a run that counted tests has one.
|
|
57
101
|
plan: planSchema.exactOptional(),
|
|
58
102
|
where: whereSchema,
|
|
59
103
|
git: gitSchema.nullable(),
|
|
104
|
+
// Only a run across runner sandboxes has it.
|
|
105
|
+
sandboxes: z.array(sandboxRecordSchema).readonly().exactOptional(),
|
|
60
106
|
ended: endedSchema.exactOptional(),
|
|
61
107
|
});
|
|
62
108
|
/** `run.json`'s text for `record`. */
|
|
@@ -103,33 +149,41 @@ export function testTotals(events) {
|
|
|
103
149
|
* ran outcome's acquired resources' result facts, with the rows `storm runs show` lists for them, each rendered when
|
|
104
150
|
* the resource's acquire answered, so a past run shows them without the definitions that made them.
|
|
105
151
|
*/
|
|
106
|
-
export function runEnd(outcome, ran, tests, reports) {
|
|
152
|
+
export function runEnd(outcome, ran, tests, reports, wallMs) {
|
|
107
153
|
const command = outcome.kind === "ran" ? outcome.command : undefined;
|
|
108
|
-
const ranRecords = outcome.kind === "ran" ? outcome.resources : undefined;
|
|
109
|
-
const ms = ran?.outcome === undefined || ran.outcome === "stopped" || ran.endedAt === undefined
|
|
110
|
-
? null
|
|
111
|
-
: ran.endedAt - ran.startedAt;
|
|
154
|
+
const ranRecords = outcome.kind === "ran" || outcome.kind === "sandboxes_ran" ? outcome.resources : undefined;
|
|
112
155
|
return {
|
|
113
156
|
outcome: outcome.kind,
|
|
114
|
-
exitCode:
|
|
157
|
+
exitCode: outcome.kind === "sandboxes_ran"
|
|
158
|
+
? acrossSandboxesExitStatus(outcome.sandboxes)
|
|
159
|
+
: command === undefined
|
|
160
|
+
? null
|
|
161
|
+
: commandExitStatus(command),
|
|
115
162
|
signal: command?.kind === "signaled" ? command.signal : null,
|
|
116
|
-
ms,
|
|
163
|
+
ms: commandMs(ran),
|
|
164
|
+
wallMs,
|
|
117
165
|
tests: testTotals(tests.events),
|
|
118
166
|
testsIncomplete: tests.incomplete ?? null,
|
|
119
167
|
resources: ranRecords === undefined ? null : reports.ranFacts(ranRecords),
|
|
120
168
|
resourceRows: ranRecords === undefined ? [] : reports.ranRows(ranRecords),
|
|
121
169
|
};
|
|
122
170
|
}
|
|
171
|
+
/** How long a command took, from its state once it ended on its own; null when it never did, or the run stopped it. */
|
|
172
|
+
function commandMs(ran) {
|
|
173
|
+
return ran?.outcome === undefined || ran.outcome === "stopped" || ran.endedAt === undefined
|
|
174
|
+
? null
|
|
175
|
+
: ran.endedAt - ran.startedAt;
|
|
176
|
+
}
|
|
123
177
|
/**
|
|
124
|
-
* Where the command runs, as `run.json` records it as the run starts:
|
|
125
|
-
* no sandbox or snapshot yet.
|
|
178
|
+
* Where the command runs, as `run.json` records it as the run starts: on the launch machine (`launch-machine`), or in
|
|
179
|
+
* a Vercel Sandbox (`vercel-sandbox`), with no sandbox or snapshot yet.
|
|
126
180
|
*/
|
|
127
181
|
export function startedWhere(run) {
|
|
128
182
|
if (run.runner === undefined)
|
|
129
|
-
return { kind: "
|
|
183
|
+
return { kind: "launch-machine" };
|
|
130
184
|
const { prepared, target } = run.runner;
|
|
131
185
|
return {
|
|
132
|
-
kind: "
|
|
186
|
+
kind: "vercel-sandbox",
|
|
133
187
|
team: target.team,
|
|
134
188
|
project: target.project,
|
|
135
189
|
region: prepared.recipe.region,
|
|
@@ -144,12 +198,12 @@ export function startedWhere(run) {
|
|
|
144
198
|
};
|
|
145
199
|
}
|
|
146
200
|
/**
|
|
147
|
-
* `where` once the run is over, from the runner's final state: for a
|
|
148
|
-
* the runner snapshot it started from, which the run reused or built, when its timeout stops the
|
|
149
|
-
* kept running. Each is null when the run stopped before it, or kept no runner sandbox.
|
|
201
|
+
* `where` once the run is over, from the runner's final state: for a run in a runner sandbox, the runner sandbox the
|
|
202
|
+
* run started, the runner snapshot it started from, which the run reused or built, and when its timeout stops the
|
|
203
|
+
* runner sandbox it kept running. Each is null when the run stopped before it, or kept no runner sandbox.
|
|
150
204
|
*/
|
|
151
205
|
export function endedWhere(where, runner) {
|
|
152
|
-
if (where.kind === "
|
|
206
|
+
if (where.kind === "launch-machine")
|
|
153
207
|
return where;
|
|
154
208
|
const snapshot = runner?.snapshot;
|
|
155
209
|
return {
|
|
@@ -167,3 +221,48 @@ export function endedWhere(where, runner) {
|
|
|
167
221
|
uploadBytes: runner?.uploadBytes ?? null,
|
|
168
222
|
};
|
|
169
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* The record of runner sandbox `sandbox` as the run directory opens: `pending`, with its command and its file list
|
|
226
|
+
* (null for a `storm exec` run), and nothing else known yet.
|
|
227
|
+
*/
|
|
228
|
+
export function pendingSandboxRecord(request) {
|
|
229
|
+
return {
|
|
230
|
+
sandbox: request.sandbox,
|
|
231
|
+
argv: [...request.argv],
|
|
232
|
+
files: request.files === null ? null : [...request.files],
|
|
233
|
+
state: "pending",
|
|
234
|
+
failedStage: null,
|
|
235
|
+
exitCode: null,
|
|
236
|
+
cause: null,
|
|
237
|
+
name: null,
|
|
238
|
+
keptUntil: null,
|
|
239
|
+
preparedMs: null,
|
|
240
|
+
commandMs: null,
|
|
241
|
+
tests: null,
|
|
242
|
+
tail: [],
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* The record of runner sandbox `sandbox` once it ended (`ended`: its runner sandbox state, exit code, and cause), with
|
|
247
|
+
* `state` folded from its events: its command (`argv`), its file list (`files`, null for a `storm exec` run), its test
|
|
248
|
+
* totals, and the last `SANDBOX_TAIL_LINES` lines of `tail`, its command log's last lines, unless it passed.
|
|
249
|
+
*/
|
|
250
|
+
export function sandboxRecord(request) {
|
|
251
|
+
const { command, runner } = request.state;
|
|
252
|
+
const { state, failedStage, exitCode, cause } = request.ended;
|
|
253
|
+
return {
|
|
254
|
+
sandbox: request.sandbox,
|
|
255
|
+
argv: [...request.argv],
|
|
256
|
+
files: request.files === null ? null : [...request.files],
|
|
257
|
+
state,
|
|
258
|
+
failedStage,
|
|
259
|
+
exitCode,
|
|
260
|
+
cause,
|
|
261
|
+
name: runner?.sandbox?.name ?? null,
|
|
262
|
+
keptUntil: runner?.kept?.stopsAt ?? null,
|
|
263
|
+
preparedMs: command === undefined ? null : Math.max(0, command.startedAt - request.startedAt.getTime()),
|
|
264
|
+
commandMs: commandMs(command),
|
|
265
|
+
tests: request.tests === null ? null : { ...request.tests },
|
|
266
|
+
tail: state === "passed" ? [] : request.tail.slice(-SANDBOX_TAIL_LINES),
|
|
267
|
+
};
|
|
268
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
/** Which row of the timeline: its name, and for a resource instance's lane the resource key, null for any other. */
|
|
8
8
|
const rowRefShape = {
|
|
9
|
-
/** The row's name: `mint`, a resource lane's name, `runner`, `
|
|
9
|
+
/** The row's name: `mint`, a resource lane's name, `runner`, `command`, or `cleanup`. */
|
|
10
10
|
name: z.string(),
|
|
11
11
|
/** For a resource instance's lane, the resource key; null for every other row. */
|
|
12
12
|
resource: z.string().nullable(),
|
|
@@ -20,7 +20,7 @@ export const timelineSchema = z.object({
|
|
|
20
20
|
/** From the run's start to its last event. */
|
|
21
21
|
totalMs: z.number(),
|
|
22
22
|
/**
|
|
23
|
-
* The
|
|
23
|
+
* The rows in order: mint, each resource instance's lane, runner, command, cleanup; each only when the run got that
|
|
24
24
|
* far.
|
|
25
25
|
*/
|
|
26
26
|
rows: z.array(z.object({
|
|
@@ -66,8 +66,8 @@ export function timelineFacts(timeline, laneKinds) {
|
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
|
-
* A
|
|
70
|
-
* such as `<lane>-setup`, the runner's setup, the
|
|
69
|
+
* A row as the waterfall and the job summary name it: the credential, each resource lane by its presentation's label,
|
|
70
|
+
* such as `<lane>-setup`, the runner's setup, the command, and the cleanup.
|
|
71
71
|
*/
|
|
72
72
|
function laneLabel(name, laneKinds) {
|
|
73
73
|
if (name === "mint")
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { SandboxCredential } from "../sdk/extension/index.ts";
|
|
1
2
|
import type { RunnerContext } from "./context.ts";
|
|
2
3
|
import type { RunnerFailure, RunnerProgress } from "./events.ts";
|
|
3
4
|
import type { CheckoutHead, RunnerSnapshotCacheFailure, RunnerSnapshotEntry, SandboxAccess } from "./gateways.ts";
|
|
4
5
|
import type { PrepareRunnerOutcome, RunnerPrepareContext } from "./prepare.ts";
|
|
5
6
|
import type { CheckedRecipe } from "./recipe.ts";
|
|
6
7
|
import { type RunnerScopeFacts } from "./scope.ts";
|
|
7
|
-
import type { RunnerSecrets } from "./secrets.ts";
|
|
8
8
|
import { type BaseSnapshotPlan } from "./snapshot-build.ts";
|
|
9
9
|
/** What `prepareSnapshotBuild` checks: where, which recipe, and what to build. */
|
|
10
10
|
export interface SnapshotBuildRequest {
|
|
@@ -56,15 +56,15 @@ export type PrepareSnapshotBuildOutcome = {
|
|
|
56
56
|
* and, when it builds at the merge-base, HEAD's count of commits after it. It never mints, acquires or creates, and removes no cache file.
|
|
57
57
|
*/
|
|
58
58
|
export declare function prepareSnapshotBuild(context: RunnerPrepareContext, request: SnapshotBuildRequest): Promise<PrepareSnapshotBuildOutcome>;
|
|
59
|
-
/** What `buildSnapshots` is handed: the checked build, where its sandboxes run, who starts them, and the
|
|
59
|
+
/** What `buildSnapshots` is handed: the checked build, where its sandboxes run, who starts them, and the credentials. */
|
|
60
60
|
export interface BuildSnapshotsRequest {
|
|
61
61
|
readonly build: PreparedSnapshotBuild;
|
|
62
62
|
/** The minted credential, and the team and project it names: the sandboxes run there. */
|
|
63
63
|
readonly access: SandboxAccess;
|
|
64
64
|
/** The local user, for each sandbox's `user` tag. */
|
|
65
65
|
readonly user: string;
|
|
66
|
-
/** The
|
|
67
|
-
readonly
|
|
66
|
+
/** The recipe's credentials, with their values: the firewall adds every one while the recipe's snapshot steps run. */
|
|
67
|
+
readonly credentials: readonly Required<SandboxCredential>[];
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
70
|
* How a build ended, before its sandbox scope closed.
|
|
@@ -106,9 +106,9 @@ export type SnapshotBuildOutcome = SnapshotBuildEnd & {
|
|
|
106
106
|
/**
|
|
107
107
|
* Builds the checked build's base snapshot, reporting to `progress`, and closes every sandbox it started however it
|
|
108
108
|
* ends, keeping none. A cached base snapshot at the commit for the access's team and project is up to date, unless
|
|
109
|
-
* `full`, which builds a new one that replaces its cache entry. `signal`
|
|
110
|
-
*
|
|
111
|
-
* once and ends `aborted` with what it saved.
|
|
109
|
+
* `full`, which builds a new one that replaces its cache entry. `signal` cancels it in any stage: the scope says so,
|
|
110
|
+
* revokes every credential at once, and stops its sandboxes. A base snapshot's save isn't stopped by the signal, so
|
|
111
|
+
* after it the build checks the signal once and ends `aborted` with what it saved.
|
|
112
112
|
*/
|
|
113
113
|
export declare function buildSnapshots(context: RunnerContext, request: BuildSnapshotsRequest, control: {
|
|
114
114
|
readonly signal: AbortSignal;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// merge-base. It owns its sandbox scope from its first stage to its end, as a run's runner session does. It
|
|
4
4
|
// acquires no resource, runs no command, and keeps no sandbox.
|
|
5
5
|
import { resolveBase } from "./base.js";
|
|
6
|
+
import { runnerNetworkPolicy } from "./network-policy.js";
|
|
6
7
|
import { runnerSandboxScope } from "./scope.js";
|
|
7
8
|
import { buildSnapshot } from "./snapshot-build.js";
|
|
8
9
|
import { hasTimeLeft } from "./snapshot-cache.js";
|
|
@@ -91,34 +92,29 @@ export async function prepareSnapshotBuild(context, request) {
|
|
|
91
92
|
/**
|
|
92
93
|
* Builds the checked build's base snapshot, reporting to `progress`, and closes every sandbox it started however it
|
|
93
94
|
* ends, keeping none. A cached base snapshot at the commit for the access's team and project is up to date, unless
|
|
94
|
-
* `full`, which builds a new one that replaces its cache entry. `signal`
|
|
95
|
-
*
|
|
96
|
-
* once and ends `aborted` with what it saved.
|
|
95
|
+
* `full`, which builds a new one that replaces its cache entry. `signal` cancels it in any stage: the scope says so,
|
|
96
|
+
* revokes every credential at once, and stops its sandboxes. A base snapshot's save isn't stopped by the signal, so
|
|
97
|
+
* after it the build checks the signal once and ends `aborted` with what it saved.
|
|
97
98
|
*/
|
|
98
99
|
export async function buildSnapshots(context, request, control, progress) {
|
|
99
100
|
const { signal } = control;
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
stop();
|
|
107
|
-
else
|
|
108
|
-
signal.addEventListener("abort", stop, { once: true });
|
|
101
|
+
// When the build is canceled, the scope stops its sandboxes and revokes every credential at once.
|
|
102
|
+
const scope = runnerSandboxScope(context, progress, {
|
|
103
|
+
keepMs: 0,
|
|
104
|
+
basePolicy: runnerNetworkPolicy(request.build.plan.recipe),
|
|
105
|
+
signal,
|
|
106
|
+
});
|
|
109
107
|
try {
|
|
110
108
|
const ended = await buildIn(context, request, { scope, signal }, progress);
|
|
111
|
-
signal.removeEventListener("abort", stop);
|
|
112
109
|
return { ...ended, cleanup: await scope.close() };
|
|
113
110
|
}
|
|
114
111
|
catch (error) {
|
|
115
|
-
signal.removeEventListener("abort", stop);
|
|
116
112
|
await scope.close();
|
|
117
113
|
throw error;
|
|
118
114
|
}
|
|
119
115
|
}
|
|
120
116
|
async function buildIn(context, request, control, progress) {
|
|
121
|
-
const { build, access, user,
|
|
117
|
+
const { build, access, user, credentials } = request;
|
|
122
118
|
const { signal } = control;
|
|
123
119
|
if (signal.aborted)
|
|
124
120
|
return { kind: "aborted", snapshot: null };
|
|
@@ -130,7 +126,7 @@ async function buildIn(context, request, control, progress) {
|
|
|
130
126
|
prepared: build.plan,
|
|
131
127
|
access,
|
|
132
128
|
user,
|
|
133
|
-
|
|
129
|
+
credentials,
|
|
134
130
|
why: why === "no-snapshot" ? { kind: why, rejected: [] } : { kind: why },
|
|
135
131
|
}, control, progress);
|
|
136
132
|
if (built.kind === "aborted")
|
package/dist/runner/events.d.ts
CHANGED
|
@@ -20,7 +20,10 @@ export interface NotDeletedSandbox {
|
|
|
20
20
|
readonly role: RunnerSandboxRole;
|
|
21
21
|
readonly message: string;
|
|
22
22
|
}
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* The runner sandbox a run kept running once it ended, with no network access, and when its timeout stops it, as an
|
|
25
|
+
* ISO time.
|
|
26
|
+
*/
|
|
24
27
|
export interface KeptSandbox {
|
|
25
28
|
readonly name: string;
|
|
26
29
|
readonly stopsAt: string;
|
|
@@ -65,10 +68,10 @@ export type SnapshotBuildReason = {
|
|
|
65
68
|
* terminal.
|
|
66
69
|
* - `command-stopped`: the run killed the command, on a signal, and stopped following its output.
|
|
67
70
|
* - `stopping`: a signal arrived and the run is stopping: killing the command when `commandRunning`, then stopping
|
|
68
|
-
*
|
|
69
|
-
* and
|
|
71
|
+
* the runner's sandboxes, but for the runner sandbox it keeps running `keepMs` when that is above 0, releasing the
|
|
72
|
+
* run's resources, and then deleting the stopped sandboxes and keeping the kept one running.
|
|
70
73
|
* - `waiting-for-snapshot`: closing waits up to `settleMs` for a runner snapshot still saving.
|
|
71
|
-
* - `sandbox-kept`: closing kept runner sandbox `name` running until `stopsAt`, an ISO time.
|
|
74
|
+
* - `sandbox-kept`: closing kept runner sandbox `name` running until `stopsAt`, an ISO time, with no network access.
|
|
72
75
|
*/
|
|
73
76
|
export type RunnerEvent = {
|
|
74
77
|
readonly kind: "snapshot-reused";
|
|
@@ -145,17 +148,21 @@ export type RunnerEvent = {
|
|
|
145
148
|
} | {
|
|
146
149
|
readonly kind: "waiting-for-snapshot";
|
|
147
150
|
readonly settleMs: number;
|
|
148
|
-
} | {
|
|
151
|
+
} | ({
|
|
149
152
|
readonly kind: "sandbox-kept";
|
|
150
|
-
|
|
151
|
-
readonly stopsAt: string;
|
|
152
|
-
};
|
|
153
|
+
} & KeptSandbox);
|
|
153
154
|
/** Hears the runner's events as they happen. */
|
|
154
155
|
export interface RunnerProgress {
|
|
155
156
|
emit(event: RunnerEvent): Promise<void>;
|
|
156
157
|
}
|
|
157
158
|
/** What a Sandbox call was doing when it failed, as `sandbox-api-failed` names it. */
|
|
158
159
|
export type RunnerSandboxCall = "start-build-sandbox" | "start-runner-sandbox" | "upload" | "run-script" | "login-path" | "run-command" | "save-snapshot";
|
|
160
|
+
/**
|
|
161
|
+
* Where a network policy write that puts credentials in place or removes them was: around the recipe's snapshot steps
|
|
162
|
+
* (its toolchain and prebuild steps, in the build sandbox), around its run steps (its install and build steps, in the
|
|
163
|
+
* runner sandbox), before a snapshot save, or around the command.
|
|
164
|
+
*/
|
|
165
|
+
export type NetworkPolicyPlace = "snapshot-steps" | "run-steps" | "snapshot-save" | "command";
|
|
159
166
|
/**
|
|
160
167
|
* Why the runner couldn't run the command.
|
|
161
168
|
*
|
|
@@ -163,6 +170,13 @@ export type RunnerSandboxCall = "start-build-sandbox" | "start-runner-sandbox" |
|
|
|
163
170
|
* without an exit code (`exitCode` null); `tail` is its last 40 output lines.
|
|
164
171
|
* - `sandbox-api-failed`: a Sandbox call failed; `status` is the HTTP status when the API answered one.
|
|
165
172
|
* - `checkout-failed`: git or tar failed on this machine, packing the base's files or the run's changes.
|
|
173
|
+
* - `network-policy-failed`: a network policy write that puts credentials in place or removes them failed, `around`
|
|
174
|
+
* one of four places: the recipe's snapshot steps (`snapshot-steps`) or its run steps (`run-steps`), whose
|
|
175
|
+
* credentials it puts in place before the first of them (`inject`; none of them ran); a snapshot save
|
|
176
|
+
* (`snapshot-save`), before which the scope removes them (`remove`); or the command (`command`), whose resources'
|
|
177
|
+
* credentials it puts in place before the command starts (`inject`; the command didn't run). `reason` is `api`, with
|
|
178
|
+
* the HTTP status when the API answered one, or `timed-out`. It holds no credential's value. After a failed removal
|
|
179
|
+
* the scope keeps no snapshot or runner sandbox of that sandbox.
|
|
166
180
|
*/
|
|
167
181
|
export type RunnerFailure = {
|
|
168
182
|
readonly kind: "snapshot-build-step-failed" | "apply-failed" | "install-failed" | "build-failed";
|
|
@@ -177,6 +191,13 @@ export type RunnerFailure = {
|
|
|
177
191
|
} | {
|
|
178
192
|
readonly kind: "checkout-failed";
|
|
179
193
|
readonly failure: CheckoutFailure;
|
|
194
|
+
} | {
|
|
195
|
+
readonly kind: "network-policy-failed";
|
|
196
|
+
readonly operation: "inject" | "remove";
|
|
197
|
+
readonly around: NetworkPolicyPlace;
|
|
198
|
+
readonly reason: "api" | "timed-out";
|
|
199
|
+
readonly status: number | null;
|
|
200
|
+
readonly message: string;
|
|
180
201
|
};
|
|
181
202
|
/** How one stage of readying the runner ended: its value, a failure, or a stop because the run was aborted. */
|
|
182
203
|
export type RunnerStage<T> = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Credential } from "../credential/index.ts";
|
|
2
|
+
import type { SandboxCredential } from "../sdk/extension/index.ts";
|
|
2
3
|
/** Why a checkout operation failed: what git or tar said, and the command that failed when there was one. */
|
|
3
4
|
export interface CheckoutFailure {
|
|
4
5
|
readonly message: string;
|
|
@@ -212,13 +213,44 @@ export interface RunnerSandbox {
|
|
|
212
213
|
/** How long it may live, in milliseconds, after which the Sandbox API stops it. */
|
|
213
214
|
readonly timeoutMs: number;
|
|
214
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* The network policy of a sandbox: what it may reach. A runner snapshot carries no policy, so every create passes one,
|
|
218
|
+
* and a write to a running sandbox replaces its whole policy. storm always builds the whole policy from what the run
|
|
219
|
+
* knows and never reads one back.
|
|
220
|
+
*
|
|
221
|
+
* It is a union by `kind`:
|
|
222
|
+
*
|
|
223
|
+
* - `allow-all`: every domain is reachable. With `credentials` (normalized `SandboxCredential`s, each with lowercased
|
|
224
|
+
* domain and header and `requests` given), the firewall adds each credential's header to the requests to its domain
|
|
225
|
+
* that its `requests` names: for `read`, `GET` and `HEAD` requests, and it answers every other request to that domain
|
|
226
|
+
* with 403; for `all`, every request. Every other domain stays fully reachable.
|
|
227
|
+
* - `custom`: only the allowed domains and the domain of each credential in place are reachable, and every other
|
|
228
|
+
* domain doesn't resolve. An allowed domain is a hostname or a wildcard with one leading `*.`. Each credential's
|
|
229
|
+
* domain gets the same rules as under `allow-all`. A recipe's `allowedDomains` gives the list.
|
|
230
|
+
* - `deny-all`: no domain is reachable, and no credential is in place. A run writes it to the runner sandbox it keeps
|
|
231
|
+
* before it releases its resources.
|
|
232
|
+
*
|
|
233
|
+
* Two credentials in one policy for one domain have the same `requests`, since the firewall has one rule set per
|
|
234
|
+
* domain.
|
|
235
|
+
*/
|
|
236
|
+
export type RunnerNetworkPolicy = {
|
|
237
|
+
readonly kind: "allow-all";
|
|
238
|
+
readonly credentials: readonly Required<SandboxCredential>[];
|
|
239
|
+
} | {
|
|
240
|
+
readonly kind: "custom";
|
|
241
|
+
readonly allowedDomains: readonly string[];
|
|
242
|
+
readonly credentials: readonly Required<SandboxCredential>[];
|
|
243
|
+
} | {
|
|
244
|
+
readonly kind: "deny-all";
|
|
245
|
+
};
|
|
215
246
|
/** What every sandbox is created with, whatever it starts from. */
|
|
216
247
|
export interface RunnerSandboxPlacement {
|
|
217
248
|
readonly region: string;
|
|
218
249
|
readonly vcpus: number;
|
|
219
250
|
readonly timeoutMs: number;
|
|
220
|
-
/** At most 5: `purpose`, `user
|
|
251
|
+
/** At most 5: `purpose`, `user`, and `role`. */
|
|
221
252
|
readonly tags: Readonly<Record<string, string>>;
|
|
253
|
+
readonly networkPolicy: RunnerNetworkPolicy;
|
|
222
254
|
}
|
|
223
255
|
/**
|
|
224
256
|
* Why a Sandbox call failed.
|
|
@@ -332,6 +364,12 @@ export interface RunnerSandboxGateway {
|
|
|
332
364
|
readonly path: string;
|
|
333
365
|
readonly fromLine: number;
|
|
334
366
|
}, onOutput: (chunk: SandboxOutputChunk) => void, signal?: AbortSignal): Promise<RunnerSandboxOperation>;
|
|
367
|
+
/**
|
|
368
|
+
* Replaces a running sandbox's whole network policy with `policy`, which takes effect on its next requests. It never
|
|
369
|
+
* reads the policy back. A failed write may have changed the policy or not: the Sandbox API's update isn't atomic.
|
|
370
|
+
* Aborting `signal` stops the write and answers `aborted`. A failure's message holds no credential's value.
|
|
371
|
+
*/
|
|
372
|
+
writeNetworkPolicy(sandbox: RunnerSandbox, policy: RunnerNetworkPolicy, signal?: AbortSignal): Promise<RunnerSandboxOperation>;
|
|
335
373
|
/** Saves a build sandbox as a runner snapshot that expires after `expirationMs`; that stops the sandbox. */
|
|
336
374
|
saveSnapshot(sandbox: RunnerSandbox, request: {
|
|
337
375
|
readonly expirationMs: number;
|
|
@@ -342,23 +380,36 @@ export interface RunnerSandboxGateway {
|
|
|
342
380
|
* fails with `processes-running` when it can't confirm one ended. A script or command asked to start once it began
|
|
343
381
|
* answers `aborted` and starts nothing. Then it keeps the sandbox running at least `until`, extending its timeout
|
|
344
382
|
* when it would stop sooner, and answers when it stops: `until`, or later when its timeout already reached past it.
|
|
345
|
-
* The Sandbox API can extend a running sandbox's timeout but never shorten it.
|
|
383
|
+
* The Sandbox API can extend a running sandbox's timeout but never shorten it. Each kill has a time limit of its
|
|
384
|
+
* own. Aborting `signal` stops the call and answers `aborted`; the sandbox may then be extended or not.
|
|
346
385
|
*/
|
|
347
386
|
keepRunning(sandbox: RunnerSandbox, request: {
|
|
348
387
|
readonly until: Date;
|
|
349
|
-
}): Promise<RunnerSandboxResult<{
|
|
388
|
+
}, signal?: AbortSignal): Promise<RunnerSandboxResult<{
|
|
350
389
|
readonly stopsAt: Date;
|
|
351
390
|
}, RunnerKeepFailure>>;
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
391
|
+
/** Stops a sandbox, which ends every process in it. Aborting `signal` stops the call and answers `aborted`. */
|
|
392
|
+
stop(sandbox: RunnerSandbox, signal?: AbortSignal): Promise<RunnerSandboxOperation>;
|
|
393
|
+
/**
|
|
394
|
+
* Deletes a sandbox, keeping every snapshot it was started from or saved as. Aborting `signal` stops the call and
|
|
395
|
+
* answers `aborted`.
|
|
396
|
+
*/
|
|
397
|
+
delete(sandbox: RunnerSandbox, signal?: AbortSignal): Promise<RunnerSandboxOperation>;
|
|
355
398
|
}
|
|
399
|
+
/**
|
|
400
|
+
* What color environment variable the launcher terminal asks the command to receive when the command's own
|
|
401
|
+
* environment sets neither `FORCE_COLOR` nor `NO_COLOR`:
|
|
402
|
+
* - `"on"`: set `FORCE_COLOR=1` (stdout is a TTY, or launcher `FORCE_COLOR` turns color on).
|
|
403
|
+
* - `"off"`: set `NO_COLOR=1` (`--no-color` was passed, or launcher `NO_COLOR` is set and non-empty).
|
|
404
|
+
* - `"auto"`: set neither (non-TTY launcher with no explicit color setting, or `FORCE_COLOR` set to `0` or `false`).
|
|
405
|
+
*/
|
|
406
|
+
export type RunnerTerminalColor = "on" | "off" | "auto";
|
|
356
407
|
/**
|
|
357
408
|
* The terminal the command's output reaches, wherever the command runs, a DI seam: stdout and stderr, and whether the
|
|
358
|
-
* terminal
|
|
409
|
+
* launcher terminal asks the command for color. Writes never throw.
|
|
359
410
|
*/
|
|
360
411
|
export interface RunnerTerminal {
|
|
361
|
-
readonly color:
|
|
412
|
+
readonly color: RunnerTerminalColor;
|
|
362
413
|
writeStdout(text: string): void;
|
|
363
414
|
writeStderr(text: string): void;
|
|
364
415
|
}
|
package/dist/runner/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { RunnerContext } from "./context.ts";
|
|
2
2
|
export { buildSnapshots, prepareSnapshotBuild, type PrepareSnapshotBuildOutcome, type SnapshotBuildOutcome, } from "./build-snapshots.ts";
|
|
3
3
|
export { type KeptSandbox, type RunnerEvent, type RunnerFailure, type RunnerProgress, type RunnerStepPhase, type SnapshotBuildReason, } from "./events.ts";
|
|
4
|
-
export type { CheckoutFailure, CheckoutGateway, RunnerSandboxGateway, RunnerSnapshotCacheFailure, RunnerSnapshotCacheGateway, RunnerSnapshotEntry, RunnerTerminal, } from "./gateways.ts";
|
|
4
|
+
export type { CheckoutFailure, CheckoutGateway, RunnerSandboxGateway, SandboxAccess, RunnerSnapshotCacheFailure, RunnerSnapshotCacheGateway, RunnerSnapshotEntry, RunnerTerminal, RunnerTerminalColor, } from "./gateways.ts";
|
|
5
5
|
export { liveCheckoutGateway } from "./live/checkout-gateway.ts";
|
|
6
6
|
export { liveRunnerSandboxGateway } from "./live/sandbox-gateway.ts";
|
|
7
7
|
export { liveRunnerTerminal } from "./live/terminal.ts";
|
|
@@ -9,10 +9,12 @@ export { localUserName } from "./live/user.ts";
|
|
|
9
9
|
export { liveRunnerSnapshotCacheGateway, unavailableRunnerSnapshotCacheGateway, } from "./live/snapshot-cache-gateway.ts";
|
|
10
10
|
export { lineSplitter } from "./output.ts";
|
|
11
11
|
export { prepareRunner, type PrepareRunnerOutcome } from "./prepare.ts";
|
|
12
|
-
export type { ReadyRunnerOutcome } from "./ready.ts";
|
|
13
|
-
export { type CheckedRecipe, checkRecipe } from "./recipe.ts";
|
|
12
|
+
export type { ChosenSnapshot, ReadyRunnerOutcome } from "./ready.ts";
|
|
13
|
+
export { type CheckedRecipe, checkRecipe, MAX_RUNNER_SANDBOXES, resolveSandboxCountDefault, type SandboxCountDefault, type SandboxCountDefaultRun, type RunnerSandboxCount, } from "./recipe.ts";
|
|
14
|
+
export { chooseSnapshotForRun, type SnapshotChoice, type SnapshotChoiceEnd } from "./snapshot-choice.ts";
|
|
14
15
|
export { SANDBOX_TEST_EVENTS_PATH } from "./sandboxed-command.ts";
|
|
15
|
-
export {
|
|
16
|
+
export type { RunnerFenceOutcome } from "./scope.ts";
|
|
17
|
+
export { declaredSecretValues, readCredentials, readUnsafeSecretEnvVars, SECRET_MIN_LENGTH, type UnsafeSecretEnvVarMap, } from "./secrets.ts";
|
|
16
18
|
export { type RunnerCleanupFacts, openRunnerSession, type RunnerSession, type RunnerSessionCleanup, type RunnerSessionRequest, } from "./session.ts";
|
|
17
19
|
export { type InspectedSnapshot, inspectSnapshotCache, type SnapshotCacheInspection, type UnpickedReason, } from "./snapshot-inspect.ts";
|
|
18
20
|
export { type RejectedSnapshot, RUNNER_SNAPSHOTS_SUBPATH, type SnapshotCacheNote, type SnapshotRejectionReason, } from "./snapshot-cache.ts";
|
package/dist/runner/index.js
CHANGED
|
@@ -10,9 +10,10 @@ export { localUserName } from "./live/user.js";
|
|
|
10
10
|
export { liveRunnerSnapshotCacheGateway, unavailableRunnerSnapshotCacheGateway, } from "./live/snapshot-cache-gateway.js";
|
|
11
11
|
export { lineSplitter } from "./output.js";
|
|
12
12
|
export { prepareRunner } from "./prepare.js";
|
|
13
|
-
export { checkRecipe } from "./recipe.js";
|
|
13
|
+
export { checkRecipe, MAX_RUNNER_SANDBOXES, resolveSandboxCountDefault, } from "./recipe.js";
|
|
14
|
+
export { chooseSnapshotForRun } from "./snapshot-choice.js";
|
|
14
15
|
export { SANDBOX_TEST_EVENTS_PATH } from "./sandboxed-command.js";
|
|
15
|
-
export { declaredSecretValues,
|
|
16
|
+
export { declaredSecretValues, readCredentials, readUnsafeSecretEnvVars, SECRET_MIN_LENGTH, } from "./secrets.js";
|
|
16
17
|
export { openRunnerSession, } from "./session.js";
|
|
17
18
|
export { inspectSnapshotCache, } from "./snapshot-inspect.js";
|
|
18
19
|
export { RUNNER_SNAPSHOTS_SUBPATH, } from "./snapshot-cache.js";
|