Files
openclaw/src/plugins/installed-plugin-index-store-path.ts
Peter Steinberger 694ca50e97 Revert "refactor: move runtime state to SQLite"
This reverts commit f91de52f0d.
2026-05-13 13:33:38 +01:00

22 lines
634 B
TypeScript

import path from "node:path";
import { resolveStateDir } from "../config/paths.js";
const INSTALLED_PLUGIN_INDEX_STORE_PATH = path.join("plugins", "installs.json");
export type InstalledPluginIndexStoreOptions = {
env?: NodeJS.ProcessEnv;
stateDir?: string;
filePath?: string;
};
export function resolveInstalledPluginIndexStorePath(
options: InstalledPluginIndexStoreOptions = {},
): string {
if (options.filePath) {
return options.filePath;
}
const env = options.env ?? process.env;
const stateDir = options.stateDir ?? resolveStateDir(env);
return path.join(stateDir, INSTALLED_PLUGIN_INDEX_STORE_PATH);
}