Skip to main content

muster/domain/process/
activity.rs

1use strum::Display;
2
3/// What a running process appears to be doing, inferred from its terminal
4/// signals. Orthogonal to [`ProcessState`](super::ProcessState): the lifecycle
5/// says whether a child is alive, this says whether it is busy or waiting on the
6/// user. The TUI maps it to a sidebar accent; the domain stays free of rendering.
7#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Display)]
8#[strum(serialize_all = "lowercase")]
9pub enum ActivityState {
10    /// No recent signal: freshly started, stopped, or between bursts of work.
11    #[default]
12    Idle,
13    /// Producing output or reporting progress right now.
14    Working,
15    /// Signalled that it wants the user, via a bell or a notification sequence
16    /// (e.g. an agent that finished and is waiting for the next instruction).
17    AwaitingInput,
18}
19
20#[cfg(test)]
21mod tests {
22    use super::*;
23
24    #[test]
25    fn defaults_to_idle() {
26        assert_eq!(ActivityState::default(), ActivityState::Idle);
27    }
28}