/** * Local Indexer Service * * Extracts entities (functions, classes, imports) from local files * and stores them in the local SQLite database. * Uses regex-based extraction for zero external dependencies. */ import { LocalDatabase, EntityType, RelationshipType, ExtractedEntity } from './local-db.js'; export interface IndexableFile { path: string; relativePath: string; language: string; } export interface LocalIndexResult { filesProcessed: number; filesSkipped: number; entitiesExtracted: number; relationshipsCreated: number; duration: number; errors: string[]; } export interface ExtractedEntityInfo { type: EntityType; name: string; normalizedName: string; line?: number; metadata?: Record; } export interface ExtractedRelationship { source: string; target: string; type: RelationshipType; strength?: number; } export declare class LocalIndexer { private db; private processedInSession; constructor(db: LocalDatabase); /** * Compute SHA-256 hash of content (truncated to 16 chars) */ private computeHash; /** * Get language ID from file extension */ private getLanguageId; /** * Check if file should be re-indexed based on content hash */ private shouldReindex; /** * Extract entities from TypeScript/JavaScript file content */ private extractEntitiesFromContent; /** * Resolve relative import path to actual file path */ private resolveImportPath; /** * Index a single file */ indexFile(projectId: string, filePath: string, content?: string): Promise<{ entities: number; relationships: number; fromCache: boolean; }>; /** * Index an entire directory */ indexDirectory(projectId: string, rootDir: string, options?: { patterns?: string[]; force?: boolean; }): Promise; /** * Get pending entities that need to be synced to cloud */ getPendingEntities(projectId: string, limit?: number): ExtractedEntity[]; /** * Mark entities as synced after successful cloud push */ markEntitiesSynced(projectId: string, filePaths: string[]): number; /** * Get indexing statistics */ getStats(projectId: string): { registry: { total: number; synced: number; pending: number; error: number; }; entities: number; relationships: number; }; /** * Clear session cache (for testing) */ clearCache(): void; } /** * Create a local indexer instance */ export declare function createLocalIndexer(db: LocalDatabase): LocalIndexer; //# sourceMappingURL=local-indexer.d.ts.map