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