(name: string)
| 127 | } |
| 128 | |
| 129 | async disconnect(name: string): Promise<void> { |
| 130 | const conn = this.connections.get(name) |
| 131 | if (!conn) return |
| 132 | |
| 133 | if (conn.type === 'connected') { |
| 134 | try { |
| 135 | await conn.cleanup() |
| 136 | } catch (err) { |
| 137 | this.deps.logger.warn(`Error disconnecting ${name}:`, err) |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | this.connections.delete(name) |
| 142 | this.toolsCache.delete(name) |
| 143 | this.emit('disconnected', name) |
| 144 | } |
| 145 | |
| 146 | async disconnectAll(): Promise<void> { |
| 147 | const names = [...this.connections.keys()] |