@qzsy/dsh-bridge 2.18.0 → 3.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 (81) hide show
  1. package/CHANGELOG.md +15 -1094
  2. package/LICENSE +21 -21
  3. package/README.md +73 -476
  4. package/client/build.mjs +1 -3
  5. package/client/client.js +381 -9747
  6. package/client/index.js +242 -6828
  7. package/client/locales.mjs +99 -233
  8. package/cordis.patch.yml +5 -3
  9. package/lib/config.js +93 -0
  10. package/lib/data-dir.js +16 -0
  11. package/lib/dsh-cookie.js +111 -0
  12. package/lib/gate.js +414 -0
  13. package/lib/identity.js +23 -0
  14. package/lib/index.js +303 -3496
  15. package/lib/saas/tunnel-client.mjs +529 -467
  16. package/locale/en.json +3 -3
  17. package/locale/zh.json +3 -3
  18. package/package.json +15 -70
  19. package/README.en.md +0 -488
  20. package/client/host-families.js +0 -442
  21. package/client/mobile-styles.js +0 -1299
  22. package/client/mobile-yield.js +0 -219
  23. package/client/panel-locales.mjs +0 -777
  24. package/client/picker-yield.js +0 -77
  25. package/client/resource-url-compat.js +0 -90
  26. package/client/settings-nav-icon.js +0 -105
  27. package/client/theme-tokens.js +0 -49
  28. package/client/tunnel-guard.js +0 -46
  29. package/client/unlock-manager.js +0 -144
  30. package/lib/auth/dsh-native-cookie.js +0 -148
  31. package/lib/auth/login-template.js +0 -516
  32. package/lib/auth/manager.js +0 -596
  33. package/lib/bridge-rpc-constants.js +0 -66
  34. package/lib/bridge-rpc.js +0 -722
  35. package/lib/cloudflared-manager.mjs +0 -1277
  36. package/lib/cloudflared-network-args.js +0 -99
  37. package/lib/cloudflared-process-scan.js +0 -153
  38. package/lib/compat.js +0 -172
  39. package/lib/connection-compat.js +0 -115
  40. package/lib/feishu/comment.js +0 -50
  41. package/lib/feishu/gateway.js +0 -644
  42. package/lib/feishu/index.js +0 -432
  43. package/lib/feishu/lark-bundled.mjs +0 -131929
  44. package/lib/feishu/markdown.js +0 -148
  45. package/lib/feishu/node.js +0 -1152
  46. package/lib/feishu/slash-commands.js +0 -255
  47. package/lib/platform/account-ops.js +0 -248
  48. package/lib/platform/activity.js +0 -169
  49. package/lib/platform/ask-user.js +0 -293
  50. package/lib/platform/base.js +0 -147
  51. package/lib/platform/changes-digest.js +0 -93
  52. package/lib/platform/commands.js +0 -267
  53. package/lib/platform/config-restore.js +0 -78
  54. package/lib/platform/conversation-bridge.js +0 -1544
  55. package/lib/platform/dsh-storage.js +0 -222
  56. package/lib/platform/index.js +0 -10
  57. package/lib/platform/instances.js +0 -458
  58. package/lib/platform/manager.js +0 -130
  59. package/lib/platform/message-split.js +0 -229
  60. package/lib/platform/session-catalog.js +0 -405
  61. package/lib/platform/session-config.js +0 -52
  62. package/lib/platform/stream-slices.js +0 -21
  63. package/lib/qq/gateway.js +0 -1107
  64. package/lib/qq/index.js +0 -561
  65. package/lib/qq/node.js +0 -1153
  66. package/lib/qq/qqbot-bundled.mjs +0 -8273
  67. package/lib/restart-helper.mjs +0 -133
  68. package/lib/security/log-sanitize.js +0 -50
  69. package/lib/security/path-validator.js +0 -195
  70. package/lib/security/rate-limiter.js +0 -93
  71. package/lib/session-strip.js +0 -100
  72. package/lib/sse-keepalive.js +0 -115
  73. package/lib/telegram/gateway.js +0 -643
  74. package/lib/telegram/index.js +0 -255
  75. package/lib/telegram/node.js +0 -410
  76. package/lib/tunnel-client.mjs +0 -537
  77. package/lib/wechat/gateway.js +0 -1000
  78. package/lib/wechat/index.js +0 -282
  79. package/lib/wechat/media.js +0 -302
  80. package/lib/wechat/node.js +0 -360
  81. package/llms.txt +0 -36
