MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / list_primary

Method list_primary

crates/opencode-agent/src/agent.rs:638–656  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

636 }
637
638 pub fn list_primary(&self) -> Vec<&AgentInfo> {
639 let mut agents: Vec<&AgentInfo> = self
640 .agents
641 .values()
642 .filter(|a| matches!(a.mode, AgentMode::Primary) && !a.hidden)
643 .collect();
644 agents.sort_by(|a, b| {
645 let a_is_build = a.name == "build";
646 let b_is_build = b.name == "build";
647 if a_is_build {
648 return std::cmp::Ordering::Less;
649 }
650 if b_is_build {
651 return std::cmp::Ordering::Greater;
652 }
653 a.name.cmp(&b.name)
654 });
655 agents
656 }
657
658 pub fn list_subagents(&self) -> Vec<&AgentInfo> {
659 let mut agents: Vec<&AgentInfo> = self

Callers

nothing calls this directly

Calls 1

filterMethod · 0.45

Tested by

no test coverage detected