mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-25 13:45:03 +08:00
feat(opencode): Phase 6 - Tauri command extensions for OpenCode
- Add import_opencode_providers_from_live command to provider.rs - Register new command in lib.rs invoke_handler - Update commands/mcp.rs: include OpenCode in sync_other_side logic - Add McpService::import_from_opencode to import_mcp_from_apps - Implement MCP sync/remove for OpenCode in services/mcp.rs - sync_server_to_app_no_config now calls sync_single_server_to_opencode - remove_server_from_app now calls remove_server_from_opencode
This commit is contained in:
@@ -325,3 +325,17 @@ pub fn sync_universal_provider(
|
||||
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// OpenCode 专属命令
|
||||
// ============================================================================
|
||||
|
||||
/// 从 OpenCode live 配置导入供应商到数据库
|
||||
///
|
||||
/// 这是 OpenCode 特有的功能,因为 OpenCode 使用累加模式,
|
||||
/// 用户可能已经在 opencode.json 中配置了供应商。
|
||||
#[tauri::command]
|
||||
pub fn import_opencode_providers_from_live(state: State<'_, AppState>) -> Result<usize, String> {
|
||||
crate::services::provider::import_opencode_providers_from_live(state.inner())
|
||||
.map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user