( mcpClients?: MCPServerConnection[], )
| 1308 | * @returns The connected IDE client, or undefined if not found |
| 1309 | */ |
| 1310 | export function getConnectedIdeClient( |
| 1311 | mcpClients?: MCPServerConnection[], |
| 1312 | ): ConnectedMCPServer | undefined { |
| 1313 | if (!mcpClients) { |
| 1314 | return undefined |
| 1315 | } |
| 1316 | |
| 1317 | const ideClient = mcpClients.find( |
| 1318 | client => client.type === 'connected' && client.name === 'ide', |
| 1319 | ) |
| 1320 | |
| 1321 | // Type guard to ensure we return the correct type |
| 1322 | return ideClient?.type === 'connected' ? ideClient : undefined |
| 1323 | } |
| 1324 | |
| 1325 | /** |
| 1326 | * Notifies the IDE that a new prompt has been submitted. |
no outgoing calls
no test coverage detected