Skip to main content

khive_types/
lib.rs

1//! khive-types — core primitives and substrate data types.
2//!
3//! `#![no_std]` compatible. Minimal dependencies. No ID generation, no clock
4//! access, no panics. Substrate structs (Note, Entity, Event) are merged into
5//! this crate — they are the data shape that the rest of the runtime operates on.
6
7#![no_std]
8#![forbid(unsafe_code)]
9
10extern crate alloc;
11
12#[cfg(feature = "std")]
13extern crate std;
14
15pub mod edge;
16pub mod entity;
17pub mod entity_type;
18pub mod error;
19pub mod event;
20pub mod hash;
21pub mod header;
22pub mod id;
23pub mod khive_error;
24pub mod namespace;
25pub mod note;
26pub mod pack;
27pub mod substrate;
28pub mod timestamp;
29pub mod vector;
30
31pub use edge::{EdgeCategory, EdgeRelation};
32pub use entity::{Entity, EntityKind, Link, PropertyValue};
33pub use entity_type::{EntityTypeDef, EntityTypeError, EntityTypeRegistry, ResolvedEntityType};
34pub use error::{TypeError, UnknownVariant};
35pub use event::{
36    AggregateRef, ApplyResult, Event, EventBuilder, EventKind, EventOutcome, EventPayload,
37    ProposalAppliedPayload, ProposalDecision, ProposalReviewedPayload, ProposalWithdrawnPayload,
38    RerankExecutedPayload,
39};
40#[cfg(feature = "serde")]
41pub use event::{
42    EntityDraft, NoteDraft, ProposalChangeset, ProposalCreatedPayload, ProposalEntityPatch,
43};
44pub use hash::Hash32;
45pub use header::Header;
46pub use id::{Id128, ParseIdError};
47pub use khive_error::{Details, ErrorCode, ErrorDomain, ErrorKind, KhiveError, RetryHint};
48pub use namespace::Namespace;
49pub use note::{Note, NoteStatus};
50// REASON: `VerbDef` is marked `#[deprecated]` in pack.rs but still re-exported
51// here for callers that have not yet migrated to `HandlerDef`.
52// Remove this allow once all downstream crates are migrated.
53#[allow(deprecated)]
54pub use pack::VerbDef;
55pub use pack::{
56    EdgeEndpointRule, EndpointKind, HandlerDef, NoteKindSpec, NoteLifecycleSpec, Pack,
57    PackSchemaPlan, ParamDef, VerbCategory, VerbPresentationPolicy, Visibility,
58};
59pub use substrate::{SubstrateKind, SUBSTRATE_COUNT};
60pub use timestamp::Timestamp;
61pub use vector::DistanceMetric;