mcp-adr-analysis-server
Version:
MCP server for analyzing Architectural Decision Records and project architecture
84 lines • 2.62 kB
TypeScript
/**
* Ripgrep wrapper for efficient code searching
* Provides a Node.js interface to the ripgrep command-line tool
*/
/**
* Options for ripgrep search
*/
export interface RipgrepOptions {
/** Pattern to search for */
pattern: string;
/** Path to search in */
path: string;
/** Respect .gitignore */
gitignore?: boolean;
/** Maximum number of matches */
maxMatches?: number;
/** File type to search */
fileType?: string;
/** Case insensitive search */
caseInsensitive?: boolean;
/** Include line numbers */
includeLineNumbers?: boolean;
/** Context lines before match */
contextBefore?: number;
/** Context lines after match */
contextAfter?: number;
/** File glob pattern */
glob?: string;
/** Exclude glob pattern */
excludeGlob?: string;
}
/**
* Result from ripgrep search
*/
export interface RipgrepResult {
/** File path */
file: string;
/** Line number (if includeLineNumbers is true) */
line?: number;
/** Column number */
column?: number;
/** Matched text */
match: string;
/** Context before match */
contextBefore?: string[];
/** Context after match */
contextAfter?: string[];
}
/**
* Check if ripgrep is available on the system
*/
export declare function isRipgrepAvailable(): Promise<boolean>;
/**
* Search for patterns using ripgrep
*
* @param options - Search options
* @returns Promise resolving to array of file paths containing matches
*/
export declare function searchWithRipgrep(options: RipgrepOptions): Promise<string[]>;
/**
* Search for patterns with detailed results
*
* @param options - Search options
* @returns Promise resolving to detailed search results
*/
export declare function searchWithRipgrepDetailed(options: RipgrepOptions): Promise<RipgrepResult[]>;
/**
* Search for multiple patterns in parallel
*
* @param patterns - Array of patterns to search for
* @param searchPath - Path to search in
* @param options - Additional search options
* @returns Promise resolving to map of pattern to files
*/
export declare function searchMultiplePatterns(patterns: string[], searchPath: string, options?: Partial<RipgrepOptions>): Promise<Map<string, string[]>>;
/**
* Get ripgrep version information
*/
export declare function getRipgrepVersion(): Promise<string | null>;
/**
* Fallback search using simple file reading (when ripgrep is not available)
*/
export declare function fallbackSearch(pattern: string, searchPath: string, options?: Partial<RipgrepOptions>): Promise<string[]>;
//# sourceMappingURL=ripgrep-wrapper.d.ts.map