1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! 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::agent::tools::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/*");
//! ```
// Re-export commonly used types
pub use ;
pub use ;
pub use ;
pub use PermissionStorage;
pub use ;