mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-24 22:49:35 +00:00
12 lines
517 B
TypeScript
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;
|
|
}
|