Skip to main content

combs_mesh/
lib.rs

1//! # combs-mesh — CombsMesh emoji engine core
2//!
3//! Pure-Rust, wasm32-friendly implementation of the CombsMesh emoji spec:
4//! an emoji is a typed bag of blocks (text, sprite atlas, todos, functions,
5//! APIs, lifecycle, character, emotion, encryption, orchestration) that can
6//! be serialized two ways —
7//!
8//! - **`.cmse` binary** ([`EmojiExporter::to_binary`]): `CMSE` container
9//!   with a block directory, CRC32 integrity, and optional per-block AEAD
10//!   encryption at rest driven by the `Enc` block + a [`KeyRing`].
11//! - **Unicode envelope** ([`EmojiExporter::to_unicode`]): self-describing
12//!   PUA plane 15/16 + tag-char encoding for text-only channels.
13//!
14//! Plus: a content-addressed [`Registry`], CPU sprite rendering behind the
15//! [`Renderer`] trait, and the [`CombsEngineCore`] trait the C ABI crate
16//! binds to (with [`DefaultEngine`] as the standalone implementation).
17//!
18//! Deliberate constraints: no GPU/inference deps (the optional `engine`
19//! feature pulls combs-runtime only for `infer`), no C dependencies
20//! (RustCrypto everywhere, algorithm-compatible with `@combs/zerotrust`),
21//! and every reader of external data is panic-free.
22
23pub mod blocks;
24pub mod codepoint;
25pub mod crypto;
26pub mod engine;
27pub mod error;
28pub mod ffi_trait;
29pub mod render;
30
31mod binary;
32#[cfg(feature = "wasm")]
33pub mod wasm;
34
35pub use blocks::{
36    ApiBlock, ApiEndpoint, Block, BlockTag, CharacterBlock, DirectiveKind, EmotionBlock,
37    EmotionState, EncryptionAlgorithm, EncryptionBlock, FunctionBlock, FunctionDef, FunctionKind,
38    ImageBlock, LifecycleBlock, LifecycleState, LifecycleTransition, OrchestrationBlock,
39    OrchestrationDirective, SpriteAtlas, TextBlock, TodoBlock, TodoItem, TodoStatus,
40};
41pub use codepoint::{decode_blocks, encode_blocks, tag_char, tag_from_char};
42pub use crypto::{DEFAULT_HKDF_INFO, KeyRing};
43pub use engine::{Emoji, EmojiBuilder, EmojiExporter, Registry, RegistryEntry, sprites};
44pub use error::{MeshError, Result};
45pub use ffi_trait::{CombsEngineCore, DefaultEngine, EngineError};
46pub use render::{CpuRenderer, Renderer};