Files
openclaw/extensions/memory-wiki/src/source-path-shared.ts
2026-06-04 21:33:54 -04:00

12 lines
517 B
TypeScript

// Memory Wiki plugin module implements source path shared behavior.
import fs from "node:fs/promises";
import path from "node:path";
import { lowercasePreservingWhitespace } from "openclaw/plugin-sdk/string-coerce-runtime";
export async function resolveArtifactKey(absolutePath: string): Promise<string> {
const canonicalPath = await fs.realpath(absolutePath).catch(() => path.resolve(absolutePath));
return process.platform === "win32"
? lowercasePreservingWhitespace(canonicalPath)
: canonicalPath;
}