pub struct AgentWrapperGateway { /* private fields */ }Implementations§
Source§impl AgentWrapperGateway
impl AgentWrapperGateway
pub fn new() -> Self
Sourcepub fn register(
&mut self,
backend: Arc<dyn AgentWrapperBackend>,
) -> Result<(), AgentWrapperError>
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.
Sourcepub fn backend(
&self,
agent_kind: &AgentWrapperKind,
) -> Option<Arc<dyn AgentWrapperBackend>>
pub fn backend( &self, agent_kind: &AgentWrapperKind, ) -> Option<Arc<dyn AgentWrapperBackend>>
Resolves a backend by AgentWrapperKind.
Sourcepub fn run(
&self,
agent_kind: &AgentWrapperKind,
request: AgentWrapperRunRequest,
) -> Pin<Box<dyn Future<Output = Result<AgentWrapperRunHandle, AgentWrapperError>> + Send + '_>>
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.
Sourcepub fn run_control(
&self,
agent_kind: &AgentWrapperKind,
request: AgentWrapperRunRequest,
) -> Pin<Box<dyn Future<Output = Result<AgentWrapperRunControl, AgentWrapperError>> + Send + '_>>
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.
Sourcepub fn mcp_list(
&self,
agent_kind: &AgentWrapperKind,
request: AgentWrapperMcpListRequest,
) -> Pin<Box<dyn Future<Output = Result<AgentWrapperMcpCommandOutput, AgentWrapperError>> + Send + '_>>
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().
Sourcepub fn mcp_get(
&self,
agent_kind: &AgentWrapperKind,
request: AgentWrapperMcpGetRequest,
) -> Pin<Box<dyn Future<Output = Result<AgentWrapperMcpCommandOutput, AgentWrapperError>> + Send + '_>>
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().
Sourcepub fn mcp_add(
&self,
agent_kind: &AgentWrapperKind,
request: AgentWrapperMcpAddRequest,
) -> Pin<Box<dyn Future<Output = Result<AgentWrapperMcpCommandOutput, AgentWrapperError>> + Send + '_>>
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().
Sourcepub fn mcp_remove(
&self,
agent_kind: &AgentWrapperKind,
request: AgentWrapperMcpRemoveRequest,
) -> Pin<Box<dyn Future<Output = Result<AgentWrapperMcpCommandOutput, AgentWrapperError>> + Send + '_>>
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
impl Clone for AgentWrapperGateway
Source§fn clone(&self) -> AgentWrapperGateway
fn clone(&self) -> AgentWrapperGateway
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more