dsh-web-mobile-pmsfh 3.2.5 → 3.2.6
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/README.en.md +190 -42
- package/README.md +133 -46
- package/mobile/app.js +11 -5
- package/package.json +4 -3
package/README.en.md
CHANGED
|
@@ -2,69 +2,118 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](README.md) | **English**
|
|
4
4
|
|
|
5
|
-
A dedicated mobile page for DeepSeek Harness: open the main site on a mobile
|
|
5
|
+
A dedicated mobile page for DeepSeek Harness: open the main site on a mobile
|
|
6
|
+
device and you land in a separate interface built for narrow screens, with
|
|
7
|
+
sessions, conversations, attachments, and approvals in one place. The desktop
|
|
8
|
+
interface and the upstream repository stay untouched.
|
|
6
9
|
|
|
7
|
-
It serves a standalone mobile
|
|
10
|
+
It serves a standalone mobile page at `/dsh-web-mobile-pmsfh/`, calls DSH's own
|
|
11
|
+
APIs directly, does not load the official frontend, and does not modify
|
|
12
|
+
official code.
|
|
8
13
|
|
|
9
14
|
[](LICENSE)
|
|
10
15
|
[](https://github.com/topics/dsh-plugin)
|
|
16
|
+
[](https://www.npmjs.com/package/dsh-web-mobile-pmsfh)
|
|
11
17
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
12
18
|
|
|
13
19
|
## Features
|
|
14
20
|
|
|
15
|
-
- **Sessions**: grouped by workspace and collapsible
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
- **Sessions**: grouped by workspace and collapsible, plus "Ungrouped"; create,
|
|
22
|
+
rename, and delete workspaces — deleting only removes a workspace from the
|
|
23
|
+
list, keeping the directory and session records, and its sessions move to
|
|
24
|
+
"Ungrouped"; long-press a session to archive it; creating a session picks the
|
|
25
|
+
workspace through an inline directory browser and a permission level (Read
|
|
26
|
+
Only / Workspace Write / Full access; only Full access requires a risk
|
|
27
|
+
confirmation)
|
|
28
|
+
- **Conversations**: streaming output, collapsible reasoning, a notice when
|
|
29
|
+
context is compacted; markdown and code block rendering, stop while
|
|
30
|
+
generating, queued messages stay visible, paginated history as you scroll up,
|
|
31
|
+
stick to the bottom with a one-tap return
|
|
32
|
+
- **Attachments**: pick files on the device, upload for a receipt, and send them
|
|
33
|
+
with the next message through the official conversation attachment channel;
|
|
34
|
+
8 MB per file, removable before sending, not written to the workspace
|
|
35
|
+
- **Approvals**: out-of-scope operations raise an approval card with allow
|
|
36
|
+
once, deny, later, or a custom command of your own
|
|
19
37
|
- **Models**: switch model and reasoning level within a session
|
|
20
38
|
- **Files**: list and download workspace files, read-only
|
|
21
|
-
- **Interface**: Chinese and English follow the browser, light and dark follow
|
|
39
|
+
- **Interface**: Chinese and English follow the browser, light and dark follow
|
|
40
|
+
the system; the composer rides above the soft keyboard; "Open desktop
|
|
41
|
+
version" at the bottom of the list applies to this browsing session only,
|
|
42
|
+
and a floating "📱" button appears in the corner after switching to return to
|
|
43
|
+
the mobile page; uses the existing DSH login state with guidance when it
|
|
44
|
+
expires and a sign-out action
|
|
22
45
|
|
|
23
46
|
## Quick Start
|
|
24
47
|
|
|
25
|
-
Requirements: DSH `0.2.2-rc.1` (see Compatibility), Node 24 or later, and
|
|
48
|
+
Requirements: DSH `0.2.2-rc.1` (see Compatibility), Node.js 24 or later, and
|
|
49
|
+
pnpm for the `dsh plugin` command — enable it through corepack or install it
|
|
50
|
+
globally:
|
|
26
51
|
|
|
27
|
-
```
|
|
52
|
+
```bash
|
|
28
53
|
corepack enable
|
|
29
54
|
```
|
|
30
55
|
|
|
31
56
|
or
|
|
32
57
|
|
|
33
|
-
```
|
|
58
|
+
```bash
|
|
34
59
|
npm i -g pnpm
|
|
35
60
|
```
|
|
36
61
|
|
|
37
|
-
Once pnpm is available, install the plugin
|
|
62
|
+
Once pnpm is available, install the plugin one of two ways; after installing,
|
|
63
|
+
restart DSH, adjusting the restart command to how your deployment runs it.
|
|
38
64
|
|
|
39
|
-
|
|
65
|
+
### Option 1: Install from npm
|
|
66
|
+
|
|
67
|
+
Ready to use, with update prompts when new versions are released:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
dsh plugin --profile web add dsh-web-mobile-pmsfh
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Option 2: Install from source
|
|
74
|
+
|
|
75
|
+
For your own modifications; keep the cloned directory, since updates are pulled
|
|
76
|
+
inside it:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
40
79
|
git clone https://github.com/renlang119/dsh-web-mobile-pmsfh.git
|
|
41
80
|
dsh plugin --profile web add ./dsh-web-mobile-pmsfh
|
|
42
81
|
```
|
|
43
82
|
|
|
44
|
-
The `dsh plugin` command above installs the plugin for the server started by
|
|
83
|
+
The `dsh plugin` command above installs the plugin for the server started by
|
|
84
|
+
`dsh web`. The DSH desktop client manages its own plugins; to use it there too,
|
|
85
|
+
open Settings → Plugins in the client.
|
|
45
86
|
|
|
46
|
-
|
|
87
|
+
If your npm points at a regional mirror and cannot find the package, append
|
|
88
|
+
`--registry=https://registry.npmjs.org`.
|
|
47
89
|
|
|
48
|
-
|
|
90
|
+
Restart command example:
|
|
49
91
|
|
|
50
|
-
```
|
|
92
|
+
```bash
|
|
51
93
|
sudo systemctl restart dsh-web
|
|
52
94
|
```
|
|
53
95
|
|
|
54
|
-
First visit: opening the main site on a mobile device redirects automatically,
|
|
96
|
+
First visit: opening the main site on a mobile device redirects automatically,
|
|
97
|
+
or you can open `https://<domain>/dsh-web-mobile-pmsfh/` directly; if it does
|
|
98
|
+
not redirect, check whether "Open desktop version" was chosen in this browsing
|
|
99
|
+
session — that preference is session-scoped (sessionStorage) and resets when
|
|
100
|
+
the page is closed and reopened.
|
|
55
101
|
|
|
56
102
|
## Compatibility
|
|
57
103
|
|
|
58
104
|
| DSH | Status |
|
|
59
105
|
| --- | --- |
|
|
60
|
-
| `0.2.2-rc.1` | Supported
|
|
106
|
+
| `0.2.2-rc.1` | Supported |
|
|
61
107
|
| other `0.2.x` | Untested; endpoint signatures may differ |
|
|
62
108
|
|
|
63
109
|
## Tech Stack
|
|
64
110
|
|
|
65
|
-
Node 24 · DeepSeek Harness `0.2.2-rc.1` · Cordis plugin · vanilla
|
|
111
|
+
Node.js 24 · DeepSeek Harness `0.2.2-rc.1` · Cordis plugin · vanilla
|
|
112
|
+
JavaScript (no build) · markdown-it
|
|
66
113
|
|
|
67
|
-
The mobile page is a single-page vanilla JS app; it does not load the official
|
|
114
|
+
The mobile page is a single-page vanilla JS app; it does not load the official
|
|
115
|
+
frontend or go through a bundler, and it has no extra runtime dependencies —
|
|
116
|
+
clone and run.
|
|
68
117
|
|
|
69
118
|
## Project Structure
|
|
70
119
|
|
|
@@ -81,14 +130,27 @@ dsh-web-mobile-pmsfh/
|
|
|
81
130
|
└─ tsconfig.json type-check only, no emit
|
|
82
131
|
```
|
|
83
132
|
|
|
84
|
-
##
|
|
133
|
+
## Architecture
|
|
85
134
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
135
|
+
The plugin has three parts, all inside the plugin directory, with zero changes
|
|
136
|
+
to the main repository; `cordis.patch.yml` inserts the plugin into the
|
|
137
|
+
profile's layer stack:
|
|
138
|
+
|
|
139
|
+
| Part | Role |
|
|
140
|
+
| --- | --- |
|
|
141
|
+
| `lib/index.js` | Host half: static routes behind the DSH login gate |
|
|
142
|
+
| `client/client.js` | Client half: bounces phones (coarse pointer, ≤ 768px) to the mobile page |
|
|
143
|
+
| `mobile/` | The mobile page: a vanilla JS single-page app, no official frontend, no bundler |
|
|
144
|
+
|
|
145
|
+
The mobile page talks to DSH exclusively through DSH's own wire protocol
|
|
146
|
+
(Typert Gateway) — there are no plugin-private endpoints:
|
|
147
|
+
|
|
148
|
+
- `POST /api/<method>`: unary RPC (sessions, workspaces, models, files, …)
|
|
149
|
+
- `WS /api/remote.mux`: frame-multiplexed long connection (session journal
|
|
150
|
+
streams, workspace baselines, the event bus)
|
|
151
|
+
- `POST /api/$events/result`: approval and question answers
|
|
90
152
|
|
|
91
|
-
|
|
153
|
+
Five resource routes, plus a bare-path 302 redirect:
|
|
92
154
|
|
|
93
155
|
| Path | Content |
|
|
94
156
|
| --- | --- |
|
|
@@ -96,28 +158,99 @@ dsh-web-mobile-pmsfh/
|
|
|
96
158
|
| `/dsh-web-mobile-pmsfh/app.js` | Page script |
|
|
97
159
|
| `/dsh-web-mobile-pmsfh/app.css` | Page styles |
|
|
98
160
|
| `/dsh-web-mobile-pmsfh/vendor/markdown-it.min.js` | Markdown rendering |
|
|
99
|
-
| `/dsh-web-mobile-pmsfh/vendor/markdown-it-cjk-friendly.min.js` | `**` handling for CJK
|
|
161
|
+
| `/dsh-web-mobile-pmsfh/vendor/markdown-it-cjk-friendly.min.js` | `**` handling for CJK |
|
|
100
162
|
|
|
101
|
-
|
|
163
|
+
Page files are read from disk per request (`no-cache`, 304 when unchanged), so
|
|
164
|
+
a plugin update plus a dsh-web restart takes effect immediately; vendor files
|
|
165
|
+
are content-hash cached for 30 days (`immutable`).
|
|
166
|
+
|
|
167
|
+
## DSH API Dependencies
|
|
168
|
+
|
|
169
|
+
The mobile page calls these internal DSH endpoints directly
|
|
170
|
+
(`session/follow`, `workspace/follow`, and `$events` ride the mux connection;
|
|
171
|
+
the rest are unary RPC):
|
|
172
|
+
|
|
173
|
+
| Endpoint | Purpose |
|
|
174
|
+
| --- | --- |
|
|
175
|
+
| `session/list`/`session/create`/`session/prompt`/`session/cancel` | List/create/prompt/stop |
|
|
176
|
+
| `session/selectModel` / `session/modelCatalog` | Model and reasoning level |
|
|
177
|
+
| `session/page` / `session/follow` | Paginated history and the live journal stream |
|
|
178
|
+
| `workspace/create` / `workspace/rename` / `workspace/delete` | Workspace management |
|
|
179
|
+
| `workspace/archiveSession` / `workspace/follow` | Archive sessions; workspace baseline stream |
|
|
180
|
+
| `directoryPicker/list` / `directoryPicker/createDirectory` | New-workspace directory browser |
|
|
181
|
+
| `commands/execute` | Permission preset setup (the `/permission` command) |
|
|
182
|
+
| `fileUploads/upload` | Attachment upload; the receipt is sent with the next message |
|
|
183
|
+
| `workspaceFiles/list` / `workspaceFiles/readBytes` | Workspace file list and download |
|
|
184
|
+
| `$events/result` | Approval and question answers |
|
|
185
|
+
|
|
186
|
+
These are DSH-internal endpoints with no stability promise: when the check
|
|
187
|
+
service is unavailable, the plugin returns 503 and does not let the request
|
|
188
|
+
through; an endpoint signature change breaks the affected features until the
|
|
189
|
+
plugin adapts (see Compatibility).
|
|
190
|
+
|
|
191
|
+
## Quality
|
|
192
|
+
|
|
193
|
+
- **Types**: `types.d.ts` defines the protocol and data shapes; sources use
|
|
194
|
+
`@ts-check`; `tsc --noEmit` is clean
|
|
195
|
+
- **Syntax**: `node --check` covers the host and the mobile page
|
|
196
|
+
- **Assets**: content-hash ETags return 304 on repeat visits and take effect
|
|
197
|
+
right after an upgrade
|
|
198
|
+
- **No build chain**: the repository is the runtime artifact; no install or
|
|
199
|
+
build step
|
|
102
200
|
|
|
103
201
|
## Security
|
|
104
202
|
|
|
105
|
-
- No account system of its own: unauthenticated access to the plugin page is
|
|
106
|
-
|
|
107
|
-
|
|
203
|
+
- No account system of its own: unauthenticated access to the plugin page is
|
|
204
|
+
rejected by DSH's login check (401); if that check service is unavailable,
|
|
205
|
+
the plugin returns 503 and does not let the request through
|
|
206
|
+
- When exposing the service through a reverse proxy, add authentication at the
|
|
207
|
+
proxy layer (Basic Auth / OIDC / mTLS) and do not expose the DSH port
|
|
208
|
+
directly to the internet
|
|
209
|
+
- Model output is rendered by markdown-it (`html: false`), and links are
|
|
210
|
+
limited to `http/https/mailto`; HTML responses carry CSP, nosniff,
|
|
211
|
+
no-referrer, and `X-Frame-Options: DENY`
|
|
212
|
+
|
|
213
|
+
## Self-check & Troubleshooting
|
|
214
|
+
|
|
215
|
+
- The plugin page bounces back to the DSH login page: not signed in or the
|
|
216
|
+
session expired — sign in on the main site first
|
|
217
|
+
- The plugin page returns 503: DSH's login-check service is unavailable, the
|
|
218
|
+
plugin refuses to let the request through — restore DSH itself first
|
|
219
|
+
- A phone opening the main site does not land on the mobile page: "Open desktop
|
|
220
|
+
version" was chosen in this browsing session (session-scoped, sessionStorage);
|
|
221
|
+
closing and reopening the page restores the default, and a phone switched to
|
|
222
|
+
the desktop page shows a floating "📱" button to return
|
|
223
|
+
- The session list loads but the model list is unavailable: the DSH backend
|
|
224
|
+
model service is failing — check DSH's own logs
|
|
225
|
+
- After a DSH upgrade the plugin page fails or misbehaves: an internal endpoint
|
|
226
|
+
signature may have changed; check Compatibility for the adapted version and
|
|
227
|
+
wait for the plugin to catch up
|
|
108
228
|
|
|
109
229
|
## Known limitations
|
|
110
230
|
|
|
111
|
-
- Subagent sessions are not listed (matching the desktop client: subagents do
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
|
|
231
|
+
- Subagent sessions are not listed (matching the desktop client: subagents do
|
|
232
|
+
not take top-level rows)
|
|
233
|
+
- Attachments use the official conversation attachment channel and are not
|
|
234
|
+
written to the workspace; workspace files are read-only
|
|
235
|
+
- The plugin consumes DSH-internal endpoints with no stability promise: an
|
|
236
|
+
endpoint signature change breaks the affected features until the plugin
|
|
237
|
+
adapts
|
|
238
|
+
- Single-user use is recommended: DSH itself does not separate accounts, so a
|
|
239
|
+
shared deployment needs isolation in front
|
|
115
240
|
|
|
116
241
|
## Update
|
|
117
242
|
|
|
118
|
-
|
|
243
|
+
Installed from npm: update to the new version and restart.
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
dsh plugin --profile web add dsh-web-mobile-pmsfh@latest
|
|
247
|
+
sudo systemctl restart dsh-web
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Installed from source: pull the latest code in the cloned directory and
|
|
251
|
+
restart.
|
|
119
252
|
|
|
120
|
-
```
|
|
253
|
+
```bash
|
|
121
254
|
git pull
|
|
122
255
|
sudo systemctl restart dsh-web
|
|
123
256
|
```
|
|
@@ -126,21 +259,36 @@ sudo systemctl restart dsh-web
|
|
|
126
259
|
|
|
127
260
|
Remove the plugin from the `web` profile and restart:
|
|
128
261
|
|
|
129
|
-
```
|
|
262
|
+
```bash
|
|
130
263
|
dsh plugin --profile web remove dsh-web-mobile-pmsfh
|
|
131
264
|
sudo systemctl restart dsh-web
|
|
132
265
|
```
|
|
133
266
|
|
|
134
267
|
## Development
|
|
135
268
|
|
|
136
|
-
For local debugging, use a separate `DSH_HOME` and port so production data is
|
|
269
|
+
For local debugging, use a separate `DSH_HOME` and port so production data is
|
|
270
|
+
unaffected:
|
|
137
271
|
|
|
138
|
-
```
|
|
272
|
+
```bash
|
|
139
273
|
DSH_HOME=~/.dsh-test dsh --profile web --no-open --port 3080
|
|
140
274
|
```
|
|
141
275
|
|
|
142
|
-
|
|
276
|
+
- No build chain: the repository is the runtime artifact; changes land after a
|
|
277
|
+
dsh-web restart (page files are read from disk per request)
|
|
278
|
+
- Syntax check with `node --check`, type check with `tsc --noEmit`
|
|
279
|
+
(`@ts-check` applies per file)
|
|
280
|
+
- Debug hooks: the page exposes `__dshwm.dispatch()`, which injects synthetic
|
|
281
|
+
mux frames to rehearse approval and question cards; `__frames` records the
|
|
282
|
+
sequence of received frame types
|
|
283
|
+
- Soft-keyboard fit: `#app` is pinned to the visualViewport height, with the
|
|
284
|
+
`interactive-widget=resizes-content` meta alongside, so the composer rides
|
|
285
|
+
above the keyboard
|
|
286
|
+
- The dictionaries live in the `T` object at the top of `mobile/app.js` —
|
|
287
|
+
Chinese and English key sets side by side; update both when changing UI copy
|
|
288
|
+
|
|
289
|
+
Implementation notes: static assets get content-hash ETags and return 304 on
|
|
290
|
+
repeat visits; bundled dependencies are cached for 30 days.
|
|
143
291
|
|
|
144
292
|
## License
|
|
145
293
|
|
|
146
|
-
[MIT](LICENSE)
|
|
294
|
+
[MIT](LICENSE) © 2026 renlang119
|
package/README.md
CHANGED
|
@@ -2,93 +2,123 @@
|
|
|
2
2
|
|
|
3
3
|
**简体中文** | [English](README.en.md)
|
|
4
4
|
|
|
5
|
-
DeepSeek Harness
|
|
5
|
+
DeepSeek Harness 的移动端页面插件:移动设备打开主站自动进入,会话、对话、
|
|
6
|
+
附件、审批都在这个为窄屏设计的独立界面里完成;不动桌面端界面,也不改主仓库代码。
|
|
6
7
|
|
|
7
|
-
它在 `/dsh-web-mobile-pmsfh/`
|
|
8
|
+
它在 `/dsh-web-mobile-pmsfh/` 路径下挂一套独立的移动页,直接调 DSH 自己的接口,不加载官方前端,也不改官方代码。
|
|
8
9
|
|
|
9
10
|
[](LICENSE)
|
|
10
11
|
[](https://github.com/topics/dsh-plugin)
|
|
12
|
+
[](https://www.npmjs.com/package/dsh-web-mobile-pmsfh)
|
|
11
13
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
12
14
|
|
|
13
15
|
## 功能概览
|
|
14
16
|
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
17
|
+
- **会话**:按工作区分组折叠,另有「未分组」;新建、重命名、删除工作区(删除只从列表移除,目录与会话记录保留,会话转入「未分组」);长按归档会话;新建会话时经内联目录浏览器选工作区,并选权限档位(仅可查看 /
|
|
18
|
+
工作区内修改 / 完全权限,完全权限启用前需确认风险)
|
|
19
|
+
- **对话**:流式输出、思考过程折叠、上下文压缩提示;markdown 与代码块渲染,生成中可停止,后续消息排队可见,上翻按页加载更早消息,贴底跟随与一键回到底部
|
|
20
|
+
- **附件**:移动设备上选文件,先上传拿到凭证再随下一条消息发送,走官方对话附件通道;单文件上限 8 MB,发送前可移除,不落工作区
|
|
21
|
+
- **审批**:越界操作弹出审批卡,可选允许一次、拒绝、稍后,也可自行输入后提交
|
|
19
22
|
- **模型**:会话内切换模型与推理等级
|
|
20
23
|
- **文件**:工作区文件列表与下载,只读
|
|
21
|
-
-
|
|
24
|
+
- **界面**:中英双语跟随浏览器,深浅色跟随系统;软键盘弹出时输入框骑在键盘上方;列表底部「进入桌面版」只对本次浏览生效,切换后右下角出现「📱」浮标可返回移动版;沿用 DSH 登录状态,过期有引导,可退出登录
|
|
22
25
|
|
|
23
26
|
## 快速开始
|
|
24
27
|
|
|
25
|
-
环境要求:DSH `0.2.2-rc.1
|
|
28
|
+
环境要求:DSH `0.2.2-rc.1`(见「兼容性」)、Node.js ≥ 24;`dsh plugin`
|
|
29
|
+
需要 pnpm,经 corepack 启用或全局安装:
|
|
26
30
|
|
|
27
|
-
```
|
|
31
|
+
```bash
|
|
28
32
|
corepack enable
|
|
29
33
|
```
|
|
30
34
|
|
|
31
35
|
或
|
|
32
36
|
|
|
33
|
-
```
|
|
37
|
+
```bash
|
|
34
38
|
npm i -g pnpm
|
|
35
39
|
```
|
|
36
40
|
|
|
37
|
-
|
|
41
|
+
装好后,两种方式选一种安装;安装完成后重启 DSH 服务,重启命令按实际部署方式调整。
|
|
38
42
|
|
|
39
|
-
|
|
43
|
+
### 方式一:从 npm 安装
|
|
44
|
+
|
|
45
|
+
适合直接使用,能收到新版本的更新提示:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
dsh plugin --profile web add dsh-web-mobile-pmsfh
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 方式二:从源码安装
|
|
52
|
+
|
|
53
|
+
适合自行修改;克隆目录需保留,更新时在目录内拉取:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
40
56
|
git clone https://github.com/renlang119/dsh-web-mobile-pmsfh.git
|
|
41
57
|
dsh plugin --profile web add ./dsh-web-mobile-pmsfh
|
|
42
58
|
```
|
|
43
59
|
|
|
44
|
-
|
|
60
|
+
`dsh plugin` 命令安装到 `dsh web` 启动的服务端;DSH 桌面客户端自行管理插件,要在桌面端使用,在客户端的设置 → 插件页里安装。
|
|
45
61
|
|
|
46
|
-
|
|
62
|
+
如果本机 npm 指向国内镜像,无法安装这个包,在命令后面加
|
|
63
|
+
`--registry=https://registry.npmjs.org`。
|
|
47
64
|
|
|
48
|
-
|
|
65
|
+
重启命令示例:
|
|
49
66
|
|
|
50
|
-
```
|
|
67
|
+
```bash
|
|
51
68
|
sudo systemctl restart dsh-web
|
|
52
69
|
```
|
|
53
70
|
|
|
54
|
-
首次访问:用移动设备打开主站会自动跳转,也可以直接开
|
|
71
|
+
首次访问:用移动设备打开主站会自动跳转,也可以直接开
|
|
72
|
+
`https://<域名>/dsh-web-mobile-pmsfh/`;如果没跳转,检查这次浏览是否点过「进入桌面版」——那是会话级偏好(sessionStorage),关闭页面重新打开即恢复默认。
|
|
55
73
|
|
|
56
74
|
## 兼容性
|
|
57
75
|
|
|
58
76
|
| DSH | 状态 |
|
|
59
77
|
| --- | --- |
|
|
60
|
-
| `0.2.2-rc.1` |
|
|
78
|
+
| `0.2.2-rc.1` | 已适配 |
|
|
61
79
|
| 其他 `0.2.x` | 未验证,端点签名可能不同 |
|
|
62
80
|
|
|
63
81
|
## 技术栈
|
|
64
82
|
|
|
65
|
-
Node 24 · DeepSeek Harness `0.2.2-rc.1` · Cordis 插件 · 原生 JavaScript
|
|
83
|
+
Node.js 24 · DeepSeek Harness `0.2.2-rc.1` · Cordis 插件 · 原生 JavaScript
|
|
84
|
+
(无构建)· markdown-it
|
|
66
85
|
|
|
67
|
-
移动页是单页原生 JS
|
|
86
|
+
移动页是单页原生 JS 应用,不加载官方前端、不走打包器;运行时没有额外依赖,
|
|
87
|
+
克隆后即可运行。
|
|
68
88
|
|
|
69
89
|
## 项目结构
|
|
70
90
|
|
|
71
91
|
```text
|
|
72
92
|
dsh-web-mobile-pmsfh/
|
|
73
|
-
├─ lib/index.js
|
|
74
|
-
├─ client/client.js
|
|
75
|
-
├─ mobile/
|
|
93
|
+
├─ lib/index.js host 侧:静态路由与 connection.admit 校验
|
|
94
|
+
├─ client/client.js 桌面端:窄屏设备跳转到移动页
|
|
95
|
+
├─ mobile/ 移动页
|
|
76
96
|
│ ├─ index.html
|
|
77
97
|
│ ├─ app.js / app.css
|
|
78
|
-
│ └─ vendor/
|
|
79
|
-
├─ cordis.patch.yml
|
|
80
|
-
├─ types.d.ts
|
|
81
|
-
└─ tsconfig.json
|
|
98
|
+
│ └─ vendor/ markdown-it 与 CJK 标点兼容补丁
|
|
99
|
+
├─ cordis.patch.yml 插件挂载配置
|
|
100
|
+
├─ types.d.ts 协议与数据形状定义
|
|
101
|
+
└─ tsconfig.json 仅类型检查,不产出构建物
|
|
82
102
|
```
|
|
83
103
|
|
|
84
|
-
##
|
|
104
|
+
## 架构
|
|
85
105
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
- **静态资源**:按内容哈希发 ETag,重复访问返回 304,升级后立即可见
|
|
89
|
-
- **无构建链**:仓库即运行产物,不需要 install 或 build
|
|
106
|
+
插件分三个部分,全部落在插件目录内,主仓库零改动;`cordis.patch.yml`
|
|
107
|
+
把插件插入 profile 层栈完成挂载:
|
|
90
108
|
|
|
91
|
-
|
|
109
|
+
| 组件 | 职责 |
|
|
110
|
+
| --- | --- |
|
|
111
|
+
| `lib/index.js` | host 侧:注册 `/dsh-web-mobile-pmsfh/` 下的静态路由,全部置于 DSH 登录门之后 |
|
|
112
|
+
| `client/client.js` | 桌面端注入:把触屏窄屏(coarse pointer 且视口 ≤ 768px)从官方界面跳转过来 |
|
|
113
|
+
| `mobile/` | 独立移动页:原生 JS 单页应用,不加载官方前端、不走打包器 |
|
|
114
|
+
|
|
115
|
+
移动页与 DSH 的通信全部走 DSH 自身的 wire 协议(Typert Gateway),没有插件私有端点:
|
|
116
|
+
|
|
117
|
+
- `POST /api/<method>`:一元 RPC(会话、工作区、模型、文件等操作)
|
|
118
|
+
- `WS /api/remote.mux`:帧复用长连接(会话日志流、工作区基线、事件总线)
|
|
119
|
+
- `POST /api/$events/result`:审批与问答应答
|
|
120
|
+
|
|
121
|
+
5 条资源路由,另加 1 条裸路径 302 跳转:
|
|
92
122
|
|
|
93
123
|
| 路径 | 内容 |
|
|
94
124
|
| --- | --- |
|
|
@@ -96,28 +126,77 @@ dsh-web-mobile-pmsfh/
|
|
|
96
126
|
| `/dsh-web-mobile-pmsfh/app.js` | 页面脚本 |
|
|
97
127
|
| `/dsh-web-mobile-pmsfh/app.css` | 页面样式 |
|
|
98
128
|
| `/dsh-web-mobile-pmsfh/vendor/markdown-it.min.js` | markdown 渲染 |
|
|
99
|
-
| `/dsh-web-mobile-pmsfh/vendor/markdown-it-cjk-friendly.min.js` |
|
|
129
|
+
| `/dsh-web-mobile-pmsfh/vendor/markdown-it-cjk-friendly.min.js` | CJK 标点下的 `**` 处理 |
|
|
130
|
+
|
|
131
|
+
页面文件每次请求从磁盘读取(`no-cache`,内容不变时 304),插件更新并重启 dsh-web 后立即生效;vendor 文件按内容哈希缓存 30 天(`immutable`)。
|
|
132
|
+
|
|
133
|
+
## DSH 接口依赖
|
|
100
134
|
|
|
101
|
-
|
|
135
|
+
移动页直接调用下列 DSH 内部接口(`session/follow`、`workspace/follow`
|
|
136
|
+
与 `$events` 走 mux 长连接,其余走一元 RPC):
|
|
137
|
+
|
|
138
|
+
| 接口 | 用途 |
|
|
139
|
+
| --- | --- |
|
|
140
|
+
| `session/list`/`session/create`/`session/prompt`/`session/cancel` | 列表、创建、发消息、停止 |
|
|
141
|
+
| `session/selectModel` / `session/modelCatalog` | 模型与推理等级选择 |
|
|
142
|
+
| `session/page` / `session/follow` | 历史分页与实时日志流 |
|
|
143
|
+
| `workspace/create` / `workspace/rename` / `workspace/delete` | 工作区管理 |
|
|
144
|
+
| `workspace/archiveSession` / `workspace/follow` | 会话归档与工作区基线流 |
|
|
145
|
+
| `directoryPicker/list` / `directoryPicker/createDirectory` | 新建工作区的内联目录浏览器 |
|
|
146
|
+
| `commands/execute` | 权限档位设置(`/permission` 命令) |
|
|
147
|
+
| `fileUploads/upload` | 附件上传,返回凭证随下一条消息发送 |
|
|
148
|
+
| `workspaceFiles/list` / `workspaceFiles/readBytes` | 工作区文件列表与下载 |
|
|
149
|
+
| `$events/result` | 审批与问答应答 |
|
|
150
|
+
|
|
151
|
+
这些是 DSH 内部接口,没有稳定承诺:校验服务不可用时返回 503,不放行;
|
|
152
|
+
端点签名变动会导致相应功能不可用,需要等插件适配(见「兼容性」)。
|
|
153
|
+
|
|
154
|
+
## 质量
|
|
155
|
+
|
|
156
|
+
- **类型**:`types.d.ts` 定义协议与数据形状,源码带 `@ts-check`,
|
|
157
|
+
`tsc --noEmit` 全绿
|
|
158
|
+
- **语法**:`node --check` 覆盖 host 侧与移动页
|
|
159
|
+
- **静态资源**:按内容哈希发 ETag,重复访问返回 304,升级后立即生效
|
|
160
|
+
- **无构建链**:仓库即运行物,没有安装与构建步骤
|
|
102
161
|
|
|
103
162
|
## 安全
|
|
104
163
|
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
- 模型输出经 markdown-it 渲染(`html: false
|
|
164
|
+
- 不自带账号体系:未登录访问插件页被 DSH 登录校验拦下(401);校验服务不可用时返回 503,不放行
|
|
165
|
+
- 经反向代理对外暴露时,在代理层加认证(Basic Auth / OIDC / mTLS),不要把 DSH 端口直接暴露公网
|
|
166
|
+
- 模型输出经 markdown-it 渲染(`html: false`),链接限定
|
|
167
|
+
`http/https/mailto`;HTML 响应带 CSP、nosniff、no-referrer 与
|
|
168
|
+
`X-Frame-Options: DENY`
|
|
169
|
+
|
|
170
|
+
## 自检与排查
|
|
171
|
+
|
|
172
|
+
- 打不开插件页、被带回 DSH 登录页:未登录或会话过期,先在主站登录
|
|
173
|
+
- 插件页返回 503:DSH 登录校验服务不可用,插件拒绝放行,先恢复 DSH
|
|
174
|
+
本体
|
|
175
|
+
- 手机打开主站没有进移动页:本次浏览点过「进入桌面版」(会话级偏好,
|
|
176
|
+
sessionStorage),关闭页面重新打开即恢复默认;切到桌面版的手机右下角有「📱」浮标,点它回移动版
|
|
177
|
+
- 会话列表能开但模型列表不可用:DSH 后端模型服务异常,看 DSH 自身日志
|
|
178
|
+
- 升级 DSH 后插件页打不开或行为异常:内部接口签名可能变动,对照「兼容性」确认适配版本,等插件适配新版
|
|
108
179
|
|
|
109
180
|
## 已知限制
|
|
110
181
|
|
|
111
182
|
- 不列子代理会话(与桌面端一致:子代理不占顶层行)
|
|
112
183
|
- 附件走官方对话附件通道,不写入工作区;工作区文件只读
|
|
113
|
-
- 依赖 DSH
|
|
184
|
+
- 依赖 DSH 内部接口,没有稳定承诺:端点签名变动会使相应功能不可用,
|
|
185
|
+
需等插件适配
|
|
114
186
|
- 建议只单人使用:DSH 本身没有多账号区分,多人共用要自己在外面做隔离
|
|
115
187
|
|
|
116
188
|
## 更新
|
|
117
189
|
|
|
118
|
-
|
|
190
|
+
从 npm 安装的,更新到新版本后重启:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
dsh plugin --profile web add dsh-web-mobile-pmsfh@latest
|
|
194
|
+
sudo systemctl restart dsh-web
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
从源码安装的,在克隆目录拉取最新代码后重启:
|
|
119
198
|
|
|
120
|
-
```
|
|
199
|
+
```bash
|
|
121
200
|
git pull
|
|
122
201
|
sudo systemctl restart dsh-web
|
|
123
202
|
```
|
|
@@ -126,21 +205,29 @@ sudo systemctl restart dsh-web
|
|
|
126
205
|
|
|
127
206
|
从 `web` profile 移除插件后重启:
|
|
128
207
|
|
|
129
|
-
```
|
|
208
|
+
```bash
|
|
130
209
|
dsh plugin --profile web remove dsh-web-mobile-pmsfh
|
|
131
210
|
sudo systemctl restart dsh-web
|
|
132
211
|
```
|
|
133
212
|
|
|
134
213
|
## 开发
|
|
135
214
|
|
|
136
|
-
|
|
215
|
+
本地调试建议使用独立的 `DSH_HOME` 与端口,避免影响生产数据:
|
|
137
216
|
|
|
138
|
-
```
|
|
217
|
+
```bash
|
|
139
218
|
DSH_HOME=~/.dsh-test dsh --profile web --no-open --port 3080
|
|
140
219
|
```
|
|
141
220
|
|
|
142
|
-
|
|
221
|
+
- 无构建链:仓库即运行产物,改动落盘后重启 dsh-web 即生效(页面文件每次请求都从磁盘读)
|
|
222
|
+
- 语法检查 `node --check`,类型检查 `tsc --noEmit`(`@ts-check` 逐文件生效)
|
|
223
|
+
- 调试钩子:页面暴露 `__dshwm.dispatch()`,可向 mux 注入合成帧,用于演练审批与问答弹窗;`__frames` 记录收到的帧类型序列
|
|
224
|
+
- 软键盘适配:`#app` 以 visualViewport 高度为准钉高,配合
|
|
225
|
+
`interactive-widget=resizes-content` meta,保证输入框骑在键盘上方
|
|
226
|
+
- 词典集中在 `mobile/app.js` 顶部的 `T` 对象,中英两套键值对照,改界面文案时两套都要动
|
|
227
|
+
|
|
228
|
+
实现要点:静态资源按内容哈希发 ETag,重复访问返回 304;内置依赖缓存
|
|
229
|
+
30 天。
|
|
143
230
|
|
|
144
231
|
## 许可证
|
|
145
232
|
|
|
146
|
-
[MIT](LICENSE)
|
|
233
|
+
[MIT](LICENSE) © 2026 renlang119
|
package/mobile/app.js
CHANGED
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
permFail: '权限设置失败,将使用默认权限',
|
|
58
58
|
createFail: '创建失败',
|
|
59
59
|
wsListFail: '工作区列表加载失败,可新建工作区或稍后重试',
|
|
60
|
-
faTitle: '
|
|
61
|
-
faDesc: '
|
|
60
|
+
faTitle: '确认启用完全权限?',
|
|
61
|
+
faDesc: '启用完全权限后,新会话将减少确认步骤,并且可以直接执行更多操作,包括敏感操作、文件修改或外部命令。仅建议在你信任后续任务时使用。',
|
|
62
62
|
faAck: '我已了解风险,并愿意继续',
|
|
63
63
|
faCancel: '取消',
|
|
64
|
-
faEnable: '
|
|
64
|
+
faEnable: '启用完全权限',
|
|
65
65
|
untitled: '新会话',
|
|
66
66
|
loading: '加载中…',
|
|
67
67
|
empty: '还没有会话\n点右上角「+」开始',
|
|
@@ -1018,8 +1018,14 @@
|
|
|
1018
1018
|
]
|
|
1019
1019
|
|
|
1020
1020
|
function permLabel(/** @type {any} */ value) {
|
|
1021
|
-
// Same product labels as the official UI
|
|
1022
|
-
//
|
|
1021
|
+
// Same product labels as the official UI in both languages; the wire
|
|
1022
|
+
// values (read-only / workspace-write / danger-full-access) never change.
|
|
1023
|
+
if (zh) {
|
|
1024
|
+
if (value === 'danger-full-access') return '完全权限'
|
|
1025
|
+
if (value === 'read-only') return '仅可查看'
|
|
1026
|
+
if (value === 'workspace-write') return '工作区内修改'
|
|
1027
|
+
return String(value)
|
|
1028
|
+
}
|
|
1023
1029
|
if (value === 'danger-full-access') return 'Full access'
|
|
1024
1030
|
return value.split('-').map(function (/** @type {any} */ w) { return w.charAt(0).toUpperCase() + w.slice(1) }).join(' ')
|
|
1025
1031
|
}
|
package/package.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-web-mobile-pmsfh",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
7
|
-
"node": ">=24"
|
|
7
|
+
"node": ">=24",
|
|
8
|
+
"dsh": ">=0.2.2-rc.1 <0.3.0-0"
|
|
8
9
|
},
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
11
12
|
"url": "git+https://github.com/renlang119/dsh-web-mobile-pmsfh.git"
|
|
12
13
|
},
|
|
13
|
-
"description": "
|
|
14
|
+
"description": "A standalone mobile page for DeepSeek Harness with conversations, attachments, approvals and workspace file browsing. Desktop UI untouched.",
|
|
14
15
|
"files": [
|
|
15
16
|
"lib/",
|
|
16
17
|
"client/",
|