agcodex_core/code_tools/
mod.rs1use thiserror::Error;
7
8#[derive(Debug, Error)]
9pub enum ToolError {
10 #[error("tool not implemented: {0}")]
11 NotImplemented(&'static str),
12
13 #[error(transparent)]
14 Io(#[from] std::io::Error),
15
16 #[error("invalid query: {0}")]
17 InvalidQuery(String),
18
19 #[error("parse error: {0}")]
20 ParseError(String),
21
22 #[error("not found: {0}")]
23 NotFound(String),
24
25 #[error("unsupported language: {0}")]
26 UnsupportedLanguage(String),
27}
28
29pub trait CodeTool {
31 type Query;
32 type Output;
33 fn search(&self, _query: Self::Query) -> Result<Self::Output, ToolError>;
34}
35
36pub mod fd_find;
37pub mod tree_sitter;
38
39pub mod queries;
41
42pub mod ast_agent_tools;
44
45pub mod ast_grep;
47
48pub mod search;
50
51#[cfg(test)]
55mod ast_agent_tools_test;