qat-cli 0.3.1 → 0.3.3
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 +1 -1
- package/dist/cli.js +1319 -1233
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +308 -129
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +128 -120
- package/dist/index.d.ts +128 -120
- package/dist/index.js +307 -128
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI 相关类型定义
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/** AI 能力标识 */
|
|
6
|
+
interface AICapability {
|
|
7
|
+
generateTest: boolean;
|
|
8
|
+
analyzeResult: boolean;
|
|
9
|
+
suggestFix: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** 源码分析摘要(传给 AI 的精简版) */
|
|
12
|
+
interface SourceAnalysisSummary {
|
|
13
|
+
/** 导出项摘要 */
|
|
14
|
+
exports: Array<{
|
|
15
|
+
name: string;
|
|
16
|
+
kind: string;
|
|
17
|
+
params?: string[];
|
|
18
|
+
isAsync?: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
/** Vue Props */
|
|
21
|
+
props?: Array<{
|
|
22
|
+
name: string;
|
|
23
|
+
type: string;
|
|
24
|
+
required: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
/** Vue Emits */
|
|
27
|
+
emits?: Array<{
|
|
28
|
+
name: string;
|
|
29
|
+
params?: string[];
|
|
30
|
+
}>;
|
|
31
|
+
/** Options API 方法 */
|
|
32
|
+
methods?: string[];
|
|
33
|
+
/** computed 属性 */
|
|
34
|
+
computed?: string[];
|
|
35
|
+
}
|
|
36
|
+
/** AI 生成测试请求 */
|
|
37
|
+
interface AIGenerateTestRequest {
|
|
38
|
+
type: TestType;
|
|
39
|
+
target: string;
|
|
40
|
+
context?: string;
|
|
41
|
+
framework?: 'vue';
|
|
42
|
+
/** 源码分析摘要 */
|
|
43
|
+
analysis?: SourceAnalysisSummary;
|
|
44
|
+
}
|
|
45
|
+
/** AI 生成测试响应 */
|
|
46
|
+
interface AIGenerateTestResponse {
|
|
47
|
+
code: string;
|
|
48
|
+
description: string;
|
|
49
|
+
confidence: number;
|
|
50
|
+
}
|
|
51
|
+
/** AI 分析结果请求 */
|
|
52
|
+
interface AIAnalyzeResultRequest {
|
|
53
|
+
testResults: TestRunResult[];
|
|
54
|
+
errorLogs?: string[];
|
|
55
|
+
screenshots?: string[];
|
|
56
|
+
}
|
|
57
|
+
/** AI 分析结果响应 */
|
|
58
|
+
interface AIAnalyzeResultResponse {
|
|
59
|
+
analysis: string;
|
|
60
|
+
suggestions: string[];
|
|
61
|
+
severity: 'info' | 'warning' | 'error';
|
|
62
|
+
}
|
|
63
|
+
/** AI 审计测试请求 */
|
|
64
|
+
interface AIReviewTestRequest {
|
|
65
|
+
/** 被测源码文件路径 */
|
|
66
|
+
target: string;
|
|
67
|
+
/** 被测源码内容 */
|
|
68
|
+
sourceCode: string;
|
|
69
|
+
/** 源码分析摘要 */
|
|
70
|
+
analysis?: SourceAnalysisSummary;
|
|
71
|
+
/** 生成的测试代码 */
|
|
72
|
+
testCode: string;
|
|
73
|
+
/** 测试类型 */
|
|
74
|
+
testType: TestType;
|
|
75
|
+
/** 生成者 AI 的描述/意图 */
|
|
76
|
+
generationDescription?: string;
|
|
77
|
+
}
|
|
78
|
+
/** AI 审计测试响应 */
|
|
79
|
+
interface AIReviewTestResponse {
|
|
80
|
+
/** 是否通过审计 */
|
|
81
|
+
approved: boolean;
|
|
82
|
+
/** 审计评分 0-1 */
|
|
83
|
+
score: number;
|
|
84
|
+
/** 审计意见 */
|
|
85
|
+
feedback: string;
|
|
86
|
+
/** 具体问题列表 */
|
|
87
|
+
issues: string[];
|
|
88
|
+
/** 改进建议 */
|
|
89
|
+
suggestions: string[];
|
|
90
|
+
}
|
|
91
|
+
/** AI Provider 接口 */
|
|
92
|
+
interface AIProvider {
|
|
93
|
+
readonly name: string;
|
|
94
|
+
readonly capabilities: AICapability;
|
|
95
|
+
generateTest(req: AIGenerateTestRequest): Promise<AIGenerateTestResponse>;
|
|
96
|
+
analyzeResult(req: AIAnalyzeResultRequest): Promise<AIAnalyzeResultResponse>;
|
|
97
|
+
suggestFix(error: TestError): Promise<string[]>;
|
|
98
|
+
reviewTest(req: AIReviewTestRequest): Promise<AIReviewTestResponse>;
|
|
99
|
+
}
|
|
100
|
+
/** AI 配置 */
|
|
101
|
+
interface AIConfig {
|
|
102
|
+
provider: string;
|
|
103
|
+
apiKey?: string;
|
|
104
|
+
model?: string;
|
|
105
|
+
baseUrl?: string;
|
|
106
|
+
}
|
|
107
|
+
/** 预置 Provider 配置(用于 init 向导) */
|
|
108
|
+
interface AIPresetProvider {
|
|
109
|
+
/** 标识名 */
|
|
110
|
+
id: string;
|
|
111
|
+
/** 显示名 */
|
|
112
|
+
name: string;
|
|
113
|
+
/** 默认 base URL */
|
|
114
|
+
baseUrl: string;
|
|
115
|
+
/** 默认模型 */
|
|
116
|
+
defaultModel: string;
|
|
117
|
+
/** 是否需要 API Key */
|
|
118
|
+
requiresApiKey: boolean;
|
|
119
|
+
}
|
|
120
|
+
|
|
1
121
|
/**
|
|
2
122
|
* QAT 全局类型定义
|
|
3
123
|
*/
|
|
@@ -161,126 +281,6 @@ interface SetupOptions extends GlobalOptions {
|
|
|
161
281
|
dryRun?: boolean;
|
|
162
282
|
}
|
|
163
283
|
|
|
164
|
-
/**
|
|
165
|
-
* AI 相关类型定义
|
|
166
|
-
*/
|
|
167
|
-
|
|
168
|
-
/** AI 能力标识 */
|
|
169
|
-
interface AICapability {
|
|
170
|
-
generateTest: boolean;
|
|
171
|
-
analyzeResult: boolean;
|
|
172
|
-
suggestFix: boolean;
|
|
173
|
-
}
|
|
174
|
-
/** 源码分析摘要(传给 AI 的精简版) */
|
|
175
|
-
interface SourceAnalysisSummary {
|
|
176
|
-
/** 导出项摘要 */
|
|
177
|
-
exports: Array<{
|
|
178
|
-
name: string;
|
|
179
|
-
kind: string;
|
|
180
|
-
params?: string[];
|
|
181
|
-
isAsync?: boolean;
|
|
182
|
-
}>;
|
|
183
|
-
/** Vue Props */
|
|
184
|
-
props?: Array<{
|
|
185
|
-
name: string;
|
|
186
|
-
type: string;
|
|
187
|
-
required: boolean;
|
|
188
|
-
}>;
|
|
189
|
-
/** Vue Emits */
|
|
190
|
-
emits?: Array<{
|
|
191
|
-
name: string;
|
|
192
|
-
params?: string[];
|
|
193
|
-
}>;
|
|
194
|
-
/** Options API 方法 */
|
|
195
|
-
methods?: string[];
|
|
196
|
-
/** computed 属性 */
|
|
197
|
-
computed?: string[];
|
|
198
|
-
}
|
|
199
|
-
/** AI 生成测试请求 */
|
|
200
|
-
interface AIGenerateTestRequest {
|
|
201
|
-
type: TestType;
|
|
202
|
-
target: string;
|
|
203
|
-
context?: string;
|
|
204
|
-
framework?: 'vue';
|
|
205
|
-
/** 源码分析摘要 */
|
|
206
|
-
analysis?: SourceAnalysisSummary;
|
|
207
|
-
}
|
|
208
|
-
/** AI 生成测试响应 */
|
|
209
|
-
interface AIGenerateTestResponse {
|
|
210
|
-
code: string;
|
|
211
|
-
description: string;
|
|
212
|
-
confidence: number;
|
|
213
|
-
}
|
|
214
|
-
/** AI 分析结果请求 */
|
|
215
|
-
interface AIAnalyzeResultRequest {
|
|
216
|
-
testResults: TestRunResult[];
|
|
217
|
-
errorLogs?: string[];
|
|
218
|
-
screenshots?: string[];
|
|
219
|
-
}
|
|
220
|
-
/** AI 分析结果响应 */
|
|
221
|
-
interface AIAnalyzeResultResponse {
|
|
222
|
-
analysis: string;
|
|
223
|
-
suggestions: string[];
|
|
224
|
-
severity: 'info' | 'warning' | 'error';
|
|
225
|
-
}
|
|
226
|
-
/** AI 审计测试请求 */
|
|
227
|
-
interface AIReviewTestRequest {
|
|
228
|
-
/** 被测源码文件路径 */
|
|
229
|
-
target: string;
|
|
230
|
-
/** 被测源码内容 */
|
|
231
|
-
sourceCode: string;
|
|
232
|
-
/** 源码分析摘要 */
|
|
233
|
-
analysis?: SourceAnalysisSummary;
|
|
234
|
-
/** 生成的测试代码 */
|
|
235
|
-
testCode: string;
|
|
236
|
-
/** 测试类型 */
|
|
237
|
-
testType: TestType;
|
|
238
|
-
/** 生成者 AI 的描述/意图 */
|
|
239
|
-
generationDescription?: string;
|
|
240
|
-
}
|
|
241
|
-
/** AI 审计测试响应 */
|
|
242
|
-
interface AIReviewTestResponse {
|
|
243
|
-
/** 是否通过审计 */
|
|
244
|
-
approved: boolean;
|
|
245
|
-
/** 审计评分 0-1 */
|
|
246
|
-
score: number;
|
|
247
|
-
/** 审计意见 */
|
|
248
|
-
feedback: string;
|
|
249
|
-
/** 具体问题列表 */
|
|
250
|
-
issues: string[];
|
|
251
|
-
/** 改进建议 */
|
|
252
|
-
suggestions: string[];
|
|
253
|
-
}
|
|
254
|
-
/** AI Provider 接口 */
|
|
255
|
-
interface AIProvider {
|
|
256
|
-
readonly name: string;
|
|
257
|
-
readonly capabilities: AICapability;
|
|
258
|
-
generateTest(req: AIGenerateTestRequest): Promise<AIGenerateTestResponse>;
|
|
259
|
-
analyzeResult(req: AIAnalyzeResultRequest): Promise<AIAnalyzeResultResponse>;
|
|
260
|
-
suggestFix(error: TestError): Promise<string[]>;
|
|
261
|
-
reviewTest(req: AIReviewTestRequest): Promise<AIReviewTestResponse>;
|
|
262
|
-
}
|
|
263
|
-
/** AI 配置 */
|
|
264
|
-
interface AIConfig {
|
|
265
|
-
provider: string;
|
|
266
|
-
apiKey?: string;
|
|
267
|
-
model?: string;
|
|
268
|
-
baseUrl?: string;
|
|
269
|
-
}
|
|
270
|
-
/** 预置 Provider 配置(用于 init 向导) */
|
|
271
|
-
interface AIPresetProvider {
|
|
272
|
-
/** 标识名 */
|
|
273
|
-
id: string;
|
|
274
|
-
/** 显示名 */
|
|
275
|
-
name: string;
|
|
276
|
-
/** 默认 base URL */
|
|
277
|
-
baseUrl: string;
|
|
278
|
-
/** 默认模型 */
|
|
279
|
-
defaultModel: string;
|
|
280
|
-
/** 是否需要 API Key */
|
|
281
|
-
requiresApiKey: boolean;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
284
|
/**
|
|
285
285
|
* 配置管理服务 - 读取/解析/校验/生成 qat.config.ts
|
|
286
286
|
*/
|
|
@@ -738,6 +738,14 @@ declare class OpenAICompatibleProvider implements AIProvider {
|
|
|
738
738
|
private chat;
|
|
739
739
|
private buildGenerateTestSystemPrompt;
|
|
740
740
|
private buildGenerateTestUserPrompt;
|
|
741
|
+
/**
|
|
742
|
+
* 根据测试类型和源文件路径,计算从测试文件到源文件的正确相对导入路径
|
|
743
|
+
*/
|
|
744
|
+
private computeTestImportPath;
|
|
745
|
+
/**
|
|
746
|
+
* 获取测试输出目录
|
|
747
|
+
*/
|
|
748
|
+
private getTestOutputDir;
|
|
741
749
|
private parseGenerateTestResponse;
|
|
742
750
|
private buildReviewTestSystemPrompt;
|
|
743
751
|
private buildReviewTestUserPrompt;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI 相关类型定义
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/** AI 能力标识 */
|
|
6
|
+
interface AICapability {
|
|
7
|
+
generateTest: boolean;
|
|
8
|
+
analyzeResult: boolean;
|
|
9
|
+
suggestFix: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** 源码分析摘要(传给 AI 的精简版) */
|
|
12
|
+
interface SourceAnalysisSummary {
|
|
13
|
+
/** 导出项摘要 */
|
|
14
|
+
exports: Array<{
|
|
15
|
+
name: string;
|
|
16
|
+
kind: string;
|
|
17
|
+
params?: string[];
|
|
18
|
+
isAsync?: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
/** Vue Props */
|
|
21
|
+
props?: Array<{
|
|
22
|
+
name: string;
|
|
23
|
+
type: string;
|
|
24
|
+
required: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
/** Vue Emits */
|
|
27
|
+
emits?: Array<{
|
|
28
|
+
name: string;
|
|
29
|
+
params?: string[];
|
|
30
|
+
}>;
|
|
31
|
+
/** Options API 方法 */
|
|
32
|
+
methods?: string[];
|
|
33
|
+
/** computed 属性 */
|
|
34
|
+
computed?: string[];
|
|
35
|
+
}
|
|
36
|
+
/** AI 生成测试请求 */
|
|
37
|
+
interface AIGenerateTestRequest {
|
|
38
|
+
type: TestType;
|
|
39
|
+
target: string;
|
|
40
|
+
context?: string;
|
|
41
|
+
framework?: 'vue';
|
|
42
|
+
/** 源码分析摘要 */
|
|
43
|
+
analysis?: SourceAnalysisSummary;
|
|
44
|
+
}
|
|
45
|
+
/** AI 生成测试响应 */
|
|
46
|
+
interface AIGenerateTestResponse {
|
|
47
|
+
code: string;
|
|
48
|
+
description: string;
|
|
49
|
+
confidence: number;
|
|
50
|
+
}
|
|
51
|
+
/** AI 分析结果请求 */
|
|
52
|
+
interface AIAnalyzeResultRequest {
|
|
53
|
+
testResults: TestRunResult[];
|
|
54
|
+
errorLogs?: string[];
|
|
55
|
+
screenshots?: string[];
|
|
56
|
+
}
|
|
57
|
+
/** AI 分析结果响应 */
|
|
58
|
+
interface AIAnalyzeResultResponse {
|
|
59
|
+
analysis: string;
|
|
60
|
+
suggestions: string[];
|
|
61
|
+
severity: 'info' | 'warning' | 'error';
|
|
62
|
+
}
|
|
63
|
+
/** AI 审计测试请求 */
|
|
64
|
+
interface AIReviewTestRequest {
|
|
65
|
+
/** 被测源码文件路径 */
|
|
66
|
+
target: string;
|
|
67
|
+
/** 被测源码内容 */
|
|
68
|
+
sourceCode: string;
|
|
69
|
+
/** 源码分析摘要 */
|
|
70
|
+
analysis?: SourceAnalysisSummary;
|
|
71
|
+
/** 生成的测试代码 */
|
|
72
|
+
testCode: string;
|
|
73
|
+
/** 测试类型 */
|
|
74
|
+
testType: TestType;
|
|
75
|
+
/** 生成者 AI 的描述/意图 */
|
|
76
|
+
generationDescription?: string;
|
|
77
|
+
}
|
|
78
|
+
/** AI 审计测试响应 */
|
|
79
|
+
interface AIReviewTestResponse {
|
|
80
|
+
/** 是否通过审计 */
|
|
81
|
+
approved: boolean;
|
|
82
|
+
/** 审计评分 0-1 */
|
|
83
|
+
score: number;
|
|
84
|
+
/** 审计意见 */
|
|
85
|
+
feedback: string;
|
|
86
|
+
/** 具体问题列表 */
|
|
87
|
+
issues: string[];
|
|
88
|
+
/** 改进建议 */
|
|
89
|
+
suggestions: string[];
|
|
90
|
+
}
|
|
91
|
+
/** AI Provider 接口 */
|
|
92
|
+
interface AIProvider {
|
|
93
|
+
readonly name: string;
|
|
94
|
+
readonly capabilities: AICapability;
|
|
95
|
+
generateTest(req: AIGenerateTestRequest): Promise<AIGenerateTestResponse>;
|
|
96
|
+
analyzeResult(req: AIAnalyzeResultRequest): Promise<AIAnalyzeResultResponse>;
|
|
97
|
+
suggestFix(error: TestError): Promise<string[]>;
|
|
98
|
+
reviewTest(req: AIReviewTestRequest): Promise<AIReviewTestResponse>;
|
|
99
|
+
}
|
|
100
|
+
/** AI 配置 */
|
|
101
|
+
interface AIConfig {
|
|
102
|
+
provider: string;
|
|
103
|
+
apiKey?: string;
|
|
104
|
+
model?: string;
|
|
105
|
+
baseUrl?: string;
|
|
106
|
+
}
|
|
107
|
+
/** 预置 Provider 配置(用于 init 向导) */
|
|
108
|
+
interface AIPresetProvider {
|
|
109
|
+
/** 标识名 */
|
|
110
|
+
id: string;
|
|
111
|
+
/** 显示名 */
|
|
112
|
+
name: string;
|
|
113
|
+
/** 默认 base URL */
|
|
114
|
+
baseUrl: string;
|
|
115
|
+
/** 默认模型 */
|
|
116
|
+
defaultModel: string;
|
|
117
|
+
/** 是否需要 API Key */
|
|
118
|
+
requiresApiKey: boolean;
|
|
119
|
+
}
|
|
120
|
+
|
|
1
121
|
/**
|
|
2
122
|
* QAT 全局类型定义
|
|
3
123
|
*/
|
|
@@ -161,126 +281,6 @@ interface SetupOptions extends GlobalOptions {
|
|
|
161
281
|
dryRun?: boolean;
|
|
162
282
|
}
|
|
163
283
|
|
|
164
|
-
/**
|
|
165
|
-
* AI 相关类型定义
|
|
166
|
-
*/
|
|
167
|
-
|
|
168
|
-
/** AI 能力标识 */
|
|
169
|
-
interface AICapability {
|
|
170
|
-
generateTest: boolean;
|
|
171
|
-
analyzeResult: boolean;
|
|
172
|
-
suggestFix: boolean;
|
|
173
|
-
}
|
|
174
|
-
/** 源码分析摘要(传给 AI 的精简版) */
|
|
175
|
-
interface SourceAnalysisSummary {
|
|
176
|
-
/** 导出项摘要 */
|
|
177
|
-
exports: Array<{
|
|
178
|
-
name: string;
|
|
179
|
-
kind: string;
|
|
180
|
-
params?: string[];
|
|
181
|
-
isAsync?: boolean;
|
|
182
|
-
}>;
|
|
183
|
-
/** Vue Props */
|
|
184
|
-
props?: Array<{
|
|
185
|
-
name: string;
|
|
186
|
-
type: string;
|
|
187
|
-
required: boolean;
|
|
188
|
-
}>;
|
|
189
|
-
/** Vue Emits */
|
|
190
|
-
emits?: Array<{
|
|
191
|
-
name: string;
|
|
192
|
-
params?: string[];
|
|
193
|
-
}>;
|
|
194
|
-
/** Options API 方法 */
|
|
195
|
-
methods?: string[];
|
|
196
|
-
/** computed 属性 */
|
|
197
|
-
computed?: string[];
|
|
198
|
-
}
|
|
199
|
-
/** AI 生成测试请求 */
|
|
200
|
-
interface AIGenerateTestRequest {
|
|
201
|
-
type: TestType;
|
|
202
|
-
target: string;
|
|
203
|
-
context?: string;
|
|
204
|
-
framework?: 'vue';
|
|
205
|
-
/** 源码分析摘要 */
|
|
206
|
-
analysis?: SourceAnalysisSummary;
|
|
207
|
-
}
|
|
208
|
-
/** AI 生成测试响应 */
|
|
209
|
-
interface AIGenerateTestResponse {
|
|
210
|
-
code: string;
|
|
211
|
-
description: string;
|
|
212
|
-
confidence: number;
|
|
213
|
-
}
|
|
214
|
-
/** AI 分析结果请求 */
|
|
215
|
-
interface AIAnalyzeResultRequest {
|
|
216
|
-
testResults: TestRunResult[];
|
|
217
|
-
errorLogs?: string[];
|
|
218
|
-
screenshots?: string[];
|
|
219
|
-
}
|
|
220
|
-
/** AI 分析结果响应 */
|
|
221
|
-
interface AIAnalyzeResultResponse {
|
|
222
|
-
analysis: string;
|
|
223
|
-
suggestions: string[];
|
|
224
|
-
severity: 'info' | 'warning' | 'error';
|
|
225
|
-
}
|
|
226
|
-
/** AI 审计测试请求 */
|
|
227
|
-
interface AIReviewTestRequest {
|
|
228
|
-
/** 被测源码文件路径 */
|
|
229
|
-
target: string;
|
|
230
|
-
/** 被测源码内容 */
|
|
231
|
-
sourceCode: string;
|
|
232
|
-
/** 源码分析摘要 */
|
|
233
|
-
analysis?: SourceAnalysisSummary;
|
|
234
|
-
/** 生成的测试代码 */
|
|
235
|
-
testCode: string;
|
|
236
|
-
/** 测试类型 */
|
|
237
|
-
testType: TestType;
|
|
238
|
-
/** 生成者 AI 的描述/意图 */
|
|
239
|
-
generationDescription?: string;
|
|
240
|
-
}
|
|
241
|
-
/** AI 审计测试响应 */
|
|
242
|
-
interface AIReviewTestResponse {
|
|
243
|
-
/** 是否通过审计 */
|
|
244
|
-
approved: boolean;
|
|
245
|
-
/** 审计评分 0-1 */
|
|
246
|
-
score: number;
|
|
247
|
-
/** 审计意见 */
|
|
248
|
-
feedback: string;
|
|
249
|
-
/** 具体问题列表 */
|
|
250
|
-
issues: string[];
|
|
251
|
-
/** 改进建议 */
|
|
252
|
-
suggestions: string[];
|
|
253
|
-
}
|
|
254
|
-
/** AI Provider 接口 */
|
|
255
|
-
interface AIProvider {
|
|
256
|
-
readonly name: string;
|
|
257
|
-
readonly capabilities: AICapability;
|
|
258
|
-
generateTest(req: AIGenerateTestRequest): Promise<AIGenerateTestResponse>;
|
|
259
|
-
analyzeResult(req: AIAnalyzeResultRequest): Promise<AIAnalyzeResultResponse>;
|
|
260
|
-
suggestFix(error: TestError): Promise<string[]>;
|
|
261
|
-
reviewTest(req: AIReviewTestRequest): Promise<AIReviewTestResponse>;
|
|
262
|
-
}
|
|
263
|
-
/** AI 配置 */
|
|
264
|
-
interface AIConfig {
|
|
265
|
-
provider: string;
|
|
266
|
-
apiKey?: string;
|
|
267
|
-
model?: string;
|
|
268
|
-
baseUrl?: string;
|
|
269
|
-
}
|
|
270
|
-
/** 预置 Provider 配置(用于 init 向导) */
|
|
271
|
-
interface AIPresetProvider {
|
|
272
|
-
/** 标识名 */
|
|
273
|
-
id: string;
|
|
274
|
-
/** 显示名 */
|
|
275
|
-
name: string;
|
|
276
|
-
/** 默认 base URL */
|
|
277
|
-
baseUrl: string;
|
|
278
|
-
/** 默认模型 */
|
|
279
|
-
defaultModel: string;
|
|
280
|
-
/** 是否需要 API Key */
|
|
281
|
-
requiresApiKey: boolean;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
284
|
/**
|
|
285
285
|
* 配置管理服务 - 读取/解析/校验/生成 qat.config.ts
|
|
286
286
|
*/
|
|
@@ -738,6 +738,14 @@ declare class OpenAICompatibleProvider implements AIProvider {
|
|
|
738
738
|
private chat;
|
|
739
739
|
private buildGenerateTestSystemPrompt;
|
|
740
740
|
private buildGenerateTestUserPrompt;
|
|
741
|
+
/**
|
|
742
|
+
* 根据测试类型和源文件路径,计算从测试文件到源文件的正确相对导入路径
|
|
743
|
+
*/
|
|
744
|
+
private computeTestImportPath;
|
|
745
|
+
/**
|
|
746
|
+
* 获取测试输出目录
|
|
747
|
+
*/
|
|
748
|
+
private getTestOutputDir;
|
|
741
749
|
private parseGenerateTestResponse;
|
|
742
750
|
private buildReviewTestSystemPrompt;
|
|
743
751
|
private buildReviewTestUserPrompt;
|