import { CliCaService } from './cli-ca.service';
/**
 * CLI SSH Management Service
 *
 * Manages SSH access with ephemeral certificates:
 * - Generates ephemeral ED25519 keypair for each connection
 * - Gets certificate signed by CA (5-minute validity)
 * - Uses certificate for SSH authentication
 * - Cleans up temporary files after connection
 */
export declare class CliSshService {
    private readonly caService;
    private readonly logger;
    private readonly fluiDir;
    private readonly sshDir;
    private readonly privateKeyPath;
    private readonly publicKeyPath;
    constructor(caService: CliCaService);
    /**
     * Ensure ~/.flui/ssh directory exists
     */
    private ensureSshDir;
    /**
     * Get or generate SSH key pair
     * Returns the public key content for server provisioning
     */
    getOrCreateSshKey(): Promise<{
        publicKey: string;
        privateKeyPath: string;
        publicKeyPath: string;
    }>;
    /**
     * Get SSH public key content
     */
    getPublicKey(): Promise<string>;
    /**
     * Get SSH private key path for SSH connections
     */
    getPrivateKeyPath(): string;
    /**
     * Generate ephemeral keypair and get signed certificate
     * Returns paths to private key and certificate
     */
    private generateEphemeralKeypair;
    /**
     * SSH into a server using ephemeral certificate
     */
    sshConnect(host: string, username?: string): Promise<void>;
    /**
     * Execute command on remote server via SSH with ephemeral certificate
     */
    sshExec(host: string, command: string, username?: string): Promise<string>;
    /**
     * Open an SSH session to `host` that requests one or more local port
     * forwards (`-L localPort:remoteHost:remotePort`) and runs `remoteCommand`
     * on the remote side. Stays in foreground until the user kills it or the
     * remote command exits. Returns the child's exit info.
     */
    sshForward(opts: {
        host: string;
        username?: string;
        forwards: Array<{
            localPort: number;
            remotePort: number;
            remoteHost?: string;
        }>;
        remoteCommand?: string;
        onReady?: () => void;
        /** Number of `Forwarding from …` lines expected on stderr before declaring readiness. */
        expectedForwardLines?: number;
    }): Promise<{
        status: number | null;
        signal: NodeJS.Signals | null;
    }>;
    /**
     * Get remote log file via SSH
     */
    getRemoteLog(host: string, logPath: string, username?: string): Promise<string>;
    /**
     * Tail remote log file via SSH
     */
    tailRemoteLog(host: string, logPath: string, lines?: number, username?: string): Promise<string>;
    /**
     * Stream remote log file via SSH with tail -f
     * Returns a cleanup function that should be called to stop streaming and cleanup resources
     */
    streamRemoteLog(host: string, logPath: string, username?: string, onData?: (data: string) => void): Promise<{
        cleanup: () => void;
    }>;
}
