feat: 发布 1.1.12,测试版 Skill 进入正式版

正式版带上 Skill 导入,并保留不再钉上一轮全文、按提交号标当前和拒绝跨站请求。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
叫我小杨同学andCursor committed 2026-09-22 11:21:04 +08:00
commit d3b3bc3551
9 files changed
+1389 -108

No files matched your search

+43 -4
View File
@@ -1318,7 +1318,37 @@ export function normPath(p) {
export function isDshHomeDir(dir) {
if (!dir || !isDir(dir)) return false;
return path.basename(path.normalize(dir)) === ".dsh";
const base = path.basename(path.normalize(dir)).toLowerCase();
return base === ".dsh" || base === "dsh-home";
}
function desktopHomeCandidates() {
const out = [];
const push = (dir) => {
if (!dir) return;
const root = path.normalize(dir);
out.push(root);
out.push(path.join(root, ".dsh"));
out.push(path.join(root, "dsh-home"));
};
try {
const exe = desktop.findDesktopAppExecutable();
if (exe) push(path.dirname(exe));
} catch { /* ignore */ }
try {
if (process.resourcesPath) push(path.dirname(path.normalize(process.resourcesPath)));
} catch { /* ignore */ }
try {
for (const root of desktop.listDesktopInstallRoots()) push(root);
} catch { /* ignore */ }
for (const guess of desktopDshHomeGuesses()) out.push(guess);
const seen = new Set();
return out.filter((item) => {
const key = path.normalize(item).replace(/\\/g, "/").toLowerCase();
if (seen.has(key)) return false;
seen.add(key);
return true;
});
}
export function portableHomeFromLauncher(shimDir, prefix) {
@@ -1350,15 +1380,24 @@ function desktopDshHomeGuesses() {
];
}
// DSH_HOME → 启动器旁 .dsh → ~/.dsh
// DSH_HOME → 桌面进程旁 .dsh/dsh-home → 启动器旁 .dsh → ~/.dsh
// 不写死盘符;桌面端不借用 Web 启动器旁的主目录。
export function findDshHome(options = {}) {
const env = options.env ?? process.env;
const fromEnv = env.DSH_HOME;
if (fromEnv && String(fromEnv).trim()) return path.normalize(fromEnv.trim());
const desktopHost = adapterFor(detectSurface(options)) === "desktop";
if (desktopHost) {
for (const cand of desktopHomeCandidates()) {
if (isDshHomeDir(cand)) return path.normalize(cand);
}
}
const shimDir = options.shimDir !== undefined ? options.shimDir : findShimDir();
const prefix = options.prefix !== undefined ? options.prefix : findNpmPrefix();
const portable = portableHomeFromLauncher(shimDir, prefix);
if (portable) return portable;
if (!desktopHost) {
const portable = portableHomeFromLauncher(shimDir, prefix);
if (portable) return portable;
}
const unix = path.join(os.homedir(), ".dsh");
if (isDir(unix)) return unix;
const wslWin = findWslWindowsDshHome(env);