useschemars::JsonSchema;useserde::{Deserialize, Serialize};useuuid::Uuid;/// The agent a usage sample belongs to and where it sits in the sub-agent
/// tree. A freshly created source has no parent; the agent that receives a
/// sub-agent's usage fills in `parent_agent_id` and `task_id`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]pubstructUsageSource{pubagent_id: String,
pubparent_agent_id:Option<String>,
pubtask_id:Option<String>,
pubagent_name: String,
}implUsageSource{pubfnnew(agent_name: impl Into<String>)->Self{Self{
agent_id:Uuid::new_v4().to_string(),
parent_agent_id:None,
task_id:None,
agent_name: agent_name.into(),}}}