1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//! Messages flowing into the main loop from input/PTY threads and (in server
//! mode) from client connections.
use std::sync::mpsc::SyncSender;
use ratatui::crossterm::event::{KeyEvent, MouseEvent};
use crate::ids::PaneId;
use crate::ipc::protocol::ServerMessage;
pub enum AppEvent {
Key(KeyEvent),
Mouse(MouseEvent),
Paste(String),
Resize(u16, u16),
/// The given pane produced output; the screen changed.
PtyData(PaneId),
/// The given pane's child process exited.
PtyExit(PaneId),
/// A binary client attached (server mode); `frames` receives rendered frames.
ClientConnected {
id: u64,
frames: SyncSender<ServerMessage>,
cols: u16,
rows: u16,
},
/// A binary client detached.
ClientDetach {
id: u64,
},
/// A module subprocess finished; fill in its log entry.
ModuleCommandFinished {
log_id: u64,
code: Option<i32>,
out: String,
err: String,
},
/// The periodic resumable-session disk scan finished (run on a worker
/// thread — the scan walks agent session stores and must never block the
/// event loop).
SessionsScanned(Vec<crate::agent::SessionInfo>),
/// A FILES-dock directory read finished (docs/38): its sorted entries, run
/// on a worker thread so the tree never blocks a frame on `read_dir`.
DirRead {
path: std::path::PathBuf,
entries: Vec<crate::files::Entry>,
},
/// The file-tree git-status scan finished (docs/38 FILE-6): path -> status.
FileGitStatus(std::collections::HashMap<std::path::PathBuf, crate::git::local::FileStatus>),
/// A file-view read finished (docs/38 FILE-3): applied to the view leaf `id`.
FileRead {
id: PaneId,
load: crate::files::FileLoad,
},
/// The periodic process scan finished: command lines running under each
/// pane's child pid, from one `ps`. `None` means the platform cannot tell
/// (Windows) or `ps` failed — detection then falls back to text heuristics
/// rather than concluding that no agent is running.
ProcScanned(Option<std::collections::HashMap<u32, Vec<String>>>),
/// A git-tab fetch finished; apply it to the matching `GitView`.
GitData {
view: u64,
payload: crate::git::GitPayload,
},
/// A task's quality-gate command finished (ORCH-5): exit 0 → Done, else held
/// at Review with the captured output.
TaskGateFinished {
task: String,
code: Option<i32>,
out: String,
},
}