import { GoodVibesSdkError, RETRYABLE_STATUS_CODES } from '@pellux/goodvibes-errors';
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
export { RETRYABLE_STATUS_CODES };
export type PlatformErrorCategory = 'authentication' | 'authorization' | 'billing' | 'rate_limit' | 'timeout' | 'network' | 'bad_request' | 'not_found' | 'permission' | 'tool' | 'config' | 'protocol' | 'service' | 'internal' | 'unknown';
export type PlatformErrorSource = 'provider' | 'tool' | 'transport' | 'config' | 'permission' | 'runtime' | 'render' | 'acp' | 'unknown';
export interface AppErrorOptions {
    readonly statusCode?: number | undefined;
    readonly category?: PlatformErrorCategory | undefined;
    readonly guidance?: string | undefined;
    readonly detail?: string | undefined;
    readonly source?: PlatformErrorSource | undefined;
    readonly provider?: string | undefined;
    readonly operation?: string | undefined;
    readonly phase?: string | undefined;
    readonly requestId?: string | undefined;
    readonly providerCode?: string | undefined;
    readonly providerType?: string | undefined;
    readonly retryAfterMs?: number | undefined;
    readonly rawMessage?: string | undefined;
    readonly cause?: unknown | undefined;
}
export interface ProviderErrorOptions extends AppErrorOptions {
    readonly statusCode?: number | undefined;
}
/** Base class for all application errors. Provides a machine-readable code and recoverability hint. */
export declare class AppError extends GoodVibesSdkError {
    readonly code: string;
    readonly recoverable: boolean;
    /** HTTP status code associated with the failure. */
    readonly statusCode?: number | undefined;
    /** Human-readable recovery guidance. */
    readonly guidance?: string | undefined;
    /** Additional detail string not present on GoodVibesSdkError. */
    readonly detail?: string | undefined;
    /** Raw provider message before normalisation. */
    readonly rawMessage?: string | undefined;
    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 {
    readonly code: 'CONFIG_ERROR';
    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 {
    readonly code: 'PROVIDER_ERROR';
    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;
    readonly code: 'TOOL_ERROR';
    constructor(message: string, toolName: string, options?: Pick<AppErrorOptions, 'cause'>);
}
/** Thrown for ACP (Agent Control Protocol) errors. Recoverable by default. */
export declare class AcpError extends AppError {
    readonly code: 'ACP_ERROR';
    constructor(message: string);
}
/** Thrown when an operation is denied due to insufficient permissions. Non-recoverable. */
export declare class PermissionError extends AppError {
    readonly code: 'PERMISSION_DENIED';
    constructor(message: string);
}
/** Thrown when the renderer encounters a failure. Recoverable by default. */
export declare class RenderError extends AppError {
    readonly code: 'RENDER_ERROR';
    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