use crate::compaction::CompactionConfig;
use crate::models::{Message, SystemPrompt};
use crate::tui::app::AppMode;
use std::path::PathBuf;
#[derive(Debug, Clone)]
pub enum Op {
SendMessage {
content: String,
mode: AppMode,
model: String,
allow_shell: bool,
trust_mode: bool,
auto_approve: bool,
},
#[allow(dead_code)]
CancelRequest,
#[allow(dead_code)]
ApproveToolCall { id: String },
#[allow(dead_code)]
DenyToolCall { id: String },
#[allow(dead_code)]
SpawnSubAgent { prompt: String },
ListSubAgents,
#[allow(dead_code)]
ChangeMode { mode: AppMode },
#[allow(dead_code)]
SetModel { model: String },
SetCompaction { config: CompactionConfig },
SyncSession {
messages: Vec<Message>,
system_prompt: Option<SystemPrompt>,
model: String,
workspace: PathBuf,
},
CompactContext,
Shutdown,
}
impl Op {
pub fn send(
content: impl Into<String>,
mode: AppMode,
model: impl Into<String>,
allow_shell: bool,
trust_mode: bool,
auto_approve: bool,
) -> Self {
Op::SendMessage {
content: content.into(),
mode,
model: model.into(),
allow_shell,
trust_mode,
auto_approve,
}
}
}