qwen-audio-agent 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CONTRIBUTING.md +1 -0
  2. package/README.md +16 -20
  3. package/README_EN.md +21 -25
  4. package/cli/package.json +1 -1
  5. package/cli/src/arguments.mjs +39 -1
  6. package/cli/src/launcher.mjs +58 -2
  7. package/docs/configuration.md +21 -0
  8. package/package.json +7 -2
  9. package/scripts/electron-smoke.mjs +39 -0
  10. package/scripts/release-check +1 -0
  11. package/server/package.json +1 -1
  12. package/server/src/agent/agent-client.mjs +19 -79
  13. package/server/src/agent/backends/claude.mjs +0 -12
  14. package/server/src/agent/backends/codebuddy.mjs +0 -11
  15. package/server/src/agent/backends/codex.mjs +0 -11
  16. package/server/src/agent/backends/generic-acp.mjs +0 -11
  17. package/server/src/agent/backends/hermes.mjs +0 -10
  18. package/server/src/agent/backends/kimi.mjs +0 -10
  19. package/server/src/agent/backends/openclaw.mjs +0 -10
  20. package/server/src/agent/backends/opencode.mjs +0 -8
  21. package/server/src/agent/backends/qoder.mjs +0 -10
  22. package/server/src/core/config.mjs +107 -99
  23. package/server/src/index.mjs +1 -1
  24. package/server/src/voice/announcement/announcement-manager.mjs +8 -7
  25. package/server/src/voice/frontend-tools.mjs +23 -0
  26. package/server/src/voice/providers/dashscope.mjs +2 -2
  27. package/server/src/voice/providers/s2s.mjs +2 -2
  28. package/server/src/voice/realtime-gateway.mjs +12 -0
  29. package/server/src/voice/realtime-provider.mjs +2 -0
  30. package/server/src/voice/tools/tool-call-handler.mjs +38 -47
  31. package/shared/backend-install.mjs +352 -0
  32. package/shared/backend-setup.mjs +67 -1
  33. package/shared/gateway-instance-lock.mjs +8 -4
  34. package/shared/logger.mjs +65 -24
  35. package/shared/realtime-events.mjs +1 -0
  36. package/tui/package.json +1 -1
  37. package/web/dist/assets/{index-D4cd8ZoW.js → index-3ibRD0zC.js} +22 -22
  38. package/web/dist/assets/index-CYkUfr6A.css +1 -0
  39. package/web/dist/index.html +2 -2
  40. package/web/dist/assets/index-Bbuq-hRH.css +0 -1
package/CONTRIBUTING.md CHANGED
@@ -15,6 +15,7 @@ npm ci
15
15
  运行完整检查:
16
16
 
