agents_core/
hitl.rs

1use serde::{Deserialize, Serialize};
2
3use crate::messaging::AgentMessage;
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
6pub enum HitlAction {
7    Approve,
8    Reject {
9        reason: Option<String>,
10    },
11    Respond {
12        message: AgentMessage,
13    },
14    /// Edit the pending tool call by choosing a tool `action` and new `args`.
15    Edit {
16        action: String,
17        args: serde_json::Value,
18    },
19}
20
21#[derive(Debug, Clone, Serialize, Deserialize)]
22pub struct HitlInterrupt {
23    pub tool_name: String,
24    pub message: AgentMessage,
25}
26
27#[derive(Debug, Clone, Serialize, Deserialize)]
28pub enum AgentInterrupt {
29    HumanInLoop(HitlInterrupt),
30}