Skip to main content

export_mem

Function export_mem 

Source
pub fn export_mem(
    mem_dir: &Path,
    config: &MemConfig,
    output_path: &Path,
    workspace_root: Option<&Path>,
    workspace_schemas_dir: Option<&Path>,
) -> Result<MemExportResult, MemExportError>
Expand description

Export a mem directory as a portable .mem archive.

The archive contains .memstead/config.json (a whitelist projection of the author’s MemConfig — author-only fields like writeGuidance, mediums, projections, readMems never enter the archive), every .md file under the mem root, and the pinned schema’s source YAML under schema/.

Output is deterministic — entries are sorted by path and written with a fixed modification time — so identical input produces byte-identical archives, and archives produced here round-trip through validate_and_normalize_archive without rewriting.