use std::collections::HashMap; use crate::ids::{AgentId, FileId, RunId, ThreadId}; use crate::message::RunStatus; #[derive(Clone, Debug)] pub struct AgentRecord { pub agent_id: AgentId, pub agent_name: String, pub file_ids: Vec, pub thread_ids: Vec, } impl AgentRecord { pub fn new(agent_id: AgentId, agent_name: String) -> Self { Self { agent_id, agent_name, file_ids: Vec::new(), thread_ids: Vec::new(), } } } #[derive(Clone, Debug)] pub struct ThreadRecord { pub agent_id: AgentId, pub thread_id: ThreadId, pub most_recent_run_id: Option, pub most_recent_run_status: Option, } #[derive(Clone, Debug, Default)] pub struct OrchestratorState { pub agents: HashMap, pub threads: HashMap, pub active_agent: Option, pub active_thread: Option, } impl OrchestratorState { pub fn dispatch_state(&self) -> DispatchState { DispatchState { active_agent: self.active_agent.clone(), active_thread: self.active_thread.clone(), } } } #[derive(Clone, Debug, Default)] pub struct DispatchState { pub active_agent: Option, pub active_thread: Option, }