mcp-probe-kit 2.1.2 → 2.2.1
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/build/tools/__tests__/start_ui.integration.test.js +8 -5
- package/build/tools/__tests__/start_ui.unit.test.js +2 -2
- package/build/tools/gencommit.d.ts +1 -1
- package/build/tools/gencommit.js +10 -19
- package/build/tools/start_ui.js +151 -16
- package/docs/pages/all-tools.html +149 -4
- package/docs/styles/page.css +55 -2
- package/package.json +1 -1
|
@@ -16,12 +16,15 @@ describe('start_ui 集成测试', () => {
|
|
|
16
16
|
const text = result.content[0].text || '';
|
|
17
17
|
// 1. 应该包含快速开始部分
|
|
18
18
|
expect(text).toMatch(/^#\s+快速开始/m);
|
|
19
|
-
// 2. 应该包含
|
|
20
|
-
expect(text).toMatch(/步骤 1
|
|
21
|
-
expect(text).toMatch(/步骤 2
|
|
22
|
-
expect(text).toMatch(/步骤 3
|
|
23
|
-
expect(text).toMatch(/步骤 4
|
|
19
|
+
// 2. 应该包含 6 个步骤(新增了项目上下文和更新索引)
|
|
20
|
+
expect(text).toMatch(/步骤 1.*生成项目上下文/);
|
|
21
|
+
expect(text).toMatch(/步骤 2.*生成设计系统/);
|
|
22
|
+
expect(text).toMatch(/步骤 3.*生成组件目录/);
|
|
23
|
+
expect(text).toMatch(/步骤 4.*搜索.*模板/);
|
|
24
|
+
expect(text).toMatch(/步骤 5.*渲染.*代码/);
|
|
25
|
+
expect(text).toMatch(/步骤 6.*更新项目上下文/);
|
|
24
26
|
// 3. 每个步骤应该包含工具名称
|
|
27
|
+
expect(text).toMatch(/init_project_context/);
|
|
25
28
|
expect(text).toMatch(/ui_design_system/);
|
|
26
29
|
expect(text).toMatch(/init_component_catalog/);
|
|
27
30
|
expect(text).toMatch(/ui_search/);
|
|
@@ -35,9 +35,9 @@ describe('start_ui 单元测试', () => {
|
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
describe('参数解析', () => {
|
|
38
|
-
test('默认 framework 为
|
|
38
|
+
test('默认 framework 为 html(最通用)', async () => {
|
|
39
39
|
const result = await startUi({ description: '测试' });
|
|
40
|
-
expect(result.content[0].text).toMatch(/
|
|
40
|
+
expect(result.content[0].text).toMatch(/html/i);
|
|
41
41
|
});
|
|
42
42
|
test('支持 vue framework', async () => {
|
|
43
43
|
const result = await startUi({
|
package/build/tools/gencommit.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { parseArgs, getString } from "../utils/parseArgs.js";
|
|
2
|
-
import { okStructured } from "../lib/response.js";
|
|
3
|
-
import { CommitMessageSchema } from "../schemas/structured-output.js";
|
|
4
2
|
// gencommit 工具实现
|
|
5
3
|
export async function gencommit(args) {
|
|
6
4
|
try {
|
|
@@ -112,24 +110,17 @@ chore: 🤖 升级依赖版本至 1.2.9
|
|
|
112
110
|
- 如果暂存区为空,提示用户先使用 \`git add\` 添加文件
|
|
113
111
|
- 如果变更较多,建议分多次提交
|
|
114
112
|
- 确保 commit 消息清晰描述了"做了什么"和"为什么"`;
|
|
115
|
-
//
|
|
116
|
-
//
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
113
|
+
// 返回纯文本指导
|
|
114
|
+
// AI 会根据这些指导分析代码变更并生成符合规范的 commit 消息
|
|
115
|
+
return {
|
|
116
|
+
content: [
|
|
117
|
+
{
|
|
118
|
+
type: "text",
|
|
119
|
+
text: textMessage,
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
isError: false,
|
|
125
123
|
};
|
|
126
|
-
// 返回结构化输出
|
|
127
|
-
// textMessage 提供人类可读的指导信息
|
|
128
|
-
// exampleCommitData 提供结构化数据示例(AI 会根据实际情况生成真实数据)
|
|
129
|
-
return okStructured(textMessage, exampleCommitData, {
|
|
130
|
-
schema: CommitMessageSchema,
|
|
131
|
-
note: 'AI 应该根据实际代码变更生成真实的 commit 数据,而不是使用这个示例',
|
|
132
|
-
});
|
|
133
124
|
}
|
|
134
125
|
catch (error) {
|
|
135
126
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
package/build/tools/start_ui.js
CHANGED
|
@@ -11,20 +11,38 @@ import { parseArgs, getString } from "../utils/parseArgs.js";
|
|
|
11
11
|
import { getReasoningEngine } from "./ui-ux-tools.js";
|
|
12
12
|
import { okStructured } from "../lib/response.js";
|
|
13
13
|
import { UIReportSchema } from "../schemas/structured-output.js";
|
|
14
|
+
import { detectProjectType } from "../lib/project-detector.js";
|
|
14
15
|
const PROMPT_TEMPLATE = `# 快速开始
|
|
15
16
|
|
|
16
17
|
**职责说明**: 本工具仅提供执行指导,不执行实际操作。请按顺序调用以下 MCP 工具。
|
|
17
18
|
|
|
18
19
|
执行以下工具:
|
|
19
20
|
|
|
20
|
-
1. 检查 \`docs/
|
|
21
|
-
2. 检查 \`docs/
|
|
22
|
-
3. \`
|
|
23
|
-
4. \`
|
|
21
|
+
1. 检查 \`docs/project-context.md\` 是否存在,不存在则调用 \`init_project_context\`
|
|
22
|
+
2. 检查 \`docs/design-system.md\` 是否存在,不存在则调用 \`ui_design_system --product_type="SaaS" --stack="{framework}"\`
|
|
23
|
+
3. 检查 \`docs/component-catalog.json\` 是否存在,不存在则调用 \`init_component_catalog\`
|
|
24
|
+
4. \`ui_search --mode=template --query="{description}"\`
|
|
25
|
+
5. \`render_ui --template="docs/ui/{templateName}.json" --framework="{framework}"\`
|
|
26
|
+
6. 将生成的 UI 文档添加到 \`docs/project-context.md\` 索引中
|
|
24
27
|
|
|
25
28
|
---
|
|
26
29
|
|
|
27
|
-
## 步骤 1:
|
|
30
|
+
## 步骤 1: 生成项目上下文(如不存在)📋
|
|
31
|
+
|
|
32
|
+
**检查**: 查看 \`docs/project-context.md\` 是否存在
|
|
33
|
+
|
|
34
|
+
**如果不存在,调用工具**: \`init_project_context\`
|
|
35
|
+
**参数**: 无(使用默认配置)
|
|
36
|
+
|
|
37
|
+
**预期输出**:
|
|
38
|
+
- \`docs/project-context.md\` - 项目上下文索引文件
|
|
39
|
+
- \`docs/project-context/\` - 项目文档目录
|
|
40
|
+
|
|
41
|
+
**失败处理**: 确保 docs 目录存在且有写入权限
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 步骤 2: 生成设计系统(如不存在)🎨
|
|
28
46
|
|
|
29
47
|
**检查**: 查看 \`docs/design-system.md\` 是否存在
|
|
30
48
|
|
|
@@ -43,7 +61,7 @@ const PROMPT_TEMPLATE = `# 快速开始
|
|
|
43
61
|
|
|
44
62
|
---
|
|
45
63
|
|
|
46
|
-
## 步骤
|
|
64
|
+
## 步骤 3: 生成组件目录(如不存在)📦
|
|
47
65
|
|
|
48
66
|
**检查**: 查看 \`docs/component-catalog.json\` 是否存在
|
|
49
67
|
|
|
@@ -51,11 +69,11 @@ const PROMPT_TEMPLATE = `# 快速开始
|
|
|
51
69
|
**参数**: 无
|
|
52
70
|
|
|
53
71
|
**预期输出**: \`docs/component-catalog.json\`
|
|
54
|
-
**失败处理**: 确保步骤
|
|
72
|
+
**失败处理**: 确保步骤 2 的设计系统文件已生成
|
|
55
73
|
|
|
56
74
|
---
|
|
57
75
|
|
|
58
|
-
## 步骤
|
|
76
|
+
## 步骤 4: 搜索 UI 模板 🔍
|
|
59
77
|
|
|
60
78
|
**工具**: \`ui_search\`
|
|
61
79
|
**参数**:
|
|
@@ -67,11 +85,11 @@ const PROMPT_TEMPLATE = `# 快速开始
|
|
|
67
85
|
\`\`\`
|
|
68
86
|
|
|
69
87
|
**预期输出**: 匹配的模板列表(可能为空)
|
|
70
|
-
**失败处理**: 如果没有找到模板,继续到步骤
|
|
88
|
+
**失败处理**: 如果没有找到模板,继续到步骤 5 使用默认模板
|
|
71
89
|
|
|
72
90
|
---
|
|
73
91
|
|
|
74
|
-
## 步骤
|
|
92
|
+
## 步骤 5: 渲染最终代码 💻
|
|
75
93
|
|
|
76
94
|
**工具**: \`render_ui\`
|
|
77
95
|
**参数**:
|
|
@@ -87,6 +105,32 @@ const PROMPT_TEMPLATE = `# 快速开始
|
|
|
87
105
|
|
|
88
106
|
---
|
|
89
107
|
|
|
108
|
+
## 步骤 6: 更新项目上下文索引 📝
|
|
109
|
+
|
|
110
|
+
**操作**: 将生成的 UI 文档添加到 \`docs/project-context.md\` 中
|
|
111
|
+
|
|
112
|
+
**添加内容**:
|
|
113
|
+
在 "## 📚 文档导航" 部分添加:
|
|
114
|
+
|
|
115
|
+
\`\`\`markdown
|
|
116
|
+
### [UI 设计系统](./design-system.md)
|
|
117
|
+
项目的 UI 设计规范,包括颜色、字体、组件样式等
|
|
118
|
+
|
|
119
|
+
### [UI 组件目录](./component-catalog.json)
|
|
120
|
+
可用的 UI 组件及其属性定义
|
|
121
|
+
\`\`\`
|
|
122
|
+
|
|
123
|
+
在 "## 💡 开发时查看对应文档" 部分的 "添加新功能" 下添加:
|
|
124
|
+
\`\`\`markdown
|
|
125
|
+
- **UI 设计系统**: [design-system.md](./design-system.md) - 查看设计规范
|
|
126
|
+
- **UI 组件目录**: [component-catalog.json](./component-catalog.json) - 查看可用组件
|
|
127
|
+
\`\`\`
|
|
128
|
+
|
|
129
|
+
**预期结果**: \`docs/project-context.md\` 包含 UI 相关文档的链接
|
|
130
|
+
**失败处理**: 如果文件不存在,跳过此步骤
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
90
134
|
## 高级选项
|
|
91
135
|
|
|
92
136
|
### 自定义设计系统
|
|
@@ -103,16 +147,75 @@ A: 不需要。如果文件已存在,直接跳过步骤 1。
|
|
|
103
147
|
**Q: 如何使用自定义模板?**
|
|
104
148
|
A: 在 \`docs/ui/\` 目录创建 JSON 模板文件,然后在步骤 4 中指定模板路径。
|
|
105
149
|
`;
|
|
150
|
+
/**
|
|
151
|
+
* 从 project-context.md 读取框架信息
|
|
152
|
+
*/
|
|
153
|
+
function getFrameworkFromContext(projectRoot) {
|
|
154
|
+
try {
|
|
155
|
+
const fs = require('fs');
|
|
156
|
+
const path = require('path');
|
|
157
|
+
const contextPath = path.join(projectRoot, 'docs', 'project-context.md');
|
|
158
|
+
if (!fs.existsSync(contextPath)) {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
const content = fs.readFileSync(contextPath, 'utf-8');
|
|
162
|
+
// 匹配表格中的框架信息:| 框架 | xxx |
|
|
163
|
+
const match = content.match(/\|\s*框架\s*\|\s*([^\|]+)\s*\|/);
|
|
164
|
+
if (match && match[1]) {
|
|
165
|
+
const framework = match[1].trim();
|
|
166
|
+
if (framework && framework !== '无' && framework !== '未检测到') {
|
|
167
|
+
return framework;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
106
176
|
/**
|
|
107
177
|
* 统一 UI 开发编排工具
|
|
108
178
|
*/
|
|
109
179
|
export async function startUi(args) {
|
|
110
180
|
try {
|
|
181
|
+
const projectRoot = process.cwd();
|
|
182
|
+
// 优先从 project-context.md 读取框架信息
|
|
183
|
+
let detectedFramework = 'html'; // 默认值
|
|
184
|
+
const contextFramework = getFrameworkFromContext(projectRoot);
|
|
185
|
+
if (contextFramework) {
|
|
186
|
+
// 从 project-context.md 中读取到了框架信息
|
|
187
|
+
const fw = contextFramework.toLowerCase();
|
|
188
|
+
if (fw.includes('vue') || fw.includes('nuxt')) {
|
|
189
|
+
detectedFramework = 'vue';
|
|
190
|
+
}
|
|
191
|
+
else if (fw.includes('react') || fw.includes('next')) {
|
|
192
|
+
detectedFramework = 'react';
|
|
193
|
+
}
|
|
194
|
+
else if (fw.includes('html')) {
|
|
195
|
+
detectedFramework = 'html';
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
// 如果没有 project-context.md,则实时检测
|
|
200
|
+
const detection = detectProjectType(projectRoot);
|
|
201
|
+
if (detection.framework) {
|
|
202
|
+
const fw = detection.framework.toLowerCase();
|
|
203
|
+
if (fw.includes('vue') || fw.includes('nuxt')) {
|
|
204
|
+
detectedFramework = 'vue';
|
|
205
|
+
}
|
|
206
|
+
else if (fw.includes('react') || fw.includes('next')) {
|
|
207
|
+
detectedFramework = 'react';
|
|
208
|
+
}
|
|
209
|
+
else if (fw.includes('html') || fw === 'none') {
|
|
210
|
+
detectedFramework = 'html';
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
111
214
|
// 智能参数解析
|
|
112
215
|
const parsedArgs = parseArgs(args, {
|
|
113
216
|
defaultValues: {
|
|
114
217
|
description: "",
|
|
115
|
-
framework:
|
|
218
|
+
framework: detectedFramework, // 使用检测到的框架
|
|
116
219
|
template: "",
|
|
117
220
|
mode: "manual",
|
|
118
221
|
},
|
|
@@ -125,7 +228,7 @@ export async function startUi(args) {
|
|
|
125
228
|
},
|
|
126
229
|
});
|
|
127
230
|
const description = getString(parsedArgs.description);
|
|
128
|
-
const framework = getString(parsedArgs.framework) ||
|
|
231
|
+
const framework = getString(parsedArgs.framework) || detectedFramework;
|
|
129
232
|
const mode = getString(parsedArgs.mode) || "manual";
|
|
130
233
|
let templateName = getString(parsedArgs.template);
|
|
131
234
|
// 验证 mode 参数
|
|
@@ -184,27 +287,35 @@ start_ui "用户列表" --mode=auto
|
|
|
184
287
|
|
|
185
288
|
请按顺序执行以下命令:
|
|
186
289
|
|
|
187
|
-
### 1.
|
|
290
|
+
### 1. 生成项目上下文 📋
|
|
291
|
+
\`\`\`bash
|
|
292
|
+
init_project_context
|
|
293
|
+
\`\`\`
|
|
294
|
+
|
|
295
|
+
### 2. 生成设计系统 🎨
|
|
188
296
|
\`\`\`bash
|
|
189
297
|
ui_design_system --product_type="${inferredProductType}" --stack="${inferredStack}" --keywords="${inferredKeywords}" --description="${description}"
|
|
190
298
|
\`\`\`
|
|
191
299
|
|
|
192
|
-
###
|
|
300
|
+
### 3. 生成组件目录 📦
|
|
193
301
|
\`\`\`bash
|
|
194
302
|
init_component_catalog
|
|
195
303
|
\`\`\`
|
|
196
304
|
|
|
197
|
-
###
|
|
305
|
+
### 4. 生成 UI 模板 📄
|
|
198
306
|
\`\`\`bash
|
|
199
307
|
# 搜索现有模板或生成新模板
|
|
200
308
|
ui_search --mode=template --query="${templateName || description}"
|
|
201
309
|
\`\`\`
|
|
202
310
|
|
|
203
|
-
###
|
|
311
|
+
### 5. 渲染代码 💻
|
|
204
312
|
\`\`\`bash
|
|
205
313
|
render_ui docs/ui/${templateName || 'template'}.json --framework="${inferredStack}"
|
|
206
314
|
\`\`\`
|
|
207
315
|
|
|
316
|
+
### 6. 更新项目上下文 📝
|
|
317
|
+
将生成的 UI 文档链接添加到 \`docs/project-context.md\` 的文档导航部分。
|
|
318
|
+
|
|
208
319
|
---
|
|
209
320
|
|
|
210
321
|
## 💡 为什么选择这个方案?
|
|
@@ -216,6 +327,11 @@ ${recommendation.reasoning}
|
|
|
216
327
|
summary: `智能 UI 开发:${description}`,
|
|
217
328
|
status: 'pending',
|
|
218
329
|
steps: [
|
|
330
|
+
{
|
|
331
|
+
name: '生成项目上下文',
|
|
332
|
+
status: 'pending',
|
|
333
|
+
description: `调用 init_project_context 生成项目文档`,
|
|
334
|
+
},
|
|
219
335
|
{
|
|
220
336
|
name: '生成设计系统',
|
|
221
337
|
status: 'pending',
|
|
@@ -236,13 +352,20 @@ ${recommendation.reasoning}
|
|
|
236
352
|
status: 'pending',
|
|
237
353
|
description: '调用 render_ui 生成组件代码',
|
|
238
354
|
},
|
|
355
|
+
{
|
|
356
|
+
name: '更新项目上下文',
|
|
357
|
+
status: 'pending',
|
|
358
|
+
description: '将 UI 文档添加到 project-context.md 索引',
|
|
359
|
+
},
|
|
239
360
|
],
|
|
240
361
|
artifacts: [],
|
|
241
362
|
nextSteps: [
|
|
363
|
+
'调用 init_project_context',
|
|
242
364
|
`调用 ui_design_system --product_type="${inferredProductType}" --stack="${inferredStack}"`,
|
|
243
365
|
'调用 init_component_catalog',
|
|
244
366
|
`调用 ui_search --mode=template --query="${description}"`,
|
|
245
367
|
`调用 render_ui --framework="${inferredStack}"`,
|
|
368
|
+
'更新 docs/project-context.md 添加 UI 文档链接',
|
|
246
369
|
],
|
|
247
370
|
designSystem: {
|
|
248
371
|
colors: {},
|
|
@@ -326,6 +449,11 @@ start_ui "设置页面" --framework=react
|
|
|
326
449
|
summary: `UI 开发工作流:${description}`,
|
|
327
450
|
status: 'pending',
|
|
328
451
|
steps: [
|
|
452
|
+
{
|
|
453
|
+
name: '检查项目上下文',
|
|
454
|
+
status: 'pending',
|
|
455
|
+
description: '检查 docs/project-context.md 是否存在',
|
|
456
|
+
},
|
|
329
457
|
{
|
|
330
458
|
name: '检查设计系统',
|
|
331
459
|
status: 'pending',
|
|
@@ -346,13 +474,20 @@ start_ui "设置页面" --framework=react
|
|
|
346
474
|
status: 'pending',
|
|
347
475
|
description: '调用 render_ui 生成组件代码',
|
|
348
476
|
},
|
|
477
|
+
{
|
|
478
|
+
name: '更新项目上下文',
|
|
479
|
+
status: 'pending',
|
|
480
|
+
description: '将 UI 文档添加到 project-context.md 索引',
|
|
481
|
+
},
|
|
349
482
|
],
|
|
350
483
|
artifacts: [],
|
|
351
484
|
nextSteps: [
|
|
485
|
+
'检查项目上下文,如不存在则调用 init_project_context',
|
|
352
486
|
'检查设计系统文件,如不存在则调用 ui_design_system',
|
|
353
487
|
'检查组件目录,如不存在则调用 init_component_catalog',
|
|
354
488
|
`调用 ui_search --mode=template --query="${description}"`,
|
|
355
489
|
`调用 render_ui --framework="${framework}"`,
|
|
490
|
+
'更新 docs/project-context.md 添加 UI 文档链接',
|
|
356
491
|
],
|
|
357
492
|
designSystem: {
|
|
358
493
|
colors: {},
|
|
@@ -296,13 +296,19 @@
|
|
|
296
296
|
|
|
297
297
|
<div class="nav-section">
|
|
298
298
|
<div class="nav-section-title">工具文档</div>
|
|
299
|
-
<
|
|
299
|
+
<div class="nav-item nav-item-toggle active expanded" onclick="toggleSubmenu(this)">
|
|
300
300
|
<div class="nav-item-content">
|
|
301
301
|
<span class="icon">🛠️</span>
|
|
302
302
|
<span>所有工具</span>
|
|
303
303
|
</div>
|
|
304
|
-
<
|
|
305
|
-
|
|
304
|
+
<div style="display: flex; align-items: center; gap: 8px;">
|
|
305
|
+
<span class="badge">39</span>
|
|
306
|
+
<span class="toggle-icon">▶</span>
|
|
307
|
+
</div>
|
|
308
|
+
</div>
|
|
309
|
+
<div class="nav-submenu expanded" id="tools-submenu">
|
|
310
|
+
<!-- 工具列表将通过 JavaScript 动态生成 -->
|
|
311
|
+
</div>
|
|
306
312
|
</div>
|
|
307
313
|
|
|
308
314
|
<div class="nav-section">
|
|
@@ -464,6 +470,142 @@
|
|
|
464
470
|
<!-- 引入工具数据 -->
|
|
465
471
|
<script src="../data/tools.js"></script>
|
|
466
472
|
<script>
|
|
473
|
+
// 切换子菜单展开/收起
|
|
474
|
+
function toggleSubmenu(element) {
|
|
475
|
+
element.classList.toggle('expanded');
|
|
476
|
+
const submenu = document.getElementById('tools-submenu');
|
|
477
|
+
submenu.classList.toggle('expanded');
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// 工具简短描述(最多4个字)
|
|
481
|
+
const toolDescriptions = {
|
|
482
|
+
// 工作流编排
|
|
483
|
+
'start_feature': '新功能',
|
|
484
|
+
'start_bugfix': '修Bug',
|
|
485
|
+
'start_review': '代码审查',
|
|
486
|
+
'start_release': '发版本',
|
|
487
|
+
'start_refactor': '重构',
|
|
488
|
+
'start_onboard': '快速上手',
|
|
489
|
+
'start_api': 'API开发',
|
|
490
|
+
'start_doc': '写文档',
|
|
491
|
+
'start_ui': 'UI开发',
|
|
492
|
+
'start_ralph': '循环开发',
|
|
493
|
+
|
|
494
|
+
// 代码分析
|
|
495
|
+
'code_review': '审查代码',
|
|
496
|
+
'security_scan': '安全扫描',
|
|
497
|
+
'debug': '调试',
|
|
498
|
+
'perf': '性能优化',
|
|
499
|
+
'refactor': '重构建议',
|
|
500
|
+
'fix_bug': '修复Bug',
|
|
501
|
+
'estimate': '工作量',
|
|
502
|
+
|
|
503
|
+
// Git 工具
|
|
504
|
+
'gencommit': '生成提交',
|
|
505
|
+
'genchangelog': '生成日志',
|
|
506
|
+
'genpr': '生成PR',
|
|
507
|
+
'resolve_conflict': '解决冲突',
|
|
508
|
+
|
|
509
|
+
// 生成工具
|
|
510
|
+
'genapi': 'API文档',
|
|
511
|
+
'gendoc': '生成注释',
|
|
512
|
+
'gentest': '生成测试',
|
|
513
|
+
'gensql': '生成SQL',
|
|
514
|
+
'genreadme': '生成说明',
|
|
515
|
+
'gen_mock': '生成数据',
|
|
516
|
+
'genui': '生成UI',
|
|
517
|
+
|
|
518
|
+
// 项目管理
|
|
519
|
+
'init_project': '初始化',
|
|
520
|
+
'analyze_project': '分析项目',
|
|
521
|
+
'init_project_context': '项目上下文',
|
|
522
|
+
'add_feature': '添加功能',
|
|
523
|
+
'check_deps': '检查依赖',
|
|
524
|
+
'interview': '需求访谈',
|
|
525
|
+
'ask_user': '提问用户',
|
|
526
|
+
|
|
527
|
+
// UI/UX 工具
|
|
528
|
+
'ui_design_system': '设计系统',
|
|
529
|
+
'ui_search': '搜索UI',
|
|
530
|
+
'sync_ui_data': '同步数据',
|
|
531
|
+
'init_component_catalog': '组件目录',
|
|
532
|
+
'render_ui': '渲染UI',
|
|
533
|
+
'design2code': '设计转码',
|
|
534
|
+
|
|
535
|
+
// 其他工具
|
|
536
|
+
'fix': '修复',
|
|
537
|
+
'split': '拆分',
|
|
538
|
+
'convert': '转换',
|
|
539
|
+
'explain': '解释',
|
|
540
|
+
'css_order': 'CSS排序',
|
|
541
|
+
'detect_shell': '检测Shell',
|
|
542
|
+
'init_setting': '初始设置',
|
|
543
|
+
'gen_skill': '生成技能'
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
// 生成侧边栏工具列表
|
|
547
|
+
function generateSidebarTools() {
|
|
548
|
+
const submenu = document.getElementById('tools-submenu');
|
|
549
|
+
let html = '';
|
|
550
|
+
|
|
551
|
+
for (const [categoryKey, categoryInfo] of Object.entries(categories)) {
|
|
552
|
+
const tools = toolsData[categoryKey];
|
|
553
|
+
if (!tools || tools.length === 0) continue;
|
|
554
|
+
|
|
555
|
+
tools.forEach(tool => {
|
|
556
|
+
const toolId = tool.name.replace(/_/g, '-');
|
|
557
|
+
const desc = toolDescriptions[tool.name] || '';
|
|
558
|
+
const displayText = desc ? `${tool.name} (${desc})` : tool.name;
|
|
559
|
+
|
|
560
|
+
html += `
|
|
561
|
+
<a href="javascript:void(0)" class="nav-subitem" onclick="scrollToTool('${toolId}', event)" title="${tool.description}">
|
|
562
|
+
${displayText}
|
|
563
|
+
</a>
|
|
564
|
+
`;
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
submenu.innerHTML = html;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
// 滚动到指定工具
|
|
572
|
+
function scrollToTool(toolId, event) {
|
|
573
|
+
// 阻止默认行为
|
|
574
|
+
if (event) {
|
|
575
|
+
event.preventDefault();
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// 移除所有选中状态
|
|
579
|
+
document.querySelectorAll('.nav-subitem').forEach(item => {
|
|
580
|
+
item.classList.remove('active');
|
|
581
|
+
});
|
|
582
|
+
|
|
583
|
+
// 添加当前选中状态
|
|
584
|
+
if (event && event.currentTarget) {
|
|
585
|
+
event.currentTarget.classList.add('active');
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
const element = document.getElementById(toolId);
|
|
589
|
+
if (element) {
|
|
590
|
+
// 计算滚动位置,留出 header 高度 (60px) + 间距 (40px)
|
|
591
|
+
const headerHeight = 100;
|
|
592
|
+
const elementPosition = element.getBoundingClientRect().top + window.pageYOffset;
|
|
593
|
+
const offsetPosition = elementPosition - headerHeight;
|
|
594
|
+
|
|
595
|
+
window.scrollTo({
|
|
596
|
+
top: offsetPosition,
|
|
597
|
+
behavior: 'smooth'
|
|
598
|
+
});
|
|
599
|
+
|
|
600
|
+
// 高亮显示
|
|
601
|
+
element.style.transition = 'background 0.3s';
|
|
602
|
+
element.style.background = 'rgba(37, 99, 235, 0.05)';
|
|
603
|
+
setTimeout(() => {
|
|
604
|
+
element.style.background = '';
|
|
605
|
+
}, 2000);
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
|
|
467
609
|
// Topbar scroll effect
|
|
468
610
|
const topbar = document.getElementById('topbar');
|
|
469
611
|
window.addEventListener('scroll', () => {
|
|
@@ -584,7 +726,7 @@
|
|
|
584
726
|
}
|
|
585
727
|
|
|
586
728
|
return `
|
|
587
|
-
<div class="tool-card">
|
|
729
|
+
<div class="tool-card" id="${tool.name.replace(/_/g, '-')}">
|
|
588
730
|
<div class="tool-main">
|
|
589
731
|
<div class="tool-header">
|
|
590
732
|
<div class="tool-name">${tool.name}</div>
|
|
@@ -632,6 +774,9 @@
|
|
|
632
774
|
});
|
|
633
775
|
}
|
|
634
776
|
|
|
777
|
+
// 生成侧边栏工具列表
|
|
778
|
+
generateSidebarTools();
|
|
779
|
+
|
|
635
780
|
// 渲染所有工具
|
|
636
781
|
renderTools();
|
|
637
782
|
|
package/docs/styles/page.css
CHANGED
|
@@ -126,7 +126,7 @@ body {
|
|
|
126
126
|
|
|
127
127
|
/* ========== Sidebar ========== */
|
|
128
128
|
.sidebar {
|
|
129
|
-
width:
|
|
129
|
+
width: 300px;
|
|
130
130
|
background: var(--bg-card);
|
|
131
131
|
border-right: 1px solid var(--border);
|
|
132
132
|
position: fixed;
|
|
@@ -218,6 +218,59 @@ body {
|
|
|
218
218
|
opacity: 1;
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
+
/* 子菜单样式 */
|
|
222
|
+
.nav-item-toggle {
|
|
223
|
+
cursor: pointer;
|
|
224
|
+
user-select: none;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.nav-item-toggle .toggle-icon {
|
|
228
|
+
transition: transform 0.2s;
|
|
229
|
+
font-size: 12px;
|
|
230
|
+
color: var(--text-tertiary);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.nav-item-toggle.expanded .toggle-icon {
|
|
234
|
+
transform: rotate(90deg);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.nav-submenu {
|
|
238
|
+
max-height: 0;
|
|
239
|
+
overflow: hidden;
|
|
240
|
+
transition: max-height 0.3s ease-out;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.nav-submenu.expanded {
|
|
244
|
+
max-height: 2000px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.nav-subitem {
|
|
248
|
+
display: block;
|
|
249
|
+
padding: 8px 16px 8px 40px;
|
|
250
|
+
margin: 2px 8px;
|
|
251
|
+
color: var(--text-secondary);
|
|
252
|
+
text-decoration: none;
|
|
253
|
+
transition: all 0.2s;
|
|
254
|
+
border-radius: 6px;
|
|
255
|
+
font-size: 12px;
|
|
256
|
+
position: relative;
|
|
257
|
+
white-space: nowrap;
|
|
258
|
+
overflow: hidden;
|
|
259
|
+
text-overflow: ellipsis;
|
|
260
|
+
font-family: 'Courier New', monospace;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.nav-subitem:hover {
|
|
264
|
+
background: var(--bg-hover);
|
|
265
|
+
color: var(--primary);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.nav-subitem.active {
|
|
269
|
+
background: rgba(37, 99, 235, 0.05);
|
|
270
|
+
color: var(--primary);
|
|
271
|
+
font-weight: 600;
|
|
272
|
+
}
|
|
273
|
+
|
|
221
274
|
.badge {
|
|
222
275
|
background: var(--bg-hover);
|
|
223
276
|
color: var(--text-secondary);
|
|
@@ -301,7 +354,7 @@ body {
|
|
|
301
354
|
/* ========== Main Content ========== */
|
|
302
355
|
.main-content {
|
|
303
356
|
flex: 1;
|
|
304
|
-
margin-left:
|
|
357
|
+
margin-left: 300px;
|
|
305
358
|
display: flex;
|
|
306
359
|
flex-direction: column;
|
|
307
360
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-probe-kit",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "AI-Powered Development Toolkit - MCP Server with 39 practical tools covering code quality, development efficiency, project management, and UI/UX design. Features: Structured Output, Workflow Orchestration, UI/UX Pro Max, and Requirements Interview.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.js",
|