dsh-multi-chat 0.6.8 → 1.0.0

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 (63) hide show
  1. package/README.md +20 -21
  2. package/README.zh.md +20 -21
  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 +57 -69
  7. package/lib/tsconfig.tsbuildinfo +1 -0
  8. package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/WallToggle.d.ts +1 -1
  9. package/lib/types/client/WallToggle.d.ts.map +1 -0
  10. package/lib/types/client/WallToggle.js +36 -0
  11. package/lib/types/client/WallToggle.js.map +1 -0
  12. package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/WallView.d.ts +1 -1
  13. package/lib/types/client/WallView.d.ts.map +1 -0
  14. package/lib/types/client/WallView.js +218 -0
  15. package/lib/types/client/WallView.js.map +1 -0
  16. package/lib/types/client/index.d.ts.map +1 -0
  17. package/lib/types/client/index.js +59 -0
  18. package/lib/types/client/index.js.map +1 -0
  19. package/lib/types/client/locales.d.ts.map +1 -0
  20. package/lib/types/client/locales.js +96 -0
  21. package/lib/types/client/locales.js.map +1 -0
  22. package/lib/types/client/store.d.ts.map +1 -0
  23. package/lib/types/client/store.js +27 -0
  24. package/lib/types/client/store.js.map +1 -0
  25. package/lib/types/client/wall-injected.d.ts.map +1 -0
  26. package/lib/types/client/wall-injected.js +76 -0
  27. package/lib/types/client/wall-injected.js.map +1 -0
  28. package/lib/types/gateway.d.ts +57 -0
  29. package/lib/types/gateway.d.ts.map +1 -0
  30. package/lib/types/gateway.js +566 -0
  31. package/lib/types/gateway.js.map +1 -0
  32. package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/index.d.ts +1 -16
  33. package/lib/types/index.d.ts.map +1 -0
  34. package/lib/types/index.js +550 -0
  35. package/lib/types/index.js.map +1 -0
  36. package/lib/types/invariant.d.ts.map +1 -0
  37. package/lib/types/invariant.js +26 -0
  38. package/lib/types/invariant.js.map +1 -0
  39. package/package.json +41 -17
  40. package/scripts/install-plugin.ps1 +6 -9
  41. package/src/client/WallToggle.module.css +26 -0
  42. package/src/client/WallToggle.tsx +52 -0
  43. package/src/client/WallView.module.css +190 -0
  44. package/src/client/WallView.tsx +406 -0
  45. package/src/client/index.ts +103 -0
  46. package/src/client/locales.ts +100 -0
  47. package/src/client/store.ts +40 -0
  48. package/src/client/wall-injected.ts +123 -0
  49. package/src/css-modules.d.ts +5 -0
  50. package/src/gateway.ts +627 -0
  51. package/src/index.ts +618 -0
  52. package/src/invariant.ts +34 -0
  53. package/plugin/dsh-client-ui-multi-wall/README.md +0 -26
  54. package/plugin/dsh-client-ui-multi-wall/README.zh.md +0 -26
  55. package/plugin/dsh-client-ui-multi-wall/cordis.patch.yml +0 -7
  56. package/plugin/dsh-client-ui-multi-wall/lib/client.js +0 -781
  57. package/plugin/dsh-client-ui-multi-wall/lib/invariant.js +0 -27
  58. package/plugin/dsh-client-ui-multi-wall/package.json +0 -88
  59. /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/index.d.ts +0 -0
  60. /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/locales.d.ts +0 -0
  61. /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/store.d.ts +0 -0
  62. /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/wall-injected.d.ts +0 -0
  63. /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/invariant.d.ts +0 -0
package/README.md CHANGED
@@ -67,18 +67,16 @@ npx dsh-multi-chat start --ports 3080,3081,3082
67
67
  ## Directory layout
68
68
 
69
69
  ```
70
- plugin/dsh-client-ui-multi-wall/ # spec-compliant client plugin package (node half + browser half)
70
+ dsh-multi-chat/ # single-package structure
71
71
  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)
72
+ src/ # source (node half + browser half)
73
+ bin/dsh-multi-chat.mjs # cross-platform npx CLI (install/start/stop/gateway)
74
+ scripts/
75
+ install-plugin.ps1 # pack + install into profile (DSH auto-mounts the bundle)
76
+ start-multi.ps1 / stop-multi.ps1 # start/stop multiple dsh web instances
77
+ gateway.mjs # token-authenticated reverse-proxy gateway (phone/remote)
78
+ cordis.patch.yml # DSH bundle layer declaration
79
+ harness-src/ # official deepseek-harness source (dev/build reference)
82
80
  ```
83
81
 
84
82
  ## Install & enable (Windows)
@@ -96,14 +94,14 @@ dsh web --port 3084
96
94
  Or manual:
