@sonicloud/dsh-sonicloud-device 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/CHANGELOG.zh.md +35 -0
  3. package/LICENSE +25 -0
  4. package/README.md +139 -2
  5. package/cordis.patch.yml +3 -0
  6. package/dist/build.json +5 -0
  7. package/dist/client.js +20621 -0
  8. package/docs/contributing/development.md +200 -0
  9. package/docs/specs/ci-cd.md +128 -0
  10. package/docs/specs/mouse-settings.md +255 -0
  11. package/docs/specs/smart-mouse-plugin.md +239 -0
  12. package/native/COPYING.LGPLv2.1 +502 -0
  13. package/native/LICENSE.hidapi-bsd +26 -0
  14. package/native/README.md +15 -0
  15. package/native/SOURCE.json +16 -0
  16. package/native/THIRD_PARTY_LICENSES.txt +69 -0
  17. package/native/darwin-arm64/README.md +71 -0
  18. package/native/darwin-arm64/libavcodec.62.28.102.dylib +0 -0
  19. package/native/darwin-arm64/libavcodec.62.dylib +0 -0
  20. package/native/darwin-arm64/libavutil.60.26.102.dylib +0 -0
  21. package/native/darwin-arm64/libavutil.60.dylib +0 -0
  22. package/native/darwin-arm64/libuMouseSdk.0.4.20.dylib +0 -0
  23. package/native/darwin-arm64/libuMouseSdk.0.dylib +0 -0
  24. package/native/darwin-arm64/libuMouseSdk.dylib +0 -0
  25. package/native/desktop/CompatibilityPolicy.swift +17 -0
  26. package/native/desktop/VoicePanel.cs +197 -0
  27. package/native/desktop/VoicePanel.swift +322 -0
  28. package/native/desktop/darwin-arm64/Sonicloud Voice.app/Contents/Info.plist +10 -0
  29. package/native/desktop/darwin-arm64/Sonicloud Voice.app/Contents/MacOS/sonicloud-voice +0 -0
  30. package/native/desktop/windows.ps1 +9 -0
  31. package/native/win32-x64/README.md +70 -0
  32. package/native/win32-x64/avcodec-58.dll +0 -0
  33. package/native/win32-x64/avutil-56.dll +0 -0
  34. package/native/win32-x64/msvcp140.dll +0 -0
  35. package/native/win32-x64/uMouseSdk.dll +0 -0
  36. package/native/win32-x64/vcruntime140.dll +0 -0
  37. package/native/win32-x64/vcruntime140_1.dll +0 -0
  38. package/package.json +74 -4
  39. package/src/asr/auth.mjs +80 -0
  40. package/src/asr/config.mjs +6 -0
  41. package/src/asr/languages.mjs +28 -0
  42. package/src/asr/stream.mjs +149 -0
  43. package/src/client/assets/contact-wechat.jpg +0 -0
  44. package/src/client/assets/sonicloud.png +0 -0
  45. package/src/client/assets/sonicloud.svg +3 -0
  46. package/src/desktop/presentation.mjs +87 -0
  47. package/src/devices/actions.mjs +46 -0
  48. package/src/devices/config.mjs +9 -0
  49. package/src/devices/diagnostics.mjs +52 -0
  50. package/src/devices/manager.mjs +335 -0
  51. package/src/devices/native-worker.mjs +64 -0
  52. package/src/devices/native.mjs +86 -0
  53. package/src/devices/queue.mjs +32 -0
  54. package/src/devices/recognition.mjs +23 -0
  55. package/src/devices/store.mjs +44 -0
  56. package/src/devices/translate.mjs +44 -0
  57. package/src/host/ai-conversation.mjs +83 -0
  58. package/src/host/index.mjs +96 -0
  59. package/src/host/store.mjs +24 -0
  60. package/src/shared/devices.mjs +69 -0
  61. package/src/shared/languages.mjs +111 -0
  62. package/src/shared/mouse-settings.mjs +22 -0
  63. package/src/shared/remote.mjs +55 -0
  64. package/src/shared/transcript.mjs +16 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,35 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.1.1 - 2026-11-09
