pub struct AgentGateway { /* private fields */ }Expand description
Capability-gated router for parent-to-child agent delegation.
Implementations§
Source§impl AgentGateway
impl AgentGateway
Sourcepub fn with_max_depth(self, max_depth: u32) -> Self
pub fn with_max_depth(self, max_depth: u32) -> Self
Sets the maximum delegation depth accepted by this gateway.
Sourcepub fn layer(self, middleware: Arc<dyn GatewayMiddleware>) -> Self
pub fn layer(self, middleware: Arc<dyn GatewayMiddleware>) -> Self
Appends around-middleware to the gateway chain.
Middleware runs in registration order before the child boundary and in
reverse order after next completes.
Sourcepub fn push_middleware(&mut self, middleware: Arc<dyn GatewayMiddleware>)
pub fn push_middleware(&mut self, middleware: Arc<dyn GatewayMiddleware>)
Appends around-middleware without consuming the gateway.
Sourcepub fn register(
&mut self,
route: AgentRoute,
) -> Result<(), AgentRegistrationError>
pub fn register( &mut self, route: AgentRoute, ) -> Result<(), AgentRegistrationError>
Registers a route without replacing an existing model-facing name.
§Errors
Returns AgentRegistrationError when the route name is blank or
already registered.
Sourcepub fn descriptor(&self, name: &str) -> Option<&AgentDescriptor>
pub fn descriptor(&self, name: &str) -> Option<&AgentDescriptor>
Returns the immutable route descriptor registered under name.
Sourcepub fn model_specs(&self) -> Vec<ToolSpec>
pub fn model_specs(&self) -> Vec<ToolSpec>
Returns model-facing route specifications in deterministic name order.
Sourcepub async fn delegate(
&self,
name: &str,
input: impl Into<String>,
parent: &RunContext,
) -> Result<AgentOutcome, GatewayError>
pub async fn delegate( &self, name: &str, input: impl Into<String>, parent: &RunContext, ) -> Result<AgentOutcome, GatewayError>
Invokes a child agent through an explicitly authorized route.
§Errors
Returns GatewayError when lifecycle, capability, authority, depth,
budget, or child execution checks fail.
Trait Implementations§
Source§impl Clone for AgentGateway
impl Clone for AgentGateway
Source§fn clone(&self) -> AgentGateway
fn clone(&self) -> AgentGateway
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more