UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

19 lines (18 loc) • 692 B
import { d as tryReadJsonSync, f as writeJson, m as writeJsonSync } from "./json-files-Cb1h8pYs.mjs"; //#region src/plugin-sdk/json-store.ts /** Read small JSON blobs synchronously for token/state caches. */ function loadJsonFile(e) { return tryReadJsonSync(e) ?? 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(e, t) { await writeJson(e, t, { mode: 384, dirMode: 448, trailingNewline: true }); } //#endregion export { saveJsonFile as n, writeJsonFileAtomically as r, loadJsonFile as t };