apple-notes-mcp 2.6.6 → 2.6.7

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 +19 -16
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -40622,12 +40622,9 @@ var AppleNotesManager = class {
40622
40622
  tell application "Notes"
40623
40623
  set theNote to note id "${safeNoteId}"
40624
40624
  set theAttachment to missing value
40625
- repeat with a in attachments of theNote
40626
- if (id of a as text) is "${safeAttId}" then
40627
- set theAttachment to a
40628
- exit repeat
40629
- end if
40630
- end repeat
40625
+ try
40626
+ set theAttachment to attachment id "${safeAttId}" of theNote
40627
+ end try
40631
40628
  if theAttachment is missing value then
40632
40629
  return "ERR" & ${AS_FIELD_SEP} & "attachment not found"
40633
40630
  end if
@@ -40934,7 +40931,10 @@ var AppleNotesManager = class {
40934
40931
  if (parts.length >= 3) {
40935
40932
  attachments.push({
40936
40933
  id: parts[0].trim(),
40937
- name: parts[1].trim(),
40934
+ // Unnamed attachments render `name` as the AppleScript sentinel; surfacing
40935
+ // the literal "missing value" as a filename is worse than saying nothing,
40936
+ // and `name` is a required string, so fall back to the content identifier.
40937
+ name: normalizeAppleScriptText(parts[1]) ?? normalizeAppleScriptText(parts[2]) ?? "",
40938
40938
  contentType: parts[2].trim(),
40939
40939
  contentId: parts[2].trim() || void 0,
40940
40940
  url: normalizeAppleScriptText(parts[3]),
@@ -41018,7 +41018,10 @@ var AppleNotesManager = class {
41018
41018
  if (parts.length >= 3) {
41019
41019
  attachments.push({
41020
41020
  id: parts[0].trim(),
41021
- name: parts[1].trim(),
41021
+ // Unnamed attachments render `name` as the AppleScript sentinel; surfacing
41022
+ // the literal "missing value" as a filename is worse than saying nothing,
41023
+ // and `name` is a required string, so fall back to the content identifier.
41024
+ name: normalizeAppleScriptText(parts[1]) ?? normalizeAppleScriptText(parts[2]) ?? "",
41022
41025
  contentType: parts[2].trim(),
41023
41026
  contentId: parts[2].trim() || void 0,
41024
41027
  url: normalizeAppleScriptText(parts[3]),
@@ -41054,12 +41057,9 @@ var AppleNotesManager = class {
41054
41057
  tell application "Notes"
41055
41058
  set theNote to note id "${safeNoteId}"
41056
41059
  set theAttachment to missing value
41057
- repeat with a in attachments of theNote
41058
- if (id of a as text) is "${safeAttId}" then
41059
- set theAttachment to a
41060
- exit repeat
41061
- end if
41062
- end repeat
41060
+ try
41061
+ set theAttachment to attachment id "${safeAttId}" of theNote
41062
+ end try
41063
41063
  if theAttachment is missing value then
41064
41064
  return "ERR" & ${AS_FIELD_SEP} & "attachment not found"
41065
41065
  end if
@@ -41099,8 +41099,11 @@ var AppleNotesManager = class {
41099
41099
  return {
41100
41100
  success: true,
41101
41101
  savedPath: abs,
41102
- name: parts[1]?.trim(),
41103
- contentType: parts[2]?.trim()
41102
+ // Unnamed attachments render as the AppleScript sentinel here too; leaving it
41103
+ // undefined lets save-attachment/fetch-attachment fall back to "attachment"
41104
+ // rather than reporting `Saved "missing value"`.
41105
+ name: normalizeAppleScriptText(parts[1]),
41106
+ contentType: normalizeAppleScriptText(parts[2])
41104
41107
  };
41105
41108
  }
41106
41109
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apple-notes-mcp",
3
- "version": "2.6.6",
3
+ "version": "2.6.7",
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",