import { getDesktopHost } from "@/desktop/host"; export async function invokeDesktopCommand( command: string, args?: Record, ): Promise { const invoke = getDesktopHost()?.invoke; if (typeof invoke !== "function") { throw new Error("Desktop invoke() is unavailable in this environment."); } return (await invoke(command, args)) as T; }