mcp-google-multi 5.1.1-alpha.1 → 5.1.1-alpha.2
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/dist/token-store.js +16 -5
- package/package.json +1 -1
package/dist/token-store.js
CHANGED
|
@@ -82,18 +82,29 @@ function withTokenLock(alias, fn) {
|
|
|
82
82
|
try {
|
|
83
83
|
const observedOwner = fs.readFileSync(lock, 'utf8');
|
|
84
84
|
const owner = Number(observedOwner);
|
|
85
|
-
|
|
85
|
+
// Non-PID content can only come from a corrupt or interrupted lock
|
|
86
|
+
// write — recover it like a dead owner instead of spinning to timeout.
|
|
87
|
+
let ownerDead = !(Number.isSafeInteger(owner) && owner > 0);
|
|
88
|
+
if (!ownerDead) {
|
|
86
89
|
try {
|
|
87
90
|
process.kill(owner, 0);
|
|
88
91
|
}
|
|
89
92
|
catch (ownerError) {
|
|
90
|
-
|
|
93
|
+
const code = ownerError.code;
|
|
94
|
+
// EPERM: the PID exists but is not signalable (recycled by another
|
|
95
|
+
// user) — treat as alive and wait out the timeout rather than
|
|
96
|
+
// break a lock we cannot verify.
|
|
97
|
+
if (code === 'ESRCH')
|
|
98
|
+
ownerDead = true;
|
|
99
|
+
else if (code !== 'EPERM')
|
|
91
100
|
throw ownerError;
|
|
92
|
-
if (fs.readFileSync(lock, 'utf8') === observedOwner)
|
|
93
|
-
fs.rmSync(lock, { force: true });
|
|
94
|
-
continue;
|
|
95
101
|
}
|
|
96
102
|
}
|
|
103
|
+
if (ownerDead) {
|
|
104
|
+
if (fs.readFileSync(lock, 'utf8') === observedOwner)
|
|
105
|
+
fs.rmSync(lock, { force: true });
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
97
108
|
}
|
|
98
109
|
catch (readError) {
|
|
99
110
|
if (readError.code === 'ENOENT') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-google-multi",
|
|
3
|
-
"version": "5.1.1-alpha.
|
|
3
|
+
"version": "5.1.1-alpha.2",
|
|
4
4
|
"description": "Local MCP server for Google Workspace (Gmail, Drive, Calendar, Sheets, Docs, Contacts, Tasks, Meet, Search Console, +Forms/Chat/Admin) across multiple accounts — OAuth-only, encrypted token storage, deny-by-default writes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|