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
73
74
// System Commands Capability
//
// Extension point for built-in /slash commands that execute directly
// without the LLM. Commands will be added here as they are implemented
// (e.g., /clear, /status, /compact).
//
// System commands are surfaced to the UI via the commands() trait method
// and executed via the commands API endpoint.
use super::{Capability, CapabilityLocalization, CapabilityStatus};
/// System commands capability ID
pub const SYSTEM_COMMANDS_CAPABILITY_ID: &str = "system_commands";
/// Built-in system commands capability.
///
/// Provides session-control commands that execute directly without
/// involving the LLM. These appear in the UI command palette.
/// Commands are added as their handlers are implemented.
pub struct SystemCommandsCapability;
impl Capability for SystemCommandsCapability {
fn id(&self) -> &str {
SYSTEM_COMMANDS_CAPABILITY_ID
}
fn name(&self) -> &str {
"System Commands"
}
fn description(&self) -> &str {
"Built-in session control commands."
}
fn localizations(&self) -> Vec<CapabilityLocalization> {
vec![CapabilityLocalization::text(
"uk",
"Системні команди",
"Вбудовані команди керування сесією.",
)]
}
fn status(&self) -> CapabilityStatus {
CapabilityStatus::Available
}
fn icon(&self) -> Option<&str> {
Some("terminal")
}
fn category(&self) -> Option<&str> {
Some("System")
}
}
#[cfg(test)]
mod tests {
use super::*;
// Metadata/tool-list constants covered by builtin_capabilities_satisfy_registry_invariants.
#[test]
fn test_system_commands_no_system_prompt() {
let cap = SystemCommandsCapability;
assert!(cap.system_prompt_addition().is_none());
}
#[test]
fn test_system_commands_empty_until_implemented() {
let cap = SystemCommandsCapability;
let commands = cap.commands();
assert!(commands.is_empty());
}
}