mcp-probe-kit 3.0.8 → 3.0.10
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 +15 -4
- package/build/lib/__tests__/gitnexus-bridge.unit.test.d.ts +1 -0
- package/build/lib/__tests__/gitnexus-bridge.unit.test.js +86 -0
- package/build/lib/gitnexus-bridge.d.ts +23 -0
- package/build/lib/gitnexus-bridge.js +518 -22
- package/build/schemas/code-analysis-tools.d.ts +9 -1
- package/build/schemas/code-analysis-tools.js +9 -1
- package/build/schemas/git-tools.d.ts +1 -1
- package/build/schemas/git-tools.js +1 -1
- package/build/schemas/index.d.ts +23 -3
- package/build/schemas/orchestration-tools.d.ts +13 -1
- package/build/schemas/orchestration-tools.js +13 -1
- package/build/schemas/output/core-tools.d.ts +130 -1
- package/build/schemas/output/core-tools.js +71 -1
- package/build/schemas/output/index.d.ts +2 -2
- package/build/schemas/output/index.js +2 -2
- package/build/schemas/output/project-tools.d.ts +13 -0
- package/build/schemas/output/project-tools.js +9 -0
- package/build/schemas/structured-output.d.ts +358 -5
- package/build/schemas/structured-output.js +169 -5
- package/build/tools/__tests__/code_insight.unit.test.js +81 -1
- package/build/tools/__tests__/fix_bug.unit.test.d.ts +1 -0
- package/build/tools/__tests__/fix_bug.unit.test.js +31 -0
- package/build/tools/__tests__/gencommit.unit.test.d.ts +1 -0
- package/build/tools/__tests__/gencommit.unit.test.js +41 -0
- package/build/tools/__tests__/init_project_context.unit.test.d.ts +1 -0
- package/build/tools/__tests__/init_project_context.unit.test.js +63 -0
- package/build/tools/__tests__/start_bugfix.unit.test.js +10 -0
- package/build/tools/__tests__/start_feature.unit.test.js +10 -0
- package/build/tools/code_insight.d.ts +10 -0
- package/build/tools/code_insight.js +156 -3
- package/build/tools/fix_bug.d.ts +3 -3
- package/build/tools/fix_bug.js +297 -312
- package/build/tools/gencommit.js +144 -123
- package/build/tools/init_project_context.js +211 -53
- package/build/tools/start_bugfix.js +170 -70
- package/build/tools/start_feature.js +79 -25
- package/docs/data/tools.js +33 -31
- package/docs/i18n/all-tools/en.json +9 -9
- package/docs/i18n/all-tools/ja.json +9 -9
- package/docs/i18n/all-tools/ko.json +9 -9
- package/docs/i18n/all-tools/zh-CN.json +9 -9
- package/docs/i18n/en.json +535 -518
- package/docs/i18n/ja.json +533 -516
- package/docs/i18n/ko.json +535 -518
- package/docs/i18n/zh-CN.json +535 -518
- package/docs/index.html +5 -4
- package/docs/pages/all-tools.html +3 -2
- package/docs/pages/examples.html +58 -31
- package/docs/pages/getting-started.html +3 -3
- package/docs/pages/migration.html +19 -10
- package/package.json +1 -1
|
@@ -15,15 +15,20 @@
|
|
|
15
15
|
*/
|
|
16
16
|
/**
|
|
17
17
|
* Commit Message Schema
|
|
18
|
-
*
|
|
18
|
+
* 用于提交草稿(保留给其他场景复用)
|
|
19
19
|
*/
|
|
20
20
|
export declare const CommitMessageSchema: {
|
|
21
21
|
readonly type: "object";
|
|
22
22
|
readonly properties: {
|
|
23
|
+
readonly status: {
|
|
24
|
+
readonly type: "string";
|
|
25
|
+
readonly description: "生成状态:ready 表示已生成提交草稿;needs_changes 表示需要补充变更内容";
|
|
26
|
+
readonly enum: readonly ["ready", "needs_changes"];
|
|
27
|
+
};
|
|
23
28
|
readonly type: {
|
|
24
29
|
readonly type: "string";
|
|
25
30
|
readonly description: "Commit 类型:feat/fix/docs/refactor/test/chore/style/perf";
|
|
26
|
-
readonly enum: readonly ["feat", "fix", "docs", "refactor", "test", "chore", "style", "perf", "ci", "build", "revert"];
|
|
31
|
+
readonly enum: readonly ["feat", "fix", "fixed", "docs", "refactor", "test", "chore", "style", "perf", "ci", "build", "revert"];
|
|
27
32
|
};
|
|
28
33
|
readonly scope: {
|
|
29
34
|
readonly type: "string";
|
|
@@ -49,8 +54,101 @@ export declare const CommitMessageSchema: {
|
|
|
49
54
|
readonly type: "string";
|
|
50
55
|
readonly description: "Emoji 前缀(如果使用 conventional+emoji 风格)";
|
|
51
56
|
};
|
|
57
|
+
readonly guidance: {
|
|
58
|
+
readonly type: "string";
|
|
59
|
+
readonly description: "当 status=needs_changes 时,提示需要补充的信息";
|
|
60
|
+
};
|
|
61
|
+
readonly nextAction: {
|
|
62
|
+
readonly type: "string";
|
|
63
|
+
readonly description: "下一步建议动作";
|
|
64
|
+
};
|
|
52
65
|
};
|
|
53
|
-
readonly required: readonly ["
|
|
66
|
+
readonly required: readonly ["status"];
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Commit Guidance Schema
|
|
70
|
+
* 用于 gencommit 工具的结构化输出
|
|
71
|
+
*/
|
|
72
|
+
export declare const CommitGuidanceSchema: {
|
|
73
|
+
readonly type: "object";
|
|
74
|
+
readonly properties: {
|
|
75
|
+
readonly mode: {
|
|
76
|
+
readonly type: "string";
|
|
77
|
+
readonly enum: readonly ["guidance"];
|
|
78
|
+
readonly description: "gencommit 当前只返回指导文档,不直接生成最终提交消息";
|
|
79
|
+
};
|
|
80
|
+
readonly status: {
|
|
81
|
+
readonly type: "string";
|
|
82
|
+
readonly enum: readonly ["ready", "needs_changes"];
|
|
83
|
+
readonly description: "ready 表示可直接按规则生成;needs_changes 表示还缺变更信息";
|
|
84
|
+
};
|
|
85
|
+
readonly hasChanges: {
|
|
86
|
+
readonly type: "boolean";
|
|
87
|
+
readonly description: "是否已拿到变更内容";
|
|
88
|
+
};
|
|
89
|
+
readonly inputSummary: {
|
|
90
|
+
readonly type: "string";
|
|
91
|
+
readonly description: "对输入变更的简要摘要";
|
|
92
|
+
};
|
|
93
|
+
readonly steps: {
|
|
94
|
+
readonly type: "array";
|
|
95
|
+
readonly description: "AI 接下来要执行的步骤";
|
|
96
|
+
readonly items: {
|
|
97
|
+
readonly type: "string";
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
readonly rules: {
|
|
101
|
+
readonly type: "array";
|
|
102
|
+
readonly description: "生成 commit message 时必须遵守的规则";
|
|
103
|
+
readonly items: {
|
|
104
|
+
readonly type: "string";
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
readonly allowedTypes: {
|
|
108
|
+
readonly type: "array";
|
|
109
|
+
readonly description: "允许使用的 type 及对应 emoji";
|
|
110
|
+
readonly items: {
|
|
111
|
+
readonly type: "object";
|
|
112
|
+
readonly properties: {
|
|
113
|
+
readonly type: {
|
|
114
|
+
readonly type: "string";
|
|
115
|
+
};
|
|
116
|
+
readonly emoji: {
|
|
117
|
+
readonly type: "string";
|
|
118
|
+
};
|
|
119
|
+
readonly when: {
|
|
120
|
+
readonly type: "string";
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
readonly required: readonly ["type", "emoji", "when"];
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
readonly outputTemplate: {
|
|
127
|
+
readonly type: "string";
|
|
128
|
+
readonly description: "最终 commit message 的模板";
|
|
129
|
+
};
|
|
130
|
+
readonly examples: {
|
|
131
|
+
readonly type: "array";
|
|
132
|
+
readonly description: "参考示例";
|
|
133
|
+
readonly items: {
|
|
134
|
+
readonly type: "object";
|
|
135
|
+
readonly properties: {
|
|
136
|
+
readonly type: {
|
|
137
|
+
readonly type: "string";
|
|
138
|
+
};
|
|
139
|
+
readonly fullMessage: {
|
|
140
|
+
readonly type: "string";
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
readonly required: readonly ["type", "fullMessage"];
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
readonly nextAction: {
|
|
147
|
+
readonly type: "string";
|
|
148
|
+
readonly description: "AI 下一步该做什么";
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
readonly required: readonly ["mode", "status", "hasChanges", "steps", "rules", "allowedTypes", "outputTemplate", "examples", "nextAction"];
|
|
54
152
|
};
|
|
55
153
|
/**
|
|
56
154
|
* Workflow Report Schema
|
|
@@ -217,6 +315,11 @@ export declare const BugFixReportSchema: {
|
|
|
217
315
|
readonly $ref: "#/definitions/WorkflowReport";
|
|
218
316
|
}];
|
|
219
317
|
readonly properties: {
|
|
318
|
+
readonly analysisMode: {
|
|
319
|
+
readonly type: "string";
|
|
320
|
+
readonly enum: readonly ["tbp8"];
|
|
321
|
+
readonly description: "分析方法";
|
|
322
|
+
};
|
|
220
323
|
readonly rootCause: {
|
|
221
324
|
readonly type: "string";
|
|
222
325
|
readonly description: "根本原因分析";
|
|
@@ -240,8 +343,109 @@ export declare const BugFixReportSchema: {
|
|
|
240
343
|
readonly type: "string";
|
|
241
344
|
};
|
|
242
345
|
};
|
|
346
|
+
readonly tbp: {
|
|
347
|
+
readonly description: "TBP 8 步法分析骨架";
|
|
348
|
+
readonly type: "object";
|
|
349
|
+
readonly properties: {
|
|
350
|
+
readonly phenomenon: {
|
|
351
|
+
readonly type: "string";
|
|
352
|
+
readonly description: "TBP-1 现象";
|
|
353
|
+
};
|
|
354
|
+
readonly timeline: {
|
|
355
|
+
readonly type: "array";
|
|
356
|
+
readonly description: "TBP-2 时间线";
|
|
357
|
+
readonly items: {
|
|
358
|
+
readonly type: "object";
|
|
359
|
+
readonly properties: {
|
|
360
|
+
readonly order: {
|
|
361
|
+
readonly type: "number";
|
|
362
|
+
readonly description: "时间线顺序";
|
|
363
|
+
};
|
|
364
|
+
readonly event: {
|
|
365
|
+
readonly type: "string";
|
|
366
|
+
readonly description: "事件描述";
|
|
367
|
+
};
|
|
368
|
+
readonly evidence: {
|
|
369
|
+
readonly type: "string";
|
|
370
|
+
readonly description: "对应证据";
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
readonly required: readonly ["order", "event"];
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
readonly ruledOut: {
|
|
377
|
+
readonly type: "array";
|
|
378
|
+
readonly description: "TBP-3 已排除方向";
|
|
379
|
+
readonly items: {
|
|
380
|
+
readonly type: "string";
|
|
381
|
+
};
|
|
382
|
+
};
|
|
383
|
+
readonly commonPattern: {
|
|
384
|
+
readonly type: "string";
|
|
385
|
+
readonly description: "TBP-4 共同模式";
|
|
386
|
+
};
|
|
387
|
+
readonly boundary: {
|
|
388
|
+
readonly type: "string";
|
|
389
|
+
readonly description: "TBP-5 问题边界";
|
|
390
|
+
};
|
|
391
|
+
readonly rootCauseStatement: {
|
|
392
|
+
readonly type: "string";
|
|
393
|
+
readonly description: "TBP-6 真因因果句";
|
|
394
|
+
};
|
|
395
|
+
readonly evidence: {
|
|
396
|
+
readonly type: "array";
|
|
397
|
+
readonly description: "TBP-7 证据链";
|
|
398
|
+
readonly items: {
|
|
399
|
+
readonly type: "object";
|
|
400
|
+
readonly properties: {
|
|
401
|
+
readonly type: {
|
|
402
|
+
readonly type: "string";
|
|
403
|
+
readonly enum: readonly ["symptom", "timeline", "stack", "code", "comparison", "environment", "graph"];
|
|
404
|
+
readonly description: "证据类型";
|
|
405
|
+
};
|
|
406
|
+
readonly detail: {
|
|
407
|
+
readonly type: "string";
|
|
408
|
+
readonly description: "证据内容";
|
|
409
|
+
};
|
|
410
|
+
readonly source: {
|
|
411
|
+
readonly type: "string";
|
|
412
|
+
readonly description: "证据来源";
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
readonly required: readonly ["type", "detail"];
|
|
416
|
+
};
|
|
417
|
+
};
|
|
418
|
+
readonly repair: {
|
|
419
|
+
readonly type: "array";
|
|
420
|
+
readonly description: "TBP-8 修复设计";
|
|
421
|
+
readonly items: {
|
|
422
|
+
readonly type: "object";
|
|
423
|
+
readonly properties: {
|
|
424
|
+
readonly layer: {
|
|
425
|
+
readonly type: "string";
|
|
426
|
+
readonly description: "修复层";
|
|
427
|
+
};
|
|
428
|
+
readonly action: {
|
|
429
|
+
readonly type: "string";
|
|
430
|
+
readonly description: "修复动作";
|
|
431
|
+
};
|
|
432
|
+
readonly risk: {
|
|
433
|
+
readonly type: "string";
|
|
434
|
+
readonly description: "潜在风险";
|
|
435
|
+
};
|
|
436
|
+
readonly verification: {
|
|
437
|
+
readonly type: "string";
|
|
438
|
+
readonly description: "验证方法";
|
|
439
|
+
};
|
|
440
|
+
};
|
|
441
|
+
readonly required: readonly ["layer", "action", "verification"];
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
readonly required: readonly ["phenomenon", "timeline", "ruledOut", "commonPattern", "boundary", "rootCauseStatement", "evidence", "repair"];
|
|
446
|
+
};
|
|
243
447
|
};
|
|
244
|
-
readonly required: readonly ["rootCause", "fixPlan", "testPlan"];
|
|
448
|
+
readonly required: readonly ["analysisMode", "rootCause", "fixPlan", "testPlan", "tbp"];
|
|
245
449
|
};
|
|
246
450
|
/**
|
|
247
451
|
* Feature Development Report Schema
|
|
@@ -746,6 +950,25 @@ export interface CommitMessage {
|
|
|
746
950
|
fullMessage: string;
|
|
747
951
|
emoji?: string;
|
|
748
952
|
}
|
|
953
|
+
export interface CommitGuidance {
|
|
954
|
+
mode: 'guidance';
|
|
955
|
+
status: 'ready' | 'needs_changes';
|
|
956
|
+
hasChanges: boolean;
|
|
957
|
+
inputSummary?: string;
|
|
958
|
+
steps: string[];
|
|
959
|
+
rules: string[];
|
|
960
|
+
allowedTypes: Array<{
|
|
961
|
+
type: string;
|
|
962
|
+
emoji: string;
|
|
963
|
+
when: string;
|
|
964
|
+
}>;
|
|
965
|
+
outputTemplate: string;
|
|
966
|
+
examples: Array<{
|
|
967
|
+
type: string;
|
|
968
|
+
fullMessage: string;
|
|
969
|
+
}>;
|
|
970
|
+
nextAction: string;
|
|
971
|
+
}
|
|
749
972
|
export interface WorkflowStep {
|
|
750
973
|
name: string;
|
|
751
974
|
status: 'completed' | 'skipped' | 'failed' | 'pending';
|
|
@@ -782,11 +1005,35 @@ export interface ExecutionPlan {
|
|
|
782
1005
|
steps: PlanStep[];
|
|
783
1006
|
}
|
|
784
1007
|
export interface BugFixReport extends WorkflowReport {
|
|
1008
|
+
analysisMode: 'tbp8';
|
|
785
1009
|
rootCause: string;
|
|
786
1010
|
fixPlan: string;
|
|
787
1011
|
testPlan: string;
|
|
788
1012
|
commitDraft?: CommitMessage;
|
|
789
1013
|
affectedFiles?: string[];
|
|
1014
|
+
tbp: {
|
|
1015
|
+
phenomenon: string;
|
|
1016
|
+
timeline: Array<{
|
|
1017
|
+
order: number;
|
|
1018
|
+
event: string;
|
|
1019
|
+
evidence?: string;
|
|
1020
|
+
}>;
|
|
1021
|
+
ruledOut: string[];
|
|
1022
|
+
commonPattern: string;
|
|
1023
|
+
boundary: string;
|
|
1024
|
+
rootCauseStatement: string;
|
|
1025
|
+
evidence: Array<{
|
|
1026
|
+
type: 'symptom' | 'timeline' | 'stack' | 'code' | 'comparison' | 'environment' | 'graph';
|
|
1027
|
+
detail: string;
|
|
1028
|
+
source?: string;
|
|
1029
|
+
}>;
|
|
1030
|
+
repair: Array<{
|
|
1031
|
+
layer: string;
|
|
1032
|
+
action: string;
|
|
1033
|
+
risk?: string;
|
|
1034
|
+
verification: string;
|
|
1035
|
+
}>;
|
|
1036
|
+
};
|
|
790
1037
|
}
|
|
791
1038
|
export interface FeatureReport extends WorkflowReport {
|
|
792
1039
|
specArtifacts: Array<{
|
|
@@ -1022,6 +1269,11 @@ export declare const BugAnalysisSchema: {
|
|
|
1022
1269
|
readonly enum: readonly ["critical", "high", "medium", "low"];
|
|
1023
1270
|
readonly description: "严重程度";
|
|
1024
1271
|
};
|
|
1272
|
+
readonly analysisMode: {
|
|
1273
|
+
readonly type: "string";
|
|
1274
|
+
readonly enum: readonly ["tbp8"];
|
|
1275
|
+
readonly description: "分析方法";
|
|
1276
|
+
};
|
|
1025
1277
|
readonly rootCause: {
|
|
1026
1278
|
readonly type: "string";
|
|
1027
1279
|
readonly description: "根本原因";
|
|
@@ -1093,8 +1345,109 @@ export declare const BugAnalysisSchema: {
|
|
|
1093
1345
|
readonly type: "string";
|
|
1094
1346
|
};
|
|
1095
1347
|
};
|
|
1348
|
+
readonly tbp: {
|
|
1349
|
+
readonly description: "TBP 8 步法分析结果";
|
|
1350
|
+
readonly type: "object";
|
|
1351
|
+
readonly properties: {
|
|
1352
|
+
readonly phenomenon: {
|
|
1353
|
+
readonly type: "string";
|
|
1354
|
+
readonly description: "TBP-1 现象";
|
|
1355
|
+
};
|
|
1356
|
+
readonly timeline: {
|
|
1357
|
+
readonly type: "array";
|
|
1358
|
+
readonly description: "TBP-2 时间线";
|
|
1359
|
+
readonly items: {
|
|
1360
|
+
readonly type: "object";
|
|
1361
|
+
readonly properties: {
|
|
1362
|
+
readonly order: {
|
|
1363
|
+
readonly type: "number";
|
|
1364
|
+
readonly description: "时间线顺序";
|
|
1365
|
+
};
|
|
1366
|
+
readonly event: {
|
|
1367
|
+
readonly type: "string";
|
|
1368
|
+
readonly description: "事件描述";
|
|
1369
|
+
};
|
|
1370
|
+
readonly evidence: {
|
|
1371
|
+
readonly type: "string";
|
|
1372
|
+
readonly description: "对应证据";
|
|
1373
|
+
};
|
|
1374
|
+
};
|
|
1375
|
+
readonly required: readonly ["order", "event"];
|
|
1376
|
+
};
|
|
1377
|
+
};
|
|
1378
|
+
readonly ruledOut: {
|
|
1379
|
+
readonly type: "array";
|
|
1380
|
+
readonly description: "TBP-3 已排除方向";
|
|
1381
|
+
readonly items: {
|
|
1382
|
+
readonly type: "string";
|
|
1383
|
+
};
|
|
1384
|
+
};
|
|
1385
|
+
readonly commonPattern: {
|
|
1386
|
+
readonly type: "string";
|
|
1387
|
+
readonly description: "TBP-4 共同模式";
|
|
1388
|
+
};
|
|
1389
|
+
readonly boundary: {
|
|
1390
|
+
readonly type: "string";
|
|
1391
|
+
readonly description: "TBP-5 问题边界";
|
|
1392
|
+
};
|
|
1393
|
+
readonly rootCauseStatement: {
|
|
1394
|
+
readonly type: "string";
|
|
1395
|
+
readonly description: "TBP-6 真因因果句";
|
|
1396
|
+
};
|
|
1397
|
+
readonly evidence: {
|
|
1398
|
+
readonly type: "array";
|
|
1399
|
+
readonly description: "TBP-7 证据链";
|
|
1400
|
+
readonly items: {
|
|
1401
|
+
readonly type: "object";
|
|
1402
|
+
readonly properties: {
|
|
1403
|
+
readonly type: {
|
|
1404
|
+
readonly type: "string";
|
|
1405
|
+
readonly enum: readonly ["symptom", "timeline", "stack", "code", "comparison", "environment", "graph"];
|
|
1406
|
+
readonly description: "证据类型";
|
|
1407
|
+
};
|
|
1408
|
+
readonly detail: {
|
|
1409
|
+
readonly type: "string";
|
|
1410
|
+
readonly description: "证据内容";
|
|
1411
|
+
};
|
|
1412
|
+
readonly source: {
|
|
1413
|
+
readonly type: "string";
|
|
1414
|
+
readonly description: "证据来源";
|
|
1415
|
+
};
|
|
1416
|
+
};
|
|
1417
|
+
readonly required: readonly ["type", "detail"];
|
|
1418
|
+
};
|
|
1419
|
+
};
|
|
1420
|
+
readonly repair: {
|
|
1421
|
+
readonly type: "array";
|
|
1422
|
+
readonly description: "TBP-8 修复设计";
|
|
1423
|
+
readonly items: {
|
|
1424
|
+
readonly type: "object";
|
|
1425
|
+
readonly properties: {
|
|
1426
|
+
readonly layer: {
|
|
1427
|
+
readonly type: "string";
|
|
1428
|
+
readonly description: "修复层";
|
|
1429
|
+
};
|
|
1430
|
+
readonly action: {
|
|
1431
|
+
readonly type: "string";
|
|
1432
|
+
readonly description: "修复动作";
|
|
1433
|
+
};
|
|
1434
|
+
readonly risk: {
|
|
1435
|
+
readonly type: "string";
|
|
1436
|
+
readonly description: "潜在风险";
|
|
1437
|
+
};
|
|
1438
|
+
readonly verification: {
|
|
1439
|
+
readonly type: "string";
|
|
1440
|
+
readonly description: "验证方法";
|
|
1441
|
+
};
|
|
1442
|
+
};
|
|
1443
|
+
readonly required: readonly ["layer", "action", "verification"];
|
|
1444
|
+
};
|
|
1445
|
+
};
|
|
1446
|
+
};
|
|
1447
|
+
readonly required: readonly ["phenomenon", "timeline", "ruledOut", "commonPattern", "boundary", "rootCauseStatement", "evidence", "repair"];
|
|
1448
|
+
};
|
|
1096
1449
|
};
|
|
1097
|
-
readonly required: readonly ["summary", "bugType", "severity", "rootCause", "fixPlan", "testPlan"];
|
|
1450
|
+
readonly required: readonly ["summary", "bugType", "severity", "analysisMode", "rootCause", "fixPlan", "testPlan", "tbp"];
|
|
1098
1451
|
};
|
|
1099
1452
|
/**
|
|
1100
1453
|
* Test Suite Schema
|
|
@@ -15,15 +15,20 @@
|
|
|
15
15
|
*/
|
|
16
16
|
/**
|
|
17
17
|
* Commit Message Schema
|
|
18
|
-
*
|
|
18
|
+
* 用于提交草稿(保留给其他场景复用)
|
|
19
19
|
*/
|
|
20
20
|
export const CommitMessageSchema = {
|
|
21
21
|
type: 'object',
|
|
22
22
|
properties: {
|
|
23
|
+
status: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
description: '生成状态:ready 表示已生成提交草稿;needs_changes 表示需要补充变更内容',
|
|
26
|
+
enum: ['ready', 'needs_changes'],
|
|
27
|
+
},
|
|
23
28
|
type: {
|
|
24
29
|
type: 'string',
|
|
25
30
|
description: 'Commit 类型:feat/fix/docs/refactor/test/chore/style/perf',
|
|
26
|
-
enum: ['feat', 'fix', 'docs', 'refactor', 'test', 'chore', 'style', 'perf', 'ci', 'build', 'revert'],
|
|
31
|
+
enum: ['feat', 'fix', 'fixed', 'docs', 'refactor', 'test', 'chore', 'style', 'perf', 'ci', 'build', 'revert'],
|
|
27
32
|
},
|
|
28
33
|
scope: {
|
|
29
34
|
type: 'string',
|
|
@@ -49,8 +54,87 @@ export const CommitMessageSchema = {
|
|
|
49
54
|
type: 'string',
|
|
50
55
|
description: 'Emoji 前缀(如果使用 conventional+emoji 风格)',
|
|
51
56
|
},
|
|
57
|
+
guidance: {
|
|
58
|
+
type: 'string',
|
|
59
|
+
description: '当 status=needs_changes 时,提示需要补充的信息',
|
|
60
|
+
},
|
|
61
|
+
nextAction: {
|
|
62
|
+
type: 'string',
|
|
63
|
+
description: '下一步建议动作',
|
|
64
|
+
},
|
|
52
65
|
},
|
|
53
|
-
required: ['
|
|
66
|
+
required: ['status'],
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Commit Guidance Schema
|
|
70
|
+
* 用于 gencommit 工具的结构化输出
|
|
71
|
+
*/
|
|
72
|
+
export const CommitGuidanceSchema = {
|
|
73
|
+
type: 'object',
|
|
74
|
+
properties: {
|
|
75
|
+
mode: {
|
|
76
|
+
type: 'string',
|
|
77
|
+
enum: ['guidance'],
|
|
78
|
+
description: 'gencommit 当前只返回指导文档,不直接生成最终提交消息',
|
|
79
|
+
},
|
|
80
|
+
status: {
|
|
81
|
+
type: 'string',
|
|
82
|
+
enum: ['ready', 'needs_changes'],
|
|
83
|
+
description: 'ready 表示可直接按规则生成;needs_changes 表示还缺变更信息',
|
|
84
|
+
},
|
|
85
|
+
hasChanges: {
|
|
86
|
+
type: 'boolean',
|
|
87
|
+
description: '是否已拿到变更内容',
|
|
88
|
+
},
|
|
89
|
+
inputSummary: {
|
|
90
|
+
type: 'string',
|
|
91
|
+
description: '对输入变更的简要摘要',
|
|
92
|
+
},
|
|
93
|
+
steps: {
|
|
94
|
+
type: 'array',
|
|
95
|
+
description: 'AI 接下来要执行的步骤',
|
|
96
|
+
items: { type: 'string' },
|
|
97
|
+
},
|
|
98
|
+
rules: {
|
|
99
|
+
type: 'array',
|
|
100
|
+
description: '生成 commit message 时必须遵守的规则',
|
|
101
|
+
items: { type: 'string' },
|
|
102
|
+
},
|
|
103
|
+
allowedTypes: {
|
|
104
|
+
type: 'array',
|
|
105
|
+
description: '允许使用的 type 及对应 emoji',
|
|
106
|
+
items: {
|
|
107
|
+
type: 'object',
|
|
108
|
+
properties: {
|
|
109
|
+
type: { type: 'string' },
|
|
110
|
+
emoji: { type: 'string' },
|
|
111
|
+
when: { type: 'string' },
|
|
112
|
+
},
|
|
113
|
+
required: ['type', 'emoji', 'when'],
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
outputTemplate: {
|
|
117
|
+
type: 'string',
|
|
118
|
+
description: '最终 commit message 的模板',
|
|
119
|
+
},
|
|
120
|
+
examples: {
|
|
121
|
+
type: 'array',
|
|
122
|
+
description: '参考示例',
|
|
123
|
+
items: {
|
|
124
|
+
type: 'object',
|
|
125
|
+
properties: {
|
|
126
|
+
type: { type: 'string' },
|
|
127
|
+
fullMessage: { type: 'string' },
|
|
128
|
+
},
|
|
129
|
+
required: ['type', 'fullMessage'],
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
nextAction: {
|
|
133
|
+
type: 'string',
|
|
134
|
+
description: 'AI 下一步该做什么',
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
required: ['mode', 'status', 'hasChanges', 'steps', 'rules', 'allowedTypes', 'outputTemplate', 'examples', 'nextAction'],
|
|
54
138
|
};
|
|
55
139
|
/**
|
|
56
140
|
* Workflow Report Schema
|
|
@@ -185,6 +269,68 @@ export const ExecutionPlanSchema = {
|
|
|
185
269
|
},
|
|
186
270
|
required: ['mode', 'steps'],
|
|
187
271
|
};
|
|
272
|
+
const TbpTimelineEventSchema = {
|
|
273
|
+
type: 'object',
|
|
274
|
+
properties: {
|
|
275
|
+
order: { type: 'number', description: '时间线顺序' },
|
|
276
|
+
event: { type: 'string', description: '事件描述' },
|
|
277
|
+
evidence: { type: 'string', description: '对应证据' },
|
|
278
|
+
},
|
|
279
|
+
required: ['order', 'event'],
|
|
280
|
+
};
|
|
281
|
+
const TbpEvidenceItemSchema = {
|
|
282
|
+
type: 'object',
|
|
283
|
+
properties: {
|
|
284
|
+
type: {
|
|
285
|
+
type: 'string',
|
|
286
|
+
enum: ['symptom', 'timeline', 'stack', 'code', 'comparison', 'environment', 'graph'],
|
|
287
|
+
description: '证据类型',
|
|
288
|
+
},
|
|
289
|
+
detail: { type: 'string', description: '证据内容' },
|
|
290
|
+
source: { type: 'string', description: '证据来源' },
|
|
291
|
+
},
|
|
292
|
+
required: ['type', 'detail'],
|
|
293
|
+
};
|
|
294
|
+
const TbpRepairItemSchema = {
|
|
295
|
+
type: 'object',
|
|
296
|
+
properties: {
|
|
297
|
+
layer: { type: 'string', description: '修复层' },
|
|
298
|
+
action: { type: 'string', description: '修复动作' },
|
|
299
|
+
risk: { type: 'string', description: '潜在风险' },
|
|
300
|
+
verification: { type: 'string', description: '验证方法' },
|
|
301
|
+
},
|
|
302
|
+
required: ['layer', 'action', 'verification'],
|
|
303
|
+
};
|
|
304
|
+
const TbpAnalysisSchema = {
|
|
305
|
+
type: 'object',
|
|
306
|
+
properties: {
|
|
307
|
+
phenomenon: { type: 'string', description: 'TBP-1 现象' },
|
|
308
|
+
timeline: {
|
|
309
|
+
type: 'array',
|
|
310
|
+
description: 'TBP-2 时间线',
|
|
311
|
+
items: TbpTimelineEventSchema,
|
|
312
|
+
},
|
|
313
|
+
ruledOut: {
|
|
314
|
+
type: 'array',
|
|
315
|
+
description: 'TBP-3 已排除方向',
|
|
316
|
+
items: { type: 'string' },
|
|
317
|
+
},
|
|
318
|
+
commonPattern: { type: 'string', description: 'TBP-4 共同模式' },
|
|
319
|
+
boundary: { type: 'string', description: 'TBP-5 问题边界' },
|
|
320
|
+
rootCauseStatement: { type: 'string', description: 'TBP-6 真因因果句' },
|
|
321
|
+
evidence: {
|
|
322
|
+
type: 'array',
|
|
323
|
+
description: 'TBP-7 证据链',
|
|
324
|
+
items: TbpEvidenceItemSchema,
|
|
325
|
+
},
|
|
326
|
+
repair: {
|
|
327
|
+
type: 'array',
|
|
328
|
+
description: 'TBP-8 修复设计',
|
|
329
|
+
items: TbpRepairItemSchema,
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
required: ['phenomenon', 'timeline', 'ruledOut', 'commonPattern', 'boundary', 'rootCauseStatement', 'evidence', 'repair'],
|
|
333
|
+
};
|
|
188
334
|
/**
|
|
189
335
|
* Bug Fix Report Schema
|
|
190
336
|
* 用于 start_bugfix 的特定字段
|
|
@@ -195,6 +341,11 @@ export const BugFixReportSchema = {
|
|
|
195
341
|
{ $ref: '#/definitions/WorkflowReport' },
|
|
196
342
|
],
|
|
197
343
|
properties: {
|
|
344
|
+
analysisMode: {
|
|
345
|
+
type: 'string',
|
|
346
|
+
enum: ['tbp8'],
|
|
347
|
+
description: '分析方法',
|
|
348
|
+
},
|
|
198
349
|
rootCause: {
|
|
199
350
|
type: 'string',
|
|
200
351
|
description: '根本原因分析',
|
|
@@ -218,8 +369,12 @@ export const BugFixReportSchema = {
|
|
|
218
369
|
type: 'string',
|
|
219
370
|
},
|
|
220
371
|
},
|
|
372
|
+
tbp: {
|
|
373
|
+
...TbpAnalysisSchema,
|
|
374
|
+
description: 'TBP 8 步法分析骨架',
|
|
375
|
+
},
|
|
221
376
|
},
|
|
222
|
-
required: ['rootCause', 'fixPlan', 'testPlan'],
|
|
377
|
+
required: ['analysisMode', 'rootCause', 'fixPlan', 'testPlan', 'tbp'],
|
|
223
378
|
};
|
|
224
379
|
/**
|
|
225
380
|
* Feature Development Report Schema
|
|
@@ -763,6 +918,11 @@ export const BugAnalysisSchema = {
|
|
|
763
918
|
enum: ['critical', 'high', 'medium', 'low'],
|
|
764
919
|
description: '严重程度',
|
|
765
920
|
},
|
|
921
|
+
analysisMode: {
|
|
922
|
+
type: 'string',
|
|
923
|
+
enum: ['tbp8'],
|
|
924
|
+
description: '分析方法',
|
|
925
|
+
},
|
|
766
926
|
rootCause: {
|
|
767
927
|
type: 'string',
|
|
768
928
|
description: '根本原因',
|
|
@@ -816,8 +976,12 @@ export const BugAnalysisSchema = {
|
|
|
816
976
|
description: '预防措施',
|
|
817
977
|
items: { type: 'string' },
|
|
818
978
|
},
|
|
979
|
+
tbp: {
|
|
980
|
+
...TbpAnalysisSchema,
|
|
981
|
+
description: 'TBP 8 步法分析结果',
|
|
982
|
+
},
|
|
819
983
|
},
|
|
820
|
-
required: ['summary', 'bugType', 'severity', 'rootCause', 'fixPlan', 'testPlan'],
|
|
984
|
+
required: ['summary', 'bugType', 'severity', 'analysisMode', 'rootCause', 'fixPlan', 'testPlan', 'tbp'],
|
|
821
985
|
};
|
|
822
986
|
/**
|
|
823
987
|
* Test Suite Schema
|