Skip to main content

AgentWrapperGateway

Struct AgentWrapperGateway 

Source
pub struct AgentWrapperGateway { /* private fields */ }

Implementations§

Source§

impl AgentWrapperGateway

Source

pub fn new() -> Self

Source

pub fn register( &mut self, backend: Arc<dyn AgentWrapperBackend>, ) -> Result<(), AgentWrapperError>

Registers a backend.

If a backend with the same AgentWrapperKind is already registered, this MUST return an error.

Source

pub fn backend( &self, agent_kind: &AgentWrapperKind, ) -> Option<Arc<dyn AgentWrapperBackend>>

Resolves a backend by AgentWrapperKind.

Source

pub fn run( &self, agent_kind: &AgentWrapperKind, request: AgentWrapperRunRequest, ) -> Pin<Box<dyn Future<Output = Result<AgentWrapperRunHandle, AgentWrapperError>> + Send + '_>>

Convenience entrypoint: resolves a backend and starts a run.

This MUST return AgentWrapperError::UnknownBackend when no backend is registered for agent_kind.

Source

pub fn run_control( &self, agent_kind: &AgentWrapperKind, request: AgentWrapperRunRequest, ) -> Pin<Box<dyn Future<Output = Result<AgentWrapperRunControl, AgentWrapperError>> + Send + '_>>

Starts a run and returns a control object including an explicit cancellation handle.

This MUST return AgentWrapperError::UnknownBackend { agent_kind } when no backend is registered for the requested agent_kind, where agent_kind == <requested AgentWrapperKind>.as_str().to_string().

If the resolved backend does not advertise agent_api.control.cancel.v1, this MUST return: AgentWrapperError::UnsupportedCapability { agent_kind, capability: "agent_api.control.cancel.v1" }, where agent_kind == <requested AgentWrapperKind>.as_str().to_string().

Cancellation is best-effort and is defined by docs/specs/unified-agent-api/run-protocol-spec.md, including the pinned "cancelled" completion outcome.

Source

pub fn mcp_list( &self, agent_kind: &AgentWrapperKind, request: AgentWrapperMcpListRequest, ) -> Pin<Box<dyn Future<Output = Result<AgentWrapperMcpCommandOutput, AgentWrapperError>> + Send + '_>>

Resolves a backend and runs mcp list.

This MUST return AgentWrapperError::UnknownBackend { agent_kind } when no backend is registered for the requested agent_kind, where agent_kind == <requested AgentWrapperKind>.as_str().to_string().

If the resolved backend does not advertise agent_api.tools.mcp.list.v1, this MUST return AgentWrapperError::UnsupportedCapability { agent_kind, capability: "agent_api.tools.mcp.list.v1" }, where agent_kind == <requested AgentWrapperKind>.as_str().to_string().

Source

pub fn mcp_get( &self, agent_kind: &AgentWrapperKind, request: AgentWrapperMcpGetRequest, ) -> Pin<Box<dyn Future<Output = Result<AgentWrapperMcpCommandOutput, AgentWrapperError>> + Send + '_>>

Resolves a backend and runs mcp get.

This MUST return AgentWrapperError::UnknownBackend { agent_kind } when no backend is registered for the requested agent_kind, where agent_kind == <requested AgentWrapperKind>.as_str().to_string().

If the resolved backend does not advertise agent_api.tools.mcp.get.v1, this MUST return AgentWrapperError::UnsupportedCapability { agent_kind, capability: "agent_api.tools.mcp.get.v1" }, where agent_kind == <requested AgentWrapperKind>.as_str().to_string().

Source

pub fn mcp_add( &self, agent_kind: &AgentWrapperKind, request: AgentWrapperMcpAddRequest, ) -> Pin<Box<dyn Future<Output = Result<AgentWrapperMcpCommandOutput, AgentWrapperError>> + Send + '_>>

Resolves a backend and runs mcp add.

This MUST return AgentWrapperError::UnknownBackend { agent_kind } when no backend is registered for the requested agent_kind, where agent_kind == <requested AgentWrapperKind>.as_str().to_string().

If the resolved backend does not advertise agent_api.tools.mcp.add.v1, this MUST return AgentWrapperError::UnsupportedCapability { agent_kind, capability: "agent_api.tools.mcp.add.v1" }, where agent_kind == <requested AgentWrapperKind>.as_str().to_string().

Source

pub fn mcp_remove( &self, agent_kind: &AgentWrapperKind, request: AgentWrapperMcpRemoveRequest, ) -> Pin<Box<dyn Future<Output = Result<AgentWrapperMcpCommandOutput, AgentWrapperError>> + Send + '_>>

Resolves a backend and runs mcp remove.

This MUST return AgentWrapperError::UnknownBackend { agent_kind } when no backend is registered for the requested agent_kind, where agent_kind == <requested AgentWrapperKind>.as_str().to_string().

If the resolved backend does not advertise agent_api.tools.mcp.remove.v1, this MUST return AgentWrapperError::UnsupportedCapability { agent_kind, capability: "agent_api.tools.mcp.remove.v1" }, where agent_kind == <requested AgentWrapperKind>.as_str().to_string().

Trait Implementations§

Source§

impl Clone for AgentWrapperGateway

Source§

fn clone(&self) -> AgentWrapperGateway

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for AgentWrapperGateway

Source§

fn default() -> AgentWrapperGateway

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.