97
95
 
98
96
  ```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
97
+ npm pack # produce a tarball (dsh-multi-chat-1.0.0.tgz)
98
+ dsh plugin --profile web add dsh-multi-chat-1.0.0.tgz # DSH adds the package to the bundle layer stack automatically
101
99
  ```
102
100
 
103
101
  Uninstall (one command, nothing manual to clean up):
104
102
 
105
103
  ```bash
106
- dsh plugin --profile web remove @deepseek-ai/dsh-client-ui-multi-wall
104
+ dsh plugin --profile web remove dsh-multi-chat
107
105
  ```
108
106
 
109
107
  ## Usage
@@ -184,20 +182,21 @@ node bin/dsh-multi-chat.mjs gateway --target 127.0.0.1:3080 --token <token>
184
182
  This plugin follows the official [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) client plugin spec:
185
183
 
186
184
  - **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.
185
+ - **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
186
  - **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
187
 
190
- ## Where it lives in the official monorepo
188
+ ## Building from source
191
189
 
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:
190
+ The single-package layout uses `tsdown` for bundling and `tsc` for type declarations:
193
191
 
194
192
  ```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
193
+ npm install
194
+ npm run build # tsc + tsdown → lib/
195
+ npx vitest run # tests
199
196
  ```
200
197
 
198
+ For development against the official harness, the `harness-src/` directory is a full DSH checkout used as the build/reference workspace.
199
+
201
200
  ## License
202
201
 
203
202
  MIT
package/README.zh.md CHANGED
@@ -67,18 +67,16 @@ npx dsh-multi-chat start --ports 3080,3081,3082
67
67
  ## 目录结构
68
68
 
69
69
  ```
70
- plugin/dsh-client-ui-multi-wall/ # 官方规范 client 插件包(node half + browser half)
70
+ dsh-multi-chat/ # 单包结构
71
71
  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 源码(开发/构建用)
72
+ src/ # 源码(node half + browser half)
73
+ bin/dsh-multi-chat.mjs # 跨平台 npx CLI(install/start/stop/gateway)
74
+ scripts/
75
+ install-plugin.ps1 # 打包 + 装进 profile(DSH 自动挂载 bundle 层)
76
+ start-multi.ps1 / stop-multi.ps1 # 启停多个 dsh web 实例
77
+ gateway.mjs # 带令牌认证的反向代理网关(手机/远程访问)
78
+ cordis.patch.yml # DSH bundle 层声明
79
+ harness-src/ # 官方 deepseek-harness 源码(开发/构建用)
82
80
  ```
83
81
 
84
82
  ## 安装与启用(Windows)
@@ -96,14 +94,14 @@ dsh web --port 3084
96
94
  或手动:
97
95
 
98
96
  ```bash
99
- cd plugin/dsh-client-ui-multi-wall && npm pack # 得到 tarball
100
- dsh plugin --profile web add <tarball> # DSH 自动把包加入 bundle 层栈
97
+ npm pack # 得到 tarball (dsh-multi-chat-1.0.0.tgz)
98
+ dsh plugin --profile web add dsh-multi-chat-1.0.0.tgz # DSH 自动把包加入 bundle 层栈
101
99
  ```
102
100
 
103
101
  卸载(一条命令,无需手动清理任何文件):
104
102
 
105
103
  ```bash
106
- dsh plugin --profile web remove @deepseek-ai/dsh-client-ui-multi-wall
104
+ dsh plugin --profile web remove dsh-multi-chat
107
105
  ```
108
106
 
109
107
  ## 使用
@@ -184,20 +182,21 @@ node bin/dsh-multi-chat.mjs gateway --target 127.0.0.1:3080 --token <口令>
184
182
  本插件遵循 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 官方 client 插件规范:
185
183
 
186
184
  - **在 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/*` 插件一致。
185
+ - **双语技术文档**:本仓库在根目录提供 `README.md`(英文)和 `README.zh.md`(中文),与官方 `packages/client/*` 插件的双语惯例一致。
188
186
  - **纯增量、不碰核心**:只注册 `conversation.view` / `sidebar.footer.action` 两个列表槽位 + `/multi/api/*` 只读路由,不改动任何官方核心逻辑。
189
187
 
190
- ## 在官方 monorepo 中的位置
188
+ ## 从源码构建
191
189
 
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` 聚合。构建:
190
+ 单包结构使用 `tsdown` 进行打包,`tsc` 生成类型声明:
193
191
 
194
192
  ```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 项测试
193
+ npm install
194
+ npm run build # tsc + tsdown → lib/
195
+ npx vitest run # 测试
199
196
  ```
200
197
 
198
+ 开发时可借助 `harness-src/` 目录(完整 DSH 源码)作为构建和参考工作区。
199
+
201
200
  ## License
202
201
 
203
202
  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')