fix: 面板不再盖住官方对话,重打补丁不再回写前端包

浮层收成右侧窄条,底边停在输入框上方;演练台嵌在面板里时不再给官方窗口加右侧内边距。重打补丁时若前端 client.js 内容没变就不写,避免页面按旧 rev 404。桌面启动自检不再杀掉自己,清洗标记同时认新旧两句。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
叫我小杨同学andCursor committed 2026-10-04 21:24:20 +08:00
1 parent 354f9a1960
commit 813fbe4d54
8 files changed
+458 -188

No files matched your search

+19 -2
View File
@@ -128,6 +128,22 @@ export function patchesMatchInstall() {
return hostStillHasAppliedPatches();
}
/**
* 宿主上的清洗还在,只是版本戳旧了。启动时不能因此 revertAll,
* 否则用户点应用并重启后,页面会回到「要重新清洗」。
*/
export async function hostCleanEnoughToKeep() {
let aiBase = "";
try {
aiBase = core.findAiBase() || "";
} catch {
return false;
}
if (!aiBase || !core.hostCleanMarkersPresent(aiBase)) return false;
const status = await core.patchStatus(aiBase);
return !Object.values(status).some((row) => row === "pending");
}
/** 有 applied 戳但宿主已回到密封 asar / 清洗标记没了:面板提示「补丁已丢失」(#57)。找不到根不算丢失。 */
export function patchesLostAfterHostReset() {
const stamp = readAppliedStamp();
@@ -251,10 +267,11 @@ export async function reapplyInstalled(options = {}) {
}
if (!aiBase) return { ok: false, error: core.missingAiBaseMessage() };
// 刚解开的是官方原件。已经在用的目录仍先还原再按这一版重打。
const reverted = freshExtract ? { reverted: [] } : await core.revertAll(aiBase);
const preserveClientBundles = options.preserveClientBundles !== false;
const reverted = freshExtract ? { reverted: [] } : await core.revertAll(aiBase, { preserveClientBundles });
if (!freshExtract) await core.revertAllShims();
await core.backupAll(aiBase);
const report = await core.applyPatches(aiBase);
const report = await core.applyPatches(aiBase, core.ALL_PATCHES, { preserveClientBundles });
await core.patchAllShims();
const flash = core.silenceCmdFlash(aiBase);
const summary = core.summarizeApplyReport(report);