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>
90 lines
1.8 KiB
Rust
90 lines
1.8 KiB
Rust
//! Core traits and types for OWLEN LLM client
|
|
//!
|
|
//! This crate provides the foundational abstractions for building
|
|
//! LLM providers, routers, and MCP (Model Context Protocol) adapters.
|
|
|
|
pub mod agent;
|
|
pub mod config;
|
|
pub mod consent;
|
|
pub mod conversation;
|
|
pub mod credentials;
|
|
pub mod encryption;
|
|
pub mod formatting;
|
|
pub mod input;
|
|
pub mod mcp;
|
|
pub mod mode;
|
|
pub mod model;
|
|
pub mod provider;
|
|
pub mod router;
|
|
pub mod sandbox;
|
|
pub mod session;
|
|
pub mod storage;
|
|
pub mod theme;
|
|
pub mod tools;
|
|
pub mod types;
|
|
pub mod ui;
|
|
pub mod validation;
|
|
pub mod wrap_cursor;
|
|
|
|
pub use agent::*;
|
|
pub use config::*;
|
|
pub use consent::*;
|
|
pub use conversation::*;
|
|
pub use credentials::*;
|
|
pub use encryption::*;
|
|
pub use formatting::*;
|
|
pub use input::*;
|
|
pub use mcp::*;
|
|
pub use mode::*;
|
|
pub use model::*;
|
|
pub use provider::*;
|
|
pub use router::*;
|
|
pub use sandbox::*;
|
|
pub use session::*;
|
|
pub use theme::*;
|
|
pub use tools::*;
|
|
pub use validation::*;
|
|
|
|
/// Result type used throughout the OWLEN ecosystem
|
|
pub type Result<T> = std::result::Result<T, Error>;
|
|
|
|
/// Core error types for OWLEN
|
|
#[derive(thiserror::Error, Debug)]
|
|
pub enum Error {
|
|
#[error("Provider error: {0}")]
|
|
Provider(#[from] anyhow::Error),
|
|
|
|
#[error("Network error: {0}")]
|
|
Network(String),
|
|
|
|
#[error("Authentication error: {0}")]
|
|
Auth(String),
|
|
|
|
#[error("Configuration error: {0}")]
|
|
Config(String),
|
|
|
|
#[error("I/O error: {0}")]
|
|
Io(#[from] std::io::Error),
|
|
|
|
#[error("Invalid input: {0}")]
|
|
InvalidInput(String),
|
|
|
|
#[error("Operation timed out: {0}")]
|
|
Timeout(String),
|
|
|
|
#[error("Serialization error: {0}")]
|
|
Serialization(#[from] serde_json::Error),
|
|
|
|
#[error("Storage error: {0}")]
|
|
Storage(String),
|
|
|
|
#[error("Unknown error: {0}")]
|
|
Unknown(String),
|
|
|
|
#[error("Not implemented: {0}")]
|
|
NotImplemented(String),
|
|
|
|
#[error("Permission denied: {0}")]
|
|
PermissionDenied(String),
|
|
}
|