Skip to main content

Server

Trait Server 

Source
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§

Source

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

Handle Send — run agent and return complete response.

Source

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

Handle Stream — run agent and stream response events.

Source

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

Handle Ping — keepalive.

Source

fn list_conversations_active( &self, ) -> impl Future<Output = Result<Vec<ActiveConversationInfo>>> + Send

Handle ListActiveConversations — list active conversations.

Source

fn kill_conversation( &self, agent: String, sender: String, ) -> impl Future<Output = Result<bool>> + Send

Handle Kill — close a conversation by (agent, sender).

Source

fn subscribe_events(&self) -> impl Stream<Item = Result<AgentEventMsg>> + Send

Handle SubscribeEvents — stream agent events.

Source

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

Handle Reload — hot-reload runtime from disk.

Source

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

Handle GetStats — return daemon-level stats.

Source

fn create_cron( &self, req: CreateCronMsg, ) -> impl Future<Output = Result<CronInfo>> + Send

Handle CreateCron — create a new cron entry and start its timer.

Source

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

Handle DeleteCron — remove a cron entry and stop its timer.

Source

fn list_crons(&self) -> impl Future<Output = Result<CronList>> + Send

Handle ListCrons — return all cron entries.

Source

fn subscribe_event( &self, req: SubscribeEventMsg, ) -> impl Future<Output = Result<SubscriptionInfo>> + Send

Handle SubscribeEvent — create an event bus subscription.

Source

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

Handle UnsubscribeEvent — remove an event bus subscription.

Source

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

Handle ListSubscriptions — return all event bus subscriptions.

Source

fn publish_event( &self, req: PublishEventMsg, ) -> impl Future<Output = Result<()>> + Send

Handle PublishEvent — publish an event to the bus.

Source

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

Handle Compact — compact a conversation’s history into a summary.

Source

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.

Source

fn steer_session( &self, req: SteerSessionMsg, ) -> impl Future<Output = Result<()>> + Send

Handle SteerSession — inject a user message into an active stream.

Source

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

Handle ListAgents — return all registered agents.

Source

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

Handle GetAgent — return a single agent by name.

Source

fn create_agent( &self, req: CreateAgentMsg, ) -> impl Future<Output = Result<AgentInfo>> + Send

Handle CreateAgent — create a new agent from JSON config.

Source

fn update_agent( &self, req: UpdateAgentMsg, ) -> impl Future<Output = Result<AgentInfo>> + Send

Handle UpdateAgent — update an existing agent from JSON config.

Source

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

Handle DeleteAgent — remove an agent by name.

Source

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

Handle RenameAgent — rename an agent in place.

Source

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

Handle ListProviders — return all registered LLM providers.

Source

fn install_plugin( &self, req: InstallPluginMsg, ) -> impl Stream<Item = Result<PluginEvent>> + Send

Handle InstallPlugin — install a plugin, stream progress.

Source

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

Handle UninstallPlugin — uninstall a plugin, stream progress.

Source

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

Handle ListPlugins — return all installed plugins.

Source

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

Handle SearchPlugins — search registry for available plugins.

Source

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

Handle ListSkills — return all available skills with enabled state.

Source

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

Handle ListModels — return all resolved models with provider and active state.

Source

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

Handle ListConversations — return historical conversations from disk.

Source

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

Handle GetConversationHistory — load messages from a session file.

Source

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

Handle DeleteConversation — delete a conversation file from disk.

Source

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

Handle ListMcps — return all MCP server configs with source info.

Source

fn upsert_mcp( &self, req: UpsertMcpMsg, ) -> impl Future<Output = Result<McpInfo>> + Send

Handle UpsertMcp — create or replace an MCP server in Storage.

Source

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

Handle DeleteMcp — remove an MCP server from Storage.

Source

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

Handle SetProvider — create or update a provider in config.toml.

Source

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

Handle DeleteProvider — remove a provider from config.toml.

Source

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

Handle SetActiveModel — update the active model in config.toml.

Source

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

Handle ListProviderPresets — return provider preset templates.

Source

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

Handle StartService — install and start a command service.

Source

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

Handle StopService — stop and uninstall a command service.

Source

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

Handle ServiceLogs — return recent log lines for a service.

Provided Methods§

Source

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.).

Source

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.

Implementors§