mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-14 02:31:24 +00:00
18 lines
528 B
TypeScript
18 lines
528 B
TypeScript
import fs from "node:fs/promises";
|
|
import path from "node:path";
|
|
|
|
export type MemoryWikiLogEntry = {
|
|
type: "init" | "ingest" | "compile" | "lint";
|
|
timestamp: string;
|
|
details?: Record<string, unknown>;
|
|
};
|
|
|
|
export async function appendMemoryWikiLog(
|
|
vaultRoot: string,
|
|
entry: MemoryWikiLogEntry,
|
|
): Promise<void> {
|
|
const logPath = path.join(vaultRoot, ".openclaw-wiki", "log.jsonl");
|
|
await fs.mkdir(path.dirname(logPath), { recursive: true });
|
|
await fs.appendFile(logPath, `${JSON.stringify(entry)}\n`, "utf8");
|
|
}
|