using System.Threading.Tasks; using MCPForUnity.Editor.Services.Transport; 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; } /// /// Gets the currently active transport mode, if any /// TransportMode? ActiveMode { get; } /// /// Starts the MCP for Unity Bridge asynchronously /// /// True if the bridge started successfully Task StartAsync(); /// /// Stops the MCP for Unity Bridge asynchronously /// Task StopAsync(); /// /// 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); /// /// Verifies the connection asynchronously (works for both HTTP and stdio transports) /// /// Verification result with detailed status Task VerifyAsync(); } /// /// 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; } } }