import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation"; import { IAhpJsonlLoggerOptions } from "../common/ahpJsonlLogger.js"; import type { AhpServerNotification, JsonRpcNotification, JsonRpcRequest, JsonRpcResponse, ProtocolMessage } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionProtocol"; import type { IClientTransport } from "../common/state/sessionTransport.js"; /** * A WebSocket client transport that connects to a remote agent host server. * Uses the native browser WebSocket API (available in Electron renderer). * Implements {@link IClientTransport} with JSON serialization and URI revival. */ export declare class WebSocketClientTransport extends Disposable implements IClientTransport { private readonly _address; private readonly _connectionToken; private readonly _onMessage; readonly onMessage: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event; private readonly _onClose; readonly onClose: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event; private readonly _onOpen; readonly onOpen: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event; private _ws; private _malformedFrames; /** Guards against firing onClose more than once. */ private _closeFired; get isOpen(): boolean; private readonly _ahpLogger?; constructor(_address: string, _connectionToken: string | undefined, ahpLogOptions: IAhpJsonlLoggerOptions | undefined, instantiationService: IInstantiationService); /** * Initiate the WebSocket connection. Resolves when the connection * is open, or rejects on error/timeout. */ connect(): Promise; /** * Send a message to the remote end. Returns `true` if the message was * sent, `false` if it was dropped (socket not open). On failure, the * transport is force-closed so reconnection is triggered immediately * rather than silently losing messages. */ send(message: ProtocolMessage | AhpServerNotification | JsonRpcNotification | JsonRpcResponse | JsonRpcRequest): boolean; dispose(): void; }