/** * X++ Symbol Search Tool * Search for classes, tables, methods, and fields by name or keyword */ import type { CallToolRequest } from '@modelcontextprotocol/sdk/types.js'; import type { XppServerContext } from '../../types/context.js'; /** * Index-safe probe for symbols whose name EQUALS the query (#15). * * Runs `lookupSymbolsNocase`, i.e. an exact-case equality probe on * idx_name_type followed by a bounded FTS5 phrase match for differently-cased * input. Deliberately NOT `LIKE` and NOT `name = ? COLLATE NOCASE` as the * primary predicate: on the 1.17M-row production symbol DB either shape * degrades to a full scan (80–278 s measured) and blocks the event loop until * MCP clients kill the server. * * Returns [] on any failure — the exact-first repair must never break search. */ export declare function probeExactMatches(symbolIndex: any, query: string, types?: string[]): Array<{ name: string; type: string; model?: string; filePath?: string; }>; /** * Probe the SQLite index for keyword matches that live in CUSTOM/ISV models. * * Broad keyword searches routed through the C# bridge fill their fixed result * window in provider-enumeration order (Microsoft-dominated) and truncate at * `maxResults`, so custom matches enumerated later never reach the client — the * search then looks like it "returns only Microsoft objects". These hits are * spliced back into the bridge/external results and ranked directly after exact * matches so custom code is always visible. Model-scoped and FTS-driven, so it * stays index-safe (never a full `%query%` scan of the whole corpus). * * Returns [] on any failure — the custom-first repair must never break search. */ export declare function probeCustomMatches(symbolIndex: any, query: string, types?: string[], limit?: number): Array<{ name: string; type: string; model?: string; parentName?: string; filePath?: string; }>; /** * Model for the rows the BRIDGE returns. * * `search`'s published schema promises "returns name, type, model", but the C# * side only ever populates Name and Type (SearchItemModel in Models.cs) — so * every bridge-sourced row rendered as `- **Name** (type)` and the caller had to * spend a second call to learn which model a hit lives in. The index already * knows, so one bounded lookup fills it in on this side of the pipe. * * Index-safe by construction: equality on `name` (idx_symbols_name / * idx_name_type), a bounded IN-list, `parent_name IS NULL` so a name that is * also a field on 900 tables cannot explode the row count, and a hard LIMIT. * Never LIKE and never COLLATE NOCASE — see symbolLookup.ts for what those two * shapes cost on the 1.17M-row production DB. */ export declare function buildBridgeMetaResolver(symbolIndex: any): (rows: Array<{ name: string; type: string; }>) => Map; /** Shared key for the enrichment map — case-folded, since bridge and index casing can differ. */ export declare function metaKey(name: string, type: string): string; export declare function searchTool(request: CallToolRequest, context: XppServerContext): Promise; //# sourceMappingURL=search.d.ts.map