@feiyang666/dsh-mobile-remote 1.4.5 → 1.4.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # 更新日志 / Changelog
2
2
 
3
+ ## v1.4.6 (2026-08-22)
4
+
5
+ ### 修复 / Fixed
6
+ - **启用远程控制后写坏 profile 的 `cordis.patch.yml`,服务启动即崩溃**(`lib/index.js` 的 `setPatchEnabled`、`lib/external.js` 的 `ensureTrustedHost`):官方模板生成的 profile patch 文件内容是 `# user patch layer for this profile\n[]`(空数组占位),插件往文件**末尾追加** `- id: webserver` 等列表块时未先移除该 `[]` 行,导致同一文件出现两个 YAML 文档且无 `---` 分隔符,js-yaml 解析报 `YAMLException: end of the stream or a document separator is expected`,dsh 服务启动即崩溃。本版在写入前过滤掉裸 `[]` 占位行,patch 文件始终是单一文档,已用官方 `entryListSchema` 验证可解析。
7
+
3
8
  ## v1.4.5 (2026-08-22)
4
9
 
5
10
  ### 修复 / Fixed
package/RELEASE_NOTES.md CHANGED
@@ -1,6 +1,6 @@
1
- # dsh-mobile-remote v1.4.5
1
+ # dsh-mobile-remote v1.4.6
2
2
 
3
- **DeepSeek Harness 移动端远程控制插件** —— 在 Web UI 设置页内置「远程控制」:连接二维码、一键开关、在线设备数,让手机通过局域网访问并操控电脑上的 DeepSeek Harness。本版**修复客户端插件加载失败**(`client-modules: loaded without registering`)的问题。
3
+ **DeepSeek Harness 移动端远程控制插件** —— 在 Web UI 设置页内置「远程控制」:连接二维码、一键开关、在线设备数,让手机通过局域网访问并操控电脑上的 DeepSeek Harness。本版**修复启用远程控制后写坏 profile 的 `cordis.patch.yml`(服务启动即崩溃)**,并继承 v1.4.5 / v1.4.4 的完整包名修复。
4
4
 
5
5
  ## 安装方式
6
6
 
@@ -10,7 +10,20 @@ dsh plugin --profile web add @feiyang666/dsh-mobile-remote
10
10
 
11
11
  安装完成后**重启 dsh web 服务**,打开 `http://127.0.0.1:3080` → **设置 → 远程控制** 即可使用。
12
12
 
13
- ## 本版更新(v1.4.5)
13
+ ## 本版更新(v1.4.6)
14
+
15
+ ### 🐛 修复启用远程控制后写坏 profile 的 cordis.patch.yml(服务启动即崩溃)
16
+
17
+ 在设置页开启「远程控制」并重启服务后,dsh 启动即崩溃,日志报:
18
+
19
+ ```
20
+ Error: dsh: failed to parse overlay C:\Users\Administrator\.dsh\profiles\web\cordis.patch.yml:
21
+ YAMLException: end of the stream or a document separator is expected (7:1)
22
+ ```
23
+
24
+ **根因**:官方模板生成的 profile patch 文件内容是 `# user patch layer for this profile\n[]`(空数组占位)。插件开启远程控制 / 外网隧道时,往文件**末尾追加** `- id: webserver` 列表块,但未先移除 `[]` 占位行,导致同一文件出现两个 YAML 文档且无 `---` 分隔符,js-yaml 无法解析。
25
+
26
+ **本版修复**:写入前过滤掉裸 `[]` 占位行(`setPatchEnabled` / `ensureTrustedHost`),patch 文件始终是单一 YAML 数组,已用官方 `entryListSchema` 验证可解析。
14
27
 
15
28
  ### 🐛 修复客户端插件加载失败(client-modules: loaded without registering)
16
29
 
package/lib/external.js CHANGED
@@ -202,6 +202,10 @@ async function downloadFrpc(base) {
202
202
  */
203
203
  function ensureTrustedHost(patchFile, domain) {
204
204
  let content = existsSync(patchFile) ? readFileSync(patchFile, 'utf8') : ''
205
+ // 移除官方模板的空数组占位行 `[]`(与 index.js setPatchEnabled 同理):
206
+ // 它单独构成一个 YAML 文档,与追加的列表块拼接会形成无分隔符的多文档流,
207
+ // js-yaml 解析报 "end of the stream or a document separator is expected"。
208
+ content = content.replace(/^\s*\[\s*\]\s*$/gm, '')
205
209
  // 1) 清理旧的错误块(id: client-connection 或旧格式的纯数组),避免堆积/语法冲突
206
210
  content = content.replace(/\n*(# --- dsh-mobile-remote external trusted-host ---)\n[\s\S]*?(# --- end dsh-mobile-remote external trusted-host ---)\n*/g, '\n')
207
211
  content = content.replace(/\n{3,}/g, '\n\n').replace(/\s*$/, '\n')
package/lib/index.js CHANGED
@@ -634,6 +634,10 @@ function setPatchEnabled(ctx, enabled) {
634
634
  const { file, content, lines } = readPatchFile(ctx)
635
635
  const block = findRemoteBlock(lines)
636
636
  let out = lines.slice()
637
+ // 移除官方模板的空数组占位行 `[]`:它单独构成一个 YAML 文档,与追加的
638
+ // 列表块拼接会形成无 `---` 分隔符的多文档流,js-yaml 解析报
639
+ // "end of the stream or a document separator is expected",导致 dsh 服务启动即崩溃。
640
+ out = out.filter((l) => l.trim() !== '[]')
637
641
 
638
642
  if (block) {
639
643
  out.splice(block.start, block.end - block.start)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feiyang666/dsh-mobile-remote",
3
- "version": "1.4.5",
3
+ "version": "1.4.6",
4
4
  "description": "DeepSeek Harness mobile remote-control plugin: LAN/external remote control (QR / on-off toggle / remote-access password gate), rich telemetry (expandable device details, system CPU/memory/load, DSH app state: version/sessions/workspaces/plugins/models), real external-tunnel status detection (frpc token / reconnect diagnostics), plus mobile-first UI polish and faster remote loading.",
5
5
  "keywords": [
6
6
  "deepseek",