codive-tools 0.1.0

Tool implementations for Codive
Documentation
//! Agent Tools - Tool implementations for the AI Coding Agent
//!
//! This crate provides implementations of the [`Tool`] trait from `codive_core`
//! for common operations like file I/O, command execution, and text searching.
//!
//! # Available Tools
//!
//! - [`bash::BashTool`] - Execute shell commands
//! - [`read_file::ReadFileTool`] - Read file contents
//! - [`write_file::WriteFileTool`] - Write content to files
//! - [`edit_file::EditFileTool`] - Make targeted edits to files
//! - [`glob::GlobTool`] - Find files matching patterns
//! - [`grep::GrepTool`] - Search file contents with regex
//!
//! # Example
//!
//! ```rust,ignore
//! use codive_tools::{BashTool, ReadFileTool, WriteFileTool, EditFileTool};
//! use codive_core::tool::ToolRegistry;
//!
//! let mut registry = ToolRegistry::new();
//! registry.register(BashTool::new());
//! registry.register(ReadFileTool::new());
//! registry.register(WriteFileTool::new());
//! registry.register(EditFileTool::new());
//! ```

pub mod bash;
pub mod edit_file;
pub mod glob;
pub mod grep;
pub mod lsp;
pub mod read_file;
pub mod write_file;

// Re-export tools for convenience
pub use bash::BashTool;
pub use edit_file::EditFileTool;
pub use glob::GlobTool;
pub use grep::GrepTool;
pub use lsp::LspTool;
pub use read_file::ReadFileTool;
pub use write_file::WriteFileTool;

use std::sync::Arc;

/// Register all standard tools with a registry
pub fn register_all_tools(registry: &mut codive_core::tool::ToolRegistry) {
    registry.register(Arc::new(BashTool::new()));
    registry.register(Arc::new(ReadFileTool::new()));
    registry.register(Arc::new(WriteFileTool::new()));
    registry.register(Arc::new(EditFileTool::new()));
    registry.register(Arc::new(GlobTool::new()));
    registry.register(Arc::new(GrepTool::new()));
    registry.register(Arc::new(LspTool::new()));
}