qwen-audio-agent 2.0.1 → 2.2.0

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 (208) hide show
  1. package/README.md +21 -10
  2. package/README_ZH.md +19 -10
  3. package/THIRD_PARTY_NOTICES.md +1 -1
  4. package/cli/package.json +1 -1
  5. package/cli/src/arguments.mjs +4 -1
  6. package/cli/src/config-command.mjs +36 -6
  7. package/cli/src/gateway-service.mjs +7 -1
  8. package/cli/src/launcher.mjs +13 -0
  9. package/config/frontend-agent/LIVE_PROMPT.md +64 -0
  10. package/config/frontend-agent/PROMPT.md +29 -26
  11. package/desktop/src/i18n.mjs +6 -1
  12. package/desktop/src/settings-config.mjs +32 -40
  13. package/desktop/src/settings-store.mjs +19 -28
  14. package/docs/architecture/deep-dive.md +103 -66
  15. package/docs/architecture/deep-dive.zh.md +73 -50
  16. package/docs/backends/configuration.md +4 -4
  17. package/docs/backends/configuration.zh.md +4 -4
  18. package/docs/backends/overview.md +3 -0
  19. package/docs/backends/overview.zh.md +3 -0
  20. package/docs/configuration/backend.md +15 -1
  21. package/docs/configuration/backend.zh.md +15 -1
  22. package/docs/configuration/frontend.md +78 -28
  23. package/docs/configuration/frontend.zh.md +76 -28
  24. package/docs/configuration.md +1 -1
  25. package/docs/configuration.zh.md +1 -1
  26. package/docs/contract.md +24 -2
  27. package/docs/contract.zh.md +20 -2
  28. package/docs/extensions.md +14 -0
  29. package/docs/extensions.zh.md +11 -0
  30. package/docs/gateway-protocol.md +26 -0
  31. package/docs/gateway-protocol.zh.md +22 -0
  32. package/docs/gateway-webrtc-client.md +3 -3
  33. package/docs/gateway-webrtc-client.zh.md +3 -3
  34. package/docs/getting-started/install.md +4 -1
  35. package/docs/getting-started/install.zh.md +4 -1
  36. package/docs/getting-started/mobile.md +8 -2
  37. package/docs/getting-started/mobile.zh.md +5 -0
  38. package/docs/getting-started/quickstart.md +2 -2
  39. package/docs/getting-started/quickstart.zh.md +2 -2
  40. package/docs/getting-started/webui.md +2 -0
  41. package/docs/getting-started/webui.zh.md +2 -0
  42. package/docs/guides/knowledge.md +8 -5
  43. package/docs/guides/knowledge.zh.md +4 -3
  44. package/docs/guides/tasks.md +63 -2
  45. package/docs/guides/tasks.zh.md +45 -1
  46. package/docs/guides/web-search.md +32 -1
  47. package/docs/guides/web-search.zh.md +28 -1
  48. package/docs/operations/troubleshooting.md +30 -0
  49. package/docs/operations/troubleshooting.zh.md +26 -0
  50. package/docs/reference/backend-adapter-sdk.md +33 -2
  51. package/docs/reference/backend-adapter-sdk.zh.md +29 -2
  52. package/docs/reference/cli.md +3 -3
  53. package/docs/reference/cli.zh.md +3 -3
  54. package/docs/scenarios/lightrag.md +2 -2
  55. package/docs/scenarios/lightrag.zh.md +2 -2
  56. package/docs/scenarios/x-omni.md +5 -2
  57. package/docs/scenarios/x-omni.zh.md +5 -2
  58. package/docs/voice-agent-architecture-presentation.zh.md +34 -37
  59. package/docs/voice-frontends/custom-provider.md +22 -4
  60. package/docs/voice-frontends/custom-provider.zh.md +22 -4
  61. package/docs/voice-frontends/google-live.md +14 -8
  62. package/docs/voice-frontends/google-live.zh.md +13 -8
  63. package/docs/voice-frontends/gpt-live-1.md +149 -0
  64. package/docs/voice-frontends/gpt-live-1.zh.md +114 -0
  65. package/docs/voice-frontends/minicpm-o.md +8 -4
  66. package/docs/voice-frontends/minicpm-o.zh.md +7 -4
  67. package/docs/voice-frontends/{gpt-live.md → openai-realtime.md} +19 -10
  68. package/docs/voice-frontends/{gpt-live.zh.md → openai-realtime.zh.md} +18 -10
  69. package/docs/voice-frontends/qwen-audio-live.md +164 -0
  70. package/docs/voice-frontends/qwen-audio-live.zh.md +122 -0
  71. package/docs/voice-frontends/qwen-audio-realtime.md +41 -15
  72. package/docs/voice-frontends/qwen-audio-realtime.zh.md +34 -12
  73. package/docs/voice-frontends/qwen-omni-realtime.md +12 -9
  74. package/docs/voice-frontends/qwen-omni-realtime.zh.md +12 -9
  75. package/docs/voice-frontends/speech-to-speech.md +8 -4
  76. package/docs/voice-frontends/speech-to-speech.zh.md +7 -3
  77. package/docs/voice-frontends/stepfun.md +7 -4
  78. package/docs/voice-frontends/stepfun.zh.md +7 -4
  79. package/examples/webrtc/start.mjs +2 -1
  80. package/package.json +34 -16
  81. package/scripts/audit-dependencies.mjs +3 -25
  82. package/scripts/electron-smoke.mjs +5 -5
  83. package/scripts/patch-build-node-gyp.mjs +63 -0
  84. package/scripts/prepare-build.mjs +2 -0
  85. package/scripts/release-check +2 -2
  86. package/scripts/runtime/claude-code-acp.mjs +5 -5
  87. package/scripts/verify-package.mjs +3 -0
  88. package/server/package.json +5 -5
  89. package/server/src/app/gateway-application.mjs +3 -0
  90. package/server/src/app/gateway-http-routes.mjs +3 -0
  91. package/server/src/app/session-conversation-history.mjs +9 -1
  92. package/server/src/backend/adapters/a2a/backend-adapter.mjs +32 -26
  93. package/server/src/backend/adapters/acp/backend-adapter.mjs +703 -251
  94. package/server/src/backend/adapters/acp/coordinator-contract.mjs +2 -13
  95. package/server/src/backend/adapters/acp/coordinator-instructions.mjs +29 -8
  96. package/server/src/backend/adapters/acp/coordinator-queue.mjs +58 -0
  97. package/server/src/backend/adapters/acp/drivers/codex.mjs +1 -1
  98. package/server/src/backend/adapters/acp/drivers/openclaw.mjs +1 -2
  99. package/server/src/backend/adapters/acp/input-broker.mjs +2 -0
  100. package/server/src/backend/adapters/acp/process-client.mjs +111 -16
  101. package/server/src/backend/adapters/acp/session-configuration.mjs +2 -19
  102. package/server/src/backend/adapters/acp/session-registry.mjs +9 -0
  103. package/server/src/backend/adapters/acp/session-tools.mjs +1 -1
  104. package/server/src/backend/adapters/acp/turn-updates.mjs +188 -0
  105. package/server/src/backend/adapters/acp/work-continuation.mjs +48 -0
  106. package/server/src/backend/adapters/agent-client.mjs +24 -1
  107. package/server/src/backend/adapters/llm/backend-adapter.mjs +393 -0
  108. package/server/src/backend/adapters/muse/backend-adapter.mjs +2 -0
  109. package/server/src/backend/availability.mjs +12 -3
  110. package/server/src/backend/backend-adapter-sdk.mjs +3 -0
  111. package/server/src/backend/backend-port.mjs +13 -0
  112. package/server/src/backend/backend-work-runtime.mjs +23 -0
  113. package/server/src/client/client-command-runtime.mjs +14 -0
  114. package/server/src/conversation/conversation-sync.mjs +26 -2
  115. package/server/src/conversation/frontend-agent-context.mjs +18 -5
  116. package/server/src/conversation/frontend-notes.mjs +7 -5
  117. package/server/src/conversation/task-result-projector.mjs +1 -1
  118. package/server/src/core/backend-events.mjs +4 -0
  119. package/server/src/core/citation.mjs +8 -2
  120. package/server/src/core/config.mjs +46 -54
  121. package/server/src/core/gateway-protocol.mjs +4 -1
  122. package/server/src/core/request-security.mjs +7 -1
  123. package/server/src/core/work-conversation-context.mjs +138 -0
  124. package/server/src/core/work-input-request.mjs +1 -0
  125. package/server/src/frontend/frontend-tools.mjs +20 -7
  126. package/server/src/frontend/retrieval/providers/bing.mjs +23 -12
  127. package/server/src/frontend/retrieval/providers/factory.mjs +18 -1
  128. package/server/src/frontend/retrieval/providers/mcp.mjs +30 -11
  129. package/server/src/frontend/retrieval/providers/so360.mjs +23 -12
  130. package/server/src/frontend/tools/agent-task-runtime.mjs +119 -99
  131. package/server/src/frontend/tools/features/agent-task-tools.mjs +23 -42
  132. package/server/src/frontend/tools/frontend-tool-context.mjs +2 -2
  133. package/server/src/frontend/tools/spawn-thinking-tool.mjs +2 -2
  134. package/server/src/frontend/tools/tool-call-handler.mjs +166 -86
  135. package/server/src/knowledge/providers/local/library.mjs +26 -6
  136. package/server/src/knowledge/providers/local/provider.mjs +25 -6
  137. package/server/src/memory/providers/markdown/context-store.mjs +24 -11
  138. package/server/src/orchestration/session-task-coordinator.mjs +13 -3
  139. package/server/src/orchestration/task-operations.mjs +54 -12
  140. package/server/src/orchestration/task-updates.mjs +82 -0
  141. package/server/src/task/reminder-scheduler.mjs +5 -1
  142. package/server/src/task/task-manager.mjs +72 -15
  143. package/server/src/task/task-recovery.mjs +12 -2
  144. package/server/src/task/task-scheduler.mjs +5 -5
  145. package/server/src/task/task-state.mjs +13 -0
  146. package/server/src/transport/gateway-client-transport.mjs +35 -0
  147. package/server/src/transport/webrtc/protocol.mjs +1 -1
  148. package/server/src/voice/announcement/announcement-manager.mjs +3 -0
  149. package/server/src/voice/audio-stream-diagnostics.mjs +139 -0
  150. package/server/src/voice/native-delegation-runtime.mjs +360 -0
  151. package/server/src/voice/providers/dashscope-live.mjs +93 -0
  152. package/server/src/voice/providers/dashscope.mjs +45 -33
  153. package/server/src/voice/providers/doubao-seeduplex-protocol.mjs +54 -0
  154. package/server/src/voice/providers/doubao-seeduplex.mjs +16 -11
  155. package/server/src/voice/providers/ga-protocol.mjs +7 -2
  156. package/server/src/voice/providers/google-live-protocol.mjs +124 -34
  157. package/server/src/voice/providers/google-live.mjs +20 -14
  158. package/server/src/voice/providers/gpt-live-1-protocol.mjs +597 -0
  159. package/server/src/voice/providers/gpt-live-1.mjs +3 -0
  160. package/server/src/voice/providers/gpt-live-client-context.mjs +182 -0
  161. package/server/src/voice/providers/minicpm-o.mjs +9 -7
  162. package/server/src/voice/providers/openai-live.mjs +150 -0
  163. package/server/src/voice/providers/{gpt-live.mjs → openai-realtime.mjs} +23 -19
  164. package/server/src/voice/providers/provider-registry.mjs +11 -1
  165. package/server/src/voice/providers/qwen-live-protocol.mjs +399 -0
  166. package/server/src/voice/providers/registry.mjs +47 -12
  167. package/server/src/voice/providers/runtime-configuration.mjs +34 -0
  168. package/server/src/voice/providers/s2s.mjs +9 -7
  169. package/server/src/voice/providers/stepfun.mjs +14 -11
  170. package/server/src/voice/realtime-input-runtime.mjs +58 -20
  171. package/server/src/voice/realtime-presentation-runtime.mjs +111 -27
  172. package/server/src/voice/realtime-provider-session.mjs +59 -14
  173. package/server/src/voice/realtime-provider.mjs +358 -45
  174. package/server/src/voice/realtime-session-runtime.mjs +282 -35
  175. package/server/src/voice/realtime-task-presentation.mjs +8 -2
  176. package/server/src/voice/realtime-turn-state.mjs +33 -2
  177. package/shared/backend/catalog.mjs +26 -2
  178. package/shared/backend/install.mjs +3 -1
  179. package/shared/backend/setup.mjs +43 -0
  180. package/shared/gateway/client-sdk.mjs +21 -6
  181. package/shared/gateway/setup.mjs +13 -1
  182. package/shared/gateway/websocket-auth.mjs +2 -1
  183. package/shared/protocol/gateway-client-protocol.mjs +14 -0
  184. package/shared/protocol/gateway-events.mjs +39 -1
  185. package/shared/realtime-legacy-environment.mjs +81 -0
  186. package/shared/realtime-model-catalog.mjs +68 -194
  187. package/shared/realtime-models/README.md +33 -0
  188. package/shared/realtime-models/dashscope.mjs +57 -0
  189. package/shared/realtime-models/google.mjs +10 -0
  190. package/shared/realtime-models/openai.mjs +24 -0
  191. package/shared/realtime-models/profile.mjs +38 -0
  192. package/shared/realtime-models/stepfun.mjs +10 -0
  193. package/shared/realtime-models/volcengine.mjs +12 -0
  194. package/shared/realtime-provider-catalog.mjs +23 -11
  195. package/shared/realtime-provider-definitions.mjs +168 -235
  196. package/shared/runtime-environment.mjs +23 -30
  197. package/shared/skill-library.mjs +49 -13
  198. package/shared/web-search-configuration.mjs +25 -2
  199. package/tui/package.json +2 -2
  200. package/tui/src/index.mjs +14 -9
  201. package/tui/src/runtime-configuration.mjs +2 -0
  202. package/tui/src/terminal-commands.mjs +40 -0
  203. package/tui/src/text-cli.mjs +10 -1
  204. package/web/dist/assets/index-Bc2Q04J9.css +1 -0
  205. package/web/dist/assets/index-bY4DFXKT.js +96 -0
  206. package/web/dist/index.html +2 -2
  207. package/web/dist/assets/index-BRaiI-dW.js +0 -91
  208. package/web/dist/assets/index-D9k8R2JY.css +0 -1
