Vai al contenuto principale
A

dsh-notify-win

andyqwe44/dsh-notify-win

Native Windows toast + taskbar flash for task done / approval / ask_user_question; Win10/11, npm install `dsh plugin --profile web add dsh-notify-win`.

Installazione

dsh plugin --profile web add github:andyqwe44/dsh-notify-win

README

dsh-notify-win

DeepSeek Harness (DSH) Windows notification plugin โ€” native toast + taskbar flash when a task finishes or your input is needed.

English | ไธญๆ–‡

platform license version

๐Ÿ“ธ Screenshots

Task finished

Task finished toast

Context compacted

Context compacted toast

Question โ€” single select

Single-select question toast

Toast timeout โ†’ taskbar flash

Taskbar flash after toast timeout

Screenshots are from Windows 11. The taskbar flash is animated; the screenshot shows the DSH taskbar button highlighted by the system warm pulse.

โœจ Features

  • ๐Ÿ”” Native Windows toast (bottom-right, Win10/11 system style)
  • ๐Ÿ’ก Taskbar flash (FlashWindowEx) when DSH is in the background
  • ๐Ÿ–ฑ๏ธ Click-to-focus โ€” clicking a toast opens DSH and switches to the corresponding session
  • โœ… Triggers when a task finishes (root agent goes idle)
  • ๐Ÿ—œ๏ธ Triggers when context compaction finishes (session/event โ†’ compaction/end)
  • โ“ Triggers when your input is needed (approval / ask_user_question)
  • ๐Ÿ“‹ Single-select question toast: native dropdown with up to 5 options + โ€œ่‡ชๅฎšไน‰็ญ”ๆกˆโ€ (custom answer) text input + Cancel / Send
  • โฐ Timeout flash fallback: if an interactive toast is ignored and dismissed by the system timeout, the taskbar flashes so the pending question is not missed
  • ๐Ÿ–ผ๏ธ Hero banner with the DeepSeek Harness logo (light/dark theme aware)
  • ๐Ÿš€ Fire-and-forget: no service, no model approval, no settings namespace

๐Ÿš€ One-line install

dsh plugin --profile web add dsh-notify-win

Requires pnpm on PATH (corepack enable if missing). See Install for details.

Install

  1. Prerequisite: pnpm

    corepack enable
    

    Or without admin, put a user-level shim in a PATH directory:

    Set-Content -Path "$env:LOCALAPPDATA\Microsoft\WindowsApps\pnpm.cmd" -Value "@echo off`r`ncorepack pnpm %*`r`n"
    corepack pnpm --version
    
  2. Install the plugin

    # From npm (recommended)
    dsh plugin --profile web add dsh-notify-win
    
    # Or directly from GitHub:
    dsh plugin --profile web add github:Andyqwe44/dsh-notify-win
    
    # If github: is blocked, use SSH:
    dsh plugin --profile web add git+ssh://git@github.com/Andyqwe44/dsh-notify-win.git
    
  3. Verify

    dsh --profile web --dump-config   # look for: # == dsh-notify-win / - id: dsh-notify-win
    
  4. Restart and test

    dsh web
    

    Complete any task. The first notification self-registers the branded toast identity (Start Menu shortcut + AppUserModelID, one-time). If the toast header still shows DeepSeekHarness without an icon, restart Explorer once:

    Stop-Process -Name explorer -Force; Start-Process explorer
    

Requirements

  • Windows 10/11
  • DeepSeek Harness, any profile (web recommended)
  • PowerShell 7 or Windows PowerShell 5.1 (5.1 is used automatically as fallback)
  • .NET 10 Desktop Runtime (x64) โ€” only needed for interactive question toasts (ask_user_question); done/compact toasts use PowerShell and do not require it

Configuration

Edit $env:USERPROFILE\.dsh\profiles\web\cordis.patch.yml:

- id: dsh-notify-win
  config:
    doneTitle: 'DeepSeek Harness ยท Task complete'
    doneBody: 'Your task has finished.'
    compactTitle: 'DeepSeek Harness ยท Context compacted'
    compactBody: 'Context compaction finished, you can continue.'
    questionTitle: 'DeepSeek Harness ยท Action needed'
    questionBody: 'An approval or decision is waiting.'
    askTitle: 'DeepSeek Harness ยท Question for you'
    askBody: 'The assistant asked you something.'
    dedupMs: 1500              # suppress duplicate notifications within this window
    showProject: true          # prefix body with project label

