import type { SqlClient, ChunkSearchResult, SqlParam } from "./types.js"; import { type CompiledExcludes } from "./exclude.js"; import { type CompiledMounts } from "./mounts.js"; export declare function validateEmbedding(embedding: number[], expectedDimensions?: number): void; export interface ChunkSearchOpts { path?: string; limit?: number; /** Max hits per file path (default 3) so one long page can't monopolize the top-k. */ perFileCap?: number; excludes?: CompiledExcludes; mounts?: CompiledMounts; } /** * The version-visibility projection every version-scoped chunk operation * shares — searches and the maintenance passes alike: the nearest entry per * path along version $2's ancestor chain (so shadowed blobs and tombstoned * paths never count), scoped to the $3 subtree and filtered by the * instance's excludes/mounts. Yields (path, blob_hash, node_type); callers * must still keep only `node_type = 'file'` rows. References $1 * (workspace), $2 (version) and $3 (scope ltree); the exclude/mount params * returned here are numbered from `paramStart`. */ export declare function visibleEntriesSql(excludes: CompiledExcludes | undefined, mounts: CompiledMounts | undefined, paramStart: number): { sql: string; params: SqlParam[]; }; /** * BM25 search at version V: lexical hits rank sections. A blob visible at * several paths yields one hit per (path, chunk); a blob with several * matching chunks yields one hit per chunk (up to the per-file cap). * Non-matching rows score 0 and are filtered out. */ export declare function chunkTextSearch(client: SqlClient, workspaceId: string, versionId: number, query: string, opts?: ChunkSearchOpts): Promise; /** * Vector search at version V: chunks ranked by cosine similarity between * the query embedding and the per-content cache (`fs_chunk_embeddings`, * filled by `indexChunkEmbeddings()`). Nearest-neighbor: it always ranks * something, so irrelevant queries return low-rank hits, not nothing. * Chunks without a cached embedding are invisible to this signal. */ export declare function chunkSemanticSearch(client: SqlClient, workspaceId: string, versionId: number, embedding: number[], opts?: ChunkSearchOpts): Promise; /** * Hybrid search at version V: the BM25 and vector rankings, each taken to * the oversample depth, fused with reciprocal-rank fusion — see `RRF_K` * for why ranks rather than weighted scores. Chunks without a cached * embedding still surface through the lexical side. */ export declare function chunkHybridSearch(client: SqlClient, workspaceId: string, versionId: number, query: string, embedding: number[], opts?: ChunkSearchOpts): Promise; //# sourceMappingURL=search.d.ts.map