dsh-remote-bridge 2.3.5 → 2.3.7

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.en.md CHANGED
@@ -9,7 +9,7 @@
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- <img alt="Version" src="https://img.shields.io/badge/version-v2.3.5-087f8c">
12
+ <img alt="Version" src="https://img.shields.io/badge/version-v2.3.6-087f8c">
13
13
  <img alt="DSH plugin" src="https://img.shields.io/badge/DeepSeek_Harness-plugin-1f2328">
14
14
  <img alt="Platforms" src="https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-586069">
15
15
  <img alt="License" src="https://img.shields.io/badge/license-AGPL--3.0-2da44e">
@@ -34,7 +34,11 @@ The desktop entry lives **inside your DSH settings**: look for the section title
34
34
 
35
35
  Remote access remains disabled until a local administrator chooses a bind address, port, and initial device permissions.
36
36
 
37
- > This section used to carry two UI screenshots, but both showed the pre-rename interface (titled "DSH 文件工作区"; the remote-access one was still labelled v1.0.0 and showed the file tree and settings as two stacked dialogs). They no longer match the shape described above, so they were removed rather than left to mislead. Re-recording needs a browser environment that can drive the plugin panel, which is not available here.
37
+ ![Phone settings — the Roots card, open by default](assets/screenshots/panel-roots.png)
38
+
39
+ > **About these screenshots.** The four images under `assets/screenshots/` are generated by `scripts/generate-screenshots.ts`, which renders the panel from the same sources the tests use — `ADMIN_TABS`, `WORKSPACE_CSS` and `APP_QR_CODES` out of `src/client/` — so what you see is the shipped markup and stylesheet, not a redrawn mock-up. They show a machine that has just installed the plugin and not yet enabled remote access, which is the honest default state. An earlier revision of this README carried two UI screenshots; both predated the rename and showed the file tree and settings as two stacked dialogs, so they were removed rather than left to mislead.
40
+ >
41
+ > Storefronts pick these up automatically from [`screenshots.json`](./screenshots.json) — no pull request, no waiting on a maintainer. Update the images and push; the next build takes them.
38
42
 
39
43
  ## About the rename (2.0.4)
40
44
 
@@ -73,10 +77,10 @@ dsh plugin --profile web add dsh-remote-bridge
73
77
  dsh plugin --profile web add dsh-remote-bridge --registry https://registry.npmmirror.com
74
78
 
75
79
  # 2. tarball from the GitHub release
76
- dsh plugin --profile web add https://github.com/westanke/dsh-remote-bridge/releases/download/v2.3.5/dsh-remote-bridge-v2.3.5.tgz
80
+ dsh plugin --profile web add https://github.com/westanke/dsh-remote-bridge/releases/download/v2.3.6/dsh-remote-bridge-v2.3.6.tgz
77
81
 
78
82
  # 3. tarball from the Gitee release (faster from mainland China)
79
- dsh plugin --profile web add https://gitee.com/westanke/dsh-remote-bridge/releases/download/v2.3.5/dsh-remote-bridge-v2.3.5.tgz
83
+ dsh plugin --profile web add https://gitee.com/westanke/dsh-remote-bridge/releases/download/v2.3.6/dsh-remote-bridge-v2.3.6.tgz
80
84
 
81
85
  npx @deepseek-ai/dsh web
82
86
  ```
@@ -93,7 +97,7 @@ Restart DSH after installation, then open settings — The section is titled **
93
97
  To install a downloaded release archive:
94
98
 
95
99
  ```sh
96
- dsh plugin --profile web add ./dsh-remote-bridge-v2.3.5.tgz
100
+ dsh plugin --profile web add ./dsh-remote-bridge-v2.3.6.tgz
97
101
  ```
98
102
 
99
103
  ## First connection
@@ -323,15 +327,15 @@ pnpm check
323
327
  pnpm pack
324
328
  ```
325
329
 
326
- `pnpm check` covers type-checking, documentation consistency, and tests. It currently passes **19 test files / 113 cases**, plus **3 browser-layer cases** (Playwright measuring real computed styles).
330
+ `pnpm check` covers type-checking, documentation consistency, and tests. It currently passes **30 test files / 226 cases**, plus **4 browser-layer cases** (Playwright measuring real computed styles).
327
331
 
