#![forbid(unsafe_code)]
#![warn(missing_docs)]
pub use agent_bridle_core::*;
#[cfg(feature = "shell")]
pub use agent_bridle_tool_shell::ShellTool;
#[cfg(feature = "host-shell")]
pub use agent_bridle_tool_shell::HostShellTool;
#[cfg(feature = "brush")]
pub use agent_bridle_tool_shell::BrushShellTool;
#[cfg(feature = "web")]
pub use agent_bridle_tool_web::WebFetchTool;
#[must_use]
pub fn registry() -> Registry {
#[allow(unused_mut)]
let mut builder = Registry::builder();
#[cfg(feature = "shell")]
{
builder = builder.tool(std::sync::Arc::new(ShellTool::new()));
}
#[cfg(feature = "web")]
{
builder = builder.tool(std::sync::Arc::new(WebFetchTool::new()));
}
builder.build()
}
#[cfg(test)]
mod tests {
use super::*;
#[cfg(feature = "shell")]
#[test]
fn shell_tool_is_present_with_feature() {
let reg = registry();
assert!(
reg.contains("shell"),
"expected `shell` tool to be registered"
);
let names = reg.tool_names();
assert!(
names.contains(&"shell"),
"tool_names missing shell: {names:?}"
);
}
#[cfg(not(feature = "shell"))]
#[test]
fn shell_tool_absent_without_feature() {
let reg = registry();
assert!(!reg.contains("shell"));
}
#[cfg(feature = "web")]
#[test]
fn web_fetch_tool_is_present_with_feature() {
let reg = registry();
assert!(
reg.contains("web_fetch"),
"expected `web_fetch` tool to be registered"
);
assert!(
reg.tool_names().contains(&"web_fetch"),
"tool_names missing web_fetch: {:?}",
reg.tool_names()
);
}
#[cfg(not(feature = "web"))]
#[test]
fn web_fetch_tool_absent_without_feature() {
let reg = registry();
assert!(!reg.contains("web_fetch"));
}
#[cfg(all(not(feature = "shell"), not(feature = "web")))]
#[test]
fn registry_is_empty_with_no_tool_features() {
let reg = registry();
assert!(reg.tool_names().is_empty());
}
#[test]
fn leash_types_are_reexported() {
let _c = Caveats::top();
let _s: Scope<String> = Scope::top();
let _b = CountBound::Unlimited;
let _k = SandboxKind::None;
}
}