use std::path::PathBuf;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum TrustyCommand {
Sessions,
Status {
session_id: String,
},
Approve {
session_id: String,
},
Deny {
session_id: String,
},
Overseer,
Tmux,
Projects,
Discover,
Adopt {
session: String,
},
Config {
project: String,
},
Snapshot {
session: String,
},
Kill {
session_id: String,
},
Alerts,
Pair {
code: Option<String>,
},
Send {
session: String,
prompt: String,
},
Launch {
project: PathBuf,
session_name: Option<String>,
},
Connect {
project: PathBuf,
session_name: Option<String>,
},
Start,
Doctor,
CoordinatorChat {
message: String,
},
Help,
}
pub fn help_text() -> &'static str {
"trusty-mpm bot commands:\n\
/sessions — list managed sessions\n\
/status <id> — detailed session status\n\
/approve <id> — approve a pending permission request\n\
/deny <id> — deny a pending permission request\n\
/overseer — show overseer status\n\
/tmux — list all tmux sessions\n\
/projects — discover projects from Claude Code config\n\
/discover — auto-discover tmux sessions running Claude Code\n\
/adopt <session> — adopt an external tmux session\n\
/config <path> — analyze Claude Code config for a project\n\
/snapshot <session> — capture a tmux pane\n\
/kill <id> — kill a session\n\
/send <session> <prompt> — send a prompt to a Claude Code session\n\
/connect <path> — connect to or start a session (no deployment)\n\
/alerts — show alert subscriptions\n\
/pair <code> — pair this bot with your daemon\n\
/start — pairing status and onboarding\n\
/doctor — run full system diagnostic\n\
/help — this message"
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn help_text_lists_every_command() {
let text = help_text();
for cmd in [
"/sessions",
"/status",
"/approve",
"/deny",
"/overseer",
"/tmux",
"/projects",
"/discover",
"/adopt",
"/config",
"/snapshot",
"/kill",
"/send",
"/connect",
"/alerts",
"/pair",
"/start",
"/doctor",
"/help",
] {
assert!(text.contains(cmd), "help text missing {cmd}");
}
}
#[test]
fn pair_command_distinguishes_code_and_status() {
let with_code = TrustyCommand::Pair {
code: Some("A4X9KZ".into()),
};
let status = TrustyCommand::Pair { code: None };
assert_ne!(with_code, status);
}
}