1pub mod anchor;
17pub mod backend;
18pub mod binding;
19pub mod binding_migrate;
20pub mod build_info;
21pub mod check;
22pub mod chunking;
23pub mod derivation;
24pub mod domain_authority_wire;
25pub mod engine;
26pub mod entity;
27pub mod filesystem;
28pub mod friction;
29pub mod graph;
30pub mod ingest;
31pub mod mem;
32pub mod mem_management;
33pub mod ops;
34pub mod overview;
35pub mod pipeline;
36pub mod pipeline_edit;
37pub mod pipeline_migrate;
38pub mod pipeline_store;
39pub mod provenance;
40pub mod render;
41pub mod runtime_validator;
42pub mod schema_source;
43#[cfg(not(target_arch = "wasm32"))]
44pub mod search_index;
45pub mod section_format;
46pub mod storage;
47pub mod store;
48pub mod validator;
49pub mod vcs;
50pub mod workspace;
51pub mod workspace_root;
52pub mod workspace_store;
53
54use std::sync::Arc;
55
56use memstead_schema::{TypeDefinition, type_by_name};
57
58pub use anchor::{
59 ANCHOR_SIDECAR_PATH, Anchor, AnchorGrain, AnchorHashStability, AnchorInput,
60 AnchorProvenanceClass, AnchorSidecar, AnchorState, AnchorValidationError, AnchorVersion,
61 ArtifactObservation, EntityAnchorComposition, INVALID_ANCHOR_CODE, compose_entity_anchors,
62 resolve_anchor,
63};
64pub use backend::{BackendError, MemBackend};
65pub use binding_migrate::{
66 BindingMigrateError, LegacyBindingV1, MigratedBinding, check_all_consumed, fold_v1_binding,
67 migrate_gen2_bindings,
68};
69pub use engine::{
70 BackendFactory, BootError, CreateEntityArgs, CreateEntityOutcome, DeleteEntityArgs,
71 DeleteEntityOutcome, DeleteReferrers, Engine, EngineError, EntityHistoryReport, EntityTouch,
72 FromArchiveBytesError, GitBranchBranchResetFn, GitBranchChangesSinceFn, GitBranchDiffFn,
73 GitBranchExportFn, GitBranchExportToBytesFn, GitBranchFetchFn, GitBranchOps, GitBranchPullFn,
74 GitBranchPushFn, GitBranchReadTreeFn, HISTORY_PAGE_DEFAULT, HISTORY_PAGE_MAX, INLINE_LIST_CAP,
75 MutationClock, ReferrerInfo, RelateAction, RelateEntityArgs, RelateEntityOutcome,
76 RenameEntityArgs, RenameEntityOutcome, ReviewMarkStatus, SchemaSourceDiagnostic, SchemaStaging,
77 SetReviewMarkOutcome, StoryStart, UpdateEntityArgs, UpdateEntityOutcome,
78 format_inline_list_overflow,
79};
80pub use entity::id::{ENTITY_ID_MAX_LEN, SlugError, TITLE_GRAMMAR_RULE};
81pub use entity::{Entity, EntityId, MetadataValue, ParseResult, Relationship};
82pub use graph::{ClusterInfo, LouvainOutput};
83pub use mem::{MEM_META_DIR, MemOrigin, MemRouterSnapshot};
84
85pub const ENGINE_VERSION: &str = env!("CARGO_PKG_VERSION");
93pub use mem_management::{CreateRuleSet, DeleteRuleSet, MatcherSet, MatcherSetError};
94pub use ops::{
95 BackendChanges, BatchEntry, BatchError, BatchResult, ChangeEnvelope, ChangesReport,
96 ContextResult, CreateArgs, CreateResult, DeleteResult, EMPTY_TREE_SHA, ExportResult, Facets,
97 HealthReport, HealthSummary, ListResult, MemExportResult, ModifiedMetadata, ModifiedSections,
98 Query, RENAME_SIMILARITY_DEFAULT, RENAME_SIMILARITY_MAX, RENAME_SIMILARITY_MIN, RelateArg,
99 RelateResult, ReloadReport, ReloadResult, RenameResult, SearchHit, SearchResult, SearchScope,
100 SetMemVersionOutcome, UpdateArgs, UpdateResult, WarningHint,
101};
102pub use pipeline::{
103 Facet, IngestTrigger, Medium, MediumType, PatternEntry, PatternMode, Projection,
104};
105pub use pipeline_edit::PipelineEditError;
106pub use pipeline_migrate::{migrate_legacy_pipeline, read_legacy_pipeline_configs};
107pub use pipeline_store::{
108 BindingConfigs, MemPipelineRecord, PipelineConfigs, PipelineRecord,
109 load_legacy_pipeline_configs, load_pipeline_configs,
110};
111pub use provenance::{Provenance, ProvenanceKind};
112pub use store::{Edge, EdgeSource, InEdge, Store};
113pub use workspace::{
114 CreateRuleSetting, DeleteRuleSetting, Mount, MountCapability, MountLifecycle, MountStorage,
115 SCHEMA_WILDCARD, Workspace, WorkspaceSettings,
116};
117pub use workspace_store::{
118 FileWorkspaceStore, InstantiateError, Layout, StoreError, WORKSPACE_STORE_DIR,
119 WorkspaceStoreAdapter, detect_layout, instantiate_lean_backend, is_mem_repo_shaped,
120 is_workspace_root, standalone_workspace, workspace_shape_label,
121};
122
123pub fn hex_lower(bytes: &[u8]) -> String {
127 use std::fmt::Write;
128 bytes
129 .iter()
130 .fold(String::with_capacity(bytes.len() * 2), |mut s, b| {
131 let _ = write!(s, "{b:02x}");
132 s
133 })
134}
135
136pub fn engine_fallback_type() -> Arc<TypeDefinition> {
141 type_by_name("spec").expect("spec type must exist in the default builtin schema")
142}