Skip to main content

everruns_core/capabilities/
system_commands.rs

1// System Commands Capability
2//
3// Extension point for built-in /slash commands that execute directly
4// without the LLM. Commands will be added here as they are implemented
5// (e.g., /clear, /status, /compact).
6//
7// System commands are surfaced to the UI via the commands() trait method
8// and executed via the commands API endpoint.
9
10use super::{Capability, CapabilityLocalization, CapabilityStatus};
11
12/// System commands capability ID
13pub const SYSTEM_COMMANDS_CAPABILITY_ID: &str = "system_commands";
14
15/// Built-in system commands capability.
16///
17/// Provides session-control commands that execute directly without
18/// involving the LLM. These appear in the UI command palette.
19/// Commands are added as their handlers are implemented.
20pub struct SystemCommandsCapability;
21
22impl Capability for SystemCommandsCapability {
23    fn id(&self) -> &str {
24        SYSTEM_COMMANDS_CAPABILITY_ID
25    }
26
27    fn name(&self) -> &str {
28        "System Commands"
29    }
30
31    fn description(&self) -> &str {
32        "Built-in session control commands."
33    }
34
35    fn localizations(&self) -> Vec<CapabilityLocalization> {
36        vec![CapabilityLocalization::text(
37            "uk",
38            "Системні команди",
39            "Вбудовані команди керування сесією.",
40        )]
41    }
42
43    fn status(&self) -> CapabilityStatus {
44        CapabilityStatus::Available
45    }
46
47    fn icon(&self) -> Option<&str> {
48        Some("terminal")
49    }
50
51    fn category(&self) -> Option<&str> {
52        Some("System")
53    }
54}
55
56#[cfg(test)]
57mod tests {
58    use super::*;
59
60    // Metadata/tool-list constants covered by builtin_capabilities_satisfy_registry_invariants.
61
62    #[test]
63    fn test_system_commands_no_system_prompt() {
64        let cap = SystemCommandsCapability;
65        assert!(cap.system_prompt_addition().is_none());
66    }
67
68    #[test]
69    fn test_system_commands_empty_until_implemented() {
70        let cap = SystemCommandsCapability;
71        let commands = cap.commands();
72        assert!(commands.is_empty());
73    }
74}