"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExecuteCommand = void 0;
const commander_1 = require("commander");
const chalk_1 = __importDefault(require("chalk"));
const PipelineOrchestrator_1 = require("../services/PipelineOrchestrator");
exports.ExecuteCommand = new commander_1.Command("execute")
    .description("Execute the full semantic-to-execution pipeline")
    .argument("[prompt]", "natural language prompt for feature generation")
    .option("--feature <id>", "execute a specific feature by ID (skip stages 1-4)")
    .option("--all", "execute all pending features")
    .action(async (prompt, options) => {
    const orchestrator = new PipelineOrchestrator_1.PipelineOrchestrator();
    if (options.feature) {
        console.log(chalk_1.default.bold(`\n🔷 Executing feature: ${options.feature}`));
        const result = await orchestrator.executeFromPrompt(`Execute feature ${options.feature}`);
        await orchestrator.displayResult(result);
        return;
    }
    if (options.all) {
        console.log(chalk_1.default.bold("\n🔷 Executing all pending features..."));
        const result = await orchestrator.executeFromPrompt("Execute all pending features");
        await orchestrator.displayResult(result);
        return;
    }
    if (!prompt) {
        console.error(chalk_1.default.yellow("\n  Please provide a prompt or use --feature / --all\n"));
        process.exit(1);
    }
    console.log(chalk_1.default.bold(`\n🔷 Processing: "${prompt}"`));
    const result = await orchestrator.executeFromPrompt(prompt);
    await orchestrator.displayResult(result);
});
//# sourceMappingURL=execute.js.map