To disable:

- id: dsh-notify-win
  disabled: true

Restart after install/disable changes (web profile HMR is disabled by default).

How it works

ConcernImplementation
Trigger "done"agent/status event with status: 'idle' (root agents only)
Trigger "compact"session/event โ†’ compaction/end (no error)
Trigger "question"approval/request waterfall + tools/execute for ask_user_question
Done/compact toastWinRT Windows.UI.Notifications via notify.ps1 with hero banner, falls back to NotifyIcon balloon
Interactive question toast.NET helper dsh-toast-question.exe (reads dropdown/text input and posts the answer back to the host)
Taskbar flashEnumWindows + FlashWindowEx (FLASHW_TRAY | FLASHW_TIMERNOFG = 14)
ExecutionFire-and-forget subprocess (powershell / dsh-toast-question.exe)

The plugin registers no service, tool, or settings namespace โ€” a plain consumer row, safe in any profile.

Known limitations

  • Native toast text is compact: only about 4 lines are displayed, so long content is truncated.
  • The native selection dropdown may collapse when the pointer moves onto the popup; if the toast is then dismissed by timeout, the taskbar flash still reminds you.
  • FlashWindowEx uses the system's warm-pulse highlight; custom colors are not possible.
  • Windows never flashes the foreground window โ€” the taskbar button only flashes when DSH is in the background.
  • Cancelling a running turn also goes idle, so a cancelled task still triggers the "done" toast.
  • Notifications are deduplicated per session within dedupMs (default 1500 ms).
  • Interactive question toasts require the .NET 10 Desktop Runtime on the machine.

Development

npm run check     # syntax check
npm test          # logic smoke test (mocked ctx)

# Show a real toast + taskbar flash:
powershell -NoProfile -File lib/notify.ps1 -Kind done -Title "test" -Body "test"

# Rebuild the interactive question helper:
dotnet publish src/DshToastQuestion/DshToastQuestion.csproj -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true -o lib

Project layout

dsh-notify-win/
โ”œโ”€โ”€ lib/
โ”‚   โ”œโ”€โ”€ index.js               # Host half: event listeners -> subprocess spawn
โ”‚   โ”œโ”€โ”€ client.js              # Browser-side click-to-focus / answer polling
โ”‚   โ”œโ”€โ”€ notify.ps1             # Done/compact toast + taskbar flash
โ”‚   โ”œโ”€โ”€ focus-dsh.ps1          # Focus/launch the DSH Edge PWA
โ”‚   โ”œโ”€โ”€ focus-dsh.vbs          # Hidden launcher for focus-dsh.ps1
โ”‚   โ”œโ”€โ”€ dsh-toast-question.exe # Interactive question toast helper (C#)
โ”‚   โ””โ”€โ”€ dsh-*.png / dsh-*.ico  # Branding assets
โ”œโ”€โ”€ src/DshToastQuestion/
โ”‚   โ”œโ”€โ”€ Program.cs             # C# helper source
โ”‚   โ””โ”€โ”€ DshToastQuestion.csproj
โ”œโ”€โ”€ test/
โ”‚   โ”œโ”€โ”€ smoke.mjs              # Plugin logic smoke test
โ”‚   โ””โ”€โ”€ headless-overlay.yml
โ”œโ”€โ”€ docs/
โ”‚   โ””โ”€โ”€ assets/screenshots/    # README screenshots
โ”œโ”€โ”€ cordis.patch.yml           # DSH bundle patch
โ”œโ”€โ”€ package.json               # dsh.bundle declaration
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ README.zh.md

Roadmap

  • V1 (implemented): done + compact + question toasts; single-select dropdown with custom answer; Cancel / Send; timeout โ†’ taskbar flash fallback.
  • V1.1 (experimental / not stable yet): multi-select question toast by numbered input.
  • V2 (planned): fully self-contained packaging (no .NET runtime install) and/or background activation so toast buttons submit without any foreground activation.

License

MIT

Plugin correlati