export interface DirectoryKnowledge { directory: string; contributors: { email: string; commits: number; percentage: number; }[]; totalCommits: number; busFactor: number; } export interface KnowledgeMapOptions { depth?: number; since?: string; until?: string; maxCommits?: number; pathPattern?: string; timeoutMs?: number; } /** * Analyze knowledge ownership per directory and compute bus factor. * * Bus factor = minimum number of contributors whose cumulative * contribution exceeds 50% of total commits for that directory. */ export declare function analyzeKnowledgeMap(repoPath: string, options?: KnowledgeMapOptions): Promise; /** * Extract directory at the given depth from a file path. * depth=1: "src/tools/foo.ts" -> "src" * depth=2: "src/tools/foo.ts" -> "src/tools" * If path has fewer segments, returns the dirname portion. */ export declare function getDirectoryAtDepth(filePath: string, depth: number): string; /** * Compute bus factor: minimum number of contributors whose cumulative * contribution exceeds 50% of total commits. * Assumes counts are sorted descending. */ export declare function computeBusFactor(sortedCounts: number[], total: number): number;