xynthe 0.1.0

A unified orchestration framework for autonomous intelligence with temporal continuity
Documentation
//! Xynthe - A Unified Orchestration Framework for Autonomous Intelligence
//!
//! Xynthe provides a unified substrate for architecting autonomous agents whose cognition,
//! memory, and action form a continuous, self-reinforcing loop. It enables development
//! of agents that maintain identity across sessions, adapt through reflection, and
//! guarantee safety through formal constraints.
//!
//! # Core Primitives
//!
//! Xynthe's architecture is built on three foundational primitives:
//!
//! ## Thought Streams
//! Typed channels carrying structured cognitive events that enable agents to maintain
//! multiple reasoning threads simultaneously.
//!
//! ## Capability Bindings
//! Type-safe interfaces that formalize tool integration through formal contracts
//! specifying preconditions, effects, failure semantics, and reflection hooks.
//!
//! ## Context Fabrics
//! Temporally aware memory substrates that provide multi-layered context with
//! asynchronous updates and unified query interfaces.
//!
//! # Example
//!
//! ```rust
//! use xynthe::prelude::*;
//! use uuid::Uuid;
//!
//! # #[tokio::main]
//! # async fn main() -> Result<()> {
//! // Create a thought stream for tracking observations
//! let stream = ThoughtStream::new("observations");
//!
//! // Emit an observation event
//! let event = ThoughtEvent {
//!     id: Uuid::new_v4(),
//!     timestamp: Timestamp::now(),
//!     event_type: ThoughtEventType::Observation,
//!     content: StructuredContent::Text("User requested weather information".into()),
//!     provenance: ProvenanceChain::default(),
//!     confidence: 1.0,
//! };
//!
//! stream.emit(event).await?;
//! # Ok(())
//! # }
//! ```

#![warn(missing_docs)]
#![warn(rustdoc::missing_crate_level_docs)]
#![deny(unsafe_code)]
#![cfg_attr(docsrs, feature(doc_cfg))]

pub mod error;
pub mod types;
pub mod thought_stream;
pub mod capability_binding;
pub mod context_fabric;
pub mod execution;
pub mod trace;

/// Re-export commonly used types for convenience
pub use error::{Error, Result};
pub use capability_binding::{Capability, CapabilityRegistry, CapabilityContract};
pub use context_fabric::ContextFabric;

/// Re-export commonly used types and traits
pub mod prelude {
    pub use crate::capability_binding::{Capability, CapabilityRegistry, CapabilityContract, CapabilityTrace};
    pub use crate::context_fabric::ContextFabric;
    pub use crate::error::{Error, Result};
    pub use crate::execution::ExecutionEngine;
    pub use crate::thought_stream::{ThoughtEvent, ThoughtEventType, ThoughtStream};
    pub use crate::types::{ProvenanceChain, StructuredContent, Timestamp};
}

/// Version of the Xynthe library
pub const VERSION: &str = env!("CARGO_PKG_VERSION");

/// Initialize Xynthe with default configuration
pub fn init() {
    tracing_subscriber::fmt()
        .with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
        .init();
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_version() {
        assert_eq!(VERSION, env!("CARGO_PKG_VERSION"));
    }
}