use klasp_agents_claude::ClaudeCodeSurface;
use klasp_agents_codex::CodexSurface;
use klasp_core::AgentSurface;
pub struct SurfaceRegistry {
surfaces: Vec<Box<dyn AgentSurface>>,
}
impl Default for SurfaceRegistry {
fn default() -> Self {
Self {
surfaces: vec![Box::new(ClaudeCodeSurface), Box::new(CodexSurface)],
}
}
}
impl SurfaceRegistry {
pub fn iter(&self) -> impl Iterator<Item = &dyn AgentSurface> {
self.surfaces.iter().map(|s| s.as_ref())
}
pub fn agent_ids(&self) -> Vec<&'static str> {
self.surfaces.iter().map(|s| s.agent_id()).collect()
}
pub fn get(&self, agent_id: &str) -> Option<&dyn AgentSurface> {
self.surfaces
.iter()
.map(|s| s.as_ref())
.find(|s| s.agent_id() == agent_id)
}
}