/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
/** HTTP status codes that indicate transient failures eligible for retry. Single source of truth. */
export declare const RETRYABLE_STATUS_CODES: readonly number[];
export type ErrorCategory = 'authentication' | 'authorization' | 'billing' | 'rate_limit' | 'timeout' | 'network' | 'bad_request' | 'not_found' | 'permission' | 'tool' | 'config' | 'protocol' | 'service' | 'internal' | 'unknown';
export type ErrorSource = 'provider' | 'tool' | 'transport' | 'config' | 'permission' | 'runtime' | 'render' | 'acp' | 'unknown';
export interface AppErrorOptions {
    readonly statusCode?: number;
    readonly category?: ErrorCategory;
    readonly guidance?: string;
    readonly detail?: string;
    readonly source?: ErrorSource;
    readonly provider?: string;
    readonly operation?: string;
    readonly phase?: string;
    readonly requestId?: string;
    readonly providerCode?: string;
    readonly providerType?: string;
    readonly retryAfterMs?: number;
    readonly rawMessage?: string;
}
export interface ProviderErrorOptions extends AppErrorOptions {
    readonly statusCode?: number;
}
/** Base class for all application errors. Provides a machine-readable code and recoverability hint. */
export declare class AppError extends Error {
    readonly code: string;
    readonly recoverable: boolean;
    readonly statusCode?: number;
    readonly category?: ErrorCategory;
    readonly guidance?: string;
    readonly detail?: string;
    readonly source?: ErrorSource;
    readonly provider?: string;
    readonly operation?: string;
    readonly phase?: string;
    readonly requestId?: string;
    readonly providerCode?: string;
    readonly providerType?: string;
    readonly retryAfterMs?: number;
    readonly rawMessage?: string;
    constructor(message: string, code: string, recoverable: boolean, options?: AppErrorOptions);
}
/** Thrown when configuration is invalid or cannot be loaded. Non-recoverable. */
export declare class ConfigError extends AppError {
    constructor(message: string);
}
/** Thrown when an LLM provider API call fails. Recoverable when statusCode is in RETRYABLE_STATUS_CODES. */
export declare class ProviderError extends AppError {
    constructor(message: string, statusCode?: number);
    constructor(message: string, options?: ProviderErrorOptions);
}
/** Thrown when a tool execution fails. Recoverable by default. */
export declare class ToolError extends AppError {
    readonly toolName: string;
    constructor(message: string, toolName: string);
}
/** Thrown for ACP (Agent Control Protocol) errors. Recoverable by default. */
export declare class AcpError extends AppError {
    constructor(message: string);
}
/** Thrown when an operation is denied due to insufficient permissions. Non-recoverable. */
export declare class PermissionError extends AppError {
    constructor(message: string);
}
/** Thrown when the renderer encounters a failure. Recoverable by default. */
export declare class RenderError extends AppError {
    constructor(message: string);
}
/**
 * Returns true when the error indicates a rate limit or quota exhaustion.
 * Used by SyntheticProvider and AgentOrchestrator to decide whether to
 * back-off and retry vs. escalate the error.
 */
export declare function isRateLimitOrQuotaError(err: unknown): boolean;
/**
 * Returns true when the error indicates the model's context window was exceeded.
 * Covers OpenAI, Anthropic, and generic provider error messages.
 */
export declare function isContextSizeExceededError(err: unknown): boolean;
/**
 * Returns true when the error indicates the provider is non-transient
 * (auth failures, connection refused, host not found, timeout).
 * 500/503 are deliberately excluded — server errors are transient and
 * eligible for retry. Only permanent auth/billing failures are flagged here.
 * Used to trigger graceful degradation / alternative model suggestions.
 */
export declare function isNonTransientProviderFailure(err: unknown): boolean;
//# sourceMappingURL=errors.d.ts.map