Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

feat(desktop): send a Windows file to a note from the context menu

tianma-ifcfd73b792b3b
diff --git a/apps/desktop/electron-builder.yml b/apps/desktop/electron-builder.yml
index 41206036..94f6e3a5 100644
--- a/apps/desktop/electron-builder.yml
+++ b/apps/desktop/electron-builder.yml
@@ -79,6 +79,7 @@ win:
nsis:
oneClick: true
perMachine: false
+ include: nsis/installer.nsh
linux:
category: Utility
syncDesktopName: true
diff --git a/apps/desktop/nsis/installer.nsh b/apps/desktop/nsis/installer.nsh
new file mode 100644
index 00000000..344024d7
--- /dev/null
+++ b/apps/desktop/nsis/installer.nsh
@@ -0,0 +1,11 @@
+; Per-user Explorer verb. Runtime registration refreshes the label and exe path.
+!macro customInstall
+ WriteRegStr HKCU "Software\Classes\*\shell\EdgeEver" "" "发送到 EdgeEver"
+ WriteRegStr HKCU "Software\Classes\*\shell\EdgeEver" "Icon" "$\"$INSTDIR\${APP_EXECUTABLE_FILENAME}$\",0"
+ WriteRegStr HKCU "Software\Classes\*\shell\EdgeEver" "MultiSelectModel" "Document"
+ WriteRegStr HKCU "Software\Classes\*\shell\EdgeEver\command" "" "$\"$INSTDIR\${APP_EXECUTABLE_FILENAME}$\" --share-file $\"%1$\""
+!macroend
+
+!macro customUnInstall
+ DeleteRegKey HKCU "Software\Classes\*\shell\EdgeEver"
+!macroend
diff --git a/apps/desktop/src/main/index.mjs b/apps/desktop/src/main/index.mjs
index 74f15253..d2e26832 100644
--- a/apps/desktop/src/main/index.mjs
+++ b/apps/desktop/src/main/index.mjs
@@ -12,6 +12,7 @@ import { downloadContentDispositionFromRequest, isSafeResourceId, parseByteRange
import { isSupportedAssociatedFile } from "./file-association.mjs";
import { createWeChatShareController } from "./wechat-share-import.mjs";
import { enableMacShareExtension } from "./share-extension-registration.mjs";
+import { registerWindowsShareMenu, shareFilePathsFromCommandLine } from "./windows-share-menu.mjs";
import { accountDataDirectory, accountScopeKey } from "./account-scope.mjs";
import { rotateDiagnosticLog } from "./diagnostic-log.mjs";
import { restrictDirectory, restrictFile } from "./file-permissions.mjs";
@@ -723,9 +724,22 @@ const handleProtocolUrl = (target) => {
}
};
+const pendingShareFiles = [];
+
+const importSharedCommandLineFiles = (commandLine) => {
+ const sharedFiles = shareFilePathsFromCommandLine(commandLine);
+ if (!protocolUrlsReady) {
+ pendingShareFiles.push(...sharedFiles);
+ return sharedFiles.length > 0;
+ }
+ for (const filePath of sharedFiles) void wechatShare().importLocalFile(filePath);
+ return sharedFiles.length > 0;
+};
+
const handleOpenTarget = (commandLine) => {
const target = commandLine.find((value) => value.startsWith("edgeever://"));
if (target) handleProtocolUrl(target);
+ if (importSharedCommandLineFiles(commandLine)) return;
const associatedFile = commandLine.find((value) => !value.startsWith("-") && isSupportedAssociatedFile(value));
if (associatedFile) void importMarkdownFile(associatedFile);
};
@@ -1860,10 +1874,24 @@ const startApplication = async () => {
message: error instanceof Error ? error.message : String(error),
});
});
+ void registerWindowsShareMenu({
+ platform: process.platform,
+ packaged: app.isPackaged,
+ exePath: process.execPath,
+ locale: app.getLocale(),
+ execFile,
+ }).then((result) => {
+ if (result.registered) void writeDiagnostic("windows-share-menu.registered");
+ }).catch((error) => {
+ void writeDiagnostic("windows-share-menu.register-failed", {
+ message: error instanceof Error ? error.message : String(error),
+ });
+ });
configureAutoUpdater();
handleOpenTarget(process.argv);
protocolUrlsReady = true;
while (pendingProtocolUrls.length > 0) handleProtocolUrl(pendingProtocolUrls.shift());
+ while (pendingShareFiles.length > 0) void wechatShare().importLocalFile(pendingShareFiles.shift());
if (process.platform === "darwin" && app.isPackaged) {
void wechatShare().importPending();
setInterval(() => { void wechatShare().importPending(); }, 2_000).unref();
diff --git a/apps/desktop/src/main/wechat-share-import.mjs b/apps/desktop/src/main/wechat-share-import.mjs
index 73a9a2cd..b822e208 100644
--- a/apps/desktop/src/main/wechat-share-import.mjs
+++ b/apps/desktop/src/main/wechat-share-import.mjs
@@ -150,16 +150,16 @@ export const createWeChatShareController = ({
if (!session) return;
if (!success) {
session.failed = true;
- failedPaths.add(session.zipPath);
+ if (!session.preserveSource) failedPaths.add(session.zipPath);
const failedEvent = session.payload?.kind === "file" ? "share-import.save-failed" : "wechat-import.save-failed";
void writeDiagnostic(failedEvent);
return;
}
sessions.delete(importId);
preparedPaths.delete(session.zipPath);
- completedPaths.add(session.zipPath);
+ if (!session.preserveSource) completedPaths.add(session.zipPath);
failedPaths.delete(session.zipPath);
- await removeImportedZip(session.zipPath, downloadsPath());
+ if (!session.preserveSource) await removeImportedZip(session.zipPath, downloadsPath());
if (session.directory) await rm(session.directory, { recursive: true, force: true }).catch(() => {});
const savedEvent = session.payload?.kind === "file" ? "share-import.saved" : "wechat-import.saved";
void writeDiagnostic(savedEvent, { media: session.media.size });
@@ -187,7 +187,7 @@ export const createWeChatShareController = ({
return { filename: media.filename, mimeType: media.mimeType, bytes };
};
- const prepareFileShare = (sourcePath, byteSize) => {
+ const prepareFileShare = (sourcePath, byteSize, { preserveSource = false } = {}) => {
const filename = basename(sourcePath);
const importId = randomUUID();
const mimeType = mimeTypeForFilename(filename);
@@ -205,31 +205,16 @@ export const createWeChatShareController = ({
zipPath: sourcePath,
payload,
failed: false,
+ preserveSource,
});
- preparedPaths.add(sourcePath);
+ if (!preserveSource) preparedPaths.add(sourcePath);
sendToRenderer(payload);
void writeDiagnostic("share-import.prepared", { bytes: byteSize });
};
- const importFromProtocolUrl = async (value) => {
- const requestedPath = wechatImportFilePath(value);
- if (!requestedPath) return;
- let shareFile = false;
- try {
- shareFile = new URL(value).hostname === "share-import";
- } catch {
- return;
- }
- const downloads = downloadsPath();
- let sourcePath = null;
+ const openSharedFile = async (sourcePath, { preserveSource }) => {
let preparedDirectory = null;
try {
- sourcePath = shareFile
- ? await assertIncomingFile(requestedPath, downloads)
- : await assertIncomingZip(requestedPath, downloads);
- if (inFlightPaths.has(sourcePath) || preparedPaths.has(sourcePath)
- || completedPaths.has(sourcePath) || failedPaths.has(sourcePath)) return;
- inFlightPaths.add(sourcePath);
onActivity();
const info = await stat(sourcePath);
if (!info.isFile() || info.size <= 0) throw new ShareImportError("empty");
@@ -238,7 +223,7 @@ export const createWeChatShareController = ({
if (isFileReferencePlaceholder(bytes)) throw new ShareImportError("unreadable");
const note = wechatNoteFromBytes(bytes, basename(sourcePath));
if (!note) {
- prepareFileShare(sourcePath, bytes.length);
+ prepareFileShare(sourcePath, bytes.length, { preserveSource });
return;
}
const importId = randomUUID();
@@ -270,8 +255,8 @@ export const createWeChatShareController = ({
markdown: note.markdown,
media: listed,
};
- sessions.set(importId, { directory, media, zipPath: sourcePath, payload, failed: false });
- preparedPaths.add(sourcePath);
+ sessions.set(importId, { directory, media, zipPath: sourcePath, payload, failed: false, preserveSource });
+ if (!preserveSource) preparedPaths.add(sourcePath);
preparedDirectory = null;
sendToRenderer(payload);
void writeDiagnostic("wechat-import.prepared", { media: listed.length, bytes: bytes.length });
@@ -280,12 +265,11 @@ export const createWeChatShareController = ({
const reason = error instanceof WeChatArchiveError || error instanceof ShareImportError
? error.code
: "failed";
- if (reason === "unreadable" && sourcePath) {
- await removeImportedZip(sourcePath, downloads);
- } else if (sourcePath && reason !== "rejected-path") {
+ if (reason === "unreadable" && sourcePath && !preserveSource) {
+ await removeImportedZip(sourcePath, downloadsPath());
+ } else if (sourcePath && reason !== "rejected-path" && !preserveSource) {
failedPaths.add(sourcePath);
}
- // A stale or malformed protocol URL is not a failed save attempt.
if (reason === "rejected-path") {
void writeDiagnostic("wechat-import.rejected", { reason });
return;
@@ -301,11 +285,60 @@ export const createWeChatShareController = ({
}
sendToRenderer({ ok: false, reason: reason === "unrecognized" ? "unrecognized" : "failed" });
void writeDiagnostic("wechat-import.rejected", { reason });
+ }
+ };
+
+ const importFromProtocolUrl = async (value) => {
+ const requestedPath = wechatImportFilePath(value);
+ if (!requestedPath) return;
+ let shareFile = false;
+ try {
+ shareFile = new URL(value).hostname === "share-import";
+ } catch {
+ return;
+ }
+ const downloads = downloadsPath();
+ let sourcePath = null;
+ try {
+ sourcePath = shareFile
+ ? await assertIncomingFile(requestedPath, downloads)
+ : await assertIncomingZip(requestedPath, downloads);
+ if (inFlightPaths.has(sourcePath) || preparedPaths.has(sourcePath)
+ || completedPaths.has(sourcePath) || failedPaths.has(sourcePath)) return;
+ inFlightPaths.add(sourcePath);
+ await openSharedFile(sourcePath, { preserveSource: false });
+ } catch (error) {
+ const reason = error instanceof WeChatArchiveError ? error.code : "failed";
+ if (reason !== "rejected-path" && sourcePath) failedPaths.add(sourcePath);
+ if (reason !== "rejected-path") {
+ sendToRenderer({ ok: false, reason: "failed" });
+ }
+ void writeDiagnostic("wechat-import.rejected", { reason });
} finally {
if (sourcePath) inFlightPaths.delete(sourcePath);
}
};
+ const localInFlight = new Set();
+ const importLocalFile = async (filePath) => {
+ if (typeof filePath !== "string" || !isAbsolute(filePath) || filePath.includes("\0")) return;
+ let sourcePath = null;
+ try {
+ sourcePath = await realpath(filePath);
+ } catch {
+ sendToRenderer({ ok: false, kind: "file", reason: "unreadable" });
+ void writeDiagnostic("share-import.rejected", { reason: "unreadable" });
+ return;
+ }
+ if (localInFlight.has(sourcePath)) return;
+ localInFlight.add(sourcePath);
+ try {
+ await openSharedFile(sourcePath, { preserveSource: true });
+ } finally {
+ localInFlight.delete(sourcePath);
+ }
+ };
+
const importPending = async () => {
const root = incomingDirectory(downloadsPath());
const batches = await readdir(root, { withFileTypes: true }).catch(() => []);
@@ -322,5 +355,5 @@ export const createWeChatShareController = ({
}
};
- return { importFromProtocolUrl, importPending, readMedia, finish, retry };
+ return { importFromProtocolUrl, importLocalFile, importPending, readMedia, finish, retry };
};
diff --git a/apps/desktop/src/main/wechat-share-import.test.mjs b/apps/desktop/src/main/wechat-share-import.test.mjs
index 24a1acee..7b677a1b 100644
--- a/apps/desktop/src/main/wechat-share-import.test.mjs
+++ b/apps/desktop/src/main/wechat-share-import.test.mjs
@@ -439,4 +439,60 @@ describe("WeChat share handoff", () => {
expect(sent).toHaveLength(0);
expect((await readFile(outside)).toString()).toBe("secret");
});
+
+ test("imports a local file from the Windows verb without deleting it", async () => {
+ const root = await mkdtemp(join(tmpdir(), "edgeever-wechat-share-"));
+ roots.push(root);
+ const filePath = join(root, "功能梳理表.xlsx");
+ await writeFile(filePath, Buffer.from("spreadsheet"));
+ const sent = [];
+ const controller = createWeChatShareController({
+ downloadsPath: () => join(root, "Downloads"),
+ tempPath: () => join(root, "temp"),
+ sendToRenderer: (payload) => sent.push(payload),
+ });
+ await controller.importLocalFile(filePath);
+ expect(sent).toHaveLength(1);
+ expect(sent[0]).toMatchObject({
+ ok: true,
+ kind: "file",
+ filename: "功能梳理表.xlsx",
+ });
+ const media = await controller.readMedia(sent[0].importId, SHARE_IMPORT_FILE_ID);
+ expect(Buffer.from(media.bytes).toString()).toBe("spreadsheet");
+ await controller.finish(sent[0].importId, true);
+ expect((await readFile(filePath)).toString()).toBe("spreadsheet");
+ await controller.importLocalFile(filePath);
+ expect(sent).toHaveLength(2);
+ });
+
+ test("keeps a local WeChat zip in place after preparing the chat", async () => {
+ const root = await mkdtemp(join(tmpdir(), "edgeever-wechat-share-"));
+ roots.push(root);
+ const zipPath = join(root, "聊天记录.zip");
+ await writeFile(zipPath, zipOf("聊天记录.txt", "·鱼\n2026年9月22日 22:15\n你好\n", "附件/readme.txt", "hello"));
+ const sent = [];
+ const controller = createWeChatShareController({
+ downloadsPath: () => join(root, "Downloads"),
+ tempPath: () => join(root, "temp"),
+ sendToRenderer: (payload) => sent.push(payload),
+ });
+ await controller.importLocalFile(zipPath);
+ expect(sent[0].ok).toBe(true);
+ expect(sent[0].kind).toBeUndefined();
+ expect(sent[0].markdown).toContain("你好");
+ await controller.finish(sent[0].importId, true);
+ expect((await stat(zipPath)).isFile()).toBe(true);
+ });
+
+ test("ignores a relative local path", async () => {
+ const sent = [];
+ const controller = createWeChatShareController({
+ downloadsPath: () => "/tmp/unused-downloads",
+ tempPath: () => "/tmp/unused-temp",
+ sendToRenderer: (payload) => sent.push(payload),
+ });
+ await controller.importLocalFile("功能梳理表.xlsx");
+ expect(sent).toHaveLength(0);
+ });
});
diff --git a/apps/desktop/src/main/windows-share-menu.mjs b/apps/desktop/src/main/windows-share-menu.mjs
new file mode 100644
index 00000000..c0b9960e
--- /dev/null
+++ b/apps/desktop/src/main/windows-share-menu.mjs
@@ -0,0 +1,62 @@
+import { join } from "node:path";
+
+export const WINDOWS_SHARE_MENU_KEY = "HKCU\\Software\\Classes\\*\\shell\\EdgeEver";
+
+export const windowsShareMenuLabel = (locale) => {
+ const value = String(locale || "").toLowerCase();
+ if (value.startsWith("zh")) return "发送到 EdgeEver";
+ if (value.startsWith("ja")) return "EdgeEver に送る";
+ return "Send to EdgeEver";
+};
+
+export const windowsShareCommand = (exePath) => `"${exePath}" --share-file "%1"`;
+
+export const shareFilePathsFromCommandLine = (commandLine) => {
+ if (!Array.isArray(commandLine)) return [];
+ const paths = [];
+ for (let index = 0; index < commandLine.length; index += 1) {
+ if (commandLine[index] !== "--share-file") continue;
+ const filePath = commandLine[index + 1];
+ if (typeof filePath === "string" && filePath && !filePath.startsWith("-")) paths.push(filePath);
+ index += 1;
+ }
+ return paths;
+};
+
+export const windowsShareRegPath = (systemRoot = process.env.SystemRoot || "C:\\Windows") =>
+ join(systemRoot, "System32", "reg.exe");
+
+export const windowsShareMenuCommands = (exePath, locale) => {
+ const label = windowsShareMenuLabel(locale);
+ const command = windowsShareCommand(exePath);
+ return [
+ ["add", WINDOWS_SHARE_MENU_KEY, "/ve", "/d", label, "/f"],
+ ["add", WINDOWS_SHARE_MENU_KEY, "/v", "Icon", "/d", `"${exePath}",0`, "/f"],
+ ["add", WINDOWS_SHARE_MENU_KEY, "/v", "MultiSelectModel", "/d", "Document", "/f"],
+ ["add", `${WINDOWS_SHARE_MENU_KEY}\\command`, "/ve", "/d", command, "/f"],
+ ];
+};
+
+const runReg = (execFile, regPath, args) => new Promise((resolve, reject) => {
+ execFile(regPath, args, { timeout: 10_000, windowsHide: true }, (error) => {
+ if (error) reject(error);
+ else resolve();
+ });
+});
+
+// Windows 11 keeps this verb under "Show more options". The command points at
+// the installed executable so a right-click can hand the selected file over.
+export const registerWindowsShareMenu = async ({
+ platform,
+ packaged,
+ exePath,
+ locale,
+ execFile,
+ regPath = windowsShareRegPath(),
+}) => {
+ if (platform !== "win32" || !packaged || typeof exePath !== "string" || !exePath) return { registered: false };
+ for (const args of windowsShareMenuCommands(exePath, locale)) {
+ await runReg(execFile, regPath, args);
+ }
+ return { registered: true };
+};
diff --git a/apps/desktop/src/main/windows-share-menu.test.mjs b/apps/desktop/src/main/windows-share-menu.test.mjs
new file mode 100644
index 00000000..8e74a775
--- /dev/null
+++ b/apps/desktop/src/main/windows-share-menu.test.mjs
@@ -0,0 +1,79 @@
+import { readFileSync } from "node:fs";
+import { dirname, join } from "node:path";
+import { fileURLToPath } from "node:url";
+import { describe, expect, test } from "bun:test";
+import {
+ registerWindowsShareMenu,
+ shareFilePathsFromCommandLine,
+ windowsShareCommand,
+ windowsShareMenuCommands,
+ windowsShareMenuLabel,
+} from "./windows-share-menu.mjs";
+
+const exePath = "C:\\Users\\Example\\AppData\\Local\\Programs\\EdgeEver\\EdgeEver.exe";
+
+describe("Windows share menu", () => {
+ test("names the verb in the desktop locale", () => {
+ expect(windowsShareMenuLabel("zh-CN")).toBe("发送到 EdgeEver");
+ expect(windowsShareMenuLabel("zh-TW")).toBe("发送到 EdgeEver");
+ expect(windowsShareMenuLabel("ja-JP")).toBe("EdgeEver に送る");
+ expect(windowsShareMenuLabel("en-US")).toBe("Send to EdgeEver");
+ });
+
+ test("passes one quoted path to the installed executable", () => {
+ expect(windowsShareCommand(exePath)).toBe(`"${exePath}" --share-file "%1"`);
+ expect(shareFilePathsFromCommandLine([
+ exePath,
+ "--share-file",
+ "D:\\Notes\\功能梳理表.xlsx",
+ ])).toEqual(["D:\\Notes\\功能梳理表.xlsx"]);
+ expect(shareFilePathsFromCommandLine(["--share-file"])).toEqual([]);
+ expect(shareFilePathsFromCommandLine(["--share-file", "--flag"])).toEqual([]);
+ });
+
+ test("registers a per-user verb that can open several selected files", async () => {
+ const calls = [];
+ const result = await registerWindowsShareMenu({
+ platform: "win32",
+ packaged: true,
+ exePath,
+ locale: "zh-CN",
+ regPath: "C:\\Windows\\System32\\reg.exe",
+ execFile: (command, args, _options, callback) => {
+ calls.push({ command, args });
+ callback(null);
+ },
+ });
+ expect(result).toEqual({ registered: true });
+ expect(calls.map((call) => call.command)).toEqual(Array(4).fill("C:\\Windows\\System32\\reg.exe"));
+ expect(calls.map((call) => call.args)).toEqual(windowsShareMenuCommands(exePath, "zh-CN"));
+ expect(calls[2].args).toContain("Document");
+ expect(calls[3].args.at(-2)).toBe(`"${exePath}" --share-file "%1"`);
+ });
+
+ test("skips registration away from a packaged Windows app", async () => {
+ const execFile = () => { throw new Error("should not run"); };
+ expect(await registerWindowsShareMenu({
+ platform: "darwin",
+ packaged: true,
+ exePath,
+ locale: "zh-CN",
+ execFile,
+ })).toEqual({ registered: false });
+ expect(await registerWindowsShareMenu({
+ platform: "win32",
+ packaged: false,
+ exePath,
+ locale: "zh-CN",
+ execFile,
+ })).toEqual({ registered: false });
+ });
+
+ test("installer adds the verb and uninstall removes it", () => {
+ const installer = readFileSync(join(dirname(fileURLToPath(import.meta.url)), "..", "..", "nsis", "installer.nsh"), "utf8");
+ expect(installer).toContain("Software\\Classes\\*\\shell\\EdgeEver");
+ expect(installer).toContain("--share-file");
+ expect(installer).toContain("MultiSelectModel");
+ expect(installer).toContain("DeleteRegKey HKCU \"Software\\Classes\\*\\shell\\EdgeEver\"");
+ });
+});
diff --git a/package.json b/package.json
index 6e6dc431..2b2a20b6 100644
--- a/package.json
+++ b/package.json
@@ -63,7 +63,7 @@
"release": "bun scripts/release.mjs",
"publish:stores": "bun scripts/store-delivery.mjs",
"test:desktop:sidecar": "bun scripts/test-desktop-sidecar.mjs",
- "test:desktop": "bun test apps/desktop/src/main/account-scope.test.mjs apps/desktop/src/main/app-protocol.test.mjs apps/desktop/src/main/child-process-start.test.mjs apps/desktop/src/main/clipboard-write.test.mjs apps/desktop/src/main/desktop-diagnostics.test.mjs apps/desktop/src/main/desktop-menu.test.mjs apps/desktop/src/main/desktop-update-flow.test.mjs apps/desktop/src/main/diagnostic-log.test.mjs apps/desktop/src/main/file-association.test.mjs apps/desktop/src/main/wechat-chat-archive.test.mjs apps/desktop/src/main/wechat-share-import.test.mjs apps/desktop/src/main/share-extension-registration.test.mjs apps/desktop/src/main/file-permissions.test.mjs apps/desktop/src/main/installation-location.test.mjs apps/desktop/src/main/local-data-reset.test.mjs apps/desktop/src/main/ai-direct.test.mjs apps/desktop/src/main/plugin-public-network.test.mjs apps/desktop/src/main/renderer-recovery.test.mjs apps/desktop/src/main/renderer-hibernate.test.mjs apps/desktop/src/main/renderer-startup-guard.test.mjs apps/desktop/src/main/renderer-storage-migration.test.mjs apps/desktop/src/main/resource-request.test.mjs apps/desktop/src/main/resource-url.test.mjs apps/desktop/src/main/scheduled-task-scheduler.test.mjs apps/desktop/src/main/screenshot-capture.test.mjs apps/desktop/src/main/staged-resource.test.mjs apps/desktop/src/main/staged-resource-alias.test.mjs apps/desktop/src/main/tray-icon.test.mjs apps/desktop/src/main/user-data-directory.test.mjs apps/desktop/src/main/window-open-policy.test.mjs apps/desktop/src/main/window-visibility.test.mjs apps/desktop/src/main/windows-update-trust.test.mjs apps/web/src/lib/api.test.mjs apps/web/src/lib/app-page-path.test.mjs apps/web/src/lib/clipboard.test.mjs apps/web/src/lib/desktop-renderer-ready.test.mjs apps/web/src/lib/desktop-workspace-restore.test.mjs apps/web/src/lib/desktop-repository.test.mjs apps/web/src/lib/desktop-resources.test.mjs apps/web/src/lib/desktop-sync.test.mjs apps/web/src/lib/local-mirror.test.mjs apps/web/src/lib/repository.test.mjs apps/web/src/lib/runtime.test.mjs apps/web/src/lib/screenshot-import.test.mjs apps/web/src/lib/wechat-chat-import.test.mjs apps/web/src/lib/shared-file-import.test.mjs apps/web/src/lib/sync-queue.test.mjs && bun run test:desktop:sidecar",
+ "test:desktop": "bun test apps/desktop/src/main/account-scope.test.mjs apps/desktop/src/main/app-protocol.test.mjs apps/desktop/src/main/child-process-start.test.mjs apps/desktop/src/main/clipboard-write.test.mjs apps/desktop/src/main/desktop-diagnostics.test.mjs apps/desktop/src/main/desktop-menu.test.mjs apps/desktop/src/main/desktop-update-flow.test.mjs apps/desktop/src/main/diagnostic-log.test.mjs apps/desktop/src/main/file-association.test.mjs apps/desktop/src/main/wechat-chat-archive.test.mjs apps/desktop/src/main/wechat-share-import.test.mjs apps/desktop/src/main/share-extension-registration.test.mjs apps/desktop/src/main/windows-share-menu.test.mjs apps/desktop/src/main/file-permissions.test.mjs apps/desktop/src/main/installation-location.test.mjs apps/desktop/src/main/local-data-reset.test.mjs apps/desktop/src/main/ai-direct.test.mjs apps/desktop/src/main/plugin-public-network.test.mjs apps/desktop/src/main/renderer-recovery.test.mjs apps/desktop/src/main/renderer-hibernate.test.mjs apps/desktop/src/main/renderer-startup-guard.test.mjs apps/desktop/src/main/renderer-storage-migration.test.mjs apps/desktop/src/main/resource-request.test.mjs apps/desktop/src/main/resource-url.test.mjs apps/desktop/src/main/scheduled-task-scheduler.test.mjs apps/desktop/src/main/screenshot-capture.test.mjs apps/desktop/src/main/staged-resource.test.mjs apps/desktop/src/main/staged-resource-alias.test.mjs apps/desktop/src/main/tray-icon.test.mjs apps/desktop/src/main/user-data-directory.test.mjs apps/desktop/src/main/window-open-policy.test.mjs apps/desktop/src/main/window-visibility.test.mjs apps/desktop/src/main/windows-update-trust.test.mjs apps/web/src/lib/api.test.mjs apps/web/src/lib/app-page-path.test.mjs apps/web/src/lib/clipboard.test.mjs apps/web/src/lib/desktop-renderer-ready.test.mjs apps/web/src/lib/desktop-workspace-restore.test.mjs apps/web/src/lib/desktop-repository.test.mjs apps/web/src/lib/desktop-resources.test.mjs apps/web/src/lib/desktop-sync.test.mjs apps/web/src/lib/local-mirror.test.mjs apps/web/src/lib/repository.test.mjs apps/web/src/lib/runtime.test.mjs apps/web/src/lib/screenshot-import.test.mjs apps/web/src/lib/wechat-chat-import.test.mjs apps/web/src/lib/shared-file-import.test.mjs apps/web/src/lib/sync-queue.test.mjs && bun run test:desktop:sidecar",
"verify:desktop-renderer": "bun scripts/verify-desktop-renderer.mjs",
"verify:renderer-origin-migration": "bun run --cwd apps/desktop verify-origin-migration",
"verify:desktop-cross-version-startup": "bun scripts/verify-desktop-cross-version-startup.mjs",