( mcpClients?: MCPServerConnection[], )
| 9 | } |
| 10 | |
| 11 | export function useIdeConnectionStatus( |
| 12 | mcpClients?: MCPServerConnection[], |
| 13 | ): IdeConnectionResult { |
| 14 | return useMemo(() => { |
| 15 | const ideClient = mcpClients?.find(client => client.name === 'ide') |
| 16 | if (!ideClient) { |
| 17 | return { status: null, ideName: null } |
| 18 | } |
| 19 | // Extract IDE name from config if available |
| 20 | const config = ideClient.config |
| 21 | const ideName = |
| 22 | config.type === 'sse-ide' || config.type === 'ws-ide' |
| 23 | ? config.ideName |
| 24 | : null |
| 25 | if (ideClient.type === 'connected') { |
| 26 | return { status: 'connected', ideName } |
| 27 | } |
| 28 | if (ideClient.type === 'pending') { |
| 29 | return { status: 'pending', ideName } |
| 30 | } |
| 31 | return { status: 'disconnected', ideName } |
| 32 | }, [mcpClients]) |
| 33 | } |
| 34 |
no outgoing calls
no test coverage detected