/** * Deterministic lexical retrieval. * * A portable postings-table + Okapi BM25 implementation over SQLite. This avoids * reliance on FTS5 availability (which can differ by Node build/platform) while * providing exact, prefix, phrase and identifier-aware full-text search with * deterministic ranking. All query text is parameter-bound, so no injection is * possible. */ import type { WorkspaceDb } from "./storage.js"; export interface LexicalHit { chunkId: string; path: string; score: number; matchedTokens: string[]; } export interface LexicalQuery { query: string; limit?: number; fileClassFilters?: string[]; languageFilters?: string[]; pathFilter?: string; prefix?: boolean; caseSensitive?: boolean; } /** Write the lexical records for a chunk. */ export declare function writeLexical(db: WorkspaceDb, generationId: string, chunkId: string, path: string, lexText: string): void; export declare function deleteLexical(db: WorkspaceDb, generationId: string, chunkId: string): void; /** Kill-list chunk_ids from a previous fully-indexed generation to remove stale vectors. */ export declare function chunkIdsForRemoval(db: WorkspaceDb, generationId: string, retained: Set): string[]; export declare function searchLexical(db: WorkspaceDb, generationId: string, opts: LexicalQuery): LexicalHit[]; /** Path-prefix search: locate chunks under a given workspace-relative path. */ export declare function searchByPath(db: WorkspaceDb, generationId: string, pathQuery: string, limit?: number): LexicalHit[]; /** Identifier-aware exact symbol-name search over the symbols table. */ export declare function searchSymbolName(db: WorkspaceDb, generationId: string, name: string, limit?: number): Array<{ symbolId: string; fileId: string; name: string; qualifiedName?: string; kind: string; startLine: number; }>; //# sourceMappingURL=lexical.d.ts.map