dsh-multi-chat 0.6.2 → 0.6.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.
package/README.md CHANGED
@@ -1,187 +1,189 @@
1
- # 💬 dsh-multi-chat —— 多对话,一屏驾驭
1
+ # 💬 dsh-multi-chat — Multi-chat, one screen
2
+
3
+ **English** | [中文](README.zh.md)
2
4
 
3
5
  <p align="center">
4
6
  <a href="https://www.npmjs.com/package/dsh-multi-chat"><img src="https://img.shields.io/npm/v/dsh-multi-chat" alt="npm version"></a>
5
7
  <a href="https://www.npmjs.com/package/dsh-multi-chat"><img src="https://img.shields.io/npm/dm/dsh-multi-chat" alt="npm downloads"></a>
6
8
  <a href="https://github.com/daetz-coder/dsh-multi-chat/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="license"></a>
7
- <a href="https://github.com/topics/dsh-plugin"><img src="https://img.shields.io/badge/dsh-plugin-✓-brightgreen" alt="dsh-plugin"></a>
9
+ <a href="https://github.com/topics/dsh-plugin"><img src="https://img.shields.io/badge/dsh--plugin-community-brightgreen" alt="dsh-plugin"></a>
8
10
  </p>
9
11
 
10
- > **在 DeepSeek Harness 里同时开 N 个对话,并排盯住每一个 Agent 的实时进度,还能用手机/平板躺着看。** 一个浏览器,从「一次一个对话」升级成「全景多对话驾驶舱」。
12
+ > **Run N conversations in DeepSeek Harness at once, watch every Agent's live progress side-by-side, and check in from your phone or tablet.** One browser tab goes from "one conversation at a time" to "a panoramic multi-conversation cockpit."
11
13
 
12
- 给 [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) 官方 Web 界面装上一面**多窗口墙**:在一张网格里同时显示 N 个正在运行的 DSH 对话实例(每个实例独立跑一个任务),所有 Agent 的实时进度、对话、输出**一眼尽收**,不用在无数标签页/窗口之间切来切去。
14
+ Install a **multi-window wall** into the official [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) Web UI: a grid that shows N running DSH conversation instances simultaneously (each instance runs its own task), so every Agent's live progress, chat, and output are **visible at a glance** — no more hopping between endless tabs and windows.
13
15
 
14
- ## ✨ 它能做什么
16
+ ## ✨ What it does
15
17
 
16
- | 能力 | 说明 |
17
- |------|------|
18
- | 📺 **多窗口** | 侧边栏一键进入,右侧对话区原位变成窗口网格,一个端口一格,并排看全部任务 |
19
- | 🔍 **自动发现** | 扫描端口区间自动发现正在运行的 DSH 实例,也可手动管理 |
20
- | ➕ **一键新建窗口** | 墙内直接启动全新 DSH 实例,凑成你的多对话矩阵 |
21
- | 📱 **手机访问** | 点「手机访问」自动起一个**内置带口令认证的局域网网关**,手机打开 URL、输入口令即可看进度 |
22
- | 🛑 **窗口控制** | 单窗口放大、刷新、新标签页打开、关闭实例、列数切换(自动/1/2/3/4/6)|
18
+ | Capability | Description |
19
+ |------------|-------------|
20
+ | 📺 **Multi-window** | One-click entry from the sidebar; the chat area becomes a window grid showing every task side-by-side, one pane per port |
21
+ | 🔍 **Auto-discovery** | Scans a port range to auto-find running DSH instances; manual management is also supported |
22
+ | ➕ **One-click new window** | Launch a brand-new DSH instance right inside the wall to grow your conversation matrix |
23
+ | 📱 **Phone access** | The "Phone access" button starts a **built-in authenticated LAN gateway** — open the URL on your phone, enter the token, and watch progress |
24
+ | 🛑 **Window controls** | Maximize, refresh, open in a new tab, stop an instance, and switch column count (auto/1/2/3/4/6) |
23
25
 
24
- > **多对话 = 多端口。** 启动 N 个 `dsh web --port <n>`,每个实例独立跑一个对话/任务;在任意一个实例里打开多窗口墙,即可并排看到全部。
26
+ > **Multi-chat = multi-port.** Start N `dsh web --port <n>` instances (each running one conversation/task), open the wall from any of them, and you see all of them side-by-side.
25
27
 
26
- ## 📸 运行效果
28
+ ## 📸 Screenshots
27
29
 
28
- **🖥️ Windows · 双对话并排** —— 两个正在运行的 DSH 实例并排列出,每格都是完整的官方对话界面,带实时在线状态点与单窗控制(放大 / 刷新 / 新标签页 / 移除):
30
+ **🖥️ Windows · Two chats side-by-side** — two running DSH instances laid out together, each pane a full official conversation UI with live online status dots and per-window controls (maximize / refresh / new tab / remove):
29
31
 
30
- ![Windows 双对话:两个 DSH 实例并排显示](assets/01-windows-dual-chat.png)
32
+ ![Windows dual chat: two DSH instances side-by-side](assets/01-windows-dual-chat.png)
31
33
 
32
- **📱 iPad · 双对话移动端** —— 同一局域网内,iPad 打开带口令认证的网关地址,即可在平板上一屏并排盯住两个 Agent 的实时进度:
34
+ **📱 iPad · Two chats on mobile** — on the same LAN, open the token-authenticated gateway URL on an iPad to watch two Agents' live progress on one tablet screen:
33
35
 
