@vitest-agent/mcp 2.4.10 → 2.4.11
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.js +1 -1
- package/package.json +2 -2
- package/tools/_project-groups.js +24 -0
- package/tools/inventory.js +15 -30
- package/tools/test.js +15 -28
package/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import { parseSessionEnvExports, recoverSessionContextFromSessionEnv } from "./s
|
|
|
12
12
|
*
|
|
13
13
|
* @public
|
|
14
14
|
*/
|
|
15
|
-
const CURRENT_MCP_VERSION = "2.4.
|
|
15
|
+
const CURRENT_MCP_VERSION = "2.4.11";
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
18
18
|
export { CURRENT_MCP_VERSION, McpLive, appRouter, buildMcpServer, createCallerFactory, createCurrentSessionIdRef, createSessionContextRef, parseSessionEnvExports, recoverSessionContextFromSessionEnv, startMcpServer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest-agent/mcp",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.11",
|
|
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": [
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@effect/sql-sqlite-node": "4.0.0-rc.109",
|
|
43
43
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
44
44
|
"@trpc/server": "^11.18.0",
|
|
45
|
-
"@vitest-agent/sdk": "2.4.
|
|
45
|
+
"@vitest-agent/sdk": "2.4.13",
|
|
46
46
|
"effect": "4.0.0-rc.109",
|
|
47
47
|
"zod": "^4.4.3"
|
|
48
48
|
},
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/tools/_project-groups.ts
|
|
4
|
+
const resolveProjectTargets = (project, listProjects) => project ? Effect.succeed([{ project }]) : Effect.map(listProjects(), (runs) => runs.map((run) => ({ project: run.project })));
|
|
5
|
+
const collectProjectRows = (targets, listRows) => Effect.gen(function* () {
|
|
6
|
+
const groups = [];
|
|
7
|
+
let total = 0;
|
|
8
|
+
for (const target of targets) {
|
|
9
|
+
const rows = yield* listRows(target.project);
|
|
10
|
+
if (rows.length === 0) continue;
|
|
11
|
+
groups.push({
|
|
12
|
+
project: target.project,
|
|
13
|
+
rows
|
|
14
|
+
});
|
|
15
|
+
total += rows.length;
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
groups,
|
|
19
|
+
total
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { collectProjectRows, resolveProjectTargets };
|
package/tools/inventory.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { publicProcedure } from "../context.js";
|
|
2
|
+
import { collectProjectRows, resolveProjectTargets } from "./_project-groups.js";
|
|
2
3
|
import { DataReader } from "@vitest-agent/sdk";
|
|
3
4
|
import { Effect, Match, Option, Schema, SchemaGetter } from "effect";
|
|
4
5
|
|
|
@@ -274,46 +275,30 @@ const inventory = publicProcedure.input(Schema.toStandardSchemaV1(InventoryInput
|
|
|
274
275
|
}),
|
|
275
276
|
module: (variant) => Effect.gen(function* () {
|
|
276
277
|
const reader = yield* DataReader;
|
|
277
|
-
const targets =
|
|
278
|
-
const
|
|
279
|
-
let total = 0;
|
|
280
|
-
for (const t of targets) {
|
|
281
|
-
const modules = yield* reader.listModules(t.project);
|
|
282
|
-
if (modules.length > 0) {
|
|
283
|
-
groups.push({
|
|
284
|
-
project: t.project,
|
|
285
|
-
modules
|
|
286
|
-
});
|
|
287
|
-
total += modules.length;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
278
|
+
const targets = yield* resolveProjectTargets(variant.project, () => reader.getRunsByProject());
|
|
279
|
+
const grouped = yield* collectProjectRows(targets, (project) => reader.listModules(project));
|
|
290
280
|
return {
|
|
291
281
|
inventoryKind: "module",
|
|
292
|
-
count: total,
|
|
293
|
-
groups
|
|
282
|
+
count: grouped.total,
|
|
283
|
+
groups: grouped.groups.map((group) => ({
|
|
284
|
+
project: group.project,
|
|
285
|
+
modules: group.rows
|
|
286
|
+
}))
|
|
294
287
|
};
|
|
295
288
|
}),
|
|
296
289
|
suite: (variant) => Effect.gen(function* () {
|
|
297
290
|
const reader = yield* DataReader;
|
|
298
291
|
const opts = {};
|
|
299
292
|
if (variant.module !== void 0) opts.module = variant.module;
|
|
300
|
-
const targets =
|
|
301
|
-
const
|
|
302
|
-
let total = 0;
|
|
303
|
-
for (const t of targets) {
|
|
304
|
-
const suites = yield* reader.listSuites(t.project, opts);
|
|
305
|
-
if (suites.length > 0) {
|
|
306
|
-
groups.push({
|
|
307
|
-
project: t.project,
|
|
308
|
-
suites
|
|
309
|
-
});
|
|
310
|
-
total += suites.length;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
293
|
+
const targets = yield* resolveProjectTargets(variant.project, () => reader.getRunsByProject());
|
|
294
|
+
const grouped = yield* collectProjectRows(targets, (project) => reader.listSuites(project, opts));
|
|
313
295
|
return {
|
|
314
296
|
inventoryKind: "suite",
|
|
315
|
-
count: total,
|
|
316
|
-
groups
|
|
297
|
+
count: grouped.total,
|
|
298
|
+
groups: grouped.groups.map((group) => ({
|
|
299
|
+
project: group.project,
|
|
300
|
+
suites: group.rows
|
|
301
|
+
}))
|
|
317
302
|
};
|
|
318
303
|
}),
|
|
319
304
|
session: (variant) => Effect.gen(function* () {
|
package/tools/test.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { publicProcedure } from "../context.js";
|
|
2
|
+
import { collectProjectRows, resolveProjectTargets } from "./_project-groups.js";
|
|
2
3
|
import { DataReader } from "@vitest-agent/sdk";
|
|
3
4
|
import { Effect, Match, Option, Schema, SchemaGetter } from "effect";
|
|
4
5
|
|
|
@@ -227,22 +228,15 @@ const test = publicProcedure.input(Schema.toStandardSchemaV1(TestInput)).query(a
|
|
|
227
228
|
if (variant.state !== void 0) opts.state = variant.state;
|
|
228
229
|
if (variant.module !== void 0) opts.module = variant.module;
|
|
229
230
|
if (variant.limit !== void 0) opts.limit = variant.limit;
|
|
230
|
-
const targets =
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
groups.push({
|
|
237
|
-
project: t.project,
|
|
238
|
-
tests
|
|
239
|
-
});
|
|
240
|
-
total += tests.length;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
231
|
+
const targets = yield* resolveProjectTargets(variant.project, () => reader.getRunsByProject());
|
|
232
|
+
const grouped = yield* collectProjectRows(targets, (project) => reader.listTests(project, opts));
|
|
233
|
+
const groups = grouped.groups.map((group) => ({
|
|
234
|
+
project: group.project,
|
|
235
|
+
tests: group.rows
|
|
236
|
+
}));
|
|
243
237
|
return {
|
|
244
238
|
action: "list",
|
|
245
|
-
count: total,
|
|
239
|
+
count: grouped.total,
|
|
246
240
|
groups
|
|
247
241
|
};
|
|
248
242
|
}),
|
|
@@ -299,23 +293,16 @@ const test = publicProcedure.input(Schema.toStandardSchemaV1(TestInput)).query(a
|
|
|
299
293
|
}),
|
|
300
294
|
for_tag: (variant) => Effect.gen(function* () {
|
|
301
295
|
const reader = yield* DataReader;
|
|
302
|
-
const targets =
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
groups.push({
|
|
309
|
-
project: t.project,
|
|
310
|
-
tests
|
|
311
|
-
});
|
|
312
|
-
total += tests.length;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
296
|
+
const targets = yield* resolveProjectTargets(variant.project, () => reader.getRunsByProject());
|
|
297
|
+
const grouped = yield* collectProjectRows(targets, (project) => reader.listTestsForTag(variant.tag, { project }));
|
|
298
|
+
const groups = grouped.groups.map((group) => ({
|
|
299
|
+
project: group.project,
|
|
300
|
+
tests: group.rows
|
|
301
|
+
}));
|
|
315
302
|
return {
|
|
316
303
|
action: "for_tag",
|
|
317
304
|
tag: variant.tag,
|
|
318
|
-
count: total,
|
|
305
|
+
count: grouped.total,
|
|
319
306
|
groups
|
|
320
307
|
};
|
|
321
308
|
})
|