/** * Error codes returned by the public MCP adapter. * * These codes are stable developer-facing contract values. They intentionally * avoid exposing internal Glitch exception classes, SQL errors, provider names, * prompts, or implementation details. */ export type GlitchErrorCode = "configuration_error" | "authentication_required" | "subscription_required" | "permission_denied" | "title_required" | "not_found" | "conflict" | "validation_error" | "rate_limited" | "upstream_timeout" | "upstream_error" | "confirmation_required"; export interface GlitchErrorDetails { readonly status?: number; readonly retryAfterSeconds?: number; readonly billingUrl?: string; readonly dashboardUrl?: string; readonly fieldErrors?: Record; } /** * Sanitized error used at the MCP boundary. * * Never attach raw Response objects, request headers, Authorization values, or * private backend stack traces to this class. The message and details may be * shown directly to a developer's AI client. */ export declare class GlitchMcpError extends Error { readonly code: GlitchErrorCode; readonly details: GlitchErrorDetails; constructor(code: GlitchErrorCode, message: string, details?: GlitchErrorDetails); } export declare function isGlitchMcpError(error: unknown): error is GlitchMcpError; export declare function configurationError(message: string): GlitchMcpError; export declare function titleRequiredError(): GlitchMcpError; export declare function confirmationRequiredError(action: string): GlitchMcpError;