Invoice-Downloader
EthanYoQ
电子发票整理与报销准备工具:从邮箱批量收集 PDF/OFD/XML 发票,OCR 识别、分类归档并生成 Excel 汇总;提供 Windows/macOS 桌面版与 DSH 插件。
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:This-is-XiaoDeng/dsh-plugin-notify
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
中文 | English
Session-state notifications for the DeepSeek Harness (DSH): a WxPusher push plus a real browser notification — with sound and requireInteraction — whenever a session stops, exits with an error, or asks you a question. Everything is configured from a native settings page (设置 → 通知 / Settings → Notifications).
new Notification(...) with a PNG icon, an optional WebAudio chime, and requireInteraction so the banner stays until you dismiss it.settings.section page built from the plugin's own Config schema; every field is volatile, so edits apply live — no restart, no plugin remount.appToken is declared role('secret'): it is stored in the profile, never returned over the wire, and edited through a path-addressed write.| Event | Source | Detail shown |
|---|---|---|
| Session stopped | api-session/status → running: false |
the folded session title + the last model reply (optional) |
| Exited with an error | api-session/error, agent/error |
the error message |
| Question asked | user-questions/request (observed, then delegated) |
the first question |
| Approval needed | approval/request (observed, then delegated) |
the tool name |
The WxPusher body for the stopped detail (the last model reply) and the question text is never truncated and keeps its line breaks, so the phone shows the whole content; browser notifications still trim to maxDetailChars (an OS notification cannot fit long text anyway).
Two filters keep the noise down:
minRunMs — a run shorter than this never reports a stop.stopDebounceMs — after the agent goes idle the Host waits this long; if the session starts running again the report is dropped. A stop is also suppressed when an error notification for the same session just fired, because that one is more precise.user-questions/request and approval/request are Cordis waterfalls: this plugin only observes them and always delegates with next(), so it can never swallow a request meant for another answerer.
@deepseek-ai/dsh-web-app), i.e. any normal dsh web profile. ctx.webServer is used for the notification stream; without it the plugin still pushes to WxPusher but delivers nothing to the browser.A different project already owns
dsh-plugin-notifyon npm.pnpm add dsh-plugin-notifyinstalls that one, not this plugin — use the repository spec below.
Add a package to the Plugins page — this repository spec, or an absolute path to a checkout — and enable the bundle it adds:
github:This-is-XiaoDeng/dsh-plugin-notify
or, from a clone:
/path/to/dsh-plugin-notify
The CLI equivalent (writes the package into the profile's dependencies and dsh.profile.bundles):
dsh plugin --profile web add github:This-is-XiaoDeng/dsh-plugin-notify
The plugin's row is declared by the bundle's own cordis.patch.yml, so nothing else needs editing. If the profile was already running, reload it (or restart) so the new package enters the module-resolution table.
# in the profile directory, e.g. ~/.dsh/profiles/web
pnpm add github:This-is-XiaoDeng/dsh-plugin-notify
Then add the bundle to dsh.profile.bundles in that profile's package.json:
{
"dsh": {
"profile": {
"bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "dsh-plugin-notify"]
}
}
}
Open Settings → Notifications (设置 → 通知). The page writes straight into the plugin's profile entry.
| Field | Default | Meaning |
|---|---|---|
enabled |
true |
Master switch for both channels. |
events.stopped |
true |
Report a session that stopped working. |
events.error |
true |
Report a session or step that errored. |
events.question |
true |
Report a question from the agent. |
events.approval |
false |
Report a pending approval decision. |
browser.enabled |
true |
Raise browser notifications at all. |
browser.sound |
true |
Play a short two-tone chime (WebAudio, no asset). |
browser.requireInteraction |
true |
Keep the banner until dismissed. |
browser.onlyWhenHidden |
true |
Stay quiet while the tab is visible. |
wxpusher.enabled |
false |
Enable the WxPusher channel. |
wxpusher.appToken |
'' |
WxPusher appToken (write-only secret). |
wxpusher.uids |
[] |
Receiving UIDs, one per line (UID_xxxxxxxx). |
wxpusher.topicIds |
[] |
Receiving topic ids, one per line. |
wxpusher.url |
'' |
Optional URL a tapped push opens. |
advanced.stopDebounceMs |
1200 |
Idle grace period before reporting a stop. |
advanced.minRunMs |
2000 |
Runs shorter than this never notify. |
advanced.rootSessionsOnly |
true |
Skip subagent sessions. |
advanced.includeSessionTitle |
true |
Include the folded session title. |
advanced.includeLastModelMessage |
true |
Attach the last model reply to the stopped notification. |
advanced.maxDetailChars |
300 |
Truncate error/question detail in browser notifications (WxPusher stopped details and questions are not truncated). |
The same values live in the profile patch, so they survive upgrades:
- id: dsh-plugin-notify
config:
events:
approval: true
wxpusher:
enabled: true
uids:
- UID_xxxxxxxx
The appToken input is always empty on load — the Host only ever reports whether a token is set.
The page shows the current Notification.permission. If it is default, press Request permission; if it is denied, re-allow notifications for the page in your browser's site settings. Sound needs one user gesture on the page before the browser lets an AudioContext start — the plugin hooks the first click/keypress to unlock it.
Each channel card owns its own test button, so a test never leaves you guessing which card it belongs to:
| Card | Button | What it does |
|---|---|---|
| Browser notifications | Send a test notification | Broadcasts a frame to every connected page and pushes one WxPusher message — a full-stack probe. |
| WxPusher push | Send a test push | Pushes one WxPusher message only. It raises no system notification, and it works while wxpusher.enabled is still off, so credentials can be verified before switching the channel on. |
Each button reports its own outcome underneath:
Browser: delivered to 1 page(s) · WxPusher: sent
WxPusher: no appToken
WxPusher: refused (appToken不正确)
Browser: no connected page (browser notifications may be off) · WxPusher: no UID or topic id
The buttons call the same endpoint with a channel selector — see below.
Host Browser
──── ───────
api-session/status ─┐
api-session/error ─┤
agent/error ─┼─► detect ─► frame ─┬─► WxPusher HTTPS push
user-questions/… ─┤ │
approval/request ─┘ └─► GET /dsh-plugin-notify/events (SSE)
│
▼
new Notification(title, {
body, icon, tag,
requireInteraction, silent,
}) + WebAudio chime
ctx.webServer: the SSE stream at /dsh-plugin-notify/events and the test endpoint at /dsh-plugin-notify/test.EventSource on the document-relative path dsh-plugin-notify/events, so it resolves under whatever mount served the page and inherits the page's own authentication. EventSource reconnects by itself; the Host sends a : ping heartbeat every 25 s.ctx.configForms.describe() — by entry id first, then by the schema it knows it owns — so it keeps working when a profile nests the bundle patch and prefixes the entry id.ConfigForm.mutate() with path-addressed operations, so a secret that the wire never returned is never restated.| Method | Path | Purpose |
|---|---|---|
GET |
/dsh-plugin-notify/events |
Server-Sent Events stream of notification frames. |
POST |
/dsh-plugin-notify/test |
Probe the notification path. ?channel=browser broadcasts without pushing, ?channel=wxpusher pushes without broadcasting, and omitting it does both. Answers with { ok, channel, browser, wxpusher }, where the channel that was not asked for reports skipped. |
stopDebounceMs and minRunMs are the knobs.MIT — see LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: notifications。