vios_app 0.1.1

Small JSON vaults: Argon2id + AES-GCM, with optional AAD binding.
Documentation
use std::fs::{create_dir_all, OpenOptions};

pub fn log_conversation_trace(vault_id: &str, speaker: &str, message: &str) {
    let dir_path = format!("vaults/conversations");
    let file_path = format!("{}/{}_log.txt", dir_path, vault_id);

    // Ensure directory exists
    create_dir_all(&dir_path).expect("❌ Failed to create conversation log directory");

    // Open log file in append mode
    let mut file = OpenOptions::new()
        .create(true)
        .append(true)
        .open(&file_path)
        .expect("❌ Failed to open conversation log");

    // Timestamped message
    let timestamp = Utc::now().to_rfc3339();
    let entry = format!("[{}] {}: {}\n", timestamp, speaker, message);

    file.write_all(entry.as_bytes())
        .expect("❌ Failed to write to conversation log");
}