@mandujs/mcp 0.13.0 → 0.17.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.
Files changed (136) hide show
  1. package/README.md +102 -7
  2. package/package.json +3 -2
  3. package/src/adapters/index.ts +20 -20
  4. package/src/adapters/monitor-adapter.ts +100 -100
  5. package/src/adapters/tool-adapter.ts +88 -88
  6. package/src/executor/error-handler.ts +250 -250
  7. package/src/executor/index.ts +22 -22
  8. package/src/executor/tool-executor.ts +148 -148
  9. package/src/hooks/config-watcher.ts +174 -174
  10. package/src/hooks/index.ts +23 -23
  11. package/src/hooks/mcp-hooks.ts +227 -227
  12. package/src/logging/index.ts +15 -15
  13. package/src/logging/mcp-transport.ts +134 -134
  14. package/src/registry/index.ts +13 -13
  15. package/src/registry/mcp-tool-registry.ts +298 -298
  16. package/src/resources/skills/guides.ts +1136 -1136
  17. package/src/resources/skills/index.ts +12 -12
  18. package/src/resources/skills/loader.ts +218 -218
  19. package/src/resources/skills/mandu-composition/SKILL.md +91 -91
  20. package/src/resources/skills/mandu-composition/metadata.json +13 -13
  21. package/src/resources/skills/mandu-composition/rules/_sections.md +26 -26
  22. package/src/resources/skills/mandu-composition/rules/_template.md +77 -77
  23. package/src/resources/skills/mandu-composition/rules/comp-arch-avoid-boolean-props.md +146 -146
  24. package/src/resources/skills/mandu-composition/rules/comp-arch-compound-components.md +164 -164
  25. package/src/resources/skills/mandu-composition/rules/comp-island-event.md +161 -161
  26. package/src/resources/skills/mandu-composition/rules/comp-island-slot-split.md +167 -167
  27. package/src/resources/skills/mandu-composition/rules/comp-pattern-children.md +149 -149
  28. package/src/resources/skills/mandu-composition/rules/comp-state-context-interface.md +148 -148
  29. package/src/resources/skills/mandu-composition/rules/comp-state-lift-state.md +150 -150
  30. package/src/resources/skills/mandu-deployment/SKILL.md +92 -92
  31. package/src/resources/skills/mandu-deployment/_sections.md +41 -41
  32. package/src/resources/skills/mandu-deployment/_template.md +38 -38
  33. package/src/resources/skills/mandu-deployment/metadata.json +13 -13
  34. package/src/resources/skills/mandu-deployment/rules/deploy-build-bun.md +109 -109
  35. package/src/resources/skills/mandu-deployment/rules/deploy-build-output.md +115 -115
  36. package/src/resources/skills/mandu-deployment/rules/deploy-cicd-github.md +219 -219
  37. package/src/resources/skills/mandu-deployment/rules/deploy-docker-bun.md +150 -150
  38. package/src/resources/skills/mandu-deployment/rules/deploy-docker-compose.md +223 -223
  39. package/src/resources/skills/mandu-deployment/rules/deploy-platform-fly.md +152 -152
  40. package/src/resources/skills/mandu-deployment/rules/deploy-platform-render.md +179 -179
  41. package/src/resources/skills/mandu-deployment/rules/deploy-platform-supabase.md +323 -323
  42. package/src/resources/skills/mandu-deployment/rules/deploy-platform-vercel.md +140 -140
  43. package/src/resources/skills/mandu-fs-routes/SKILL.md +82 -82
  44. package/src/resources/skills/mandu-fs-routes/metadata.json +12 -12
  45. package/src/resources/skills/mandu-fs-routes/rules/_sections.md +36 -36
  46. package/src/resources/skills/mandu-fs-routes/rules/_template.md +69 -69
  47. package/src/resources/skills/mandu-fs-routes/rules/routes-api-methods.md +65 -65
  48. package/src/resources/skills/mandu-fs-routes/rules/routes-dynamic-param.md +93 -93
  49. package/src/resources/skills/mandu-fs-routes/rules/routes-naming-page.md +55 -55
  50. package/src/resources/skills/mandu-guard/SKILL.md +129 -129
  51. package/src/resources/skills/mandu-guard/metadata.json +12 -12
  52. package/src/resources/skills/mandu-guard/rules/_sections.md +36 -36
  53. package/src/resources/skills/mandu-guard/rules/_template.md +82 -82
  54. package/src/resources/skills/mandu-guard/rules/guard-config-rules.md +100 -100
  55. package/src/resources/skills/mandu-guard/rules/guard-layer-direction.md +76 -76
  56. package/src/resources/skills/mandu-guard/rules/guard-preset-mandu.md +81 -81
  57. package/src/resources/skills/mandu-guard/rules/guard-validate-import.md +80 -80
  58. package/src/resources/skills/mandu-hydration/SKILL.md +91 -91
  59. package/src/resources/skills/mandu-hydration/metadata.json +12 -12
  60. package/src/resources/skills/mandu-hydration/rules/_sections.md +31 -31
  61. package/src/resources/skills/mandu-hydration/rules/_template.md +72 -72
  62. package/src/resources/skills/mandu-hydration/rules/hydration-data-event.md +109 -109
  63. package/src/resources/skills/mandu-hydration/rules/hydration-directive-use-client.md +55 -55
  64. package/src/resources/skills/mandu-hydration/rules/hydration-island-setup.md +113 -113
  65. package/src/resources/skills/mandu-hydration/rules/hydration-priority-visible.md +68 -68
  66. package/src/resources/skills/mandu-performance/SKILL.md +85 -85
  67. package/src/resources/skills/mandu-performance/metadata.json +14 -14
  68. package/src/resources/skills/mandu-performance/rules/_sections.md +31 -31
  69. package/src/resources/skills/mandu-performance/rules/_template.md +64 -64
  70. package/src/resources/skills/mandu-performance/rules/perf-async-defer-await.md +103 -103
  71. package/src/resources/skills/mandu-performance/rules/perf-async-parallel.md +95 -95
  72. package/src/resources/skills/mandu-performance/rules/perf-bun-file.md +124 -124
  73. package/src/resources/skills/mandu-performance/rules/perf-bun-serve.md +125 -125
  74. package/src/resources/skills/mandu-performance/rules/perf-bundle-imports.md +80 -80
  75. package/src/resources/skills/mandu-performance/rules/perf-bundle-island-lazy.md +145 -145
  76. package/src/resources/skills/mandu-performance/rules/perf-cache-react.md +98 -98
  77. package/src/resources/skills/mandu-performance/rules/perf-render-transitions.md +154 -154
  78. package/src/resources/skills/mandu-security/SKILL.md +87 -87
  79. package/src/resources/skills/mandu-security/metadata.json +13 -13
  80. package/src/resources/skills/mandu-security/rules/_sections.md +31 -31
  81. package/src/resources/skills/mandu-security/rules/_template.md +74 -74
  82. package/src/resources/skills/mandu-security/rules/sec-auth-guard.md +127 -127
  83. package/src/resources/skills/mandu-security/rules/sec-env-management.md +133 -133
  84. package/src/resources/skills/mandu-security/rules/sec-input-validate.md +148 -148
  85. package/src/resources/skills/mandu-security/rules/sec-protect-csrf.md +146 -146
  86. package/src/resources/skills/mandu-security/rules/sec-protect-headers.md +138 -138
  87. package/src/resources/skills/mandu-slot/SKILL.md +85 -85
  88. package/src/resources/skills/mandu-slot/metadata.json +12 -12
  89. package/src/resources/skills/mandu-slot/rules/_sections.md +36 -36
  90. package/src/resources/skills/mandu-slot/rules/_template.md +63 -63
  91. package/src/resources/skills/mandu-slot/rules/slot-basic-structure.md +38 -38
  92. package/src/resources/skills/mandu-slot/rules/slot-ctx-response.md +56 -56
  93. package/src/resources/skills/mandu-slot/rules/slot-guard-auth.md +59 -59
  94. package/src/resources/skills/mandu-slot/rules/slot-http-methods.md +64 -64
  95. package/src/resources/skills/mandu-styling/SKILL.md +154 -154
  96. package/src/resources/skills/mandu-styling/_sections.md +43 -43
  97. package/src/resources/skills/mandu-styling/_template.md +32 -32
  98. package/src/resources/skills/mandu-styling/metadata.json +15 -15
  99. package/src/resources/skills/mandu-styling/rules/style-component-compound.md +235 -235
  100. package/src/resources/skills/mandu-styling/rules/style-component-slots.md +255 -255
  101. package/src/resources/skills/mandu-styling/rules/style-component-tokens.md +205 -205
  102. package/src/resources/skills/mandu-styling/rules/style-island-animations.md +272 -272
  103. package/src/resources/skills/mandu-styling/rules/style-island-scoping.md +167 -167
  104. package/src/resources/skills/mandu-styling/rules/style-island-variants.md +221 -221
  105. package/src/resources/skills/mandu-styling/rules/style-perf-critical.md +209 -209
  106. package/src/resources/skills/mandu-styling/rules/style-perf-purge.md +192 -192
  107. package/src/resources/skills/mandu-styling/rules/style-setup-modules.md +162 -162
  108. package/src/resources/skills/mandu-styling/rules/style-setup-panda.md +164 -164
  109. package/src/resources/skills/mandu-styling/rules/style-setup-tailwind.md +170 -170
  110. package/src/resources/skills/mandu-styling/rules/style-tailwind-v4-gotchas.md +179 -179
  111. package/src/resources/skills/mandu-styling/rules/style-theme-darkmode.md +229 -229
  112. package/src/resources/skills/mandu-testing/SKILL.md +99 -99
  113. package/src/resources/skills/mandu-testing/metadata.json +13 -13
  114. package/src/resources/skills/mandu-testing/rules/_sections.md +26 -26
  115. package/src/resources/skills/mandu-testing/rules/_template.md +65 -65
  116. package/src/resources/skills/mandu-testing/rules/test-component-island.md +195 -195
  117. package/src/resources/skills/mandu-testing/rules/test-e2e-playwright.md +196 -196
  118. package/src/resources/skills/mandu-testing/rules/test-mock-fetch.md +219 -219
  119. package/src/resources/skills/mandu-testing/rules/test-slot-unit.md +192 -192
  120. package/src/resources/skills/mandu-ui/SKILL.md +117 -117
  121. package/src/resources/skills/mandu-ui/_sections.md +23 -23
  122. package/src/resources/skills/mandu-ui/_template.md +32 -32
  123. package/src/resources/skills/mandu-ui/metadata.json +13 -13
  124. package/src/resources/skills/mandu-ui/rules/ui-accessibility-aria.md +232 -232
  125. package/src/resources/skills/mandu-ui/rules/ui-accessibility-focus.md +238 -238
  126. package/src/resources/skills/mandu-ui/rules/ui-composition-patterns.md +259 -259
  127. package/src/resources/skills/mandu-ui/rules/ui-island-integration.md +258 -258
  128. package/src/resources/skills/mandu-ui/rules/ui-radix-patterns.md +213 -213
  129. package/src/resources/skills/mandu-ui/rules/ui-shadcn-setup.md +209 -209
  130. package/src/resources/skills/recipes.ts +932 -932
  131. package/src/tools/ate.ts +219 -0
  132. package/src/tools/index.ts +4 -1
  133. package/src/tools/project.ts +334 -334
  134. package/src/tools/runtime.ts +497 -497
  135. package/src/tools/seo.ts +417 -417
  136. package/src/utils/withWarnings.ts +83 -83
