@vitest-agent/mcp 1.0.1 → 1.1.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/bin/vitest-agent-mcp.js +1 -17
- package/index.d.ts +322 -313
- package/index.js +2 -4
- package/middleware/idempotency.js +1 -1
- package/package.json +2 -2
- package/{public/patterns → patterns}/_meta.json +1 -1
- package/{public/patterns → patterns}/operating-vitest-agent-as-an-agent.md +17 -8
- package/{public/patterns → patterns}/running-tests-via-mcp.md +45 -0
- package/resources/index.js +1 -1
- package/resources/manifest-schema.js +1 -1
- package/tools/acceptance-metrics.js +1 -1
- package/tools/cache-health.js +1 -1
- package/tools/commit-changes.js +1 -1
- package/tools/configure.js +1 -1
- package/tools/coverage.js +1 -1
- package/tools/errors.js +1 -1
- package/tools/failure-signature-get.js +1 -1
- package/tools/file-coverage.js +1 -1
- package/tools/history.js +1 -1
- package/tools/inventory.js +1 -1
- package/tools/overview.js +1 -1
- package/tools/run-tests.js +15 -3
- package/tools/settings-list.js +1 -1
- package/tools/status.js +1 -1
- package/tools/tdd-artifact.js +1 -1
- package/tools/tdd-task.js +1 -1
- package/tools/test.js +1 -1
- package/tools/trends.js +1 -1
- package/tools/turn-search.js +1 -1
- /package/{public/patterns → patterns}/authoring-a-custom-vitest-agent-reporter.md +0 -0
- /package/{public/patterns → patterns}/known-issues-and-caveats.md +0 -0
- /package/{public/patterns → patterns}/silencing-leaking-output-in-tests.md +0 -0
- /package/{public/patterns → patterns}/testing-effect-schema-definitions.md +0 -0
- /package/{public/patterns → patterns}/testing-effect-services-with-mock-layers.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/ATTRIBUTION.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/advanced/artifacts.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/advanced/metadata.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/advanced/plugin.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/advanced/reporters.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/advanced/runner.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/advanced/test-case.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/advanced/test-collection.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/advanced/test-module.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/advanced/test-project.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/advanced/test-specification.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/advanced/test-suite.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/advanced/vitest.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/assert-type.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/assert.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/browser/assertions.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/browser/commands.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/browser/context.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/browser/interactivity.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/browser/locators.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/browser/react.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/browser/svelte.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/browser/vue.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/describe.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/expect-typeof.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/expect.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/hooks.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/mock.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/test.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/api/vi.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/alias.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/allowonly.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/api.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/attachmentsdir.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/bail.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/benchmark.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/api.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/commands.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/connecttimeout.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/detailspanelposition.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/enabled.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/expect.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/headless.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/instances.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/isolate.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/locators.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/orchestratorscripts.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/playwright.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/preview.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/provider.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/screenshotdirectory.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/screenshotfailures.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/testerhtmlpath.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/trace.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/trackunhandlederrors.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/ui.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/viewport.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/browser/webdriverio.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/cache.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/chaiconfig.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/clearmocks.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/coverage.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/css.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/dangerouslyignoreunhandlederrors.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/deps.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/detectasyncleaks.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/diff.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/dir.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/disableconsoleintercept.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/env.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/environment.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/environmentoptions.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/exclude.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/execargv.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/expandsnapshotdiff.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/expect.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/experimental.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/faketimers.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/fileparallelism.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/forcereruntriggers.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/globals.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/globalsetup.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/hideskippedtests.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/hooktimeout.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/include-source.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/include.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/includetasklocation.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/index.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/isolate.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/logheapusage.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/maxconcurrency.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/maxworkers.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/mockreset.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/mode.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/name.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/onconsolelog.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/onstacktrace.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/onunhandlederror.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/open.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/outputfile.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/passwithnotests.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/pool.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/printconsoletrace.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/projects.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/provide.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/reporters.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/resolvesnapshotpath.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/restoremocks.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/retry.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/root.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/runner.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/sequence.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/server.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/setupfiles.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/silent.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/slowtestthreshold.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/snapshotenvironment.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/snapshotformat.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/snapshotserializers.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/stricttags.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/tags.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/teardowntimeout.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/testnamepattern.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/testtimeout.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/typecheck.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/ui.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/unstubenvs.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/unstubglobals.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/update.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/vmmemorylimit.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/watch.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/config/watchtriggerpatterns.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/advanced/index.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/advanced/pool.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/advanced/reporters.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/advanced/tests.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/browser/aria-snapshots.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/browser/component-testing.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/browser/index.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/browser/multiple-setups.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/browser/trace-view.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/browser/visual-regression-testing.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/cli-generated.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/cli.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/common-errors.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/coverage.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/debugging.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/environment.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/extending-matchers.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/features.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/filtering.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/ide.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/improving-performance.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/in-source.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/index.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/learn/async.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/learn/debugging-tests.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/learn/matchers.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/learn/mock-functions.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/learn/setup-teardown.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/learn/snapshots.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/learn/testing-in-practice.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/learn/writing-tests-with-ai.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/learn/writing-tests.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/lifecycle.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/migration.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/mocking/classes.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/mocking/dates.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/mocking/file-system.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/mocking/functions.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/mocking/globals.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/mocking/modules.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/mocking/requests.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/mocking/timers.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/mocking.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/open-telemetry.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/parallelism.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/profiling-test-performance.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/projects.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/recipes.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/reporters.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/snapshot.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/test-annotations.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/test-context.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/test-tags.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/testing-types.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/ui.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/guide/using-plugins.md +0 -0
- /package/{public/vendor → vendor}/vitest-docs/manifest.json +0 -0
package/index.js
CHANGED
|
@@ -7,13 +7,11 @@ import { startMcpServer } from "./server.js";
|
|
|
7
7
|
/**
|
|
8
8
|
* The version of this package, inlined at build time from
|
|
9
9
|
* package.json#version via rslib-builder's __PACKAGE_VERSION__ substitution.
|
|
10
|
-
*
|
|
11
|
-
* partially-upgraded installs as a single stderr warning. See the root
|
|
12
|
-
* CLAUDE.md "Cross-package version drift" section.
|
|
10
|
+
* Exported for version introspection by downstream tooling.
|
|
13
11
|
*
|
|
14
12
|
* @public
|
|
15
13
|
*/
|
|
16
|
-
const CURRENT_MCP_VERSION = "1.0
|
|
14
|
+
const CURRENT_MCP_VERSION = "1.1.0";
|
|
17
15
|
|
|
18
16
|
//#endregion
|
|
19
17
|
export { CURRENT_MCP_VERSION, McpLive, appRouter, createCallerFactory, createCurrentSessionIdRef, createSessionContextRef, startMcpServer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest-agent/mcp",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Model Context Protocol server for vitest-agent. Exposes 53 tools for agent access to test data, TDD lifecycle, and session management.",
|
|
6
6
|
"keywords": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@effect/sql-sqlite-node": "^0.52.0",
|
|
46
46
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
47
47
|
"@trpc/server": "^11.18.0",
|
|
48
|
-
"@vitest-agent/sdk": "1.0
|
|
48
|
+
"@vitest-agent/sdk": "1.1.0",
|
|
49
49
|
"effect": "^3.21.4",
|
|
50
50
|
"zod": "^4.4.3"
|
|
51
51
|
},
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
{
|
|
58
58
|
"slug": "operating-vitest-agent-as-an-agent",
|
|
59
59
|
"title": "Operating vitest-agent as an Agent",
|
|
60
|
-
"summary": "Read first: the front-loaded facts an agent needs (no run_tests filter param, coverage-in-subset behavior,
|
|
60
|
+
"summary": "Read first: the front-loaded facts an agent needs (no run_tests filter param, coverage-in-subset behavior, consoleLeaks signal in run_tests output, VITEST_AGENT_CONSOLE CLI escape hatch, attribution is auto-recovered) with links to the deeper patterns.",
|
|
61
61
|
"annotations": {
|
|
62
62
|
"audience": ["assistant"],
|
|
63
63
|
"priority": 0.95
|
|
@@ -19,11 +19,14 @@ trial-and-error, then points you at the deeper patterns.
|
|
|
19
19
|
— global thresholds applied to partial coverage. There is no per-run
|
|
20
20
|
coverage toggle in `run_tests`; it inherits your `vitest.config`. For
|
|
21
21
|
isolated inspection use the CLI: `vitest run <file> --coverage.enabled=false`.
|
|
22
|
-
4. **
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
4. **Stray `console.*` is surfaced by `run_tests` as a signal, not raw logs.**
|
|
23
|
+
The `ok` result's `report.consoleLeaks` field lists writes by file with
|
|
24
|
+
counts, optional per-test attribution, and a truncated sample. `run_tests`
|
|
25
|
+
still null-routes Vitest's stdout; the signal captures what was printed
|
|
26
|
+
without forwarding raw log lines into agent context. To see the raw output
|
|
27
|
+
for a flagged file, run Vitest on the CLI:
|
|
28
|
+
`VITEST_AGENT_CONSOLE=passthrough pnpm test`. Details at
|
|
29
|
+
`vitest-agent://patterns/running-tests-via-mcp`.
|
|
27
30
|
5. **Session attribution is recovered for you.** The SessionStart hook writes
|
|
28
31
|
the `VITEST_AGENT_*` identity into the environment and the SDK recovers it —
|
|
29
32
|
you never set those vars by hand. The only behavioral knobs are
|
|
@@ -38,9 +41,15 @@ trial-and-error, then points you at the deeper patterns.
|
|
|
38
41
|
You do not configure vitest-agent through environment variables. The
|
|
39
42
|
`VITEST_AGENT_*` vars (chat id, conversation id, agent ids, project dir,
|
|
40
43
|
sidecar bin) are attribution plumbing written by the Claude Code plugin's
|
|
41
|
-
SessionStart hook and recovered automatically. The
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
SessionStart hook and recovered automatically. The vars you might set:
|
|
45
|
+
|
|
46
|
+
- `VITEST_REPORTER_LOG_LEVEL` / `VITEST_REPORTER_LOG_FILE` — diagnostic
|
|
47
|
+
logger (separate from the console reporter).
|
|
48
|
+
- `NO_COLOR` — disables ANSI color in rendered output.
|
|
49
|
+
- `VITEST_AGENT_CONSOLE=passthrough` — overrides the resolved console mode
|
|
50
|
+
for the active executor on a CLI `vitest` run. Useful when investigating
|
|
51
|
+
files flagged by `report.consoleLeaks`. Invalid-for-slot values warn to
|
|
52
|
+
stderr and are ignored.
|
|
44
53
|
|
|
45
54
|
## Where to go next
|
|
46
55
|
|
|
@@ -51,6 +51,51 @@ This is expected: your global coverage thresholds are applied to a partial run,
|
|
|
51
51
|
vitest run path/to/one.test.ts --coverage.enabled=false
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
## Stray console output — `report.consoleLeaks`
|
|
55
|
+
|
|
56
|
+
When the run produces stray `console.*` output, the `report` object on an
|
|
57
|
+
`"ok"` result carries an optional `consoleLeaks` field. It is omitted
|
|
58
|
+
entirely when the run produced no user console output.
|
|
59
|
+
|
|
60
|
+
Shape:
|
|
61
|
+
|
|
62
|
+
- `total` — total stray console writes across the run
|
|
63
|
+
- `byFile` — one entry per file that produced writes:
|
|
64
|
+
- `file` — the test file path
|
|
65
|
+
- `stdout` — writes to stdout-class streams (`log`, `info`, `debug`)
|
|
66
|
+
- `stderr` — writes to stderr-class streams (`error`, `warn`)
|
|
67
|
+
- `tests` (optional) — test names where writes were attributed
|
|
68
|
+
- `sample` (optional) — truncated excerpt of the first write in this file
|
|
69
|
+
- `truncated` (optional) — `true` when `byFile` was capped
|
|
70
|
+
|
|
71
|
+
Use `byFile[].file` to locate which files to investigate and `sample` to
|
|
72
|
+
find the call site, without dumping full log content into agent context.
|
|
73
|
+
The markdown summary line also surfaces the leak count inline (e.g.
|
|
74
|
+
`⚠ 3 stray console writes across 2 files (see consoleLeaks)`).
|
|
75
|
+
|
|
76
|
+
### Console-output visibility by surface
|
|
77
|
+
|
|
78
|
+
| Surface | Sees stray `console.*` | Per-test attribution |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| `run_tests` (MCP) | yes — `consoleLeaks` signal (counts + sample) | per file, per test where resolvable |
|
|
81
|
+
| Human at a TTY | yes — Vitest's own `stdout \|` / `stderr \|` lines | yes (TTY only) |
|
|
82
|
+
| Piped shell (default) | no — agent-shaped summary suppresses it | n/a |
|
|
83
|
+
| Piped shell + `VITEST_AGENT_CONSOLE=passthrough` | yes — raw passthrough | no (raw, unlabeled) |
|
|
84
|
+
|
|
85
|
+
### `VITEST_AGENT_CONSOLE` — CLI escape hatch
|
|
86
|
+
|
|
87
|
+
To see raw console output for a file that `consoleLeaks` flagged, run
|
|
88
|
+
Vitest directly on the CLI with the override set:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
VITEST_AGENT_CONSOLE=passthrough pnpm test
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
This overrides the plugin's resolved console mode to `passthrough` for
|
|
95
|
+
the active executor — Vitest's own reporters emit console output
|
|
96
|
+
unfiltered. An invalid value for the current executor slot warns to
|
|
97
|
+
stderr and is ignored.
|
|
98
|
+
|
|
54
99
|
## See also
|
|
55
100
|
|
|
56
101
|
- `vitest-agent://patterns/operating-vitest-agent-as-an-agent` — the orientation index
|
package/resources/index.js
CHANGED
|
@@ -43,4 +43,4 @@ const PatternsManifest = Schema.Struct({ patterns: Schema.Array(PatternEntry) })
|
|
|
43
43
|
const decodePatternsManifest = Schema.decodeUnknown(PatternsManifest);
|
|
44
44
|
|
|
45
45
|
//#endregion
|
|
46
|
-
export { decodePatternsManifest, decodeUpstreamManifest };
|
|
46
|
+
export { ManifestPage, PatternEntry, PatternsManifest, ResourceAnnotations, UpstreamManifest, decodePatternsManifest, decodeUpstreamManifest };
|
|
@@ -72,4 +72,4 @@ const acceptanceMetrics = publicProcedure.input(Schema.standardSchemaV1(Schema.S
|
|
|
72
72
|
})));
|
|
73
73
|
|
|
74
74
|
//#endregion
|
|
75
|
-
export { AcceptanceMetricsAsMarkdown, AcceptanceMetricsResult, acceptanceMetrics };
|
|
75
|
+
export { AcceptanceMetricsAsMarkdown, AcceptanceMetricsResult, acceptanceMetrics, formatAcceptanceMetricsMarkdown };
|
package/tools/cache-health.js
CHANGED
|
@@ -80,4 +80,4 @@ const cacheHealth = publicProcedure.query(async ({ ctx }) => ctx.runtime.runProm
|
|
|
80
80
|
})));
|
|
81
81
|
|
|
82
82
|
//#endregion
|
|
83
|
-
export { CacheHealthAsMarkdown, CacheHealthResult, cacheHealth };
|
|
83
|
+
export { CacheHealthAsMarkdown, CacheHealthResult, cacheHealth, formatCacheHealthMarkdown };
|
package/tools/commit-changes.js
CHANGED
|
@@ -61,4 +61,4 @@ const commitChanges = publicProcedure.input(Schema.standardSchemaV1(Schema.Struc
|
|
|
61
61
|
})));
|
|
62
62
|
|
|
63
63
|
//#endregion
|
|
64
|
-
export { CommitChangesAsMarkdown, CommitChangesResult, commitChanges };
|
|
64
|
+
export { CommitChangesAsMarkdown, CommitChangesResult, commitChanges, formatCommitChangesMarkdown };
|
package/tools/configure.js
CHANGED
package/tools/coverage.js
CHANGED
|
@@ -73,4 +73,4 @@ const testCoverage = publicProcedure.input(Schema.standardSchemaV1(Schema.Struct
|
|
|
73
73
|
})));
|
|
74
74
|
|
|
75
75
|
//#endregion
|
|
76
|
-
export { TestCoverageAsMarkdown, TestCoverageResult, testCoverage };
|
|
76
|
+
export { TestCoverageAsMarkdown, TestCoverageResult, formatTestCoverageMarkdown, testCoverage };
|
package/tools/errors.js
CHANGED
|
@@ -148,4 +148,4 @@ const testErrors = publicProcedure.input(Schema.standardSchemaV1(Schema.Struct({
|
|
|
148
148
|
})));
|
|
149
149
|
|
|
150
150
|
//#endregion
|
|
151
|
-
export { TestErrorsAsMarkdown, TestErrorsResult, testErrors };
|
|
151
|
+
export { TestErrorRow, TestErrorsAsMarkdown, TestErrorsResult, formatTestErrorsMarkdown, testErrors };
|
|
@@ -70,4 +70,4 @@ const failureSignatureGet = publicProcedure.input(Schema.standardSchemaV1(Schema
|
|
|
70
70
|
})));
|
|
71
71
|
|
|
72
72
|
//#endregion
|
|
73
|
-
export { FailureSignatureGetAsMarkdown, FailureSignatureGetResult, failureSignatureGet };
|
|
73
|
+
export { FailureSignatureGetAsMarkdown, FailureSignatureGetResult, failureSignatureGet, formatFailureSignatureMarkdown };
|
package/tools/file-coverage.js
CHANGED
|
@@ -103,4 +103,4 @@ const fileCoverage = publicProcedure.input(Schema.standardSchemaV1(Schema.Struct
|
|
|
103
103
|
})));
|
|
104
104
|
|
|
105
105
|
//#endregion
|
|
106
|
-
export { FileCoverageAsMarkdown, FileCoverageResult, fileCoverage };
|
|
106
|
+
export { FileCoverageAsMarkdown, FileCoverageResult, fileCoverage, formatFileCoverageMarkdown };
|
package/tools/history.js
CHANGED
|
@@ -118,4 +118,4 @@ const testHistory = publicProcedure.input(Schema.standardSchemaV1(Schema.Struct(
|
|
|
118
118
|
})));
|
|
119
119
|
|
|
120
120
|
//#endregion
|
|
121
|
-
export { TestHistoryAsMarkdown, TestHistoryResult, testHistory };
|
|
121
|
+
export { TestHistoryAsMarkdown, TestHistoryResult, formatTestHistoryMarkdown, testHistory };
|
package/tools/inventory.js
CHANGED
package/tools/overview.js
CHANGED
|
@@ -89,4 +89,4 @@ const testOverview = publicProcedure.input(Schema.standardSchemaV1(Schema.Struct
|
|
|
89
89
|
})));
|
|
90
90
|
|
|
91
91
|
//#endregion
|
|
92
|
-
export { TestOverviewAsMarkdown, TestOverviewResult, testOverview };
|
|
92
|
+
export { TestOverviewAsMarkdown, TestOverviewResult, formatTestOverviewMarkdown, testOverview };
|
package/tools/run-tests.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { publicProcedure } from "../context.js";
|
|
2
|
-
import { AgentReport, DataReader, DataStore, buildAgentReport } from "@vitest-agent/sdk";
|
|
2
|
+
import { AgentReport, DataReader, DataStore, buildAgentReport, buildConsoleLeaks, collectConsoleLeakEntries } from "@vitest-agent/sdk";
|
|
3
3
|
import { Effect, ParseResult, Schema } from "effect";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
import { Writable } from "node:stream";
|
|
@@ -209,6 +209,13 @@ function formatReportMarkdown(report, classifications) {
|
|
|
209
209
|
if (summary.skipped > 0) headlineParts.push(`${summary.skipped} skipped`);
|
|
210
210
|
lines.push(`## ${status} Vitest -- ${headlineParts.join(", ")} (${summary.duration}ms)`);
|
|
211
211
|
if (report.project) lines.push(`\nProject: ${report.project}`);
|
|
212
|
+
if (report.consoleLeaks !== void 0) {
|
|
213
|
+
const cl = report.consoleLeaks;
|
|
214
|
+
const writes = `${cl.total} stray console write${cl.total === 1 ? "" : "s"}`;
|
|
215
|
+
const plural = cl.byFile.length !== 1 || cl.truncated === true;
|
|
216
|
+
const files = `${cl.byFile.length}${cl.truncated === true ? "+" : ""} file${plural ? "s" : ""}`;
|
|
217
|
+
lines.push(`\n⚠ ${writes} across ${files} (see consoleLeaks)`);
|
|
218
|
+
}
|
|
212
219
|
for (const mod of report.failed) {
|
|
213
220
|
lines.push(`\n### \u274C \`${mod.file}\``);
|
|
214
221
|
if (mod.errors) for (const err of mod.errors) {
|
|
@@ -313,7 +320,12 @@ const runTests = publicProcedure.input(Schema.standardSchemaV1(Schema.Struct({
|
|
|
313
320
|
resolvedExpression
|
|
314
321
|
}
|
|
315
322
|
};
|
|
316
|
-
const
|
|
323
|
+
const baseReport = buildAgentReport(testModules, unhandledErrors, unhandledErrors.length > 0 || result.testModules.some((m) => m.state() === "failed") ? "failed" : "passed", { omitPassingTests: true });
|
|
324
|
+
const leaks = buildConsoleLeaks(collectConsoleLeakEntries(localVitest.state.getFiles()));
|
|
325
|
+
const report = leaks !== void 0 ? {
|
|
326
|
+
...baseReport,
|
|
327
|
+
consoleLeaks: leaks
|
|
328
|
+
} : baseReport;
|
|
317
329
|
let classifications;
|
|
318
330
|
try {
|
|
319
331
|
classifications = await ctx.runtime.runPromise(Effect.gen(function* () {
|
|
@@ -356,4 +368,4 @@ const runTests = publicProcedure.input(Schema.standardSchemaV1(Schema.Struct({
|
|
|
356
368
|
}));
|
|
357
369
|
|
|
358
370
|
//#endregion
|
|
359
|
-
export { RunTestsAsMarkdown, RunTestsResult, runTests };
|
|
371
|
+
export { RunTestsAsMarkdown, RunTestsResult, coerceErrors, composeTagExpression, formatNoMatchMarkdown, formatReportMarkdown, formatRunTestsMarkdown, runTests, sanitizeTestArgs, withStdioCaptured };
|
package/tools/settings-list.js
CHANGED
|
@@ -45,4 +45,4 @@ const settingsList = publicProcedure.input(Schema.standardSchemaV1(Schema.Struct
|
|
|
45
45
|
})));
|
|
46
46
|
|
|
47
47
|
//#endregion
|
|
48
|
-
export { SettingsListAsMarkdown, SettingsListResult, settingsList };
|
|
48
|
+
export { SettingsListAsMarkdown, SettingsListResult, formatSettingsListMarkdown, settingsList };
|
package/tools/status.js
CHANGED
package/tools/tdd-artifact.js
CHANGED
|
@@ -98,4 +98,4 @@ const tddArtifactList = publicProcedure.input(Schema.standardSchemaV1(TddArtifac
|
|
|
98
98
|
})));
|
|
99
99
|
|
|
100
100
|
//#endregion
|
|
101
|
-
export { TddArtifactListAsMarkdown, TddArtifactListResult, tddArtifactList };
|
|
101
|
+
export { TddArtifactListAsMarkdown, TddArtifactListResult, formatTddArtifactListMarkdown, tddArtifactList };
|
package/tools/tdd-task.js
CHANGED
package/tools/test.js
CHANGED
package/tools/trends.js
CHANGED
|
@@ -109,4 +109,4 @@ const testTrends = publicProcedure.input(Schema.standardSchemaV1(Schema.Struct({
|
|
|
109
109
|
})));
|
|
110
110
|
|
|
111
111
|
//#endregion
|
|
112
|
-
export { TestTrendsAsMarkdown, TestTrendsResult, testTrends };
|
|
112
|
+
export { TestTrendsAsMarkdown, TestTrendsResult, formatTestTrendsMarkdown, testTrends };
|
package/tools/turn-search.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|