@@ -2,62 +2,103 @@
2
2
 
3
3
  语音前台负责实时交流;后台 Agent 负责执行工作。二者可独立选择。
4
4
 
5
- 本页配置写入 `qwenaudio config` 显示的 `config.env`。桌面版也可在“语音前台”设置中选择服务并填写凭据。
5
+ 供应商选择、凭据、服务地址和当前模型仍写入 `qwenaudio config` 显示的 `config.env`。桌面版“语音前台”设置修改这些连接信息,并从框架支持的模型中下拉选择。模型定义和适配参数由代码维护。
6
6
 
7
7
  ## 选择服务
8
8
 
9
9
  | 服务 | Provider 值 | 必填或首次使用配置 | 使用说明 |
10
10
  | --- | --- | --- | --- |
11
- | Qwen Audio / Omni 3.5 / Omni 3.8 | `dashscope`(默认) | `DASHSCOPE_API_KEY`;Omni 3.8 还需将 `QWEN_AUDIO_REALTIME_BASE_URL` 设为业务空间专属地址 | [Audio 语音](../voice-frontends/qwen-audio-realtime.zh.md) / [Omni 视觉](../voice-frontends/qwen-omni-realtime.zh.md) |
12
- | StepAudio 3 | `stepfun` | `STEPFUN_API_KEY` | [StepFun](../voice-frontends/stepfun.zh.md) |
13
- | OpenAI Realtime | `gpt-live` | `OPENAI_API_KEY` | [GPT-Live](../voice-frontends/gpt-live.zh.md) |
14
- | Gemini Live | `google-live` | `GOOGLE_API_KEY` | [Google Live](../voice-frontends/google-live.zh.md) |
15
- | 豆包 Seeduplex | `doubao-seeduplex` | `DOUBAO_API_KEY` | 模型、音色与服务地址配置见下表 |
16
- | Hugging Face speech-to-speech | `speech-to-speech` | 先启动服务;默认 `ws://127.0.0.1:8765/v1/realtime` | [本地模型链路](../voice-frontends/speech-to-speech.zh.md) |
17
- | MiniCPM-o 4.5 | `minicpm-o` | 先启动服务;默认 `ws://127.0.0.1:8006/v1/realtime?mode=audio` | [音频 / 视频模式及限制](../voice-frontends/minicpm-o.zh.md) |
11
+ | Qwen Audio / Audio Live / Omni | `dashscope`(默认) | DashScope API Key;Audio Live 和 Omni 3.8 还需业务空间专属地址 | [Audio Realtime](../voice-frontends/qwen-audio-realtime.zh.md) / [Audio Live](../voice-frontends/qwen-audio-live.zh.md) / [Omni 视觉](../voice-frontends/qwen-omni-realtime.zh.md) |
12
+ | StepAudio 3 | `stepfun` | StepFun API Key | [StepFun](../voice-frontends/stepfun.zh.md) |
13
+ | OpenAI | `openai` | OpenAI API Key | [GPT Realtime](../voice-frontends/openai-realtime.zh.md) / [GPT Live](../voice-frontends/gpt-live-1.zh.md) |
14
+ | Google | `google` | Google API Key | [Gemini Live](../voice-frontends/google-live.zh.md) |
15
+ | 火山引擎 | `volcengine` | 火山引擎语音 API Key | 豆包 Seeduplex 的模型、音色与服务地址见下表 |
16
+ | speech-to-speech 服务 | `speech-to-speech` | 先启动服务;默认 `ws://127.0.0.1:8765/v1/realtime` | [自行部署模型链路](../voice-frontends/speech-to-speech.zh.md) |
17
+ | 面壁智能 / MiniCPM-o 服务 | `minicpm-o` | 先启动服务或取得兼容地址;本机默认 `ws://127.0.0.1:8006/v1/realtime?mode=audio` | [音频 / 视频模式及限制](../voice-frontends/minicpm-o.zh.md) |
18
18
 
