Skip to main content

ares_tools/
lib.rs

1//! Built-in agent tools for A.R.E.S.
2
3pub mod config;
4pub use config::ToolConfig;
5
6pub mod calculator;
7pub mod fence;
8pub mod http_tool;
9pub mod plugins;
10pub(crate) mod registry;
11#[cfg(feature = "script-tools")]
12pub mod rhai_tool;
13#[cfg(feature = "script-tools")]
14pub mod script_tool;
15pub mod tool_service;
16pub mod tools;
17
18#[cfg(any(feature = "postgres", test))]
19pub(crate) mod runtime_registry;
20
21#[cfg(any(feature = "postgres", test))]
22pub(crate) use runtime_registry::RuntimeToolRegistry;
23
24#[cfg(any(feature = "postgres", test))]
25pub mod sql_tool;
26
27#[cfg(any(feature = "search-tools", test))]
28pub mod search;
29
30#[cfg(any(feature = "search-tools", test))]
31pub mod web_scrape;
32
33#[cfg(any(feature = "mcp", test))]
34pub mod mcp_bridge;
35
36#[cfg(any(feature = "postgres", test))]
37pub mod connectors;
38
39pub use calculator::{Calculator, CalculatorConfig, CalculatorService};
40pub use plugins::register_plugins;
41pub use registry::Tool;
42#[cfg(feature = "script-tools")]
43pub use rhai_tool::{RhaiTool, RhaiToolConfig};
44pub use tool_service::Tools;
45
46#[cfg(test)]
47mod tests {
48    use super::{calculator::Calculator, Tool, Tools};
49    use std::sync::Arc;
50
51    #[test]
52    fn calculator_and_tools_are_wired() {
53        let tools = Tools::from_static([Arc::new(Calculator) as Arc<dyn Tool>]);
54        let ctx = cordis::Context::new_root();
55        assert!(tools.resolve(&ctx, "calculator").is_some());
56        assert!(tools
57            .list(&ctx)
58            .iter()
59            .any(|definition| definition.name == "calculator"));
60    }
61
62    #[test]
63    fn search_and_scrape_modules_compile_under_test_cfg() {
64        let _ = std::any::type_name::<crate::search::WebSearch>();
65        let _ = std::any::type_name::<crate::web_scrape::WebScrape>();
66    }
67}