( mcpClients?: MCPServerConnection[], )
| 1249 | * @returns The connected IDE client, or undefined if not found |
| 1250 | */ |
| 1251 | export function getConnectedIdeClient( |
| 1252 | mcpClients?: MCPServerConnection[], |
| 1253 | ): ConnectedMCPServer | undefined { |
| 1254 | if (!mcpClients) { |
| 1255 | return undefined |
| 1256 | } |
| 1257 | |
| 1258 | const ideClient = mcpClients.find( |
| 1259 | client => client.type === 'connected' && client.name === 'ide', |
| 1260 | ) |
| 1261 | |
| 1262 | // Type guard to ensure we return the correct type |
| 1263 | return ideClient?.type === 'connected' ? ideClient : undefined |
| 1264 | } |
| 1265 | |
| 1266 | /** |
| 1267 | * Notifies the IDE that a new prompt has been submitted. |
no outgoing calls
no test coverage detected