import type { BaseConnection, OnDisconnectCallback, SessionConfig } from "./utils/BaseConnection"; import type { AgentAudioEvent, AgentResponseEvent, ClientToolCallEvent, InternalTentativeAgentResponseEvent, InterruptionEvent, UserTranscriptionEvent } from "./utils/events"; import type { InputConfig } from "./utils/input"; export type Role = "user" | "ai"; export type Mode = "speaking" | "listening"; export type Status = "connecting" | "connected" | "disconnecting" | "disconnected"; export type Options = SessionConfig & Callbacks & ClientToolsConfig & InputConfig; export type PartialOptions = SessionConfig & Partial & Partial & Partial; export type ClientToolsConfig = { clientTools: Record Promise | string | number | void>; }; export type Callbacks = { onConnect: (props: { conversationId: string; }) => void; onDebug: (props: any) => void; onDisconnect: OnDisconnectCallback; onError: (message: string, context?: any) => void; onMessage: (props: { message: string; source: Role; }) => void; onAudio: (base64Audio: string) => void; onModeChange: (prop: { mode: Mode; }) => void; onStatusChange: (prop: { status: Status; }) => void; onCanSendFeedbackChange: (prop: { canSendFeedback: boolean; }) => void; onUnhandledClientToolCall?: (params: ClientToolCallEvent["client_tool_call"]) => void; }; export declare class BaseConversation { protected readonly options: Options; protected readonly connection: BaseConnection; protected lastInterruptTimestamp: number; protected mode: Mode; protected status: Status; protected volume: number; protected currentEventId: number; protected lastFeedbackEventId: number; protected canSendFeedback: boolean; protected static getFullOptions(partialOptions: PartialOptions): Options; protected constructor(options: Options, connection: BaseConnection); endSession(): Promise; private endSessionWithDetails; protected handleEndSession(): Promise; protected updateMode(mode: Mode): void; protected updateStatus(status: Status): void; protected updateCanSendFeedback(): void; protected handleInterruption(event: InterruptionEvent): void; protected handleAgentResponse(event: AgentResponseEvent): void; protected handleUserTranscript(event: UserTranscriptionEvent): void; protected handleTentativeAgentResponse(event: InternalTentativeAgentResponseEvent): void; protected handleClientToolCall(event: ClientToolCallEvent): Promise; protected handleAudio(event: AgentAudioEvent): void; private onMessage; private onError; getId(): string; isOpen(): boolean; setVolume: ({ volume }: { volume: number; }) => void; setMicMuted(isMuted: boolean): void; getInputByteFrequencyData(): Uint8Array; getOutputByteFrequencyData(): Uint8Array; getInputVolume(): number; getOutputVolume(): number; sendFeedback(like: boolean): void; sendContextualUpdate(text: string): void; sendUserMessage(text: string): void; sendUserActivity(): void; sendMCPToolApprovalResult(toolCallId: string, isApproved: boolean): void; }