Skip to main content

openclaw_core/
lib.rs

1//! # `OpenClaw` Core
2//!
3//! Core types, configuration, and storage for `OpenClaw`.
4//!
5//! This crate provides:
6//! - Configuration loading and validation (JSON5 format)
7//! - Event-sourced session storage (grite pattern)
8//! - CRDT projections for session state
9//! - Secrets management with encryption at rest
10//! - Input validation and sanitization
11
12#![forbid(unsafe_code)]
13#![warn(missing_docs)]
14
15pub mod auth;
16pub mod config;
17pub mod events;
18pub mod secrets;
19pub mod types;
20pub mod validation;
21
22pub use auth::AuthProfile;
23pub use config::{Config, ConfigError};
24pub use events::{EventStore, SessionEvent, SessionEventKind, SessionProjection};
25pub use secrets::CredentialStore;
26pub use secrets::{ApiKey, scrub_secrets};
27pub use types::{AgentId, ChannelId, Message, PeerId, SessionKey};
28pub use validation::{ValidationError, validate_message_content};
29
30/// Re-export commonly used external types
31pub mod prelude {
32    pub use crate::config::Config;
33    pub use crate::events::{EventStore, SessionEvent, SessionProjection};
34    pub use crate::secrets::ApiKey;
35    pub use crate::types::*;
36    pub use crate::validation::validate_message_content;
37}