Sync Stats & History window, headless --sync-cli, and Windows remote support (#160)

This commit is contained in:
sudacode authored and GitHub committed 2026-07-13 18:56:51 -07:00
1 parent 66f8ca4f80
commit 49b926e08c
111 files changed
+6983 -1130

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
import net from 'node:net';
/**
* True when something is accepting connections on the unix socket / Windows
* named pipe (400 ms probe). Electron-free; shared by the sync CLI's
* running-app guard and the Windows mpv launch attach wait.
*/
export async function canConnectSocket(socketPath: string): Promise<boolean> {
return await new Promise<boolean>((resolve) => {
const socket = net.createConnection(socketPath);
let settled = false;
const finish = (value: boolean): void => {
if (settled) return;
settled = true;
try {
socket.destroy();
} catch {
// ignore
}
resolve(value);
};
socket.once('connect', () => finish(true));
socket.once('error', () => finish(false));
socket.setTimeout(400, () => finish(false));
});
}