Skip to main content

Module safety

Module safety 

Source
Expand description

Safety layer for agent file operations.

This module provides protection against destructive operations through:

  • Soft delete with trash (files can be recovered)
  • Audit history logging
  • Undo support for reversible operations

Re-exportsยง

use chrono::DateTime; ๐Ÿ”’
use chrono::Utc; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use std::fs; ๐Ÿ”’
use std::fs::File; ๐Ÿ”’
use std::fs::OpenOptions; ๐Ÿ”’
use std::io::BufRead; ๐Ÿ”’
use std::io::BufReader; ๐Ÿ”’
use std::io::Write; ๐Ÿ”’
use std::path::Path; ๐Ÿ”’
use std::path::PathBuf; ๐Ÿ”’
use std::sync::Arc; ๐Ÿ”’
use tokio::sync::RwLock; ๐Ÿ”’
use tracing::debug; ๐Ÿ”’
use tracing::info; ๐Ÿ”’
use tracing::warn; ๐Ÿ”’
use uuid::Uuid; ๐Ÿ”’

Structsยง

HistoryEntry
Entry in the history log.
SafetyConfig
Configuration for the safety manager.
SafetyManager
Safety manager for protecting file operations.
TrashEntry
Entry in the trash directory.

Enumsยง

HistoryOperation
Type of operation for history logging.
UndoData
Data needed to undo an operation.