apple-notes-mcp 2.8.17 → 2.8.18
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/build/index.js +25 -6
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -43656,6 +43656,30 @@ function withJsonSchema2020_12(transport2) {
|
|
|
43656
43656
|
return transport2;
|
|
43657
43657
|
}
|
|
43658
43658
|
|
|
43659
|
+
// src/utils/shutdown.ts
|
|
43660
|
+
var SHUTDOWN_DRAIN_TIMEOUT_MS = 2e3;
|
|
43661
|
+
function createShutdown(stream, exit, timeoutMs = SHUTDOWN_DRAIN_TIMEOUT_MS) {
|
|
43662
|
+
let shuttingDown = false;
|
|
43663
|
+
let exited = false;
|
|
43664
|
+
const exitOnce = () => {
|
|
43665
|
+
if (exited) return;
|
|
43666
|
+
exited = true;
|
|
43667
|
+
clearTimeout(timer);
|
|
43668
|
+
exit();
|
|
43669
|
+
};
|
|
43670
|
+
let timer;
|
|
43671
|
+
const exitWhenDrained = () => {
|
|
43672
|
+
if (stream.writableLength === 0) exitOnce();
|
|
43673
|
+
else stream.once("drain", exitWhenDrained);
|
|
43674
|
+
};
|
|
43675
|
+
return () => {
|
|
43676
|
+
if (shuttingDown) return;
|
|
43677
|
+
shuttingDown = true;
|
|
43678
|
+
timer = setTimeout(exitOnce, timeoutMs);
|
|
43679
|
+
setImmediate(exitWhenDrained);
|
|
43680
|
+
};
|
|
43681
|
+
}
|
|
43682
|
+
|
|
43659
43683
|
// src/utils/noteTables.ts
|
|
43660
43684
|
import { gunzipSync as gunzipSync3 } from "node:zlib";
|
|
43661
43685
|
var sub = (f, n) => {
|
|
@@ -46244,12 +46268,7 @@ process.on("uncaughtException", (err) => {
|
|
|
46244
46268
|
process.on("unhandledRejection", (reason) => {
|
|
46245
46269
|
console.error("[unhandledRejection]", reason);
|
|
46246
46270
|
});
|
|
46247
|
-
var
|
|
46248
|
-
var shutdown = () => {
|
|
46249
|
-
if (_shuttingDown) return;
|
|
46250
|
-
_shuttingDown = true;
|
|
46251
|
-
process.exit(0);
|
|
46252
|
-
};
|
|
46271
|
+
var shutdown = createShutdown(process.stdout, () => process.exit(0));
|
|
46253
46272
|
for (const sig of ["SIGINT", "SIGTERM"]) {
|
|
46254
46273
|
process.on(sig, shutdown);
|
|
46255
46274
|
}
|
package/package.json
CHANGED