@vitest-agent/ui 4.0.1 → 5.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/README.md +3 -3
- package/dispatcher/cells/single-file-fail.js +1 -5
- package/dispatcher/cells/single-file-pass.js +1 -5
- package/dispatcher/cells/single-file-threshold.js +3 -8
- package/dispatcher/cells/single-project-fail.js +1 -5
- package/dispatcher/cells/single-project-pass.js +1 -5
- package/dispatcher/cells/single-project-threshold.js +4 -8
- package/dispatcher/cells/single-test-fail.js +1 -5
- package/dispatcher/cells/single-test-pass.js +1 -5
- package/dispatcher/cells/workspace-fail.js +1 -5
- package/dispatcher/cells/workspace-pass.js +1 -5
- package/dispatcher/cells/workspace-threshold.js +4 -8
- package/dispatcher/classify.js +6 -1
- package/dispatcher/dispatch.js +20 -25
- package/dispatcher/helpers.js +52 -3
- package/index.d.ts +148 -316
- package/index.js +5 -18
- package/{render-ink → ink}/CountColumns.js +2 -2
- package/{render-ink → ink}/CoverageBlock.js +2 -2
- package/{render-ink → ink}/FailureSection.js +2 -2
- package/{render-ink → ink}/FailuresSection.js +2 -2
- package/{render-ink → ink}/ModuleHeader.js +1 -1
- package/{render-ink → ink}/ProjectRow.js +1 -1
- package/{render-ink → ink}/StatusIcon.js +2 -2
- package/{render-ink → ink}/StreamApp.js +14 -5
- package/{render-ink → ink}/SuggestedActions.js +2 -2
- package/{render-ink → ink}/TagColumns.js +1 -1
- package/{render-ink → ink}/TestRow.js +1 -1
- package/{render-ink → ink}/TrendLine.js +2 -2
- package/ink/dispatch-ink.js +61 -0
- package/{dispatcher → ink}/ink-helpers.js +1 -1
- package/ink.d.ts +789 -0
- package/ink.js +15 -0
- package/package.json +12 -7
- package/reducer.js +4 -2
- package/render-agent.js +4 -1
- package/{render-ink/spinner.js → spinner.js} +1 -1
- package/synthesize.js +22 -7
- package/render-ink/index.js +0 -15
package/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { FC, ReactElement } from "react";
|
|
3
2
|
import { CoreStatusName, GlyphSet, Status, Style, TokenName } from "@effected/cli";
|
|
4
3
|
//#region ../sdk/dist/dev/pkg/index.d.ts
|
|
5
4
|
//#region src/schemas/Coverage.d.ts
|
|
@@ -31,6 +30,35 @@ declare const FileCoverageReport: Schema.Struct<{
|
|
|
31
30
|
}>;
|
|
32
31
|
/** @public */
|
|
33
32
|
type FileCoverageReport = typeof FileCoverageReport.Type;
|
|
33
|
+
/**
|
|
34
|
+
* A threshold glob whose AGGREGATE coverage (summed covered/total across
|
|
35
|
+
* every file the glob matches, the same way Vitest evaluates a glob
|
|
36
|
+
* threshold) is below at least one of the glob's metric numbers.
|
|
37
|
+
*
|
|
38
|
+
* This is independent of the per-file lists: with an object `perFile` every
|
|
39
|
+
* matched file can pass while the glob as a whole still fails.
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
declare const GlobShortfall: Schema.Struct<{
|
|
43
|
+
/** The threshold glob pattern as configured. */
|
|
44
|
+
readonly pattern: Schema.String;
|
|
45
|
+
/** Aggregate coverage percentages over the files the glob matches. */
|
|
46
|
+
readonly summary: Schema.Struct<{
|
|
47
|
+
readonly statements: Schema.Number;
|
|
48
|
+
readonly branches: Schema.Number;
|
|
49
|
+
readonly functions: Schema.Number;
|
|
50
|
+
readonly lines: Schema.Number;
|
|
51
|
+
}>;
|
|
52
|
+
/** The glob's own metric numbers that were set (`perFile` excluded). */
|
|
53
|
+
readonly thresholds: Schema.Struct<{
|
|
54
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
55
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
56
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
57
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
58
|
+
}>;
|
|
59
|
+
}>;
|
|
60
|
+
/** @public */
|
|
61
|
+
type GlobShortfall = typeof GlobShortfall.Type;
|
|
34
62
|
//#endregion
|
|
35
63
|
//#region src/schemas/RenderState.d.ts
|
|
36
64
|
/**
|
|
@@ -153,6 +181,21 @@ export declare const CoverageRenderState: Schema.Struct<{
|
|
|
153
181
|
readonly scoped: Schema.optional<Schema.Boolean>;
|
|
154
182
|
readonly scopedFiles: Schema.optional<Schema.Number>;
|
|
155
183
|
readonly totalFiles: Schema.optional<Schema.Number>;
|
|
184
|
+
readonly globShortfalls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
185
|
+
readonly pattern: Schema.String;
|
|
186
|
+
readonly summary: Schema.Struct<{
|
|
187
|
+
readonly statements: Schema.Number;
|
|
188
|
+
readonly branches: Schema.Number;
|
|
189
|
+
readonly functions: Schema.Number;
|
|
190
|
+
readonly lines: Schema.Number;
|
|
191
|
+
}>;
|
|
192
|
+
readonly thresholds: Schema.Struct<{
|
|
193
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
194
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
195
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
196
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
197
|
+
}>;
|
|
198
|
+
}>>>;
|
|
156
199
|
}>;
|
|
157
200
|
/** @public */
|
|
158
201
|
export type CoverageRenderState = typeof CoverageRenderState.Type;
|
|
@@ -274,6 +317,21 @@ export declare const RenderState: Schema.Struct<{
|
|
|
274
317
|
readonly scoped: Schema.optional<Schema.Boolean>;
|
|
275
318
|
readonly scopedFiles: Schema.optional<Schema.Number>;
|
|
276
319
|
readonly totalFiles: Schema.optional<Schema.Number>;
|
|
320
|
+
readonly globShortfalls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
321
|
+
readonly pattern: Schema.String;
|
|
322
|
+
readonly summary: Schema.Struct<{
|
|
323
|
+
readonly statements: Schema.Number;
|
|
324
|
+
readonly branches: Schema.Number;
|
|
325
|
+
readonly functions: Schema.Number;
|
|
326
|
+
readonly lines: Schema.Number;
|
|
327
|
+
}>;
|
|
328
|
+
readonly thresholds: Schema.Struct<{
|
|
329
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
330
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
331
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
332
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
333
|
+
}>;
|
|
334
|
+
}>>>;
|
|
277
335
|
}>>;
|
|
278
336
|
readonly trend: Schema.NullOr<Schema.Struct<{
|
|
279
337
|
readonly direction: Schema.Literals<readonly ["improving", "regressing", "stable"]>;
|
|
@@ -322,6 +380,21 @@ export declare const RenderState: Schema.Struct<{
|
|
|
322
380
|
readonly expected: Schema.optional<Schema.String>;
|
|
323
381
|
readonly received: Schema.optional<Schema.String>;
|
|
324
382
|
}>>;
|
|
383
|
+
/**
|
|
384
|
+
* What the run wrote straight to the terminal, past Vitest's console
|
|
385
|
+
* capture, folded from `RunFinished.strayOutput`. Absent when the run
|
|
386
|
+
* wrote nothing stray.
|
|
387
|
+
*/
|
|
388
|
+
readonly strayOutput: Schema.optional<Schema.Struct<{
|
|
389
|
+
readonly total: Schema.Number;
|
|
390
|
+
readonly stdout: Schema.Number;
|
|
391
|
+
readonly stderr: Schema.Number;
|
|
392
|
+
readonly bytes: Schema.Number;
|
|
393
|
+
readonly samples: Schema.$Array<Schema.Struct<{
|
|
394
|
+
readonly stream: Schema.Literals<readonly ["stdout", "stderr"]>;
|
|
395
|
+
readonly text: Schema.String;
|
|
396
|
+
}>>;
|
|
397
|
+
}>>;
|
|
325
398
|
}>;
|
|
326
399
|
/** @public */
|
|
327
400
|
export type RenderState = typeof RenderState.Type;
|
|
@@ -606,6 +679,21 @@ declare const AgentReport: Schema.Struct<{
|
|
|
606
679
|
readonly uncoveredLines: Schema.String;
|
|
607
680
|
}>>>;
|
|
608
681
|
readonly belowTargetFiles: Schema.optional<Schema.$Array<Schema.String>>;
|
|
682
|
+
readonly globShortfalls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
683
|
+
readonly pattern: Schema.String;
|
|
684
|
+
readonly summary: Schema.Struct<{
|
|
685
|
+
readonly statements: Schema.Number;
|
|
686
|
+
readonly branches: Schema.Number;
|
|
687
|
+
readonly functions: Schema.Number;
|
|
688
|
+
readonly lines: Schema.Number;
|
|
689
|
+
}>;
|
|
690
|
+
readonly thresholds: Schema.Struct<{
|
|
691
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
692
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
693
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
694
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
695
|
+
}>;
|
|
696
|
+
}>>>;
|
|
609
697
|
}>>;
|
|
610
698
|
readonly tagCounts: Schema.optional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
611
699
|
readonly passed: Schema.optional<Schema.Number>;
|
|
@@ -627,6 +715,16 @@ declare const AgentReport: Schema.Struct<{
|
|
|
627
715
|
readonly files: Schema.Number;
|
|
628
716
|
}>>;
|
|
629
717
|
}>>;
|
|
718
|
+
readonly strayOutput: Schema.optional<Schema.Struct<{
|
|
719
|
+
readonly total: Schema.Number;
|
|
720
|
+
readonly stdout: Schema.Number;
|
|
721
|
+
readonly stderr: Schema.Number;
|
|
722
|
+
readonly bytes: Schema.Number;
|
|
723
|
+
readonly samples: Schema.$Array<Schema.Struct<{
|
|
724
|
+
readonly stream: Schema.Literals<readonly ["stdout", "stderr"]>;
|
|
725
|
+
readonly text: Schema.String;
|
|
726
|
+
}>>;
|
|
727
|
+
}>>;
|
|
630
728
|
}>;
|
|
631
729
|
/** @public */
|
|
632
730
|
type AgentReport = typeof AgentReport.Type;
|
|
@@ -825,6 +923,21 @@ export declare const RunEvent: Schema.Union<readonly [Schema.TaggedStruct<"RunSt
|
|
|
825
923
|
readonly scoped: Schema.optional<Schema.Boolean>;
|
|
826
924
|
readonly scopedFiles: Schema.optional<Schema.Number>;
|
|
827
925
|
readonly totalFiles: Schema.optional<Schema.Number>;
|
|
926
|
+
readonly globShortfalls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
927
|
+
readonly pattern: Schema.String;
|
|
928
|
+
readonly summary: Schema.Struct<{
|
|
929
|
+
readonly statements: Schema.Number;
|
|
930
|
+
readonly branches: Schema.Number;
|
|
931
|
+
readonly functions: Schema.Number;
|
|
932
|
+
readonly lines: Schema.Number;
|
|
933
|
+
}>;
|
|
934
|
+
readonly thresholds: Schema.Struct<{
|
|
935
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
936
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
937
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
938
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
939
|
+
}>;
|
|
940
|
+
}>>>;
|
|
828
941
|
}>, Schema.TaggedStruct<"ThresholdViolation", {
|
|
829
942
|
readonly metric: Schema.Literals<readonly ["lines", "branches", "functions", "statements"]>;
|
|
830
943
|
readonly expected: Schema.Number;
|
|
@@ -867,6 +980,21 @@ export declare const RunEvent: Schema.Union<readonly [Schema.TaggedStruct<"RunSt
|
|
|
867
980
|
readonly expected: Schema.optional<Schema.String>;
|
|
868
981
|
readonly received: Schema.optional<Schema.String>;
|
|
869
982
|
}>>>;
|
|
983
|
+
/**
|
|
984
|
+
* What the run wrote straight to the terminal, past Vitest's console
|
|
985
|
+
* capture (`AgentReport.strayOutput`). Optional: absent when the run
|
|
986
|
+
* wrote nothing stray, and in older replay data.
|
|
987
|
+
*/
|
|
988
|
+
readonly strayOutput: Schema.optional<Schema.Struct<{
|
|
989
|
+
readonly total: Schema.Number;
|
|
990
|
+
readonly stdout: Schema.Number;
|
|
991
|
+
readonly stderr: Schema.Number;
|
|
992
|
+
readonly bytes: Schema.Number;
|
|
993
|
+
readonly samples: Schema.$Array<Schema.Struct<{
|
|
994
|
+
readonly stream: Schema.Literals<readonly ["stdout", "stderr"]>;
|
|
995
|
+
readonly text: Schema.String;
|
|
996
|
+
}>>;
|
|
997
|
+
}>>;
|
|
870
998
|
}>]>;
|
|
871
999
|
/** @public */
|
|
872
1000
|
export type RunEvent = typeof RunEvent.Type;
|
|
@@ -1046,23 +1174,15 @@ interface VitestTestModule {
|
|
|
1046
1174
|
*/
|
|
1047
1175
|
type AgentCellFn = (inputs: DispatchInputs, opts: CellOptions) => string;
|
|
1048
1176
|
/**
|
|
1049
|
-
*
|
|
1050
|
-
*
|
|
1051
|
-
*
|
|
1052
|
-
* @public
|
|
1053
|
-
*/
|
|
1054
|
-
type InkCellFn = (inputs: DispatchInputs, opts: CellOptions) => ReactElement;
|
|
1055
|
-
/**
|
|
1056
|
-
* One entry in the dispatcher matrix: an agent-string renderer and an
|
|
1057
|
-
* optional Ink-tree renderer for the same `(RunShape, RunOutcome)` pair.
|
|
1177
|
+
* One entry in the dispatcher matrix: the agent-string renderer for a
|
|
1178
|
+
* `(RunShape, RunOutcome)` pair. The Ink half of the same pair is the
|
|
1179
|
+
* matching entry of `inkDispatcherTable` in `@vitest-agent/ui/ink`.
|
|
1058
1180
|
*
|
|
1059
1181
|
* @public
|
|
1060
1182
|
*/
|
|
1061
1183
|
interface Cell {
|
|
1062
1184
|
/** Agent-string half — always present. */
|
|
1063
1185
|
readonly agent: AgentCellFn;
|
|
1064
|
-
/** Ink-tree half — omitted for cells where agent output is sufficient. */
|
|
1065
|
-
readonly ink?: InkCellFn;
|
|
1066
1186
|
}
|
|
1067
1187
|
//#endregion
|
|
1068
1188
|
//#region src/dispatcher/classify.d.ts
|
|
@@ -1074,6 +1194,8 @@ interface Cell {
|
|
|
1074
1194
|
* UI rewrite spec §7 open question 1:
|
|
1075
1195
|
*
|
|
1076
1196
|
* 1. More than one project → `workspace`.
|
|
1197
|
+
* 1b. `collectedModules` greater than one → `single-project` (the reduced
|
|
1198
|
+
* `modules` map may hold only the failing modules of a larger run).
|
|
1077
1199
|
* 2. One module with exactly one test → `single-test`.
|
|
1078
1200
|
* 3. One module with more than one test → `single-file`.
|
|
1079
1201
|
* 4. Otherwise → `single-project`.
|
|
@@ -1125,18 +1247,6 @@ export declare const dispatcherTable: Readonly<Record<RunShape, Readonly<Record<
|
|
|
1125
1247
|
* @public
|
|
1126
1248
|
*/
|
|
1127
1249
|
export declare const dispatch: (inputs: DispatchInputs, opts: CellOptions) => string;
|
|
1128
|
-
/**
|
|
1129
|
-
* Dispatch to the cell that matches `(inputs.shape, inputs.outcome)`
|
|
1130
|
-
* and return its Ink-half React tree. Returns `null` when the matched
|
|
1131
|
-
* cell does not expose an `ink` half — callers should fall back to
|
|
1132
|
-
* the agent string in that case.
|
|
1133
|
-
*
|
|
1134
|
-
* @param inputs - the classified dispatch inputs
|
|
1135
|
-
* @param opts - cell rendering options
|
|
1136
|
-
* @returns the Ink React element, or `null` when the cell has no Ink half
|
|
1137
|
-
* @public
|
|
1138
|
-
*/
|
|
1139
|
-
export declare const dispatchInk: (inputs: DispatchInputs, opts: CellOptions) => ReactElement | null;
|
|
1140
1250
|
//#endregion
|
|
1141
1251
|
//#region src/dispatcher/footer.d.ts
|
|
1142
1252
|
/**
|
|
@@ -1267,229 +1377,7 @@ interface RenderAgentOptions {
|
|
|
1267
1377
|
*/
|
|
1268
1378
|
export declare const renderAgent: (state: RenderState, options?: RenderAgentOptions) => string;
|
|
1269
1379
|
//#endregion
|
|
1270
|
-
//#region src/
|
|
1271
|
-
/**
|
|
1272
|
-
* Props for the `CountColumns` component.
|
|
1273
|
-
*
|
|
1274
|
-
* @public
|
|
1275
|
-
*/
|
|
1276
|
-
interface CountColumnsProps {
|
|
1277
|
-
/** Number of passing tests. */
|
|
1278
|
-
readonly passCount: number;
|
|
1279
|
-
/** Number of failing tests. */
|
|
1280
|
-
readonly failCount: number;
|
|
1281
|
-
/** Number of skipped tests. */
|
|
1282
|
-
readonly skipCount: number;
|
|
1283
|
-
/** Number of timed-out tests. */
|
|
1284
|
-
readonly timeoutCount: number;
|
|
1285
|
-
}
|
|
1286
|
-
/**
|
|
1287
|
-
* Fixed width of the duration cell that follows the count columns on an
|
|
1288
|
-
* aggregate row — sized for the formatter's widest common output
|
|
1289
|
-
* (`59m 59s`). Longer values overflow their row rather than truncate.
|
|
1290
|
-
*
|
|
1291
|
-
* @public
|
|
1292
|
-
*/
|
|
1293
|
-
export declare const DURATION_CELL_WIDTH = 7;
|
|
1294
|
-
/**
|
|
1295
|
-
* Renders four colored count columns (pass ✓, fail ✗, skip ↷, timeout ⧖)
|
|
1296
|
-
* for an aggregate row. Counts render right-aligned in fixed 4-digit cells so
|
|
1297
|
-
* columns align across rows; counts of 10,000+ overflow their row without
|
|
1298
|
-
* truncation. Zeros are greyed; all four columns always appear. Glyphs and
|
|
1299
|
-
* colours come from `VitestAgentStatus` (skip is `muted`).
|
|
1300
|
-
*
|
|
1301
|
-
* @public
|
|
1302
|
-
*/
|
|
1303
|
-
export declare const CountColumns: FC<CountColumnsProps>;
|
|
1304
|
-
//#endregion
|
|
1305
|
-
//#region src/render-ink/CoverageBlock.d.ts
|
|
1306
|
-
/**
|
|
1307
|
-
* Props for the `CoverageBlock` component.
|
|
1308
|
-
*
|
|
1309
|
-
* @public
|
|
1310
|
-
*/
|
|
1311
|
-
interface CoverageBlockProps {
|
|
1312
|
-
/** The coverage render state to display. */
|
|
1313
|
-
readonly coverage: CoverageRenderState;
|
|
1314
|
-
/** Maximum number of gap entries to list; defaults to 3. */
|
|
1315
|
-
readonly maxGaps?: number;
|
|
1316
|
-
}
|
|
1317
|
-
/**
|
|
1318
|
-
* Renders the coverage section: per-metric percentages, threshold
|
|
1319
|
-
* violations, and top-N gap entries sorted by missing line count.
|
|
1320
|
-
*
|
|
1321
|
-
* @public
|
|
1322
|
-
*/
|
|
1323
|
-
export declare const CoverageBlock: FC<CoverageBlockProps>;
|
|
1324
|
-
//#endregion
|
|
1325
|
-
//#region src/render-ink/FailureSection.d.ts
|
|
1326
|
-
/**
|
|
1327
|
-
* Props for the `FailureSection` component.
|
|
1328
|
-
*
|
|
1329
|
-
* @public
|
|
1330
|
-
*/
|
|
1331
|
-
interface FailureSectionProps {
|
|
1332
|
-
/** The list of failure records to display. */
|
|
1333
|
-
readonly failures: ReadonlyArray<FailureRecord>;
|
|
1334
|
-
/** When `true`, renders the full stack trace under each failure. */
|
|
1335
|
-
readonly includeStack?: boolean;
|
|
1336
|
-
}
|
|
1337
|
-
/**
|
|
1338
|
-
* Renders one block per failed test: glyph, path, classification tag,
|
|
1339
|
-
* error message, diff lines, and optionally the stack trace.
|
|
1340
|
-
*
|
|
1341
|
-
* @public
|
|
1342
|
-
*/
|
|
1343
|
-
export declare const FailureSection: FC<FailureSectionProps>;
|
|
1344
|
-
//#endregion
|
|
1345
|
-
//#region src/render-ink/FailuresSection.d.ts
|
|
1346
|
-
/**
|
|
1347
|
-
* Props for the `FailuresSection` component.
|
|
1348
|
-
*
|
|
1349
|
-
* @public
|
|
1350
|
-
*/
|
|
1351
|
-
interface FailuresSectionProps {
|
|
1352
|
-
/** The list of failure records to display. */
|
|
1353
|
-
readonly failures: ReadonlyArray<FailureRecord>;
|
|
1354
|
-
/** Maximum entries to list before collapsing the rest into an overflow line. */
|
|
1355
|
-
readonly limit: number;
|
|
1356
|
-
}
|
|
1357
|
-
/**
|
|
1358
|
-
* Renders the capped failures block for aggregate-row shapes.
|
|
1359
|
-
* Entries beyond `limit` collapse into an overflow line.
|
|
1360
|
-
*
|
|
1361
|
-
* @public
|
|
1362
|
-
*/
|
|
1363
|
-
export declare const FailuresSection: FC<FailuresSectionProps>;
|
|
1364
|
-
//#endregion
|
|
1365
|
-
//#region src/render-ink/ModuleHeader.d.ts
|
|
1366
|
-
/**
|
|
1367
|
-
* Props for the `ModuleHeader` component.
|
|
1368
|
-
*
|
|
1369
|
-
* @public
|
|
1370
|
-
*/
|
|
1371
|
-
interface ModuleHeaderProps {
|
|
1372
|
-
/** The module record to display. */
|
|
1373
|
-
readonly module: ModuleRecord;
|
|
1374
|
-
}
|
|
1375
|
-
/**
|
|
1376
|
-
* Renders the per-module title line: a status glyph, the module path,
|
|
1377
|
-
* and a dimmed inline summary of pass/fail/skip counts and duration.
|
|
1378
|
-
*
|
|
1379
|
-
* @public
|
|
1380
|
-
*/
|
|
1381
|
-
export declare const ModuleHeader: FC<ModuleHeaderProps>;
|
|
1382
|
-
//#endregion
|
|
1383
|
-
//#region src/render-ink/ProjectRow.d.ts
|
|
1384
|
-
/**
|
|
1385
|
-
* Props for the `ProjectRow` component.
|
|
1386
|
-
*
|
|
1387
|
-
* @public
|
|
1388
|
-
*/
|
|
1389
|
-
interface ProjectRowProps {
|
|
1390
|
-
/** The per-project rollup. */
|
|
1391
|
-
readonly project: ProjectSummary;
|
|
1392
|
-
/** Pass/fail/skip/timeout counts for the project. */
|
|
1393
|
-
readonly counts: {
|
|
1394
|
-
passCount: number;
|
|
1395
|
-
failCount: number;
|
|
1396
|
-
skipCount: number;
|
|
1397
|
-
timeoutCount: number;
|
|
1398
|
-
};
|
|
1399
|
-
/** True while the project still has a running or queued module. */
|
|
1400
|
-
readonly running: boolean;
|
|
1401
|
-
/**
|
|
1402
|
-
* True when the run has been timed out — running rows resolve to the
|
|
1403
|
-
* `⧖` glyph instead of continuing to animate the spinner.
|
|
1404
|
-
*/
|
|
1405
|
-
readonly timedOut?: boolean;
|
|
1406
|
-
/** Elapsed milliseconds — wall-clock while running, summed duration once finished. */
|
|
1407
|
-
readonly elapsedMs: number;
|
|
1408
|
-
/** Current spinner glyph; rendered in place of the status icon while running. */
|
|
1409
|
-
readonly frame: string;
|
|
1410
|
-
/** Name-column width so the count columns align across rows. */
|
|
1411
|
-
readonly nameWidth: number;
|
|
1412
|
-
/** Per-tag test counts for the project, merged across its modules; feeds the TagColumns cells. */
|
|
1413
|
-
readonly tagCounts?: Record<string, number> | undefined;
|
|
1414
|
-
/**
|
|
1415
|
-
* The view-level tag union. Every row renders every tag in it so the
|
|
1416
|
-
* tag columns align; empty (the default) renders no tag cells.
|
|
1417
|
-
*/
|
|
1418
|
-
readonly tagUnion?: ReadonlyArray<string>;
|
|
1419
|
-
}
|
|
1420
|
-
/**
|
|
1421
|
-
* Renders one per-project row in the `workspace`-shape live view: status
|
|
1422
|
-
* glyph (animated spinner while running), project name, count columns,
|
|
1423
|
-
* elapsed duration, and optional tag counts.
|
|
1424
|
-
*
|
|
1425
|
-
* @public
|
|
1426
|
-
*/
|
|
1427
|
-
export declare const ProjectRow: FC<ProjectRowProps>;
|
|
1428
|
-
//#endregion
|
|
1429
|
-
//#region src/render-ink/StatusIcon.d.ts
|
|
1430
|
-
/**
|
|
1431
|
-
* The set of named statuses a `StatusIcon` can render.
|
|
1432
|
-
*
|
|
1433
|
-
* @public
|
|
1434
|
-
*/
|
|
1435
|
-
type StatusIconKind = "passed" | "failed" | "skipped" | "pending" | "running" | "queued" | "finished" | "threshold" | "timed-out";
|
|
1436
|
-
/**
|
|
1437
|
-
* Props for the `StatusIcon` component.
|
|
1438
|
-
*
|
|
1439
|
-
* @public
|
|
1440
|
-
*/
|
|
1441
|
-
interface StatusIconProps {
|
|
1442
|
-
/** The status to render as a colored glyph. */
|
|
1443
|
-
readonly status: StatusIconKind;
|
|
1444
|
-
}
|
|
1445
|
-
/**
|
|
1446
|
-
* Renders a single colored status glyph for a test, module, or run.
|
|
1447
|
-
*
|
|
1448
|
-
* @public
|
|
1449
|
-
*/
|
|
1450
|
-
export declare const StatusIcon: FC<StatusIconProps>;
|
|
1451
|
-
//#endregion
|
|
1452
|
-
//#region src/render-ink/StreamApp.d.ts
|
|
1453
|
-
/**
|
|
1454
|
-
* Props for the `StreamApp` component.
|
|
1455
|
-
*
|
|
1456
|
-
* @public
|
|
1457
|
-
*/
|
|
1458
|
-
interface StreamAppProps {
|
|
1459
|
-
/** The current reduced render state to display. */
|
|
1460
|
-
readonly state: RenderState;
|
|
1461
|
-
/** Current spinner frame index (the live view's `frame`: wall-clock ticks of `SPINNER_FRAME_MS`). */
|
|
1462
|
-
readonly frameIndex: number;
|
|
1463
|
-
/** Current wall-clock time in milliseconds; defaults to `Date.now()`. */
|
|
1464
|
-
readonly nowMs?: number;
|
|
1465
|
-
}
|
|
1466
|
-
/**
|
|
1467
|
-
* Root Ink component for the `stream` live renderer. Classifies the run
|
|
1468
|
-
* shape and renders the appropriate per-shape live region.
|
|
1469
|
-
*
|
|
1470
|
-
* @public
|
|
1471
|
-
*/
|
|
1472
|
-
export declare const StreamApp: FC<StreamAppProps>;
|
|
1473
|
-
//#endregion
|
|
1474
|
-
//#region src/render-ink/SuggestedActions.d.ts
|
|
1475
|
-
/**
|
|
1476
|
-
* Props for the `SuggestedActions` component.
|
|
1477
|
-
*
|
|
1478
|
-
* @public
|
|
1479
|
-
*/
|
|
1480
|
-
interface SuggestedActionsProps {
|
|
1481
|
-
/** The list of suggested actions to display. */
|
|
1482
|
-
readonly actions: ReadonlyArray<SuggestedActionRecord>;
|
|
1483
|
-
}
|
|
1484
|
-
/**
|
|
1485
|
-
* Renders the suggested-actions queue as severity-prefixed rows with
|
|
1486
|
-
* optional tool hints. Returns `null` when the actions list is empty.
|
|
1487
|
-
*
|
|
1488
|
-
* @public
|
|
1489
|
-
*/
|
|
1490
|
-
export declare const SuggestedActions: FC<SuggestedActionsProps>;
|
|
1491
|
-
//#endregion
|
|
1492
|
-
//#region src/render-ink/spinner.d.ts
|
|
1380
|
+
//#region src/spinner.d.ts
|
|
1493
1381
|
/**
|
|
1494
1382
|
* The Unicode spinner frames, in animation order (`Glyphs.unicode.spinner`).
|
|
1495
1383
|
*
|
|
@@ -1515,74 +1403,6 @@ export declare const SPINNER_FRAME_MS: number;
|
|
|
1515
1403
|
*/
|
|
1516
1404
|
export declare const spinnerFrame: (index: number, glyphs?: GlyphSet) => string;
|
|
1517
1405
|
//#endregion
|
|
1518
|
-
//#region src/render-ink/TagColumns.d.ts
|
|
1519
|
-
/**
|
|
1520
|
-
* Compute the view-level tag union: the alphabetically sorted set of tag
|
|
1521
|
-
* names across every row's tag counts. A union of a single tag carries no
|
|
1522
|
-
* signal (the whole view is one kind), so it collapses to empty and the
|
|
1523
|
-
* view renders no tag columns at all.
|
|
1524
|
-
*
|
|
1525
|
-
* @public
|
|
1526
|
-
*/
|
|
1527
|
-
export declare const tagUnion: (rows: ReadonlyArray<Record<string, number> | undefined>) => ReadonlyArray<string>;
|
|
1528
|
-
/**
|
|
1529
|
-
* Props for the `TagColumns` component.
|
|
1530
|
-
*
|
|
1531
|
-
* @public
|
|
1532
|
-
*/
|
|
1533
|
-
interface TagColumnsProps {
|
|
1534
|
-
/** The view-level tag union — every row renders every tag in it. */
|
|
1535
|
-
readonly tags: ReadonlyArray<string>;
|
|
1536
|
-
/** This row's per-tag test counts; tags absent here render a dimmed 0. */
|
|
1537
|
-
readonly counts?: Record<string, number> | undefined;
|
|
1538
|
-
}
|
|
1539
|
-
/**
|
|
1540
|
-
* Renders one row's fixed-width tag cells for the given tag union.
|
|
1541
|
-
* Renders nothing when the union is empty.
|
|
1542
|
-
*
|
|
1543
|
-
* @public
|
|
1544
|
-
*/
|
|
1545
|
-
export declare const TagColumns: FC<TagColumnsProps>;
|
|
1546
|
-
//#endregion
|
|
1547
|
-
//#region src/render-ink/TestRow.d.ts
|
|
1548
|
-
/**
|
|
1549
|
-
* Props for the `TestRow` component.
|
|
1550
|
-
*
|
|
1551
|
-
* @public
|
|
1552
|
-
*/
|
|
1553
|
-
interface TestRowProps {
|
|
1554
|
-
/** The test record to display. */
|
|
1555
|
-
readonly test: TestRecord;
|
|
1556
|
-
/** Leading indentation in spaces; defaults to 2. */
|
|
1557
|
-
readonly indent?: number;
|
|
1558
|
-
}
|
|
1559
|
-
/**
|
|
1560
|
-
* Renders one test row: status glyph, optional suite prefix, test name, and duration.
|
|
1561
|
-
*
|
|
1562
|
-
* @public
|
|
1563
|
-
*/
|
|
1564
|
-
export declare const TestRow: FC<TestRowProps>;
|
|
1565
|
-
//#endregion
|
|
1566
|
-
//#region src/render-ink/TrendLine.d.ts
|
|
1567
|
-
/**
|
|
1568
|
-
* Props for the `TrendLine` component.
|
|
1569
|
-
*
|
|
1570
|
-
* @public
|
|
1571
|
-
*/
|
|
1572
|
-
interface TrendLineProps {
|
|
1573
|
-
/** The trend summary to display. */
|
|
1574
|
-
readonly trend: {
|
|
1575
|
-
readonly direction: "improving" | "regressing" | "stable";
|
|
1576
|
-
readonly runCount: number;
|
|
1577
|
-
};
|
|
1578
|
-
}
|
|
1579
|
-
/**
|
|
1580
|
-
* Renders the one-line trend signal: direction (colored) and run count.
|
|
1581
|
-
*
|
|
1582
|
-
* @public
|
|
1583
|
-
*/
|
|
1584
|
-
export declare const TrendLine: FC<TrendLineProps>;
|
|
1585
|
-
//#endregion
|
|
1586
1406
|
//#region src/synthesize.d.ts
|
|
1587
1407
|
/**
|
|
1588
1408
|
* Synthetic test name used to surface a suite-level (collection/load)
|
|
@@ -1593,6 +1413,16 @@ export declare const TrendLine: FC<TrendLineProps>;
|
|
|
1593
1413
|
* @public
|
|
1594
1414
|
*/
|
|
1595
1415
|
export declare const SUITE_LOAD_FAILURE_LABEL = "test suite failed to load";
|
|
1416
|
+
/**
|
|
1417
|
+
* Synthetic test name for a suite-level failure in a module that loaded
|
|
1418
|
+
* and collected one or more test cases — a failing `beforeAll` or
|
|
1419
|
+
* `afterAll` hook, for example. The file imported fine, so
|
|
1420
|
+
* {@link SUITE_LOAD_FAILURE_LABEL} would mislead; this label is used
|
|
1421
|
+
* instead when the module has collected tests.
|
|
1422
|
+
*
|
|
1423
|
+
* @public
|
|
1424
|
+
*/
|
|
1425
|
+
export declare const SUITE_FAILURE_LABEL = "test suite failed";
|
|
1596
1426
|
/**
|
|
1597
1427
|
* Optional metadata threaded through the synthesized event stream.
|
|
1598
1428
|
*
|
|
@@ -1636,6 +1466,8 @@ interface SynthesizedCoverage {
|
|
|
1636
1466
|
readonly scopedFiles?: number;
|
|
1637
1467
|
/** Total test-file count for the project, when known. */
|
|
1638
1468
|
readonly totalFiles?: number;
|
|
1469
|
+
/** Threshold globs whose aggregate coverage is below their numbers (issue #391). */
|
|
1470
|
+
readonly globShortfalls?: ReadonlyArray<GlobShortfall>;
|
|
1639
1471
|
}
|
|
1640
1472
|
/**
|
|
1641
1473
|
* Project a fully-completed Vitest run into the canonical
|
|
@@ -1768,5 +1600,5 @@ export declare const statusInkStyle: (name: VitestAgentStatusName) => InkTextSty
|
|
|
1768
1600
|
*/
|
|
1769
1601
|
export declare const CURRENT_UI_VERSION: string;
|
|
1770
1602
|
//#endregion
|
|
1771
|
-
export { type AgentCellFn, type AgentReport, type Cell, type CellOptions,
|
|
1603
|
+
export { type AgentCellFn, type AgentReport, type Cell, type CellOptions, FileCoverageReport as CoverageFile, type CoverageTotals, type DispatchInputs, type GlobShortfall, type InkTextStyle, type MetricThresholds, type ProjectSummary, type RenderAgentOptions, type RunEventByTag, type RunOutcome, type RunShape, type SynthesizeFromAgentReportOptions, type SynthesizeOptions, type SynthesizedCoverage, type TestClassification, type TrendSummary, type VitestAgentStatusName, type VitestModuleDiagnostic, type VitestModuleError, type VitestParsedStack, type VitestTestCase, type VitestTestDiagnostic, type VitestTestError, type VitestTestModule, type VitestTestResult, type VitestTestSuite };
|
|
1772
1604
|
//# sourceMappingURL=index.d.ts.map
|
package/index.js
CHANGED
|
@@ -2,24 +2,11 @@ import { classifyOutcome, classifyRunShape } from "./dispatcher/classify.js";
|
|
|
2
2
|
import { buildFooter, dominantClassification } from "./dispatcher/footer.js";
|
|
3
3
|
import { VitestAgentStatus, VitestAgentTokens, inkStyle, statusGlyph, statusInkStyle } from "./theme.js";
|
|
4
4
|
import { formatDisplayDuration } from "./format-duration.js";
|
|
5
|
-
import { dispatch,
|
|
5
|
+
import { dispatch, dispatcherTable } from "./dispatcher/dispatch.js";
|
|
6
6
|
import { reduceRenderState, reduceRenderStateAll } from "./reducer.js";
|
|
7
7
|
import { renderAgent } from "./render-agent.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { FailureSection } from "./render-ink/FailureSection.js";
|
|
11
|
-
import { FailuresSection } from "./render-ink/FailuresSection.js";
|
|
12
|
-
import { StatusIcon } from "./render-ink/StatusIcon.js";
|
|
13
|
-
import { ModuleHeader } from "./render-ink/ModuleHeader.js";
|
|
14
|
-
import { TagColumns, tagUnion } from "./render-ink/TagColumns.js";
|
|
15
|
-
import { ProjectRow } from "./render-ink/ProjectRow.js";
|
|
16
|
-
import { SPINNER_FRAMES, SPINNER_FRAME_MS, spinnerFrame } from "./render-ink/spinner.js";
|
|
17
|
-
import { TestRow } from "./render-ink/TestRow.js";
|
|
18
|
-
import { TrendLine } from "./render-ink/TrendLine.js";
|
|
19
|
-
import { StreamApp } from "./render-ink/StreamApp.js";
|
|
20
|
-
import { SuggestedActions } from "./render-ink/SuggestedActions.js";
|
|
21
|
-
import "./render-ink/index.js";
|
|
22
|
-
import { SUITE_LOAD_FAILURE_LABEL, synthesizeFromAgentReport, synthesizeRunEvents } from "./synthesize.js";
|
|
8
|
+
import { SPINNER_FRAMES, SPINNER_FRAME_MS, spinnerFrame } from "./spinner.js";
|
|
9
|
+
import { SUITE_FAILURE_LABEL, SUITE_LOAD_FAILURE_LABEL, synthesizeFromAgentReport, synthesizeRunEvents } from "./synthesize.js";
|
|
23
10
|
import { ActionSeverity, CoverageFile, CoverageGap, CoverageMetric, CoverageRenderState, FailureRecord, ModuleRecord, RenderState, RenderTotals, RunEvent, SuggestedActionRecord, TestRecord, initialRenderState } from "@vitest-agent/sdk";
|
|
24
11
|
|
|
25
12
|
//#region src/index.ts
|
|
@@ -30,7 +17,7 @@ import { ActionSeverity, CoverageFile, CoverageGap, CoverageMetric, CoverageRend
|
|
|
30
17
|
*
|
|
31
18
|
* @public
|
|
32
19
|
*/
|
|
33
|
-
const CURRENT_UI_VERSION = "
|
|
20
|
+
const CURRENT_UI_VERSION = "5.0.0";
|
|
34
21
|
|
|
35
22
|
//#endregion
|
|
36
|
-
export { ActionSeverity, CURRENT_UI_VERSION,
|
|
23
|
+
export { ActionSeverity, CURRENT_UI_VERSION, CoverageFile, CoverageGap, CoverageMetric, CoverageRenderState, FailureRecord, ModuleRecord, RenderState, RenderTotals, RunEvent, SPINNER_FRAMES, SPINNER_FRAME_MS, SUITE_FAILURE_LABEL, SUITE_LOAD_FAILURE_LABEL, SuggestedActionRecord, TestRecord, VitestAgentStatus, VitestAgentTokens, buildFooter, classifyOutcome, classifyRunShape, dispatch, dispatcherTable, dominantClassification, formatDisplayDuration, initialRenderState, inkStyle, reduceRenderState, reduceRenderStateAll, renderAgent, spinnerFrame, statusGlyph, statusInkStyle, synthesizeFromAgentReport, synthesizeRunEvents };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { VitestAgentTokens, inkStyle, statusGlyph, statusInkStyle } from "../theme.js";
|
|
2
|
-
import { Text } from "ink";
|
|
3
2
|
import { useGlyphs } from "@effected/cli/ui";
|
|
3
|
+
import { Text } from "ink";
|
|
4
4
|
import { jsxs } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
|
-
//#region src/
|
|
6
|
+
//#region src/ink/CountColumns.tsx
|
|
7
7
|
/**
|
|
8
8
|
* Fixed width of the duration cell that follows the count columns on an
|
|
9
9
|
* aggregate row — sized for the formatter's widest common output
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { inkStyle } from "../theme.js";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
2
|
import { Fmt } from "@effected/cli";
|
|
3
|
+
import { Box, Text } from "ink";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
|
-
//#region src/
|
|
6
|
+
//#region src/ink/CoverageBlock.tsx
|
|
7
7
|
/**
|
|
8
8
|
* Coverage section: per-metric percentage, threshold violations, top-N gaps.
|
|
9
9
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { inkStyle, statusGlyph, statusInkStyle } from "../theme.js";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
2
|
import { useGlyphs } from "@effected/cli/ui";
|
|
3
|
+
import { Box, Text } from "ink";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
|
-
//#region src/
|
|
6
|
+
//#region src/ink/FailureSection.tsx
|
|
7
7
|
/**
|
|
8
8
|
* Failure list: one block per failed test with classification, message,
|
|
9
9
|
* diff, and optionally stack trace.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { VitestAgentTokens, inkStyle, statusGlyph, statusInkStyle } from "../theme.js";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
2
|
import { useGlyphs } from "@effected/cli/ui";
|
|
3
|
+
import { Box, Text } from "ink";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
|
-
//#region src/
|
|
6
|
+
//#region src/ink/FailuresSection.tsx
|
|
7
7
|
/**
|
|
8
8
|
* The capped failures block for aggregate-row shapes (workspace,
|
|
9
9
|
* single-project) — the rows there are projects or modules and cannot
|
|
@@ -3,7 +3,7 @@ import { StatusIcon } from "./StatusIcon.js";
|
|
|
3
3
|
import { Box, Text } from "ink";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
|
-
//#region src/
|
|
6
|
+
//#region src/ink/ModuleHeader.tsx
|
|
7
7
|
const moduleGlyph = (m) => {
|
|
8
8
|
if (m.status === "queued") return "queued";
|
|
9
9
|
if (m.status === "running") return "running";
|