feat: introduce workflow management tools and commands

- Added new workflow commands: `/workflow` to open the workflow panel and `/workflow run <prompt>` to execute workflows.
- Implemented `spawn_agents` and `spawn_pipeline` tools for parallel and sequential task execution, respectively.
- Enhanced workflow engine to handle real-time agent status updates and display in the UI.
- Updated workflow panel to show agent statuses, findings count, and session counters.
- Refactored existing code to integrate new workflow functionalities and improve overall structure.
This commit is contained in:
asepharyana
2026-07-12 17:49:34 +07:00
parent 7bdfd9c4c4
commit 53b0cb271f
14 changed files with 668 additions and 173 deletions
+6 -4
View File
@@ -18,12 +18,13 @@ pub struct SubagentContext {
/// Build a `SubagentContext` from an `AgentDefinition`.
///
/// Flow: copy optional `allowed_tools` from the def -> fall back to the
/// reviewer-allowlist when the def has none and the role is "reviewer" ->
/// Flow: copy optional `allowed_tools` from the def fall back to the
/// reviewer-allowlist when the def has none and the role is "reviewer"
/// fall back to an empty list (i.e. "all tools allowed") for other roles.
/// `max_steps` is read from the definition, defaulting to 25 if absent.
///
/// Return: a context with empty `system_prompt` and `session_dir`,
/// `max_steps = 25`, and the resolved allowed-tool list.
/// resolved `max_steps`, and the resolved allowed-tool list.
pub fn build_subagent_context(def: AgentDefinition) -> SubagentContext {
let allowed_tools = def.allowed_tools.clone().unwrap_or_else(|| {
if def.role == "reviewer" {
@@ -32,10 +33,11 @@ pub fn build_subagent_context(def: AgentDefinition) -> SubagentContext {
Vec::new()
}
});
let max_steps = def.max_steps.unwrap_or(25);
SubagentContext {
system_prompt: String::new(),
allowed_tools,
max_steps: 25,
max_steps,
session_dir: PathBuf::new(),
}
}