diff --git a/fix_warnings.py b/fix_warnings.py new file mode 100644 index 0000000..218b70c --- /dev/null +++ b/fix_warnings.py @@ -0,0 +1,40 @@ +import re + +# 1. Fix stub/src/main.rs +stub_path = r'C:\Users\reazul.ashraf\workspace\rust\mcp-memory\stub\src\main.rs' +with open(stub_path, 'r', encoding='utf-8') as f: + content = f.read() +content = content.replace('use tokio::io::AsyncBufReadExt;\n', '') +with open(stub_path, 'w', encoding='utf-8') as f: + f.write(content) + +# 2. Fix nvim-core/src/lib.rs +nvim_path = r'C:\Users\reazul.ashraf\workspace\rust\mcp-memory\nvim-core\src\lib.rs' +with open(nvim_path, 'r', encoding='utf-8') as f: + content = f.read() +content = content.replace( + 'use tokio::io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader};', + 'use tokio::io::{AsyncReadExt, AsyncWriteExt};' +) +with open(nvim_path, 'w', encoding='utf-8') as f: + f.write(content) + +# 3. Fix server/src/store.rs +store_path = r'C:\Users\reazul.ashraf\workspace\rust\mcp-memory\server\src\store.rs' +with open(store_path, 'r', encoding='utf-8') as f: + content = f.read() + +inspect_method = """ pub fn inspect(&self, f: F) -> R + where + F: FnOnce(&T) -> R, + { + let lock = self.cache.read().unwrap(); + f(&lock) + } + +""" +content = content.replace(inspect_method, "") +with open(store_path, 'w', encoding='utf-8') as f: + f.write(content) + +print("Warnings fixed!") diff --git a/nvim-core/src/lib.rs b/nvim-core/src/lib.rs index d1d0054..836c62d 100644 --- a/nvim-core/src/lib.rs +++ b/nvim-core/src/lib.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; use serde_json::{json, Value}; -use tokio::io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader}; +use tokio::io::{AsyncReadExt, AsyncWriteExt}; #[derive(Serialize, Deserialize, Debug, Clone)] pub struct JsonRpcRequest { diff --git a/server/fix_descriptions.py b/server/fix_descriptions.py new file mode 100644 index 0000000..7d2e1a1 --- /dev/null +++ b/server/fix_descriptions.py @@ -0,0 +1,24 @@ +import re + +with open(r'C:\Users\reazul.ashraf\workspace\rust\mcp-memory\server\src\handlers.rs', 'r', encoding='utf-8') as f: + content = f.read() + +content = content.replace( + 'crate::mcp::tool_def::(\n "generate_standup_report",\n "",\n )', + 'crate::mcp::tool_def::(\n "generate_standup_report",\n "Generate a standup report summarizing recent work, blockers, and next steps.",\n )' +) + +content = content.replace( + 'crate::mcp::tool_def::(\n "get_environment_details",\n "",\n )', + 'crate::mcp::tool_def::(\n "get_environment_details",\n "Get detailed information about a specific deployment environment.",\n )' +) + +content = content.replace( + 'crate::mcp::tool_def::(\n "list_context_workspaces",\n "",\n )', + 'crate::mcp::tool_def::(\n "list_context_workspaces",\n "List all saved context workspaces.",\n )' +) + +with open(r'C:\Users\reazul.ashraf\workspace\rust\mcp-memory\server\src\handlers.rs', 'w', encoding='utf-8') as f: + f.write(content) + +print("Descriptions fixed.") diff --git a/server/src/store.rs b/server/src/store.rs index 7ac0cb1..a44ff3b 100644 --- a/server/src/store.rs +++ b/server/src/store.rs @@ -45,14 +45,6 @@ impl Store(&self, f: F) -> R - where - F: FnOnce(&T) -> R, - { - let lock = self.cache.read().unwrap(); - f(&lock) - } - pub fn modify(&self, f: F) { let mut lock = self.cache.write().unwrap(); f(&mut lock); diff --git a/server/update_win_config.py b/server/update_win_config.py new file mode 100644 index 0000000..09522fd --- /dev/null +++ b/server/update_win_config.py @@ -0,0 +1,37 @@ +import json +import os + +eager_tools = [ + "log_code_change", + "log_error_fix", + "log_tech_debt", + "omni_search", + "create_entities", + "learn_preference", + "list_active_tasks", + "add_task", + "set_acceptance_criteria", + "verify_acceptance_criteria", + "update_task_status", + "list_pinned_files", + "pin_file", + "unpin_file", + "get_project_health", + "list_tech_debt", + "resolve_tech_debt" +] + +# Update Windows config +win_config_path = r'C:\Users\reazul.ashraf\.gemini\config\mcp_config.json' +with open(win_config_path, 'r', encoding='utf-8') as f: + win_data = json.load(f) + +win_data['mcpServers']['mcp-memory']['eagerTools'] = eager_tools +if 'args' in win_data['mcpServers']['mcp-memory']: + # Ensure args are empty as we removed --target earlier + win_data['mcpServers']['mcp-memory']['args'] = [] + +with open(win_config_path, 'w', encoding='utf-8') as f: + json.dump(win_data, f, indent=2) + +print("Updated Windows config") diff --git a/stub/src/main.rs b/stub/src/main.rs index eba20f3..86e387b 100644 --- a/stub/src/main.rs +++ b/stub/src/main.rs @@ -1,7 +1,6 @@ use clap::Parser; use futures_util::{SinkExt, StreamExt}; use std::sync::Arc; -use tokio::io::AsyncBufReadExt; use tokio::sync::mpsc; #[derive(Parser)]