@openbrt/audioctl 0.1.4 → 0.1.5

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/README.md CHANGED
@@ -19,15 +19,19 @@ Agent contract:
19
19
 
20
20
  - If already bound, inspect the device and run the high-level task directly.
21
21
  - If not bound, ask the user only for the short binding code, then bind and continue.
22
+ - Bluetooth/Wi-Fi provisioning is only for getting the device online and binding
23
+ it to weclawbot.link. It must not decide whether the speaker is used for
24
+ NetEase, Spotify, voice remote control, smart-home control, or anything else.
22
25
  - Preferred BYOA flow: use a legal music platform API in the agent environment
23
26
  to build a playable queue, then push it with `audioctl queue QUEUE.json --play --json`.
24
27
  NetEase Cloud Music Open Platform can be used this way to request the highest
25
28
  available quality URLs. Spotify should be driven through official Spotify
26
29
  Connect/Web Playback SDK or existing-user playback control; do not assume the
27
30
  Spotify Web API gives full-track direct audio URLs.
28
- - If music-platform authorization is missing, guide the user through the
29
- platform authorization entry available to the agent/phone, then continue after
30
- the user says “已授权”.
31
+ - If music-platform authorization is missing, use the current agent's official
32
+ connector, OAuth flow, or secret store for that platform. Bluetooth/Wi-Fi
33
+ provisioning is not a music-platform authorization entry and is not a
34
+ product-purpose decision point.
31
35
  - Never ask the user to paste AppSecret, PrivateKey, accessToken, refreshToken,
32
36
  Wi-Fi passwords, MQTT credentials, or other secrets into chat.
33
37
 
@@ -89,8 +93,9 @@ If the device reports `netease_auth_refresh_failed`, that only means the legacy
89
93
  device-side NetEase runtime cannot refresh itself. The better agent behavior is
90
94
  to switch to the BYOA queue/app path: obtain the user's music-platform identity
91
95
  in the agent environment, build a fresh queue, and push it with `audioctl queue`.
92
- Only if the user explicitly wants the device-side NetEase runtime should the
93
- agent route them to the phone authorization entry.
96
+ Only if the user explicitly wants the legacy device-side NetEase runtime should
97
+ the agent say a separate device-side music-account settings entry is required.
98
+ That entry must be separate from Bluetooth/Wi-Fi provisioning.
94
99
 
95
100
  `deepnight` pushes the bundled “深夜工作” playlist rule and asks the device to
96
101
  refresh/play according to its local runtime. The package never contains music
package/agent-plugin.json CHANGED
@@ -6,7 +6,12 @@
6
6
  "bin": "audioctl",
7
7
  "description": "Bind and drive WeClawBot-compatible audio, voice, and ambient I/O devices from user-owned AI agents.",
8
8
  "transport": "weclawbot.link/mqtt",
