pub trait Mode: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn name(&self) -> &str;
fn description(&self) -> &str;
fn system_prompt(&self) -> &str;
fn process<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 str,
context: &'life2 ModeContext,
) -> Pin<Box<dyn Future<Output = Result<ModeResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn capabilities(&self) -> Vec<Capability>;
fn config(&self) -> &ModeConfig;
fn can_execute(&self, operation: &Operation) -> bool;
fn constraints(&self) -> ModeConstraints;
}Expand description
Trait that all modes must implement
This trait defines the interface for all modes in the RiceCoder system. Each mode must provide its own implementation of these methods.
Required Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Mode description
Sourcefn system_prompt(&self) -> &str
fn system_prompt(&self) -> &str
Get system prompt for this mode
Sourcefn process<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 str,
context: &'life2 ModeContext,
) -> Pin<Box<dyn Future<Output = Result<ModeResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn process<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 str,
context: &'life2 ModeContext,
) -> Pin<Box<dyn Future<Output = Result<ModeResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Process user input in this mode
Sourcefn capabilities(&self) -> Vec<Capability>
fn capabilities(&self) -> Vec<Capability>
Get mode-specific capabilities
Sourcefn config(&self) -> &ModeConfig
fn config(&self) -> &ModeConfig
Get mode configuration
Sourcefn can_execute(&self, operation: &Operation) -> bool
fn can_execute(&self, operation: &Operation) -> bool
Validate if operation is allowed in this mode
Sourcefn constraints(&self) -> ModeConstraints
fn constraints(&self) -> ModeConstraints
Get mode-specific constraints