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.
Files changed (162) hide show
  1. package/README.md +113 -1642
  2. package/build/index.js +75 -42
  3. package/build/lib/elicitation-helper.d.ts +73 -0
  4. package/build/lib/elicitation-helper.js +130 -0
  5. package/build/lib/response.d.ts +32 -0
  6. package/build/lib/response.js +28 -0
  7. package/build/lib/tasks-manager.d.ts +116 -0
  8. package/build/lib/tasks-manager.js +217 -0
  9. package/build/lib/toolset-manager.d.ts +48 -0
  10. package/build/lib/toolset-manager.js +112 -0
  11. package/build/schemas/basic-tools.d.ts +0 -32
  12. package/build/schemas/basic-tools.js +0 -34
  13. package/build/schemas/code-analysis-tools.d.ts +0 -36
  14. package/build/schemas/code-analysis-tools.js +0 -38
  15. package/build/schemas/code-gen-tools.d.ts +0 -44
  16. package/build/schemas/code-gen-tools.js +0 -46
  17. package/build/schemas/doc-util-tools.d.ts +0 -54
  18. package/build/schemas/doc-util-tools.js +0 -58
  19. package/build/schemas/index.d.ts +0 -188
  20. package/build/schemas/orchestration-tools.d.ts +0 -22
  21. package/build/schemas/orchestration-tools.js +0 -23
  22. package/build/schemas/output/core-tools.d.ts +817 -0
  23. package/build/schemas/output/core-tools.js +421 -0
  24. package/build/schemas/output/generation-tools.d.ts +936 -0
  25. package/build/schemas/output/generation-tools.js +446 -0
  26. package/build/schemas/output/helper-tools.d.ts +243 -0
  27. package/build/schemas/output/helper-tools.js +138 -0
  28. package/build/schemas/output/index.d.ts +76 -0
  29. package/build/schemas/output/index.js +96 -0
  30. package/build/schemas/output/project-tools.d.ts +702 -0
  31. package/build/schemas/output/project-tools.js +339 -0
  32. package/build/schemas/output/ui-ux-tools.d.ts +469 -0
  33. package/build/schemas/output/ui-ux-tools.js +218 -0
  34. package/build/schemas/output/workflow-tools.d.ts +267 -0
  35. package/build/schemas/output/workflow-tools.js +179 -0
  36. package/build/schemas/structured-output.d.ts +1317 -0
  37. package/build/schemas/structured-output.js +1017 -0
  38. package/build/tools/__tests__/start_ui.integration.test.js +5 -5
  39. package/build/tools/__tests__/start_ui.property.test.js +11 -11
  40. package/build/tools/add_feature.d.ts +1 -13
  41. package/build/tools/add_feature.js +48 -13
  42. package/build/tools/analyze_project.js +57 -18
  43. package/build/tools/check_deps.d.ts +1 -13
  44. package/build/tools/check_deps.js +24 -15
  45. package/build/tools/code_review.d.ts +1 -13
  46. package/build/tools/code_review.js +19 -16
  47. package/build/tools/debug.d.ts +1 -13
  48. package/build/tools/debug.js +18 -16
  49. package/build/tools/estimate.d.ts +1 -19
  50. package/build/tools/estimate.js +36 -6
  51. package/build/tools/fix_bug.d.ts +1 -13
  52. package/build/tools/fix_bug.js +24 -6
  53. package/build/tools/gen_mock.d.ts +1 -19
  54. package/build/tools/gen_mock.js +42 -227
  55. package/build/tools/genapi.d.ts +1 -13
  56. package/build/tools/genapi.js +18 -15
  57. package/build/tools/genchangelog.d.ts +1 -13
  58. package/build/tools/genchangelog.js +36 -212
  59. package/build/tools/gencommit.d.ts +1 -7
  60. package/build/tools/gencommit.js +21 -13
  61. package/build/tools/gendoc.d.ts +1 -13
  62. package/build/tools/gendoc.js +18 -15
  63. package/build/tools/genpr.d.ts +1 -13
  64. package/build/tools/genpr.js +28 -157
  65. package/build/tools/genreadme.d.ts +1 -13
  66. package/build/tools/genreadme.js +22 -587
  67. package/build/tools/gensql.d.ts +1 -13
  68. package/build/tools/gensql.js +24 -283
  69. package/build/tools/gentest.d.ts +1 -13
  70. package/build/tools/gentest.js +49 -16
  71. package/build/tools/index.d.ts +0 -10
  72. package/build/tools/index.js +0 -10
  73. package/build/tools/init_component_catalog.d.ts +3 -20
  74. package/build/tools/init_component_catalog.js +141 -786
  75. package/build/tools/init_project.d.ts +7 -13
  76. package/build/tools/init_project.js +54 -16
  77. package/build/tools/init_project_context.d.ts +1 -13
  78. package/build/tools/init_project_context.js +41 -14
  79. package/build/tools/perf.d.ts +1 -13
  80. package/build/tools/perf.js +18 -15
  81. package/build/tools/refactor.d.ts +1 -13
  82. package/build/tools/refactor.js +54 -15
  83. package/build/tools/render_ui.d.ts +2 -19
  84. package/build/tools/render_ui.js +201 -347
  85. package/build/tools/resolve_conflict.d.ts +1 -13
  86. package/build/tools/resolve_conflict.js +18 -15
  87. package/build/tools/security_scan.d.ts +1 -13
  88. package/build/tools/security_scan.js +16 -5
  89. package/build/tools/start_api.d.ts +7 -13
  90. package/build/tools/start_api.js +69 -157
  91. package/build/tools/start_bugfix.d.ts +1 -7
  92. package/build/tools/start_bugfix.js +38 -2
  93. package/build/tools/start_doc.d.ts +7 -13
  94. package/build/tools/start_doc.js +76 -169
  95. package/build/tools/start_feature.d.ts +1 -7
  96. package/build/tools/start_feature.js +54 -2
  97. package/build/tools/start_onboard.d.ts +1 -7
  98. package/build/tools/start_onboard.js +40 -2
  99. package/build/tools/start_ralph.d.ts +1 -7
  100. package/build/tools/start_ralph.js +88 -2
  101. package/build/tools/start_refactor.d.ts +7 -13
  102. package/build/tools/start_refactor.js +75 -148
  103. package/build/tools/start_release.d.ts +7 -13
  104. package/build/tools/start_release.js +56 -131
  105. package/build/tools/start_review.d.ts +7 -13
  106. package/build/tools/start_review.js +70 -142
  107. package/build/tools/start_ui.d.ts +1 -7
  108. package/build/tools/start_ui.js +98 -8
  109. package/build/tools/ui-ux-tools.d.ts +3 -39
  110. package/build/tools/ui-ux-tools.js +201 -125
  111. package/docs/data/tools.js +864 -0
  112. package/docs/index.html +594 -0
  113. package/docs/pages/all-tools.html +649 -0
  114. package/docs/pages/examples.html +564 -0
  115. package/docs/pages/getting-started.html +529 -0
  116. package/docs/pages/migration.html +308 -0
  117. package/docs/specs/algorithm-enhancement/roadmap.md +619 -0
  118. package/docs/specs/vnext-upgrade/00-OVERVIEW.md +258 -0
  119. package/docs/specs/vnext-upgrade/BETA_RELEASE_GUIDE.md +328 -0
  120. package/docs/specs/vnext-upgrade/GITHUB_DISCUSSION_TEMPLATE.md +236 -0
  121. package/docs/specs/vnext-upgrade/M8.9-PROGRESS-UPDATE.md +248 -0
  122. package/docs/specs/vnext-upgrade/PROGRESS-SUMMARY.md +195 -0
  123. package/docs/specs/vnext-upgrade/QUICK_REFERENCE.md +338 -0
  124. package/docs/specs/vnext-upgrade/README.md +125 -0
  125. package/docs/specs/vnext-upgrade/STATUS-UPDATE-2026-01-26.md +230 -0
  126. package/docs/specs/vnext-upgrade/TOOL_CLEANUP.md +343 -0
  127. package/docs/specs/vnext-upgrade/completed/M1-M2-SUMMARY.md +27 -0
  128. package/docs/specs/vnext-upgrade/completed/M3_COMPLETION_SUMMARY.md +273 -0
  129. package/docs/specs/vnext-upgrade/completed/M4-SUMMARY.md +19 -0
  130. package/docs/specs/vnext-upgrade/completed/M5_COMPLETION_SUMMARY.md +0 -0
  131. package/docs/specs/vnext-upgrade/completed/M8.1-SUMMARY.md +247 -0
  132. package/docs/specs/vnext-upgrade/completed/M8.2-SUMMARY.md +296 -0
  133. package/docs/specs/vnext-upgrade/completed/M8.3-SUMMARY.md +241 -0
  134. package/docs/specs/vnext-upgrade/completed/M8.3-TEST-SUMMARY.md +216 -0
  135. package/docs/specs/vnext-upgrade/completed/M8.4-SUMMARY.md +217 -0
  136. package/docs/specs/vnext-upgrade/completed/M8.4-TEST-SUMMARY.md +198 -0
  137. package/docs/specs/vnext-upgrade/completed/M8.5-SUMMARY.md +202 -0
  138. package/docs/specs/vnext-upgrade/completed/M8.5-TEST-SUMMARY.md +223 -0
  139. package/docs/specs/vnext-upgrade/completed/M8.6-SUMMARY.md +299 -0
  140. package/docs/specs/vnext-upgrade/completed/M8.8-TEST-SUMMARY.md +216 -0
  141. package/docs/specs/vnext-upgrade/completed/TOOL-CLEANUP-SUMMARY.md +210 -0
  142. package/docs/specs/vnext-upgrade/design.md +848 -0
  143. package/docs/specs/vnext-upgrade/requirements.md +221 -0
  144. package/docs/specs/vnext-upgrade/tasks/00-INDEX.md +335 -0
  145. package/docs/specs/vnext-upgrade/tasks/M8.1-SCHEMA-DEFINITION.md +300 -0
  146. package/docs/specs/vnext-upgrade/tasks/M8.2-P1-TOOLS.md +249 -0
  147. package/docs/specs/vnext-upgrade/tasks/M8.3-GENERATION-TOOLS.md +49 -0
  148. package/docs/specs/vnext-upgrade/tasks/M8.4-ORCHESTRATION-TOOLS.md +28 -0
  149. package/docs/specs/vnext-upgrade/tasks/M8.5-PROJECT-TOOLS.md +29 -0
  150. package/docs/specs/vnext-upgrade/tasks/M8.6-UI-TOOLS.md +66 -0
  151. package/docs/specs/vnext-upgrade/tasks/M8.7-HELPER-TOOLS.md +24 -0
  152. package/docs/specs/vnext-upgrade/tasks/M8.8-INTEGRATION-TESTS.md +90 -0
  153. package/docs/specs/vnext-upgrade/tasks/M8.9-DOCUMENTATION.md +103 -0
  154. package/docs/styles/docs.css +556 -0
  155. package/docs/styles/page.css +815 -0
  156. package/docs/vnext/MCP_2025-11-25_GUIDE.md +276 -0
  157. package/docs/vnext/vNext-PRD.md +488 -0
  158. package/package.json +6 -6
  159. package/docs/BEST_PRACTICES.md +0 -1185
  160. package/docs/HOW_TO_TRIGGER.md +0 -1141
  161. package/docs/MCP-Probe-Kit-/344/275/277/347/224/250/346/211/213/345/206/214.html +0 -544
  162. package/docs/MCP-Probe-Kit-/344/275/277/347/224/250/346/211/213/345/206/214.md +0 -1447