34
- ![iPad 双对话:平板端并排显示两个 DSH 实例](assets/02-ipad-dual-chat.png)
36
+ ![iPad dual chat: two DSH instances on tablet](assets/02-ipad-dual-chat.png)
35
37
 
36
- **🖥️ Windows · 三对话全景** —— 3 列网格并排显示 3 个正在运行的实例,一屏尽收全部 Agent,把「一次一个对话」升级成「全景多对话驾驶舱」:
38
+ **🖥️ Windows · Three-chat panorama** — a 3-column grid of three running instances, all Agents on one screen, upgrading you from "one conversation at a time" to "a panoramic multi-conversation cockpit":
37
39
 
38
- ![Windows 三对话:3 列网格并排显示 3 个 DSH 实例](assets/03-windows-triple-chat.png)
40
+ ![Windows triple chat: 3-column grid of three DSH instances](assets/03-windows-triple-chat.png)
39
41
 
40
- ## 🚀 30 秒上手
42
+ ## 🚀 30-second quick start
41
43
 
42
44
  ```bash
43
- # 1. 安装(npm / npx,免手工打包补丁)
45
+ # 1. Install (npm / npx, no manual patch needed)
44
46
  npx dsh-multi-chat install
45
47
 
46
- # 2. 启动几个实例
48
+ # 2. Start a few instances
47
49
  npx dsh-multi-chat start --ports 3080,3081,3082
48
50
 
49
- # 3. 打开任意实例,点侧边栏底部「多窗口」→ 完成 🎉
51
+ # 3. Open any instance and click "Multi-window" in the sidebar footer → done 🎉
50
52
  ```
51
53
 
52
- ## 为什么这样做
54
+ ## Why this approach
53
55
 
54
- - **不改动任何官方逻辑**:插件只注册两个**增量列表槽位**(`conversation.view` 视图环条目、`sidebar.footer.action` 侧边栏快捷入口)和五个只读 JSON 路由(`/multi/api/ports`、`/multi/api/status`、`/multi/api/stop`、`/multi/api/create`、`/multi/api/link`)。不替换任何既有槽位、不改写任何行、不触碰会话/代理/工具等核心逻辑。
55
- - **界面就是官方界面**:墙是官方视图环的一个视图,渲染在对话主面板内(不是弹层),主题、字号、图标、控件全部走官方 `--dsw-*` token 与官方 primitives(Button/Input/Menu/StateDot)。
56
- - **递归防护**:墙永远不嵌入自身端口;被嵌入页面带 `?multi-wall=embed` 标记,不注册任何墙界面,杜绝「墙中墙」无限递归。
57
- - **最小改动**:新增一个 client 插件包 + 一个 patch 行。
56
+ - **No official logic is touched**: the plugin only registers two **additive list slots** (`conversation.view` ring entry, `sidebar.footer.action` sidebar shortcut) and five read-only JSON routes (`/multi/api/ports`, `/multi/api/status`, `/multi/api/stop`, `/multi/api/create`, `/multi/api/link`). No existing slot is replaced, no line is rewritten, and no core session/agent/tool logic is touched.
57
+ - **The UI is the official UI**: the wall is a view in the official view ring rendered inside the chat panel (not a popup). Theme, type scale, icons, and controls all use the official `--dsw-*` tokens and official primitives (Button/Input/Menu/StateDot).
58
+ - **Recursion guard**: the wall never embeds its own port; embedded pages carry a `?multi-wall=embed` flag and register no wall UI, preventing infinite "wall-in-wall" recursion.
59
+ - **Minimal footprint**: one client plugin package + one patch line.
58
60
 
59
- ## 目录结构
61
+ ## Directory layout
60
62
 
61
63
  ```
62
- plugin/dsh-client-ui-multi-wall/ # 官方规范 client 插件包(node half + browser half)
63
- lib/ # 已构建产物(lib/index.js + lib/client.js + 类型)
64
- src/ # 源码(与官方 monorepo packages/client/ui-multi-wall 一致)
65
- patches/multi-wall.yml # 启用插件的 cordis.patch.yml insert 行
64
+ plugin/dsh-client-ui-multi-wall/ # spec-compliant client plugin package (node half + browser half)
65
+ lib/ # built artifacts (lib/index.js + lib/client.js + types)
66
+ src/ # source (mirrors the official monorepo packages/client/ui-multi-wall)
67
+ patches/multi-wall.yml # cordis.patch.yml insert line that enables the plugin
66
68
  scripts/
67
- install-plugin.ps1 # 打包 + 装进 profile + 追加 patch + 提示重启
68
- start-multi.ps1 / stop-multi.ps1 # 启停多个 dsh web 实例(-Remote 可带认证网关)
69
- gateway.mjs # 带令牌认证 / 可选 TLS 的反向代理网关(手机/远程访问)
70
- gateway-hidden.vbs # 无窗口启动器:用隐藏窗口方式启动 gateway.mjs(不弹控制台)
71
- gateway-start.ps1 / gateway-stop.ps1 # 一键静默启动/停止网关
72
- bin/dsh-multi-chat.mjs # 跨平台 npx CLI(install/start/stop/gateway)
73
- harness-src/ # 官方 deepseek-harness 源码(开发/构建用)
69
+ install-plugin.ps1 # pack + install into profile + append patch + prompt restart
70
+ start-multi.ps1 / stop-multi.ps1 # start/stop multiple dsh web instances (-Remote can carry an authenticated gateway)
71
+ gateway.mjs # token-authenticated / optional-TLS reverse-proxy gateway (phone/remote access)
72
+ gateway-hidden.vbs # no-window launcher: starts gateway.mjs hidden (no console flash)
73
+ gateway-start.ps1 / gateway-stop.ps1 # one-shot silent start/stop of the gateway
74
+ bin/dsh-multi-chat.mjs # cross-platform npx CLI (install/start/stop/gateway)
75
+ harness-src/ # official deepseek-harness source (dev/build reference)
74
76
  ```
