import WebSocket from 'ws'; import type { AgentEvent, InteractionResponse, ModelCapabilities, WebSocketConnection, WebSocketMessage } from '@a5c-ai/comm-adapter'; type ApprovalMode = 'yolo' | 'prompt' | 'deny'; interface QueuedUserMessage { type: 'user_message'; text: string; } interface QueuedInteractionResponse { type: 'interaction_response'; interactionId: string; response: InteractionResponse; } type SendPayload = QueuedUserMessage | QueuedInteractionResponse | WebSocketMessage | Record; export declare class CodexWebSocketConnection implements WebSocketConnection { readonly connectionId: string; readonly connectionType: "websocket"; readonly websocketUrl: string; readonly endpoint: string; private readonly prompt; private readonly cwd; private readonly requestedModel?; private readonly approvalMode; private readonly initialSessionId?; private readonly models; private readonly createSocket; private ws; private connected; private closed; private requestSeq; private pendingResponses; private pendingInteractionRequests; private eventQueue; private waitingResolver; private threadId; private currentTurnId; private currentModelId; private turnIndex; private textByItemId; private thinkingByItemId; constructor(options: { websocketUrl: string; connectionId: string; prompt: string; cwd: string; requestedModel?: string; approvalMode: ApprovalMode; sessionId?: string; models: ModelCapabilities[]; createSocket?: (url: string) => WebSocket; }); connect(): Promise; send(data: SendPayload): Promise; receive(): AsyncIterableIterator; subscribe(_channel: string): AsyncIterableIterator; unsubscribe(_channel: string): Promise; close(): Promise; private handleIncomingMessage; private handleResponse; private handleServerRequest; private handleNotification; private handleItemStarted; private handleItemCompleted; private startTurn; private sendUserMessage; private sendInteractionResponse; private buildInteractionResult; private request; private notify; private asTextInput; private mapApprovalPolicy; private buildCostRecord; private isUserMessagePayload; private isInteractionResponsePayload; private pushEvent; private baseEvent; } export {};