/** * smart_search — cross-codebase symbol search via tree-sitter. * * Walks a directory tree, batch-parses code files by language, and * matches symbols against a query string with relevance scoring. * * @task T152 */ import type { CodeSymbol } from '@cleocode/contracts'; import { type TreeSitterLanguage } from '../lib/tree-sitter-languages.js'; /** A search result with relevance score. */ export interface SmartSearchResult { /** The matched symbol. */ symbol: CodeSymbol; /** Relevance score (higher = better match). */ score: number; /** How the query matched (exact, substring, fuzzy, path). */ matchType: 'exact' | 'substring' | 'fuzzy' | 'path'; } /** Options for smart_search. */ export interface SmartSearchOptions { /** Maximum results to return (default: 20). */ maxResults?: number; /** Glob-like file pattern filter (e.g. "*.ts", "src/**"). */ filePattern?: string; /** Restrict to specific language. */ language?: TreeSitterLanguage; /** Root directory to search (default: cwd). */ rootDir?: string; } /** * Search for symbols across a codebase. * * Walks the directory tree, batch-parses source files, and returns * symbols matching the query ranked by relevance score. * * @param query - Search string to match against symbol names and paths * @param options - Search options (maxResults, filePattern, language, rootDir) * @returns Ranked array of search results */ export declare function smartSearch(query: string, options?: SmartSearchOptions): SmartSearchResult[]; //# sourceMappingURL=search.d.ts.map