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
1.2 KB
Raw Blame
import {
  buildOperatorSnapshot,
  renderOperatorSnapshot,
} from "../../../core/brain/operator-snapshot.ts";
import { brainVerbContext, fail, parse } from "../helpers.ts";

/**
 * `o2b brain status` - unified operator status snapshot (O3). Composes
 * doctor, semantic health, hygiene, stale scan, review candidates, active
 * profile, and state-file health into one readable snapshot. Every problem
 * line carries the exact next command to run (from the diagnostics-signal
 * definition). A healthy vault prints a compact all-clear. Read-only.
 */
export async function cmdBrainStatus(argv: string[]): Promise<number> {
  const { flags } = parse(argv, {
    vault: { type: "string" },
    json: { type: "boolean" },
  });
  // `null` with no vault configured: the snapshot covers the store (D14).
  const { config, vault } = brainVerbContext(flags, { vault: "optional" });

  let snapshot;
  try {
    snapshot = await buildOperatorSnapshot(vault, { configPath: config });
  } catch (exc) {
    return fail(`status failed: ${(exc as Error).message ?? exc}`);
  }

  if (flags["json"]) {
    process.stdout.write(JSON.stringify(snapshot, null, 2) + "\n");
    return 0;
  }

  process.stdout.write(renderOperatorSnapshot(snapshot));
  return 0;
}