/** * search.ts — find things by meaning, not by ID. * * The structured index answers "what references switch 5?"; this answers * "where is the blacksmith?" / "the dark forest" / "the sad dialogue" by * ranking the project's human-readable text — map names, NPC names, dialogue, * item/skill descriptions and notes — against a free-text query. * * It is a lexical ranker (offline, no embeddings, no extra deps): field-weighted * token + phrase matching. It is the structured/search split the roadmap asks * for (#5) and can later be backed by real embeddings without changing callers. */ export interface SearchDoc { type: string; id: number; label: string; text: string; mapId?: number; } export interface SearchHit { type: string; id: number; label: string; score: number; snippet: string; mapId?: number; } /** Rank docs against a query. Label matches weigh more than body matches; an * exact phrase occurrence is a strong boost. Pure and deterministic. */ export declare function rankDocuments(docs: SearchDoc[], query: string, limit?: number): SearchHit[]; /** Read the project and build the searchable document set. */ export declare function gatherDocuments(projectPath: string): Promise;