codetether_agent/tui/app/state/
agent_profile.rs1use crate::session::Session;
7
8use super::profile_defs::{self, AgentProfile, *};
9
10#[allow(dead_code)]
12pub struct SpawnedAgent {
13 pub name: String,
15 pub instructions: String,
17 pub session: Session,
19 pub is_processing: bool,
21}
22
23pub fn agent_profile(agent_name: &str) -> AgentProfile {
25 let normalized = agent_name.to_ascii_lowercase();
26
27 if normalized.contains("planner") {
28 return PROFILE_PLANNER;
29 }
30 if normalized.contains("research") {
31 return PROFILE_RESEARCH;
32 }
33 if normalized.contains("coder") || normalized.contains("implement") {
34 return PROFILE_CODER;
35 }
36 if normalized.contains("review") {
37 return PROFILE_REVIEW;
38 }
39 if normalized.contains("tester") || normalized.contains("test") {
40 return PROFILE_TESTER;
41 }
42 if normalized.contains("integrat") {
43 return PROFILE_INTEGRATOR;
44 }
45 if normalized.contains("skeptic") || normalized.contains("risk") {
46 return PROFILE_SKEPTIC;
47 }
48 if normalized.contains("summary") || normalized.contains("summarizer") {
49 return PROFILE_SUMMARIZER;
50 }
51
52 let mut hash: u64 = 2_166_136_261;
54 for byte in normalized.bytes() {
55 hash = (hash ^ u64::from(byte)).wrapping_mul(16_777_619);
56 }
57 FALLBACK_PROFILES[hash as usize % FALLBACK_PROFILES.len()]
58}