{"version":3,"file":"sync-Dlxz2msM.cjs","names":["path","randomUUID","serializePrivateJson"],"sources":["../src/services/atomicJson/sync.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\n// sync: Preserve the exported Node-only writePrivateAtomicJson signature until phase 2.\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { PRIVATE_DIRECTORY_MODE, PRIVATE_FILE_MODE, serializePrivateJson } from './format';\n\nconst TEMPORARY_SUFFIX = '.tmp';\n\n/**\n * Writes JSON readable by its owner only, replacing the target atomically.\n *\n * @deprecated Node-only sync shim; use writePrivateAtomicJsonAsync. Removed in M2.\n */\nexport function writePrivateAtomicJson(filePath: string, value: unknown): void {\n  fs.mkdirSync(path.dirname(filePath), { mode: PRIVATE_DIRECTORY_MODE, recursive: true });\n  const temporaryPath = `${filePath}.${process.pid}.${randomUUID()}${TEMPORARY_SUFFIX}`;\n  try {\n    fs.writeFileSync(temporaryPath, serializePrivateJson(value), { mode: PRIVATE_FILE_MODE });\n    fs.renameSync(temporaryPath, filePath);\n  } catch (error) {\n    fs.rmSync(temporaryPath, { force: true });\n    throw error;\n  }\n}\n"],"mappings":";;;;;;;;AAOA,MAAM,mBAAmB;;;;;;AAOzB,SAAgB,uBAAuB,UAAkB,OAAsB;CAC7E,QAAA,QAAG,UAAUA,UAAAA,QAAK,QAAQ,QAAQ,GAAG;EAAE,MAAA;EAA8B,WAAW;CAAK,CAAC;CACtF,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,IAAI,IAAA,GAAGC,YAAAA,WAAAA,CAAW,IAAI;CACnE,IAAI;EACF,QAAA,QAAG,cAAc,eAAeC,mBAAAA,qBAAqB,KAAK,GAAG,EAAE,MAAA,IAAwB,CAAC;EACxF,QAAA,QAAG,WAAW,eAAe,QAAQ;CACvC,SAAS,OAAO;EACd,QAAA,QAAG,OAAO,eAAe,EAAE,OAAO,KAAK,CAAC;EACxC,MAAM;CACR;AACF"}