@mandujs/mcp 0.19.1 → 0.19.3
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/package.json +3 -3
- package/src/activity-monitor.ts +17 -0
- package/src/tools/ate.ts +79 -0
- package/src/tools/index.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mandujs/mcp",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.3",
|
|
4
4
|
"description": "Mandu MCP Server - Agent-native interface for Mandu framework operations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@mandujs/core": "^0.
|
|
38
|
-
"@mandujs/ate": "^0.
|
|
37
|
+
"@mandujs/core": "^0.20.0",
|
|
38
|
+
"@mandujs/ate": "^0.18.0",
|
|
39
39
|
"@modelcontextprotocol/sdk": "^1.25.3"
|
|
40
40
|
},
|
|
41
41
|
"engines": {
|
package/src/activity-monitor.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import fs from "fs";
|
|
9
9
|
import path from "path";
|
|
10
10
|
import type { Subprocess } from "bun";
|
|
11
|
+
import { eventBus } from "@mandujs/core/observability";
|
|
11
12
|
|
|
12
13
|
const TOOL_ICONS: Record<string, string> = {
|
|
13
14
|
// Spec
|
|
@@ -379,6 +380,14 @@ export class ActivityMonitor {
|
|
|
379
380
|
fingerprint: `tool:error:${name}:${argsStr}`,
|
|
380
381
|
data: { tool: name, tag, args, argsSummary: argsStr, error },
|
|
381
382
|
});
|
|
383
|
+
// Phase 1-3: MCP 도구 에러 → EventBus
|
|
384
|
+
eventBus.emit({
|
|
385
|
+
type: "mcp",
|
|
386
|
+
severity: "error",
|
|
387
|
+
source: "mcp",
|
|
388
|
+
message: `${name} ❌ ${error}`,
|
|
389
|
+
data: { tool: name, args, error },
|
|
390
|
+
});
|
|
382
391
|
return;
|
|
383
392
|
}
|
|
384
393
|
|
|
@@ -389,6 +398,14 @@ export class ActivityMonitor {
|
|
|
389
398
|
source: "tool",
|
|
390
399
|
data: { tool: name, tag, args, argsSummary: argsStr },
|
|
391
400
|
});
|
|
401
|
+
// Phase 1-3: MCP 도구 호출 → EventBus
|
|
402
|
+
eventBus.emit({
|
|
403
|
+
type: "mcp",
|
|
404
|
+
severity: "info",
|
|
405
|
+
source: "mcp",
|
|
406
|
+
message: `${name} ✅`,
|
|
407
|
+
data: { tool: name, args },
|
|
408
|
+
});
|
|
392
409
|
}
|
|
393
410
|
|
|
394
411
|
/**
|
package/src/tools/ate.ts
CHANGED
|
@@ -9,6 +9,9 @@ import {
|
|
|
9
9
|
runFullPipeline,
|
|
10
10
|
analyzeFeedback,
|
|
11
11
|
applyHeal,
|
|
12
|
+
smartSelectRoutes,
|
|
13
|
+
detectCoverageGaps,
|
|
14
|
+
precommitCheck,
|
|
12
15
|
} from "@mandujs/ate";
|
|
13
16
|
import type { OracleLevel } from "@mandujs/ate";
|
|
14
17
|
|
|
@@ -390,3 +393,79 @@ export function ateTools(projectRoot: string) {
|
|
|
390
393
|
},
|
|
391
394
|
};
|
|
392
395
|
}
|
|
396
|
+
|
|
397
|
+
// ─── Phase 5: AI Agent Integration Tools ───
|
|
398
|
+
|
|
399
|
+
export const atePhase5ToolDefinitions: Tool[] = [
|
|
400
|
+
{
|
|
401
|
+
name: "mandu.test.smart",
|
|
402
|
+
annotations: { readOnlyHint: true },
|
|
403
|
+
description:
|
|
404
|
+
"Intelligently select which routes to test based on git diff analysis. " +
|
|
405
|
+
"Prioritizes contract changes (HIGH), guard violations (HIGH), API routes (MEDIUM), and shared code (LOW). " +
|
|
406
|
+
"Returns a sorted list of routes with reasoning for each selection.",
|
|
407
|
+
inputSchema: {
|
|
408
|
+
type: "object",
|
|
409
|
+
properties: {
|
|
410
|
+
repoRoot: { type: "string", description: "Absolute path to the Mandu project root" },
|
|
411
|
+
changedFiles: {
|
|
412
|
+
type: "array",
|
|
413
|
+
items: { type: "string" },
|
|
414
|
+
description: "List of changed file paths. If not provided, uses git diff HEAD.",
|
|
415
|
+
},
|
|
416
|
+
maxRoutes: { type: "number", description: "Maximum routes to select (default: 10)" },
|
|
417
|
+
},
|
|
418
|
+
required: ["repoRoot"],
|
|
419
|
+
},
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
name: "mandu.test.coverage",
|
|
423
|
+
annotations: { readOnlyHint: true },
|
|
424
|
+
description:
|
|
425
|
+
"Detect missing test coverage in the interaction graph. " +
|
|
426
|
+
"Finds route transitions, API calls, form actions, and island interactions that have no corresponding test. " +
|
|
427
|
+
"Returns gaps with suggested test scenarios and overall coverage percentage.",
|
|
428
|
+
inputSchema: {
|
|
429
|
+
type: "object",
|
|
430
|
+
properties: {
|
|
431
|
+
repoRoot: { type: "string", description: "Absolute path to the Mandu project root" },
|
|
432
|
+
},
|
|
433
|
+
required: ["repoRoot"],
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
name: "mandu.test.precommit",
|
|
438
|
+
annotations: { readOnlyHint: true },
|
|
439
|
+
description:
|
|
440
|
+
"Pre-commit check: analyze staged files to determine if tests should be run before committing. " +
|
|
441
|
+
"Returns whether testing is recommended and which routes are affected.",
|
|
442
|
+
inputSchema: {
|
|
443
|
+
type: "object",
|
|
444
|
+
properties: {
|
|
445
|
+
repoRoot: { type: "string", description: "Absolute path to the Mandu project root" },
|
|
446
|
+
},
|
|
447
|
+
required: ["repoRoot"],
|
|
448
|
+
},
|
|
449
|
+
},
|
|
450
|
+
];
|
|
451
|
+
|
|
452
|
+
export function createAtePhase5Handlers() {
|
|
453
|
+
return {
|
|
454
|
+
"mandu.test.smart": async (args: Record<string, unknown>) => {
|
|
455
|
+
const { repoRoot, changedFiles, maxRoutes } = args as {
|
|
456
|
+
repoRoot: string;
|
|
457
|
+
changedFiles?: string[];
|
|
458
|
+
maxRoutes?: number;
|
|
459
|
+
};
|
|
460
|
+
return smartSelectRoutes({ repoRoot, changedFiles, maxRoutes });
|
|
461
|
+
},
|
|
462
|
+
"mandu.test.coverage": async (args: Record<string, unknown>) => {
|
|
463
|
+
const { repoRoot } = args as { repoRoot: string };
|
|
464
|
+
return detectCoverageGaps(repoRoot);
|
|
465
|
+
},
|
|
466
|
+
"mandu.test.precommit": async (args: Record<string, unknown>) => {
|
|
467
|
+
const { repoRoot } = args as { repoRoot: string };
|
|
468
|
+
return precommitCheck(repoRoot);
|
|
469
|
+
},
|
|
470
|
+
};
|
|
471
|
+
}
|
package/src/tools/index.ts
CHANGED
|
@@ -27,7 +27,7 @@ export { brainTools, brainToolDefinitions } from "./brain.js";
|
|
|
27
27
|
export { runtimeTools, runtimeToolDefinitions } from "./runtime.js";
|
|
28
28
|
export { seoTools, seoToolDefinitions } from "./seo.js";
|
|
29
29
|
export { projectTools, projectToolDefinitions, getDevServerState } from "./project.js";
|
|
30
|
-
export { ateTools, ateToolDefinitions } from "./ate.js";
|
|
30
|
+
export { ateTools, ateToolDefinitions, atePhase5ToolDefinitions, createAtePhase5Handlers } from "./ate.js";
|
|
31
31
|
export { resourceTools, resourceToolDefinitions } from "./resource.js";
|
|
32
32
|
export { componentTools, componentToolDefinitions } from "./component.js";
|
|
33
33
|
export { kitchenTools, kitchenToolDefinitions } from "./kitchen.js";
|
|
@@ -49,7 +49,7 @@ import { brainTools, brainToolDefinitions } from "./brain.js";
|
|
|
49
49
|
import { runtimeTools, runtimeToolDefinitions } from "./runtime.js";
|
|
50
50
|
import { seoTools, seoToolDefinitions } from "./seo.js";
|
|
51
51
|
import { projectTools, projectToolDefinitions } from "./project.js";
|
|
52
|
-
import { ateTools, ateToolDefinitions } from "./ate.js";
|
|
52
|
+
import { ateTools, ateToolDefinitions, atePhase5ToolDefinitions, createAtePhase5Handlers } from "./ate.js";
|
|
53
53
|
import { resourceTools, resourceToolDefinitions } from "./resource.js";
|
|
54
54
|
import { componentTools, componentToolDefinitions } from "./component.js";
|
|
55
55
|
import { kitchenTools, kitchenToolDefinitions } from "./kitchen.js";
|
|
@@ -89,6 +89,7 @@ const TOOL_MODULES: ToolModule[] = [
|
|
|
89
89
|
{ category: "seo", definitions: seoToolDefinitions, handlers: seoTools },
|
|
90
90
|
{ category: "project", definitions: projectToolDefinitions, handlers: projectTools as ToolModule["handlers"], requiresServer: true },
|
|
91
91
|
{ category: "ate", definitions: ateToolDefinitions, handlers: ateTools as ToolModule["handlers"] },
|
|
92
|
+
{ category: "ate-phase5", definitions: atePhase5ToolDefinitions, handlers: createAtePhase5Handlers as unknown as ToolModule["handlers"] },
|
|
92
93
|
{ category: "resource", definitions: resourceToolDefinitions, handlers: resourceTools },
|
|
93
94
|
{ category: "component", definitions: componentToolDefinitions, handlers: componentTools },
|
|
94
95
|
{ category: "kitchen", definitions: kitchenToolDefinitions, handlers: kitchenTools },
|