/** One council member: a model running under a role with a prior weight. */ export interface CouncilMemberSpec { model: string; role: string; weight: number; } /** The task the council answers. Generic so /code-review etc. can reuse it. */ export interface CouncilTaskSpec { question: string; context?: string; rubric?: string; rolePack?: string; members?: CouncilMemberSpec[]; minSurvivors?: number; perMemberTimeoutMs?: number; synthTimeoutMs?: number; synthesizerModel?: string; probe?: boolean; maxConcurrency?: number; tmpDir?: string; } /** What each member MUST emit (the member JSON contract). */ export interface CouncilMemberOutput { verdict: string; confidence: number; rationale: string; risks?: string[]; dissent?: string; } /** Per-member runtime classification. "unavailable" is distinct from "error". */ export type CouncilMemberStatus = "ok" | "timeout" | "error" | "unavailable" | "unparseable"; /** Per-member runtime result (engine-internal, surfaced in --json). */ export interface CouncilMemberResult { spec: CouncilMemberSpec; status: CouncilMemberStatus; output?: CouncilMemberOutput; rawStdout?: string; rawStderr?: string; exitCode?: number; durationMs: number; dropReason?: string; jsonPath?: string; } export interface CouncilPerMemberSummary { model: string; role: string; weight: number; verdict: string; confidence: number; dropped: boolean; dropReason?: string; } /** Synthesizer output schema (final verdict). */ export interface CouncilSynthOutput { verdict: string; confidence: number; rationale: string; minority_report: string; per_member_summary: CouncilPerMemberSummary[]; } /** Top-level engine result (what runCouncil returns / cli prints). */ export interface CouncilRunResult { ok: boolean; synth?: CouncilSynthOutput; members: CouncilMemberResult[]; survivors: number; dropped: number; tmpDir: string; error?: string; } /** Resolved configuration after merging spec > config > built-in default. */ export interface ResolvedCouncilConfig { members: CouncilMemberSpec[]; synthesizerModel: string; minSurvivors: number; perMemberTimeoutMs: number; synthTimeoutMs: number; maxConcurrency: number; probe: boolean; } export interface SpawnRequest { model: string; prompt: string; timeoutMs: number; } export interface SpawnResponse { stdout: string; stderr: string; exitCode: number; timedOut: boolean; } /** Real impl spawns `copilot --model -p `; tests inject a fake. */ export type CouncilSpawn = (req: SpawnRequest) => Promise; /** stderr signature copilot emits when a --model slug is not entitled to the plan. */ export declare const UNAVAILABLE_SIGNATURE: RegExp; /** * True only for an entitlement failure (model not available to this plan), not a * transient crash/timeout. Lives here (a leaf module) so both the council and * the copilot model-probing utilities share one detector without a cycle. */ export declare function isModelUnavailable(res: SpawnResponse): boolean; export interface CouncilDeps { spawn: CouncilSpawn; now?: () => number; writeArtifact?: (path: string, data: string) => void; }