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-gap-feed

v0.1.9

Published

dsh plugin: during long agent thinking, posts a hot-news or reminder message directly into the conversation stream.

Downloads

889

Readme

dsh-gap-feed

English | 中文

npm GitHub stars

DeepSeek Harness (dsh) 插件:agent 思考超过阈值时,直接在对话流中打出一条热点新闻或提醒卡片。频率极低、绝不打扰正常对话。

demo

功能特性

  • 对话流注入:agent 思考超时时,插件以 assistant/message 消息直接追加进会话日志(session.append + surfaceOp:'append'),UI 自动渲染成对话流卡片(带可点击链接);内容源挂了静默降级,不阻塞对话。
  • 多内容源:今日头条热榜(公开接口,免登录)+ GitHub 本周热门仓库(按星数排序)+ B站全站热榜;多源并发抓取,单源失败不影响其他。
  • 对话建提醒:对话里直接说"提醒我 18:00 开会",模型调用 gap_feed_reminder_add 工具写入提醒,到点后在间隙内容里优先于新闻展示。
  • 设置页管理:dsh 设置页按 schema 自动渲染 gap-feed 表单,可改配置、管理提醒(增删改查 / 启停 / 完成),改动即时生效。
  • 限频参数:思考时长阈值 + 冷却间隔 + 每小时上限可配,保证低频、不刷屏。
  • 内容优先级:到点提醒 > 未到点提醒 > 新闻;同一内容不重复插入。
  • 持久化安全:追加的消息从会话现有消息继承合法 model source(kind/provider/model),重启后会话可正常加载(伪造 source 会被 SessionPersistence 校验拒绝)。

安装

dsh plugin --profile web add dsh-gap-feed

重启 dsh web(或刷新页面即可)。

已发布到 npm(dsh-gap-feed)——市场优先展示预构建 npm 包(免 allowBuilds 构建授权)。

使用

触发条件

一次注入需同时满足:

  1. enabled 为 true(总开关);
  2. agent 持续思考超过 minThinkSeconds(默认 20 秒)——通过轮询 agents 注册表检测,对事件时序鲁棒;
  3. 距上次注入超过 cooldownMinutes(默认 15 分钟);
  4. 最近 1 小时注入次数未超 maxPerHour(默认 4)。

不满足则静默,什么都不做。

对话建提醒

对话里说一句带时间 + 事项的话即可,例如:

  • "提醒我 18:00 开会"
  • "半小时后提醒我回邮件"

模型解析为 text(事项)+ dueAt(unix 毫秒,缺省 = 当前 + 1 小时)写入提醒。解析失败返回友好错误,不阻塞对话。到点后该提醒在下次注入时优先于新闻展示。

设置页

dsh 设置页自动渲染 gap-feed 命名空间表单,可改配置、管理提醒,改动即时生效、重启后保留。

配置项

| 配置项 | 类型 | 默认 | 说明 | |--------|------|------|------| | enabled | boolean | true | 总开关 | | minThinkSeconds | number | 20 | 思考超过该秒数才考虑注入 | | cooldownMinutes | number | 15 | 两次注入最小间隔(分钟),限频核心 | | maxPerHour | number | 4 | 每小时注入上限(兜底) | | blacklist | string[] | [] | 标题黑名单词,命中任一即过滤 |

默认值定义在 src/types.ts 的 DEFAULT_CONFIG。

提醒数据存储

$DSH_HOME/profiles/<profile>/data/gap-feed/reminders.json
  • DSH_HOME 缺省为 ~/.dsh;
  • JSON 数组,字段 id / text / dueAt / done / enabled / createdAt;目录不存在自动建,读写失败或 JSON 损坏时静默降级为内存态,绝不抛错。

开发

npm install        # 装 devDeps
npm test           # vitest:67 条单测 + 契约测试
npm run typecheck  # tsc --noEmit
npm run build      # tsc -> dist/(prepack 自动执行)

分层纪律:纯函数层(decision.ts / picker.ts)零 dsh 依赖、全分支覆盖;副作用层(news.ts 网络 / reminders.ts 文件 I/O)经 Source 接口可 mock;接线层(index.ts)只做运行时接线。

已知限制

  • B站源在数据中心 IP 可能被风控(-352),自动静默降级,不影响其他源;
  • 提醒卡片与新闻卡片走同一对话流通道;提醒管理 UI 在设置页;
  • 会话内去重为插件生命周期级(不跨重启)。

License

MIT