import { projectRoot } from '../core/fsx.js';
import { formatHarnessConflictReport, llmHarnessCleanupPrompt, scanHarnessConflicts } from '../core/harness-conflicts.js';
import { flag } from '../cli/args.js';
import { printJson } from '../cli/output.js';
export async function run(_command, args = []) {
    const action = args[0] || 'check';
    const scan = await scanHarnessConflicts(await projectRoot());
    const result = { ...scan, cleanup_prompt: scan.hard_block ? llmHarnessCleanupPrompt(scan) : null };
    if (flag(args, '--json'))
        return printJson(result);
    if (action === 'prompt')
        return console.log(result.cleanup_prompt || '');
    console.log(formatHarnessConflictReport(scan));
    if (scan.hard_block)
        process.exitCode = 1;
}
//# sourceMappingURL=conflicts.js.map