mcp-probe-kit 1.15.1 → 2.0.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/README.md +113 -1642
- package/build/index.js +75 -42
- package/build/lib/elicitation-helper.d.ts +73 -0
- package/build/lib/elicitation-helper.js +130 -0
- package/build/lib/response.d.ts +32 -0
- package/build/lib/response.js +28 -0
- package/build/lib/tasks-manager.d.ts +116 -0
- package/build/lib/tasks-manager.js +217 -0
- package/build/lib/toolset-manager.d.ts +48 -0
- package/build/lib/toolset-manager.js +112 -0
- package/build/schemas/basic-tools.d.ts +0 -32
- package/build/schemas/basic-tools.js +0 -34
- package/build/schemas/code-analysis-tools.d.ts +0 -36
- package/build/schemas/code-analysis-tools.js +0 -38
- package/build/schemas/code-gen-tools.d.ts +0 -44
- package/build/schemas/code-gen-tools.js +0 -46
- package/build/schemas/doc-util-tools.d.ts +0 -54
- package/build/schemas/doc-util-tools.js +0 -58
- package/build/schemas/index.d.ts +0 -188
- package/build/schemas/orchestration-tools.d.ts +0 -22
- package/build/schemas/orchestration-tools.js +0 -23
- package/build/schemas/output/core-tools.d.ts +817 -0
- package/build/schemas/output/core-tools.js +421 -0
- package/build/schemas/output/generation-tools.d.ts +936 -0
- package/build/schemas/output/generation-tools.js +446 -0
- package/build/schemas/output/helper-tools.d.ts +243 -0
- package/build/schemas/output/helper-tools.js +138 -0
- package/build/schemas/output/index.d.ts +76 -0
- package/build/schemas/output/index.js +96 -0
- package/build/schemas/output/project-tools.d.ts +702 -0
- package/build/schemas/output/project-tools.js +339 -0
- package/build/schemas/output/ui-ux-tools.d.ts +469 -0
- package/build/schemas/output/ui-ux-tools.js +218 -0
- package/build/schemas/output/workflow-tools.d.ts +267 -0
- package/build/schemas/output/workflow-tools.js +179 -0
- package/build/schemas/structured-output.d.ts +1317 -0
- package/build/schemas/structured-output.js +1017 -0
- package/build/tools/__tests__/start_ui.integration.test.js +5 -5
- package/build/tools/__tests__/start_ui.property.test.js +11 -11
- package/build/tools/add_feature.d.ts +1 -13
- package/build/tools/add_feature.js +48 -13
- package/build/tools/analyze_project.js +57 -18
- package/build/tools/check_deps.d.ts +1 -13
- package/build/tools/check_deps.js +24 -15
- package/build/tools/code_review.d.ts +1 -13
- package/build/tools/code_review.js +19 -16
- package/build/tools/debug.d.ts +1 -13
- package/build/tools/debug.js +18 -16
- package/build/tools/estimate.d.ts +1 -19
- package/build/tools/estimate.js +36 -6
- package/build/tools/fix_bug.d.ts +1 -13
- package/build/tools/fix_bug.js +24 -6
- package/build/tools/gen_mock.d.ts +1 -19
- package/build/tools/gen_mock.js +42 -227
- package/build/tools/genapi.d.ts +1 -13
- package/build/tools/genapi.js +18 -15
- package/build/tools/genchangelog.d.ts +1 -13
- package/build/tools/genchangelog.js +36 -212
- package/build/tools/gencommit.d.ts +1 -7
- package/build/tools/gencommit.js +21 -13
- package/build/tools/gendoc.d.ts +1 -13
- package/build/tools/gendoc.js +18 -15
- package/build/tools/genpr.d.ts +1 -13
- package/build/tools/genpr.js +28 -157
- package/build/tools/genreadme.d.ts +1 -13
- package/build/tools/genreadme.js +22 -587
- package/build/tools/gensql.d.ts +1 -13
- package/build/tools/gensql.js +24 -283
- package/build/tools/gentest.d.ts +1 -13
- package/build/tools/gentest.js +49 -16
- package/build/tools/index.d.ts +0 -10
- package/build/tools/index.js +0 -10
- package/build/tools/init_component_catalog.d.ts +3 -20
- package/build/tools/init_component_catalog.js +141 -786
- package/build/tools/init_project.d.ts +7 -13
- package/build/tools/init_project.js +54 -16
- package/build/tools/init_project_context.d.ts +1 -13
- package/build/tools/init_project_context.js +41 -14
- package/build/tools/perf.d.ts +1 -13
- package/build/tools/perf.js +18 -15
- package/build/tools/refactor.d.ts +1 -13
- package/build/tools/refactor.js +54 -15
- package/build/tools/render_ui.d.ts +2 -19
- package/build/tools/render_ui.js +201 -347
- package/build/tools/resolve_conflict.d.ts +1 -13
- package/build/tools/resolve_conflict.js +18 -15
- package/build/tools/security_scan.d.ts +1 -13
- package/build/tools/security_scan.js +16 -5
- package/build/tools/start_api.d.ts +7 -13
- package/build/tools/start_api.js +69 -157
- package/build/tools/start_bugfix.d.ts +1 -7
- package/build/tools/start_bugfix.js +38 -2
- package/build/tools/start_doc.d.ts +7 -13
- package/build/tools/start_doc.js +76 -169
- package/build/tools/start_feature.d.ts +1 -7
- package/build/tools/start_feature.js +54 -2
- package/build/tools/start_onboard.d.ts +1 -7
- package/build/tools/start_onboard.js +40 -2
- package/build/tools/start_ralph.d.ts +1 -7
- package/build/tools/start_ralph.js +88 -2
- package/build/tools/start_refactor.d.ts +7 -13
- package/build/tools/start_refactor.js +75 -148
- package/build/tools/start_release.d.ts +7 -13
- package/build/tools/start_release.js +56 -131
- package/build/tools/start_review.d.ts +7 -13
- package/build/tools/start_review.js +70 -142
- package/build/tools/start_ui.d.ts +1 -7
- package/build/tools/start_ui.js +98 -8
- package/build/tools/ui-ux-tools.d.ts +3 -39
- package/build/tools/ui-ux-tools.js +201 -125
- package/docs/data/tools.js +864 -0
- package/docs/index.html +594 -0
- package/docs/pages/all-tools.html +649 -0
- package/docs/pages/examples.html +564 -0
- package/docs/pages/getting-started.html +529 -0
- package/docs/pages/migration.html +308 -0
- package/docs/specs/algorithm-enhancement/roadmap.md +619 -0
- package/docs/specs/vnext-upgrade/00-OVERVIEW.md +258 -0
- package/docs/specs/vnext-upgrade/BETA_RELEASE_GUIDE.md +328 -0
- package/docs/specs/vnext-upgrade/GITHUB_DISCUSSION_TEMPLATE.md +236 -0
- package/docs/specs/vnext-upgrade/M8.9-PROGRESS-UPDATE.md +248 -0
- package/docs/specs/vnext-upgrade/PROGRESS-SUMMARY.md +195 -0
- package/docs/specs/vnext-upgrade/QUICK_REFERENCE.md +338 -0
- package/docs/specs/vnext-upgrade/README.md +125 -0
- package/docs/specs/vnext-upgrade/STATUS-UPDATE-2026-01-26.md +230 -0
- package/docs/specs/vnext-upgrade/TOOL_CLEANUP.md +343 -0
- package/docs/specs/vnext-upgrade/completed/M1-M2-SUMMARY.md +27 -0
- package/docs/specs/vnext-upgrade/completed/M3_COMPLETION_SUMMARY.md +273 -0
- package/docs/specs/vnext-upgrade/completed/M4-SUMMARY.md +19 -0
- package/docs/specs/vnext-upgrade/completed/M5_COMPLETION_SUMMARY.md +0 -0
- package/docs/specs/vnext-upgrade/completed/M8.1-SUMMARY.md +247 -0
- package/docs/specs/vnext-upgrade/completed/M8.2-SUMMARY.md +296 -0
- package/docs/specs/vnext-upgrade/completed/M8.3-SUMMARY.md +241 -0
- package/docs/specs/vnext-upgrade/completed/M8.3-TEST-SUMMARY.md +216 -0
- package/docs/specs/vnext-upgrade/completed/M8.4-SUMMARY.md +217 -0
- package/docs/specs/vnext-upgrade/completed/M8.4-TEST-SUMMARY.md +198 -0
- package/docs/specs/vnext-upgrade/completed/M8.5-SUMMARY.md +202 -0
- package/docs/specs/vnext-upgrade/completed/M8.5-TEST-SUMMARY.md +223 -0
- package/docs/specs/vnext-upgrade/completed/M8.6-SUMMARY.md +299 -0
- package/docs/specs/vnext-upgrade/completed/M8.8-TEST-SUMMARY.md +216 -0
- package/docs/specs/vnext-upgrade/completed/TOOL-CLEANUP-SUMMARY.md +210 -0
- package/docs/specs/vnext-upgrade/design.md +848 -0
- package/docs/specs/vnext-upgrade/requirements.md +221 -0
- package/docs/specs/vnext-upgrade/tasks/00-INDEX.md +335 -0
- package/docs/specs/vnext-upgrade/tasks/M8.1-SCHEMA-DEFINITION.md +300 -0
- package/docs/specs/vnext-upgrade/tasks/M8.2-P1-TOOLS.md +249 -0
- package/docs/specs/vnext-upgrade/tasks/M8.3-GENERATION-TOOLS.md +49 -0
- package/docs/specs/vnext-upgrade/tasks/M8.4-ORCHESTRATION-TOOLS.md +28 -0
- package/docs/specs/vnext-upgrade/tasks/M8.5-PROJECT-TOOLS.md +29 -0
- package/docs/specs/vnext-upgrade/tasks/M8.6-UI-TOOLS.md +66 -0
- package/docs/specs/vnext-upgrade/tasks/M8.7-HELPER-TOOLS.md +24 -0
- package/docs/specs/vnext-upgrade/tasks/M8.8-INTEGRATION-TESTS.md +90 -0
- package/docs/specs/vnext-upgrade/tasks/M8.9-DOCUMENTATION.md +103 -0
- package/docs/styles/docs.css +556 -0
- package/docs/styles/page.css +815 -0
- package/docs/vnext/MCP_2025-11-25_GUIDE.md +276 -0
- package/docs/vnext/vNext-PRD.md +488 -0
- package/package.json +6 -6
- package/docs/BEST_PRACTICES.md +0 -1185
- package/docs/HOW_TO_TRIGGER.md +0 -1141
- package/docs/MCP-Probe-Kit-/344/275/277/347/224/250/346/211/213/345/206/214.html +0 -544
- package/docs/MCP-Probe-Kit-/344/275/277/347/224/250/346/211/213/345/206/214.md +0 -1447
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 核心开发工具的结构化输出 Schema
|
|
3
|
+
* 包含: code_review, debug, fix_bug, gentest, refactor, security_scan, perf
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Code Review Report Schema
|
|
7
|
+
* 用于 code_review 工具的结构化输出
|
|
8
|
+
*/
|
|
9
|
+
export const CodeReviewReportSchema = {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
summary: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: '审查总结',
|
|
15
|
+
},
|
|
16
|
+
overallScore: {
|
|
17
|
+
type: 'number',
|
|
18
|
+
minimum: 0,
|
|
19
|
+
maximum: 100,
|
|
20
|
+
description: '总体评分(0-100)',
|
|
21
|
+
},
|
|
22
|
+
issues: {
|
|
23
|
+
type: 'array',
|
|
24
|
+
description: '问题列表',
|
|
25
|
+
items: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
severity: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
enum: ['critical', 'high', 'medium', 'low', 'info'],
|
|
31
|
+
description: '严重程度',
|
|
32
|
+
},
|
|
33
|
+
category: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
enum: ['security', 'performance', 'quality', 'style', 'best-practice'],
|
|
36
|
+
description: '问题类别',
|
|
37
|
+
},
|
|
38
|
+
line: { type: 'number', description: '行号' },
|
|
39
|
+
file: { type: 'string', description: '文件路径' },
|
|
40
|
+
message: { type: 'string', description: '问题描述' },
|
|
41
|
+
suggestion: { type: 'string', description: '修复建议' },
|
|
42
|
+
code: { type: 'string', description: '问题代码片段' },
|
|
43
|
+
},
|
|
44
|
+
required: ['severity', 'category', 'message'],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
strengths: {
|
|
48
|
+
type: 'array',
|
|
49
|
+
items: { type: 'string' },
|
|
50
|
+
description: '代码优点',
|
|
51
|
+
},
|
|
52
|
+
recommendations: {
|
|
53
|
+
type: 'array',
|
|
54
|
+
items: { type: 'string' },
|
|
55
|
+
description: '改进建议',
|
|
56
|
+
},
|
|
57
|
+
metrics: {
|
|
58
|
+
type: 'object',
|
|
59
|
+
description: '代码指标',
|
|
60
|
+
properties: {
|
|
61
|
+
complexity: { type: 'number' },
|
|
62
|
+
maintainability: { type: 'number' },
|
|
63
|
+
testCoverage: { type: 'number' },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
required: ['summary', 'overallScore', 'issues'],
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Debug Report Schema
|
|
71
|
+
* 用于 debug 工具的结构化输出
|
|
72
|
+
*/
|
|
73
|
+
export const DebugReportSchema = {
|
|
74
|
+
type: 'object',
|
|
75
|
+
properties: {
|
|
76
|
+
summary: { type: 'string', description: '调试摘要' },
|
|
77
|
+
rootCause: { type: 'string', description: '根本原因分析' },
|
|
78
|
+
errorType: {
|
|
79
|
+
type: 'string',
|
|
80
|
+
enum: ['syntax', 'runtime', 'logic', 'performance', 'memory', 'network', 'unknown'],
|
|
81
|
+
description: '错误类型',
|
|
82
|
+
},
|
|
83
|
+
location: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {
|
|
86
|
+
file: { type: 'string' },
|
|
87
|
+
line: { type: 'number' },
|
|
88
|
+
column: { type: 'number' },
|
|
89
|
+
function: { type: 'string' },
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
stackTrace: {
|
|
93
|
+
type: 'array',
|
|
94
|
+
items: {
|
|
95
|
+
type: 'object',
|
|
96
|
+
properties: {
|
|
97
|
+
file: { type: 'string' },
|
|
98
|
+
line: { type: 'number' },
|
|
99
|
+
function: { type: 'string' },
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
debugStrategy: {
|
|
104
|
+
type: 'array',
|
|
105
|
+
items: { type: 'string' },
|
|
106
|
+
description: '调试策略',
|
|
107
|
+
},
|
|
108
|
+
solutions: {
|
|
109
|
+
type: 'array',
|
|
110
|
+
items: {
|
|
111
|
+
type: 'object',
|
|
112
|
+
properties: {
|
|
113
|
+
title: { type: 'string' },
|
|
114
|
+
description: { type: 'string' },
|
|
115
|
+
code: { type: 'string' },
|
|
116
|
+
priority: { type: 'string', enum: ['high', 'medium', 'low'] },
|
|
117
|
+
},
|
|
118
|
+
required: ['title', 'description'],
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
relatedIssues: {
|
|
122
|
+
type: 'array',
|
|
123
|
+
items: { type: 'string' },
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
required: ['summary', 'rootCause', 'errorType', 'solutions'],
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Bug Analysis Schema
|
|
130
|
+
* 用于 fix_bug 工具的结构化输出
|
|
131
|
+
*/
|
|
132
|
+
export const BugAnalysisSchema = {
|
|
133
|
+
type: 'object',
|
|
134
|
+
properties: {
|
|
135
|
+
summary: { type: 'string', description: 'Bug 摘要' },
|
|
136
|
+
bugType: {
|
|
137
|
+
type: 'string',
|
|
138
|
+
enum: ['functional', 'performance', 'security', 'ui', 'data', 'integration'],
|
|
139
|
+
},
|
|
140
|
+
severity: {
|
|
141
|
+
type: 'string',
|
|
142
|
+
enum: ['critical', 'high', 'medium', 'low'],
|
|
143
|
+
},
|
|
144
|
+
rootCause: { type: 'string' },
|
|
145
|
+
affectedComponents: {
|
|
146
|
+
type: 'array',
|
|
147
|
+
items: { type: 'string' },
|
|
148
|
+
},
|
|
149
|
+
affectedFiles: {
|
|
150
|
+
type: 'array',
|
|
151
|
+
items: { type: 'string' },
|
|
152
|
+
},
|
|
153
|
+
fixPlan: {
|
|
154
|
+
type: 'object',
|
|
155
|
+
properties: {
|
|
156
|
+
steps: { type: 'array', items: { type: 'string' } },
|
|
157
|
+
estimatedTime: { type: 'string' },
|
|
158
|
+
risks: { type: 'array', items: { type: 'string' } },
|
|
159
|
+
},
|
|
160
|
+
required: ['steps'],
|
|
161
|
+
},
|
|
162
|
+
testPlan: {
|
|
163
|
+
type: 'object',
|
|
164
|
+
properties: {
|
|
165
|
+
unitTests: { type: 'array', items: { type: 'string' } },
|
|
166
|
+
integrationTests: { type: 'array', items: { type: 'string' } },
|
|
167
|
+
manualTests: { type: 'array', items: { type: 'string' } },
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
preventionMeasures: {
|
|
171
|
+
type: 'array',
|
|
172
|
+
items: { type: 'string' },
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
required: ['summary', 'bugType', 'severity', 'rootCause', 'fixPlan', 'testPlan'],
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Test Suite Schema
|
|
179
|
+
* 用于 gentest 工具的结构化输出
|
|
180
|
+
*/
|
|
181
|
+
export const TestSuiteSchema = {
|
|
182
|
+
type: 'object',
|
|
183
|
+
properties: {
|
|
184
|
+
summary: { type: 'string' },
|
|
185
|
+
framework: {
|
|
186
|
+
type: 'string',
|
|
187
|
+
enum: ['jest', 'vitest', 'mocha', 'jasmine', 'pytest', 'junit'],
|
|
188
|
+
},
|
|
189
|
+
testCases: {
|
|
190
|
+
type: 'array',
|
|
191
|
+
items: {
|
|
192
|
+
type: 'object',
|
|
193
|
+
properties: {
|
|
194
|
+
name: { type: 'string' },
|
|
195
|
+
description: { type: 'string' },
|
|
196
|
+
type: {
|
|
197
|
+
type: 'string',
|
|
198
|
+
enum: ['unit', 'integration', 'e2e', 'performance'],
|
|
199
|
+
},
|
|
200
|
+
code: { type: 'string' },
|
|
201
|
+
assertions: { type: 'array', items: { type: 'string' } },
|
|
202
|
+
},
|
|
203
|
+
required: ['name', 'type', 'code'],
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
edgeCases: {
|
|
207
|
+
type: 'array',
|
|
208
|
+
items: {
|
|
209
|
+
type: 'object',
|
|
210
|
+
properties: {
|
|
211
|
+
scenario: { type: 'string' },
|
|
212
|
+
input: { type: 'string' },
|
|
213
|
+
expectedOutput: { type: 'string' },
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
mockData: {
|
|
218
|
+
type: 'object',
|
|
219
|
+
additionalProperties: true,
|
|
220
|
+
},
|
|
221
|
+
coverage: {
|
|
222
|
+
type: 'object',
|
|
223
|
+
properties: {
|
|
224
|
+
statements: { type: 'number' },
|
|
225
|
+
branches: { type: 'number' },
|
|
226
|
+
functions: { type: 'number' },
|
|
227
|
+
lines: { type: 'number' },
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
required: ['summary', 'framework', 'testCases'],
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Refactor Plan Schema
|
|
235
|
+
* 用于 refactor 工具的结构化输出
|
|
236
|
+
*/
|
|
237
|
+
export const RefactorPlanSchema = {
|
|
238
|
+
type: 'object',
|
|
239
|
+
properties: {
|
|
240
|
+
summary: { type: 'string' },
|
|
241
|
+
goal: {
|
|
242
|
+
type: 'string',
|
|
243
|
+
enum: ['improve_readability', 'reduce_complexity', 'improve_performance', 'improve_maintainability', 'modernize'],
|
|
244
|
+
},
|
|
245
|
+
currentIssues: {
|
|
246
|
+
type: 'array',
|
|
247
|
+
items: { type: 'string' },
|
|
248
|
+
},
|
|
249
|
+
refactoringSteps: {
|
|
250
|
+
type: 'array',
|
|
251
|
+
items: {
|
|
252
|
+
type: 'object',
|
|
253
|
+
properties: {
|
|
254
|
+
step: { type: 'number' },
|
|
255
|
+
title: { type: 'string' },
|
|
256
|
+
description: { type: 'string' },
|
|
257
|
+
before: { type: 'string' },
|
|
258
|
+
after: { type: 'string' },
|
|
259
|
+
rationale: { type: 'string' },
|
|
260
|
+
},
|
|
261
|
+
required: ['step', 'title', 'description'],
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
riskAssessment: {
|
|
265
|
+
type: 'object',
|
|
266
|
+
properties: {
|
|
267
|
+
level: { type: 'string', enum: ['low', 'medium', 'high'] },
|
|
268
|
+
risks: { type: 'array', items: { type: 'string' } },
|
|
269
|
+
mitigations: { type: 'array', items: { type: 'string' } },
|
|
270
|
+
},
|
|
271
|
+
required: ['level', 'risks'],
|
|
272
|
+
},
|
|
273
|
+
rollbackPlan: { type: 'string' },
|
|
274
|
+
estimatedEffort: {
|
|
275
|
+
type: 'object',
|
|
276
|
+
properties: {
|
|
277
|
+
hours: { type: 'number' },
|
|
278
|
+
complexity: { type: 'string', enum: ['low', 'medium', 'high'] },
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
expectedBenefits: {
|
|
282
|
+
type: 'array',
|
|
283
|
+
items: { type: 'string' },
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
required: ['summary', 'goal', 'refactoringSteps', 'riskAssessment'],
|
|
287
|
+
};
|
|
288
|
+
/**
|
|
289
|
+
* Security Report Schema
|
|
290
|
+
* 用于 security_scan 工具的结构化输出
|
|
291
|
+
*/
|
|
292
|
+
export const SecurityReportSchema = {
|
|
293
|
+
type: 'object',
|
|
294
|
+
properties: {
|
|
295
|
+
summary: { type: 'string' },
|
|
296
|
+
overallRisk: {
|
|
297
|
+
type: 'string',
|
|
298
|
+
enum: ['critical', 'high', 'medium', 'low', 'none'],
|
|
299
|
+
},
|
|
300
|
+
vulnerabilities: {
|
|
301
|
+
type: 'array',
|
|
302
|
+
items: {
|
|
303
|
+
type: 'object',
|
|
304
|
+
properties: {
|
|
305
|
+
id: { type: 'string' },
|
|
306
|
+
type: {
|
|
307
|
+
type: 'string',
|
|
308
|
+
enum: ['injection', 'xss', 'csrf', 'auth', 'crypto', 'data-exposure', 'dos', 'other'],
|
|
309
|
+
},
|
|
310
|
+
severity: {
|
|
311
|
+
type: 'string',
|
|
312
|
+
enum: ['critical', 'high', 'medium', 'low'],
|
|
313
|
+
},
|
|
314
|
+
title: { type: 'string' },
|
|
315
|
+
description: { type: 'string' },
|
|
316
|
+
location: {
|
|
317
|
+
type: 'object',
|
|
318
|
+
properties: {
|
|
319
|
+
file: { type: 'string' },
|
|
320
|
+
line: { type: 'number' },
|
|
321
|
+
code: { type: 'string' },
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
cwe: { type: 'string' },
|
|
325
|
+
cvss: { type: 'number' },
|
|
326
|
+
remediation: { type: 'string' },
|
|
327
|
+
references: { type: 'array', items: { type: 'string' } },
|
|
328
|
+
},
|
|
329
|
+
required: ['type', 'severity', 'title', 'description'],
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
complianceChecks: {
|
|
333
|
+
type: 'array',
|
|
334
|
+
items: {
|
|
335
|
+
type: 'object',
|
|
336
|
+
properties: {
|
|
337
|
+
standard: { type: 'string' },
|
|
338
|
+
passed: { type: 'boolean' },
|
|
339
|
+
details: { type: 'string' },
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
recommendations: {
|
|
344
|
+
type: 'array',
|
|
345
|
+
items: { type: 'string' },
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
required: ['summary', 'overallRisk', 'vulnerabilities'],
|
|
349
|
+
};
|
|
350
|
+
/**
|
|
351
|
+
* Performance Report Schema
|
|
352
|
+
* 用于 perf 工具的结构化输出
|
|
353
|
+
*/
|
|
354
|
+
export const PerformanceReportSchema = {
|
|
355
|
+
type: 'object',
|
|
356
|
+
properties: {
|
|
357
|
+
summary: { type: 'string' },
|
|
358
|
+
overallScore: {
|
|
359
|
+
type: 'number',
|
|
360
|
+
minimum: 0,
|
|
361
|
+
maximum: 100,
|
|
362
|
+
},
|
|
363
|
+
bottlenecks: {
|
|
364
|
+
type: 'array',
|
|
365
|
+
items: {
|
|
366
|
+
type: 'object',
|
|
367
|
+
properties: {
|
|
368
|
+
type: {
|
|
369
|
+
type: 'string',
|
|
370
|
+
enum: ['algorithm', 'memory', 'database', 'network', 'rendering', 'io'],
|
|
371
|
+
},
|
|
372
|
+
severity: {
|
|
373
|
+
type: 'string',
|
|
374
|
+
enum: ['critical', 'high', 'medium', 'low'],
|
|
375
|
+
},
|
|
376
|
+
location: {
|
|
377
|
+
type: 'object',
|
|
378
|
+
properties: {
|
|
379
|
+
file: { type: 'string' },
|
|
380
|
+
line: { type: 'number' },
|
|
381
|
+
function: { type: 'string' },
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
description: { type: 'string' },
|
|
385
|
+
impact: { type: 'string' },
|
|
386
|
+
currentMetric: { type: 'string' },
|
|
387
|
+
},
|
|
388
|
+
required: ['type', 'severity', 'description'],
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
metrics: {
|
|
392
|
+
type: 'object',
|
|
393
|
+
properties: {
|
|
394
|
+
executionTime: { type: 'number' },
|
|
395
|
+
memoryUsage: { type: 'number' },
|
|
396
|
+
cpuUsage: { type: 'number' },
|
|
397
|
+
throughput: { type: 'number' },
|
|
398
|
+
latency: { type: 'number' },
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
optimizations: {
|
|
402
|
+
type: 'array',
|
|
403
|
+
items: {
|
|
404
|
+
type: 'object',
|
|
405
|
+
properties: {
|
|
406
|
+
title: { type: 'string' },
|
|
407
|
+
description: { type: 'string' },
|
|
408
|
+
priority: { type: 'string', enum: ['high', 'medium', 'low'] },
|
|
409
|
+
expectedImprovement: { type: 'string' },
|
|
410
|
+
implementation: { type: 'string' },
|
|
411
|
+
},
|
|
412
|
+
required: ['title', 'description', 'priority'],
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
benchmarks: {
|
|
416
|
+
type: 'object',
|
|
417
|
+
additionalProperties: true,
|
|
418
|
+
},
|
|
419
|
+
},
|
|
420
|
+
required: ['summary', 'overallScore', 'bottlenecks', 'optimizations'],
|
|
421
|
+
};
|