/** * Multi-Agent Coordination System - Type Definitions */ export type AgentRole = "ALPHA" | "BETA" | "GAMMA"; export type AgentStatus = "IDLE" | "WORKING" | "WAITING" | "BLOCKED" | "COMPLETED" | "FAILED"; export type MessageType = "PROPOSAL" | "FEEDBACK" | "QUERY" | "RESPONSE" | "SYNC" | "HANDOFF" | "SPAWN_REQUEST"; export type BlackboardSection = "problem" | "solutions" | "constraints" | "progress" | "conflicts" | "consensus"; export interface AgentMessage { id: string; from: AgentRole; to: AgentRole | "ALL" | "BLACKBOARD"; type: MessageType; payload: any; timestamp: string; correlation_id?: string; } export interface BlackboardEntry { section: BlackboardSection; key: string; value: any; author: AgentRole; version: number; timestamp: string; supersedes?: string; } export interface AgentState { agent_id: string; role: AgentRole; status: AgentStatus; current_task: string; progress: number; confidence: number; last_activity: string; messages_sent: number; messages_received: number; proposals_made: number; conflicts_detected: number; blocked_since?: string; } export interface CoordinationMetrics { task_id: string; start_time: string; end_time?: string; total_messages: number; direct_messages: number; blackboard_writes: number; blackboard_reads: number; conflicts_detected: number; conflicts_resolved: number; gamma_spawned: boolean; gamma_spawn_reason?: string; gamma_spawn_time?: string; final_consensus: boolean; performance_score: number; } export interface SpawnCondition { type: "STUCK" | "CONFLICT" | "COMPLEXITY" | "SUCCESS" | "MANUAL"; threshold: number; current_value: number; triggered: boolean; description: string; } export interface TaskDefinition { task_id: string; objective: string; complexity: "low" | "medium" | "high" | "extreme"; subtasks: { id: string; description: string; assigned_to?: AgentRole; status: "pending" | "in_progress" | "completed" | "blocked"; dependencies: string[]; }[]; constraints: string[]; success_criteria: string[]; timeout_seconds: number; } export interface ConsensusVote { agent: AgentRole; proposal_id: string; vote: "ACCEPT" | "REJECT" | "ABSTAIN"; reasoning: string; timestamp: string; }