Skip to main content

indusagi_core/
lib.rs

1//! Cross-cutting primitives that every indusagi crate depends on.
2//!
3//! This is the foundational crate of the 100%-Rust indusagi rebuild — the
4//! "packaging skin and shared vocabulary" that no single subsystem owns but all
5//! of them need. It deliberately carries no subsystem logic; it ships the
6//! load-bearing primitives:
7//!
8//! - [`cancel`] — the framework's single cancellation currency
9//!   ([`cancel::CancellationToken`]) with the parent→round→child chain helpers
10//!   and the typed-error gate (cancel yields a typed [`errors::CoreError`], never
11//!   a panic).
12//! - [`canonical`] — the character-faithful `JSON.stringify` encoder and
13//!   [`canonical::content_hash`], the parity-critical content-addressing surface.
14//! - [`env`] — the single environment-variable registry (brand grammar,
15//!   `INDUSAGI_HOME`, the provider-table skeleton).
16//! - [`brand`] — the one source of naming truth ([`brand::BRAND`], [`brand::env_name`]).
17//! - [`locate`] — the unified [`locate::Locator`] honoring `INDUSAGI_HOME` on all
18//!   state paths.
19//! - [`version`] — the single-source [`version::VERSION`] (kills the TS 3-way drift).
20//! - [`ids`] — ULID id helpers.
21//! - [`errors`] — the shared closed [`errors::CoreError`] vocabulary.
22//! - [`channel`] — the re-iterable [`channel::Channel`] stream factory.
23//! - [`time`] — the single wall-clock surface ([`time::now_ms`], the canonical
24//!   `Date.now()` analogue) that replaces a dozen per-module copies.
25
26pub mod brand;
27pub mod cancel;
28pub mod canonical;
29pub mod channel;
30pub mod env;
31pub mod errors;
32pub mod ids;
33pub mod locate;
34pub mod time;
35pub mod version;
36
37// Re-export the most frequently reached-for symbols at the crate root so
38// downstream crates can `use indusagi_core::{VERSION, CoreError, CancellationToken}`.
39pub use brand::{BRAND, Brand, env_name};
40pub use cancel::{CancelExt, CancellationToken};
41pub use canonical::{HASH_WIDTH, canonical_json, content_hash};
42pub use channel::{BoxStream, Channel};
43pub use errors::{CoreError, CoreResult};
44pub use locate::{Locator, LocatorOverrides};
45pub use time::now_ms;
46pub use version::VERSION;