agentool 0.2.0

Rust toolkit for AI agents: JSON Schema-defined tools for workspace files, search, web, Markdown, Git, memory, human-in-the-loop hooks, and todos.
Documentation
use crate::tool::ToolError;

#[derive(Clone, Copy)]
pub(crate) enum WebErrorCode {
    NetworkError,
}

impl WebErrorCode {
    const fn as_str(self) -> &'static str {
        match self {
            Self::NetworkError => "NETWORK_ERROR",
        }
    }
}

pub(crate) fn tool_error(code: WebErrorCode, message: impl Into<String>) -> ToolError {
    ToolError {
        code: code.as_str().to_string(),
        message: message.into(),
    }
}