"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SyncREADMECommand = void 0;
const chalk_1 = __importDefault(require("chalk"));
const ContextSyncer_1 = require("../services/ContextSyncer");
/**
 * SyncREADMECommand: Synchronizes the project's root README.md with the Living Brain.
 * This is a thin wrapper around ContextSyncer for better CLI ergonomics.
 */
class SyncREADMECommand {
    async execute(options) {
        const rootPath = options.project || process.cwd();
        try {
            // Use the unified ContextSyncer engine for all sync operations
            const syncer = new ContextSyncer_1.ContextSyncer(rootPath);
            console.log(chalk_1.default.blue.bold("🔄 Synchronizing README with Living Brain..."));
            const result = await syncer.syncReadme({ dryRun: false });
            if (result.readmeUpdated) {
                console.log(chalk_1.default.green("✅ README.md synchronized with latest context!"));
            }
            else {
                console.log(chalk_1.default.yellow(`⚠️  README sync skipped: ${result.readmeDiff}`));
            }
        }
        catch (error) {
            console.error(chalk_1.default.red("❌ README synchronization failed:"), error);
        }
    }
}
exports.SyncREADMECommand = SyncREADMECommand;
//# sourceMappingURL=sync-readme.js.map