dsh-web-mobile-pmsfh 3.2.6 → 3.2.7

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 CHANGED
@@ -14,7 +14,7 @@ official code.
14
14
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
15
15
  [![topic](https://img.shields.io/badge/topic-dsh--plugin-amber)](https://github.com/topics/dsh-plugin)
16
16
  [![npm](https://img.shields.io/npm/v/dsh-web-mobile-pmsfh.svg)](https://www.npmjs.com/package/dsh-web-mobile-pmsfh)
17
- [![dsh](https://img.shields.io/badge/dsh-0.2.2--rc.1-5B6EF5)](https://github.com/deepseek-ai/deepseek-harness)
17
+ [![dsh](https://img.shields.io/badge/dsh-0.2.2-5B6EF5)](https://github.com/deepseek-ai/deepseek-harness)
18
18
 
19
19
  ## Features
20
20
 
@@ -45,7 +45,7 @@ official code.
45
45
 
46
46
  ## Quick Start
47
47
 
48
- Requirements: DSH `0.2.2-rc.1` (see Compatibility), Node.js 24 or later, and
48
+ Requirements: DSH `0.2.2` line (see Compatibility), Node.js 24 or later, and
49
49
  pnpm for the `dsh plugin` command — enable it through corepack or install it
50
50
  globally:
51
51
 
@@ -103,12 +103,12 @@ the page is closed and reopened.
103
103
 
104
104
  | DSH | Status |
105
105
  | --- | --- |
106
- | `0.2.2-rc.1` | Supported |
107
- | other `0.2.x` | Untested; endpoint signatures may differ |
106
+ | `0.2.2` line (`0.2.2-rc.1` through `0.2.2`) | Supported; tested on `rc.1`, `rc.2`, `rc.3` |
107
+ | `0.2.3` and later | Outside the declared range; endpoint signatures may change |
108
108
 
109
109
  ## Tech Stack
110
110
 
111
- Node.js 24 · DeepSeek Harness `0.2.2-rc.1` · Cordis plugin · vanilla
111
+ Node.js 24 · DeepSeek Harness `0.2.2` · Cordis plugin · vanilla
112
112
  JavaScript (no build) · markdown-it
113
113
 
114
114
  The mobile page is a single-page vanilla JS app; it does not load the official
@@ -228,6 +228,16 @@ plugin adapts (see Compatibility).
228
228
 
229
229
  ## Known limitations
230
230
 
231
+ - The plugin provides no network connectivity of its own: it does no port
232
+ forwarding, NAT traversal, or traffic relay. The mobile page is served under
233
+ the same address as DSH and listens on no separate port, so its reachability
234
+ matches the DSH site. If DSH is reachable from the public internet, a mobile
235
+ device on any network can open the same address; if it runs only on a private
236
+ network, the device must join that network; if it runs only on the local
237
+ machine, it is reachable only from that machine. When DSH is deployed locally
238
+ or you use the desktop client, a desktop browser will not enter the mobile
239
+ page by default; to test that page, enable device emulation or use a mobile
240
+ emulator.
231
241
  - Subagent sessions are not listed (matching the desktop client: subagents do
232
242
  not take top-level rows)
233
243
  - Attachments use the official conversation attachment channel and are not
package/README.md CHANGED
@@ -10,7 +10,7 @@ DeepSeek Harness 的移动端页面插件:移动设备打开主站自动进入
10
10
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
11
11
  [![topic](https://img.shields.io/badge/topic-dsh--plugin-amber)](https://github.com/topics/dsh-plugin)
12
12
  [![npm](https://img.shields.io/npm/v/dsh-web-mobile-pmsfh.svg)](https://www.npmjs.com/package/dsh-web-mobile-pmsfh)
13
- [![dsh](https://img.shields.io/badge/dsh-0.2.2--rc.1-5B6EF5)](https://github.com/deepseek-ai/deepseek-harness)
13
+ [![dsh](https://img.shields.io/badge/dsh-0.2.2-5B6EF5)](https://github.com/deepseek-ai/deepseek-harness)
14
14
 
15
15
  ## 功能概览
16
16
 
@@ -25,7 +25,7 @@ DeepSeek Harness 的移动端页面插件:移动设备打开主站自动进入
25
25
 
26
26
  ## 快速开始
27
27
 
28
- 环境要求:DSH `0.2.2-rc.1`(见「兼容性」)、Node.js ≥ 24;`dsh plugin`
28
+ 环境要求:DSH `0.2.2` 系列(见「兼容性」)、Node.js ≥ 24;`dsh plugin`
29
29
  需要 pnpm,经 corepack 启用或全局安装:
30
30
 
31
31
  ```bash
@@ -75,12 +75,12 @@ sudo systemctl restart dsh-web
75
75
 
76
76
  | DSH | 状态 |
77
77
  | --- | --- |
78
- | `0.2.2-rc.1` | 已适配 |
79
- | 其他 `0.2.x` | 未验证,端点签名可能不同 |
78
+ | `0.2.2` 系列(`0.2.2-rc.1` 至 `0.2.2`) | 已适配,`rc.1` / `rc.2` / `rc.3` 实测 |
79
+ | `0.2.3` 及以后 | 不在声明范围,端点签名可能变动 |
80
80
 
81
81
  ## 技术栈
82
82
 
83
- Node.js 24 · DeepSeek Harness `0.2.2-rc.1` · Cordis 插件 · 原生 JavaScript
83
+ Node.js 24 · DeepSeek Harness `0.2.2` · Cordis 插件 · 原生 JavaScript
84
84
  (无构建)· markdown-it
85
85
 
86
86
  移动页是单页原生 JS 应用,不加载官方前端、不走打包器;运行时没有额外依赖,
@@ -179,11 +179,16 @@ dsh-web-mobile-pmsfh/
179
179
 
180
180
  ## 已知限制
181
181
 
182
+ - 本插件不提供网络连接能力:不做端口转发、内网穿透,也不代转流量。移动页挂在
183
+ DSH 同一地址下,不单独监听端口,能否打开与 DSH 主站一致。DSH 在公网可访问的,
184
+ 移动设备接任意网络打开同一地址即可;只在内网部署的,移动设备需接入同一内网;
185
+ 只在本机运行的,只能在本机访问。在本机部署 DSH 或使用桌面版时,桌面浏览器
186
+ 默认不会进入移动页,要测试移动页面需自行开启设备模拟或安装移动模拟器。
182
187
  - 不列子代理会话(与桌面端一致:子代理不占顶层行)
183
188
  - 附件走官方对话附件通道,不写入工作区;工作区文件只读
184
189
  - 依赖 DSH 内部接口,没有稳定承诺:端点签名变动会使相应功能不可用,
185
190
  需等插件适配
186
- - 建议只单人使用:DSH 本身没有多账号区分,多人共用要自己在外面做隔离
191
+ - 建议单用户使用:DSH 本身没有多账号区分,多用户共用要自己在外面做隔离
187
192
 
188
193
  ## 更新
189
194
 
package/mobile/app.css CHANGED
@@ -13,6 +13,7 @@
13
13
  --accent-weak: rgba(37, 99, 235, 0.1);
14
14
  --danger: #dc2626;
15
15
  --ok: #16a34a;
16
+ --warn: #d97706;
16
17
  --bubble-user: #2563eb;
17
18
  --bubble-user-text: #ffffff;
18
19
  --header-h: calc(52px + env(safe-area-inset-top, 0px));
@@ -28,6 +29,9 @@
28
29
  --border: rgba(255, 255, 255, 0.1);
29
30
  --accent: #5b8def;
30
31
  --accent-weak: rgba(91, 141, 239, 0.18);
32
+ --ok: #4ade80;
33
+ --warn: #fbbf24;
34
+ --danger: #f87171;
31
35
  --bubble-user: #2f5cb8;
32
36
  --bubble-user-text: #ffffff;
33
37
  }
@@ -97,14 +101,28 @@ html, body {
97
101
  background: var(--text3);
98
102
  }
99
103
  .conn.on { background: var(--ok); }
104
+ .conn.wait { background: var(--warn); animation: conn-pulse 1.2s ease-in-out infinite; }
105
+ .conn.bad { background: var(--danger); }
106
+ @keyframes conn-pulse {
107
+ 0%, 100% { opacity: 1; }
108
+ 50% { opacity: 0.35; }
109
+ }
110
+ @media (prefers-reduced-motion: reduce) {
111
+ .conn.wait { animation: none; }
112
+ }
100
113
 
101
114
  /* ── session list ───────────────────────────────────────────── */
102
115
  .list {
103
116
  flex: 1;
117
+ display: flex;
118
+ flex-direction: column;
104
119
  overflow-y: auto;
105
120
  -webkit-overflow-scrolling: touch;
106
121
  padding: 8px 12px calc(24px + env(safe-area-inset-bottom, 0px));
107
122
  }
123
+ /* Keep rows at their natural height inside the flex column, otherwise a
124
+ list taller than the viewport would be squeezed instead of scrolled. */
125
+ .list > * { flex: none; }
108
126
  .ws-group { margin-top: 14px; }
109
127
  .ws-group.folded .srow { display: none; }
110
128
  .ws-head {
@@ -759,6 +777,10 @@ details.reasoning[open] summary::before { content: '▾ '; }
759
777
  .desktop-link {
760
778
  display: block;
761
779
  padding: 18px 0 8px;
780
+ /* Short list: the auto margin absorbs the leftover height and pins the
781
+ link to the bottom of the screen. Long list: no free space is left, the
782
+ margin computes to 0 and the link stays right under the last row. */
783
+ margin-top: auto;
762
784
  text-align: center;
763
785
  color: var(--text3);
764
786
  font-size: 12px;
package/mobile/app.js CHANGED
@@ -68,6 +68,9 @@
68
68
  chatEmpty: '发消息开始对话\n📎 可以传文件给智能体',
69
69
  loadFail: '加载失败,点右上角刷新重试',
70
70
  desktop: '进入桌面版',
71
+ connOn: '已连接',
72
+ connWait: '正在连接',
73
+ connErr: '连接断开',
71
74
  jumpDown: '回到底部',
72
75
  justNow: '刚刚',
73
76
  minutesAgo: ' 分钟前',
@@ -160,6 +163,9 @@
160
163
  chatEmpty: 'Send a message to start\n📎 attaches a file for the agent',
161
164
  loadFail: 'Load failed — tap refresh to retry',
162
165
  desktop: 'Open desktop version',
166
+ connOn: 'Connected',
167
+ connWait: 'Connecting',
168
+ connErr: 'Disconnected',
163
169
  jumpDown: 'Back to bottom',
164
170
  justNow: 'just now',
165
171
  minutesAgo: 'm ago',
@@ -345,6 +351,14 @@
345
351
  var muxRetry = 0
346
352
  var muxOpen = false
347
353
  var muxEverOpen = false
354
+ /** @type {'wait' | 'on' | 'bad'} 连接灯状态:连接中 / 已连接 / 连不上 */
355
+ var connState = 'wait'
356
+ var muxFails = 0 // 本次断开后累计的失败次数(onopen 清零)
357
+ var downSince = 0 // 本次断开起始时刻(ms),onopen 清零
358
+ /** @type {any} 下一次重连的定时器 */
359
+ var muxTimer = null
360
+ /** @type {any} 断开满 10 秒时重新判定的定时器 */
361
+ var downTimer = null
348
362
  /** @type {WebSocket | null} */
349
363
  var muxWs = null
350
364
  /** @type {any} connection status dot element */
@@ -355,10 +369,32 @@
355
369
  /** @type {string | null} 当前聊天会话的 session/follow streamId */
356
370
  var followStreamId = null // 当前聊天会话的 session/follow streamId
357
371
 
358
- /** @param {boolean} on */
359
- function setConn(on) {
360
- muxOpen = !!on
361
- if (connEl) connEl.classList.toggle('on', muxOpen)
372
+ /** @param {'wait' | 'on' | 'bad'} state */
373
+ function setConn(state) {
374
+ connState = state
375
+ muxOpen = state === 'on'
376
+ if (!connEl) return
377
+ connEl.className = 'conn' + (state === 'on' ? ' on' : state === 'bad' ? ' bad' : ' wait')
378
+ var label = state === 'on' ? T.connOn : state === 'bad' ? T.connErr : T.connWait
379
+ connEl.setAttribute('aria-label', label)
380
+ connEl.title = label
381
+ }
382
+ function clearDownTimer() {
383
+ if (downTimer) { clearTimeout(downTimer); downTimer = null }
384
+ }
385
+ // 断开满 10 秒且至少两次重试失败,或浏览器明确离线 → 红灯;否则黄灯。
386
+ function downState() {
387
+ return (!navigator.onLine || (muxFails >= 2 && Date.now() - downSince >= 10000)) ? 'bad' : 'wait'
388
+ }
389
+ function onMuxDown() {
390
+ if (!downSince) downSince = Date.now()
391
+ muxFails++
392
+ setConn(downState())
393
+ // 失败次数先到、时间未到:到 10 秒时再判一次,避免红灯迟迟不亮。
394
+ clearDownTimer()
395
+ downTimer = setTimeout(function () {
396
+ if (!muxOpen) setConn(downState())
397
+ }, Math.max(0, 10000 - (Date.now() - downSince)))
362
398
  }
363
399
 
364
400
  /** @param {Record<string, unknown>} obj frame to send on the mux socket, if open */
@@ -386,17 +422,23 @@
386
422
  }
387
423
 
388
424
  function connectMux() {
425
+ if (muxTimer) { clearTimeout(muxTimer); muxTimer = null }
389
426
  var proto = location.protocol === 'https:' ? 'wss:' : 'ws:'
390
427
  /** @type {WebSocket} */
391
428
  var ws
392
429
  try {
393
430
  ws = new WebSocket(proto + '//' + location.host + '/api/remote.mux')
394
- } catch (e) { scheduleMux(); return }
431
+ } catch (e) { onMuxDown(); scheduleMux(); return }
395
432
  muxWs = ws
433
+ if (connState !== 'on') setConn('wait')
396
434
  ws.onopen = function () {
435
+ if (ws !== muxWs) return // 旧 socket 的迟到事件
397
436
  var wasDown = muxEverOpen && !muxOpen
398
437
  muxRetry = 0
399
- setConn(true)
438
+ muxFails = 0
439
+ downSince = 0
440
+ clearDownTimer()
441
+ setConn('on')
400
442
  muxEverOpen = true
401
443
  openStream(STREAM_EVENTS, '$events', {})
402
444
  openStream(STREAM_WS, 'workspace/follow', {})
@@ -405,6 +447,7 @@
405
447
  else if (wasDown) scheduleRefresh(true)
406
448
  }
407
449
  ws.onmessage = function (ev) {
450
+ if (ws !== muxWs) return
408
451
  var f
409
452
  try { f = JSON.parse(ev.data) } catch (e) { return }
410
453
  if (!f || !f.streamId) return
@@ -420,13 +463,40 @@
420
463
  if (f.streamId === STREAM_WS) return onWorkspaceFrame(f.value)
421
464
  if (followStreamId && f.streamId === followStreamId) return onFollowFrame(f.value)
422
465
  }
423
- ws.onclose = function () { setConn(false); followStreamId = null; eventsClientId = null; checkAuth(); scheduleMux() }
466
+ ws.onclose = function () {
467
+ if (ws !== muxWs) return
468
+ onMuxDown()
469
+ followStreamId = null
470
+ eventsClientId = null
471
+ checkAuth()
472
+ scheduleMux()
473
+ }
424
474
  ws.onerror = function () { try { ws.close() } catch (e) {} }
425
475
  }
426
476
  function scheduleMux() {
477
+ if (muxTimer) return // 同一时间只排一个重连
427
478
  var d = Math.min(15000, 800 * Math.pow(1.6, muxRetry++))
428
- setTimeout(connectMux, d)
479
+ muxTimer = setTimeout(connectMux, d)
480
+ }
481
+ function reconnectMux() {
482
+ if (muxTimer) { clearTimeout(muxTimer); muxTimer = null }
483
+ var old = muxWs
484
+ connectMux() // 新 socket 成为 muxWs,旧 socket 的迟到事件按身份判断忽略
485
+ if (old && old !== muxWs) { try { old.close() } catch (e) {} }
429
486
  }
487
+ window.addEventListener('offline', function () {
488
+ clearDownTimer()
489
+ setConn('bad')
490
+ })
491
+ window.addEventListener('online', function () {
492
+ if (muxOpen) return
493
+ muxRetry = 0
494
+ muxFails = 0
495
+ downSince = 0
496
+ clearDownTimer()
497
+ setConn('wait')
498
+ reconnectMux()
499
+ })
430
500
 
431
501
  // ── $events 全局总线帧 ──────────────────────────────────────
432
502
  /** @param {any} v */
@@ -600,7 +670,8 @@
600
670
  }
601
671
  hd.appendChild(el('h1', null, title))
602
672
  connEl = el('span', 'conn')
603
- if (muxOpen) connEl.classList.add('on')
673
+ connEl.setAttribute('role', 'status')
674
+ setConn(connState)
604
675
  hd.appendChild(connEl)
605
676
  if (opts.refresh) {
606
677
  var rf = el('button', null)
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "dsh-web-mobile-pmsfh",
3
- "version": "3.2.6",
3
+ "version": "3.2.7",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {
7
7
  "node": ">=24",
8
- "dsh": ">=0.2.2-rc.1 <0.3.0-0"
8
+ "dsh": ">=0.2.2-rc.1 <0.2.3-0"
9
9
  },
10
10
  "repository": {
11
11
  "type": "git",