/** * Port Inspection - Cross-platform port usage detection * * Provides utilities to: * - Check if a port is in use * - Identify which process is listening * - Classify whether a listener is the gateway */ export type PortUsageStatus = 'free' | 'busy' | 'unknown'; export interface PortListener { pid?: number; ppid?: number; command?: string; commandLine?: string; address?: string; } export interface PortUsage { port: number; status: PortUsageStatus; listeners: PortListener[]; hints: string[]; errors?: string[]; } export type PortListenerKind = 'gateway' | 'other' | 'unknown'; /** Inspect port usage: check if busy and identify listeners */ export declare function inspectPortUsage(port: number): Promise; /** Classify whether a port listener belongs to the gateway */ export declare function classifyPortListener(listener: PortListener, runtimePid?: number): PortListenerKind; /** Format port diagnostics for display */ export declare function formatPortDiagnostics(usage: PortUsage): string[];