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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! Command driver for reovim - command execution framework.
//!
//! Linux equivalent: `drivers/block/` (block command interface)
//!
//! # Architecture
//!
//! This crate defines the command execution framework for reovim.
//! Commands implement [`Command`] for metadata and [`CommandHandler`] for execution.
//!
//! ```text
//! server/lib/drivers/command/ <-- Command framework (this crate)
//! ^
//! | (modules implement commands)
//! |
//! server/modules/ <-- Policy: actual command implementations
//! ```
//!
//! # Components
//!
//! - [`Command`] - Self-describing command metadata
//! - [`CommandHandler`] - Command execution trait
//! - [`ArgSpec`] - Argument specification
//! - [`ArgKind`], [`ArgValue`] - Argument types
//! - [`CommandContext`] - Context carrying all command inputs
//! - [`CommandResult`] - Command execution result
//!
//! # Example
//!
//! ```ignore
//! use reovim_driver_command::{Command, CommandHandler, CommandContext, CommandResult, ArgSpec, ArgKind};
//! use reovim_driver_session::SessionRuntime;
//! use reovim_kernel::api::v1::{CommandId, ModuleId};
//!
//! const MY_MODULE: ModuleId = ModuleId::new_const("my-module");
//!
//! pub struct CursorDown;
//!
//! impl Command for CursorDown {
//! fn id(&self) -> CommandId {
//! CommandId::new(MY_MODULE, "cursor-down")
//! }
//!
//! fn description(&self) -> &'static str {
//! "Move cursor down"
//! }
//!
//! fn args(&self) -> Vec<ArgSpec> {
//! vec![ArgSpec::optional("count", ArgKind::Count, "Number of lines")]
//! }
//! }
//!
//! impl CommandHandler for CursorDown {
//! fn execute(&self, runtime: &mut SessionRuntime<'_>, args: &CommandContext) -> CommandResult {
//! let count = args.count().unwrap_or(1);
//! // Move cursor down by count lines using runtime.kernel() escape hatch
//! // or BufferApi methods
//! CommandResult::Success
//! }
//! }
//! ```
// Internal modules
// Re-export from command-types for backwards compatibility
pub use ;
// Re-export provider trait
pub use CommandProvider;
// Re-export registry for ServiceRegistry (Epic #417 Part 3)
pub use CommandHandlerStore;
// Re-export query service (#453, #522)
pub use ;
// Re-export name index and cmdline parser (#547, #559, #561)
pub use ;
// Re-export traits
pub use ;