Struct ToolArtifact
pub struct ToolArtifact {
pub path: String,
pub uri: String,
pub filename: String,
pub title: String,
pub mime: String,
pub size: u64,
}Expand description
Structured metadata for a tool that produced a file artifact (e.g.
deliver_file). Carried on TurnEvent::ToolResult so a channel attaches
the file from typed fields instead of parsing a text trailer out of the
free-form output string. Trailer parsing let a crafted filename forge the
delivered path (arbitrary-file-read / confused-deputy class).
Fields§
§path: StringAbsolute path of the delivered file on the agent host.
uri: StringStable citation URI the client can reference (e.g. attachment://…).
filename: StringOriginal filename.
title: StringHuman-readable chat label; defaults to the filename.
mime: StringMIME type.
size: u64Size in bytes.
Implementations§
Source§impl ToolArtifact
impl ToolArtifact
Sourcepub fn from_delivered_data(data: &Value) -> Option<Self>
pub fn from_delivered_data(data: &Value) -> Option<Self>
Build from a tool’s structured output_data when it declares a delivered
file (delivered: true with a non-empty path). Returns None for any
other structured output, keeping this a channel-neutral convention rather
than a hook tied to one tool name.
Trait Implementations§
Source§impl Clone for ToolArtifact
impl Clone for ToolArtifact
Source§fn clone(&self) -> ToolArtifact
fn clone(&self) -> ToolArtifact
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more