mcp-probe-kit 1.10.1 → 1.11.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.
- package/build/index.js +22 -450
- package/build/resources/index.d.ts +4 -0
- package/build/resources/index.js +4 -0
- package/build/resources/tool-params-guide.d.ts +571 -0
- package/build/resources/tool-params-guide.js +488 -0
- package/build/schemas/basic-tools.d.ts +54 -0
- package/build/schemas/basic-tools.js +58 -0
- package/build/schemas/code-analysis-tools.d.ts +156 -0
- package/build/schemas/code-analysis-tools.js +165 -0
- package/build/schemas/code-gen-tools.d.ts +150 -0
- package/build/schemas/code-gen-tools.js +158 -0
- package/build/schemas/doc-util-tools.d.ts +85 -0
- package/build/schemas/doc-util-tools.js +93 -0
- package/build/schemas/git-tools.d.ts +76 -0
- package/build/schemas/git-tools.js +81 -0
- package/build/schemas/index.d.ts +767 -0
- package/build/schemas/index.js +20 -0
- package/build/schemas/orchestration-tools.d.ts +186 -0
- package/build/schemas/orchestration-tools.js +196 -0
- package/build/schemas/project-tools.d.ts +84 -0
- package/build/schemas/project-tools.js +89 -0
- package/build/tools/add_feature.js +68 -5
- package/build/tools/start_feature.js +64 -7
- package/build/utils/parseArgs.js +12 -1
- package/package.json +1 -1
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 代码分析工具的 Schema 定义
|
|
3
|
+
*/
|
|
4
|
+
export declare const codeAnalysisToolSchemas: readonly [{
|
|
5
|
+
readonly name: "debug";
|
|
6
|
+
readonly description: "当用户遇到错误、需要调试问题时使用。分析错误信息和堆栈跟踪,定位问题根因,提供调试策略和解决方案";
|
|
7
|
+
readonly inputSchema: {
|
|
8
|
+
readonly type: "object";
|
|
9
|
+
readonly properties: {
|
|
10
|
+
readonly error: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly description: "错误信息。可以是错误消息、堆栈跟踪或完整的错误输出";
|
|
13
|
+
};
|
|
14
|
+
readonly context: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly description: "相关代码上下文。可选,有助于更准确的分析";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
readonly required: readonly [];
|
|
20
|
+
readonly additionalProperties: true;
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
readonly name: "code_review";
|
|
24
|
+
readonly description: "当用户需要审查代码质量、检查代码问题时使用。审查代码的质量、安全性、性能,输出结构化问题清单(severity/category/suggestion)";
|
|
25
|
+
readonly inputSchema: {
|
|
26
|
+
readonly type: "object";
|
|
27
|
+
readonly properties: {
|
|
28
|
+
readonly code: {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
readonly description: "要审查的代码。可以是代码片段、完整文件或 git diff 输出";
|
|
31
|
+
};
|
|
32
|
+
readonly focus: {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
readonly description: "审查重点:security(安全)、performance(性能)、quality(质量)、all(全部)。可选,默认 all";
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
readonly required: readonly [];
|
|
38
|
+
readonly additionalProperties: true;
|
|
39
|
+
};
|
|
40
|
+
}, {
|
|
41
|
+
readonly name: "explain";
|
|
42
|
+
readonly description: "当用户不理解某段代码、需要代码解释时使用。解释代码逻辑和实现原理,包含执行流程、关键概念";
|
|
43
|
+
readonly inputSchema: {
|
|
44
|
+
readonly type: "object";
|
|
45
|
+
readonly properties: {
|
|
46
|
+
readonly code: {
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
readonly description: "要解释的代码。可以是代码片段或完整函数";
|
|
49
|
+
};
|
|
50
|
+
readonly context: {
|
|
51
|
+
readonly type: "string";
|
|
52
|
+
readonly description: "业务背景或上下文。可选,有助于更好的解释";
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
readonly required: readonly [];
|
|
56
|
+
readonly additionalProperties: true;
|
|
57
|
+
};
|
|
58
|
+
}, {
|
|
59
|
+
readonly name: "perf";
|
|
60
|
+
readonly description: "当用户关注代码性能、需要优化性能时使用。分析性能瓶颈(算法/内存/数据库/React渲染),输出瓶颈清单和优化建议";
|
|
61
|
+
readonly inputSchema: {
|
|
62
|
+
readonly type: "object";
|
|
63
|
+
readonly properties: {
|
|
64
|
+
readonly code: {
|
|
65
|
+
readonly type: "string";
|
|
66
|
+
readonly description: "要分析性能的代码";
|
|
67
|
+
};
|
|
68
|
+
readonly type: {
|
|
69
|
+
readonly type: "string";
|
|
70
|
+
readonly description: "分析类型:algorithm(算法)、memory(内存)、database(数据库)、react(React渲染)。可选,会自动识别";
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
readonly required: readonly [];
|
|
74
|
+
readonly additionalProperties: true;
|
|
75
|
+
};
|
|
76
|
+
}, {
|
|
77
|
+
readonly name: "security_scan";
|
|
78
|
+
readonly description: "当用户关注代码安全、需要检查安全漏洞时使用。扫描安全漏洞(注入/认证/加密/敏感数据),输出风险清单和修复建议";
|
|
79
|
+
readonly inputSchema: {
|
|
80
|
+
readonly type: "object";
|
|
81
|
+
readonly properties: {
|
|
82
|
+
readonly code: {
|
|
83
|
+
readonly type: "string";
|
|
84
|
+
readonly description: "要扫描的代码";
|
|
85
|
+
};
|
|
86
|
+
readonly language: {
|
|
87
|
+
readonly type: "string";
|
|
88
|
+
readonly description: "编程语言。可选,会自动识别";
|
|
89
|
+
};
|
|
90
|
+
readonly scan_type: {
|
|
91
|
+
readonly type: "string";
|
|
92
|
+
readonly description: "扫描类型:injection(注入)、auth(认证)、crypto(加密)、all(全部)。可选,默认 all";
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
readonly required: readonly [];
|
|
96
|
+
readonly additionalProperties: true;
|
|
97
|
+
};
|
|
98
|
+
}, {
|
|
99
|
+
readonly name: "refactor";
|
|
100
|
+
readonly description: "当用户需要重构代码、改善代码结构时使用。分析代码结构,提供重构建议、重构步骤和风险评估";
|
|
101
|
+
readonly inputSchema: {
|
|
102
|
+
readonly type: "object";
|
|
103
|
+
readonly properties: {
|
|
104
|
+
readonly code: {
|
|
105
|
+
readonly type: "string";
|
|
106
|
+
readonly description: "要重构的代码";
|
|
107
|
+
};
|
|
108
|
+
readonly goal: {
|
|
109
|
+
readonly type: "string";
|
|
110
|
+
readonly description: "重构目标:improve_readability(可读性)、reduce_complexity(复杂度)、performance(性能)。可选";
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
readonly required: readonly [];
|
|
114
|
+
readonly additionalProperties: true;
|
|
115
|
+
};
|
|
116
|
+
}, {
|
|
117
|
+
readonly name: "fix";
|
|
118
|
+
readonly description: "当用户需要自动修复代码问题(Lint/格式化/类型错误)时使用。自动修复可机械化问题,输出补丁(unified diff)";
|
|
119
|
+
readonly inputSchema: {
|
|
120
|
+
readonly type: "object";
|
|
121
|
+
readonly properties: {
|
|
122
|
+
readonly code: {
|
|
123
|
+
readonly type: "string";
|
|
124
|
+
readonly description: "要修复的代码";
|
|
125
|
+
};
|
|
126
|
+
readonly type: {
|
|
127
|
+
readonly type: "string";
|
|
128
|
+
readonly description: "修复类型:lint(代码规范)、ts(TypeScript错误)、format(格式化)、import(导入)。可选,会自动识别";
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
readonly required: readonly [];
|
|
132
|
+
readonly additionalProperties: true;
|
|
133
|
+
};
|
|
134
|
+
}, {
|
|
135
|
+
readonly name: "fix_bug";
|
|
136
|
+
readonly description: "当用户需要修复 Bug、获取修复指导时使用。提供 Bug 修复流程指导,包含根因分析、修复方案、验证步骤";
|
|
137
|
+
readonly inputSchema: {
|
|
138
|
+
readonly type: "object";
|
|
139
|
+
readonly properties: {
|
|
140
|
+
readonly error_message: {
|
|
141
|
+
readonly type: "string";
|
|
142
|
+
readonly description: "错误信息";
|
|
143
|
+
};
|
|
144
|
+
readonly stack_trace: {
|
|
145
|
+
readonly type: "string";
|
|
146
|
+
readonly description: "堆栈跟踪。可选";
|
|
147
|
+
};
|
|
148
|
+
readonly code_context: {
|
|
149
|
+
readonly type: "string";
|
|
150
|
+
readonly description: "相关代码。可选";
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
readonly required: readonly [];
|
|
154
|
+
readonly additionalProperties: true;
|
|
155
|
+
};
|
|
156
|
+
}];
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 代码分析工具的 Schema 定义
|
|
3
|
+
*/
|
|
4
|
+
export const codeAnalysisToolSchemas = [
|
|
5
|
+
{
|
|
6
|
+
name: "debug",
|
|
7
|
+
description: "当用户遇到错误、需要调试问题时使用。分析错误信息和堆栈跟踪,定位问题根因,提供调试策略和解决方案",
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
error: {
|
|
12
|
+
type: "string",
|
|
13
|
+
description: "错误信息。可以是错误消息、堆栈跟踪或完整的错误输出",
|
|
14
|
+
},
|
|
15
|
+
context: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "相关代码上下文。可选,有助于更准确的分析",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
required: [],
|
|
21
|
+
additionalProperties: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "code_review",
|
|
26
|
+
description: "当用户需要审查代码质量、检查代码问题时使用。审查代码的质量、安全性、性能,输出结构化问题清单(severity/category/suggestion)",
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: "object",
|
|
29
|
+
properties: {
|
|
30
|
+
code: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "要审查的代码。可以是代码片段、完整文件或 git diff 输出",
|
|
33
|
+
},
|
|
34
|
+
focus: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "审查重点:security(安全)、performance(性能)、quality(质量)、all(全部)。可选,默认 all",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
required: [],
|
|
40
|
+
additionalProperties: true,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "explain",
|
|
45
|
+
description: "当用户不理解某段代码、需要代码解释时使用。解释代码逻辑和实现原理,包含执行流程、关键概念",
|
|
46
|
+
inputSchema: {
|
|
47
|
+
type: "object",
|
|
48
|
+
properties: {
|
|
49
|
+
code: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "要解释的代码。可以是代码片段或完整函数",
|
|
52
|
+
},
|
|
53
|
+
context: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "业务背景或上下文。可选,有助于更好的解释",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
required: [],
|
|
59
|
+
additionalProperties: true,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "perf",
|
|
64
|
+
description: "当用户关注代码性能、需要优化性能时使用。分析性能瓶颈(算法/内存/数据库/React渲染),输出瓶颈清单和优化建议",
|
|
65
|
+
inputSchema: {
|
|
66
|
+
type: "object",
|
|
67
|
+
properties: {
|
|
68
|
+
code: {
|
|
69
|
+
type: "string",
|
|
70
|
+
description: "要分析性能的代码",
|
|
71
|
+
},
|
|
72
|
+
type: {
|
|
73
|
+
type: "string",
|
|
74
|
+
description: "分析类型:algorithm(算法)、memory(内存)、database(数据库)、react(React渲染)。可选,会自动识别",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
required: [],
|
|
78
|
+
additionalProperties: true,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "security_scan",
|
|
83
|
+
description: "当用户关注代码安全、需要检查安全漏洞时使用。扫描安全漏洞(注入/认证/加密/敏感数据),输出风险清单和修复建议",
|
|
84
|
+
inputSchema: {
|
|
85
|
+
type: "object",
|
|
86
|
+
properties: {
|
|
87
|
+
code: {
|
|
88
|
+
type: "string",
|
|
89
|
+
description: "要扫描的代码",
|
|
90
|
+
},
|
|
91
|
+
language: {
|
|
92
|
+
type: "string",
|
|
93
|
+
description: "编程语言。可选,会自动识别",
|
|
94
|
+
},
|
|
95
|
+
scan_type: {
|
|
96
|
+
type: "string",
|
|
97
|
+
description: "扫描类型:injection(注入)、auth(认证)、crypto(加密)、all(全部)。可选,默认 all",
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
required: [],
|
|
101
|
+
additionalProperties: true,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "refactor",
|
|
106
|
+
description: "当用户需要重构代码、改善代码结构时使用。分析代码结构,提供重构建议、重构步骤和风险评估",
|
|
107
|
+
inputSchema: {
|
|
108
|
+
type: "object",
|
|
109
|
+
properties: {
|
|
110
|
+
code: {
|
|
111
|
+
type: "string",
|
|
112
|
+
description: "要重构的代码",
|
|
113
|
+
},
|
|
114
|
+
goal: {
|
|
115
|
+
type: "string",
|
|
116
|
+
description: "重构目标:improve_readability(可读性)、reduce_complexity(复杂度)、performance(性能)。可选",
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
required: [],
|
|
120
|
+
additionalProperties: true,
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: "fix",
|
|
125
|
+
description: "当用户需要自动修复代码问题(Lint/格式化/类型错误)时使用。自动修复可机械化问题,输出补丁(unified diff)",
|
|
126
|
+
inputSchema: {
|
|
127
|
+
type: "object",
|
|
128
|
+
properties: {
|
|
129
|
+
code: {
|
|
130
|
+
type: "string",
|
|
131
|
+
description: "要修复的代码",
|
|
132
|
+
},
|
|
133
|
+
type: {
|
|
134
|
+
type: "string",
|
|
135
|
+
description: "修复类型:lint(代码规范)、ts(TypeScript错误)、format(格式化)、import(导入)。可选,会自动识别",
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
required: [],
|
|
139
|
+
additionalProperties: true,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "fix_bug",
|
|
144
|
+
description: "当用户需要修复 Bug、获取修复指导时使用。提供 Bug 修复流程指导,包含根因分析、修复方案、验证步骤",
|
|
145
|
+
inputSchema: {
|
|
146
|
+
type: "object",
|
|
147
|
+
properties: {
|
|
148
|
+
error_message: {
|
|
149
|
+
type: "string",
|
|
150
|
+
description: "错误信息",
|
|
151
|
+
},
|
|
152
|
+
stack_trace: {
|
|
153
|
+
type: "string",
|
|
154
|
+
description: "堆栈跟踪。可选",
|
|
155
|
+
},
|
|
156
|
+
code_context: {
|
|
157
|
+
type: "string",
|
|
158
|
+
description: "相关代码。可选",
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
required: [],
|
|
162
|
+
additionalProperties: true,
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
];
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 代码生成工具的 Schema 定义
|
|
3
|
+
*/
|
|
4
|
+
export declare const codeGenToolSchemas: readonly [{
|
|
5
|
+
readonly name: "gentest";
|
|
6
|
+
readonly description: "当用户需要为代码生成单元测试时使用。生成单元测试代码(Jest/Vitest/Mocha),包含边界用例和 mock";
|
|
7
|
+
readonly inputSchema: {
|
|
8
|
+
readonly type: "object";
|
|
9
|
+
readonly properties: {
|
|
10
|
+
readonly code: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly description: "要生成测试的代码。可以是函数、类或模块";
|
|
13
|
+
};
|
|
14
|
+
readonly framework: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly description: "测试框架:jest、vitest、mocha。可选,会自动识别项目使用的框架";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
readonly required: readonly [];
|
|
20
|
+
readonly additionalProperties: true;
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
readonly name: "gendoc";
|
|
24
|
+
readonly description: "当用户需要为代码添加注释、生成文档时使用。生成代码注释(JSDoc/TSDoc/Javadoc),补全参数/返回值/异常/示例";
|
|
25
|
+
readonly inputSchema: {
|
|
26
|
+
readonly type: "object";
|
|
27
|
+
readonly properties: {
|
|
28
|
+
readonly code: {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
readonly description: "要生成注释的代码";
|
|
31
|
+
};
|
|
32
|
+
readonly style: {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
readonly description: "注释风格:jsdoc、tsdoc、javadoc。可选,会根据语言自动选择";
|
|
35
|
+
};
|
|
36
|
+
readonly lang: {
|
|
37
|
+
readonly type: "string";
|
|
38
|
+
readonly description: "注释语言:zh(中文)、en(英文)。可选,默认 zh";
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
readonly required: readonly [];
|
|
42
|
+
readonly additionalProperties: true;
|
|
43
|
+
};
|
|
44
|
+
}, {
|
|
45
|
+
readonly name: "genapi";
|
|
46
|
+
readonly description: "当用户需要生成 API 文档时使用。基于 API 代码(路由/Controller)生成文档(Markdown/OpenAPI/JSDoc),包含参数说明与示例";
|
|
47
|
+
readonly inputSchema: {
|
|
48
|
+
readonly type: "object";
|
|
49
|
+
readonly properties: {
|
|
50
|
+
readonly code: {
|
|
51
|
+
readonly type: "string";
|
|
52
|
+
readonly description: "API 代码。可以是路由定义、Controller 或接口函数";
|
|
53
|
+
};
|
|
54
|
+
readonly format: {
|
|
55
|
+
readonly type: "string";
|
|
56
|
+
readonly description: "文档格式:markdown、openapi、jsdoc。可选,默认 markdown";
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
readonly required: readonly [];
|
|
60
|
+
readonly additionalProperties: true;
|
|
61
|
+
};
|
|
62
|
+
}, {
|
|
63
|
+
readonly name: "genui";
|
|
64
|
+
readonly description: "当用户需要生成 UI 组件代码时使用。根据描述生成 UI 组件代码(React/Vue/HTML),包含 Props 和样式";
|
|
65
|
+
readonly inputSchema: {
|
|
66
|
+
readonly type: "object";
|
|
67
|
+
readonly properties: {
|
|
68
|
+
readonly description: {
|
|
69
|
+
readonly type: "string";
|
|
70
|
+
readonly description: "组件描述。可以是简短描述(如'登录表单组件')或详细的UI需求";
|
|
71
|
+
};
|
|
72
|
+
readonly framework: {
|
|
73
|
+
readonly type: "string";
|
|
74
|
+
readonly description: "前端框架:react、vue、html。可选,默认 react";
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
readonly required: readonly [];
|
|
78
|
+
readonly additionalProperties: true;
|
|
79
|
+
};
|
|
80
|
+
}, {
|
|
81
|
+
readonly name: "gensql";
|
|
82
|
+
readonly description: "当用户需要根据自然语言生成 SQL 查询时使用。将自然语言描述转换为 SQL 语句(PostgreSQL/MySQL/SQLite)";
|
|
83
|
+
readonly inputSchema: {
|
|
84
|
+
readonly type: "object";
|
|
85
|
+
readonly properties: {
|
|
86
|
+
readonly description: {
|
|
87
|
+
readonly type: "string";
|
|
88
|
+
readonly description: "查询需求的自然语言描述。如'查询所有活跃用户的姓名和邮箱'";
|
|
89
|
+
};
|
|
90
|
+
readonly dialect: {
|
|
91
|
+
readonly type: "string";
|
|
92
|
+
readonly description: "SQL 方言:postgres、mysql、sqlite。可选,默认 postgres";
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
readonly required: readonly [];
|
|
96
|
+
readonly additionalProperties: true;
|
|
97
|
+
};
|
|
98
|
+
}, {
|
|
99
|
+
readonly name: "gen_mock";
|
|
100
|
+
readonly description: "当用户需要生成测试数据、Mock 数据时使用。根据 TypeScript 类型或 JSON Schema 生成 Mock 数据";
|
|
101
|
+
readonly inputSchema: {
|
|
102
|
+
readonly type: "object";
|
|
103
|
+
readonly properties: {
|
|
104
|
+
readonly schema: {
|
|
105
|
+
readonly type: "string";
|
|
106
|
+
readonly description: "数据结构定义(TypeScript interface、JSON Schema 或自然语言描述)";
|
|
107
|
+
};
|
|
108
|
+
readonly count: {
|
|
109
|
+
readonly type: "number";
|
|
110
|
+
readonly description: "生成数据条数。可选,默认为 1,范围 1-1000";
|
|
111
|
+
};
|
|
112
|
+
readonly format: {
|
|
113
|
+
readonly type: "string";
|
|
114
|
+
readonly description: "输出格式:json、typescript、javascript、csv。可选,默认为 json";
|
|
115
|
+
};
|
|
116
|
+
readonly locale: {
|
|
117
|
+
readonly type: "string";
|
|
118
|
+
readonly description: "数据语言:zh-CN(中文)、en-US(英文)、ja-JP(日文)。可选,默认为 zh-CN";
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
readonly required: readonly [];
|
|
122
|
+
readonly additionalProperties: true;
|
|
123
|
+
};
|
|
124
|
+
}, {
|
|
125
|
+
readonly name: "design2code";
|
|
126
|
+
readonly description: "当用户需要将设计稿转换为代码时使用。将设计稿(图片URL/描述/HTML)转换为前端代码(React/Vue),1:1 还原布局和样式";
|
|
127
|
+
readonly inputSchema: {
|
|
128
|
+
readonly type: "object";
|
|
129
|
+
readonly properties: {
|
|
130
|
+
readonly input: {
|
|
131
|
+
readonly type: "string";
|
|
132
|
+
readonly description: "设计稿输入:图片 URL、base64 图片、HTML 代码或设计稿描述";
|
|
133
|
+
};
|
|
134
|
+
readonly framework: {
|
|
135
|
+
readonly type: "string";
|
|
136
|
+
readonly description: "目标框架:vue、react。可选,默认为 vue";
|
|
137
|
+
};
|
|
138
|
+
readonly style_solution: {
|
|
139
|
+
readonly type: "string";
|
|
140
|
+
readonly description: "样式方案:tailwind、css-modules、styled-components。可选,默认为 tailwind";
|
|
141
|
+
};
|
|
142
|
+
readonly component_type: {
|
|
143
|
+
readonly type: "string";
|
|
144
|
+
readonly description: "组件类型:page(页面组件)、component(通用组件)。可选,默认为 page";
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
readonly required: readonly [];
|
|
148
|
+
readonly additionalProperties: true;
|
|
149
|
+
};
|
|
150
|
+
}];
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 代码生成工具的 Schema 定义
|
|
3
|
+
*/
|
|
4
|
+
export const codeGenToolSchemas = [
|
|
5
|
+
{
|
|
6
|
+
name: "gentest",
|
|
7
|
+
description: "当用户需要为代码生成单元测试时使用。生成单元测试代码(Jest/Vitest/Mocha),包含边界用例和 mock",
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
code: {
|
|
12
|
+
type: "string",
|
|
13
|
+
description: "要生成测试的代码。可以是函数、类或模块",
|
|
14
|
+
},
|
|
15
|
+
framework: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "测试框架:jest、vitest、mocha。可选,会自动识别项目使用的框架",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
required: [],
|
|
21
|
+
additionalProperties: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "gendoc",
|
|
26
|
+
description: "当用户需要为代码添加注释、生成文档时使用。生成代码注释(JSDoc/TSDoc/Javadoc),补全参数/返回值/异常/示例",
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: "object",
|
|
29
|
+
properties: {
|
|
30
|
+
code: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "要生成注释的代码",
|
|
33
|
+
},
|
|
34
|
+
style: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "注释风格:jsdoc、tsdoc、javadoc。可选,会根据语言自动选择",
|
|
37
|
+
},
|
|
38
|
+
lang: {
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "注释语言:zh(中文)、en(英文)。可选,默认 zh",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
required: [],
|
|
44
|
+
additionalProperties: true,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "genapi",
|
|
49
|
+
description: "当用户需要生成 API 文档时使用。基于 API 代码(路由/Controller)生成文档(Markdown/OpenAPI/JSDoc),包含参数说明与示例",
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: {
|
|
53
|
+
code: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "API 代码。可以是路由定义、Controller 或接口函数",
|
|
56
|
+
},
|
|
57
|
+
format: {
|
|
58
|
+
type: "string",
|
|
59
|
+
description: "文档格式:markdown、openapi、jsdoc。可选,默认 markdown",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
required: [],
|
|
63
|
+
additionalProperties: true,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "genui",
|
|
68
|
+
description: "当用户需要生成 UI 组件代码时使用。根据描述生成 UI 组件代码(React/Vue/HTML),包含 Props 和样式",
|
|
69
|
+
inputSchema: {
|
|
70
|
+
type: "object",
|
|
71
|
+
properties: {
|
|
72
|
+
description: {
|
|
73
|
+
type: "string",
|
|
74
|
+
description: "组件描述。可以是简短描述(如'登录表单组件')或详细的UI需求",
|
|
75
|
+
},
|
|
76
|
+
framework: {
|
|
77
|
+
type: "string",
|
|
78
|
+
description: "前端框架:react、vue、html。可选,默认 react",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
required: [],
|
|
82
|
+
additionalProperties: true,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "gensql",
|
|
87
|
+
description: "当用户需要根据自然语言生成 SQL 查询时使用。将自然语言描述转换为 SQL 语句(PostgreSQL/MySQL/SQLite)",
|
|
88
|
+
inputSchema: {
|
|
89
|
+
type: "object",
|
|
90
|
+
properties: {
|
|
91
|
+
description: {
|
|
92
|
+
type: "string",
|
|
93
|
+
description: "查询需求的自然语言描述。如'查询所有活跃用户的姓名和邮箱'",
|
|
94
|
+
},
|
|
95
|
+
dialect: {
|
|
96
|
+
type: "string",
|
|
97
|
+
description: "SQL 方言:postgres、mysql、sqlite。可选,默认 postgres",
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
required: [],
|
|
101
|
+
additionalProperties: true,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "gen_mock",
|
|
106
|
+
description: "当用户需要生成测试数据、Mock 数据时使用。根据 TypeScript 类型或 JSON Schema 生成 Mock 数据",
|
|
107
|
+
inputSchema: {
|
|
108
|
+
type: "object",
|
|
109
|
+
properties: {
|
|
110
|
+
schema: {
|
|
111
|
+
type: "string",
|
|
112
|
+
description: "数据结构定义(TypeScript interface、JSON Schema 或自然语言描述)",
|
|
113
|
+
},
|
|
114
|
+
count: {
|
|
115
|
+
type: "number",
|
|
116
|
+
description: "生成数据条数。可选,默认为 1,范围 1-1000",
|
|
117
|
+
},
|
|
118
|
+
format: {
|
|
119
|
+
type: "string",
|
|
120
|
+
description: "输出格式:json、typescript、javascript、csv。可选,默认为 json",
|
|
121
|
+
},
|
|
122
|
+
locale: {
|
|
123
|
+
type: "string",
|
|
124
|
+
description: "数据语言:zh-CN(中文)、en-US(英文)、ja-JP(日文)。可选,默认为 zh-CN",
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
required: [],
|
|
128
|
+
additionalProperties: true,
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "design2code",
|
|
133
|
+
description: "当用户需要将设计稿转换为代码时使用。将设计稿(图片URL/描述/HTML)转换为前端代码(React/Vue),1:1 还原布局和样式",
|
|
134
|
+
inputSchema: {
|
|
135
|
+
type: "object",
|
|
136
|
+
properties: {
|
|
137
|
+
input: {
|
|
138
|
+
type: "string",
|
|
139
|
+
description: "设计稿输入:图片 URL、base64 图片、HTML 代码或设计稿描述",
|
|
140
|
+
},
|
|
141
|
+
framework: {
|
|
142
|
+
type: "string",
|
|
143
|
+
description: "目标框架:vue、react。可选,默认为 vue",
|
|
144
|
+
},
|
|
145
|
+
style_solution: {
|
|
146
|
+
type: "string",
|
|
147
|
+
description: "样式方案:tailwind、css-modules、styled-components。可选,默认为 tailwind",
|
|
148
|
+
},
|
|
149
|
+
component_type: {
|
|
150
|
+
type: "string",
|
|
151
|
+
description: "组件类型:page(页面组件)、component(通用组件)。可选,默认为 page",
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
required: [],
|
|
155
|
+
additionalProperties: true,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
];
|