dsh-stats-expand
DeepSeek Harness Web 插件:会话底部统计条单行完整显示。
功能
- 官方统计条(轮/步 · LLM/工具时长 · 首 token 平均/吐字速度 · 缓存命中 · 输入/输出 tokens)
被 --dsh-chat-content-width:748px 限宽 + nowrap + ellipsis 截成单行省略号,完整内容 只能 hover 看 Tooltip;本插件默认解除限宽,单行完整铺满对话区宽度。
- 点击统计条可在 单行完整 / 官方截断 之间切换,偏好存
localStorage["dsh-stats-expand:expanded"]。 - StatsLine 根类名是 css-module hash(升级会变),运行时从 DSH 注入的
<style data-plugin-css="@deepseek-ai/dsh-client-ui-conversation/StatsLine.module.css"> 标签解析,解析失败退回已知 hash 兜底。
- 调试口:DevTools 里
__dshStatsExpand(expanded/toggle()/sync()/rootClass())。
安装
npm install # 装 esbuild(devDependency,仅构建需要)
npm run build # src/client.js → lib/client.js
npm run link-profilelink-profile 自动完成:dependencies 加 link: 依赖、dsh.profile.bundles 追加、 profile 里 pnpm install。然后手动重启 dsh web(约定:不自动重启)生效。
目录结构
src/client.js # 浏览器端源码(手写 ModuleLoader 格式,client 插件逻辑所在地)
lib/index.js # 宿主端空 apply(host 插件逻辑写这里,参考 dsh-image-read)
lib/client.js # 浏览器端构建产物(npm run build 生成)
package.json # 三要素:dsh.bundle.patch + dsh.client 声明 + exports["./client"]
cordis.patch.yml # bundle patch:insert 进 profile 插件树
build.mjs # 构建脚本(esbuild)
link-profile.mjs # 链接安装脚本开发参考
- 项目级 skill
dsh-plugin-dev:SKILL.md + references/(manifest 三要素、client half、
paste/reference 链、pnpm 陷阱)。
- 参考实现:
dsh-text-collapse(client 插件完整模板)、dsh-image-read(host 工具插件)、
~/.dsh/profiles/web/node_modules/dsh-chat-timeline(手写 client bundle)。
- DSH 内部 API 权威来源:
/opt/homebrew/lib/node_modules/@deepseek-ai/dsh/(已安装版本)。