Skip to main content

Client

Trait Client 

Source
pub trait Client: Send {
Show 36 methods // Required methods fn request( &mut self, msg: ClientMessage, ) -> impl Future<Output = Result<ServerMessage>> + Send; fn request_stream( &mut self, msg: ClientMessage, ) -> impl Stream<Item = Result<ServerMessage>> + Send + '_; // Provided methods fn send( &mut self, req: SendMsg, ) -> impl Future<Output = Result<SendResponse>> + Send { ... } fn stream( &mut self, req: StreamMsg, ) -> impl Stream<Item = Result<Event>> + Send + '_ { ... } fn ping(&mut self) -> impl Future<Output = Result<()>> + Send { ... } fn get_stats(&mut self) -> impl Future<Output = Result<DaemonStats>> + Send { ... } fn list_agents( &mut self, ) -> impl Future<Output = Result<Vec<AgentInfo>>> + Send { ... } fn get_agent( &mut self, name: String, ) -> impl Future<Output = Result<AgentInfo>> + Send { ... } fn create_agent( &mut self, name: String, config: String, prompt: String, ) -> impl Future<Output = Result<AgentInfo>> + Send { ... } fn update_agent( &mut self, name: String, config: String, prompt: String, ) -> impl Future<Output = Result<AgentInfo>> + Send { ... } fn delete_agent( &mut self, name: String, ) -> impl Future<Output = Result<()>> + Send { ... } fn rename_agent( &mut self, old_name: String, new_name: String, ) -> impl Future<Output = Result<AgentInfo>> + Send { ... } fn list_providers( &mut self, ) -> impl Future<Output = Result<Vec<ProviderInfo>>> + Send { ... } fn install_plugin( &mut self, plugin: String, branch: String, path: String, force: bool, ) -> impl Stream<Item = Result<Event>> + Send + '_ { ... } fn uninstall_plugin( &mut self, plugin: String, ) -> impl Stream<Item = Result<Event>> + Send + '_ { ... } fn list_plugins( &mut self, ) -> impl Future<Output = Result<Vec<PluginInfo>>> + Send { ... } fn search_plugins( &mut self, query: String, ) -> impl Future<Output = Result<Vec<PluginInfo>>> + Send { ... } fn list_conversations( &mut self, agent: String, sender: String, ) -> impl Future<Output = Result<Vec<ConversationInfo>>> + Send { ... } fn get_conversation_history( &mut self, file_path: String, ) -> impl Future<Output = Result<ConversationHistory>> + Send { ... } fn delete_conversation( &mut self, file_path: String, ) -> impl Future<Output = Result<()>> + Send { ... } fn list_mcps(&mut self) -> impl Future<Output = Result<Vec<McpInfo>>> + Send { ... } fn upsert_mcp( &mut self, config: String, ) -> impl Future<Output = Result<McpInfo>> + Send { ... } fn delete_mcp( &mut self, name: String, ) -> impl Future<Output = Result<()>> + Send { ... } fn set_provider( &mut self, name: String, config: String, ) -> impl Future<Output = Result<ProviderInfo>> + Send { ... } fn delete_provider( &mut self, name: String, ) -> impl Future<Output = Result<()>> + Send { ... } fn set_active_model( &mut self, model: String, ) -> impl Future<Output = Result<()>> + Send { ... } fn list_provider_presets( &mut self, ) -> impl Future<Output = Result<Vec<ProviderPresetInfo>>> + Send { ... } fn start_service( &mut self, name: String, force: bool, ) -> impl Future<Output = Result<()>> + Send { ... } fn stop_service( &mut self, name: String, ) -> impl Future<Output = Result<()>> + Send { ... } fn list_skills( &mut self, ) -> impl Future<Output = Result<Vec<SkillInfo>>> + Send { ... } fn list_models( &mut self, ) -> impl Future<Output = Result<Vec<ModelInfo>>> + Send { ... } fn service_logs( &mut self, name: String, lines: u32, ) -> impl Future<Output = Result<String>> + Send { ... } fn subscribe_event( &mut self, source: String, target_agent: String, once: bool, ) -> impl Future<Output = Result<SubscriptionInfo>> + Send { ... } fn unsubscribe_event( &mut self, id: u64, ) -> impl Future<Output = Result<()>> + Send { ... } fn list_subscriptions( &mut self, ) -> impl Future<Output = Result<Vec<SubscriptionInfo>>> + Send { ... } fn publish_event( &mut self, source: String, payload: String, ) -> impl Future<Output = Result<()>> + Send { ... }
}
Expand description

Client-side protocol interface.

Implementors provide two transport primitives — request for request-response and request_stream for streaming operations. All typed methods are provided defaults that delegate to these primitives.

Required Methods§

Source

fn request( &mut self, msg: ClientMessage, ) -> impl Future<Output = Result<ServerMessage>> + Send

Send a ClientMessage and receive a single ServerMessage.

Source

fn request_stream( &mut self, msg: ClientMessage, ) -> impl Stream<Item = Result<ServerMessage>> + Send + '_

Send a ClientMessage and receive a stream of ServerMessages.

This is a raw transport primitive — the stream reads indefinitely. Callers must detect the terminal sentinel (e.g. StreamEnd) and stop consuming. The typed streaming methods handle this automatically.

