"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SemanticsDiffCommand = void 0;
const commander_1 = require("commander");
const chalk_1 = __importDefault(require("chalk"));
const LivingDictionary_1 = require("../services/LivingDictionary");
exports.SemanticsDiffCommand = new commander_1.Command("semantics:diff")
    .description("Show changes in the semantic dictionary since last save")
    .option("--json", "output as JSON")
    .action(async (options) => {
    const dict = new LivingDictionary_1.LivingDictionary();
    await dict.load();
    const allTerms = dict.getAllTerms();
    const conflicts = dict.getConflicts();
    console.log(chalk_1.default.bold("\n📊 Semantic Dictionary State"));
    console.log(chalk_1.default.dim("─".repeat(50)));
    console.log(`  ${chalk_1.default.cyan("Terms:")}     ${allTerms.length}`);
    console.log(`  ${chalk_1.default.cyan("Conflicts:")} ${conflicts.length}`);
    if (conflicts.length > 0) {
        console.log(chalk_1.default.dim("\n  Active conflicts:"));
        for (const c of conflicts) {
            console.log(`     · ${chalk_1.default.yellow(c.term)}`);
        }
    }
    const byCategory = {};
    for (const [, entry] of dict.getEntries()) {
        byCategory[entry.category] = (byCategory[entry.category] || 0) + 1;
    }
    if (Object.keys(byCategory).length > 0) {
        console.log(chalk_1.default.dim("\n  By category:"));
        for (const [cat, count] of Object.entries(byCategory)) {
            console.log(`     · ${cat}: ${count}`);
        }
    }
    console.log();
});
//# sourceMappingURL=semantics-diff.js.map