@cnc-tools/storm 0.5.0 → 0.7.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/build-info.js +1 -1
- package/dist/combine-errors.js +2 -2
- package/dist/commands/dashboard.js +1 -1
- package/dist/commands/{run → exec}/cleanup.d.ts +1 -1
- package/dist/commands/{run → exec}/cleanup.js +1 -1
- package/dist/commands/{run/outcomes.d.ts → exec/command.d.ts} +103 -112
- package/dist/commands/exec/command.js +23 -0
- package/dist/commands/{run → exec}/job-summary.d.ts +5 -1
- package/dist/commands/{run → exec}/job-summary.js +5 -2
- package/dist/commands/{run → exec}/live-view.js +29 -13
- package/dist/commands/exec/metadata.d.ts +69 -0
- package/dist/commands/exec/metadata.js +55 -0
- package/dist/commands/{run → exec}/mint-failed.js +4 -4
- package/dist/commands/exec/outcomes.d.ts +664 -0
- package/dist/commands/exec/outcomes.js +347 -0
- package/dist/commands/{run → exec}/progress.d.ts +14 -2
- package/dist/commands/{run → exec}/progress.js +54 -9
- package/dist/commands/exec/run-command.d.ts +227 -0
- package/dist/commands/exec/run-command.js +696 -0
- package/dist/commands/exec/run-metadata.d.ts +59 -0
- package/dist/commands/exec/run-metadata.js +61 -0
- package/dist/commands/{run → exec}/run-record.d.ts +110 -5
- package/dist/commands/{run → exec}/run-record.js +57 -1
- package/dist/commands/exec/testserver-flags.d.ts +48 -0
- package/dist/commands/exec/testserver-flags.js +80 -0
- package/dist/commands/{run → exec}/view.js +36 -4
- package/dist/commands/runs/facts.d.ts +25 -0
- package/dist/commands/runs/facts.js +38 -5
- package/dist/commands/runs/list/command.d.ts +25 -0
- package/dist/commands/runs/list/outcomes.d.ts +25 -0
- package/dist/commands/runs/logs/metadata.js +1 -1
- package/dist/commands/runs/logs/outcomes.js +4 -1
- package/dist/commands/runs/past-run.d.ts +2 -2
- package/dist/commands/runs/past-run.js +2 -2
- package/dist/commands/runs/show/command.d.ts +25 -0
- package/dist/commands/runs/show/metadata.js +2 -2
- package/dist/commands/runs/show/outcomes.d.ts +25 -0
- package/dist/commands/runs/show/outcomes.js +37 -5
- package/dist/commands/vitest/command.d.ts +325 -0
- package/dist/commands/vitest/command.js +138 -0
- package/dist/commands/vitest/metadata.d.ts +69 -0
- package/dist/commands/vitest/metadata.js +35 -0
- package/dist/commands/vitest/outcomes.d.ts +298 -0
- package/dist/commands/vitest/outcomes.js +77 -0
- package/dist/config/index.d.ts +2 -1
- package/dist/config/index.js +1 -0
- package/dist/config/resolve.d.ts +3 -3
- package/dist/config/resolve.js +3 -3
- package/dist/config/resource-config.d.ts +2 -2
- package/dist/config/schema.d.ts +1 -1
- package/dist/config/set.d.ts +15 -4
- package/dist/config/set.js +28 -12
- package/dist/config-file/define.d.ts +8 -6
- package/dist/context.d.ts +6 -3
- package/dist/context.js +4 -2
- package/dist/core/command-provider.d.ts +1 -1
- package/dist/core/events.d.ts +9 -7
- package/dist/core/presentation.js +1 -1
- package/dist/core/presentations.js +1 -1
- package/dist/core/run-state.d.ts +30 -6
- package/dist/core/run-state.js +19 -4
- package/dist/core/run.d.ts +17 -4
- package/dist/core/run.js +61 -25
- package/dist/resources/testserver/command.d.ts +1 -1
- package/dist/resources/testserver/command.js +1 -1
- package/dist/resources/testserver/config.d.ts +1 -1
- package/dist/resources/testserver/config.js +3 -2
- package/dist/resources/testserver/credential-facts.js +1 -1
- package/dist/resources/testserver/resource.d.ts +2 -2
- package/dist/resources/testserver/sandbox/create.d.ts +2 -2
- package/dist/resources/testserver/sandbox/create.js +2 -2
- package/dist/resources.d.ts +9 -6
- package/dist/resources.js +3 -3
- package/dist/runner/events.d.ts +64 -1
- package/dist/runner/gateways.d.ts +17 -6
- package/dist/runner/index.d.ts +5 -4
- package/dist/runner/index.js +4 -3
- package/dist/runner/live/snapshot-records.js +18 -4
- package/dist/runner/prepare.d.ts +23 -4
- package/dist/runner/prepare.js +13 -3
- package/dist/runner/ready.d.ts +7 -3
- package/dist/runner/ready.js +11 -5
- package/dist/runner/scope.d.ts +17 -1
- package/dist/runner/scope.js +4 -0
- package/dist/runner/snapshot-build.d.ts +3 -1
- package/dist/runner/snapshot-build.js +12 -2
- package/dist/runner/snapshot-cache.d.ts +46 -8
- package/dist/runner/snapshot-cache.js +60 -11
- package/dist/runner/snapshot-key.d.ts +12 -1
- package/dist/runner/snapshot-key.js +17 -1
- package/dist/runner/snapshot-save.d.ts +53 -0
- package/dist/runner/snapshot-save.js +148 -0
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/payload/payload.d.ts +2 -2
- package/dist/sdk/payload/payload.js +2 -2
- package/dist/story/align.d.ts +1 -1
- package/dist/story/align.js +1 -1
- package/dist/story/definition.d.ts +22 -15
- package/dist/story/definition.js +2 -2
- package/dist/story/errors.js +1 -1
- package/dist/story/gateways.d.ts +45 -25
- package/dist/story/gateways.js +2 -2
- package/dist/story/host.d.ts +11 -8
- package/dist/story/host.js +37 -37
- package/dist/story/index.d.ts +1 -1
- package/dist/story/index.js +4 -4
- package/dist/story/json.d.ts +1 -1
- package/dist/story/json.js +2 -2
- package/dist/story/live/recording-gateway.d.ts +2 -0
- package/dist/story/live/{artifact-gateway.js → recording-gateway.js} +33 -12
- package/dist/story/mode.d.ts +2 -2
- package/dist/story/mode.js +1 -1
- package/dist/story/orphans.d.ts +23 -5
- package/dist/story/orphans.js +44 -8
- package/dist/story/recording.d.ts +62 -0
- package/dist/story/{artifact.js → recording.js} +31 -27
- package/dist/story/report.d.ts +21 -9
- package/dist/story/report.js +37 -25
- package/dist/story/settle.d.ts +23 -21
- package/dist/story/settle.js +17 -16
- package/dist/story/{run.d.ts → start.d.ts} +18 -17
- package/dist/story/{run.js → start.js} +66 -43
- package/dist/vercel-cli/driver.d.ts +1 -1
- package/dist/vercel-cli/entry.d.ts +1 -1
- package/dist/vercel-cli/entry.js +1 -1
- package/dist/vercel-cli/verbose.d.ts +2 -2
- package/dist/vercel-cli/verbose.js +2 -2
- package/dist/vitest/config.d.ts +5 -5
- package/dist/vitest/config.js +5 -5
- package/dist/vitest/find-vitest.d.ts +7 -0
- package/dist/vitest/find-vitest.js +28 -0
- package/dist/vitest/fixtures.d.ts +2 -2
- package/dist/vitest/fixtures.js +3 -3
- package/dist/vitest/gateways.d.ts +37 -6
- package/dist/vitest/gateways.js +3 -2
- package/dist/vitest/live/list-gateway.d.ts +7 -3
- package/dist/vitest/live/list-gateway.js +55 -8
- package/dist/vitest/plan.d.ts +41 -8
- package/dist/vitest/plan.js +47 -16
- package/dist/vitest/sandbox.d.ts +1 -1
- package/dist/vitest/sandbox.js +1 -1
- package/dist/vitest/test-events.d.ts +2 -2
- package/dist/vitest/test-events.js +3 -3
- package/dist/vitest/test-results.d.ts +1 -1
- package/dist/vitest/test-results.js +1 -1
- package/dist/vitest/types.d.ts +1 -1
- package/package.json +2 -2
- package/skills/overview.md +5 -4
- package/skills/read-run-output.md +1 -1
- package/dist/commands/run/command.d.ts +0 -327
- package/dist/commands/run/command.js +0 -620
- package/dist/commands/run/metadata.d.ts +0 -47
- package/dist/commands/run/metadata.js +0 -83
- package/dist/commands/run/outcomes.js +0 -332
- package/dist/story/artifact.d.ts +0 -60
- package/dist/story/live/artifact-gateway.d.ts +0 -2
- /package/dist/commands/{run → exec}/live-view.d.ts +0 -0
- /package/dist/commands/{run → exec}/mint-failed.d.ts +0 -0
- /package/dist/commands/{run → exec}/redaction.d.ts +0 -0
- /package/dist/commands/{run → exec}/redaction.js +0 -0
- /package/dist/commands/{run → exec}/run-collector.d.ts +0 -0
- /package/dist/commands/{run → exec}/run-collector.js +0 -0
- /package/dist/commands/{run → exec}/tests-summary.d.ts +0 -0
- /package/dist/commands/{run → exec}/tests-summary.js +0 -0
- /package/dist/commands/{run → exec}/text.d.ts +0 -0
- /package/dist/commands/{run → exec}/text.js +0 -0
- /package/dist/commands/{run → exec}/view.d.ts +0 -0
- /package/dist/commands/{run → exec}/waterfall.d.ts +0 -0
- /package/dist/commands/{run → exec}/waterfall.js +0 -0
- /package/dist/commands/{run → exec}/worker-chart.d.ts +0 -0
- /package/dist/commands/{run → exec}/worker-chart.js +0 -0
package/dist/story/report.d.ts
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
import type { StoryCall, StoryIdentity } from "./
|
|
1
|
+
import type { StoryCall, StoryIdentity } from "./recording.ts";
|
|
2
2
|
import { type StoryRecordLevel } from "./mode.ts";
|
|
3
3
|
import type { StorySettlement } from "./settle.ts";
|
|
4
4
|
/** `user calls slot {"command":"list --json"}`, the input as compact JSON cut to 100 characters. */
|
|
5
5
|
export declare function describeCall(call: Pick<StoryCall, "agent" | "tool" | "input">): string;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* change, an unrecorded call reads `recorded`, an accepted divergence `divergence accepted`, an unmade call
|
|
10
|
-
* `unmade removed`, an unreadable artifact `unreadable rewritten` and an orphan `orphan removed`.
|
|
7
|
+
* What a story's end changed: whether it wrote or removed the story's own recording, and the orphan recordings it
|
|
8
|
+
* removed, or found already gone. An end that fails partway keeps what it changed before the failure.
|
|
11
9
|
*/
|
|
12
|
-
export
|
|
10
|
+
export interface StoryApplied {
|
|
11
|
+
readonly recording: boolean;
|
|
12
|
+
readonly orphans: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* One line per aligned call, then one per unreadable recording and orphan, each with its status in brackets:
|
|
16
|
+
* `matched`, `divergence`, `unrecorded` or `unmade`, `orphan` or `unreadable`. When the story's end `applied` the
|
|
17
|
+
* change to its recording, an unrecorded call reads `recorded`, an accepted divergence `divergence accepted`, an
|
|
18
|
+
* unmade call `unmade removed` and an unreadable recording `unreadable rewritten`; each orphan it removed reads
|
|
19
|
+
* `orphan removed`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function storyEventLines(settlement: StorySettlement, applied: StoryApplied): readonly string[];
|
|
13
22
|
export interface StoryReportInput {
|
|
14
23
|
readonly story: StoryIdentity;
|
|
15
24
|
readonly level: StoryRecordLevel;
|
|
@@ -24,7 +33,10 @@ export interface StoryReportInput {
|
|
|
24
33
|
*/
|
|
25
34
|
export declare function storyReport(input: StoryReportInput): string;
|
|
26
35
|
/**
|
|
27
|
-
*
|
|
28
|
-
* recorded, divergences it accepted, unmade calls it removed, unreadable
|
|
36
|
+
* What a passing story's end `applied`, or `undefined` when it changed nothing. Its first line counts what it did: the
|
|
37
|
+
* calls it recorded, the divergences it accepted, the unmade calls it removed, an unreadable recording it rewrote and
|
|
38
|
+
* the orphans it removed. One line follows for each call it rewrote and each recording it rewrote or removed, as
|
|
39
|
+
* `storyEventLines` gives it, so a call whose input changed with its answer shows as the unmade call removed and the
|
|
40
|
+
* new call recorded.
|
|
29
41
|
*/
|
|
30
|
-
export declare function
|
|
42
|
+
export declare function storyChangeReport(story: StoryIdentity, path: string, settlement: StorySettlement, applied: StoryApplied): string | undefined;
|
package/dist/story/report.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// What a story says about its calls: one event line per call, the report of a failed story, and
|
|
2
|
-
//
|
|
1
|
+
// What a story says about its calls: one event line per call, the report of a failed story, and what a passing story
|
|
2
|
+
// changed. Pure.
|
|
3
3
|
import { describeObservationDiff } from "./diff.js";
|
|
4
4
|
import { STORY_RECORD_VARIABLE } from "./mode.js";
|
|
5
5
|
/** How much of a call's input its line keeps. */
|
|
@@ -10,22 +10,24 @@ export function describeCall(call) {
|
|
|
10
10
|
return `${call.agent} calls ${call.tool} ${input.length > INPUT_CHARS ? `${input.slice(0, INPUT_CHARS - 1)}…` : input}`;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* One line per aligned call, then one per unreadable
|
|
14
|
-
* `matched`, `divergence`, `unrecorded` or `unmade`, `orphan` or `unreadable`. When the story's end `applied`
|
|
15
|
-
* change, an unrecorded call reads `recorded`, an accepted divergence `divergence accepted`, an
|
|
16
|
-
* `unmade removed
|
|
13
|
+
* One line per aligned call, then one per unreadable recording and orphan, each with its status in brackets:
|
|
14
|
+
* `matched`, `divergence`, `unrecorded` or `unmade`, `orphan` or `unreadable`. When the story's end `applied` the
|
|
15
|
+
* change to its recording, an unrecorded call reads `recorded`, an accepted divergence `divergence accepted`, an
|
|
16
|
+
* unmade call `unmade removed` and an unreadable recording `unreadable rewritten`; each orphan it removed reads
|
|
17
|
+
* `orphan removed`.
|
|
17
18
|
*/
|
|
18
19
|
export function storyEventLines(settlement, applied) {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const calls = settlement.aligned.map((each) => `${describeAligned(each)} [${callStatus(each, applied.recording, settlement.accepted)}]`);
|
|
21
|
+
return [...calls, ...recordingLines(settlement, applied)];
|
|
22
|
+
}
|
|
23
|
+
/** One line per unreadable recording and orphan recording, each with its status, as `storyEventLines` gives it. */
|
|
24
|
+
function recordingLines(settlement, applied) {
|
|
25
|
+
const removed = new Set(applied.orphans);
|
|
26
|
+
return settlement.stale.flatMap((entry) => entry.kind === "unreadable"
|
|
27
|
+
? [`recording ${entry.path} [${applied.recording ? "unreadable rewritten" : "unreadable"}]`]
|
|
23
28
|
: entry.kind === "orphan"
|
|
24
|
-
? [
|
|
25
|
-
`artifact ${entry.path} [${applied && settlement.removeOrphans.includes(entry.path) ? "orphan removed" : "orphan"}]`,
|
|
26
|
-
]
|
|
29
|
+
? [`recording ${entry.path} [${removed.has(entry.path) ? "orphan removed" : "orphan"}]`]
|
|
27
30
|
: []);
|
|
28
|
-
return [...calls, ...files];
|
|
29
31
|
}
|
|
30
32
|
function describeAligned(each) {
|
|
31
33
|
return describeCall(each.kind === "unmade" ? each.recorded : each.live);
|
|
@@ -85,18 +87,20 @@ function summary(input) {
|
|
|
85
87
|
if (input.bodyFailed)
|
|
86
88
|
return `${counts} The story threw, so nothing was written.`;
|
|
87
89
|
if (divergences.length > 0) {
|
|
88
|
-
return `${counts} A divergence means the tool behaved differently. If that is intended,
|
|
90
|
+
return `${counts} A divergence means the tool behaved differently. If that is intended, accept it with ${STORY_RECORD_VARIABLE}=all.`;
|
|
89
91
|
}
|
|
90
|
-
return `${counts} The recording no longer fits the story.
|
|
92
|
+
return `${counts} The recording no longer fits the story. Rewrite it with ${STORY_RECORD_VARIABLE}=stale.`;
|
|
91
93
|
}
|
|
92
94
|
/**
|
|
93
|
-
*
|
|
94
|
-
* recorded, divergences it accepted, unmade calls it removed, unreadable
|
|
95
|
+
* What a passing story's end `applied`, or `undefined` when it changed nothing. Its first line counts what it did: the
|
|
96
|
+
* calls it recorded, the divergences it accepted, the unmade calls it removed, an unreadable recording it rewrote and
|
|
97
|
+
* the orphans it removed. One line follows for each call it rewrote and each recording it rewrote or removed, as
|
|
98
|
+
* `storyEventLines` gives it, so a call whose input changed with its answer shows as the unmade call removed and the
|
|
99
|
+
* new call recorded.
|
|
95
100
|
*/
|
|
96
|
-
export function
|
|
101
|
+
export function storyChangeReport(story, path, settlement, applied) {
|
|
97
102
|
const parts = [];
|
|
98
|
-
|
|
99
|
-
if (written) {
|
|
103
|
+
if (applied.recording) {
|
|
100
104
|
const kinds = (kind) => settlement.stale.filter((entry) => entry.kind === kind).length;
|
|
101
105
|
if (kinds("unrecorded") > 0)
|
|
102
106
|
parts.push(`recorded ${count(kinds("unrecorded"), "call")}`);
|
|
@@ -105,13 +109,21 @@ export function storyChangeLine(story, path, settlement) {
|
|
|
105
109
|
if (kinds("unmade") > 0)
|
|
106
110
|
parts.push(`removed ${count(kinds("unmade"), "unmade call")}`);
|
|
107
111
|
if (kinds("unreadable") > 0)
|
|
108
|
-
parts.push("rewrote an unreadable
|
|
112
|
+
parts.push("rewrote an unreadable recording");
|
|
109
113
|
}
|
|
110
|
-
if (
|
|
111
|
-
parts.push(`removed ${count(
|
|
114
|
+
if (applied.orphans.length > 0)
|
|
115
|
+
parts.push(`removed ${count(applied.orphans.length, "orphan recording")}`);
|
|
112
116
|
if (parts.length === 0)
|
|
113
117
|
return undefined;
|
|
114
|
-
|
|
118
|
+
const changed = [
|
|
119
|
+
...(applied.recording ? rewrittenCallLines(settlement) : []),
|
|
120
|
+
...recordingLines(settlement, applied),
|
|
121
|
+
];
|
|
122
|
+
return [`story "${story.name}": ${parts.join(", ")} (${path})`, ...changed.map((line) => ` ${line}`)].join("\n");
|
|
123
|
+
}
|
|
124
|
+
/** The event line of each aligned call a written recording changed: every one but the matched ones. */
|
|
125
|
+
function rewrittenCallLines(settlement) {
|
|
126
|
+
return settlement.aligned.flatMap((each) => each.kind === "matched" ? [] : [`${describeAligned(each)} [${callStatus(each, true, settlement.accepted)}]`]);
|
|
115
127
|
}
|
|
116
128
|
function count(n, one, many = `${one}s`) {
|
|
117
129
|
return `${n} ${n === 1 ? one : many}`;
|
package/dist/story/settle.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type StoryAlignedCall } from "./align.ts";
|
|
2
|
-
import type {
|
|
2
|
+
import type { StoryRecording, StoryCall, StoryIdentity } from "./recording.ts";
|
|
3
3
|
import type { StoryRecordLevel } from "./mode.ts";
|
|
4
4
|
/** A recorded call and a live call with the same key and different observations: the tool behaved differently. */
|
|
5
5
|
export interface StoryDivergence {
|
|
@@ -11,8 +11,9 @@ export interface StoryDivergence {
|
|
|
11
11
|
*
|
|
12
12
|
* - `unrecorded`: a live call with no recorded call.
|
|
13
13
|
* - `unmade`: a recorded call with no live call.
|
|
14
|
-
* - `orphan`:
|
|
15
|
-
*
|
|
14
|
+
* - `orphan`: a recording in the story file's recording directory that belongs to no story in the file, or one in the
|
|
15
|
+
* recording directory of a story file that is gone.
|
|
16
|
+
* - `unreadable`: the story's recording doesn't parse, or has another schema version.
|
|
16
17
|
*/
|
|
17
18
|
export type StoryStaleEntry = {
|
|
18
19
|
readonly kind: "unrecorded";
|
|
@@ -28,20 +29,20 @@ export type StoryStaleEntry = {
|
|
|
28
29
|
readonly path: string;
|
|
29
30
|
readonly problem: string;
|
|
30
31
|
};
|
|
31
|
-
/** The story's
|
|
32
|
-
export type
|
|
32
|
+
/** The story's recording as the story's end read it: found, missing, or unreadable (a read that didn't fail). */
|
|
33
|
+
export type RecordingRead = {
|
|
33
34
|
readonly kind: "found";
|
|
34
|
-
readonly
|
|
35
|
+
readonly recording: StoryRecording;
|
|
35
36
|
} | {
|
|
36
37
|
readonly kind: "missing";
|
|
37
38
|
} | {
|
|
38
39
|
readonly kind: "unreadable";
|
|
39
40
|
readonly problem: string;
|
|
40
41
|
};
|
|
41
|
-
/** What to do with the story's own
|
|
42
|
-
export type
|
|
42
|
+
/** What to do with the story's own recording: write it, remove it, or leave it. */
|
|
43
|
+
export type RecordingChange = {
|
|
43
44
|
readonly kind: "write";
|
|
44
|
-
readonly
|
|
45
|
+
readonly recording: StoryRecording;
|
|
45
46
|
} | {
|
|
46
47
|
readonly kind: "remove";
|
|
47
48
|
} | {
|
|
@@ -49,15 +50,15 @@ export type StoryArtifactChange = {
|
|
|
49
50
|
};
|
|
50
51
|
export interface StorySettleInput {
|
|
51
52
|
readonly story: StoryIdentity;
|
|
52
|
-
/** The story's
|
|
53
|
+
/** The story's recording path, which an unreadable entry names. */
|
|
53
54
|
readonly path: string;
|
|
54
55
|
readonly level: StoryRecordLevel;
|
|
55
56
|
/** Whether the story's body returned without throwing. */
|
|
56
57
|
readonly bodyPassed: boolean;
|
|
57
|
-
readonly
|
|
58
|
+
readonly read: RecordingRead;
|
|
58
59
|
/** The calls the story made, in order. */
|
|
59
60
|
readonly live: readonly StoryCall[];
|
|
60
|
-
/** The
|
|
61
|
+
/** The orphan recordings, when this story's end looks for them (`findOrphans`); none otherwise. */
|
|
61
62
|
readonly orphans: readonly string[];
|
|
62
63
|
}
|
|
63
64
|
export interface StorySettlement {
|
|
@@ -70,9 +71,9 @@ export interface StorySettlement {
|
|
|
70
71
|
readonly unreached: number;
|
|
71
72
|
readonly divergences: readonly StoryDivergence[];
|
|
72
73
|
readonly stale: readonly StoryStaleEntry[];
|
|
73
|
-
readonly change:
|
|
74
|
-
/**
|
|
75
|
-
readonly
|
|
74
|
+
readonly change: RecordingChange;
|
|
75
|
+
/** Whether the end removes the orphan recordings, the `orphan` entries in `stale`. */
|
|
76
|
+
readonly removesOrphans: boolean;
|
|
76
77
|
/** Whether the divergences are recorded as the new observations (`STORY_RECORD=all`). */
|
|
77
78
|
readonly accepted: boolean;
|
|
78
79
|
/** Why the story fails, beyond its body: a divergence, or a stale entry at `none`. */
|
|
@@ -80,15 +81,16 @@ export interface StorySettlement {
|
|
|
80
81
|
}
|
|
81
82
|
/**
|
|
82
83
|
* Settles one story's end. Its live calls are aligned with the recorded ones (`alignCalls`); each `divergence` is a
|
|
83
|
-
* divergence, and each `unrecorded` and `unmade` call, an unreadable
|
|
84
|
-
* story whose body threw changes nothing and fails with its own error; the recorded calls after its last
|
|
85
|
-
* count as unreached, not unmade. Otherwise, by level:
|
|
84
|
+
* divergence, and each `unrecorded` and `unmade` call, an unreadable recording and each orphan recording is a stale
|
|
85
|
+
* entry. A story whose body threw changes nothing and fails with its own error; the recorded calls after its last
|
|
86
|
+
* aligned call count as unreached, not unmade. Otherwise, by level:
|
|
86
87
|
*
|
|
87
88
|
* - `none` changes nothing, and fails on a divergence, else on a stale entry.
|
|
88
|
-
* - `stale` fails on a divergence, changing nothing; otherwise it writes the
|
|
89
|
-
*
|
|
89
|
+
* - `stale` fails on a divergence, changing nothing; otherwise it writes the recording and removes the orphan
|
|
90
|
+
* recordings.
|
|
91
|
+
* - `all` writes the recording and removes the orphan recordings, accepting any divergence.
|
|
90
92
|
*
|
|
91
|
-
* The
|
|
93
|
+
* The recording written holds the live calls. A story that made no call has no recording, so writing it removes one
|
|
92
94
|
* that is there.
|
|
93
95
|
*/
|
|
94
96
|
export declare function settleStory(input: StorySettleInput): StorySettlement;
|
package/dist/story/settle.js
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
// What a story's end decides: how its live calls compare with its
|
|
1
|
+
// What a story's end decides: how its live calls compare with its recording, which divergences and stale entries
|
|
2
2
|
// there are, what to write, and whether the story fails. Pure.
|
|
3
3
|
import { alignCalls } from "./align.js";
|
|
4
|
-
import {
|
|
4
|
+
import { STORY_RECORDING_SCHEMA_VERSION } from "./recording.js";
|
|
5
5
|
/**
|
|
6
6
|
* Settles one story's end. Its live calls are aligned with the recorded ones (`alignCalls`); each `divergence` is a
|
|
7
|
-
* divergence, and each `unrecorded` and `unmade` call, an unreadable
|
|
8
|
-
* story whose body threw changes nothing and fails with its own error; the recorded calls after its last
|
|
9
|
-
* count as unreached, not unmade. Otherwise, by level:
|
|
7
|
+
* divergence, and each `unrecorded` and `unmade` call, an unreadable recording and each orphan recording is a stale
|
|
8
|
+
* entry. A story whose body threw changes nothing and fails with its own error; the recorded calls after its last
|
|
9
|
+
* aligned call count as unreached, not unmade. Otherwise, by level:
|
|
10
10
|
*
|
|
11
11
|
* - `none` changes nothing, and fails on a divergence, else on a stale entry.
|
|
12
|
-
* - `stale` fails on a divergence, changing nothing; otherwise it writes the
|
|
13
|
-
*
|
|
12
|
+
* - `stale` fails on a divergence, changing nothing; otherwise it writes the recording and removes the orphan
|
|
13
|
+
* recordings.
|
|
14
|
+
* - `all` writes the recording and removes the orphan recordings, accepting any divergence.
|
|
14
15
|
*
|
|
15
|
-
* The
|
|
16
|
+
* The recording written holds the live calls. A story that made no call has no recording, so writing it removes one
|
|
16
17
|
* that is there.
|
|
17
18
|
*/
|
|
18
19
|
export function settleStory(input) {
|
|
19
|
-
const recorded = input.
|
|
20
|
+
const recorded = input.read.kind === "found" ? input.read.recording.calls : [];
|
|
20
21
|
const all = alignCalls(recorded, input.live);
|
|
21
22
|
const reached = input.bodyPassed ? all.length : lastLiveIndex(all) + 1;
|
|
22
23
|
const aligned = all.slice(0, reached);
|
|
23
24
|
const unreached = all.length - reached;
|
|
24
25
|
const divergences = aligned.flatMap((each) => each.kind === "divergence" ? [{ recorded: each.recorded, live: each.live }] : []);
|
|
25
26
|
const stale = [
|
|
26
|
-
...(input.
|
|
27
|
-
? [{ kind: "unreadable", path: input.path, problem: input.
|
|
27
|
+
...(input.read.kind === "unreadable"
|
|
28
|
+
? [{ kind: "unreadable", path: input.path, problem: input.read.problem }]
|
|
28
29
|
: []),
|
|
29
30
|
...aligned.flatMap((each) => each.kind === "unrecorded"
|
|
30
31
|
? [{ kind: "unrecorded", call: each.live }]
|
|
@@ -34,7 +35,7 @@ export function settleStory(input) {
|
|
|
34
35
|
...input.orphans.map((path) => ({ kind: "orphan", path })),
|
|
35
36
|
];
|
|
36
37
|
const settled = { aligned, unreached, divergences, stale };
|
|
37
|
-
const leave = { change: { kind: "leave" },
|
|
38
|
+
const leave = { change: { kind: "leave" }, removesOrphans: false, accepted: false };
|
|
38
39
|
if (!input.bodyPassed)
|
|
39
40
|
return { ...settled, ...leave, failure: undefined };
|
|
40
41
|
if (input.level === "none") {
|
|
@@ -49,20 +50,20 @@ export function settleStory(input) {
|
|
|
49
50
|
return {
|
|
50
51
|
...settled,
|
|
51
52
|
change: desiredChange(input),
|
|
52
|
-
|
|
53
|
+
removesOrphans: true,
|
|
53
54
|
accepted: divergences.length > 0,
|
|
54
55
|
failure: undefined,
|
|
55
56
|
};
|
|
56
57
|
}
|
|
57
|
-
/** The
|
|
58
|
+
/** The recording that fits the story's live calls: one holding them, or none when it made no call. */
|
|
58
59
|
function desiredChange(input) {
|
|
59
60
|
if (input.live.length > 0) {
|
|
60
61
|
return {
|
|
61
62
|
kind: "write",
|
|
62
|
-
|
|
63
|
+
recording: { schemaVersion: STORY_RECORDING_SCHEMA_VERSION, story: input.story, calls: input.live },
|
|
63
64
|
};
|
|
64
65
|
}
|
|
65
|
-
return input.
|
|
66
|
+
return input.read.kind === "missing" ? { kind: "leave" } : { kind: "remove" };
|
|
66
67
|
}
|
|
67
68
|
/** The index of the last aligned call the story made, -1 when it made none. */
|
|
68
69
|
function lastLiveIndex(aligned) {
|
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
import type { StoryIdentity } from "./
|
|
1
|
+
import type { StoryIdentity } from "./recording.ts";
|
|
2
2
|
import type { StoryAgents, StoryHandles, StoryHarness, StorySession } from "./definition.ts";
|
|
3
|
-
import type {
|
|
3
|
+
import type { StoryRecordingGateway } from "./gateways.ts";
|
|
4
4
|
import type { StoryRecordLevel } from "./mode.ts";
|
|
5
|
-
export interface
|
|
5
|
+
export interface StoryStartOptions {
|
|
6
6
|
readonly story: StoryIdentity;
|
|
7
|
-
/** The story's
|
|
7
|
+
/** The story's recording path (`recordingPath`). */
|
|
8
8
|
readonly path: string;
|
|
9
9
|
readonly level: StoryRecordLevel;
|
|
10
10
|
/**
|
|
11
11
|
* Aborts when the story is stopped, as by a timeout. A story stopped before its end compares as one whose body
|
|
12
|
-
* threw, so it changes nothing; one stopped while its end changes the
|
|
12
|
+
* threw, so it changes nothing; one stopped while its end changes the recording stops before the next change.
|
|
13
13
|
*/
|
|
14
14
|
readonly signal?: AbortSignal;
|
|
15
15
|
}
|
|
16
16
|
/** How a story's end went. */
|
|
17
|
-
export interface
|
|
18
|
-
/** One line per call, unreadable
|
|
17
|
+
export interface StoryEnd {
|
|
18
|
+
/** One line per call, unreadable recording and orphan recording (`storyEventLines`). */
|
|
19
19
|
readonly events: readonly string[];
|
|
20
20
|
/** The report, when the story fails or its body threw with something to report; otherwise `undefined`. */
|
|
21
21
|
readonly report: string | undefined;
|
|
22
|
-
/** What a passing story changed (`
|
|
23
|
-
readonly
|
|
22
|
+
/** What a passing story changed, naming each call it rewrote (`storyChangeReport`), or `undefined`. */
|
|
23
|
+
readonly changeReport: string | undefined;
|
|
24
24
|
/**
|
|
25
|
-
* Why the story fails beyond its body: a `StoryDivergenceError`, a `StoryStaleError`,
|
|
25
|
+
* Why the story fails beyond its body: a `StoryDivergenceError`, a `StoryStaleError`, a recording that couldn't be
|
|
26
26
|
* read, written or removed, or a session whose `close()` threw. `undefined` when nothing did.
|
|
27
27
|
*/
|
|
28
28
|
readonly error: Error | undefined;
|
|
29
29
|
}
|
|
30
|
-
/** How a story's body ended, and the
|
|
31
|
-
export interface
|
|
30
|
+
/** How a story's body ended, and the orphan recordings when this story's end looks for them (none otherwise). */
|
|
31
|
+
export interface StoryEndInput {
|
|
32
32
|
readonly bodyPassed: boolean;
|
|
33
33
|
readonly orphans: readonly string[];
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
/** A story that started: its body calls tools through `handles` until the story ends. */
|
|
36
|
+
export interface StartedStory<Agents> {
|
|
36
37
|
/** What the story's body gets: one handle per agent, each with a function per tool. */
|
|
37
38
|
readonly handles: StoryHandles<Agents>;
|
|
38
39
|
/**
|
|
39
|
-
* Ends the story, once: whether its body passed, and the
|
|
40
|
+
* Ends the story, once: whether its body passed, and the orphan recordings when this end looks for them.
|
|
40
41
|
* Closes the session, if one started, whatever else happens.
|
|
41
42
|
*/
|
|
42
|
-
|
|
43
|
+
end(input: StoryEndInput): Promise<StoryEnd>;
|
|
43
44
|
}
|
|
44
45
|
/**
|
|
45
|
-
* Starts one story
|
|
46
|
+
* Starts one story. Each tool call checks its input against the tool's schema (a `TypeError` when it doesn't
|
|
46
47
|
* match), starts the session on the first call, runs the tool, and keeps its observation; a tool that throws keeps
|
|
47
48
|
* nothing. Its input and observation must be JSON (a `TypeError` otherwise).
|
|
48
49
|
*/
|
|
49
|
-
export declare function
|
|
50
|
+
export declare function startStory<Session extends StorySession, Agents extends StoryAgents<Session>>(harness: StoryHarness<Session, Agents>, options: StoryStartOptions, gateway: StoryRecordingGateway): StartedStory<Agents>;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
// One story
|
|
2
|
-
// calls with the
|
|
3
|
-
// gateway.
|
|
1
|
+
// One story from its start to its end, apart from Vitest: the handles its body calls tools through, and its end, which
|
|
2
|
+
// compares the calls with the recording, changes what the level allows, and closes the session. Domain logic over the
|
|
3
|
+
// recording gateway.
|
|
4
4
|
import { StoryDivergenceError, StoryStaleError } from "./errors.js";
|
|
5
5
|
import { toStoryJson } from "./json.js";
|
|
6
|
-
import {
|
|
6
|
+
import { storyChangeReport, storyEventLines, storyReport } from "./report.js";
|
|
7
7
|
import { settleStory } from "./settle.js";
|
|
8
8
|
/**
|
|
9
|
-
* Starts one story
|
|
9
|
+
* Starts one story. Each tool call checks its input against the tool's schema (a `TypeError` when it doesn't
|
|
10
10
|
* match), starts the session on the first call, runs the tool, and keeps its observation; a tool that throws keeps
|
|
11
11
|
* nothing. Its input and observation must be JSON (a `TypeError` otherwise).
|
|
12
12
|
*/
|
|
13
|
-
export function
|
|
13
|
+
export function startStory(harness, options, gateway) {
|
|
14
14
|
const live = [];
|
|
15
15
|
let session;
|
|
16
|
-
let
|
|
16
|
+
let ended = false;
|
|
17
17
|
const startSession = () => {
|
|
18
18
|
session ??= Promise.resolve().then(() => harness.start());
|
|
19
19
|
return session;
|
|
20
20
|
};
|
|
21
21
|
const callTool = async (agent, name, raw) => {
|
|
22
|
-
if (
|
|
22
|
+
if (ended)
|
|
23
23
|
throw new Error(`story: ${agent} calls ${name} after the story ended`);
|
|
24
24
|
const tool = harness.agents[agent]?.tools[name];
|
|
25
25
|
if (tool === undefined)
|
|
@@ -33,10 +33,10 @@ export function startStoryRun(harness, options, gateway) {
|
|
|
33
33
|
const input = toStoryJson(parsed.data, `${agent} calls ${name} with input that must be JSON`);
|
|
34
34
|
const index = live.push({ kind: "running" }) - 1;
|
|
35
35
|
try {
|
|
36
|
-
const
|
|
37
|
-
const observation = toStoryJson(tool.observe(
|
|
36
|
+
const returned = await tool.run(await startSession(), parsed.data);
|
|
37
|
+
const observation = toStoryJson(tool.observe(returned), `${agent}'s ${name} tool observes its return value as JSON`);
|
|
38
38
|
live[index] = { kind: "done", call: { agent, tool: name, input, observation } };
|
|
39
|
-
return
|
|
39
|
+
return returned;
|
|
40
40
|
}
|
|
41
41
|
catch (error) {
|
|
42
42
|
live[index] = { kind: "threw" };
|
|
@@ -60,58 +60,79 @@ export function startStoryRun(harness, options, gateway) {
|
|
|
60
60
|
return new Error(`story: the session's close() threw: ${messageOf(error)}`, { cause: error });
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
/** Writes or removes the story's own recording, as `change` says; the error when that failed or was stopped. */
|
|
64
|
+
const changeRecording = async (change) => {
|
|
65
65
|
const { signal } = options;
|
|
66
66
|
if (change.kind === "write") {
|
|
67
|
-
const written = await gateway.
|
|
67
|
+
const written = await gateway.writeRecording({
|
|
68
68
|
path: options.path,
|
|
69
|
-
|
|
69
|
+
recording: change.recording,
|
|
70
70
|
...signalOf(signal),
|
|
71
71
|
});
|
|
72
72
|
if (written.kind === "canceled")
|
|
73
|
-
return stoppedBefore(`writing the
|
|
73
|
+
return stoppedBefore(`writing the recording ${options.path}`);
|
|
74
74
|
if (written.kind === "failed")
|
|
75
|
-
return new Error(`story: couldn't write the
|
|
75
|
+
return new Error(`story: couldn't write the recording ${options.path}: ${written.message}`);
|
|
76
76
|
}
|
|
77
77
|
else if (change.kind === "remove") {
|
|
78
|
-
const removed = await gateway.
|
|
78
|
+
const removed = await gateway.removeRecording({ path: options.path, ...signalOf(signal) });
|
|
79
79
|
if (removed.kind === "canceled")
|
|
80
|
-
return stoppedBefore(`removing the
|
|
80
|
+
return stoppedBefore(`removing the recording ${options.path}`);
|
|
81
81
|
if (removed.kind === "failed")
|
|
82
|
-
return new Error(`story: couldn't remove the
|
|
82
|
+
return new Error(`story: couldn't remove the recording ${options.path}: ${removed.message}`);
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
return undefined;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Makes the changes `settlement` decided, in order: the story's own recording, then each orphan recording. Returns
|
|
88
|
+
* what it changed, up to the first change that failed or was stopped, and that change's error.
|
|
89
|
+
*/
|
|
90
|
+
const apply = async (settlement) => {
|
|
91
|
+
const recordingError = await changeRecording(settlement.change);
|
|
92
|
+
if (recordingError !== undefined)
|
|
93
|
+
return { applied: { recording: false, orphans: [] }, error: recordingError };
|
|
94
|
+
const orphans = [];
|
|
95
|
+
const applied = (error) => ({
|
|
96
|
+
applied: { recording: settlement.change.kind !== "leave", orphans },
|
|
97
|
+
error,
|
|
98
|
+
});
|
|
99
|
+
if (!settlement.removesOrphans)
|
|
100
|
+
return applied(undefined);
|
|
101
|
+
// Two story files that end at once may both find a deleted story file's recordings, so one already gone
|
|
102
|
+
// (`missing`) is no failure.
|
|
103
|
+
for (const entry of settlement.stale) {
|
|
104
|
+
if (entry.kind !== "orphan")
|
|
105
|
+
continue;
|
|
106
|
+
const removed = await gateway.removeRecording({ path: entry.path, ...signalOf(options.signal) });
|
|
86
107
|
if (removed.kind === "canceled")
|
|
87
|
-
return stoppedBefore(`removing the orphan ${
|
|
88
|
-
if (removed.kind === "failed")
|
|
89
|
-
return new Error(`story: couldn't remove the orphan ${
|
|
108
|
+
return applied(stoppedBefore(`removing the orphan ${entry.path}`));
|
|
109
|
+
if (removed.kind === "failed") {
|
|
110
|
+
return applied(new Error(`story: couldn't remove the orphan ${entry.path}: ${removed.message}`));
|
|
111
|
+
}
|
|
112
|
+
orphans.push(entry.path);
|
|
90
113
|
}
|
|
91
|
-
return undefined;
|
|
114
|
+
return applied(undefined);
|
|
92
115
|
};
|
|
93
|
-
const settle = async (
|
|
116
|
+
const settle = async (input) => {
|
|
94
117
|
const calls = live.flatMap((slot) => (slot.kind === "done" ? [slot.call] : []));
|
|
95
|
-
const read = await gateway.
|
|
118
|
+
const read = await gateway.readRecording({ path: options.path });
|
|
96
119
|
if (read.kind === "failed") {
|
|
97
|
-
const error = new Error(`story: couldn't read the
|
|
98
|
-
return { events: [], report: undefined,
|
|
120
|
+
const error = new Error(`story: couldn't read the recording ${options.path}: ${read.message}`);
|
|
121
|
+
return { events: [], report: undefined, changeReport: undefined, error };
|
|
99
122
|
}
|
|
100
|
-
|
|
101
|
-
// A story stopped while it ended, reading its artifact or finding its file's orphans, compares as one whose body
|
|
123
|
+
// A story stopped while it ended, reading its recording or finding orphan recordings, compares as one whose body
|
|
102
124
|
// threw: the test has already failed, so nothing may be written for it.
|
|
103
|
-
const bodyPassed =
|
|
125
|
+
const bodyPassed = input.bodyPassed && options.signal?.aborted !== true;
|
|
104
126
|
const settlement = settleStory({
|
|
105
127
|
story: options.story,
|
|
106
128
|
path: options.path,
|
|
107
129
|
level: options.level,
|
|
108
130
|
bodyPassed,
|
|
109
|
-
|
|
131
|
+
read,
|
|
110
132
|
live: calls,
|
|
111
|
-
orphans:
|
|
133
|
+
orphans: input.orphans,
|
|
112
134
|
});
|
|
113
|
-
const applyError = await apply(settlement);
|
|
114
|
-
const applied = applyError === undefined;
|
|
135
|
+
const { applied, error: applyError } = await apply(settlement);
|
|
115
136
|
const something = settlement.divergences.length > 0 || settlement.stale.length > 0 || settlement.unreached > 0;
|
|
116
137
|
let report;
|
|
117
138
|
let failure;
|
|
@@ -127,17 +148,19 @@ export function startStoryRun(harness, options, gateway) {
|
|
|
127
148
|
return {
|
|
128
149
|
events: storyEventLines(settlement, applied),
|
|
129
150
|
report,
|
|
130
|
-
|
|
151
|
+
changeReport: applyError === undefined && bodyPassed
|
|
152
|
+
? storyChangeReport(options.story, options.path, settlement, applied)
|
|
153
|
+
: undefined,
|
|
131
154
|
error: applyError ?? failure,
|
|
132
155
|
};
|
|
133
156
|
};
|
|
134
|
-
const
|
|
135
|
-
if (
|
|
157
|
+
const end = async (input) => {
|
|
158
|
+
if (ended)
|
|
136
159
|
throw new Error("story: the story already ended");
|
|
137
|
-
|
|
160
|
+
ended = true;
|
|
138
161
|
let settled;
|
|
139
162
|
try {
|
|
140
|
-
settled = await settle(
|
|
163
|
+
settled = await settle(input);
|
|
141
164
|
}
|
|
142
165
|
finally {
|
|
143
166
|
const closeError = await closeSession();
|
|
@@ -147,7 +170,7 @@ export function startStoryRun(harness, options, gateway) {
|
|
|
147
170
|
}
|
|
148
171
|
return settled;
|
|
149
172
|
};
|
|
150
|
-
return { handles,
|
|
173
|
+
return { handles, end };
|
|
151
174
|
}
|
|
152
175
|
function signalOf(signal) {
|
|
153
176
|
return signal === undefined ? {} : { signal };
|
|
@@ -39,7 +39,7 @@ export interface VercelCliOptions {
|
|
|
39
39
|
/**
|
|
40
40
|
* Hears each invocation once it has ended, or failed to start, tokens redacted, such as to print it with
|
|
41
41
|
* `describeInvocation` as the test goes. What it throws is dropped. Without one, `vercelCli` prints each invocation
|
|
42
|
-
* with `describeInvocation` to stderr in a verbose run (
|
|
42
|
+
* with `describeInvocation` to stderr in a verbose run (its `--verbose`) and does nothing otherwise; a
|
|
43
43
|
* listener replaces that, so `() => {}` silences it.
|
|
44
44
|
*/
|
|
45
45
|
readonly onInvocationEnd?: (invocation: VercelInvocation) => void;
|
|
@@ -3,6 +3,6 @@ import { type VercelCli, type VercelCliOptions } from "./driver.ts";
|
|
|
3
3
|
* A `VercelCli` for one test, running `vercel` as real processes with `PATH`, `SystemRoot` and `TEMP` from
|
|
4
4
|
* `process.env` unless `hostEnv` says otherwise. It creates `<home>/global-config` and `<home>/work` first. Without an
|
|
5
5
|
* `onInvocationEnd`, it prints each invocation with `describeInvocation` to stderr in a verbose run
|
|
6
|
-
* (
|
|
6
|
+
* (a run's `--verbose`, read from `process.env`'s run payload), and nothing otherwise.
|
|
7
7
|
*/
|
|
8
8
|
export declare function vercelCli(options: VercelCliOptions): Promise<VercelCli>;
|
package/dist/vercel-cli/entry.js
CHANGED
|
@@ -5,7 +5,7 @@ import { defaultInvocationListener } from "./verbose.js";
|
|
|
5
5
|
* A `VercelCli` for one test, running `vercel` as real processes with `PATH`, `SystemRoot` and `TEMP` from
|
|
6
6
|
* `process.env` unless `hostEnv` says otherwise. It creates `<home>/global-config` and `<home>/work` first. Without an
|
|
7
7
|
* `onInvocationEnd`, it prints each invocation with `describeInvocation` to stderr in a verbose run
|
|
8
|
-
* (
|
|
8
|
+
* (a run's `--verbose`, read from `process.env`'s run payload), and nothing otherwise.
|
|
9
9
|
*/
|
|
10
10
|
export function vercelCli(options) {
|
|
11
11
|
const onInvocationEnd = options.onInvocationEnd ?? defaultInvocationListener(process.env, (text) => console.error(text));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { VercelInvocation } from "./invocation.ts";
|
|
2
2
|
/**
|
|
3
3
|
* The listener `vercelCli` uses when the caller passes no `onInvocationEnd`: one that prints each invocation with
|
|
4
|
-
* `describeInvocation` to `print`, when `env`'s run payload says the run is verbose (
|
|
5
|
-
* `undefined` outside
|
|
4
|
+
* `describeInvocation` to `print`, when `env`'s run payload says the run is verbose (its `--verbose`), or
|
|
5
|
+
* `undefined` outside a storm run, in a run that isn't verbose, or when the run payload can't be read.
|
|
6
6
|
*/
|
|
7
7
|
export declare function defaultInvocationListener(env: Readonly<Record<string, string | undefined>>, print: (text: string) => void): ((invocation: VercelInvocation) => void) | undefined;
|