feat(app): daemon status with Stop/Restart in settings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 18:57:53 +07:00
parent a2087a0de5
commit 9ca1ff3bc5
4 changed files with 59 additions and 4 deletions
+12
View File
@@ -211,3 +211,15 @@ export async function setConfig(patch: Partial<Pick<ConfigView, "default_shell"
accent: patch.accent ?? null,
});
}
export async function shutdownDaemon(): Promise<void> {
try { await invoke("shutdown_daemon"); } catch { /* connection drops as the daemon exits — expected */ }
}
export async function restartDaemon(): Promise<void> {
await shutdownDaemon();
// Let the old process exit; the next request triggers the bridge's
// ensure_daemon respawn (or launchd KeepAlive) and reconnects.
await new Promise((r) => setTimeout(r, 600));
try { await getHealth(); } catch { /* reconnect loop will retry */ }
}