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-peak-block

v0.1.1

Published

梁文峰时间拦截官方 DeepSeek API 请求:北京时间工作日高峰时段 09:00-12:00、14:00-18:00 自动拦截发往官方 provider `deepseek-official` 的模型请求,可切换到第三方中转或预留的本机转 API 端口,未配置则阻止并提示;非高峰不拦、正常走官方,专治高峰掉速与刷屏。标准可安装 dsh 插件,host 单半身,设置经 cordis 配置文件注入。

Readme

dsh·禁止梁文峰

在 DeepSeek 官方高峰时段拦截官方 provider 请求,保障安心使用梁文谷。

高峰时段默认北京时间工作日 09:00–12:00、14:00–18:00,周末全天谷价。拦截到官方请求时:已配置 targetProvider 则切到该目标,未配置则阻止并提示;非高峰不拦截,正常走官方。官方判定默认只精确匹配 deepseek-official,不做名称前缀规则,因此 pi-ai 自带的三方 deepseek 中转不会误拦。

效果

未配置 targetProvider 时于高峰时段发起官方请求,请求被阻止,界面呈现「未配置拦截目标」的报错:

拦截效果

安装

dsh plugin --profile web add github:better-er/dsh-peak-block

一条命令装完即生效,自动挂载,重启 DSH web 后启用,无需手工编辑任何文件。

卸载

dsh plugin --profile web remove dsh-peak-block

彻底移除,重启 DSH web 后不再加载。

配置

插件通过 cordis 配置注入,默认 enabled: true,其余键可覆盖:

| 键 | 默认 | 说明 | |---|---|---| | enabled | true | 总开关 | | officialProviders | 未设,只认 deepseek-official | 视为「官方」的 provider 精确名单,不设用默认判定 | | targetProvider | 空 | 拦截后切到的目标 provider;留空 = 阻止并提示 | | peakWindow | 工作日 9–12、14–18,周末谷 | 峰谷时段窗口,可整体或局部覆盖 |

配置示例:

plugins:
  dsh-peak-block:
    enabled: true
    targetProvider: opencode-go
    peakWindow:
      days: [1, 2, 3, 4, 5]
      hourRanges: [[9, 12], [14, 18]]
      weekendOffPeak: true

边界

  • 只拦对话模型请求:agent/request 覆盖 agent loop 的正常对话;compaction 等走 ctx.llm.stream 的路径不拦。
  • targetProvider 必须是 DSH 已注册适配器路由,否则切换后以 NO_ADAPTER 失败。
  • days 用 JS getUTCDay 序号,1..5 为周一..周五;时区判定纯 UTC+8 数学换算,与系统时区无关。

要求与开发

  • 标准形态的 dsh host 单半身插件:host 在 agent/request waterfall 里拦截并切换/阻止,设置全部经 cordis 配置文件注入,见上方配置表,不提供界面配置 UI。

  • 无构建:lib/index.js 为源码即产物,改完即用。

  • 纯函数 isPeakBeijing / isOfficial / decidelib/index.js 导出,冒烟测试:

    node scripts/smoke.mjs

License

MIT