@remcp/remcp 0.2.221 → 0.2.222

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remcp/remcp",
3
- "version": "0.2.221",
3
+ "version": "0.2.222",
4
4
  "description": "ReMCP device client: pair a computer with ReMCP and run the outbound-only agent that hosts the local MCP runtime.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -67,11 +67,25 @@ export function withWindowsUpdateLock(prefix, operation) {
67
67
  }
68
68
 
69
69
  const onExit = () => removeOwnedLock(directory, token);
70
- process.once('exit', onExit);
71
- try {
72
- return operation();
73
- } finally {
70
+ let released = false;
71
+ const release = () => {
72
+ if (released) return;
73
+ released = true;
74
74
  process.removeListener('exit', onExit);
75
75
  removeOwnedLock(directory, token);
76
+ };
77
+ process.once('exit', onExit);
78
+ try {
79
+ const result = operation();
80
+ // A future async installer must retain the prefix lock until it settles.
81
+ // Releasing here would let another updater move the same package/shims.
82
+ if (result && typeof result.then === 'function') {
83
+ return Promise.resolve(result).finally(release);
84
+ }
85
+ release();
86
+ return result;
87
+ } catch (error) {
88
+ release();
89
+ throw error;
76
90
  }
77
91
  }