Skip to main content

agentic_reality/types/
mod.rs

1//! Core data types for AgenticReality.
2
3pub mod coherence;
4pub mod deployment;
5pub mod environment;
6pub mod error;
7pub mod ids;
8pub mod reality;
9pub mod resource;
10pub mod stakes;
11pub mod temporal;
12pub mod topology;
13
14// Re-export all ID types
15pub use ids::{
16    AnchorId, ContextId, DependencyId, EventId, IncarnationId, NeighborId, ObserverId, ServiceId,
17    SnapshotId, TimelineId, TransitionId,
18};
19
20// Re-export error types
21pub use error::{RealityError, RealityResult};
22
23/// Current timestamp in microseconds since epoch.
24pub fn now_micros() -> u64 {
25    chrono::Utc::now().timestamp_micros() as u64
26}
27
28/// .areal file magic bytes: "REAL"
29pub const AREAL_MAGIC: [u8; 4] = [0x52, 0x45, 0x41, 0x4C];
30
31/// .areal format version
32pub const FORMAT_VERSION: u32 = 1;
33
34/// Header size in bytes
35pub const HEADER_SIZE: usize = 256;
36
37/// Footer size in bytes
38pub const FOOTER_SIZE: usize = 64;
39
40/// Footer magic: "REALEND\0"
41pub const FOOTER_MAGIC: [u8; 8] = [0x52, 0x45, 0x41, 0x4C, 0x45, 0x4E, 0x44, 0x00];