codex-memory 0.1.51

An advanced hierarchical memory system for AI agents with MCP integration
#!/usr/bin/env cargo +nightly -Zscript
//! Test script to demonstrate codex-dreams functionality
//!
//! ```cargo
//! [dependencies]
//! tokio = { version = "1.0", features = ["full"] }
//! sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "postgres", "uuid"] }
//! uuid = { version = "1.0", features = ["v4"] }
//! serde_json = "1.0"
//! tracing = "0.1"
//! ```

#[cfg(feature = "codex-dreams")]
use std::sync::Arc;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    println!("🧠 Testing Codex Dreams Implementation");
    println!("======================================");
    
    // Test basic compilation of codex-dreams structs
    #[cfg(feature = "codex-dreams")]
    {
        use codex_memory::insights::{
            processor::ProcessorConfig,
            models::{InsightType, Insight},
            storage::InsightStorage,
        };
        use codex_memory::memory::MemoryRepository;
        
        println!("✅ Successfully imported codex-dreams modules");
        
        // Test that we can create configurations
        let config = ProcessorConfig {
            max_retries: 3,
            circuit_breaker_threshold: 5,
            circuit_breaker_recovery_timeout: 60,
            min_confidence_threshold: 0.6,
            max_insights_per_batch: 10,
        };
        
        println!("✅ ProcessorConfig created with confidence threshold: {}", config.min_confidence_threshold);
        
        // Test insight types
        let insight_types = vec![
            InsightType::Learning,
            InsightType::Connection,
            InsightType::Pattern,
            InsightType::MentalModel,
        ];
        
        println!("✅ InsightType variants available: {:?}", insight_types);
        
        return Ok(());
    }
    
    #[cfg(not(feature = "codex-dreams"))]
    {
        println!("❌ codex-dreams feature not enabled");
        return Err("Feature not enabled".into());
    }
}