@mrrisega/dsh-remote 0.6.1 → 0.6.3

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.md CHANGED
@@ -28,7 +28,16 @@ dsh-remote 是一个轻量的**隧道模式**远程控制方案:电脑端运
28
28
  └→ bridge (电脑端) → 127.0.0.1:3080 (dsh web)
29
29
  ```
30
30
 
31
- ## 0.6.1 速览(用户最关心的新能力)
31
+ ## 0.6.2 速览(用户最关心的新能力)
32
+
33
+ - **插件市场安装即可用**:市场只装「面板插件」,桌面运行环境(bridge + 自启动)由插件在后台自动补齐;修掉了
34
+ 「装完 bridge 起不来且永远不自愈」的三处根因(运行环境缺失仍写自启动 → launchd 崩溃循环;崩溃循环被误判成
35
+ 「运行中」→ 自愈停摆;自愈顺序把运行环境排到最后)。
36
+ - **首次安装/更新后一键重启 DeepSeek harness**:面板顶部醒目提示「首次安装需要重启 DeepSeek harness」+
37
+ 「重启」按钮,面板最底部常驻「🔄 重启 DeepSeek harness」;重启后页面自动恢复,不用手动刷新。
38
+ - **状态不再说谎**:面板把「运行环境安装中 / 启动失败(已自动转入修复)」如实展示,不再把崩溃循环显示成「运行中」。
39
+
40
+ **0.6.1 起已有**
32
41
 
33
42
  - **首次安装体验修复**:装完插件立即登录,二维码与已授权设备列表不再报「尚未登录」红字;中继未就绪时面板自动退避重试,不用再手动刷新页面。
34
43
  - **企微交流群**:README 底部扫码入群;服务端可在管理后台「推广」页上传交流群二维码,官网、付费页底部、设置面板「加入交流群」按钮与用户反馈页会同步展示。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrisega/dsh-remote",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "手机远程控制 DeepSeek Harness · Remote control DeepSeek Harness (dsh web) from any phone browser — 100% 全功能 App 级体验:发消息、看工具执行、审批权限、改设置、管凭据,含特权操作,免内网穿透。一条命令安装 npx @mrrisega/dsh-remote。Mobile remote control for DSH, self-host or SaaS, no server needed on LAN.",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -50,11 +50,13 @@
50
50
  "scripts": {
51
51
  "test": "npm run test:router && npm run test:plugin && npm run test:bridge",
52
52
  "test:router": "node --test packages/relay-router/test/native-device-selection.test.mjs packages/relay-router/test/quotas.test.mjs",
53
- "test:plugin": "node --test --test-concurrency=1 packages/dsh-remote-web/test/*.test.mjs",
53
+ "_comment:test:plugin": "DSH_RELAY_SKIP_SERVICE=1 = 测试隔离:插件加载时不做真实系统操作(npx 补装 / launchctl / 重启 harness);需要真实分支的用例自行 unset(见 account-switch / runtime-provision / harness-restart 用例注释)",
54
+ "test:plugin": "DSH_RELAY_SKIP_SERVICE=1 node --test --test-concurrency=1 packages/dsh-remote-web/test/*.test.mjs",
54
55
  "test:bridge": "node --test clients/dsh-remote/test/*.test.mjs",
55
56
  "check": "node --check clients/dsh-remote/dsh-bridge.mjs && node --check clients/dsh-remote/e2ee-shim.mjs && node --check dsh-setup.mjs && node --check packages/dsh-remote-web/lib/index.js && node --check packages/dsh-remote-web/lib/client.js && bash -n deploy/install-open.sh && npm run check:alias",
56
57
  "sync:alias": "node scripts/sync-legacy-alias.mjs",
57
- "check:alias": "node scripts/sync-legacy-alias.mjs --check"
58
+ "check:alias": "node scripts/sync-legacy-alias.mjs --check",
59
+ "release:tarballs": "bash scripts/release-tarballs.sh"
58
60
  },
59
61
  "dependencies": {
60
62
  "ws": "^8.18.0"
@@ -91,6 +91,13 @@ window.__ModuleLoader__.load({
91
91
  ".dru-msg-err{color:#cf222e}",
92
92
  ".dru-msg-warn{color:#9a6700}",
93
93
  ".dru-hint{font-size:12px;color:#57606a;line-height:1.6}",
94
+ // ── 重启 DeepSeek harness(首次安装/更新后置顶提醒 + 底部常驻按钮) ──
95
+ ".dru-restart-alert{display:flex;gap:10px;align-items:flex-start;background:#fff8c5;border:1px solid #d4a72c;border-radius:10px;padding:12px 14px;margin-bottom:12px}",
96
+ ".dru-restart-alert-icon{font-size:18px;line-height:1.2}",
97
+ ".dru-restart-alert-title{font-size:13px;font-weight:700;color:#7d4e00}",
98
+ ".dru-restart-alert-sub{font-size:12px;color:#6b5900;margin-top:4px;line-height:1.6}",
99
+ ".dru-restart-foot{margin-top:14px;padding-top:12px;border-top:1px solid #eaeef2;display:flex;gap:10px;align-items:center;flex-wrap:wrap}",
100
+ ".dru-restart-foot .dru-hint{flex:1;min-width:180px;margin:0}",
94
101
  // ── 用户反馈模块 ──
95
102
  ".dru-fb-tabs{display:flex;gap:8px;margin-bottom:10px}",
96
103
  ".dru-fb-tab{flex:1;padding:6px 0;text-align:center;border-radius:8px;cursor:pointer;font-size:12.5px;font-weight:600;color:#57606a;background:#eaeef2;border:1px solid #d0d7de;user-select:none}",
@@ -1202,6 +1209,19 @@ window.__ModuleLoader__.load({
1202
1209
 
1203
1210
  var loggedIn = !!(st && st.config && (st.config.phone || st.config.hasLocalKey));
1204
1211
  var serviceRunning = !!(st && st.service && st.service.running);
1212
+ // 0.6.2:运行环境是否就绪 + launchd 是否处于崩溃循环(入口脚本缺失导致的 KeepAlive 重拉)。
1213
+ // 旧版把「作业在 launchd 里但进程秒退」显示成「运行中」,用户完全看不出问题在哪。
1214
+ var serviceRuntimeReady = !(st && st.service && st.service.runtimeReady === false);
1215
+ var serviceLaunchd = (st && st.service && st.service.launchd) || {};
1216
+ var serviceCrashing = !!serviceLaunchd.crashing;
1217
+ var serviceStateText = !st ? "查询中…"
1218
+ : serviceRunning ? "运行中"
1219
+ : serviceCrashing ? "启动失败(已自动转入修复)"
1220
+ : !serviceRuntimeReady ? "运行环境安装中…"
1221
+ : "已停止";
1222
+ // 是否需要重启 DeepSeek harness(首次安装/在线更新后置顶提醒 + 底部常驻按钮)
1223
+ var restartInfo = (st && st.restart) || {};
1224
+ var restartPending = !!restartInfo.pending;
1205
1225
  // 账号标识(掩码手机号):登录成功/换账号时变化 → 触发上方的重取 effect(比布尔 loggedIn 更敏感)
1206
1226
  var phoneKey = (st && st.config && st.config.phone) || "";
1207
1227
  var launchdPid = st && st.service && st.service.launchd && st.service.launchd.pid;
@@ -1718,6 +1738,39 @@ window.__ModuleLoader__.load({
1718
1738
  .finally(function () { setBusy(""); });
1719
1739
  };
1720
1740
 
1741
+ /**
1742
+ * 重启 DeepSeek harness:插件本体与浏览器半在进程启动时装载,首次安装/在线更新后
1743
+ * 必须重启才生效。重启会短暂断开本页面 —— 这里轮询等它回来,然后自动刷新。
1744
+ */
1745
+ var restartHarness = function () {
1746
+ setBusy("restart");
1747
+ post("/dsh-remote/harness/restart")
1748
+ .then(function (body) {
1749
+ setSt(body);
1750
+ setMsg("ok", "🔄 正在重启 DeepSeek harness" + (body && body.mode ? "(" + body.mode + ")" : "") +
1751
+ "…约 2~10 秒,页面会自动刷新,无需手动操作。");
1752
+ waitHarnessBack(0, false);
1753
+ })
1754
+ .catch(function (e) {
1755
+ setMsg("err", "重启失败: " + e.message + " —— 请手动重启 DeepSeek harness(退出 dsh web 后重新启动)。");
1756
+ setBusy("");
1757
+ });
1758
+ };
1759
+
1760
+ /** 轮询等待 harness 回来;观察到「断过又恢复」或等待足够久后自动刷新页面。 */
1761
+ var waitHarnessBack = function (tries, sawDown) {
1762
+ if (tries > 40) { setMsg("err", "重启后仍未就绪,请手动刷新页面或重启 DeepSeek harness。"); setBusy(""); return; }
1763
+ setTimeout(function () {
1764
+ fetch("/dsh-remote/status", { cache: "no-store" })
1765
+ .then(function (r) { if (!r.ok) throw new Error("HTTP " + r.status); return r.json(); })
1766
+ .then(function () {
1767
+ if (sawDown || tries >= 8) { location.reload(); return; }
1768
+ waitHarnessBack(tries + 1, sawDown);
1769
+ })
1770
+ .catch(function () { waitHarnessBack(tries + 1, true); });
1771
+ }, 1500);
1772
+ };
1773
+
1721
1774
  var saveLocal = function () {
1722
1775
  if (!selfHost.trim() || !localKey.trim()) { setMsg("err", "请填写服务器地址与访问密钥"); return; }
1723
1776
  setBusy("local");
@@ -2139,7 +2192,7 @@ window.__ModuleLoader__.load({
2139
2192
  card("🖥 Bridge 服务",
2140
2193
  h("div", { className: "dru-status-line" },
2141
2194
  h("span", { className: "dru-dot " + (serviceRunning ? "dru-dot-on" : "dru-dot-off") }),
2142
- h("span", null, st ? (serviceRunning ? "运行中" : "已停止") : "查询中…"),
2195
+ h("span", null, st ? serviceStateText : "查询中…"),
2143
2196
  launchdPid ? h("span", { className: "dru-meta", style: { marginTop: 0 } }, "(pid=" + launchdPid + ")") : null
2144
2197
  ),
2145
2198
  h("div", { className: "dru-actions", style: { marginTop: 10 } },
@@ -2149,6 +2202,14 @@ window.__ModuleLoader__.load({
2149
2202
  ),
2150
2203
  h("div", { className: "dru-meta" }, st && st.config && st.config.deviceId ? "设备 ID:" + st.config.deviceId : "设备 ID:生成中"),
2151
2204
  h("div", { className: "dru-meta" }, st ? (st.service && st.service.plistExists ? "自启动服务已安装" : "自启动服务未安装(启动时自动创建)") : ""),
2205
+ // 0.6.2:把「运行环境缺失 / launchd 崩溃循环」如实告诉用户,而不是显示「运行中」
2206
+ st && !serviceRuntimeReady
2207
+ ? h("div", { className: "dru-hint", style: { marginTop: 8 } },
2208
+ "🛠 插件市场只装「面板插件」,桌面运行环境(bridge)需要额外补装——已自动在后台安装,装完会自动启动 bridge,不用做任何操作。若超过几分钟仍未变成「运行中」,点上方版本卡的「一键更新」手动补全。")
2209
+ : serviceCrashing
2210
+ ? h("div", { className: "dru-hint", style: { marginTop: 8 } },
2211
+ "⚠️ 上一次启动失败(自启动入口失效),已自动清理失效自启动项并重新补装运行环境。稍候会自动恢复;仍失败请点「一键更新」。")
2212
+ : null,
2152
2213
  st && st.service && st.service.bindError
2153
2214
  ? h("div", { className: "dru-msg dru-msg-err", style: { marginTop: 8 } },
2154
2215
  "⚠️ 设备注册失败:" + (st.service.bindError.message || "未说明原因"),
@@ -2214,8 +2275,37 @@ window.__ModuleLoader__.load({
2214
2275
  )
2215
2276
  ),
2216
2277
  h("div", { className: "dru-settings-body" },
2278
+ restartPending
2279
+ ? h("div", { className: "dru-restart-alert", role: "status" },
2280
+ h("span", { className: "dru-restart-alert-icon" }, "🔔"),
2281
+ h("div", { style: { flex: "1" } },
2282
+ h("div", { className: "dru-restart-alert-title" },
2283
+ restartInfo.kind === "update" ? "在线更新已完成,需要重启 DeepSeek harness" : "首次安装需要重启 DeepSeek harness"),
2284
+ h("div", { className: "dru-restart-alert-sub" },
2285
+ "插件本体与「远程访问」面板是在 DeepSeek harness 启动时装载的,重启之后即可正常使用(账号、二维码、bridge 全部生效)。"),
2286
+ h("div", { className: "dru-actions", style: { marginTop: 10 } },
2287
+ h("button", {
2288
+ type: "button",
2289
+ className: "dru-btn dru-btn-primary",
2290
+ disabled: busy !== "",
2291
+ onClick: function () { restartHarness(); }
2292
+ }, busy === "restart" ? "重启中…" : "重启 DeepSeek harness")
2293
+ )
2294
+ )
2295
+ )
2296
+ : null,
2217
2297
  view === "feedback" ? renderFeedback() : view === "invite" ? renderInvite() : renderHome()
2218
2298
  ),
2299
+ // 常驻入口最底部:「重启 DeepSeek harness」按钮始终可达(首次安装/更新/排查都用它)
2300
+ h("div", { className: "dru-restart-foot" },
2301
+ h("div", { className: "dru-hint" }, "重启 DeepSeek harness:插件与面板在 harness 启动时装载,首次安装或在线更新后重启即可生效;仅重启 dsh web,不影响 bridge 与手机端连接。"),
2302
+ h("button", {
2303
+ type: "button",
2304
+ className: "dru-btn " + (restartPending ? "dru-btn-primary" : "dru-btn-ghost"),
2305
+ disabled: busy !== "",
2306
+ onClick: function () { restartHarness(); }
2307
+ }, busy === "restart" ? "重启中…" : "🔄 重启 DeepSeek harness")
2308
+ ),
2219
2309
  renderCommunityModal()
2220
2310
  );
2221
2311
  }