75
77
 
76
- ## 安装与启用(Windows)
78
+ ## Install & enable (Windows)
77
79
 
78
80
  ```powershell
79
- # 1) 打包并装进 web profile,自动追加 patch 行
81
+ # 1) Pack and install into the web profile, appends the patch line automatically
80
82
  .\scripts\install-plugin.ps1
81
83
 
82
- # 2) 重启 dsh web,打开任意实例
84
+ # 2) Restart dsh web and open any instance
83
85
  dsh web --port 3084
84
- # 浏览器打开 http://127.0.0.1:3084 ,侧边栏底部出现「多窗口」按钮
86
+ # Browser: http://127.0.0.1:3084 — a "Multi-window" button appears in the sidebar footer
85
87
  ```
86
88
 
87
- 或手动:
89
+ Or manual:
88
90
 
89
91
  ```bash
90
- cd plugin/dsh-client-ui-multi-wall && npm pack # 得到 tarball
91
- dsh plugin --profile web add <tarball> # 装进 profile
92
- # 把 patches/multi-wall.yml 的 insert 行加进 ~/.dsh/profiles/web/cordis.patch.yml
92
+ cd plugin/dsh-client-ui-multi-wall && npm pack # produce a tarball
93
+ dsh plugin --profile web add <tarball> # install into the profile
94
+ # Append the insert line from patches/multi-wall.yml to ~/.dsh/profiles/web/cordis.patch.yml
93
95
  ```
94
96
 
95
- ## 使用
97
+ ## Usage
96
98
 
97
- 1. 先启动若干实例:`.\scripts\start-multi.ps1 -Ports "3080,3081,3082,3084"`(或手动 `dsh web --port <n>`)。
98
- 2. 打开任意实例,点侧边栏底部的「多窗口」快捷入口(或点对话区头部的「多窗口」标签页)。
99
- 3. 墙视图内:自动发现实例(自动排除自身端口)、列数切换(自动/1/2/3/4/6,默认横向铺满)、点标题放大、⟳ 单独刷新、↗ 新标签页打开、✕ 从视图移除、全部刷新、实时在线状态点。布局保存在 localStorage。
100
- 4. 退出墙:点工具栏**右上角的「退出」按钮**,一键切回对话视图。
99
+ 1. Start several instances: `.\scripts\start-multi.ps1 -Ports "3080,3081,3082,3084"` (or manual `dsh web --port <n>`).
100
+ 2. Open any instance and click the "Multi-window" shortcut in the sidebar footer (or the "Multi-window" tab at the top of the chat area).
101
+ 3. Inside the wall view: auto-discovery (own port excluded), column switching (auto/1/2/3/4/6, horizontally filled by default), click title to maximize, ⟳ refresh one, ↗ open in a new tab, ✕ remove from view, refresh all, and live online status dots. The layout is persisted to `localStorage`.
102
+ 4. To exit the wall, click the **"Exit" button in the toolbar's top-right** to switch back to the chat view in one click.
101
103
 
102
- ## 手机 / 远程访问(内置认证网关)
104
+ ## Phone / remote access (built-in authenticated gateway)
103
105
 
104
- 官方 `dsh web` 出于安全**刻意禁止 `--host 0.0.0.0`**(会向网络暴露远程代码执行)。本插件内置了一个**带令牌认证的内联网关**:点工具栏「手机访问」按钮,它会**自动**为本实例启动一个网关(监听 `0.0.0.0`,反向代理到 `127.0.0.1:<本实例端口>`),并返回局域网 URL + 登录口令。
106
+ The official `dsh web` **deliberately forbids `--host 0.0.0.0`** (it would expose remote code execution to the network). This plugin ships a built-in **token-authenticated intranet gateway**: click the "Phone access" button and it **automatically** starts a gateway for the current instance (listening on `0.0.0.0`, reverse-proxying to `127.0.0.1:<this instance's port>`), returning a LAN URL + login token.
105
107
 
106
108
  ```text
107
- 点击「手机访问」→ 得到:
108
- 手机在同一网络时可用:http://10.105.7.204:9477 口令:2efb23eade16
109
+ Click "Phone access" → you get:
110
+ Available on your phone on the same network: http://10.105.7.204:9477 token: 2efb23eade16
109
111
  ```
110
112
 
111
- 手机打开该 URL、输入口令即可进入完整 DSH 界面。网关的安全模型:
113
+ Open that URL on your phone and enter the token to reach the full DSH UI. The gateway's security model:
112
114
 
