apple-notes-mcp 2.8.47 → 2.8.49
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/README.md +5 -2
- package/build/index.js +25 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -829,8 +829,11 @@ nothing was deleted instead of claiming success.
|
|
|
829
829
|
A note that is already in Recently Deleted is refused, because deleting it there
|
|
830
830
|
removes it permanently. The folder is read live from Notes.app in the same
|
|
831
831
|
AppleScript; the Recently Deleted folder is recognised by its database id (with
|
|
832
|
-
Full Disk Access) or by its English name.
|
|
833
|
-
|
|
832
|
+
Full Disk Access) or by its English name. The check fails closed: a note whose
|
|
833
|
+
folder Notes.app reports as something other than a folder (as it does for a note
|
|
834
|
+
trashed earlier in the same Notes session) is refused the same way, and a note
|
|
835
|
+
whose folder cannot be read at all is refused with a message to retry. To remove
|
|
836
|
+
such a note for good, do it in Notes.app.
|
|
834
837
|
|
|
835
838
|
**⚠️ Safety:** Irreversible from the agent's side — requires explicit user confirmation before calling. Prefer `search-notes` / `list-notes` first to confirm the exact id(s) being deleted.
|
|
836
839
|
|
package/build/index.js
CHANGED
|
@@ -43035,26 +43035,26 @@ var AppleNotesManager = class {
|
|
|
43035
43035
|
try
|
|
43036
43036
|
set originalFolder to container of noteRef
|
|
43037
43037
|
end try
|
|
43038
|
-
if originalFolder is
|
|
43039
|
-
|
|
43040
|
-
|
|
43041
|
-
|
|
43042
|
-
|
|
43043
|
-
|
|
43044
|
-
|
|
43045
|
-
|
|
43046
|
-
|
|
43047
|
-
|
|
43038
|
+
if originalFolder is missing value then return "SAFETY_CONTAINER_UNKNOWN"
|
|
43039
|
+
set __inTrash to true
|
|
43040
|
+
try
|
|
43041
|
+
if (class of originalFolder) is folder then set __inTrash to false
|
|
43042
|
+
end try
|
|
43043
|
+
try
|
|
43044
|
+
if ${trashFolderIdList()} contains (id of originalFolder) then set __inTrash to true
|
|
43045
|
+
end try
|
|
43046
|
+
try
|
|
43047
|
+
if (name of originalFolder) is "${RECENTLY_DELETED_FOLDER_NAME}" then set __inTrash to true
|
|
43048
|
+
end try
|
|
43049
|
+
if __inTrash then return "SAFETY_IN_RECENTLY_DELETED"
|
|
43048
43050
|
set currentBody to body of noteRef
|
|
43049
43051
|
considering case
|
|
43050
43052
|
if currentBody is not "${safeExpectedBody}" and currentBody is not "${safeExpectedBody}" & linefeed then return "SAFETY_CONFLICT"
|
|
43051
43053
|
delete noteRef
|
|
43052
43054
|
end considering
|
|
43053
|
-
|
|
43054
|
-
|
|
43055
|
-
|
|
43056
|
-
end try
|
|
43057
|
-
end if
|
|
43055
|
+
try
|
|
43056
|
+
if (id of notes of originalFolder) contains "${safeId}" then return "SAFETY_NOT_DELETED"
|
|
43057
|
+
end try
|
|
43058
43058
|
return "SAFETY_DELETED"
|
|
43059
43059
|
`);
|
|
43060
43060
|
const result = executeMutationAppleScript(script);
|
|
@@ -43067,6 +43067,7 @@ var AppleNotesManager = class {
|
|
|
43067
43067
|
const status = result.output.trim();
|
|
43068
43068
|
if (status === "SAFETY_CONFLICT") return { status: "conflict" };
|
|
43069
43069
|
if (status === "SAFETY_IN_RECENTLY_DELETED") return { status: "in-recently-deleted" };
|
|
43070
|
+
if (status === "SAFETY_CONTAINER_UNKNOWN") return { status: "container-unknown" };
|
|
43070
43071
|
if (status === "SAFETY_NOT_DELETED") return { status: "not-deleted" };
|
|
43071
43072
|
return status === "SAFETY_DELETED" ? { status: "deleted" } : { status: "failed" };
|
|
43072
43073
|
}
|
|
@@ -51554,6 +51555,9 @@ function readExactNoteSnapshot(id2) {
|
|
|
51554
51555
|
return { note, body, rich, contentHash: richContentHash(body, rich) };
|
|
51555
51556
|
}
|
|
51556
51557
|
var NOT_DELETED_MESSAGE = "Notes.app accepted the delete, but the note is still in its original folder, so it was not moved to Recently Deleted. Nothing was deleted; read the note again before retrying.";
|
|
51558
|
+
function containerUnknownMessage(title) {
|
|
51559
|
+
return `Could not read which folder note "${title}" is in, so it may already be in Recently Deleted, where deleting it would remove it permanently. Nothing was deleted. Retry in a moment; if it keeps failing, quit and reopen Notes.app, then retry.`;
|
|
51560
|
+
}
|
|
51557
51561
|
function inRecentlyDeletedMessage(title) {
|
|
51558
51562
|
return `Note "${title}" is already in Recently Deleted, where deleting it would remove it permanently. Nothing was deleted. Remove it from Recently Deleted in Notes.app if that is intended.`;
|
|
51559
51563
|
}
|
|
@@ -52826,6 +52830,9 @@ registerTool(
|
|
|
52826
52830
|
if (result.status === "in-recently-deleted") {
|
|
52827
52831
|
return errorResponse(inRecentlyDeletedMessage(snapshot.note.title));
|
|
52828
52832
|
}
|
|
52833
|
+
if (result.status === "container-unknown") {
|
|
52834
|
+
return errorResponse(containerUnknownMessage(snapshot.note.title));
|
|
52835
|
+
}
|
|
52829
52836
|
if (result.status === "not-deleted") {
|
|
52830
52837
|
return errorResponse(NOT_DELETED_MESSAGE);
|
|
52831
52838
|
}
|
|
@@ -53506,6 +53513,9 @@ registerTool(
|
|
|
53506
53513
|
if (result.status === "in-recently-deleted") {
|
|
53507
53514
|
return { id: id2, success: false, error: inRecentlyDeletedMessage(snapshot.note.title) };
|
|
53508
53515
|
}
|
|
53516
|
+
if (result.status === "container-unknown") {
|
|
53517
|
+
return { id: id2, success: false, error: containerUnknownMessage(snapshot.note.title) };
|
|
53518
|
+
}
|
|
53509
53519
|
if (result.status === "not-deleted")
|
|
53510
53520
|
return { id: id2, success: false, error: NOT_DELETED_MESSAGE };
|
|
53511
53521
|
return { id: id2, success: false, error: "Delete result uncertain; inspect this exact ID" };
|
package/package.json
CHANGED