declare const messages: { readonly configuration_invalid: "Configuration is invalid or incomplete."; readonly authentication_required: "Authentication is required."; readonly permission_denied: "Access was denied."; readonly credential_store_unavailable: "The OS credential store could not be accessed."; readonly secret_lookup_failed: "A secret command failed or exceeded its limits."; readonly timeout: "The operation timed out."; readonly cancelled: "The operation was cancelled."; readonly connection_failed: "The server connection failed."; readonly protocol_error: "The server response or protocol is not supported."; readonly server_unknown: "The MCP server is not configured."; readonly server_disabled: "The MCP server is disabled."; readonly tool_changed: "The tool is unavailable or its configuration or schema changed."; readonly tool_error: "The tool reported an error."; readonly resource_invalid: "The resource URI is invalid."; readonly resource_not_found: "The resource is no longer available or was not found."; readonly prompts_unsupported: "The server does not advertise prompts."; readonly prompt_not_found: "The prompt is no longer available or was not found."; readonly prompt_invalid: "The prompt arguments do not match the advertised arguments or exceed their limits."; readonly prompt_too_large: "The prompt exceeds 2000 lines or 50 KiB and cannot be used. No content was attached."; readonly resources_unsupported: "The server does not advertise resource access."; readonly completions_unsupported: "The server does not advertise argument completions."; readonly completion_invalid: "The resource completion arguments are invalid."; readonly subscriptions_unsupported: "The server did not accept resource subscriptions."; readonly subscription_limit: "The connection has reached its limit of 50 resource subscriptions."; readonly catalog_changed: "The catalog kept changing during discovery."; readonly elicitation_required: "The server requires a browser step before this tool can run."; readonly elicitation_declined: "The browser step required by the server was declined or dismissed."; readonly elicitation_completed: "The browser step required by the server is complete."; readonly oauth_failed: "OAuth authentication did not complete."; readonly oauth_client_required: "OAuth requires a registered client: this server does not support dynamic client registration."; readonly oauth_registration_rejected: "The authorization server rejected OAuth client registration."; readonly oauth_client_rejected: "The authorization server rejected the OAuth client or its authentication method."; readonly oauth_pkce_unsupported: "The authorization server does not support the required S256 PKCE method."; readonly oauth_scope_rejected: "The authorization server rejected the requested OAuth scopes."; readonly oauth_scope_required: "The server requires additional OAuth permissions."; readonly oauth_grant_rejected: "The OAuth authorization code or refresh token was rejected."; readonly oauth_redirect_rejected: "The authorization server rejected the OAuth callback URL."; readonly oauth_endpoint_insecure: "The OAuth token endpoint is not secure."; readonly oauth_issuer_changed: "The OAuth authorization server changed."; readonly oauth_dpop_unavailable: "The OAuth DPoP signing key is unavailable or DPoP is disabled."; readonly callback_unavailable: "The local OAuth callback port is unavailable."; readonly busy: "Discovery is still running."; readonly operation_failed: "The operation failed."; }; export type DiagnosticCode = keyof typeof messages; export type Operation = "configuration" | "connect" | "search" | "call" | "read" | "prompt" | "complete" | "subscribe" | "auth" | "reconnect" | "refresh"; export interface DiagnosticContext { server?: string; operation: Operation; oauth?: boolean; signal?: AbortSignal; } export interface Diagnostic { code: DiagnosticCode; operation: Operation; server?: string; message: string; hint: string; } export declare function diagnostic(code: DiagnosticCode, context: DiagnosticContext): Diagnostic; /** Only constructed from local diagnostic codes; never carries a raw cause. */ export declare class DiagnosticError extends Error { readonly diagnostic: Diagnostic; constructor(diagnostic: Diagnostic); } export declare function failure(code: DiagnosticCode, context: DiagnosticContext): DiagnosticError; export declare function formatDiagnostic(value: Diagnostic): string; /** Classify SDK errors and allowlisted codes without exposing raw payloads. */ export declare function diagnose(error: unknown, context: DiagnosticContext): Diagnostic; export {};