apple-notes-mcp 2.8.17 → 2.8.19
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 +40 -9
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -42910,10 +42910,22 @@ function appendMarkdownHtml(markdown) {
|
|
|
42910
42910
|
|
|
42911
42911
|
// src/utils/noteRevision.ts
|
|
42912
42912
|
var INLINE_TAG = /^<\/?(?:b|i|u|s|strike|em|strong|span|a|font|sub|sup|code|tt|small|big|mark)\b/i;
|
|
42913
|
+
var LEGACY_ENTITIES = {
|
|
42914
|
+
nbsp: " ",
|
|
42915
|
+
quot: '"',
|
|
42916
|
+
lt: "<",
|
|
42917
|
+
gt: ">",
|
|
42918
|
+
amp: "&"
|
|
42919
|
+
};
|
|
42913
42920
|
function comparableVisibleText(html) {
|
|
42914
|
-
return html.replace(/<br\s*\/?\s*>/gi, " ").replace(/<[^>]*>/g, (tag) => INLINE_TAG.test(tag) ? "" : " ").replace(
|
|
42915
|
-
|
|
42916
|
-
(_match,
|
|
42921
|
+
return html.replace(/<br\s*\/?\s*>/gi, " ").replace(/<[^>]*>/g, (tag) => INLINE_TAG.test(tag) ? "" : " ").replace(
|
|
42922
|
+
/&(?:(nbsp|quot|lt|gt|amp);?|apos;|#(\d+);|#x([0-9a-f]+);)/gi,
|
|
42923
|
+
(_match, legacy, dec, hex2) => {
|
|
42924
|
+
if (legacy) return LEGACY_ENTITIES[legacy.toLowerCase()];
|
|
42925
|
+
if (dec) return String.fromCodePoint(Number(dec));
|
|
42926
|
+
if (hex2) return String.fromCodePoint(Number.parseInt(hex2, 16));
|
|
42927
|
+
return "'";
|
|
42928
|
+
}
|
|
42917
42929
|
).replace(/\s+/g, " ").trim();
|
|
42918
42930
|
}
|
|
42919
42931
|
|
|
@@ -43656,6 +43668,30 @@ function withJsonSchema2020_12(transport2) {
|
|
|
43656
43668
|
return transport2;
|
|
43657
43669
|
}
|
|
43658
43670
|
|
|
43671
|
+
// src/utils/shutdown.ts
|
|
43672
|
+
var SHUTDOWN_DRAIN_TIMEOUT_MS = 2e3;
|
|
43673
|
+
function createShutdown(stream, exit, timeoutMs = SHUTDOWN_DRAIN_TIMEOUT_MS) {
|
|
43674
|
+
let shuttingDown = false;
|
|
43675
|
+
let exited = false;
|
|
43676
|
+
const exitOnce = () => {
|
|
43677
|
+
if (exited) return;
|
|
43678
|
+
exited = true;
|
|
43679
|
+
clearTimeout(timer);
|
|
43680
|
+
exit();
|
|
43681
|
+
};
|
|
43682
|
+
let timer;
|
|
43683
|
+
const exitWhenDrained = () => {
|
|
43684
|
+
if (stream.writableLength === 0) exitOnce();
|
|
43685
|
+
else stream.once("drain", exitWhenDrained);
|
|
43686
|
+
};
|
|
43687
|
+
return () => {
|
|
43688
|
+
if (shuttingDown) return;
|
|
43689
|
+
shuttingDown = true;
|
|
43690
|
+
timer = setTimeout(exitOnce, timeoutMs);
|
|
43691
|
+
setImmediate(exitWhenDrained);
|
|
43692
|
+
};
|
|
43693
|
+
}
|
|
43694
|
+
|
|
43659
43695
|
// src/utils/noteTables.ts
|
|
43660
43696
|
import { gunzipSync as gunzipSync3 } from "node:zlib";
|
|
43661
43697
|
var sub = (f, n) => {
|
|
@@ -46244,12 +46280,7 @@ process.on("uncaughtException", (err) => {
|
|
|
46244
46280
|
process.on("unhandledRejection", (reason) => {
|
|
46245
46281
|
console.error("[unhandledRejection]", reason);
|
|
46246
46282
|
});
|
|
46247
|
-
var
|
|
46248
|
-
var shutdown = () => {
|
|
46249
|
-
if (_shuttingDown) return;
|
|
46250
|
-
_shuttingDown = true;
|
|
46251
|
-
process.exit(0);
|
|
46252
|
-
};
|
|
46283
|
+
var shutdown = createShutdown(process.stdout, () => process.exit(0));
|
|
46253
46284
|
for (const sig of ["SIGINT", "SIGTERM"]) {
|
|
46254
46285
|
process.on(sig, shutdown);
|
|
46255
46286
|
}
|
package/package.json
CHANGED