17
17
  ```bash
18
+ npm run lint
18
19
  npm test
19
20
  npm run build
20
21
  npm run release:check
package/README.md CHANGED
@@ -20,6 +20,8 @@
20
20
 
21
21
  ## News
22
22
 
23
+ - **2026-08-04 · [v1.4.1](https://github.com/QwenAudio/qwen-audio-agent/releases/tag/v1.4.1)**
24
+ 🧰 新增后台 Agent 一键安装;桌面悬浮球支持自动隐藏与快捷键唤回。
23
25
  - **2026-08-04 · [v1.4.0](https://github.com/QwenAudio/qwen-audio-agent/releases/tag/v1.4.0)**
24
26
  🧠 新增个性化规则与清单管理;桌面版支持自动休眠与快捷键唤醒。
25
27
  - **2026-08-03 · [v1.3.0](https://github.com/QwenAudio/qwen-audio-agent/releases/tag/v1.3.0)**
@@ -70,14 +72,14 @@ https://github.com/user-attachments/assets/42022655-36d1-46b2-9c26-ff0765284000
70
72
  | 后台 Agent | 接入方式 | 接入准备 | 推荐指数 |
71
73
  | --- | --- | --- | --- |
72
74
  | 无 | N/A | 仅前台模式,无需配置 | ★★★★★ |
73
- | OpenCode | 原生 ACP | 支持自动安装和百炼配置 | ★★★★★ |
74
- | OpenClaw | 内置 ACP 桥接 | 支持自动安装和百炼配置 | ★★★★★ |
75
- | Qoder | 原生 ACP | 用户自行安装和配置 | ★★★★★ |
76
- | Kimi Code | 原生 ACP | 用户自行安装和配置 | ★★★★★ |
77
- | Hermes | 原生 ACP | 用户自行安装和配置 | ★★★★☆ |
78
- | CodeBuddy | 原生 ACP | 用户自行安装和配置 | ★★★★☆ |
79
- | Codex | 外部 ACP 适配 | 用户自行安装和配置 | ★★★★☆ |
80
- | Claude Code | 外部 ACP 适配 | 用户自行安装和配置 | ★★★★☆ |
75
+ | OpenCode | 原生 ACP | 支持一键安装和百炼配置 | ★★★★★ |
76
+ | OpenClaw | 内置 ACP 桥接 | 支持一键安装和百炼配置 | ★★★★★ |
77
+ | Qoder | 原生 ACP | 支持一键安装,需用户配置 | ★★★★★ |
78
+ | Kimi Code | 原生 ACP | 支持一键安装,需用户配置 | ★★★★★ |
79
+ | Hermes | 原生 ACP | macOS / Linux 支持一键安装,需用户配置 | ★★★★☆ |
80
+ | CodeBuddy | 原生 ACP | 支持一键安装,需用户配置 | ★★★★☆ |
81
+ | Codex | 外部 ACP 适配 | 支持一键安装本体与适配器,需用户配置 | ★★★★☆ |
82
+ | Claude Code | 外部 ACP 适配 | 支持一键安装本体与适配器,需用户配置 | ★★★★☆ |
81
83
 
82
84
  推荐指数综合反映当前集成完整度、兼容性和实际验证程度:五星表示已经过充分测试的
83
85
  推荐集成,四星表示正在开发或尚未完成同等范围验证。
@@ -239,10 +241,14 @@ qwenaudio tui --audio-mode full
239
241
  ## macOS 桌面版
240
242
 
241
243
  桌面版提供常驻桌面的语音悬浮球,并内置 Gateway,无需事先启动服务。同一用户配置
242
- 目录已有兼容的本地 Gateway 时会直接复用,否则由桌面版自动启动和管理。首次运行时,
244
+ 目录已有本地 Gateway 时会直接连接并以其当前运行配置为准,否则由桌面版自动启动和管理。首次运行时,
243
245
  应用会创建配置文件,并引导你在设置页填写 DashScope API Key、选择后台 Agent
244
246
  (也可以使用仅前台模式)。
245
247
 
248
+ 闲置后悬浮球会自动隐藏并断开实时语音;也可以直接说“可以退下了”让它隐藏。应用仍
249
+ 常驻菜单栏,可从菜单栏或显示快捷键重新唤出。默认快捷键为 `⇧⌘ Space`,也可以在
250
+ 应用设置中更换。
251
+
246
252
  桌面版支持流光声波球和液态渐变球两种外观。下面分别展示它们在思考 / 呼吸状态
247
253
  下的原始动态效果:
248
254
 
@@ -311,19 +317,9 @@ AGENT_PROTOCOL=opencode
311
317
  AGENT_PROTOCOL=qoder
312
318
  ```
313
319
 
314
- 后台 Agent 需要用户自行安装并完成原生配置;qwen-audio-agent 会复用其
320
+ 已安装并完成原生配置的后台 Agent,qwen-audio-agent 会复用其
315
321
  用户级模型、工具、MCP、Skill 和认证。
316
322
 
317
- 其中部分 Agent 通过外部 ACP 适配器接入,除本体外,还需要全局安装对应的适配器。
318
- 以 Codex 为例:
319
-
320
- ```bash
321
- npm install -g @agentclientprotocol/codex-acp
322
- ```
323
-
324
- CLI 模式缺少适配器时会尝试通过 npx 按需启动;桌面版为保证启动可靠,仅使用已安装的
325
- 组件,请提前安装。
326
-
327
323
  使用其他支持 ACP stdio 的 Agent:
328
324
 
