/** * Repository Mapper * * Combines file walking and significance scoring into a comprehensive "map" * of the repository that guides all subsequent analysis. */ import type { ProjectType, ScoredFile } from '../../types/index.js'; import { type ScoringConfig } from './significance-scorer.js'; /** * Language breakdown in the repository */ export interface LanguageBreakdown { language: string; extension: string; fileCount: number; percentage: number; } /** * Detected framework information */ export interface DetectedFramework { name: string; category: 'frontend' | 'backend' | 'database' | 'testing' | 'auth' | 'ci' | 'other'; confidence: 'high' | 'medium' | 'low'; evidence: string[]; } /** * Directory statistics */ export interface DirectoryStats { path: string; fileCount: number; purpose: string; avgScore: number; } /** * File clusters by domain/layer */ export interface FileClusters { byDirectory: Record; byDomain: Record; byLayer: { presentation: ScoredFile[]; business: ScoredFile[]; data: ScoredFile[]; infrastructure: ScoredFile[]; }; } /** * Repository map metadata */ export interface RepositoryMapMetadata { projectName: string; projectType: ProjectType; rootPath: string; analyzedAt: string; version: string; } /** * Repository map summary */ export interface RepositoryMapSummary { totalFiles: number; analyzedFiles: number; skippedFiles: number; languages: LanguageBreakdown[]; frameworks: DetectedFramework[]; directories: DirectoryStats[]; } /** * Complete repository map */ export interface RepositoryMap { metadata: RepositoryMapMetadata; summary: RepositoryMapSummary; highValueFiles: ScoredFile[]; entryPoints: ScoredFile[]; schemaFiles: ScoredFile[]; configFiles: ScoredFile[]; clusters: FileClusters; allFiles: ScoredFile[]; } /** * Options for repository mapping */ export interface RepositoryMapperOptions { /** Maximum files to process */ maxFiles?: number; /** Patterns to force-include, overriding gitignore and excludePatterns */ includePatterns?: string[]; /** Additional patterns to exclude */ excludePatterns?: string[]; /** Custom scoring configuration */ scoringConfig?: ScoringConfig; /** Progress callback */ onProgress?: (stage: string, progress: number) => void; /** Output directory for analysis files */ outputDir?: string; } export declare class RepositoryMapper { private rootPath; private options; private packageJson; constructor(rootPath: string, options?: RepositoryMapperOptions); /** * Load package.json if it exists */ private loadPackageJson; /** * Get project name from package.json or directory name */ private getProjectName; /** * Detect project type */ private detectProjectType; /** * Calculate language breakdown */ private calculateLanguages; /** * Detect frameworks */ private detectFrameworks; /** * Calculate directory statistics */ private calculateDirectoryStats; /** * Cluster files by various dimensions */ private clusterFiles; /** * Generate the repository map */ map(): Promise; /** * Write repository map to output directory */ writeOutput(map: RepositoryMap): Promise; /** * Generate human-readable summary */ private generateSummaryMarkdown; } /** * Convenience function to map a repository */ export declare function mapRepository(rootPath: string, options?: RepositoryMapperOptions): Promise; //# sourceMappingURL=repository-mapper.d.ts.map