@duke-dsh-plugins/dsh-remote-control 1.1.3 → 1.1.4

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 (3) hide show
  1. package/README.md +91 -88
  2. package/market/index.json +95 -0
  3. package/package.json +79 -75
package/README.md CHANGED
@@ -1,88 +1,91 @@
1
- # plugin —— DSH 插件(Host 侧半边)
2
-
3
- 用 HarmonyOS 手机远程控制 DeepSeek Harness 的 DSH 插件:会话遥控、审批/提问应答、推送通知。
4
-
5
- 架构与安全模型见仓库根 [README](../README.md);线协议见 [docs/PROTOCOL.md](../docs/PROTOCOL.md)(v1.0.2)。
6
-
7
- ## 安装
8
-
9
- ```bash
10
- dsh plugin add <本目录> # 或 DSH 的 plugin_manager install_bundle(target 指向本目录)
11
- ```
12
-
13
- ## 配对(一次性)
14
-
15
- 1. 插件首次启用会在 `%DSH_HOME%/remote-control/config.json`(默认 `~/.dsh`)生成配对信息:
16
- - `channel`:16 位 base32(`^[A-Z2-7]{16,64}$`)
17
- - `secret`:E2E 密钥材料(**不要**发给中继或任何第三方)
18
- 2. 在 `config.json` 里填写 `relayUrl`(如 `ws://192.168.3.2:8787` 或 `wss://relay.example.com/`),
19
- 需要中继鉴权时填 `relayToken`(对应中继的 `RELAY_TOKEN`)。
20
- 3. 手机 App([../app](../app/))配对页输入同样的 `relayUrl / channel / secret`,连接即配对。
21
-
22
- > 修改 `config.json` 后如插件未即时生效,用 plugin_manager 把本插件 disable→enable,
23
- > 或 remove 后重新 install(link 安装指向本目录,磁盘即最新源码)。
24
-
25
- ## 扫码配对(§3.5,v1.0.3)
26
-
27
- 除手动输入外,可用会话命令 `/remote-pairing` 生成**配对二维码**(协议
28
- [docs/PROTOCOL.md](../docs/PROTOCOL.md) §3.5):手机 App 配对页「扫码」直接填入
29
- `relayUrl / channel / secret`,免手抄。
30
-
31
- | 命令 | 作用 |
32
- |---|---|
33
- | `/remote-pairing` | 显示配对二维码(ASCII,会话窗口直接扫)+ 配对 URI(可复制兜底)+ 使用说明;同时写 `%DSH_HOME%/remote-control/pairing.svg` 并尝试用系统默认程序打开 |
34
- | `/remote-pairing rotate` | 重新生成 channel+secret → 落盘 → 中继链路立即以新配对信息重连;**旧二维码/旧口述即刻失效** |
35
- | `/remote-pairing hide` | 删除本机 `pairing.svg` 文件(不在屏幕上留图) |
36
-
37
- 编码细节(可由手机端实现者对照):URI 形如
38
- `dshrc://pair?r=<encodeURIComponent(relayUrl)>&c=<channel>&s=<secret>[&t=<encodeURIComponent(relayToken)>]`,
39
- 二维码为 byte 模式、纠错级 M、版本自适应 1–10(内嵌零依赖编码器,`lib/qr.mjs`)。
40
-
41
- > ⚠️ **安全提示(§3.5)**:二维码/URI 含 secret 明文(与口述同级信任域)——只在受信任
42
- > 屏幕上展示;不需要时用 `rotate`(换 secret 作废旧码)或 `hide`(删图)清理;
43
- > 插件日志对 URI 做脱敏(`s=***`/`t=***`),不落明文。
44
-
45
- ## 配置项(config.json)
46
-
47
- | 键 | 默认 | 说明 |
48
- |---|---|---|
49
- | `enabled` | `true` | 总开关;false 时不连中继、不拦截任何请求 |
50
- | `relayUrl` | `""` | 中继地址;空 = 空转待配对 |
51
- | `relayToken` | `""` | 中继自身鉴权 token(可选) |
52
- | `channel` / `secret` | 首启生成 | 配对信息 |
53
- | `interceptApprovals` | `true` | 手机在线时代理审批请求 |
54
- | `interceptQuestions` | `true` | 手机在线时代理用户提问 |
55
- | `approvalTimeoutMs` | `120000` | 手机应答超时(钳制 10s–600s);**超时一律放行给桌面答案器** |
56
- | `push.*` | 关闭 | Push Kit(`appId` / `clientId` / `clientSecret` / `channelId` / `topic` / `notifyTurnEnd`) |
57
-
58
- ## 目录
59
-
60
- ```
61
- index.js Cordis 插件入口(KAT→配置→/remote-pairing→装配→清理)
62
- lib/protocol.mjs 信封 + HKDF/AES-GCM + assertKat
63
- lib/config.mjs config.json 读写(首启生成 channel/secret)
64
- lib/relay-client.mjs 中继客户端(重连退避/心跳/sid:seq 去重/reload 热更换)
65
- lib/host-bridge.mjs Host 服务桥接(sessionController + 事件 + 审批/提问瀑布)
66
- lib/pairing.mjs 配对 URI(§3.5)+ SVG 落盘/打开/隐藏 + /remote-pairing 命令
67
- lib/qr.mjs 内嵌 QR 编码器(byte/ECC-M/版本 1–10,零运行时依赖)
68
- lib/push.mjs Push Kit REST 发送
69
- scripts/smoke-link.mjs 链路冒烟
70
- scripts/verify-qr.mjs QR 正确性自检(jsqr 独立解码 + 矩阵级 RS 自检;devDependencies)
71
- scripts/verify-pairing.mjs /remote-pairing 命令逻辑自检(mock ctx;devDependencies)
72
- ```
73
-
74
- ## 安装(npm 分发,v1.1.3 起)
75
-
76
- ```bash
77
- # DSH 插件管理器(推荐):会解析 peerDependencies 并做兼容性 gate
78
- plugin_manager install @duke-dsh-plugins/dsh-remote-control
79
-
80
- # 或直接 link 安装(本地开发)
81
- plugin_manager install_bundle /path/to/this/repo/plugin
82
- ```
83
-
84
- 装好后到 DSH「设置 → DSH Pocket」分区填中继地址、扫码配对。中继进程会由插件
85
- 自动托管(`relayUrl` 指向本机时);VPS 部署请另装
86
- [`@duke-dsh-plugins/dsh-remote-control-relay`](../relay/README.md)。
87
- 协议契约见 [`docs/PROTOCOL.md`](../docs/PROTOCOL.md)(v1.1.3:端到端加密 +
88
- 会话纪元抗重放 + 可选中继 TLS)。
1
+ # plugin —— DSH 插件(Host 侧半边)
2
+
3
+ 用 HarmonyOS 手机远程控制 DeepSeek Harness 的 DSH 插件:会话遥控、审批/提问应答、推送通知。
4
+
5
+ 架构与安全模型见仓库根 [README](../README.md);线协议见 [docs/PROTOCOL.md](../docs/PROTOCOL.md)(v1.0.2)。
6
+
7
+ ## 安装
8
+
9
+ ```bash
10
+ dsh plugin add <本目录> # 或 DSH 的 plugin_manager install_bundle(target 指向本目录)
11
+ ```
12
+
13
+ ## 配对(一次性)
14
+
15
+ 1. 插件首次启用会在 `%DSH_HOME%/remote-control/config.json`(默认 `~/.dsh`)生成配对信息:
16
+ - `channel`:16 位 base32(`^[A-Z2-7]{16,64}$`)
17
+ - `secret`:E2E 密钥材料(**不要**发给中继或任何第三方)
18
+ 2. 在 `config.json` 里填写 `relayUrl`(如 `ws://192.168.3.2:8787` 或 `wss://relay.example.com/`),
19
+ 需要中继鉴权时填 `relayToken`(对应中继的 `RELAY_TOKEN`)。
20
+ 3. 手机 App([../app](../app/))配对页输入同样的 `relayUrl / channel / secret`,连接即配对。
21
+
22
+ > 修改 `config.json` 后如插件未即时生效,用 plugin_manager 把本插件 disable→enable,
23
+ > 或 remove 后重新 install(link 安装指向本目录,磁盘即最新源码)。
24
+
25
+ ## 扫码配对(§3.5,v1.0.3)
26
+
27
+ 除手动输入外,可用会话命令 `/remote-pairing` 生成**配对二维码**(协议
28
+ [docs/PROTOCOL.md](../docs/PROTOCOL.md) §3.5):手机 App 配对页「扫码」直接填入
29
+ `relayUrl / channel / secret`,免手抄。
30
+
31
+ | 命令 | 作用 |
32
+ |---|---|
33
+ | `/remote-pairing` | 显示配对二维码(ASCII,会话窗口直接扫)+ 配对 URI(可复制兜底)+ 使用说明;同时写 `%DSH_HOME%/remote-control/pairing.svg` 并尝试用系统默认程序打开 |
34
+ | `/remote-pairing rotate` | 重新生成 channel+secret → 落盘 → 中继链路立即以新配对信息重连;**旧二维码/旧口述即刻失效** |
35
+ | `/remote-pairing hide` | 删除本机 `pairing.svg` 文件(不在屏幕上留图) |
36
+
37
+ 编码细节(可由手机端实现者对照):URI 形如
38
+ `dshrc://pair?r=<encodeURIComponent(relayUrl)>&c=<channel>&s=<secret>[&t=<encodeURIComponent(relayToken)>]`,
39
+ 二维码为 byte 模式、纠错级 M、版本自适应 1–10(内嵌零依赖编码器,`lib/qr.mjs`)。
40
+
41
+ > ⚠️ **安全提示(§3.5)**:二维码/URI 含 secret 明文(与口述同级信任域)——只在受信任
42
+ > 屏幕上展示;不需要时用 `rotate`(换 secret 作废旧码)或 `hide`(删图)清理;
43
+ > 插件日志对 URI 做脱敏(`s=***`/`t=***`),不落明文。
44
+
45
+ ## 配置项(config.json)
46
+
47
+ | 键 | 默认 | 说明 |
48
+ |---|---|---|
49
+ | `enabled` | `true` | 总开关;false 时不连中继、不拦截任何请求 |
50
+ | `relayUrl` | `""` | 中继地址;空 = 空转待配对 |
51
+ | `relayToken` | `""` | 中继自身鉴权 token(可选) |
52
+ | `channel` / `secret` | 首启生成 | 配对信息 |
53
+ | `interceptApprovals` | `true` | 手机在线时代理审批请求 |
54
+ | `interceptQuestions` | `true` | 手机在线时代理用户提问 |
55
+ | `approvalTimeoutMs` | `120000` | 手机应答超时(钳制 10s–600s);**超时一律放行给桌面答案器** |
56
+ | `push.*` | 关闭 | Push Kit(`appId` / `clientId` / `clientSecret` / `channelId` / `topic` / `notifyTurnEnd`) |
57
+
58
+ ## 目录
59
+
60
+ ```
61
+ index.js Cordis 插件入口(KAT→配置→/remote-pairing→装配→清理)
62
+ lib/protocol.mjs 信封 + HKDF/AES-GCM + assertKat
63
+ lib/config.mjs config.json 读写(首启生成 channel/secret)
64
+ lib/relay-client.mjs 中继客户端(重连退避/心跳/sid:seq 去重/reload 热更换)
65
+ lib/host-bridge.mjs Host 服务桥接(sessionController + 事件 + 审批/提问瀑布)
66
+ lib/pairing.mjs 配对 URI(§3.5)+ SVG 落盘/打开/隐藏 + /remote-pairing 命令
67
+ lib/qr.mjs 内嵌 QR 编码器(byte/ECC-M/版本 1–10,零运行时依赖)
68
+ lib/push.mjs Push Kit REST 发送
69
+ scripts/smoke-link.mjs 链路冒烟
70
+ scripts/verify-qr.mjs QR 正确性自检(jsqr 独立解码 + 矩阵级 RS 自检;devDependencies)
71
+ scripts/verify-pairing.mjs /remote-pairing 命令逻辑自检(mock ctx;devDependencies)
72
+ ```
73
+
74
+ ## 安装(npm 分发,v1.1.3 起)
75
+
76
+ ```bash
77
+ # DSH 插件市场(推荐):在「设置 → 插件市场」添加索引 URL 后搜「DSH Pocket」安装
78
+ # https://unpkg.com/@duke-dsh-plugins/dsh-remote-control-market@latest/index.json
79
+ #
80
+ # 或直接用插件管理器:会解析 peerDependencies 并做兼容性 gate
81
+ plugin_manager install @duke-dsh-plugins/dsh-remote-control
82
+
83
+ # 或直接 link 安装(本地开发)
84
+ plugin_manager install_bundle /path/to/this/repo/plugin
85
+ ```
86
+
87
+ 装好后到 DSH「设置 → DSH Pocket」分区填中继地址、扫码配对。中继进程会由插件
88
+ 自动托管(`relayUrl` 指向本机时);VPS 部署请另装
89
+ [`@duke-dsh-plugins/dsh-remote-control-relay`](../relay/README.md)。
90
+ 协议契约见 [`docs/PROTOCOL.md`](../docs/PROTOCOL.md)(v1.1.3:端到端加密 +
91
+ 会话纪元抗重放 + 可选中继 TLS)。
@@ -0,0 +1,95 @@
1
+ {
2
+ "format": 1,
3
+ "title": {
4
+ "en": "DSH Pocket Market",
5
+ "zh": "DSH Pocket 插件市场"
6
+ },
7
+ "description": {
8
+ "en": "Plugin index for DSH Pocket: remote-control DeepSeek Harness from a HarmonyOS phone over an end-to-end-encrypted relay.",
9
+ "zh": "DSH Pocket 的插件索引:通过端到端加密中继,用 HarmonyOS 手机遥控 DeepSeek Harness。"
10
+ },
11
+ "metadata": {
12
+ "categories": {
13
+ "remote-control": {
14
+ "title": {
15
+ "en": "Remote Control",
16
+ "zh": "远程控制"
17
+ }
18
+ }
19
+ },
20
+ "labels": {
21
+ "phone": {
22
+ "title": {
23
+ "en": "Phone",
24
+ "zh": "手机"
25
+ }
26
+ },
27
+ "e2e-encrypted": {
28
+ "title": {
29
+ "en": "End-to-end encrypted",
30
+ "zh": "端到端加密"
31
+ }
32
+ }
33
+ },
34
+ "sortKeys": {}
35
+ },
36
+ "plugins": [
37
+ {
38
+ "name": "@duke-dsh-plugins/dsh-remote-control",
39
+ "title": {
40
+ "en": "DSH Pocket",
41
+ "zh": "DSH Pocket 手机遥控"
42
+ },
43
+ "description": {
44
+ "en": "Control DeepSeek Harness from your phone: sessions, prompts, streamed replies, approvals, images and model switching over an E2E-encrypted relay. Fail-open by design. The relay can also be installed standalone (@duke-dsh-plugins/dsh-remote-control-relay) for VPS deployment.",
45
+ "zh": "在手机上遥控 DeepSeek Harness:会话、发送提示词、流式回复、审批应答、图片与模型切换,全程端到端加密。审批缺省放行(fail-open)。中继可独立安装(@duke-dsh-plugins/dsh-remote-control-relay)部署到 VPS。"
46
+ },
47
+ "icon": "https://raw.githubusercontent.com/MoonlitDropOfBlood/dsh-remote-control/main/plugin/icon.svg",
48
+ "author": "dukebywwh",
49
+ "homepage": "https://github.com/MoonlitDropOfBlood/dsh-remote-control#readme",
50
+ "repository": {
51
+ "url": "https://github.com/MoonlitDropOfBlood/dsh-remote-control",
52
+ "directory": "plugin"
53
+ },
54
+ "metadata": {
55
+ "category": "remote-control",
56
+ "keywords": [
57
+ "dsh",
58
+ "remote-control",
59
+ "harmonyos",
60
+ "phone",
61
+ "relay",
62
+ "e2e",
63
+ "approval"
64
+ ],
65
+ "labels": [
66
+ "phone",
67
+ "e2e-encrypted"
68
+ ],
69
+ "sortKeys": {}
70
+ },
71
+ "versions": [
72
+ {
73
+ "version": "1.1.4",
74
+ "publishTimestamp": 1793036288,
75
+ "source": {
76
+ "type": "npm"
77
+ },
78
+ "engines": {
79
+ "dsh": "^0.1.5-rc.3 || ^0.2.0-rc.1 || ^0.2.1-rc.0"
80
+ }
81
+ },
82
+ {
83
+ "version": "1.1.3",
84
+ "publishTimestamp": 1793029637,
85
+ "source": {
86
+ "type": "npm"
87
+ },
88
+ "engines": {
89
+ "dsh": "^0.1.5-rc.3 || ^0.2.0-rc.1 || ^0.2.1-rc.0"
90
+ }
91
+ }
92
+ ]
93
+ }
94
+ ]
95
+ }
package/package.json CHANGED
@@ -1,75 +1,79 @@
1
- {
2
- "name": "@duke-dsh-plugins/dsh-remote-control",
3
- "version": "1.1.3",
4
- "description": "Remote-control bridge for DeepSeek Harness: pairs a HarmonyOS phone app with the desktop Host over an end-to-end-encrypted public relay (WebSocket). Lets the phone list/create/switch sessions, send prompts, watch streamed replies, cancel turns, and answer approval and ask-user-question requests from anywhere; pushes Huawei Push Kit notifications (gracefully disabled when AGC is unconfigured) for approvals, questions, and turn completion. The pairing QR lives in the DSH settings panel (\"DSH Pocket\"). Fail-open by design: any relay timeout or fault hands the request back to the desktop answerer.",
5
- "type": "module",
6
- "main": "index.js",
7
- "exports": {
8
- ".": "./index.js",
9
- "./client": "./client.js",
10
- "./typert": "./typert.host.js",
11
- "./cordis.patch.yml": "./cordis.patch.yml",
12
- "./icon": "./icon.svg",
13
- "./locale/*.json": "./locale/*.json",
14
- "./package.json": "./package.json"
15
- },
16
- "files": [
17
- "index.js",
18
- "client.js",
19
- "typert.host.js",
20
- "lib",
21
- "vendor",
22
- "cordis.patch.yml",
23
- "icon.svg",
24
- "locale"
25
- ],
26
- "license": "MIT",
27
- "dsh": {
28
- "bundle": {
29
- "patch": "./cordis.patch.yml"
30
- },
31
- "client": {
32
- "platform": "web"
33
- },
34
- "engines": {
35
- "dsh": "^0.1.5-rc.3 || ^0.2.0-rc.1 || ^0.2.1-rc.0"
36
- }
37
- },
38
- "peerDependencies": {
39
- "@deepseek-ai/cordis": "^4.0.1",
40
- "@deepseek-ai/dsh": "^0.1.5-rc.3 || ^0.2.0-rc.1 || ^0.2.1-rc.0",
41
- "@deepseek-ai/dsh-typert-protocol": "^0.1.0-rc.7 || ^0.2.0-rc.1 || ^0.2.1-rc.0"
42
- },
43
- "peerDependenciesMeta": {
44
- "@deepseek-ai/dsh": {
45
- "optional": true
46
- },
47
- "@deepseek-ai/cordis": {
48
- "optional": true
49
- },
50
- "@deepseek-ai/dsh-typert-protocol": {
51
- "optional": true
52
- }
53
- },
54
- "dependencies": {
55
- "ws": "^8.18.1",
56
- "zod": "^4.4.3"
57
- },
58
- "devDependencies": {
59
- "jsqr": "^1.4.0"
60
- },
61
- "scripts": {
62
- "vendor:relay": "node scripts/vendor-relay.mjs",
63
- "vendor:relay:check": "node scripts/vendor-relay.mjs --check"
64
- },
65
- "repository": {
66
- "type": "git",
67
- "url": "git+https://github.com/MoonlitDropOfBlood/dsh-remote-control.git",
68
- "directory": "plugin"
69
- },
70
- "homepage": "https://github.com/MoonlitDropOfBlood/dsh-remote-control/tree/main/plugin#readme",
71
- "bugs": {
72
- "url": "https://github.com/MoonlitDropOfBlood/dsh-remote-control/issues"
73
- },
74
- "keywords": []
75
- }
1
+ {
2
+ "name": "@duke-dsh-plugins/dsh-remote-control",
3
+ "version": "1.1.4",
4
+ "description": "Remote-control bridge for DeepSeek Harness: pairs a HarmonyOS phone app with the desktop Host over an end-to-end-encrypted public relay (WebSocket). Lets the phone list/create/switch sessions, send prompts, watch streamed replies, cancel turns, and answer approval and ask-user-question requests from anywhere; pushes Huawei Push Kit notifications (gracefully disabled when AGC is unconfigured) for approvals, questions, and turn completion. The pairing QR lives in the DSH settings panel (\"DSH Pocket\"). Fail-open by design: any relay timeout or fault hands the request back to the desktop answerer.",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "exports": {
8
+ ".": "./index.js",
9
+ "./client": "./client.js",
10
+ "./typert": "./typert.host.js",
11
+ "./cordis.patch.yml": "./cordis.patch.yml",
12
+ "./icon": "./icon.svg",
13
+ "./locale/*.json": "./locale/*.json",
14
+ "./package.json": "./package.json"
15
+ },
16
+ "files": [
17
+ "index.js",
18
+ "client.js",
19
+ "typert.host.js",
20
+ "lib",
21
+ "vendor",
22
+ "cordis.patch.yml",
23
+ "icon.svg",
24
+ "locale",
25
+ "market/index.json"
26
+ ],
27
+ "license": "MIT",
28
+ "dsh": {
29
+ "bundle": {
30
+ "patch": "./cordis.patch.yml"
31
+ },
32
+ "client": {
33
+ "platform": "web"
34
+ },
35
+ "engines": {
36
+ "dsh": "^0.1.5-rc.3 || ^0.2.0-rc.1 || ^0.2.1-rc.0"
37
+ }
38
+ },
39
+ "peerDependencies": {
40
+ "@deepseek-ai/cordis": "^4.0.1",
41
+ "@deepseek-ai/dsh": "^0.1.5-rc.3 || ^0.2.0-rc.1 || ^0.2.1-rc.0",
42
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.0-rc.7 || ^0.2.0-rc.1 || ^0.2.1-rc.0"
43
+ },
44
+ "peerDependenciesMeta": {
45
+ "@deepseek-ai/dsh": {
46
+ "optional": true
47
+ },
48
+ "@deepseek-ai/cordis": {
49
+ "optional": true
50
+ },
51
+ "@deepseek-ai/dsh-typert-protocol": {
52
+ "optional": true
53
+ }
54
+ },
55
+ "dependencies": {
56
+ "ws": "^8.18.1",
57
+ "zod": "^4.4.3"
58
+ },
59
+ "devDependencies": {
60
+ "jsqr": "^1.4.0"
61
+ },
62
+ "scripts": {
63
+ "vendor:relay": "node scripts/vendor-relay.mjs",
64
+ "vendor:relay:check": "node scripts/vendor-relay.mjs --check"
65
+ },
66
+ "repository": {
67
+ "type": "git",
68
+ "url": "git+https://github.com/MoonlitDropOfBlood/dsh-remote-control.git",
69
+ "directory": "plugin"
70
+ },
71
+ "homepage": "https://github.com/MoonlitDropOfBlood/dsh-remote-control/tree/main/plugin#readme",
72
+ "bugs": {
73
+ "url": "https://github.com/MoonlitDropOfBlood/dsh-remote-control/issues"
74
+ },
75
+ "keywords": [],
76
+ "publishConfig": {
77
+ "access": "public"
78
+ }
79
+ }