/**
 * Tracks the PID of a Gateway process spawned by this 4Runr CLI session (TUI connect autostart).
 * Used before global npm updates on Windows so `apps/gateway` is not locked (EBUSY).
 */
export declare const LOCAL_GATEWAY_PID_FILENAME = "4runr-os-local-gateway.pid";
/** Default local Gateway HTTP port when URL has no explicit port */
export declare const DEFAULT_LOCAL_GATEWAY_PORT = 3001;
/**
 * Port to use when stopping the local Gateway on exit — matches `GATEWAY_URL` when it points at localhost.
 */
export declare function resolveLocalGatewayShutdownPort(): number;
export declare function localGatewayPidFilePath(): string;
export declare function writeLocalGatewayPid(pid: number): void;
export declare function clearLocalGatewayPidFile(): void;
export declare function readLocalGatewayPid(): number | null;
/**
 * If the PID file is stale (npm exited but Node still listens), stop the listener on `port`.
 * Only kills when the owning image looks like Node — avoids killing unrelated servers on 3001.
 */
export declare function killLocalGatewayListenerFallback(port?: number): void;
/**
 * Stop autostart Gateway: recorded PID (full tree on Windows) + orphaned listener fallback.
 */
export declare function shutdownAutostartedGateway(port?: number): void;
export interface GatewayShutdownReport {
    /** True when nothing is LISTENING on `port` (Windows), or best-effort stop ran (Unix). */
    portClear: boolean;
    /** Short lines for stderr — proof of cleanup without running netstat yourself. */
    lines: string[];
}
/**
 * Same as {@link shutdownAutostartedGateway}, then verifies the TCP listener is gone (Windows).
 * Runs an extra kill round if something still owns the port — maximizes confidence on exit.
 */
export declare function shutdownAutostartedGatewayVerified(port?: number): GatewayShutdownReport;
/**
 * Stop a previously recorded autostart Gateway so npm can replace the global package tree.
 */
export declare function killRecordedLocalGateway(): void;
//# sourceMappingURL=local-gateway-pid.d.ts.map