@@ -40,6 +40,7 @@ pub mod icons;
4040pub mod licensing;
4141#[ cfg( target_os = "macos" ) ]
4242mod macos_icons;
43+ mod mcp;
4344mod menu;
4445#[ cfg( target_os = "macos" ) ]
4546mod network;
@@ -51,7 +52,8 @@ mod volumes;
5152
5253use menu:: {
5354 ABOUT_ID , COMMAND_PALETTE_ID , GO_BACK_ID , GO_FORWARD_ID , GO_PARENT_ID , MenuState , SHOW_HIDDEN_FILES_ID ,
54- SWITCH_PANE_ID , VIEW_MODE_BRIEF_ID , VIEW_MODE_FULL_ID , ViewMode ,
55+ SORT_ASCENDING_ID , SORT_BY_CREATED_ID , SORT_BY_EXTENSION_ID , SORT_BY_MODIFIED_ID , SORT_BY_NAME_ID , SORT_BY_SIZE_ID ,
56+ SORT_DESCENDING_ID , SWITCH_PANE_ID , VIEW_MODE_BRIEF_ID , VIEW_MODE_FULL_ID , ViewMode ,
5557} ;
5658use tauri:: { Emitter , Manager } ;
5759
@@ -136,6 +138,13 @@ pub fn run() {
136138 let _ = window. set_title ( & title) ;
137139 }
138140
141+ // Initialize pane state store for MCP context tools
142+ app. manage ( mcp:: PaneStateStore :: new ( ) ) ;
143+
144+ // Start MCP server for AI agent integration
145+ let mcp_config = mcp:: McpConfig :: from_env ( ) ;
146+ mcp:: start_mcp_server ( app. handle ( ) . clone ( ) , mcp_config) ;
147+
139148 Ok ( ( ) )
140149 } )
141150 . on_menu_event ( |app, event| {
@@ -191,6 +200,29 @@ pub fn run() {
191200 } else if id == SWITCH_PANE_ID {
192201 // Emit event to switch pane
193202 let _ = app. emit ( "switch-pane" , ( ) ) ;
203+ } else if id == SORT_BY_NAME_ID
204+ || id == SORT_BY_EXTENSION_ID
205+ || id == SORT_BY_SIZE_ID
206+ || id == SORT_BY_MODIFIED_ID
207+ || id == SORT_BY_CREATED_ID
208+ {
209+ // Handle sort by column
210+ let column = match id {
211+ SORT_BY_NAME_ID => "name" ,
212+ SORT_BY_EXTENSION_ID => "extension" ,
213+ SORT_BY_SIZE_ID => "size" ,
214+ SORT_BY_MODIFIED_ID => "modified" ,
215+ SORT_BY_CREATED_ID => "created" ,
216+ _ => return ,
217+ } ;
218+ let _ = app. emit ( "menu-sort" , serde_json:: json!( { "action" : "sortBy" , "value" : column } ) ) ;
219+ } else if id == SORT_ASCENDING_ID || id == SORT_DESCENDING_ID {
220+ // Handle sort order
221+ let order = if id == SORT_ASCENDING_ID { "asc" } else { "desc" } ;
222+ let _ = app. emit (
223+ "menu-sort" ,
224+ serde_json:: json!( { "action" : "sortOrder" , "value" : order } ) ,
225+ ) ;
194226 } else {
195227 // Handle file actions
196228 commands:: ui:: execute_menu_action ( app, id) ;
@@ -221,6 +253,9 @@ pub fn run() {
221253 commands:: ui:: copy_to_clipboard,
222254 commands:: ui:: quick_look,
223255 commands:: ui:: get_info,
256+ mcp:: pane_state:: update_left_pane_state,
257+ mcp:: pane_state:: update_right_pane_state,
258+ mcp:: pane_state:: update_focused_pane,
224259 #[ cfg( target_os = "macos" ) ]
225260 commands:: sync_status:: get_sync_status,
226261 #[ cfg( target_os = "macos" ) ]
0 commit comments