import type { OneclawClientConfig, OneclawResponse } from "../types.js"; /** * Internal HTTP transport used by every resource module. * Handles authentication headers, 402 auto-pay, and error mapping. */ export declare class HttpClient { private baseUrl; private token?; private tokenExpiresAt; private signer?; private maxAutoPayUsd; private agentCredentials?; private refreshPromise?; private _resolvedAgentId?; private dpopEnabled; private dpopManager?; private dpopReady; private static readonly REFRESH_BUFFER_MS; constructor(config: OneclawClientConfig); /** Agent ID resolved from the token exchange (for key-only auth). */ get resolvedAgentId(): string | undefined; /** Replace the current Bearer token (called by auth methods). */ setToken(token: string): void; getToken(): string | undefined; getBaseUrl(): string; private static decodeExpiry; private ensureDPoP; private ensureToken; /** * Perform a typed request against the API and return an envelope. * Automatically retries once with an x402 payment header when * a signer is configured and the price is within limits. */ request(method: string, path: string, options?: { body?: unknown; query?: Record; headers?: Record; /** Public routes: no Bearer token, no agent token refresh. */ skipAuth?: boolean; /** Non-2xx status codes to treat as successful (parse body as T). */ acceptStatuses?: number[]; }): Promise>; /** * Same as `request` but throws on error instead of returning an envelope. * Convenient for callers that prefer exceptions. */ requestOrThrow(method: string, path: string, options?: { body?: unknown; query?: Record; headers?: Record; }): Promise; get(path: string, options?: { query?: Record; headers?: Record; }): Promise; post(path: string, body?: unknown, options?: { query?: Record; headers?: Record; }): Promise; put(path: string, body?: unknown, options?: { query?: Record; headers?: Record; }): Promise; patch(path: string, body?: unknown, options?: { query?: Record; headers?: Record; }): Promise; del(path: string, options?: { headers?: Record; }): Promise; delete(path: string, options?: { headers?: Record; }): Promise; /** * Perform a request and return the raw `Response` object without parsing. * Useful for SSE streaming or binary responses where the caller manages * the response body directly. */ rawRequest(method: string, path: string, options?: { body?: unknown; headers?: Record; }): Promise; private buildUrl; /** * Attempt to sign an x402 payment and retry the original request * with the `X-PAYMENT` header attached. */ private handlePayment; } //# sourceMappingURL=http.d.ts.map