dsh-plugin-noticeme
消息通讯 活跃维护

dsh-plugin-noticeme

lw-storm/dsh-plugin-noticeme

当后台页面出现审批请求或用户询问卡片时自动触发桌面通知,若桌面通知权限受限则自动切换为网页标签页标题提醒,避免用户错过需要人工介入的交互节点。

1
Stars 标星
0
Forks 分支
1
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
130 KB
仓库大小
20 天前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:lw-storm/dsh-plugin-noticeme
git clone https://github.com/lw-storm/dsh-plugin-noticeme.git
git clone git@github.com:lw-storm/dsh-plugin-noticeme.git
README.md main

dsh-plugin-noticeme

Notify me when DSH needs me: desktop notification (with tab-title fallback) when an
approval prompt or an ask-user-question card appears while the page is in the background.After testing, this plugin can implement notification functionality in a lightweight manner.

image

Install

dsh plugin --profile web add link:/absolute/path/to/this/pkg
# published form:
dsh plugin add github:lw-storm/dsh-plugin-noticeme

Restart DSH after installing. On first page load the browser asks for notification
permission — allow it.

Behavior

  • Watches approval/request (approval prompts) and tools/result for
    ask_user_question (question cards) on the host.
  • Host keeps a short-lived queue, exposed at GET /dsh-noticeme/pending
    (same-origin only). Reading drains the queue: each item is notified once.
  • Client polls every 3 s. While the page is visible nothing is shown; while
    hidden, a desktop Notification is raised (click → focus the page). If the
    Notification permission is unavailable, the tab title is prefixed with
    ⚠ 需要你确认 · and restored when the page becomes visible again.

Files

  • lib/index.js — host entry (ESM, Node)
  • client/client.js — browser entry (hand-written ModuleLoader bundle, no build step)
  • cordis.patch.yml — profile layer insertion

License

MIT