1mod context_server_registry;
 2mod copy_path_tool;
 3mod create_directory_tool;
 4mod delete_path_tool;
 5mod diagnostics_tool;
 6mod edit_file_tool;
 7mod fetch_tool;
 8mod find_path_tool;
 9mod grep_tool;
10mod list_directory_tool;
11mod move_path_tool;
12mod now_tool;
13mod open_tool;
14mod read_file_tool;
15mod terminal_tool;
16mod thinking_tool;
17mod web_search_tool;
18
19use crate::AgentTool;
20use language_model::{LanguageModelRequestTool, LanguageModelToolSchemaFormat};
21
22pub use context_server_registry::*;
23pub use copy_path_tool::*;
24pub use create_directory_tool::*;
25pub use delete_path_tool::*;
26pub use diagnostics_tool::*;
27pub use edit_file_tool::*;
28pub use fetch_tool::*;
29pub use find_path_tool::*;
30pub use grep_tool::*;
31pub use list_directory_tool::*;
32pub use move_path_tool::*;
33pub use now_tool::*;
34pub use open_tool::*;
35pub use read_file_tool::*;
36pub use terminal_tool::*;
37pub use thinking_tool::*;
38pub use web_search_tool::*;
39
40macro_rules! tools {
41    ($($tool:ty),* $(,)?) => {
42        /// A list of all built-in tool names
43        pub fn built_in_tool_names() -> impl Iterator<Item = String> {
44            [
45                $(
46                    <$tool>::name().to_string(),
47                )*
48            ]
49            .into_iter()
50        }
51
52        /// A list of all built-in tools
53        pub fn built_in_tools() -> impl Iterator<Item = LanguageModelRequestTool> {
54            fn language_model_tool<T: AgentTool>() -> LanguageModelRequestTool {
55                LanguageModelRequestTool {
56                    name: T::name().to_string(),
57                    description: T::description().to_string(),
58                    input_schema: T::input_schema(LanguageModelToolSchemaFormat::JsonSchema).to_value(),
59                }
60            }
61            [
62                $(
63                    language_model_tool::<$tool>(),
64                )*
65            ]
66            .into_iter()
67        }
68    };
69}
70
71tools! {
72    CopyPathTool,
73    CreateDirectoryTool,
74    DeletePathTool,
75    DiagnosticsTool,
76    EditFileTool,
77    FetchTool,
78    FindPathTool,
79    GrepTool,
80    ListDirectoryTool,
81    MovePathTool,
82    NowTool,
83    OpenTool,
84    ReadFileTool,
85    TerminalTool,
86    ThinkingTool,
87    WebSearchTool,
88}