Skip to main content

slick/
lib.rs

1//! slickit — Semantic, LLM-Interpretable Component Kit.
2//!
3//! Two layers, both in-memory:
4//!
5//! | Layer | Feature | Types | Consumer |
6//! |-------|---------|-------|----------|
7//! | Runtime | default | [`TypedConfig`], [`TypedRegistry`], [`RegistryError`] | geist-edge |
8//! | Authoring | `manifest` | [`Kind`], [`Manifest`] | Composer |
9//!
10//! Bridge: `Manifest.type_url` = `TypedConfig.type_url`.
11//!
12//! Cross-surface: Rust is canonical. Crusts (PyO3, wasm-bindgen) expose
13//! identical types to Python and TypeScript.
14//!
15//! # Example (runtime layer)
16//!
17//! ```
18//! use slick::{TypedConfig, TypedRegistryBuilder};
19//!
20//! let registry = TypedRegistryBuilder::<String, String>::new()
21//!     .register("example.v1", |value| {
22//!         let name: String = serde_json::from_value(value.clone())
23//!             .map_err(|e| e.to_string())?;
24//!         Ok(name)
25//!     })
26//!     .build();
27//!
28//! let config = serde_json::json!("hello");
29//! let instance = registry.create("example.v1", &config).unwrap();
30//! assert_eq!(instance, "hello");
31//! ```
32
33mod registry;
34
35pub use registry::{RegistryError, TypedConfig, TypedRegistry, TypedRegistryBuilder};
36
37#[cfg(feature = "manifest")]
38pub mod manifest;
39
40#[cfg(feature = "manifest")]
41pub use manifest::{Kind, Manifest};