/** * Session ID Utilities * * Functions for generating, parsing, and working with PTY session IDs. * * Session ID formats: * - CLI sessions: cli-{pid}-{timestamp}-{random} * - Local sessions: local-{uuid} * - Namespaced IDs: {source}|{connectionId}|{originalId} */ import type { SessionSource } from '../types.js'; /** * Generate a CLI session ID * Format: cli-{pid}-{timestamp}-{random} */ export declare function generateCliSessionId(pid: number): string; /** * Generate a local session ID * Format: local-{uuid} */ export declare function generateLocalSessionId(): string; /** * Generate a session ID for any source */ export declare function generateSessionId(source: SessionSource, pid?: number): string; /** * Parsed namespaced ID components */ export interface NamespacedId { source: SessionSource; connectionId: string; originalId: string; } /** * Create a namespaced session ID * Format: {source}|{connectionId}|{originalId} */ export declare function createNamespacedId(source: SessionSource, connectionId: string, originalId: string): string; /** * Parse a namespaced session ID * @returns Parsed components, or null if invalid format */ export declare function parseNamespacedId(namespacedId: string): NamespacedId | null; /** * Check if a session ID is namespaced */ export declare function isNamespacedId(sessionId: string): boolean; /** * Extract the original session ID from a namespaced ID * Returns the ID unchanged if not namespaced */ export declare function getOriginalId(sessionId: string): string; /** * Extract the connection ID from a namespaced session ID * Returns null if not namespaced */ export declare function getConnectionId(sessionId: string): string | null; /** * Check if a string is a valid session source */ export declare function isValidSource(source: string): source is SessionSource; /** * Check if a session ID appears to be a CLI session */ export declare function isCliSessionId(sessionId: string): boolean; /** * Check if a session ID appears to be a local session */ export declare function isLocalSessionId(sessionId: string): boolean; /** * Get the socket directory path */ export declare function getSocketDir(): string; /** * Get the UDS socket path */ export declare function getSocketPath(): string; //# sourceMappingURL=session-id.d.ts.map