* 按分类获取工具
()
| 151 | * 按分类获取工具 |
| 152 | */ |
| 153 | public getToolsByCategory(): Record<string, ToolDefinition[]> { |
| 154 | const tools = this.getTools(); |
| 155 | const categories: Record<string, ToolDefinition[]> = {}; |
| 156 | |
| 157 | for (const tool of tools) { |
| 158 | const category = tool.category || 'other'; |
| 159 | if (!categories[category]) { |
| 160 | categories[category] = []; |
| 161 | } |
| 162 | categories[category].push(tool); |
| 163 | } |
| 164 | |
| 165 | return categories; |
| 166 | } |
| 167 | |
| 168 | /** |
| 169 | * 搜索工具 |
no test coverage detected