/** @internal Transport bridge for a single session. */ export declare class GrpcBridge { readonly addr: string; readonly agent: any; readonly pipeline: any; readonly session: any; readonly roomConfig: Record; readonly recording: any; private client; private eventStream; private callMetadata; sessionId: string; private readonly outboundQueue; /** True once the session event stream has ended; later sends fail fast instead of vanishing. */ private streamEnded; private readonly outboundDropCounts; private readonly outboundDropLastEmitTs; private readonly pumpWorkerErrorCounts; private readonly pumpWorkerErrorLastEmitTs; private running; private readonly pendingTasks; private llmStreamBridge; private llmStreamBridgeHook; private customSttPump; private customTtsPump; private observeQueue; private observeTask; constructor(runtimeAddr: string, agent: any, pipeline: any, session: any, roomConfig: Record, recording?: any); private track; private openClient; createSession(): Promise; private unaryCreateSession; /** Reject realtime configs against an engine that predates pipeline-mode derivation. */ private guardStaleEngine; /** Queue an outbound command; fails fast when the session stream has already ended. */ private putOutbound; /** Surface a fatal event-stream failure to session listeners as a `runtime_error`. */ private emitStreamFailure; destroySession(opts?: { skipDestroyRpc?: boolean; }): Promise; runEventLoop(): Promise; sendGenerate(text: string): Promise; sendCancelGeneration(): Promise; sendSetUserInputEnabled(enabled: boolean): Promise; sendSay(text: string, interruptCurrent?: boolean, voice?: string, interruptible?: boolean): Promise; sendToolResult(callId: string, resultJson: string, isError?: boolean): Promise; sendUpdateInstructions(instructions: string): Promise; /** Retune the conversation context-window budget live; zeros leave a knob unchanged. */ sendUpdateContextWindow(maxTokens: number, maxContextItems: number, keepRecentTurns: number): Promise; /** Ask the session to summarize and compress the conversation now. */ sendSummarizeContext(): Promise; /** * Clear the running conversation history. With `keepSystemPrompt`, the agent's * instructions are kept and only the turns are cleared. Returns whether the * clear was applied. */ clearContext(keepSystemPrompt?: boolean): Promise; sendUpdateTools(tools: any[]): Promise; sendPlayBackgroundAudio(fileUrl: string, volume?: number, looping?: boolean, playbackMode?: boolean, audioData?: Buffer | Uint8Array): Promise; sendPreloadBackgroundAudio(fileUrl: string, volume?: number, audioData?: Buffer | Uint8Array): Promise; sendStopBackgroundAudio(): Promise; sendPushAudioFrame(pcm: Buffer | Uint8Array, sampleRate: number): Promise; sendSendImage(mimeType: string, data: Buffer | Uint8Array): Promise; sendPublishMessage(topic: string, message: string, optionsJson: string, payloadJson: string): Promise; sendSubscribePubSub(topic: string): Promise; sendSendMessageWithFrames(text: string | null, frames: Array<[string, Buffer | Uint8Array]>, numLatestFrames?: number): Promise; sendRecordingStart(config: any): Promise; sendRecordingStop(): Promise; sendCallTransfer(transferTo: string, token?: string): Promise; sendUpdateProvider(component: string, provider: string, params?: Record | null): Promise; /** Request a live pipeline-mode switch; components are (component, provider, params) triples. */ sendReconfigurePipeline(pipelineMode: string, components: Array<[string, string, Record | null]>): Promise; sendModifyLlmToken(tokenId: number, replacement?: string, drop?: boolean): Promise; private handleCustomSttAudio; private sendCustomSttResult; private handleCustomTtsSynthesize; private sendCustomTtsAudio; private emitOutboundQueueDrop; private emitPumpWorkerError; private handleRuntimeEvent; private enqueueObserve; private observePump; private handleErrorEvent; private handleObserveEvent; private handleLlmTokenForReview; private handleBeforeLlm; private _runSttStreamHookOnce; /** * Run the registered `tts` stream hook once over a one-item text stream and return * the rewritten text (joined from the hook's forwarded chunks). @internal */ private _runTtsStreamHookOnce; private handleSttHook; private handleTtsHook; private handleToolCall; private dispatchRecordingStatus; private buildSessionConfig; private callHook; private setSessionField; private updateAgentState; private updateUserState; private currentUtterance; /** Resolve the oldest pending say()/reply() handle (FIFO). Falls back to the current one. */ private resolveUtterance; private markUtteranceDone; } /** @internal Convert a `snake_case` config key to the `camelCase` transport form. */ export declare function toWireKey(key: string): string; /** @internal Recursively rewrite keys to transport form; binary and string-map fields untouched. */ export declare function toWireKeys(value: any): any;