apple-notes-mcp 2.8.12 → 2.8.14
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 +16 -3
- package/build/index.js +13 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -225,6 +225,14 @@ Creates a new note in Apple Notes.
|
|
|
225
225
|
|
|
226
226
|
> **Note:** The title is automatically prepended as `<h1>` in both plaintext and HTML formats. Do not include a `<h1>` title tag in the `content` parameter, or the title will appear twice.
|
|
227
227
|
|
|
228
|
+
> **Known limitation:** `create-note` sets the note body directly via AppleScript's
|
|
229
|
+
> `body` property, which does not apply real Notes paragraph styles for interior
|
|
230
|
+
> content — an `<h2>`/`<h3>` tag or a `<span style="font-size: …px">` heading span
|
|
231
|
+
> in `content` renders as plain bold, styled text, not an actual Heading or
|
|
232
|
+
> Subheading ([#172](https://github.com/sweetrb/apple-notes-mcp/issues/172)). Real
|
|
233
|
+
> Heading/Subheading styles can currently only be added to a note that already
|
|
234
|
+
> exists, with [`append-native`](#append-native)'s `format: "markdown"`.
|
|
235
|
+
|
|
228
236
|
**Returns:** Confirmation message with note title and ID. Save the ID for subsequent operations like `update-note`, `delete-note`, etc.
|
|
229
237
|
|
|
230
238
|
---
|
|
@@ -1066,9 +1074,14 @@ when `scopeText` is supplied. Use a distinctive phrase of plain words without
|
|
|
1066
1074
|
punctuation, hashtags, or paths because Notes search may not resolve them
|
|
1067
1075
|
literally. `format: "html"` accepts the fixed subset tabulated under
|
|
1068
1076
|
[`append-to-note`](#append-to-note); content outside it is refused by name, with
|
|
1069
|
-
the accepted subset in the error.
|
|
1070
|
-
|
|
1071
|
-
|
|
1077
|
+
the accepted subset in the error. `format: "markdown"` accepts the same bounded
|
|
1078
|
+
subset as `format: "html"`'s Markdown-shaped content (`#`/`##`/`###` headings,
|
|
1079
|
+
flat lists, emphasis, and inline links) but is sent through Notes' own native
|
|
1080
|
+
Markdown importer rather than converted to HTML first, so `#`/`##`/`###`
|
|
1081
|
+
produce real Title/Heading/Subheading — Notes' HTML importer only
|
|
1082
|
+
distinguishes two heading levels and renders `###` the same as `##`. A
|
|
1083
|
+
transport failure names the Shortcut it was waiting on, so a missing or
|
|
1084
|
+
unapproved bridge is identified rather than guessed at.
|
|
1072
1085
|
|
|
1073
1086
|
#### `create-checklist-item`
|
|
1074
1087
|
|
package/build/index.js
CHANGED
|
@@ -39708,7 +39708,7 @@ function visibleCharacters(html) {
|
|
|
39708
39708
|
token++;
|
|
39709
39709
|
if (part[0].startsWith("<")) continue;
|
|
39710
39710
|
for (const item of part[0].matchAll(
|
|
39711
|
-
/&(?:#[0-9]+;?|#x[0-9a-f]+;?|(?:amp|lt|gt|quot|
|
|
39711
|
+
/&(?:#[0-9]+;?|#x[0-9a-f]+;?|(?:amp|lt|gt|quot|nbsp);?|apos;)|[\s\S]/gi
|
|
39712
39712
|
)) {
|
|
39713
39713
|
const value = decodeEntity(item[0]);
|
|
39714
39714
|
for (let i = 0; i < value.length; i++) {
|
|
@@ -39770,7 +39770,8 @@ function enrichNoteRead(id2, rawBody) {
|
|
|
39770
39770
|
warning: "Native tags, inline objects or checklists are present. Their state is not writable through AppleScript; full-body edits are blocked to preserve them."
|
|
39771
39771
|
} : {}
|
|
39772
39772
|
};
|
|
39773
|
-
} catch {
|
|
39773
|
+
} catch (err) {
|
|
39774
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
39774
39775
|
return {
|
|
39775
39776
|
content: rawBody,
|
|
39776
39777
|
links: metadata?.links ?? [],
|
|
@@ -39778,7 +39779,7 @@ function enrichNoteRead(id2, rawBody) {
|
|
|
39778
39779
|
complete: false,
|
|
39779
39780
|
writable: false,
|
|
39780
39781
|
revision: metadata?.revision ?? "unavailable",
|
|
39781
|
-
warning:
|
|
39782
|
+
warning: `Rich Notes metadata could not be read or matched. Links/native tags may be missing from this view. Full-body edits are blocked; check Full Disk Access and retry after sync. (${detail})`
|
|
39782
39783
|
};
|
|
39783
39784
|
}
|
|
39784
39785
|
}
|
|
@@ -39799,10 +39800,12 @@ function htmlLinks(html) {
|
|
|
39799
39800
|
}
|
|
39800
39801
|
return links;
|
|
39801
39802
|
}
|
|
39803
|
+
var BARE_HTTP_ORIGIN = /^https?:\/\/[^/?#]+$/i;
|
|
39804
|
+
var normalizedUrl = (url) => BARE_HTTP_ORIGIN.test(url) ? `${url}/` : url;
|
|
39802
39805
|
function linkSignature(links) {
|
|
39803
39806
|
return JSON.stringify(
|
|
39804
39807
|
links.flatMap(
|
|
39805
|
-
(link) => normalized(link.text).split("").map((char) => [char, link.url])
|
|
39808
|
+
(link) => normalized(link.text).split("").map((char) => [char, normalizedUrl(link.url)])
|
|
39806
39809
|
)
|
|
39807
39810
|
);
|
|
39808
39811
|
}
|
|
@@ -43156,15 +43159,10 @@ function assertAppendedVisibleText(beforeHtml, afterHtml, expected) {
|
|
|
43156
43159
|
}
|
|
43157
43160
|
function appendNative(manager, request) {
|
|
43158
43161
|
validateAppendContent(request.content, request.format);
|
|
43159
|
-
if (request.format === "markdown")
|
|
43160
|
-
return appendNative(manager, {
|
|
43161
|
-
...request,
|
|
43162
|
-
content: appendMarkdownHtml(request.content),
|
|
43163
|
-
format: "html"
|
|
43164
|
-
});
|
|
43165
43162
|
if (request.format === "html" && /<table\b/i.test(request.content))
|
|
43166
43163
|
throw new Error("Use create-table for verified native table insertion");
|
|
43167
|
-
const
|
|
43164
|
+
const markdownHtml = request.format === "markdown" ? appendMarkdownHtml(request.content) : null;
|
|
43165
|
+
const op = request.format === "plaintext" ? "append-text" : request.format === "markdown" ? "append-markdown" : "append-html";
|
|
43168
43166
|
const text = request.format === "html" ? "<div><br></div>" + request.content : "\n\n" + request.content;
|
|
43169
43167
|
return mutateBackground(
|
|
43170
43168
|
request,
|
|
@@ -43172,10 +43170,11 @@ function appendNative(manager, request) {
|
|
|
43172
43170
|
{ text },
|
|
43173
43171
|
(before, after) => {
|
|
43174
43172
|
assertPreserved(before, after, { append: true });
|
|
43175
|
-
const
|
|
43173
|
+
const verifyHtml = markdownHtml ?? request.content;
|
|
43174
|
+
const expected = request.format === "plaintext" ? request.content : comparableVisibleText(verifyHtml);
|
|
43176
43175
|
if (expected) assertAppendedVisibleText(before.html, after.html, expected);
|
|
43177
|
-
if (request.format === "html")
|
|
43178
|
-
assertAppendedHtmlLinks(before.rich.links.length, after.rich.links,
|
|
43176
|
+
if (request.format === "html" || request.format === "markdown")
|
|
43177
|
+
assertAppendedHtmlLinks(before.rich.links.length, after.rich.links, verifyHtml);
|
|
43179
43178
|
},
|
|
43180
43179
|
backgroundDependencies(manager)
|
|
43181
43180
|
);
|
package/package.json
CHANGED