/** * Agentic QE v3 - HTTP Client * Fetch wrapper with timeout, retry, and circuit breaker patterns */ import { Result } from '../types'; export interface RequestOptions { timeout?: number; retries?: number; retryDelay?: number; headers?: Record; circuitBreaker?: boolean; } export interface HttpError { message: string; code: string; status?: number; cause?: Error; timing?: RequestTiming; } export interface RequestTiming { startTime: number; endTime: number; duration: number; retryCount: number; } export interface CircuitBreakerState { failures: number; lastFailure: number | null; state: 'closed' | 'open' | 'half-open'; } export declare class HttpClient { private circuitBreaker; constructor(); /** * Perform a GET request */ get(url: string, options?: RequestOptions): Promise>; /** * Perform a POST request */ post(url: string, body: unknown, options?: RequestOptions): Promise>; /** * Perform a PUT request */ put(url: string, body: unknown, options?: RequestOptions): Promise>; /** * Perform a PATCH request */ patch(url: string, body: unknown, options?: RequestOptions): Promise>; /** * Perform a DELETE request */ delete(url: string, options?: RequestOptions): Promise>; /** * Perform a health check on the given URL * Returns true if the endpoint is reachable and returns a successful status */ healthCheck(url: string): Promise; /** * Get the current circuit breaker state for a URL */ getCircuitState(url: string): CircuitBreakerState; /** * Reset the circuit breaker for a specific URL or all circuits */ resetCircuit(url?: string): void; /** * Core request method with timeout, retry, and circuit breaker */ private request; /** * Fetch with timeout using AbortController */ private fetchWithTimeout; /** * Determine error code from error type */ private getErrorCode; /** * Sleep utility for retry delays */ private sleep; } /** * Get the default HTTP client instance */ export declare function getHttpClient(): HttpClient; /** * Create a new HTTP client instance */ export declare function createHttpClient(): HttpClient; //# sourceMappingURL=http-client.d.ts.map