wenbin-wb/dsh-bridge
wenbin-wb/dsh-bridgeDeepSeek Harness 远程与移动端接入插件:提供局域网扫码直连、Cloudflare 与自建公网隧道,以及微信、QQ、飞书、Telegram 机器人交互,内置安全认证与访问控制。
Zero-friction remote bridge for your phone: install once, no networking configuration, no local patches — after restarting dsh, a persistent QR panel appears in the left sidebar (cross-platform, immune to DSH upgrades).
of login state — · PC logged in → the phone (even logged out) scans to log into the same account; · PC logged out → the phone (logged in) scans to grant access and the PC logs in automatically;
auto-refresh);
in-App scan = direct login / grant.
Pick your path first: DSH desktop app 0.2.0 or newer → §A (GUI, recommended); legacy dsh web (0.1.7) → §B (CLI). Both install the same package, @zdx8637/dshmobile-bridge (current version 1.0.8).
「输入插件的包名、GitHub 仓库地址或本地目录路径。」 — a GitHub repository URL or a local directory path is accepted there too):
@zdx8637/dshmobile-bridge@1.0.8npm 官方源 (official npm registry) or 中国大陆镜像源(Mainland-China mirror) — whichever your network reaches;
⚠️ Always pin an exact version (e.g. @zdx8637/dshmobile-bridge@1.0.8). The profile directorycontains a pnpm-lock.yaml; when you reinstall by bare package name the lockfile can pin theversion back to the old one (measured: npm already served 1.0.2, yet a reinstall still left 1.0.0
installed).
⚠️ Plugins do not auto-update. The dialog says so outright —
「插件安装后,暂不支持自动更新。若需升级,请先卸载再安装新版」. So to upgrade: uninstall in the
plugin manager first, then repeat the steps above with the new version number.
dsh web + CLI) — install from the CLInpx -y @deepseek-ai/dsh plugin --profile web add @zdx8637/dshmobile-bridge@latest
# after restarting dsh, a ▶ arrow appears at the bottom of the web sidebar — click to open the panelPrerequisite: pnpm (the dsh plugin subcommand depends on it; corepack enable or npm i -g pnpm).
Legacy only: npmlatestfor@deepseek-ai/dshpoints at the 0.1.7 CLI, so this command pulls the
0.1.7 dsh plugin. On 0.2.0 or newer use §A (the GUI) instead — the CLI is not the 0.2.0install path.
Phone App: scan the panel QR → download the APK from the landing page (or from the releases page).
DSH 0.1.0-rc.6 does not expose third-party settings namespaces to the browser (upstream marks this as deferred work). This plugin does not depend on that channel: the panel prefers the official connection service RPC channel (ctx.connection.rpc, channel /dshmobile, a same-origin relative path with no origin dependency) and automatically falls back to local HTTP at 127.0.0.1:17653 (status polling + action dispatch, CORS echoes the caller origin) when that service is unavailable. Both channels share the same payloads and actions, therefore
dsh-app://app) and in dsh web;scripts/expose-settings-namespace.ps1 patch).
Since v0.1.5 DSH added browser-session auth to the local web service (the URL printed by dsh web carries a process-level launch token → the browser exchanges it for a session Cookie, and every /api request is validated), and upgraded the RPC protocol to Typert endpoints (session/list, {args} payloads, /api/remote.mux stream multiplexing, $events approval/question waterfalls). The plugin adapts automatically since 0.1.0-beta.17:
ctx.connection.authenticatedUrl() and hands it tothe bridge child process;
state directory, re-mints on 401, and attaches it to every /api request and WS upgrade;
/api/remote.mux (session/follow + workspace/follow + session/control); approvals and questions flow through $events + $events/result.
⚠️ Legacy DSH support (≤ v0.1.0-rc.6) was removed in 0.1.0-beta.23: the former
dual-protocol auto-detection (dot endpoints, raw payloads,events.mux/events.host,
/api/respond, no auth) is gone — one protocol path removed: **adapter −283 lines /dsh −59 / main −21 / host −8**, plus the whole "simulated legacy DSH" smoke script.
DSH ≥ v0.1.5 is now required. If the bridge cannot reach DSH it logs a clear
message in bridge.log:"v2 协议握手失败:请确认 DSH 正在运行(dsh web);本插件版本已不再支持旧版 DSH(≤0.1.5-rc.6)".
Self-check scripts: node scripts/smoke-dsh-v2.mjs (full pipeline against a simulated new DSH), node scripts/probe-real-dsh.mjs (read-only verification against a running real DSH; requires having logged into the web panel once in this browser to generate the signing secret), node scripts/archive-session.mjs --list | --newest-idle (safely clean idle sessions; refuses to archive live ones by default), node scripts/unarchive-session.mjs and node scripts/probe-session-archive.mjs (DSH has no unarchive API: the archive set lives in the host's memory, so editing the state file only takes effect after a DSH restart — see docs/dsh-session-archive.md).
If two bridges ever run on the same machine (a second DSH instance, an orphaned bridge left behind when DSH was killed, or a mix of old/new plugin versions) they share the same state directory ~/.dsh-mobile ⇒ the same relay device identity ⇒ they kick each other off the relay, and the phone shows "cannot refresh conversations after login". Since 0.1.0-beta.23 there are four layers of defence:
(released automatically when the process dies); a new instance asks the holder to *yield*, and exits with code 42 if the holder refuses — the two never coexist;
machine (so updating/restarting DSH also cleans up old orphans, and the newest code is the one running);
4000 duplicate connection(meaning an *older* bridge is still around), it cleans up the other bridge processes.
The panel entry dot then shows "另一个桥实例在运行" (another bridge instance is running); saving once in the panel (or restarting DSH) takes control back. Diagnostics: ~/.dsh-mobile/bridge.lock.json and bridge.log (UTF-8). For a temporary second bridge (UI verification) use a separate state directory plus --state-dir=, or set DSHMOBILE_BRIDGE_SINGLETON=0. Details: docs/bridge-singleton.md.
The plugin connects to https://www.deepseek-claudex.cn by default (author-operated relay: account registration, device management, message routing). You can also self-host: see the relay/ directory and dsh-remote/docs/04-operations.md in the main repo, then point the panel at your own relay URL.
npm install
node scripts/build.mjs # produces lib/index.js + lib/client.js
node scripts/smoke-host.mjs <u> <p> # username/password smoke test
node scripts/smoke-grant.mjs <u> <p> # phone-grant smoke testThe complete three-part stack (phone App / relay / protocol) lives in the main repo zdx8637-gitdog/dshmobile.
MIT