import type { CompletionRequest } from '../types/messages.js'; import type { SpeechRequest, SpeechResponse, TranscriptionRequest, TranscriptionResponse, VoiceConfig, VoiceProvider, VoiceSessionConfig, VoiceTurnRequest, VoiceTurnResponse } from '../types/voice.js'; import type { NexusResponse } from '../types/response.js'; import { type FamilyRuntime } from '../ops/family-telemetry.js'; import { VoiceSession, type VoiceSessionCompletionClient } from './session.js'; /** The part of a client a voice turn needs. */ export interface VoiceCompletionClient { /** Runs one completion. */ complete(request: CompletionRequest): Promise; } /** * Routes speech-to-text and text-to-speech to registered providers: the one a request names, the * configured default, or the first that supports the operation. */ export declare class VoiceManager { private config; private providers; private readonly telemetry; constructor(config?: VoiceConfig, runtime?: FamilyRuntime); /** Registers a provider under a name. Returns the manager, for chaining. */ registerProvider(name: string, provider: VoiceProvider): this; /** Whether a provider is registered. */ hasProvider(name: string): boolean; /** Every registered provider's name. */ listProviders(): string[]; /** Transcribes audio. */ transcribe(request: TranscriptionRequest): Promise; private callTranscribe; /** Synthesizes speech. */ speak(request: SpeechRequest): Promise; private callSpeak; /** * Runs one voice turn: transcribes the audio unless a transcript is given, completes, and speaks * the answer when `speech` is set. */ runTurn(request: VoiceTurnRequest, client: VoiceCompletionClient): Promise; /** Starts a multi-turn voice session. */ createSession(config: VoiceSessionConfig, client: VoiceSessionCompletionClient): VoiceSession; private requireTranscription; private withTranscript; private createTranscriptMessage; private resolveProvider; }