@qzsy/dsh-bridge 0.0.0-stage → 2.18.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 (77) hide show
  1. package/CHANGELOG.md +1107 -0
  2. package/LICENSE +21 -0
  3. package/README.en.md +488 -0
  4. package/README.md +509 -2
  5. package/client/build.mjs +43 -0
  6. package/client/client.js +9864 -0
  7. package/client/host-families.js +442 -0
  8. package/client/index.js +6883 -0
  9. package/client/locales.mjs +242 -0
  10. package/client/mobile-styles.js +1299 -0
  11. package/client/mobile-yield.js +219 -0
  12. package/client/panel-locales.mjs +777 -0
  13. package/client/picker-yield.js +77 -0
  14. package/client/resource-url-compat.js +90 -0
  15. package/client/settings-nav-icon.js +105 -0
  16. package/client/theme-tokens.js +49 -0
  17. package/client/tunnel-guard.js +46 -0
  18. package/client/unlock-manager.js +144 -0
  19. package/cordis.patch.yml +4 -0
  20. package/lib/auth/dsh-native-cookie.js +148 -0
  21. package/lib/auth/login-template.js +516 -0
  22. package/lib/auth/manager.js +596 -0
  23. package/lib/bridge-rpc-constants.js +66 -0
  24. package/lib/bridge-rpc.js +722 -0
  25. package/lib/cloudflared-manager.mjs +1277 -0
  26. package/lib/cloudflared-network-args.js +99 -0
  27. package/lib/cloudflared-process-scan.js +153 -0
  28. package/lib/compat.js +172 -0
  29. package/lib/connection-compat.js +115 -0
  30. package/lib/feishu/comment.js +50 -0
  31. package/lib/feishu/gateway.js +644 -0
  32. package/lib/feishu/index.js +432 -0
  33. package/lib/feishu/lark-bundled.mjs +131929 -0
  34. package/lib/feishu/markdown.js +148 -0
  35. package/lib/feishu/node.js +1152 -0
  36. package/lib/feishu/slash-commands.js +255 -0
  37. package/lib/index.js +3554 -0
  38. package/lib/platform/account-ops.js +248 -0
  39. package/lib/platform/activity.js +169 -0
  40. package/lib/platform/ask-user.js +293 -0
  41. package/lib/platform/base.js +147 -0
  42. package/lib/platform/changes-digest.js +93 -0
  43. package/lib/platform/commands.js +267 -0
  44. package/lib/platform/config-restore.js +78 -0
  45. package/lib/platform/conversation-bridge.js +1544 -0
  46. package/lib/platform/dsh-storage.js +222 -0
  47. package/lib/platform/index.js +10 -0
  48. package/lib/platform/instances.js +458 -0
  49. package/lib/platform/manager.js +130 -0
  50. package/lib/platform/message-split.js +229 -0
  51. package/lib/platform/session-catalog.js +405 -0
  52. package/lib/platform/session-config.js +52 -0
  53. package/lib/platform/stream-slices.js +21 -0
  54. package/lib/qq/gateway.js +1107 -0
  55. package/lib/qq/index.js +561 -0
  56. package/lib/qq/node.js +1153 -0
  57. package/lib/qq/qqbot-bundled.mjs +8273 -0
  58. package/lib/restart-helper.mjs +133 -0
  59. package/lib/saas/device-auth.mjs +366 -0
  60. package/lib/saas/tunnel-client.mjs +695 -0
  61. package/lib/security/log-sanitize.js +50 -0
  62. package/lib/security/path-validator.js +195 -0
  63. package/lib/security/rate-limiter.js +93 -0
  64. package/lib/session-strip.js +100 -0
  65. package/lib/sse-keepalive.js +115 -0
  66. package/lib/telegram/gateway.js +643 -0
  67. package/lib/telegram/index.js +255 -0
  68. package/lib/telegram/node.js +410 -0
  69. package/lib/tunnel-client.mjs +537 -0
  70. package/lib/wechat/gateway.js +1000 -0
  71. package/lib/wechat/index.js +282 -0
  72. package/lib/wechat/media.js +302 -0
  73. package/lib/wechat/node.js +360 -0
  74. package/llms.txt +36 -0
  75. package/locale/en.json +6 -0
  76. package/locale/zh.json +6 -0
  77. package/package.json +135 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 wenbin-wb
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md ADDED
@@ -0,0 +1,488 @@
1
+ # dsh-bridge · DSH Remote Access / Remote Control Plugin
2
+
3
+ <p align="center">
4
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/banner.webp" alt="dsh-bridge banner" width="100%" />
5
+ </p>
6
+
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/@wenbin_wb/dsh-bridge"><img src="https://img.shields.io/npm/v/@wenbin_wb/dsh-bridge.svg?style=flat-square&color=38bdf8&logo=npm" alt="npm version" /></a>
9
+ <a href="https://www.npmjs.com/package/@wenbin_wb/dsh-bridge"><img src="https://img.shields.io/npm/dt/@wenbin_wb/dsh-bridge.svg?style=flat-square&color=fbbf24&logo=npm" alt="npm downloads" /></a>
10
+ <a href="https://github.com/wenbin-wb/dsh-bridge/releases"><img src="https://img.shields.io/github/v/release/wenbin-wb/dsh-bridge?style=flat-square&color=10b981&logo=github" alt="GitHub release" /></a>
11
+ <a href="https://github.com/wenbin-wb/dsh-bridge/stargazers"><img src="https://img.shields.io/github/stars/wenbin-wb/dsh-bridge?style=flat-square&color=f43f5e&logo=github" alt="GitHub stars" /></a>
12
+ <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/Node.js-%E2%89%A522.19%20%7C%20%E2%89%A524-339933?style=flat-square&logo=node.js" alt="Node.js version" /></a>
13
+ <a href="LICENSE"><img src="https://img.shields.io/npm/l/@wenbin_wb/dsh-bridge?style=flat-square&color=a855f7" alt="license" /></a>
14
+ </p>
15
+
16
+ <p align="center">
17
+ <img src="https://img.shields.io/badge/Security-Access%20Auth%20%2B%20PBKDF2-6366f1?style=flat-square&logo=security" alt="Security" />
18
+ <img src="https://img.shields.io/badge/WeChat-ClawBot%20%7C%20iLink-07C160?style=flat-square&logo=wechat" alt="WeChat" />
19
+ <img src="https://img.shields.io/badge/QQ%20Bot-Official%20SDK-12B7F5?style=flat-square&logo=tencentqq" alt="QQ" />
20
+ <img src="https://img.shields.io/badge/Feishu-Channel%20SDK-00D6B9?style=flat-square&logo=lark" alt="Feishu" />
21
+ <img src="https://img.shields.io/badge/Telegram-Bot%20API-24A1DE?style=flat-square&logo=telegram" alt="Telegram" />
22
+ <img src="https://img.shields.io/badge/Cloudflare-Tunnel-F38020?style=flat-square&logo=cloudflare" alt="Cloudflare" />
23
+ <a href="https://dpharness.com/plugin/wenbin-wb/dsh-bridge" target="_blank" rel="noopener noreferrer"><img src="https://dpharness.com/badge/install/wenbin-wb/dsh-bridge.svg" alt="DSH Hub 实装验证" /></a>
24
+ </p>
25
+
26
+ <p align="center">
27
+ <a href="README.md">简体中文</a> | <b>English</b>
28
+ </p>
29
+
30
+ > **Multi-Channel Remote Access & Comprehensive Security Gateway Plugin for DeepSeek Harness (DSH remote access / remote control plugin, remote control)**
31
+ >
32
+ > Scan a QR code on your phone to continue using DeepSeek Harness anywhere. Whether relaxing on the sofa, commuting, or working across networks—no need to stay at your PC or set up complex servers.
33
+ >
34
+ > Seamlessly extends your local DeepSeek Harness instance to mobile web, standalone PWA app, secure public tunnels, and **WeChat / QQ / Feishu (Lark) / Telegram** bot matrix. Drive AI coding, run tasks, approve operations, and manage workspaces anytime, anywhere.
35
+ >
36
+ > 📖 Remote-access landing page: [docs/remote-connection.md](docs/remote-connection.md) | 🤖 Summary for AI: [llms.txt](llms.txt)
37
+
38
+ ---
39
+
40
+ ## Table of Contents
41
+
42
+ - [✨ Key Features](#-key-features)
43
+ - [📦 Requirements & Installation](#-requirements--installation)
44
+ - [🚀 Core Features & Usage Guide](#-core-features--usage-guide)
45
+ - [1. 🛜 LAN Access & Multi-NIC Smart Selection](#1-🛜-lan-access--multi-nic-smart-selection)
46
+ - [2. 🌐 Public Tunnels (Cloudflare & Custom)](#2-🌐-public-tunnels-cloudflare--custom)
47
+ - [3. 📱 Mobile Experience & Standalone PWA](#3-📱-mobile-experience--standalone-pwa)
48
+ - [4. 🗂️ Web Remote Workspace Directory Picker](#4-🗂️-web-remote-workspace-directory-picker)
49
+ - [5. 🔐 Comprehensive Access Security & Admin Lock](#5-🔐-comprehensive-access-security--admin-lock)
50
+ - [6. 🤖 All-in-One IM Bot Matrix (WeChat / QQ / Feishu / Telegram)](#6-🤖-all-in-one-im-bot-matrix-wechat--qq--feishu--telegram)
51
+ - [7. 📊 Maintenance Dashboard & Graceful Restart](#7-📊-maintenance-dashboard--graceful-restart)
52
+ - [💬 FAQ](#-faq)
53
+ - [🛠️ Development & Contribution](#️-development--contribution)
54
+ - [⭐ Star History](#-star-history)
55
+ - [📄 License](#-license)
56
+
57
+ ---
58
+
59
+ ## ✨ Key Features
60
+
61
+ - **🛜 Multi-NIC Smart Detection & Switching**: Automatically detects physical Wi-Fi, Ethernet, and virtual NICs (WSL/VMware/Docker); provides visual switching with persistent memory;
62
+ - **🌐 Dual-Mode Cloudflare Public Tunnels**: Zero-login 1-click random temporary domains or Cloudflare Named Tunnel Token with auto-start on boot; built-in idle keepalive for SSE streams so remote live channels are never cut by the link;
63
+ - **📡 Tunnel Observability**: end-to-end public-entry probe every 60s (DNS / TLS / edge / origin — catches "/ready looks fine but users cannot get in", flags suspected DNS poisoning with the resolved IP); shows the actual cloudflared path · version · source; warns when another cloudflared uses the same Tunnel Token;
64
+ - **📱 Native-Grade Mobile UI & PWA**: Centered session header, native drawer sidebar with `[|` fold icon, anti-overlap responsive layout, PWA install support;
65
+ - **🌏 UI Follows the DSH Language (Chinese / English)**: the settings panel (all five sections and cards), lock/unlock screens, remote workspace picker, command help and upgrade prompts switch language with `<html lang>`; the visitor login page (rendered before the DSH language is known) follows the browser's `Accept-Language` — no separate language setting;
66
+ - **🗂️ Web Remote Workspace Directory Picker**: Mobile/remote visits pop up responsive tree directory browser; localhost visits route to OS native dialogs; supports `/addworkspace` IM command;
67
+ - **🔐 Comprehensive Access Security & Dual Defenses**: QR code secret Token login, visitor password gate, independent admin anti-tamper lock; host physical privilege (`127.0.0.1`) & emergency terminal reset (`reset-auth`);
68
+ - **🤖 All-in-One IM Bot Matrix (WeChat / QQ / Feishu / Telegram)**: Multi-workspace dispatching, cross-restart session persistence, streaming Markdown typewriter, Card 2.0 interactive approvals, and bidirectional file sharing; every platform also reports a **per-turn change digest** (which files changed) and `/diff` exports a `.patch` attachment;
69
+ - **📊 Maintenance & Smooth Upgrades**: Host CPU / RAM / Uptime metrics, 1-click network diagnosis, JSON configuration backup & restore, npmmirror fast check & graceful restart.
70
+
71
+ ---
72
+
73
+ ## 📦 Requirements & Installation
74
+
75
+ ### Requirements
76
+
77
+ 1. **Node.js ≥ 22** (DSH requires `^22.19.0` or `≥ 24.0.0`)
78
+ 2. **dsh CLI available** (runnable directly in terminal)
79
+
80
+ ```bash
81
+ # Verify environment
82
+ node -v # v22.19+ or v24+
83
+ dsh --version
84
+ ```
85
+
86
+ ### DSH version compatibility
87
+
88
+ This plugin supports **both old and new DSH releases** — there is no need to pick a plugin version to match your harness.
89
+
90
+ | DSH version | Status |
91
+ | --- | --- |
92
+ | `0.1.0` ~ `0.1.1` | ✅ Supported (loopback-only RPC channel hardening) |
93
+ | `0.1.2` ~ `0.1.4` | ✅ Supported |
94
+ | `0.1.5-alpha.1` ~ `0.1.5-rc.2` | ✅ Supported (since v2.10.9) |
95
+ | `0.1.6` ~ `0.1.7` | ✅ Supported (v2.12.x adapts to the 0.1.7 storage-format and grid-layout changes; backward-compat regression covers the 0.1.6 single-file layout) |
96
+ | `0.2.0-rc.2` (Web, profile `web`) | ✅ Supported (since v2.12.4 host CSS-module class names are resolved at runtime; the full mobile UI acceptance suite passes on this version) |
97
+ | Desktop builtin host `0.2.0-rc.2` (profile `desktop`) | ✅ Supported (v2.12.4 fixes the mobile settings styles vanishing on the desktop host; **verified on a real desktop install**) |
98
+
99
+ > **About the built-in DSH authentication**: since `0.1.2`, `dsh web` ships browser authentication — it prints a URL carrying a one-time token (`http://127.0.0.1:3080/?token=…`), which is exchanged for a session cookie bound to the loopback address. Afterwards `/`, `/api` and every plugin RPC channel require that cookie.
100
+ >
101
+ > This is **complementary to, not a duplicate of**, this plugin's access-password gate: the built-in auth protects "the DSH process on local loopback", while this plugin's gate protects "remote access arriving over LAN or a public tunnel". The plugin's reverse proxy injects a valid loopback session cookie while forwarding, so phone / tunnel access needs **no** manual handling of DSH's `?token=` — just use it as documented on this page.
102
+
103
+ ### Installation
104
+
105
+ ```bash
106
+ # Method 1: Install from npm (Recommended)
107
+ dsh plugin --profile web add @wenbin_wb/dsh-bridge
108
+
109
+ # Method 2: Global-permission-free npx installation
110
+ npx --yes @deepseek-ai/dsh plugin --profile web add @wenbin_wb/dsh-bridge
111
+
112
+ # Method 3: Install from source
113
+ git clone https://github.com/wenbin-wb/dsh-bridge.git
114
+ dsh plugin --profile web add ./dsh-bridge
115
+ ```
116
+
117
+ ### Upgrade
118
+
119
+ ```bash
120
+ # Recommended: Click "🚀 1-Click Upgrade & Restart" in Web Settings > Remote Access
121
+
122
+ # Or force install latest version via CLI:
123
+ dsh plugin --profile web add @wenbin_wb/dsh-bridge@latest
124
+ ```
125
+
126
+ ### DSH Desktop (desktop app) installation
127
+
128
+ The desktop (Electron) app runs on its own `desktop` profile — **a separate plugin installation from the Web profile** — so install it there as well:
129
+
130
+ * **Option 1 · GUI (recommended)**: open **Settings → Plugins → "+ Add Plugin"** → type `@wenbin_wb/dsh-bridge` → on restricted networks pick the **China mainland mirror** as the install source → click **Install** → confirm the plugin is enabled under **Installed** → **restart DeepSeek Harness from the app menu** to load it.
131
+ * **Option 2 · CLI**:
132
+
133
+ ```bash
134
+ dsh plugin --profile desktop add @wenbin_wb/dsh-bridge
135
+ ```
136
+
137
+ <p align="center">
138
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/desktop-plugin-install.webp" width="700" alt="Add the plugin in DSH Desktop (1) package name (2) mirror source (3) install (4) confirm enabled" />
139
+ </p>
140
+
141
+ ---
142
+
143
+ ## 🚀 Core Features & Usage Guide
144
+
145
+ Launch DeepSeek Harness, open Settings in the left sidebar, and click **"Remote Access"**:
146
+
147
+ ---
148
+
149
+ ### 1. 🛜 LAN Access & Multi-NIC Smart Selection
150
+
151
+ Starts **automatically with DSH service**, zero configuration required.
152
+
153
+ <p align="center">
154
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/lan-access.webp" width="600" alt="LAN Access Console" />
155
+ </p>
156
+
157
+ * **Instant QR Code Scan**: Connect phone and PC to the same Wi-Fi, scan the QR code with phone camera to access mobile web UI;
158
+ * **Multi-NIC Detection & Switching**: Automatically detects multiple network interfaces (physical Wi-Fi, Ethernet, WSL, VMware, Docker) and presents **"🛜 Network Interface / IP Selection"** dropdown; instantly regenerates QR codes upon selection and **persists choice across restarts**.
159
+
160
+ ---
161
+
162
+ ### 2. 🌐 Public Tunnels (Cloudflare & Custom)
163
+
164
+ Access DeepSeek Harness from anywhere outside your home network without public IP or router port forwarding:
165
+
166
+ <p align="center">
167
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/tunnel-access.webp" width="600" alt="Tunnel Access Configuration" />
168
+ </p>
169
+
170
+ - **Mode 1: Zero-Login Temporary Tunnel (Default)**:
171
+ - Click "Start"; automatically prepares `cloudflared` binary with permission self-healing;
172
+ - Instantly generates `https://*.trycloudflare.com` URL and QR code.
173
+ - **Mode 2: Cloudflare Token Fixed Domain (Permanent · Free)**:
174
+ - Create a Tunnel in [Cloudflare Zero Trust Console](https://one.dash.cloudflare.com/) and bind your custom domain;
175
+ - Enter Tunnel Token & hostname in Advanced Settings, enable **"Auto-start with DSH"** for permanent fixed URL!
176
+ - (Optional) Adjust **network parameters** in the same form: protocol (QUIC / HTTP/2), edge IP (4 / 6 / auto), region (US / global) — whitelisted from official Cloudflare docs, defaults unchanged; restart the tunnel to apply, unsupported flags are skipped with a warning;
177
+ - **Mode 3: Custom WebSocket Tunnel**:
178
+ - Connect to your personal VPS reverse proxy server ([View Setup Guide](docs/custom-tunnel.md)), equipped with per-message gzip and SSE optimization.
179
+
180
+ - **📡 At-a-Glance Health**: the `Data plane` line = latest end-to-end public probe (every 60s, with resolved IP; failures distinguish "origin down" vs "suspected DNS poisoning/fake certificate"); the `cloudflared` line = actual binary path · version · source (system installs are not version-pinned); a yellow warning appears if another cloudflared uses the same Tunnel Token.
181
+
182
+ > **Custom tunnel security note**: The tunnel server (`scripts/install-tunnel-server.sh`) only authenticates the *tunnel client control channel* with `TOKEN`; public HTTP/WebSocket requests forwarded through the tunnel domain are **not independently authenticated** — security relies entirely on the plugin's local Access Auth (the `x-dsh-internal-tunnel` marker prevents tunnel traffic from using the loopback exemption). Always enable **Access Auth** with a password/QR Token in the plugin settings (especially with `scope=all` or when exposed publicly); with no password set, anyone who knows the tunnel URL can reach your DSH.
183
+
184
+ ---
185
+
186
+ ### 3. 📱 Mobile Experience & Standalone PWA
187
+
188
+ Deeply optimized for mobile screens and touch interactions:
189
+
190
+ - **Clean Top Header**: Retains left drawer and right new session button, with centered dynamic session title;
191
+ - **Native Sidebar Drawer**: Full DSH history & workspace grouping with native `[|` fold icon and swipe gestures;
192
+ - **Standalone PWA Support**: Click "Add to Home Screen" in mobile browser to run as a 100% standalone fullscreen app;
193
+ - **Anti-Overlap Responsive Layout**: Bottom toolbar adapts to screen width, preventing button collision.
194
+
195
+ #### Mobile Chat & Workspace Experience
196
+
197
+ <p align="center">
198
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/remote-web-mobile.webp" width="23%" alt="Mobile Home" />
199
+ &nbsp;
200
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/mobile-chat.webp" width="23%" alt="Mobile Chat" />
201
+ &nbsp;
202
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/mobile-drawer.webp" width="23%" alt="Mobile Drawer" />
203
+ &nbsp;
204
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/mobile-workspace-picker.webp" width="23%" alt="Mobile Workspace Picker" />
205
+ </p>
206
+
207
+ #### Remote Settings Center on Mobile
208
+
209
+ <p align="center">
210
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/mobile-settings-lan.webp" width="23%" alt="LAN Settings" />
211
+ &nbsp;
212
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/mobile-settings-tunnel.webp" width="23%" alt="Tunnel Settings" />
213
+ &nbsp;
214
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/mobile-settings-im.webp" width="23%" alt="IM Bot Settings" />
215
+ &nbsp;
216
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/mobile-settings-security.webp" width="23%" alt="Security Settings" />
217
+ </p>
218
+
219
+ ---
220
+
221
+ ### 4. 🗂️ Web Remote Workspace Directory Picker
222
+
223
+ Solves the pain point of mobile browsers being unable to trigger PC native folder dialogs:
224
+
225
+ <p align="center">
226
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/mobile-workspace-picker.webp" width="380" alt="Mobile Workspace Picker" />
227
+ </p>
228
+
229
+ * **Smart Routing**: PC localhost visits (`127.0.0.1`) invoke OS native file dialogs; mobile/remote visits pop up responsive bottom directory browser;
230
+ * **Quick Access**: 1-click access to Windows drives (C:, D:) and standard system folders (Desktop, Documents, Downloads, Projects).
231
+
232
+ ---
233
+
234
+ ### 5. 🔐 Comprehensive Access Security & Admin Lock
235
+
236
+ Open **"Security"** tab to establish bank-grade protection for your local development environment:
237
+
238
+ <p align="center">
239
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/security-auth-config.webp" width="600" alt="Security Config" />
240
+ </p>
241
+
242
+ #### 1. 🛡️ Line 1: External Access Gateway
243
+ - **QR Token Passwordless + Password Verification**: QR codes carry 256-bit encrypted Token for instant access; manual IP/domain visits require password;
244
+ - **Channel Isolation**: Choose between "All Channels / Public Tunnels Only (LAN Passwordless) / LAN Only".
245
+
246
+ <details>
247
+ <summary>📱 Click to view Remote Access Login Page</summary>
248
+ <br/>
249
+ <p align="center">
250
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/remote-auth-login.webp" width="500" alt="Remote Access Login Page" />
251
+ </p>
252
+ </details>
253
+
254
+ #### 2. 🔒 Line 2: Admin Console Anti-Tamper Lock
255
+ - **Independent Admin Password**: Remote devices enter locked console, requiring admin password to view or modify tokens and bot configs;
256
+ - **Strict Host Policy**: Option to restrict management solely to host machine (`127.0.0.1`).
257
+
258
+ <details>
259
+ <summary>🖥️ Click to view Admin Console Lock Screen</summary>
260
+ <br/>
261
+ <p align="center">
262
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/admin-lock-screen.webp" width="500" alt="Admin Console Lock Screen" />
263
+ </p>
264
+ </details>
265
+
266
+ #### 3. 🛟 Triple Disaster Recovery (Never Locked Out)
267
+ - **Host Physical Privilege**: PC localhost (`127.0.0.1`) enjoys permanent highest privilege, never locked;
268
+ - **Terminal Emergency Reset**: Run `touch ~/.dsh/dsh-bridge/reset-auth` in terminal to reset passwords and security policy (takes effect on the next plugin start / DSH restart);
269
+ - **Interactive Guidance**: Built-in interactive recovery guides on all auth pages.
270
+
271
+ ---
272
+
273
+ ### 6. 🤖 All-in-One IM Bot Matrix (WeChat / QQ / Feishu / Telegram)
274
+
275
+ Interact with local AI agents directly inside your favorite messaging apps without opening a browser:
276
+
277
+ * **🔀 Multiple accounts per platform**: WeChat / QQ / Feishu / Telegram can each run **several bots of the same platform in parallel** on one machine (e.g. two Feishu self-built apps, "Whale" and "Scale"), with credentials, persona, workspace, allow-list and session ownership fully isolated. Add one via **"+ Add account"** in Settings (up to 10 per platform). See the [multi-account guide](docs/multi-account.md) (Chinese).
278
+
279
+ ---
280
+
281
+ #### 🟢 WeChat Bot (ClawBot / iLink)
282
+
283
+ Scan QR code with personal WeChat account to chat, manage sessions, and approve permissions via official Tencent servers without public IP.
284
+
285
+ <p align="center">
286
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/wechat-bot-config.webp" width="600" alt="WeChat Bot Config" />
287
+ </p>
288
+
289
+ <details>
290
+ <summary>📱 Click to view WeChat Chat & Approval</summary>
291
+ <br/>
292
+ <p align="center">
293
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/wechat-chat.webp" width="380" alt="WeChat Chat" />
294
+ </p>
295
+ </details>
296
+
297
+ * **Quick Setup**: Remote Access > IM Bot > WeChat > Scan QR code > Send first message to auto-authorize. See [WeChat Guide](docs/wechat-usage.md).
298
+
299
+ ---
300
+
301
+ #### 🐧 QQ Bot (official QQ Bot SDK)
302
+
303
+ Official QQ Bot with direct/group @chat, C2C streaming output, Markdown rendering, interactive approval/question button keyboards, and rich media transfers.
304
+
305
+ The transport is now **fully backed by Tencent's official SDK**: the protocol layer [`@tencent-connect/qqbot-nodejs`](https://github.com/tencent-connect/qqbot-nodejs) (MIT) is **pre-bundled into the plugin** — long connection/RESUME/reconnect, event normalization, quote resolution, dedup & rate limiting, chunked media upload and `stream_messages` streaming are all official implementations; this plugin only provides the session bridge and business mapping.
306
+
307
+ > **Scan-to-bind is optional**: it depends on [`@tencent-connect/qqbot-connector`](https://www.npmjs.com/package/@tencent-connect/qqbot-connector), which is declared **UNLICENSED** and therefore **cannot be redistributed with this plugin**. It is listed as an optionalDependency (usually installed by `npm i` automatically); if it is missing, the settings panel tells you — **entering AppID / AppSecret manually works just as well** (the transport layer is unaffected).
308
+
309
+ <p align="center">
310
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/qq-bot-config.webp" width="600" alt="QQ Bot Config" />
311
+ </p>
312
+
313
+ <details>
314
+ <summary>📱 Click to view QQ Direct & Group Chat</summary>
315
+ <br/>
316
+ <p align="center">
317
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/qq-chat.webp" width="48%" alt="QQ Direct Chat" />
318
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/qq-group.webp" width="48%" alt="QQ Group Chat" />
319
+ </p>
320
+ </details>
321
+
322
+ * **Quick Setup**: click **"📱 Scan to bind bot"** in the settings panel and scan with mobile QQ — credentials come back from the official open-platform API; or create a bot on [QQ Open Platform](https://q.qq.com) and fill AppID / AppSecret manually. Send the first message to auto-authorize. See [QQ Guide](docs/qq-usage.md).
323
+
324
+ ---
325
+
326
+ #### 🐦 Feishu (Lark) Bot (recommended · official Channel SDK)
327
+
328
+ Built on the **official Feishu Channel SDK**: WebSocket transport with auto-reconnect, event verification/normalization, message rendering and chunking, streaming typewriter cards, and media upload/download are all handled by Feishu's own implementation (this plugin no longer maintains its own protocol stack). Onboarding is one scan away — click **"📱 Scan to create app"** in the settings panel and permissions, event subscriptions and card callbacks are provisioned automatically, no developer-console setup required (manual App ID / Secret entry is still supported). Long-connection mode needs **no public IP, no domain, no webhook**. See also: **cloud-doc comments**, the **native slash-command panel**, and approvals whose cards **update in place** after you decide.
329
+
330
+ <p align="center">
331
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/feishu-bot-config.webp" width="600" alt="Feishu: scan to create the app in one step" />
332
+ </p>
333
+
334
+ <details>
335
+ <summary>📱 Click to view Feishu Chat & Card Approval</summary>
336
+ <br/>
337
+ <p align="center">
338
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/feishu-chat.webp" width="380" alt="Feishu Chat" />
339
+ </p>
340
+ </details>
341
+
342
+ * **Cloud-doc comments**: mention the bot in a Feishu doc/sheet comment and the answer is posted back into that comment thread (no need to mention again when following up; comments are plain text — no streaming or cards).
343
+ * **🚀 Scan to create app (recommended)**: click **"📱 Scan to create app"** in the settings panel > confirm with the Feishu mobile app; permissions, event subscriptions and card callbacks are provisioned automatically and the bot connects right away — no developer console needed. Tenant brand (Feishu / Lark) is detected automatically.
344
+ * **⌨️ Native slash-command panel**: 12 commands (`/help`, `/new`, `/sessions`, `/use`, `/status`, `/diff`, `/ask`, …) are registered automatically so users can pick them from Feishu's `/` panel (Feishu PC ≥ 7.70 / mobile ≥ 7.71; typing them manually works on older clients).
345
+ * **📄 Cloud-doc comments**: mention the bot in a Feishu doc/sheet comment and the answer is posted back into that comment thread (no need to mention again when following up; comments are plain text).
346
+ * **🙋 Answer the Agent's questions**: when the Agent needs a decision (`ask_user_question` / plan review) the question is delivered to the chat — full option text and descriptions are shown in the card body, tap a button to answer (recommended option highlighted with ⭐), or reply with text (`/ask 1`, `/ask 1,3` for multi-select, `/ask =your answer`, `/ask 1; 2=1` for several questions). Only turns initiated from this IM are claimed, so questions raised in the web UI are never hijacked.
347
+ * **👀 Live activity status**: while the Agent works, the top of its card shows what it is doing right now (`⌨️ 正在运行命令(npm test)`, `📝 正在编辑文件(…)`, `🤖 正在协调子智能体`, …, using the same wording as the web UI's "thinking / running command" hints), rendered as a quote block in italics so it never reads as body text. The card updates in place (no extra messages) and the status disappears when the turn ends (Feishu / Telegram). **Off by default** — enable it from the settings page.
348
+ * **🛡 In-place approval cards**: after you approve/reject, the card turns into a result state (showing who decided and who requested; timeout/cancel are marked too) instead of sending a duplicate text message.
349
+ * **Manual setup (existing app)**: create a self-built app on [Feishu Open Platform](https://open.feishu.cn/app), enable long connection > fill App ID & Secret. See [Feishu Guide](docs/feishu-usage.md).
350
+
351
+ ---
352
+
353
+ #### ✈️ Telegram Bot (Bot API + Proxy Support)
354
+
355
+ Official Telegram Bot API with Long Polling and **built-in zero-dependency HTTP/HTTPS proxy tunnel**.
356
+
357
+ <p align="center">
358
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/telegram-bot-config.webp" width="600" alt="Telegram Bot Config" />
359
+ </p>
360
+
361
+ * **Quick Setup**: Create bot with [@BotFather](https://t.me/BotFather) > Fill Bot Token (and optional proxy) > Send first message to auto-authorize. See [Telegram Guide](docs/telegram-usage.md).
362
+
363
+ ---
364
+
365
+ #### Standardized IM Commands
366
+
367
+ | Command | Description |
368
+ | :--- | :--- |
369
+ | *(Direct Text)* | Drives current active agent to think and code |
370
+ | `/sessions` (or `/list`) | List all sessions grouped by workspace |
371
+ | `/use N` (or `/resume N`) | Switch context to session number N |
372
+ | `/rename <new title>` | Rename active session title |
373
+ | `/workspaces` | List all registered workspaces in DSH |
374
+ | `/addworkspace <path>` | Remotely register a local project folder |
375
+ | `/new <prompt>` | Start a new session in current workspace |
376
+ | `/new <prompt> @N` | Start a new session in workspace N |
377
+ | `/stop` | Immediately abort current running task |
378
+ | `/end` | End and suspend active session |
379
+ | `/yes` / `/no` (or `1`/`2`) | Respond to sensitive operation permission approvals |
380
+ | `/status` | View agent status and system summary |
381
+ | `/help` | View full command and shortcut button help |
382
+
383
+ ---
384
+
385
+ ### 7. 📊 Maintenance Dashboard & Graceful Restart
386
+
387
+ Open **"Maintenance"** tab to monitor health and manage operations:
388
+
389
+ <p align="center">
390
+ <img src="https://raw.githubusercontent.com/wenbin-wb/dsh-bridge/main/docs/screenshots/mobile-remote-settings.webp" width="380" alt="Maintenance Dashboard" />
391
+ </p>
392
+
393
+ * **📊 Host System Metrics Dashboard**: Real-time CPU model, total/used RAM, Node heap memory, and DSH uptime;
394
+ * **🔍 1-Click Network Diagnostics**: Diagnoses reverse proxy port, LAN IPv4, Cloudflare Anycast edge, and npm mirror latency;
395
+ * **🗄️ Configuration Backup & Migration**: 1-click export/import of `.json` configuration files;
396
+ * **🔄 Graceful Smooth Restart**: 1-click DSH service restart with automatic reconnect and page reload.
397
+
398
+ ---
399
+
400
+ ## 💬 FAQ
401
+
402
+ <details>
403
+ <summary><b>Q0: What is dsh-bridge? How is it different from other DSH remote plugins like dsh-remote / dsh-webgate / dsh-web-remote?</b></summary>
404
+ <br/>
405
+
406
+ **In one sentence: dsh-bridge is the remote access / remote control plugin (remote control) for DeepSeek Harness — scan a QR code and keep using your local DSH from phone or public internet.** If you search "remote DSH plugins" or "how to remote control DSH", this is it.
407
+
408
+ 1. **All-in-one**: LAN QR + Cloudflare temp/fixed-domain tunnels + custom tunnel + WeChat / QQ / Feishu / Telegram bot matrix in one install;
409
+ 2. **Mobile-first**: mobile UI, PWA fullscreen, and a web remote workspace picker tuned for controlling desktop DSH from your phone;
410
+ 3. **Built-in gate**: QR Token + access password + admin anti-tamper lock for all LAN / tunnel traffic;
411
+ 4. **Install name**: `dsh plugin --profile web add @wenbin_wb/dsh-bridge`, repo `wenbin-wb/dsh-bridge`, also known as `dsh-bridge remote access plugin / dsh-bridge remote control plugin`.
412
+ </details>
413
+
414
+ <details>
415
+ <summary><b>Q1: Phone cannot connect after scanning QR code?</b></summary>
416
+ <br/>
417
+
418
+ 1. **Wi-Fi Check**: Ensure phone and PC are on the same Wi-Fi network with AP isolation disabled;
419
+ 2. **Multi-NIC Switching**: If WSL/VMware/VPN is enabled, switch to physical Wi-Fi/Ethernet IP in the **"🛜 Network Interface / IP Selection"** dropdown;
420
+ 3. **Firewall**: Ensure firewall allows Node.js on port `3082`;
421
+ 4. **Use Public Tunnel**: Enable Cloudflare Tunnel if crossing network segments.
422
+ </details>
423
+
424
+ <details>
425
+ <summary><b>Q2: How is IM Bot security ensured? Can strangers trigger my agent?</b></summary>
426
+ <br/>
427
+
428
+ 1. **Strict Allowlist**: Built-in sender allowlist; only authorized users can drive the Agent;
429
+ 2. **Auto First Authorization**: Admin sending the first message after login automatically binds to allowlist;
430
+ 3. **Silent Drop**: Unauthorized messages are dropped at the lowest layer (Never fed to LLM).
431
+ </details>
432
+
433
+ <details>
434
+ <summary><b>Q3: What is the difference between Temporary and Fixed Cloudflare Tunnels?</b></summary>
435
+ <br/>
436
+
437
+ 1. **Temporary (Default)**: Zero-login random `*.trycloudflare.com` domain, ideal for quick outdoor access;
438
+ 2. **Fixed (Token Mode)**: Uses Cloudflare Zero Trust Named Tunnel Token to bind your own domain with auto-start on boot.
439
+ </details>
440
+
441
+ <details>
442
+ <summary><b>Q4: Will chat sessions and configurations be lost after upgrading or restarting DSH?</b></summary>
443
+ <br/>
444
+
445
+ 1. **Persistent Configuration**: All credentials, allowlists, and passwords persist in `~/.dsh-bridge/`;
446
+ 2. **Session Context Recovery**: Session history is persisted by DSH core engine; resume conversations with `/resume` anytime;
447
+ 3. **Backup & Migration**: 1-click `.json` export/import in Maintenance tab.
448
+ </details>
449
+
450
+ ---
451
+
452
+ ## 🛠️ Development & Contribution
453
+
454
+ Contributions are welcome! Feel free to submit an Issue or Pull Request.
455
+
456
+ ```bash
457
+ # 1. Clone repo
458
+ git clone https://github.com/wenbin-wb/dsh-bridge.git
459
+ cd dsh-bridge
460
+
461
+ # 2. Install dependencies & build
462
+ npm install
463
+ npm run build:client
464
+
465
+ # 3. Run unit tests
466
+ npm test
467
+
468
+ # 4. Link to local DSH Web Profile
469
+ dsh plugin --profile web add .
470
+ ```
471
+
472
+ ---
473
+
474
+ ## ⭐ Star History
475
+
476
+ <a href="https://www.star-history.com/?repos=wenbin-wb%2Fdsh-bridge&type=date&legend=top-left">
477
+ <picture>
478
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=wenbin-wb/dsh-bridge&type=date&theme=dark&legend=top-left" />
479
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=wenbin-wb/dsh-bridge&type=date&legend=top-left" />
480
+ <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=wenbin-wb/dsh-bridge&type=date&legend=top-left" />
481
+ </picture>
482
+ </a>
483
+
484
+ ---
485
+
486
+ ## 📄 License
487
+
488
+ MIT © [wenbin-wb](https://github.com/wenbin-wb)