329
325
  ```dotenv
package/README_EN.md CHANGED
@@ -25,6 +25,8 @@ tells you:
25
25
 
26
26
  ## News
27
27
 
28
+ - **2026-08-04 · [v1.4.1](https://github.com/QwenAudio/qwen-audio-agent/releases/tag/v1.4.1)**
29
+ 🧰 Adds one-click backend Agent installation; the desktop orb now supports automatic hiding and shortcut recall.
28
30
  - **2026-08-04 · [v1.4.0](https://github.com/QwenAudio/qwen-audio-agent/releases/tag/v1.4.0)**
29
31
  🧠 Adds custom behavior rules and list management; desktop adds automatic sleep and shortcut wake-up.
30
32
  - **2026-08-03 · [v1.3.0](https://github.com/QwenAudio/qwen-audio-agent/releases/tag/v1.3.0)**
@@ -84,14 +86,14 @@ module walkthrough.
84
86
  | Backend Agent | Integration | Setup | Rating |
85
87
  | --- | --- | --- | --- |
86
88
  | None | N/A | Frontend-only, no setup required | ★★★★★ |
87
- | OpenCode | Native ACP | Automatic installation and Bailian setup supported | ★★★★★ |
88
- | OpenClaw | Built-in ACP Bridge | Automatic installation and Bailian setup supported | ★★★★★ |
89
- | Qoder | Native ACP | User installation and configuration required | ★★★★★ |
90
- | Kimi Code | Native ACP | User installation and configuration required | ★★★★★ |
91
- | Hermes | Native ACP | User installation and configuration required | ★★★★☆ |
92
- | CodeBuddy | Native ACP | User installation and configuration required | ★★★★☆ |
93
- | Codex | External ACP Adapter | User installation and configuration required | ★★★★☆ |
94
- | Claude Code | External ACP Adapter | User installation and configuration required | ★★★★☆ |
89
+ | OpenCode | Native ACP | One-click installation and Bailian setup supported | ★★★★★ |
90
+ | OpenClaw | Built-in ACP Bridge | One-click installation and Bailian setup supported | ★★★★★ |
91
+ | Qoder | Native ACP | One-click installation; user configuration required | ★★★★★ |
92
+ | Kimi Code | Native ACP | One-click installation; user configuration required | ★★★★★ |
93
+ | Hermes | Native ACP | One-click installation on macOS / Linux; user configuration required | ★★★★☆ |
94
+ | CodeBuddy | Native ACP | One-click installation; user configuration required | ★★★★☆ |
95
+ | Codex | External ACP Adapter | One-click Agent and adapter installation; user configuration required | ★★★★☆ |
96
+ | Claude Code | External ACP Adapter | One-click Agent and adapter installation; user configuration required | ★★★★☆ |
95
97
 
96
98
  Ratings reflect the current integration completeness, compatibility, and
97
99
  extent of real-world validation. Five stars identify recommended integrations
@@ -264,12 +266,18 @@ qwenaudio tui --audio-mode full
264
266
  ## macOS Desktop App
265
267
 
266
268
  The desktop app provides a persistent voice orb and includes the Gateway, so no
267
- service needs to be started in advance. It reuses a compatible local Gateway
268
- already running for the same user configuration directory; otherwise, it
269
- starts and manages one automatically. On first launch, the app creates its
269
+ service needs to be started in advance. If a local Gateway is already running
270
+ for the same user configuration directory, the desktop app attaches to its
271
+ current runtime configuration; otherwise, it starts and manages one
272
+ automatically. On first launch, the app creates its
270
273
  configuration file and guides you to enter a DashScope API Key and choose a
271
274
  backend Agent (or frontend-only mode) in Settings.
272
275
 
276
+ When idle, the orb hides and disconnects realtime voice; you can also say
277
+ “you can go now” to hide it. The app remains available from the menu bar. Show
278
+ it again from the menu bar or with the default `⇧⌘ Space` shortcut, or choose
279
+ another shortcut in the app.
280
+
273
281
  The desktop app includes a streaming wave orb and a liquid gradient orb. Their
274
282
  original animated thinking / breathing states are shown below:
275
283
 
@@ -345,20 +353,8 @@ Use Qoder:
345
353
  AGENT_PROTOCOL=qoder
346
354
  ```
347
355
 
348
- Backend Agents require the user to install and configure the native Agent
349
- first. qwen-audio-agent reuses its user-level model, tools, MCP servers,
350
- Skills, and authentication.
351
-
352
- Some Agents connect through external ACP adapters. Besides the Agent itself,
353
- install the matching adapter globally. For example, for Codex:
354
-
355
- ```bash
356
- npm install -g @agentclientprotocol/codex-acp
357
- ```
358
-
359
- The CLI falls back to starting a missing adapter on demand with npx; the
360
- desktop app only uses installed components for reliable startup, so install
361
- the adapter up front.
356
+ For an installed and natively configured backend Agent, qwen-audio-agent reuses
357
+ its user-level model, tools, MCP servers, Skills, and authentication.
362
358
 
363
359
  Use another Agent that supports ACP over stdio:
364
360
 
