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