@cnc-tools/storm 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/storm.js +54 -40
- package/dist/build-info.js +1 -1
- package/dist/chunks/{chunk-VL7WFTVQ.js → chunk-24UYAK4R.js} +465 -365
- package/dist/chunks/{chunk-DC2CDHNK.js → chunk-2JMWUKH3.js} +2074 -473
- package/dist/chunks/{chunk-FOZWA52V.js → chunk-3VXZONGE.js} +481 -376
- package/dist/chunks/{chunk-ZG3WQ4UF.js → chunk-55O4FCN4.js} +1 -1
- package/dist/chunks/{chunk-CN4EFA5J.js → chunk-72ZFEMAW.js} +1 -1
- package/dist/chunks/chunk-AS37D43E.js +2173 -0
- package/dist/chunks/chunk-CQAY6GLP.js +1260 -0
- package/dist/chunks/chunk-DZLU7BYK.js +340 -0
- package/dist/chunks/{chunk-R7XVBZOY.js → chunk-EEENLQHE.js} +59 -11
- package/dist/chunks/{chunk-TJNFVNKR.js → chunk-EI3XDCEI.js} +1 -1
- package/dist/chunks/{chunk-HVNK3I45.js → chunk-FDUY3BNF.js} +1 -1
- package/dist/chunks/{chunk-FCQUJDA4.js → chunk-GUCCYCIO.js} +4 -189
- package/dist/chunks/{chunk-OIY3DMF2.js → chunk-HBI4LEMH.js} +3 -3
- package/dist/chunks/{chunk-2MAD5NKK.js → chunk-K4MDQPLW.js} +1 -18
- package/dist/chunks/chunk-KK7PAWIZ.js +198 -0
- package/dist/chunks/{chunk-G3PHMXH5.js → chunk-KQ5FXRUD.js} +18 -1
- package/dist/chunks/{chunk-5VXBKPW6.js → chunk-LKXHGGGX.js} +1 -1
- package/dist/chunks/{chunk-P357TZAY.js → chunk-LOGHIUUB.js} +21 -18
- package/dist/chunks/{chunk-CK2GZEPK.js → chunk-OEPFINFT.js} +2 -2
- package/dist/chunks/{chunk-DWEAHX4T.js → chunk-OI4AP6Z7.js} +5 -5
- package/dist/chunks/{chunk-V4IKA3WI.js → chunk-PMBQWVTW.js} +26 -19
- package/dist/chunks/chunk-SZMYIIG2.js +88 -0
- package/dist/chunks/{chunk-5CCP36QQ.js → chunk-TXCOFC7N.js} +1 -1
- package/dist/chunks/{chunk-VUPZH7J2.js → chunk-UXD3TVWM.js} +1 -1
- package/dist/chunks/{chunk-3L52KNQA.js → chunk-WNW2QXQK.js} +8 -8
- package/dist/chunks/{chunk-AWBSONHB.js → chunk-XBDRVFEV.js} +55 -16
- package/dist/chunks/{live-app-WECQOQ4C.js → live-app-UY7BEDUN.js} +17 -13
- package/dist/cli.d.ts +28 -0
- package/dist/cli.js +64 -0
- package/dist/commands/exec/across-sandboxes-outcomes.d.ts +2 -2
- package/dist/commands/exec/across-sandboxes-outcomes.js +3 -3
- package/dist/commands/exec/before-run.d.ts +123 -0
- package/dist/commands/exec/before-run.js +105 -0
- package/dist/commands/exec/command.d.ts +67 -14
- package/dist/commands/exec/command.js +31 -95
- package/dist/commands/exec/driver-plan.d.ts +9 -4
- package/dist/commands/exec/driver-plan.js +8 -8
- package/dist/commands/exec/exec-words.js +1 -1
- package/dist/commands/exec/execute-run.d.ts +39 -0
- package/dist/commands/exec/execute-run.js +325 -0
- package/dist/commands/exec/live-view.d.ts +3 -3
- package/dist/commands/exec/live-view.js +16 -15
- package/dist/commands/exec/metadata.js +1 -1
- package/dist/commands/exec/mint-failed.d.ts +38 -0
- package/dist/commands/exec/mint-failed.js +27 -4
- package/dist/commands/exec/outcomes.d.ts +104 -22
- package/dist/commands/exec/outcomes.js +73 -26
- package/dist/commands/exec/plan-run.d.ts +58 -150
- package/dist/commands/exec/plan-run.js +239 -90
- package/dist/commands/exec/progress.d.ts +10 -6
- package/dist/commands/exec/progress.js +38 -25
- package/dist/commands/exec/run-bin.d.ts +11 -11
- package/dist/commands/exec/run-bin.js +9 -9
- package/dist/commands/exec/run-flags.d.ts +69 -0
- package/dist/commands/exec/run-flags.js +58 -0
- package/dist/commands/exec/run-metadata.js +4 -4
- package/dist/commands/exec/run-summary.d.ts +58 -0
- package/dist/commands/exec/run-summary.js +205 -0
- package/dist/commands/exec/runner-refusals.d.ts +82 -0
- package/dist/commands/exec/runner-refusals.js +71 -0
- package/dist/commands/exec/sandbox-progress.js +3 -0
- package/dist/commands/exec/stopped-outcome.d.ts +12 -0
- package/dist/commands/exec/stopped-outcome.js +77 -0
- package/dist/commands/exec/view.d.ts +20 -11
- package/dist/commands/exec/view.js +103 -47
- package/dist/commands/runs/facts.d.ts +8 -4
- package/dist/commands/runs/facts.js +19 -10
- package/dist/commands/runs/list/command.d.ts +16 -8
- package/dist/commands/runs/list/command.js +10 -10
- package/dist/commands/runs/list/outcomes.d.ts +8 -4
- package/dist/commands/runs/logs/command.js +10 -10
- package/dist/commands/runs/show/command.d.ts +16 -8
- package/dist/commands/runs/show/command.js +31 -29
- package/dist/commands/runs/show/metadata.js +1 -1
- package/dist/commands/runs/show/outcomes.d.ts +8 -4
- package/dist/commands/runs/show/outcomes.js +8 -6
- package/dist/commands/snapshots/access.d.ts +111 -0
- package/dist/commands/snapshots/access.js +96 -0
- package/dist/commands/snapshots/build/command.d.ts +376 -101
- package/dist/commands/snapshots/build/command.js +447 -149
- package/dist/commands/snapshots/build/metadata.d.ts +10 -0
- package/dist/commands/snapshots/build/metadata.js +31 -11
- package/dist/commands/snapshots/build/outcomes.d.ts +242 -47
- package/dist/commands/snapshots/build/outcomes.js +200 -36
- package/dist/commands/snapshots/list/command.d.ts +368 -27
- package/dist/commands/snapshots/list/command.js +298 -68
- package/dist/commands/snapshots/list/metadata.d.ts +16 -0
- package/dist/commands/snapshots/list/metadata.js +29 -6
- package/dist/commands/snapshots/list/outcomes.d.ts +247 -15
- package/dist/commands/snapshots/list/outcomes.js +223 -52
- package/dist/commands/snapshots/metadata.js +1 -1
- package/dist/commands/snapshots/prune/command.d.ts +430 -0
- package/dist/commands/snapshots/prune/command.js +161 -0
- package/dist/commands/snapshots/prune/metadata.d.ts +28 -0
- package/dist/commands/snapshots/prune/metadata.js +39 -0
- package/dist/commands/snapshots/prune/outcomes.d.ts +208 -0
- package/dist/commands/snapshots/prune/outcomes.js +78 -0
- package/dist/commands/suites/list/command.js +17 -17
- package/dist/commands/suites/list/outcomes.js +2 -2
- package/dist/commands/test/command.d.ts +67 -14
- package/dist/commands/test/command.js +49 -252
- package/dist/commands/test/outcomes.d.ts +33 -7
- package/dist/config/check-runner.d.ts +3 -3
- package/dist/config/check-runner.js +8 -7
- package/dist/config/credential-resolver.d.ts +50 -5
- package/dist/config/credential-resolver.js +51 -19
- package/dist/config/credential-settle.d.ts +6 -2
- package/dist/config/credential-settle.js +11 -5
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +1 -1
- package/dist/config/runner.d.ts +5 -5
- package/dist/config/runner.js +1 -1
- package/dist/config/schema.d.ts +2 -2
- package/dist/config/schema.js +1 -1
- package/dist/config-file/define.d.ts +1 -1
- package/dist/config-file/define.js +1 -1
- package/dist/config-file/runner.d.ts +5 -5
- package/dist/config-file/toolchain.d.ts +14 -4
- package/dist/config-file/toolchain.js +43 -7
- package/dist/context.d.ts +10 -6
- package/dist/context.js +8 -6
- package/dist/core/across-sandboxes.d.ts +7 -6
- package/dist/core/across-sandboxes.js +123 -152
- package/dist/core/coordinator.d.ts +166 -0
- package/dist/core/coordinator.js +233 -0
- package/dist/core/events.d.ts +2 -2
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.js +1 -1
- package/dist/core/outcomes.d.ts +148 -0
- package/dist/core/{sandbox-end.js → outcomes.js} +28 -4
- package/dist/core/resources.d.ts +31 -53
- package/dist/core/resources.js +32 -70
- package/dist/core/run-state.d.ts +7 -1
- package/dist/core/run-state.js +2 -0
- package/dist/core/run.d.ts +32 -236
- package/dist/core/run.js +107 -267
- package/dist/core/state-directory.d.ts +1 -1
- package/dist/core/state-directory.js +2 -2
- package/dist/credential/gateways.d.ts +15 -1
- package/dist/credential/index.d.ts +4 -3
- package/dist/credential/index.js +3 -2
- package/dist/credential/live/vercel-cli-gateway.d.ts +1 -1
- package/dist/credential/live/vercel-cli-gateway.js +1 -1
- package/dist/credential/live/vercel-oidc-token-gateway.d.ts +11 -0
- package/dist/credential/live/vercel-oidc-token-gateway.js +16 -0
- package/dist/credential/source.d.ts +73 -6
- package/dist/credential/source.js +55 -2
- package/dist/extension-commands.d.ts +1 -1
- package/dist/extension-commands.js +2 -2
- package/dist/extensions/testserver/commands/pool/create/command.d.ts +35 -2
- package/dist/extensions/testserver/commands/pool/create/command.js +7 -7
- package/dist/extensions/testserver/commands/pool/create/metadata.js +5 -5
- package/dist/extensions/testserver/commands/pool/create/outcomes.d.ts +17 -1
- package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
- package/dist/extensions/testserver/credential-facts.d.ts +6 -2
- package/dist/extensions/testserver/credential-facts.js +29 -11
- package/dist/extensions/testserver/lifecycle.js +7 -1
- package/dist/extensions/testserver/limit.d.ts +3 -0
- package/dist/extensions/testserver/limit.js +3 -0
- package/dist/extensions/testserver/provision.d.ts +8 -1
- package/dist/extensions/testserver/provision.js +8 -3
- package/dist/extensions/testserver/refusals.d.ts +6 -1
- package/dist/extensions/testserver/refusals.js +16 -1
- package/dist/extensions/testserver/resource.d.ts +1 -1
- package/dist/extensions/testserver/resource.js +1 -1
- package/dist/extensions/testserver/result.d.ts +1 -1
- package/dist/extensions/testserver/result.js +9 -4
- package/dist/planning/driver-file-lists.d.ts +0 -15
- package/dist/planning/driver-file-lists.js +2 -21
- package/dist/planning/plan-only.d.ts +3 -14
- package/dist/planning/plan-only.js +11 -20
- package/dist/planning/run-kind-flags.js +2 -2
- package/dist/planning/run-plan.d.ts +45 -12
- package/dist/planning/run-plan.js +4 -3
- package/dist/planning/suites.d.ts +1 -1
- package/dist/planning/suites.js +2 -2
- package/dist/planning/test-plan.d.ts +9 -0
- package/dist/planning/test-plan.js +9 -0
- package/dist/run-directory/recording.js +3 -3
- package/dist/run-directory/run-record.d.ts +26 -11
- package/dist/run-directory/run-record.js +16 -13
- package/dist/runner/base.js +1 -1
- package/dist/runner/build-snapshots.d.ts +60 -29
- package/dist/runner/build-snapshots.js +136 -29
- package/dist/runner/context.d.ts +15 -7
- package/dist/runner/context.js +19 -6
- package/dist/runner/events.d.ts +16 -10
- package/dist/runner/gateways.d.ts +122 -23
- package/dist/runner/gateways.js +1 -1
- package/dist/runner/gh.d.ts +42 -0
- package/dist/runner/gh.js +58 -0
- package/dist/runner/index.d.ts +13 -8
- package/dist/runner/index.js +12 -6
- package/dist/runner/live/checkout-gateway.js +7 -0
- package/dist/runner/live/gh-output.d.ts +17 -0
- package/dist/runner/live/gh-output.js +37 -0
- package/dist/runner/live/gh-token-gateway.d.ts +13 -0
- package/dist/runner/live/gh-token-gateway.js +51 -0
- package/dist/runner/live/sandbox-errors.d.ts +2 -0
- package/dist/runner/live/sandbox-errors.js +4 -0
- package/dist/runner/live/sandbox-gateway.js +140 -4
- package/dist/runner/live/snapshot-index-gateway.d.ts +12 -0
- package/dist/runner/live/{snapshot-cache-gateway.js → snapshot-index-gateway.js} +11 -11
- package/dist/runner/live/snapshot-records.js +12 -12
- package/dist/runner/local-snapshot-index.d.ts +205 -0
- package/dist/runner/local-snapshot-index.js +210 -0
- package/dist/runner/network-policy.d.ts +6 -6
- package/dist/runner/network-policy.js +7 -7
- package/dist/runner/policy-writes.d.ts +1 -1
- package/dist/runner/policy-writes.js +1 -1
- package/dist/runner/prepare.d.ts +14 -14
- package/dist/runner/prepare.js +20 -11
- package/dist/runner/ready.d.ts +19 -11
- package/dist/runner/ready.js +104 -33
- package/dist/runner/sandboxed-command.d.ts +3 -3
- package/dist/runner/sandboxed-command.js +3 -3
- package/dist/runner/scope.d.ts +15 -8
- package/dist/runner/scope.js +16 -5
- package/dist/runner/secrets.d.ts +41 -18
- package/dist/runner/secrets.js +226 -30
- package/dist/runner/session.d.ts +8 -8
- package/dist/runner/session.js +6 -3
- package/dist/runner/shared-snapshot-entry.d.ts +92 -0
- package/dist/runner/shared-snapshot-entry.js +168 -0
- package/dist/runner/shared-snapshot-list.d.ts +81 -0
- package/dist/runner/shared-snapshot-list.js +155 -0
- package/dist/runner/shared-snapshot-lookup.d.ts +51 -0
- package/dist/runner/shared-snapshot-lookup.js +118 -0
- package/dist/runner/shared-snapshot-prune.d.ts +58 -0
- package/dist/runner/shared-snapshot-prune.js +133 -0
- package/dist/runner/snapshot-build.d.ts +42 -14
- package/dist/runner/snapshot-build.js +79 -47
- package/dist/runner/snapshot-choice.js +2 -1
- package/dist/runner/snapshot-inspect.d.ts +39 -40
- package/dist/runner/snapshot-inspect.js +52 -35
- package/dist/runner/snapshot-key.d.ts +32 -17
- package/dist/runner/snapshot-key.js +43 -18
- package/dist/runner/snapshot-source.d.ts +31 -0
- package/dist/runner/snapshot-source.js +122 -0
- package/dist/runner/steps.d.ts +1 -1
- package/dist/runner/steps.js +1 -1
- package/dist/runner/{recipe-check.d.ts → vercel-sandbox-check.d.ts} +4 -2
- package/dist/runner/{recipe-check.js → vercel-sandbox-check.js} +7 -2
- package/dist/runner/{recipe.d.ts → vercel-sandbox-options.d.ts} +59 -28
- package/dist/runner/{recipe.js → vercel-sandbox-options.js} +128 -84
- package/dist/runner/vercel-sandbox-secrets.d.ts +116 -0
- package/dist/runner/{recipe-secrets.js → vercel-sandbox-secrets.js} +159 -26
- package/dist/sdk/extension/credential-diagnosis.d.ts +3 -1
- package/dist/sdk/extension/credential-diagnosis.js +25 -5
- package/dist/sdk/extension/credential-source.d.ts +20 -3
- package/dist/sdk/extension/credential-source.js +4 -4
- package/dist/sdk/extension/index.d.ts +3 -2
- package/dist/sdk/extension/index.js +2 -1
- package/dist/sdk/extension/resource-definition.d.ts +1 -1
- package/dist/sdk/extension/secret-source.d.ts +1 -1
- package/dist/sdk/extension/secret-source.js +1 -1
- package/dist/sdk/extension/vercel-oidc-facts.d.ts +20 -0
- package/dist/sdk/extension/vercel-oidc-facts.js +20 -0
- package/dist/shared/cleanup.d.ts +3 -3
- package/dist/shared/cleanup.js +15 -5
- package/dist/shared/snapshot-text.d.ts +4 -4
- package/dist/shared/snapshot-text.js +11 -11
- package/dist/time/duration.js +1 -1
- package/package.json +5 -3
- package/skills/overview.md +4 -4
- package/skills/plan-runs.md +1 -1
- package/skills/read-run-output.md +6 -6
- package/dist/application.d.ts +0 -21
- package/dist/application.js +0 -30
- package/dist/chunks/chunk-7EENF73W.js +0 -782
- package/dist/chunks/chunk-Z5PBVG3Y.js +0 -2599
- package/dist/commands/exec/across-sandboxes-run.d.ts +0 -180
- package/dist/commands/exec/across-sandboxes-run.js +0 -339
- package/dist/commands/exec/plan-only.d.ts +0 -10
- package/dist/commands/exec/plan-only.js +0 -45
- package/dist/commands/exec/run-command.d.ts +0 -475
- package/dist/commands/exec/run-command.js +0 -603
- package/dist/commands/exec/run-planned.d.ts +0 -20
- package/dist/commands/exec/run-planned.js +0 -22
- package/dist/commands/exec/sandbox-view.d.ts +0 -19
- package/dist/commands/exec/sandbox-view.js +0 -72
- package/dist/commands/test/plan.d.ts +0 -92
- package/dist/commands/test/plan.js +0 -125
- package/dist/core/sandbox-end.d.ts +0 -64
- package/dist/runner/live/snapshot-cache-gateway.d.ts +0 -12
- package/dist/runner/recipe-secrets.d.ts +0 -67
- package/dist/runner/snapshot-cache.d.ts +0 -148
- package/dist/runner/snapshot-cache.js +0 -126
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RanCommand, type RunObserver, type TimedRunEvent } from "../../core/index.ts";
|
|
2
|
-
import type { RunnerEvent,
|
|
2
|
+
import type { RunnerEvent, RunnerSnapshotIndexFailure, SnapshotIndexNote } from "../../runner/index.ts";
|
|
3
3
|
/**
|
|
4
4
|
* The lane a plain progress line names after its elapsed time: what part of the run it is about, such as `run`,
|
|
5
5
|
* `mint`, `runner`, `command`, `cleanup` or a resource's lane.
|
|
@@ -13,6 +13,8 @@ export interface LineProgressOptions {
|
|
|
13
13
|
readonly github: boolean;
|
|
14
14
|
readonly verbose?: boolean;
|
|
15
15
|
}
|
|
16
|
+
/** Wraps `write` so once a write fails (e.g. EIO after SIGHUP), every later line is dropped and calls still resolve. */
|
|
17
|
+
export declare function droppingWriter(write: (line: string) => Promise<void>): (line: string) => Promise<void>;
|
|
16
18
|
/**
|
|
17
19
|
* A run's progress as plain lines through `write`, one call per line. Each of storm's own lines starts with the
|
|
18
20
|
* time since the run started and its lane: `[+4.2s] command running pnpm test`. Lanes that run at once say so:
|
|
@@ -44,7 +46,7 @@ export declare function snapshotReusedText(event: Extract<RunnerEvent, {
|
|
|
44
46
|
readonly kind: "snapshot-reused";
|
|
45
47
|
}>, mergeBase: string | undefined): string;
|
|
46
48
|
/**
|
|
47
|
-
* The lines that say the run builds a
|
|
49
|
+
* The lines that say the run builds a runner snapshot: where and why, then why each indexed snapshot of the runner
|
|
48
50
|
* doesn't fit.
|
|
49
51
|
*/
|
|
50
52
|
export declare function snapshotBuildTexts(event: Extract<RunnerEvent, {
|
|
@@ -61,10 +63,12 @@ export declare function skippedText(skipped: {
|
|
|
61
63
|
readonly resource: string;
|
|
62
64
|
readonly notice: string;
|
|
63
65
|
}): string;
|
|
64
|
-
/** What the runner's local checks noticed: nested Git repositories left out, and the
|
|
66
|
+
/** What the runner's local checks noticed: nested Git repositories left out, and the local snapshot index's notes. */
|
|
65
67
|
export declare function preparedNoteTexts(prepared: {
|
|
66
68
|
readonly nestedRepositories: readonly string[];
|
|
67
|
-
readonly notes: readonly
|
|
69
|
+
readonly notes: readonly SnapshotIndexNote[];
|
|
68
70
|
}): string[];
|
|
69
|
-
/** The
|
|
70
|
-
export declare function
|
|
71
|
+
/** The local snapshot index couldn't record a runner snapshot the run built. */
|
|
72
|
+
export declare function localIndexWriteFailureText(failure: RunnerSnapshotIndexFailure): string;
|
|
73
|
+
/** Querying the shared snapshot index failed; the run continues without it. */
|
|
74
|
+
export declare function sharedSnapshotLookupFailedText(message: string): string;
|
|
@@ -2,8 +2,22 @@ import { mintTargetText } from "../../credential/index.js";
|
|
|
2
2
|
import { megabytesText, secondsOf, secondsText, warningTally, } from "../../core/index.js";
|
|
3
3
|
import { DEFINITION_SET } from "../../extensions.js";
|
|
4
4
|
import { versionText } from "../../version.js";
|
|
5
|
-
import { builtAtText, rejectionLines,
|
|
5
|
+
import { builtAtText, rejectionLines, snapshotIndexNoteText } from "../../shared/snapshot-text.js";
|
|
6
6
|
import { isoSecondsText, keepTimeText, orderText, releaseText, seconds, short } from "../../shared/text.js";
|
|
7
|
+
/** Wraps `write` so once a write fails (e.g. EIO after SIGHUP), every later line is dropped and calls still resolve. */
|
|
8
|
+
export function droppingWriter(write) {
|
|
9
|
+
let failed = false;
|
|
10
|
+
return async (line) => {
|
|
11
|
+
if (failed)
|
|
12
|
+
return;
|
|
13
|
+
try {
|
|
14
|
+
await write(line);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
failed = true;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
7
21
|
/**
|
|
8
22
|
* A run's progress as plain lines through `write`, one call per line. Each of storm's own lines starts with the
|
|
9
23
|
* time since the run started and its lane: `[+4.2s] command running pnpm test`. Lanes that run at once say so:
|
|
@@ -20,20 +34,12 @@ import { isoSecondsText, keepTimeText, orderText, releaseText, seconds, short }
|
|
|
20
34
|
* deleting the stopped sandboxes.
|
|
21
35
|
*/
|
|
22
36
|
export function lineProgress(write, options = { github: false }) {
|
|
23
|
-
|
|
37
|
+
const writer = droppingWriter(write);
|
|
24
38
|
const render = plainRenderer(options);
|
|
25
39
|
return {
|
|
26
40
|
observe: async (timed) => {
|
|
27
|
-
for (const line of render(timed))
|
|
28
|
-
|
|
29
|
-
return;
|
|
30
|
-
try {
|
|
31
|
-
await write(line);
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
failed = true;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
41
|
+
for (const line of render(timed))
|
|
42
|
+
await writer(line);
|
|
37
43
|
},
|
|
38
44
|
};
|
|
39
45
|
}
|
|
@@ -206,10 +212,12 @@ function runnerLines(event, state, line, options) {
|
|
|
206
212
|
return [line("runner", "saving the build sandbox as a runner snapshot…")];
|
|
207
213
|
case "snapshot-built":
|
|
208
214
|
return [
|
|
209
|
-
line("runner", `built
|
|
215
|
+
line("runner", `built runner snapshot ${event.snapshotId} at ${short(event.base)} in ${seconds(event.ms)} (${megabytesText(event.sizeBytes)})`),
|
|
210
216
|
];
|
|
211
217
|
case "snapshot-entry-not-written":
|
|
212
|
-
return [line("runner",
|
|
218
|
+
return [line("runner", localIndexWriteFailureText(event.failure))];
|
|
219
|
+
case "shared-snapshot-lookup-failed":
|
|
220
|
+
return [line("runner", sharedSnapshotLookupFailedText(event.message))];
|
|
213
221
|
case "uploading":
|
|
214
222
|
return [];
|
|
215
223
|
case "uploaded":
|
|
@@ -241,14 +249,15 @@ function runnerLines(event, state, line, options) {
|
|
|
241
249
|
* before HEAD.
|
|
242
250
|
*/
|
|
243
251
|
export function snapshotReusedText(event, mergeBase) {
|
|
244
|
-
|
|
252
|
+
const from = event.source === "shared" ? ", from the shared snapshot index" : "";
|
|
253
|
+
return `snapshot ${event.snapshotId}, ${builtAtText({ base: event.base, builtBehind: event.builtBehind, mergeBase })}${from}`;
|
|
245
254
|
}
|
|
246
255
|
/**
|
|
247
|
-
* The lines that say the run builds a
|
|
256
|
+
* The lines that say the run builds a runner snapshot: where and why, then why each indexed snapshot of the runner
|
|
248
257
|
* doesn't fit.
|
|
249
258
|
*/
|
|
250
259
|
export function snapshotBuildTexts(event) {
|
|
251
|
-
const building = `building a
|
|
260
|
+
const building = `building a runner snapshot at ${short(event.base)}`;
|
|
252
261
|
const tail = `this takes a few minutes: ${event.summary}`;
|
|
253
262
|
const { why } = event;
|
|
254
263
|
switch (why.kind) {
|
|
@@ -259,11 +268,11 @@ export function snapshotBuildTexts(event) {
|
|
|
259
268
|
return [`${building} (${SNAPSHOT_BUILD_REASON_TEXT[why.kind]}); ${tail}`];
|
|
260
269
|
}
|
|
261
270
|
}
|
|
262
|
-
/** Why a
|
|
271
|
+
/** Why a runner snapshot is being built, as its line says in parentheses. */
|
|
263
272
|
const SNAPSHOT_BUILD_REASON_TEXT = {
|
|
264
|
-
"no-snapshot": "no
|
|
273
|
+
"no-snapshot": "no snapshot fits",
|
|
265
274
|
full: "--full",
|
|
266
|
-
base: "the
|
|
275
|
+
base: "the local snapshot index has no runner snapshot at that commit",
|
|
267
276
|
};
|
|
268
277
|
/**
|
|
269
278
|
* What a stopping run says it releases of its resource instances, such as `releasing a, b`, by their resource keys:
|
|
@@ -324,16 +333,20 @@ export function resourceWarningText(warning) {
|
|
|
324
333
|
export function skippedText(skipped) {
|
|
325
334
|
return `no ${skipped.resource}: ${skipped.notice}`;
|
|
326
335
|
}
|
|
327
|
-
/** What the runner's local checks noticed: nested Git repositories left out, and the
|
|
336
|
+
/** What the runner's local checks noticed: nested Git repositories left out, and the local snapshot index's notes. */
|
|
328
337
|
export function preparedNoteTexts(prepared) {
|
|
329
338
|
return [
|
|
330
339
|
...(prepared.nestedRepositories.length === 0
|
|
331
340
|
? []
|
|
332
341
|
: [`leaving out untracked nested Git repositories: ${prepared.nestedRepositories.join(", ")}`]),
|
|
333
|
-
...prepared.notes.map(
|
|
342
|
+
...prepared.notes.map(snapshotIndexNoteText),
|
|
334
343
|
];
|
|
335
344
|
}
|
|
336
|
-
/** The
|
|
337
|
-
export function
|
|
338
|
-
return `couldn't record the runner snapshot in the
|
|
345
|
+
/** The local snapshot index couldn't record a runner snapshot the run built. */
|
|
346
|
+
export function localIndexWriteFailureText(failure) {
|
|
347
|
+
return `couldn't record the runner snapshot in the local snapshot index at ${failure.path}: ${failure.message}; later runs won't reuse it`;
|
|
348
|
+
}
|
|
349
|
+
/** Querying the shared snapshot index failed; the run continues without it. */
|
|
350
|
+
export function sharedSnapshotLookupFailedText(message) {
|
|
351
|
+
return `couldn't query the shared snapshot index: ${message}; continuing without it`;
|
|
339
352
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { StormApp } from "../../context.ts";
|
|
2
|
+
import type { PlannedRunner } from "../../planning/run-plan.ts";
|
|
2
3
|
import type { CheckoutFailure } from "../../runner/index.ts";
|
|
3
|
-
import type { PlannedWhere } from "../../planning/run-plan.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Where a package's binary was looked for, and what the run does with it: `found`, with the directory the tests are
|
|
6
|
-
* counted in (`cwd`), the binary that counts them on this machine (`counts`) and the run's `argv[0]` (`runs`);
|
|
7
|
-
* `not-found`, with every directory searched; or `checkout-failed`, when git can't say a
|
|
8
|
-
*
|
|
6
|
+
* counted in (`cwd`), the binary that counts them on this machine (`counts`), and the run's `argv[0]` (`runs`);
|
|
7
|
+
* `not-found`, with every directory searched; or `checkout-failed`, when git can't say the repository root for a run
|
|
8
|
+
* in a runner sandbox.
|
|
9
9
|
*/
|
|
10
10
|
export type RunBin = {
|
|
11
11
|
readonly kind: "found";
|
|
@@ -21,15 +21,15 @@ export type RunBin = {
|
|
|
21
21
|
readonly failure: CheckoutFailure;
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
|
-
* Finds the binary `name` for a run that counts its tests with it before anything is minted, acquired or started:
|
|
24
|
+
* Finds the binary `name` for a run that counts its tests with it before anything is minted, acquired, or started:
|
|
25
25
|
*
|
|
26
|
-
* 1. Where to count:
|
|
27
|
-
* directory on this machine that
|
|
26
|
+
* 1. Where to count: the working directory for `launch-machine`; `<repository root>/<runner.cwd>` for
|
|
27
|
+
* `vercel-sandbox`, the directory on this machine that corresponds to `/vercel/sandbox/<runner.cwd>` in the runner
|
|
28
|
+
* sandbox.
|
|
28
29
|
* 2. Finds `node_modules/.bin/<name>` in that directory and each above it, up to the repository's root, or the
|
|
29
|
-
* filesystem's root outside a repository,
|
|
30
|
-
* (`app.packageBins`, `src/local-services.ts`).
|
|
30
|
+
* filesystem's root outside a repository, through `app.packageBins` (`src/local-services.ts`) for `launch-machine`.
|
|
31
31
|
*
|
|
32
|
-
*
|
|
32
|
+
* A `launch-machine` run starts the binary found; a `vercel-sandbox` run starts plain `name`, which the runner's
|
|
33
33
|
* `PATH` finds in `node_modules/.bin` of `runner.cwd` and of the repository's root.
|
|
34
34
|
*/
|
|
35
|
-
export declare function findRunBin(app: Pick<StormApp, "context" | "cwd" | "packageBins">, name: string,
|
|
35
|
+
export declare function findRunBin(app: Pick<StormApp, "context" | "cwd" | "packageBins">, name: string, runner: PlannedRunner): Promise<RunBin>;
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
// (`driver.ts`), such as `vitest` or `playwright`.
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
/**
|
|
5
|
-
* Finds the binary `name` for a run that counts its tests with it before anything is minted, acquired or started:
|
|
5
|
+
* Finds the binary `name` for a run that counts its tests with it before anything is minted, acquired, or started:
|
|
6
6
|
*
|
|
7
|
-
* 1. Where to count:
|
|
8
|
-
* directory on this machine that
|
|
7
|
+
* 1. Where to count: the working directory for `launch-machine`; `<repository root>/<runner.cwd>` for
|
|
8
|
+
* `vercel-sandbox`, the directory on this machine that corresponds to `/vercel/sandbox/<runner.cwd>` in the runner
|
|
9
|
+
* sandbox.
|
|
9
10
|
* 2. Finds `node_modules/.bin/<name>` in that directory and each above it, up to the repository's root, or the
|
|
10
|
-
* filesystem's root outside a repository,
|
|
11
|
-
* (`app.packageBins`, `src/local-services.ts`).
|
|
11
|
+
* filesystem's root outside a repository, through `app.packageBins` (`src/local-services.ts`) for `launch-machine`.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* A `launch-machine` run starts the binary found; a `vercel-sandbox` run starts plain `name`, which the runner's
|
|
14
14
|
* `PATH` finds in `node_modules/.bin` of `runner.cwd` and of the repository's root.
|
|
15
15
|
*/
|
|
16
|
-
export async function findRunBin(app, name,
|
|
17
|
-
if (
|
|
16
|
+
export async function findRunBin(app, name, runner) {
|
|
17
|
+
if (runner.kind === "launch-machine") {
|
|
18
18
|
const cwd = app.cwd;
|
|
19
19
|
const found = await app.packageBins.find(name, cwd);
|
|
20
20
|
return found.ok
|
|
@@ -24,7 +24,7 @@ export async function findRunBin(app, name, where) {
|
|
|
24
24
|
const root = await app.context.checkout.repositoryRoot({ cwd: app.cwd });
|
|
25
25
|
if (!root.ok)
|
|
26
26
|
return { kind: "checkout-failed", failure: root.failure };
|
|
27
|
-
const cwd = join(root.value,
|
|
27
|
+
const cwd = join(root.value, runner.options.cwd);
|
|
28
28
|
const found = await app.context.packageBins.find({ name, from: cwd, root: root.value });
|
|
29
29
|
return found.ok
|
|
30
30
|
? { kind: "found", cwd, counts: found.path, runs: name }
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { ArgumentIssue } from "@vercel/clinkr";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import type { SettingsFile } from "../../config/index.ts";
|
|
4
|
+
/** Shared refusal detail for `--show-output` in a run across runner sandboxes. */
|
|
5
|
+
export declare const SHOW_OUTPUT_ACROSS_SANDBOXES_DETAIL = "prints status lines and no step output, and each runner sandbox entry of its run directory keeps its step logs; drop --show-output.";
|
|
6
|
+
/**
|
|
7
|
+
* The request fields every run takes, `storm test`'s and `storm exec`'s: the run's own, and each resource option's
|
|
8
|
+
* flag (`resource-flags.ts`). Each command adds its own fields (`--runner` on `exec`, `--suite` and `--count-tests`
|
|
9
|
+
* on `test`).
|
|
10
|
+
*/
|
|
11
|
+
export declare const RUN_REQUEST_FIELDS: {
|
|
12
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
13
|
+
project: z.ZodOptional<z.ZodString>;
|
|
14
|
+
credential: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
"github-actions": "github-actions";
|
|
16
|
+
mint: "mint";
|
|
17
|
+
"vercel-oidc": "vercel-oidc";
|
|
18
|
+
}>>;
|
|
19
|
+
showOutput: z.ZodDefault<z.ZodBoolean>;
|
|
20
|
+
keepSandbox: z.ZodOptional<z.ZodString>;
|
|
21
|
+
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
22
|
+
planOnly: z.ZodDefault<z.ZodBoolean>;
|
|
23
|
+
};
|
|
24
|
+
/** The CLI spellings of the fields every run takes. */
|
|
25
|
+
export declare const RUN_CLI_OPTIONS: {
|
|
26
|
+
readonly project: {
|
|
27
|
+
readonly short: "p";
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
declare const runRequestSchema: z.ZodObject<{
|
|
31
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
32
|
+
project: z.ZodOptional<z.ZodString>;
|
|
33
|
+
credential: z.ZodOptional<z.ZodEnum<{
|
|
34
|
+
"github-actions": "github-actions";
|
|
35
|
+
mint: "mint";
|
|
36
|
+
"vercel-oidc": "vercel-oidc";
|
|
37
|
+
}>>;
|
|
38
|
+
showOutput: z.ZodDefault<z.ZodBoolean>;
|
|
39
|
+
keepSandbox: z.ZodOptional<z.ZodString>;
|
|
40
|
+
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
41
|
+
planOnly: z.ZodDefault<z.ZodBoolean>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
/** What every run's request holds. */
|
|
44
|
+
export type RunCommandRequest = z.output<typeof runRequestSchema>;
|
|
45
|
+
/**
|
|
46
|
+
* What planning a run reads: the run's request, and what the command settled before planning: the effective config
|
|
47
|
+
* file (`effectiveConfig`, with any selected suite laid over the top level), the selected suite's name (null for the
|
|
48
|
+
* project's tests and `storm exec`), `--runner launch-machine` on `storm exec`, and `--sandboxes` and `--file-lists`,
|
|
49
|
+
* which `planRun` refuses for the launch machine runner (`conflicting_options`).
|
|
50
|
+
*/
|
|
51
|
+
export type RunPlanRequest = RunCommandRequest & {
|
|
52
|
+
readonly settingsFile: SettingsFile;
|
|
53
|
+
readonly suite: string | null;
|
|
54
|
+
readonly runner?: "launch-machine" | undefined;
|
|
55
|
+
readonly sandboxes?: number | undefined;
|
|
56
|
+
readonly fileLists?: string | undefined;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* What is wrong with `--sandboxes` or `--file-lists` combined with other run flags, whatever the runner, as `validate`
|
|
60
|
+
* reports it. The launch machine runner refuses both flags in `planRun` (`conflicting_options`), once it knows the
|
|
61
|
+
* effective runner.
|
|
62
|
+
*/
|
|
63
|
+
export declare function sandboxesFlagProblems(request: Pick<RunCommandRequest, "showOutput"> & {
|
|
64
|
+
readonly sandboxes?: number | undefined;
|
|
65
|
+
readonly fileLists?: string | undefined;
|
|
66
|
+
}): readonly ArgumentIssue[];
|
|
67
|
+
/** Flag checks that hold regardless of which runner the run uses (`validate`). */
|
|
68
|
+
export declare function runFlagProblems(request: RunCommandRequest): readonly ArgumentIssue[];
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Shared request fields, CLI options, and flag validation for `storm test` and `storm exec`.
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { resourceFlagFields, resourceFlagProblems } from "../../planning/resource-flags.js";
|
|
4
|
+
import { parseKeepTime } from "../../time/index.js";
|
|
5
|
+
/** Shared refusal detail for `--show-output` in a run across runner sandboxes. */
|
|
6
|
+
export const SHOW_OUTPUT_ACROSS_SANDBOXES_DETAIL = "prints status lines and no step output, and each runner sandbox entry of its run directory keeps its step logs; drop --show-output.";
|
|
7
|
+
/** The run's own request fields, which every run takes beside the resources' flags. */
|
|
8
|
+
const OWN_RUN_FIELDS = {
|
|
9
|
+
scope: z.string().min(1).optional(),
|
|
10
|
+
project: z.string().min(1).optional(),
|
|
11
|
+
credential: z.enum(["mint", "github-actions", "vercel-oidc"]).optional(),
|
|
12
|
+
showOutput: z.boolean().default(false),
|
|
13
|
+
keepSandbox: z.string().optional(),
|
|
14
|
+
verbose: z.boolean().default(false),
|
|
15
|
+
planOnly: z.boolean().default(false),
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The request fields every run takes, `storm test`'s and `storm exec`'s: the run's own, and each resource option's
|
|
19
|
+
* flag (`resource-flags.ts`). Each command adds its own fields (`--runner` on `exec`, `--suite` and `--count-tests`
|
|
20
|
+
* on `test`).
|
|
21
|
+
*/
|
|
22
|
+
export const RUN_REQUEST_FIELDS = { ...OWN_RUN_FIELDS, ...resourceFlagFields(Object.keys(OWN_RUN_FIELDS)) };
|
|
23
|
+
/** The CLI spellings of the fields every run takes. */
|
|
24
|
+
export const RUN_CLI_OPTIONS = { project: { short: "p" } };
|
|
25
|
+
const runRequestSchema = z.object(RUN_REQUEST_FIELDS);
|
|
26
|
+
/**
|
|
27
|
+
* What is wrong with `--sandboxes` or `--file-lists` combined with other run flags, whatever the runner, as `validate`
|
|
28
|
+
* reports it. The launch machine runner refuses both flags in `planRun` (`conflicting_options`), once it knows the
|
|
29
|
+
* effective runner.
|
|
30
|
+
*/
|
|
31
|
+
export function sandboxesFlagProblems(request) {
|
|
32
|
+
const flag = request.sandboxes !== undefined ? "--sandboxes" : request.fileLists !== undefined ? "--file-lists" : undefined;
|
|
33
|
+
if (flag === undefined)
|
|
34
|
+
return [];
|
|
35
|
+
return request.showOutput
|
|
36
|
+
? [
|
|
37
|
+
{
|
|
38
|
+
field: "showOutput",
|
|
39
|
+
message: `A run with ${flag} ${SHOW_OUTPUT_ACROSS_SANDBOXES_DETAIL}`,
|
|
40
|
+
},
|
|
41
|
+
]
|
|
42
|
+
: [];
|
|
43
|
+
}
|
|
44
|
+
/** Flag checks that hold regardless of which runner the run uses (`validate`). */
|
|
45
|
+
export function runFlagProblems(request) {
|
|
46
|
+
const { keepSandbox } = request;
|
|
47
|
+
return [
|
|
48
|
+
...resourceFlagProblems(request),
|
|
49
|
+
...(keepSandbox !== undefined && parseKeepTime(keepSandbox) === undefined
|
|
50
|
+
? [
|
|
51
|
+
{
|
|
52
|
+
field: "keepSandbox",
|
|
53
|
+
message: `--keep-sandbox takes 0, or a whole number of minutes or hours up to 5h, such as 30m or 2h, not ${JSON.stringify(keepSandbox)}.`,
|
|
54
|
+
},
|
|
55
|
+
]
|
|
56
|
+
: []),
|
|
57
|
+
];
|
|
58
|
+
}
|
|
@@ -14,11 +14,11 @@ export const EXEC_USAGE_FLAGS = `${RESOURCE_USAGE_FLAGS} [--credential <SOURCE>]
|
|
|
14
14
|
const ownRunFields = (verbose) => ({
|
|
15
15
|
credential: {
|
|
16
16
|
valueLabel: "SOURCE",
|
|
17
|
-
description: "The credential source: mint, the default, mints one with the vercel CLI for --scope and --project; github-actions requests a GitHub Actions OIDC token, in a GitHub Actions job with permissions id-token: write, anew once it is 4 minutes old, and needs no --scope or --project.
|
|
17
|
+
description: "The credential source: mint, the default, mints one with the vercel CLI for --scope and --project; vercel-oidc reads a pre-minted Vercel project OIDC token from VERCEL_OIDC_TOKEN and needs no --scope or --project; github-actions requests a GitHub Actions OIDC token, in a GitHub Actions job with permissions id-token: write, anew once it is 4 minutes old, and needs no --scope or --project. The Vercel Sandbox runner accepts mint and vercel-oidc, and refuses github-actions. On the launch machine, only a run with a resource that takes a credential takes it, as that resource's options decide; otherwise it is credential_unused. This credential is the Vercel OIDC token storm uses for its own calls, not a sandbox credential that runner.credentials declares: the word has both uses until a rename. No config key.",
|
|
18
18
|
},
|
|
19
19
|
keepSandbox: {
|
|
20
20
|
valueLabel: "DURATION",
|
|
21
|
-
description: "Keep the runner sandbox running this long once the run ends, however it ends, so you can connect to it from its page in the Vercel dashboard: 0, which stops and deletes it with the run's other sandboxes, or a whole number of minutes or hours up to 5h (30m, 2h). A run keeps its runner sandbox only when this flag or keepSandbox in vercelSandbox({ … }) asks; by default it stops and deletes it, after a failure too. A kept runner sandbox holds the checkout, the installed packages, and everything the command wrote, including its test output; storm removes nothing from it, and it holds no credential, the
|
|
21
|
+
description: "Keep the runner sandbox running this long once the run ends, however it ends, so you can connect to it from its page in the Vercel dashboard: 0, which stops and deletes it with the run's other sandboxes, or a whole number of minutes or hours up to 5h (30m, 2h). A run keeps its runner sandbox only when this flag or keepSandbox in vercelSandbox({ … }) asks; by default it stops and deletes it, after a failure too. A kept runner sandbox holds the checkout, the installed packages, and everything the command wrote, including its test output; storm removes nothing from it, and it holds no credential, the runner's or a resource's, since storm revokes every sandbox credential before it keeps the sandbox. Anyone who can update the Vercel project can connect to it. Refused when vercelSandbox({ … }) sets unsafeSecretEnvVars (because a run that passes secrets into the runner sandbox's environment never keeps its runner sandbox) or managedCredentials (because Vercel Sandbox rejects deny-all on a sandbox with managed credentials, so storm cannot fence it). storm gives the kept runner sandbox no network access before it releases the run's resources: once the run releases its resources, another run can take them. Before it keeps the sandbox, the run ends every process it started there. The run asks Vercel Sandbox to extend the runner sandbox's timeout when it would stop sooner; it never shortens it, so the sandbox may run past the keep time until its own timeout. The run says until when it runs, and storm runs show and runs list say so too. Default: keepSandbox in vercelSandbox({ … }), else 0; a run across runner sandboxes keeps each runner sandbox only with --keep-sandbox and ignores keepSandbox in vercelSandbox({ … }). Fits the Vercel Sandbox runner only.",
|
|
22
22
|
},
|
|
23
23
|
showOutput: {
|
|
24
24
|
description: "With the Vercel Sandbox runner on a terminal, print the runner's step output (a snapshot build, the install, the build) above the live view instead of keeping only each step's last line there. Plain output always prints it. Either way, the run directory keeps it whole. Fits the Vercel Sandbox runner only. No config key.",
|
|
@@ -31,11 +31,11 @@ const ownRunFields = (verbose) => ({
|
|
|
31
31
|
},
|
|
32
32
|
scope: {
|
|
33
33
|
valueLabel: "TEAM",
|
|
34
|
-
description: "The control plane team: the Vercel team whose project the credential is minted for and the Vercel Sandbox runner's sandboxes run in. Required, from this flag or scope in storm.config.ts, unless a launch machine run
|
|
34
|
+
description: "The control plane team: the Vercel team whose project the credential is minted for and the Vercel Sandbox runner's sandboxes run in. Required, from this flag or scope in storm.config.ts, unless the run takes --credential vercel-oidc or --credential github-actions, or is a launch machine run with no resource that takes a credential.",
|
|
35
35
|
},
|
|
36
36
|
project: {
|
|
37
37
|
valueLabel: "PROJECT",
|
|
38
|
-
description: "The control plane project: the Vercel project, within the team, to mint the credential for. Required, from this flag or project in storm.config.ts, unless a launch machine run
|
|
38
|
+
description: "The control plane project: the Vercel project, within the team, to mint the credential for. Required, from this flag or project in storm.config.ts, unless the run takes --credential vercel-oidc or --credential github-actions, or is a launch machine run with no resource that takes a credential.",
|
|
39
39
|
},
|
|
40
40
|
});
|
|
41
41
|
/**
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import type { StormApp } from "../../context.ts";
|
|
3
|
+
import type { AcrossSandboxesOutcome, RunRunnerRequest, SandboxesRanRun, SingleRunOutcome } from "../../core/index.ts";
|
|
4
|
+
import { type FileListMismatch } from "../../planning/file-lists.ts";
|
|
5
|
+
import type { FinalResultsRead } from "../../planning/final-results.ts";
|
|
6
|
+
import type { AcrossSandboxesRecorded, AcrossSandboxesRecording, RunRecording, TestPlanFacts, TimelineFacts } from "../../run-directory/index.ts";
|
|
7
|
+
import type { DriverHints } from "../../sdk/extension/index.ts";
|
|
8
|
+
import type { sandboxesRanSchema } from "./across-sandboxes-outcomes.ts";
|
|
9
|
+
import type { ranSchema } from "./outcomes.ts";
|
|
10
|
+
import type { RunView } from "./view.ts";
|
|
11
|
+
/** What a `ran` outcome reports of every run, which a command's own `ran` may extend. */
|
|
12
|
+
export type RanFacts = z.input<typeof ranSchema>;
|
|
13
|
+
/** What a `sandboxes_ran` outcome reports of every run across runner sandboxes. */
|
|
14
|
+
export type SandboxesRanFacts = z.input<typeof sandboxesRanSchema>;
|
|
15
|
+
/** Counts final test results and partial-read flags across a run's recorded test events. */
|
|
16
|
+
export declare function countFinalResults(tests: {
|
|
17
|
+
readonly events: readonly {
|
|
18
|
+
readonly kind: string;
|
|
19
|
+
}[];
|
|
20
|
+
readonly unreadable: number;
|
|
21
|
+
readonly incomplete?: unknown;
|
|
22
|
+
}): Omit<FinalResultsRead, "collected">;
|
|
23
|
+
/** Shortens a path under `$HOME` to `~/...` for display in summaries and headers. */
|
|
24
|
+
export declare function displayPath(path: string, env: Readonly<Record<string, string | undefined>>): string;
|
|
25
|
+
/** Ends a single run's recording, appends its job summary, finishes its view, and returns its timeline and test counts. */
|
|
26
|
+
export declare function summarizeSingle(app: StormApp, run: {
|
|
27
|
+
readonly command: string;
|
|
28
|
+
readonly hints: Pick<DriverHints, "noFinalResults">;
|
|
29
|
+
readonly view: RunView;
|
|
30
|
+
readonly recording: RunRecording;
|
|
31
|
+
readonly outcome: SingleRunOutcome;
|
|
32
|
+
}): Promise<{
|
|
33
|
+
readonly timeline: TimelineFacts;
|
|
34
|
+
readonly finalResults: Omit<FinalResultsRead, "collected">;
|
|
35
|
+
}>;
|
|
36
|
+
/** Compares each runner sandbox's assigned file list against the test files it reported. */
|
|
37
|
+
export declare function listMismatches(recorded: AcrossSandboxesRecorded): readonly FileListMismatch[];
|
|
38
|
+
/** Appends a multi-sandbox run's job summary and finishes its view with per-sandbox waterfalls and the end table. */
|
|
39
|
+
export declare function summarizeAcrossSandboxes(app: StormApp, run: {
|
|
40
|
+
readonly command: string;
|
|
41
|
+
readonly hints: Pick<DriverHints, "noFinalResults">;
|
|
42
|
+
readonly extraMismatchHint?: string;
|
|
43
|
+
readonly view: RunView;
|
|
44
|
+
readonly recording: AcrossSandboxesRecording;
|
|
45
|
+
readonly recorded: AcrossSandboxesRecorded;
|
|
46
|
+
readonly outcome: AcrossSandboxesOutcome;
|
|
47
|
+
readonly mismatches: readonly FileListMismatch[];
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
/** Builds the `SandboxesRanFacts` payload for a completed run across runner sandboxes. */
|
|
50
|
+
export declare function sandboxesRanFacts(app: StormApp, run: {
|
|
51
|
+
readonly outcome: SandboxesRanRun;
|
|
52
|
+
readonly recorded: AcrossSandboxesRecorded;
|
|
53
|
+
readonly recording: AcrossSandboxesRecording;
|
|
54
|
+
readonly plan: TestPlanFacts;
|
|
55
|
+
readonly runner: RunRunnerRequest;
|
|
56
|
+
readonly configFile: string | null;
|
|
57
|
+
readonly mismatches: readonly FileListMismatch[];
|
|
58
|
+
}): SandboxesRanFacts;
|