use super::{WarpDriveItem, WarpDriveItemId}; use crate::{ ai::mcp::CloudMCPServer, appearance::Appearance, cloud_object::CloudObjectMetadata, drive::{index::DriveIndexAction, CloudObjectTypeAndId, DriveObjectType}, themes::theme::Fill, }; use warpui::{elements::MouseStateHandle, AppContext, Element}; #[derive(Clone)] pub struct WarpDriveMCPServer { id: CloudObjectTypeAndId, mcp_server: CloudMCPServer, } impl WarpDriveMCPServer { pub fn new(id: CloudObjectTypeAndId, mcp_server: CloudMCPServer) -> Self { Self { id, mcp_server } } } impl WarpDriveItem for WarpDriveMCPServer { fn display_name(&self) -> Option { Some(self.mcp_server.model().string_model.name.clone()) } fn metadata(&self) -> Option<&CloudObjectMetadata> { Some(&self.mcp_server.metadata) } fn object_type(&self) -> Option { Some(DriveObjectType::MCPServer) } fn secondary_icon(&self, _color: Option) -> Option> { None } fn click_action(&self) -> Option { Some(DriveIndexAction::OpenMCPServerCollection) } fn preview(&self, _appearance: &Appearance) -> Option> { // TODO None } fn warp_drive_id(&self) -> WarpDriveItemId { WarpDriveItemId::Object(self.id) } fn sync_status_icon( &self, sync_queue_is_dequeueing: bool, hover_state: MouseStateHandle, appearance: &Appearance, ) -> Option> { self.mcp_server .metadata .pending_changes_statuses .render_icon(sync_queue_is_dequeueing, hover_state, appearance) } fn action_summary(&self, _app: &AppContext) -> Option { None } fn clone_box(&self) -> Box { Box::new(self.clone()) } }