328
- `npm pack` produces roughly a **0.25 MB** archive: 2.2.0 dropped the standalone page and its editor dependencies and turned source maps off, down from 1.72 MB.
332
+ `npm pack` produces roughly a **0.29 MB** archive: 2.2.0 dropped the standalone page and its editor dependencies and turned source maps off, down from 1.72 MB.
329
333
 
330
- v2.3.5 was developed against DSH `master@47f943859bef60e4160492346772ded9b24f765a`. CI covers Windows, Ubuntu, and macOS.
334
+ v2.3.6 was developed against DSH `master@47f943859bef60e4160492346772ded9b24f765a`. CI covers Windows, Ubuntu, and macOS.
331
335
 
332
336
  ## Project
333
337
 
334
- - Version: `v2.3.5`
338
+ - Version: `v2.3.6`
335
339
  - Author: upstream [Hakunm](https://github.com/Hakunm); this fork maintained by [westanke](https://github.com/westanke)
336
340
  - Repository: [GitHub](https://github.com/westanke/dsh-remote-bridge) · [Gitee](https://gitee.com/westanke/dsh-remote-bridge)
337
341
  - npm: [`dsh-remote-bridge`](https://www.npmjs.com/package/dsh-remote-bridge) ([mainland-China mirror](https://registry.npmmirror.com/dsh-remote-bridge))
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- <img alt="Version" src="https://img.shields.io/badge/version-v2.3.5-087f8c">
12
+ <img alt="Version" src="https://img.shields.io/badge/version-v2.3.6-087f8c">
13
13
  <img alt="DSH plugin" src="https://img.shields.io/badge/DeepSeek_Harness-plugin-1f2328">
14
14
  <img alt="Platforms" src="https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-586069">
15
15
  <img alt="License" src="https://img.shields.io/badge/license-AGPL--3.0-2da44e">
@@ -32,6 +32,12 @@
32
32
 
33
33
  远程访问默认关闭。管理员可在本机 WebUI 中设置绑定 IP、端口和新设备的初始权限。
34
34
 
35
+ ![手机设置 —— 默认展开的「根目录」卡片](assets/screenshots/panel-roots.png)
36
+
37
+ > **关于这几张截图。** `assets/screenshots/` 下的四张图由 `scripts/generate-screenshots.ts` 生成,它用与测试同一份产出来源渲染面板 —— `ADMIN_TABS`、`WORKSPACE_CSS`、`APP_QR_CODES` 全部取自 `src/client/`,所以你看到的是**发布包里的标记与样式表**,不是另画的示意图。图中呈现的是一台刚装好插件、尚未启用远程访问的机器,这是最诚实的默认状态。本 README 早前曾放过两张界面截图,但都摄于改名之前(标题还是「DSH 文件工作区」,远程访问那张还标着 v1.0.0,且把文件树与设置显示成上下两个弹窗),与上文描述的形态已不符,于是撤掉而不是留着误导。
38
+ >
39
+ > 市场会从 [`screenshots.json`](./screenshots.json) 自动取用这些图 —— 不必再来提 PR、不必等维护者。换了图直接推自己的仓库即可,下一次构建自动生效。
40
+
35
41
 
36
42
  ## 关于改名(2.0.4)
37
43
 
@@ -70,10 +76,10 @@ dsh plugin --profile web add dsh-remote-bridge
70
76
  dsh plugin --profile web add dsh-remote-bridge --registry https://registry.npmmirror.com
71
77
 
72
78
  # ② GitHub Release 的 tarball
73
- dsh plugin --profile web add https://github.com/westanke/dsh-remote-bridge/releases/download/v2.3.5/dsh-remote-bridge-v2.3.5.tgz
79
+ dsh plugin --profile web add https://github.com/westanke/dsh-remote-bridge/releases/download/v2.3.6/dsh-remote-bridge-v2.3.6.tgz
74
80
 
75
81
  # ③ Gitee Release 的 tarball(国内访问更快)
76
- dsh plugin --profile web add https://gitee.com/westanke/dsh-remote-bridge/releases/download/v2.3.5/dsh-remote-bridge-v2.3.5.tgz
82
+ dsh plugin --profile web add https://gitee.com/westanke/dsh-remote-bridge/releases/download/v2.3.6/dsh-remote-bridge-v2.3.6.tgz
77
83
 
78
84
  npx @deepseek-ai/dsh web
79
85
  ```
@@ -89,7 +95,7 @@ npx @deepseek-ai/dsh web
89
95
  从 GitHub Release 下载离线安装包时,可直接安装 tarball:
90
96
 
91
97
  ```sh
92
- dsh plugin --profile web add ./dsh-remote-bridge-v2.3.5.tgz
98
+ dsh plugin --profile web add ./dsh-remote-bridge-v2.3.6.tgz
93
99
  ```
94
100
 
95
101
  ## 第一次使用
@@ -315,15 +321,15 @@ pnpm check
315
321
  pnpm pack
316
322
  ```
317
323
 
318
- `pnpm check` 覆盖类型检查、文档一致性与测试;当前 **19 个测试文件 / 113 个用例**,外加 **3 个浏览器层用例**(Playwright 实测量出的计算样式),全部通过。
324
+ `pnpm check` 覆盖类型检查、文档一致性与测试;当前 **30 个测试文件 / 226 个用例**,外加 **4 个浏览器层用例**(Playwright 实测量出的计算样式),全部通过。
319
325
 
320
- `npm pack` 的产物约 **0.25 MB**:2.2.0 删除独立页及其编辑器依赖、并关闭 source map 之后,从 1.72 MB 降下来。
326
+ `npm pack` 的产物约 **0.29 MB**:2.2.0 删除独立页及其编辑器依赖、并关闭 source map 之后,从 1.72 MB 降下来。
321
327
 
322
- v2.3.5 基于 DSH `master@47f943859bef60e4160492346772ded9b24f765a` 开发,CI 覆盖 Windows、Ubuntu 和 macOS。
328
+ v2.3.6 基于 DSH `master@47f943859bef60e4160492346772ded9b24f765a` 开发,CI 覆盖 Windows、Ubuntu 和 macOS。
323
329
 
324
330
  ## 项目信息
325
331
 
326
- - 当前版本:`v2.3.5`
332
+ - 当前版本:`v2.3.6`
327
333
  - 作者:上游 [Hakunm](https://github.com/Hakunm),本 fork 维护 [westanke](https://github.com/westanke)
328
334
  - 仓库:[GitHub](https://github.com/westanke/dsh-remote-bridge) · [Gitee](https://gitee.com/westanke/dsh-remote-bridge)
329
335
  - npm:[`dsh-remote-bridge`](https://www.npmjs.com/package/dsh-remote-bridge)([国内镜像](https://registry.npmmirror.com/dsh-remote-bridge))
@@ -1,7 +1,7 @@
1
1
  asyncapi: 3.0.0
2
2
  info:
3
3
  title: DeepSeek Harness Mobile Events
4
- version: 2.3.5
4
+ version: 2.3.7
5
5
  description: |
6
6
  Live file and authorized DSH chat events. Reconnect clients must refresh
7
7
  REST state; unbounded replay is not provided.
@@ -1,7 +1,7 @@
1
1
  openapi: 3.1.0
2
2
  info:
3
3
  title: DeepSeek Harness Mobile API
4
- version: 2.3.5
4
+ version: 2.3.7
5
5
  description: Versioned file and chat BFF for mobile and third-party DSH clients. HTTP and HTTPS are both supported.
6
6
  servers:
7
7
  - url: http://127.0.0.1:3090/api/v1
@@ -24,7 +24,7 @@ paths:
24
24
  properties:
25
25
  ok: { type: boolean, const: true }
26
26
  version: { type: string, const: v1 }
27
- pluginVersion: { type: string, const: 2.3.5 }
27
+ pluginVersion: { type: string, const: 2.3.7 }
28
28
  /pairings/exchange:
29
29
  post:
30
30
  security: []
@@ -4,7 +4,7 @@ plugins {
4
4
  }
5
5
 
6
6
  group = "ai.deepseek.dsh"
7
- version = "2.3.5"
7
+ version = "2.3.7"
8
8
 
9
9
  repositories { mavenCentral() }
10
10
 
package/lib/index.d.ts CHANGED
@@ -626,6 +626,15 @@ interface WorkspaceRegistryLike {
626
626
  updatedAt: string;
627
627
  sessionIds?: readonly string[];
628
628
  }[];
629
+ /**
630
+ * 注册表级(registry-global)归档集合:被归档、应从**所有**分组界面隐藏的会话 id。
631
+ *
632
+ * 内核 `dsh-workspace` 的 `WorkspaceRegistry` 用 getter 暴露它
633
+ * (`lib/types/index.d.ts` 的 `get archivedSessionIds(): readonly SessionId[]`),
634
+ * 且 `ctx.workspaceRegistry` 就是这个实体。声明成可选:老内核或测试替身可能没有,
635
+ * 读不到时退化成空集合,只是过滤失效,不该让整条列表读崩掉。
636
+ */
637
+ readonly archivedSessionIds?: readonly string[];
629
638
  }
630
639
  interface SettingsControllerLike {
631
640
  describe(): {
@@ -707,8 +716,15 @@ interface Dsh02HostServices {
707
716
  * Cordis event bus of the host context. Used for the two facts the old
708
717
  * `apiProxy` event streams carried that no controller returns: session
709
718
  * registry changes and the approval answerer waterfall.
719
+ *
720
+ * `options.prepend` 是 Cordis `EventsService.on` 的原生选项(cordis 4.0.2
721
+ * `src/events.ts:143`、`:255`:`const method = options.prepend ? 'unshift' : 'push'`)。
722
+ * 审批与提问两个钩子**必须**传 `{ prepend: true }` —— 原因见
723
+ * `ApprovalBridge.attach` 与 `QuestionBridge.attach` 的注释。
710
724
  */
711
- on(event: string, listener: (...args: any[]) => unknown): () => void;
725
+ on(event: string, listener: (...args: any[]) => unknown, options?: {
726
+ prepend?: boolean;
727
+ }): () => void;
712
728
  }
713
729
  /**
714
730
  * 需要交接时,把每个 `image` 部件换成**两行文本**;否则原样返回。
package/lib/index.js CHANGED
@@ -1995,7 +1995,7 @@ var ApprovalBridge = class {
1995
1995
  });
1996
1996
  if (outcome === "delegate") return next();
1997
1997
  return outcome;
1998
- });
1998
+ }, { prepend: true });
1999
1999
  }
2000
2000
  async respond(message) {
2001
2001
  const entry = this.pending.get(message.rpcId);
@@ -2115,7 +2115,7 @@ var QuestionBridge = class {
2115
2115
  rpcId
2116
2116
  });
2117
2117
  return await delegate;
2118
- });
2118
+ }, { prepend: true });
2119
2119
  }
2120
2120
  /**
2121
2121
  * 回答一条**正挂在前台等待**的提问(App 通过 `POST …/answer` 打进来)。
@@ -2182,12 +2182,30 @@ function isUserQuestionAnswerLike(value) {
2182
2182
  return Array.isArray(entry.selected) && entry.selected.every((label) => typeof label === "string");
2183
2183
  });
2184
2184
  }
2185
- /** Best-effort projection of an Agent identity to its session id. */
2185
+ /**
2186
+ * Best-effort projection of an Agent identity to its session id.
2187
+ *
2188
+ * 内核侧有两个真相来源,顺序不能反:
2189
+ * - `Agent.id` **就是** `SessionId`(`dsh-agent/lib/types/types.d.ts:11-14` 的
2190
+ * `readonly id: SessionId`,运行时由 `dsh-agent-loop/lib/index.js:773` 的
2191
+ * `this.id = id` 赋值)。这是直给的那个,必须第一个查;
2192
+ * - `agent.session` 是 `dsh-session` 的 **class** `Session`,它**没有** `id` 属性 ——
2193
+ * session id 挂在 `header.id`(`SessionHeader.id`)。只查 `session.id` 永远落空。
2194
+ *
2195
+ * 这两条都曾经被漏掉,代价极大:审批与提问两个 waterfall 监听都以
2196
+ * 「`sessionId === undefined` → 原样交给下游」收场,于是**电脑端一切正常、手机端
2197
+ * 一张卡都没有** —— 而且失败是静默的,两侧日志都不会说一句话。
2198
+ */
2186
2199
  function sessionIdOfAgent(agent) {
2187
2200
  if (!agent || typeof agent !== "object") return void 0;
2188
2201
  const candidate = agent;
2189
2202
  if (typeof candidate.sessionId === "string") return candidate.sessionId;
2190
- if (candidate.session && typeof candidate.session === "object" && typeof candidate.session.id === "string") return candidate.session.id;
2203
+ if (typeof candidate.id === "string") return candidate.id;
2204
+ const session = candidate.session;
2205
+ if (session && typeof session === "object") {
2206
+ if (typeof session.id === "string") return session.id;
2207
+ if (session.header && typeof session.header.id === "string") return session.header.id;
2208
+ }
2191
2209
  }
2192
2210
  /** Best-effort projection of a session view to its session id. */
2193
2211
  function sessionIdOf(summary) {
@@ -2380,6 +2398,21 @@ async function handoffImagesForTextOnlyModel(host, roots, fallbackDir, subdir, l
2380
2398
  }
2381
2399
  }
2382
2400
  /**
2401
+ * 读注册表级归档集合,读不到就返回空数组。
2402
+ *
2403
+ * 让 `workspace.list` 把内核的归档状态透传给上层(chat-adapter 靠它把已归档会话
2404
+ * 从列表里滤掉)。getter 缺失(老内核、测试替身)时退化成空集合:过滤失效,
2405
+ * 但列表本身照常可读 —— 比抛错更接近旧的可用行为。
2406
+ *
2407
+ * @param registry - 内核工作区注册表(`ctx.workspaceRegistry`)。
2408
+ * @returns 归档的会话 id;字段缺失或不是字符串数组时为空数组。
2409
+ */
2410
+ function readArchivedSessionIds(registry) {
2411
+ const value = registry.archivedSessionIds;
2412
+ if (!Array.isArray(value)) return [];
2413
+ return value.filter((item) => typeof item === "string");
2414
+ }
2415
+ /**
2383
2416
  * Build the `apiProxy` replacement out of 0.2.x host services.
2384
2417
  *
2385
2418
  * Every method keeps the old `{ rpcId, payload }` request shape and the old
@@ -2387,7 +2420,6 @@ async function handoffImagesForTextOnlyModel(host, roots, fallbackDir, subdir, l
2387
2420
  * `chat-adapter.ts` and `settings-adapter.ts` are written against.
2388
2421
  *
2389
2422
  * @param host - host services resolved from the plugin context.
2390
- * @param host - host services resolved from the plugin context.
2391
2423
  * @returns a `SettingsApiProxy` (i.e. `DshApiProxy` plus the settings surfaces).
2392
2424
  */
2393
2425
  function createDsh02ApiProxy(host, options = {}) {
@@ -2589,7 +2621,7 @@ function createDsh02ApiProxy(host, options = {}) {
2589
2621
  createdAt: row.createdAt,
2590
2622
  updatedAt: row.updatedAt
2591
2623
  })),
2592
- archivedSessionIds: []
2624
+ archivedSessionIds: readArchivedSessionIds(host.workspaceRegistry)
2593
2625
  };
2594
2626
  }),
2595
2627
  create: (request) => call(() => host.workspaceController.create(request.payload)),
@@ -3682,7 +3714,7 @@ async function inspectResolvedPath(root, wirePath) {
3682
3714
  }
3683
3715
  //#endregion
3684
3716
  //#region src/shared/version.ts
3685
- const PLUGIN_VERSION = "2.3.5";
3717
+ const PLUGIN_VERSION = "2.3.7";
3686
3718
  //#endregion
3687
3719
  //#region src/host/router.ts
3688
3720
  var ApiRouter = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-remote-bridge",
3
- "version": "2.3.5",
3
+ "version": "2.3.7",
4
4
  "description": "Versioned REST bridge for DeepSeek Harness: remote access for trusted clients (chat, files, devices) plus a Phone-settings panel inside the DSH WebUI.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.19.0",
@@ -29,6 +29,7 @@
29
29
  "kotlin-sdk/src/**",
30
30
  "kotlin-sdk/README.md",
31
31
  "cordis.patch.yml",
32
+ "screenshots.json",
32
33
  "README.md",
33
34
  "README.en.md",
34
35
  "LICENSE"
@@ -0,0 +1,6 @@
1
+ [
2
+ "assets/screenshots/panel-roots.png",
3
+ "assets/screenshots/panel-remote.png",
4
+ "assets/screenshots/panel-devices.png",
5
+ "assets/screenshots/panel-app-download.png"
6
+ ]