(
base: Vec<ToolDefinition>,
extra: Vec<ToolDefinition>,
)
| 3087 | } |
| 3088 | |
| 3089 | pub fn merge_tool_definitions( |
| 3090 | base: Vec<ToolDefinition>, |
| 3091 | extra: Vec<ToolDefinition>, |
| 3092 | ) -> Vec<ToolDefinition> { |
| 3093 | let mut merged: HashMap<String, ToolDefinition> = HashMap::new(); |
| 3094 | for tool in base.into_iter().chain(extra) { |
| 3095 | merged.insert(tool.name.clone(), tool); |
| 3096 | } |
| 3097 | |
| 3098 | let mut tools: Vec<ToolDefinition> = merged.into_values().collect(); |
| 3099 | tools.sort_by(|a, b| a.name.cmp(&b.name)); |
| 3100 | tools |
| 3101 | } |
| 3102 | |
| 3103 | pub async fn resolve_tools_with_mcp( |
| 3104 | tool_registry: &opencode_tool::ToolRegistry, |
no test coverage detected