fix mcp
This commit is contained in:
36
src/main.rs
36
src/main.rs
@ -3,7 +3,7 @@ mod cli;
|
||||
mod config;
|
||||
mod mcp;
|
||||
|
||||
use cli::{Args, Commands, ServerCommands};
|
||||
use cli::{Args, Commands, ServerCommands, MemoryCommands};
|
||||
use clap::Parser;
|
||||
|
||||
#[tokio::main]
|
||||
@ -21,8 +21,38 @@ async fn main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
Commands::Chat { message } => {
|
||||
mcp::server::chat(&message).await;
|
||||
Commands::Chat { message, with_memory } => {
|
||||
if with_memory {
|
||||
if let Err(e) = mcp::memory::handle_chat_with_memory(&message).await {
|
||||
eprintln!("❌ 記憶チャットエラー: {}", e);
|
||||
}
|
||||
} else {
|
||||
mcp::server::chat(&message).await;
|
||||
}
|
||||
}
|
||||
Commands::Memory { command } => {
|
||||
match command {
|
||||
MemoryCommands::Import { file } => {
|
||||
if let Err(e) = mcp::memory::handle_import(&file).await {
|
||||
eprintln!("❌ インポートエラー: {}", e);
|
||||
}
|
||||
}
|
||||
MemoryCommands::Search { query, limit } => {
|
||||
if let Err(e) = mcp::memory::handle_search(&query, limit).await {
|
||||
eprintln!("❌ 検索エラー: {}", e);
|
||||
}
|
||||
}
|
||||
MemoryCommands::List => {
|
||||
if let Err(e) = mcp::memory::handle_list().await {
|
||||
eprintln!("❌ 一覧取得エラー: {}", e);
|
||||
}
|
||||
}
|
||||
MemoryCommands::Detail { filepath } => {
|
||||
if let Err(e) = mcp::memory::handle_detail(&filepath).await {
|
||||
eprintln!("❌ 詳細取得エラー: {}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user