@@ -0,0 +1,219 @@
1
+ import type { Tool } from "@modelcontextprotocol/sdk/types.js";
2
+ import {
3
+ ateExtract,
4
+ ateGenerate,
5
+ ateRun,
6
+ ateReport,
7
+ ateHeal,
8
+ ateImpact,
9
+ runFullPipeline,
10
+ analyzeFeedback,
11
+ applyHeal,
12
+ } from "@mandujs/ate";
13
+
14
+ export const ateToolDefinitions: Tool[] = [
15
+ {
16
+ name: "mandu.ate.extract",
17
+ description: "ATE: AST 기반 상호작용 그래프 추출",
18
+ inputSchema: {
19
+ type: "object",
20
+ properties: {
21
+ repoRoot: { type: "string" },
22
+ tsconfigPath: { type: "string" },
23
+ routeGlobs: { type: "array", items: { type: "string" } },
24
+ buildSalt: { type: "string" },
25
+ },
26
+ required: ["repoRoot"],
27
+ },
28
+ },
29
+ {
30
+ name: "mandu.ate.generate",
31
+ description: "ATE: 시나리오 생성 + Playwright spec codegen",
32
+ inputSchema: {
33
+ type: "object",
34
+ properties: {
35
+ repoRoot: { type: "string" },
36
+ oracleLevel: { type: "string", enum: ["L0", "L1", "L2", "L3"] },
37
+ onlyRoutes: { type: "array", items: { type: "string" } },
38
+ },
39
+ required: ["repoRoot"],
40
+ },
41
+ },
42
+ {
43
+ name: "mandu.ate.run",
44
+ description: "ATE: Playwright runner 실행(artifacts 수집)",
45
+ inputSchema: {
46
+ type: "object",
47
+ properties: {
48
+ repoRoot: { type: "string" },
49
+ baseURL: { type: "string" },
50
+ ci: { type: "boolean" },
51
+ headless: { type: "boolean" },
52
+ browsers: { type: "array", items: { type: "string", enum: ["chromium", "firefox", "webkit"] } },
53
+ },
54
+ required: ["repoRoot"],
55
+ },
56
+ },
57
+ {
58
+ name: "mandu.ate.report",
59
+ description: "ATE: 테스트 리포트 생성 (JSON, HTML, 또는 both)",
60
+ inputSchema: {
61
+ type: "object",
62
+ properties: {
63
+ repoRoot: { type: "string" },
64
+ runId: { type: "string" },
65
+ startedAt: { type: "string" },
66
+ finishedAt: { type: "string" },
67
+ exitCode: { type: "number" },
68
+ oracleLevel: { type: "string", enum: ["L0", "L1", "L2", "L3"] },
69
+ format: { type: "string", enum: ["json", "html", "both"], description: "리포트 포맷 (기본값: both)" },
70
+ impact: {
71
+ type: "object",
72
+ properties: {
73
+ mode: { type: "string", enum: ["full", "subset"] },
74
+ changedFiles: { type: "array", items: { type: "string" } },
75
+ selectedRoutes: { type: "array", items: { type: "string" } },
76
+ },
77
+ required: ["mode", "changedFiles", "selectedRoutes"],
78
+ },
79
+ },
80
+ required: ["repoRoot", "runId", "startedAt", "finishedAt", "exitCode"],
81
+ },
82
+ },
83
+ {
84
+ name: "mandu.ate.heal",
85
+ description: "ATE: 실패 원인 분류 + 복구 제안(diff) 생성 (자동 커밋 금지)",
86
+ inputSchema: {
87
+ type: "object",
88
+ properties: {
89
+ repoRoot: { type: "string" },
90
+ runId: { type: "string" },
91
+ },
92
+ required: ["repoRoot", "runId"],
93
+ },
94
+ },
95
+ {
96
+ name: "mandu.ate.impact",
97
+ description: "ATE: git diff 기반 subset 계산",
98
+ inputSchema: {
99
+ type: "object",
100
+ properties: {
101
+ repoRoot: { type: "string" },
102
+ base: { type: "string" },
103
+ head: { type: "string" },
104
+ },
105
+ required: ["repoRoot"],
106
+ },
107
+ },
108
+ {
109
+ name: "mandu.ate.auto_pipeline",
110
+ description: "ATE: 전체 파이프라인 자동 실행 (Extract → Generate → Run → Report → Heal)",
111
+ inputSchema: {
112
+ type: "object",
113
+ properties: {
114
+ repoRoot: { type: "string" },
115
+ baseURL: { type: "string" },
116
+ oracleLevel: { type: "string", enum: ["L0", "L1", "L2", "L3"] },
117
+ ci: { type: "boolean" },
118
+ useImpactAnalysis: { type: "boolean" },
119
+ base: { type: "string" },
120
+ head: { type: "string" },
121
+ autoHeal: { type: "boolean" },
122
+ tsconfigPath: { type: "string" },
123
+ routeGlobs: { type: "array", items: { type: "string" } },
124
+ buildSalt: { type: "string" },
125
+ },
126
+ required: ["repoRoot"],
127
+ },
128
+ },
129
+ {
130
+ name: "mandu.ate.feedback",
131
+ description: "ATE: 테스트 실패 원인 분석 및 heal 제안 평가",
132
+ inputSchema: {
133
+ type: "object",
134
+ properties: {
135
+ repoRoot: { type: "string", description: "프로젝트 루트 디렉토리" },
136
+ runId: { type: "string", description: "테스트 실행 ID" },
137
+ autoApply: {
138
+ type: "boolean",
139
+ description: "자동 적용 가능 여부 (selector-map만 안전)",
140
+ },
141
+ },
142
+ required: ["repoRoot", "runId"],
143
+ },
144
+ },
145
+ {
146
+ name: "mandu.ate.apply_heal",
147
+ description: "ATE: heal diff를 실제 코드에 적용 (rollback 가능)",
148
+ inputSchema: {
149
+ type: "object",
150
+ properties: {
151
+ repoRoot: { type: "string", description: "프로젝트 루트 디렉토리" },
152
+ runId: { type: "string", description: "테스트 실행 ID" },
153
+ healIndex: {
154
+ type: "number",
155
+ description: "적용할 heal suggestion의 인덱스 (0부터 시작)",
156
+ },
157
+ createBackup: {
158
+ type: "boolean",
159
+ description: "백업 생성 여부 (기본값: true, 필수 권장)",
160
+ },
161
+ },
162
+ required: ["repoRoot", "runId", "healIndex"],
163
+ },
164
+ },
165
+ ];
166
+
167
+ export function ateTools(projectRoot: string) {
168
+ return {
169
+ "mandu.ate.extract": async (args: Record<string, unknown>) => {
170
+ return await ateExtract(args as any);
171
+ },
172
+ "mandu.ate.generate": async (args: Record<string, unknown>) => {
173
+ return ateGenerate(args as any);
174
+ },
175
+ "mandu.ate.run": async (args: Record<string, unknown>) => {
176
+ return await ateRun(args as any);
177
+ },
178
+ "mandu.ate.report": async (args: Record<string, unknown>) => {
179
+ const input = args as any;
180
+ return await ateReport({
181
+ repoRoot: input.repoRoot,
182
+ runId: input.runId,
183
+ startedAt: input.startedAt,
184
+ finishedAt: input.finishedAt,
185
+ exitCode: input.exitCode,
186
+ oracleLevel: input.oracleLevel ?? "L1",
187
+ format: input.format ?? "both",
188
+ impact: input.impact,
189
+ });
190
+ },
191
+ "mandu.ate.heal": async (args: Record<string, unknown>) => {
192
+ return ateHeal(args as any);
193
+ },
194
+ "mandu.ate.impact": async (args: Record<string, unknown>) => {
195
+ return ateImpact(args as any);
196
+ },
197
+ "mandu.ate.auto_pipeline": async (args: Record<string, unknown>) => {
198
+ return await runFullPipeline(args as any);
199
+ },
200
+ "mandu.ate.feedback": async (args: Record<string, unknown>) => {
201
+ const result = analyzeFeedback(args as any);
202
+ return {
203
+ ok: true,
204
+ category: result.category,
205
+ autoApplicable: result.autoApplicable,
206
+ priority: result.priority,
207
+ reasoning: result.reasoning,
208
+ suggestions: result.suggestions,
209
+ };
210
+ },
211
+ "mandu.ate.apply_heal": async (args: Record<string, unknown>) => {
212
+ const result = applyHeal(args as any);
213
+ return {
214
+ ok: result.success,
215
+ ...result,
216
+ };
217
+ },
218
+ };
219
+ }
@@ -22,6 +22,7 @@ export { brainTools, brainToolDefinitions } from "./brain.js";
22
22
  export { runtimeTools, runtimeToolDefinitions } from "./runtime.js";
