pmat 3.11.0

PMAT - Zero-config AI context generation and code quality toolkit (CLI, MCP, HTTP)
/// Example: `RefactorService` adapter
pub mod refactor_adapter {
    use super::{Deserialize, Result, Serialize, Service, ServiceAdapter, ServiceMetrics};
    use std::path::PathBuf;

    #[derive(Debug, Clone, Serialize, Deserialize)]
    pub struct RefactorInput {
        pub file_path: PathBuf,
        pub refactor_type: RefactorType,
    }

    #[derive(Debug, Clone, Serialize, Deserialize)]
    pub enum RefactorType {
        ExtractFunction,
        SimplifyCondition,
        RemoveDeadCode,
        Auto,
    }

    #[derive(Debug, Clone, Serialize, Deserialize)]
    pub struct RefactorOutput {
        pub success: bool,
        pub changes: Vec<Change>,
        pub message: String,
    }

    #[derive(Debug, Clone, Serialize, Deserialize)]
    pub struct Change {
        pub file: String,
        pub line: usize,
        pub before: String,
        pub after: String,
    }

    pub type RefactorServiceAdapter = ServiceAdapter<(), RefactorInput, RefactorOutput>;

    impl RefactorServiceAdapter {
        #[must_use]
        pub fn new_refactor_service() -> Self {
            ServiceAdapter::new(())
        }
    }

    async fn process_refactor(_inner: &(), _input: RefactorInput) -> Result<RefactorOutput> {
        // Would call actual refactor engine here
        Ok(RefactorOutput {
            success: true,
            changes: vec![],
            message: "Refactoring completed".to_string(),
        })
    }

    impl_service_adapter!(
        RefactorServiceAdapter,
        RefactorInput,
        RefactorOutput,
        process_refactor
    );
}