namespace MCPForUnity.Editor.Services
{
///
/// Service for controlling the MCP for Unity Bridge connection
///
public interface IBridgeControlService
{
///
/// Gets whether the bridge is currently running
///
bool IsRunning { get; }
///
/// Gets the current port the bridge is listening on
///
int CurrentPort { get; }
///
/// Gets whether the bridge is in auto-connect mode
///
bool IsAutoConnectMode { get; }
///
/// Starts the MCP for Unity Bridge
///
void Start();
///
/// Stops the MCP for Unity Bridge
///
void Stop();
///
/// Verifies the bridge connection by sending a ping and waiting for a pong response
///
/// The port to verify
/// Verification result with detailed status
BridgeVerificationResult Verify(int port);
}
///
/// Result of a bridge verification attempt
///
public class BridgeVerificationResult
{
///
/// Whether the verification was successful
///
public bool Success { get; set; }
///
/// Human-readable message about the verification result
///
public string Message { get; set; }
///
/// Whether the handshake was valid (FRAMING=1 protocol)
///
public bool HandshakeValid { get; set; }
///
/// Whether the ping/pong exchange succeeded
///
public bool PingSucceeded { get; set; }
}
}