raxit-core 0.1.2

Core security scanning engine for AI agent applications
Documentation
//! Framework-specific extractors
//!
//! Extract agent assets from different AI agent frameworks

pub mod autogen;
pub mod crewai;
pub mod langgraph;
pub mod pydantic_ai;
pub mod swarm;
// Future framework extractors will be added here:
// etc.

use crate::error::Result;
use crate::schema::{Agent, Memory, Model, Tool};
use std::path::Path;

/// Extracted assets from a single file
#[derive(Debug, Default)]
pub struct ExtractedAssets {
    pub agents: Vec<Agent>,
    pub tools: Vec<Tool>,
    pub models: Vec<Model>,
    pub memory: Vec<Memory>,
}

/// Extract assets from a Python file based on detected framework
pub fn extract_from_file(path: &Path, framework: &str) -> Result<ExtractedAssets> {
    match framework {
        "pydantic-ai" => pydantic_ai::extract(path),
        "langgraph" => langgraph::extract(path),
        "crewai" => crewai::extract(path),
        "autogen" => autogen::extract(path),
        "swarm" => swarm::extract(path),
        _ => {
            // Unknown framework, return empty results
            Ok(ExtractedAssets::default())
        }
    }
}

#[cfg(test)]
mod tests {
    #[test]
    fn test_extractor_module() {
        // Placeholder test - module compiles successfully
    }
}