import type { Logger, SessionHandler } from "./types.js"; export declare const INITIAL_BACKOFF_MS = 1000; export declare const MAX_BACKOFF_MS = 5000; export declare const MAX_RETRIES = 5; export declare const DEFAULT_IDLE_TIMEOUT_MS: number; /** Shared transport config for the relay polling loop, held by both Scan and Target. */ export interface RelayConfig { scanId?: string; targetId: string; concurrency: number; baseUrl: string; headers: Record; idleTimeoutMs: number; logger: Logger; } export interface MessageLoopConfig { handler: SessionHandler; messageScopeId: string; logContext: Record; onDone: (body: { payload?: string; }) => T | undefined; rethrowHandlerErrors: boolean; throwOnIdleTimeout: boolean; logPrefix: string; } export declare function submitResponse(cfg: RelayConfig, relaySessionId: string, message: string, sessionId?: string): Promise; export declare function submitError(cfg: RelayConfig, sessionId: string, message: string): Promise; /** * Poll the relay message queue for a scope, driving the caller's SessionHandler * across concurrent sessions until the server signals done or the queue idles * out. Shared by scan execution and target recon — both push prompts through * the same relay loop, differing only in scope id and completion handling. */ export declare function runMessageLoop(cfg: RelayConfig, config: MessageLoopConfig): Promise; export declare function fetchWithRetry(url: string, init: RequestInit, maxRetries: number, logger?: Logger): Promise; export declare const sleep: (ms: number) => Promise; //# sourceMappingURL=messageLoop.d.ts.map