import { SurrealAdapter } from './surreal-adapter'; import type { CodebaseStats, VectorRecord } from './surreal-adapter'; export type { SurrealConfig, VectorRecord, CodebaseStats } from './surreal-adapter'; /** * Extended index statistics for a codebase, including language and package * breakdowns. Built on top of `CodebaseStats` via additional GROUP BY queries. */ export interface CodebaseIndexStats { codebaseId: string; totalChunks: number; totalFiles: number; languages: Record; packages: Record; lastIndexedAt: string | null; } /** * Code-specific adapter extending SurrealAdapter with methods for codebase * indexing. Operates on rag_documents rows with collection='code'. * * Separated from SurrealAdapter (which handles document/RAG operations) to * keep each class focused on a single concern. */ export declare class CodeAdapter extends SurrealAdapter { /** * Insert code chunks into rag_documents with collection='code'. * * Unlike insertChunks() which hardcodes collection='documents' and * sourceType='s3_document', this method is designed for codebase indexing * and accepts arbitrary metadata including contentHash. */ insertCodeChunks(records: VectorRecord[], extraMetadata: Record): Promise; /** * Get the content_hash for a file in the code collection. * Returns null if the file is not indexed. */ getContentHash(codebaseId: string, filePath: string): Promise; /** * Delete all code chunks for a specific file path. */ deleteByFilePath(codebaseId: string, filePath: string): Promise; /** * Get all unique file paths indexed for a codebase. * Used for stale chunk cleanup — to find paths that no longer exist in git. */ getIndexedFilePaths(codebaseId: string): Promise; /** * Delete all code chunks for a codebase. */ purgeCodebase(codebaseId: string): Promise; /** * Get statistics about indexed code for a codebase. */ getStats(codebaseId: string): Promise; /** * Get extended index statistics for a codebase, including language and * package breakdowns. Used by the `codebase-stats` MCP tool to report * per-codebase index health. * * Issues three aggregate queries parameterized by `$codebaseId`: * 1. Totals + last updated (same as getStats) * 2. GROUP BY metadata.language for language counts * 3. GROUP BY metadata.packageName for package counts * * Entries with null/undefined keys are excluded from the records so callers * get clean, typed breakdowns. */ getIndexStats(codebaseId: string): Promise; } //# sourceMappingURL=code-adapter.d.ts.map