/** * Grep tool: search file contents using regex. * * Uses the bundled ripgrep (rg) binary from @vscode/ripgrep as the * primary search engine. Falls back to a pure Node.js regex search * if the rg binary is unavailable (e.g., postinstall failed). * * Three output modes: files_with_matches, content, count. * Pagination via offset + head_limit. * * Reference: docs/cortex/tools/grep.md */ import { Type, type Static } from 'typebox'; import type { ToolContentDetails } from '../types.js'; export declare const GrepParams: Type.TObject<{ pattern: Type.TString; path: Type.TOptional; glob: Type.TOptional; type: Type.TOptional; output_mode: Type.TOptional, Type.TLiteral<"content">, Type.TLiteral<"count">]>>; context: Type.TOptional; '-i': Type.TOptional; head_limit: Type.TOptional; offset: Type.TOptional; multiline: Type.TOptional; }>; export type GrepParamsType = Static; export interface GrepDetails { totalFiles: number; totalMatches: number; durationMs: number; /** True when results were capped by head_limit. Output size limiting is handled by the agent's result-persistence interceptor. */ truncated: boolean; usingFallback: boolean; } export interface GrepToolConfig { /** Default search directory when no path param is given. */ defaultCwd: string; /** Whether to respect .gitignore. Default: true. */ respectGitignore?: boolean | undefined; } export declare function createGrepTool(config: GrepToolConfig): { name: string; description: string; parameters: typeof GrepParams; execute: (params: GrepParamsType) => Promise>; }; /** * Reset the cached ripgrep path. Used by tests to force re-detection. * @internal */ export declare function _resetRipgrepCache(): void; //# sourceMappingURL=grep.d.ts.map