/** * Internal lexical retriever for hybrid search. * * This is not the grep *tool* — it is the lexical recall backend: it turns a * natural query into a ripgrep pattern, streams matches, and returns bare * `rel:line` hits for the grep→chunk adapter. rg drives the fast path; the * pure-JS nativeGrep fallback keeps restricted environments working, same as * the grep tool. */ import type { GrepLineHit } from "./adapter.js"; export interface LexicalQueryPlan { /** rg-ready regex pattern. */ pattern: string; /** Raw (unescaped, lowercased) terms, for per-line term attribution. */ terms: string[]; } /** * Build the retrieval plan for a query: a quoted segment is searched * verbatim; otherwise the longest few identifier-ish tokens are OR-ed * together. Returns undefined when the query yields nothing searchable. */ export declare function buildLexicalQueryPlan(query: string): LexicalQueryPlan | undefined; /** Pattern-only view of {@link buildLexicalQueryPlan}. */ export declare function buildLexicalPattern(query: string): string | undefined; /** * Run lexical retrieval over `cwd`, returning up to `limit` line-hits in * output order with POSIX repo-relative paths. */ export interface RunLexicalOptions { cwd: string; query: string; limit: number; glob?: string; signal?: AbortSignal; /** * Restrict the search to these repo-relative files instead of walking `cwd`. * * Used to scope the grep leg to files the embedding index does not have * current content for. An empty array means "no files to search", which is * a real answer — not "search everything". */ paths?: readonly string[]; } export declare function runLexicalRetriever(options: RunLexicalOptions): Promise; //# sourceMappingURL=lexical-retriever.d.ts.map