mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-30 16:20:22 +08:00
fix: 发布 1.1.61,多宿主 Apply 与 #73/#74、极简 preset
- Apply/reapply 同时写 npm-global 与桌面宿主;#73 地区闸门误拦;#74 提示词落盘与 resolveInjectText - 极简 #80 官方 shell;agent-preset/selected 优先;adaptInjectForMinimalPreset;refusal-recover 扩展 - identity 注入去重与组装;默认提示词重加密 asset-table.js Closes #73. Closes #74. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
cefce7e6ec
commit
8dcbad241b
17 files changed
+957
-429
No files matched your search
+33
-1
@@ -99,6 +99,37 @@ const OFFICIAL_HARNESS_BASES = new Set([
|
||||
"deepseek-harness",
|
||||
]);
|
||||
|
||||
/**
|
||||
* 只把「路径自己那一段」当桌面名字,不看祖先目录。
|
||||
*
|
||||
* 上面那段注释说要避免的事,原实现其实在做:`n.includes("/deepseek harness/")`
|
||||
* 会命中任意祖先目录。而 npm 前缀(`D:\DeepSeek Harness\npm-global\…`)和
|
||||
* DSH_HOME 的父目录(`D:\DeepSeek Harness\.dsh` 的上级)恰好都叫这个名字 ——
|
||||
* 于是 Web 安装根被判成桌面,findAiBaseWeb 里每一处
|
||||
* `!isInsideDesktopInstall(cand)` 守卫都会把正确答案踢掉,Web 面定位不到宿主。
|
||||
*
|
||||
* 真正的桌面安装靠结构标记判定:路径里含 `/resources/app/`、
|
||||
* `/resources/app.asar.unpacked/` 或 `/contents/resources/`(见 inferDesktopInstallDir)。
|
||||
* 名字只作为「这一级目录本身就是安装根」的兜底。
|
||||
*/
|
||||
export function looksLikeDesktopNameTail(p) {
|
||||
const n = slashNorm(p).toLowerCase().replace(/\/+$/, "");
|
||||
if (!n) return false;
|
||||
const cut = n.lastIndexOf("/");
|
||||
const tail = cut >= 0 ? n.slice(cut + 1) : n;
|
||||
if (!tail) return false;
|
||||
return (
|
||||
tail === "dsh desktop" ||
|
||||
tail === "dsh desktop.app" ||
|
||||
tail === "deepseek harness" ||
|
||||
tail === "deepseek harness.app" ||
|
||||
tail === "deepseek-harness" ||
|
||||
tail === "deepseekharness" ||
|
||||
/^dsh-desktop/.test(tail) ||
|
||||
/^deepseek[\s._-]*harness(\.exe)?$/.test(tail)
|
||||
);
|
||||
}
|
||||
|
||||
function sameBase(name, expected) {
|
||||
return String(name || "").toLowerCase() === expected;
|
||||
}
|
||||
@@ -555,7 +586,8 @@ export function listDesktopInstallRoots(input = {}) {
|
||||
*/
|
||||
export function isInsideDesktopInstall(p, input = {}) {
|
||||
if (!p) return false;
|
||||
if (looksLikeDesktopName(p)) return true;
|
||||
// 名字兜底只看路径尾部那一段,不看祖先目录名 —— 见 looksLikeDesktopNameTail。
|
||||
if (looksLikeDesktopNameTail(p)) return true;
|
||||
const roots = listDesktopInstallRoots(input);
|
||||
if (roots.some((root) => isSubPath(p, root))) return true;
|
||||
const inferred = inferDesktopInstallDir(p);
|
||||
|
||||
Reference in new issue
Block a user