/** * App discovery and session management for multiple Tauri instances. * * This module handles discovering and connecting to multiple Tauri apps * running with MCP Bridge on the same machine or remote devices using port scanning. */ import { PluginClient } from './plugin-client.js'; export interface AppInstance { host: string; port: number; available: boolean; } export interface SessionInfo { appId: string; name: string; host: string; port: number; client?: PluginClient; connected: boolean; } /** * Manages discovery and connection to multiple Tauri app instances */ export declare class AppDiscovery { private _activeSessions; private _host; private _basePort; private _maxPorts; constructor(host?: string, basePort?: number); /** * Gets the configured host. */ get host(): string; /** * Sets the host for discovery. */ setHost(host: string): void; /** * Discovers available Tauri app instances by scanning ports */ discoverApps(): Promise; /** * Connects to a specific app on a host and port */ connectToPort(port: number, appName?: string, host?: string): Promise; /** * Gets the first available app */ getFirstAvailableApp(): Promise; /** * Disconnects from a specific session */ disconnectSession(sessionId: string): Promise; /** * Disconnects from all apps */ disconnectAll(): Promise; /** * Gets the active session by ID */ getSession(sessionId: string): SessionInfo | undefined; /** * Gets all active sessions */ getAllSessions(): SessionInfo[]; /** * Try to connect to the default port */ connectToDefaultPort(): Promise; /** * Check if a port is in use (likely a Tauri app) */ private _isPortInUse; } export declare const appDiscovery: AppDiscovery;