2026-07-12 11:28:39 +07:00
|
|
|
//! Event variants that a running subagent can emit to its parent via the
|
|
|
|
|
//! shared mpsc channel.
|
|
|
|
|
|
2026-07-11 13:16:10 +07:00
|
|
|
use serde_json::Value;
|
|
|
|
|
|
2026-07-12 11:28:39 +07:00
|
|
|
/// Progress and outcome events emitted by `run_subagent` as it processes
|
|
|
|
|
/// LLM responses and tool calls.
|
2026-07-11 13:16:10 +07:00
|
|
|
#[derive(Debug, Clone)]
|
|
|
|
|
pub enum SubagentEvent {
|
|
|
|
|
StepCompleted {
|
2026-07-13 08:12:02 +07:00
|
|
|
#[allow(dead_code)]
|
|
|
|
|
step: usize,
|
|
|
|
|
#[allow(dead_code)]
|
|
|
|
|
output: String,
|
2026-07-11 13:16:10 +07:00
|
|
|
},
|
|
|
|
|
StepFailed {
|
2026-07-13 08:12:02 +07:00
|
|
|
step: usize,
|
|
|
|
|
error: String,
|
2026-07-11 13:16:10 +07:00
|
|
|
},
|
|
|
|
|
Completed {
|
2026-07-13 08:12:02 +07:00
|
|
|
#[allow(dead_code)]
|
|
|
|
|
output: String,
|
2026-07-11 13:16:10 +07:00
|
|
|
},
|
|
|
|
|
ToolCall {
|
2026-07-13 08:12:02 +07:00
|
|
|
tool: String,
|
|
|
|
|
#[allow(dead_code)]
|
|
|
|
|
args: Value,
|
2026-07-11 13:16:10 +07:00
|
|
|
},
|
|
|
|
|
ToolResult {
|
2026-07-13 08:12:02 +07:00
|
|
|
tool: String,
|
2026-07-15 02:18:30 +07:00
|
|
|
args: Value,
|
2026-07-13 08:12:02 +07:00
|
|
|
#[allow(dead_code)]
|
|
|
|
|
output: String,
|
2026-07-11 13:16:10 +07:00
|
|
|
},
|
2026-07-15 02:14:10 +07:00
|
|
|
Progress(String),
|
2026-07-11 13:16:10 +07:00
|
|
|
}
|