import { type ZodError } from "zod"; import { ApiError, ConnectionError, AuthenticationError, NotFoundError, ClientNotConfiguredError } from "./classes.js"; import { getAppMessage } from "./messages.js"; export declare const AppErrorFactory: { readonly mcp: { readonly invalidRequest: (reason: string) => import("mcp-server-framework").McpProtocolError; readonly methodNotFound: (method: string) => import("mcp-server-framework").McpProtocolError; readonly invalidParams: (reason: string) => import("mcp-server-framework").McpProtocolError; readonly parseError: (reason: string) => import("mcp-server-framework").McpProtocolError; readonly custom: (message: string, code?: number) => import("mcp-server-framework").McpProtocolError; }; readonly session: { readonly notFound: (sessionId: string) => import("mcp-server-framework").SessionError; readonly expired: (sessionId: string) => import("mcp-server-framework").SessionError; readonly limitReached: (maxSessions: number) => import("mcp-server-framework").SessionError; readonly invalidState: (sessionId: string, currentState: string, expectedState: string) => import("mcp-server-framework").SessionError; readonly custom: (message: string, sessionId?: string) => import("mcp-server-framework").SessionError; }; readonly transport: { readonly connectionFailed: (reason: string) => import("mcp-server-framework").TransportError; readonly connectionClosed: (reason?: string) => import("mcp-server-framework").TransportError; readonly invalidHeader: (header: string, reason: string) => import("mcp-server-framework").TransportError; readonly protocolMismatch: (expected: string, received: string) => import("mcp-server-framework").TransportError; readonly rateLimited: (retryAfterSeconds?: number) => import("mcp-server-framework").TransportError; readonly dnsRebinding: (host: string) => import("mcp-server-framework").TransportError; readonly portInUse: (bind: string) => import("mcp-server-framework").TransportError; readonly privilegesRequired: (bind: string) => import("mcp-server-framework").TransportError; readonly custom: (message: string, transportType?: "http" | "sse" | "stdio") => import("mcp-server-framework").TransportError; }; readonly validation: { readonly fromZodError: (error: ZodError, message?: string) => import("mcp-server-framework").ValidationError; readonly fieldRequired: (field: string) => import("mcp-server-framework").ValidationError; readonly fieldInvalid: (field: string, value?: unknown) => import("mcp-server-framework").ValidationError; readonly fieldTypeMismatch: (field: string, expectedType: string) => import("mcp-server-framework").ValidationError; readonly fieldMin: (field: string, min: number) => import("mcp-server-framework").ValidationError; readonly fieldMax: (field: string, max: number) => import("mcp-server-framework").ValidationError; readonly fieldPattern: (field: string) => import("mcp-server-framework").ValidationError; readonly custom: (message: string, field?: string) => import("mcp-server-framework").ValidationError; }; readonly configuration: { readonly missingEnvVar: (varName: string) => import("mcp-server-framework").ConfigurationError; readonly invalidEnvVar: (varName: string, reason: string) => import("mcp-server-framework").ConfigurationError; readonly invalid: (message: string) => import("mcp-server-framework").ConfigurationError; readonly fileNotFound: (filePath: string) => import("mcp-server-framework").ConfigurationError; readonly fileReadFailed: (filePath: string, cause?: Error) => import("mcp-server-framework").ConfigurationError; readonly fileParseFailed: (filePath: string, cause?: Error) => import("mcp-server-framework").ConfigurationError; readonly fileValidationFailed: (filePath: string, zodError: ZodError) => import("mcp-server-framework").ConfigurationError; readonly envValidationFailed: (zodError: ZodError) => import("mcp-server-framework").ConfigurationError; readonly unsupportedFormat: (extension: string) => import("mcp-server-framework").ConfigurationError; readonly constraintViolation: (message: string, fields: string[]) => import("mcp-server-framework").ConfigurationError; readonly custom: (message: string, configKey?: string) => import("mcp-server-framework").ConfigurationError; }; readonly operation: { readonly failed: (operation: string, reason?: string) => import("mcp-server-framework").OperationError; readonly timeout: (operation: string, timeoutMs: number) => import("mcp-server-framework").OperationError; readonly unavailable: (operation: string) => import("mcp-server-framework").OperationError; readonly custom: (message: string, operation?: string) => import("mcp-server-framework").OperationError; }; readonly cancellation: { readonly fromRequest: (requestId: string | number, reason?: string) => import("mcp-server-framework").OperationCancelledError; readonly fromAbortSignal: (signal: AbortSignal, requestId?: string | number) => import("mcp-server-framework").OperationCancelledError; readonly custom: (message: string, requestId?: string | number) => import("mcp-server-framework").OperationCancelledError; }; readonly internal: { readonly wrap: (error: unknown, context?: string) => import("mcp-server-framework").InternalError; readonly unexpectedState: (description: string) => import("mcp-server-framework").InternalError; readonly notImplemented: (feature: string) => import("mcp-server-framework").InternalError; readonly custom: (message: string) => import("mcp-server-framework").InternalError; }; readonly registry: { readonly toolNotFound: (name: string) => import("mcp-server-framework").RegistryError; readonly duplicateTool: (name: string) => import("mcp-server-framework").RegistryError; readonly resourceNotFound: (name: string) => import("mcp-server-framework").RegistryError; readonly duplicateResource: (name: string) => import("mcp-server-framework").RegistryError; readonly promptNotFound: (name: string) => import("mcp-server-framework").RegistryError; readonly duplicatePrompt: (name: string) => import("mcp-server-framework").RegistryError; }; readonly normalize: (error: unknown, fallbackMessage?: string) => import("mcp-server-framework").AppError; readonly isAppError: (error: unknown) => error is import("mcp-server-framework").AppError; readonly api: { readonly requestFailed: (reason?: string) => ApiError; readonly fromResponse: (status: number, message: string, endpoint?: string) => ApiError; readonly invalidResponse: (reason?: string) => ApiError; readonly parseError: (cause?: Error) => ApiError; readonly custom: (message: string, options?: { endpoint?: string; apiStatusCode?: number; }) => ApiError; }; readonly connection: { readonly failed: (target: string, reason?: string) => ConnectionError; readonly refused: (target: string) => ConnectionError; readonly timeout: (target: string) => ConnectionError; readonly custom: (message: string, target: string) => ConnectionError; }; readonly auth: { readonly failed: (reason?: string) => AuthenticationError; readonly invalidCredentials: () => AuthenticationError; readonly tokenExpired: () => AuthenticationError; readonly tokenInvalid: () => AuthenticationError; readonly unauthorized: () => AuthenticationError; readonly forbidden: () => AuthenticationError; readonly custom: (message: string) => AuthenticationError; }; readonly notFound: { readonly resource: (resource: string, type?: string) => NotFoundError; readonly server: (server: string) => NotFoundError; readonly container: (container: string) => NotFoundError; readonly stack: (stack: string) => NotFoundError; readonly deployment: (deployment: string) => NotFoundError; }; readonly client: { readonly notConfigured: () => ClientNotConfiguredError; readonly notConnected: () => ClientNotConfiguredError; readonly invalidConfiguration: (reason: string) => ClientNotConfiguredError; readonly custom: (message: string) => ClientNotConfiguredError; }; readonly getMessage: typeof getAppMessage; }; export type AppErrorFactoryType = typeof AppErrorFactory;