Create a new registry with built-in commands.
()
| 126 | impl CommandRegistry { |
| 127 | /// Create a new registry with built-in commands. |
| 128 | pub fn new() -> Self { |
| 129 | let mut registry = Self { |
| 130 | commands: HashMap::new(), |
| 131 | }; |
| 132 | registry.register(Arc::new(HelpCommand)); |
| 133 | registry.register(Arc::new(CompactCommand)); |
| 134 | registry.register(Arc::new(CostCommand)); |
| 135 | registry.register(Arc::new(ModelCommand)); |
| 136 | registry.register(Arc::new(ClearCommand)); |
| 137 | registry.register(Arc::new(HistoryCommand)); |
| 138 | registry.register(Arc::new(ToolsCommand)); |
| 139 | registry.register(Arc::new(McpCommand)); |
| 140 | registry |
| 141 | } |
| 142 | |
| 143 | /// Register a custom command. |
| 144 | pub fn register(&mut self, cmd: Arc<dyn SlashCommand>) { |