// file: crates/ksp-app-backfill-desk/frontend/ts/invoke.ts // version: 1 import { invoke } from "@tauri-apps/api/core"; import { frontendDebug, frontendError, frontendTrace, type FrontendLogTargetId } from "./frontend_log"; export async function invokeKsp(targetId: FrontendLogTargetId, command: string, args?: Record): Promise { frontendDebug(targetId, "Frontend IPC command requested", { command }); try { const result = await invoke(command, args); frontendTrace(targetId, "Frontend IPC command completed", { command }); return result; } catch (caughtError) { frontendError(targetId, "Frontend IPC command failed", { command }); throw caughtError; } }