"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuestionsBlockersCommand = void 0;
const commander_1 = require("commander");
const chalk_1 = __importDefault(require("chalk"));
const QuestionGraphEngine_1 = require("../services/QuestionGraphEngine");
exports.QuestionsBlockersCommand = new commander_1.Command("questions:blockers")
    .description("Show blocking questions that must be answered before execution")
    .option("--json", "output as JSON")
    .action(async (options) => {
    const engine = new QuestionGraphEngine_1.QuestionGraphEngine();
    await engine.load();
    const blockers = engine.getBlockers();
    if (options.json) {
        console.log(JSON.stringify(blockers, null, 2));
        return;
    }
    if (blockers.length === 0) {
        console.log(chalk_1.default.green("\n  ✓ No blocking questions — compilation is clear\n"));
        return;
    }
    console.error(chalk_1.default.red.bold(`\n❌ ${blockers.length} Blocking Question(s)`));
    console.error(chalk_1.default.red("   These must be answered before execution can proceed."));
    console.error(chalk_1.default.dim("─".repeat(60)));
    for (const q of blockers) {
        console.error(`\n  ${chalk_1.default.red("●")} ${chalk_1.default.bold(q.text)}`);
        console.error(`     ${chalk_1.default.dim("ID:")} ${chalk_1.default.cyan(q.id)}`);
        if (q.context) {
            console.error(`     ${chalk_1.default.dim("Context:")} ${q.context}`);
        }
        if (q.options && q.options.length > 0) {
            console.error(`     ${chalk_1.default.dim("Options:")}`);
            for (const opt of q.options) {
                console.error(`       · ${chalk_1.default.cyan(opt.value)} — ${opt.label}`);
                if (opt.description) {
                    console.error(`         ${chalk_1.default.dim(opt.description)}`);
                }
            }
        }
        console.error(`     ${chalk_1.default.dim("Answer:")} mycontext questions:answer ${q.id} <value>`);
    }
    console.error();
});
//# sourceMappingURL=questions-blockers.js.map