dsh-zen-remote 1.1.10 → 1.1.12
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.
- package/AGENTS.md +28 -3
- package/README.md +137 -143
- package/README.zh-CN.md +343 -0
- package/docs/interface.md +4 -4
- package/docs/remote-access.en.md +81 -3
- package/docs/remote-access.md +5 -3
- package/dsh-push.mjs +62 -8
- package/lan-gate.mjs +16 -1
- package/lib/client.js +350 -36
- package/lib/lan-gate-server.cjs +243 -35
- package/lib/types/client/MobileHome.d.ts +7 -2
- package/lib/types/client/MobileHome.d.ts.map +1 -1
- package/lib/types/client/MobileSessionInfo.d.ts +2 -2
- package/lib/types/client/MobileSessionInfo.d.ts.map +1 -1
- package/lib/types/client/compat/store.d.ts +62 -0
- package/lib/types/client/compat/store.d.ts.map +1 -0
- package/lib/types/client/compat/types.d.ts +84 -0
- package/lib/types/client/compat/types.d.ts.map +1 -0
- package/lib/types/client/debug.d.ts +1 -1
- package/lib/types/client/debug.d.ts.map +1 -1
- package/lib/types/client/effects/aionui-compat.d.ts +1 -1
- package/lib/types/client/effects/aionui-compat.d.ts.map +1 -1
- package/lib/types/client/effects/gestures.d.ts +1 -1
- package/lib/types/client/effects/gestures.d.ts.map +1 -1
- package/lib/types/client/effects/header-status.d.ts +1 -1
- package/lib/types/client/effects/header-status.d.ts.map +1 -1
- package/lib/types/client/effects/keyboard-avoid.d.ts +1 -1
- package/lib/types/client/effects/keyboard-avoid.d.ts.map +1 -1
- package/lib/types/client/effects/keyboard-guard.d.ts +1 -1
- package/lib/types/client/effects/keyboard-guard.d.ts.map +1 -1
- package/lib/types/client/effects/modal-back.d.ts +1 -1
- package/lib/types/client/effects/modal-back.d.ts.map +1 -1
- package/lib/types/client/effects/native-trigger-overlay.d.ts +1 -1
- package/lib/types/client/effects/native-trigger-overlay.d.ts.map +1 -1
- package/lib/types/client/effects/phone-chrome.d.ts +1 -1
- package/lib/types/client/effects/phone-chrome.d.ts.map +1 -1
- package/lib/types/client/effects/turn-fold.d.ts +1 -1
- package/lib/types/client/effects/turn-fold.d.ts.map +1 -1
- package/lib/types/client/effects/welcome-notice.d.ts +1 -1
- package/lib/types/client/effects/welcome-notice.d.ts.map +1 -1
- package/lib/types/client/effects/workbench-ref-close.d.ts +1 -1
- package/lib/types/client/effects/workbench-ref-close.d.ts.map +1 -1
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/nav-store.d.ts +2 -2
- package/lib/types/client/nav-store.d.ts.map +1 -1
- package/lib/types/client/session-dot.d.ts +11 -3
- package/lib/types/client/session-dot.d.ts.map +1 -1
- package/lib/types/client/styles/compat.css.d.ts +1 -1
- package/lib/types/client/styles/compat.css.d.ts.map +1 -1
- package/lib/types/client/styles/composer.css.d.ts +1 -1
- package/lib/types/client/styles/composer.css.d.ts.map +1 -1
- package/lib/types/client/styles/info.css.d.ts +1 -1
- package/lib/types/client/styles/info.css.d.ts.map +1 -1
- package/llms.txt +1 -1
- package/package.json +51 -27
- package/pwa/inject.js +44 -11
- package/pwa/manifest.json +1 -1
- package/pwa/offline.html +16 -5
- package/pwa/sw.js +20 -3
- package/pwa/touch-gestures.js +3 -1
- package/scripts/check-client-externals.mjs +48 -0
- package/scripts/check-compat-store.mjs +113 -0
- package/scripts/check-host-shadow.mjs +145 -0
- package/scripts/check-info-sheet-stacking.mjs +55 -0
- package/scripts/sync-doc-version.mjs +12 -7
- package/src/client/MobileAttachButton.tsx +1 -1
- package/src/client/MobileHome.tsx +33 -7
- package/src/client/MobileSessionInfo.tsx +6 -4
- package/src/client/chips-store.ts +1 -1
- package/src/client/compat/store.ts +205 -0
- package/src/client/compat/types.ts +115 -0
- package/src/client/debug.ts +1 -1
- package/src/client/effects/aionui-compat.ts +1 -1
- package/src/client/effects/gestures.ts +1 -1
- package/src/client/effects/header-status.ts +22 -3
- package/src/client/effects/keyboard-avoid.ts +1 -1
- package/src/client/effects/keyboard-guard.ts +1 -1
- package/src/client/effects/modal-back.ts +1 -1
- package/src/client/effects/native-trigger-overlay.ts +1 -1
- package/src/client/effects/phone-chrome.ts +1 -1
- package/src/client/effects/turn-fold.ts +1 -1
- package/src/client/effects/welcome-notice.ts +1 -1
- package/src/client/effects/workbench-ref-close.ts +1 -1
- package/src/client/index.tsx +66 -6
- package/src/client/nav-store.ts +2 -2
- package/src/client/session-dot.ts +13 -4
- package/src/client/styles/compat.css.ts +43 -11
- package/src/client/styles/composer.css.ts +14 -2
- package/src/client/styles/info.css.ts +21 -0
package/AGENTS.md
CHANGED
|
@@ -32,13 +32,38 @@ pnpm verify # 两个 tsconfig 的 --noEmit 类型检查
|
|
|
32
32
|
pnpm test # 网关 node:test 用例 + 三个界面自检脚本 + 文档版本号一致性检查,一条命令全跑
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
`scripts/sync-doc-version.mjs` 按 `package.json`
|
|
37
|
-
|
|
35
|
+
**版本号**:两份 README(`README.md` 英文为主文档,`README.zh-CN.md` 中文)里的
|
|
36
|
+
release 徽章和 profile 依赖示例由 `scripts/sync-doc-version.mjs` 按 `package.json`
|
|
37
|
+
改写,挂在 `version` 生命周期脚本上——`npm version patch` 会把改好的两份 README
|
|
38
|
+
带进同一个发版提交,不用手改
|
|
38
39
|
(徽章曾经一路卡在 v1.0.0 到 1.0.2)。`pnpm test` 里的 `--check` 会在漏同步时
|
|
39
40
|
把测试挂掉。文档里的锚点变了就更新那个脚本:找不到标记它直接非零退出,不会
|
|
40
41
|
默默通过。
|
|
41
42
|
|
|
43
|
+
**发版**:全部由 tag 驱动,本地只做一步。
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
npm version patch # 改 package.json + 同步两份 README + 建 commit 和 v* tag
|
|
47
|
+
git push --follow-tags # 推 tag 才是真正的触发器
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
推上去之后 `.github/workflows/publish.yml` 依次做:装依赖 → `pnpm build` →
|
|
51
|
+
**`git diff --exit-code -- lib`**(入库产物必须与重新构建的结果一致,挡住
|
|
52
|
+
「改了 src 忘了 build 就打 tag」)→ `pnpm verify` → `pnpm test` →
|
|
53
|
+
tag 名与 `package.json` 版本一致性 → `pnpm publish`(npm Trusted Publishing,
|
|
54
|
+
OIDC 无令牌,provenance 自动生成)→ **建 GitHub Release**。
|
|
55
|
+
|
|
56
|
+
Release 那步刻意排在 npm 之后:它宣告的是「这个版本已经发出去了」,npm 失败就
|
|
57
|
+
不该留下一个指向不存在版本的发布页。发布说明用 `--generate-notes` 按上一个 tag
|
|
58
|
+
以来的提交自动生成,所以**提交信息就是 changelog**,不另外维护文件。这一步可重入
|
|
59
|
+
(先 `gh release view` 查在不在,在就跳过),重跑失败的 workflow 不会因为
|
|
60
|
+
Release 已存在而挂掉。
|
|
61
|
+
|
|
62
|
+
需要人工配置的只有一处:npmjs.com 的包设置里登记可信发布者
|
|
63
|
+
`KyoMio/dsh-zen-remote` + 文件名 `publish.yml`。GitHub Release 那步用的是
|
|
64
|
+
workflow 自带的 `GITHUB_TOKEN`,不需要额外密钥——但 job 的 `permissions` 里
|
|
65
|
+
`contents` 必须是 `write`(原来是 `read`)。
|
|
66
|
+
|
|
42
67
|
## 深度文档
|
|
43
68
|
|
|
44
69
|
| 文件 | 内容 |
|
package/README.md
CHANGED
|
@@ -1,45 +1,51 @@
|
|
|
1
1
|
<h1 align="center">dsh-zen-remote</h1>
|
|
2
|
-
<p align="center"
|
|
2
|
+
<p align="center">Turn DeepSeek Harness into a phone app you can safely reach from the public internet: a mobile UI, a pairing-code gateway, install-to-home-screen, and lock-screen push.</p>
|
|
3
3
|
|
|
4
4
|
<p align="center">
|
|
5
5
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-0B7285?style=flat-square" alt="MIT"></a>
|
|
6
|
-
<img src="https://img.shields.io/badge/release-v1.1.
|
|
6
|
+
<img src="https://img.shields.io/badge/release-v1.1.12-5B4CF0?style=flat-square" alt="v1.1.12">
|
|
7
7
|
<img src="https://img.shields.io/badge/DSH-Web%20Profile-5B4CF0?style=flat-square" alt="DSH Web Profile">
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
<p align="center"><a href="README.zh-CN.md">中文文档</a></p>
|
|
11
|
+
|
|
12
|
+
| Session list home | Session page | Session info card |
|
|
11
13
|
| --- | --- | --- |
|
|
12
|
-
|  |  |  |
|
|
13
15
|
|
|
14
|
-
|
|
|
16
|
+
| Composer permission sheet | Pairing page a public visitor sees |
|
|
15
17
|
| --- | --- |
|
|
16
|
-
|  |  |
|
|
17
19
|
|
|
18
|
-
>
|
|
20
|
+
> Screenshots are a 390×844 phone viewport in the light theme; both themes are supported. The pairing page is drawn by the gateway itself and is always dark.
|
|
19
21
|
|
|
20
22
|
---
|
|
21
23
|
|
|
22
|
-
##
|
|
24
|
+
## Install
|
|
23
25
|
|
|
24
26
|
```sh
|
|
25
27
|
dsh plugin add dsh-zen-remote
|
|
26
28
|
```
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
Restart `dsh web` afterwards. The mobile UI and the gateway both come up — there is no config line to hand-write.
|
|
29
31
|
|
|
30
|
-
>
|
|
32
|
+
> **Compatibility — one build, both runtimes.** Verified live on DSH `0.1.1-rc.2` and `0.1.2-rc.1` (web profile), 2026-09-04.
|
|
33
|
+
>
|
|
34
|
+
> 0.1.2 removed `@deepseek-ai/dsh-client-runtime` and put the web UI behind a signed cookie, which would have broken the mobile UI and locked the phone out of the gateway. The plugin carries its own store engine instead of importing that package, probes for the services 0.1.2 moved (`uiWorkspace`, `uiSession`) and falls back to the 0.1.1 shapes when they are absent, reads a turn's events through either `session.events` or `session.snapshotEvents()`, and lets the gateway do the browser-token handshake on the phone's behalf — all of it inert on 0.1.1, where the token endpoint does not exist.
|
|
35
|
+
>
|
|
36
|
+
> One thing to know on 0.1.2: the web UI now rejects requests whose `Host` is not trusted. Reaching DSH through this plugin's gateway is unaffected (the gateway presents every request as `127.0.0.1`), but pointing a browser straight at `http://<LAN-IP>:3080` returns 403 unless you start `dsh web --trusted-host <host>`.
|
|
31
37
|
|
|
32
|
-
|
|
38
|
+
To uninstall: `dsh plugin remove dsh-zen-remote` (or delete the two lines from your profile's `dependencies` and `bundles`) and restart `dsh web`. To also wipe the pairing data, delete `~/.dsh/lan-gate-state.json` and `~/.dsh/lan-gate.config.json`.
|
|
33
39
|
|
|
34
40
|
<details>
|
|
35
|
-
<summary
|
|
41
|
+
<summary>Manual install / local development</summary>
|
|
36
42
|
|
|
37
|
-
|
|
43
|
+
Edit `~/.dsh/profiles/web/package.json` by hand — one line under `dependencies`, one under `bundles`:
|
|
38
44
|
|
|
39
45
|
```jsonc
|
|
40
46
|
{
|
|
41
47
|
"dependencies": {
|
|
42
|
-
"dsh-zen-remote": "^1.1.
|
|
48
|
+
"dsh-zen-remote": "^1.1.12" // for local development: "link:/path/to/dsh-zen-remote"
|
|
43
49
|
},
|
|
44
50
|
"dsh": { "profile": { "bundles": [
|
|
45
51
|
"@deepseek-ai/dsh-base",
|
|
@@ -51,28 +57,28 @@ dsh plugin add dsh-zen-remote
|
|
|
51
57
|
|
|
52
58
|
```sh
|
|
53
59
|
cd ~/.dsh/profiles/web && pnpm install
|
|
54
|
-
#
|
|
60
|
+
# restart dsh web
|
|
55
61
|
```
|
|
56
62
|
|
|
57
|
-
|
|
63
|
+
If you would rather not go through the profile install flow at all, see the static mount in [`cordis.patch.yml.example`](cordis.patch.yml.example).
|
|
58
64
|
|
|
59
65
|
</details>
|
|
60
66
|
|
|
61
67
|
---
|
|
62
68
|
|
|
63
|
-
##
|
|
69
|
+
## Setting up public access
|
|
64
70
|
|
|
65
|
-
|
|
71
|
+
Once installed, the mobile UI already works at `127.0.0.1:3080` on the machine itself. To reach it from outside, three steps.
|
|
66
72
|
|
|
67
|
-
### 1.
|
|
73
|
+
### 1. Put a reverse proxy in front for HTTPS
|
|
68
74
|
|
|
69
|
-
|
|
75
|
+
The gateway listens on `127.0.0.1:3088` only — exposing it is your reverse proxy's job. **If your home connection has no public IP, or you'd rather not open a port on your router**, skip nginx/Caddy and jump to the third block (Cloudflare Tunnel).
|
|
70
76
|
|
|
71
77
|
<details open>
|
|
72
78
|
<summary><b>nginx</b></summary>
|
|
73
79
|
|
|
74
80
|
```nginx
|
|
75
|
-
# http {}
|
|
81
|
+
# once, inside the http {} block
|
|
76
82
|
map $http_upgrade $connection_upgrade { default upgrade; '' close; }
|
|
77
83
|
|
|
78
84
|
server {
|
|
@@ -113,86 +119,88 @@ dsh.example.com {
|
|
|
113
119
|
</details>
|
|
114
120
|
|
|
115
121
|
<details open>
|
|
116
|
-
<summary><b
|
|
122
|
+
<summary><b>No public IP? Use a Cloudflare Tunnel</b></summary>
|
|
117
123
|
|
|
118
|
-
|
|
124
|
+
For when your home connection gets no public IP, or you don't want to open a router port: `cloudflared` dials out from your machine, and Cloudflare handles the domain, the certificate and the entry point. Not a single port needs opening. The free tier is enough.
|
|
119
125
|
|
|
120
|
-
|
|
126
|
+
Prerequisite: the domain is hosted on Cloudflare (nameservers pointed at it).
|
|
121
127
|
|
|
122
|
-
1.
|
|
123
|
-
2.
|
|
128
|
+
1. Open the [Zero Trust dashboard](https://one.dash.cloudflare.com/) → **Networks → Tunnels → Create a tunnel** → pick **Cloudflared**, name it. After creating it the page hands you an install command with a token in it;
|
|
129
|
+
2. Run that command on the machine running DSH (it looks like this, with the token from the page):
|
|
124
130
|
|
|
125
131
|
```sh
|
|
126
|
-
# macOS / Linux
|
|
127
|
-
cloudflared service install eyJhIjoi
|
|
132
|
+
# macOS / Linux: install as a service that starts at boot
|
|
133
|
+
cloudflared service install eyJhIjoi...your-token
|
|
128
134
|
```
|
|
129
135
|
|
|
130
|
-
3.
|
|
136
|
+
3. Back on the tunnel's detail page → **Public Hostname** → **Add a public hostname**:
|
|
131
137
|
|
|
132
|
-
|
|
|
138
|
+
| Field | Value |
|
|
133
139
|
| --- | --- |
|
|
134
|
-
| Subdomain / Domain | `dsh` / `example.com
|
|
140
|
+
| Subdomain / Domain | `dsh` / `example.com` (i.e. `dsh.example.com`) |
|
|
135
141
|
| Service Type | `HTTP` |
|
|
136
142
|
| URL | `127.0.0.1:3088` |
|
|
137
143
|
|
|
138
|
-
|
|
144
|
+
Save, and `https://dsh.example.com` is live with a Cloudflare-issued certificate. Leave the gateway's `LAN_GATE_HOST` at its `127.0.0.1` default — `cloudflared` runs on the same machine.
|
|
139
145
|
|
|
140
|
-
|
|
146
|
+
**Step 2's 403 self-check is mandatory**, and it matters most for a tunnel: `cloudflared` reaches the gateway over a loopback connection, so the only thing separating "a visitor from the internet" from "you, sitting at this computer" is whether the tunnel forwards `X-Forwarded-For`. `cloudflared` does by default, so the pairing wall works; but if your version or config strips it, public requests get treated as the local admin and the pairing wall is decorative. **Load `/lan-gate/admin` over mobile data — a 403 is the only safe answer.**
|
|
141
147
|
|
|
142
|
-
>
|
|
148
|
+
> Note: you do not need `LAN_GATE_TRUSTED_PROXIES` here. The gateway already trusts a loopback connection as a reverse proxy, so setting it to `127.0.0.1` is a no-op — and it is **not** a substitute for the self-check above.
|
|
143
149
|
>
|
|
144
|
-
> Cloudflare
|
|
150
|
+
> Cloudflare's free tier supports WebSockets (DSH's conversation stream needs them) and caps a request body at 100MB, above this plugin's 20MB upload default, so nothing is affected.
|
|
145
151
|
|
|
146
|
-
|
|
152
|
+
The CLI route (`cloudflared tunnel login` / `create` / `route dns` plus an `ingress` block in `config.yml`) is in [docs/remote-access.en.md](docs/remote-access.en.md#cloudflare-tunnel--getting-in-without-a-public-ip).
|
|
147
153
|
</details>
|
|
148
154
|
|
|
149
|
-
Lucky
|
|
155
|
+
For Lucky (routers/NAS), see [docs/remote-access.en.md](docs/remote-access.en.md#lucky). When the proxy and the gateway are on different machines, put the proxy's egress IP in `LAN_GATE_TRUSTED_PROXIES`.
|
|
150
156
|
|
|
151
|
-
### 2.
|
|
157
|
+
### 2. Self-check
|
|
152
158
|
|
|
153
|
-
|
|
159
|
+
From **mobile data** (not your home Wi-Fi), open `https://your-domain/lan-gate/admin`. The correct result is a **403**.
|
|
154
160
|
|
|
155
|
-
|
|
161
|
+
If you can see the admin page, your proxy isn't sending the `X-Forwarded-*` headers and public requests are being treated as local ones. Go back and fix the forwarded headers before continuing.
|
|
156
162
|
|
|
157
|
-
### 3.
|
|
163
|
+
### 3. Pair a device
|
|
158
164
|
|
|
159
165
|
```sh
|
|
160
|
-
#
|
|
166
|
+
# on the machine running DSH, in a browser on that machine
|
|
161
167
|
open http://127.0.0.1:3088/lan-gate/admin
|
|
162
168
|
```
|
|
163
169
|
|
|
164
|
-
1.
|
|
165
|
-
2.
|
|
166
|
-
3.
|
|
167
|
-
4.
|
|
168
|
-
5.
|
|
170
|
+
1. Click "Generate pairing code" for an 8-character code (valid 10 minutes, single use);
|
|
171
|
+
2. On the phone, open your HTTPS domain and enter the code on the pairing page;
|
|
172
|
+
3. Once paired you land in DSH. Identity lives in a long-lived cookie, so switching networks doesn't log you out;
|
|
173
|
+
4. Use the browser's "Add to Home Screen" to install it as an app;
|
|
174
|
+
5. Grant notification permission, and the agent reaches your lock screen when it needs you.
|
|
169
175
|
|
|
170
|
-
|
|
176
|
+
The admin page can also rename devices, change a device's type, and revoke devices one at a time or all at once.
|
|
171
177
|
|
|
172
178
|
---
|
|
173
179
|
|
|
174
|
-
##
|
|
180
|
+
## Optional configuration
|
|
175
181
|
|
|
176
|
-
|
|
182
|
+
Environment variables, or `~/.dsh/lan-gate.config.json` (keys are the variable names minus the prefix, camelCased — `port`, `trustedProxies`; an explicit env var wins). Restart `dsh web` after changing anything.
|
|
177
183
|
|
|
178
|
-
|
|
|
184
|
+
| Variable | Default | What it does |
|
|
179
185
|
| --- | --- | --- |
|
|
180
|
-
| `LAN_GATE_PORT` | `3088` |
|
|
181
|
-
| `LAN_GATE_HOST` | `127.0.0.1` |
|
|
182
|
-
| `LAN_GATE_TARGET_PORT` | `3080` |
|
|
183
|
-
| `LAN_GATE_RATE_LIMIT` | `120` |
|
|
184
|
-
| `LAN_GATE_TRUSTED_PROXIES` |
|
|
185
|
-
| `LAN_GATE_VAPID_SUBJECT` | `mailto:admin@localhost` |
|
|
186
|
-
| `
|
|
187
|
-
| `
|
|
188
|
-
| `
|
|
189
|
-
| `
|
|
190
|
-
| `
|
|
191
|
-
| `
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
186
|
+
| `LAN_GATE_PORT` | `3088` | Gateway port; if taken it retries upward (up to +20) |
|
|
187
|
+
| `LAN_GATE_HOST` | `127.0.0.1` | Listen address; only open this up when the proxy is on another machine |
|
|
188
|
+
| `LAN_GATE_TARGET_PORT` | `3080` | Local DSH Web UI port |
|
|
189
|
+
| `LAN_GATE_RATE_LIMIT` | `120` | Per-minute cap on unpaired requests, counted per real client IP |
|
|
190
|
+
| `LAN_GATE_TRUSTED_PROXIES` | empty | Comma-separated IPs; required when the proxy is on another machine |
|
|
191
|
+
| `LAN_GATE_VAPID_SUBJECT` | `mailto:admin@localhost` | Push contact. **On iOS this must be a real email or https URL**, or Apple refuses to deliver |
|
|
192
|
+
| `LAN_GATE_LANG` | `auto` | Language of the pairing page, the admin page and the push opt-in card. `auto` follows the browser's `Accept-Language` (falling back to Chinese when there is none); `zh`/`en` pin it |
|
|
193
|
+
| `DSH_PUSH_TURN_END` | **off** | Set `1` to also push when a turn ends. Off by default — a finished turn doesn't mean you're needed (it pushed by default before 1.0.3; this was a behaviour change). Approval-pending and question-pending notifications are unaffected and always fire |
|
|
194
|
+
| `DSH_PUSH_EVENTS` | `agent/turn-stopping` | Which events count as "turn ended", comma-separated; only meaningful with `DSH_PUSH_TURN_END=1` |
|
|
195
|
+
| `DSH_PUSH_DEBOUNCE_MS` | `15000` | Minimum gap between two automatic pushes; approval/question notifications are never suppressed by it |
|
|
196
|
+
| `DSH_PUSH_SUMMARY` | off | Set `1` to include this turn's final reply (prose only, never the reasoning; clipped to 120 chars) and the question text |
|
|
197
|
+
| `DSH_PUSH_TOOL` | on | Set `0` to remove the model-callable `push_notify` tool |
|
|
198
|
+
| `DSH_PUSH_LANG` | `zh` | Language of the notification copy. A notification carries no signal about who will read it, and the host process has no reliable system locale either (launchd starts it without `LANG`), so this is not autodetected: set `en` for English |
|
|
199
|
+
| `DSH_PUSH_APPROVAL_GRACE_MS` | `5000` | How long to wait before pushing "approval pending". With a plugin that answers approvals automatically (dsh-auto-approve and the like) installed, the push waits for its verdict — answered means no push. A slower judge still gets pushed over, so raise this if yours is |
|
|
200
|
+
|
|
201
|
+
The upload size limit (20MB by default) is `config.maxUploadBytes` on the plugin row.
|
|
202
|
+
|
|
203
|
+
To enable turn-process folding on desktop too (it only applies at phone widths by default), set `config.turnFoldDesktop` to `true` on the plugin row — that is, add this to the profile's `cordis.patch.yml`:
|
|
196
204
|
|
|
197
205
|
```yaml
|
|
198
206
|
- id: dsh-zen-remote
|
|
@@ -200,15 +208,15 @@ open http://127.0.0.1:3088/lan-gate/admin
|
|
|
200
208
|
turnFoldDesktop: true
|
|
201
209
|
```
|
|
202
210
|
|
|
203
|
-
|
|
211
|
+
Restart `dsh web` afterwards. Without touching the server config, a single browser can also turn it on for itself by visiting `?mobile-nav-turn-fold=1` once (`=0` turns it off; remembered per browser).
|
|
204
212
|
|
|
205
|
-
|
|
213
|
+
**Three calibration values for the soft-keyboard lift.** On a few phones the system never tells the browser how tall the keyboard is (measured: certain third-party IMEs plus Chrome; the PWA shell Xiaomi's browser installs). With no measurable signal at all, the plugin has to lift the input box by estimate. The estimate is tuned to one reported device, so it may be too high or too low on yours — all three numbers are adjustable on the plugin row:
|
|
206
214
|
|
|
207
|
-
|
|
|
215
|
+
| Setting | Default | Meaning | Allowed range |
|
|
208
216
|
| --- | --- | --- | --- |
|
|
209
|
-
| `keyboardLiftRatio` | `0.42` |
|
|
210
|
-
| `keyboardLiftMaxPx` | `400` |
|
|
211
|
-
| `keyboardSafetyPadPx` | `15` |
|
|
217
|
+
| `keyboardLiftRatio` | `0.42` | Estimate the lift as this fraction of screen height | 0 – 1 |
|
|
218
|
+
| `keyboardLiftMaxPx` | `400` | Cap on the estimate (pixels), so the input box doesn't end up mid-screen on a tall phone | 0 – 2000 |
|
|
219
|
+
| `keyboardSafetyPadPx` | `15` | A little extra clearance above the keyboard, **Android only**. Third-party IMEs routinely under-report their own height (leaving out the toolbar strip above the keys); this makes up for it | 0 – 200 |
|
|
212
220
|
|
|
213
221
|
```yaml
|
|
214
222
|
- id: dsh-zen-remote
|
|
@@ -217,118 +225,104 @@ open http://127.0.0.1:3088/lan-gate/admin
|
|
|
217
225
|
keyboardSafetyPadPx: 30
|
|
218
226
|
```
|
|
219
227
|
|
|
220
|
-
|
|
228
|
+
How to tune: if the box is lifted **too little** (the keyboard still covers part of it), raise `keyboardLiftRatio` in steps of 0.03; if it's lifted **too far** (a gap opens between the box and the keyboard), lower it. If it's off by only a little (tens of pixels, on Android), reach for `keyboardSafetyPadPx` first. Leaving all three unset keeps today's behaviour exactly; out-of-range values are clamped to the table above, so the input box can never be pushed off-screen. Phones that report properly take the measured path and none of these values affect them.
|
|
221
229
|
|
|
222
230
|
---
|
|
223
231
|
|
|
224
|
-
##
|
|
232
|
+
## When notifications fire
|
|
225
233
|
|
|
226
|
-
|
|
234
|
+
By default only when you are **actually needed**, along two independent lines.
|
|
227
235
|
|
|
228
|
-
|
|
236
|
+
**1. Decided by the system (always on, never suppressed by the debounce)**
|
|
229
237
|
|
|
230
|
-
|
|
|
238
|
+
| Situation | Notification |
|
|
231
239
|
| --- | --- |
|
|
232
|
-
|
|
|
233
|
-
|
|
|
240
|
+
| A tool is waiting for your authorization | "DSH needs your approval", with the tool name |
|
|
241
|
+
| The model called `ask_user_question` and is waiting | "DSH is waiting for your answer" |
|
|
234
242
|
|
|
235
|
-
|
|
236
|
-
`DSH_PUSH_DEBOUNCE_MS` 压制**:「有操作等你点头」是最不能被吞掉的一条。
|
|
243
|
+
Neither looks at session depth — a subagent stuck on an approval still calls out, because it's still you it's waiting for. Neither is suppressed by `DSH_PUSH_DEBOUNCE_MS` either: "something needs your nod" is the one notification that must never be swallowed.
|
|
237
244
|
|
|
238
|
-
|
|
239
|
-
所以推送并不是一见到 asked 就发,而是等 `DSH_PUSH_APPROVAL_GRACE_MS`(默认 5 秒)
|
|
240
|
-
——这段时间内被答复掉的就不推。这个窗口原来是 1.5 秒,按「答复者都在同一个 tick
|
|
241
|
-
内结算」设计的;那对同步答复者成立,但对模型答复者不成立(实测平均 2.4 秒),
|
|
242
|
-
结果是自动通过的请求照样推了一条「等你授权」,通知到了、框却从来没出现。
|
|
243
|
-
换了更慢的判定模型就把这个值调大。
|
|
245
|
+
**Timing when a machine answers**: approval events arrive as "record asked → consult the answerer → record decided", so the push doesn't fire the moment `asked` appears — it waits `DSH_PUSH_APPROVAL_GRACE_MS` (5 seconds by default) and skips anything answered within it. That window used to be 1.5s, designed around "every answerer settles in the same tick". True for a synchronous answerer, not for a model-backed one (measured: 2.4s average), and the result was a "needs your approval" push for a request that was auto-allowed — notification delivered, dialog never shown. Raise it if you switch to a slower judge.
|
|
244
246
|
|
|
245
|
-
|
|
246
|
-
只有真正悬着没人管的才推。
|
|
247
|
+
Approvals a policy waves through don't disturb you: after the request lands, the push waits 1.5s and cancels if the matching "decided" arrives. Only genuinely unattended ones go out.
|
|
247
248
|
|
|
248
|
-
|
|
249
|
+
**2. Decided by the model**
|
|
249
250
|
|
|
250
|
-
`push_notify`
|
|
251
|
-
出现你大概率想立刻知道的意外。不该调的场景(常规回合结束、进度汇报、它自己能推进
|
|
252
|
-
的事)同样写在工具描述里——只写前者会让它每回合都调。会话开始还会注入一段同源的
|
|
253
|
-
上下文强化,和工具描述共用一个常量,不会各改各的。
|
|
251
|
+
The `push_notify` tool. The model should call it when you explicitly asked to be told when something finished, when it needs you to continue, or when something unexpected happened that you'd probably want to know right away. The tool description also spells out when *not* to call it (routine turn ends, progress reports, anything it can push forward on its own) — listing only the former turns it into a per-turn reflex. The same guidance is injected as standing session context, from one shared constant, so the two cannot drift apart.
|
|
254
252
|
|
|
255
|
-
|
|
253
|
+
**What does not fire by default**
|
|
256
254
|
|
|
257
|
-
-
|
|
258
|
-
|
|
259
|
-
- **子代理跑完永远不推**,无论上面那个开关。
|
|
255
|
+
- **A plain finished turn does not push** (changed in 1.0.3; before that every turn did). Getting work done isn't the same as needing you. Set `DSH_PUSH_TURN_END=1` for the old behaviour.
|
|
256
|
+
- **A subagent finishing never pushes**, regardless of that switch.
|
|
260
257
|
|
|
261
|
-
|
|
262
|
-
的最终回复——只取正文,不含思考过程;这一轮没说话就退回「最后执行了 xx 工具」,不拿思考内容凑数。
|
|
263
|
-
推送 payload 是 aes128gcm 端到端加密的。
|
|
258
|
+
**What's in a notification**: by default the title only, with no conversation content. With `DSH_PUSH_SUMMARY=1` the body carries this turn's final reply — prose only, never the reasoning; a turn that produced no prose falls back to "Last executed: <tool>" rather than padding it out with thinking text. The push payload is aes128gcm end-to-end encrypted.
|
|
264
259
|
|
|
265
260
|
---
|
|
266
261
|
|
|
267
|
-
##
|
|
262
|
+
## Features
|
|
268
263
|
|
|
269
|
-
-
|
|
270
|
-
-
|
|
271
|
-
- composer
|
|
272
|
-
-
|
|
273
|
-
-
|
|
274
|
-
-
|
|
275
|
-
-
|
|
276
|
-
-
|
|
277
|
-
-
|
|
278
|
-
-
|
|
279
|
-
-
|
|
280
|
-
- `push_notify`
|
|
281
|
-
-
|
|
264
|
+
- Two-level page stack — session list home plus a standalone session page, pushed in and out horizontally
|
|
265
|
+
- Plugin entry chips on the home screen, appearing automatically for what you have installed, individually hideable
|
|
266
|
+
- Reworked composer: controls become icons, the permission and model menus become bottom sheets
|
|
267
|
+
- Session info card: six stats plus export log / rename / fork / archive
|
|
268
|
+
- Reasoning and tool calls within one turn fold into a single "process · N steps" row by default
|
|
269
|
+
- Gestures: swipe right from the left edge to go back, swipe down to dismiss a bottom sheet. Android's system back gesture is taken over as "close the overlay → back to the list → leave the app", instead of quitting the PWA on the first press
|
|
270
|
+
- Local attachment upload from the phone: files land in the session's working directory under `.dsh-uploads/` and an `@` reference is appended to the composer — sending it is still your call
|
|
271
|
+
- A pairing code buys a long-lived device token; identity follows the token, not the IP, and can be revoked at any time
|
|
272
|
+
- The admin surface (generate a code / manage devices / trigger a push) only accepts direct local connections; anything through the proxy gets a 403
|
|
273
|
+
- A real PWA: manifest plus service worker, installable to the home screen, opens offline
|
|
274
|
+
- Real Web Push: VAPID plus aes128gcm, no conversation body by default; fires only for approvals and questions, no longer on every turn end (see above)
|
|
275
|
+
- The `push_notify` tool: the model can push at a moment that matters, rate-limited
|
|
276
|
+
- The "internal testing notice" dialog gets a "don't show again" option: remote access re-shows the notice on every reload, and one click makes this device remember and dismiss it from then on
|
|
282
277
|
|
|
283
|
-
|
|
278
|
+
In depth: [interface](docs/interface.md) · [public access](docs/remote-access.en.md)
|
|
284
279
|
|
|
285
280
|
---
|
|
286
281
|
|
|
287
|
-
##
|
|
282
|
+
## Third-party plugins with mobile support
|
|
288
283
|
|
|
289
|
-
|
|
290
|
-
没装该插件时规则不生效,装了未列出的插件也不会被误伤。
|
|
284
|
+
The mobile UI has specific adaptations for the plugins below. Every adaptation is anchored on that plugin's own DOM markers: if you don't have it installed the rules simply don't match, and installing a plugin that isn't listed here can't be caught in the crossfire.
|
|
291
285
|
|
|
292
|
-
|
|
|
286
|
+
| Plugin | What the mobile adaptation does | Version tested |
|
|
293
287
|
| --- | --- | --- |
|
|
294
|
-
| [dsh-better-sidebar](https://github.com/omdsh-dev/DSH-better-sidebar) |
|
|
295
|
-
| [@nanmicoder/dsh-agent-teams](https://github.com/NanmiCoder/dsh-agent-teams) | AgentTeams
|
|
296
|
-
| [@ychris12138/dsh-usage-stats](https://github.com/Ychris12138/dsh-usage-stats) |
|
|
297
|
-
| [@opendsh/dsh-plugin-scheduled-tasks](https://github.com/Ceelog/dsh-plugins) |
|
|
298
|
-
| dsh-at-file |
|
|
299
|
-
| [@ace-zone/dsh-market](https://www.npmjs.com/package/@ace-zone/dsh-market) |
|
|
300
|
-
| [dsh-vision-toolkit](https://www.npmjs.com/package/@anionex/dsh-vision-toolkit) |
|
|
301
|
-
| [dsh-web-ui
|
|
288
|
+
| [dsh-better-sidebar](https://github.com/omdsh-dev/DSH-better-sidebar) | A workbench entry button in the session page header; the panel becomes a full-width phone drawer that respects the notch safe area, with a centred close button at the bottom | 0.15.0 |
|
|
289
|
+
| [@nanmicoder/dsh-agent-teams](https://github.com/NanmiCoder/dsh-agent-teams) | The AgentTeams activity overlay moves below the session header (its original position covered the header buttons) and hides itself on the session list; a subagent session keeps a tappable parent-session title in its header for jumping back | 0.1.9 |
|
|
290
|
+
| [@ychris12138/dsh-usage-stats](https://github.com/Ychris12138/dsh-usage-stats) | Usage and balance entries fold into the home-screen chips row | 0.2.9 |
|
|
291
|
+
| [@opendsh/dsh-plugin-scheduled-tasks](https://github.com/Ceelog/dsh-plugins) | The scheduled-tasks entry folds into the home-screen chips row | 0.2.3 |
|
|
292
|
+
| dsh-at-file | `@` file references, used alongside attachment upload's `@` paths. It and this plugin's attachment chips read the same draft token, so on the phone its `.dsh-uploads/` rows are hidden to stop one file being drawn twice (thumbnail plus filename); other `@` references are left alone | 0.6.7 |
|
|
293
|
+
| [@ace-zone/dsh-market](https://www.npmjs.com/package/@ace-zone/dsh-market) | The plugin market dialog's top bar doesn't fit on a phone and the × gets squeezed out of the panel (no Esc on a touchscreen, so it can't be closed at all). Three decorative slots — tagline, version, homepage link — are hidden, the title shrinks with an ellipsis, and the language switch and × stay with a bigger tap target | 0.1.66 |
|
|
294
|
+
| [dsh-vision-toolkit](https://www.npmjs.com/package/@anionex/dsh-vision-toolkit) | Image Q&A / OCR, used with phone-side attachment upload | — |
|
|
295
|
+
| [dsh-web-ui suite](https://www.npmjs.com/package/@linxin666/dsh-web-ui-all) | Inherits the compatibility rules from upstream dsh-web-mobile (file tree, width-capped centred preview overlay, and so on) | — |
|
|
302
296
|
|
|
303
|
-
|
|
297
|
+
The technical detail behind each adaptation — anchor selectors, breakpoints, what was traded away — is in the "compatible plugins" section of the [interface doc](docs/interface.md).
|
|
304
298
|
|
|
305
299
|
---
|
|
306
300
|
|
|
307
|
-
##
|
|
301
|
+
## Known issues
|
|
308
302
|
|
|
309
|
-
**iOS 26.x
|
|
303
|
+
**iOS 26.x standalone PWA viewport shrinkage**: after adding to the home screen, the viewport loses a status-bar's height at the bottom; an ordinary Safari tab is fine. This is an iOS defect — the missing region is outside the document and CSS cannot reach it. The plugin ships three layers of mitigation (light manifest background, safe-area compensation, forced reflow) which reduce it without guaranteeing a fix. Only quitting and reopening the whole app restores it fully.
|
|
310
304
|
|
|
311
|
-
|
|
305
|
+
**In a few environments the soft keyboard is completely invisible to the browser, and the lift falls back to an estimate**: in some combinations (measured: certain third-party IMEs plus Chrome; the PWA shell installed by Xiaomi's browser) the system never tells the page the keyboard's height when it opens or closes — the viewport doesn't change and no event fires (visualViewport and the VirtualKeyboard API both fail; both ruled out by measurement). The fallback: probe for about 1.2s after focus, and if the keyboard is judged invisible, lift the input box by the estimated height (the verdict is remembered per browser, so later focuses lift immediately). Two costs: the lift is an estimate and can be tens of pixels off the real keyboard, and there's no signal for the keyboard closing either, so the box only drops back once you tap or scroll outside it. Normal environments never take this path. If the lift is visibly off you don't need to change code — `keyboardLiftRatio` / `keyboardLiftMaxPx` / `keyboardSafetyPadPx` on the plugin row are there to be tuned to your device; see the configuration section above.
|
|
312
306
|
|
|
313
|
-
|
|
307
|
+
**Settings pages don't open through the reverse proxy (the plugin config list is blank, model cards report "settings are unavailable in this browser")**: connecting directly to `127.0.0.1:3080/3088` works fine.
|
|
314
308
|
|
|
315
|
-
|
|
309
|
+
The root cause is DSH's own design, not the gateway: settings RPCs are **loopback-only**. The client decides from `location.hostname` (`isLoopback` in `dsh-client-connection`), and off-loopback `dsh-client-ui-settings` degrades persistence to `memory`, so the settings mirror starts out `unavailable` — the upstream source comment reads, verbatim, "remote browsers remain process-local because settings RPCs are loopback-only". Every card that depends on that mirror (models, plugin config) goes blank together. Nothing to do with this plugin or with service worker caching (verified 2026-08-20 by USB-debugging a real device against a local control).
|
|
316
310
|
|
|
317
|
-
|
|
311
|
+
Workaround: change settings from a browser on the machine running DSH. The config lives in the backend, and nothing else on the phone side is affected. Making settings remotely editable requires upstream to relax that restriction.
|
|
318
312
|
|
|
319
313
|
---
|
|
320
314
|
|
|
321
|
-
##
|
|
315
|
+
## Permissions and data
|
|
322
316
|
|
|
323
|
-
-
|
|
324
|
-
-
|
|
325
|
-
-
|
|
317
|
+
- **Network**: the gateway listens on the local machine only (`127.0.0.1:3088` by default); what gets exposed is entirely up to your reverse proxy or tunnel. Push travels through the browser vendor's push service (the content is aes128gcm end-to-end encrypted, so the vendor can't read it). The plugin itself reports nothing to any third party.
|
|
318
|
+
- **Files**: attachment uploads are written only to `.dsh-uploads/` inside the current session's working directory; pairing state and config live in `~/.dsh/lan-gate-state.json` and `lan-gate.config.json`.
|
|
319
|
+
- **Credentials**: no account or password is ever collected or stored; a device's identity is a random token this plugin issues itself, in an HttpOnly cookie.
|
|
326
320
|
|
|
327
|
-
|
|
321
|
+
Troubleshooting: runtime logs are in `~/.dsh/logs/web.log` (gateway and push lines are prefixed `[dsh-zen-remote-*]`); the phone UI has a debug badge for self-checks (tap the home screen's top bar five times to toggle it). Please report security issues privately through GitHub Security Advisories rather than opening a public issue.
|
|
328
322
|
|
|
329
|
-
##
|
|
323
|
+
## Upstream credits
|
|
330
324
|
|
|
331
|
-
|
|
325
|
+
This plugin's interface layer derives from [mexiaosqwq/dsh-web-mobile](https://github.com/mexiaosqwq/dsh-web-mobile), and its channel layer from [zylzyqzz/dsh-mobile-pwa](https://github.com/zylzyqzz/dsh-mobile-pwa) (itself derived from [Bernardxu123/dsh-mobile-gate](https://github.com/Bernardxu123/dsh-mobile-gate)), both MIT. The original copyright lines are preserved in [LICENSE](LICENSE).
|
|
332
326
|
|
|
333
327
|
## License
|
|
334
328
|
|