npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-notify-bark

v0.1.4

Published

Bark 推送通知插件:DSH Host 端监听回合结束 / 等待回答 / 等待授权等事件,通过 Bark Server 推送到 iPhone。设置页经专用 RPC 读写 Host 配置(Bark 地址脱敏,不落地到浏览器)。

Readme

dsh-notify-bark

awesome · DSH plugin

License: MIT · Requires: Node ^22.19 · Platform: DSH Host + Web 设置页

English · 简体中文

DeepSeek Harness(DSH)的 Bark 推送通知插件:DSH Host 端监听回合结束、等待回答、等待授权等事件,通过 Bark Server 把通知推送到 iPhone。通知完全在 Host 发送——浏览器关掉、页面刷新、电脑休眠都不影响推送。

  • Host 半端(src/index.ts + lib/*.js):session/event 监听 + Bark HTTP 发送 + bark 设置命名空间(ctx.settings → settings.yaml,热更新)+ 挂在 ctx.webServer 上的 /dsh-notify-bark RPC 通道。
  • 浏览器半端(src/client/ + lib/client.js):注册 settings.section 插槽,表单经 RPC 读写 Host 配置;Bark 地址永不下发到浏览器,只显示脱敏状态(已配置:••••••••3F82)。

通知事件(9 个开关)

| 事件 | 触发条件 | 默认 | Bark level | | --- | --- | :-: | --- | | ✅ 任务完成 | turn/end reason completed | 开 | active | | ❌ 执行失败 | turn/end reason error | 开 | timeSensitive | | 🚫 执行被阻塞 | turn/end reason blocked | 开 | timeSensitive | | ⏹ 已中止 | turn/end reason aborted | 关 | passive | | ⚠️ Token 达到上限 | turn/end reason max-tokens | 开 | timeSensitive | | ⏸ 异常中断 | turn/end reason interrupted | 开 | timeSensitive | | ❓ 等待你的回答 | tool/call ask_user_question | 开 | timeSensitive | | 🔐 等待你的授权 | approval/asked | 开 | timeSensitive | | 📋 计划待确认 | tool/call exit_plan_mode | 关 | timeSensitive |

标题固定为工作区名(session.header.cwd 最后一级),状态放在 body 第一行;可选附带 AI 最后一段回复、body 长度上限、Bark Group。

安装

从 GitHub 直接安装(仓库内置编译产物,克隆即可用,无需先构建):

dsh plugin --profile web add https://github.com/pc439527/dsh-notify-bark.git

或本地路径:

dsh plugin --profile web add /path/to/dsh-notify-bark

dsh plugin add 会执行 pnpm add(写入依赖 + dsh.profile.bundles),插件包自带的 cordis.patch.yml 插入 bark-notify 行。当前已在运行的 dsh web 通过 Cordis HMR 监听 profile 的 cordis.patch.yml——在用户层追加同一插入行即可热加载,无需重启服务:

# $DSH_HOME/profiles/web/cordis.patch.yml
- insert:
    - id: bark-notify
      name: 'dsh-notify-bark'

浏览器刷新设置页(齿轮 → Bark 通知)即可看到配置表单。

安全与隐私

  • 无内置密钥:barkUrl 默认值为空,由每个部署者自行在设置页填写自己的 Bark 地址(https://api.day.app/你的key);本仓库不含任何真实凭据(测试仅用假 key testkey)。
  • 凭据不进浏览器:barkUrl 在 schema 中声明为 role('secret'),RPC 只回传脱敏状态(已配置:••••••••3F82),日志只输出 configured: true/false。
  • 配置只存 Host:写入 Host 端 settings.yaml,不会上传到任何第三方;通知仅发送到你配置的 Bark 地址。

开发

pnpm install        # typescript / @types/node(锁文件 pnpm-lock.yaml)
pnpm run build      # tsc 编译 Host 半端到 lib/(同时重新生成 lib/rpc.js 与它的 sourcemap);client bundle 直接维护在 lib/client.js
pnpm test           # node:test 单元测试(发送层 / 事件映射 / 默认值 / 去重 / 脱敏 / RPC 路由)

结构

dsh-notify-bark/
├── package.json          # dsh.client 声明 + bundle patch 声明 + 仓库元信息
├── pnpm-lock.yaml        # pnpm 锁文件
├── cordis.patch.yml      # 插件行插入
├── LICENSE               # MIT
├── src/
│   ├── index.ts          # Host 入口:settings 注册 + 事件监听 + RPC
│   ├── bark-service.ts   # Bark HTTP 发送(超时 / 错误分类)
│   ├── event-listener.ts # session/event → 通知意图(去重 / 标题 / 内容)
│   ├── settings-store.ts # 设置模型 / schema / 默认值 / 脱敏
│   ├── rpc-contract.ts   # /dsh-notify-bark 通道契约
│   ├── rpc.ts            # Host RPC(get 脱敏 / set / test)
│   └── client/           # 浏览器半端源码(lib/client.js 为其 bundle 镜像)
├── lib/                  # 部署产物(tsc 编译的 Host + 手写 module-loader bundle)
└── tests/                # node:test 单元测试

设计要点

  • 通知走 Host:ctx.on('session/event') 直接监听(与 dsh-im-bridge 同路径),浏览器只是配置面板。
  • 配置存 Host:bark 命名空间注册进 ctx.settings,持久化到 settings.yaml;DSH 的 Web 设置 wire 有命名空间白名单(WEB_SETTINGS_NAMESPACES),第三方命名空间走 settings-not-exposed,所以设置页用专用 RPC(同 dsh-codex-auth 架构)读写。
  • 通道直接挂在 ctx.webServer 上,而不是 connection.rpc.handle():Connection 用 owner.effect(() => owner.webServer.register(route)) 挂载通道,而 cordis 会通过连接插件自己的 fiber 解析这个(被 shadow 的)owner 上的 webServer,第三方插件永远无法注入它。在 DSH 0.1.5-rc.1 上注册会抛 cannot get property "webServer" without inject,路由根本没有挂上,设置页每次调用都变成 transport failure for /dsh-notify-bark/get: HTTP 405(未匹配的 POST 落到前端静态兜底)。改为把路由挂到 webServer(dshmarket、dsh-continue 用的同一扩展点)后,仍然保持浏览器端 transport 要求的 client-request / server-response 线协议,并继续通过 connection.requestRejection 复用 Connection 的 Host/Origin 校验与浏览器鉴权。tests/rpc-route.test.js 专门守住这一点。
  • 凭据不进浏览器:barkUrl 声明为 role('secret') 且 RPC 只回传脱敏状态(已配置:••••••••3F82);日志只输出 configured: true/false。
  • 事件去重:sessionId + event.seq 键 + 有界台账,重连/重放不会重复推送。

参考与致谢

  • 架构模式参考(仅借鉴设计,未复制代码):
    • dsh-im-bridge——session/event 监听路径(DeepSeek 内部插件,未公开);
    • dsh-codex-auth——设置页经专用 RPC 读写 Host 配置的模式(DeepSeek 内部插件,未公开)。
  • 插件运行平台:DeepSeek Harness(MIT)。
  • 推送服务:Bark(开源 iOS 推送服务)——本插件只向用户自行配置的 Bark 地址发送 HTTP 请求,不包含或分发 Bark 代码。

许可证

MIT。按现状提供,无任何明示或暗示的担保;因使用本插件造成的任何损失由使用者自行承担。贡献者提交代码即视为同意以 MIT 许可授权。