import { EventEmitter } from 'events';
import { SessionInfo, TeamMemberSessionConfig } from '../../types/index.js';
import { TmuxCommandService } from './tmux-command.service.js';
import { OrchestratorConfig } from './agent-registration.service.js';
/**
 * Refactored TmuxService that acts as a facade, coordinating specialized services
 * to provide a high-level API for tmux session management and agent initialization.
 *
 * This service retains the public-facing API while delegating actual work to specialized services:
 * - TmuxCommandService: Low-level tmux operations
 * - RuntimeServiceFactory: Creates runtime-specific services
 * - AgentRegistrationService: Agent initialization and registration
 * - PromptBuilderService: Prompt generation and management
 */
export declare class TmuxService extends EventEmitter {
    private sessions;
    private outputBuffers;
    private logger;
    private tmuxCommand;
    private agentRegistration;
    private promptBuilder;
    private storageService;
    private cleanupInterval;
    private readonly MAX_BUFFER_SIZE;
    private readonly CLEANUP_INTERVAL;
    private sessionCreationQueue;
    private isProcessingQueue;
    private readonly SESSION_CREATION_DELAY;
    private readonly MAX_CONCURRENT_INITIALIZING;
    private activeSessions;
    private readonly projectRoot;
    constructor();
    /**
     * Find the project root by looking for package.json.
     * Walks up from process.cwd() to locate the nearest package.json.
     */
    private findProjectRoot;
    /**
     * Clean up memory to prevent accumulation of old data
     */
    private cleanupMemory;
    /**
     * Destroy the service and clean up resources
     */
    destroy(): void;
    /**
     * Force immediate memory cleanup (for emergency situations)
     */
    forceCleanup(): void;
    /**
     * Initialize tmux server if not running
     *
     * DORMANT: tmux initialization is disabled since we're using PTY session backend.
     * This method is kept for backward compatibility but does nothing.
     * To re-enable tmux support, restore the call to ensureTmuxServer().
     */
    initialize(): Promise<void>;
    /**
     * Ensure tmux server is running using the initialize_tmux.sh script
     *
     * DORMANT: This method is not called when using PTY session backend.
     */
    private ensureTmuxServer;
    /**
     * Create orchestrator session for project management
     */
    createOrchestratorSession(config: OrchestratorConfig): Promise<{
        success: boolean;
        sessionName: string;
        message?: string;
        error?: string;
    }>;
    /**
     * Initialize orchestrator session with appropriate runtime
     */
    initializeOrchestrator(sessionName: string, timeout?: number): Promise<{
        success: boolean;
        message?: string;
        error?: string;
    }>;
    /**
     * Send project start prompt to orchestrator
     */
    sendProjectStartPrompt(sessionName: string, projectData: {
        projectName: string;
        projectPath: string;
        teamDetails: any;
        requirements?: string;
    }): Promise<{
        success: boolean;
        message?: string;
        error?: string;
    }>;
    /**
     * Check if Claude Code CLI is installed
     */
    checkClaudeInstallation(): Promise<{
        installed: boolean;
        version?: string;
        message: string;
    }>;
    /**
     * Initialize Claude Code in an existing session
     */
    initializeClaudeInSession(sessionName: string): Promise<{
        success: boolean;
        message?: string;
        error?: string;
    }>;
    /**
     * Create a new tmux session for a team member (queued to prevent concurrent creation conflicts)
     */
    createTeamMemberSession(config: TeamMemberSessionConfig, sessionName: string): Promise<{
        success: boolean;
        sessionName?: string;
        message?: string;
        error?: string;
    }>;
    /**
     * Internal method for creating team member session (called by queue processor)
     */
    private createTeamMemberSessionInternal;
    /**
     * Process the session creation queue to serialize session creation
     */
    private processSessionCreationQueue;
    /**
     * Create a new tmux session with Claude Code (legacy compatibility)
     */
    createSession(config: TeamMemberSessionConfig): Promise<string>;
    /**
     * Check if a tmux session is attached
     */
    isSessionAttached(sessionName: string): Promise<boolean>;
    /**
     * Send message directly using send-keys (for attached sessions)
     */
    sendMessageDirectly(sessionName: string, message: string): Promise<void>;
    /**
     * Send a message to a specific tmux session
     * Uses robust tmux_robosend.sh script for all sessions (attached and detached)
     */
    sendMessage(sessionName: string, message: string): Promise<void>;
    /**
     * Send individual key to a specific tmux session (without Enter)
     */
    sendKey(sessionName: string, key: string): Promise<void>;
    /**
     * Capture terminal output from a session
     */
    capturePane(sessionName: string, lines?: number): Promise<string>;
    /**
     * Kill a tmux session
     */
    killSession(sessionName: string): Promise<void>;
    /**
     * List all tmux sessions
     */
    listSessions(): Promise<SessionInfo[]>;
    /**
     * Check if a session exists
     */
    sessionExists(sessionName: string): Promise<boolean>;
    /**
     * Check multiple sessions at once (highly optimized for bulk checking)
     * Returns a Map with sessionName -> boolean for each session
     */
    bulkSessionExists(sessionNames: string[]): Promise<Map<string, boolean>>;
    /**
     * Start streaming output for an existing session (public method)
     */
    enableOutputStreaming(sessionName: string): void;
    /**
     * Start optimized streaming output from a session with reduced frequency and jitter
     */
    private startOutputStreaming;
    /**
     * Execute tmux initialization script
     * @deprecated tmux support has been removed - PTY backend is now used
     */
    private executeTmuxInitScript;
    /**
     * Get the underlying TmuxCommandService instance for specialized operations
     * @returns TmuxCommandService instance
     */
    getTmuxCommandService(): TmuxCommandService;
}
export { OrchestratorConfig };
//# sourceMappingURL=tmux.service.d.ts.map