Skip to main content

AcpDispatch

Trait AcpDispatch 

Source
pub trait AcpDispatch:
    Send
    + Sync
    + 'static {
    // Required methods
    fn post(
        &self,
        server_id: &str,
        bootstrap_agent: Option<&str>,
        payload: Value,
    ) -> Pin<Box<dyn Future<Output = Result<AcpDispatchResult, String>> + Send + '_>>;
    fn notification_stream(
        &self,
        server_id: &str,
        last_event_id: Option<u64>,
    ) -> Pin<Box<dyn Future<Output = Result<AcpPayloadStream, String>> + Send + '_>>;
    fn delete(
        &self,
        server_id: &str,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + '_>>;
}
Expand description

Trait for dispatching JSON-RPC payloads to ACP agent process instances.

Implementors (e.g. AcpProxyRuntime) handle launching, bootstrapping, and communicating with agent subprocesses via the ACP stdio bridge.

Required Methods§

Source

fn post( &self, server_id: &str, bootstrap_agent: Option<&str>, payload: Value, ) -> Pin<Box<dyn Future<Output = Result<AcpDispatchResult, String>> + Send + '_>>

Send a JSON-RPC payload to the agent process identified by server_id. If the instance does not exist yet and bootstrap_agent is provided, the implementation should create it for that agent.

Source

fn notification_stream( &self, server_id: &str, last_event_id: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<AcpPayloadStream, String>> + Send + '_>>

Open a stream of raw JSON-RPC notification payloads from the agent process. Each item is a serde_json::Value containing a complete JSON-RPC message (notification or response).

Source

fn delete( &self, server_id: &str, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + '_>>

Destroy the agent process instance.

Implementors§