use crate::ast::polyglot::utils::PolyglotPathValidator;
use crate::ast::polyglot::{
CrossLanguageDependencies, Language, LanguageMapperFactory, UnifiedNode,
};
use crate::mcp_integration::{McpError, McpTool, ToolMetadata};
use anyhow::Result;
use async_trait::async_trait;
use serde_json::{json, Value};
use std::collections::{HashMap, HashSet};
use std::path::{Path, PathBuf};
use std::sync::Arc;
pub struct PolyglotAnalysisTool {
#[allow(dead_code)]
agent_registry: Arc<crate::agents::registry::AgentRegistry>,
}
impl PolyglotAnalysisTool {
pub fn new(agent_registry: Arc<crate::agents::registry::AgentRegistry>) -> Self {
Self { agent_registry }
}
}
pub struct LanguageBoundaryTool {
#[allow(dead_code)]
agent_registry: Arc<crate::agents::registry::AgentRegistry>,
}
impl LanguageBoundaryTool {
pub fn new(agent_registry: Arc<crate::agents::registry::AgentRegistry>) -> Self {
Self { agent_registry }
}
}
fn get_node_type_counts(nodes: &[UnifiedNode]) -> HashMap<String, HashMap<String, usize>> {
let mut counts = HashMap::new();
for node in nodes {
let lang_name = node.language.name().to_string();
let kind_name = node.kind.as_str().to_string();
counts
.entry(lang_name)
.or_insert_with(HashMap::new)
.entry(kind_name)
.and_modify(|c| *c += 1)
.or_insert(1);
}
counts
}
include!("polyglot_tools_analysis.rs");
include!("polyglot_tools_boundary.rs");
#[cfg(all(test, feature = "broken-tests"))]
#[path = "tests.rs"]
mod tests;