import type { PortableToolSet } from './portable'; import type { PluginInput } from '@opencode-ai/plugin'; import type { createOpencodeClient } from '@opencode-ai/sdk'; import { type CouncillorSummary, type ConsensusInput, type ConsensusResult, type RetryAction, RETRY_LIMITS, tokenize, jaccard, downgradeVariant, pairwiseAgreement, computeConsensus, decideRetryAction, appendRetryContext, classifyFailure, extractCouncillorSummary, RetryBudget } from '../shared/consensus.js'; export { type CouncillorSummary, type ConsensusInput, type ConsensusResult, type RetryAction, RETRY_LIMITS, tokenize, jaccard, pairwiseAgreement, computeConsensus, decideRetryAction, downgradeVariant, appendRetryContext, extractCouncillorSummary, classifyFailure, RetryBudget, }; export interface CouncillorConfig { /** "provider/model" */ model: string; /** "max" | "high" | "medium" | "low" */ variant?: string; /** Optional per-councillor prompt prefix */ prompt?: string; } export interface CouncilPreset { [councillorName: string]: CouncillorConfig; } export interface CouncilConfig { /** Preset map (e.g. { default: { expert1: {...}, expert2: {...} } }) */ presets: Record; /** Per-councillor timeout in ms (default: 180000) */ timeout?: number; /** Default preset name (default: "default") */ default_preset?: string; /** Execution mode (default: "parallel") */ councillor_execution_mode?: 'parallel' | 'serial'; /** Retry budget for empty responses (default: 3) */ councillor_retries?: number; /** Consensus agreement threshold 0-1 for convergence (default: 0.6) */ consensus_threshold?: number; /** Hard cap on serial rounds (default: 2) */ max_rounds?: number; /** Global retry budget shared by all councillors (default: 6) */ max_total_retries?: number; /** Global elapsed budget for a whole council run in ms (default: 3 * timeout) */ max_elapsed_ms?: number; } /** Internal councillor result shape */ interface CouncillorResult { name: string; model: string; status: string; result?: string; error?: string; /** Optional structured summary used for consensus detection */ summary?: CouncillorSummary; } export declare class CouncilManager { private client; private directory; private config; constructor(client: ReturnType, directory: string, config: CouncilConfig); /** * Run a full council session. * Resolves a preset, runs all councillors, and returns formatted results. */ runCouncil(prompt: string, presetName?: string, parentSessionId?: string): Promise<{ success: boolean; result?: string; error?: string; councillorResults: CouncillorResult[]; consensus?: boolean; agreement?: number; }>; private runCouncillors; private runCouncillorWithRetry; private runAgentSession; } /** * Create the `council_session` tool definition. * * The tool launches a multi-LLM council: multiple councillors run in parallel * against their assigned models, and their responses are assembled into a * structured block for the calling (co-council) agent to synthesize. * * Only the `co-council` agent is allowed to invoke this tool. */ export declare function createCouncilTool(ctx: PluginInput, councilManager: CouncilManager): PortableToolSet; //# sourceMappingURL=council.d.ts.map