/** * ThreadWeaver — Multi-Agent Debate Protocol * All TypeScript type definitions. */ export type ComplexityLevel = "standard" | "heavy"; export interface ThreadWeaverConfig { debateRounds: number; heavyThreshold: number; forceComplexity: ComplexityLevel | null; model: string | null; activationThreshold: number; roundTimeoutMs: number; totalTimeoutMs: number; saveLedger: boolean; } export declare const DEFAULT_THREADWEAVER_CONFIG: ThreadWeaverConfig; export interface AgentRole { id: string; role: string; grokEquiv: string; focus: string; /** Domain keywords for sparse activation relevance scoring */ domains: string[]; /** For specialist agents, reference to the core role they extend */ parentRole?: string; } export type RoundType = "analysis" | "critique" | "revision"; export interface AgentOutput { agentId: string; role: string; content: string; selfConfidence: number; durationMs: number; error?: string; } export interface Critique { criticId: string; targetId: string; /** -1 (disagree), 0 (neutral), 1 (agree) */ agreement: number; issues: string[]; strengths: string[]; } export interface RoundResult { roundNumber: number; roundType: RoundType; outputs: AgentOutput[]; critiques?: Critique[]; durationMs: number; } export interface AgentWeight { agentId: string; role: string; selfConfidence: number; crossAgreement: number; domainRelevance: number; finalWeight: number; } export interface Dissent { topic: string; positions: Array<{ agentId: string; position: string; }>; } export interface ThreadWeaverResult { query: string; complexity: ComplexityLevel; activatedAgents: string[]; rounds: RoundResult[]; weights: AgentWeight[]; synthesis: string; dissents: Dissent[]; totalDurationMs: number; partial?: boolean; } export interface ComplexityAnalysis { level: ComplexityLevel; score: number; activatedAgents: AgentRole[]; }