/** * Fix Suggester for Error Debugging * * Generates actionable fix suggestions by comparing error context * with working examples found via RAG search. * * @module @wundr/mcp-server/tools/error-debugger-rag/fix-suggester */ import type { ExtractedIdentifier, IdentifierExtractionResult } from './identifier-extractor'; /** * Confidence level for fix suggestions */ export type FixConfidence = 'high' | 'medium' | 'low'; /** * Category of fix suggestion */ export type FixCategory = 'import' | 'type' | 'syntax' | 'missing-property' | 'missing-argument' | 'null-check' | 'declaration' | 'configuration' | 'dependency' | 'refactor' | 'lint' | 'other'; /** * A code snippet that can be used in a fix */ export interface CodeSnippet { /** The code content */ code: string; /** Language of the code */ language: string; /** Source file path */ sourcePath?: string; /** Line numbers in source */ lineRange?: { start: number; end: number; }; /** Description of what this snippet shows */ description?: string; } /** * A working example found that doesn't have the error */ export interface WorkingExample { /** File path of the working example */ filePath: string; /** Relevant code snippet */ snippet: CodeSnippet; /** Relevance score to the error */ relevanceScore: number; /** Why this example is relevant */ explanation: string; } /** * A single fix suggestion */ export interface FixSuggestion { /** Short title for the fix */ title: string; /** Detailed description of what to do */ description: string; /** Category of the fix */ category: FixCategory; /** Confidence level */ confidence: FixConfidence; /** Priority (1 = highest) */ priority: number; /** Code snippet to apply */ codeSnippet?: CodeSnippet; /** Working examples that informed this suggestion */ workingExamples: WorkingExample[]; /** Steps to implement the fix */ steps: string[]; /** Additional context or notes */ notes?: string; } /** * Result from fix suggestion generation */ export interface FixSuggestionResult { /** Error message that was analyzed */ errorMessage: string; /** Generated fix suggestions */ suggestions: FixSuggestion[]; /** Identifiers extracted from the error */ identifiers: ExtractedIdentifier[]; /** Whether a fix could be confidently suggested */ hasConfidentFix: boolean; /** Summary of the analysis */ summary: string; } /** * RAG search result for context */ export interface RagContextResult { /** File path */ filePath: string; /** Content snippet */ content: string; /** Relevance score */ score: number; /** Line numbers */ lineNumbers?: number[]; } /** * Generate fix suggestions for an error message * * Analyzes the error message, compares with working examples from RAG context, * and generates actionable fix suggestions with code snippets. * * @param errorMessage - The error message to analyze * @param identifiers - Extracted identifiers from the error * @param ragContext - Working examples found via RAG search * @returns Fix suggestion result * * @example * ```typescript * const result = generateFixSuggestion( * "Cannot find module './utils/helpers'", * extractIdentifiers("Cannot find module './utils/helpers'"), * ragSearchResults * ); * ``` */ export declare function generateFixSuggestion(errorMessage: string, identifiers: IdentifierExtractionResult, ragContext?: RagContextResult[]): FixSuggestionResult; /** * Generate fix suggestions for multiple errors * * @param errors - Array of objects with error messages and identifiers * @param ragContext - RAG context results * @returns Array of fix suggestion results */ export declare function generateFixSuggestionsForMultiple(errors: Array<{ errorMessage: string; identifiers: IdentifierExtractionResult; }>, ragContext?: RagContextResult[]): FixSuggestionResult[]; declare const _default: { generateFixSuggestion: typeof generateFixSuggestion; generateFixSuggestionsForMultiple: typeof generateFixSuggestionsForMultiple; }; export default _default; //# sourceMappingURL=fix-suggester.d.ts.map