/**
 * Error classification for client-facing tool error messages.
 *
 * Cluster 6 (2026-05-31 consolidated report): many tools collapsed every
 * failure into the opaque string "An error occurred", giving agents/users
 * nothing actionable. This module maps a thrown error — including the
 * imapflow-style server rejections that expose `responseText` /
 * `responseStatus` / `code` — into a small set of stable, distinguishable
 * categories plus a concise, actionable message.
 *
 * Internal stack detail is intentionally NOT included in the returned message;
 * callers should log the raw error separately (the dispatcher already does).
 */
/**
 * A connection/credential problem the OPERATOR must fix (e.g. wrong Bridge
 * password, Bridge not running). Its message is written for a human and is
 * surfaced VERBATIM to the MCP client (safeErrorMessage passes it through), so
 * the agent — and through it the user — gets actionable guidance instead of an
 * opaque "IMAP operation failed". Thrown from the connection chokepoints; not
 * reclassified.
 */
export declare class ConnectionStateError extends Error {
    constructor(message: string);
}
/** Stable, machine-stable error categories surfaced to callers. */
export type ErrorCategory = "not_found" | "conflict" | "auth" | "connection" | "timeout" | "internal";
export interface ClassifiedError {
    category: ErrorCategory;
    /** Concise, actionable, safe-to-surface message. No stack/PII. */
    message: string;
}
/**
 * Classify an arbitrary thrown value into a category + actionable message.
 *
 * @param error The thrown value.
 * @param context Optional hint about the resource being acted on (e.g. the
 *   folder or label name) so a not-found message can name it precisely.
 */
export declare function classifyError(error: unknown, context?: {
    folder?: string;
}): ClassifiedError;
/**
 * Returns true when the error looks like a "mailbox/folder does not exist"
 * rejection from the IMAP server. Used by read tools to convert an opaque
 * server rejection into a precise, named not-found error up front.
 */
export declare function isFolderNotFoundError(error: unknown): boolean;
//# sourceMappingURL=error-classify.d.ts.map