use std::sync::Arc;
use async_trait::async_trait;
use serde::{Deserialize, Serialize};
use crate::error::Result;
use crate::id::SessionId;
use crate::tool::{Tool, ToolOutput};
#[derive(Debug, Clone)]
pub struct SystemPromptContext {
pub session_id: SessionId,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CommandDescriptor {
pub name: String,
pub description: String,
}
#[derive(Debug, Clone)]
pub struct CommandContext {
pub session_id: SessionId,
}
#[async_trait]
pub trait Capability: Send + Sync {
fn id(&self) -> &str;
fn name(&self) -> &str {
self.id()
}
fn description(&self) -> &str {
""
}
async fn system_prompt_contribution(&self, _context: &SystemPromptContext) -> Option<String> {
None
}
async fn tools(&self) -> Result<Vec<Arc<dyn Tool>>> {
Ok(Vec::new())
}
fn commands(&self) -> Vec<CommandDescriptor> {
Vec::new()
}
async fn execute_command(
&self,
_name: &str,
_args: &str,
_context: &CommandContext,
) -> Option<ToolOutput> {
None
}
}