@vitest-agent/plugin 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 C. Spencer Beggs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # @vitest-agent/plugin
2
+
3
+ [![npm](https://img.shields.io/npm/v/@vitest-agent/plugin?label=npm&color=cb3837)](https://www.npmjs.com/package/@vitest-agent/plugin)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-4caf50.svg)](https://opensource.org/licenses/MIT)
5
+ [![TypeScript 6.0](https://img.shields.io/badge/TypeScript-6.0-3178c6.svg)](https://www.typescriptlang.org/)
6
+
7
+ Vitest plugin that turns your test suite into a live data source for LLM coding agents. Handles persistence, failure classification, coverage policy enforcement, project discovery and a configurable reporter chain — the CLI and MCP server arrive as required peers and are wired automatically.
8
+
9
+ ## Features
10
+
11
+ - **`AgentPlugin`** — drop into `vitest.config.ts`; auto-detects human, agent and CI executors and adapts console output accordingly
12
+ - **Project discovery** — `AgentPlugin.discover()` scans workspace packages, returns `{ projects, tags }` ready for `test.projects` and `test.tags`
13
+ - **Coverage presets** — `COVERAGE_LEVELS` and `COVERAGE_LEVELS_PER_FILE` return dual-output `{ thresholds, coverageTargets }` objects; `COVERAGE_AUTOUPDATE` tolerance functions plug into Vitest's native `autoUpdate`
14
+ - **Failure classification** — persists per-test errors, computes failure signatures, classifies tests as stable, new-failure, persistent, flaky or recovered across runs
15
+ - **Custom reporters** — pass any `VitestAgentReporterFactory` as the `reporter` option; the default wires `DefaultVitestAgentReporter` from `@vitest-agent/reporter`
16
+ - **`onRunEvent` tap** — optional read-only callback receiving every `RunEvent` in parallel with the renderer, safe to throw from
17
+
18
+ ## Install
19
+
20
+ ```bash
21
+ npm install --save-dev @vitest-agent/plugin
22
+ # or
23
+ pnpm add -D @vitest-agent/plugin
24
+ ```
25
+
26
+ The required peers `@vitest-agent/cli` and `@vitest-agent/mcp` install automatically with npm 7+ and pnpm (`autoInstallPeers: true`).
27
+
28
+ ## Quick start
29
+
30
+ ```ts
31
+ import { AgentPlugin } from "@vitest-agent/plugin";
32
+ import { defineConfig } from "vitest/config";
33
+
34
+ export default async () => {
35
+ const { projects, tags } = await AgentPlugin.discover();
36
+ const coverage = AgentPlugin.COVERAGE_LEVELS.standard;
37
+ return defineConfig({
38
+ plugins: [AgentPlugin({ console: { human: "stream", agent: "agent" }, coverageTargets: coverage.coverageTargets })],
39
+ test: { ...(projects ? { projects } : {}), tags, coverage: { enabled: true, provider: "v8", thresholds: coverage.thresholds } },
40
+ });
41
+ };
42
+ ```
43
+
44
+ ## Documentation
45
+
46
+ Full guide, configuration reference and the Claude Code plugin docs live at [vitest-agent.dev/guide](https://vitest-agent.dev/guide).
47
+
48
+ ## License
49
+
50
+ [MIT](LICENSE)