Public declaration syntax from harness-sdk/src/error.rs Original source SHA-256: dd22454797649293ba8ac281f4d0330b4b35d3723f28ac576c0bfdb00f64ac63 Function bodies and constant values are omitted. This is not the complete implementation. Source line 30 #[derive(Debug, thiserror::Error)] pub enum SdkError { // ── Adapter Errors ── /// An error from the adapter implementation. #[error("adapter error: {0}")] Adapter(#[from] AdapterError), /// Adapter output failed validation. #[error("adapter output validation failed: {0}")] InvalidAdapterOutput(String), /// Adapter stream timed out. #[error("adapter stream timeout after {0:?}")] AdapterTimeout(Duration), /// Adapter does not support the requested feature. #[error("adapter does not support {0}")] NotSupported(String), // ── Runtime Errors ── /// Terminal I/O error. #[error("terminal error: {0}")] Terminal(#[from] std::io::Error), /// Event loop error. #[error("event loop error: {0}")] EventLoop(String), /// Invalid mode transition. #[error("mode transition failed: cannot go from {from} to {to}")] InvalidModeTransition { /// The current mode. from: String, /// The requested mode. to: String, }, // ── Input Errors ── /// Interjection parse error. #[error("interjection parse error: {0}")] InterjectionParse(#[from] ParseError), /// Slash command error. #[error("slash command error: {0}")] SlashCommand(String), // ── Plugin Errors ── /// Plugin system error. #[cfg(feature = "plugins")] #[error("plugin error: {0}")] Plugin(#[from] PluginError), // ── Configuration Errors ── /// Builder configuration error. #[error("builder error: {0}")] Builder(String), /// Serialization/deserialization error. #[error("serialization error: {0}")] Serialization(String), } Source line 105 #[derive(Debug, thiserror::Error, Clone)] pub enum AdapterError { /// Connection to the agent backend failed. #[error("connection error: {0}")] Connection(String), /// The adapter received an invalid response from the backend. #[error("protocol error: {0}")] Protocol(String), /// An I/O error occurred during adapter communication. #[error("i/o error: {0}")] Io(String), /// The adapter operation timed out. #[error("timeout: {0}")] Timeout(String), /// Authentication failed. #[error("authentication error: {0}")] Authentication(String), /// The requested operation is not supported by this adapter. #[error("not supported: {0}")] NotSupported(String), /// A generic adapter error. #[error("{0}")] Other(String), } Source line 149 #[derive(Debug, thiserror::Error, Clone, PartialEq, Eq)] pub enum ParseError { /// Input was empty or whitespace-only. #[error("interjection input is empty")] EmptyInput, /// Input exceeded the maximum allowed length. #[error("interjection too long: {0} chars (max {1})")] TooLong(usize, usize), /// Targeted agent name is invalid. #[error("invalid agent target: {0}")] InvalidTarget(String), } Source line 177 #[derive(Debug, thiserror::Error, Clone)] pub enum PluginError { /// WASM module failed structural validation. #[error("WASM module failed validation: {0}")] InvalidModule(String), /// WASM module hash does not match the expected hash. #[error("WASM hash mismatch: expected {expected}, got {actual}")] HashMismatch { /// Expected SHA-256 hash. expected: String, /// Actual computed SHA-256 hash. actual: String, }, /// Plugin does not export a required function. #[error("plugin '{0}' missing required export: {1}")] MissingExport(String, String), /// Plugin requested a capability the host does not provide. #[error("plugin '{0}' requested unsupported capability: {1}")] UnsupportedCapability(String, String), /// Capability was denied by the permission manager. #[error("capability denied for plugin '{plugin}': {capability} -> {resource}")] CapabilityDenied { /// Plugin name. plugin: String, /// Capability kind. capability: String, /// Requested resource. resource: String, }, /// Plugin trapped during execution. #[error("plugin '{0}' panicked during execution: {1}")] PluginPanic(String, String), /// Plugin not found in configured sources. #[error("plugin '{0}' not found in configured sources")] NotFound(String), /// Plugin is disabled. #[error("plugin '{0}' is disabled")] Disabled(String), /// Plugin configuration error. #[error("plugin config error: {0}")] Config(String), /// Host function error. #[error("plugin '{0}' host function error: {1}")] HostFunction(String, String), }