Repository navigation
feat: list notifications and act on one through Notification Center's custom actions - #74
Merged
Merged
Conversation
This was referenced Oct 17, 2026
This was referenced Oct 17, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
desktop_notifications(read) anddesktop_notification_action(act). There are now 44 tools.Model assumed (macOS 11–15)
com.apple.notificationcenterui), and so is the open panel.Name:<name>\nTarget:…\nSelector:…descriptors: Close, Show, Options, and the app's own actions.AXNotificationCenter*.Peekaboo:
peekaboo-notification-actions.patch(last in the stack)DetachedAXObservationWorkersetsattributes.customActionsto the custom action names, newline-joined. It does this only when the traversed process's executable is exactly/System/Library/CoreServices/NotificationCenter.app/Contents/MacOS/NotificationCenter(proc_pidpath). Bounds:performActionWithOutcomeacceptsAXCustomAction:<name>and runs element-action's usual checks: snapshot, exact snapshot element, process generation, and the mutation target. It also refuses before dispatch unless both of these hold:customActionDescriptorsseamIt performs the one matching descriptor and reports the requested name as
actionName, because the Bridge.performActionreceipt requiresresult.actionName == expected.NotificationCenterCustomActionsTests): parsing, bounds, duplicates, the reserved form,isValidActionName, the non-NC process gate, performing the listed descriptor, and refusing before dispatch outside NC or for an unlisted or ambiguous name. Run with a narrow filter together withActionInputDriverTests, whose fixture now records action names: 93 tests passed.Client
actions.swift:element-actionalso acceptsAXCustomAction:<name>, but only when the snapshot element'scustomActionslists that name.src/notifications.ts, the read side:customActionsor anAXNotificationCenter*subrole.id=snapshot/element,kind,app,title,subtitle,body,time,description, rawtexts,stack, andactions.fields_from: identifiers); otherwise from text order plus the app name at the start of the description (fields_from: order).system_alertslists UserNotificationCenter and SecurityAgent windows fordesktop_dialog. They are never inspected or acted on.openis the element click.closerunsAXCustomAction:Close.AXCustomAction:<name>.completedonly when the entry (same window, kind, texts and description as in the last read) is gone; otherwise it isunknown.test/notifications.test.mjswith fixtures.docs/tools.mdand the patch README.Checks
npm run checkandnpm test(14) pass. Native and the signed dev app build.desktop_notifications. It finds NC (pid 1299) and its 3 widget windows, which report capture-unavailable errors, and it lists the 5 UserNotificationCenter alerts undersystem_alertswithout touching them.