Invoice-Downloader
EthanYoQ
电子发票整理与报销准备工具:从邮箱批量收集 PDF/OFD/XML 发票,OCR 识别、分类归档并生成 Excel 汇总;提供 Windows/macOS 桌面版与 DSH 插件。
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:NotLinky671/dsh-notify
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 中文
Native desktop notifications for DeepSeek Harness: pushes the events worth your attention to the system notification center, so you don't have to keep staring at the window.
| Platform | Status | Notes |
|---|---|---|
| Windows | ✅ Supported | Windows 10 / 11, native toasts + click-to-focus |
| macOS | ✅ Supported | Notification Center banners via osascript, cue via afplay; no click-to-focus |
| Linux | ❌ Not planned | — |
On any other platform the plugin logs a single warning and exits quietly — no error, no crash, no impact on DSH itself. The event policy lives in
lib/core.jsand is platform-neutral; only the delivery layer (lib/transport-*.js) is OS-specific.
| Event | Source | Presentation | Default |
|---|---|---|---|
| Root turn completed | turn/end reason=completed |
Banner | On |
| Root turn failed | turn/end reason=error |
Alert | On |
| Root turn interrupted | turn/end reason=aborted / max-tokens / blocked |
Banner | On |
| Approval required | approval/asked |
Alert | On |
| Agent is asking you a question | tool/call name=ask_user_question |
Alert (with the question header) | On |
| Approval auto-rejected | approval/asked with policy never |
Banner (non-intrusive) | Follows the row above |
| Context above threshold | contextPressure projection |
Banner; escalates to alert at ≥95% | On (80%) |
| Daily token budget exceeded | tokenUsage projection delta |
Alert (once per day) | Off |
| Subagent turn ended | turn/end origin=subagent |
Banner | Off |
Alert means "you must look at this": on Windows a duration="long" toast, on macOS a repeated cue (macOS has no sticky banners). Both play a short chime by default.
The sound is played by the plugin itself —
SoundPlayeron Windows,afplayon macOS. On Windows it is deliberately not the toast's<audio>element, which silently fails for unpackaged desktop apps (the XML is accepted, nothing plays, no error is reported). Windows resolves the wav from your current sound scheme, so a customised scheme is honoured; macOS mapssoundEventonto the stock alerts in/System/Library/Sounds. Change the timbre withsoundEvent(e.g.Notification.Calendar,Notification.Looping.Alarm) ordarwinSound, and the repeat count withcriticalRepeat.
The app must be fully quit during installation — the desktop profile is owned exclusively by the app and cannot be modified while it runs.
Verified on DSH 0.2.2-rc.1: desktop profile on macOS 27 (arm64) and Windows 10 / 11.
⚠️ Install via the
github:form. An unrelated package nameddsh-notifyalready exists on npm (Pasumao/dsh-plugin-notify). Runningdsh plugin add dsh-notifyinstalls that one, not this project.
# 1. Fully quit DeepSeek Harness
# 2. Install
"/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh" \
plugin --profile desktop add "github:NotLinky671/dsh-notify"
# 3. Start the app again
open -a "DeepSeek Harness"
Pin a version, or skip git, with the release tarball:
"/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh" \
plugin --profile desktop add "https://github.com/NotLinky671/dsh-notify/releases/latest/download/dsh-notify.tgz"
# 1. Fully quit DeepSeek Harness (including the tray icon)
# 2. Install
& "$env:LOCALAPPDATA\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add "github:NotLinky671/dsh-notify"
# 3. Start the app again manually
Windows tarball fallback:
& "$env:LOCALAPPDATA\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add "https://github.com/NotLinky671/dsh-notify/releases/latest/download/dsh-notify.tgz"
For dsh web, replace --profile desktop with --profile web in every command above.
The host mounts plugins only at boot, so restart the app instead of reloading the window. The plugin always writes a startup trace:
cat ~/.dsh/storages/dsh-notify/diag.log
[apply] {"platform":"darwin"} followed by [subscribed] means it is live; debug: true adds one line per session event on top of the startup and dispatch lines.
Link the checkout instead — edits take effect on restart, no reinstall needed:
# macOS
"/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh" plugin --profile desktop add "link:$PWD"
# Windows
& "$env:LOCALAPPDATA\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add "link:$PWD"
Override by id in ~/.dsh/profiles/desktop/cordis.patch.yml (.../profiles/web/ for dsh web):
- patch:
- id: dsh-notify
config:
contextWarnPercent: 80 # 0 disables the context warning
contextCooldownMs: 300000 # min gap between two warnings in one session
dailyTokenBudget: 20000000 # 20M tokens/day; 0 disables
quietHours: [23, 8] # no toasts 23:00-08:00 (may wrap midnight)
notifySubagentEnd: true # opt into subagent notifications
sound: false
clickFocus: false # Windows only
darwinSound: Pop # macOS only: "Pop", "Pop.aiff", or an absolute path
Restart the app after editing.
macOS banners raised through osascript carry no click action, so click-to-focus exists on Windows only. On macOS the option is ignored (one warning at load), and clicking a banner just opens Notification Center.
On Windows, the first load writes two HKCU (current user, no administrator) registry keys:
HKCU\SOFTWARE\Classes\AppUserModelID\DeepSeek.Harness.Notify — lets Windows accept our toasts, displayed as "DeepSeek Harness"HKCU\Software\Classes\dsh-notify — the dsh-notify: URL protocol. Clicking a toast runs
wscript.exe //nologo scripts\focus.vbs, which starts focus.ps1 with a hidden window.Two traps were hit here, both worth knowing:
powershell.exe directly. It is a console program, so the protocol handler always
gets a console window allocated. -WindowStyle Hidden can only hide a window after it exists, so the
flash is unavoidable; and when the default terminal is Windows Terminal, -WindowStyle is ignored
outright and you get a new tab. Going through wscript.exe (a GUI-subsystem host) means no console at all.SetForegroundWindow is silently ignored by Windows' foreground lock. A background process
has no foreground rights, so the call returns and nothing happens. focus.ps1 therefore uses
AttachThreadInput to borrow the foreground thread's input queue, then BringWindowToTop +
SetForegroundWindow, with SwitchToThisWindow as a last resort.Set clickFocus: false to skip the registry entirely — toasts still appear, they just do nothing when clicked.
osascript drop the banner while
still exiting 0. If nothing appears, check that list first.Notification.Default → Glass, Notification.IM → Ping,
Notification.Mail → Pop, Notification.Reminder → Morse, Notification.Looping.Alarm → Sosumi;
anything unknown falls back to Glass. darwinSound overrides the mapping; a bare name is looked up in
/System/Library/Sounds, an absolute path is used verbatim.powershell.exe (PowerShell 5.1);
macOS uses the stock osascript and afplay binaries. No node-notifier, no native modules to compile.Windows.UI.Notifications WinRT projection,
so the scripts fail outright.osascript as argv items (item 1 of argv), never
spliced into AppleScript source, and no shell is involved. Quotes, backslashes, newlines and CJK text
therefore need no escaping at all.stdio: 'ignore' and an
error listener; each PowerShell script wraps itself in try/catch/finally. A broken notification can
never affect the host.
Do not add detached: true on Windows — libuv turns it into DETACHED_PROCESS, where the powershell
process is created but does nothing at all, without reporting an error. That bug once made the plugin fail silently.~/.dsh/storages/dsh-notify/state.json holds the daily total and a per-session baseline. The first time the plugin sees a session it records only the baseline, so history is not charged to today.powershell.exe on
Windows, osascript / afplay on macOS) to show a banner and play a cue.session/title and approval/policy metadata from session events, plus the two numeric projections tokenUsage / contextPressure.dsh-notify: protocol key. clickFocus: false skips them completely. macOS writes no system state at all.dependencies is empty, so there is no supply-chain surface.git clone https://github.com/NotLinky671/dsh-notify.git
cd dsh-notify
node --test test/run.mjs
37 offline test cases, all driven through injected fakes (no notification is shown, the real ~/.dsh is never touched). Both transports are constructed with an injectable spawn, so argv and repetition logic are asserted without running a single child process.
To exercise the macOS transport alone:
osascript -e 'on run argv' \
-e 'display notification (item 2 of argv) with title (item 1 of argv)' \
-e 'end run' "dsh-notify" "hello"
afplay /System/Library/Sounds/Glass.aiff
To exercise the Windows toast transport alone:
@{ aumid='DeepSeek.Harness.Notify'; title='test'; body='hello'; sound=$true; critical=$false; launch='' } |
ConvertTo-Json | Set-Content "$env:TEMP\t.json" -Encoding utf8
powershell.exe -NoProfile -File .\scripts\toast.ps1 -Payload "$env:TEMP\t.json"
osascript cannot run a command when clicked.osascript exits 0 even when the banner is suppressed.contextPressure projection from @deepseek-ai/dsh-token-meter. When the host does not register that projection the check is skipped silently rather than guessed.projectedTokens is an estimate for the next request, so it can differ slightly from the number shown in the UI. That is the projection's own definition.MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: notifications。