add extended

This commit is contained in:
2025-07-29 04:08:29 +09:00
parent 93b523b1ba
commit 4620d0862a
16 changed files with 1189 additions and 21 deletions

2
src/lib.rs Normal file
View File

@@ -0,0 +1,2 @@
pub mod memory;
pub mod mcp;

View File

@@ -2,8 +2,8 @@ use anyhow::Result;
use clap::{Parser, Subcommand};
use std::path::PathBuf;
mod memory;
mod mcp;
pub mod memory;
pub mod mcp;
use memory::MemoryManager;
use mcp::MCPServer;

41
src/mcp_server.rs Normal file
View File

@@ -0,0 +1,41 @@
use anyhow::Result;
use std::env;
mod memory;
mod mcp;
use mcp::MCPServer;
#[tokio::main]
async fn main() -> Result<()> {
// 環境変数から自動実行設定を読み込み
let auto_execute = env::var("MEMORY_AUTO_EXECUTE")
.unwrap_or_else(|_| "false".to_string())
.parse::<bool>()
.unwrap_or(false);
let auto_save = env::var("MEMORY_AUTO_SAVE")
.unwrap_or_else(|_| "false".to_string())
.parse::<bool>()
.unwrap_or(false);
let auto_search = env::var("MEMORY_AUTO_SEARCH")
.unwrap_or_else(|_| "false".to_string())
.parse::<bool>()
.unwrap_or(false);
let trigger_sensitivity = env::var("TRIGGER_SENSITIVITY")
.unwrap_or_else(|_| "medium".to_string());
// 設定をログ出力(デバッグ用)
eprintln!("Memory MCP Server starting with config:");
eprintln!(" AUTO_EXECUTE: {}", auto_execute);
eprintln!(" AUTO_SAVE: {}", auto_save);
eprintln!(" AUTO_SEARCH: {}", auto_search);
eprintln!(" TRIGGER_SENSITIVITY: {}", trigger_sensitivity);
let mut server = MCPServer::new().await?;
server.run().await?;
Ok(())
}

View File

@@ -148,6 +148,7 @@ impl MemoryManager {
conversations
}
#[allow(dead_code)]
pub async fn import_chatgpt_conversations(&mut self, file_path: &PathBuf) -> Result<()> {
let content = std::fs::read_to_string(file_path)
.context("Failed to read conversations file")?;