Skip to content

Local-first 🧠 memory for Hermes Agent that lives in your Obsidian vault and remembers project context. Nightly 😴 dream passes turn repeat corrections into confirmed preferences with measurable confidence. Adapters ship for Claude Code, Codex, and OpenClaw, with an MCP server for anything else.

TypeScript
1002 B
Raw Blame
import { describe, expect, test } from "bun:test";
import { mkdtempSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import {
  loadManifest,
  saveManifest,
  type ClaudeMemoryManifest,
} from "../../../src/core/brain/claude-memory-manifest.ts";

describe("claude-memory manifest", () => {
  test("missing file → empty manifest", () => {
    const v = mkdtempSync(join(tmpdir(), "o2b-cm-m1-"));
    expect(loadManifest(v)).toEqual({ version: 1, imports: {} });
    rmSync(v, { recursive: true });
  });

  test("round-trip", () => {
    const v = mkdtempSync(join(tmpdir(), "o2b-cm-m2-"));
    const m: ClaudeMemoryManifest = {
      version: 1,
      imports: {
        "no-em-dashes.md": {
          pref_id: "pref-no-em-dashes",
          sha256: "a".repeat(64),
          imported_at: "2026-05-18T10:00:00Z",
        },
      },
    };
    saveManifest(v, m);
    expect(loadManifest(v)).toEqual(m);
    rmSync(v, { recursive: true });
  });
});