qwen-audio-agent 0.9.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 (122) hide show
  1. package/CONTRIBUTING.md +58 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +5 -0
  4. package/PRIVACY.md +34 -0
  5. package/README.md +282 -0
  6. package/README_EN.md +316 -0
  7. package/SECURITY.md +32 -0
  8. package/THIRD_PARTY_NOTICES.md +26 -0
  9. package/cli/bin/qwenaudio.mjs +10 -0
  10. package/cli/package.json +13 -0
  11. package/cli/src/arguments.mjs +247 -0
  12. package/cli/src/gateway-service.mjs +386 -0
  13. package/cli/src/instance-lock.mjs +65 -0
  14. package/cli/src/launcher.mjs +217 -0
  15. package/cli/src/runtime.mjs +356 -0
  16. package/cli/src/webui.mjs +61 -0
  17. package/config/acp/workspace/AGENTS.md +13 -0
  18. package/config/codebuddy/workspace/.codebuddy/models.json +19 -0
  19. package/config/codebuddy/workspace/AGENTS.md +13 -0
  20. package/config/codex/workspace/AGENTS.md +13 -0
  21. package/config/frontend-agent/PROMPT.md +127 -0
  22. package/config/hermes/workspace/AGENTS.md +13 -0
  23. package/config/openclaw/openclaw.json5 +50 -0
  24. package/config/openclaw/workspace/AGENTS.md +9 -0
  25. package/config/opencode/agents/qwen-audio-agent-backend.md +65 -0
  26. package/config/opencode/workspace/AGENTS.md +16 -0
  27. package/config/qoder/workspace/AGENTS.md +16 -0
  28. package/docs/architecture-overview-en.png +0 -0
  29. package/docs/architecture-overview.png +0 -0
  30. package/docs/architecture.md +332 -0
  31. package/docs/configuration.md +386 -0
  32. package/docs/desktop-fluid-orb-thinking.gif +0 -0
  33. package/docs/desktop-goo-orb-thinking.gif +0 -0
  34. package/docs/qwen-audio-agent-three-layer-architecture-en.png +0 -0
  35. package/docs/qwen-audio-agent-three-layer-architecture.png +0 -0
  36. package/package.json +126 -0
  37. package/scripts/audit-dependencies.mjs +109 -0
  38. package/scripts/check-desktop-release-env.mjs +41 -0
  39. package/scripts/codex-acp +58 -0
  40. package/scripts/install-global.mjs +66 -0
  41. package/scripts/openclaw +194 -0
  42. package/scripts/openclaw-gateway +8 -0
  43. package/scripts/opencode-acp +6 -0
  44. package/scripts/opencode-server +179 -0
  45. package/scripts/prepare-build.mjs +38 -0
  46. package/scripts/release-check +182 -0
  47. package/scripts/set-version.mjs +133 -0
  48. package/scripts/start.mjs +43 -0
  49. package/scripts/verify-package.mjs +109 -0
  50. package/server/package.json +18 -0
  51. package/server/src/agent/acp-backend-adapter.mjs +1138 -0
  52. package/server/src/agent/acp-backend-profile.mjs +35 -0
  53. package/server/src/agent/acp-backend-session-utils.mjs +139 -0
  54. package/server/src/agent/acp-process-client.mjs +447 -0
  55. package/server/src/agent/acp-session-registry.mjs +106 -0
  56. package/server/src/agent/acp-session-tools.mjs +257 -0
  57. package/server/src/agent/agent-client.mjs +218 -0
  58. package/server/src/agent/backend-adapter.mjs +15 -0
  59. package/server/src/agent/backend-agent-instructions.mjs +8 -0
  60. package/server/src/agent/backends/codebuddy.mjs +47 -0
  61. package/server/src/agent/backends/codex.mjs +62 -0
  62. package/server/src/agent/backends/generic-acp.mjs +46 -0
  63. package/server/src/agent/backends/hermes.mjs +29 -0
  64. package/server/src/agent/backends/openclaw.mjs +101 -0
  65. package/server/src/agent/backends/opencode.mjs +36 -0
  66. package/server/src/agent/backends/qoder.mjs +47 -0
  67. package/server/src/agent/backends/registry.mjs +32 -0
  68. package/server/src/agent/backends/shared.mjs +46 -0
  69. package/server/src/agent/coordinator.mjs +308 -0
  70. package/server/src/agent/openclaw-adapter.mjs +245 -0
  71. package/server/src/app/bootstrap.mjs +244 -0
  72. package/server/src/conversation/conversation-sync.mjs +183 -0
  73. package/server/src/conversation/frontend-agent-context.mjs +162 -0
  74. package/server/src/conversation/frontend-memory.mjs +328 -0
  75. package/server/src/conversation/profiled-memory-store.mjs +87 -0
  76. package/server/src/conversation/task-result-projector.mjs +18 -0
  77. package/server/src/conversation/user-profile.mjs +234 -0
  78. package/server/src/core/config.mjs +388 -0
  79. package/server/src/core/identity.mjs +93 -0
  80. package/server/src/core/install-paths.mjs +8 -0
  81. package/server/src/core/package-version.mjs +10 -0
  82. package/server/src/core/request-security.mjs +80 -0
  83. package/server/src/index.mjs +67 -0
  84. package/server/src/process/backend-drivers/codebuddy.mjs +15 -0
  85. package/server/src/process/backend-drivers/codex.mjs +15 -0
  86. package/server/src/process/backend-drivers/generic-acp.mjs +18 -0
  87. package/server/src/process/backend-drivers/hermes.mjs +15 -0
  88. package/server/src/process/backend-drivers/openclaw.mjs +35 -0
  89. package/server/src/process/backend-drivers/opencode.mjs +75 -0
  90. package/server/src/process/backend-drivers/qoder.mjs +15 -0
  91. package/server/src/process/backend-drivers/registry.mjs +24 -0
  92. package/server/src/process/backend-drivers/shared.mjs +46 -0
  93. package/server/src/process/managed-backend.mjs +188 -0
  94. package/server/src/task/task-manager.mjs +704 -0
  95. package/server/src/task/task-scheduler.mjs +44 -0
  96. package/server/src/task/task-store.mjs +167 -0
  97. package/server/src/voice/active-voice-clients.mjs +58 -0
  98. package/server/src/voice/announcement/announcement-manager.mjs +402 -0
  99. package/server/src/voice/announcement/announcement-window.mjs +89 -0
  100. package/server/src/voice/input-transcript.mjs +9 -0
  101. package/server/src/voice/realtime-errors.mjs +6 -0
  102. package/server/src/voice/realtime-gateway.mjs +1366 -0
  103. package/server/src/voice/realtime-provider.mjs +771 -0
  104. package/server/src/voice/reconnect-backoff.mjs +30 -0
  105. package/server/src/voice/response-context.mjs +41 -0
  106. package/server/src/voice/session-permission-policy.mjs +56 -0
  107. package/server/src/voice/tools/tool-call-handler.mjs +823 -0
  108. package/server/src/voice/tools/turn-transcripts.mjs +59 -0
  109. package/server/src/voice/turn-correlation.mjs +41 -0
  110. package/shared/backend-catalog.mjs +56 -0
  111. package/shared/gateway-client.mjs +13 -0
  112. package/shared/realtime-events.mjs +55 -0
  113. package/shared/runtime-environment.mjs +422 -0
  114. package/tui/native/macos-voice-io.swift +552 -0
  115. package/tui/native/portaudio-voice-io.py +240 -0
  116. package/tui/package.json +13 -0
  117. package/tui/src/index.mjs +1217 -0
  118. package/tui/src/macos-voice-io.mjs +186 -0
  119. package/tui/src/portaudio-voice-io.mjs +158 -0
  120. package/web/dist/assets/index-BeamDvsE.js +38 -0
  121. package/web/dist/assets/index-BuB0EFih.css +1 -0
  122. package/web/dist/index.html +14 -0
@@ -0,0 +1,58 @@
1
+ # Contributing to qwen-audio-agent
2
+
3
+ 感谢你帮助改进 qwen-audio-agent。
4
+
5
+ ## 开发环境
6
+
7
+ 需要 Node.js 22.22.2 或 24.15.0、npm 10+。使用 nvm 时:
8
+
9
+ ```bash
10
+ nvm install
11
+ nvm use
12
+ npm ci
13
+ ```
14
+
15
+ 运行完整检查:
16
+
17
+ ```bash
18
+ npm test
19
+ npm run build
20
+ npm run release:check
21
+ ```
22
+
23
+ 提交前请确保没有把 `.env`、API Key、用户档案、任务状态、日志或后台工作目录加入
24
+ 版本控制。
25
+
26
+ ## 变更原则
27
+
28
+ - 保持 Realtime 前台与后台 Agent 的边界,遵循 `docs/architecture.md`。
29
+ - 修复应包含覆盖失败场景的测试。
30
+ - 避免在无关变更中重排或重写大段代码。
31
+ - 新配置必须有安全默认值,并同步更新 `.env.example` 与配置文档。
32
+ - 用户可见行为变化应更新 `CHANGELOG.md`。
33
+
34
+ ## Pull Request
35
+
36
+ 请在 PR 中说明问题、修复方式、验证命令和兼容性影响。涉及网络、权限、持久化、
37
+ 进程管理或发布流程的变更,应明确列出安全影响和回滚方式。
38
+
39
+ 行为准则以友善、尊重和建设性协作为基本要求。骚扰、歧视、泄露隐私或恶意提交
40
+ 不会被接受。
41
+
42
+ ## 发布
43
+
44
+ 根目录 `package.json` 是项目版本的唯一来源。准备发布时使用以下任一命令,
45
+ 脚本会同步根包、所有 workspace 和 `package-lock.json`:
46
+
47
+ ```bash
48
+ npm run version:patch # 0.5.0 → 0.5.1,兼容性修复
49
+ npm run version:minor # 0.5.0 → 0.6.0,兼容性功能
50
+ npm run version:major # 0.5.0 → 1.0.0,不兼容或稳定版
51
+ npm run version:set -- 0.6.0-beta.1 # 指定预发布版本
52
+ ```
53
+
54
+ 更新版本后必须同步维护 `CHANGELOG.md` 并运行 `npm run release:check`。版本标签必须
55
+ 与根 `package.json` 完全一致,例如 `v0.5.0`。标签触发发布工作流:
56
+ 先运行完整检查,再以 npm provenance 发布公共包,随后构建、签名、公证 macOS
57
+ DMG 并创建 GitHub Release。仓库维护者需预先配置 `NPM_TOKEN`、Apple Developer
58
+ 签名证书和公证凭据。
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 qwen-audio-agent contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ qwen-audio-agent
2
+ Copyright 2026 qwen-audio-agent contributors
3
+
4
+ This product includes software developed by third-party open-source projects.
5
+ See THIRD_PARTY_NOTICES.md for the primary component notices.
package/PRIVACY.md ADDED
@@ -0,0 +1,34 @@
1
+ # Privacy
2
+
3
+ qwen-audio-agent 是本地运行的语音前台,不包含内置遥测、广告分析或自动崩溃上报。
4
+ 但完成语音对话和 Agent 任务需要与用户选择的外部服务交换数据。
5
+
6
+ ## 数据流向
7
+
8
+ - 默认情况下,麦克风音频、实时转写上下文和模型回复请求会发送到阿里云
9
+ DashScope 的 Qwen Audio Realtime 服务。若用户配置其他兼容服务,则数据发送到
10
+ 该服务。
11
+ - 委派任务、必要的对话上下文和任务结果会发送给用户选择的后台 Agent,例如
12
+ OpenCode、OpenClaw、Qoder、Hermes、CodeBuddy、Codex 或用户配置的其他 ACP
13
+ Agent。后台 Agent 还可能按照用户配置调用模型、工具、MCP 服务或访问项目文件;
14
+ 这些服务各自的隐私政策同样适用。
15
+ - Markdown 中的远程图片、音频和视频默认不会自动加载。用户点击加载或打开链接
16
+ 后,目标站点可能获知用户的 IP 地址和浏览器信息。
17
+
18
+ ## 本地数据
19
+
20
+ 用户档案、长期记忆、任务状态、后台工作目录和配置默认保存在
21
+ `~/.config/qwaudio/`。API Key 等凭据不应写入仓库、对话或用户档案。卸载应用不会
22
+ 自动删除该目录,避免意外丢失用户数据。
23
+
24
+ ## 远程部署
25
+
26
+ Gateway 默认仅供本机使用。通过反向代理开放远程访问时,部署者负责启用 HTTPS、
27
+ 访问认证、日志保护和适用的数据保留策略。不要将 Gateway 端口直接暴露到局域网
28
+ 或公网。
29
+
30
+ ## 项目边界
31
+
32
+ 本项目无法控制 DashScope、用户选择的后台 Agent、模型提供商、MCP 服务或用户
33
+ 打开的第三方链接如何处理数据。正式使用前,请审阅相关服务的隐私条款并选择
34
+ 合适的部署方式。
package/README.md ADDED
@@ -0,0 +1,282 @@
1
+ # Qwen Audio Agent
2
+
3
+ [中文](README.md) | [English](README_EN.md)
4
+
5
+ [![CI](https://github.com/QwenAudio/qwen-audio-agent/actions/workflows/ci.yml/badge.svg)](https://github.com/QwenAudio/qwen-audio-agent/actions/workflows/ci.yml)
6
+ [![npm](https://img.shields.io/badge/npm-v0.9.0-orange)](https://www.npmjs.com/package/qwen-audio-agent)
7
+ [![node](https://img.shields.io/badge/node-%E2%89%A522.22.2-brightgreen)](https://nodejs.org/)
8
+ [![license](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
9
+
10
+ ## 我们不是这样和人交流的。
11
+
12
+ 没有人说完一句话,然后站在那里等待一分钟。
13
+
14
+ 没有人会因为对方去查资料,就停止整个聊天。
15
+
16
+ 真正的交流,是连续的。
17
+
18
+ 而 Agent,也应该如此。
19
+
20
+ 所以,我们做了 **qwen-audio-agent**。
21
+
22
+ 一个让 Agent 持续交流、持续工作、持续在场的实时语音运行时。
23
+
24
+ ## 核心特色
25
+
26
+ - 全双工实时语音交互、自然打断和持续多轮对话
27
+ - 一键连接你喜欢的各种 Agent,使用已有的模型、工具、MCP、Skill
28
+ - 对话与后台任务并行,可随时查询进度或取消任务
29
+ - 任务结果自动回到当前上下文,支持继续追问和修改
30
+ - 支持 WebUI、终端 TUI 和 macOS 桌面悬浮球
31
+ - 支持本地用户档案与跨会话个人记忆
32
+
33
+ ## 对话继续,任务也在继续
34
+
35
+ ![qwen-audio-agent 原理图](docs/architecture-overview.png)
36
+
37
+ 能直接回答的问题会立即回答;需要工具或持续处理时,任务会交给后台 Agent。
38
+ 整个过程中,用户面对的始终是同一个助理。
39
+
40
+ <details>
41
+ <summary>查看详细架构</summary>
42
+
43
+ ![qwen-audio-agent 接入参考架构](docs/qwen-audio-agent-three-layer-architecture.png)
44
+
45
+ 更完整的设计与模块说明见[架构文档](docs/architecture.md)。
46
+
47
+ </details>
48
+
49
+ ## Agent 支持
50
+
51
+ | 后台 Agent | 状态 | 主要能力 | 推荐指数 |
52
+ | --- | --- | --- | --- |
53
+ | OpenCode | 已支持 | 工具与代码任务、项目 Session、进度查询与取消 | ★★★★★ |
54
+ | OpenClaw | 已支持 | Agent、工具、任务执行与权限控制 | ★★★★★ |
55
+ | Qoder | 已支持 | 原生 CLI Session、新建或继续项目、任务委派与取消 | ★★★★★ |
56
+ | Hermes | 已支持 | 原生 ACP、工具调用、项目 Session 与任务执行 | ★★★★☆ |
57
+ | CodeBuddy | 已支持 | 原生 ACP、自定义模型、项目 Session 与权限控制 | ★★★★☆ |
58
+ | Codex | 已支持 | Codex ACP、代码任务、项目 Session 与权限控制 | ★★★★☆ |
59
+
60
+ 推荐指数综合反映当前集成完整度、兼容性和实际验证程度:五星表示已经过充分测试的
61
+ 推荐集成,四星表示正在开发或尚未完成同等范围验证。是否当前可用以状态栏为准。
62
+ 详细配置和能力边界见[配置说明](docs/configuration.md)。
63
+
64
+ ## 安装
65
+
66
+ 需要 Node.js 22.22.2+ 或 24.15.0+、npm 10+ 和 DashScope API Key。
67
+ 仓库提供 `.nvmrc` 和 `.node-version`;使用 nvm 时可直接运行 `nvm use`。
68
+
69
+ 一键安装(推荐,从 npm 安装):
70
+
71
+ ```bash
72
+ npm install -g qwen-audio-agent
73
+ ```
74
+
75
+ 也可以直接从 GitHub 安装最新代码:
76
+
77
+ ```bash
78
+ npm install -g git+https://github.com/QwenAudio/qwen-audio-agent.git
79
+ ```
80
+
81
+ 从源码安装:
82
+
83
+ ```bash
84
+ git clone https://github.com/QwenAudio/qwen-audio-agent.git
85
+ cd qwen-audio-agent
86
+ npm install
87
+ npm run install:global
88
+ ```
89
+
90
+ 升级到最新 npm 版本:
91
+
92
+ ```bash
93
+ npm install -g qwen-audio-agent@latest
94
+ ```
95
+
96
+ 升级到 GitHub 最新代码:
97
+
98
+ ```bash
99
+ npm install -g git+https://github.com/QwenAudio/qwen-audio-agent.git
100
+ ```
101
+
102
+ ## 快速开始
103
+
104
+ 1. 创建配置:
105
+
106
+ ```bash
107
+ qwenaudio config
108
+ ```
109
+
110
+ 2. 打开命令显示的 `config.env`,填写 DashScope API Key,并选择 OpenClaw:
111
+
112
+ ```dotenv
113
+ DASHSCOPE_API_KEY=your-key
114
+ AGENT_PROTOCOL=openclaw
115
+ ```
116
+
117
+ 3. 在一个终端中启动 Gateway:
118
+
119
+ ```bash
120
+ qwenaudio
121
+ ```
122
+
123
+ 4. 另开一个终端,启动 TUI:
124
+
125
+ ```bash
126
+ qwenaudio tui
127
+ ```
128
+
129
+ 也可以使用浏览器界面:
130
+
131
+ ```bash
132
+ qwenaudio webui
133
+ ```
134
+
135
+ ### TUI 使用注意
136
+
137
+ | 平台 | 默认模式 | 打断方式 |
138
+ | --- | --- | --- |
139
+ | macOS | 带回声消除的全双工 | 直接说话 |
140
+ | Linux / Windows | 半双工 | 播报时按 `x` |
141
+
142
+ Linux 和 Windows 首次使用前需安装 `sounddevice` 和系统 PortAudio。也可以开启
143
+ 无回声消除的全双工模式;此时请佩戴耳机,避免扬声器声音造成误识别:
144
+
145
+ ```bash
146
+ qwenaudio tui --audio-mode full
147
+ ```
148
+
149
+ ## macOS 桌面版
150
+
151
+ 桌面版提供常驻桌面的语音悬浮球。使用前请先启动 Gateway;首次运行需要授予
152
+ 麦克风权限。设置页可以切换 Gateway 地址和悬浮球外观,并显示当前使用的模型与
153
+ 后台 Agent。
154
+
155
+ 桌面版支持流光声波球和液态渐变球两种外观。下面分别展示它们在思考 / 呼吸状态
156
+ 下的原始动态效果:
157
+
158
+ | 流光声波球 | 液态渐变球 |
159
+ | --- | --- |
160
+ | ![流光声波球思考动画](docs/desktop-fluid-orb-thinking.gif) | ![液态渐变球思考动画](docs/desktop-goo-orb-thinking.gif) |
161
+
162
+ 从发布页下载 `.dmg`,打开后将 **Qwen Audio Agent** 拖入“应用程序”即可。
163
+
164
+ 从源码生成本机测试版:
165
+
166
+ ```bash
167
+ npm run desktop:build:local
168
+ ```
169
+
170
+ ## 后台常驻
171
+
172
+ 希望个人助理长期在线时,可以安装为用户后台服务:
173
+
174
+ ```bash
175
+ qwenaudio gateway install
176
+ ```
177
+
178
+ 常用管理命令:
179
+
180
+ ```bash
181
+ qwenaudio gateway status
182
+ qwenaudio gateway restart
183
+ qwenaudio gateway stop
184
+ qwenaudio gateway start
185
+ qwenaudio gateway uninstall
186
+ ```
187
+
188
+ ## 选择后台 Agent
189
+
190
+ 通过 `AGENT_PROTOCOL` 选择后台 Agent(必填,没有默认值)。使用 OpenClaw:
191
+
192
+ ```dotenv
193
+ AGENT_PROTOCOL=openclaw
194
+ ```
195
+
196
+ 使用 OpenCode:
197
+
198
+ ```dotenv
199
+ AGENT_PROTOCOL=opencode
200
+ ```
201
+
202
+ 使用 Qoder:
203
+
204
+ ```dotenv
205
+ AGENT_PROTOCOL=qoder
206
+ QODER_MODEL=auto
207
+ ```
208
+
209
+ Hermes、CodeBuddy 和 Codex 也可直接选择:
210
+
211
+ ```dotenv
212
+ AGENT_PROTOCOL=hermes
213
+ # 或 codebuddy、codex
214
+ ```
215
+
216
+ 使用其他支持 ACP stdio 的 Agent:
217
+
218
+ ```dotenv
219
+ AGENT_PROTOCOL=acp
220
+ ACP_COMMAND=your-agent
221
+ ACP_ARGS=["--acp"]
222
+ ```
223
+
224
+ 通用 ACP 入口不需要修改 Gateway 代码。命令、参数、显示名称、模型和工作目录可分别通过 `ACP_COMMAND`、`ACP_ARGS`、`ACP_LABEL`、`ACP_MODEL` 和 `ACP_WORKSPACE` 配置。
225
+
226
+ 后台权限默认使用 `native`,由后台 Agent 在需要时询问。只有在可信项目中,并且
227
+ 明确接受自动执行命令和修改文件时,才应启用:
228
+
229
+ ```dotenv
230
+ QWEN_AUDIO_AGENT_BACKEND_PERMISSION_MODE=full
231
+ ```
232
+
233
+ 详细选项见 [配置说明](docs/configuration.md)。
234
+
235
+ ## 用户档案与记忆
236
+
237
+ 用户数据保存在 `~/.config/qwaudio/`:
238
+
239
+ - `USER.md`:称呼、所在地、偏好和常用项目
240
+ - `frontend-memory.json`:用户明确要求长期记住的信息
241
+ - `tasks.json`:任务结果和待通知状态
242
+
243
+ 这些文件只保存在本机,不会写入源码仓库。可以直接编辑 `USER.md`,也可以在对话中
244
+ 要求助理记住或忘记信息。
245
+
246
+ ## 使用注意事项
247
+
248
+ - 不要在用户档案或对话中保存密码、API Key、验证码和访问令牌。
249
+ - 麦克风音频与实时对话会发送到配置的 Qwen Audio Realtime 服务。
250
+ - 后台任务可能调用所选 Agent 的模型、工具、MCP 和外部服务。
251
+ - `full` 权限允许后台执行命令和修改文件,只应在可信项目中使用。
252
+ - Gateway 默认仅供本机访问;不要直接暴露到局域网或公网。
253
+ - Linux / Windows 使用无回声消除全双工时,请佩戴耳机。
254
+
255
+ 详细数据边界见[隐私说明](PRIVACY.md),网络与权限配置见
256
+ [配置说明](docs/configuration.md)。
257
+
258
+ ## 源码开发
259
+
260
+ ```bash
261
+ npm install
262
+ npm run build
263
+ npm test
264
+ ```
265
+
266
+ ```bash
267
+ npm run dev # Gateway 与 WebUI 热更新
268
+ npm run desktop # macOS 桌面悬浮球
269
+ ```
270
+
271
+ 更多构建、测试和发布说明见 [CONTRIBUTING.md](CONTRIBUTING.md)。
272
+
273
+ ## 参与贡献与安全
274
+
275
+ - 开发与提交说明:[CONTRIBUTING.md](CONTRIBUTING.md)
276
+ - 安全问题报告:[SECURITY.md](SECURITY.md)
277
+ - 数据流向说明:[PRIVACY.md](PRIVACY.md)
278
+ - 第三方组件声明:[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)
279
+
280
+ ## 许可证
281
+
282
+ [Apache License 2.0](LICENSE)