feat(desktop): auto-restart desktop-managed daemon on version mismatch

When the desktop app starts and finds a running daemon with a different
version, it now restarts it automatically. Only applies to daemons the
desktop app itself started, identified by a PASEO_DESKTOP_MANAGED flag
written into the PID lock file.

Also rewrites resolveStatus() to use the CLI daemon status command
instead of manually parsing the PID file, and surfaces daemonVersion
in the CLI status output from the WebSocket hello message.
This commit is contained in:
Mohamed Boudra
2026-04-03 19:43:56 +07:00
parent 23ffec5072
commit 29037abd54
6 changed files with 81 additions and 128 deletions
+2
View File
@@ -9,6 +9,7 @@ export interface PidLockInfo {
hostname: string;
uid: number;
listen: string | null;
desktopManaged?: boolean;
}
export class PidLockError extends Error {
@@ -86,6 +87,7 @@ export async function acquirePidLock(
hostname: hostname(),
uid: process.getuid?.() ?? 0,
listen,
...(process.env.PASEO_DESKTOP_MANAGED === "1" ? { desktopManaged: true } : {}),
};
let fd;