feat(phase5): implement mode consolidation and tool availability system

Implements Phase 5 from the roadmap with complete mode-based tool filtering:

- Add Mode enum (Chat/Code) with FromStr trait implementation
- Extend Config with ModeConfig for per-mode tool availability
- Update ToolRegistry to enforce mode-based filtering
- Add --code/-c CLI argument to start in code mode
- Implement TUI commands: :mode, :code, :chat, :tools
- Add operating mode indicator to status line (💬/💻 badges)
- Create comprehensive documentation in docs/phase5-mode-system.md

Default configuration:
- Chat mode: only web_search allowed
- Code mode: all tools allowed (wildcard *)

All code compiles cleanly with cargo clippy passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-09 20:17:41 +02:00
parent 33d11ae223
commit e57844e742
9 changed files with 581 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ pub mod encryption;
pub mod formatting;
pub mod input;
pub mod mcp;
pub mod mode;
pub mod model;
pub mod provider;
pub mod router;
@@ -34,6 +35,7 @@ pub use encryption::*;
pub use formatting::*;
pub use input::*;
pub use mcp::*;
pub use mode::*;
pub use model::*;
pub use provider::*;
pub use router::*;