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 preparation;
41pub mod provenance;
42pub mod render;
43pub mod runtime_validator;
44pub mod schema_source;
45#[cfg(not(target_arch = "wasm32"))]
46pub mod search_index;
47pub mod section_format;
48pub mod storage;
49pub mod store;
50pub mod validator;
51pub mod vcs;
52pub mod workspace;
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 binding_migrate::{
68 BindingMigrateError, LegacyBindingV1, MigratedBinding, check_all_consumed, fold_v1_binding,
69 migrate_gen2_bindings,
70};
71pub use engine::{
72 BackendFactory, BootError, CreateEntityArgs, CreateEntityOutcome, DeleteEntityArgs,
73 DeleteEntityOutcome, DeleteReferrers, Engine, EngineError, EntityHistoryReport, EntityTouch,
74 FromArchiveBytesError, GitBranchBranchResetFn, GitBranchChangesSinceFn, GitBranchDiffFn,
75 GitBranchExportFn, GitBranchExportToBytesFn, GitBranchFetchFn, GitBranchOps, GitBranchPullFn,
76 GitBranchPushFn, GitBranchReadTreeFn, HISTORY_PAGE_DEFAULT, HISTORY_PAGE_MAX, INLINE_LIST_CAP,
77 MutationClock, ReferrerInfo, RelateAction, RelateEntityArgs, RelateEntityOutcome,
78 RenameEntityArgs, RenameEntityOutcome, RetypeEdge, RetypeEdgeDirection, RetypeEntityArgs,
79 RetypeEntityOutcome, RetypeProblem, ReviewMarkStatus, SchemaSourceDiagnostic, SchemaStaging,
80 SetReviewMarkOutcome, StoryStart, UpdateEntityArgs, UpdateEntityOutcome,
81 format_inline_list_overflow,
82};
83pub use entity::id::{ENTITY_ID_MAX_LEN, SlugError, TITLE_GRAMMAR_RULE};
84pub use entity::{Entity, EntityId, MetadataValue, ParseResult, Relationship};
85pub use graph::{ClusterInfo, LouvainOutput};
86pub use mem::{MEM_META_DIR, MemOrigin, MemRouterSnapshot};
87
88pub const ENGINE_VERSION: &str = env!("CARGO_PKG_VERSION");
96pub use mem_management::{CreateRuleSet, DeleteRuleSet, MatcherSet, MatcherSetError};
97pub use ops::{
98 BackendChanges, BatchEntry, BatchError, BatchResult, ChangeEnvelope, ChangesReport,
99 ContextResult, CreateArgs, CreateResult, DeleteResult, EMPTY_TREE_SHA, ExportResult, Facets,
100 HealthReport, HealthSummary, ListResult, MemExportResult, ModifiedMetadata, ModifiedSections,
101 Query, RENAME_SIMILARITY_DEFAULT, RENAME_SIMILARITY_MAX, RENAME_SIMILARITY_MIN, RelateArg,
102 RelateResult, ReloadReport, ReloadResult, RenameResult, SearchHit, SearchResult, SearchScope,
103 SetMemVersionOutcome, UpdateArgs, UpdateResult, WarningHint,
104};
105pub use pipeline::{
106 Facet, IngestTrigger, Medium, MediumType, PatternEntry, PatternMode, Projection,
107};
108pub use pipeline_edit::PipelineEditError;
109pub use pipeline_migrate::{migrate_legacy_pipeline, read_legacy_pipeline_configs};
110pub use pipeline_store::{
111 BindingConfigs, MemPipelineRecord, PipelineConfigs, PipelineRecord,
112 load_legacy_pipeline_configs, load_pipeline_configs,
113};
114pub use provenance::{Provenance, ProvenanceKind};
115pub use store::{Edge, EdgeSource, InEdge, Store};
116pub use workspace::{
117 CreateRuleSetting, DeleteRuleSetting, Mount, MountCapability, MountLifecycle, MountStorage,
118 SCHEMA_WILDCARD, Workspace, WorkspaceSettings, branch_full_ref, branch_short_name,
119};
120pub use workspace_store::{
121 FileWorkspaceStore, InstantiateError, Layout, StoreError, WORKSPACE_STORE_DIR,
122 WorkspaceStoreAdapter, detect_layout, instantiate_lean_backend, is_mem_repo_shaped,
123 is_workspace_root, standalone_workspace, workspace_shape_label,
124};
125
126pub fn hex_lower(bytes: &[u8]) -> String {
130 use std::fmt::Write;
131 bytes
132 .iter()
133 .fold(String::with_capacity(bytes.len() * 2), |mut s, b| {
134 let _ = write!(s, "{b:02x}");
135 s
136 })
137}
138
139pub fn engine_fallback_type() -> Arc<TypeDefinition> {
144 type_by_name("spec").expect("spec type must exist in the default builtin schema")
145}