/** * Tunnel Management Service * Provides high-level tunnel management abstraction for localhost URLs */ export interface TunnelInfo { tunnelId: string; originalUrl: string; tunnelUrl: string; publicUrl: string; port: number; createdAt: number; lastAccessedAt: number; autoShutoffTimer?: NodeJS.Timeout; } export interface TunnelResult { url: string; tunnelId?: string; isLocalhost: boolean; } declare class TunnelManager { private activeTunnels; private initialized; private readonly TUNNEL_TIMEOUT_MS; private ensureInitialized; /** * Reset the auto-shutoff timer for a tunnel */ private resetTunnelTimer; /** * Touch a tunnel to reset its timer (called when the tunnel is used) */ touchTunnel(tunnelId: string): void; /** * Touch a tunnel by URL (convenience method) */ touchTunnelByUrl(url: string): void; /** * Process a URL and create a tunnel if needed * Returns the URL to use (either original or tunneled) and tunnel metadata */ processUrl(url: string, authToken?: string, specificTunnelId?: string): Promise; /** * Check if a URL is a tunnel URL */ isTunnelUrl(url: string): boolean; /** * Extract tunnel ID from a tunnel URL */ extractTunnelId(url: string): string | null; /** * Get tunnel info by ID */ getTunnelInfo(tunnelId: string): TunnelInfo | undefined; /** * Find tunnel by port */ private findTunnelByPort; /** * Create a new tunnel */ private createTunnel; /** * Stop a tunnel by ID */ stopTunnel(tunnelId: string): Promise; /** * Stop all active tunnels */ stopAllTunnels(): Promise; /** * Get all active tunnels */ getActiveTunnels(): TunnelInfo[]; /** * Get tunnel status with timing information */ getTunnelStatus(tunnelId: string): { tunnel: TunnelInfo; age: number; timeSinceLastAccess: number; timeUntilAutoShutoff: number; } | null; /** * Get all tunnel statuses */ getAllTunnelStatuses(): any[]; } declare const tunnelManager: TunnelManager; export { tunnelManager }; export default TunnelManager; //# sourceMappingURL=tunnelManager.d.ts.map