package/cli/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qwen-audio-agent/cli",
3
3
  "private": true,
4
- "version": "1.4.0",
4
+ "version": "1.4.1",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "qwenaudio": "./bin/qwenaudio.mjs"
@@ -12,6 +12,7 @@ const COMMANDS = new Set([
12
12
  'status',
13
13
  'config',
14
14
  'setup',
15
+ 'install',
15
16
  ])
16
17
  const GATEWAY_ACTIONS = new Set([
17
18
  'run',
@@ -61,6 +62,11 @@ export function parseArguments(argv, env = process.env) {
61
62
  if (command === 'gateway' && !GATEWAY_ACTIONS.has(gatewayAction)) {
62
63
  throw new Error(`未知 Gateway 命令:${gatewayAction}`)
63
64
  }
65
+ const installTarget = command === 'install'
66
+ && args[0]
67
+ && !args[0].startsWith('-')
68
+ ? args.shift()
69
+ : ''
64
70
 
65
71
  const options = {
66
72
  command,
@@ -78,9 +84,11 @@ export function parseArguments(argv, env = process.env) {
78
84
  env.QWEN_AUDIO_AGENT_BACKEND_AGENT || '',
79
85
  ).trim(),
80
86
  backendUrl: '',
87
+ installTarget: '',
81
88
  openBrowser: true,
82
89
  takeover: false,
83
90
  json: false,
91
+ yes: false,
84
92
  backendSpecified: false,
85
93
  gatewayConfigurationSpecified: false,
86
94
  }
@@ -118,10 +126,35 @@ export function parseArguments(argv, env = process.env) {
118
126
  } else if (argument === '--no-open') options.openBrowser = false
119
127
  else if (argument === '--takeover') options.takeover = true
120
128
  else if (argument === '--json') options.json = true
129
+ else if (argument === '--yes' || argument === '-y') options.yes = true
121
130
  else if (argument === '--help' || argument === '-h') options.help = true
122
131
  else throw new Error(`未知参数:${argument}`)
123
132
  }
124
133
 
134
+ if (
135
+ command === 'install'
136
+ && !normalizeBackendProtocol(installTarget)
137
+ ) {
138
+ throw new Error(
139
+ `install 缺少后台名称(可选:${backendNames().join('、')})`,
140
+ )
141
+ }
142
+ options.installTarget = normalizeBackendProtocol(installTarget)
143
+ if (
144
+ options.installTarget
145
+ && !backendDefinition(options.installTarget)
146
+ ) {
147
+ throw new Error(
148
+ `不支持的后台:${options.installTarget}(可选 ${backendNames().join('、')})`,
149
+ )
150
+ }
151
+ if (options.installTarget === 'acp') {
152
+ throw new Error('通用 ACP 后台请自行安装,并通过 ACP_COMMAND 配置')
153
+ }
154
+ if (command !== 'install' && options.yes) {
155
+ throw new Error('--yes 只适用于 install')
156
+ }
157
+
125
158
  const definition = options.backend
126
159
  ? backendDefinition(options.backend)
127
160
  : null
@@ -174,7 +207,7 @@ export function parseArguments(argv, env = process.env) {
174
207
  ? cleanOrigin(options.backendUrl || configuredBackendUrl, '后台地址')
175
208
  : ''
176
209
  if (
177
- command !== 'setup'
210
+ !['setup', 'install'].includes(command)
178
211
  && definition
179
212
  && options.backendPermissionMode === 'full'
180
213
  && !definition.supportsFullPermission
@@ -205,6 +238,7 @@ export function helpText() {
205
238
  ' qwenaudio status [选项] gateway status 的兼容别名',
206
239
  ' qwenaudio config 显示用户配置文件位置',
207
240
  ' qwenaudio setup [选项] 只读检查后台 Agent 接入准备情况',
241
+ ' qwenaudio install NAME 一键安装后台 Agent(含所需 ACP 适配器)',
208
242
  '',
209
243
  'Gateway 选项:',
210
244
  ' --url URL Gateway 地址(默认 http://127.0.0.1:3101)',
@@ -217,6 +251,10 @@ export function helpText() {
217
251
  ' --backend NAME 只检查指定后台;默认检查全部后台',
218
252
  ' --json 输出供桌面版或脚本使用的 JSON',
219
253
  '',
254
+ 'Install 选项:',
255
+ ` NAME 可选:${backendNames().filter(name => name !== 'acp').join('、')};不含通用 acp(需自行安装)`,
256
+ ' --yes, -y 脚本类安装步骤不再逐个确认(谨慎使用)',
257
+ '',
220
258
  '界面选项:',
221
259
  ' --session ID 复用指定语音会话',
222
260
  ' --audio-mode MODE Linux / Windows 使用 half(默认)或 full',
@@ -1,11 +1,13 @@
1
1
  import { dirname, resolve } from 'node:path'
2
2
  import { fileURLToPath, pathToFileURL } from 'node:url'
3
+ import readline from 'node:readline'
3
4
  import { loadRuntimeEnvironment } from '../../shared/runtime-environment.mjs'
4
5
  import { backendDefinition } from '../../shared/backend-catalog.mjs'
5
6
  import {
6
7
  formatBackendSetup,
7
8
  inspectBackendSetups,
8
9
  } from '../../shared/backend-setup.mjs'
10
+ import { installBackend } from '../../shared/backend-install.mjs'
9
11
  import { helpText, parseArguments } from './arguments.mjs'
10
12
  import {
11
13
  ensureRuntime,
@@ -87,8 +89,19 @@ async function waitForGatewayStop(url, {
87
89
  throw new Error(`Gateway 停止超时:${url}`)
88
90
  }
89
91
 
92
+ function askConfirmation(question, { stdin, stdout }) {
93
+ return new Promise(resolvePromise => {
94
+ const rl = readline.createInterface({ input: stdin, output: stdout })
95
+ rl.question(question, answer => {
96
+ rl.close()
97
+ resolvePromise(answer)
98
+ })
99
+ })
100
+ }
101
+
90
102
  export async function main(argv, {
91
103
  env = process.env,
104
+ stdin = process.stdin,
92
105
  stdout = process.stdout,
93
106
  signalSource = process,
94
107
  prepareEnvironment = ({ readOnly = false } = {}) => loadRuntimeEnvironment({
@@ -100,6 +113,10 @@ export async function main(argv, {
100
113
  env,
101
114
  backend: options.backendSpecified ? options.backend : '',
102
115
  }),
116
+ runInstaller = (id, installerOptions) => installBackend(id, {
117
+ env,
118
+ ...installerOptions,
119
+ }),
103
120
  runMinimalTui = runMinimal,
104
121
  prepareRuntime = options => ensureRuntime(options, { root, env }),
105
122
  inspectGateway = url => readGatewayHealth(url),
@@ -110,8 +127,8 @@ export async function main(argv, {
110
127
  runWebUi = options => launchWebUi(options),
111
128
  acquireInstance = directory => acquireCliInstance(directory),
112
129
  } = {}) {
113
- const setupCommand = argv[0] === 'setup'
114
- const environment = prepareEnvironment({ readOnly: setupCommand })
130
+ const readOnlyCommand = ['setup', 'install'].includes(argv[0])
131
+ const environment = prepareEnvironment({ readOnly: readOnlyCommand })
115
132
  const options = parseArguments(argv, env)
116
133
  if (options.help) {
117
134
  stdout.write(`${helpText()}\n`)
@@ -131,6 +148,45 @@ export async function main(argv, {
131
148
  || (options.backendSpecified ? report.backends[0] : null)
132
149
  return selected && !selected.ready ? 1 : 0
133
150
  }
151
+ if (options.command === 'install') {
152
+ const label = backendDefinition(options.installTarget)?.label
153
+ || options.installTarget
154
+ const confirmStep = options.yes
155
+ ? async () => true
156
+ : async step => {
157
+ stdout.write(`即将执行官方安装脚本:\n ${step.display}\n`)
158
+ const answer = await askConfirmation('确认执行?[y/N] ', {
159
+ stdin,
160
+ stdout,
161
+ })
162
+ return /^y(?:es)?$/i.test(answer.trim())
163
+ }
164
+ const result = await runInstaller(options.installTarget, {
165
+ confirmStep,
166
+ onProgress: event => {
167
+ if (event.phase === 'start') {
168
+ stdout.write(`${event.title}:${event.display}\n`)
169
+ } else if (event.phase === 'skip') {
170
+ stdout.write(`${event.title}:组件已就绪,跳过\n`)
171
+ } else if (event.phase === 'output') {
172
+ stdout.write(event.chunk)
173
+ }
174
+ },
175
+ })
176
+ if (!result.ok) {
177
+ stdout.write(
178
+ `✗ ${label} 安装未完成:${result.error?.message || '未知错误'}\n`,
179
+ )
180
+ return 1
181
+ }
182
+ stdout.write(
183
+ result.alreadyInstalled
184
+ ? `✓ ${label} 已安装并就绪\n`
185
+ : `✓ ${label} 安装完成\n`,
186
+ )
187
+ if (result.loginHint) stdout.write(`${result.loginHint}\n`)
188
+ return 0
189
+ }
134
190
 
135
191
  if (
136
192
  (options.command === 'gateway' && options.gatewayAction !== 'run')
@@ -43,6 +43,27 @@ qwenaudio setup --json
43
43
 
44
44
  JSON 输出与 CLI 使用同一个共享检测模块,可供桌面版和其他工具直接复用。
45
45
 
46
+ ## 一键安装后台 Agent
47
+
48
+ 未安装的后台 Agent 可用统一命令安装到本机:
49
+
50
+ ```bash
51
+ qwenaudio install codex
52
+ ```
53
+
54
+ - 安装前先检测,只补齐缺失的组件:原生 ACP 后台装好即可用;本体缺失时装本体;
55
+ 本体已装、仅缺 ACP 适配器时只装适配器;全部就绪时直接提示已可用。
56
+ - 安装规格(官方 npm 包与锁定版本、官方安装脚本)由 CLI 与桌面版共享同一份
57
+ 定义,版本与 `scripts/` 下 managed 启动脚本保持一致;可用对应环境变量覆盖,
58
+ 如 `OPENCODE_PACKAGE`、`CODEX_ACP_PACKAGE`、`CLAUDE_CODE_ACP_PACKAGE`。
59
+ - Codex、Claude Code 的 ACP 适配器随本体一并提供;Hermes 使用官方安装
60
+ 脚本。脚本类步骤执行前会逐个展示完整命令并等待确认,`--yes` 跳过确认
61
+ (谨慎使用)。
62
+ - 安装完成后自动重新检测该后台的可用状态;需要登录的后台会给出登录提示。
63
+ - 通用 `acp` 后台不提供一键安装,请自行安装后通过 `ACP_COMMAND` 配置。
64
+ - 桌面版设置页的“后台 Agent”列表中,未安装且支持一键安装的后台行尾会显示
65
+ “安装”按钮,与 CLI 使用同一份安装逻辑;脚本类安装会弹出原生确认框。
66
+
46
67
  ## 最小配置
47
68
 
48
69
  最小配置只需要填写实时语音凭据:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qwen-audio-agent",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "A realtime voice frontend for mainstream AI agents.",
5
5
  "author": "qwen-audio-agent contributors",
6
6
  "license": "Apache-2.0",
@@ -95,6 +95,7 @@
95
95
  "pregateway": "npm run build",
96
96
  "gateway": "npm run start --workspace server",
97
97
  "desktop": "npm run start --workspace desktop",
98
+ "test:desktop-smoke": "node scripts/electron-smoke.mjs",
98
99
  "desktop:build": "node scripts/check-desktop-release-env.mjs && npm run build && electron-builder --config desktop/electron-builder.yml --mac dmg",
99
100
  "desktop:build:local": "npm run build && electron-builder --config desktop/electron-builder.yml --config.mac.identity=- --config.mac.hardenedRuntime=false --config.mac.notarize=false --mac dmg",
100
101
  "cli": "npm run start --workspace @qwen-audio-agent/cli --",
@@ -102,6 +103,7 @@
102
103
  "backend": "node scripts/start.mjs",
103
104
  "openclaw": "./scripts/openclaw-gateway",
104
105
  "opencode": "./scripts/opencode-server",
106
+ "lint": "eslint .",
105
107
  "test": "node --test test/*.test.mjs && npm run test --workspace server && npm run test --workspace web && npm run test --workspace tui && npm run test --workspace desktop && npm run test --workspace @qwen-audio-agent/cli",
106
108
  "audit:release": "node scripts/audit-dependencies.mjs",
107
109
  "version:set": "node scripts/set-version.mjs",
@@ -120,7 +122,10 @@
120
122
  },
121
123
  "devDependencies": {
122
124
  "concurrently": "^9.2.0",
123
- "electron-builder": "26.15.7"
125
+ "electron-builder": "26.15.7",
126
+ "eslint": "10.8.0",
127
+ "eslint-plugin-react-hooks": "7.1.1",
128
+ "globals": "17.9.0"
124
129
  },
125
130
  "overrides": {
126
131
  "@hono/node-server": "2.0.12",
@@ -0,0 +1,39 @@
1
+ import { spawn } from 'node:child_process'
2
+ import { dirname, resolve } from 'node:path'
3
+ import { fileURLToPath } from 'node:url'
4
+
5
+ const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
6
+ const executable = resolve(
7
+ root,
8
+ 'node_modules/.bin',
9
+ process.platform === 'win32' ? 'electron.cmd' : 'electron',
10
+ )
11
+ const fixture = resolve(root, 'desktop/smoke/electron-smoke.cjs')
12
+
13
+ const child = spawn(executable, [fixture], {
14
+ cwd: root,
15
+ env: {
16
+ ...process.env,
17
+ ELECTRON_DISABLE_SECURITY_WARNINGS: 'true',
18
+ },
19
+ stdio: ['ignore', 'pipe', 'pipe'],
20
+ })
21
+ let stdout = ''
22
+ let stderr = ''
23
+ child.stdout.on('data', chunk => { stdout += chunk })
24
+ child.stderr.on('data', chunk => { stderr += chunk })
25
+ const timer = setTimeout(() => child.kill('SIGKILL'), 20_000)
26
+ const [code, signal] = await new Promise(resolvePromise => {
27
+ child.once('error', error => {
28
+ stderr += error.stack || error.message
29
+ resolvePromise([1, null])
30
+ })
31
+ child.once('exit', (...result) => resolvePromise(result))
32
+ })
33
+ clearTimeout(timer)
34
+ if (code !== 0 || !stdout.includes('QWEN_AUDIO_DESKTOP_SMOKE_OK')) {
35
+ throw new Error(
36
+ `Electron desktop smoke test failed (${signal || code})\n${stdout}\n${stderr}`,
37
+ )
38
+ }
39
+ process.stdout.write('Electron desktop smoke test passed.\n')
@@ -177,6 +177,7 @@ node --check shared/runtime-environment.mjs
177
177
  node --check cli/src/runtime.mjs
178
178
  git diff --check
179
179
  npm run audit:release
180
+ npm run lint
180
181
  npm test
181
182
  npm run build
182
183
  node scripts/verify-package.mjs
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qwen-audio-agent/server",
3
3
  "private": true,
4
- "version": "1.4.0",
4
+ "version": "1.4.1",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "node --watch src/index.mjs",
@@ -10,93 +10,33 @@ export class AgentClient {
10
10
  protocol = config.agentProtocol,
11
11
  ownership = config.backendOwnership,
12
12
  permissionMode = config.backendPermissionMode,
13
- baseUrl = config.openCodeBaseUrl,
14
13
  model,
14
+ coordinatorAgent,
15
15
  timeoutMs = config.agentTimeoutMs,
16
- directory = config.openCodeDirectory,
17
- coordinatorAgent = config.openCodeCoordinatorAgent,
18
- openClawBaseUrl = config.openClawBaseUrl,
19
- openClawToken = config.openClawToken,
20
- openClawTokenFile = config.openClawTokenFile,
21
- openClawCoordinatorAgent = config.openClawCoordinatorAgent,
22
- openClawDirectory = config.openClawDirectory,
23
- qoderModel = config.qoderModel,
24
- qoderDirectory = config.qoderDirectory,
25
- qoderConfigDirectory = config.qoderConfigDirectory,
26
- qoderCliPath = config.qoderCliPath,
27
- kimiDirectory = config.kimiDirectory,
28
- kimiCliPath = config.kimiCliPath,
29
- kimiModel = config.kimiModel,
30
- hermesDirectory = config.hermesDirectory,
31
- hermesCliPath = config.hermesCliPath,
32
- hermesModel = config.hermesModel,
33
- codeBuddyModel = config.codeBuddyModel,
34
- codeBuddyModelUrl = config.codeBuddyModelUrl,
35
- codeBuddyDirectory = config.codeBuddyDirectory,
36
- codeBuddyCliPath = config.codeBuddyCliPath,
37
- codexModel = config.codexModel,
38
- codexModelUrl = config.codexModelUrl,
39
- codexDirectory = config.codexDirectory,
40
- codexCliPath = config.codexCliPath,
41
- claudeDirectory = config.claudeDirectory,
42
- claudeCliPath = config.claudeCliPath,
43
- claudeExecutable = config.claudeExecutable,
44
- claudeModel = config.claudeModel,
45
- claudeConfigDirectory = config.claudeConfigDirectory,
46
- acpCommand = config.acpCommand,
47
- acpArgs = config.acpArgs,
48
- acpLabel = config.acpLabel,
49
- acpDirectory = config.acpDirectory,
50
- acpModel = config.acpModel,
51
- acpCoordinatorAgent = config.acpCoordinatorAgent,
16
+ backends = {},
52
17
  sessionStatePath = config.backendSessionStatePath,
53
18
  acpClient,
54
19
  acpClientFactory,
55
20
  sessionToolServer,
56
21
  } = {}) {
57
22
  const driver = backendDriver(protocol)
58
- const options = driver.resolveOptions({
59
- baseUrl,
60
- model,
61
- openCodeModel: config.openCodeModel,
62
- openClawModel: config.openClawModel,
63
- directory,
64
- coordinatorAgent,
65
- openClawBaseUrl,
66
- openClawToken,
67
- openClawTokenFile,
68
- openClawCoordinatorAgent,
69
- openClawDirectory,
70
- qoderModel,
71
- qoderDirectory,
72
- qoderConfigDirectory,
73
- qoderCliPath,
74
- kimiDirectory,
75
- kimiCliPath,
76
- kimiModel,
77
- hermesDirectory,
78
- hermesCliPath,
79
- hermesModel,
80
- codeBuddyModel,
81
- codeBuddyModelUrl,
82
- codeBuddyDirectory,
83
- codeBuddyCliPath,
84
- codexModel,
85
- codexModelUrl,
86
- codexDirectory,
87
- codexCliPath,
88
- claudeDirectory,
89
- claudeCliPath,
90
- claudeExecutable,
91
- claudeModel,
92
- claudeConfigDirectory,
93
- acpCommand,
94
- acpArgs,
95
- acpLabel,
96
- acpDirectory,
97
- acpModel,
98
- acpCoordinatorAgent,
99
- })
23
+ // The selected backend's option namespace (config defaults merged with
24
+ // per-construction overrides) plus the two cross-cutting overrides. New
25
+ // backends only need a config.backends entry; nothing to thread here.
26
+ const backend = {
27
+ ...(config.backends?.[driver.id] || {}),
28
+ ...(backends[driver.id] || {}),
29
+ }
30
+ const options = {
31
+ baseUrl: '',
32
+ ...backend,
33
+ model: model ?? backend.model,
34
+ coordinatorAgent: (
35
+ coordinatorAgent
36
+ ?? backend.coordinatorAgent
37
+ ?? config.backends?.opencode?.coordinatorAgent
38
+ ),
39
+ }
100
40
  const profile = driver.createProfile({
101
41
  protocol,
102
42
  root: config.root,
@@ -5,18 +5,6 @@ export const claudeBackendDriver = {
5
5
  id: 'claude',
6
6
  label: 'Claude Code',
7
7
 
8
- resolveOptions(options) {
9
- return {
10
- baseUrl: '',
11
- model: options.claudeModel,
12
- directory: options.claudeDirectory,
13
- cliPath: options.claudeCliPath,
14
- claudeExecutable: options.claudeExecutable,
15
- configDirectory: options.claudeConfigDirectory,
16
- coordinatorAgent: options.coordinatorAgent,
17
- }
18
- },
19
-
20
8
  createProfile({
21
9
  root,
22
10
  directory,
@@ -4,17 +4,6 @@ export const codeBuddyBackendDriver = {
4
4
  id: 'codebuddy',
5
5
  label: 'CodeBuddy',
6
6
 
7
- resolveOptions(options) {
8
- return {
9
- baseUrl: '',
10
- model: options.codeBuddyModel,
11
- modelUrl: options.codeBuddyModelUrl,
12
- directory: options.codeBuddyDirectory,
13
- cliPath: options.codeBuddyCliPath,
14
- coordinatorAgent: options.coordinatorAgent,
15
- }
16
- },
17
-
18
7
  createProfile({
19
8
  directory,
20
9
  cliPath,
@@ -7,17 +7,6 @@ export const codexBackendDriver = {
7
7
  id: 'codex',
8
8
  label: 'Codex',
9
9
 
10
- resolveOptions(options) {
11
- return {
12
- baseUrl: '',
13
- model: options.codexModel,
14
- modelUrl: options.codexModelUrl,
15
- directory: options.codexDirectory,
16
- cliPath: options.codexCliPath,
17
- coordinatorAgent: options.coordinatorAgent,
18
- }
19
- },
20
-
21
10
  createProfile({
22
11
  root,
23
12
  directory,