@floomhq/floom 1.0.42 → 1.0.43

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.
@@ -1,4 +1,4 @@
1
- import { constants } from "node:fs";
1
+ import { constants, rmSync } from "node:fs";
2
2
  import { lstat, mkdir, open, rename, rm, stat } from "node:fs/promises";
3
3
  import { homedir } from "node:os";
4
4
  import { basename, dirname, join, relative, resolve, sep } from "node:path";
@@ -260,10 +260,30 @@ export async function withSyncLock(fn) {
260
260
  await new Promise((resolveDelay) => setTimeout(resolveDelay, 50));
261
261
  }
262
262
  }
263
+ const signalHandlers = new Map();
264
+ const cleanupSync = () => {
265
+ try {
266
+ rmSync(lockPath, { recursive: true, force: true });
267
+ }
268
+ catch {
269
+ // Best-effort signal cleanup. The normal finally path reports real errors.
270
+ }
271
+ };
272
+ for (const signal of ["SIGINT", "SIGTERM"]) {
273
+ const handler = () => {
274
+ cleanupSync();
275
+ process.exit(signal === "SIGINT" ? 130 : 143);
276
+ };
277
+ signalHandlers.set(signal, handler);
278
+ process.once(signal, handler);
279
+ }
263
280
  try {
264
281
  return await fn();
265
282
  }
266
283
  finally {
284
+ for (const [signal, handler] of signalHandlers) {
285
+ process.off(signal, handler);
286
+ }
267
287
  await rm(lockPath, { recursive: true, force: true }).catch(() => { });
268
288
  }
269
289
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floomhq/floom",
3
- "version": "1.0.42",
3
+ "version": "1.0.43",
4
4
  "description": "Sync AI skills across agents and machines.",
5
5
  "license": "MIT",
6
6
  "type": "module",