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§
Sourcefn request(
&mut self,
msg: ClientMessage,
) -> impl Future<Output = Result<ServerMessage>> + Send
fn request( &mut self, msg: ClientMessage, ) -> impl Future<Output = Result<ServerMessage>> + Send
Send a ClientMessage and receive a single ServerMessage.
Sourcefn request_stream(
&mut self,
msg: ClientMessage,
) -> impl Stream<Item = Result<ServerMessage>> + Send + '_
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§
Sourcefn send(
&mut self,
req: SendMsg,
) -> impl Future<Output = Result<SendResponse>> + Send
fn send( &mut self, req: SendMsg, ) -> impl Future<Output = Result<SendResponse>> + Send
Send a message to an agent and receive a complete response.
Sourcefn stream(
&mut self,
req: StreamMsg,
) -> impl Stream<Item = Result<Event>> + Send + '_
fn stream( &mut self, req: StreamMsg, ) -> impl Stream<Item = Result<Event>> + Send + '_
Send a message to an agent and receive a streamed response.
Sourcefn get_stats(&mut self) -> impl Future<Output = Result<DaemonStats>> + Send
fn get_stats(&mut self) -> impl Future<Output = Result<DaemonStats>> + Send
Get daemon stats including the active model name.
Sourcefn list_agents(&mut self) -> impl Future<Output = Result<Vec<AgentInfo>>> + Send
fn list_agents(&mut self) -> impl Future<Output = Result<Vec<AgentInfo>>> + Send
List all registered agents.
Sourcefn get_agent(
&mut self,
name: String,
) -> impl Future<Output = Result<AgentInfo>> + Send
fn get_agent( &mut self, name: String, ) -> impl Future<Output = Result<AgentInfo>> + Send
Get a single agent by name.
Sourcefn create_agent(
&mut self,
name: String,
config: String,
prompt: String,
) -> impl Future<Output = Result<AgentInfo>> + Send
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.
Sourcefn update_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
Update an agent from JSON config and optional system prompt.
Sourcefn delete_agent(
&mut self,
name: String,
) -> impl Future<Output = Result<()>> + Send
fn delete_agent( &mut self, name: String, ) -> impl Future<Output = Result<()>> + Send
Delete an agent by name.
Sourcefn rename_agent(
&mut self,
old_name: String,
new_name: String,
) -> impl Future<Output = Result<AgentInfo>> + Send
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.
Sourcefn list_providers(
&mut self,
) -> impl Future<Output = Result<Vec<ProviderInfo>>> + Send
fn list_providers( &mut self, ) -> impl Future<Output = Result<Vec<ProviderInfo>>> + Send
List all registered LLM providers.
Sourcefn install_plugin(
&mut self,
plugin: String,
branch: String,
path: String,
force: bool,
) -> impl Stream<Item = Result<Event>> + Send + '_
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.
Sourcefn uninstall_plugin(
&mut self,
plugin: String,
) -> impl Stream<Item = Result<Event>> + Send + '_
fn uninstall_plugin( &mut self, plugin: String, ) -> impl Stream<Item = Result<Event>> + Send + '_
Uninstall a plugin, streaming progress events.
Sourcefn list_plugins(
&mut self,
) -> impl Future<Output = Result<Vec<PluginInfo>>> + Send
fn list_plugins( &mut self, ) -> impl Future<Output = Result<Vec<PluginInfo>>> + Send
List installed plugins.
Sourcefn search_plugins(
&mut self,
query: String,
) -> impl Future<Output = Result<Vec<PluginInfo>>> + Send
fn search_plugins( &mut self, query: String, ) -> impl Future<Output = Result<Vec<PluginInfo>>> + Send
Search plugin registry for available plugins.
Sourcefn list_conversations(
&mut self,
agent: String,
sender: String,
) -> impl Future<Output = Result<Vec<ConversationInfo>>> + Send
fn list_conversations( &mut self, agent: String, sender: String, ) -> impl Future<Output = Result<Vec<ConversationInfo>>> + Send
List historical conversations from disk.
Sourcefn get_conversation_history(
&mut self,
file_path: String,
) -> impl Future<Output = Result<ConversationHistory>> + Send
fn get_conversation_history( &mut self, file_path: String, ) -> impl Future<Output = Result<ConversationHistory>> + Send
Load conversation history from a session file.
Sourcefn delete_conversation(
&mut self,
file_path: String,
) -> impl Future<Output = Result<()>> + Send
fn delete_conversation( &mut self, file_path: String, ) -> impl Future<Output = Result<()>> + Send
Delete a conversation file from disk.
Sourcefn list_mcps(&mut self) -> impl Future<Output = Result<Vec<McpInfo>>> + Send
fn list_mcps(&mut self) -> impl Future<Output = Result<Vec<McpInfo>>> + Send
List all MCP server configs.
Sourcefn upsert_mcp(
&mut self,
config: String,
) -> impl Future<Output = Result<McpInfo>> + Send
fn upsert_mcp( &mut self, config: String, ) -> impl Future<Output = Result<McpInfo>> + Send
Create or replace an MCP server (Storage-backed).
Sourcefn delete_mcp(
&mut self,
name: String,
) -> impl Future<Output = Result<()>> + Send
fn delete_mcp( &mut self, name: String, ) -> impl Future<Output = Result<()>> + Send
Delete an MCP server by name.
Sourcefn set_provider(
&mut self,
name: String,
config: String,
) -> impl Future<Output = Result<ProviderInfo>> + Send
fn set_provider( &mut self, name: String, config: String, ) -> impl Future<Output = Result<ProviderInfo>> + Send
Create or update a provider.
Sourcefn delete_provider(
&mut self,
name: String,
) -> impl Future<Output = Result<()>> + Send
fn delete_provider( &mut self, name: String, ) -> impl Future<Output = Result<()>> + Send
Delete a provider by name.
Sourcefn set_active_model(
&mut self,
model: String,
) -> impl Future<Output = Result<()>> + Send
fn set_active_model( &mut self, model: String, ) -> impl Future<Output = Result<()>> + Send
Set the active model.
Sourcefn list_provider_presets(
&mut self,
) -> impl Future<Output = Result<Vec<ProviderPresetInfo>>> + Send
fn list_provider_presets( &mut self, ) -> impl Future<Output = Result<Vec<ProviderPresetInfo>>> + Send
List provider presets.
Sourcefn start_service(
&mut self,
name: String,
force: bool,
) -> impl Future<Output = Result<()>> + Send
fn start_service( &mut self, name: String, force: bool, ) -> impl Future<Output = Result<()>> + Send
Start a command service.
Sourcefn stop_service(
&mut self,
name: String,
) -> impl Future<Output = Result<()>> + Send
fn stop_service( &mut self, name: String, ) -> impl Future<Output = Result<()>> + Send
Stop a command service.
Sourcefn list_skills(&mut self) -> impl Future<Output = Result<Vec<SkillInfo>>> + Send
fn list_skills(&mut self) -> impl Future<Output = Result<Vec<SkillInfo>>> + Send
List all available skills with enabled state.
Sourcefn list_models(&mut self) -> impl Future<Output = Result<Vec<ModelInfo>>> + Send
fn list_models(&mut self) -> impl Future<Output = Result<Vec<ModelInfo>>> + Send
List all resolved models with provider and active state.
Sourcefn service_logs(
&mut self,
name: String,
lines: u32,
) -> impl Future<Output = Result<String>> + Send
fn service_logs( &mut self, name: String, lines: u32, ) -> impl Future<Output = Result<String>> + Send
Get recent log lines for a service.
Sourcefn subscribe_event(
&mut self,
source: String,
target_agent: String,
once: bool,
) -> impl Future<Output = Result<SubscriptionInfo>> + Send
fn subscribe_event( &mut self, source: String, target_agent: String, once: bool, ) -> impl Future<Output = Result<SubscriptionInfo>> + Send
Create an event bus subscription.
Sourcefn unsubscribe_event(
&mut self,
id: u64,
) -> impl Future<Output = Result<()>> + Send
fn unsubscribe_event( &mut self, id: u64, ) -> impl Future<Output = Result<()>> + Send
Remove an event bus subscription.
Sourcefn list_subscriptions(
&mut self,
) -> impl Future<Output = Result<Vec<SubscriptionInfo>>> + Send
fn list_subscriptions( &mut self, ) -> impl Future<Output = Result<Vec<SubscriptionInfo>>> + Send
List all event bus subscriptions.
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.