返回 CodeWhale
mod.rs
根目录 / crates / tui / src / commands / groups / mod.rs
1 //! Group-owned built-in command areas.
2 //!
3 //! Each group module registers command objects into the central command
4 //! registry. Command implementation functions still live with their owning
5 //! groups, while dispatch, palette metadata, and help lookup all read from the
6 //! same registry surface.
7
8 macro_rules! cached_command_list {
9 ($commands:expr) => {{
10 static COMMANDS: std::sync::OnceLock<Vec<Box<dyn crate::commands::traits::Command>>> =
11 std::sync::OnceLock::new();
12 COMMANDS.get_or_init(|| $commands).as_slice()
13 }};
14 }
15
16 pub mod config;
17 pub mod core;
18 pub mod memory;
19 pub mod plugins;
20 pub mod project;
21 pub mod session;
22 pub mod skills;
23 pub mod utility;
24
25 use std::sync::OnceLock;
26
27 use crate::commands::traits::CommandGroup;
28
29 pub fn all_command_groups() -> &'static [&'static dyn CommandGroup] {
30 static GROUPS: OnceLock<Vec<&'static dyn CommandGroup>> = OnceLock::new();
31 GROUPS
32 .get_or_init(|| {
33 vec![
34 &core::CoreCommands,
35 &super::session_group::SessionCommands,
36 &super::config_group::ConfigCommands,
37 &super::debug_group::DebugCommands,
38 &project::ProjectCommands,
39 &skills::SkillsCommands,
40 &memory::MemoryCommands,
41 &plugins::PluginsCommands,
42 &utility::UtilityCommands,
43 ]
44 })
45 .as_slice()
46 }
47
47 lines RUST