truth_engine/lib.rs
1//! # truth-engine
2//!
3//! Deterministic calendar computation for AI agents.
4//!
5//! The Truth Engine provides mathematically correct recurrence rule expansion,
6//! conflict detection, free/busy computation, multi-calendar availability
7//! merging, and temporal computation that LLMs cannot reliably perform via
8//! inference.
9//!
10//! ## Modules
11//!
12//! - [`expander`] — RRULE string → list of concrete datetime instances
13//! - [`dst`] — DST transition policies (skip, shift, etc.)
14//! - [`conflict`] — Detect overlapping events in expanded schedules
15//! - [`freebusy`] — Compute free time slots from event lists
16//! - [`availability`] — Merge N event streams into unified busy/free with privacy control
17//! - [`temporal`] — Timezone conversion, duration computation, timestamp adjustment, relative datetime resolution
18//! - [`error`] — Error types
19
20pub mod availability;
21pub mod conflict;
22pub mod dst;
23pub mod error;
24pub mod expander;
25pub mod freebusy;
26pub mod temporal;
27
28pub use availability::{
29 find_first_free_across, merge_availability, BusyBlock, EventStream, PrivacyLevel,
30 UnifiedAvailability,
31};
32pub use conflict::find_conflicts;
33pub use error::TruthError;
34pub use expander::{expand_rrule, expand_rrule_with_exdates, ExpandedEvent};
35pub use freebusy::{find_free_slots, FreeSlot};
36pub use temporal::{
37 adjust_timestamp, compute_duration, convert_timezone, resolve_relative, AdjustedTimestamp,
38 ConvertedDatetime, DurationInfo, ResolvedDatetime,
39};