| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | export interface DiffHunk { |
| | file: string; |
| | oldStart: number; |
| | oldLines: number; |
| | newStart: number; |
| | newLines: number; |
| | content: string; |
| | additions: string[]; |
| | deletions: string[]; |
| | } |
| | export interface DiffAnalysis { |
| | file: string; |
| | hunks: DiffHunk[]; |
| | totalAdditions: number; |
| | totalDeletions: number; |
| | complexity: number; |
| | riskScore: number; |
| | category: 'feature' | 'bugfix' | 'refactor' | 'docs' | 'test' | 'config' | 'unknown'; |
| | embedding?: number[]; |
| | } |
| | export interface CommitAnalysis { |
| | hash: string; |
| | message: string; |
| | author: string; |
| | date: string; |
| | files: DiffAnalysis[]; |
| | totalAdditions: number; |
| | totalDeletions: number; |
| | riskScore: number; |
| | embedding?: number[]; |
| | } |
| | |
| | |
| | |
| | export declare function parseDiff(diff: string): DiffHunk[]; |
| | |
| | |
| | |
| | export declare function classifyChange(diff: string, message?: string): 'feature' | 'bugfix' | 'refactor' | 'docs' | 'test' | 'config' | 'unknown'; |
| | |
| | |
| | |
| | export declare function calculateRiskScore(analysis: DiffAnalysis): number; |
| | |
| | |
| | |
| | export declare function analyzeFileDiff(file: string, diff: string, message?: string): Promise<DiffAnalysis>; |
| | |
| | |
| | |
| | export declare function getCommitDiff(commitHash?: string): string; |
| | |
| | |
| | |
| | export declare function getStagedDiff(): string; |
| | |
| | |
| | |
| | export declare function getUnstagedDiff(): string; |
| | |
| | |
| | |
| | export declare function analyzeCommit(commitHash?: string): Promise<CommitAnalysis>; |
| | |
| | |
| | |
| | export declare function findSimilarCommits(currentDiff: string, recentCommits?: number, topK?: number): Promise<Array<{ |
| | hash: string; |
| | similarity: number; |
| | message: string; |
| | }>>; |
| | declare const _default: { |
| | parseDiff: typeof parseDiff; |
| | classifyChange: typeof classifyChange; |
| | calculateRiskScore: typeof calculateRiskScore; |
| | analyzeFileDiff: typeof analyzeFileDiff; |
| | analyzeCommit: typeof analyzeCommit; |
| | getCommitDiff: typeof getCommitDiff; |
| | getStagedDiff: typeof getStagedDiff; |
| | getUnstagedDiff: typeof getUnstagedDiff; |
| | findSimilarCommits: typeof findSimilarCommits; |
| | }; |
| | export default _default; |
| | |