packages/dsh-remote-web-ui
zhu1090093659/dsh-web手机/PC 远程操控 dsh web 工作区:扫码配对、令牌门控通道、SSE 实时同步,提供移动端与完整桌面 GUI 两种远程形态。
让 DSH 在 iPhone/iPad 上可用:显式开启的局域网反向代理(改写 Host/Origin 通过回环信任栅栏,含 WebSocket 升级)、iOS PWA 外壳(主屏幕图标、standalone meta、viewport-fit)、触屏/移动端 CSS(安全区、键盘避让、输入框按钮行适配)。
Use DeepSeek Harness from your iPhone / iPad: LAN reverse proxy + iOS PWA (add-to-home-screen) + touch/mobile CSS for the web GUI.
DeepSeek Harness's web GUI binds to 127.0.0.1 by default (upstream deliberately rejects --host 0.0.0.0 for safety). This plugin adds a first-class mobile experience:
0.0.0.0 reverse proxy that forwards phone/iPad traffic to the loopback server, rewriting Host/Origin so the /api trust fence accepts it (HTTP and WebSocket upgrades included). The LAN URL and a terminal QR code are printed on startup.apple-mobile-web-app-capable, viewport-fit=cover, apple-touch-icon, programmatically generated PNG icons, and an enhanced manifest.webmanifest. After "Add to Home Screen" in Safari it opens fullscreen like a native app with its own icon.touch-action: manipulation to kill double-tap delay, notch / home-indicator safe-area insets, raising the composer above the on-screen keyboard (visualViewport tracking), and larger tap targets for message actions.http://127.0.0.1:3080/mobile on the desktop to get a big QR code plus step-by-step instructions; the phone camera opens the LAN URL in one scan.Enabling this plugin exposes the full Harness — including its code-execution tools — to every device on your LAN. That is the price of "usable from a phone". Please:
mobile row in cordis.patch.yml and restart;allow config (see below).dsh-mobile itself does NOT depend on dsh-webchatlike — a stock harness without webchatlike works fine. Patches are applied as needed:
| Patch | Required? | Notes |
|---|---|---|
| Secure-context UUID | ✅ Required | Upstream bug: mintRpcId() uses crypto.randomUUID, a [SecureContext]-only API. http://127.0.0.1 is a trustworthy origin (local GUI fine), but a phone on a LAN IP is NOT a secure context → randomUUID is undefined → every RPC throws → the connection handshake fails → the page spins forever. Patches the stock files; unrelated to webchatlike. |
| webchatlike folding fallback | ⚪ Only with dsh-webchatlike | Fixes webchatlike's version-family folding on fresh browsers (no localStorage ledger): phones showed every regenerate/edit fork as an independent row and clicking the folded row did nothing. Not needed without webchatlike — stock harness never folds. |
| File | Change |
|---|---|
packages/host/apiproxy/src/fetch/client.ts | mintRpcId() mints a v4 UUID from crypto.getRandomValues (core fix) |
packages/client/ui-conversation/src/client/service.ts | Draft attachment ids use the same fallback |
packages/llm/llm/src/message.ts | Message ids use the same fallback |
cd /path/to/deepseek-harness
pnpm run build:lib:client # the running GUI hot-swaps client bundles; no restart needed
All patches are backed up in
harness-patches/for re-application after upstream updates.
packages/client/ui-workspace/src/client/tree.ts, WorkspaceBrowser.tsx, index.ts — also backed up in harness-patches/.
Repository: github.com/cindyguyuehu123/dsh-mobile (built lib/ ships with the repo — no build step needed)
Option 1 — official plugin command (clones and installs dependencies automatically):
dsh plugin --profile web add https://github.com/cindyguyuehu123/dsh-mobile.git
Option 2 — manual registration (same as dsh-webchatlike):
# 1. Clone and install dependencies
git clone https://github.com/cindyguyuehu123/dsh-mobile.git
cd dsh-mobile && pnpm install
# 2. Add to ~/.dsh/profiles/web/package.json dependencies
# "dsh-mobile": "link:/absolute/path/dsh-mobile"
cd ~/.dsh/profiles/web && pnpm install
# 3. Insert into ~/.dsh/profiles/web/cordis.patch.yml
# - insert:
# - id: mobile
# name: 'dsh-mobile'
cd /path/to/dsh-mobile
pnpm install
pnpm run build
Outputs: lib/index.js (host half) and lib/client.js (browser half, zero runtime imports).
Edit ~/.dsh/profiles/web/package.json and add a link dependency:
"dependencies": {
"dsh-mobile": "link:/path/to/dsh-mobile"
}
Then:
cd ~/.dsh/profiles/web && pnpm install
Edit ~/.dsh/profiles/web/cordis.patch.yml, insert the loader row:
- insert:
- id: mobile
name: 'dsh-mobile'
cd /path/to/deepseek-harness
pnpm dsh web
The log prints:
dsh-mobile: 📱 phone / iPad access: http://192.168.x.x:3090
dsh-mobile: desktop QR page: http://127.0.0.1:3080/mobile
/mobile page (or type the printed URL);The plugin row accepts an optional config (all optional):
- insert:
- id: mobile
name: 'dsh-mobile'
config:
lanPort: 3090 # proxy port; walks +1 when busy (default 3090)
allow: [] # optional client-IP allowlist, e.g. ['192.168.1.20']; empty = allow all
/api routes and WebSocket upgrades all pass isTrustedApiRequest: loopback Host passes, Origin (when present) must be same-origin. The proxy rewrites Host to 127.0.0.1:<loopback port> and same-origin Origin accordingly, so phone traffic looks exactly like local traffic to the core server — no harness source modification, and the blocked --host 0.0.0.0 is never touched.webServer.tapIndex() and route-registration extension points.dsh.client channel (/plugins/dsh-mobile/client.js), same loading path as the shipped ui-* plugins.pnpm run build # build lib/ via tsdown
pnpm run typecheck # tsc --noEmit
Client-side changes hot-swap into a running GUI (bundle polling); host-side changes need a dsh web restart.
| Symptom | Likely cause | Fix |
|---|---|---|
| "Cannot connect" / endless spinner | Phone not on the same network, router AP isolation, or iOS Local Network permission off | Same Wi-Fi; disable AP isolation on the router; Settings → Privacy & Security → Local Network → enable browser |
| Blank spinning page | Old cached bundle (pre-fix) | Refresh; private window; clear Safari cache |
| Works on Mac only | macOS firewall | System Settings → Network → Firewall → allow Node.js |