pub mod anchor;
pub mod backend;
pub mod binding;
pub mod binding_migrate;
pub mod build_info;
pub mod check;
pub mod chunking;
pub mod derivation;
pub mod domain_authority_wire;
pub mod engine;
pub mod entity;
pub mod filesystem;
pub mod friction;
pub mod graph;
pub mod ingest;
pub mod mem;
pub mod mem_management;
pub mod ops;
pub mod overview;
pub mod pipeline;
pub mod pipeline_edit;
pub mod pipeline_migrate;
pub mod pipeline_store;
pub mod provenance;
pub mod render;
pub mod runtime_validator;
pub mod schema_source;
#[cfg(not(target_arch = "wasm32"))]
pub mod search_index;
pub mod section_format;
pub mod storage;
pub mod store;
pub mod validator;
pub mod vcs;
pub mod workspace;
pub mod workspace_root;
pub mod workspace_store;
use std::sync::Arc;
use memstead_schema::{TypeDefinition, type_by_name};
pub use anchor::{
ANCHOR_SIDECAR_PATH, Anchor, AnchorGrain, AnchorHashStability, AnchorInput,
AnchorProvenanceClass, AnchorSidecar, AnchorState, AnchorValidationError, AnchorVersion,
ArtifactObservation, EntityAnchorComposition, INVALID_ANCHOR_CODE, compose_entity_anchors,
resolve_anchor,
};
pub use backend::{BackendError, MemBackend};
pub use binding_migrate::{
BindingMigrateError, LegacyBindingV1, MigratedBinding, check_all_consumed, fold_v1_binding,
migrate_gen2_bindings,
};
pub use engine::{
BackendFactory, BootError, CreateEntityArgs, CreateEntityOutcome, DeleteEntityArgs,
DeleteEntityOutcome, DeleteReferrers, Engine, EngineError, EntityHistoryReport, EntityTouch,
FromArchiveBytesError, GitBranchBranchResetFn, GitBranchChangesSinceFn, GitBranchDiffFn,
GitBranchExportFn, GitBranchExportToBytesFn, GitBranchFetchFn, GitBranchOps, GitBranchPullFn,
GitBranchPushFn, GitBranchReadTreeFn, HISTORY_PAGE_DEFAULT, HISTORY_PAGE_MAX, INLINE_LIST_CAP,
MutationClock, ReferrerInfo, RelateAction, RelateEntityArgs, RelateEntityOutcome,
RenameEntityArgs, RenameEntityOutcome, ReviewMarkStatus, SchemaSourceDiagnostic,
SetReviewMarkOutcome, StoryStart, UpdateEntityArgs, UpdateEntityOutcome,
format_inline_list_overflow,
};
pub use entity::id::{ENTITY_ID_MAX_LEN, SlugError, TITLE_GRAMMAR_RULE};
pub use entity::{Entity, EntityId, MetadataValue, ParseResult, Relationship};
pub use graph::{ClusterInfo, LouvainOutput};
pub use mem::{MEM_META_DIR, MemOrigin, MemRouterSnapshot};
pub const ENGINE_VERSION: &str = env!("CARGO_PKG_VERSION");
pub use mem_management::{CreateRuleSet, DeleteRuleSet, MatcherSet, MatcherSetError};
pub use ops::{
BackendChanges, BatchEntry, BatchError, BatchResult, ChangeEnvelope, ChangesReport,
ContextResult, CreateArgs, CreateResult, DeleteResult, EMPTY_TREE_SHA, ExportResult, Facets,
HealthReport, HealthSummary, ListResult, MemExportResult, ModifiedMetadata, ModifiedSections,
Query, RENAME_SIMILARITY_DEFAULT, RENAME_SIMILARITY_MAX, RENAME_SIMILARITY_MIN, RelateArg,
RelateResult, ReloadReport, ReloadResult, RenameResult, SearchHit, SearchResult, SearchScope,
SetMemVersionOutcome, UpdateArgs, UpdateResult, WarningHint,
};
pub use pipeline::{
Facet, IngestTrigger, Medium, MediumType, PatternEntry, PatternMode, Projection,
};
pub use pipeline_edit::PipelineEditError;
pub use pipeline_migrate::{migrate_legacy_pipeline, read_legacy_pipeline_configs};
pub use pipeline_store::{
BindingConfigs, MemPipelineRecord, PipelineConfigs, PipelineRecord,
load_legacy_pipeline_configs, load_pipeline_configs,
};
pub use provenance::{Provenance, ProvenanceKind};
pub use store::{Edge, EdgeSource, InEdge, Store};
pub use workspace::{
CreateRuleSetting, DeleteRuleSetting, Mount, MountCapability, MountLifecycle, MountStorage,
SCHEMA_WILDCARD, Workspace, WorkspaceSettings,
};
pub use workspace_store::{
FileWorkspaceStore, InstantiateError, Layout, StoreError, WORKSPACE_STORE_DIR,
WorkspaceStoreAdapter, detect_layout, instantiate_lean_backend, is_workspace_root,
standalone_workspace,
};
pub fn hex_lower(bytes: &[u8]) -> String {
use std::fmt::Write;
bytes
.iter()
.fold(String::with_capacity(bytes.len() * 2), |mut s, b| {
let _ = write!(s, "{b:02x}");
s
})
}
pub fn engine_fallback_type() -> Arc<TypeDefinition> {
type_by_name("spec").expect("spec type must exist in the default builtin schema")
}