import { z } from 'zod'; import { PluginClient } from './plugin-client.js'; /** * Session Manager - Native IPC-based session management * * This module provides lightweight native session management using Tauri IPC. * The "session" concept is maintained for API compatibility. * * Connection Strategy: * 1. Try localhost first (most reliable for simulators/emulators/desktop) * 2. If localhost fails and a remote host is configured, try that host * 3. Return error if all connection attempts fail */ export declare const ManageDriverSessionSchema: z.ZodObject<{ action: z.ZodEnum<["start", "stop", "status"]>; host: z.ZodOptional; port: z.ZodOptional; appIdentifier: z.ZodOptional>; }, "strip", z.ZodTypeAny, { action: "status" | "start" | "stop"; host?: string | undefined; port?: number | undefined; appIdentifier?: string | number | undefined; }, { action: "status" | "start" | "stop"; host?: string | undefined; port?: number | undefined; appIdentifier?: string | number | undefined; }>; export interface SessionInfo { name: string; identifier: string | null; host: string; port: number; client: PluginClient; connected: boolean; } /** * Check if any session is currently active. * @returns true if at least one session exists */ export declare function hasActiveSession(): boolean; /** * Get a specific session by port. */ export declare function getSession(port: number): SessionInfo | null; /** * Get the default session (most recently connected). */ export declare function getDefaultSession(): SessionInfo | null; /** * Get all active sessions. */ export declare function getAllSessions(): SessionInfo[]; /** * Resolve target app from port or identifier. * Returns the appropriate session based on the routing logic. */ export declare function resolveTargetApp(portOrIdentifier?: string | number): SessionInfo; /** * Manage session lifecycle (start, stop, or status). * * Connection strategy for 'start': * 1. Try localhost:{port} first (most reliable for simulators/emulators/desktop) * 2. If localhost fails AND a different host is configured, try {host}:{port} * 3. If both fail, try auto-discovery on localhost * 4. Return error if all attempts fail * * @param action - 'start', 'stop', or 'status' * @param host - Optional host address (defaults to env var or localhost) * @param port - Optional port number (defaults to 9223) * @param appIdentifier - Optional app identifier for 'stop' action (port or bundle ID) * @returns For 'start'/'stop': A message string describing the result. * For 'status': A JSON string with connection details */ export declare function manageDriverSession(action: 'start' | 'stop' | 'status', host?: string, port?: number, appIdentifier?: string | number): Promise;