feat(core): Define AppMode enum and add to AppState
This commit is contained in:
@@ -1,12 +1,27 @@
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::Mutex;
|
||||
use llm_core::ChatMessage;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum AppMode {
|
||||
Normal,
|
||||
Plan,
|
||||
AcceptAll,
|
||||
}
|
||||
|
||||
impl Default for AppMode {
|
||||
fn default() -> Self {
|
||||
Self::Normal
|
||||
}
|
||||
}
|
||||
|
||||
/// Shared application state
|
||||
#[derive(Debug, Default)]
|
||||
pub struct AppState {
|
||||
pub messages: Vec<ChatMessage>,
|
||||
pub running: bool,
|
||||
pub mode: AppMode,
|
||||
}
|
||||
|
||||
impl AppState {
|
||||
@@ -14,6 +29,7 @@ impl AppState {
|
||||
Self {
|
||||
messages: Vec::new(),
|
||||
running: true,
|
||||
mode: AppMode::Normal,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user