openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
19 lines (18 loc) • 728 B
JavaScript
import { d as writeJson, p as writeJsonSync, u as tryReadJsonSync } from "./json-files-C5mNTScg.mjs";
//#region src/plugin-sdk/json-store.ts
/** Read small JSON blobs synchronously for token/state caches. */
function loadJsonFile(filePath) {
return tryReadJsonSync(filePath) ?? void 0;
}
/** Persist small JSON blobs synchronously with restrictive permissions. */
const saveJsonFile = writeJsonSync;
/** Write JSON with secure file permissions and atomic replacement semantics. */
async function writeJsonFileAtomically(filePath, value) {
await writeJson(filePath, value, {
mode: 384,
dirMode: 448,
trailingNewline: true
});
}
//#endregion
export { saveJsonFile as n, writeJsonFileAtomically as r, loadJsonFile as t };