/** * @license * Copyright 2026 Qwen * SPDX-License-Identifier: Apache-2.0 */ import { type MemoryConfig } from './memory/config.js'; import type { LiveLanguage } from './i18n/messages.js'; import { type PermissionMode } from './permission-preferences.js'; /** * One backend the live call can drive. `name` is what the voice model sees * (session_create's `backend` arg); it becomes the scoping prefix for * jobRefs and permission requestIds, so it must not contain ':'. */ export type BackendConfig = { name: string; kind: 'qwen-code'; baseUrl: string; token?: string; /** Live owns this local service; address and token are assigned at startup. */ managedServe?: { command: string; }; /** Opt-in local terminals; an explicit controller grant enables text delivery. */ peerDiscovery?: { qwenHome: string; controllerToken?: string; reports?: boolean; }; isDefault: boolean; } | { name: string; kind: 'acp'; command: string; args: string[]; env: Record; cwd?: string; /** * Approval mode selected after `session/new` (ACP `session/set_mode`), * e.g. `yolo`. Omitted → the advertised asking mode is forced so every * action needs an explicit approval. */ sessionMode?: string; isDefault: boolean; }; export type VisualInputSource = 'screen' | 'camera'; export type VisualInputMode = 'on-demand' | 'live-feed'; export type VisualResolution = 'native' | { width: number; height: number; }; export interface VisualInputConfig { source: VisualInputSource; mode: VisualInputMode; screenDisplayId?: string; fps: number; cameraResolution: Exclude; cameraSnapshotResolution: VisualResolution; liveResolution: Exclude; snapshotResolution: VisualResolution; } export interface ProactiveConfig { enabled: boolean; monitor: { sessionRecycleEvals: number; representationCompact: 'none' | 'normal'; }; scheduler: { evalIntervalSec: number; /** Legacy config field; no longer limits active monitors. */ maxConcurrentTasks?: number; maxFailuresPerTask: number; repeat: { cooldownSec: number; maxWaitTtsSec: number; clearBufferOnResume: boolean; }; }; vision: { windowSizeSec: number; minEvalDurationSec: number; }; audio: { windowSizeSec: number; minEvalDurationSec: number; }; } export interface LiveConfig { language?: LiveLanguage; /** Missing values retain per-request confirmation. Never migrate old grants. */ permissionMode?: PermissionMode; realtime: { endpoint: string; apiKey: string; model: string; voice?: string; }; /** Explicit [] disables delegation; otherwise exactly one backend is the default. */ backends: BackendConfig[]; /** Default working directory for handoff-created sessions. */ defaultCwd?: string; /** Data root: session logs live in `/sessions`. */ dataDir: string; /** Discovery base; the shipped Host reads `/run/daemon.json`. */ discoveryDir: string; /** Global shortcut advertised to the Host. */ shortcut?: string; /** Visual source, acquisition mode, and capture quality settings. */ visualInput: VisualInputConfig; /** Background perception and timer monitoring. */ proactive: ProactiveConfig; memory: MemoryConfig; /** Fixed listen port; 0 (default) lets the kernel pick. */ port: number; } export declare const DEFAULT_REALTIME_MODEL = "qwen3.8-omni-flash-realtime"; export declare const DEFAULT_PROACTIVE_CONFIG: ProactiveConfig; /** Shared with incremental setup so saved backends use the runtime contract. */ export declare function parseBackends(env: Record, file: Record, configPath: string): BackendConfig[]; export declare function loadConfig(env?: Record): LiveConfig;