Public declaration syntax from forge-rs/crates/forge-core/src/tool.rs Original source SHA-256: 3f0b5dc4e3b4b5a7753480e90ed91dce4f9139d2a39de2fdec738d0b2184389d Function bodies and constant values are omitted. This is not the complete implementation. Source line 26 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum ToolTier { /// Tier 1 -- Platform tools provided by the runtime. /// /// Always available, no authorization needed. Examples: clock, crypto, logging. #[serde(rename = "platform")] Platform, /// Tier 2 -- External tools that execute outside the sandbox. /// /// Require Arsenal ACT authorization. Examples: web browsing, database, APIs. #[serde(rename = "external", alias = "host")] External, /// Tier 3 -- Embedded tools compiled into the agent WASM module. /// /// Scoped to the module. Examples: data parsing, computation, pure functions. #[serde(rename = "embedded")] Embedded, } Source line 51 pub fn requires_authorization(&self) -> bool; Source line 56 pub fn as_str(&self) -> &'static str; Source line 93 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ToolDefinition { } Source line 110 pub fn builder(name: impl Into) -> ToolDefinitionBuilder; Source line 120 pub fn name(&self) -> &str; Source line 125 pub fn description(&self) -> &str; Source line 130 pub fn parameters(&self) -> &JsonSchema; Source line 135 pub fn tier(&self) -> ToolTier; Source line 141 pub struct ToolDefinitionBuilder { } Source line 150 pub fn description(mut self, desc: impl Into) -> Self; Source line 156 pub fn parameters(mut self, schema: JsonSchema) -> Self; Source line 162 pub fn tier(mut self, tier: ToolTier) -> Self; Source line 168 pub fn build(self) -> ToolDefinition; Source line 182 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ToolCall { /// Unique identifier for this call (used to match with results). pub id: String, /// The tool name being invoked. pub name: String, /// JSON arguments for the tool. pub arguments: serde_json::Value } Source line 195 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ToolResult { /// The tool call ID this result corresponds to. pub tool_call_id: String, /// The tool name. pub name: String, /// The result content (stringified). pub content: String, /// Whether the tool execution resulted in an error. pub is_error: bool } Source line 215 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub enum ToolApproval { /// The tool call is approved as-is. Approve, /// The tool call is denied with a reason. Deny { /// Why the tool call was denied. reason: String, }, /// The tool call is approved but with modified arguments. Modify { /// The modified arguments to use instead. arguments: serde_json::Value, }, }