/** * `codebase-search` tool — search the symbol index with BM25 ranking. * * Usage: codebase-search({ * query: string, // search terms * kind?: string, // class|function|interface|method|const|... * lang?: string, // ts|tsx|js|jsx|go|py|rs|java|ruby|… (derived from EXT_TO_LANG) * file?: string, // filter to a specific file path (substring match) * limit?: number, // max results (default 20, max 100) * }) * * Returns: [{ name, kind, lang, file, line, signature, snippet, score }, ...] * * The query executes in the index worker via FTS5 (`MATCH` + native `bm25()`) * — the main thread never opens SQLite, so a contended or wedged index can * slow this tool down but can never freeze the terminal. */ import type { Tool } from '@wrongstack/core/types'; import type { SearchResult, SymbolLang } from './schema.js'; /** * Language ids the index understands — DERIVED from `EXT_TO_LANG` * (languages.ts), the same table that decides which files get indexed, so * this enum can no longer drift from the indexer's actual coverage (~40 * languages, including java/ruby/php/swift/md/css/… that the old * hand-maintained 9-item list silently rejected). Single source for the * `lang` enum here and the `langs` validation in codebase-index-tool.ts. */ export declare const INDEXABLE_LANG_IDS: readonly SymbolLang[]; export declare const codebaseSearchTool: Tool; export interface CodebaseSearchInput { query: string; kind?: string | undefined; lang?: string | undefined; file?: string | undefined; limit?: number | undefined; lspKind?: number | undefined; /** * Deprecated compatibility hint. The built-in tool is index-only; the LSP * plugin exposes live workspace-symbol search as `codebase-lsp-search`. */ preferLsp?: boolean | undefined; } export interface CodebaseSearchOutput { results: SearchResult[]; total: number; query: string; /** * True when the project server served a previous generation's cached * answer during a refresh. Results are internally consistent but may lag * the files currently being indexed. */ stale?: boolean | undefined; /** Advisory note when a stale previous-generation answer was served. */ indexStatus?: string | undefined; } //# sourceMappingURL=codebase-search-tool.d.ts.map