packages/dsh-remote-web-ui
zhu1090093659/dsh-web手机/PC 远程操控 dsh web 工作区:扫码配对、令牌门控通道、SSE 实时同步,提供移动端与完整桌面 GUI 两种远程形态。
受 PIN 保护的 DeepSeek Harness 移动端对话界面,在独立端口上通过局域网或自备隧道访问。
A PIN-protected, chat-only mobile web client for DeepSeek Harness (DSH), served on an isolated port over your LAN or a self-provided tunnel — without ever exposing the desktop web surface.
DSH's web UI binds to 127.0.0.1 for good reason — it exposes files, terminals and settings, so opening it to the network means opening all of that. This plugin keeps that desktop surface untouched and instead runs its own, deliberately narrow HTTP listener that only ever offers chat: view sessions, keep talking, and see the same stats the desktop shows. Access it from your phone on the same Wi-Fi, or through a tunnel when you are away.
/m/)A standard DSH settings card, reachable from the desktop UI:
lan / tunnel / both), tunnel host, and idle timeout.N=2^14, r=8, p=1) with a random salt, compared in constant time.sha256(token) is persisted; 7-day expiry plus an idle timeout (default 60 min).--host 0.0.0.0, no changes to DSH's own trust boundary.┌─────────────────────────── DSH host (loopback only) ───────────────────────────┐
│ desktop web UI (127.0.0.1:3080) ← unchanged, never exposed │
│ dsh-mobile-access host plugin │
│ settings · sessionQuery · agents · apiProxy · permissionPresets · ... │
└──────────────────────────────────────┬─────────────────────────────────────────┘
│ in-process service calls
┌──────────────────────────────────────▼─────────────────────────────────────────┐
│ isolated HTTP listener (0.0.0.0:3081 for LAN, 127.0.0.1 for tunnel) │
│ PIN auth · host allowlist · CSRF · SSE │
│ /m/ mobile SPA (preact, served statically) │
│ /m/api/* chat / sessions / stats / models / permissions │
│ /m/api/admin/* loopback-only admin (PIN, sessions, login history) │
└────────────────────────────────────────────────────────────────────────────────┘
▲ LAN (HTTP) or tunnel (Tailscale / cloudflared / cpolar, HTTPS)
│
📱 phone browser
The plugin bridges to DSH's own host services (sessionQuery, agents, apiProxy, permissionPresets, sessionProjections, …) in-process. It does not re-implement DSH; it exposes a small, curated slice of it.
0.1.1-rc.2 (the @deepseek-ai/* packages are declared as peerDependencies).The repository ships prebuilt lib/ and dist-webapp/, so a Git install works without a build step:
dsh plugin --profile web add github:huanlanmie/dsh-mobile-access
Restart dsh web. A Mobile access card appears in the desktop settings — use it to set the PIN, enable the surface, and scan the QR code. Until a PIN is set, the surface stays loopback-only.
Local development install:
dsh plugin --profile web add link:<path-to-checkout>(or./dsh-mobile-accessfrom the checkout's parent directory).
lan — the listener binds 0.0.0.0; scan the QR code on your phone over the same Wi-Fi.tunnel — fill in your tunnel authority (see below) and reach it over HTTPS.both — LAN for home, tunnel for away./m/, enter the PIN, and continue your sessions.| Provider | What to put in tunnel host | Notes |
|---|---|---|
| Tailscale | mypc.tail12345.ts.net | tailnet traffic is already encrypted; recommended. |
| cloudflared | the temporary *.trycloudflare.com host | HTTPS terminated at Cloudflare, forwarded locally. |
| cpolar | the assigned *.cpolar.top / *.cpolar.io host | HTTPS tunnel; keep the token in .cpolar/. |
| Key | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | Master switch. Disabled = no listener at all. |
port | number | 3081 | Port of the plugin's isolated HTTP surface (1024–65535). |
mode | lan | tunnel | both | lan | Which networks may reach the surface. |
tunnelHost | string | "" | Tunnel authority (hostname) served over HTTPS. |
idleTimeoutMin | number | 60 | Session idle timeout in minutes (5–10080). |
These are DSH settings under the mobile-access namespace; they can be edited from the desktop settings card.
npm install
npm run build # esbuild bundles the mobile SPA + desktop client, then tsc compiles the host
npm test # node:test — PIN format, token hashing, lockout, host allowlist
npm run typecheck # tsc --noEmit
Layout:
src/ host plugin (TypeScript): auth, server, settings, storage,
net (allowlist/URLs), mux (question/approval bridge), API routes
src/client/ desktop settings section (React)
webapp/src/ mobile SPA (preact): main.tsx, api.ts, styles.css
scripts/ build-webapp.mjs (esbuild + client-bundle envelope)
test/ node:test suites
Prebuilt lib/ and dist-webapp/ are committed so Git installs need no build step; they are regenerated by npm run build.