fix(plugin): add OpenClaw state dir fallback

This commit is contained in:
李冠辰
2026-05-25 00:10:57 +08:00
parent be998adeb2
commit 49788fc085
4 changed files with 37 additions and 4 deletions
+12
View File
@@ -0,0 +1,12 @@
import { homedir } from "node:os";
import path from "node:path";
export interface OpenClawRuntimeStateLike {
resolveStateDir?: () => string;
}
export function resolveOpenClawStateDir(
runtimeState: OpenClawRuntimeStateLike | undefined,
): string {
return runtimeState?.resolveStateDir?.() ?? path.join(homedir(), ".openclaw");
}