macOS: add --priority flag for time-sensitive notifications

Add NotificationPriority enum with passive/active/timeSensitive levels
that map to UNNotificationInterruptionLevel. timeSensitive breaks
through Focus modes for urgent notifications.

Usage: clawdis-mac notify --title X --body Y --priority timeSensitive
This commit is contained in:
Peter Steinberger
2025-12-12 18:27:12 +00:00
parent 8ca240fb2c
commit c86cb4e9a5
4 changed files with 34 additions and 9 deletions

View File

@@ -14,9 +14,9 @@ enum ControlRequestHandler {
}
switch request {
case let .notify(title, body, sound):
case let .notify(title, body, sound, priority):
let chosenSound = sound?.trimmingCharacters(in: .whitespacesAndNewlines)
let ok = await notifier.send(title: title, body: body, sound: chosenSound)
let ok = await notifier.send(title: title, body: body, sound: chosenSound, priority: priority)
return ok ? Response(ok: true) : Response(ok: false, message: "notification not authorized")
case let .ensurePermissions(caps, interactive):