dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DSH 本地通知栏:侧边栏【通知】入口 + 未读徽标、全屏通知中心(级别视觉分级 info/success/warn/error、时间/来源筛选、排序、标题内容搜索、未读已读、删除、详情弹层一键复制、分页),notify_add agent 工具与 CLI 写入本地 JSON 文件(支持自动清理),页面实时刷新,界面跟随 dsh web 语言切换。
🌐 中文: README.md · 🤖 Agent Guide: README.agent.md
A local notification center plugin for DSH (DeepSeek Harness): adds a Notifications entry to the Web UI sidebar, opening a full-screen notification center. Notifications are shown as cards (title + one-line body preview) with level color coding, time/source filtering, sorting, title/body search, read/unread marking, and deletion. Clicking a card opens a detail popup with the full information and one-click copy of the title/body. Notifications are written by the agent tool (notify_add) or the CLI (dsh-localnotify) into a local JSON file, and the page refreshes in real time — fully local, no external services.
Typical use: the agent writes a notification to remind you when a task finishes; scripts and cron jobs can deliver notifications through the CLI.
shell.overlay, independent of any session):
info (brand) / success (green) / warn (yellow) / error (red); level tags shown on cards and in the detail popupN total · page x/y); only the current page is rendered--dsw-alias-*), following light/dark themes automaticallynotify_add during a conversation (supports level)dsh-localnotify add "title" -b "body" [--level success], for scripts / cronNotifications live in ~/.dsh/notify/notifications.json (DSH_HOME takes precedence), shaped as:
{
"version": 2,
"notifications": [
{
"id": "n_mtisij3d_q32zcn",
"title": "Task done",
"body": "23 pages converted to Markdown.",
"createdAt": 1788274582825,
"read": false,
"source": "agent",
"level": "success"
}
],
"settings": { "retainDays": 0 }
}
level: info | success | warn | error (missing on old data renders as info)settings.retainDays: auto-cleanup retention in days; 0 = keep forever (default); >0 removes notifications older than N days on each write (set via CLI config --retain-days). version-1 files are upgraded to version 2 on the first write~/.dshdsh plugin --profile web add github:yakoylp/dsh-localnotify
Clone the repository (or unpack the source archive) anywhere, then install from that directory:
git clone https://github.com/yakoylp/dsh-localnotify.git
dsh plugin --profile web add ./dsh-localnotify # macOS / Linux
dsh plugin --profile web add "C:\path\to\dsh-localnotify" # Windows (use your real path)
Restart dsh web after installing (the client bundle is loaded at web startup). The 🔔 Notifications entry appears at the sidebar foot; verify with dsh-localnotify add "test".
dsh-localnotify add "Task done" -b "converted" # add a notification
dsh-localnotify add "Reminder" --source cron --level warn # custom source & level
dsh-localnotify add "Deploy OK" --level success # level: info/success/warn/error
dsh-localnotify list # list (* = unread; [E]/[W]/[OK] level marks)
dsh-localnotify list --unread # unread only
dsh-localnotify list --level error # error-level only
dsh-localnotify list --json # JSON output (script-friendly)
dsh-localnotify read n_xxxx # mark one as read
dsh-localnotify read --all # mark all as read
dsh-localnotify delete n_xxxx # delete one
dsh-localnotify config [--retain-days 7] # show/set auto-cleanup days (0=keep forever)
dsh-localnotify prune # clean up expired notifications now
dsh-localnotify --help # help
dsh-localnotify --file /path/to/notifications.json add ... # override storage path
The CLI reads/writes the same JSON file directly and does not require cordis — usable in any terminal, script, or cron job.
The plugin registers notify_add; the agent calls it in-conversation to write notifications (validated: title required ≤200 chars, body ≤5000 chars). Example when a task completes:
notify_add(title: "Conversion done", body: "23 scanned pages converted to Markdown ...", level: "success")
level is an optional enum info | success | warn | error for visual coding: success for completed tasks, error for failures, warn for things needing attention, omit for ordinary messages (default info).
| Path | Who uses it | Prerequisite |
|---|---|---|
notify_add tool | DSH agents (same profile) | Registered automatically on install; agents see the tool in their tool list and call it per its description (task done, important progress, needs attention) — no extra config |
dsh-localnotify CLI | scripts / cron / terminal | Installed (bin linked into the profile's node_modules/.bin); or node <plugin-path>/lib/cli.js directly |
| Direct JSON file write | any program | Write ~/.dsh/notify/notifications.json per the format above; visible within ~3s |
Note: the
notify_addtool is visible to agents in the same DSH profile where the plugin is installed; other environments/agents need their own install for the tool path, while the CLI and file write are environment-independent.
The host registers same-origin POST /dsh-localnotify/api/<method> (reachable only by the DSH web server); JSON in/out with an { ok, value } or { ok: false, error: { code, message } } envelope:
| Method | Args | Description |
|---|---|---|
list | {} | Returns { notifications, storagePath } |
markRead | { id } | Mark one as read |
markAllRead | {} | Mark all as read |
delete | { id } | Delete one |
cordis.patch.yml, lib/index.js): registers the notify_add tool (ctx.tools.register) and the /dsh-localnotify/api/* route (ctx.webServer.register, prefix match); storage logic lives in lib/store.js (shared by host and CLI)dsh.client + exports["./client"] → lib/client.js): a hand-written ModuleLoader bundle (window.__ModuleLoader__.load({ id, factory }), same format as official tsdown output, depending only on the baseline external react); registers sidebar.footer.action (entry) and shell.overlay (center) via ctx.slots.inject/register, fetching data from the host API--dsw-alias-bg-* / --dsw-alias-label-* / --dsw-alias-border-* / --dsw-alias-brand-primary, etc.)node --test # run all tests (store layer + API handler + CLI end-to-end)
node lib/cli.js --file ./tmp-notify.json add "test" -b "body" --level success
node lib/cli.js --file ./tmp-notify.json list
node lib/cli.js --file ./tmp-notify.json config --retain-days 7
curl -X POST http://127.0.0.1:<port>/dsh-localnotify/api/list -H "Content-Type: application/json" -d "{}". If it returns 405 (empty body), the host route is not registered; upgrade to ≥1.1.0 (1.0.0 silently skipped route registration because webServer was missing from inject). If it returns { ok:true, value: { notifications, ... } }, the route works — check the storage file for dataflex: none, the list scrolls properly).github/workflows/test.yml)MIT