"use strict";
// Council adapter — bridges the pure model council to the harness's chat
// clients (OllamaClient / OpenAIClient via IChatClient).
Object.defineProperty(exports, "__esModule", { value: true });
exports.runCouncilForChat = runCouncilForChat;
const modelCouncil_1 = require("./modelCouncil");
/**
 * Run a model council against a single user prompt using the supplied
 * chat client factory. Each member spins up its own client (or reuses one
 * from the factory) so the parallel dispatch is genuine.
 */
async function runCouncilForChat(prompt, options, factory) {
    const invoke = async (model, p) => {
        const client = factory(model);
        const result = await client.chat([{ role: 'user', content: p }], [], undefined);
        const message = result.message?.content ?? '';
        return typeof message === 'string' ? message : JSON.stringify(message);
    };
    return (0, modelCouncil_1.runCouncil)(prompt, options, invoke);
}
//# sourceMappingURL=councilAdapter.js.map