Public declaration syntax from forge-rs/crates/forge-collab/src/capability.rs Original source SHA-256: 881a760efca13e792b460d367b6998094b14144f7a45416ee888b57b2653aba1 Function bodies and constant values are omitted. This is not the complete implementation. Source line 58 pub trait CapabilityAdvertiser: Send + Sync { /// Returns the agent's full capability profile. /// /// The profile includes the agent's supported roles, task types, /// available tools, current load, and maximum concurrency. /// /// # Returns /// /// An [`AgentCapabilityProfile`] describing the agent's capabilities. fn advertise_capabilities(&self) -> AgentCapabilityProfile; /// Returns `true` if this agent can handle the given task type. /// /// This is a convenience check that avoids constructing the full /// capability profile for simple task type matching. /// /// # Arguments /// /// * `task_type` - The task type to check (e.g., "code-review"). /// /// # Returns /// /// `true` if the agent supports this task type. fn can_handle(&self, task_type: &str) -> bool; /// Returns the agent's current availability as a factor between 0.0 /// (fully loaded) and 1.0 (completely idle). /// /// This is the inverse of `current_load` in the capability profile: /// `availability = 1.0 - current_load`. /// /// # Returns /// /// A value between 0.0 and 1.0 representing available capacity. fn current_availability(&self) -> f64; } Source line 163 pub fn match_task_to_agents( task: &DelegatedTask, agents: &[AgentCapabilityProfile], ) -> Vec;