feat(notification): add cmux as notification provider
Add cmux as the highest-priority notification provider on macOS. cmux delivers notifications via native UNUserNotificationCenter, properly attributed to the cmux app instead of Script Editor. Notification priority: cmux > terminal-notifier > osascript Tests cover the full fallback chain: - cmux available: uses cmux, skips others - cmux fails: falls back to terminal-notifier - cmux + terminal-notifier fail: falls back to osascript - cmux not available: skips to terminal-notifier Fixes #3628
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin"
|
||||
import { platform } from "os"
|
||||
import {
|
||||
getCmuxPath,
|
||||
getOsascriptPath,
|
||||
getNotifySendPath,
|
||||
getPowershellPath,
|
||||
@@ -40,7 +41,17 @@ export async function sendSessionNotification(
|
||||
): Promise<void> {
|
||||
switch (platform) {
|
||||
case "darwin": {
|
||||
// Try terminal-notifier first - deterministic click-to-focus
|
||||
// Try cmux first - native UNUserNotificationCenter, properly attributed
|
||||
const cmuxPath = await getCmuxPath()
|
||||
if (cmuxPath) {
|
||||
try {
|
||||
await ctx.$`${cmuxPath} notify --title ${title} --body ${message}`.quiet()
|
||||
break
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
|
||||
// Try terminal-notifier - deterministic click-to-focus
|
||||
const terminalNotifierPath = await getTerminalNotifierPath()
|
||||
if (terminalNotifierPath) {
|
||||
const bundleId = process.env.__CFBundleIdentifier
|
||||
|
||||
Reference in New Issue
Block a user