mirror of
https://github.com/lWolvesl/claw-code.git
synced 2026-04-02 21:01:52 +08:00
Add typed runtime-facing MCP and OAuth configuration models on top of the existing merged settings loader so later parity work can consume validated structures instead of ad hoc JSON traversal. This keeps the first slice bounded to parsing, precedence, exports, and tests. While validating the slice under the repo's required clippy gate, I also fixed a handful of pre-existing clippy failures in runtime file operations so the requested verification command can pass for this commit. Constraint: Must keep scope to parity-unblocking primitives, not full MCP or OAuth flow execution Constraint: cargo clippy --all-targets is a required verification gate for this repo Rejected: Add a new integrations crate first | too much boundary churn for the first landing slice Rejected: Leave existing clippy failures untouched | would block the required verification command for this commit Confidence: medium Scope-risk: moderate Reversibility: clean Directive: Keep future MCP/OAuth additions layered on these typed config surfaces before introducing transport orchestration Tested: cargo fmt --all; cargo test -p runtime; cargo clippy -p runtime --all-targets -- -D warnings Not-tested: workspace-wide clippy/test beyond the runtime crate; live MCP or OAuth network flows
Rust port foundation
This directory contains the first compatibility-first Rust foundation for a drop-in Claude Code CLI replacement.
Current milestone
This initial milestone focuses on harness-first scaffolding, not full feature parity:
- a Cargo workspace aligned to major upstream seams
- a placeholder CLI crate (
rusty-claude-cli) - runtime, command, and tool registry skeleton crates
- a
compat-harnesscrate that reads the upstream TypeScript sources in../src/ - tests that prove upstream manifests/bootstrap hints can be extracted from the leaked TypeScript codebase
Workspace layout
rust/
├── Cargo.toml
├── README.md
├── crates/
│ ├── rusty-claude-cli/
│ ├── runtime/
│ ├── commands/
│ ├── tools/
│ └── compat-harness/
└── tests/
How to use
From this directory:
cargo fmt --all
cargo check --workspace
cargo test --workspace
cargo run -p rusty-claude-cli -- --help
cargo run -p rusty-claude-cli -- dump-manifests
cargo run -p rusty-claude-cli -- bootstrap-plan
Design notes
The shape follows the PRD's harness-first recommendation:
- Extract observable upstream command/tool/bootstrap facts first.
- Keep Rust module boundaries recognizable.
- Grow runtime compatibility behind proof artifacts.
- Document explicit gaps instead of implying drop-in parity too early.
Relationship to the root README
The repository root README explains the leaked TypeScript codebase. This document tracks the Rust replacement effort that lives in rust/.