import { z } from "zod";
/**
 * Exhaustive error codes for Stitch operations.
 * Add new codes here as needed.
 */
export declare const StitchErrorCode: z.ZodEnum<{
    NOT_FOUND: "NOT_FOUND";
    AUTH_FAILED: "AUTH_FAILED";
    PERMISSION_DENIED: "PERMISSION_DENIED";
    RATE_LIMITED: "RATE_LIMITED";
    SERVICE_UNAVAILABLE: "SERVICE_UNAVAILABLE";
    NETWORK_ERROR: "NETWORK_ERROR";
    VALIDATION_ERROR: "VALIDATION_ERROR";
    CLIENT_CLOSED: "CLIENT_CLOSED";
    CLARIFICATION_REQUIRED: "CLARIFICATION_REQUIRED";
    UNKNOWN_ERROR: "UNKNOWN_ERROR";
}>;
export type StitchErrorCode = z.infer<typeof StitchErrorCode>;
/** The question a generative tool asked instead of producing screens. */
export interface StitchClarification {
    /** The agent's question, joined from every `outputComponents[].text`. */
    question: string;
    /** Replies the agent proposed, from `outputComponents[].suggestion`. */
    suggestions: string[];
}
/**
 * Structured error data for internal Result types.
 */
export interface StitchErrorData {
    code: StitchErrorCode;
    message: string;
    suggestion?: string;
    recoverable: boolean;
    /** HTTP status, when the failure came from an HTTP response. */
    status?: number;
    /** MCP tool name, when the failure came from a tool call. */
    toolName?: string;
    /** Delay in milliseconds requested by the server before retrying. */
    retryAfter?: number;
    /** Present when `code` is `CLARIFICATION_REQUIRED`. */
    clarification?: StitchClarification;
}
/**
 * Throwable error class for the public API.
 * Extends Error so it works with try/catch and instanceof checks.
 */
export declare class StitchError extends Error {
    readonly code: StitchErrorCode;
    readonly suggestion?: string;
    readonly recoverable: boolean;
    /** HTTP status, when the failure came from an HTTP response. */
    readonly status?: number;
    /** MCP tool name, when the failure came from a tool call. */
    readonly toolName?: string;
    /** Delay in milliseconds requested by the server before retrying. */
    readonly retryAfter?: number;
    /** Present when `code` is `CLARIFICATION_REQUIRED`. */
    readonly clarification?: StitchClarification;
    constructor(data: StitchErrorData);
    /**
     * Create a StitchError from an unknown caught error.
     */
    static fromUnknown(error: unknown): StitchError;
}
//# sourceMappingURL=errors.d.ts.map