113
- - HMAC 签名的 HttpOnly/SameSite 会话 Cookie(默认 12h),`?token=` 供脚本快捷使用,按 IP 限流登录失败
114
- - 所有代理请求把 Host/Origin 重写为回环目标,官方 `/api` 浏览器信任栅栏(DNS-rebinding 防线)判定为本地请求,无需重启加 `--trusted-host`
115
- - WebSocket 升级与 SSE 流原样透传
116
- - 目标端口撞上 Windows 排除段或已占用时,自动回退到 OS 分配的空闲端口
115
+ - HMAC-signed HttpOnly/SameSite session cookie (12h default), `?token=` for script convenience, per-IP rate limiting on failed logins
116
+ - All proxied requests rewrite Host/Origin to the loopback target, so the official `/api` browser-trust fence (the DNS-rebinding defense) treats it as a local request — no restart / `--trusted-host` needed
117
+ - WebSocket upgrades and SSE streams pass through unchanged
118
+ - When the intended port hits a Windows excluded range or is already bound, it automatically falls back to an OS-assigned free port
117
119
 
118
- > 也有独立的 `scripts/gateway.mjs`(带可选 TLS)供进阶场景手动使用。
120
+ > A standalone `scripts/gateway.mjs` (with optional TLS) is also available for advanced manual use.
119
121
 
120
- ## 分发与安装
122
+ ## Distribution & install
121
123
 
122
- 仓库内置跨平台 CLI `dsh-multi-chat`(`bin/dsh-multi-chat.mjs`),下面三种渠道都可安装。CLI 的 `install` 会探测 `$DSH_HOME`(缺省 `~/.dsh`)并幂等地追加启用 patch(与 `install-plugin.ps1` 行为一致)。
124
+ The repo bundles a cross-platform CLI, `dsh-multi-chat` (`bin/dsh-multi-chat.mjs`), installable through any of the three channels below. Its `install` command probes `$DSH_HOME` (default `~/.dsh`) and idempotently appends the enable patch (same behavior as `install-plugin.ps1`).
123
125
 
124
- ### 渠道一:npm / npx(推荐,最省事)
126
+ ### Channel 1: npm / npx (recommended, easiest)
125
127
 
126
128
  ```bash
127
- # 发布到 npm 后,任意机器一句话安装
129
+ # After publishing to npm, one line installs on any machine
128
130
  npx dsh-multi-chat install
129
131
 
130
- # 或直接 npx 跑单条命令(无需安装)
131
- npx dsh-multi-chat start --remote --token <口令> --ports 3080,3081
132
- npx dsh-multi-chat gateway --target 127.0.0.1:3080 --token <口令>
132
+ # Or run a single command straight from npx (no install needed)
133
+ npx dsh-multi-chat start --remote --token <token> --ports 3080,3081
134
+ npx dsh-multi-chat gateway --target 127.0.0.1:3080 --token <token>
133
135
  ```
134
136
 
135
- 维护者发布:`npm publish`(无作用域公开包 `dsh-multi-chat`)。
137
+ Publishing (maintainer): `npm publish` (unscoped public package `dsh-multi-chat`).
136
138
 
137
- ### 渠道二:GitHub Release
139
+ ### Channel 2: GitHub Release
138
140
 
