pub trait Server: Sync {
Show 46 methods
// Required methods
fn send(
&self,
req: SendMsg,
) -> impl Future<Output = Result<SendResponse>> + Send;
fn stream(
&self,
req: StreamMsg,
) -> impl Stream<Item = Result<StreamEvent>> + Send;
fn ping(&self) -> impl Future<Output = Result<()>> + Send;
fn list_conversations_active(
&self,
) -> impl Future<Output = Result<Vec<ActiveConversationInfo>>> + Send;
fn kill_conversation(
&self,
agent: String,
sender: String,
) -> impl Future<Output = Result<bool>> + Send;
fn subscribe_events(
&self,
) -> impl Stream<Item = Result<AgentEventMsg>> + Send;
fn reload(&self) -> impl Future<Output = Result<()>> + Send;
fn get_stats(&self) -> impl Future<Output = Result<DaemonStats>> + Send;
fn create_cron(
&self,
req: CreateCronMsg,
) -> impl Future<Output = Result<CronInfo>> + Send;
fn delete_cron(&self, id: u64) -> impl Future<Output = Result<bool>> + Send;
fn list_crons(&self) -> impl Future<Output = Result<CronList>> + Send;
fn subscribe_event(
&self,
req: SubscribeEventMsg,
) -> impl Future<Output = Result<SubscriptionInfo>> + Send;
fn unsubscribe_event(
&self,
id: u64,
) -> impl Future<Output = Result<bool>> + Send;
fn list_subscriptions(
&self,
) -> impl Future<Output = Result<SubscriptionList>> + Send;
fn publish_event(
&self,
req: PublishEventMsg,
) -> impl Future<Output = Result<()>> + Send;
fn compact_conversation(
&self,
agent: String,
sender: String,
) -> impl Future<Output = Result<String>> + Send;
fn reply_to_ask(
&self,
agent: String,
sender: String,
content: String,
) -> impl Future<Output = Result<()>> + Send;
fn steer_session(
&self,
req: SteerSessionMsg,
) -> impl Future<Output = Result<()>> + Send;
fn list_agents(&self) -> impl Future<Output = Result<Vec<AgentInfo>>> + Send;
fn get_agent(
&self,
name: String,
) -> impl Future<Output = Result<AgentInfo>> + Send;
fn create_agent(
&self,
req: CreateAgentMsg,
) -> impl Future<Output = Result<AgentInfo>> + Send;
fn update_agent(
&self,
req: UpdateAgentMsg,
) -> impl Future<Output = Result<AgentInfo>> + Send;
fn delete_agent(
&self,
name: String,
) -> impl Future<Output = Result<bool>> + Send;
fn rename_agent(
&self,
old_name: String,
new_name: String,
) -> impl Future<Output = Result<AgentInfo>> + Send;
fn list_providers(
&self,
) -> impl Future<Output = Result<Vec<ProviderInfo>>> + Send;
fn install_plugin(
&self,
req: InstallPluginMsg,
) -> impl Stream<Item = Result<PluginEvent>> + Send;
fn uninstall_plugin(
&self,
plugin: String,
) -> impl Stream<Item = Result<PluginEvent>> + Send;
fn list_plugins(
&self,
) -> impl Future<Output = Result<Vec<PluginInfo>>> + Send;
fn search_plugins(
&self,
query: String,
) -> impl Future<Output = Result<Vec<PluginInfo>>> + Send;
fn list_skills(&self) -> impl Future<Output = Result<Vec<SkillInfo>>> + Send;
fn list_models(&self) -> impl Future<Output = Result<Vec<ModelInfo>>> + Send;
fn list_conversations(
&self,
agent: String,
sender: String,
) -> impl Future<Output = Result<Vec<ConversationInfo>>> + Send;
fn get_conversation_history(
&self,
file_path: String,
) -> impl Future<Output = Result<ConversationHistory>> + Send;
fn delete_conversation(
&self,
file_path: String,
) -> impl Future<Output = Result<()>> + Send;
fn list_mcps(&self) -> impl Future<Output = Result<Vec<McpInfo>>> + Send;
fn upsert_mcp(
&self,
req: UpsertMcpMsg,
) -> impl Future<Output = Result<McpInfo>> + Send;
fn delete_mcp(
&self,
name: String,
) -> impl Future<Output = Result<bool>> + Send;
fn set_provider(
&self,
name: String,
config: String,
) -> impl Future<Output = Result<ProviderInfo>> + Send;
fn delete_provider(
&self,
name: String,
) -> impl Future<Output = Result<()>> + Send;
fn set_active_model(
&self,
model: String,
) -> impl Future<Output = Result<()>> + Send;
fn list_provider_presets(
&self,
) -> impl Future<Output = Result<Vec<ProviderPresetInfo>>> + Send;
fn start_service(
&self,
name: String,
force: bool,
) -> impl Future<Output = Result<()>> + Send;
fn stop_service(
&self,
name: String,
) -> impl Future<Output = Result<()>> + Send;
fn service_logs(
&self,
name: String,
lines: u32,
) -> impl Future<Output = Result<String>> + Send;
// Provided methods
fn dispatch_extension(
&self,
_payload: Vec<u8>,
) -> impl Future<Output = Result<Vec<u8>>> + Send { ... }
fn dispatch(
&self,
msg: ClientMessage,
) -> impl Stream<Item = ServerMessage> + Send + '_ { ... }
}Expand description
Server-side protocol handler.
Each method corresponds to one ClientMessage variant. Implementations
receive typed request structs and return typed responses — no enum matching
required. Streaming operations return impl Stream.
The provided dispatch method routes a raw
ClientMessage to the appropriate handler, returning a stream of
ServerMessages.
Required Methods§
Sourcefn send(
&self,
req: SendMsg,
) -> impl Future<Output = Result<SendResponse>> + Send
fn send( &self, req: SendMsg, ) -> impl Future<Output = Result<SendResponse>> + Send
Handle Send — run agent and return complete response.
Sourcefn stream(
&self,
req: StreamMsg,
) -> impl Stream<Item = Result<StreamEvent>> + Send
fn stream( &self, req: StreamMsg, ) -> impl Stream<Item = Result<StreamEvent>> + Send
Handle Stream — run agent and stream response events.
Sourcefn list_conversations_active(
&self,
) -> impl Future<Output = Result<Vec<ActiveConversationInfo>>> + Send
fn list_conversations_active( &self, ) -> impl Future<Output = Result<Vec<ActiveConversationInfo>>> + Send
Handle ListActiveConversations — list active conversations.
Sourcefn kill_conversation(
&self,
agent: String,
sender: String,
) -> impl Future<Output = Result<bool>> + Send
fn kill_conversation( &self, agent: String, sender: String, ) -> impl Future<Output = Result<bool>> + Send
Handle Kill — close a conversation by (agent, sender).
Sourcefn subscribe_events(&self) -> impl Stream<Item = Result<AgentEventMsg>> + Send
fn subscribe_events(&self) -> impl Stream<Item = Result<AgentEventMsg>> + Send
Handle SubscribeEvents — stream agent events.
Sourcefn reload(&self) -> impl Future<Output = Result<()>> + Send
fn reload(&self) -> impl Future<Output = Result<()>> + Send
Handle Reload — hot-reload runtime from disk.
Sourcefn get_stats(&self) -> impl Future<Output = Result<DaemonStats>> + Send
fn get_stats(&self) -> impl Future<Output = Result<DaemonStats>> + Send
Handle GetStats — return daemon-level stats.
Sourcefn create_cron(
&self,
req: CreateCronMsg,
) -> impl Future<Output = Result<CronInfo>> + Send
fn create_cron( &self, req: CreateCronMsg, ) -> impl Future<Output = Result<CronInfo>> + Send
Handle CreateCron — create a new cron entry and start its timer.
Sourcefn delete_cron(&self, id: u64) -> impl Future<Output = Result<bool>> + Send
fn delete_cron(&self, id: u64) -> impl Future<Output = Result<bool>> + Send
Handle DeleteCron — remove a cron entry and stop its timer.
Sourcefn list_crons(&self) -> impl Future<Output = Result<CronList>> + Send
fn list_crons(&self) -> impl Future<Output = Result<CronList>> + Send
Handle ListCrons — return all cron entries.
Sourcefn subscribe_event(
&self,
req: SubscribeEventMsg,
) -> impl Future<Output = Result<SubscriptionInfo>> + Send
fn subscribe_event( &self, req: SubscribeEventMsg, ) -> impl Future<Output = Result<SubscriptionInfo>> + Send
Handle SubscribeEvent — create an event bus subscription.
Sourcefn unsubscribe_event(
&self,
id: u64,
) -> impl Future<Output = Result<bool>> + Send
fn unsubscribe_event( &self, id: u64, ) -> impl Future<Output = Result<bool>> + Send
Handle UnsubscribeEvent — remove an event bus subscription.
Sourcefn list_subscriptions(
&self,
) -> impl Future<Output = Result<SubscriptionList>> + Send
fn list_subscriptions( &self, ) -> impl Future<Output = Result<SubscriptionList>> + Send
Handle ListSubscriptions — return all event bus subscriptions.
Sourcefn publish_event(
&self,
req: PublishEventMsg,
) -> impl Future<Output = Result<()>> + Send
fn publish_event( &self, req: PublishEventMsg, ) -> impl Future<Output = Result<()>> + Send
Handle PublishEvent — publish an event to the bus.
Sourcefn compact_conversation(
&self,
agent: String,
sender: String,
) -> impl Future<Output = Result<String>> + Send
fn compact_conversation( &self, agent: String, sender: String, ) -> impl Future<Output = Result<String>> + Send
Handle Compact — compact a conversation’s history into a summary.
Sourcefn reply_to_ask(
&self,
agent: String,
sender: String,
content: String,
) -> impl Future<Output = Result<()>> + Send
fn reply_to_ask( &self, agent: String, sender: String, content: String, ) -> impl Future<Output = Result<()>> + Send
Handle ReplyToAsk — deliver a user reply to a pending ask_user tool call.
Sourcefn steer_session(
&self,
req: SteerSessionMsg,
) -> impl Future<Output = Result<()>> + Send
fn steer_session( &self, req: SteerSessionMsg, ) -> impl Future<Output = Result<()>> + Send
Handle SteerSession — inject a user message into an active stream.
Sourcefn list_agents(&self) -> impl Future<Output = Result<Vec<AgentInfo>>> + Send
fn list_agents(&self) -> impl Future<Output = Result<Vec<AgentInfo>>> + Send
Handle ListAgents — return all registered agents.
Sourcefn get_agent(
&self,
name: String,
) -> impl Future<Output = Result<AgentInfo>> + Send
fn get_agent( &self, name: String, ) -> impl Future<Output = Result<AgentInfo>> + Send
Handle GetAgent — return a single agent by name.
Sourcefn create_agent(
&self,
req: CreateAgentMsg,
) -> impl Future<Output = Result<AgentInfo>> + Send
fn create_agent( &self, req: CreateAgentMsg, ) -> impl Future<Output = Result<AgentInfo>> + Send
Handle CreateAgent — create a new agent from JSON config.
Sourcefn update_agent(
&self,
req: UpdateAgentMsg,
) -> impl Future<Output = Result<AgentInfo>> + Send
fn update_agent( &self, req: UpdateAgentMsg, ) -> impl Future<Output = Result<AgentInfo>> + Send
Handle UpdateAgent — update an existing agent from JSON config.
Sourcefn delete_agent(
&self,
name: String,
) -> impl Future<Output = Result<bool>> + Send
fn delete_agent( &self, name: String, ) -> impl Future<Output = Result<bool>> + Send
Handle DeleteAgent — remove an agent by name.
Sourcefn rename_agent(
&self,
old_name: String,
new_name: String,
) -> impl Future<Output = Result<AgentInfo>> + Send
fn rename_agent( &self, old_name: String, new_name: String, ) -> impl Future<Output = Result<AgentInfo>> + Send
Handle RenameAgent — rename an agent in place.
Sourcefn list_providers(
&self,
) -> impl Future<Output = Result<Vec<ProviderInfo>>> + Send
fn list_providers( &self, ) -> impl Future<Output = Result<Vec<ProviderInfo>>> + Send
Handle ListProviders — return all registered LLM providers.
Sourcefn install_plugin(
&self,
req: InstallPluginMsg,
) -> impl Stream<Item = Result<PluginEvent>> + Send
fn install_plugin( &self, req: InstallPluginMsg, ) -> impl Stream<Item = Result<PluginEvent>> + Send
Handle InstallPlugin — install a plugin, stream progress.
Sourcefn uninstall_plugin(
&self,
plugin: String,
) -> impl Stream<Item = Result<PluginEvent>> + Send
fn uninstall_plugin( &self, plugin: String, ) -> impl Stream<Item = Result<PluginEvent>> + Send
Handle UninstallPlugin — uninstall a plugin, stream progress.
Sourcefn list_plugins(&self) -> impl Future<Output = Result<Vec<PluginInfo>>> + Send
fn list_plugins(&self) -> impl Future<Output = Result<Vec<PluginInfo>>> + Send
Handle ListPlugins — return all installed plugins.
Sourcefn search_plugins(
&self,
query: String,
) -> impl Future<Output = Result<Vec<PluginInfo>>> + Send
fn search_plugins( &self, query: String, ) -> impl Future<Output = Result<Vec<PluginInfo>>> + Send
Handle SearchPlugins — search registry for available plugins.
Sourcefn list_skills(&self) -> impl Future<Output = Result<Vec<SkillInfo>>> + Send
fn list_skills(&self) -> impl Future<Output = Result<Vec<SkillInfo>>> + Send
Handle ListSkills — return all available skills with enabled state.
Sourcefn list_models(&self) -> impl Future<Output = Result<Vec<ModelInfo>>> + Send
fn list_models(&self) -> impl Future<Output = Result<Vec<ModelInfo>>> + Send
Handle ListModels — return all resolved models with provider and active state.
Sourcefn list_conversations(
&self,
agent: String,
sender: String,
) -> impl Future<Output = Result<Vec<ConversationInfo>>> + Send
fn list_conversations( &self, agent: String, sender: String, ) -> impl Future<Output = Result<Vec<ConversationInfo>>> + Send
Handle ListConversations — return historical conversations from disk.
Sourcefn get_conversation_history(
&self,
file_path: String,
) -> impl Future<Output = Result<ConversationHistory>> + Send
fn get_conversation_history( &self, file_path: String, ) -> impl Future<Output = Result<ConversationHistory>> + Send
Handle GetConversationHistory — load messages from a session file.
Sourcefn delete_conversation(
&self,
file_path: String,
) -> impl Future<Output = Result<()>> + Send
fn delete_conversation( &self, file_path: String, ) -> impl Future<Output = Result<()>> + Send
Handle DeleteConversation — delete a conversation file from disk.
Sourcefn list_mcps(&self) -> impl Future<Output = Result<Vec<McpInfo>>> + Send
fn list_mcps(&self) -> impl Future<Output = Result<Vec<McpInfo>>> + Send
Handle ListMcps — return all MCP server configs with source info.
Sourcefn upsert_mcp(
&self,
req: UpsertMcpMsg,
) -> impl Future<Output = Result<McpInfo>> + Send
fn upsert_mcp( &self, req: UpsertMcpMsg, ) -> impl Future<Output = Result<McpInfo>> + Send
Handle UpsertMcp — create or replace an MCP server in Storage.
Sourcefn delete_mcp(&self, name: String) -> impl Future<Output = Result<bool>> + Send
fn delete_mcp(&self, name: String) -> impl Future<Output = Result<bool>> + Send
Handle DeleteMcp — remove an MCP server from Storage.
Sourcefn set_provider(
&self,
name: String,
config: String,
) -> impl Future<Output = Result<ProviderInfo>> + Send
fn set_provider( &self, name: String, config: String, ) -> impl Future<Output = Result<ProviderInfo>> + Send
Handle SetProvider — create or update a provider in config.toml.
Sourcefn delete_provider(
&self,
name: String,
) -> impl Future<Output = Result<()>> + Send
fn delete_provider( &self, name: String, ) -> impl Future<Output = Result<()>> + Send
Handle DeleteProvider — remove a provider from config.toml.
Sourcefn set_active_model(
&self,
model: String,
) -> impl Future<Output = Result<()>> + Send
fn set_active_model( &self, model: String, ) -> impl Future<Output = Result<()>> + Send
Handle SetActiveModel — update the active model in config.toml.
Sourcefn list_provider_presets(
&self,
) -> impl Future<Output = Result<Vec<ProviderPresetInfo>>> + Send
fn list_provider_presets( &self, ) -> impl Future<Output = Result<Vec<ProviderPresetInfo>>> + Send
Handle ListProviderPresets — return provider preset templates.
Sourcefn start_service(
&self,
name: String,
force: bool,
) -> impl Future<Output = Result<()>> + Send
fn start_service( &self, name: String, force: bool, ) -> impl Future<Output = Result<()>> + Send
Handle StartService — install and start a command service.
Provided Methods§
Sourcefn dispatch_extension(
&self,
_payload: Vec<u8>,
) -> impl Future<Output = Result<Vec<u8>>> + Send
fn dispatch_extension( &self, _payload: Vec<u8>, ) -> impl Future<Output = Result<Vec<u8>>> + Send
Handle Extension — opaque bytes for downstream product protocols.
Default: returns “not supported”. Downstream products override this to handle their own message formats (local proto, JSON, bincode, etc.).
Sourcefn dispatch(
&self,
msg: ClientMessage,
) -> impl Stream<Item = ServerMessage> + Send + '_
fn dispatch( &self, msg: ClientMessage, ) -> impl Stream<Item = ServerMessage> + Send + '_
Dispatch a ClientMessage to the appropriate handler method.
Returns a stream of ServerMessages. Request-response operations
yield exactly one message; streaming operations yield many.
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.