/**
 * Shared UI types for the MCP server menu views. These used to live in a
 * deleted sibling file; re-declared here to unblock the remaining
 * ManagePlugins / MCPRemoteServerMenu call sites.
 */

import type { ConnectedMCPServer, MCPServerConnection } from '../../services/mcp/client.js'
import type {
  ConfigScope,
  McpHTTPServerConfig,
  McpRemoteProxyServerConfig,
  McpSSEServerConfig,
  McpStdioServerConfig,
} from '../../services/mcp/types.js'

type BaseServerInfo = {
  name: string
  client: MCPServerConnection | ConnectedMCPServer
  scope: ConfigScope
}

export type StdioServerInfo = BaseServerInfo & {
  transport: 'stdio'
  config: McpStdioServerConfig
}

export type SSEServerInfo = BaseServerInfo & {
  transport: 'sse'
  isAuthenticated: boolean | undefined
  config: McpSSEServerConfig
}

export type HTTPServerInfo = BaseServerInfo & {
  transport: 'http'
  isAuthenticated: boolean | undefined
  config: McpHTTPServerConfig
}

export type RemoteProxyServerInfo = BaseServerInfo & {
  transport: 'remote-proxy'
  isAuthenticated: boolean | undefined
  config: McpRemoteProxyServerConfig
}

export type RemoteServerInfo =
  | SSEServerInfo
  | HTTPServerInfo
  | RemoteProxyServerInfo

export type ServerInfo = StdioServerInfo | RemoteServerInfo