@@ -1,4 +1,5 @@
1
1
  import { parseArgs, getString } from "../utils/parseArgs.js";
2
+ import { okStructured } from "../lib/response.js";
2
3
  // gensql 工具实现
3
4
  export async function gensql(args) {
4
5
  try {
@@ -27,294 +28,34 @@ ${description || "请描述需要查询/操作的数据"}
27
28
 
28
29
  ## SQL 生成指南
29
30
 
30
- ### 第一步:理解需求
31
-
32
- **需求类型**:
33
- - 查询(SELECT)
34
- - 插入(INSERT)
35
- - 更新(UPDATE)
36
- - 删除(DELETE)
37
- - 建表(CREATE TABLE)
38
- - 修改表结构(ALTER TABLE)
39
- - 创建索引(CREATE INDEX)
40
-
41
- ### 第二步:生成 SQL
42
-
43
- **查询示例:**
44
-
45
- **1️⃣ 简单查询**
46
- \`\`\`sql
47
- -- 查询所有用户
48
- SELECT * FROM users;
49
-
50
- -- 按条件查询
51
- SELECT id, name, email
52
- FROM users
53
- WHERE status = 'active'
54
- AND created_at > '2024-01-01';
55
- \`\`\`
56
-
57
- **2️⃣ 复杂查询**
58
- \`\`\`sql
59
- -- JOIN 查询
60
- SELECT
61
- u.id,
62
- u.name,
63
- u.email,
64
- COUNT(o.id) as order_count,
65
- SUM(o.total) as total_spent
66
- FROM users u
67
- LEFT JOIN orders o ON u.id = o.user_id
68
- WHERE u.status = 'active'
69
- GROUP BY u.id, u.name, u.email
70
- HAVING COUNT(o.id) > 0
71
- ORDER BY total_spent DESC
72
- LIMIT 10;
73
- \`\`\`
74
-
75
- **3️⃣ 子查询**
76
- \`\`\`sql
77
- -- 查找购买金额超过平均值的用户
78
- SELECT
79
- u.name,
80
- SUM(o.total) as total_spent
81
- FROM users u
82
- JOIN orders o ON u.id = o.user_id
83
- GROUP BY u.id, u.name
84
- HAVING SUM(o.total) > (
85
- SELECT AVG(total_per_user)
86
- FROM (
87
- SELECT SUM(total) as total_per_user
88
- FROM orders
89
- GROUP BY user_id
90
- ) avg_calc
91
- );
92
- \`\`\`
93
-
94
- **4️⃣ 窗口函数**
95
- \`\`\`sql
96
- -- 每个用户的订单排名
97
- SELECT
98
- user_id,
99
- order_id,
100
- total,
101
- ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY total DESC) as rank,
102
- SUM(total) OVER (PARTITION BY user_id) as user_total
103
- FROM orders;
104
- \`\`\`
105
-
106
- ---
107
-
108
- ### 建表示例
109
-
110
- **完整的表定义:**
111
- \`\`\`sql
112
- CREATE TABLE users (
113
- id BIGSERIAL PRIMARY KEY,
114
- email VARCHAR(255) UNIQUE NOT NULL,
115
- name VARCHAR(100) NOT NULL,
116
- password_hash VARCHAR(255) NOT NULL,
117
- status VARCHAR(20) DEFAULT 'active',
118
- created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
119
- updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
120
-
121
- -- 约束
122
- CONSTRAINT valid_email CHECK (email ~* '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$'),
123
- CONSTRAINT valid_status CHECK (status IN ('active', 'inactive', 'suspended'))
124
- );
125
-
126
- -- 索引
127
- CREATE INDEX idx_users_email ON users(email);
128
- CREATE INDEX idx_users_status ON users(status);
129
- CREATE INDEX idx_users_created_at ON users(created_at);
130
-
131
- -- 注释
132
- COMMENT ON TABLE users IS '用户表';
133
- COMMENT ON COLUMN users.email IS '用户邮箱(唯一)';
134
- \`\`\`
135
-
136
- ---
137
-
138
- ### 索引优化
139
-
140
- **索引建议:**
141
- \`\`\`sql
142
- -- 单列索引
143
- CREATE INDEX idx_users_email ON users(email);
144
-
145
- -- 复合索引(顺序很重要!)
146
- CREATE INDEX idx_orders_user_status ON orders(user_id, status, created_at);
147
-
148
- -- 唯一索引
149
- CREATE UNIQUE INDEX idx_users_email_unique ON users(email);
150
-
151
- -- 部分索引(条件索引)
152
- CREATE INDEX idx_active_users ON users(email) WHERE status = 'active';
153
-
154
- -- 全文索引(PostgreSQL)
155
- CREATE INDEX idx_posts_title_fulltext ON posts USING GIN (to_tsvector('english', title));
156
- \`\`\`
157
-
158
- ---
159
-
160
- ## 查询优化技巧
161
-
162
- ### 1️⃣ 使用 EXPLAIN ANALYZE
163
- \`\`\`sql
164
- EXPLAIN ANALYZE
165
- SELECT * FROM orders WHERE user_id = 123;
166
- \`\`\`
167
-
168
- ### 2️⃣ 避免 SELECT *
169
- \`\`\`sql
170
- -- ❌ Bad
171
- SELECT * FROM users;
172
-
173
- -- ✅ Good
174
- SELECT id, name, email FROM users;
175
- \`\`\`
176
-
177
- ### 3️⃣ 使用 EXISTS 替代 IN(大数据量)
178
- \`\`\`sql
179
- -- ❌ Slow
180
- SELECT * FROM users
181
- WHERE id IN (SELECT user_id FROM orders);
182
-
183
- -- ✅ Faster
184
- SELECT * FROM users u
185
- WHERE EXISTS (
186
- SELECT 1 FROM orders o WHERE o.user_id = u.id
187
- );
188
- \`\`\`
189
-
190
- ### 4️⃣ 避免在 WHERE 中使用函数
191
- \`\`\`sql
192
- -- ❌ Bad (无法使用索引)
193
- SELECT * FROM users WHERE LOWER(email) = 'test@example.com';
194
-
195
- -- ✅ Good
196
- SELECT * FROM users WHERE email = 'test@example.com';
197
- \`\`\`
198
-
199
- ### 5️⃣ 分页优化
200
- \`\`\`sql
201
- -- ❌ Slow (大 OFFSET)
202
- SELECT * FROM posts ORDER BY created_at DESC LIMIT 10 OFFSET 10000;
203
-
204
- -- ✅ Faster (游标分页)
205
- SELECT * FROM posts
206
- WHERE created_at < '2024-01-01 00:00:00'
207
- ORDER BY created_at DESC
208
- LIMIT 10;
209
- \`\`\`
210
-
211
- ---
212
-
213
- ## 常用查询模板
214
-
215
- ### 去重查询
216
- \`\`\`sql
217
- SELECT DISTINCT email FROM users;
218
-
219
- -- 或使用 GROUP BY
220
- SELECT email FROM users GROUP BY email;
221
- \`\`\`
222
-
223
- ### 统计分析
224
- \`\`\`sql
225
- SELECT
226
- DATE_TRUNC('day', created_at) as date,
227
- COUNT(*) as count,
228
- COUNT(DISTINCT user_id) as unique_users,
229
- SUM(total) as revenue,
230
- AVG(total) as avg_order_value
231
- FROM orders
232
- WHERE created_at >= CURRENT_DATE - INTERVAL '30 days'
233
- GROUP BY DATE_TRUNC('day', created_at)
234
- ORDER BY date DESC;
235
- \`\`\`
236
-
237
- ### 排名查询
238
- \`\`\`sql
239
- -- Top N per group
240
- SELECT * FROM (
241
- SELECT
242
- *,
243
- ROW_NUMBER() OVER (PARTITION BY category_id ORDER BY sales DESC) as rank
244
- FROM products
245
- ) ranked
246
- WHERE rank <= 10;
247
- \`\`\`
248
-
249
- ### 递归查询(树形结构)
250
- \`\`\`sql
251
- WITH RECURSIVE category_tree AS (
252
- -- 根节点
253
- SELECT id, name, parent_id, 1 as level
254
- FROM categories
255
- WHERE parent_id IS NULL
256
-
257
- UNION ALL
258
-
259
- -- 递归部分
260
- SELECT c.id, c.name, c.parent_id, ct.level + 1
261
- FROM categories c
262
- JOIN category_tree ct ON c.parent_id = ct.id
263
- )
264
- SELECT * FROM category_tree ORDER BY level, name;
265
- \`\`\`
266
-
267
- ---
268
-
269
- ## 数据库特定语法
270
-
271
- ### PostgreSQL
272
- \`\`\`sql
273
- -- JSON 查询
274
- SELECT data->>'name' as name FROM users WHERE data @> '{"active": true}';
275
-
276
- -- 数组操作
277
- SELECT * FROM posts WHERE tags && ARRAY['sql', 'database'];
278
-
279
- -- 全文搜索
280
- SELECT * FROM articles WHERE to_tsvector(content) @@ to_tsquery('postgresql');
281
- \`\`\`
282
-
283
- ### MySQL
284
- \`\`\`sql
285
- -- JSON 查询
286
- SELECT JSON_EXTRACT(data, '$.name') as name FROM users;
287
-
288
- -- 全文搜索
289
- SELECT * FROM articles WHERE MATCH(title, content) AGAINST('database' IN NATURAL LANGUAGE MODE);
290
- \`\`\`
291
-
292
- ---
293
-
294
- 现在请根据需求生成优化的 SQL 语句,并提供:
31
+ 请生成优化的 SQL 语句,并提供:
295
32
  1. 完整的 SQL 代码
296
- 2. 执行计划分析(如需要)
297
- 3. 索引建议
298
- 4. 性能优化建议`;
299
- return {
300
- content: [
301
- {
302
- type: "text",
303
- text: message,
304
- },
305
- ],
33
+ 2. 查询说明
34
+ 3. 索引建议(如适用)
35
+ 4. 性能优化建议(如适用)
36
+
37
+ **重要**: 请使用结构化输出格式返回结果。`;
38
+ // 创建结构化数据对象
39
+ const structuredData = {
40
+ summary: `生成 ${dialect} SQL 查询`,
41
+ dialect: dialect,
42
+ query: "", // AI 将填充实际的 SQL
43
+ explanation: description,
306
44
  };
45
+ return okStructured(message, structuredData, {
46
+ schema: (await import("../schemas/output/generation-tools.js")).SQLQuerySchema,
47
+ });
307
48
  }
308
49
  catch (error) {
309
50
  const errorMessage = error instanceof Error ? error.message : String(error);
310
- return {
311
- content: [
312
- {
313
- type: "text",
314
- text: `❌ 生成 SQL 失败: ${errorMessage}`,
315
- },
316
- ],
317
- isError: true,
51
+ const errorData = {
52
+ summary: "SQL 生成失败",
53
+ dialect: "postgres",
54
+ query: "",
55
+ explanation: errorMessage,
318
56
  };
57
+ return okStructured(`❌ 生成 SQL 失败: ${errorMessage}`, errorData, {
58
+ schema: (await import("../schemas/output/generation-tools.js")).SQLQuerySchema,
59
+ });
319
60
  }
320
61
  }
@@ -1,13 +1 @@
1
- export declare function gentest(args: any): Promise<{
2
- content: {
3
- type: string;
4
- text: string;
5
- }[];
6
- isError?: undefined;
7
- } | {
8
- content: {
9
- type: string;
10
- text: string;
11
- }[];
12
- isError: boolean;
13
- }>;
1
+ export declare function gentest(args: any): Promise<import("../lib/response.js").ToolResponse>;
@@ -1,4 +1,5 @@
1
1
  import { parseArgs, getString } from "../utils/parseArgs.js";
2
+ import { okStructured } from "../lib/response.js";
2
3
  // gentest 工具实现
3
4
  export async function gentest(args) {
4
5
  try {
@@ -152,26 +153,58 @@ const createUser = (overrides = {}) => ({
152
153
  2. 所有必要的测试用例
153
154
  3. Mock/Stub 设置
154
155
  4. 测试数据准备
155
- 5. 清晰的注释说明`;
156
- return {
157
- content: [
158
- {
159
- type: "text",
160
- text: message,
161
- },
162
- ],
156
+ 5. 清晰的注释说明
157
+
158
+ ---
159
+
160
+ ## 📤 输出格式要求
161
+
162
+ 请严格按以下 JSON 格式输出测试套件:
163
+
164
+ \`\`\`json
165
+ {
166
+ "summary": "测试套件摘要",
167
+ "framework": "jest|vitest|mocha",
168
+ "testCases": [
169
+ {
170
+ "name": "测试用例名称",
171
+ "description": "测试用例描述",
172
+ "type": "unit|integration|e2e",
173
+ "code": "完整的测试代码",
174
+ "assertions": ["断言1", "断言2"]
175
+ }
176
+ ],
177
+ "edgeCases": [
178
+ {
179
+ "scenario": "边界场景描述",
180
+ "input": "输入数据",
181
+ "expectedOutput": "预期输出"
182
+ }
183
+ ],
184
+ "mockData": {
185
+ "mockName": "mock数据"
186
+ }
187
+ }
188
+ \`\`\``;
189
+ // 创建结构化数据对象
190
+ const testSuite = {
191
+ summary: `为提供的代码生成 ${framework} 测试用例`,
192
+ framework: framework,
193
+ testCases: [],
163
194
  };
195
+ return okStructured(message, testSuite, {
196
+ schema: (await import('../schemas/output/core-tools.js')).TestSuiteSchema,
197
+ });
164
198
  }
165
199
  catch (error) {
166
200
  const errorMessage = error instanceof Error ? error.message : String(error);
167
- return {
168
- content: [
169
- {
170
- type: "text",
171
- text: `❌ 生成测试用例失败: ${errorMessage}`,
172
- },
173
- ],
174
- isError: true,
201
+ const errorData = {
202
+ summary: `生成测试用例失败: ${errorMessage}`,
203
+ framework: 'jest',
204
+ testCases: [],
175
205
  };
206
+ return okStructured(`❌ 生成测试用例失败: ${errorMessage}`, errorData, {
207
+ schema: (await import('../schemas/output/core-tools.js')).TestSuiteSchema,
208
+ });
176
209
  }
177
210
  }
@@ -1,5 +1,3 @@
1
- export { detectShell } from "./detect_shell.js";
2
- export { initSetting } from "./init_setting.js";
3
1
  export { initProject } from "./init_project.js";
4
2
  export { gencommit } from "./gencommit.js";
5
3
  export { debug } from "./debug.js";
@@ -12,15 +10,9 @@ export { gendoc } from "./gendoc.js";
12
10
  export { genchangelog } from "./genchangelog.js";
13
11
  export { refactor } from "./refactor.js";
14
12
  export { perf } from "./perf.js";
15
- export { fix } from "./fix.js";
16
13
  export { gensql } from "./gensql.js";
17
14
  export { resolveConflict } from "./resolve_conflict.js";
18
- export { genui } from "./genui.js";
19
- export { explain } from "./explain.js";
20
- export { convert } from "./convert.js";
21
- export { cssOrder } from "./css_order.js";
22
15
  export { genreadme } from "./genreadme.js";
23
- export { split } from "./split.js";
24
16
  export { analyzeProject } from "./analyze_project.js";
25
17
  export { initProjectContext } from "./init_project_context.js";
26
18
  export { addFeature } from "./add_feature.js";
@@ -28,7 +20,6 @@ export { securityScan } from "./security_scan.js";
28
20
  export { fixBug } from "./fix_bug.js";
29
21
  export { estimate } from "./estimate.js";
30
22
  export { genMock } from "./gen_mock.js";
31
- export { design2code } from "./design2code.js";
32
23
  export { startFeature } from "./start_feature.js";
33
24
  export { startBugfix } from "./start_bugfix.js";
34
25
  export { startReview } from "./start_review.js";
@@ -37,7 +28,6 @@ export { startRefactor } from "./start_refactor.js";
37
28
  export { startOnboard } from "./start_onboard.js";
38
29
  export { startApi } from "./start_api.js";
39
30
  export { startDoc } from "./start_doc.js";
40
- export { genSkill } from "./gen_skill.js";
41
31
  export { startRalph } from "./start_ralph.js";
42
32
  export { interview } from "./interview.js";
43
33
  export { askUser } from "./ask_user.js";
@@ -1,5 +1,3 @@
1
- export { detectShell } from "./detect_shell.js";
2
- export { initSetting } from "./init_setting.js";
3
1
  export { initProject } from "./init_project.js";
4
2
  export { gencommit } from "./gencommit.js";
5
3
  export { debug } from "./debug.js";
@@ -12,15 +10,9 @@ export { gendoc } from "./gendoc.js";
12
10
  export { genchangelog } from "./genchangelog.js";
13
11
  export { refactor } from "./refactor.js";
14
12
  export { perf } from "./perf.js";
15
- export { fix } from "./fix.js";
16
13
  export { gensql } from "./gensql.js";
17
14
  export { resolveConflict } from "./resolve_conflict.js";
18
- export { genui } from "./genui.js";
19
- export { explain } from "./explain.js";
20
- export { convert } from "./convert.js";
21
- export { cssOrder } from "./css_order.js";
22
15
  export { genreadme } from "./genreadme.js";
23
- export { split } from "./split.js";
24
16
  export { analyzeProject } from "./analyze_project.js";
25
17
  export { initProjectContext } from "./init_project_context.js";
26
18
  export { addFeature } from "./add_feature.js";
@@ -28,7 +20,6 @@ export { securityScan } from "./security_scan.js";
28
20
  export { fixBug } from "./fix_bug.js";
29
21
  export { estimate } from "./estimate.js";
30
22
  export { genMock } from "./gen_mock.js";
31
- export { design2code } from "./design2code.js";
32
23
  // 智能编排工具
33
24
  export { startFeature } from "./start_feature.js";
34
25
  export { startBugfix } from "./start_bugfix.js";
@@ -38,7 +29,6 @@ export { startRefactor } from "./start_refactor.js";
38
29
  export { startOnboard } from "./start_onboard.js";
39
30
  export { startApi } from "./start_api.js";
40
31
  export { startDoc } from "./start_doc.js";
41
- export { genSkill } from "./gen_skill.js";
42
32
  export { startRalph } from "./start_ralph.js";
43
33
  // 访谈工具
44
34
  export { interview } from "./interview.js";
@@ -1,22 +1,5 @@
1
1
  /**
2
- * 初始化组件目录工具
3
- *
4
- * 基于设计系统规范生成组件目录
5
- * 组件定义包含占位符,渲染时自动替换为实际值
2
+ * 初始化组件目录工具(内部工具)
3
+ * 基于设计系统规范生成组件目录文件
6
4
  */
7
- /**
8
- * 初始化组件目录工具
9
- */
10
- export declare function initComponentCatalog(args: any): Promise<{
11
- content: {
12
- type: string;
13
- text: string;
14
- }[];
15
- isError: boolean;
16
- } | {
17
- content: {
18
- type: string;
19
- text: string;
20
- }[];
21
- isError?: undefined;
22
- }>;
5
+ export declare function initComponentCatalog(_args: any): Promise<import("../lib/response.js").ToolResponse>;