#[derive(Debug, Clone, PartialEq, Eq)]
pub enum UiEvent {
AssistantPartial { text: String },
AssistantMessage { content: String },
ToolCall {
id: String,
name: String,
arguments: String,
},
ToolResult {
id: String,
name: String,
output: String,
success: bool,
},
Usage {
input_tokens: u64,
output_tokens: u64,
},
Reasoning { content: String },
Latency { llm_ms: u64 },
Compacted { removed: usize, kept: usize },
TurnFinished,
Error { message: String },
PlanProposed {
plan_text: String,
tool_calls: Vec<serde_json::Value>,
},
PlanConfirmed,
PlanRejected { reason: String },
PlanModeRequested { reason: String },
PlanModeApproved,
PlanModeRejected { reason: String },
TodoUpdated {
todos: Vec<crate::tools::todo::TodoItem>,
},
GoalContinuing { reason: String, turns: u32 },
GoalAchieved { condition: String, turns: u32 },
GoalCleared,
Interrupted,
SessionResumed {
session_id: String,
turn_count: usize,
},
McpServersLoaded {
entries: Vec<crate::tui::ui::modal::McpEntry>,
},
HookStarted {
hook_event: String,
hook_name: String,
status_message: Option<String>,
},
HookProgress {
hook_event: String,
hook_name: String,
last_line: String,
},
HookFinished {
hook_event: String,
hook_name: String,
outcome: String,
duration_ms: u64,
},
HookSystemMessage { text: String },
#[cfg(feature = "weixin")]
WeixinMessage {
user_id: String,
text: String,
},
}
pub struct PermissionRequest {
pub tool_name: String,
pub args_preview: String,
pub reply: tokio::sync::oneshot::Sender<bool>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum UserAction {
SendMessage(String),
RunShell(String),
ConfirmPlan,
RejectPlan(String),
ApprovePlanMode,
RejectPlanMode(String),
Compact,
SetPlanningMode(bool),
Interrupt,
Shutdown,
SetGoal {
condition: String,
max_turns: u32,
},
ClearGoal,
RunSkillPrompt {
prompt: String,
},
ResumeSession {
session_dir: std::path::PathBuf,
},
ListMcpServers,
}
#[cfg(feature = "weixin")]
pub struct WeixinBackendRequest {
pub user_id: String,
pub text: String,
pub reply_tx: tokio::sync::oneshot::Sender<Option<String>>,
}