@vitest-agent/mcp 6.2.0 → 6.3.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/index.d.ts +392 -0
- package/package.json +4 -4
- package/prompts/why-flaky.js +1 -0
- package/tools/errors.js +6 -0
- package/tools/help.js +3 -3
- package/tools/history.js +42 -6
- package/tools/run-tests.js +30 -10
- package/tools/status.js +11 -6
- package/version.js +1 -1
package/index.d.ts
CHANGED
|
@@ -773,6 +773,23 @@ export declare const TestErrorsResult: Schema.Struct<{
|
|
|
773
773
|
readonly scope: Schema.Literals<readonly ["test", "suite", "module", "unhandled"]>;
|
|
774
774
|
readonly testFullName: Schema.NullOr<Schema.String>;
|
|
775
775
|
readonly moduleFile: Schema.NullOr<Schema.String>;
|
|
776
|
+
readonly attempt: Schema.NullOr<Schema.Struct<{
|
|
777
|
+
readonly retryIndex: Schema.Finite;
|
|
778
|
+
readonly repeatIndex: Schema.Finite;
|
|
779
|
+
}>>;
|
|
780
|
+
readonly traceSteps: Schema.$Array<Schema.Struct<{
|
|
781
|
+
readonly name: Schema.String;
|
|
782
|
+
readonly status: Schema.optional<Schema.Literals<readonly ["pass", "fail"]>>;
|
|
783
|
+
readonly startTime: Schema.Finite;
|
|
784
|
+
readonly duration: Schema.optional<Schema.Finite>;
|
|
785
|
+
readonly depth: Schema.Finite;
|
|
786
|
+
readonly locator: Schema.optional<Schema.String>;
|
|
787
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
788
|
+
readonly file: Schema.String;
|
|
789
|
+
readonly line: Schema.Finite;
|
|
790
|
+
readonly column: Schema.Finite;
|
|
791
|
+
}>>;
|
|
792
|
+
}>>;
|
|
776
793
|
readonly annotations: Schema.$Array<Schema.Struct<{
|
|
777
794
|
readonly type: Schema.String;
|
|
778
795
|
readonly message: Schema.String;
|
|
@@ -837,6 +854,23 @@ export declare const testErrorsTool: Tool.Tool<"test_errors", {
|
|
|
837
854
|
readonly scope: Schema.Literals<readonly ["test", "suite", "module", "unhandled"]>;
|
|
838
855
|
readonly testFullName: Schema.NullOr<Schema.String>;
|
|
839
856
|
readonly moduleFile: Schema.NullOr<Schema.String>;
|
|
857
|
+
readonly attempt: Schema.NullOr<Schema.Struct<{
|
|
858
|
+
readonly retryIndex: Schema.Finite;
|
|
859
|
+
readonly repeatIndex: Schema.Finite;
|
|
860
|
+
}>>;
|
|
861
|
+
readonly traceSteps: Schema.$Array<Schema.Struct<{
|
|
862
|
+
readonly name: Schema.String;
|
|
863
|
+
readonly status: Schema.optional<Schema.Literals<readonly ["pass", "fail"]>>;
|
|
864
|
+
readonly startTime: Schema.Finite;
|
|
865
|
+
readonly duration: Schema.optional<Schema.Finite>;
|
|
866
|
+
readonly depth: Schema.Finite;
|
|
867
|
+
readonly locator: Schema.optional<Schema.String>;
|
|
868
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
869
|
+
readonly file: Schema.String;
|
|
870
|
+
readonly line: Schema.Finite;
|
|
871
|
+
readonly column: Schema.Finite;
|
|
872
|
+
}>>;
|
|
873
|
+
}>>;
|
|
840
874
|
readonly annotations: Schema.$Array<Schema.Struct<{
|
|
841
875
|
readonly type: Schema.String;
|
|
842
876
|
readonly message: Schema.String;
|
|
@@ -1134,6 +1168,31 @@ export declare const TestHistoryResult: Schema.Struct<{
|
|
|
1134
1168
|
}>>;
|
|
1135
1169
|
}>>;
|
|
1136
1170
|
}>;
|
|
1171
|
+
readonly moduleCache: Schema.Struct<{
|
|
1172
|
+
readonly runs: Schema.$Array<Schema.Struct<{
|
|
1173
|
+
readonly timestamp: Schema.String;
|
|
1174
|
+
readonly moduleCache: Schema.Struct<{
|
|
1175
|
+
readonly enabled: Schema.Boolean;
|
|
1176
|
+
readonly transformMs: Schema.Finite;
|
|
1177
|
+
readonly trackedMs: Schema.Finite;
|
|
1178
|
+
readonly share: Schema.Finite;
|
|
1179
|
+
readonly modulesWritten: Schema.optional<Schema.Finite>;
|
|
1180
|
+
}>;
|
|
1181
|
+
}>>;
|
|
1182
|
+
}>;
|
|
1183
|
+
readonly retried: Schema.$Array<Schema.Struct<{
|
|
1184
|
+
readonly fullName: Schema.String;
|
|
1185
|
+
readonly modulePath: Schema.String;
|
|
1186
|
+
readonly attempts: Schema.$Array<Schema.Struct<{
|
|
1187
|
+
readonly id: Schema.Finite;
|
|
1188
|
+
readonly retryIndex: Schema.Finite;
|
|
1189
|
+
readonly repeatIndex: Schema.Finite;
|
|
1190
|
+
readonly state: Schema.Literals<readonly ["passed", "failed", "skipped"]>;
|
|
1191
|
+
readonly duration: Schema.NullOr<Schema.Finite>;
|
|
1192
|
+
readonly startTime: Schema.NullOr<Schema.Finite>;
|
|
1193
|
+
readonly errorIds: Schema.$Array<Schema.Finite>;
|
|
1194
|
+
}>>;
|
|
1195
|
+
}>>;
|
|
1137
1196
|
}>;
|
|
1138
1197
|
/**
|
|
1139
1198
|
* The decoded {@link TestHistoryResult}.
|
|
@@ -1228,6 +1287,31 @@ export declare const testHistoryTool: Tool.Tool<"test_history", {
|
|
|
1228
1287
|
}>>;
|
|
1229
1288
|
}>>;
|
|
1230
1289
|
}>;
|
|
1290
|
+
readonly moduleCache: Schema.Struct<{
|
|
1291
|
+
readonly runs: Schema.$Array<Schema.Struct<{
|
|
1292
|
+
readonly timestamp: Schema.String;
|
|
1293
|
+
readonly moduleCache: Schema.Struct<{
|
|
1294
|
+
readonly enabled: Schema.Boolean;
|
|
1295
|
+
readonly transformMs: Schema.Finite;
|
|
1296
|
+
readonly trackedMs: Schema.Finite;
|
|
1297
|
+
readonly share: Schema.Finite;
|
|
1298
|
+
readonly modulesWritten: Schema.optional<Schema.Finite>;
|
|
1299
|
+
}>;
|
|
1300
|
+
}>>;
|
|
1301
|
+
}>;
|
|
1302
|
+
readonly retried: Schema.$Array<Schema.Struct<{
|
|
1303
|
+
readonly fullName: Schema.String;
|
|
1304
|
+
readonly modulePath: Schema.String;
|
|
1305
|
+
readonly attempts: Schema.$Array<Schema.Struct<{
|
|
1306
|
+
readonly id: Schema.Finite;
|
|
1307
|
+
readonly retryIndex: Schema.Finite;
|
|
1308
|
+
readonly repeatIndex: Schema.Finite;
|
|
1309
|
+
readonly state: Schema.Literals<readonly ["passed", "failed", "skipped"]>;
|
|
1310
|
+
readonly duration: Schema.NullOr<Schema.Finite>;
|
|
1311
|
+
readonly startTime: Schema.NullOr<Schema.Finite>;
|
|
1312
|
+
readonly errorIds: Schema.$Array<Schema.Finite>;
|
|
1313
|
+
}>>;
|
|
1314
|
+
}>>;
|
|
1231
1315
|
}>;
|
|
1232
1316
|
readonly failure: Schema.Never;
|
|
1233
1317
|
readonly failureMode: "error";
|
|
@@ -1458,6 +1542,7 @@ export declare const RunTestsResult: Schema.Union<readonly [Schema.Struct<{
|
|
|
1458
1542
|
readonly any: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1459
1543
|
readonly none: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1460
1544
|
}>>;
|
|
1545
|
+
readonly lastFailed: Schema.Boolean;
|
|
1461
1546
|
}>;
|
|
1462
1547
|
readonly report: Schema.Struct<{
|
|
1463
1548
|
readonly timestamp: Schema.String;
|
|
@@ -1481,6 +1566,19 @@ export declare const RunTestsResult: Schema.Union<readonly [Schema.Struct<{
|
|
|
1481
1566
|
readonly diff: Schema.optional<Schema.String>;
|
|
1482
1567
|
readonly expected: Schema.optional<Schema.String>;
|
|
1483
1568
|
readonly received: Schema.optional<Schema.String>;
|
|
1569
|
+
readonly traceSteps: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
1570
|
+
readonly name: Schema.String;
|
|
1571
|
+
readonly status: Schema.optional<Schema.Literals<readonly ["pass", "fail"]>>;
|
|
1572
|
+
readonly startTime: Schema.Finite;
|
|
1573
|
+
readonly duration: Schema.optional<Schema.Finite>;
|
|
1574
|
+
readonly depth: Schema.Finite;
|
|
1575
|
+
readonly locator: Schema.optional<Schema.String>;
|
|
1576
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
1577
|
+
readonly file: Schema.String;
|
|
1578
|
+
readonly line: Schema.Finite;
|
|
1579
|
+
readonly column: Schema.Finite;
|
|
1580
|
+
}>>;
|
|
1581
|
+
}>>>;
|
|
1484
1582
|
}>>>;
|
|
1485
1583
|
readonly tests: Schema.$Array<Schema.Struct<{
|
|
1486
1584
|
readonly name: Schema.String;
|
|
@@ -1495,6 +1593,19 @@ export declare const RunTestsResult: Schema.Union<readonly [Schema.Struct<{
|
|
|
1495
1593
|
readonly diff: Schema.optional<Schema.String>;
|
|
1496
1594
|
readonly expected: Schema.optional<Schema.String>;
|
|
1497
1595
|
readonly received: Schema.optional<Schema.String>;
|
|
1596
|
+
readonly traceSteps: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
1597
|
+
readonly name: Schema.String;
|
|
1598
|
+
readonly status: Schema.optional<Schema.Literals<readonly ["pass", "fail"]>>;
|
|
1599
|
+
readonly startTime: Schema.Finite;
|
|
1600
|
+
readonly duration: Schema.optional<Schema.Finite>;
|
|
1601
|
+
readonly depth: Schema.Finite;
|
|
1602
|
+
readonly locator: Schema.optional<Schema.String>;
|
|
1603
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
1604
|
+
readonly file: Schema.String;
|
|
1605
|
+
readonly line: Schema.Finite;
|
|
1606
|
+
readonly column: Schema.Finite;
|
|
1607
|
+
}>>;
|
|
1608
|
+
}>>>;
|
|
1498
1609
|
}>>>;
|
|
1499
1610
|
readonly classification: Schema.optional<Schema.Literals<readonly ["stable", "new-failure", "persistent", "flaky", "recovered"]>>;
|
|
1500
1611
|
}>>;
|
|
@@ -1505,6 +1616,19 @@ export declare const RunTestsResult: Schema.Union<readonly [Schema.Struct<{
|
|
|
1505
1616
|
readonly diff: Schema.optional<Schema.String>;
|
|
1506
1617
|
readonly expected: Schema.optional<Schema.String>;
|
|
1507
1618
|
readonly received: Schema.optional<Schema.String>;
|
|
1619
|
+
readonly traceSteps: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
1620
|
+
readonly name: Schema.String;
|
|
1621
|
+
readonly status: Schema.optional<Schema.Literals<readonly ["pass", "fail"]>>;
|
|
1622
|
+
readonly startTime: Schema.Finite;
|
|
1623
|
+
readonly duration: Schema.optional<Schema.Finite>;
|
|
1624
|
+
readonly depth: Schema.Finite;
|
|
1625
|
+
readonly locator: Schema.optional<Schema.String>;
|
|
1626
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
1627
|
+
readonly file: Schema.String;
|
|
1628
|
+
readonly line: Schema.Finite;
|
|
1629
|
+
readonly column: Schema.Finite;
|
|
1630
|
+
}>>;
|
|
1631
|
+
}>>>;
|
|
1508
1632
|
}>>;
|
|
1509
1633
|
readonly failedFiles: Schema.$Array<Schema.String>;
|
|
1510
1634
|
readonly coverage: Schema.optional<Schema.Struct<{
|
|
@@ -1645,6 +1769,13 @@ export declare const RunTestsResult: Schema.Union<readonly [Schema.Struct<{
|
|
|
1645
1769
|
readonly text: Schema.String;
|
|
1646
1770
|
}>>;
|
|
1647
1771
|
}>>;
|
|
1772
|
+
readonly moduleCache: Schema.optional<Schema.Struct<{
|
|
1773
|
+
readonly enabled: Schema.Boolean;
|
|
1774
|
+
readonly transformMs: Schema.Finite;
|
|
1775
|
+
readonly trackedMs: Schema.Finite;
|
|
1776
|
+
readonly share: Schema.Finite;
|
|
1777
|
+
readonly modulesWritten: Schema.optional<Schema.Finite>;
|
|
1778
|
+
}>>;
|
|
1648
1779
|
}>;
|
|
1649
1780
|
readonly classifications: Schema.$Record<Schema.String, Schema.String>;
|
|
1650
1781
|
readonly discoveryLastScannedAt: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
@@ -1698,6 +1829,7 @@ export declare const RunTestsResult: Schema.Union<readonly [Schema.Struct<{
|
|
|
1698
1829
|
readonly none: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1699
1830
|
}>>;
|
|
1700
1831
|
readonly resolvedExpression: Schema.NullOr<Schema.String>;
|
|
1832
|
+
readonly lastFailed: Schema.Boolean;
|
|
1701
1833
|
}>;
|
|
1702
1834
|
}>]>;
|
|
1703
1835
|
/**
|
|
@@ -1721,6 +1853,7 @@ export declare const RunTestsInput: Schema.Struct<{
|
|
|
1721
1853
|
readonly any: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1722
1854
|
readonly none: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1723
1855
|
}>>;
|
|
1856
|
+
readonly lastFailed: Schema.optionalKey<Schema.Boolean>;
|
|
1724
1857
|
readonly passWithNoTests: Schema.optionalKey<Schema.Boolean>;
|
|
1725
1858
|
readonly timeout: Schema.optionalKey<Schema.Finite>;
|
|
1726
1859
|
readonly _callerCwd: Schema.optionalKey<Schema.String>;
|
|
@@ -1763,6 +1896,7 @@ export declare const runTestsTool: Tool.Tool<"run_tests", {
|
|
|
1763
1896
|
readonly any: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1764
1897
|
readonly none: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1765
1898
|
}>>;
|
|
1899
|
+
readonly lastFailed: Schema.optionalKey<Schema.Boolean>;
|
|
1766
1900
|
readonly passWithNoTests: Schema.optionalKey<Schema.Boolean>;
|
|
1767
1901
|
readonly timeout: Schema.optionalKey<Schema.Finite>;
|
|
1768
1902
|
readonly _callerCwd: Schema.optionalKey<Schema.String>;
|
|
@@ -1784,6 +1918,7 @@ export declare const runTestsTool: Tool.Tool<"run_tests", {
|
|
|
1784
1918
|
readonly any: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1785
1919
|
readonly none: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1786
1920
|
}>>;
|
|
1921
|
+
readonly lastFailed: Schema.Boolean;
|
|
1787
1922
|
}>;
|
|
1788
1923
|
readonly report: Schema.Struct<{
|
|
1789
1924
|
readonly timestamp: Schema.String;
|
|
@@ -1807,6 +1942,19 @@ export declare const runTestsTool: Tool.Tool<"run_tests", {
|
|
|
1807
1942
|
readonly diff: Schema.optional<Schema.String>;
|
|
1808
1943
|
readonly expected: Schema.optional<Schema.String>;
|
|
1809
1944
|
readonly received: Schema.optional<Schema.String>;
|
|
1945
|
+
readonly traceSteps: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
1946
|
+
readonly name: Schema.String;
|
|
1947
|
+
readonly status: Schema.optional<Schema.Literals<readonly ["pass", "fail"]>>;
|
|
1948
|
+
readonly startTime: Schema.Finite;
|
|
1949
|
+
readonly duration: Schema.optional<Schema.Finite>;
|
|
1950
|
+
readonly depth: Schema.Finite;
|
|
1951
|
+
readonly locator: Schema.optional<Schema.String>;
|
|
1952
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
1953
|
+
readonly file: Schema.String;
|
|
1954
|
+
readonly line: Schema.Finite;
|
|
1955
|
+
readonly column: Schema.Finite;
|
|
1956
|
+
}>>;
|
|
1957
|
+
}>>>;
|
|
1810
1958
|
}>>>;
|
|
1811
1959
|
readonly tests: Schema.$Array<Schema.Struct<{
|
|
1812
1960
|
readonly name: Schema.String;
|
|
@@ -1821,6 +1969,19 @@ export declare const runTestsTool: Tool.Tool<"run_tests", {
|
|
|
1821
1969
|
readonly diff: Schema.optional<Schema.String>;
|
|
1822
1970
|
readonly expected: Schema.optional<Schema.String>;
|
|
1823
1971
|
readonly received: Schema.optional<Schema.String>;
|
|
1972
|
+
readonly traceSteps: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
1973
|
+
readonly name: Schema.String;
|
|
1974
|
+
readonly status: Schema.optional<Schema.Literals<readonly ["pass", "fail"]>>;
|
|
1975
|
+
readonly startTime: Schema.Finite;
|
|
1976
|
+
readonly duration: Schema.optional<Schema.Finite>;
|
|
1977
|
+
readonly depth: Schema.Finite;
|
|
1978
|
+
readonly locator: Schema.optional<Schema.String>;
|
|
1979
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
1980
|
+
readonly file: Schema.String;
|
|
1981
|
+
readonly line: Schema.Finite;
|
|
1982
|
+
readonly column: Schema.Finite;
|
|
1983
|
+
}>>;
|
|
1984
|
+
}>>>;
|
|
1824
1985
|
}>>>;
|
|
1825
1986
|
readonly classification: Schema.optional<Schema.Literals<readonly ["stable", "new-failure", "persistent", "flaky", "recovered"]>>;
|
|
1826
1987
|
}>>;
|
|
@@ -1831,6 +1992,19 @@ export declare const runTestsTool: Tool.Tool<"run_tests", {
|
|
|
1831
1992
|
readonly diff: Schema.optional<Schema.String>;
|
|
1832
1993
|
readonly expected: Schema.optional<Schema.String>;
|
|
1833
1994
|
readonly received: Schema.optional<Schema.String>;
|
|
1995
|
+
readonly traceSteps: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
1996
|
+
readonly name: Schema.String;
|
|
1997
|
+
readonly status: Schema.optional<Schema.Literals<readonly ["pass", "fail"]>>;
|
|
1998
|
+
readonly startTime: Schema.Finite;
|
|
1999
|
+
readonly duration: Schema.optional<Schema.Finite>;
|
|
2000
|
+
readonly depth: Schema.Finite;
|
|
2001
|
+
readonly locator: Schema.optional<Schema.String>;
|
|
2002
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
2003
|
+
readonly file: Schema.String;
|
|
2004
|
+
readonly line: Schema.Finite;
|
|
2005
|
+
readonly column: Schema.Finite;
|
|
2006
|
+
}>>;
|
|
2007
|
+
}>>>;
|
|
1834
2008
|
}>>;
|
|
1835
2009
|
readonly failedFiles: Schema.$Array<Schema.String>;
|
|
1836
2010
|
readonly coverage: Schema.optional<Schema.Struct<{
|
|
@@ -1971,6 +2145,13 @@ export declare const runTestsTool: Tool.Tool<"run_tests", {
|
|
|
1971
2145
|
readonly text: Schema.String;
|
|
1972
2146
|
}>>;
|
|
1973
2147
|
}>>;
|
|
2148
|
+
readonly moduleCache: Schema.optional<Schema.Struct<{
|
|
2149
|
+
readonly enabled: Schema.Boolean;
|
|
2150
|
+
readonly transformMs: Schema.Finite;
|
|
2151
|
+
readonly trackedMs: Schema.Finite;
|
|
2152
|
+
readonly share: Schema.Finite;
|
|
2153
|
+
readonly modulesWritten: Schema.optional<Schema.Finite>;
|
|
2154
|
+
}>>;
|
|
1974
2155
|
}>;
|
|
1975
2156
|
readonly classifications: Schema.$Record<Schema.String, Schema.String>;
|
|
1976
2157
|
readonly discoveryLastScannedAt: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
@@ -2024,6 +2205,7 @@ export declare const runTestsTool: Tool.Tool<"run_tests", {
|
|
|
2024
2205
|
readonly none: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
2025
2206
|
}>>;
|
|
2026
2207
|
readonly resolvedExpression: Schema.NullOr<Schema.String>;
|
|
2208
|
+
readonly lastFailed: Schema.Boolean;
|
|
2027
2209
|
}>;
|
|
2028
2210
|
}>]>;
|
|
2029
2211
|
readonly failure: Schema.Never;
|
|
@@ -2096,6 +2278,13 @@ export declare const TestStatusResult: Schema.Union<readonly [Schema.Struct<{
|
|
|
2096
2278
|
readonly text: Schema.String;
|
|
2097
2279
|
}>>;
|
|
2098
2280
|
}>>;
|
|
2281
|
+
readonly moduleCache: Schema.optionalKey<Schema.Struct<{
|
|
2282
|
+
readonly enabled: Schema.Boolean;
|
|
2283
|
+
readonly transformMs: Schema.Finite;
|
|
2284
|
+
readonly trackedMs: Schema.Finite;
|
|
2285
|
+
readonly share: Schema.Finite;
|
|
2286
|
+
readonly modulesWritten: Schema.optional<Schema.Finite>;
|
|
2287
|
+
}>>;
|
|
2099
2288
|
}>>;
|
|
2100
2289
|
}>, Schema.Struct<{
|
|
2101
2290
|
readonly dataAvailable: Schema.Literal<false>;
|
|
@@ -2158,6 +2347,13 @@ export declare const testStatusTool: Tool.Tool<"test_status", {
|
|
|
2158
2347
|
readonly text: Schema.String;
|
|
2159
2348
|
}>>;
|
|
2160
2349
|
}>>;
|
|
2350
|
+
readonly moduleCache: Schema.optionalKey<Schema.Struct<{
|
|
2351
|
+
readonly enabled: Schema.Boolean;
|
|
2352
|
+
readonly transformMs: Schema.Finite;
|
|
2353
|
+
readonly trackedMs: Schema.Finite;
|
|
2354
|
+
readonly share: Schema.Finite;
|
|
2355
|
+
readonly modulesWritten: Schema.optional<Schema.Finite>;
|
|
2356
|
+
}>>;
|
|
2161
2357
|
}>>;
|
|
2162
2358
|
}>, Schema.Struct<{
|
|
2163
2359
|
readonly dataAvailable: Schema.Literal<false>;
|
|
@@ -3180,6 +3376,7 @@ export declare const Kit: Toolkit.Toolkit<{
|
|
|
3180
3376
|
readonly any: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
3181
3377
|
readonly none: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
3182
3378
|
}>>;
|
|
3379
|
+
readonly lastFailed: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
3183
3380
|
readonly passWithNoTests: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
3184
3381
|
readonly timeout: import("effect/Schema").optionalKey<import("effect/Schema").Finite>;
|
|
3185
3382
|
readonly _callerCwd: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
@@ -3201,6 +3398,7 @@ export declare const Kit: Toolkit.Toolkit<{
|
|
|
3201
3398
|
readonly any: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
3202
3399
|
readonly none: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
3203
3400
|
}>>;
|
|
3401
|
+
readonly lastFailed: import("effect/Schema").Boolean;
|
|
3204
3402
|
}>;
|
|
3205
3403
|
readonly report: import("effect/Schema").Struct<{
|
|
3206
3404
|
readonly timestamp: import("effect/Schema").String;
|
|
@@ -3224,6 +3422,19 @@ export declare const Kit: Toolkit.Toolkit<{
|
|
|
3224
3422
|
readonly diff: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
3225
3423
|
readonly expected: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
3226
3424
|
readonly received: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
3425
|
+
readonly traceSteps: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
3426
|
+
readonly name: import("effect/Schema").String;
|
|
3427
|
+
readonly status: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["pass", "fail"]>>;
|
|
3428
|
+
readonly startTime: import("effect/Schema").Finite;
|
|
3429
|
+
readonly duration: import("effect/Schema").optional<import("effect/Schema").Finite>;
|
|
3430
|
+
readonly depth: import("effect/Schema").Finite;
|
|
3431
|
+
readonly locator: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
3432
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
3433
|
+
readonly file: import("effect/Schema").String;
|
|
3434
|
+
readonly line: import("effect/Schema").Finite;
|
|
3435
|
+
readonly column: import("effect/Schema").Finite;
|
|
3436
|
+
}>>;
|
|
3437
|
+
}>>>;
|
|
3227
3438
|
}>>>;
|
|
3228
3439
|
readonly tests: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
3229
3440
|
readonly name: import("effect/Schema").String;
|
|
@@ -3238,6 +3449,19 @@ export declare const Kit: Toolkit.Toolkit<{
|
|
|
3238
3449
|
readonly diff: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
3239
3450
|
readonly expected: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
3240
3451
|
readonly received: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
3452
|
+
readonly traceSteps: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
3453
|
+
readonly name: import("effect/Schema").String;
|
|
3454
|
+
readonly status: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["pass", "fail"]>>;
|
|
3455
|
+
readonly startTime: import("effect/Schema").Finite;
|
|
3456
|
+
readonly duration: import("effect/Schema").optional<import("effect/Schema").Finite>;
|
|
3457
|
+
readonly depth: import("effect/Schema").Finite;
|
|
3458
|
+
readonly locator: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
3459
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
3460
|
+
readonly file: import("effect/Schema").String;
|
|
3461
|
+
readonly line: import("effect/Schema").Finite;
|
|
3462
|
+
readonly column: import("effect/Schema").Finite;
|
|
3463
|
+
}>>;
|
|
3464
|
+
}>>>;
|
|
3241
3465
|
}>>>;
|
|
3242
3466
|
readonly classification: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["stable", "new-failure", "persistent", "flaky", "recovered"]>>;
|
|
3243
3467
|
}>>;
|
|
@@ -3248,6 +3472,19 @@ export declare const Kit: Toolkit.Toolkit<{
|
|
|
3248
3472
|
readonly diff: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
3249
3473
|
readonly expected: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
3250
3474
|
readonly received: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
3475
|
+
readonly traceSteps: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
3476
|
+
readonly name: import("effect/Schema").String;
|
|
3477
|
+
readonly status: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["pass", "fail"]>>;
|
|
3478
|
+
readonly startTime: import("effect/Schema").Finite;
|
|
3479
|
+
readonly duration: import("effect/Schema").optional<import("effect/Schema").Finite>;
|
|
3480
|
+
readonly depth: import("effect/Schema").Finite;
|
|
3481
|
+
readonly locator: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
3482
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
3483
|
+
readonly file: import("effect/Schema").String;
|
|
3484
|
+
readonly line: import("effect/Schema").Finite;
|
|
3485
|
+
readonly column: import("effect/Schema").Finite;
|
|
3486
|
+
}>>;
|
|
3487
|
+
}>>>;
|
|
3251
3488
|
}>>;
|
|
3252
3489
|
readonly failedFiles: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
3253
3490
|
readonly coverage: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
@@ -3388,6 +3625,13 @@ export declare const Kit: Toolkit.Toolkit<{
|
|
|
3388
3625
|
readonly text: import("effect/Schema").String;
|
|
3389
3626
|
}>>;
|
|
3390
3627
|
}>>;
|
|
3628
|
+
readonly moduleCache: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
3629
|
+
readonly enabled: import("effect/Schema").Boolean;
|
|
3630
|
+
readonly transformMs: import("effect/Schema").Finite;
|
|
3631
|
+
readonly trackedMs: import("effect/Schema").Finite;
|
|
3632
|
+
readonly share: import("effect/Schema").Finite;
|
|
3633
|
+
readonly modulesWritten: import("effect/Schema").optional<import("effect/Schema").Finite>;
|
|
3634
|
+
}>>;
|
|
3391
3635
|
}>;
|
|
3392
3636
|
readonly classifications: import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>;
|
|
3393
3637
|
readonly discoveryLastScannedAt: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
@@ -3441,6 +3685,7 @@ export declare const Kit: Toolkit.Toolkit<{
|
|
|
3441
3685
|
readonly none: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
3442
3686
|
}>>;
|
|
3443
3687
|
readonly resolvedExpression: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
3688
|
+
readonly lastFailed: import("effect/Schema").Boolean;
|
|
3444
3689
|
}>;
|
|
3445
3690
|
}>]>;
|
|
3446
3691
|
readonly failure: import("effect/Schema").Never;
|
|
@@ -4253,6 +4498,23 @@ export declare const Kit: Toolkit.Toolkit<{
|
|
|
4253
4498
|
readonly scope: import("effect/Schema").Literals<readonly ["test", "suite", "module", "unhandled"]>;
|
|
4254
4499
|
readonly testFullName: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
4255
4500
|
readonly moduleFile: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
4501
|
+
readonly attempt: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
4502
|
+
readonly retryIndex: import("effect/Schema").Finite;
|
|
4503
|
+
readonly repeatIndex: import("effect/Schema").Finite;
|
|
4504
|
+
}>>;
|
|
4505
|
+
readonly traceSteps: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
4506
|
+
readonly name: import("effect/Schema").String;
|
|
4507
|
+
readonly status: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["pass", "fail"]>>;
|
|
4508
|
+
readonly startTime: import("effect/Schema").Finite;
|
|
4509
|
+
readonly duration: import("effect/Schema").optional<import("effect/Schema").Finite>;
|
|
4510
|
+
readonly depth: import("effect/Schema").Finite;
|
|
4511
|
+
readonly locator: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
4512
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
4513
|
+
readonly file: import("effect/Schema").String;
|
|
4514
|
+
readonly line: import("effect/Schema").Finite;
|
|
4515
|
+
readonly column: import("effect/Schema").Finite;
|
|
4516
|
+
}>>;
|
|
4517
|
+
}>>;
|
|
4256
4518
|
readonly annotations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
4257
4519
|
readonly type: import("effect/Schema").String;
|
|
4258
4520
|
readonly message: import("effect/Schema").String;
|
|
@@ -4326,6 +4588,31 @@ export declare const Kit: Toolkit.Toolkit<{
|
|
|
4326
4588
|
}>>;
|
|
4327
4589
|
}>>;
|
|
4328
4590
|
}>;
|
|
4591
|
+
readonly moduleCache: import("effect/Schema").Struct<{
|
|
4592
|
+
readonly runs: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
4593
|
+
readonly timestamp: import("effect/Schema").String;
|
|
4594
|
+
readonly moduleCache: import("effect/Schema").Struct<{
|
|
4595
|
+
readonly enabled: import("effect/Schema").Boolean;
|
|
4596
|
+
readonly transformMs: import("effect/Schema").Finite;
|
|
4597
|
+
readonly trackedMs: import("effect/Schema").Finite;
|
|
4598
|
+
readonly share: import("effect/Schema").Finite;
|
|
4599
|
+
readonly modulesWritten: import("effect/Schema").optional<import("effect/Schema").Finite>;
|
|
4600
|
+
}>;
|
|
4601
|
+
}>>;
|
|
4602
|
+
}>;
|
|
4603
|
+
readonly retried: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
4604
|
+
readonly fullName: import("effect/Schema").String;
|
|
4605
|
+
readonly modulePath: import("effect/Schema").String;
|
|
4606
|
+
readonly attempts: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
4607
|
+
readonly id: import("effect/Schema").Finite;
|
|
4608
|
+
readonly retryIndex: import("effect/Schema").Finite;
|
|
4609
|
+
readonly repeatIndex: import("effect/Schema").Finite;
|
|
4610
|
+
readonly state: import("effect/Schema").Literals<readonly ["passed", "failed", "skipped"]>;
|
|
4611
|
+
readonly duration: import("effect/Schema").NullOr<import("effect/Schema").Finite>;
|
|
4612
|
+
readonly startTime: import("effect/Schema").NullOr<import("effect/Schema").Finite>;
|
|
4613
|
+
readonly errorIds: import("effect/Schema").$Array<import("effect/Schema").Finite>;
|
|
4614
|
+
}>>;
|
|
4615
|
+
}>>;
|
|
4329
4616
|
}>;
|
|
4330
4617
|
readonly failure: import("effect/Schema").Never;
|
|
4331
4618
|
readonly failureMode: "error";
|
|
@@ -4378,6 +4665,13 @@ export declare const Kit: Toolkit.Toolkit<{
|
|
|
4378
4665
|
readonly text: import("effect/Schema").String;
|
|
4379
4666
|
}>>;
|
|
4380
4667
|
}>>;
|
|
4668
|
+
readonly moduleCache: import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
|
|
4669
|
+
readonly enabled: import("effect/Schema").Boolean;
|
|
4670
|
+
readonly transformMs: import("effect/Schema").Finite;
|
|
4671
|
+
readonly trackedMs: import("effect/Schema").Finite;
|
|
4672
|
+
readonly share: import("effect/Schema").Finite;
|
|
4673
|
+
readonly modulesWritten: import("effect/Schema").optional<import("effect/Schema").Finite>;
|
|
4674
|
+
}>>;
|
|
4381
4675
|
}>>;
|
|
4382
4676
|
}>, import("effect/Schema").Struct<{
|
|
4383
4677
|
readonly dataAvailable: import("effect/Schema").Literal<false>;
|
|
@@ -5667,6 +5961,7 @@ export declare const ToolsLayer: import("effect/Layer").Layer<import("effect/ai/
|
|
|
5667
5961
|
readonly any: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
5668
5962
|
readonly none: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
5669
5963
|
}>>;
|
|
5964
|
+
readonly lastFailed: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
5670
5965
|
readonly passWithNoTests: import("effect/Schema").optionalKey<import("effect/Schema").Boolean>;
|
|
5671
5966
|
readonly timeout: import("effect/Schema").optionalKey<import("effect/Schema").Finite>;
|
|
5672
5967
|
readonly _callerCwd: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
@@ -5688,6 +5983,7 @@ export declare const ToolsLayer: import("effect/Layer").Layer<import("effect/ai/
|
|
|
5688
5983
|
readonly any: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
5689
5984
|
readonly none: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
5690
5985
|
}>>;
|
|
5986
|
+
readonly lastFailed: import("effect/Schema").Boolean;
|
|
5691
5987
|
}>;
|
|
5692
5988
|
readonly report: import("effect/Schema").Struct<{
|
|
5693
5989
|
readonly timestamp: import("effect/Schema").String;
|
|
@@ -5711,6 +6007,19 @@ export declare const ToolsLayer: import("effect/Layer").Layer<import("effect/ai/
|
|
|
5711
6007
|
readonly diff: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
5712
6008
|
readonly expected: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
5713
6009
|
readonly received: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
6010
|
+
readonly traceSteps: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
6011
|
+
readonly name: import("effect/Schema").String;
|
|
6012
|
+
readonly status: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["pass", "fail"]>>;
|
|
6013
|
+
readonly startTime: import("effect/Schema").Finite;
|
|
6014
|
+
readonly duration: import("effect/Schema").optional<import("effect/Schema").Finite>;
|
|
6015
|
+
readonly depth: import("effect/Schema").Finite;
|
|
6016
|
+
readonly locator: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
6017
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
6018
|
+
readonly file: import("effect/Schema").String;
|
|
6019
|
+
readonly line: import("effect/Schema").Finite;
|
|
6020
|
+
readonly column: import("effect/Schema").Finite;
|
|
6021
|
+
}>>;
|
|
6022
|
+
}>>>;
|
|
5714
6023
|
}>>>;
|
|
5715
6024
|
readonly tests: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
5716
6025
|
readonly name: import("effect/Schema").String;
|
|
@@ -5725,6 +6034,19 @@ export declare const ToolsLayer: import("effect/Layer").Layer<import("effect/ai/
|
|
|
5725
6034
|
readonly diff: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
5726
6035
|
readonly expected: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
5727
6036
|
readonly received: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
6037
|
+
readonly traceSteps: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
6038
|
+
readonly name: import("effect/Schema").String;
|
|
6039
|
+
readonly status: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["pass", "fail"]>>;
|
|
6040
|
+
readonly startTime: import("effect/Schema").Finite;
|
|
6041
|
+
readonly duration: import("effect/Schema").optional<import("effect/Schema").Finite>;
|
|
6042
|
+
readonly depth: import("effect/Schema").Finite;
|
|
6043
|
+
readonly locator: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
6044
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
6045
|
+
readonly file: import("effect/Schema").String;
|
|
6046
|
+
readonly line: import("effect/Schema").Finite;
|
|
6047
|
+
readonly column: import("effect/Schema").Finite;
|
|
6048
|
+
}>>;
|
|
6049
|
+
}>>>;
|
|
5728
6050
|
}>>>;
|
|
5729
6051
|
readonly classification: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["stable", "new-failure", "persistent", "flaky", "recovered"]>>;
|
|
5730
6052
|
}>>;
|
|
@@ -5735,6 +6057,19 @@ export declare const ToolsLayer: import("effect/Layer").Layer<import("effect/ai/
|
|
|
5735
6057
|
readonly diff: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
5736
6058
|
readonly expected: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
5737
6059
|
readonly received: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
6060
|
+
readonly traceSteps: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
6061
|
+
readonly name: import("effect/Schema").String;
|
|
6062
|
+
readonly status: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["pass", "fail"]>>;
|
|
6063
|
+
readonly startTime: import("effect/Schema").Finite;
|
|
6064
|
+
readonly duration: import("effect/Schema").optional<import("effect/Schema").Finite>;
|
|
6065
|
+
readonly depth: import("effect/Schema").Finite;
|
|
6066
|
+
readonly locator: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
6067
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
6068
|
+
readonly file: import("effect/Schema").String;
|
|
6069
|
+
readonly line: import("effect/Schema").Finite;
|
|
6070
|
+
readonly column: import("effect/Schema").Finite;
|
|
6071
|
+
}>>;
|
|
6072
|
+
}>>>;
|
|
5738
6073
|
}>>;
|
|
5739
6074
|
readonly failedFiles: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
5740
6075
|
readonly coverage: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
@@ -5875,6 +6210,13 @@ export declare const ToolsLayer: import("effect/Layer").Layer<import("effect/ai/
|
|
|
5875
6210
|
readonly text: import("effect/Schema").String;
|
|
5876
6211
|
}>>;
|
|
5877
6212
|
}>>;
|
|
6213
|
+
readonly moduleCache: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
6214
|
+
readonly enabled: import("effect/Schema").Boolean;
|
|
6215
|
+
readonly transformMs: import("effect/Schema").Finite;
|
|
6216
|
+
readonly trackedMs: import("effect/Schema").Finite;
|
|
6217
|
+
readonly share: import("effect/Schema").Finite;
|
|
6218
|
+
readonly modulesWritten: import("effect/Schema").optional<import("effect/Schema").Finite>;
|
|
6219
|
+
}>>;
|
|
5878
6220
|
}>;
|
|
5879
6221
|
readonly classifications: import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>;
|
|
5880
6222
|
readonly discoveryLastScannedAt: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
@@ -5928,6 +6270,7 @@ export declare const ToolsLayer: import("effect/Layer").Layer<import("effect/ai/
|
|
|
5928
6270
|
readonly none: import("effect/Schema").optionalKey<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
5929
6271
|
}>>;
|
|
5930
6272
|
readonly resolvedExpression: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
6273
|
+
readonly lastFailed: import("effect/Schema").Boolean;
|
|
5931
6274
|
}>;
|
|
5932
6275
|
}>]>;
|
|
5933
6276
|
readonly failure: import("effect/Schema").Never;
|
|
@@ -6740,6 +7083,23 @@ export declare const ToolsLayer: import("effect/Layer").Layer<import("effect/ai/
|
|
|
6740
7083
|
readonly scope: import("effect/Schema").Literals<readonly ["test", "suite", "module", "unhandled"]>;
|
|
6741
7084
|
readonly testFullName: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
6742
7085
|
readonly moduleFile: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
7086
|
+
readonly attempt: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
7087
|
+
readonly retryIndex: import("effect/Schema").Finite;
|
|
7088
|
+
readonly repeatIndex: import("effect/Schema").Finite;
|
|
7089
|
+
}>>;
|
|
7090
|
+
readonly traceSteps: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
7091
|
+
readonly name: import("effect/Schema").String;
|
|
7092
|
+
readonly status: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["pass", "fail"]>>;
|
|
7093
|
+
readonly startTime: import("effect/Schema").Finite;
|
|
7094
|
+
readonly duration: import("effect/Schema").optional<import("effect/Schema").Finite>;
|
|
7095
|
+
readonly depth: import("effect/Schema").Finite;
|
|
7096
|
+
readonly locator: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
7097
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
7098
|
+
readonly file: import("effect/Schema").String;
|
|
7099
|
+
readonly line: import("effect/Schema").Finite;
|
|
7100
|
+
readonly column: import("effect/Schema").Finite;
|
|
7101
|
+
}>>;
|
|
7102
|
+
}>>;
|
|
6743
7103
|
readonly annotations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
6744
7104
|
readonly type: import("effect/Schema").String;
|
|
6745
7105
|
readonly message: import("effect/Schema").String;
|
|
@@ -6813,6 +7173,31 @@ export declare const ToolsLayer: import("effect/Layer").Layer<import("effect/ai/
|
|
|
6813
7173
|
}>>;
|
|
6814
7174
|
}>>;
|
|
6815
7175
|
}>;
|
|
7176
|
+
readonly moduleCache: import("effect/Schema").Struct<{
|
|
7177
|
+
readonly runs: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
7178
|
+
readonly timestamp: import("effect/Schema").String;
|
|
7179
|
+
readonly moduleCache: import("effect/Schema").Struct<{
|
|
7180
|
+
readonly enabled: import("effect/Schema").Boolean;
|
|
7181
|
+
readonly transformMs: import("effect/Schema").Finite;
|
|
7182
|
+
readonly trackedMs: import("effect/Schema").Finite;
|
|
7183
|
+
readonly share: import("effect/Schema").Finite;
|
|
7184
|
+
readonly modulesWritten: import("effect/Schema").optional<import("effect/Schema").Finite>;
|
|
7185
|
+
}>;
|
|
7186
|
+
}>>;
|
|
7187
|
+
}>;
|
|
7188
|
+
readonly retried: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
7189
|
+
readonly fullName: import("effect/Schema").String;
|
|
7190
|
+
readonly modulePath: import("effect/Schema").String;
|
|
7191
|
+
readonly attempts: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
7192
|
+
readonly id: import("effect/Schema").Finite;
|
|
7193
|
+
readonly retryIndex: import("effect/Schema").Finite;
|
|
7194
|
+
readonly repeatIndex: import("effect/Schema").Finite;
|
|
7195
|
+
readonly state: import("effect/Schema").Literals<readonly ["passed", "failed", "skipped"]>;
|
|
7196
|
+
readonly duration: import("effect/Schema").NullOr<import("effect/Schema").Finite>;
|
|
7197
|
+
readonly startTime: import("effect/Schema").NullOr<import("effect/Schema").Finite>;
|
|
7198
|
+
readonly errorIds: import("effect/Schema").$Array<import("effect/Schema").Finite>;
|
|
7199
|
+
}>>;
|
|
7200
|
+
}>>;
|
|
6816
7201
|
}>;
|
|
6817
7202
|
readonly failure: import("effect/Schema").Never;
|
|
6818
7203
|
readonly failureMode: "error";
|
|
@@ -6865,6 +7250,13 @@ export declare const ToolsLayer: import("effect/Layer").Layer<import("effect/ai/
|
|
|
6865
7250
|
readonly text: import("effect/Schema").String;
|
|
6866
7251
|
}>>;
|
|
6867
7252
|
}>>;
|
|
7253
|
+
readonly moduleCache: import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
|
|
7254
|
+
readonly enabled: import("effect/Schema").Boolean;
|
|
7255
|
+
readonly transformMs: import("effect/Schema").Finite;
|
|
7256
|
+
readonly trackedMs: import("effect/Schema").Finite;
|
|
7257
|
+
readonly share: import("effect/Schema").Finite;
|
|
7258
|
+
readonly modulesWritten: import("effect/Schema").optional<import("effect/Schema").Finite>;
|
|
7259
|
+
}>>;
|
|
6868
7260
|
}>>;
|
|
6869
7261
|
}>, import("effect/Schema").Struct<{
|
|
6870
7262
|
readonly dataAvailable: import("effect/Schema").Literal<false>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest-agent/mcp",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Model Context Protocol server for vitest-agent. Exposes 30 tools for agent access to test data, TDD lifecycle, and session management.",
|
|
6
6
|
"keywords": [
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@effect/platform-node": "4.1.5",
|
|
47
47
|
"@effected/commands": "0.22.0",
|
|
48
|
-
"@effected/git": "0.
|
|
48
|
+
"@effected/git": "0.34.0",
|
|
49
49
|
"@effected/glob": "0.23.0",
|
|
50
50
|
"@effected/kit": "0.14.0",
|
|
51
51
|
"@effected/mcp-kit": "0.15.1",
|
|
52
52
|
"@effected/walker": "0.30.0",
|
|
53
|
-
"@vitest-agent/engine": "3.
|
|
54
|
-
"@vitest-agent/sdk": "9.
|
|
53
|
+
"@vitest-agent/engine": "3.4.0",
|
|
54
|
+
"@vitest-agent/sdk": "9.2.0",
|
|
55
55
|
"effect": "4.1.5"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
package/prompts/why-flaky.js
CHANGED
|
@@ -12,6 +12,7 @@ function whyFlakyPrompt(args) {
|
|
|
12
12
|
"",
|
|
13
13
|
`1. Call \`test_history\` for ${args.project ? `\`project: "${args.project}"\` and ` : ""}the named test to read the recent pass/fail pattern.`,
|
|
14
14
|
"2. For any recent failure with a `signature_hash`, call `failure_signature_get` to see whether the same signature has appeared in earlier runs. A repeating signature is structural; a one-off signature is environmental. `occurrenceCount` counts each finally-failed test once per run and skips sightings on tests that passed on a retry, so `occurrenceCount: 0` means the signature has only appeared on attempts that later passed: a flake. Do not compare it with the length of `recentErrors`: every retry attempt writes its own error row, and the list is capped at 10. Otherwise read flakiness from step 1's pass/fail history.",
|
|
15
|
+
" `test_history` also returns `retried[]`: for a test that ran more than one attempt (a retry or a repeat) in the latest run, every attempt's `state`, indexes and `errorIds`. A test that failed on one attempt and passed on a later one is a flake by definition; read which attempt failed and how from the matching `test_errors` row, whose `attempt` names the retry/repeat index that raised it.",
|
|
15
16
|
"3. Look for these classic flake sources, in order:",
|
|
16
17
|
" - **Timing-based assertions** — `vi.useFakeTimers` not paired with `vi.useRealTimers`, or assertions that race with `setTimeout`/`setInterval`. Fake timers do not patch `node:timers` or `node:timers/promises` unless you opt in with `vi.useFakeTimers({ fakeNodeBuiltins: true })` (Vitest 5.1+), so code importing from those modules keeps using real timers.",
|
|
17
18
|
" - **Shared state across tests** — module-level mutables, `globalThis`, file system fixtures not cleaned up.",
|
package/tools/errors.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DataReader } from "@vitest-agent/engine";
|
|
2
|
+
import { TraceStep } from "@vitest-agent/sdk";
|
|
2
3
|
import { Effect, Schema } from "effect";
|
|
3
4
|
import { Tool } from "effect/ai";
|
|
4
5
|
|
|
@@ -37,6 +38,11 @@ const TestErrorRow = Schema.Struct({
|
|
|
37
38
|
]).annotate({ description: "Where the error fired: `test` (a single test case), `suite` (a `describe` setup), `module` (collection / import time), or `unhandled` (uncaught from a background context)." }),
|
|
38
39
|
testFullName: Schema.NullOr(Schema.String).annotate({ description: "Full hierarchical test name (`describe > it`); `null` for non-test scopes (`module`, `unhandled`)." }),
|
|
39
40
|
moduleFile: Schema.NullOr(Schema.String).annotate({ description: "Repo-relative path of the test module the error originated in." }),
|
|
41
|
+
attempt: Schema.NullOr(Schema.Struct({
|
|
42
|
+
retryIndex: Schema.Finite.annotate({ description: "Zero-based retry index within the repeat." }),
|
|
43
|
+
repeatIndex: Schema.Finite.annotate({ description: "Zero-based repeat index." })
|
|
44
|
+
})).annotate({ description: "The retry / repeat attempt that raised this error (Vitest 5.1+); `null` for suite, module and unhandled errors and for errors recorded before attempts were persisted. Several rows of one test with different attempts mean the test failed more than once; an attempt that failed while the final one passed is a flake." }),
|
|
45
|
+
traceSteps: Schema.Array(TraceStep).annotate({ description: "Vitest 5.1 `experimental.traceTimeline` steps of the test's failed attempt, oldest first and capped at the last ten (name without the `vitest:` prefix, `status` pass/fail, `startTime` and `duration` in ms from the attempt start, nesting `depth`, optional `locator` and repo-relative `location`). Empty when the test recorded no trace, for non-test scopes, and on Vitest older than 5.1; every error of one test serves the same list." }),
|
|
40
46
|
annotations: Schema.Array(TestErrorAnnotation).annotate({ description: "Test annotations the author recorded on this test (`context.annotate`). Empty for non-test scopes and for tests with no annotations." })
|
|
41
47
|
}).annotate({
|
|
42
48
|
identifier: "TestErrorRow",
|
package/tools/help.js
CHANGED
|
@@ -36,13 +36,13 @@ const HELP_TEXT = `# vitest-agent MCP Tools
|
|
|
36
36
|
|
|
37
37
|
| Tool | Parameters | Description |
|
|
38
38
|
| ---- | ---------- | ----------- |
|
|
39
|
-
| \`test_status\` | \`project?\` | Per-project test pass/fail state; an entry carries \`strayOutput\` when the latest run wrote straight to the terminal |
|
|
39
|
+
| \`test_status\` | \`project?\` | Per-project test pass/fail state; an entry carries \`strayOutput\` when the latest run wrote straight to the terminal, and \`moduleCache\` (fs module cache on/off, transform time and share, modules written) when it recorded one |
|
|
40
40
|
| \`test_overview\` | \`project?\` | Test landscape with run metrics |
|
|
41
41
|
| \`test_coverage\` | \`project?\` | Coverage gaps with uncovered lines |
|
|
42
42
|
| \`file_coverage\` | \`filePath\`, \`project?\` | Per-file coverage with uncovered lines and related tests |
|
|
43
|
-
| \`test_history\` | \`project\`, \`testName?\`, \`modulePath?\`, \`limit?\` | Flaky/persistent/recovered tests, plus \`strayOutput
|
|
43
|
+
| \`test_history\` | \`project\`, \`testName?\`, \`modulePath?\`, \`limit?\` | Flaky/persistent/recovered tests, plus \`strayOutput\` (how many of the last 10 runs wrote straight to the terminal), \`moduleCache\` (recent runs' fs module cache stats, newest first: cold versus warm), and \`retried[]\` (tests that ran more than one attempt in the latest run, each attempt's state and error ids) |
|
|
44
44
|
| \`test_trends\` | \`project\`, \`limit?\` | Coverage trajectory over time |
|
|
45
|
-
| \`test_errors\` | \`project\`, \`errorName?\` | Errors with diffs, stacks, each row's \`annotations[]\` (the test annotations the author recorded), and the cite-able \`testErrorId\` / \`topStackFrameId\` values needed by \`hypothesis (action: record)\` |
|
|
45
|
+
| \`test_errors\` | \`project\`, \`errorName?\` | Errors with diffs, stacks, each row's \`annotations[]\` (the test annotations the author recorded), each row's \`attempt\` (which retry/repeat raised it), and the cite-able \`testErrorId\` / \`topStackFrameId\` values needed by \`hypothesis (action: record)\` |
|
|
46
46
|
| \`test\` | \`action\` (\`list\`/\`get\`/\`for_file\`/\`for_tag\`/\`annotations\`/\`artifacts\`), plus per-action params | Consolidated test inspection: list/get/for_file/for_tag/annotations/artifacts |
|
|
47
47
|
|
|
48
48
|
\`test\` actions:
|
package/tools/history.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataReader } from "@vitest-agent/engine";
|
|
2
|
-
import { HistoryRecord, StrayOutput } from "@vitest-agent/sdk";
|
|
2
|
+
import { HistoryRecord, ModuleCacheStat, StrayOutput } from "@vitest-agent/sdk";
|
|
3
3
|
import { Effect, Schema } from "effect";
|
|
4
4
|
import { Tool } from "effect/ai";
|
|
5
5
|
|
|
@@ -44,6 +44,33 @@ const StrayOutputHistoryRow = Schema.Struct({
|
|
|
44
44
|
identifier: "StrayOutputHistoryRow",
|
|
45
45
|
description: "How often recent runs of the project wrote straight to the terminal (a test or a child process with inherited stdio). A run-level signal: nothing attributes it to one test."
|
|
46
46
|
});
|
|
47
|
+
const ModuleCacheHistoryRow = Schema.Struct({ runs: Schema.Array(Schema.Struct({
|
|
48
|
+
timestamp: Schema.String.annotate({ description: "ISO-8601 timestamp of the run." }),
|
|
49
|
+
moduleCache: ModuleCacheStat
|
|
50
|
+
})).annotate({ description: "The project's recent runs that recorded a module cache stat, newest first (up to 10). A cold run shows a large transform time and many modules written; a warm run, a small transform time and few or none written." }) }).annotate({
|
|
51
|
+
identifier: "ModuleCacheHistoryRow",
|
|
52
|
+
description: "How well Vitest's fs module cache served the project's recent runs. Exact hit counts are not available: `modulesWritten` counts the misses the cache saved, and `transformMs` is the time the cache did not remove."
|
|
53
|
+
});
|
|
54
|
+
const RetriedTestRow = Schema.Struct({
|
|
55
|
+
fullName: Schema.String,
|
|
56
|
+
modulePath: Schema.String.annotate({ description: "Project-relative test module path -- disambiguates same-named tests across files." }),
|
|
57
|
+
attempts: Schema.Array(Schema.Struct({
|
|
58
|
+
id: Schema.Finite.annotate({ description: "`test_attempts.id`." }),
|
|
59
|
+
retryIndex: Schema.Finite.annotate({ description: "Zero-based retry index within the repeat." }),
|
|
60
|
+
repeatIndex: Schema.Finite.annotate({ description: "Zero-based repeat index." }),
|
|
61
|
+
state: Schema.Literals([
|
|
62
|
+
"passed",
|
|
63
|
+
"failed",
|
|
64
|
+
"skipped"
|
|
65
|
+
]).annotate({ description: "Outcome of this attempt alone, after applying the test's expected-failure option." }),
|
|
66
|
+
duration: Schema.NullOr(Schema.Finite).annotate({ description: "Attempt duration in milliseconds." }),
|
|
67
|
+
startTime: Schema.NullOr(Schema.Finite).annotate({ description: "Attempt start time (epoch ms)." }),
|
|
68
|
+
errorIds: Schema.Array(Schema.Finite).annotate({ description: "`test_errors.id` values this attempt raised; pass one as `citedTestErrorId` to `hypothesis (action: record)`." })
|
|
69
|
+
})).annotate({ description: "Every attempt, ordered by repeat then retry." })
|
|
70
|
+
}).annotate({
|
|
71
|
+
identifier: "RetriedTestRow",
|
|
72
|
+
description: "A test that ran more than one attempt (a retry or a repeat) in the project's latest run."
|
|
73
|
+
});
|
|
47
74
|
/**
|
|
48
75
|
* The `test_history` tool's success payload.
|
|
49
76
|
*
|
|
@@ -56,7 +83,9 @@ const TestHistoryResult = Schema.Struct({
|
|
|
56
83
|
flaky: Schema.Array(FlakyTestRow).annotate({ description: "Tests with mixed pass/fail outcomes recently." }),
|
|
57
84
|
persistent: Schema.Array(PersistentFailureRow).annotate({ description: "Tests failing across consecutive runs." }),
|
|
58
85
|
recovered: Schema.Array(RecoveredTestRow).annotate({ description: "Tests that just transitioned from failing to passing in the last run." }),
|
|
59
|
-
strayOutput: StrayOutputHistoryRow
|
|
86
|
+
strayOutput: StrayOutputHistoryRow,
|
|
87
|
+
moduleCache: ModuleCacheHistoryRow,
|
|
88
|
+
retried: Schema.Array(RetriedTestRow).annotate({ description: "Tests that ran more than one attempt in the latest run (Vitest 5.1+), each with every attempt's state and error ids: which attempt failed and how. Narrowed by `testName` / `modulePath`; empty when nothing retried or repeated." })
|
|
60
89
|
}).annotate({
|
|
61
90
|
identifier: "TestHistoryResult",
|
|
62
91
|
title: "test_history result",
|
|
@@ -88,11 +117,13 @@ const handleTestHistory = (input) => Effect.gen(function* () {
|
|
|
88
117
|
...scopeOptions,
|
|
89
118
|
...input.limit !== void 0 && { limit: input.limit }
|
|
90
119
|
};
|
|
91
|
-
const [history, flaky, persistent, strayOutput] = yield* Effect.all([
|
|
120
|
+
const [history, flaky, persistent, strayOutput, cacheHistory, retried] = yield* Effect.all([
|
|
92
121
|
reader.getHistory(input.project, historyOptions),
|
|
93
122
|
reader.getFlaky(input.project, scopeOptions),
|
|
94
123
|
reader.getPersistentFailures(input.project, scopeOptions),
|
|
95
|
-
reader.getStrayOutputHistory({ project: input.project })
|
|
124
|
+
reader.getStrayOutputHistory({ project: input.project }),
|
|
125
|
+
reader.getModuleCacheHistory({ project: input.project }),
|
|
126
|
+
reader.getRetriedTests(input.project, scopeOptions)
|
|
96
127
|
], { concurrency: "unbounded" });
|
|
97
128
|
const recovered = history.tests.filter((t) => {
|
|
98
129
|
const runs = t.runs;
|
|
@@ -113,7 +144,12 @@ const handleTestHistory = (input) => Effect.gen(function* () {
|
|
|
113
144
|
flaky,
|
|
114
145
|
persistent,
|
|
115
146
|
recovered,
|
|
116
|
-
strayOutput
|
|
147
|
+
strayOutput,
|
|
148
|
+
moduleCache: { runs: cacheHistory.runs.map(({ timestamp, moduleCache }) => ({
|
|
149
|
+
timestamp,
|
|
150
|
+
moduleCache
|
|
151
|
+
})) },
|
|
152
|
+
retried
|
|
117
153
|
};
|
|
118
154
|
}).pipe(Effect.orDie);
|
|
119
155
|
/**
|
|
@@ -122,7 +158,7 @@ const handleTestHistory = (input) => Effect.gen(function* () {
|
|
|
122
158
|
* @public
|
|
123
159
|
*/
|
|
124
160
|
const testHistoryTool = Tool.make("test_history", {
|
|
125
|
-
description: "Use when failures recur and you need flaky, persistent, and recovered test classifications. Returns a typed JSON object in structuredContent (project, hasData, history, flaky[], persistent[], recovered[], strayOutput: how many of the last 10 runs wrote straight to the terminal). Optional testName/modulePath narrow to a single test; limit caps runs kept per test (default 20) — omit all three only when you actually need the whole project's history.",
|
|
161
|
+
description: "Use when failures recur and you need flaky, persistent, and recovered test classifications. Returns a typed JSON object in structuredContent (project, hasData, history, flaky[], persistent[], recovered[], strayOutput: how many of the last 10 runs wrote straight to the terminal, moduleCache: the recent runs' fs module cache stats newest first to compare cold and warm runs, retried[]: tests that ran more than one attempt in the latest run with the state and error ids of each attempt). Optional testName/modulePath narrow to a single test; limit caps runs kept per test (default 20) — omit all three only when you actually need the whole project's history.",
|
|
126
162
|
parameters: TestHistoryInput,
|
|
127
163
|
success: TestHistoryResult,
|
|
128
164
|
dependencies: [DataReader]
|
package/tools/run-tests.js
CHANGED
|
@@ -26,7 +26,8 @@ const TagFilter = Schema.Struct({
|
|
|
26
26
|
const RunTestsScope = Schema.Struct({
|
|
27
27
|
project: Schema.NullOr(Schema.String),
|
|
28
28
|
files: Schema.Array(Schema.String),
|
|
29
|
-
tags: Schema.NullOr(TagFilter)
|
|
29
|
+
tags: Schema.NullOr(TagFilter),
|
|
30
|
+
lastFailed: Schema.Boolean.annotate({ description: "Whether the run was restricted to the tests that failed in the last run (`lastFailed` input)." })
|
|
30
31
|
}).annotate({
|
|
31
32
|
identifier: "RunTestsScope",
|
|
32
33
|
description: "The filter set actually used for this run, verbatim. Lets an agent tell 'ran exactly what I asked' apart from 'a dropped/misspelled param silently ran everything' without cross-checking summary counts."
|
|
@@ -68,7 +69,8 @@ const RunTestsNoMatch = Schema.Struct({
|
|
|
68
69
|
project: Schema.NullOr(Schema.String),
|
|
69
70
|
files: Schema.Array(Schema.String),
|
|
70
71
|
tags: Schema.NullOr(TagFilter),
|
|
71
|
-
resolvedExpression: Schema.NullOr(Schema.String)
|
|
72
|
+
resolvedExpression: Schema.NullOr(Schema.String),
|
|
73
|
+
lastFailed: Schema.Boolean
|
|
72
74
|
})
|
|
73
75
|
}).annotate({ identifier: "RunTestsNoMatch" });
|
|
74
76
|
/**
|
|
@@ -475,6 +477,7 @@ const RunTestsInput = Schema.Struct({
|
|
|
475
477
|
project: Schema.optionalKey(Schema.String).annotate({ description: "Project name to filter" }),
|
|
476
478
|
projectRoot: Schema.optionalKey(Schema.String).annotate({ description: "Explicit Vitest root for this call, used verbatim. Omit it to get the config-anchored default (walk up from the server's boot dir for a vitest/vite config, bounded at the git root). Prefer an absolute path; a relative path is resolved against ctx.cwd, not the server process's cwd. Validated: must be an existing directory in the same git repository as ctx.cwd (same git-common-dir, compared via `git rev-parse --path-format=absolute --git-common-dir`, which requires git 2.31 or newer; e.g. a sibling worktree). Rejected with { kind: 'error' } naming both paths otherwise." }),
|
|
477
479
|
tags: Schema.optionalKey(TagFilter).annotate({ description: "Structured tag filter; all/any/none AND together with each other and with project/files" }),
|
|
480
|
+
lastFailed: Schema.optionalKey(Schema.Boolean).annotate({ description: "Run only the tests that failed in their last run, using Vitest's `--last-failed` results cache. Counts as a filter: a run that selects nothing (no recorded failures, or `cache: false` in the Vitest config, which always selects nothing) returns the `no-match` result rather than an error, and the coverage-scope note applies." }),
|
|
478
481
|
passWithNoTests: Schema.optionalKey(Schema.Boolean).annotate({ description: "Per-call override of Vitest's native test.passWithNoTests" }),
|
|
479
482
|
timeout: Schema.optionalKey(Schema.Finite).annotate({ description: "Timeout in seconds (default: 120)" }),
|
|
480
483
|
_callerCwd: Schema.optionalKey(Schema.String).annotate({ description: "Hook-injected caller working directory; do not pass manually." }),
|
|
@@ -496,6 +499,7 @@ const RunTestsInput = Schema.Struct({
|
|
|
496
499
|
*/
|
|
497
500
|
function deriveRunScope(input) {
|
|
498
501
|
const tags = input.tags;
|
|
502
|
+
const lastFailed = input.lastFailed === true;
|
|
499
503
|
try {
|
|
500
504
|
const files = input.files ? sanitizeTestArgs(input.files) : [];
|
|
501
505
|
const project = input.project ? sanitizeTestArgs([input.project])[0] : void 0;
|
|
@@ -505,12 +509,13 @@ function deriveRunScope(input) {
|
|
|
505
509
|
if (tags.none) sanitizeTestArgs(tags.none);
|
|
506
510
|
}
|
|
507
511
|
const resolvedExpression = composeTagExpression(tags ?? null);
|
|
508
|
-
const hasFilter = files.length > 0 || project !== void 0 || resolvedExpression !== null;
|
|
512
|
+
const hasFilter = files.length > 0 || project !== void 0 || resolvedExpression !== null || lastFailed;
|
|
509
513
|
return Result.succeed({
|
|
510
514
|
files,
|
|
511
515
|
project,
|
|
512
516
|
tags,
|
|
513
517
|
resolvedExpression,
|
|
518
|
+
lastFailed,
|
|
514
519
|
hasFilter
|
|
515
520
|
});
|
|
516
521
|
} catch (err) {
|
|
@@ -541,11 +546,20 @@ function toNoMatch(scope, projectRoot) {
|
|
|
541
546
|
project: scope.project ?? null,
|
|
542
547
|
files: scope.files,
|
|
543
548
|
tags: scope.tags ?? null,
|
|
544
|
-
resolvedExpression: scope.resolvedExpression
|
|
549
|
+
resolvedExpression: scope.resolvedExpression,
|
|
550
|
+
lastFailed: scope.lastFailed
|
|
545
551
|
}
|
|
546
552
|
};
|
|
547
553
|
}
|
|
548
554
|
/**
|
|
555
|
+
* Whether a rejected Vitest step is Vitest's `VITEST_FILES_NOT_FOUND`.
|
|
556
|
+
*
|
|
557
|
+
* @internal exported for tests
|
|
558
|
+
*/
|
|
559
|
+
function isFilesNotFound(cause) {
|
|
560
|
+
return typeof cause === "object" && cause !== null && cause.code === "VITEST_FILES_NOT_FOUND";
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
549
563
|
* Shape the `ok` result from a finished run's plain values. `project` is
|
|
550
564
|
* echoed at the top level only when supplied; `scope` always echoes the
|
|
551
565
|
* resolved filter set; absent classifications and scan time become `{}` and
|
|
@@ -563,7 +577,8 @@ function toOkPayload(args) {
|
|
|
563
577
|
scope: {
|
|
564
578
|
project: scope.project ?? null,
|
|
565
579
|
files: scope.files,
|
|
566
|
-
tags: scope.tags ?? null
|
|
580
|
+
tags: scope.tags ?? null,
|
|
581
|
+
lastFailed: scope.lastFailed
|
|
567
582
|
},
|
|
568
583
|
report: args.report,
|
|
569
584
|
classifications: args.classifications ? Object.fromEntries(args.classifications) : {},
|
|
@@ -626,7 +641,8 @@ const runVitest = (args) => Effect.gen(function* () {
|
|
|
626
641
|
coverage: { reportsDirectory: coverageDir },
|
|
627
642
|
...project ? { project } : {},
|
|
628
643
|
...resolvedExpression !== null ? { tagsFilter: [resolvedExpression] } : {},
|
|
629
|
-
...input.passWithNoTests !== void 0 ? { passWithNoTests: input.passWithNoTests } : {}
|
|
644
|
+
...input.passWithNoTests !== void 0 ? { passWithNoTests: input.passWithNoTests } : {},
|
|
645
|
+
...scope.lastFailed ? { lastFailed: true } : {}
|
|
630
646
|
}, {}, {
|
|
631
647
|
stdout: nullStream,
|
|
632
648
|
stderr: nullStream
|
|
@@ -635,17 +651,21 @@ const runVitest = (args) => Effect.gen(function* () {
|
|
|
635
651
|
const started = yield* step(() => capture.run(DISCARD_STDIO, () => vitest.start(files.length > 0 ? files : void 0)), { abandon: true }).pipe(Effect.timeout(timeoutSeconds * 1e3), Effect.map((value) => ({
|
|
636
652
|
outcome: "ok",
|
|
637
653
|
value
|
|
638
|
-
})), Effect.catchTag("TimeoutError", () => Effect.succeed({ outcome: "timeout" })));
|
|
654
|
+
})), Effect.catchTag("TimeoutError", () => Effect.succeed({ outcome: "timeout" })), Effect.catchTag("RunStepFailure", (failure) => hasFilter && isFilesNotFound(failure.cause) ? Effect.succeed({ outcome: "no-match" }) : Effect.fail(failure)));
|
|
639
655
|
if (started.outcome === "timeout") return {
|
|
640
656
|
kind: "timeout",
|
|
641
657
|
timeoutSeconds
|
|
642
658
|
};
|
|
659
|
+
if (started.outcome === "no-match") return toNoMatch(scope, resolvedRoot);
|
|
643
660
|
const result = started.value;
|
|
644
661
|
const testModules = result.testModules;
|
|
645
662
|
const unhandledErrors = coerceErrors(result.unhandledErrors);
|
|
646
663
|
if (isNoMatch(scope, result.testModules.length, unhandledErrors.length)) return toNoMatch(scope, resolvedRoot);
|
|
647
664
|
const preliminaryReason = unhandledErrors.length > 0 || result.testModules.some((m) => m.state() === "failed") ? "failed" : "passed";
|
|
648
|
-
const baseReport = buildAgentReport(testModules, unhandledErrors, preliminaryReason, {
|
|
665
|
+
const baseReport = buildAgentReport(testModules, unhandledErrors, preliminaryReason, {
|
|
666
|
+
omitPassingTests: true,
|
|
667
|
+
root: resolvedRoot
|
|
668
|
+
});
|
|
649
669
|
const leaks = buildConsoleLeaks(collectConsoleLeakEntries(vitest.state.getFiles()));
|
|
650
670
|
const strayOutput = readStrayOutput(vitest.logger);
|
|
651
671
|
const configSuggestedActions = readConfigSuggestedActions(vitest);
|
|
@@ -789,7 +809,7 @@ const handleRunTests = (input) => Effect.gen(function* () {
|
|
|
789
809
|
* @public
|
|
790
810
|
*/
|
|
791
811
|
const runTestsTool = Tool.make("run_tests", {
|
|
792
|
-
description: "Use to run Vitest tests, with optional file, project, and tag filters. structuredContent carries the typed AgentReport plus per-test classifications (discriminate on `kind`: ok, timeout, error, no-match). Unknown parameters are rejected — accepted keys are files, project, tags, passWithNoTests, timeout, projectRoot. When projectRoot is omitted, the server anchors the Vitest root at the directory of the vitest (or vite) config Vitest would load anyway, walking up from its boot dir and stopping at the git root — so a server booted inside a package subtree still resolves the root config's relative globalSetup/setupFiles correctly. projectRoot overrides that for this call and is used verbatim, but only after validation: it must be an existing directory belonging to the same git repository as ctx.cwd (checked via `git rev-parse --path-format=absolute --git-common-dir`, which needs git 2.31 or newer and is identical across a repo and all its worktrees, including a sibling worktree checked out from the same repo). A path in a different repository, or a non-existent path, is rejected with `{ kind: \"error\" }` naming both paths — never a silent fallback to ctx.cwd. The resolved root actually used is always echoed back on success. When the plugin hook supplies the caller working directory (the hook-injected _callerCwd), a call from a different working tree of the same repository than the resolved root is refused with `{ kind: \"error\" }` naming both trees; pass projectRoot (your own worktree path) to run there. An absent or indeterminate caller directory never refuses. An error result with `reason: \"stale-install\"` means the vitest install was replaced under this long-lived server (the lockfile was regenerated) and the resolved vitest/node entry is gone; restart the MCP server (/mcp in Claude Code) rather than retrying. The legacy format=json arg is dropped — structuredContent supersedes it.",
|
|
812
|
+
description: "Use to run Vitest tests, with optional file, project, and tag filters. structuredContent carries the typed AgentReport plus per-test classifications (discriminate on `kind`: ok, timeout, error, no-match). Unknown parameters are rejected — accepted keys are files, project, tags, lastFailed, passWithNoTests, timeout, projectRoot. Set lastFailed to rerun only the tests that failed in their last run (the Vitest last-failed results cache); a run that selects nothing returns kind no-match. When projectRoot is omitted, the server anchors the Vitest root at the directory of the vitest (or vite) config Vitest would load anyway, walking up from its boot dir and stopping at the git root — so a server booted inside a package subtree still resolves the root config's relative globalSetup/setupFiles correctly. projectRoot overrides that for this call and is used verbatim, but only after validation: it must be an existing directory belonging to the same git repository as ctx.cwd (checked via `git rev-parse --path-format=absolute --git-common-dir`, which needs git 2.31 or newer and is identical across a repo and all its worktrees, including a sibling worktree checked out from the same repo). A path in a different repository, or a non-existent path, is rejected with `{ kind: \"error\" }` naming both paths — never a silent fallback to ctx.cwd. The resolved root actually used is always echoed back on success. When the plugin hook supplies the caller working directory (the hook-injected _callerCwd), a call from a different working tree of the same repository than the resolved root is refused with `{ kind: \"error\" }` naming both trees; pass projectRoot (your own worktree path) to run there. An absent or indeterminate caller directory never refuses. An error result with `reason: \"stale-install\"` means the vitest install was replaced under this long-lived server (the lockfile was regenerated) and the resolved vitest/node entry is gone; restart the MCP server (/mcp in Claude Code) rather than retrying. The legacy format=json arg is dropped — structuredContent supersedes it.",
|
|
793
813
|
parameters: RunTestsInput,
|
|
794
814
|
success: RunTestsResult,
|
|
795
815
|
dependencies: [
|
|
@@ -799,4 +819,4 @@ const runTestsTool = Tool.make("run_tests", {
|
|
|
799
819
|
]
|
|
800
820
|
}).annotate(Tool.Title, "Run tests").annotate(Tool.Readonly, false).annotate(Tool.Destructive, false).annotate(Tool.OpenWorld, false).annotate(Tool.Idempotent, false);
|
|
801
821
|
|
|
802
|
-
export { RUN_TESTS_ERROR_REASONS, RunTestsInput, RunTestsResult, RunTestsStdio, checkCallerWorktree, coerceErrors, composeTagExpression, deriveRunScope, handleRunTests, isNoMatch, makeBestEffortFork, readConfigSuggestedActions, readDiscoveryLastScannedAt, readRunDiagnostics, resolveAnchoredConfigFile, resolveConfigAnchoredRoot, resolveVitestNodeEntry, runTestsTool, sanitizeTestArgs, staleInstallMessage, toNoMatch, toOkPayload, validateProjectRoot, vitestLoader };
|
|
822
|
+
export { RUN_TESTS_ERROR_REASONS, RunTestsInput, RunTestsResult, RunTestsStdio, checkCallerWorktree, coerceErrors, composeTagExpression, deriveRunScope, handleRunTests, isFilesNotFound, isNoMatch, makeBestEffortFork, readConfigSuggestedActions, readDiscoveryLastScannedAt, readRunDiagnostics, resolveAnchoredConfigFile, resolveConfigAnchoredRoot, resolveVitestNodeEntry, runTestsTool, sanitizeTestArgs, staleInstallMessage, toNoMatch, toOkPayload, validateProjectRoot, vitestLoader };
|
package/tools/status.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToolOutputSchema } from "@effected/mcp-kit";
|
|
2
2
|
import { DataReader } from "@vitest-agent/engine";
|
|
3
|
-
import { CacheManifestEntry, StrayOutput } from "@vitest-agent/sdk";
|
|
3
|
+
import { CacheManifestEntry, ModuleCacheStat, StrayOutput } from "@vitest-agent/sdk";
|
|
4
4
|
import { Effect, Option, Schema } from "effect";
|
|
5
5
|
import { Tool } from "effect/ai";
|
|
6
6
|
|
|
@@ -12,7 +12,8 @@ import { Tool } from "effect/ai";
|
|
|
12
12
|
*/
|
|
13
13
|
const StatusEntry = Schema.Struct({
|
|
14
14
|
...CacheManifestEntry.fields,
|
|
15
|
-
strayOutput: Schema.optionalKey(StrayOutput).annotate({ description: "Output the latest run wrote straight to the terminal past Vitest's console capture (a test or a child process with inherited stdio). Absent when it recorded none." })
|
|
15
|
+
strayOutput: Schema.optionalKey(StrayOutput).annotate({ description: "Output the latest run wrote straight to the terminal past Vitest's console capture (a test or a child process with inherited stdio). Absent when it recorded none." }),
|
|
16
|
+
moduleCache: Schema.optionalKey(ModuleCacheStat).annotate({ description: "How well Vitest's fs module cache served the project's latest run: whether it was on, the time spent transforming modules and its share of tracked time, and the cache entries written (misses saved). Exact hit counts are not available. Absent when the run recorded none." })
|
|
16
17
|
}).annotate({ identifier: "TestStatusEntry" });
|
|
17
18
|
const StatusAvailable = Schema.Struct({
|
|
18
19
|
dataAvailable: Schema.Literal(true).annotate({ description: "Discriminant — `true` when at least one project entry exists in the manifest." }),
|
|
@@ -56,12 +57,16 @@ const handleTestStatus = (input) => Effect.gen(function* () {
|
|
|
56
57
|
...input.project !== void 0 && { projectFilter: input.project }
|
|
57
58
|
};
|
|
58
59
|
const manifest = manifestOpt.value;
|
|
59
|
-
const
|
|
60
|
+
const summaries = yield* reader.getRunsByProject();
|
|
61
|
+
const strayByProject = new Map(summaries.map((summary) => [summary.project, summary.strayOutput]));
|
|
62
|
+
const cacheByProject = new Map(summaries.map((summary) => [summary.project, summary.moduleCache]));
|
|
60
63
|
const entries = (input.project === void 0 ? manifest.projects : manifest.projects.filter((e) => e.project === input.project)).map((entry) => {
|
|
61
64
|
const strayOutput = strayByProject.get(entry.project) ?? null;
|
|
62
|
-
|
|
65
|
+
const moduleCache = cacheByProject.get(entry.project) ?? null;
|
|
66
|
+
return {
|
|
63
67
|
...entry,
|
|
64
|
-
strayOutput
|
|
68
|
+
...strayOutput !== null && { strayOutput },
|
|
69
|
+
...moduleCache !== null && { moduleCache }
|
|
65
70
|
};
|
|
66
71
|
});
|
|
67
72
|
if (entries.length === 0) return {
|
|
@@ -82,7 +87,7 @@ const handleTestStatus = (input) => Effect.gen(function* () {
|
|
|
82
87
|
* @public
|
|
83
88
|
*/
|
|
84
89
|
const testStatusTool = Tool.make("test_status", {
|
|
85
|
-
description: "Use when you need each project's current pass/fail state from the most recent run. Returns a typed JSON object in structuredContent ({ dataAvailable, manifestUpdatedAt, projectFilter?, entries[] } or absent variant); an entry carries strayOutput when the project's latest run wrote straight to the terminal.",
|
|
90
|
+
description: "Use when you need each project's current pass/fail state from the most recent run. Returns a typed JSON object in structuredContent ({ dataAvailable, manifestUpdatedAt, projectFilter?, entries[] } or absent variant); an entry carries strayOutput when the project's latest run wrote straight to the terminal, and moduleCache (fs module cache on/off, transform time and share, modules written) when it recorded one.",
|
|
86
91
|
parameters: TestStatusInput,
|
|
87
92
|
success: TestStatusResult,
|
|
88
93
|
dependencies: [DataReader]
|