package/locale/en.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
- "title": "DSH Bridge — Remote Access & Security",
4
- "description": "Scan the QR code to keep using DeepSeek Harness on mobile or public networks when you're away from your computer. One-tap LAN QR code, Cloudflare public tunnel, self-hosted tunnel, and WeChat / QQ / Lark / Telegram bots (multi-workspace / session persistence / media / card approval / streaming output), no public server required."
3
+ "title": "DSH Remote Tunnel Cloud · Official Client",
4
+ "description": "Connect your local DeepSeek Harness to DSH Remote Tunnel Cloud: device-code binding, short-lived tokens, HTTP/SSE/WebSocket reverse tunnel, and a local gated proxy."
5
5
  }
6
- }
6
+ }
package/locale/zh.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
- "title": "DSH Bridge — 远程访问与安全守护",
4
- "description": "手机扫码即可在移动端/公网继续用 DeepSeek Harness,人不在电脑前也能接着干。一键局域网二维码、Cloudflare 公网隧道、自建隧道与微信 / QQ / 飞书 / Telegram Bot(多工作区/会话持久化/媒体/卡片审批/流式输出),无需自己搭公网服务器。"
3
+ "title": "DSH 远程隧道云 · 官方客户端",
4
+ "description": "把本机 DeepSeek Harness 接入 DSH 远程隧道云:设备码绑定、短期令牌、HTTP/SSE/WebSocket 反向隧道,本地门禁代理保护访问。"
5
5
  }
6
- }
6
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@qzsy/dsh-bridge",
3
- "version": "2.18.0",
4
- "description": "DSH 远程连接/远程控制插件(remote control):手机扫码即可在移动端/公网继续用 DeepSeek Harness,人不在电脑前也能接着干。一键局域网二维码、Cloudflare 公网隧道、自建隧道与微信 / QQ / 飞书 / Telegram Bot(多工作区/会话持久化/媒体/卡片审批/流式输出),无需自己搭公网服务器。",
5
- "releaseNotes": "【v2.18.0】SaaS 版首发(@qzsy/dsh-bridge)\n• 新增 SaaS 账号模式:设备码绑定、短期令牌、自动重连,一条命令接入 DSH 远程隧道云\n• 支持多终端并存、在线态心跳、公网地址热更新(route-update)、优雅下线(drain)\n• 保留自建隧道 / Cloudflare / 局域网二维码全部原有能力,旧配置无需迁移",
3
+ "version": "3.0.1",
4
+ "description": "DSH 远程隧道云官方客户端插件:一条命令把本机 DeepSeek Harness 接入云端隧道(设备码绑定、短期令牌、本地门禁代理、HTTP/SSE/WebSocket 反向隧道)。",
5
+ "releaseNotes": "【v3.0.0】官方客户端插件首个独立实现版本\n• 全新自研代码:插件骨架、本地门禁代理、SaaS 隧道客户端与设置面板均独立实现\n• 设备码绑定 + 短期设备令牌 + v2 控制通道(心跳/路由热更新/drain/终态吊销)\n• 本地门禁:回环免认证、隧道来源用进程内随机密钥标记、局域网访问需本地口令\n• 支持 HTTP / SSE 流式 / WebSocket 转发,公网地址复制与二维码\n• 数据目录 ~/.dsh/qzsy-dsh-bridge,默认本地端口 3092(可配置)",
6
6
  "type": "module",
7
7
  "main": "lib/index.js",
8
8
  "exports": {
@@ -19,47 +19,23 @@
19
19
  "locale",
20
20
  "cordis.patch.yml",
21
21
  "README.md",
22
- "README.en.md",
23
22
  "CHANGELOG.md",
24
- "LICENSE",
25
- "llms.txt"
23
+ "LICENSE"
26
24
  ],
