import { ConsensusProposal, ConsensusVote, ConsensusResult, TrustScore } from '../types.js'; type Verdict = 'accepted' | 'rejected' | 'conflict' | 'pending'; /** * ConsensusEngine — multi-agent agreement protocol. * * When multiple AI agents observe the same codebase, they may produce * conflicting insights. This engine: * * 1. Collects proposals from agents * 2. Opens voting windows where agents vote accept/reject with confidence * 3. Computes agreement scores and confidence intervals * 4. Resolves conflicts via weighted trust scores * 5. Tracks long-term trust for each agent based on proposal accuracy */ export declare class ConsensusEngine { private proposals; private votes; private results; private trustScores; private pendingTimers; private storeDir; private agentId; constructor(agentId?: string, customDir?: string); /** Submit a new proposal for consensus */ propose(content: string, category: string, confidence: number, evidence?: string[]): string; /** Vote on a proposal */ vote(proposalId: string, vote: 'agree' | 'disagree' | 'abstain', confidence: number, reasoning: string): boolean; /** Process an incoming vote from a remote agent */ receiveVote(vote: ConsensusVote): boolean; /** Resolve a proposal by computing consensus */ resolveProposal(proposalId: string): ConsensusResult | null; private getTrustScore; getTrustScores(): TrustScore[]; private updateTrustFromResult; /** Manually adjust trust for an agent (e.g., human override) */ setTrust(agentId: string, score: number): void; /** Get result for a specific proposal */ getResult(proposalId: string): ConsensusResult | undefined; /** Get all proposals with a specific verdict */ getByVerdict(verdict: Verdict): ConsensusResult[]; /** Get proposals by category */ getByCategory(category: string): ConsensusProposal[]; /** Get pending proposals (not yet resolved) */ getPending(): ConsensusProposal[]; getStats(): { totalProposals: number; acceptedCount: number; rejectedCount: number; conflictCount: number; pendingCount: number; averageAgreement: number; agentCount: number; topTrustedAgents: Array<{ agent: string; score: number; accuracy: number; }>; }; private persistToDisk; private loadFromDisk; /** Clean up timers */ dispose(): void; } export {}; //# sourceMappingURL=consensus-engine.d.ts.map