Skip to main content

muster/domain/process/
kind.rs

1use serde::{Deserialize, Serialize};
2use strum::Display;
3
4/// Which sidebar section a process belongs to.
5#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Display, Serialize, Deserialize)]
6#[strum(serialize_all = "lowercase")]
7#[serde(rename_all = "lowercase")]
8pub enum ProcessKind {
9    /// A CLI coding agent (Claude Code, Codex, ...).
10    Agent,
11    /// A plain interactive shell.
12    Terminal,
13    /// A long-running dev command (dev server, queue worker, ...).
14    Command,
15}
16
17impl ProcessKind {
18    /// Returns this kind's stable sidebar section position.
19    pub(crate) const fn section_index(self) -> usize {
20        match self {
21            Self::Agent => 0,
22            Self::Terminal => 1,
23            Self::Command => 2,
24        }
25    }
26}
27
28#[cfg(test)]
29mod tests {
30    use super::*;
31
32    #[test]
33    fn displays_lowercase() {
34        assert_eq!(ProcessKind::Agent.to_string(), "agent");
35        assert_eq!(ProcessKind::Terminal.to_string(), "terminal");
36        assert_eq!(ProcessKind::Command.to_string(), "command");
37    }
38}