use crate::mcp_server::state_manager::StateManager;
use crate::models::refactor::RefactorConfig;
use async_trait::async_trait;
use pmcp::{Error as PmcpError, RequestHandlerExtra, Result as PmcpResult, ToolHandler};
use serde::{Deserialize, Serialize};
use serde_json::{json, Value};
use std::path::PathBuf;
use std::sync::Arc;
use tokio::sync::Mutex;
use tracing::debug;
#[derive(Debug, Deserialize)]
struct RefactorStartArgs {
targets: Vec<String>,
config: Option<RefactorConfig>,
}
#[derive(Debug, Serialize)]
struct RefactorStartResult {
session_id: String,
state: Value,
}
pub struct RefactorStartTool {
state_manager: Arc<Mutex<StateManager>>,
}
impl RefactorStartTool {
pub fn new(state_manager: Arc<Mutex<StateManager>>) -> Self {
Self { state_manager }
}
}
pub struct RefactorNextIterationTool {
state_manager: Arc<Mutex<StateManager>>,
}
impl RefactorNextIterationTool {
pub fn new(state_manager: Arc<Mutex<StateManager>>) -> Self {
Self { state_manager }
}
}
pub struct RefactorGetStateTool {
state_manager: Arc<Mutex<StateManager>>,
}
impl RefactorGetStateTool {
pub fn new(state_manager: Arc<Mutex<StateManager>>) -> Self {
Self { state_manager }
}
}
pub struct RefactorStopTool {
state_manager: Arc<Mutex<StateManager>>,
}
impl RefactorStopTool {
pub fn new(state_manager: Arc<Mutex<StateManager>>) -> Self {
Self { state_manager }
}
}
include!("handlers_tool_impls.rs");
include!("handlers_serialize.rs");
include!("handlers_tests.rs");