Invoice-Downloader
EthanYoQ
电子发票整理与报销准备工具:从邮箱批量收集 PDF/OFD/XML 发票,OCR 识别、分类归档并生成 Excel 汇总;提供 Windows/macOS 桌面版与 DSH 插件。
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:879745uhjun/dsh-session-notify
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A card in the bottom-right corner of your screen the moment a conversation you are keeping an eye on finishes a turn. Watch several sessions, work elsewhere, and let the desktop tell you when one is done.
In the sidebar, right-click the session you want to follow.
The menu carries one row, 会话提醒设置 › (Session notifications). Point at it to open its submenu, which holds both actions:
While the watch is on, the parent row reads 会话提醒设置 · 开 and the child reads 已开启结束时提醒, so the state is visible at a glance.
Leave the session alone. When a turn closes — the assistant's output for that turn is complete and committed — a card appears in the bottom-right corner of the primary screen:
会话标题 此对话已结束 已完成 · 19:54 · 点击打开对话
Click the card and it closes while DSH jumps to that conversation — the same session switch the sidebar does.
Turn it off through the same submenu, or by clicking the bell on the row while it is visible.
Watching more than one session is fine: each finished turn gets its own card, and cards stack upwards instead of covering each other.
The Host listens for the durable turn/end event of a watched session's log and
nothing else, so the card never appears mid-stream: it waits until that turn's
output is complete and committed. This fires for every turn while the watch is
on, including a turn that ends with an error or a stop — the accent turns amber
for a stop and red for an error, while the message stays 此对话已结束.
body[data-ds-dark-theme] to the Host, which passes -Theme dark|light
explicitly. auto (read the Windows app theme) stays only as the fallback for
a Host that no page ever reported to, so a dark DSH on a light Windows still
matches.A plugin can watch a session on the user's behalf through the same write path the
sidebar menu uses — one session-notify.json, one SSE stream, event name
watched — so there is never a second source of truth.
# watch
curl -s -X POST "http://127.0.0.1:$PORT/session-notify/watch" \
-H 'content-type: application/json' \
-d '{"sessionId":"session-xxxx","on":true}'
# → {"ok":true,"sessionId":"session-xxxx","watching":true}
# unwatch
curl -s -X POST "http://127.0.0.1:$PORT/session-notify/watch" \
-H 'content-type: application/json' \
-d '{"sessionId":"session-xxxx","on":false}'
# → {"ok":true,"sessionId":"session-xxxx","watching":false}
# read the list back
curl -s "http://127.0.0.1:$PORT/session-notify"
# → {"ok":true,"watched":{"session-xxxx":{"title":"…","locale":"zh",…}}}
| Case | Behaviour |
|---|---|
on is not a boolean, sessionId missing, bad JSON |
400 {"ok":false,"error":…}, nothing written |
| Cross-origin caller | 403, nothing written |
Not POST |
405 |
| No live session for that id on this Host | 200 {"ok":true,"watching":false,"reason":"unknown-session"}, nothing written |
Repeated on:true / on:false |
unchanged result, no second write, no second event |
Caller notes:
sessionId must belong to a session that is live on this Host (checked with
ctx.sessions.get()); a closed session or one never opened answers unknown-session.$PORT is DSH's web address and can change on every desktop launch.The row in cordis.patch.yml carries the tunables:
| key | default | meaning |
|---|---|---|
enabled |
true |
Keep the watch list but draw no cards. |
durationMs |
8000 |
How long one card stays (1200–60000). |
sticky |
false |
Keep the card until it is clicked. |
powershell |
— | Absolute path to powershell.exe when it is not in the system directory. |
Adding -LogPath <file> to a manual popup.ps1 run writes one line per
lifecycle step, which is the fastest way to answer "why did no card appear".
powershell.exe (~0.5–1 s to the card being
visible). Corporate script policies are bypassed for this single file with
-ExecutionPolicy Bypass; endpoint protection that blocks PowerShell will
block the card, and the DSH log then carries a [session-notify] warning.session-notify.json under the DSH home, so it
survives restarts and reloads. Nothing is sent anywhere.| file | role |
|---|---|
index.js |
Host: watch file, /session-notify routes, SSE, turn trigger, launcher. |
client.js |
Browser: the menu entries and the row bell. |
popup.ps1 |
The card itself: geometry, theme, stacking, dismissal. |
demo/preview.ps1 |
Show the card once with sample text. |
test/host.test.mjs |
Host routes, durability, and the trigger, with a spawn seam. |
test/client.logic.test.mjs |
Client slots driven against the real Host over a fake fetch. |
test/shot.ps1 |
Screenshot harness for the card. |
node --test test/host.test.mjs
node --test test/client.logic.test.mjs
powershell -NoProfile -ExecutionPolicy Bypass -File demo\preview.ps1
dsh plugin --profile desktop add github:879745uhjun/dsh-session-notify
Reload the Web UI page after installing.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: notification。