"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PlanContextCommand = void 0;
const chalk_1 = __importDefault(require("chalk"));
const agent_1 = require("./agent");
class PlanContextCommand {
    register(program) {
        program
            .command("plan:context [prompt]")
            .description("Evolve the Living Brain (context.json + Markdown) from a narrative prompt")
            .option("-e, --execute", "Apply the proposed changes to the manifest and refresh docs")
            .option("-y, --yes", "Skip confirmation prompts")
            .action(async (prompt, options) => {
            try {
                const agentCommand = new agent_1.AgentCommand();
                // We reuse the AgentCommand logic as it already implements the Top-Down evolution
                await agentCommand.execute({
                    prompt,
                    execute: options.execute,
                    yes: options.yes
                });
            }
            catch (error) {
                console.error(chalk_1.default.red("❌ Context planning failed:"), error);
                process.exit(1);
            }
        });
    }
}
exports.PlanContextCommand = PlanContextCommand;
//# sourceMappingURL=plan-context.js.map