MCPcopy Create free account
hub / github.com/GCWing/BitFun / show_agent_selector

Method show_agent_selector

src/apps/cli/src/modes/chat.rs:2201–2222  ·  view source on GitHub ↗

Show agent selector popup with all available agent modes

(
        &self,
        chat_view: &mut ChatView,
        chat_state: &mut ChatState,
        rt_handle: &tokio::runtime::Handle,
    )

Source from the content-addressed store, hash-verified

2199
2200 /// Show agent selector popup with all available agent modes
2201 fn show_agent_selector(
2202 &self,
2203 chat_view: &mut ChatView,
2204 chat_state: &mut ChatState,
2205 rt_handle: &tokio::runtime::Handle,
2206 ) {
2207 let modes = self.get_mode_agents(rt_handle);
2208 if modes.is_empty() {
2209 chat_state.add_system_message("No mode agents available".to_string());
2210 return;
2211 }
2212
2213 let agent_items: Vec<AgentItem> = modes
2214 .into_iter()
2215 .map(|m| AgentItem {
2216 id: m.id,
2217 description: m.description,
2218 })
2219 .collect();
2220
2221 chat_view.show_agent_selector(agent_items, Some(self.agent_type.clone()));
2222 }
2223
2224 /// Apply agent selection: switch agent type
2225 fn apply_agent_selection(&mut self, selected: &AgentItem, chat_state: &mut ChatState) {

Callers 2

handle_palette_actionMethod · 0.45
handle_commandMethod · 0.45

Calls 5

add_system_messageMethod · 0.80
collectMethod · 0.80
get_mode_agentsMethod · 0.45
is_emptyMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected