File size: 2,522 Bytes
40d7073
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/**
 * Coverage Router - Test coverage-aware agent routing
 *
 * Uses test coverage data to make smarter routing decisions:
 * - Prioritize testing for uncovered code
 * - Route to tester agent for low-coverage files
 * - Suggest test files for modified code
 */
export interface CoverageData {
    file: string;
    lines: {
        total: number;
        covered: number;
        percentage: number;
    };
    functions: {
        total: number;
        covered: number;
        percentage: number;
    };
    branches: {
        total: number;
        covered: number;
        percentage: number;
    };
    uncoveredLines: number[];
    uncoveredFunctions: string[];
}
export interface CoverageSummary {
    files: Map<string, CoverageData>;
    overall: {
        lines: number;
        functions: number;
        branches: number;
    };
    lowCoverageFiles: string[];
    uncoveredFiles: string[];
}
export interface TestSuggestion {
    file: string;
    testFile: string;
    reason: string;
    priority: 'high' | 'medium' | 'low';
    coverage: number;
    uncoveredFunctions: string[];
}
/**
 * Parse Istanbul/NYC JSON coverage report
 */
export declare function parseIstanbulCoverage(coveragePath: string): CoverageSummary;
/**
 * Find coverage report in project
 */
export declare function findCoverageReport(projectRoot?: string): string | null;
/**
 * Get coverage data for a specific file
 */
export declare function getFileCoverage(file: string, summary?: CoverageSummary): CoverageData | null;
/**
 * Suggest tests for files based on coverage
 */
export declare function suggestTests(files: string[], summary?: CoverageSummary): TestSuggestion[];
/**
 * Determine if a file needs the tester agent based on coverage
 */
export declare function shouldRouteToTester(file: string, summary?: CoverageSummary): {
    route: boolean;
    reason: string;
    coverage: number;
};
/**
 * Get coverage-aware routing weight for agent selection
 */
export declare function getCoverageRoutingWeight(file: string, summary?: CoverageSummary): {
    coder: number;
    tester: number;
    reviewer: number;
};
declare const _default: {
    parseIstanbulCoverage: typeof parseIstanbulCoverage;
    findCoverageReport: typeof findCoverageReport;
    getFileCoverage: typeof getFileCoverage;
    suggestTests: typeof suggestTests;
    shouldRouteToTester: typeof shouldRouteToTester;
    getCoverageRoutingWeight: typeof getCoverageRoutingWeight;
};
export default _default;
//# sourceMappingURL=coverage-router.d.ts.map