import { SessionInfo } from '../../types/index.js';
/**
 * Service responsible for all direct, low-level interactions with the tmux command-line tool.
 * Abstracts away the details of executing tmux commands.
 * Implements caching and rate limiting to reduce excessive tmux command execution.
 */
export declare class TmuxCommandService {
    private logger;
    private readonly projectRoot;
    private readonly tmuxDisabled;
    private sessionCache;
    private readonly SESSION_CACHE_TTL;
    private paneCache;
    private readonly PANE_CACHE_TTL;
    private lastListSessions;
    private readonly LIST_SESSIONS_THROTTLE;
    private cachedSessionList;
    private shadowClients;
    private shadowClientProcesses;
    private shadowClientLocks;
    private focusEventsEnabled;
    constructor();
    /**
     * Find the project root by looking for package.json.
     * Walks up from process.cwd() to locate the nearest package.json.
     */
    private findProjectRoot;
    /**
     * Get path to the tmux_robosend.sh script
     * @deprecated tmux support has been removed - PTY backend is now used
     */
    private getTmuxRobosendScriptPath;
    /**
     * Get tmux socket name (default socket)
     */
    private getTmuxSocketName;
    /**
     * Execute a tmux command with bashrc sourced first
     */
    executeTmuxCommand(args: string[]): Promise<string>;
    /**
     * Execute a shell command using bash (for commands that need shell interpretation like semicolons)
     */
    private executeShellCommand;
    /**
     * Enable focus events for tmux (one-time setup for shadow client support)
     */
    private enableFocusEvents;
    /**
     * Find the pane ID for a given session name
     * Since we only have one window per session, we look for session:0.0
     */
    private findSessionPaneId;
    /**
     * Ensure shadow client is attached to session for TUI input reliability
     * This prevents TUI applications from ignoring input when no client is attached
     */
    private ensureShadowClient;
    /**
     * Internal implementation of shadow client creation
     */
    private ensureShadowClientInternal;
    /**
     * Clean up shadow client tracking for a session
     */
    private cleanupShadowClient;
    /**
     * Check if a tmux session exists (optimized to use listSessions instead of individual has-session calls)
     *
     * DORMANT: Returns false when tmux is disabled (PTY backend is active)
     */
    sessionExists(sessionName: string): Promise<boolean>;
    /**
     * Check multiple sessions at once (highly optimized for bulk checking)
     * Returns a Map with sessionName -> boolean for each session
     *
     * DORMANT: Returns map with all false when tmux is disabled (PTY backend is active)
     */
    bulkSessionExists(sessionNames: string[]): Promise<Map<string, boolean>>;
    /**
     * Kill a tmux session
     */
    killSession(sessionName: string): Promise<void>;
    /**
     * Send a message to a specific tmux session using the robust tmux_robosend.sh script
     */
    sendMessage(sessionName: string, message: string): Promise<void>;
    /**
     * Send individual key to a specific tmux session
     */
    sendKey(sessionName: string, key: string, allowRetry?: boolean): Promise<void>;
    /**
     * To clear the commandline commands regardless it is in coding agent runtime or regular terminal
     * @param sessionName
     */
    clearCurrentCommandLine(sessionName: string): Promise<void>;
    /**
     * Send control keys to a session using enhanced approach with session focusing
     * Leverages some benefits of the robust script approach
     */
    private sendControlKey;
    /**
     * Send Enter key to a session
     */
    sendEnter(sessionName: string): Promise<void>;
    /**
     * Send Ctrl+C to a session
     */
    sendCtrlC(sessionName: string): Promise<void>;
    /**
     * Send Escape key to a session
     */
    sendEscape(sessionName: string): Promise<void>;
    /**
     * Capture terminal output from a session (cached for 2 seconds to reduce frequent calls)
     */
    capturePane(sessionName: string, lines?: number): Promise<string>;
    /**
     * List all tmux sessions (rate limited and cached for 3 seconds)
     *
     * DORMANT: Returns empty array when tmux is disabled (PTY backend is active)
     */
    listSessions(): Promise<SessionInfo[]>;
    /**
     * Create a new tmux session
     */
    createSession(sessionName: string, workingDirectory: string, windowName?: string): Promise<void>;
    /**
     * Validate that a session is ready for commands
     * This helps prevent race conditions after session creation
     */
    validateSessionReady(sessionName: string): Promise<boolean>;
    /**
     * Set environment variable in a tmux session
     */
    setEnvironmentVariable(sessionName: string, key: string, value: string): Promise<void>;
    /**
     * Clear all caches for a specific session
     */
    clearSessionCache(sessionName: string): void;
    /**
     * Force clear all caches (useful for debugging or when cache becomes stale)
     */
    clearAllCaches(): void;
    /**
     * Get cache statistics for monitoring
     */
    getCacheStats(): {
        sessionCache: {
            size: number;
            entries: string[];
        };
        paneCache: {
            size: number;
            entries: string[];
        };
        sessionList: {
            cached: boolean;
            age?: number;
        };
    };
}
//# sourceMappingURL=tmux-command.service.d.ts.map