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

Method new

crates/opencode-tui/src/components/dialogs/agent_select.rs:25–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23
24impl AgentSelectDialog {
25 pub fn new() -> Self {
26 let agents = vec![
27 Agent {
28 name: "build".into(),
29 description: "Code generation and modification".into(),
30 color: ratatui::style::Color::Cyan,
31 },
32 Agent {
33 name: "oracle".into(),
34 description: "Read-only consultation".into(),
35 color: ratatui::style::Color::Magenta,
36 },
37 Agent {
38 name: "metis".into(),
39 description: "Pre-planning analysis".into(),
40 color: ratatui::style::Color::Yellow,
41 },
42 Agent {
43 name: "momus".into(),
44 description: "Expert reviewer".into(),
45 color: ratatui::style::Color::Green,
46 },
47 Agent {
48 name: "explore".into(),
49 description: "Codebase exploration".into(),
50 color: ratatui::style::Color::Blue,
51 },
52 Agent {
53 name: "librarian".into(),
54 description: "Documentation lookup".into(),
55 color: ratatui::style::Color::Rgb(180, 100, 255),
56 },
57 ];
58
59 let mut state = ListState::default();
60 state.select(Some(0));
61
62 Self {
63 agents,
64 state,
65 open: false,
66 }
67 }
68
69 pub fn set_agents(&mut self, agents: Vec<Agent>) {
70 self.agents = agents;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected