@vitest-agent/plugin 5.2.0 → 5.2.2

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 CHANGED
@@ -1,13 +1,11 @@
1
1
  import "@effected/env";
2
- import { EnvironmentDetector, PlatformOptions, PlatformServices, SettingsInput, StackFrameInput } from "@vitest-agent/engine";
2
+ import { EnvironmentDetector, PlatformLiveError, PlatformOptions, PlatformServices, SettingsInput, StackFrameInput } from "@vitest-agent/engine";
3
3
  import { AgentPluginOptions, AgentReporterOptions, ConsoleMode, CoverageBaselines, CoverageInput, CoverageLevel, CoverageLevelName, CoverageLevelName as CoverageLevelName$1, CoverageReport, OutputFormat, ResolvedReporterConfig, ResolvedThresholds, RunEvent, Transport, VitestAgentReporterFactory, resolveCoverageInput, validateCoverageConfig } from "@vitest-agent/sdk";
4
4
  import { Context, Effect, Layer, Option } from "effect";
5
5
  import { TestProjectInlineConfiguration, TestTagDefinition } from "vitest/config";
6
6
  import { ResolvedConfig, VitestPluginContext } from "vitest/node";
7
7
  import { WorkspacesSyncOptions } from "@effected/workspaces/node-sync";
8
8
  import { SourceMap } from "magic-string";
9
- import { MigrationError } from "effect/sql/Migrator";
10
- import { SqlError } from "effect/sql/SqlError";
11
9
  //#region src/utils/tag.d.ts
12
10
  /**
13
11
  * Options for a `Tag`, mirroring `TestTagDefinition` minus the `name` field.
@@ -1296,17 +1294,16 @@ export declare class CoverageAnalyzer extends CoverageAnalyzer_base {}
1296
1294
  * `PlatformLive` (SQLite, migrations, Node platform services, logger and
1297
1295
  * the shared service layers) plus the plugin-only `CoverageAnalyzer`.
1298
1296
  *
1299
- * The return type is spelled out so the emitted declaration names
1300
- * `MigrationError` through `effect/sql/Migrator`; left to
1301
- * inference it is emitted via `@effect/sql-sqlite-node/SqliteMigrator`,
1302
- * which this package does not depend on and a root typecheck cannot
1303
- * resolve.
1297
+ * The return type is spelled out so the emitted declaration names the
1298
+ * error through the engine's `PlatformLiveError` alias; left to inference
1299
+ * it is emitted via `@effected/store`, which this package does not depend
1300
+ * on and a root typecheck cannot resolve.
1304
1301
  *
1305
1302
  * @param options - forwarded to `PlatformLive`; the reporter passes
1306
1303
  * `process.env` as `env`
1307
1304
  * @public
1308
1305
  */
1309
- export declare const ReporterLive: (options: PlatformOptions) => Layer.Layer<CoverageAnalyzer | PlatformServices, MigrationError | SqlError>;
1306
+ export declare const ReporterLive: (options: PlatformOptions) => Layer.Layer<CoverageAnalyzer | PlatformServices, PlatformLiveError>;
1310
1307
  //#endregion
1311
1308
  //#region src/layers/CoverageAnalyzerLive.d.ts
1312
1309
  /**
@@ -8,11 +8,10 @@ import { Layer } from "effect";
8
8
  * `PlatformLive` (SQLite, migrations, Node platform services, logger and
9
9
  * the shared service layers) plus the plugin-only `CoverageAnalyzer`.
10
10
  *
11
- * The return type is spelled out so the emitted declaration names
12
- * `MigrationError` through `effect/sql/Migrator`; left to
13
- * inference it is emitted via `@effect/sql-sqlite-node/SqliteMigrator`,
14
- * which this package does not depend on and a root typecheck cannot
15
- * resolve.
11
+ * The return type is spelled out so the emitted declaration names the
12
+ * error through the engine's `PlatformLiveError` alias; left to inference
13
+ * it is emitted via `@effected/store`, which this package does not depend
14
+ * on and a root typecheck cannot resolve.
16
15
  *
17
16
  * @param options - forwarded to `PlatformLive`; the reporter passes
18
17
  * `process.env` as `env`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitest-agent/plugin",
3
- "version": "5.2.0",
3
+ "version": "5.2.2",
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": [
@@ -44,16 +44,16 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@effect/platform-node": "^4.0.0",
47
- "@effected/cli": "^0.11.0",
47
+ "@effected/cli": "^0.12.0",
48
48
  "@effected/env": "^0.1.0",
49
49
  "@effected/glob": "^0.10.0",
50
50
  "@effected/walker": "^0.15.0",
51
51
  "@effected/workspaces": "^0.31.0",
52
- "@vitest-agent/cli": "4.0.0",
53
- "@vitest-agent/engine": "0.4.0",
54
- "@vitest-agent/mcp": "5.1.6",
55
- "@vitest-agent/reporter": "4.0.0",
56
- "@vitest-agent/sdk": "5.2.0",
52
+ "@vitest-agent/cli": "4.0.2",
53
+ "@vitest-agent/engine": "0.6.0",
54
+ "@vitest-agent/mcp": "5.1.8",
55
+ "@vitest-agent/reporter": "4.1.0",
56
+ "@vitest-agent/sdk": "6.0.0",
57
57
  "effect": "^4.0.0",
58
58
  "magic-string": "^1.4.2"
59
59
  },
package/reporter.js CHANGED
@@ -7,6 +7,7 @@ import { captureSettings, hashSettings } from "./utils/capture-settings.js";
7
7
  import { isPartialRun } from "./utils/is-partial-run.js";
8
8
  import { processFailure } from "./utils/process-failure.js";
9
9
  import { assertReportCapable, createReportWriter } from "./utils/report-writer.js";
10
+ import { resolveNoColor } from "./utils/resolve-no-color.js";
10
11
  import { routeRenderedOutput } from "./utils/route-rendered-output.js";
11
12
  import { stringifyFailureValue } from "./utils/stringify-failure-value.js";
12
13
  import { mkdirSync, statSync } from "node:fs";
@@ -564,16 +565,17 @@ var AgentReporter = class {
564
565
  hasFailures: false,
565
566
  belowTargets: false,
566
567
  hasTargets: !!opts.coverageTargets
567
- }, opts.detail)
568
+ }, opts.detail),
569
+ noColor: yield* resolveNoColor
568
570
  };
569
571
  });
570
- const { env, executor, format, detail } = await Effect.runPromise(initProgram.pipe(Effect.provide(OutputPipelineLive(process.env)), Effect.provide(NodeServices.layer)));
572
+ const { env, executor, format, detail, noColor } = await Effect.runPromise(initProgram.pipe(Effect.provide(OutputPipelineLive(process.env)), Effect.provide(NodeServices.layer)));
571
573
  const kit = buildReporterKit({
572
574
  env,
573
575
  executor,
574
576
  format,
575
577
  detail,
576
- noColor: !!process.env.NO_COLOR,
578
+ noColor,
577
579
  consoleMode: opts.consoleMode ?? "passthrough",
578
580
  mcp: opts.mcp ?? false,
579
581
  githubActions: opts.githubActions,
@@ -1176,7 +1178,7 @@ var AgentReporter = class {
1176
1178
  executor,
1177
1179
  format,
1178
1180
  detail,
1179
- noColor: !!process.env.NO_COLOR,
1181
+ noColor: yield* resolveNoColor,
1180
1182
  consoleMode: opts.consoleMode ?? "passthrough",
1181
1183
  mcp: opts.mcp ?? false,
1182
1184
  githubActions: opts.githubActions,
@@ -1728,7 +1730,7 @@ var AgentReporter = class {
1728
1730
  executor,
1729
1731
  format,
1730
1732
  detail,
1731
- noColor: !!process.env.NO_COLOR,
1733
+ noColor: yield* resolveNoColor,
1732
1734
  consoleMode: opts.consoleMode ?? "passthrough",
1733
1735
  mcp: opts.mcp ?? false,
1734
1736
  githubActions: opts.githubActions,
@@ -0,0 +1,13 @@
1
+ import { TerminalEnv } from "@effected/env";
2
+ import { Effect } from "effect";
3
+
4
+ //#region src/utils/resolve-no-color.ts
5
+ /**
6
+ * Whether the reporter should render without colour, decided by the kit's
7
+ * terminal rule rather than `NO_COLOR` alone: `FORCE_COLOR` beats `NO_COLOR`,
8
+ * and `NODE_DISABLE_COLORS`, `TERM=dumb` and a non-TTY stdout all disable it.
9
+ */
10
+ const resolveNoColor = TerminalEnv.colorLevel("stdout").pipe(Effect.map((level) => level === "none"));
11
+
12
+ //#endregion
13
+ export { resolveNoColor };
package/version.js CHANGED
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * @public
10
10
  */
11
- const CURRENT_PLUGIN_VERSION = "5.2.0";
11
+ const CURRENT_PLUGIN_VERSION = "5.2.2";
12
12
 
13
13
  //#endregion
14
14
  export { CURRENT_PLUGIN_VERSION };