dsh-notify-sound: Notification Sound Plugin for DSH Web Dialogues and Approval Scenarios

Preface

When running long conversations or parallel tasks with DSH (DeepSeek Harness), the window is often not in the foreground. When a round of generation ends, an approval dialog pops up, or a click is required for ask_user_question / plan confirmation, it is easy to miss the timing without obvious feedback. A common practice is to keep an eye on the interface or rely on system notifications, but DSH Web itself does not come with client-side capabilities like “ringing on event.”

Below is an introduction to the community plugin dsh-notify-sound (Maintainer: Fur1naaaaaaaa, Category: Client). It monitors DSH session events on the host side, pushes them to the browser via local HTTP/SSE, synthesizes notification sounds on-site using Web Audio, and includes a settings page along with optional fallbacks for bubbles and title flashing.

What is this

dsh-notify-sound is a notification sound plugin for DSH Web. It rings a bell at moments such as “Conversation Completed,” “Authorization Required,” or “Question/Plan Confirmation Pop-up,” drawing you back from other windows. The audio does not rely on external files or npm dependency packages (dependencies is empty); the four tone colors are synthesized in the browser using Web Audio.

When it rings

The README uses a table to combine trigger moments, default tones, and detection sources. The core details are as follows.

Trigger Moment Default Notification Sound Detection Source
A conversation turn completes Two clear ascending tones (A5 → E6) turn/end in session/event, with reason=completed
Authorization required Three urgent square waves (C6 C6 F6) approval/request (the moment the approval dialog appears)
Question / Plan confirmation pop-up Two inquiring tones (E5 → B5) user-questions/request (both ask_user_question and plan-review use this)
Error / Blocked / Max length end Two low warning tones The same turn/end, with reason as error, blocked, max-tokens, etc.

Subagent (subagent / workflow sub-session) turn ends are filtered by skipSubagents by default to avoid serial ringing during multi-agent collaboration. aborted / interrupted caused by active user stopping are not in turnEndReasons by default, preventing reminders when you press stop yourself.

Core Capabilities

Settings Interface (Recommended Entry)

After installation, open Settings → Plugins → Notification Sound (next to “Plugin Market”):

  • Volume Slider: Dragging takes effect immediately and writes to ~/.dsh/dsh-notify-sound.json;
  • Four Preview Buttons: Completed / Question / Approval / Error;
  • “When to ring”: Three switches for Conversation Completed, Authorization Required, and Question/Plan Confirmation Pop-up, plus Ignore Subagents, Only Ring When Backgrounded, and Master Switch;
  • Notification Bubble Policy (auto / always / never) and “Flash Title When Backgrounded”;
  • If there are local overrides in the browser’s localStorage (e.g., you clicked “Mute” on a bubble), the page will indicate this and provide “Clear Local Overrides”.

No page refresh is needed after saving: the script running within the page will re-pull the configuration. To confirm if the settings page is hooked up, check ui.module.tabRegistered in the return of /dsh-notify/ping.

Transport & Synthesis

The host-side lib/index.js monitors session/event, approval/request, user-questions/request, etc., increments the seq for notifications, and pushes them to the browser. The browser side prioritizes SSE /dsh-notify/stream; if it cannot connect, it falls back to pollMs polling of /dsh-notify/events, preventing notification delays caused by background tab timer throttling. The same notification is deduplicated by seq; the plugin resets the cursor using bootId upon reload to avoid missing notifications or playing back old generations.

Even when autoplay is blocked, it will still pop up bubbles and flash the title, prompting you to click the page to unlock the AudioContext.

Browser Console API

You can debug in the F12 Console on the DSH Web page:

dshNotifySound.status()            // Config, transport mode (sse/polling), AudioContext status, statistics
dshNotifySound.test()              // Preview "Conversation Completed"
dshNotifySound.test('approval')    // Also question / error
dshNotifySound.toggle()            // Turn on / off
dshNotifySound.setVolume(0.8)      // Volume 0~1, takes effect immediately and is remembered
dshNotifySound.refreshConfig()     // Re-pull after changing host config file, no need to refresh page
dshNotifySound.overrides()         // View keys overridden by the browser
dshNotifySound.reset()             // Clear all browser overrides

