Raises a macOS Notification Center banner at four moments when a DSH agent waits on you — tool approval, ask_user_question, a finished turn, and a session error — each with its own switch and alert tone; banners are clickable through the bundled DSH Notify helper and bring DSH back to the front, finish reminders can follow the frontmost app or the system idle time (60 seconds), a burst of finishes is merged into one banner, error reminders are capped, and the bilingual settings page offers a test notice, a self-check and an Open DSH action.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:wphhyan/dsh-approval-notify
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
简体中文 | English
Raises a macOS Notification Center banner at the four moments an agent stops and waits for you: a tool approval, an ask_user_question prompt, a finished turn, and a session error — one switch each, and clicking the banner brings DSH back to the front.
| Event | Source | Default |
|---|---|---|
| Approval | approval/request — a tool call needs permission; only exists while the permission preset asks (read-only / workspace-write) |
on |
| Question | user-questions/request — the agent calls ask_user_question |
on |
| Finish | api-session/status — a session stops running and waits for you; skipped while DSH is frontmost |
on |
| Error | api-session/error — a session or turn failed |
on |
The approval and question events are Cordis waterfalls: the plugin listens, announces, and always delegates with next(). It never answers, and a missing banner can never block a tool call.
Install
Requires macOS and DSH >=0.2.2-rc.5 <0.3.0.
dsh plugin --profile <profile> add github:wphhyan/dsh-approval-notify
Then enable the bundle, and restart the desktop app (⌘Q) so the Host half loads its module generation. On desktop the profile is usually desktop; find it in Settings → Plugins.
The market install is the same package: Plugins → Discover, search for dsh-approval-notify, install, enable, restart.
What you get
- Clickable banners. A ~600 KB
DSH Notifyhelper app ships with the plugin (source inhelper/, reproducible build script) and posts the banner from its own identity: clicking it brings the DSH desktop app to the front (using the app's owndsh://openwhen it is not running), or opens the page when onlydsh webruns. The notification permission is requested only by the settings page's request button. - Banner with the tone attached.
display notification … sound name/--soundhands both to the system, so the tone is never truncated by a plugin-side timeout and Focus/mute rules apply exactly as they do for any other app: approval Glass, question Ping, finish Tink, error Basso. - Quiet when it should be. Finish reminders can follow the frontmost app or, in away-only mode, the system idle time (60s of no input), which is more accurate when the GUI runs in a browser; one finish reminder per session per 5 s; sessions that finish within a 4 s window are merged into one banner (subtitle "N sessions", counters still add up per session); error reminders are limited to one per 5 minutes, so an automation that fails every minute cannot fill the notification center; the same
callIdis announced once per 3 s. - Settings page under Settings → Plugins → 审批提醒: ten switches (master, approval, question, finish, error, sound, skip-while-focused, away-only via idle time, clickable, also notify scheduled runs), four counters, the last event, and five buttons — Request notification permission, Send test notification, Self-check, Open system notification settings, Refresh.
- A tool for your agent:
dsh_approval_notifywithstatus,test, anddiagnose; the oldapproval_notifyname stays as an alias so existing prompts keep working. - Copy follows the UI language: the settings page registers Chinese and English dictionaries with the DSH locale service, and the Host picks its notification, status and tool text from the
clientLocalethe page writes.
Delivery and limitations
- With clickable on, the helper posts the banner and macOS shows it as DSH Notify; clicking it brings DSH to the front. The permission is requested only by the Request notification permission button in the settings page — a notification itself never opens an authorization dialog. Without permission, or after a denial, delivery falls back to the compatible channel automatically (banners still arrive, shown as Script Editor) until you allow DSH Notify in System Settings → Notifications.
- Scheduled runs stay quiet by default: sessions created by
dsh-automation-session-*(the scheduling plugin) do not raise finish or error reminders, so a broken one-minute task cannot fill the notification center; turn on Also notify scheduled runs when you want them. - With clickable off (or the helper missing), delivery falls back to
osascript display notification: no permission prompt, but macOS attributes the banner to Script Editor (「脚本编辑器」) and it cannot be clicked. That channel stays as the safety net. - A click returns you to DSH, not to one Session: DSH 0.2.2-rc.5's desktop app only handles
dsh://open, and the web client has no Session URL routing, so there is no Session deep link to open. - Exit code 0 means the notification server accepted the request, not that you saw it. Focus modes, muting Script Editor in System Settings, or a locked screen drop it silently, so the plugin reports "submitted" instead of "seen".
- macOS only. On other platforms the tool reports the channel as unavailable.
- Approval reminders never appear under the
full-accesspreset: it rejects approval-requiring calls outright, so no request exists to announce. Switch to read-only or workspace-write to exercise that channel. - The plugin writes only its own status counters (
plugin-data/dsh-approval-notify/) and its own volatile config fields. It never edits the profile patch file directly.
Troubleshooting
- Settings → Plugins → 审批提醒 → Request notification permission (once; it shows the single system dialog), then Send test notification. If a banner appears, the channel works.
- Self-check also reports the frontmost app and the tone result.
- Open system notification settings jumps to the macOS pane; check that DSH Notify (or Script Editor for the fallback channel) is allowed and that a Focus mode is not on.
- Check
~/.dsh/profiles/<profile>/plugin-data/dsh-approval-notify/debug.logfornotify(...)lines, andstate.jsonfor the counters.
Implementation
lib/notify.js— startshelper/DSHNotify.appfirst (clickable, handles the click), falls back to AppleScript +osascript, and toafplaywhen the scripted request is rejected.helper/dsh-notify.m— about 200 lines of Objective-C: deliver throughUNUserNotificationCenter, keep a run loop alive for the click, then activatecom.deepseek.dshor open the web GUI URL;helper/build.shcompiles universal (arm64 + x86_64) and ad-hoc signs it.lib/system.js— frontmost app throughlsappinfo(1 s cache), opening the notification settings pane.lib/state.js— atomic counters and last event underplugin-data, tolerating an older state document.client.js— the settings page, reading and writing this plugin's settings namespace throughctx.remote.settings.
Development
npm run check # syntax check with node --check
npm test # node:test: pure functions, state document, manifest, helper
helper/build.sh rebuilds the universal DSH Notify helper with clang (macOS plus the Xcode command line tools). CI runs the syntax check, the unit tests, and a npm pack file-list assertion on Ubuntu.
Helper modes: --status prints the notification authorization (0 not determined, 1 denied, 2 allowed), --request asks once, --activate-now --focus-url dsh://open only focuses the window, and a no-argument launch behaves like clicking an older banner. The web GUI URL travels in the DSH_NOTIFY_URL environment variable, never in the process arguments.
License
MIT
Links
More in this category
xmanrui/dsh-im★ 3817
Connect IM bots to DeepSeek Harness via QR codes or bot credentials (9 channels: Feishu, WeChat, DingTalk, WeCom, QQ, Slack, Telegram, Discord, and WhatsApp).
shaobeichen/dsh-pocket★ 3174
Remote phone access to the DSH Web UI: scan a QR code for LAN or public (cloudflared tunnel) access with real-time sync, a mobile-adaptive layout, and a settings tab.
c1overzz/dsh-bili-scroll★ 1477
Let your DSH agent browse Bilibili on its own, read subtitles, write a daily digest, and @ you when it finds something worth your attention.
OpenPetsHQ/openpets#dsh★ 1412
Bridges DeepSeek Harness lifecycle status, errors, and approval requests to a locally running OpenPets desktop companion.
inclusionAI/Avernet#deepseek-harness-channel-bcn★ 611
Connects DeepSeek Harness to Avernet's Bot Collaboration Network over WebSocket V2, with automatic onboarding, isolated agent sessions, tool-call events, and multi-bot routing tools.
zaofan-make/dsh-qqbot★ 284
QQ official bot channel (enhanced fork of tencent-connect/dsh-qqbot): full agent chat in groups and DMs, rich media, an auto-tagged sticker library with AI image replies, join approval, mute and broadcast, scheduled wakeups, remote approvals over QQ, interactive cards, multi-account instances, extensions, member profiles, and token-saving value-scored wakeups.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.