RemoveTool 移除工具
(name string)
| 265 | |
| 266 | // RemoveTool 移除工具 |
| 267 | func (tm *ToolManager) RemoveTool(name string) error { |
| 268 | tm.mu.Lock() |
| 269 | defer tm.mu.Unlock() |
| 270 | |
| 271 | // 不能移除核心工具 |
| 272 | if tm.isCoreToolLocked(name) { |
| 273 | return fmt.Errorf("cannot remove core tool: %s", name) |
| 274 | } |
| 275 | |
| 276 | // 从索引中移除 |
| 277 | tm.index.RemoveTool(name) |
| 278 | |
| 279 | // 从活跃和延迟列表中移除 |
| 280 | delete(tm.activeTools, name) |
| 281 | delete(tm.deferredTools, name) |
| 282 | |
| 283 | return nil |
| 284 | } |
| 285 | |
| 286 | // GetIndex 获取工具索引 |
| 287 | func (tm *ToolManager) GetIndex() *search.ToolIndex { |
nothing calls this directly
no test coverage detected