* 注销工具
(toolName: string)
| 86 | * 注销工具 |
| 87 | */ |
| 88 | public unregisterTool(toolName: string): boolean { |
| 89 | const existed = this.tools.has(toolName); |
| 90 | |
| 91 | if (existed) { |
| 92 | this.tools.delete(toolName); |
| 93 | this.toolStates.delete(toolName); |
| 94 | |
| 95 | this.log(`工具 "${toolName}" 已注销`); |
| 96 | this.emit('toolUnregistered', { toolName }); |
| 97 | } |
| 98 | |
| 99 | return existed; |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * 获取所有已注册的工具 |
no test coverage detected