@vitest-agent/ui 1.0.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/LICENSE +21 -0
- package/README.md +53 -0
- package/dispatcher/cells/single-file-fail.js +28 -0
- package/dispatcher/cells/single-file-pass.js +19 -0
- package/dispatcher/cells/single-file-threshold.js +22 -0
- package/dispatcher/cells/single-project-fail.js +34 -0
- package/dispatcher/cells/single-project-pass.js +17 -0
- package/dispatcher/cells/single-project-threshold.js +25 -0
- package/dispatcher/cells/single-test-fail.js +22 -0
- package/dispatcher/cells/single-test-pass.js +19 -0
- package/dispatcher/cells/single-test-threshold.js +12 -0
- package/dispatcher/cells/workspace-fail.js +27 -0
- package/dispatcher/cells/workspace-pass.js +25 -0
- package/dispatcher/cells/workspace-threshold.js +28 -0
- package/dispatcher/classify.js +48 -0
- package/dispatcher/dispatch.js +73 -0
- package/dispatcher/footer.js +55 -0
- package/dispatcher/helpers.js +186 -0
- package/dispatcher/ink-helpers.js +79 -0
- package/format-duration.js +34 -0
- package/index.d.ts +1843 -0
- package/index.js +40 -0
- package/package.json +59 -0
- package/pubsub/Channel.js +30 -0
- package/pubsub/Publisher.js +37 -0
- package/pubsub/Subscriber.js +77 -0
- package/pubsub/index.js +5 -0
- package/reducer.js +260 -0
- package/render-agent.js +137 -0
- package/render-ink/CountColumns.js +34 -0
- package/render-ink/CoverageBlock.js +80 -0
- package/render-ink/FailureSection.js +69 -0
- package/render-ink/FailuresSection.js +85 -0
- package/render-ink/ModuleHeader.js +43 -0
- package/render-ink/ProjectRow.js +56 -0
- package/render-ink/StatusIcon.js +44 -0
- package/render-ink/StreamApp.js +453 -0
- package/render-ink/SuggestedActions.js +49 -0
- package/render-ink/TestRow.js +33 -0
- package/render-ink/TrendLine.js +42 -0
- package/render-ink/index.js +14 -0
- package/render-ink/spinner.js +62 -0
- package/render-ink/tag-suffix.js +18 -0
- package/synthesize.js +335 -0
- package/tsdoc-metadata.json +11 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,1843 @@
|
|
|
1
|
+
import { Context, Effect, Layer, PubSub, Queue, Schema, Scope, Stream } from "effect";
|
|
2
|
+
import { FC, ReactElement } from "react";
|
|
3
|
+
|
|
4
|
+
//#region ../sdk/dist/dev/pkg/DataReader-2kJ9I9Hh.d.ts
|
|
5
|
+
//#region src/schemas/Coverage.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Aggregate coverage percentages across four istanbul metrics.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
declare const CoverageTotals: Schema.Struct<{
|
|
11
|
+
statements: typeof Schema.Number;
|
|
12
|
+
branches: typeof Schema.Number;
|
|
13
|
+
functions: typeof Schema.Number;
|
|
14
|
+
lines: typeof Schema.Number;
|
|
15
|
+
}>;
|
|
16
|
+
/** @public */
|
|
17
|
+
type CoverageTotals = typeof CoverageTotals.Type;
|
|
18
|
+
/**
|
|
19
|
+
* Per-file coverage data including uncovered line ranges.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
declare const FileCoverageReport: Schema.Struct<{
|
|
23
|
+
file: typeof Schema.String;
|
|
24
|
+
summary: Schema.Struct<{
|
|
25
|
+
statements: typeof Schema.Number;
|
|
26
|
+
branches: typeof Schema.Number;
|
|
27
|
+
functions: typeof Schema.Number;
|
|
28
|
+
lines: typeof Schema.Number;
|
|
29
|
+
}>;
|
|
30
|
+
uncoveredLines: typeof Schema.String;
|
|
31
|
+
}>;
|
|
32
|
+
/** @public */
|
|
33
|
+
type FileCoverageReport = typeof FileCoverageReport.Type;
|
|
34
|
+
/**
|
|
35
|
+
* Complete coverage report attached to an AgentReport.
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* Complete per-project test report written to disk as JSON.
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
declare const AgentReport: Schema.Struct<{
|
|
43
|
+
timestamp: typeof Schema.String;
|
|
44
|
+
project: Schema.optional<typeof Schema.String>;
|
|
45
|
+
reason: Schema.Literal<["passed", "failed", "interrupted"]>;
|
|
46
|
+
summary: Schema.Struct<{
|
|
47
|
+
total: typeof Schema.Number;
|
|
48
|
+
passed: typeof Schema.Number;
|
|
49
|
+
failed: typeof Schema.Number;
|
|
50
|
+
skipped: typeof Schema.Number;
|
|
51
|
+
duration: typeof Schema.Number;
|
|
52
|
+
}>;
|
|
53
|
+
failed: Schema.Array$<Schema.Struct<{
|
|
54
|
+
file: typeof Schema.String;
|
|
55
|
+
state: Schema.Literal<["passed", "failed", "skipped", "pending"]>;
|
|
56
|
+
duration: Schema.optional<typeof Schema.Number>;
|
|
57
|
+
errors: Schema.optional<Schema.Array$<Schema.Struct<{
|
|
58
|
+
message: typeof Schema.String;
|
|
59
|
+
stack: Schema.optional<typeof Schema.String>;
|
|
60
|
+
diff: Schema.optional<typeof Schema.String>;
|
|
61
|
+
expected: Schema.optional<typeof Schema.String>;
|
|
62
|
+
received: Schema.optional<typeof Schema.String>;
|
|
63
|
+
}>>>;
|
|
64
|
+
tests: Schema.Array$<Schema.Struct<{
|
|
65
|
+
name: typeof Schema.String;
|
|
66
|
+
fullName: typeof Schema.String;
|
|
67
|
+
state: Schema.Literal<["passed", "failed", "skipped", "pending"]>;
|
|
68
|
+
duration: Schema.optional<typeof Schema.Number>;
|
|
69
|
+
flaky: Schema.optional<typeof Schema.Boolean>;
|
|
70
|
+
slow: Schema.optional<typeof Schema.Boolean>;
|
|
71
|
+
errors: Schema.optional<Schema.Array$<Schema.Struct<{
|
|
72
|
+
message: typeof Schema.String;
|
|
73
|
+
stack: Schema.optional<typeof Schema.String>;
|
|
74
|
+
diff: Schema.optional<typeof Schema.String>;
|
|
75
|
+
expected: Schema.optional<typeof Schema.String>;
|
|
76
|
+
received: Schema.optional<typeof Schema.String>;
|
|
77
|
+
}>>>;
|
|
78
|
+
classification: Schema.optional<Schema.Literal<["stable", "new-failure", "persistent", "flaky", "recovered"]>>;
|
|
79
|
+
}>>;
|
|
80
|
+
}>>;
|
|
81
|
+
unhandledErrors: Schema.Array$<Schema.Struct<{
|
|
82
|
+
message: typeof Schema.String;
|
|
83
|
+
stack: Schema.optional<typeof Schema.String>;
|
|
84
|
+
diff: Schema.optional<typeof Schema.String>;
|
|
85
|
+
expected: Schema.optional<typeof Schema.String>;
|
|
86
|
+
received: Schema.optional<typeof Schema.String>;
|
|
87
|
+
}>>;
|
|
88
|
+
failedFiles: Schema.Array$<typeof Schema.String>;
|
|
89
|
+
coverage: Schema.optional<Schema.Struct<{
|
|
90
|
+
totals: Schema.Struct<{
|
|
91
|
+
statements: typeof Schema.Number;
|
|
92
|
+
branches: typeof Schema.Number;
|
|
93
|
+
functions: typeof Schema.Number;
|
|
94
|
+
lines: typeof Schema.Number;
|
|
95
|
+
}>;
|
|
96
|
+
thresholds: Schema.Struct<{
|
|
97
|
+
global: Schema.Struct<{
|
|
98
|
+
lines: Schema.optional<typeof Schema.Number>;
|
|
99
|
+
functions: Schema.optional<typeof Schema.Number>;
|
|
100
|
+
branches: Schema.optional<typeof Schema.Number>;
|
|
101
|
+
statements: Schema.optional<typeof Schema.Number>;
|
|
102
|
+
}>;
|
|
103
|
+
patterns: Schema.optionalWith<Schema.Array$<Schema.Tuple2<typeof Schema.String, Schema.Struct<{
|
|
104
|
+
lines: Schema.optional<typeof Schema.Number>;
|
|
105
|
+
functions: Schema.optional<typeof Schema.Number>;
|
|
106
|
+
branches: Schema.optional<typeof Schema.Number>;
|
|
107
|
+
statements: Schema.optional<typeof Schema.Number>;
|
|
108
|
+
}>>>, {
|
|
109
|
+
default: () => never[];
|
|
110
|
+
}>;
|
|
111
|
+
}>;
|
|
112
|
+
targets: Schema.optional<Schema.Struct<{
|
|
113
|
+
global: Schema.Struct<{
|
|
114
|
+
lines: Schema.optional<typeof Schema.Number>;
|
|
115
|
+
functions: Schema.optional<typeof Schema.Number>;
|
|
116
|
+
branches: Schema.optional<typeof Schema.Number>;
|
|
117
|
+
statements: Schema.optional<typeof Schema.Number>;
|
|
118
|
+
}>;
|
|
119
|
+
patterns: Schema.optionalWith<Schema.Array$<Schema.Tuple2<typeof Schema.String, Schema.Struct<{
|
|
120
|
+
lines: Schema.optional<typeof Schema.Number>;
|
|
121
|
+
functions: Schema.optional<typeof Schema.Number>;
|
|
122
|
+
branches: Schema.optional<typeof Schema.Number>;
|
|
123
|
+
statements: Schema.optional<typeof Schema.Number>;
|
|
124
|
+
}>>>, {
|
|
125
|
+
default: () => never[];
|
|
126
|
+
}>;
|
|
127
|
+
}>>;
|
|
128
|
+
baselines: Schema.optional<Schema.Struct<{
|
|
129
|
+
global: Schema.Struct<{
|
|
130
|
+
lines: Schema.optional<typeof Schema.Number>;
|
|
131
|
+
functions: Schema.optional<typeof Schema.Number>;
|
|
132
|
+
branches: Schema.optional<typeof Schema.Number>;
|
|
133
|
+
statements: Schema.optional<typeof Schema.Number>;
|
|
134
|
+
}>;
|
|
135
|
+
patterns: Schema.optionalWith<Schema.Array$<Schema.Tuple2<typeof Schema.String, Schema.Struct<{
|
|
136
|
+
lines: Schema.optional<typeof Schema.Number>;
|
|
137
|
+
functions: Schema.optional<typeof Schema.Number>;
|
|
138
|
+
branches: Schema.optional<typeof Schema.Number>;
|
|
139
|
+
statements: Schema.optional<typeof Schema.Number>;
|
|
140
|
+
}>>>, {
|
|
141
|
+
default: () => never[];
|
|
142
|
+
}>;
|
|
143
|
+
}>>;
|
|
144
|
+
scoped: Schema.optionalWith<typeof Schema.Boolean, {
|
|
145
|
+
default: () => false;
|
|
146
|
+
}>;
|
|
147
|
+
scopedFiles: Schema.optional<Schema.Array$<typeof Schema.String>>;
|
|
148
|
+
lowCoverage: Schema.Array$<Schema.Struct<{
|
|
149
|
+
file: typeof Schema.String;
|
|
150
|
+
summary: Schema.Struct<{
|
|
151
|
+
statements: typeof Schema.Number;
|
|
152
|
+
branches: typeof Schema.Number;
|
|
153
|
+
functions: typeof Schema.Number;
|
|
154
|
+
lines: typeof Schema.Number;
|
|
155
|
+
}>;
|
|
156
|
+
uncoveredLines: typeof Schema.String;
|
|
157
|
+
}>>;
|
|
158
|
+
lowCoverageFiles: Schema.Array$<typeof Schema.String>;
|
|
159
|
+
belowTarget: Schema.optional<Schema.Array$<Schema.Struct<{
|
|
160
|
+
file: typeof Schema.String;
|
|
161
|
+
summary: Schema.Struct<{
|
|
162
|
+
statements: typeof Schema.Number;
|
|
163
|
+
branches: typeof Schema.Number;
|
|
164
|
+
functions: typeof Schema.Number;
|
|
165
|
+
lines: typeof Schema.Number;
|
|
166
|
+
}>;
|
|
167
|
+
uncoveredLines: typeof Schema.String;
|
|
168
|
+
}>>>;
|
|
169
|
+
belowTargetFiles: Schema.optional<Schema.Array$<typeof Schema.String>>;
|
|
170
|
+
}>>;
|
|
171
|
+
tagCounts: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Struct<{
|
|
172
|
+
passed: Schema.optional<typeof Schema.Number>;
|
|
173
|
+
failed: Schema.optional<typeof Schema.Number>;
|
|
174
|
+
skipped: Schema.optional<typeof Schema.Number>;
|
|
175
|
+
}>>>;
|
|
176
|
+
}>;
|
|
177
|
+
/** @public */
|
|
178
|
+
type AgentReport = typeof AgentReport.Type; //#endregion
|
|
179
|
+
//#region src/schemas/Identity.d.ts
|
|
180
|
+
/**
|
|
181
|
+
* Canonical UUID for an LLM agent invocation. Generated server-side at
|
|
182
|
+
* `register_agent` time. Stable across transport reconnects within an
|
|
183
|
+
* agent's lifetime.
|
|
184
|
+
* @public
|
|
185
|
+
*/
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region ../sdk/dist/dev/pkg/index.d.ts
|
|
188
|
+
//#region src/schemas/RenderState.d.ts
|
|
189
|
+
/**
|
|
190
|
+
* Per-test record accumulated as `TestStarted` / `TestFinished` events arrive.
|
|
191
|
+
* @public
|
|
192
|
+
*/
|
|
193
|
+
declare const TestRecord: Schema.Struct<{
|
|
194
|
+
testName: typeof Schema.String;
|
|
195
|
+
suitePath: Schema.Array$<typeof Schema.String>;
|
|
196
|
+
status: Schema.Union<[Schema.Literal<["passed", "failed", "skipped", "pending"]>, Schema.Literal<["running", "timed-out"]>]>;
|
|
197
|
+
durationMs: Schema.NullOr<typeof Schema.Number>;
|
|
198
|
+
error: Schema.optional<Schema.Struct<{
|
|
199
|
+
message: typeof Schema.String;
|
|
200
|
+
stack: Schema.optional<typeof Schema.String>;
|
|
201
|
+
diff: Schema.optional<typeof Schema.String>;
|
|
202
|
+
expected: Schema.optional<typeof Schema.String>;
|
|
203
|
+
received: Schema.optional<typeof Schema.String>;
|
|
204
|
+
}>>;
|
|
205
|
+
}>;
|
|
206
|
+
/** @public */
|
|
207
|
+
type TestRecord = typeof TestRecord.Type;
|
|
208
|
+
/**
|
|
209
|
+
* Per-module aggregation. The reducer keeps modules keyed on
|
|
210
|
+
* `modulePath` so out-of-order events can update the right slot.
|
|
211
|
+
* @public
|
|
212
|
+
*/
|
|
213
|
+
declare const ModuleRecord: Schema.Struct<{
|
|
214
|
+
modulePath: typeof Schema.String;
|
|
215
|
+
status: Schema.Literal<["queued", "running", "finished"]>;
|
|
216
|
+
passCount: typeof Schema.Number;
|
|
217
|
+
failCount: typeof Schema.Number;
|
|
218
|
+
skipCount: typeof Schema.Number;
|
|
219
|
+
timeoutCount: typeof Schema.Number;
|
|
220
|
+
durationMs: typeof Schema.Number;
|
|
221
|
+
tests: Schema.Array$<Schema.Struct<{
|
|
222
|
+
testName: typeof Schema.String;
|
|
223
|
+
suitePath: Schema.Array$<typeof Schema.String>;
|
|
224
|
+
status: Schema.Union<[Schema.Literal<["passed", "failed", "skipped", "pending"]>, Schema.Literal<["running", "timed-out"]>]>;
|
|
225
|
+
durationMs: Schema.NullOr<typeof Schema.Number>;
|
|
226
|
+
error: Schema.optional<Schema.Struct<{
|
|
227
|
+
message: typeof Schema.String;
|
|
228
|
+
stack: Schema.optional<typeof Schema.String>;
|
|
229
|
+
diff: Schema.optional<typeof Schema.String>;
|
|
230
|
+
expected: Schema.optional<typeof Schema.String>;
|
|
231
|
+
received: Schema.optional<typeof Schema.String>;
|
|
232
|
+
}>>;
|
|
233
|
+
}>>;
|
|
234
|
+
/**
|
|
235
|
+
* Owning Vitest project name. Optional — events from project-less
|
|
236
|
+
* configs or older replays leave it `undefined`, which the renderer
|
|
237
|
+
* treats as a single anonymous project.
|
|
238
|
+
*/
|
|
239
|
+
projectName: Schema.optional<typeof Schema.String>;
|
|
240
|
+
/**
|
|
241
|
+
* ISO wall-clock stamp captured at `onTestModuleStart`. The live
|
|
242
|
+
* renderer derives a ticking elapsed column from it while the module
|
|
243
|
+
* runs; once finished it shows `durationMs` instead. Optional — a
|
|
244
|
+
* module seeded by `ModuleQueued` (or replayed) has no start stamp.
|
|
245
|
+
*/
|
|
246
|
+
startedAt: Schema.optional<typeof Schema.String>;
|
|
247
|
+
tagCounts: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Number>>;
|
|
248
|
+
}>;
|
|
249
|
+
/** @public */
|
|
250
|
+
type ModuleRecord = typeof ModuleRecord.Type;
|
|
251
|
+
/**
|
|
252
|
+
* One row in the failure list. A failure can exist before its
|
|
253
|
+
* classification arrives (`FailureClassified` is emitted from a
|
|
254
|
+
* separate pipeline), so `classification` is nullable.
|
|
255
|
+
* @public
|
|
256
|
+
*/
|
|
257
|
+
declare const FailureRecord: Schema.Struct<{
|
|
258
|
+
modulePath: typeof Schema.String;
|
|
259
|
+
testName: typeof Schema.String;
|
|
260
|
+
suitePath: Schema.Array$<typeof Schema.String>;
|
|
261
|
+
error: Schema.optional<Schema.Struct<{
|
|
262
|
+
message: typeof Schema.String;
|
|
263
|
+
stack: Schema.optional<typeof Schema.String>;
|
|
264
|
+
diff: Schema.optional<typeof Schema.String>;
|
|
265
|
+
expected: Schema.optional<typeof Schema.String>;
|
|
266
|
+
received: Schema.optional<typeof Schema.String>;
|
|
267
|
+
}>>;
|
|
268
|
+
timedOut: Schema.optional<typeof Schema.Boolean>;
|
|
269
|
+
classification: Schema.NullOr<Schema.Literal<["stable", "new-failure", "persistent", "flaky", "recovered"]>>;
|
|
270
|
+
}>;
|
|
271
|
+
/** @public */
|
|
272
|
+
type FailureRecord = typeof FailureRecord.Type;
|
|
273
|
+
/**
|
|
274
|
+
* Coverage block, populated only after `CoverageReady`. Threshold
|
|
275
|
+
* violations are accumulated separately as they arrive.
|
|
276
|
+
* @public
|
|
277
|
+
*/
|
|
278
|
+
declare const CoverageRenderState: Schema.Struct<{
|
|
279
|
+
metrics: Schema.Struct<{
|
|
280
|
+
statements: typeof Schema.Number;
|
|
281
|
+
branches: typeof Schema.Number;
|
|
282
|
+
functions: typeof Schema.Number;
|
|
283
|
+
lines: typeof Schema.Number;
|
|
284
|
+
}>;
|
|
285
|
+
thresholds: Schema.Struct<{
|
|
286
|
+
lines: Schema.optional<typeof Schema.Number>;
|
|
287
|
+
functions: Schema.optional<typeof Schema.Number>;
|
|
288
|
+
branches: Schema.optional<typeof Schema.Number>;
|
|
289
|
+
statements: Schema.optional<typeof Schema.Number>;
|
|
290
|
+
}>;
|
|
291
|
+
gaps: Schema.Array$<Schema.Struct<{
|
|
292
|
+
file: typeof Schema.String;
|
|
293
|
+
missing: Schema.Struct<{
|
|
294
|
+
statements: typeof Schema.Number;
|
|
295
|
+
branches: typeof Schema.Number;
|
|
296
|
+
functions: typeof Schema.Number;
|
|
297
|
+
lines: typeof Schema.Number;
|
|
298
|
+
}>;
|
|
299
|
+
uncoveredLines: Schema.optional<typeof Schema.String>;
|
|
300
|
+
}>>;
|
|
301
|
+
violations: Schema.Array$<Schema.Struct<{
|
|
302
|
+
metric: Schema.Literal<["lines", "branches", "functions", "statements"]>;
|
|
303
|
+
expected: typeof Schema.Number;
|
|
304
|
+
actual: typeof Schema.Number;
|
|
305
|
+
}>>;
|
|
306
|
+
}>;
|
|
307
|
+
/** @public */
|
|
308
|
+
type CoverageRenderState = typeof CoverageRenderState.Type;
|
|
309
|
+
/**
|
|
310
|
+
* A `SuggestedAction` event, denormalized into the queue the renderer reads.
|
|
311
|
+
* @public
|
|
312
|
+
*/
|
|
313
|
+
declare const SuggestedActionRecord: Schema.Struct<{
|
|
314
|
+
severity: Schema.Literal<["info", "warn", "blocker"]>;
|
|
315
|
+
title: typeof Schema.String;
|
|
316
|
+
detail: typeof Schema.String;
|
|
317
|
+
targetTool: Schema.optional<typeof Schema.String>;
|
|
318
|
+
}>;
|
|
319
|
+
/** @public */
|
|
320
|
+
type SuggestedActionRecord = typeof SuggestedActionRecord.Type;
|
|
321
|
+
/**
|
|
322
|
+
* Per-run totals, recomputed on every `ModuleFinished` and reconciled
|
|
323
|
+
* against `RunFinished` (which carries the runner's own count).
|
|
324
|
+
* @public
|
|
325
|
+
*/
|
|
326
|
+
declare const RenderTotals: Schema.Struct<{
|
|
327
|
+
passCount: typeof Schema.Number;
|
|
328
|
+
failCount: typeof Schema.Number;
|
|
329
|
+
skipCount: typeof Schema.Number;
|
|
330
|
+
timeoutCount: typeof Schema.Number;
|
|
331
|
+
durationMs: typeof Schema.Number;
|
|
332
|
+
}>;
|
|
333
|
+
/** @public */
|
|
334
|
+
type RenderTotals = typeof RenderTotals.Type;
|
|
335
|
+
/**
|
|
336
|
+
* The renderer state. Both the human (Ink) and agent (string)
|
|
337
|
+
* renderers read this shape; the reducer is the only producer.
|
|
338
|
+
*
|
|
339
|
+
* `phase` is the layout discriminator — agent mode emits one final
|
|
340
|
+
* frame when `phase === "finished"`; human mode redraws at every
|
|
341
|
+
* state change. `"timed-out"` is a terminal phase like `"finished"`
|
|
342
|
+
* — the run is over, but it ended because `onProcessTimeout` fired
|
|
343
|
+
* rather than the suite completing.
|
|
344
|
+
* @public
|
|
345
|
+
*/
|
|
346
|
+
declare const RenderState: Schema.Struct<{
|
|
347
|
+
phase: Schema.Literal<["idle", "running", "finished", "timed-out"]>;
|
|
348
|
+
runId: Schema.NullOr<typeof Schema.String>;
|
|
349
|
+
configHash: Schema.NullOr<typeof Schema.String>;
|
|
350
|
+
startedAt: Schema.NullOr<typeof Schema.String>;
|
|
351
|
+
finishedAt: Schema.NullOr<typeof Schema.String>;
|
|
352
|
+
modules: Schema.Record$<typeof Schema.String, Schema.Struct<{
|
|
353
|
+
modulePath: typeof Schema.String;
|
|
354
|
+
status: Schema.Literal<["queued", "running", "finished"]>;
|
|
355
|
+
passCount: typeof Schema.Number;
|
|
356
|
+
failCount: typeof Schema.Number;
|
|
357
|
+
skipCount: typeof Schema.Number;
|
|
358
|
+
timeoutCount: typeof Schema.Number;
|
|
359
|
+
durationMs: typeof Schema.Number;
|
|
360
|
+
tests: Schema.Array$<Schema.Struct<{
|
|
361
|
+
testName: typeof Schema.String;
|
|
362
|
+
suitePath: Schema.Array$<typeof Schema.String>;
|
|
363
|
+
status: Schema.Union<[Schema.Literal<["passed", "failed", "skipped", "pending"]>, Schema.Literal<["running", "timed-out"]>]>;
|
|
364
|
+
durationMs: Schema.NullOr<typeof Schema.Number>;
|
|
365
|
+
error: Schema.optional<Schema.Struct<{
|
|
366
|
+
message: typeof Schema.String;
|
|
367
|
+
stack: Schema.optional<typeof Schema.String>;
|
|
368
|
+
diff: Schema.optional<typeof Schema.String>;
|
|
369
|
+
expected: Schema.optional<typeof Schema.String>;
|
|
370
|
+
received: Schema.optional<typeof Schema.String>;
|
|
371
|
+
}>>;
|
|
372
|
+
}>>;
|
|
373
|
+
/**
|
|
374
|
+
* Owning Vitest project name. Optional — events from project-less
|
|
375
|
+
* configs or older replays leave it `undefined`, which the renderer
|
|
376
|
+
* treats as a single anonymous project.
|
|
377
|
+
*/
|
|
378
|
+
projectName: Schema.optional<typeof Schema.String>;
|
|
379
|
+
/**
|
|
380
|
+
* ISO wall-clock stamp captured at `onTestModuleStart`. The live
|
|
381
|
+
* renderer derives a ticking elapsed column from it while the module
|
|
382
|
+
* runs; once finished it shows `durationMs` instead. Optional — a
|
|
383
|
+
* module seeded by `ModuleQueued` (or replayed) has no start stamp.
|
|
384
|
+
*/
|
|
385
|
+
startedAt: Schema.optional<typeof Schema.String>;
|
|
386
|
+
tagCounts: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Number>>;
|
|
387
|
+
}>>;
|
|
388
|
+
moduleOrder: Schema.Array$<typeof Schema.String>;
|
|
389
|
+
totals: Schema.Struct<{
|
|
390
|
+
passCount: typeof Schema.Number;
|
|
391
|
+
failCount: typeof Schema.Number;
|
|
392
|
+
skipCount: typeof Schema.Number;
|
|
393
|
+
timeoutCount: typeof Schema.Number;
|
|
394
|
+
durationMs: typeof Schema.Number;
|
|
395
|
+
}>;
|
|
396
|
+
coverage: Schema.NullOr<Schema.Struct<{
|
|
397
|
+
metrics: Schema.Struct<{
|
|
398
|
+
statements: typeof Schema.Number;
|
|
399
|
+
branches: typeof Schema.Number;
|
|
400
|
+
functions: typeof Schema.Number;
|
|
401
|
+
lines: typeof Schema.Number;
|
|
402
|
+
}>;
|
|
403
|
+
thresholds: Schema.Struct<{
|
|
404
|
+
lines: Schema.optional<typeof Schema.Number>;
|
|
405
|
+
functions: Schema.optional<typeof Schema.Number>;
|
|
406
|
+
branches: Schema.optional<typeof Schema.Number>;
|
|
407
|
+
statements: Schema.optional<typeof Schema.Number>;
|
|
408
|
+
}>;
|
|
409
|
+
gaps: Schema.Array$<Schema.Struct<{
|
|
410
|
+
file: typeof Schema.String;
|
|
411
|
+
missing: Schema.Struct<{
|
|
412
|
+
statements: typeof Schema.Number;
|
|
413
|
+
branches: typeof Schema.Number;
|
|
414
|
+
functions: typeof Schema.Number;
|
|
415
|
+
lines: typeof Schema.Number;
|
|
416
|
+
}>;
|
|
417
|
+
uncoveredLines: Schema.optional<typeof Schema.String>;
|
|
418
|
+
}>>;
|
|
419
|
+
violations: Schema.Array$<Schema.Struct<{
|
|
420
|
+
metric: Schema.Literal<["lines", "branches", "functions", "statements"]>;
|
|
421
|
+
expected: typeof Schema.Number;
|
|
422
|
+
actual: typeof Schema.Number;
|
|
423
|
+
}>>;
|
|
424
|
+
}>>;
|
|
425
|
+
trend: Schema.NullOr<Schema.Struct<{
|
|
426
|
+
direction: Schema.Literal<["improving", "regressing", "stable"]>;
|
|
427
|
+
runCount: typeof Schema.Number;
|
|
428
|
+
}>>;
|
|
429
|
+
failures: Schema.Array$<Schema.Struct<{
|
|
430
|
+
modulePath: typeof Schema.String;
|
|
431
|
+
testName: typeof Schema.String;
|
|
432
|
+
suitePath: Schema.Array$<typeof Schema.String>;
|
|
433
|
+
error: Schema.optional<Schema.Struct<{
|
|
434
|
+
message: typeof Schema.String;
|
|
435
|
+
stack: Schema.optional<typeof Schema.String>;
|
|
436
|
+
diff: Schema.optional<typeof Schema.String>;
|
|
437
|
+
expected: Schema.optional<typeof Schema.String>;
|
|
438
|
+
received: Schema.optional<typeof Schema.String>;
|
|
439
|
+
}>>;
|
|
440
|
+
timedOut: Schema.optional<typeof Schema.Boolean>;
|
|
441
|
+
classification: Schema.NullOr<Schema.Literal<["stable", "new-failure", "persistent", "flaky", "recovered"]>>;
|
|
442
|
+
}>>;
|
|
443
|
+
suggestedActions: Schema.Array$<Schema.Struct<{
|
|
444
|
+
severity: Schema.Literal<["info", "warn", "blocker"]>;
|
|
445
|
+
title: typeof Schema.String;
|
|
446
|
+
detail: typeof Schema.String;
|
|
447
|
+
targetTool: Schema.optional<typeof Schema.String>;
|
|
448
|
+
}>>;
|
|
449
|
+
}>;
|
|
450
|
+
/** @public */
|
|
451
|
+
type RenderState = typeof RenderState.Type;
|
|
452
|
+
/**
|
|
453
|
+
* Initial state — what the reducer returns when no events have been
|
|
454
|
+
* applied yet. Exported so tests and the renderers' bootstrapping
|
|
455
|
+
* code share one definition.
|
|
456
|
+
* @public
|
|
457
|
+
*/
|
|
458
|
+
declare const initialRenderState: RenderState; //#endregion
|
|
459
|
+
//#region src/contracts/dispatcher.d.ts
|
|
460
|
+
/**
|
|
461
|
+
* The four run shapes the dispatcher distinguishes.
|
|
462
|
+
*
|
|
463
|
+
* Computed once per run from the reduced state's module count, the
|
|
464
|
+
* distinct-project count (carried via {@link DispatchInputs.projects}),
|
|
465
|
+
* and the test count inside each module.
|
|
466
|
+
*
|
|
467
|
+
* - `single-test` — exactly one test by name across the run.
|
|
468
|
+
* - `single-file` — exactly one module, more than one test.
|
|
469
|
+
* - `single-project` — one project, more than one module.
|
|
470
|
+
* - `workspace` — more than one project.
|
|
471
|
+
* @public
|
|
472
|
+
*/
|
|
473
|
+
type RunShape = "single-test" | "single-file" | "single-project" | "workspace";
|
|
474
|
+
/**
|
|
475
|
+
* The three outcome classes the dispatcher distinguishes.
|
|
476
|
+
*
|
|
477
|
+
* - `all-pass` — `totals.failed === 0` and no coverage threshold violations.
|
|
478
|
+
* - `some-fail` — `totals.failed > 0`.
|
|
479
|
+
* - `threshold-violation` — `totals.failed === 0` and at least one coverage violation.
|
|
480
|
+
* @public
|
|
481
|
+
*/
|
|
482
|
+
type RunOutcome = "all-pass" | "some-fail" | "threshold-violation";
|
|
483
|
+
/**
|
|
484
|
+
* Compact per-project aggregate carried into workspace cells.
|
|
485
|
+
*
|
|
486
|
+
* Populated by the plugin from `ReporterRenderInput.reports`. Empty for
|
|
487
|
+
* non-workspace shapes. `tagCounts`, `belowTarget`, and `violations` are
|
|
488
|
+
* optional — workspace cells render the columns only when present.
|
|
489
|
+
* @public
|
|
490
|
+
*/
|
|
491
|
+
interface ProjectSummary {
|
|
492
|
+
readonly name: string;
|
|
493
|
+
readonly passCount: number;
|
|
494
|
+
readonly failCount: number;
|
|
495
|
+
readonly skipCount: number;
|
|
496
|
+
readonly durationMs: number;
|
|
497
|
+
readonly tagCounts?: Record<string, number>;
|
|
498
|
+
readonly belowTarget?: number;
|
|
499
|
+
readonly violations?: number;
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Per-run trend direction handed to cells that surface a `Trend: …` line.
|
|
503
|
+
*
|
|
504
|
+
* Mirrors the inline `ReporterRenderInput.trendSummary` shape — promoted
|
|
505
|
+
* to a named type here so the dispatcher and its cells can pass it around
|
|
506
|
+
* without re-declaring it. The plugin populates this from
|
|
507
|
+
* `ReporterRenderInput.trendSummary` before invoking `dispatch`.
|
|
508
|
+
* @public
|
|
509
|
+
*/
|
|
510
|
+
interface TrendSummary {
|
|
511
|
+
readonly direction: "improving" | "regressing" | "stable";
|
|
512
|
+
readonly runCount: number;
|
|
513
|
+
readonly firstMetric?: {
|
|
514
|
+
readonly name: string;
|
|
515
|
+
readonly from: number;
|
|
516
|
+
readonly to: number;
|
|
517
|
+
readonly target?: number;
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* Inputs each cell renderer reads to produce its output.
|
|
522
|
+
*
|
|
523
|
+
* `state` carries the post-reduce projection of the `RunEvent`
|
|
524
|
+
* stream. `shape` and `outcome` are the classified axes the dispatcher
|
|
525
|
+
* keyed on to reach this cell. The remaining fields are non-state
|
|
526
|
+
* helpers the plugin computes once before dispatch so cells stay pure.
|
|
527
|
+
* @public
|
|
528
|
+
*/
|
|
529
|
+
interface DispatchInputs {
|
|
530
|
+
readonly state: RenderState;
|
|
531
|
+
readonly shape: RunShape;
|
|
532
|
+
readonly outcome: RunOutcome;
|
|
533
|
+
/**
|
|
534
|
+
* Per-project aggregates carried into workspace cells. Populated by
|
|
535
|
+
* the plugin from `ReporterRenderInput.reports`; empty for non-workspace
|
|
536
|
+
* shapes.
|
|
537
|
+
*/
|
|
538
|
+
readonly projects: ReadonlyArray<ProjectSummary>;
|
|
539
|
+
/**
|
|
540
|
+
* Trend direction for cells that surface a `Trend: …` line. `null`
|
|
541
|
+
* for scoped runs and any run where trend history is unavailable.
|
|
542
|
+
*/
|
|
543
|
+
readonly trend: TrendSummary | null;
|
|
544
|
+
/**
|
|
545
|
+
* Files below the aspirational `coverageTargets` tier. Workspace and
|
|
546
|
+
* project cells surface a truncated listing of these; single-file and
|
|
547
|
+
* single-test cells ignore them.
|
|
548
|
+
*/
|
|
549
|
+
readonly belowTarget: ReadonlyArray<FileCoverageReport>;
|
|
550
|
+
/**
|
|
551
|
+
* Configured run command (e.g. `pnpm test`). Cell footers reference
|
|
552
|
+
* this so copy-pasted commands stay accurate. `null` when no command
|
|
553
|
+
* was configured.
|
|
554
|
+
*/
|
|
555
|
+
readonly runCommand: string | null;
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Render-time options threaded into each cell from the resolved
|
|
559
|
+
* `ReporterKit`. These are concerns the cell needs to format its
|
|
560
|
+
* output but that do not belong on the state-derived
|
|
561
|
+
* {@link DispatchInputs} struct.
|
|
562
|
+
*
|
|
563
|
+
* The plugin builds this once per run from the kit and passes it into
|
|
564
|
+
* `dispatch(inputs, opts)`. Cells destructure only what they consume.
|
|
565
|
+
* @public
|
|
566
|
+
*/
|
|
567
|
+
interface CellOptions {
|
|
568
|
+
/**
|
|
569
|
+
* Resolved value of the `NO_COLOR` env var. Cells gate ANSI escape
|
|
570
|
+
* sequences and OSC-8 hyperlinks on this.
|
|
571
|
+
*/
|
|
572
|
+
readonly noColor: boolean;
|
|
573
|
+
/**
|
|
574
|
+
* Pre-bound OSC-8 hyperlink helper. The plugin has already decided
|
|
575
|
+
* whether OSC-8 should be enabled (`target=stdout`, `!noColor`) so
|
|
576
|
+
* cells can call this directly without re-consulting the environment.
|
|
577
|
+
*/
|
|
578
|
+
readonly osc8: (url: string, label: string) => string;
|
|
579
|
+
} //#endregion
|
|
580
|
+
//#region src/schemas/Common.d.ts
|
|
581
|
+
/**
|
|
582
|
+
* Possible states for an individual test case.
|
|
583
|
+
* @public
|
|
584
|
+
*/
|
|
585
|
+
/**
|
|
586
|
+
* Classification of a test's failure history across runs.
|
|
587
|
+
* @public
|
|
588
|
+
*/
|
|
589
|
+
declare const TestClassification: Schema.Literal<["stable", "new-failure", "persistent", "flaky", "recovered"]>;
|
|
590
|
+
/** @public */
|
|
591
|
+
type TestClassification = typeof TestClassification.Type;
|
|
592
|
+
/**
|
|
593
|
+
* Console output verbosity mode for AgentReporter.
|
|
594
|
+
* @public
|
|
595
|
+
*/
|
|
596
|
+
//#endregion
|
|
597
|
+
//#region src/schemas/RunEvent.d.ts
|
|
598
|
+
/**
|
|
599
|
+
* Coverage metric whose threshold can be violated independently.
|
|
600
|
+
* @public
|
|
601
|
+
*/
|
|
602
|
+
declare const CoverageMetric: Schema.Literal<["lines", "branches", "functions", "statements"]>;
|
|
603
|
+
/** @public */
|
|
604
|
+
type CoverageMetric = typeof CoverageMetric.Type;
|
|
605
|
+
/**
|
|
606
|
+
* Severity tier for a suggested action emitted during a run.
|
|
607
|
+
* @public
|
|
608
|
+
*/
|
|
609
|
+
declare const ActionSeverity: Schema.Literal<["info", "warn", "blocker"]>;
|
|
610
|
+
/** @public */
|
|
611
|
+
type ActionSeverity = typeof ActionSeverity.Type;
|
|
612
|
+
/**
|
|
613
|
+
* Lifecycle scope of a Vitest setup/teardown hook.
|
|
614
|
+
* @public
|
|
615
|
+
*/
|
|
616
|
+
/**
|
|
617
|
+
* A coverage gap surfaced to the renderer — a per-file shortfall that
|
|
618
|
+
* a renderer may want to call out individually.
|
|
619
|
+
* @public
|
|
620
|
+
*/
|
|
621
|
+
declare const CoverageGap: Schema.Struct<{
|
|
622
|
+
file: typeof Schema.String;
|
|
623
|
+
missing: Schema.Struct<{
|
|
624
|
+
statements: typeof Schema.Number;
|
|
625
|
+
branches: typeof Schema.Number;
|
|
626
|
+
functions: typeof Schema.Number;
|
|
627
|
+
lines: typeof Schema.Number;
|
|
628
|
+
}>;
|
|
629
|
+
uncoveredLines: Schema.optional<typeof Schema.String>;
|
|
630
|
+
}>;
|
|
631
|
+
/** @public */
|
|
632
|
+
type CoverageGap = typeof CoverageGap.Type;
|
|
633
|
+
/**
|
|
634
|
+
* The reducer projects this union into `RenderState`. Renderers
|
|
635
|
+
* never read the raw event stream — they read the projected state.
|
|
636
|
+
*
|
|
637
|
+
* @remarks
|
|
638
|
+
* Adding a variant here is one change in one place; the reducer's
|
|
639
|
+
* exhaustive `Match.exhaustive` will surface any renderer that hasn't
|
|
640
|
+
* been updated to consume the new state shape.
|
|
641
|
+
* @public
|
|
642
|
+
*/
|
|
643
|
+
declare const RunEvent: Schema.Union<[Schema.TaggedStruct<"RunStarted", {
|
|
644
|
+
runId: typeof Schema.String;
|
|
645
|
+
startedAt: typeof Schema.String;
|
|
646
|
+
configHash: typeof Schema.String;
|
|
647
|
+
}>, Schema.TaggedStruct<"ModuleQueued", {
|
|
648
|
+
modulePath: typeof Schema.String;
|
|
649
|
+
projectName: Schema.optional<typeof Schema.String>;
|
|
650
|
+
}>, Schema.TaggedStruct<"ModuleStarted", {
|
|
651
|
+
modulePath: typeof Schema.String;
|
|
652
|
+
startedAt: typeof Schema.String;
|
|
653
|
+
projectName: Schema.optional<typeof Schema.String>;
|
|
654
|
+
}>, Schema.TaggedStruct<"TestStarted", {
|
|
655
|
+
modulePath: typeof Schema.String;
|
|
656
|
+
testName: typeof Schema.String;
|
|
657
|
+
suitePath: Schema.Array$<typeof Schema.String>;
|
|
658
|
+
}>, Schema.TaggedStruct<"TestFinished", {
|
|
659
|
+
modulePath: typeof Schema.String;
|
|
660
|
+
testName: typeof Schema.String;
|
|
661
|
+
suitePath: Schema.Array$<typeof Schema.String>;
|
|
662
|
+
status: Schema.Literal<["passed", "failed", "skipped", "pending"]>;
|
|
663
|
+
durationMs: typeof Schema.Number;
|
|
664
|
+
error: Schema.optional<Schema.Struct<{
|
|
665
|
+
message: typeof Schema.String;
|
|
666
|
+
stack: Schema.optional<typeof Schema.String>;
|
|
667
|
+
diff: Schema.optional<typeof Schema.String>;
|
|
668
|
+
expected: Schema.optional<typeof Schema.String>;
|
|
669
|
+
received: Schema.optional<typeof Schema.String>;
|
|
670
|
+
}>>;
|
|
671
|
+
timedOut: Schema.optional<typeof Schema.Boolean>;
|
|
672
|
+
}>, Schema.TaggedStruct<"ModuleFinished", {
|
|
673
|
+
modulePath: typeof Schema.String;
|
|
674
|
+
passCount: typeof Schema.Number;
|
|
675
|
+
failCount: typeof Schema.Number;
|
|
676
|
+
skipCount: typeof Schema.Number;
|
|
677
|
+
durationMs: typeof Schema.Number;
|
|
678
|
+
projectName: Schema.optional<typeof Schema.String>;
|
|
679
|
+
timeoutCount: Schema.optional<typeof Schema.Number>;
|
|
680
|
+
tagCounts: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Number>>;
|
|
681
|
+
}>, Schema.TaggedStruct<"ModuleCollected", {
|
|
682
|
+
modulePath: typeof Schema.String;
|
|
683
|
+
testCount: typeof Schema.Number;
|
|
684
|
+
suiteCount: typeof Schema.Number;
|
|
685
|
+
}>, Schema.TaggedStruct<"SuiteStarted", {
|
|
686
|
+
modulePath: typeof Schema.String;
|
|
687
|
+
suitePath: Schema.Array$<typeof Schema.String>;
|
|
688
|
+
suiteName: typeof Schema.String;
|
|
689
|
+
}>, Schema.TaggedStruct<"SuiteFinished", {
|
|
690
|
+
modulePath: typeof Schema.String;
|
|
691
|
+
suitePath: Schema.Array$<typeof Schema.String>;
|
|
692
|
+
suiteName: typeof Schema.String;
|
|
693
|
+
passCount: typeof Schema.Number;
|
|
694
|
+
failCount: typeof Schema.Number;
|
|
695
|
+
skipCount: typeof Schema.Number;
|
|
696
|
+
}>, Schema.TaggedStruct<"HookStarted", {
|
|
697
|
+
modulePath: typeof Schema.String;
|
|
698
|
+
hookType: Schema.Literal<["beforeAll", "afterAll", "beforeEach", "afterEach"]>;
|
|
699
|
+
scopeName: typeof Schema.String;
|
|
700
|
+
}>, Schema.TaggedStruct<"HookFinished", {
|
|
701
|
+
modulePath: typeof Schema.String;
|
|
702
|
+
hookType: Schema.Literal<["beforeAll", "afterAll", "beforeEach", "afterEach"]>;
|
|
703
|
+
scopeName: typeof Schema.String;
|
|
704
|
+
durationMs: typeof Schema.Number;
|
|
705
|
+
status: Schema.Literal<["passed", "failed"]>;
|
|
706
|
+
error: Schema.optional<Schema.Struct<{
|
|
707
|
+
message: typeof Schema.String;
|
|
708
|
+
stack: Schema.optional<typeof Schema.String>;
|
|
709
|
+
diff: Schema.optional<typeof Schema.String>;
|
|
710
|
+
expected: Schema.optional<typeof Schema.String>;
|
|
711
|
+
received: Schema.optional<typeof Schema.String>;
|
|
712
|
+
}>>;
|
|
713
|
+
}>, Schema.TaggedStruct<"ConsoleLog", {
|
|
714
|
+
modulePath: Schema.optional<typeof Schema.String>;
|
|
715
|
+
testName: Schema.optional<typeof Schema.String>;
|
|
716
|
+
level: Schema.Literal<["stdout", "stderr"]>;
|
|
717
|
+
content: typeof Schema.String;
|
|
718
|
+
time: typeof Schema.Number;
|
|
719
|
+
}>, Schema.TaggedStruct<"RunTimedOut", {
|
|
720
|
+
message: typeof Schema.String;
|
|
721
|
+
}>, Schema.TaggedStruct<"TestAnnotated", {
|
|
722
|
+
modulePath: typeof Schema.String;
|
|
723
|
+
testName: typeof Schema.String;
|
|
724
|
+
suitePath: Schema.Array$<typeof Schema.String>;
|
|
725
|
+
annotation: typeof Schema.String;
|
|
726
|
+
}>, Schema.TaggedStruct<"TestArtifactRecorded", {
|
|
727
|
+
modulePath: typeof Schema.String;
|
|
728
|
+
testName: typeof Schema.String;
|
|
729
|
+
suitePath: Schema.Array$<typeof Schema.String>;
|
|
730
|
+
artifact: typeof Schema.String;
|
|
731
|
+
}>, Schema.TaggedStruct<"WatcherReady", {}>, Schema.TaggedStruct<"WatcherRerun", {
|
|
732
|
+
triggerFiles: Schema.Array$<typeof Schema.String>;
|
|
733
|
+
reason: Schema.optional<typeof Schema.String>;
|
|
734
|
+
}>, Schema.TaggedStruct<"TrendComputed", {
|
|
735
|
+
direction: Schema.Literal<["improving", "regressing", "stable"]>;
|
|
736
|
+
runCount: typeof Schema.Number;
|
|
737
|
+
}>, Schema.TaggedStruct<"CoverageReady", {
|
|
738
|
+
metrics: Schema.Struct<{
|
|
739
|
+
statements: typeof Schema.Number;
|
|
740
|
+
branches: typeof Schema.Number;
|
|
741
|
+
functions: typeof Schema.Number;
|
|
742
|
+
lines: typeof Schema.Number;
|
|
743
|
+
}>;
|
|
744
|
+
thresholds: Schema.Struct<{
|
|
745
|
+
lines: Schema.optional<typeof Schema.Number>;
|
|
746
|
+
functions: Schema.optional<typeof Schema.Number>;
|
|
747
|
+
branches: Schema.optional<typeof Schema.Number>;
|
|
748
|
+
statements: Schema.optional<typeof Schema.Number>;
|
|
749
|
+
}>;
|
|
750
|
+
gaps: Schema.Array$<Schema.Struct<{
|
|
751
|
+
file: typeof Schema.String;
|
|
752
|
+
missing: Schema.Struct<{
|
|
753
|
+
statements: typeof Schema.Number;
|
|
754
|
+
branches: typeof Schema.Number;
|
|
755
|
+
functions: typeof Schema.Number;
|
|
756
|
+
lines: typeof Schema.Number;
|
|
757
|
+
}>;
|
|
758
|
+
uncoveredLines: Schema.optional<typeof Schema.String>;
|
|
759
|
+
}>>;
|
|
760
|
+
}>, Schema.TaggedStruct<"ThresholdViolation", {
|
|
761
|
+
metric: Schema.Literal<["lines", "branches", "functions", "statements"]>;
|
|
762
|
+
expected: typeof Schema.Number;
|
|
763
|
+
actual: typeof Schema.Number;
|
|
764
|
+
}>, Schema.TaggedStruct<"FailureClassified", {
|
|
765
|
+
modulePath: typeof Schema.String;
|
|
766
|
+
testName: typeof Schema.String;
|
|
767
|
+
classification: Schema.Literal<["stable", "new-failure", "persistent", "flaky", "recovered"]>;
|
|
768
|
+
}>, Schema.TaggedStruct<"SuggestedAction", {
|
|
769
|
+
severity: Schema.Literal<["info", "warn", "blocker"]>;
|
|
770
|
+
title: typeof Schema.String;
|
|
771
|
+
detail: typeof Schema.String;
|
|
772
|
+
targetTool: Schema.optional<typeof Schema.String>;
|
|
773
|
+
}>, Schema.TaggedStruct<"RunFinished", {
|
|
774
|
+
runId: typeof Schema.String;
|
|
775
|
+
finishedAt: typeof Schema.String;
|
|
776
|
+
passCount: typeof Schema.Number;
|
|
777
|
+
failCount: typeof Schema.Number;
|
|
778
|
+
skipCount: typeof Schema.Number;
|
|
779
|
+
durationMs: typeof Schema.Number;
|
|
780
|
+
timeoutCount: Schema.optional<typeof Schema.Number>;
|
|
781
|
+
}>]>;
|
|
782
|
+
/** @public */
|
|
783
|
+
type RunEvent = typeof RunEvent.Type;
|
|
784
|
+
/**
|
|
785
|
+
* Convenience: discriminator-keyed map of the individual variants.
|
|
786
|
+
*
|
|
787
|
+
* Useful for callers that want to construct an event by tag without
|
|
788
|
+
* pulling the whole union shape into scope.
|
|
789
|
+
* @public
|
|
790
|
+
*/
|
|
791
|
+
type RunEventByTag = { [E in RunEvent as E["_tag"]]: E }; //#endregion
|
|
792
|
+
//#region src/schemas/Thresholds.d.ts
|
|
793
|
+
/**
|
|
794
|
+
* Per-metric threshold values. All optional -- only set metrics are enforced.
|
|
795
|
+
* @public
|
|
796
|
+
*/
|
|
797
|
+
declare const MetricThresholds: Schema.Struct<{
|
|
798
|
+
lines: Schema.optional<typeof Schema.Number>;
|
|
799
|
+
functions: Schema.optional<typeof Schema.Number>;
|
|
800
|
+
branches: Schema.optional<typeof Schema.Number>;
|
|
801
|
+
statements: Schema.optional<typeof Schema.Number>;
|
|
802
|
+
}>;
|
|
803
|
+
/** @public */
|
|
804
|
+
type MetricThresholds = typeof MetricThresholds.Type;
|
|
805
|
+
/**
|
|
806
|
+
* A glob pattern paired with its metric thresholds.
|
|
807
|
+
* @public
|
|
808
|
+
*/
|
|
809
|
+
//#endregion
|
|
810
|
+
//#region src/utils/build-report.d.ts
|
|
811
|
+
/**
|
|
812
|
+
* Duck-typed Vitest parsed stack frame.
|
|
813
|
+
*
|
|
814
|
+
* Vitest's TestError.stacks is `ParsedStack[]` from `@vitest/utils`, not a
|
|
815
|
+
* plain string array. Frames must be formatted before joining; otherwise
|
|
816
|
+
* `[obj].join("\n")` produces "[object Object]".
|
|
817
|
+
*
|
|
818
|
+
* @public
|
|
819
|
+
*/
|
|
820
|
+
interface VitestParsedStack {
|
|
821
|
+
method: string;
|
|
822
|
+
file: string;
|
|
823
|
+
line: number;
|
|
824
|
+
column: number;
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* Duck-typed Vitest test error with message, optional diff, and stack traces.
|
|
828
|
+
*
|
|
829
|
+
* `stacks` accepts both already-formatted strings (legacy / coercion path)
|
|
830
|
+
* and `ParsedStack[]` (real Vitest output).
|
|
831
|
+
*
|
|
832
|
+
* @public
|
|
833
|
+
*/
|
|
834
|
+
interface VitestTestError {
|
|
835
|
+
message: string;
|
|
836
|
+
diff?: string;
|
|
837
|
+
stacks?: Array<string | VitestParsedStack>;
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Duck-typed Vitest test result returned by `TestCase.result()`.
|
|
841
|
+
*
|
|
842
|
+
* Vitest returns `undefined` for tests that have not finished running
|
|
843
|
+
* (pending/collected state).
|
|
844
|
+
*
|
|
845
|
+
* @public
|
|
846
|
+
*/
|
|
847
|
+
interface VitestTestResult {
|
|
848
|
+
state: string;
|
|
849
|
+
errors?: ReadonlyArray<VitestTestError>;
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* Duck-typed Vitest test diagnostic returned by `TestCase.diagnostic()`.
|
|
853
|
+
*
|
|
854
|
+
* @public
|
|
855
|
+
*/
|
|
856
|
+
interface VitestTestDiagnostic {
|
|
857
|
+
duration: number;
|
|
858
|
+
flaky: boolean;
|
|
859
|
+
slow: boolean;
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* Duck-typed Vitest TestCase from the Reporter v2 API.
|
|
863
|
+
*
|
|
864
|
+
* @remarks
|
|
865
|
+
* These interfaces mirror the Vitest TestCase shape without importing
|
|
866
|
+
* Vitest types directly, keeping the formatter a pure data transformer
|
|
867
|
+
* with no dependency on the Vitest runtime.
|
|
868
|
+
*
|
|
869
|
+
* @public
|
|
870
|
+
*/
|
|
871
|
+
interface VitestTestCase {
|
|
872
|
+
type: "test";
|
|
873
|
+
name: string;
|
|
874
|
+
fullName: string;
|
|
875
|
+
tags: readonly string[];
|
|
876
|
+
/** Parent suite or module. Optional in the duck-type so unit-test fixtures don't have to fabricate a stub; always present in real Vitest TestCase instances. */
|
|
877
|
+
parent?: VitestTestSuite | VitestTestModule;
|
|
878
|
+
result(): VitestTestResult | undefined;
|
|
879
|
+
diagnostic(): VitestTestDiagnostic | undefined;
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Duck-typed Vitest module diagnostic.
|
|
883
|
+
*
|
|
884
|
+
* @public
|
|
885
|
+
*/
|
|
886
|
+
interface VitestModuleDiagnostic {
|
|
887
|
+
duration: number;
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* Duck-typed Vitest module error.
|
|
891
|
+
*
|
|
892
|
+
* @public
|
|
893
|
+
*/
|
|
894
|
+
interface VitestModuleError {
|
|
895
|
+
message: string;
|
|
896
|
+
stacks?: Array<string | VitestParsedStack>;
|
|
897
|
+
}
|
|
898
|
+
/**
|
|
899
|
+
* Duck-typed Vitest TestSuite from the Reporter v2 API.
|
|
900
|
+
*
|
|
901
|
+
* @public
|
|
902
|
+
*/
|
|
903
|
+
interface VitestTestSuite {
|
|
904
|
+
type: "suite";
|
|
905
|
+
name: string;
|
|
906
|
+
fullName: string;
|
|
907
|
+
state(): string;
|
|
908
|
+
parent: VitestTestSuite | VitestTestModule;
|
|
909
|
+
options: {
|
|
910
|
+
concurrent?: boolean;
|
|
911
|
+
shuffle?: boolean;
|
|
912
|
+
retry?: number;
|
|
913
|
+
repeats?: number;
|
|
914
|
+
mode?: string;
|
|
915
|
+
tags?: string[];
|
|
916
|
+
};
|
|
917
|
+
location?: {
|
|
918
|
+
line: number;
|
|
919
|
+
column: number;
|
|
920
|
+
};
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* Duck-typed Vitest TestModule from the Reporter v2 API.
|
|
924
|
+
*
|
|
925
|
+
* @remarks
|
|
926
|
+
* Each `TestModule` carries a `.project` reference with a `.name` property,
|
|
927
|
+
* which `AgentReporter` uses to group results by Vitest project in
|
|
928
|
+
* monorepo configurations.
|
|
929
|
+
*
|
|
930
|
+
* @public
|
|
931
|
+
*/
|
|
932
|
+
interface VitestTestModule {
|
|
933
|
+
type: "module";
|
|
934
|
+
moduleId: string;
|
|
935
|
+
relativeModuleId: string;
|
|
936
|
+
project: {
|
|
937
|
+
name: string;
|
|
938
|
+
};
|
|
939
|
+
state(): string;
|
|
940
|
+
children: {
|
|
941
|
+
allTests(filter?: string): Generator<VitestTestCase>;
|
|
942
|
+
allSuites(): Generator<VitestTestSuite>;
|
|
943
|
+
};
|
|
944
|
+
diagnostic(): VitestModuleDiagnostic | undefined;
|
|
945
|
+
errors(): Array<VitestModuleError>;
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* Convert Vitest TestModule/TestCase objects into an `AgentReport`.
|
|
949
|
+
*
|
|
950
|
+
* @remarks
|
|
951
|
+
* This is a pure data transformation function with no I/O. It tallies
|
|
952
|
+
* pass/fail/skip counts, extracts error details with diffs, and builds
|
|
953
|
+
* the complete report structure. Only modules with at least one failing
|
|
954
|
+
* test are included in the `failed` array to keep reports compact.
|
|
955
|
+
*
|
|
956
|
+
* @param testModules - All test modules from the Vitest run
|
|
957
|
+
* @param unhandledErrors - Unhandled errors from the run
|
|
958
|
+
* @param reason - Overall run outcome (`"passed"`, `"failed"`, or `"interrupted"`)
|
|
959
|
+
* @param options - Reporter options; only `omitPassingTests` is used
|
|
960
|
+
* @param projectName - Optional project name for monorepo grouping
|
|
961
|
+
* @returns Structured report ready for JSON serialization
|
|
962
|
+
*
|
|
963
|
+
* @public
|
|
964
|
+
*/
|
|
965
|
+
//#endregion
|
|
966
|
+
//#region src/dispatcher/cell-types.d.ts
|
|
967
|
+
/**
|
|
968
|
+
* A cell's agent-string half: pure function from dispatch inputs to a
|
|
969
|
+
* token-economy string emitted once at end-of-run.
|
|
970
|
+
*
|
|
971
|
+
* @public
|
|
972
|
+
*/
|
|
973
|
+
type AgentCellFn = (inputs: DispatchInputs, opts: CellOptions) => string;
|
|
974
|
+
/**
|
|
975
|
+
* A cell's Ink half: pure function from dispatch inputs to a React
|
|
976
|
+
* element rendered live to the terminal.
|
|
977
|
+
*
|
|
978
|
+
* @public
|
|
979
|
+
*/
|
|
980
|
+
type InkCellFn = (inputs: DispatchInputs, opts: CellOptions) => ReactElement;
|
|
981
|
+
/**
|
|
982
|
+
* One entry in the dispatcher matrix: an agent-string renderer and an
|
|
983
|
+
* optional Ink-tree renderer for the same `(RunShape, RunOutcome)` pair.
|
|
984
|
+
*
|
|
985
|
+
* @public
|
|
986
|
+
*/
|
|
987
|
+
interface Cell {
|
|
988
|
+
/** Agent-string half — always present. */
|
|
989
|
+
readonly agent: AgentCellFn;
|
|
990
|
+
/** Ink-tree half — omitted for cells where agent output is sufficient. */
|
|
991
|
+
readonly ink?: InkCellFn;
|
|
992
|
+
}
|
|
993
|
+
//#endregion
|
|
994
|
+
//#region src/dispatcher/classify.d.ts
|
|
995
|
+
/**
|
|
996
|
+
* Compute the run shape from the reduced state plus the per-project
|
|
997
|
+
* aggregates the plugin carries through `DispatchInputs.projects`.
|
|
998
|
+
*
|
|
999
|
+
* The classification follows the state-shape signal described in the
|
|
1000
|
+
* UI rewrite spec §7 open question 1:
|
|
1001
|
+
*
|
|
1002
|
+
* 1. More than one project → `workspace`.
|
|
1003
|
+
* 2. One module with exactly one test → `single-test`.
|
|
1004
|
+
* 3. One module with more than one test → `single-file`.
|
|
1005
|
+
* 4. Otherwise → `single-project`.
|
|
1006
|
+
*
|
|
1007
|
+
* @param state - the fully-reduced render state
|
|
1008
|
+
* @param projects - per-project summaries from the dispatch inputs
|
|
1009
|
+
* @returns the run shape classification
|
|
1010
|
+
* @public
|
|
1011
|
+
*/
|
|
1012
|
+
declare const classifyRunShape: (state: RenderState, projects: ReadonlyArray<ProjectSummary>) => RunShape;
|
|
1013
|
+
/**
|
|
1014
|
+
* Compute the outcome class from the reduced state.
|
|
1015
|
+
*
|
|
1016
|
+
* Precedence: failures win over threshold violations. A run with one
|
|
1017
|
+
* failing test and a coverage gap classifies as `some-fail`; the
|
|
1018
|
+
* threshold-violation cell is reserved for runs where the test suite
|
|
1019
|
+
* itself is clean but coverage policy is not.
|
|
1020
|
+
*
|
|
1021
|
+
* @param state - the fully-reduced render state
|
|
1022
|
+
* @returns the outcome classification
|
|
1023
|
+
* @public
|
|
1024
|
+
*/
|
|
1025
|
+
declare const classifyOutcome: (state: RenderState) => RunOutcome;
|
|
1026
|
+
//#endregion
|
|
1027
|
+
//#region src/dispatcher/dispatch.d.ts
|
|
1028
|
+
/**
|
|
1029
|
+
* The 4×3 cell table. Exported for the test harness so spy-based
|
|
1030
|
+
* routing tests can introspect the wiring without re-deriving it from
|
|
1031
|
+
* source.
|
|
1032
|
+
*
|
|
1033
|
+
* @public
|
|
1034
|
+
*/
|
|
1035
|
+
declare const dispatcherTable: Readonly<Record<RunShape, Readonly<Record<RunOutcome, Cell>>>>;
|
|
1036
|
+
/**
|
|
1037
|
+
* Dispatch to the cell that matches `(inputs.shape, inputs.outcome)`
|
|
1038
|
+
* and return its agent-half string output.
|
|
1039
|
+
*
|
|
1040
|
+
* @param inputs - the classified dispatch inputs
|
|
1041
|
+
* @param opts - cell rendering options
|
|
1042
|
+
* @returns the agent-string output for the matched cell
|
|
1043
|
+
* @public
|
|
1044
|
+
*/
|
|
1045
|
+
declare const dispatch: (inputs: DispatchInputs, opts: CellOptions) => string;
|
|
1046
|
+
/**
|
|
1047
|
+
* Dispatch to the cell that matches `(inputs.shape, inputs.outcome)`
|
|
1048
|
+
* and return its Ink-half React tree. Returns `null` when the matched
|
|
1049
|
+
* cell does not expose an `ink` half — callers should fall back to
|
|
1050
|
+
* the agent string in that case.
|
|
1051
|
+
*
|
|
1052
|
+
* @param inputs - the classified dispatch inputs
|
|
1053
|
+
* @param opts - cell rendering options
|
|
1054
|
+
* @returns the Ink React element, or `null` when the cell has no Ink half
|
|
1055
|
+
* @public
|
|
1056
|
+
*/
|
|
1057
|
+
declare const dispatchInk: (inputs: DispatchInputs, opts: CellOptions) => ReactElement | null;
|
|
1058
|
+
//#endregion
|
|
1059
|
+
//#region src/dispatcher/footer.d.ts
|
|
1060
|
+
/**
|
|
1061
|
+
* Pick the dominant classification from a state's failure list.
|
|
1062
|
+
*
|
|
1063
|
+
* Priority order (most actionable first): `new-failure`, `persistent`,
|
|
1064
|
+
* `flaky`, `recovered`, `stable`. Returns `null` when the failure list
|
|
1065
|
+
* is empty or every failure is unclassified.
|
|
1066
|
+
*
|
|
1067
|
+
* @param state - the fully-reduced render state
|
|
1068
|
+
* @returns the most actionable classification, or `null` when none applies
|
|
1069
|
+
* @public
|
|
1070
|
+
*/
|
|
1071
|
+
declare const dominantClassification: (state: RenderState) => TestClassification | null;
|
|
1072
|
+
/**
|
|
1073
|
+
* Compose the trailing footer lines for a dispatcher cell. Returns an
|
|
1074
|
+
* empty string when no pointer applies. The footer starts with a
|
|
1075
|
+
* leading newline so cells can append it directly without crafting
|
|
1076
|
+
* their own separator.
|
|
1077
|
+
*
|
|
1078
|
+
* @param inputs - the classified dispatch inputs
|
|
1079
|
+
* @returns the footer string, or an empty string when no pointer applies
|
|
1080
|
+
* @public
|
|
1081
|
+
*/
|
|
1082
|
+
declare const buildFooter: (inputs: DispatchInputs) => string;
|
|
1083
|
+
//#endregion
|
|
1084
|
+
//#region src/format-duration.d.ts
|
|
1085
|
+
/**
|
|
1086
|
+
* Shared display formatter for run / module / test durations.
|
|
1087
|
+
*
|
|
1088
|
+
* Vitest hands the reporter full-float millisecond durations
|
|
1089
|
+
* (`14.87745800000016`). Rendering those verbatim is noise. This is
|
|
1090
|
+
* the single formatter every render path calls — `render-agent.ts`,
|
|
1091
|
+
* the `render-ink/` components, the dispatcher cells, and `StreamApp`
|
|
1092
|
+
* — so a duration looks the same wherever it appears.
|
|
1093
|
+
*
|
|
1094
|
+
* Display only. Full-precision durations continue to persist to the
|
|
1095
|
+
* database unchanged; nothing in the trend / baseline / classification
|
|
1096
|
+
* pipeline reads a duration through a formatter.
|
|
1097
|
+
*/
|
|
1098
|
+
/**
|
|
1099
|
+
* Format a duration in milliseconds for display.
|
|
1100
|
+
*
|
|
1101
|
+
* Sub-second values round to one decimal place and render as `<N.N>ms`;
|
|
1102
|
+
* values at or above one second render as `<N.N>s`. A value that rounds
|
|
1103
|
+
* to a whole number drops the trailing `.0` naturally (`Number`
|
|
1104
|
+
* stringification), so `1000` → `1s` and `250` → `250ms`.
|
|
1105
|
+
*
|
|
1106
|
+
* @param ms - duration in milliseconds
|
|
1107
|
+
* @returns formatted duration string
|
|
1108
|
+
* @public
|
|
1109
|
+
*/
|
|
1110
|
+
declare const formatDisplayDuration: (ms: number) => string;
|
|
1111
|
+
//#endregion
|
|
1112
|
+
//#region src/pubsub/Channel.d.ts
|
|
1113
|
+
declare const RunEventChannel_base: Context.TagClass<RunEventChannel, "vitest-agent-ui/RunEventChannel", PubSub.PubSub<{
|
|
1114
|
+
readonly _tag: "RunStarted";
|
|
1115
|
+
readonly runId: string;
|
|
1116
|
+
readonly startedAt: string;
|
|
1117
|
+
readonly configHash: string;
|
|
1118
|
+
} | {
|
|
1119
|
+
readonly _tag: "ModuleQueued";
|
|
1120
|
+
readonly modulePath: string;
|
|
1121
|
+
readonly projectName?: string | undefined;
|
|
1122
|
+
} | {
|
|
1123
|
+
readonly _tag: "ModuleStarted";
|
|
1124
|
+
readonly startedAt: string;
|
|
1125
|
+
readonly modulePath: string;
|
|
1126
|
+
readonly projectName?: string | undefined;
|
|
1127
|
+
} | {
|
|
1128
|
+
readonly _tag: "TestStarted";
|
|
1129
|
+
readonly modulePath: string;
|
|
1130
|
+
readonly testName: string;
|
|
1131
|
+
readonly suitePath: readonly string[];
|
|
1132
|
+
} | {
|
|
1133
|
+
readonly _tag: "TestFinished";
|
|
1134
|
+
readonly modulePath: string;
|
|
1135
|
+
readonly testName: string;
|
|
1136
|
+
readonly suitePath: readonly string[];
|
|
1137
|
+
readonly status: "passed" | "failed" | "skipped" | "pending";
|
|
1138
|
+
readonly durationMs: number;
|
|
1139
|
+
readonly error?: {
|
|
1140
|
+
readonly message: string;
|
|
1141
|
+
readonly stack?: string | undefined;
|
|
1142
|
+
readonly diff?: string | undefined;
|
|
1143
|
+
readonly expected?: string | undefined;
|
|
1144
|
+
readonly received?: string | undefined;
|
|
1145
|
+
} | undefined;
|
|
1146
|
+
readonly timedOut?: boolean | undefined;
|
|
1147
|
+
} | {
|
|
1148
|
+
readonly _tag: "ModuleFinished";
|
|
1149
|
+
readonly modulePath: string;
|
|
1150
|
+
readonly projectName?: string | undefined;
|
|
1151
|
+
readonly durationMs: number;
|
|
1152
|
+
readonly passCount: number;
|
|
1153
|
+
readonly failCount: number;
|
|
1154
|
+
readonly skipCount: number;
|
|
1155
|
+
readonly timeoutCount?: number | undefined;
|
|
1156
|
+
readonly tagCounts?: {
|
|
1157
|
+
readonly [x: string]: number;
|
|
1158
|
+
} | undefined;
|
|
1159
|
+
} | {
|
|
1160
|
+
readonly _tag: "ModuleCollected";
|
|
1161
|
+
readonly modulePath: string;
|
|
1162
|
+
readonly testCount: number;
|
|
1163
|
+
readonly suiteCount: number;
|
|
1164
|
+
} | {
|
|
1165
|
+
readonly _tag: "SuiteStarted";
|
|
1166
|
+
readonly modulePath: string;
|
|
1167
|
+
readonly suitePath: readonly string[];
|
|
1168
|
+
readonly suiteName: string;
|
|
1169
|
+
} | {
|
|
1170
|
+
readonly _tag: "SuiteFinished";
|
|
1171
|
+
readonly modulePath: string;
|
|
1172
|
+
readonly suitePath: readonly string[];
|
|
1173
|
+
readonly passCount: number;
|
|
1174
|
+
readonly failCount: number;
|
|
1175
|
+
readonly skipCount: number;
|
|
1176
|
+
readonly suiteName: string;
|
|
1177
|
+
} | {
|
|
1178
|
+
readonly _tag: "HookStarted";
|
|
1179
|
+
readonly modulePath: string;
|
|
1180
|
+
readonly hookType: "beforeAll" | "afterAll" | "beforeEach" | "afterEach";
|
|
1181
|
+
readonly scopeName: string;
|
|
1182
|
+
} | {
|
|
1183
|
+
readonly _tag: "HookFinished";
|
|
1184
|
+
readonly modulePath: string;
|
|
1185
|
+
readonly status: "passed" | "failed";
|
|
1186
|
+
readonly durationMs: number;
|
|
1187
|
+
readonly error?: {
|
|
1188
|
+
readonly message: string;
|
|
1189
|
+
readonly stack?: string | undefined;
|
|
1190
|
+
readonly diff?: string | undefined;
|
|
1191
|
+
readonly expected?: string | undefined;
|
|
1192
|
+
readonly received?: string | undefined;
|
|
1193
|
+
} | undefined;
|
|
1194
|
+
readonly hookType: "beforeAll" | "afterAll" | "beforeEach" | "afterEach";
|
|
1195
|
+
readonly scopeName: string;
|
|
1196
|
+
} | {
|
|
1197
|
+
readonly _tag: "ConsoleLog";
|
|
1198
|
+
readonly modulePath?: string | undefined;
|
|
1199
|
+
readonly testName?: string | undefined;
|
|
1200
|
+
readonly level: "stdout" | "stderr";
|
|
1201
|
+
readonly content: string;
|
|
1202
|
+
readonly time: number;
|
|
1203
|
+
} | {
|
|
1204
|
+
readonly _tag: "RunTimedOut";
|
|
1205
|
+
readonly message: string;
|
|
1206
|
+
} | {
|
|
1207
|
+
readonly _tag: "TestAnnotated";
|
|
1208
|
+
readonly modulePath: string;
|
|
1209
|
+
readonly testName: string;
|
|
1210
|
+
readonly suitePath: readonly string[];
|
|
1211
|
+
readonly annotation: string;
|
|
1212
|
+
} | {
|
|
1213
|
+
readonly _tag: "TestArtifactRecorded";
|
|
1214
|
+
readonly modulePath: string;
|
|
1215
|
+
readonly testName: string;
|
|
1216
|
+
readonly suitePath: readonly string[];
|
|
1217
|
+
readonly artifact: string;
|
|
1218
|
+
} | {
|
|
1219
|
+
readonly _tag: "WatcherReady";
|
|
1220
|
+
} | {
|
|
1221
|
+
readonly _tag: "WatcherRerun";
|
|
1222
|
+
readonly triggerFiles: readonly string[];
|
|
1223
|
+
readonly reason?: string | undefined;
|
|
1224
|
+
} | {
|
|
1225
|
+
readonly _tag: "TrendComputed";
|
|
1226
|
+
readonly direction: "improving" | "regressing" | "stable";
|
|
1227
|
+
readonly runCount: number;
|
|
1228
|
+
} | {
|
|
1229
|
+
readonly _tag: "CoverageReady";
|
|
1230
|
+
readonly metrics: {
|
|
1231
|
+
readonly statements: number;
|
|
1232
|
+
readonly branches: number;
|
|
1233
|
+
readonly functions: number;
|
|
1234
|
+
readonly lines: number;
|
|
1235
|
+
};
|
|
1236
|
+
readonly thresholds: {
|
|
1237
|
+
readonly statements?: number | undefined;
|
|
1238
|
+
readonly branches?: number | undefined;
|
|
1239
|
+
readonly functions?: number | undefined;
|
|
1240
|
+
readonly lines?: number | undefined;
|
|
1241
|
+
};
|
|
1242
|
+
readonly gaps: readonly {
|
|
1243
|
+
readonly file: string;
|
|
1244
|
+
readonly missing: {
|
|
1245
|
+
readonly statements: number;
|
|
1246
|
+
readonly branches: number;
|
|
1247
|
+
readonly functions: number;
|
|
1248
|
+
readonly lines: number;
|
|
1249
|
+
};
|
|
1250
|
+
readonly uncoveredLines?: string | undefined;
|
|
1251
|
+
}[];
|
|
1252
|
+
} | {
|
|
1253
|
+
readonly _tag: "ThresholdViolation";
|
|
1254
|
+
readonly expected: number;
|
|
1255
|
+
readonly metric: "statements" | "branches" | "functions" | "lines";
|
|
1256
|
+
readonly actual: number;
|
|
1257
|
+
} | {
|
|
1258
|
+
readonly _tag: "FailureClassified";
|
|
1259
|
+
readonly modulePath: string;
|
|
1260
|
+
readonly testName: string;
|
|
1261
|
+
readonly classification: "stable" | "new-failure" | "persistent" | "flaky" | "recovered";
|
|
1262
|
+
} | {
|
|
1263
|
+
readonly _tag: "SuggestedAction";
|
|
1264
|
+
readonly severity: "info" | "warn" | "blocker";
|
|
1265
|
+
readonly title: string;
|
|
1266
|
+
readonly detail: string;
|
|
1267
|
+
readonly targetTool?: string | undefined;
|
|
1268
|
+
} | {
|
|
1269
|
+
readonly _tag: "RunFinished";
|
|
1270
|
+
readonly runId: string;
|
|
1271
|
+
readonly durationMs: number;
|
|
1272
|
+
readonly passCount: number;
|
|
1273
|
+
readonly failCount: number;
|
|
1274
|
+
readonly skipCount: number;
|
|
1275
|
+
readonly timeoutCount?: number | undefined;
|
|
1276
|
+
readonly finishedAt: string;
|
|
1277
|
+
}>>;
|
|
1278
|
+
/**
|
|
1279
|
+
* Service tag for the run-event channel. Consumers depend on this tag;
|
|
1280
|
+
* the {@link RunEventChannelLive} layer is the single point at which
|
|
1281
|
+
* the underlying Effect `PubSub` is constructed.
|
|
1282
|
+
*
|
|
1283
|
+
* @public
|
|
1284
|
+
*/
|
|
1285
|
+
declare class RunEventChannel extends RunEventChannel_base {}
|
|
1286
|
+
/**
|
|
1287
|
+
* Default live layer providing an unbounded Effect `PubSub` for
|
|
1288
|
+
* the run-event channel. The PubSub is scoped — when the surrounding
|
|
1289
|
+
* scope closes, the channel shuts down and any pending subscribers
|
|
1290
|
+
* receive their dequeue closure.
|
|
1291
|
+
*
|
|
1292
|
+
* Unbounded is the right default for the plugin and CLI: events arrive
|
|
1293
|
+
* faster than a slow renderer can drain (e.g., several `TestFinished`
|
|
1294
|
+
* per millisecond during a large suite), and dropping events would
|
|
1295
|
+
* leave the rendered state inconsistent with the runner's truth.
|
|
1296
|
+
* If memory pressure becomes a concern, swap in `PubSub.sliding`
|
|
1297
|
+
* with a tuned capacity at the call site.
|
|
1298
|
+
*
|
|
1299
|
+
* @public
|
|
1300
|
+
*/
|
|
1301
|
+
declare const RunEventChannelLive: Layer.Layer<RunEventChannel>;
|
|
1302
|
+
//#endregion
|
|
1303
|
+
//#region src/pubsub/Publisher.d.ts
|
|
1304
|
+
/**
|
|
1305
|
+
* Emit one event onto the channel.
|
|
1306
|
+
*
|
|
1307
|
+
* Resolves when the event is enqueued. Returns the success boolean
|
|
1308
|
+
* from `PubSub.publish` so callers can detect a shutdown
|
|
1309
|
+
* channel if needed; in normal operation the result is always `true`.
|
|
1310
|
+
*
|
|
1311
|
+
* @param event - the run event to publish
|
|
1312
|
+
* @returns an Effect that resolves to the publish success boolean
|
|
1313
|
+
* @public
|
|
1314
|
+
*/
|
|
1315
|
+
declare const publish: (event: RunEvent) => Effect.Effect<boolean, never, RunEventChannel>;
|
|
1316
|
+
/**
|
|
1317
|
+
* Emit a batch of events onto the channel in order.
|
|
1318
|
+
*
|
|
1319
|
+
* Useful for the CLI replay path where the entire event sequence is
|
|
1320
|
+
* materialized synchronously from a database query before any
|
|
1321
|
+
* subscriber needs to read it.
|
|
1322
|
+
*
|
|
1323
|
+
* @param events - iterable of run events to publish in order
|
|
1324
|
+
* @returns an Effect that resolves when all events are enqueued
|
|
1325
|
+
* @public
|
|
1326
|
+
*/
|
|
1327
|
+
declare const publishAll: (events: Iterable<RunEvent>) => Effect.Effect<void, never, RunEventChannel>;
|
|
1328
|
+
//#endregion
|
|
1329
|
+
//#region src/pubsub/Subscriber.d.ts
|
|
1330
|
+
/**
|
|
1331
|
+
* Subscribe, fold the run-event stream into a terminal
|
|
1332
|
+
* `RenderState`, and return when `RunFinished` arrives.
|
|
1333
|
+
*
|
|
1334
|
+
* The subscription is scoped — when this effect completes (or is
|
|
1335
|
+
* interrupted), the underlying PubSub releases its slot.
|
|
1336
|
+
*
|
|
1337
|
+
* @param initial - the initial render state to fold from
|
|
1338
|
+
* @returns an Effect that resolves to the terminal render state
|
|
1339
|
+
* @public
|
|
1340
|
+
*/
|
|
1341
|
+
declare const accumulateUntilFinished: (initial?: RenderState) => Effect.Effect<RenderState, never, RunEventChannel>;
|
|
1342
|
+
/**
|
|
1343
|
+
* Run a callback for every projected `RenderState` as events
|
|
1344
|
+
* arrive. The stream terminates when the PubSub shuts down (typically
|
|
1345
|
+
* when the surrounding scope closes).
|
|
1346
|
+
*
|
|
1347
|
+
* The host runs this in a forked fiber so the publisher and the
|
|
1348
|
+
* renderer can make progress concurrently. Returning an Effect from
|
|
1349
|
+
* the callback lets the host suspend further rendering on backpressure
|
|
1350
|
+
* (e.g. throttling redraws to the next animation frame).
|
|
1351
|
+
*
|
|
1352
|
+
* @param onState - callback invoked with each projected render state
|
|
1353
|
+
* @param initial - the initial render state to fold from
|
|
1354
|
+
* @returns an Effect that completes when the PubSub shuts down
|
|
1355
|
+
* @public
|
|
1356
|
+
*/
|
|
1357
|
+
declare const forEachRenderState: <R, E>(onState: (state: RenderState) => Effect.Effect<void, E, R>, initial?: RenderState) => Effect.Effect<void, E, R | RunEventChannel>;
|
|
1358
|
+
/**
|
|
1359
|
+
* Build an Effect `Stream` of accumulated states over the channel.
|
|
1360
|
+
*
|
|
1361
|
+
* Lower-level than {@link forEachRenderState} — useful when the host
|
|
1362
|
+
* wants to compose with other stream operators (debouncing, throttling,
|
|
1363
|
+
* tee-to-file) before running the terminal sink.
|
|
1364
|
+
*
|
|
1365
|
+
* @param initial - the initial render state to fold from
|
|
1366
|
+
* @returns an Effect that resolves to a Stream of render states
|
|
1367
|
+
* @public
|
|
1368
|
+
*/
|
|
1369
|
+
declare const renderStateStream: (initial?: RenderState) => Effect.Effect<Stream.Stream<RenderState>, never, RunEventChannel | Scope.Scope>;
|
|
1370
|
+
/**
|
|
1371
|
+
* Convenience: subscribe and produce a low-level dequeue of raw
|
|
1372
|
+
* `RunEvent` values. Mostly for tests and ad-hoc consumers; most
|
|
1373
|
+
* application code should prefer {@link forEachRenderState} or
|
|
1374
|
+
* {@link renderStateStream}.
|
|
1375
|
+
*
|
|
1376
|
+
* @returns an Effect that resolves to a dequeue of raw run events
|
|
1377
|
+
* @public
|
|
1378
|
+
*/
|
|
1379
|
+
declare const subscribeRaw: () => Effect.Effect<Queue.Dequeue<RunEvent>, never, RunEventChannel | Scope.Scope>;
|
|
1380
|
+
//#endregion
|
|
1381
|
+
//#region src/reducer.d.ts
|
|
1382
|
+
/**
|
|
1383
|
+
* Apply a single event to the previous state and return the next.
|
|
1384
|
+
*
|
|
1385
|
+
* The function is pure: no I/O, no time, no randomness. Folding it
|
|
1386
|
+
* over an event sequence yields the same state regardless of when the
|
|
1387
|
+
* fold runs.
|
|
1388
|
+
*
|
|
1389
|
+
* @param state - the current render state
|
|
1390
|
+
* @param event - the run event to apply
|
|
1391
|
+
* @returns the next render state
|
|
1392
|
+
* @public
|
|
1393
|
+
*/
|
|
1394
|
+
declare const reduceRenderState: (state: RenderState, event: RunEvent) => RenderState;
|
|
1395
|
+
/**
|
|
1396
|
+
* Fold a sequence of events into a final `RenderState`.
|
|
1397
|
+
*
|
|
1398
|
+
* Convenience for tests, replays, and the agent renderer's
|
|
1399
|
+
* accumulate-then-render-once path.
|
|
1400
|
+
*
|
|
1401
|
+
* @param events - the ordered event sequence to fold
|
|
1402
|
+
* @param seed - the initial render state (defaults to `initialRenderState`)
|
|
1403
|
+
* @returns the terminal render state after all events are applied
|
|
1404
|
+
* @public
|
|
1405
|
+
*/
|
|
1406
|
+
declare const reduceRenderStateAll: (events: ReadonlyArray<RunEvent>, seed?: RenderState) => RenderState;
|
|
1407
|
+
//#endregion
|
|
1408
|
+
//#region src/render-agent.d.ts
|
|
1409
|
+
/**
|
|
1410
|
+
* Options controlling agent-mode output. All fields optional; defaults
|
|
1411
|
+
* match the spec's "80-column, top-3 gaps, no error stack" target.
|
|
1412
|
+
*
|
|
1413
|
+
* @public
|
|
1414
|
+
*/
|
|
1415
|
+
interface RenderAgentOptions {
|
|
1416
|
+
/**
|
|
1417
|
+
* Target column width for soft-wrapping the longer detail lines.
|
|
1418
|
+
* The renderer does not enforce a hard wrap — short lines never
|
|
1419
|
+
* pad — but uses this when truncating diff or stack output.
|
|
1420
|
+
*
|
|
1421
|
+
* @defaultValue 80
|
|
1422
|
+
*/
|
|
1423
|
+
readonly width?: number;
|
|
1424
|
+
/**
|
|
1425
|
+
* How many coverage gaps to list (top by missing lines). Set to 0
|
|
1426
|
+
* to omit the gap block entirely; the violations block is
|
|
1427
|
+
* independent and always rendered when present.
|
|
1428
|
+
*
|
|
1429
|
+
* @defaultValue 3
|
|
1430
|
+
*/
|
|
1431
|
+
readonly maxCoverageGaps?: number;
|
|
1432
|
+
/**
|
|
1433
|
+
* Whether to include the full stack trace for each failure. The
|
|
1434
|
+
* agent path defaults to false because the structured failure data
|
|
1435
|
+
* is already available via MCP tools.
|
|
1436
|
+
*
|
|
1437
|
+
* @defaultValue false
|
|
1438
|
+
*/
|
|
1439
|
+
readonly includeStack?: boolean;
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* Project the reduced `RenderState` into a single string suitable
|
|
1443
|
+
* for emission once at the end of a run.
|
|
1444
|
+
*
|
|
1445
|
+
* The output is deterministic given a stable input — folding the same
|
|
1446
|
+
* event sequence twice and rendering produces byte-identical strings.
|
|
1447
|
+
*
|
|
1448
|
+
* @param state - the fully-reduced render state
|
|
1449
|
+
* @param options - optional output-shaping options
|
|
1450
|
+
* @returns the agent-format string
|
|
1451
|
+
* @public
|
|
1452
|
+
*/
|
|
1453
|
+
declare const renderAgent: (state: RenderState, options?: RenderAgentOptions) => string;
|
|
1454
|
+
//#endregion
|
|
1455
|
+
//#region src/render-ink/CountColumns.d.ts
|
|
1456
|
+
/**
|
|
1457
|
+
* Props for the `CountColumns` component.
|
|
1458
|
+
*
|
|
1459
|
+
* @public
|
|
1460
|
+
*/
|
|
1461
|
+
interface CountColumnsProps {
|
|
1462
|
+
/** Number of passing tests. */
|
|
1463
|
+
readonly passCount: number;
|
|
1464
|
+
/** Number of failing tests. */
|
|
1465
|
+
readonly failCount: number;
|
|
1466
|
+
/** Number of skipped tests. */
|
|
1467
|
+
readonly skipCount: number;
|
|
1468
|
+
/** Number of timed-out tests. */
|
|
1469
|
+
readonly timeoutCount: number;
|
|
1470
|
+
}
|
|
1471
|
+
/**
|
|
1472
|
+
* Renders four colored count columns (pass ✓, fail ✗, skip ↷, timeout ⧖)
|
|
1473
|
+
* for an aggregate row. Zeros are dimmed; all four columns always appear.
|
|
1474
|
+
*
|
|
1475
|
+
* @public
|
|
1476
|
+
*/
|
|
1477
|
+
declare const CountColumns: FC<CountColumnsProps>;
|
|
1478
|
+
//#endregion
|
|
1479
|
+
//#region src/render-ink/CoverageBlock.d.ts
|
|
1480
|
+
/**
|
|
1481
|
+
* Props for the `CoverageBlock` component.
|
|
1482
|
+
*
|
|
1483
|
+
* @public
|
|
1484
|
+
*/
|
|
1485
|
+
interface CoverageBlockProps {
|
|
1486
|
+
/** The coverage render state to display. */
|
|
1487
|
+
readonly coverage: CoverageRenderState;
|
|
1488
|
+
/** Maximum number of gap entries to list; defaults to 3. */
|
|
1489
|
+
readonly maxGaps?: number;
|
|
1490
|
+
}
|
|
1491
|
+
/**
|
|
1492
|
+
* Renders the coverage section: per-metric percentages, threshold
|
|
1493
|
+
* violations, and top-N gap entries sorted by missing line count.
|
|
1494
|
+
*
|
|
1495
|
+
* @public
|
|
1496
|
+
*/
|
|
1497
|
+
declare const CoverageBlock: FC<CoverageBlockProps>;
|
|
1498
|
+
//#endregion
|
|
1499
|
+
//#region src/render-ink/FailureSection.d.ts
|
|
1500
|
+
/**
|
|
1501
|
+
* Props for the `FailureSection` component.
|
|
1502
|
+
*
|
|
1503
|
+
* @public
|
|
1504
|
+
*/
|
|
1505
|
+
interface FailureSectionProps {
|
|
1506
|
+
/** The list of failure records to display. */
|
|
1507
|
+
readonly failures: ReadonlyArray<FailureRecord>;
|
|
1508
|
+
/** When `true`, renders the full stack trace under each failure. */
|
|
1509
|
+
readonly includeStack?: boolean;
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Renders one block per failed test: glyph, path, classification tag,
|
|
1513
|
+
* error message, diff lines, and optionally the stack trace.
|
|
1514
|
+
*
|
|
1515
|
+
* @public
|
|
1516
|
+
*/
|
|
1517
|
+
declare const FailureSection: FC<FailureSectionProps>;
|
|
1518
|
+
//#endregion
|
|
1519
|
+
//#region src/render-ink/FailuresSection.d.ts
|
|
1520
|
+
/**
|
|
1521
|
+
* Props for the `FailuresSection` component.
|
|
1522
|
+
*
|
|
1523
|
+
* @public
|
|
1524
|
+
*/
|
|
1525
|
+
interface FailuresSectionProps {
|
|
1526
|
+
/** The list of failure records to display. */
|
|
1527
|
+
readonly failures: ReadonlyArray<FailureRecord>;
|
|
1528
|
+
/** Maximum entries to list before collapsing the rest into an overflow line. */
|
|
1529
|
+
readonly limit: number;
|
|
1530
|
+
}
|
|
1531
|
+
/**
|
|
1532
|
+
* Renders the capped failures block for aggregate-row shapes.
|
|
1533
|
+
* Entries beyond `limit` collapse into an overflow line.
|
|
1534
|
+
*
|
|
1535
|
+
* @public
|
|
1536
|
+
*/
|
|
1537
|
+
declare const FailuresSection: FC<FailuresSectionProps>;
|
|
1538
|
+
//#endregion
|
|
1539
|
+
//#region src/render-ink/ModuleHeader.d.ts
|
|
1540
|
+
/**
|
|
1541
|
+
* Props for the `ModuleHeader` component.
|
|
1542
|
+
*
|
|
1543
|
+
* @public
|
|
1544
|
+
*/
|
|
1545
|
+
interface ModuleHeaderProps {
|
|
1546
|
+
/** The module record to display. */
|
|
1547
|
+
readonly module: ModuleRecord;
|
|
1548
|
+
}
|
|
1549
|
+
/**
|
|
1550
|
+
* Renders the per-module title line: a status glyph, the module path,
|
|
1551
|
+
* and a dimmed inline summary of pass/fail/skip counts and duration.
|
|
1552
|
+
*
|
|
1553
|
+
* @public
|
|
1554
|
+
*/
|
|
1555
|
+
declare const ModuleHeader: FC<ModuleHeaderProps>;
|
|
1556
|
+
//#endregion
|
|
1557
|
+
//#region src/render-ink/ProjectRow.d.ts
|
|
1558
|
+
/**
|
|
1559
|
+
* Props for the `ProjectRow` component.
|
|
1560
|
+
*
|
|
1561
|
+
* @public
|
|
1562
|
+
*/
|
|
1563
|
+
interface ProjectRowProps {
|
|
1564
|
+
/** The per-project rollup. */
|
|
1565
|
+
readonly project: ProjectSummary;
|
|
1566
|
+
/** Pass/fail/skip/timeout counts for the project. */
|
|
1567
|
+
readonly counts: {
|
|
1568
|
+
passCount: number;
|
|
1569
|
+
failCount: number;
|
|
1570
|
+
skipCount: number;
|
|
1571
|
+
timeoutCount: number;
|
|
1572
|
+
};
|
|
1573
|
+
/** True while the project still has a running or queued module. */
|
|
1574
|
+
readonly running: boolean;
|
|
1575
|
+
/**
|
|
1576
|
+
* True when the run has been timed out — running rows resolve to the
|
|
1577
|
+
* `⧖` glyph instead of continuing to animate the spinner.
|
|
1578
|
+
*/
|
|
1579
|
+
readonly timedOut?: boolean;
|
|
1580
|
+
/** Elapsed milliseconds — wall-clock while running, summed duration once finished. */
|
|
1581
|
+
readonly elapsedMs: number;
|
|
1582
|
+
/** Current spinner glyph; rendered in place of the status icon while running. */
|
|
1583
|
+
readonly frame: string;
|
|
1584
|
+
/** Name-column width so the count columns align across rows. */
|
|
1585
|
+
readonly nameWidth: number;
|
|
1586
|
+
/** Per-tag test counts for the project, merged across its modules. */
|
|
1587
|
+
readonly tagCounts?: Record<string, number>;
|
|
1588
|
+
}
|
|
1589
|
+
/**
|
|
1590
|
+
* Renders one per-project row in the `workspace`-shape live view: status
|
|
1591
|
+
* glyph (animated spinner while running), project name, count columns,
|
|
1592
|
+
* elapsed duration, and optional tag counts.
|
|
1593
|
+
*
|
|
1594
|
+
* @public
|
|
1595
|
+
*/
|
|
1596
|
+
declare const ProjectRow: FC<ProjectRowProps>;
|
|
1597
|
+
//#endregion
|
|
1598
|
+
//#region src/render-ink/StatusIcon.d.ts
|
|
1599
|
+
/**
|
|
1600
|
+
* The set of named statuses a `StatusIcon` can render.
|
|
1601
|
+
*
|
|
1602
|
+
* @public
|
|
1603
|
+
*/
|
|
1604
|
+
type StatusIconKind = "passed" | "failed" | "skipped" | "pending" | "running" | "queued" | "finished" | "threshold" | "timed-out";
|
|
1605
|
+
/**
|
|
1606
|
+
* Props for the `StatusIcon` component.
|
|
1607
|
+
*
|
|
1608
|
+
* @public
|
|
1609
|
+
*/
|
|
1610
|
+
interface StatusIconProps {
|
|
1611
|
+
/** The status to render as a colored glyph. */
|
|
1612
|
+
readonly status: StatusIconKind;
|
|
1613
|
+
}
|
|
1614
|
+
/**
|
|
1615
|
+
* Renders a single colored status glyph for a test, module, or run.
|
|
1616
|
+
*
|
|
1617
|
+
* @public
|
|
1618
|
+
*/
|
|
1619
|
+
declare const StatusIcon: FC<StatusIconProps>;
|
|
1620
|
+
//#endregion
|
|
1621
|
+
//#region src/render-ink/StreamApp.d.ts
|
|
1622
|
+
/**
|
|
1623
|
+
* Props for the `StreamApp` component.
|
|
1624
|
+
*
|
|
1625
|
+
* @public
|
|
1626
|
+
*/
|
|
1627
|
+
interface StreamAppProps {
|
|
1628
|
+
/** The current reduced render state to display. */
|
|
1629
|
+
readonly state: RenderState;
|
|
1630
|
+
/** Current spinner frame index, derived from wall-clock time. */
|
|
1631
|
+
readonly frameIndex: number;
|
|
1632
|
+
/** Current wall-clock time in milliseconds; defaults to `Date.now()`. */
|
|
1633
|
+
readonly nowMs?: number;
|
|
1634
|
+
}
|
|
1635
|
+
/**
|
|
1636
|
+
* Root Ink component for the `stream` live renderer. Classifies the run
|
|
1637
|
+
* shape and renders the appropriate per-shape live region.
|
|
1638
|
+
*
|
|
1639
|
+
* @public
|
|
1640
|
+
*/
|
|
1641
|
+
declare const StreamApp: FC<StreamAppProps>;
|
|
1642
|
+
//#endregion
|
|
1643
|
+
//#region src/render-ink/SuggestedActions.d.ts
|
|
1644
|
+
/**
|
|
1645
|
+
* Props for the `SuggestedActions` component.
|
|
1646
|
+
*
|
|
1647
|
+
* @public
|
|
1648
|
+
*/
|
|
1649
|
+
interface SuggestedActionsProps {
|
|
1650
|
+
/** The list of suggested actions to display. */
|
|
1651
|
+
readonly actions: ReadonlyArray<SuggestedActionRecord>;
|
|
1652
|
+
}
|
|
1653
|
+
/**
|
|
1654
|
+
* Renders the suggested-actions queue as severity-prefixed rows with
|
|
1655
|
+
* optional tool hints. Returns `null` when the actions list is empty.
|
|
1656
|
+
*
|
|
1657
|
+
* @public
|
|
1658
|
+
*/
|
|
1659
|
+
declare const SuggestedActions: FC<SuggestedActionsProps>;
|
|
1660
|
+
//#endregion
|
|
1661
|
+
//#region src/render-ink/spinner.d.ts
|
|
1662
|
+
/**
|
|
1663
|
+
* Hand-rolled Braille spinner for the `stream` live renderer.
|
|
1664
|
+
*
|
|
1665
|
+
* No `ink-spinner` dependency — that package is a thin wrapper over the
|
|
1666
|
+
* same ten Braille characters plus a timer. The `stream` renderer
|
|
1667
|
+
* already needs a frame clock for the ticking elapsed column, so the
|
|
1668
|
+
* timer is shared and only the frame array lives here.
|
|
1669
|
+
*
|
|
1670
|
+
* The frame index is presentation state: it is derived from wall-clock
|
|
1671
|
+
* time by `createLiveInk` and passed to `StreamApp` as a prop. It never
|
|
1672
|
+
* enters the event-sourced `RenderState`.
|
|
1673
|
+
*/
|
|
1674
|
+
/**
|
|
1675
|
+
* The ten Braille spinner frames, in animation order.
|
|
1676
|
+
*
|
|
1677
|
+
* @public
|
|
1678
|
+
*/
|
|
1679
|
+
declare const SPINNER_FRAMES: readonly ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
1680
|
+
/**
|
|
1681
|
+
* How long each spinner frame is held, in milliseconds.
|
|
1682
|
+
*
|
|
1683
|
+
* @public
|
|
1684
|
+
*/
|
|
1685
|
+
declare const SPINNER_FRAME_MS = 80;
|
|
1686
|
+
/**
|
|
1687
|
+
* Resolve the spinner glyph for a frame index. The index wraps modulo
|
|
1688
|
+
* the frame count and tolerates negative values, so a wall-clock-derived
|
|
1689
|
+
* index is always valid.
|
|
1690
|
+
*
|
|
1691
|
+
* @param index - the frame index (wraps modulo frame count)
|
|
1692
|
+
* @returns the Braille glyph for the given frame
|
|
1693
|
+
* @public
|
|
1694
|
+
*/
|
|
1695
|
+
declare const spinnerFrame: (index: number) => string;
|
|
1696
|
+
/**
|
|
1697
|
+
* Derive the spinner frame index from a wall-clock timestamp. Using the
|
|
1698
|
+
* clock — rather than a monotonic counter — keeps the animation correct
|
|
1699
|
+
* across watch-mode remounts with no extra closure state to reset.
|
|
1700
|
+
*
|
|
1701
|
+
* @param nowMs - current wall-clock time in milliseconds
|
|
1702
|
+
* @returns the frame index for the given timestamp
|
|
1703
|
+
* @public
|
|
1704
|
+
*/
|
|
1705
|
+
declare const spinnerFrameForTime: (nowMs: number) => number;
|
|
1706
|
+
//#endregion
|
|
1707
|
+
//#region src/render-ink/TestRow.d.ts
|
|
1708
|
+
/**
|
|
1709
|
+
* Props for the `TestRow` component.
|
|
1710
|
+
*
|
|
1711
|
+
* @public
|
|
1712
|
+
*/
|
|
1713
|
+
interface TestRowProps {
|
|
1714
|
+
/** The test record to display. */
|
|
1715
|
+
readonly test: TestRecord;
|
|
1716
|
+
/** Leading indentation in spaces; defaults to 2. */
|
|
1717
|
+
readonly indent?: number;
|
|
1718
|
+
}
|
|
1719
|
+
/**
|
|
1720
|
+
* Renders one test row: status glyph, optional suite prefix, test name, and duration.
|
|
1721
|
+
*
|
|
1722
|
+
* @public
|
|
1723
|
+
*/
|
|
1724
|
+
declare const TestRow: FC<TestRowProps>;
|
|
1725
|
+
//#endregion
|
|
1726
|
+
//#region src/render-ink/TrendLine.d.ts
|
|
1727
|
+
/**
|
|
1728
|
+
* Props for the `TrendLine` component.
|
|
1729
|
+
*
|
|
1730
|
+
* @public
|
|
1731
|
+
*/
|
|
1732
|
+
interface TrendLineProps {
|
|
1733
|
+
/** The trend summary to display. */
|
|
1734
|
+
readonly trend: {
|
|
1735
|
+
readonly direction: "improving" | "regressing" | "stable";
|
|
1736
|
+
readonly runCount: number;
|
|
1737
|
+
};
|
|
1738
|
+
}
|
|
1739
|
+
/**
|
|
1740
|
+
* Renders the one-line trend signal: direction (colored) and run count.
|
|
1741
|
+
*
|
|
1742
|
+
* @public
|
|
1743
|
+
*/
|
|
1744
|
+
declare const TrendLine: FC<TrendLineProps>;
|
|
1745
|
+
//#endregion
|
|
1746
|
+
//#region src/synthesize.d.ts
|
|
1747
|
+
/**
|
|
1748
|
+
* Optional metadata threaded through the synthesized event stream.
|
|
1749
|
+
*
|
|
1750
|
+
* @public
|
|
1751
|
+
*/
|
|
1752
|
+
interface SynthesizeOptions {
|
|
1753
|
+
readonly runId?: string;
|
|
1754
|
+
readonly configHash?: string;
|
|
1755
|
+
readonly startedAt?: string;
|
|
1756
|
+
readonly finishedAt?: string;
|
|
1757
|
+
readonly classifications?: ReadonlyMap<string, TestClassification>;
|
|
1758
|
+
readonly coverage?: SynthesizedCoverage;
|
|
1759
|
+
readonly suggestedActions?: ReadonlyArray<{
|
|
1760
|
+
readonly severity: ActionSeverity;
|
|
1761
|
+
readonly title: string;
|
|
1762
|
+
readonly detail: string;
|
|
1763
|
+
readonly targetTool?: string;
|
|
1764
|
+
}>;
|
|
1765
|
+
}
|
|
1766
|
+
/**
|
|
1767
|
+
* Coverage data to thread into the synthesized event stream.
|
|
1768
|
+
*
|
|
1769
|
+
* @public
|
|
1770
|
+
*/
|
|
1771
|
+
interface SynthesizedCoverage {
|
|
1772
|
+
/** Aggregated coverage totals for each metric. */
|
|
1773
|
+
readonly metrics: CoverageTotals;
|
|
1774
|
+
/** The configured threshold values for each metric. */
|
|
1775
|
+
readonly thresholds: MetricThresholds;
|
|
1776
|
+
/** Per-file coverage gaps (files below threshold). */
|
|
1777
|
+
readonly gaps: ReadonlyArray<CoverageGap>;
|
|
1778
|
+
/** Threshold violations to emit as `ThresholdViolation` events. */
|
|
1779
|
+
readonly violations?: ReadonlyArray<{
|
|
1780
|
+
readonly metric: CoverageMetric;
|
|
1781
|
+
readonly expected: number;
|
|
1782
|
+
readonly actual: number;
|
|
1783
|
+
}>;
|
|
1784
|
+
}
|
|
1785
|
+
/**
|
|
1786
|
+
* Project a fully-completed Vitest run into the canonical
|
|
1787
|
+
* `RunEvent` stream. The output is deterministic given a
|
|
1788
|
+
* stable input.
|
|
1789
|
+
*
|
|
1790
|
+
* @param modules - the array of completed Vitest test modules
|
|
1791
|
+
* @param options - optional metadata to thread into the event stream
|
|
1792
|
+
* @returns an ordered array of run events
|
|
1793
|
+
* @public
|
|
1794
|
+
*/
|
|
1795
|
+
declare const synthesizeRunEvents: (modules: ReadonlyArray<VitestTestModule>, options?: SynthesizeOptions) => RunEvent[];
|
|
1796
|
+
/**
|
|
1797
|
+
* Options for {@link synthesizeFromAgentReport}.
|
|
1798
|
+
*
|
|
1799
|
+
* @public
|
|
1800
|
+
*/
|
|
1801
|
+
interface SynthesizeFromAgentReportOptions {
|
|
1802
|
+
/** Override runId; defaults to `report.timestamp`. */
|
|
1803
|
+
readonly runId?: string;
|
|
1804
|
+
/** Override startedAt; defaults to `report.timestamp`. */
|
|
1805
|
+
readonly startedAt?: string;
|
|
1806
|
+
/** Override finishedAt; defaults to `report.timestamp`. */
|
|
1807
|
+
readonly finishedAt?: string;
|
|
1808
|
+
/** configHash placeholder; AgentReport does not carry one. */
|
|
1809
|
+
readonly configHash?: string;
|
|
1810
|
+
/** Optional suggested actions appended before RunFinished. */
|
|
1811
|
+
readonly suggestedActions?: SynthesizeOptions["suggestedActions"];
|
|
1812
|
+
}
|
|
1813
|
+
/**
|
|
1814
|
+
* Bridge a persisted `AgentReport` into a `RunEvent` stream.
|
|
1815
|
+
*
|
|
1816
|
+
* `AgentReport` stores only failed modules in detail; passed-only modules
|
|
1817
|
+
* are summarized via `summary.passed` without per-module breakdown. The
|
|
1818
|
+
* synthesized stream reflects this — it emits per-test events for the
|
|
1819
|
+
* failed modules and lets `RunFinished` carry the authoritative totals.
|
|
1820
|
+
* Renderers see "N passed, M failed" in the header while the Modules
|
|
1821
|
+
* section enumerates only the failing modules.
|
|
1822
|
+
*
|
|
1823
|
+
* @param report - the persisted agent report to synthesize from
|
|
1824
|
+
* @param options - optional overrides for run metadata
|
|
1825
|
+
* @returns an ordered array of run events
|
|
1826
|
+
* @public
|
|
1827
|
+
*/
|
|
1828
|
+
declare const synthesizeFromAgentReport: (report: AgentReport, options?: SynthesizeFromAgentReportOptions) => RunEvent[];
|
|
1829
|
+
//#endregion
|
|
1830
|
+
//#region src/index.d.ts
|
|
1831
|
+
/**
|
|
1832
|
+
* The version of this package, inlined at build time from
|
|
1833
|
+
* `package.json#version` via rslib-builder's `__PACKAGE_VERSION__`
|
|
1834
|
+
* substitution. The UI package is consumed through the plugin so it does not
|
|
1835
|
+
* run its own init-time drift check, but the constant is exported so the
|
|
1836
|
+
* plugin can compare against it.
|
|
1837
|
+
*
|
|
1838
|
+
* @public
|
|
1839
|
+
*/
|
|
1840
|
+
declare const CURRENT_UI_VERSION: string;
|
|
1841
|
+
//#endregion
|
|
1842
|
+
export { ActionSeverity, type AgentCellFn, type AgentReport, CURRENT_UI_VERSION, type Cell, type CellOptions, CountColumns, type CountColumnsProps, CoverageBlock, type CoverageBlockProps, FileCoverageReport as CoverageFile, CoverageGap, CoverageMetric, CoverageRenderState, type CoverageTotals, type DispatchInputs, FailureRecord, FailureSection, type FailureSectionProps, FailuresSection, type FailuresSectionProps, type InkCellFn, type MetricThresholds, ModuleHeader, type ModuleHeaderProps, ModuleRecord, ProjectRow, type ProjectRowProps, type ProjectSummary, type RenderAgentOptions, RenderState, RenderTotals, RunEvent, type RunEventByTag, RunEventChannel, RunEventChannelLive, type RunOutcome, type RunShape, SPINNER_FRAMES, SPINNER_FRAME_MS, StatusIcon, type StatusIconKind, type StatusIconProps, StreamApp, type StreamAppProps, SuggestedActionRecord, SuggestedActions, type SuggestedActionsProps, type SynthesizeFromAgentReportOptions, type SynthesizeOptions, type SynthesizedCoverage, type TestClassification, TestRecord, TestRow, type TestRowProps, TrendLine, type TrendLineProps, type TrendSummary, type VitestModuleDiagnostic, type VitestModuleError, type VitestParsedStack, type VitestTestCase, type VitestTestDiagnostic, type VitestTestError, type VitestTestModule, type VitestTestResult, type VitestTestSuite, accumulateUntilFinished, buildFooter, classifyOutcome, classifyRunShape, dispatch, dispatchInk, dispatcherTable, dominantClassification, forEachRenderState, formatDisplayDuration, initialRenderState, publish, publishAll, reduceRenderState, reduceRenderStateAll, renderAgent, renderStateStream, spinnerFrame, spinnerFrameForTime, subscribeRaw, synthesizeFromAgentReport, synthesizeRunEvents };
|
|
1843
|
+
//# sourceMappingURL=index.d.ts.map
|