/** * @license * Copyright 2026 Qwen * SPDX-License-Identifier: Apache-2.0 */ import { QWEN_REALTIME_OUTPUT_SAMPLE_RATE, type QwenRealtimeDeps } from './realtime-session.js'; import type { DebugArchive } from '../log/debug-archive.js'; export type NotificationSpeechPurpose = 'observation' | 'visual_result' | 'search_result' | 'task_result' | 'task_rejection' | 'peer_report' | 'permission_execution'; export interface NotificationNarrationPreferences { sourceRequest: string; fallbackLanguage: 'en' | 'zh-CN'; taskTitle: string; narrationFocus: string; styleOverride?: string; } export interface NotificationSpeechOptions { endpoint: string; apiKey?: string; model: string; voice?: string; summary: string; purpose?: NotificationSpeechPurpose; /** Runtime-formatted approval or rejection, never backend/model text. */ fixedAnnouncement?: string; language: 'en' | 'zh-CN'; narrationPreferences?: NotificationNarrationPreferences; signal?: AbortSignal; debugArchive?: DebugArchive; debugContext?: Record; } export interface NotificationSpeechResult { audio: Uint8Array; sampleRate: typeof QWEN_REALTIME_OUTPUT_SAMPLE_RATE; transcript: string; sessionId?: string; responseId?: string; } export interface NotificationSpeechDeps { createWebSocket?: QwenRealtimeDeps['createWebSocket']; timeoutMs?: number; } /** * A bounded, disposable speech-only session. Nothing is played until the * entire response has completed without tools, invalid PCM or protocol errors. */ export declare function synthesizeNotificationSpeech(sourceOptions: NotificationSpeechOptions, deps?: NotificationSpeechDeps): Promise;