import { type PipelineBus } from "./pipeline-bus.js"; import type { SttResultPacket } from "./packets.js"; import { SessionState } from "./packets.js"; import type { VoicePlugin } from "./plugin-contract.js"; import { type Scheduler } from "./scheduler.js"; import { TtsPlayoutClock } from "./tts-playout-clock.js"; export declare function estimatePcm16Duration(audio: Uint8Array, sampleRate: number): number; export declare function requireTtsAudioSampleRate(value: unknown): number; export declare function languageFromTranscripts(transcripts: readonly SttResultPacket[]): string; interface ForceFinalizableSttPlugin extends VoicePlugin { forceFinalize(contextId?: string): void; } export declare function findForceFinalizableSttPlugin(plugins: ReadonlyMap): ForceFinalizableSttPlugin | null; export interface VoiceSessionWatchdogsDeps { readonly bus: PipelineBus; readonly plugins: ReadonlyMap; readonly ttsPlayout: TtsPlayoutClock; readonly sttForceFinalizeTimeoutMs: number; readonly vaqiMissedResponseMs: number; readonly ttsStallMs: number; readonly inputCadenceTimeoutMs: number; readonly getSessionState: () => SessionState; readonly isGenerationInterrupted: (contextId: string) => boolean; readonly onVaqiMissedResponseFired: (contextId: string) => void; readonly scheduler?: Scheduler; } export declare class VoiceSessionWatchdogs { private readonly deps; private readonly scheduler; private sttForceFinalizeScheduled; private pendingSttContextId; /** Contexts whose STT the force-finalize watchdog has already fired on this turn. */ private readonly forceFinalizedContexts; private vaqiMissedResponseScheduled; private vaqiMissedResponseContextId; private vaqiMissedResponseStartMs; private ttsStallScheduled; private ttsStallContextId; private inputCadenceScheduled; private inputCadenceContextId; constructor(deps: VoiceSessionWatchdogsDeps); dispose(): void; scheduleSttForceFinalize(contextId: string): void; /** True when the force-finalize watchdog has already fired for this context this turn. */ wasForceFinalized(contextId: string): boolean; /** Retire the flag once the turn has completed (read by the emitter + metrics tracker). */ clearForceFinalized(contextId: string): void; clearSttForceFinalizeIfContext(contextId: string): void; startVaqiMissedResponseTimer(contextId: string, startMs: number): void; clearVaqiIfContext(contextId: string): void; armTtsStallTimer(contextId: string): void; clearTtsStallTimerFor(contextId: string): void; scheduleInputCadenceWatchdog(contextId: string): void; clearInputCadenceWatchdog(): void; private clearSttForceFinalizeTimer; private clearVaqiMissedResponseTimer; private clearTtsStallTimer; } export {}; //# sourceMappingURL=voice-agent-session-util.d.ts.map