Public declaration syntax from forge-rs/harness-runtime/src/planes/tools.rs Original source SHA-256: 36ef411f19b9a639c2ef8ac3c013fdaf253025ac97ec003efe57ce9b8d3e8cd9 Function bodies and constant values are omitted. This is not the complete implementation. Source line 13 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct ToolInvocation { /// The run id the invocation belongs to. pub run_id: String, /// The `/` tool identifier. pub tool: String, /// Opaque tool input (plane-defined encoding). pub input: String, /// Capability grants offered for authorization /// (`[capabilities].act_refs`). pub act_refs: Vec } Source line 27 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct ToolOutput { /// The tool's result content. pub content: String, /// Provider evidence reference for the invocation, when produced. pub evidence_ref: Option } Source line 39 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct ApprovalRequest { /// The run id. pub run_id: String, /// The tool awaiting approval. pub tool: String, /// The input awaiting approval. pub input: String } Source line 51 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(tag = "decision", rename_all = "snake_case")] pub enum ApprovalDecision { /// Approved; the invocation may proceed. Approved { /// Who approved (human principal or approver-harness DID). approver: String, }, /// Denied; the loop receives the denial as an observation. Denied { /// Why the invocation was denied. reason: String, }, } Source line 66 #[async_trait] pub trait ToolsPlane: Plane { /// Invoke an allowlisted tool against a covering capability grant. async fn invoke(&self, invocation: ToolInvocation) -> Result; /// Request approval for a gated invocation. Called only for tools in /// `[tools].approval_required`; the runtime records the decision /// either way (ยง5.9). async fn request_approval( &self, request: ApprovalRequest, ) -> Result; }