apple-notes-mcp 2.8.2 → 2.8.4

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.
Files changed (2) hide show
  1. package/build/index.js +15 -5
  2. package/package.json +3 -3
package/build/index.js CHANGED
@@ -39050,11 +39050,17 @@ function isRetryableError(errorMessage) {
39050
39050
  function sleep(ms) {
39051
39051
  Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
39052
39052
  }
39053
+ var PERMISSION_DENIED_PATTERN = /not author(?:i[sz])ed|not permitted|access.*denied|\(-1743\)/i;
39054
+ var PERMISSION_DENIED_MESSAGE = `Permission denied. ${AUTOMATION_REMEDIATION}`;
39055
+ function isPermissionDenied(error2) {
39056
+ if (!error2) return false;
39057
+ return PERMISSION_DENIED_PATTERN.test(error2) || error2.includes(PERMISSION_DENIED_MESSAGE);
39058
+ }
39053
39059
  var ERROR_MAPPINGS = [
39054
39060
  // Permission errors
39055
39061
  {
39056
- pattern: /not authorized|not permitted|access.*denied/i,
39057
- message: `Permission denied. ${AUTOMATION_REMEDIATION}`
39062
+ pattern: PERMISSION_DENIED_PATTERN,
39063
+ message: PERMISSION_DENIED_MESSAGE
39058
39064
  },
39059
39065
  // Application not running
39060
39066
  {
@@ -39120,6 +39126,9 @@ function parseErrorMessage(errorOutput) {
39120
39126
  if (executionError) {
39121
39127
  coreError = executionError[1].trim();
39122
39128
  }
39129
+ if (isPermissionDenied(errorOutput)) {
39130
+ return PERMISSION_DENIED_MESSAGE;
39131
+ }
39123
39132
  for (const { pattern, message } of ERROR_MAPPINGS) {
39124
39133
  const match = coreError.match(pattern);
39125
39134
  if (match) {
@@ -41120,7 +41129,7 @@ var AppleNotesManager = class {
41120
41129
  message: "Notes.app is accessible"
41121
41130
  });
41122
41131
  } else {
41123
- const errorHint = appCheck.error?.includes("not authorized") ? " (check Automation permissions in System Settings > Privacy & Security > Automation)" : "";
41132
+ const errorHint = isPermissionDenied(appCheck.error) ? " (check Automation permissions in System Settings > Privacy & Security > Automation)" : "";
41124
41133
  checks.push({
41125
41134
  name: "notes_app",
41126
41135
  passed: false,
@@ -41136,7 +41145,7 @@ var AppleNotesManager = class {
41136
41145
  message: "AppleScript automation permissions granted"
41137
41146
  });
41138
41147
  } else {
41139
- const isPermError = permCheck.error?.includes("not authorized") || permCheck.error?.includes("not permitted");
41148
+ const isPermError = isPermissionDenied(permCheck.error);
41140
41149
  checks.push({
41141
41150
  name: "permissions",
41142
41151
  passed: !isPermError,
@@ -42527,8 +42536,9 @@ import { createHash } from "node:crypto";
42527
42536
  function hashNoteContent(content) {
42528
42537
  return `sha256:${createHash("sha256").update(content, "utf8").digest("hex")}`;
42529
42538
  }
42539
+ var INLINE_TAG = /^<\/?(?:b|i|u|s|strike|em|strong|span|a|font|sub|sup|code|tt|small|big|mark)\b/i;
42530
42540
  function comparableVisibleText(html) {
42531
- return html.replace(/<br\s*\/?\s*>/gi, " ").replace(/<[^>]*>/g, " ").replace(/&nbsp;|&#160;/gi, " ").replace(/&quot;/gi, '"').replace(/&#39;|&apos;/gi, "'").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">").replace(/&amp;/gi, "&").replace(/&#(\d+);/g, (_match, codePoint) => String.fromCodePoint(Number(codePoint))).replace(
42541
+ return html.replace(/<br\s*\/?\s*>/gi, " ").replace(/<[^>]*>/g, (tag) => INLINE_TAG.test(tag) ? "" : " ").replace(/&nbsp;|&#160;/gi, " ").replace(/&quot;/gi, '"').replace(/&#39;|&apos;/gi, "'").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">").replace(/&amp;/gi, "&").replace(/&#(\d+);/g, (_match, codePoint) => String.fromCodePoint(Number(codePoint))).replace(
42532
42542
  /&#x([0-9a-f]+);/gi,
42533
42543
  (_match, codePoint) => String.fromCodePoint(Number.parseInt(codePoint, 16))
42534
42544
  ).replace(/\s+/g, " ").trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apple-notes-mcp",
3
- "version": "2.8.2",
3
+ "version": "2.8.4",
4
4
  "description": "MCP server for Apple Notes - create, search, update, and manage notes via Claude and other AI assistants",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
@@ -52,7 +52,7 @@
52
52
  "@types/turndown": "^5.0.6",
53
53
  "@typescript-eslint/eslint-plugin": "^8.0.0",
54
54
  "@typescript-eslint/parser": "^8.0.0",
55
- "@vitest/coverage-v8": "^3.2.6",
55
+ "@vitest/coverage-v8": "^4.1.11",
56
56
  "ajv": "^8.17.1",
57
57
  "esbuild": "^0.28.1",
58
58
  "eslint": "^9.0.0",
@@ -63,7 +63,7 @@
63
63
  "tsconfig-paths": "^4.2.0",
64
64
  "typescript": "^5.0.0",
65
65
  "typescript-eslint": "^8.51.0",
66
- "vitest": "^3.2.6"
66
+ "vitest": "^4.1.11"
67
67
  },
68
68
  "volta": {
69
69
  "node": "24.17.0"