6
+
7
+ ### Added
8
+
9
+ - Enable GitHub Actions: dev pushes build test packages and main pushes publish releases through npm Trusted Publisher, with bilingual changelog and package checks, run summaries, and release recovery.
10
+
11
+ ### Fixed
12
+
13
+ - Wait for npm processing before checking the version and download, avoiding premature failures after a successful upload.
14
+
15
+ ## 0.1.0 - 2026-11-09
16
+
17
+ Initial release of the Sonicloud smart mouse plugin for DeepSeek Harness 0.2.1-rc.5 and later.
18
+
19
+ ### Added
20
+
21
+ - Integrate Sonicloud smart mice connected through Bluetooth or a 2.4G USB receiver, with bundled native SDKs for macOS ARM64 and Windows x64.
22
+ - Add Sonicloud Devices settings showing device names, SNs, connection types, and battery levels, with device switching, per-device preferences, automatic saving, restored defaults, and preference restoration on reconnection.
23
+ - Support 800, 1200, 1600, and 2400 DPI settings; synchronize physical DPI-button changes to the originating device's displayed and saved values, with separately configurable report and command mappings.
24
+ - Support hold-to-talk voice typing and translation using the mouse, with recognition language, punctuation, and translation source and target language settings.
25
+ - Configure the M key for Enter, Backspace, voice typing, voice translation, voice search, or opening a link; offer Baidu, Bing, and Google search, and save links on confirmation with optional HTTP/HTTPS schemes.
26
+ - Use the AI key to activate Harness, reuse the current conversation or create one, and append recognized text to the conversation draft; provide a per-device Auto-send switch enabled by default.
27
+ - Add a standalone desktop voice panel with recognition previews, processing status, errors, cancellation, and result copying; continue voice processing while the main window is minimized or hidden, with one voice session at a time.
28
+ - Insert text into desktop application inputs after checking the target and input state, retaining results for copying when safe insertion is unavailable; use compatibility paste on macOS while protecting and restoring clipboard contents.
29
+ - Obtain voice and translation service credentials automatically using the originating device SN, refreshing and retrying once on authentication failure without manual credential setup; handle device disconnections, reconnect event streams, and report macOS USB interface contention.
30
+ - Provide local development and automatic reload commands, development and feature specifications, and tests for device isolation, settings UI, voice flows, and host Gateway integration.
31
+
32
+ ### Changed
33
+
34
+ - **Breaking change:** Compared with the old local package, rename the npm package to `@sonicloud/dsh-sonicloud-device`; preserve the plugin instance ID and device configuration storage keys.
35
+ - License project code under MIT; bundled native components retain their own licenses.
@@ -0,0 +1,35 @@
1
+ # 更新日志
2
+
3
+ ## 未发布
4
+
5
+ ## 0.1.1 - 2026-11-09
6
+
7
+ ### 新增
8
+
9
+ - 启用 GitHub Actions:dev 推送生成测试包,main 推送通过 npm Trusted Publisher 发布正式包;提供双语日志与包内容校验、运行摘要及发布恢复。
10
+
11
+ ### 修复
12
+
13
+ - 等待 npm 异步处理完成后再核对版本和下载内容,避免上传成功后过早误报发布失败。
14
+
15
+ ## 0.1.0 - 2026-11-09
16
+
17
+ 首次发布声云智能鼠标插件,适用于 DeepSeek Harness 0.2.1-rc.5 及更高版本。
18
+
19
+ ### 新增
20
+
21
+ - 接入通过蓝牙或 2.4G USB 接收器连接的声云智能鼠标,随包提供 macOS ARM64 和 Windows x64 原生 SDK。
22
+ - 提供“声云设备”设置页,展示设备名称、SN、连接方式和电量,支持多设备切换、按设备保存偏好、自动保存、恢复默认及重连恢复。
23
+ - 支持 800、1200、1600、2400 DPI 设置;实体 DPI 键切档后同步更新对应设备的界面值和保存值,上报与下发映射可分别配置。
24
+ - 支持鼠标按住说话、松开结束的语音打字与翻译,提供识别语言、标点及翻译源语言和目标语言设置。
25
+ - 支持 M 键配置为回车、后退、语音打字、语音翻译、语音搜索或一键链接;搜索可选百度、Bing、Google,链接经确认后保存并允许省略 HTTP/HTTPS 协议。
26
+ - 支持 AI 键唤起 Harness、复用当前对话或新建对话,并将识别文字追加到对话草稿;提供按设备保存、默认开启的“自动发送”开关。
27
+ - 提供独立桌面语音浮层,显示识别预览、处理状态和错误,支持取消及复制结果;主窗口最小化或隐藏时继续处理语音,同一时间仅运行一个语音会话。
28
+ - 支持向桌面应用输入框回填文字,检查目标和输入状态,无法安全回填时保留结果供复制;macOS 使用兼容粘贴并保护、恢复剪贴板内容。
29
+ - 按来源设备 SN 自动获取语音与翻译服务凭证,支持鉴权失效后刷新并重试一次,无需手填鉴权配置;提供设备断连处理、事件流重连及 macOS USB 接口占用提示。
30
+ - 提供本地开发与自动重载命令、开发及功能规格文档,以及设备隔离、设置界面、语音流程和宿主 Gateway 集成测试。
31
+
32
+ ### 变更
33
+
34
+ - **破坏性变更:** 相对旧本地包,npm 包名迁移为 `@sonicloud/dsh-sonicloud-device`;保留插件实例 ID 和设备配置存储键。
35
+ - 项目代码采用 MIT 许可;随包原生组件保留各自许可。
package/LICENSE ADDED
@@ -0,0 +1,25 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SonicloudTech
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ Third-party components and the bundled proprietary uMouseSdk binaries retain
24
+ their own licenses. See native/THIRD_PARTY_LICENSES.txt and the license files
25
+ in native/ for their notices and terms.
package/README.md CHANGED
@@ -1,3 +1,140 @@
1
- # Temporary Holding Version
1
+ # 声云智能鼠标插件
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 使用声云智能鼠标在桌面应用中进行语音输入、翻译和搜索,并通过 DeepSeek Harness 管理鼠标按键和灵敏度。安装后,可在 Harness 设置中的“声云设备”查看和配置鼠标。
4
+
5
+ ## 你可以做什么
6
+
7
+ - **语音打字**:按住鼠标语音键说话,松开后将识别文字填入按键时聚焦的可编辑输入框,不自动发送。
8
+ - **语音翻译**:设置源语言和目标语言,将语音键或 M 键设为语音翻译,松开后回填译文。
9
+ - **语音搜索**:将 M 键设为语音搜索,说出关键词后使用所选搜索引擎搜索。
10
+ - **自定义按键**:为 M 键选择回车、后退、一键链接等动作;长按 AI 键可唤起 Harness 并向 AI 对话输入框填入语音文字,默认自动发送,可在设备设置关闭。
11
+ - **管理多台鼠标**:查看连接方式、电量和设备序列号,分别保存每台鼠标的语言、按键和灵敏度设置。
12
+
13
+ 插件根据当前鼠标身份自动接入服务,无需手填鉴权配置。
14
+
15
+ ## 使用前准备
16
+
17
+ - DeepSeek Harness **0.2.1-rc.5 或更高版本**。
18
+ - 支持本插件的声云智能鼠标,通过蓝牙或 2.4G USB 接收器连接。
19
+ - 插件安装包(`.tgz` 文件),以及可访问语音服务的网络。
20
+
21
+ 安装包包含 Apple 芯片 Mac 和 Windows x64 所需的设备组件。维护者已确认完成 0.1.0 的实机验收;其他系统暂不保证可用。
22
+
23
+ ## 安装与启用
24
+
25
+ 1. 启动一次 Harness,完成初始化,然后完全退出应用。
26
+ 2. 在终端执行以下命令,将路径替换为你取得的安装包的完整路径:
27
+
28
+ ```sh
29
+ dsh plugin --profile desktop add "/绝对路径/sonicloud-dsh-sonicloud-device-0.1.1.tgz"
30
+ ```
31
+
32
+ 文件名以实际安装包为准。Mac 如果提示找不到 `dsh`,可使用:
33
+
34
+ ```sh
35
+ "/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh" plugin --profile desktop add "/绝对路径/sonicloud-dsh-sonicloud-device-0.1.1.tgz"
36
+ ```
37
+
38
+ 3. 重新启动 Harness,在插件管理中启用 `dsh-sonicloud-device`。
39
+ 4. 打开设置,进入侧栏的“声云设备”。
40
+
41
+ 正式版也可按确切版本从 npm 安装:
42
+
43
+ ```sh
44
+ dsh plugin --profile desktop add @sonicloud/dsh-sonicloud-device@0.1.1
45
+ ```
46
+
47
+ 若安装提示 `ERR_PNPM_IGNORED_BUILDS` 且指向 `koffi`,在该 profile 的 `pnpm-workspace.yaml` 中补充以下配置,替换为报错中的确切版本后重试;保留已有配置,仅批准这一原生依赖:
48
+
49
+ ```yaml
50
+ allowBuilds:
51
+ "koffi@<报错中的版本>": true
52
+ ```
53
+
54
+ 从旧包迁移时,完全退出 Harness,先运行 `dsh plugin --profile desktop remove dsh-sonicloud-device`,再安装新包。插件实例 ID 仍为 `dsh-sonicloud-device`,按 SN 保存的设备偏好继续使用原存储键;不要删除 profile 数据。
55
+
56
+ 测试包从 [Actions](https://github.com/SonicloudTech/dsh-sonicloud-device/actions/workflows/release.yml) 的运行摘要下载,保留 30 天;下载需要登录 GitHub,解压外层归档后安装其中的 `.tgz`。
57
+
58
+ ## 开始使用
59
+
60
+ ### 连接与设置鼠标
61
+
62
+ 打开鼠标电源,选择蓝牙或 2.4G 模式并完成连接。在“声云设备”中选中鼠标,即可查看电量、连接方式和序列号(SN)。
63
+
64
+ 你可以调整语音识别语言、是否保留标点、鼠标灵敏度(DPI)以及按键动作。更改后自动保存,无需点击保存按钮。“恢复默认”只重置当前鼠标;重新连接同一台鼠标时会恢复已保存的设置。
65
+
66
+ ### 语音输入
67
+
68
+ 1. 在“声云设备”中,将“语音键”设为“语音打字”,选择识别语言。
69
+ 2. 在目标应用的可编辑输入框中放置光标;不必打开 Harness 对话。
70
+ 3. 按住鼠标语音键说话,松开后等待识别完成。
71
+ 4. 检查输入框中的文字,再自行发送。
72
+
73
+ 录音来自鼠标。识别中间文字、整理和翻译状态显示在鼠标所在屏幕底部居中的独立浮层,不抢占输入焦点。Harness 主窗口最小化、隐藏或切换页面不会取消会话;插件后台仍须运行,完全退出 Harness 后不可用。
74
+
75
+ 点击浮层叉号按钮或断开鼠标可取消会话。输入目标、内容或选区发生变化,或应用不支持安全回填时,浮层保留结果供复制。macOS 自动回填需要在“系统设置 → 隐私与安全性 → 辅助功能”中允许 Sonicloud Voice;没有权限仍可识别并复制结果。Windows 对不提供可编辑 UI Automation 文本接口的输入框保留结果供复制。
76
+
77
+ macOS 默认使用兼容粘贴回填,支持 Zed 等未提供辅助功能写入接口的应用。录音期间保持目标窗口和文档,不进行键盘编辑、鼠标点击或滚动;可读取内容与选区时也会检查是否变化。回填临时使用剪贴板并恢复原内容,不覆盖期间的新复制内容;检测到目标或输入活动变化时保留结果供复制。
78
+
79
+ ### 按键与搜索
80
+
81
+ | 按键 | 使用方式 |
82
+ | --- | --- |
83
+ | 语音键 | 选择语音打字或语音翻译,按住说话、松开结束 |
84
+ | M 键 | 可选回车、后退、语音打字、语音翻译、语音搜索、一键链接等动作;语音动作按住说话,其他动作在松键时执行 |
85
+ | AI 键 | 长按说话、松开结束;Harness 不在前台时自动唤起,在 AI 对话页时填充当前对话,否则新建对话并填充;无需输入框焦点;“自动发送”默认开启,关闭时仅填充 |
86
+
87
+ AI 键仅作用于 DeepSeek Harness,沿用当前鼠标的识别语言与标点配置。识别结果追加到已有草稿末尾;“自动发送”开启时提交完整草稿及附件,关闭时保留供手动发送。开关按设备保存,录音使用按下时的设置;录音期间切换页面或对话,完成后仍回到本次目标对话并填充。唤起、创建或填充失败时,浮层保留结果供复制。宿主和插件须已运行,完全退出后不可用。
88
+
89
+ 使用语音搜索时,在设置中选择百度、Bing 或 Google。使用一键链接时,先填写网址并点击“确认”;`https://` 或 `http://` 可省略,保存和打开时保留原地址。搜索和打开链接无需先选中对话输入框。
90
+
91
+ 多台鼠标可同时连接、分别设置,但同一时间只能进行一次语音操作。
92
+
93
+ ## 常见问题
94
+
95
+ ### 接收器已插入但没有设备
96
+
97
+ 先确认鼠标已开机、切到 2.4G 模式并已唤醒。如果正在运行 ClawMouse 等鼠标管理软件,请完全退出后再试,它们可能占用连接。普通光标能够移动,并不代表语音功能已经连接成功。
98
+
99
+ Mac 上请留意“声云设备”中的占用提示。若显示“已检测到 2.4G 接收器,正在等待鼠标响应”,请再次检查鼠标的电源和连接模式。
100
+
101
+ ### 语音或翻译失败
102
+
103
+ 先确认鼠标身份已识别、网络可用,翻译源语言和目标语言不同。鉴权失效会自动重试一次,仍失败时弹出提示;翻译失败可复制识别原文。
104
+
105
+ ### 设置或按键没有生效
106
+
107
+ - DPI 提示应用失败时,重新选择后重试。
108
+ - Mac 上的回车、后退等系统按键动作可能需要为 Harness 授予辅助功能权限。
109
+ - 如果提示原语言选项已不再支持,请重新选择语言。
110
+
111
+ ### 如何更新或卸载
112
+
113
+ 更新时,完全退出 Harness,用安装命令安装新版本的 `.tgz` 文件,再重新启动。
114
+
115
+ 卸载时,完全退出 Harness 后执行:
116
+
117
+ ```sh
118
+ dsh plugin --profile desktop remove @sonicloud/dsh-sonicloud-device
119
+ ```
120
+
121
+ Mac 如果找不到 `dsh`,使用安装步骤中的完整命令路径。
122
+
123
+ ## 联系方式
124
+
125
+ 如需商务合作、技术支持或购买鼠标硬件,欢迎通过以下方式联系我们:
126
+
127
+ - 邮箱:[xu_heng_yu@sinicloud.com](mailto:xu_heng_yu@sinicloud.com)
128
+ - 微信:扫描下方二维码联系。
129
+
130
+ <img src="src/client/assets/contact-wechat.jpg" alt="商务合作、技术支持与鼠标硬件购买微信联系二维码" width="300" />
131
+
132
+ ## 参与贡献
133
+
134
+ 想修改插件或贡献代码,请阅读[本地开发与代码贡献指南](docs/contributing/development.md),了解环境准备、调试、测试和提交流程。
135
+
136
+ 版本变更见[更新日志](CHANGELOG.zh.md)。
137
+
138
+ ## 许可
139
+
140
+ 项目代码使用 [MIT 许可](LICENSE)。随包原生 SDK 和第三方库保留各自许可,见 [组件声明](native/THIRD_PARTY_LICENSES.txt)。
@@ -0,0 +1,3 @@
1
+ - insert:
2
+ - id: dsh-sonicloud-device
3
+ name: "@sonicloud/dsh-sonicloud-device"
@@ -0,0 +1,5 @@
1
+ {
2
+ "plugin": "dsh-sonicloud-device",
3
+ "version": "0.1.1",
4
+ "harness": "0.2.1-rc.5"
5
+ }