27
25
  "scripts": {
28
26
  "build:client": "node client/build.mjs",
29
- "build:lark": "node scripts/bundle-lark.mjs",
30
- "build:qq": "node scripts/bundle-qq.mjs",
31
- "build:banner": "node scripts/generate-banner.mjs",
32
- "prepack": "npm run build:client && npm run build:qq",
33
- "release:github": "node scripts/create-github-release.mjs",
34
- "lint": "eslint .",
35
- "test": "node --test test/*.test.mjs",
36
- "verify:mobile-ui": "node test/browser/run-all.mjs"
27
+ "prepack": "npm run build:client",
28
+ "test": "node --test test/*.test.mjs"
37
29
  },
38
30
  "dependencies": {
39
31
  "qrcode": "^1.5.3",
40
32
  "ws": "^8.18.0"
41
33
  },
42
34
  "devDependencies": {
43
- "@deepseek-ai/dsh-llm": "0.1.0-rc.8",
44
- "@eslint/js": "^10.0.1",
45
- "@larksuite/channel": "^0.7.1",
46
- "@larksuiteoapi/node-sdk": "^1.75.0",
47
- "@tencent-connect/qqbot-nodejs": "^1.0.5",
48
- "esbuild": "^0.28.2",
49
- "eslint": "^10.9.1",
50
- "espree": "^11.2.0",
51
- "follow-redirects": "^1.16.1",
52
- "globals": "^17.11.0",
53
- "puppeteer-core": "^25.8.0"
35
+ "esbuild": "^0.28.2"
54
36
  },
55
37
  "peerDependencies": {
56
- "@deepseek-ai/cordis": "^4.0.1",
57
- "@deepseek-ai/dsh-llm": ">=0.1.0-rc.6"
58
- },
59
- "peerDependenciesMeta": {
60
- "@deepseek-ai/dsh-llm": {
61
- "optional": true
62
- }
38
+ "@deepseek-ai/cordis": "^4.0.1"
63
39
  },
64
40
  "engines": {
65
41
  "node": "^22.19.0 || >=24.0.0"
@@ -70,43 +46,11 @@
70
46
  "dsh",
71
47
  "dsh-plugin",
72
48
  "remote",
73
- "remote-access",
74
49
  "tunnel",
75
- "cloudflare",
76
- "mobile",
77
- "smartphone",
78
- "tablet",
79
- "qr-code",
80
- "qrcode",
81
- "websocket",
82
- "bot",
83
- "wechat",
84
- "qq",
85
- "feishu",
86
- "telegram",
87
- "remote-control",
88
- "remote-development",
89
- "remote-ui",
90
- "mobile-access",
91
- "dsh-remote",
92
- "dsh-bridge",
93
- "dsh-mobile",
94
- "dsh-remote-control",
95
- "dsh-remote-access",
96
- "mobile-remote",
97
- "mobile-control",
98
- "phone-remote",
99
- "pwa",
100
- "android",
101
- "ios",
102
- "public-tunnel",
103
- "lan-access",
104
- "远程连接",
105
- "远程控制",
50
+ "saas",
51
+ "remote-access",
106
52
  "远程访问",
107
- "移动端",
108
- "dsh移动端",
109
- "手机远程"
53
+ "隧道"
110
54
  ],
111
55
  "dsh": {
112
56
  "bundle": {
@@ -127,11 +71,12 @@
127
71
  "url": "https://github.com/qzsy/dsh-remote.git",
128
72
  "directory": "packages/dsh-bridge"
129
73
  },
74
+ "homepage": "https://github.com/qzsy/dsh-remote#readme",
75
+ "bugs": {
76
+ "url": "https://github.com/qzsy/dsh-remote/issues"
77
+ },
130
78
  "publishConfig": {
131
79
  "access": "public",
132
80
  "registry": "https://registry.npmjs.org/"
133
- },
134
- "optionalDependencies": {
135
- "@tencent-connect/qqbot-connector": "^1.2.0"
136
81
  }
137
82
  }
package/README.en.md DELETED
@@ -1,488 +0,0 @@
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)