import WebSocket from "ws"; export type RealtimeAuth = { type: "api"; apiKey: string; } | { type: "oauth"; accessToken: string; accountId?: string; }; export type RealtimePlan = { session: Record; items: Record[]; response: Record; }; export declare function isRealtimeModelID(modelID: unknown): modelID is string; export declare function realtimeWebSocketURL(modelID: string, base?: string): string; export declare function realtimeWebSocketHeaders(auth: RealtimeAuth): Record; export declare function realtimePlanFromResponsesBody(body: Record): RealtimePlan; /** * Translate one realtime server event into zero or one Responses-API SSE payloads. * Session bookkeeping frames (session.*, conversation.*, rate_limits.*) are dropped; * response.* frames pass through nearly verbatim because the realtime event family * matches the Responses streaming event family, with response.done reshaped into * response.completed/failed/incomplete carrying Responses-shaped usage. */ export declare function translateRealtimeEvent(modelID: string, event: Record): Record | undefined; type RealtimeBridgeOptions = { url: string; headers: Record; body: Record; signal?: AbortSignal; handshakeTimeoutMs?: number; idleTimeoutMs?: number; }; type WebSocketConstructorLike = new (url: string, options: { headers: Record; }) => WebSocket; export declare function supportsRealtimeUnexpectedResponseEvent(constructorName: string, bunVersion?: string | undefined): boolean; export declare function setRealtimeWebSocketConstructorForTesting(ctor?: WebSocketConstructorLike): void; /** * Bridge one Responses-API request body onto a realtime WebSocket session. * Streams Responses-shaped SSE back to the caller; when the caller asked for a * non-streaming response (body.stream === false) the final response object is * aggregated and returned as JSON instead. */ export declare function bridgeRealtimeWebSocket(options: RealtimeBridgeOptions): Promise; export {}; //# sourceMappingURL=realtime.d.ts.map