import { type UpgradeOffer } from "./upgrade.js"; export declare function formatError(error: unknown): string; /** * Error carrying a structured upgrade offer, so a caller that wants the raw * data (rather than the rendered card) can still reach it. */ export declare class PlanLimitError extends Error { readonly offer: UpgradeOffer; constructor(offer: UpgradeOffer, rendered: string); } /** * Turn a non-2xx API response into an Error carrying the server's own message. * * MisarMail returns `{ error }` on most routes and `{ message }` on a few * (validation middleware); falling back to the status code keeps the tool * result readable when neither is present. * * When the body is a plan-limit rejection, the message becomes the full * rendered upgrade card — so EVERY tool surfaces the upsell automatically, * without each one needing to handle quota errors itself. */ export declare function apiError(status: number, body: unknown): Error; //# sourceMappingURL=errors.d.ts.map