import { invoke } from "@tauri-apps/api/core"; import type { HermesModelConfig, HermesHealthWarning } from "@/types"; /** * Hermes Agent configuration API (CC Switch side). * * CC Switch intentionally keeps its Hermes surface minimal — deep configuration * (model, agent behavior, env vars, skills, cron, logs, analytics) lives in * the Hermes Web UI at http://127.0.0.1:9119. CC Switch only reads the `model` * section to highlight the active provider, scans config health, and launches * the Hermes Web UI for everything else. Writes to `model` happen implicitly * via `apply_switch_defaults` when the user switches providers. */ export const hermesApi = { async getModelConfig(): Promise { return await invoke("get_hermes_model_config"); }, async scanHealth(): Promise { return await invoke("scan_hermes_config_health"); }, /** * Probe the local Hermes Web UI and open it in the system browser. * Optional `path` lets callers deep-link to specific pages like `/config`. */ async openWebUI(path?: string): Promise { await invoke("open_hermes_web_ui", { path: path ?? null }); }, };