1- use crate :: app :: AppConfig ;
1+ use crate :: client :: ClientConfig ;
22use crate :: json_manager:: JsonManager ;
33use serde_json:: Value ;
44
55#[ tauri:: command]
6- pub async fn read_json_file ( app_name : String , path : Option < String > ) -> Result < Value , String > {
7- let app_config = AppConfig :: new ( & app_name , path. as_deref ( ) ) ;
6+ pub async fn read_json_file ( client_name : String , path : Option < String > ) -> Result < Value , String > {
7+ let app_config = ClientConfig :: new ( & client_name , path. as_deref ( ) ) ;
88 let file_path = app_config. get_path ( ) ;
99
10- if !file_path. exists ( ) && app_name != "claude" {
10+ if !file_path. exists ( ) && client_name != "claude" {
1111 return Err ( format ! ( "File not found: {}" , file_path. display( ) ) ) ;
1212 }
1313
@@ -16,57 +16,57 @@ pub async fn read_json_file(app_name: String, path: Option<String>) -> Result<Va
1616
1717#[ tauri:: command]
1818pub async fn write_json_file (
19- app_name : String ,
19+ client_name : String ,
2020 path : Option < String > ,
2121 content : Value ,
2222) -> Result < ( ) , String > {
23- let app_config = AppConfig :: new ( & app_name , path. as_deref ( ) ) ;
23+ let app_config = ClientConfig :: new ( & client_name , path. as_deref ( ) ) ;
2424 let file_path = app_config. get_path ( ) ;
2525
2626 JsonManager :: write_json_file ( file_path, & content)
2727}
2828
2929#[ tauri:: command]
30- pub async fn get_app_path ( app_name : String , path : Option < String > ) -> Result < String , String > {
31- let app_config = AppConfig :: new ( & app_name , path. as_deref ( ) ) ;
30+ pub async fn get_app_path ( client_name : String , path : Option < String > ) -> Result < String , String > {
31+ let app_config = ClientConfig :: new ( & client_name , path. as_deref ( ) ) ;
3232 let file_path = app_config. get_path ( ) ;
3333
3434 Ok ( file_path. to_string_lossy ( ) . to_string ( ) )
3535}
3636
3737#[ tauri:: command]
3838pub async fn add_mcp_server (
39- app_name : String ,
39+ client_name : String ,
4040 path : Option < String > ,
4141 server_name : String ,
4242 server_config : Value ,
4343) -> Result < Value , String > {
44- let app_config = AppConfig :: new ( & app_name , path. as_deref ( ) ) ;
44+ let app_config = ClientConfig :: new ( & client_name , path. as_deref ( ) ) ;
4545 let file_path = app_config. get_path ( ) ;
4646
4747 JsonManager :: add_mcp_server ( file_path, & server_name, server_config)
4848}
4949
5050#[ tauri:: command]
5151pub async fn remove_mcp_server (
52- app_name : String ,
52+ client_name : String ,
5353 path : Option < String > ,
5454 server_name : String ,
5555) -> Result < Value , String > {
56- let app_config = AppConfig :: new ( & app_name , path. as_deref ( ) ) ;
56+ let app_config = ClientConfig :: new ( & client_name , path. as_deref ( ) ) ;
5757 let file_path = app_config. get_path ( ) ;
5858
5959 JsonManager :: remove_mcp_server ( file_path, & server_name)
6060}
6161
6262#[ tauri:: command]
6363pub async fn update_mcp_server (
64- app_name : String ,
64+ client_name : String ,
6565 path : Option < String > ,
6666 server_name : String ,
6767 server_config : Value ,
6868) -> Result < Value , String > {
69- let app_config = AppConfig :: new ( & app_name , path. as_deref ( ) ) ;
69+ let app_config = ClientConfig :: new ( & client_name , path. as_deref ( ) ) ;
7070 let file_path = app_config. get_path ( ) ;
7171
7272 JsonManager :: update_mcp_server ( file_path, & server_name, server_config)
0 commit comments