codeguard-testgen 1.0.15 ā 1.0.16
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 +157 -1034
- package/dist/ai.d.ts +8 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +332 -0
- package/dist/ai.js.map +1 -0
- package/dist/ast.d.ts +8 -0
- package/dist/ast.d.ts.map +1 -0
- package/dist/ast.js +988 -0
- package/dist/ast.js.map +1 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/git.d.ts +18 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +208 -0
- package/dist/git.js.map +1 -0
- package/dist/globals.d.ts +24 -0
- package/dist/globals.d.ts.map +1 -0
- package/dist/globals.js +40 -0
- package/dist/globals.js.map +1 -0
- package/dist/index.d.ts +9 -54
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +85 -5442
- package/dist/index.js.map +1 -1
- package/dist/pathResolver.d.ts +12 -0
- package/dist/pathResolver.d.ts.map +1 -0
- package/dist/pathResolver.js +44 -0
- package/dist/pathResolver.js.map +1 -0
- package/dist/reviewer.d.ts +13 -0
- package/dist/reviewer.d.ts.map +1 -0
- package/dist/reviewer.js +402 -0
- package/dist/reviewer.js.map +1 -0
- package/dist/testGenerator.d.ts +24 -0
- package/dist/testGenerator.d.ts.map +1 -0
- package/dist/testGenerator.js +1107 -0
- package/dist/testGenerator.js.map +1 -0
- package/dist/toolDefinitions.d.ts +6 -0
- package/dist/toolDefinitions.d.ts.map +1 -0
- package/dist/toolDefinitions.js +370 -0
- package/dist/toolDefinitions.js.map +1 -0
- package/dist/toolHandlers.d.ts +76 -0
- package/dist/toolHandlers.d.ts.map +1 -0
- package/dist/toolHandlers.js +1430 -0
- package/dist/toolHandlers.js.map +1 -0
- package/dist/types.d.ts +74 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +2 -5
package/dist/reviewer.js
ADDED
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reviewChangedFiles = reviewChangedFiles;
|
|
4
|
+
exports.generateUnifiedCodeReview = generateUnifiedCodeReview;
|
|
5
|
+
const fs = require("fs/promises");
|
|
6
|
+
const fsSync = require("fs");
|
|
7
|
+
const path = require("path");
|
|
8
|
+
const globals_1 = require("./globals");
|
|
9
|
+
const ai_1 = require("./ai");
|
|
10
|
+
const toolHandlers_1 = require("./toolHandlers");
|
|
11
|
+
const toolDefinitions_1 = require("./toolDefinitions");
|
|
12
|
+
const git_1 = require("./git");
|
|
13
|
+
/**
|
|
14
|
+
* Review code changes for quality, bugs, performance, and security issues
|
|
15
|
+
*/
|
|
16
|
+
async function reviewChangedFiles() {
|
|
17
|
+
(0, globals_1.updateSpinner)('š Scanning git changes for review...');
|
|
18
|
+
try {
|
|
19
|
+
const { fullDiff, files } = await (0, git_1.getGitDiff)();
|
|
20
|
+
if (files.length === 0) {
|
|
21
|
+
(0, globals_1.stopSpinner)();
|
|
22
|
+
console.log('ā
No changes detected in source files.');
|
|
23
|
+
console.log(' (Only staged and unstaged changes are checked)');
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
globals_1.g.globalSpinner.text = `Found changes in ${files.length} file(s) to review`;
|
|
27
|
+
await new Promise(resolve => setTimeout(resolve, 200));
|
|
28
|
+
const filesToReview = [];
|
|
29
|
+
for (const fileInfo of files) {
|
|
30
|
+
const { filePath, diff } = fileInfo;
|
|
31
|
+
if (!fsSync.existsSync(filePath)) {
|
|
32
|
+
(0, globals_1.updateSpinner)(`āļø Skipping ${filePath} (file not found)`);
|
|
33
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
(0, globals_1.updateSpinner)(`š Analyzing: ${filePath}`);
|
|
37
|
+
const changedFunctions = await (0, git_1.getChangedFunctionsFromDiff)(filePath, diff);
|
|
38
|
+
if (changedFunctions.length === 0) {
|
|
39
|
+
globals_1.g.globalSpinner.text = `āļø No exported functions changed in ${path.basename(filePath)}`;
|
|
40
|
+
await new Promise(resolve => setTimeout(resolve, 150));
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
globals_1.g.globalSpinner.text = `Found ${changedFunctions.length} changed function(s) in ${path.basename(filePath)}`;
|
|
44
|
+
await new Promise(resolve => setTimeout(resolve, 200));
|
|
45
|
+
filesToReview.push({ filePath, diff, functions: changedFunctions });
|
|
46
|
+
}
|
|
47
|
+
if (filesToReview.length === 0) {
|
|
48
|
+
console.log('\nā
No functions to review.');
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
await generateUnifiedCodeReview(filesToReview);
|
|
53
|
+
(0, globals_1.stopSpinner)();
|
|
54
|
+
console.log('\nā
Code review completed!');
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
console.error(`\nā Error during review: ${error.message}`);
|
|
58
|
+
}
|
|
59
|
+
console.log('\n' + '='.repeat(60));
|
|
60
|
+
console.log('š Code Review Summary');
|
|
61
|
+
console.log('='.repeat(60));
|
|
62
|
+
console.log(`ā
Files reviewed: ${filesToReview.length}`);
|
|
63
|
+
console.log(`š Total functions: ${filesToReview.reduce((sum, f) => sum + f.functions.length, 0)}`);
|
|
64
|
+
console.log(`š Review saved to: reviews/code_review.md`);
|
|
65
|
+
console.log('='.repeat(60));
|
|
66
|
+
console.log('\n⨠Done!');
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
if (error.message === 'Not a git repository') {
|
|
70
|
+
console.error('ā Error: Not a git repository');
|
|
71
|
+
console.error(' Review mode requires git to detect changes.');
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Build AI prompt for a specific review step based on its ruleset
|
|
79
|
+
*/
|
|
80
|
+
async function buildStepPrompt(step, filesToReview, stepOutputPath) {
|
|
81
|
+
const filesContext = filesToReview.map(f => `- ${f.filePath}: ${f.functions.join(', ')}`).join('\n');
|
|
82
|
+
const totalFunctions = filesToReview.reduce((sum, f) => sum + f.functions.length, 0);
|
|
83
|
+
const rulesetPath = path.join(process.cwd(), 'codeguard-ruleset', step.ruleset);
|
|
84
|
+
let rulesetContent;
|
|
85
|
+
try {
|
|
86
|
+
rulesetContent = await fs.readFile(rulesetPath, 'utf-8');
|
|
87
|
+
if (globals_1.g.globalSpinner && globals_1.g.globalSpinner.isSpinning) {
|
|
88
|
+
globals_1.g.globalSpinner.text = `š Loaded ruleset: ${step.ruleset}`;
|
|
89
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
(0, globals_1.stopSpinner)();
|
|
94
|
+
console.warn(`ā ļø Could not read ruleset file: ${rulesetPath}`);
|
|
95
|
+
console.warn(` Using default ruleset message. Error: ${error.message}`);
|
|
96
|
+
rulesetContent = `Please review the code for ${step.name} following industry best practices.`;
|
|
97
|
+
}
|
|
98
|
+
return `You are a senior software engineer conducting a focused code review for: **${step.name}**
|
|
99
|
+
|
|
100
|
+
## CONTEXT
|
|
101
|
+
Review Focus: ${step.name}
|
|
102
|
+
Category: ${step.category}
|
|
103
|
+
Total files changed: ${filesToReview.length}
|
|
104
|
+
Total functions changed: ${totalFunctions}
|
|
105
|
+
|
|
106
|
+
Changed files and functions:
|
|
107
|
+
${filesContext}
|
|
108
|
+
|
|
109
|
+
## GIT DIFFS
|
|
110
|
+
|
|
111
|
+
${filesToReview.map(f => `### ${f.filePath}
|
|
112
|
+
\`\`\`diff
|
|
113
|
+
${f.diff}
|
|
114
|
+
\`\`\`
|
|
115
|
+
`).join('\n')}
|
|
116
|
+
|
|
117
|
+
## YOUR TASK
|
|
118
|
+
Conduct a focused code review ONLY for ${step.name}. Use the available tools to analyze the code thoroughly.
|
|
119
|
+
Must complete and write the review within 1 minutes. Your review should be brief and to the point.
|
|
120
|
+
|
|
121
|
+
## ANALYSIS STEPS
|
|
122
|
+
|
|
123
|
+
**Phase 1: Code Analysis (MANDATORY)**
|
|
124
|
+
For each changed file:
|
|
125
|
+
1. analyze_file_ast(filePath) ā Get file structure and all functions
|
|
126
|
+
- OR use analyze_file_ast(filePath, functionName) for specific function reviews (token-efficient)
|
|
127
|
+
2. For each changed function:
|
|
128
|
+
- get_function_ast(filePath, functionName) ā Get implementation details
|
|
129
|
+
3. get_imports_ast(filePath) ā Understand dependencies
|
|
130
|
+
4. get_type_definitions(filePath) ā Review type safety
|
|
131
|
+
5. Use search_codebase() if needed to understand usage patterns
|
|
132
|
+
6. Use tools to analyze the code thoroughly. -> Where the functions is used and what all dependencies are there that call this function? What can be potential issues with the code?
|
|
133
|
+
|
|
134
|
+
**Phase 2: Review Analysis for ${step.name}**
|
|
135
|
+
|
|
136
|
+
Review the code against the following ruleset:
|
|
137
|
+
|
|
138
|
+
${rulesetContent}
|
|
139
|
+
|
|
140
|
+
Also give attention to any industry specific points that are not covered by the ruleset for ${step.name}.
|
|
141
|
+
|
|
142
|
+
**Phase 3: Write Review**
|
|
143
|
+
|
|
144
|
+
Use the write_review tool to save findings to: ${stepOutputPath}
|
|
145
|
+
|
|
146
|
+
## OUTPUT FORMAT
|
|
147
|
+
|
|
148
|
+
Your review MUST be in markdown format with the following structure:
|
|
149
|
+
|
|
150
|
+
\`\`\`markdown
|
|
151
|
+
# ${step.name}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
## Findings
|
|
155
|
+
|
|
156
|
+
### š“ Critical Issues
|
|
157
|
+
|
|
158
|
+
#### [Issue Title]
|
|
159
|
+
**File**: \`filePath\`
|
|
160
|
+
**Function**: \`functionName\`
|
|
161
|
+
**Severity**: Critical
|
|
162
|
+
|
|
163
|
+
**Issue**:
|
|
164
|
+
[Description]
|
|
165
|
+
|
|
166
|
+
**Current Code**:
|
|
167
|
+
\`\`\`typescript
|
|
168
|
+
// problematic code
|
|
169
|
+
\`\`\`
|
|
170
|
+
|
|
171
|
+
**Recommended Code**:
|
|
172
|
+
\`\`\`typescript
|
|
173
|
+
// improved code
|
|
174
|
+
\`\`\`
|
|
175
|
+
|
|
176
|
+
**Rationale**:
|
|
177
|
+
[Why this is important]
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
### š High Priority Issues
|
|
182
|
+
[Same format as above]
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
### š” Medium Priority Issues
|
|
187
|
+
[Same format as above]
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Positive Aspects
|
|
192
|
+
[What was done well in this area]
|
|
193
|
+
|
|
194
|
+
## Recommendations
|
|
195
|
+
[Specific recommendations for ${step.name}]
|
|
196
|
+
\`\`\`
|
|
197
|
+
|
|
198
|
+
## CRITICAL REMINDERS
|
|
199
|
+
|
|
200
|
+
- ALWAYS use tools to analyze code before reviewing
|
|
201
|
+
- Focus ONLY on ${step.name} - do not review other aspects
|
|
202
|
+
- Be specific and actionable
|
|
203
|
+
- Include code examples
|
|
204
|
+
- Use write_review tool to save to: ${stepOutputPath}
|
|
205
|
+
- Must complete within 30 seconds
|
|
206
|
+
- Use avaiable tools extensively to analyze the code.
|
|
207
|
+
- The review should be based on the ruleset, it should be to the point without too much text.
|
|
208
|
+
- Before writing the review, make sure to analyze the code thoroughly using the tools available, how similar code is used in the codebase.
|
|
209
|
+
- Keep the review short and to the point, do not write too much text.
|
|
210
|
+
|
|
211
|
+
**START**: Begin by calling analyze_file_ast on each changed file.`;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Execute a single review step with AI
|
|
215
|
+
*/
|
|
216
|
+
async function executeReviewStep(step, filesToReview, stepOutputPath) {
|
|
217
|
+
try {
|
|
218
|
+
const prompt = await buildStepPrompt(step, filesToReview, stepOutputPath);
|
|
219
|
+
const messages = [
|
|
220
|
+
{
|
|
221
|
+
role: 'user',
|
|
222
|
+
content: prompt
|
|
223
|
+
}
|
|
224
|
+
];
|
|
225
|
+
let iterations = 0;
|
|
226
|
+
const maxIterations = 30;
|
|
227
|
+
let reviewWritten = false;
|
|
228
|
+
while (iterations < maxIterations) {
|
|
229
|
+
iterations++;
|
|
230
|
+
const response = await (0, ai_1.callAI)(messages, toolDefinitions_1.TOOLS_FOR_CODE_REVIEW, globals_1.g.CONFIG.aiProvider);
|
|
231
|
+
if (response.content) {
|
|
232
|
+
const content = typeof response.content === 'string' ? response.content : JSON.stringify(response.content);
|
|
233
|
+
messages.push({ role: 'assistant', content });
|
|
234
|
+
if (typeof content === 'string' && (content.toLowerCase().includes('review complete') ||
|
|
235
|
+
content.toLowerCase().includes('review has been written'))) {
|
|
236
|
+
if (reviewWritten) {
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
if (!response.toolCalls || response.toolCalls.length === 0) {
|
|
242
|
+
if (reviewWritten) {
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
messages.push({
|
|
246
|
+
role: 'user',
|
|
247
|
+
content: `Please use the write_review tool NOW to save your ${step.name} review to ${stepOutputPath}. Include all findings with severity levels and code examples.`
|
|
248
|
+
});
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
const toolResults = [];
|
|
252
|
+
for (const toolCall of response.toolCalls) {
|
|
253
|
+
const toolResult = await (0, toolHandlers_1.executeTool)(toolCall.name, toolCall.input);
|
|
254
|
+
toolResults.push({ id: toolCall.id, name: toolCall.name, result: toolResult });
|
|
255
|
+
if (toolCall.name === 'write_review' && toolResult.success) {
|
|
256
|
+
reviewWritten = true;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
(0, ai_1.addToolResultsToMessages)(globals_1.g.CONFIG.aiProvider, messages, response.toolCalls, toolResults);
|
|
260
|
+
}
|
|
261
|
+
if (!reviewWritten) {
|
|
262
|
+
throw new Error(`Could not complete ${step.name} review within iteration limit`);
|
|
263
|
+
}
|
|
264
|
+
console.log(` ā
${step.name} review completed`);
|
|
265
|
+
return { success: true, stepId: step.id, stepName: step.name };
|
|
266
|
+
}
|
|
267
|
+
catch (error) {
|
|
268
|
+
console.error(` ā ${step.name} review failed: ${error.message}`);
|
|
269
|
+
return { success: false, error: error.message, stepId: step.id, stepName: step.name };
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Merge review results from multiple steps into a single unified review
|
|
274
|
+
*/
|
|
275
|
+
async function mergeReviewResults(stepResults, filesToReview, finalOutputPath) {
|
|
276
|
+
const timestamp = new Date().toISOString().split('T')[0];
|
|
277
|
+
const totalFunctions = filesToReview.reduce((sum, f) => sum + f.functions.length, 0);
|
|
278
|
+
let mergedReview = `# Code Review
|
|
279
|
+
|
|
280
|
+
**Date**: ${timestamp}
|
|
281
|
+
**Reviewer**: AI Code Review System
|
|
282
|
+
**Files Changed**: ${filesToReview.length}
|
|
283
|
+
**Functions Changed**: ${totalFunctions}
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Summary
|
|
288
|
+
|
|
289
|
+
This review covers ${filesToReview.length} file(s) with ${totalFunctions} changed function(s). The review was conducted across multiple aspects: ${stepResults.map(r => r.stepName).join(', ')}.
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## Files Changed
|
|
294
|
+
|
|
295
|
+
${filesToReview.map(f => `- **${f.filePath}**
|
|
296
|
+
- Functions: ${f.functions.join(', ')}`).join('\n')}
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
`;
|
|
301
|
+
for (const result of stepResults) {
|
|
302
|
+
const stepFilePath = path.join('reviews', '.tmp', `step-${result.stepId}.md`);
|
|
303
|
+
if (result.success) {
|
|
304
|
+
try {
|
|
305
|
+
if (fsSync.existsSync(stepFilePath)) {
|
|
306
|
+
const stepContent = await fs.readFile(stepFilePath, 'utf-8');
|
|
307
|
+
const lines = stepContent.split('\n');
|
|
308
|
+
let contentStart = 0;
|
|
309
|
+
for (let i = 0; i < lines.length; i++) {
|
|
310
|
+
if (lines[i].startsWith('# ')) {
|
|
311
|
+
contentStart = i + 1;
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
const content = lines.slice(contentStart).join('\n').trim();
|
|
316
|
+
mergedReview += `## ${result.stepName}\n\n${content}\n\n---\n\n`;
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
mergedReview += `## ${result.stepName}\n\nā ļø Review file not found.\n\n---\n\n`;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
catch (error) {
|
|
323
|
+
mergedReview += `## ${result.stepName}\n\nā ļø Error reading review: ${error.message}\n\n---\n\n`;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
mergedReview += `## ${result.stepName}\n\nā **Review step failed**: ${result.error}\n\n---\n\n`;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
mergedReview += `## Conclusion
|
|
331
|
+
|
|
332
|
+
This comprehensive review analyzed the code changes from multiple perspectives. Please address the findings based on their severity levels, starting with critical issues.
|
|
333
|
+
|
|
334
|
+
The review was conducted using AI-powered analysis with access to the full codebase context.
|
|
335
|
+
`;
|
|
336
|
+
const reviewsDir = path.dirname(finalOutputPath);
|
|
337
|
+
if (!fsSync.existsSync(reviewsDir)) {
|
|
338
|
+
await fs.mkdir(reviewsDir, { recursive: true });
|
|
339
|
+
}
|
|
340
|
+
await fs.writeFile(finalOutputPath, mergedReview, 'utf-8');
|
|
341
|
+
console.log(`\nā
Merged review written to: ${finalOutputPath}`);
|
|
342
|
+
try {
|
|
343
|
+
const tmpDir = path.join('reviews', '.tmp');
|
|
344
|
+
if (fsSync.existsSync(tmpDir)) {
|
|
345
|
+
const tmpFiles = await fs.readdir(tmpDir);
|
|
346
|
+
for (const file of tmpFiles) {
|
|
347
|
+
await fs.unlink(path.join(tmpDir, file));
|
|
348
|
+
}
|
|
349
|
+
await fs.rmdir(tmpDir);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
catch (error) {
|
|
353
|
+
// Ignore cleanup errors
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Generate unified code review for all changed files
|
|
358
|
+
*/
|
|
359
|
+
async function generateUnifiedCodeReview(filesToReview) {
|
|
360
|
+
const reviewFilePath = path.join('reviews', 'code_review.md');
|
|
361
|
+
const enabledSteps = globals_1.g.CONFIG.reviewSteps.filter(step => step.enabled);
|
|
362
|
+
if (enabledSteps.length === 0) {
|
|
363
|
+
console.log('\nā ļø No review steps enabled. Please enable at least one step in codeguard.json');
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
console.log(`\nš Running ${enabledSteps.length} review step(s): ${enabledSteps.map(s => s.name).join(', ')}`);
|
|
367
|
+
const tmpDir = path.join('reviews', '.tmp');
|
|
368
|
+
if (!fsSync.existsSync(tmpDir)) {
|
|
369
|
+
await fs.mkdir(tmpDir, { recursive: true });
|
|
370
|
+
}
|
|
371
|
+
let stepResults;
|
|
372
|
+
if (globals_1.g.CONFIG.reviewExecutionMode === 'parallel') {
|
|
373
|
+
(0, globals_1.updateSpinner)('š Executing review steps in parallel...');
|
|
374
|
+
const stepPromises = enabledSteps.map(step => {
|
|
375
|
+
const stepOutputPath = path.join('reviews', '.tmp', `step-${step.id}.md`);
|
|
376
|
+
return executeReviewStep(step, filesToReview, stepOutputPath);
|
|
377
|
+
});
|
|
378
|
+
stepResults = await Promise.all(stepPromises);
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
(0, globals_1.updateSpinner)('š Executing review steps sequentially...');
|
|
382
|
+
stepResults = [];
|
|
383
|
+
for (const step of enabledSteps) {
|
|
384
|
+
if (globals_1.g.globalSpinner) {
|
|
385
|
+
globals_1.g.globalSpinner.text = `š Running ${step.name} review step...`;
|
|
386
|
+
}
|
|
387
|
+
const stepOutputPath = path.join('reviews', '.tmp', `step-${step.id}.md`);
|
|
388
|
+
const result = await executeReviewStep(step, filesToReview, stepOutputPath);
|
|
389
|
+
stepResults.push(result);
|
|
390
|
+
if (globals_1.g.globalSpinner && result.success) {
|
|
391
|
+
globals_1.g.globalSpinner.text = `${step.name} review completed`;
|
|
392
|
+
await new Promise(resolve => setTimeout(resolve, 200));
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
await mergeReviewResults(stepResults, filesToReview, reviewFilePath);
|
|
397
|
+
(0, globals_1.stopSpinner)();
|
|
398
|
+
const successCount = stepResults.filter(r => r.success).length;
|
|
399
|
+
const failCount = stepResults.filter(r => !r.success).length;
|
|
400
|
+
console.log(`\nā
Review complete: ${successCount} step(s) succeeded${failCount > 0 ? `, ${failCount} failed` : ''}`);
|
|
401
|
+
}
|
|
402
|
+
//# sourceMappingURL=reviewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviewer.js","sourceRoot":"","sources":["../src/reviewer.ts"],"names":[],"mappings":";;AAcA,gDA2EC;AAkUD,8DA0DC;AArdD,kCAAmC;AACnC,6BAA8B;AAC9B,6BAA8B;AAC9B,uCAA0D;AAC1D,6BAAwD;AACxD,iDAA6C;AAC7C,uDAA0D;AAC1D,+BAAgE;AAIhE;;GAEG;AACI,KAAK,UAAU,kBAAkB;IACtC,IAAA,uBAAa,EAAC,uCAAuC,CAAC,CAAC;IAEvD,IAAI,CAAC;QACH,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,MAAM,IAAA,gBAAU,GAAE,CAAC;QAE/C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,IAAA,qBAAW,GAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,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IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACtC,WAAC,CAAC,aAAa,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,IAAI,mBAAmB,CAAC;gBACvD,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;YACzD,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,kBAAkB,CAAC,WAAW,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;IAErE,IAAA,qBAAW,GAAE,CAAC;IAEd,MAAM,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;IAC/D,MAAM,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;IAE7D,OAAO,CAAC,GAAG,CAAC,wBAAwB,YAAY,qBAAqB,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACvH,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare function listFilesRecursive(dir: string, fileList?: string[]): Promise<string[]>;
|
|
2
|
+
export declare function getTestFilePath(sourceFile: string): string;
|
|
3
|
+
export declare function generateTests(sourceFile: string): Promise<string>;
|
|
4
|
+
export declare function promptUser(question: string): Promise<string>;
|
|
5
|
+
export declare function generateTestsForFolder(): Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Generate tests for a single function
|
|
8
|
+
* @returns true if tests passed, false if legitimate failure reported
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateTestForSingleFunction(sourceFile: string, functionName: string, testFilePath: string, testFileExists: boolean): Promise<boolean>;
|
|
11
|
+
/**
|
|
12
|
+
* Smart validation that fixes failing tests
|
|
13
|
+
*/
|
|
14
|
+
export declare function smartValidateTestSuite(sourceFile: string, testFilePath: string, functionNames: string[]): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Fix failing tests using AI
|
|
17
|
+
*/
|
|
18
|
+
export declare function fixFailingTests(sourceFile: string, testFilePath: string, functionNames: string[], failingTests: string[], fullSuiteOutput: string): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Generate tests for multiple functions, one at a time
|
|
21
|
+
*/
|
|
22
|
+
export declare function generateTestsForFunctions(sourceFile: string, functionNames: string[]): Promise<string>;
|
|
23
|
+
export declare function generateTestsForFunction(): Promise<void>;
|
|
24
|
+
//# sourceMappingURL=testGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testGenerator.d.ts","sourceRoot":"","sources":["../src/testGenerator.ts"],"names":[],"mappings":"AAeA,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAmChG;AAGD,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CA0B1D;AAMD,wBAAsB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAqBvE;AAMD,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAYlE;AAoBD,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAuD5D;AAMD;;;GAGG;AACH,wBAAsB,6BAA6B,CACjD,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,OAAO,GACtB,OAAO,CAAC,OAAO,CAAC,CAkvBlB;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EAAE,G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