/** * Error Classifier * Classifies and analyzes error responses for security testing * * Extracted from SecurityResponseAnalyzer.ts (Issue #53) * Handles: connection error detection, error classification, error info extraction */ import { CompatibilityCallToolResult } from "@modelcontextprotocol/sdk/types.js"; /** * Error classification types */ export type ErrorClassification = "connection" | "server" | "protocol"; /** * Extracted error information from response */ export interface ErrorInfo { code?: string | number; message?: string; } /** * Classifies errors from tool responses and exceptions */ export declare class ErrorClassifier { /** * Check if response indicates connection/server failure */ isConnectionError(response: CompatibilityCallToolResult): boolean; /** * Check if caught exception indicates connection/server failure */ isConnectionErrorFromException(error: unknown): boolean; /** * Check if response indicates transient error worth retrying. * Transient errors (ECONNREFUSED, ETIMEDOUT, etc.) may resolve on retry. * Permanent errors (unknown tool, unauthorized) will not. * * @see https://github.com/triepod-ai/inspector-assessment/issues/157 */ isTransientError(response: CompatibilityCallToolResult): boolean; /** * Check if caught exception indicates transient error worth retrying. * * @see https://github.com/triepod-ai/inspector-assessment/issues/157 */ isTransientErrorFromException(error: unknown): boolean; /** * Internal: Check if text indicates connection/server failure */ private isConnectionErrorFromText; /** * Classify error type for reporting */ classifyError(response: CompatibilityCallToolResult): ErrorClassification; /** * Classify error type from caught exception */ classifyErrorFromException(error: unknown): ErrorClassification; /** * Internal: Classify error type from text */ private classifyErrorFromText; /** * Extract error info from response */ extractErrorInfo(response: CompatibilityCallToolResult): ErrorInfo; /** * Extract response content from MCP response */ extractResponseContent(response: CompatibilityCallToolResult): string; } //# sourceMappingURL=ErrorClassifier.d.ts.map