//! Permission management system for tool execution.
//!
//! This module provides a comprehensive permission system for controlling access
//! to potentially dangerous operations like file writes, command execution,
//! HTTP requests, and more.
//!
//! # Key Components
//!
//! - [`PermissionConfig`](config::PermissionConfig): Configuration for permissions including
//!   whitelist rules and session grants
//! - [`PermissionChecker`](checker::PermissionChecker): Trait for checking and requesting permissions
//! - [`PermissionType`](config::PermissionType): Types of permissions (WriteFile, ExecuteCommand, etc.)
//!
//! # Usage
//!
//! ```ignore
//! use std::sync::Arc;
//! use crate::permission::{PermissionConfig, PermissionChecker, PermissionType};
//!
//! // Create a permission configuration
//! let config = Arc::new(PermissionConfig::new());
//!
//! // Check if permission is needed
//! if config.needs_confirmation(PermissionType::WriteFile, "/tmp/test.txt") {
//!     // Request user confirmation...
//! }
//!
//! // Grant session permission
//! config.grant_session_permission(PermissionType::WriteFile, "/tmp/*");
//! ```

pub mod approval_store;
pub mod bash_security;
pub mod checker;
pub mod config;
pub mod hierarchy;
pub mod rule_parser;
pub mod storage;
pub mod tool_permissions;

// Re-export commonly used types
pub use approval_store::{with_cached_approval, ApprovalDecision, ApprovalStore};
pub use checker::{
    is_safe_edit_command, AllowAllPermissionChecker, ConfigPermissionChecker,
    DenyDangerousPermissionChecker, LoggingPermissionChecker, ModeAwarePermissionChecker,
    PermissionChecker, PermissionCheckerExt, PermissionContext, PermissionError, PermissionResult,
};
pub use config::{
    PermissionConfig, PermissionMode, PermissionRule, PermissionType, RiskLevel,
    SerializablePermissionConfig, SessionGrant,
};
pub use hierarchy::PermissionRuleSet;
pub use rule_parser::ParsedRule;
pub use storage::PermissionStorage;
pub use tool_permissions::{check_permissions, check_tool_rules, is_delete_command};
