import * as readline from 'readline/promises';
/** y/yes/д/да → true; пустой ввод и остальное → false */
export async function askYesNo(prompt) {
    if (!process.stdin.isTTY)
        return false;
    const rl = readline.createInterface({
        input: process.stdin,
        output: process.stdout,
    });
    try {
        const answer = (await rl.question(prompt)).trim().toLowerCase();
        return answer === 'y' || answer === 'yes' || answer === 'д' || answer === 'да';
    }
    finally {
        rl.close();
    }
}
