From 869b7df3aa98a319545084281659a4d59cd9d3a3 Mon Sep 17 00:00:00 2001 From: cyrus Date: Mon, 30 Mar 2026 21:10:32 +0530 Subject: [PATCH] refactor: replace `callCoreRpc` with `invoke` for Tauri command handling - Updated all `openhuman` service methods to use `invoke` with `core_rpc_relay`. - Simplified parameter structure and improved consistency in Tauri command invocation. --- app/src/utils/tauriCommands.ts | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/app/src/utils/tauriCommands.ts b/app/src/utils/tauriCommands.ts index 28e8eb530..4bb5f6078 100644 --- a/app/src/utils/tauriCommands.ts +++ b/app/src/utils/tauriCommands.ts @@ -1344,36 +1344,44 @@ export async function openhumanServiceInstall(): Promise>({ method: 'openhuman.service_install' }); + return await invoke>('core_rpc_relay', { + request: { method: 'openhuman.service_install', params: {} }, + }); } export async function openhumanServiceStart(): Promise> { if (!isTauri()) { throw new Error('Not running in Tauri'); } - return await callCoreRpc>({ method: 'openhuman.service_start' }); + return await invoke>('core_rpc_relay', { + request: { method: 'openhuman.service_start', params: {} }, + }); } export async function openhumanServiceStop(): Promise> { if (!isTauri()) { throw new Error('Not running in Tauri'); } - return await callCoreRpc>({ method: 'openhuman.service_stop' }); + return await invoke>('core_rpc_relay', { + request: { method: 'openhuman.service_stop', params: {} }, + }); } export async function openhumanServiceStatus(): Promise> { if (!isTauri()) { throw new Error('Not running in Tauri'); } - return await callCoreRpc>({ method: 'openhuman.service_status' }); + return await invoke>('core_rpc_relay', { + request: { method: 'openhuman.service_status', params: {} }, + }); } export async function openhumanServiceUninstall(): Promise> { if (!isTauri()) { throw new Error('Not running in Tauri'); } - return await callCoreRpc>({ - method: 'openhuman.service_uninstall', + return await invoke>('core_rpc_relay', { + request: { method: 'openhuman.service_uninstall', params: {} }, }); } @@ -1381,8 +1389,8 @@ export async function openhumanAgentServerStatus(): Promise>({ - method: 'openhuman.agent_server_status', + return await invoke>('core_rpc_relay', { + request: { method: 'openhuman.agent_server_status', params: {} }, }); }