/** * Custom error types for the Qoder Agent SDK. */ /** * Thrown when an operation is aborted, typically via an AbortSignal. * Mirrors the built-in DOMException AbortError semantics. */ export declare class AbortError extends Error { constructor(message?: string); } /** * Thrown when the CLI's wire protocol version is incompatible with the * version this SDK was built against (cross-major mismatch). * * The major version of `WIRE_PROTOCOL_VERSION` (defined in `src/protocol/version.ts`) * is the compatibility boundary: any breaking change to a wire field * (rename / removal / type semantics) forces a major bump. SDK builds * against a specific major and refuses to communicate with CLIs that * announce a different one. */ /** * Thrown when the resolveModel callback does not return within * the configured `resolveModelTimeoutMs` window. The SDK does NOT * silently fall back — callers must handle this error (retry with a * fixed model, surface to the user, etc.). */ export declare class ModelPolicyTimeoutError extends Error { readonly timeoutMs: number; constructor(timeoutMs: number); } export declare class ProtocolVersionMismatchError extends Error { readonly cliProtocolVersion: string; readonly sdkProtocolVersion: string; constructor(cliProtocolVersion: string, sdkProtocolVersion: string); } /** * Thrown when an SDK operation requires a protocol capability that the * running qodercli process did not advertise in its system/init message. */ export declare class UnsupportedCliCapabilityError extends Error { readonly capability: string; constructor(capability: string); } /** Stable code for an outbound control request whose local timeout elapsed. */ export declare const CONTROL_REQUEST_TIMEOUT_CODE = "CONTROL_REQUEST_TIMEOUT"; /** * Thrown when the runtime rejects an SDK control request. * * `retryable` is true only when the runtime guarantees that retrying the * original control operation will not duplicate an operation already applied * by the Worker. */ export declare class ControlRequestError extends Error { readonly requestId: string; readonly code: string | undefined; readonly retryable: boolean; readonly details: Record | undefined; constructor(options: { requestId: string; message: string; code?: string; retryable?: boolean; details?: Record; }); }