apple-tools-mcp 2.1.3 → 2.1.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.
- package/README.md +4 -0
- package/lib/mailWrite.js +12 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -480,8 +480,12 @@ Keystrokes use System Events, so **node needs Accessibility** (Privacy & Securit
|
|
|
480
480
|
|
|
481
481
|
**Compose body hit-test (2.1.3).** Mini host: `AXFocusedUIElement` role coerce fails (**-1700**); `windows of process Mail` is empty; a deep `UI elements` tree walk (the `app_ax_find` class of walk) **truncates after ~23 header/toolbar nodes** and never reaches compose `AXWebArea`. Subject-anchored clipboard read-back is refuted on Mini. The proven path: identify the compose window by the **subject title** among **top-level** System Events UI elements, then **coordinate AX hit-test** (`AXUIElementCopyElementAtPosition`) into the body region. The hit must be `AXWebArea` **"message body"**; a short `AXTextField` is fail-closed (`BODY_FOCUS_FAILED`). Focus + `AXValue` produced a **plain** Sent `.emlx` (cite=0) — no AppleScript `content` setter, no physical mouse click. Typed Returns / Cmd-V run only if a readable AX value is still missing the needle. System Events permissions probe is unchanged from 2.1.2.
|
|
482
482
|
|
|
483
|
+
**AXTitle compile (2.1.4).** Mini host: 2.1.3 `mail_send` never reached hit-test because `osacompile` failed **-2741** on bare `value of attribute "AXTitle" of atmEl` in `atmTopElemBits` / `atmTopElemExactTitle` (those handlers sit outside the System Events tell that walks top-level UI elements). Mini solution probe (`results-214/SOLUTION-PROBE-REPORT.md`): wrapping those AXTitle reads inside `tell application "System Events"` compiles (`osacompile` exit 0). Hit-test + fail-closed `AXTextField` + plain Sent behavior is unchanged from 2.1.3. Live Sent prove is after npm.
|
|
484
|
+
|
|
483
485
|
**mail_send success is Sent/Outbox verify (2.0.7).** AppleScript `send` returning without throw is not enough. After a real send the tool looks in **Sent** and **Outbox** and reports success only if the message is there. The success text names the delivery state (`mailbox: sent` + `delivery: sent`, or `mailbox: outbox` + `delivery: outbox` while still sending). If verify misses, the tool returns a failure (`isError`) — not success. Hang/timeout recover matches **To + subject** (and Message-ID when compose captured one). It never matches subject alone (short subjects like `test` are unsafe). `from` / account selection is out of scope; Mail's default From is used. `dry_run` / confirm-blocked writes stay `ok: false`, `planned: true`, `delivered: false`.
|
|
484
486
|
|
|
487
|
+
**Compile prove (2.1.4 on the Mini host):** Unpatched `buildComposeScript` / `buildMailBodyPasteHandler` `osacompile` **-2741** on those bare AXTitle reads; patched AXTitle-inside-System-Events tell `osacompile` exit 0. Report: `results-214/SOLUTION-PROBE-REPORT.md`. Global install untouched. Live Sent is the 2.1.3 ship prove after npm.
|
|
488
|
+
|
|
485
489
|
**Manual prove (2.1.3 on the Mini host):** After `apple-tools-mcp permissions` reports System Events granted, `mail_send` a short **multiline** plain message and a short `body_format: "html"` message whose body looks like ordinary paragraphs (for example `<p>Quick note</p>`), neither with a `Re:`/`Fwd:` subject. The body must land via title-marker + hit-test (not Tab / focused-role): no `BODY_FOCUS_FAILED` / `BODY_PASTE_MISDIRECTED`. Inspect each Sent `.emlx`: the text/plain part must contain the intended text (newlines preserved) and must not prefix every body line with `>`, and any HTML alternative must not wrap the whole body in `<blockquote type="cite">`. Compose must succeed (no `-2753` / undefined `newMessage`). Prove the production path (write-bridge with node → System Events allowed, **or** the documented in-process fallback). That quote-prefix Mini Sent prove is a separate bar from the 2.0.7 verify contract.
|
|
486
490
|
|
|
487
491
|
Emails are addressed by their RFC822 **Message-ID**. Pass `message_id`, or pass the `file_path` from `mail_search` / `mail_recent` and the server reads the Message-ID out of the `.emlx` headers for you. `mail_archive` moves the message to its account's Archive (or All Mail) mailbox; `mail_trash` moves it to that account's Trash.
|
package/lib/mailWrite.js
CHANGED
|
@@ -465,6 +465,12 @@ function systemEventsGrantKind(result) {
|
|
|
465
465
|
* Typed Returns / Cmd-V only if a readable AX value is still missing the
|
|
466
466
|
* needle. Header checks stay. System Events Apple events are wrapped in
|
|
467
467
|
* `with timeout`.
|
|
468
|
+
*
|
|
469
|
+
* Mini 2.1.3 compile: bare `value of attribute "AXTitle"` in
|
|
470
|
+
* atmTopElemBits / atmTopElemExactTitle is osacompile **-2741** (those
|
|
471
|
+
* handlers sit outside the System Events tell that walks top-level UI
|
|
472
|
+
* elements). 2.1.4 wraps those AXTitle reads inside
|
|
473
|
+
* `tell application "System Events"` (Mini solution-probe PASS).
|
|
468
474
|
*/
|
|
469
475
|
export function buildMailBodyPasteHandler() {
|
|
470
476
|
const seSecs = asInteger(MAIL_SE_APPLEEVENT_TIMEOUT_SEC, { min: 1, max: 30, field: "seTimeout" });
|
|
@@ -496,7 +502,9 @@ on atmTopElemBits(atmEl)
|
|
|
496
502
|
set atmBits to atmBits & (description of atmEl as string) & " "
|
|
497
503
|
end try
|
|
498
504
|
try
|
|
499
|
-
|
|
505
|
+
tell application "System Events"
|
|
506
|
+
set atmBits to atmBits & (value of attribute "AXTitle" of atmEl as string) & " "
|
|
507
|
+
end tell
|
|
500
508
|
end try
|
|
501
509
|
return atmBits
|
|
502
510
|
end atmTopElemBits
|
|
@@ -509,7 +517,9 @@ on atmTopElemExactTitle(atmEl, atmMarker)
|
|
|
509
517
|
if (title of atmEl as string) is atmMarker then return true
|
|
510
518
|
end try
|
|
511
519
|
try
|
|
512
|
-
|
|
520
|
+
tell application "System Events"
|
|
521
|
+
if (value of attribute "AXTitle" of atmEl as string) is atmMarker then return true
|
|
522
|
+
end tell
|
|
513
523
|
end try
|
|
514
524
|
return false
|
|
515
525
|
end atmTopElemExactTitle
|