@vitest-agent/plugin 2.5.5 → 2.5.6
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 +31 -31
- package/package.json +2 -2
- package/plugin.js +1 -1
package/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ type TagOptions = Omit<TestTagDefinition, "name">;
|
|
|
17
17
|
* A validated Vitest tag with its `name` string and a `TestTagDefinition` for registration.
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
|
-
declare class Tag {
|
|
20
|
+
export declare class Tag {
|
|
21
21
|
/** The tag name string (validated on construction). */
|
|
22
22
|
readonly name: string;
|
|
23
23
|
/** The full `TestTagDefinition` object to pass to Vitest's `test.tags` config. */
|
|
@@ -109,7 +109,7 @@ interface WalkerEntryStat {
|
|
|
109
109
|
* an explicit port.
|
|
110
110
|
* @public
|
|
111
111
|
*/
|
|
112
|
-
declare const nodeWalkerFs: WalkerFileSystem;
|
|
112
|
+
export declare const nodeWalkerFs: WalkerFileSystem;
|
|
113
113
|
//#endregion
|
|
114
114
|
//#region src/utils/discover-strategy.d.ts
|
|
115
115
|
/**
|
|
@@ -209,7 +209,7 @@ interface DiscoverStrategyExtendOptions {
|
|
|
209
209
|
* the built-in unit/int/e2e heuristics.
|
|
210
210
|
* @public
|
|
211
211
|
*/
|
|
212
|
-
declare abstract class DiscoverStrategy {
|
|
212
|
+
export declare abstract class DiscoverStrategy {
|
|
213
213
|
abstract readonly tags: ReadonlyArray<Tag>;
|
|
214
214
|
abstract get tagDefinitions(): ReadonlyArray<TestTagDefinition>;
|
|
215
215
|
abstract buildProject(input: DiscoverInput): Promise<TestProjectInlineConfiguration | null>;
|
|
@@ -226,7 +226,7 @@ declare abstract class DiscoverStrategy {
|
|
|
226
226
|
* (`.int.test.*` → `"int"`, `.e2e.test.*` → `"e2e"`, everything else → `"unit"`).
|
|
227
227
|
* @public
|
|
228
228
|
*/
|
|
229
|
-
declare class DefaultDiscoverStrategy extends DiscoverStrategy {
|
|
229
|
+
export declare class DefaultDiscoverStrategy extends DiscoverStrategy {
|
|
230
230
|
readonly tags: ReadonlyArray<Tag>;
|
|
231
231
|
get tagDefinitions(): ReadonlyArray<TestTagDefinition>;
|
|
232
232
|
classify(ctx: {
|
|
@@ -297,7 +297,7 @@ interface AgentPluginConstructorOptions extends AgentPluginOptions {
|
|
|
297
297
|
*
|
|
298
298
|
* @public
|
|
299
299
|
*/
|
|
300
|
-
declare const CURRENT_PLUGIN_VERSION: string;
|
|
300
|
+
export declare const CURRENT_PLUGIN_VERSION: string;
|
|
301
301
|
/**
|
|
302
302
|
* Vitest plugin that injects `AgentReporter` into the reporter chain.
|
|
303
303
|
*
|
|
@@ -307,7 +307,7 @@ declare const CURRENT_PLUGIN_VERSION: string;
|
|
|
307
307
|
*
|
|
308
308
|
* @public
|
|
309
309
|
*/
|
|
310
|
-
declare function AgentPlugin(options?: AgentPluginConstructorOptions, _layer?: Layer.Layer<EnvironmentDetector>): {
|
|
310
|
+
export declare function AgentPlugin(options?: AgentPluginConstructorOptions, _layer?: Layer.Layer<EnvironmentDetector>): {
|
|
311
311
|
name: "vitest-agent";
|
|
312
312
|
configResolved: (resolvedConfig: {
|
|
313
313
|
logger: {
|
|
@@ -378,7 +378,7 @@ interface DiscoverBuilder extends PromiseLike<DiscoverResult> {
|
|
|
378
378
|
* Exposes coverage-level preset maps, auto-update tolerance functions, and the `discover` thenable builder.
|
|
379
379
|
* @public
|
|
380
380
|
*/
|
|
381
|
-
declare namespace AgentPlugin {
|
|
381
|
+
export declare namespace AgentPlugin {
|
|
382
382
|
const COVERAGE_LEVELS: Readonly<Record<CoverageLevelName$1, CoverageLevelPreset>>;
|
|
383
383
|
const COVERAGE_LEVELS_PER_FILE: Readonly<Record<CoverageLevelName$1, CoverageLevelPreset>>;
|
|
384
384
|
/**
|
|
@@ -576,7 +576,7 @@ interface AgentReporterConstructorOptions extends AgentReporterOptions {
|
|
|
576
576
|
* @see {@link https://vitest.dev/api/advanced/reporters.html | Vitest Reporter API}
|
|
577
577
|
* @public
|
|
578
578
|
*/
|
|
579
|
-
declare class AgentReporter {
|
|
579
|
+
export declare class AgentReporter {
|
|
580
580
|
private options;
|
|
581
581
|
private dbPath;
|
|
582
582
|
/**
|
|
@@ -1078,7 +1078,7 @@ interface DiscoverProjectsOptions {
|
|
|
1078
1078
|
* @returns Resolved projects and tag definitions
|
|
1079
1079
|
* @public
|
|
1080
1080
|
*/
|
|
1081
|
-
declare function discoverProjects(options?: DiscoverProjectsOptions): Promise<DiscoverProjectsResult>;
|
|
1081
|
+
export declare function discoverProjects(options?: DiscoverProjectsOptions): Promise<DiscoverProjectsResult>;
|
|
1082
1082
|
//#endregion
|
|
1083
1083
|
//#region src/utils/classify-helpers.d.ts
|
|
1084
1084
|
/**
|
|
@@ -1095,7 +1095,7 @@ declare function discoverProjects(options?: DiscoverProjectsOptions): Promise<Di
|
|
|
1095
1095
|
* No match returns an empty array.
|
|
1096
1096
|
* @public
|
|
1097
1097
|
*/
|
|
1098
|
-
declare function classifyByFilename(suffixMap: Record<string, ReadonlyArray<string>> | ReadonlyArray<readonly [RegExp, ReadonlyArray<string>]>): ClassifyFn;
|
|
1098
|
+
export declare function classifyByFilename(suffixMap: Record<string, ReadonlyArray<string>> | ReadonlyArray<readonly [RegExp, ReadonlyArray<string>]>): ClassifyFn;
|
|
1099
1099
|
/**
|
|
1100
1100
|
* Creates a ClassifyFn that maps directory segment paths to tag arrays.
|
|
1101
1101
|
*
|
|
@@ -1107,7 +1107,7 @@ declare function classifyByFilename(suffixMap: Record<string, ReadonlyArray<stri
|
|
|
1107
1107
|
* No match returns `[]`.
|
|
1108
1108
|
* @public
|
|
1109
1109
|
*/
|
|
1110
|
-
declare function classifyByDirectory(dirMap: Record<string, ReadonlyArray<string>>): ClassifyFn;
|
|
1110
|
+
export declare function classifyByDirectory(dirMap: Record<string, ReadonlyArray<string>>): ClassifyFn;
|
|
1111
1111
|
/**
|
|
1112
1112
|
* Composes multiple `ClassifyFn` values into one. Each classifier is called with
|
|
1113
1113
|
* the same context; results are concatenated in order and deduplicated by tag
|
|
@@ -1115,7 +1115,7 @@ declare function classifyByDirectory(dirMap: Record<string, ReadonlyArray<string
|
|
|
1115
1115
|
* returns `[]`.
|
|
1116
1116
|
* @public
|
|
1117
1117
|
*/
|
|
1118
|
-
declare function combineClassifiers(...fns: ReadonlyArray<ClassifyFn>): ClassifyFn;
|
|
1118
|
+
export declare function combineClassifiers(...fns: ReadonlyArray<ClassifyFn>): ClassifyFn;
|
|
1119
1119
|
//#endregion
|
|
1120
1120
|
//#region src/utils/find-test-files.d.ts
|
|
1121
1121
|
/**
|
|
@@ -1139,14 +1139,14 @@ declare function combineClassifiers(...fns: ReadonlyArray<ClassifyFn>): Classify
|
|
|
1139
1139
|
* @returns Absolute paths of matched test files
|
|
1140
1140
|
* @public
|
|
1141
1141
|
*/
|
|
1142
|
-
declare function findTestFiles(dir: string, patterns: ReadonlyArray<string>, fs?: WalkerFileSystem): Promise<ReadonlyArray<string>>;
|
|
1142
|
+
export declare function findTestFiles(dir: string, patterns: ReadonlyArray<string>, fs?: WalkerFileSystem): Promise<ReadonlyArray<string>>;
|
|
1143
1143
|
//#endregion
|
|
1144
1144
|
//#region src/layers/ReporterLive.d.ts
|
|
1145
1145
|
/**
|
|
1146
1146
|
* Composition layer for a single `AgentReporter` run. Wires SQLite, migrations, and all service layers.
|
|
1147
1147
|
* @public
|
|
1148
1148
|
*/
|
|
1149
|
-
declare const ReporterLive: (dbPath: string, logLevel?: LogLevel.LogLevel, logFile?: string) => Layer.Layer<CoverageAnalyzer | import("@vitest-agent/sdk").DataReader | import("@vitest-agent/sdk").DataStore | import("@vitest-agent/sdk").DetailResolver | import("@vitest-agent/sdk").EnvironmentDetector | import("@vitest-agent/sdk").ExecutorResolver | import("@vitest-agent/sdk").FormatSelector | import("@vitest-agent/sdk").HistoryTracker | import("@vitest-agent/sdk").OutputRenderer | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | NodeServices.NodeServices, SqliteMigrator.MigrationError | import("effect/unstable/sql/SqlError").SqlError, never>;
|
|
1149
|
+
export declare const ReporterLive: (dbPath: string, logLevel?: LogLevel.LogLevel, logFile?: string) => Layer.Layer<CoverageAnalyzer | import("@vitest-agent/sdk").DataReader | import("@vitest-agent/sdk").DataStore | import("@vitest-agent/sdk").DetailResolver | import("@vitest-agent/sdk").EnvironmentDetector | import("@vitest-agent/sdk").ExecutorResolver | import("@vitest-agent/sdk").FormatSelector | import("@vitest-agent/sdk").HistoryTracker | import("@vitest-agent/sdk").OutputRenderer | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | NodeServices.NodeServices, SqliteMigrator.MigrationError | import("effect/unstable/sql/SqlError").SqlError, never>;
|
|
1150
1150
|
//#endregion
|
|
1151
1151
|
//#region src/services/CoverageAnalyzer.d.ts
|
|
1152
1152
|
/**
|
|
@@ -1179,21 +1179,21 @@ declare const CoverageAnalyzer_base: Context.ServiceClass<CoverageAnalyzer, "vit
|
|
|
1179
1179
|
* Effect service for processing istanbul coverage maps into structured reports.
|
|
1180
1180
|
* @public
|
|
1181
1181
|
*/
|
|
1182
|
-
declare class CoverageAnalyzer extends CoverageAnalyzer_base {}
|
|
1182
|
+
export declare class CoverageAnalyzer extends CoverageAnalyzer_base {}
|
|
1183
1183
|
//#endregion
|
|
1184
1184
|
//#region src/layers/CoverageAnalyzerLive.d.ts
|
|
1185
1185
|
/**
|
|
1186
1186
|
* Live implementation of the CoverageAnalyzer service backed by istanbul.
|
|
1187
1187
|
* @public
|
|
1188
1188
|
*/
|
|
1189
|
-
declare const CoverageAnalyzerLive: Layer.Layer<CoverageAnalyzer>;
|
|
1189
|
+
export declare const CoverageAnalyzerLive: Layer.Layer<CoverageAnalyzer>;
|
|
1190
1190
|
//#endregion
|
|
1191
1191
|
//#region src/layers/CoverageAnalyzerTest.d.ts
|
|
1192
1192
|
/**
|
|
1193
1193
|
* Test-double layer factory for CoverageAnalyzer. Pass a pre-built `CoverageReport` to inject.
|
|
1194
1194
|
* @public
|
|
1195
1195
|
*/
|
|
1196
|
-
declare const CoverageAnalyzerTest: {
|
|
1196
|
+
export declare const CoverageAnalyzerTest: {
|
|
1197
1197
|
readonly layer: (data?: CoverageReport) => Layer.Layer<CoverageAnalyzer>;
|
|
1198
1198
|
};
|
|
1199
1199
|
//#endregion
|
|
@@ -1250,21 +1250,21 @@ declare const ConfigValidation_base: Context.ServiceClass<ConfigValidation, "vit
|
|
|
1250
1250
|
* Effect service for validating Vitest + plugin coverage configuration.
|
|
1251
1251
|
* @public
|
|
1252
1252
|
*/
|
|
1253
|
-
declare class ConfigValidation extends ConfigValidation_base {}
|
|
1253
|
+
export declare class ConfigValidation extends ConfigValidation_base {}
|
|
1254
1254
|
//#endregion
|
|
1255
1255
|
//#region src/layers/ConfigValidationLive.d.ts
|
|
1256
1256
|
/**
|
|
1257
1257
|
* Live implementation of the ConfigValidation service running the built-in rule registry.
|
|
1258
1258
|
* @public
|
|
1259
1259
|
*/
|
|
1260
|
-
declare const ConfigValidationLive: Layer.Layer<ConfigValidation>;
|
|
1260
|
+
export declare const ConfigValidationLive: Layer.Layer<ConfigValidation>;
|
|
1261
1261
|
//#endregion
|
|
1262
1262
|
//#region src/layers/ConfigValidationTest.d.ts
|
|
1263
1263
|
/**
|
|
1264
1264
|
* Test-double layer factory for ConfigValidation. Pass a pre-built `ValidationResult` to inject.
|
|
1265
1265
|
* @public
|
|
1266
1266
|
*/
|
|
1267
|
-
declare const ConfigValidationTest: {
|
|
1267
|
+
export declare const ConfigValidationTest: {
|
|
1268
1268
|
readonly layer: (override?: ValidationResult) => Layer.Layer<ConfigValidation>;
|
|
1269
1269
|
};
|
|
1270
1270
|
//#endregion
|
|
@@ -1275,7 +1275,7 @@ declare const ConfigValidationTest: {
|
|
|
1275
1275
|
* @returns A filtered map of relevant environment variable keys and values
|
|
1276
1276
|
* @public
|
|
1277
1277
|
*/
|
|
1278
|
-
declare function captureEnvVars(env: Record<string, string | undefined>): Record<string, string>;
|
|
1278
|
+
export declare function captureEnvVars(env: Record<string, string | undefined>): Record<string, string>;
|
|
1279
1279
|
//#endregion
|
|
1280
1280
|
//#region src/utils/capture-settings.d.ts
|
|
1281
1281
|
/**
|
|
@@ -1285,14 +1285,14 @@ declare function captureEnvVars(env: Record<string, string | undefined>): Record
|
|
|
1285
1285
|
* @returns A `SettingsInput` ready for persistence
|
|
1286
1286
|
* @public
|
|
1287
1287
|
*/
|
|
1288
|
-
declare function captureSettings(config: Record<string, unknown>, vitestVersion: string): SettingsInput;
|
|
1288
|
+
export declare function captureSettings(config: Record<string, unknown>, vitestVersion: string): SettingsInput;
|
|
1289
1289
|
/**
|
|
1290
1290
|
* Compute a stable SHA-256 hash of a settings record for change detection.
|
|
1291
1291
|
* @param settings - The settings record to hash (keys are sorted for stability)
|
|
1292
1292
|
* @returns A hex-encoded SHA-256 digest
|
|
1293
1293
|
* @public
|
|
1294
1294
|
*/
|
|
1295
|
-
declare function hashSettings(settings: Record<string, unknown>): string;
|
|
1295
|
+
export declare function hashSettings(settings: Record<string, unknown>): string;
|
|
1296
1296
|
//#endregion
|
|
1297
1297
|
//#region src/utils/process-failure.d.ts
|
|
1298
1298
|
/**
|
|
@@ -1328,7 +1328,7 @@ interface VitestErrorLike {
|
|
|
1328
1328
|
* still be populated even when the signature is null.
|
|
1329
1329
|
* @public
|
|
1330
1330
|
*/
|
|
1331
|
-
declare const processFailure: (error: VitestErrorLike) => {
|
|
1331
|
+
export declare const processFailure: (error: VitestErrorLike) => {
|
|
1332
1332
|
frames: ReadonlyArray<StackFrameInput>;
|
|
1333
1333
|
signatureHash: string | null;
|
|
1334
1334
|
};
|
|
@@ -1345,7 +1345,7 @@ type VitestThresholdsInput = Record<string, unknown>;
|
|
|
1345
1345
|
* @returns Normalized thresholds with global, perFile, and pattern entries
|
|
1346
1346
|
* @public
|
|
1347
1347
|
*/
|
|
1348
|
-
declare function resolveThresholds(input: VitestThresholdsInput | undefined): ResolvedThresholds;
|
|
1348
|
+
export declare function resolveThresholds(input: VitestThresholdsInput | undefined): ResolvedThresholds;
|
|
1349
1349
|
//#endregion
|
|
1350
1350
|
//#region src/utils/strip-console-reporters.d.ts
|
|
1351
1351
|
/**
|
|
@@ -1360,7 +1360,7 @@ declare function resolveThresholds(input: VitestThresholdsInput | undefined): Re
|
|
|
1360
1360
|
* @see {@link https://vitest.dev/api/advanced/reporters.html | Vitest Reporter docs}
|
|
1361
1361
|
* @internal
|
|
1362
1362
|
*/
|
|
1363
|
-
declare const CONSOLE_REPORTERS: Set<string>;
|
|
1363
|
+
export declare const CONSOLE_REPORTERS: Set<string>;
|
|
1364
1364
|
/**
|
|
1365
1365
|
* Filter out built-in console reporters from a Vitest reporters array.
|
|
1366
1366
|
*
|
|
@@ -1373,19 +1373,19 @@ declare const CONSOLE_REPORTERS: Set<string>;
|
|
|
1373
1373
|
*
|
|
1374
1374
|
* @internal
|
|
1375
1375
|
*/
|
|
1376
|
-
declare function stripConsoleReporters(reporters: unknown[]): unknown[];
|
|
1376
|
+
export declare function stripConsoleReporters(reporters: unknown[]): unknown[];
|
|
1377
1377
|
//#endregion
|
|
1378
1378
|
//#region src/index.d.ts
|
|
1379
1379
|
/** Preset map for coverage levels without per-file enforcement. Mirrors `AgentPlugin.COVERAGE_LEVELS`. @public */
|
|
1380
|
-
declare const COVERAGE_LEVELS: Readonly<Record<import("@vitest-agent/sdk").CoverageLevelName, CoverageLevelPreset>>;
|
|
1380
|
+
export declare const COVERAGE_LEVELS: Readonly<Record<import("@vitest-agent/sdk").CoverageLevelName, CoverageLevelPreset>>;
|
|
1381
1381
|
/** Preset map for coverage levels with per-file enforcement. Mirrors `AgentPlugin.COVERAGE_LEVELS_PER_FILE`. @public */
|
|
1382
|
-
declare const COVERAGE_LEVELS_PER_FILE: Readonly<Record<import("@vitest-agent/sdk").CoverageLevelName, CoverageLevelPreset>>;
|
|
1382
|
+
export declare const COVERAGE_LEVELS_PER_FILE: Readonly<Record<import("@vitest-agent/sdk").CoverageLevelName, CoverageLevelPreset>>;
|
|
1383
1383
|
/** Auto-update tolerance functions for `coverage.thresholds.autoUpdate`. Mirrors `AgentPlugin.COVERAGE_AUTOUPDATE`. @public */
|
|
1384
|
-
declare const COVERAGE_AUTOUPDATE: Readonly<{
|
|
1384
|
+
export declare const COVERAGE_AUTOUPDATE: Readonly<{
|
|
1385
1385
|
standard: (n: number) => number;
|
|
1386
1386
|
strict: (n: number) => number;
|
|
1387
1387
|
lenient: (n: number) => number;
|
|
1388
1388
|
}>;
|
|
1389
1389
|
//#endregion
|
|
1390
|
-
export { type AddProjectInput,
|
|
1390
|
+
export { type AddProjectInput, type AgentPluginConstructorOptions, type AgentReporterConstructorOptions, type ClassifyContext, type ClassifyFn, type CoverageInput, CoverageLevel, type CoverageLevelName, type CoverageLevelPreset, type CoverageOptions, type DiscoverBuilder, type DiscoverInput, type PackageJson as DiscoverPackageJson, type DiscoverProjectsOptions, type DiscoverProjectsResult, type DiscoverResult, type DiscoverStrategyCreateOptions, type DiscoverStrategyExtendOptions, type InjectTagsResult, type ModuleInfo, type TagOptions, type ValidationError, type ValidationInfo, type ValidationInput, type ValidationResult, type ValidationWarning, type VitestErrorLike, type VitestStackFrameLike, type VitestThresholdsInput, type WalkerEntry, type WalkerEntryStat, type WalkerFileSystem, resolveCoverageInput, validateCoverageConfig };
|
|
1391
1391
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest-agent/plugin",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Vitest plugin for the vitest-agent ecosystem: owns persistence, classification, baselines, trends, and dispatches rendering to a configurable reporter.",
|
|
6
6
|
"keywords": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@effect/sql-sqlite-node": "4.0.0-rc.109",
|
|
44
44
|
"@effected/workspaces": "^0.19.0",
|
|
45
45
|
"@vitest-agent/cli": "2.2.14",
|
|
46
|
-
"@vitest-agent/mcp": "2.4.
|
|
46
|
+
"@vitest-agent/mcp": "2.4.14",
|
|
47
47
|
"@vitest-agent/reporter": "2.2.3",
|
|
48
48
|
"@vitest-agent/sdk": "2.5.0",
|
|
49
49
|
"effect": "4.0.0-rc.109",
|
package/plugin.js
CHANGED
|
@@ -114,7 +114,7 @@ const coverageDirDecidedByVitest = /* @__PURE__ */ new WeakSet();
|
|
|
114
114
|
*
|
|
115
115
|
* @public
|
|
116
116
|
*/
|
|
117
|
-
const CURRENT_PLUGIN_VERSION = "2.5.
|
|
117
|
+
const CURRENT_PLUGIN_VERSION = "2.5.6";
|
|
118
118
|
const TEST_FILE_DIR_RE = new RegExp(`/(?:${SRC_DIR}|${TEST_DIR})/`);
|
|
119
119
|
const isTestFile = (id) => isTestFileName(id) && TEST_FILE_DIR_RE.test(id);
|
|
120
120
|
/**
|