Skip to main content

sim_lib_intent/
lib.rs

1//! Intent value model, gesture algebra, and `codec:intent` (WEBUI_4).
2//!
3//! An Intent is a user (or agent) gesture expressed as a SIM value and decoded
4//! into a checked operation. An Intent says *what the operator wants*, in terms
5//! an editor can validate against a Shape before it ever touches runtime state.
6//! Intents round-trip through `codec:intent` and carry an `origin.operator`
7//! (human or agent) plus a logical tick for audit.
8//!
9//! This crate provides:
10//!
11//! - the Intent [`kinds`] and their required fields (open metadata);
12//! - a [`model`] of origin, builders, accessors, fail-closed validation, and
13//!   target resolution against a caller-supplied predicate;
14//! - the [`gesture`] algebra folding raw browser gestures into one Intent;
15//! - the [`codec`] `codec:intent` plus Intent kind [`shapes`].
16
17#![forbid(unsafe_code)]
18#![deny(missing_docs)]
19
20mod citizen;
21pub mod codec;
22pub mod gesture;
23pub mod kinds;
24pub mod model;
25pub mod shapes;
26
27pub use citizen::{IntentDescriptor, intent_descriptor_class_symbol};
28pub use codec::{IntentCodec, IntentCodecLib, intent_codec_symbol};
29pub use gesture::{
30    GestureRecognizer, Hit, HitRole, PointerEvent, PointerPhase, RawGesture, intent_from_gesture,
31};
32pub use kinds::{INTENT_KINDS, INTENT_NAMESPACE, intent_kind, is_known_kind, required_fields};
33pub use model::{
34    IntentError, Operator, Origin, field, intent, intent_kind_of, origin, referenced_targets,
35    resolve_targets, validate_intent,
36};
37pub use shapes::{IntentKindShape, IntentShape, intent_shape_specs, intent_shape_symbol};
38
39#[cfg(test)]
40mod tests;