139
- 从 [Releases](https://github.com/daetz-coder/dsh-multi-chat/releases) 下载源码 zip/tarball,解压后进目录:
141
+ Download the source zip/tarball from [Releases](https://github.com/daetz-coder/dsh-multi-chat/releases), unpack it, and cd in:
140
142
 
141
143
  ```bash
142
- node bin/dsh-multi-chat.mjs install # 打包 + dsh plugin add + 追加启用 patch
144
+ node bin/dsh-multi-chat.mjs install # pack + dsh plugin add + append enable patch
143
145
  node bin/dsh-multi-chat.mjs start --ports 3080,3081
144
146
  ```
145
147
 
146
- > 打 tag 后,GitHub 会自动生成 source zip/tarball 资产;也可在 Release 附加 `npm pack` 产出的 `.tgz` 作为离线安装包。
148
+ > Tagging a release makes GitHub auto-generate the source zip/tarball assets; you can also attach a `npm pack`-produced `.tgz` as an offline install bundle.
147
149
 
148
- ### 渠道三:git 直接安装
150
+ ### Channel 3: direct git install
149
151
 
150
152
  ```bash
151
153
  git clone https://github.com/daetz-coder/dsh-multi-chat.git
152
154
  cd dsh-multi-chat
153
155
 
154
- node bin/dsh-multi-chat.mjs install # 装插件
156
+ node bin/dsh-multi-chat.mjs install # install the plugin
155
157
  node bin/dsh-multi-chat.mjs start --ports 3080,3081
156
- node bin/dsh-multi-chat.mjs gateway --target 127.0.0.1:3080 --token <口令>
158
+ node bin/dsh-multi-chat.mjs gateway --target 127.0.0.1:3080 --token <token>
157
159
  ```
158
160
 
159
- ### 本仓库直接运行(开发)
161
+ ### Running straight from this repo (development)
160
162
 
161
163
  ```bash
162
164
  node bin/dsh-multi-chat.mjs install
163
165
  node bin/dsh-multi-chat.mjs start --ports 3080,3081
164
166
  node bin/dsh-multi-chat.mjs stop
165
- node bin/dsh-multi-chat.mjs gateway --target 127.0.0.1:3080 --token <口令>
167
+ node bin/dsh-multi-chat.mjs gateway --target 127.0.0.1:3080 --token <token>
166
168
  ```
167
169
 
168
- ## 🔍 发现与生态
170
+ ## 🔍 Discovery & ecosystem
169
171
 
170
- 本插件遵循 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 官方 client 插件规范:
172
+ This plugin follows the official [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) client plugin spec:
171
173
 
172
- - **在 GitHub 插件生态中被发现**:给本仓库添加 [`dsh-plugin`](https://github.com/topics/dsh-plugin) topic,即可在官方 [`dsh-plugin` topic 页](https://github.com/topics/dsh-plugin) 被搜索到(官方推荐的第三方插件发现方式)。
173
- - **三语技术文档**:插件包 `plugin/dsh-client-ui-multi-wall/` 下提供 `README.md`(英文)、`README.zh.md`(中文)与 `README.i18n.yaml`(双语一致性记录),结构与官方 `packages/client/*` 插件一致。
174
- - **纯增量、不碰核心**:只注册 `conversation.view` / `sidebar.footer.action` 两个列表槽位 + `/multi/api/*` 只读路由,不改动任何官方核心逻辑。
174
+ - **Be found in the GitHub plugin ecosystem**: adding the [`dsh-plugin`](https://github.com/topics/dsh-plugin) topic to this repo makes it searchable on the official [`dsh-plugin` topic page](https://github.com/topics/dsh-plugin) (the officially recommended third-party discovery path).
175
+ - **Bilingual technical docs**: under `plugin/dsh-client-ui-multi-wall/` there is `README.md` (English), `README.zh.md` (Chinese), and `README.i18n.yaml` (bilingual consistency record), matching the structure of official `packages/client/*` plugins.
176
+ - **Purely additive, no core touching**: registers only the `conversation.view` / `sidebar.footer.action` list slots + `/multi/api/*` read-only routes, changing no official core logic.
175
177
 
176
- ## 在官方 monorepo 中的位置
178
+ ## Where it lives in the official monorepo
177
179
 
178
- `packages/client/ui-multi-wall` 是遵循官方 client 插件规范的包(tsconfig host/client 分离、tsdown clientBundle、locales zh/en、invariant 伴随、HMR 安全测试),并已接入 `packages/bundle/web-app` 的 dsh.client roster 与 `tsconfig.client.json` 聚合。构建:
180
+ `packages/client/ui-multi-wall` is a spec-compliant client plugin package (separate host/client tsconfig, tsdown clientBundle, zh/en locales, invariant companion, HMR-safe tests) wired into `packages/bundle/web-app`'s dsh.client roster and the `tsconfig.client.json` aggregate. To build:
179
181
 
180
182
  ```bash
181
183
  cd harness-src
182
184
  pnpm install
183
- pnpm --filter @deepseek-ai/dsh-client-ui-multi-wall bundle # 产出 lib/client.js
184
- npx vitest run packages/client/ui-multi-wall # 14 项测试
185
+ pnpm --filter @deepseek-ai/dsh-client-ui-multi-wall bundle # produces lib/client.js
186
+ npx vitest run packages/client/ui-multi-wall # 14 tests
185
187
  ```
186
188
 
187
189
  ## License
package/README.zh.md ADDED
@@ -0,0 +1,191 @@
1
+ # 💬 dsh-multi-chat —— 多对话,一屏驾驭
2
+
3
+ [English](README.md) | **中文**
4
+
5
+ <p align="center">
6
+ <a href="https://www.npmjs.com/package/dsh-multi-chat"><img src="https://img.shields.io/npm/v/dsh-multi-chat" alt="npm version"></a>
7
+ <a href="https://www.npmjs.com/package/dsh-multi-chat"><img src="https://img.shields.io/npm/dm/dsh-multi-chat" alt="npm downloads"></a>
8
+ <a href="https://github.com/daetz-coder/dsh-multi-chat/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="license"></a>
9
+ <a href="https://github.com/topics/dsh-plugin"><img src="https://img.shields.io/badge/dsh--plugin-community-brightgreen" alt="dsh-plugin"></a>
10
+ </p>
11
+
12
+ > **在 DeepSeek Harness 里同时开 N 个对话,并排盯住每一个 Agent 的实时进度,还能用手机/平板躺着看。** 一个浏览器,从「一次一个对话」升级成「全景多对话驾驶舱」。
13
+
14
+ 给 [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) 官方 Web 界面装上一面**多窗口墙**:在一张网格里同时显示 N 个正在运行的 DSH 对话实例(每个实例独立跑一个任务),所有 Agent 的实时进度、对话、输出**一眼尽收**,不用在无数标签页/窗口之间切来切去。
15
+
16
+ ## ✨ 它能做什么
17
+
18
+ | 能力 | 说明 |
19
+ |------|------|
20
+ | 📺 **多窗口** | 侧边栏一键进入,右侧对话区原位变成窗口网格,一个端口一格,并排看全部任务 |
21
+ | 🔍 **自动发现** | 扫描端口区间自动发现正在运行的 DSH 实例,也可手动管理 |
22
+ | ➕ **一键新建窗口** | 墙内直接启动全新 DSH 实例,凑成你的多对话矩阵 |
23
+ | 📱 **手机访问** | 点「手机访问」自动起一个**内置带口令认证的局域网网关**,手机打开 URL、输入口令即可看进度 |
24
+ | 🛑 **窗口控制** | 单窗口放大、刷新、新标签页打开、关闭实例、列数切换(自动/1/2/3/4/6)|
25
+
26
+ > **多对话 = 多端口。** 启动 N 个 `dsh web --port <n>`,每个实例独立跑一个对话/任务;在任意一个实例里打开多窗口墙,即可并排看到全部。
27
+
28
+ ## 📸 运行效果
29
+
30
+ **🖥️ Windows · 双对话并排** —— 两个正在运行的 DSH 实例并排列出,每格都是完整的官方对话界面,带实时在线状态点与单窗控制(放大 / 刷新 / 新标签页 / 移除):
31
+
32
+ ![Windows 双对话:两个 DSH 实例并排显示](assets/01-windows-dual-chat.png)
33
+
34
+ **📱 iPad · 双对话移动端** —— 同一局域网内,iPad 打开带口令认证的网关地址,即可在平板上一屏并排盯住两个 Agent 的实时进度:
35
+
36
+ ![iPad 双对话:平板端并排显示两个 DSH 实例](assets/02-ipad-dual-chat.png)
37
+
38
+ **🖥️ Windows · 三对话全景** —— 3 列网格并排显示 3 个正在运行的实例,一屏尽收全部 Agent,把「一次一个对话」升级成「全景多对话驾驶舱」:
39
+
40
+ ![Windows 三对话:3 列网格并排显示 3 个 DSH 实例](assets/03-windows-triple-chat.png)
41
+
42
+ ## 🚀 30 秒上手
43
+
44
+ ```bash
45
+ # 1. 安装(npm / npx,免手工打包补丁)
46
+ npx dsh-multi-chat install
47
+
48
+ # 2. 启动几个实例
49
+ npx dsh-multi-chat start --ports 3080,3081,3082
50
+
51
+ # 3. 打开任意实例,点侧边栏底部「多窗口」→ 完成 🎉
52
+ ```
53
+
54
+ ## 为什么这样做
55
+
56
+ - **不改动任何官方逻辑**:插件只注册两个**增量列表槽位**(`conversation.view` 视图环条目、`sidebar.footer.action` 侧边栏快捷入口)和五个只读 JSON 路由(`/multi/api/ports`、`/multi/api/status`、`/multi/api/stop`、`/multi/api/create`、`/multi/api/link`)。不替换任何既有槽位、不改写任何行、不触碰会话/代理/工具等核心逻辑。
57
+ - **界面就是官方界面**:墙是官方视图环的一个视图,渲染在对话主面板内(不是弹层),主题、字号、图标、控件全部走官方 `--dsw-*` token 与官方 primitives(Button/Input/Menu/StateDot)。
58
+ - **递归防护**:墙永远不嵌入自身端口;被嵌入页面带 `?multi-wall=embed` 标记,不注册任何墙界面,杜绝「墙中墙」无限递归。
59
+ - **最小改动**:新增一个 client 插件包 + 一个 patch 行。
60
+
61
+ ## 目录结构
62
+
63
+ ```
64
+ plugin/dsh-client-ui-multi-wall/ # 官方规范 client 插件包(node half + browser half)
65
+ lib/ # 已构建产物(lib/index.js + lib/client.js + 类型)
66
+ src/ # 源码(与官方 monorepo packages/client/ui-multi-wall 一致)
67
+ patches/multi-wall.yml # 启用插件的 cordis.patch.yml insert 行
68
+ scripts/
69
+ install-plugin.ps1 # 打包 + 装进 profile + 追加 patch + 提示重启
70
+ start-multi.ps1 / stop-multi.ps1 # 启停多个 dsh web 实例(-Remote 可带认证网关)
71
+ gateway.mjs # 带令牌认证 / 可选 TLS 的反向代理网关(手机/远程访问)
72
+ gateway-hidden.vbs # 无窗口启动器:用隐藏窗口方式启动 gateway.mjs(不弹控制台)
73
+ gateway-start.ps1 / gateway-stop.ps1 # 一键静默启动/停止网关
74
+ bin/dsh-multi-chat.mjs # 跨平台 npx CLI(install/start/stop/gateway)
75
+ harness-src/ # 官方 deepseek-harness 源码(开发/构建用)
76
+ ```
77
+
78
+ ## 安装与启用(Windows)
79
+
80
+ ```powershell
81
+ # 1) 打包并装进 web profile,自动追加 patch 行
82
+ .\scripts\install-plugin.ps1
83
+
84
+ # 2) 重启 dsh web,打开任意实例
85
+ dsh web --port 3084
86
+ # 浏览器打开 http://127.0.0.1:3084 ,侧边栏底部出现「多窗口」按钮
87
+ ```
88
+
89
+ 或手动:
90
+
91
+ ```bash
92
+ cd plugin/dsh-client-ui-multi-wall && npm pack # 得到 tarball
93
+ dsh plugin --profile web add <tarball> # 装进 profile
94
+ # 把 patches/multi-wall.yml 的 insert 行加进 ~/.dsh/profiles/web/cordis.patch.yml
95
+ ```
96
+
97
+ ## 使用
98
+
99
+ 1. 先启动若干实例:`.\scripts\start-multi.ps1 -Ports "3080,3081,3082,3084"`(或手动 `dsh web --port <n>`)。
100
+ 2. 打开任意实例,点侧边栏底部的「多窗口」快捷入口(或点对话区头部的「多窗口」标签页)。
101
+ 3. 墙视图内:自动发现实例(自动排除自身端口)、列数切换(自动/1/2/3/4/6,默认横向铺满)、点标题放大、⟳ 单独刷新、↗ 新标签页打开、✕ 从视图移除、全部刷新、实时在线状态点。布局保存在 localStorage。
102
+ 4. 退出墙:点工具栏**右上角的「退出」按钮**,一键切回对话视图。
103
+
104
+ ## 手机 / 远程访问(内置认证网关)
105
+
106
+ 官方 `dsh web` 出于安全**刻意禁止 `--host 0.0.0.0`**(会向网络暴露远程代码执行)。本插件内置了一个**带令牌认证的内联网关**:点工具栏「手机访问」按钮,它会**自动**为本实例启动一个网关(监听 `0.0.0.0`,反向代理到 `127.0.0.1:<本实例端口>`),并返回局域网 URL + 登录口令。
107
+
108
+ ```text
109
+ 点击「手机访问」→ 得到:
110
+ 手机在同一网络时可用:http://10.105.7.204:9477 口令:2efb23eade16
111
+ ```
112
+
113
+ 手机打开该 URL、输入口令即可进入完整 DSH 界面。网关的安全模型:
114
+
115
+ - HMAC 签名的 HttpOnly/SameSite 会话 Cookie(默认 12h),`?token=` 供脚本快捷使用,按 IP 限流登录失败
116
+ - 所有代理请求把 Host/Origin 重写为回环目标,官方 `/api` 浏览器信任栅栏(DNS-rebinding 防线)判定为本地请求,无需重启加 `--trusted-host`
117
+ - WebSocket 升级与 SSE 流原样透传
118
+ - 目标端口撞上 Windows 排除段或已占用时,自动回退到 OS 分配的空闲端口
119
+
120
+ > 也有独立的 `scripts/gateway.mjs`(带可选 TLS)供进阶场景手动使用。
121
+
122
+ ## 分发与安装
123
+
124
+ 仓库内置跨平台 CLI `dsh-multi-chat`(`bin/dsh-multi-chat.mjs`),下面三种渠道都可安装。CLI 的 `install` 会探测 `$DSH_HOME`(缺省 `~/.dsh`)并幂等地追加启用 patch(与 `install-plugin.ps1` 行为一致)。
125
+
126
+ ### 渠道一:npm / npx(推荐,最省事)
127
+
128
+ ```bash
129
+ # 发布到 npm 后,任意机器一句话安装
130
+ npx dsh-multi-chat install
131
+
132
+ # 或直接 npx 跑单条命令(无需安装)
133
+ npx dsh-multi-chat start --remote --token <口令> --ports 3080,3081
134
+ npx dsh-multi-chat gateway --target 127.0.0.1:3080 --token <口令>
135
+ ```
136
+
137
+ 维护者发布:`npm publish`(无作用域公开包 `dsh-multi-chat`)。
138
+
139
+ ### 渠道二:GitHub Release
140
+
141
+ 从 [Releases](https://github.com/daetz-coder/dsh-multi-chat/releases) 下载源码 zip/tarball,解压后进目录:
142
+
143
+ ```bash
144
+ node bin/dsh-multi-chat.mjs install # 打包 + dsh plugin add + 追加启用 patch
145
+ node bin/dsh-multi-chat.mjs start --ports 3080,3081
146
+ ```
147
+
148
+ > 打 tag 后,GitHub 会自动生成 source zip/tarball 资产;也可在 Release 附加 `npm pack` 产出的 `.tgz` 作为离线安装包。
149
+
150
+ ### 渠道三:git 直接安装
151
+
152
+ ```bash
153
+ git clone https://github.com/daetz-coder/dsh-multi-chat.git
154
+ cd dsh-multi-chat
155
+
156
+ node bin/dsh-multi-chat.mjs install # 装插件
157
+ node bin/dsh-multi-chat.mjs start --ports 3080,3081
158
+ node bin/dsh-multi-chat.mjs gateway --target 127.0.0.1:3080 --token <口令>
159
+ ```
160
+
161
+ ### 本仓库直接运行(开发)
162
+
163
+ ```bash
164
+ node bin/dsh-multi-chat.mjs install
165
+ node bin/dsh-multi-chat.mjs start --ports 3080,3081
166
+ node bin/dsh-multi-chat.mjs stop
167
+ node bin/dsh-multi-chat.mjs gateway --target 127.0.0.1:3080 --token <口令>
168
+ ```
169
+
170
+ ## 🔍 发现与生态
171
+
172
+ 本插件遵循 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 官方 client 插件规范:
173
+
174
+ - **在 GitHub 插件生态中被发现**:给本仓库添加 [`dsh-plugin`](https://github.com/topics/dsh-plugin) topic,即可在官方 [`dsh-plugin` topic 页](https://github.com/topics/dsh-plugin) 被搜索到(官方推荐的第三方插件发现方式)。
175
+ - **三语技术文档**:插件包 `plugin/dsh-client-ui-multi-wall/` 下提供 `README.md`(英文)、`README.zh.md`(中文)与 `README.i18n.yaml`(双语一致性记录),结构与官方 `packages/client/*` 插件一致。
176
+ - **纯增量、不碰核心**:只注册 `conversation.view` / `sidebar.footer.action` 两个列表槽位 + `/multi/api/*` 只读路由,不改动任何官方核心逻辑。
177
+
178
+ ## 在官方 monorepo 中的位置
179
+
180
+ `packages/client/ui-multi-wall` 是遵循官方 client 插件规范的包(tsconfig host/client 分离、tsdown clientBundle、locales zh/en、invariant 伴随、HMR 安全测试),并已接入 `packages/bundle/web-app` 的 dsh.client roster 与 `tsconfig.client.json` 聚合。构建:
181
+
182
+ ```bash
183
+ cd harness-src
184
+ pnpm install
185
+ pnpm --filter @deepseek-ai/dsh-client-ui-multi-wall bundle # 产出 lib/client.js
186
+ npx vitest run packages/client/ui-multi-wall # 14 项测试
187
+ ```
188
+
189
+ ## License
190
+
191
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-multi-chat",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "DSH 多对话:在官方 DeepSeek Harness Web 界面里以多窗口网格并排运行、监控多个对话实例,一屏盯住所有 Agent 的实时进度;内置带口令认证的局域网网关,手机/平板也能看。npx dsh-multi-chat install|start|stop|gateway",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -66,6 +66,8 @@
66
66
  "patches/",
67
67
  "assets/",
68
68
  "cordis.patch.yml",
69
+ "README.md",
70
+ "README.zh.md",
69
71
  "plugin/dsh-client-ui-multi-wall/package.json",
70
72
  "plugin/dsh-client-ui-multi-wall/README.md",
71
73
  "plugin/dsh-client-ui-multi-wall/lib/index.js",
@@ -0,0 +1,26 @@
1
+ # @deepseek-ai/dsh-client-ui-multi-wall
2
+
3
+ [English](README.md) | 中文
4
+
5
+ 多窗口墙插件(浏览器端 + 服务端):把每一个正在运行的 DSH 实例铺成一张网格,一个窗口对应一个 `127.0.0.1:<port>`,作为增量 `conversation.view` 视图环条目(order 20)渲染在官方 Web 界面内。该视图将对话区原位替换为一张 iframe 墙,每个 iframe 加载带 `?multi-wall=embed` 标记的原版 DSH Web UI,该标记会在被嵌入页面内抑制墙界面——从根上杜绝「墙中墙」无限递归。侧边栏底部新增 `sidebar.footer.action` 快捷入口(order 10),点击后触发头部本插件的视图环标签页,从而经官方视图环状态机完成切换,而非直接读写对话 store。
6
+
7
+ 墙的业务状态只有一个 store(`dsh.multi-wall`):已发现的端口列表与网格列数,跨视图切换与重载均可持久化。发现、探活、新建与关闭全部经服务端只读 JSON 路由完成——`/multi/api/ports`(自动发现,不排除任何端口,因此服务实例自身也可被监视)、`/multi/api/status`(指定端口列表的存活探活)、`/multi/api/stop`(终止所选实例)、`/multi/api/create`(启动全新实例,失败时回传子进程 stderr 等真实原因)、以及 `/multi/api/link`(手机访问)。
8
+
9
+ 手机/远程访问:官方 CLI 出于安全禁止 `--host 0.0.0.0`(会暴露远程代码执行),因此 `/multi/api/link` 会懒启动一个**内联带令牌认证的网关**(基于 `node:net` 的反向代理,HMAC 签名的会话 Cookie 登录,目标为 `127.0.0.1:<self-port>`,重写 Host/Origin 使官方 `/api` 浏览器信任栅栏判定为本地请求,并原样透传 WebSocket 升级)。该路由返回局域网 URL 与登录口令;返回的地址会过滤掉虚拟网卡(VMware/VirtualBox/WSL/Docker/Hyper-V/VPN 等,手机无法直达),并把物理网卡(Wi-Fi/以太网)排在最前。当目标端口落入 Windows 排除段或已被占用时,网关自动回退到 OS 分配的端口。
10
+
11
+ `/client` 导出接口包括插件本体(`apply`/`inject`)、`WallView`/`WallToggle` 组件、墙 store 工厂,以及注入的探活面类型。
12
+
13
+ ## 模型体验
14
+
15
+ 无影响。本插件不添加任何提示词内容、不产生会话事件、不注入任何模型可见输入;墙、其 store 以及所有 `/multi/api/*` 路由都只是 UI/发现面。无 token 或 KV-cache 影响。
16
+
17
+ #### KV Cache 影响
18
+
19
+ 无影响。本插件拥有的任何内容都不会进入历史尾部或模型上下文。
20
+
21
+ ## 已知限制与暂缓事项
22
+
23
+ - **仅回环窗口**——墙内嵌 `127.0.0.1:<port>` 并探测回环地址;绑定到非回环主机的实例需在外部自行配置。
24
+ - **探活仅做标记检查**——存活判定只检查所服务页面的 index 是否含 `__DSH_BOOT__`;同端口被非 DSH 服务占用会误报为「未发现」。
25
+ - **会话作用域视图**——墙是 `conversation.view` 视图环条目,故仅在存在活跃会话时渲染。
26
+ - **内联网关为明文 HTTP**——受信任的局域网内明文输送口令可接受;跨公网时优先使用 `publicUrl`(外部 TLS 网关)或 VPN。