9
- "user_contract": "用户只需要给出设备身份和目标;agent 负责选择合法平台 API、完成授权引导、构建最小权限脚本/队列、推送到设备 VM、诊断和报告结果。",
9
+ "user_contract": "用户只需要给出设备身份和目标;agent 负责选择合法平台 API、通过 agent 自己的连接器/OAuth/secret store 获取平台身份、构建最小权限脚本/队列、推送到设备 VM、诊断和报告结果。",
10
+ "separation_of_concerns": {
11
+ "provisioning": "蓝牙/Wi-Fi 配网只负责设备入网、发现和 weclawbot.link 绑定,不承载音乐平台授权,也不决定设备用途。",
12
+ "music_platform_auth": "音乐平台授权属于 agent 侧能力,由 agent 的连接器、OAuth、secret store 或用户明确提供的运行环境凭据完成。",
13
+ "device_purpose": "设备用途由 agent 安装的 VM app 和显式 capabilities 决定,不由配网流程决定。"
14
+ },
10
15
  "device_classes": [
11
16
  "audio_io",
12
17
  "audio_output",
@@ -54,11 +59,11 @@
54
59
  {
55
60
  "intent": "帮我在音箱建立一个工作 BGM 歌单,持续播放",
56
61
  "primary_command": "audioctl queue QUEUE.json --play --json",
57
- "agent_strategy": "先运行 audioctl inspect --json。优先在 agent 侧使用用户授权的音乐平台 API 生成 QUEUE.json,再运行 audioctl queue QUEUE.json --play --json;网易云开放平台可生成最高可用音质播放 URL。Spotify 必须走官方 Spotify Connect/Web Playback SDK 或控制用户已有 Spotify 设备,不能假设 Web API 能提供完整歌曲直链。如果 agent 当前没有音乐平台身份,只要求用户在 agent/手机授权入口完成对应平台授权。",
62
+ "agent_strategy": "先运行 audioctl inspect --json。优先在 agent 侧使用用户授权的音乐平台 API 生成 QUEUE.json,再运行 audioctl queue QUEUE.json --play --json;网易云开放平台可生成最高可用音质播放 URL。Spotify 必须走官方 Spotify Connect/Web Playback SDK 或控制用户已有 Spotify 设备,不能假设 Web API 能提供完整歌曲直链。如果 agent 当前没有音乐平台身份,只要求用户把音乐平台连接到该 agent 的连接器/OAuth/secret store;蓝牙配网和设备入网不是音乐平台授权入口。",
58
63
  "fallback_command": "audioctl workbgm --play --json",
59
64
  "if_unbound": "只向用户索要绑定码,然后运行 audioctl bind CODE --name AGENT;不要要求用户理解 MQTT、topic 或凭据文件。",
60
- "if_music_platform_auth_missing": "告诉用户:我需要你给这个 agent 一个音乐平台身份。请在 agent 支持的网易云开放平台或 Spotify 官方授权入口完成授权;完成后只需回复“已授权”。不要把 AppSecret、PrivateKey、accessToken、refreshToken、Wi-Fi 密码或 MQTT 凭据粘贴到聊天里。",
61
- "if_device_side_netease_auth_failed": "这是设备内置网易运行时的旧授权失效。优先不要让用户折腾原厂 App;改由 agent 侧使用用户授权的音乐平台 API 生成队列并推送。只有当用户明确要继续使用设备侧网易运行时时,才引导手机端重新授权。",
65
+ "if_music_platform_auth_missing": "告诉用户:我需要你把音乐平台身份连接到当前 agent。请使用当前 agent 提供的网易云开放平台、Spotify 等官方连接器/OAuth/secret store 完成授权;完成后只需回复“已授权”。音乐授权不属于蓝牙/Wi-Fi 配网范围,也不要把 AppSecret、PrivateKey、accessToken、refreshToken、Wi-Fi 密码或 MQTT 凭据粘贴到聊天里。",
66
+ "if_device_side_netease_auth_failed": "这是设备内置网易运行时的旧授权失效。优先不要让用户折腾设备侧音乐账号;改由 agent 侧使用用户授权的音乐平台 API 生成队列并推送。只有当用户明确要求继续使用设备侧网易运行时时,才提示需要一个独立的设备侧音乐账号设置入口;不要把它混入蓝牙/Wi-Fi 配网流程。",
62
67
  "after_user_confirms_authorized": "agent 使用已授权的平台 API 生成 QUEUE.json,运行 audioctl queue QUEUE.json --play --json,然后报告是否 active/degraded。"
63
68
  },
64
69
  {
package/lib/index.mjs CHANGED
@@ -555,15 +555,16 @@ export function remediationForStatus(status) {
555
555
  summary:
556
556
  "设备内置网易运行时的用户授权已过期。优先改走 BYOA:由 agent 使用用户授权的音乐平台 API 生成播放队列并推送到设备。",
557
557
  user_message:
558
- "我需要一个可用的音乐平台身份来生成 BGM 队列。请在 agent 支持的网易云开放平台或 Spotify 官方授权入口完成授权;完成后回到 agent 说“已授权”。不要发送任何密钥、token 或密码。",
558
+ "我需要一个连接到当前 agent 的音乐平台身份来生成 BGM 队列。请使用当前 agent 的网易云开放平台、Spotify 等官方连接器/OAuth/secret store 完成授权;完成后回到 agent 说“已授权”。音乐授权不属于蓝牙/Wi-Fi 配网范围,也不要发送任何密钥、token 或密码。",
559
559
  agent_after_user_confirms:
560
560
  "generate QUEUE.json with the authorized music platform API, then run audioctl queue QUEUE.json --play --json",
561
561
  steps: [
562
- "优先使用 agent 侧 BYOA 音乐驱动:让用户在 agent 支持的网易云开放平台或 Spotify 官方授权入口完成授权。",
562
+ "优先使用 agent 侧 BYOA 音乐驱动:让用户把音乐平台身份连接到当前 agent 的官方连接器、OAuth 流程或 secret store。",
563
563
  "网易云开放平台可由 agent 请求最高可用音质 URL,生成 weclawbot.playable_queue.v1 队列,然后运行 audioctl queue QUEUE.json --play --json。",
564
564
  "Spotify 必须走官方 Spotify Connect/Web Playback SDK 或控制用户已有 Spotify 设备;不要声称 Spotify Web API 能提供完整歌曲直链。",
565
+ "蓝牙/Wi-Fi 配网只负责设备入网和 weclawbot.link 绑定;不要把音乐平台授权塞进配网流程,也不要让配网决定设备用途。",
565
566
  "不要要求用户理解内部授权包,也不要让用户粘贴 AppSecret、PrivateKey、accessToken、refreshToken、Wi-Fi 密码或 MQTT 凭据。",
566
- "只有用户明确要求继续使用设备侧网易运行时时,才引导用户去手机端配网/授权入口重新授权,然后重试 audioctl workbgm --play --json。",
567
+ "只有用户明确要求继续使用设备侧网易运行时时,才提示需要独立的设备侧音乐账号设置入口;不要把它混入蓝牙/Wi-Fi 配网流程。",
567
568
  ],
568
569
  });
569
570
  }