19
19
  例如,使用默认前台:
20
20
 
21
21
  ```dotenv
22
22
  QWEN_AUDIO_REALTIME_PROVIDER=dashscope
23
- DASHSCOPE_API_KEY=your-key
24
- QWEN_AUDIO_REALTIME_MODEL=qwen-audio-3.0-realtime-plus
23
+ QWEN_AUDIO_REALTIME_API_KEY=your-key
24
+ QWEN_AUDIO_REALTIME_MODEL=qwen-audio-3.1-realtime-plus
25
+ QWEN_AUDIO_REALTIME_URL=
26
+ QWEN_AUDIO_REALTIME_VOICE=
25
27
  ```
26
28
 
27
29
  切换到 StepFun 时,改选服务并填写它自己的凭据:
28
30
 
29
31
  ```dotenv
30
32
  QWEN_AUDIO_REALTIME_PROVIDER=stepfun
31
- STEPFUN_API_KEY=your-stepfun-key
33
+ QWEN_AUDIO_REALTIME_API_KEY=your-stepfun-key
34
+ QWEN_AUDIO_REALTIME_MODEL=stepaudio-3-realtime-preview
35
+ QWEN_AUDIO_REALTIME_URL=
36
+ QWEN_AUDIO_REALTIME_VOICE=
32
37
  ```
33
38
 
34
- 各家的配置可以同时保留,切换只需改 `QWEN_AUDIO_REALTIME_PROVIDER`。Gateway 不会把另一家的 Key、模型或音色拿来使用。
39
+ 所有前台使用相同的五个字段,只描述当前连接,不分别保存每家供应商的配置。切换供应商时,同时替换 Key 和模型,清空或替换地址、音色。前台凭据与后台、搜索、记忆服务的凭据独立。
35
40
 
36
- ## 模型、音色与地址
41
+ **Provider 标识供应商或服务,能否选择模型由该服务的能力决定。** 例如,先选择 `openai`,再选择 `gpt-realtime-2.1` 或 `gpt-live-1`。框架根据模型定义选择对应协议适配器;Adapter 是内部实现,不是第三个用户配置项,也不会根据模型名称猜测协议。speech-to-speech 和 MiniCPM-o 的模型由上游服务管理,Gateway 不提供模型选择。
37
42
 
38
- | Provider | 模型 | 音色 | 服务地址 |
39
- | --- | --- | --- | --- |
40
- | DashScope | `QWEN_AUDIO_REALTIME_MODEL` | Audio:`QWEN_AUDIO_REALTIME_VOICE`;Omni:`QWEN_OMNI_REALTIME_VOICE` | `QWEN_AUDIO_REALTIME_BASE_URL` |
41
- | StepFun | `STEPFUN_REALTIME_MODEL` | `STEPFUN_REALTIME_VOICE` | `STEPFUN_REALTIME_URL` |
42
- | GPT-Live | `GPT_LIVE_REALTIME_MODEL` | `GPT_LIVE_REALTIME_VOICE` | `GPT_LIVE_REALTIME_URL` |
43
- | Google Live | `GOOGLE_LIVE_REALTIME_MODEL` | `GOOGLE_LIVE_REALTIME_VOICE` | `GOOGLE_LIVE_REALTIME_URL` |
44
- | 豆包 Seeduplex | `DOUBAO_SEEDUPLEX_REALTIME_MODEL` | `DOUBAO_SEEDUPLEX_REALTIME_VOICE` | `DOUBAO_SEEDUPLEX_REALTIME_URL` |
45
- | speech-to-speech | 在上游服务设置 | 在上游服务设置 | `SPEECH_TO_SPEECH_REALTIME_URL` |
46
- | MiniCPM-o | 在上游服务设置 | 在上游服务设置 | `MINICPM_O_REALTIME_URL` |
43
+ ## 连接配置
44
+
45
+ | 字段 | 含义 |
46
+ | --- | --- |
47
+ | `QWEN_AUDIO_REALTIME_PROVIDER` | 供应商,默认 `dashscope` |
48
+ | `QWEN_AUDIO_REALTIME_MODEL` | 模型 ID;留空使用供应商默认模型 |
49
+ | `QWEN_AUDIO_REALTIME_API_KEY` | 当前服务的凭据 |
50
+ | `QWEN_AUDIO_REALTIME_URL` | WebSocket 服务地址;留空使用所选模型或供应商的默认值 |
51
+ | `QWEN_AUDIO_REALTIME_VOICE` | 指定音色;留空使用模型或服务默认值 |
52
+
53
+ 各供应商的默认值:
47
54
 
48
- 地址和模型留空使用该 Provider 的默认值;Qwen3.8 Omni 例外,必须填写[业务空间专属地址](../voice-frontends/qwen-omni-realtime.zh.md#配置)。自建服务如需 Bearer 认证,分别设置 `SPEECH_TO_SPEECH_AUTH_TOKEN` 或 `MINICPM_O_AUTH_TOKEN`。可用别名与协议细节见各服务页面。
55
+ | Provider | 默认模型 | 默认地址 |
56
+ | --- | --- | --- |
57
+ | `dashscope` | `qwen-audio-3.1-realtime-plus` | `wss://dashscope.aliyuncs.com/api-ws/v1/realtime` |
58
+ | `stepfun` | `stepaudio-3-realtime-preview` | `wss://api.stepfun.com/v1/realtime` |
59
+ | `openai` | `gpt-realtime-2.1` | `wss://api.openai.com/v1/realtime` |
60
+ | `google` | `gemini-3.8-live` | `wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent` |
61
+ | `volcengine` | `1.2.6.1` | `wss://openspeech.bytedance.com/api/v3/duplex/realtime/dialogue` |
62
+ | `speech-to-speech` | 上游配置 | `ws://127.0.0.1:8765/v1/realtime` |
63
+ | `minicpm-o` | 上游配置 | `ws://127.0.0.1:8006/v1/realtime?mode=audio` |
64
+
65
+ `openai` 选择 `gpt-live-1` 时,默认地址改为 `wss://api.openai.com/v1/live/sessions`。桌面版在同一供应商下换模型会保留 API Key;若协议适配器改变,会清空地址和音色覆盖,改用新模型默认值;`qwenaudio config set --realtime-model` 也遵循这一跨协议重置规则。直接编辑配置文件时,需自行清空或替换这两项。
66
+
67
+ speech-to-speech 与 MiniCPM-o 的模型、音色由上游服务管理,应留空;服务启用 Bearer 认证时才需填写 API Key。Qwen3.8 Omni 必须填写[业务空间专属地址](../voice-frontends/qwen-omni-realtime.zh.md#配置),不能使用 DashScope 公共默认地址。[Qwen Audio Live](../voice-frontends/qwen-audio-live.zh.md#配置) 同样需要业务空间地址,路径为 `/live`。统一配置不改变各服务的协议和能力限制,这些差异仍由 Provider adapter 处理。
68
+
69
+ GPT Live 与 Qwen Audio Live 均采用 Client 模式委派给已配置的后台 Agent。这两项集成不注册前台函数工具,也不支持口头授权。后台配置和客户端任务操作见 [GPT Live](../voice-frontends/gpt-live-1.zh.md#配置) 与 [Qwen Audio Live](../voice-frontends/qwen-audio-live.zh.md#配置) 指南。
49
70
 
50
71
  DashScope 当前内置以下模型档案:
51
72
 
52
73
  | 模型 ID | 实时输入 |
53
74
  | --- | --- |
54
- | `qwen-audio-3.0-realtime-plus`(默认) | 文字、语音 |
75
+ | `qwen-audio-3.1-realtime-plus`(默认) | 文字、语音 |
76
+ | `qwen-audio-3.1-realtime-flash` | 文字、语音 |
77
+ | `qwen-audio-3.1-live` | 文字、全双工语音;原生 Client 委派 |
78
+ | `qwen-audio-3.0-realtime-plus` | 文字、语音 |
55
79
  | `qwen-audio-3.0-realtime-flash` | 文字、语音 |
56
80
  | `qwen3.5-omni-flash-realtime` | 文字、语音、实时视觉帧 |
57
81
  | `qwen3.5-omni-plus-realtime` | 文字、语音、实时视觉帧 |
58
82
  | `qwen3.8-omni-flash-realtime` | 文字、语音、实时视觉帧 |
59
83
 
60
- 这些档案均支持工具调用。模型能否接收视觉帧,还取决于客户端和传输通道,见[视觉输入](../guides/vision.zh.md)。
84
+ Realtime 档案支持前台工具调用;Live 档案改用原生 Client 委派。模型能否接收视觉帧,还取决于客户端和传输通道,见[视觉输入](../guides/vision.zh.md)。
85
+
86
+ Audio 3.1 Plus / Flash 复用现有 `dashscope` Provider,默认音色为 `longanqian_v3.1`;
87
+ Audio 3.0 Plus / Flash 保持 `longanqian`。显式配置 `QWEN_AUDIO_REALTIME_VOICE`
88
+ 时,须选择与模型匹配的音色。Audio 模型不支持视觉输入。模型切换和工作区端点覆盖见
89
+ [Audio 使用说明](../voice-frontends/qwen-audio-realtime.zh.md)。
90
+
91
+ Audio Live 档案采用官方双工配置,默认音色为 `yunshu`。服务 ID 仍为
92
+ `qwen-audio-3.1-live`,内部会话模型为 4.0 Realtime Preview。请先阅读
93
+ [Live 指南](../voice-frontends/qwen-audio-live.zh.md#配置),不要直接复用 Realtime 地址或音色。
94
+
95
+ ## 选择受支持模型
96
+
97
+ 模型列表由框架维护,桌面版和 `qwenaudio config show` 使用同一份列表。在桌面版为当前供应商选择模型,或设置 `QWEN_AUDIO_REALTIME_MODEL`;留空使用供应商默认模型。例如,当前供应商为 `dashscope` 时,填写 `qwen-audio-3.1-realtime-flash` 即可切换到内置的 3.1 Flash,默认模型仍为 3.1 Plus。
98
+
99
+ 未支持的模型 ID 会报配置错误。用户配置不能新增模型、重定义已有模型,也不能修改其 API 绑定、能力、话轮检测或接入约束;这些参数由框架的模型适配固定。现有 `QWEN_AUDIO_REALTIME_VOICE` 和会话级音色覆盖仍然有效,但须选择与当前模型兼容的音色。
100
+
101
+ 列表表示代码已实现的支持,不代表线上服务可用性或账号授权。请确认所选模型的账号、地域、服务地址和音色,再按下文应用并验证连接。speech-to-speech 与 MiniCPM-o 的模型继续在外部服务中配置。
61
102
 
62
103
  ## 应用并验证
63
104
 
@@ -65,11 +106,11 @@ DashScope 当前内置以下模型档案:
65
106
  2. 连接客户端,确认“语音前台”已连接。
66
107
  3. 说一句话,确认能听到回答。需要工具时,再测试搜索或一个简单后台请求。
67
108
 
68
- CLI 可查看当前配置及支持的模型:
109
+ CLI 可查看当前配置及受支持模型列表:
69
110
 
70
111
  ```bash
71
112
  qwenaudio config show
72
- qwenaudio config set --realtime-model qwen-audio-3.0-realtime-flash
113
+ qwenaudio config set --realtime-model qwen-audio-3.1-realtime-flash
73
114
  ```
74
115
 
75
116
  `config set` 修改当前 Provider 的模型,不切换 Provider,也不自动重启 Gateway。远程客户端沿用远端配置;不能通过本机配置切换远端模型。
@@ -79,10 +120,17 @@ qwenaudio config set --realtime-model qwen-audio-3.0-realtime-flash
79
120
  - **MiniCPM-o** 当前适配不支持文字输入、结构化工具调用、主动播报或会话上下文恢复;适合语音 / 视觉聊天,不用于后台编排。
80
121
  - **speech-to-speech** 的语言识别、音色、工具调用质量取决于你配置的 STT、LLM 与 TTS。
81
122
  - **Google Live** 当前不向重连后的上游会话恢复历史上下文;界面保留记录不等于模型已收到历史。
123
+ - **Qwen Audio Live / GPT Live** 复用相同的 Gateway 任务系统,但原生输入与回传协议不同;名称中同为 `Live` 不代表 API 行为一致,详见各自指南。
82
124
  - 其他服务的已支持能力和限制,以各自接入页面为准。
83
125
 
84
126
  前台扩展工具另行配置:[搜索](../guides/web-search.zh.md)、[MCP](../reference/frontend-mcp.zh.md)、[OpenAPI](../reference/frontend-openapi.zh.md)。
85
127
 
86
128
  ## 旧配置排查
87
129
 
88
- 新配置只使用上面的供应商字段。`QWEN_AUDIO_REALTIME_API_KEY` 和 `QWEN_AUDIO_REALTIME_ENDPOINT` 不再作为进程环境覆盖项。旧文件读取时会转换;若提示迁移冲突,保留正确的供应商字段并移除旧字段。更多优先级规则见[配置总览](../configuration.zh.md#配置优先级)。
130
+ OpenAI 的旧 Provider 值仍可读取:`gpt-live`、`openai-realtime`、`gptlive`、`gpt-realtime` 保持 Realtime 默认模型;`gpt-live-1`、`openai-live`、`gptlive1` 保持 Live 默认模型。通过配置设置保存后,统一为 `openai` 和对应模型。旧值 `gpt-live` 不会因此切换到 Live API。
131
+
132
+ 旧 Provider 值 `google-live`、`doubao-seeduplex` 也保持可读,保存后分别统一为 `google`、`volcengine`。模型 ID、凭据和 API 行为不变;`google-live`、`doubao-seeduplex` 仅作为内部协议 Adapter 标识保留。
133
+
134
+ 供应商专属的旧前台变量仅兼容读取,上述五个统一字段优先,包括显式留空。旧文件若同时含有统一的模型/音色字段和其他供应商的模型/音色字段,需将当前所选供应商需要的值写入统一字段。Omni 原有的 `QWEN_OMNI_REALTIME_VOICE` 应移至 `QWEN_AUDIO_REALTIME_VOICE`。
135
+
136
+ 现在只保存当前连接,不再分别持久化各供应商草稿。旧变量不会自动删除,因为后台 Agent、搜索或其他模块可能仍在使用;迁移后可自行清理仅用于前台的废弃覆盖项。更多优先级规则见[配置总览](../configuration.zh.md#配置优先级)。
@@ -16,7 +16,7 @@ tokens, or local identity secrets.
16
16
  For the default voice frontend:
17
17
 
18
18
  ```dotenv
19
- DASHSCOPE_API_KEY=your-key
19
+ QWEN_AUDIO_REALTIME_API_KEY=your-key
20
20
  ```
21
21
 
22
22
  If your Backend Agent is already installed and configured, simply select it. For Qwen Code:
@@ -14,7 +14,7 @@ qwenaudio config
14
14
  使用默认语音前台:
15
15
 
16
16
  ```dotenv
17
- DASHSCOPE_API_KEY=your-key
17
+ QWEN_AUDIO_REALTIME_API_KEY=your-key
18
18
  ```
19
19
 
20
20
  已经安装并配置好后台时,选择它即可。例如 Qwen Code:
package/docs/contract.md CHANGED
@@ -34,7 +34,9 @@ Wire 7.0 replaces the permission decision `once` with explicit Task-scoped `task
34
34
  Gateway and Clients must update together. Capability IDs keep their historical
35
35
  names; negotiate the actual wire version through `session.hello`.
36
36
 
37
- The current health-contract version is `5.9.0`. The additive `5.9` line adds
37
+ The current health-contract version is `5.10.0`. The additive `5.10` line exposes
38
+ accepted client input state through authenticated health requests, with remote
39
+ results scoped to the authenticated owner. The additive `5.9` line adds
38
40
  host-issued direct device connection codes: Conversation Clients authenticate and operate through
39
41
  one WS/WSS connection, while loopback HTTP remains a host management plane. The `5.8` line adds
40
42
  capability-negotiated realtime JPEG visual frames while keeping provider wire
@@ -85,6 +87,7 @@ below instead of assuming the old list.
85
87
  | `gateway.direct-device-connection` | A loopback-only management call issues one short browser-compatible connection code containing a revocable per-device credential; native Clients import it without HTTP pairing or health preflight, while a browser exchanges its fragment token for an HttpOnly cookie | `server/test/gateway-application.test.mjs`, `test/gateway-remote-access.test.mjs`, `desktop/test/gateway-connection.test.mjs` |
86
88
  | `host.electron-entry` | `qwen-audio-agent/electron`: a CommonJS entry an Electron main process can `require`, loading every ESM contract through one `load()` | `test/consumer-install.test.mjs` |
87
89
  | `host.gateway-process` | `GatewayProcess` ships: forking, port fallback, the readiness handshake, restart, and telling a planned exit from a crash — the desktop app runs the same implementation | `desktop/test/gateway-process.test.mjs` |
90
+ | `input.client-status` | Authenticated health exposes accepted client input, host suspension and effective input; remote results are owner-scoped | `server/test/gateway-application.test.mjs`, `server/test/gateway-client-handshake.test.mjs`, `server/test/realtime-session-runtime.test.mjs` |
88
91
  | `input.suspend-protocol` | `POST /api/input/suspend\|resume`, `GET /api/input`; the Gateway relays the suspension to clients through `input.suspend` / `input.resume` | `server/test/input-suspend-protocol.test.mjs` |
89
92
  | `input.suspend-clears-playback` | Suspending also clears playback so host recording stays clean | `server/test/input-suspend-protocol.test.mjs` |
90
93
  | `input.suspend-ttl` | A suspension expires on its own when the holder never resumes | `server/test/input-arbitration.test.mjs` |
@@ -269,6 +272,8 @@ conversation surface.
269
272
  | server → client | `input.suspend` | Stop capturing outright (stronger than user-level mute: no capture, no wake word); carries `owner`, `reason`, `expiresAt` |
270
273
  | server → client | `input.resume` | Capture may resume |
271
274
  | client → server | `input.suspend.ack` | Confirms the suspension took effect on this client |
275
+ | server → client | `voice.ready` | `interruptionPlaysOut: true` when the voice model finishes the speech it already generated on an interruption: Gateway sends no `playback.clear` for a spoken barge-in, typed input, or `interrupt`, and a client keeps playing on `voice.state` `listening` and on its own `interrupt` |
276
+ | server → client | `voice.ready` | `pacedOutputAudio: true` when output audio arrives at playback speed: a client plays it from a reserve even from a local Gateway |
272
277
  | server → client | `voice.state` | Foreground voice-turn presentation state: `idle`, `listening`, `processing`, or `speaking`; `processing` remains active across a synchronous frontend tool call until its terminal result or direct follow-up response |
273
278
  | server → client | `transcript.final` | A final assistant transcript may include `citations: [{ id, title, url, snippet?, source?, published_at? }]`; capability: `messages.citations` |
274
279
 
@@ -304,7 +309,7 @@ the lease. Locked by `test/consumer-install.test.mjs` and
304
309
 
305
310
  Starting `server/src/index.mjs` without the required realtime credential is
306
311
  refused before the lease is touched: the process exits non-zero and the error
307
- names every missing key (`DASHSCOPE_API_KEY`, or the Speech-to-Speech service
312
+ names every missing key (`QWEN_AUDIO_REALTIME_API_KEY`, or the Speech-to-Speech service
308
313
  address when that provider is selected). `QWEN_AUDIO_ALLOW_UNCONFIGURED=1`
309
314
  opts out for harnesses that never open a voice connection. Locked by
310
315
  `test/gateway-setup.test.mjs` and `test/consumer-install.test.mjs`.
@@ -314,3 +319,20 @@ opts out for harnesses that never open a voice connection. Locked by
314
319
  Shipped code runs on the oldest Node admitted by the `engines` range. CI runs
315
320
  the suite on that version, and `test/runtime-baseline.test.mjs` fails the
316
321
  build if shipped code uses an API newer than the baseline.
322
+
323
+ ## Client input status
324
+
325
+ With `input.client-status`, `GET /api/health` includes `voiceInput`:
326
+
327
+ ```json
328
+ {"inputEnabled":false,"inputActive":false,"clients":[{"clientType":"cli","inputEnabled":false,"inputSuspended":false,"inputActive":false}]}
329
+ ```
330
+
331
+ `inputEnabled` is the runtime's accepted client input setting; `inputSuspended`
332
+ is a separate host hold. `inputActive` requires enabled input, no host hold,
333
+ an awake runtime and active voice ownership. It is a runtime input gate, not a
334
+ measurement of physical microphone capture. Only active voice clients appear;
335
+ without one, `inputEnabled` is `null`, `inputActive` is `false`, and `clients`
336
+ is empty. Loopback operators see an aggregate across owners; authenticated
337
+ remote requests see only their owner. This read does not claim a client lease.
338
+ State is transient and carries no owner IDs, device IDs, credentials or media.
@@ -28,7 +28,7 @@ Delivery、Client Action、参考 Client SDK 与有限回放均落在同一条 W
28
28
  线协议 7.0 将权限决定 `once` 替换为明确的 Task 级 `task`,Gateway 与客户端
29
29
  需要同步更新。Capability ID 保留历史名称,实际线协议版本通过 `session.hello` 协商。
30
30
 
31
- 当前健康契约版本为 `5.9.0`。新增的 `5.9` 能力允许网关主机直接签发设备连接码:
31
+ 当前健康契约版本为 `5.10.0`。新增的 `5.10` 能力通过已认证健康接口公开客户端输入状态,远程结果仅限已认证用户。新增的 `5.9` 能力允许网关主机直接签发设备连接码:
32
32
  对话客户端只用一条 WS/WSS 完成认证与业务,本机 HTTP 仅保留为宿主管理面。`5.8` 能力通过 capability 协商提供实时 JPEG
33
33
  视觉帧,并把厂商线协议保留在 Realtime Provider Adapter 内。`5.7` 能力提供远程 Client 认证、一次性
34
34
  设备配对,以及按用户生效的活动 Client 接管与租约代次 fencing。`5.6` 能力为可替换客户端提供
@@ -66,6 +66,7 @@ Task 事件提供与 A2A 对齐的 `submitted`、
66
66
  | `gateway.direct-device-connection` | 仅本机可调用的管理接口签发一个包含可撤销独立设备凭证的短浏览器兼容连接码;原生客户端导入时不需要 HTTP 配对或健康预检,浏览器仅把 fragment Token 换成 HttpOnly Cookie | `server/test/gateway-application.test.mjs`、`test/gateway-remote-access.test.mjs`、`desktop/test/gateway-connection.test.mjs` |
67
67
  | `host.electron-entry` | `qwen-audio-agent/electron`:Electron 主进程可直接 `require` 的 CommonJS 入口,一次 `load()` 拿到全部契约 | `test/consumer-install.test.mjs` |
68
68
  | `host.gateway-process` | `GatewayProcess` 随包发布:fork、端口回退、就绪握手、重启、计划退出与崩溃分离——桌面版跑的是同一份实现 | `desktop/test/gateway-process.test.mjs` |
69
+ | `input.client-status` | 已认证健康接口公开客户端输入启用、宿主暂停与有效输入状态;远程结果只限所属用户 | `server/test/gateway-application.test.mjs`, `server/test/gateway-client-handshake.test.mjs`, `server/test/realtime-session-runtime.test.mjs` |
69
70
  | `input.suspend-protocol` | `POST /api/input/suspend\|resume`、`GET /api/input`;Gateway 通过 `input.suspend` / `input.resume` 把抢占传达给客户端 | `server/test/input-suspend-protocol.test.mjs` |
70
71
  | `input.suspend-clears-playback` | 抢占同时清除播报,宿主录音不会录进 Gateway 自己的语音 | `server/test/input-suspend-protocol.test.mjs` |
71
72
  | `input.suspend-ttl` | 持有者不主动释放时抢占自行过期 | `server/test/input-arbitration.test.mjs` |
@@ -239,6 +240,8 @@ await orb.load()
239
240
  | 服务端 → 客户端 | `input.suspend` | 立即停止采集(比用户级静音更强:不采集、不做唤醒词检测);携带 `owner`、`reason`、`expiresAt` |
240
241
  | 服务端 → 客户端 | `input.resume` | 可以恢复采集 |
241
242
  | 客户端 → 服务端 | `input.suspend.ack` | 确认抢占已在本客户端生效 |
243
+ | 服务端 → 客户端 | `voice.ready` | 语音模型在打断时会把已经生成的语音说完时带 `interruptionPlaysOut: true`:插话、文字输入或 `interrupt` 时 Gateway 不发 `playback.clear`,客户端在 `voice.state` 为 `listening` 和自己发 `interrupt` 时继续播放 |
244
+ | 服务端 → 客户端 | `voice.ready` | 输出音频按播放速度到达时带 `pacedOutputAudio: true`:客户端连本机 Gateway 时也先缓冲再播放 |
242
245
  | 服务端 → 客户端 | `voice.state` | 前台语音轮次的表现状态:`idle`、`listening`、`processing` 或 `speaking`;同步前台工具调用期间保持 `processing`,直到终止结果或直连后续回复开始 |
243
246
  | 服务端 → 客户端 | `transcript.final` | 最终助手转写可携带 `citations: [{ id, title, url, snippet?, source?, published_at? }]`;能力位:`messages.citations` |
244
247
 
@@ -267,7 +270,7 @@ startedAt, heartbeatAt }`。定位实例的方式:读租约、探活 `origin`
267
270
 
268
271
  ## 启动门禁(setup gate)
269
272
 
270
- 缺少必填的实时语音凭据(`DASHSCOPE_API_KEY`,或选择 Speech-to-Speech 时的
273
+ 缺少必填的实时语音凭据(`QWEN_AUDIO_REALTIME_API_KEY`,或选择 Speech-to-Speech 时的
271
274
  服务地址)时,`server/src/index.mjs` 在触碰租约之前即拒绝启动:进程以非零
272
275
  退出,错误信息点名每一个缺失的键。`QWEN_AUDIO_ALLOW_UNCONFIGURED=1` 供
273
276
  从不建立语音连接的调试场景显式跳过。锁定测试:`test/gateway-setup.test.mjs`、
@@ -278,3 +281,18 @@ startedAt, heartbeatAt }`。定位实例的方式:读租约、探活 `origin`
278
281
  发布代码必须能在 `engines` 范围允许的最老 Node 上运行。CI 在该版本上实跑
279
282
  测试套件,`test/runtime-baseline.test.mjs` 会在发布代码用到高于基线的 API
280
283
  时让构建失败。
284
+
285
+ ## 客户端输入状态
286
+
287
+ 具备 `input.client-status` 能力时,`GET /api/health` 返回 `voiceInput`:
288
+
289
+ ```json
290
+ {"inputEnabled":false,"inputActive":false,"clients":[{"clientType":"cli","inputEnabled":false,"inputSuspended":false,"inputActive":false}]}
291
+ ```
292
+
293
+ `inputEnabled` 是运行时接受的客户端输入设置;`inputSuspended` 单独表示宿主暂停。
294
+ `inputActive` 要求输入启用、没有宿主暂停、运行时处于唤醒状态且持有语音所有权。
295
+ 它表示运行时输入通道,不能据此证明物理麦克风是否正在采集。仅列出活动语音客户端;
296
+ 没有活动客户端时,`inputEnabled` 为 `null`、`inputActive` 为 `false`,`clients` 为空。
297
+ 本机管理者可查看各用户汇总,远程调用只返回已认证用户的状态;查询不会占用客户端租约。
298
+ 状态不持久化,不包含用户 ID、设备 ID、凭证或媒体内容。
@@ -60,6 +60,20 @@ VoiceMem installation and configuration example:
60
60
 
61
61
  ## Client: Build Your Own
62
62
 
63
+ Server-registered Client Event handlers receive connection-scoped effects for
64
+ external input pipelines: `setExternalInput(boolean, { audioInput })` switches off
65
+ ordinary input processing while optionally continuing native audio ingress.
66
+ The provider connection and its turn detection remain unchanged.
67
+ `onRealtimeEvent(listener)` observes normalized provider events, replays unfinished
68
+ speech on subscription, and returns an unsubscribe function. `appendAudio(audio)`
69
+ uses the ordinary microphone ingress checks. `setInputCollecting(boolean)` cancels the current response and
70
+ blocks premature presentation/tools while collecting; `submitInput(parts)` creates
71
+ an ordinary user turn after collection ends. `publishClientState(state, data)`
72
+ sends a `client.state` event, and `onDisconnect(cleanup)` releases extension-owned
73
+ resources. These effects are only supplied to trusted registered handlers, never
74
+ decoded from client payloads. The [four-zone cockpit example](https://github.com/QwenAudio/qwen-audio-agent/blob/main/examples/smart-cockpit/docs/multi-zone.md)
75
+ keeps its ASR, batching and seat semantics outside the framework.
76
+
63
77
  The Gateway speaks typed events over a single WebSocket. Build a custom client
64
78
  against the client protocol, or embed the assistant into a host page through
65
79
  the stability contract — the same channel the desktop orb, TUI, and WebUI use.
@@ -56,6 +56,17 @@ VoiceMem 安装与配置示例:
56
56
 
57
57
  ## 客户端:自己构建
58
58
 
59
+ 服务端注册的 Client Event handler 可以使用连接作用域的外部输入 effects:
60
+ `setExternalInput(boolean, { audioInput })` 暂停普通输入处理,可选择继续原生音频
61
+ 输入,保持模型连接和原有轮次检测。`onRealtimeEvent(listener)` 订阅规范化模型事件,
62
+ 订阅时回放未完成的语音输入,并返回取消订阅函数;`appendAudio(audio)` 沿用普通
63
+ 麦克风入口校验。`setInputCollecting(boolean)`
64
+ 取消旧回复并在收集期间阻止提前展示与工具执行;收集结束后用 `submitInput(parts)`
65
+ 创建普通用户轮次。`publishClientState(state, data)` 发送 `client.state`,
66
+ `onDisconnect(cleanup)` 清理扩展资源。这些能力只提供给可信注册 handler,
67
+ 不从客户端载荷反序列化。[四音区座舱示例](https://github.com/QwenAudio/qwen-audio-agent/blob/main/examples/smart-cockpit/docs/multi-zone.md)
68
+ 的 ASR、批次与座位语义均留在 example 中。
69
+
59
70
  网关在单条 WebSocket 上讲类型化事件。按客户端协议构建自定义客户端,
60
71
  或通过稳定性契约把助手嵌入宿主页面——桌面悬浮球、TUI、WebUI 用的都是
61
72
  同一条通道。
@@ -66,6 +66,15 @@ creation, and device administration, are outside the interactive GCP Session.
66
66
  They authenticate independently and never claim or replace the active Client
67
67
  lease.
68
68
 
69
+ Automatic Task-result announcements are scoped to the current owner and session.
70
+ Reconnecting to the same session can resume its pending notifications; opening a
71
+ different session does not announce older-session results. Trusted host code may
72
+ explicitly opt into cross-session notification claims after verifying the recipient.
73
+ Personal identity mode shares one owner and assumes a single trusted user; session
74
+ IDs are not an authentication boundary. Shared-device or telephone integrations must
75
+ use separate authenticated owners for independent users and avoid reusing a
76
+ conversation session across callers.
77
+
69
78
  ## 3. Connection and negotiation
70
79
 
71
80
  The Client connects to `ws://<gateway>/api/realtime`. The first message is `session.hello`.
@@ -403,6 +412,7 @@ The active Client uses the same WebSocket for runtime commands and queries. Each
403
412
  | Command | Direction | Meaning |
404
413
  |---|---|---|
405
414
  | `task.create` | C→G | Explicitly create an asynchronous Task without impersonating conversational user input |
415
+ | `task.update` | C→G | Update a specified Task with `task_id` and `message.parts`; returns `task.update.result` with `status: accepted/duplicate` and a Task snapshot |
406
416
  | `task.get` / `task.list` | C→G | Read one Task or a bounded filtered Task snapshot |
407
417
  | `task.cancel` | C→G | Request cancellation of one Task; subsequent lifecycle events report the final state |
408
418
  | `permission.respond` | C→G | Resolve the currently pending authorization request |
@@ -451,6 +461,18 @@ This is the Client runtime control plane. Equivalent internal REST/SSE routes re
451
461
 
452
462
  `task.create` is an explicit integration command, not the normal voice-chat path. Conversational requests still reach Task creation through the frontend Agent's tools, preserving its routing and acknowledgement behavior.
453
463
 
464
+ `task.update` uses the same `tasks.commands` capability. Its `event_id` deduplicates admission
465
+ within the retained Task record. Acceptance is not delivery or completion. The Task's optional
466
+ `updates` list exposes `instruction`, `createdAt`, `status` (`queued`, `pending`, `delivered`,
467
+ `failed`) and an optional `error`. A completed Task continued under the same ID has an incremented
468
+ `revision`; private backend continuation tokens never appear in client snapshots.
469
+
470
+ Backend input events may report `input.status: 'answered'` when the frontend model's
471
+ `update_agent_task` tool forwards a natural-language reply; this is neither approval nor completion.
472
+ The separate `task.input.respond` UI command still requires an explicit `action` (`accept`,
473
+ `decline`, or `cancel`), resolving to `accepted`, `declined`, or `cancelled` respectively.
474
+ The wire `task.update` command remains a work-update API, not a pending-input reply API.
475
+
454
476
  ### 5.5 Gateway state and presentation
455
477
 
456
478
  Gateway publishes normalized state; the Client renders it without reconstructing Gateway internals:
@@ -505,6 +527,10 @@ Task replay or the Session Journal.
505
527
 
506
528
  `response.done` means generation finished, not that the user heard the response. Delivery workflows that require audible confirmation use playback receipts.
507
529
 
530
+ When a Client explicitly negotiates capabilities without `playback.receipts`, Gateway provides a generation-only fallback: assistant transcripts are displayed and ordinary conversation records are retained without waiting for playback acknowledgements. Generation completion releases generation-side scheduling; it never creates a synthetic `playback.ended` or confirms audible delivery. Automatic background-result notifications are not claimed for announcement and remain pending. Clients can still display task cards, query results, respond to permissions and cancel tasks. Workflows that require automatic spoken-delivery confirmation must use a Client with playback receipts.
531
+
532
+ The notification restriction applies to audio Clients; explicitly text-only Clients retain their existing text-delivery confirmation. This fallback applies only to explicit capability negotiation. Legacy Clients retain their existing behavior; no new public field or event is introduced. Use a Gateway revision containing this fallback, since older implementations may still wait for receipts before advancing transcripts or scheduling.
533
+
508
534
  ### 5.7 Local mute and external capture ownership
509
535
 
510
536
  Local mute stops microphone input at the Client and does not disconnect, cancel Tasks, or suppress output. It does not need a Gateway event.
@@ -55,6 +55,12 @@ HTTPS 换取 Token。浏览器扫码页仅把 fragment 中的 Token 换成 HttpO
55
55
  端点发布、设备连接码签发与设备管理等 Host 管理请求不属于交互式 GCP Session。
56
56
  它们独立完成认证,也不会取得或替换活动 Client 租约。
57
57
 
58
+ Task 结果自动播报限定在当前 owner 和 session 内。同一 session 重连可恢复其待播报
59
+ 通知;新 session 不会自动播报旧 session 的结果。可信宿主代码只有在确认接收人一致后,
60
+ 才应显式开启跨 session 通知领取。个人身份模式共享一个 owner,假设只有一位可信用户;
61
+ session ID 不是身份认证边界。共享设备或电话接入应为独立用户配置不同的已认证 owner,
62
+ 并避免在不同来电用户之间复用同一个会话 session。
63
+
58
64
  ## 3. 连接与能力协商
59
65
 
60
66
  Client 连接 `ws://<gateway>/api/realtime`,第一条消息必须是 `session.hello`。
@@ -363,6 +369,7 @@ WebUI 在实际开始采集、停止、失败时上报视觉状态,不逐帧
363
369
  | 命令 | 方向 | 语义 |
364
370
  |---|---|---|
365
371
  | `task.create` | C→G | 显式创建异步 Task,不伪装成对话中的用户输入 |
372
+ | `task.update` | C→G | 用 `task_id` 和 `message.parts` 调整指定 Task;返回 `task.update.result`,包含 `status: accepted/duplicate` 与 Task 快照 |
366
373
  | `task.get` / `task.list` | C→G | 查询一个 Task,或读取有界、可筛选的 Task 快照 |
367
374
  | `task.cancel` | C→G | 请求取消一个 Task;最终状态由后续生命周期事件报告 |
368
375
  | `permission.respond` | C→G | 处理当前等待中的授权请求 |
@@ -409,6 +416,17 @@ Realtime Session。Provider 不支持会话音色时返回关联错误
409
416
 
410
417
  `task.create` 是显式集成命令,不是常规语音聊天路径。对话请求仍由前台 Agent 通过工具创建 Task,以保留它的路由判断和自然承接行为。
411
418
 
419
+ `task.update` 同样要求 `tasks.commands` 能力。`event_id` 在保留的 Task 记录内用于受理去重;
420
+ 受理不表示投递或执行完成。Task 可选的 `updates` 包含 `instruction`、`createdAt`、
421
+ `status`(`queued`、`pending`、`delivered`、`failed`)及可选 `error`。
422
+ 已结束的 Task 续接时保持 ID、递增 `revision`;后台续接标识只保存在运行时,不进入客户端快照。
423
+
424
+ 前台模型通过 `update_agent_task` 工具转达自然语言答复后,后台输入事件可返回
425
+ `input.status: 'answered'`,不代表批准或完成。
426
+ 独立的 `task.input.respond` UI 命令仍要求显式 `action`(`accept`、`decline` 或 `cancel`),
427
+ 分别解析为 `accepted`、`declined`、`cancelled`。
428
+ 线协议中的 `task.update` 仍是工作调整接口,不是待补充输入的回复接口。
429
+
412
430
  ### 5.5 Gateway 状态与 Presentation
413
431
 
414
432
  Gateway 发布规范化状态,Client 不需要反向推导内部状态机:
@@ -461,6 +479,10 @@ Task SSE 路由只写传输层注释心跳。这些注释不会进入 Task 回
461
479
 
462
480
  `response.done` 只表示生成完成,不表示用户已经听到。确实需要可听送达确认的工作流使用播放回执。
463
481
 
482
+ Client 完成显式能力协商且未声明 `playback.receipts` 时,Gateway 提供仅按生成状态推进的降级:展示助手生成字幕、保留普通会话记录,不再等待播放回执。生成完成释放生成侧调度,但绝不补造 `playback.ended` 或确认可听送达。自动后台结果通知不领取,保持 pending;Client 仍可展示任务卡片、主动查询结果、响应权限请求及取消任务。依赖自动语音送达确认的工作流应使用支持播放回执的 Client。
483
+
484
+ 通知限制针对音频 Client;显式声明仅文本的 Client 仍按既有文本投递规则确认。该降级仅适用于显式能力协商,传统 Client 的行为不变,不增加公开字段或事件。使用时需要包含这项降级的 Gateway 版本;旧实现可能仍在字幕或调度路径等待回执。
485
+
464
486
  ### 5.7 本地静音与外部采集占用
465
487
 
466
488
  本地静音只在 Client 停止麦克风输入,不断开连接、不取消 Task、不抑制输出,不需要 Gateway 事件。
@@ -45,12 +45,12 @@ An alternative source launch is:
45
45
  ```sh
46
46
  QWAUDIO_WEBRTC_ENABLED=1 \
47
47
  QWEN_AUDIO_REALTIME_PROVIDER=dashscope \
48
- QWEN_AUDIO_REALTIME_MODEL=qwen-audio-3.0-realtime-plus \
48
+ QWEN_AUDIO_REALTIME_MODEL=qwen-audio-3.1-realtime-plus \
49
49
  npm run start --workspace server
50
50
  ```
51
51
 
52
52
  For Omni, change the model to `qwen3.5-omni-plus-realtime` and restart. Reuse the
53
- server's existing `DASHSCOPE_API_KEY` and regional/workspace configuration. Never
53
+ server's existing `QWEN_AUDIO_REALTIME_API_KEY` and regional/workspace configuration. Never
54
54
  enter a provider key in the browser. Requests cannot override the Gateway's
55
55
  configured model or upstream URL.
56
56
 
@@ -88,7 +88,7 @@ clients, and the response is not cacheable.
88
88
  ### SDP negotiation
89
89
 
90
90
  ```http
91
- POST /api/v1/webrtc/realtime?model=qwen-audio-3.0-realtime-plus&sessionId=my-session
91
+ POST /api/v1/webrtc/realtime?model=qwen-audio-3.1-realtime-plus&sessionId=my-session
92
92
  Authorization: Bearer <Gateway access credential>
93
93
  Content-Type: application/sdp
94
94
 
@@ -40,12 +40,12 @@ CLI 可用 `qwenaudio gateway --webrtc` 开启同一个入口;先安装依赖
40
40
  ```sh
41
41
  QWAUDIO_WEBRTC_ENABLED=1 \
42
42
  QWEN_AUDIO_REALTIME_PROVIDER=dashscope \
43
- QWEN_AUDIO_REALTIME_MODEL=qwen-audio-3.0-realtime-plus \
43
+ QWEN_AUDIO_REALTIME_MODEL=qwen-audio-3.1-realtime-plus \
44
44
  npm run start --workspace server
45
45
  ```
46
46
 
47
47
  另一次测试 Omni 时,将模型改成 `qwen3.5-omni-plus-realtime` 并重启。
48
- 沿用服务器已有 `DASHSCOPE_API_KEY` 和地域/Workspace 配置,不需要将 Key 写入示例页。
48
+ 沿用服务器已有 `QWEN_AUDIO_REALTIME_API_KEY` 和地域/Workspace 配置,不需要将 Key 写入示例页。
49
49
  同一个 Gateway 本版使用其当前配置的模型,不支持请求级随意覆盖模型或上游地址。
50
50
 
51
51
  默认端口下打开:
@@ -78,7 +78,7 @@ ICE 配置仅对已认证客户端返回,响应禁止缓存。
78
78
  ### SDP 建连
79
79
 
80
80
  ```http
81
- POST /api/v1/webrtc/realtime?model=qwen-audio-3.0-realtime-plus&sessionId=my-session
81
+ POST /api/v1/webrtc/realtime?model=qwen-audio-3.1-realtime-plus&sessionId=my-session
82
82
  Authorization: Bearer <Gateway access credential>
83
83
  Content-Type: application/sdp
84
84
 
@@ -29,6 +29,9 @@ The following requirements apply to **CLI / source installations**: Node.js ^22.
29
29
  or >=26.0.0, and npm 10+. The source repository includes `.nvmrc` and `.node-version`;
30
30
  with nvm, run `nvm use`.
31
31
 
32
+ On Windows, use Node 24.16.0 or later within the 24.x line: 24.15.0 has a
33
+ [native TCP crash fixed in 24.16.0](https://github.com/nodejs/node/issues/63620).
34
+
32
35
  Install the stable release:
33
36
 
34
37
  ```bash
@@ -98,6 +101,6 @@ for overrides and storage details.
98
101
  ## Obtain a DashScope API Key
99
102
 
100
103
  1. Open the [Bailian API Key page](https://bailian.console.aliyun.com/?tab=model#/api-key), sign in, and create a key.
101
- 2. Enter it in Desktop settings or as `DASHSCOPE_API_KEY` in `config.env`.
104
+ 2. Enter it in Desktop settings or as `QWEN_AUDIO_REALTIME_API_KEY` in `config.env`.
102
105
 
103
106
  See the [official free-quota guide](https://help.aliyun.com/zh/model-studio/new-free-quota) for eligibility and conditions. Check available quota and billing settings before use. Do not expose keys or commit configuration files.
@@ -26,6 +26,9 @@
26
26
  以下是 **CLI / 源码** 的要求:Node.js ^22.22.2、^24.15.0 或 >=26.0.0,npm 10+。
27
27
  源码仓库提供 `.nvmrc` 和 `.node-version`,使用 nvm 时可运行 `nvm use`。
28
28
 
29
+ Windows 使用 Node 24.x 时,请选择 24.16.0 或更新版本;24.15.0 存在
30
+ [已在 24.16.0 修复的 TCP 原生崩溃](https://github.com/nodejs/node/issues/63620)。
31
+
29
32
  安装正式版:
30
33
 
31
34
  ```bash
@@ -91,6 +94,6 @@ CLI 与桌面版默认共享 `~/.config/qwaudio/config.env`,运行时状态分
91
94
  ## 获取 DashScope API Key
92
95
 
93
96
  1. 打开百炼控制台的 [API Key 页面](https://bailian.console.aliyun.com/?tab=model#/api-key),登录并创建 Key。
94
- 2. 将 Key 填入桌面设置,或写入 `config.env` 的 `DASHSCOPE_API_KEY`。
97
+ 2. 将 Key 填入桌面设置,或写入 `config.env` 的 `QWEN_AUDIO_REALTIME_API_KEY`。
95
98
 
96
99
  免费额度及适用条件以[百炼官方说明](https://help.aliyun.com/zh/model-studio/new-free-quota)为准。开始前确认账户可用额度与计费设置,不要公开 Key 或提交配置文件。
@@ -67,8 +67,14 @@ npm run mobile:android
67
67
 
68
68
  iOS requires full Xcode. Android requires JDK 21 and the Android SDK.
69
69
  `mobile:sync` builds the local web assets before syncing the Capacitor projects.
70
- The Gateway endpoint must use HTTPS; Mobile never downgrades a device credential
71
- to a clear-text WebSocket.
70
+ Public Gateway endpoints must use HTTPS/WSS. Explicit LAN connection codes may
71
+ use a tokenized `ws://<LAN IPv4>` endpoint.
72
+
73
+ Bundled web assets use the fixed local origin `capacitor://qwaudio.local` on iOS
74
+ (`iosScheme: "capacitor"`) and `https://qwaudio.local` on Android. WKWebView cannot
75
+ register `https` as a custom scheme. The Gateway accepts these local origins only
76
+ for authenticated native devices; opaque `null` and other custom origins remain
77
+ rejected. This local asset scheme does not change the remote transport policy.
72
78
 
73
79
  The GitHub `Mobile` workflow retains an Android debug APK and an iOS Simulator
74
80
  App for testing without a local native toolchain. Installing on a physical iOS
@@ -60,5 +60,10 @@ iOS 构建需要完整 Xcode;Android 构建需要 JDK 21 和 Android SDK。`mo
60
60
  本地 Web 资源,再同步到 Capacitor 原生工程。公网 Gateway 地址必须是 HTTPS;显式 LAN
61
61
  连接允许使用带 Token 的 `ws://局域网IP`。
62
62
 
63
+ 内置 Web 资源在 iOS 使用固定本地 Origin `capacitor://qwaudio.local`
64
+ (`iosScheme: "capacitor"`),Android 使用 `https://qwaudio.local`。WKWebView 无法将
65
+ `https` 注册为自定义 scheme。Gateway 只允许已认证原生设备使用这两个本地 Origin;
66
+ 不接受不透明的 `null` 或其他自定义 Origin。本地资源 scheme 不改变远程连接的传输策略。
67
+
63
68
  GitHub 的 `Mobile` 工作流会保存 Android debug APK 和 iOS Simulator App,便于在没有
64
69
  本地原生工具链时下载验收。iOS 真机安装仍需要 Apple 开发签名。
@@ -27,8 +27,8 @@ Start in frontend-only mode to verify voice conversation:
27
27
 
28
28
  ```dotenv
29
29
  QWEN_AUDIO_REALTIME_PROVIDER=dashscope
30
- DASHSCOPE_API_KEY=your-key
31
- QWEN_AUDIO_REALTIME_MODEL=qwen-audio-3.0-realtime-plus
30
+ QWEN_AUDIO_REALTIME_API_KEY=your-key
31
+ QWEN_AUDIO_REALTIME_MODEL=qwen-audio-3.1-realtime-plus
32
32
  AGENT_PROTOCOL=none
33
33
  ```
34
34
 
@@ -27,8 +27,8 @@ qwenaudio config
27
27
 
28
28
  ```dotenv
29
29
  QWEN_AUDIO_REALTIME_PROVIDER=dashscope
30
- DASHSCOPE_API_KEY=your-key
31
- QWEN_AUDIO_REALTIME_MODEL=qwen-audio-3.0-realtime-plus
30
+ QWEN_AUDIO_REALTIME_API_KEY=your-key
31
+ QWEN_AUDIO_REALTIME_MODEL=qwen-audio-3.1-realtime-plus
32
32
  AGENT_PROTOCOL=none
33
33
  ```
34
34
 
@@ -26,6 +26,8 @@ Options:
26
26
  | `--session ID` | Resume a specific voice session |
27
27
  | `--no-open` | Print the URL only, without opening a browser |
28
28
 
29
+ Use “Take photo” in the composer to open a camera-only preview. Capture a bounded JPEG, review or retake it, then choose “Add to draft”. The photo remains a normal attachment until you click Send; it can be removed from the draft. Cancel or close the photo dialog to release the camera. This does not start the microphone or continuous visual input. Ordinary photo attachments use the existing attachment processing and retention rules.
30
+
29
31
  ## What you can do
30
32
 
31
33
  - **Full-duplex voice** — speak and interrupt naturally, with live transcripts.
@@ -24,6 +24,8 @@ qwenaudio webui
24
24
  | `--session ID` | 复用指定的语音会话 |
25
25
  | `--no-open` | 只打印地址,不打开浏览器 |
26
26
 
27
+ 在输入框点击“拍照”可打开仅使用相机的预览。拍摄有大小限制的 JPEG 后,可查看、重拍或取消,再选择“加入草稿”;照片作为普通附件保留,点击“发送”才提交,也可从草稿中删除。取消或关闭拍照窗口会释放相机,拍照不会启动麦克风或连续视觉输入。照片附件沿用现有附件处理与保留规则。
28
+
27
29
  ## 能做什么
28
30
 
29
31
  - **全双工语音**——自然说话、随时打断,实时转写同步显示。