Provided Methods§

Source

fn send( &mut self, req: SendMsg, ) -> impl Future<Output = Result<SendResponse>> + Send

Send a message to an agent and receive a complete response.

Source

fn stream( &mut self, req: StreamMsg, ) -> impl Stream<Item = Result<Event>> + Send + '_

Send a message to an agent and receive a streamed response.

Source

fn ping(&mut self) -> impl Future<Output = Result<()>> + Send

Ping the server (keepalive).

Source

fn get_stats(&mut self) -> impl Future<Output = Result<DaemonStats>> + Send

Get daemon stats including the active model name.

Source

fn list_agents(&mut self) -> impl Future<Output = Result<Vec<AgentInfo>>> + Send

List all registered agents.

Source

fn get_agent( &mut self, name: String, ) -> impl Future<Output = Result<AgentInfo>> + Send

Get a single agent by name.

Source

fn create_agent( &mut self, name: String, config: String, prompt: String, ) -> impl Future<Output = Result<AgentInfo>> + Send

Create an agent from JSON config and system prompt.

Source

fn update_agent( &mut self, name: String, config: String, prompt: String, ) -> impl Future<Output = Result<AgentInfo>> + Send

Update an agent from JSON config and optional system prompt.

Source

fn delete_agent( &mut self, name: String, ) -> impl Future<Output = Result<()>> + Send

Delete an agent by name.

Source

fn rename_agent( &mut self, old_name: String, new_name: String, ) -> impl Future<Output = Result<AgentInfo>> + Send

Rename an agent. The agent’s stored ULID stays stable.

Source

fn list_providers( &mut self, ) -> impl Future<Output = Result<Vec<ProviderInfo>>> + Send

List all registered LLM providers.

Source

fn install_plugin( &mut self, plugin: String, branch: String, path: String, force: bool, ) -> impl Stream<Item = Result<Event>> + Send + '_

Install a plugin, streaming progress events.

Source

fn uninstall_plugin( &mut self, plugin: String, ) -> impl Stream<Item = Result<Event>> + Send + '_

Uninstall a plugin, streaming progress events.

Source

fn list_plugins( &mut self, ) -> impl Future<Output = Result<Vec<PluginInfo>>> + Send

List installed plugins.

Source

fn search_plugins( &mut self, query: String, ) -> impl Future<Output = Result<Vec<PluginInfo>>> + Send

Search plugin registry for available plugins.

Source

fn list_conversations( &mut self, agent: String, sender: String, ) -> impl Future<Output = Result<Vec<ConversationInfo>>> + Send

List historical conversations from disk.

Source

fn get_conversation_history( &mut self, file_path: String, ) -> impl Future<Output = Result<ConversationHistory>> + Send

Load conversation history from a session file.

Source

fn delete_conversation( &mut self, file_path: String, ) -> impl Future<Output = Result<()>> + Send

Delete a conversation file from disk.

Source

fn list_mcps(&mut self) -> impl Future<Output = Result<Vec<McpInfo>>> + Send

List all MCP server configs.

Source

fn upsert_mcp( &mut self, config: String, ) -> impl Future<Output = Result<McpInfo>> + Send

Create or replace an MCP server (Storage-backed).

Source

fn delete_mcp( &mut self, name: String, ) -> impl Future<Output = Result<()>> + Send

Delete an MCP server by name.

Source

fn set_provider( &mut self, name: String, config: String, ) -> impl Future<Output = Result<ProviderInfo>> + Send

Create or update a provider.

Source

fn delete_provider( &mut self, name: String, ) -> impl Future<Output = Result<()>> + Send

Delete a provider by name.

Source

fn set_active_model( &mut self, model: String, ) -> impl Future<Output = Result<()>> + Send

Set the active model.

Source

fn list_provider_presets( &mut self, ) -> impl Future<Output = Result<Vec<ProviderPresetInfo>>> + Send

List provider presets.

Source

fn start_service( &mut self, name: String, force: bool, ) -> impl Future<Output = Result<()>> + Send

Start a command service.

Source

fn stop_service( &mut self, name: String, ) -> impl Future<Output = Result<()>> + Send

Stop a command service.

Source

fn list_skills(&mut self) -> impl Future<Output = Result<Vec<SkillInfo>>> + Send

List all available skills with enabled state.

Source

fn list_models(&mut self) -> impl Future<Output = Result<Vec<ModelInfo>>> + Send

List all resolved models with provider and active state.

Source

fn service_logs( &mut self, name: String, lines: u32, ) -> impl Future<Output = Result<String>> + Send

Get recent log lines for a service.

Source

fn subscribe_event( &mut self, source: String, target_agent: String, once: bool, ) -> impl Future<Output = Result<SubscriptionInfo>> + Send

Create an event bus subscription.

Source

fn unsubscribe_event( &mut self, id: u64, ) -> impl Future<Output = Result<()>> + Send

Remove an event bus subscription.

Source

fn list_subscriptions( &mut self, ) -> impl Future<Output = Result<Vec<SubscriptionInfo>>> + Send

List all event bus subscriptions.

Source

fn publish_event( &mut self, source: String, payload: String, ) -> impl Future<Output = Result<()>> + Send

Publish an event to the bus.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§