1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//! Public agent data types.
//!
//! This module groups the serializable metadata and result types shared by the
//! agent runtime, server, and session layers.
//!
//! # Examples
//!
//! ```ignore
//! let mode = AgentMode::Primary;
//! assert_eq!(mode, AgentMode::Primary);
//! ```
use ;
/// Describes a registered agent profile and runtime defaults.
///
/// These fields are exposed through the server and UI so callers can inspect
/// the agent catalog and choose an execution mode.
///
/// # Examples
///
/// ```ignore
/// let info = AgentInfo { name: "build".into(), description: None, mode: AgentMode::Primary, native: true, hidden: false, model: None, temperature: None, top_p: None, max_steps: Some(100) };
/// ```
/// Categorizes where an agent can be presented or spawned.
///
/// Primary agents are visible entrypoints, subagents are delegated workers, and
/// `All` is used for filters that should include both groups.
///
/// # Examples
///
/// ```ignore
/// match AgentMode::Primary { AgentMode::Primary => (), _ => unreachable!() }
/// ```
/// Metadata describing a tool registered with an agent.
///
/// The agent surfaces this alongside the raw tool registry so UIs and remote
/// clients can render descriptions and parameter schemas.
///
/// # Examples
///
/// ```ignore
/// let metadata = ToolMetadata { name: "bash".into(), description: "Run shell commands".into(), parameters: serde_json::json!({}) };
/// ```
/// Final response returned from a completed agent run.
///
/// This includes the textual answer along with recorded tool activity and
/// provider usage metadata captured in the session.
///
/// # Examples
///
/// ```ignore
/// let response = AgentResponse { text: String::new(), tool_uses: vec![], usage: Default::default() };
/// ```
/// Records a single tool invocation executed during an agent run.
///
/// Sessions store these values so downstream tooling can inspect tool history
/// without re-parsing provider messages.
///
/// # Examples
///
/// ```ignore
/// let use_record = ToolUse { id: "1".into(), name: "bash".into(), input: "{}".into(), output: "ok".into(), success: true };
/// ```