-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgenaicode_tracker.ts
More file actions
37 lines (31 loc) · 1.09 KB
/
genaicode_tracker.ts
File metadata and controls
37 lines (31 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { Plugin } from '../../src/index.js';
/**
* Example plugin demonstrating the usage of planning hook with enhanced issue tracking
*/
const genaicodeTracker: Plugin = {
name: 'genaicode-tracker',
// Planning post-hook: Modify the planning result
planningPostHook: async ({ result }) => {
try {
const { getRcConfig } = await import('../../src/index.js');
if (!result) {
return undefined;
}
// Example: Add additional analysis to the problem analysis
const trackerUpdate = result.args!.affectedFiles.find((file) => file.filePath.endsWith('GENAICODE_TRACKER.md'));
if (!trackerUpdate) {
result.args!.affectedFiles.push({
reason: 'Needs to be updated with the new changes',
filePath: (await getRcConfig()).rootDir + '/GENAICODE_TRACKER.md',
dependencies: [],
});
}
return result;
} catch (error) {
console.error('Error in planning post-hook:', error);
// Return undefined to use original result in case of error
return undefined;
}
},
};
export default genaicodeTracker;