mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-02 18:41:35 +08:00
feat: add Hermes frontend types, API layer, and hooks (Phase 7)
- Add "hermes" to AppId union type and all exhaustive Record<AppId> - Add HermesModelConfig, HermesAgentConfig, HermesEnvConfig types - Add hermes field to VisibleApps, McpApps, ProxyTakeoverStatus - Create src/lib/api/hermes.ts with Tauri invoke wrappers - Create src/hooks/useHermes.ts with 5 query + 3 mutation hooks - Register hermes in APP_IDS, APP_ICON_MAP (violet color scheme) - Split MCP_SKILLS_APP_IDS into MCP_APP_IDS (includes hermes) and SKILLS_APP_IDS (excludes hermes, since Hermes has no Skills support) - Wire hermes additive-mode into App.tsx (remove/duplicate handlers), ProviderList.tsx (live provider ID query + In Config badge), mutations.ts (cache invalidation on switch/add/delete) - Add Hermes checkbox to McpFormModal - Add basic hermes i18n keys (en/zh/ja)
This commit is contained in:
@@ -136,6 +136,14 @@ export const providersApi = {
|
||||
return await invoke("get_openclaw_live_provider_ids");
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取 Hermes live 配置中的供应商 ID 列表
|
||||
* 用于前端判断供应商是否已添加到 Hermes 配置
|
||||
*/
|
||||
async getHermesLiveProviderIds(): Promise<string[]> {
|
||||
return await invoke("get_hermes_live_provider_ids");
|
||||
},
|
||||
|
||||
/**
|
||||
* 从 OpenClaw live 配置导入供应商到数据库
|
||||
* OpenClaw 特有功能:由于累加模式,用户可能已在 openclaw.json 中配置供应商
|
||||
@@ -143,6 +151,14 @@ export const providersApi = {
|
||||
async importOpenClawFromLive(): Promise<number> {
|
||||
return await invoke("import_openclaw_providers_from_live");
|
||||
},
|
||||
|
||||
/**
|
||||
* 从 Hermes live 配置导入供应商到数据库
|
||||
* Hermes 特有功能:由于累加模式,用户可能已在 Hermes 配置中配置供应商
|
||||
*/
|
||||
async importHermesFromLive(): Promise<number> {
|
||||
return await invoke("import_hermes_providers_from_live");
|
||||
},
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user