@nogataka/smart-edit 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -126,7 +126,10 @@ function readRegistry() {
126
126
  function writeRegistry(data) {
127
127
  const instancesFile = getInstancesFilePath();
128
128
  ensureDirectoryExists(instancesFile);
129
- fs.writeFileSync(instancesFile, JSON.stringify(data, null, 2), 'utf-8');
129
+ // Atomic write: write to temp file first, then rename
130
+ const tempFile = `${instancesFile}.tmp`;
131
+ fs.writeFileSync(tempFile, JSON.stringify(data, null, 2), 'utf-8');
132
+ fs.renameSync(tempFile, instancesFile);
130
133
  }
131
134
  function isProcessAlive(pid) {
132
135
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nogataka/smart-edit",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Smart Edit is a tool for editing code with AI.",
5
5
  "private": false,
6
6
  "license": "MIT",