import type { RawSseEvent } from "../types.js"; import type { ResponseCreateParamsBase, ResponseStreamEvent } from "./openai-responses-wire.js"; import { ResponsesWebSocketConnection } from "./responses-websocket-connection.js"; export interface ResponsesTransportScope { url: string; modelId: string; sessionId?: string; } /** Standard Responses protocol state; all networking belongs to the shared Codex-derived channel. */ export declare class StandardResponsesWebSocketSession { #private; readonly headers: Record; readonly connection: ResponsesWebSocketConnection; constructor(url: string, headers: Record, proxy: string | undefined, connectTimeoutMs: number); get reusable(): boolean; events(body: ResponseCreateParamsBase, options: { signal: AbortSignal; chain: boolean; supportsImageDetailOriginal?: boolean; onSseEvent?: (event: RawSseEvent) => void; /** Reports whether a sent continuation anchor was accepted or definitely rejected as stale. */ onChainResult?: (accepted: boolean) => void; }): AsyncGenerator; close(): void; } export interface StandardResponsesWebSocketLease { session: StandardResponsesWebSocketSession; /** Whether repeated anchor rejections disabled continuation for this logical session. */ readonly chainDisabled: boolean; /** Mark only the logical entry this lease acquired, never a replacement created after releaseSession/close. */ markSseOnly(): void; /** Count a pre-send network failure; returns true once consecutive failures made SSE sticky. */ recordConnectFailure(): boolean; /** Count an accepted (resets) or definitely stale (increments) continuation anchor. */ recordChainResult(accepted: boolean): void; release(): void; } /** The existing session pool owns both sticky transport choice and optional physical connection. */ export declare class OpenAIResponsesTransportSessions { #private; isSseOnly(scope: ResponsesTransportScope): boolean; acquire(args: { scope: ResponsesTransportScope; headers: Record; proxy?: string; connectTimeoutMs: number; retainConnection: boolean; }): StandardResponsesWebSocketLease; releaseSession(sessionId?: string): void; close(): void; }