@yasserkhanorg/e2e-agents 0.3.4 → 0.3.6
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 +59 -1
- package/dist/agent/ai_flow_analysis.d.ts +12 -0
- package/dist/agent/ai_flow_analysis.d.ts.map +1 -0
- package/dist/agent/ai_flow_analysis.js +326 -0
- package/dist/agent/ai_mapping.d.ts +14 -0
- package/dist/agent/ai_mapping.d.ts.map +1 -0
- package/dist/agent/ai_mapping.js +374 -0
- package/dist/agent/config.d.ts +30 -0
- package/dist/agent/config.d.ts.map +1 -1
- package/dist/agent/config.js +159 -1
- package/dist/agent/flow_catalog.d.ts.map +1 -1
- package/dist/agent/flow_catalog.js +10 -1
- package/dist/agent/pipeline.d.ts.map +1 -1
- package/dist/agent/pipeline.js +182 -52
- package/dist/agent/plan.d.ts +1 -0
- package/dist/agent/plan.d.ts.map +1 -1
- package/dist/agent/plan.js +13 -4
- package/dist/agent/report.d.ts +2 -2
- package/dist/agent/report.d.ts.map +1 -1
- package/dist/agent/runner.d.ts.map +1 -1
- package/dist/agent/runner.js +233 -14
- package/dist/agent/tests.d.ts +1 -1
- package/dist/agent/tests.d.ts.map +1 -1
- package/dist/cli.js +59 -2
- package/dist/esm/agent/ai_flow_analysis.js +323 -0
- package/dist/esm/agent/ai_mapping.js +371 -0
- package/dist/esm/agent/config.js +159 -1
- package/dist/esm/agent/flow_catalog.js +10 -1
- package/dist/esm/agent/pipeline.js +182 -52
- package/dist/esm/agent/plan.js +13 -4
- package/dist/esm/agent/runner.js +233 -14
- package/dist/esm/cli.js +59 -2
- package/dist/esm/provider_factory.js +7 -3
- package/dist/provider_factory.d.ts.map +1 -1
- package/dist/provider_factory.js +7 -3
- package/package.json +4 -1
- package/schemas/impact.schema.json +3 -3
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
3
|
+
// See LICENSE.txt for license information.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.mapAITestsToFlows = mapAITestsToFlows;
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const provider_factory_js_1 = require("../provider_factory.js");
|
|
9
|
+
const utils_js_1 = require("./utils.js");
|
|
10
|
+
const PRIORITY_RANK = {
|
|
11
|
+
P0: 0,
|
|
12
|
+
P1: 1,
|
|
13
|
+
P2: 2,
|
|
14
|
+
};
|
|
15
|
+
const MIN_SINGLE_KEYWORD_LENGTH = 8;
|
|
16
|
+
const LOW_SIGNAL_FLOW_KEYWORDS = new Set([
|
|
17
|
+
'app',
|
|
18
|
+
'apps',
|
|
19
|
+
'channel',
|
|
20
|
+
'channels',
|
|
21
|
+
'client',
|
|
22
|
+
'common',
|
|
23
|
+
'component',
|
|
24
|
+
'components',
|
|
25
|
+
'detail',
|
|
26
|
+
'details',
|
|
27
|
+
'dialog',
|
|
28
|
+
'feature',
|
|
29
|
+
'files',
|
|
30
|
+
'flow',
|
|
31
|
+
'group',
|
|
32
|
+
'groups',
|
|
33
|
+
'hooks',
|
|
34
|
+
'message',
|
|
35
|
+
'messages',
|
|
36
|
+
'modal',
|
|
37
|
+
'new',
|
|
38
|
+
'page',
|
|
39
|
+
'pages',
|
|
40
|
+
'panel',
|
|
41
|
+
'post',
|
|
42
|
+
'posts',
|
|
43
|
+
'query',
|
|
44
|
+
'result',
|
|
45
|
+
'results',
|
|
46
|
+
'screen',
|
|
47
|
+
'screens',
|
|
48
|
+
'section',
|
|
49
|
+
'src',
|
|
50
|
+
'tsx',
|
|
51
|
+
'ts',
|
|
52
|
+
'jsx',
|
|
53
|
+
'js',
|
|
54
|
+
'ui',
|
|
55
|
+
'use',
|
|
56
|
+
'user',
|
|
57
|
+
'users',
|
|
58
|
+
'view',
|
|
59
|
+
'webapp',
|
|
60
|
+
]);
|
|
61
|
+
function extractJson(text) {
|
|
62
|
+
const fenced = text.match(/```(?:json)?\s*([\s\S]*?)```/i);
|
|
63
|
+
const candidates = fenced ? [fenced[1], text] : [text];
|
|
64
|
+
for (const candidate of candidates) {
|
|
65
|
+
const start = candidate.indexOf('{');
|
|
66
|
+
const end = candidate.lastIndexOf('}');
|
|
67
|
+
if (start < 0 || end <= start) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const raw = candidate.slice(start, end + 1);
|
|
71
|
+
try {
|
|
72
|
+
const parsed = JSON.parse(raw);
|
|
73
|
+
if (parsed && Array.isArray(parsed.mappings)) {
|
|
74
|
+
return parsed;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
// Continue trying other candidates.
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
function resolveContextFiles(appRoot, testsRoot, files) {
|
|
84
|
+
const resolved = [];
|
|
85
|
+
const seen = new Set();
|
|
86
|
+
const maxCharsPerFile = 12000;
|
|
87
|
+
const maxTotalChars = 30000;
|
|
88
|
+
let totalChars = 0;
|
|
89
|
+
for (const file of files) {
|
|
90
|
+
const candidates = (0, path_1.isAbsolute)(file)
|
|
91
|
+
? [file]
|
|
92
|
+
: [(0, path_1.join)(testsRoot, file), (0, path_1.join)(appRoot, file)];
|
|
93
|
+
for (const candidate of candidates) {
|
|
94
|
+
const normalized = (0, utils_js_1.normalizePath)(candidate);
|
|
95
|
+
if (seen.has(normalized) || !(0, fs_1.existsSync)(candidate)) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
const content = (0, fs_1.readFileSync)(candidate, 'utf-8');
|
|
99
|
+
const trimmed = content.trim();
|
|
100
|
+
if (!trimmed) {
|
|
101
|
+
seen.add(normalized);
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
const remaining = Math.max(0, maxTotalChars - totalChars);
|
|
105
|
+
if (remaining <= 0) {
|
|
106
|
+
return resolved;
|
|
107
|
+
}
|
|
108
|
+
const clipped = trimmed.slice(0, Math.min(maxCharsPerFile, remaining));
|
|
109
|
+
resolved.push({ path: normalized, content: clipped });
|
|
110
|
+
seen.add(normalized);
|
|
111
|
+
totalChars += clipped.length;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return resolved;
|
|
116
|
+
}
|
|
117
|
+
function flowKeywords(flow) {
|
|
118
|
+
return (0, utils_js_1.uniqueTokens)([
|
|
119
|
+
...(0, utils_js_1.tokenize)(flow.id || ''),
|
|
120
|
+
...(0, utils_js_1.tokenize)(flow.name || ''),
|
|
121
|
+
...(flow.keywords || []),
|
|
122
|
+
]).filter((keyword) => (keyword.length >= 3 &&
|
|
123
|
+
!LOW_SIGNAL_FLOW_KEYWORDS.has(keyword))).slice(0, 18);
|
|
124
|
+
}
|
|
125
|
+
function matchedFlowKeywords(flow, testPath) {
|
|
126
|
+
const haystack = testPath.toLowerCase();
|
|
127
|
+
return flowKeywords(flow).filter((keyword) => keyword && haystack.includes(keyword.toLowerCase()));
|
|
128
|
+
}
|
|
129
|
+
function scoreTestPath(flow, testPath) {
|
|
130
|
+
return matchedFlowKeywords(flow, testPath).length;
|
|
131
|
+
}
|
|
132
|
+
function isStrongCandidateMatch(flow, matchedKeywords) {
|
|
133
|
+
if (matchedKeywords.length >= 2) {
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
if (matchedKeywords.length !== 1) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
const keywords = flowKeywords(flow);
|
|
140
|
+
return keywords.length === 1 && matchedKeywords[0].length >= MIN_SINGLE_KEYWORD_LENGTH;
|
|
141
|
+
}
|
|
142
|
+
function selectCandidateTests(flows, tests, maxCandidateTests) {
|
|
143
|
+
const selected = new Set();
|
|
144
|
+
const byFlow = new Map();
|
|
145
|
+
const evidence = [];
|
|
146
|
+
const warnings = [];
|
|
147
|
+
const normalizedTests = tests.map((test) => (0, utils_js_1.normalizePath)(test.path)).filter(Boolean);
|
|
148
|
+
const perFlowLimit = Math.max(2, Math.min(6, Math.floor(maxCandidateTests / Math.max(1, flows.length))));
|
|
149
|
+
for (const flow of flows) {
|
|
150
|
+
const scored = [];
|
|
151
|
+
for (const testPath of normalizedTests) {
|
|
152
|
+
const matchedKeywords = matchedFlowKeywords(flow, testPath);
|
|
153
|
+
if (matchedKeywords.length === 0) {
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
scored.push({
|
|
157
|
+
path: testPath,
|
|
158
|
+
score: matchedKeywords.length,
|
|
159
|
+
matchedKeywords,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
const strongCandidates = scored
|
|
163
|
+
.filter((candidate) => isStrongCandidateMatch(flow, candidate.matchedKeywords))
|
|
164
|
+
.sort((a, b) => b.score - a.score || a.path.localeCompare(b.path))
|
|
165
|
+
.slice(0, perFlowLimit);
|
|
166
|
+
if (strongCandidates.length === 0) {
|
|
167
|
+
if (scored.length > 0) {
|
|
168
|
+
warnings.push(`AI mapping withheld weak path-only candidates for ${flow.id}; traceability evidence is required to reuse existing tests.`);
|
|
169
|
+
}
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
byFlow.set(flow.id, new Set(strongCandidates.map((candidate) => candidate.path)));
|
|
173
|
+
evidence.push({ flowId: flow.id, candidates: strongCandidates });
|
|
174
|
+
for (const candidate of strongCandidates) {
|
|
175
|
+
selected.add(candidate.path);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
tests: Array.from(selected).sort((a, b) => a.localeCompare(b)).slice(0, maxCandidateTests),
|
|
180
|
+
byFlow,
|
|
181
|
+
evidence,
|
|
182
|
+
warnings,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function buildCoverage(flows, mapped) {
|
|
186
|
+
return flows.map((flow) => ({
|
|
187
|
+
flowId: flow.id,
|
|
188
|
+
flowName: flow.name,
|
|
189
|
+
priority: flow.priority,
|
|
190
|
+
coveredBy: mapped.get(flow.id) || [],
|
|
191
|
+
score: (mapped.get(flow.id) || []).length,
|
|
192
|
+
source: 'ai',
|
|
193
|
+
}));
|
|
194
|
+
}
|
|
195
|
+
function providerFor(config) {
|
|
196
|
+
if (config.provider === 'auto') {
|
|
197
|
+
return 'auto';
|
|
198
|
+
}
|
|
199
|
+
return config.provider;
|
|
200
|
+
}
|
|
201
|
+
async function mapAITestsToFlows(appRoot, testsRoot, config, flows, tests) {
|
|
202
|
+
const warnings = [];
|
|
203
|
+
const providerName = providerFor(config);
|
|
204
|
+
if (!config.enabled) {
|
|
205
|
+
return {
|
|
206
|
+
enabled: false,
|
|
207
|
+
used: false,
|
|
208
|
+
provider: providerName,
|
|
209
|
+
mappedFlows: 0,
|
|
210
|
+
matchedTests: 0,
|
|
211
|
+
coverage: [],
|
|
212
|
+
warnings,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
const prioritizedFlows = [...flows]
|
|
216
|
+
.sort((a, b) => {
|
|
217
|
+
const prioDiff = (PRIORITY_RANK[a.priority] ?? 3) - (PRIORITY_RANK[b.priority] ?? 3);
|
|
218
|
+
if (prioDiff !== 0) {
|
|
219
|
+
return prioDiff;
|
|
220
|
+
}
|
|
221
|
+
return (b.score || 0) - (a.score || 0);
|
|
222
|
+
})
|
|
223
|
+
.slice(0, Math.max(1, config.maxFlowsPerRequest));
|
|
224
|
+
const candidateSelection = selectCandidateTests(prioritizedFlows, tests, Math.max(20, config.maxCandidateTests));
|
|
225
|
+
warnings.push(...candidateSelection.warnings);
|
|
226
|
+
const candidateTests = candidateSelection.tests;
|
|
227
|
+
if (prioritizedFlows.length === 0 || candidateTests.length === 0) {
|
|
228
|
+
warnings.push('AI mapping skipped: no prioritized flows or path-aligned candidate tests were available.');
|
|
229
|
+
return {
|
|
230
|
+
enabled: true,
|
|
231
|
+
used: false,
|
|
232
|
+
provider: providerName,
|
|
233
|
+
mappedFlows: 0,
|
|
234
|
+
matchedTests: 0,
|
|
235
|
+
coverage: [],
|
|
236
|
+
warnings,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
const contextFiles = resolveContextFiles(appRoot, testsRoot, config.contextFiles || []);
|
|
240
|
+
const contextBlock = contextFiles.length > 0
|
|
241
|
+
? contextFiles.map((entry) => `### Context: ${entry.path}\n${entry.content}`).join('\n\n')
|
|
242
|
+
: 'No optional markdown context files were found.';
|
|
243
|
+
if (contextFiles.length === 0) {
|
|
244
|
+
warnings.push('AI mapping context files were not found; continuing without optional markdown context.');
|
|
245
|
+
}
|
|
246
|
+
let provider;
|
|
247
|
+
try {
|
|
248
|
+
provider = config.provider === 'auto'
|
|
249
|
+
? await provider_factory_js_1.LLMProviderFactory.createFromEnv()
|
|
250
|
+
: provider_factory_js_1.LLMProviderFactory.createFromString(config.provider);
|
|
251
|
+
}
|
|
252
|
+
catch (error) {
|
|
253
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
254
|
+
warnings.push(`AI mapping unavailable (${providerName}): ${message}`);
|
|
255
|
+
return {
|
|
256
|
+
enabled: true,
|
|
257
|
+
used: false,
|
|
258
|
+
provider: providerName,
|
|
259
|
+
mappedFlows: 0,
|
|
260
|
+
matchedTests: 0,
|
|
261
|
+
coverage: [],
|
|
262
|
+
warnings,
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
const prompt = [
|
|
266
|
+
'You are an expert Mattermost E2E test impact analyst.',
|
|
267
|
+
'Map impacted flows to existing Playwright test file paths.',
|
|
268
|
+
'Only use tests from CANDIDATE_TESTS. Never invent paths.',
|
|
269
|
+
'Prefer no mapping over a broad or generic mapping.',
|
|
270
|
+
'Return strict JSON only with this shape:',
|
|
271
|
+
'{"mappings":[{"flowId":"<flow id>","tests":["specs/..."],"reason":"short reason","confidence":0.0}]}',
|
|
272
|
+
'',
|
|
273
|
+
'Rules:',
|
|
274
|
+
'- Keep at most 5 tests per flow.',
|
|
275
|
+
'- Use exact flowId values from FLOWS.',
|
|
276
|
+
'- Only map a test when its path clearly matches the flow scenario. Generic subsystem similarity is not enough.',
|
|
277
|
+
'- A flow may only map to tests listed under FLOW_CANDIDATE_SIGNALS for that flow.',
|
|
278
|
+
'- Treat single-keyword or broad subsystem overlap as insufficient evidence.',
|
|
279
|
+
'- If the candidate path overlap is weak or ambiguous, return tests: [].',
|
|
280
|
+
'- If unsure for a flow, return tests: [].',
|
|
281
|
+
'',
|
|
282
|
+
`FLOWS (${prioritizedFlows.length}):`,
|
|
283
|
+
JSON.stringify(prioritizedFlows.map((flow) => ({
|
|
284
|
+
flowId: flow.id,
|
|
285
|
+
name: flow.name,
|
|
286
|
+
priority: flow.priority,
|
|
287
|
+
score: flow.score,
|
|
288
|
+
files: (flow.files || []).slice(0, 5),
|
|
289
|
+
keywords: flowKeywords(flow),
|
|
290
|
+
})), null, 2),
|
|
291
|
+
'',
|
|
292
|
+
`CANDIDATE_TESTS (${candidateTests.length}):`,
|
|
293
|
+
JSON.stringify(candidateTests, null, 2),
|
|
294
|
+
'',
|
|
295
|
+
`FLOW_CANDIDATE_SIGNALS (${candidateSelection.evidence.length}):`,
|
|
296
|
+
JSON.stringify(candidateSelection.evidence, null, 2),
|
|
297
|
+
'',
|
|
298
|
+
contextBlock,
|
|
299
|
+
].join('\n');
|
|
300
|
+
let parsed = null;
|
|
301
|
+
try {
|
|
302
|
+
const response = await provider.generateText(prompt, {
|
|
303
|
+
maxTokens: Math.max(500, config.maxTokens),
|
|
304
|
+
temperature: Math.max(0, Math.min(1, config.temperature)),
|
|
305
|
+
systemPrompt: 'Return only valid JSON. Do not include markdown fences unless necessary.',
|
|
306
|
+
});
|
|
307
|
+
parsed = extractJson(response.text);
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
311
|
+
warnings.push(`AI mapping request failed (${provider.name}): ${message}`);
|
|
312
|
+
return {
|
|
313
|
+
enabled: true,
|
|
314
|
+
used: false,
|
|
315
|
+
provider: provider.name,
|
|
316
|
+
mappedFlows: 0,
|
|
317
|
+
matchedTests: 0,
|
|
318
|
+
coverage: [],
|
|
319
|
+
warnings,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
if (!parsed) {
|
|
323
|
+
warnings.push(`AI mapping returned invalid JSON (${provider.name}).`);
|
|
324
|
+
return {
|
|
325
|
+
enabled: true,
|
|
326
|
+
used: false,
|
|
327
|
+
provider: provider.name,
|
|
328
|
+
mappedFlows: 0,
|
|
329
|
+
matchedTests: 0,
|
|
330
|
+
coverage: [],
|
|
331
|
+
warnings,
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
const allowedFlowIds = new Set(prioritizedFlows.map((flow) => flow.id));
|
|
335
|
+
const prioritizedFlowsById = new Map(prioritizedFlows.map((flow) => [flow.id, flow]));
|
|
336
|
+
const mapped = new Map();
|
|
337
|
+
const matchedTests = new Set();
|
|
338
|
+
for (const entry of parsed.mappings) {
|
|
339
|
+
if (!entry || !allowedFlowIds.has(entry.flowId) || !Array.isArray(entry.tests)) {
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
const flow = prioritizedFlowsById.get(entry.flowId);
|
|
343
|
+
const confidence = typeof entry.confidence === 'number' ? entry.confidence : undefined;
|
|
344
|
+
const allowedTestsForFlow = candidateSelection.byFlow.get(entry.flowId);
|
|
345
|
+
const valid = Array.from(new Set(entry.tests
|
|
346
|
+
.map((testPath) => (0, utils_js_1.normalizePath)(testPath))
|
|
347
|
+
.filter((testPath) => allowedTestsForFlow?.has(testPath))
|
|
348
|
+
.filter((testPath) => (flow ? scoreTestPath(flow, testPath) > 0 : true)))).slice(0, 5);
|
|
349
|
+
if (confidence !== undefined && confidence < 0.5) {
|
|
350
|
+
warnings.push(`AI mapping rejected low-confidence result for ${entry.flowId} (${confidence}).`);
|
|
351
|
+
continue;
|
|
352
|
+
}
|
|
353
|
+
if (valid.length === 0) {
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
356
|
+
mapped.set(entry.flowId, valid);
|
|
357
|
+
for (const testPath of valid) {
|
|
358
|
+
matchedTests.add(testPath);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
const coverage = buildCoverage(flows, mapped);
|
|
362
|
+
if (mapped.size === 0) {
|
|
363
|
+
warnings.push(`AI mapping returned no valid test mappings (${provider.name}).`);
|
|
364
|
+
}
|
|
365
|
+
return {
|
|
366
|
+
enabled: true,
|
|
367
|
+
used: mapped.size > 0,
|
|
368
|
+
provider: provider.name,
|
|
369
|
+
mappedFlows: mapped.size,
|
|
370
|
+
matchedTests: matchedTests.size,
|
|
371
|
+
coverage,
|
|
372
|
+
warnings,
|
|
373
|
+
};
|
|
374
|
+
}
|
package/dist/agent/config.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type AnalysisMode = 'impact' | 'gap';
|
|
2
2
|
export type FrameworkType = 'auto' | 'playwright' | 'cypress' | 'selenium' | 'unknown';
|
|
3
3
|
export type ArtifactMode = 'commit' | 'keep-local' | 'none';
|
|
4
|
+
export type AnalysisProfile = 'default' | 'mattermost';
|
|
4
5
|
export interface BudgetConfig {
|
|
5
6
|
maxUSD?: number;
|
|
6
7
|
maxTokens?: number;
|
|
@@ -54,6 +55,9 @@ export interface PipelineConfig {
|
|
|
54
55
|
dryRun?: boolean;
|
|
55
56
|
mcp?: boolean;
|
|
56
57
|
mcpAllowFallback?: boolean;
|
|
58
|
+
mcpOnly?: boolean;
|
|
59
|
+
mcpCommandTimeoutMs?: number;
|
|
60
|
+
mcpRetries?: number;
|
|
57
61
|
}
|
|
58
62
|
export interface LLMConfig {
|
|
59
63
|
provider?: string;
|
|
@@ -93,12 +97,33 @@ export interface SubsystemRiskImpactConfig {
|
|
|
93
97
|
mapPath: string;
|
|
94
98
|
maxRulesPerFile: number;
|
|
95
99
|
}
|
|
100
|
+
export type AIMappingProvider = 'anthropic' | 'openai' | 'ollama' | 'auto';
|
|
101
|
+
export interface AIMappingImpactConfig {
|
|
102
|
+
enabled: boolean;
|
|
103
|
+
provider: AIMappingProvider;
|
|
104
|
+
contextFiles: string[];
|
|
105
|
+
maxFlowsPerRequest: number;
|
|
106
|
+
maxCandidateTests: number;
|
|
107
|
+
maxTokens: number;
|
|
108
|
+
temperature: number;
|
|
109
|
+
}
|
|
110
|
+
export interface AIFlowImpactConfig {
|
|
111
|
+
enabled: boolean;
|
|
112
|
+
strict: boolean;
|
|
113
|
+
provider: AIMappingProvider;
|
|
114
|
+
contextFiles: string[];
|
|
115
|
+
maxFilesPerRequest: number;
|
|
116
|
+
maxFlowsPerRequest: number;
|
|
117
|
+
maxTokens: number;
|
|
118
|
+
temperature: number;
|
|
119
|
+
}
|
|
96
120
|
export interface GitConfig {
|
|
97
121
|
since: string;
|
|
98
122
|
includeUncommitted?: boolean;
|
|
99
123
|
}
|
|
100
124
|
export interface AgentConfig {
|
|
101
125
|
path: string;
|
|
126
|
+
profile: AnalysisProfile;
|
|
102
127
|
testsRoot?: string;
|
|
103
128
|
flowCatalogPath?: string;
|
|
104
129
|
mode: AnalysisMode;
|
|
@@ -115,6 +140,8 @@ export interface AgentConfig {
|
|
|
115
140
|
dependencyGraph: DependencyGraphImpactConfig;
|
|
116
141
|
traceability: TraceabilityImpactConfig;
|
|
117
142
|
subsystemRisk: SubsystemRiskImpactConfig;
|
|
143
|
+
aiFlow: AIFlowImpactConfig;
|
|
144
|
+
aiMapping: AIMappingImpactConfig;
|
|
118
145
|
};
|
|
119
146
|
pipeline: PipelineConfig;
|
|
120
147
|
llm: LLMConfig;
|
|
@@ -133,6 +160,7 @@ export interface ResolvedConfig {
|
|
|
133
160
|
}
|
|
134
161
|
export interface ConfigOverrides {
|
|
135
162
|
path?: string;
|
|
163
|
+
profile?: AnalysisProfile;
|
|
136
164
|
testsRoot?: string;
|
|
137
165
|
flowCatalogPath?: string;
|
|
138
166
|
mode?: AnalysisMode;
|
|
@@ -146,6 +174,8 @@ export interface ConfigOverrides {
|
|
|
146
174
|
gitSince?: string;
|
|
147
175
|
pipeline?: Partial<PipelineConfig>;
|
|
148
176
|
policy?: Partial<PolicyConfig>;
|
|
177
|
+
llmProvider?: string;
|
|
178
|
+
llmFallback?: string;
|
|
149
179
|
}
|
|
150
180
|
export declare function resolveConfig(cwd: string, configPath?: string, overrides?: ConfigOverrides): ResolvedConfig;
|
|
151
181
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/agent/config.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,KAAK,CAAC;AAC5C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AACvF,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/agent/config.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,KAAK,CAAC;AAC5C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AACvF,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;AAC5D,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,YAAY,CAAC;AAEvD,MAAM,WAAW,YAAY;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC3B,YAAY,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAChC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IA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