23
23
  export { seoTools, seoToolDefinitions } from "./seo.js";
24
24
  export { projectTools, projectToolDefinitions } from "./project.js";
25
+ export { ateTools, ateToolDefinitions } from "./ate.js";
25
26
 
26
27
  // 도구 모듈 import (등록용)
27
28
  import { specTools, specToolDefinitions } from "./spec.js";
@@ -36,13 +37,14 @@ import { brainTools, brainToolDefinitions } from "./brain.js";
36
37
  import { runtimeTools, runtimeToolDefinitions } from "./runtime.js";
37
38
  import { seoTools, seoToolDefinitions } from "./seo.js";
38
39
  import { projectTools, projectToolDefinitions } from "./project.js";
40
+ import { ateTools, ateToolDefinitions } from "./ate.js";
39
41
 
40
42
  /**
41
43
  * 도구 모듈 정보
42
44
  */
43
45
  interface ToolModule {
44
46
  category: string;
45
- definitions: typeof specToolDefinitions;
47
+ definitions: any;
46
48
  handlers: (
47
49
  projectRoot: string,
48
50
  server?: Server,
@@ -67,6 +69,7 @@ const TOOL_MODULES: ToolModule[] = [
67
69
  { category: "runtime", definitions: runtimeToolDefinitions, handlers: runtimeTools },
68
70
  { category: "seo", definitions: seoToolDefinitions, handlers: seoTools },
69
71
  { category: "project", definitions: projectToolDefinitions, handlers: projectTools as ToolModule["handlers"], requiresServer: true },
72
+ { category: "ate", definitions: ateToolDefinitions as any, handlers: ateTools as any },
70
73
  ];
71
74
 
72
75
  /**