/** * Living Docs Builder - Discovery Phase * * Scans the codebase structure without LLM calls to: * - Count files by type and extension * - Detect tech stack from config files * - Find existing documentation * - Identify entry points * - Group files into modules * - Calculate sampling tier */ /** * Module information discovered from directory structure */ export interface ModuleInfo { name: string; path: string; fileCount: number; estimatedLOC: number; hasTests: boolean; hasReadme: boolean; entryPoints: string[]; extensions: Record; } /** * Sampling configuration based on codebase size */ export interface SamplingConfig { tier: 'small' | 'medium' | 'large' | 'massive'; filesPerDir: number | 'all'; priorityPatterns: string[]; skipPatterns: string[]; } /** * Complete discovery result */ export interface DiscoveryResult { codebaseStats: { totalFiles: number; totalDirs: number; byExtension: Record; byType: { code: number; tests: number; docs: number; config: number; assets: number; }; estimatedLOC: number; }; techStack: { languages: string[]; frameworks: string[]; buildTools: string[]; testFrameworks: string[]; detectedFrom: string[]; }; existingDocs: { readme: string | null; contributing: string | null; docsFolder: string | null; wikiFolder: string | null; mdFiles: string[]; }; entryPoints: { main: string[]; index: string[]; exports: string[]; }; modules: ModuleInfo[]; tier: SamplingConfig['tier']; samplingConfig: SamplingConfig; discoveredAt: string; /** Languages detected from file extensions (v1.0.258+) */ languagesDetected: string[]; /** Umbrella detection result (v0.31.0+) */ umbrella?: { /** Is this an umbrella project */ isUmbrella: boolean; /** Detection source */ source: 'clone-job' | 'config' | 'git-scan' | 'none'; /** Number of child repos */ childRepoCount: number; }; } /** * Maximum directory depth for the discovery walk (the project root is depth 0). * Shared by countDirectories() and scanDirectory() so the progress total matches * what is actually scanned and neither can run away on a huge tree (0879). */ export declare const MAX_SCAN_DEPTH = 15; /** * Progress callback type */ export type DiscoveryProgressCallback = (current: number, total: number, currentDir: string) => void; /** * Run the discovery phase */ export declare function runDiscovery(projectPath: string, additionalSources: string[], onProgress?: DiscoveryProgressCallback): Promise; /** * Calculate sampling tier based on file count */ export declare function calculateTier(totalFiles: number): SamplingConfig; /** * Select representative files from a directory for analysis */ export declare function selectRepresentativeFiles(files: string[], maxFiles: number | 'all', moduleName?: string): string[]; //# sourceMappingURL=discovery.d.ts.map