1use serde::{Deserialize, Serialize};
4
5pub trait ToolRender: Send + Sync {
9 fn user_facing_name(&self, input: Option<&serde_json::Value>) -> String;
10 fn get_tool_use_summary(&self, input: Option<&serde_json::Value>) -> Option<String>;
11 fn render_tool_result_message(&self, content: &serde_json::Value) -> Option<String>;
12}
13
14#[derive(Debug, Clone, Serialize, Deserialize)]
16pub struct ToolProgressData {
17 #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
18 pub kind: Option<String>,
19 #[serde(flatten)]
20 pub extra: std::collections::HashMap<String, serde_json::Value>,
21}
22
23pub type ShellProgress = ToolProgressData;
25pub type BashProgress = ToolProgressData;
26pub type PowerShellProgress = ToolProgressData;
27pub type McpProgress = ToolProgressData;
28pub type SkillToolProgress = ToolProgressData;
29pub type TaskOutputProgress = ToolProgressData;
30pub type WebSearchProgress = ToolProgressData;
31pub type AgentToolProgress = ToolProgressData;
32pub type ReplToolProgress = ToolProgressData;
33pub type SdkWorkflowProgress = ToolProgressData;