/** * Grep Tool - Search for patterns in files using regex */ import type { Tool } from '../types.js'; /** * Input parameters for grep tool */ export interface GrepInput { /** * Regular expression pattern to search for */ pattern: string; /** * Path to file or directory to search in */ path: string; /** * Case insensitive search (default: false) */ ignoreCase?: boolean; /** * Include line numbers in output (default: true) */ lineNumbers?: boolean; /** * Number of context lines before match (default: 0) */ before?: number; /** * Number of context lines after match (default: 0) */ after?: number; /** * Only return filenames with matches (default: false) */ filesOnly?: boolean; /** * Include hidden files/directories (default: false) */ includeHidden?: boolean; /** * File extensions to include (e.g., ['.ts', '.js']) */ extensions?: string[]; /** * Maximum number of matches to return (default: 100) */ maxMatches?: number; /** * Search recursively in directories (default: true) */ recursive?: boolean; /** * Directory names to exclude from search. * Default excludes: node_modules, .git, dist, build, etc. * Set to empty array [] to include all directories. */ excludeDirs?: string[]; } /** * Grep tool definition */ export declare const grepTool: Tool; /** * Factory function to create a grep tool with custom options * * TODO: Future enhancements could include: * - maxFileSize: Skip files larger than specified size */ export declare function createGrepTool(options?: { /** * Base directory to resolve relative paths against */ baseDir?: string; /** * Default file extensions to search */ defaultExtensions?: string[]; /** * Override default excluded directories. * Defaults to: node_modules, .git, dist, build, etc. */ excludeDirs?: string[]; }): Tool;