(mcpClients: MCPServerConnection[], ideInstallationStatus: IDEExtensionInstallationStatus | null = null, theme: ThemeName)
| 186 | }]; |
| 187 | } |
| 188 | export function buildIDEProperties(mcpClients: MCPServerConnection[], ideInstallationStatus: IDEExtensionInstallationStatus | null = null, theme: ThemeName): Property[] { |
| 189 | const ideClient = mcpClients?.find(client => client.name === 'ide'); |
| 190 | if (ideInstallationStatus) { |
| 191 | const ideName = toIDEDisplayName(ideInstallationStatus.ideType); |
| 192 | const pluginOrExtension = isJetBrainsIde(ideInstallationStatus.ideType) ? 'plugin' : 'extension'; |
| 193 | if (ideInstallationStatus.error) { |
| 194 | return [{ |
| 195 | label: 'IDE', |
| 196 | value: <Text> |
| 197 | {color('error', theme)(figures.cross)} Error installing {ideName}{' '} |
| 198 | {pluginOrExtension}: {ideInstallationStatus.error} |
| 199 | {'\n'}Please restart your IDE and try again. |
| 200 | </Text> |
| 201 | }]; |
| 202 | } |
| 203 | if (ideInstallationStatus.installed) { |
| 204 | if (ideClient && ideClient.type === 'connected') { |
| 205 | if (ideInstallationStatus.installedVersion !== ideClient.serverInfo?.version) { |
| 206 | return [{ |
| 207 | label: 'IDE', |
| 208 | value: `Connected to ${ideName} ${pluginOrExtension} version ${ideInstallationStatus.installedVersion} (server version: ${ideClient.serverInfo?.version})` |
| 209 | }]; |
| 210 | } else { |
| 211 | return [{ |
| 212 | label: 'IDE', |
| 213 | value: `Connected to ${ideName} ${pluginOrExtension} version ${ideInstallationStatus.installedVersion}` |
| 214 | }]; |
| 215 | } |
| 216 | } else { |
| 217 | return [{ |
| 218 | label: 'IDE', |
| 219 | value: `Installed ${ideName} ${pluginOrExtension}` |
| 220 | }]; |
| 221 | } |
| 222 | } |
| 223 | } else if (ideClient) { |
| 224 | const ideName = getIdeClientName(ideClient) ?? 'IDE'; |
| 225 | if (ideClient.type === 'connected') { |
| 226 | return [{ |
| 227 | label: 'IDE', |
| 228 | value: `Connected to ${ideName} extension` |
| 229 | }]; |
| 230 | } else { |
| 231 | return [{ |
| 232 | label: 'IDE', |
| 233 | value: `${color('error', theme)(figures.cross)} Not connected to ${ideName}` |
| 234 | }]; |
| 235 | } |
| 236 | } |
| 237 | return []; |
| 238 | } |
| 239 | export function buildMcpProperties(clients: MCPServerConnection[] = [], theme: ThemeName): Property[] { |
| 240 | const servers = clients.filter(client => client.name !== 'ide'); |
| 241 | if (!servers.length) { |
no test coverage detected