Skip to content
dsh.fish
Bundle

dsh-status-bar

Live execution status bar for the DeepSeek Harness web GUI: real-time activity (thinking tail, running tools, elapsed time) plus event-driven LLM achievement summaries with expandable structured detail reports.

Source
OuYangxin12
License
MIT
Updated
Updated 2 days ago

Readme

# dsh-status-bar

**English** | [中文](#中文)

A live execution status bar plugin for the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) web GUI. While the agent works on a long task, a compact strip above the composer shows what it is doing right now — and an LLM-distilled achievement line tells you what it has accomplished, expandable into a structured progress report.

---

<a id="中文"></a>

## 中文

DSH Web GUI 的执行状态栏插件。agent 执行长任务时,输入框上方的状态栏实时显示它在做什么,并由 LLM 蒸馏出一行「当前成果」,可展开查看结构化详细报告。

```
┌───────────────────────────────────────────────┐
│ [成果] 正在修复构建错误,已定位两处语法问题  14:32 ▾ │  ← 一行速览(可展开)
│ ─────────────────────────────────────────── │
│ 已完成:                                       │  ← 展开态:结构化详细报告
│ - 读取 3 个配置文件,定位到 JSON 语法错误          │
│ - 修复 lib/config.ts 两处语法错误                │
│ 正在进行:                                     │
│ - 运行 pnpm build 验证修复                      │
│ 下一步:                                       │
│ - 构建通过后运行测试套件                         │
│ 问题/风险:                                    │
│ - 无                          生成于 14:32 [刷新] │
└───────────────────────────────────────────────┘
│ ⏳ 03:12 · T1/S2 · bash · pnpm build            │  ← 过程行
│ 💭 ……先检查 tsconfig 的引用路径再重试……           │  ← 思考尾部(悬停看全文)
```

空闲且无总结时渲染为空,不占布局。

### 刷新是事件驱动的,不是固定轮询

总结节奏自适应任务的真实进度:

| 触发 | 行为 |
|---|---|
| 工具调用/结果、step 边界 | 短去抖(1~2.5s)后总结,爆发期自动合并 |
| 长时间思考(只有 token 流) | 兜底上限(默认 30s)保底更新 |
| turn 开始 | ~3s 快速首报,短任务也能有一读 |
| **用户新输入 / steering** | **立即强制刷新**单行总结 |
| turn 结束 | 强制刷新单行 + 全新详细报告 |
| 详情页展开中 | 新进展出现后自动跟随刷新(8s 去抖) |

### 安装

**方式一:plugin CLI(推荐)**

```sh
dsh plugin --profile web add github:OuYangxin12/dsh-status-bar
```

重启 `dsh web` 即生效。

**方式二:任意 profile 手动挂载**

把仓库软链进 profile 的 `node_modules`,再 insert:

```sh
ln -sfn /path/to/dsh-status-bar ~/.dsh/profiles/<profile>/node_modules/dsh-status-bar
```

```yaml
# ~/.dsh/profiles/<profile>/cordis.patch.yml
- insert:
    - id: dsh-status-bar
      name: 'dsh-status-bar'
```

> 注意:insert 必须用**包名**(client bundle 扫描按 `require.resolve(<名字>/package.json)` 解析包根),绝对路径文件名只能挂载 host 半。

### 配置(环境变量,均可选)

| 变量 | 默认 | 说明 |
|---|---|---|
| `DSH_STATUS_BAR_PROVIDER` / `DSH_STATUS_BAR_MODEL` | 第一个已注册 provider 中优先 "flash/mini/lite" 等便宜模型 | 总结用的模型路由 |
| `DSH_STATUS_BAR_MIN_GAP_MS` | 10000 | 两次自动总结的最小间隔(强制触发不受限) |
| `DSH_STATUS_BAR_MAX_AGE_MS` | 30000 | 连续思考流下的兜底刷新上限 |
| `DSH_STATUS_BAR_MAX_TOKENS` | 160 | 单行总结的输出上限 |
| `DSH_STATUS_BAR_DETAIL_MAX_TOKENS` | 700 | 详细报告的输出上限 |

### HTTP 面(调试用)

- `GET /status-bar/stream` — SSE,NDJSON 帧(summary/detail/活动状态)
- `GET /status-bar/state` — 当前全部会话总结快照
- `GET /status-bar/detail?session=<id>[&force=1]` — 请求生成/刷新详细报告(结果经 SSE 推送)

### 工作原理

- **数据源(client)**:插件注册进 `conversation.input.dock` 插槽(与内置 GoalBar 同机制),
  直接读取框架传入的 `ConversationSnapshot` 点时快照——`partial.blocks`(含 `reasoning`
  思考块)、`runningCalls`、`running` 都是现成可观察数据,浏览器半零 RPC
- **数据源(host)**:`ctx.on('session/event')` 把工具调用/结果、思考/文本尾部、turn/step
  边界聚合为滚动活动日志(上限 40 条)
- **总结**:事件驱动调度(去抖 + 最小间隔 + 兜底上限 + 强制触发),`ctx.llm.stream()`
  一次性调用(手写 message 字面量,无 @deepseek-ai 运行时依赖),结果经 SSE 广播
- **双面插件**:`lib/index.js` 为 host 半(纯 ESM JS,无构建);`lib/client.js` 为浏览器半
  (esbuild 打包成 `window.__ModuleLoader__` 工厂闭包格式,构建产物已提交,安装免构建)

### 开发

```sh
node build.mjs      # 重建浏览器 bundle(esbuild 自动从 DSH checkout 解析)
node smoke-test.mjs # host 半冒烟测试(mock ctx + fake LLM,六项断言)
```

改浏览器半后 `node build.mjs` + 刷新页面即可;改 host 半需重启 DSH 进程。

## License

[MIT](LICENSE)

Install

dsh plugin --profile web add github:OuYangxin12/dsh-status-bar#1129baba726f9608a6bb77434d3e005f8c3125ae

Profile: web

Source