mirror of
https://github.com/lWolvesl/claw-code.git
synced 2026-04-02 19:11:51 +08:00
feat: Rust port of Claude Code CLI
Crates: - api: Anthropic Messages API client with SSE streaming - tools: Claude-compatible tool implementations (Bash, Read, Write, Edit, Glob, Grep + extended suite) - runtime: conversation loop, session persistence, permissions, system prompt builder - rusty-claude-cli: terminal UI with markdown rendering, syntax highlighting, spinners - commands: subcommand definitions - compat-harness: upstream TS parity verification All crates pass cargo fmt/clippy/test.
This commit is contained in:
29
rust/crates/commands/src/lib.rs
Normal file
29
rust/crates/commands/src/lib.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct CommandManifestEntry {
|
||||
pub name: String,
|
||||
pub source: CommandSource,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum CommandSource {
|
||||
Builtin,
|
||||
InternalOnly,
|
||||
FeatureGated,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, PartialEq, Eq)]
|
||||
pub struct CommandRegistry {
|
||||
entries: Vec<CommandManifestEntry>,
|
||||
}
|
||||
|
||||
impl CommandRegistry {
|
||||
#[must_use]
|
||||
pub fn new(entries: Vec<CommandManifestEntry>) -> Self {
|
||||
Self { entries }
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn entries(&self) -> &[CommandManifestEntry] {
|
||||
&self.entries
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user