#[derive(Debug, Clone)]
pub struct BrainConfig {
pub enabled: bool,
pub endpoint: String,
pub model: String,
pub auto_mode: bool,
pub timeout_ms: u64,
pub max_context_tokens: u32,
pub few_shot_count: usize,
pub max_sessions: usize,
pub orchestrate: bool,
pub orchestrate_interval_secs: u64,
pub test_runners: Vec<String>,
}
pub fn default_test_runners() -> Vec<String> {
[
"cargo test",
"cargo nextest",
"npm test",
"npm run test",
"pnpm test",
"yarn test",
"bun test",
"pytest",
"go test",
"jest",
"vitest",
"mix test",
"rspec",
]
.iter()
.map(|s| s.to_string())
.collect()
}
impl Default for BrainConfig {
fn default() -> Self {
Self {
enabled: true,
endpoint: "http://localhost:11434/api/generate".into(),
model: "gemma4:e4b".into(),
auto_mode: false,
timeout_ms: 5000,
max_context_tokens: 4000,
few_shot_count: 5,
max_sessions: 10,
orchestrate: false,
orchestrate_interval_secs: 30,
test_runners: default_test_runners(),
}
}
}
#[allow(dead_code)]
#[derive(Debug, Clone)]
pub struct IdleConfig {
pub enabled: bool,
pub after_idle_mins: u64,
pub max_concurrent: usize,
pub max_cost_usd: f64,
pub tasks: Vec<IdleTask>,
}
#[allow(dead_code)]
#[derive(Debug, Clone)]
pub struct IdleTask {
pub prompt: String,
pub cwd: Option<String>,
pub priority: u32,
}
impl Default for IdleConfig {
fn default() -> Self {
Self {
enabled: false,
after_idle_mins: 15,
max_concurrent: 2,
max_cost_usd: 5.0,
tasks: Vec::new(),
}
}
}