qwen-audio-agent 0.12.1 → 1.0.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.
- package/CONTRIBUTING.md +7 -2
- package/README.md +6 -5
- package/README_EN.md +8 -9
- package/cli/package.json +1 -1
- package/package.json +1 -1
- package/scripts/claude-code-acp +4 -0
- package/scripts/codex-acp +4 -0
- package/scripts/openclaw +38 -4
- package/scripts/opencode-server +17 -1
- package/server/package.json +1 -1
- package/server/src/app/bootstrap.mjs +11 -1
- package/server/src/core/config.mjs +7 -2
- package/server/src/index.mjs +2 -1
- package/server/src/process/openclaw-desktop-helper.mjs +21 -0
- package/tui/package.json +1 -1
package/CONTRIBUTING.md
CHANGED
|
@@ -55,9 +55,14 @@ npm run version:set -- 0.6.0-beta.1 # 指定预发布版本
|
|
|
55
55
|
应从专用分支提交,例如 `release/0.11.0` 或 `codex/release-0.11.0`。Release PR
|
|
56
56
|
合并到 `main` 后,工作流会确认版本确实发生变化、版本对应的 Changelog 存在且
|
|
57
57
|
完整检查通过,然后自动创建 `v0.11.0` 标签、以 npm provenance 发布公共包,
|
|
58
|
-
|
|
58
|
+
构建 Universal macOS 桌面版,完成 Developer ID 签名和 Apple 公证,并将 DMG
|
|
59
|
+
上传到 GitHub Release。
|
|
59
60
|
|
|
60
61
|
普通 PR 合并或未改变版本号的 `main` 更新不会触发发布。若发布在创建标签、上传
|
|
61
62
|
npm 或生成 Release 之间中断,可从 GitHub Actions 手动运行 Release 工作流,并
|
|
62
63
|
输入当前 `package.json` 中的版本继续;已经完成的阶段会被安全复用。仓库维护者
|
|
63
|
-
需预先配置 `NPM_TOKEN
|
|
64
|
+
需预先配置 `NPM_TOKEN`,以及以下 GitHub Actions Secrets:
|
|
65
|
+
|
|
66
|
+
- `CSC_LINK`:包含证书和私钥的加密 `.p12` 文件,以 Base64 编码保存。
|
|
67
|
+
- `CSC_KEY_PASSWORD`:导出 `.p12` 时设置的密码。
|
|
68
|
+
- `APPLE_ID`、`APPLE_APP_SPECIFIC_PASSWORD`、`APPLE_TEAM_ID`:Apple 公证凭据。
|
package/README.md
CHANGED
|
@@ -111,12 +111,13 @@ npm install -g git+https://github.com/QwenAudio/qwen-audio-agent.git
|
|
|
111
111
|
|
|
112
112
|
## 获取 DashScope API Key
|
|
113
113
|
|
|
114
|
-
阿里云百炼为 Qwen Audio 3.0 Realtime
|
|
114
|
+
阿里云百炼为 Qwen Audio 3.0 Realtime 提供
|
|
115
|
+
[新人免费额度](https://help.aliyun.com/zh/model-studio/new-free-quota),创建 API Key 后
|
|
116
|
+
即可免费开始使用 qwen-audio-agent。
|
|
115
117
|
|
|
116
|
-
1.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
3. 复制生成的 Key,稍后填入 `config.env`。请勿公开或提交 API Key。
|
|
118
|
+
1. 打开百炼控制台的 [API Key 页面](https://bailian.console.aliyun.com/?tab=model#/api-key),
|
|
119
|
+
登录账号,单击**创建 API Key**。
|
|
120
|
+
2. 复制生成的 Key,稍后填入 `config.env`。请勿公开或提交 API Key。
|
|
120
121
|
|
|
121
122
|
详细说明见[百炼官方文档](https://help.aliyun.com/zh/model-studio/get-api-key)。
|
|
122
123
|
|
package/README_EN.md
CHANGED
|
@@ -127,15 +127,14 @@ npm install -g git+https://github.com/QwenAudio/qwen-audio-agent.git
|
|
|
127
127
|
|
|
128
128
|
## Get a DashScope API Key
|
|
129
129
|
|
|
130
|
-
Alibaba Cloud Model Studio
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
3. Copy the generated Key and add it to `config.env` later. Never publish or
|
|
130
|
+
Alibaba Cloud Model Studio includes Qwen Audio 3.0 Realtime in its
|
|
131
|
+
[free quota for new users](https://help.aliyun.com/en/model-studio/new-free-quota).
|
|
132
|
+
Create an API Key to start using qwen-audio-agent for free.
|
|
133
|
+
|
|
134
|
+
1. Open the Model Studio
|
|
135
|
+
[API Key page](https://bailian.console.aliyun.com/?tab=model#/api-key), sign
|
|
136
|
+
in, and click **Create API Key**.
|
|
137
|
+
2. Copy the generated Key and add it to `config.env` later. Never publish or
|
|
139
138
|
commit your API Key.
|
|
140
139
|
|
|
141
140
|
See the [official API Key guide](https://help.aliyun.com/en/model-studio/get-api-key)
|
package/cli/package.json
CHANGED
package/package.json
CHANGED
package/scripts/claude-code-acp
CHANGED
|
@@ -37,6 +37,10 @@ run_binary() {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
run_package() {
|
|
40
|
+
if [ "${QWEN_AUDIO_AGENT_DESKTOP_INSTALLED_ONLY:-}" = "1" ]; then
|
|
41
|
+
echo "claude-code-acp is not installed. Install the ACP adapter before selecting Claude Code in the desktop app." >&2
|
|
42
|
+
exit 1
|
|
43
|
+
fi
|
|
40
44
|
if ! command -v npx >/dev/null 2>&1; then
|
|
41
45
|
echo "claude-code-acp package mode requires npx." >&2
|
|
42
46
|
exit 1
|
package/scripts/codex-acp
CHANGED
|
@@ -35,6 +35,10 @@ run_binary() {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
run_package() {
|
|
38
|
+
if [ "${QWEN_AUDIO_AGENT_DESKTOP_INSTALLED_ONLY:-}" = "1" ]; then
|
|
39
|
+
echo "codex-acp is not installed. Install the ACP adapter before selecting Codex in the desktop app." >&2
|
|
40
|
+
exit 1
|
|
41
|
+
fi
|
|
38
42
|
if ! command -v npx >/dev/null 2>&1; then
|
|
39
43
|
echo "codex-acp package mode requires npx." >&2
|
|
40
44
|
exit 1
|
package/scripts/openclaw
CHANGED
|
@@ -3,6 +3,38 @@ set -eu
|
|
|
3
3
|
|
|
4
4
|
QWEN_AUDIO_AGENT_ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
|
5
5
|
export QWEN_AUDIO_AGENT_ROOT
|
|
6
|
+
QWEN_AUDIO_AGENT_SOURCE_ROOT=${QWEN_AUDIO_AGENT_SOURCE_ROOT:-"$QWEN_AUDIO_AGENT_ROOT"}
|
|
7
|
+
|
|
8
|
+
run_qwenaudio_node() {
|
|
9
|
+
if [ "${QWEN_AUDIO_AGENT_DESKTOP:-}" = "1" ]; then
|
|
10
|
+
ELECTRON_RUN_AS_NODE=1 "${QWEN_AUDIO_AGENT_NODE:-node}" "$@"
|
|
11
|
+
return
|
|
12
|
+
fi
|
|
13
|
+
"${QWEN_AUDIO_AGENT_NODE:-node}" "$@"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
run_openclaw_helper() {
|
|
17
|
+
if [ "$QWEN_AUDIO_AGENT_SOURCE_ROOT" != "$QWEN_AUDIO_AGENT_ROOT" ]; then
|
|
18
|
+
run_qwenaudio_node \
|
|
19
|
+
"$QWEN_AUDIO_AGENT_SOURCE_ROOT/server/src/process/openclaw-desktop-helper.mjs" \
|
|
20
|
+
"$@"
|
|
21
|
+
return
|
|
22
|
+
fi
|
|
23
|
+
case "$1" in
|
|
24
|
+
prepare)
|
|
25
|
+
shift
|
|
26
|
+
run_qwenaudio_node \
|
|
27
|
+
"$QWEN_AUDIO_AGENT_ROOT/scripts/prepare-openclaw-config.mjs" \
|
|
28
|
+
"$@"
|
|
29
|
+
;;
|
|
30
|
+
sync-token)
|
|
31
|
+
shift
|
|
32
|
+
run_qwenaudio_node \
|
|
33
|
+
"$QWEN_AUDIO_AGENT_ROOT/scripts/sync-openclaw-gateway-token.mjs" \
|
|
34
|
+
"$@"
|
|
35
|
+
;;
|
|
36
|
+
esac
|
|
37
|
+
}
|
|
6
38
|
|
|
7
39
|
if [ "${QWEN_AUDIO_AGENT_ENV_LOADED:-}" != "1" ]; then
|
|
8
40
|
if [ -f "$QWEN_AUDIO_AGENT_ROOT/.env.local" ]; then
|
|
@@ -71,8 +103,7 @@ if [ "${1:-}" = "gateway" ]; then
|
|
|
71
103
|
OPENCLAW_USER_CONFIG_PATH=$OPENCLAW_CONFIG_PATH
|
|
72
104
|
OPENCLAW_USER_STATE_DIR=$(dirname -- "$OPENCLAW_USER_CONFIG_PATH")
|
|
73
105
|
OPENCLAW_RUNTIME_CONFIG_PATH="$OPENCLAW_RUNTIME_STATE_DIR/openclaw.json"
|
|
74
|
-
|
|
75
|
-
"$QWEN_AUDIO_AGENT_ROOT/scripts/prepare-openclaw-config.mjs" \
|
|
106
|
+
run_openclaw_helper prepare \
|
|
76
107
|
"$OPENCLAW_USER_CONFIG_PATH" \
|
|
77
108
|
"$OPENCLAW_RUNTIME_CONFIG_PATH"
|
|
78
109
|
export OPENCLAW_CONFIG_PATH="$OPENCLAW_RUNTIME_CONFIG_PATH"
|
|
@@ -104,8 +135,7 @@ if [ -n "$OPENCLAW_GATEWAY_TOKEN" ]; then
|
|
|
104
135
|
chmod 600 "$OPENCLAW_GATEWAY_TOKEN_TMP"
|
|
105
136
|
mv -f "$OPENCLAW_GATEWAY_TOKEN_TMP" "$OPENCLAW_GATEWAY_TOKEN_FILE"
|
|
106
137
|
elif [ "${1:-}" = "gateway" ]; then
|
|
107
|
-
|
|
108
|
-
"$QWEN_AUDIO_AGENT_ROOT/scripts/sync-openclaw-gateway-token.mjs" \
|
|
138
|
+
run_openclaw_helper sync-token \
|
|
109
139
|
"$OPENCLAW_GATEWAY_TOKEN_FILE"
|
|
110
140
|
fi
|
|
111
141
|
export OPENCLAW_GATEWAY_TOKEN_FILE
|
|
@@ -148,6 +178,10 @@ run_source() {
|
|
|
148
178
|
}
|
|
149
179
|
|
|
150
180
|
run_package() {
|
|
181
|
+
if [ "${QWEN_AUDIO_AGENT_DESKTOP_INSTALLED_ONLY:-}" = "1" ]; then
|
|
182
|
+
echo "OpenClaw is not installed. Install OpenClaw before selecting it in the desktop app." >&2
|
|
183
|
+
exit 1
|
|
184
|
+
fi
|
|
151
185
|
if ! command -v npx >/dev/null 2>&1; then
|
|
152
186
|
echo "OpenClaw package mode requires npx." >&2
|
|
153
187
|
exit 1
|
package/scripts/opencode-server
CHANGED
|
@@ -9,6 +9,14 @@ OPENCODE_MIN_VERSION=${OPENCODE_MIN_VERSION:-1.18.0}
|
|
|
9
9
|
OPENCODE_COMMAND=${OPENCODE_COMMAND:-serve}
|
|
10
10
|
QWEN_AUDIO_AGENT_NODE=${QWEN_AUDIO_AGENT_NODE:-node}
|
|
11
11
|
|
|
12
|
+
run_qwenaudio_node() {
|
|
13
|
+
if [ "${QWEN_AUDIO_AGENT_DESKTOP:-}" = "1" ]; then
|
|
14
|
+
ELECTRON_RUN_AS_NODE=1 "$QWEN_AUDIO_AGENT_NODE" "$@"
|
|
15
|
+
return
|
|
16
|
+
fi
|
|
17
|
+
"$QWEN_AUDIO_AGENT_NODE" "$@"
|
|
18
|
+
}
|
|
19
|
+
|
|
12
20
|
if [ "${QWEN_AUDIO_AGENT_ENV_LOADED:-}" != "1" ]; then
|
|
13
21
|
if [ -f "$QWEN_AUDIO_AGENT_ROOT/.env.local" ]; then
|
|
14
22
|
set -a
|
|
@@ -84,6 +92,10 @@ run_source() {
|
|
|
84
92
|
}
|
|
85
93
|
|
|
86
94
|
run_package() {
|
|
95
|
+
if [ "${QWEN_AUDIO_AGENT_DESKTOP_INSTALLED_ONLY:-}" = "1" ]; then
|
|
96
|
+
echo "OpenCode is not installed. Install OpenCode before selecting it in the desktop app." >&2
|
|
97
|
+
exit 1
|
|
98
|
+
fi
|
|
87
99
|
if ! command -v npx >/dev/null 2>&1; then
|
|
88
100
|
echo "OpenCode package mode requires npx." >&2
|
|
89
101
|
exit 1
|
|
@@ -115,7 +127,7 @@ installed_version() {
|
|
|
115
127
|
}
|
|
116
128
|
|
|
117
129
|
version_supported() {
|
|
118
|
-
|
|
130
|
+
run_qwenaudio_node -e '
|
|
119
131
|
const parse = value => {
|
|
120
132
|
const match = String(value).match(/(\d+)\.(\d+)\.(\d+)/)
|
|
121
133
|
return match ? match.slice(1).map(Number) : null
|
|
@@ -186,6 +198,10 @@ if command -v opencode >/dev/null 2>&1; then
|
|
|
186
198
|
fi
|
|
187
199
|
exec opencode "$OPENCODE_COMMAND" "$@"
|
|
188
200
|
fi
|
|
201
|
+
if [ "${QWEN_AUDIO_AGENT_DESKTOP_INSTALLED_ONLY:-}" = "1" ]; then
|
|
202
|
+
echo "Installed OpenCode $VERSION is older than the supported minimum $OPENCODE_MIN_VERSION." >&2
|
|
203
|
+
exit 1
|
|
204
|
+
fi
|
|
189
205
|
echo "Installed OpenCode $VERSION is older than the supported minimum; using $OPENCODE_PACKAGE." >&2
|
|
190
206
|
fi
|
|
191
207
|
|
package/server/package.json
CHANGED
|
@@ -229,6 +229,7 @@ app.use(express.static(webDist))
|
|
|
229
229
|
app.get('*', (req, res) => res.sendFile(resolve(webDist, 'index.html')))
|
|
230
230
|
|
|
231
231
|
const server = createServer(app)
|
|
232
|
+
export { server }
|
|
232
233
|
realtimeGateway = attachRealtimeGateway(server, {
|
|
233
234
|
identityManager,
|
|
234
235
|
memoryStore: frontendMemory,
|
|
@@ -243,5 +244,14 @@ realtimeGateway = attachRealtimeGateway(server, {
|
|
|
243
244
|
permissionPolicy,
|
|
244
245
|
})
|
|
245
246
|
server.listen(config.port, config.host, () => {
|
|
246
|
-
|
|
247
|
+
const address = server.address()
|
|
248
|
+
const port = address && typeof address === 'object' ? address.port : config.port
|
|
249
|
+
const origin = `http://${config.host}:${port}`
|
|
250
|
+
if (process.parentPort) {
|
|
251
|
+
process.parentPort.postMessage({
|
|
252
|
+
type: 'qwen-audio-agent:gateway-ready',
|
|
253
|
+
origin,
|
|
254
|
+
})
|
|
255
|
+
}
|
|
256
|
+
console.log(`qwen-audio-agent running at ${origin}`)
|
|
247
257
|
})
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
} from '../../../shared/backend-catalog.mjs'
|
|
9
9
|
|
|
10
10
|
const here = dirname(fileURLToPath(import.meta.url))
|
|
11
|
-
const
|
|
11
|
+
const sourceRoot = resolve(here, '../../..')
|
|
12
|
+
const root = process.env.QWEN_AUDIO_AGENT_RUNTIME_ROOT || sourceRoot
|
|
12
13
|
const runtimeEnvironment = loadRuntimeEnvironment({ root })
|
|
13
14
|
|
|
14
15
|
function numberSetting(value, fallback, {
|
|
@@ -187,7 +188,11 @@ export function resolveOpenCodeCoordinatorAgent(env = process.env) {
|
|
|
187
188
|
export const config = {
|
|
188
189
|
root,
|
|
189
190
|
host: process.env.HOST || '127.0.0.1',
|
|
190
|
-
|
|
191
|
+
// PORT=0 lets an embedded host (e.g. the desktop app) fall back to a
|
|
192
|
+
// random loopback port and learn it from the child process report.
|
|
193
|
+
port: String(process.env.PORT || '').trim() === '0'
|
|
194
|
+
? 0
|
|
195
|
+
: numberSetting(process.env.PORT, 3101, { min: 1, max: 65535 }),
|
|
191
196
|
audioProvider: String(
|
|
192
197
|
process.env.QWEN_AUDIO_REALTIME_PROVIDER || 'dashscope',
|
|
193
198
|
).trim().toLowerCase(),
|
package/server/src/index.mjs
CHANGED
|
@@ -3,7 +3,8 @@ import { fileURLToPath } from 'node:url'
|
|
|
3
3
|
import { loadRuntimeEnvironment } from '../../shared/runtime-environment.mjs'
|
|
4
4
|
import { startManagedBackend } from './process/managed-backend.mjs'
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const sourceRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../..')
|
|
7
|
+
const root = process.env.QWEN_AUDIO_AGENT_RUNTIME_ROOT || sourceRoot
|
|
7
8
|
loadRuntimeEnvironment({ root })
|
|
8
9
|
|
|
9
10
|
let backendRuntime
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
syncOpenClawGatewayTokenFile,
|
|
5
|
+
writeIsolatedOpenClawConfig,
|
|
6
|
+
} from './backend-drivers/openclaw-auth.mjs'
|
|
7
|
+
|
|
8
|
+
const [, , command, ...args] = process.argv
|
|
9
|
+
|
|
10
|
+
if (command === 'prepare') {
|
|
11
|
+
const [sourcePath, targetPath] = args
|
|
12
|
+
if (!writeIsolatedOpenClawConfig({ sourcePath, targetPath })) {
|
|
13
|
+
process.stderr.write('Unable to prepare isolated OpenClaw configuration.\n')
|
|
14
|
+
process.exitCode = 1
|
|
15
|
+
}
|
|
16
|
+
} else if (command === 'sync-token') {
|
|
17
|
+
syncOpenClawGatewayTokenFile({ targetPath: args[0] })
|
|
18
|
+
} else {
|
|
19
|
+
process.stderr.write(`Unknown OpenClaw desktop helper command: ${command || '(empty)'}\n`)
|
|
20
|
+
process.exitCode = 1
|
|
21
|
+
}
|