"use strict";
/**
 * Command Execution Contract
 *
 * Standardized lifecycle: parse -> validate -> execute -> render
 * for CLI command handlers.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.runCommandWithContract = void 0;
/**
 * Run a command through the standard lifecycle.
 */
async function runCommandWithContract(rawArgs, contract) {
    const parsedArgs = contract.parse(rawArgs);
    await contract.validate(parsedArgs);
    const result = await contract.execute(parsedArgs);
    await contract.render(result, { rawArgs, parsedArgs });
    return { parsedArgs, result };
}
exports.runCommandWithContract = runCommandWithContract;
//# sourceMappingURL=command-execution-contract.js.map