/** * Error hierarchy for @a5c-ai/agent-mux. * * All errors extend the base AgentMuxError. */ import type { AgentName, ErrorCode, ValidationFieldError } from './types.js'; /** * Base error class for all agent-mux errors. * Provides a machine-readable `code` and a `recoverable` flag. */ export declare class AgentMuxError extends Error { /** Machine-readable error code. */ readonly code: ErrorCode; /** Whether the operation can be retried. */ readonly recoverable: boolean; constructor(code: ErrorCode, message: string, recoverable?: boolean); } /** * Thrown when a RunOptions field or API call requires a capability that * the target agent or model does not support. */ export declare class CapabilityError extends AgentMuxError { /** The agent that lacks the capability. */ readonly agent: AgentName; /** The capability that was requested. */ readonly capability: string; /** The model that was targeted, if applicable. */ readonly model?: string; constructor(agent: AgentName, capability: string, model?: string); } /** * Thrown when input values fail schema or range validation. */ export declare class ValidationError extends AgentMuxError { /** The field(s) that failed validation. */ readonly fields: ValidationFieldError[]; constructor(fields: ValidationFieldError[]); } /** * Thrown when an agent's authentication state prevents the requested operation. */ export declare class AuthError extends AgentMuxError { /** The agent with the auth problem. */ readonly agent: AgentName; /** Current auth status. */ readonly status: 'unauthenticated' | 'expired' | 'unknown'; /** Human-readable guidance on how to authenticate. */ readonly guidance: string; constructor(agent: AgentName, status: AuthError['status'], guidance: string); }