import type { Tool } from '../core/tools/tool-types.js'; /** Reset cached rg probe — for tests only. */ export declare function resetRgAvailabilityForTests(): void; export declare function isRgAvailable(): Promise; export type SearchCodeOutputMode = 'content' | 'files_with_matches' | 'count'; export interface GrepWithRgOptions { searchDir: string; pattern: string; extensions: string[] | null; /** Optional rg --glob filter (e.g. `*.ts` or nested path globs). */ glob?: string | null; /** Optional rg --type filter (e.g. "ts", "py"). */ type?: string | null; limit: number; timeoutMs: number; displayRoot: string; caseSensitive: boolean; contextLines: number; outputMode: SearchCodeOutputMode; multiline?: boolean; } /** * Run the search via ripgrep. Shape depends on `outputMode`: * - content: `path:line:> match` / `path:line-| context` (matches grepWalk) * - files_with_matches: one relative path per line * - count: `path: N` per file * * Returns null when rg is unavailable or fails hard (caller falls back). * Empty array when there are no matches. */ export declare function grepWithRg(opts: GrepWithRgOptions): Promise; /** * Find files via `rg --files` (respects .gitignore). Returns absolute paths * sorted by mtime descending (Claude Code Glob parity — recent files first). * Returns null when rg is unavailable. */ export declare function filesWithRg(searchDir: string, pattern: string, limit: number, timeoutMs?: number): Promise; export declare function walkMatch(dir: string, pattern: string, limit: number): Promise; export declare function isSafeRegex(pattern: string): boolean; export declare const searchFilesTool: Tool; export declare const searchCodeTool: Tool; export interface GrepWalkOptions { outputMode?: SearchCodeOutputMode; contextLines?: number; glob?: string | null; } export declare function grepWalk(dir: string, regex: RegExp, extensions: string[] | null, limit: number, maxFileSize: number, timeoutMs: number, displayRoot?: string, options?: GrepWalkOptions): Promise; //# sourceMappingURL=search-tools.d.ts.map