Installation & Activation

Requirements: DSH 0.2.x (README development and verification environment is 0.2.0-rc.2 desktop), Node ≥ 20. The plugin does not introduce third-party npm packages.

Install from npm (most convenient if published as stated in README):

dsh plugin --profile <your-profile> add dsh-notify-sound

Install from GitHub:

dsh plugin --profile <your-profile> add github:Fur1naaaaaaaa/dsh-notify-sound

Local directory development mounting:

dsh plugin --profile <your-profile> add link:/absolute/path/dsh-notify-sound

Refresh the page once after installation: The injected script is written into index.html during page load, so already open tabs will not automatically have the script. To uninstall, disable or delete the entry in the plugin manager.

Configuration Description

Configuration overrides level by level according to fields: Defaults → config of this plugin entry in the profile → ~/.dsh/dsh-notify-sound.json → Browser localStorage (only records keys you explicitly changed).

Complete field example for ~/.dsh/dsh-notify-sound.json:

{
  "enabled": true,
  "volume": 0.5,
  "pollMs": 700,
  "turnEnd": true,
  "approval": true,
  "question": true,
  "turnEndReasons": ["completed", "error", "blocked", "max-tokens"],
  "skipSubagents": true,
  "onlyWhenHidden": false,
  "toast": "auto",
  "flashTitle": true
}

onlyWhenHidden: true means it only rings when the page is in the background, which is a common usage in multi-window scenarios. You can also write config in the profile patch (the id must match the mount id, the README example is notify-sound).

Three ways to adjust volume, from most to least recommended: Settings page slider; editing volume (0~1) in ~/.dsh/dsh-notify-sound.json then refreshing or running dshNotifySound.refreshConfig(); Console dshNotifySound.setVolume(0.8).

Typical Usage & Self-Check

Host HTTP Self-Check

Get <port> from the address printed when starting dsh web, or the environment variable DSH_WEB_URL:

curl http://127.0.0.1:<port>/dsh-notify/ping
curl "http://127.0.0.1:<port>/dsh-notify/test?type=approval"

In /ping, lastAck.outcome: played indicates the browser actually played sound; blocked is mostly due to autoplay policy; muted means currently muted. metrics.streamOpened confirms if SSE was used.

Preview the four sounds in order

The repo provides a script that connects to http://127.0.0.1:19387 by default and pushes previews for Completed, Question, Approval, and Error in rhythm with browser receipts:

python scripts/preview-cues.py
python scripts/preview-cues.py http://127.0.0.1:<port>

Suitable Scenarios & Notes

Who it is for: Developers who let DSH run generation in the background for long periods and need to switch back to the foreground for approvals or answering questions; users who want to supplement the Web side with “auditory reminders” using a lightweight client plugin without wanting to maintain audio resource files.

Permissions & Privacy (Key points from README): The plugin does not request external networks, only registers local http://127.0.0.1:<port>/dsh-notify/* routes; it writes to ~/.dsh/dsh-notify-sound.json and browser localStorage['dsh-notify-sound.prefs']. Routes are registered via DSH webServer and do not go through DSH Web login authentication; same-origin pages can read and write, cross-origin is restricted by CORS. The plugin runs with the same permissions as the current dsh process. Please review the source code and MIT license yourself before installation, and assess if there are untrusted local processes on your machine.

Troubleshooting Quick Check: If it doesn’t ring at all, check /dsh-notify/ping and dshNotifySound.status(); if it doesn’t ring the first time, it’s mostly because the page wasn’t clicked to unlock audio; if config doesn’t take effect, check dshNotifySound.overrides() first; if the settings page is missing, check ui.module.error in /ping; if sound is late, confirm if it fell back to background polling and try refreshing to reconnect SSE.

The community directory site skillhub has no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem emphasizes “everything is a plugin,” this article introduces a community-maintained client plugin, not an officially built-in feature.

Conclusion

dsh-notify-sound binds DSH host events, local SSE/polling, and Web Audio synthesis together: zero third-party dependencies, with a settings page and console API, suitable for the daily development rhythm of “person not next to the window, but conversation is still running.” For further information, open the Directory Page and GitHub Repo.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye