DSH Plugins Marketplace

DSH Plugins

Plugins

/

Development & Infrastructure

/

dsh-cache-hit-precision

v

dsh-cache-hit-precision

Manifest valid

Precise three-decimal cache-hit readout for the DeepSeek Harness (DSH) Web composer stats row. Refine the cache hit rate in the DSH Web stats row in place to three decimal places.

UI (client)hasBundlePatch

dsh-cache-hit-precision

中文 | English

CI License: MIT

一个 DeepSeek Harness(DSH)Web 插件:把底部 composer 统计行里的缓存命中率原位精化到三位小数(缓存命中 98% → 缓存命中 98.460%),并同步「Token 用量」弹窗与状态行中的同一读数。

不新增任何可见内容:插件在 composer dock 里占一个不可见的席位,读取与内置 统计 pill 相同的 tokenUsage 投影,只改写缓存命中率这一个读数——轮次、步数、 速度、总量,以及弹窗里的其余桶位(未缓存输入、缓存读取、缓存写入、输出)都 保持原样,也不改动任何布局尺寸。

效果

「Token 用量」弹窗与底部状态行中的缓存命中率被精化为 99.186%

弹窗中的「缓存命中」行与底部状态行(80.9M tok · 缓存命中 99.186%)都被 原位替换为三位小数读数,界面其余部分与内置渲染完全一致。

为什么需要三位小数

DSH 内置的格式化器有一条好规则:不把部分命中向上舍入成 100%——整数读数 会失真时,它会自动加宽小数位,直到那一份未命中可见。本插件把同样的承诺 建立在三位小数的起点上,而不是整数起点,让命中率的变化在日常使用中就 能被看见:

缓存读取 / 计费输入内置显示本插件显示
123 / 112311%10.953%
9995 / 1000099.95%99.950%
999999 / 100000099.9999%99.9999%
9995 / 9995100%100.000%

分母与 DSH 完全一致,即三个互不重叠的输入侧计费桶之和: uncachedInputTokens + cacheReadTokens + cacheWriteTokens。因此两者只可能在 精度上不同,不会在口径上不同。舍入采用精确整数运算的半进位,百分比 不会带上浮点误差。

工作原理

精化是即时的:内置弹窗首帧以整数精度渲染,因此每当锚点新挂载或 React 原位 改写读数时,插件都在 mutation observer 自己的微任务里重新精化——在 React 提交之后、浏览器绘制之前完成,低精度首帧不会被看到;其余变更仍按 burst 结束后的一次去抖重扫处理。

插件锚定统计行的 data-composer-stats 容器、会话用量弹窗行列表的 data-session-stats-usage 属性,以及内置的两种语言文案,因此能跨次要的 主题与布局调整继续工作。

安装

按包名安装(推荐) —— 包已发布到 npm。桌面端打开「设置 → 插件」,点 「添加插件」,直接填包名 dsh-cache-hit-precision 再点「安装」;命令行等价于:

dsh plugin --profile web add dsh-cache-hit-precision

刚发布的版本在 npmmirror 镜像上可能有几分钟延迟;安装对话框和 CLI 都会在 官方源与镜像之间自动回退,CLI 也可以用 --registry 显式指定源。

按目录安装 —— 也可以从源码目录安装。先把仓库克隆到本地:

git clone https://github.com/vrvtvy/dsh-cache-hit-precision.git

桌面端「设置 → 插件 → 添加插件」填克隆目录的绝对路径;命令行:

dsh plugin --profile web add /absolute/path/to/dsh-cache-hit-precision

路径必须是绝对路径;正斜杠在各平台都可用(Windows 用 D:/…,其它平台用 /home/you/…)。安装完成后重启 DSH。

桌面端独占管理自己的 profile,因此命令行会拒绝 --profile desktop;那种情况 请改用「设置 → 插件」。

兼容性

面向 DSH 0.2.0-rc.*(已在 0.2.0-rc.2 上验证)。该版本的统计行由 @deepseek-ai/dsh-client-ui-chat 的 StatsPills 渲染。若上游重做了相关 结构或文案,可能需要更新本插件。

每轮用量面板(data-turn-usage-details)被有意排除在外:它的缓存命中率是 另一个口径——单轮而非整个会话——改写成 pill 的数字反而会误报。

DSH 0.1.x 的统计行实现不同,本版本不支持。

说明

  • 不请求网络,不上传任何数据。
  • 只注册一个 slot 条目,不注入样式;卸载后不留残留。

测试

npm test

致谢与许可

基于 Cheng-cheng9669 的 dsh-cache-precision 延续维护,适配 DSH 0.2。以 MIT 许可证发布。

Comments

Loading…

From the same category

awesome-dsh-plugin

by awesome-dsh-plugin

A curated list of plugins for DeepSeek Harness (dsh) · DeepSeek Harness 插件精选列表

Development & Infrastructure

★ 18.3k

CC0-1.0

Python

Oct 10, 2026

Index only — not installable

by 0xsline

DeepSeek Harness (DSH) ecosystem: curated plugins, tools, and infrastructure from dsh-external/hub and the public dsh-plugin topic.

Development & Infrastructure

★ 1.2k

CC0-1.0

Python

Oct 10, 2026

Index only — not installable

by pax-beehive

Open-source CLI, schemas, resolver, and DSH agent tools for DSH Plugin Hub

Development & Infrastructure

★ 450

MIT

TypeScript

Oct 6, 2026

Index only — not installable

by xiajiajun516

DeepSeek Harness (DSH) backup & restore plugin — export, import, migrate and sync your complete DSH configuration, plugins, MCP servers, skills and workspace. One-click migration to another machine.

Development & InfrastructureManifest valid

★ 176

MIT

TypeScript

Oct 8, 2026

dsh plugin --profile web add dsh-config-manager

by yjh051108

推荐组件(非必须):DeepSeek Harness 运行时注入器;已随 dsh-routing-suite 单仓库化保留,本仓库继续维护/发布。

Development & InfrastructureManifest valid

★ 164

TypeScript

Sep 18, 2026

dsh plugin --profile web add @dsh-external/dsh-super-injector

by jigjoy-ai

A CLI that turns a goal into a pull request - and a sandbox for testing concurrent AI coding agents on the Mozaik runtime.

Development & Infrastructure

★ 124

MIT

TypeScript

Oct 2, 2026

Index only — not installable