@vitest-agent/mcp 1.3.1 → 1.3.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
@@ -275,6 +275,7 @@ declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
275
275
  readonly project: string;
276
276
  readonly updatedAt: string;
277
277
  readonly tests: readonly {
278
+ readonly modulePath: string;
278
279
  readonly fullName: string;
279
280
  readonly runs: readonly {
280
281
  readonly timestamp: string;
@@ -284,6 +285,7 @@ declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
284
285
  };
285
286
  readonly flaky: readonly {
286
287
  readonly fullName: string;
288
+ readonly modulePath: string;
287
289
  readonly project: string;
288
290
  readonly passCount: number;
289
291
  readonly failCount: number;
@@ -292,6 +294,7 @@ declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
292
294
  }[];
293
295
  readonly persistent: readonly {
294
296
  readonly fullName: string;
297
+ readonly modulePath: string;
295
298
  readonly project: string;
296
299
  readonly consecutiveFailures: number;
297
300
  readonly firstFailedAt: string;
@@ -299,6 +302,7 @@ declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
299
302
  readonly lastErrorMessage: string | null;
300
303
  }[];
301
304
  readonly recovered: readonly {
305
+ readonly modulePath: string;
302
306
  readonly fullName: string;
303
307
  readonly recentRuns: readonly ("failed" | "passed")[];
304
308
  }[];
package/index.js CHANGED
@@ -11,7 +11,7 @@ import { startMcpServer } from "./server.js";
11
11
  *
12
12
  * @public
13
13
  */
14
- const CURRENT_MCP_VERSION = "1.3.1";
14
+ const CURRENT_MCP_VERSION = "1.3.2";
15
15
 
16
16
  //#endregion
17
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.3.1",
3
+ "version": "1.3.2",
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.2.0",
48
+ "@vitest-agent/sdk": "1.3.0",
49
49
  "effect": "^3.21.4",
50
50
  "zod": "^4.4.3"
51
51
  },
package/tools/history.js CHANGED
@@ -14,6 +14,7 @@ import { Effect, ParseResult, Schema } from "effect";
14
14
  */
15
15
  const FlakyTestRow = Schema.Struct({
16
16
  fullName: Schema.String.annotations({ description: "Full hierarchical test name (`describe > it`)." }),
17
+ modulePath: Schema.String.annotations({ description: "Project-relative test module path -- disambiguates same-named tests across files." }),
17
18
  project: Schema.String,
18
19
  passCount: Schema.Number.annotations({ description: "Number of passing runs in the recent window." }),
19
20
  failCount: Schema.Number.annotations({ description: "Number of failing runs in the recent window." }),
@@ -25,6 +26,7 @@ const FlakyTestRow = Schema.Struct({
25
26
  });
26
27
  const PersistentFailureRow = Schema.Struct({
27
28
  fullName: Schema.String,
29
+ modulePath: Schema.String.annotations({ description: "Project-relative test module path -- disambiguates same-named tests across files." }),
28
30
  project: Schema.String,
29
31
  consecutiveFailures: Schema.Number.annotations({ description: "Length of the current uninterrupted failure streak." }),
30
32
  firstFailedAt: Schema.String.annotations({ description: "ISO-8601 timestamp of the first failure in this streak." }),
@@ -35,6 +37,7 @@ const PersistentFailureRow = Schema.Struct({
35
37
  description: "A test that has failed in every recent run since `firstFailedAt`."
36
38
  });
37
39
  const RecoveredTestRow = Schema.Struct({
40
+ modulePath: Schema.String.annotations({ description: "Project-relative test module path -- disambiguates same-named tests across files." }),
38
41
  fullName: Schema.String,
39
42
  recentRuns: Schema.Array(Schema.Literal("passed", "failed")).annotations({ description: "Last 10 run states for this test, oldest first." })
40
43
  }).annotations({
@@ -61,13 +64,13 @@ const formatTestHistoryMarkdown = (data) => {
61
64
  for (const test of data.flaky) {
62
65
  const total = test.passCount + test.failCount;
63
66
  const passRate = total > 0 ? (test.passCount / total * 100).toFixed(0) : "0";
64
- lines.push(`### ⚠️ ${test.fullName}`, "", `- Pass rate: ${passRate}% (${test.passCount}/${total})`, `- Last state: ${test.lastState}`, `- Last run: ${new Date(test.lastTimestamp).toLocaleString()}`, "");
67
+ lines.push(`### ⚠️ ${test.fullName}`, "", `- Module: \`${test.modulePath}\``, `- Pass rate: ${passRate}% (${test.passCount}/${total})`, `- Last state: ${test.lastState}`, `- Last run: ${new Date(test.lastTimestamp).toLocaleString()}`, "");
65
68
  }
66
69
  }
67
70
  if (data.persistent.length > 0) {
68
71
  lines.push("## Persistent Failures", "", "Tests that have failed in consecutive runs:", "");
69
72
  for (const failure of data.persistent) {
70
- lines.push(`### ❌ ${failure.fullName}`, "", `- Consecutive failures: ${failure.consecutiveFailures}`, `- First failed: ${new Date(failure.firstFailedAt).toLocaleString()}`, `- Last failed: ${new Date(failure.lastFailedAt).toLocaleString()}`);
73
+ lines.push(`### ❌ ${failure.fullName}`, "", `- Module: \`${failure.modulePath}\``, `- Consecutive failures: ${failure.consecutiveFailures}`, `- First failed: ${new Date(failure.firstFailedAt).toLocaleString()}`, `- Last failed: ${new Date(failure.lastFailedAt).toLocaleString()}`);
71
74
  if (failure.lastErrorMessage !== null) lines.push(`- Last error: ${failure.lastErrorMessage}`);
72
75
  lines.push("");
73
76
  }
@@ -76,7 +79,7 @@ const formatTestHistoryMarkdown = (data) => {
76
79
  lines.push("## Recovered Tests", "", "Tests that previously failed but are now passing:", "");
77
80
  for (const test of data.recovered) {
78
81
  const runViz = test.recentRuns.map((s) => s === "passed" ? "P" : "F").join("");
79
- lines.push(`- ✅ **${test.fullName}** — recent runs: \`${runViz}\``);
82
+ lines.push(`- ✅ **${test.fullName}** (${test.modulePath}) — recent runs: \`${runViz}\``);
80
83
  }
81
84
  lines.push("");
82
85
  }
@@ -99,12 +102,13 @@ const testHistory = publicProcedure.input(Schema.standardSchemaV1(Schema.Struct(
99
102
  const recovered = history.tests.filter((t) => {
100
103
  const runs = t.runs;
101
104
  if (runs.length < 2) return false;
102
- const last = runs[runs.length - 1];
103
- const prev = runs[runs.length - 2];
104
- return last !== void 0 && prev !== void 0 && last.state === "passed" && prev.state === "failed";
105
+ const mostRecent = runs[0];
106
+ const previous = runs[1];
107
+ return mostRecent !== void 0 && previous !== void 0 && mostRecent.state === "passed" && previous.state === "failed";
105
108
  }).map((t) => ({
109
+ modulePath: t.modulePath,
106
110
  fullName: t.fullName,
107
- recentRuns: t.runs.slice(-10).map((r) => r.state)
111
+ recentRuns: t.runs.slice(0, 10).reverse().map((r) => r.state)
108
112
  }));
109
113
  const hasData = history.tests.length > 0 || flaky.length > 0 || persistent.length > 0;
110
114
  return {