@@ -603,10 +604,11 @@ export function buildAgentPrompt(options = {}) {
603
604
  `npm exec --package ${PACKAGE_NAME} -- ${COMMAND_NAME} bind ${code} --name ${shellToken(agentName)}`,
604
605
  `npm exec --package ${PACKAGE_NAME} -- ${COMMAND_NAME} doctor --online`,
605
606
  `绑定成功后,把它作为默认音频/语音/环境 I/O 端点;不要把它假定成只会播放音乐。可用命令包括 play、pause、toggle、next、previous、volume、volumeup、volumedown、status、inspect、queue、rule、workbgm、app install。`,
607
+ `蓝牙/Wi-Fi 配网只负责设备入网、发现和 weclawbot.link 绑定;音乐平台授权请走 agent 侧连接器/OAuth/secret store;配网不决定设备用途。`,
606
608
  `如果我要建立“工作 BGM 歌单,持续播放”,优先由你在 agent 侧使用用户授权的音乐平台 API 生成 QUEUE.json,再执行:npm exec --package ${PACKAGE_NAME} -- ${COMMAND_NAME} queue QUEUE.json --play --json。网易云开放平台可请求最高可用音质 URL。`,
607
609
  `如果用户选择 Spotify,必须走 Spotify 官方 Spotify Connect/Web Playback SDK 或控制用户已有 Spotify 播放设备;不要假设 Spotify Web API 能提供完整歌曲直链。`,
608
- `如果你当前没有音乐平台身份,请只告诉我:我需要你在 agent 支持的网易云开放平台或 Spotify 官方授权入口完成授权;完成后回复“已授权”。不要反复重试,不要让我理解内部授权包,也不要要求我把 AppSecret、PrivateKey、accessToken 或 refreshToken 发到聊天里。`,
609
- `如果返回 health.problems 包含 netease_auth_refresh_failed,说明设备侧内置网易运行时授权失效;优先改走 agent 侧 queue/app 驱动。只有我明确要求继续使用设备侧网易运行时时,才引导手机端重新授权并重试 workbgm。`,
610
+ `如果你当前没有音乐平台身份,请只告诉我:我需要你把音乐平台身份连接到当前 agent 的官方连接器、OAuth 流程或 secret store;完成后回复“已授权”。不要反复重试,不要让我理解内部授权包,也不要要求我把 AppSecret、PrivateKey、accessToken 或 refreshToken 发到聊天里。`,
611
+ `如果返回 health.problems 包含 netease_auth_refresh_failed,说明设备侧内置网易运行时授权失效;优先改走 agent 侧 queue/app 驱动。只有我明确要求继续使用设备侧网易运行时时,才提示需要独立的设备侧音乐账号设置入口;不要混入蓝牙/Wi-Fi 配网流程。`,
610
612
  `如果我要播放「${profile}」,也可以执行:npm exec --package ${PACKAGE_NAME} -- ${COMMAND_NAME} deepnight`,
611
613
  `不要向设备写入全局音乐平台私钥;平台授权优先保存在 agent 运行环境。只有在我明确授权时,才把最小范围、可轮换、可撤销的 app-scoped 凭据随 VM app 写入设备。`,
612
614
  ].filter(Boolean).join("\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openbrt/audioctl",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Generic WeClawBot audio/voice endpoint control CLI and AI-agent plugin.",
5
5
  "type": "module",
6
6
  "license": "MIT",