//! Internal app events delivered via channel. //! //! Background tasks (PTY child watchers, future hook listeners, etc.) send //! events to the main loop through this channel. No polling needed. use crate::detect::{Agent, AgentState}; use crate::layout::PaneId; use crate::workspace::WorkspaceGitStatus; /// An event from a background task to the main loop. #[derive(Debug)] pub enum AppEvent { /// A pane's child process exited. PaneDied { pane_id: PaneId }, /// Fallback detector state changed in a pane. StateChanged { pane_id: PaneId, agent: Option, state: AgentState, }, /// Hook-authoritative agent state was reported for a pane. HookStateReported { pane_id: PaneId, source: String, agent_label: String, state: AgentState, message: Option, custom_status: Option, seq: Option, }, /// Hook authority was explicitly cleared for a pane. HookAuthorityCleared { pane_id: PaneId, source: Option, seq: Option, }, /// The current detected agent gracefully released this pane back to the shell. HookAgentReleased { pane_id: PaneId, source: String, agent_label: String, known_agent: Option, seq: Option, }, /// A new version is available through the active installation manager. UpdateReady { version: String, install_command: String, }, /// A pane child emitted a valid OSC 52 clipboard write. The main loop /// re-emits it through herdr's own clipboard writer. ClipboardWrite { content: Vec }, /// Background git status refresh completed for workspaces. GitStatusRefreshed { results: Vec }, }