export declare const ERROR_CODES: {
    readonly AUTHENTICATION: "GATEWAY_AUTHENTICATION";
    readonly TRANSPORT: "GATEWAY_TRANSPORT";
    readonly MODEL_REFUSAL: "GATEWAY_MODEL_REFUSAL";
    readonly MALFORMED_TOOL_CALL: "GATEWAY_MALFORMED_TOOL_CALL";
    readonly CONTEXT_OVERFLOW: "GATEWAY_CONTEXT_OVERFLOW";
    readonly RATE_LIMIT: "GATEWAY_RATE_LIMIT";
    readonly TIMEOUT: "GATEWAY_TIMEOUT";
    readonly CANCELLED: "GATEWAY_CANCELLED";
    readonly CIRCUIT_OPEN: "GATEWAY_CIRCUIT_OPEN";
    readonly PROVIDER_ERROR: "GATEWAY_PROVIDER_ERROR";
    readonly CONFIG_INVALID: "GATEWAY_CONFIG_INVALID";
    readonly UNKNOWN_MODEL: "GATEWAY_UNKNOWN_MODEL";
};
export type ErrorCode = (typeof ERROR_CODES)[keyof typeof ERROR_CODES];
export declare abstract class GatewayError extends Error {
    abstract readonly code: ErrorCode;
    abstract readonly retryable: boolean;
    constructor(message: string, secrets?: readonly string[]);
}
export declare class AuthenticationError extends GatewayError {
    readonly code: "GATEWAY_AUTHENTICATION";
    readonly retryable = false;
}
export declare class TransportError extends GatewayError {
    readonly code: "GATEWAY_TRANSPORT";
    readonly retryable = true;
}
export declare class ModelRefusalError extends GatewayError {
    readonly code: "GATEWAY_MODEL_REFUSAL";
    readonly retryable = false;
}
export declare class MalformedToolCallError extends GatewayError {
    readonly code: "GATEWAY_MALFORMED_TOOL_CALL";
    readonly retryable = false;
}
export declare class ContextOverflowError extends GatewayError {
    readonly code: "GATEWAY_CONTEXT_OVERFLOW";
    readonly retryable = false;
}
export declare class RateLimitError extends GatewayError {
    readonly code: "GATEWAY_RATE_LIMIT";
    readonly retryable = true;
    readonly retryAfterMs: number | null;
    constructor(message: string, retryAfterMs?: number | null, secrets?: readonly string[]);
}
export declare class TimeoutError extends GatewayError {
    readonly code: "GATEWAY_TIMEOUT";
    readonly retryable = true;
}
export declare class CancelledError extends GatewayError {
    readonly code: "GATEWAY_CANCELLED";
    readonly retryable = false;
}
export declare class CircuitOpenError extends GatewayError {
    readonly code: "GATEWAY_CIRCUIT_OPEN";
    readonly retryable = false;
}
export declare class ProviderError extends GatewayError {
    readonly code: "GATEWAY_PROVIDER_ERROR";
    readonly retryable = false;
    readonly httpStatus: number;
    constructor(message: string, httpStatus: number, secrets?: readonly string[]);
}
export declare class ConfigInvalidError extends GatewayError {
    readonly code: "GATEWAY_CONFIG_INVALID";
    readonly retryable = false;
}
export declare class UnknownModelError extends GatewayError {
    readonly code: "GATEWAY_UNKNOWN_MODEL";
    readonly retryable = false;
}
//# sourceMappingURL=gateway.d.ts.map