2026-07-16 12:32:17 +07:00
|
|
|
#![allow(dead_code)]
|
2026-07-12 11:28:39 +07:00
|
|
|
//! Hardcoded built-in subagent definitions (coder, reviewer, researcher, planner).
|
2026-07-11 13:16:10 +07:00
|
|
|
use crate::app::subagent::spawn::AgentDefinition;
|
|
|
|
|
|
2026-07-12 11:28:39 +07:00
|
|
|
/// Build the fixed list of built-in agent definitions shipped with zesdex.
|
|
|
|
|
///
|
|
|
|
|
/// Flow: construct each `AgentDefinition` with a name, system prompt, and
|
|
|
|
|
/// allowed tool list, then collect into a `Vec`.
|
|
|
|
|
///
|
|
|
|
|
/// Why: these agents are always available regardless of global/session
|
|
|
|
|
/// config, giving users a baseline set of roles out of the box.
|
|
|
|
|
///
|
|
|
|
|
/// Return: a freshly-built `Vec<AgentDefinition>` (coder, reviewer,
|
|
|
|
|
/// researcher, planner).
|
2026-07-11 13:16:10 +07:00
|
|
|
pub fn builtin_agents() -> Vec<AgentDefinition> {
|
|
|
|
|
vec![
|
|
|
|
|
AgentDefinition::new(
|
|
|
|
|
"coder".to_string(),
|
|
|
|
|
"coder".to_string(),
|
|
|
|
|
).with_system_prompt(
|
|
|
|
|
"You are a coding agent. Write correct, idiomatic Rust code.".to_string()
|
|
|
|
|
).with_allowed_tools(
|
|
|
|
|
vec![
|
|
|
|
|
"read".to_string(),
|
|
|
|
|
"write".to_string(),
|
|
|
|
|
"edit".to_string(),
|
|
|
|
|
"bash".to_string(),
|
|
|
|
|
"grep".to_string(),
|
|
|
|
|
"glob".to_string(),
|
|
|
|
|
"git_operator".to_string(),
|
2026-07-12 14:47:01 +07:00
|
|
|
"lsp_connect".to_string(),
|
|
|
|
|
"lsp_diagnostics".to_string(),
|
|
|
|
|
"lsp_hover".to_string(),
|
|
|
|
|
"lsp_definition".to_string(),
|
|
|
|
|
"lsp_references".to_string(),
|
|
|
|
|
"lsp_completion".to_string(),
|
|
|
|
|
"lsp_disconnect".to_string(),
|
2026-07-11 13:16:10 +07:00
|
|
|
]
|
2026-07-12 04:01:10 +07:00
|
|
|
).with_max_steps(usize::MAX),
|
2026-07-11 13:16:10 +07:00
|
|
|
|
|
|
|
|
AgentDefinition::new(
|
|
|
|
|
"reviewer".to_string(),
|
|
|
|
|
"reviewer".to_string(),
|
|
|
|
|
).with_system_prompt(
|
|
|
|
|
"You are a code reviewer. Focus on correctness, safety, and performance.".to_string()
|
|
|
|
|
).with_allowed_tools(
|
|
|
|
|
vec![
|
|
|
|
|
"read".to_string(),
|
|
|
|
|
"grep".to_string(),
|
|
|
|
|
"glob".to_string(),
|
|
|
|
|
"recall".to_string(),
|
|
|
|
|
"remember".to_string(),
|
2026-07-12 14:47:01 +07:00
|
|
|
"lsp_diagnostics".to_string(),
|
|
|
|
|
"lsp_hover".to_string(),
|
|
|
|
|
"lsp_definition".to_string(),
|
|
|
|
|
"lsp_references".to_string(),
|
2026-07-11 13:16:10 +07:00
|
|
|
]
|
2026-07-12 04:01:10 +07:00
|
|
|
).with_max_steps(usize::MAX),
|
2026-07-11 13:16:10 +07:00
|
|
|
|
|
|
|
|
AgentDefinition::new(
|
|
|
|
|
"researcher".to_string(),
|
|
|
|
|
"researcher".to_string(),
|
|
|
|
|
).with_system_prompt(
|
2026-07-16 12:32:17 +07:00
|
|
|
"You are a research agent. Search for information and summarize findings.".to_string()
|
2026-07-11 13:16:10 +07:00
|
|
|
).with_allowed_tools(
|
|
|
|
|
vec![
|
|
|
|
|
"read".to_string(),
|
|
|
|
|
"grep".to_string(),
|
|
|
|
|
"glob".to_string(),
|
2026-07-16 12:32:17 +07:00
|
|
|
"bash".to_string(),
|
|
|
|
|
"search_web".to_string(),
|
|
|
|
|
"fetch_url".to_string(),
|
2026-07-11 13:16:10 +07:00
|
|
|
]
|
2026-07-12 04:01:10 +07:00
|
|
|
).with_max_steps(usize::MAX),
|
2026-07-11 13:16:10 +07:00
|
|
|
|
|
|
|
|
AgentDefinition::new(
|
|
|
|
|
"planner".to_string(),
|
|
|
|
|
"planner".to_string(),
|
|
|
|
|
).with_system_prompt(
|
|
|
|
|
"You are a planning agent. Break down tasks into clear steps.".to_string()
|
|
|
|
|
).with_allowed_tools(
|
|
|
|
|
vec![
|
|
|
|
|
"read".to_string(),
|
2026-07-16 12:32:17 +07:00
|
|
|
"write".to_string(),
|
|
|
|
|
"edit".to_string(),
|
|
|
|
|
"bash".to_string(),
|
|
|
|
|
"todo_write".to_string(),
|
|
|
|
|
"todo_finish".to_string(),
|
2026-07-11 13:16:10 +07:00
|
|
|
]
|
2026-07-12 04:01:10 +07:00
|
|
|
).with_max_steps(usize::MAX),
|
2026-07-11 13:16:10 +07:00
|
|
|
]
|
|
|
|
|
}
|