DeepSeek Harness 插件

dsh-statusbar

VSCode-like bottom status bar for DSH Web: conversation token usage, host CPU/memory with Linux-style colored char bars, clock, and a public API for other plugins.(英文原文)

跳到安装方式

来源信息

GitHub 仓库
Small-Miao/dsh-statusbar
最近更新
2026年8月15日
分类
记忆
GitHub stars
2
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/Small-Miao/dsh-statusbar
插件名:dsh-statusbar
作者:Small-Miao

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器4 个文件
README.zh.md来源说明 · 只读预览
README 语言

dsh-statusbar

DeepSeek Harness Web 打造的 VSCode 风格底部状态条:展示当前对话用量、宿主机 CPU/内存,以及实时生成速率——每个项目都可配置。

!DSH Web !License ![Release](https://github.com/Small-Miao/dsh-statusbar/releases) ![Changelog](./CHANGELOG.md)

English | 简体中文

功能

  • 24px 底部状态条(shell.overlay 席位渲染);应用主框架预留底部空间,页面内容(侧栏设置、输入框)永不被遮挡
  • 内置项目(每一项都可单独配置,见[配置](#配置)):

- DSH 品牌标识(左侧) - ⧉ Tokens — 当前对话估算 Token(tokenMeter) - 7 轮 · 64 步 — 会话轮数 / 步数(sessionStats) - LLM 14m12s · 工具调用 48.4s — LLM / 工具调用累计耗时 - 首 token 平均 1.3s · 129 tok/s — 首 token 平均耗时与生成速率 - 缓存命中 97% — 提示词侧缓存命中率(tokenUsage) - 输入 7.4M tok · 输出 98.9K tok — 计费侧累计输入 / 输出 token - TPS 363 tok/s — 实时生成速率(liveTokenUsage,需安装 [dsh-live-stats])

- `CPU 20% []` — Linux 风格字符进度条(绿 → 黄 → 红渐变)
- `MEM 55% (8.2G/14.8G) []` — 内存占用 + 字符进度条

- 宿主机时钟

  • 隐藏输入框下方原有的统计行与 TPS 行(状态条已包含,避免重复)。
  • 每 2 秒轮询 /dsh-statusbar/snapshot?session=<id>

[dsh-live-stats]: https://github.com/zhu1090093659/dsh-web-ui

安装

前置条件:已安装 DSH 且存在 web profile(例如 dsh web 创建的默认 web profile)。

# 从 GitHub 仓库安装
dsh plugin --profile web add https://github.com/Small-Miao/dsh-statusbar

# 或通过 SSH(本机需已配置 GitHub SSH 访问)
dsh plugin --profile web add git@github.com:Small-Miao/dsh-statusbar.git

# 或本地开发目录
dsh plugin --profile web add /path/to/dsh-statusbar

该命令会在 profile 中执行 pnpm add,把插件安装到 ~/.dsh/profiles/web/node_modules, 并自动追加到 dsh.profile.bundles。然后重启 DSH,插件随启动自动挂载,刷新页面即可看到状态条。

> 手动安装(不用 dsh plugin):pnpm --dir ~/.dsh/profiles/web add <路径或地址> 同样可行—— > 本插件就是标准的 dsh.bundle 包。

配置

设置 → 状态栏:切换每个项目的显示与否、位置(左侧 / 右侧)与顺序 (数字越小越靠左),并提供「全部重置」按钮。

配置由宿主保存,持久化到 profile 组合目录旁的 dsh-statusbar-config.json。 HTTP 接口:GET /dsh-statusbar/snapshot?session=<id> 返回 { items, catalog, config }POST /dsh-statusbar/config 接受 { id, patch }patch{ visible?, align?, order? }, 传 null 表示清除)或 { resetAll: true }

给其他插件使用的公共 API

宿主侧暴露 statusbar Cordis 服务,其他宿主插件可以注册自己的条目——支持实时文本与字符进度条:

export function apply(ctx) {
  const statusbar = ctx.get('statusbar')
  if (statusbar === undefined) return   // 插件未安装时优雅降级
  ctx.effect(() => statusbar.registerItem({
    id: 'my.item',          // 必填,唯一
    order: 15,              // 排序,越小越靠左(用户可再配置)
    align: 'right',         // 'left' | 'right'
    label: () => '值',      // 静态字符串或惰性函数
    style: 'bar',           // 'text'(默认)| 'bar'
    progress: () => 62,     // 0-100,数字或惰性函数(bar 样式)
    barChar: '|',           // 可选,默认 '|'
    barTotal: 10,           // 可选,默认 10
    color: '#4fc1ff',       // 可选,标签颜色
    tooltip: '提示',        // 可选,悬浮文本
  }))
  // 另有:statusbar.updateItem(id, patch) / statusbar.removeItem(id) / statusbar.list()
}

注册新的数据源

如果你拥有一个实时值(自己的指标、服务读数、投影等),可以用 registerDataSourceprovide() 回调交给状态条,按自己的刷新节奏取数并渲染为条目(文本或字符进度条):

export function apply(ctx) {
  const statusbar = ctx.get('statusbar')
  if (statusbar === undefined) return
  ctx.effect(() => statusbar.registerDataSource({
    id: 'disk.usage',       // 必填,唯一——同时也是配置项的 key
    order: 55,              // 默认位置
    align: 'right',         // 'left' | 'right'
    style: 'bar',           // 'text'(默认)| 'bar'
    barChar: '|',           // 可选,默认 '|'
    barTotal: 10,           // 可选,默认 10
    refreshMs: 5000,        // 可选,默认 2000——过期后宿主才会重新调用 provide()
    tooltip: '磁盘用量',
    provide: async () => ({ // 必填——宿主调用;返回最新值
      text: '磁盘 62%',
      progress: 62,         // 0-100,style 为 'bar' 时生效
      color: '#4fc1ff',     // 可选
      tooltip: '更新的提示',  // 可选,覆盖默认 tooltip
    }),
  }))
  // 另有:statusbar.removeDataSource(id)
}

数据源与内置条目完全一致:出现在状态条中,也能在「设置 → 状态栏」里开关 / 调整位置; provide() 较慢时,宿主会先渲染最近一次已知值。

开发

git clone https://github.com/Small-Miao/dsh-statusbar
dsh plugin --profile web add ./dsh-statusbar   # 或软链进 profile
  • lib/index.js — 宿主侧:statusbar 服务、/dsh-statusbar/* HTTP 路由、

node:os 采集 CPU/内存、会话投影(sessionStats / tokenUsage / liveTokenUsage)按会话缓存 4 秒。

  • lib/client.js — 浏览器侧(__ModuleLoader__ bundle):shell.overlay 中的状态条

settings.section 中的设置页。

布局说明

预留底部空间依赖应用主框架的哈希类名(当前 Web 构建为 .pI_x6G_frame)。 如果 Web 应用重新构建导致 CSS 哈希变化,请同步更新 lib/client.js 中的选择器。

许可证

[MIT](./LICENSE)