@vitest-agent/sdk 7.1.0 → 9.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/errors/ProjectIdentityError.js +25 -1
- package/index.d.ts +701 -751
- package/index.js +8 -14
- package/package.json +1 -1
- package/schemas/5.0/run.json +113 -222
- package/schemas/AgentReport.js +12 -12
- package/schemas/Common.js +22 -1
- package/schemas/ConsoleLeaks.js +6 -5
- package/schemas/Coverage.js +6 -5
- package/schemas/RenderState.js +8 -1
- package/schemas/RunDiagnostics.js +61 -0
- package/schemas/RunEvent.js +8 -1
- package/schemas/RunReportFile.js +3 -1
- package/schemas/StrayOutput.js +5 -4
- package/schemas/Thresholds.js +5 -4
- package/tsdoc-metadata.json +1 -1
- package/utils/ansi.js +1 -35
- package/utils/console-leaks.js +27 -1
- package/utils/run-diagnostics-actions.js +58 -0
- package/utils/vitest-config-files.js +24 -0
- package/version.js +1 -1
- package/utils/compress-lines.js +0 -44
- package/utils/detect-pm.js +0 -57
- package/utils/format-console.js +0 -222
- package/utils/format-fatal-error.js +0 -46
- package/utils/format-gfm.js +0 -160
- package/utils/hyperlink.js +0 -10
- package/utils/normalize-workspace-key.js +0 -33
- package/utils/probe-host-metadata.js +0 -98
- package/utils/safe-filename.js +0 -33
package/index.d.ts
CHANGED
|
@@ -4,10 +4,10 @@ import { Option, PubSub, Schema } from "effect";
|
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
6
|
export declare const CoverageTotals: Schema.Struct<{
|
|
7
|
-
readonly statements: Schema.
|
|
8
|
-
readonly branches: Schema.
|
|
9
|
-
readonly functions: Schema.
|
|
10
|
-
readonly lines: Schema.
|
|
7
|
+
readonly statements: Schema.Finite;
|
|
8
|
+
readonly branches: Schema.Finite;
|
|
9
|
+
readonly functions: Schema.Finite;
|
|
10
|
+
readonly lines: Schema.Finite;
|
|
11
11
|
}>;
|
|
12
12
|
/** @public */
|
|
13
13
|
export type CoverageTotals = typeof CoverageTotals.Type;
|
|
@@ -18,10 +18,10 @@ export type CoverageTotals = typeof CoverageTotals.Type;
|
|
|
18
18
|
export declare const FileCoverageReport: Schema.Struct<{
|
|
19
19
|
readonly file: Schema.String;
|
|
20
20
|
readonly summary: Schema.Struct<{
|
|
21
|
-
readonly statements: Schema.
|
|
22
|
-
readonly branches: Schema.
|
|
23
|
-
readonly functions: Schema.
|
|
24
|
-
readonly lines: Schema.
|
|
21
|
+
readonly statements: Schema.Finite;
|
|
22
|
+
readonly branches: Schema.Finite;
|
|
23
|
+
readonly functions: Schema.Finite;
|
|
24
|
+
readonly lines: Schema.Finite;
|
|
25
25
|
}>;
|
|
26
26
|
readonly uncoveredLines: Schema.String;
|
|
27
27
|
}>;
|
|
@@ -41,17 +41,17 @@ export declare const GlobShortfall: Schema.Struct<{
|
|
|
41
41
|
readonly pattern: Schema.String;
|
|
42
42
|
/** Aggregate coverage percentages over the files the glob matches. */
|
|
43
43
|
readonly summary: Schema.Struct<{
|
|
44
|
-
readonly statements: Schema.
|
|
45
|
-
readonly branches: Schema.
|
|
46
|
-
readonly functions: Schema.
|
|
47
|
-
readonly lines: Schema.
|
|
44
|
+
readonly statements: Schema.Finite;
|
|
45
|
+
readonly branches: Schema.Finite;
|
|
46
|
+
readonly functions: Schema.Finite;
|
|
47
|
+
readonly lines: Schema.Finite;
|
|
48
48
|
}>;
|
|
49
49
|
/** The glob's own metric numbers that were set (`perFile` excluded). */
|
|
50
50
|
readonly thresholds: Schema.Struct<{
|
|
51
|
-
readonly lines: Schema.optional<Schema.
|
|
52
|
-
readonly functions: Schema.optional<Schema.
|
|
53
|
-
readonly branches: Schema.optional<Schema.
|
|
54
|
-
readonly statements: Schema.optional<Schema.
|
|
51
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
52
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
53
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
54
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
55
55
|
}>;
|
|
56
56
|
}>;
|
|
57
57
|
/** @public */
|
|
@@ -62,81 +62,81 @@ export type GlobShortfall = typeof GlobShortfall.Type;
|
|
|
62
62
|
*/
|
|
63
63
|
export declare const CoverageReport: Schema.Struct<{
|
|
64
64
|
readonly totals: Schema.Struct<{
|
|
65
|
-
readonly statements: Schema.
|
|
66
|
-
readonly branches: Schema.
|
|
67
|
-
readonly functions: Schema.
|
|
68
|
-
readonly lines: Schema.
|
|
65
|
+
readonly statements: Schema.Finite;
|
|
66
|
+
readonly branches: Schema.Finite;
|
|
67
|
+
readonly functions: Schema.Finite;
|
|
68
|
+
readonly lines: Schema.Finite;
|
|
69
69
|
}>;
|
|
70
70
|
readonly thresholds: Schema.Struct<{
|
|
71
71
|
readonly global: Schema.Struct<{
|
|
72
|
-
readonly lines: Schema.optional<Schema.
|
|
73
|
-
readonly functions: Schema.optional<Schema.
|
|
74
|
-
readonly branches: Schema.optional<Schema.
|
|
75
|
-
readonly statements: Schema.optional<Schema.
|
|
72
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
73
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
74
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
75
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
76
76
|
}>;
|
|
77
77
|
readonly patterns: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Struct<{
|
|
78
|
-
readonly lines: Schema.optional<Schema.
|
|
79
|
-
readonly functions: Schema.optional<Schema.
|
|
80
|
-
readonly branches: Schema.optional<Schema.
|
|
81
|
-
readonly statements: Schema.optional<Schema.
|
|
78
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
79
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
80
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
81
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
82
82
|
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
83
|
-
readonly lines: Schema.optional<Schema.
|
|
84
|
-
readonly functions: Schema.optional<Schema.
|
|
85
|
-
readonly branches: Schema.optional<Schema.
|
|
86
|
-
readonly statements: Schema.optional<Schema.
|
|
83
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
84
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
85
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
86
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
87
87
|
}>]>>;
|
|
88
88
|
}>]>>, never>;
|
|
89
89
|
}>;
|
|
90
90
|
readonly targets: Schema.optional<Schema.Struct<{
|
|
91
91
|
readonly global: Schema.Struct<{
|
|
92
|
-
readonly lines: Schema.optional<Schema.
|
|
93
|
-
readonly functions: Schema.optional<Schema.
|
|
94
|
-
readonly branches: Schema.optional<Schema.
|
|
95
|
-
readonly statements: Schema.optional<Schema.
|
|
92
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
93
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
94
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
95
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
96
96
|
}>;
|
|
97
97
|
readonly patterns: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Struct<{
|
|
98
|
-
readonly lines: Schema.optional<Schema.
|
|
99
|
-
readonly functions: Schema.optional<Schema.
|
|
100
|
-
readonly branches: Schema.optional<Schema.
|
|
101
|
-
readonly statements: Schema.optional<Schema.
|
|
98
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
99
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
100
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
101
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
102
102
|
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
103
|
-
readonly lines: Schema.optional<Schema.
|
|
104
|
-
readonly functions: Schema.optional<Schema.
|
|
105
|
-
readonly branches: Schema.optional<Schema.
|
|
106
|
-
readonly statements: Schema.optional<Schema.
|
|
103
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
104
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
105
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
106
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
107
107
|
}>]>>;
|
|
108
108
|
}>]>>, never>;
|
|
109
109
|
}>>;
|
|
110
110
|
readonly baselines: Schema.optional<Schema.Struct<{
|
|
111
111
|
readonly global: Schema.Struct<{
|
|
112
|
-
readonly lines: Schema.optional<Schema.
|
|
113
|
-
readonly functions: Schema.optional<Schema.
|
|
114
|
-
readonly branches: Schema.optional<Schema.
|
|
115
|
-
readonly statements: Schema.optional<Schema.
|
|
112
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
113
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
114
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
115
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
116
116
|
}>;
|
|
117
117
|
readonly patterns: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Struct<{
|
|
118
|
-
readonly lines: Schema.optional<Schema.
|
|
119
|
-
readonly functions: Schema.optional<Schema.
|
|
120
|
-
readonly branches: Schema.optional<Schema.
|
|
121
|
-
readonly statements: Schema.optional<Schema.
|
|
118
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
119
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
120
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
121
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
122
122
|
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
123
|
-
readonly lines: Schema.optional<Schema.
|
|
124
|
-
readonly functions: Schema.optional<Schema.
|
|
125
|
-
readonly branches: Schema.optional<Schema.
|
|
126
|
-
readonly statements: Schema.optional<Schema.
|
|
123
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
124
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
125
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
126
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
127
127
|
}>]>>;
|
|
128
128
|
}>]>>, never>;
|
|
129
129
|
}>>;
|
|
130
130
|
readonly scoped: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
131
131
|
readonly scopedFiles: Schema.optional<Schema.$Array<Schema.String>>;
|
|
132
|
-
readonly totalFiles: Schema.optional<Schema.
|
|
132
|
+
readonly totalFiles: Schema.optional<Schema.Finite>;
|
|
133
133
|
readonly lowCoverage: Schema.$Array<Schema.Struct<{
|
|
134
134
|
readonly file: Schema.String;
|
|
135
135
|
readonly summary: Schema.Struct<{
|
|
136
|
-
readonly statements: Schema.
|
|
137
|
-
readonly branches: Schema.
|
|
138
|
-
readonly functions: Schema.
|
|
139
|
-
readonly lines: Schema.
|
|
136
|
+
readonly statements: Schema.Finite;
|
|
137
|
+
readonly branches: Schema.Finite;
|
|
138
|
+
readonly functions: Schema.Finite;
|
|
139
|
+
readonly lines: Schema.Finite;
|
|
140
140
|
}>;
|
|
141
141
|
readonly uncoveredLines: Schema.String;
|
|
142
142
|
}>>;
|
|
@@ -144,10 +144,10 @@ export declare const CoverageReport: Schema.Struct<{
|
|
|
144
144
|
readonly belowTarget: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
145
145
|
readonly file: Schema.String;
|
|
146
146
|
readonly summary: Schema.Struct<{
|
|
147
|
-
readonly statements: Schema.
|
|
148
|
-
readonly branches: Schema.
|
|
149
|
-
readonly functions: Schema.
|
|
150
|
-
readonly lines: Schema.
|
|
147
|
+
readonly statements: Schema.Finite;
|
|
148
|
+
readonly branches: Schema.Finite;
|
|
149
|
+
readonly functions: Schema.Finite;
|
|
150
|
+
readonly lines: Schema.Finite;
|
|
151
151
|
}>;
|
|
152
152
|
readonly uncoveredLines: Schema.String;
|
|
153
153
|
}>>>;
|
|
@@ -157,17 +157,17 @@ export declare const CoverageReport: Schema.Struct<{
|
|
|
157
157
|
readonly pattern: Schema.String;
|
|
158
158
|
/** Aggregate coverage percentages over the files the glob matches. */
|
|
159
159
|
readonly summary: Schema.Struct<{
|
|
160
|
-
readonly statements: Schema.
|
|
161
|
-
readonly branches: Schema.
|
|
162
|
-
readonly functions: Schema.
|
|
163
|
-
readonly lines: Schema.
|
|
160
|
+
readonly statements: Schema.Finite;
|
|
161
|
+
readonly branches: Schema.Finite;
|
|
162
|
+
readonly functions: Schema.Finite;
|
|
163
|
+
readonly lines: Schema.Finite;
|
|
164
164
|
}>;
|
|
165
165
|
/** The glob's own metric numbers that were set (`perFile` excluded). */
|
|
166
166
|
readonly thresholds: Schema.Struct<{
|
|
167
|
-
readonly lines: Schema.optional<Schema.
|
|
168
|
-
readonly functions: Schema.optional<Schema.
|
|
169
|
-
readonly branches: Schema.optional<Schema.
|
|
170
|
-
readonly statements: Schema.optional<Schema.
|
|
167
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
168
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
169
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
170
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
171
171
|
}>;
|
|
172
172
|
}>>>;
|
|
173
173
|
}>;
|
|
@@ -264,24 +264,24 @@ export type FailureRecord = typeof FailureRecord.Type;
|
|
|
264
264
|
*/
|
|
265
265
|
export declare const CoverageRenderState: Schema.Struct<{
|
|
266
266
|
readonly metrics: Schema.Struct<{
|
|
267
|
-
readonly statements: Schema.
|
|
268
|
-
readonly branches: Schema.
|
|
269
|
-
readonly functions: Schema.
|
|
270
|
-
readonly lines: Schema.
|
|
267
|
+
readonly statements: Schema.Finite;
|
|
268
|
+
readonly branches: Schema.Finite;
|
|
269
|
+
readonly functions: Schema.Finite;
|
|
270
|
+
readonly lines: Schema.Finite;
|
|
271
271
|
}>;
|
|
272
272
|
readonly thresholds: Schema.Struct<{
|
|
273
|
-
readonly lines: Schema.optional<Schema.
|
|
274
|
-
readonly functions: Schema.optional<Schema.
|
|
275
|
-
readonly branches: Schema.optional<Schema.
|
|
276
|
-
readonly statements: Schema.optional<Schema.
|
|
273
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
274
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
275
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
276
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
277
277
|
}>;
|
|
278
278
|
readonly gaps: Schema.$Array<Schema.Struct<{
|
|
279
279
|
readonly file: Schema.String;
|
|
280
280
|
readonly missing: Schema.Struct<{
|
|
281
|
-
readonly statements: Schema.
|
|
282
|
-
readonly branches: Schema.
|
|
283
|
-
readonly functions: Schema.
|
|
284
|
-
readonly lines: Schema.
|
|
281
|
+
readonly statements: Schema.Finite;
|
|
282
|
+
readonly branches: Schema.Finite;
|
|
283
|
+
readonly functions: Schema.Finite;
|
|
284
|
+
readonly lines: Schema.Finite;
|
|
285
285
|
}>;
|
|
286
286
|
readonly uncoveredLines: Schema.optional<Schema.String>;
|
|
287
287
|
}>>;
|
|
@@ -296,16 +296,16 @@ export declare const CoverageRenderState: Schema.Struct<{
|
|
|
296
296
|
readonly globShortfalls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
297
297
|
readonly pattern: Schema.String;
|
|
298
298
|
readonly summary: Schema.Struct<{
|
|
299
|
-
readonly statements: Schema.
|
|
300
|
-
readonly branches: Schema.
|
|
301
|
-
readonly functions: Schema.
|
|
302
|
-
readonly lines: Schema.
|
|
299
|
+
readonly statements: Schema.Finite;
|
|
300
|
+
readonly branches: Schema.Finite;
|
|
301
|
+
readonly functions: Schema.Finite;
|
|
302
|
+
readonly lines: Schema.Finite;
|
|
303
303
|
}>;
|
|
304
304
|
readonly thresholds: Schema.Struct<{
|
|
305
|
-
readonly lines: Schema.optional<Schema.
|
|
306
|
-
readonly functions: Schema.optional<Schema.
|
|
307
|
-
readonly branches: Schema.optional<Schema.
|
|
308
|
-
readonly statements: Schema.optional<Schema.
|
|
305
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
306
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
307
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
308
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
309
309
|
}>;
|
|
310
310
|
}>>>;
|
|
311
311
|
}>;
|
|
@@ -400,24 +400,24 @@ export declare const RenderState: Schema.Struct<{
|
|
|
400
400
|
}>;
|
|
401
401
|
readonly coverage: Schema.NullOr<Schema.Struct<{
|
|
402
402
|
readonly metrics: Schema.Struct<{
|
|
403
|
-
readonly statements: Schema.
|
|
404
|
-
readonly branches: Schema.
|
|
405
|
-
readonly functions: Schema.
|
|
406
|
-
readonly lines: Schema.
|
|
403
|
+
readonly statements: Schema.Finite;
|
|
404
|
+
readonly branches: Schema.Finite;
|
|
405
|
+
readonly functions: Schema.Finite;
|
|
406
|
+
readonly lines: Schema.Finite;
|
|
407
407
|
}>;
|
|
408
408
|
readonly thresholds: Schema.Struct<{
|
|
409
|
-
readonly lines: Schema.optional<Schema.
|
|
410
|
-
readonly functions: Schema.optional<Schema.
|
|
411
|
-
readonly branches: Schema.optional<Schema.
|
|
412
|
-
readonly statements: Schema.optional<Schema.
|
|
409
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
410
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
411
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
412
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
413
413
|
}>;
|
|
414
414
|
readonly gaps: Schema.$Array<Schema.Struct<{
|
|
415
415
|
readonly file: Schema.String;
|
|
416
416
|
readonly missing: Schema.Struct<{
|
|
417
|
-
readonly statements: Schema.
|
|
418
|
-
readonly branches: Schema.
|
|
419
|
-
readonly functions: Schema.
|
|
420
|
-
readonly lines: Schema.
|
|
417
|
+
readonly statements: Schema.Finite;
|
|
418
|
+
readonly branches: Schema.Finite;
|
|
419
|
+
readonly functions: Schema.Finite;
|
|
420
|
+
readonly lines: Schema.Finite;
|
|
421
421
|
}>;
|
|
422
422
|
readonly uncoveredLines: Schema.optional<Schema.String>;
|
|
423
423
|
}>>;
|
|
@@ -432,16 +432,16 @@ export declare const RenderState: Schema.Struct<{
|
|
|
432
432
|
readonly globShortfalls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
433
433
|
readonly pattern: Schema.String;
|
|
434
434
|
readonly summary: Schema.Struct<{
|
|
435
|
-
readonly statements: Schema.
|
|
436
|
-
readonly branches: Schema.
|
|
437
|
-
readonly functions: Schema.
|
|
438
|
-
readonly lines: Schema.
|
|
435
|
+
readonly statements: Schema.Finite;
|
|
436
|
+
readonly branches: Schema.Finite;
|
|
437
|
+
readonly functions: Schema.Finite;
|
|
438
|
+
readonly lines: Schema.Finite;
|
|
439
439
|
}>;
|
|
440
440
|
readonly thresholds: Schema.Struct<{
|
|
441
|
-
readonly lines: Schema.optional<Schema.
|
|
442
|
-
readonly functions: Schema.optional<Schema.
|
|
443
|
-
readonly branches: Schema.optional<Schema.
|
|
444
|
-
readonly statements: Schema.optional<Schema.
|
|
441
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
442
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
443
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
444
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
445
445
|
}>;
|
|
446
446
|
}>>>;
|
|
447
447
|
}>>;
|
|
@@ -498,15 +498,35 @@ export declare const RenderState: Schema.Struct<{
|
|
|
498
498
|
* wrote nothing stray.
|
|
499
499
|
*/
|
|
500
500
|
readonly strayOutput: Schema.optional<Schema.Struct<{
|
|
501
|
-
readonly total: Schema.
|
|
502
|
-
readonly stdout: Schema.
|
|
503
|
-
readonly stderr: Schema.
|
|
504
|
-
readonly bytes: Schema.
|
|
501
|
+
readonly total: Schema.Finite;
|
|
502
|
+
readonly stdout: Schema.Finite;
|
|
503
|
+
readonly stderr: Schema.Finite;
|
|
504
|
+
readonly bytes: Schema.Finite;
|
|
505
505
|
readonly samples: Schema.$Array<Schema.Struct<{
|
|
506
506
|
readonly stream: Schema.Literals<readonly ["stdout", "stderr"]>;
|
|
507
507
|
readonly text: Schema.String;
|
|
508
508
|
}>>;
|
|
509
509
|
}>>;
|
|
510
|
+
/**
|
|
511
|
+
* `console.*` output Vitest captured from tests that did not fail, folded
|
|
512
|
+
* from `RunFinished.consoleLeaks`. Absent when the run logged nothing
|
|
513
|
+
* (issue #544).
|
|
514
|
+
*/
|
|
515
|
+
readonly consoleLeaks: Schema.optional<Schema.Struct<{
|
|
516
|
+
readonly total: Schema.Finite;
|
|
517
|
+
readonly byFile: Schema.$Array<Schema.Struct<{
|
|
518
|
+
readonly file: Schema.String;
|
|
519
|
+
readonly stdout: Schema.Finite;
|
|
520
|
+
readonly stderr: Schema.Finite;
|
|
521
|
+
readonly tests: Schema.optional<Schema.$Array<Schema.String>>;
|
|
522
|
+
readonly sample: Schema.optional<Schema.String>;
|
|
523
|
+
}>>;
|
|
524
|
+
readonly truncated: Schema.optional<Schema.Boolean>;
|
|
525
|
+
readonly fromFailingTests: Schema.optional<Schema.Struct<{
|
|
526
|
+
readonly total: Schema.Finite;
|
|
527
|
+
readonly files: Schema.Finite;
|
|
528
|
+
}>>;
|
|
529
|
+
}>>;
|
|
510
530
|
}>;
|
|
511
531
|
/** @public */
|
|
512
532
|
export type RenderState = typeof RenderState.Type;
|
|
@@ -616,27 +636,41 @@ export interface DispatchInputs {
|
|
|
616
636
|
readonly runCommand: string | null;
|
|
617
637
|
}
|
|
618
638
|
/**
|
|
619
|
-
*
|
|
620
|
-
* `ReporterKit`. These are concerns the cell needs to format its
|
|
621
|
-
* output but that do not belong on the state-derived
|
|
622
|
-
* {@link DispatchInputs} struct.
|
|
639
|
+
* Where a file link points: a path, with an optional line and column.
|
|
623
640
|
*
|
|
624
|
-
* The
|
|
641
|
+
* The file half of `@effected/cli`'s `LinkTarget`, spelled structurally so
|
|
642
|
+
* this platform-free contract names no kit type. A relative path resolves
|
|
643
|
+
* against the working directory the kit's `CliLinks` layer was built with.
|
|
644
|
+
* @public
|
|
645
|
+
*/
|
|
646
|
+
export interface FileLinkTarget {
|
|
647
|
+
readonly file: string;
|
|
648
|
+
readonly line?: number;
|
|
649
|
+
readonly col?: number;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Render-time options threaded into each cell. These are concerns the
|
|
653
|
+
* cell needs to format its output but that do not belong on the
|
|
654
|
+
* state-derived {@link DispatchInputs} struct.
|
|
655
|
+
*
|
|
656
|
+
* The caller builds this once per render and passes it into
|
|
625
657
|
* `dispatch(inputs, opts)`. Cells destructure only what they consume.
|
|
626
658
|
* @public
|
|
627
659
|
*/
|
|
628
660
|
export interface CellOptions {
|
|
629
661
|
/**
|
|
630
|
-
*
|
|
631
|
-
*
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
*
|
|
636
|
-
*
|
|
637
|
-
*
|
|
662
|
+
* Writes a file path as a link for the audience and terminal the output
|
|
663
|
+
* is for: the label wrapped in an OSC 8 hyperlink when the reader can
|
|
664
|
+
* follow it, the label unchanged otherwise. The kit decides both halves
|
|
665
|
+
* (`@effected/cli`'s `CliLinks.linker`, `Render.context("stdout").link`):
|
|
666
|
+
* `vscode://file/<path>:<line>:<col>` under VS Code, `file://` otherwise,
|
|
667
|
+
* never for an agent audience, and nothing on a terminal that cannot
|
|
668
|
+
* render hyperlinks (a pipe, tmux, GNU screen, `NO_COLOR`).
|
|
669
|
+
*
|
|
670
|
+
* Omitted, every path is its label alone, which is what an agent reads;
|
|
671
|
+
* a cell therefore never writes an escape sequence of its own.
|
|
638
672
|
*/
|
|
639
|
-
readonly
|
|
673
|
+
readonly link?: (target: FileLinkTarget, label: string) => string;
|
|
640
674
|
}
|
|
641
675
|
/**
|
|
642
676
|
* One unit of rendered reporter output, tagged by where it goes.
|
|
@@ -666,11 +700,11 @@ export type RenderedOutput = {
|
|
|
666
700
|
* @public
|
|
667
701
|
*/
|
|
668
702
|
export declare const ReportSummary: Schema.Struct<{
|
|
669
|
-
readonly total: Schema.
|
|
670
|
-
readonly passed: Schema.
|
|
671
|
-
readonly failed: Schema.
|
|
672
|
-
readonly skipped: Schema.
|
|
673
|
-
readonly duration: Schema.
|
|
703
|
+
readonly total: Schema.Finite;
|
|
704
|
+
readonly passed: Schema.Finite;
|
|
705
|
+
readonly failed: Schema.Finite;
|
|
706
|
+
readonly skipped: Schema.Finite;
|
|
707
|
+
readonly duration: Schema.Finite;
|
|
674
708
|
/**
|
|
675
709
|
* Count of every collected module, passing modules included.
|
|
676
710
|
* `AgentReport.failed` only carries failing modules, so a green run
|
|
@@ -678,7 +712,7 @@ export declare const ReportSummary: Schema.Struct<{
|
|
|
678
712
|
* this a fully-passing replay reads as "0 modules all-passed"
|
|
679
713
|
* (issue #204). Optional to keep existing fixtures/reports valid.
|
|
680
714
|
*/
|
|
681
|
-
readonly modules: Schema.optional<Schema.
|
|
715
|
+
readonly modules: Schema.optional<Schema.Finite>;
|
|
682
716
|
}>;
|
|
683
717
|
/** @public */
|
|
684
718
|
export type ReportSummary = typeof ReportSummary.Type;
|
|
@@ -690,7 +724,7 @@ export declare const TestReport: Schema.Struct<{
|
|
|
690
724
|
readonly name: Schema.String;
|
|
691
725
|
readonly fullName: Schema.String;
|
|
692
726
|
readonly state: Schema.Literals<readonly ["passed", "failed", "skipped", "pending"]>;
|
|
693
|
-
readonly duration: Schema.optional<Schema.
|
|
727
|
+
readonly duration: Schema.optional<Schema.Finite>;
|
|
694
728
|
readonly flaky: Schema.optional<Schema.Boolean>;
|
|
695
729
|
readonly slow: Schema.optional<Schema.Boolean>;
|
|
696
730
|
readonly errors: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
@@ -711,7 +745,7 @@ export type TestReport = typeof TestReport.Type;
|
|
|
711
745
|
export declare const ModuleReport: Schema.Struct<{
|
|
712
746
|
readonly file: Schema.String;
|
|
713
747
|
readonly state: Schema.Literals<readonly ["passed", "failed", "skipped", "pending"]>;
|
|
714
|
-
readonly duration: Schema.optional<Schema.
|
|
748
|
+
readonly duration: Schema.optional<Schema.Finite>;
|
|
715
749
|
readonly errors: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
716
750
|
readonly message: Schema.String;
|
|
717
751
|
readonly stack: Schema.optional<Schema.String>;
|
|
@@ -723,7 +757,7 @@ export declare const ModuleReport: Schema.Struct<{
|
|
|
723
757
|
readonly name: Schema.String;
|
|
724
758
|
readonly fullName: Schema.String;
|
|
725
759
|
readonly state: Schema.Literals<readonly ["passed", "failed", "skipped", "pending"]>;
|
|
726
|
-
readonly duration: Schema.optional<Schema.
|
|
760
|
+
readonly duration: Schema.optional<Schema.Finite>;
|
|
727
761
|
readonly flaky: Schema.optional<Schema.Boolean>;
|
|
728
762
|
readonly slow: Schema.optional<Schema.Boolean>;
|
|
729
763
|
readonly errors: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
@@ -743,9 +777,9 @@ export type ModuleReport = typeof ModuleReport.Type;
|
|
|
743
777
|
* @public
|
|
744
778
|
*/
|
|
745
779
|
export declare const TagCountEntry: Schema.Struct<{
|
|
746
|
-
readonly passed: Schema.optional<Schema.
|
|
747
|
-
readonly failed: Schema.optional<Schema.
|
|
748
|
-
readonly skipped: Schema.optional<Schema.
|
|
780
|
+
readonly passed: Schema.optional<Schema.Finite>;
|
|
781
|
+
readonly failed: Schema.optional<Schema.Finite>;
|
|
782
|
+
readonly skipped: Schema.optional<Schema.Finite>;
|
|
749
783
|
}>;
|
|
750
784
|
/** @public */
|
|
751
785
|
export type TagCountEntry = typeof TagCountEntry.Type;
|
|
@@ -758,11 +792,11 @@ export declare const AgentReport: Schema.Struct<{
|
|
|
758
792
|
readonly project: Schema.optional<Schema.String>;
|
|
759
793
|
readonly reason: Schema.Literals<readonly ["passed", "failed", "interrupted"]>;
|
|
760
794
|
readonly summary: Schema.Struct<{
|
|
761
|
-
readonly total: Schema.
|
|
762
|
-
readonly passed: Schema.
|
|
763
|
-
readonly failed: Schema.
|
|
764
|
-
readonly skipped: Schema.
|
|
765
|
-
readonly duration: Schema.
|
|
795
|
+
readonly total: Schema.Finite;
|
|
796
|
+
readonly passed: Schema.Finite;
|
|
797
|
+
readonly failed: Schema.Finite;
|
|
798
|
+
readonly skipped: Schema.Finite;
|
|
799
|
+
readonly duration: Schema.Finite;
|
|
766
800
|
/**
|
|
767
801
|
* Count of every collected module, passing modules included.
|
|
768
802
|
* `AgentReport.failed` only carries failing modules, so a green run
|
|
@@ -770,12 +804,12 @@ export declare const AgentReport: Schema.Struct<{
|
|
|
770
804
|
* this a fully-passing replay reads as "0 modules all-passed"
|
|
771
805
|
* (issue #204). Optional to keep existing fixtures/reports valid.
|
|
772
806
|
*/
|
|
773
|
-
readonly modules: Schema.optional<Schema.
|
|
807
|
+
readonly modules: Schema.optional<Schema.Finite>;
|
|
774
808
|
}>;
|
|
775
809
|
readonly failed: Schema.$Array<Schema.Struct<{
|
|
776
810
|
readonly file: Schema.String;
|
|
777
811
|
readonly state: Schema.Literals<readonly ["passed", "failed", "skipped", "pending"]>;
|
|
778
|
-
readonly duration: Schema.optional<Schema.
|
|
812
|
+
readonly duration: Schema.optional<Schema.Finite>;
|
|
779
813
|
readonly errors: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
780
814
|
readonly message: Schema.String;
|
|
781
815
|
readonly stack: Schema.optional<Schema.String>;
|
|
@@ -787,7 +821,7 @@ export declare const AgentReport: Schema.Struct<{
|
|
|
787
821
|
readonly name: Schema.String;
|
|
788
822
|
readonly fullName: Schema.String;
|
|
789
823
|
readonly state: Schema.Literals<readonly ["passed", "failed", "skipped", "pending"]>;
|
|
790
|
-
readonly duration: Schema.optional<Schema.
|
|
824
|
+
readonly duration: Schema.optional<Schema.Finite>;
|
|
791
825
|
readonly flaky: Schema.optional<Schema.Boolean>;
|
|
792
826
|
readonly slow: Schema.optional<Schema.Boolean>;
|
|
793
827
|
readonly errors: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
@@ -810,81 +844,81 @@ export declare const AgentReport: Schema.Struct<{
|
|
|
810
844
|
readonly failedFiles: Schema.$Array<Schema.String>;
|
|
811
845
|
readonly coverage: Schema.optional<Schema.Struct<{
|
|
812
846
|
readonly totals: Schema.Struct<{
|
|
813
|
-
readonly statements: Schema.
|
|
814
|
-
readonly branches: Schema.
|
|
815
|
-
readonly functions: Schema.
|
|
816
|
-
readonly lines: Schema.
|
|
847
|
+
readonly statements: Schema.Finite;
|
|
848
|
+
readonly branches: Schema.Finite;
|
|
849
|
+
readonly functions: Schema.Finite;
|
|
850
|
+
readonly lines: Schema.Finite;
|
|
817
851
|
}>;
|
|
818
852
|
readonly thresholds: Schema.Struct<{
|
|
819
853
|
readonly global: Schema.Struct<{
|
|
820
|
-
readonly lines: Schema.optional<Schema.
|
|
821
|
-
readonly functions: Schema.optional<Schema.
|
|
822
|
-
readonly branches: Schema.optional<Schema.
|
|
823
|
-
readonly statements: Schema.optional<Schema.
|
|
854
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
855
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
856
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
857
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
824
858
|
}>;
|
|
825
859
|
readonly patterns: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Struct<{
|
|
826
|
-
readonly lines: Schema.optional<Schema.
|
|
827
|
-
readonly functions: Schema.optional<Schema.
|
|
828
|
-
readonly branches: Schema.optional<Schema.
|
|
829
|
-
readonly statements: Schema.optional<Schema.
|
|
860
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
861
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
862
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
863
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
830
864
|
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
831
|
-
readonly lines: Schema.optional<Schema.
|
|
832
|
-
readonly functions: Schema.optional<Schema.
|
|
833
|
-
readonly branches: Schema.optional<Schema.
|
|
834
|
-
readonly statements: Schema.optional<Schema.
|
|
865
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
866
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
867
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
868
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
835
869
|
}>]>>;
|
|
836
870
|
}>]>>, never>;
|
|
837
871
|
}>;
|
|
838
872
|
readonly targets: Schema.optional<Schema.Struct<{
|
|
839
873
|
readonly global: Schema.Struct<{
|
|
840
|
-
readonly lines: Schema.optional<Schema.
|
|
841
|
-
readonly functions: Schema.optional<Schema.
|
|
842
|
-
readonly branches: Schema.optional<Schema.
|
|
843
|
-
readonly statements: Schema.optional<Schema.
|
|
874
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
875
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
876
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
877
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
844
878
|
}>;
|
|
845
879
|
readonly patterns: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Struct<{
|
|
846
|
-
readonly lines: Schema.optional<Schema.
|
|
847
|
-
readonly functions: Schema.optional<Schema.
|
|
848
|
-
readonly branches: Schema.optional<Schema.
|
|
849
|
-
readonly statements: Schema.optional<Schema.
|
|
880
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
881
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
882
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
883
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
850
884
|
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
851
|
-
readonly lines: Schema.optional<Schema.
|
|
852
|
-
readonly functions: Schema.optional<Schema.
|
|
853
|
-
readonly branches: Schema.optional<Schema.
|
|
854
|
-
readonly statements: Schema.optional<Schema.
|
|
885
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
886
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
887
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
888
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
855
889
|
}>]>>;
|
|
856
890
|
}>]>>, never>;
|
|
857
891
|
}>>;
|
|
858
892
|
readonly baselines: Schema.optional<Schema.Struct<{
|
|
859
893
|
readonly global: Schema.Struct<{
|
|
860
|
-
readonly lines: Schema.optional<Schema.
|
|
861
|
-
readonly functions: Schema.optional<Schema.
|
|
862
|
-
readonly branches: Schema.optional<Schema.
|
|
863
|
-
readonly statements: Schema.optional<Schema.
|
|
894
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
895
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
896
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
897
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
864
898
|
}>;
|
|
865
899
|
readonly patterns: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Struct<{
|
|
866
|
-
readonly lines: Schema.optional<Schema.
|
|
867
|
-
readonly functions: Schema.optional<Schema.
|
|
868
|
-
readonly branches: Schema.optional<Schema.
|
|
869
|
-
readonly statements: Schema.optional<Schema.
|
|
900
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
901
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
902
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
903
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
870
904
|
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
871
|
-
readonly lines: Schema.optional<Schema.
|
|
872
|
-
readonly functions: Schema.optional<Schema.
|
|
873
|
-
readonly branches: Schema.optional<Schema.
|
|
874
|
-
readonly statements: Schema.optional<Schema.
|
|
905
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
906
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
907
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
908
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
875
909
|
}>]>>;
|
|
876
910
|
}>]>>, never>;
|
|
877
911
|
}>>;
|
|
878
912
|
readonly scoped: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
879
913
|
readonly scopedFiles: Schema.optional<Schema.$Array<Schema.String>>;
|
|
880
|
-
readonly totalFiles: Schema.optional<Schema.
|
|
914
|
+
readonly totalFiles: Schema.optional<Schema.Finite>;
|
|
881
915
|
readonly lowCoverage: Schema.$Array<Schema.Struct<{
|
|
882
916
|
readonly file: Schema.String;
|
|
883
917
|
readonly summary: Schema.Struct<{
|
|
884
|
-
readonly statements: Schema.
|
|
885
|
-
readonly branches: Schema.
|
|
886
|
-
readonly functions: Schema.
|
|
887
|
-
readonly lines: Schema.
|
|
918
|
+
readonly statements: Schema.Finite;
|
|
919
|
+
readonly branches: Schema.Finite;
|
|
920
|
+
readonly functions: Schema.Finite;
|
|
921
|
+
readonly lines: Schema.Finite;
|
|
888
922
|
}>;
|
|
889
923
|
readonly uncoveredLines: Schema.String;
|
|
890
924
|
}>>;
|
|
@@ -892,10 +926,10 @@ export declare const AgentReport: Schema.Struct<{
|
|
|
892
926
|
readonly belowTarget: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
893
927
|
readonly file: Schema.String;
|
|
894
928
|
readonly summary: Schema.Struct<{
|
|
895
|
-
readonly statements: Schema.
|
|
896
|
-
readonly branches: Schema.
|
|
897
|
-
readonly functions: Schema.
|
|
898
|
-
readonly lines: Schema.
|
|
929
|
+
readonly statements: Schema.Finite;
|
|
930
|
+
readonly branches: Schema.Finite;
|
|
931
|
+
readonly functions: Schema.Finite;
|
|
932
|
+
readonly lines: Schema.Finite;
|
|
899
933
|
}>;
|
|
900
934
|
readonly uncoveredLines: Schema.String;
|
|
901
935
|
}>>>;
|
|
@@ -903,44 +937,44 @@ export declare const AgentReport: Schema.Struct<{
|
|
|
903
937
|
readonly globShortfalls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
904
938
|
readonly pattern: Schema.String;
|
|
905
939
|
readonly summary: Schema.Struct<{
|
|
906
|
-
readonly statements: Schema.
|
|
907
|
-
readonly branches: Schema.
|
|
908
|
-
readonly functions: Schema.
|
|
909
|
-
readonly lines: Schema.
|
|
940
|
+
readonly statements: Schema.Finite;
|
|
941
|
+
readonly branches: Schema.Finite;
|
|
942
|
+
readonly functions: Schema.Finite;
|
|
943
|
+
readonly lines: Schema.Finite;
|
|
910
944
|
}>;
|
|
911
945
|
readonly thresholds: Schema.Struct<{
|
|
912
|
-
readonly lines: Schema.optional<Schema.
|
|
913
|
-
readonly functions: Schema.optional<Schema.
|
|
914
|
-
readonly branches: Schema.optional<Schema.
|
|
915
|
-
readonly statements: Schema.optional<Schema.
|
|
946
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
947
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
948
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
949
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
916
950
|
}>;
|
|
917
951
|
}>>>;
|
|
918
952
|
}>>;
|
|
919
953
|
readonly tagCounts: Schema.optional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
920
|
-
readonly passed: Schema.optional<Schema.
|
|
921
|
-
readonly failed: Schema.optional<Schema.
|
|
922
|
-
readonly skipped: Schema.optional<Schema.
|
|
954
|
+
readonly passed: Schema.optional<Schema.Finite>;
|
|
955
|
+
readonly failed: Schema.optional<Schema.Finite>;
|
|
956
|
+
readonly skipped: Schema.optional<Schema.Finite>;
|
|
923
957
|
}>>>;
|
|
924
958
|
readonly consoleLeaks: Schema.optional<Schema.Struct<{
|
|
925
|
-
readonly total: Schema.
|
|
959
|
+
readonly total: Schema.Finite;
|
|
926
960
|
readonly byFile: Schema.$Array<Schema.Struct<{
|
|
927
961
|
readonly file: Schema.String;
|
|
928
|
-
readonly stdout: Schema.
|
|
929
|
-
readonly stderr: Schema.
|
|
962
|
+
readonly stdout: Schema.Finite;
|
|
963
|
+
readonly stderr: Schema.Finite;
|
|
930
964
|
readonly tests: Schema.optional<Schema.$Array<Schema.String>>;
|
|
931
965
|
readonly sample: Schema.optional<Schema.String>;
|
|
932
966
|
}>>;
|
|
933
967
|
readonly truncated: Schema.optional<Schema.Boolean>;
|
|
934
968
|
readonly fromFailingTests: Schema.optional<Schema.Struct<{
|
|
935
|
-
readonly total: Schema.
|
|
936
|
-
readonly files: Schema.
|
|
969
|
+
readonly total: Schema.Finite;
|
|
970
|
+
readonly files: Schema.Finite;
|
|
937
971
|
}>>;
|
|
938
972
|
}>>;
|
|
939
973
|
readonly strayOutput: Schema.optional<Schema.Struct<{
|
|
940
|
-
readonly total: Schema.
|
|
941
|
-
readonly stdout: Schema.
|
|
942
|
-
readonly stderr: Schema.
|
|
943
|
-
readonly bytes: Schema.
|
|
974
|
+
readonly total: Schema.Finite;
|
|
975
|
+
readonly stdout: Schema.Finite;
|
|
976
|
+
readonly stderr: Schema.Finite;
|
|
977
|
+
readonly bytes: Schema.Finite;
|
|
944
978
|
readonly samples: Schema.$Array<Schema.Struct<{
|
|
945
979
|
readonly stream: Schema.Literals<readonly ["stdout", "stderr"]>;
|
|
946
980
|
readonly text: Schema.String;
|
|
@@ -949,6 +983,27 @@ export declare const AgentReport: Schema.Struct<{
|
|
|
949
983
|
}>;
|
|
950
984
|
/** @public */
|
|
951
985
|
export type AgentReport = typeof AgentReport.Type;
|
|
986
|
+
/**
|
|
987
|
+
* A finite JSON number: the numeric field type for every schema that
|
|
988
|
+
* reaches a published document (`RunReportFile` and the `schemas/5.0/run.json`
|
|
989
|
+
* it generates). The `Type` is still `number`, and a finite value decodes
|
|
990
|
+
* exactly as it did under `Schema.Number`; only `NaN`, `Infinity` and
|
|
991
|
+
* `-Infinity` are rejected.
|
|
992
|
+
*
|
|
993
|
+
* @remarks
|
|
994
|
+
* `Schema.Number` lowers to JSON Schema as
|
|
995
|
+
* `anyOf: [{ type: "number" }, { type: "string", enum: ["Infinity", "-Infinity", "NaN"] }]`
|
|
996
|
+
* so the JSON codec can round-trip the non-finite values JSON has no
|
|
997
|
+
* literal for. The reporter writes those fields with `JSON.stringify`,
|
|
998
|
+
* which never produces the string arms, so the published schema was
|
|
999
|
+
* looser than the data and a type generator read every count and
|
|
1000
|
+
* duration as `number | "Infinity" | "-Infinity" | "NaN"` (issue #392).
|
|
1001
|
+
* `Schema.Finite`'s check carries a `{ type: "number" }` JSON Schema
|
|
1002
|
+
* annotation that the emitter folds into the bare number type.
|
|
1003
|
+
*
|
|
1004
|
+
* @public
|
|
1005
|
+
*/
|
|
1006
|
+
export declare const FiniteNumber: Schema.Finite;
|
|
952
1007
|
/**
|
|
953
1008
|
* Possible states for an individual test case.
|
|
954
1009
|
* @public
|
|
@@ -1063,6 +1118,85 @@ export declare const ReportError: Schema.Struct<{
|
|
|
1063
1118
|
}>;
|
|
1064
1119
|
/** @public */
|
|
1065
1120
|
export type ReportError = typeof ReportError.Type;
|
|
1121
|
+
/**
|
|
1122
|
+
* Which Vitest performance diagnostic a hint came from.
|
|
1123
|
+
* @public
|
|
1124
|
+
*/
|
|
1125
|
+
export declare const PerformanceHintKind: Schema.Literals<readonly ["environment", "import", "transform", "isolate"]>;
|
|
1126
|
+
/** @public */
|
|
1127
|
+
export type PerformanceHintKind = typeof PerformanceHintKind.Type;
|
|
1128
|
+
/**
|
|
1129
|
+
* One performance hint derived from Vitest's run diagnostics. `project` is
|
|
1130
|
+
* omitted for a hint that applies to the whole run (for example `isolate`).
|
|
1131
|
+
* @public
|
|
1132
|
+
*/
|
|
1133
|
+
export declare const PerformanceHint: Schema.Struct<{
|
|
1134
|
+
readonly kind: Schema.Literals<readonly ["environment", "import", "transform", "isolate"]>;
|
|
1135
|
+
readonly project: Schema.optionalKey<Schema.String>;
|
|
1136
|
+
readonly message: Schema.String;
|
|
1137
|
+
readonly remedy: Schema.String;
|
|
1138
|
+
readonly detail: Schema.String;
|
|
1139
|
+
readonly learnMoreUrl: Schema.String;
|
|
1140
|
+
readonly estimatedSavingMs: Schema.optionalKey<Schema.Finite>;
|
|
1141
|
+
readonly share: Schema.optionalKey<Schema.Finite>;
|
|
1142
|
+
}>;
|
|
1143
|
+
/** @public */
|
|
1144
|
+
export type PerformanceHint = typeof PerformanceHint.Type;
|
|
1145
|
+
/**
|
|
1146
|
+
* Wall-clock timing of the plugin's post-run work, in milliseconds.
|
|
1147
|
+
* @public
|
|
1148
|
+
*/
|
|
1149
|
+
export declare const PostRunTiming: Schema.Struct<{
|
|
1150
|
+
readonly persistMs: Schema.Finite;
|
|
1151
|
+
readonly coverageScanMs: Schema.Finite;
|
|
1152
|
+
readonly totalMs: Schema.Finite;
|
|
1153
|
+
readonly renderMs: Schema.optionalKey<Schema.Finite>;
|
|
1154
|
+
readonly vitestDurationMs: Schema.optionalKey<Schema.Finite>;
|
|
1155
|
+
}>;
|
|
1156
|
+
/** @public */
|
|
1157
|
+
export type PostRunTiming = typeof PostRunTiming.Type;
|
|
1158
|
+
/**
|
|
1159
|
+
* Whether the run's results were persisted to the database.
|
|
1160
|
+
* @public
|
|
1161
|
+
*/
|
|
1162
|
+
export declare const PersistenceStatus: Schema.Struct<{
|
|
1163
|
+
readonly ok: Schema.Boolean;
|
|
1164
|
+
readonly reason: Schema.optionalKey<Schema.String>;
|
|
1165
|
+
readonly migrationFailed: Schema.optionalKey<Schema.Boolean>;
|
|
1166
|
+
}>;
|
|
1167
|
+
/** @public */
|
|
1168
|
+
export type PersistenceStatus = typeof PersistenceStatus.Type;
|
|
1169
|
+
/**
|
|
1170
|
+
* Run-level diagnostics: performance hints, post-run timing and persistence
|
|
1171
|
+
* status (issue #544).
|
|
1172
|
+
* @public
|
|
1173
|
+
*/
|
|
1174
|
+
export declare const RunDiagnostics: Schema.Struct<{
|
|
1175
|
+
readonly performanceHints: Schema.$Array<Schema.Struct<{
|
|
1176
|
+
readonly kind: Schema.Literals<readonly ["environment", "import", "transform", "isolate"]>;
|
|
1177
|
+
readonly project: Schema.optionalKey<Schema.String>;
|
|
1178
|
+
readonly message: Schema.String;
|
|
1179
|
+
readonly remedy: Schema.String;
|
|
1180
|
+
readonly detail: Schema.String;
|
|
1181
|
+
readonly learnMoreUrl: Schema.String;
|
|
1182
|
+
readonly estimatedSavingMs: Schema.optionalKey<Schema.Finite>;
|
|
1183
|
+
readonly share: Schema.optionalKey<Schema.Finite>;
|
|
1184
|
+
}>>;
|
|
1185
|
+
readonly postRun: Schema.optionalKey<Schema.Struct<{
|
|
1186
|
+
readonly persistMs: Schema.Finite;
|
|
1187
|
+
readonly coverageScanMs: Schema.Finite;
|
|
1188
|
+
readonly totalMs: Schema.Finite;
|
|
1189
|
+
readonly renderMs: Schema.optionalKey<Schema.Finite>;
|
|
1190
|
+
readonly vitestDurationMs: Schema.optionalKey<Schema.Finite>;
|
|
1191
|
+
}>>;
|
|
1192
|
+
readonly persistence: Schema.optionalKey<Schema.Struct<{
|
|
1193
|
+
readonly ok: Schema.Boolean;
|
|
1194
|
+
readonly reason: Schema.optionalKey<Schema.String>;
|
|
1195
|
+
readonly migrationFailed: Schema.optionalKey<Schema.Boolean>;
|
|
1196
|
+
}>>;
|
|
1197
|
+
}>;
|
|
1198
|
+
/** @public */
|
|
1199
|
+
export type RunDiagnostics = typeof RunDiagnostics.Type;
|
|
1066
1200
|
/**
|
|
1067
1201
|
* Coverage metric whose threshold can be violated independently.
|
|
1068
1202
|
* @public
|
|
@@ -1106,10 +1240,10 @@ export type ConsoleLogLevel = typeof ConsoleLogLevel.Type;
|
|
|
1106
1240
|
export declare const CoverageGap: Schema.Struct<{
|
|
1107
1241
|
readonly file: Schema.String;
|
|
1108
1242
|
readonly missing: Schema.Struct<{
|
|
1109
|
-
readonly statements: Schema.
|
|
1110
|
-
readonly branches: Schema.
|
|
1111
|
-
readonly functions: Schema.
|
|
1112
|
-
readonly lines: Schema.
|
|
1243
|
+
readonly statements: Schema.Finite;
|
|
1244
|
+
readonly branches: Schema.Finite;
|
|
1245
|
+
readonly functions: Schema.Finite;
|
|
1246
|
+
readonly lines: Schema.Finite;
|
|
1113
1247
|
}>;
|
|
1114
1248
|
readonly uncoveredLines: Schema.optional<Schema.String>;
|
|
1115
1249
|
}>;
|
|
@@ -1246,24 +1380,24 @@ export declare const RunEvent: Schema.Union<readonly [Schema.TaggedStruct<"RunSt
|
|
|
1246
1380
|
readonly runCount: Schema.Number;
|
|
1247
1381
|
}>, Schema.TaggedStruct<"CoverageReady", {
|
|
1248
1382
|
readonly metrics: Schema.Struct<{
|
|
1249
|
-
readonly statements: Schema.
|
|
1250
|
-
readonly branches: Schema.
|
|
1251
|
-
readonly functions: Schema.
|
|
1252
|
-
readonly lines: Schema.
|
|
1383
|
+
readonly statements: Schema.Finite;
|
|
1384
|
+
readonly branches: Schema.Finite;
|
|
1385
|
+
readonly functions: Schema.Finite;
|
|
1386
|
+
readonly lines: Schema.Finite;
|
|
1253
1387
|
}>;
|
|
1254
1388
|
readonly thresholds: Schema.Struct<{
|
|
1255
|
-
readonly lines: Schema.optional<Schema.
|
|
1256
|
-
readonly functions: Schema.optional<Schema.
|
|
1257
|
-
readonly branches: Schema.optional<Schema.
|
|
1258
|
-
readonly statements: Schema.optional<Schema.
|
|
1389
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
1390
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
1391
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
1392
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
1259
1393
|
}>;
|
|
1260
1394
|
readonly gaps: Schema.$Array<Schema.Struct<{
|
|
1261
1395
|
readonly file: Schema.String;
|
|
1262
1396
|
readonly missing: Schema.Struct<{
|
|
1263
|
-
readonly statements: Schema.
|
|
1264
|
-
readonly branches: Schema.
|
|
1265
|
-
readonly functions: Schema.
|
|
1266
|
-
readonly lines: Schema.
|
|
1397
|
+
readonly statements: Schema.Finite;
|
|
1398
|
+
readonly branches: Schema.Finite;
|
|
1399
|
+
readonly functions: Schema.Finite;
|
|
1400
|
+
readonly lines: Schema.Finite;
|
|
1267
1401
|
}>;
|
|
1268
1402
|
readonly uncoveredLines: Schema.optional<Schema.String>;
|
|
1269
1403
|
}>>;
|
|
@@ -1273,16 +1407,16 @@ export declare const RunEvent: Schema.Union<readonly [Schema.TaggedStruct<"RunSt
|
|
|
1273
1407
|
readonly globShortfalls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
1274
1408
|
readonly pattern: Schema.String;
|
|
1275
1409
|
readonly summary: Schema.Struct<{
|
|
1276
|
-
readonly statements: Schema.
|
|
1277
|
-
readonly branches: Schema.
|
|
1278
|
-
readonly functions: Schema.
|
|
1279
|
-
readonly lines: Schema.
|
|
1410
|
+
readonly statements: Schema.Finite;
|
|
1411
|
+
readonly branches: Schema.Finite;
|
|
1412
|
+
readonly functions: Schema.Finite;
|
|
1413
|
+
readonly lines: Schema.Finite;
|
|
1280
1414
|
}>;
|
|
1281
1415
|
readonly thresholds: Schema.Struct<{
|
|
1282
|
-
readonly lines: Schema.optional<Schema.
|
|
1283
|
-
readonly functions: Schema.optional<Schema.
|
|
1284
|
-
readonly branches: Schema.optional<Schema.
|
|
1285
|
-
readonly statements: Schema.optional<Schema.
|
|
1416
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
1417
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
1418
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
1419
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
1286
1420
|
}>;
|
|
1287
1421
|
}>>>;
|
|
1288
1422
|
}>, Schema.TaggedStruct<"ThresholdViolation", {
|
|
@@ -1333,15 +1467,35 @@ export declare const RunEvent: Schema.Union<readonly [Schema.TaggedStruct<"RunSt
|
|
|
1333
1467
|
* wrote nothing stray, and in older replay data.
|
|
1334
1468
|
*/
|
|
1335
1469
|
readonly strayOutput: Schema.optional<Schema.Struct<{
|
|
1336
|
-
readonly total: Schema.
|
|
1337
|
-
readonly stdout: Schema.
|
|
1338
|
-
readonly stderr: Schema.
|
|
1339
|
-
readonly bytes: Schema.
|
|
1470
|
+
readonly total: Schema.Finite;
|
|
1471
|
+
readonly stdout: Schema.Finite;
|
|
1472
|
+
readonly stderr: Schema.Finite;
|
|
1473
|
+
readonly bytes: Schema.Finite;
|
|
1340
1474
|
readonly samples: Schema.$Array<Schema.Struct<{
|
|
1341
1475
|
readonly stream: Schema.Literals<readonly ["stdout", "stderr"]>;
|
|
1342
1476
|
readonly text: Schema.String;
|
|
1343
1477
|
}>>;
|
|
1344
1478
|
}>>;
|
|
1479
|
+
/**
|
|
1480
|
+
* `console.*` output Vitest captured from tests that did not fail
|
|
1481
|
+
* (`AgentReport.consoleLeaks`). Optional: absent when the run logged
|
|
1482
|
+
* nothing, and in older replay data (issue #544).
|
|
1483
|
+
*/
|
|
1484
|
+
readonly consoleLeaks: Schema.optional<Schema.Struct<{
|
|
1485
|
+
readonly total: Schema.Finite;
|
|
1486
|
+
readonly byFile: Schema.$Array<Schema.Struct<{
|
|
1487
|
+
readonly file: Schema.String;
|
|
1488
|
+
readonly stdout: Schema.Finite;
|
|
1489
|
+
readonly stderr: Schema.Finite;
|
|
1490
|
+
readonly tests: Schema.optional<Schema.$Array<Schema.String>>;
|
|
1491
|
+
readonly sample: Schema.optional<Schema.String>;
|
|
1492
|
+
}>>;
|
|
1493
|
+
readonly truncated: Schema.optional<Schema.Boolean>;
|
|
1494
|
+
readonly fromFailingTests: Schema.optional<Schema.Struct<{
|
|
1495
|
+
readonly total: Schema.Finite;
|
|
1496
|
+
readonly files: Schema.Finite;
|
|
1497
|
+
}>>;
|
|
1498
|
+
}>>;
|
|
1345
1499
|
}>]>;
|
|
1346
1500
|
/** @public */
|
|
1347
1501
|
export type RunEvent = typeof RunEvent.Type;
|
|
@@ -1358,10 +1512,10 @@ export type RunEventByTag = { [E in RunEvent as E["_tag"]]: E; };
|
|
|
1358
1512
|
* @public
|
|
1359
1513
|
*/
|
|
1360
1514
|
export declare const MetricThresholds: Schema.Struct<{
|
|
1361
|
-
readonly lines: Schema.optional<Schema.
|
|
1362
|
-
readonly functions: Schema.optional<Schema.
|
|
1363
|
-
readonly branches: Schema.optional<Schema.
|
|
1364
|
-
readonly statements: Schema.optional<Schema.
|
|
1515
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
1516
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
1517
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
1518
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
1365
1519
|
}>;
|
|
1366
1520
|
/** @public */
|
|
1367
1521
|
export type MetricThresholds = typeof MetricThresholds.Type;
|
|
@@ -1375,10 +1529,10 @@ export type MetricThresholds = typeof MetricThresholds.Type;
|
|
|
1375
1529
|
* @public
|
|
1376
1530
|
*/
|
|
1377
1531
|
export declare const PerFileThresholds: Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
1378
|
-
readonly lines: Schema.optional<Schema.
|
|
1379
|
-
readonly functions: Schema.optional<Schema.
|
|
1380
|
-
readonly branches: Schema.optional<Schema.
|
|
1381
|
-
readonly statements: Schema.optional<Schema.
|
|
1532
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
1533
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
1534
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
1535
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
1382
1536
|
}>]>;
|
|
1383
1537
|
/** @public */
|
|
1384
1538
|
export type PerFileThresholds = typeof PerFileThresholds.Type;
|
|
@@ -1389,15 +1543,15 @@ export type PerFileThresholds = typeof PerFileThresholds.Type;
|
|
|
1389
1543
|
* @public
|
|
1390
1544
|
*/
|
|
1391
1545
|
export declare const PatternMetricThresholds: Schema.Struct<{
|
|
1392
|
-
readonly lines: Schema.optional<Schema.
|
|
1393
|
-
readonly functions: Schema.optional<Schema.
|
|
1394
|
-
readonly branches: Schema.optional<Schema.
|
|
1395
|
-
readonly statements: Schema.optional<Schema.
|
|
1546
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
1547
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
1548
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
1549
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
1396
1550
|
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
1397
|
-
readonly lines: Schema.optional<Schema.
|
|
1398
|
-
readonly functions: Schema.optional<Schema.
|
|
1399
|
-
readonly branches: Schema.optional<Schema.
|
|
1400
|
-
readonly statements: Schema.optional<Schema.
|
|
1551
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
1552
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
1553
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
1554
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
1401
1555
|
}>]>>;
|
|
1402
1556
|
}>;
|
|
1403
1557
|
/** @public */
|
|
@@ -1407,15 +1561,15 @@ export type PatternMetricThresholds = typeof PatternMetricThresholds.Type;
|
|
|
1407
1561
|
* @public
|
|
1408
1562
|
*/
|
|
1409
1563
|
export declare const PatternThresholds: Schema.Tuple<readonly [Schema.String, Schema.Struct<{
|
|
1410
|
-
readonly lines: Schema.optional<Schema.
|
|
1411
|
-
readonly functions: Schema.optional<Schema.
|
|
1412
|
-
readonly branches: Schema.optional<Schema.
|
|
1413
|
-
readonly statements: Schema.optional<Schema.
|
|
1564
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
1565
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
1566
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
1567
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
1414
1568
|
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
1415
|
-
readonly lines: Schema.optional<Schema.
|
|
1416
|
-
readonly functions: Schema.optional<Schema.
|
|
1417
|
-
readonly branches: Schema.optional<Schema.
|
|
1418
|
-
readonly statements: Schema.optional<Schema.
|
|
1569
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
1570
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
1571
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
1572
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
1419
1573
|
}>]>>;
|
|
1420
1574
|
}>]>;
|
|
1421
1575
|
/** @public */
|
|
@@ -1426,27 +1580,27 @@ export type PatternThresholds = typeof PatternThresholds.Type;
|
|
|
1426
1580
|
*/
|
|
1427
1581
|
export declare const ResolvedThresholds: Schema.Struct<{
|
|
1428
1582
|
readonly global: Schema.Struct<{
|
|
1429
|
-
readonly lines: Schema.optional<Schema.
|
|
1430
|
-
readonly functions: Schema.optional<Schema.
|
|
1431
|
-
readonly branches: Schema.optional<Schema.
|
|
1432
|
-
readonly statements: Schema.optional<Schema.
|
|
1583
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
1584
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
1585
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
1586
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
1433
1587
|
}>;
|
|
1434
1588
|
readonly perFile: Schema.withDecodingDefaultKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
1435
|
-
readonly lines: Schema.optional<Schema.
|
|
1436
|
-
readonly functions: Schema.optional<Schema.
|
|
1437
|
-
readonly branches: Schema.optional<Schema.
|
|
1438
|
-
readonly statements: Schema.optional<Schema.
|
|
1589
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
1590
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
1591
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
1592
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
1439
1593
|
}>]>, never>;
|
|
1440
1594
|
readonly patterns: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Struct<{
|
|
1441
|
-
readonly lines: Schema.optional<Schema.
|
|
1442
|
-
readonly functions: Schema.optional<Schema.
|
|
1443
|
-
readonly branches: Schema.optional<Schema.
|
|
1444
|
-
readonly statements: Schema.optional<Schema.
|
|
1595
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
1596
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
1597
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
1598
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
1445
1599
|
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
1446
|
-
readonly lines: Schema.optional<Schema.
|
|
1447
|
-
readonly functions: Schema.optional<Schema.
|
|
1448
|
-
readonly branches: Schema.optional<Schema.
|
|
1449
|
-
readonly statements: Schema.optional<Schema.
|
|
1600
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
1601
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
1602
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
1603
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
1450
1604
|
}>]>>;
|
|
1451
1605
|
}>]>>, never>;
|
|
1452
1606
|
}>;
|
|
@@ -1477,8 +1631,8 @@ export type Transport = typeof Transport.Type;
|
|
|
1477
1631
|
*
|
|
1478
1632
|
* `detail` is pre-resolved by the plugin (via `DetailResolver`) but
|
|
1479
1633
|
* reporters that want to override can ignore it. `noColor` is the resolved
|
|
1480
|
-
* value of the `NO_COLOR` env var; reporters use it to gate ANSI escapes
|
|
1481
|
-
*
|
|
1634
|
+
* value of the `NO_COLOR` env var; reporters use it to gate ANSI escapes
|
|
1635
|
+
* (hyperlinks are the kit's decision: `@effected/cli`'s `CliLinks`).
|
|
1482
1636
|
* @public
|
|
1483
1637
|
*/
|
|
1484
1638
|
export interface ResolvedReporterConfig {
|
|
@@ -1563,8 +1717,9 @@ export interface ResolvedReporterConfig {
|
|
|
1563
1717
|
* Plugin-provided primitives passed to the reporter factory at construction
|
|
1564
1718
|
* time. The `std*` prefix marks these as "the plugin gives you these — do
|
|
1565
1719
|
* not import equivalents yourself"; they are pre-resolved with full context
|
|
1566
|
-
* (environment, executor, NO_COLOR
|
|
1567
|
-
*
|
|
1720
|
+
* (environment, executor, NO_COLOR) so the reporter doesn't have to
|
|
1721
|
+
* re-derive that state. File hyperlinks are not among them: the reporter
|
|
1722
|
+
* reads `@effected/cli`'s `CliLinks` from its own environment.
|
|
1568
1723
|
*
|
|
1569
1724
|
* The shape is open to additions: future fields (e.g. `stdLogger`,
|
|
1570
1725
|
* `stdRuntime`) won't break existing reporters because the parameter is a
|
|
@@ -1574,12 +1729,6 @@ export interface ResolvedReporterConfig {
|
|
|
1574
1729
|
export interface ReporterKit {
|
|
1575
1730
|
readonly config: ResolvedReporterConfig;
|
|
1576
1731
|
readonly stdEnv: Environment;
|
|
1577
|
-
/**
|
|
1578
|
-
* Pre-bound OSC-8 hyperlink helper. The plugin has already decided
|
|
1579
|
-
* whether OSC-8 should be enabled (target=stdout, !noColor) so the
|
|
1580
|
-
* reporter can call this directly without consulting environment.
|
|
1581
|
-
*/
|
|
1582
|
-
readonly stdOsc8: (url: string, label: string) => string;
|
|
1583
1732
|
/**
|
|
1584
1733
|
* Live run-event channel. The plugin publishes one `RunEvent`
|
|
1585
1734
|
* per Vitest streaming callback (`onTestRunStart`, `onTestModuleStart`,
|
|
@@ -1610,6 +1759,15 @@ export interface ReporterKit {
|
|
|
1610
1759
|
export interface ReporterRenderInput {
|
|
1611
1760
|
readonly reports: ReadonlyArray<AgentReport>;
|
|
1612
1761
|
readonly classifications: ReadonlyMap<string, TestClassification>;
|
|
1762
|
+
/**
|
|
1763
|
+
* Run-level suggested actions for the agent (a `SuggestedAction` event
|
|
1764
|
+
* each), rendered as a compact `Actions:` list after the cell output. The
|
|
1765
|
+
* default reporter feeds them to the synthesizer for every report; absent
|
|
1766
|
+
* when the plugin has nothing to suggest (issue #544).
|
|
1767
|
+
*/
|
|
1768
|
+
readonly suggestedActions?: ReadonlyArray<SuggestedActionRecord>;
|
|
1769
|
+
/** Run-level diagnostics (performance hints, post-run timing, persistence status); absent when none were collected (issue #544). */
|
|
1770
|
+
readonly runDiagnostics?: RunDiagnostics;
|
|
1613
1771
|
readonly trendSummary?: {
|
|
1614
1772
|
readonly direction: "improving" | "regressing" | "stable";
|
|
1615
1773
|
readonly runCount: number;
|
|
@@ -1949,6 +2107,53 @@ export declare class ProjectIdentityNotResolvableError extends ProjectIdentityNo
|
|
|
1949
2107
|
readonly tried: ReadonlyArray<ProjectIdentityCandidate>;
|
|
1950
2108
|
});
|
|
1951
2109
|
}
|
|
2110
|
+
/**
|
|
2111
|
+
* Which identity source failed to be read or decoded.
|
|
2112
|
+
*
|
|
2113
|
+
* - `toml` — `vitest-agent.config.toml` was found but could not be read,
|
|
2114
|
+
* parsed, or did not satisfy `VitestAgentConfig`.
|
|
2115
|
+
* - `package-json` — the root `package.json` discovery named could not be
|
|
2116
|
+
* read (other than not existing) or is not valid JSON.
|
|
2117
|
+
* - `workspace` — workspace discovery itself failed inside a workspace (a
|
|
2118
|
+
* malformed manifest, an unexpandable `packages:` pattern); a directory
|
|
2119
|
+
* that sits in no workspace is not an error, it is an absent source.
|
|
2120
|
+
* @public
|
|
2121
|
+
*/
|
|
2122
|
+
export type ProjectIdentitySource = "toml" | "package-json" | "workspace";
|
|
2123
|
+
declare const ProjectIdentitySourceError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2124
|
+
readonly _tag: "ProjectIdentitySourceError";
|
|
2125
|
+
} & Readonly<A>;
|
|
2126
|
+
/**
|
|
2127
|
+
* Raised by `ProjectIdentity.resolve` when a source that IS present cannot
|
|
2128
|
+
* be used: a malformed `vitest-agent.config.toml`, an unreadable or
|
|
2129
|
+
* malformed root `package.json`, or a workspace manifest discovery rejects.
|
|
2130
|
+
*
|
|
2131
|
+
* Distinct from `ProjectIdentityNotResolvableError`, which means every
|
|
2132
|
+
* source was absent or empty. An operator with a broken config file must
|
|
2133
|
+
* see this rather than silently receive the default identity (issue 321);
|
|
2134
|
+
* `cause` carries the kit's structured failure for callers that branch on
|
|
2135
|
+
* it, and `detail` its one-line message.
|
|
2136
|
+
* @public
|
|
2137
|
+
*/
|
|
2138
|
+
export declare class ProjectIdentitySourceError extends ProjectIdentitySourceError_base<{
|
|
2139
|
+
readonly source: ProjectIdentitySource;
|
|
2140
|
+
readonly path: string;
|
|
2141
|
+
readonly detail: string;
|
|
2142
|
+
readonly cause: unknown;
|
|
2143
|
+
}> {
|
|
2144
|
+
constructor(args: {
|
|
2145
|
+
readonly source: ProjectIdentitySource;
|
|
2146
|
+
readonly path: string;
|
|
2147
|
+
readonly detail: string;
|
|
2148
|
+
readonly cause: unknown;
|
|
2149
|
+
});
|
|
2150
|
+
}
|
|
2151
|
+
/**
|
|
2152
|
+
* Every failure `ProjectIdentity.resolve` can surface: no source produced a
|
|
2153
|
+
* value, or a present source could not be used.
|
|
2154
|
+
* @public
|
|
2155
|
+
*/
|
|
2156
|
+
export type ProjectIdentityError = ProjectIdentityNotResolvableError | ProjectIdentitySourceError;
|
|
1952
2157
|
declare const GitCommandError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
1953
2158
|
readonly _tag: "GitCommandError";
|
|
1954
2159
|
} & Readonly<A>;
|
|
@@ -2124,21 +2329,21 @@ export interface AgentTreeNode {
|
|
|
2124
2329
|
export declare const CoverageBaselines: Schema.Struct<{
|
|
2125
2330
|
readonly updatedAt: Schema.String;
|
|
2126
2331
|
readonly global: Schema.Struct<{
|
|
2127
|
-
readonly lines: Schema.optional<Schema.
|
|
2128
|
-
readonly functions: Schema.optional<Schema.
|
|
2129
|
-
readonly branches: Schema.optional<Schema.
|
|
2130
|
-
readonly statements: Schema.optional<Schema.
|
|
2332
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
2333
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
2334
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
2335
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
2131
2336
|
}>;
|
|
2132
2337
|
readonly patterns: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Struct<{
|
|
2133
|
-
readonly lines: Schema.optional<Schema.
|
|
2134
|
-
readonly functions: Schema.optional<Schema.
|
|
2135
|
-
readonly branches: Schema.optional<Schema.
|
|
2136
|
-
readonly statements: Schema.optional<Schema.
|
|
2338
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
2339
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
2340
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
2341
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
2137
2342
|
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
2138
|
-
readonly lines: Schema.optional<Schema.
|
|
2139
|
-
readonly functions: Schema.optional<Schema.
|
|
2140
|
-
readonly branches: Schema.optional<Schema.
|
|
2141
|
-
readonly statements: Schema.optional<Schema.
|
|
2343
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
2344
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
2345
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
2346
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
2142
2347
|
}>]>>;
|
|
2143
2348
|
}>]>>, never>;
|
|
2144
2349
|
}>;
|
|
@@ -2500,8 +2705,8 @@ export declare class RunRetentionPolicy extends RunRetentionPolicy_base {
|
|
|
2500
2705
|
*/
|
|
2501
2706
|
export declare const ConsoleLeakFile: Schema.Struct<{
|
|
2502
2707
|
readonly file: Schema.String;
|
|
2503
|
-
readonly stdout: Schema.
|
|
2504
|
-
readonly stderr: Schema.
|
|
2708
|
+
readonly stdout: Schema.Finite;
|
|
2709
|
+
readonly stderr: Schema.Finite;
|
|
2505
2710
|
readonly tests: Schema.optional<Schema.$Array<Schema.String>>;
|
|
2506
2711
|
readonly sample: Schema.optional<Schema.String>;
|
|
2507
2712
|
}>;
|
|
@@ -2516,8 +2721,8 @@ export type ConsoleLeakFile = typeof ConsoleLeakFile.Type;
|
|
|
2516
2721
|
* @public
|
|
2517
2722
|
*/
|
|
2518
2723
|
export declare const ConsoleLeaksFromFailingTests: Schema.Struct<{
|
|
2519
|
-
readonly total: Schema.
|
|
2520
|
-
readonly files: Schema.
|
|
2724
|
+
readonly total: Schema.Finite;
|
|
2725
|
+
readonly files: Schema.Finite;
|
|
2521
2726
|
}>;
|
|
2522
2727
|
/** @public */
|
|
2523
2728
|
export type ConsoleLeaksFromFailingTests = typeof ConsoleLeaksFromFailingTests.Type;
|
|
@@ -2531,18 +2736,18 @@ export type ConsoleLeaksFromFailingTests = typeof ConsoleLeaksFromFailingTests.T
|
|
|
2531
2736
|
* @public
|
|
2532
2737
|
*/
|
|
2533
2738
|
export declare const ConsoleLeaks: Schema.Struct<{
|
|
2534
|
-
readonly total: Schema.
|
|
2739
|
+
readonly total: Schema.Finite;
|
|
2535
2740
|
readonly byFile: Schema.$Array<Schema.Struct<{
|
|
2536
2741
|
readonly file: Schema.String;
|
|
2537
|
-
readonly stdout: Schema.
|
|
2538
|
-
readonly stderr: Schema.
|
|
2742
|
+
readonly stdout: Schema.Finite;
|
|
2743
|
+
readonly stderr: Schema.Finite;
|
|
2539
2744
|
readonly tests: Schema.optional<Schema.$Array<Schema.String>>;
|
|
2540
2745
|
readonly sample: Schema.optional<Schema.String>;
|
|
2541
2746
|
}>>;
|
|
2542
2747
|
readonly truncated: Schema.optional<Schema.Boolean>;
|
|
2543
2748
|
readonly fromFailingTests: Schema.optional<Schema.Struct<{
|
|
2544
|
-
readonly total: Schema.
|
|
2545
|
-
readonly files: Schema.
|
|
2749
|
+
readonly total: Schema.Finite;
|
|
2750
|
+
readonly files: Schema.Finite;
|
|
2546
2751
|
}>>;
|
|
2547
2752
|
}>;
|
|
2548
2753
|
/** @public */
|
|
@@ -2621,10 +2826,10 @@ export declare const CoverageTargetsMetrics: Schema.Struct<{
|
|
|
2621
2826
|
readonly statements: Schema.optional<Schema.Number>;
|
|
2622
2827
|
readonly 100: Schema.optional<Schema.Literal<true>>;
|
|
2623
2828
|
readonly perFile: Schema.optional<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
2624
|
-
readonly lines: Schema.optional<Schema.
|
|
2625
|
-
readonly functions: Schema.optional<Schema.
|
|
2626
|
-
readonly branches: Schema.optional<Schema.
|
|
2627
|
-
readonly statements: Schema.optional<Schema.
|
|
2829
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
2830
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
2831
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
2832
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
2628
2833
|
}>]>>;
|
|
2629
2834
|
}>;
|
|
2630
2835
|
/** @public */
|
|
@@ -2653,10 +2858,10 @@ export declare const CoverageTargets: Schema.$Record<Schema.String, Schema.Union
|
|
|
2653
2858
|
readonly statements: Schema.optional<Schema.Number>;
|
|
2654
2859
|
readonly 100: Schema.optional<Schema.Literal<true>>;
|
|
2655
2860
|
readonly perFile: Schema.optional<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
2656
|
-
readonly lines: Schema.optional<Schema.
|
|
2657
|
-
readonly functions: Schema.optional<Schema.
|
|
2658
|
-
readonly branches: Schema.optional<Schema.
|
|
2659
|
-
readonly statements: Schema.optional<Schema.
|
|
2861
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
2862
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
2863
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
2864
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
2660
2865
|
}>]>>;
|
|
2661
2866
|
}>]>>;
|
|
2662
2867
|
/** @public */
|
|
@@ -2770,10 +2975,10 @@ export declare const AgentPluginOptions: Schema.Struct<{
|
|
|
2770
2975
|
readonly statements: Schema.optional<Schema.Number>;
|
|
2771
2976
|
readonly 100: Schema.optional<Schema.Literal<true>>;
|
|
2772
2977
|
readonly perFile: Schema.optional<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
2773
|
-
readonly lines: Schema.optional<Schema.
|
|
2774
|
-
readonly functions: Schema.optional<Schema.
|
|
2775
|
-
readonly branches: Schema.optional<Schema.
|
|
2776
|
-
readonly statements: Schema.optional<Schema.
|
|
2978
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
2979
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
2980
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
2981
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
2777
2982
|
}>]>>;
|
|
2778
2983
|
}>]>>>;
|
|
2779
2984
|
readonly transport: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -2857,17 +3062,17 @@ export declare const RunReportFile: Schema.Struct<{
|
|
|
2857
3062
|
readonly project: Schema.optional<Schema.String>;
|
|
2858
3063
|
readonly reason: Schema.Literals<readonly ["passed", "failed", "interrupted"]>;
|
|
2859
3064
|
readonly summary: Schema.Struct<{
|
|
2860
|
-
readonly total: Schema.
|
|
2861
|
-
readonly passed: Schema.
|
|
2862
|
-
readonly failed: Schema.
|
|
2863
|
-
readonly skipped: Schema.
|
|
2864
|
-
readonly duration: Schema.
|
|
2865
|
-
readonly modules: Schema.optional<Schema.
|
|
3065
|
+
readonly total: Schema.Finite;
|
|
3066
|
+
readonly passed: Schema.Finite;
|
|
3067
|
+
readonly failed: Schema.Finite;
|
|
3068
|
+
readonly skipped: Schema.Finite;
|
|
3069
|
+
readonly duration: Schema.Finite;
|
|
3070
|
+
readonly modules: Schema.optional<Schema.Finite>;
|
|
2866
3071
|
}>;
|
|
2867
3072
|
readonly failed: Schema.$Array<Schema.Struct<{
|
|
2868
3073
|
readonly file: Schema.String;
|
|
2869
3074
|
readonly state: Schema.Literals<readonly ["passed", "failed", "skipped", "pending"]>;
|
|
2870
|
-
readonly duration: Schema.optional<Schema.
|
|
3075
|
+
readonly duration: Schema.optional<Schema.Finite>;
|
|
2871
3076
|
readonly errors: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
2872
3077
|
readonly message: Schema.String;
|
|
2873
3078
|
readonly stack: Schema.optional<Schema.String>;
|
|
@@ -2879,7 +3084,7 @@ export declare const RunReportFile: Schema.Struct<{
|
|
|
2879
3084
|
readonly name: Schema.String;
|
|
2880
3085
|
readonly fullName: Schema.String;
|
|
2881
3086
|
readonly state: Schema.Literals<readonly ["passed", "failed", "skipped", "pending"]>;
|
|
2882
|
-
readonly duration: Schema.optional<Schema.
|
|
3087
|
+
readonly duration: Schema.optional<Schema.Finite>;
|
|
2883
3088
|
readonly flaky: Schema.optional<Schema.Boolean>;
|
|
2884
3089
|
readonly slow: Schema.optional<Schema.Boolean>;
|
|
2885
3090
|
readonly errors: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
@@ -2902,81 +3107,81 @@ export declare const RunReportFile: Schema.Struct<{
|
|
|
2902
3107
|
readonly failedFiles: Schema.$Array<Schema.String>;
|
|
2903
3108
|
readonly coverage: Schema.optional<Schema.Struct<{
|
|
2904
3109
|
readonly totals: Schema.Struct<{
|
|
2905
|
-
readonly statements: Schema.
|
|
2906
|
-
readonly branches: Schema.
|
|
2907
|
-
readonly functions: Schema.
|
|
2908
|
-
readonly lines: Schema.
|
|
3110
|
+
readonly statements: Schema.Finite;
|
|
3111
|
+
readonly branches: Schema.Finite;
|
|
3112
|
+
readonly functions: Schema.Finite;
|
|
3113
|
+
readonly lines: Schema.Finite;
|
|
2909
3114
|
}>;
|
|
2910
3115
|
readonly thresholds: Schema.Struct<{
|
|
2911
3116
|
readonly global: Schema.Struct<{
|
|
2912
|
-
readonly lines: Schema.optional<Schema.
|
|
2913
|
-
readonly functions: Schema.optional<Schema.
|
|
2914
|
-
readonly branches: Schema.optional<Schema.
|
|
2915
|
-
readonly statements: Schema.optional<Schema.
|
|
3117
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
3118
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
3119
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
3120
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
2916
3121
|
}>;
|
|
2917
3122
|
readonly patterns: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Struct<{
|
|
2918
|
-
readonly lines: Schema.optional<Schema.
|
|
2919
|
-
readonly functions: Schema.optional<Schema.
|
|
2920
|
-
readonly branches: Schema.optional<Schema.
|
|
2921
|
-
readonly statements: Schema.optional<Schema.
|
|
3123
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
3124
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
3125
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
3126
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
2922
3127
|
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
2923
|
-
readonly lines: Schema.optional<Schema.
|
|
2924
|
-
readonly functions: Schema.optional<Schema.
|
|
2925
|
-
readonly branches: Schema.optional<Schema.
|
|
2926
|
-
readonly statements: Schema.optional<Schema.
|
|
3128
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
3129
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
3130
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
3131
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
2927
3132
|
}>]>>;
|
|
2928
3133
|
}>]>>, never>;
|
|
2929
3134
|
}>;
|
|
2930
3135
|
readonly targets: Schema.optional<Schema.Struct<{
|
|
2931
3136
|
readonly global: Schema.Struct<{
|
|
2932
|
-
readonly lines: Schema.optional<Schema.
|
|
2933
|
-
readonly functions: Schema.optional<Schema.
|
|
2934
|
-
readonly branches: Schema.optional<Schema.
|
|
2935
|
-
readonly statements: Schema.optional<Schema.
|
|
3137
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
3138
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
3139
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
3140
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
2936
3141
|
}>;
|
|
2937
3142
|
readonly patterns: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Struct<{
|
|
2938
|
-
readonly lines: Schema.optional<Schema.
|
|
2939
|
-
readonly functions: Schema.optional<Schema.
|
|
2940
|
-
readonly branches: Schema.optional<Schema.
|
|
2941
|
-
readonly statements: Schema.optional<Schema.
|
|
3143
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
3144
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
3145
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
3146
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
2942
3147
|
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
2943
|
-
readonly lines: Schema.optional<Schema.
|
|
2944
|
-
readonly functions: Schema.optional<Schema.
|
|
2945
|
-
readonly branches: Schema.optional<Schema.
|
|
2946
|
-
readonly statements: Schema.optional<Schema.
|
|
3148
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
3149
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
3150
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
3151
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
2947
3152
|
}>]>>;
|
|
2948
3153
|
}>]>>, never>;
|
|
2949
3154
|
}>>;
|
|
2950
3155
|
readonly baselines: Schema.optional<Schema.Struct<{
|
|
2951
3156
|
readonly global: Schema.Struct<{
|
|
2952
|
-
readonly lines: Schema.optional<Schema.
|
|
2953
|
-
readonly functions: Schema.optional<Schema.
|
|
2954
|
-
readonly branches: Schema.optional<Schema.
|
|
2955
|
-
readonly statements: Schema.optional<Schema.
|
|
3157
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
3158
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
3159
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
3160
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
2956
3161
|
}>;
|
|
2957
3162
|
readonly patterns: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Struct<{
|
|
2958
|
-
readonly lines: Schema.optional<Schema.
|
|
2959
|
-
readonly functions: Schema.optional<Schema.
|
|
2960
|
-
readonly branches: Schema.optional<Schema.
|
|
2961
|
-
readonly statements: Schema.optional<Schema.
|
|
3163
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
3164
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
3165
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
3166
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
2962
3167
|
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
2963
|
-
readonly lines: Schema.optional<Schema.
|
|
2964
|
-
readonly functions: Schema.optional<Schema.
|
|
2965
|
-
readonly branches: Schema.optional<Schema.
|
|
2966
|
-
readonly statements: Schema.optional<Schema.
|
|
3168
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
3169
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
3170
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
3171
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
2967
3172
|
}>]>>;
|
|
2968
3173
|
}>]>>, never>;
|
|
2969
3174
|
}>>;
|
|
2970
3175
|
readonly scoped: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
2971
3176
|
readonly scopedFiles: Schema.optional<Schema.$Array<Schema.String>>;
|
|
2972
|
-
readonly totalFiles: Schema.optional<Schema.
|
|
3177
|
+
readonly totalFiles: Schema.optional<Schema.Finite>;
|
|
2973
3178
|
readonly lowCoverage: Schema.$Array<Schema.Struct<{
|
|
2974
3179
|
readonly file: Schema.String;
|
|
2975
3180
|
readonly summary: Schema.Struct<{
|
|
2976
|
-
readonly statements: Schema.
|
|
2977
|
-
readonly branches: Schema.
|
|
2978
|
-
readonly functions: Schema.
|
|
2979
|
-
readonly lines: Schema.
|
|
3181
|
+
readonly statements: Schema.Finite;
|
|
3182
|
+
readonly branches: Schema.Finite;
|
|
3183
|
+
readonly functions: Schema.Finite;
|
|
3184
|
+
readonly lines: Schema.Finite;
|
|
2980
3185
|
}>;
|
|
2981
3186
|
readonly uncoveredLines: Schema.String;
|
|
2982
3187
|
}>>;
|
|
@@ -2984,10 +3189,10 @@ export declare const RunReportFile: Schema.Struct<{
|
|
|
2984
3189
|
readonly belowTarget: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
2985
3190
|
readonly file: Schema.String;
|
|
2986
3191
|
readonly summary: Schema.Struct<{
|
|
2987
|
-
readonly statements: Schema.
|
|
2988
|
-
readonly branches: Schema.
|
|
2989
|
-
readonly functions: Schema.
|
|
2990
|
-
readonly lines: Schema.
|
|
3192
|
+
readonly statements: Schema.Finite;
|
|
3193
|
+
readonly branches: Schema.Finite;
|
|
3194
|
+
readonly functions: Schema.Finite;
|
|
3195
|
+
readonly lines: Schema.Finite;
|
|
2991
3196
|
}>;
|
|
2992
3197
|
readonly uncoveredLines: Schema.String;
|
|
2993
3198
|
}>>>;
|
|
@@ -2995,50 +3200,74 @@ export declare const RunReportFile: Schema.Struct<{
|
|
|
2995
3200
|
readonly globShortfalls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
2996
3201
|
readonly pattern: Schema.String;
|
|
2997
3202
|
readonly summary: Schema.Struct<{
|
|
2998
|
-
readonly statements: Schema.
|
|
2999
|
-
readonly branches: Schema.
|
|
3000
|
-
readonly functions: Schema.
|
|
3001
|
-
readonly lines: Schema.
|
|
3203
|
+
readonly statements: Schema.Finite;
|
|
3204
|
+
readonly branches: Schema.Finite;
|
|
3205
|
+
readonly functions: Schema.Finite;
|
|
3206
|
+
readonly lines: Schema.Finite;
|
|
3002
3207
|
}>;
|
|
3003
3208
|
readonly thresholds: Schema.Struct<{
|
|
3004
|
-
readonly lines: Schema.optional<Schema.
|
|
3005
|
-
readonly functions: Schema.optional<Schema.
|
|
3006
|
-
readonly branches: Schema.optional<Schema.
|
|
3007
|
-
readonly statements: Schema.optional<Schema.
|
|
3209
|
+
readonly lines: Schema.optional<Schema.Finite>;
|
|
3210
|
+
readonly functions: Schema.optional<Schema.Finite>;
|
|
3211
|
+
readonly branches: Schema.optional<Schema.Finite>;
|
|
3212
|
+
readonly statements: Schema.optional<Schema.Finite>;
|
|
3008
3213
|
}>;
|
|
3009
3214
|
}>>>;
|
|
3010
3215
|
}>>;
|
|
3011
3216
|
readonly tagCounts: Schema.optional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
3012
|
-
readonly passed: Schema.optional<Schema.
|
|
3013
|
-
readonly failed: Schema.optional<Schema.
|
|
3014
|
-
readonly skipped: Schema.optional<Schema.
|
|
3217
|
+
readonly passed: Schema.optional<Schema.Finite>;
|
|
3218
|
+
readonly failed: Schema.optional<Schema.Finite>;
|
|
3219
|
+
readonly skipped: Schema.optional<Schema.Finite>;
|
|
3015
3220
|
}>>>;
|
|
3016
3221
|
readonly consoleLeaks: Schema.optional<Schema.Struct<{
|
|
3017
|
-
readonly total: Schema.
|
|
3222
|
+
readonly total: Schema.Finite;
|
|
3018
3223
|
readonly byFile: Schema.$Array<Schema.Struct<{
|
|
3019
3224
|
readonly file: Schema.String;
|
|
3020
|
-
readonly stdout: Schema.
|
|
3021
|
-
readonly stderr: Schema.
|
|
3225
|
+
readonly stdout: Schema.Finite;
|
|
3226
|
+
readonly stderr: Schema.Finite;
|
|
3022
3227
|
readonly tests: Schema.optional<Schema.$Array<Schema.String>>;
|
|
3023
3228
|
readonly sample: Schema.optional<Schema.String>;
|
|
3024
3229
|
}>>;
|
|
3025
3230
|
readonly truncated: Schema.optional<Schema.Boolean>;
|
|
3026
3231
|
readonly fromFailingTests: Schema.optional<Schema.Struct<{
|
|
3027
|
-
readonly total: Schema.
|
|
3028
|
-
readonly files: Schema.
|
|
3232
|
+
readonly total: Schema.Finite;
|
|
3233
|
+
readonly files: Schema.Finite;
|
|
3029
3234
|
}>>;
|
|
3030
3235
|
}>>;
|
|
3031
3236
|
readonly strayOutput: Schema.optional<Schema.Struct<{
|
|
3032
|
-
readonly total: Schema.
|
|
3033
|
-
readonly stdout: Schema.
|
|
3034
|
-
readonly stderr: Schema.
|
|
3035
|
-
readonly bytes: Schema.
|
|
3237
|
+
readonly total: Schema.Finite;
|
|
3238
|
+
readonly stdout: Schema.Finite;
|
|
3239
|
+
readonly stderr: Schema.Finite;
|
|
3240
|
+
readonly bytes: Schema.Finite;
|
|
3036
3241
|
readonly samples: Schema.$Array<Schema.Struct<{
|
|
3037
3242
|
readonly stream: Schema.Literals<readonly ["stdout", "stderr"]>;
|
|
3038
3243
|
readonly text: Schema.String;
|
|
3039
3244
|
}>>;
|
|
3040
3245
|
}>>;
|
|
3041
3246
|
}>>;
|
|
3247
|
+
readonly runDiagnostics: Schema.optionalKey<Schema.Struct<{
|
|
3248
|
+
readonly performanceHints: Schema.$Array<Schema.Struct<{
|
|
3249
|
+
readonly kind: Schema.Literals<readonly ["environment", "import", "transform", "isolate"]>;
|
|
3250
|
+
readonly project: Schema.optionalKey<Schema.String>;
|
|
3251
|
+
readonly message: Schema.String;
|
|
3252
|
+
readonly remedy: Schema.String;
|
|
3253
|
+
readonly detail: Schema.String;
|
|
3254
|
+
readonly learnMoreUrl: Schema.String;
|
|
3255
|
+
readonly estimatedSavingMs: Schema.optionalKey<Schema.Finite>;
|
|
3256
|
+
readonly share: Schema.optionalKey<Schema.Finite>;
|
|
3257
|
+
}>>;
|
|
3258
|
+
readonly postRun: Schema.optionalKey<Schema.Struct<{
|
|
3259
|
+
readonly persistMs: Schema.Finite;
|
|
3260
|
+
readonly coverageScanMs: Schema.Finite;
|
|
3261
|
+
readonly totalMs: Schema.Finite;
|
|
3262
|
+
readonly renderMs: Schema.optionalKey<Schema.Finite>;
|
|
3263
|
+
readonly vitestDurationMs: Schema.optionalKey<Schema.Finite>;
|
|
3264
|
+
}>>;
|
|
3265
|
+
readonly persistence: Schema.optionalKey<Schema.Struct<{
|
|
3266
|
+
readonly ok: Schema.Boolean;
|
|
3267
|
+
readonly reason: Schema.optionalKey<Schema.String>;
|
|
3268
|
+
readonly migrationFailed: Schema.optionalKey<Schema.Boolean>;
|
|
3269
|
+
}>>;
|
|
3270
|
+
}>>;
|
|
3042
3271
|
}>;
|
|
3043
3272
|
/** @public */
|
|
3044
3273
|
export type RunReportFile = typeof RunReportFile.Type;
|
|
@@ -3070,10 +3299,10 @@ export type StrayOutputSample = typeof StrayOutputSample.Type;
|
|
|
3070
3299
|
* @public
|
|
3071
3300
|
*/
|
|
3072
3301
|
export declare const StrayOutput: Schema.Struct<{
|
|
3073
|
-
readonly total: Schema.
|
|
3074
|
-
readonly stdout: Schema.
|
|
3075
|
-
readonly stderr: Schema.
|
|
3076
|
-
readonly bytes: Schema.
|
|
3302
|
+
readonly total: Schema.Finite;
|
|
3303
|
+
readonly stdout: Schema.Finite;
|
|
3304
|
+
readonly stderr: Schema.Finite;
|
|
3305
|
+
readonly bytes: Schema.Finite;
|
|
3077
3306
|
readonly samples: Schema.$Array<Schema.Struct<{
|
|
3078
3307
|
readonly stream: Schema.Literals<readonly ["stdout", "stderr"]>;
|
|
3079
3308
|
readonly text: Schema.String;
|
|
@@ -3254,16 +3483,16 @@ export type TestArtifact = typeof TestArtifact.Type;
|
|
|
3254
3483
|
export declare const TrendEntry: Schema.Struct<{
|
|
3255
3484
|
readonly timestamp: Schema.String;
|
|
3256
3485
|
readonly coverage: Schema.Struct<{
|
|
3257
|
-
readonly statements: Schema.
|
|
3258
|
-
readonly branches: Schema.
|
|
3259
|
-
readonly functions: Schema.
|
|
3260
|
-
readonly lines: Schema.
|
|
3486
|
+
readonly statements: Schema.Finite;
|
|
3487
|
+
readonly branches: Schema.Finite;
|
|
3488
|
+
readonly functions: Schema.Finite;
|
|
3489
|
+
readonly lines: Schema.Finite;
|
|
3261
3490
|
}>;
|
|
3262
3491
|
readonly delta: Schema.Struct<{
|
|
3263
|
-
readonly statements: Schema.
|
|
3264
|
-
readonly branches: Schema.
|
|
3265
|
-
readonly functions: Schema.
|
|
3266
|
-
readonly lines: Schema.
|
|
3492
|
+
readonly statements: Schema.Finite;
|
|
3493
|
+
readonly branches: Schema.Finite;
|
|
3494
|
+
readonly functions: Schema.Finite;
|
|
3495
|
+
readonly lines: Schema.Finite;
|
|
3267
3496
|
}>;
|
|
3268
3497
|
readonly direction: Schema.Literals<readonly ["improving", "regressing", "stable"]>;
|
|
3269
3498
|
readonly targetsHash: Schema.optional<Schema.String>;
|
|
@@ -3278,16 +3507,16 @@ export declare const TrendRecord: Schema.Struct<{
|
|
|
3278
3507
|
readonly entries: Schema.$Array<Schema.Struct<{
|
|
3279
3508
|
readonly timestamp: Schema.String;
|
|
3280
3509
|
readonly coverage: Schema.Struct<{
|
|
3281
|
-
readonly statements: Schema.
|
|
3282
|
-
readonly branches: Schema.
|
|
3283
|
-
readonly functions: Schema.
|
|
3284
|
-
readonly lines: Schema.
|
|
3510
|
+
readonly statements: Schema.Finite;
|
|
3511
|
+
readonly branches: Schema.Finite;
|
|
3512
|
+
readonly functions: Schema.Finite;
|
|
3513
|
+
readonly lines: Schema.Finite;
|
|
3285
3514
|
}>;
|
|
3286
3515
|
readonly delta: Schema.Struct<{
|
|
3287
|
-
readonly statements: Schema.
|
|
3288
|
-
readonly branches: Schema.
|
|
3289
|
-
readonly functions: Schema.
|
|
3290
|
-
readonly lines: Schema.
|
|
3516
|
+
readonly statements: Schema.Finite;
|
|
3517
|
+
readonly branches: Schema.Finite;
|
|
3518
|
+
readonly functions: Schema.Finite;
|
|
3519
|
+
readonly lines: Schema.Finite;
|
|
3291
3520
|
}>;
|
|
3292
3521
|
readonly direction: Schema.Literals<readonly ["improving", "regressing", "stable"]>;
|
|
3293
3522
|
readonly targetsHash: Schema.optional<Schema.String>;
|
|
@@ -3403,34 +3632,6 @@ export declare const TurnPayload: Schema.Union<readonly [Schema.Struct<{
|
|
|
3403
3632
|
}>]>;
|
|
3404
3633
|
/** @public */
|
|
3405
3634
|
export type TurnPayload = typeof TurnPayload.Type;
|
|
3406
|
-
/**
|
|
3407
|
-
* Options for ANSI color output control.
|
|
3408
|
-
*
|
|
3409
|
-
* @internal
|
|
3410
|
-
*/
|
|
3411
|
-
export interface AnsiOptions {
|
|
3412
|
-
noColor?: boolean;
|
|
3413
|
-
}
|
|
3414
|
-
/**
|
|
3415
|
-
* Wrap text with an ANSI color/style escape code.
|
|
3416
|
-
*
|
|
3417
|
-
* No-ops when `options.noColor` is true, keeping output as valid plain
|
|
3418
|
-
* markdown when captured by agents or piped to files.
|
|
3419
|
-
*
|
|
3420
|
-
* @privateRemarks
|
|
3421
|
-
* Uses raw ANSI escape sequences (`\x1b[...m`) rather than a dependency
|
|
3422
|
-
* like `chalk` or `picocolors` to keep the package zero-dependency. The
|
|
3423
|
-
* `noColor` flag respects the `NO_COLOR` environment variable convention.
|
|
3424
|
-
*
|
|
3425
|
-
* @param text - Text to wrap
|
|
3426
|
-
* @param color - ANSI code name: `reset`, `bold`, `dim`, `red`, `green`, `yellow`, `cyan`
|
|
3427
|
-
* @param options - Control color output
|
|
3428
|
-
* @returns Text with ANSI escape codes, or plain text if noColor
|
|
3429
|
-
*
|
|
3430
|
-
* @see {@link https://no-color.org/ | NO_COLOR convention}
|
|
3431
|
-
* @internal
|
|
3432
|
-
*/
|
|
3433
|
-
export declare function ansi(text: string, color: string, options?: AnsiOptions): string;
|
|
3434
3635
|
/**
|
|
3435
3636
|
* Strip all ANSI escape codes from a string.
|
|
3436
3637
|
*
|
|
@@ -3692,33 +3893,6 @@ export declare const coerceErrorText: (value: unknown) => string | undefined;
|
|
|
3692
3893
|
* @public
|
|
3693
3894
|
*/
|
|
3694
3895
|
export declare const coerceErrorField: (source: unknown, key: string) => string | undefined;
|
|
3695
|
-
/**
|
|
3696
|
-
* Compress an array of line numbers into a compact range string.
|
|
3697
|
-
*
|
|
3698
|
-
* Consecutive line numbers are collapsed into `start-end` ranges,
|
|
3699
|
-
* separated by commas. Duplicate values are removed and the input
|
|
3700
|
-
* is sorted ascending before processing.
|
|
3701
|
-
*
|
|
3702
|
-
* @param lines - Array of line numbers to compress
|
|
3703
|
-
* @returns Compressed range string, or empty string for empty input
|
|
3704
|
-
*
|
|
3705
|
-
* @example
|
|
3706
|
-
* ```typescript
|
|
3707
|
-
* import { compressLines } from "@vitest-agent/sdk/utils";
|
|
3708
|
-
*
|
|
3709
|
-
* compressLines([1, 2, 3, 5, 10, 11, 12]);
|
|
3710
|
-
* // Returns: "1-3,5,10-12"
|
|
3711
|
-
*
|
|
3712
|
-
* compressLines([42]);
|
|
3713
|
-
* // Returns: "42"
|
|
3714
|
-
*
|
|
3715
|
-
* compressLines([]);
|
|
3716
|
-
* // Returns: ""
|
|
3717
|
-
* ```
|
|
3718
|
-
*
|
|
3719
|
-
* @public
|
|
3720
|
-
*/
|
|
3721
|
-
export declare function compressLines(lines: number[]): string;
|
|
3722
3896
|
/**
|
|
3723
3897
|
* Hash resolved targets to detect configuration changes.
|
|
3724
3898
|
*
|
|
@@ -3810,6 +3984,15 @@ export interface ConsoleLeakTask {
|
|
|
3810
3984
|
* @public
|
|
3811
3985
|
*/
|
|
3812
3986
|
export declare function collectConsoleLeakEntries(files: ReadonlyArray<ConsoleLeakTask>): ConsoleLeakEntry[];
|
|
3987
|
+
/**
|
|
3988
|
+
* The note a renderer prints for a run's console leaks: one line naming the
|
|
3989
|
+
* write count, the file count and the fix, then up to three files with
|
|
3990
|
+
* their stream split and sample, how many files it left out, and the output
|
|
3991
|
+
* from failing tests that the leak count excludes. Empty when the run has no
|
|
3992
|
+
* leak from a passing test (output from failing tests alone is not a leak).
|
|
3993
|
+
* @public
|
|
3994
|
+
*/
|
|
3995
|
+
export declare const formatConsoleLeaksNote: (leaks: ConsoleLeaks) => ReadonlyArray<string>;
|
|
3813
3996
|
/**
|
|
3814
3997
|
* Lexically detects whether a Vitest/Vite config source text appears to
|
|
3815
3998
|
* configure a non-default `DiscoverStrategy` — a custom `discoverStrategy`
|
|
@@ -3825,66 +4008,6 @@ export declare function collectConsoleLeakEntries(files: ReadonlyArray<ConsoleLe
|
|
|
3825
4008
|
* @public
|
|
3826
4009
|
*/
|
|
3827
4010
|
export declare function detectNonDefaultDiscoverStrategy(source: string): boolean;
|
|
3828
|
-
/**
|
|
3829
|
-
* Filesystem abstraction for package manager detection.
|
|
3830
|
-
*
|
|
3831
|
-
* @remarks
|
|
3832
|
-
* This interface allows dependency injection for testability. In production,
|
|
3833
|
-
* pass an adapter backed by `node:fs/promises`. In tests, provide a mock
|
|
3834
|
-
* implementation.
|
|
3835
|
-
*
|
|
3836
|
-
* @example
|
|
3837
|
-
* ```typescript
|
|
3838
|
-
* import type { FileSystemAdapter } from "@vitest-agent/sdk/detect-pm";
|
|
3839
|
-
* import { readFile, access } from "node:fs/promises";
|
|
3840
|
-
*
|
|
3841
|
-
* const fsAdapter: FileSystemAdapter = {
|
|
3842
|
-
* readFile: (path: string) => readFile(path, "utf-8"),
|
|
3843
|
-
* exists: async (path: string) => {
|
|
3844
|
-
* try {
|
|
3845
|
-
* await access(path);
|
|
3846
|
-
* return true;
|
|
3847
|
-
* } catch {
|
|
3848
|
-
* return false;
|
|
3849
|
-
* }
|
|
3850
|
-
* },
|
|
3851
|
-
* };
|
|
3852
|
-
* ```
|
|
3853
|
-
*
|
|
3854
|
-
* @internal
|
|
3855
|
-
*/
|
|
3856
|
-
export interface FileSystemAdapter {
|
|
3857
|
-
readFile(path: string): Promise<string>;
|
|
3858
|
-
exists(path: string): Promise<boolean>;
|
|
3859
|
-
}
|
|
3860
|
-
/**
|
|
3861
|
-
* Detect the package manager used in a project by inspecting the root directory.
|
|
3862
|
-
*
|
|
3863
|
-
* @remarks
|
|
3864
|
-
* Detection order:
|
|
3865
|
-
* 1. The `packageManager` field in `package.json` (e.g., `"pnpm\@10.32.1"`)
|
|
3866
|
-
* 2. Lockfile presence: `pnpm-lock.yaml`, `package-lock.json`, `yarn.lock`, `bun.lock`
|
|
3867
|
-
*
|
|
3868
|
-
* Returns `null` when no package manager can be determined.
|
|
3869
|
-
*
|
|
3870
|
-
* @param root - Absolute path to the project root directory
|
|
3871
|
-
* @param fs - Filesystem adapter for reading files and checking existence
|
|
3872
|
-
* @returns The detected package manager, or `null`
|
|
3873
|
-
*
|
|
3874
|
-
* @internal
|
|
3875
|
-
*/
|
|
3876
|
-
export declare function detectPackageManager(root: string, fs: FileSystemAdapter): Promise<PackageManager | null>;
|
|
3877
|
-
/**
|
|
3878
|
-
* Return the vitest run command for the given package manager.
|
|
3879
|
-
*
|
|
3880
|
-
* Falls back to `"npx vitest run"` when `pm` is `null`.
|
|
3881
|
-
*
|
|
3882
|
-
* @param pm - Detected package manager, or `null` for unknown
|
|
3883
|
-
* @returns Shell command string for running vitest
|
|
3884
|
-
*
|
|
3885
|
-
* @internal
|
|
3886
|
-
*/
|
|
3887
|
-
export declare function getRunCommand(pm: PackageManager | null): string;
|
|
3888
4011
|
/**
|
|
3889
4012
|
* True when the error looks like a Vitest test or hook timeout. Either
|
|
3890
4013
|
* the message matches "timed out in Nms" or the error name contains
|
|
@@ -3895,132 +4018,6 @@ export declare const isTimeoutError: (error: {
|
|
|
3895
4018
|
message?: string;
|
|
3896
4019
|
name?: string;
|
|
3897
4020
|
}) => boolean;
|
|
3898
|
-
/**
|
|
3899
|
-
* Options controlling console markdown output formatting.
|
|
3900
|
-
*
|
|
3901
|
-
* @internal
|
|
3902
|
-
*/
|
|
3903
|
-
export interface ConsoleFormatOptions {
|
|
3904
|
-
/** Absolute project root; stripped from file paths for display. */
|
|
3905
|
-
cwd: string;
|
|
3906
|
-
/** Output verbosity: `"failures"` (default), `"full"`, or `"silent"`. */
|
|
3907
|
-
consoleOutput: "failures" | "full" | "silent";
|
|
3908
|
-
/** Maximum number of low-coverage files to show in console output. */
|
|
3909
|
-
coverageConsoleLimit: number;
|
|
3910
|
-
/** When `true`, suppress ANSI color codes for valid plain markdown. */
|
|
3911
|
-
noColor: boolean;
|
|
3912
|
-
/** Optional trend summary for tiered coverage output. */
|
|
3913
|
-
trendSummary?: {
|
|
3914
|
-
direction: "improving" | "regressing" | "stable";
|
|
3915
|
-
runCount: number;
|
|
3916
|
-
firstMetric?: {
|
|
3917
|
-
name: string;
|
|
3918
|
-
from: number;
|
|
3919
|
-
to: number;
|
|
3920
|
-
target?: number;
|
|
3921
|
-
};
|
|
3922
|
-
};
|
|
3923
|
-
/** CLI run command prefix for coverage/trends hints (e.g., `"pnpm vitest-agent"`). */
|
|
3924
|
-
runCommand?: string;
|
|
3925
|
-
/** When true, suggest MCP tools instead of CLI commands in Next Steps. */
|
|
3926
|
-
mcp?: boolean;
|
|
3927
|
-
}
|
|
3928
|
-
/**
|
|
3929
|
-
* Return the metric with the lowest percentage from a `FileCoverageReport`.
|
|
3930
|
-
*
|
|
3931
|
-
* @remarks
|
|
3932
|
-
* Used to surface the single worst coverage metric per file in console output,
|
|
3933
|
-
* keeping the display compact. Labels are abbreviated: `"Stmts"`, `"Branch"`,
|
|
3934
|
-
* `"Funcs"`, `"Lines"`.
|
|
3935
|
-
*
|
|
3936
|
-
* @param f - File coverage report to analyze
|
|
3937
|
-
* @returns Object with `label` and `pct` of the worst metric
|
|
3938
|
-
*
|
|
3939
|
-
* @internal
|
|
3940
|
-
*/
|
|
3941
|
-
export declare function getWorstMetric(f: FileCoverageReport): {
|
|
3942
|
-
label: string;
|
|
3943
|
-
pct: number;
|
|
3944
|
-
};
|
|
3945
|
-
/**
|
|
3946
|
-
* Strip the working directory prefix from a file path to produce a
|
|
3947
|
-
* project-relative path for display.
|
|
3948
|
-
*
|
|
3949
|
-
* @param filePath - Absolute or relative file path
|
|
3950
|
-
* @param cwd - Working directory to strip
|
|
3951
|
-
* @returns Project-relative path string
|
|
3952
|
-
*
|
|
3953
|
-
* @internal
|
|
3954
|
-
*/
|
|
3955
|
-
export declare function relativePath(filePath: string, cwd: string): string;
|
|
3956
|
-
/**
|
|
3957
|
-
* Determine the output tier based on test results and coverage state.
|
|
3958
|
-
*
|
|
3959
|
-
* - `"red"` -- failures, unhandled errors, or files below threshold
|
|
3960
|
-
* - `"yellow"` -- all tests pass but coverage targets exist (room to improve)
|
|
3961
|
-
* - `"green"` -- all tests pass, all coverage targets met
|
|
3962
|
-
*
|
|
3963
|
-
* @internal
|
|
3964
|
-
*/
|
|
3965
|
-
export declare function determineTier(report: AgentReport): "green" | "yellow" | "red";
|
|
3966
|
-
/**
|
|
3967
|
-
* Format an {@link (AgentReport:variable)} as compact, actionable console markdown.
|
|
3968
|
-
*
|
|
3969
|
-
* @remarks
|
|
3970
|
-
* The output is structured for LLM agent consumption with four sections:
|
|
3971
|
-
*
|
|
3972
|
-
* 1. **Compact header** with pass/fail counts and duration
|
|
3973
|
-
* 2. **Failed test details** with error messages and diffs (the core value)
|
|
3974
|
-
* 3. **Coverage gaps** showing only files below threshold, worst metric first
|
|
3975
|
-
* 4. **Next steps** with re-run commands and cache file pointer
|
|
3976
|
-
*
|
|
3977
|
-
* When all tests pass, the output collapses to a single success line
|
|
3978
|
-
* with an optional cache file reference.
|
|
3979
|
-
*
|
|
3980
|
-
* Returns an empty string when `consoleOutput` is `"silent"`.
|
|
3981
|
-
*
|
|
3982
|
-
* @param report - The report to format
|
|
3983
|
-
* @param options - Formatting options controlling verbosity and color
|
|
3984
|
-
* @returns Formatted markdown string, or empty string for silent mode
|
|
3985
|
-
*
|
|
3986
|
-
* @internal
|
|
3987
|
-
*/
|
|
3988
|
-
export declare function formatConsoleMarkdown(report: AgentReport, options: ConsoleFormatOptions): string;
|
|
3989
|
-
/**
|
|
3990
|
-
* Format an unknown error into a human-readable string with issue URL.
|
|
3991
|
-
*
|
|
3992
|
-
* Extraction order:
|
|
3993
|
-
* 1. Effect Cause — use `Cause.pretty()` for full formatting
|
|
3994
|
-
* 2. Effect FiberFailure — extract Cause and use `Cause.pretty()`
|
|
3995
|
-
* 3. Plain Error — extract `.message` and `.stack`
|
|
3996
|
-
* 4. Unknown — `String(err)`
|
|
3997
|
-
*
|
|
3998
|
-
* @public
|
|
3999
|
-
*/
|
|
4000
|
-
export declare function formatFatalError(err: unknown): string;
|
|
4001
|
-
/**
|
|
4002
|
-
* Format one or more {@link (AgentReport:variable) | AgentReports} as a GitHub-Flavored
|
|
4003
|
-
* Markdown string for writing to `GITHUB_STEP_SUMMARY`.
|
|
4004
|
-
*
|
|
4005
|
-
* @remarks
|
|
4006
|
-
* GFM-specific features used in the output:
|
|
4007
|
-
*
|
|
4008
|
-
* - **Summary table** with pass/fail counts across all projects
|
|
4009
|
-
* - **Collapsible `<details>` blocks** for per-project results in monorepo setups
|
|
4010
|
-
* - **Tables** for coverage metrics
|
|
4011
|
-
* - **Diff-fenced code blocks** for expected/received comparison output
|
|
4012
|
-
* - **GitHub Alert callouts** (`[!WARNING]`) for coverage threshold violations
|
|
4013
|
-
*
|
|
4014
|
-
* For a single report, the project body is rendered directly without
|
|
4015
|
-
* a `<details>` wrapper. For multiple reports (monorepo), each project
|
|
4016
|
-
* gets its own collapsible section with a status icon in the summary line.
|
|
4017
|
-
*
|
|
4018
|
-
* @param reports - One or more agent reports to format
|
|
4019
|
-
* @returns GFM-formatted string ready for appending to `GITHUB_STEP_SUMMARY`
|
|
4020
|
-
*
|
|
4021
|
-
* @public
|
|
4022
|
-
*/
|
|
4023
|
-
export declare function formatGfm(reports: AgentReport[]): string;
|
|
4024
4021
|
/**
|
|
4025
4022
|
* Format the informational note shown when coverage thresholds were
|
|
4026
4023
|
* skipped because a run only exercised a subset of the project's test
|
|
@@ -4055,12 +4052,6 @@ export interface FunctionBoundary {
|
|
|
4055
4052
|
* @public
|
|
4056
4053
|
*/
|
|
4057
4054
|
export declare const findFunctionBoundary: (source: string, line: number) => FunctionBoundary | null;
|
|
4058
|
-
/** @public */
|
|
4059
|
-
export interface Osc8Options {
|
|
4060
|
-
readonly enabled: boolean;
|
|
4061
|
-
}
|
|
4062
|
-
/** @public */
|
|
4063
|
-
export declare const osc8: (url: string, label: string, options: Osc8Options) => string;
|
|
4064
4055
|
/**
|
|
4065
4056
|
* Return `true` if the command invokes Vitest in any of the five
|
|
4066
4057
|
* supported shapes. The `vitestScripts` set carries the names of
|
|
@@ -4107,34 +4098,6 @@ export declare const rewriteBashCommand: (input: {
|
|
|
4107
4098
|
* @public
|
|
4108
4099
|
*/
|
|
4109
4100
|
export declare const detectVitestScripts: (scripts: Record<string, string>) => Set<string>;
|
|
4110
|
-
/**
|
|
4111
|
-
* Normalize a workspace name into a filesystem-safe directory segment.
|
|
4112
|
-
*
|
|
4113
|
-
* The workspace key drives the per-project subdirectory under the XDG data
|
|
4114
|
-
* directory (e.g. `$XDG_DATA_HOME/vitest-agent/<key>/data.db`). The
|
|
4115
|
-
* key must be deterministic for a given input and safe to use as a single
|
|
4116
|
-
* path segment on macOS, Linux, and Windows.
|
|
4117
|
-
*
|
|
4118
|
-
* Rules (applied in order):
|
|
4119
|
-
*
|
|
4120
|
-
* 1. Replace `/` with `__` so scoped names like `@org/pkg` collapse to
|
|
4121
|
-
* `@org__pkg` rather than introducing a subdirectory boundary. Scoped
|
|
4122
|
-
* npm names contain at most one `/` (between scope and name), and
|
|
4123
|
-
* leading-`@` requires the scope/name form, so `@org__pkg` is not a
|
|
4124
|
-
* valid unscoped npm name -- the `__` token is unambiguous in
|
|
4125
|
-
* practice.
|
|
4126
|
-
* 2. Replace any character outside `[A-Za-z0-9._@-]` with `_`. This catches
|
|
4127
|
-
* Windows-reserved characters (`\`, `:`, `*`, `?`, `"`, `<`, `>`, `|`),
|
|
4128
|
-
* control characters, whitespace, and anything else that varies in
|
|
4129
|
-
* interpretation across filesystems.
|
|
4130
|
-
* 3. Collapse runs of underscores produced by the substitution above into a
|
|
4131
|
-
* single `_` so the output stays compact.
|
|
4132
|
-
*
|
|
4133
|
-
* @param name - The raw `name` field from a workspace's `package.json`.
|
|
4134
|
-
* @returns A filesystem-safe single path segment.
|
|
4135
|
-
* @public
|
|
4136
|
-
*/
|
|
4137
|
-
export declare function normalizeWorkspaceKey(name: string): string;
|
|
4138
4101
|
/**
|
|
4139
4102
|
* Pure POSIX path helpers for the platform-free core.
|
|
4140
4103
|
*
|
|
@@ -4168,60 +4131,33 @@ export declare const joinPosix: (...parts: ReadonlyArray<string>) => string;
|
|
|
4168
4131
|
* @public
|
|
4169
4132
|
*/
|
|
4170
4133
|
export declare const relativePosix: (from: string, to: string) => string;
|
|
4171
|
-
/** @public */
|
|
4172
|
-
export interface HostMetadataResult {
|
|
4173
|
-
readonly source: string | null;
|
|
4174
|
-
readonly value: string | null;
|
|
4175
|
-
readonly metadata: Record<string, unknown> | null;
|
|
4176
|
-
}
|
|
4177
4134
|
/**
|
|
4178
|
-
*
|
|
4179
|
-
* along with any decorating metadata (`term_program`, `ci_provider`,
|
|
4180
|
-
* etc.) for that source. When no probe matches, `source`/`value`/
|
|
4181
|
-
* `metadata` are all `null`.
|
|
4182
|
-
*
|
|
4183
|
-
* The probe order matches the plan's table exactly:
|
|
4184
|
-
*
|
|
4185
|
-
* 1. `TMUX_PANE` (tmux reattach-stable)
|
|
4186
|
-
* 2. `WT_SESSION` (Windows Terminal pane)
|
|
4187
|
-
* 3. `WEZTERM_PANE` (WezTerm pane)
|
|
4188
|
-
* 4. `KITTY_WINDOW_ID` (kitty window)
|
|
4189
|
-
* 5. `TERM_SESSION_ID` (iTerm2, Terminal.app)
|
|
4190
|
-
* 6. `VSCODE_INJECTION` + `process.ppid` (handled by the Live layer
|
|
4191
|
-
* since it needs `process.ppid`, not env)
|
|
4192
|
-
* 7. `GITHUB_RUN_ID` + `GITHUB_RUN_ATTEMPT`
|
|
4193
|
-
* 8. `BUILDKITE_JOB_ID` / `CIRCLE_BUILD_NUM` / `GITLAB_CI_JOB_ID`
|
|
4194
|
-
* 9. `process.ppid` walk (handled by the Live layer)
|
|
4135
|
+
* Post-run work at or above this many milliseconds is always "slow".
|
|
4195
4136
|
* @public
|
|
4196
4137
|
*/
|
|
4197
|
-
export declare const
|
|
4138
|
+
export declare const POST_RUN_SLOW_MS = 5000;
|
|
4198
4139
|
/**
|
|
4199
|
-
*
|
|
4200
|
-
*
|
|
4201
|
-
*
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
*
|
|
4206
|
-
* @
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
*
|
|
4211
|
-
*
|
|
4212
|
-
* safeFilename("\@savvy-web/my-lib:unit");
|
|
4213
|
-
* // Returns: "\@savvy-web__my-lib__unit"
|
|
4214
|
-
*
|
|
4215
|
-
* safeFilename("core");
|
|
4216
|
-
* // Returns: "core"
|
|
4217
|
-
*
|
|
4218
|
-
* safeFilename("");
|
|
4219
|
-
* // Returns: "default"
|
|
4220
|
-
* ```
|
|
4221
|
-
*
|
|
4140
|
+
* Post-run work at or above this share of Vitest's own duration is "slow"
|
|
4141
|
+
* (once it also clears {@link POST_RUN_SLOW_MIN_MS}).
|
|
4142
|
+
* @public
|
|
4143
|
+
*/
|
|
4144
|
+
export declare const POST_RUN_SLOW_SHARE = 0.1;
|
|
4145
|
+
/**
|
|
4146
|
+
* Minimum post-run milliseconds before the share rule applies.
|
|
4147
|
+
* @public
|
|
4148
|
+
*/
|
|
4149
|
+
export declare const POST_RUN_SLOW_MIN_MS = 1000;
|
|
4150
|
+
/**
|
|
4151
|
+
* Whether the plugin's post-run work was slow enough to surface.
|
|
4222
4152
|
* @public
|
|
4223
4153
|
*/
|
|
4224
|
-
export declare function
|
|
4154
|
+
export declare function isPostRunSlow(timing: PostRunTiming): boolean;
|
|
4155
|
+
/**
|
|
4156
|
+
* Map run diagnostics onto suggested actions: persistence failure first, then
|
|
4157
|
+
* slow post-run work, then performance hints in input order.
|
|
4158
|
+
* @public
|
|
4159
|
+
*/
|
|
4160
|
+
export declare function suggestedActionsFromRunDiagnostics(d: RunDiagnostics): ReadonlyArray<SuggestedActionRecord>;
|
|
4225
4161
|
/**
|
|
4226
4162
|
* A stream stray output was written to.
|
|
4227
4163
|
* @public
|
|
@@ -4531,6 +4467,20 @@ export declare const requiredArtifactForTransition: (from: Phase, to: Phase) =>
|
|
|
4531
4467
|
export declare const transitionEnforcesBehaviorMatch: (from: Phase, to: Phase) => boolean;
|
|
4532
4468
|
/** @public */
|
|
4533
4469
|
export declare const validatePhaseTransition: (ctx: PhaseTransitionContext) => PhaseTransitionResult;
|
|
4470
|
+
/**
|
|
4471
|
+
* The config filenames Vitest 5 itself loads, in the order it prefers them:
|
|
4472
|
+
* `vitest.config.*` before `vite.config.*`, each across
|
|
4473
|
+
* `ts` / `mts` / `cts` / `js` / `mjs` / `cjs`. Mirrors `configFiles` in
|
|
4474
|
+
* Vitest's own `constants.ts`. `vitest.workspace.*` is absent on purpose:
|
|
4475
|
+
* Vitest no longer reads a workspace file (projects live in the config's
|
|
4476
|
+
* `test.projects`).
|
|
4477
|
+
*
|
|
4478
|
+
* The single source both front ends derive their config lookups from, so the
|
|
4479
|
+
* CLI's `check-test-path` and the MCP `run_tests` root walk cannot drift.
|
|
4480
|
+
*
|
|
4481
|
+
* @public
|
|
4482
|
+
*/
|
|
4483
|
+
export declare const VITEST_CONFIG_FILES: ReadonlyArray<string>;
|
|
4534
4484
|
/**
|
|
4535
4485
|
* The version of this package. Inlined at build time from
|
|
4536
4486
|
* package.json#version via rslib-builder's __PACKAGE_VERSION__ substitution.
|