@mrrisega/dsh-remote 0.3.5 → 0.3.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/dsh-setup.mjs +17 -14
- package/package.json +1 -1
package/dsh-setup.mjs
CHANGED
|
@@ -557,26 +557,29 @@ function copyPluginIntoProfile(profileDir, pluginDir) {
|
|
|
557
557
|
}
|
|
558
558
|
|
|
559
559
|
/**
|
|
560
|
-
* 兜底:确保 dsh 能从 profile 的 node_modules 解析到 dsh-remote-ui
|
|
561
|
-
*
|
|
562
|
-
*
|
|
563
|
-
*
|
|
560
|
+
* 兜底:确保 dsh 能从 profile 的 node_modules 解析到 dsh-remote-ui,且指向本次拷贝的插件目录。
|
|
561
|
+
* 常见坑:
|
|
562
|
+
* - 残留的旧软链指向旧 npx 缓存(可能悬空/已清理),existsSync 判“存在”会误跳过 → 必须校验真实目标;
|
|
563
|
+
* - pnpm 布局的 profile 里跑 npm install 会崩(npm 读 .pnpm 报错),不能依赖包管理器。
|
|
564
|
+
* 因此这里:解析现有链接的真实目标,只要不等于本次拷贝目录就强制重建为绝对路径链接/拷贝。
|
|
565
|
+
* 返回 true 表示本次重建了链接。
|
|
564
566
|
*/
|
|
565
567
|
function ensurePluginLinked(profileDir, pluginLocalDir) {
|
|
566
|
-
const
|
|
567
|
-
|
|
568
|
+
const nmDir = path.join(profileDir, "node_modules");
|
|
569
|
+
const nmPlugin = path.join(nmDir, "dsh-remote-ui");
|
|
570
|
+
fs.mkdirSync(nmDir, { recursive: true });
|
|
571
|
+
// 已正确指向本次拷贝目录 → 无需处理
|
|
572
|
+
try {
|
|
573
|
+
if (fs.realpathSync(nmPlugin) === pluginLocalDir) return false;
|
|
574
|
+
} catch { /* 悬空或不存在 → 需要重建 */ }
|
|
575
|
+
try { fs.rmSync(nmPlugin, { recursive: true, force: true }); } catch { /* ignore */ }
|
|
568
576
|
try {
|
|
569
|
-
fs.mkdirSync(path.join(profileDir, "node_modules"), { recursive: true });
|
|
570
577
|
fs.symlinkSync(pluginLocalDir, nmPlugin, "dir");
|
|
571
|
-
return true;
|
|
572
578
|
} catch {
|
|
573
|
-
|
|
574
|
-
fs.cpSync(pluginLocalDir, nmPlugin, { recursive: true });
|
|
575
|
-
return true;
|
|
576
|
-
} catch {
|
|
577
|
-
return false;
|
|
578
|
-
}
|
|
579
|
+
fs.cpSync(pluginLocalDir, nmPlugin, { recursive: true });
|
|
579
580
|
}
|
|
581
|
+
// 复核
|
|
582
|
+
try { return fs.realpathSync(nmPlugin) === pluginLocalDir; } catch { return false; }
|
|
580
583
|
}
|
|
581
584
|
|
|
582
585
|
async function pluginCmd(argv) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrrisega/dsh-remote",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
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",
|