dsh-multi-chat 0.6.8 → 1.0.1

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 (66) hide show
  1. package/README.md +88 -30
  2. package/README.zh.md +54 -30
  3. package/bin/dsh-multi-chat.mjs +5 -9
  4. package/lib/client.js +778 -0
  5. package/lib/client.js.map +1 -0
  6. package/{plugin/dsh-client-ui-multi-wall/lib → lib}/index.js +58 -70
  7. package/lib/tsconfig.tsbuildinfo +1 -0
  8. package/lib/types/client/WallToggle.d.ts.map +1 -0
  9. package/lib/types/client/WallToggle.js +36 -0
  10. package/lib/types/client/WallToggle.js.map +1 -0
  11. package/lib/types/client/WallView.d.ts.map +1 -0
  12. package/lib/types/client/WallView.js +218 -0
  13. package/lib/types/client/WallView.js.map +1 -0
  14. package/lib/types/client/index.d.ts.map +1 -0
  15. package/lib/types/client/index.js +59 -0
  16. package/lib/types/client/index.js.map +1 -0
  17. package/lib/types/client/locales.d.ts.map +1 -0
  18. package/lib/types/client/locales.js +96 -0
  19. package/lib/types/client/locales.js.map +1 -0
  20. package/lib/types/client/store.d.ts.map +1 -0
  21. package/lib/types/client/store.js +27 -0
  22. package/lib/types/client/store.js.map +1 -0
  23. package/lib/types/client/wall-injected.d.ts.map +1 -0
  24. package/lib/types/client/wall-injected.js +76 -0
  25. package/lib/types/client/wall-injected.js.map +1 -0
  26. package/lib/types/gateway.d.ts +57 -0
  27. package/lib/types/gateway.d.ts.map +1 -0
  28. package/lib/types/gateway.js +566 -0
  29. package/lib/types/gateway.js.map +1 -0
  30. package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/index.d.ts +80 -80
  31. package/lib/types/index.d.ts.map +1 -0
  32. package/lib/types/index.js +550 -0
  33. package/lib/types/index.js.map +1 -0
  34. package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/invariant.d.ts +3 -4
  35. package/lib/types/invariant.d.ts.map +1 -0
  36. package/lib/types/invariant.js +25 -0
  37. package/lib/types/invariant.js.map +1 -0
  38. package/package.json +49 -17
  39. package/patches/multi-wall.yml +1 -1
  40. package/scripts/install-plugin.ps1 +6 -9
  41. package/scripts/start-multi.ps1 +1 -1
  42. package/scripts/sync-vitest-paths.mjs +63 -0
  43. package/src/client/WallToggle.module.css +26 -0
  44. package/src/client/WallToggle.tsx +52 -0
  45. package/src/client/WallView.module.css +190 -0
  46. package/src/client/WallView.tsx +406 -0
  47. package/src/client/index.ts +103 -0
  48. package/src/client/locales.ts +100 -0
  49. package/src/client/store.ts +40 -0
  50. package/src/client/wall-injected.ts +123 -0
  51. package/src/css-modules.d.ts +5 -0
  52. package/src/gateway.ts +627 -0
  53. package/src/index.ts +618 -0
  54. package/src/invariant.ts +33 -0
  55. package/plugin/dsh-client-ui-multi-wall/README.md +0 -26
  56. package/plugin/dsh-client-ui-multi-wall/README.zh.md +0 -26
  57. package/plugin/dsh-client-ui-multi-wall/cordis.patch.yml +0 -7
  58. package/plugin/dsh-client-ui-multi-wall/lib/client.js +0 -781
  59. package/plugin/dsh-client-ui-multi-wall/lib/invariant.js +0 -27
  60. package/plugin/dsh-client-ui-multi-wall/package.json +0 -88
  61. /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/WallToggle.d.ts +0 -0
  62. /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/WallView.d.ts +0 -0
  63. /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/index.d.ts +0 -0
  64. /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/locales.d.ts +0 -0
  65. /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/store.d.ts +0 -0
  66. /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/wall-injected.d.ts +0 -0
