Preface¶
The core philosophy of DSH is “everything is a plugin.” In practice, agent sessions often need to wait for user actions, such as waiting for permission approvals, answering questions, or confirming plans. If the application window is minimized or switched to other tasks at such times, users often cannot perceive these pending items in a timely manner.
The @camusugar/dsh-notify plugin solves this problem by monitoring session status and window focus changes, triggering OS-level notifications (Windows Toast / macOS Notification Center) when the application window loses focus.
Plugin Overview¶
- Name:
@camusugar/dsh-notify - Positioning: A DSH user-level plugin that pops up notifications when a session is waiting for user action and the application window loses focus.
- Maintainer: Camusugar
- License: MIT
Core Features¶
This plugin does not modify the DSH core; it is implemented entirely through the plugin mechanism. Key features include:
- Pure Event-Driven: Triggers notifications by subscribing to
uiSession.sessionStatusand listening to DOM events (visibilitychange/blur/focus), with no timers or polling mechanisms. - Zero-Intrusion Installation: Installed alongside the profile, without modifying DSH core code. Configuration persists after application updates.
- Fault-Tolerant Design: If the
uiSessionservice is missing or errors occur, the plugin silently disables itself without throwing exceptions to the system or causing application crashes. - Deduplication and Limits: Deduplicates notifications by key. A single session displays at most 16 notifications; excess notifications are silently suppressed.
- Multi-Session Concurrency: Supports handling multiple sessions simultaneously. Each session has an independent state snapshot and notification set. Keys across sessions (e.g.,
approval:N/question:N) are guaranteed to be unique via a global incrementing counter. Notifications for each session pop up and close independently. - Automatic Language Switching: Automatically selects Chinese or English text based on
navigator.language.
Installation & Activation¶
Use the official installation command to add this plugin:
dsh plugin add https://github.com/Camusugar/dsh-notify
The plugin loads automatically after installation with no additional configuration required.
Typical Usage¶
The plugin automatically triggers system notifications when the following conditions are met:
* The session is waiting for permission approval.
* The session is waiting for the user to answer a question (ask_user_question).
* The session is in the plan confirmation stage in Plan mode.
* The application window is minimized, switched to another window, or loses focus.
Technical Details & Notes¶
- Notification Mechanism: Uses the standard Web Notification API, theoretically supporting cross-platform operation.
- Dependency Requirements: Requires injecting the dependency
@deepseek-ai/dsh-client-ui-session. - macOS Limitations: On macOS, the application must be a signed build; otherwise, the Notification Center may not function correctly.
- Uninstallation:
- Quit the application.
- Edit the configuration file (Windows path:
C:\Users\<username>\.dsh\profiles\desktop\package.json): Remove@camusugar/dsh-notifyfromdsh.profile.bundlesanddependencies. - (Optional) Delete
node_modules\@camusugarin the same directory. - Restart the application.
Troubleshooting & Recovery¶
If the plugin causes application startup failure, use the built-in recovery feature:
1. When startup fails, select “Disable all plugins and restart” in the error dialog.
2. The application will back up cordis.patch.yml as cordis.patch.yml.bak-<timestamp> and reset dsh.profile.bundles to default values.
3. After restarting, the plugin can be reinstalled.
If you need to manually restore custom configurations, follow the uninstallation steps above.
Summary¶
This plugin enhances DSH’s usability during multitasking through lightweight event monitoring and system notification mechanisms. It is suitable for users who frequently handle multiple sessions or run long-running Agent tasks. Source code and documentation: GitHub.