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
//! Unified error and result types for the crate.
/// All the ways a corrosive agent can fail.
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
/// Invalid or missing configuration (builder validation, env vars, …).
#[error("configuration error: {0}")]
Config(String),
/// JSON (de)serialization failure.
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
/// Underlying I/O failure.
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
/// HTTP transport failure (NVIDIA NIM, Pinecone, Qdrant, …).
#[error("HTTP error: {0}")]
Http(#[from] reqwest::Error),
/// The LLM provider returned an error or an unusable response.
#[error("LLM provider error: {0}")]
Llm(String),
/// Key material could not be parsed or used.
#[error("identity error: {0}")]
Identity(String),
/// A cryptographic signature did not verify.
#[error("verification failed: {0}")]
Verification(String),
/// A vector store operation failed.
#[error("vector store error: {0}")]
VectorStore(String),
/// An MCP server misbehaved or the JSON-RPC exchange failed.
#[error("MCP error: {0}")]
Mcp(String),
/// No skill registered under the requested name.
#[error("skill '{0}' not found")]
SkillNotFound(String),
/// A skill ran but failed.
#[error("skill execution error: {0}")]
Skill(String),
/// A skill (or other action) was refused by the active policy.
#[error("permission denied: {0}")]
PermissionDenied(String),
/// Authentication or authorization failed.
#[error("authentication error: {0}")]
Auth(String),
/// Transport-layer serving failure (REST/WS/gRPC).
#[error("server error: {0}")]
Server(String),
/// Agent-to-agent delegation failure (peer unreachable, untrusted, or
/// returned an error).
#[error("A2A error: {0}")]
A2a(String),
/// The agent was asked to do something it was not built for
/// (e.g. `chat` without an LLM provider).
#[error("agent has no {0} configured")]
NotConfigured(&'static str),
}
/// Crate-wide result alias.
pub type Result<T> = std::result::Result<T, Error>;