@mrrisega/dsh-remote 0.6.4-beta.7 → 0.6.4-beta.8
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/dsh-setup.mjs
CHANGED
|
@@ -689,11 +689,13 @@ async function setup(argv) {
|
|
|
689
689
|
// patch 激活形态:harness 的 HMR 监听 profile patch 文件,存盘后约 1 秒重新 compose。
|
|
690
690
|
// 所以这里**先等热挂载**,等到了就完全不需要重启(用户只需刷新页面拿浏览器半)。
|
|
691
691
|
if (needRestart && pluginResult && pluginResult.hotPatch) {
|
|
692
|
-
|
|
692
|
+
// HMR 通常 1~3 秒完成,但插件节点半还要起服务、注册路由,机器繁忙时会到十几秒;
|
|
693
|
+
// 给足 ~30 秒窗口,避免"其实已经热挂载成功、却报成需要重启"的误报(实测踩到)。
|
|
694
|
+
for (let i = 0; i < 45; i += 1) {
|
|
693
695
|
const r = await fetch("http://127.0.0.1:3080/dsh-remote/status", { signal: AbortSignal.timeout(900) })
|
|
694
696
|
.catch(() => null);
|
|
695
697
|
if (r && r.ok) { hotMounted = true; break; }
|
|
696
|
-
sleepSync(
|
|
698
|
+
sleepSync(700);
|
|
697
699
|
}
|
|
698
700
|
if (hotMounted) needRestart = false;
|
|
699
701
|
}
|
|
@@ -782,6 +784,12 @@ async function setup(argv) {
|
|
|
782
784
|
} else if (needRestart && restartResult && restartResult.ok) {
|
|
783
785
|
L.push("");
|
|
784
786
|
L.push(" 下一步: dsh web 已重启,直接打开 http://127.0.0.1:3080 → 设置 → 「远程控制」→ 注册/登录手机号。");
|
|
787
|
+
} else if (needRestart && pluginResult && pluginResult.hotPatch && pluginResult.changed) {
|
|
788
|
+
// patch 已写入但探测窗口内没等到面板接口:热加载很可能还在进行(插件节点半启动+注册路由)。
|
|
789
|
+
// 这种情况**不能**直接让用户重启 —— 先让他等几秒刷新,再给兜底方案。
|
|
790
|
+
L.push("");
|
|
791
|
+
L.push("ℹ 插件已按热加载方式登记(patch 已写入),若「设置 → 远程控制」还没出现:");
|
|
792
|
+
L.push(" 等几秒后刷新页面即可;仍未出现再重启一次 dsh web(命令见 README)。");
|
|
785
793
|
} else if (needRestart) {
|
|
786
794
|
// 需要重启但没做成功:必须给出**可照抄**的命令,而不是只说"请重启"
|
|
787
795
|
L.push("");
|
|
@@ -1187,8 +1195,11 @@ async function pluginCmd(argv) {
|
|
|
1187
1195
|
return;
|
|
1188
1196
|
}
|
|
1189
1197
|
|
|
1190
|
-
//
|
|
1191
|
-
|
|
1198
|
+
// 安装:收敛到"恰好一处激活"(热挂载 patch 行 或 bundles,二选一),绝不与市场/历史 include 并存
|
|
1199
|
+
//
|
|
1200
|
+
// ⚠️ 必须 **return 结果**:setup() 依赖它判断激活形态(false/undefined = 走 bundles,需重启),
|
|
1201
|
+
// 少了这个 return,安装后就不会去验证热挂载,白白多报一次"需要重启"(实测踩到)。
|
|
1202
|
+
return convergePluginActivation(profileDir, pkgFile, patchFile, pluginDir, patch);
|
|
1192
1203
|
|
|
1193
1204
|
// 引导语只在 setup 汇总里打印一次(这里不再重复;单独跑 `dsh-remote plugin` 也无需引导)
|
|
1194
1205
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrrisega/dsh-remote",
|
|
3
|
-
"version": "0.6.4-beta.
|
|
3
|
+
"version": "0.6.4-beta.8",
|
|
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",
|
|
@@ -1739,7 +1739,7 @@ const PLUGIN_ID = "dsh-remote-web";
|
|
|
1739
1739
|
const PLUGIN_LEGACY_IDS = ["dsh-remote-ui"];
|
|
1740
1740
|
const PLUGIN_ALL_IDS = [PLUGIN_ID, ...PLUGIN_LEGACY_IDS];
|
|
1741
1741
|
/** 插件自身发布版本(与 dsh-remote 根包同步递增)。 */
|
|
1742
|
-
const PLUGIN_VERSION = "0.6.4-beta.
|
|
1742
|
+
const PLUGIN_VERSION = "0.6.4-beta.8";
|
|
1743
1743
|
const UPDATE_LOG = ".dsh-update.log";
|
|
1744
1744
|
const UPDATE_MARKER = ".dsh-update-running";
|
|
1745
1745
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-remote-web",
|
|
3
|
-
"version": "0.6.4-beta.
|
|
3
|
+
"version": "0.6.4-beta.8",
|
|
4
4
|
"description": "公网远程控制 DeepSeek Harness(dsh web):安装即得专属加密地址,人在外面也能用手机访问电脑上的 dsh——无需同一局域网/WiFi、无需公网 IP 与内网穿透,全程加密;手机端 100% 还原电脑体验(对话/工具/审批/设置)。技术用户可选自建服务,流量走自己的服务器。Remote control DeepSeek Harness (dsh web) from anywhere over the public internet — install, get an encrypted URL, use it from your phone on any network (dual-half cordis plugin: Settings panel + same-origin /dsh-remote routes). (2026-09 由 dsh-remote-ui 更名 / renamed from dsh-remote-ui; dsh-remote 的 dsh web 插件半,不是纯 UI/皮肤插件)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -170,3 +170,14 @@ test("安全护栏:原子写回 —— 不留 .tmp 残留,且末尾换行规
|
|
|
170
170
|
assert.ok(readPatch(profile).endsWith("\n"), "文件应以换行结尾");
|
|
171
171
|
} finally { cleanup(profile); }
|
|
172
172
|
});
|
|
173
|
+
|
|
174
|
+
test("回归护栏:plugin 子命令必须把激活结果 return 给 setup(否则热挂载验证被跳过)", () => {
|
|
175
|
+
// 事故复盘:convergePluginActivation 已经返回 {hotPatch},但 pluginCmd 没把它 return 出去,
|
|
176
|
+
// 于是 setup() 拿不到激活形态 → 跳过热挂载验证 → 明明热挂载成功却仍报「需要重启」。
|
|
177
|
+
const src = readFileSync(SETUP, "utf8");
|
|
178
|
+
const call = src.match(/return convergePluginActivation\(profileDir[^\n]*/);
|
|
179
|
+
assert.ok(call, "pluginCmd 必须 return convergePluginActivation(...) 的结果");
|
|
180
|
+
// setup() 必须真的消费这个结果
|
|
181
|
+
assert.match(src, /pluginResult = await pluginCmd\(\[\]\)/, "setup 应保存 pluginCmd 的返回值");
|
|
182
|
+
assert.match(src, /pluginResult\.hotPatch/, "应据 hotPatch 判断是否走热挂载形态");
|
|
183
|
+
});
|