/** * SamplingManager - Handles MCP Sampling operations for AI-powered features * * This utility provides error analysis using the MCP Sampling capability, * which allows the server to request LLM assistance from the client. */ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { ErrorAnalysis } from './types.js'; /** * Parameters for error analysis */ export interface ErrorAnalysisParams { /** Command that failed */ command: string; /** Command arguments */ args: string[]; /** Error output from the command */ errorOutput: string; /** Exit code of the failed command */ exitCode: number; } /** * SamplingManager handles AI-powered analysis using MCP Sampling */ export declare class SamplingManager { private mcpServer; constructor(mcpServer: McpServer); /** * Check if error should be analyzed based on its characteristics * @param errorOutput The error message to check * @param minLength Minimum error length to trigger analysis * @returns True if error should be analyzed */ shouldAnalyzeError(errorOutput: string, minLength?: number): boolean; /** * Analyze command error and provide AI-powered suggestions * Uses MCP Sampling to request LLM analysis from the client * * @param params Error analysis parameters * @returns Promise with error analysis result */ analyzeError(params: ErrorAnalysisParams): Promise; /** * Build the error analysis prompt for the LLM * @param params Error analysis parameters * @returns Formatted prompt string */ private buildErrorAnalysisPrompt; /** * Parse the LLM response into structured ErrorAnalysis * @param content Response content from LLM * @returns Parsed error analysis */ private parseAnalysisResponse; /** * Extract numbered list items from text * @param text Text containing numbered list * @returns Array of list items */ private extractListItems; /** * Format error analysis for display * @param analysis Error analysis result * @returns Formatted string for display */ formatAnalysis(analysis: ErrorAnalysis): string; } //# sourceMappingURL=samplingManager.d.ts.map