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 agent;
16pub mod edge;
17pub mod entity;
18pub mod entity_type;
19pub mod error;
20pub mod event;
21pub mod hash;
22pub mod header;
23pub mod id;
24pub mod khive_error;
25pub mod namespace;
26pub mod note;
27pub mod pack;
28pub mod refusal;
29pub mod substrate;
30pub mod timestamp;
31pub mod vector;
32
33pub use agent::{AgentRecord, AgentState, TerminalReason};
34pub use edge::{EdgeCategory, EdgeRelation};
35pub use entity::{Entity, EntityKind, Link, PropertyValue};
36pub use entity_type::{EntityTypeDef, EntityTypeError, EntityTypeRegistry, ResolvedEntityType};
37pub use error::{TypeError, UnknownVariant};
38pub use event::{
39    AggregateRef, ApplyResult, Event, EventBuilder, EventKind, EventOutcome, EventPayload,
40    ProposalAppliedPayload, ProposalDecision, ProposalReviewedPayload, ProposalWithdrawnPayload,
41    RerankExecutedPayload,
42};
43#[cfg(feature = "serde")]
44pub use event::{
45    EntityDraft, NoteDraft, ProposalChangeset, ProposalCreatedPayload, ProposalEntityPatch,
46};
47pub use hash::Hash32;
48pub use header::Header;
49pub use id::{Id128, ParseIdError};
50pub use khive_error::{Details, ErrorCode, ErrorDomain, ErrorKind, KhiveError, RetryHint};
51pub use namespace::Namespace;
52pub use note::{Note, NoteStatus};
53// REASON: `VerbDef` is marked `#[deprecated]` in pack.rs but still re-exported
54// here for callers that have not yet migrated to `HandlerDef`.
55// Remove this allow once all downstream crates are migrated.
56#[allow(deprecated)]
57pub use pack::VerbDef;
58pub use pack::{
59    EdgeEndpointRule, EndpointKind, HandlerDef, NoteKindSpec, NoteLifecycleSpec, Pack,
60    PackSchemaPlan, ParamDef, VerbCategory, VerbPresentationPolicy, Visibility,
61    RESERVED_ENVELOPE_ARGS,
62};
63pub use refusal::RefusalReason;
64pub use substrate::{SubstrateKind, SUBSTRATE_COUNT};
65pub use timestamp::Timestamp;
66pub use vector::DistanceMetric;