Mode

Trait Mode 

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

Source

fn id(&self) -> &str

Mode identifier (e.g., “code”, “ask”, “vibe”)

Source

fn name(&self) -> &str

Human-readable name

Source

fn description(&self) -> &str

Mode description

Source

fn system_prompt(&self) -> &str

Get system prompt for this mode

Source

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

Source

fn capabilities(&self) -> Vec<Capability>

Get mode-specific capabilities

Source

fn config(&self) -> &ModeConfig

Get mode configuration

Source

fn can_execute(&self, operation: &Operation) -> bool

Validate if operation is allowed in this mode

Source

fn constraints(&self) -> ModeConstraints

Get mode-specific constraints

Implementors§