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-bili-config

v0.1.0

Published

Graphical config panel for the billion-context (ACP) compression engine inside DeepSeek Harness: tune fold thresholds from the plugin page, watch live usage / pending-compress / cache-hit / drift metrics, and apply preset profiles — no more hand-editing a

Downloads

380

Readme

dsh-bili-config

简体中文 | English

给 billion-context(ACP 上下文压缩引擎)做一个图形化配置面板:DSH 插件页里调阈值、看实时压缩指标、一键档位——不用再手啃 328KB 的配置参考文档。

为什么需要它

billion-context 是 DSH 生态里装得最多的上下文压缩插件,但它的默认阈值非常保守:

  • 增长门 nudgeGrowthTokens 默认 50000 —— 会话每步攒的可压缩量到不了这个数,折叠就永远不触发;
  • 压力线 maxContextLimit 默认 75% —— 上下文占用不到窗口 3/4,同样不压。

于是长会话每一步都把全部历史原样重传(实测单会话 195 次 forward、每分钟 3–5 次、单请求 1.3–1.9 MiB),而压缩引擎一直在"待命"。要让它真正开工,只能去改 ~/.config/billion-context/billion-context.json —— 但那份 CONFIGURATION.zh-CN.md 有 32 万字,普通用户根本不知道从哪下手。

本插件把这件事变成三次点击:设置 → 插件 → bili 压缩 → 选档位。

功能

  • 三个档位(只动白名单键,其它配置分毫不动):

| 档位 | 改什么 | 适合 | | --- | --- | --- | | 保守 | 只钉 reconcile=repair,其余用引擎默认 | 想先观察的人 | | 均衡(推荐) | 增长门 50000→25000 | 大多数会话 | | 激进 | 增长门 20000 + 压力线 50% | 超长会话、高频重发 |

  • 实时指标(解析 bili.log 尾部 512KB 窗口,5 秒刷新):上下文占用%、待压缩积压、增长量、缓存命中率、折叠漂移次数、退化折叠警告、实际压缩次数与最近一次压缩的压缩比
  • 逐键微调:白名单键带说明文字的表单
  • 写入即热生效:billion-context 按请求合并配置,改完不用重启
  • 每次写入自动备份(.bak-<时间戳>,保留最近 10 份),支持一键回看
  • 附带 bili_config 工具:模型侧也能只读查询指标("帮我看看压缩为什么没触发")

安装

dsh plugin --profile web add dsh-bili-config

DSH Desktop 桌面端请在应用内 设置 → 插件 里安装(桌面端 profile 归应用管理)。

要求:DSH 0.2.1-rc.2(engines.dsh 声明),billion-context 任意近期版本(独立进程,经配置文件交互,不依赖其内部 API)。

与其它插件的关系

  • @indexyz/dsh-autocompact:管的是 DSH 原生 compaction(/compact 链路、dsh-compaction 服务)的触发阈值;本插件管的是 billion-context 的 ACP fold(独立代理、~/.config/billion-context/)。两者是"客厅空调遥控器"和"卧室空调遥控器",互不干涉,可以同装。唯一的交集是 UI 上提醒:两条管线都调太狠会过度压缩丢信息。
  • dsh-context-governor:只读观测通用上下文/费用;本插件专写 billion-context 配置,两者互补。

内置插件冲突检测

插件页会自动检查 profile 里已安装的插件,如果发现已知会与本插件或 billion-context 打架的,会在面板顶部逐条提示,格式如:

插件兼容性提示(已检查 18 个已装插件)
⚠️ mosaic-memory-compress 与 billion-context 冲突(冲突):就地对话压缩与 ACP fold 同域竞争……
⚠️ dsh-sieve 与 DSH 0.2.1-rc.2 宿主(不兼容):engines 锁 0.2.1-alpha.1 线,安装会加载失败。

检测分级:

  • 冲突:同装互相破坏(如 mosaic-memory-compress 与 billion-context 双压缩引擎互相覆盖状态)
  • 不兼容:版本/引擎面不匹配,装不上或加载失败(如 dsh-sieve)
  • 功能重叠:不报错但重复/空转(如 dsh-cost-meter 与 whale-widget 同域)

知识库位于 lib/compatibility.mjs(COMPAT 表),只收录有实际依据的条目;未收录的插件一律不猜"没冲突"。模型侧也可以用 bili_config 工具 action=compat 查询。

安全设计

  1. 键级合并,绝不整文件覆盖 —— billion-context 两天升了三版(0.1.202→0.1.204),键面在变;用户配置里我们不认识的键一律原样保留。
  2. 白名单:本插件只允许修改 WHITELIST(lib/config.mjs)里声明的 17 个键,且有类型/范围校验;越界写入请求整体拒绝、原文件不动。
  3. 原子写:临时文件 + rename,中途断电不留半截文件。
  4. 自动备份 + 数量上限:每次写入前备份,最多保留 10 份。
  5. UI 读取与模型工具都是本机文件交互,不碰 billion-context 的管理面 API(/__bili__/ 有信任围栏,直接访问 403)。

开发

npm run check   # node --check 三个入口
npm test        # 离线测试:键级合并/未知键保留/备份清理/日志解析(用真实日志行做夹具)

无构建步骤、无运行时依赖。

已知边界

  • nudge idle 行只在引擎真的评估过压缩时机时出现;刚启动的会话里"待压缩积压"可能显示 —。
  • bili.log 10MB 自动轮转,指标只反映尾部 512KB 窗口(最近几十轮),不是全历史统计。
  • 档位"命中"的判断是逐键精确比对;手动改过任何一个档位键,档位就显示"(自定义)"。

License

MIT