import type { NotificationPayload, NotificationsAPI } from '@openchamber/ui/lib/api/types'; import { sendBridgeMessage } from './bridge'; type NotifyResponse = { shown?: boolean }; export const createVSCodeNotificationsAPI = (): NotificationsAPI => ({ async notifyAgentCompletion(payload?: NotificationPayload): Promise { try { const response = await sendBridgeMessage('notifications:notify', { payload }); return Boolean(response?.shown); } catch { return false; } }, async canNotify(): Promise { try { return await sendBridgeMessage('notifications:can-notify'); } catch { return false; } }, });