import { SQLiteDatabase } from '../storage/sqlite-db.js'; import { SemanticVectorDB } from '../storage/vector-db.js'; export interface CodebaseAnalysisResult { languages: string[]; frameworks: string[]; complexity: { cyclomatic: number; cognitive: number; lines: number; }; concepts: Array<{ name: string; type: string; confidence: number; }>; analysisStatus?: 'normal' | 'degraded'; errors?: string[]; entryPoints?: Array<{ type: string; filePath: string; framework?: string; }>; keyDirectories?: Array<{ path: string; type: string; fileCount: number; }>; } export interface FileAnalysisResult { concepts: Array<{ name: string; type: string; confidence: number; filePath: string; lineRange: { start: number; end: number; }; }>; } export declare class SemanticEngine { private database; private vectorDB; private rustAnalyzer; private rustCircuitBreaker; private initializationPromise; private cleanupInterval; private fileAnalysisCache; private codebaseAnalysisCache; private readonly CACHE_TTL; constructor(database: SQLiteDatabase, vectorDB: SemanticVectorDB); /** * Lazy initialization of Rust analyzer */ private initializeRustAnalyzer; private memoizedLanguageDetection; analyzeCodebase(path: string): Promise; analyzeFileContent(filePath: string, content: string): Promise; learnFromCodebase(path: string, progressCallback?: (current: number, total: number, message: string) => void): Promise; }>>; updateFromAnalysis(analysisData: any): Promise; findRelatedConcepts(conceptId: string): Promise; searchSemanticallySimilar(query: string, limit?: number): Promise>; private fallbackAnalysis; private fallbackFileAnalysis; /** * Simple hash function for cache keys */ private hashString; /** * Clean up old cache entries to prevent memory leaks */ private cleanupCaches; /** * Get cache statistics for monitoring */ getCacheStats(): { fileCache: { size: number; hitRate?: number; }; codebaseCache: { size: number; hitRate?: number; }; }; private detectLanguageFromPath; /** * Detect entry points using Rust analyzer with TypeScript fallback * Uses CircuitBreaker pattern for graceful degradation */ detectEntryPoints(projectPath: string, frameworks: string[]): Promise>; /** * Map key directories using Rust analyzer with TypeScript fallback * Uses CircuitBreaker pattern for graceful degradation */ mapKeyDirectories(projectPath: string): Promise>; /** * Count files recursively in a directory (async with depth limit) * @param dirPath - Directory to count files in * @param maxDepth - Maximum recursion depth (default 5) * @param currentDepth - Current depth (for internal recursion tracking) */ private countFilesInDirectory; /** * Clean up resources to prevent process hanging */ cleanup(): void; } //# sourceMappingURL=semantic-engine.d.ts.map