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