import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event"; import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service"; import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service"; import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service"; import { IVoicePriorTimelineEntry, IVoiceSessionContext, IVoiceTranscription, IVoiceAudioResponse, IVoiceToolCall, IVoiceSpeechStarted, IVoiceSessionInit, IVoiceFeedbackPayload } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/voiceClient/voiceClientService"; import { IVoiceClientService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/voiceClient/voiceClientService.service"; export declare class VoiceClientService extends Disposable implements IVoiceClientService { private readonly _configurationService; private readonly _logService; private readonly _productService; readonly _serviceBrand: undefined; private _ws; private _reconnectAttempts; private _reconnectStartedAt; private _reconnectTimer; private _isConnected; private _isResuming; private _window; private _lastSessionId; private _pingTimer; private _pongTimer; private _contextSendTimer; private _pendingContext; private _lastSentById; private _lastSentActive; private readonly _onTranscription; readonly onTranscription: Event; private readonly _onAudioResponse; readonly onAudioResponse: Event; private readonly _onToolCall; readonly onToolCall: Event; private readonly _onSpeechStarted; readonly onSpeechStarted: Event; private readonly _onSessionInit; readonly onSessionInit: Event; private readonly _onError; readonly onError: Event; private readonly _onDidChangeConnectionState; readonly onDidChangeConnectionState: Event; get isConnected(): boolean; get isResuming(): boolean; get currentSessionId(): string | undefined; private _authToken; constructor(_configurationService: IConfigurationService, _logService: ILogService, _productService: IProductService); private _getWsUrl; connect(window: Window & typeof globalThis, authToken?: string): Promise; private _connectWebSocket; disconnect(): void; private _cleanup; private _startPing; private _stopPing; private _clearPongTimeout; private _setConnected; sendPttStart(turnId: string): void; sendPttAudioChunk(audio: string): void; sendPttEnd(): void; sendPttDiagnostic(turnId: string, metrics: Record): void; sendSessionContext(context: IVoiceSessionContext): void; flushSessionContext(): void; invalidateSessionCache(sessionId: string): void; private _sendDelta; private _seedTracking; sendToolResult(callId: string, result: string): void; sendSessionStateChange(sessionId: string, newState: string, _label: string, detail?: string, lastResponseSummary?: string): void; stopSpeaking(): void; /** * Send the start_session message with the given context. * Called by the consumer after connect() resolves and AudioContext is ready. * * ``priorTimeline`` carries an ordered slice of cross-session entries * (voice turns, voice tool calls, coding-session events, and a synthesized * coding-agent-reply summary per active session) from the previous voice * session. The BE consumes it once on the first command turn so the model * can answer recall questions across reconnects without backend * persistence. See ``IVoicePriorTimelineEntry``. */ sendStartSession(context: IVoiceSessionContext, machineId: string, priorTimeline?: readonly IVoicePriorTimelineEntry[]): void; sendResumeSession(context: IVoiceSessionContext, machineId: string): void; submitFeedback(payload: IVoiceFeedbackPayload): Promise<{ ok: boolean; error?: string; }>; dispose(): void; }