import type { CodebaseStats } from '../worker/code-adapter'; import type { CodebaseIndexerConfig, IndexResult, SyncDiffOptions } from './types'; /** * Indexes local source files into SurrealDB's rag_documents table * with collection='code'. Reuses the existing Document Store extraction, * chunking, and embedding pipeline but reads directly from the local * filesystem instead of S3. */ export declare class CodebaseIndexer { private config; private ragIgnore; private packageDetector; private contentExtractor; private chunker; private embeddingService; private surreal; constructor(config: CodebaseIndexerConfig); /** * Get the embedding service, throwing if not configured. * Status and purge operations don't need embeddings, so the service * is lazily required only when sync operations need it. */ private requireEmbeddingService; /** * Full reindex: walk all git-tracked files, filter, extract, chunk, embed, store. */ syncFull(options?: { dryRun?: boolean; }): Promise; /** * Incremental sync: only reindex files changed since a git ref. * Handles Added, Copied, Modified, Renamed, and Deleted files. */ syncDiff(options?: SyncDiffOptions): Promise; /** * Get statistics about the indexed codebase. * Schema is guaranteed to exist if data is present — skip migration. */ getStats(): Promise; /** * Remove all indexed chunks for this codebase. * Schema is guaranteed to exist if data is present — skip migration. */ purge(): Promise<{ chunksDeleted: number; }>; private getGitFiles; private filterFiles; /** * Verify a relative path resolves within the repo root. * Prevents path traversal via ../ sequences. */ private isPathWithinRepo; /** * Check if a path should be excluded from delete operations in syncDiff. * * Unlike shouldSkipFile(), this does NOT perform a stat() or size check — * deleted files no longer exist on disk so statSync would always throw. * We only need to know whether the file would ever have been indexed. */ private isPathExcluded; /** * Check if a single file should be skipped (ragignore or size). */ private shouldSkipFile; /** * Process a single file: hash check, extract, chunk, embed, store. * Returns true if the file was indexed (new or changed), false if skipped. */ private processFile; private emitProgress; } //# sourceMappingURL=codebase-indexer.d.ts.map