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

@@ -54,17 +54,20 @@ struct ClawdisCLI {
var title: String?
var body: String?
var sound: String?
var priority: NotificationPriority?
while !args.isEmpty {
let arg = args.removeFirst()
switch arg {
case "--title": title = args.popFirst()
case "--body": body = args.popFirst()
case "--sound": sound = args.popFirst()
case "--priority":
if let val = args.popFirst(), let p = NotificationPriority(rawValue: val) { priority = p }
default: break
}
}
guard let t = title, let b = body else { throw CLIError.help }
return .notify(title: t, body: b, sound: sound)
return .notify(title: t, body: b, sound: sound, priority: priority)
case "ensure-permissions":
var caps: [Capability] = []
@@ -169,7 +172,7 @@ struct ClawdisCLI {
clawdis-mac — talk to the running Clawdis.app XPC service
Usage:
clawdis-mac notify --title <t> --body <b> [--sound <name>]
clawdis-mac notify --title <t> --body <b> [--sound <name>] [--priority <passive|active|timeSensitive>]
clawdis-mac ensure-permissions
[--cap <notifications|accessibility|screenRecording|microphone|speechRecognition>]
[--interactive]