package/README.md CHANGED
@@ -48,13 +48,16 @@ Install a **multi-window wall** into the official [DeepSeek Harness (DSH)](https
48
48
  ## 🚀 30-second quick start
49
49
 
50
50
  ```bash
51
- # 1. Install (npm / npx, no manual patch needed)
51
+ # 1. Install — ONE command straight from the npm registry (no CLI to download):
52
+ dsh plugin --profile web add dsh-multi-chat
53
+
54
+ # …or via the plugin's own npx CLI (packs a tarball and installs it):
52
55
  npx dsh-multi-chat install
53
56
 
54
57
  # 2. Start a few instances
55
58
  npx dsh-multi-chat start --ports 3080,3081,3082
56
59
 
57
- # 3. Open any instance and click "Multi-window" in the sidebar footer → done 🎉
60
+ # 3. (Re)start any instance and click "Multi-window" in the sidebar footer → done 🎉
58
61
  ```
59
62
 
60
63
  ## Why this approach
@@ -67,18 +70,16 @@ npx dsh-multi-chat start --ports 3080,3081,3082
67
70
  ## Directory layout
68
71
 
69
72
  ```
70
- plugin/dsh-client-ui-multi-wall/ # spec-compliant client plugin package (node half + browser half)
73
+ dsh-multi-chat/ # single-package structure
71
74
  lib/ # built artifacts (lib/index.js + lib/client.js + types)
72
- src/ # source (mirrors the official monorepo packages/client/ui-multi-wall)
73
- patches/multi-wall.yml # optional `--patch` overlay (usually not needed; the plugin auto-mounts via dsh.bundle)
74
- scripts/
75
- install-plugin.ps1 # pack + install into profile (DSH auto-mounts the bundle) + prompt restart
76
- start-multi.ps1 / stop-multi.ps1 # start/stop multiple dsh web instances (-Remote can carry an authenticated gateway)
77
- gateway.mjs # token-authenticated / optional-TLS reverse-proxy gateway (phone/remote access)
78
- gateway-hidden.vbs # no-window launcher: starts gateway.mjs hidden (no console flash)
79
- gateway-start.ps1 / gateway-stop.ps1 # one-shot silent start/stop of the gateway
80
- bin/dsh-multi-chat.mjs # cross-platform npx CLI (install/start/stop/gateway)
81
- harness-src/ # official deepseek-harness source (dev/build reference)
75
+ src/ # source (node half + browser half)
76
+ bin/dsh-multi-chat.mjs # cross-platform npx CLI (install/start/stop/gateway)
77
+ scripts/
78
+ install-plugin.ps1 # pack + install into profile (DSH auto-mounts the bundle)
79
+ start-multi.ps1 / stop-multi.ps1 # start/stop multiple dsh web instances
80
+ gateway.mjs # token-authenticated reverse-proxy gateway (phone/remote)
81
+ cordis.patch.yml # DSH bundle layer declaration
82
+ harness-src/ # official deepseek-harness source (dev/build reference)
82
83
  ```
83
84
 
84
85
  ## Install & enable (Windows)
@@ -96,14 +97,14 @@ dsh web --port 3084
96
97
  Or manual:
97
98
 
98
99
  ```bash
99
- cd plugin/dsh-client-ui-multi-wall && npm pack # produce a tarball
100
- dsh plugin --profile web add <tarball> # DSH adds the package to the bundle layer stack automatically
100
+ npm pack # produce a tarball (dsh-multi-chat-1.0.1.tgz)
101
+ dsh plugin --profile web add dsh-multi-chat-1.0.1.tgz # DSH adds the package to the bundle layer stack automatically
101
102
  ```
102
103
 
103
- Uninstall (one command, nothing manual to clean up):
104
+ Uninstall (one command, nothing manual to clean up — restart `dsh web` to unload it):
104
105
 
105
106
  ```bash
106
- dsh plugin --profile web remove @deepseek-ai/dsh-client-ui-multi-wall
107
+ dsh plugin --profile web remove dsh-multi-chat
107
108
  ```
108
109
 
109
110
  ## Usage
@@ -133,27 +134,49 @@ Open that URL on your phone and enter the token to reach the full DSH UI. The ga
133
134
 
134
135
  ## Distribution & install
135
136
 
136
- 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`).
137
+ `dsh-multi-chat` is published to npm (unscoped public package) and released on GitHub (source zip/tarball per tag). Every channel below ends in the same three things: the package lands as a dependency of the web profile, DSH reconciles it into the bundle layer stack (the package declares `dsh.bundle.patch`, so its own `cordis.patch.yml` is mounted automatically — no manual patch edits), and a `dsh web` restart loads the wall.
138
+
139
+ ### Install / uninstall cheat-sheet
140
+
141
+ | Channel | Install | Uninstall |
142
+ |---------|---------|-----------|
143
+ | **One-command (registry)** | `dsh plugin --profile web add dsh-multi-chat` | `dsh plugin --profile web remove dsh-multi-chat` |
144
+ | **npx (no download)** | `npx dsh-multi-chat install` | `dsh plugin --profile web remove dsh-multi-chat` |
145
+ | **Global CLI (npm)** | `npm i -g dsh-multi-chat` then `dsh-multi-chat install` | `dsh plugin --profile web remove dsh-multi-chat` then `npm rm -g dsh-multi-chat` |
146
+ | **Tarball (offline)** | `npm pack` → `dsh plugin --profile web add ./dsh-multi-chat-1.0.1.tgz` | `dsh plugin --profile web remove dsh-multi-chat` |
147
+ | **Git clone** | `node bin/dsh-multi-chat.mjs install` | `dsh plugin --profile web remove dsh-multi-chat` |
148
+
149
+ > `dsh plugin --profile web remove dsh-multi-chat` is the **single uninstall
150
+ > command for every channel**: it removes the dependency from the profile, and
151
+ > DSH strips it from the `dsh.profile.bundles` layer stack automatically
152
+ > (reconciled from the installed dependency set — see `dsh plugin --help`).
153
+ > Restart `dsh web` afterwards to unload the wall.
154
+
155
+ The repo also bundles a cross-platform CLI, `dsh-multi-chat` (`bin/dsh-multi-chat.mjs`). Its `install` command probes `$DSH_HOME` (default `~/.dsh`), packs the package into the profile's `plugins/` folder, and runs `dsh plugin --profile web add <tarball>` (same behavior as `install-plugin.ps1`).
137
156
 
138
157
  ### Channel 1: npm / npx (recommended, easiest)
139
158
 
140
159
  ```bash
141
- # After publishing to npm, one line installs on any machine
160
+ # Published on npm — one line installs on any machine (node + pnpm required)
142
161
  npx dsh-multi-chat install
143
162
 
144
- # Or run a single command straight from npx (no install needed)
163
+ # Or install the CLI globally, then install the plugin from anywhere
164
+ npm i -g dsh-multi-chat
165
+ dsh-multi-chat install
166
+
167
+ # Or run single commands straight from npx (no plugin install needed)
145
168
  npx dsh-multi-chat start --remote --token <token> --ports 3080,3081
146
169
  npx dsh-multi-chat gateway --target 127.0.0.1:3080 --token <token>
147
170
  ```
148
171
 
149
- Publishing (maintainer): `npm publish` (unscoped public package `dsh-multi-chat`).
172
+ Maintaining / republishing (maintainer): `npm publish` (unscoped public package `dsh-multi-chat`).
150
173
 
151
174
  ### Channel 2: GitHub Release
152
175
 
153
176
  Download the source zip/tarball from [Releases](https://github.com/daetz-coder/dsh-multi-chat/releases), unpack it, and cd in:
154
177
 
155
178
  ```bash
156
- node bin/dsh-multi-chat.mjs install # pack + dsh plugin add + append enable patch
179
+ node bin/dsh-multi-chat.mjs install # pack + dsh plugin add (see cheat-sheet)
157
180
  node bin/dsh-multi-chat.mjs start --ports 3080,3081
158
181
  ```
159
182
 
@@ -165,11 +188,13 @@ node bin/dsh-multi-chat.mjs start --ports 3080,3081
165
188
  git clone https://github.com/daetz-coder/dsh-multi-chat.git
166
189
  cd dsh-multi-chat
167
190
 
168
- node bin/dsh-multi-chat.mjs install # install the plugin
191
+ node bin/dsh-multi-chat.mjs install # pack + dsh plugin add (see cheat-sheet)
169
192
  node bin/dsh-multi-chat.mjs start --ports 3080,3081
170
193
  node bin/dsh-multi-chat.mjs gateway --target 127.0.0.1:3080 --token <token>
171
194
  ```
172
195
 
196
+ > For the one-command-on-this-machine flow, `dsh plugin --profile web add dsh-multi-chat` also works straight from a git clone — install the plugin _from_ the repo checkout without packaging it yourself.
197
+
173
198
  ### Running straight from this repo (development)
174
199
 
175
200
  ```bash
@@ -184,20 +209,53 @@ node bin/dsh-multi-chat.mjs gateway --target 127.0.0.1:3080 --token <token>
184
209
  This plugin follows the official [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) client plugin spec:
185
210
 
186
211
  - **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).
187
- - **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.
212
+ - **Bilingual technical docs**: this repo ships `README.md` (English) and `README.zh.md` (Chinese) at the root, matching the bilingual convention of official `packages/client/*` plugins.
188
213
  - **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.
189
214
 
190
- ## Where it lives in the official monorepo
215
+ ## Building from source
191
216
 
192
- `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:
217
+ The single-package layout uses `tsdown` for bundling and `tsc` for type declarations:
193
218
 
194
219
  ```bash
195
- cd harness-src
196
- pnpm install
197
- pnpm --filter @deepseek-ai/dsh-client-ui-multi-wall bundle # produces lib/client.js
198
- npx vitest run packages/client/ui-multi-wall # 14 tests
220
+ npm install
221
+ npm run build # tsc + tsdown → lib/
222
+ npm test # vitest (browser half in jsdom + node half)
199
223
  ```
200
224
 
225
+ ## Testing
226
+
227
+ The unit suite (`tests/browser-plugin.client.spec.tsx`, 20 specs) exercises the
228
+ browser half (view-ring entry, sidebar shortcut, wall store, recursion guard,
229
+ HMR disposal) against a real cordis Context in jsdom, plus the node half
230
+ (probe routes, config schema, stop semantics).
231
+
232
+ The specs import `@deepseek-ai/*` platform packages whose published versions
233
+ lag the snapshot this plugin was written against, so tests resolve them to the
234
+ **vendored harness sources** in `harness-src/` instead of npm:
235
+
236
+ 1. First install the vendored workspace once (it is a full DSH checkout):
237
+ ```bash
238
+ cd harness-src && pnpm install && cd ..
239
+ ```
240
+ 2. `tsconfig.vitest.json` carries the workspace's `tsconfig.base.json` paths
241
+ map (rewritten with a `harness-src/` prefix) so every `@deepseek-ai/*`
242
+ import resolves to sources — never to unbuilt `lib/` outputs. Regenerate it
243
+ after updating the vendored checkout:
244
+ ```bash
245
+ node scripts/sync-vitest-paths.mjs
246
+ ```
247
+ 3. `vitest.config.ts` feeds that map to `vite-tsconfig-paths` and dedupes
248
+ `react`/`react-dom` so the component specs and `@testing-library/react`
249
+ share one React instance. Then:
250
+
251
+ ```bash
252
+ npm test
253
+ ```
254
+
255
+ > `npm run build`'s `tsc` step resolves `@deepseek-ai/*` types from the
256
+ > installed workspace (or from npm-installed versions on a machine with the
257
+ > matching snapshot); the committed `lib/` is the reference output.
258
+
201
259
  ## License
202
260
 
203
261
  MIT
package/README.zh.md CHANGED
@@ -48,13 +48,16 @@
48
48
  ## 🚀 30 秒上手
49
49
 
50
50
  ```bash
51
- # 1. 安装(npm / npx,免手工打包补丁)
51
+ # 1. 安装 —— 从 npm 官方源一条命令搞定(无需下载任何 CLI):
52
+ dsh plugin --profile web add dsh-multi-chat
53
+
54
+ # ……或通过插件自带的 npx CLI(先打包再安装):
52
55
  npx dsh-multi-chat install
53
56
 
54
57
  # 2. 启动几个实例
55
58
  npx dsh-multi-chat start --ports 3080,3081,3082
56
59
 
57
- # 3. 打开任意实例,点侧边栏底部「多窗口」→ 完成 🎉
60
+ # 3.(重新)打开任意实例,点侧边栏底部「多窗口」→ 完成 🎉
58
61
  ```
59
62
 
60
63
  ## 为什么这样做
@@ -67,18 +70,16 @@ npx dsh-multi-chat start --ports 3080,3081,3082
67
70
  ## 目录结构
68
71
 
69
72
  ```
70
- plugin/dsh-client-ui-multi-wall/ # 官方规范 client 插件包(node half + browser half)
73
+ dsh-multi-chat/ # 单包结构
71
74
  lib/ # 已构建产物(lib/index.js + lib/client.js + 类型)
72
- src/ # 源码(与官方 monorepo packages/client/ui-multi-wall 一致)
73
- patches/multi-wall.yml # 可选 `--patch` overlay(通常不需要;插件经 dsh.bundle 自动挂载)
74
- scripts/
75
- install-plugin.ps1 # 打包 + 装进 profile(DSH 自动挂载 bundle 层)+ 提示重启
76
- start-multi.ps1 / stop-multi.ps1 # 启停多个 dsh web 实例(-Remote 可带认证网关)
77
- gateway.mjs # 带令牌认证 / 可选 TLS 的反向代理网关(手机/远程访问)
78
- gateway-hidden.vbs # 无窗口启动器:用隐藏窗口方式启动 gateway.mjs(不弹控制台)
79
- gateway-start.ps1 / gateway-stop.ps1 # 一键静默启动/停止网关
80
- bin/dsh-multi-chat.mjs # 跨平台 npx CLI(install/start/stop/gateway)
81
- harness-src/ # 官方 deepseek-harness 源码(开发/构建用)
75
+ src/ # 源码(node half + browser half)
76
+ bin/dsh-multi-chat.mjs # 跨平台 npx CLI(install/start/stop/gateway)
77
+ scripts/
78
+ install-plugin.ps1 # 打包 + 装进 profile(DSH 自动挂载 bundle 层)
79
+ start-multi.ps1 / stop-multi.ps1 # 启停多个 dsh web 实例
80
+ gateway.mjs # 带令牌认证的反向代理网关(手机/远程访问)
81
+ cordis.patch.yml # DSH bundle 层声明
82
+ harness-src/ # 官方 deepseek-harness 源码(开发/构建用)
82
83
  ```
83
84
 
84
85
  ## 安装与启用(Windows)
@@ -96,14 +97,14 @@ dsh web --port 3084
96
97
  或手动:
97
98
 
98
99
  ```bash
99
- cd plugin/dsh-client-ui-multi-wall && npm pack # 得到 tarball
100
- dsh plugin --profile web add <tarball> # DSH 自动把包加入 bundle 层栈
100
+ npm pack # 得到 tarball (dsh-multi-chat-1.0.1.tgz)
101
+ dsh plugin --profile web add dsh-multi-chat-1.0.1.tgz # DSH 自动把包加入 bundle 层栈
101
102
  ```
102
103
 
103
- 卸载(一条命令,无需手动清理任何文件):
104
+ 卸载(一条命令,无需手动清理任何文件 —— 重启 `dsh web` 后生效):
104
105
 
105
106
  ```bash
106
- dsh plugin --profile web remove @deepseek-ai/dsh-client-ui-multi-wall
107
+ dsh plugin --profile web remove dsh-multi-chat
107
108
  ```
108
109
 
109
110
  ## 使用
@@ -133,27 +134,47 @@ dsh plugin --profile web remove @deepseek-ai/dsh-client-ui-multi-wall
133
134
 
134
135
  ## 分发与安装
135
136
 
136
- 仓库内置跨平台 CLI `dsh-multi-chat`(`bin/dsh-multi-chat.mjs`),下面三种渠道都可安装。CLI 的 `install` 会探测 `$DSH_HOME`(缺省 `~/.dsh`)并幂等地追加启用 patch(与 `install-plugin.ps1` 行为一致)。
137
+ `dsh-multi-chat` 已发布到 npm(无作用域公开包),并在 GitHub 按 tag 发布 Release(源码 zip/tarball)。下面每条渠道殊途同归:包成为 web profile 的依赖 → DSH 自动调和进 bundle 层栈(包声明了 `dsh.bundle.patch`,自带 `cordis.patch.yml` 自动挂载,无需手改任何文件)→ 重启 `dsh web` 生效。
138
+
139
+ ### 安装 / 卸载速查表
140
+
141
+ | 渠道 | 安装 | 卸载 |
142
+ |------|------|------|
143
+ | **一条命令(npm 官方源)** | `dsh plugin --profile web add dsh-multi-chat` | `dsh plugin --profile web remove dsh-multi-chat` |
144
+ | **npx(免下载)** | `npx dsh-multi-chat install` | `dsh plugin --profile web remove dsh-multi-chat` |
145
+ | **全局 CLI(npm)** | `npm i -g dsh-multi-chat` 然后 `dsh-multi-chat install` | `dsh plugin --profile web remove dsh-multi-chat` 然后 `npm rm -g dsh-multi-chat` |
146
+ | **Tarball(离线)** | `npm pack` → `dsh plugin --profile web add ./dsh-multi-chat-1.0.1.tgz` | `dsh plugin --profile web remove dsh-multi-chat` |
147
+ | **Git clone** | `node bin/dsh-multi-chat.mjs install` | `dsh plugin --profile web remove dsh-multi-chat` |
148
+
149
+ > `dsh plugin --profile web remove dsh-multi-chat` 是**所有渠道统一的卸载命令**:
150
+ > 它从 profile 移除依赖,DSH 会自动把它从 `dsh.profile.bundles` 层栈里剔除
151
+ > (层栈按已安装依赖实时调和,详见 `dsh plugin --help`)。之后重启 `dsh web` 卸载生效。
152
+
153
+ 仓库还内置了一个跨平台 CLI `dsh-multi-chat`(`bin/dsh-multi-chat.mjs`)。它的 `install` 命令会探测 `$DSH_HOME`(缺省 `~/.dsh`),把包打包进 profile 的 `plugins/` 目录,再执行 `dsh plugin --profile web add <tarball>`(与 `install-plugin.ps1` 行为一致)。
137
154
 
138
155
  ### 渠道一:npm / npx(推荐,最省事)
139
156
 
140
157
  ```bash
141
- # 发布到 npm 后,任意机器一句话安装
158
+ # 已发布到 npm —— 任意机器一句话安装(需 node + pnpm)
142
159
  npx dsh-multi-chat install
143
160
 
144
- # 或直接 npx 跑单条命令(无需安装)
161
+ # 或全局装 CLI,再从任意目录安装插件
162
+ npm i -g dsh-multi-chat
163
+ dsh-multi-chat install
164
+
165
+ # 或直接用 npx 跑单条命令(无需安装插件)
145
166
  npx dsh-multi-chat start --remote --token <口令> --ports 3080,3081
146
167
  npx dsh-multi-chat gateway --target 127.0.0.1:3080 --token <口令>
147
168
  ```
148
169
 
149
- 维护者发布:`npm publish`(无作用域公开包 `dsh-multi-chat`)。
170
+ 维护者发布/再发布:`npm publish`(无作用域公开包 `dsh-multi-chat`)。
150
171
 
151
172
  ### 渠道二:GitHub Release
152
173
 
153
174
  从 [Releases](https://github.com/daetz-coder/dsh-multi-chat/releases) 下载源码 zip/tarball,解压后进目录:
154
175
 
155
176
  ```bash
156
- node bin/dsh-multi-chat.mjs install # 打包 + dsh plugin add + 追加启用 patch
177
+ node bin/dsh-multi-chat.mjs install # 打包 + dsh plugin add(见速查表)
157
178
  node bin/dsh-multi-chat.mjs start --ports 3080,3081
158
179
  ```
159
180
 
@@ -165,11 +186,13 @@ node bin/dsh-multi-chat.mjs start --ports 3080,3081
165
186
  git clone https://github.com/daetz-coder/dsh-multi-chat.git
166
187
  cd dsh-multi-chat
167
188
 
168
- node bin/dsh-multi-chat.mjs install # 装插件
189
+ node bin/dsh-multi-chat.mjs install # 打包 + dsh plugin add(见速查表)
169
190
  node bin/dsh-multi-chat.mjs start --ports 3080,3081
170
191
  node bin/dsh-multi-chat.mjs gateway --target 127.0.0.1:3080 --token <口令>
171
192
  ```
172
193
 
194
+ > 在 git clone 出来的仓库里也可以直接走一条命令:`dsh plugin --profile web add dsh-multi-chat` —— 直接从已发布版本安装,无需自己打包。
195
+
173
196
  ### 本仓库直接运行(开发)
174
197
 
175
198
  ```bash
@@ -184,20 +207,21 @@ node bin/dsh-multi-chat.mjs gateway --target 127.0.0.1:3080 --token <口令>
184
207
  本插件遵循 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 官方 client 插件规范:
185
208
 
186
209
  - **在 GitHub 插件生态中被发现**:给本仓库添加 [`dsh-plugin`](https://github.com/topics/dsh-plugin) topic,即可在官方 [`dsh-plugin` topic 页](https://github.com/topics/dsh-plugin) 被搜索到(官方推荐的第三方插件发现方式)。
187
- - **三语技术文档**:插件包 `plugin/dsh-client-ui-multi-wall/` 下提供 `README.md`(英文)、`README.zh.md`(中文)与 `README.i18n.yaml`(双语一致性记录),结构与官方 `packages/client/*` 插件一致。
210
+ - **双语技术文档**:本仓库在根目录提供 `README.md`(英文)和 `README.zh.md`(中文),与官方 `packages/client/*` 插件的双语惯例一致。
188
211
  - **纯增量、不碰核心**:只注册 `conversation.view` / `sidebar.footer.action` 两个列表槽位 + `/multi/api/*` 只读路由,不改动任何官方核心逻辑。
189
212
 
190
- ## 在官方 monorepo 中的位置
213
+ ## 从源码构建
191
214
 
192
- `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` 聚合。构建:
215
+ 单包结构使用 `tsdown` 进行打包,`tsc` 生成类型声明:
193
216
 
194
217
  ```bash
195
- cd harness-src
196
- pnpm install
197
- pnpm --filter @deepseek-ai/dsh-client-ui-multi-wall bundle # 产出 lib/client.js
198
- npx vitest run packages/client/ui-multi-wall # 14 项测试
218
+ npm install
219
+ npm run build # tsc + tsdown → lib/
220
+ npx vitest run # 测试
199
221
  ```
200
222
 
223
+ 开发时可借助 `harness-src/` 目录(完整 DSH 源码)作为构建和参考工作区。
224
+
201
225
  ## License
202
226
 
203
227
  MIT
@@ -29,7 +29,6 @@ import { fileURLToPath } from 'node:url'
29
29
 
30
30
  const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..')
31
31
  const STATE_FILE = join(ROOT, '.wall-pids.json')
32
- const PLUGIN_DIR = join(ROOT, 'plugin', 'dsh-client-ui-multi-wall')
33
32
 
34
33
  // Node ≥22 warns about spawn(shell:true, args[]) (DEP0190). The args here are
35
34
  // fixed strings we control (numeric ports, our own paths), so the warning is
@@ -123,11 +122,11 @@ const INSTALL_HELP = `dsh-multi-chat install — install the multi-window wall p
123
122
  Usage:
124
123
  dsh-multi-chat install [--profile web]
125
124
 
126
- Packs plugin/dsh-client-ui-multi-wall and installs the tarball into the profile
127
- with \`dsh plugin --profile <p> add\`. The plugin declares \`dsh.bundle.patch\`
125
+ Packs the dsh-multi-chat package and installs the tarball into the profile
126
+ with \`dsh plugin --profile <p> add\`. The package declares \`dsh.bundle.patch\`
128
127
  (pointing at its own cordis.patch.yml), so DSH mounts it automatically as a
129
128
  bundle layer — no manual profile patch is needed. Restart dsh web afterwards.
130
- Uninstall with: dsh plugin --profile <p> remove @deepseek-ai/dsh-client-ui-multi-wall
129
+ Uninstall with: dsh plugin --profile <p> remove dsh-multi-chat
131
130
  `
132
131
 
133
132
  async function cmdInstall(args) {
@@ -137,17 +136,14 @@ async function cmdInstall(args) {
137
136
  else if (args[i] === '--help') { process.stdout.write(INSTALL_HELP); return }
138
137
  else throw new Error(`unknown install option: ${args[i]}`)
139
138
  }
140
- if (!existsSync(PLUGIN_DIR)) {
141
- throw new Error(`plugin directory not found: ${PLUGIN_DIR} — run from the dsh-multi-chat package root`)
142
- }
143
139
 
144
- // 1) pack the plugin tarball into a STABLE location under DSH home. The
140
+ // 1) pack the tarball into a STABLE location under DSH home. The
145
141
  // profile records a `file:` dependency on the tarball, so a temp directory
146
142
  // (deleted after install) would break every later `dsh plugin add` — the
147
143
  // tarball must outlive the CLI run. (npm pack is offline-safe.)
148
144
  const stableDir = join(dshHome(), 'profiles', profile, 'plugins')
149
145
  mkdirSync(stableDir, { recursive: true })
150
- const packOut = run('npm', ['pack', '--pack-destination', stableDir], { cwd: PLUGIN_DIR })
146
+ const packOut = run('npm', ['pack', '--pack-destination', stableDir], { cwd: ROOT })
151
147
  const tarballName = packOut.trim().split(/\r?\n/).pop()
152
148
  const tarball = join(stableDir, tarballName)
153
149
  if (!existsSync(tarball)) throw new Error('npm pack produced no tarball')