Skip to main content

Module notification

Module notification 

Source
Expand description

Desktop notification system for task completion and failures.

Responsibilities:

  • Send cross-platform desktop notifications via notify-rust.
  • Play optional sound alerts using platform-specific mechanisms.
  • Provide graceful degradation when notification systems are unavailable.
  • Support different notification types: task success, task failure, loop completion.

Does NOT handle:

  • Notification scheduling or queuing (callers trigger explicitly).
  • Persistent notification history or logging.
  • UI mode detection (callers should suppress if desired).
  • Do Not Disturb detection (handled at call site if needed).

Invariants:

  • Sound playback failures don’t fail the notification.
  • Notification failures are logged but don’t fail the calling operation.
  • All platform-specific code is isolated per target OS.
  • Windows custom sounds are limited to .wav files played through WinMM.

Structs§

NotificationConfig
Configuration for desktop notifications.
NotificationOverrides
CLI overrides for notification settings. Fields are Option<bool> to distinguish “not set” from explicit false.

Enums§

NotificationType
Types of notifications that can be sent.

Functions§

build_notification_config
Build a runtime NotificationConfig from config and CLI overrides.
notify_loop_complete
Send loop completion notification. Silently logs errors but never fails the calling operation.
notify_task_complete
Send task completion notification. Silently logs errors but never fails the calling operation.
notify_task_complete_with_context
Send task completion notification with UI awareness. Silently logs errors but never fails the calling operation.
notify_task_failed
Send task failure notification. Silently logs errors but never fails the calling operation.
notify_watch_new_task
Send watch mode notification for newly detected tasks. Silently logs errors but never fails the calling operation.
play_completion_sound
Play completion sound using platform-specific mechanisms.
send_notification
Send a notification based on the notification type. Silently logs errors but never fails the calling operation.