Skip to main content

zagens_core/engine/turn_loop/
exec.rs

1//! Tool-batch execution types for the turn loop (P2 PR4).
2
3use std::time::Instant;
4
5use serde_json::Value;
6use zagens_tools::{ToolError, ToolResult};
7
8use crate::chat::ToolCaller;
9
10#[derive(Debug, Clone)]
11pub struct ToolExecOutcome {
12    pub index: usize,
13    pub id: String,
14    pub name: String,
15    pub input: Value,
16    pub started_at: Instant,
17    pub result: Result<ToolResult, ToolError>,
18}
19
20/// Approval / parallelism metadata resolved during tool planning (L2 may consult registry).
21#[derive(Debug, Clone)]
22pub struct ToolPlanApprovalMeta {
23    pub approval_required: bool,
24    pub approval_description: String,
25    pub supports_parallel: bool,
26    pub read_only: bool,
27}
28
29#[derive(Debug, Clone)]
30pub struct ToolExecutionPlan {
31    pub index: usize,
32    pub id: String,
33    pub name: String,
34    pub input: Value,
35    pub caller: Option<ToolCaller>,
36    pub interactive: bool,
37    pub approval_required: bool,
38    pub approval_description: String,
39    pub supports_parallel: bool,
40    pub read_only: bool,
41    pub blocked_error: Option<ToolError>,
42    pub guard_result: Option<ToolResult>,
43}