/** * Index Manager * * Manages project index lifecycle with: * - Staleness detection (checks file mtimes) * - Incremental reindexing (only modified files) * - Automatic reindexing on search */ import type { IVectorStore } from "@massa-th0th/shared"; interface StaleCheckResult { isStale: boolean; reason?: string; modifiedFiles?: string[]; newFiles?: string[]; deletedFiles?: string[]; } export declare class IndexManager { private metadataCache; private vectorStore; constructor(vectorStore: IVectorStore); /** * Check if project index is stale */ isIndexStale(projectId: string, projectPath: string): Promise; /** * Get files that need reindexing */ getFilesToReindex(projectId: string, projectPath: string, previousStaleCheck?: StaleCheckResult): Promise; /** * Update index metadata after indexing */ updateIndexMetadata(projectId: string, projectPath: string, indexedFiles: string[]): Promise; /** * Load and parse .gitignore file (delegates to shared ignore-patterns module) */ private loadGitignore; /** * Scan project files and get current state */ private scanProjectFiles; /** * Get index metadata from vector store */ private getIndexMetadata; /** * Save index metadata to vector store * * The metadata doc is a marker (JSON payload in `content`), not a searchable * vector. We still must supply an `embedding` whose length matches the * backend's declared dimension: under PostgreSQL+pgvector the column is * strictly typed (`vector(N)`), so a wrong-length vector throws a dimension * mismatch. We resolve the actual dimension from `vectorStore.getStats()` * (provider-driven: 384/768/1024/1536/3072/…) instead of hardcoding 4096, * and fall back to a small value only when the backend doesn't report one. */ private saveIndexMetadata; /** * Clear metadata cache */ clearCache(projectId?: string): void; } export {}; //# sourceMappingURL=index-manager.d.ts.map