@duke-dsh-plugins/dsh-remote-control

中文文档
1.3.3发布于 2026/11/13MITES Module构建来源已验证近 30 天下载 2514

DeepSeek Harness的远程控制桥:通过端到端加密的公用中继器(WebSocket)与桌面主机对接一款HarmonyOS手机应用. 让电话列表/ 创建/ 切换会话、 发送提示、 监视流回覆、 取消转折和回答

中文使用文档
文档目录6 节
  1. 安装
  2. 配对(一次性)
  3. 扫码配对(§3.5,v1.0.3)
  4. 配置项(config.json)
  5. 目录
  6. 安装(npm 分发,v1.1.3 起)

plugin —— DSH 插件(Host 侧半边)

用 HarmonyOS 手机远程控制 DeepSeek Harness 的 DSH 插件:会话遥控、审批/提问应答、推送通知。

架构与安全模型见仓库根 README;线协议见 docs/PROTOCOL.md(v1.0.2)。

安装

dsh plugin add <本目录>        # 或 DSH 的 plugin_manager install_bundle(target 指向本目录)

配对(一次性)

  1. 插件首次启用会在 %DSH_HOME%/remote-control/config.json(默认 ~/.dsh)生成配对信息:
    • channel:16 位 base32(^[A-Z2-7]{16,64}$)
    • secret:E2E 密钥材料(不要发给中继或任何第三方)
  2. 在 config.json 里填写 relayUrl(如 ws://192.168.3.2:8787 或 wss://relay.example.com/), 需要中继鉴权时填 relayToken(对应中继的 RELAY_TOKEN)。
  3. 手机 App(../app)配对页输入同样的 relayUrl / channel / secret,连接即配对。

修改 config.json 后如插件未即时生效,用 plugin_manager 把本插件 disable→enable, 或 remove 后重新 install(link 安装指向本目录,磁盘即最新源码)。

扫码配对(§3.5,v1.0.3)

除手动输入外,可用会话命令 /remote-pairing 生成配对二维码(协议 docs/PROTOCOL.md §3.5):手机 App 配对页「扫码」直接填入 relayUrl / channel / secret,免手抄。

命令作用
/remote-pairing显示配对二维码(ASCII,会话窗口直接扫)+ 配对 URI(可复制兜底)+ 使用说明;同时写 %DSH_HOME%/remote-control/pairing.svg 并尝试用系统默认程序打开
/remote-pairing rotate重新生成 channel+secret → 落盘 → 中继链路立即以新配对信息重连;旧二维码/旧口述即刻失效
/remote-pairing hide删除本机 pairing.svg 文件(不在屏幕上留图)

编码细节(可由手机端实现者对照):URI 形如 dshrc://pair?r=<encodeURIComponent(relayUrl)>&c=<channel>&s=<secret>[&t=<encodeURIComponent(relayToken)>], 二维码为 byte 模式、纠错级 M、版本自适应 1–10(内嵌零依赖编码器,lib/qr.mjs)。

⚠️ 安全提示(§3.5):二维码/URI 含 secret 明文(与口述同级信任域)——只在受信任 屏幕上展示;不需要时用 rotate(换 secret 作废旧码)或 hide(删图)清理; 插件日志对 URI 做脱敏(s=***/t=***),不落明文。

配置项(config.json)

键默认说明
enabledtrue总开关;false 时不连中继、不拦截任何请求
relayUrl""中继地址;空 = 空转待配对
relayToken""中继自身鉴权 token(可选)
channel / secret首启生成配对信息
interceptApprovalstrue手机在线时代理审批请求
interceptQuestionstrue手机在线时代理用户提问
approvalTimeoutMs120000手机独占应答窗口(钳制 10s–600s)。审批超时一律放行桌面答案器;提问在 Host userQuestions timed 模式下超时只转为 continued,快照仍可恢复。它与 Host ask 工具的 timeout 是两个计时器,建议保持一致
push.*关闭Push Kit(appId / clientId / clientSecret / channelId / topic / notifyTurnEnd)

目录

index.js              Cordis 插件入口(KAT→配置→/remote-pairing→装配→清理)
lib/protocol.mjs      信封 + HKDF/AES-GCM + assertKat
lib/config.mjs        config.json 读写(首启生成 channel/secret)
lib/relay-client.mjs  中继客户端(重连退避/心跳/sid:seq 去重/reload 热更换)
lib/host-bridge.mjs   Host 服务桥接(sessionController + 事件 + 审批/提问瀑布)
lib/pairing.mjs       配对 URI(§3.5)+ SVG 落盘/打开/隐藏 + /remote-pairing 命令
lib/qr.mjs            内嵌 QR 编码器(byte/ECC-M/版本 1–10,零运行时依赖)
lib/push.mjs          Push Kit REST 发送
scripts/smoke-link.mjs  链路冒烟
scripts/verify-qr.mjs   QR 正确性自检(jsqr 独立解码 + 矩阵级 RS 自检;devDependencies)
scripts/verify-pairing.mjs  /remote-pairing 命令逻辑自检(mock ctx;devDependencies)

安装(npm 分发,v1.1.3 起)

# DSH 插件市场(推荐):在「设置 → 插件市场」添加索引 URL 后搜「DSH Pocket」安装
#   https://unpkg.com/@duke-dsh-plugins/dsh-remote-control@latest/market/index.json
#
# 或直接用插件管理器:会解析 peerDependencies 并做兼容性 gate
plugin_manager install @duke-dsh-plugins/dsh-remote-control

# 或直接 link 安装(本地开发)
plugin_manager install_bundle /path/to/this/repo/plugin

装好后到 DSH「设置 → DSH Pocket」分区填中继地址、扫码配对。中继进程会由插件 自动托管(relayUrl 指向本机时);VPS 部署请另装 @duke-dsh-plugins/dsh-remote-control-relay。 协议契约见 docs/PROTOCOL.md(v1.1.3:端到端加密 + 会话纪元抗重放 + 可选中继 TLS)。

版本与发布记录

@duke-dsh-plugins/dsh-remote-control 共发布 14 个版本,首次发布于 2026/10/26;过去 12 个月发布了 14 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.3.3latest2026/11/13今天
1.3.22026/11/12今天
1.3.12026/11/103 天前
1.3.02026/11/094 天前
1.2.12026/11/085 天前
1.2.02026/11/076 天前

关于 @duke-dsh-plugins/dsh-remote-control 的常见问题

@duke-dsh-plugins/dsh-remote-control 是什么?

DeepSeek Harness的远程控制桥:通过端到端加密的公用中继器(WebSocket)与桌面主机对接一款HarmonyOS手机应用. 让电话列表/ 创建/ 切换会话、 发送提示、 监视流回覆、 取消转折和回答

如何安装 @duke-dsh-plugins/dsh-remote-control?

在项目目录运行 npm install @duke-dsh-plugins/dsh-remote-control,或使用 pnpm add / yarn add / bun add。

@duke-dsh-plugins/dsh-remote-control 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/duke-dsh-plugins__dsh-remote-control 是否存在。

@duke-dsh-plugins/dsh-remote-control 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@duke-dsh-plugins/dsh-remote-control 可以商用吗?

@duke-dsh-plugins/dsh-remote-control 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@duke-dsh-plugins/dsh-remote-control 的下载量有多少?

根据 npm 官方下载统计,@duke-dsh-plugins/dsh-remote-control 在 2026/10/13 – 2026/11/11 这 30 天内被下载 2,514 次,日均约 84 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@duke-dsh-plugins/dsh-remote-control 还在维护吗?

最新版本 1.3.3 发布于 2026/11/13(今天);至今共发布 14 个版本,其中过去 12 个月发布了 14 个;首次发布于 2026/10/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。