import type { Readable } from 'node:stream'; import type pino from 'pino'; /** Default max retries for HTTP requests (2 retries = 3 total attempts). */ export declare const DEFAULT_MAX_RETRIES = 2; /** Default base delay for exponential backoff (1 second). */ export declare const DEFAULT_BASE_DELAY_MS = 1000; /** Default timeout for HTTP requests (30 seconds). */ export declare const DEFAULT_REQUEST_TIMEOUT_MS = 30000; /** * Configure the minimum interval between outbound requests to the same * vendor hostname. Applied by {@link httpRequestWithRetry} before every * attempt (including retries). Set to 0 to disable rate limiting. */ export declare function configureVendorRateLimit(minIntervalMs: number): void; /** Test-only: reset rate limiter state between test cases. */ export declare function resetVendorRateLimitStateForTests(): void; /** * Read the entire body of a readable stream and return it as a UTF-8 string. * Works with both Buffer and string chunks. */ export declare function readBody(stream: Readable): Promise; /** Options for an HTTP request. */ export interface RequestOptions { /** HTTP method (default: GET). */ method?: string; /** Request headers. */ headers?: Record; /** Request body string. */ body?: string; /** Timeout in milliseconds (default: 30s). */ timeoutMs?: number; } /** Result of a completed HTTP request. */ export interface RequestResult { /** HTTP status code. */ statusCode: number; /** Response body as a string. */ responseText: string; } export interface RequestResult { statusCode: number; responseText: string; } /** * Perform an HTTP request with exponential-backoff retry logic. * * Retries on 429 (rate-limit), 5xx (server errors), network failures, * and retryable `EasyEdaMcpError` instances. * * @param url - The full request URL. * @param options - Request method, headers, body, and timeout. * @param logger - Pino logger instance for structured logging. * @param maxRetries - Max retries before giving up (default: 2). * @throws {EasyEdaMcpError} With code `VENDOR_API_UNAVAILABLE` when all attempts fail. */ export declare function httpRequestWithRetry(url: string, options: RequestOptions, logger: pino.Logger, maxRetries?: number): Promise;