import type { EventBus } from '../core/event-bus.js';
export interface TerminalCreateOptions {
    cwd?: string;
    cols?: number;
    rows?: number;
}
export interface TerminalInfo {
    terminalId: string;
    pid: number;
    cwd: string;
}
/**
 * Manages standalone interactive shell terminals.
 * Each terminal is a raw PTY (zsh/cmd 等系统默认 shell) with no parser or MsgStore.
 * Terminals are owned by the socket that created them.
 */
export declare class TerminalManager {
    private readonly eventBus;
    private terminals;
    private ownership;
    private ttlTimer;
    constructor(eventBus: EventBus);
    /**
     * Create a new standalone terminal.
     * Returns terminal info including the generated ID.
     */
    create(socketId: string, options?: TerminalCreateOptions): TerminalInfo;
    /**
     * Write data to a terminal's stdin.
     */
    write(terminalId: string, data: string): void;
    /**
     * Resize a terminal.
     */
    resize(terminalId: string, cols: number, rows: number): void;
    /**
     * Destroy a single terminal.
     */
    destroy(terminalId: string): void;
    /**
     * Clean up all terminals owned by a specific socket.
     * Called when a socket disconnects.
     */
    cleanupBySocket(socketId: string): void;
    /**
     * Destroy all terminals. Called on graceful server shutdown.
     */
    destroyAll(): void;
    /**
     * Check if a terminal exists.
     */
    has(terminalId: string): boolean;
    /**
     * Get count of active terminals.
     */
    get size(): number;
    private recordOwnership;
    private removeTerminal;
    /**
     * Periodic TTL check — kill terminals that have been idle too long.
     */
    private startTTLChecker;
}
//# sourceMappingURL=terminal-manager.d.ts.map