import type { PaymentRequirement } from "../types.js"; /** * Base error class for all 1Claw SDK errors. * Includes the HTTP status code and a machine-readable error type. */ export declare class OneclawError extends Error { readonly status: number; readonly type: string; readonly detail?: string; constructor(message: string, status: number, type: string, detail?: string); } /** Thrown on 401 Unauthorized or 403 Forbidden responses. */ export declare class AuthError extends OneclawError { constructor(message: string, status?: 401 | 403); } /** * Thrown when a resource limit is exceeded (403 with type "resource_limit_exceeded"). * The `detail` message includes the current count, limit, and tier. */ export declare class ResourceLimitExceededError extends OneclawError { constructor(message: string); } /** * Thrown on 402 Payment Required responses. * Contains the full `PaymentRequirement` so callers can inspect * price, network, and payment address before deciding to pay. */ export declare class PaymentRequiredError extends OneclawError { readonly paymentRequirement: PaymentRequirement; constructor(message: string, paymentRequirement: PaymentRequirement); } /** * Thrown when a secret is gated behind human approval. * The `approvalRequestId` can be used to poll for approval status. */ export declare class ApprovalRequiredError extends OneclawError { readonly approvalRequestId: string; constructor(approvalRequestId: string, message?: string); } /** Thrown on 404 Not Found responses. */ export declare class NotFoundError extends OneclawError { constructor(message?: string); } /** * Thrown on 409 Conflict — the resource already exists. * * Reachable since 0.59.10 on `POST /v1/vaults`, where a duplicate name used to * surface as a 500. Without this class a 409 fell through to a bare * `OneclawError` typed "unknown", which reads as our fault rather than as * something the caller chose and can change. */ export declare class ConflictError extends OneclawError { constructor(message?: string); } /** Thrown on 429 Too Many Requests responses. Includes retry timing when available. */ export declare class RateLimitError extends OneclawError { readonly retryAfterMs?: number; constructor(message?: string, retryAfterMs?: number); } /** Thrown on 400 Bad Request responses for validation failures. */ export declare class ValidationError extends OneclawError { readonly fields?: Record; constructor(message: string, fields?: Record); } /** Thrown on 500+ server-side errors. */ export declare class ServerError extends OneclawError { constructor(message?: string, status?: number); } /** * Parse an HTTP response into the appropriate typed error. * Falls back to a generic `OneclawError` for unrecognised status codes. */ export declare function errorFromResponse(res: Response): Promise; //# sourceMappingURL=errors.d.ts.map