/**
 * Multi-Agent Debate — Dual LLM in orient/decide phases.
 *
 * Pattern: Strategist (thesis) + Skeptic (antithesis) → Synthesizer → synthesis.
 *
 * The debate engine runs two adversarial LLM stances against each other
 * and produces a consensus score + plan. Used for high-stakes decisions
 * where a single LLM's blind spots are unacceptable (legal review,
 * financial allocation, security decisions).
 *
 * Reference: command-center/docs/specs/debate-engine-spec.md
 *
 * @public
 */
// ─── Engine ─────────────────────────────────────────────────────────────────────
/**
 * Run a multi-agent debate.
 *
 * 1. Strategist proposes thesis
 * 2. Skeptic challenges with antithesis
 * 3. Synthesizer merges into consensus + recommendation
 *
 * If `maxRounds > 1`, the thesis and antithesis are fed back for refinement.
 */
export async function runDebate(config) {
    const maxRounds = config.maxRounds ?? 1;
    let thesis = await config.strategist(config.question, config.context);
    let antithesis = await config.skeptic(config.question, thesis, config.context);
    // Multi-round refinement
    for (let round = 1; round < maxRounds; round++) {
        // Refine thesis against antithesis
        thesis = await config.strategist(`${config.question}\n\nCounterarguments to address:\n${antithesis.content}`, config.context);
        // Refine antithesis against refined thesis
        antithesis = await config.skeptic(`${config.question}\n\nUpdated thesis to challenge:\n${thesis.content}`, thesis, config.context);
    }
    const synthesis = await config.synthesizer(config.question, thesis, antithesis, config.context);
    return { thesis, antithesis, synthesis, rounds: maxRounds };
}
//# sourceMappingURL=debate.js.map